diff options
1761 files changed, 90985 insertions, 89317 deletions
diff --git a/.gitignore b/.gitignore index 60d7dd4640..abbda17ee2 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ platform/osx/logo.h platform/windows/logo.h platform/x11/logo.h drivers/gles2/shaders/*.h +drivers/gles3/shaders/*.h modules/register_module_types.cpp core/version.h core/method_bind.inc diff --git a/.travis.yml b/.travis.yml index d76fcca791..12b49f4c07 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,10 +11,10 @@ os: - osx env: - - GODOT_TARGET=iphone + #- GODOT_TARGET=iphone - GODOT_TARGET=osx - GODOT_TARGET=x11 - - GODOT_TARGET=android + #- GODOT_TARGET=android - GODOT_TARGET=windows matrix: @@ -69,8 +69,8 @@ addons: before_script: - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; brew install scons; fi - if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "$GODOT_TARGET" = "android" ]; then - brew update; travis_wait 20 brew install -v android-sdk; - travis_wait 20 brew install -v android-ndk | grep -v "inflating:" | grep -v "creating:"; + brew update; brew install -v android-sdk; + brew install -v android-ndk | grep -v "inflating:" | grep -v "creating:"; export ANDROID_HOME=/usr/local/opt/android-sdk; export ANDROID_NDK_ROOT=/usr/local/opt/android-ndk; fi diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 887fe93779..fc088ab14b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,6 +54,30 @@ Also try to make commits that bring the engine from one stable state to another This git style guide has some good practices to have in mind: https://github.com/agis-/git-style-guide +#### Format your commit logs with readability in mind + +The way you format your commit logs is quite important to ensure that the commit history and changelog will be easy to read and understand. A git commit log is formatted as a short title (first line) and an extended description (everything after the first line and an empty separation line). + +The short title is the most important part, as it is what will appear in the `shortlog` changelog (one line per commit, so no description shown) or in the GitHub interface unless you click the "expand" button. As the name tells it, try to keep that first line relatively short (ideally <= 50 chars, though it's rare to be able to tell enough in so few characters, so you can go a bit higher) - it should describe what the commit does globally, while details would go in the description. Typically, if you can't keep the title short because you have too much stuff to mention, it means that you should probably split your changes in several commits :) + +Here's an example of a well-formatted commit log (note how the extended description is also manually wrapped at 80 chars for readability): + +``` +Prevent French fries carbonization by fixing heat regulation + +When using the French fries frying module, Godot would not regulate the heat +and thus bring the oil bath to supercritical liquid conditions, thus causing +unwanted side effects in the physics engine. + +By fixing the regulation system via an added binding to the internal feature, +this commit now ensures that Godot will not go past the ebullition temperature +of cooking oil under normal atmosheric conditions. + +Fixes #1789, long live the Realm! +``` + +*Note:* When using the GitHub online editor (or worse, the drag and drop feature), *please* edit the commit title to something meaningful. Commits named "Update my_file.cpp" will not be accepted. + Thanks! The Godot development team diff --git a/ISSUE_TEMPLATE b/ISSUE_TEMPLATE deleted file mode 100644 index ee78c6c4f6..0000000000 --- a/ISSUE_TEMPLATE +++ /dev/null @@ -1,10 +0,0 @@ -**Operating system or device - Godot version:** - - -**Issue description** (what happened, and what was expected): - - -**Steps to reproduce:** - - -**Link to minimal example project** (optional but very welcome): diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md new file mode 100644 index 0000000000..fcaaca6278 --- /dev/null +++ b/ISSUE_TEMPLATE.md @@ -0,0 +1,19 @@ +vvv Remove me vvv + +*NOTE:* If you using the current master branch / 3.0-alpha version, do not that +breakage is *expected*. Projects from Godot 2.x are expected not to work. Please +wait for the upcoming stabilisation period to report bugs regarding recent changes. + +^^^ Remove me ^^^ + + +**Operating system or device - Godot version:** + + +**Issue description** (what happened, and what was expected): + + +**Steps to reproduce:** + + +**Link to minimal example project** (optional but very welcome): diff --git a/LICENSE.md b/LICENSE.md index 2f3e879c8c..a983b20863 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -3,7 +3,7 @@ ************************************************************************ - Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. + Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/SConstruct b/SConstruct index 04c648c283..a1af763031 100644 --- a/SConstruct +++ b/SConstruct @@ -1,3 +1,4 @@ + #!/usr/bin/env python EnsureSConsVersion(0, 14) @@ -144,7 +145,6 @@ opts.Add('vsproj', "Generate Visual Studio Project. (yes/no)", 'no') # Thirdparty libraries opts.Add('builtin_enet', "Use the builtin enet library (yes/no)", 'yes') opts.Add('builtin_freetype', "Use the builtin freetype library (yes/no)", 'yes') -opts.Add('builtin_glew', "Use the builtin glew library (yes/no)", 'yes') opts.Add('builtin_libmpcdec', "Use the builtin libmpcdec library (yes/no)", 'yes') opts.Add('builtin_libogg', "Use the builtin libogg library (yes/no)", 'yes') opts.Add('builtin_libpng', "Use the builtin libpng library (yes/no)", 'yes') @@ -349,6 +349,9 @@ if selected_platform in platform_list: if (env['verbose'] == 'no'): methods.no_verbose(sys, env) + if (True): # FIXME: detect GLES3 + env.Append( BUILDERS = { 'GLES3_GLSL' : env.Builder(action = methods.build_gles3_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) + Export('env') # build subdirs, the build order is dependent on link order. @@ -358,7 +361,6 @@ if selected_platform in platform_list: SConscript("scene/SCsub") SConscript("tools/SCsub") SConscript("drivers/SCsub") - SConscript("bin/SCsub") SConscript("modules/SCsub") SConscript("main/SCsub") diff --git a/bin/SCsub b/bin/SCsub deleted file mode 100644 index 52f7e3bb39..0000000000 --- a/bin/SCsub +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/python - -Import('env') -Export('env') - -SConscript('tests/SCsub') diff --git a/bin/tests/test_detailer.cpp b/bin/tests/test_detailer.cpp deleted file mode 100644 index 5dba7c3f72..0000000000 --- a/bin/tests/test_detailer.cpp +++ /dev/null @@ -1,217 +0,0 @@ -/*************************************************************************/ -/* test_detailer.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "test_detailer.h" -#include "servers/visual_server.h" -#include "os/main_loop.h" -#include "math_funcs.h" -#include "print_string.h" -#include "geometry.h" -#include "quick_hull.h" -namespace TestMultiMesh { - - -class TestMainLoop : public MainLoop { - - RID instance; - RID camera; - RID viewport; - RID light; - RID mesh; - RID scenario; - -#define MULTIMESH_COUNT 1500 - - float ofs_x,ofs_y; - bool quit; -public: - - - virtual void _update_qh() { - - VisualServer *vs=VisualServer::get_singleton(); - Vector<Vector3> vts; -/* - - static const int s = 20; - for(int i=0;i<s;i++) { - Matrix3 rot(Vector3(0,1,0),i*Math_PI/s); - - for(int j=0;j<s;j++) { - Vector3 v; - v.x=Math::sin(j*Math_PI*2/s); - v.y=Math::cos(j*Math_PI*2/s); - - vts.push_back( rot.xform(v*2 ) ); - } - }*/ - /* - Math::seed(0); - for(int i=0;i<50;i++) { - - vts.push_back( Vector3(Math::randf()*2-1.0,Math::randf()*2-1.0,Math::randf()*2-1.0).normalized()*2); - }*/ - /* - vts.push_back(Vector3(0,0,1)); - vts.push_back(Vector3(0,0,-1)); - vts.push_back(Vector3(0,1,0)); - vts.push_back(Vector3(0,-1,0)); - vts.push_back(Vector3(1,0,0)); - vts.push_back(Vector3(-1,0,0));*/ -/* - vts.push_back(Vector3(1,1,1)); - vts.push_back(Vector3(1,-1,1)); - vts.push_back(Vector3(-1,1,1)); - vts.push_back(Vector3(-1,-1,1)); - vts.push_back(Vector3(1,1,-1)); - vts.push_back(Vector3(1,-1,-1)); - vts.push_back(Vector3(-1,1,-1)); - vts.push_back(Vector3(-1,-1,-1)); -*/ - - - DVector<Plane> convex_planes = Geometry::build_cylinder_planes(0.5,0.7,4,Vector3::AXIS_Z); - Geometry::MeshData convex_data = Geometry::build_convex_mesh(convex_planes); - vts=convex_data.vertices; - - Geometry::MeshData md; - Error err = QuickHull::build(vts,md); - print_line("ERR: "+itos(err)); - - vs->mesh_remove_surface(mesh,0); - vs->mesh_add_surface_from_mesh_data(mesh,md); - - - - //vs->scenario_set_debug(scenario,VS::SCENARIO_DEBUG_WIREFRAME); - - /* - RID sm = vs->shader_create(); - //vs->shader_set_fragment_code(sm,"OUT_ALPHA=mod(TIME,1);"); - //vs->shader_set_vertex_code(sm,"OUT_VERTEX=IN_VERTEX*mod(TIME,1);"); - vs->shader_set_fragment_code(sm,"OUT_DIFFUSE=vec3(1,0,1);OUT_GLOW=abs(sin(TIME));"); - RID tcmat = vs->mesh_surface_get_material(test_cube,0); - vs->material_set_shader(tcmat,sm); - */ - - } - - virtual void input_event(const InputEvent& p_event) { - - if (p_event.type==InputEvent::MOUSE_MOTION && p_event.mouse_motion.button_mask&4) { - - ofs_x+=p_event.mouse_motion.relative_y/200.0; - ofs_y+=p_event.mouse_motion.relative_x/200.0; - } - if (p_event.type==InputEvent::MOUSE_BUTTON && p_event.mouse_button.pressed && p_event.mouse_button.button_index==1) { - - QuickHull::debug_stop_after++; - _update_qh(); - } - if (p_event.type==InputEvent::MOUSE_BUTTON && p_event.mouse_button.pressed && p_event.mouse_button.button_index==2) { - - if (QuickHull::debug_stop_after>0) - QuickHull::debug_stop_after--; - _update_qh(); - } - - - } - - virtual void request_quit() { - - quit=true; - } - - - - virtual void init() { - - VisualServer *vs=VisualServer::get_singleton(); - - - mesh = vs->mesh_create(); - - scenario = vs->scenario_create(); - - QuickHull::debug_stop_after=0; - _update_qh(); - - instance = vs->instance_create2(mesh,scenario); - - camera = vs->camera_create(); - - - vs->camera_set_perspective( camera, 60.0,0.1, 100.0 ); - viewport = vs->viewport_create(); - vs->viewport_attach_camera( viewport, camera ); - vs->viewport_attach_to_screen(viewport); - vs->viewport_set_scenario( viewport, scenario ); - - vs->camera_set_transform(camera, Transform( Matrix3(), Vector3(0,0,2 ) ) ); - - RID lightaux = vs->light_create( VisualServer::LIGHT_DIRECTIONAL ); - //vs->light_set_color( lightaux, VisualServer::LIGHT_COLOR_AMBIENT, Color(0.3,0.3,0.3) ); - light = vs->instance_create2( lightaux,scenario ); - vs->instance_set_transform(light,Transform(Matrix3(Vector3(0.1,0.4,0.7).normalized(),0.9))); - - ofs_x=0; - ofs_y=0; - quit=false; - } - - virtual bool idle(float p_time) { - return false; - } - - virtual bool iteration(float p_time) { - - VisualServer *vs=VisualServer::get_singleton(); - - Transform tr_camera; - tr_camera.rotate( Vector3(0,1,0), ofs_y ); - tr_camera.rotate( Vector3(1,0,0),ofs_x ); - tr_camera.translate(0,0,10); - - vs->camera_set_transform( camera, tr_camera ); - - return quit; - } - virtual void finish() { - - } - -}; - -MainLoop* test() { - - return memnew(TestMainLoop); - -} - -} diff --git a/bin/tests/test_detailer.h b/bin/tests/test_detailer.h deleted file mode 100644 index 597e088caf..0000000000 --- a/bin/tests/test_detailer.h +++ /dev/null @@ -1,44 +0,0 @@ -/*************************************************************************/ -/* test_detailer.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef TEST_MULTIMESH_H -#define TEST_MULTIMESH_H - -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ -#include "os/main_loop.h" - -namespace TestMultiMesh { - -MainLoop* test(); - -} - - -#endif diff --git a/bin/tests/test_misc.cpp b/bin/tests/test_misc.cpp deleted file mode 100644 index 9d7adc3573..0000000000 --- a/bin/tests/test_misc.cpp +++ /dev/null @@ -1,499 +0,0 @@ -/*************************************************************************/ -/* test_misc.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "test_misc.h" -#include "servers/visual_server.h" -#include "os/main_loop.h" -#include "math_funcs.h" -#include "print_string.h" - - -namespace TestMisc { - -struct ConvexTestResult -{ - - Vector3 edgeA[2]; - Vector3 edgeB[2]; - bool valid; - Vector3 contactA; - Vector3 contactB; - Vector3 contactNormal; - float depth; - - /* - Vector3 contactA; - Vector3 contactB; - Vector3 contactNormal; - Vector3 contactX; - Vector3 contactY; - Vector3 edgeA[2]; - Vector3 edgeB[2]; - float depth; - bool valid; - bool isEdgeEdge; - bool needTransform; - neBool ComputerEdgeContactPoint(ConvexTestResult & res); - neBool ComputerEdgeContactPoint2(float & au, float & bu); - void Reverse() - { - neSwap(contactA, contactB); - contactNormal *= -1.0f; - }*/ - bool ComputerEdgeContactPoint2(float & au, float & bu); -}; - - - -bool ConvexTestResult::ComputerEdgeContactPoint2(float & au, float & bu) -{ - float d1343, d4321, d1321, d4343, d2121; - float numer, denom; - - Vector3 p13; - Vector3 p43; - Vector3 p21; - Vector3 diff; - - p13 = (edgeA[0]) - (edgeB[0]); - p43 = (edgeB[1]) - (edgeB[0]); - - if ( p43.length_squared() < CMP_EPSILON2 ) - { - valid = false; - goto ComputerEdgeContactPoint2_Exit; - } - - p21 = (edgeA[1]) - (edgeA[0]); - - if ( p21.length_squared()<CMP_EPSILON2 ) - { - valid = false; - goto ComputerEdgeContactPoint2_Exit; - } - - d1343 = p13.dot(p43); - d4321 = p43.dot(p21); - d1321 = p13.dot(p21); - d4343 = p43.dot(p43); - d2121 = p21.dot(p21); - - denom = d2121 * d4343 - d4321 * d4321; - - if (ABS(denom) < CMP_EPSILON) - { - valid = false; - - goto ComputerEdgeContactPoint2_Exit; - } - - numer = d1343 * d4321 - d1321 * d4343; - au = numer / denom; - bu = (d1343 + d4321 * (au)) / d4343; - - if (au < 0.0f || au >= 1.0f) - { - valid = false; - } - else if (bu < 0.0f || bu >= 1.0f) - { - valid = false; - } - else - { - valid = true; - } - { - Vector3 tmpv; - - tmpv = p21 * au; - contactA = (edgeA[0]) + tmpv; - - tmpv = p43 * bu; - contactB = (edgeB[0]) + tmpv; - } - - diff = contactA - contactB; - - depth = Math::sqrt(diff.dot(diff)); - - return true; - -ComputerEdgeContactPoint2_Exit: - - return false; -} - -struct neCollisionResult { - - float depth; - bool penetrate; - Matrix3 collisionFrame; - Vector3 contactA; - Vector3 contactB; -}; - - -struct TConvex { - - float radius; - float half_height; - float CylinderRadius() const { return radius; } - float CylinderHalfHeight() const { return half_height; } -}; - -float GetDistanceFromLine2(Vector3 v, Vector3 & project, const Vector3 & pointA, const Vector3 & pointB) -{ - Vector3 ba = pointB - pointA; - - float len = ba.length(); - - if (len<CMP_EPSILON) - ba=Vector3(); - else - ba *= 1.0f / len; - - Vector3 pa = v - pointA; - - float k = pa.dot(ba); - - project = pointA + ba * k; - - Vector3 diff = v - project; - - return diff.length(); -} - -void TestCylinderVertEdge(neCollisionResult & result, Vector3 & edgeA1, Vector3 & edgeA2, Vector3 & vertB, - TConvex & cA, TConvex & cB, Transform & transA, Transform & transB, bool flip) -{ - Vector3 project; - - float dist = GetDistanceFromLine2(vertB,project, edgeA1, edgeA2); - - float depth = cA.CylinderRadius() + cB.CylinderRadius() - dist; - - if (depth <= 0.0f) - return; - - if (depth <= result.depth) - return; - - result.penetrate = true; - - result.depth = depth; - - if (!flip) - { - result.collisionFrame.set_axis(2,(project - vertB).normalized()); - - result.contactA = project - result.collisionFrame.get_axis(2) * cA.CylinderRadius(); - - result.contactB = vertB + result.collisionFrame.get_axis(2) * cB.CylinderRadius(); - } - else - { - - result.collisionFrame.set_axis(2,(vertB - project).normalized()); - - result.contactA = vertB - result.collisionFrame.get_axis(2) * cB.CylinderRadius(); - - result.contactB = project + result.collisionFrame.get_axis(2) * cA.CylinderRadius(); - } -} - -void TestCylinderVertVert(neCollisionResult & result, Vector3 & vertA, Vector3 & vertB, - TConvex & cA, TConvex & cB, Transform & transA, Transform & transB) -{ - Vector3 diff = vertA - vertB; - - float dist = diff.length(); - - float depth = cA.CylinderRadius() + cB.CylinderRadius() - dist; - - if (depth <= 0.0f) - return; - - if (depth <= result.depth) - return; - - result.penetrate = true; - - result.depth = depth; - - result.collisionFrame.set_axis(2, diff * (1.0f / dist)); - - result.contactA = vertA - result.collisionFrame.get_axis(2) * cA.CylinderRadius(); - - result.contactB = vertB + result.collisionFrame.get_axis(2) * cB.CylinderRadius(); -} - -void Cylinder2CylinderTest(neCollisionResult & result, TConvex & cA, Transform & transA, TConvex & cB, Transform & transB) -{ - result.penetrate = false; - - Vector3 dir = transA.basis.get_axis(1).cross(transB.basis.get_axis(1)); - - float len = dir.length(); - -// bool isParallel = len<CMP_EPSILON; - -// int doVertCheck = 0; - - ConvexTestResult cr; - - cr.edgeA[0] = transA.origin + transA.basis.get_axis(1) * cA.CylinderHalfHeight(); - cr.edgeA[1] = transA.origin - transA.basis.get_axis(1) * cA.CylinderHalfHeight(); - cr.edgeB[0] = transB.origin + transB.basis.get_axis(1) * cB.CylinderHalfHeight(); - cr.edgeB[1] = transB.origin - transB.basis.get_axis(1) * cB.CylinderHalfHeight(); - -// float dot = transA.basis.get_axis(1).dot(transB.basis.get_axis(1)); - - if (len>CMP_EPSILON) - { - float au, bu; - - cr.ComputerEdgeContactPoint2(au, bu); - - if (cr.valid) - { - float depth = cA.CylinderRadius() + cB.CylinderRadius() - cr.depth; - - if (depth <= 0.0f) - return; - - result.depth = depth; - - result.penetrate = true; - - result.collisionFrame.set_axis(2, (cr.contactA - cr.contactB)*(1.0f / cr.depth)); - - result.contactA = cr.contactA - result.collisionFrame.get_axis(2) * cA.CylinderRadius(); - - result.contactB = cr.contactB + result.collisionFrame.get_axis(2) * cB.CylinderRadius(); - - return; - } - } - result.depth = -1.0e6f; - - int i; - - for (i = 0; i < 2; i++) - { - //project onto edge b - - Vector3 diff = cr.edgeA[i] - cr.edgeB[1]; - - float dot = diff.dot(transB.basis.get_axis(1)); - - if (dot < 0.0f) - { - TestCylinderVertVert(result, cr.edgeA[i], cr.edgeB[1], cA, cB, transA, transB); - } - else if (dot > (2.0f * cB.CylinderHalfHeight())) - { - TestCylinderVertVert(result, cr.edgeA[i], cr.edgeB[0], cA, cB, transA, transB); - } - else - { - TestCylinderVertEdge(result, cr.edgeB[0], cr.edgeB[1], cr.edgeA[i], cB, cA, transB, transA, true); - } - } - for (i = 0; i < 2; i++) - { - //project onto edge b - - Vector3 diff = cr.edgeB[i] - cr.edgeA[1]; - - float dot = diff.dot(transA.basis.get_axis(1)); - - if (dot < 0.0f) - { - TestCylinderVertVert(result, cr.edgeB[i], cr.edgeA[1], cA, cB, transA, transB); - } - else if (dot > (2.0f * cB.CylinderHalfHeight())) - { - TestCylinderVertVert(result, cr.edgeB[i], cr.edgeA[0], cA, cB, transA, transB); - } - else - { - TestCylinderVertEdge(result, cr.edgeA[0], cr.edgeA[1], cr.edgeB[i], cA, cB, transA, transB, false); - } - } -} - - -class TestMainLoop : public MainLoop { - - RID meshA; - RID meshB; - RID poly; - RID instance; - RID camera; - RID viewport; - RID boxA; - RID boxB; - RID scenario; - - Transform rot_a; - Transform rot_b; - - bool quit; -public: - virtual void input_event(const InputEvent& p_event) { - - if (p_event.type==InputEvent::MOUSE_MOTION && p_event.mouse_motion.button_mask&BUTTON_MASK_LEFT) { - - rot_b.origin.y+=-p_event.mouse_motion.relative_y/100.0; - rot_b.origin.x+=p_event.mouse_motion.relative_x/100.0; - } - if (p_event.type==InputEvent::MOUSE_MOTION && p_event.mouse_motion.button_mask&BUTTON_MASK_MIDDLE) { - - //rot_b.origin.x+=-p_event.mouse_motion.relative_y/100.0; - rot_b.origin.z+=p_event.mouse_motion.relative_x/100.0; - } - if (p_event.type==InputEvent::MOUSE_MOTION && p_event.mouse_motion.button_mask&BUTTON_MASK_RIGHT) { - - float rot_x=-p_event.mouse_motion.relative_y/100.0; - float rot_y=p_event.mouse_motion.relative_x/100.0; - rot_b.basis = rot_b.basis * Matrix3(Vector3(1,0,0),rot_x) * Matrix3(Vector3(0,1,0),rot_y); - } - - } - virtual void request_quit() { - - quit=true; - } - virtual void init() { - - VisualServer *vs=VisualServer::get_singleton(); - - camera = vs->camera_create(); - - viewport = vs->viewport_create(); - vs->viewport_attach_to_screen(viewport); - vs->viewport_attach_camera( viewport, camera ); - vs->camera_set_transform(camera, Transform( Matrix3(), Vector3(0,0,3 ) ) ); - - /* CONVEX SHAPE */ - - DVector<Plane> cylinder_planes = Geometry::build_cylinder_planes(0.5,2,9,Vector3::AXIS_Y); - RID cylinder_material = vs->fixed_material_create(); - vs->fixed_material_set_param( cylinder_material, VisualServer::FIXED_MATERIAL_PARAM_DIFFUSE, Color(0.8,0.2,0.9)); - vs->material_set_flag( cylinder_material, VisualServer::MATERIAL_FLAG_ONTOP,true); - //vs->material_set_flag( cylinder_material, VisualServer::MATERIAL_FLAG_WIREFRAME,true); - vs->material_set_flag( cylinder_material, VisualServer::MATERIAL_FLAG_DOUBLE_SIDED,true); - vs->material_set_flag( cylinder_material, VisualServer::MATERIAL_FLAG_UNSHADED,true); - - RID cylinder_mesh = vs->mesh_create(); - Geometry::MeshData cylinder_data = Geometry::build_convex_mesh(cylinder_planes); - vs->mesh_add_surface_from_mesh_data(cylinder_mesh,cylinder_data); - vs->mesh_surface_set_material( cylinder_mesh, 0, cylinder_material ); - - meshA=vs->instance_create2(cylinder_mesh,scenario); - meshB=vs->instance_create2(cylinder_mesh,scenario); - boxA=vs->instance_create2(vs->get_test_cube(),scenario); - boxB=vs->instance_create2(vs->get_test_cube(),scenario); - - /* - RID lightaux = vs->light_create( VisualServer::LIGHT_OMNI ); - vs->light_set_var( lightaux, VisualServer::LIGHT_VAR_RADIUS, 80 ); - vs->light_set_var( lightaux, VisualServer::LIGHT_VAR_ATTENUATION, 1 ); - vs->light_set_var( lightaux, VisualServer::LIGHT_VAR_ENERGY, 1.5 ); - light = vs->instance_create2( lightaux ); - */ - RID lightaux = vs->light_create( VisualServer::LIGHT_DIRECTIONAL ); - //vs->light_set_color( lightaux, VisualServer::LIGHT_COLOR_AMBIENT, Color(0.0,0.0,0.0) ); - //vs->light_set_shadow( lightaux, true ); - vs->instance_create2( lightaux,scenario ); - - //rot_a=Transform(Matrix3(Vector3(1,0,0),Math_PI/2.0),Vector3()); - rot_b=Transform(Matrix3(),Vector3(2,0,0)); - - //rot_x=0; - //rot_y=0; - quit=false; - } - virtual bool idle(float p_time) { - - VisualServer *vs=VisualServer::get_singleton(); - - vs->instance_set_transform(meshA,rot_a); - vs->instance_set_transform(meshB,rot_b); - - - neCollisionResult res; - TConvex a; - a.radius=0.5; - a.half_height=1; - Cylinder2CylinderTest(res,a,rot_a,a,rot_b); - if (res.penetrate) { - - Matrix3 scale; - scale.scale(Vector3(0.1,0.1,0.1)); - vs->instance_set_transform(boxA,Transform(scale,res.contactA)); - vs->instance_set_transform(boxB,Transform(scale,res.contactB)); - print_line("depth: "+rtos(res.depth)); - } else { - - Matrix3 scale; - scale.scale(Vector3()); - vs->instance_set_transform(boxA,Transform(scale,res.contactA)); - vs->instance_set_transform(boxB,Transform(scale,res.contactB)); - - } - print_line("collided: "+itos(res.penetrate)); - - return false; - } - - - virtual bool iteration(float p_time) { - - - - return quit; - } - virtual void finish() { - - } - -}; - - -MainLoop* test() { - - return memnew( TestMainLoop ); - -} - -} - - - diff --git a/bin/tests/test_misc.h b/bin/tests/test_misc.h deleted file mode 100644 index 55608f6a0e..0000000000 --- a/bin/tests/test_misc.h +++ /dev/null @@ -1,40 +0,0 @@ -/*************************************************************************/ -/* test_misc.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef TEST_MISC_H -#define TEST_MISC_H - -#include "os/main_loop.h" - -namespace TestMisc { - -MainLoop* test(); - -} - -#endif diff --git a/bin/tests/test_particles.cpp b/bin/tests/test_particles.cpp deleted file mode 100644 index 23a4b9e635..0000000000 --- a/bin/tests/test_particles.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/*************************************************************************/ -/* test_particles.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "test_particles.h" -#include "servers/visual_server.h" -#include "os/main_loop.h" -#include "math_funcs.h" -#include "print_string.h" - -namespace TestParticles { - - -class TestMainLoop : public MainLoop { - - RID particles; - RID instance; - RID camera; - RID viewport; - RID light; - RID scenario; - - struct InstanceInfo { - - RID instance; - Transform base; - Vector3 rot_axis; - }; - - List<InstanceInfo> instances; - - float ofs; - bool quit; -public: - virtual void input_event(const InputEvent& p_event) { - - - } - virtual void request_quit() { - - quit=true; - } - virtual void init() { - - VisualServer *vs=VisualServer::get_singleton(); - particles = vs->particles_create(); - vs->particles_set_amount(particles,1000); - - instance = vs->instance_create2(particles,scenario); - - - camera = vs->camera_create(); - -// vs->camera_set_perspective( camera, 60.0,0.1, 100.0 ); - viewport = vs->viewport_create(); - vs->viewport_attach_camera( viewport, camera ); - vs->camera_set_transform(camera, Transform( Matrix3(), Vector3(0,0,20 ) ) ); - /* - RID lightaux = vs->light_create( VisualServer::LIGHT_OMNI ); - vs->light_set_var( lightaux, VisualServer::LIGHT_VAR_RADIUS, 80 ); - vs->light_set_var( lightaux, VisualServer::LIGHT_VAR_ATTENUATION, 1 ); - vs->light_set_var( lightaux, VisualServer::LIGHT_VAR_ENERGY, 1.5 ); - light = vs->instance_create2( lightaux ); - */ - RID lightaux = vs->light_create( VisualServer::LIGHT_DIRECTIONAL ); - // vs->light_set_color( lightaux, VisualServer::LIGHT_COLOR_AMBIENT, Color(0.0,0.0,0.0) ); - light = vs->instance_create2( lightaux, scenario ); - - ofs=0; - quit=false; - } - virtual bool idle(float p_time) { - return false; - } - - - virtual bool iteration(float p_time) { - -// VisualServer *vs=VisualServer::get_singleton(); - - ofs+=p_time; - return quit; - } - virtual void finish() { - - } - -}; - - -MainLoop* test() { - - return memnew( TestMainLoop ); - -} - -} diff --git a/bin/tests/test_particles.h b/bin/tests/test_particles.h deleted file mode 100644 index e95637a4e6..0000000000 --- a/bin/tests/test_particles.h +++ /dev/null @@ -1,43 +0,0 @@ -/*************************************************************************/ -/* test_particles.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef TEST_PARTICLES_H -#define TEST_PARTICLES_H - -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ -#include "os/main_loop.h" - -namespace TestParticles { - -MainLoop* test(); - -} - -#endif diff --git a/bin/tests/test_python.cpp b/bin/tests/test_python.cpp deleted file mode 100644 index f4a3d7a3a2..0000000000 --- a/bin/tests/test_python.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/*************************************************************************/ -/* test_python.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "test_python.h" - -#ifdef PYTHON_ENABLED - -#include "Python.h" -#include "print_string.h" - -namespace TestPython { - -void test() { - - print_line("testing python"); - PyRun_SimpleString("import engine\n"); - PyRun_SimpleString("def test(self):\n\tprint(\"noway\")\n"); - PyRun_SimpleString("a=engine.ObjectPtr()\n"); - PyRun_SimpleString("a.noway(22,'hello')\n"); - PyRun_SimpleString("a.normalize()\n"); - PyRun_SimpleString("class Moch(engine.ObjectPtr):\n\tdef mooch(self):\n\t\tprint('muchi')\n"); - PyRun_SimpleString("b=Moch();\n"); - PyRun_SimpleString("b.mooch();\n"); - PyRun_SimpleString("b.meis();\n"); - - -} - -} - -#endif diff --git a/bin/tests/test_python.h b/bin/tests/test_python.h deleted file mode 100644 index 77e9603fe2..0000000000 --- a/bin/tests/test_python.h +++ /dev/null @@ -1,43 +0,0 @@ -/*************************************************************************/ -/* test_python.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef TEST_PYTHON_H -#define TEST_PYTHON_H - -#ifdef PYTHON_ENABLED -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ -namespace TestPython { - -void test(); - -} - -#endif -#endif diff --git a/bin/tests/test_shader_lang.cpp b/bin/tests/test_shader_lang.cpp deleted file mode 100644 index 9c0075c47d..0000000000 --- a/bin/tests/test_shader_lang.cpp +++ /dev/null @@ -1,340 +0,0 @@ -/*************************************************************************/ -/* test_shader_lang.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "test_shader_lang.h" - - -#include "os/main_loop.h" -#include "os/os.h" -#include "os/file_access.h" - -#include "scene/gui/control.h" -#include "scene/gui/text_edit.h" -#include "print_string.h" -#include "servers/visual/shader_language.h" -#include "drivers/gles2/shader_compiler_gles2.h" - - -typedef ShaderLanguage SL; - -namespace TestShaderLang { - - -static String _mktab(int p_level) { - - String tb; - for(int i=0;i<p_level;i++) { - tb+="\t"; - } - - return tb; -} - -static String _typestr(SL::DataType p_type) { - - switch(p_type) { - - case SL::TYPE_VOID: return "void"; - case SL::TYPE_BOOL: return "bool"; - case SL::TYPE_FLOAT: return "float"; - case SL::TYPE_VEC2: return "vec2"; - case SL::TYPE_VEC3: return "vec3"; - case SL::TYPE_VEC4: return "vec4"; - case SL::TYPE_MAT3: return "mat3"; - case SL::TYPE_MAT4: return "mat4"; - case SL::TYPE_TEXTURE: return "texture"; - case SL::TYPE_CUBEMAP: return "cubemap"; - default: {} - } - - return ""; -} - -static String _opstr(SL::Operator p_op) { - - switch(p_op) { - case SL::OP_ASSIGN: return "="; - case SL::OP_ADD: return "+"; - case SL::OP_SUB: return "-"; - case SL::OP_MUL: return "*"; - case SL::OP_DIV: return "/"; - case SL::OP_ASSIGN_ADD: return "+="; - case SL::OP_ASSIGN_SUB: return "-="; - case SL::OP_ASSIGN_MUL: return "*="; - case SL::OP_ASSIGN_DIV: return "/="; - case SL::OP_NEG: return "-"; - case SL::OP_NOT: return "!"; - case SL::OP_CMP_EQ: return "=="; - case SL::OP_CMP_NEQ: return "!="; - case SL::OP_CMP_LEQ: return "<="; - case SL::OP_CMP_GEQ: return ">="; - case SL::OP_CMP_LESS: return "<"; - case SL::OP_CMP_GREATER: return ">"; - case SL::OP_CMP_OR: return "||"; - case SL::OP_CMP_AND: return "&&"; - default: return ""; - } - - return ""; -} - -static String dump_node_code(SL::Node *p_node,int p_level) { - - String code; - - switch(p_node->type) { - - case SL::Node::TYPE_PROGRAM: { - - SL::ProgramNode *pnode=(SL::ProgramNode*)p_node; - - for(Map<StringName,SL::Uniform>::Element *E=pnode->uniforms.front();E;E=E->next()) { - - String ucode="uniform "; - ucode+=_typestr(E->get().type)+"="+String(E->get().default_value)+"\n"; - code+=ucode; - - } - - for(int i=0;i<pnode->functions.size();i++) { - - SL::FunctionNode *fnode=pnode->functions[i].function; - - String header; - header=_typestr(fnode->return_type)+" "+fnode->name+"("; - for(int i=0;i<fnode->arguments.size();i++) { - - if (i>0) - header+=", "; - header+=_typestr(fnode->arguments[i].type)+" "+fnode->arguments[i].name; - } - - header+=") {\n"; - code+=header; - code+=dump_node_code(fnode->body,p_level+1); - code+="}\n"; - } - - code+=dump_node_code(pnode->body,p_level); - } break; - case SL::Node::TYPE_FUNCTION: { - - } break; - case SL::Node::TYPE_BLOCK: { - SL::BlockNode *bnode=(SL::BlockNode*)p_node; - - //variables - for(Map<StringName,SL::DataType>::Element *E=bnode->variables.front();E;E=E->next()) { - - code+=_mktab(p_level)+_typestr(E->value())+" "+E->key()+";\n"; - } - - for(int i=0;i<bnode->statements.size();i++) { - - code+=_mktab(p_level)+dump_node_code(bnode->statements[i],p_level)+";\n"; - } - - - } break; - case SL::Node::TYPE_VARIABLE: { - SL::VariableNode *vnode=(SL::VariableNode*)p_node; - code=vnode->name; - - } break; - case SL::Node::TYPE_CONSTANT: { - SL::ConstantNode *cnode=(SL::ConstantNode*)p_node; - switch(cnode->datatype) { - - - case SL::TYPE_BOOL: code=cnode->value.operator bool()?"true":"false"; break; - case SL::TYPE_FLOAT: code=cnode->value; break; - case SL::TYPE_VEC2: { Vector2 v = cnode->value; code="vec2("+rtos(v.x)+", "+rtos(v.y)+")"; } break; - case SL::TYPE_VEC3: { Vector3 v = cnode->value; code="vec3("+rtos(v.x)+", "+rtos(v.y)+", "+rtos(v.z)+")"; } break; - case SL::TYPE_VEC4: { Plane v = cnode->value; code="vec4("+rtos(v.normal.x)+", "+rtos(v.normal.y)+", "+rtos(v.normal.z)+", "+rtos(v.d)+")"; } break; - case SL::TYPE_MAT3: { Matrix3 x = cnode->value; code="mat3( vec3("+rtos(x.get_axis(0).x)+", "+rtos(x.get_axis(0).y)+", "+rtos(x.get_axis(0).z)+"), vec3("+rtos(x.get_axis(1).x)+", "+rtos(x.get_axis(1).y)+", "+rtos(x.get_axis(1).z)+"), vec3("+rtos(x.get_axis(2).x)+", "+rtos(x.get_axis(2).y)+", "+rtos(x.get_axis(2).z)+"))"; } break; - case SL::TYPE_MAT4: { Transform x = cnode->value; code="mat4( vec3("+rtos(x.basis.get_axis(0).x)+", "+rtos(x.basis.get_axis(0).y)+", "+rtos(x.basis.get_axis(0).z)+"), vec3("+rtos(x.basis.get_axis(1).x)+", "+rtos(x.basis.get_axis(1).y)+", "+rtos(x.basis.get_axis(1).z)+"), vec3("+rtos(x.basis.get_axis(2).x)+", "+rtos(x.basis.get_axis(2).y)+", "+rtos(x.basis.get_axis(2).z)+"), vec3("+rtos(x.origin.x)+", "+rtos(x.origin.y)+", "+rtos(x.origin.z)+"))"; } break; - default: code="<error: "+Variant::get_type_name(cnode->value.get_type())+" ("+itos(cnode->datatype)+">"; - } - - } break; - case SL::Node::TYPE_OPERATOR: { - SL::OperatorNode *onode=(SL::OperatorNode*)p_node; - - - switch(onode->op) { - - case SL::OP_ASSIGN: - case SL::OP_ASSIGN_ADD: - case SL::OP_ASSIGN_SUB: - case SL::OP_ASSIGN_MUL: - case SL::OP_ASSIGN_DIV: - code=dump_node_code(onode->arguments[0],p_level)+_opstr(onode->op)+dump_node_code(onode->arguments[1],p_level); - break; - - case SL::OP_ADD: - case SL::OP_SUB: - case SL::OP_MUL: - case SL::OP_DIV: - case SL::OP_CMP_EQ: - case SL::OP_CMP_NEQ: - case SL::OP_CMP_LEQ: - case SL::OP_CMP_GEQ: - case SL::OP_CMP_LESS: - case SL::OP_CMP_GREATER: - case SL::OP_CMP_OR: - case SL::OP_CMP_AND: - - code="("+dump_node_code(onode->arguments[0],p_level)+_opstr(onode->op)+dump_node_code(onode->arguments[1],p_level)+")"; - break; - case SL::OP_NEG: - case SL::OP_NOT: - code=_opstr(onode->op)+dump_node_code(onode->arguments[0],p_level); - break; - case SL::OP_CALL: - case SL::OP_CONSTRUCT: - code=dump_node_code(onode->arguments[0],p_level)+"("; - for(int i=1;i<onode->arguments.size();i++) { - if (i>1) - code+=", "; - code+=dump_node_code(onode->arguments[i],p_level); - } - code+=")"; - break; - default: {} - } - - } break; - case SL::Node::TYPE_CONTROL_FLOW: { - SL::ControlFlowNode *cfnode=(SL::ControlFlowNode*)p_node; - if (cfnode->flow_op==SL::FLOW_OP_IF) { - - code+="if ("+dump_node_code(cfnode->statements[0],p_level)+") {\n"; - code+=dump_node_code(cfnode->statements[1],p_level+1); - if (cfnode->statements.size()==3) { - - code+="} else {\n"; - code+=dump_node_code(cfnode->statements[2],p_level+1); - } - - code+="}\n"; - - } else if (cfnode->flow_op==SL::FLOW_OP_RETURN) { - - if (cfnode->statements.size()) { - code="return "+dump_node_code(cfnode->statements[0],p_level); - } else { - code="return"; - } - } - - } break; - case SL::Node::TYPE_MEMBER: { - SL::MemberNode *mnode=(SL::MemberNode*)p_node; - code=dump_node_code(mnode->owner,p_level)+"."+mnode->name; - - } break; - } - - return code; - -} - -static Error recreate_code(void *p_str,SL::ProgramNode *p_program) { - - print_line("recr"); - String *str=(String*)p_str; - - *str=dump_node_code(p_program,0); - - return OK; - - -} - - -MainLoop* test() { - - List<String> cmdlargs = OS::get_singleton()->get_cmdline_args(); - - if (cmdlargs.empty()) { - //try editor! - return NULL; - } - - String test = cmdlargs.back()->get(); - - FileAccess *fa = FileAccess::open(test,FileAccess::READ); - - if (!fa) { - ERR_FAIL_V(NULL); - } - - String code; - - while(true) { - CharType c = fa->get_8(); - if (fa->eof_reached()) - break; - code+=c; - } - - int errline; - int errcol; - String error; - print_line(SL::lex_debug(code)); - Error err = SL::compile(code,ShaderLanguage::SHADER_MATERIAL_FRAGMENT,NULL,NULL,&error,&errline,&errcol); - - if (err) { - - print_line("Error: "+itos(errline)+":"+itos(errcol)+" "+error); - return NULL; - } - - print_line("Compile OK! - pretty printing"); - - String rcode; - err = SL::compile(code,ShaderLanguage::SHADER_MATERIAL_FRAGMENT,recreate_code,&rcode,&error,&errline,&errcol); - - if (!err) { - print_line(rcode); - } - - ShaderCompilerGLES2 comp; - String codeline,globalsline; - SL::VarInfo vi; - vi.name="mongs"; - vi.type=SL::TYPE_VEC3; - - - ShaderCompilerGLES2::Flags fl; - comp.compile(code,ShaderLanguage::SHADER_MATERIAL_FRAGMENT,codeline,globalsline,fl); - - return NULL; -} - -} diff --git a/core/SCsub b/core/SCsub index caae3a1c9b..8d89f6427b 100644 --- a/core/SCsub +++ b/core/SCsub @@ -15,7 +15,7 @@ for x in env.global_defaults: gd_cpp = '#include "globals.h"\n' gd_cpp += gd_inc -gd_cpp += "void Globals::register_global_defaults() {\n" + gd_call + "\n}\n" +gd_cpp += "void GlobalConfig::register_global_defaults() {\n" + gd_call + "\n}\n" f = open("global_defaults.cpp", "wb") f.write(gd_cpp) diff --git a/core/allocators.h b/core/allocators.h index 4a5fd7a119..14deeb8739 100644 --- a/core/allocators.h +++ b/core/allocators.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/array.cpp b/core/array.cpp index 683a43e3d0..50cc9eee47 100644 --- a/core/array.cpp +++ b/core/array.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -150,6 +150,16 @@ void Array::erase(const Variant& p_value) { _p->array.erase(p_value); } +Variant Array::front() const { + ERR_FAIL_COND_V(_p->array.size() == 0, Variant()); + return operator[](0); +} + +Variant Array::back() const { + ERR_FAIL_COND_V(_p->array.size() == 0, Variant()); + return operator[](_p->array.size() - 1); +} + int Array::find(const Variant& p_value, int p_from) const { return _p->array.find(p_value, p_from); diff --git a/core/array.h b/core/array.h index eb79b0cf33..af57940d79 100644 --- a/core/array.h +++ b/core/array.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -67,6 +67,9 @@ public: void insert(int p_pos, const Variant& p_value); void remove(int p_pos); + Variant front() const; + Variant back() const; + void sort(); void sort_custom(Object *p_obj,const StringName& p_function); void invert(); diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp index df49ecebcf..8f1c1779bd 100644 --- a/core/bind/core_bind.cpp +++ b/core/bind/core_bind.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -69,11 +69,11 @@ RES _ResourceLoader::load(const String &p_path,const String& p_type_hint, bool p return ret; } -DVector<String> _ResourceLoader::get_recognized_extensions_for_type(const String& p_type) { +PoolVector<String> _ResourceLoader::get_recognized_extensions_for_type(const String& p_type) { List<String> exts; ResourceLoader::get_recognized_extensions_for_type(p_type,&exts); - DVector<String> ret; + PoolVector<String> ret; for(List<String>::Element *E=exts.front();E;E=E->next()) { ret.push_back(E->get()); @@ -87,12 +87,12 @@ void _ResourceLoader::set_abort_on_missing_resources(bool p_abort) { ResourceLoader::set_abort_on_missing_resources(p_abort); } -StringArray _ResourceLoader::get_dependencies(const String& p_path) { +PoolStringArray _ResourceLoader::get_dependencies(const String& p_path) { List<String> deps; ResourceLoader::get_dependencies(p_path, &deps); - StringArray ret; + PoolStringArray ret; for(List<String>::Element *E=deps.front();E;E=E->next()) { ret.push_back(E->get()); } @@ -102,7 +102,7 @@ StringArray _ResourceLoader::get_dependencies(const String& p_path) { bool _ResourceLoader::has(const String &p_path) { - String local_path = Globals::get_singleton()->localize_path(p_path); + String local_path = GlobalConfig::get_singleton()->localize_path(p_path); return ResourceCache::has(local_path); }; @@ -114,13 +114,13 @@ Ref<ResourceImportMetadata> _ResourceLoader::load_import_metadata(const String& void _ResourceLoader::_bind_methods() { - ObjectTypeDB::bind_method(_MD("load_interactive:ResourceInteractiveLoader","path","type_hint"),&_ResourceLoader::load_interactive,DEFVAL("")); - ObjectTypeDB::bind_method(_MD("load:Resource","path","type_hint", "p_no_cache"),&_ResourceLoader::load,DEFVAL(""), DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("load_import_metadata:ResourceImportMetadata","path"),&_ResourceLoader::load_import_metadata); - ObjectTypeDB::bind_method(_MD("get_recognized_extensions_for_type","type"),&_ResourceLoader::get_recognized_extensions_for_type); - ObjectTypeDB::bind_method(_MD("set_abort_on_missing_resources","abort"),&_ResourceLoader::set_abort_on_missing_resources); - ObjectTypeDB::bind_method(_MD("get_dependencies","path"),&_ResourceLoader::get_dependencies); - ObjectTypeDB::bind_method(_MD("has","path"),&_ResourceLoader::has); + ClassDB::bind_method(_MD("load_interactive:ResourceInteractiveLoader","path","type_hint"),&_ResourceLoader::load_interactive,DEFVAL("")); + ClassDB::bind_method(_MD("load:Resource","path","type_hint", "p_no_cache"),&_ResourceLoader::load,DEFVAL(""), DEFVAL(false)); + ClassDB::bind_method(_MD("load_import_metadata:ResourceImportMetadata","path"),&_ResourceLoader::load_import_metadata); + ClassDB::bind_method(_MD("get_recognized_extensions_for_type","type"),&_ResourceLoader::get_recognized_extensions_for_type); + ClassDB::bind_method(_MD("set_abort_on_missing_resources","abort"),&_ResourceLoader::set_abort_on_missing_resources); + ClassDB::bind_method(_MD("get_dependencies","path"),&_ResourceLoader::get_dependencies); + ClassDB::bind_method(_MD("has","path"),&_ResourceLoader::has); } _ResourceLoader::_ResourceLoader() { @@ -135,12 +135,12 @@ Error _ResourceSaver::save(const String &p_path,const RES& p_resource, uint32_t return ResourceSaver::save(p_path,p_resource, p_flags); } -DVector<String> _ResourceSaver::get_recognized_extensions(const RES& p_resource) { +PoolVector<String> _ResourceSaver::get_recognized_extensions(const RES& p_resource) { - ERR_FAIL_COND_V(p_resource.is_null(),DVector<String>()); + ERR_FAIL_COND_V(p_resource.is_null(),PoolVector<String>()); List<String> exts; ResourceSaver::get_recognized_extensions(p_resource,&exts); - DVector<String> ret; + PoolVector<String> ret; for(List<String>::Element *E=exts.front();E;E=E->next()) { ret.push_back(E->get()); @@ -153,8 +153,8 @@ _ResourceSaver *_ResourceSaver::singleton=NULL; void _ResourceSaver::_bind_methods() { - ObjectTypeDB::bind_method(_MD("save","path","resource:Resource","flags"),&_ResourceSaver::save,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("get_recognized_extensions","type"),&_ResourceSaver::get_recognized_extensions); + ClassDB::bind_method(_MD("save","path","resource:Resource","flags"),&_ResourceSaver::save,DEFVAL(0)); + ClassDB::bind_method(_MD("get_recognized_extensions","type"),&_ResourceSaver::get_recognized_extensions); BIND_CONSTANT(FLAG_RELATIVE_PATHS); BIND_CONSTANT(FLAG_BUNDLE_RESOURCES); @@ -553,6 +553,16 @@ void _OS::set_icon(const Image& p_icon) { OS::get_singleton()->set_icon(p_icon); } +int _OS::get_exit_code() const { + + return OS::get_singleton()->get_exit_code(); +} + +void _OS::set_exit_code(int p_code) { + + OS::get_singleton()->set_exit_code(p_code); +} + /** * Get current datetime with consideration for utc and * dst @@ -836,7 +846,7 @@ void _OS::print_all_textures_by_size() { for (List<Ref<Resource> >::Element *E=rsrc.front();E;E=E->next()) { - if (!E->get()->is_type("ImageTexture")) + if (!E->get()->is_class("ImageTexture")) continue; Size2 size = E->get()->call("get_size"); @@ -878,18 +888,18 @@ void _OS::print_resources_by_type(const Vector<String>& p_types) { bool found = false; for (int i=0; i<p_types.size(); i++) { - if (r->is_type(p_types[i])) + if (r->is_class(p_types[i])) found = true; } if (!found) continue; - if (!type_count.has(r->get_type())) { - type_count[r->get_type()]=0; + if (!type_count.has(r->get_class())) { + type_count[r->get_class()]=0; } - type_count[r->get_type()]++; + type_count[r->get_class()]++; } }; @@ -1027,154 +1037,157 @@ _OS *_OS::singleton=NULL; void _OS::_bind_methods() { - //ObjectTypeDB::bind_method(_MD("get_mouse_pos"),&_OS::get_mouse_pos); - //ObjectTypeDB::bind_method(_MD("is_mouse_grab_enabled"),&_OS::is_mouse_grab_enabled); - - ObjectTypeDB::bind_method(_MD("set_clipboard","clipboard"),&_OS::set_clipboard); - ObjectTypeDB::bind_method(_MD("get_clipboard"),&_OS::get_clipboard); - - ObjectTypeDB::bind_method(_MD("set_video_mode","size","fullscreen","resizable","screen"),&_OS::set_video_mode,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("get_video_mode_size","screen"),&_OS::get_video_mode,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("is_video_mode_fullscreen","screen"),&_OS::is_video_mode_fullscreen,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("is_video_mode_resizable","screen"),&_OS::is_video_mode_resizable,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("get_fullscreen_mode_list","screen"),&_OS::get_fullscreen_mode_list,DEFVAL(0)); - - - ObjectTypeDB::bind_method(_MD("get_screen_count"),&_OS::get_screen_count); - ObjectTypeDB::bind_method(_MD("get_current_screen"),&_OS::get_current_screen); - ObjectTypeDB::bind_method(_MD("set_current_screen","screen"),&_OS::set_current_screen); - ObjectTypeDB::bind_method(_MD("get_screen_position","screen"),&_OS::get_screen_position,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("get_screen_size","screen"),&_OS::get_screen_size,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("get_screen_dpi","screen"),&_OS::get_screen_dpi,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("get_window_position"),&_OS::get_window_position); - ObjectTypeDB::bind_method(_MD("set_window_position","position"),&_OS::set_window_position); - ObjectTypeDB::bind_method(_MD("get_window_size"),&_OS::get_window_size); - ObjectTypeDB::bind_method(_MD("set_window_size","size"),&_OS::set_window_size); - ObjectTypeDB::bind_method(_MD("set_window_fullscreen","enabled"),&_OS::set_window_fullscreen); - ObjectTypeDB::bind_method(_MD("is_window_fullscreen"),&_OS::is_window_fullscreen); - ObjectTypeDB::bind_method(_MD("set_window_resizable","enabled"),&_OS::set_window_resizable); - ObjectTypeDB::bind_method(_MD("is_window_resizable"),&_OS::is_window_resizable); - ObjectTypeDB::bind_method(_MD("set_window_minimized", "enabled"),&_OS::set_window_minimized); - ObjectTypeDB::bind_method(_MD("is_window_minimized"),&_OS::is_window_minimized); - ObjectTypeDB::bind_method(_MD("set_window_maximized", "enabled"),&_OS::set_window_maximized); - ObjectTypeDB::bind_method(_MD("is_window_maximized"),&_OS::is_window_maximized); - ObjectTypeDB::bind_method(_MD("request_attention"), &_OS::request_attention); - - ObjectTypeDB::bind_method(_MD("set_borderless_window", "borderless"), &_OS::set_borderless_window); - ObjectTypeDB::bind_method(_MD("get_borderless_window"), &_OS::get_borderless_window); - - ObjectTypeDB::bind_method(_MD("set_screen_orientation","orientation"),&_OS::set_screen_orientation); - ObjectTypeDB::bind_method(_MD("get_screen_orientation"),&_OS::get_screen_orientation); - - ObjectTypeDB::bind_method(_MD("set_keep_screen_on","enabled"),&_OS::set_keep_screen_on); - ObjectTypeDB::bind_method(_MD("is_keep_screen_on"),&_OS::is_keep_screen_on); - - ObjectTypeDB::bind_method(_MD("set_iterations_per_second","iterations_per_second"),&_OS::set_iterations_per_second); - ObjectTypeDB::bind_method(_MD("get_iterations_per_second"),&_OS::get_iterations_per_second); - ObjectTypeDB::bind_method(_MD("set_target_fps","target_fps"),&_OS::set_target_fps); - ObjectTypeDB::bind_method(_MD("get_target_fps"),&_OS::get_target_fps); - - ObjectTypeDB::bind_method(_MD("set_time_scale","time_scale"),&_OS::set_time_scale); - ObjectTypeDB::bind_method(_MD("get_time_scale"),&_OS::get_time_scale); - - ObjectTypeDB::bind_method(_MD("has_touchscreen_ui_hint"),&_OS::has_touchscreen_ui_hint); - - ObjectTypeDB::bind_method(_MD("set_window_title","title"),&_OS::set_window_title); - - ObjectTypeDB::bind_method(_MD("set_low_processor_usage_mode","enable"),&_OS::set_low_processor_usage_mode); - ObjectTypeDB::bind_method(_MD("is_in_low_processor_usage_mode"),&_OS::is_in_low_processor_usage_mode); - - ObjectTypeDB::bind_method(_MD("get_processor_count"),&_OS::get_processor_count); - - ObjectTypeDB::bind_method(_MD("get_executable_path"),&_OS::get_executable_path); - ObjectTypeDB::bind_method(_MD("execute","path","arguments","blocking","output"),&_OS::execute,DEFVAL(Array())); - ObjectTypeDB::bind_method(_MD("kill","pid"),&_OS::kill); - ObjectTypeDB::bind_method(_MD("shell_open","uri"),&_OS::shell_open); - ObjectTypeDB::bind_method(_MD("get_process_ID"),&_OS::get_process_ID); - - ObjectTypeDB::bind_method(_MD("get_environment","environment"),&_OS::get_environment); - ObjectTypeDB::bind_method(_MD("has_environment","environment"),&_OS::has_environment); - - ObjectTypeDB::bind_method(_MD("get_name"),&_OS::get_name); - ObjectTypeDB::bind_method(_MD("get_cmdline_args"),&_OS::get_cmdline_args); - ObjectTypeDB::bind_method(_MD("get_main_loop"),&_OS::get_main_loop); - - ObjectTypeDB::bind_method(_MD("get_datetime","utc"),&_OS::get_datetime,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("get_date","utc"),&_OS::get_date,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("get_time","utc"),&_OS::get_time,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("get_time_zone_info"),&_OS::get_time_zone_info); - ObjectTypeDB::bind_method(_MD("get_unix_time"),&_OS::get_unix_time); - ObjectTypeDB::bind_method(_MD("get_datetime_from_unix_time", "unix_time_val"), + //ClassDB::bind_method(_MD("get_mouse_pos"),&_OS::get_mouse_pos); + //ClassDB::bind_method(_MD("is_mouse_grab_enabled"),&_OS::is_mouse_grab_enabled); + + ClassDB::bind_method(_MD("set_clipboard","clipboard"),&_OS::set_clipboard); + ClassDB::bind_method(_MD("get_clipboard"),&_OS::get_clipboard); + + ClassDB::bind_method(_MD("set_video_mode","size","fullscreen","resizable","screen"),&_OS::set_video_mode,DEFVAL(0)); + ClassDB::bind_method(_MD("get_video_mode_size","screen"),&_OS::get_video_mode,DEFVAL(0)); + ClassDB::bind_method(_MD("is_video_mode_fullscreen","screen"),&_OS::is_video_mode_fullscreen,DEFVAL(0)); + ClassDB::bind_method(_MD("is_video_mode_resizable","screen"),&_OS::is_video_mode_resizable,DEFVAL(0)); + ClassDB::bind_method(_MD("get_fullscreen_mode_list","screen"),&_OS::get_fullscreen_mode_list,DEFVAL(0)); + + + ClassDB::bind_method(_MD("get_screen_count"),&_OS::get_screen_count); + ClassDB::bind_method(_MD("get_current_screen"),&_OS::get_current_screen); + ClassDB::bind_method(_MD("set_current_screen","screen"),&_OS::set_current_screen); + ClassDB::bind_method(_MD("get_screen_position","screen"),&_OS::get_screen_position,DEFVAL(0)); + ClassDB::bind_method(_MD("get_screen_size","screen"),&_OS::get_screen_size,DEFVAL(0)); + ClassDB::bind_method(_MD("get_screen_dpi","screen"),&_OS::get_screen_dpi,DEFVAL(0)); + ClassDB::bind_method(_MD("get_window_position"),&_OS::get_window_position); + ClassDB::bind_method(_MD("set_window_position","position"),&_OS::set_window_position); + ClassDB::bind_method(_MD("get_window_size"),&_OS::get_window_size); + ClassDB::bind_method(_MD("set_window_size","size"),&_OS::set_window_size); + ClassDB::bind_method(_MD("set_window_fullscreen","enabled"),&_OS::set_window_fullscreen); + ClassDB::bind_method(_MD("is_window_fullscreen"),&_OS::is_window_fullscreen); + ClassDB::bind_method(_MD("set_window_resizable","enabled"),&_OS::set_window_resizable); + ClassDB::bind_method(_MD("is_window_resizable"),&_OS::is_window_resizable); + ClassDB::bind_method(_MD("set_window_minimized", "enabled"),&_OS::set_window_minimized); + ClassDB::bind_method(_MD("is_window_minimized"),&_OS::is_window_minimized); + ClassDB::bind_method(_MD("set_window_maximized", "enabled"),&_OS::set_window_maximized); + ClassDB::bind_method(_MD("is_window_maximized"),&_OS::is_window_maximized); + ClassDB::bind_method(_MD("request_attention"), &_OS::request_attention); + + ClassDB::bind_method(_MD("set_borderless_window", "borderless"), &_OS::set_borderless_window); + ClassDB::bind_method(_MD("get_borderless_window"), &_OS::get_borderless_window); + + ClassDB::bind_method(_MD("set_screen_orientation","orientation"),&_OS::set_screen_orientation); + ClassDB::bind_method(_MD("get_screen_orientation"),&_OS::get_screen_orientation); + + ClassDB::bind_method(_MD("set_keep_screen_on","enabled"),&_OS::set_keep_screen_on); + ClassDB::bind_method(_MD("is_keep_screen_on"),&_OS::is_keep_screen_on); + + ClassDB::bind_method(_MD("set_iterations_per_second","iterations_per_second"),&_OS::set_iterations_per_second); + ClassDB::bind_method(_MD("get_iterations_per_second"),&_OS::get_iterations_per_second); + ClassDB::bind_method(_MD("set_target_fps","target_fps"),&_OS::set_target_fps); + ClassDB::bind_method(_MD("get_target_fps"),&_OS::get_target_fps); + + ClassDB::bind_method(_MD("set_time_scale","time_scale"),&_OS::set_time_scale); + ClassDB::bind_method(_MD("get_time_scale"),&_OS::get_time_scale); + + ClassDB::bind_method(_MD("has_touchscreen_ui_hint"),&_OS::has_touchscreen_ui_hint); + + ClassDB::bind_method(_MD("set_window_title","title"),&_OS::set_window_title); + + ClassDB::bind_method(_MD("set_low_processor_usage_mode","enable"),&_OS::set_low_processor_usage_mode); + ClassDB::bind_method(_MD("is_in_low_processor_usage_mode"),&_OS::is_in_low_processor_usage_mode); + + ClassDB::bind_method(_MD("get_processor_count"),&_OS::get_processor_count); + + ClassDB::bind_method(_MD("get_executable_path"),&_OS::get_executable_path); + ClassDB::bind_method(_MD("execute","path","arguments","blocking","output"),&_OS::execute,DEFVAL(Array())); + ClassDB::bind_method(_MD("kill","pid"),&_OS::kill); + ClassDB::bind_method(_MD("shell_open","uri"),&_OS::shell_open); + ClassDB::bind_method(_MD("get_process_ID"),&_OS::get_process_ID); + + ClassDB::bind_method(_MD("get_environment","environment"),&_OS::get_environment); + ClassDB::bind_method(_MD("has_environment","environment"),&_OS::has_environment); + + ClassDB::bind_method(_MD("get_name"),&_OS::get_name); + ClassDB::bind_method(_MD("get_cmdline_args"),&_OS::get_cmdline_args); + ClassDB::bind_method(_MD("get_main_loop"),&_OS::get_main_loop); + + ClassDB::bind_method(_MD("get_datetime","utc"),&_OS::get_datetime,DEFVAL(false)); + ClassDB::bind_method(_MD("get_date","utc"),&_OS::get_date,DEFVAL(false)); + ClassDB::bind_method(_MD("get_time","utc"),&_OS::get_time,DEFVAL(false)); + ClassDB::bind_method(_MD("get_time_zone_info"),&_OS::get_time_zone_info); + ClassDB::bind_method(_MD("get_unix_time"),&_OS::get_unix_time); + ClassDB::bind_method(_MD("get_datetime_from_unix_time", "unix_time_val"), &_OS::get_datetime_from_unix_time); - ObjectTypeDB::bind_method(_MD("get_unix_time_from_datetime", "datetime"), + ClassDB::bind_method(_MD("get_unix_time_from_datetime", "datetime"), &_OS::get_unix_time_from_datetime); - ObjectTypeDB::bind_method(_MD("get_system_time_secs"), &_OS::get_system_time_secs); + ClassDB::bind_method(_MD("get_system_time_secs"), &_OS::get_system_time_secs); + + ClassDB::bind_method(_MD("set_icon","icon"),&_OS::set_icon); - ObjectTypeDB::bind_method(_MD("set_icon","icon"),&_OS::set_icon); + ClassDB::bind_method(_MD("get_exit_code"),&_OS::get_exit_code); + ClassDB::bind_method(_MD("set_exit_code","code"),&_OS::set_exit_code); - ObjectTypeDB::bind_method(_MD("delay_usec","usec"),&_OS::delay_usec); - ObjectTypeDB::bind_method(_MD("delay_msec","msec"),&_OS::delay_msec); - ObjectTypeDB::bind_method(_MD("get_ticks_msec"),&_OS::get_ticks_msec); - ObjectTypeDB::bind_method(_MD("get_splash_tick_msec"),&_OS::get_splash_tick_msec); - ObjectTypeDB::bind_method(_MD("get_locale"),&_OS::get_locale); - ObjectTypeDB::bind_method(_MD("get_latin_keyboard_variant"),&_OS::get_latin_keyboard_variant); - ObjectTypeDB::bind_method(_MD("get_model_name"),&_OS::get_model_name); + ClassDB::bind_method(_MD("delay_usec","usec"),&_OS::delay_usec); + ClassDB::bind_method(_MD("delay_msec","msec"),&_OS::delay_msec); + ClassDB::bind_method(_MD("get_ticks_msec"),&_OS::get_ticks_msec); + ClassDB::bind_method(_MD("get_splash_tick_msec"),&_OS::get_splash_tick_msec); + ClassDB::bind_method(_MD("get_locale"),&_OS::get_locale); + ClassDB::bind_method(_MD("get_latin_keyboard_variant"),&_OS::get_latin_keyboard_variant); + ClassDB::bind_method(_MD("get_model_name"),&_OS::get_model_name); - ObjectTypeDB::bind_method(_MD("get_custom_level"),&_OS::get_custom_level); + ClassDB::bind_method(_MD("get_custom_level"),&_OS::get_custom_level); - ObjectTypeDB::bind_method(_MD("can_draw"),&_OS::can_draw); - ObjectTypeDB::bind_method(_MD("get_frames_drawn"),&_OS::get_frames_drawn); - ObjectTypeDB::bind_method(_MD("is_stdout_verbose"),&_OS::is_stdout_verbose); + ClassDB::bind_method(_MD("can_draw"),&_OS::can_draw); + ClassDB::bind_method(_MD("get_frames_drawn"),&_OS::get_frames_drawn); + ClassDB::bind_method(_MD("is_stdout_verbose"),&_OS::is_stdout_verbose); - ObjectTypeDB::bind_method(_MD("can_use_threads"),&_OS::can_use_threads); + ClassDB::bind_method(_MD("can_use_threads"),&_OS::can_use_threads); - ObjectTypeDB::bind_method(_MD("is_debug_build"),&_OS::is_debug_build); + ClassDB::bind_method(_MD("is_debug_build"),&_OS::is_debug_build); - //ObjectTypeDB::bind_method(_MD("get_mouse_button_state"),&_OS::get_mouse_button_state); + //ClassDB::bind_method(_MD("get_mouse_button_state"),&_OS::get_mouse_button_state); - ObjectTypeDB::bind_method(_MD("dump_memory_to_file","file"),&_OS::dump_memory_to_file); - ObjectTypeDB::bind_method(_MD("dump_resources_to_file","file"),&_OS::dump_resources_to_file); - ObjectTypeDB::bind_method(_MD("has_virtual_keyboard"),&_OS::has_virtual_keyboard); - ObjectTypeDB::bind_method(_MD("show_virtual_keyboard", "existing_text"),&_OS::show_virtual_keyboard,DEFVAL("")); - ObjectTypeDB::bind_method(_MD("hide_virtual_keyboard"),&_OS::hide_virtual_keyboard); - ObjectTypeDB::bind_method(_MD("print_resources_in_use","short"),&_OS::print_resources_in_use,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("print_all_resources","tofile"),&_OS::print_all_resources,DEFVAL("")); + ClassDB::bind_method(_MD("dump_memory_to_file","file"),&_OS::dump_memory_to_file); + ClassDB::bind_method(_MD("dump_resources_to_file","file"),&_OS::dump_resources_to_file); + ClassDB::bind_method(_MD("has_virtual_keyboard"),&_OS::has_virtual_keyboard); + ClassDB::bind_method(_MD("show_virtual_keyboard", "existing_text"),&_OS::show_virtual_keyboard,DEFVAL("")); + ClassDB::bind_method(_MD("hide_virtual_keyboard"),&_OS::hide_virtual_keyboard); + ClassDB::bind_method(_MD("print_resources_in_use","short"),&_OS::print_resources_in_use,DEFVAL(false)); + ClassDB::bind_method(_MD("print_all_resources","tofile"),&_OS::print_all_resources,DEFVAL("")); - ObjectTypeDB::bind_method(_MD("get_static_memory_usage"),&_OS::get_static_memory_usage); - ObjectTypeDB::bind_method(_MD("get_static_memory_peak_usage"),&_OS::get_static_memory_peak_usage); - ObjectTypeDB::bind_method(_MD("get_dynamic_memory_usage"),&_OS::get_dynamic_memory_usage); + ClassDB::bind_method(_MD("get_static_memory_usage"),&_OS::get_static_memory_usage); + ClassDB::bind_method(_MD("get_static_memory_peak_usage"),&_OS::get_static_memory_peak_usage); + ClassDB::bind_method(_MD("get_dynamic_memory_usage"),&_OS::get_dynamic_memory_usage); - ObjectTypeDB::bind_method(_MD("get_data_dir"),&_OS::get_data_dir); - ObjectTypeDB::bind_method(_MD("get_system_dir","dir"),&_OS::get_system_dir); - ObjectTypeDB::bind_method(_MD("get_unique_ID"),&_OS::get_unique_ID); + ClassDB::bind_method(_MD("get_data_dir"),&_OS::get_data_dir); + ClassDB::bind_method(_MD("get_system_dir","dir"),&_OS::get_system_dir); + ClassDB::bind_method(_MD("get_unique_ID"),&_OS::get_unique_ID); - ObjectTypeDB::bind_method(_MD("is_ok_left_and_cancel_right"),&_OS::is_ok_left_and_cancel_right); + ClassDB::bind_method(_MD("is_ok_left_and_cancel_right"),&_OS::is_ok_left_and_cancel_right); - ObjectTypeDB::bind_method(_MD("get_frames_per_second"),&_OS::get_frames_per_second); + ClassDB::bind_method(_MD("get_frames_per_second"),&_OS::get_frames_per_second); - ObjectTypeDB::bind_method(_MD("print_all_textures_by_size"),&_OS::print_all_textures_by_size); - ObjectTypeDB::bind_method(_MD("print_resources_by_type","types"),&_OS::print_resources_by_type); + ClassDB::bind_method(_MD("print_all_textures_by_size"),&_OS::print_all_textures_by_size); + ClassDB::bind_method(_MD("print_resources_by_type","types"),&_OS::print_resources_by_type); - ObjectTypeDB::bind_method(_MD("native_video_play","path","volume","audio_track","subtitle_track"),&_OS::native_video_play); - ObjectTypeDB::bind_method(_MD("native_video_is_playing"),&_OS::native_video_is_playing); - ObjectTypeDB::bind_method(_MD("native_video_stop"),&_OS::native_video_stop); - ObjectTypeDB::bind_method(_MD("native_video_pause"),&_OS::native_video_pause); - ObjectTypeDB::bind_method(_MD("native_video_unpause"),&_OS::native_video_unpause); + ClassDB::bind_method(_MD("native_video_play","path","volume","audio_track","subtitle_track"),&_OS::native_video_play); + ClassDB::bind_method(_MD("native_video_is_playing"),&_OS::native_video_is_playing); + ClassDB::bind_method(_MD("native_video_stop"),&_OS::native_video_stop); + ClassDB::bind_method(_MD("native_video_pause"),&_OS::native_video_pause); + ClassDB::bind_method(_MD("native_video_unpause"),&_OS::native_video_unpause); - ObjectTypeDB::bind_method(_MD("get_scancode_string","code"),&_OS::get_scancode_string); - ObjectTypeDB::bind_method(_MD("is_scancode_unicode","code"),&_OS::is_scancode_unicode); - ObjectTypeDB::bind_method(_MD("find_scancode_from_string","string"),&_OS::find_scancode_from_string); + ClassDB::bind_method(_MD("get_scancode_string","code"),&_OS::get_scancode_string); + ClassDB::bind_method(_MD("is_scancode_unicode","code"),&_OS::is_scancode_unicode); + ClassDB::bind_method(_MD("find_scancode_from_string","string"),&_OS::find_scancode_from_string); - ObjectTypeDB::bind_method(_MD("set_use_file_access_save_and_swap","enabled"),&_OS::set_use_file_access_save_and_swap); + ClassDB::bind_method(_MD("set_use_file_access_save_and_swap","enabled"),&_OS::set_use_file_access_save_and_swap); - ObjectTypeDB::bind_method(_MD("alert","text","title"),&_OS::alert,DEFVAL("Alert!")); + ClassDB::bind_method(_MD("alert","text","title"),&_OS::alert,DEFVAL("Alert!")); - ObjectTypeDB::bind_method(_MD("set_thread_name","name"),&_OS::set_thread_name); + ClassDB::bind_method(_MD("set_thread_name","name"),&_OS::set_thread_name); - ObjectTypeDB::bind_method(_MD("set_use_vsync","enable"),&_OS::set_use_vsync); - ObjectTypeDB::bind_method(_MD("is_vsync_enabled"),&_OS::is_vsync_enabled); + ClassDB::bind_method(_MD("set_use_vsync","enable"),&_OS::set_use_vsync); + ClassDB::bind_method(_MD("is_vsync_enabled"),&_OS::is_vsync_enabled); - ObjectTypeDB::bind_method(_MD("get_engine_version"),&_OS::get_engine_version); + ClassDB::bind_method(_MD("get_engine_version"),&_OS::get_engine_version); BIND_CONSTANT( DAY_SUNDAY ); BIND_CONSTANT( DAY_MONDAY ); @@ -1232,16 +1245,16 @@ _Geometry *_Geometry::get_singleton() { return singleton; } -DVector<Plane> _Geometry::build_box_planes(const Vector3& p_extents) { +PoolVector<Plane> _Geometry::build_box_planes(const Vector3& p_extents) { return Geometry::build_box_planes(p_extents); } -DVector<Plane> _Geometry::build_cylinder_planes(float p_radius, float p_height, int p_sides, Vector3::Axis p_axis) { +PoolVector<Plane> _Geometry::build_cylinder_planes(float p_radius, float p_height, int p_sides, Vector3::Axis p_axis) { return Geometry::build_cylinder_planes(p_radius,p_height,p_sides,p_axis); } -DVector<Plane> _Geometry::build_capsule_planes(float p_radius, float p_height, int p_sides, int p_lats, Vector3::Axis p_axis) { +PoolVector<Plane> _Geometry::build_capsule_planes(float p_radius, float p_height, int p_sides, int p_lats, Vector3::Axis p_axis) { return Geometry::build_capsule_planes(p_radius,p_height,p_sides,p_lats,p_axis); } @@ -1262,22 +1275,22 @@ Variant _Geometry::segment_intersects_segment_2d(const Vector2& p_from_a,const V }; }; -DVector<Vector2> _Geometry::get_closest_points_between_segments_2d( const Vector2& p1,const Vector2& q1, const Vector2& p2,const Vector2& q2) { +PoolVector<Vector2> _Geometry::get_closest_points_between_segments_2d( const Vector2& p1,const Vector2& q1, const Vector2& p2,const Vector2& q2) { Vector2 r1, r2; Geometry::get_closest_points_between_segments(p1,q1,p2,q2,r1,r2); - DVector<Vector2> r; + PoolVector<Vector2> r; r.resize(2); r.set(0,r1); r.set(1,r2); return r; } -DVector<Vector3> _Geometry::get_closest_points_between_segments(const Vector3& p1,const Vector3& p2,const Vector3& q1,const Vector3& q2) { +PoolVector<Vector3> _Geometry::get_closest_points_between_segments(const Vector3& p1,const Vector3& p2,const Vector3& q1,const Vector3& q2) { Vector3 r1, r2; Geometry::get_closest_points_between_segments(p1,p2,q1,q2,r1,r2); - DVector<Vector3> r; + PoolVector<Vector3> r; r.resize(2); r.set(0,r1); r.set(1,r2); @@ -1314,9 +1327,9 @@ bool _Geometry::point_is_inside_triangle(const Vector2& s, const Vector2& a, con return Geometry::is_point_in_triangle(s,a,b,c); } -DVector<Vector3> _Geometry::segment_intersects_sphere( const Vector3& p_from, const Vector3& p_to, const Vector3& p_sphere_pos,real_t p_sphere_radius) { +PoolVector<Vector3> _Geometry::segment_intersects_sphere( const Vector3& p_from, const Vector3& p_to, const Vector3& p_sphere_pos,real_t p_sphere_radius) { - DVector<Vector3> r; + PoolVector<Vector3> r; Vector3 res,norm; if (!Geometry::segment_intersects_sphere(p_from,p_to,p_sphere_pos,p_sphere_radius,&res,&norm)) return r; @@ -1326,9 +1339,9 @@ DVector<Vector3> _Geometry::segment_intersects_sphere( const Vector3& p_from, co r.set(1,norm); return r; } -DVector<Vector3> _Geometry::segment_intersects_cylinder( const Vector3& p_from, const Vector3& p_to, float p_height,float p_radius) { +PoolVector<Vector3> _Geometry::segment_intersects_cylinder( const Vector3& p_from, const Vector3& p_to, float p_height,float p_radius) { - DVector<Vector3> r; + PoolVector<Vector3> r; Vector3 res,norm; if (!Geometry::segment_intersects_cylinder(p_from,p_to,p_height,p_radius,&res,&norm)) return r; @@ -1339,9 +1352,9 @@ DVector<Vector3> _Geometry::segment_intersects_cylinder( const Vector3& p_from, return r; } -DVector<Vector3> _Geometry::segment_intersects_convex(const Vector3& p_from, const Vector3& p_to,const Vector<Plane>& p_planes) { +PoolVector<Vector3> _Geometry::segment_intersects_convex(const Vector3& p_from, const Vector3& p_to,const Vector<Plane>& p_planes) { - DVector<Vector3> r; + PoolVector<Vector3> r; Vector3 res,norm; if (!Geometry::segment_intersects_convex(p_from,p_to,p_planes.ptr(),p_planes.size(),&res,&norm)) return r; @@ -1396,29 +1409,29 @@ int _Geometry::get_uv84_normal_bit(const Vector3& p_vector) { void _Geometry::_bind_methods() { - ObjectTypeDB::bind_method(_MD("build_box_planes","extents"),&_Geometry::build_box_planes); - ObjectTypeDB::bind_method(_MD("build_cylinder_planes","radius","height","sides","axis"),&_Geometry::build_cylinder_planes,DEFVAL(Vector3::AXIS_Z)); - ObjectTypeDB::bind_method(_MD("build_capsule_planes","radius","height","sides","lats","axis"),&_Geometry::build_capsule_planes,DEFVAL(Vector3::AXIS_Z)); - ObjectTypeDB::bind_method(_MD("segment_intersects_circle","segment_from","segment_to","circle_pos","circle_radius"),&_Geometry::segment_intersects_circle); - ObjectTypeDB::bind_method(_MD("segment_intersects_segment_2d","from_a","to_a","from_b","to_b"),&_Geometry::segment_intersects_segment_2d); + ClassDB::bind_method(_MD("build_box_planes","extents"),&_Geometry::build_box_planes); + ClassDB::bind_method(_MD("build_cylinder_planes","radius","height","sides","axis"),&_Geometry::build_cylinder_planes,DEFVAL(Vector3::AXIS_Z)); + ClassDB::bind_method(_MD("build_capsule_planes","radius","height","sides","lats","axis"),&_Geometry::build_capsule_planes,DEFVAL(Vector3::AXIS_Z)); + ClassDB::bind_method(_MD("segment_intersects_circle","segment_from","segment_to","circle_pos","circle_radius"),&_Geometry::segment_intersects_circle); + ClassDB::bind_method(_MD("segment_intersects_segment_2d","from_a","to_a","from_b","to_b"),&_Geometry::segment_intersects_segment_2d); - ObjectTypeDB::bind_method(_MD("get_closest_points_between_segments_2d","p1","q1","p2","q2"),&_Geometry::get_closest_points_between_segments_2d); - ObjectTypeDB::bind_method(_MD("get_closest_points_between_segments","p1","p2","q1","q2"),&_Geometry::get_closest_points_between_segments); + ClassDB::bind_method(_MD("get_closest_points_between_segments_2d","p1","q1","p2","q2"),&_Geometry::get_closest_points_between_segments_2d); + ClassDB::bind_method(_MD("get_closest_points_between_segments","p1","p2","q1","q2"),&_Geometry::get_closest_points_between_segments); - ObjectTypeDB::bind_method(_MD("get_closest_point_to_segment","point","s1","s2"),&_Geometry::get_closest_point_to_segment); + ClassDB::bind_method(_MD("get_closest_point_to_segment","point","s1","s2"),&_Geometry::get_closest_point_to_segment); - ObjectTypeDB::bind_method(_MD("get_uv84_normal_bit","normal"),&_Geometry::get_uv84_normal_bit); + ClassDB::bind_method(_MD("get_uv84_normal_bit","normal"),&_Geometry::get_uv84_normal_bit); - ObjectTypeDB::bind_method(_MD("ray_intersects_triangle","from","dir","a","b","c"),&_Geometry::ray_intersects_triangle); - ObjectTypeDB::bind_method(_MD("segment_intersects_triangle","from","to","a","b","c"),&_Geometry::segment_intersects_triangle); - ObjectTypeDB::bind_method(_MD("segment_intersects_sphere","from","to","spos","sradius"),&_Geometry::segment_intersects_sphere); - ObjectTypeDB::bind_method(_MD("segment_intersects_cylinder","from","to","height","radius"),&_Geometry::segment_intersects_cylinder); - ObjectTypeDB::bind_method(_MD("segment_intersects_convex","from","to","planes"),&_Geometry::segment_intersects_convex); - ObjectTypeDB::bind_method(_MD("point_is_inside_triangle","point","a","b","c"),&_Geometry::point_is_inside_triangle); + ClassDB::bind_method(_MD("ray_intersects_triangle","from","dir","a","b","c"),&_Geometry::ray_intersects_triangle); + ClassDB::bind_method(_MD("segment_intersects_triangle","from","to","a","b","c"),&_Geometry::segment_intersects_triangle); + ClassDB::bind_method(_MD("segment_intersects_sphere","from","to","spos","sradius"),&_Geometry::segment_intersects_sphere); + ClassDB::bind_method(_MD("segment_intersects_cylinder","from","to","height","radius"),&_Geometry::segment_intersects_cylinder); + ClassDB::bind_method(_MD("segment_intersects_convex","from","to","planes"),&_Geometry::segment_intersects_convex); + ClassDB::bind_method(_MD("point_is_inside_triangle","point","a","b","c"),&_Geometry::point_is_inside_triangle); - ObjectTypeDB::bind_method(_MD("triangulate_polygon","polygon"),&_Geometry::triangulate_polygon); + ClassDB::bind_method(_MD("triangulate_polygon","polygon"),&_Geometry::triangulate_polygon); - ObjectTypeDB::bind_method(_MD("make_atlas","sizes"),&_Geometry::make_atlas); + ClassDB::bind_method(_MD("make_atlas","sizes"),&_Geometry::make_atlas); } @@ -1566,9 +1579,9 @@ real_t _File::get_real() const{ return f->get_real(); } -DVector<uint8_t> _File::get_buffer(int p_length) const{ +PoolVector<uint8_t> _File::get_buffer(int p_length) const{ - DVector<uint8_t> data; + PoolVector<uint8_t> data; ERR_FAIL_COND_V(!f,data); ERR_FAIL_COND_V(p_length<0,data); @@ -1576,11 +1589,11 @@ DVector<uint8_t> _File::get_buffer(int p_length) const{ return data; Error err = data.resize(p_length); ERR_FAIL_COND_V(err!=OK,data); - DVector<uint8_t>::Write w = data.write(); + PoolVector<uint8_t>::Write w = data.write(); int len = f->get_buffer(&w[0],p_length); - ERR_FAIL_COND_V( len < 0 , DVector<uint8_t>()); + ERR_FAIL_COND_V( len < 0 , PoolVector<uint8_t>()); - w = DVector<uint8_t>::Write(); + w = PoolVector<uint8_t>::Write(); if (len < p_length) data.resize(p_length); @@ -1735,7 +1748,7 @@ void _File::store_line(const String& p_string){ f->store_line(p_string); } -void _File::store_buffer(const DVector<uint8_t>& p_buffer){ +void _File::store_buffer(const PoolVector<uint8_t>& p_buffer){ ERR_FAIL_COND(!f); @@ -1743,7 +1756,7 @@ void _File::store_buffer(const DVector<uint8_t>& p_buffer){ if (len==0) return; - DVector<uint8_t>::Read r = p_buffer.read(); + PoolVector<uint8_t>::Read r = p_buffer.read(); f->store_buffer(&r[0],len); } @@ -1762,13 +1775,13 @@ void _File::store_var(const Variant& p_var) { Error err = encode_variant(p_var,NULL,len); ERR_FAIL_COND( err != OK ); - DVector<uint8_t> buff; + PoolVector<uint8_t> buff; buff.resize(len); - DVector<uint8_t>::Write w = buff.write(); + PoolVector<uint8_t>::Write w = buff.write(); err = encode_variant(p_var,&w[0],len); ERR_FAIL_COND( err != OK ); - w=DVector<uint8_t>::Write(); + w=PoolVector<uint8_t>::Write(); store_32(len); store_buffer(buff); @@ -1778,10 +1791,10 @@ Variant _File::get_var() const { ERR_FAIL_COND_V(!f,Variant()); uint32_t len = get_32(); - DVector<uint8_t> buff = get_buffer(len); + PoolVector<uint8_t> buff = get_buffer(len); ERR_FAIL_COND_V(buff.size() != len, Variant()); - DVector<uint8_t>::Read r = buff.read(); + PoolVector<uint8_t>::Read r = buff.read(); Variant v; Error err = decode_variant(v,&r[0],len); @@ -1793,51 +1806,51 @@ Variant _File::get_var() const { void _File::_bind_methods() { - ObjectTypeDB::bind_method(_MD("open_encrypted","path","mode_flags","key"),&_File::open_encrypted); - ObjectTypeDB::bind_method(_MD("open_encrypted_with_pass","path","mode_flags","pass"),&_File::open_encrypted_pass); - - ObjectTypeDB::bind_method(_MD("open","path","flags"),&_File::open); - ObjectTypeDB::bind_method(_MD("close"),&_File::close); - ObjectTypeDB::bind_method(_MD("is_open"),&_File::is_open); - ObjectTypeDB::bind_method(_MD("seek","pos"),&_File::seek); - ObjectTypeDB::bind_method(_MD("seek_end","pos"),&_File::seek_end,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("get_pos"),&_File::get_pos); - ObjectTypeDB::bind_method(_MD("get_len"),&_File::get_len); - ObjectTypeDB::bind_method(_MD("eof_reached"),&_File::eof_reached); - ObjectTypeDB::bind_method(_MD("get_8"),&_File::get_8); - ObjectTypeDB::bind_method(_MD("get_16"),&_File::get_16); - ObjectTypeDB::bind_method(_MD("get_32"),&_File::get_32); - ObjectTypeDB::bind_method(_MD("get_64"),&_File::get_64); - ObjectTypeDB::bind_method(_MD("get_float"),&_File::get_float); - ObjectTypeDB::bind_method(_MD("get_double"),&_File::get_double); - ObjectTypeDB::bind_method(_MD("get_real"),&_File::get_real); - ObjectTypeDB::bind_method(_MD("get_buffer","len"),&_File::get_buffer); - ObjectTypeDB::bind_method(_MD("get_line"),&_File::get_line); - ObjectTypeDB::bind_method(_MD("get_as_text"),&_File::get_as_text); - ObjectTypeDB::bind_method(_MD("get_md5","path"),&_File::get_md5); - ObjectTypeDB::bind_method(_MD("get_sha256","path"),&_File::get_sha256); - ObjectTypeDB::bind_method(_MD("get_endian_swap"),&_File::get_endian_swap); - ObjectTypeDB::bind_method(_MD("set_endian_swap","enable"),&_File::set_endian_swap); - ObjectTypeDB::bind_method(_MD("get_error:Error"),&_File::get_error); - ObjectTypeDB::bind_method(_MD("get_var"),&_File::get_var); - ObjectTypeDB::bind_method(_MD("get_csv_line","delim"),&_File::get_csv_line,DEFVAL(",")); - - ObjectTypeDB::bind_method(_MD("store_8","value"),&_File::store_8); - ObjectTypeDB::bind_method(_MD("store_16","value"),&_File::store_16); - ObjectTypeDB::bind_method(_MD("store_32","value"),&_File::store_32); - ObjectTypeDB::bind_method(_MD("store_64","value"),&_File::store_64); - ObjectTypeDB::bind_method(_MD("store_float","value"),&_File::store_float); - ObjectTypeDB::bind_method(_MD("store_double","value"),&_File::store_double); - ObjectTypeDB::bind_method(_MD("store_real","value"),&_File::store_real); - ObjectTypeDB::bind_method(_MD("store_buffer","buffer"),&_File::store_buffer); - ObjectTypeDB::bind_method(_MD("store_line","line"),&_File::store_line); - ObjectTypeDB::bind_method(_MD("store_string","string"),&_File::store_string); - ObjectTypeDB::bind_method(_MD("store_var","value"),&_File::store_var); - - ObjectTypeDB::bind_method(_MD("store_pascal_string","string"),&_File::store_pascal_string); - ObjectTypeDB::bind_method(_MD("get_pascal_string"),&_File::get_pascal_string); - - ObjectTypeDB::bind_method(_MD("file_exists","path"),&_File::file_exists); + ClassDB::bind_method(_MD("open_encrypted","path","mode_flags","key"),&_File::open_encrypted); + ClassDB::bind_method(_MD("open_encrypted_with_pass","path","mode_flags","pass"),&_File::open_encrypted_pass); + + ClassDB::bind_method(_MD("open","path","flags"),&_File::open); + ClassDB::bind_method(_MD("close"),&_File::close); + ClassDB::bind_method(_MD("is_open"),&_File::is_open); + ClassDB::bind_method(_MD("seek","pos"),&_File::seek); + ClassDB::bind_method(_MD("seek_end","pos"),&_File::seek_end,DEFVAL(0)); + ClassDB::bind_method(_MD("get_pos"),&_File::get_pos); + ClassDB::bind_method(_MD("get_len"),&_File::get_len); + ClassDB::bind_method(_MD("eof_reached"),&_File::eof_reached); + ClassDB::bind_method(_MD("get_8"),&_File::get_8); + ClassDB::bind_method(_MD("get_16"),&_File::get_16); + ClassDB::bind_method(_MD("get_32"),&_File::get_32); + ClassDB::bind_method(_MD("get_64"),&_File::get_64); + ClassDB::bind_method(_MD("get_float"),&_File::get_float); + ClassDB::bind_method(_MD("get_double"),&_File::get_double); + ClassDB::bind_method(_MD("get_real"),&_File::get_real); + ClassDB::bind_method(_MD("get_buffer","len"),&_File::get_buffer); + ClassDB::bind_method(_MD("get_line"),&_File::get_line); + ClassDB::bind_method(_MD("get_as_text"),&_File::get_as_text); + ClassDB::bind_method(_MD("get_md5","path"),&_File::get_md5); + ClassDB::bind_method(_MD("get_sha256","path"),&_File::get_sha256); + ClassDB::bind_method(_MD("get_endian_swap"),&_File::get_endian_swap); + ClassDB::bind_method(_MD("set_endian_swap","enable"),&_File::set_endian_swap); + ClassDB::bind_method(_MD("get_error:Error"),&_File::get_error); + ClassDB::bind_method(_MD("get_var"),&_File::get_var); + ClassDB::bind_method(_MD("get_csv_line","delim"),&_File::get_csv_line,DEFVAL(",")); + + ClassDB::bind_method(_MD("store_8","value"),&_File::store_8); + ClassDB::bind_method(_MD("store_16","value"),&_File::store_16); + ClassDB::bind_method(_MD("store_32","value"),&_File::store_32); + ClassDB::bind_method(_MD("store_64","value"),&_File::store_64); + ClassDB::bind_method(_MD("store_float","value"),&_File::store_float); + ClassDB::bind_method(_MD("store_double","value"),&_File::store_double); + ClassDB::bind_method(_MD("store_real","value"),&_File::store_real); + ClassDB::bind_method(_MD("store_buffer","buffer"),&_File::store_buffer); + ClassDB::bind_method(_MD("store_line","line"),&_File::store_line); + ClassDB::bind_method(_MD("store_string","string"),&_File::store_string); + ClassDB::bind_method(_MD("store_var","value"),&_File::store_var); + + ClassDB::bind_method(_MD("store_pascal_string","string"),&_File::store_pascal_string); + ClassDB::bind_method(_MD("get_pascal_string"),&_File::get_pascal_string); + + ClassDB::bind_method(_MD("file_exists","path"),&_File::file_exists); BIND_CONSTANT( READ ); BIND_CONSTANT( WRITE ); @@ -2011,24 +2024,24 @@ Error _Directory::remove(String p_name){ void _Directory::_bind_methods() { - ObjectTypeDB::bind_method(_MD("open:Error","path"),&_Directory::open); - ObjectTypeDB::bind_method(_MD("list_dir_begin"),&_Directory::list_dir_begin); - ObjectTypeDB::bind_method(_MD("get_next"),&_Directory::get_next); - ObjectTypeDB::bind_method(_MD("current_is_dir"),&_Directory::current_is_dir); - ObjectTypeDB::bind_method(_MD("list_dir_end"),&_Directory::list_dir_end); - ObjectTypeDB::bind_method(_MD("get_drive_count"),&_Directory::get_drive_count); - ObjectTypeDB::bind_method(_MD("get_drive","idx"),&_Directory::get_drive); - ObjectTypeDB::bind_method(_MD("change_dir:Error","todir"),&_Directory::change_dir); - ObjectTypeDB::bind_method(_MD("get_current_dir"),&_Directory::get_current_dir); - ObjectTypeDB::bind_method(_MD("make_dir:Error","path"),&_Directory::make_dir); - ObjectTypeDB::bind_method(_MD("make_dir_recursive:Error","path"),&_Directory::make_dir_recursive); - ObjectTypeDB::bind_method(_MD("file_exists","path"),&_Directory::file_exists); - ObjectTypeDB::bind_method(_MD("dir_exists","path"),&_Directory::dir_exists); -// ObjectTypeDB::bind_method(_MD("get_modified_time","file"),&_Directory::get_modified_time); - ObjectTypeDB::bind_method(_MD("get_space_left"),&_Directory::get_space_left); - ObjectTypeDB::bind_method(_MD("copy:Error","from","to"),&_Directory::copy); - ObjectTypeDB::bind_method(_MD("rename:Error","from","to"),&_Directory::rename); - ObjectTypeDB::bind_method(_MD("remove:Error","path"),&_Directory::remove); + ClassDB::bind_method(_MD("open:Error","path"),&_Directory::open); + ClassDB::bind_method(_MD("list_dir_begin"),&_Directory::list_dir_begin); + ClassDB::bind_method(_MD("get_next"),&_Directory::get_next); + ClassDB::bind_method(_MD("current_is_dir"),&_Directory::current_is_dir); + ClassDB::bind_method(_MD("list_dir_end"),&_Directory::list_dir_end); + ClassDB::bind_method(_MD("get_drive_count"),&_Directory::get_drive_count); + ClassDB::bind_method(_MD("get_drive","idx"),&_Directory::get_drive); + ClassDB::bind_method(_MD("change_dir:Error","todir"),&_Directory::change_dir); + ClassDB::bind_method(_MD("get_current_dir"),&_Directory::get_current_dir); + ClassDB::bind_method(_MD("make_dir:Error","path"),&_Directory::make_dir); + ClassDB::bind_method(_MD("make_dir_recursive:Error","path"),&_Directory::make_dir_recursive); + ClassDB::bind_method(_MD("file_exists","path"),&_Directory::file_exists); + ClassDB::bind_method(_MD("dir_exists","path"),&_Directory::dir_exists); +// ClassDB::bind_method(_MD("get_modified_time","file"),&_Directory::get_modified_time); + ClassDB::bind_method(_MD("get_space_left"),&_Directory::get_space_left); + ClassDB::bind_method(_MD("copy:Error","from","to"),&_Directory::copy); + ClassDB::bind_method(_MD("rename:Error","from","to"),&_Directory::rename); + ClassDB::bind_method(_MD("remove:Error","path"),&_Directory::remove); } @@ -2056,17 +2069,17 @@ String _Marshalls::variant_to_base64(const Variant& p_var) { Error err = encode_variant(p_var,NULL,len); ERR_FAIL_COND_V( err != OK, "" ); - DVector<uint8_t> buff; + PoolVector<uint8_t> buff; buff.resize(len); - DVector<uint8_t>::Write w = buff.write(); + PoolVector<uint8_t>::Write w = buff.write(); err = encode_variant(p_var,&w[0],len); ERR_FAIL_COND_V( err != OK, "" ); int b64len = len / 3 * 4 + 4 + 1; - DVector<uint8_t> b64buff; + PoolVector<uint8_t> b64buff; b64buff.resize(b64len); - DVector<uint8_t>::Write w64 = b64buff.write(); + PoolVector<uint8_t>::Write w64 = b64buff.write(); int strlen = base64_encode((char*)(&w64[0]), (char*)(&w[0]), len); //OS::get_singleton()->print("len is %i, vector size is %i\n", b64len, strlen); @@ -2081,9 +2094,9 @@ Variant _Marshalls::base64_to_variant(const String& p_str) { int strlen = p_str.length(); CharString cstr = p_str.ascii(); - DVector<uint8_t> buf; + PoolVector<uint8_t> buf; buf.resize(strlen / 4 * 3 + 1); - DVector<uint8_t>::Write w = buf.write(); + PoolVector<uint8_t>::Write w = buf.write(); int len = base64_decode((char*)(&w[0]), (char*)cstr.get_data(), strlen); @@ -2094,15 +2107,15 @@ Variant _Marshalls::base64_to_variant(const String& p_str) { return v; }; -String _Marshalls::raw_to_base64(const DVector<uint8_t> &p_arr) { +String _Marshalls::raw_to_base64(const PoolVector<uint8_t> &p_arr) { int len = p_arr.size(); - DVector<uint8_t>::Read r = p_arr.read(); + PoolVector<uint8_t>::Read r = p_arr.read(); int b64len = len / 3 * 4 + 4 + 1; - DVector<uint8_t> b64buff; + PoolVector<uint8_t> b64buff; b64buff.resize(b64len); - DVector<uint8_t>::Write w64 = b64buff.write(); + PoolVector<uint8_t>::Write w64 = b64buff.write(); int strlen = base64_encode((char*)(&w64[0]), (char*)(&r[0]), len); w64[strlen] = 0; @@ -2111,22 +2124,22 @@ String _Marshalls::raw_to_base64(const DVector<uint8_t> &p_arr) { return ret; }; -DVector<uint8_t> _Marshalls::base64_to_raw(const String &p_str) { +PoolVector<uint8_t> _Marshalls::base64_to_raw(const String &p_str) { int strlen = p_str.length(); CharString cstr = p_str.ascii(); int arr_len; - DVector<uint8_t> buf; + PoolVector<uint8_t> buf; { buf.resize(strlen / 4 * 3 + 1); - DVector<uint8_t>::Write w = buf.write(); + PoolVector<uint8_t>::Write w = buf.write(); arr_len = base64_decode((char*)(&w[0]), (char*)cstr.get_data(), strlen); }; buf.resize(arr_len); - // conversion from DVector<uint8_t> to raw array? + // conversion from PoolVector<uint8_t> to raw array? return buf; }; @@ -2136,9 +2149,9 @@ String _Marshalls::utf8_to_base64(const String& p_str) { int len = cstr.length(); int b64len = len / 3 * 4 + 4 + 1; - DVector<uint8_t> b64buff; + PoolVector<uint8_t> b64buff; b64buff.resize(b64len); - DVector<uint8_t>::Write w64 = b64buff.write(); + PoolVector<uint8_t>::Write w64 = b64buff.write(); int strlen = base64_encode((char*)(&w64[0]), (char*)cstr.get_data(), len); @@ -2153,9 +2166,9 @@ String _Marshalls::base64_to_utf8(const String& p_str) { int strlen = p_str.length(); CharString cstr = p_str.ascii(); - DVector<uint8_t> buf; + PoolVector<uint8_t> buf; buf.resize(strlen / 4 * 3 + 1 + 1); - DVector<uint8_t>::Write w = buf.write(); + PoolVector<uint8_t>::Write w = buf.write(); int len = base64_decode((char*)(&w[0]), (char*)cstr.get_data(), strlen); @@ -2168,14 +2181,14 @@ String _Marshalls::base64_to_utf8(const String& p_str) { void _Marshalls::_bind_methods() { - ObjectTypeDB::bind_method(_MD("variant_to_base64:String","variant"),&_Marshalls::variant_to_base64); - ObjectTypeDB::bind_method(_MD("base64_to_variant:Variant","base64_str"),&_Marshalls::base64_to_variant); + ClassDB::bind_method(_MD("variant_to_base64:String","variant"),&_Marshalls::variant_to_base64); + ClassDB::bind_method(_MD("base64_to_variant:Variant","base64_str"),&_Marshalls::base64_to_variant); - ObjectTypeDB::bind_method(_MD("raw_to_base64:String","array"),&_Marshalls::raw_to_base64); - ObjectTypeDB::bind_method(_MD("base64_to_raw:RawArray","base64_str"),&_Marshalls::base64_to_raw); + ClassDB::bind_method(_MD("raw_to_base64:String","array"),&_Marshalls::raw_to_base64); + ClassDB::bind_method(_MD("base64_to_raw:RawArray","base64_str"),&_Marshalls::base64_to_raw); - ObjectTypeDB::bind_method(_MD("utf8_to_base64:String","utf8_str"),&_Marshalls::utf8_to_base64); - ObjectTypeDB::bind_method(_MD("base64_to_utf8:String","base64_str"),&_Marshalls::base64_to_utf8); + ClassDB::bind_method(_MD("utf8_to_base64:String","utf8_str"),&_Marshalls::utf8_to_base64); + ClassDB::bind_method(_MD("base64_to_utf8:String","base64_str"),&_Marshalls::base64_to_utf8); }; @@ -2199,8 +2212,8 @@ Error _Semaphore::post() { void _Semaphore::_bind_methods() { - ObjectTypeDB::bind_method(_MD("wait:Error"),&_Semaphore::wait); - ObjectTypeDB::bind_method(_MD("post:Error"),&_Semaphore::post); + ClassDB::bind_method(_MD("wait:Error"),&_Semaphore::wait); + ClassDB::bind_method(_MD("post:Error"),&_Semaphore::post); } @@ -2236,9 +2249,9 @@ void _Mutex::unlock(){ void _Mutex::_bind_methods() { - ObjectTypeDB::bind_method(_MD("lock"),&_Mutex::lock); - ObjectTypeDB::bind_method(_MD("try_lock:Error"),&_Mutex::try_lock); - ObjectTypeDB::bind_method(_MD("unlock"),&_Mutex::unlock); + ClassDB::bind_method(_MD("lock"),&_Mutex::lock); + ClassDB::bind_method(_MD("try_lock:Error"),&_Mutex::try_lock); + ClassDB::bind_method(_MD("unlock"),&_Mutex::unlock); } @@ -2358,10 +2371,10 @@ Variant _Thread::wait_to_finish() { void _Thread::_bind_methods() { - ObjectTypeDB::bind_method(_MD("start:Error","instance","method","userdata","priority"),&_Thread::start,DEFVAL(Variant()),DEFVAL(PRIORITY_NORMAL)); - ObjectTypeDB::bind_method(_MD("get_id"),&_Thread::get_id); - ObjectTypeDB::bind_method(_MD("is_active"),&_Thread::is_active); - ObjectTypeDB::bind_method(_MD("wait_to_finish:Variant"),&_Thread::wait_to_finish); + ClassDB::bind_method(_MD("start:Error","instance","method","userdata","priority"),&_Thread::start,DEFVAL(Variant()),DEFVAL(PRIORITY_NORMAL)); + ClassDB::bind_method(_MD("get_id"),&_Thread::get_id); + ClassDB::bind_method(_MD("is_active"),&_Thread::is_active); + ClassDB::bind_method(_MD("wait_to_finish:Variant"),&_Thread::wait_to_finish); BIND_CONSTANT( PRIORITY_LOW ); BIND_CONSTANT( PRIORITY_NORMAL ); @@ -2382,3 +2395,204 @@ _Thread::~_Thread() { } ERR_FAIL_COND(active==true); } +///////////////////////////////////// + + +PoolStringArray _ClassDB::get_class_list() const { + + List<StringName> classes; + ClassDB::get_class_list(&classes); + + PoolStringArray ret; + ret.resize(classes.size()); + int idx=0; + for (List<StringName>::Element *E=classes.front();E;E=E->next()) { + ret.set(idx++,E->get()); + } + + return ret; + +} +PoolStringArray _ClassDB::get_inheriters_from_class( const StringName& p_class) const { + + List<StringName> classes; + ClassDB::get_inheriters_from_class(p_class,&classes); + + PoolStringArray ret; + ret.resize(classes.size()); + int idx=0; + for (List<StringName>::Element *E=classes.front();E;E=E->next()) { + ret.set(idx++,E->get()); + } + + return ret; +} +StringName _ClassDB::get_parent_class(const StringName& p_class) const { + + return ClassDB::get_parent_class(p_class); +} +bool _ClassDB::class_exists(const StringName &p_class) const { + + return ClassDB::class_exists(p_class); +} +bool _ClassDB::is_parent_class(const StringName &p_class,const StringName& p_inherits) const { + + return ClassDB::is_parent_class(p_class,p_inherits); +} +bool _ClassDB::can_instance(const StringName &p_class) const { + + return ClassDB::can_instance(p_class); +} +Variant _ClassDB::instance(const StringName &p_class) const { + + Object *obj = ClassDB::instance(p_class); + if (!obj) + return Variant(); + + Reference *r = obj->cast_to<Reference>(); + if (r) { + return REF(r); + } else { + return obj; + } +} + +bool _ClassDB::has_signal(StringName p_class,StringName p_signal) const { + + return ClassDB::has_signal(p_class,p_signal); +} +Dictionary _ClassDB::get_signal(StringName p_class,StringName p_signal) const { + + MethodInfo signal; + if (ClassDB::get_signal(p_class,p_signal,&signal)) { + return signal.operator Dictionary(); + } else { + return Dictionary(); + } + +} +Array _ClassDB::get_signal_list(StringName p_class,bool p_no_inheritance) const { + + List<MethodInfo> signals; + ClassDB::get_signal_list(p_class,&signals,p_no_inheritance); + Array ret; + + for (List<MethodInfo>::Element *E=signals.front();E;E=E->next()) { + ret.push_back(E->get().operator Dictionary()); + } + + return ret; +} + +Array _ClassDB::get_property_list(StringName p_class, bool p_no_inheritance) const { + + List<PropertyInfo> plist; + ClassDB::get_property_list(p_class,&plist,p_no_inheritance); + Array ret; + for (List<PropertyInfo>::Element *E=plist.front();E;E=E->next()) { + ret.push_back(E->get().operator Dictionary()); + } + + return ret; + + +} + +bool _ClassDB::has_method(StringName p_class,StringName p_method,bool p_no_inheritance) const { + + return ClassDB::has_method(p_class,p_method,p_no_inheritance); +} + + +Array _ClassDB::get_method_list(StringName p_class,bool p_no_inheritance) const { + + List<MethodInfo> methods; + ClassDB::get_method_list(p_class,&methods,p_no_inheritance); + Array ret; + + for (List<MethodInfo>::Element *E=methods.front();E;E=E->next()) { + ret.push_back(E->get().operator Dictionary()); + } + + return ret; +} + +PoolStringArray _ClassDB::get_integer_constant_list(const StringName& p_class, bool p_no_inheritance) const { + + List<String> constants; + ClassDB::get_integer_constant_list(p_class,&constants,p_no_inheritance); + + PoolStringArray ret; + ret.resize(constants.size()); + int idx=0; + for (List<String>::Element *E=constants.front();E;E=E->next()) { + ret.set(idx++,E->get()); + } + + return ret; +} + +bool _ClassDB::has_integer_constant(const StringName& p_class, const StringName &p_name) const { + + bool success; + ClassDB::get_integer_constant(p_class,p_name,&success); + return success; +} + +int _ClassDB::get_integer_constant(const StringName& p_class, const StringName &p_name) const { + + bool found; + int c = ClassDB::get_integer_constant(p_class,p_name,&found); + ERR_FAIL_COND_V(!found,0); + return c; + +} +StringName _ClassDB::get_category(const StringName& p_node) const { + + return ClassDB::get_category(p_node); +} + +bool _ClassDB::is_class_enabled(StringName p_class) const { + + return ClassDB::is_class_enabled(p_class); +} + +void _ClassDB::_bind_methods() { + + ClassDB::bind_method(_MD("get_class_list"),&_ClassDB::get_class_list); + ClassDB::bind_method(_MD("get_inheriters_from_class","class"),&_ClassDB::get_inheriters_from_class); + ClassDB::bind_method(_MD("get_parent_class","class"),&_ClassDB::get_parent_class); + ClassDB::bind_method(_MD("class_exists","class"),&_ClassDB::class_exists); + ClassDB::bind_method(_MD("is_parent_class","class","inherits"),&_ClassDB::is_parent_class); + ClassDB::bind_method(_MD("can_instance","class"),&_ClassDB::can_instance); + ClassDB::bind_method(_MD("instance","class"),&_ClassDB::instance); + + ClassDB::bind_method(_MD("has_signal","class","signal"),&_ClassDB::has_signal); + ClassDB::bind_method(_MD("get_signal","class","signal"),&_ClassDB::get_signal); + ClassDB::bind_method(_MD("get_signal_list","class","no_inheritance"),&_ClassDB::get_signal_list,DEFVAL(false)); + + ClassDB::bind_method(_MD("get_property_list","class","no_inheritance"),&_ClassDB::get_property_list,DEFVAL(false)); + + ClassDB::bind_method(_MD("has_method","class","method","no_inheritance"),&_ClassDB::has_method,DEFVAL(false)); + + ClassDB::bind_method(_MD("get_method_list","class","no_inheritance"),&_ClassDB::get_method_list,DEFVAL(false)); + + ClassDB::bind_method(_MD("get_integer_constant_list","class","no_inheritance"),&_ClassDB::get_integer_constant_list,DEFVAL(false)); + + ClassDB::bind_method(_MD("has_integer_constant","class","name"),&_ClassDB::has_integer_constant); + ClassDB::bind_method(_MD("get_integer_constant","class","name"),&_ClassDB::get_integer_constant); + + ClassDB::bind_method(_MD("get_category","class"),&_ClassDB::get_category); + ClassDB::bind_method(_MD("is_class_enabled","class"),&_ClassDB::is_class_enabled); + + +} + +_ClassDB::_ClassDB(){ + + +} +_ClassDB::~_ClassDB(){ + + +} diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h index 2fb7f93cef..d491483d82 100644 --- a/core/bind/core_bind.h +++ b/core/bind/core_bind.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -38,7 +38,7 @@ class _ResourceLoader : public Object { - OBJ_TYPE(_ResourceLoader,Object); + GDCLASS(_ResourceLoader,Object); protected: @@ -50,9 +50,9 @@ public: static _ResourceLoader *get_singleton() { return singleton; } Ref<ResourceInteractiveLoader> load_interactive(const String& p_path,const String& p_type_hint=""); RES load(const String &p_path,const String& p_type_hint="", bool p_no_cache = false); - DVector<String> get_recognized_extensions_for_type(const String& p_type); + PoolVector<String> get_recognized_extensions_for_type(const String& p_type); void set_abort_on_missing_resources(bool p_abort); - StringArray get_dependencies(const String& p_path); + PoolStringArray get_dependencies(const String& p_path); bool has(const String& p_path); Ref<ResourceImportMetadata> load_import_metadata(const String& p_path); @@ -60,7 +60,7 @@ public: }; class _ResourceSaver : public Object { - OBJ_TYPE(_ResourceSaver,Object); + GDCLASS(_ResourceSaver,Object); protected: @@ -81,7 +81,7 @@ public: static _ResourceSaver *get_singleton() { return singleton; } Error save(const String &p_path,const RES& p_resource, uint32_t p_flags); - DVector<String> get_recognized_extensions(const RES& p_resource); + PoolVector<String> get_recognized_extensions(const RES& p_resource); _ResourceSaver(); @@ -90,7 +90,7 @@ public: class MainLoop; class _OS : public Object { - OBJ_TYPE(_OS,Object); + GDCLASS(_OS,Object); protected: @@ -246,6 +246,9 @@ public: void set_use_file_access_save_and_swap(bool p_enable); void set_icon(const Image& p_icon); + + int get_exit_code() const; + void set_exit_code(int p_code); Dictionary get_date(bool utc) const; Dictionary get_time(bool utc) const; Dictionary get_datetime(bool utc) const; @@ -333,7 +336,7 @@ VARIANT_ENUM_CAST(_OS::ScreenOrientation); class _Geometry : public Object { - OBJ_TYPE(_Geometry, Object); + GDCLASS(_Geometry, Object); static _Geometry *singleton; protected: @@ -342,20 +345,20 @@ protected: public: static _Geometry *get_singleton(); - DVector<Plane> build_box_planes(const Vector3& p_extents); - DVector<Plane> build_cylinder_planes(float p_radius, float p_height, int p_sides, Vector3::Axis p_axis=Vector3::AXIS_Z); - DVector<Plane> build_capsule_planes(float p_radius, float p_height, int p_sides, int p_lats, Vector3::Axis p_axis=Vector3::AXIS_Z); + PoolVector<Plane> build_box_planes(const Vector3& p_extents); + PoolVector<Plane> build_cylinder_planes(float p_radius, float p_height, int p_sides, Vector3::Axis p_axis=Vector3::AXIS_Z); + PoolVector<Plane> build_capsule_planes(float p_radius, float p_height, int p_sides, int p_lats, Vector3::Axis p_axis=Vector3::AXIS_Z); Variant segment_intersects_segment_2d(const Vector2& p_from_a,const Vector2& p_to_a,const Vector2& p_from_b,const Vector2& p_to_b); - DVector<Vector2> get_closest_points_between_segments_2d( const Vector2& p1,const Vector2& q1, const Vector2& p2,const Vector2& q2); - DVector<Vector3> get_closest_points_between_segments(const Vector3& p1,const Vector3& p2,const Vector3& q1,const Vector3& q2); + PoolVector<Vector2> get_closest_points_between_segments_2d( const Vector2& p1,const Vector2& q1, const Vector2& p2,const Vector2& q2); + PoolVector<Vector3> get_closest_points_between_segments(const Vector3& p1,const Vector3& p2,const Vector3& q1,const Vector3& q2); Vector3 get_closest_point_to_segment(const Vector3& p_point, const Vector3& p_a,const Vector3& p_b); Variant ray_intersects_triangle( const Vector3& p_from, const Vector3& p_dir, const Vector3& p_v0,const Vector3& p_v1,const Vector3& p_v2); Variant segment_intersects_triangle( const Vector3& p_from, const Vector3& p_to, const Vector3& p_v0,const Vector3& p_v1,const Vector3& p_v2); bool point_is_inside_triangle(const Vector2& s, const Vector2& a, const Vector2& b, const Vector2& c) const; - DVector<Vector3> segment_intersects_sphere( const Vector3& p_from, const Vector3& p_to, const Vector3& p_sphere_pos,real_t p_sphere_radius); - DVector<Vector3> segment_intersects_cylinder( const Vector3& p_from, const Vector3& p_to, float p_height,float p_radius); - DVector<Vector3> segment_intersects_convex(const Vector3& p_from, const Vector3& p_to,const Vector<Plane>& p_planes); + PoolVector<Vector3> segment_intersects_sphere( const Vector3& p_from, const Vector3& p_to, const Vector3& p_sphere_pos,real_t p_sphere_radius); + PoolVector<Vector3> segment_intersects_cylinder( const Vector3& p_from, const Vector3& p_to, float p_height,float p_radius); + PoolVector<Vector3> segment_intersects_convex(const Vector3& p_from, const Vector3& p_to,const Vector<Plane>& p_planes); real_t segment_intersects_circle(const Vector2& p_from, const Vector2& p_to, const Vector2& p_circle_pos, real_t p_circle_radius); int get_uv84_normal_bit(const Vector3& p_vector); @@ -371,7 +374,7 @@ public: class _File : public Reference { - OBJ_TYPE(_File,Reference); + GDCLASS(_File,Reference); FileAccess *f; bool eswap; protected: @@ -413,7 +416,7 @@ public: Variant get_var() const; - DVector<uint8_t> get_buffer(int p_length) const; ///< get an array of bytes + PoolVector<uint8_t> get_buffer(int p_length) const; ///< get an array of bytes String get_line() const; String get_as_text() const; String get_md5(const String& p_path) const; @@ -447,7 +450,7 @@ public: Vector<String> get_csv_line(String delim=",") const; - void store_buffer(const DVector<uint8_t>& p_buffer); ///< store an array of bytes + void store_buffer(const PoolVector<uint8_t>& p_buffer); ///< store an array of bytes void store_var(const Variant& p_var); @@ -460,7 +463,7 @@ public: class _Directory : public Reference { - OBJ_TYPE(_Directory,Reference); + GDCLASS(_Directory,Reference); DirAccess *d; protected: @@ -501,7 +504,7 @@ public: class _Marshalls : public Reference { - OBJ_TYPE(_Marshalls,Reference); + GDCLASS(_Marshalls,Reference); static _Marshalls* singleton; @@ -517,8 +520,8 @@ public: String variant_to_base64(const Variant& p_var); Variant base64_to_variant(const String& p_str); - String raw_to_base64(const DVector<uint8_t>& p_arr); - DVector<uint8_t> base64_to_raw(const String& p_str); + String raw_to_base64(const PoolVector<uint8_t>& p_arr); + PoolVector<uint8_t> base64_to_raw(const String& p_str); String utf8_to_base64(const String& p_str); String base64_to_utf8(const String& p_str); @@ -530,7 +533,7 @@ public: class _Mutex : public Reference { - OBJ_TYPE(_Mutex,Reference); + GDCLASS(_Mutex,Reference); Mutex *mutex; static void _bind_methods(); @@ -546,7 +549,7 @@ public: class _Semaphore : public Reference { - OBJ_TYPE(_Semaphore,Reference); + GDCLASS(_Semaphore,Reference); Semaphore *semaphore; static void _bind_methods(); @@ -561,7 +564,7 @@ public: class _Thread : public Reference { - OBJ_TYPE(_Thread,Reference); + GDCLASS(_Thread,Reference); protected: @@ -591,4 +594,42 @@ public: ~_Thread(); }; +class _ClassDB : public Object { + + GDCLASS(_ClassDB,Object) + +protected: + static void _bind_methods(); +public: + + PoolStringArray get_class_list() const; + PoolStringArray get_inheriters_from_class( const StringName& p_class) const; + StringName get_parent_class(const StringName& p_class) const; + bool class_exists(const StringName &p_class) const; + bool is_parent_class(const StringName &p_class,const StringName& p_inherits) const; + bool can_instance(const StringName &p_class) const; + Variant instance(const StringName &p_class) const; + + bool has_signal(StringName p_class,StringName p_signal) const; + Dictionary get_signal(StringName p_class,StringName p_signal) const; + Array get_signal_list(StringName p_class,bool p_no_inheritance=false) const; + + Array get_property_list(StringName p_class, bool p_no_inheritance=false) const; + + bool has_method(StringName p_class,StringName p_method,bool p_no_inheritance=false) const; + + + Array get_method_list(StringName p_class,bool p_no_inheritance=false) const; + + PoolStringArray get_integer_constant_list(const StringName& p_class, bool p_no_inheritance=false) const; + bool has_integer_constant(const StringName& p_class, const StringName &p_name) const; + int get_integer_constant(const StringName& p_class, const StringName &p_name) const; + StringName get_category(const StringName& p_node) const; + + bool is_class_enabled(StringName p_class) const; + + _ClassDB(); + ~_ClassDB(); +}; + #endif // CORE_BIND_H diff --git a/core/color.cpp b/core/color.cpp index 532c1bd1c2..89accbb6d2 100644 --- a/core/color.cpp +++ b/core/color.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/color.h b/core/color.h index 72157c4a2d..50a6761340 100644 --- a/core/color.h +++ b/core/color.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/command_queue_mt.cpp b/core/command_queue_mt.cpp index acd3aeddfb..9b1c052eb9 100644 --- a/core/command_queue_mt.cpp +++ b/core/command_queue_mt.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/command_queue_mt.h b/core/command_queue_mt.h index 409543bf25..779bbe1b58 100644 --- a/core/command_queue_mt.h +++ b/core/command_queue_mt.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/compressed_translation.cpp b/core/compressed_translation.cpp index b104b8062a..71f810422a 100644 --- a/core/compressed_translation.cpp +++ b/core/compressed_translation.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -356,8 +356,8 @@ void PHashTranslation::generate(const Ref<Translation> &p_from) { hash_table.resize(size); bucket_table.resize(bucket_table_size); - DVector<int>::Write htwb = hash_table.write(); - DVector<int>::Write btwb = bucket_table.write(); + PoolVector<int>::Write htwb = hash_table.write(); + PoolVector<int>::Write btwb = bucket_table.write(); uint32_t *htw = (uint32_t*)&htwb[0]; uint32_t *btw = (uint32_t*)&btwb[0]; @@ -392,7 +392,7 @@ void PHashTranslation::generate(const Ref<Translation> &p_from) { print_line("total collisions: "+itos(collisions)); strings.resize(total_compression_size); - DVector<uint8_t>::Write cw = strings.write(); + PoolVector<uint8_t>::Write cw = strings.write(); for(int i=0;i<compressed.size();i++) { memcpy(&cw[compressed[i].offset],compressed[i].compressed.get_data(),compressed[i].compressed.size()); @@ -454,11 +454,11 @@ StringName PHashTranslation::get_message(const StringName& p_src_text) const { uint32_t h = hash(0,str.get_data()); - DVector<int>::Read htr = hash_table.read(); + PoolVector<int>::Read htr = hash_table.read(); const uint32_t *htptr = (const uint32_t*)&htr[0]; - DVector<int>::Read btr = bucket_table.read(); + PoolVector<int>::Read btr = bucket_table.read(); const uint32_t *btptr = (const uint32_t*)&btr[0]; - DVector<uint8_t>::Read sr = strings.read(); + PoolVector<uint8_t>::Read sr = strings.read(); const char *sptr= (const char*)&sr[0]; uint32_t p = htptr[ h % htsize]; @@ -518,15 +518,15 @@ StringName PHashTranslation::get_message(const StringName& p_src_text) const { void PHashTranslation::_get_property_list( List<PropertyInfo> *p_list) const{ - p_list->push_back( PropertyInfo(Variant::INT_ARRAY, "hash_table")); - p_list->push_back( PropertyInfo(Variant::INT_ARRAY, "bucket_table")); - p_list->push_back( PropertyInfo(Variant::RAW_ARRAY, "strings")); + p_list->push_back( PropertyInfo(Variant::POOL_INT_ARRAY, "hash_table")); + p_list->push_back( PropertyInfo(Variant::POOL_INT_ARRAY, "bucket_table")); + p_list->push_back( PropertyInfo(Variant::POOL_BYTE_ARRAY, "strings")); p_list->push_back( PropertyInfo(Variant::OBJECT, "load_from",PROPERTY_HINT_RESOURCE_TYPE,"Translation",PROPERTY_USAGE_EDITOR)); } void PHashTranslation::_bind_methods() { - ObjectTypeDB::bind_method(_MD("generate","from:Translation"),&PHashTranslation::generate); + ClassDB::bind_method(_MD("generate","from:Translation"),&PHashTranslation::generate); } PHashTranslation::PHashTranslation() diff --git a/core/compressed_translation.h b/core/compressed_translation.h index a1406ce1b2..cb1e084051 100644 --- a/core/compressed_translation.h +++ b/core/compressed_translation.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class PHashTranslation : public Translation { - OBJ_TYPE(PHashTranslation,Translation); + GDCLASS(PHashTranslation,Translation); //this translation uses a sort of modified perfect hash algorithm @@ -42,9 +42,9 @@ class PHashTranslation : public Translation { //of catching untranslated strings //load/store friendly types - DVector<int> hash_table; - DVector<int> bucket_table; - DVector<uint8_t> strings; + PoolVector<int> hash_table; + PoolVector<int> bucket_table; + PoolVector<uint8_t> strings; struct Bucket { diff --git a/core/core_string_names.cpp b/core/core_string_names.cpp index 8605b9131b..a173f98602 100644 --- a/core/core_string_names.cpp +++ b/core/core_string_names.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/core_string_names.h b/core/core_string_names.h index ef9e846c47..7d3754786c 100644 --- a/core/core_string_names.h +++ b/core/core_string_names.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/dictionary.cpp b/core/dictionary.cpp index 6770b798f1..d5d29ca0fc 100644 --- a/core/dictionary.cpp +++ b/core/dictionary.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -29,7 +29,6 @@ #include "dictionary.h" #include "safe_refcount.h" #include "variant.h" -#include "io/json.h" struct _DictionaryVariantHash { @@ -37,18 +36,47 @@ struct _DictionaryVariantHash { }; + + + struct DictionaryPrivate { + struct Data { + Variant variant; + int order; + }; + SafeRefCount refcount; - HashMap<Variant,Variant,_DictionaryVariantHash> variant_map; + HashMap<Variant,Data,_DictionaryVariantHash> variant_map; + int counter; bool shared; }; +struct DictionaryPrivateSort { + + bool operator()(const HashMap<Variant,DictionaryPrivate::Data,_DictionaryVariantHash>::Pair *A,const HashMap<Variant,DictionaryPrivate::Data,_DictionaryVariantHash>::Pair *B) const { + + return A->data.order < B->data.order; + } +}; void Dictionary::get_key_list( List<Variant> *p_keys) const { - _p->variant_map.get_key_list(p_keys); + if (_p->variant_map.empty()) + return; + + int count = _p->variant_map.size(); + const HashMap<Variant,DictionaryPrivate::Data,_DictionaryVariantHash>::Pair **pairs = (const HashMap<Variant,DictionaryPrivate::Data,_DictionaryVariantHash>::Pair**)alloca( count * sizeof(HashMap<Variant,DictionaryPrivate::Data,_DictionaryVariantHash>::Pair *) ); + _p->variant_map.get_key_value_ptr_array(pairs); + + SortArray<const HashMap<Variant,DictionaryPrivate::Data,_DictionaryVariantHash>::Pair*,DictionaryPrivateSort> sort; + sort.sort(pairs,count); + + for(int i=0;i<count;i++) { + p_keys->push_back(pairs[i]->key); + } + } void Dictionary::_copy_on_write() const { @@ -69,30 +97,52 @@ Variant& Dictionary::operator[](const Variant& p_key) { _copy_on_write(); - return _p->variant_map[p_key]; + DictionaryPrivate::Data *v =_p->variant_map.getptr(p_key); + + if (!v) { + + DictionaryPrivate::Data d; + d.order=_p->counter++; + _p->variant_map[p_key]=d; + v =_p->variant_map.getptr(p_key); + + } + return v->variant; } const Variant& Dictionary::operator[](const Variant& p_key) const { - return _p->variant_map[p_key]; + return _p->variant_map[p_key].variant; } const Variant* Dictionary::getptr(const Variant& p_key) const { - return _p->variant_map.getptr(p_key); + const DictionaryPrivate::Data *v =_p->variant_map.getptr(p_key); + if (!v) + return NULL; + else + return &v->variant; } + Variant* Dictionary::getptr(const Variant& p_key) { - _copy_on_write(); - return _p->variant_map.getptr(p_key); + _copy_on_write(); + DictionaryPrivate::Data *v =_p->variant_map.getptr(p_key); + if (!v) + return NULL; + else + return &v->variant; + + } Variant Dictionary::get_valid(const Variant& p_key) const { - const Variant *v = getptr(p_key); + DictionaryPrivate::Data *v =_p->variant_map.getptr(p_key); if (!v) return Variant(); - return *v; + else + return v->variant; } @@ -151,6 +201,7 @@ void Dictionary::clear() { _copy_on_write(); _p->variant_map.clear(); + _p->counter=0; } bool Dictionary::is_shared() const { @@ -203,11 +254,20 @@ Array Dictionary::values() const { Array varr; varr.resize(size()); - const Variant *key=NULL; - int i=0; - while((key=next(key))){ - varr[i++] = _p->variant_map[*key]; + if (_p->variant_map.empty()) + return varr; + + int count = _p->variant_map.size(); + const HashMap<Variant,DictionaryPrivate::Data,_DictionaryVariantHash>::Pair **pairs = (const HashMap<Variant,DictionaryPrivate::Data,_DictionaryVariantHash>::Pair**)alloca( count * sizeof(HashMap<Variant,DictionaryPrivate::Data,_DictionaryVariantHash>::Pair *) ); + _p->variant_map.get_key_value_ptr_array(pairs); + + SortArray<const HashMap<Variant,DictionaryPrivate::Data,_DictionaryVariantHash>::Pair*,DictionaryPrivateSort> sort; + sort.sort(pairs,count); + + for(int i=0;i<count;i++) { + varr[i]=pairs[i]->data.variant; } + return varr; } @@ -216,22 +276,6 @@ const Variant* Dictionary::next(const Variant* p_key) const { return _p->variant_map.next(p_key); } - -Error Dictionary::parse_json(const String& p_json) { - - String errstr; - int errline=0; - if (p_json != ""){ - Error err = JSON::parse(p_json,*this,errstr,errline); - if (err!=OK) { - ERR_EXPLAIN("Error parsing JSON: "+errstr+" at line: "+itos(errline)); - ERR_FAIL_COND_V(err!=OK,err); - } - } - - return OK; -} - Dictionary Dictionary::copy() const { Dictionary n(is_shared()); @@ -246,11 +290,6 @@ Dictionary Dictionary::copy() const { return n; } -String Dictionary::to_json() const { - - return JSON::print(*this); -} - void Dictionary::operator=(const Dictionary& p_dictionary) { @@ -269,6 +308,7 @@ Dictionary::Dictionary(bool p_shared) { _p=memnew( DictionaryPrivate ); _p->refcount.init(); + _p->counter=0; _p->shared=p_shared; } diff --git a/core/dictionary.h b/core/dictionary.h index 6a5f4e20e6..9fab653470 100644 --- a/core/dictionary.h +++ b/core/dictionary.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -63,9 +63,6 @@ public: void clear(); - Error parse_json(const String& p_json); - String to_json() const; - bool is_shared() const; bool has(const Variant& p_key) const; diff --git a/core/dvector.cpp b/core/dvector.cpp index fa06399139..f6b5a5fcbf 100644 --- a/core/dvector.cpp +++ b/core/dvector.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -30,3 +30,44 @@ Mutex* dvector_lock=NULL; +PoolAllocator *MemoryPool::memory_pool=NULL; +uint8_t *MemoryPool::pool_memory=NULL; +size_t *MemoryPool::pool_size=NULL; + + +MemoryPool::Alloc *MemoryPool::allocs=NULL; +MemoryPool::Alloc *MemoryPool::free_list=NULL; +uint32_t MemoryPool::alloc_count=0; +uint32_t MemoryPool::allocs_used=0; +Mutex *MemoryPool::alloc_mutex=NULL; + +size_t MemoryPool::total_memory=0; +size_t MemoryPool::max_memory=0; + + +void MemoryPool::setup(uint32_t p_max_allocs) { + + allocs = memnew_arr( Alloc, p_max_allocs); + alloc_count = p_max_allocs; + allocs_used=0; + + for(uint32_t i=0;i<alloc_count-1;i++) { + + allocs[i].free_list=&allocs[i+1]; + } + + free_list=&allocs[0]; + + alloc_mutex = Mutex::create(); + +} + +void MemoryPool::cleanup() { + + memdelete_arr(allocs); + memdelete(alloc_mutex); + + ERR_EXPLAINC("There are still MemoryPool allocs in use at exit!"); + ERR_FAIL_COND(allocs_used>0); + +} diff --git a/core/dvector.h b/core/dvector.h index 9a54641617..cac9e8ef85 100644 --- a/core/dvector.h +++ b/core/dvector.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -30,6 +30,46 @@ #define DVECTOR_H #include "os/memory.h" +#include "os/copymem.h" +#include "pool_allocator.h" +#include "safe_refcount.h" +#include "os/rw_lock.h" + +struct MemoryPool { + + //avoid accessing these directly, must be public for template access + + static PoolAllocator *memory_pool; + static uint8_t *pool_memory; + static size_t *pool_size; + + + struct Alloc { + + SafeRefCount refcount; + uint32_t lock; + void *mem; + PoolAllocator::ID pool_id; + size_t size; + + Alloc *free_list; + + Alloc() { mem=NULL; lock=0; pool_id=POOL_ALLOCATOR_INVALID_ID; size=0; free_list=NULL; } + }; + + + static Alloc *allocs; + static Alloc *free_list; + static uint32_t alloc_count; + static uint32_t allocs_used; + static Mutex *alloc_mutex; + static size_t total_memory; + static size_t max_memory; + + + static void setup(uint32_t p_max_allocs=(1<<16)); + static void cleanup(); +}; /** @@ -37,182 +77,302 @@ */ -extern Mutex* dvector_lock; - template<class T> -class DVector { +class PoolVector { + + MemoryPool::Alloc *alloc; - mutable MID mem; + void _copy_on_write() { - void copy_on_write() { - if (!mem.is_valid()) + if (!alloc) return; - if (dvector_lock) - dvector_lock->lock(); + ERR_FAIL_COND(alloc->lock>0); - MID_Lock lock( mem ); + if (alloc->refcount.get()==1) + return; //nothing to do - if ( *(int*)lock.data() == 1 ) { - // one reference, means no refcount changes - if (dvector_lock) - dvector_lock->unlock(); - return; + //must allocate something + + MemoryPool::alloc_mutex->lock(); + if (MemoryPool::allocs_used==MemoryPool::alloc_count) { + MemoryPool::alloc_mutex->unlock(); + ERR_EXPLAINC("All memory pool allocations are in use, can't COW."); + ERR_FAIL(); } - MID new_mem= dynalloc( mem.get_size() ); + MemoryPool::Alloc *old_alloc = alloc; - if (!new_mem.is_valid()) { + //take one from the free list + alloc = MemoryPool::free_list; + MemoryPool::free_list = alloc->free_list; + //increment the used counter + MemoryPool::allocs_used++; - if (dvector_lock) - dvector_lock->unlock(); - ERR_FAIL_COND( new_mem.is_valid() ); // out of memory + //copy the alloc data + alloc->size=old_alloc->size; + alloc->refcount.init(); + alloc->pool_id=POOL_ALLOCATOR_INVALID_ID; + alloc->lock=0; + +#ifdef DEBUG_ENABLED + MemoryPool::total_memory+=alloc->size; + if (MemoryPool::total_memory>MemoryPool::max_memory) { + MemoryPool::max_memory=MemoryPool::total_memory; } +#endif - MID_Lock dst_lock( new_mem ); + MemoryPool::alloc_mutex->unlock(); - int *rc = (int*)dst_lock.data(); - *rc=1; + if (MemoryPool::memory_pool) { - T * dst = (T*)(rc + 1 ); - T * src =(T*) ((int*)lock.data() + 1 ); + } else { + alloc->mem = memalloc( alloc->size ); + } - int count = (mem.get_size() - sizeof(int)) / sizeof(T); + { + Write w; + w._ref(alloc); + Read r; + r._ref(old_alloc); + + int cur_elements = alloc->size/sizeof(T); + T*dst = (T*)w.ptr(); + const T*src = (const T*)r.ptr(); + for(int i=0;i<cur_elements;i++) { + memnew_placement(&dst[i],T(src[i])); + } + } - for (int i=0;i<count;i++) { - memnew_placement( &dst[i], T(src[i]) ); - } + if (old_alloc->refcount.unref()==true) { + //this should never happen but.. - (*(int*)lock.data())--; +#ifdef DEBUG_ENABLED + MemoryPool::alloc_mutex->lock(); + MemoryPool::total_memory-=old_alloc->size; + MemoryPool::alloc_mutex->unlock(); +#endif - // unlock all - dst_lock=MID_Lock(); - lock=MID_Lock(); + { + Write w; + w._ref(old_alloc); - mem=new_mem; + int cur_elements = old_alloc->size/sizeof(T); + T*elems = (T*)w.ptr(); + for(int i=0;i<cur_elements;i++) { + elems[i].~T(); + } - if (dvector_lock) - dvector_lock->unlock(); + } - } + if (MemoryPool::memory_pool) { + //resize memory pool + //if none, create + //if some resize + } else { - void reference( const DVector& p_dvector ) { - unreference(); + memfree( old_alloc->mem ); + old_alloc->mem=NULL; + old_alloc->size=0; - if (dvector_lock) - dvector_lock->lock(); - if (!p_dvector.mem.is_valid()) { + MemoryPool::alloc_mutex->lock(); + old_alloc->free_list=MemoryPool::free_list; + MemoryPool::free_list=old_alloc; + MemoryPool::allocs_used--; + MemoryPool::alloc_mutex->unlock(); + } - if (dvector_lock) - dvector_lock->unlock(); - return; } - MID_Lock lock(p_dvector.mem); + } - int * rc = (int*)lock.data(); - (*rc)++; + void _reference( const PoolVector& p_dvector ) { - lock = MID_Lock(); - mem=p_dvector.mem; + if (alloc==p_dvector.alloc) + return; - if (dvector_lock) - dvector_lock->unlock(); + _unreference(); - } + if (!p_dvector.alloc) { + return; + } + if (p_dvector.alloc->refcount.ref()) { + alloc=p_dvector.alloc; + } - void unreference() { + } - if (dvector_lock) - dvector_lock->lock(); - if (!mem.is_valid()) { + void _unreference() { - if (dvector_lock) - dvector_lock->unlock(); + if (!alloc) return; - } - MID_Lock lock(mem); - - int * rc = (int*)lock.data(); - (*rc)--; + if (alloc->refcount.unref()==false) { + alloc=NULL; + return; + } - if (*rc==0) { - // no one else using it, destruct + //must be disposed! - T * t= (T*)(rc+1); - int count = (mem.get_size() - sizeof(int)) / sizeof(T); + { + int cur_elements = alloc->size/sizeof(T); + Write w = write(); - for (int i=0;i<count;i++) { + for (int i=0;i<cur_elements;i++) { - t[i].~T(); + w[i].~T(); } } +#ifdef DEBUG_ENABLED + MemoryPool::alloc_mutex->lock(); + MemoryPool::total_memory-=alloc->size; + MemoryPool::alloc_mutex->unlock(); +#endif + + + if (MemoryPool::memory_pool) { + //resize memory pool + //if none, create + //if some resize + } else { + + memfree( alloc->mem ); + alloc->mem=NULL; + alloc->size=0; - lock = MID_Lock(); - mem = MID (); + MemoryPool::alloc_mutex->lock(); + alloc->free_list=MemoryPool::free_list; + MemoryPool::free_list=alloc; + MemoryPool::allocs_used--; + MemoryPool::alloc_mutex->unlock(); - if (dvector_lock) - dvector_lock->unlock(); + } + alloc=NULL; } public: - class Read { - friend class DVector; - MID_Lock lock; - const T * mem; + class Access { + friend class PoolVector; + protected: + MemoryPool::Alloc *alloc; + T * mem; + + _FORCE_INLINE_ void _ref(MemoryPool::Alloc *p_alloc) { + alloc=p_alloc; + if (alloc) { + if (atomic_increment(&alloc->lock)==1) { + if (MemoryPool::memory_pool) { + //lock it and get mem + } + } + + mem = (T*)alloc->mem; + } + } + + _FORCE_INLINE_ void _unref() { + + + if (alloc) { + if (atomic_decrement(&alloc->lock)==0) { + if (MemoryPool::memory_pool) { + //put mem back + } + } + + mem = NULL; + alloc=NULL; + } + + + } + + Access() { + alloc=NULL; + mem=NULL; + } + + + public: + virtual ~Access() { + _unref(); + } + }; + + class Read : public Access { public: - _FORCE_INLINE_ const T& operator[](int p_index) const { return mem[p_index]; } - _FORCE_INLINE_ const T *ptr() const { return mem; } + _FORCE_INLINE_ const T& operator[](int p_index) const { return this->mem[p_index]; } + _FORCE_INLINE_ const T *ptr() const { return this->mem; } + + void operator=(const Read& p_read) { + if (this->alloc==p_read.alloc) + return; + this->_unref(); + this->_ref(p_read.alloc); + } + + Read(const Read& p_read) { + this->_ref(p_read.alloc); + } + + Read() {} + - Read() { mem=NULL; } }; - class Write { - friend class DVector; - MID_Lock lock; - T * mem; + class Write : public Access { public: - _FORCE_INLINE_ T& operator[](int p_index) { return mem[p_index]; } - _FORCE_INLINE_ T *ptr() { return mem; } + _FORCE_INLINE_ T& operator[](int p_index) const { return this->mem[p_index]; } + _FORCE_INLINE_ T *ptr() const { return this->mem; } + + void operator=(const Write& p_read) { + if (this->alloc==p_read.alloc) + return; + this->_unref(); + this->_ref(p_read.alloc); + } + + Write(const Write& p_read) { + this->_ref(p_read.alloc); + } + + Write() {} - Write() { mem=NULL; } }; Read read() const { Read r; - if (mem.is_valid()) { - r.lock = MID_Lock( mem ); - r.mem = (const T*)((int*)r.lock.data()+1); + if (alloc) { + r._ref(alloc); } return r; + } Write write() { Write w; - if (mem.is_valid()) { - copy_on_write(); - w.lock = MID_Lock( mem ); - w.mem = (T*)((int*)w.lock.data()+1); + if (alloc) { + _copy_on_write(); //make sure there is only one being acessed + w._ref(alloc); } return w; } @@ -250,7 +410,7 @@ public: void set(int p_index, const T& p_val); void push_back(const T& p_val); void append(const T& p_val) { push_back(p_val); } - void append_array(const DVector<T>& p_arr) { + void append_array(const PoolVector<T>& p_arr) { int ds = p_arr.size(); if (ds==0) return; @@ -262,7 +422,7 @@ public: w[bs+i]=r[i]; } - DVector<T> subarray(int p_from, int p_to) { + PoolVector<T> subarray(int p_from, int p_to) { if (p_from<0) { p_from=size()+p_from; @@ -271,15 +431,15 @@ public: p_to=size()+p_to; } if (p_from<0 || p_from>=size()) { - DVector<T>& aux=*((DVector<T>*)0); // nullreturn + PoolVector<T>& aux=*((PoolVector<T>*)0); // nullreturn ERR_FAIL_COND_V(p_from<0 || p_from>=size(),aux) } if (p_to<0 || p_to>=size()) { - DVector<T>& aux=*((DVector<T>*)0); // nullreturn + PoolVector<T>& aux=*((PoolVector<T>*)0); // nullreturn ERR_FAIL_COND_V(p_to<0 || p_to>=size(),aux) } - DVector<T> slice; + PoolVector<T> slice; int span=1 + p_to - p_from; slice.resize(span); Read r = read(); @@ -307,7 +467,7 @@ public: } - bool is_locked() const { return mem.is_locked(); } + bool is_locked() const { return alloc && alloc->lock>0; } inline const T operator[](int p_index) const; @@ -315,27 +475,27 @@ public: void invert(); - void operator=(const DVector& p_dvector) { reference(p_dvector); } - DVector() {} - DVector(const DVector& p_dvector) { reference(p_dvector); } - ~DVector() { unreference(); } + void operator=(const PoolVector& p_dvector) { _reference(p_dvector); } + PoolVector() { alloc=NULL; } + PoolVector(const PoolVector& p_dvector) { alloc=NULL; _reference(p_dvector); } + ~PoolVector() { _unreference(); } }; template<class T> -int DVector<T>::size() const { +int PoolVector<T>::size() const { - return mem.is_valid() ? ((mem.get_size() - sizeof(int)) / sizeof(T) ) : 0; + return alloc ? alloc->size/sizeof(T) : 0; } template<class T> -T DVector<T>::get(int p_index) const { +T PoolVector<T>::get(int p_index) const { return operator[](p_index); } template<class T> -void DVector<T>::set(int p_index, const T& p_val) { +void PoolVector<T>::set(int p_index, const T& p_val) { if (p_index<0 || p_index>=size()) { ERR_FAIL_COND(p_index<0 || p_index>=size()); @@ -346,14 +506,14 @@ void DVector<T>::set(int p_index, const T& p_val) { } template<class T> -void DVector<T>::push_back(const T& p_val) { +void PoolVector<T>::push_back(const T& p_val) { resize( size() + 1 ); set( size() -1, p_val ); } template<class T> -const T DVector<T>::operator[](int p_index) const { +const T PoolVector<T>::operator[](int p_index) const { if (p_index<0 || p_index>=size()) { T& aux=*((T*)0); //nullreturn @@ -367,86 +527,122 @@ const T DVector<T>::operator[](int p_index) const { template<class T> -Error DVector<T>::resize(int p_size) { +Error PoolVector<T>::resize(int p_size) { - if (dvector_lock) - dvector_lock->lock(); - bool same = p_size==size(); + if (alloc==NULL) { - if (dvector_lock) - dvector_lock->unlock(); - // no further locking is necesary because we are supposed to own the only copy of this (using copy on write) + if (p_size==0) + return OK; //nothing to do here - if (same) - return OK; + //must allocate something + MemoryPool::alloc_mutex->lock(); + if (MemoryPool::allocs_used==MemoryPool::alloc_count) { + MemoryPool::alloc_mutex->unlock(); + ERR_EXPLAINC("All memory pool allocations are in use."); + ERR_FAIL_V(ERR_OUT_OF_MEMORY); + } - if (p_size == 0 ) { + //take one from the free list + alloc = MemoryPool::free_list; + MemoryPool::free_list = alloc->free_list; + //increment the used counter + MemoryPool::allocs_used++; - unreference(); - return OK; + //cleanup the alloc + alloc->size=0; + alloc->refcount.init(); + alloc->pool_id=POOL_ALLOCATOR_INVALID_ID; + MemoryPool::alloc_mutex->unlock(); + + } else { + + ERR_FAIL_COND_V( alloc->lock>0, ERR_LOCKED ); //can't resize if locked! } + size_t new_size = sizeof(T)*p_size; - copy_on_write(); // make it unique + if (alloc->size==new_size) + return OK; //nothing to do - ERR_FAIL_COND_V( mem.is_locked(), ERR_LOCKED ); // if after copy on write, memory is locked, fail. + if (p_size == 0 ) { + _unreference(); + return OK; + } - if (p_size > size() ) { + _copy_on_write(); // make it unique - int oldsize=size(); +#ifdef DEBUG_ENABLED + MemoryPool::alloc_mutex->lock(); + MemoryPool::total_memory-=alloc->size; + MemoryPool::total_memory+=new_size; + if (MemoryPool::total_memory>MemoryPool::max_memory) { + MemoryPool::max_memory=MemoryPool::total_memory; + } + MemoryPool::alloc_mutex->unlock(); +#endif - MID_Lock lock; - if (oldsize==0) { + int cur_elements = alloc->size / sizeof(T); - mem = dynalloc( p_size * sizeof(T) + sizeof(int) ); - lock=MID_Lock(mem); - int *rc = ((int*)lock.data()); - *rc=1; + if (p_size > cur_elements ) { + if (MemoryPool::memory_pool) { + //resize memory pool + //if none, create + //if some resize } else { - if (dynrealloc( mem, p_size * sizeof(T) + sizeof(int) )!=OK ) { - - ERR_FAIL_V(ERR_OUT_OF_MEMORY); // out of memory + if (alloc->size==0) { + alloc->mem = memalloc( new_size ); + } else { + alloc->mem = memrealloc( alloc->mem, new_size ); } - - lock=MID_Lock(mem); } + alloc->size=new_size; + Write w = write(); + for (int i=cur_elements;i<p_size;i++) { - T *t = (T*)((int*)lock.data() + 1); - - for (int i=oldsize;i<p_size;i++) { - - memnew_placement(&t[i], T ); + memnew_placement(&w[i], T ); } - lock = MID_Lock(); // clear - } else { - - int oldsize=size(); - - MID_Lock lock(mem); + } else { - T *t = (T*)((int*)lock.data() + 1); + { + Write w = write(); + for (int i=p_size;i<cur_elements;i++) { - for (int i=p_size;i<oldsize;i++) { + w[i].~T(); + } - t[i].~T(); } - lock = MID_Lock(); // clear + if (MemoryPool::memory_pool) { + //resize memory pool + //if none, create + //if some resize + } else { - if (dynrealloc( mem, p_size * sizeof(T) + sizeof(int) )!=OK ) { + if (new_size==0) { + memfree( alloc->mem ); + alloc->mem=NULL; + alloc->size=0; - ERR_FAIL_V(ERR_OUT_OF_MEMORY); // wtf error - } + MemoryPool::alloc_mutex->lock(); + alloc->free_list=MemoryPool::free_list; + MemoryPool::free_list=alloc; + MemoryPool::allocs_used--; + MemoryPool::alloc_mutex->unlock(); + } else { + alloc->mem = memrealloc( alloc->mem, new_size ); + alloc->size=new_size; + } + } } @@ -454,7 +650,7 @@ Error DVector<T>::resize(int p_size) { } template<class T> -void DVector<T>::invert() { +void PoolVector<T>::invert() { T temp; Write w = write(); int s = size(); diff --git a/core/error_list.h b/core/error_list.h index 154af679fc..c3cd9b399d 100644 --- a/core/error_list.h +++ b/core/error_list.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/error_macros.cpp b/core/error_macros.cpp index 03e5ba37da..53a361fa3a 100644 --- a/core/error_macros.cpp +++ b/core/error_macros.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/error_macros.h b/core/error_macros.h index 6d931e899e..ac86ef432b 100644 --- a/core/error_macros.h +++ b/core/error_macros.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -49,7 +49,8 @@ enum ErrorHandlerType { ERR_HANDLER_ERROR, ERR_HANDLER_WARNING, - ERR_HANDLER_SCRIPT + ERR_HANDLER_SCRIPT, + ERR_HANDLER_SHADER, }; typedef void (*ErrorHandlerFunc)(void*,const char*,const char*,int p_line,const char *, const char *,ErrorHandlerType p_type); diff --git a/core/event_queue.cpp b/core/event_queue.cpp index 958ef41132..587283cc79 100644 --- a/core/event_queue.cpp +++ b/core/event_queue.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/event_queue.h b/core/event_queue.h index 99e853fd28..d15ff81bc7 100644 --- a/core/event_queue.h +++ b/core/event_queue.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/func_ref.cpp b/core/func_ref.cpp index ca890111be..1e8c229810 100644 --- a/core/func_ref.cpp +++ b/core/func_ref.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -61,12 +61,12 @@ void FuncRef::_bind_methods() { MethodInfo mi; mi.name="call_func"; Vector<Variant> defargs; - ObjectTypeDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"call_func:Variant",&FuncRef::call_func,mi,defargs); + ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"call_func:Variant",&FuncRef::call_func,mi,defargs); } - ObjectTypeDB::bind_method(_MD("set_instance","instance"),&FuncRef::set_instance); - ObjectTypeDB::bind_method(_MD("set_function","name"),&FuncRef::set_function); + ClassDB::bind_method(_MD("set_instance","instance"),&FuncRef::set_instance); + ClassDB::bind_method(_MD("set_function","name"),&FuncRef::set_function); } diff --git a/core/func_ref.h b/core/func_ref.h index 140dcd6b1c..0c9bca4680 100644 --- a/core/func_ref.h +++ b/core/func_ref.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class FuncRef : public Reference{ - OBJ_TYPE(FuncRef,Reference); + GDCLASS(FuncRef,Reference); ObjectID id; StringName function; diff --git a/core/global_constants.cpp b/core/global_constants.cpp index 2594be63ac..936facdd23 100644 --- a/core/global_constants.cpp +++ b/core/global_constants.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -329,7 +329,7 @@ static _GlobalConstant _global_constants[]={ BIND_GLOBAL_CONSTANT( BUTTON_MASK_RIGHT ), BIND_GLOBAL_CONSTANT( BUTTON_MASK_MIDDLE ), - //joysticks + //joypads BIND_GLOBAL_CONSTANT( JOY_BUTTON_0 ), BIND_GLOBAL_CONSTANT( JOY_BUTTON_1 ), BIND_GLOBAL_CONSTANT( JOY_BUTTON_2 ), @@ -463,7 +463,12 @@ static _GlobalConstant _global_constants[]={ BIND_GLOBAL_CONSTANT( PROPERTY_HINT_LENGTH ), BIND_GLOBAL_CONSTANT( PROPERTY_HINT_KEY_ACCEL ), BIND_GLOBAL_CONSTANT( PROPERTY_HINT_FLAGS ), - BIND_GLOBAL_CONSTANT( PROPERTY_HINT_ALL_FLAGS ), + + BIND_GLOBAL_CONSTANT( PROPERTY_HINT_LAYERS_2D_RENDER ), + BIND_GLOBAL_CONSTANT( PROPERTY_HINT_LAYERS_2D_PHYSICS ), + BIND_GLOBAL_CONSTANT( PROPERTY_HINT_LAYERS_3D_RENDER ), + BIND_GLOBAL_CONSTANT( PROPERTY_HINT_LAYERS_3D_PHYSICS), + BIND_GLOBAL_CONSTANT( PROPERTY_HINT_FILE ), BIND_GLOBAL_CONSTANT( PROPERTY_HINT_DIR ), BIND_GLOBAL_CONSTANT( PROPERTY_HINT_GLOBAL_FILE ), @@ -483,7 +488,7 @@ static _GlobalConstant _global_constants[]={ BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_CHECKABLE ), BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_CHECKED ), BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_INTERNATIONALIZED ), - BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_BUNDLE ), + BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_GROUP ), BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_CATEGORY ), BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_STORE_IF_NONZERO ), BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_STORE_IF_NONONE ), @@ -512,11 +517,11 @@ static _GlobalConstant _global_constants[]={ {"TYPE_VECTOR2",Variant::VECTOR2}, // 5 {"TYPE_RECT2",Variant::RECT2}, {"TYPE_VECTOR3",Variant::VECTOR3}, - {"TYPE_MATRIX32",Variant::MATRIX32}, + {"TYPE_TRANSFORM2D",Variant::TRANSFORM2D}, {"TYPE_PLANE",Variant::PLANE}, {"TYPE_QUAT",Variant::QUAT}, // 10 - {"TYPE_AABB",Variant::_AABB}, //sorry naming convention fail :( not like it's used often - {"TYPE_MATRIX3",Variant::MATRIX3}, + {"TYPE_RECT3",Variant::RECT3}, //sorry naming convention fail :( not like it's used often + {"TYPE_BASIS",Variant::BASIS}, {"TYPE_TRANSFORM",Variant::TRANSFORM}, {"TYPE_COLOR",Variant::COLOR}, {"TYPE_IMAGE",Variant::IMAGE}, // 15 @@ -526,13 +531,13 @@ static _GlobalConstant _global_constants[]={ {"TYPE_INPUT_EVENT",Variant::INPUT_EVENT}, {"TYPE_DICTIONARY",Variant::DICTIONARY}, // 20 {"TYPE_ARRAY",Variant::ARRAY}, - {"TYPE_RAW_ARRAY",Variant::RAW_ARRAY}, - {"TYPE_INT_ARRAY",Variant::INT_ARRAY}, - {"TYPE_REAL_ARRAY",Variant::REAL_ARRAY}, - {"TYPE_STRING_ARRAY",Variant::STRING_ARRAY}, // 25 - {"TYPE_VECTOR2_ARRAY",Variant::VECTOR2_ARRAY}, - {"TYPE_VECTOR3_ARRAY",Variant::VECTOR3_ARRAY}, - {"TYPE_COLOR_ARRAY",Variant::COLOR_ARRAY}, + {"TYPE_RAW_ARRAY",Variant::POOL_BYTE_ARRAY}, + {"TYPE_INT_ARRAY",Variant::POOL_INT_ARRAY}, + {"TYPE_REAL_ARRAY",Variant::POOL_REAL_ARRAY}, + {"TYPE_STRING_ARRAY",Variant::POOL_STRING_ARRAY}, // 25 + {"TYPE_VECTOR2_ARRAY",Variant::POOL_VECTOR2_ARRAY}, + {"TYPE_VECTOR3_ARRAY",Variant::POOL_VECTOR3_ARRAY}, + {"TYPE_COLOR_ARRAY",Variant::POOL_COLOR_ARRAY}, {"TYPE_MAX",Variant::VARIANT_MAX}, {NULL,0} diff --git a/core/global_constants.h b/core/global_constants.h index f7f6677482..3270dcd151 100644 --- a/core/global_constants.h +++ b/core/global_constants.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/globals.cpp b/core/globals.cpp index bef40ff330..0dd31e65d0 100644 --- a/core/globals.cpp +++ b/core/globals.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,24 +37,25 @@ #include "io/file_access_pack.h" #include "io/file_access_network.h" -Globals *Globals::singleton=NULL; +GlobalConfig *GlobalConfig::singleton=NULL; -Globals *Globals::get_singleton() { +GlobalConfig *GlobalConfig::get_singleton() { return singleton; } -String Globals::get_resource_path() const { +String GlobalConfig::get_resource_path() const { return resource_path; }; -String Globals::localize_path(const String& p_path) const { +String GlobalConfig::localize_path(const String& p_path) const { if (resource_path=="") return p_path; //not initialied yet - if (p_path.begins_with("res://") || p_path.begins_with("user://") || p_path.is_abs_path()) + if (p_path.begins_with("res://") || p_path.begins_with("user://") || + (p_path.is_abs_path() && !p_path.begins_with(resource_path))) return p_path.simplify_path(); @@ -95,21 +96,14 @@ String Globals::localize_path(const String& p_path) const { } -void Globals::set_persisting(const String& p_name, bool p_persist) { +void GlobalConfig::set_initial_value(const String& p_name, const Variant & p_value) { ERR_FAIL_COND(!props.has(p_name)); - props[p_name].persist=p_persist; + props[p_name].initial=p_value; } -bool Globals::is_persisting(const String& p_name) const { - ERR_FAIL_COND_V(!props.has(p_name),false); - return props[p_name].persist; - -} - - -String Globals::globalize_path(const String& p_path) const { +String GlobalConfig::globalize_path(const String& p_path) const { if (p_path.begins_with("res://")) { @@ -124,7 +118,7 @@ String Globals::globalize_path(const String& p_path) const { } -bool Globals::_set(const StringName& p_name, const Variant& p_value) { +bool GlobalConfig::_set(const StringName& p_name, const Variant& p_value) { _THREAD_SAFE_METHOD_ @@ -168,7 +162,7 @@ bool Globals::_set(const StringName& p_name, const Variant& p_value) { return true; } -bool Globals::_get(const StringName& p_name,Variant &r_ret) const { +bool GlobalConfig::_get(const StringName& p_name,Variant &r_ret) const { _THREAD_SAFE_METHOD_ @@ -189,7 +183,7 @@ struct _VCSort { bool operator<(const _VCSort& p_vcs) const{ return order==p_vcs.order?name<p_vcs.name:order< p_vcs.order; } }; -void Globals::_get_property_list(List<PropertyInfo> *p_list) const { +void GlobalConfig::_get_property_list(List<PropertyInfo> *p_list) const { _THREAD_SAFE_METHOD_ @@ -207,13 +201,9 @@ void Globals::_get_property_list(List<PropertyInfo> *p_list) const { vc.order=v->order; vc.type=v->variant.get_type(); if (vc.name.begins_with("input/") || vc.name.begins_with("import/") || vc.name.begins_with("export/") || vc.name.begins_with("/remap") || vc.name.begins_with("/locale") || vc.name.begins_with("/autoload")) - vc.flags=PROPERTY_USAGE_CHECKABLE|PROPERTY_USAGE_STORAGE; + vc.flags=PROPERTY_USAGE_STORAGE; else - vc.flags=PROPERTY_USAGE_CHECKABLE|PROPERTY_USAGE_EDITOR|PROPERTY_USAGE_STORAGE; - - if (v->persist) { - vc.flags|=PROPERTY_USAGE_CHECKED; - } + vc.flags=PROPERTY_USAGE_EDITOR|PROPERTY_USAGE_STORAGE; vclist.insert(vc); } @@ -232,7 +222,7 @@ void Globals::_get_property_list(List<PropertyInfo> *p_list) const { -bool Globals::_load_resource_pack(const String& p_pack) { +bool GlobalConfig::_load_resource_pack(const String& p_pack) { if (PackedData::get_singleton()->is_disabled()) return false; @@ -249,7 +239,7 @@ bool Globals::_load_resource_pack(const String& p_pack) { return true; } -Error Globals::setup(const String& p_path,const String & p_main_pack) { +Error GlobalConfig::setup(const String& p_path,const String & p_main_pack) { //an absolute mess of a function, must be cleaned up and reorganized somehow at some point @@ -396,7 +386,7 @@ Error Globals::setup(const String& p_path,const String & p_main_pack) { return OK; } -bool Globals::has(String p_var) const { +bool GlobalConfig::has(String p_var) const { _THREAD_SAFE_METHOD_ @@ -626,7 +616,7 @@ static Variant _decode_variant(const String& p_string) { ERR_FAIL_COND_V(params.size()!=2,Variant()); InputEvent ie; - ie.type=InputEvent::JOYSTICK_BUTTON; + ie.type=InputEvent::JOYPAD_BUTTON; ie.device=params[0].to_int(); ie.joy_button.button_index=params[1].to_int(); @@ -638,7 +628,7 @@ static Variant _decode_variant(const String& p_string) { ERR_FAIL_COND_V(params.size()!=2,Variant()); InputEvent ie; - ie.type=InputEvent::JOYSTICK_MOTION; + ie.type=InputEvent::JOYPAD_MOTION; ie.device=params[0].to_int(); int axis = params[1].to_int();; ie.joy_motion.axis=axis>>1; @@ -657,37 +647,37 @@ static Variant _decode_variant(const String& p_string) { String format=params[0].strip_edges(); Image::Format imgformat; - +/* if (format=="grayscale") { - imgformat=Image::FORMAT_GRAYSCALE; + imgformat=Image::FORMAT_L8; } else if (format=="intensity") { imgformat=Image::FORMAT_INTENSITY; } else if (format=="grayscale_alpha") { - imgformat=Image::FORMAT_GRAYSCALE_ALPHA; + imgformat=Image::FORMAT_LA8; } else if (format=="rgb") { - imgformat=Image::FORMAT_RGB; + imgformat=Image::FORMAT_RGB8; } else if (format=="rgba") { - imgformat=Image::FORMAT_RGBA; + imgformat=Image::FORMAT_RGBA8; } else if (format=="indexed") { imgformat=Image::FORMAT_INDEXED; } else if (format=="indexed_alpha") { imgformat=Image::FORMAT_INDEXED_ALPHA; } else if (format=="bc1") { - imgformat=Image::FORMAT_BC1; + imgformat=Image::FORMAT_DXT1; } else if (format=="bc2") { - imgformat=Image::FORMAT_BC2; + imgformat=Image::FORMAT_DXT3; } else if (format=="bc3") { - imgformat=Image::FORMAT_BC3; + imgformat=Image::FORMAT_DXT5; } else if (format=="bc4") { - imgformat=Image::FORMAT_BC4; + imgformat=Image::FORMAT_ATI1; } else if (format=="bc5") { - imgformat=Image::FORMAT_BC5; + imgformat=Image::FORMAT_ATI2; } else if (format=="custom") { imgformat=Image::FORMAT_CUSTOM; } else { ERR_FAIL_V( Image() ); - } + }*/ int mipmaps=params[1].to_int(); int w=params[2].to_int(); @@ -701,9 +691,9 @@ static Variant _decode_variant(const String& p_string) { String data=params[4]; int datasize=data.length()/2; - DVector<uint8_t> pixels; + PoolVector<uint8_t> pixels; pixels.resize(datasize); - DVector<uint8_t>::Write wb = pixels.write(); + PoolVector<uint8_t>::Write wb = pixels.write(); const CharType *cptr=data.c_str(); int idx=0; @@ -730,7 +720,7 @@ static Variant _decode_variant(const String& p_string) { } - wb = DVector<uint8_t>::Write(); + wb = PoolVector<uint8_t>::Write(); return Image(w,h,mipmaps,imgformat,pixels); } @@ -750,12 +740,12 @@ static Variant _decode_variant(const String& p_string) { return Variant(); } -void Globals::set_registering_order(bool p_enable) { +void GlobalConfig::set_registering_order(bool p_enable) { registering_order=p_enable; } -Error Globals::_load_settings_binary(const String p_path) { +Error GlobalConfig::_load_settings_binary(const String p_path) { Error err; FileAccess *f= FileAccess::open(p_path,FileAccess::READ,&err); @@ -796,7 +786,7 @@ Error Globals::_load_settings_binary(const String p_path) { ERR_EXPLAIN("Error decoding property: "+key); ERR_CONTINUE(err!=OK); set(key,value); - set_persisting(key,true); + } set_registering_order(true); @@ -804,7 +794,7 @@ Error Globals::_load_settings_binary(const String p_path) { return OK; } -Error Globals::_load_settings(const String p_path) { +Error GlobalConfig::_load_settings(const String p_path) { Error err; @@ -883,8 +873,10 @@ Error Globals::_load_settings(const String p_path) { Variant val = _decode_variant(value); - set(subpath+var,val); - set_persisting(subpath+var,true); + StringName path = subpath+var; + + set(path,val); + //props[subpath+var]=VariantContainer(val,last_order++,true); } else { @@ -935,9 +927,9 @@ static String _encode_variant(const Variant& p_variant) { Color val = p_variant; return "#"+val.to_html(); } break; - case Variant::STRING_ARRAY: - case Variant::INT_ARRAY: - case Variant::REAL_ARRAY: + case Variant::POOL_STRING_ARRAY: + case Variant::POOL_INT_ARRAY: + case Variant::POOL_REAL_ARRAY: case Variant::ARRAY: { Array arr = p_variant; String str="["; @@ -974,31 +966,35 @@ static String _encode_variant(const Variant& p_variant) { if (!img.empty()) { String format; + + /* switch(img.get_format()) { - case Image::FORMAT_GRAYSCALE: format="grayscale"; break; + case Image::FORMAT_L8: format="grayscale"; break; case Image::FORMAT_INTENSITY: format="intensity"; break; - case Image::FORMAT_GRAYSCALE_ALPHA: format="grayscale_alpha"; break; - case Image::FORMAT_RGB: format="rgb"; break; - case Image::FORMAT_RGBA: format="rgba"; break; + case Image::FORMAT_LA8: format="grayscale_alpha"; break; + case Image::FORMAT_RGB8: format="rgb"; break; + case Image::FORMAT_RGBA8: format="rgba"; break; case Image::FORMAT_INDEXED : format="indexed"; break; case Image::FORMAT_INDEXED_ALPHA: format="indexed_alpha"; break; - case Image::FORMAT_BC1: format="bc1"; break; - case Image::FORMAT_BC2: format="bc2"; break; - case Image::FORMAT_BC3: format="bc3"; break; - case Image::FORMAT_BC4: format="bc4"; break; - case Image::FORMAT_BC5: format="bc5"; break; + case Image::FORMAT_DXT1: format="bc1"; break; + case Image::FORMAT_DXT3: format="bc2"; break; + case Image::FORMAT_DXT5: format="bc3"; break; + case Image::FORMAT_ATI1: format="bc4"; break; + case Image::FORMAT_ATI2: format="bc5"; break; case Image::FORMAT_CUSTOM: format="custom custom_size="+itos(img.get_data().size())+""; break; default: {} } + */ + str+=format+", "; - str+=itos(img.get_mipmaps())+", "; + str+=itos(img.has_mipmaps())+", "; str+=itos(img.get_width())+", "; str+=itos(img.get_height())+", "; - DVector<uint8_t> data = img.get_data(); + PoolVector<uint8_t> data = img.get_data(); int ds=data.size(); - DVector<uint8_t>::Read r = data.read(); + PoolVector<uint8_t>::Read r = data.read(); for(int i=0;i<ds;i++) { uint8_t byte = r[i]; const char hex[16]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; @@ -1035,11 +1031,11 @@ static String _encode_variant(const Variant& p_variant) { return "mbutton("+itos(ev.device)+", "+itos(ev.mouse_button.button_index)+")"; } break; - case InputEvent::JOYSTICK_BUTTON: { + case InputEvent::JOYPAD_BUTTON: { return "jbutton("+itos(ev.device)+", "+itos(ev.joy_button.button_index)+")"; } break; - case InputEvent::JOYSTICK_MOTION: { + case InputEvent::JOYPAD_MOTION: { return "jaxis("+itos(ev.device)+", "+itos(ev.joy_motion.axis * 2 + (ev.joy_motion.axis_value<0?0:1))+")"; } break; @@ -1057,31 +1053,31 @@ static String _encode_variant(const Variant& p_variant) { } -int Globals::get_order(const String& p_name) const { +int GlobalConfig::get_order(const String& p_name) const { ERR_FAIL_COND_V(!props.has(p_name),-1); return props[p_name].order; } -void Globals::set_order(const String& p_name, int p_order){ +void GlobalConfig::set_order(const String& p_name, int p_order){ ERR_FAIL_COND(!props.has(p_name)); props[p_name].order=p_order; } -void Globals::clear(const String& p_name) { +void GlobalConfig::clear(const String& p_name) { ERR_FAIL_COND(!props.has(p_name)); props.erase(p_name); } -Error Globals::save() { +Error GlobalConfig::save() { return save_custom(get_resource_path()+"/engine.cfg"); } -Error Globals::_save_settings_binary(const String& p_file,const Map<String,List<String> > &props,const CustomMap& p_custom) { +Error GlobalConfig::_save_settings_binary(const String& p_file,const Map<String,List<String> > &props,const CustomMap& p_custom) { Error err; @@ -1150,7 +1146,7 @@ Error Globals::_save_settings_binary(const String& p_file,const Map<String,List< } -Error Globals::_save_settings_text(const String& p_file,const Map<String,List<String> > &props,const CustomMap& p_custom) { +Error GlobalConfig::_save_settings_text(const String& p_file,const Map<String,List<String> > &props,const CustomMap& p_custom) { Error err; FileAccess *file = FileAccess::open(p_file,FileAccess::WRITE,&err); @@ -1189,12 +1185,12 @@ Error Globals::_save_settings_text(const String& p_file,const Map<String,List<St return OK; } -Error Globals::_save_custom_bnd(const String &p_file) { // add other params as dictionary and array? +Error GlobalConfig::_save_custom_bnd(const String &p_file) { // add other params as dictionary and array? return save_custom(p_file); }; -Error Globals::save_custom(const String& p_path,const CustomMap& p_custom,const Set<String>& p_ignore_masks) { +Error GlobalConfig::save_custom(const String& p_path,const CustomMap& p_custom,const Set<String>& p_ignore_masks) { ERR_FAIL_COND_V(p_path=="",ERR_INVALID_PARAMETER); @@ -1227,8 +1223,8 @@ Error Globals::save_custom(const String& p_path,const CustomMap& p_custom,const vc.name=G->key();//*k; vc.order=v->order; vc.type=v->variant.get_type(); - vc.flags=PROPERTY_USAGE_CHECKABLE|PROPERTY_USAGE_EDITOR|PROPERTY_USAGE_STORAGE; - if (!v->persist) + vc.flags=PROPERTY_USAGE_EDITOR|PROPERTY_USAGE_STORAGE; + if (v->variant==v->initial) continue; @@ -1322,20 +1318,23 @@ Error Globals::save_custom(const String& p_path,const CustomMap& p_custom,const Variant _GLOBAL_DEF( const String& p_var, const Variant& p_default) { - if (Globals::get_singleton()->has(p_var)) - return Globals::get_singleton()->get(p_var); - Globals::get_singleton()->set(p_var,p_default); + if (GlobalConfig::get_singleton()->has(p_var)) { + GlobalConfig::get_singleton()->set_initial_value(p_var,p_default); + return GlobalConfig::get_singleton()->get(p_var); + } + GlobalConfig::get_singleton()->set(p_var,p_default); + GlobalConfig::get_singleton()->set_initial_value(p_var,p_default); return p_default; } -void Globals::add_singleton(const Singleton &p_singleton) { +void GlobalConfig::add_singleton(const Singleton &p_singleton) { singletons.push_back(p_singleton); singleton_ptrs[p_singleton.name]=p_singleton.ptr; } -Object* Globals::get_singleton_object(const String& p_name) const { +Object* GlobalConfig::get_singleton_object(const String& p_name) const { const Map<StringName,Object*>::Element *E=singleton_ptrs.find(p_name); @@ -1346,21 +1345,21 @@ Object* Globals::get_singleton_object(const String& p_name) const { }; -bool Globals::has_singleton(const String& p_name) const { +bool GlobalConfig::has_singleton(const String& p_name) const { return get_singleton_object(p_name) != NULL; }; -void Globals::get_singletons(List<Singleton> *p_singletons) { +void GlobalConfig::get_singletons(List<Singleton> *p_singletons) { for(List<Singleton>::Element *E=singletons.front();E;E=E->next()) p_singletons->push_back(E->get()); } -Vector<String> Globals::get_optimizer_presets() const { +Vector<String> GlobalConfig::get_optimizer_presets() const { List<PropertyInfo> pi; - Globals::get_singleton()->get_property_list(&pi); + GlobalConfig::get_singleton()->get_property_list(&pi); Vector<String> names; for (List<PropertyInfo>::Element *E=pi.front();E;E=E->next()) { @@ -1376,7 +1375,7 @@ Vector<String> Globals::get_optimizer_presets() const { } -void Globals::_add_property_info_bind(const Dictionary& p_info) { +void GlobalConfig::_add_property_info_bind(const Dictionary& p_info) { ERR_FAIL_COND(!p_info.has("name")); ERR_FAIL_COND(!p_info.has("type")); @@ -1395,44 +1394,63 @@ void Globals::_add_property_info_bind(const Dictionary& p_info) { set_custom_property_info(pinfo.name, pinfo); } -void Globals::set_custom_property_info(const String& p_prop,const PropertyInfo& p_info) { +void GlobalConfig::set_custom_property_info(const String& p_prop,const PropertyInfo& p_info) { ERR_FAIL_COND(!props.has(p_prop)); custom_prop_info[p_prop]=p_info; + custom_prop_info[p_prop].name=p_prop; } -void Globals::set_disable_platform_override(bool p_disable) { +void GlobalConfig::set_disable_platform_override(bool p_disable) { disable_platform_override=p_disable; } -bool Globals::is_using_datapack() const { +bool GlobalConfig::is_using_datapack() const { return using_datapack; } -void Globals::_bind_methods() { +bool GlobalConfig::property_can_revert(const String& p_name) { + + if (!props.has(p_name)) + return false; + + return props[p_name].initial!=props[p_name].variant; + +} + +Variant GlobalConfig::property_get_revert(const String& p_name) { + + if (!props.has(p_name)) + return Variant(); - ObjectTypeDB::bind_method(_MD("has","name"),&Globals::has); - ObjectTypeDB::bind_method(_MD("set_order","name","pos"),&Globals::set_order); - ObjectTypeDB::bind_method(_MD("get_order","name"),&Globals::get_order); - ObjectTypeDB::bind_method(_MD("set_persisting","name","enable"),&Globals::set_persisting); - ObjectTypeDB::bind_method(_MD("is_persisting","name"),&Globals::is_persisting); - ObjectTypeDB::bind_method(_MD("add_property_info", "hint"),&Globals::_add_property_info_bind); - ObjectTypeDB::bind_method(_MD("clear","name"),&Globals::clear); - ObjectTypeDB::bind_method(_MD("localize_path","path"),&Globals::localize_path); - ObjectTypeDB::bind_method(_MD("globalize_path","path"),&Globals::globalize_path); - ObjectTypeDB::bind_method(_MD("save"),&Globals::save); - ObjectTypeDB::bind_method(_MD("has_singleton","name"),&Globals::has_singleton); - ObjectTypeDB::bind_method(_MD("get_singleton","name"),&Globals::get_singleton_object); - ObjectTypeDB::bind_method(_MD("load_resource_pack","pack"),&Globals::_load_resource_pack); + return props[p_name].initial; +} - ObjectTypeDB::bind_method(_MD("save_custom","file"),&Globals::_save_custom_bnd); +void GlobalConfig::_bind_methods() { + + ClassDB::bind_method(_MD("has","name"),&GlobalConfig::has); + ClassDB::bind_method(_MD("set_order","name","pos"),&GlobalConfig::set_order); + ClassDB::bind_method(_MD("get_order","name"),&GlobalConfig::get_order); + ClassDB::bind_method(_MD("set_initial_value","name","value"),&GlobalConfig::set_initial_value); + ClassDB::bind_method(_MD("add_property_info", "hint"),&GlobalConfig::_add_property_info_bind); + ClassDB::bind_method(_MD("clear","name"),&GlobalConfig::clear); + ClassDB::bind_method(_MD("localize_path","path"),&GlobalConfig::localize_path); + ClassDB::bind_method(_MD("globalize_path","path"),&GlobalConfig::globalize_path); + ClassDB::bind_method(_MD("save"),&GlobalConfig::save); + ClassDB::bind_method(_MD("has_singleton","name"),&GlobalConfig::has_singleton); + ClassDB::bind_method(_MD("get_singleton","name"),&GlobalConfig::get_singleton_object); + ClassDB::bind_method(_MD("load_resource_pack","pack"),&GlobalConfig::_load_resource_pack); + ClassDB::bind_method(_MD("property_can_revert","name"),&GlobalConfig::property_can_revert); + ClassDB::bind_method(_MD("property_get_revert","name"),&GlobalConfig::property_get_revert); + + ClassDB::bind_method(_MD("save_custom","file"),&GlobalConfig::_save_custom_bnd); } -Globals::Globals() { +GlobalConfig::GlobalConfig() { singleton=this; @@ -1445,14 +1463,14 @@ Globals::Globals() { InputEvent key; key.type=InputEvent::KEY; InputEvent joyb; - joyb.type=InputEvent::JOYSTICK_BUTTON; + joyb.type=InputEvent::JOYPAD_BUTTON; - set("application/name","" ); - set("application/main_scene",""); + GLOBAL_DEF("application/name","" ); + GLOBAL_DEF("application/main_scene",""); custom_prop_info["application/main_scene"]=PropertyInfo(Variant::STRING,"application/main_scene",PROPERTY_HINT_FILE,"tscn,scn,xscn,xml,res"); - set("application/disable_stdout",false); - set("application/use_shared_user_dir",true); + GLOBAL_DEF("application/disable_stdout",false); + GLOBAL_DEF("application/use_shared_user_dir",true); key.key.scancode=KEY_RETURN; @@ -1463,7 +1481,7 @@ Globals::Globals() { va.push_back(key); joyb.joy_button.button_index=JOY_BUTTON_0; va.push_back(joyb); - set("input/ui_accept",va); + GLOBAL_DEF("input/ui_accept",va); input_presets.push_back("input/ui_accept"); va=Array(); @@ -1471,7 +1489,7 @@ Globals::Globals() { va.push_back(key); joyb.joy_button.button_index=JOY_BUTTON_3; va.push_back(joyb); - set("input/ui_select",va); + GLOBAL_DEF("input/ui_select",va); input_presets.push_back("input/ui_select"); va=Array(); @@ -1479,20 +1497,20 @@ Globals::Globals() { va.push_back(key); joyb.joy_button.button_index=JOY_BUTTON_1; va.push_back(joyb); - set("input/ui_cancel",va); + GLOBAL_DEF("input/ui_cancel",va); input_presets.push_back("input/ui_cancel"); va=Array(); key.key.scancode=KEY_TAB; va.push_back(key); - set("input/ui_focus_next",va); + GLOBAL_DEF("input/ui_focus_next",va); input_presets.push_back("input/ui_focus_next"); va=Array(); key.key.scancode=KEY_TAB; key.key.mod.shift=true; va.push_back(key); - set("input/ui_focus_prev",va); + GLOBAL_DEF("input/ui_focus_prev",va); input_presets.push_back("input/ui_focus_prev"); key.key.mod.shift=false; @@ -1501,7 +1519,7 @@ Globals::Globals() { va.push_back(key); joyb.joy_button.button_index=JOY_DPAD_LEFT; va.push_back(joyb); - set("input/ui_left",va); + GLOBAL_DEF("input/ui_left",va); input_presets.push_back("input/ui_left"); va=Array(); @@ -1509,7 +1527,7 @@ Globals::Globals() { va.push_back(key); joyb.joy_button.button_index=JOY_DPAD_RIGHT; va.push_back(joyb); - set("input/ui_right",va); + GLOBAL_DEF("input/ui_right",va); input_presets.push_back("input/ui_right"); va=Array(); @@ -1517,7 +1535,7 @@ Globals::Globals() { va.push_back(key); joyb.joy_button.button_index=JOY_DPAD_UP; va.push_back(joyb); - set("input/ui_up",va); + GLOBAL_DEF("input/ui_up",va); input_presets.push_back("input/ui_up"); va=Array(); @@ -1525,36 +1543,35 @@ Globals::Globals() { va.push_back(key); joyb.joy_button.button_index=JOY_DPAD_DOWN; va.push_back(joyb); - set("input/ui_down",va); + GLOBAL_DEF("input/ui_down",va); input_presets.push_back("input/ui_down"); va=Array(); key.key.scancode=KEY_PAGEUP; va.push_back(key); - set("input/ui_page_up",va); + GLOBAL_DEF("input/ui_page_up",va); input_presets.push_back("input/ui_page_up"); va=Array(); key.key.scancode=KEY_PAGEDOWN; va.push_back(key); - set("input/ui_page_down",va); + GLOBAL_DEF("input/ui_page_down",va); input_presets.push_back("input/ui_page_down"); -// set("display/orientation", "landscape"); +// GLOBAL_DEF("display/handheld/orientation", "landscape"); - custom_prop_info["display/orientation"]=PropertyInfo(Variant::STRING,"display/orientation",PROPERTY_HINT_ENUM,"landscape,portrait,reverse_landscape,reverse_portrait,sensor_landscape,sensor_portrait,sensor"); - custom_prop_info["render/mipmap_policy"]=PropertyInfo(Variant::INT,"render/mipmap_policy",PROPERTY_HINT_ENUM,"Allow,Allow For Po2,Disallow"); - custom_prop_info["render/thread_model"]=PropertyInfo(Variant::INT,"render/thread_model",PROPERTY_HINT_ENUM,"Single-Unsafe,Single-Safe,Multi-Threaded"); - custom_prop_info["physics_2d/thread_model"]=PropertyInfo(Variant::INT,"physics_2d/thread_model",PROPERTY_HINT_ENUM,"Single-Unsafe,Single-Safe,Multi-Threaded"); + custom_prop_info["display/handheld/orientation"]=PropertyInfo(Variant::STRING,"display/handheld/orientation",PROPERTY_HINT_ENUM,"landscape,portrait,reverse_landscape,reverse_portrait,sensor_landscape,sensor_portrait,sensor"); + custom_prop_info["rendering/threads/thread_model"]=PropertyInfo(Variant::INT,"rendering/threads/thread_model",PROPERTY_HINT_ENUM,"Single-Unsafe,Single-Safe,Multi-Threaded"); + custom_prop_info["physics/2d/thread_model"]=PropertyInfo(Variant::INT,"physics/2d/thread_model",PROPERTY_HINT_ENUM,"Single-Unsafe,Single-Safe,Multi-Threaded"); - set("debug/profiler_max_functions",16384); + GLOBAL_DEF("debug/profiler/max_functions",16384); using_datapack=false; } -Globals::~Globals() { +GlobalConfig::~GlobalConfig() { singleton=NULL; } diff --git a/core/globals.h b/core/globals.h index 5e0bdb0e54..faf077f2a5 100644 --- a/core/globals.h +++ b/core/globals.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,9 +37,9 @@ */ -class Globals : public Object { +class GlobalConfig : public Object { - OBJ_TYPE( Globals, Object ); + GDCLASS( GlobalConfig, Object ); _THREAD_SAFE_CLASS_ public: @@ -62,6 +62,7 @@ protected: int order; bool persist; Variant variant; + Variant initial; bool hide_from_editor; bool overrided; VariantContainer(){ order=0; hide_from_editor=false; persist=false; overrided=false; } @@ -82,7 +83,7 @@ protected: bool _get(const StringName& p_name,Variant &r_ret) const; void _get_property_list(List<PropertyInfo> *p_list) const; - static Globals *singleton; + static GlobalConfig *singleton; Error _load_settings(const String p_path); Error _load_settings_binary(const String p_path); @@ -109,12 +110,14 @@ public: String localize_path(const String& p_path) const; String globalize_path(const String& p_path) const; - void set_persisting(const String& p_name, bool p_persist); - bool is_persisting(const String& p_name) const; + + void set_initial_value(const String& p_name, const Variant & p_value); + bool property_can_revert(const String& p_name); + Variant property_get_revert(const String& p_name); String get_resource_path() const; - static Globals *get_singleton(); + static GlobalConfig *get_singleton(); void clear(const String& p_name); int get_order(const String& p_name) const; @@ -144,12 +147,14 @@ public: void set_registering_order(bool p_registering); - Globals(); - ~Globals(); + GlobalConfig(); + ~GlobalConfig(); }; //not a macro any longer Variant _GLOBAL_DEF( const String& p_var, const Variant& p_default); #define GLOBAL_DEF(m_var,m_value) _GLOBAL_DEF(m_var,m_value) +#define GLOBAL_GET(m_var) GlobalConfig::get_singleton()->get(m_var) + #endif diff --git a/core/hash_map.h b/core/hash_map.h index e83710c700..fba12b55ec 100644 --- a/core/hash_map.h +++ b/core/hash_map.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -596,6 +596,20 @@ public: hash_table_power=0; } + void get_key_value_ptr_array(const Pair **p_pairs) const { + if (!hash_table) + return; + for(int i=0;i<(1<<hash_table_power);i++) { + + Entry *e=hash_table[i]; + while(e) { + *p_pairs=&e->pair; + p_pairs++; + e=e->next; + } + } + } + void get_key_list(List<TKey> *p_keys) const { if (!hash_table) return; diff --git a/core/hashfuncs.h b/core/hashfuncs.h index 6c029a3458..e9e57d8b42 100644 --- a/core/hashfuncs.h +++ b/core/hashfuncs.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/helper/value_evaluator.h b/core/helper/value_evaluator.h index 461c505ee7..9ea03db4c6 100644 --- a/core/helper/value_evaluator.h +++ b/core/helper/value_evaluator.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class ValueEvaluator : public Object { - OBJ_TYPE(ValueEvaluator, Object); + GDCLASS(ValueEvaluator, Object); public: virtual double eval(const String& p_text) { return p_text.to_double(); diff --git a/core/image.cpp b/core/image.cpp index 90051d7d0d..174c840c23 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,86 +36,186 @@ const char* Image::format_names[Image::FORMAT_MAX]={ - "Grayscale", - "Intensity", - "GrayscaleAlpha", - "RGB", - "RGBA", - "Indexed", - "IndexedAlpha", - "YUV422", - "YUV444", - "BC1", - "BC2", - "BC3", - "BC4", - "BC5", - "PVRTC2", - "PVRTC2Alpha", + "Lum8", //luminance + "LumAlpha8", //luminance-alpha + "Red8", + "RedGreen", + "RGB8", + "RGBA8", + "RGB565", //16 bit + "RGBA4444", + "RGBA5551", + "RFloat", //float + "RGFloat", + "RGBFloat", + "RGBAFloat", + "RHalf", //half float + "RGHalf", + "RGBHalf", + "RGBAHalf", + "DXT1", //s3tc + "DXT3", + "DXT5", + "ATI1", + "ATI2", + "BPTC_RGBA", + "BPTC_RGBF", + "BPTC_RGBFU", + "PVRTC2", //pvrtc + "PVRTC2A", "PVRTC4", - "PVRTC4Alpha", - "ETC", - "ATC", - "ATCAlphaExp", - "ATCAlphaInterp", + "PVRTC4A", + "ETC", //etc1 + "ETC2_R11", //etc2 + "ETC2_R11S", //signed", NOT srgb. + "ETC2_RG11", + "ETC2_RG11S", + "ETC2_RGB8", + "ETC2_RGBA8", + "ETC2_RGB8A1", }; SavePNGFunc Image::save_png_func = NULL; -void Image::_put_pixel(int p_x,int p_y, const BColor& p_color, unsigned char *p_data) { - _put_pixelw(p_x,p_y,width,p_color,p_data); +void Image::_put_pixelb(int p_x,int p_y, uint32_t p_pixelsize,uint8_t *p_dst,const uint8_t *p_src) { + + uint32_t ofs=(p_y*width+p_x)*p_pixelsize; + + for(uint32_t i=0;i<p_pixelsize;i++) { + p_dst[ofs+i]=p_src[i]; + } } -void Image::_put_pixelw(int p_x,int p_y, int p_width, const BColor& p_color, unsigned char *p_data) { +void Image::_get_pixelb(int p_x,int p_y, uint32_t p_pixelsize,const uint8_t *p_src,uint8_t *p_dst) { + uint32_t ofs=(p_y*width+p_x)*p_pixelsize; - int ofs=p_y*p_width+p_x; + for(uint32_t i=0;i<p_pixelsize;i++) { + p_dst[ofs]=p_src[ofs+i]; + } - switch(format) { - case FORMAT_GRAYSCALE: { +} - p_data[ofs]=p_color.gray(); - } break; - case FORMAT_INTENSITY: { - p_data[ofs]=p_color.a; - } break; - case FORMAT_GRAYSCALE_ALPHA: { +int Image::get_format_pixel_size(Format p_format) { + + switch(p_format) { + case FORMAT_L8: return 1; //luminance + case FORMAT_LA8: return 2; //luminance-alpha + case FORMAT_R8: return 1; + case FORMAT_RG8: return 2; + case FORMAT_RGB8: return 3; + case FORMAT_RGBA8: return 4; + case FORMAT_RGB565: return 2; //16 bit + case FORMAT_RGBA4444: return 2; + case FORMAT_RGBA5551: return 2; + case FORMAT_RF: return 4; //float + case FORMAT_RGF: return 8; + case FORMAT_RGBF: return 12; + case FORMAT_RGBAF: return 16; + case FORMAT_RH: return 2; //half float + case FORMAT_RGH: return 4; + case FORMAT_RGBH: return 8; + case FORMAT_RGBAH: return 12; + case FORMAT_DXT1: return 1; //s3tc bc1 + case FORMAT_DXT3: return 1; //bc2 + case FORMAT_DXT5: return 1; //bc3 + case FORMAT_ATI1: return 1; //bc4 + case FORMAT_ATI2: return 1; //bc5 + case FORMAT_BPTC_RGBA: return 1; //btpc bc6h + case FORMAT_BPTC_RGBF: return 1; //float / + case FORMAT_BPTC_RGBFU: return 1; //unsigned float + case FORMAT_PVRTC2: return 1; //pvrtc + case FORMAT_PVRTC2A: return 1; + case FORMAT_PVRTC4: return 1; + case FORMAT_PVRTC4A: return 1; + case FORMAT_ETC: return 1; //etc1 + case FORMAT_ETC2_R11: return 1; //etc2 + case FORMAT_ETC2_R11S: return 1; //signed: return 1; NOT srgb. + case FORMAT_ETC2_RG11: return 1; + case FORMAT_ETC2_RG11S: return 1; + case FORMAT_ETC2_RGB8: return 1; + case FORMAT_ETC2_RGBA8: return 1; + case FORMAT_ETC2_RGB8A1: return 1; + case FORMAT_MAX: {} + - p_data[ofs*2]=p_color.gray(); - p_data[ofs*2+1]=p_color.a; + } + return 0; +} + +void Image::get_format_min_pixel_size(Format p_format,int &r_w, int &r_h) { + + + switch(p_format) { + case FORMAT_DXT1: //s3tc bc1 + case FORMAT_DXT3: //bc2 + case FORMAT_DXT5: //bc3 + case FORMAT_ATI1: //bc4 + case FORMAT_ATI2: { //bc5 case case FORMAT_DXT1: + r_w=4; + r_h=4; } break; - case FORMAT_RGB: { + case FORMAT_PVRTC2: + case FORMAT_PVRTC2A: { - p_data[ofs*3+0]=p_color.r; - p_data[ofs*3+1]=p_color.g; - p_data[ofs*3+2]=p_color.b; + r_w=16; + r_h=8; + } break; + case FORMAT_PVRTC4A: + case FORMAT_PVRTC4: { + r_w=8; + r_h=8; } break; - case FORMAT_RGBA: { + case FORMAT_ETC: { - p_data[ofs*4+0]=p_color.r; - p_data[ofs*4+1]=p_color.g; - p_data[ofs*4+2]=p_color.b; - p_data[ofs*4+3]=p_color.a; + r_w=4; + r_h=4; + } break; + case FORMAT_BPTC_RGBA: + case FORMAT_BPTC_RGBF: + case FORMAT_BPTC_RGBFU: { + r_w=4; + r_h=4; } break; - case FORMAT_INDEXED: - case FORMAT_INDEXED_ALPHA: { + case FORMAT_ETC2_R11: //etc2 + case FORMAT_ETC2_R11S: //signed: NOT srgb. + case FORMAT_ETC2_RG11: + case FORMAT_ETC2_RG11S: + case FORMAT_ETC2_RGB8: + case FORMAT_ETC2_RGBA8: + case FORMAT_ETC2_RGB8A1: { + + r_w=4; + r_h=4; - ERR_FAIL(); } break; - default: {}; + default: { + r_w=1; + r_h=1; + } break; } } +int Image::get_format_pixel_rshift(Format p_format) { + + if (p_format==FORMAT_DXT1 || p_format==FORMAT_ATI1 || p_format==FORMAT_PVRTC4 || p_format==FORMAT_PVRTC4A || p_format==FORMAT_ETC || p_format==FORMAT_ETC2_R11 || p_format==FORMAT_ETC2_R11S || p_format==FORMAT_ETC2_RGB8 || p_format==FORMAT_ETC2_RGB8A1) + return 1; + else if (p_format==FORMAT_PVRTC2 || p_format==FORMAT_PVRTC2A) + return 2; + else + return 0; +} + void Image::_get_mipmap_offset_and_size(int p_mipmap,int &r_offset, int &r_width,int &r_height) const { @@ -126,7 +226,7 @@ void Image::_get_mipmap_offset_and_size(int p_mipmap,int &r_offset, int &r_width int pixel_size = get_format_pixel_size(format); int pixel_rshift = get_format_pixel_rshift(format); int minw,minh; - _get_format_min_data_size(format,minw,minh); + get_format_min_pixel_size(format,minw,minh); for(int i=0;i<p_mipmap;i++) { int s = w*h; @@ -173,191 +273,76 @@ void Image::get_mipmap_offset_size_and_dimensions(int p_mipmap,int &r_ofs, int & } -void Image::put_pixel(int p_x,int p_y, const Color& p_color,int p_mipmap){ - - ERR_FAIL_INDEX(p_mipmap,mipmaps+1); - int ofs,w,h; - _get_mipmap_offset_and_size(p_mipmap,ofs,w,h); - ERR_FAIL_INDEX(p_x,w); - ERR_FAIL_INDEX(p_y,h); - - DVector<uint8_t>::Write wp = data.write(); - unsigned char *data_ptr=wp.ptr(); - - _put_pixelw(p_x,p_y,w,BColor(p_color.r*255,p_color.g*255,p_color.b*255,p_color.a*255),&data_ptr[ofs]); +int Image::get_width() const { + return width; } +int Image::get_height() const{ -Image::BColor Image::_get_pixel(int p_x,int p_y,const unsigned char *p_data,int p_data_size) const{ - - return _get_pixelw(p_x,p_y,width,p_data,p_data_size); + return height; } -Image::BColor Image::_get_pixelw(int p_x,int p_y,int p_width,const unsigned char *p_data,int p_data_size) const{ - int ofs=p_y*p_width+p_x; - BColor result(0,0,0,0); - switch(format) { - - case FORMAT_GRAYSCALE: { - - result=BColor(p_data[ofs],p_data[ofs],p_data[ofs],255.0); - } break; - case FORMAT_INTENSITY: { - - result=BColor(255,255,255,p_data[ofs]); - } break; - case FORMAT_GRAYSCALE_ALPHA: { - - result=BColor(p_data[ofs*2],p_data[ofs*2],p_data[ofs*2],p_data[ofs*2+1]); - - } break; - case FORMAT_RGB: { - - result=BColor(p_data[ofs*3],p_data[ofs*3+1],p_data[ofs*3+2]); - - } break; - case FORMAT_RGBA: { - - result=BColor(p_data[ofs*4],p_data[ofs*4+1],p_data[ofs*4+2],p_data[ofs*4+3]); - } break; - case FORMAT_INDEXED_ALPHA: { - - int pitch = 4; - const uint8_t* pal = &p_data[ p_data_size - pitch * 256 ]; - int idx = p_data[ofs]; - result=BColor(pal[idx * pitch + 0] , pal[idx * pitch + 1] , pal[idx * pitch + 2] , pal[idx * pitch + 3] ); - - } break; - case FORMAT_INDEXED: { - - int pitch = 3; - const uint8_t* pal = &p_data[ p_data_size - pitch * 256 ]; - int idx = p_data[ofs]; - result=BColor(pal[idx * pitch + 0] , pal[idx * pitch + 1] , pal[idx * pitch + 2] ,255); - } break; - case FORMAT_YUV_422: { - - int y, u, v; - if (p_x % 2) { - const uint8_t* yp = &p_data[p_width * 2 * p_y + p_x * 2]; - u = *(yp-1); - y = yp[0]; - v = yp[1]; - } else { - - const uint8_t* yp = &p_data[p_width * 2 * p_y + p_x * 2]; - y = yp[0]; - u = yp[1]; - v = yp[3]; - }; - - int32_t r = 1.164 * (y - 16) + 1.596 * (v - 128); - int32_t g = 1.164 * (y - 16) - 0.813 * (v - 128) - 0.391 * (u - 128); - int32_t b = 1.164 * (y - 16) + 2.018 * (u - 128); - result = BColor(CLAMP(r, 0, 255), CLAMP(g, 0, 255), CLAMP(b, 0, 255)); - } break; - case FORMAT_YUV_444: { - - uint8_t y, u, v; - const uint8_t* yp = &p_data[p_width * 3 * p_y + p_x * 3]; - y = yp[0]; - u = yp[1]; - v = yp[2]; - - int32_t r = 1.164 * (y - 16) + 1.596 * (v - 128); - int32_t g = 1.164 * (y - 16) - 0.813 * (v - 128) - 0.391 * (u - 128); - int32_t b = 1.164 * (y - 16) + 2.018 * (u - 128); - result = BColor(CLAMP(r, 0, 255), CLAMP(g, 0, 255), CLAMP(b, 0, 255)); - } break; - default:{} - - } - - return result; +bool Image::has_mipmaps() const { + return mipmaps; } -void Image::put_indexed_pixel(int p_x, int p_y, uint8_t p_idx,int p_mipmap) { - - ERR_FAIL_COND(format != FORMAT_INDEXED && format != FORMAT_INDEXED_ALPHA); - ERR_FAIL_INDEX(p_mipmap,mipmaps+1); - int ofs,w,h; - _get_mipmap_offset_and_size(p_mipmap,ofs,w,h); - ERR_FAIL_INDEX(p_x,w); - ERR_FAIL_INDEX(p_y,h); - - data.set(ofs + p_y * w + p_x, p_idx); -}; - -uint8_t Image::get_indexed_pixel(int p_x, int p_y,int p_mipmap) const { +int Image::get_mipmap_count() const { - ERR_FAIL_COND_V(format != FORMAT_INDEXED && format != FORMAT_INDEXED_ALPHA, 0); - - ERR_FAIL_INDEX_V(p_mipmap,mipmaps+1,0); - int ofs,w,h; - _get_mipmap_offset_and_size(p_mipmap,ofs,w,h); - ERR_FAIL_INDEX_V(p_x,w,0); - ERR_FAIL_INDEX_V(p_y,h,0); - - - return data[ofs + p_y * w + p_x]; -}; - -void Image::set_pallete(const DVector<uint8_t>& p_data) { - - - int len = p_data.size(); - - ERR_FAIL_COND(format != FORMAT_INDEXED && format != FORMAT_INDEXED_ALPHA); - ERR_FAIL_COND(format == FORMAT_INDEXED && len!=(256*3)); - ERR_FAIL_COND(format == FORMAT_INDEXED_ALPHA && len!=(256*4)); - - int ofs,w,h; - _get_mipmap_offset_and_size(mipmaps+1,ofs,w,h); + if (mipmaps) + return get_image_required_mipmaps(width,height,format); + else + return 0; +} - int pal_ofs = ofs; - data.resize(pal_ofs + p_data.size()); - DVector<uint8_t>::Write wp = data.write(); - unsigned char *dst=wp.ptr() + pal_ofs; +//using template generates perfectly optimized code due to constant expression reduction and unused variable removal present in all compilers +template<uint32_t read_bytes,bool read_alpha,uint32_t write_bytes,bool write_alpha,bool read_gray,bool write_gray> +static void _convert( int p_width,int p_height,const uint8_t* p_src,uint8_t* p_dst ){ - DVector<uint8_t>::Read r = p_data.read(); - const unsigned char *src=r.ptr(); - copymem(dst, src, len); -}; -int Image::get_width() const { + for(int y=0;y<p_height;y++) { + for(int x=0;x<p_width;x++) { - return width; -} -int Image::get_height() const{ + const uint8_t *rofs = &p_src[((y*p_width)+x)*(read_bytes+(read_alpha?1:0))]; + uint8_t *wofs = &p_dst[((y*p_width)+x)*(write_bytes+(write_alpha?1:0))]; - return height; -} + uint8_t rgba[4]; -int Image::get_mipmaps() const { + if (read_gray) { + rgba[0]=rofs[0]; + rgba[1]=rofs[0]; + rgba[2]=rofs[0]; + } else { + for(uint32_t i=0;i<MAX(read_bytes,write_bytes);i++) { + rgba[i]=(i<read_bytes)?rofs[i]:0; + } + } - return mipmaps; -} + if (read_alpha || write_alpha) { + rgba[3]=read_alpha?rofs[read_bytes]:255; + } -Color Image::get_pixel(int p_x,int p_y,int p_mipmap) const { + if (write_gray) { + //TODO: not correct grayscale, should use fixed point version of actual weights + wofs[0]=uint8_t((uint16_t(rofs[0])+uint16_t(rofs[1])+uint16_t(rofs[2]))/3); + } else { + for(uint32_t i=0;i<write_bytes;i++) { + wofs[i]=rgba[i]; + } + } - ERR_FAIL_INDEX_V(p_mipmap,mipmaps+1,Color()); - int ofs,w,h; - _get_mipmap_offset_and_size(p_mipmap,ofs,w,h); - ERR_FAIL_INDEX_V(p_x,w,Color()); - ERR_FAIL_INDEX_V(p_y,h,Color()); + if (write_alpha) { + wofs[write_bytes]=rgba[3]; + } + } + } - int len = data.size(); - DVector<uint8_t>::Read r = data.read(); - const unsigned char*data_ptr=r.ptr(); - BColor c = _get_pixelw(p_x,p_y,w,&data_ptr[ofs],len); - return Color( c.r/255.0,c.g/255.0,c.b/255.0,c.a/255.0 ); } void Image::convert( Format p_new_format ){ @@ -368,58 +353,74 @@ void Image::convert( Format p_new_format ){ if (p_new_format==format) return; - if (format>=FORMAT_BC1 || p_new_format>=FORMAT_BC1) { - - ERR_EXPLAIN("Cannot convert to <-> from compressed/custom image formats (for now)."); - ERR_FAIL(); - } - - if (p_new_format==FORMAT_INDEXED || p_new_format==FORMAT_INDEXED_ALPHA) { + if (format>=FORMAT_RGB565 || p_new_format>=FORMAT_RGB565) { - return; + ERR_EXPLAIN("Cannot convert to <-> from non byte formats."); + ERR_FAIL(); } Image new_img(width,height,0,p_new_format); - int len=data.size(); +// int len=data.size(); - DVector<uint8_t>::Read r = data.read(); - DVector<uint8_t>::Write w = new_img.data.write(); + PoolVector<uint8_t>::Read r = data.read(); + PoolVector<uint8_t>::Write w = new_img.data.write(); const uint8_t *rptr = r.ptr(); uint8_t *wptr = w.ptr(); - if (p_new_format==FORMAT_RGBA && format==FORMAT_INDEXED_ALPHA) { - - //optimized unquantized form - int dataend = len-256*4; - const uint32_t *palpos = (const uint32_t*)&rptr[dataend]; - uint32_t *dst32 = (uint32_t *)wptr; + int conversion_type = format | p_new_format<<8; + + switch(conversion_type) { + + case FORMAT_L8|(FORMAT_LA8<<8): _convert<1,false,1,true,true,true>( width, height,rptr, wptr ); break; + case FORMAT_L8|(FORMAT_R8<<8): _convert<1,false,1,false,true,false>( width, height,rptr, wptr ); break; + case FORMAT_L8|(FORMAT_RG8<<8): _convert<1,false,2,false,true,false>( width, height,rptr, wptr ); break; + case FORMAT_L8|(FORMAT_RGB8<<8): _convert<1,false,3,false,true,false>( width, height,rptr, wptr ); break; + case FORMAT_L8|(FORMAT_RGBA8<<8): _convert<1,false,3,true,true,false>( width, height,rptr, wptr ); break; + case FORMAT_LA8|(FORMAT_L8<<8): _convert<1,true,1,false,true,true>( width, height,rptr, wptr ); break; + case FORMAT_LA8|(FORMAT_R8<<8): _convert<1,true,1,false,true,false>( width, height,rptr, wptr ); break; + case FORMAT_LA8|(FORMAT_RG8<<8): _convert<1,true,2,false,true,false>( width, height,rptr, wptr ); break; + case FORMAT_LA8|(FORMAT_RGB8<<8): _convert<1,true,3,false,true,false>( width, height,rptr, wptr ); break; + case FORMAT_LA8|(FORMAT_RGBA8<<8): _convert<1,true,3,true,true,false>( width, height,rptr, wptr ); break; + case FORMAT_R8|(FORMAT_L8<<8): _convert<1,false,1,false,false,true>( width, height,rptr, wptr ); break; + case FORMAT_R8|(FORMAT_LA8<<8): _convert<1,false,1,true,false,true>( width, height,rptr, wptr ); break; + case FORMAT_R8|(FORMAT_RG8<<8): _convert<1,false,2,false,false,false>( width, height,rptr, wptr ); break; + case FORMAT_R8|(FORMAT_RGB8<<8): _convert<1,false,3,false,false,false>( width, height,rptr, wptr ); break; + case FORMAT_R8|(FORMAT_RGBA8<<8): _convert<1,false,3,true,false,false>( width, height,rptr, wptr ); break; + case FORMAT_RG8|(FORMAT_L8<<8): _convert<2,false,1,false,false,true>( width, height,rptr, wptr ); break; + case FORMAT_RG8|(FORMAT_LA8<<8): _convert<2,false,1,true,false,true>( width, height,rptr, wptr ); break; + case FORMAT_RG8|(FORMAT_R8<<8): _convert<2,false,1,false,false,false>( width, height,rptr, wptr ); break; + case FORMAT_RG8|(FORMAT_RGB8<<8): _convert<2,false,3,false,false,false>( width, height,rptr, wptr ); break; + case FORMAT_RG8|(FORMAT_RGBA8<<8): _convert<2,false,3,true,false,false>( width, height,rptr, wptr ); break; + case FORMAT_RGB8|(FORMAT_L8<<8): _convert<3,false,1,false,false,true>( width, height,rptr, wptr ); break; + case FORMAT_RGB8|(FORMAT_LA8<<8): _convert<3,false,1,true,false,true>( width, height,rptr, wptr ); break; + case FORMAT_RGB8|(FORMAT_R8<<8): _convert<3,false,1,false,false,false>( width, height,rptr, wptr ); break; + case FORMAT_RGB8|(FORMAT_RG8<<8): _convert<3,false,2,false,false,false>( width, height,rptr, wptr ); break; + case FORMAT_RGB8|(FORMAT_RGBA8<<8): _convert<3,false,3,true,false,false>( width, height,rptr, wptr ); break; + case FORMAT_RGBA8|(FORMAT_L8<<8): _convert<3,true,1,false,false,true>( width, height,rptr, wptr ); break; + case FORMAT_RGBA8|(FORMAT_LA8<<8): _convert<3,true,1,true,false,true>( width, height,rptr, wptr ); break; + case FORMAT_RGBA8|(FORMAT_R8<<8): _convert<3,true,1,false,false,false>( width, height,rptr, wptr ); break; + case FORMAT_RGBA8|(FORMAT_RG8<<8): _convert<3,true,2,false,false,false>( width, height,rptr, wptr ); break; + case FORMAT_RGBA8|(FORMAT_RGB8<<8): _convert<3,true,3,false,false,false>( width, height,rptr, wptr ); break; - for(int i=0;i<dataend;i++) - dst32[i]=palpos[rptr[i]]; //since this is read/write, endianness is not a problem + } - } else { - //this is temporary, must find a faster way to do it. - for(int i=0;i<width;i++) - for(int j=0;j<height;j++) - new_img._put_pixel(i,j,_get_pixel(i,j,rptr,len),wptr); - } + r = PoolVector<uint8_t>::Read(); + w = PoolVector<uint8_t>::Write(); - r = DVector<uint8_t>::Read(); - w = DVector<uint8_t>::Write(); + bool gen_mipmaps=mipmaps; - bool gen_mipmaps=mipmaps>0; +// mipmaps=false; *this=new_img; if (gen_mipmaps) generate_mipmaps(); - } Image::Format Image::get_format() const{ @@ -460,13 +461,13 @@ static void _scale_cubic(const uint8_t* p_src, uint8_t* p_dst, uint32_t p_src_wi int xmax = width - 1; // temporary pointer - for ( int y = 0; y < p_dst_height; y++ ) { + for ( uint32_t y = 0; y < p_dst_height; y++ ) { // Y coordinates oy = (double) y * yfac - 0.5f; oy1 = (int) oy; dy = oy - (double) oy1; - for ( int x = 0; x < p_dst_width; x++ ) { + for ( uint32_t x = 0; x < p_dst_width; x++ ) { // X coordinates ox = (double) x * xfac - 0.5f; ox1 = (int) ox; @@ -650,14 +651,10 @@ void Image::resize( int p_width, int p_height, Interpolation p_interpolation ) { Image dst( p_width, p_height, 0, format ); - if (format==FORMAT_INDEXED) - p_interpolation=INTERPOLATE_NEAREST; - - - DVector<uint8_t>::Read r = data.read(); + PoolVector<uint8_t>::Read r = data.read(); const unsigned char*r_ptr=r.ptr(); - DVector<uint8_t>::Write w = dst.data.write(); + PoolVector<uint8_t>::Write w = dst.data.write(); unsigned char*w_ptr=w.ptr(); @@ -696,8 +693,8 @@ void Image::resize( int p_width, int p_height, Interpolation p_interpolation ) { } - r = DVector<uint8_t>::Read(); - w = DVector<uint8_t>::Write(); + r = PoolVector<uint8_t>::Read(); + w = PoolVector<uint8_t>::Write(); if (mipmaps>0) dst.generate_mipmaps(); @@ -722,18 +719,33 @@ void Image::crop( int p_width, int p_height ) { if (p_width==width && p_height==height) return; + uint8_t pdata[16]; //largest is 16 + uint32_t pixel_size = get_format_pixel_size(format); + Image dst( p_width, p_height,0, format ); + { + PoolVector<uint8_t>::Read r = data.read(); + PoolVector<uint8_t>::Write w = dst.data.write(); + + for (int y=0;y<p_height;y++) { + + for (int x=0;x<p_width;x++) { - for (int y=0;y<p_height;y++) { + if ((x>=width || y>=height)) { + for(uint32_t i=0;i<pixel_size;i++) + pdata[i]=0; + } else { + _get_pixelb(x,y,pixel_size,r.ptr(),pdata); + } - for (int x=0;x<p_width;x++) { - Color col = (x>=width || y>=height)? Color() : get_pixel(x,y); - dst.put_pixel(x,y,col); + dst._put_pixelb(x,y,pixel_size,w.ptr(),pdata); + } } } + if (mipmaps>0) dst.generate_mipmaps(); *this=dst; @@ -754,18 +766,28 @@ void Image::flip_y() { + { + PoolVector<uint8_t>::Write w = data.write(); + uint8_t up[16]; + uint8_t down[16]; + uint32_t pixel_size = get_format_pixel_size(format); + + for (int y=0;y<height;y++) { + + for (int x=0;x<width;x++) { - for (int y=0;y<(height/2);y++) { - for (int x=0;x<width;x++) { + _get_pixelb(x,y,pixel_size,w.ptr(),up); + _get_pixelb(x,height-y-1,pixel_size,w.ptr(),down); - Color up = get_pixel(x,y); - Color down = get_pixel(x,height-y-1); + _put_pixelb(x,height-y-1,pixel_size,w.ptr(),up); + _put_pixelb(x,y,pixel_size,w.ptr(),down); - put_pixel(x,y,down); - put_pixel(x,height-y-1,up); + } } } + + if (gm) generate_mipmaps();; @@ -782,15 +804,25 @@ void Image::flip_x() { if (gm) clear_mipmaps();; - for (int y=0;y<(height/2);y++) { - for (int x=0;x<width;x++) { + { + PoolVector<uint8_t>::Write w = data.write(); + uint8_t up[16]; + uint8_t down[16]; + uint32_t pixel_size = get_format_pixel_size(format); + + for (int y=0;y<height;y++) { + + for (int x=0;x<width;x++) { - Color up = get_pixel(x,y); - Color down = get_pixel(width-x-1,y); - put_pixel(x,y,down); - put_pixel(width-x-1,y,up); + _get_pixelb(x,y,pixel_size,w.ptr(),up); + _get_pixelb(width-x-1,y,pixel_size,w.ptr(),down); + + _put_pixelb(width-x-1,y,pixel_size,w.ptr(),up); + _put_pixelb(x,y,pixel_size,w.ptr(),down); + + } } } @@ -809,15 +841,7 @@ int Image::_get_dst_image_size(int p_width, int p_height, Format p_format,int &r int pixsize=get_format_pixel_size(p_format); int pixshift=get_format_pixel_rshift(p_format); int minw,minh; - _get_format_min_data_size(p_format,minw,minh); - - - switch(p_format) { - - case FORMAT_INDEXED: pixsize=1; size=256*3; break; - case FORMAT_INDEXED_ALPHA: pixsize=1; size=256*4;break; - default: {} - } ; + get_format_min_pixel_size(p_format,minw,minh); while(true) { @@ -849,20 +873,7 @@ int Image::_get_dst_image_size(int p_width, int p_height, Format p_format,int &r bool Image::_can_modify(Format p_format) const { - switch(p_format) { - - //these are OK - case FORMAT_GRAYSCALE: - case FORMAT_INTENSITY: - case FORMAT_GRAYSCALE_ALPHA: - case FORMAT_RGB: - case FORMAT_RGBA: - return true; - default: - return false; - } - - return false; + return p_format<FORMAT_RGB565; } template<int CC> @@ -903,23 +914,23 @@ static void _generate_po2_mipmap(const uint8_t* p_src, uint8_t* p_dst, uint32_t void Image::expand_x2_hq2x() { - ERR_FAIL_COND(format>=FORMAT_INDEXED); + ERR_FAIL_COND(!_can_modify(format)); Format current = format; - bool mipmaps=get_mipmaps(); - if (mipmaps) { + bool mm=has_mipmaps(); + if (mm) { clear_mipmaps(); } - if (current!=FORMAT_RGBA) - convert(FORMAT_RGBA); + if (current!=FORMAT_RGBA8) + convert(FORMAT_RGBA8); - DVector<uint8_t> dest; + PoolVector<uint8_t> dest; dest.resize(width*2*height*2*4); { - DVector<uint8_t>::Read r = data.read(); - DVector<uint8_t>::Write w = dest.write(); + PoolVector<uint8_t>::Read r = data.read(); + PoolVector<uint8_t>::Write w = dest.write(); hq2x_resize((const uint32_t*)r.ptr(),width,height,(uint32_t*)w.ptr()); @@ -930,7 +941,7 @@ void Image::expand_x2_hq2x() { data=dest; - if (current!=FORMAT_RGBA) + if (current!=FORMAT_RGBA8) convert(current); if (mipmaps) { @@ -941,7 +952,6 @@ void Image::expand_x2_hq2x() { void Image::shrink_x2() { - ERR_FAIL_COND(format==FORMAT_INDEXED || format==FORMAT_INDEXED_ALPHA); ERR_FAIL_COND( data.size()==0 ); @@ -949,7 +959,7 @@ void Image::shrink_x2() { if (mipmaps) { //just use the lower mipmap as base and copy all - DVector<uint8_t> new_img; + PoolVector<uint8_t> new_img; int ofs = get_mipmap_offset(1); @@ -958,36 +968,36 @@ void Image::shrink_x2() { { - DVector<uint8_t>::Write w=new_img.write(); - DVector<uint8_t>::Read r=data.read(); + PoolVector<uint8_t>::Write w=new_img.write(); + PoolVector<uint8_t>::Read r=data.read(); copymem(w.ptr(),&r[ofs],new_size); } - mipmaps--; width/=2; height/=2; data=new_img; } else { - DVector<uint8_t> new_img; + PoolVector<uint8_t> new_img; - ERR_FAIL_COND( format>=FORMAT_INDEXED ); + ERR_FAIL_COND( !_can_modify(format) ); int ps = get_format_pixel_size(format); new_img.resize((width/2)*(height/2)*ps); { - DVector<uint8_t>::Write w=new_img.write(); - DVector<uint8_t>::Read r=data.read(); + PoolVector<uint8_t>::Write w=new_img.write(); + PoolVector<uint8_t>::Read r=data.read(); switch(format) { - case FORMAT_GRAYSCALE: - case FORMAT_INTENSITY: _generate_po2_mipmap<1>(r.ptr(), w.ptr(), width,height); break; - case FORMAT_GRAYSCALE_ALPHA: _generate_po2_mipmap<2>(r.ptr(), w.ptr(), width,height); break; - case FORMAT_RGB: _generate_po2_mipmap<3>(r.ptr(), w.ptr(), width,height); break; - case FORMAT_RGBA: _generate_po2_mipmap<4>(r.ptr(), w.ptr(), width,height); break; + case FORMAT_L8: + case FORMAT_R8: _generate_po2_mipmap<1>(r.ptr(), w.ptr(), width,height); break; + case FORMAT_LA8: _generate_po2_mipmap<2>(r.ptr(), w.ptr(), width,height); break; + case FORMAT_RG8: _generate_po2_mipmap<2>(r.ptr(), w.ptr(), width,height); break; + case FORMAT_RGB8: _generate_po2_mipmap<3>(r.ptr(), w.ptr(), width,height); break; + case FORMAT_RGBA8: _generate_po2_mipmap<4>(r.ptr(), w.ptr(), width,height); break; default: {} } } @@ -999,7 +1009,7 @@ void Image::shrink_x2() { } } -Error Image::generate_mipmaps(int p_mipmaps,bool p_keep_existing) { +Error Image::generate_mipmaps(bool p_keep_existing) { if (!_can_modify(format)) { ERR_EXPLAIN("Cannot generate mipmaps in indexed, compressed or custom image formats."); @@ -1007,15 +1017,17 @@ Error Image::generate_mipmaps(int p_mipmaps,bool p_keep_existing) { } + int mmcount = get_mipmap_count(); + int from_mm=1; if (p_keep_existing) { - from_mm=mipmaps+1; + from_mm=mmcount+1; } - int size = _get_dst_image_size(width,height,format,mipmaps,p_mipmaps); + int size = _get_dst_image_size(width,height,format,mmcount); data.resize(size); - DVector<uint8_t>::Write wp=data.write(); + PoolVector<uint8_t>::Write wp=data.write(); if (nearest_power_of_2(width)==uint32_t(width) && nearest_power_of_2(height)==uint32_t(height)) { //use fast code for powers of 2 @@ -1023,7 +1035,7 @@ Error Image::generate_mipmaps(int p_mipmaps,bool p_keep_existing) { int prev_h=height; int prev_w=width; - for(int i=1;i<mipmaps;i++) { + for(int i=1;i<mmcount;i++) { int ofs,w,h; @@ -1033,11 +1045,12 @@ Error Image::generate_mipmaps(int p_mipmaps,bool p_keep_existing) { switch(format) { - case FORMAT_GRAYSCALE: - case FORMAT_INTENSITY: _generate_po2_mipmap<1>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h); break; - case FORMAT_GRAYSCALE_ALPHA: _generate_po2_mipmap<2>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h); break; - case FORMAT_RGB: _generate_po2_mipmap<3>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h); break; - case FORMAT_RGBA: _generate_po2_mipmap<4>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h); break; + case FORMAT_L8: + case FORMAT_R8: _generate_po2_mipmap<1>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h); break; + case FORMAT_LA8: + case FORMAT_RG8: _generate_po2_mipmap<2>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h); break; + case FORMAT_RGB8: _generate_po2_mipmap<3>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h); break; + case FORMAT_RGBA8: _generate_po2_mipmap<4>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h); break; default: {} } } @@ -1056,7 +1069,7 @@ Error Image::generate_mipmaps(int p_mipmaps,bool p_keep_existing) { int prev_h=height; int prev_w=width; - for(int i=1;i<mipmaps;i++) { + for(int i=1;i<mmcount;i++) { int ofs,w,h; @@ -1066,11 +1079,12 @@ Error Image::generate_mipmaps(int p_mipmaps,bool p_keep_existing) { switch(format) { - case FORMAT_GRAYSCALE: - case FORMAT_INTENSITY: _scale_bilinear<1>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h,w,h); break; - case FORMAT_GRAYSCALE_ALPHA: _scale_bilinear<2>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h,w,h); break; - case FORMAT_RGB: _scale_bilinear<3>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h,w,h); break; - case FORMAT_RGBA: _scale_bilinear<4>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h,w,h); break; + case FORMAT_L8: + case FORMAT_R8: _scale_bilinear<1>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h,w,h); break; + case FORMAT_LA8: + case FORMAT_RG8: _scale_bilinear<2>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h,w,h); break; + case FORMAT_RGB8:_scale_bilinear<3>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h,w,h); break; + case FORMAT_RGBA8: _scale_bilinear<4>(&wp[prev_ofs], &wp[ofs], prev_w,prev_h,w,h); break; default: {} } } @@ -1083,92 +1097,32 @@ Error Image::generate_mipmaps(int p_mipmaps,bool p_keep_existing) { } - - return OK; } void Image::clear_mipmaps() { - if (mipmaps==0) + if (!mipmaps) return; - if (format==FORMAT_CUSTOM) { - ERR_EXPLAIN("Cannot clear mipmaps in indexed, compressed or custom image formats."); - ERR_FAIL(); - - } - if (empty()) return; int ofs,w,h; _get_mipmap_offset_and_size(1,ofs,w,h); - int palsize = get_format_pallete_size(format); - DVector<uint8_t> pallete; - ERR_FAIL_COND(ofs+palsize > data.size()); //bug? - if (palsize) { - - pallete.resize(palsize); - DVector<uint8_t>::Read r = data.read(); - DVector<uint8_t>::Write w = pallete.write(); - - copymem(&w[0],&r[data.size()-palsize],palsize); - } - - data.resize(ofs+palsize); + data.resize(ofs); - if (palsize) { - - DVector<uint8_t>::Read r = pallete.read(); - DVector<uint8_t>::Write w = data.write(); - - copymem(&w[ofs],&r[0],palsize); - } - - mipmaps=0; + mipmaps=false; } -void Image::make_normalmap(float p_height_scale) { - - if (!_can_modify(format)) { - ERR_EXPLAIN("Cannot crop in indexed, compressed or custom image formats."); - ERR_FAIL(); - } - - ERR_FAIL_COND( empty() ); - - Image normalmap(width,height,0, FORMAT_RGB); - /* - for (int y=0;y<height;y++) { - for (int x=0;x<width;x++) { - - float center=get_pixel(x,y).gray()/255.0; - float up=(y>0)?get_pixel(x,y-1).gray()/255.0:center; - float down=(y<(height-1))?get_pixel(x,y+1).gray()/255.0:center; - float left=(x>0)?get_pixel(x-1,y).gray()/255.0:center; - float right=(x<(width-1))?get_pixel(x+1,y).gray()/255.0:center; - - - // uhm, how do i do this? .... - - Color result( (uint8_t)((normal.x+1.0)*127.0), (uint8_t)((normal.y+1.0)*127.0), (uint8_t)((normal.z+1.0)*127.0) ); - - normalmap.put_pixel( x, y, result ); - } - - } - */ - *this=normalmap; -} bool Image::empty() const { return (data.size()==0); } -DVector<uint8_t> Image::get_data() const { +PoolVector<uint8_t> Image::get_data() const { return data; } @@ -1180,38 +1134,36 @@ void Image::create(int p_width, int p_height, bool p_use_mipmaps,Format p_format int size = _get_dst_image_size(p_width,p_height,p_format,mm,p_use_mipmaps?-1:0); data.resize( size ); { - DVector<uint8_t>::Write w= data.write(); + PoolVector<uint8_t>::Write w= data.write(); zeromem(w.ptr(),size); } width=p_width; height=p_height; - mipmaps=mm; + mipmaps=p_use_mipmaps; format=p_format; } -void Image::create(int p_width, int p_height, int p_mipmaps, Format p_format, const DVector<uint8_t>& p_data) { +void Image::create(int p_width, int p_height, bool p_use_mipmaps, Format p_format, const PoolVector<uint8_t>& p_data) { ERR_FAIL_INDEX(p_width-1,MAX_WIDTH); ERR_FAIL_INDEX(p_height-1,MAX_HEIGHT); - if (p_format < FORMAT_CUSTOM) { - int mm; - int size = _get_dst_image_size(p_width,p_height,p_format,mm,p_mipmaps); + int mm; + int size = _get_dst_image_size(p_width,p_height,p_format,mm,p_use_mipmaps); - if (size!=p_data.size()) { - ERR_EXPLAIN("Expected data size of "+itos(size)+" in Image::create()"); - ERR_FAIL_COND(p_data.size()!=size); - } - }; + if (size!=p_data.size()) { + ERR_EXPLAIN("Expected data size of "+itos(size)+" in Image::create()"); + ERR_FAIL_COND(p_data.size()!=size); + } height=p_height; width=p_width; format=p_format; data=p_data; - mipmaps=p_mipmaps; + mipmaps=p_use_mipmaps; } @@ -1220,7 +1172,7 @@ void Image::create( const char ** p_xpm ) { int size_width,size_height; int pixelchars=0; - mipmaps=0; + mipmaps=false; bool has_alpha=false; enum Status { @@ -1235,6 +1187,8 @@ void Image::create( const char ** p_xpm ) { HashMap<String,Color> colormap; int colormap_size; + uint32_t pixel_size; + PoolVector<uint8_t>::Write w; while (status!=DONE) { @@ -1327,7 +1281,9 @@ void Image::create( const char ** p_xpm ) { if (line==colormap_size) { status=READING_PIXELS; - create(size_width,size_height,0,has_alpha?FORMAT_RGBA:FORMAT_RGB); + create(size_width,size_height,0,has_alpha?FORMAT_RGBA8:FORMAT_RGB8); + w=data.write(); + pixel_size=has_alpha?4:3; } } break; case READING_PIXELS: { @@ -1341,7 +1297,11 @@ void Image::create( const char ** p_xpm ) { Color *colorptr = colormap.getptr(pixelstr); ERR_FAIL_COND(!colorptr); - put_pixel(x,y,*colorptr); + uint8_t pixel[4]; + for(uint32_t i=0;i<pixel_size;i++) { + pixel[i]=CLAMP((*colorptr)[i]*255,0,255); + } + _put_pixelb(x,y,pixel_size,w.ptr(),pixel); } @@ -1382,9 +1342,8 @@ void Image::create( const char ** p_xpm ) { bool Image::is_invisible() const { - if (format==FORMAT_GRAYSCALE || - format==FORMAT_RGB || - format==FORMAT_INDEXED) + if (format==FORMAT_L8 || + format==FORMAT_RGB8 || format==FORMAT_RG8) return false; int len = data.size(); @@ -1392,25 +1351,18 @@ bool Image::is_invisible() const { if (len==0) return true; - if (format >= FORMAT_YUV_422 && format <= FORMAT_YUV_444) - return false; int w,h; _get_mipmap_offset_and_size(1,len,w,h); - DVector<uint8_t>::Read r = data.read(); + PoolVector<uint8_t>::Read r = data.read(); const unsigned char *data_ptr=r.ptr(); bool detected=false; switch(format) { - case FORMAT_INTENSITY: { - for(int i=0;i<len;i++) { - DETECT_NON_ALPHA(data_ptr[i]); - } - } break; - case FORMAT_GRAYSCALE_ALPHA: { + case FORMAT_LA8: { for(int i=0;i<(len>>1);i++) { @@ -1418,25 +1370,18 @@ bool Image::is_invisible() const { } } break; - case FORMAT_RGBA: { + case FORMAT_RGBA8: { for(int i=0;i<(len>>2);i++) { DETECT_NON_ALPHA(data_ptr[(i<<2)+3]) } } break; - case FORMAT_INDEXED: { - return false; - } break; - case FORMAT_INDEXED_ALPHA: { - - return false; - } break; - case FORMAT_PVRTC2_ALPHA: - case FORMAT_PVRTC4_ALPHA: - case FORMAT_BC2: - case FORMAT_BC3: { + case FORMAT_PVRTC2A: + case FORMAT_PVRTC4A: + case FORMAT_DXT3: + case FORMAT_DXT5: { detected=true; } break; default: {} @@ -1447,36 +1392,24 @@ bool Image::is_invisible() const { Image::AlphaMode Image::detect_alpha() const { - if (format==FORMAT_GRAYSCALE || - format==FORMAT_RGB || - format==FORMAT_INDEXED) - return ALPHA_NONE; int len = data.size(); if (len==0) return ALPHA_NONE; - if (format >= FORMAT_YUV_422 && format <= FORMAT_YUV_444) - return ALPHA_NONE; - int w,h; _get_mipmap_offset_and_size(1,len,w,h); - DVector<uint8_t>::Read r = data.read(); + PoolVector<uint8_t>::Read r = data.read(); const unsigned char *data_ptr=r.ptr(); bool bit=false; bool detected=false; switch(format) { - case FORMAT_INTENSITY: { - for(int i=0;i<len;i++) { - DETECT_ALPHA(data_ptr[i]); - } - } break; - case FORMAT_GRAYSCALE_ALPHA: { + case FORMAT_LA8: { for(int i=0;i<(len>>1);i++) { @@ -1484,25 +1417,17 @@ Image::AlphaMode Image::detect_alpha() const { } } break; - case FORMAT_RGBA: { + case FORMAT_RGBA8: { for(int i=0;i<(len>>2);i++) { DETECT_ALPHA(data_ptr[(i<<2)+3]) } - } break; - case FORMAT_INDEXED: { - - return ALPHA_NONE; - } break; - case FORMAT_INDEXED_ALPHA: { - - return ALPHA_BLEND; - } break; - case FORMAT_PVRTC2_ALPHA: - case FORMAT_PVRTC4_ALPHA: - case FORMAT_BC2: - case FORMAT_BC3: { + } break; + case FORMAT_PVRTC2A: + case FORMAT_PVRTC4A: + case FORMAT_DXT3: + case FORMAT_DXT5: { detected=true; } break; default: {} @@ -1528,97 +1453,20 @@ Error Image::save_png(const String& p_path) { return ERR_UNAVAILABLE; return save_png_func(p_path, *this); -}; +} bool Image::operator==(const Image& p_image) const { if (data.size() == 0 && p_image.data.size() == 0) return true; - DVector<uint8_t>::Read r = data.read(); - DVector<uint8_t>::Read pr = p_image.data.read(); + PoolVector<uint8_t>::Read r = data.read(); + PoolVector<uint8_t>::Read pr = p_image.data.read(); return r.ptr() == pr.ptr(); } -int Image::get_format_pixel_size(Format p_format) { - - switch(p_format) { - case FORMAT_GRAYSCALE: { - - return 1; - } break; - case FORMAT_INTENSITY: { - - return 1; - } break; - case FORMAT_GRAYSCALE_ALPHA: { - return 2; - } break; - case FORMAT_RGB: { - - return 3; - } break; - case FORMAT_RGBA: { - - return 4; - } break; - case FORMAT_INDEXED: { - - return 1; - } break; - case FORMAT_INDEXED_ALPHA: { - - return 1; - } break; - case FORMAT_BC1: - case FORMAT_BC2: - case FORMAT_BC3: - case FORMAT_BC4: - case FORMAT_BC5: { - - return 1; - } break; - case FORMAT_PVRTC2: - case FORMAT_PVRTC2_ALPHA: { - - return 1; - } break; - case FORMAT_PVRTC4: - case FORMAT_PVRTC4_ALPHA: { - - return 1; - } break; - case FORMAT_ATC: - case FORMAT_ATC_ALPHA_EXPLICIT: - case FORMAT_ATC_ALPHA_INTERPOLATED: { - - return 1; - } break; - case FORMAT_ETC: { - - return 1; - } break; - case FORMAT_YUV_422: { - return 2; - }; - case FORMAT_YUV_444: { - return 3; - } break; - case FORMAT_CUSTOM: { - - ERR_EXPLAIN("pixel size requested for custom image format, and it's unknown obviously"); - ERR_FAIL_V(1); - } break; - default:{ - ERR_EXPLAIN("Cannot obtain pixel size from this format"); - ERR_FAIL_V(1); - - } - } - return 0; -} int Image::get_image_data_size(int p_width, int p_height, Format p_format,int p_mipmaps) { @@ -1635,105 +1483,12 @@ int Image::get_image_required_mipmaps(int p_width, int p_height, Format p_format } -void Image::_get_format_min_data_size(Format p_format,int &r_w, int &r_h) { - - - switch(p_format) { - case FORMAT_BC1: - case FORMAT_BC2: - case FORMAT_BC3: - case FORMAT_BC4: - case FORMAT_BC5: { - r_w=4; - r_h=4; - } break; - case FORMAT_PVRTC2: - case FORMAT_PVRTC2_ALPHA: { - - r_w=16; - r_h=8; - } break; - case FORMAT_PVRTC4_ALPHA: - case FORMAT_PVRTC4: { - - r_w=8; - r_h=8; - } break; - case FORMAT_ATC: - case FORMAT_ATC_ALPHA_EXPLICIT: - case FORMAT_ATC_ALPHA_INTERPOLATED: { - - r_w=8; - r_h=8; - - } break; - - case FORMAT_ETC: { - - r_w=4; - r_h=4; - } break; - default: { - r_w=1; - r_h=1; - } break; - } - -} - - -int Image::get_format_pixel_rshift(Format p_format) { - - if (p_format==FORMAT_BC1 || p_format==FORMAT_BC4 || p_format==FORMAT_ATC || p_format==FORMAT_PVRTC4 || p_format==FORMAT_PVRTC4_ALPHA || p_format==FORMAT_ETC) - return 1; - else if (p_format==FORMAT_PVRTC2 || p_format==FORMAT_PVRTC2_ALPHA) - return 2; - else - return 0; -} - -int Image::get_format_pallete_size(Format p_format) { - - switch(p_format) { - case FORMAT_GRAYSCALE: { - - return 0; - } break; - case FORMAT_INTENSITY: { - - return 0; - } break; - case FORMAT_GRAYSCALE_ALPHA: { - - return 0; - } break; - case FORMAT_RGB: { - - return 0; - } break; - case FORMAT_RGBA: { - - return 0; - } break; - case FORMAT_INDEXED: { - - return 3*256; - } break; - case FORMAT_INDEXED_ALPHA: { - - return 4*256; - } break; - default:{} - } - return 0; -} Error Image::_decompress_bc() { - print_line("decompressing bc"); int wd=width,ht=height; if (wd%4!=0) { @@ -1745,13 +1500,13 @@ Error Image::_decompress_bc() { int mm; - int size = _get_dst_image_size(wd,ht,FORMAT_RGBA,mm,mipmaps); + int size = _get_dst_image_size(wd,ht,FORMAT_RGBA8,mm); - DVector<uint8_t> newdata; + PoolVector<uint8_t> newdata; newdata.resize(size); - DVector<uint8_t>::Write w = newdata.write(); - DVector<uint8_t>::Read r = data.read(); + PoolVector<uint8_t>::Write w = newdata.write(); + PoolVector<uint8_t>::Read r = data.read(); int rofs=0; int wofs=0; @@ -1762,7 +1517,7 @@ Error Image::_decompress_bc() { switch(format) { - case FORMAT_BC1: { + case FORMAT_DXT1: { int len = (wd*ht)/16; uint8_t* dst=&w[wofs]; @@ -1788,8 +1543,8 @@ Error Image::_decompress_bc() { col_b|=src[2]; uint8_t table[4][4]={ - { (col_a>>11)<<3, ((col_a>>5)&0x3f)<<2, ((col_a)&0x1f)<<3, 255 }, - { (col_b>>11)<<3, ((col_b>>5)&0x3f)<<2, ((col_b)&0x1f)<<3, 255 }, + { uint8_t((col_a>>11)<<3), uint8_t(((col_a>>5)&0x3f)<<2),uint8_t(((col_a)&0x1f)<<3), 255 }, + { uint8_t((col_b>>11)<<3), uint8_t(((col_b>>5)&0x3f)<<2),uint8_t(((col_b)&0x1f)<<3), 255 }, {0,0,0,255}, {0,0,0,255} }; @@ -1841,7 +1596,7 @@ Error Image::_decompress_bc() { ht/=2; } break; - case FORMAT_BC2: { + case FORMAT_DXT3: { int len = (wd*ht)/16; uint8_t* dst=&w[wofs]; @@ -1885,8 +1640,9 @@ Error Image::_decompress_bc() { col_b|=src[8+2]; uint8_t table[4][4]={ - { (col_a>>11)<<3, ((col_a>>5)&0x3f)<<2, ((col_a)&0x1f)<<3, 255 }, - { (col_b>>11)<<3, ((col_b>>5)&0x3f)<<2, ((col_b)&0x1f)<<3, 255 }, + { uint8_t((col_a>>11)<<3), uint8_t(((col_a>>5)&0x3f)<<2),uint8_t(((col_a)&0x1f)<<3), 255 }, + { uint8_t((col_b>>11)<<3), uint8_t(((col_b>>5)&0x3f)<<2),uint8_t(((col_b)&0x1f)<<3), 255 }, + {0,0,0,255}, {0,0,0,255} }; @@ -1933,7 +1689,7 @@ Error Image::_decompress_bc() { ht/=2; } break; - case FORMAT_BC3: { + case FORMAT_DXT5: { int len = (wd*ht)/16; uint8_t* dst=&w[wofs]; @@ -2001,9 +1757,10 @@ Error Image::_decompress_bc() { col_b<<=8; col_b|=src[8+2]; - uint8_t table[4][4]={ - { (col_a>>11)<<3, ((col_a>>5)&0x3f)<<2, ((col_a)&0x1f)<<3, 255 }, - { (col_b>>11)<<3, ((col_b>>5)&0x3f)<<2, ((col_b)&0x1f)<<3, 255 }, + uint8_t table[4][4]={ + { uint8_t((col_a>>11)<<3), uint8_t(((col_a>>5)&0x3f)<<2),uint8_t(((col_a)&0x1f)<<3), 255 }, + { uint8_t((col_b>>11)<<3), uint8_t(((col_b>>5)&0x3f)<<2),uint8_t(((col_b)&0x1f)<<3), 255 }, + {0,0,0,255}, {0,0,0,255} }; @@ -2057,22 +1814,23 @@ Error Image::_decompress_bc() { } - w=DVector<uint8_t>::Write(); - r=DVector<uint8_t>::Read(); + w=PoolVector<uint8_t>::Write(); + r=PoolVector<uint8_t>::Read(); data=newdata; - format=FORMAT_RGBA; + format=FORMAT_RGBA8; if (wd!=width || ht!=height) { - //todo, crop - width=wd; - height=ht; + + SWAP(width,wd); + SWAP(height,ht); + crop(wd,ht); } return OK; } bool Image::is_compressed() const { - return format>=FORMAT_BC1; + return format>=FORMAT_RGB565; } @@ -2085,12 +1843,14 @@ Image Image::decompressed() const { Error Image::decompress() { - if (format>=FORMAT_BC1 && format<=FORMAT_BC5 ) + if (format>=FORMAT_DXT1 && format<=FORMAT_ATI2 ) _decompress_bc();//_image_decompress_bc(this); - else if (format>=FORMAT_PVRTC2 && format<=FORMAT_PVRTC4_ALPHA && _image_decompress_pvrtc) + else if (format>=FORMAT_PVRTC2 && format<=FORMAT_PVRTC4A&& _image_decompress_pvrtc) _image_decompress_pvrtc(this); else if (format==FORMAT_ETC && _image_decompress_etc) _image_decompress_etc(this); + else if (format>=FORMAT_ETC2_R11 && format<=FORMAT_ETC2_RGB8A1 && _image_decompress_etc) + _image_decompress_etc2(this); else return ERR_UNAVAILABLE; return OK; @@ -2101,7 +1861,12 @@ Error Image::compress(CompressMode p_mode) { switch(p_mode) { - case COMPRESS_BC: { + case COMPRESS_16BIT: { + + //ERR_FAIL_COND_V(!_image_compress_bc_func, ERR_UNAVAILABLE); + //_image_compress_bc_func(this); + } break; + case COMPRESS_S3TC: { ERR_FAIL_COND_V(!_image_compress_bc_func, ERR_UNAVAILABLE); _image_compress_bc_func(this); @@ -2121,6 +1886,11 @@ Error Image::compress(CompressMode p_mode) { ERR_FAIL_COND_V(!_image_compress_etc_func, ERR_UNAVAILABLE); _image_compress_etc_func(this); } break; + case COMPRESS_ETC2: { + + ERR_FAIL_COND_V(!_image_compress_etc_func, ERR_UNAVAILABLE); + _image_compress_etc_func(this); + } break; } @@ -2133,14 +1903,14 @@ Image Image::compressed(int p_mode) { ret.compress((Image::CompressMode)p_mode); return ret; -}; +} Image::Image(const char **p_xpm) { width=0; height=0; - mipmaps=0; - format=FORMAT_GRAYSCALE; + mipmaps=false; + format=FORMAT_L8; create(p_xpm); } @@ -2150,37 +1920,28 @@ Image::Image(int p_width, int p_height,bool p_use_mipmaps, Format p_format) { width=0; height=0; - mipmaps=0; - format=FORMAT_GRAYSCALE; + mipmaps=p_use_mipmaps; + format=FORMAT_L8; create(p_width,p_height,p_use_mipmaps,p_format); } -Image::Image(int p_width, int p_height, int p_mipmaps, Format p_format, const DVector<uint8_t>& p_data) { +Image::Image(int p_width, int p_height, bool p_mipmaps, Format p_format, const PoolVector<uint8_t>& p_data) { width=0; height=0; - mipmaps=0; - format=FORMAT_GRAYSCALE; + mipmaps=p_mipmaps; + format=FORMAT_L8; create(p_width,p_height,p_mipmaps,p_format,p_data); } -Image Image::brushed(const Image& p_src, const Image& p_brush, const Point2& p_dest) const { - - Image img = *this; - img.brush_transfer(p_src,p_brush,p_dest); - return img; -} - Rect2 Image::get_used_rect() const { - if (format==FORMAT_GRAYSCALE || - format==FORMAT_RGB || - format==FORMAT_INDEXED || format>FORMAT_INDEXED_ALPHA) + if (format!=FORMAT_LA8 && format!=FORMAT_RGBA8) return Rect2(Point2(),Size2(width,height)); int len = data.size(); @@ -2188,16 +1949,18 @@ Rect2 Image::get_used_rect() const { if (len==0) return Rect2(); - int data_size = len; - DVector<uint8_t>::Read r = data.read(); + //int data_size = len; + PoolVector<uint8_t>::Read r = data.read(); const unsigned char *rptr=r.ptr(); + int ps = format==FORMAT_LA8?2:4; int minx=0xFFFFFF,miny=0xFFFFFFF; int maxx=-1,maxy=-1; - for(int i=0;i<width;i++) { - for(int j=0;j<height;j++) { + for(int j=0;j<height;j++) { + for(int i=0;i<width;i++) { + - bool opaque = _get_pixel(i,j,rptr,data_size).a>2; + bool opaque = rptr[(j*width+i)*ps+(ps-1)]>2; if (!opaque) continue; if (i>maxx) @@ -2225,101 +1988,47 @@ Image Image::get_rect(const Rect2& p_area) const { img.blit_rect(*this, p_area, Point2(0, 0)); return img; -}; - -void Image::brush_transfer(const Image& p_src, const Image& p_brush, const Point2& p_dest) { - - - ERR_FAIL_COND( width != p_src.width || height !=p_src.height); - - int dst_data_size = data.size(); - DVector<uint8_t>::Write wp = data.write(); - unsigned char *dst_data_ptr=wp.ptr(); - - - int src_data_size = p_src.data.size(); - DVector<uint8_t>::Read rp = p_src.data.read(); - const unsigned char *src_data_ptr=rp.ptr(); - - int brush_data_size = p_brush.data.size(); - DVector<uint8_t>::Read bp = p_brush.data.read(); - const unsigned char *src_brush_ptr=bp.ptr(); - - int bw = p_brush.get_width(); - int bh = p_brush.get_height(); - int dx=p_dest.x; - int dy=p_dest.y; - - for(int i=dy;i<dy+bh;i++) { - - if (i<0 || i >= height) - continue; - for(int j=dx;j<dx+bw;j++) { - - if (j<0 || j>=width) - continue; - - BColor src = p_src._get_pixel(j,i,src_data_ptr,src_data_size); - BColor dst = _get_pixel(j,i,dst_data_ptr,dst_data_size); - BColor brush = p_brush._get_pixel(j-dx,i-dy,src_brush_ptr,brush_data_size); - uint32_t mult = brush.r; - dst.r = dst.r + (((int32_t(src.r)-int32_t(dst.r))*mult)>>8); - dst.g = dst.g + (((int32_t(src.g)-int32_t(dst.g))*mult)>>8); - dst.b = dst.b + (((int32_t(src.b)-int32_t(dst.b))*mult)>>8); - dst.a = dst.a + (((int32_t(src.a)-int32_t(dst.a))*mult)>>8); - _put_pixel(j,i,dst,dst_data_ptr); - } - } } - void Image::blit_rect(const Image& p_src, const Rect2& p_src_rect,const Point2& p_dest) { int dsize=data.size(); int srcdsize=p_src.data.size(); ERR_FAIL_COND( dsize==0 ); ERR_FAIL_COND( srcdsize==0 ); + ERR_FAIL_COND( format!=p_src.format ); + Rect2i local_src_rect = Rect2i(0,0,width,height).clip( Rect2i(p_dest+p_src_rect.pos,p_src_rect.size) ); - Rect2 rrect = Rect2(0,0,p_src.width,p_src.height).clip(p_src_rect); + if (local_src_rect.size.x<=0 || local_src_rect.size.y<=0) + return; + Rect2i src_rect( p_src_rect.pos + ( local_src_rect.pos - p_dest), local_src_rect.size ); - DVector<uint8_t>::Write wp = data.write(); - unsigned char *dst_data_ptr=wp.ptr(); + PoolVector<uint8_t>::Write wp = data.write(); + uint8_t *dst_data_ptr=wp.ptr(); - DVector<uint8_t>::Read rp = p_src.data.read(); - const unsigned char *src_data_ptr=rp.ptr(); + PoolVector<uint8_t>::Read rp = p_src.data.read(); + const uint8_t *src_data_ptr=rp.ptr(); - if ((format==FORMAT_INDEXED || format == FORMAT_INDEXED_ALPHA) && (p_src.format==FORMAT_INDEXED || p_src.format == FORMAT_INDEXED_ALPHA)) { + int pixel_size=get_format_pixel_size(format); - Point2i desti(p_dest.x, p_dest.y); - Point2i srci(rrect.pos.x, rrect.pos.y); + for(int i=0;i<src_rect.size.y;i++) { - for(int i=0;i<rrect.size.y;i++) { - if (i<0 || i >= height) - continue; - for(int j=0;j<rrect.size.x;j++) { + for(int j=0;j<src_rect.size.x;j++) { - if (j<0 || j>=width) - continue; + int src_x = src_rect.pos.x+j; + int src_y = src_rect.pos.y+i; - dst_data_ptr[width * (desti.y + i) + desti.x + j] = src_data_ptr[p_src.width * (srci.y+i) + srci.x+j]; - } - } + int dst_x = local_src_rect.pos.x+j; + int dst_y = local_src_rect.pos.y+i; - } else { - - for(int i=0;i<rrect.size.y;i++) { - - if (i<0 || i >= height) - continue; - for(int j=0;j<rrect.size.x;j++) { - - if (j<0 || j>=width) - continue; + const uint8_t *src = &src_data_ptr[ (src_y*p_src.width+src_x)*pixel_size]; + uint8_t *dst = &dst_data_ptr[ (dst_y*width+dst_x)*pixel_size]; - _put_pixel(p_dest.x+j,p_dest.y+i,p_src._get_pixel(rrect.pos.x+j,rrect.pos.y+i,src_data_ptr,srcdsize),dst_data_ptr); + for(int k=0;k<pixel_size;k++) { + dst[k]=src[k]; } } } @@ -2334,14 +2043,16 @@ void (*Image::_image_compress_bc_func)(Image *)=NULL; void (*Image::_image_compress_pvrtc2_func)(Image *)=NULL; void (*Image::_image_compress_pvrtc4_func)(Image *)=NULL; void (*Image::_image_compress_etc_func)(Image *)=NULL; +void (*Image::_image_compress_etc2_func)(Image *)=NULL; void (*Image::_image_decompress_pvrtc)(Image *)=NULL; void (*Image::_image_decompress_bc)(Image *)=NULL; void (*Image::_image_decompress_etc)(Image *)=NULL; +void (*Image::_image_decompress_etc2)(Image *)=NULL; -DVector<uint8_t> (*Image::lossy_packer)(const Image& ,float )=NULL; -Image (*Image::lossy_unpacker)(const DVector<uint8_t>& )=NULL; -DVector<uint8_t> (*Image::lossless_packer)(const Image& )=NULL; -Image (*Image::lossless_unpacker)(const DVector<uint8_t>& )=NULL; +PoolVector<uint8_t> (*Image::lossy_packer)(const Image& ,float )=NULL; +Image (*Image::lossy_unpacker)(const PoolVector<uint8_t>& )=NULL; +PoolVector<uint8_t> (*Image::lossless_packer)(const Image& )=NULL; +Image (*Image::lossless_unpacker)(const PoolVector<uint8_t>& )=NULL; void Image::set_compress_bc_func(void (*p_compress_func)(Image *)) { @@ -2352,11 +2063,11 @@ void Image::set_compress_bc_func(void (*p_compress_func)(Image *)) { void Image::normalmap_to_xy() { - convert(Image::FORMAT_RGBA); + convert(Image::FORMAT_RGBA8); { int len = data.size()/4; - DVector<uint8_t>::Write wp = data.write(); + PoolVector<uint8_t>::Write wp = data.write(); unsigned char *data_ptr=wp.ptr(); for(int i=0;i<len;i++) { @@ -2367,7 +2078,7 @@ void Image::normalmap_to_xy() { } } - convert(Image::FORMAT_GRAYSCALE_ALPHA); + convert(Image::FORMAT_LA8); } void Image::srgb_to_linear() { @@ -2378,12 +2089,12 @@ void Image::srgb_to_linear() { static const uint8_t srgb2lin[256]={0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 22, 22, 23, 23, 24, 24, 25, 26, 26, 27, 27, 28, 29, 29, 30, 31, 31, 32, 33, 33, 34, 35, 36, 36, 37, 38, 38, 39, 40, 41, 42, 42, 43, 44, 45, 46, 47, 47, 48, 49, 50, 51, 52, 53, 54, 55, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 70, 71, 72, 73, 74, 75, 76, 77, 78, 80, 81, 82, 83, 84, 85, 87, 88, 89, 90, 92, 93, 94, 95, 97, 98, 99, 101, 102, 103, 105, 106, 107, 109, 110, 112, 113, 114, 116, 117, 119, 120, 122, 123, 125, 126, 128, 129, 131, 132, 134, 135, 137, 139, 140, 142, 144, 145, 147, 148, 150, 152, 153, 155, 157, 159, 160, 162, 164, 166, 167, 169, 171, 173, 175, 176, 178, 180, 182, 184, 186, 188, 190, 192, 193, 195, 197, 199, 201, 203, 205, 207, 209, 211, 213, 215, 218, 220, 222, 224, 226, 228, 230, 232, 235, 237, 239, 241, 243, 245, 248, 250, 252}; - ERR_FAIL_COND( format!=FORMAT_RGB && format!=FORMAT_RGBA ); + ERR_FAIL_COND( format!=FORMAT_RGB8 && format!=FORMAT_RGBA8 ); - if (format==FORMAT_RGBA) { + if (format==FORMAT_RGBA8) { int len = data.size()/4; - DVector<uint8_t>::Write wp = data.write(); + PoolVector<uint8_t>::Write wp = data.write(); unsigned char *data_ptr=wp.ptr(); for(int i=0;i<len;i++) { @@ -2393,10 +2104,10 @@ void Image::srgb_to_linear() { data_ptr[(i<<2)+2]=srgb2lin[ data_ptr[(i<<2)+2] ]; } - } else if (format==FORMAT_RGB) { + } else if (format==FORMAT_RGB8) { int len = data.size()/3; - DVector<uint8_t>::Write wp = data.write(); + PoolVector<uint8_t>::Write wp = data.write(); unsigned char *data_ptr=wp.ptr(); for(int i=0;i<len;i++) { @@ -2414,21 +2125,21 @@ void Image::premultiply_alpha() { if (data.size()==0) return; - if (format!=FORMAT_RGBA) + if (format!=FORMAT_RGBA8) return; //not needed - DVector<uint8_t>::Write wp = data.write(); + PoolVector<uint8_t>::Write wp = data.write(); unsigned char *data_ptr=wp.ptr(); for(int i=0;i<height;i++) { for(int j=0;j<width;j++) { - BColor bc = _get_pixel(j,i,data_ptr,0); - bc.r=(int(bc.r)*int(bc.a))>>8; - bc.g=(int(bc.g)*int(bc.a))>>8; - bc.b=(int(bc.b)*int(bc.a))>>8; - _put_pixel(j,i,bc,data_ptr); + uint8_t *ptr = &data_ptr[(i*width+j)*4]; + + ptr[0]=(uint16_t(ptr[0])*uint16_t(ptr[3]))>>8; + ptr[1]=(uint16_t(ptr[1])*uint16_t(ptr[3]))>>8; + ptr[2]=(uint16_t(ptr[2])*uint16_t(ptr[3]))>>8; } } } @@ -2438,14 +2149,14 @@ void Image::fix_alpha_edges() { if (data.size()==0) return; - if (format!=FORMAT_RGBA) + if (format!=FORMAT_RGBA8) return; //not needed - DVector<uint8_t> dcopy = data; - DVector<uint8_t>::Read rp = data.read(); - const uint8_t *rptr=rp.ptr(); + PoolVector<uint8_t> dcopy = data; + PoolVector<uint8_t>::Read rp = data.read(); + const uint8_t *srcptr=rp.ptr(); - DVector<uint8_t>::Write wp = data.write(); + PoolVector<uint8_t>::Write wp = data.write(); unsigned char *data_ptr=wp.ptr(); const int max_radius=4; @@ -2455,13 +2166,16 @@ void Image::fix_alpha_edges() { for(int i=0;i<height;i++) { for(int j=0;j<width;j++) { - BColor bc = _get_pixel(j,i,rptr,0); - if (bc.a>=alpha_treshold) + const uint8_t *rptr = &srcptr[(i*width+j)*4]; + uint8_t *wptr = &data_ptr[(i*width+j)*4]; + + if (rptr[3]>=alpha_treshold) continue; int closest_dist=max_dist; - BColor closest_color; - closest_color.a=bc.a; + uint8_t closest_color[3]; + + int from_x = MAX(0,j-max_radius); int to_x = MIN(width-1,j+max_radius); int from_y = MAX(0,i-max_radius); @@ -2476,22 +2190,25 @@ void Image::fix_alpha_edges() { if (dist>=closest_dist) continue; - const uint8_t * rp = &rptr[(k*width+l)<<2]; + const uint8_t * rp = &srcptr[(k*width+l)<<2]; if (rp[3]<alpha_treshold) continue; - closest_dist=dist; - closest_color.r=rp[0]; - closest_color.g=rp[1]; - closest_color.b=rp[2]; + closest_color[0]=rp[0]; + closest_color[1]=rp[1]; + closest_color[2]=rp[2]; } } - if (closest_dist!=max_dist) - _put_pixel(j,i,closest_color,data_ptr); + if (closest_dist!=max_dist) { + + wptr[0]=closest_color[0]; + wptr[1]=closest_color[1]; + wptr[2]=closest_color[2]; + } } } @@ -2508,8 +2225,8 @@ Image::Image(const uint8_t* p_mem_png_jpg, int p_len) { width=0; height=0; - mipmaps=0; - format=FORMAT_GRAYSCALE; + mipmaps=false; + format=FORMAT_L8; if (_png_mem_loader_func) { *this = _png_mem_loader_func(p_mem_png_jpg,p_len); @@ -2525,8 +2242,8 @@ Image::Image() { width=0; height=0; - mipmaps=0; - format = FORMAT_GRAYSCALE; + mipmaps=false; + format = FORMAT_L8; } Image::~Image() { diff --git a/core/image.h b/core/image.h index 0f0b345eb9..620160147b 100644 --- a/core/image.h +++ b/core/image.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -55,35 +55,44 @@ public: static SavePNGFunc save_png_func; enum Format { - FORMAT_GRAYSCALE, ///< one byte per pixel, 0-255 - FORMAT_INTENSITY, ///< one byte per pixel, 0-255 - FORMAT_GRAYSCALE_ALPHA, ///< two bytes per pixel, 0-255. alpha 0-255 - FORMAT_RGB, ///< one byte R, one byte G, one byte B - FORMAT_RGBA, ///< one byte R, one byte G, one byte B, one byte A - FORMAT_INDEXED, ///< index byte 0-256, and after image end, 256*3 bytes of palette - FORMAT_INDEXED_ALPHA, ///< index byte 0-256, and after image end, 256*4 bytes of palette (alpha) - FORMAT_YUV_422, - FORMAT_YUV_444, - FORMAT_BC1, // DXT1 - FORMAT_BC2, // DXT3 - FORMAT_BC3, // DXT5 - FORMAT_BC4, // ATI1 - FORMAT_BC5, // ATI2 - FORMAT_PVRTC2, - FORMAT_PVRTC2_ALPHA, - FORMAT_PVRTC4, - FORMAT_PVRTC4_ALPHA, - FORMAT_ETC, // regular ETC, no transparency - FORMAT_ATC, - FORMAT_ATC_ALPHA_EXPLICIT, - FORMAT_ATC_ALPHA_INTERPOLATED, - /*FORMAT_ETC2_R, for the future.. - FORMAT_ETC2_RG, - FORMAT_ETC2_RGB, - FORMAT_ETC2_RGBA1, - FORMAT_ETC2_RGBA,*/ - FORMAT_CUSTOM, + FORMAT_L8, //luminance + FORMAT_LA8, //luminance-alpha + FORMAT_R8, + FORMAT_RG8, + FORMAT_RGB8, + FORMAT_RGBA8, + FORMAT_RGB565, //16 bit + FORMAT_RGBA4444, + FORMAT_RGBA5551, + FORMAT_RF, //float + FORMAT_RGF, + FORMAT_RGBF, + FORMAT_RGBAF, + FORMAT_RH, //half float + FORMAT_RGH, + FORMAT_RGBH, + FORMAT_RGBAH, + FORMAT_DXT1, //s3tc bc1 + FORMAT_DXT3, //bc2 + FORMAT_DXT5, //bc3 + FORMAT_ATI1, //bc4 + FORMAT_ATI2, //bc5 + FORMAT_BPTC_RGBA, //btpc bc6h + FORMAT_BPTC_RGBF, //float / + FORMAT_BPTC_RGBFU, //unsigned float + FORMAT_PVRTC2, //pvrtc + FORMAT_PVRTC2A, + FORMAT_PVRTC4, + FORMAT_PVRTC4A, + FORMAT_ETC, //etc1 + FORMAT_ETC2_R11, //etc2 + FORMAT_ETC2_R11S, //signed, NOT srgb. + FORMAT_ETC2_RG11, + FORMAT_ETC2_RG11S, + FORMAT_ETC2_RGB8, + FORMAT_ETC2_RGBA8, + FORMAT_ETC2_RGB8A1, FORMAT_MAX }; @@ -96,110 +105,43 @@ public: /* INTERPOLATE GAUSS */ }; + //some functions provided by something else + static Image (*_png_mem_loader_func)(const uint8_t* p_png,int p_size); static Image (*_jpg_mem_loader_func)(const uint8_t* p_png,int p_size); + static void (*_image_compress_bc_func)(Image *); static void (*_image_compress_pvrtc2_func)(Image *); static void (*_image_compress_pvrtc4_func)(Image *); static void (*_image_compress_etc_func)(Image *); + static void (*_image_compress_etc2_func)(Image *); + static void (*_image_decompress_pvrtc)(Image *); static void (*_image_decompress_bc)(Image *); static void (*_image_decompress_etc)(Image *); + static void (*_image_decompress_etc2)(Image *); Error _decompress_bc(); - static DVector<uint8_t> (*lossy_packer)(const Image& p_image,float p_quality); - static Image (*lossy_unpacker)(const DVector<uint8_t>& p_buffer); - static DVector<uint8_t> (*lossless_packer)(const Image& p_image); - static Image (*lossless_unpacker)(const DVector<uint8_t>& p_buffer); + static PoolVector<uint8_t> (*lossy_packer)(const Image& p_image,float p_quality); + static Image (*lossy_unpacker)(const PoolVector<uint8_t>& p_buffer); + static PoolVector<uint8_t> (*lossless_packer)(const Image& p_image); + static Image (*lossless_unpacker)(const PoolVector<uint8_t>& p_buffer); private: - //internal byte based color - struct BColor { - union { - uint8_t col[4]; - struct { - uint8_t r,g,b,a; - }; - }; - - bool operator==(const BColor& p_color) const { for(int i=0;i<4;i++) {if (col[i]!=p_color.col[i]) return false; } return true; } - _FORCE_INLINE_ uint8_t gray() const { return (uint16_t(col[0])+uint16_t(col[1])+uint16_t(col[2]))/3; } - _FORCE_INLINE_ BColor() {} - BColor(uint8_t p_r,uint8_t p_g,uint8_t p_b,uint8_t p_a=255) { col[0]=p_r; col[1]=p_g; col[2]=p_b; col[3]=p_a; } - }; - - //median cut classes - - struct BColorPos { - - uint32_t index; - BColor color; - struct SortR { - - bool operator()(const BColorPos& ca, const BColorPos& cb) const { return ca.color.r < cb.color.r; } - }; - - struct SortG { - - bool operator()(const BColorPos& ca, const BColorPos& cb) const { return ca.color.g < cb.color.g; } - }; - - struct SortB { - - bool operator()(const BColorPos& ca, const BColorPos& cb) const { return ca.color.b < cb.color.b; } - }; - - struct SortA { - - bool operator()(const BColorPos& ca, const BColorPos& cb) const { return ca.color.a < cb.color.a; } - }; - }; - - struct SPTree { - - bool leaf; - uint8_t split_plane; - uint8_t split_value; - union { - int left; - int color; - }; - int right; - SPTree() { leaf=true; left=-1; right=-1;} - }; - - struct MCBlock { - - BColorPos min_color,max_color; - BColorPos *colors; - int sp_idx; - int color_count; - int get_longest_axis_index() const; - int get_longest_axis_length() const; - bool operator<(const MCBlock& p_block) const; - void shrink(); - MCBlock(); - MCBlock(BColorPos *p_colors,int p_color_count); - }; - Format format; - DVector<uint8_t> data; - int width,height,mipmaps; - - + PoolVector<uint8_t> data; + int width,height; + bool mipmaps; - _FORCE_INLINE_ BColor _get_pixel(int p_x,int p_y,const unsigned char *p_data,int p_data_size) const; - _FORCE_INLINE_ BColor _get_pixelw(int p_x,int p_y,int p_width,const unsigned char *p_data,int p_data_size) const; - _FORCE_INLINE_ void _put_pixelw(int p_x,int p_y, int p_width, const BColor& p_color, unsigned char *p_data); - _FORCE_INLINE_ void _put_pixel(int p_x,int p_y, const BColor& p_color, unsigned char *p_data); _FORCE_INLINE_ void _get_mipmap_offset_and_size(int p_mipmap,int &r_offset, int &r_width, int &r_height) const; //get where the mipmap begins in data - _FORCE_INLINE_ static void _get_format_min_data_size(Format p_format,int &r_w, int &r_h); static int _get_dst_image_size(int p_width, int p_height, Format p_format,int &r_mipmaps,int p_mipmaps=-1); bool _can_modify(Format p_format) const; + _FORCE_INLINE_ void _put_pixelb(int p_x,int p_y, uint32_t p_pixelsize,uint8_t *p_dst,const uint8_t *p_src); + _FORCE_INLINE_ void _get_pixelb(int p_x,int p_y, uint32_t p_pixelsize,const uint8_t *p_src,uint8_t *p_dst); public: @@ -207,20 +149,11 @@ public: int get_width() const; ///< Get image width int get_height() const; ///< Get image height - int get_mipmaps() const; - - /** - * Get a pixel from the image. for grayscale or indexed formats, use Color::gray to obtain the actual - * value. - */ - Color get_pixel(int p_x,int p_y,int p_mipmap=0) const; - /** - * Set a pixel into the image. for grayscale or indexed formats, a suitable Color constructor. - */ - void put_pixel(int p_x,int p_y, const Color& p_color,int p_mipmap=0); /* alpha and index are averaged */ + bool has_mipmaps() const; + int get_mipmap_count() const; /** - * Convert the image to another format, as close as it can be done. + * Convert the image to another format, conversion only to raw byte format */ void convert( Format p_new_format ); @@ -259,25 +192,21 @@ public: void flip_x(); void flip_y(); + /** * Generate a mipmap to an image (creates an image 1/4 the size, with averaging of 4->1) */ - Error generate_mipmaps(int p_amount=-1,bool p_keep_existing=false); + Error generate_mipmaps(bool p_keep_existing=false); void clear_mipmaps(); - /** - * Generate a normal map from a grayscale image - */ - - void make_normalmap(float p_height_scale=1.0); /** * Create a new image of a given size and format. Current image will be lost */ void create(int p_width, int p_height, bool p_use_mipmaps, Format p_format); - void create(int p_width, int p_height, int p_mipmaps, Format p_format, const DVector<uint8_t>& p_data); + void create(int p_width, int p_height, bool p_use_mipmaps, Format p_format, const PoolVector<uint8_t>& p_data); void create( const char ** p_xpm ); /** @@ -285,7 +214,7 @@ public: */ bool empty() const; - DVector<uint8_t> get_data() const; + PoolVector<uint8_t> get_data() const; Error load(const String& p_path); Error save_png(const String& p_path); @@ -301,7 +230,7 @@ public: /** * import an image of a specific size and format from a pointer */ - Image(int p_width, int p_height, int p_mipmaps, Format p_format, const DVector<uint8_t>& p_data); + Image(int p_width, int p_height, bool p_mipmaps, Format p_format, const PoolVector<uint8_t>& p_data); enum AlphaMode { ALPHA_NONE, @@ -312,32 +241,27 @@ public: AlphaMode detect_alpha() const; bool is_invisible() const; - void put_indexed_pixel(int p_x, int p_y, uint8_t p_idx,int p_mipmap=0); - uint8_t get_indexed_pixel(int p_x, int p_y,int p_mipmap=0) const; - void set_pallete(const DVector<uint8_t>& p_data); - static int get_format_pixel_size(Format p_format); static int get_format_pixel_rshift(Format p_format); - static int get_format_pallete_size(Format p_format); + static void get_format_min_pixel_size(Format p_format,int &r_w, int &r_h); + static int get_image_data_size(int p_width, int p_height, Format p_format,int p_mipmaps=0); static int get_image_required_mipmaps(int p_width, int p_height, Format p_format); - - bool operator==(const Image& p_image) const; - void quantize(); - enum CompressMode { - COMPRESS_BC, + COMPRESS_16BIT, + COMPRESS_S3TC, COMPRESS_PVRTC2, COMPRESS_PVRTC4, - COMPRESS_ETC + COMPRESS_ETC, + COMPRESS_ETC2 }; - Error compress(CompressMode p_mode=COMPRESS_BC); + Error compress(CompressMode p_mode=COMPRESS_S3TC); Image compressed(int p_mode); /* from the Image::CompressMode enum */ Error decompress(); Image decompressed() const; @@ -349,8 +273,6 @@ public: void normalmap_to_xy(); void blit_rect(const Image& p_src, const Rect2& p_src_rect,const Point2& p_dest); - void brush_transfer(const Image& p_src, const Image& p_brush, const Point2& p_dest); - Image brushed(const Image& p_src, const Image& p_brush, const Point2& p_dest) const; Rect2 get_used_rect() const; Image get_rect(const Rect2& p_area) const; diff --git a/core/image_quantize.cpp b/core/image_quantize.cpp deleted file mode 100644 index f6fe7a88a0..0000000000 --- a/core/image_quantize.cpp +++ /dev/null @@ -1,365 +0,0 @@ -/*************************************************************************/ -/* image_quantize.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "image.h" -#include <stdio.h> -#include "print_string.h" -#ifdef TOOLS_ENABLED -#include "set.h" -#include "sort.h" -#include "os/os.h" - -//#define QUANTIZE_SPEED_OVER_QUALITY - - -Image::MCBlock::MCBlock() { - - -} - -Image::MCBlock::MCBlock(BColorPos *p_colors,int p_color_count) { - - colors=p_colors; - color_count=p_color_count; - min_color.color=BColor(255,255,255,255); - max_color.color=BColor(0,0,0,0); - shrink(); -} - -int Image::MCBlock::get_longest_axis_index() const { - - int max_dist=-1; - int max_index=0; - - for(int i=0;i<4;i++) { - - int d = max_color.color.col[i]-min_color.color.col[i]; - if (d>max_dist) { - max_index=i; - max_dist=d; - } - } - - return max_index; -} -int Image::MCBlock::get_longest_axis_length() const { - - int max_dist=-1; - - for(int i=0;i<4;i++) { - - int d = max_color.color.col[i]-min_color.color.col[i]; - if (d>max_dist) { - max_dist=d; - } - } - - return max_dist; -} - -bool Image::MCBlock::operator<(const MCBlock& p_block) const { - - int alen = get_longest_axis_length(); - int blen = p_block.get_longest_axis_length(); - if (alen==blen) { - - return colors < p_block.colors; - } else - return alen < blen; - -} - -void Image::MCBlock::shrink() { - - min_color=colors[0]; - max_color=colors[0]; - - for(int i=1;i<color_count;i++) { - - for(int j=0;j<4;j++) { - - min_color.color.col[j]=MIN(min_color.color.col[j],colors[i].color.col[j]); - max_color.color.col[j]=MAX(max_color.color.col[j],colors[i].color.col[j]); - } - } -} - - - - -void Image::quantize() { - - bool has_alpha = detect_alpha()!=ALPHA_NONE; - - bool quantize_fast=OS::get_singleton()->has_environment("QUANTIZE_FAST"); - - convert(FORMAT_RGBA); - - ERR_FAIL_COND( format!=FORMAT_RGBA ); - - DVector<uint8_t> indexed_data; - - - { - int color_count = data.size()/4; - - ERR_FAIL_COND(color_count==0); - - Set<MCBlock> block_queue; - - DVector<BColorPos> data_colors; - data_colors.resize(color_count); - - DVector<BColorPos>::Write dcw=data_colors.write(); - - DVector<uint8_t>::Read dr = data.read(); - const BColor * drptr=(const BColor*)&dr[0]; - BColorPos *bcptr=&dcw[0]; - - - - { - for(int i=0;i<color_count;i++) { - - //uint32_t data_ofs=i<<2; - bcptr[i].color=drptr[i];//BColor(drptr[data_ofs+0],drptr[data_ofs+1],drptr[data_ofs+2],drptr[data_ofs+3]); - bcptr[i].index=i; - } - - } - - //printf("color count: %i\n",color_count); - /* - for(int i=0;i<color_count;i++) { - - BColor bc = ((BColor*)&wb[0])[i]; - printf("%i - %i,%i,%i,%i\n",i,bc.r,bc.g,bc.b,bc.a); - }*/ - - MCBlock initial_block((BColorPos*)&dcw[0],color_count); - - block_queue.insert(initial_block); - - while( block_queue.size() < 256 && block_queue.back()->get().color_count > 1 ) { - - MCBlock longest = block_queue.back()->get(); - //printf("longest: %i (%i)\n",longest.get_longest_axis_index(),longest.get_longest_axis_length()); - - block_queue.erase(block_queue.back()); - - BColorPos *first = longest.colors; - BColorPos *median = longest.colors + (longest.color_count+1)/2; - BColorPos *end = longest.colors + longest.color_count; - -#if 0 - int lai =longest.get_longest_axis_index(); - switch(lai) { -#if 0 - case 0: { SortArray<BColorPos,BColorPos::SortR> sort; sort.sort(first,end-first); } break; - case 1: { SortArray<BColorPos,BColorPos::SortG> sort; sort.sort(first,end-first); } break; - case 2: { SortArray<BColorPos,BColorPos::SortB> sort; sort.sort(first,end-first); } break; - case 3: { SortArray<BColorPos,BColorPos::SortA> sort; sort.sort(first,end-first); } break; -#else - case 0: { SortArray<BColorPos,BColorPos::SortR> sort; sort.nth_element(0,end-first,median-first,first); } break; - case 1: { SortArray<BColorPos,BColorPos::SortG> sort; sort.nth_element(0,end-first,median-first,first); } break; - case 2: { SortArray<BColorPos,BColorPos::SortB> sort; sort.nth_element(0,end-first,median-first,first); } break; - case 3: { SortArray<BColorPos,BColorPos::SortA> sort; sort.nth_element(0,end-first,median-first,first); } break; -#endif - - } - - //avoid same color from being split in 2 - //search forward and flip - BColorPos *median_end=median; - BColorPos *p=median_end+1; - - while(p!=end) { - if (median_end->color==p->color) { - SWAP(*(median_end+1),*p); - median_end++; - } - p++; - } - - //search backward and flip - BColorPos *median_begin=median; - p=median_begin-1; - - while(p!=(first-1)) { - if (median_begin->color==p->color) { - SWAP(*(median_begin-1),*p); - median_begin--; - } - p--; - } - - - if (first < median_begin) { - median=median_begin; - } else if (median_end < end-1) { - median=median_end+1; - } else { - break; //shouldn't have arrived here, since it means all pixels are equal, but wathever - } - - MCBlock left(first,median-first); - MCBlock right(median,end-median); - - block_queue.insert(left); - block_queue.insert(right); - -#else - switch(longest.get_longest_axis_index()) { - case 0: { SortArray<BColorPos,BColorPos::SortR> sort; sort.nth_element(0,end-first,median-first,first); } break; - case 1: { SortArray<BColorPos,BColorPos::SortG> sort; sort.nth_element(0,end-first,median-first,first); } break; - case 2: { SortArray<BColorPos,BColorPos::SortB> sort; sort.nth_element(0,end-first,median-first,first); } break; - case 3: { SortArray<BColorPos,BColorPos::SortA> sort; sort.nth_element(0,end-first,median-first,first); } break; - - } - - MCBlock left(first,median-first); - MCBlock right(median,end-median); - - block_queue.insert(left); - block_queue.insert(right); - - -#endif - - - } - - while(block_queue.size() > 256) { - - block_queue.erase(block_queue.front());// erase least significant - } - - int res_colors=0; - - int comp_size = (has_alpha?4:3); - indexed_data.resize(color_count + 256*comp_size); - - DVector<uint8_t>::Write iw = indexed_data.write(); - uint8_t *iwptr=&iw[0]; - BColor pallete[256]; - - // print_line("applying quantization - res colors "+itos(block_queue.size())); - - while(block_queue.size()) { - - const MCBlock &b = block_queue.back()->get(); - - uint64_t sum[4]={0,0,0,0}; - - for(int i=0;i<b.color_count;i++) { - - sum[0]+=b.colors[i].color.col[0]; - sum[1]+=b.colors[i].color.col[1]; - sum[2]+=b.colors[i].color.col[2]; - sum[3]+=b.colors[i].color.col[3]; - } - - BColor c( sum[0]/b.color_count, sum[1]/b.color_count, sum[2]/b.color_count, sum[3]/b.color_count ); - - - - //printf(" %i: %i,%i,%i,%i out of %i\n",res_colors,c.r,c.g,c.b,c.a,b.color_count); - - - - for(int i=0;i<comp_size;i++) { - iwptr[ color_count + res_colors * comp_size + i ] = c.col[i]; - } - - if (quantize_fast) { - for(int i=0;i<b.color_count;i++) { - iwptr[b.colors[i].index]=res_colors; - } - } else { - - pallete[res_colors]=c; - } - - - res_colors++; - - block_queue.erase(block_queue.back()); - - } - - - if (!quantize_fast) { - - for(int i=0;i<color_count;i++) { - - const BColor &c=drptr[i]; - uint8_t best_dist_idx=0; - uint32_t dist=0xFFFFFFFF; - - for(int j=0;j<res_colors;j++) { - - const BColor &pc=pallete[j]; - uint32_t d = 0; - { int16_t v = (int16_t)c.r-(int16_t)pc.r; d+=v*v; } - { int16_t v = (int16_t)c.g-(int16_t)pc.g; d+=v*v; } - { int16_t v = (int16_t)c.b-(int16_t)pc.b; d+=v*v; } - { int16_t v = (int16_t)c.a-(int16_t)pc.a; d+=v*v; } - - if (d<=dist) { - best_dist_idx=j; - dist=d; - } - } - - - iwptr[ i ] = best_dist_idx; - - } - } - - //iw = DVector<uint8_t>::Write(); - //dr = DVector<uint8_t>::Read(); - //wb = DVector<uint8_t>::Write(); - } - - print_line(itos(indexed_data.size())); - data=indexed_data; - format=has_alpha?FORMAT_INDEXED_ALPHA:FORMAT_INDEXED; - - -} //do none - - - -#else - - -void Image::quantize() {} //do none - - -#endif diff --git a/core/input_map.cpp b/core/input_map.cpp index 09cb7ce426..0379131dd3 100644 --- a/core/input_map.cpp +++ b/core/input_map.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,19 +34,19 @@ InputMap *InputMap::singleton=NULL; void InputMap::_bind_methods() { - ObjectTypeDB::bind_method(_MD("has_action","action"),&InputMap::has_action); - ObjectTypeDB::bind_method(_MD("get_action_id","action"),&InputMap::get_action_id); - ObjectTypeDB::bind_method(_MD("get_action_from_id","id"),&InputMap::get_action_from_id); - ObjectTypeDB::bind_method(_MD("get_actions"),&InputMap::_get_actions); - ObjectTypeDB::bind_method(_MD("add_action","action"),&InputMap::add_action); - ObjectTypeDB::bind_method(_MD("erase_action","action"),&InputMap::erase_action); + ClassDB::bind_method(_MD("has_action","action"),&InputMap::has_action); + ClassDB::bind_method(_MD("get_action_id","action"),&InputMap::get_action_id); + ClassDB::bind_method(_MD("get_action_from_id","id"),&InputMap::get_action_from_id); + ClassDB::bind_method(_MD("get_actions"),&InputMap::_get_actions); + ClassDB::bind_method(_MD("add_action","action"),&InputMap::add_action); + ClassDB::bind_method(_MD("erase_action","action"),&InputMap::erase_action); - ObjectTypeDB::bind_method(_MD("action_add_event","action","event"),&InputMap::action_add_event); - ObjectTypeDB::bind_method(_MD("action_has_event","action","event"),&InputMap::action_has_event); - ObjectTypeDB::bind_method(_MD("action_erase_event","action","event"),&InputMap::action_erase_event); - ObjectTypeDB::bind_method(_MD("get_action_list","action"),&InputMap::_get_action_list); - ObjectTypeDB::bind_method(_MD("event_is_action","event","action"),&InputMap::event_is_action); - ObjectTypeDB::bind_method(_MD("load_from_globals"),&InputMap::load_from_globals); + ClassDB::bind_method(_MD("action_add_event","action","event"),&InputMap::action_add_event); + ClassDB::bind_method(_MD("action_has_event","action","event"),&InputMap::action_has_event); + ClassDB::bind_method(_MD("action_erase_event","action","event"),&InputMap::action_erase_event); + ClassDB::bind_method(_MD("get_action_list","action"),&InputMap::_get_action_list); + ClassDB::bind_method(_MD("event_is_action","event","action"),&InputMap::event_is_action); + ClassDB::bind_method(_MD("load_from_globals"),&InputMap::load_from_globals); } @@ -106,7 +106,7 @@ List<StringName> InputMap::get_actions() const { return actions; } -List<InputEvent>::Element *InputMap::_find_event(List<InputEvent> &p_list,const InputEvent& p_event) const { +List<InputEvent>::Element *InputMap::_find_event(List<InputEvent> &p_list,const InputEvent& p_event, bool p_mod_ignore=false) const { for (List<InputEvent>::Element *E=p_list.front();E;E=E->next()) { @@ -122,10 +122,10 @@ List<InputEvent>::Element *InputMap::_find_event(List<InputEvent> &p_list,const case InputEvent::KEY: { - same=(e.key.scancode==p_event.key.scancode && e.key.mod == p_event.key.mod); + same=(e.key.scancode==p_event.key.scancode && (p_mod_ignore || e.key.mod == p_event.key.mod)); } break; - case InputEvent::JOYSTICK_BUTTON: { + case InputEvent::JOYPAD_BUTTON: { same=(e.joy_button.button_index==p_event.joy_button.button_index); @@ -135,7 +135,7 @@ List<InputEvent>::Element *InputMap::_find_event(List<InputEvent> &p_list,const same=(e.mouse_button.button_index==p_event.mouse_button.button_index); } break; - case InputEvent::JOYSTICK_MOTION: { + case InputEvent::JOYPAD_MOTION: { same=(e.joy_motion.axis==p_event.joy_motion.axis && (e.joy_motion.axis_value < 0) == (p_event.joy_motion.axis_value < 0)); @@ -229,7 +229,7 @@ bool InputMap::event_is_action(const InputEvent& p_event, const StringName& p_ac return p_event.action.action==E->get().id; } - return _find_event(E->get().inputs,p_event)!=NULL; + return _find_event(E->get().inputs,p_event,!p_event.is_pressed())!=NULL; } const Map<StringName, InputMap::Action>& InputMap::get_action_map() const { @@ -241,7 +241,7 @@ void InputMap::load_from_globals() { input_map.clear();; List<PropertyInfo> pinfo; - Globals::get_singleton()->get_property_list(&pinfo); + GlobalConfig::get_singleton()->get_property_list(&pinfo); for(List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) { const PropertyInfo &pi=E->get(); @@ -253,7 +253,7 @@ void InputMap::load_from_globals() { add_action(name); - Array va = Globals::get_singleton()->get(pi.name);; + Array va = GlobalConfig::get_singleton()->get(pi.name);; for(int i=0;i<va.size();i++) { @@ -324,7 +324,7 @@ void InputMap::load_default() { key.key.scancode=KEY_PAGEDOWN; action_add_event("ui_page_down",key); -// set("display/orientation", "landscape"); +// set("display/handheld/orientation", "landscape"); } diff --git a/core/input_map.h b/core/input_map.h index 21c479588d..306845fc89 100644 --- a/core/input_map.h +++ b/core/input_map.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class InputMap : public Object { - OBJ_TYPE( InputMap, Object ); + GDCLASS( InputMap, Object ); public: struct Action { int id; @@ -46,7 +46,7 @@ private: mutable Map<StringName, Action> input_map; mutable Map<int,StringName> input_id_map; - List<InputEvent>::Element *_find_event(List<InputEvent> &p_list,const InputEvent& p_event) const; + List<InputEvent>::Element *_find_event(List<InputEvent> &p_list,const InputEvent& p_event, bool p_mod_ignore) const; Array _get_action_list(const StringName& p_action); Array _get_actions(); diff --git a/core/int_types.h b/core/int_types.h index 7d7c4b16b0..a7f04c680e 100644 --- a/core/int_types.h +++ b/core/int_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/compression.cpp b/core/io/compression.cpp index ca44d24911..0d3b494106 100644 --- a/core/io/compression.cpp +++ b/core/io/compression.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/compression.h b/core/io/compression.h index e0a4d31a51..fc00d02dda 100644 --- a/core/io/compression.h +++ b/core/io/compression.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/config_file.cpp b/core/io/config_file.cpp index e0dc7ef9fa..a9de740806 100644 --- a/core/io/config_file.cpp +++ b/core/io/config_file.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,11 +31,11 @@ #include "os/file_access.h" #include "variant_parser.h" -StringArray ConfigFile::_get_sections() const { +PoolStringArray ConfigFile::_get_sections() const { List<String> s; get_sections(&s); - StringArray arr; + PoolStringArray arr; arr.resize(s.size()); int idx=0; for(const List<String>::Element *E=s.front();E;E=E->next()) { @@ -46,11 +46,11 @@ StringArray ConfigFile::_get_sections() const { return arr; } -StringArray ConfigFile::_get_section_keys(const String& p_section) const{ +PoolStringArray ConfigFile::_get_section_keys(const String& p_section) const{ List<String> s; get_section_keys(p_section,&s); - StringArray arr; + PoolStringArray arr; arr.resize(s.size()); int idx=0; for(const List<String>::Element *E=s.front();E;E=E->next()) { @@ -206,17 +206,17 @@ Error ConfigFile::load(const String& p_path) { void ConfigFile::_bind_methods(){ - ObjectTypeDB::bind_method(_MD("set_value","section","key","value"),&ConfigFile::set_value); - ObjectTypeDB::bind_method(_MD("get_value:Variant","section","key","default"),&ConfigFile::get_value,DEFVAL(Variant())); + ClassDB::bind_method(_MD("set_value","section","key","value"),&ConfigFile::set_value); + ClassDB::bind_method(_MD("get_value:Variant","section","key","default"),&ConfigFile::get_value,DEFVAL(Variant())); - ObjectTypeDB::bind_method(_MD("has_section","section"),&ConfigFile::has_section); - ObjectTypeDB::bind_method(_MD("has_section_key","section","key"),&ConfigFile::has_section_key); + ClassDB::bind_method(_MD("has_section","section"),&ConfigFile::has_section); + ClassDB::bind_method(_MD("has_section_key","section","key"),&ConfigFile::has_section_key); - ObjectTypeDB::bind_method(_MD("get_sections"),&ConfigFile::_get_sections); - ObjectTypeDB::bind_method(_MD("get_section_keys","section"),&ConfigFile::_get_section_keys); + ClassDB::bind_method(_MD("get_sections"),&ConfigFile::_get_sections); + ClassDB::bind_method(_MD("get_section_keys","section"),&ConfigFile::_get_section_keys); - ObjectTypeDB::bind_method(_MD("load:Error","path"),&ConfigFile::load); - ObjectTypeDB::bind_method(_MD("save:Error","path"),&ConfigFile::save); + ClassDB::bind_method(_MD("load:Error","path"),&ConfigFile::load); + ClassDB::bind_method(_MD("save:Error","path"),&ConfigFile::save); } diff --git a/core/io/config_file.h b/core/io/config_file.h index 4708fefeaa..397342f90f 100644 --- a/core/io/config_file.h +++ b/core/io/config_file.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,12 +34,12 @@ class ConfigFile : public Reference { - OBJ_TYPE(ConfigFile,Reference); + GDCLASS(ConfigFile,Reference); Map< String, Map<String, Variant> > values; - StringArray _get_sections() const; - StringArray _get_section_keys(const String& p_section) const; + PoolStringArray _get_sections() const; + PoolStringArray _get_section_keys(const String& p_section) const; protected: static void _bind_methods(); diff --git a/core/io/file_access_buffered.cpp b/core/io/file_access_buffered.cpp index e6b01475b6..71518de38b 100644 --- a/core/io/file_access_buffered.cpp +++ b/core/io/file_access_buffered.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -117,7 +117,7 @@ int FileAccessBuffered::get_buffer(uint8_t *p_dest,int p_elements) const { int size = (cache.buffer.size() - (file.offset - cache.offset)); size = size - (size % 4); - //DVector<uint8_t>::Read read = cache.buffer.read(); + //PoolVector<uint8_t>::Read read = cache.buffer.read(); //memcpy(p_dest, read.ptr() + (file.offset - cache.offset), size); memcpy(p_dest, cache.buffer.ptr() + (file.offset - cache.offset), size); p_dest += size; @@ -152,7 +152,7 @@ int FileAccessBuffered::get_buffer(uint8_t *p_dest,int p_elements) const { }; int r = MIN(left, to_read); - //DVector<uint8_t>::Read read = cache.buffer.read(); + //PoolVector<uint8_t>::Read read = cache.buffer.read(); //memcpy(p_dest+total_read, &read.ptr()[file.offset - cache.offset], r); memcpy(p_dest+total_read, cache.buffer.ptr() + (file.offset - cache.offset), r); diff --git a/core/io/file_access_buffered.h b/core/io/file_access_buffered.h index 058c26b8a9..be8ea714b1 100644 --- a/core/io/file_access_buffered.h +++ b/core/io/file_access_buffered.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/file_access_buffered_fa.h b/core/io/file_access_buffered_fa.h index afa79db06f..884d40a266 100644 --- a/core/io/file_access_buffered_fa.h +++ b/core/io/file_access_buffered_fa.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -53,7 +53,7 @@ class FileAccessBufferedFA : public FileAccessBuffered { cache.buffer.resize(p_size); // on dvector - //DVector<uint8_t>::Write write = cache.buffer.write(); + //PoolVector<uint8_t>::Write write = cache.buffer.write(); //f.get_buffer(write.ptr(), p_size); // on vector diff --git a/core/io/file_access_compressed.cpp b/core/io/file_access_compressed.cpp index 2547d2d065..3bcfade526 100644 --- a/core/io/file_access_compressed.cpp +++ b/core/io/file_access_compressed.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/file_access_compressed.h b/core/io/file_access_compressed.h index f9e7cd98bd..70034120f9 100644 --- a/core/io/file_access_compressed.h +++ b/core/io/file_access_compressed.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/file_access_encrypted.cpp b/core/io/file_access_encrypted.cpp index 4d4b4d8ee7..039458237d 100644 --- a/core/io/file_access_encrypted.cpp +++ b/core/io/file_access_encrypted.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/file_access_encrypted.h b/core/io/file_access_encrypted.h index 34926faadf..51ed9a8677 100644 --- a/core/io/file_access_encrypted.h +++ b/core/io/file_access_encrypted.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/file_access_memory.cpp b/core/io/file_access_memory.cpp index 11a425001e..a9dbf56c15 100644 --- a/core/io/file_access_memory.cpp +++ b/core/io/file_access_memory.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -42,8 +42,8 @@ void FileAccessMemory::register_file(String p_name, Vector<uint8_t> p_data) { } String name; - if (Globals::get_singleton()) - name = Globals::get_singleton()->globalize_path(p_name); + if (GlobalConfig::get_singleton()) + name = GlobalConfig::get_singleton()->globalize_path(p_name); else name = p_name; //name = DirAccess::normalize_path(name); diff --git a/core/io/file_access_memory.h b/core/io/file_access_memory.h index 287f3dfe04..c6dda07971 100644 --- a/core/io/file_access_memory.h +++ b/core/io/file_access_memory.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/file_access_network.cpp b/core/io/file_access_network.cpp index a3c839e761..19076b57be 100644 --- a/core/io/file_access_network.cpp +++ b/core/io/file_access_network.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -528,6 +528,14 @@ uint64_t FileAccessNetwork::_get_modified_time(const String& p_file){ } +void FileAccessNetwork::configure() { + + GLOBAL_DEF("network/remote_fs/page_size",65536); + GLOBAL_DEF("network/remote_fs/page_read_ahead",4); + GLOBAL_DEF("network/remote_fs/max_pages",20); + +} + FileAccessNetwork::FileAccessNetwork() { eof_flag=false; @@ -541,9 +549,9 @@ FileAccessNetwork::FileAccessNetwork() { id=nc->last_id++; nc->accesses[id]=this; nc->unlock_mutex(); - page_size = GLOBAL_DEF("remote_fs/page_size",65536); - read_ahead = GLOBAL_DEF("remote_fs/page_read_ahead",4); - max_pages = GLOBAL_DEF("remote_fs/max_pages",20); + page_size = GLOBAL_GET("network/remote_fs/page_size"); + read_ahead = GLOBAL_GET("network/remote_fs/page_read_ahead"); + max_pages = GLOBAL_GET("network/remote_fs/max_pages"); last_activity_val=0; waiting_on_page=-1; last_page=-1; diff --git a/core/io/file_access_network.h b/core/io/file_access_network.h index 0073209ab8..4dbfb04b10 100644 --- a/core/io/file_access_network.h +++ b/core/io/file_access_network.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -162,6 +162,8 @@ public: virtual uint64_t _get_modified_time(const String& p_file); + static void configure(); + FileAccessNetwork(); ~FileAccessNetwork(); }; diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp index 1632b841c6..7e3a6d1fa0 100644 --- a/core/io/file_access_pack.cpp +++ b/core/io/file_access_pack.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/file_access_pack.h b/core/io/file_access_pack.h index f5dae6d51d..83340a662b 100644 --- a/core/io/file_access_pack.h +++ b/core/io/file_access_pack.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/file_access_zip.cpp b/core/io/file_access_zip.cpp index 41f43bf54d..c4439f2599 100644 --- a/core/io/file_access_zip.cpp +++ b/core/io/file_access_zip.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/file_access_zip.h b/core/io/file_access_zip.h index 0a927b72f2..e34bc1283a 100644 --- a/core/io/file_access_zip.h +++ b/core/io/file_access_zip.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index e3289b452c..5e57f55f87 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -29,11 +29,14 @@ #include "http_client.h" #include "io/stream_peer_ssl.h" -VARIANT_ENUM_CAST(IP_Address::AddrType); +void HTTPClient::set_ip_type(IP::Type p_type) { + ip_type = p_type; +} -Error HTTPClient::connect(const String &p_host, int p_port, bool p_ssl,bool p_verify_host, IP_Address::AddrType p_addr_type){ +Error HTTPClient::connect(const String &p_host, int p_port, bool p_ssl,bool p_verify_host){ close(); + tcp_connection->set_ip_type(ip_type); conn_port=p_port; conn_host=p_host; @@ -63,7 +66,7 @@ Error HTTPClient::connect(const String &p_host, int p_port, bool p_ssl,bool p_ve status=STATUS_CONNECTING; } else { //is hostname - resolving=IP::get_singleton()->resolve_hostname_queue_item(conn_host, p_addr_type); + resolving=IP::get_singleton()->resolve_hostname_queue_item(conn_host, ip_type); status=STATUS_RESOLVING; } @@ -84,7 +87,7 @@ Ref<StreamPeer> HTTPClient::get_connection() const { return connection; } -Error HTTPClient::request_raw( Method p_method, const String& p_url, const Vector<String>& p_headers,const DVector<uint8_t>& p_body) { +Error HTTPClient::request_raw( Method p_method, const String& p_url, const Vector<String>& p_headers,const PoolVector<uint8_t>& p_body) { ERR_FAIL_INDEX_V(p_method,METHOD_MAX,ERR_INVALID_PARAMETER); ERR_FAIL_COND_V(status!=STATUS_CONNECTED,ERR_INVALID_PARAMETER); @@ -117,7 +120,7 @@ Error HTTPClient::request_raw( Method p_method, const String& p_url, const Vecto request+="\r\n"; CharString cs=request.utf8(); - DVector<uint8_t> data; + PoolVector<uint8_t> data; //Maybe this goes faster somehow? for(int i=0;i<cs.length();i++) { @@ -125,7 +128,7 @@ Error HTTPClient::request_raw( Method p_method, const String& p_url, const Vecto } data.append_array( p_body ); - DVector<uint8_t>::Read r = data.read(); + PoolVector<uint8_t>::Read r = data.read(); Error err = connection->put_data(&r[0], data.size()); if (err) { @@ -190,7 +193,7 @@ Error HTTPClient::send_body_text(const String& p_body){ return OK; } -Error HTTPClient::send_body_data(const ByteArray& p_body){ +Error HTTPClient::send_body_data(const PoolByteArray& p_body){ return OK; } @@ -441,11 +444,11 @@ Dictionary HTTPClient::_get_response_headers_as_dictionary() { return ret; } -StringArray HTTPClient::_get_response_headers() { +PoolStringArray HTTPClient::_get_response_headers() { List<String> rh; get_response_headers(&rh); - StringArray ret; + PoolStringArray ret; ret.resize(rh.size()); int idx=0; for(const List<String>::Element *E=rh.front();E;E=E->next()) { @@ -460,9 +463,9 @@ int HTTPClient::get_response_body_length() const { return body_size; } -ByteArray HTTPClient::read_response_body_chunk() { +PoolByteArray HTTPClient::read_response_body_chunk() { - ERR_FAIL_COND_V( status !=STATUS_BODY, ByteArray() ); + ERR_FAIL_COND_V( status !=STATUS_BODY, PoolByteArray() ); Error err=OK; @@ -484,7 +487,7 @@ ByteArray HTTPClient::read_response_body_chunk() { if (chunk.size()>32) { ERR_PRINT("HTTP Invalid chunk hex len"); status=STATUS_CONNECTION_ERROR; - return ByteArray(); + return PoolByteArray(); } if (chunk.size()>2 && chunk[chunk.size()-2]=='\r' && chunk[chunk.size()-1]=='\n') { @@ -502,14 +505,14 @@ ByteArray HTTPClient::read_response_body_chunk() { else { ERR_PRINT("HTTP Chunk len not in hex!!"); status=STATUS_CONNECTION_ERROR; - return ByteArray(); + return PoolByteArray(); } len<<=4; len|=v; if (len>(1<<24)) { ERR_PRINT("HTTP Chunk too big!! >16mb"); status=STATUS_CONNECTION_ERROR; - return ByteArray(); + return PoolByteArray(); } } @@ -518,7 +521,7 @@ ByteArray HTTPClient::read_response_body_chunk() { //end! status=STATUS_CONNECTED; chunk.clear(); - return ByteArray(); + return PoolByteArray(); } chunk_left=len+2; @@ -539,13 +542,13 @@ ByteArray HTTPClient::read_response_body_chunk() { if (chunk[chunk.size()-2]!='\r' || chunk[chunk.size()-1]!='\n') { ERR_PRINT("HTTP Invalid chunk terminator (not \\r\\n)"); status=STATUS_CONNECTION_ERROR; - return ByteArray(); + return PoolByteArray(); } - ByteArray ret; + PoolByteArray ret; ret.resize(chunk.size()-2); { - ByteArray::Write w = ret.write(); + PoolByteArray::Write w = ret.write(); copymem(w.ptr(),chunk.ptr(),chunk.size()-2); } chunk.clear(); @@ -561,9 +564,9 @@ ByteArray HTTPClient::read_response_body_chunk() { } else { int to_read = MIN(body_left,read_chunk_size); - ByteArray ret; + PoolByteArray ret; ret.resize(to_read); - ByteArray::Write w = ret.write(); + PoolByteArray::Write w = ret.write(); int _offset = 0; while (to_read > 0) { int rec=0; @@ -600,7 +603,7 @@ ByteArray HTTPClient::read_response_body_chunk() { status=STATUS_CONNECTED; } - return ByteArray(); + return PoolByteArray(); } HTTPClient::Status HTTPClient::get_status() const { @@ -636,31 +639,32 @@ Error HTTPClient::_get_http_data(uint8_t* p_buffer, int p_bytes,int &r_received) void HTTPClient::_bind_methods() { - ObjectTypeDB::bind_method(_MD("connect:Error","host","port","use_ssl","verify_host"),&HTTPClient::connect,DEFVAL(false),DEFVAL(true),DEFVAL(IP_Address::TYPE_ANY)); - ObjectTypeDB::bind_method(_MD("set_connection","connection:StreamPeer"),&HTTPClient::set_connection); - ObjectTypeDB::bind_method(_MD("get_connection:StreamPeer"),&HTTPClient::get_connection); - ObjectTypeDB::bind_method(_MD("request_raw","method","url","headers","body"),&HTTPClient::request_raw); - ObjectTypeDB::bind_method(_MD("request","method","url","headers","body"),&HTTPClient::request,DEFVAL(String())); - ObjectTypeDB::bind_method(_MD("send_body_text","body"),&HTTPClient::send_body_text); - ObjectTypeDB::bind_method(_MD("send_body_data","body"),&HTTPClient::send_body_data); - ObjectTypeDB::bind_method(_MD("close"),&HTTPClient::close); + ClassDB::bind_method(_MD("set_ip_type","ip_type"),&HTTPClient::set_ip_type); + ClassDB::bind_method(_MD("connect:Error","host","port","use_ssl","verify_host"),&HTTPClient::connect,DEFVAL(false),DEFVAL(true)); + ClassDB::bind_method(_MD("set_connection","connection:StreamPeer"),&HTTPClient::set_connection); + ClassDB::bind_method(_MD("get_connection:StreamPeer"),&HTTPClient::get_connection); + ClassDB::bind_method(_MD("request_raw","method","url","headers","body"),&HTTPClient::request_raw); + ClassDB::bind_method(_MD("request","method","url","headers","body"),&HTTPClient::request,DEFVAL(String())); + ClassDB::bind_method(_MD("send_body_text","body"),&HTTPClient::send_body_text); + ClassDB::bind_method(_MD("send_body_data","body"),&HTTPClient::send_body_data); + ClassDB::bind_method(_MD("close"),&HTTPClient::close); - ObjectTypeDB::bind_method(_MD("has_response"),&HTTPClient::has_response); - ObjectTypeDB::bind_method(_MD("is_response_chunked"),&HTTPClient::is_response_chunked); - ObjectTypeDB::bind_method(_MD("get_response_code"),&HTTPClient::get_response_code); - ObjectTypeDB::bind_method(_MD("get_response_headers"),&HTTPClient::_get_response_headers); - ObjectTypeDB::bind_method(_MD("get_response_headers_as_dictionary"),&HTTPClient::_get_response_headers_as_dictionary); - ObjectTypeDB::bind_method(_MD("get_response_body_length"),&HTTPClient::get_response_body_length); - ObjectTypeDB::bind_method(_MD("read_response_body_chunk"),&HTTPClient::read_response_body_chunk); - ObjectTypeDB::bind_method(_MD("set_read_chunk_size","bytes"),&HTTPClient::set_read_chunk_size); + ClassDB::bind_method(_MD("has_response"),&HTTPClient::has_response); + ClassDB::bind_method(_MD("is_response_chunked"),&HTTPClient::is_response_chunked); + ClassDB::bind_method(_MD("get_response_code"),&HTTPClient::get_response_code); + ClassDB::bind_method(_MD("get_response_headers"),&HTTPClient::_get_response_headers); + ClassDB::bind_method(_MD("get_response_headers_as_dictionary"),&HTTPClient::_get_response_headers_as_dictionary); + ClassDB::bind_method(_MD("get_response_body_length"),&HTTPClient::get_response_body_length); + ClassDB::bind_method(_MD("read_response_body_chunk"),&HTTPClient::read_response_body_chunk); + ClassDB::bind_method(_MD("set_read_chunk_size","bytes"),&HTTPClient::set_read_chunk_size); - ObjectTypeDB::bind_method(_MD("set_blocking_mode","enabled"),&HTTPClient::set_blocking_mode); - ObjectTypeDB::bind_method(_MD("is_blocking_mode_enabled"),&HTTPClient::is_blocking_mode_enabled); + ClassDB::bind_method(_MD("set_blocking_mode","enabled"),&HTTPClient::set_blocking_mode); + ClassDB::bind_method(_MD("is_blocking_mode_enabled"),&HTTPClient::is_blocking_mode_enabled); - ObjectTypeDB::bind_method(_MD("get_status"),&HTTPClient::get_status); - ObjectTypeDB::bind_method(_MD("poll:Error"),&HTTPClient::poll); + ClassDB::bind_method(_MD("get_status"),&HTTPClient::get_status); + ClassDB::bind_method(_MD("poll:Error"),&HTTPClient::poll); - ObjectTypeDB::bind_method(_MD("query_string_from_dict:String","fields"),&HTTPClient::query_string_from_dict); + ClassDB::bind_method(_MD("query_string_from_dict:String","fields"),&HTTPClient::query_string_from_dict); BIND_CONSTANT( METHOD_GET ); @@ -762,6 +766,7 @@ String HTTPClient::query_string_from_dict(const Dictionary& p_dict) { HTTPClient::HTTPClient(){ + ip_type = IP::TYPE_ANY; tcp_connection = StreamPeerTCP::create_ref(); resolving = IP::RESOLVER_INVALID_ID; status=STATUS_DISCONNECTED; diff --git a/core/io/http_client.h b/core/io/http_client.h index ba464c34c7..c6f96db1d6 100644 --- a/core/io/http_client.h +++ b/core/io/http_client.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ class HTTPClient : public Reference { - OBJ_TYPE(HTTPClient,Reference); + GDCLASS(HTTPClient,Reference); public: enum ResponseCode { @@ -132,6 +132,7 @@ public: private: + IP::Type ip_type; Status status; IP::ResolverID resolving; int conn_port; @@ -155,7 +156,7 @@ private: Vector<String> response_headers; static void _bind_methods(); - StringArray _get_response_headers(); + PoolStringArray _get_response_headers(); Dictionary _get_response_headers_as_dictionary(); int read_chunk_size; @@ -164,16 +165,17 @@ private: public: + void set_ip_type(IP::Type p_type); //Error connect_and_get(const String& p_url,bool p_verify_host=true); //connects to a full url and perform request - Error connect(const String &p_host,int p_port,bool p_ssl=false,bool p_verify_host=true, IP_Address::AddrType p_addr_type = IP_Address::TYPE_ANY); + Error connect(const String &p_host,int p_port,bool p_ssl=false,bool p_verify_host=true); void set_connection(const Ref<StreamPeer>& p_connection); Ref<StreamPeer> get_connection() const; - Error request_raw( Method p_method, const String& p_url, const Vector<String>& p_headers,const DVector<uint8_t>& p_body); + Error request_raw( Method p_method, const String& p_url, const Vector<String>& p_headers,const PoolVector<uint8_t>& p_body); Error request( Method p_method, const String& p_url, const Vector<String>& p_headers,const String& p_body=String()); Error send_body_text(const String& p_body); - Error send_body_data(const ByteArray& p_body); + Error send_body_data(const PoolByteArray& p_body); void close(); @@ -185,7 +187,7 @@ public: Error get_response_headers(List<String> *r_response); int get_response_body_length() const; - ByteArray read_response_body_chunk(); // can't get body as partial text because of most encodings UTF8, gzip, etc. + PoolByteArray read_response_body_chunk(); // can't get body as partial text because of most encodings UTF8, gzip, etc. void set_blocking_mode(bool p_enable); //useful mostly if running in a thread bool is_blocking_mode_enabled() const; diff --git a/core/io/image_loader.cpp b/core/io/image_loader.cpp index ac6c00dc61..d4d10e2126 100644 --- a/core/io/image_loader.cpp +++ b/core/io/image_loader.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/image_loader.h b/core/io/image_loader.h index c799837792..4de7706ab0 100644 --- a/core/io/image_loader.h +++ b/core/io/image_loader.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/ip.cpp b/core/io/ip.cpp index f0f273af1a..0eb1f221c9 100644 --- a/core/io/ip.cpp +++ b/core/io/ip.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,7 +32,6 @@ #include "hash_map.h" VARIANT_ENUM_CAST(IP::ResolverStatus); -VARIANT_ENUM_CAST(IP_Address::AddrType); /************* RESOLVER ******************/ @@ -44,12 +43,12 @@ struct _IP_ResolverPrivate { volatile IP::ResolverStatus status; IP_Address response; String hostname; - IP_Address::AddrType type; + IP::Type type; void clear() { status = IP::RESOLVER_STATUS_NONE; response = IP_Address(); - type = IP_Address::TYPE_NONE; + type = IP::TYPE_NONE; hostname=""; }; @@ -83,7 +82,7 @@ struct _IP_ResolverPrivate { continue; queue[i].response=IP::get_singleton()->resolve_hostname(queue[i].hostname, queue[i].type); - if (queue[i].response.type==IP_Address::TYPE_NONE) + if (queue[i].response==IP_Address()) queue[i].status=IP::RESOLVER_STATUS_ERROR; else queue[i].status=IP::RESOLVER_STATUS_DONE; @@ -108,25 +107,28 @@ struct _IP_ResolverPrivate { HashMap<String, IP_Address> cache; + static String get_cache_key(String p_hostname, IP::Type p_type) { + return itos(p_type) + p_hostname; + } + }; -IP_Address IP::resolve_hostname(const String& p_hostname, IP_Address::AddrType p_type) { +IP_Address IP::resolve_hostname(const String& p_hostname, IP::Type p_type) { GLOBAL_LOCK_FUNCTION; - if (resolver->cache.has(p_hostname)) - if (resolver->cache[p_hostname].type & p_type != 0) - return resolver->cache[p_hostname]; - // requested type is different from type in cache. continue resolution, if successful it'll overwrite cache + String key = _IP_ResolverPrivate::get_cache_key(p_hostname, p_type); + if (resolver->cache.has(key)) + return resolver->cache[key]; IP_Address res = _resolve_hostname(p_hostname, p_type); - resolver->cache[p_hostname]=res; + resolver->cache[key]=res; return res; } -IP::ResolverID IP::resolve_hostname_queue_item(const String& p_hostname, IP_Address::AddrType p_type) { +IP::ResolverID IP::resolve_hostname_queue_item(const String& p_hostname, IP::Type p_type) { GLOBAL_LOCK_FUNCTION; @@ -137,10 +139,11 @@ IP::ResolverID IP::resolve_hostname_queue_item(const String& p_hostname, IP_Addr return id; } + String key = _IP_ResolverPrivate::get_cache_key(p_hostname, p_type); resolver->queue[id].hostname=p_hostname; resolver->queue[id].type = p_type; - if (resolver->cache.has(p_hostname) && (resolver->cache[p_hostname].type & p_type) != 0) { - resolver->queue[id].response=resolver->cache[p_hostname]; + if (resolver->cache.has(key)) { + resolver->queue[id].response=resolver->cache[key]; resolver->queue[id].status=IP::RESOLVER_STATUS_DONE; } else { resolver->queue[id].response=IP_Address(); @@ -194,7 +197,10 @@ void IP::clear_cache(const String &p_hostname) { if (p_hostname.empty()) { resolver->cache.clear(); } else { - resolver->cache.erase(p_hostname); + resolver->cache.erase(_IP_ResolverPrivate::get_cache_key(p_hostname, IP::TYPE_NONE)); + resolver->cache.erase(_IP_ResolverPrivate::get_cache_key(p_hostname, IP::TYPE_IPV4)); + resolver->cache.erase(_IP_ResolverPrivate::get_cache_key(p_hostname, IP::TYPE_IPV6)); + resolver->cache.erase(_IP_ResolverPrivate::get_cache_key(p_hostname, IP::TYPE_ANY)); } }; @@ -212,13 +218,13 @@ Array IP::_get_local_addresses() const { void IP::_bind_methods() { - ObjectTypeDB::bind_method(_MD("resolve_hostname","host","ip_type"),&IP::resolve_hostname,DEFVAL(IP_Address::TYPE_ANY)); - ObjectTypeDB::bind_method(_MD("resolve_hostname_queue_item","host","ip_type"),&IP::resolve_hostname_queue_item,DEFVAL(IP_Address::TYPE_ANY)); - ObjectTypeDB::bind_method(_MD("get_resolve_item_status","id"),&IP::get_resolve_item_status); - ObjectTypeDB::bind_method(_MD("get_resolve_item_address","id"),&IP::get_resolve_item_address); - ObjectTypeDB::bind_method(_MD("erase_resolve_item","id"),&IP::erase_resolve_item); - ObjectTypeDB::bind_method(_MD("get_local_addresses"),&IP::_get_local_addresses); - ObjectTypeDB::bind_method(_MD("clear_cache"),&IP::clear_cache, DEFVAL("")); + ClassDB::bind_method(_MD("resolve_hostname","host","ip_type"),&IP::resolve_hostname,DEFVAL(IP::TYPE_ANY)); + ClassDB::bind_method(_MD("resolve_hostname_queue_item","host","ip_type"),&IP::resolve_hostname_queue_item,DEFVAL(IP::TYPE_ANY)); + ClassDB::bind_method(_MD("get_resolve_item_status","id"),&IP::get_resolve_item_status); + ClassDB::bind_method(_MD("get_resolve_item_address","id"),&IP::get_resolve_item_address); + ClassDB::bind_method(_MD("erase_resolve_item","id"),&IP::erase_resolve_item); + ClassDB::bind_method(_MD("get_local_addresses"),&IP::_get_local_addresses); + ClassDB::bind_method(_MD("clear_cache"),&IP::clear_cache, DEFVAL("")); BIND_CONSTANT( RESOLVER_STATUS_NONE ); BIND_CONSTANT( RESOLVER_STATUS_WAITING ); @@ -228,6 +234,10 @@ void IP::_bind_methods() { BIND_CONSTANT( RESOLVER_MAX_QUERIES ); BIND_CONSTANT( RESOLVER_INVALID_ID ); + BIND_CONSTANT( TYPE_NONE ); + BIND_CONSTANT( TYPE_IPV4 ); + BIND_CONSTANT( TYPE_IPV6 ); + BIND_CONSTANT( TYPE_ANY ); } diff --git a/core/io/ip.h b/core/io/ip.h index 742dd0e740..3e028f2613 100644 --- a/core/io/ip.h +++ b/core/io/ip.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ struct _IP_ResolverPrivate; class IP : public Object { - OBJ_TYPE( IP, Object ); + GDCLASS( IP, Object ); OBJ_CATEGORY("Networking"); public: @@ -48,12 +48,12 @@ public: RESOLVER_STATUS_ERROR, }; - enum AddressType { + enum Type { - ADDRESS_IPV4 = 1, - ADDRESS_IPV6 = 2, - - ADDRESS_ANY = 3, + TYPE_NONE = 0, + TYPE_IPV4 = 1, + TYPE_IPV6 = 2, + TYPE_ANY = 3, }; enum { @@ -73,7 +73,7 @@ protected: static IP*singleton; static void _bind_methods(); - virtual IP_Address _resolve_hostname(const String& p_hostname, IP_Address::AddrType p_type = IP_Address::TYPE_ANY)=0; + virtual IP_Address _resolve_hostname(const String& p_hostname, Type p_type = TYPE_ANY)=0; Array _get_local_addresses() const; static IP* (*_create)(); @@ -81,9 +81,9 @@ public: - IP_Address resolve_hostname(const String& p_hostname, IP_Address::AddrType p_type = IP_Address::TYPE_ANY); + IP_Address resolve_hostname(const String& p_hostname, Type p_type = TYPE_ANY); // async resolver hostname - ResolverID resolve_hostname_queue_item(const String& p_hostname, IP_Address::AddrType p_type = IP_Address::TYPE_ANY); + ResolverID resolve_hostname_queue_item(const String& p_hostname, Type p_type = TYPE_ANY); ResolverStatus get_resolve_item_status(ResolverID p_id) const; IP_Address get_resolve_item_address(ResolverID p_id) const; virtual void get_local_addresses(List<IP_Address> *r_addresses) const=0; @@ -101,4 +101,6 @@ public: }; +VARIANT_ENUM_CAST(IP::Type); + #endif // IP_H diff --git a/core/io/ip_address.cpp b/core/io/ip_address.cpp index 9887cd132b..1fda7fed7b 100644 --- a/core/io/ip_address.cpp +++ b/core/io/ip_address.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -38,21 +38,18 @@ IP_Address::operator Variant() const { IP_Address::operator String() const { - if (type == TYPE_NONE) - return "0.0.0.0"; - if (type == TYPE_IPV4) - return itos(field8[0])+"."+itos(field8[1])+"."+itos(field8[2])+"."+itos(field8[3]); - else { - String ret; - for (int i=0; i<8; i++) { - if (i > 0) - ret = ret + ":"; - uint16_t num = (field8[i*2] << 8) + field8[i*2+1]; - ret = ret + String::num_int64(num, 16); - }; - - return ret; + if(is_ipv4()) + // IPv4 address mapped to IPv6 + return itos(field8[12])+"."+itos(field8[13])+"."+itos(field8[14])+"."+itos(field8[15]); + String ret; + for (int i=0; i<8; i++) { + if (i > 0) + ret = ret + ":"; + uint16_t num = (field8[i*2] << 8) + field8[i*2+1]; + ret = ret + String::num_int64(num, 16); }; + + return ret; } static void _parse_hex(const String& p_string, int p_start, uint8_t* p_dst) { @@ -176,17 +173,41 @@ void IP_Address::clear() { memset(&field8[0], 0, sizeof(field8)); }; +bool IP_Address::is_ipv4() const{ + return (field32[0]==0 && field32[1]==0 && field16[4]==0 && field16[5]==0xffff); +} + +const uint8_t *IP_Address::get_ipv4() const{ + ERR_FAIL_COND_V(!is_ipv4(),0); + return &(field8[12]); +} + +void IP_Address::set_ipv4(const uint8_t *p_ip) { + clear(); + field16[5]=0xffff; + field32[3]=*((const uint32_t *)p_ip); +} + +const uint8_t *IP_Address::get_ipv6() const{ + return field8; +} + +void IP_Address::set_ipv6(const uint8_t *p_buf) { + clear(); + for (int i=0; i<16; i++) + field8[i] = p_buf[i]; +} + IP_Address::IP_Address(const String& p_string) { clear(); if (p_string.find(":") >= 0) { _parse_ipv6(p_string); - type = TYPE_IPV6; } else { - - _parse_ipv4(p_string, 0, &field8[0]); - type = TYPE_IPV4; + // Mapped to IPv6 + field16[5] = 0xffff; + _parse_ipv4(p_string, 0, &field8[12]); }; } @@ -198,25 +219,22 @@ _FORCE_INLINE_ static void _32_to_buf(uint8_t* p_dst, uint32_t p_n) { p_dst[3] = (p_n >> 0) & 0xff; }; -IP_Address::IP_Address(uint32_t p_a,uint32_t p_b,uint32_t p_c,uint32_t p_d, IP_Address::AddrType p_type) { +IP_Address::IP_Address(uint32_t p_a,uint32_t p_b,uint32_t p_c,uint32_t p_d, bool is_v6) { - type = p_type; - memset(&field8[0], 0, sizeof(field8)); - if (p_type == TYPE_IPV4) { - field8[0]=p_a; - field8[1]=p_b; - field8[2]=p_c; - field8[3]=p_d; - } else if (type == TYPE_IPV6) { + clear(); + if (!is_v6) { + // Mapped to IPv6 + field16[5]=0xffff; + field8[12]=p_a; + field8[13]=p_b; + field8[14]=p_c; + field8[15]=p_d; + } else { _32_to_buf(&field8[0], p_a); _32_to_buf(&field8[4], p_b); _32_to_buf(&field8[8], p_c); _32_to_buf(&field8[12], p_d); - } else { - type = TYPE_NONE; - ERR_EXPLAIN("Invalid type specified for IP_Address (use TYPE_IPV4 or TYPE_IPV6"); - ERR_FAIL(); - }; + } } diff --git a/core/io/ip_address.h b/core/io/ip_address.h index fe13d70611..87f32b0ac2 100644 --- a/core/io/ip_address.h +++ b/core/io/ip_address.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,16 +33,7 @@ struct IP_Address { -public: - enum AddrType { - TYPE_NONE = 0, - TYPE_IPV4 = 1, - TYPE_IPV6 = 2, - - TYPE_ANY = 3, - }; - - AddrType type; +private: union { uint8_t field8[16]; @@ -70,11 +61,17 @@ public: } void clear(); + bool is_ipv4() const; + const uint8_t *get_ipv4() const; + void set_ipv4(const uint8_t *p_ip); + + const uint8_t *get_ipv6() const; + void set_ipv6(const uint8_t *buf); operator String() const; IP_Address(const String& p_string); - IP_Address(uint32_t p_a,uint32_t p_b,uint32_t p_c,uint32_t p_d, AddrType p_type=TYPE_IPV4); - IP_Address() { clear(); type=TYPE_NONE; } + IP_Address(uint32_t p_a,uint32_t p_b,uint32_t p_c,uint32_t p_d, bool is_v6=false); + IP_Address() { clear(); } }; diff --git a/core/io/json.cpp b/core/io/json.cpp index f9a8638d06..ed1e74967b 100644 --- a/core/io/json.cpp +++ b/core/io/json.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -52,9 +52,9 @@ String JSON::_print_var(const Variant& p_var) { case Variant::BOOL: return p_var.operator bool() ? "true": "false"; case Variant::INT: return itos(p_var); case Variant::REAL: return rtos(p_var); - case Variant::INT_ARRAY: - case Variant::REAL_ARRAY: - case Variant::STRING_ARRAY: + case Variant::POOL_INT_ARRAY: + case Variant::POOL_REAL_ARRAY: + case Variant::POOL_STRING_ARRAY: case Variant::ARRAY: { String s = "["; @@ -92,9 +92,9 @@ String JSON::_print_var(const Variant& p_var) { } -String JSON::print(const Dictionary& p_dict) { +String JSON::print(const Variant& p_var) { - return _print_var(p_dict); + return _print_var(p_var); } @@ -450,27 +450,24 @@ Error JSON::_parse_object(Dictionary &object,const CharType *p_str,int &index, i } -Error JSON::parse(const String& p_json,Dictionary& r_ret,String &r_err_str,int &r_err_line) { +Error JSON::parse(const String& p_json, Variant &r_ret, String &r_err_str, int &r_err_line) { const CharType *str = p_json.ptr(); int idx = 0; int len = p_json.length(); Token token; - int line=0; + r_err_line=0; String aux_key; - Error err = _get_token(str,idx,len,token,line,r_err_str); + Error err = _get_token(str,idx,len,token,r_err_line,r_err_str); if (err) return err; - if (token.type!=TK_CURLY_BRACKET_OPEN) { + err = _parse_value(r_ret,token,str,idx,len,r_err_line,r_err_str); - r_err_str="Expected '{'"; - return ERR_PARSE_ERROR; - } - - return _parse_object(r_ret,str,idx,len,r_err_line,r_err_str); + return err; + } diff --git a/core/io/json.h b/core/io/json.h index a2803269cb..97457d223e 100644 --- a/core/io/json.h +++ b/core/io/json.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -74,8 +74,8 @@ class JSON { static Error _parse_object(Dictionary &object,const CharType *p_str,int &index, int p_len,int &line,String &r_err_str); public: - static String print(const Dictionary& p_dict); - static Error parse(const String& p_json,Dictionary& r_ret,String &r_err_str,int &r_err_line); + static String print(const Variant &p_var); + static Error parse(const String& p_json,Variant& r_ret,String &r_err_str,int &r_err_line); }; #endif // JSON_H diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index c9bd38c654..67baa117cb 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,6 +31,10 @@ #include "os/keyboard.h" #include <stdio.h> + +#define ENCODE_MASK 0xFF +#define ENCODE_FLAG_64 1<<16 + Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int *r_len) { const uint8_t * buf=p_buffer; @@ -44,14 +48,14 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * uint32_t type=decode_uint32(buf); - ERR_FAIL_COND_V(type>=Variant::VARIANT_MAX,ERR_INVALID_DATA); + ERR_FAIL_COND_V((type&ENCODE_MASK)>=Variant::VARIANT_MAX,ERR_INVALID_DATA); buf+=4; len-=4; if (r_len) *r_len=4; - switch(type) { + switch(type&ENCODE_MASK) { case Variant::NIL: { @@ -68,19 +72,35 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * case Variant::INT: { ERR_FAIL_COND_V(len<4,ERR_INVALID_DATA); - int val = decode_uint32(buf); - r_variant=val; - if (r_len) - (*r_len)+=4; + if (type&ENCODE_FLAG_64) { + int64_t val = decode_uint64(buf); + r_variant=val; + if (r_len) + (*r_len)+=8; + + } else { + int32_t val = decode_uint32(buf); + r_variant=val; + if (r_len) + (*r_len)+=4; + } } break; case Variant::REAL: { ERR_FAIL_COND_V(len<(int)4,ERR_INVALID_DATA); - float val = decode_float(buf); - r_variant=val; - if (r_len) - (*r_len)+=4; + + if (type&ENCODE_FLAG_64) { + double val = decode_double(buf); + r_variant=val; + if (r_len) + (*r_len)+=8; + } else { + float val = decode_float(buf); + r_variant=val; + if (r_len) + (*r_len)+=4; + } } break; case Variant::STRING: { @@ -144,10 +164,10 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * (*r_len)+=4*3; } break; - case Variant::MATRIX32: { + case Variant::TRANSFORM2D: { ERR_FAIL_COND_V(len<(int)4*6,ERR_INVALID_DATA); - Matrix32 val; + Transform2D val; for(int i=0;i<3;i++) { for(int j=0;j<2;j++) { @@ -189,10 +209,10 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * (*r_len)+=4*4; } break; - case Variant::_AABB: { + case Variant::RECT3: { ERR_FAIL_COND_V(len<(int)4*6,ERR_INVALID_DATA); - AABB val; + Rect3 val; val.pos.x=decode_float(&buf[0]); val.pos.y=decode_float(&buf[4]); val.pos.z=decode_float(&buf[8]); @@ -205,10 +225,10 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * (*r_len)+=4*6; } break; - case Variant::MATRIX3: { + case Variant::BASIS: { ERR_FAIL_COND_V(len<(int)4*9,ERR_INVALID_DATA); - Matrix3 val; + Basis val; for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { @@ -272,11 +292,11 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * if (datalen>0) { len-=5*4; ERR_FAIL_COND_V( len < datalen, ERR_INVALID_DATA ); - DVector<uint8_t> data; + PoolVector<uint8_t> data; data.resize(datalen); - DVector<uint8_t>::Write wr = data.write(); + PoolVector<uint8_t>::Write wr = data.write(); copymem(&wr[0],&buf[20],datalen); - wr = DVector<uint8_t>::Write(); + wr = PoolVector<uint8_t>::Write(); @@ -423,7 +443,7 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * (*r_len)+=4; } break; - case InputEvent::JOYSTICK_BUTTON: { + case InputEvent::JOYPAD_BUTTON: { ie.joy_button.button_index=decode_uint32(&buf[12]); if (r_len) @@ -435,7 +455,7 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * if (r_len) (*r_len)+=4; } break; - case InputEvent::JOYSTICK_MOTION: { + case InputEvent::JOYPAD_MOTION: { ie.joy_motion.axis=decode_uint32(&buf[12]); ie.joy_motion.axis_value=decode_float(&buf[16]); @@ -528,7 +548,7 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * } break; // arrays - case Variant::RAW_ARRAY: { + case Variant::POOL_BYTE_ARRAY: { ERR_FAIL_COND_V(len<4,ERR_INVALID_DATA); uint32_t count = decode_uint32(buf); @@ -537,17 +557,17 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * ERR_FAIL_COND_V((int)count>len,ERR_INVALID_DATA); - DVector<uint8_t> data; + PoolVector<uint8_t> data; if (count) { data.resize(count); - DVector<uint8_t>::Write w = data.write(); + PoolVector<uint8_t>::Write w = data.write(); for(int i=0;i<count;i++) { w[i]=buf[i]; } - w = DVector<uint8_t>::Write(); + w = PoolVector<uint8_t>::Write(); } r_variant=data; @@ -561,7 +581,7 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * } break; - case Variant::INT_ARRAY: { + case Variant::POOL_INT_ARRAY: { ERR_FAIL_COND_V(len<4,ERR_INVALID_DATA); uint32_t count = decode_uint32(buf); @@ -569,18 +589,18 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * len-=4; ERR_FAIL_COND_V((int)count*4>len,ERR_INVALID_DATA); - DVector<int> data; + PoolVector<int> data; if (count) { //const int*rbuf=(const int*)buf; data.resize(count); - DVector<int>::Write w = data.write(); + PoolVector<int>::Write w = data.write(); for(int i=0;i<count;i++) { w[i]=decode_uint32(&buf[i*4]); } - w = DVector<int>::Write(); + w = PoolVector<int>::Write(); } r_variant=Variant(data); if (r_len) { @@ -588,7 +608,7 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * } } break; - case Variant::REAL_ARRAY: { + case Variant::POOL_REAL_ARRAY: { ERR_FAIL_COND_V(len<4,ERR_INVALID_DATA); uint32_t count = decode_uint32(buf); @@ -596,18 +616,18 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * len-=4; ERR_FAIL_COND_V((int)count*4>len,ERR_INVALID_DATA); - DVector<float> data; + PoolVector<float> data; if (count) { //const float*rbuf=(const float*)buf; data.resize(count); - DVector<float>::Write w = data.write(); + PoolVector<float>::Write w = data.write(); for(int i=0;i<count;i++) { w[i]=decode_float(&buf[i*4]); } - w = DVector<float>::Write(); + w = PoolVector<float>::Write(); } r_variant=data; @@ -617,13 +637,13 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * } break; - case Variant::STRING_ARRAY: { + case Variant::POOL_STRING_ARRAY: { ERR_FAIL_COND_V(len<4,ERR_INVALID_DATA); uint32_t count = decode_uint32(buf); ERR_FAIL_COND_V(count<0,ERR_INVALID_DATA); - DVector<String> strings; + PoolVector<String> strings; buf+=4; len-=4; @@ -667,7 +687,7 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * } break; - case Variant::VECTOR2_ARRAY: { + case Variant::POOL_VECTOR2_ARRAY: { ERR_FAIL_COND_V(len<4,ERR_INVALID_DATA); uint32_t count = decode_uint32(buf); @@ -676,7 +696,7 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * len-=4; ERR_FAIL_COND_V((int)count*4*2>len,ERR_INVALID_DATA); - DVector<Vector2> varray; + PoolVector<Vector2> varray; if (r_len) { (*r_len)+=4; @@ -684,7 +704,7 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * if (count) { varray.resize(count); - DVector<Vector2>::Write w = varray.write(); + PoolVector<Vector2>::Write w = varray.write(); for(int i=0;i<(int)count;i++) { @@ -705,7 +725,7 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * r_variant=varray; } break; - case Variant::VECTOR3_ARRAY: { + case Variant::POOL_VECTOR3_ARRAY: { ERR_FAIL_COND_V(len<4,ERR_INVALID_DATA); uint32_t count = decode_uint32(buf); @@ -714,7 +734,7 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * len-=4; ERR_FAIL_COND_V((int)count*4*3>len,ERR_INVALID_DATA); - DVector<Vector3> varray; + PoolVector<Vector3> varray; if (r_len) { (*r_len)+=4; @@ -722,7 +742,7 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * if (count) { varray.resize(count); - DVector<Vector3>::Write w = varray.write(); + PoolVector<Vector3>::Write w = varray.write(); for(int i=0;i<(int)count;i++) { @@ -744,7 +764,7 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * r_variant=varray; } break; - case Variant::COLOR_ARRAY: { + case Variant::POOL_COLOR_ARRAY: { ERR_FAIL_COND_V(len<4,ERR_INVALID_DATA); uint32_t count = decode_uint32(buf); @@ -753,7 +773,7 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * len-=4; ERR_FAIL_COND_V((int)count*4*4>len,ERR_INVALID_DATA); - DVector<Color> carray; + PoolVector<Color> carray; if (r_len) { (*r_len)+=4; @@ -761,7 +781,7 @@ Error decode_variant(Variant& r_variant,const uint8_t *p_buffer, int p_len,int * if (count) { carray.resize(count); - DVector<Color>::Write w = carray.write(); + PoolVector<Color>::Write w = carray.write(); for(int i=0;i<(int)count;i++) { @@ -796,8 +816,28 @@ Error encode_variant(const Variant& p_variant, uint8_t *r_buffer, int &r_len) { r_len=0; + uint32_t flags=0; + + switch(p_variant.get_type()) { + + case Variant::INT: { + int64_t val = p_variant; + if (val>0x7FFFFFFF || val < -0x80000000) { + flags|=ENCODE_FLAG_64; + } + } break; + case Variant::REAL: { + + double d = p_variant; + float f = d; + if (double(f)!=d) { + flags|=ENCODE_FLAG_64; //always encode real as double + } + } break; + } + if (buf) { - encode_uint32(p_variant.get_type(),buf); + encode_uint32(p_variant.get_type()|flags,buf); buf+=4; } r_len+=4; @@ -819,20 +859,42 @@ Error encode_variant(const Variant& p_variant, uint8_t *r_buffer, int &r_len) { } break; case Variant::INT: { - if (buf) { - encode_uint32(p_variant.operator int(),buf); - } + int64_t val = p_variant; + if (val>0x7FFFFFFF || val < -0x80000000) { + //64 bits + if (buf) { + encode_uint64(val,buf); + } - r_len+=4; + r_len+=8; + } else { + if (buf) { + encode_uint32(int32_t(val),buf); + } + r_len+=4; + } } break; case Variant::REAL: { - if (buf) { - encode_float(p_variant.operator float(),buf); + double d = p_variant; + float f = d; + if (double(f)!=d) { + if (buf) { + encode_double(p_variant.operator double(),buf); + } + + r_len+=8; + + } else { + + if (buf) { + encode_double(p_variant.operator float(),buf); + } + + r_len+=4; } - r_len+=4; } break; case Variant::NODE_PATH: { @@ -942,10 +1004,10 @@ Error encode_variant(const Variant& p_variant, uint8_t *r_buffer, int &r_len) { r_len+=3*4; } break; - case Variant::MATRIX32: { + case Variant::TRANSFORM2D: { if (buf) { - Matrix32 val=p_variant; + Transform2D val=p_variant; for(int i=0;i<3;i++) { for(int j=0;j<2;j++) { @@ -984,10 +1046,10 @@ Error encode_variant(const Variant& p_variant, uint8_t *r_buffer, int &r_len) { r_len+=4*4; } break; - case Variant::_AABB: { + case Variant::RECT3: { if (buf) { - AABB aabb=p_variant; + Rect3 aabb=p_variant; encode_float(aabb.pos.x,&buf[0]); encode_float(aabb.pos.y,&buf[4]); encode_float(aabb.pos.z,&buf[8]); @@ -1000,10 +1062,10 @@ Error encode_variant(const Variant& p_variant, uint8_t *r_buffer, int &r_len) { } break; - case Variant::MATRIX3: { + case Variant::BASIS: { if (buf) { - Matrix3 val=p_variant; + Basis val=p_variant; for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { @@ -1055,17 +1117,17 @@ Error encode_variant(const Variant& p_variant, uint8_t *r_buffer, int &r_len) { case Variant::IMAGE: { Image image = p_variant; - DVector<uint8_t> data=image.get_data(); + PoolVector<uint8_t> data=image.get_data(); if (buf) { encode_uint32(image.get_format(),&buf[0]); - encode_uint32(image.get_mipmaps(),&buf[4]); + encode_uint32(image.has_mipmaps(),&buf[4]); encode_uint32(image.get_width(),&buf[8]); encode_uint32(image.get_height(),&buf[12]); int ds=data.size(); encode_uint32(ds,&buf[16]); - DVector<uint8_t>::Read r = data.read(); + PoolVector<uint8_t>::Read r = data.read(); copymem(&buf[20],&r[0],ds); } @@ -1130,7 +1192,7 @@ Error encode_variant(const Variant& p_variant, uint8_t *r_buffer, int &r_len) { } llen+=4; } break; - case InputEvent::JOYSTICK_BUTTON: { + case InputEvent::JOYPAD_BUTTON: { if (buf) { @@ -1146,7 +1208,7 @@ Error encode_variant(const Variant& p_variant, uint8_t *r_buffer, int &r_len) { } llen+=4; } break; - case InputEvent::JOYSTICK_MOTION: { + case InputEvent::JOYPAD_MOTION: { if (buf) { @@ -1232,16 +1294,16 @@ Error encode_variant(const Variant& p_variant, uint8_t *r_buffer, int &r_len) { } break; // arrays - case Variant::RAW_ARRAY: { + case Variant::POOL_BYTE_ARRAY: { - DVector<uint8_t> data = p_variant; + PoolVector<uint8_t> data = p_variant; int datalen=data.size(); int datasize=sizeof(uint8_t); if (buf) { encode_uint32(datalen,buf); buf+=4; - DVector<uint8_t>::Read r = data.read(); + PoolVector<uint8_t>::Read r = data.read(); copymem(buf,&r[0],datalen*datasize); } @@ -1251,16 +1313,16 @@ Error encode_variant(const Variant& p_variant, uint8_t *r_buffer, int &r_len) { r_len++; } break; - case Variant::INT_ARRAY: { + case Variant::POOL_INT_ARRAY: { - DVector<int> data = p_variant; + PoolVector<int> data = p_variant; int datalen=data.size(); int datasize=sizeof(int32_t); if (buf) { encode_uint32(datalen,buf); buf+=4; - DVector<int>::Read r = data.read(); + PoolVector<int>::Read r = data.read(); for(int i=0;i<datalen;i++) encode_uint32(r[i],&buf[i*datasize]); @@ -1269,16 +1331,16 @@ Error encode_variant(const Variant& p_variant, uint8_t *r_buffer, int &r_len) { r_len+=4+datalen*datasize; } break; - case Variant::REAL_ARRAY: { + case Variant::POOL_REAL_ARRAY: { - DVector<real_t> data = p_variant; + PoolVector<real_t> data = p_variant; int datalen=data.size(); int datasize=sizeof(real_t); if (buf) { encode_uint32(datalen,buf); buf+=4; - DVector<real_t>::Read r = data.read(); + PoolVector<real_t>::Read r = data.read(); for(int i=0;i<datalen;i++) encode_float(r[i],&buf[i*datasize]); @@ -1287,10 +1349,10 @@ Error encode_variant(const Variant& p_variant, uint8_t *r_buffer, int &r_len) { r_len+=4+datalen*datasize; } break; - case Variant::STRING_ARRAY: { + case Variant::POOL_STRING_ARRAY: { - DVector<String> data = p_variant; + PoolVector<String> data = p_variant; int len=data.size(); if (buf) { @@ -1321,9 +1383,9 @@ Error encode_variant(const Variant& p_variant, uint8_t *r_buffer, int &r_len) { } } break; - case Variant::VECTOR2_ARRAY: { + case Variant::POOL_VECTOR2_ARRAY: { - DVector<Vector2> data = p_variant; + PoolVector<Vector2> data = p_variant; int len=data.size(); if (buf) { @@ -1349,9 +1411,9 @@ Error encode_variant(const Variant& p_variant, uint8_t *r_buffer, int &r_len) { r_len+=4*2*len; } break; - case Variant::VECTOR3_ARRAY: { + case Variant::POOL_VECTOR3_ARRAY: { - DVector<Vector3> data = p_variant; + PoolVector<Vector3> data = p_variant; int len=data.size(); if (buf) { @@ -1378,9 +1440,9 @@ Error encode_variant(const Variant& p_variant, uint8_t *r_buffer, int &r_len) { r_len+=4*3*len; } break; - case Variant::COLOR_ARRAY: { + case Variant::POOL_COLOR_ARRAY: { - DVector<Color> data = p_variant; + PoolVector<Color> data = p_variant; int len=data.size(); if (buf) { diff --git a/core/io/marshalls.h b/core/io/marshalls.h index 6a46e9882a..f04ec9a256 100644 --- a/core/io/marshalls.h +++ b/core/io/marshalls.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/networked_multiplayer_peer.cpp b/core/io/networked_multiplayer_peer.cpp index 47e5f3729c..6133401a8c 100644 --- a/core/io/networked_multiplayer_peer.cpp +++ b/core/io/networked_multiplayer_peer.cpp @@ -3,18 +3,18 @@ void NetworkedMultiplayerPeer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_transfer_mode","mode"), &NetworkedMultiplayerPeer::set_transfer_mode ); - ObjectTypeDB::bind_method(_MD("set_target_peer","id"), &NetworkedMultiplayerPeer::set_target_peer ); + ClassDB::bind_method(_MD("set_transfer_mode","mode"), &NetworkedMultiplayerPeer::set_transfer_mode ); + ClassDB::bind_method(_MD("set_target_peer","id"), &NetworkedMultiplayerPeer::set_target_peer ); - ObjectTypeDB::bind_method(_MD("get_packet_peer"), &NetworkedMultiplayerPeer::get_packet_peer ); + ClassDB::bind_method(_MD("get_packet_peer"), &NetworkedMultiplayerPeer::get_packet_peer ); - ObjectTypeDB::bind_method(_MD("poll"), &NetworkedMultiplayerPeer::poll ); + ClassDB::bind_method(_MD("poll"), &NetworkedMultiplayerPeer::poll ); - ObjectTypeDB::bind_method(_MD("get_connection_status"), &NetworkedMultiplayerPeer::get_connection_status ); - ObjectTypeDB::bind_method(_MD("get_unique_id"), &NetworkedMultiplayerPeer::get_unique_id ); + ClassDB::bind_method(_MD("get_connection_status"), &NetworkedMultiplayerPeer::get_connection_status ); + ClassDB::bind_method(_MD("get_unique_id"), &NetworkedMultiplayerPeer::get_unique_id ); - ObjectTypeDB::bind_method(_MD("set_refuse_new_connections","enable"), &NetworkedMultiplayerPeer::set_refuse_new_connections ); - ObjectTypeDB::bind_method(_MD("is_refusing_new_connections"), &NetworkedMultiplayerPeer::is_refusing_new_connections ); + ClassDB::bind_method(_MD("set_refuse_new_connections","enable"), &NetworkedMultiplayerPeer::set_refuse_new_connections ); + ClassDB::bind_method(_MD("is_refusing_new_connections"), &NetworkedMultiplayerPeer::is_refusing_new_connections ); BIND_CONSTANT( TRANSFER_MODE_UNRELIABLE ); BIND_CONSTANT( TRANSFER_MODE_UNRELIABLE_ORDERED ); diff --git a/core/io/networked_multiplayer_peer.h b/core/io/networked_multiplayer_peer.h index 485200a9a9..a59d9367d1 100644 --- a/core/io/networked_multiplayer_peer.h +++ b/core/io/networked_multiplayer_peer.h @@ -5,7 +5,7 @@ class NetworkedMultiplayerPeer : public PacketPeer { - OBJ_TYPE(NetworkedMultiplayerPeer,PacketPeer); + GDCLASS(NetworkedMultiplayerPeer,PacketPeer); protected: static void _bind_methods(); diff --git a/core/io/packet_peer.cpp b/core/io/packet_peer.cpp index 8e96697ac9..5ff09f9fb0 100644 --- a/core/io/packet_peer.cpp +++ b/core/io/packet_peer.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,7 +39,7 @@ PacketPeer::PacketPeer() { last_get_error=OK; } -Error PacketPeer::get_packet_buffer(DVector<uint8_t> &r_buffer) const { +Error PacketPeer::get_packet_buffer(PoolVector<uint8_t> &r_buffer) const { const uint8_t *buffer; int buffer_size; @@ -51,7 +51,7 @@ Error PacketPeer::get_packet_buffer(DVector<uint8_t> &r_buffer) const { if (buffer_size==0) return OK; - DVector<uint8_t>::Write w = r_buffer.write(); + PoolVector<uint8_t>::Write w = r_buffer.write(); for(int i=0;i<buffer_size;i++) w[i]=buffer[i]; @@ -59,13 +59,13 @@ Error PacketPeer::get_packet_buffer(DVector<uint8_t> &r_buffer) const { } -Error PacketPeer::put_packet_buffer(const DVector<uint8_t> &p_buffer) { +Error PacketPeer::put_packet_buffer(const PoolVector<uint8_t> &p_buffer) { int len = p_buffer.size(); if (len==0) return OK; - DVector<uint8_t>::Read r = p_buffer.read(); + PoolVector<uint8_t>::Read r = p_buffer.read(); return put_packet(&r[0],len); } @@ -108,12 +108,12 @@ Variant PacketPeer::_bnd_get_var() const { return var; }; -Error PacketPeer::_put_packet(const DVector<uint8_t> &p_buffer) { +Error PacketPeer::_put_packet(const PoolVector<uint8_t> &p_buffer) { return put_packet_buffer(p_buffer); } -DVector<uint8_t> PacketPeer::_get_packet() const { +PoolVector<uint8_t> PacketPeer::_get_packet() const { - DVector<uint8_t> raw; + PoolVector<uint8_t> raw; last_get_error=get_packet_buffer(raw); return raw; } @@ -126,12 +126,12 @@ Error PacketPeer::_get_packet_error() const { void PacketPeer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_var:Variant"),&PacketPeer::_bnd_get_var); - ObjectTypeDB::bind_method(_MD("put_var", "var:Variant"),&PacketPeer::put_var); - ObjectTypeDB::bind_method(_MD("get_packet"),&PacketPeer::_get_packet); - ObjectTypeDB::bind_method(_MD("put_packet:Error", "buffer"),&PacketPeer::_put_packet); - ObjectTypeDB::bind_method(_MD("get_packet_error:Error"),&PacketPeer::_get_packet_error); - ObjectTypeDB::bind_method(_MD("get_available_packet_count"),&PacketPeer::get_available_packet_count); + ClassDB::bind_method(_MD("get_var:Variant"),&PacketPeer::_bnd_get_var); + ClassDB::bind_method(_MD("put_var", "var:Variant"),&PacketPeer::put_var); + ClassDB::bind_method(_MD("get_packet"),&PacketPeer::_get_packet); + ClassDB::bind_method(_MD("put_packet:Error", "buffer"),&PacketPeer::_put_packet); + ClassDB::bind_method(_MD("get_packet_error:Error"),&PacketPeer::_get_packet_error); + ClassDB::bind_method(_MD("get_available_packet_count"),&PacketPeer::get_available_packet_count); }; /***************/ @@ -145,7 +145,7 @@ void PacketPeerStream::_set_stream_peer(REF p_peer) { void PacketPeerStream::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_stream_peer","peer:StreamPeer"),&PacketPeerStream::_set_stream_peer); + ClassDB::bind_method(_MD("set_stream_peer","peer:StreamPeer"),&PacketPeerStream::_set_stream_peer); } Error PacketPeerStream::_poll_buffer() const { @@ -265,7 +265,8 @@ void PacketPeerStream::set_input_buffer_max_size(int p_max_size) { PacketPeerStream::PacketPeerStream() { - int rbsize=GLOBAL_DEF( "core/packet_stream_peer_max_buffer_po2",(16)); + int rbsize=GLOBAL_GET( "network/packets/packet_stream_peer_max_buffer_po2"); + ring_buffer.resize(rbsize); temp_buffer.resize(1<<rbsize); diff --git a/core/io/packet_peer.h b/core/io/packet_peer.h index b29fc22af0..bacd5214f1 100644 --- a/core/io/packet_peer.h +++ b/core/io/packet_peer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ #include "ring_buffer.h" class PacketPeer : public Reference { - OBJ_TYPE( PacketPeer, Reference ); + GDCLASS( PacketPeer, Reference ); Variant _bnd_get_var() const; void _bnd_put_var(const Variant& p_var); @@ -42,8 +42,8 @@ class PacketPeer : public Reference { static void _bind_methods(); - Error _put_packet(const DVector<uint8_t> &p_buffer); - DVector<uint8_t> _get_packet() const; + Error _put_packet(const PoolVector<uint8_t> &p_buffer); + PoolVector<uint8_t> _get_packet() const; Error _get_packet_error() const; @@ -59,8 +59,8 @@ public: /* helpers / binders */ - virtual Error get_packet_buffer(DVector<uint8_t> &r_buffer) const; - virtual Error put_packet_buffer(const DVector<uint8_t> &p_buffer); + virtual Error get_packet_buffer(PoolVector<uint8_t> &r_buffer) const; + virtual Error put_packet_buffer(const PoolVector<uint8_t> &p_buffer); virtual Error get_var(Variant &r_variant) const; virtual Error put_var(const Variant& p_packet); @@ -71,7 +71,7 @@ public: class PacketPeerStream : public PacketPeer { - OBJ_TYPE(PacketPeerStream,PacketPeer); + GDCLASS(PacketPeerStream,PacketPeer); //the way the buffers work sucks, will change later @@ -92,6 +92,8 @@ public: virtual int get_max_packet_size() const; + + void set_stream_peer(const Ref<StreamPeer>& p_peer); void set_input_buffer_max_size(int p_max_size); PacketPeerStream(); diff --git a/core/io/packet_peer_udp.cpp b/core/io/packet_peer_udp.cpp index 925d00a84a..91d1fc5f98 100644 --- a/core/io/packet_peer_udp.cpp +++ b/core/io/packet_peer_udp.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,20 +31,18 @@ PacketPeerUDP* (*PacketPeerUDP::_create)()=NULL; -VARIANT_ENUM_CAST(IP_Address::AddrType); - String PacketPeerUDP::_get_packet_ip() const { return get_packet_address(); } -Error PacketPeerUDP::_set_send_address(const String& p_address,int p_port,IP_Address::AddrType p_type) { +Error PacketPeerUDP::_set_send_address(const String& p_address, int p_port) { IP_Address ip; if (p_address.is_valid_ip_address()) { ip=p_address; } else { - ip=IP::get_singleton()->resolve_hostname(p_address, p_type); + ip=IP::get_singleton()->resolve_hostname(p_address, ip_type); if (ip==IP_Address()) return ERR_CANT_RESOLVE; } @@ -53,16 +51,22 @@ Error PacketPeerUDP::_set_send_address(const String& p_address,int p_port,IP_Add return OK; } +void PacketPeerUDP::set_ip_type(IP::Type p_type) { + close(); + ip_type = p_type; +} + void PacketPeerUDP::_bind_methods() { - ObjectTypeDB::bind_method(_MD("listen:Error","port","ip_type", "recv_buf_size"),&PacketPeerUDP::listen,DEFVAL(IP_Address::TYPE_ANY),DEFVAL(65536)); - ObjectTypeDB::bind_method(_MD("close"),&PacketPeerUDP::close); - ObjectTypeDB::bind_method(_MD("wait:Error"),&PacketPeerUDP::wait); - ObjectTypeDB::bind_method(_MD("is_listening"),&PacketPeerUDP::is_listening); - ObjectTypeDB::bind_method(_MD("get_packet_ip"),&PacketPeerUDP::_get_packet_ip); - //ObjectTypeDB::bind_method(_MD("get_packet_address"),&PacketPeerUDP::_get_packet_address); - ObjectTypeDB::bind_method(_MD("get_packet_port"),&PacketPeerUDP::get_packet_port); - ObjectTypeDB::bind_method(_MD("set_send_address","host","port","ip_type"),&PacketPeerUDP::_set_send_address,DEFVAL(IP_Address::TYPE_ANY)); + ClassDB::bind_method(_MD("set_ip_type","ip_type"),&PacketPeerUDP::set_ip_type); + ClassDB::bind_method(_MD("listen:Error","port", "recv_buf_size"),&PacketPeerUDP::listen,DEFVAL(65536)); + ClassDB::bind_method(_MD("close"),&PacketPeerUDP::close); + ClassDB::bind_method(_MD("wait:Error"),&PacketPeerUDP::wait); + ClassDB::bind_method(_MD("is_listening"),&PacketPeerUDP::is_listening); + ClassDB::bind_method(_MD("get_packet_ip"),&PacketPeerUDP::_get_packet_ip); + //ClassDB::bind_method(_MD("get_packet_address"),&PacketPeerUDP::_get_packet_address); + ClassDB::bind_method(_MD("get_packet_port"),&PacketPeerUDP::get_packet_port); + ClassDB::bind_method(_MD("set_send_address","host","port"),&PacketPeerUDP::_set_send_address); } @@ -83,4 +87,5 @@ PacketPeerUDP* PacketPeerUDP::create() { PacketPeerUDP::PacketPeerUDP() { + ip_type = IP::TYPE_ANY; } diff --git a/core/io/packet_peer_udp.h b/core/io/packet_peer_udp.h index 37e700cebd..17a2817f34 100644 --- a/core/io/packet_peer_udp.h +++ b/core/io/packet_peer_udp.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -30,23 +30,27 @@ #define PACKET_PEER_UDP_H +#include "io/ip.h" #include "io/packet_peer.h" class PacketPeerUDP : public PacketPeer { - OBJ_TYPE(PacketPeerUDP,PacketPeer); + GDCLASS(PacketPeerUDP,PacketPeer); protected: + IP::Type ip_type; + static PacketPeerUDP* (*_create)(); static void _bind_methods(); String _get_packet_ip() const; - virtual Error _set_send_address(const String& p_address,int p_port, IP_Address::AddrType p_address_type = IP_Address::TYPE_ANY); + virtual Error _set_send_address(const String& p_address,int p_port); public: - virtual Error listen(int p_port, IP_Address::AddrType p_address_type = IP_Address::TYPE_ANY, int p_recv_buffer_size=65536)=0; + virtual void set_ip_type(IP::Type p_type); + virtual Error listen(int p_port, int p_recv_buffer_size=65536)=0; virtual void close()=0; virtual Error wait()=0; virtual bool is_listening() const=0; diff --git a/core/io/pck_packer.cpp b/core/io/pck_packer.cpp index 04b88ea028..a9f357a7c8 100644 --- a/core/io/pck_packer.cpp +++ b/core/io/pck_packer.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -52,9 +52,9 @@ static void _pad(FileAccess* p_file, int p_bytes) { void PCKPacker::_bind_methods() { - ObjectTypeDB::bind_method(_MD("pck_start","pck_name","alignment"),&PCKPacker::pck_start); - ObjectTypeDB::bind_method(_MD("add_file","pck_path","source_path"),&PCKPacker::add_file); - ObjectTypeDB::bind_method(_MD("flush","verbose"),&PCKPacker::flush); + ClassDB::bind_method(_MD("pck_start","pck_name","alignment"),&PCKPacker::pck_start); + ClassDB::bind_method(_MD("add_file","pck_path","source_path"),&PCKPacker::add_file); + ClassDB::bind_method(_MD("flush","verbose"),&PCKPacker::flush); }; diff --git a/core/io/pck_packer.h b/core/io/pck_packer.h index b1182335e2..a4eba04f2d 100644 --- a/core/io/pck_packer.h +++ b/core/io/pck_packer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,7 +32,7 @@ class FileAccess; class PCKPacker : public Reference { - OBJ_TYPE(PCKPacker, Reference); + GDCLASS(PCKPacker, Reference); FileAccess* file; int alignment; diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index 0544fd6ba8..7383fd7f6d 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -68,35 +68,14 @@ enum { VARIANT_VECTOR3_ARRAY=35, VARIANT_COLOR_ARRAY=36, VARIANT_VECTOR2_ARRAY=37, + VARIANT_INT64=40, + VARIANT_DOUBLE=41, IMAGE_ENCODING_EMPTY=0, IMAGE_ENCODING_RAW=1, IMAGE_ENCODING_LOSSLESS=2, IMAGE_ENCODING_LOSSY=3, - IMAGE_FORMAT_GRAYSCALE=0, - IMAGE_FORMAT_INTENSITY=1, - IMAGE_FORMAT_GRAYSCALE_ALPHA=2, - IMAGE_FORMAT_RGB=3, - IMAGE_FORMAT_RGBA=4, - IMAGE_FORMAT_INDEXED=5, - IMAGE_FORMAT_INDEXED_ALPHA=6, - IMAGE_FORMAT_BC1=7, - IMAGE_FORMAT_BC2=8, - IMAGE_FORMAT_BC3=9, - IMAGE_FORMAT_BC4=10, - IMAGE_FORMAT_BC5=11, - IMAGE_FORMAT_PVRTC2=12, - IMAGE_FORMAT_PVRTC2_ALPHA=13, - IMAGE_FORMAT_PVRTC4=14, - IMAGE_FORMAT_PVRTC4_ALPHA=15, - IMAGE_FORMAT_ETC=16, - IMAGE_FORMAT_ATC=17, - IMAGE_FORMAT_ATC_ALPHA_EXPLICIT=18, - IMAGE_FORMAT_ATC_ALPHA_INTERPOLATED=19, - IMAGE_FORMAT_CUSTOM=30, - - OBJECT_EMPTY=0, OBJECT_EXTERNAL_RESOURCE=1, OBJECT_INTERNAL_RESOURCE=2, @@ -139,10 +118,18 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) { r_v=int(f->get_32()); } break; + case VARIANT_INT64: { + + r_v=int64_t(f->get_64()); + } break; case VARIANT_REAL: { r_v=f->get_real(); } break; + case VARIANT_DOUBLE: { + + r_v=f->get_double(); + } break; case VARIANT_STRING: { r_v=get_unicode_string(); @@ -193,7 +180,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) { } break; case VARIANT_AABB: { - AABB v; + Rect3 v; v.pos.x=f->get_real(); v.pos.y=f->get_real(); v.pos.z=f->get_real(); @@ -205,7 +192,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) { } break; case VARIANT_MATRIX32: { - Matrix32 v; + Transform2D v; v.elements[0].x=f->get_real(); v.elements[0].y=f->get_real(); v.elements[1].x=f->get_real(); @@ -217,7 +204,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) { } break; case VARIANT_MATRIX3: { - Matrix3 v; + Basis v; v.elements[0].x=f->get_real(); v.elements[0].y=f->get_real(); v.elements[0].z=f->get_real(); @@ -269,56 +256,40 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) { uint32_t height = f->get_32(); uint32_t mipmaps = f->get_32(); uint32_t format = f->get_32(); - Image::Format fmt; - switch(format) { - - case IMAGE_FORMAT_GRAYSCALE: { fmt=Image::FORMAT_GRAYSCALE; } break; - case IMAGE_FORMAT_INTENSITY: { fmt=Image::FORMAT_INTENSITY; } break; - case IMAGE_FORMAT_GRAYSCALE_ALPHA: { fmt=Image::FORMAT_GRAYSCALE_ALPHA; } break; - case IMAGE_FORMAT_RGB: { fmt=Image::FORMAT_RGB; } break; - case IMAGE_FORMAT_RGBA: { fmt=Image::FORMAT_RGBA; } break; - case IMAGE_FORMAT_INDEXED: { fmt=Image::FORMAT_INDEXED; } break; - case IMAGE_FORMAT_INDEXED_ALPHA: { fmt=Image::FORMAT_INDEXED_ALPHA; } break; - case IMAGE_FORMAT_BC1: { fmt=Image::FORMAT_BC1; } break; - case IMAGE_FORMAT_BC2: { fmt=Image::FORMAT_BC2; } break; - case IMAGE_FORMAT_BC3: { fmt=Image::FORMAT_BC3; } break; - case IMAGE_FORMAT_BC4: { fmt=Image::FORMAT_BC4; } break; - case IMAGE_FORMAT_BC5: { fmt=Image::FORMAT_BC5; } break; - case IMAGE_FORMAT_PVRTC2: { fmt=Image::FORMAT_PVRTC2; } break; - case IMAGE_FORMAT_PVRTC2_ALPHA: { fmt=Image::FORMAT_PVRTC2_ALPHA; } break; - case IMAGE_FORMAT_PVRTC4: { fmt=Image::FORMAT_PVRTC4; } break; - case IMAGE_FORMAT_PVRTC4_ALPHA: { fmt=Image::FORMAT_PVRTC4_ALPHA; } break; - case IMAGE_FORMAT_ETC: { fmt=Image::FORMAT_ETC; } break; - case IMAGE_FORMAT_ATC: { fmt=Image::FORMAT_ATC; } break; - case IMAGE_FORMAT_ATC_ALPHA_EXPLICIT: { fmt=Image::FORMAT_ATC_ALPHA_EXPLICIT; } break; - case IMAGE_FORMAT_ATC_ALPHA_INTERPOLATED: { fmt=Image::FORMAT_ATC_ALPHA_INTERPOLATED; } break; - case IMAGE_FORMAT_CUSTOM: { fmt=Image::FORMAT_CUSTOM; } break; - default: { - - ERR_FAIL_V(ERR_FILE_CORRUPT); - } + const uint32_t format_version_shift=24; + const uint32_t format_version_mask=format_version_shift-1; + + uint32_t format_version = format>>format_version_shift; + + const uint32_t current_version = 0; + if (format_version>current_version) { + ERR_PRINT("Format version for encoded binary image is too new"); + return ERR_PARSE_ERROR; } + Image::Format fmt=Image::Format(format&format_version_mask); //if format changes, we can add a compatibility bit on top + + uint32_t datalen = f->get_32(); - DVector<uint8_t> imgdata; + PoolVector<uint8_t> imgdata; imgdata.resize(datalen); - DVector<uint8_t>::Write w = imgdata.write(); + PoolVector<uint8_t>::Write w = imgdata.write(); f->get_buffer(w.ptr(),datalen); _advance_padding(datalen); - w=DVector<uint8_t>::Write(); + w=PoolVector<uint8_t>::Write(); r_v=Image(width,height,mipmaps,fmt,imgdata); } else { //compressed - DVector<uint8_t> data; + PoolVector<uint8_t> data; data.resize(f->get_32()); - DVector<uint8_t>::Write w = data.write(); + PoolVector<uint8_t>::Write w = data.write(); f->get_buffer(w.ptr(),data.size()); - w = DVector<uint8_t>::Write(); + w = PoolVector<uint8_t>::Write(); Image img; @@ -394,7 +365,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) { if (path.find("://")==-1 && path.is_rel_path()) { // path is relative to file being loaded, so convert to a resource path - path=Globals::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path)); + path=GlobalConfig::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path)); } @@ -424,7 +395,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) { if (path.find("://")==-1 && path.is_rel_path()) { // path is relative to file being loaded, so convert to a resource path - path=Globals::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path)); + path=GlobalConfig::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path)); } @@ -487,12 +458,12 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) { uint32_t len = f->get_32(); - DVector<uint8_t> array; + PoolVector<uint8_t> array; array.resize(len); - DVector<uint8_t>::Write w = array.write(); + PoolVector<uint8_t>::Write w = array.write(); f->get_buffer(w.ptr(),len); _advance_padding(len); - w=DVector<uint8_t>::Write(); + w=PoolVector<uint8_t>::Write(); r_v=array; } break; @@ -500,9 +471,9 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) { uint32_t len = f->get_32(); - DVector<int> array; + PoolVector<int> array; array.resize(len); - DVector<int>::Write w = array.write(); + PoolVector<int>::Write w = array.write(); f->get_buffer((uint8_t*)w.ptr(),len*4); #ifdef BIG_ENDIAN_ENABLED { @@ -514,16 +485,16 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) { } #endif - w=DVector<int>::Write(); + w=PoolVector<int>::Write(); r_v=array; } break; case VARIANT_REAL_ARRAY: { uint32_t len = f->get_32(); - DVector<real_t> array; + PoolVector<real_t> array; array.resize(len); - DVector<real_t>::Write w = array.write(); + PoolVector<real_t>::Write w = array.write(); f->get_buffer((uint8_t*)w.ptr(),len*sizeof(real_t)); #ifdef BIG_ENDIAN_ENABLED { @@ -536,18 +507,18 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) { #endif - w=DVector<real_t>::Write(); + w=PoolVector<real_t>::Write(); r_v=array; } break; case VARIANT_STRING_ARRAY: { uint32_t len = f->get_32(); - DVector<String> array; + PoolVector<String> array; array.resize(len); - DVector<String>::Write w = array.write(); + PoolVector<String>::Write w = array.write(); for(uint32_t i=0;i<len;i++) w[i]=get_unicode_string(); - w=DVector<String>::Write(); + w=PoolVector<String>::Write(); r_v=array; @@ -556,9 +527,9 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) { uint32_t len = f->get_32(); - DVector<Vector2> array; + PoolVector<Vector2> array; array.resize(len); - DVector<Vector2>::Write w = array.write(); + PoolVector<Vector2>::Write w = array.write(); if (sizeof(Vector2)==8) { f->get_buffer((uint8_t*)w.ptr(),len*sizeof(real_t)*2); #ifdef BIG_ENDIAN_ENABLED @@ -576,7 +547,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) { ERR_EXPLAIN("Vector2 size is NOT 8!"); ERR_FAIL_V(ERR_UNAVAILABLE); } - w=DVector<Vector2>::Write(); + w=PoolVector<Vector2>::Write(); r_v=array; } break; @@ -584,9 +555,9 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) { uint32_t len = f->get_32(); - DVector<Vector3> array; + PoolVector<Vector3> array; array.resize(len); - DVector<Vector3>::Write w = array.write(); + PoolVector<Vector3>::Write w = array.write(); if (sizeof(Vector3)==12) { f->get_buffer((uint8_t*)w.ptr(),len*sizeof(real_t)*3); #ifdef BIG_ENDIAN_ENABLED @@ -604,7 +575,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) { ERR_EXPLAIN("Vector3 size is NOT 12!"); ERR_FAIL_V(ERR_UNAVAILABLE); } - w=DVector<Vector3>::Write(); + w=PoolVector<Vector3>::Write(); r_v=array; } break; @@ -612,9 +583,9 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) { uint32_t len = f->get_32(); - DVector<Color> array; + PoolVector<Color> array; array.resize(len); - DVector<Color>::Write w = array.write(); + PoolVector<Color>::Write w = array.write(); if (sizeof(Color)==16) { f->get_buffer((uint8_t*)w.ptr(),len*sizeof(real_t)*4); #ifdef BIG_ENDIAN_ENABLED @@ -632,7 +603,7 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant& r_v) { ERR_EXPLAIN("Color size is NOT 16!"); ERR_FAIL_V(ERR_UNAVAILABLE); } - w=DVector<Color>::Write(); + w=PoolVector<Color>::Write(); r_v=array; } break; @@ -739,7 +710,7 @@ Error ResourceInteractiveLoaderBinary::poll(){ String t = get_unicode_string(); - Object *obj = ObjectTypeDB::instance(t); + Object *obj = ClassDB::instance(t); if (!obj) { error=ERR_FILE_CORRUPT; ERR_EXPLAIN(local_path+":Resource of unrecognized type in file: "+t); @@ -750,7 +721,7 @@ Error ResourceInteractiveLoaderBinary::poll(){ if (!r) { error=ERR_FILE_CORRUPT; memdelete(obj); //bye - ERR_EXPLAIN(local_path+":Resoucre type in resource field not a resource, type is: "+obj->get_type()); + ERR_EXPLAIN(local_path+":Resoucre type in resource field not a resource, type is: "+obj->get_class()); ERR_FAIL_COND_V(!r,ERR_FILE_CORRUPT); } @@ -1086,7 +1057,7 @@ Ref<ResourceInteractiveLoader> ResourceFormatLoaderBinary::load_interactive(cons } Ref<ResourceInteractiveLoaderBinary> ria = memnew( ResourceInteractiveLoaderBinary ); - ria->local_path=Globals::get_singleton()->localize_path(p_path); + ria->local_path=GlobalConfig::get_singleton()->localize_path(p_path); ria->res_path=ria->local_path; // ria->set_local_path( Globals::get_singleton()->localize_path(p_path) ); ria->open(f); @@ -1103,7 +1074,7 @@ void ResourceFormatLoaderBinary::get_recognized_extensions_for_type(const String } List<String> extensions; - ObjectTypeDB::get_extensions_for_type(p_type,&extensions); + ClassDB::get_extensions_for_type(p_type,&extensions); extensions.sort(); @@ -1116,7 +1087,7 @@ void ResourceFormatLoaderBinary::get_recognized_extensions_for_type(const String void ResourceFormatLoaderBinary::get_recognized_extensions(List<String> *p_extensions) const{ List<String> extensions; - ObjectTypeDB::get_resource_base_extensions(&extensions); + ClassDB::get_resource_base_extensions(&extensions); extensions.sort(); for(List<String>::Element *E=extensions.front();E;E=E->next()) { @@ -1141,7 +1112,7 @@ Error ResourceFormatLoaderBinary::load_import_metadata(const String &p_path, Ref } Ref<ResourceInteractiveLoaderBinary> ria = memnew( ResourceInteractiveLoaderBinary ); - ria->local_path=Globals::get_singleton()->localize_path(p_path); + ria->local_path=GlobalConfig::get_singleton()->localize_path(p_path); ria->res_path=ria->local_path; // ria->set_local_path( Globals::get_singleton()->localize_path(p_path) ); ria->recognize(f); @@ -1186,7 +1157,7 @@ void ResourceFormatLoaderBinary::get_dependencies(const String& p_path,List<Stri ERR_FAIL_COND(!f); Ref<ResourceInteractiveLoaderBinary> ria = memnew( ResourceInteractiveLoaderBinary ); - ria->local_path=Globals::get_singleton()->localize_path(p_path); + ria->local_path=GlobalConfig::get_singleton()->localize_path(p_path); ria->res_path=ria->local_path; // ria->set_local_path( Globals::get_singleton()->localize_path(p_path) ); ria->get_dependencies(f,p_dependencies,p_add_types); @@ -1276,7 +1247,7 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path,const } Ref<ResourceInteractiveLoaderBinary> ria = memnew( ResourceInteractiveLoaderBinary ); - ria->local_path=Globals::get_singleton()->localize_path(p_path); + ria->local_path=GlobalConfig::get_singleton()->localize_path(p_path); ria->res_path=ria->local_path; ria->remaps=p_map; // ria->set_local_path( Globals::get_singleton()->localize_path(p_path) ); @@ -1411,7 +1382,7 @@ String ResourceFormatLoaderBinary::get_resource_type(const String &p_path) const } Ref<ResourceInteractiveLoaderBinary> ria = memnew( ResourceInteractiveLoaderBinary ); - ria->local_path=Globals::get_singleton()->localize_path(p_path); + ria->local_path=GlobalConfig::get_singleton()->localize_path(p_path); ria->res_path=ria->local_path; // ria->set_local_path( Globals::get_singleton()->localize_path(p_path) ); String r = ria->recognize(f); @@ -1455,15 +1426,33 @@ void ResourceFormatSaverBinaryInstance::write_variant(const Variant& p_property, } break; case Variant::INT: { - f->store_32(VARIANT_INT); - int val=p_property; - f->store_32(val); + int64_t val = p_property; + if (val>0x7FFFFFFF || val < -0x80000000) { + f->store_32(VARIANT_INT64); + f->store_64(val); + + } else { + f->store_32(VARIANT_INT); + int val=p_property; + f->store_32(int32_t(val)); + + } + } break; case Variant::REAL: { - f->store_32(VARIANT_REAL); - real_t val=p_property; - f->store_real(val); + + double d = p_property; + float fl = d; + if (double(fl)!=d) { + f->store_32(VARIANT_DOUBLE); + f->store_double(d); + } else { + + f->store_32(VARIANT_REAL); + f->store_real(fl); + + } } break; case Variant::STRING: { @@ -1520,10 +1509,10 @@ void ResourceFormatSaverBinaryInstance::write_variant(const Variant& p_property, f->store_real(val.w); } break; - case Variant::_AABB: { + case Variant::RECT3: { f->store_32(VARIANT_AABB); - AABB val=p_property; + Rect3 val=p_property; f->store_real(val.pos.x); f->store_real(val.pos.y); f->store_real(val.pos.z); @@ -1532,10 +1521,10 @@ void ResourceFormatSaverBinaryInstance::write_variant(const Variant& p_property, f->store_real(val.size.z); } break; - case Variant::MATRIX32: { + case Variant::TRANSFORM2D: { f->store_32(VARIANT_MATRIX32); - Matrix32 val=p_property; + Transform2D val=p_property; f->store_real(val.elements[0].x); f->store_real(val.elements[0].y); f->store_real(val.elements[1].x); @@ -1544,10 +1533,10 @@ void ResourceFormatSaverBinaryInstance::write_variant(const Variant& p_property, f->store_real(val.elements[2].y); } break; - case Variant::MATRIX3: { + case Variant::BASIS: { f->store_32(VARIANT_MATRIX3); - Matrix3 val=p_property; + Basis val=p_property; f->store_real(val.elements[0].x); f->store_real(val.elements[0].y); f->store_real(val.elements[0].z); @@ -1599,7 +1588,7 @@ void ResourceFormatSaverBinaryInstance::write_variant(const Variant& p_property, int encoding=IMAGE_ENCODING_RAW; float quality=0.7; - if (val.get_format() <= Image::FORMAT_INDEXED_ALPHA) { + if (!val.is_compressed()) { //can only compress uncompressed stuff if (p_hint.hint==PROPERTY_HINT_IMAGE_COMPRESS_LOSSY && Image::lossy_packer) { @@ -1621,42 +1610,17 @@ void ResourceFormatSaverBinaryInstance::write_variant(const Variant& p_property, f->store_32(val.get_width()); f->store_32(val.get_height()); - f->store_32(val.get_mipmaps()); - switch(val.get_format()) { - - case Image::FORMAT_GRAYSCALE: f->store_32(IMAGE_FORMAT_GRAYSCALE ); break; ///< one byte per pixel: f->store_32(IMAGE_FORMAT_ ); break; 0-255 - case Image::FORMAT_INTENSITY: f->store_32(IMAGE_FORMAT_INTENSITY ); break; ///< one byte per pixel: f->store_32(IMAGE_FORMAT_ ); break; 0-255 - case Image::FORMAT_GRAYSCALE_ALPHA: f->store_32(IMAGE_FORMAT_GRAYSCALE_ALPHA ); break; ///< two bytes per pixel: f->store_32(IMAGE_FORMAT_ ); break; 0-255. alpha 0-255 - case Image::FORMAT_RGB: f->store_32(IMAGE_FORMAT_RGB ); break; ///< one byte R: f->store_32(IMAGE_FORMAT_ ); break; one byte G: f->store_32(IMAGE_FORMAT_ ); break; one byte B - case Image::FORMAT_RGBA: f->store_32(IMAGE_FORMAT_RGBA ); break; ///< one byte R: f->store_32(IMAGE_FORMAT_ ); break; one byte G: f->store_32(IMAGE_FORMAT_ ); break; one byte B: f->store_32(IMAGE_FORMAT_ ); break; one byte A - case Image::FORMAT_INDEXED: f->store_32(IMAGE_FORMAT_INDEXED ); break; ///< index byte 0-256: f->store_32(IMAGE_FORMAT_ ); break; and after image end: f->store_32(IMAGE_FORMAT_ ); break; 256*3 bytes of palette - case Image::FORMAT_INDEXED_ALPHA: f->store_32(IMAGE_FORMAT_INDEXED_ALPHA ); break; ///< index byte 0-256: f->store_32(IMAGE_FORMAT_ ); break; and after image end: f->store_32(IMAGE_FORMAT_ ); break; 256*4 bytes of palette (alpha) - case Image::FORMAT_BC1: f->store_32(IMAGE_FORMAT_BC1 ); break; // DXT1 - case Image::FORMAT_BC2: f->store_32(IMAGE_FORMAT_BC2 ); break; // DXT3 - case Image::FORMAT_BC3: f->store_32(IMAGE_FORMAT_BC3 ); break; // DXT5 - case Image::FORMAT_BC4: f->store_32(IMAGE_FORMAT_BC4 ); break; // ATI1 - case Image::FORMAT_BC5: f->store_32(IMAGE_FORMAT_BC5 ); break; // ATI2 - case Image::FORMAT_PVRTC2: f->store_32(IMAGE_FORMAT_PVRTC2 ); break; - case Image::FORMAT_PVRTC2_ALPHA: f->store_32(IMAGE_FORMAT_PVRTC2_ALPHA ); break; - case Image::FORMAT_PVRTC4: f->store_32(IMAGE_FORMAT_PVRTC4 ); break; - case Image::FORMAT_PVRTC4_ALPHA: f->store_32(IMAGE_FORMAT_PVRTC4_ALPHA ); break; - case Image::FORMAT_ETC: f->store_32(IMAGE_FORMAT_ETC); break; - case Image::FORMAT_ATC: f->store_32(IMAGE_FORMAT_ATC); break; - case Image::FORMAT_ATC_ALPHA_EXPLICIT: f->store_32(IMAGE_FORMAT_ATC_ALPHA_EXPLICIT); break; - case Image::FORMAT_ATC_ALPHA_INTERPOLATED: f->store_32(IMAGE_FORMAT_ATC_ALPHA_INTERPOLATED); break; - case Image::FORMAT_CUSTOM: f->store_32(IMAGE_FORMAT_CUSTOM ); break; - default: {} - - } + f->store_32(val.has_mipmaps()); + f->store_32(val.get_format()); //if format changes we can add a compatibility version bit int dlen = val.get_data().size(); f->store_32(dlen); - DVector<uint8_t>::Read r = val.get_data().read(); + PoolVector<uint8_t>::Read r = val.get_data().read(); f->store_buffer(r.ptr(),dlen); _pad_buffer(dlen); } else { - DVector<uint8_t> data; + PoolVector<uint8_t> data; if (encoding==IMAGE_ENCODING_LOSSY) { data=Image::lossy_packer(val,quality); @@ -1668,7 +1632,7 @@ void ResourceFormatSaverBinaryInstance::write_variant(const Variant& p_property, int ds=data.size(); f->store_32(ds); if (ds>0) { - DVector<uint8_t>::Read r = data.read(); + PoolVector<uint8_t>::Read r = data.read(); f->store_buffer(r.ptr(),ds); _pad_buffer(ds); @@ -1764,59 +1728,59 @@ void ResourceFormatSaverBinaryInstance::write_variant(const Variant& p_property, } } break; - case Variant::RAW_ARRAY: { + case Variant::POOL_BYTE_ARRAY: { f->store_32(VARIANT_RAW_ARRAY); - DVector<uint8_t> arr = p_property; + PoolVector<uint8_t> arr = p_property; int len=arr.size(); f->store_32(len); - DVector<uint8_t>::Read r = arr.read(); + PoolVector<uint8_t>::Read r = arr.read(); f->store_buffer(r.ptr(),len); _pad_buffer(len); } break; - case Variant::INT_ARRAY: { + case Variant::POOL_INT_ARRAY: { f->store_32(VARIANT_INT_ARRAY); - DVector<int> arr = p_property; + PoolVector<int> arr = p_property; int len=arr.size(); f->store_32(len); - DVector<int>::Read r = arr.read(); + PoolVector<int>::Read r = arr.read(); for(int i=0;i<len;i++) f->store_32(r[i]); } break; - case Variant::REAL_ARRAY: { + case Variant::POOL_REAL_ARRAY: { f->store_32(VARIANT_REAL_ARRAY); - DVector<real_t> arr = p_property; + PoolVector<real_t> arr = p_property; int len=arr.size(); f->store_32(len); - DVector<real_t>::Read r = arr.read(); + PoolVector<real_t>::Read r = arr.read(); for(int i=0;i<len;i++) { f->store_real(r[i]); } } break; - case Variant::STRING_ARRAY: { + case Variant::POOL_STRING_ARRAY: { f->store_32(VARIANT_STRING_ARRAY); - DVector<String> arr = p_property; + PoolVector<String> arr = p_property; int len=arr.size(); f->store_32(len); - DVector<String>::Read r = arr.read(); + PoolVector<String>::Read r = arr.read(); for(int i=0;i<len;i++) { save_unicode_string(r[i]); } } break; - case Variant::VECTOR3_ARRAY: { + case Variant::POOL_VECTOR3_ARRAY: { f->store_32(VARIANT_VECTOR3_ARRAY); - DVector<Vector3> arr = p_property; + PoolVector<Vector3> arr = p_property; int len=arr.size(); f->store_32(len); - DVector<Vector3>::Read r = arr.read(); + PoolVector<Vector3>::Read r = arr.read(); for(int i=0;i<len;i++) { f->store_real(r[i].x); f->store_real(r[i].y); @@ -1824,26 +1788,26 @@ void ResourceFormatSaverBinaryInstance::write_variant(const Variant& p_property, } } break; - case Variant::VECTOR2_ARRAY: { + case Variant::POOL_VECTOR2_ARRAY: { f->store_32(VARIANT_VECTOR2_ARRAY); - DVector<Vector2> arr = p_property; + PoolVector<Vector2> arr = p_property; int len=arr.size(); f->store_32(len); - DVector<Vector2>::Read r = arr.read(); + PoolVector<Vector2>::Read r = arr.read(); for(int i=0;i<len;i++) { f->store_real(r[i].x); f->store_real(r[i].y); } } break; - case Variant::COLOR_ARRAY: { + case Variant::POOL_COLOR_ARRAY: { f->store_32(VARIANT_COLOR_ARRAY); - DVector<Color> arr = p_property; + PoolVector<Color> arr = p_property; int len=arr.size(); f->store_32(len); - DVector<Color>::Read r = arr.read(); + PoolVector<Color>::Read r = arr.read(); for(int i=0;i<len;i++) { f->store_real(r[i].r); f->store_real(r[i].g); @@ -1889,7 +1853,7 @@ void ResourceFormatSaverBinaryInstance::_find_resources(const Variant& p_variant for(List<PropertyInfo>::Element *E=property_list.front();E;E=E->next()) { - if (E->get().usage&PROPERTY_USAGE_STORAGE || (bundle_resources && E->get().usage&PROPERTY_USAGE_BUNDLE)) { + if (E->get().usage&PROPERTY_USAGE_STORAGE) { _find_resources(res->get(E->get().name)); } @@ -2066,7 +2030,7 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path,const RES& p_ } //f->store_32(saved_resources.size()+external_resources.size()); // load steps -not needed - save_unicode_string(p_resource->get_type()); + save_unicode_string(p_resource->get_class()); uint64_t md_at = f->get_pos(); f->store_64(0); //offset to impoty metadata for(int i=0;i<14;i++) @@ -2083,7 +2047,7 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path,const RES& p_ ResourceData &rd = resources.push_back(ResourceData())->get(); - rd.type=E->get()->get_type(); + rd.type=E->get()->get_class(); List<PropertyInfo> property_list; E->get()->get_property_list( &property_list ); @@ -2092,7 +2056,7 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path,const RES& p_ if (skip_editor && F->get().name.begins_with("__editor")) continue; - if (F->get().usage&PROPERTY_USAGE_STORAGE || (bundle_resources && F->get().usage&PROPERTY_USAGE_BUNDLE)) { + if (F->get().usage&PROPERTY_USAGE_STORAGE ) { Property p; p.name_idx=get_string_index(F->get().name); p.value=E->get()->get(F->get().name); @@ -2128,7 +2092,7 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path,const RES& p_ for(int i=0;i<save_order.size();i++) { - save_unicode_string(save_order[i]->get_save_type()); + save_unicode_string(save_order[i]->get_save_class()); String path = save_order[i]->get_path(); path=relative_paths?local_path.path_to_file(path):path; save_unicode_string(path); @@ -2256,7 +2220,7 @@ Error ResourceFormatSaverBinaryInstance::save(const String &p_path,const RES& p_ Error ResourceFormatSaverBinary::save(const String &p_path,const RES& p_resource,uint32_t p_flags) { - String local_path = Globals::get_singleton()->localize_path(p_path); + String local_path = GlobalConfig::get_singleton()->localize_path(p_path); ResourceFormatSaverBinaryInstance saver; return saver.save(local_path,p_resource,p_flags); diff --git a/core/io/resource_format_binary.h b/core/io/resource_format_binary.h index b8be3080b8..611029e792 100644 --- a/core/io/resource_format_binary.h +++ b/core/io/resource_format_binary.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/resource_format_xml.cpp b/core/io/resource_format_xml.cpp deleted file mode 100644 index 44fbaf02ac..0000000000 --- a/core/io/resource_format_xml.cpp +++ /dev/null @@ -1,2889 +0,0 @@ -/*************************************************************************/ -/* resource_format_xml.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "resource_format_xml.h" -#include "globals.h" -#include "version.h" -#include "os/dir_access.h" - - -ResourceInteractiveLoaderXML::Tag* ResourceInteractiveLoaderXML::parse_tag(bool *r_exit, bool p_printerr, List<String> *r_order) { - - - while(get_char()!='<' && !f->eof_reached()) {} - if (f->eof_reached()) { - return NULL; - } - - Tag tag; - bool exit=false; - if (r_exit) - *r_exit=false; - - bool complete=false; - while(!f->eof_reached()) { - - CharType c=get_char(); - if (c<33 && tag.name.length() && !exit) { - break; - } else if (c=='>') { - complete=true; - break; - } else if (c=='/') { - exit=true; - } else { - tag.name+=c; - } - } - - if (f->eof_reached()) { - - return NULL; - } - - if (exit) { - if (!tag_stack.size()) { - if (!p_printerr) - return NULL; - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Unmatched exit tag </"+tag.name+">"); - ERR_FAIL_COND_V(!tag_stack.size(),NULL); - } - - if (tag_stack.back()->get().name!=tag.name) { - if (!p_printerr) - return NULL; - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Mismatched exit tag. Got </"+tag.name+">, expected </"+tag_stack.back()->get().name+">"); - ERR_FAIL_COND_V(tag_stack.back()->get().name!=tag.name,NULL); - } - - if (!complete) { - while(get_char()!='>' && !f->eof_reached()) {} - if (f->eof_reached()) - return NULL; - } - - if (r_exit) - *r_exit=true; - - tag_stack.pop_back(); - return NULL; - - } - - if (!complete) { - String name; - CharString r_value; - bool reading_value=false; - - while(!f->eof_reached()) { - - CharType c=get_char(); - if (c=='>') { - if (r_value.size()) { - - r_value.push_back(0); - String str; - str.parse_utf8(r_value.get_data()); - tag.args[name]=str; - if (r_order) - r_order->push_back(name); - } - break; - - } else if ( ((!reading_value && (c<33)) || c=='=' || c=='"' || c=='\'') && tag.name.length()) { - - if (!reading_value && name.length()) { - - reading_value=true; - } else if (reading_value && r_value.size()) { - - r_value.push_back(0); - String str; - str.parse_utf8(r_value.get_data()); - tag.args[name]=str; - if (r_order) - r_order->push_back(name); - name=""; - r_value.clear(); - reading_value=false; - } - - } else if (reading_value) { - - r_value.push_back(c); - } else { - - name+=c; - } - } - - if (f->eof_reached()) - return NULL; - } - - tag_stack.push_back(tag); - - return &tag_stack.back()->get(); -} - - -Error ResourceInteractiveLoaderXML::close_tag(const String& p_name) { - - int level=0; - bool inside_tag=false; - - while(true) { - - if (f->eof_reached()) { - - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": EOF found while attempting to find </"+p_name+">"); - ERR_FAIL_COND_V( f->eof_reached(), ERR_FILE_CORRUPT ); - } - - uint8_t c = get_char(); - - if (c == '<') { - - if (inside_tag) { - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Malformed XML. Already inside Tag."); - ERR_FAIL_COND_V(inside_tag,ERR_FILE_CORRUPT); - } - inside_tag=true; - c = get_char(); - if (c == '/') { - - --level; - } else { - - ++level; - }; - } else if (c == '>') { - - if (!inside_tag) { - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Malformed XML. Already outside Tag"); - ERR_FAIL_COND_V(!inside_tag,ERR_FILE_CORRUPT); - } - inside_tag=false; - if (level == -1) { - tag_stack.pop_back(); - return OK; - }; - }; - } - - return OK; -} - -void ResourceInteractiveLoaderXML::unquote(String& p_str) { - - - p_str=p_str.strip_edges().replace("\"","").xml_unescape(); - - /*p_str=p_str.strip_edges(); - p_str=p_str.replace("\"",""); - p_str=p_str.replace(">","<"); - p_str=p_str.replace("<",">"); - p_str=p_str.replace("'","'"); - p_str=p_str.replace(""","\""); - for (int i=1;i<32;i++) { - - char chr[2]={i,0}; - p_str=p_str.replace("&#"+String::num(i)+";",chr); - } - p_str=p_str.replace("&","&"); -*/ - //p_str.parse_utf8( p_str.ascii(true).get_data() ); - -} - -Error ResourceInteractiveLoaderXML::goto_end_of_tag() { - - uint8_t c; - while(true) { - - c=get_char(); - if (c=='>') //closetag - break; - if (f->eof_reached()) { - - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": EOF found while attempting to find close tag."); - ERR_FAIL_COND_V( f->eof_reached(), ERR_FILE_CORRUPT ); - } - - } - tag_stack.pop_back(); - - return OK; -} - - -Error ResourceInteractiveLoaderXML::parse_property_data(String &r_data) { - - r_data=""; - CharString cs; - while(true) { - - CharType c=get_char(); - if (c=='<') - break; - ERR_FAIL_COND_V(f->eof_reached(),ERR_FILE_CORRUPT); - cs.push_back(c); - } - - cs.push_back(0); - - r_data.parse_utf8(cs.get_data()); - - while(get_char()!='>' && !f->eof_reached()) {} - if (f->eof_reached()) { - - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Malformed XML."); - ERR_FAIL_COND_V( f->eof_reached(), ERR_FILE_CORRUPT ); - } - - r_data=r_data.strip_edges(); - tag_stack.pop_back(); - - return OK; -} - - -Error ResourceInteractiveLoaderXML::_parse_array_element(Vector<char> &buff,bool p_number_only,FileAccess *f,bool *end) { - - if (buff.empty()) - buff.resize(32); // optimi - - int buff_max=buff.size(); - int buff_size=0; - *end=false; - char *buffptr=&buff[0]; - bool found=false; - bool quoted=false; - - while(true) { - - char c=get_char(); - - if (c==0) { - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": File corrupt (zero found)."); - ERR_FAIL_V(ERR_FILE_CORRUPT); - } else if (c=='"') { - quoted=!quoted; - } else if ((!quoted && ((p_number_only && c<33) || c==',')) || c=='<') { - - - if (c=='<') { - *end=true; - break; - } - if (c<32 && f->eof_reached()) { - *end=true; - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": File corrupt (unexpected EOF)."); - ERR_FAIL_V(ERR_FILE_CORRUPT); - } - - if (found) - break; - - } else { - - found=true; - if (buff_size>=buff_max) { - - buff_max++; - buff.resize(buff_max); - buffptr=buff.ptr(); - - } - - buffptr[buff_size]=c; - buff_size++; - } - } - - if (buff_size>=buff_max) { - - buff_max++; - buff.resize(buff_max); - - } - - buff[buff_size]=0; - buff_size++; - - return OK; -} - -Error ResourceInteractiveLoaderXML::parse_property(Variant& r_v, String &r_name) { - - bool exit; - Tag *tag = parse_tag(&exit); - - if (!tag) { - if (exit) // shouldn't have exited - return ERR_FILE_EOF; - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": File corrupt (No Property Tag)."); - ERR_FAIL_V(ERR_FILE_CORRUPT); - } - - r_v=Variant(); - r_name=""; - - - //ERR_FAIL_COND_V(tag->name!="property",ERR_FILE_CORRUPT); - //ERR_FAIL_COND_V(!tag->args.has("name"),ERR_FILE_CORRUPT); -// ERR_FAIL_COND_V(!tag->args.has("type"),ERR_FILE_CORRUPT); - - //String name=tag->args["name"]; - //ERR_FAIL_COND_V(name=="",ERR_FILE_CORRUPT); - String type=tag->name; - String name=tag->args["name"]; - - if (type=="") { - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": 'type' field is empty."); - ERR_FAIL_COND_V(type=="",ERR_FILE_CORRUPT); - } - - if (type=="dictionary") { - - Dictionary d( tag->args.has("shared") && (String(tag->args["shared"])=="true" || String(tag->args["shared"])=="1")); - - while(true) { - - Error err; - String tagname; - Variant key; - - int dictline = get_current_line(); - - - err=parse_property(key,tagname); - - if (err && err!=ERR_FILE_EOF) { - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Error parsing dictionary: "+name+" (from line "+itos(dictline)+")"); - ERR_FAIL_COND_V(err && err!=ERR_FILE_EOF,err); - } - //ERR_FAIL_COND_V(tagname!="key",ERR_FILE_CORRUPT); - if (err) - break; - Variant value; - err=parse_property(value,tagname); - if (err) { - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Error parsing dictionary: "+name+" (from line "+itos(dictline)+")"); - } - - ERR_FAIL_COND_V(err,err); - //ERR_FAIL_COND_V(tagname!="value",ERR_FILE_CORRUPT); - - d[key]=value; - } - - - //err=parse_property_data(name); // skip the rest - //ERR_FAIL_COND_V(err,err); - - r_name=name; - r_v=d; - return OK; - - } else if (type=="array") { - - if (!tag->args.has("len")) { - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Array missing 'len' field: "+name); - ERR_FAIL_COND_V(!tag->args.has("len"),ERR_FILE_CORRUPT); - } - - - int len=tag->args["len"].to_int(); - bool shared = tag->args.has("shared") && (String(tag->args["shared"])=="true" || String(tag->args["shared"])=="1"); - - Array array(shared); - array.resize(len); - - Error err; - Variant v; - String tagname; - int idx=0; - while( (err=parse_property(v,tagname))==OK ) { - - ERR_CONTINUE( idx <0 || idx >=len ); - - array.set(idx,v); - idx++; - } - - if (idx!=len) { - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Error loading array (size mismatch): "+name); - ERR_FAIL_COND_V(idx!=len,err); - } - - if (err!=ERR_FILE_EOF) { - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Error loading array: "+name); - ERR_FAIL_COND_V(err!=ERR_FILE_EOF,err); - } - - //err=parse_property_data(name); // skip the rest - //ERR_FAIL_COND_V(err,err); - - r_name=name; - r_v=array; - return OK; - - } else if (type=="resource") { - - if (tag->args.has("path")) { - - String path=tag->args["path"]; - String hint; - if (tag->args.has("resource_type")) - hint=tag->args["resource_type"]; - - if (path.begins_with("local://")) - path=path.replace("local://",local_path+"::"); - else if (path.find("://")==-1 && path.is_rel_path()) { - // path is relative to file being loaded, so convert to a resource path - path=Globals::get_singleton()->localize_path(local_path.get_base_dir().plus_file(path)); - - } - - if (remaps.has(path)) { - path=remaps[path]; - } - - //take advantage of the resource loader cache. The resource is cached on it, even if - RES res=ResourceLoader::load(path,hint); - - - if (res.is_null()) { - - WARN_PRINT(String("Couldn't load resource: "+path).ascii().get_data()); - } - - r_v=res.get_ref_ptr(); - } else if (tag->args.has("external")) { - - int index = tag->args["external"].to_int(); - if (ext_resources.has(index)) { - String path=ext_resources[index].path; - String type=ext_resources[index].type; - - //take advantage of the resource loader cache. The resource is cached on it, even if - RES res=ResourceLoader::load(path,type); - - if (res.is_null()) { - - WARN_PRINT(String("Couldn't load externalresource: "+path).ascii().get_data()); - } - - r_v=res.get_ref_ptr(); - } else { - WARN_PRINT(String("Invalid external resource index: "+itos(index)).ascii().get_data()); - - } - } - - - - - Error err=goto_end_of_tag(); - if (err) { - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Error closing <resource> tag."); - ERR_FAIL_COND_V(err,err); - } - - - r_name=name; - - return OK; - - } else if (type=="image") { - - if (!tag->args.has("encoding")) { - //empty image - r_v=Image(); - String sdfsdfg; - Error err=parse_property_data(sdfsdfg); - return OK; - } - - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Image missing 'encoding' field."); - ERR_FAIL_COND_V( !tag->args.has("encoding"), ERR_FILE_CORRUPT ); - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Image missing 'width' field."); - ERR_FAIL_COND_V( !tag->args.has("width"), ERR_FILE_CORRUPT ); - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Image missing 'height' field."); - ERR_FAIL_COND_V( !tag->args.has("height"), ERR_FILE_CORRUPT ); - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Image missing 'format' field."); - ERR_FAIL_COND_V( !tag->args.has("format"), ERR_FILE_CORRUPT ); - - String encoding=tag->args["encoding"]; - - if (encoding=="raw") { - String width=tag->args["width"]; - String height=tag->args["height"]; - String format=tag->args["format"]; - int mipmaps=tag->args.has("mipmaps")?int(tag->args["mipmaps"].to_int()):int(0); - int custom_size = tag->args.has("custom_size")?int(tag->args["custom_size"].to_int()):int(0); - - r_name=name; - - Image::Format imgformat; - - - if (format=="grayscale") { - imgformat=Image::FORMAT_GRAYSCALE; - } else if (format=="intensity") { - imgformat=Image::FORMAT_INTENSITY; - } else if (format=="grayscale_alpha") { - imgformat=Image::FORMAT_GRAYSCALE_ALPHA; - } else if (format=="rgb") { - imgformat=Image::FORMAT_RGB; - } else if (format=="rgba") { - imgformat=Image::FORMAT_RGBA; - } else if (format=="indexed") { - imgformat=Image::FORMAT_INDEXED; - } else if (format=="indexed_alpha") { - imgformat=Image::FORMAT_INDEXED_ALPHA; - } else if (format=="bc1") { - imgformat=Image::FORMAT_BC1; - } else if (format=="bc2") { - imgformat=Image::FORMAT_BC2; - } else if (format=="bc3") { - imgformat=Image::FORMAT_BC3; - } else if (format=="bc4") { - imgformat=Image::FORMAT_BC4; - } else if (format=="bc5") { - imgformat=Image::FORMAT_BC5; - } else if (format=="pvrtc2") { - imgformat=Image::FORMAT_PVRTC2; - } else if (format=="pvrtc2a") { - imgformat=Image::FORMAT_PVRTC2_ALPHA; - } else if (format=="pvrtc4") { - imgformat=Image::FORMAT_PVRTC4; - } else if (format=="pvrtc4a") { - imgformat=Image::FORMAT_PVRTC4_ALPHA; - } else if (format=="etc") { - imgformat=Image::FORMAT_ETC; - } else if (format=="atc") { - imgformat=Image::FORMAT_ATC; - } else if (format=="atcai") { - imgformat=Image::FORMAT_ATC_ALPHA_INTERPOLATED; - } else if (format=="atcae") { - imgformat=Image::FORMAT_ATC_ALPHA_EXPLICIT; - } else if (format=="custom") { - imgformat=Image::FORMAT_CUSTOM; - } else { - - ERR_FAIL_V( ERR_FILE_CORRUPT ); - } - - - int datasize; - int w=width.to_int(); - int h=height.to_int(); - - if (w == 0 && h == 0) { - //r_v = Image(w, h, imgformat); - r_v=Image(); - String sdfsdfg; - Error err=parse_property_data(sdfsdfg); - return OK; - }; - - if (imgformat==Image::FORMAT_CUSTOM) { - - datasize=custom_size; - } else { - - datasize = Image::get_image_data_size(h,w,imgformat,mipmaps); - } - - if (datasize==0) { - //r_v = Image(w, h, imgformat); - r_v=Image(); - String sdfsdfg; - Error err=parse_property_data(sdfsdfg); - return OK; - }; - - DVector<uint8_t> pixels; - pixels.resize(datasize); - DVector<uint8_t>::Write wb = pixels.write(); - - int idx=0; - uint8_t byte; - while( idx<datasize*2) { - - CharType c=get_char(); - - ERR_FAIL_COND_V(c=='<',ERR_FILE_CORRUPT); - - if ( (c>='0' && c<='9') || (c>='A' && c<='F') || (c>='a' && c<='f') ) { - - if (idx&1) { - - byte|=HEX2CHR(c); - wb[idx>>1]=byte; - } else { - - byte=HEX2CHR(c)<<4; - } - - idx++; - } - - } - ERR_FAIL_COND_V(f->eof_reached(),ERR_FILE_CORRUPT); - - wb=DVector<uint8_t>::Write(); - - r_v=Image(w,h,mipmaps,imgformat,pixels); - String sdfsdfg; - Error err=parse_property_data(sdfsdfg); - ERR_FAIL_COND_V(err,err); - - return OK; - } - - ERR_FAIL_V(ERR_FILE_CORRUPT); - - } else if (type=="raw_array") { - - if (!tag->args.has("len")) { - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": RawArray missing 'len' field: "+name); - ERR_FAIL_COND_V(!tag->args.has("len"),ERR_FILE_CORRUPT); - } - int len=tag->args["len"].to_int(); - - DVector<uint8_t> bytes; - bytes.resize(len); - DVector<uint8_t>::Write w=bytes.write(); - uint8_t *bytesptr=w.ptr(); - int idx=0; - uint8_t byte; - - while( idx<len*2) { - - CharType c=get_char(); - if (c<=32) - continue; - - if (idx&1) { - - byte|=HEX2CHR(c); - bytesptr[idx>>1]=byte; - //printf("%x\n",int(byte)); - } else { - - byte=HEX2CHR(c)<<4; - } - - idx++; - } - - ERR_FAIL_COND_V(f->eof_reached(),ERR_FILE_CORRUPT); - - w=DVector<uint8_t>::Write(); - r_v=bytes; - String sdfsdfg; - Error err=parse_property_data(sdfsdfg); - ERR_FAIL_COND_V(err,err); - r_name=name; - - return OK; - - } else if (type=="int_array") { - - if (!tag->args.has("len")) { - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Array missing 'len' field: "+name); - ERR_FAIL_COND_V(!tag->args.has("len"),ERR_FILE_CORRUPT); - } - int len=tag->args["len"].to_int(); - - DVector<int> ints; - ints.resize(len); - DVector<int>::Write w=ints.write(); - int *intsptr=w.ptr(); - int idx=0; - String str; -#if 0 - while( idx<len ) { - - - CharType c=get_char(); - ERR_FAIL_COND_V(f->eof_reached(),ERR_FILE_CORRUPT); - - if (c<33 || c==',' || c=='<') { - - if (str.length()) { - - intsptr[idx]=str.to_int(); - str=""; - idx++; - } - - if (c=='<') { - - while(get_char()!='>' && !f->eof_reached()) {} - ERR_FAIL_COND_V(f->eof_reached(),ERR_FILE_CORRUPT); - break; - } - - } else { - - str+=c; - } - } - -#else - - Vector<char> tmpdata; - - while( idx<len ) { - - bool end=false; - Error err = _parse_array_element(tmpdata,true,f,&end); - ERR_FAIL_COND_V(err,err); - - intsptr[idx]=String::to_int(&tmpdata[0]); - idx++; - if (end) - break; - - } - -#endif - w=DVector<int>::Write(); - - r_v=ints; - Error err=goto_end_of_tag(); - ERR_FAIL_COND_V(err,err); - r_name=name; - - return OK; - } else if (type=="real_array") { - - if (!tag->args.has("len")) { - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Array missing 'len' field: "+name); - ERR_FAIL_COND_V(!tag->args.has("len"),ERR_FILE_CORRUPT); - } - int len=tag->args["len"].to_int();; - - DVector<real_t> reals; - reals.resize(len); - DVector<real_t>::Write w=reals.write(); - real_t *realsptr=w.ptr(); - int idx=0; - String str; - - -#if 0 - while( idx<len ) { - - - CharType c=get_char(); - ERR_FAIL_COND_V(f->eof_reached(),ERR_FILE_CORRUPT); - - - if (c<33 || c==',' || c=='<') { - - if (str.length()) { - - realsptr[idx]=str.to_double(); - str=""; - idx++; - } - - if (c=='<') { - - while(get_char()!='>' && !f->eof_reached()) {} - ERR_FAIL_COND_V(f->eof_reached(),ERR_FILE_CORRUPT); - break; - } - - } else { - - str+=c; - } - } - -#else - - - - Vector<char> tmpdata; - - while( idx<len ) { - - bool end=false; - Error err = _parse_array_element(tmpdata,true,f,&end); - ERR_FAIL_COND_V(err,err); - - realsptr[idx]=String::to_double(&tmpdata[0]); - idx++; - - if (end) - break; - } - -#endif - - w=DVector<real_t>::Write(); - r_v=reals; - - Error err=goto_end_of_tag(); - ERR_FAIL_COND_V(err,err); - r_name=name; - - return OK; - } else if (type=="string_array") { -#if 0 - if (!tag->args.has("len")) { - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Array missing 'len' field: "+name); - ERR_FAIL_COND_V(!tag->args.has("len"),ERR_FILE_CORRUPT); - } - int len=tag->args["len"].to_int(); - - DVector<String> strings; - strings.resize(len); - DVector<String>::Write w=strings.write(); - String *stringsptr=w.ptr(); - int idx=0; - String str; - - bool inside_str=false; - CharString cs; - while( idx<len ) { - - - CharType c=get_char(); - ERR_FAIL_COND_V(f->eof_reached(),ERR_FILE_CORRUPT); - - - if (c=='"') { - if (inside_str) { - - cs.push_back(0); - String str; - str.parse_utf8(cs.get_data()); - unquote(str); - stringsptr[idx]=str; - cs.clear(); - idx++; - inside_str=false; - } else { - inside_str=true; - } - } else if (c=='<') { - - while(get_char()!='>' && !f->eof_reached()) {} - ERR_FAIL_COND_V(f->eof_reached(),ERR_FILE_CORRUPT); - break; - - - } else if (inside_str){ - - cs.push_back(c); - } - } - w=DVector<String>::Write(); - r_v=strings; - String sdfsdfg; - Error err=parse_property_data(sdfsdfg); - ERR_FAIL_COND_V(err,err); - - r_name=name; - - return OK; -#endif - if (!tag->args.has("len")) { - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": String Array missing 'len' field: "+name); - ERR_FAIL_COND_V(!tag->args.has("len"),ERR_FILE_CORRUPT); - } - - - int len=tag->args["len"].to_int(); - - StringArray array; - array.resize(len); - DVector<String>::Write w = array.write(); - - Error err; - Variant v; - String tagname; - int idx=0; - - - while( (err=parse_property(v,tagname))==OK ) { - - ERR_CONTINUE( idx <0 || idx >=len ); - String str = v; //convert back to string - w[idx]=str; - idx++; - } - - if (idx!=len) { - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Error loading array (size mismatch): "+name); - ERR_FAIL_COND_V(idx!=len,err); - } - - if (err!=ERR_FILE_EOF) { - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Error loading array: "+name); - ERR_FAIL_COND_V(err!=ERR_FILE_EOF,err); - } - - //err=parse_property_data(name); // skip the rest - //ERR_FAIL_COND_V(err,err); - - r_name=name; - r_v=array; - return OK; - - } else if (type=="vector3_array") { - - if (!tag->args.has("len")) { - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Array missing 'len' field: "+name); - ERR_FAIL_COND_V(!tag->args.has("len"),ERR_FILE_CORRUPT); - } - int len=tag->args["len"].to_int();; - - DVector<Vector3> vectors; - vectors.resize(len); - DVector<Vector3>::Write w=vectors.write(); - Vector3 *vectorsptr=w.ptr(); - int idx=0; - int subidx=0; - Vector3 auxvec; - String str; - -// uint64_t tbegin = OS::get_singleton()->get_ticks_usec(); -#if 0 - while( idx<len ) { - - - CharType c=get_char(); - ERR_FAIL_COND_V(f->eof_reached(),ERR_FILE_CORRUPT); - - - if (c<33 || c==',' || c=='<') { - - if (str.length()) { - - auxvec[subidx]=str.to_double(); - subidx++; - str=""; - if (subidx==3) { - vectorsptr[idx]=auxvec; - - idx++; - subidx=0; - } - } - - if (c=='<') { - - while(get_char()!='>' && !f->eof_reached()) {} - ERR_FAIL_COND_V(f->eof_reached(),ERR_FILE_CORRUPT); - break; - } - - } else { - - str+=c; - } - } -#else - - Vector<char> tmpdata; - - while( idx<len ) { - - bool end=false; - Error err = _parse_array_element(tmpdata,true,f,&end); - ERR_FAIL_COND_V(err,err); - - - auxvec[subidx]=String::to_double(&tmpdata[0]); - subidx++; - if (subidx==3) { - vectorsptr[idx]=auxvec; - - idx++; - subidx=0; - } - - if (end) - break; - } - - - -#endif - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Premature end of vector3 array"); - ERR_FAIL_COND_V(idx<len,ERR_FILE_CORRUPT); -// double time_taken = (OS::get_singleton()->get_ticks_usec() - tbegin)/1000000.0; - - - w=DVector<Vector3>::Write(); - r_v=vectors; - String sdfsdfg; - Error err=goto_end_of_tag(); - ERR_FAIL_COND_V(err,err); - r_name=name; - - return OK; - - } else if (type=="vector2_array") { - - if (!tag->args.has("len")) { - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Array missing 'len' field: "+name); - ERR_FAIL_COND_V(!tag->args.has("len"),ERR_FILE_CORRUPT); - } - int len=tag->args["len"].to_int();; - - DVector<Vector2> vectors; - vectors.resize(len); - DVector<Vector2>::Write w=vectors.write(); - Vector2 *vectorsptr=w.ptr(); - int idx=0; - int subidx=0; - Vector2 auxvec; - String str; - -// uint64_t tbegin = OS::get_singleton()->get_ticks_usec(); -#if 0 - while( idx<len ) { - - - CharType c=get_char(); - ERR_FAIL_COND_V(f->eof_reached(),ERR_FILE_CORRUPT); - - - if (c<22 || c==',' || c=='<') { - - if (str.length()) { - - auxvec[subidx]=str.to_double(); - subidx++; - str=""; - if (subidx==2) { - vectorsptr[idx]=auxvec; - - idx++; - subidx=0; - } - } - - if (c=='<') { - - while(get_char()!='>' && !f->eof_reached()) {} - ERR_FAIL_COND_V(f->eof_reached(),ERR_FILE_CORRUPT); - break; - } - - } else { - - str+=c; - } - } -#else - - Vector<char> tmpdata; - - while( idx<len ) { - - bool end=false; - Error err = _parse_array_element(tmpdata,true,f,&end); - ERR_FAIL_COND_V(err,err); - - - auxvec[subidx]=String::to_double(&tmpdata[0]); - subidx++; - if (subidx==2) { - vectorsptr[idx]=auxvec; - - idx++; - subidx=0; - } - - if (end) - break; - } - - - -#endif - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Premature end of vector2 array"); - ERR_FAIL_COND_V(idx<len,ERR_FILE_CORRUPT); -// double time_taken = (OS::get_singleton()->get_ticks_usec() - tbegin)/1000000.0; - - - w=DVector<Vector2>::Write(); - r_v=vectors; - String sdfsdfg; - Error err=goto_end_of_tag(); - ERR_FAIL_COND_V(err,err); - r_name=name; - - return OK; - - } else if (type=="color_array") { - - if (!tag->args.has("len")) { - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Array missing 'len' field: "+name); - ERR_FAIL_COND_V(!tag->args.has("len"),ERR_FILE_CORRUPT); - } - int len=tag->args["len"].to_int();; - - DVector<Color> colors; - colors.resize(len); - DVector<Color>::Write w=colors.write(); - Color *colorsptr=w.ptr(); - int idx=0; - int subidx=0; - Color auxcol; - String str; - - while( idx<len ) { - - - CharType c=get_char(); - ERR_FAIL_COND_V(f->eof_reached(),ERR_FILE_CORRUPT); - - - if (c<33 || c==',' || c=='<') { - - if (str.length()) { - - auxcol[subidx]=str.to_double(); - subidx++; - str=""; - if (subidx==4) { - colorsptr[idx]=auxcol; - idx++; - subidx=0; - } - } - - if (c=='<') { - - while(get_char()!='>' && !f->eof_reached()) {} - ERR_FAIL_COND_V(f->eof_reached(),ERR_FILE_CORRUPT); - break; - } - - } else { - - str+=c; - } - } - w=DVector<Color>::Write(); - r_v=colors; - String sdfsdfg; - Error err=parse_property_data(sdfsdfg); - ERR_FAIL_COND_V(err,err); - r_name=name; - - return OK; - } - - - String data; - Error err = parse_property_data(data); - ERR_FAIL_COND_V(err!=OK,err); - - if (type=="nil") { - // uh do nothing - - } else if (type=="bool") { - // uh do nothing - if (data.nocasecmp_to("true")==0 || data.to_int()!=0) - r_v=true; - else - r_v=false; - } else if (type=="int") { - - r_v=data.to_int(); - } else if (type=="real") { - - r_v=data.to_double(); - } else if (type=="string") { - - String str=data; - unquote(str); - r_v=str; - } else if (type=="vector3") { - - - r_v=Vector3( - data.get_slicec(',',0).to_double(), - data.get_slicec(',',1).to_double(), - data.get_slicec(',',2).to_double() - ); - - } else if (type=="vector2") { - - - r_v=Vector2( - data.get_slicec(',',0).to_double(), - data.get_slicec(',',1).to_double() - ); - - } else if (type=="plane") { - - r_v=Plane( - data.get_slicec(',',0).to_double(), - data.get_slicec(',',1).to_double(), - data.get_slicec(',',2).to_double(), - data.get_slicec(',',3).to_double() - ); - - } else if (type=="quaternion") { - - r_v=Quat( - data.get_slicec(',',0).to_double(), - data.get_slicec(',',1).to_double(), - data.get_slicec(',',2).to_double(), - data.get_slicec(',',3).to_double() - ); - - } else if (type=="rect2") { - - r_v=Rect2( - Vector2( - data.get_slicec(',',0).to_double(), - data.get_slicec(',',1).to_double() - ), - Vector2( - data.get_slicec(',',2).to_double(), - data.get_slicec(',',3).to_double() - ) - ); - - - } else if (type=="aabb") { - - r_v=AABB( - Vector3( - data.get_slicec(',',0).to_double(), - data.get_slicec(',',1).to_double(), - data.get_slicec(',',2).to_double() - ), - Vector3( - data.get_slicec(',',3).to_double(), - data.get_slicec(',',4).to_double(), - data.get_slicec(',',5).to_double() - ) - ); - - } else if (type=="matrix32") { - - Matrix32 m3; - for (int i=0;i<3;i++) { - for (int j=0;j<2;j++) { - m3.elements[i][j]=data.get_slicec(',',i*2+j).to_double(); - } - } - r_v=m3; - - } else if (type=="matrix3") { - - Matrix3 m3; - for (int i=0;i<3;i++) { - for (int j=0;j<3;j++) { - m3.elements[i][j]=data.get_slicec(',',i*3+j).to_double(); - } - } - r_v=m3; - - } else if (type=="transform") { - - Transform tr; - for (int i=0;i<3;i++) { - for (int j=0;j<3;j++) { - tr.basis.elements[i][j]=data.get_slicec(',',i*3+j).to_double(); - } - - } - tr.origin=Vector3( - data.get_slicec(',',9).to_double(), - data.get_slicec(',',10).to_double(), - data.get_slicec(',',11).to_double() - ); - r_v=tr; - - } else if (type=="color") { - - r_v=Color( - data.get_slicec(',',0).to_double(), - data.get_slicec(',',1).to_double(), - data.get_slicec(',',2).to_double(), - data.get_slicec(',',3).to_double() - ); - - } else if (type=="node_path") { - - String str=data; - unquote(str); - r_v=NodePath( str ); - } else if (type=="input_event") { - - // ? - } else { - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Unrecognized tag in file: "+type); - ERR_FAIL_V(ERR_FILE_CORRUPT); - } - r_name=name; - return OK; -} - - - -int ResourceInteractiveLoaderXML::get_current_line() const { - - return lines; -} - - -uint8_t ResourceInteractiveLoaderXML::get_char() const { - - uint8_t c = f->get_8(); - if (c=='\n') - lines++; - return c; - -} - - - - -/// - -void ResourceInteractiveLoaderXML::set_local_path(const String& p_local_path) { - - res_path=p_local_path; -} - -Ref<Resource> ResourceInteractiveLoaderXML::get_resource() { - - return resource; -} -Error ResourceInteractiveLoaderXML::poll() { - - if (error!=OK) - return error; - - bool exit; - Tag *tag = parse_tag(&exit); - - - if (!tag) { - error=ERR_FILE_CORRUPT; - if (!exit) // shouldn't have exited - ERR_FAIL_V(error); - error=ERR_FILE_EOF; - return error; - } - - RES res; - //Object *obj=NULL; - - bool main; - - if (tag->name=="ext_resource") { - - error=ERR_FILE_CORRUPT; - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": <ext_resource> missing 'path' field."); - ERR_FAIL_COND_V(!tag->args.has("path"),ERR_FILE_CORRUPT); - - String type="Resource"; - if (tag->args.has("type")) - type=tag->args["type"]; - - String path = tag->args["path"]; - - - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": <ext_resource> can't use a local path, this is a bug?."); - ERR_FAIL_COND_V(path.begins_with("local://"),ERR_FILE_CORRUPT); - - if (path.find("://")==-1 && path.is_rel_path()) { - // path is relative to file being loaded, so convert to a resource path - path=Globals::get_singleton()->localize_path(local_path.get_base_dir().plus_file(path)); - } - - if (remaps.has(path)) { - path=remaps[path]; - } - - RES res = ResourceLoader::load(path,type); - - if (res.is_null()) { - - if (ResourceLoader::get_abort_on_missing_resources()) { - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": <ext_resource> referenced nonexistent resource at: "+path); - ERR_FAIL_V(error); - } else { - ResourceLoader::notify_dependency_error(local_path,path,type); - } - } else { - - resource_cache.push_back(res); - } - - if (tag->args.has("index")) { - ExtResource er; - er.path=path; - er.type=type; - ext_resources[tag->args["index"].to_int()]=er; - } - - - Error err = close_tag("ext_resource"); - if (err) - return error; - - - error=OK; - resource_current++; - return error; - - } else if (tag->name=="resource") { - - main=false; - } else if (tag->name=="main_resource") { - main=true; - } else { - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": unexpected main tag: "+tag->name); - error=ERR_FILE_CORRUPT; - ERR_FAIL_V(error); - } - - - String type; - String path; - int subres=0; - - if (!main) { - //loading resource - - error=ERR_FILE_CORRUPT; - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": <resource> missing 'len' field."); - ERR_FAIL_COND_V(!tag->args.has("path"),ERR_FILE_CORRUPT); - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": <resource> missing 'type' field."); - ERR_FAIL_COND_V(!tag->args.has("type"),ERR_FILE_CORRUPT); - path=tag->args["path"]; - - error=OK; - - if (path.begins_with("local://")) { - //built-in resource (but really external) - - path=path.replace("local://",""); - subres=path.to_int(); - path=local_path+"::"+path; - } - - - if (ResourceCache::has(path)) { - Error err = close_tag(tag->name); - if (err) { - error=ERR_FILE_CORRUPT; - } - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Unable to close <resource> tag."); - ERR_FAIL_COND_V( err, err ); - resource_current++; - error=OK; - return OK; - } - - type = tag->args["type"]; - } else { - type=resource_type; - } - - Object *obj = ObjectTypeDB::instance(type); - if (!obj) { - error=ERR_FILE_CORRUPT; - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Object of unrecognized type in file: "+type); - } - ERR_FAIL_COND_V(!obj,ERR_FILE_CORRUPT); - - Resource *r = obj->cast_to<Resource>(); - if (!r) { - error=ERR_FILE_CORRUPT; - memdelete(obj); //bye - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": Object type in resource field not a resource, type is: "+obj->get_type()); - ERR_FAIL_COND_V(!r,ERR_FILE_CORRUPT); - } - - res = RES( r ); - if (path!="") - r->set_path(path); - r->set_subindex(subres); - - //load properties - - while(true) { - - String name; - Variant v; - Error err; - err = parse_property(v,name); - if (err==ERR_FILE_EOF) //tag closed - break; - if (err!=OK) { - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": XML Parsing aborted."); - ERR_FAIL_COND_V(err!=OK,ERR_FILE_CORRUPT); - } - - obj->set(name,v); - } -#ifdef TOOLS_ENABLED - res->set_edited(false); -#endif - resource_cache.push_back(res); //keep it in mem until finished loading - resource_current++; - if (main) { - f->close(); - resource=res; - if (!ResourceCache::has(res_path)) { - resource->set_path(res_path); - } - error=ERR_FILE_EOF; - return error; - - } - error=OK; - return OK; -} - -int ResourceInteractiveLoaderXML::get_stage() const { - - return resource_current; -} -int ResourceInteractiveLoaderXML::get_stage_count() const { - - return resources_total;//+ext_resources; -} - -ResourceInteractiveLoaderXML::~ResourceInteractiveLoaderXML() { - - memdelete(f); -} - -void ResourceInteractiveLoaderXML::get_dependencies(FileAccess *f,List<String> *p_dependencies,bool p_add_types) { - - - open(f); - ERR_FAIL_COND(error!=OK); - - while(true) { - bool exit; - Tag *tag = parse_tag(&exit); - - - if (!tag) { - error=ERR_FILE_CORRUPT; - ERR_FAIL_COND(!exit); - error=ERR_FILE_EOF; - return; - } - - if (tag->name!="ext_resource") { - - return; - } - - error=ERR_FILE_CORRUPT; - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": <ext_resource> missing 'path' field."); - ERR_FAIL_COND(!tag->args.has("path")); - - String path = tag->args["path"]; - - ERR_EXPLAIN(local_path+":"+itos(get_current_line())+": <ext_resource> can't use a local path, this is a bug?."); - ERR_FAIL_COND(path.begins_with("local://")); - - if (path.find("://")==-1 && path.is_rel_path()) { - // path is relative to file being loaded, so convert to a resource path - path=Globals::get_singleton()->localize_path(local_path.get_base_dir().plus_file(path)); - } - - if (path.ends_with("*")) { - ERR_FAIL_COND(!tag->args.has("type")); - String type = tag->args["type"]; - path = ResourceLoader::guess_full_filename(path,type); - } - - if (p_add_types && tag->args.has("type")) { - path+="::"+tag->args["type"]; - } - - p_dependencies->push_back(path); - - Error err = close_tag("ext_resource"); - if (err) - return; - - error=OK; - } - -} - -Error ResourceInteractiveLoaderXML::rename_dependencies(FileAccess *p_f, const String &p_path,const Map<String,String>& p_map) { - - open(p_f); - ERR_FAIL_COND_V(error!=OK,error); - - //FileAccess - - bool old_format=false; - - FileAccess *fw = NULL; - - String base_path=local_path.get_base_dir(); - - while(true) { - bool exit; - List<String> order; - - Tag *tag = parse_tag(&exit,true,&order); - - bool done=false; - - if (!tag) { - if (fw) { - memdelete(fw); - } - error=ERR_FILE_CORRUPT; - ERR_FAIL_COND_V(!exit,error); - error=ERR_FILE_EOF; - - return error; - } - - if (tag->name=="ext_resource") { - - if (!tag->args.has("index") || !tag->args.has("path") || !tag->args.has("type")) { - old_format=true; - break; - } - - if (!fw) { - - fw=FileAccess::open(p_path+".depren",FileAccess::WRITE); - fw->store_line("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"); //no escape - fw->store_line("<resource_file type=\""+resource_type+"\" subresource_count=\""+itos(resources_total)+"\" version=\""+itos(VERSION_MAJOR)+"."+itos(VERSION_MINOR)+"\" version_name=\""+VERSION_FULL_NAME+"\">"); - - } - - String path = tag->args["path"]; - String index = tag->args["index"]; - String type = tag->args["type"]; - - - bool relative=false; - if (!path.begins_with("res://")) { - path=base_path.plus_file(path).simplify_path(); - relative=true; - } - - - if (p_map.has(path)) { - String np=p_map[path]; - path=np; - } - - if (relative) { - //restore relative - path=base_path.path_to_file(path); - } - - tag->args["path"]=path; - tag->args["index"]=index; - tag->args["type"]=type; - - } else { - - done=true; - } - - String tagt="\t<"; - if (exit) - tagt+="/"; - tagt+=tag->name; - - for(List<String>::Element *E=order.front();E;E=E->next()) { - tagt+=" "+E->get()+"=\""+tag->args[E->get()]+"\""; - } - tagt+=">"; - fw->store_line(tagt); - if (done) - break; - close_tag("ext_resource"); - fw->store_line("\t</ext_resource>"); - - } - - - if (old_format) { - if (fw) - memdelete(fw); - - DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); - da->remove(p_path+".depren"); - memdelete(da); - //fuck it, use the old approach; - - WARN_PRINT(("This file is old, so it can't refactor dependencies, opening and resaving: "+p_path).utf8().get_data()); - - Error err; - FileAccess *f2 = FileAccess::open(p_path,FileAccess::READ,&err); - if (err!=OK) { - ERR_FAIL_COND_V(err!=OK,ERR_FILE_CANT_OPEN); - } - - Ref<ResourceInteractiveLoaderXML> ria = memnew( ResourceInteractiveLoaderXML ); - ria->local_path=Globals::get_singleton()->localize_path(p_path); - ria->res_path=ria->local_path; - ria->remaps=p_map; - // ria->set_local_path( Globals::get_singleton()->localize_path(p_path) ); - ria->open(f2); - - err = ria->poll(); - - while(err==OK) { - err=ria->poll(); - } - - ERR_FAIL_COND_V(err!=ERR_FILE_EOF,ERR_FILE_CORRUPT); - RES res = ria->get_resource(); - ERR_FAIL_COND_V(!res.is_valid(),ERR_FILE_CORRUPT); - - return ResourceFormatSaverXML::singleton->save(p_path,res); - } - - if (!fw) { - - return OK; //nothing to rename, do nothing - } - - uint8_t c=f->get_8(); - while(!f->eof_reached()) { - fw->store_8(c); - c=f->get_8(); - } - f->close(); - - bool all_ok = fw->get_error()==OK; - - memdelete(fw); - - if (!all_ok) { - return ERR_CANT_CREATE; - } - - DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES); - da->remove(p_path); - da->rename(p_path+".depren",p_path); - memdelete(da); - - return OK; - -} - - -void ResourceInteractiveLoaderXML::open(FileAccess *p_f) { - - error=OK; - - lines=1; - f=p_f; - - - ResourceInteractiveLoaderXML::Tag *tag = parse_tag(); - if (!tag || tag->name!="?xml" || !tag->args.has("version") || !tag->args.has("encoding") || tag->args["encoding"]!="UTF-8") { - - error=ERR_FILE_CORRUPT; - ResourceLoader::notify_load_error("XML is invalid (missing header tags)"); - ERR_EXPLAIN("Not a XML:UTF-8 File: "+local_path); - ERR_FAIL(); - } - - tag_stack.clear(); - - tag = parse_tag(); - - - if (!tag || tag->name!="resource_file" || !tag->args.has("type") || !tag->args.has("version")) { - - ResourceLoader::notify_load_error(local_path+": XML is not a valid resource file."); - error=ERR_FILE_CORRUPT; - ERR_EXPLAIN("Unrecognized XML File: "+local_path); - ERR_FAIL(); - } - - - if (tag->args.has("subresource_count")) - resources_total=tag->args["subresource_count"].to_int(); - resource_current=0; - resource_type=tag->args["type"]; - - String version = tag->args["version"]; - if (version.get_slice_count(".")!=2) { - - error=ERR_FILE_CORRUPT; - ResourceLoader::notify_load_error(local_path+":XML version string is invalid: "+version); - ERR_EXPLAIN("Invalid Version String '"+version+"'' in file: "+local_path); - ERR_FAIL(); - } - - int major = version.get_slicec('.',0).to_int(); - if (major>VERSION_MAJOR) { - - error=ERR_FILE_UNRECOGNIZED; - ResourceLoader::notify_load_error(local_path+": File Format '"+version+"' is too new. Please upgrade to a newer engine version."); - ERR_EXPLAIN("File Format '"+version+"' is too new! Please upgrade to a a new engine version: "+local_path); - ERR_FAIL(); - - } - - /* - String preload_depts = "deps/"+local_path.md5_text(); - if (Globals::get_singleton()->has(preload_depts)) { - ext_resources.clear(); - //ignore external resources and use these - NodePath depts=Globals::get_singleton()->get(preload_depts); - - for(int i=0;i<depts.get_name_count();i++) { - ext_resources.push_back(depts.get_name(i)); - } - print_line(local_path+" - EXTERNAL RESOURCES: "+itos(ext_resources.size())); - } -*/ - -} - -String ResourceInteractiveLoaderXML::recognize(FileAccess *p_f) { - - error=OK; - - lines=1; - f=p_f; - - ResourceInteractiveLoaderXML::Tag *tag = parse_tag(); - if (!tag || tag->name!="?xml" || !tag->args.has("version") || !tag->args.has("encoding") || tag->args["encoding"]!="UTF-8") { - - - return ""; //unrecognized - } - - tag_stack.clear(); - - tag = parse_tag(); - - if (!tag || tag->name!="resource_file" || !tag->args.has("type") || !tag->args.has("version")) { - - return ""; //unrecognized - } - - return tag->args["type"]; - -} - -///////////////////// - -Ref<ResourceInteractiveLoader> ResourceFormatLoaderXML::load_interactive(const String &p_path, Error *r_error) { - - if (r_error) - *r_error=ERR_CANT_OPEN; - - Error err; - FileAccess *f = FileAccess::open(p_path,FileAccess::READ,&err); - - - if (err!=OK) { - - ERR_FAIL_COND_V(err!=OK,Ref<ResourceInteractiveLoader>()); - } - - Ref<ResourceInteractiveLoaderXML> ria = memnew( ResourceInteractiveLoaderXML ); - ria->local_path=Globals::get_singleton()->localize_path(p_path); - ria->res_path=ria->local_path; -// ria->set_local_path( Globals::get_singleton()->localize_path(p_path) ); - ria->open(f); - - return ria; -} - -void ResourceFormatLoaderXML::get_recognized_extensions_for_type(const String& p_type,List<String> *p_extensions) const { - - if (p_type=="") { - get_recognized_extensions(p_extensions); - return; - } - - List<String> extensions; - ObjectTypeDB::get_extensions_for_type(p_type,&extensions); - - extensions.sort(); - - for(List<String>::Element *E=extensions.front();E;E=E->next()) { - String ext = E->get().to_lower(); - if (ext=="res") - continue; - p_extensions->push_back("x"+ext); - } - - p_extensions->push_back("xml"); - - -} -void ResourceFormatLoaderXML::get_recognized_extensions(List<String> *p_extensions) const{ - - List<String> extensions; - ObjectTypeDB::get_resource_base_extensions(&extensions); - extensions.sort(); - - for(List<String>::Element *E=extensions.front();E;E=E->next()) { - String ext = E->get().to_lower(); - if (ext=="res") - continue; - p_extensions->push_back("x"+ext); - } - - p_extensions->push_back("xml"); -} - -bool ResourceFormatLoaderXML::handles_type(const String& p_type) const{ - - return true; -} -String ResourceFormatLoaderXML::get_resource_type(const String &p_path) const{ - - - String ext=p_path.extension().to_lower(); - if (!ext.begins_with("x")) //a lie but.. - return ""; - - FileAccess *f = FileAccess::open(p_path,FileAccess::READ); - if (!f) { - - return ""; //could not rwead - } - - Ref<ResourceInteractiveLoaderXML> ria = memnew( ResourceInteractiveLoaderXML ); - ria->local_path=Globals::get_singleton()->localize_path(p_path); - ria->res_path=ria->local_path; -// ria->set_local_path( Globals::get_singleton()->localize_path(p_path) ); - String r = ria->recognize(f); - return r; -} - - -void ResourceFormatLoaderXML::get_dependencies(const String& p_path,List<String> *p_dependencies,bool p_add_types) { - - FileAccess *f = FileAccess::open(p_path,FileAccess::READ); - if (!f) { - - ERR_FAIL(); - } - - Ref<ResourceInteractiveLoaderXML> ria = memnew( ResourceInteractiveLoaderXML ); - ria->local_path=Globals::get_singleton()->localize_path(p_path); - ria->res_path=ria->local_path; -// ria->set_local_path( Globals::get_singleton()->localize_path(p_path) ); - ria->get_dependencies(f,p_dependencies,p_add_types); - - -} - -Error ResourceFormatLoaderXML::rename_dependencies(const String &p_path,const Map<String,String>& p_map) { - - FileAccess *f = FileAccess::open(p_path,FileAccess::READ); - if (!f) { - - ERR_FAIL_V(ERR_CANT_OPEN); - } - - Ref<ResourceInteractiveLoaderXML> ria = memnew( ResourceInteractiveLoaderXML ); - ria->local_path=Globals::get_singleton()->localize_path(p_path); - ria->res_path=ria->local_path; -// ria->set_local_path( Globals::get_singleton()->localize_path(p_path) ); - return ria->rename_dependencies(f,p_path,p_map); -} - - -/****************************************************************************************/ -/****************************************************************************************/ -/****************************************************************************************/ -/****************************************************************************************/ -/****************************************************************************************/ -/****************************************************************************************/ -/****************************************************************************************/ -/****************************************************************************************/ -/****************************************************************************************/ -/****************************************************************************************/ -/****************************************************************************************/ -/****************************************************************************************/ -/****************************************************************************************/ - - - -void ResourceFormatSaverXMLInstance::escape(String& p_str) { - - p_str=p_str.replace("&","&"); - p_str=p_str.replace("<","<"); - p_str=p_str.replace(">",">"); - p_str=p_str.replace("'","'"); - p_str=p_str.replace("\"","""); - for (char i=1;i<32;i++) { - - char chr[2]={i,0}; - const char hexn[16]={'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'}; - const char hex[8]={'&','#','0','0',hexn[i>>4],hexn[i&0xf],';',0}; - - p_str=p_str.replace(chr,hex); - } - - -} -void ResourceFormatSaverXMLInstance::write_tabs(int p_diff) { - - for (int i=0;i<depth+p_diff;i++) { - - f->store_8('\t'); - } -} - -void ResourceFormatSaverXMLInstance::write_string(String p_str,bool p_escape) { - - /* write an UTF8 string */ - if (p_escape) - escape(p_str); - - f->store_string(p_str);; - /* - CharString cs=p_str.utf8(); - const char *data=cs.get_data(); - - while (*data) { - f->store_8(*data); - data++; - }*/ - - -} - -void ResourceFormatSaverXMLInstance::enter_tag(const char* p_tag,const String& p_args) { - - f->store_8('<'); - int cc = 0; - const char *c=p_tag; - while(*c) { - cc++; - c++; - } - f->store_buffer((const uint8_t*)p_tag,cc); - if (p_args.length()) { - f->store_8(' '); - f->store_string(p_args); - } - f->store_8('>'); - depth++; - -} -void ResourceFormatSaverXMLInstance::exit_tag(const char* p_tag) { - - depth--; - f->store_8('<'); - f->store_8('/'); - int cc = 0; - const char *c=p_tag; - while(*c) { - cc++; - c++; - } - f->store_buffer((const uint8_t*)p_tag,cc); - f->store_8('>'); - -} - -/* -static bool _check_type(const Variant& p_property) { - - if (p_property.get_type()==Variant::_RID) - return false; - if (p_property.get_type()==Variant::OBJECT) { - RES res = p_property; - if (res.is_null()) - return false; - } - - return true; -}*/ - -void ResourceFormatSaverXMLInstance::write_property(const String& p_name,const Variant& p_property,bool *r_ok) { - - if (r_ok) - *r_ok=false; - - const char* type; - String params; - bool oneliner=true; - - switch( p_property.get_type() ) { - - case Variant::NIL: type="nil"; break; - case Variant::BOOL: type="bool"; break; - case Variant::INT: type="int"; break; - case Variant::REAL: type="real"; break; - case Variant::STRING: type="string"; break; - case Variant::VECTOR2: type="vector2"; break; - case Variant::RECT2: type="rect2"; break; - case Variant::VECTOR3: type="vector3"; break; - case Variant::PLANE: type="plane"; break; - case Variant::_AABB: type="aabb"; break; - case Variant::QUAT: type="quaternion"; break; - case Variant::MATRIX32: type="matrix32"; break; - case Variant::MATRIX3: type="matrix3"; break; - case Variant::TRANSFORM: type="transform"; break; - case Variant::COLOR: type="color"; break; - case Variant::IMAGE: { - type="image"; - Image img=p_property; - if (img.empty()) { - write_tabs(); - enter_tag(type,"name=\""+p_name+"\""); - exit_tag(type); - if (r_ok) - *r_ok=true; - return; - } - params+="encoding=\"raw\""; - params+=" width=\""+itos(img.get_width())+"\""; - params+=" height=\""+itos(img.get_height())+"\""; - params+=" mipmaps=\""+itos(img.get_mipmaps())+"\""; - - switch(img.get_format()) { - - case Image::FORMAT_GRAYSCALE: params+=" format=\"grayscale\""; break; - case Image::FORMAT_INTENSITY: params+=" format=\"intensity\""; break; - case Image::FORMAT_GRAYSCALE_ALPHA: params+=" format=\"grayscale_alpha\""; break; - case Image::FORMAT_RGB: params+=" format=\"rgb\""; break; - case Image::FORMAT_RGBA: params+=" format=\"rgba\""; break; - case Image::FORMAT_INDEXED : params+=" format=\"indexed\""; break; - case Image::FORMAT_INDEXED_ALPHA: params+=" format=\"indexed_alpha\""; break; - case Image::FORMAT_BC1: params+=" format=\"bc1\""; break; - case Image::FORMAT_BC2: params+=" format=\"bc2\""; break; - case Image::FORMAT_BC3: params+=" format=\"bc3\""; break; - case Image::FORMAT_BC4: params+=" format=\"bc4\""; break; - case Image::FORMAT_BC5: params+=" format=\"bc5\""; break; - case Image::FORMAT_PVRTC2: params+=" format=\"pvrtc2\""; break; - case Image::FORMAT_PVRTC2_ALPHA: params+=" format=\"pvrtc2a\""; break; - case Image::FORMAT_PVRTC4: params+=" format=\"pvrtc4\""; break; - case Image::FORMAT_PVRTC4_ALPHA: params+=" format=\"pvrtc4a\""; break; - case Image::FORMAT_ETC: params+=" format=\"etc\""; break; - case Image::FORMAT_ATC: params+=" format=\"atc\""; break; - case Image::FORMAT_ATC_ALPHA_EXPLICIT: params+=" format=\"atcae\""; break; - case Image::FORMAT_ATC_ALPHA_INTERPOLATED: params+=" format=\"atcai\""; break; - case Image::FORMAT_CUSTOM: params+=" format=\"custom\" custom_size=\""+itos(img.get_data().size())+"\""; break; - default: {} - } - } break; - case Variant::NODE_PATH: type="node_path"; break; - case Variant::OBJECT: { - type="resource"; - RES res = p_property; - if (res.is_null()) { - write_tabs(); - enter_tag(type,"name=\""+p_name+"\""); - exit_tag(type); - if (r_ok) - *r_ok=true; - - return; // don't save it - } - - if (external_resources.has(res)) { - - params="external=\""+itos(external_resources[res])+"\""; - } else { - params="resource_type=\""+res->get_save_type()+"\""; - - - if (res->get_path().length() && res->get_path().find("::")==-1) { - //external resource - String path=relative_paths?local_path.path_to_file(res->get_path()):res->get_path(); - escape(path); - params+=" path=\""+path+"\""; - } else { - - //internal resource - ERR_EXPLAIN("Resource was not pre cached for the resource section, bug?"); - ERR_FAIL_COND(!resource_set.has(res)); - - params+=" path=\"local://"+itos(res->get_subindex())+"\""; - } - } - - } break; - case Variant::INPUT_EVENT: type="input_event"; break; - case Variant::DICTIONARY: type="dictionary"; params="shared=\""+String(p_property.is_shared()?"true":"false")+"\""; oneliner=false; break; - case Variant::ARRAY: type="array"; params="len=\""+itos(p_property.operator Array().size())+"\" shared=\""+String(p_property.is_shared()?"true":"false")+"\""; oneliner=false; break; - - case Variant::RAW_ARRAY: type="raw_array"; params="len=\""+itos(p_property.operator DVector < uint8_t >().size())+"\""; break; - case Variant::INT_ARRAY: type="int_array"; params="len=\""+itos(p_property.operator DVector < int >().size())+"\""; break; - case Variant::REAL_ARRAY: type="real_array"; params="len=\""+itos(p_property.operator DVector < real_t >().size())+"\""; break; - case Variant::STRING_ARRAY: oneliner=false; type="string_array"; params="len=\""+itos(p_property.operator DVector < String >().size())+"\""; break; - case Variant::VECTOR2_ARRAY: type="vector2_array"; params="len=\""+itos(p_property.operator DVector < Vector2 >().size())+"\""; break; - case Variant::VECTOR3_ARRAY: type="vector3_array"; params="len=\""+itos(p_property.operator DVector < Vector3 >().size())+"\""; break; - case Variant::COLOR_ARRAY: type="color_array"; params="len=\""+itos(p_property.operator DVector < Color >().size())+"\""; break; - default: { - - ERR_PRINT("Unknown Variant type."); - ERR_FAIL(); - } - - } - - write_tabs(); - - if (p_name!="") { - if (params.length()) - enter_tag(type,"name=\""+p_name+"\" "+params); - else - enter_tag(type,"name=\""+p_name+"\""); - } else { - if (params.length()) - enter_tag(type," "+params); - else - enter_tag(type,String()); - } - - if (!oneliner) - f->store_8('\n'); - else - f->store_8(' '); - - - switch( p_property.get_type() ) { - - case Variant::NIL: { - - } break; - case Variant::BOOL: { - - write_string( p_property.operator bool() ? "True":"False" ); - } break; - case Variant::INT: { - - write_string( itos(p_property.operator int()) ); - } break; - case Variant::REAL: { - - write_string( rtos(p_property.operator real_t()) ); - } break; - case Variant::STRING: { - - String str=p_property; - escape(str); - str="\""+str+"\""; - write_string( str,false ); - } break; - case Variant::VECTOR2: { - - Vector2 v = p_property; - write_string( rtoss(v.x) +", "+rtoss(v.y) ); - } break; - case Variant::RECT2: { - - Rect2 aabb = p_property; - write_string( rtoss(aabb.pos.x) +", "+rtoss(aabb.pos.y) +", "+rtoss(aabb.size.x) +", "+rtoss(aabb.size.y) ); - - } break; - case Variant::VECTOR3: { - - Vector3 v = p_property; - write_string( rtoss(v.x) +", "+rtoss(v.y)+", "+rtoss(v.z) ); - } break; - case Variant::PLANE: { - - Plane p = p_property; - write_string( rtoss(p.normal.x) +", "+rtoss(p.normal.y)+", "+rtoss(p.normal.z)+", "+rtoss(p.d) ); - - } break; - case Variant::_AABB: { - - AABB aabb = p_property; - write_string( rtoss(aabb.pos.x) +", "+rtoss(aabb.pos.y) +", "+rtoss(aabb.pos.z) +", "+rtoss(aabb.size.x) +", "+rtoss(aabb.size.y) +", "+rtoss(aabb.size.z) ); - - } break; - case Variant::QUAT: { - - Quat quat = p_property; - write_string( rtoss(quat.x)+", "+rtoss(quat.y)+", "+rtoss(quat.z)+", "+rtoss(quat.w)+", "); - - } break; - case Variant::MATRIX32: { - - String s; - Matrix32 m3 = p_property; - for (int i=0;i<3;i++) { - for (int j=0;j<2;j++) { - - if (i!=0 || j!=0) - s+=", "; - s+=rtoss( m3.elements[i][j] ); - } - } - - write_string(s); - - } break; - case Variant::MATRIX3: { - - String s; - Matrix3 m3 = p_property; - for (int i=0;i<3;i++) { - for (int j=0;j<3;j++) { - - if (i!=0 || j!=0) - s+=", "; - s+=rtoss( m3.elements[i][j] ); - } - } - - write_string(s); - - } break; - case Variant::TRANSFORM: { - - String s; - Transform t = p_property; - Matrix3 &m3 = t.basis; - for (int i=0;i<3;i++) { - for (int j=0;j<3;j++) { - - if (i!=0 || j!=0) - s+=", "; - s+=rtoss( m3.elements[i][j] ); - } - } - - s=s+", "+rtoss(t.origin.x) +", "+rtoss(t.origin.y)+", "+rtoss(t.origin.z); - - write_string(s); - } break; - - // misc types - case Variant::COLOR: { - - Color c = p_property; - write_string( rtoss(c.r) +", "+rtoss(c.g)+", "+rtoss(c.b)+", "+rtoss(c.a) ); - - } break; - case Variant::IMAGE: { - - String s; - Image img = p_property; - DVector<uint8_t> data = img.get_data(); - int len = data.size(); - DVector<uint8_t>::Read r = data.read(); - const uint8_t *ptr=r.ptr();; - for (int i=0;i<len;i++) { - - uint8_t byte = ptr[i]; - const char hex[16]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; - char str[3]={ hex[byte>>4], hex[byte&0xF], 0}; - s+=str; - } - - write_string(s); - } break; - case Variant::NODE_PATH: { - - String str=p_property; - escape(str); - str="\""+str+"\""; - write_string( str,false); - - } break; - - case Variant::OBJECT: { - /* this saver does not save resources in here - RES res = p_property; - - if (!res.is_null()) { - - String path=res->get_path(); - if (!res->is_shared() || !path.length()) { - // if no path, or path is from inside a scene - write_object( *res ); - } - - } - */ - - } break; - case Variant::INPUT_EVENT: { - - write_string( p_property.operator String() ); - } break; - case Variant::DICTIONARY: { - - Dictionary dict = p_property; - - - List<Variant> keys; - dict.get_key_list(&keys); - keys.sort(); - - for(List<Variant>::Element *E=keys.front();E;E=E->next()) { - - //if (!_check_type(dict[E->get()])) - // continue; - bool ok; - write_property("",E->get(),&ok); - ERR_CONTINUE(!ok); - - write_property("",dict[E->get()],&ok); - if (!ok) - write_property("",Variant()); //at least make the file consistent.. - } - - - - - } break; - case Variant::ARRAY: { - - Array array = p_property; - int len=array.size(); - for (int i=0;i<len;i++) { - - write_property("",array[i]); - - } - - } break; - - case Variant::RAW_ARRAY: { - - String s; - DVector<uint8_t> data = p_property; - int len = data.size(); - DVector<uint8_t>::Read r = data.read(); - const uint8_t *ptr=r.ptr();; - for (int i=0;i<len;i++) { - - uint8_t byte = ptr[i]; - const char hex[16]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; - char str[3]={ hex[byte>>4], hex[byte&0xF], 0}; - s+=str; - } - - write_string(s,false); - - } break; - case Variant::INT_ARRAY: { - - DVector<int> data = p_property; - int len = data.size(); - DVector<int>::Read r = data.read(); - const int *ptr=r.ptr();; - write_tabs(); - - for (int i=0;i<len;i++) { - - if (i>0) - write_string(", ",false); - - write_string(itos(ptr[i]),false); - } - - - - } break; - case Variant::REAL_ARRAY: { - - DVector<real_t> data = p_property; - int len = data.size(); - DVector<real_t>::Read r = data.read(); - const real_t *ptr=r.ptr();; - write_tabs(); - String cm=", " ; - - for (int i=0;i<len;i++) { - - if (i>0) - write_string(cm,false); - write_string(rtoss(ptr[i]),false); - } - - - } break; - case Variant::STRING_ARRAY: { - - DVector<String> data = p_property; - int len = data.size(); - DVector<String>::Read r = data.read(); - const String *ptr=r.ptr();; - String s; - //write_string("\n"); - - - - for (int i=0;i<len;i++) { - - write_tabs(0); - String str=ptr[i]; - escape(str); - write_string("<string> \""+str+"\" </string>\n",false); - } - } break; - case Variant::VECTOR2_ARRAY: { - - DVector<Vector2> data = p_property; - int len = data.size(); - DVector<Vector2>::Read r = data.read(); - const Vector2 *ptr=r.ptr();; - write_tabs(); - - for (int i=0;i<len;i++) { - - if (i>0) - write_string(", ",false); - write_string(rtoss(ptr[i].x),false); - write_string(", "+rtoss(ptr[i].y),false); - - } - - - } break; - case Variant::VECTOR3_ARRAY: { - - DVector<Vector3> data = p_property; - int len = data.size(); - DVector<Vector3>::Read r = data.read(); - const Vector3 *ptr=r.ptr();; - write_tabs(); - - for (int i=0;i<len;i++) { - - if (i>0) - write_string(", ",false); - write_string(rtoss(ptr[i].x),false); - write_string(", "+rtoss(ptr[i].y),false); - write_string(", "+rtoss(ptr[i].z),false); - - } - - - } break; - case Variant::COLOR_ARRAY: { - - DVector<Color> data = p_property; - int len = data.size(); - DVector<Color>::Read r = data.read(); - const Color *ptr=r.ptr();; - write_tabs(); - - for (int i=0;i<len;i++) { - - if (i>0) - write_string(", ",false); - - write_string(rtoss(ptr[i].r),false); - write_string(", "+rtoss(ptr[i].g),false); - write_string(", "+rtoss(ptr[i].b),false); - write_string(", "+rtoss(ptr[i].a),false); - - } - - } break; - default: {} - - } - if (oneliner) - f->store_8(' '); - else - write_tabs(-1); - exit_tag(type); - - f->store_8('\n'); - - if (r_ok) - *r_ok=true; - -} - - -void ResourceFormatSaverXMLInstance::_find_resources(const Variant& p_variant,bool p_main) { - - - switch(p_variant.get_type()) { - case Variant::OBJECT: { - - - RES res = p_variant.operator RefPtr(); - - if (res.is_null() || external_resources.has(res)) - return; - - if (!p_main && (!bundle_resources ) && res->get_path().length() && res->get_path().find("::") == -1 ) { - int index = external_resources.size(); - external_resources[res]=index; - return; - } - - if (resource_set.has(res)) - return; - - List<PropertyInfo> property_list; - - res->get_property_list( &property_list ); - property_list.sort(); - - List<PropertyInfo>::Element *I=property_list.front(); - - while(I) { - - PropertyInfo pi=I->get(); - - if (pi.usage&PROPERTY_USAGE_STORAGE || (bundle_resources && pi.usage&PROPERTY_USAGE_BUNDLE)) { - - Variant v=res->get(I->get().name); - _find_resources(v); - } - - I=I->next(); - } - - resource_set.insert( res ); //saved after, so the childs it needs are available when loaded - saved_resources.push_back(res); - - } break; - case Variant::ARRAY: { - - Array varray=p_variant; - int len=varray.size(); - for(int i=0;i<len;i++) { - - Variant v=varray.get(i); - _find_resources(v); - } - - } break; - case Variant::DICTIONARY: { - - Dictionary d=p_variant; - List<Variant> keys; - d.get_key_list(&keys); - for(List<Variant>::Element *E=keys.front();E;E=E->next()) { - - Variant v = d[E->get()]; - _find_resources(v); - } - } break; - default: {} - } - -} - - - -Error ResourceFormatSaverXMLInstance::save(const String &p_path,const RES& p_resource,uint32_t p_flags) { - - Error err; - f = FileAccess::open(p_path, FileAccess::WRITE,&err); - ERR_FAIL_COND_V( err, ERR_CANT_OPEN ); - FileAccessRef _fref(f); - - local_path = Globals::get_singleton()->localize_path(p_path); - - relative_paths=p_flags&ResourceSaver::FLAG_RELATIVE_PATHS; - skip_editor=p_flags&ResourceSaver::FLAG_OMIT_EDITOR_PROPERTIES; - bundle_resources=p_flags&ResourceSaver::FLAG_BUNDLE_RESOURCES; - takeover_paths=p_flags&ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS; - if (!p_path.begins_with("res://")) { - takeover_paths=false; - } - depth=0; - - // save resources - _find_resources(p_resource,true); - - ERR_FAIL_COND_V(err!=OK,err); - - write_string("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>",false); //no escape - write_string("\n",false); - enter_tag("resource_file","type=\""+p_resource->get_type()+"\" subresource_count=\""+itos(saved_resources.size()+external_resources.size())+"\" version=\""+itos(VERSION_MAJOR)+"."+itos(VERSION_MINOR)+"\" version_name=\""+VERSION_FULL_NAME+"\""); - write_string("\n",false); - - for(Map<RES,int>::Element *E=external_resources.front();E;E=E->next()) { - - write_tabs(); - String p = E->key()->get_path(); - - enter_tag("ext_resource","path=\""+p+"\" type=\""+E->key()->get_save_type()+"\" index=\""+itos(E->get())+"\""); //bundled - exit_tag("ext_resource"); //bundled - write_string("\n",false); - } - - Set<int> used_indices; - - for(List<RES>::Element *E=saved_resources.front();E;E=E->next()) { - - RES res = E->get(); - if (E->next() && (res->get_path()=="" || res->get_path().find("::") != -1 )) { - - if (res->get_subindex()!=0) { - if (used_indices.has(res->get_subindex())) { - res->set_subindex(0); //repeated - } else { - used_indices.insert(res->get_subindex()); - } - } - } - } - - for(List<RES>::Element *E=saved_resources.front();E;E=E->next()) { - - RES res = E->get(); - ERR_CONTINUE(!resource_set.has(res)); - bool main = (E->next()==NULL); - - write_tabs(); - - if (main) - enter_tag("main_resource",""); //bundled - else if (res->get_path().length() && res->get_path().find("::") == -1 ) - enter_tag("resource","type=\""+res->get_type()+"\" path=\""+res->get_path()+"\""); //bundled - else { - - if (res->get_subindex()==0) { - int new_subindex=1; - if (used_indices.size()) { - new_subindex=used_indices.back()->get()+1; - } - - res->set_subindex(new_subindex); - used_indices.insert(new_subindex); - } - - int idx = res->get_subindex(); - enter_tag("resource","type=\""+res->get_type()+"\" path=\"local://"+itos(idx)+"\""); - if (takeover_paths) { - res->set_path(p_path+"::"+itos(idx),true); - } -#ifdef TOOLS_ENABLED - res->set_edited(false); -#endif - - - } - write_string("\n",false); - - - List<PropertyInfo> property_list; - res->get_property_list(&property_list); -// property_list.sort(); - for(List<PropertyInfo>::Element *PE = property_list.front();PE;PE=PE->next()) { - - - if (skip_editor && PE->get().name.begins_with("__editor")) - continue; - - if (PE->get().usage&PROPERTY_USAGE_STORAGE || (bundle_resources && PE->get().usage&PROPERTY_USAGE_BUNDLE)) { - - String name = PE->get().name; - Variant value = res->get(name); - - - if ((PE->get().usage&PROPERTY_USAGE_STORE_IF_NONZERO && value.is_zero())||(PE->get().usage&PROPERTY_USAGE_STORE_IF_NONONE && value.is_one()) ) - continue; - - - write_property(name,value); - } - - - } - - write_string("\n",false); - write_tabs(-1); - if (main) - exit_tag("main_resource"); - else - exit_tag("resource"); - - write_string("\n",false); - } - - exit_tag("resource_file"); - if (f->get_error()!=OK && f->get_error()!=ERR_FILE_EOF) { - f->close(); - return ERR_CANT_CREATE; - } - - f->close(); - //memdelete(f); - - return OK; -} - - - -Error ResourceFormatSaverXML::save(const String &p_path,const RES& p_resource,uint32_t p_flags) { - - ResourceFormatSaverXMLInstance saver; - return saver.save(p_path,p_resource,p_flags); - -} - -bool ResourceFormatSaverXML::recognize(const RES& p_resource) const { - - - return true; // all recognized! -} -void ResourceFormatSaverXML::get_recognized_extensions(const RES& p_resource,List<String> *p_extensions) const { - - - //here comes the sun, lalalala - String base = p_resource->get_base_extension().to_lower(); - p_extensions->push_back("xml"); - if (base!="res") { - - p_extensions->push_back("x"+base); - } - -} - -ResourceFormatSaverXML* ResourceFormatSaverXML::singleton=NULL; -ResourceFormatSaverXML::ResourceFormatSaverXML() { - singleton=this; -} diff --git a/core/io/resource_format_xml.h b/core/io/resource_format_xml.h deleted file mode 100644 index 94c81a4111..0000000000 --- a/core/io/resource_format_xml.h +++ /dev/null @@ -1,170 +0,0 @@ -/*************************************************************************/ -/* resource_format_xml.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef RESOURCE_FORMAT_XML_H -#define RESOURCE_FORMAT_XML_H - -#include "io/resource_loader.h" -#include "io/resource_saver.h" -#include "os/file_access.h" - - - -class ResourceInteractiveLoaderXML : public ResourceInteractiveLoader { - - String local_path; - String res_path; - - FileAccess *f; - - struct Tag { - - String name; - HashMap<String,String> args; - - }; - - _FORCE_INLINE_ Error _parse_array_element(Vector<char> &buff,bool p_number_only,FileAccess *f,bool *end); - - - struct ExtResource { - String path; - String type; - }; - - - Map<String,String> remaps; - - Map<int,ExtResource> ext_resources; - - int resources_total; - int resource_current; - String resource_type; - - mutable int lines; - uint8_t get_char() const; - int get_current_line() const; - -friend class ResourceFormatLoaderXML; - List<Tag> tag_stack; - - List<RES> resource_cache; - Tag* parse_tag(bool* r_exit=NULL,bool p_printerr=true,List<String> *r_order=NULL); - Error close_tag(const String& p_name); - _FORCE_INLINE_ void unquote(String& p_str); - Error goto_end_of_tag(); - Error parse_property_data(String &r_data); - Error parse_property(Variant& r_v, String &r_name); - - Error error; - - RES resource; - -public: - - virtual void set_local_path(const String& p_local_path); - virtual Ref<Resource> get_resource(); - virtual Error poll(); - virtual int get_stage() const; - virtual int get_stage_count() const; - - void open(FileAccess *p_f); - String recognize(FileAccess *p_f); - void get_dependencies(FileAccess *p_f, List<String> *p_dependencies, bool p_add_types); - Error rename_dependencies(FileAccess *p_f, const String &p_path,const Map<String,String>& p_map); - - - ~ResourceInteractiveLoaderXML(); - -}; - -class ResourceFormatLoaderXML : public ResourceFormatLoader { -public: - - virtual Ref<ResourceInteractiveLoader> load_interactive(const String &p_path,Error *r_error=NULL); - virtual void get_recognized_extensions_for_type(const String& p_type,List<String> *p_extensions) const; - virtual void get_recognized_extensions(List<String> *p_extensions) const; - virtual bool handles_type(const String& p_type) const; - virtual String get_resource_type(const String &p_path) const; - virtual void get_dependencies(const String& p_path, List<String> *p_dependencies, bool p_add_types=false); - virtual Error rename_dependencies(const String &p_path,const Map<String,String>& p_map); - - -}; - - -//////////////////////////////////////////////////////////////////////////////////////////// - - -class ResourceFormatSaverXMLInstance { - - String local_path; - - - - bool takeover_paths; - bool relative_paths; - bool bundle_resources; - bool skip_editor; - FileAccess *f; - int depth; - Set<RES> resource_set; - List<RES> saved_resources; - Map<RES,int> external_resources; - - void enter_tag(const char* p_tag,const String& p_args=String()); - void exit_tag(const char* p_tag); - - void _find_resources(const Variant& p_variant,bool p_main=false); - void write_property(const String& p_name,const Variant& p_property,bool *r_ok=NULL); - - - void escape(String& p_str); - void write_tabs(int p_diff=0); - void write_string(String p_str,bool p_escape=true); - - -public: - - Error save(const String &p_path,const RES& p_resource,uint32_t p_flags=0); - - -}; - -class ResourceFormatSaverXML : public ResourceFormatSaver { -public: - static ResourceFormatSaverXML* singleton; - virtual Error save(const String &p_path,const RES& p_resource,uint32_t p_flags=0); - virtual bool recognize(const RES& p_resource) const; - virtual void get_recognized_extensions(const RES& p_resource,List<String> *p_extensions) const; - - ResourceFormatSaverXML(); -}; - - -#endif // RESOURCE_FORMAT_XML_H diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 08b4139047..cc3c8ce006 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -78,16 +78,16 @@ void ResourceLoader::get_recognized_extensions_for_type(const String& p_type,Lis void ResourceInteractiveLoader::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_resource"),&ResourceInteractiveLoader::get_resource); - ObjectTypeDB::bind_method(_MD("poll"),&ResourceInteractiveLoader::poll); - ObjectTypeDB::bind_method(_MD("wait"),&ResourceInteractiveLoader::wait); - ObjectTypeDB::bind_method(_MD("get_stage"),&ResourceInteractiveLoader::get_stage); - ObjectTypeDB::bind_method(_MD("get_stage_count"),&ResourceInteractiveLoader::get_stage_count); + ClassDB::bind_method(_MD("get_resource"),&ResourceInteractiveLoader::get_resource); + ClassDB::bind_method(_MD("poll"),&ResourceInteractiveLoader::poll); + ClassDB::bind_method(_MD("wait"),&ResourceInteractiveLoader::wait); + ClassDB::bind_method(_MD("get_stage"),&ResourceInteractiveLoader::get_stage); + ClassDB::bind_method(_MD("get_stage_count"),&ResourceInteractiveLoader::get_stage_count); } class ResourceInteractiveLoaderDefault : public ResourceInteractiveLoader { - OBJ_TYPE( ResourceInteractiveLoaderDefault, ResourceInteractiveLoader ); + GDCLASS( ResourceInteractiveLoaderDefault, ResourceInteractiveLoader ); public: Ref<Resource> resource; @@ -164,7 +164,7 @@ RES ResourceLoader::load(const String &p_path, const String& p_type_hint, bool p if (p_path.is_rel_path()) local_path="res://"+p_path; else - local_path = Globals::get_singleton()->localize_path(p_path); + local_path = GlobalConfig::get_singleton()->localize_path(p_path); local_path=find_complete_path(local_path,p_type_hint); ERR_FAIL_COND_V(local_path=="",RES()); @@ -228,7 +228,7 @@ Ref<ResourceImportMetadata> ResourceLoader::load_import_metadata(const String &p if (p_path.is_rel_path()) local_path="res://"+p_path; else - local_path = Globals::get_singleton()->localize_path(p_path); + local_path = GlobalConfig::get_singleton()->localize_path(p_path); String extension=p_path.extension(); Ref<ResourceImportMetadata> ret; @@ -285,7 +285,7 @@ String ResourceLoader::find_complete_path(const String& p_path,const String& p_t for(List<String>::Element *E=candidates.front();E;E=E->next()) { String rt = get_resource_type(E->get()); - if (ObjectTypeDB::is_type(rt,p_type)) { + if (ClassDB::is_parent_class(rt,p_type)) { return E->get(); } } @@ -307,7 +307,7 @@ Ref<ResourceInteractiveLoader> ResourceLoader::load_interactive(const String &p_ if (p_path.is_rel_path()) local_path="res://"+p_path; else - local_path = Globals::get_singleton()->localize_path(p_path); + local_path = GlobalConfig::get_singleton()->localize_path(p_path); local_path=find_complete_path(local_path,p_type_hint); ERR_FAIL_COND_V(local_path=="",Ref<ResourceInteractiveLoader>()); @@ -381,7 +381,7 @@ void ResourceLoader::get_dependencies(const String& p_path, List<String> *p_depe if (p_path.is_rel_path()) local_path="res://"+p_path; else - local_path = Globals::get_singleton()->localize_path(p_path); + local_path = GlobalConfig::get_singleton()->localize_path(p_path); String remapped_path = PathRemap::get_singleton()->get_remap(local_path); @@ -406,7 +406,7 @@ Error ResourceLoader::rename_dependencies(const String &p_path,const Map<String, if (p_path.is_rel_path()) local_path="res://"+p_path; else - local_path = Globals::get_singleton()->localize_path(p_path); + local_path = GlobalConfig::get_singleton()->localize_path(p_path); String remapped_path = PathRemap::get_singleton()->get_remap(local_path); @@ -434,7 +434,7 @@ String ResourceLoader::guess_full_filename(const String &p_path,const String& p_ if (p_path.is_rel_path()) local_path="res://"+p_path; else - local_path = Globals::get_singleton()->localize_path(p_path); + local_path = GlobalConfig::get_singleton()->localize_path(p_path); return find_complete_path(local_path,p_type); @@ -446,7 +446,7 @@ String ResourceLoader::get_resource_type(const String &p_path) { if (p_path.is_rel_path()) local_path="res://"+p_path; else - local_path = Globals::get_singleton()->localize_path(p_path); + local_path = GlobalConfig::get_singleton()->localize_path(p_path); String remapped_path = PathRemap::get_singleton()->get_remap(local_path); String extension=remapped_path.extension(); diff --git a/core/io/resource_loader.h b/core/io/resource_loader.h index f976a43d91..7979bd02a7 100644 --- a/core/io/resource_loader.h +++ b/core/io/resource_loader.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ class ResourceInteractiveLoader : public Reference { - OBJ_TYPE(ResourceInteractiveLoader,Reference); + GDCLASS(ResourceInteractiveLoader,Reference); protected: static void _bind_methods(); diff --git a/core/io/resource_saver.cpp b/core/io/resource_saver.cpp index 2ead405440..9081adaa8f 100644 --- a/core/io/resource_saver.cpp +++ b/core/io/resource_saver.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -64,7 +64,7 @@ Error ResourceSaver::save(const String &p_path,const RES& p_resource,uint32_t p_ String old_path=p_resource->get_path(); - String local_path=Globals::get_singleton()->localize_path(p_path); + String local_path=GlobalConfig::get_singleton()->localize_path(p_path); RES rwcopy = p_resource; if (p_flags&FLAG_CHANGE_PATH) diff --git a/core/io/resource_saver.h b/core/io/resource_saver.h index b05ae23afc..f00f074090 100644 --- a/core/io/resource_saver.h +++ b/core/io/resource_saver.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/stream_peer.cpp b/core/io/stream_peer.cpp index baaeacaf18..a2812edb81 100644 --- a/core/io/stream_peer.cpp +++ b/core/io/stream_peer.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -29,16 +29,16 @@ #include "stream_peer.h" #include "io/marshalls.h" -Error StreamPeer::_put_data(const DVector<uint8_t>& p_data) { +Error StreamPeer::_put_data(const PoolVector<uint8_t>& p_data) { int len = p_data.size(); if (len==0) return OK; - DVector<uint8_t>::Read r = p_data.read(); + PoolVector<uint8_t>::Read r = p_data.read(); return put_data(&r[0],len); } -Array StreamPeer::_put_partial_data(const DVector<uint8_t>& p_data) { +Array StreamPeer::_put_partial_data(const PoolVector<uint8_t>& p_data) { Array ret; @@ -49,7 +49,7 @@ Array StreamPeer::_put_partial_data(const DVector<uint8_t>& p_data) { return ret; } - DVector<uint8_t>::Read r = p_data.read(); + PoolVector<uint8_t>::Read r = p_data.read(); int sent; Error err = put_partial_data(&r[0],len,sent); @@ -66,18 +66,18 @@ Array StreamPeer::_get_data(int p_bytes) { Array ret; - DVector<uint8_t> data; + PoolVector<uint8_t> data; data.resize(p_bytes); if (data.size()!=p_bytes) { ret.push_back(ERR_OUT_OF_MEMORY); - ret.push_back(DVector<uint8_t>()); + ret.push_back(PoolVector<uint8_t>()); return ret; } - DVector<uint8_t>::Write w = data.write(); + PoolVector<uint8_t>::Write w = data.write(); Error err = get_data(&w[0],p_bytes); - w = DVector<uint8_t>::Write(); + w = PoolVector<uint8_t>::Write(); ret.push_back(err); ret.push_back(data); return ret; @@ -88,19 +88,19 @@ Array StreamPeer::_get_partial_data(int p_bytes) { Array ret; - DVector<uint8_t> data; + PoolVector<uint8_t> data; data.resize(p_bytes); if (data.size()!=p_bytes) { ret.push_back(ERR_OUT_OF_MEMORY); - ret.push_back(DVector<uint8_t>()); + ret.push_back(PoolVector<uint8_t>()); return ret; } - DVector<uint8_t>::Write w = data.write(); + PoolVector<uint8_t>::Write w = data.write(); int received; Error err = get_partial_data(&w[0],p_bytes,received); - w = DVector<uint8_t>::Write(); + w = PoolVector<uint8_t>::Write(); if (err!=OK) { data.resize(0); @@ -389,57 +389,57 @@ Variant StreamPeer::get_var(){ void StreamPeer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("put_data","data"),&StreamPeer::_put_data); - ObjectTypeDB::bind_method(_MD("put_partial_data","data"),&StreamPeer::_put_partial_data); - - ObjectTypeDB::bind_method(_MD("get_data","bytes"),&StreamPeer::_get_data); - ObjectTypeDB::bind_method(_MD("get_partial_data","bytes"),&StreamPeer::_get_partial_data); - - ObjectTypeDB::bind_method(_MD("get_available_bytes"),&StreamPeer::get_available_bytes); - - ObjectTypeDB::bind_method(_MD("set_big_endian","enable"),&StreamPeer::set_big_endian); - ObjectTypeDB::bind_method(_MD("is_big_endian_enabled"),&StreamPeer::is_big_endian_enabled); - - ObjectTypeDB::bind_method(_MD("put_8","val"),&StreamPeer::put_8); - ObjectTypeDB::bind_method(_MD("put_u8","val"),&StreamPeer::put_u8); - ObjectTypeDB::bind_method(_MD("put_16","val"),&StreamPeer::put_16); - ObjectTypeDB::bind_method(_MD("put_u16","val"),&StreamPeer::put_u16); - ObjectTypeDB::bind_method(_MD("put_32","val"),&StreamPeer::put_32); - ObjectTypeDB::bind_method(_MD("put_u32","val"),&StreamPeer::put_u32); - ObjectTypeDB::bind_method(_MD("put_64","val"),&StreamPeer::put_64); - ObjectTypeDB::bind_method(_MD("put_u64","val"),&StreamPeer::put_u64); - ObjectTypeDB::bind_method(_MD("put_float","val"),&StreamPeer::put_float); - ObjectTypeDB::bind_method(_MD("put_double","val"),&StreamPeer::put_double); - ObjectTypeDB::bind_method(_MD("put_utf8_string","val"),&StreamPeer::put_utf8_string); - ObjectTypeDB::bind_method(_MD("put_var","val:Variant"),&StreamPeer::put_var); - - ObjectTypeDB::bind_method(_MD("get_8"),&StreamPeer::get_8); - ObjectTypeDB::bind_method(_MD("get_u8"),&StreamPeer::get_u8); - ObjectTypeDB::bind_method(_MD("get_16"),&StreamPeer::get_16); - ObjectTypeDB::bind_method(_MD("get_u16"),&StreamPeer::get_u16); - ObjectTypeDB::bind_method(_MD("get_32"),&StreamPeer::get_32); - ObjectTypeDB::bind_method(_MD("get_u32"),&StreamPeer::get_u32); - ObjectTypeDB::bind_method(_MD("get_64"),&StreamPeer::get_64); - ObjectTypeDB::bind_method(_MD("get_u64"),&StreamPeer::get_u64); - ObjectTypeDB::bind_method(_MD("get_float"),&StreamPeer::get_float); - ObjectTypeDB::bind_method(_MD("get_double"),&StreamPeer::get_double); - ObjectTypeDB::bind_method(_MD("get_string","bytes"),&StreamPeer::get_string); - ObjectTypeDB::bind_method(_MD("get_utf8_string","bytes"),&StreamPeer::get_utf8_string); - ObjectTypeDB::bind_method(_MD("get_var:Variant"),&StreamPeer::get_var); + ClassDB::bind_method(_MD("put_data","data"),&StreamPeer::_put_data); + ClassDB::bind_method(_MD("put_partial_data","data"),&StreamPeer::_put_partial_data); + + ClassDB::bind_method(_MD("get_data","bytes"),&StreamPeer::_get_data); + ClassDB::bind_method(_MD("get_partial_data","bytes"),&StreamPeer::_get_partial_data); + + ClassDB::bind_method(_MD("get_available_bytes"),&StreamPeer::get_available_bytes); + + ClassDB::bind_method(_MD("set_big_endian","enable"),&StreamPeer::set_big_endian); + ClassDB::bind_method(_MD("is_big_endian_enabled"),&StreamPeer::is_big_endian_enabled); + + ClassDB::bind_method(_MD("put_8","val"),&StreamPeer::put_8); + ClassDB::bind_method(_MD("put_u8","val"),&StreamPeer::put_u8); + ClassDB::bind_method(_MD("put_16","val"),&StreamPeer::put_16); + ClassDB::bind_method(_MD("put_u16","val"),&StreamPeer::put_u16); + ClassDB::bind_method(_MD("put_32","val"),&StreamPeer::put_32); + ClassDB::bind_method(_MD("put_u32","val"),&StreamPeer::put_u32); + ClassDB::bind_method(_MD("put_64","val"),&StreamPeer::put_64); + ClassDB::bind_method(_MD("put_u64","val"),&StreamPeer::put_u64); + ClassDB::bind_method(_MD("put_float","val"),&StreamPeer::put_float); + ClassDB::bind_method(_MD("put_double","val"),&StreamPeer::put_double); + ClassDB::bind_method(_MD("put_utf8_string","val"),&StreamPeer::put_utf8_string); + ClassDB::bind_method(_MD("put_var","val:Variant"),&StreamPeer::put_var); + + ClassDB::bind_method(_MD("get_8"),&StreamPeer::get_8); + ClassDB::bind_method(_MD("get_u8"),&StreamPeer::get_u8); + ClassDB::bind_method(_MD("get_16"),&StreamPeer::get_16); + ClassDB::bind_method(_MD("get_u16"),&StreamPeer::get_u16); + ClassDB::bind_method(_MD("get_32"),&StreamPeer::get_32); + ClassDB::bind_method(_MD("get_u32"),&StreamPeer::get_u32); + ClassDB::bind_method(_MD("get_64"),&StreamPeer::get_64); + ClassDB::bind_method(_MD("get_u64"),&StreamPeer::get_u64); + ClassDB::bind_method(_MD("get_float"),&StreamPeer::get_float); + ClassDB::bind_method(_MD("get_double"),&StreamPeer::get_double); + ClassDB::bind_method(_MD("get_string","bytes"),&StreamPeer::get_string); + ClassDB::bind_method(_MD("get_utf8_string","bytes"),&StreamPeer::get_utf8_string); + ClassDB::bind_method(_MD("get_var:Variant"),&StreamPeer::get_var); } //////////////////////////////// void StreamPeerBuffer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("seek","pos"),&StreamPeerBuffer::seek); - ObjectTypeDB::bind_method(_MD("get_size"),&StreamPeerBuffer::get_size); - ObjectTypeDB::bind_method(_MD("get_pos"),&StreamPeerBuffer::get_pos); - ObjectTypeDB::bind_method(_MD("resize","size"),&StreamPeerBuffer::resize); - ObjectTypeDB::bind_method(_MD("set_data_array","data"),&StreamPeerBuffer::set_data_array); - ObjectTypeDB::bind_method(_MD("get_data_array"),&StreamPeerBuffer::get_data_array); - ObjectTypeDB::bind_method(_MD("clear"),&StreamPeerBuffer::clear); - ObjectTypeDB::bind_method(_MD("duplicate:StreamPeerBuffer"),&StreamPeerBuffer::duplicate); + ClassDB::bind_method(_MD("seek","pos"),&StreamPeerBuffer::seek); + ClassDB::bind_method(_MD("get_size"),&StreamPeerBuffer::get_size); + ClassDB::bind_method(_MD("get_pos"),&StreamPeerBuffer::get_pos); + ClassDB::bind_method(_MD("resize","size"),&StreamPeerBuffer::resize); + ClassDB::bind_method(_MD("set_data_array","data"),&StreamPeerBuffer::set_data_array); + ClassDB::bind_method(_MD("get_data_array"),&StreamPeerBuffer::get_data_array); + ClassDB::bind_method(_MD("clear"),&StreamPeerBuffer::clear); + ClassDB::bind_method(_MD("duplicate:StreamPeerBuffer"),&StreamPeerBuffer::duplicate); } @@ -454,7 +454,7 @@ Error StreamPeerBuffer::put_data(const uint8_t* p_data,int p_bytes) { } - DVector<uint8_t>::Write w = data.write(); + PoolVector<uint8_t>::Write w = data.write(); copymem(&w[pointer],p_data,p_bytes); pointer+=p_bytes; @@ -490,7 +490,7 @@ Error StreamPeerBuffer::get_partial_data(uint8_t* p_buffer, int p_bytes,int &r_r r_received=p_bytes; } - DVector<uint8_t>::Read r = data.read(); + PoolVector<uint8_t>::Read r = data.read(); copymem(p_buffer,r.ptr(),r_received); } @@ -520,13 +520,13 @@ void StreamPeerBuffer::resize(int p_size){ data.resize(p_size); } -void StreamPeerBuffer::set_data_array(const DVector<uint8_t> & p_data){ +void StreamPeerBuffer::set_data_array(const PoolVector<uint8_t> & p_data){ data=p_data; pointer=0; } -DVector<uint8_t> StreamPeerBuffer::get_data_array() const{ +PoolVector<uint8_t> StreamPeerBuffer::get_data_array() const{ return data; } diff --git a/core/io/stream_peer.h b/core/io/stream_peer.h index f28e6f594d..eb0f90ba50 100644 --- a/core/io/stream_peer.h +++ b/core/io/stream_peer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,14 +32,14 @@ #include "reference.h" class StreamPeer : public Reference { - OBJ_TYPE( StreamPeer, Reference ); + GDCLASS( StreamPeer, Reference ); OBJ_CATEGORY("Networking"); protected: static void _bind_methods(); //bind helpers - Error _put_data(const DVector<uint8_t>& p_data); - Array _put_partial_data(const DVector<uint8_t>& p_data); + Error _put_data(const PoolVector<uint8_t>& p_data); + Array _put_partial_data(const PoolVector<uint8_t>& p_data); Array _get_data(int p_bytes); Array _get_partial_data(int p_bytes); @@ -94,9 +94,9 @@ public: class StreamPeerBuffer : public StreamPeer { - OBJ_TYPE(StreamPeerBuffer,StreamPeer); + GDCLASS(StreamPeerBuffer,StreamPeer); - DVector<uint8_t> data; + PoolVector<uint8_t> data; int pointer; protected: @@ -116,8 +116,8 @@ public: void resize(int p_size); - void set_data_array(const DVector<uint8_t> & p_data); - DVector<uint8_t> get_data_array() const; + void set_data_array(const PoolVector<uint8_t> & p_data); + PoolVector<uint8_t> get_data_array() const; void clear(); diff --git a/core/io/stream_peer_ssl.cpp b/core/io/stream_peer_ssl.cpp index a58be84225..aab42a2989 100644 --- a/core/io/stream_peer_ssl.cpp +++ b/core/io/stream_peer_ssl.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -45,7 +45,7 @@ StreamPeerSSL::LoadCertsFromMemory StreamPeerSSL::load_certs_func=NULL; bool StreamPeerSSL::available=false; bool StreamPeerSSL::initialize_certs=true; -void StreamPeerSSL::load_certs_from_memory(const ByteArray& p_memory) { +void StreamPeerSSL::load_certs_from_memory(const PoolByteArray& p_memory) { if (load_certs_func) load_certs_func(p_memory); } @@ -57,10 +57,10 @@ bool StreamPeerSSL::is_available() { void StreamPeerSSL::_bind_methods() { - ObjectTypeDB::bind_method(_MD("accept:Error","stream:StreamPeer"),&StreamPeerSSL::accept); - ObjectTypeDB::bind_method(_MD("connect:Error","stream:StreamPeer","validate_certs","for_hostname"),&StreamPeerSSL::connect,DEFVAL(false),DEFVAL(String())); - ObjectTypeDB::bind_method(_MD("get_status"),&StreamPeerSSL::get_status); - ObjectTypeDB::bind_method(_MD("disconnect"),&StreamPeerSSL::disconnect); + ClassDB::bind_method(_MD("accept:Error","stream:StreamPeer"),&StreamPeerSSL::accept); + ClassDB::bind_method(_MD("connect:Error","stream:StreamPeer","validate_certs","for_hostname"),&StreamPeerSSL::connect,DEFVAL(false),DEFVAL(String())); + ClassDB::bind_method(_MD("get_status"),&StreamPeerSSL::get_status); + ClassDB::bind_method(_MD("disconnect"),&StreamPeerSSL::disconnect); BIND_CONSTANT( STATUS_DISCONNECTED ); BIND_CONSTANT( STATUS_CONNECTED ); BIND_CONSTANT( STATUS_ERROR_NO_CERTIFICATE ); diff --git a/core/io/stream_peer_ssl.h b/core/io/stream_peer_ssl.h index 3435a9a445..8675433a30 100644 --- a/core/io/stream_peer_ssl.h +++ b/core/io/stream_peer_ssl.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,10 +32,10 @@ #include "io/stream_peer.h" class StreamPeerSSL : public StreamPeer { - OBJ_TYPE(StreamPeerSSL,StreamPeer); + GDCLASS(StreamPeerSSL,StreamPeer); public: - typedef void (*LoadCertsFromMemory)(const ByteArray& p_certs); + typedef void (*LoadCertsFromMemory)(const PoolByteArray& p_certs); protected: static StreamPeerSSL* (*_create)(); static void _bind_methods(); @@ -65,7 +65,7 @@ public: static StreamPeerSSL* create(); - static void load_certs_from_memory(const ByteArray& p_memory); + static void load_certs_from_memory(const PoolByteArray& p_memory); static bool is_available(); StreamPeerSSL(); diff --git a/core/io/stream_peer_tcp.cpp b/core/io/stream_peer_tcp.cpp index 528f2e8cab..2218057cf7 100644 --- a/core/io/stream_peer_tcp.cpp +++ b/core/io/stream_peer_tcp.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -30,15 +30,13 @@ StreamPeerTCP* (*StreamPeerTCP::_create)()=NULL; -VARIANT_ENUM_CAST(IP_Address::AddrType); - -Error StreamPeerTCP::_connect(const String& p_address,int p_port,IP_Address::AddrType p_type) { +Error StreamPeerTCP::_connect(const String& p_address,int p_port) { IP_Address ip; if (p_address.is_valid_ip_address()) { ip=p_address; } else { - ip=IP::get_singleton()->resolve_hostname(p_address, p_type); + ip=IP::get_singleton()->resolve_hostname(p_address, ip_type); if (ip==IP_Address()) return ERR_CANT_RESOLVE; } @@ -47,14 +45,20 @@ Error StreamPeerTCP::_connect(const String& p_address,int p_port,IP_Address::Add return OK; } +void StreamPeerTCP::set_ip_type(IP::Type p_type) { + disconnect(); + ip_type = p_type; +} + void StreamPeerTCP::_bind_methods() { - ObjectTypeDB::bind_method(_MD("connect","host","port","ip_type"),&StreamPeerTCP::_connect,DEFVAL(IP_Address::TYPE_ANY)); - ObjectTypeDB::bind_method(_MD("is_connected"),&StreamPeerTCP::is_connected); - ObjectTypeDB::bind_method(_MD("get_status"),&StreamPeerTCP::get_status); - ObjectTypeDB::bind_method(_MD("get_connected_host"),&StreamPeerTCP::get_connected_host); - ObjectTypeDB::bind_method(_MD("get_connected_port"),&StreamPeerTCP::get_connected_port); - ObjectTypeDB::bind_method(_MD("disconnect"),&StreamPeerTCP::disconnect); + ClassDB::bind_method(_MD("set_ip_type","ip_type"),&StreamPeerTCP::set_ip_type); + ClassDB::bind_method(_MD("connect","host","port"),&StreamPeerTCP::_connect); + ClassDB::bind_method(_MD("is_connected"),&StreamPeerTCP::is_connected); + ClassDB::bind_method(_MD("get_status"),&StreamPeerTCP::get_status); + ClassDB::bind_method(_MD("get_connected_host"),&StreamPeerTCP::get_connected_host); + ClassDB::bind_method(_MD("get_connected_port"),&StreamPeerTCP::get_connected_port); + ClassDB::bind_method(_MD("disconnect"),&StreamPeerTCP::disconnect); BIND_CONSTANT( STATUS_NONE ); BIND_CONSTANT( STATUS_CONNECTING ); @@ -79,6 +83,7 @@ StreamPeerTCP* StreamPeerTCP::create() { StreamPeerTCP::StreamPeerTCP() { + ip_type = IP::TYPE_ANY; } StreamPeerTCP::~StreamPeerTCP() { diff --git a/core/io/stream_peer_tcp.h b/core/io/stream_peer_tcp.h index a151fffad8..8f6dfaf3f8 100644 --- a/core/io/stream_peer_tcp.h +++ b/core/io/stream_peer_tcp.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ class StreamPeerTCP : public StreamPeer { - OBJ_TYPE( StreamPeerTCP, StreamPeer ); + GDCLASS( StreamPeerTCP, StreamPeer ); OBJ_CATEGORY("Networking"); public: @@ -51,12 +51,15 @@ public: protected: - virtual Error _connect(const String& p_address, int p_port, IP_Address::AddrType p_type = IP_Address::TYPE_ANY); + IP::Type ip_type; + + virtual Error _connect(const String& p_address, int p_port); static StreamPeerTCP* (*_create)(); static void _bind_methods(); public: + virtual void set_ip_type(IP::Type p_type); virtual Error connect(const IP_Address& p_host, uint16_t p_port)=0; //read/write from streampeer diff --git a/core/io/tcp_server.cpp b/core/io/tcp_server.cpp index 894cccf691..bfa5dce58f 100644 --- a/core/io/tcp_server.cpp +++ b/core/io/tcp_server.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -30,8 +30,6 @@ TCP_Server* (*TCP_Server::_create)()=NULL; -VARIANT_ENUM_CAST(IP_Address::AddrType); - Ref<TCP_Server> TCP_Server::create_ref() { if (!_create) @@ -46,26 +44,33 @@ TCP_Server* TCP_Server::create() { return _create(); } -Error TCP_Server::_listen(uint16_t p_port, IP_Address::AddrType p_type, DVector<String> p_accepted_hosts) { +Error TCP_Server::_listen(uint16_t p_port, PoolVector<String> p_accepted_hosts) { List<String> hosts; for(int i=0;i<p_accepted_hosts.size();i++) hosts.push_back(p_accepted_hosts.get(i)); - return listen(p_port,p_type, hosts.size()?&hosts:NULL); + return listen(p_port, hosts.size()?&hosts:NULL); + +} +void TCP_Server::set_ip_type(IP::Type p_type) { + stop(); + ip_type = p_type; } void TCP_Server::_bind_methods() { - ObjectTypeDB::bind_method(_MD("listen","port","ip_type", "accepted_hosts"),&TCP_Server::_listen,DEFVAL(IP_Address::TYPE_ANY),DEFVAL(DVector<String>())); - ObjectTypeDB::bind_method(_MD("is_connection_available"),&TCP_Server::is_connection_available); - ObjectTypeDB::bind_method(_MD("take_connection"),&TCP_Server::take_connection); - ObjectTypeDB::bind_method(_MD("stop"),&TCP_Server::stop); + ClassDB::bind_method(_MD("set_ip_type","ip_type"),&TCP_Server::set_ip_type); + ClassDB::bind_method(_MD("listen","port","accepted_hosts"),&TCP_Server::_listen,DEFVAL(PoolVector<String>())); + ClassDB::bind_method(_MD("is_connection_available"),&TCP_Server::is_connection_available); + ClassDB::bind_method(_MD("take_connection"),&TCP_Server::take_connection); + ClassDB::bind_method(_MD("stop"),&TCP_Server::stop); } TCP_Server::TCP_Server() { + ip_type = IP::TYPE_ANY; } diff --git a/core/io/tcp_server.h b/core/io/tcp_server.h index 0267895008..3d7b3ddd8d 100644 --- a/core/io/tcp_server.h +++ b/core/io/tcp_server.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,17 +35,20 @@ class TCP_Server : public Reference { - OBJ_TYPE( TCP_Server, Reference ); + GDCLASS( TCP_Server, Reference ); protected: + IP::Type ip_type; + static TCP_Server* (*_create)(); //bind helper - Error _listen(uint16_t p_port, IP_Address::AddrType p_type = IP_Address::TYPE_ANY ,DVector<String> p_accepted_hosts=DVector<String>()); + Error _listen(uint16_t p_port, PoolVector<String> p_accepted_hosts=PoolVector<String>()); static void _bind_methods(); public: - virtual Error listen(uint16_t p_port, IP_Address::AddrType p_type = IP_Address::TYPE_ANY, const List<String> *p_accepted_hosts=NULL)=0; + virtual void set_ip_type(IP::Type p_type); + virtual Error listen(uint16_t p_port, const List<String> *p_accepted_hosts=NULL)=0; virtual bool is_connection_available() const=0; virtual Ref<StreamPeerTCP> take_connection()=0; diff --git a/core/io/translation_loader_po.cpp b/core/io/translation_loader_po.cpp index a22c57b941..8c4c1c8180 100644 --- a/core/io/translation_loader_po.cpp +++ b/core/io/translation_loader_po.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,8 +33,6 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const String &p_path) { - String l = f->get_line(); - enum Status { STATUS_NONE, diff --git a/core/io/translation_loader_po.h b/core/io/translation_loader_po.h index b0c4e42682..127c8dafab 100644 --- a/core/io/translation_loader_po.h +++ b/core/io/translation_loader_po.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/io/xml_parser.cpp b/core/io/xml_parser.cpp index e6a90412c1..0322f23056 100644 --- a/core/io/xml_parser.cpp +++ b/core/io/xml_parser.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -379,23 +379,23 @@ Error XMLParser::seek(uint64_t p_pos) { void XMLParser::_bind_methods() { - ObjectTypeDB::bind_method(_MD("read"),&XMLParser::read); - ObjectTypeDB::bind_method(_MD("get_node_type"),&XMLParser::get_node_type); - ObjectTypeDB::bind_method(_MD("get_node_name"),&XMLParser::get_node_name); - ObjectTypeDB::bind_method(_MD("get_node_data"),&XMLParser::get_node_data); - ObjectTypeDB::bind_method(_MD("get_node_offset"),&XMLParser::get_node_offset); - ObjectTypeDB::bind_method(_MD("get_attribute_count"),&XMLParser::get_attribute_count); - ObjectTypeDB::bind_method(_MD("get_attribute_name","idx"),&XMLParser::get_attribute_name); - ObjectTypeDB::bind_method(_MD("get_attribute_value","idx"),(String (XMLParser::*)(int) const) &XMLParser::get_attribute_value); - ObjectTypeDB::bind_method(_MD("has_attribute","name"),&XMLParser::has_attribute); - ObjectTypeDB::bind_method(_MD("get_named_attribute_value","name"), (String (XMLParser::*)(const String&) const) &XMLParser::get_attribute_value); - ObjectTypeDB::bind_method(_MD("get_named_attribute_value_safe","name"), &XMLParser::get_attribute_value_safe); - ObjectTypeDB::bind_method(_MD("is_empty"),&XMLParser::is_empty); - ObjectTypeDB::bind_method(_MD("get_current_line"),&XMLParser::get_current_line); - ObjectTypeDB::bind_method(_MD("skip_section"),&XMLParser::skip_section); - ObjectTypeDB::bind_method(_MD("seek","pos"),&XMLParser::seek); - ObjectTypeDB::bind_method(_MD("open","file"),&XMLParser::open); - ObjectTypeDB::bind_method(_MD("open_buffer","buffer"),&XMLParser::open_buffer); + ClassDB::bind_method(_MD("read"),&XMLParser::read); + ClassDB::bind_method(_MD("get_node_type"),&XMLParser::get_node_type); + ClassDB::bind_method(_MD("get_node_name"),&XMLParser::get_node_name); + ClassDB::bind_method(_MD("get_node_data"),&XMLParser::get_node_data); + ClassDB::bind_method(_MD("get_node_offset"),&XMLParser::get_node_offset); + ClassDB::bind_method(_MD("get_attribute_count"),&XMLParser::get_attribute_count); + ClassDB::bind_method(_MD("get_attribute_name","idx"),&XMLParser::get_attribute_name); + ClassDB::bind_method(_MD("get_attribute_value","idx"),(String (XMLParser::*)(int) const) &XMLParser::get_attribute_value); + ClassDB::bind_method(_MD("has_attribute","name"),&XMLParser::has_attribute); + ClassDB::bind_method(_MD("get_named_attribute_value","name"), (String (XMLParser::*)(const String&) const) &XMLParser::get_attribute_value); + ClassDB::bind_method(_MD("get_named_attribute_value_safe","name"), &XMLParser::get_attribute_value_safe); + ClassDB::bind_method(_MD("is_empty"),&XMLParser::is_empty); + ClassDB::bind_method(_MD("get_current_line"),&XMLParser::get_current_line); + ClassDB::bind_method(_MD("skip_section"),&XMLParser::skip_section); + ClassDB::bind_method(_MD("seek","pos"),&XMLParser::seek); + ClassDB::bind_method(_MD("open","file"),&XMLParser::open); + ClassDB::bind_method(_MD("open_buffer","buffer"),&XMLParser::open_buffer); BIND_CONSTANT( NODE_NONE ); BIND_CONSTANT( NODE_ELEMENT ); diff --git a/core/io/xml_parser.h b/core/io/xml_parser.h index e0ec3ec770..7f80751156 100644 --- a/core/io/xml_parser.h +++ b/core/io/xml_parser.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -40,7 +40,7 @@ class XMLParser : public Reference { - OBJ_TYPE( XMLParser, Reference ); + GDCLASS( XMLParser, Reference ); public: //! Enumeration of all supported source text file formats enum SourceFormat { diff --git a/core/io/zip_io.h b/core/io/zip_io.h index 0668c47d97..c994593518 100644 --- a/core/io/zip_io.h +++ b/core/io/zip_io.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/list.h b/core/list.h index b989f009a9..c464af7475 100644 --- a/core/list.h +++ b/core/list.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/make_binders.py b/core/make_binders.py index ef71c4264b..74b5e9fda3 100644 --- a/core/make_binders.py +++ b/core/make_binders.py @@ -17,8 +17,8 @@ public: return Variant::NIL; } #endif - virtual String get_instance_type() const { - return T::get_type_static(); + virtual String get_instance_class() const { + return T::get_class_static(); } virtual Variant call(Object* p_object,const Variant** p_args,int p_arg_count, Variant::CallError& r_error) { @@ -97,7 +97,7 @@ public: return Variant::NIL; } #endif - virtual String get_instance_type() const { + virtual String get_instance_class() const { return type_name; } @@ -159,7 +159,7 @@ MethodBind* create_method_bind($ifret R$ $ifnoret void$ (T::*p_method)($arg, P@$ } u; u.sm=p_method; a->method=u.dm; - a->type_name=T::get_type_static(); + a->type_name=T::get_class_static(); return a; } #endif diff --git a/core/map.h b/core/map.h index 81cda1ece2..af35fec332 100644 --- a/core/map.h +++ b/core/map.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/a_star.cpp b/core/math/a_star.cpp index 198d9f6076..0d6997183f 100644 --- a/core/math/a_star.cpp +++ b/core/math/a_star.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -295,10 +295,10 @@ bool AStar::_solve(Point* begin_point, Point* end_point) { } -DVector<Vector3> AStar::get_point_path(int p_from_id, int p_to_id) { +PoolVector<Vector3> AStar::get_point_path(int p_from_id, int p_to_id) { - ERR_FAIL_COND_V(!points.has(p_from_id),DVector<Vector3>()); - ERR_FAIL_COND_V(!points.has(p_to_id),DVector<Vector3>()); + ERR_FAIL_COND_V(!points.has(p_from_id),PoolVector<Vector3>()); + ERR_FAIL_COND_V(!points.has(p_to_id),PoolVector<Vector3>()); pass++; @@ -307,7 +307,7 @@ DVector<Vector3> AStar::get_point_path(int p_from_id, int p_to_id) { Point* b = points[p_to_id]; if (a==b) { - DVector<Vector3> ret; + PoolVector<Vector3> ret; ret.push_back(a->pos); return ret; } @@ -319,7 +319,7 @@ DVector<Vector3> AStar::get_point_path(int p_from_id, int p_to_id) { bool found_route=_solve(begin_point,end_point); if (!found_route) - return DVector<Vector3>(); + return PoolVector<Vector3>(); //midpoints Point *p=end_point; @@ -329,11 +329,11 @@ DVector<Vector3> AStar::get_point_path(int p_from_id, int p_to_id) { p=p->prev_point; } - DVector<Vector3> path; + PoolVector<Vector3> path; path.resize(pc); { - DVector<Vector3>::Write w = path.write(); + PoolVector<Vector3>::Write w = path.write(); Point *p=end_point; int idx=pc-1; @@ -351,10 +351,10 @@ DVector<Vector3> AStar::get_point_path(int p_from_id, int p_to_id) { } -DVector<int> AStar::get_id_path(int p_from_id, int p_to_id) { +PoolVector<int> AStar::get_id_path(int p_from_id, int p_to_id) { - ERR_FAIL_COND_V(!points.has(p_from_id),DVector<int>()); - ERR_FAIL_COND_V(!points.has(p_to_id),DVector<int>()); + ERR_FAIL_COND_V(!points.has(p_from_id),PoolVector<int>()); + ERR_FAIL_COND_V(!points.has(p_to_id),PoolVector<int>()); pass++; @@ -363,7 +363,7 @@ DVector<int> AStar::get_id_path(int p_from_id, int p_to_id) { Point* b = points[p_to_id]; if (a==b) { - DVector<int> ret; + PoolVector<int> ret; ret.push_back(a->id); return ret; } @@ -375,7 +375,7 @@ DVector<int> AStar::get_id_path(int p_from_id, int p_to_id) { bool found_route=_solve(begin_point,end_point); if (!found_route) - return DVector<int>(); + return PoolVector<int>(); //midpoints Point *p=end_point; @@ -385,11 +385,11 @@ DVector<int> AStar::get_id_path(int p_from_id, int p_to_id) { p=p->prev_point; } - DVector<int> path; + PoolVector<int> path; path.resize(pc); { - DVector<int>::Write w = path.write(); + PoolVector<int>::Write w = path.write(); p=end_point; int idx=pc-1; @@ -407,23 +407,23 @@ DVector<int> AStar::get_id_path(int p_from_id, int p_to_id) { void AStar::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_available_point_id"),&AStar::get_available_point_id); - ObjectTypeDB::bind_method(_MD("add_point","id","pos","weight_scale"),&AStar::add_point,DEFVAL(1.0)); - ObjectTypeDB::bind_method(_MD("get_point_pos","id"),&AStar::get_point_pos); - ObjectTypeDB::bind_method(_MD("get_point_weight_scale","id"),&AStar::get_point_weight_scale); - ObjectTypeDB::bind_method(_MD("remove_point","id"),&AStar::remove_point); + ClassDB::bind_method(_MD("get_available_point_id"),&AStar::get_available_point_id); + ClassDB::bind_method(_MD("add_point","id","pos","weight_scale"),&AStar::add_point,DEFVAL(1.0)); + ClassDB::bind_method(_MD("get_point_pos","id"),&AStar::get_point_pos); + ClassDB::bind_method(_MD("get_point_weight_scale","id"),&AStar::get_point_weight_scale); + ClassDB::bind_method(_MD("remove_point","id"),&AStar::remove_point); - ObjectTypeDB::bind_method(_MD("connect_points","id","to_id"),&AStar::connect_points); - ObjectTypeDB::bind_method(_MD("disconnect_points","id","to_id"),&AStar::disconnect_points); - ObjectTypeDB::bind_method(_MD("are_points_connected","id","to_id"),&AStar::are_points_connected); + ClassDB::bind_method(_MD("connect_points","id","to_id"),&AStar::connect_points); + ClassDB::bind_method(_MD("disconnect_points","id","to_id"),&AStar::disconnect_points); + ClassDB::bind_method(_MD("are_points_connected","id","to_id"),&AStar::are_points_connected); - ObjectTypeDB::bind_method(_MD("clear"),&AStar::clear); + ClassDB::bind_method(_MD("clear"),&AStar::clear); - ObjectTypeDB::bind_method(_MD("get_closest_point","to_pos"),&AStar::get_closest_point); - ObjectTypeDB::bind_method(_MD("get_closest_pos_in_segment","to_pos"),&AStar::get_closest_pos_in_segment); + ClassDB::bind_method(_MD("get_closest_point","to_pos"),&AStar::get_closest_point); + ClassDB::bind_method(_MD("get_closest_pos_in_segment","to_pos"),&AStar::get_closest_pos_in_segment); - ObjectTypeDB::bind_method(_MD("get_point_path","from_id","to_id"),&AStar::get_point_path); - ObjectTypeDB::bind_method(_MD("get_id_path","from_id","to_id"),&AStar::get_id_path); + ClassDB::bind_method(_MD("get_point_path","from_id","to_id"),&AStar::get_point_path); + ClassDB::bind_method(_MD("get_id_path","from_id","to_id"),&AStar::get_id_path); } diff --git a/core/math/a_star.h b/core/math/a_star.h index 26f3a85046..35e6ead226 100644 --- a/core/math/a_star.h +++ b/core/math/a_star.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ class AStar: public Reference { - OBJ_TYPE(AStar,Reference) + GDCLASS(AStar,Reference) uint64_t pass; @@ -113,8 +113,8 @@ public: int get_closest_point(const Vector3& p_point) const; Vector3 get_closest_pos_in_segment(const Vector3& p_point) const; - DVector<Vector3> get_point_path(int p_from_id, int p_to_id); - DVector<int> get_id_path(int p_from_id, int p_to_id); + PoolVector<Vector3> get_point_path(int p_from_id, int p_to_id); + PoolVector<int> get_id_path(int p_from_id, int p_to_id); AStar(); ~AStar(); diff --git a/core/math/aabb.cpp b/core/math/aabb.cpp index 6d8a5a72f0..3518eea7ac 100644 --- a/core/math/aabb.cpp +++ b/core/math/aabb.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -30,24 +30,24 @@ #include "print_string.h" -float AABB::get_area() const { +float Rect3::get_area() const { return size.x*size.y*size.z; } -bool AABB::operator==(const AABB& p_rval) const { +bool Rect3::operator==(const Rect3& p_rval) const { return ((pos==p_rval.pos) && (size==p_rval.size)); } -bool AABB::operator!=(const AABB& p_rval) const { +bool Rect3::operator!=(const Rect3& p_rval) const { return ((pos!=p_rval.pos) || (size!=p_rval.size)); } -void AABB::merge_with(const AABB& p_aabb) { +void Rect3::merge_with(const Rect3& p_aabb) { Vector3 beg_1,beg_2; Vector3 end_1,end_2; @@ -70,7 +70,7 @@ void AABB::merge_with(const AABB& p_aabb) { size=max-min; } -AABB AABB::intersection(const AABB& p_aabb) const { +Rect3 Rect3::intersection(const Rect3& p_aabb) const { Vector3 src_min=pos; Vector3 src_max=pos+size; @@ -80,7 +80,7 @@ AABB AABB::intersection(const AABB& p_aabb) const { Vector3 min,max; if (src_min.x > dst_max.x || src_max.x < dst_min.x ) - return AABB(); + return Rect3(); else { min.x= ( src_min.x > dst_min.x ) ? src_min.x :dst_min.x; @@ -89,7 +89,7 @@ AABB AABB::intersection(const AABB& p_aabb) const { } if (src_min.y > dst_max.y || src_max.y < dst_min.y ) - return AABB(); + return Rect3(); else { min.y= ( src_min.y > dst_min.y ) ? src_min.y :dst_min.y; @@ -98,7 +98,7 @@ AABB AABB::intersection(const AABB& p_aabb) const { } if (src_min.z > dst_max.z || src_max.z < dst_min.z ) - return AABB(); + return Rect3(); else { min.z= ( src_min.z > dst_min.z ) ? src_min.z :dst_min.z; @@ -107,10 +107,10 @@ AABB AABB::intersection(const AABB& p_aabb) const { } - return AABB( min, max-min ); + return Rect3( min, max-min ); } -bool AABB::intersects_ray(const Vector3& p_from, const Vector3& p_dir,Vector3* r_clip,Vector3* r_normal) const { +bool Rect3::intersects_ray(const Vector3& p_from, const Vector3& p_dir,Vector3* r_clip,Vector3* r_normal) const { Vector3 c1, c2; Vector3 end = pos+size; @@ -155,7 +155,7 @@ bool AABB::intersects_ray(const Vector3& p_from, const Vector3& p_dir,Vector3* r } -bool AABB::intersects_segment(const Vector3& p_from, const Vector3& p_to,Vector3* r_clip,Vector3* r_normal) const { +bool Rect3::intersects_segment(const Vector3& p_from, const Vector3& p_to,Vector3* r_clip,Vector3* r_normal) const { real_t min=0,max=1; int axis=0; @@ -216,7 +216,7 @@ bool AABB::intersects_segment(const Vector3& p_from, const Vector3& p_to,Vector3 } -bool AABB::intersects_plane(const Plane &p_plane) const { +bool Rect3::intersects_plane(const Plane &p_plane) const { Vector3 points[8] = { Vector3( pos.x , pos.y , pos.z ), @@ -246,7 +246,7 @@ bool AABB::intersects_plane(const Plane &p_plane) const { -Vector3 AABB::get_longest_axis() const { +Vector3 Rect3::get_longest_axis() const { Vector3 axis(1,0,0); real_t max_size=size.x; @@ -263,7 +263,7 @@ Vector3 AABB::get_longest_axis() const { return axis; } -int AABB::get_longest_axis_index() const { +int Rect3::get_longest_axis_index() const { int axis=0; real_t max_size=size.x; @@ -282,7 +282,7 @@ int AABB::get_longest_axis_index() const { } -Vector3 AABB::get_shortest_axis() const { +Vector3 Rect3::get_shortest_axis() const { Vector3 axis(1,0,0); real_t max_size=size.x; @@ -299,7 +299,7 @@ Vector3 AABB::get_shortest_axis() const { return axis; } -int AABB::get_shortest_axis_index() const { +int Rect3::get_shortest_axis_index() const { int axis=0; real_t max_size=size.x; @@ -317,26 +317,26 @@ int AABB::get_shortest_axis_index() const { return axis; } -AABB AABB::merge(const AABB& p_with) const { +Rect3 Rect3::merge(const Rect3& p_with) const { - AABB aabb=*this; + Rect3 aabb=*this; aabb.merge_with(p_with); return aabb; } -AABB AABB::expand(const Vector3& p_vector) const { - AABB aabb=*this; +Rect3 Rect3::expand(const Vector3& p_vector) const { + Rect3 aabb=*this; aabb.expand_to(p_vector); return aabb; } -AABB AABB::grow(real_t p_by) const { +Rect3 Rect3::grow(real_t p_by) const { - AABB aabb=*this; + Rect3 aabb=*this; aabb.grow_by(p_by); return aabb; } -void AABB::get_edge(int p_edge,Vector3& r_from,Vector3& r_to) const { +void Rect3::get_edge(int p_edge,Vector3& r_from,Vector3& r_to) const { ERR_FAIL_INDEX(p_edge,12); switch(p_edge) { @@ -412,7 +412,7 @@ void AABB::get_edge(int p_edge,Vector3& r_from,Vector3& r_to) const { } -AABB::operator String() const { +Rect3::operator String() const { return String()+pos +" - "+ size; } diff --git a/core/math/aabb.h b/core/math/aabb.h index 57fe1b32f5..2816d1f012 100644 --- a/core/math/aabb.h +++ b/core/math/aabb.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -40,7 +40,7 @@ -class AABB { +class Rect3 { public: Vector3 pos; Vector3 size; @@ -62,16 +62,16 @@ public: void set_size(const Vector3& p_size) { size=p_size; } - bool operator==(const AABB& p_rval) const; - bool operator!=(const AABB& p_rval) const; + bool operator==(const Rect3& p_rval) const; + bool operator!=(const Rect3& p_rval) const; - _FORCE_INLINE_ bool intersects(const AABB& p_aabb) const; /// Both AABBs overlap - _FORCE_INLINE_ bool intersects_inclusive(const AABB& p_aabb) const; /// Both AABBs (or their faces) overlap - _FORCE_INLINE_ bool encloses(const AABB & p_aabb) const; /// p_aabb is completely inside this + _FORCE_INLINE_ bool intersects(const Rect3& p_aabb) const; /// Both AABBs overlap + _FORCE_INLINE_ bool intersects_inclusive(const Rect3& p_aabb) const; /// Both AABBs (or their faces) overlap + _FORCE_INLINE_ bool encloses(const Rect3 & p_aabb) const; /// p_aabb is completely inside this - AABB merge(const AABB& p_with) const; - void merge_with(const AABB& p_aabb); ///merge with another AABB - AABB intersection(const AABB& p_aabb) const; ///get box where two intersect, empty if no intersection occurs + Rect3 merge(const Rect3& p_with) const; + void merge_with(const Rect3& p_aabb); ///merge with another AABB + Rect3 intersection(const Rect3& p_aabb) const; ///get box where two intersect, empty if no intersection occurs bool intersects_segment(const Vector3& p_from, const Vector3& p_to,Vector3* r_clip=NULL,Vector3* r_normal=NULL) const; bool intersects_ray(const Vector3& p_from, const Vector3& p_dir,Vector3* r_clip=NULL,Vector3* r_normal=NULL) const; _FORCE_INLINE_ bool smits_intersect_ray(const Vector3 &from,const Vector3& p_dir, float t0, float t1) const; @@ -91,25 +91,25 @@ public: int get_shortest_axis_index() const; _FORCE_INLINE_ real_t get_shortest_axis_size() const; - AABB grow(real_t p_by) const; + Rect3 grow(real_t p_by) const; _FORCE_INLINE_ void grow_by(real_t p_amount); void get_edge(int p_edge,Vector3& r_from,Vector3& r_to) const; _FORCE_INLINE_ Vector3 get_endpoint(int p_point) const; - AABB expand(const Vector3& p_vector) const; + Rect3 expand(const Vector3& p_vector) const; _FORCE_INLINE_ void project_range_in_plane(const Plane& p_plane,float &r_min,float& r_max) const; _FORCE_INLINE_ void expand_to(const Vector3& p_vector); /** expand to contain a point if necesary */ operator String() const; - _FORCE_INLINE_ AABB() {} - inline AABB(const Vector3 &p_pos,const Vector3& p_size) { pos=p_pos; size=p_size; } + _FORCE_INLINE_ Rect3() {} + inline Rect3(const Vector3 &p_pos,const Vector3& p_size) { pos=p_pos; size=p_size; } }; -inline bool AABB::intersects(const AABB& p_aabb) const { +inline bool Rect3::intersects(const Rect3& p_aabb) const { if ( pos.x >= (p_aabb.pos.x + p_aabb.size.x) ) return false; @@ -127,7 +127,7 @@ inline bool AABB::intersects(const AABB& p_aabb) const { return true; } -inline bool AABB::intersects_inclusive(const AABB& p_aabb) const { +inline bool Rect3::intersects_inclusive(const Rect3& p_aabb) const { if ( pos.x > (p_aabb.pos.x + p_aabb.size.x) ) return false; @@ -145,7 +145,7 @@ inline bool AABB::intersects_inclusive(const AABB& p_aabb) const { return true; } -inline bool AABB::encloses(const AABB & p_aabb) const { +inline bool Rect3::encloses(const Rect3 & p_aabb) const { Vector3 src_min=pos; Vector3 src_max=pos+size; @@ -162,7 +162,7 @@ inline bool AABB::encloses(const AABB & p_aabb) const { } -Vector3 AABB::get_support(const Vector3& p_normal) const { +Vector3 Rect3::get_support(const Vector3& p_normal) const { Vector3 half_extents = size * 0.5; Vector3 ofs = pos + half_extents; @@ -175,7 +175,7 @@ Vector3 AABB::get_support(const Vector3& p_normal) const { } -Vector3 AABB::get_endpoint(int p_point) const { +Vector3 Rect3::get_endpoint(int p_point) const { switch(p_point) { case 0: return Vector3( pos.x , pos.y , pos.z ); @@ -191,7 +191,7 @@ Vector3 AABB::get_endpoint(int p_point) const { ERR_FAIL_V(Vector3()); } -bool AABB::intersects_convex_shape(const Plane *p_planes, int p_plane_count) const { +bool Rect3::intersects_convex_shape(const Plane *p_planes, int p_plane_count) const { #if 1 @@ -251,7 +251,7 @@ bool AABB::intersects_convex_shape(const Plane *p_planes, int p_plane_count) con #endif } -bool AABB::has_point(const Vector3& p_point) const { +bool Rect3::has_point(const Vector3& p_point) const { if (p_point.x<pos.x) return false; @@ -270,7 +270,7 @@ bool AABB::has_point(const Vector3& p_point) const { } -inline void AABB::expand_to(const Vector3& p_vector) { +inline void Rect3::expand_to(const Vector3& p_vector) { Vector3 begin=pos; Vector3 end=pos+size; @@ -293,7 +293,7 @@ inline void AABB::expand_to(const Vector3& p_vector) { size=end-begin; } -void AABB::project_range_in_plane(const Plane& p_plane,float &r_min,float& r_max) const { +void Rect3::project_range_in_plane(const Plane& p_plane,float &r_min,float& r_max) const { Vector3 half_extents( size.x * 0.5, size.y * 0.5, size.z * 0.5 ); Vector3 center( pos.x + half_extents.x, pos.y + half_extents.y, pos.z + half_extents.z ); @@ -304,7 +304,7 @@ void AABB::project_range_in_plane(const Plane& p_plane,float &r_min,float& r_max r_max = distance + length; } -inline real_t AABB::get_longest_axis_size() const { +inline real_t Rect3::get_longest_axis_size() const { real_t max_size=size.x; @@ -319,7 +319,7 @@ inline real_t AABB::get_longest_axis_size() const { return max_size; } -inline real_t AABB::get_shortest_axis_size() const { +inline real_t Rect3::get_shortest_axis_size() const { real_t max_size=size.x; @@ -334,7 +334,7 @@ inline real_t AABB::get_shortest_axis_size() const { return max_size; } -bool AABB::smits_intersect_ray(const Vector3 &from,const Vector3& dir, float t0, float t1) const { +bool Rect3::smits_intersect_ray(const Vector3 &from,const Vector3& dir, float t0, float t1) const { float divx=1.0/dir.x; float divy=1.0/dir.y; @@ -381,7 +381,7 @@ bool AABB::smits_intersect_ray(const Vector3 &from,const Vector3& dir, float t0, return ( (tmin < t1) && (tmax > t0) ); } -void AABB::grow_by(real_t p_amount) { +void Rect3::grow_by(real_t p_amount) { pos.x-=p_amount; pos.y-=p_amount; @@ -391,6 +391,5 @@ void AABB::grow_by(real_t p_amount) { size.z+=2.0*p_amount; } -typedef AABB Rect3; #endif // AABB_H diff --git a/core/math/bsp_tree.cpp b/core/math/bsp_tree.cpp index d16495217c..b888b6b56c 100644 --- a/core/math/bsp_tree.cpp +++ b/core/math/bsp_tree.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,7 +31,7 @@ #include "print_string.h" -void BSP_Tree::from_aabb(const AABB& p_aabb) { +void BSP_Tree::from_aabb(const Rect3& p_aabb) { planes.clear(); @@ -67,7 +67,7 @@ Vector<Plane> BSP_Tree::get_planes() const { return planes; } -AABB BSP_Tree::get_aabb() const { +Rect3 BSP_Tree::get_aabb() const { return aabb; } @@ -484,7 +484,7 @@ BSP_Tree::operator Variant() const { d["planes"]=plane_values; - DVector<int> dst_nodes; + PoolVector<int> dst_nodes; dst_nodes.resize(nodes.size()*3); for(int i=0;i<nodes.size();i++) { @@ -514,19 +514,19 @@ BSP_Tree::BSP_Tree(const Variant& p_variant) { ERR_FAIL_COND(!d.has("aabb")); ERR_FAIL_COND(!d.has("error_radius")); - DVector<int> src_nodes = d["nodes"]; + PoolVector<int> src_nodes = d["nodes"]; ERR_FAIL_COND(src_nodes.size()%3); - if (d["planes"].get_type()==Variant::REAL_ARRAY) { + if (d["planes"].get_type()==Variant::POOL_REAL_ARRAY) { - DVector<float> src_planes=d["planes"]; + PoolVector<float> src_planes=d["planes"]; int plane_count=src_planes.size(); ERR_FAIL_COND(plane_count%4); planes.resize(plane_count/4); if (plane_count) { - DVector<float>::Read r = src_planes.read(); + PoolVector<float>::Read r = src_planes.read(); for(int i=0;i<plane_count/4;i++) { planes[i].normal.x=r[i*4+0]; @@ -549,7 +549,7 @@ BSP_Tree::BSP_Tree(const Variant& p_variant) { // int node_count = src_nodes.size(); nodes.resize(src_nodes.size()/3); - DVector<int>::Read r = src_nodes.read(); + PoolVector<int>::Read r = src_nodes.read(); for(int i=0;i<nodes.size();i++) { @@ -560,12 +560,12 @@ BSP_Tree::BSP_Tree(const Variant& p_variant) { } -BSP_Tree::BSP_Tree(const DVector<Face3>& p_faces,float p_error_radius) { +BSP_Tree::BSP_Tree(const PoolVector<Face3>& p_faces,float p_error_radius) { // compute aabb int face_count=p_faces.size(); - DVector<Face3>::Read faces_r=p_faces.read(); + PoolVector<Face3>::Read faces_r=p_faces.read(); const Face3 *facesptr = faces_r.ptr(); @@ -613,7 +613,7 @@ BSP_Tree::BSP_Tree(const DVector<Face3>& p_faces,float p_error_radius) { error_radius=p_error_radius; } -BSP_Tree::BSP_Tree(const Vector<Node> &p_nodes, const Vector<Plane> &p_planes, const AABB& p_aabb,float p_error_radius) { +BSP_Tree::BSP_Tree(const Vector<Node> &p_nodes, const Vector<Plane> &p_planes, const Rect3& p_aabb,float p_error_radius) { nodes=p_nodes; planes=p_planes; diff --git a/core/math/bsp_tree.h b/core/math/bsp_tree.h index 6c36d80e3e..e01df96555 100644 --- a/core/math/bsp_tree.h +++ b/core/math/bsp_tree.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -65,7 +65,7 @@ private: Vector<Node> nodes; Vector<Plane> planes; - AABB aabb; + Rect3 aabb; float error_radius; int _get_points_inside(int p_node,const Vector3* p_points,int *p_indices, const Vector3& p_center,const Vector3& p_half_extents,int p_indices_count) const; @@ -78,7 +78,7 @@ public: bool is_empty() const { return nodes.size()==0; } Vector<Node> get_nodes() const; Vector<Plane> get_planes() const; - AABB get_aabb() const; + Rect3 get_aabb() const; bool point_is_inside(const Vector3& p_point) const; int get_points_inside(const Vector3* p_points, int p_point_count) const; @@ -87,12 +87,12 @@ public: operator Variant() const; - void from_aabb(const AABB& p_aabb); + void from_aabb(const Rect3& p_aabb); BSP_Tree(); BSP_Tree(const Variant& p_variant); - BSP_Tree(const DVector<Face3>& p_faces,float p_error_radius=0); - BSP_Tree(const Vector<Node> &p_nodes, const Vector<Plane> &p_planes, const AABB& p_aabb,float p_error_radius=0); + BSP_Tree(const PoolVector<Face3>& p_faces,float p_error_radius=0); + BSP_Tree(const Vector<Node> &p_nodes, const Vector<Plane> &p_planes, const Rect3& p_aabb,float p_error_radius=0); ~BSP_Tree(); }; diff --git a/core/math/camera_matrix.cpp b/core/math/camera_matrix.cpp index f7dd8839b8..c44ff4682a 100644 --- a/core/math/camera_matrix.cpp +++ b/core/math/camera_matrix.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -54,7 +54,7 @@ void CameraMatrix::set_zero() { } -Plane CameraMatrix::xform4(const Plane& p_vec4) { +Plane CameraMatrix::xform4(const Plane& p_vec4) const { Plane ret; @@ -495,6 +495,28 @@ void CameraMatrix::set_light_bias() { } +void CameraMatrix::set_light_atlas_rect(const Rect2& p_rect) { + + float *m=&matrix[0][0]; + + m[0]=p_rect.size.width, + m[1]=0.0, + m[2]=0.0, + m[3]=0.0, + m[4]=0.0, + m[5]=p_rect.size.height, + m[6]=0.0, + m[7]=0.0, + m[8]=0.0, + m[9]=0.0, + m[10]=1.0, + m[11]=0.0, + m[12]=p_rect.pos.x, + m[13]=p_rect.pos.y, + m[14]=0.0, + m[15]=1.0; +} + CameraMatrix::operator String() const { String str; @@ -512,6 +534,15 @@ float CameraMatrix::get_aspect() const { return w/h; } +int CameraMatrix::get_pixels_per_meter(int p_for_pixel_width) const { + + + Vector3 result = xform(Vector3(1,0,-1)); + + return int((result.x * 0.5 + 0.5) * p_for_pixel_width); + +} + float CameraMatrix::get_fov() const { const float * matrix = (const float*)this->matrix; @@ -533,7 +564,7 @@ void CameraMatrix::make_scale(const Vector3 &p_scale) { } -void CameraMatrix::scale_translate_to_fit(const AABB& p_aabb) { +void CameraMatrix::scale_translate_to_fit(const Rect3& p_aabb) { Vector3 min = p_aabb.pos; Vector3 max = p_aabb.pos+p_aabb.size; diff --git a/core/math/camera_matrix.h b/core/math/camera_matrix.h index d192b1fef1..952f1e8fb2 100644 --- a/core/math/camera_matrix.h +++ b/core/math/camera_matrix.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -30,6 +30,7 @@ #define CAMERA_MATRIX_H #include "transform.h" +#include "math_2d.h" /** @author Juan Linietsky <reduzio@gmail.com> */ @@ -53,6 +54,7 @@ struct CameraMatrix { void set_identity(); void set_zero(); void set_light_bias(); + void set_light_atlas_rect(const Rect2& p_rect); void set_perspective(float p_fovy_degrees, float p_aspect, float p_z_near, float p_z_far,bool p_flip_fov=false); void set_orthogonal(float p_left, float p_right, float p_bottom, float p_top, float p_znear, float p_zfar); void set_orthogonal(float p_size, float p_aspect, float p_znear, float p_zfar,bool p_flip_fov=false); @@ -78,13 +80,14 @@ struct CameraMatrix { CameraMatrix operator*(const CameraMatrix& p_matrix) const; - Plane xform4(const Plane& p_vec4); + Plane xform4(const Plane& p_vec4) const; _FORCE_INLINE_ Vector3 xform(const Vector3& p_vec3) const; operator String() const; - void scale_translate_to_fit(const AABB& p_aabb); + void scale_translate_to_fit(const Rect3& p_aabb); void make_scale(const Vector3 &p_scale); + int get_pixels_per_meter(int p_for_pixel_width) const; operator Transform() const; CameraMatrix(); diff --git a/core/math/face3.cpp b/core/math/face3.cpp index e1af91f28e..faf124593e 100644 --- a/core/math/face3.cpp +++ b/core/math/face3.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -205,7 +205,7 @@ ClockDirection Face3::get_clock_dir() const { } -bool Face3::intersects_aabb(const AABB& p_aabb) const { +bool Face3::intersects_aabb(const Rect3& p_aabb) const { /** TEST PLANE **/ if (!p_aabb.intersects_plane( get_plane() )) diff --git a/core/math/face3.h b/core/math/face3.h index 3a81da74db..f08eb227b1 100644 --- a/core/math/face3.h +++ b/core/math/face3.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -78,16 +78,16 @@ public: void get_support(const Vector3& p_normal,const Transform& p_transform,Vector3 *p_vertices,int* p_count,int p_max) const; void project_range(const Vector3& p_normal,const Transform& p_transform,float& r_min, float& r_max) const; - AABB get_aabb() const { + Rect3 get_aabb() const { - AABB aabb( vertex[0], Vector3() ); + Rect3 aabb( vertex[0], Vector3() ); aabb.expand_to( vertex[1] ); aabb.expand_to( vertex[2] ); return aabb; } - bool intersects_aabb(const AABB& p_aabb) const; - _FORCE_INLINE_ bool intersects_aabb2(const AABB& p_aabb) const; + bool intersects_aabb(const Rect3& p_aabb) const; + _FORCE_INLINE_ bool intersects_aabb2(const Rect3& p_aabb) const; operator String() const; inline Face3() {} @@ -96,7 +96,7 @@ public: }; -bool Face3::intersects_aabb2(const AABB& p_aabb) const { +bool Face3::intersects_aabb2(const Rect3& p_aabb) const { Vector3 perp = (vertex[0]-vertex[2]).cross(vertex[0]-vertex[1]); diff --git a/core/math/geometry.cpp b/core/math/geometry.cpp index 790903eff5..bf3364a052 100644 --- a/core/math/geometry.cpp +++ b/core/math/geometry.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -204,21 +204,21 @@ static bool _group_face(_FaceClassify *p_faces, int len, int p_index,int p_group } -DVector< DVector< Face3 > > Geometry::separate_objects( DVector< Face3 > p_array ) { +PoolVector< PoolVector< Face3 > > Geometry::separate_objects( PoolVector< Face3 > p_array ) { - DVector< DVector< Face3 > > objects; + PoolVector< PoolVector< Face3 > > objects; int len = p_array.size(); - DVector<Face3>::Read r=p_array.read(); + PoolVector<Face3>::Read r=p_array.read(); const Face3* arrayptr = r.ptr(); - DVector< _FaceClassify> fc; + PoolVector< _FaceClassify> fc; fc.resize( len ); - DVector< _FaceClassify >::Write fcw=fc.write(); + PoolVector< _FaceClassify >::Write fcw=fc.write(); _FaceClassify * _fcptr = fcw.ptr(); @@ -231,7 +231,7 @@ DVector< DVector< Face3 > > Geometry::separate_objects( DVector< Face3 > p_array if (error) { - ERR_FAIL_COND_V(error, DVector< DVector< Face3 > >() ); // invalid geometry + ERR_FAIL_COND_V(error, PoolVector< PoolVector< Face3 > >() ); // invalid geometry } /* group connected faces in separate objects */ @@ -257,8 +257,8 @@ DVector< DVector< Face3 > > Geometry::separate_objects( DVector< Face3 > p_array if (group>=0) { objects.resize(group); - DVector< DVector<Face3> >::Write obw=objects.write(); - DVector< Face3 > *group_faces = obw.ptr(); + PoolVector< PoolVector<Face3> >::Write obw=objects.write(); + PoolVector< Face3 > *group_faces = obw.ptr(); for (int i=0;i<len;i++) { if (!_fcptr[i].valid) @@ -304,7 +304,7 @@ enum _CellFlags { static inline void _plot_face(uint8_t*** p_cell_status,int x,int y,int z,int len_x,int len_y,int len_z,const Vector3& voxelsize,const Face3& p_face) { - AABB aabb( Vector3(x,y,z),Vector3(len_x,len_y,len_z)); + Rect3 aabb( Vector3(x,y,z),Vector3(len_x,len_y,len_z)); aabb.pos=aabb.pos*voxelsize; aabb.size=aabb.size*voxelsize; @@ -487,7 +487,7 @@ static inline void _mark_outside(uint8_t*** p_cell_status,int x,int y,int z,int } } -static inline void _build_faces(uint8_t*** p_cell_status,int x,int y,int z,int len_x,int len_y,int len_z,DVector<Face3>& p_faces) { +static inline void _build_faces(uint8_t*** p_cell_status,int x,int y,int z,int len_x,int len_y,int len_z,PoolVector<Face3>& p_faces) { ERR_FAIL_INDEX(x,len_x); ERR_FAIL_INDEX(y,len_y); @@ -580,16 +580,16 @@ static inline void _build_faces(uint8_t*** p_cell_status,int x,int y,int z,int l } -DVector< Face3 > Geometry::wrap_geometry( DVector< Face3 > p_array,float *p_error ) { +PoolVector< Face3 > Geometry::wrap_geometry( PoolVector< Face3 > p_array,float *p_error ) { #define _MIN_SIZE 1.0 #define _MAX_LENGTH 20 int face_count=p_array.size(); - DVector<Face3>::Read facesr=p_array.read(); + PoolVector<Face3>::Read facesr=p_array.read(); const Face3 *faces = facesr.ptr(); - AABB global_aabb; + Rect3 global_aabb; for(int i=0;i<face_count;i++) { @@ -696,7 +696,7 @@ DVector< Face3 > Geometry::wrap_geometry( DVector< Face3 > p_array,float *p_erro //print_line("Wrapper (3/6): Building Faces"); - DVector<Face3> wrapped_faces; + PoolVector<Face3> wrapped_faces; for (int i=0;i<div_x;i++) { @@ -714,7 +714,7 @@ DVector< Face3 > Geometry::wrap_geometry( DVector< Face3 > p_array,float *p_erro // transform face vertices to global coords int wrapped_faces_count=wrapped_faces.size(); - DVector<Face3>::Write wrapped_facesw=wrapped_faces.write(); + PoolVector<Face3>::Write wrapped_facesw=wrapped_faces.write(); Face3* wrapped_faces_ptr=wrapped_facesw.ptr(); for(int i=0;i<wrapped_faces_count;i++) { @@ -748,7 +748,7 @@ DVector< Face3 > Geometry::wrap_geometry( DVector< Face3 > p_array,float *p_erro return wrapped_faces; } -Geometry::MeshData Geometry::build_convex_mesh(const DVector<Plane> &p_planes) { +Geometry::MeshData Geometry::build_convex_mesh(const PoolVector<Plane> &p_planes) { MeshData mesh; @@ -896,9 +896,9 @@ Geometry::MeshData Geometry::build_convex_mesh(const DVector<Plane> &p_planes) { } -DVector<Plane> Geometry::build_box_planes(const Vector3& p_extents) { +PoolVector<Plane> Geometry::build_box_planes(const Vector3& p_extents) { - DVector<Plane> planes; + PoolVector<Plane> planes; planes.push_back( Plane( Vector3(1,0,0), p_extents.x ) ); planes.push_back( Plane( Vector3(-1,0,0), p_extents.x ) ); @@ -910,9 +910,9 @@ DVector<Plane> Geometry::build_box_planes(const Vector3& p_extents) { return planes; } -DVector<Plane> Geometry::build_cylinder_planes(float p_radius, float p_height, int p_sides, Vector3::Axis p_axis) { +PoolVector<Plane> Geometry::build_cylinder_planes(float p_radius, float p_height, int p_sides, Vector3::Axis p_axis) { - DVector<Plane> planes; + PoolVector<Plane> planes; for (int i=0;i<p_sides;i++) { @@ -933,10 +933,10 @@ DVector<Plane> Geometry::build_cylinder_planes(float p_radius, float p_height, i } -DVector<Plane> Geometry::build_sphere_planes(float p_radius, int p_lats,int p_lons, Vector3::Axis p_axis) { +PoolVector<Plane> Geometry::build_sphere_planes(float p_radius, int p_lats,int p_lons, Vector3::Axis p_axis) { - DVector<Plane> planes; + PoolVector<Plane> planes; Vector3 axis; axis[p_axis]=1.0; @@ -969,9 +969,9 @@ DVector<Plane> Geometry::build_sphere_planes(float p_radius, int p_lats,int p_lo } -DVector<Plane> Geometry::build_capsule_planes(float p_radius, float p_height, int p_sides, int p_lats, Vector3::Axis p_axis) { +PoolVector<Plane> Geometry::build_capsule_planes(float p_radius, float p_height, int p_sides, int p_lats, Vector3::Axis p_axis) { - DVector<Plane> planes; + PoolVector<Plane> planes; Vector3 axis; axis[p_axis]=1.0; diff --git a/core/math/geometry.h b/core/math/geometry.h index b353423851..9800e5513c 100644 --- a/core/math/geometry.h +++ b/core/math/geometry.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -808,9 +808,9 @@ public: } - static DVector< DVector< Face3 > > separate_objects( DVector< Face3 > p_array ); + static PoolVector< PoolVector< Face3 > > separate_objects( PoolVector< Face3 > p_array ); - static DVector< Face3 > wrap_geometry( DVector< Face3 > p_array, float *p_error=NULL ); ///< create a "wrap" that encloses the given geometry + static PoolVector< Face3 > wrap_geometry( PoolVector< Face3 > p_array, float *p_error=NULL ); ///< create a "wrap" that encloses the given geometry struct MeshData { @@ -919,11 +919,11 @@ public: return H; } - static MeshData build_convex_mesh(const DVector<Plane> &p_planes); - static DVector<Plane> build_sphere_planes(float p_radius, int p_lats, int p_lons, Vector3::Axis p_axis=Vector3::AXIS_Z); - static DVector<Plane> build_box_planes(const Vector3& p_extents); - static DVector<Plane> build_cylinder_planes(float p_radius, float p_height, int p_sides, Vector3::Axis p_axis=Vector3::AXIS_Z); - static DVector<Plane> build_capsule_planes(float p_radius, float p_height, int p_sides, int p_lats, Vector3::Axis p_axis=Vector3::AXIS_Z); + static MeshData build_convex_mesh(const PoolVector<Plane> &p_planes); + static PoolVector<Plane> build_sphere_planes(float p_radius, int p_lats, int p_lons, Vector3::Axis p_axis=Vector3::AXIS_Z); + static PoolVector<Plane> build_box_planes(const Vector3& p_extents); + static PoolVector<Plane> build_cylinder_planes(float p_radius, float p_height, int p_sides, Vector3::Axis p_axis=Vector3::AXIS_Z); + static PoolVector<Plane> build_capsule_planes(float p_radius, float p_height, int p_sides, int p_lats, Vector3::Axis p_axis=Vector3::AXIS_Z); static void make_atlas(const Vector<Size2i>& p_rects,Vector<Point2i>& r_result, Size2i& r_size); diff --git a/core/math/math_2d.cpp b/core/math/math_2d.cpp index e616f05914..c6860ba2e8 100644 --- a/core/math/math_2d.cpp +++ b/core/math/math_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,22 +31,22 @@ real_t Vector2::angle() const { - return Math::atan2(x,y); + return Math::atan2(y,x); } -float Vector2::length() const { +real_t Vector2::length() const { return Math::sqrt( x*x + y*y ); } -float Vector2::length_squared() const { +real_t Vector2::length_squared() const { return x*x + y*y; } void Vector2::normalize() { - float l = x*x + y*y; + real_t l = x*x + y*y; if (l!=0) { l=Math::sqrt(l); @@ -62,32 +62,32 @@ Vector2 Vector2::normalized() const { return v; } -float Vector2::distance_to(const Vector2& p_vector2) const { +real_t Vector2::distance_to(const Vector2& p_vector2) const { return Math::sqrt( (x-p_vector2.x)*(x-p_vector2.x) + (y-p_vector2.y)*(y-p_vector2.y)); } -float Vector2::distance_squared_to(const Vector2& p_vector2) const { +real_t Vector2::distance_squared_to(const Vector2& p_vector2) const { return (x-p_vector2.x)*(x-p_vector2.x) + (y-p_vector2.y)*(y-p_vector2.y); } -float Vector2::angle_to(const Vector2& p_vector2) const { +real_t Vector2::angle_to(const Vector2& p_vector2) const { - return Math::atan2( tangent().dot(p_vector2), dot(p_vector2) ); + return Math::atan2( cross(p_vector2), dot(p_vector2) ); } -float Vector2::angle_to_point(const Vector2& p_vector2) const { +real_t Vector2::angle_to_point(const Vector2& p_vector2) const { - return Math::atan2( x-p_vector2.x, y - p_vector2.y ); + return Math::atan2( y - p_vector2.y, x-p_vector2.x ); } -float Vector2::dot(const Vector2& p_other) const { +real_t Vector2::dot(const Vector2& p_other) const { return x*p_other.x + y*p_other.y; } -float Vector2::cross(const Vector2& p_other) const { +real_t Vector2::cross(const Vector2& p_other) const { return x*p_other.y - y*p_other.x; } @@ -120,11 +120,11 @@ Vector2 Vector2::operator*(const Vector2 &p_v1) const { return Vector2(x * p_v1.x, y * p_v1.y); }; -Vector2 Vector2::operator*(const float &rvalue) const { +Vector2 Vector2::operator*(const real_t &rvalue) const { return Vector2(x * rvalue, y * rvalue); }; -void Vector2::operator*=(const float &rvalue) { +void Vector2::operator*=(const real_t &rvalue) { x *= rvalue; y *= rvalue; }; @@ -134,12 +134,12 @@ Vector2 Vector2::operator/(const Vector2 &p_v1) const { return Vector2(x / p_v1.x, y / p_v1.y); }; -Vector2 Vector2::operator/(const float &rvalue) const { +Vector2 Vector2::operator/(const real_t &rvalue) const { return Vector2(x / rvalue, y / rvalue); }; -void Vector2::operator/=(const float &rvalue) { +void Vector2::operator/=(const real_t &rvalue) { x /= rvalue; y /= rvalue; }; @@ -162,7 +162,7 @@ Vector2 Vector2::floor() const { return Vector2( Math::floor(x), Math::floor(y) ); } -Vector2 Vector2::rotated(float p_by) const { +Vector2 Vector2::rotated(real_t p_by) const { Vector2 v; v.set_rotation(angle()+p_by); @@ -198,7 +198,7 @@ Vector2 Vector2::clamped(real_t p_len) const { return v; } -Vector2 Vector2::cubic_interpolate_soft(const Vector2& p_b,const Vector2& p_pre_a, const Vector2& p_post_b,float p_t) const { +Vector2 Vector2::cubic_interpolate_soft(const Vector2& p_b,const Vector2& p_pre_a, const Vector2& p_post_b,real_t p_t) const { #if 0 k[0] = ((*this) (vi[0] + 1, vi[1], vi[2])) - ((*this) (vi[0], vi[1],vi[2])); //fk = a0 @@ -219,13 +219,13 @@ Vector2 Vector2::cubic_interpolate_soft(const Vector2& p_b,const Vector2& p_pre_ //dk = (fk+1 - fk-1)*0.5 //Dk = (fk+1 - fk) - float dk = + real_t dk = #endif return Vector2(); } -Vector2 Vector2::cubic_interpolate(const Vector2& p_b,const Vector2& p_pre_a, const Vector2& p_post_b,float p_t) const { +Vector2 Vector2::cubic_interpolate(const Vector2& p_b,const Vector2& p_pre_a, const Vector2& p_post_b,real_t p_t) const { @@ -234,9 +234,9 @@ Vector2 Vector2::cubic_interpolate(const Vector2& p_b,const Vector2& p_pre_a, co Vector2 p2=p_b; Vector2 p3=p_post_b; - float t = p_t; - float t2 = t * t; - float t3 = t2 * t; + real_t t = p_t; + real_t t2 = t * t; + real_t t3 = t2 * t; Vector2 out; out = 0.5f * ( ( p1 * 2.0f) + @@ -246,8 +246,8 @@ Vector2 Vector2::cubic_interpolate(const Vector2& p_b,const Vector2& p_pre_a, co return out; /* - float mu = p_t; - float mu2 = mu*mu; + real_t mu = p_t; + real_t mu2 = mu*mu; Vector2 a0 = p_post_b - p_b - p_pre_a + *this; Vector2 a1 = p_pre_a - *this - a0; @@ -257,7 +257,7 @@ Vector2 Vector2::cubic_interpolate(const Vector2& p_b,const Vector2& p_pre_a, co return ( a0*mu*mu2 + a1*mu2 + a2*mu + a3 ); */ /* - float t = p_t; + real_t t = p_t; real_t t2 = t*t; real_t t3 = t2*t; @@ -291,7 +291,7 @@ bool Rect2::intersects_segment(const Point2& p_from, const Point2& p_to, Point2* real_t min=0,max=1; int axis=0; - float sign=0; + real_t sign=0; for(int i=0;i<2;i++) { real_t seg_from=p_from[i]; @@ -299,7 +299,7 @@ bool Rect2::intersects_segment(const Point2& p_from, const Point2& p_to, Point2* real_t box_begin=pos[i]; real_t box_end=box_begin+size[i]; real_t cmin,cmax; - float csign; + real_t csign; if (seg_from < seg_to) { @@ -408,25 +408,26 @@ bool Point2i::operator!=(const Point2i& p_vec2) const { return x!=p_vec2.x || y!=p_vec2.y; } -void Matrix32::invert() { - +void Transform2D::invert() { + // FIXME: this function assumes the basis is a rotation matrix, with no scaling. + // Transform2D::affine_inverse can handle matrices with scaling, so GDScript should eventually use that. SWAP(elements[0][1],elements[1][0]); elements[2] = basis_xform(-elements[2]); } -Matrix32 Matrix32::inverse() const { +Transform2D Transform2D::inverse() const { - Matrix32 inv=*this; + Transform2D inv=*this; inv.invert(); return inv; } -void Matrix32::affine_invert() { +void Transform2D::affine_invert() { - float det = basis_determinant(); + real_t det = basis_determinant(); ERR_FAIL_COND(det==0); - float idet = 1.0 / det; + real_t idet = 1.0 / det; SWAP( elements[0][0],elements[1][1] ); elements[0]*=Vector2(idet,-idet); @@ -436,72 +437,74 @@ void Matrix32::affine_invert() { } -Matrix32 Matrix32::affine_inverse() const { +Transform2D Transform2D::affine_inverse() const { - Matrix32 inv=*this; + Transform2D inv=*this; inv.affine_invert(); return inv; } -void Matrix32::rotate(real_t p_phi) { - - Matrix32 rot(p_phi,Vector2()); - *this *= rot; +void Transform2D::rotate(real_t p_phi) { + *this = Transform2D(p_phi,Vector2()) * (*this); } -real_t Matrix32::get_rotation() const { - - return Math::atan2(elements[1].x,elements[1].y); +real_t Transform2D::get_rotation() const { + real_t det = basis_determinant(); + Transform2D m = orthonormalized(); + if (det < 0) { + m.scale_basis(Size2(-1,-1)); + } + return Math::atan2(m[0].y,m[0].x); } -void Matrix32::set_rotation(real_t p_rot) { +void Transform2D::set_rotation(real_t p_rot) { real_t cr = Math::cos(p_rot); real_t sr = Math::sin(p_rot); elements[0][0]=cr; + elements[0][1]=sr; + elements[1][0]=-sr; elements[1][1]=cr; - elements[0][1]=-sr; - elements[1][0]=sr; } -Matrix32::Matrix32(real_t p_rot, const Vector2& p_pos) { +Transform2D::Transform2D(real_t p_rot, const Vector2& p_pos) { real_t cr = Math::cos(p_rot); real_t sr = Math::sin(p_rot); elements[0][0]=cr; + elements[0][1]=sr; + elements[1][0]=-sr; elements[1][1]=cr; - elements[0][1]=-sr; - elements[1][0]=sr; elements[2]=p_pos; } -Size2 Matrix32::get_scale() const { - - return Size2( elements[0].length(), elements[1].length() ); +Size2 Transform2D::get_scale() const { + real_t det_sign = basis_determinant() > 0 ? 1 : -1; + return det_sign * Size2( elements[0].length(), elements[1].length() ); } -void Matrix32::scale(const Size2& p_scale) { - - elements[0]*=p_scale; - elements[1]*=p_scale; +void Transform2D::scale(const Size2& p_scale) { + scale_basis(p_scale); elements[2]*=p_scale; } -void Matrix32::scale_basis(const Size2& p_scale) { +void Transform2D::scale_basis(const Size2& p_scale) { - elements[0]*=p_scale; - elements[1]*=p_scale; + elements[0][0]*=p_scale.x; + elements[0][1]*=p_scale.y; + elements[1][0]*=p_scale.x; + elements[1][1]*=p_scale.y; } -void Matrix32::translate( real_t p_tx, real_t p_ty) { +void Transform2D::translate( real_t p_tx, real_t p_ty) { translate(Vector2(p_tx,p_ty)); } -void Matrix32::translate( const Vector2& p_translation ) { +void Transform2D::translate( const Vector2& p_translation ) { elements[2]+=basis_xform(p_translation); } -void Matrix32::orthonormalize() { +void Transform2D::orthonormalize() { // Gram-Schmidt Process @@ -515,15 +518,15 @@ void Matrix32::orthonormalize() { elements[0]=x; elements[1]=y; } -Matrix32 Matrix32::orthonormalized() const { +Transform2D Transform2D::orthonormalized() const { - Matrix32 on=*this; + Transform2D on=*this; on.orthonormalize(); return on; } -bool Matrix32::operator==(const Matrix32& p_transform) const { +bool Transform2D::operator==(const Transform2D& p_transform) const { for(int i=0;i<3;i++) { if (elements[i]!=p_transform.elements[i]) @@ -533,7 +536,7 @@ bool Matrix32::operator==(const Matrix32& p_transform) const { return true; } -bool Matrix32::operator!=(const Matrix32& p_transform) const { +bool Transform2D::operator!=(const Transform2D& p_transform) const { for(int i=0;i<3;i++) { if (elements[i]!=p_transform.elements[i]) @@ -544,11 +547,11 @@ bool Matrix32::operator!=(const Matrix32& p_transform) const { } -void Matrix32::operator*=(const Matrix32& p_transform) { +void Transform2D::operator*=(const Transform2D& p_transform) { elements[2] = xform(p_transform.elements[2]); - float x0,x1,y0,y1; + real_t x0,x1,y0,y1; x0 = tdotx(p_transform.elements[0]); x1 = tdoty(p_transform.elements[0]); @@ -562,59 +565,59 @@ void Matrix32::operator*=(const Matrix32& p_transform) { } -Matrix32 Matrix32::operator*(const Matrix32& p_transform) const { +Transform2D Transform2D::operator*(const Transform2D& p_transform) const { - Matrix32 t = *this; + Transform2D t = *this; t*=p_transform; return t; } -Matrix32 Matrix32::scaled(const Size2& p_scale) const { +Transform2D Transform2D::scaled(const Size2& p_scale) const { - Matrix32 copy=*this; + Transform2D copy=*this; copy.scale(p_scale); return copy; } -Matrix32 Matrix32::basis_scaled(const Size2& p_scale) const { +Transform2D Transform2D::basis_scaled(const Size2& p_scale) const { - Matrix32 copy=*this; + Transform2D copy=*this; copy.scale_basis(p_scale); return copy; } -Matrix32 Matrix32::untranslated() const { +Transform2D Transform2D::untranslated() const { - Matrix32 copy=*this; + Transform2D copy=*this; copy.elements[2]=Vector2(); return copy; } -Matrix32 Matrix32::translated(const Vector2& p_offset) const { +Transform2D Transform2D::translated(const Vector2& p_offset) const { - Matrix32 copy=*this; + Transform2D copy=*this; copy.translate(p_offset); return copy; } -Matrix32 Matrix32::rotated(float p_phi) const { +Transform2D Transform2D::rotated(real_t p_phi) const { - Matrix32 copy=*this; + Transform2D copy=*this; copy.rotate(p_phi); return copy; } -float Matrix32::basis_determinant() const { +real_t Transform2D::basis_determinant() const { return elements[0].x * elements[1].y - elements[0].y * elements[1].x; } -Matrix32 Matrix32::interpolate_with(const Matrix32& p_transform, float p_c) const { +Transform2D Transform2D::interpolate_with(const Transform2D& p_transform, real_t p_c) const { //extract parameters Vector2 p1 = get_origin(); @@ -645,12 +648,12 @@ Matrix32 Matrix32::interpolate_with(const Matrix32& p_transform, float p_c) cons } //construct matrix - Matrix32 res(Math::atan2(v.y, v.x), Vector2::linear_interpolate(p1, p2, p_c)); + Transform2D res(Math::atan2(v.y, v.x), Vector2::linear_interpolate(p1, p2, p_c)); res.scale_basis(Vector2::linear_interpolate(s1, s2, p_c)); return res; } -Matrix32::operator String() const { +Transform2D::operator String() const { return String(String()+elements[0]+", "+elements[1]+", "+elements[2]); } diff --git a/core/math/math_2d.h b/core/math/math_2d.h index 38c1ac9656..7896299c24 100644 --- a/core/math/math_2d.h +++ b/core/math/math_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -65,35 +65,35 @@ enum VAlign { struct Vector2 { union { - float x; - float width; + real_t x; + real_t width; }; union { - float y; - float height; + real_t y; + real_t height; }; - _FORCE_INLINE_ float& operator[](int p_idx) { + _FORCE_INLINE_ real_t& operator[](int p_idx) { return p_idx?y:x; } - _FORCE_INLINE_ const float& operator[](int p_idx) const { + _FORCE_INLINE_ const real_t& operator[](int p_idx) const { return p_idx?y:x; } void normalize(); Vector2 normalized() const; - float length() const; - float length_squared() const; + real_t length() const; + real_t length_squared() const; - float distance_to(const Vector2& p_vector2) const; - float distance_squared_to(const Vector2& p_vector2) const; - float angle_to(const Vector2& p_vector2) const; - float angle_to_point(const Vector2& p_vector2) const; + real_t distance_to(const Vector2& p_vector2) const; + real_t distance_squared_to(const Vector2& p_vector2) const; + real_t angle_to(const Vector2& p_vector2) const; + real_t angle_to_point(const Vector2& p_vector2) const; - float dot(const Vector2& p_other) const; - float cross(const Vector2& p_other) const; + real_t dot(const Vector2& p_other) const; + real_t cross(const Vector2& p_other) const; Vector2 cross(real_t p_other) const; Vector2 project(const Vector2& p_vec) const; @@ -101,10 +101,10 @@ struct Vector2 { Vector2 clamped(real_t p_len) const; - _FORCE_INLINE_ static Vector2 linear_interpolate(const Vector2& p_a, const Vector2& p_b,float p_t); - _FORCE_INLINE_ Vector2 linear_interpolate(const Vector2& p_b,float p_t) const; - Vector2 cubic_interpolate(const Vector2& p_b,const Vector2& p_pre_a, const Vector2& p_post_b,float p_t) const; - Vector2 cubic_interpolate_soft(const Vector2& p_b,const Vector2& p_pre_a, const Vector2& p_post_b,float p_t) const; + _FORCE_INLINE_ static Vector2 linear_interpolate(const Vector2& p_a, const Vector2& p_b,real_t p_t); + _FORCE_INLINE_ Vector2 linear_interpolate(const Vector2& p_b,real_t p_t) const; + Vector2 cubic_interpolate(const Vector2& p_b,const Vector2& p_pre_a, const Vector2& p_post_b,real_t p_t) const; + Vector2 cubic_interpolate_soft(const Vector2& p_b,const Vector2& p_pre_a, const Vector2& p_post_b,real_t p_t) const; Vector2 slide(const Vector2& p_vec) const; Vector2 reflect(const Vector2& p_vec) const; @@ -115,15 +115,15 @@ struct Vector2 { void operator-=(const Vector2& p_v); Vector2 operator*(const Vector2 &p_v1) const; - Vector2 operator*(const float &rvalue) const; - void operator*=(const float &rvalue); + Vector2 operator*(const real_t &rvalue) const; + void operator*=(const real_t &rvalue); void operator*=(const Vector2 &rvalue) { *this = *this * rvalue; } Vector2 operator/(const Vector2 &p_v1) const; - Vector2 operator/(const float &rvalue) const; + Vector2 operator/(const real_t &rvalue) const; - void operator/=(const float &rvalue); + void operator/=(const real_t &rvalue); Vector2 operator-() const; @@ -135,10 +135,10 @@ struct Vector2 { real_t angle() const; - void set_rotation(float p_radians) { + void set_rotation(real_t p_radians) { - x=Math::sin(p_radians); - y=Math::cos(p_radians); + x=Math::cos(p_radians); + y=Math::sin(p_radians); } _FORCE_INLINE_ Vector2 abs() const { @@ -146,7 +146,7 @@ struct Vector2 { return Vector2( Math::abs(x), Math::abs(y) ); } - Vector2 rotated(float p_by) const; + Vector2 rotated(real_t p_by) const; Vector2 tangent() const { return Vector2(y,-x); @@ -154,12 +154,12 @@ struct Vector2 { Vector2 floor() const; Vector2 snapped(const Vector2& p_by) const; - float get_aspect() const { return width/height; } + real_t get_aspect() const { return width/height; } operator String() const { return String::num(x)+", "+String::num(y); } - _FORCE_INLINE_ Vector2(float p_x,float p_y) { x=p_x; y=p_y; } + _FORCE_INLINE_ Vector2(real_t p_x,real_t p_y) { x=p_x; y=p_y; } _FORCE_INLINE_ Vector2() { x=0; y=0; } }; @@ -169,12 +169,12 @@ _FORCE_INLINE_ Vector2 Vector2::plane_project(real_t p_d, const Vector2& p_vec) } -_FORCE_INLINE_ Vector2 operator*(float p_scalar, const Vector2& p_vec) { +_FORCE_INLINE_ Vector2 operator*(real_t p_scalar, const Vector2& p_vec) { return p_vec*p_scalar; } -Vector2 Vector2::linear_interpolate(const Vector2& p_b,float p_t) const { +Vector2 Vector2::linear_interpolate(const Vector2& p_b,real_t p_t) const { Vector2 res=*this; @@ -185,7 +185,7 @@ Vector2 Vector2::linear_interpolate(const Vector2& p_b,float p_t) const { } -Vector2 Vector2::linear_interpolate(const Vector2& p_a, const Vector2& p_b,float p_t) { +Vector2 Vector2::linear_interpolate(const Vector2& p_a, const Vector2& p_b,real_t p_t) { Vector2 res=p_a; @@ -198,7 +198,7 @@ Vector2 Vector2::linear_interpolate(const Vector2& p_a, const Vector2& p_b,float typedef Vector2 Size2; typedef Vector2 Point2; -struct Matrix32; +struct Transform2D; struct Rect2 { @@ -211,7 +211,7 @@ struct Rect2 { const Vector2& get_size() const { return size; } void set_size(const Vector2& p_size) { size=p_size; } - float get_area() const { return size.width*size.height; } + real_t get_area() const { return size.width*size.height; } inline bool intersects(const Rect2& p_rect) const { if ( pos.x >= (p_rect.pos.x + p_rect.size.width) ) @@ -226,9 +226,9 @@ struct Rect2 { return true; } - inline float distance_to(const Vector2& p_point) const { + inline real_t distance_to(const Vector2& p_point) const { - float dist = 1e20; + real_t dist = 1e20; if (p_point.x < pos.x) { dist=MIN(dist,pos.x-p_point.x); @@ -249,7 +249,7 @@ struct Rect2 { return dist; } - _FORCE_INLINE_ bool intersects_transformed(const Matrix32& p_xform, const Rect2& p_rect) const; + _FORCE_INLINE_ bool intersects_transformed(const Transform2D& p_xform, const Rect2& p_rect) const; bool intersects_segment(const Point2& p_from, const Point2& p_to, Point2* r_pos=NULL, Point2* r_normal=NULL) const; @@ -359,7 +359,7 @@ struct Rect2 { operator String() const { return String(pos)+", "+String(size); } Rect2() {} - Rect2( float p_x, float p_y, float p_width, float p_height) { pos=Point2(p_x,p_y); size=Size2( p_width, p_height ); } + Rect2( real_t p_x, real_t p_y, real_t p_width, real_t p_height) { pos=Point2(p_x,p_y); size=Size2( p_width, p_height ); } Rect2( const Point2& p_pos, const Size2& p_size ) { pos=p_pos; size=p_size; } }; @@ -407,7 +407,7 @@ struct Point2i { bool operator==(const Point2i& p_vec2) const; bool operator!=(const Point2i& p_vec2) const; - float get_aspect() const { return width/(float)height; } + real_t get_aspect() const { return width/(real_t)height; } operator String() const { return String::num(x)+", "+String::num(y); } @@ -551,12 +551,22 @@ struct Rect2i { -struct Matrix32 { +struct Transform2D { + // Warning #1: basis of Transform2D is stored differently from Basis. In terms of elements array, the basis matrix looks like "on paper": + // M = (elements[0][0] elements[1][0]) + // (elements[0][1] elements[1][1]) + // This is such that the columns, which can be interpreted as basis vectors of the coordinate system "painted" on the object, can be accessed as elements[i]. + // Note that this is the opposite of the indices in mathematical texts, meaning: $M_{12}$ in a math book corresponds to elements[1][0] here. + // This requires additional care when working with explicit indices. + // See https://en.wikipedia.org/wiki/Row-_and_column-major_order for further reading. + + // Warning #2: 2D be aware that unlike 3D code, 2D code uses a left-handed coordinate system: Y-axis points down, + // and angle is measure from +X to +Y in a clockwise-fashion. Vector2 elements[3]; - _FORCE_INLINE_ float tdotx(const Vector2& v) const { return elements[0][0] * v.x + elements[1][0] * v.y; } - _FORCE_INLINE_ float tdoty(const Vector2& v) const { return elements[0][1] * v.x + elements[1][1] * v.y; } + _FORCE_INLINE_ real_t tdotx(const Vector2& v) const { return elements[0][0] * v.x + elements[1][0] * v.y; } + _FORCE_INLINE_ real_t tdoty(const Vector2& v) const { return elements[0][1] * v.x + elements[1][1] * v.y; } const Vector2& operator[](int p_idx) const { return elements[p_idx]; } Vector2& operator[](int p_idx) { return elements[p_idx]; } @@ -565,10 +575,10 @@ struct Matrix32 { _FORCE_INLINE_ void set_axis(int p_axis,const Vector2& p_vec) { ERR_FAIL_INDEX(p_axis,3); elements[p_axis]=p_vec; } void invert(); - Matrix32 inverse() const; + Transform2D inverse() const; void affine_invert(); - Matrix32 affine_inverse() const; + Transform2D affine_inverse() const; void set_rotation(real_t p_phi); real_t get_rotation() const; @@ -580,30 +590,30 @@ struct Matrix32 { void translate( real_t p_tx, real_t p_ty); void translate( const Vector2& p_translation ); - float basis_determinant() const; + real_t basis_determinant() const; Size2 get_scale() const; _FORCE_INLINE_ const Vector2& get_origin() const { return elements[2]; } _FORCE_INLINE_ void set_origin(const Vector2& p_origin) { elements[2]=p_origin; } - Matrix32 scaled(const Size2& p_scale) const; - Matrix32 basis_scaled(const Size2& p_scale) const; - Matrix32 translated(const Vector2& p_offset) const; - Matrix32 rotated(float p_phi) const; + Transform2D scaled(const Size2& p_scale) const; + Transform2D basis_scaled(const Size2& p_scale) const; + Transform2D translated(const Vector2& p_offset) const; + Transform2D rotated(real_t p_phi) const; - Matrix32 untranslated() const; + Transform2D untranslated() const; void orthonormalize(); - Matrix32 orthonormalized() const; + Transform2D orthonormalized() const; - bool operator==(const Matrix32& p_transform) const; - bool operator!=(const Matrix32& p_transform) const; + bool operator==(const Transform2D& p_transform) const; + bool operator!=(const Transform2D& p_transform) const; - void operator*=(const Matrix32& p_transform); - Matrix32 operator*(const Matrix32& p_transform) const; + void operator*=(const Transform2D& p_transform); + Transform2D operator*(const Transform2D& p_transform) const; - Matrix32 interpolate_with(const Matrix32& p_transform, float p_c) const; + Transform2D interpolate_with(const Transform2D& p_transform, real_t p_c) const; _FORCE_INLINE_ Vector2 basis_xform(const Vector2& p_vec) const; _FORCE_INLINE_ Vector2 basis_xform_inv(const Vector2& p_vec) const; @@ -614,7 +624,7 @@ struct Matrix32 { operator String() const; - Matrix32(real_t xx, real_t xy, real_t yx, real_t yy, real_t ox, real_t oy) { + Transform2D(real_t xx, real_t xy, real_t yx, real_t yy, real_t ox, real_t oy) { elements[0][0] = xx; elements[0][1] = xy; @@ -624,11 +634,11 @@ struct Matrix32 { elements[2][1] = oy; } - Matrix32(real_t p_rot, const Vector2& p_pos); - Matrix32() { elements[0][0]=1.0; elements[1][1]=1.0; } + Transform2D(real_t p_rot, const Vector2& p_pos); + Transform2D() { elements[0][0]=1.0; elements[1][1]=1.0; } }; -bool Rect2::intersects_transformed(const Matrix32& p_xform, const Rect2& p_rect) const { +bool Rect2::intersects_transformed(const Transform2D& p_xform, const Rect2& p_rect) const { //SAT intersection between local and transformed rect2 @@ -783,7 +793,7 @@ bool Rect2::intersects_transformed(const Matrix32& p_xform, const Rect2& p_rect) } -Vector2 Matrix32::basis_xform(const Vector2& v) const { +Vector2 Transform2D::basis_xform(const Vector2& v) const { return Vector2( tdotx(v), @@ -791,7 +801,7 @@ Vector2 Matrix32::basis_xform(const Vector2& v) const { ); } -Vector2 Matrix32::basis_xform_inv(const Vector2& v) const{ +Vector2 Transform2D::basis_xform_inv(const Vector2& v) const{ return Vector2( elements[0].dot(v), @@ -799,14 +809,14 @@ Vector2 Matrix32::basis_xform_inv(const Vector2& v) const{ ); } -Vector2 Matrix32::xform(const Vector2& v) const { +Vector2 Transform2D::xform(const Vector2& v) const { return Vector2( tdotx(v), tdoty(v) ) + elements[2]; } -Vector2 Matrix32::xform_inv(const Vector2& p_vec) const { +Vector2 Transform2D::xform_inv(const Vector2& p_vec) const { Vector2 v = p_vec - elements[2]; @@ -816,7 +826,7 @@ Vector2 Matrix32::xform_inv(const Vector2& p_vec) const { ); } -Rect2 Matrix32::xform(const Rect2& p_rect) const { +Rect2 Transform2D::xform(const Rect2& p_rect) const { Vector2 x=elements[0]*p_rect.size.x; Vector2 y=elements[1]*p_rect.size.y; @@ -830,16 +840,16 @@ Rect2 Matrix32::xform(const Rect2& p_rect) const { return new_rect; } -void Matrix32::set_rotation_and_scale(real_t p_rot,const Size2& p_scale) { +void Transform2D::set_rotation_and_scale(real_t p_rot,const Size2& p_scale) { elements[0][0]=Math::cos(p_rot)*p_scale.x; elements[1][1]=Math::cos(p_rot)*p_scale.y; - elements[0][1]=-Math::sin(p_rot)*p_scale.x; - elements[1][0]=Math::sin(p_rot)*p_scale.y; + elements[1][0]=-Math::sin(p_rot)*p_scale.y; + elements[0][1]=Math::sin(p_rot)*p_scale.x; } -Rect2 Matrix32::xform_inv(const Rect2& p_rect) const { +Rect2 Transform2D::xform_inv(const Rect2& p_rect) const { Vector2 ends[4]={ xform_inv( p_rect.pos ), diff --git a/core/math/math_defs.h b/core/math/math_defs.h index e6a56c5e45..feaff38a44 100644 --- a/core/math/math_defs.h +++ b/core/math/math_defs.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/math_funcs.cpp b/core/math/math_funcs.cpp index 46c0218707..db1c52ccb4 100644 --- a/core/math/math_funcs.cpp +++ b/core/math/math_funcs.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h index fc76d96b2e..24081528f0 100644 --- a/core/math/math_funcs.h +++ b/core/math/math_funcs.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -96,6 +96,15 @@ public: static double random(double from, double to); + static _FORCE_INLINE_ bool isequal_approx(real_t a, real_t b) { + // TODO: Comparing floats for approximate-equality is non-trivial. + // Using epsilon should cover the typical cases in Godot (where a == b is used to compare two reals), such as matrix and vector comparison operators. + // A proper implementation in terms of ULPs should eventually replace the contents of this function. + // See https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ for details. + + return abs(a-b) < CMP_EPSILON; + } + static _FORCE_INLINE_ real_t abs(real_t g) { @@ -175,6 +184,108 @@ public: static double log(double x); static double exp(double x); + + static _FORCE_INLINE_ uint32_t halfbits_to_floatbits(uint16_t h) + { + uint16_t h_exp, h_sig; + uint32_t f_sgn, f_exp, f_sig; + + h_exp = (h&0x7c00u); + f_sgn = ((uint32_t)h&0x8000u) << 16; + switch (h_exp) { + case 0x0000u: /* 0 or subnormal */ + h_sig = (h&0x03ffu); + /* Signed zero */ + if (h_sig == 0) { + return f_sgn; + } + /* Subnormal */ + h_sig <<= 1; + while ((h_sig&0x0400u) == 0) { + h_sig <<= 1; + h_exp++; + } + f_exp = ((uint32_t)(127 - 15 - h_exp)) << 23; + f_sig = ((uint32_t)(h_sig&0x03ffu)) << 13; + return f_sgn + f_exp + f_sig; + case 0x7c00u: /* inf or NaN */ + /* All-ones exponent and a copy of the significand */ + return f_sgn + 0x7f800000u + (((uint32_t)(h&0x03ffu)) << 13); + default: /* normalized */ + /* Just need to adjust the exponent and shift */ + return f_sgn + (((uint32_t)(h&0x7fffu) + 0x1c000u) << 13); + } + } + + static _FORCE_INLINE_ float halfptr_to_float(const uint16_t *h) { + + union { + uint32_t u32; + float f32; + } u; + + u.u32=halfbits_to_floatbits(*h); + return u.f32; + } + + static _FORCE_INLINE_ uint16_t make_half_float(float f) { + + union { + float fv; + uint32_t ui; + } ci; + ci.fv=f; + + uint32_t x = ci.ui; + uint32_t sign = (unsigned short)(x >> 31); + uint32_t mantissa; + uint32_t exp; + uint16_t hf; + + // get mantissa + mantissa = x & ((1 << 23) - 1); + // get exponent bits + exp = x & (0xFF << 23); + if (exp >= 0x47800000) + { + // check if the original single precision float number is a NaN + if (mantissa && (exp == (0xFF << 23))) + { + // we have a single precision NaN + mantissa = (1 << 23) - 1; + } + else + { + // 16-bit half-float representation stores number as Inf + mantissa = 0; + } + hf = (((uint16_t)sign) << 15) | (uint16_t)((0x1F << 10)) | + (uint16_t)(mantissa >> 13); + } + // check if exponent is <= -15 + else if (exp <= 0x38000000) + { + + /*// store a denorm half-float value or zero + exp = (0x38000000 - exp) >> 23; + mantissa >>= (14 + exp); + + hf = (((uint16_t)sign) << 15) | (uint16_t)(mantissa); + */ + hf=0; //denormals do not work for 3D, convert to zero + } + else + { + hf = (((uint16_t)sign) << 15) | + (uint16_t)((exp - 0x38000000) >> 13) | + (uint16_t)(mantissa >> 13); + } + + return hf; + } + + + }; diff --git a/core/math/matrix3.cpp b/core/math/matrix3.cpp index 71e6b62212..e9c3442582 100644 --- a/core/math/matrix3.cpp +++ b/core/math/matrix3.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ #define cofac(row1,col1, row2, col2)\ (elements[row1][col1] * elements[row2][col2] - elements[row1][col2] * elements[row2][col1]) -void Matrix3::from_z(const Vector3& p_z) { +void Basis::from_z(const Vector3& p_z) { if (Math::abs(p_z.z) > Math_SQRT12 ) { @@ -53,7 +53,7 @@ void Matrix3::from_z(const Vector3& p_z) { elements[2]=p_z; } -void Matrix3::invert() { +void Basis::invert() { real_t co[3]={ @@ -72,7 +72,8 @@ void Matrix3::invert() { } -void Matrix3::orthonormalize() { +void Basis::orthonormalize() { + ERR_FAIL_COND(determinant() == 0); // Gram-Schmidt Process @@ -92,100 +93,230 @@ void Matrix3::orthonormalize() { } -Matrix3 Matrix3::orthonormalized() const { +Basis Basis::orthonormalized() const { - Matrix3 c = *this; + Basis c = *this; c.orthonormalize(); return c; } +bool Basis::is_orthogonal() const { + Basis id; + Basis m = (*this)*transposed(); -Matrix3 Matrix3::inverse() const { + return isequal_approx(id,m); +} + +bool Basis::is_rotation() const { + return Math::isequal_approx(determinant(), 1) && is_orthogonal(); +} + + +bool Basis::is_symmetric() const { + + if (Math::abs(elements[0][1] - elements[1][0]) > CMP_EPSILON) + return false; + if (Math::abs(elements[0][2] - elements[2][0]) > CMP_EPSILON) + return false; + if (Math::abs(elements[1][2] - elements[2][1]) > CMP_EPSILON) + return false; + + return true; +} + + +Basis Basis::diagonalize() { + + //NOTE: only implemented for symmetric matrices + //with the Jacobi iterative method method + + ERR_FAIL_COND_V(!is_symmetric(), Basis()); + + const int ite_max = 1024; + + real_t off_matrix_norm_2 = elements[0][1] * elements[0][1] + elements[0][2] * elements[0][2] + elements[1][2] * elements[1][2]; + + int ite = 0; + Basis acc_rot; + while (off_matrix_norm_2 > CMP_EPSILON2 && ite++ < ite_max ) { + real_t el01_2 = elements[0][1] * elements[0][1]; + real_t el02_2 = elements[0][2] * elements[0][2]; + real_t el12_2 = elements[1][2] * elements[1][2]; + // Find the pivot element + int i, j; + if (el01_2 > el02_2) { + if (el12_2 > el01_2) { + i = 1; + j = 2; + } else { + i = 0; + j = 1; + } + } else { + if (el12_2 > el02_2) { + i = 1; + j = 2; + } else { + i = 0; + j = 2; + } + } + + // Compute the rotation angle + real_t angle; + if (Math::abs(elements[j][j] - elements[i][i]) < CMP_EPSILON) { + angle = Math_PI / 4; + } else { + angle = 0.5 * Math::atan(2 * elements[i][j] / (elements[j][j] - elements[i][i])); + } - Matrix3 inv=*this; + // Compute the rotation matrix + Basis rot; + rot.elements[i][i] = rot.elements[j][j] = Math::cos(angle); + rot.elements[i][j] = - (rot.elements[j][i] = Math::sin(angle)); + + // Update the off matrix norm + off_matrix_norm_2 -= elements[i][j] * elements[i][j]; + + // Apply the rotation + *this = rot * *this * rot.transposed(); + acc_rot = rot * acc_rot; + } + + return acc_rot; +} + +Basis Basis::inverse() const { + + Basis inv=*this; inv.invert(); return inv; } -void Matrix3::transpose() { +void Basis::transpose() { SWAP(elements[0][1],elements[1][0]); SWAP(elements[0][2],elements[2][0]); SWAP(elements[1][2],elements[2][1]); } -Matrix3 Matrix3::transposed() const { +Basis Basis::transposed() const { - Matrix3 tr=*this; + Basis tr=*this; tr.transpose(); return tr; } -void Matrix3::scale(const Vector3& p_scale) { +// Multiplies the matrix from left by the scaling matrix: M -> S.M +// See the comment for Basis::rotated for further explanation. +void Basis::scale(const Vector3& p_scale) { elements[0][0]*=p_scale.x; - elements[1][0]*=p_scale.x; - elements[2][0]*=p_scale.x; - elements[0][1]*=p_scale.y; + elements[0][1]*=p_scale.x; + elements[0][2]*=p_scale.x; + elements[1][0]*=p_scale.y; elements[1][1]*=p_scale.y; - elements[2][1]*=p_scale.y; - elements[0][2]*=p_scale.z; - elements[1][2]*=p_scale.z; + elements[1][2]*=p_scale.y; + elements[2][0]*=p_scale.z; + elements[2][1]*=p_scale.z; elements[2][2]*=p_scale.z; } -Matrix3 Matrix3::scaled( const Vector3& p_scale ) const { +Basis Basis::scaled( const Vector3& p_scale ) const { - Matrix3 m = *this; + Basis m = *this; m.scale(p_scale); return m; } -Vector3 Matrix3::get_scale() const { - - return Vector3( +Vector3 Basis::get_scale() const { + // We are assuming M = R.S, and performing a polar decomposition to extract R and S. + // FIXME: We eventually need a proper polar decomposition. + // As a cheap workaround until then, to ensure that R is a proper rotation matrix with determinant +1 + // (such that it can be represented by a Quat or Euler angles), we absorb the sign flip into the scaling matrix. + // As such, it works in conjuction with get_rotation(). + real_t det_sign = determinant() > 0 ? 1 : -1; + return det_sign*Vector3( Vector3(elements[0][0],elements[1][0],elements[2][0]).length(), Vector3(elements[0][1],elements[1][1],elements[2][1]).length(), Vector3(elements[0][2],elements[1][2],elements[2][2]).length() ); } -void Matrix3::rotate(const Vector3& p_axis, real_t p_phi) { - *this = *this * Matrix3(p_axis, p_phi); +// Multiplies the matrix from left by the rotation matrix: M -> R.M +// Note that this does *not* rotate the matrix itself. +// +// The main use of Basis is as Transform.basis, which is used a the transformation matrix +// of 3D object. Rotate here refers to rotation of the object (which is R * (*this)), +// not the matrix itself (which is R * (*this) * R.transposed()). +Basis Basis::rotated(const Vector3& p_axis, real_t p_phi) const { + return Basis(p_axis, p_phi) * (*this); } -Matrix3 Matrix3::rotated(const Vector3& p_axis, real_t p_phi) const { +void Basis::rotate(const Vector3& p_axis, real_t p_phi) { + *this = rotated(p_axis, p_phi); +} - return *this * Matrix3(p_axis, p_phi); +Basis Basis::rotated(const Vector3& p_euler) const { + return Basis(p_euler) * (*this); +} +void Basis::rotate(const Vector3& p_euler) { + *this = rotated(p_euler); } -Vector3 Matrix3::get_euler() const { +Vector3 Basis::get_rotation() const { + // Assumes that the matrix can be decomposed into a proper rotation and scaling matrix as M = R.S, + // and returns the Euler angles corresponding to the rotation part, complementing get_scale(). + // See the comment in get_scale() for further information. + Basis m = orthonormalized(); + real_t det = m.determinant(); + if (det < 0) { + // Ensure that the determinant is 1, such that result is a proper rotation matrix which can be represented by Euler angles. + m.scale(Vector3(-1,-1,-1)); + } + + return m.get_euler(); +} +// get_euler returns a vector containing the Euler angles in the format +// (a1,a2,a3), where a3 is the angle of the first rotation, and a1 is the last +// (following the convention they are commonly defined in the literature). +// +// The current implementation uses XYZ convention (Z is the first rotation), +// so euler.z is the angle of the (first) rotation around Z axis and so on, +// +// And thus, assuming the matrix is a rotation matrix, this function returns +// the angles in the decomposition R = X(a1).Y(a2).Z(a3) where Z(a) rotates +// around the z-axis by a and so on. +Vector3 Basis::get_euler() const { + + // Euler angles in XYZ convention. + // See https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix + // // rot = cy*cz -cy*sz sy - // cz*sx*sy+cx*sz cx*cz-sx*sy*sz -cy*sx - // -cx*cz*sy+sx*sz cz*sx+cx*sy*sz cx*cy - - Matrix3 m = *this; - m.orthonormalize(); + // cz*sx*sy+cx*sz cx*cz-sx*sy*sz -cy*sx + // -cx*cz*sy+sx*sz cz*sx+cx*sy*sz cx*cy Vector3 euler; - euler.y = Math::asin(m[0][2]); + ERR_FAIL_COND_V(is_rotation() == false, euler); + + euler.y = Math::asin(elements[0][2]); if ( euler.y < Math_PI*0.5) { if ( euler.y > -Math_PI*0.5) { - euler.x = Math::atan2(-m[1][2],m[2][2]); - euler.z = Math::atan2(-m[0][1],m[0][0]); + euler.x = Math::atan2(-elements[1][2],elements[2][2]); + euler.z = Math::atan2(-elements[0][1],elements[0][0]); } else { - real_t r = Math::atan2(m[1][0],m[1][1]); + real_t r = Math::atan2(elements[1][0],elements[1][1]); euler.z = 0.0; euler.x = euler.z - r; } } else { - real_t r = Math::atan2(m[0][1],m[1][1]); + real_t r = Math::atan2(elements[0][1],elements[1][1]); euler.z = 0; euler.x = r - euler.z; } @@ -195,43 +326,59 @@ Vector3 Matrix3::get_euler() const { } -void Matrix3::set_euler(const Vector3& p_euler) { +// set_euler expects a vector containing the Euler angles in the format +// (c,b,a), where a is the angle of the first rotation, and c is the last. +// The current implementation uses XYZ convention (Z is the first rotation). +void Basis::set_euler(const Vector3& p_euler) { real_t c, s; c = Math::cos(p_euler.x); s = Math::sin(p_euler.x); - Matrix3 xmat(1.0,0.0,0.0,0.0,c,-s,0.0,s,c); + Basis xmat(1.0,0.0,0.0,0.0,c,-s,0.0,s,c); c = Math::cos(p_euler.y); s = Math::sin(p_euler.y); - Matrix3 ymat(c,0.0,s,0.0,1.0,0.0,-s,0.0,c); + Basis ymat(c,0.0,s,0.0,1.0,0.0,-s,0.0,c); c = Math::cos(p_euler.z); s = Math::sin(p_euler.z); - Matrix3 zmat(c,-s,0.0,s,c,0.0,0.0,0.0,1.0); + Basis zmat(c,-s,0.0,s,c,0.0,0.0,0.0,1.0); //optimizer will optimize away all this anyway *this = xmat*(ymat*zmat); } -bool Matrix3::operator==(const Matrix3& p_matrix) const { +bool Basis::isequal_approx(const Basis& a, const Basis& b) const { + + for (int i=0;i<3;i++) { + for (int j=0;j<3;j++) { + if (Math::isequal_approx(a.elements[i][j],b.elements[i][j]) == false) + return false; + } + } + + return true; +} + +bool Basis::operator==(const Basis& p_matrix) const { for (int i=0;i<3;i++) { for (int j=0;j<3;j++) { - if (elements[i][j]!=p_matrix.elements[i][j]) + if (elements[i][j] != p_matrix.elements[i][j]) return false; } } return true; } -bool Matrix3::operator!=(const Matrix3& p_matrix) const { + +bool Basis::operator!=(const Basis& p_matrix) const { return (!(*this==p_matrix)); } -Matrix3::operator String() const { +Basis::operator String() const { String mtx; for (int i=0;i<3;i++) { @@ -248,12 +395,10 @@ Matrix3::operator String() const { return mtx; } -Matrix3::operator Quat() const { +Basis::operator Quat() const { + ERR_FAIL_COND_V(is_rotation() == false, Quat()); - Matrix3 m=*this; - m.orthonormalize(); - - real_t trace = m.elements[0][0] + m.elements[1][1] + m.elements[2][2]; + real_t trace = elements[0][0] + elements[1][1] + elements[2][2]; real_t temp[4]; if (trace > 0.0) @@ -262,66 +407,66 @@ Matrix3::operator Quat() const { temp[3]=(s * 0.5); s = 0.5 / s; - temp[0]=((m.elements[2][1] - m.elements[1][2]) * s); - temp[1]=((m.elements[0][2] - m.elements[2][0]) * s); - temp[2]=((m.elements[1][0] - m.elements[0][1]) * s); + temp[0]=((elements[2][1] - elements[1][2]) * s); + temp[1]=((elements[0][2] - elements[2][0]) * s); + temp[2]=((elements[1][0] - elements[0][1]) * s); } else { - int i = m.elements[0][0] < m.elements[1][1] ? - (m.elements[1][1] < m.elements[2][2] ? 2 : 1) : - (m.elements[0][0] < m.elements[2][2] ? 2 : 0); + int i = elements[0][0] < elements[1][1] ? + (elements[1][1] < elements[2][2] ? 2 : 1) : + (elements[0][0] < elements[2][2] ? 2 : 0); int j = (i + 1) % 3; int k = (i + 2) % 3; - real_t s = Math::sqrt(m.elements[i][i] - m.elements[j][j] - m.elements[k][k] + 1.0); + real_t s = Math::sqrt(elements[i][i] - elements[j][j] - elements[k][k] + 1.0); temp[i] = s * 0.5; s = 0.5 / s; - temp[3] = (m.elements[k][j] - m.elements[j][k]) * s; - temp[j] = (m.elements[j][i] + m.elements[i][j]) * s; - temp[k] = (m.elements[k][i] + m.elements[i][k]) * s; + temp[3] = (elements[k][j] - elements[j][k]) * s; + temp[j] = (elements[j][i] + elements[i][j]) * s; + temp[k] = (elements[k][i] + elements[i][k]) * s; } return Quat(temp[0],temp[1],temp[2],temp[3]); } -static const Matrix3 _ortho_bases[24]={ - Matrix3(1, 0, 0, 0, 1, 0, 0, 0, 1), - Matrix3(0, -1, 0, 1, 0, 0, 0, 0, 1), - Matrix3(-1, 0, 0, 0, -1, 0, 0, 0, 1), - Matrix3(0, 1, 0, -1, 0, 0, 0, 0, 1), - Matrix3(1, 0, 0, 0, 0, -1, 0, 1, 0), - Matrix3(0, 0, 1, 1, 0, 0, 0, 1, 0), - Matrix3(-1, 0, 0, 0, 0, 1, 0, 1, 0), - Matrix3(0, 0, -1, -1, 0, 0, 0, 1, 0), - Matrix3(1, 0, 0, 0, -1, 0, 0, 0, -1), - Matrix3(0, 1, 0, 1, 0, 0, 0, 0, -1), - Matrix3(-1, 0, 0, 0, 1, 0, 0, 0, -1), - Matrix3(0, -1, 0, -1, 0, 0, 0, 0, -1), - Matrix3(1, 0, 0, 0, 0, 1, 0, -1, 0), - Matrix3(0, 0, -1, 1, 0, 0, 0, -1, 0), - Matrix3(-1, 0, 0, 0, 0, -1, 0, -1, 0), - Matrix3(0, 0, 1, -1, 0, 0, 0, -1, 0), - Matrix3(0, 0, 1, 0, 1, 0, -1, 0, 0), - Matrix3(0, -1, 0, 0, 0, 1, -1, 0, 0), - Matrix3(0, 0, -1, 0, -1, 0, -1, 0, 0), - Matrix3(0, 1, 0, 0, 0, -1, -1, 0, 0), - Matrix3(0, 0, 1, 0, -1, 0, 1, 0, 0), - Matrix3(0, 1, 0, 0, 0, 1, 1, 0, 0), - Matrix3(0, 0, -1, 0, 1, 0, 1, 0, 0), - Matrix3(0, -1, 0, 0, 0, -1, 1, 0, 0) +static const Basis _ortho_bases[24]={ + Basis(1, 0, 0, 0, 1, 0, 0, 0, 1), + Basis(0, -1, 0, 1, 0, 0, 0, 0, 1), + Basis(-1, 0, 0, 0, -1, 0, 0, 0, 1), + Basis(0, 1, 0, -1, 0, 0, 0, 0, 1), + Basis(1, 0, 0, 0, 0, -1, 0, 1, 0), + Basis(0, 0, 1, 1, 0, 0, 0, 1, 0), + Basis(-1, 0, 0, 0, 0, 1, 0, 1, 0), + Basis(0, 0, -1, -1, 0, 0, 0, 1, 0), + Basis(1, 0, 0, 0, -1, 0, 0, 0, -1), + Basis(0, 1, 0, 1, 0, 0, 0, 0, -1), + Basis(-1, 0, 0, 0, 1, 0, 0, 0, -1), + Basis(0, -1, 0, -1, 0, 0, 0, 0, -1), + Basis(1, 0, 0, 0, 0, 1, 0, -1, 0), + Basis(0, 0, -1, 1, 0, 0, 0, -1, 0), + Basis(-1, 0, 0, 0, 0, -1, 0, -1, 0), + Basis(0, 0, 1, -1, 0, 0, 0, -1, 0), + Basis(0, 0, 1, 0, 1, 0, -1, 0, 0), + Basis(0, -1, 0, 0, 0, 1, -1, 0, 0), + Basis(0, 0, -1, 0, -1, 0, -1, 0, 0), + Basis(0, 1, 0, 0, 0, -1, -1, 0, 0), + Basis(0, 0, 1, 0, -1, 0, 1, 0, 0), + Basis(0, 1, 0, 0, 0, 1, 1, 0, 0), + Basis(0, 0, -1, 0, 1, 0, 1, 0, 0), + Basis(0, -1, 0, 0, 0, -1, 1, 0, 0) }; -int Matrix3::get_orthogonal_index() const { +int Basis::get_orthogonal_index() const { //could be sped up if i come up with a way - Matrix3 orth=*this; + Basis orth=*this; for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { - float v = orth[i][j]; + real_t v = orth[i][j]; if (v>0.5) v=1.0; else if (v<-0.5) @@ -344,7 +489,7 @@ int Matrix3::get_orthogonal_index() const { return 0; } -void Matrix3::set_orthogonal_index(int p_index){ +void Basis::set_orthogonal_index(int p_index){ //there only exist 24 orthogonal bases in r3 ERR_FAIL_INDEX(p_index,24); @@ -355,7 +500,8 @@ void Matrix3::set_orthogonal_index(int p_index){ } -void Matrix3::get_axis_and_angle(Vector3 &r_axis,real_t& r_angle) const { +void Basis::get_axis_and_angle(Vector3 &r_axis,real_t& r_angle) const { + ERR_FAIL_COND(is_rotation() == false); double angle,x,y,z; // variables for result @@ -423,26 +569,25 @@ void Matrix3::get_axis_and_angle(Vector3 &r_axis,real_t& r_angle) const { // as we have reached here there are no singularities so we can handle normally double s = Math::sqrt((elements[1][2] - elements[2][1])*(elements[1][2] - elements[2][1]) +(elements[2][0] - elements[0][2])*(elements[2][0] - elements[0][2]) - +(elements[0][1] - elements[1][0])*(elements[0][1] - elements[1][0])); // used to normalise - if (Math::abs(s) < 0.001) s=1; - // prevent divide by zero, should not happen if matrix is orthogonal and should be - // caught by singularity test above, but I've left it in just in case + +(elements[0][1] - elements[1][0])*(elements[0][1] - elements[1][0])); // s=|axis||sin(angle)|, used to normalise + angle = Math::acos(( elements[0][0] + elements[1][1] + elements[2][2] - 1)/2); - x = (elements[1][2] - elements[2][1])/s; - y = (elements[2][0] - elements[0][2])/s; - z = (elements[0][1] - elements[1][0])/s; + if (angle < 0) s = -s; + x = (elements[2][1] - elements[1][2])/s; + y = (elements[0][2] - elements[2][0])/s; + z = (elements[1][0] - elements[0][1])/s; r_axis=Vector3(x,y,z); r_angle=angle; } -Matrix3::Matrix3(const Vector3& p_euler) { +Basis::Basis(const Vector3& p_euler) { set_euler( p_euler ); } -Matrix3::Matrix3(const Quat& p_quat) { +Basis::Basis(const Quat& p_quat) { real_t d = p_quat.length_squared(); real_t s = 2.0 / d; @@ -456,7 +601,8 @@ Matrix3::Matrix3(const Quat& p_quat) { } -Matrix3::Matrix3(const Vector3& p_axis, real_t p_phi) { +Basis::Basis(const Vector3& p_axis, real_t p_phi) { + // Rotation matrix from axis and angle, see https://en.wikipedia.org/wiki/Rotation_matrix#Rotation_matrix_from_axis_and_angle Vector3 axis_sq(p_axis.x*p_axis.x,p_axis.y*p_axis.y,p_axis.z*p_axis.z); @@ -464,15 +610,15 @@ Matrix3::Matrix3(const Vector3& p_axis, real_t p_phi) { real_t sine= Math::sin(p_phi); elements[0][0] = axis_sq.x + cosine * ( 1.0 - axis_sq.x ); - elements[0][1] = p_axis.x * p_axis.y * ( 1.0 - cosine ) + p_axis.z * sine; - elements[0][2] = p_axis.z * p_axis.x * ( 1.0 - cosine ) - p_axis.y * sine; + elements[0][1] = p_axis.x * p_axis.y * ( 1.0 - cosine ) - p_axis.z * sine; + elements[0][2] = p_axis.z * p_axis.x * ( 1.0 - cosine ) + p_axis.y * sine; - elements[1][0] = p_axis.x * p_axis.y * ( 1.0 - cosine ) - p_axis.z * sine; + elements[1][0] = p_axis.x * p_axis.y * ( 1.0 - cosine ) + p_axis.z * sine; elements[1][1] = axis_sq.y + cosine * ( 1.0 - axis_sq.y ); - elements[1][2] = p_axis.y * p_axis.z * ( 1.0 - cosine ) + p_axis.x * sine; + elements[1][2] = p_axis.y * p_axis.z * ( 1.0 - cosine ) - p_axis.x * sine; - elements[2][0] = p_axis.z * p_axis.x * ( 1.0 - cosine ) + p_axis.y * sine; - elements[2][1] = p_axis.y * p_axis.z * ( 1.0 - cosine ) - p_axis.x * sine; + elements[2][0] = p_axis.z * p_axis.x * ( 1.0 - cosine ) - p_axis.y * sine; + elements[2][1] = p_axis.y * p_axis.z * ( 1.0 - cosine ) + p_axis.x * sine; elements[2][2] = axis_sq.z + cosine * ( 1.0 - axis_sq.z ); } diff --git a/core/math/matrix3.h b/core/math/matrix3.h index e514f490f7..abce1ee45d 100644 --- a/core/math/matrix3.h +++ b/core/math/matrix3.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -26,16 +26,18 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ + +#include "vector3.h" + #ifndef MATRIX3_H #define MATRIX3_H -#include "vector3.h" #include "quat.h" /** @author Juan Linietsky <reduzio@gmail.com> */ -class Matrix3 { +class Basis { public: Vector3 elements[3]; @@ -52,10 +54,10 @@ public: void invert(); void transpose(); - Matrix3 inverse() const; - Matrix3 transposed() const; + Basis inverse() const; + Basis transposed() const; - _FORCE_INLINE_ float determinant() const; + _FORCE_INLINE_ real_t determinant() const; void from_z(const Vector3& p_z); @@ -71,10 +73,14 @@ public: } void rotate(const Vector3& p_axis, real_t p_phi); - Matrix3 rotated(const Vector3& p_axis, real_t p_phi) const; + Basis rotated(const Vector3& p_axis, real_t p_phi) const; + + void rotate(const Vector3& p_euler); + Basis rotated(const Vector3& p_euler) const; + Vector3 get_rotation() const; void scale( const Vector3& p_scale ); - Matrix3 scaled( const Vector3& p_scale ) const; + Basis scaled( const Vector3& p_scale ) const; Vector3 get_scale() const; Vector3 get_euler() const; @@ -91,17 +97,28 @@ public: return elements[0][2] * v[0] + elements[1][2] * v[1] + elements[2][2] * v[2]; } - bool operator==(const Matrix3& p_matrix) const; - bool operator!=(const Matrix3& p_matrix) const; + bool isequal_approx(const Basis& a, const Basis& b) const; + + bool operator==(const Basis& p_matrix) const; + bool operator!=(const Basis& p_matrix) const; _FORCE_INLINE_ Vector3 xform(const Vector3& p_vector) const; _FORCE_INLINE_ Vector3 xform_inv(const Vector3& p_vector) const; - _FORCE_INLINE_ void operator*=(const Matrix3& p_matrix); - _FORCE_INLINE_ Matrix3 operator*(const Matrix3& p_matrix) const; + _FORCE_INLINE_ void operator*=(const Basis& p_matrix); + _FORCE_INLINE_ Basis operator*(const Basis& p_matrix) const; + _FORCE_INLINE_ void operator+=(const Basis& p_matrix); + _FORCE_INLINE_ Basis operator+(const Basis& p_matrix) const; + _FORCE_INLINE_ void operator-=(const Basis& p_matrix); + _FORCE_INLINE_ Basis operator-(const Basis& p_matrix) const; + _FORCE_INLINE_ void operator*=(real_t p_val); + _FORCE_INLINE_ Basis operator*(real_t p_val) const; int get_orthogonal_index() const; void set_orthogonal_index(int p_index); + bool is_orthogonal() const; + bool is_rotation() const; + operator String() const; void get_axis_and_angle(Vector3 &r_axis,real_t& r_angle) const; @@ -130,6 +147,10 @@ public: return Vector3(elements[i][0],elements[i][1],elements[i][2]); } + _FORCE_INLINE_ Vector3 get_main_diagonal() const { + return Vector3(elements[0][0],elements[1][1],elements[2][2]); + } + _FORCE_INLINE_ void set_row(int i, const Vector3& p_row) { elements[i][0]=p_row.x; elements[i][1]=p_row.y; @@ -142,9 +163,9 @@ public: elements[2].zero(); } - _FORCE_INLINE_ Matrix3 transpose_xform(const Matrix3& m) const + _FORCE_INLINE_ Basis transpose_xform(const Basis& m) const { - return Matrix3( + return Basis( elements[0].x * m[0].x + elements[1].x * m[1].x + elements[2].x * m[2].x, elements[0].x * m[0].y + elements[1].x * m[1].y + elements[2].x * m[2].y, elements[0].x * m[0].z + elements[1].x * m[1].z + elements[2].x * m[2].z, @@ -155,21 +176,31 @@ public: elements[0].z * m[0].y + elements[1].z * m[1].y + elements[2].z * m[2].y, elements[0].z * m[0].z + elements[1].z * m[1].z + elements[2].z * m[2].z); } - Matrix3(real_t xx, real_t xy, real_t xz, real_t yx, real_t yy, real_t yz, real_t zx, real_t zy, real_t zz) { + Basis(real_t xx, real_t xy, real_t xz, real_t yx, real_t yy, real_t yz, real_t zx, real_t zy, real_t zz) { set(xx, xy, xz, yx, yy, yz, zx, zy, zz); } void orthonormalize(); - Matrix3 orthonormalized() const; + Basis orthonormalized() const; + + bool is_symmetric() const; + Basis diagonalize(); operator Quat() const; - Matrix3(const Quat& p_quat); // euler - Matrix3(const Vector3& p_euler); // euler - Matrix3(const Vector3& p_axis, real_t p_phi); + Basis(const Quat& p_quat); // euler + Basis(const Vector3& p_euler); // euler + Basis(const Vector3& p_axis, real_t p_phi); - _FORCE_INLINE_ Matrix3() { + _FORCE_INLINE_ Basis(const Vector3& row0, const Vector3& row1, const Vector3& row2) + { + elements[0]=row0; + elements[1]=row1; + elements[2]=row2; + } + + _FORCE_INLINE_ Basis() { elements[0][0]=1; elements[0][1]=0; @@ -185,7 +216,7 @@ public: }; -_FORCE_INLINE_ void Matrix3::operator*=(const Matrix3& p_matrix) { +_FORCE_INLINE_ void Basis::operator*=(const Basis& p_matrix) { set( p_matrix.tdotx(elements[0]), p_matrix.tdoty(elements[0]), p_matrix.tdotz(elements[0]), @@ -194,16 +225,59 @@ _FORCE_INLINE_ void Matrix3::operator*=(const Matrix3& p_matrix) { } -_FORCE_INLINE_ Matrix3 Matrix3::operator*(const Matrix3& p_matrix) const { +_FORCE_INLINE_ Basis Basis::operator*(const Basis& p_matrix) const { - return Matrix3( + return Basis( p_matrix.tdotx(elements[0]), p_matrix.tdoty(elements[0]), p_matrix.tdotz(elements[0]), p_matrix.tdotx(elements[1]), p_matrix.tdoty(elements[1]), p_matrix.tdotz(elements[1]), p_matrix.tdotx(elements[2]), p_matrix.tdoty(elements[2]), p_matrix.tdotz(elements[2]) ); } -Vector3 Matrix3::xform(const Vector3& p_vector) const { + +_FORCE_INLINE_ void Basis::operator+=(const Basis& p_matrix) { + + elements[0] += p_matrix.elements[0]; + elements[1] += p_matrix.elements[1]; + elements[2] += p_matrix.elements[2]; +} + +_FORCE_INLINE_ Basis Basis::operator+(const Basis& p_matrix) const { + + Basis ret(*this); + ret += p_matrix; + return ret; +} + +_FORCE_INLINE_ void Basis::operator-=(const Basis& p_matrix) { + + elements[0] -= p_matrix.elements[0]; + elements[1] -= p_matrix.elements[1]; + elements[2] -= p_matrix.elements[2]; +} + +_FORCE_INLINE_ Basis Basis::operator-(const Basis& p_matrix) const { + + Basis ret(*this); + ret -= p_matrix; + return ret; +} + +_FORCE_INLINE_ void Basis::operator*=(real_t p_val) { + + elements[0]*=p_val; + elements[1]*=p_val; + elements[2]*=p_val; +} + +_FORCE_INLINE_ Basis Basis::operator*(real_t p_val) const { + + Basis ret(*this); + ret *= p_val; + return ret; +} + +Vector3 Basis::xform(const Vector3& p_vector) const { return Vector3( elements[0].dot(p_vector), @@ -212,7 +286,7 @@ Vector3 Matrix3::xform(const Vector3& p_vector) const { ); } -Vector3 Matrix3::xform_inv(const Vector3& p_vector) const { +Vector3 Basis::xform_inv(const Vector3& p_vector) const { return Vector3( (elements[0][0]*p_vector.x ) + ( elements[1][0]*p_vector.y ) + ( elements[2][0]*p_vector.z ), @@ -221,7 +295,7 @@ Vector3 Matrix3::xform_inv(const Vector3& p_vector) const { ); } -float Matrix3::determinant() const { +real_t Basis::determinant() const { return elements[0][0]*(elements[1][1]*elements[2][2] - elements[2][1]*elements[1][2]) - elements[1][0]*(elements[0][1]*elements[2][2] - elements[2][1]*elements[0][2]) + diff --git a/core/math/octree.h b/core/math/octree.h index 6080b21680..1a41413a76 100644 --- a/core/math/octree.h +++ b/core/math/octree.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -107,7 +107,7 @@ private: struct Octant { // cached for FAST plane check - AABB aabb; + Rect3 aabb; uint64_t last_pass; Octant *parent; @@ -152,8 +152,8 @@ private: OctreeElementID _id; Octant *common_parent; - AABB aabb; - AABB container_aabb; + Rect3 aabb; + Rect3 container_aabb; List<PairData*,AL> pair_list; @@ -338,7 +338,7 @@ private: void _insert_element(Element *p_element,Octant *p_octant); - void _ensure_valid_root(const AABB& p_aabb); + void _ensure_valid_root(const Rect3& p_aabb); bool _remove_element_from_octant(Element *p_element,Octant *p_octant,Octant *p_limit=NULL); void _remove_element(Element *p_element); void _pair_element(Element *p_element,Octant *p_octant); @@ -356,7 +356,7 @@ private: }; void _cull_convex(Octant *p_octant,_CullConvexData *p_cull); - void _cull_AABB(Octant *p_octant,const AABB& p_aabb, T** p_result_array,int *p_result_idx,int p_result_max,int *p_subindex_array,uint32_t p_mask); + void _cull_AABB(Octant *p_octant,const Rect3& p_aabb, T** p_result_array,int *p_result_idx,int p_result_max,int *p_subindex_array,uint32_t p_mask); void _cull_segment(Octant *p_octant,const Vector3& p_from, const Vector3& p_to,T** p_result_array,int *p_result_idx,int p_result_max,int *p_subindex_array,uint32_t p_mask); void _cull_point(Octant *p_octant,const Vector3& p_point,T** p_result_array,int *p_result_idx,int p_result_max,int *p_subindex_array,uint32_t p_mask); @@ -375,8 +375,8 @@ private: } public: - OctreeElementID create(T* p_userdata, const AABB& p_aabb=AABB(), int p_subindex=0, bool p_pairable=false,uint32_t p_pairable_type=0,uint32_t pairable_mask=1); - void move(OctreeElementID p_id, const AABB& p_aabb); + OctreeElementID create(T* p_userdata, const Rect3& p_aabb=Rect3(), int p_subindex=0, bool p_pairable=false,uint32_t p_pairable_type=0,uint32_t pairable_mask=1); + void move(OctreeElementID p_id, const Rect3& p_aabb); void set_pairable(OctreeElementID p_id,bool p_pairable=false,uint32_t p_pairable_type=0,uint32_t pairable_mask=1); void erase(OctreeElementID p_id); @@ -385,7 +385,7 @@ public: int get_subindex(OctreeElementID p_id) const; int cull_convex(const Vector<Plane>& p_convex,T** p_result_array,int p_result_max,uint32_t p_mask=0xFFFFFFFF); - int cull_AABB(const AABB& p_aabb,T** p_result_array,int p_result_max,int *p_subindex_array=NULL,uint32_t p_mask=0xFFFFFFFF); + int cull_AABB(const Rect3& p_aabb,T** p_result_array,int p_result_max,int *p_subindex_array=NULL,uint32_t p_mask=0xFFFFFFFF); int cull_segment(const Vector3& p_from, const Vector3& p_to,T** p_result_array,int p_result_max,int *p_subindex_array=NULL,uint32_t p_mask=0xFFFFFFFF); int cull_point(const Vector3& p_point,T** p_result_array,int p_result_max,int *p_subindex_array=NULL,uint32_t p_mask=0xFFFFFFFF); @@ -487,7 +487,7 @@ void Octree<T,use_pairs,AL>::_insert_element(Element *p_element,Octant *p_octant } else { /* check againt AABB where child should be */ - AABB aabb=p_octant->aabb; + Rect3 aabb=p_octant->aabb; aabb.size*=0.5; if (i&1) @@ -549,12 +549,12 @@ void Octree<T,use_pairs,AL>::_insert_element(Element *p_element,Octant *p_octant template<class T,bool use_pairs,class AL> -void Octree<T,use_pairs,AL>::_ensure_valid_root(const AABB& p_aabb) { +void Octree<T,use_pairs,AL>::_ensure_valid_root(const Rect3& p_aabb) { if (!root) { // octre is empty - AABB base( Vector3(), Vector3(1.0,1.0,1.0) * unit_size); + Rect3 base( Vector3(), Vector3(1.0,1.0,1.0) * unit_size); while ( !base.encloses(p_aabb) ) { @@ -578,7 +578,7 @@ void Octree<T,use_pairs,AL>::_ensure_valid_root(const AABB& p_aabb) { } else { - AABB base=root->aabb; + Rect3 base=root->aabb; while( !base.encloses( p_aabb ) ) { @@ -814,7 +814,7 @@ void Octree<T,use_pairs,AL>::_remove_element(Element *p_element) { } template<class T,bool use_pairs,class AL> -OctreeElementID Octree<T,use_pairs,AL>::create(T* p_userdata, const AABB& p_aabb, int p_subindex,bool p_pairable,uint32_t p_pairable_type,uint32_t p_pairable_mask) { +OctreeElementID Octree<T,use_pairs,AL>::create(T* p_userdata, const Rect3& p_aabb, int p_subindex,bool p_pairable,uint32_t p_pairable_type,uint32_t p_pairable_mask) { // check for AABB validity #ifdef DEBUG_ENABLED @@ -857,7 +857,7 @@ OctreeElementID Octree<T,use_pairs,AL>::create(T* p_userdata, const AABB& p_aabb template<class T,bool use_pairs,class AL> -void Octree<T,use_pairs,AL>::move(OctreeElementID p_id, const AABB& p_aabb) { +void Octree<T,use_pairs,AL>::move(OctreeElementID p_id, const Rect3& p_aabb) { #ifdef DEBUG_ENABLED // check for AABB validity @@ -906,7 +906,7 @@ void Octree<T,use_pairs,AL>::move(OctreeElementID p_id, const AABB& p_aabb) { if (old_has_surf) { _remove_element(&e); // removing e.common_parent=NULL; - e.aabb=AABB(); + e.aabb=Rect3(); _optimize(); } else { _ensure_valid_root(p_aabb); // inserting @@ -935,7 +935,7 @@ void Octree<T,use_pairs,AL>::move(OctreeElementID p_id, const AABB& p_aabb) { return; } - AABB combined=e.aabb; + Rect3 combined=e.aabb; combined.merge_with(p_aabb); _ensure_valid_root(combined); @@ -1129,7 +1129,7 @@ void Octree<T,use_pairs,AL>::_cull_convex(Octant *p_octant,_CullConvexData *p_cu template<class T,bool use_pairs,class AL> -void Octree<T,use_pairs,AL>::_cull_AABB(Octant *p_octant,const AABB& p_aabb, T** p_result_array,int *p_result_idx,int p_result_max,int *p_subindex_array,uint32_t p_mask) { +void Octree<T,use_pairs,AL>::_cull_AABB(Octant *p_octant,const Rect3& p_aabb, T** p_result_array,int *p_result_idx,int p_result_max,int *p_subindex_array,uint32_t p_mask) { if (*p_result_idx==p_result_max) return; //pointless @@ -1376,7 +1376,7 @@ int Octree<T,use_pairs,AL>::cull_convex(const Vector<Plane>& p_convex,T** p_resu template<class T,bool use_pairs,class AL> -int Octree<T,use_pairs,AL>::cull_AABB(const AABB& p_aabb,T** p_result_array,int p_result_max,int *p_subindex_array,uint32_t p_mask) { +int Octree<T,use_pairs,AL>::cull_AABB(const Rect3& p_aabb,T** p_result_array,int p_result_max,int *p_subindex_array,uint32_t p_mask) { if (!root) diff --git a/core/math/plane.cpp b/core/math/plane.cpp index b29350fe3c..2a97932049 100644 --- a/core/math/plane.cpp +++ b/core/math/plane.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/plane.h b/core/math/plane.h index 81a968682e..f746ea2067 100644 --- a/core/math/plane.h +++ b/core/math/plane.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/quat.cpp b/core/math/quat.cpp index 73124e5e8e..055e2b7c35 100644 --- a/core/math/quat.cpp +++ b/core/math/quat.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -27,22 +27,40 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "quat.h" +#include "matrix3.h" #include "print_string.h" +// set_euler expects a vector containing the Euler angles in the format +// (c,b,a), where a is the angle of the first rotation, and c is the last. +// The current implementation uses XYZ convention (Z is the first rotation). void Quat::set_euler(const Vector3& p_euler) { - real_t half_yaw = p_euler.x * 0.5; - real_t half_pitch = p_euler.y * 0.5; - real_t half_roll = p_euler.z * 0.5; - real_t cos_yaw = Math::cos(half_yaw); - real_t sin_yaw = Math::sin(half_yaw); - real_t cos_pitch = Math::cos(half_pitch); - real_t sin_pitch = Math::sin(half_pitch); - real_t cos_roll = Math::cos(half_roll); - real_t sin_roll = Math::sin(half_roll); - set(cos_roll * sin_pitch * cos_yaw+sin_roll * cos_pitch * sin_yaw, - cos_roll * cos_pitch * sin_yaw - sin_roll * sin_pitch * cos_yaw, - sin_roll * cos_pitch * cos_yaw - cos_roll * sin_pitch * sin_yaw, - cos_roll * cos_pitch * cos_yaw+sin_roll * sin_pitch * sin_yaw); + real_t half_a1 = p_euler.x * 0.5; + real_t half_a2 = p_euler.y * 0.5; + real_t half_a3 = p_euler.z * 0.5; + + // R = X(a1).Y(a2).Z(a3) convention for Euler angles. + // Conversion to quaternion as listed in https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19770024290.pdf (page A-2) + // a3 is the angle of the first rotation, following the notation in this reference. + + real_t cos_a1 = Math::cos(half_a1); + real_t sin_a1 = Math::sin(half_a1); + real_t cos_a2 = Math::cos(half_a2); + real_t sin_a2 = Math::sin(half_a2); + real_t cos_a3 = Math::cos(half_a3); + real_t sin_a3 = Math::sin(half_a3); + + set(sin_a1*cos_a2*cos_a3 + sin_a2*sin_a3*cos_a1, + -sin_a1*sin_a3*cos_a2 + sin_a2*cos_a1*cos_a3, + sin_a1*sin_a2*cos_a3 + sin_a3*cos_a1*cos_a2, + -sin_a1*sin_a2*sin_a3 + cos_a1*cos_a2*cos_a3); +} + +// get_euler returns a vector containing the Euler angles in the format +// (a1,a2,a3), where a3 is the angle of the first rotation, and a1 is the last. +// The current implementation uses XYZ convention (Z is the first rotation). +Vector3 Quat::get_euler() const { + Basis m(*this); + return m.get_euler(); } void Quat::operator*=(const Quat& q) { @@ -126,26 +144,25 @@ Quat Quat::slerp(const Quat& q, const real_t& t) const { } #else - real_t to1[4]; + Quat to1; real_t omega, cosom, sinom, scale0, scale1; // calc cosine - cosom = x * q.x + y * q.y + z * q.z - + w * q.w; - + cosom = dot(q); // adjust signs (if necessary) if ( cosom <0.0 ) { - cosom = -cosom; to1[0] = - q.x; - to1[1] = - q.y; - to1[2] = - q.z; - to1[3] = - q.w; + cosom = -cosom; + to1.x = - q.x; + to1.y = - q.y; + to1.z = - q.z; + to1.w = - q.w; } else { - to1[0] = q.x; - to1[1] = q.y; - to1[2] = q.z; - to1[3] = q.w; + to1.x = q.x; + to1.y = q.y; + to1.z = q.z; + to1.w = q.w; } @@ -165,10 +182,10 @@ Quat Quat::slerp(const Quat& q, const real_t& t) const { } // calculate final values return Quat( - scale0 * x + scale1 * to1[0], - scale0 * y + scale1 * to1[1], - scale0 * z + scale1 * to1[2], - scale0 * w + scale1 * to1[3] + scale0 * x + scale1 * to1.x, + scale0 * y + scale1 * to1.y, + scale0 * z + scale1 * to1.z, + scale0 * w + scale1 * to1.w ); #endif } @@ -186,10 +203,10 @@ Quat Quat::slerpni(const Quat& q, const real_t& t) const { newFactor = Math::sin(t * theta) * sinT, invFactor = Math::sin((1.0f - t) * theta) * sinT; - return Quat( invFactor * from.x + newFactor * q.x, - invFactor * from.y + newFactor * q.y, - invFactor * from.z + newFactor * q.z, - invFactor * from.w + newFactor * q.w ); + return Quat(invFactor * from.x + newFactor * q.x, + invFactor * from.y + newFactor * q.y, + invFactor * from.z + newFactor * q.z, + invFactor * from.w + newFactor * q.w); #if 0 real_t to1[4]; @@ -203,7 +220,7 @@ Quat Quat::slerpni(const Quat& q, const real_t& t) const { // adjust signs (if necessary) if ( cosom <0.0 && false) { - cosom = -cosom; to1[0] = - q.x; + cosom = -cosom;to1[0] = - q.x; to1[1] = - q.y; to1[2] = - q.z; to1[3] = - q.w; @@ -260,8 +277,10 @@ Quat::Quat(const Vector3& axis, const real_t& angle) { if (d==0) set(0,0,0,0); else { - real_t s = Math::sin(-angle * 0.5) / d; + real_t sin_angle = Math::sin(angle * 0.5); + real_t cos_angle = Math::cos(angle * 0.5); + real_t s = sin_angle / d; set(axis.x * s, axis.y * s, axis.z * s, - Math::cos(-angle * 0.5)); + cos_angle); } } diff --git a/core/math/quat.h b/core/math/quat.h index 0d206bb3b7..43c2cab9e6 100644 --- a/core/math/quat.h +++ b/core/math/quat.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -26,13 +26,15 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ + +#include "vector3.h" + #ifndef QUAT_H #define QUAT_H #include "math_defs.h" #include "math_funcs.h" #include "ustring.h" -#include "vector3.h" /** @author Juan Linietsky <reduzio@gmail.com> @@ -49,15 +51,16 @@ public: Quat inverse() const; _FORCE_INLINE_ real_t dot(const Quat& q) const; void set_euler(const Vector3& p_euler); + Vector3 get_euler() const; Quat slerp(const Quat& q, const real_t& t) const; Quat slerpni(const Quat& q, const real_t& t) const; Quat cubic_slerp(const Quat& q, const Quat& prep, const Quat& postq,const real_t& t) const; _FORCE_INLINE_ void get_axis_and_angle(Vector3& r_axis, real_t &r_angle) const { r_angle = 2 * Math::acos(w); - r_axis.x = -x / Math::sqrt(1-w*w); - r_axis.y = -y / Math::sqrt(1-w*w); - r_axis.z = -z / Math::sqrt(1-w*w); + r_axis.x = x / Math::sqrt(1-w*w); + r_axis.y = y / Math::sqrt(1-w*w); + r_axis.z = z / Math::sqrt(1-w*w); } void operator*=(const Quat& q); @@ -183,12 +186,10 @@ Quat Quat::operator/(const real_t& s) const { bool Quat::operator==(const Quat& p_quat) const { - return x==p_quat.x && y==p_quat.y && z==p_quat.z && w==p_quat.w; } bool Quat::operator!=(const Quat& p_quat) const { - return x!=p_quat.x || y!=p_quat.y || z!=p_quat.z || w!=p_quat.w; } diff --git a/core/math/quick_hull.cpp b/core/math/quick_hull.cpp index 956824d3d0..ab81a068d4 100644 --- a/core/math/quick_hull.cpp +++ b/core/math/quick_hull.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -38,7 +38,7 @@ Error QuickHull::build(const Vector<Vector3>& p_points, Geometry::MeshData &r_me /* CREATE AABB VOLUME */ - AABB aabb; + Rect3 aabb; for(int i=0;i<p_points.size();i++) { if (i==0) { diff --git a/core/math/quick_hull.h b/core/math/quick_hull.h index 8c009b907d..04d25fef18 100644 --- a/core/math/quick_hull.h +++ b/core/math/quick_hull.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/transform.cpp b/core/math/transform.cpp index 22eb6c4fdd..6d9324c176 100644 --- a/core/math/transform.cpp +++ b/core/math/transform.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -54,7 +54,8 @@ void Transform::invert() { } Transform Transform::inverse() const { - + // FIXME: this function assumes the basis is a rotation matrix, with no scaling. + // Transform::affine_inverse can handle matrices with scaling, so GDScript should eventually use that. Transform ret=*this; ret.invert(); return ret; @@ -63,12 +64,12 @@ Transform Transform::inverse() const { void Transform::rotate(const Vector3& p_axis,real_t p_phi) { - *this = *this * Transform( Matrix3( p_axis, p_phi ), Vector3() ); + *this = rotated(p_axis, p_phi); } Transform Transform::rotated(const Vector3& p_axis,real_t p_phi) const{ - return *this * Transform( Matrix3( p_axis, p_phi ), Vector3() ); + return Transform(Basis( p_axis, p_phi ), Vector3()) * (*this); } void Transform::rotate_basis(const Vector3& p_axis,real_t p_phi) { @@ -113,7 +114,7 @@ void Transform::set_look_at( const Vector3& p_eye, const Vector3& p_target, cons } -Transform Transform::interpolate_with(const Transform& p_transform, float p_c) const { +Transform Transform::interpolate_with(const Transform& p_transform, real_t p_c) const { /* not sure if very "efficient" but good enough? */ @@ -209,7 +210,7 @@ Transform::operator String() const { } -Transform::Transform(const Matrix3& p_basis, const Vector3& p_origin) { +Transform::Transform(const Basis& p_basis, const Vector3& p_origin) { basis=p_basis; origin=p_origin; diff --git a/core/math/transform.h b/core/math/transform.h index f948a4c919..d65e87cc6a 100644 --- a/core/math/transform.h +++ b/core/math/transform.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -38,7 +38,7 @@ class Transform { public: - Matrix3 basis; + Basis basis; Vector3 origin; void invert(); @@ -62,8 +62,8 @@ public: void translate( const Vector3& p_translation ); Transform translated( const Vector3& p_translation ) const; - const Matrix3& get_basis() const { return basis; } - void set_basis(const Matrix3& p_basis) { basis=p_basis; } + const Basis& get_basis() const { return basis; } + void set_basis(const Basis& p_basis) { basis=p_basis; } const Vector3& get_origin() const { return origin; } void set_origin(const Vector3& p_origin) { origin=p_origin; } @@ -80,13 +80,13 @@ public: _FORCE_INLINE_ Plane xform(const Plane& p_plane) const; _FORCE_INLINE_ Plane xform_inv(const Plane& p_plane) const; - _FORCE_INLINE_ AABB xform(const AABB& p_aabb) const; - _FORCE_INLINE_ AABB xform_inv(const AABB& p_aabb) const; + _FORCE_INLINE_ Rect3 xform(const Rect3& p_aabb) const; + _FORCE_INLINE_ Rect3 xform_inv(const Rect3& p_aabb) const; void operator*=(const Transform& p_transform); Transform operator*(const Transform& p_transform) const; - Transform interpolate_with(const Transform& p_transform, float p_c) const; + Transform interpolate_with(const Transform& p_transform, real_t p_c) const; _FORCE_INLINE_ Transform inverse_xform(const Transform& t) const { @@ -113,7 +113,7 @@ public: operator String() const; - Transform(const Matrix3& p_basis, const Vector3& p_origin=Vector3()); + Transform(const Basis& p_basis, const Vector3& p_origin=Vector3()); Transform() {} }; @@ -168,7 +168,7 @@ _FORCE_INLINE_ Plane Transform::xform_inv(const Plane& p_plane) const { } -_FORCE_INLINE_ AABB Transform::xform(const AABB& p_aabb) const { +_FORCE_INLINE_ Rect3 Transform::xform(const Rect3& p_aabb) const { /* define vertices */ #if 1 Vector3 x=basis.get_axis(0)*p_aabb.size.x; @@ -176,7 +176,7 @@ _FORCE_INLINE_ AABB Transform::xform(const AABB& p_aabb) const { Vector3 z=basis.get_axis(2)*p_aabb.size.z; Vector3 pos = xform( p_aabb.pos ); //could be even further optimized - AABB new_aabb; + Rect3 new_aabb; new_aabb.pos=pos; new_aabb.expand_to( pos+x ); new_aabb.expand_to( pos+y ); @@ -214,7 +214,7 @@ _FORCE_INLINE_ AABB Transform::xform(const AABB& p_aabb) const { #endif } -_FORCE_INLINE_ AABB Transform::xform_inv(const AABB& p_aabb) const { +_FORCE_INLINE_ Rect3 Transform::xform_inv(const Rect3& p_aabb) const { /* define vertices */ Vector3 vertices[8]={ @@ -229,7 +229,7 @@ _FORCE_INLINE_ AABB Transform::xform_inv(const AABB& p_aabb) const { }; - AABB ret; + Rect3 ret; ret.pos=xform_inv(vertices[0]); diff --git a/core/math/triangle_mesh.cpp b/core/math/triangle_mesh.cpp index 7aea32a8a0..fc5f55066b 100644 --- a/core/math/triangle_mesh.cpp +++ b/core/math/triangle_mesh.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -48,7 +48,7 @@ int TriangleMesh::_create_bvh(BVH*p_bvh,BVH** p_bb,int p_from,int p_size,int p_d } - AABB aabb; + Rect3 aabb; aabb=p_bb[p_from]->aabb; for(int i=1;i<p_size;i++) { @@ -94,7 +94,7 @@ int TriangleMesh::_create_bvh(BVH*p_bvh,BVH** p_bb,int p_from,int p_size,int p_d } -void TriangleMesh::create(const DVector<Vector3>& p_faces) { +void TriangleMesh::create(const PoolVector<Vector3>& p_faces) { valid=false; @@ -104,7 +104,7 @@ void TriangleMesh::create(const DVector<Vector3>& p_faces) { triangles.resize(fc); bvh.resize(fc*3); //will never be larger than this (todo make better) - DVector<BVH>::Write bw = bvh.write(); + PoolVector<BVH>::Write bw = bvh.write(); { @@ -112,8 +112,8 @@ void TriangleMesh::create(const DVector<Vector3>& p_faces) { //except for the Set for repeated triangles, everything //goes in-place. - DVector<Vector3>::Read r = p_faces.read(); - DVector<Triangle>::Write w = triangles.write(); + PoolVector<Vector3>::Read r = p_faces.read(); + PoolVector<Triangle>::Write w = triangles.write(); Map<Vector3,int> db; for(int i=0;i<fc;i++) { @@ -149,16 +149,16 @@ void TriangleMesh::create(const DVector<Vector3>& p_faces) { } vertices.resize(db.size()); - DVector<Vector3>::Write vw = vertices.write(); + PoolVector<Vector3>::Write vw = vertices.write(); for (Map<Vector3,int>::Element *E=db.front();E;E=E->next()) { vw[E->get()]=E->key(); } } - DVector<BVH*> bwptrs; + PoolVector<BVH*> bwptrs; bwptrs.resize(fc); - DVector<BVH*>::Write bwp = bwptrs.write(); + PoolVector<BVH*>::Write bwp = bwptrs.write(); for(int i=0;i<fc;i++) { bwp[i]=&bw[i]; @@ -168,7 +168,7 @@ void TriangleMesh::create(const DVector<Vector3>& p_faces) { int max_alloc=fc; int max=_create_bvh(bw.ptr(),bwp.ptr(),0,fc,1,max_depth,max_alloc); - bw=DVector<BVH>::Write(); //clearup + bw=PoolVector<BVH>::Write(); //clearup bvh.resize(max_alloc); //resize back valid=true; @@ -176,7 +176,7 @@ void TriangleMesh::create(const DVector<Vector3>& p_faces) { } -Vector3 TriangleMesh::get_area_normal(const AABB& p_aabb) const { +Vector3 TriangleMesh::get_area_normal(const Rect3& p_aabb) const { uint32_t* stack = (uint32_t*)alloca(sizeof(int)*max_depth); @@ -197,9 +197,9 @@ Vector3 TriangleMesh::get_area_normal(const AABB& p_aabb) const { int level=0; - DVector<Triangle>::Read trianglesr = triangles.read(); - DVector<Vector3>::Read verticesr=vertices.read(); - DVector<BVH>::Read bvhr=bvh.read(); + PoolVector<Triangle>::Read trianglesr = triangles.read(); + PoolVector<Vector3>::Read verticesr=vertices.read(); + PoolVector<BVH>::Read bvhr=bvh.read(); const Triangle *triangleptr=trianglesr.ptr(); int pos=bvh.size()-1; @@ -299,9 +299,9 @@ bool TriangleMesh::intersect_segment(const Vector3& p_begin,const Vector3& p_end int level=0; - DVector<Triangle>::Read trianglesr = triangles.read(); - DVector<Vector3>::Read verticesr=vertices.read(); - DVector<BVH>::Read bvhr=bvh.read(); + PoolVector<Triangle>::Read trianglesr = triangles.read(); + PoolVector<Vector3>::Read verticesr=vertices.read(); + PoolVector<BVH>::Read bvhr=bvh.read(); const Triangle *triangleptr=trianglesr.ptr(); const Vector3 *vertexptr=verticesr.ptr(); @@ -422,9 +422,9 @@ bool TriangleMesh::intersect_ray(const Vector3& p_begin,const Vector3& p_dir,Vec int level=0; - DVector<Triangle>::Read trianglesr = triangles.read(); - DVector<Vector3>::Read verticesr=vertices.read(); - DVector<BVH>::Read bvhr=bvh.read(); + PoolVector<Triangle>::Read trianglesr = triangles.read(); + PoolVector<Vector3>::Read verticesr=vertices.read(); + PoolVector<BVH>::Read bvhr=bvh.read(); const Triangle *triangleptr=trianglesr.ptr(); const Vector3 *vertexptr=verticesr.ptr(); @@ -524,18 +524,18 @@ bool TriangleMesh::is_valid() const { return valid; } -DVector<Face3> TriangleMesh::get_faces() const { +PoolVector<Face3> TriangleMesh::get_faces() const { if (!valid) - return DVector<Face3>(); + return PoolVector<Face3>(); - DVector<Face3> faces; + PoolVector<Face3> faces; int ts = triangles.size(); faces.resize(triangles.size()); - DVector<Face3>::Write w=faces.write(); - DVector<Triangle>::Read r = triangles.read(); - DVector<Vector3>::Read rv = vertices.read(); + PoolVector<Face3>::Write w=faces.write(); + PoolVector<Triangle>::Read r = triangles.read(); + PoolVector<Vector3>::Read rv = vertices.read(); for(int i=0;i<ts;i++) { for(int j=0;j<3;j++) { @@ -543,7 +543,7 @@ DVector<Face3> TriangleMesh::get_faces() const { } } - w = DVector<Face3>::Write(); + w = PoolVector<Face3>::Write(); return faces; } diff --git a/core/math/triangle_mesh.h b/core/math/triangle_mesh.h index b5e8f79cde..65250c023d 100644 --- a/core/math/triangle_mesh.h +++ b/core/math/triangle_mesh.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ #include "face3.h" class TriangleMesh : public Reference { - OBJ_TYPE( TriangleMesh, Reference); + GDCLASS( TriangleMesh, Reference); struct Triangle { @@ -41,12 +41,12 @@ class TriangleMesh : public Reference { int indices[3]; }; - DVector<Triangle> triangles; - DVector<Vector3> vertices; + PoolVector<Triangle> triangles; + PoolVector<Vector3> vertices; struct BVH { - AABB aabb; + Rect3 aabb; Vector3 center; //used for sorting int left; int right; @@ -79,7 +79,7 @@ class TriangleMesh : public Reference { int _create_bvh(BVH*p_bvh,BVH** p_bb,int p_from,int p_size,int p_depth,int&max_depth,int&max_alloc); - DVector<BVH> bvh; + PoolVector<BVH> bvh; int max_depth; bool valid; @@ -88,11 +88,11 @@ public: bool is_valid() const; bool intersect_segment(const Vector3& p_begin,const Vector3& p_end,Vector3 &r_point, Vector3 &r_normal) const; bool intersect_ray(const Vector3& p_begin,const Vector3& p_dir,Vector3 &r_point, Vector3 &r_normal) const; - Vector3 get_area_normal(const AABB& p_aabb) const; - DVector<Face3> get_faces() const; + Vector3 get_area_normal(const Rect3& p_aabb) const; + PoolVector<Face3> get_faces() const; - void create(const DVector<Vector3>& p_faces); + void create(const PoolVector<Vector3>& p_faces); TriangleMesh(); }; diff --git a/core/math/triangulate.cpp b/core/math/triangulate.cpp index eaf019f200..82b49be7f3 100644 --- a/core/math/triangulate.cpp +++ b/core/math/triangulate.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/triangulate.h b/core/math/triangulate.h index ef622b5005..d22677a8b8 100644 --- a/core/math/triangulate.h +++ b/core/math/triangulate.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/math/vector3.cpp b/core/math/vector3.cpp index fae3831dd6..3eb978333d 100644 --- a/core/math/vector3.cpp +++ b/core/math/vector3.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,7 +32,7 @@ void Vector3::rotate(const Vector3& p_axis,float p_phi) { - *this=Matrix3(p_axis,p_phi).xform(*this); + *this=Basis(p_axis,p_phi).xform(*this); } Vector3 Vector3::rotated(const Vector3& p_axis,float p_phi) const { diff --git a/core/math/vector3.h b/core/math/vector3.h index 06840be5e7..9ae9b69dfa 100644 --- a/core/math/vector3.h +++ b/core/math/vector3.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,6 +34,7 @@ #include "math_funcs.h" #include "ustring.h" +class Basis; struct Vector3 { @@ -92,6 +93,8 @@ struct Vector3 { _FORCE_INLINE_ Vector3 cross(const Vector3& p_b) const; _FORCE_INLINE_ real_t dot(const Vector3& p_b) const; + _FORCE_INLINE_ Basis outer(const Vector3& p_b) const; + _FORCE_INLINE_ Basis to_diagonal_matrix() const; _FORCE_INLINE_ Vector3 abs() const; _FORCE_INLINE_ Vector3 floor() const; @@ -144,6 +147,8 @@ struct Vector3 { #else +#include "matrix3.h" + Vector3 Vector3::cross(const Vector3& p_b) const { Vector3 ret ( @@ -160,6 +165,21 @@ real_t Vector3::dot(const Vector3& p_b) const { return x*p_b.x + y*p_b.y + z*p_b.z; } +Basis Vector3::outer(const Vector3& p_b) const { + + Vector3 row0(x*p_b.x, x*p_b.y, x*p_b.z); + Vector3 row1(y*p_b.x, y*p_b.y, y*p_b.z); + Vector3 row2(z*p_b.x, z*p_b.y, z*p_b.z); + + return Basis(row0, row1, row2); +} + +Basis Vector3::to_diagonal_matrix() const { + return Basis(x, 0, 0, + 0, y, 0, + 0, 0, z); +} + Vector3 Vector3::abs() const { return Vector3( Math::abs(x), Math::abs(y), Math::abs(z) ); @@ -293,7 +313,6 @@ bool Vector3::operator==(const Vector3& p_v) const { } bool Vector3::operator!=(const Vector3& p_v) const { - return (x!=p_v.x || y!=p_v.y || z!=p_v.z); } diff --git a/core/message_queue.cpp b/core/message_queue.cpp index f3daa46c3d..fe46e1671c 100644 --- a/core/message_queue.cpp +++ b/core/message_queue.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -45,7 +45,7 @@ Error MessageQueue::push_call(ObjectID p_id,const StringName& p_method,const Var if ((buffer_end+room_needed) >= buffer_size) { String type; if (ObjectDB::get_instance(p_id)) - type=ObjectDB::get_instance(p_id)->get_type(); + type=ObjectDB::get_instance(p_id)->get_class(); print_line("failed method: "+type+":"+p_method+" target ID: "+itos(p_id)); statistics(); @@ -98,7 +98,7 @@ Error MessageQueue::push_set(ObjectID p_id, const StringName& p_prop, const Vari if ((buffer_end+room_needed) >= buffer_size) { String type; if (ObjectDB::get_instance(p_id)) - type=ObjectDB::get_instance(p_id)->get_type(); + type=ObjectDB::get_instance(p_id)->get_class(); print_line("failed set: "+type+":"+p_prop+" target ID: "+itos(p_id)); statistics(); @@ -133,7 +133,7 @@ Error MessageQueue::push_notification(ObjectID p_id, int p_notification) { if ((buffer_end+room_needed) >= buffer_size) { String type; if (ObjectDB::get_instance(p_id)) - type=ObjectDB::get_instance(p_id)->get_type(); + type=ObjectDB::get_instance(p_id)->get_class(); print_line("failed notification: "+itos(p_notification)+" target ID: "+itos(p_id)); statistics(); @@ -398,7 +398,7 @@ MessageQueue::MessageQueue() { buffer_end=0; buffer_max_used=0; - buffer_size=GLOBAL_DEF( "core/message_queue_size_kb", DEFAULT_QUEUE_SIZE_KB ); + buffer_size=GLOBAL_DEF( "memory/buffers/message_queue_max_size_kb", DEFAULT_QUEUE_SIZE_KB ); buffer_size*=1024; buffer = memnew_arr( uint8_t, buffer_size ); } diff --git a/core/message_queue.h b/core/message_queue.h index 6a3ec79732..1b1a20ba9a 100644 --- a/core/message_queue.h +++ b/core/message_queue.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/method_bind.cpp b/core/method_bind.cpp index a99d0af636..f323f3bc24 100644 --- a/core/method_bind.cpp +++ b/core/method_bind.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/method_bind.h b/core/method_bind.h index 04ff5c22c6..7b59e6a6b0 100644 --- a/core/method_bind.h +++ b/core/method_bind.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -231,7 +231,7 @@ public: #endif void set_hint_flags(uint32_t p_hint) { hint_flags=p_hint; } uint32_t get_hint_flags() const { return hint_flags|(is_const()?METHOD_FLAG_CONST:0)|(is_vararg()?METHOD_FLAG_VARARG:0); } - virtual String get_instance_type() const=0; + virtual String get_instance_class() const=0; _FORCE_INLINE_ int get_argument_count() const { return argument_count; }; @@ -328,7 +328,7 @@ public: void set_method(NativeCall p_method) { call_method=p_method; } virtual bool is_const() const { return false; } - virtual String get_instance_type() const { return T::get_type_static(); } + virtual String get_instance_class() const { return T::get_class_static(); } virtual bool is_vararg() const { return true; } diff --git a/core/method_ptrcall.h b/core/method_ptrcall.h index e38d59fd8f..36b42c84f3 100644 --- a/core/method_ptrcall.h +++ b/core/method_ptrcall.h @@ -71,11 +71,11 @@ MAKE_PTRARG(String); MAKE_PTRARG(Vector2); MAKE_PTRARG(Rect2); MAKE_PTRARG(Vector3); -MAKE_PTRARG(Matrix32); +MAKE_PTRARG(Transform2D); MAKE_PTRARG(Plane); MAKE_PTRARG(Quat); MAKE_PTRARG(AABB); -MAKE_PTRARG(Matrix3); +MAKE_PTRARG(Basis); MAKE_PTRARG(Transform); MAKE_PTRARG(Color); MAKE_PTRARG(Image); @@ -133,12 +133,12 @@ struct PtrToArg< const T* > { template<>\ struct PtrToArg<Vector<m_type> > {\ _FORCE_INLINE_ static Vector<m_type> convert(const void* p_ptr) {\ - const DVector<m_type> *dvs = reinterpret_cast<const DVector<m_type> *>(p_ptr);\ + const PoolVector<m_type> *dvs = reinterpret_cast<const PoolVector<m_type> *>(p_ptr);\ Vector<m_type> ret;\ int len = dvs->size();\ ret.resize(len);\ {\ - DVector<m_type>::Read r=dvs->read();\ + PoolVector<m_type>::Read r=dvs->read();\ for(int i=0;i<len;i++) {\ ret[i]=r[i];\ }\ @@ -146,11 +146,11 @@ struct PtrToArg<Vector<m_type> > {\ return ret;\ }\ _FORCE_INLINE_ static void encode(Vector<m_type> p_vec, void* p_ptr) {\ - DVector<m_type> *dv = reinterpret_cast<DVector<m_type> *>(p_ptr);\ + PoolVector<m_type> *dv = reinterpret_cast<PoolVector<m_type> *>(p_ptr);\ int len=p_vec.size();\ dv->resize(len);\ {\ - DVector<m_type>::Write w=dv->write();\ + PoolVector<m_type>::Write w=dv->write();\ for(int i=0;i<len;i++) {\ w[i]=p_vec[i];\ }\ @@ -160,12 +160,12 @@ struct PtrToArg<Vector<m_type> > {\ template<>\ struct PtrToArg<const Vector<m_type>& > {\ _FORCE_INLINE_ static Vector<m_type> convert(const void* p_ptr) {\ - const DVector<m_type> *dvs = reinterpret_cast<const DVector<m_type> *>(p_ptr);\ + const PoolVector<m_type> *dvs = reinterpret_cast<const PoolVector<m_type> *>(p_ptr);\ Vector<m_type> ret;\ int len = dvs->size();\ ret.resize(len);\ {\ - DVector<m_type>::Read r=dvs->read();\ + PoolVector<m_type>::Read r=dvs->read();\ for(int i=0;i<len;i++) {\ ret[i]=r[i];\ }\ @@ -226,26 +226,26 @@ MAKE_VECARR(Plane); #define MAKE_DVECARR(m_type) \ template<>\ -struct PtrToArg<DVector<m_type> > {\ - _FORCE_INLINE_ static DVector<m_type> convert(const void* p_ptr) {\ +struct PtrToArg<PoolVector<m_type> > {\ + _FORCE_INLINE_ static PoolVector<m_type> convert(const void* p_ptr) {\ const Array *arr = reinterpret_cast<const Array *>(p_ptr);\ - DVector<m_type> ret;\ + PoolVector<m_type> ret;\ int len = arr->size();\ ret.resize(len);\ {\ - DVector<m_type>::Write w=ret.write();\ + PoolVector<m_type>::Write w=ret.write();\ for(int i=0;i<len;i++) {\ w[i]=(*arr)[i];\ }\ }\ return ret;\ }\ - _FORCE_INLINE_ static void encode(DVector<m_type> p_vec, void* p_ptr) {\ + _FORCE_INLINE_ static void encode(PoolVector<m_type> p_vec, void* p_ptr) {\ Array *arr = reinterpret_cast<Array *>(p_ptr);\ int len = p_vec.size();\ arr->resize(len);\ {\ - DVector<m_type>::Read r=p_vec.read();\ + PoolVector<m_type>::Read r=p_vec.read();\ for(int i=0;i<len;i++) {\ (*arr)[i]=r[i];\ }\ @@ -253,14 +253,14 @@ struct PtrToArg<DVector<m_type> > {\ } \ };\ template<>\ -struct PtrToArg<const DVector<m_type>& > {\ - _FORCE_INLINE_ static DVector<m_type> convert(const void* p_ptr) {\ +struct PtrToArg<const PoolVector<m_type>& > {\ + _FORCE_INLINE_ static PoolVector<m_type> convert(const void* p_ptr) {\ const Array *arr = reinterpret_cast<const Array *>(p_ptr);\ - DVector<m_type> ret;\ + PoolVector<m_type> ret;\ int len = arr->size();\ ret.resize(len);\ {\ - DVector<m_type>::Write w=ret.write();\ + PoolVector<m_type>::Write w=ret.write();\ for(int i=0;i<len;i++) {\ w[i]=(*arr)[i];\ }\ @@ -297,15 +297,15 @@ MAKE_STRINGCONV(StringName); MAKE_STRINGCONV(IP_Address); template<> -struct PtrToArg<DVector<Face3> > { - _FORCE_INLINE_ static DVector<Face3> convert(const void* p_ptr) { - const DVector<Vector3> *dvs = reinterpret_cast<const DVector<Vector3> *>(p_ptr); - DVector<Face3> ret; +struct PtrToArg<PoolVector<Face3> > { + _FORCE_INLINE_ static PoolVector<Face3> convert(const void* p_ptr) { + const PoolVector<Vector3> *dvs = reinterpret_cast<const PoolVector<Vector3> *>(p_ptr); + PoolVector<Face3> ret; int len = dvs->size()/3; ret.resize(len); { - DVector<Vector3>::Read r=dvs->read(); - DVector<Face3>::Write w=ret.write(); + PoolVector<Vector3>::Read r=dvs->read(); + PoolVector<Face3>::Write w=ret.write(); for(int i=0;i<len;i++) { w[i].vertex[0]=r[i*3+0]; w[i].vertex[1]=r[i*3+1]; @@ -314,13 +314,13 @@ struct PtrToArg<DVector<Face3> > { } return ret; } - _FORCE_INLINE_ static void encode(DVector<Face3> p_vec, void* p_ptr) {\ - DVector<Vector3> *arr = reinterpret_cast<DVector<Vector3> *>(p_ptr);\ + _FORCE_INLINE_ static void encode(PoolVector<Face3> p_vec, void* p_ptr) {\ + PoolVector<Vector3> *arr = reinterpret_cast<PoolVector<Vector3> *>(p_ptr);\ int len = p_vec.size();\ arr->resize(len*3);\ {\ - DVector<Face3>::Read r=p_vec.read();\ - DVector<Vector3>::Write w=arr->write();\ + PoolVector<Face3>::Read r=p_vec.read();\ + PoolVector<Vector3>::Write w=arr->write();\ for(int i=0;i<len;i++) {\ w[i*3+0]=r[i].vertex[0];\ w[i*3+1]=r[i].vertex[1];\ @@ -330,15 +330,15 @@ struct PtrToArg<DVector<Face3> > { } \ }; template<> -struct PtrToArg<const DVector<Face3>& > { - _FORCE_INLINE_ static DVector<Face3> convert(const void* p_ptr) { - const DVector<Vector3> *dvs = reinterpret_cast<const DVector<Vector3> *>(p_ptr); - DVector<Face3> ret; +struct PtrToArg<const PoolVector<Face3>& > { + _FORCE_INLINE_ static PoolVector<Face3> convert(const void* p_ptr) { + const PoolVector<Vector3> *dvs = reinterpret_cast<const PoolVector<Vector3> *>(p_ptr); + PoolVector<Face3> ret; int len = dvs->size()/3; ret.resize(len); { - DVector<Vector3>::Read r=dvs->read(); - DVector<Face3>::Write w=ret.write(); + PoolVector<Vector3>::Read r=dvs->read(); + PoolVector<Face3>::Write w=ret.write(); for(int i=0;i<len;i++) { w[i].vertex[0]=r[i*3+0]; w[i].vertex[1]=r[i*3+1]; diff --git a/core/object.cpp b/core/object.cpp index 9a1e9be8d5..3bb917bd38 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -341,15 +341,15 @@ bool Object::_predelete() { _predelete_ok=1; notification(NOTIFICATION_PREDELETE,true); if (_predelete_ok) { - _type_ptr=NULL; //must restore so destructors can access type ptr correctly + _class_ptr=NULL; //must restore so destructors can access class ptr correctly } return _predelete_ok; } void Object::_postinitialize() { - _type_ptr=_get_type_namev(); - _initialize_typev(); + _class_ptr=_get_class_namev(); + _initialize_classv(); notification(NOTIFICATION_POSTINITIALIZE); } @@ -373,7 +373,7 @@ void Object::set(const String& p_name, const Variant& p_value) { // return; bool success; - ObjectTypeDB::set_property(this,p_name,p_value,success); + ClassDB::set_property(this,p_name,p_value,success); if (success) { return; } @@ -409,7 +409,7 @@ void Object::set(const StringName& p_name, const Variant& p_value, bool *r_valid //try built-in setgetter { - if (ObjectTypeDB::set_property(this,p_name,p_value,r_valid)) { + if (ClassDB::set_property(this,p_name,p_value,r_valid)) { //if (r_valid) // *r_valid=true; return; @@ -460,7 +460,7 @@ Variant Object::get(const StringName& p_name, bool *r_valid) const{ //try built-in setgetter { - if (ObjectTypeDB::get_property(const_cast<Object*>(this),p_name,ret)) { + if (ClassDB::get_property(const_cast<Object*>(this),p_name,ret)) { if (r_valid) *r_valid=true; return ret; @@ -504,7 +504,7 @@ Variant Object::get(const String& p_name) const { return ret; bool success; - ObjectTypeDB::get_property(const_cast<Object*>(this),p_name,ret,success); + ClassDB::get_property(const_cast<Object*>(this),p_name,ret,success); if (success) { return ret; } @@ -532,10 +532,8 @@ void Object::get_property_list(List<PropertyInfo> *p_list,bool p_reversed) const _get_property_listv(p_list,p_reversed); - if (!_use_builtin_script()) - return; - if (!is_type("Script")) // can still be set, but this is for userfriendlyness + if (!is_class("Script")) // can still be set, but this is for userfriendlyness p_list->push_back( PropertyInfo( Variant::OBJECT, "script/script", PROPERTY_HINT_RESOURCE_TYPE, "Script",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_STORE_IF_NONZERO)); if (!metadata.empty()) p_list->push_back( PropertyInfo( Variant::DICTIONARY, "__meta__", PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR|PROPERTY_USAGE_STORE_IF_NONZERO)); @@ -552,7 +550,7 @@ void Object::_validate_property(PropertyInfo& property) const { void Object::get_method_list(List<MethodInfo> *p_list) const { - ObjectTypeDB::get_method_list(get_type_name(),p_list); + ClassDB::get_method_list(get_class_name(),p_list); if (script_instance) { script_instance->get_method_list(p_list); } @@ -697,7 +695,7 @@ void Object::call_multilevel(const StringName& p_method,const Variant** p_args,i } - MethodBind *method=ObjectTypeDB::get_method(get_type_name(),p_method); + MethodBind *method=ClassDB::get_method(get_class_name(),p_method); if (method) { @@ -710,7 +708,7 @@ void Object::call_multilevel(const StringName& p_method,const Variant** p_args,i void Object::call_multilevel_reversed(const StringName& p_method,const Variant** p_args,int p_argcount) { - MethodBind *method=ObjectTypeDB::get_method(get_type_name(),p_method); + MethodBind *method=ClassDB::get_method(get_class_name(),p_method); Variant::CallError error; OBJ_DEBUG_LOCK @@ -744,7 +742,7 @@ bool Object::has_method(const StringName& p_method) const { return true; } - MethodBind *method=ObjectTypeDB::get_method(get_type_name(),p_method); + MethodBind *method=ClassDB::get_method(get_class_name(),p_method); if (method) { return true; @@ -821,7 +819,7 @@ Variant Object::call(const StringName& p_name, VARIANT_ARG_DECLARE) { return ret; } - MethodBind *method=ObjectTypeDB::get_method(get_type_name(),p_name); + MethodBind *method=ClassDB::get_method(get_type_name(),p_name); if (method) { @@ -888,7 +886,7 @@ void Object::call_multilevel(const StringName& p_name, VARIANT_ARG_DECLARE) { } - MethodBind *method=ObjectTypeDB::get_method(get_type_name(),p_name); + MethodBind *method=ClassDB::get_method(get_type_name(),p_name); if (method) { @@ -971,7 +969,7 @@ Variant Object::call(const StringName& p_method,const Variant** p_args,int p_arg } } - MethodBind *method=ObjectTypeDB::get_method(get_type_name(),p_method); + MethodBind *method=ClassDB::get_method(get_class_name(),p_method); if (method) { @@ -1112,9 +1110,9 @@ Array Object::_get_method_list_bind() const { } -DVector<String> Object::_get_meta_list_bind() const { +PoolVector<String> Object::_get_meta_list_bind() const { - DVector<String> _metaret; + PoolVector<String> _metaret; List<Variant> keys; metadata.get_key_list(&keys); @@ -1138,7 +1136,7 @@ void Object::get_meta_list(List<String> *p_list) const { void Object::add_user_signal(const MethodInfo& p_signal) { ERR_FAIL_COND(p_signal.name==""); - ERR_FAIL_COND( ObjectTypeDB::has_signal(get_type_name(),p_signal.name ) ); + ERR_FAIL_COND( ClassDB::has_signal(get_class_name(),p_signal.name ) ); ERR_FAIL_COND(signal_map.has(p_signal.name)); Signal s; s.user=p_signal; @@ -1216,7 +1214,7 @@ void Object::emit_signal(const StringName& p_name,const Variant** p_args,int p_a Signal *s = signal_map.getptr(p_name); if (!s) { #ifdef DEBUG_ENABLED - bool signal_is_valid = ObjectTypeDB::has_signal(get_type_name(),p_name); + bool signal_is_valid = ClassDB::has_signal(get_class_name(),p_name); //check in script if (!signal_is_valid && !script.is_null() && !Ref<Script>(script)->has_script_signal(p_name)) { ERR_EXPLAIN("Can't emit non-existing signal " + String("\"")+p_name+"\"."); @@ -1281,7 +1279,7 @@ void Object::emit_signal(const StringName& p_name,const Variant** p_args,int p_a target->call( c.method, args, argc,ce ); if (ce.error!=Variant::CallError::CALL_OK) { - if (ce.error==Variant::CallError::CALL_ERROR_INVALID_METHOD && !ObjectTypeDB::type_exists( target->get_type_name() ) ) { + if (ce.error==Variant::CallError::CALL_ERROR_INVALID_METHOD && !ClassDB::class_exists( target->get_class_name() ) ) { //most likely object is not initialized yet, do not throw error. } else { ERR_PRINTS("Error calling method from signal '"+String(p_name)+"': "+Variant::get_call_error_text(target,c.method,args,argc,ce)); @@ -1415,7 +1413,7 @@ void Object::get_signal_list(List<MethodInfo> *p_signals ) const { Ref<Script>(script)->get_script_signal_list(p_signals); } - ObjectTypeDB::get_signal_list(get_type_name(),p_signals); + ClassDB::get_signal_list(get_class_name(),p_signals); //find maybe usersignals? const StringName *S=NULL; @@ -1489,13 +1487,13 @@ Error Object::connect(const StringName& p_signal, Object *p_to_object, const Str Signal *s = signal_map.getptr(p_signal); if (!s) { - bool signal_is_valid = ObjectTypeDB::has_signal(get_type_name(),p_signal); + bool signal_is_valid = ClassDB::has_signal(get_class_name(),p_signal); //check in script if (!signal_is_valid && !script.is_null() && Ref<Script>(script)->has_script_signal(p_signal)) signal_is_valid=true; if (!signal_is_valid) { - ERR_EXPLAIN("In Object of type '"+String(get_type())+"': Attempt to connect nonexistent signal '"+p_signal+"' to method '"+p_to_object->get_type()+"."+p_to_method+"'"); + ERR_EXPLAIN("In Object of type '"+String(get_class())+"': Attempt to connect nonexistent signal '"+p_signal+"' to method '"+p_to_object->get_class()+"."+p_to_method+"'"); ERR_FAIL_COND_V(!signal_is_valid,ERR_INVALID_PARAMETER); } signal_map[p_signal]=Signal(); @@ -1529,7 +1527,7 @@ bool Object::is_connected(const StringName& p_signal, Object *p_to_object, const ERR_FAIL_NULL_V(p_to_object,false); const Signal *s = signal_map.getptr(p_signal); if (!s) { - bool signal_is_valid = ObjectTypeDB::has_signal(get_type_name(),p_signal); + bool signal_is_valid = ClassDB::has_signal(get_class_name(),p_signal); if (signal_is_valid) return false; @@ -1571,7 +1569,7 @@ void Object::disconnect(const StringName& p_signal, Object *p_to_object, const S p_to_object->connections.erase(s->slot_map[target].cE); s->slot_map.erase(target); - if (s->slot_map.empty() && ObjectTypeDB::has_signal(get_type_name(),p_signal )) { + if (s->slot_map.empty() && ClassDB::has_signal(get_class_name(),p_signal )) { //not user signal, delete signal_map.erase(p_signal); } @@ -1588,12 +1586,12 @@ Variant Object::_get_bind(const String& p_name) const { return get(p_name); } -void Object::initialize_type() { +void Object::initialize_class() { static bool initialized=false; if (initialized) return; - ObjectTypeDB::_add_type<Object>(); + ClassDB::_add_class<Object>(); _bind_methods(); initialized=true; } @@ -1672,31 +1670,31 @@ void Object::clear_internal_resource_paths() { void Object::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_type"),&Object::get_type); - ObjectTypeDB::bind_method(_MD("is_type","type"),&Object::is_type); - ObjectTypeDB::bind_method(_MD("set","property","value"),&Object::_set_bind); - ObjectTypeDB::bind_method(_MD("get","property"),&Object::_get_bind); - ObjectTypeDB::bind_method(_MD("get_property_list"),&Object::_get_property_list_bind); - ObjectTypeDB::bind_method(_MD("get_method_list"),&Object::_get_method_list_bind); - ObjectTypeDB::bind_method(_MD("notification","what","reversed"),&Object::notification,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("get_instance_ID"),&Object::get_instance_ID); + ClassDB::bind_method(_MD("get_class"),&Object::get_class); + ClassDB::bind_method(_MD("is_class","type"),&Object::is_class); + ClassDB::bind_method(_MD("set","property","value"),&Object::_set_bind); + ClassDB::bind_method(_MD("get","property"),&Object::_get_bind); + ClassDB::bind_method(_MD("get_property_list"),&Object::_get_property_list_bind); + ClassDB::bind_method(_MD("get_method_list"),&Object::_get_method_list_bind); + ClassDB::bind_method(_MD("notification","what","reversed"),&Object::notification,DEFVAL(false)); + ClassDB::bind_method(_MD("get_instance_ID"),&Object::get_instance_ID); - ObjectTypeDB::bind_method(_MD("set_script","script:Script"),&Object::set_script); - ObjectTypeDB::bind_method(_MD("get_script:Script"),&Object::get_script); + ClassDB::bind_method(_MD("set_script","script:Script"),&Object::set_script); + ClassDB::bind_method(_MD("get_script:Script"),&Object::get_script); - ObjectTypeDB::bind_method(_MD("set_meta","name","value"),&Object::set_meta); - ObjectTypeDB::bind_method(_MD("get_meta","name","value"),&Object::get_meta); - ObjectTypeDB::bind_method(_MD("has_meta","name"),&Object::has_meta); - ObjectTypeDB::bind_method(_MD("get_meta_list"),&Object::_get_meta_list_bind); + ClassDB::bind_method(_MD("set_meta","name","value"),&Object::set_meta); + ClassDB::bind_method(_MD("get_meta","name","value"),&Object::get_meta); + ClassDB::bind_method(_MD("has_meta","name"),&Object::has_meta); + ClassDB::bind_method(_MD("get_meta_list"),&Object::_get_meta_list_bind); //todo reimplement this per language so all 5 arguments can be called -// ObjectTypeDB::bind_method(_MD("call","method","arg1","arg2","arg3","arg4"),&Object::_call_bind,DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant())); -// ObjectTypeDB::bind_method(_MD("call_deferred","method","arg1","arg2","arg3","arg4"),&Object::_call_deferred_bind,DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant())); +// ClassDB::bind_method(_MD("call","method","arg1","arg2","arg3","arg4"),&Object::_call_bind,DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant())); +// ClassDB::bind_method(_MD("call_deferred","method","arg1","arg2","arg3","arg4"),&Object::_call_deferred_bind,DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant()),DEFVAL(Variant())); - ObjectTypeDB::bind_method(_MD("add_user_signal","signal","arguments"),&Object::_add_user_signal,DEFVAL(Array())); - ObjectTypeDB::bind_method(_MD("has_user_signal","signal"),&Object::_has_user_signal); -// ObjectTypeDB::bind_method(_MD("emit_signal","signal","arguments"),&Object::_emit_signal,DEFVAL(Array())); + ClassDB::bind_method(_MD("add_user_signal","signal","arguments"),&Object::_add_user_signal,DEFVAL(Array())); + ClassDB::bind_method(_MD("has_user_signal","signal"),&Object::_has_user_signal); +// ClassDB::bind_method(_MD("emit_signal","signal","arguments"),&Object::_emit_signal,DEFVAL(Array())); { @@ -1704,7 +1702,7 @@ void Object::_bind_methods() { mi.name="emit_signal"; mi.arguments.push_back( PropertyInfo( Variant::STRING, "signal")); - ObjectTypeDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"emit_signal",&Object::_emit_signal,mi); + ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"emit_signal",&Object::_emit_signal,mi); } { @@ -1714,7 +1712,7 @@ void Object::_bind_methods() { - ObjectTypeDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"call:Variant",&Object::_call_bind,mi); + ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"call:Variant",&Object::_call_bind,mi); } { @@ -1722,32 +1720,32 @@ void Object::_bind_methods() { mi.name="call_deferred"; mi.arguments.push_back( PropertyInfo( Variant::STRING, "method")); - ObjectTypeDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"call_deferred",&Object::_call_deferred_bind,mi); + ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"call_deferred",&Object::_call_deferred_bind,mi); } - ObjectTypeDB::bind_method(_MD("callv:Variant","method","arg_array"),&Object::callv); + ClassDB::bind_method(_MD("callv:Variant","method","arg_array"),&Object::callv); - ObjectTypeDB::bind_method(_MD("has_method","method"),&Object::has_method); + ClassDB::bind_method(_MD("has_method","method"),&Object::has_method); - ObjectTypeDB::bind_method(_MD("get_signal_list"),&Object::_get_signal_list); - ObjectTypeDB::bind_method(_MD("get_signal_connection_list","signal"),&Object::_get_signal_connection_list); + ClassDB::bind_method(_MD("get_signal_list"),&Object::_get_signal_list); + ClassDB::bind_method(_MD("get_signal_connection_list","signal"),&Object::_get_signal_connection_list); - ObjectTypeDB::bind_method(_MD("connect","signal","target:Object","method","binds","flags"),&Object::connect,DEFVAL(Array()),DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("disconnect","signal","target:Object","method"),&Object::disconnect); - ObjectTypeDB::bind_method(_MD("is_connected","signal","target:Object","method"),&Object::is_connected); + ClassDB::bind_method(_MD("connect","signal","target:Object","method","binds","flags"),&Object::connect,DEFVAL(Array()),DEFVAL(0)); + ClassDB::bind_method(_MD("disconnect","signal","target:Object","method"),&Object::disconnect); + ClassDB::bind_method(_MD("is_connected","signal","target:Object","method"),&Object::is_connected); - ObjectTypeDB::bind_method(_MD("set_block_signals","enable"),&Object::set_block_signals); - ObjectTypeDB::bind_method(_MD("is_blocking_signals"),&Object::is_blocking_signals); - ObjectTypeDB::bind_method(_MD("set_message_translation","enable"),&Object::set_message_translation); - ObjectTypeDB::bind_method(_MD("can_translate_messages"),&Object::can_translate_messages); - ObjectTypeDB::bind_method(_MD("property_list_changed_notify"),&Object::property_list_changed_notify); + ClassDB::bind_method(_MD("set_block_signals","enable"),&Object::set_block_signals); + ClassDB::bind_method(_MD("is_blocking_signals"),&Object::is_blocking_signals); + ClassDB::bind_method(_MD("set_message_translation","enable"),&Object::set_message_translation); + ClassDB::bind_method(_MD("can_translate_messages"),&Object::can_translate_messages); + ClassDB::bind_method(_MD("property_list_changed_notify"),&Object::property_list_changed_notify); - ObjectTypeDB::bind_method(_MD("XL_MESSAGE","message"),&Object::XL_MESSAGE); - ObjectTypeDB::bind_method(_MD("tr","message"),&Object::tr); + ClassDB::bind_method(_MD("XL_MESSAGE","message"),&Object::XL_MESSAGE); + ClassDB::bind_method(_MD("tr","message"),&Object::tr); - ObjectTypeDB::bind_method(_MD("is_queued_for_deletion"),&Object::is_queued_for_deletion); + ClassDB::bind_method(_MD("is_queued_for_deletion"),&Object::is_queued_for_deletion); - ObjectTypeDB::add_virtual_method("Object",MethodInfo("free"),false); + ClassDB::add_virtual_method("Object",MethodInfo("free"),false); ADD_SIGNAL( MethodInfo("script_changed")); @@ -1815,7 +1813,7 @@ void Object::get_translatable_strings(List<String> *p_strings) const { Variant::Type Object::get_static_property_type(const StringName& p_property, bool *r_valid) const { bool valid; - Variant::Type t = ObjectTypeDB::get_property_type(get_type_name(),p_property,&valid); + Variant::Type t = ClassDB::get_property_type(get_class_name(),p_property,&valid); if (valid) { if (r_valid) *r_valid=true; @@ -1857,7 +1855,7 @@ uint32_t Object::get_edited_version() const { Object::Object() { - _type_ptr=NULL; + _class_ptr=NULL; _block_signals=false; _predelete_ok=0; _instance_ID=0; @@ -1942,27 +1940,37 @@ uint32_t ObjectDB::instance_counter=1; HashMap<Object*,ObjectID,ObjectDB::ObjectPtrHash> ObjectDB::instance_checks; uint32_t ObjectDB::add_instance(Object *p_object) { - GLOBAL_LOCK_FUNCTION; + ERR_FAIL_COND_V( p_object->get_instance_ID()!=0, 0 ); + + rw_lock->write_lock(); instances[++instance_counter]=p_object; #ifdef DEBUG_ENABLED instance_checks[p_object]=instance_counter; #endif + rw_lock->write_unlock(); + return instance_counter; } void ObjectDB::remove_instance(Object *p_object) { - GLOBAL_LOCK_FUNCTION; + + rw_lock->write_lock(); + instances.erase( p_object->get_instance_ID() ); #ifdef DEBUG_ENABLED instance_checks.erase(p_object); #endif + + rw_lock->write_unlock(); } Object *ObjectDB::get_instance(uint32_t p_instance_ID) { - GLOBAL_LOCK_FUNCTION; + rw_lock->read_lock(); Object**obj=instances.getptr(p_instance_ID); + rw_lock->read_unlock(); + if (!obj) return NULL; return *obj; @@ -1970,13 +1978,16 @@ Object *ObjectDB::get_instance(uint32_t p_instance_ID) { void ObjectDB::debug_objects(DebugFunc p_func) { - GLOBAL_LOCK_FUNCTION; + rw_lock->read_lock(); const uint32_t *K=NULL; while((K=instances.next(K))) { p_func(instances[*K]); } + + rw_lock->read_unlock(); + } @@ -1987,15 +1998,26 @@ void Object::get_argument_options(const StringName& p_function,int p_idx,List<St int ObjectDB::get_object_count() { - GLOBAL_LOCK_FUNCTION; - return instances.size(); + rw_lock->read_lock(); + int count =instances.size(); + rw_lock->read_unlock(); + + return count; + +} + +RWLock *ObjectDB::rw_lock=NULL; + +void ObjectDB::setup() { + + rw_lock = RWLock::create(); } void ObjectDB::cleanup() { - GLOBAL_LOCK_FUNCTION; + rw_lock->write_lock(); if (instances.size()) { WARN_PRINT("ObjectDB Instances still exist!"); @@ -2004,14 +2026,17 @@ void ObjectDB::cleanup() { while((K=instances.next(K))) { String node_name; - if (instances[*K]->is_type("Node")) + if (instances[*K]->is_class("Node")) node_name=" - Node Name: "+String(instances[*K]->call("get_name")); - if (instances[*K]->is_type("Resoucre")) + if (instances[*K]->is_class("Resoucre")) node_name=" - Resource Name: "+String(instances[*K]->call("get_name"))+" Path: "+String(instances[*K]->call("get_path")); - print_line("Leaked Instance: "+String(instances[*K]->get_type())+":"+itos(*K)+node_name); + print_line("Leaked Instance: "+String(instances[*K]->get_class())+":"+itos(*K)+node_name); } } } instances.clear(); instance_checks.clear(); + rw_lock->write_unlock(); + + memdelete(rw_lock); } diff --git a/core/object.h b/core/object.h index ac3fc51b3e..a54693eab6 100644 --- a/core/object.h +++ b/core/object.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,6 +34,7 @@ #include "set.h" #include "map.h" #include "vmap.h" +#include "os/rw_lock.h" #define VARIANT_ARG_LIST const Variant& p_arg1=Variant(),const Variant& p_arg2=Variant(),const Variant& p_arg3=Variant(),const Variant& p_arg4=Variant(),const Variant& p_arg5=Variant() #define VARIANT_ARG_PASS p_arg1,p_arg2,p_arg3,p_arg4,p_arg5 @@ -57,7 +58,10 @@ enum PropertyHint { PROPERTY_HINT_SPRITE_FRAME, PROPERTY_HINT_KEY_ACCEL, ///< hint_text= "length" (as integer) PROPERTY_HINT_FLAGS, ///< hint_text= "flag1,flag2,etc" (as bit flags) - PROPERTY_HINT_ALL_FLAGS, + PROPERTY_HINT_LAYERS_2D_RENDER, + PROPERTY_HINT_LAYERS_2D_PHYSICS, + PROPERTY_HINT_LAYERS_3D_RENDER, + PROPERTY_HINT_LAYERS_3D_PHYSICS, PROPERTY_HINT_FILE, ///< a file path must be passed, hint_text (optionally) is a filter "*.png,*.wav,*.doc," PROPERTY_HINT_DIR, ///< a directort path must be passed PROPERTY_HINT_GLOBAL_FILE, ///< a file path must be passed, hint_text (optionally) is a filter "*.png,*.wav,*.doc," @@ -90,7 +94,7 @@ enum PropertyUsageFlags { PROPERTY_USAGE_CHECKABLE=16, //used for editing global variables PROPERTY_USAGE_CHECKED=32, //used for editing global variables PROPERTY_USAGE_INTERNATIONALIZED=64, //hint for internationalized strings - PROPERTY_USAGE_BUNDLE=128, //used for optimized bundles + PROPERTY_USAGE_GROUP=128, //used for grouping props in the editor PROPERTY_USAGE_CATEGORY=256, PROPERTY_USAGE_STORE_IF_NONZERO=512, //only store if nonzero PROPERTY_USAGE_STORE_IF_NONONE=1024, //only store if false @@ -108,13 +112,14 @@ enum PropertyUsageFlags { -#define ADD_SIGNAL( m_signal ) ObjectTypeDB::add_signal( get_type_static(), m_signal ) -#define ADD_PROPERTY( m_property, m_setter, m_getter ) ObjectTypeDB::add_property( get_type_static(), m_property, m_setter, m_getter ) -#define ADD_PROPERTYI( m_property, m_setter, m_getter, m_index ) ObjectTypeDB::add_property( get_type_static(), m_property, m_setter, m_getter, m_index ) -#define ADD_PROPERTYNZ( m_property, m_setter, m_getter ) ObjectTypeDB::add_property( get_type_static(), (m_property).added_usage(PROPERTY_USAGE_STORE_IF_NONZERO), m_setter, m_getter ) -#define ADD_PROPERTYINZ( m_property, m_setter, m_getter, m_index ) ObjectTypeDB::add_property( get_type_static(), (m_property).added_usage(PROPERTY_USAGE_STORE_IF_NONZERO), m_setter, m_getter, m_index ) -#define ADD_PROPERTYNO( m_property, m_setter, m_getter ) ObjectTypeDB::add_property( get_type_static(), (m_property).added_usage(PROPERTY_USAGE_STORE_IF_NONONE), m_setter, m_getter ) -#define ADD_PROPERTYINO( m_property, m_setter, m_getter, m_index ) ObjectTypeDB::add_property( get_type_static(), (m_property).added_usage(PROPERTY_USAGE_STORE_IF_NONONE), m_setter, m_getter, m_index ) +#define ADD_SIGNAL( m_signal ) ClassDB::add_signal( get_class_static(), m_signal ) +#define ADD_PROPERTY( m_property, m_setter, m_getter ) ClassDB::add_property( get_class_static(), m_property, m_setter, m_getter ) +#define ADD_PROPERTYI( m_property, m_setter, m_getter, m_index ) ClassDB::add_property( get_class_static(), m_property, m_setter, m_getter, m_index ) +#define ADD_PROPERTYNZ( m_property, m_setter, m_getter ) ClassDB::add_property( get_class_static(), (m_property).added_usage(PROPERTY_USAGE_STORE_IF_NONZERO), m_setter, m_getter ) +#define ADD_PROPERTYINZ( m_property, m_setter, m_getter, m_index ) ClassDB::add_property( get_class_static(), (m_property).added_usage(PROPERTY_USAGE_STORE_IF_NONZERO), m_setter, m_getter, m_index ) +#define ADD_PROPERTYNO( m_property, m_setter, m_getter ) ClassDB::add_property( get_class_static(), (m_property).added_usage(PROPERTY_USAGE_STORE_IF_NONONE), m_setter, m_getter ) +#define ADD_PROPERTYINO( m_property, m_setter, m_getter, m_index ) ClassDB::add_property( get_class_static(), (m_property).added_usage(PROPERTY_USAGE_STORE_IF_NONONE), m_setter, m_getter, m_index ) +#define ADD_GROUP( m_name, m_prefix ) ClassDB::add_property_group( get_class_static(), m_name, m_prefix ) struct PropertyInfo { @@ -175,7 +180,7 @@ struct MethodInfo { }; // old cast_to -//if ( is_type(T::get_type_static()) ) +//if ( is_type(T::get_class_static()) ) //return static_cast<T*>(this); ////else //return NULL; @@ -196,33 +201,33 @@ private: -#define OBJ_TYPE( m_type, m_inherits )\ +#define GDCLASS( m_class, m_inherits )\ private:\ - void operator=(const m_type& p_rval) {}\ - mutable StringName _type_name;\ - friend class ObjectTypeDB;\ + void operator=(const m_class& p_rval) {}\ + mutable StringName _class_name;\ + friend class ClassDB;\ public:\ -virtual String get_type() const { \ - return String(#m_type);\ +virtual String get_class() const { \ + return String(#m_class);\ }\ -virtual const StringName* _get_type_namev() const { \ - if (!_type_name)\ - _type_name=get_type_static();\ - return &_type_name;\ +virtual const StringName* _get_class_namev() const { \ + if (!_class_name)\ + _class_name=get_class_static();\ + return &_class_name;\ }\ -static _FORCE_INLINE_ void* get_type_ptr_static() { \ +static _FORCE_INLINE_ void* get_class_ptr_static() { \ static int ptr;\ return &ptr;\ }\ -static _FORCE_INLINE_ String get_type_static() { \ - return String(#m_type);\ +static _FORCE_INLINE_ String get_class_static() { \ + return String(#m_class);\ }\ -static _FORCE_INLINE_ String get_parent_type_static() { \ - return m_inherits::get_type_static();\ +static _FORCE_INLINE_ String get_parent_class_static() { \ + return m_inherits::get_class_static();\ }\ static void get_inheritance_list_static(List<String>* p_inheritance_list) { \ m_inherits::get_inheritance_list_static(p_inheritance_list);\ - p_inheritance_list->push_back(String(#m_type));\ + p_inheritance_list->push_back(String(#m_class));\ }\ static String get_category_static() { \ String category = m_inherits::get_category_static();\ @@ -236,85 +241,85 @@ static String get_category_static() { \ static String inherits_static() {\ return String(#m_inherits);\ }\ -virtual bool is_type(const String& p_type) const { return (p_type==(#m_type))?true:m_inherits::is_type(p_type); }\ -virtual bool is_type_ptr(void *p_ptr) const { return (p_ptr==get_type_ptr_static())?true:m_inherits::is_type_ptr(p_ptr); }\ +virtual bool is_class(const String& p_class) const { return (p_class==(#m_class))?true:m_inherits::is_class(p_class); }\ +virtual bool is_class_ptr(void *p_ptr) const { return (p_ptr==get_class_ptr_static())?true:m_inherits::is_class_ptr(p_ptr); }\ \ \ static void get_valid_parents_static(List<String> *p_parents) {\ \ - if (m_type::_get_valid_parents_static!=m_inherits::_get_valid_parents_static) { \ - m_type::_get_valid_parents_static(p_parents);\ + if (m_class::_get_valid_parents_static!=m_inherits::_get_valid_parents_static) { \ + m_class::_get_valid_parents_static(p_parents);\ }\ \ m_inherits::get_valid_parents_static(p_parents);\ }\ protected:\ _FORCE_INLINE_ static void (*_get_bind_methods())() {\ - return &m_type::_bind_methods;\ + return &m_class::_bind_methods;\ }\ public:\ -static void initialize_type() {\ +static void initialize_class() {\ static bool initialized=false;\ if (initialized)\ return;\ - m_inherits::initialize_type();\ - ObjectTypeDB::_add_type<m_type>();\ - if (m_type::_get_bind_methods() != m_inherits::_get_bind_methods())\ + m_inherits::initialize_class();\ + ClassDB::_add_class<m_class>();\ + if (m_class::_get_bind_methods() != m_inherits::_get_bind_methods())\ _bind_methods();\ initialized=true;\ }\ protected:\ -virtual void _initialize_typev() {\ - initialize_type();\ +virtual void _initialize_classv() {\ + initialize_class();\ }\ _FORCE_INLINE_ bool (Object::* (_get_get() const))(const StringName& p_name,Variant&) const {\ - return (bool (Object::*)(const StringName&,Variant&)const) &m_type::_get;\ + return (bool (Object::*)(const StringName&,Variant&)const) &m_class::_get;\ }\ virtual bool _getv(const StringName& p_name, Variant& r_ret) const { \ - if (m_type::_get_get() != m_inherits::_get_get()) {\ + if (m_class::_get_get() != m_inherits::_get_get()) {\ if (_get(p_name,r_ret))\ return true;\ }\ return m_inherits::_getv(p_name,r_ret);\ }\ _FORCE_INLINE_ bool (Object::* (_get_set() const))(const StringName& p_name,const Variant &p_property) {\ - return (bool (Object::*)(const StringName&, const Variant&))&m_type::_set;\ + return (bool (Object::*)(const StringName&, const Variant&))&m_class::_set;\ }\ virtual bool _setv(const StringName& p_name,const Variant &p_property) { \ if (m_inherits::_setv(p_name,p_property)) return true;\ - if (m_type::_get_set() != m_inherits::_get_set()) {\ + if (m_class::_get_set() != m_inherits::_get_set()) {\ return _set(p_name,p_property);\ \ }\ return false;\ }\ _FORCE_INLINE_ void (Object::* (_get_get_property_list() const))(List<PropertyInfo> *p_list) const{\ - return (void (Object::*)(List<PropertyInfo>*)const)&m_type::_get_property_list;\ + return (void (Object::*)(List<PropertyInfo>*)const)&m_class::_get_property_list;\ }\ virtual void _get_property_listv(List<PropertyInfo> *p_list,bool p_reversed) const { \ if (!p_reversed) {\ m_inherits::_get_property_listv(p_list,p_reversed);\ }\ - p_list->push_back( PropertyInfo(Variant::NIL,get_type_static(),PROPERTY_HINT_NONE,String(),PROPERTY_USAGE_CATEGORY));\ + p_list->push_back( PropertyInfo(Variant::NIL,get_class_static(),PROPERTY_HINT_NONE,String(),PROPERTY_USAGE_CATEGORY));\ if (!_is_gpl_reversed())\ - ObjectTypeDB::get_property_list(#m_type,p_list,true,this);\ - if (m_type::_get_get_property_list() != m_inherits::_get_get_property_list()) {\ + ClassDB::get_property_list(#m_class,p_list,true,this);\ + if (m_class::_get_get_property_list() != m_inherits::_get_get_property_list()) {\ _get_property_list(p_list);\ }\ if (_is_gpl_reversed())\ - ObjectTypeDB::get_property_list(#m_type,p_list,true,this);\ + ClassDB::get_property_list(#m_class,p_list,true,this);\ if (p_reversed) {\ m_inherits::_get_property_listv(p_list,p_reversed);\ }\ \ }\ _FORCE_INLINE_ void (Object::* (_get_notification() const))(int){\ - return (void (Object::*)(int)) &m_type::_notification;\ + return (void (Object::*)(int)) &m_class::_notification;\ }\ virtual void _notificationv(int p_notification,bool p_reversed) { \ if (!p_reversed) \ m_inherits::_notificationv(p_notification,p_reversed);\ - if (m_type::_get_notification() != m_inherits::_get_notification()) {\ + if (m_class::_get_notification() != m_inherits::_get_notification()) {\ _notification(p_notification);\ }\ if (p_reversed)\ @@ -329,9 +334,9 @@ protected:\ _FORCE_INLINE_ static String _get_category() { return m_category; }\ private: -#define OBJ_SAVE_TYPE(m_type) \ +#define OBJ_SAVE_TYPE(m_class) \ public: \ -virtual String get_save_type() const { return #m_type; }\ +virtual String get_save_class() const { return #m_class; }\ private: class ScriptInstance; @@ -415,8 +420,8 @@ friend void postinitialize_handler(Object*); ScriptInstance *script_instance; RefPtr script; Dictionary metadata; - mutable StringName _type_name; - mutable const StringName* _type_ptr; + mutable StringName _class_name; + mutable const StringName* _class_ptr; void _add_user_signal(const String& p_name, const Array& p_pargs=Array()); bool _has_user_signal(const StringName& p_name) const; @@ -430,8 +435,8 @@ friend void postinitialize_handler(Object*); protected: - virtual bool _use_builtin_script() const { return false; } - virtual void _initialize_typev() { initialize_type(); } + + virtual void _initialize_classv() { initialize_class(); } virtual bool _setv(const StringName& p_name,const Variant &p_property) { return false; }; virtual bool _getv(const StringName& p_name,Variant &r_property) const { return false; }; virtual void _get_property_listv(List<PropertyInfo> *p_list,bool p_reversed) const {}; @@ -474,23 +479,23 @@ protected: Variant _call_deferred_bind(const Variant** p_args, int p_argcount, Variant::CallError& r_error); - virtual const StringName* _get_type_namev() const { - if (!_type_name) - _type_name=get_type_static(); - return &_type_name; + virtual const StringName* _get_class_namev() const { + if (!_class_name) + _class_name=get_class_static(); + return &_class_name; } - DVector<String> _get_meta_list_bind() const; + PoolVector<String> _get_meta_list_bind() const; Array _get_property_list_bind() const; Array _get_method_list_bind() const; void _clear_internal_resource_paths(const Variant &p_var); -friend class ObjectTypeDB; +friend class ClassDB; virtual void _validate_property(PropertyInfo& property) const; public: //should be protected, but bug in clang++ - static void initialize_type(); + static void initialize_class(); _FORCE_INLINE_ static void register_custom_data_to_otdb() {}; public: @@ -500,7 +505,7 @@ public: #else _FORCE_INLINE_ void _change_notify(const char *p_what="") { } #endif - static void* get_type_ptr_static() { + static void* get_class_ptr_static() { static int ptr; return &ptr; } @@ -521,7 +526,7 @@ public: #else if (!this) return NULL; - if (is_type_ptr(T::get_type_ptr_static())) + if (is_class_ptr(T::get_class_ptr_static())) return static_cast<T*>(this); else return NULL; @@ -536,7 +541,7 @@ public: #else if (!this) return NULL; - if (is_type_ptr(T::get_type_ptr_static())) + if (is_class_ptr(T::get_class_ptr_static())) return static_cast<const T*>(this); else return NULL; @@ -552,24 +557,24 @@ public: /* TYPE API */ static void get_inheritance_list_static(List<String>* p_inheritance_list) { p_inheritance_list->push_back("Object"); } - static String get_type_static() { return "Object"; } - static String get_parent_type_static() { return String(); } + static String get_class_static() { return "Object"; } + static String get_parent_class_static() { return String(); } static String get_category_static() { return String(); } - virtual String get_type() const { return "Object"; } - virtual String get_save_type() const { return get_type(); } //type stored when saving + virtual String get_class() const { return "Object"; } + virtual String get_save_class() const { return get_class(); } //class stored when saving - virtual bool is_type(const String& p_type) const { return (p_type=="Object"); } - virtual bool is_type_ptr(void *p_ptr) const { return get_type_ptr_static()==p_ptr; } + virtual bool is_class(const String& p_class) const { return (p_class=="Object"); } + virtual bool is_class_ptr(void *p_ptr) const { return get_class_ptr_static()==p_ptr; } - _FORCE_INLINE_ const StringName& get_type_name() const { - if (!_type_ptr) { - return *_get_type_namev(); + _FORCE_INLINE_ const StringName& get_class_name() const { + if (!_class_ptr) { + return *_get_class_namev(); } else { - return *_type_ptr; + return *_class_ptr; } } @@ -685,9 +690,14 @@ class ObjectDB { friend class Object; friend void unregister_core_types(); + + static RWLock *rw_lock; static void cleanup(); static uint32_t add_instance(Object *p_object); static void remove_instance(Object *p_object); +friend void register_core_types(); + static void setup(); + public: typedef void (*DebugFunc)(Object *p_obj); diff --git a/core/object_type_db.cpp b/core/object_type_db.cpp index e121dc9e98..7432c09563 100644 --- a/core/object_type_db.cpp +++ b/core/object_type_db.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,11 +31,12 @@ #ifdef NO_THREADS -#define OBJTYPE_LOCK +#define OBJTYPE_RLOCK #else -#define OBJTYPE_LOCK MutexLock _mutex_lock_(lock); +#define OBJTYPE_RLOCK RWLockRead _rw_lockr_(lock); +#define OBJTYPE_WLOCK RWLockWrite _rw_lockw_(lock); #endif @@ -190,93 +191,94 @@ MethodDefinition _MD(const char* p_name,const char *p_arg1,const char *p_arg2,co #endif -ObjectTypeDB::APIType ObjectTypeDB::current_api=API_CORE; +ClassDB::APIType ClassDB::current_api=API_CORE; -void ObjectTypeDB::set_current_api(APIType p_api) { +void ClassDB::set_current_api(APIType p_api) { current_api=p_api; } -HashMap<StringName,ObjectTypeDB::TypeInfo,StringNameHasher> ObjectTypeDB::types; -HashMap<StringName,StringName,StringNameHasher> ObjectTypeDB::resource_base_extensions; -HashMap<StringName,StringName,StringNameHasher> ObjectTypeDB::compat_types; +HashMap<StringName,ClassDB::ClassInfo,StringNameHasher> ClassDB::classes; +HashMap<StringName,StringName,StringNameHasher> ClassDB::resource_base_extensions; +HashMap<StringName,StringName,StringNameHasher> ClassDB::compat_classes; -ObjectTypeDB::TypeInfo::TypeInfo() { +ClassDB::ClassInfo::ClassInfo() { creation_func=NULL; inherits_ptr=NULL; disabled=false; } -ObjectTypeDB::TypeInfo::~TypeInfo() { +ClassDB::ClassInfo::~ClassInfo() { } -bool ObjectTypeDB::is_type(const StringName &p_type,const StringName& p_inherits) { +bool ClassDB::is_parent_class(const StringName &p_class,const StringName& p_inherits) { - OBJTYPE_LOCK; + OBJTYPE_RLOCK; - StringName inherits=p_type; + StringName inherits=p_class; while (inherits.operator String().length()) { if (inherits==p_inherits) return true; - inherits=type_inherits_from(inherits); + inherits=get_parent_class(inherits); } return false; } -void ObjectTypeDB::get_type_list( List<StringName> *p_types) { +void ClassDB::get_class_list( List<StringName> *p_classes) { - OBJTYPE_LOCK; + OBJTYPE_RLOCK; const StringName *k=NULL; - while((k=types.next(k))) { + while((k=classes.next(k))) { - p_types->push_back(*k); + p_classes->push_back(*k); } - p_types->sort(); + p_classes->sort(); } -void ObjectTypeDB::get_inheriters_from( const StringName& p_type,List<StringName> *p_types) { +void ClassDB::get_inheriters_from_class( const StringName& p_class,List<StringName> *p_classes) { - OBJTYPE_LOCK; + OBJTYPE_RLOCK; const StringName *k=NULL; - while((k=types.next(k))) { + while((k=classes.next(k))) { - if (*k!=p_type && is_type(*k,p_type)) - p_types->push_back(*k); + if (*k!=p_class && is_parent_class(*k,p_class)) + p_classes->push_back(*k); } } -StringName ObjectTypeDB::type_inherits_from(const StringName& p_type) { +StringName ClassDB::get_parent_class(const StringName& p_class) { - OBJTYPE_LOCK; + OBJTYPE_RLOCK; - TypeInfo *ti = types.getptr(p_type); + ClassInfo *ti = classes.getptr(p_class); ERR_FAIL_COND_V(!ti,""); return ti->inherits; } -ObjectTypeDB::APIType ObjectTypeDB::get_api_type(const StringName &p_type) { +ClassDB::APIType ClassDB::get_api_type(const StringName &p_class) { - OBJTYPE_LOCK; + OBJTYPE_RLOCK; - TypeInfo *ti = types.getptr(p_type); + ClassInfo *ti = classes.getptr(p_class); ERR_FAIL_COND_V(!ti,API_NONE); return ti->api; } -uint64_t ObjectTypeDB::get_api_hash(APIType p_api) { +uint64_t ClassDB::get_api_hash(APIType p_api) { + OBJTYPE_RLOCK; #ifdef DEBUG_METHODS_ENABLED uint64_t hash = hash_djb2_one_64(HashMapHahserDefault::hash(VERSION_FULL_NAME)); @@ -285,7 +287,7 @@ uint64_t ObjectTypeDB::get_api_hash(APIType p_api) { const StringName *k=NULL; - while((k=types.next(k))) { + while((k=classes.next(k))) { names.push_back(*k); } @@ -294,7 +296,7 @@ uint64_t ObjectTypeDB::get_api_hash(APIType p_api) { for (List<StringName>::Element *E=names.front();E;E=E->next()) { - TypeInfo *t = types.getptr(E->get()); + ClassInfo *t = classes.getptr(E->get()); ERR_FAIL_COND_V(!t,0); if (t->api!=p_api) continue; @@ -431,26 +433,27 @@ uint64_t ObjectTypeDB::get_api_hash(APIType p_api) { } -bool ObjectTypeDB::type_exists(const StringName &p_type) { +bool ClassDB::class_exists(const StringName &p_class) { - OBJTYPE_LOCK; - return types.has(p_type); + OBJTYPE_RLOCK; + return classes.has(p_class); } -void ObjectTypeDB::add_compatibility_type(const StringName& p_type,const StringName& p_fallback) { +void ClassDB::add_compatibility_class(const StringName& p_class,const StringName& p_fallback) { - compat_types[p_type]=p_fallback; + OBJTYPE_WLOCK; + compat_classes[p_class]=p_fallback; } -Object *ObjectTypeDB::instance(const StringName &p_type) { +Object *ClassDB::instance(const StringName &p_class) { - TypeInfo *ti; + ClassInfo *ti; { - OBJTYPE_LOCK; - ti=types.getptr(p_type); + OBJTYPE_RLOCK; + ti=classes.getptr(p_class); if (!ti || ti->disabled || !ti->creation_func) { - if (compat_types.has(p_type)) { - ti=types.getptr(compat_types[p_type]); + if (compat_classes.has(p_class)) { + ti=classes.getptr(compat_classes[p_class]); } } ERR_FAIL_COND_V(!ti,NULL); @@ -460,34 +463,34 @@ Object *ObjectTypeDB::instance(const StringName &p_type) { return ti->creation_func(); } -bool ObjectTypeDB::can_instance(const StringName &p_type) { +bool ClassDB::can_instance(const StringName &p_class) { - OBJTYPE_LOCK; + OBJTYPE_RLOCK; - TypeInfo *ti = types.getptr(p_type); + ClassInfo *ti = classes.getptr(p_class); ERR_FAIL_COND_V(!ti,false); return (!ti->disabled && ti->creation_func!=NULL); } -void ObjectTypeDB::_add_type2(const StringName& p_type, const StringName& p_inherits) { +void ClassDB::_add_class2(const StringName& p_class, const StringName& p_inherits) { - OBJTYPE_LOCK; + OBJTYPE_WLOCK; - StringName name = p_type; + StringName name = p_class; - ERR_FAIL_COND(types.has(name)); + ERR_FAIL_COND(classes.has(name)); - types[name]=TypeInfo(); - TypeInfo &ti=types[name]; + classes[name]=ClassInfo(); + ClassInfo &ti=classes[name]; ti.name=name; ti.inherits=p_inherits; ti.api=current_api; if (ti.inherits) { - ERR_FAIL_COND( !types.has(ti.inherits) ); //it MUST be registered. - ti.inherits_ptr = &types[ti.inherits]; + ERR_FAIL_COND( !classes.has(ti.inherits) ); //it MUST be registered. + ti.inherits_ptr = &classes[ti.inherits]; } else { ti.inherits_ptr=NULL; @@ -496,12 +499,12 @@ void ObjectTypeDB::_add_type2(const StringName& p_type, const StringName& p_inhe } -void ObjectTypeDB::get_method_list(StringName p_type,List<MethodInfo> *p_methods,bool p_no_inheritance) { +void ClassDB::get_method_list(StringName p_class,List<MethodInfo> *p_methods,bool p_no_inheritance) { - OBJTYPE_LOCK; + OBJTYPE_RLOCK; - TypeInfo *type=types.getptr(p_type); + ClassInfo *type=classes.getptr(p_class); while(type) { @@ -570,11 +573,11 @@ void ObjectTypeDB::get_method_list(StringName p_type,List<MethodInfo> *p_methods } -MethodBind *ObjectTypeDB::get_method(StringName p_type, StringName p_name) { +MethodBind *ClassDB::get_method(StringName p_class, StringName p_name) { - OBJTYPE_LOCK; + OBJTYPE_RLOCK; - TypeInfo *type=types.getptr(p_type); + ClassInfo *type=classes.getptr(p_class); while(type) { @@ -587,11 +590,11 @@ MethodBind *ObjectTypeDB::get_method(StringName p_type, StringName p_name) { } -void ObjectTypeDB::bind_integer_constant(const StringName& p_type, const StringName &p_name, int p_constant) { +void ClassDB::bind_integer_constant(const StringName& p_class, const StringName &p_name, int p_constant) { - OBJTYPE_LOCK; + OBJTYPE_WLOCK; - TypeInfo *type=types.getptr(p_type); + ClassInfo *type=classes.getptr(p_class); if (!type) { ERR_FAIL_COND(!type); @@ -609,11 +612,11 @@ void ObjectTypeDB::bind_integer_constant(const StringName& p_type, const StringN } -void ObjectTypeDB::get_integer_constant_list(const StringName& p_type, List<String> *p_constants, bool p_no_inheritance) { +void ClassDB::get_integer_constant_list(const StringName& p_class, List<String> *p_constants, bool p_no_inheritance) { - OBJTYPE_LOCK; + OBJTYPE_RLOCK; - TypeInfo *type=types.getptr(p_type); + ClassInfo *type=classes.getptr(p_class); while(type) { @@ -637,12 +640,12 @@ void ObjectTypeDB::get_integer_constant_list(const StringName& p_type, List<Stri } -int ObjectTypeDB::get_integer_constant(const StringName& p_type, const StringName &p_name, bool *p_success) { +int ClassDB::get_integer_constant(const StringName& p_class, const StringName &p_name, bool *p_success) { - OBJTYPE_LOCK; + OBJTYPE_RLOCK; - TypeInfo *type=types.getptr(p_type); + ClassInfo *type=classes.getptr(p_class); while(type) { @@ -664,18 +667,20 @@ int ObjectTypeDB::get_integer_constant(const StringName& p_type, const StringNam return 0; } -void ObjectTypeDB::add_signal(StringName p_type,const MethodInfo& p_signal) { +void ClassDB::add_signal(StringName p_class,const MethodInfo& p_signal) { - TypeInfo *type=types.getptr(p_type); + OBJTYPE_WLOCK; + + ClassInfo *type=classes.getptr(p_class); ERR_FAIL_COND(!type); - TypeInfo *check=type; + ClassInfo *check=type; StringName sname = p_signal.name; #ifdef DEBUG_METHODS_ENABLED while(check) { if (check->signal_map.has(sname)) { - ERR_EXPLAIN("Type "+String(p_type)+" already has signal: "+String(sname)); + ERR_EXPLAIN("Type "+String(p_class)+" already has signal: "+String(sname)); ERR_FAIL(); } check=check->inherits_ptr; @@ -686,12 +691,14 @@ void ObjectTypeDB::add_signal(StringName p_type,const MethodInfo& p_signal) { } -void ObjectTypeDB::get_signal_list(StringName p_type,List<MethodInfo> *p_signals,bool p_no_inheritance) { +void ClassDB::get_signal_list(StringName p_class,List<MethodInfo> *p_signals,bool p_no_inheritance) { + + OBJTYPE_RLOCK; - TypeInfo *type=types.getptr(p_type); + ClassInfo *type=classes.getptr(p_class); ERR_FAIL_COND(!type); - TypeInfo *check=type; + ClassInfo *check=type; while(check) { @@ -710,10 +717,11 @@ void ObjectTypeDB::get_signal_list(StringName p_type,List<MethodInfo> *p_signals } -bool ObjectTypeDB::has_signal(StringName p_type,StringName p_signal) { +bool ClassDB::has_signal(StringName p_class,StringName p_signal) { - TypeInfo *type=types.getptr(p_type); - TypeInfo *check=type; + OBJTYPE_RLOCK; + ClassInfo *type=classes.getptr(p_class); + ClassInfo *check=type; while(check) { if (check->signal_map.has(p_signal)) return true; @@ -723,10 +731,11 @@ bool ObjectTypeDB::has_signal(StringName p_type,StringName p_signal) { return false; } -bool ObjectTypeDB::get_signal(StringName p_type,StringName p_signal,MethodInfo *r_signal) { +bool ClassDB::get_signal(StringName p_class,StringName p_signal,MethodInfo *r_signal) { - TypeInfo *type=types.getptr(p_type); - TypeInfo *check=type; + OBJTYPE_RLOCK; + ClassInfo *type=classes.getptr(p_class); + ClassInfo *check=type; while(check) { if (check->signal_map.has(p_signal)) { if (r_signal) { @@ -740,23 +749,39 @@ bool ObjectTypeDB::get_signal(StringName p_type,StringName p_signal,MethodInfo * return false; } -void ObjectTypeDB::add_property(StringName p_type,const PropertyInfo& p_pinfo, const StringName& p_setter, const StringName& p_getter, int p_index) { +void ClassDB::add_property_group(StringName p_class,const String& p_name,const String& p_prefix) { + + OBJTYPE_WLOCK; + ClassInfo *type=classes.getptr(p_class); + ERR_FAIL_COND(!type); + + type->property_list.push_back(PropertyInfo(Variant::NIL,p_name,PROPERTY_HINT_NONE,p_prefix,PROPERTY_USAGE_GROUP)); +} + +void ClassDB::add_property(StringName p_class,const PropertyInfo& p_pinfo, const StringName& p_setter, const StringName& p_getter, int p_index) { + + + + lock->read_lock(); + + ClassInfo *type=classes.getptr(p_class); + + lock->read_unlock(); - TypeInfo *type=types.getptr(p_type); ERR_FAIL_COND(!type); MethodBind *mb_set=NULL; if (p_setter) { - mb_set = get_method(p_type,p_setter); + mb_set = get_method(p_class,p_setter); #ifdef DEBUG_METHODS_ENABLED if (!mb_set) { - ERR_EXPLAIN("Invalid Setter: "+p_type+"::"+p_setter+" for property: "+p_pinfo.name); + ERR_EXPLAIN("Invalid Setter: "+p_class+"::"+p_setter+" for property: "+p_pinfo.name); ERR_FAIL_COND(!mb_set); } else { int exp_args=1+(p_index>=0?1:0); if (mb_set->get_argument_count()!=exp_args) { - ERR_EXPLAIN("Invalid Function for Setter: "+p_type+"::"+p_setter+" for property: "+p_pinfo.name); + ERR_EXPLAIN("Invalid Function for Setter: "+p_class+"::"+p_setter+" for property: "+p_pinfo.name); ERR_FAIL(); } @@ -767,17 +792,17 @@ void ObjectTypeDB::add_property(StringName p_type,const PropertyInfo& p_pinfo, c MethodBind *mb_get=NULL; if (p_getter) { - MethodBind *mb_get = get_method(p_type,p_getter); + MethodBind *mb_get = get_method(p_class,p_getter); #ifdef DEBUG_METHODS_ENABLED if (!mb_get) { - ERR_EXPLAIN("Invalid Getter: "+p_type+"::"+p_getter+" for property: "+p_pinfo.name); + ERR_EXPLAIN("Invalid Getter: "+p_class+"::"+p_getter+" for property: "+p_pinfo.name); ERR_FAIL_COND(!mb_get); } else { int exp_args=0+(p_index>=0?1:0); if (mb_get->get_argument_count()!=exp_args) { - ERR_EXPLAIN("Invalid Function for Getter: "+p_type+"::"+p_getter+" for property: "+p_pinfo.name); + ERR_EXPLAIN("Invalid Function for Getter: "+p_class+"::"+p_getter+" for property: "+p_pinfo.name); ERR_FAIL(); } @@ -791,10 +816,13 @@ void ObjectTypeDB::add_property(StringName p_type,const PropertyInfo& p_pinfo, c #ifdef DEBUG_METHODS_ENABLED if (type->property_setget.has(p_pinfo.name)) { - ERR_EXPLAIN("Object already has property: "+p_type); + ERR_EXPLAIN("Object already has property: "+p_class); ERR_FAIL(); } #endif + + OBJTYPE_WLOCK + type->property_list.push_back(p_pinfo); PropertySetGet psg; @@ -810,10 +838,12 @@ void ObjectTypeDB::add_property(StringName p_type,const PropertyInfo& p_pinfo, c } -void ObjectTypeDB::get_property_list(StringName p_type, List<PropertyInfo> *p_list, bool p_no_inheritance,const Object *p_validator) { +void ClassDB::get_property_list(StringName p_class, List<PropertyInfo> *p_list, bool p_no_inheritance,const Object *p_validator) { + + OBJTYPE_RLOCK; - TypeInfo *type=types.getptr(p_type); - TypeInfo *check=type; + ClassInfo *type=classes.getptr(p_class); + ClassInfo *check=type; while(check) { for(List<PropertyInfo>::Element *E=check->property_list.front();E;E=E->next()) { @@ -834,11 +864,12 @@ void ObjectTypeDB::get_property_list(StringName p_type, List<PropertyInfo> *p_li } } -bool ObjectTypeDB::set_property(Object* p_object,const StringName& p_property, const Variant& p_value,bool *r_valid) { +bool ClassDB::set_property(Object* p_object,const StringName& p_property, const Variant& p_value,bool *r_valid) { - TypeInfo *type=types.getptr(p_object->get_type_name()); - TypeInfo *check=type; + + ClassInfo *type=classes.getptr(p_object->get_class_name()); + ClassInfo *check=type; while(check) { const PropertySetGet *psg = check->property_setget.getptr(p_property); if (psg) { @@ -882,10 +913,10 @@ bool ObjectTypeDB::set_property(Object* p_object,const StringName& p_property, c return false; } -bool ObjectTypeDB::get_property(Object* p_object,const StringName& p_property, Variant& r_value) { +bool ClassDB::get_property(Object* p_object,const StringName& p_property, Variant& r_value) { - TypeInfo *type=types.getptr(p_object->get_type_name()); - TypeInfo *check=type; + ClassInfo *type=classes.getptr(p_object->get_class_name()); + ClassInfo *check=type; while(check) { const PropertySetGet *psg = check->property_setget.getptr(p_property); if (psg) { @@ -925,10 +956,10 @@ bool ObjectTypeDB::get_property(Object* p_object,const StringName& p_property, V return false; } -Variant::Type ObjectTypeDB::get_property_type(const StringName& p_type, const StringName& p_property,bool *r_is_valid) { +Variant::Type ClassDB::get_property_type(const StringName& p_class, const StringName& p_property,bool *r_is_valid) { - TypeInfo *type=types.getptr(p_type); - TypeInfo *check=type; + ClassInfo *type=classes.getptr(p_class); + ClassInfo *check=type; while(check) { const PropertySetGet *psg = check->property_setget.getptr(p_property); if (psg) { @@ -948,11 +979,62 @@ Variant::Type ObjectTypeDB::get_property_type(const StringName& p_type, const St } +StringName ClassDB::get_property_setter(StringName p_class,const StringName p_property) { + + ClassInfo *type=classes.getptr(p_class); + ClassInfo *check=type; + while(check) { + const PropertySetGet *psg = check->property_setget.getptr(p_property); + if (psg) { + + return psg->setter; + } + + check=check->inherits_ptr; + } + + return StringName(); +} + +StringName ClassDB::get_property_getter(StringName p_class,const StringName p_property) { + + ClassInfo *type=classes.getptr(p_class); + ClassInfo *check=type; + while(check) { + const PropertySetGet *psg = check->property_setget.getptr(p_property); + if (psg) { -void ObjectTypeDB::set_method_flags(StringName p_type,StringName p_method,int p_flags) { + return psg->getter; + } - TypeInfo *type=types.getptr(p_type); - TypeInfo *check=type; + check=check->inherits_ptr; + } + + return StringName(); +} + +bool ClassDB::has_property(const StringName& p_class, const StringName& p_property, bool p_no_inheritance) { + + + ClassInfo *type=classes.getptr(p_class); + ClassInfo *check=type; + while(check) { + if (check->property_setget.has(p_property)) + return true; + + if (p_no_inheritance) + break; + check=check->inherits_ptr; + } + + return false; +} + +void ClassDB::set_method_flags(StringName p_class,StringName p_method,int p_flags) { + + OBJTYPE_WLOCK; + ClassInfo *type=classes.getptr(p_class); + ClassInfo *check=type; ERR_FAIL_COND(!check); ERR_FAIL_COND(!check->method_map.has(p_method)); check->method_map[p_method]->set_hint_flags(p_flags); @@ -960,10 +1042,10 @@ void ObjectTypeDB::set_method_flags(StringName p_type,StringName p_method,int p_ } -bool ObjectTypeDB::has_method(StringName p_type,StringName p_method,bool p_no_inheritance) { +bool ClassDB::has_method(StringName p_class,StringName p_method,bool p_no_inheritance) { - TypeInfo *type=types.getptr(p_type); - TypeInfo *check=type; + ClassInfo *type=classes.getptr(p_class); + ClassInfo *check=type; while(check) { if (check->method_map.has(p_method)) return true; @@ -976,10 +1058,10 @@ bool ObjectTypeDB::has_method(StringName p_type,StringName p_method,bool p_no_in } -bool ObjectTypeDB::get_setter_and_type_for_property(const StringName& p_class, const StringName& p_prop, StringName& r_class, StringName& r_setter) { +bool ClassDB::get_setter_and_type_for_property(const StringName& p_class, const StringName& p_prop, StringName& r_class, StringName& r_setter) { - TypeInfo *type=types.getptr(p_class); - TypeInfo *check=type; + ClassInfo *type=classes.getptr(p_class); + ClassInfo *check=type; while(check) { if (check->property_setget.has(p_prop)) { @@ -996,10 +1078,10 @@ bool ObjectTypeDB::get_setter_and_type_for_property(const StringName& p_class, c } #ifdef DEBUG_METHODS_ENABLED -MethodBind* ObjectTypeDB::bind_methodfi(uint32_t p_flags, MethodBind *p_bind , const MethodDefinition &method_name, const Variant **p_defs, int p_defcount) { +MethodBind* ClassDB::bind_methodfi(uint32_t p_flags, MethodBind *p_bind , const MethodDefinition &method_name, const Variant **p_defs, int p_defcount) { StringName mdname=method_name.name; #else -MethodBind* ObjectTypeDB::bind_methodfi(uint32_t p_flags, MethodBind *p_bind , const char *method_name, const Variant **p_defs, int p_defcount) { +MethodBind* ClassDB::bind_methodfi(uint32_t p_flags, MethodBind *p_bind , const char *method_name, const Variant **p_defs, int p_defcount) { StringName mdname=StaticCString::create(method_name); #endif @@ -1011,13 +1093,13 @@ MethodBind* ObjectTypeDB::bind_methodfi(uint32_t p_flags, MethodBind *p_bind , c } - OBJTYPE_LOCK; + OBJTYPE_WLOCK; ERR_FAIL_COND_V(!p_bind,NULL); p_bind->set_name(mdname); - String instance_type=p_bind->get_instance_type(); + String instance_type=p_bind->get_instance_class(); - TypeInfo *type=types.getptr(instance_type); + ClassInfo *type=classes.getptr(instance_type); if (!type) { ERR_PRINTS("Couldn't bind method '"+mdname+"' for instance: "+instance_type); memdelete(p_bind); @@ -1052,27 +1134,29 @@ MethodBind* ObjectTypeDB::bind_methodfi(uint32_t p_flags, MethodBind *p_bind , c } -void ObjectTypeDB::add_virtual_method(const StringName& p_type, const MethodInfo& p_method , bool p_virtual) { - ERR_FAIL_COND(!types.has(p_type)); +void ClassDB::add_virtual_method(const StringName& p_class, const MethodInfo& p_method , bool p_virtual) { + ERR_FAIL_COND(!classes.has(p_class)); + + OBJTYPE_WLOCK; #ifdef DEBUG_METHODS_ENABLED MethodInfo mi=p_method; if (p_virtual) mi.flags|=METHOD_FLAG_VIRTUAL; - types[p_type].virtual_methods.push_back(mi); + classes[p_class].virtual_methods.push_back(mi); #endif } -void ObjectTypeDB::get_virtual_methods(const StringName& p_type, List<MethodInfo> * p_methods , bool p_no_inheritance) { +void ClassDB::get_virtual_methods(const StringName& p_class, List<MethodInfo> * p_methods , bool p_no_inheritance) { - ERR_FAIL_COND(!types.has(p_type)); + ERR_FAIL_COND(!classes.has(p_class)); #ifdef DEBUG_METHODS_ENABLED - TypeInfo *type=types.getptr(p_type); - TypeInfo *check=type; + ClassInfo *type=classes.getptr(p_class); + ClassInfo *check=type; while(check) { for(List<MethodInfo>::Element *E=check->virtual_methods.front();E;E=E->next()) { @@ -1088,18 +1172,22 @@ void ObjectTypeDB::get_virtual_methods(const StringName& p_type, List<MethodInfo } -void ObjectTypeDB::set_type_enabled(StringName p_type,bool p_enable) { +void ClassDB::set_class_enabled(StringName p_class,bool p_enable) { - ERR_FAIL_COND(!types.has(p_type)); - types[p_type].disabled=!p_enable; + OBJTYPE_WLOCK; + + ERR_FAIL_COND(!classes.has(p_class)); + classes[p_class].disabled=!p_enable; } -bool ObjectTypeDB::is_type_enabled(StringName p_type) { +bool ClassDB::is_class_enabled(StringName p_class) { + + OBJTYPE_RLOCK; - TypeInfo *ti=types.getptr(p_type); + ClassInfo *ti=classes.getptr(p_class); if (!ti || !ti->creation_func) { - if (compat_types.has(p_type)) { - ti=types.getptr(compat_types[p_type]); + if (compat_classes.has(p_class)) { + ti=classes.getptr(compat_classes[p_class]); } } @@ -1107,25 +1195,25 @@ bool ObjectTypeDB::is_type_enabled(StringName p_type) { return !ti->disabled; } -StringName ObjectTypeDB::get_category(const StringName& p_node) { +StringName ClassDB::get_category(const StringName& p_node) { - ERR_FAIL_COND_V(!types.has(p_node),StringName()); + ERR_FAIL_COND_V(!classes.has(p_node),StringName()); #ifdef DEBUG_ENABLED - return types[p_node].category; + return classes[p_node].category; #else return StringName(); #endif } -void ObjectTypeDB::add_resource_base_extension(const StringName& p_extension,const StringName& p_type) { +void ClassDB::add_resource_base_extension(const StringName& p_extension,const StringName& p_class) { if (resource_base_extensions.has(p_extension)) return; - resource_base_extensions[p_extension]=p_type; + resource_base_extensions[p_extension]=p_class; } -void ObjectTypeDB::get_resource_base_extensions(List<String> *p_extensions) { +void ClassDB::get_resource_base_extensions(List<String> *p_extensions) { const StringName *K=NULL; @@ -1135,43 +1223,39 @@ void ObjectTypeDB::get_resource_base_extensions(List<String> *p_extensions) { } } -void ObjectTypeDB::get_extensions_for_type(const StringName& p_type,List<String> *p_extensions) { +void ClassDB::get_extensions_for_type(const StringName& p_class,List<String> *p_extensions) { const StringName *K=NULL; while((K=resource_base_extensions.next(K))) { StringName cmp = resource_base_extensions[*K]; - if (is_type(cmp,p_type)) + if (is_parent_class(cmp,p_class)) p_extensions->push_back(*K); } } -Mutex *ObjectTypeDB::lock=NULL; +RWLock *ClassDB::lock=NULL; -void ObjectTypeDB::init() { +void ClassDB::init() { #ifndef NO_THREADS - lock = Mutex::create(); + lock = RWLock::create(); #endif } -void ObjectTypeDB::cleanup() { +void ClassDB::cleanup() { -#ifndef NO_THREADS - - memdelete(lock); -#endif //OBJTYPE_LOCK; hah not here const StringName *k=NULL; - while((k=types.next(k))) { + while((k=classes.next(k))) { - TypeInfo &ti=types[*k]; + ClassInfo &ti=classes[*k]; const StringName *m=NULL; while((m=ti.method_map.next(m))) { @@ -1179,9 +1263,15 @@ void ObjectTypeDB::cleanup() { memdelete( ti.method_map[*m] ); } } - types.clear(); + classes.clear(); resource_base_extensions.clear(); - compat_types.clear(); + compat_classes.clear(); + +#ifndef NO_THREADS + + memdelete(lock); +#endif + } // diff --git a/core/object_type_db.h b/core/object_type_db.h index 9e9029ff2f..158a4dae23 100644 --- a/core/object_type_db.h +++ b/core/object_type_db.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -108,7 +108,7 @@ static _FORCE_INLINE_ const char* _MD(const char* m_name, ...) { return m_name; #endif -class ObjectTypeDB { +class ClassDB { public: enum APIType { API_CORE, @@ -126,10 +126,10 @@ public: Variant::Type type; }; - struct TypeInfo { + struct ClassInfo { APIType api; - TypeInfo *inherits_ptr; + ClassInfo *inherits_ptr; HashMap<StringName,MethodBind*,StringNameHasher> method_map; HashMap<StringName,int,StringNameHasher> constant_map; HashMap<StringName,MethodInfo,StringNameHasher> signal_map; @@ -147,8 +147,8 @@ public: StringName name; bool disabled; Object* (*creation_func)(); - TypeInfo(); - ~TypeInfo(); + ClassInfo(); + ~ClassInfo(); }; template<class T> @@ -156,10 +156,10 @@ public: return memnew( T ); } - static Mutex *lock; - static HashMap<StringName,TypeInfo,StringNameHasher> types; + static RWLock *lock; + static HashMap<StringName,ClassInfo,StringNameHasher> classes; static HashMap<StringName,StringName,StringNameHasher> resource_base_extensions; - static HashMap<StringName,StringName,StringNameHasher> compat_types; + static HashMap<StringName,StringName,StringNameHasher> compat_classes; #ifdef DEBUG_METHODS_ENABLED static MethodBind* bind_methodfi(uint32_t p_flags, MethodBind *p_bind , const MethodDefinition &method_name, const Variant **p_defs, int p_defcount); @@ -170,25 +170,25 @@ public: static APIType current_api; - static void _add_type2(const StringName& p_type, const StringName& p_inherits); + static void _add_class2(const StringName& p_class, const StringName& p_inherits); public: // DO NOT USE THIS!!!!!! NEEDS TO BE PUBLIC BUT DO NOT USE NO MATTER WHAT!!! template<class T> - static void _add_type() { + static void _add_class() { - _add_type2(T::get_type_static(),T::get_parent_type_static()); + _add_class2(T::get_class_static(),T::get_parent_class_static()); #if 0 GLOBAL_LOCK_FUNCTION; - StringName name = T::get_type_static(); + StringName name = T::get_class_static(); ERR_FAIL_COND(types.has(name)); types[name]=TypeInfo(); TypeInfo &ti=types[name]; ti.name=name; - ti.inherits=T::get_parent_type_static(); + ti.inherits=T::get_parent_class_static(); if (ti.inherits) { @@ -202,21 +202,21 @@ public: } template<class T> - static void register_type() { + static void register_class() { GLOBAL_LOCK_FUNCTION; - T::initialize_type(); - TypeInfo *t=types.getptr(T::get_type_static()); + T::initialize_class(); + ClassInfo *t=classes.getptr(T::get_class_static()); ERR_FAIL_COND(!t); t->creation_func=&creator<T>; T::register_custom_data_to_otdb(); } template<class T> - static void register_virtual_type() { + static void register_virtual_class() { GLOBAL_LOCK_FUNCTION; - T::initialize_type(); + T::initialize_class(); //nothing } @@ -227,24 +227,24 @@ public: } template<class T> - static void register_create_type() { + static void register_custom_instance_class() { GLOBAL_LOCK_FUNCTION; - T::initialize_type(); - TypeInfo *t=types.getptr(T::get_type_static()); + T::initialize_class(); + ClassInfo *t=classes.getptr(T::get_class_static()); ERR_FAIL_COND(!t); t->creation_func=&_create_ptr_func<T>; T::register_custom_data_to_otdb(); } - static void get_type_list( List<StringName> *p_types); - static void get_inheriters_from( const StringName& p_type,List<StringName> *p_types); - static StringName type_inherits_from(const StringName& p_type); - static bool type_exists(const StringName &p_type); - static bool is_type(const StringName &p_type,const StringName& p_inherits); - static bool can_instance(const StringName &p_type); - static Object *instance(const StringName &p_type); - static APIType get_api_type(const StringName &p_type); + static void get_class_list( List<StringName> *p_classes); + static void get_inheriters_from_class( const StringName& p_class,List<StringName> *p_classes); + static StringName get_parent_class(const StringName& p_class); + static bool class_exists(const StringName &p_class); + static bool is_parent_class(const StringName &p_class,const StringName& p_inherits); + static bool can_instance(const StringName &p_class); + static Object *instance(const StringName &p_class); + static APIType get_api_type(const StringName &p_class); static uint64_t get_api_hash(APIType p_api); @@ -444,9 +444,9 @@ public: bind->set_name(p_name); bind->set_default_arguments(p_default_args); - String instance_type=bind->get_instance_type(); + String instance_type=bind->get_instance_class(); - TypeInfo *type=types.getptr(instance_type); + ClassInfo *type=classes.getptr(instance_type); if (!type) { memdelete(bind); ERR_FAIL_COND_V(!type,NULL); @@ -471,44 +471,48 @@ public: } - static void add_signal(StringName p_type,const MethodInfo& p_signal); - static bool has_signal(StringName p_type,StringName p_signal); - static bool get_signal(StringName p_type,StringName p_signal,MethodInfo *r_signal); - static void get_signal_list(StringName p_type,List<MethodInfo> *p_signals,bool p_no_inheritance=false); + static void add_signal(StringName p_class,const MethodInfo& p_signal); + static bool has_signal(StringName p_class,StringName p_signal); + static bool get_signal(StringName p_class,StringName p_signal,MethodInfo *r_signal); + static void get_signal_list(StringName p_class,List<MethodInfo> *p_signals,bool p_no_inheritance=false); - static void add_property(StringName p_type,const PropertyInfo& p_pinfo, const StringName& p_setter, const StringName& p_getter, int p_index=-1); - static void get_property_list(StringName p_type, List<PropertyInfo> *p_list, bool p_no_inheritance=false, const Object *p_validator=NULL); + static void add_property_group(StringName p_class,const String& p_name,const String& p_prefix=""); + static void add_property(StringName p_class,const PropertyInfo& p_pinfo, const StringName& p_setter, const StringName& p_getter, int p_index=-1); + static void get_property_list(StringName p_class, List<PropertyInfo> *p_list, bool p_no_inheritance=false, const Object *p_validator=NULL); static bool set_property(Object* p_object, const StringName& p_property, const Variant& p_value, bool *r_valid=NULL); static bool get_property(Object* p_object,const StringName& p_property, Variant& r_value); - static Variant::Type get_property_type(const StringName& p_type, const StringName& p_property,bool *r_is_valid=NULL); + static bool has_property(const StringName& p_class,const StringName& p_property,bool p_no_inheritance=false); + static Variant::Type get_property_type(const StringName& p_class, const StringName& p_property,bool *r_is_valid=NULL); + static StringName get_property_setter(StringName p_class,const StringName p_property); + static StringName get_property_getter(StringName p_class,const StringName p_property); - static bool has_method(StringName p_type,StringName p_method,bool p_no_inheritance=false); - static void set_method_flags(StringName p_type,StringName p_method,int p_flags); + static bool has_method(StringName p_class,StringName p_method,bool p_no_inheritance=false); + static void set_method_flags(StringName p_class,StringName p_method,int p_flags); - static void get_method_list(StringName p_type,List<MethodInfo> *p_methods,bool p_no_inheritance=false); - static MethodBind *get_method(StringName p_type, StringName p_name); + static void get_method_list(StringName p_class,List<MethodInfo> *p_methods,bool p_no_inheritance=false); + static MethodBind *get_method(StringName p_class, StringName p_name); - static void add_virtual_method(const StringName& p_type,const MethodInfo& p_method,bool p_virtual=true ); - static void get_virtual_methods(const StringName& p_type,List<MethodInfo> * p_methods,bool p_no_inheritance=false ); + static void add_virtual_method(const StringName& p_class,const MethodInfo& p_method,bool p_virtual=true ); + static void get_virtual_methods(const StringName& p_class,List<MethodInfo> * p_methods,bool p_no_inheritance=false ); - static void bind_integer_constant(const StringName& p_type, const StringName &p_name, int p_constant); - static void get_integer_constant_list(const StringName& p_type, List<String> *p_constants, bool p_no_inheritance=false); - static int get_integer_constant(const StringName& p_type, const StringName &p_name, bool *p_success=NULL); + static void bind_integer_constant(const StringName& p_class, const StringName &p_name, int p_constant); + static void get_integer_constant_list(const StringName& p_class, List<String> *p_constants, bool p_no_inheritance=false); + static int get_integer_constant(const StringName& p_class, const StringName &p_name, bool *p_success=NULL); static StringName get_category(const StringName& p_node); static bool get_setter_and_type_for_property(const StringName& p_class, const StringName& p_prop, StringName& r_class, StringName& r_setter); - static void set_type_enabled(StringName p_type,bool p_enable); - static bool is_type_enabled(StringName p_type); + static void set_class_enabled(StringName p_class,bool p_enable); + static bool is_class_enabled(StringName p_class); - static void add_resource_base_extension(const StringName& p_extension,const StringName& p_type); + static void add_resource_base_extension(const StringName& p_extension,const StringName& p_class); static void get_resource_base_extensions(List<String> *p_extensions); - static void get_extensions_for_type(const StringName& p_type,List<String> *p_extensions); + static void get_extensions_for_type(const StringName& p_class,List<String> *p_extensions); - static void add_compatibility_type(const StringName& p_type,const StringName& p_fallback); + static void add_compatibility_class(const StringName& p_class,const StringName& p_fallback); static void init(); static void set_current_api(APIType p_api); @@ -517,12 +521,12 @@ public: #define BIND_CONSTANT(m_constant)\ - ObjectTypeDB::bind_integer_constant( get_type_static() , #m_constant, m_constant); + ClassDB::bind_integer_constant( get_class_static() , #m_constant, m_constant); #ifdef TOOLS_ENABLED #define BIND_VMETHOD(m_method)\ - ObjectTypeDB::add_virtual_method( get_type_static() , m_method ); + ClassDB::add_virtual_method( get_class_static() , m_method ); #else diff --git a/core/os/copymem.cpp b/core/os/copymem.cpp deleted file mode 100644 index 49f53f1a51..0000000000 --- a/core/os/copymem.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/*************************************************************************/ -/* copymem.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "copymem.h" - -#include <string.h> - -void movemem_system(void *to, void *from,int amount) { - - memmove(to,from,amount); - -} - -void zeromem(void* p_mem,size_t p_bytes) { - - memset(p_mem,0,p_bytes); -} diff --git a/core/os/copymem.h b/core/os/copymem.h index d7fc46aae4..0452b1a36c 100644 --- a/core/os/copymem.h +++ b/core/os/copymem.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,89 +31,18 @@ #include "typedefs.h" -///@TODO use optimized routines for this, depending on platform. these are just the standard ones +#ifdef PLATFORM_COPYMEM -#define copymem(m_to,m_from,m_count) \ - do { \ - unsigned char * _from=(unsigned char*)m_from; \ - unsigned char * _to=(unsigned char*)m_to; \ - int _count=m_count; \ - for (int _i=0;_i<_count;_i++) \ - _to[_i]=_from[_i]; \ - } while (0); - /* - case 0: *_dto++ = *_dfrom++; \ - case 7: *_dto++ = *_dfrom++; \ - case 6: *_dto++ = *_dfrom++; \ - case 5: *_dto++ = *_dfrom++; \ - case 4: *_dto++ = *_dfrom++; \ - case 3: *_dto++ = *_dfrom++; \ - case 2: *_dto++ = *_dfrom++; \ - case 1: *_dto++ = *_dfrom++; \ - */ -#define movemem_duff(m_to, m_from, m_count) \ - do { \ - if (m_to<m_from) { \ - unsigned char* _dto = (unsigned char*)m_to; \ - unsigned char* _dfrom = (unsigned char*)m_from; \ - int n = (m_count + 7) / 8; \ - switch (m_count % 8) { \ - do { \ - case 0: *_dto++ = *_dfrom++; \ - case 7: *_dto++ = *_dfrom++; \ - case 6: *_dto++ = *_dfrom++; \ - case 5: *_dto++ = *_dfrom++; \ - case 4: *_dto++ = *_dfrom++; \ - case 3: *_dto++ = *_dfrom++; \ - case 2: *_dto++ = *_dfrom++; \ - case 1: *_dto++ = *_dfrom++; \ - } while (--n > 0); \ - }; \ - } else if (m_to>m_from) { \ - unsigned char* _dto = &((unsigned char*)m_to)[m_count-1]; \ - unsigned char* _dfrom = &((unsigned char*)m_from)[m_count-1]; \ - int n = (m_count + 7) / 8; \ - switch (m_count % 8) { \ - do { \ - case 0: *_dto-- = *_dfrom--; \ - case 7: *_dto-- = *_dfrom--; \ - case 6: *_dto-- = *_dfrom--; \ - case 5: *_dto-- = *_dfrom--; \ - case 4: *_dto-- = *_dfrom--; \ - case 3: *_dto-- = *_dfrom--; \ - case 2: *_dto-- = *_dfrom--; \ - case 1: *_dto-- = *_dfrom--; \ - } while (--n > 0); \ - }; \ - } \ - } while(0) \ +#include "platform_copymem.h" // included from platform/<current_platform>/platform_copymem.h" -#define movemem_conventional(m_to,m_from,m_count) \ - do { \ - if (m_to<m_from) { \ - unsigned char * _from=(unsigned char*)m_from; \ - unsigned char * _to=(unsigned char*)m_to; \ - int _count=m_count; \ - for (int _i=0;_i<_count;_i++) \ - _to[_i]=_from[_i]; \ - \ - } else if (m_to>m_from) { \ - unsigned char * _from=(unsigned char*)m_from; \ - unsigned char * _to=(unsigned char*)m_to; \ - int _count=m_count; \ - while (_count--) \ - _to[_count]=_from[_count]; \ - \ - \ - } \ - } while (0); \ +#else -void movemem_system(void*,void*,int); +#include <string.h> -#define movemem movemem_system - - -void zeromem(void* p_mem,size_t p_bytes); +#define copymem(to,from,count) memcpy(to,from,count) +#define zeromem(to, count) memset(to, 0, count) +#define movemem(to, from, count) memmove(to, from, count) #endif +#endif diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp index c2402183fd..804fe15c39 100644 --- a/core/os/dir_access.cpp +++ b/core/os/dir_access.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ String DirAccess::_get_root_path() const { switch(_access_type) { - case ACCESS_RESOURCES: return Globals::get_singleton()->get_resource_path(); + case ACCESS_RESOURCES: return GlobalConfig::get_singleton()->get_resource_path(); case ACCESS_USERDATA: return OS::get_singleton()->get_data_dir(); default: return ""; } @@ -204,10 +204,10 @@ String DirAccess::fix_path(String p_path) const { case ACCESS_RESOURCES: { - if (Globals::get_singleton()) { + if (GlobalConfig::get_singleton()) { if (p_path.begins_with("res://")) { - String resource_path = Globals::get_singleton()->get_resource_path(); + String resource_path = GlobalConfig::get_singleton()->get_resource_path(); if (resource_path != "") { return p_path.replace_first("res:/",resource_path); diff --git a/core/os/dir_access.h b/core/os/dir_access.h index 83288b7c91..f824b5f319 100644 --- a/core/os/dir_access.h +++ b/core/os/dir_access.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/file_access.cpp b/core/os/file_access.cpp index 2f1693c044..06723c5131 100644 --- a/core/os/file_access.cpp +++ b/core/os/file_access.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -139,10 +139,10 @@ String FileAccess::fix_path(const String& p_path) const { case ACCESS_RESOURCES: { - if (Globals::get_singleton()) { + if (GlobalConfig::get_singleton()) { if (r_path.begins_with("res://")) { - String resource_path = Globals::get_singleton()->get_resource_path(); + String resource_path = GlobalConfig::get_singleton()->get_resource_path(); if (resource_path != "") { return r_path.replace("res:/",resource_path); diff --git a/core/os/file_access.h b/core/os/file_access.h index 5178c469bc..7d61099bc2 100644 --- a/core/os/file_access.h +++ b/core/os/file_access.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/input.cpp b/core/os/input.cpp index 4ab57a84ea..d2bd433ed9 100644 --- a/core/os/input.cpp +++ b/core/os/input.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -49,39 +49,39 @@ Input::MouseMode Input::get_mouse_mode() const { void Input::_bind_methods() { - ObjectTypeDB::bind_method(_MD("is_key_pressed","scancode"),&Input::is_key_pressed); - ObjectTypeDB::bind_method(_MD("is_mouse_button_pressed","button"),&Input::is_mouse_button_pressed); - ObjectTypeDB::bind_method(_MD("is_joy_button_pressed","device","button"),&Input::is_joy_button_pressed); - ObjectTypeDB::bind_method(_MD("is_action_pressed","action"),&Input::is_action_pressed); - ObjectTypeDB::bind_method(_MD("is_action_just_pressed","action"),&Input::is_action_just_pressed); - ObjectTypeDB::bind_method(_MD("is_action_just_released","action"),&Input::is_action_just_released); - ObjectTypeDB::bind_method(_MD("add_joy_mapping","mapping", "update_existing"),&Input::add_joy_mapping, DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("remove_joy_mapping","guid"),&Input::remove_joy_mapping); - ObjectTypeDB::bind_method(_MD("is_joy_known","device"),&Input::is_joy_known); - ObjectTypeDB::bind_method(_MD("get_joy_axis","device","axis"),&Input::get_joy_axis); - ObjectTypeDB::bind_method(_MD("get_joy_name","device"),&Input::get_joy_name); - ObjectTypeDB::bind_method(_MD("get_joy_guid","device"),&Input::get_joy_guid); - ObjectTypeDB::bind_method(_MD("get_connected_joysticks"),&Input::get_connected_joysticks); - ObjectTypeDB::bind_method(_MD("get_joy_vibration_strength", "device"), &Input::get_joy_vibration_strength); - ObjectTypeDB::bind_method(_MD("get_joy_vibration_duration", "device"), &Input::get_joy_vibration_duration); - ObjectTypeDB::bind_method(_MD("get_joy_button_string", "button_index"), &Input::get_joy_button_string); - ObjectTypeDB::bind_method(_MD("get_joy_button_index_from_string", "button"), &Input::get_joy_button_index_from_string); - ObjectTypeDB::bind_method(_MD("get_joy_axis_string", "axis_index"), &Input::get_joy_axis_string); - ObjectTypeDB::bind_method(_MD("get_joy_axis_index_from_string", "axis"), &Input::get_joy_axis_index_from_string); - ObjectTypeDB::bind_method(_MD("start_joy_vibration", "device", "weak_magnitude", "strong_magnitude", "duration"), &Input::start_joy_vibration, DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("stop_joy_vibration", "device"), &Input::stop_joy_vibration); - ObjectTypeDB::bind_method(_MD("get_accelerometer"),&Input::get_accelerometer); - ObjectTypeDB::bind_method(_MD("get_magnetometer"),&Input::get_magnetometer); - ObjectTypeDB::bind_method(_MD("get_gyroscope"),&Input::get_gyroscope); - //ObjectTypeDB::bind_method(_MD("get_mouse_pos"),&Input::get_mouse_pos); - this is not the function you want - ObjectTypeDB::bind_method(_MD("get_mouse_speed"),&Input::get_mouse_speed); - ObjectTypeDB::bind_method(_MD("get_mouse_button_mask"),&Input::get_mouse_button_mask); - ObjectTypeDB::bind_method(_MD("set_mouse_mode","mode"),&Input::set_mouse_mode); - ObjectTypeDB::bind_method(_MD("get_mouse_mode"),&Input::get_mouse_mode); - ObjectTypeDB::bind_method(_MD("warp_mouse_pos","to"),&Input::warp_mouse_pos); - ObjectTypeDB::bind_method(_MD("action_press","action"),&Input::action_press); - ObjectTypeDB::bind_method(_MD("action_release","action"),&Input::action_release); - ObjectTypeDB::bind_method(_MD("set_custom_mouse_cursor","image:Texture","hotspot"),&Input::set_custom_mouse_cursor,DEFVAL(Vector2())); + ClassDB::bind_method(_MD("is_key_pressed","scancode"),&Input::is_key_pressed); + ClassDB::bind_method(_MD("is_mouse_button_pressed","button"),&Input::is_mouse_button_pressed); + ClassDB::bind_method(_MD("is_joy_button_pressed","device","button"),&Input::is_joy_button_pressed); + ClassDB::bind_method(_MD("is_action_pressed","action"),&Input::is_action_pressed); + ClassDB::bind_method(_MD("is_action_just_pressed","action"),&Input::is_action_just_pressed); + ClassDB::bind_method(_MD("is_action_just_released","action"),&Input::is_action_just_released); + ClassDB::bind_method(_MD("add_joy_mapping","mapping", "update_existing"),&Input::add_joy_mapping, DEFVAL(false)); + ClassDB::bind_method(_MD("remove_joy_mapping","guid"),&Input::remove_joy_mapping); + ClassDB::bind_method(_MD("is_joy_known","device"),&Input::is_joy_known); + ClassDB::bind_method(_MD("get_joy_axis","device","axis"),&Input::get_joy_axis); + ClassDB::bind_method(_MD("get_joy_name","device"),&Input::get_joy_name); + ClassDB::bind_method(_MD("get_joy_guid","device"),&Input::get_joy_guid); + ClassDB::bind_method(_MD("get_connected_joypads"),&Input::get_connected_joypads); + ClassDB::bind_method(_MD("get_joy_vibration_strength", "device"), &Input::get_joy_vibration_strength); + ClassDB::bind_method(_MD("get_joy_vibration_duration", "device"), &Input::get_joy_vibration_duration); + ClassDB::bind_method(_MD("get_joy_button_string", "button_index"), &Input::get_joy_button_string); + ClassDB::bind_method(_MD("get_joy_button_index_from_string", "button"), &Input::get_joy_button_index_from_string); + ClassDB::bind_method(_MD("get_joy_axis_string", "axis_index"), &Input::get_joy_axis_string); + ClassDB::bind_method(_MD("get_joy_axis_index_from_string", "axis"), &Input::get_joy_axis_index_from_string); + ClassDB::bind_method(_MD("start_joy_vibration", "device", "weak_magnitude", "strong_magnitude", "duration"), &Input::start_joy_vibration, DEFVAL(0)); + ClassDB::bind_method(_MD("stop_joy_vibration", "device"), &Input::stop_joy_vibration); + ClassDB::bind_method(_MD("get_accelerometer"),&Input::get_accelerometer); + ClassDB::bind_method(_MD("get_magnetometer"),&Input::get_magnetometer); + ClassDB::bind_method(_MD("get_gyroscope"),&Input::get_gyroscope); + //ClassDB::bind_method(_MD("get_mouse_pos"),&Input::get_mouse_pos); - this is not the function you want + ClassDB::bind_method(_MD("get_mouse_speed"),&Input::get_mouse_speed); + ClassDB::bind_method(_MD("get_mouse_button_mask"),&Input::get_mouse_button_mask); + ClassDB::bind_method(_MD("set_mouse_mode","mode"),&Input::set_mouse_mode); + ClassDB::bind_method(_MD("get_mouse_mode"),&Input::get_mouse_mode); + ClassDB::bind_method(_MD("warp_mouse_pos","to"),&Input::warp_mouse_pos); + ClassDB::bind_method(_MD("action_press","action"),&Input::action_press); + ClassDB::bind_method(_MD("action_release","action"),&Input::action_release); + ClassDB::bind_method(_MD("set_custom_mouse_cursor","image:Texture","hotspot"),&Input::set_custom_mouse_cursor,DEFVAL(Vector2())); BIND_CONSTANT( MOUSE_MODE_VISIBLE ); BIND_CONSTANT( MOUSE_MODE_HIDDEN ); @@ -97,7 +97,7 @@ void Input::get_argument_options(const StringName& p_function,int p_idx,List<Str if (p_idx==0 && (pf=="is_action_pressed" || pf=="action_press" || pf=="action_release" || pf=="is_action_just_pressed" || pf=="is_action_just_released")) { List<PropertyInfo> pinfo; - Globals::get_singleton()->get_property_list(&pinfo); + GlobalConfig::get_singleton()->get_property_list(&pinfo); for(List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) { const PropertyInfo &pi=E->get(); diff --git a/core/os/input.h b/core/os/input.h index d8f3be09df..c365894f46 100644 --- a/core/os/input.h +++ b/core/os/input.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class Input : public Object { - OBJ_TYPE( Input, Object ); + GDCLASS( Input, Object ); static Input *singleton; @@ -64,7 +64,7 @@ public: virtual float get_joy_axis(int p_device,int p_axis) const=0; virtual String get_joy_name(int p_idx)=0; - virtual Array get_connected_joysticks()=0; + virtual Array get_connected_joypads()=0; virtual void joy_connection_changed(int p_idx, bool p_connected, String p_name, String p_guid)=0; virtual void add_joy_mapping(String p_mapping, bool p_update_existing=false)=0; virtual void remove_joy_mapping(String p_guid)=0; diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp index 7350be824a..3cc595208f 100644 --- a/core/os/input_event.cpp +++ b/core/os/input_event.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -61,10 +61,10 @@ bool InputEvent::operator==(const InputEvent &p_event) const { && mouse_button.button_index == p_event.mouse_button.button_index && mouse_button.button_mask == p_event.mouse_button.button_mask && key.mod == p_event.key.mod; - case JOYSTICK_MOTION: + case JOYPAD_MOTION: return joy_motion.axis == p_event.joy_motion.axis && joy_motion.axis_value == p_event.joy_motion.axis_value; - case JOYSTICK_BUTTON: + case JOYPAD_BUTTON: return joy_button.pressed == p_event.joy_button.pressed && joy_button.button_index == p_event.joy_button.button_index && joy_button.pressure == p_event.joy_button.pressure; @@ -155,14 +155,14 @@ InputEvent::operator String() const { return str; } break; - case JOYSTICK_MOTION: { - str+= "Event: JoystickMotion "; + case JOYPAD_MOTION: { + str+= "Event: JoypadMotion "; str=str+"Axis: "+itos(joy_motion.axis)+" Value: " +rtos(joy_motion.axis_value); return str; } break; - case JOYSTICK_BUTTON: { - str+= "Event: JoystickButton "; + case JOYPAD_BUTTON: { + str+= "Event: JoypadButton "; str=str+"Pressed: "+itos(joy_button.pressed)+" Index: " +itos(joy_button.button_index)+" pressure "+rtos(joy_button.pressure); return str; @@ -203,9 +203,9 @@ bool InputEvent::is_pressed() const { case KEY: return key.pressed; case MOUSE_BUTTON: return mouse_button.pressed; - case JOYSTICK_BUTTON: return joy_button.pressed; + case JOYPAD_BUTTON: return joy_button.pressed; case SCREEN_TOUCH: return screen_touch.pressed; - case JOYSTICK_MOTION: return ABS(joy_motion.axis_value) > 0.5; + case JOYPAD_MOTION: return ABS(joy_motion.axis_value) > 0.5; case ACTION: return action.pressed; default: {} } @@ -249,7 +249,7 @@ uint32_t InputEventKey::get_scancode_with_modifiers() const { } -InputEvent InputEvent::xform_by(const Matrix32& p_xform) const { +InputEvent InputEvent::xform_by(const Transform2D& p_xform) const { InputEvent ev=*this; diff --git a/core/os/input_event.h b/core/os/input_event.h index 1c4f1dcf96..3947d86285 100644 --- a/core/os/input_event.h +++ b/core/os/input_event.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -225,13 +225,13 @@ struct InputEventMouseMotion : public InputEventMouse { float speed_x,speed_y; }; -struct InputEventJoystickMotion { +struct InputEventJoypadMotion { - int axis; ///< Joystick axis + int axis; ///< Joypad axis float axis_value; ///< -1 to 1 }; -struct InputEventJoystickButton { +struct InputEventJoypadButton { int button_index; bool pressed; @@ -267,8 +267,8 @@ struct InputEvent { KEY, MOUSE_MOTION, MOUSE_BUTTON, - JOYSTICK_MOTION, - JOYSTICK_BUTTON, + JOYPAD_MOTION, + JOYPAD_BUTTON, SCREEN_TOUCH, SCREEN_DRAG, ACTION, @@ -282,8 +282,8 @@ struct InputEvent { union { InputEventMouseMotion mouse_motion; InputEventMouseButton mouse_button; - InputEventJoystickMotion joy_motion; - InputEventJoystickButton joy_button; + InputEventJoypadMotion joy_motion; + InputEventJoypadButton joy_button; InputEventKey key; InputEventScreenTouch screen_touch; InputEventScreenDrag screen_drag; @@ -298,7 +298,7 @@ struct InputEvent { void set_as_action(const String& p_action, bool p_pressed); - InputEvent xform_by(const Matrix32& p_xform) const; + InputEvent xform_by(const Transform2D& p_xform) const; bool operator==(const InputEvent &p_event) const; operator String() const; InputEvent() { zeromem(this,sizeof(InputEvent)); } diff --git a/core/os/keyboard.cpp b/core/os/keyboard.cpp index 9710638234..309348ea31 100644 --- a/core/os/keyboard.cpp +++ b/core/os/keyboard.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/keyboard.h b/core/os/keyboard.h index fd52d331c8..1357cc8b8e 100644 --- a/core/os/keyboard.h +++ b/core/os/keyboard.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/main_loop.cpp b/core/os/main_loop.cpp index e5feebfbfc..11396666d2 100644 --- a/core/os/main_loop.cpp +++ b/core/os/main_loop.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,19 +31,19 @@ void MainLoop::_bind_methods() { - ObjectTypeDB::bind_method(_MD("input_event","ev"),&MainLoop::input_event); - ObjectTypeDB::bind_method(_MD("input_text","text"),&MainLoop::input_text); - ObjectTypeDB::bind_method(_MD("init"),&MainLoop::init); - ObjectTypeDB::bind_method(_MD("iteration","delta"),&MainLoop::iteration); - ObjectTypeDB::bind_method(_MD("idle","delta"),&MainLoop::idle); - ObjectTypeDB::bind_method(_MD("finish"),&MainLoop::finish); + ClassDB::bind_method(_MD("input_event","ev"),&MainLoop::input_event); + ClassDB::bind_method(_MD("input_text","text"),&MainLoop::input_text); + ClassDB::bind_method(_MD("init"),&MainLoop::init); + ClassDB::bind_method(_MD("iteration","delta"),&MainLoop::iteration); + ClassDB::bind_method(_MD("idle","delta"),&MainLoop::idle); + ClassDB::bind_method(_MD("finish"),&MainLoop::finish); BIND_VMETHOD( MethodInfo("_input_event",PropertyInfo(Variant::INPUT_EVENT,"ev")) ); BIND_VMETHOD( MethodInfo("_input_text",PropertyInfo(Variant::STRING,"text")) ); BIND_VMETHOD( MethodInfo("_initialize") ); BIND_VMETHOD( MethodInfo("_iteration",PropertyInfo(Variant::REAL,"delta")) ); BIND_VMETHOD( MethodInfo("_idle",PropertyInfo(Variant::REAL,"delta")) ); - BIND_VMETHOD( MethodInfo("_drop_files",PropertyInfo(Variant::STRING_ARRAY,"files"),PropertyInfo(Variant::INT,"screen")) ); + BIND_VMETHOD( MethodInfo("_drop_files",PropertyInfo(Variant::POOL_STRING_ARRAY,"files"),PropertyInfo(Variant::INT,"screen")) ); BIND_VMETHOD( MethodInfo("_finalize") ); BIND_CONSTANT(NOTIFICATION_WM_MOUSE_ENTER); diff --git a/core/os/main_loop.h b/core/os/main_loop.h index 57185d9d3d..5251061423 100644 --- a/core/os/main_loop.h +++ b/core/os/main_loop.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ */ class MainLoop : public Object { - OBJ_TYPE( MainLoop, Object ); + GDCLASS( MainLoop, Object ); OBJ_CATEGORY("Main Loop"); Ref<Script> init_script; @@ -54,6 +54,7 @@ public: NOTIFICATION_WM_QUIT_REQUEST = 7, NOTIFICATION_WM_UNFOCUS_REQUEST = 8, NOTIFICATION_OS_MEMORY_WARNING = 9, + NOTIFICATION_TRANSLATION_CHANGED = 10, }; virtual void input_event( const InputEvent& p_event ); diff --git a/core/os/memory.cpp b/core/os/memory.cpp index c2ff2aa781..37a523b763 100644 --- a/core/os/memory.cpp +++ b/core/os/memory.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -30,9 +30,13 @@ #include "error_macros.h" #include "copymem.h" #include <stdio.h> +#include <stdlib.h> + + + void * operator new(size_t p_size,const char *p_description) { - return Memory::alloc_static( p_size, p_description ); + return Memory::alloc_static( p_size, false ); } void * operator new(size_t p_size,void* (*p_allocfunc)(size_t p_size)) { @@ -42,74 +46,144 @@ void * operator new(size_t p_size,void* (*p_allocfunc)(size_t p_size)) { #include <stdio.h> -void * Memory::alloc_static(size_t p_bytes,const char *p_alloc_from) { +#ifdef DEBUG_ENABLED +size_t Memory::mem_usage=0; +size_t Memory::max_usage=0; +#endif - ERR_FAIL_COND_V( !MemoryPoolStatic::get_singleton(), NULL ); - return MemoryPoolStatic::get_singleton()->alloc(p_bytes,p_alloc_from); -} -void * Memory::realloc_static(void *p_memory,size_t p_bytes) { +size_t Memory::alloc_count=0; - ERR_FAIL_COND_V( !MemoryPoolStatic::get_singleton(), NULL ); - return MemoryPoolStatic::get_singleton()->realloc(p_memory,p_bytes); -} -void Memory::free_static(void *p_ptr) { +void * Memory::alloc_static(size_t p_bytes,bool p_pad_align) { - ERR_FAIL_COND( !MemoryPoolStatic::get_singleton()); - MemoryPoolStatic::get_singleton()->free(p_ptr); -} +#ifdef DEBUG_ENABLED + bool prepad=true; +#else + bool prepad=p_pad_align; +#endif -size_t Memory::get_static_mem_available() { + void * mem = malloc( p_bytes + (prepad?PAD_ALIGN:0)); - ERR_FAIL_COND_V( !MemoryPoolStatic::get_singleton(), 0); - return MemoryPoolStatic::get_singleton()->get_available_mem(); + alloc_count++; -} + ERR_FAIL_COND_V(!mem,NULL); -size_t Memory::get_static_mem_max_usage() { + if (prepad) { + uint64_t *s = (uint64_t*)mem; + *s=p_bytes; - ERR_FAIL_COND_V( !MemoryPoolStatic::get_singleton(), 0); - return MemoryPoolStatic::get_singleton()->get_max_usage(); + uint8_t *s8 = (uint8_t*)mem; + +#ifdef DEBUG_ENABLED + mem_usage+=p_bytes; + if (mem_usage>max_usage) { + max_usage=mem_usage; + } +#endif + return s8 + PAD_ALIGN; + } else { + return mem; + } } -size_t Memory::get_static_mem_usage() { +void * Memory::realloc_static(void *p_memory,size_t p_bytes,bool p_pad_align) { - ERR_FAIL_COND_V( !MemoryPoolStatic::get_singleton(), 0); - return MemoryPoolStatic::get_singleton()->get_total_usage(); + if (p_memory==NULL) { + return alloc_static(p_bytes,p_pad_align); + } -} + uint8_t *mem = (uint8_t*)p_memory; -void Memory::dump_static_mem_to_file(const char* p_file) { +#ifdef DEBUG_ENABLED + bool prepad=true; +#else + bool prepad=p_pad_align; +#endif - MemoryPoolStatic::get_singleton()->dump_mem_to_file(p_file); -} + if (prepad) { + mem-=PAD_ALIGN; + uint64_t *s = (uint64_t*)mem; -MID Memory::alloc_dynamic(size_t p_bytes, const char *p_descr) { +#ifdef DEBUG_ENABLED + mem_usage-=*s; + mem_usage+=p_bytes; +#endif - MemoryPoolDynamic::ID id = MemoryPoolDynamic::get_singleton()->alloc(p_bytes,p_descr); + if (p_bytes==0) { + free(mem); + return NULL; + } else { + *s=p_bytes; - return MID(id); -} -Error Memory::realloc_dynamic(MID p_mid,size_t p_bytes) { + mem = (uint8_t*)realloc(mem,p_bytes+PAD_ALIGN); + ERR_FAIL_COND_V(!mem,NULL); + + s = (uint64_t*)mem; + + *s=p_bytes; - MemoryPoolDynamic::ID id = p_mid.data?p_mid.data->id:MemoryPoolDynamic::INVALID_ID; + return mem+PAD_ALIGN; + } + } else { - if (id==MemoryPoolDynamic::INVALID_ID) - return ERR_INVALID_PARAMETER; + mem = (uint8_t*)realloc(mem,p_bytes); - return MemoryPoolDynamic::get_singleton()->realloc(p_mid, p_bytes); + ERR_FAIL_COND_V(mem==NULL && p_bytes>0,NULL); + return mem; + } } -size_t Memory::get_dynamic_mem_available() { +void Memory::free_static(void *p_ptr,bool p_pad_align) { + + ERR_FAIL_COND(p_ptr==NULL); + + uint8_t *mem = (uint8_t*)p_ptr; + +#ifdef DEBUG_ENABLED + bool prepad=true; +#else + bool prepad=p_pad_align; +#endif + + alloc_count--; + + if (prepad) { + mem-=PAD_ALIGN; + uint64_t *s = (uint64_t*)mem; + +#ifdef DEBUG_ENABLED + mem_usage-=*s; +#endif + + free(mem); + } else { + + free(mem); + } - return MemoryPoolDynamic::get_singleton()->get_available_mem(); } -size_t Memory::get_dynamic_mem_usage() { +size_t Memory::get_mem_available() { + + return 0xFFFFFFFFFFFFF; - return MemoryPoolDynamic::get_singleton()->get_total_usage(); +} + +size_t Memory::get_mem_usage(){ +#ifdef DEBUG_ENABLED + return mem_usage; +#else + return 0; +#endif +} +size_t Memory::get_mem_max_usage(){ +#ifdef DEBUG_ENABLED + return max_usage; +#else + return 0; +#endif } diff --git a/core/os/memory.h b/core/os/memory.h index 5f4c6f929c..0e6dea48d3 100644 --- a/core/os/memory.h +++ b/core/os/memory.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,175 +31,45 @@ #include <stddef.h> #include "safe_refcount.h" -#include "os/memory_pool_dynamic.h" -#include "os/memory_pool_static.h" /** @author Juan Linietsky <reduzio@gmail.com> */ -class MID { - - struct Data { - - SafeRefCount refcount; - MemoryPoolDynamic::ID id; - }; - - mutable Data *data; - - void unref() { - - if (!data) - return; - if (data->refcount.unref()) { - - if (data->id!=MemoryPoolDynamic::INVALID_ID) - MemoryPoolDynamic::get_singleton()->free(data->id); - MemoryPoolStatic::get_singleton()->free(data); - } - - data=NULL; - } - - void ref(Data *p_data) { - - if (data==p_data) - return; - unref(); - - if (p_data && p_data->refcount.ref()) - data=p_data; - } - -friend class MID_Lock; - - inline void lock() { - - if (data && data->id!=MemoryPoolDynamic::INVALID_ID) - MemoryPoolDynamic::get_singleton()->lock(data->id); - } - inline void unlock() { - - if (data && data->id!=MemoryPoolDynamic::INVALID_ID) - MemoryPoolDynamic::get_singleton()->unlock(data->id); - - } - - inline void * get() { - - if (data && data->id!=MemoryPoolDynamic::INVALID_ID) - return MemoryPoolDynamic::get_singleton()->get(data->id); - - return NULL; - } - - Error _resize(size_t p_size) { - - if (p_size==0 && (!data || data->id==MemoryPoolDynamic::INVALID_ID)) - return OK; - if (p_size && !data) { - // create data because we'll need it - data = (Data*)MemoryPoolStatic::get_singleton()->alloc(sizeof(Data),"MID::Data"); - ERR_FAIL_COND_V( !data,ERR_OUT_OF_MEMORY ); - data->refcount.init(); - data->id=MemoryPoolDynamic::INVALID_ID; - } - - if (p_size==0 && data && data->id==MemoryPoolDynamic::INVALID_ID) { - - MemoryPoolDynamic::get_singleton()->free(data->id); - data->id=MemoryPoolDynamic::INVALID_ID; - } - - if (p_size>0) { - - if (data->id==MemoryPoolDynamic::INVALID_ID) { - - data->id=MemoryPoolDynamic::get_singleton()->alloc(p_size,"Unnamed MID"); - ERR_FAIL_COND_V( data->id==MemoryPoolDynamic::INVALID_ID, ERR_OUT_OF_MEMORY ); - - } else { - - MemoryPoolDynamic::get_singleton()->realloc(data->id,p_size); - ERR_FAIL_COND_V( data->id==MemoryPoolDynamic::INVALID_ID, ERR_OUT_OF_MEMORY ); - - } - } - - return OK; - } -friend class Memory; - - MID(MemoryPoolDynamic::ID p_id) { - - data = (Data*)MemoryPoolStatic::get_singleton()->alloc(sizeof(Data),"MID::Data"); - data->refcount.init(); - data->id=p_id; - } -public: - - bool is_valid() const { return data; } - operator bool() const { return data; } - - - size_t get_size() const { return (data && data->id!=MemoryPoolDynamic::INVALID_ID) ? MemoryPoolDynamic::get_singleton()->get_size(data->id) : 0; } - Error resize(size_t p_size) { return _resize(p_size); } - inline void operator=(const MID& p_mid) { ref( p_mid.data ); } - inline bool is_locked() const { return (data && data->id!=MemoryPoolDynamic::INVALID_ID) ? MemoryPoolDynamic::get_singleton()->is_locked(data->id) : false; } - inline MID(const MID& p_mid) { data=NULL; ref( p_mid.data ); } - inline MID() { data = NULL; } - ~MID() { unref(); } -}; - - -class MID_Lock { - - MID mid; - -public: - - void *data() { return mid.get(); } +#ifndef PAD_ALIGN +#define PAD_ALIGN 16 //must always be greater than this at much +#endif - void operator=(const MID_Lock& p_lock ) { mid.unlock(); mid = p_lock.mid; mid.lock(); } - inline MID_Lock(const MID& p_mid) { mid=p_mid; mid.lock(); } - inline MID_Lock(const MID_Lock& p_lock) { mid=p_lock.mid; mid.lock(); } - MID_Lock() {} - ~MID_Lock() { mid.unlock(); } -}; class Memory{ Memory(); -public: +#ifdef DEBUG_ENABLED + static size_t mem_usage; + static size_t max_usage; +#endif + + static size_t alloc_count; - static void * alloc_static(size_t p_bytes,const char *p_descr=""); - static void * realloc_static(void *p_memory,size_t p_bytes); - static void free_static(void *p_ptr); - static size_t get_static_mem_available(); - static size_t get_static_mem_usage(); - static size_t get_static_mem_max_usage(); - static void dump_static_mem_to_file(const char* p_file); +public: - static MID alloc_dynamic(size_t p_bytes, const char *p_descr=""); - static Error realloc_dynamic(MID p_mid,size_t p_bytes); + static void * alloc_static(size_t p_bytes,bool p_pad_align=false); + static void * realloc_static(void *p_memory,size_t p_bytes,bool p_pad_align=false); + static void free_static(void *p_ptr,bool p_pad_align=false); - static size_t get_dynamic_mem_available(); - static size_t get_dynamic_mem_usage(); + static size_t get_mem_available(); + static size_t get_mem_usage(); + static size_t get_mem_max_usage(); -}; -template<class T> -struct MemAalign { - static _FORCE_INLINE_ int get_align() { return DEFAULT_ALIGNMENT; } }; class DefaultAllocator { public: - _FORCE_INLINE_ static void *alloc(size_t p_memory) { return Memory::alloc_static(p_memory, ""); } - _FORCE_INLINE_ static void free(void *p_ptr) { return Memory::free_static(p_ptr); } + _FORCE_INLINE_ static void *alloc(size_t p_memory) { return Memory::alloc_static(p_memory, false); } + _FORCE_INLINE_ static void free(void *p_ptr) { return Memory::free_static(p_ptr,false); } }; @@ -209,31 +79,10 @@ void * operator new(size_t p_size,void* (*p_allocfunc)(size_t p_size)); ///< ope void * operator new(size_t p_size,void *p_pointer,size_t check, const char *p_description); ///< operator new that takes a description and uses a pointer to the preallocated memory -#ifdef DEBUG_MEMORY_ENABLED - -#define memalloc(m_size) Memory::alloc_static(m_size, __FILE__ ":" __STR(__LINE__) ", memalloc.") -#define memrealloc(m_mem,m_size) Memory::realloc_static(m_mem,m_size) -#define memfree(m_size) Memory::free_static(m_size) - -#else - #define memalloc(m_size) Memory::alloc_static(m_size) #define memrealloc(m_mem,m_size) Memory::realloc_static(m_mem,m_size) #define memfree(m_size) Memory::free_static(m_size) -#endif - -#ifdef DEBUG_MEMORY_ENABLED -#define dynalloc(m_size) Memory::alloc_dynamic(m_size, __FILE__ ":" __STR(__LINE__) ", type: DYNAMIC") -#define dynrealloc(m_mem,m_size) m_mem.resize(m_size) - -#else - -#define dynalloc(m_size) Memory::alloc_dynamic(m_size) -#define dynrealloc(m_mem,m_size) m_mem.resize(m_size) - -#endif - _ALWAYS_INLINE_ void postinitialize_handler(void *) {} @@ -245,16 +94,8 @@ _ALWAYS_INLINE_ T *_post_initialize(T *p_obj) { return p_obj; } -#ifdef DEBUG_MEMORY_ENABLED - -#define memnew(m_class) _post_initialize(new(__FILE__ ":" __STR(__LINE__) ", memnew type: " __STR(m_class)) m_class) - -#else - #define memnew(m_class) _post_initialize(new("") m_class) -#endif - _ALWAYS_INLINE_ void * operator new(size_t p_size,void *p_pointer,size_t check, const char *p_description) { // void *failptr=0; // ERR_FAIL_COND_V( check < p_size , failptr); /** bug, or strange compiler, most likely */ @@ -275,7 +116,7 @@ void memdelete(T *p_class) { if (!predelete_handler(p_class)) return; // doesn't want to be deleted p_class->~T(); - Memory::free_static(p_class); + Memory::free_static(p_class,false); } template<class T,class A> @@ -288,15 +129,9 @@ void memdelete_allocator(T *p_class) { } #define memdelete_notnull(m_v) { if (m_v) memdelete(m_v); } -#ifdef DEBUG_MEMORY_ENABLED - -#define memnew_arr( m_class, m_count ) memnew_arr_template<m_class>(m_count,__FILE__ ":" __STR(__LINE__) ", memnew_arr type: " _STR(m_class)) - -#else #define memnew_arr( m_class, m_count ) memnew_arr_template<m_class>(m_count) -#endif template<typename T> T* memnew_arr_template(size_t p_elements,const char *p_descr="") { @@ -304,14 +139,14 @@ T* memnew_arr_template(size_t p_elements,const char *p_descr="") { if (p_elements==0) return 0; /** overloading operator new[] cannot be done , because it may not return the real allocated address (it may pad the 'element count' before the actual array). Because of that, it must be done by hand. This is the - same strategy used by std::vector, and the DVector class, so it should be safe.*/ + same strategy used by std::vector, and the PoolVector class, so it should be safe.*/ size_t len = sizeof(T) * p_elements; - unsigned int *mem = (unsigned int*)Memory::alloc_static( len + MAX(sizeof(size_t), DEFAULT_ALIGNMENT), p_descr ); + uint64_t *mem = (uint64_t*)Memory::alloc_static( len , true ); T *failptr=0; //get rid of a warning ERR_FAIL_COND_V( !mem, failptr ); - *mem=p_elements; - mem = (unsigned int *)( ((uint8_t*)mem) + MAX(sizeof(size_t), DEFAULT_ALIGNMENT)); + *(mem-1)=p_elements; + T* elems = (T*)mem; /* call operator new */ @@ -330,20 +165,22 @@ T* memnew_arr_template(size_t p_elements,const char *p_descr="") { template<typename T> size_t memarr_len(const T *p_class) { - uint8_t* ptr = ((uint8_t*)p_class) - MAX(sizeof(size_t), DEFAULT_ALIGNMENT); - return *(size_t*)ptr; + uint64_t* ptr = (uint64_t*)p_class; + return *(ptr-1); } template<typename T> void memdelete_arr(T *p_class) { - unsigned int * elems = (unsigned int*)(((uint8_t*)p_class) - MAX(sizeof(size_t), DEFAULT_ALIGNMENT)); + uint64_t* ptr = (uint64_t*)p_class; + + uint64_t elem_count = *(ptr-1); - for (unsigned int i=0;i<*elems;i++) { + for (uint64_t i=0;i<elem_count;i++) { p_class[i].~T(); }; - Memory::free_static(elems); + Memory::free_static(ptr,true); } diff --git a/core/os/memory_pool_dynamic.cpp b/core/os/memory_pool_dynamic.cpp deleted file mode 100644 index 6be8d0a36d..0000000000 --- a/core/os/memory_pool_dynamic.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/*************************************************************************/ -/* memory_pool_dynamic.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "memory_pool_dynamic.h" - - -MemoryPoolDynamic* MemoryPoolDynamic::singleton=NULL; - - -MemoryPoolDynamic* MemoryPoolDynamic::get_singleton() { - - return singleton; -} - - -MemoryPoolDynamic::MemoryPoolDynamic() { - - ERR_FAIL_COND(singleton!=NULL); - singleton=this; -} - -MemoryPoolDynamic::~MemoryPoolDynamic() { - - singleton=NULL; -} diff --git a/core/os/memory_pool_dynamic.h b/core/os/memory_pool_dynamic.h deleted file mode 100644 index 70752fb10d..0000000000 --- a/core/os/memory_pool_dynamic.h +++ /dev/null @@ -1,79 +0,0 @@ -/*************************************************************************/ -/* memory_pool_dynamic.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef MEMORY_POOL_DYNAMIC_H -#define MEMORY_POOL_DYNAMIC_H - -#include "typedefs.h" - - -class MemoryPoolDynamic { - - static MemoryPoolDynamic* singleton; -protected: -friend class Memory; -friend class MID; - - enum { - - INVALID_ID=0xFFFFFFFF - }; - - static MemoryPoolDynamic* get_singleton(); - - typedef uint64_t ID; - - - virtual ID alloc(size_t p_amount,const char* p_description)=0; - virtual void free(ID p_id)=0; - virtual Error realloc(ID p_id, size_t p_amount)=0; - virtual bool is_valid(ID p_id)=0; - virtual size_t get_size(ID p_id) const=0; - virtual const char* get_description(ID p_id) const=0; - - virtual Error lock(ID p_id)=0; - virtual void * get(ID p_ID)=0; - virtual Error unlock(ID p_id)=0; - virtual bool is_locked(ID p_id) const=0; - - virtual size_t get_available_mem() const=0; - virtual size_t get_total_usage() const=0; - - MemoryPoolDynamic(); -public: - virtual ~MemoryPoolDynamic(); - -}; - - -#endif - - - - - diff --git a/core/os/memory_pool_dynamic_prealloc.cpp b/core/os/memory_pool_dynamic_prealloc.cpp deleted file mode 100644 index f76c2a12b4..0000000000 --- a/core/os/memory_pool_dynamic_prealloc.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/*************************************************************************/ -/* memory_pool_dynamic_prealloc.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "memory_pool_dynamic_prealloc.h" -#include "os/memory.h" - -#include "print_string.h" -MemoryPoolDynamicPrealloc::ID MemoryPoolDynamicPrealloc::alloc(size_t p_amount,const char* p_description) { - - -// print_line("dynpool - allocating: "+itos(p_amount)); - ID id = pool_alloc->alloc(p_amount); -// print_line("dynpool - free: "+itos(pool_alloc->get_free_mem())); - return id; - -} - -void MemoryPoolDynamicPrealloc::free(ID p_id) { - - pool_alloc->free(p_id); -} - -Error MemoryPoolDynamicPrealloc::realloc(ID p_id, size_t p_amount) { - - return pool_alloc->resize(p_id,p_amount); -} - -bool MemoryPoolDynamicPrealloc::is_valid(ID p_id) { - - return true; -} - -size_t MemoryPoolDynamicPrealloc::get_size(ID p_id) const { - - return pool_alloc->get_size(p_id); -} - -const char* MemoryPoolDynamicPrealloc::get_description(ID p_id) const { - - return ""; -} - -Error MemoryPoolDynamicPrealloc::lock(ID p_id) { - -// print_line("lock: "+itos(p_id)); - return pool_alloc->lock(p_id); -} - -void * MemoryPoolDynamicPrealloc::get(ID p_ID) { - -// print_line("get: "+itos(p_ID)); - return pool_alloc->get(p_ID); -} - -Error MemoryPoolDynamicPrealloc::unlock(ID p_id) { - -// print_line("unlock: "+itos(p_id)); - pool_alloc->unlock(p_id); - return OK; -} - -bool MemoryPoolDynamicPrealloc::is_locked(ID p_id) const { - - return pool_alloc->is_locked(p_id); -} - - -size_t MemoryPoolDynamicPrealloc::get_available_mem() const { - - return pool_alloc->get_free_mem(); -} - -size_t MemoryPoolDynamicPrealloc::get_total_usage() const { - - return pool_alloc->get_used_mem(); -} - - - -MemoryPoolDynamicPrealloc::MemoryPoolDynamicPrealloc(void * p_mem,int p_size, int p_align, int p_max_entries) { - - pool_alloc = memnew( PoolAllocator(p_mem,p_size,p_align,true,p_max_entries)); - -} - -MemoryPoolDynamicPrealloc::~MemoryPoolDynamicPrealloc() { - - - memdelete( pool_alloc ); -} - diff --git a/core/os/memory_pool_dynamic_prealloc.h b/core/os/memory_pool_dynamic_prealloc.h deleted file mode 100644 index d2256c0c98..0000000000 --- a/core/os/memory_pool_dynamic_prealloc.h +++ /dev/null @@ -1,60 +0,0 @@ -/*************************************************************************/ -/* memory_pool_dynamic_prealloc.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef MEMORY_POOL_DYNAMIC_PREALLOC_H -#define MEMORY_POOL_DYNAMIC_PREALLOC_H - -#include "pool_allocator.h" -#include "core/os/memory_pool_dynamic.h" - -class MemoryPoolDynamicPrealloc : public MemoryPoolDynamic { - - PoolAllocator *pool_alloc; - -public: - - virtual ID alloc(size_t p_amount,const char* p_description); - virtual void free(ID p_id); - virtual Error realloc(ID p_id, size_t p_amount); - virtual bool is_valid(ID p_id); - virtual size_t get_size(ID p_id) const; - virtual const char* get_description(ID p_id) const; - - virtual Error lock(ID p_id); - virtual void * get(ID p_ID); - virtual Error unlock(ID p_id); - virtual bool is_locked(ID p_id) const; - - virtual size_t get_available_mem() const; - virtual size_t get_total_usage() const; - - MemoryPoolDynamicPrealloc(void * p_mem,int p_size, int p_align = 16, int p_max_entries=PoolAllocator::DEFAULT_MAX_ALLOCS); - ~MemoryPoolDynamicPrealloc(); -}; - -#endif // MEMORY_POOL_DYNAMIC_PREALLOC_H diff --git a/core/os/memory_pool_dynamic_static.cpp b/core/os/memory_pool_dynamic_static.cpp deleted file mode 100644 index c047c931ec..0000000000 --- a/core/os/memory_pool_dynamic_static.cpp +++ /dev/null @@ -1,272 +0,0 @@ -/*************************************************************************/ -/* memory_pool_dynamic_static.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "memory_pool_dynamic_static.h" -#include "os/memory.h" -#include "os/os.h" -#include "ustring.h" -#include "print_string.h" -#include <stdio.h> - -MemoryPoolDynamicStatic::Chunk *MemoryPoolDynamicStatic::get_chunk(ID p_id) { - - uint64_t check = p_id/MAX_CHUNKS; - uint64_t idx = p_id%MAX_CHUNKS; - - if (!chunk[idx].mem || chunk[idx].check!=check) - return NULL; - - return &chunk[idx]; -} - - -const MemoryPoolDynamicStatic::Chunk *MemoryPoolDynamicStatic::get_chunk(ID p_id) const { - - uint64_t check = p_id/MAX_CHUNKS; - uint64_t idx = p_id%MAX_CHUNKS; - - if (!chunk[idx].mem || chunk[idx].check!=check) - return NULL; - - return &chunk[idx]; -} - -MemoryPoolDynamic::ID MemoryPoolDynamicStatic::alloc(size_t p_amount,const char* p_description) { - - _THREAD_SAFE_METHOD_ - - int idx=-1; - - for (int i=0;i<MAX_CHUNKS;i++) { - - last_alloc++; - if (last_alloc>=MAX_CHUNKS) - last_alloc=0; - - if ( !chunk[last_alloc].mem ) { - - idx=last_alloc; - break; - } - } - - - if (idx==-1) { - ERR_EXPLAIN("Out of dynamic Memory IDs"); - ERR_FAIL_V(INVALID_ID); - //return INVALID_ID; - } - - //chunk[idx].mem = Memory::alloc_static(p_amount,p_description); - chunk[idx].mem = memalloc(p_amount); - if (!chunk[idx].mem) - return INVALID_ID; - - chunk[idx].size=p_amount; - chunk[idx].check=++last_check; - chunk[idx].descr=p_description; - chunk[idx].lock=0; - - total_usage+=p_amount; - if (total_usage>max_usage) - max_usage=total_usage; - - ID id = chunk[idx].check*MAX_CHUNKS + (uint64_t)idx; - - return id; - -} -void MemoryPoolDynamicStatic::free(ID p_id) { - - _THREAD_SAFE_METHOD_ - - Chunk *c = get_chunk(p_id); - ERR_FAIL_COND(!c); - - - total_usage-=c->size; - memfree(c->mem); - - c->mem=0; - - if (c->lock>0) { - - ERR_PRINT("Freed ID Still locked"); - } -} - -Error MemoryPoolDynamicStatic::realloc(ID p_id, size_t p_amount) { - - _THREAD_SAFE_METHOD_ - - Chunk *c = get_chunk(p_id); - ERR_FAIL_COND_V(!c,ERR_INVALID_PARAMETER); - ERR_FAIL_COND_V(c->lock > 0 , ERR_LOCKED ); - - - void * new_mem = memrealloc(c->mem,p_amount); - - ERR_FAIL_COND_V(!new_mem,ERR_OUT_OF_MEMORY); - total_usage-=c->size; - c->mem=new_mem; - c->size=p_amount; - total_usage+=c->size; - if (total_usage>max_usage) - max_usage=total_usage; - - - return OK; -} -bool MemoryPoolDynamicStatic::is_valid(ID p_id) { - - _THREAD_SAFE_METHOD_ - - Chunk *c = get_chunk(p_id); - - return c!=NULL; - -} -size_t MemoryPoolDynamicStatic::get_size(ID p_id) const { - - _THREAD_SAFE_METHOD_ - - const Chunk *c = get_chunk(p_id); - ERR_FAIL_COND_V(!c,0); - - return c->size; - - -} -const char* MemoryPoolDynamicStatic::get_description(ID p_id) const { - - _THREAD_SAFE_METHOD_ - - const Chunk *c = get_chunk(p_id); - ERR_FAIL_COND_V(!c,""); - - return c->descr; - -} - - -bool MemoryPoolDynamicStatic::is_locked(ID p_id) const { - - _THREAD_SAFE_METHOD_ - - const Chunk *c = get_chunk(p_id); - ERR_FAIL_COND_V(!c,false); - - return c->lock>0; - -} - -Error MemoryPoolDynamicStatic::lock(ID p_id) { - - _THREAD_SAFE_METHOD_ - - Chunk *c = get_chunk(p_id); - ERR_FAIL_COND_V(!c,ERR_INVALID_PARAMETER); - - c->lock++; - - return OK; -} -void * MemoryPoolDynamicStatic::get(ID p_id) { - - _THREAD_SAFE_METHOD_ - - const Chunk *c = get_chunk(p_id); - ERR_FAIL_COND_V(!c,NULL); - ERR_FAIL_COND_V( c->lock==0, NULL ); - - return c->mem; -} -Error MemoryPoolDynamicStatic::unlock(ID p_id) { - - _THREAD_SAFE_METHOD_ - - Chunk *c = get_chunk(p_id); - ERR_FAIL_COND_V(!c,ERR_INVALID_PARAMETER); - - ERR_FAIL_COND_V( c->lock<=0, ERR_INVALID_PARAMETER ); - c->lock--; - - return OK; -} - -size_t MemoryPoolDynamicStatic::get_available_mem() const { - - return Memory::get_static_mem_available(); -} - -size_t MemoryPoolDynamicStatic::get_total_usage() const { - _THREAD_SAFE_METHOD_ - - return total_usage; -} - -MemoryPoolDynamicStatic::MemoryPoolDynamicStatic() { - - last_check=1; - last_alloc=0; - total_usage=0; - max_usage=0; -} - -MemoryPoolDynamicStatic::~MemoryPoolDynamicStatic() { - -#ifdef DEBUG_MEMORY_ENABLED - - if (OS::get_singleton()->is_stdout_verbose()) { - - if (total_usage>0) { - - ERR_PRINT("DYNAMIC ALLOC: ** MEMORY LEAKS DETECTED **"); - ERR_PRINT(String("DYNAMIC ALLOC: "+String::num(total_usage)+" bytes of memory in use at exit.").ascii().get_data()); - - ERR_PRINT("DYNAMIC ALLOC: Following is the list of leaked allocations:"); - - for (int i=0;i<MAX_CHUNKS;i++) { - - if (chunk[i].mem) { - - ERR_PRINT(String("\t"+String::num(chunk[i].size)+" bytes - "+String(chunk[i].descr)).ascii().get_data()); - } - } - - ERR_PRINT("DYNAMIC ALLOC: End of Report."); - - print_line("INFO: dynmem - max: "+itos(max_usage)+", "+itos(total_usage)+" leaked."); - } else { - - print_line("INFO: dynmem - max: "+itos(max_usage)+", no leaks."); - } - } - -#endif -} diff --git a/core/os/memory_pool_dynamic_static.h b/core/os/memory_pool_dynamic_static.h deleted file mode 100644 index a72d39355c..0000000000 --- a/core/os/memory_pool_dynamic_static.h +++ /dev/null @@ -1,86 +0,0 @@ -/*************************************************************************/ -/* memory_pool_dynamic_static.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef MEMORY_POOL_DYNAMIC_STATIC_H -#define MEMORY_POOL_DYNAMIC_STATIC_H - -#include "os/memory_pool_dynamic.h" -#include "typedefs.h" -#include "os/thread_safe.h" - -class MemoryPoolDynamicStatic : public MemoryPoolDynamic { - - _THREAD_SAFE_CLASS_ - - enum { - MAX_CHUNKS=65536 - }; - - - struct Chunk { - - uint64_t lock; - uint64_t check; - void *mem; - size_t size; - const char *descr; - - Chunk() { mem=NULL; lock=0; check=0; } - }; - - Chunk chunk[MAX_CHUNKS]; - uint64_t last_check; - int last_alloc; - size_t total_usage; - size_t max_usage; - - Chunk *get_chunk(ID p_id); - const Chunk *get_chunk(ID p_id) const; -public: - - virtual ID alloc(size_t p_amount,const char* p_description); - virtual void free(ID p_id); - virtual Error realloc(ID p_id, size_t p_amount); - virtual bool is_valid(ID p_id); - virtual size_t get_size(ID p_id) const; - virtual const char* get_description(ID p_id) const; - - virtual bool is_locked(ID p_id) const; - virtual Error lock(ID p_id); - virtual void * get(ID p_ID); - virtual Error unlock(ID p_id); - - virtual size_t get_available_mem() const; - virtual size_t get_total_usage() const; - - MemoryPoolDynamicStatic(); - virtual ~MemoryPoolDynamicStatic(); - -}; - -#endif diff --git a/core/os/memory_pool_static.cpp b/core/os/memory_pool_static.cpp deleted file mode 100644 index 88c2ba3b3e..0000000000 --- a/core/os/memory_pool_static.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/*************************************************************************/ -/* memory_pool_static.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "memory_pool_static.h" - -MemoryPoolStatic *MemoryPoolStatic::singleton=0; - -MemoryPoolStatic *MemoryPoolStatic::get_singleton() { - - return singleton; -} - - -MemoryPoolStatic::MemoryPoolStatic() { - - singleton=this; -} - - -MemoryPoolStatic::~MemoryPoolStatic() { - singleton=NULL; -} - - diff --git a/core/os/memory_pool_static.h b/core/os/memory_pool_static.h deleted file mode 100644 index f7f60b8df8..0000000000 --- a/core/os/memory_pool_static.h +++ /dev/null @@ -1,69 +0,0 @@ -/*************************************************************************/ -/* memory_pool_static.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef MEMORY_POOL_STATIC_H -#define MEMORY_POOL_STATIC_H - -#include <stddef.h> - -#include "core/typedefs.h" - -/** - @author Juan Linietsky <red@lunatea> -*/ -class MemoryPoolStatic { -private: - - static MemoryPoolStatic *singleton; - -public: - - static MemoryPoolStatic *get_singleton(); - - virtual void* alloc(size_t p_bytes,const char *p_description)=0; ///< Pointer in p_description shold be to a const char const like "hello" - virtual void* realloc(void * p_memory,size_t p_bytes)=0; ///< Pointer in p_description shold be to a const char const like "hello" - virtual void free(void *p_ptr)=0; ///< Pointer in p_description shold be to a const char const - - virtual size_t get_available_mem() const=0; - virtual size_t get_total_usage()=0; - virtual size_t get_max_usage()=0; - - /* Most likely available only if memory debugger was compiled in */ - virtual int get_alloc_count()=0; - virtual void * get_alloc_ptr(int p_alloc_idx)=0; - virtual const char* get_alloc_description(int p_alloc_idx)=0; - virtual size_t get_alloc_size(int p_alloc_idx)=0; - - virtual void dump_mem_to_file(const char* p_file)=0; - - MemoryPoolStatic(); - virtual ~MemoryPoolStatic(); - -}; - -#endif diff --git a/core/os/mutex.cpp b/core/os/mutex.cpp index 21400d2ccf..f5f7f757c3 100644 --- a/core/os/mutex.cpp +++ b/core/os/mutex.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/mutex.h b/core/os/mutex.h index 5870171dc7..a1004965bb 100644 --- a/core/os/mutex.h +++ b/core/os/mutex.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/os.cpp b/core/os/os.cpp index 11a315a01b..677bf63e69 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -68,6 +68,7 @@ void OS::print_error(const char* p_function,const char* p_file,int p_line,const case ERR_ERROR: err_type="**ERROR**"; break; case ERR_WARNING: err_type="**WARNING**"; break; case ERR_SCRIPT: err_type="**SCRIPT ERROR**"; break; + case ERR_SHADER: err_type="**SHADER ERROR**"; break; } if (p_rationale && *p_rationale) @@ -186,7 +187,7 @@ const char *OS::get_last_error() const { void OS::dump_memory_to_file(const char* p_file) { - Memory::dump_static_mem_to_file(p_file); +// Memory::dump_static_mem_to_file(p_file); } static FileAccess *_OSPRF=NULL; @@ -197,7 +198,7 @@ static void _OS_printres(Object *p_obj) { if (!res) return; - String str = itos(res->get_instance_ID())+String(res->get_type())+":"+String(res->get_name())+" - "+res->get_path(); + String str = itos(res->get_instance_ID())+String(res->get_class())+":"+String(res->get_name())+" - "+res->get_path(); if (_OSPRF) _OSPRF->store_line(str); else @@ -296,7 +297,7 @@ String OS::get_locale() const { String OS::get_resource_dir() const { - return Globals::get_singleton()->get_resource_path(); + return GlobalConfig::get_singleton()->get_resource_path(); } @@ -306,7 +307,7 @@ String OS::get_system_dir(SystemDir p_dir) const { } String OS::get_safe_application_name() const { - String an = Globals::get_singleton()->get("application/name"); + String an = GlobalConfig::get_singleton()->get("application/name"); Vector<String> invalid_char = String("\\ / : * ? \" < > |").split(" "); for (int i=0;i<invalid_char.size();i++) { an = an.replace(invalid_char[i],"-"); @@ -366,16 +367,16 @@ Error OS::dialog_input_text(String p_title, String p_description, String p_parti int OS::get_static_memory_usage() const { - return Memory::get_static_mem_usage(); + return Memory::get_mem_usage(); } int OS::get_dynamic_memory_usage() const{ - return Memory::get_dynamic_mem_usage(); + return MemoryPool::total_memory; } int OS::get_static_memory_peak_usage() const { - return Memory::get_static_mem_max_usage(); + return Memory::get_mem_max_usage(); } Error OS::set_cwd(const String& p_cwd) { @@ -391,7 +392,7 @@ bool OS::has_touchscreen_ui_hint() const { int OS::get_free_static_memory() const { - return Memory::get_static_mem_available(); + return Memory::get_mem_available(); } void OS::yield() { @@ -532,7 +533,7 @@ bool OS::is_joy_known(int p_device) { } String OS::get_joy_guid(int p_device) const { - return "Default Joystick"; + return "Default Joypad"; } void OS::set_context(int p_context) { diff --git a/core/os/os.h b/core/os/os.h index 037fcac039..5ea3216f24 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -120,7 +120,8 @@ public: enum ErrorType { ERR_ERROR, ERR_WARNING, - ERR_SCRIPT + ERR_SCRIPT, + ERR_SHADER }; virtual void print_error(const char* p_function,const char* p_file,int p_line,const char *p_code,const char*p_rationale,ErrorType p_type=ERR_ERROR); diff --git a/core/os/rw_lock.cpp b/core/os/rw_lock.cpp new file mode 100644 index 0000000000..9b2d1f8a46 --- /dev/null +++ b/core/os/rw_lock.cpp @@ -0,0 +1,21 @@ +#include "rw_lock.h" +#include "error_macros.h" +#include <stddef.h> + + + +RWLock* (*RWLock::create_func)()=0; + +RWLock *RWLock::create() { + + ERR_FAIL_COND_V( !create_func, 0 ); + + return create_func(); +} + + +RWLock::~RWLock() { + + +} + diff --git a/core/os/rw_lock.h b/core/os/rw_lock.h new file mode 100644 index 0000000000..c513e6d636 --- /dev/null +++ b/core/os/rw_lock.h @@ -0,0 +1,46 @@ +#ifndef RWLOCK_H +#define RWLOCK_H + +#include "error_list.h" + +class RWLock { +protected: + static RWLock* (*create_func)(); + +public: + + virtual void read_lock()=0; ///< Lock the rwlock, block if locked by someone else + virtual void read_unlock()=0; ///< Unlock the rwlock, let other threads continue + virtual Error read_try_lock()=0; ///< Attempt to lock the rwlock, OK on success, ERROR means it can't lock. + + virtual void write_lock()=0; ///< Lock the rwlock, block if locked by someone else + virtual void write_unlock()=0; ///< Unlock the rwlock, let other thwrites continue + virtual Error write_try_lock()=0; ///< Attempt to lock the rwlock, OK on success, ERROR means it can't lock. + + static RWLock * create(); ///< Create a rwlock + + virtual ~RWLock(); +}; + + +class RWLockRead { + + RWLock *lock; +public: + + RWLockRead(RWLock* p_lock) { lock=p_lock; if (lock) lock->read_lock(); } + ~RWLockRead() { if (lock) lock->read_unlock(); } + +}; + +class RWLockWrite { + + RWLock *lock; +public: + + RWLockWrite(RWLock* p_lock) { lock=p_lock; if (lock) lock->write_lock(); } + ~RWLockWrite() { if (lock) lock->write_unlock(); } + +}; + +#endif // RWLOCK_H diff --git a/core/os/semaphore.cpp b/core/os/semaphore.cpp index 5fa2d339dc..fe476c5888 100644 --- a/core/os/semaphore.cpp +++ b/core/os/semaphore.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/semaphore.h b/core/os/semaphore.h index 8469408e65..e0b4460b22 100644 --- a/core/os/semaphore.h +++ b/core/os/semaphore.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/shell.cpp b/core/os/shell.cpp index 8737d97fa0..60f4203dbe 100644 --- a/core/os/shell.cpp +++ b/core/os/shell.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/shell.h b/core/os/shell.h index 8b0c286d73..f26f01846e 100644 --- a/core/os/shell.h +++ b/core/os/shell.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/thread.cpp b/core/os/thread.cpp index c1ae53074b..689fed7537 100644 --- a/core/os/thread.cpp +++ b/core/os/thread.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/thread.h b/core/os/thread.h index 5f0ec707f2..23ed76d486 100644 --- a/core/os/thread.h +++ b/core/os/thread.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/thread_dummy.cpp b/core/os/thread_dummy.cpp index 30a0e2696c..93a020b7a8 100644 --- a/core/os/thread_dummy.cpp +++ b/core/os/thread_dummy.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/thread_dummy.h b/core/os/thread_dummy.h index 800eef9ef9..01e366e2fa 100644 --- a/core/os/thread_dummy.h +++ b/core/os/thread_dummy.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/thread_safe.cpp b/core/os/thread_safe.cpp index a742b1144e..a0bfb86c82 100644 --- a/core/os/thread_safe.cpp +++ b/core/os/thread_safe.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/os/thread_safe.h b/core/os/thread_safe.h index 1c82cbe704..c9a832b41b 100644 --- a/core/os/thread_safe.h +++ b/core/os/thread_safe.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/packed_data_container.cpp b/core/packed_data_container.cpp index 91f886ff4b..5f3b877822 100644 --- a/core/packed_data_container.cpp +++ b/core/packed_data_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -82,7 +82,7 @@ Variant PackedDataContainer::_iter_get_ofs(const Variant& p_iter,uint32_t p_offs if (pos<0 || pos>=size) return Variant(); - DVector<uint8_t>::Read rd=data.read(); + PoolVector<uint8_t>::Read rd=data.read(); const uint8_t *r=&rd[p_offset]; uint32_t type = decode_uint32(r); @@ -131,7 +131,7 @@ Variant PackedDataContainer::_get_at_ofs(uint32_t p_ofs,const uint8_t *p_buf,boo uint32_t PackedDataContainer::_type_at_ofs(uint32_t p_ofs) const { - DVector<uint8_t>::Read rd=data.read(); + PoolVector<uint8_t>::Read rd=data.read(); const uint8_t *r=&rd[p_ofs]; uint32_t type = decode_uint32(r); @@ -140,7 +140,7 @@ uint32_t PackedDataContainer::_type_at_ofs(uint32_t p_ofs) const { int PackedDataContainer::_size(uint32_t p_ofs) const { - DVector<uint8_t>::Read rd=data.read(); + PoolVector<uint8_t>::Read rd=data.read(); const uint8_t *r=&rd[p_ofs]; uint32_t type = decode_uint32(r); @@ -160,7 +160,7 @@ int PackedDataContainer::_size(uint32_t p_ofs) const { Variant PackedDataContainer::_key_at_ofs(uint32_t p_ofs,const Variant& p_key,bool &err) const { - DVector<uint8_t>::Read rd=data.read(); + PoolVector<uint8_t>::Read rd=data.read(); const uint8_t *r=&rd[p_ofs]; uint32_t type = decode_uint32(r); @@ -239,21 +239,21 @@ uint32_t PackedDataContainer::_pack(const Variant& p_data, Vector<uint8_t>& tmpd case Variant::VECTOR2: case Variant::RECT2: case Variant::VECTOR3: - case Variant::MATRIX32: + case Variant::TRANSFORM2D: case Variant::PLANE: case Variant::QUAT: - case Variant::_AABB: - case Variant::MATRIX3: + case Variant::RECT3: + case Variant::BASIS: case Variant::TRANSFORM: case Variant::IMAGE: case Variant::INPUT_EVENT: - case Variant::RAW_ARRAY: - case Variant::INT_ARRAY: - case Variant::REAL_ARRAY: - case Variant::STRING_ARRAY: - case Variant::VECTOR2_ARRAY: - case Variant::VECTOR3_ARRAY: - case Variant::COLOR_ARRAY: + case Variant::POOL_BYTE_ARRAY: + case Variant::POOL_INT_ARRAY: + case Variant::POOL_REAL_ARRAY: + case Variant::POOL_STRING_ARRAY: + case Variant::POOL_VECTOR2_ARRAY: + case Variant::POOL_VECTOR3_ARRAY: + case Variant::POOL_COLOR_ARRAY: case Variant::NODE_PATH: { uint32_t pos = tmpdata.size(); @@ -344,21 +344,21 @@ Error PackedDataContainer::pack(const Variant& p_data) { _pack(p_data,tmpdata,string_cache); datalen=tmpdata.size(); data.resize(tmpdata.size()); - DVector<uint8_t>::Write w = data.write(); + PoolVector<uint8_t>::Write w = data.write(); copymem(w.ptr(),tmpdata.ptr(),tmpdata.size()); return OK; } -void PackedDataContainer::_set_data(const DVector<uint8_t>& p_data) { +void PackedDataContainer::_set_data(const PoolVector<uint8_t>& p_data) { data=p_data; datalen=data.size(); } -DVector<uint8_t> PackedDataContainer::_get_data() const { +PoolVector<uint8_t> PackedDataContainer::_get_data() const { return data; } @@ -382,15 +382,15 @@ Variant PackedDataContainer::_iter_get(const Variant& p_iter){ void PackedDataContainer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_set_data"),&PackedDataContainer::_set_data); - ObjectTypeDB::bind_method(_MD("_get_data"),&PackedDataContainer::_get_data); - ObjectTypeDB::bind_method(_MD("_iter_init"),&PackedDataContainer::_iter_init); - ObjectTypeDB::bind_method(_MD("_iter_get"),&PackedDataContainer::_iter_get); - ObjectTypeDB::bind_method(_MD("_iter_next"),&PackedDataContainer::_iter_next); - ObjectTypeDB::bind_method(_MD("pack:Error","value"),&PackedDataContainer::pack); - ObjectTypeDB::bind_method(_MD("size"),&PackedDataContainer::size); + ClassDB::bind_method(_MD("_set_data"),&PackedDataContainer::_set_data); + ClassDB::bind_method(_MD("_get_data"),&PackedDataContainer::_get_data); + ClassDB::bind_method(_MD("_iter_init"),&PackedDataContainer::_iter_init); + ClassDB::bind_method(_MD("_iter_get"),&PackedDataContainer::_iter_get); + ClassDB::bind_method(_MD("_iter_next"),&PackedDataContainer::_iter_next); + ClassDB::bind_method(_MD("pack:Error","value"),&PackedDataContainer::pack); + ClassDB::bind_method(_MD("size"),&PackedDataContainer::size); - ADD_PROPERTY( PropertyInfo(Variant::RAW_ARRAY,"__data__"),_SCS("_set_data"),_SCS("_get_data")); + ADD_PROPERTY( PropertyInfo(Variant::POOL_BYTE_ARRAY,"__data__"),_SCS("_set_data"),_SCS("_get_data")); } @@ -426,11 +426,11 @@ bool PackedDataContainerRef::_is_dictionary() const { void PackedDataContainerRef::_bind_methods() { - ObjectTypeDB::bind_method(_MD("size"),&PackedDataContainerRef::size); - ObjectTypeDB::bind_method(_MD("_iter_init"),&PackedDataContainerRef::_iter_init); - ObjectTypeDB::bind_method(_MD("_iter_get"),&PackedDataContainerRef::_iter_get); - ObjectTypeDB::bind_method(_MD("_iter_next"),&PackedDataContainerRef::_iter_next); - ObjectTypeDB::bind_method(_MD("_is_dictionary"),&PackedDataContainerRef::_is_dictionary); + ClassDB::bind_method(_MD("size"),&PackedDataContainerRef::size); + ClassDB::bind_method(_MD("_iter_init"),&PackedDataContainerRef::_iter_init); + ClassDB::bind_method(_MD("_iter_get"),&PackedDataContainerRef::_iter_get); + ClassDB::bind_method(_MD("_iter_next"),&PackedDataContainerRef::_iter_next); + ClassDB::bind_method(_MD("_is_dictionary"),&PackedDataContainerRef::_is_dictionary); } diff --git a/core/packed_data_container.h b/core/packed_data_container.h index 9183dcb90e..f8ff43f9b0 100644 --- a/core/packed_data_container.h +++ b/core/packed_data_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ class PackedDataContainer : public Resource { - OBJ_TYPE(PackedDataContainer,Resource); + GDCLASS(PackedDataContainer,Resource); enum { TYPE_DICT=0xFFFFFFFF, @@ -50,7 +50,7 @@ class PackedDataContainer : public Resource { }; - DVector<uint8_t> data; + PoolVector<uint8_t> data; int datalen; @@ -73,8 +73,8 @@ friend class PackedDataContainerRef; protected: - void _set_data(const DVector<uint8_t>& p_data); - DVector<uint8_t> _get_data() const; + void _set_data(const PoolVector<uint8_t>& p_data); + PoolVector<uint8_t> _get_data() const; static void _bind_methods(); public: @@ -87,7 +87,7 @@ public: }; class PackedDataContainerRef : public Reference { - OBJ_TYPE(PackedDataContainerRef,Reference); + GDCLASS(PackedDataContainerRef,Reference); friend class PackedDataContainer; uint32_t offset; diff --git a/core/pair.h b/core/pair.h index 9bffc37f49..d75cbed642 100644 --- a/core/pair.h +++ b/core/pair.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,6 +34,9 @@ struct Pair { F first; S second; + + Pair() {} + Pair( F p_first, S p_second) { first=p_first; second=p_second; } }; #endif // PAIR_H diff --git a/core/path_db.cpp b/core/path_db.cpp index 132cc83a35..25f62ed951 100644 --- a/core/path_db.cpp +++ b/core/path_db.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/path_db.h b/core/path_db.h index 3a550fe1d0..db756c3420 100644 --- a/core/path_db.h +++ b/core/path_db.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/path_remap.cpp b/core/path_remap.cpp index 8f189187f2..fd5b38fa79 100644 --- a/core/path_remap.cpp +++ b/core/path_remap.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -124,13 +124,13 @@ void PathRemap::clear_remaps() { void PathRemap::load_remaps() { // default remaps first - DVector<String> remaps = Globals::get_singleton()->get("remap/all"); + PoolVector<String> remaps = GlobalConfig::get_singleton()->get("remap/all"); { int rlen = remaps.size(); ERR_FAIL_COND( rlen%2 ); - DVector<String>::Read r = remaps.read(); + PoolVector<String>::Read r = remaps.read(); for(int i=0;i<rlen/2;i++) { String from = r[i*2+0]; @@ -141,13 +141,13 @@ void PathRemap::load_remaps() { // platform remaps second, so override - remaps = Globals::get_singleton()->get("remap/"+OS::get_singleton()->get_name()); + remaps = GlobalConfig::get_singleton()->get("remap/"+OS::get_singleton()->get_name()); // remaps = Globals::get_singleton()->get("remap/PSP"); { int rlen = remaps.size(); ERR_FAIL_COND( rlen%2 ); - DVector<String>::Read r = remaps.read(); + PoolVector<String>::Read r = remaps.read(); for(int i=0;i<rlen/2;i++) { String from = r[i*2+0]; @@ -160,17 +160,17 @@ void PathRemap::load_remaps() { //locale based remaps - if (Globals::get_singleton()->has("locale/translation_remaps")) { + if (GlobalConfig::get_singleton()->has("locale/translation_remaps")) { - Dictionary remaps = Globals::get_singleton()->get("locale/translation_remaps"); + Dictionary remaps = GlobalConfig::get_singleton()->get("locale/translation_remaps"); List<Variant> rk; remaps.get_key_list(&rk); for(List<Variant>::Element *E=rk.front();E;E=E->next()) { String source = E->get(); - StringArray sa = remaps[E->get()]; + PoolStringArray sa = remaps[E->get()]; int sas = sa.size(); - StringArray::Read r = sa.read(); + PoolStringArray::Read r = sa.read(); for(int i=0;i<sas;i++) { @@ -190,11 +190,11 @@ void PathRemap::load_remaps() { void PathRemap::_bind_methods() { - ObjectTypeDB::bind_method(_MD("add_remap","from","to","locale"),&PathRemap::add_remap,DEFVAL(String())); - ObjectTypeDB::bind_method(_MD("has_remap","path"),&PathRemap::has_remap); - ObjectTypeDB::bind_method(_MD("get_remap","path"),&PathRemap::get_remap); - ObjectTypeDB::bind_method(_MD("erase_remap","path"),&PathRemap::erase_remap); - ObjectTypeDB::bind_method(_MD("clear_remaps"),&PathRemap::clear_remaps); + ClassDB::bind_method(_MD("add_remap","from","to","locale"),&PathRemap::add_remap,DEFVAL(String())); + ClassDB::bind_method(_MD("has_remap","path"),&PathRemap::has_remap); + ClassDB::bind_method(_MD("get_remap","path"),&PathRemap::get_remap); + ClassDB::bind_method(_MD("erase_remap","path"),&PathRemap::erase_remap); + ClassDB::bind_method(_MD("clear_remaps"),&PathRemap::clear_remaps); } PathRemap::PathRemap() { diff --git a/core/path_remap.h b/core/path_remap.h index 66ebe7987b..a106030f95 100644 --- a/core/path_remap.h +++ b/core/path_remap.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ class PathRemap : public Object { - OBJ_TYPE(PathRemap,Object); + GDCLASS(PathRemap,Object); static PathRemap* singleton; struct RemapData { diff --git a/core/pool_allocator.cpp b/core/pool_allocator.cpp index 9f5fcf5f50..e425218060 100644 --- a/core/pool_allocator.cpp +++ b/core/pool_allocator.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -604,7 +604,7 @@ void PoolAllocator::create_pool(void * p_mem,int p_size,int p_max_entries) { PoolAllocator::PoolAllocator(int p_size,bool p_needs_locking,int p_max_entries) { - mem_ptr=Memory::alloc_static( p_size,"PoolAllocator()"); + mem_ptr=memalloc( p_size); ERR_FAIL_COND(!mem_ptr); align=1; create_pool(mem_ptr,p_size,p_max_entries); @@ -648,7 +648,7 @@ PoolAllocator::PoolAllocator(int p_align,int p_size,bool p_needs_locking,int p_m PoolAllocator::~PoolAllocator() { if (mem_ptr) - Memory::free_static( mem_ptr ); + memfree( mem_ptr ); memdelete_arr( entry_array ); memdelete_arr( entry_indices ); diff --git a/core/pool_allocator.h b/core/pool_allocator.h index 438548bfe4..a5911688f7 100644 --- a/core/pool_allocator.h +++ b/core/pool_allocator.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/print_string.cpp b/core/print_string.cpp index b6154f1cf6..3faed62bb4 100644 --- a/core/print_string.cpp +++ b/core/print_string.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/print_string.h b/core/print_string.h index 0aa5b4c8e9..a13abd4e38 100644 --- a/core/print_string.h +++ b/core/print_string.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/ref_ptr.cpp b/core/ref_ptr.cpp index dee2b9a164..e781bae496 100644 --- a/core/ref_ptr.cpp +++ b/core/ref_ptr.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/ref_ptr.h b/core/ref_ptr.h index 68788b73cd..c9824639dc 100644 --- a/core/ref_ptr.h +++ b/core/ref_ptr.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/reference.cpp b/core/reference.cpp index 34f36a5735..69e053cc1a 100644 --- a/core/reference.cpp +++ b/core/reference.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -54,9 +54,9 @@ bool Reference::init_ref() { void Reference::_bind_methods() { - ObjectTypeDB::bind_method(_MD("init_ref"),&Reference::init_ref); - ObjectTypeDB::bind_method(_MD("reference"),&Reference::reference); - ObjectTypeDB::bind_method(_MD("unreference"),&Reference::unreference); + ClassDB::bind_method(_MD("init_ref"),&Reference::init_ref); + ClassDB::bind_method(_MD("reference"),&Reference::reference); + ClassDB::bind_method(_MD("unreference"),&Reference::unreference); } int Reference::reference_get_count() const { @@ -126,7 +126,7 @@ WeakRef::WeakRef() { void WeakRef::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_ref:Object"),&WeakRef::get_ref); + ClassDB::bind_method(_MD("get_ref:Object"),&WeakRef::get_ref); } #if 0 diff --git a/core/reference.h b/core/reference.h index 89e9627b77..ce196801bb 100644 --- a/core/reference.h +++ b/core/reference.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,7 +39,7 @@ */ class Reference : public Object{ - OBJ_TYPE( Reference, Object ); + GDCLASS( Reference, Object ); friend class RefBase; SafeRefCount refcount; SafeRefCount refcount_init; @@ -315,7 +315,7 @@ typedef Ref<Reference> REF; class WeakRef : public Reference { - OBJ_TYPE(WeakRef,Reference); + GDCLASS(WeakRef,Reference); ObjectID ref; protected: diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp index 4c9d121781..fe88d1d13d 100644 --- a/core/register_core_types.cpp +++ b/core/register_core_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,6 +34,7 @@ #include "os/main_loop.h" #include "io/packet_peer.h" #include "math/a_star.h" +#include "math/triangle_mesh.h" #include "globals.h" #include "object_type_db.h" #include "geometry.h" @@ -43,7 +44,6 @@ #include "translation.h" #include "compressed_translation.h" #include "io/translation_loader_po.h" -#include "io/resource_format_xml.h" #include "io/resource_format_binary.h" #include "io/stream_peer_ssl.h" #include "os/input.h" @@ -55,10 +55,6 @@ #include "input_map.h" #include "undo_redo.h" -#ifdef XML_ENABLED -static ResourceFormatSaverXML *resource_saver_xml=NULL; -static ResourceFormatLoaderXML *resource_loader_xml=NULL; -#endif static ResourceFormatSaverBinary *resource_saver_binary=NULL; static ResourceFormatLoaderBinary *resource_loader_binary=NULL; @@ -66,6 +62,7 @@ static ResourceFormatLoaderBinary *resource_loader_binary=NULL; static _ResourceLoader *_resource_loader=NULL; static _ResourceSaver *_resource_saver=NULL; static _OS *_os=NULL; +static _ClassDB *_classdb=NULL; static _Marshalls *_marshalls = NULL; static TranslationLoaderPO *resource_format_po=NULL; @@ -83,6 +80,9 @@ extern void unregister_variant_methods(); void register_core_types() { + ObjectDB::setup(); + ResourceCache::setup(); + MemoryPool::setup(); _global_mutex=Mutex::create(); @@ -104,54 +104,48 @@ void register_core_types() { resource_loader_binary = memnew( ResourceFormatLoaderBinary ); ResourceLoader::add_resource_format_loader(resource_loader_binary); -#ifdef XML_ENABLED - resource_saver_xml = memnew( ResourceFormatSaverXML ); - ResourceSaver::add_resource_format_saver(resource_saver_xml); - resource_loader_xml = memnew( ResourceFormatLoaderXML ); - ResourceLoader::add_resource_format_loader(resource_loader_xml); -#endif - - ObjectTypeDB::register_type<Object>(); - - - ObjectTypeDB::register_type<Reference>(); - ObjectTypeDB::register_type<WeakRef>(); - ObjectTypeDB::register_type<ResourceImportMetadata>(); - ObjectTypeDB::register_type<Resource>(); - ObjectTypeDB::register_type<FuncRef>(); - ObjectTypeDB::register_virtual_type<StreamPeer>(); - ObjectTypeDB::register_type<StreamPeerBuffer>(); - ObjectTypeDB::register_create_type<StreamPeerTCP>(); - ObjectTypeDB::register_create_type<TCP_Server>(); - ObjectTypeDB::register_create_type<PacketPeerUDP>(); - ObjectTypeDB::register_create_type<StreamPeerSSL>(); - ObjectTypeDB::register_virtual_type<IP>(); - ObjectTypeDB::register_virtual_type<PacketPeer>(); - ObjectTypeDB::register_type<PacketPeerStream>(); - ObjectTypeDB::register_type<MainLoop>(); -// ObjectTypeDB::register_type<OptimizedSaver>(); - ObjectTypeDB::register_type<Translation>(); - ObjectTypeDB::register_type<PHashTranslation>(); - ObjectTypeDB::register_type<UndoRedo>(); - ObjectTypeDB::register_type<HTTPClient>(); - - ObjectTypeDB::register_virtual_type<ResourceInteractiveLoader>(); - - ObjectTypeDB::register_type<_File>(); - ObjectTypeDB::register_type<_Directory>(); - ObjectTypeDB::register_type<_Thread>(); - ObjectTypeDB::register_type<_Mutex>(); - ObjectTypeDB::register_type<_Semaphore>(); - - ObjectTypeDB::register_type<XMLParser>(); - - ObjectTypeDB::register_type<ConfigFile>(); - - ObjectTypeDB::register_type<PCKPacker>(); - - ObjectTypeDB::register_type<PackedDataContainer>(); - ObjectTypeDB::register_virtual_type<PackedDataContainerRef>(); - ObjectTypeDB::register_type<AStar>(); + ClassDB::register_class<Object>(); + + + ClassDB::register_class<Reference>(); + ClassDB::register_class<WeakRef>(); + ClassDB::register_class<ResourceImportMetadata>(); + ClassDB::register_class<Resource>(); + ClassDB::register_class<FuncRef>(); + ClassDB::register_virtual_class<StreamPeer>(); + ClassDB::register_class<StreamPeerBuffer>(); + ClassDB::register_custom_instance_class<StreamPeerTCP>(); + ClassDB::register_custom_instance_class<TCP_Server>(); + ClassDB::register_custom_instance_class<PacketPeerUDP>(); + ClassDB::register_custom_instance_class<StreamPeerSSL>(); + ClassDB::register_virtual_class<IP>(); + ClassDB::register_virtual_class<PacketPeer>(); + ClassDB::register_class<PacketPeerStream>(); + ClassDB::register_class<MainLoop>(); +// ClassDB::register_type<OptimizedSaver>(); + ClassDB::register_class<Translation>(); + ClassDB::register_class<PHashTranslation>(); + ClassDB::register_class<UndoRedo>(); + ClassDB::register_class<HTTPClient>(); + ClassDB::register_class<TriangleMesh>(); + + ClassDB::register_virtual_class<ResourceInteractiveLoader>(); + + ClassDB::register_class<_File>(); + ClassDB::register_class<_Directory>(); + ClassDB::register_class<_Thread>(); + ClassDB::register_class<_Mutex>(); + ClassDB::register_class<_Semaphore>(); + + ClassDB::register_class<XMLParser>(); + + ClassDB::register_class<ConfigFile>(); + + ClassDB::register_class<PCKPacker>(); + + ClassDB::register_class<PackedDataContainer>(); + ClassDB::register_virtual_class<PackedDataContainerRef>(); + ClassDB::register_class<AStar>(); ip = IP::create(); @@ -162,26 +156,35 @@ void register_core_types() { _resource_loader=memnew(_ResourceLoader); _resource_saver=memnew(_ResourceSaver); _os=memnew(_OS); + _classdb=memnew(_ClassDB); _marshalls = memnew(_Marshalls); } +void register_core_settings() { + //since in register core types, globals may not e present + GLOBAL_DEF( "network/packets/packet_stream_peer_max_buffer_po2",(16)); + +} + void register_core_singletons() { - Globals::get_singleton()->add_singleton( Globals::Singleton("Globals",Globals::get_singleton()) ); - Globals::get_singleton()->add_singleton( Globals::Singleton("IP",IP::get_singleton()) ); - Globals::get_singleton()->add_singleton( Globals::Singleton("Geometry",_Geometry::get_singleton()) ); - Globals::get_singleton()->add_singleton( Globals::Singleton("ResourceLoader",_ResourceLoader::get_singleton()) ); - Globals::get_singleton()->add_singleton( Globals::Singleton("ResourceSaver",_ResourceSaver::get_singleton()) ); - Globals::get_singleton()->add_singleton( Globals::Singleton("PathRemap",PathRemap::get_singleton() ) ); - Globals::get_singleton()->add_singleton( Globals::Singleton("OS",_OS::get_singleton() ) ); - Globals::get_singleton()->add_singleton( Globals::Singleton("Marshalls",_Marshalls::get_singleton() ) ); - Globals::get_singleton()->add_singleton( Globals::Singleton("TranslationServer",TranslationServer::get_singleton() ) ); - Globals::get_singleton()->add_singleton( Globals::Singleton("TS",TranslationServer::get_singleton() ) ); - Globals::get_singleton()->add_singleton( Globals::Singleton("Input",Input::get_singleton() ) ); - Globals::get_singleton()->add_singleton( Globals::Singleton("InputMap",InputMap::get_singleton() ) ); + + GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("GlobalConfig",GlobalConfig::get_singleton()) ); + GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("IP",IP::get_singleton()) ); + GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("Geometry",_Geometry::get_singleton()) ); + GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("ResourceLoader",_ResourceLoader::get_singleton()) ); + GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("ResourceSaver",_ResourceSaver::get_singleton()) ); + GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("PathRemap",PathRemap::get_singleton() ) ); + GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("OS",_OS::get_singleton() ) ); + GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("ClassDB",_classdb ) ); + GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("Marshalls",_Marshalls::get_singleton() ) ); + GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("TranslationServer",TranslationServer::get_singleton() ) ); + GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("TS",TranslationServer::get_singleton() ) ); + GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("Input",Input::get_singleton() ) ); + GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("InputMap",InputMap::get_singleton() ) ); } @@ -193,15 +196,10 @@ void unregister_core_types() { memdelete( _resource_loader ); memdelete( _resource_saver ); memdelete( _os); + memdelete( _classdb ); memdelete( _marshalls ); memdelete( _geometry ); -#ifdef XML_ENABLED - if (resource_saver_xml) - memdelete(resource_saver_xml); - if (resource_loader_xml) - memdelete(resource_loader_xml); -#endif if (resource_saver_binary) memdelete(resource_saver_binary); @@ -219,7 +217,7 @@ void unregister_core_types() { unregister_variant_methods(); - ObjectTypeDB::cleanup(); + ClassDB::cleanup(); ResourceCache::clear(); CoreStringNames::free(); StringName::cleanup(); @@ -228,4 +226,7 @@ void unregister_core_types() { memdelete(_global_mutex); _global_mutex=NULL; //still needed at a few places }; + + MemoryPool::cleanup(); + } diff --git a/core/register_core_types.h b/core/register_core_types.h index 239d67f1ec..c664d0ebf4 100644 --- a/core/register_core_types.h +++ b/core/register_core_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,6 +34,7 @@ */ void register_core_types(); +void register_core_settings(); void register_core_singletons(); void unregister_core_types(); diff --git a/core/resource.cpp b/core/resource.cpp index e8d4069779..db4d2ec0db 100644 --- a/core/resource.cpp +++ b/core/resource.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,6 +31,7 @@ #include <stdio.h> #include "os/file_access.h" #include "io/resource_loader.h" +#include "script_language.h" void ResourceImportMetadata::set_editor(const String& p_editor) { @@ -112,9 +113,9 @@ void ResourceImportMetadata::get_options(List<String> *r_options) const { } -StringArray ResourceImportMetadata::_get_options() const { +PoolStringArray ResourceImportMetadata::_get_options() const { - StringArray option_names; + PoolStringArray option_names; option_names.resize(options.size()); int i=0; for(Map<String,Variant>::Element *E=options.front();E;E=E->next()) { @@ -127,17 +128,17 @@ StringArray ResourceImportMetadata::_get_options() const { void ResourceImportMetadata::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_editor","name"),&ResourceImportMetadata::set_editor); - ObjectTypeDB::bind_method(_MD("get_editor"),&ResourceImportMetadata::get_editor); - ObjectTypeDB::bind_method(_MD("add_source","path","md5"),&ResourceImportMetadata::add_source, ""); - ObjectTypeDB::bind_method(_MD("get_source_path","idx"),&ResourceImportMetadata::get_source_path); - ObjectTypeDB::bind_method(_MD("get_source_md5","idx"),&ResourceImportMetadata::get_source_md5); - ObjectTypeDB::bind_method(_MD("set_source_md5","idx", "md5"),&ResourceImportMetadata::set_source_md5); - ObjectTypeDB::bind_method(_MD("remove_source","idx"),&ResourceImportMetadata::remove_source); - ObjectTypeDB::bind_method(_MD("get_source_count"),&ResourceImportMetadata::get_source_count); - ObjectTypeDB::bind_method(_MD("set_option","key","value"),&ResourceImportMetadata::set_option); - ObjectTypeDB::bind_method(_MD("get_option","key"),&ResourceImportMetadata::get_option); - ObjectTypeDB::bind_method(_MD("get_options"),&ResourceImportMetadata::_get_options); + ClassDB::bind_method(_MD("set_editor","name"),&ResourceImportMetadata::set_editor); + ClassDB::bind_method(_MD("get_editor"),&ResourceImportMetadata::get_editor); + ClassDB::bind_method(_MD("add_source","path","md5"),&ResourceImportMetadata::add_source, ""); + ClassDB::bind_method(_MD("get_source_path","idx"),&ResourceImportMetadata::get_source_path); + ClassDB::bind_method(_MD("get_source_md5","idx"),&ResourceImportMetadata::get_source_md5); + ClassDB::bind_method(_MD("set_source_md5","idx", "md5"),&ResourceImportMetadata::set_source_md5); + ClassDB::bind_method(_MD("remove_source","idx"),&ResourceImportMetadata::remove_source); + ClassDB::bind_method(_MD("get_source_count"),&ResourceImportMetadata::get_source_count); + ClassDB::bind_method(_MD("set_option","key","value"),&ResourceImportMetadata::set_option); + ClassDB::bind_method(_MD("get_option","key"),&ResourceImportMetadata::get_option); + ClassDB::bind_method(_MD("get_options"),&ResourceImportMetadata::_get_options); } ResourceImportMetadata::ResourceImportMetadata() { @@ -164,17 +165,31 @@ void Resource::set_path(const String& p_path, bool p_take_over) { if (path_cache!="") { + ResourceCache::lock->write_lock(); ResourceCache::resources.erase(path_cache); + ResourceCache::lock->write_unlock(); } path_cache=""; - if (ResourceCache::resources.has( p_path )) { + + ResourceCache::lock->read_lock(); + bool has_path = ResourceCache::resources.has( p_path ); + ResourceCache::lock->read_unlock(); + + if (has_path) { if (p_take_over) { + ResourceCache::lock->write_lock(); ResourceCache::resources.get(p_path)->set_name(""); + ResourceCache::lock->write_unlock(); } else { ERR_EXPLAIN("Another resource is loaded from path: "+p_path); - ERR_FAIL_COND( ResourceCache::resources.has( p_path ) ); + + ResourceCache::lock->read_lock(); + bool exists = ResourceCache::resources.has( p_path ); + ResourceCache::lock->read_unlock(); + + ERR_FAIL_COND( exists ); } } @@ -182,10 +197,12 @@ void Resource::set_path(const String& p_path, bool p_take_over) { if (path_cache!="") { + ResourceCache::lock->write_lock(); ResourceCache::resources[path_cache]=this;; + ResourceCache::lock->write_unlock(); } - _change_notify("resource/path"); + _change_notify("resource_path"); _resource_path_changed(); } @@ -209,7 +226,7 @@ int Resource::get_subindex() const{ void Resource::set_name(const String& p_name) { name=p_name; - _change_notify("resource/name"); + _change_notify("resource_name"); } String Resource::get_name() const { @@ -229,7 +246,7 @@ void Resource::reload_from_file() { if (!path.is_resource_file()) return; - Ref<Resource> s = ResourceLoader::load(path,get_type(),true); + Ref<Resource> s = ResourceLoader::load(path,get_class(),true); if (!s.is_valid()) return; @@ -241,7 +258,7 @@ void Resource::reload_from_file() { if (!(E->get().usage&PROPERTY_USAGE_STORAGE)) continue; - if (E->get().name=="resource/path") + if (E->get().name=="resource_path") continue; //do not change path set(E->get().name,s->get(E->get().name)); @@ -250,13 +267,56 @@ void Resource::reload_from_file() { } +Ref<Resource> Resource::duplicate_for_local_scene(Node *p_for_scene, Map<Ref<Resource>, Ref<Resource> > &remap_cache) { + + + List<PropertyInfo> plist; + get_property_list(&plist); + + + Resource *r = (Resource*)ClassDB::instance(get_class()); + ERR_FAIL_COND_V(!r,Ref<Resource>()); + + r->local_scene=p_for_scene; + + for(List<PropertyInfo>::Element *E=plist.front();E;E=E->next()) { + + if (!(E->get().usage&PROPERTY_USAGE_STORAGE)) + continue; + Variant p = get(E->get().name); + if (p.get_type()==Variant::OBJECT) { + + RES sr = p; + if (sr.is_valid()) { + + if (sr->is_local_to_scene()) { + if (remap_cache.has(sr)) { + p=remap_cache[sr]; + } else { + + + RES dupe = sr->duplicate_for_local_scene(p_for_scene,remap_cache); + p=dupe; + remap_cache[sr]=dupe; + } + } + } + } + + r->set(E->get().name,p); + } + + return Ref<Resource>(r); +} + Ref<Resource> Resource::duplicate(bool p_subresources) { + List<PropertyInfo> plist; get_property_list(&plist); - Resource *r = (Resource*)ObjectTypeDB::instance(get_type()); + Resource *r = (Resource*)ClassDB::instance(get_class()); ERR_FAIL_COND_V(!r,Ref<Resource>()); for(List<PropertyInfo>::Element *E=plist.front();E;E=E->next()) { @@ -289,23 +349,6 @@ void Resource::_take_over_path(const String& p_path) { } -void Resource::_bind_methods() { - - ObjectTypeDB::bind_method(_MD("set_path","path"),&Resource::_set_path); - ObjectTypeDB::bind_method(_MD("take_over_path","path"),&Resource::_take_over_path); - ObjectTypeDB::bind_method(_MD("get_path"),&Resource::get_path); - ObjectTypeDB::bind_method(_MD("set_name","name"),&Resource::set_name); - ObjectTypeDB::bind_method(_MD("get_name"),&Resource::get_name); - ObjectTypeDB::bind_method(_MD("get_rid"),&Resource::get_rid); - ObjectTypeDB::bind_method(_MD("set_import_metadata","metadata"),&Resource::set_import_metadata); - ObjectTypeDB::bind_method(_MD("get_import_metadata"),&Resource::get_import_metadata); - - ObjectTypeDB::bind_method(_MD("duplicate","subresources"),&Resource::duplicate,DEFVAL(false)); - ADD_SIGNAL( MethodInfo("changed") ); - ADD_PROPERTY( PropertyInfo(Variant::STRING,"resource/path",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_EDITOR ), _SCS("set_path"),_SCS("get_path")); - ADD_PROPERTYNZ( PropertyInfo(Variant::STRING,"resource/name"), _SCS("set_name"),_SCS("get_name")); -} - RID Resource::get_rid() const { return RID(); @@ -377,6 +420,62 @@ uint32_t Resource::hash_edited_version() const { #endif +void Resource::set_local_to_scene(bool p_enable) { + + local_to_scene=p_enable; +} + +bool Resource::is_local_to_scene() const { + + return local_to_scene; +} + +Node* Resource::get_local_scene() const { + + if (local_scene) + return local_scene; + + if (_get_local_scene_func) { + return _get_local_scene_func(); + } + + return NULL; +} + +void Resource::setup_local_to_scene() { + + if (get_script_instance()) + get_script_instance()->call("_setup_local_to_scene"); +} + +Node* (*Resource::_get_local_scene_func)()=NULL; + + +void Resource::_bind_methods() { + + ClassDB::bind_method(_MD("set_path","path"),&Resource::_set_path); + ClassDB::bind_method(_MD("take_over_path","path"),&Resource::_take_over_path); + ClassDB::bind_method(_MD("get_path"),&Resource::get_path); + ClassDB::bind_method(_MD("set_name","name"),&Resource::set_name); + ClassDB::bind_method(_MD("get_name"),&Resource::get_name); + ClassDB::bind_method(_MD("get_rid"),&Resource::get_rid); + ClassDB::bind_method(_MD("set_import_metadata","metadata"),&Resource::set_import_metadata); + ClassDB::bind_method(_MD("get_import_metadata"),&Resource::get_import_metadata); + ClassDB::bind_method(_MD("set_local_to_scene","enable"),&Resource::set_local_to_scene); + ClassDB::bind_method(_MD("is_local_to_scene"),&Resource::is_local_to_scene); + ClassDB::bind_method(_MD("get_local_scene:Node"),&Resource::get_local_scene); + ClassDB::bind_method(_MD("setup_local_to_scene"),&Resource::setup_local_to_scene); + + ClassDB::bind_method(_MD("duplicate","subresources"),&Resource::duplicate,DEFVAL(false)); + ADD_SIGNAL( MethodInfo("changed") ); + ADD_GROUP("Resource","resource_"); + ADD_PROPERTYNZ( PropertyInfo(Variant::BOOL,"resource_local_to_scene" ), _SCS("set_local_to_scene"),_SCS("is_local_to_scene")); + ADD_PROPERTY( PropertyInfo(Variant::STRING,"resource_path",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_EDITOR ), _SCS("set_path"),_SCS("get_path")); + ADD_PROPERTYNZ( PropertyInfo(Variant::STRING,"resource_name"), _SCS("set_name"),_SCS("get_name")); + + BIND_VMETHOD( MethodInfo("_setup_local_to_scene") ); + +} Resource::Resource() { @@ -385,6 +484,7 @@ Resource::Resource() { #endif subindex=0; + local_scene=NULL; } @@ -392,8 +492,11 @@ Resource::Resource() { Resource::~Resource() { - if (path_cache!="") + if (path_cache!="") { + ResourceCache::lock->write_lock(); ResourceCache::resources.erase(path_cache); + ResourceCache::lock->write_unlock(); + } if (owners.size()) { WARN_PRINT("Resource is still owned"); } @@ -401,18 +504,24 @@ Resource::~Resource() { HashMap<String,Resource*> ResourceCache::resources; +RWLock *ResourceCache::lock=NULL; + +void ResourceCache::setup() { + + lock = RWLock::create(); +} + void ResourceCache::clear() { if (resources.size()) ERR_PRINT("Resources Still in use at Exit!"); resources.clear(); + memdelete(lock); } void ResourceCache::reload_externals() { - GLOBAL_LOCK_FUNCTION - //const String *K=NULL; //while ((K=resources.next(K))) { // resources[*K]->reload_external_data(); @@ -422,15 +531,21 @@ void ResourceCache::reload_externals() { bool ResourceCache::has(const String& p_path) { - GLOBAL_LOCK_FUNCTION + lock->read_lock();; + bool b = resources.has(p_path); + lock->read_unlock();; + - return resources.has(p_path); + return b; } Resource *ResourceCache::get(const String& p_path) { - GLOBAL_LOCK_FUNCTION + lock->read_lock(); Resource **res = resources.getptr(p_path); + + lock->read_unlock(); + if (!res) { return NULL; } @@ -442,6 +557,7 @@ Resource *ResourceCache::get(const String& p_path) { void ResourceCache::get_cached_resources(List<Ref<Resource> > *p_resources) { + lock->read_lock(); const String* K=NULL; while((K=resources.next(K))) { @@ -449,17 +565,22 @@ void ResourceCache::get_cached_resources(List<Ref<Resource> > *p_resources) { p_resources->push_back( Ref<Resource>( r )); } + lock->read_unlock(); } int ResourceCache::get_cached_resource_count() { - return resources.size(); + lock->read_lock(); + int rc = resources.size(); + lock->read_unlock(); + + return rc; } void ResourceCache::dump(const char* p_file,bool p_short) { #ifdef DEBUG_ENABLED - GLOBAL_LOCK_FUNCTION + lock->read_lock(); Map<String,int> type_count; @@ -476,16 +597,16 @@ void ResourceCache::dump(const char* p_file,bool p_short) { Resource *r = resources[*K]; - if (!type_count.has(r->get_type())) { - type_count[r->get_type()]=0; + if (!type_count.has(r->get_class())) { + type_count[r->get_class()]=0; } - type_count[r->get_type()]++; + type_count[r->get_class()]++; if (!p_short) { if (f) - f->store_line(r->get_type()+": "+r->get_path()); + f->store_line(r->get_class()+": "+r->get_path()); } } @@ -499,5 +620,7 @@ void ResourceCache::dump(const char* p_file,bool p_short) { memdelete(f); } + lock->read_unlock(); + #endif } diff --git a/core/resource.h b/core/resource.h index 0673a4e89d..284c59e1a8 100644 --- a/core/resource.h +++ b/core/resource.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -41,14 +41,14 @@ #define RES_BASE_EXTENSION(m_ext)\ public:\ -static void register_custom_data_to_otdb() { ObjectTypeDB::add_resource_base_extension(m_ext,get_type_static()); }\ +static void register_custom_data_to_otdb() { ClassDB::add_resource_base_extension(m_ext,get_class_static()); }\ virtual String get_base_extension() const { return m_ext; }\ private: class ResourceImportMetadata : public Reference { - OBJ_TYPE( ResourceImportMetadata, Reference ); + GDCLASS( ResourceImportMetadata, Reference ); struct Source { String path; @@ -60,9 +60,10 @@ class ResourceImportMetadata : public Reference { Map<String,Variant> options; - StringArray _get_options() const; + PoolStringArray _get_options() const; + protected: - virtual bool _use_builtin_script() const { return false; } + static void _bind_methods(); public: @@ -82,13 +83,14 @@ public: void get_options(List<String> *r_options) const; + ResourceImportMetadata(); }; class Resource : public Reference { - OBJ_TYPE( Resource, Reference ); + GDCLASS( Resource, Reference ); OBJ_CATEGORY("Resources"); RES_BASE_EXTENSION("res"); @@ -108,6 +110,10 @@ friend class ResourceCache; uint64_t last_modified_time; #endif + bool local_to_scene; +friend class SceneState; + Node* local_scene; + protected: void emit_changed(); @@ -121,6 +127,8 @@ protected: void _take_over_path(const String& p_path); public: + static Node* (*_get_local_scene_func)(); //used by editor + virtual bool editor_can_reload_from_file(); virtual void reload_from_file(); @@ -137,12 +145,17 @@ public: int get_subindex() const; Ref<Resource> duplicate(bool p_subresources=false); + Ref<Resource> duplicate_for_local_scene(Node *p_scene,Map<Ref<Resource>,Ref<Resource> >& remap_cache); + void set_import_metadata(const Ref<ResourceImportMetadata>& p_metadata); Ref<ResourceImportMetadata> get_import_metadata() const; + void set_local_to_scene(bool p_enable); + bool is_local_to_scene() const; + virtual void setup_local_to_scene(); - + Node* get_local_scene() const; #ifdef TOOLS_ENABLED @@ -165,9 +178,12 @@ typedef Ref<Resource> RES; class ResourceCache { friend class Resource; + static RWLock *lock; static HashMap<String,Resource*> resources; friend void unregister_core_types(); static void clear(); +friend void register_core_types(); + static void setup(); public: static void reload_externals(); diff --git a/core/rid.cpp b/core/rid.cpp index 219c2f0e69..c7e487f91a 100644 --- a/core/rid.cpp +++ b/core/rid.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -28,18 +28,16 @@ /*************************************************************************/ #include "rid.h" -static SafeRefCount current_id; -void RID_OwnerBase::init_rid() { +RID_Data::~RID_Data() { - current_id.init(1); } -ID RID_OwnerBase::new_ID() { +SafeRefCount RID_OwnerBase::refcount; - ID id = current_id.refval(); - return id; -} +void RID_OwnerBase::init_rid() { + refcount.init(); +} diff --git a/core/rid.h b/core/rid.h index 2de6956096..8dc535c9c1 100644 --- a/core/rid.h +++ b/core/rid.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,183 +33,197 @@ #include "safe_refcount.h" #include "typedefs.h" #include "os/memory.h" -#include "hash_map.h" +#include "set.h" #include "list.h" /** @author Juan Linietsky <reduzio@gmail.com> */ + class RID_OwnerBase; -typedef uint32_t ID; +class RID_Data { + +friend class RID_OwnerBase; + +#ifndef DEBUG_ENABLED + RID_OwnerBase *_owner; +#endif + uint32_t _id; +public: + _FORCE_INLINE_ uint32_t get_id() const { return _id; } + + virtual ~RID_Data(); +}; + class RID { friend class RID_OwnerBase; - ID _id; - RID_OwnerBase *owner; + + mutable RID_Data *_data; + public: - _FORCE_INLINE_ ID get_id() const { return _id; } - bool operator==(const RID& p_rid) const { + _FORCE_INLINE_ RID_Data *get_data() const { return _data; } + + _FORCE_INLINE_ bool operator==(const RID& p_rid) const { - return _id==p_rid._id; + return _data==p_rid._data; } _FORCE_INLINE_ bool operator<(const RID& p_rid) const { - return _id < p_rid._id; + return _data < p_rid._data; } _FORCE_INLINE_ bool operator<=(const RID& p_rid) const { - return _id <= p_rid._id; + return _data <= p_rid._data; } _FORCE_INLINE_ bool operator>(const RID& p_rid) const { - return _id > p_rid._id; + return _data > p_rid._data; } - bool operator!=(const RID& p_rid) const { + _FORCE_INLINE_ bool operator!=(const RID& p_rid) const { - return _id!=p_rid._id; + return _data!=p_rid._data; } - _FORCE_INLINE_ bool is_valid() const { return _id>0; } + _FORCE_INLINE_ bool is_valid() const { return _data!=NULL; } - operator const void*() const { - return is_valid() ? this : 0; - }; + _FORCE_INLINE_ uint32_t get_id() const { return _data?_data->get_id():0; } _FORCE_INLINE_ RID() { - _id = 0; - owner=0; + _data=NULL; } + }; class RID_OwnerBase { protected: -friend class RID; - void set_id(RID& p_rid, ID p_id) const { p_rid._id=p_id; } - void set_ownage(RID& p_rid) const { p_rid.owner=const_cast<RID_OwnerBase*>(this); } - ID new_ID(); + + static SafeRefCount refcount; + _FORCE_INLINE_ void _set_data(RID& p_rid, RID_Data* p_data) { + p_rid._data=p_data; + refcount.ref(); + p_data->_id=refcount.get(); +#ifndef DEBUG_ENABLED + p_data->_owner=this; +#endif + } + +#ifndef DEBUG_ENABLED + + _FORCE_INLINE_ bool _is_owner(const RID& p_rid) const { + + return this==p_rid._data->_owner; + + } + + _FORCE_INLINE_ void _remove_owner(RID& p_rid) { + + p_rid._data->_owner=NULL; + + } +# +#endif + + public: - virtual bool owns(const RID& p_rid) const=0; - virtual void get_owned_list(List<RID> *p_owned) const=0; - static void init_rid(); + virtual void get_owned_list(List<RID> *p_owned)=0; + static void init_rid(); virtual ~RID_OwnerBase() {} }; -template<class T,bool thread_safe=false> +template<class T> class RID_Owner : public RID_OwnerBase { public: - - typedef void (*ReleaseNotifyFunc)(void*user,T *p_data); -private: - - Mutex *mutex; - mutable HashMap<ID,T*> id_map; - +#ifdef DEBUG_ENABLED + mutable Set<RID_Data*> id_map; +#endif public: - RID make_rid(T * p_data) { + _FORCE_INLINE_ RID make_rid(T * p_data) { - if (thread_safe) { - mutex->lock(); - } - ID id = new_ID(); - id_map[id]=p_data; RID rid; - set_id(rid,id); - set_ownage(rid); + _set_data(rid,p_data); - if (thread_safe) { - mutex->unlock(); - } +#ifdef DEBUG_ENABLED + id_map.insert(p_data) ; +#endif return rid; } _FORCE_INLINE_ T * get(const RID& p_rid) { - if (thread_safe) { - mutex->lock(); - } - - T**elem = id_map.getptr(p_rid.get_id()); +#ifdef DEBUG_ENABLED - if (thread_safe) { - mutex->unlock(); - } - - ERR_FAIL_COND_V(!elem,NULL); - - return *elem; + ERR_FAIL_COND_V(!p_rid.is_valid(),NULL); + ERR_FAIL_COND_V(!id_map.has(p_rid.get_data()),NULL); +#endif + return static_cast<T*>(p_rid.get_data()); } - virtual bool owns(const RID& p_rid) const { + _FORCE_INLINE_ T * getornull(const RID& p_rid) { - if (thread_safe) { - mutex->lock(); - } - - T**elem = id_map.getptr(p_rid.get_id()); +#ifdef DEBUG_ENABLED - if (thread_safe) { - mutex->lock(); + if (p_rid.get_data()) { + ERR_FAIL_COND_V(!id_map.has(p_rid.get_data()),NULL); } +#endif + return static_cast<T*>(p_rid.get_data()); - return elem!=NULL; } - virtual void free(RID p_rid) { - if (thread_safe) { - mutex->lock(); - } - ERR_FAIL_COND(!owns(p_rid)); - id_map.erase(p_rid.get_id()); - } - virtual void get_owned_list(List<RID> *p_owned) const { - - if (thread_safe) { - mutex->lock(); - } + _FORCE_INLINE_ T * getptr(const RID& p_rid) { - const ID*id=NULL; - while((id=id_map.next(id))) { + return static_cast<T*>(p_rid.get_data()); - RID rid; - set_id(rid,*id); - set_ownage(rid); - p_owned->push_back(rid); + } - } - if (thread_safe) { - mutex->lock(); - } + _FORCE_INLINE_ bool owns(const RID& p_rid) const { + if (p_rid.get_data()==NULL) + return false; +#ifdef DEBUG_ENABLED + return id_map.has(p_rid.get_data()); +#else + return _is_owner(p_rid); +#endif } - RID_Owner() { - if (thread_safe) { - - mutex = Mutex::create(); - } + void free(RID p_rid) { +#ifdef DEBUG_ENABLED + id_map.erase(p_rid.get_data()); +#else + _remove_owner(p_rid); +#endif } + void get_owned_list(List<RID> *p_owned) { + - ~RID_Owner() { - if (thread_safe) { +#ifdef DEBUG_ENABLED - memdelete(mutex); + for (typename Set<RID_Data*>::Element *E=id_map.front();E;E=E->next()) { + RID r; + _set_data(r,static_cast<T*>(E->get())); + p_owned->push_back(r); } +#endif + } + }; diff --git a/core/ring_buffer.h b/core/ring_buffer.h index 7d78fac660..a4da0086e0 100644 --- a/core/ring_buffer.h +++ b/core/ring_buffer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/safe_refcount.cpp b/core/safe_refcount.cpp index 9736f96f34..ede37bbe8a 100644 --- a/core/safe_refcount.cpp +++ b/core/safe_refcount.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -29,27 +29,85 @@ #include "safe_refcount.h" +// Atomic functions, these are used for multithread safe reference counters! + +#ifdef NO_THREADS + + +uint32_t atomic_conditional_increment( register uint32_t * pw ) { + + if (*pw==0) + return 0; + + (*pw)++; + + return *pw; +} + +uint32_t atomic_decrement( register uint32_t * pw ) { + + (*pw)--; + + return *pw; + +} + +#else + #ifdef _MSC_VER // don't pollute my namespace! #include <windows.h> -long atomic_conditional_increment( register long * pw ) { +uint32_t atomic_conditional_increment( register uint32_t * pw ) { /* try to increment until it actually works */ // taken from boost while (true) { - long tmp = static_cast< long const volatile& >( *pw ); + uint32_t tmp = static_cast< uint32_t const volatile& >( *pw ); if( tmp == 0 ) - return 0; // if zero, can't add to it anymore - if( InterlockedCompareExchange( pw, tmp + 1, tmp ) == tmp ) + return 0; // if zero, can't add to it anymore + if( InterlockedCompareExchange( (LONG volatile*)pw, tmp + 1, tmp ) == tmp ) return tmp+1; } +} +uint32_t atomic_decrement( register uint32_t * pw ) { + return InterlockedDecrement( (LONG volatile*)pw ); } -long atomic_decrement( register long * pw ) { - return InterlockedDecrement( pw ); +uint32_t atomic_increment( register uint32_t * pw ) { + return InterlockedIncrement( (LONG volatile*)pw ); } +#elif defined(__GNUC__) + +uint32_t atomic_conditional_increment( register uint32_t * pw ) { + + while (true) { + uint32_t tmp = static_cast< uint32_t const volatile& >( *pw ); + if( tmp == 0 ) + return 0; // if zero, can't add to it anymore + if( __sync_val_compare_and_swap( pw, tmp, tmp + 1 ) == tmp ) + return tmp+1; + } +} + +uint32_t atomic_decrement( register uint32_t * pw ) { + + return __sync_sub_and_fetch(pw,1); + +} + +uint32_t atomic_increment( register uint32_t * pw ) { + + return __sync_add_and_fetch(pw,1); + +} + +#else + //no threads supported? +#error Must provide atomic functions for this platform or compiler! + +#endif #endif diff --git a/core/safe_refcount.h b/core/safe_refcount.h index d976458c1d..6e349d89d8 100644 --- a/core/safe_refcount.h +++ b/core/safe_refcount.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,309 +33,18 @@ /* x86/x86_64 GCC */ #include "platform_config.h" +#include "typedefs.h" -#ifdef NO_THREADS - -struct SafeRefCount { - - int count; - -public: - - // destroy() is called when weak_count_ drops to zero. - - bool ref() { //true on success - - if (count==0) - return false; - count++; - - return true; - } - - int refval() { //true on success - - if (count==0) - return 0; - count++; - return count; - } - - bool unref() { // true if must be disposed of - - if (count>0) - count--; - - return count==0; - } - - long get() const { // nothrow - - return static_cast<int const volatile &>( count ); - } - - void init(int p_value=1) { - - count=p_value; - }; - -}; - - - - - - - - -#else - -#if defined( PLATFORM_REFCOUNT ) - -#include "platform_refcount.h" - - -#elif defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) ) - -#define REFCOUNT_T volatile int -#define REFCOUNT_GET_T int const volatile& - -static inline int atomic_conditional_increment( volatile int * pw ) { - // int rv = *pw; - // if( rv != 0 ) ++*pw; - // return rv; - - int rv, tmp; - - __asm__ - ( - "movl %0, %%eax\n\t" - "0:\n\t" - "test %%eax, %%eax\n\t" - "je 1f\n\t" - "movl %%eax, %2\n\t" - "incl %2\n\t" - "lock\n\t" - "cmpxchgl %2, %0\n\t" - "jne 0b\n\t" - "1:": - "=m"( *pw ), "=&a"( rv ), "=&r"( tmp ): // outputs (%0, %1, %2) - "m"( *pw ): // input (%3) - "cc" // clobbers - ); - - return rv; -} - -static inline int atomic_decrement( volatile int *pw) { - - // return --(*pw); - - unsigned char rv; - - __asm__ - ( - "lock\n\t" - "decl %0\n\t" - "setne %1": - "=m" (*pw), "=qm" (rv): - "m" (*pw): - "memory" - ); - return static_cast<int>(rv); -} - -/* PowerPC32/64 GCC */ - -#elif ( defined( __GNUC__ ) ) && ( defined( __powerpc__ ) || defined( __ppc__ ) ) - -#define REFCOUNT_T int -#define REFCOUNT_GET_T int const volatile& - -inline int atomic_conditional_increment( int * pw ) -{ - // if( *pw != 0 ) ++*pw; - // return *pw; - - int rv; - - __asm__ - ( - "0:\n\t" - "lwarx %1, 0, %2\n\t" - "cmpwi %1, 0\n\t" - "beq 1f\n\t" - "addi %1, %1, 1\n\t" - "1:\n\t" - "stwcx. %1, 0, %2\n\t" - "bne- 0b": - - "=m"( *pw ), "=&b"( rv ): - "r"( pw ), "m"( *pw ): - "cc" - ); - - return rv; -} - - -inline int atomic_decrement( int * pw ) -{ - // return --*pw; - - int rv; - - __asm__ __volatile__ - ( - "sync\n\t" - "0:\n\t" - "lwarx %1, 0, %2\n\t" - "addi %1, %1, -1\n\t" - "stwcx. %1, 0, %2\n\t" - "bne- 0b\n\t" - "isync": - - "=m"( *pw ), "=&b"( rv ): - "r"( pw ), "m"( *pw ): - "memory", "cc" - ); - - return rv; -} - -/* CW ARM */ - -#elif defined( __GNUC__ ) && ( defined( __arm__ ) ) - -#define REFCOUNT_T int -#define REFCOUNT_GET_T int const volatile& - -inline int atomic_conditional_increment(volatile int* v) -{ - int t; - int tmp; - - __asm__ __volatile__( - "1: ldrex %0, [%2] \n" - " cmp %0, #0 \n" - " beq 2f \n" - " add %0, %0, #1 \n" - "2: \n" - " strex %1, %0, [%2] \n" - " cmp %1, #0 \n" - " bne 1b \n" - - : "=&r" (t), "=&r" (tmp) - : "r" (v) - : "cc", "memory"); - - return t; -} - - -inline int atomic_decrement(volatile int* v) -{ - int t; - int tmp; - - __asm__ __volatile__( - "1: ldrex %0, [%2] \n" - " add %0, %0, #-1 \n" - " strex %1, %0, [%2] \n" - " cmp %1, #0 \n" - " bne 1b \n" - - : "=&r" (t), "=&r" (tmp) - : "r" (v) - : "cc", "memory"); - - return t; -} - - - -/* CW PPC */ - -#elif ( defined( __MWERKS__ ) ) && defined( __POWERPC__ ) - -inline long atomic_conditional_increment( register long * pw ) -{ - register int a; - - asm - { - loop: - - lwarx a, 0, pw - cmpwi a, 0 - beq store - - addi a, a, 1 - - store: - - stwcx. a, 0, pw - bne- loop - } - - return a; -} - - -inline long atomic_decrement( register long * pw ) -{ - register int a; - - asm { - - sync - - loop: - - lwarx a, 0, pw - addi a, a, -1 - stwcx. a, 0, pw - bne- loop - - isync - } - - return a; -} - -/* Any Windows (MSVC) */ - -#elif defined( _MSC_VER ) - -// made functions to not pollute namespace.. - -#define REFCOUNT_T long -#define REFCOUNT_GET_T long const volatile& - -long atomic_conditional_increment( register long * pw ); -long atomic_decrement( register long * pw ); - -#if 0 -#elif defined( __GNUC__ ) && defined( ARMV6_ENABLED) - - -#endif - - - - -#else - -#error This platform cannot use safe refcount, compile with NO_THREADS or implement it. - -#endif +uint32_t atomic_conditional_increment( register uint32_t * counter ); +uint32_t atomic_decrement( register uint32_t * pw ); +uint32_t atomic_increment( register uint32_t * pw ); struct SafeRefCount { - REFCOUNT_T count; + uint32_t count; public: @@ -346,7 +55,7 @@ public: return atomic_conditional_increment( &count ) != 0; } - int refval() { //true on success + uint32_t refval() { //true on success return atomic_conditional_increment( &count ); } @@ -360,20 +69,18 @@ public: return false; } - long get() const { // nothrow + uint32_t get() const { // nothrow - return static_cast<REFCOUNT_GET_T>( count ); + return count; } - void init(int p_value=1) { + void init(uint32_t p_value=1) { count=p_value; - }; + } }; -#endif // no thread safe - #endif diff --git a/core/script_debugger_local.cpp b/core/script_debugger_local.cpp index dfff54378a..a8d77668f5 100644 --- a/core/script_debugger_local.cpp +++ b/core/script_debugger_local.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/script_debugger_local.h b/core/script_debugger_local.h index ffe8dce445..6e2057ef45 100644 --- a/core/script_debugger_local.h +++ b/core/script_debugger_local.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp index 6d685d3c43..62fcd5247f 100644 --- a/core/script_debugger_remote.cpp +++ b/core/script_debugger_remote.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -134,7 +134,7 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script,bool p_can_continue) { ERR_FAIL(); } - OS::get_singleton()->enable_for_stealing_focus(Globals::get_singleton()->get("editor_pid")); + OS::get_singleton()->enable_for_stealing_focus(GlobalConfig::get_singleton()->get("editor_pid")); packet_peer_stream->put_var("debug_enter"); packet_peer_stream->put_var(2); @@ -575,8 +575,8 @@ void ScriptDebuggerRemote::_send_object_id(ObjectID p_id) { packet_peer_stream->put_var("message:inspect_object"); packet_peer_stream->put_var(props_to_send*5+4); packet_peer_stream->put_var(p_id); - packet_peer_stream->put_var(obj->get_type()); - if (obj->is_type("Resource") || obj->is_type("Node")) + packet_peer_stream->put_var(obj->get_class()); + if (obj->is_class("Resource") || obj->is_class("Node")) packet_peer_stream->put_var(obj->call("get_path")); else packet_peer_stream->put_var(""); @@ -1009,12 +1009,12 @@ ScriptDebuggerRemote::ScriptDebuggerRemote() { phl.userdata=this; add_print_handler(&phl); requested_quit=false; - performance = Globals::get_singleton()->get_singleton_object("Performance"); + performance = GlobalConfig::get_singleton()->get_singleton_object("Performance"); last_perf_time=0; poll_every=0; request_scene_tree=NULL; live_edit_funcs=NULL; - max_cps = GLOBAL_DEF("debug/max_remote_stdout_chars_per_second",2048); + max_cps = GLOBAL_DEF("network/debug/max_remote_stdout_chars_per_second",2048); char_count=0; msec_count=0; last_msec=0; @@ -1024,7 +1024,7 @@ ScriptDebuggerRemote::ScriptDebuggerRemote() { eh.userdata=this; add_error_handler(&eh); - profile_info.resize(CLAMP(int(Globals::get_singleton()->get("debug/profiler_max_functions")),128,65535)); + profile_info.resize(CLAMP(int(GlobalConfig::get_singleton()->get("debug/profiler/max_functions")),128,65535)); profile_info_ptrs.resize(profile_info.size()); profiling=false; max_frame_functions=16; diff --git a/core/script_debugger_remote.h b/core/script_debugger_remote.h index c6a00e189f..4b991e2f0c 100644 --- a/core/script_debugger_remote.h +++ b/core/script_debugger_remote.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/script_language.cpp b/core/script_language.cpp index fa1d01d3eb..52ae181c32 100644 --- a/core/script_language.cpp +++ b/core/script_language.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -46,13 +46,13 @@ void Script::_notification( int p_what) { void Script::_bind_methods() { - ObjectTypeDB::bind_method(_MD("can_instance"),&Script::can_instance); - //ObjectTypeDB::bind_method(_MD("instance_create","base_object"),&Script::instance_create); - ObjectTypeDB::bind_method(_MD("instance_has","base_object"),&Script::instance_has); - ObjectTypeDB::bind_method(_MD("has_source_code"),&Script::has_source_code); - ObjectTypeDB::bind_method(_MD("get_source_code"),&Script::get_source_code); - ObjectTypeDB::bind_method(_MD("set_source_code","source"),&Script::set_source_code); - ObjectTypeDB::bind_method(_MD("reload","keep_state"),&Script::reload,DEFVAL(false)); + ClassDB::bind_method(_MD("can_instance"),&Script::can_instance); + //ClassDB::bind_method(_MD("instance_create","base_object"),&Script::instance_create); + ClassDB::bind_method(_MD("instance_has","base_object"),&Script::instance_has); + ClassDB::bind_method(_MD("has_source_code"),&Script::has_source_code); + ClassDB::bind_method(_MD("get_source_code"),&Script::get_source_code); + ClassDB::bind_method(_MD("set_source_code","source"),&Script::set_source_code); + ClassDB::bind_method(_MD("reload","keep_state"),&Script::reload,DEFVAL(false)); } diff --git a/core/script_language.h b/core/script_language.h index 53af4c74d1..fd96541b18 100644 --- a/core/script_language.h +++ b/core/script_language.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -77,7 +77,7 @@ class PlaceHolderScriptInstance; class Script : public Resource { - OBJ_TYPE( Script, Resource ); + GDCLASS( Script, Resource ); OBJ_SAVE_TYPE( Script ); protected: @@ -207,7 +207,7 @@ public: virtual Script *create_script() const=0; virtual bool has_named_classes() const=0; virtual int find_function(const String& p_function,const String& p_code) const=0; - virtual String make_function(const String& p_class,const String& p_name,const StringArray& p_args) const=0; + virtual String make_function(const String& p_class,const String& p_name,const PoolStringArray& p_args) const=0; virtual Error complete_code(const String& p_code, const String& p_base_path, Object*p_owner,List<String>* r_options,String& r_call_hint) { return ERR_UNAVAILABLE; } diff --git a/core/self_list.h b/core/self_list.h index bfdcfbfbc2..aec3c33adc 100644 --- a/core/self_list.h +++ b/core/self_list.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/set.h b/core/set.h index d4d19129d4..9da2887671 100644 --- a/core/set.h +++ b/core/set.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/simple_type.h b/core/simple_type.h index 1754deec71..6d4a1ba455 100644 --- a/core/simple_type.h +++ b/core/simple_type.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/sort.h b/core/sort.h index 2070065a0d..fd3b57251a 100644 --- a/core/sort.h +++ b/core/sort.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/string_db.cpp b/core/string_db.cpp index bf92c4eac4..be35a44ed1 100644 --- a/core/string_db.cpp +++ b/core/string_db.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -41,9 +41,12 @@ StringName _scs_create(const char *p_chr) { } bool StringName::configured=false; +Mutex* StringName::lock=NULL; void StringName::setup() { + lock = Mutex::create(); + ERR_FAIL_COND(configured); for(int i=0;i<STRING_TABLE_LEN;i++) { @@ -54,7 +57,8 @@ void StringName::setup() { void StringName::cleanup() { - _global_lock(); + lock->lock(); + int lost_strings=0; for(int i=0;i<STRING_TABLE_LEN;i++) { @@ -78,7 +82,9 @@ void StringName::cleanup() { if (OS::get_singleton()->is_stdout_verbose() && lost_strings) { print_line("StringName: "+itos(lost_strings)+" unclaimed string names at exit."); } - _global_unlock(); + lock->unlock(); + + memdelete(lock); } void StringName::unref() { @@ -87,7 +93,7 @@ void StringName::unref() { if (_data && _data->refcount.unref()) { - _global_lock(); + lock->lock(); if (_data->prev) { _data->prev->next=_data->next; @@ -103,7 +109,7 @@ void StringName::unref() { } memdelete(_data); - _global_unlock(); + lock->unlock(); } _data=NULL; @@ -186,7 +192,7 @@ StringName::StringName(const char *p_name) { if (!p_name || p_name[0]==0) return; //empty, ignore - _global_lock(); + lock->lock(); uint32_t hash = String::hash(p_name); @@ -206,7 +212,7 @@ StringName::StringName(const char *p_name) { if (_data) { if (_data->refcount.ref()) { // exists - _global_unlock(); + lock->unlock(); return; } else { @@ -226,8 +232,7 @@ StringName::StringName(const char *p_name) { _table[idx]=_data; - _global_unlock(); - + lock->unlock(); } StringName::StringName(const StaticCString& p_static_string) { @@ -238,7 +243,7 @@ StringName::StringName(const StaticCString& p_static_string) { ERR_FAIL_COND( !p_static_string.ptr || !p_static_string.ptr[0]); - _global_lock(); + lock->lock(); uint32_t hash = String::hash(p_static_string.ptr); @@ -258,7 +263,7 @@ StringName::StringName(const StaticCString& p_static_string) { if (_data) { if (_data->refcount.ref()) { // exists - _global_unlock(); + lock->unlock(); return; } else { @@ -278,7 +283,8 @@ StringName::StringName(const StaticCString& p_static_string) { _table[idx]=_data; - _global_unlock(); + lock->unlock(); + } @@ -292,7 +298,7 @@ StringName::StringName(const String& p_name) { if (p_name==String()) return; - _global_lock(); + lock->lock(); uint32_t hash = p_name.hash(); @@ -311,7 +317,7 @@ StringName::StringName(const String& p_name) { if (_data) { if (_data->refcount.ref()) { // exists - _global_unlock(); + lock->unlock(); return; } else { @@ -332,7 +338,7 @@ StringName::StringName(const String& p_name) { _table[idx]->prev=_data; _table[idx]=_data; - _global_unlock(); + lock->unlock(); } @@ -344,7 +350,7 @@ StringName StringName::search(const char *p_name) { if (!p_name[0]) return StringName(); - _global_lock(); + lock->lock(); uint32_t hash = String::hash(p_name); @@ -361,12 +367,13 @@ StringName StringName::search(const char *p_name) { } if (_data && _data->refcount.ref()) { - _global_unlock(); + lock->unlock(); + return StringName(_data); } - _global_unlock(); + lock->unlock(); return StringName(); //does not exist @@ -380,7 +387,7 @@ StringName StringName::search(const CharType *p_name) { if (!p_name[0]) return StringName(); - _global_lock(); + lock->lock(); uint32_t hash = String::hash(p_name); @@ -397,12 +404,12 @@ StringName StringName::search(const CharType *p_name) { } if (_data && _data->refcount.ref()) { - _global_unlock(); + lock->unlock(); return StringName(_data); } - _global_unlock(); + lock->unlock(); return StringName(); //does not exist } @@ -410,7 +417,7 @@ StringName StringName::search(const String &p_name) { ERR_FAIL_COND_V( p_name=="", StringName() ); - _global_lock(); + lock->lock(); uint32_t hash = p_name.hash(); @@ -427,12 +434,12 @@ StringName StringName::search(const String &p_name) { } if (_data && _data->refcount.ref()) { - _global_unlock(); + lock->unlock(); return StringName(_data); } - _global_unlock(); + lock->unlock(); return StringName(); //does not exist } diff --git a/core/string_db.h b/core/string_db.h index 43bcccc902..a14cdbc7ba 100644 --- a/core/string_db.h +++ b/core/string_db.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,7 +32,7 @@ #include "hash_map.h" #include "ustring.h" #include "safe_refcount.h" - +#include "os/mutex.h" /** @author Juan Linietsky <reduzio@gmail.com> */ @@ -83,6 +83,7 @@ class StringName { friend void register_core_types(); friend void unregister_core_types(); + static Mutex *lock; static void setup(); static void cleanup(); static bool configured; diff --git a/core/translation.cpp b/core/translation.cpp index 4d81073fe6..5215e5f6d1 100644 --- a/core/translation.cpp +++ b/core/translation.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -292,6 +292,7 @@ static const char* locale_list[]={ "pa_PK", // Panjabi (Pakistan) "pl", // Polish "pl_PL", // Polish (Poland) +"pr", // Pirate "ps_AF", // Pushto (Afghanistan) "pt", // Portuguese "pt_BR", // Portuguese (Brazil) @@ -308,6 +309,7 @@ static const char* locale_list[]={ "sa_IN", // Sanskrit (India) "sat_IN", // Santali (India) "sc_IT", // Sardinian (Italy) +"sco", // Scots "sd_IN", // Sindhi (India) "se_NO", // Northern Sami (Norway) "sgs_LT", // Samogitian (Lithuania) @@ -650,6 +652,7 @@ static const char* locale_names[]={ "Panjabi (Pakistan)", "Polish", "Polish (Poland)", +"Pirate", "Pushto (Afghanistan)", "Portuguese", "Portuguese (Brazil)", @@ -797,9 +800,9 @@ static bool is_valid_locale(const String& p_locale) { return false; } -DVector<String> Translation::_get_messages() const { +PoolVector<String> Translation::_get_messages() const { - DVector<String> msgs; + PoolVector<String> msgs; msgs.resize(translation_map.size()*2); int idx=0; for (const Map<StringName, StringName>::Element *E=translation_map.front();E;E=E->next()) { @@ -812,9 +815,9 @@ DVector<String> Translation::_get_messages() const { return msgs; } -DVector<String> Translation::_get_message_list() const { +PoolVector<String> Translation::_get_message_list() const { - DVector<String> msgs; + PoolVector<String> msgs; msgs.resize(translation_map.size()); int idx=0; for (const Map<StringName, StringName>::Element *E=translation_map.front();E;E=E->next()) { @@ -827,12 +830,12 @@ DVector<String> Translation::_get_message_list() const { } -void Translation::_set_messages(const DVector<String>& p_messages){ +void Translation::_set_messages(const PoolVector<String>& p_messages){ int msg_count=p_messages.size(); ERR_FAIL_COND(msg_count%2); - DVector<String>::Read r = p_messages.read(); + PoolVector<String>::Read r = p_messages.read(); for(int i=0;i<msg_count;i+=2) { @@ -896,17 +899,17 @@ int Translation::get_message_count() const { void Translation::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_locale","locale"),&Translation::set_locale); - ObjectTypeDB::bind_method(_MD("get_locale"),&Translation::get_locale); - ObjectTypeDB::bind_method(_MD("add_message","src_message","xlated_message"),&Translation::add_message); - ObjectTypeDB::bind_method(_MD("get_message","src_message"),&Translation::get_message); - ObjectTypeDB::bind_method(_MD("erase_message","src_message"),&Translation::erase_message); - ObjectTypeDB::bind_method(_MD("get_message_list"),&Translation::_get_message_list); - ObjectTypeDB::bind_method(_MD("get_message_count"),&Translation::get_message_count); - ObjectTypeDB::bind_method(_MD("_set_messages"),&Translation::_set_messages); - ObjectTypeDB::bind_method(_MD("_get_messages"),&Translation::_get_messages); - - ADD_PROPERTY( PropertyInfo(Variant::STRING_ARRAY,"messages",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_messages"), _SCS("_get_messages") ); + ClassDB::bind_method(_MD("set_locale","locale"),&Translation::set_locale); + ClassDB::bind_method(_MD("get_locale"),&Translation::get_locale); + ClassDB::bind_method(_MD("add_message","src_message","xlated_message"),&Translation::add_message); + ClassDB::bind_method(_MD("get_message","src_message"),&Translation::get_message); + ClassDB::bind_method(_MD("erase_message","src_message"),&Translation::erase_message); + ClassDB::bind_method(_MD("get_message_list"),&Translation::_get_message_list); + ClassDB::bind_method(_MD("get_message_count"),&Translation::get_message_count); + ClassDB::bind_method(_MD("_set_messages"),&Translation::_set_messages); + ClassDB::bind_method(_MD("_get_messages"),&Translation::_get_messages); + + ADD_PROPERTY( PropertyInfo(Variant::POOL_STRING_ARRAY,"messages",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_messages"), _SCS("_get_messages") ); ADD_PROPERTY( PropertyInfo(Variant::STRING,"locale"), _SCS("set_locale"), _SCS("get_locale") ); } @@ -936,6 +939,10 @@ void TranslationServer::set_locale(const String& p_locale) { else { locale=univ_locale; } + + if (OS::get_singleton()->get_main_loop()) { + OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_TRANSLATION_CHANGED); + } } String TranslationServer::get_locale() const { @@ -1045,13 +1052,13 @@ TranslationServer *TranslationServer::singleton=NULL; bool TranslationServer::_load_translations(const String& p_from) { - if (Globals::get_singleton()->has(p_from)) { - DVector<String> translations=Globals::get_singleton()->get(p_from); + if (GlobalConfig::get_singleton()->has(p_from)) { + PoolVector<String> translations=GlobalConfig::get_singleton()->get(p_from); int tcount=translations.size(); if (tcount) { - DVector<String>::Read r = translations.read(); + PoolVector<String>::Read r = translations.read(); for(int i=0;i<tcount;i++) { @@ -1087,7 +1094,7 @@ void TranslationServer::setup() { options+=locale_list[idx]; idx++; } - Globals::get_singleton()->set_custom_property_info("locale/fallback",PropertyInfo(Variant::STRING,"locale/fallback",PROPERTY_HINT_ENUM,options)); + GlobalConfig::get_singleton()->set_custom_property_info("locale/fallback",PropertyInfo(Variant::STRING,"locale/fallback",PROPERTY_HINT_ENUM,options)); } #endif //load translations @@ -1114,15 +1121,15 @@ StringName TranslationServer::tool_translate(const StringName& p_message) const void TranslationServer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_locale","locale"),&TranslationServer::set_locale); - ObjectTypeDB::bind_method(_MD("get_locale"),&TranslationServer::get_locale); + ClassDB::bind_method(_MD("set_locale","locale"),&TranslationServer::set_locale); + ClassDB::bind_method(_MD("get_locale"),&TranslationServer::get_locale); - ObjectTypeDB::bind_method(_MD("translate","message"),&TranslationServer::translate); + ClassDB::bind_method(_MD("translate","message"),&TranslationServer::translate); - ObjectTypeDB::bind_method(_MD("add_translation","translation:Translation"),&TranslationServer::add_translation); - ObjectTypeDB::bind_method(_MD("remove_translation","translation:Translation"),&TranslationServer::remove_translation); + ClassDB::bind_method(_MD("add_translation","translation:Translation"),&TranslationServer::add_translation); + ClassDB::bind_method(_MD("remove_translation","translation:Translation"),&TranslationServer::remove_translation); - ObjectTypeDB::bind_method(_MD("clear"),&TranslationServer::clear); + ClassDB::bind_method(_MD("clear"),&TranslationServer::clear); } diff --git a/core/translation.h b/core/translation.h index cdb22bfeca..85ab4a229d 100644 --- a/core/translation.h +++ b/core/translation.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,17 +35,17 @@ class Translation : public Resource { - OBJ_TYPE( Translation, Resource ); + GDCLASS( Translation, Resource ); OBJ_SAVE_TYPE( Translation ); RES_BASE_EXTENSION("xl"); String locale; Map<StringName, StringName> translation_map; - DVector<String> _get_message_list() const; + PoolVector<String> _get_message_list() const; - DVector<String> _get_messages() const; - void _set_messages(const DVector<String>& p_messages); + PoolVector<String> _get_messages() const; + void _set_messages(const PoolVector<String>& p_messages); protected: static void _bind_methods(); @@ -68,7 +68,7 @@ public: class TranslationServer : public Object { - OBJ_TYPE(TranslationServer, Object); + GDCLASS(TranslationServer, Object); String locale; String fallback; diff --git a/core/typedefs.h b/core/typedefs.h index 30a75e66da..176c77570d 100644 --- a/core/typedefs.h +++ b/core/typedefs.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -77,10 +77,6 @@ #endif -#ifndef DEFAULT_ALIGNMENT -#define DEFAULT_ALIGNMENT 1 -#endif - //custom, gcc-safe offsetof, because gcc complains a lot. template<class T> diff --git a/core/ucaps.h b/core/ucaps.h index cf42e96b4f..55b6509269 100644 --- a/core/ucaps.h +++ b/core/ucaps.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/undo_redo.cpp b/core/undo_redo.cpp index e8a71d4991..acb262d400 100644 --- a/core/undo_redo.cpp +++ b/core/undo_redo.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -27,7 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "undo_redo.h" - +#include "os/os.h" void UndoRedo::_discard_redo() { @@ -54,12 +54,14 @@ void UndoRedo::_discard_redo() { void UndoRedo::create_action(const String& p_name,MergeMode p_mode) { + uint32_t ticks = OS::get_singleton()->get_ticks_msec(); + if (action_level==0) { _discard_redo(); // Check if the merge operation is valid - if (p_mode!=MERGE_DISABLE && actions.size() && actions[actions.size()-1].name==p_name) { + if (p_mode!=MERGE_DISABLE && actions.size() && actions[actions.size()-1].name==p_name && actions[actions.size()-1].last_tick+800 > ticks) { current_action=actions.size()-2; @@ -83,12 +85,15 @@ void UndoRedo::create_action(const String& p_name,MergeMode p_mode) { } } + actions[actions.size()-1].last_tick=ticks; + merge_mode=p_mode; } else { Action new_action; new_action.name=p_name; + new_action.last_tick=ticks; actions.push_back(new_action); merge_mode=MERGE_DISABLE; @@ -479,11 +484,11 @@ Variant UndoRedo::_add_undo_method(const Variant** p_args, int p_argcount, Varia void UndoRedo::_bind_methods() { - ObjectTypeDB::bind_method(_MD("create_action","name","merge_mode"),&UndoRedo::create_action, DEFVAL(MERGE_DISABLE) ); - ObjectTypeDB::bind_method(_MD("commit_action"),&UndoRedo::commit_action); + ClassDB::bind_method(_MD("create_action","name","merge_mode"),&UndoRedo::create_action, DEFVAL(MERGE_DISABLE) ); + ClassDB::bind_method(_MD("commit_action"),&UndoRedo::commit_action); - //ObjectTypeDB::bind_method(_MD("add_do_method","p_object", "p_method", "VARIANT_ARG_LIST"),&UndoRedo::add_do_method); - //ObjectTypeDB::bind_method(_MD("add_undo_method","p_object", "p_method", "VARIANT_ARG_LIST"),&UndoRedo::add_undo_method); + //ClassDB::bind_method(_MD("add_do_method","p_object", "p_method", "VARIANT_ARG_LIST"),&UndoRedo::add_do_method); + //ClassDB::bind_method(_MD("add_undo_method","p_object", "p_method", "VARIANT_ARG_LIST"),&UndoRedo::add_undo_method); { MethodInfo mi; @@ -492,7 +497,7 @@ void UndoRedo::_bind_methods() { mi.arguments.push_back( PropertyInfo( Variant::STRING, "method")); - ObjectTypeDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"add_do_method",&UndoRedo::_add_do_method,mi); + ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"add_do_method",&UndoRedo::_add_do_method,mi); } { @@ -502,16 +507,16 @@ void UndoRedo::_bind_methods() { mi.arguments.push_back( PropertyInfo( Variant::STRING, "method")); - ObjectTypeDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"add_undo_method",&UndoRedo::_add_undo_method,mi); + ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"add_undo_method",&UndoRedo::_add_undo_method,mi); } - ObjectTypeDB::bind_method(_MD("add_do_property","object", "property", "value:Variant"),&UndoRedo::add_do_property); - ObjectTypeDB::bind_method(_MD("add_undo_property","object", "property", "value:Variant"),&UndoRedo::add_undo_property); - ObjectTypeDB::bind_method(_MD("add_do_reference","object"),&UndoRedo::add_do_reference); - ObjectTypeDB::bind_method(_MD("add_undo_reference","object"),&UndoRedo::add_undo_reference); - ObjectTypeDB::bind_method(_MD("clear_history"),&UndoRedo::clear_history); - ObjectTypeDB::bind_method(_MD("get_current_action_name"),&UndoRedo::get_current_action_name); - ObjectTypeDB::bind_method(_MD("get_version"),&UndoRedo::get_version); + ClassDB::bind_method(_MD("add_do_property","object", "property", "value:Variant"),&UndoRedo::add_do_property); + ClassDB::bind_method(_MD("add_undo_property","object", "property", "value:Variant"),&UndoRedo::add_undo_property); + ClassDB::bind_method(_MD("add_do_reference","object"),&UndoRedo::add_do_reference); + ClassDB::bind_method(_MD("add_undo_reference","object"),&UndoRedo::add_undo_reference); + ClassDB::bind_method(_MD("clear_history"),&UndoRedo::clear_history); + ClassDB::bind_method(_MD("get_current_action_name"),&UndoRedo::get_current_action_name); + ClassDB::bind_method(_MD("get_version"),&UndoRedo::get_version); BIND_CONSTANT(MERGE_DISABLE); BIND_CONSTANT(MERGE_ENDS); diff --git a/core/undo_redo.h b/core/undo_redo.h index 208eb6ed5e..7664cf7cb5 100644 --- a/core/undo_redo.h +++ b/core/undo_redo.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ class UndoRedo : public Object { - OBJ_TYPE(UndoRedo,Object); + GDCLASS(UndoRedo,Object); OBJ_SAVE_TYPE( UndoRedo ); public: @@ -76,6 +76,7 @@ private: String name; List<Operation> do_ops; List<Operation> undo_ops; + uint64_t last_tick; }; Vector<Action> actions; diff --git a/core/ustring.cpp b/core/ustring.cpp index f9c10615b3..27bb8eac72 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -612,6 +612,8 @@ String String::get_slicec(CharType p_splitter, int p_slice) const { if (p_slice==count) { return substr(prev,i-prev); + } else if (c[i]==0) { + return String(); } else { count++; prev=i+1; @@ -1545,20 +1547,20 @@ String::String(const StrRange& p_range) { int String::hex_to_int(bool p_with_prefix) const { - int l = length(); + int l = length(); if (p_with_prefix && l<3) return 0; - const CharType *s=ptr(); + const CharType *s=ptr(); - int sign = s[0]=='-' ? -1 : 1; + int sign = s[0]=='-' ? -1 : 1; - if (sign<0) { - s++; - l--; + if (sign<0) { + s++; + l--; if (p_with_prefix && l<2) - return 0; - } + return 0; + } if (p_with_prefix) { if (s[0]!='0' || s[1]!='x') @@ -1567,26 +1569,74 @@ int String::hex_to_int(bool p_with_prefix) const { l-=2; }; - int hex=0; + int hex=0; - while(*s) { + while(*s) { - CharType c = LOWERCASE(*s); - int n; - if (c>='0' && c<='9') { - n=c-'0'; - } else if (c>='a' && c<='f') { - n=(c-'a')+10; - } else { - return 0; - } + CharType c = LOWERCASE(*s); + int n; + if (c>='0' && c<='9') { + n=c-'0'; + } else if (c>='a' && c<='f') { + n=(c-'a')+10; + } else { + return 0; + } - hex*=16; - hex+=n; - s++; - } + hex*=16; + hex+=n; + s++; + } + + return hex*sign; + +} + + +int64_t String::hex_to_int64(bool p_with_prefix) const { + + int l = length(); + if (p_with_prefix && l<3) + return 0; + + const CharType *s=ptr(); + + int64_t sign = s[0]=='-' ? -1 : 1; + + if (sign<0) { + s++; + l--; + if (p_with_prefix && l<2) + return 0; + } + + if (p_with_prefix) { + if (s[0]!='0' || s[1]!='x') + return 0; + s+=2; + l-=2; + }; + + int64_t hex=0; + + while(*s) { + + CharType c = LOWERCASE(*s); + int64_t n; + if (c>='0' && c<='9') { + n=c-'0'; + } else if (c>='a' && c<='f') { + n=(c-'a')+10; + } else { + return 0; + } + + hex*=16; + hex+=n; + s++; + } - return hex*sign; + return hex*sign; } diff --git a/core/ustring.h b/core/ustring.h index 452f252857..9a145143d0 100644 --- a/core/ustring.h +++ b/core/ustring.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -147,6 +147,7 @@ public: int hex_to_int(bool p_with_prefix = true) const; int to_int() const; + int64_t hex_to_int64(bool p_with_prefix = true) const; int64_t to_int64() const; static int to_int(const char* p_str, int p_len=-1); static double to_double(const char* p_str); diff --git a/core/variant.cpp b/core/variant.cpp index b2afc9d080..4ab46edf75 100644 --- a/core/variant.cpp +++ b/core/variant.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -74,9 +74,9 @@ String Variant::get_type_name(Variant::Type p_type) { return "Rect2"; } break; - case MATRIX32: { + case TRANSFORM2D: { - return "Matrix32"; + return "Transform2D"; } break; case VECTOR3: { @@ -92,18 +92,18 @@ String Variant::get_type_name(Variant::Type p_type) { } break;*/ - case _AABB: { + case RECT3: { - return "AABB"; + return "Rect3"; } break; case QUAT: { return "Quat"; } break; - case MATRIX3: { + case BASIS: { - return "Matrix3"; + return "Basis"; } break; case TRANSFORM: { @@ -153,38 +153,38 @@ String Variant::get_type_name(Variant::Type p_type) { } break; // arrays - case RAW_ARRAY: { + case POOL_BYTE_ARRAY: { - return "RawArray"; + return "PoolByteArray"; } break; - case INT_ARRAY: { + case POOL_INT_ARRAY: { - return "IntArray"; + return "PoolIntArray"; } break; - case REAL_ARRAY: { + case POOL_REAL_ARRAY: { - return "RealArray"; + return "PoolFloatArray"; } break; - case STRING_ARRAY: { + case POOL_STRING_ARRAY: { - return "StringArray"; + return "PoolStringArray"; } break; - case VECTOR2_ARRAY: { + case POOL_VECTOR2_ARRAY: { - return "Vector2Array"; + return "PoolVector2Array"; } break; - case VECTOR3_ARRAY: { + case POOL_VECTOR3_ARRAY: { - return "Vector3Array"; + return "PoolVector3Array"; } break; - case COLOR_ARRAY: { + case POOL_COLOR_ARRAY: { - return "ColorArray"; + return "PoolColorArray"; } break; default: {} @@ -255,7 +255,7 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) { invalid_types=invalid; } break; - case MATRIX32: { + case TRANSFORM2D: { static const Type valid[]={ @@ -268,14 +268,14 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) { case QUAT: { static const Type valid[]={ - MATRIX3, + BASIS, NIL }; valid_types=valid; } break; - case MATRIX3: { + case BASIS: { static const Type valid[]={ QUAT, @@ -289,9 +289,9 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) { case TRANSFORM: { static const Type valid[]={ - MATRIX32, + TRANSFORM2D, QUAT, - MATRIX3, + BASIS, NIL }; @@ -341,20 +341,20 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) { static const Type valid[]={ - RAW_ARRAY, - INT_ARRAY, - STRING_ARRAY, - REAL_ARRAY, - COLOR_ARRAY, - VECTOR2_ARRAY, - VECTOR3_ARRAY, + POOL_BYTE_ARRAY, + POOL_INT_ARRAY, + POOL_STRING_ARRAY, + POOL_REAL_ARRAY, + POOL_COLOR_ARRAY, + POOL_VECTOR2_ARRAY, + POOL_VECTOR3_ARRAY, NIL }; valid_types=valid; } break; // arrays - case RAW_ARRAY: { + case POOL_BYTE_ARRAY: { static const Type valid[]={ ARRAY, @@ -363,7 +363,7 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) { valid_types=valid; } break; - case INT_ARRAY: { + case POOL_INT_ARRAY: { static const Type valid[]={ ARRAY, @@ -371,7 +371,7 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) { }; valid_types=valid; } break; - case REAL_ARRAY: { + case POOL_REAL_ARRAY: { static const Type valid[]={ ARRAY, @@ -380,7 +380,7 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) { valid_types=valid; } break; - case STRING_ARRAY: { + case POOL_STRING_ARRAY: { static const Type valid[]={ ARRAY, @@ -388,7 +388,7 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) { }; valid_types=valid; } break; - case VECTOR2_ARRAY: { + case POOL_VECTOR2_ARRAY: { static const Type valid[]={ ARRAY, @@ -397,7 +397,7 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) { valid_types=valid; } break; - case VECTOR3_ARRAY: { + case POOL_VECTOR3_ARRAY: { static const Type valid[]={ ARRAY, @@ -406,7 +406,7 @@ bool Variant::can_convert(Variant::Type p_type_from,Variant::Type p_type_to) { valid_types=valid; } break; - case COLOR_ARRAY: { + case POOL_COLOR_ARRAY: { static const Type valid[]={ ARRAY, @@ -507,7 +507,7 @@ bool Variant::can_convert_strict(Variant::Type p_type_from,Variant::Type p_type_ valid_types=valid; } break; - case MATRIX32: { + case TRANSFORM2D: { static const Type valid[]={ @@ -520,14 +520,14 @@ bool Variant::can_convert_strict(Variant::Type p_type_from,Variant::Type p_type_ case QUAT: { static const Type valid[]={ - MATRIX3, + BASIS, NIL }; valid_types=valid; } break; - case MATRIX3: { + case BASIS: { static const Type valid[]={ QUAT, @@ -541,9 +541,9 @@ bool Variant::can_convert_strict(Variant::Type p_type_from,Variant::Type p_type_ case TRANSFORM: { static const Type valid[]={ - MATRIX32, + TRANSFORM2D, QUAT, - MATRIX3, + BASIS, NIL }; @@ -593,20 +593,20 @@ bool Variant::can_convert_strict(Variant::Type p_type_from,Variant::Type p_type_ static const Type valid[]={ - RAW_ARRAY, - INT_ARRAY, - STRING_ARRAY, - REAL_ARRAY, - COLOR_ARRAY, - VECTOR2_ARRAY, - VECTOR3_ARRAY, + POOL_BYTE_ARRAY, + POOL_INT_ARRAY, + POOL_STRING_ARRAY, + POOL_REAL_ARRAY, + POOL_COLOR_ARRAY, + POOL_VECTOR2_ARRAY, + POOL_VECTOR3_ARRAY, NIL }; valid_types=valid; } break; // arrays - case RAW_ARRAY: { + case POOL_BYTE_ARRAY: { static const Type valid[]={ ARRAY, @@ -615,7 +615,7 @@ bool Variant::can_convert_strict(Variant::Type p_type_from,Variant::Type p_type_ valid_types=valid; } break; - case INT_ARRAY: { + case POOL_INT_ARRAY: { static const Type valid[]={ ARRAY, @@ -623,7 +623,7 @@ bool Variant::can_convert_strict(Variant::Type p_type_from,Variant::Type p_type_ }; valid_types=valid; } break; - case REAL_ARRAY: { + case POOL_REAL_ARRAY: { static const Type valid[]={ ARRAY, @@ -632,7 +632,7 @@ bool Variant::can_convert_strict(Variant::Type p_type_from,Variant::Type p_type_ valid_types=valid; } break; - case STRING_ARRAY: { + case POOL_STRING_ARRAY: { static const Type valid[]={ ARRAY, @@ -640,7 +640,7 @@ bool Variant::can_convert_strict(Variant::Type p_type_from,Variant::Type p_type_ }; valid_types=valid; } break; - case VECTOR2_ARRAY: { + case POOL_VECTOR2_ARRAY: { static const Type valid[]={ ARRAY, @@ -649,7 +649,7 @@ bool Variant::can_convert_strict(Variant::Type p_type_from,Variant::Type p_type_ valid_types=valid; } break; - case VECTOR3_ARRAY: { + case POOL_VECTOR3_ARRAY: { static const Type valid[]={ ARRAY, @@ -658,7 +658,7 @@ bool Variant::can_convert_strict(Variant::Type p_type_from,Variant::Type p_type_ valid_types=valid; } break; - case COLOR_ARRAY: { + case POOL_COLOR_ARRAY: { static const Type valid[]={ ARRAY, @@ -759,9 +759,9 @@ bool Variant::is_zero() const { return *reinterpret_cast<const Rect2*>(_data._mem)==Rect2(); } break; - case MATRIX32: { + case TRANSFORM2D: { - return *_data._matrix32==Matrix32(); + return *_data._transform2d==Transform2D(); } break; case VECTOR3: { @@ -779,18 +779,18 @@ bool Variant::is_zero() const { } break;*/ - case _AABB: { + case RECT3: { - return *_data._aabb==AABB(); + return *_data._rect3==Rect3(); } break; case QUAT: { return *reinterpret_cast<const Quat*>(_data._mem)==Quat(); } break; - case MATRIX3: { + case BASIS: { - return *_data._matrix3==Matrix3(); + return *_data._basis==Basis(); } break; case TRANSFORM: { @@ -840,39 +840,39 @@ bool Variant::is_zero() const { } break; // arrays - case RAW_ARRAY: { + case POOL_BYTE_ARRAY: { - return reinterpret_cast<const DVector<uint8_t>*>(_data._mem)->size()==0; + return reinterpret_cast<const PoolVector<uint8_t>*>(_data._mem)->size()==0; } break; - case INT_ARRAY: { + case POOL_INT_ARRAY: { - return reinterpret_cast<const DVector<int>*>(_data._mem)->size()==0; + return reinterpret_cast<const PoolVector<int>*>(_data._mem)->size()==0; } break; - case REAL_ARRAY: { + case POOL_REAL_ARRAY: { - return reinterpret_cast<const DVector<real_t>*>(_data._mem)->size()==0; + return reinterpret_cast<const PoolVector<real_t>*>(_data._mem)->size()==0; } break; - case STRING_ARRAY: { + case POOL_STRING_ARRAY: { - return reinterpret_cast<const DVector<String>*>(_data._mem)->size()==0; + return reinterpret_cast<const PoolVector<String>*>(_data._mem)->size()==0; } break; - case VECTOR2_ARRAY: { + case POOL_VECTOR2_ARRAY: { - return reinterpret_cast<const DVector<Vector2>*>(_data._mem)->size()==0; + return reinterpret_cast<const PoolVector<Vector2>*>(_data._mem)->size()==0; } break; - case VECTOR3_ARRAY: { + case POOL_VECTOR3_ARRAY: { - return reinterpret_cast<const DVector<Vector3>*>(_data._mem)->size()==0; + return reinterpret_cast<const PoolVector<Vector3>*>(_data._mem)->size()==0; } break; - case COLOR_ARRAY: { + case POOL_COLOR_ARRAY: { - return reinterpret_cast<const DVector<Color>*>(_data._mem)->size()==0; + return reinterpret_cast<const PoolVector<Color>*>(_data._mem)->size()==0; } break; default: {} @@ -987,9 +987,9 @@ void Variant::reference(const Variant& p_variant) { memnew_placement( _data._mem, Rect2( *reinterpret_cast<const Rect2*>(p_variant._data._mem) ) ); } break; - case MATRIX32: { + case TRANSFORM2D: { - _data._matrix32 = memnew( Matrix32( *p_variant._data._matrix32 ) ); + _data._transform2d = memnew( Transform2D( *p_variant._data._transform2d ) ); } break; case VECTOR3: { @@ -1007,18 +1007,18 @@ void Variant::reference(const Variant& p_variant) { } break;*/ - case _AABB: { + case RECT3: { - _data._aabb = memnew( AABB( *p_variant._data._aabb ) ); + _data._rect3 = memnew( Rect3( *p_variant._data._rect3 ) ); } break; case QUAT: { memnew_placement( _data._mem, Quat( *reinterpret_cast<const Quat*>(p_variant._data._mem) ) ); } break; - case MATRIX3: { + case BASIS: { - _data._matrix3 = memnew( Matrix3( *p_variant._data._matrix3 ) ); + _data._basis = memnew( Basis( *p_variant._data._basis ) ); } break; case TRANSFORM: { @@ -1068,39 +1068,39 @@ void Variant::reference(const Variant& p_variant) { } break; // arrays - case RAW_ARRAY: { + case POOL_BYTE_ARRAY: { - memnew_placement( _data._mem, DVector<uint8_t> ( *reinterpret_cast<const DVector<uint8_t>*>(p_variant._data._mem) ) ); + memnew_placement( _data._mem, PoolVector<uint8_t> ( *reinterpret_cast<const PoolVector<uint8_t>*>(p_variant._data._mem) ) ); } break; - case INT_ARRAY: { + case POOL_INT_ARRAY: { - memnew_placement( _data._mem, DVector<int> ( *reinterpret_cast<const DVector<int>*>(p_variant._data._mem) ) ); + memnew_placement( _data._mem, PoolVector<int> ( *reinterpret_cast<const PoolVector<int>*>(p_variant._data._mem) ) ); } break; - case REAL_ARRAY: { + case POOL_REAL_ARRAY: { - memnew_placement( _data._mem, DVector<real_t> ( *reinterpret_cast<const DVector<real_t>*>(p_variant._data._mem) ) ); + memnew_placement( _data._mem, PoolVector<real_t> ( *reinterpret_cast<const PoolVector<real_t>*>(p_variant._data._mem) ) ); } break; - case STRING_ARRAY: { + case POOL_STRING_ARRAY: { - memnew_placement( _data._mem, DVector<String> ( *reinterpret_cast<const DVector<String>*>(p_variant._data._mem) ) ); + memnew_placement( _data._mem, PoolVector<String> ( *reinterpret_cast<const PoolVector<String>*>(p_variant._data._mem) ) ); } break; - case VECTOR2_ARRAY: { + case POOL_VECTOR2_ARRAY: { - memnew_placement( _data._mem, DVector<Vector2> ( *reinterpret_cast<const DVector<Vector2>*>(p_variant._data._mem) ) ); + memnew_placement( _data._mem, PoolVector<Vector2> ( *reinterpret_cast<const PoolVector<Vector2>*>(p_variant._data._mem) ) ); } break; - case VECTOR3_ARRAY: { + case POOL_VECTOR3_ARRAY: { - memnew_placement( _data._mem, DVector<Vector3> ( *reinterpret_cast<const DVector<Vector3>*>(p_variant._data._mem) ) ); + memnew_placement( _data._mem, PoolVector<Vector3> ( *reinterpret_cast<const PoolVector<Vector3>*>(p_variant._data._mem) ) ); } break; - case COLOR_ARRAY: { + case POOL_COLOR_ARRAY: { - memnew_placement( _data._mem, DVector<Color> ( *reinterpret_cast<const DVector<Color>*>(p_variant._data._mem) ) ); + memnew_placement( _data._mem, PoolVector<Color> ( *reinterpret_cast<const PoolVector<Color>*>(p_variant._data._mem) ) ); } break; default: {} @@ -1139,19 +1139,19 @@ void Variant::clear() { VECTOR2, RECT2 */ - case MATRIX32: { + case TRANSFORM2D: { - memdelete( _data._matrix32 ); + memdelete( _data._transform2d ); } break; - case _AABB: { + case RECT3: { - memdelete( _data._aabb ); + memdelete( _data._rect3 ); } break; - case MATRIX3: { + case BASIS: { - memdelete( _data._matrix3 ); + memdelete( _data._basis ); } break; case TRANSFORM: { @@ -1196,39 +1196,39 @@ void Variant::clear() { } break; // arrays - case RAW_ARRAY: { + case POOL_BYTE_ARRAY: { - reinterpret_cast< DVector<uint8_t>* >(_data._mem)->~DVector<uint8_t>(); + reinterpret_cast< PoolVector<uint8_t>* >(_data._mem)->~PoolVector<uint8_t>(); } break; - case INT_ARRAY: { + case POOL_INT_ARRAY: { - reinterpret_cast< DVector<int>* >(_data._mem)->~DVector<int>(); + reinterpret_cast< PoolVector<int>* >(_data._mem)->~PoolVector<int>(); } break; - case REAL_ARRAY: { + case POOL_REAL_ARRAY: { - reinterpret_cast< DVector<real_t>* >(_data._mem)->~DVector<real_t>(); + reinterpret_cast< PoolVector<real_t>* >(_data._mem)->~PoolVector<real_t>(); } break; - case STRING_ARRAY: { + case POOL_STRING_ARRAY: { - reinterpret_cast< DVector<String>* >(_data._mem)->~DVector<String>(); + reinterpret_cast< PoolVector<String>* >(_data._mem)->~PoolVector<String>(); } break; - case VECTOR2_ARRAY: { + case POOL_VECTOR2_ARRAY: { - reinterpret_cast< DVector<Vector2>* >(_data._mem)->~DVector<Vector2>(); + reinterpret_cast< PoolVector<Vector2>* >(_data._mem)->~PoolVector<Vector2>(); } break; - case VECTOR3_ARRAY: { + case POOL_VECTOR3_ARRAY: { - reinterpret_cast< DVector<Vector3>* >(_data._mem)->~DVector<Vector3>(); + reinterpret_cast< PoolVector<Vector3>* >(_data._mem)->~PoolVector<Vector3>(); } break; - case COLOR_ARRAY: { + case POOL_COLOR_ARRAY: { - reinterpret_cast< DVector<Color>* >(_data._mem)->~DVector<Color>(); + reinterpret_cast< PoolVector<Color>* >(_data._mem)->~PoolVector<Color>(); } break; default: {} /* not needed */ @@ -1467,7 +1467,7 @@ Variant::operator double() const { case NIL: return 0; case BOOL: return _data._bool ? 1.0 : 0.0; - case INT: return (float)_data._int; + case INT: return (double)_data._int; case REAL: return _data._real; case STRING: return operator String().to_double(); default: { @@ -1502,26 +1502,26 @@ Variant::operator String() const { switch( type ) { - case NIL: return ""; + case NIL: return "Null"; case BOOL: return _data._bool ? "True" : "False"; - case INT: return String::num(_data._int); - case REAL: return String::num(_data._real); + case INT: return itos(_data._int); + case REAL: return rtos(_data._real); case STRING: return *reinterpret_cast<const String*>(_data._mem); case VECTOR2: return "("+operator Vector2()+")"; case RECT2: return "("+operator Rect2()+")"; - case MATRIX32: { + case TRANSFORM2D: { - Matrix32 mat32 = operator Matrix32(); + Transform2D mat32 = operator Transform2D(); return "("+Variant(mat32.elements[0]).operator String()+", "+Variant(mat32.elements[1]).operator String()+", "+Variant(mat32.elements[2]).operator String()+")"; } break; case VECTOR3: return "("+operator Vector3()+")"; case PLANE: return operator Plane(); //case QUAT: - case _AABB: return operator AABB(); + case RECT3: return operator Rect3(); case QUAT: return "("+operator Quat()+")"; - case MATRIX3: { + case BASIS: { - Matrix3 mat3 = operator Matrix3(); + Basis mat3 = operator Basis(); String mtx("("); for (int i=0;i<3;i++) { @@ -1576,9 +1576,9 @@ Variant::operator String() const { return str; } break; - case VECTOR2_ARRAY: { + case POOL_VECTOR2_ARRAY: { - DVector<Vector2> vec = operator DVector<Vector2>(); + PoolVector<Vector2> vec = operator PoolVector<Vector2>(); String str("["); for(int i=0;i<vec.size();i++) { @@ -1589,9 +1589,9 @@ Variant::operator String() const { str += "]"; return str; } break; - case VECTOR3_ARRAY: { + case POOL_VECTOR3_ARRAY: { - DVector<Vector3> vec = operator DVector<Vector3>(); + PoolVector<Vector3> vec = operator PoolVector<Vector3>(); String str("["); for(int i=0;i<vec.size();i++) { @@ -1602,9 +1602,9 @@ Variant::operator String() const { str += "]"; return str; } break; - case STRING_ARRAY: { + case POOL_STRING_ARRAY: { - DVector<String> vec = operator DVector<String>(); + PoolVector<String> vec = operator PoolVector<String>(); String str("["); for(int i=0;i<vec.size();i++) { @@ -1615,9 +1615,9 @@ Variant::operator String() const { str += "]"; return str; } break; - case INT_ARRAY: { + case POOL_INT_ARRAY: { - DVector<int> vec = operator DVector<int>(); + PoolVector<int> vec = operator PoolVector<int>(); String str("["); for(int i=0;i<vec.size();i++) { @@ -1628,9 +1628,9 @@ Variant::operator String() const { str += "]"; return str; } break; - case REAL_ARRAY: { + case POOL_REAL_ARRAY: { - DVector<real_t> vec = operator DVector<real_t>(); + PoolVector<real_t> vec = operator PoolVector<real_t>(); String str("["); for(int i=0;i<vec.size();i++) { @@ -1665,7 +1665,7 @@ Variant::operator String() const { }; }; #endif - return "["+_get_obj().obj->get_type()+":"+itos(_get_obj().obj->get_instance_ID())+"]"; + return "["+_get_obj().obj->get_class()+":"+itos(_get_obj().obj->get_instance_ID())+"]"; } else return "[Object:null]"; @@ -1713,32 +1713,32 @@ Variant::operator Plane() const { return Plane(); } -Variant::operator AABB() const { +Variant::operator Rect3() const { - if (type==_AABB) - return *_data._aabb; + if (type==RECT3) + return *_data._rect3; else - return AABB(); + return Rect3(); } -Variant::operator Matrix3() const { +Variant::operator Basis() const { - if (type==MATRIX3) - return *_data._matrix3; + if (type==BASIS) + return *_data._basis; else if (type==QUAT) return *reinterpret_cast<const Quat*>(_data._mem); else if (type==TRANSFORM) return _data._transform->basis; else - return Matrix3(); + return Basis(); } Variant::operator Quat() const { if (type==QUAT) return *reinterpret_cast<const Quat*>(_data._mem); - else if (type==MATRIX3) - return *_data._matrix3; + else if (type==BASIS) + return *_data._basis; else if (type==TRANSFORM) return _data._transform->basis; else @@ -1751,21 +1751,21 @@ Variant::operator Transform() const { if (type==TRANSFORM) return *_data._transform; - else if (type==MATRIX3) - return Transform(*_data._matrix3,Vector3()); + else if (type==BASIS) + return Transform(*_data._basis,Vector3()); else if (type==QUAT) - return Transform(Matrix3(*reinterpret_cast<const Quat*>(_data._mem)),Vector3()); + return Transform(Basis(*reinterpret_cast<const Quat*>(_data._mem)),Vector3()); else return Transform(); } - Variant::operator Matrix32() const { + Variant::operator Transform2D() const { - if (type==MATRIX32) { - return *_data._matrix32; + if (type==TRANSFORM2D) { + return *_data._transform2d; } else if (type==TRANSFORM) { const Transform& t = *_data._transform;; - Matrix32 m; + Transform2D m; m.elements[0][0]=t.basis.elements[0][0]; m.elements[0][1]=t.basis.elements[1][0]; m.elements[1][0]=t.basis.elements[0][1]; @@ -1774,7 +1774,7 @@ Variant::operator Transform() const { m.elements[2][1]=t.origin[1]; return m; } else - return Matrix32(); + return Transform2D(); } @@ -1893,13 +1893,13 @@ inline DA _convert_array_from_variant(const Variant& p_variant) { case Variant::ARRAY: { return _convert_array<DA,Array >( p_variant.operator Array () ); } - case Variant::RAW_ARRAY: { return _convert_array<DA,DVector<uint8_t> >( p_variant.operator DVector<uint8_t> () ); } - case Variant::INT_ARRAY: { return _convert_array<DA,DVector<int> >( p_variant.operator DVector<int> () ); } - case Variant::REAL_ARRAY: { return _convert_array<DA,DVector<real_t> >( p_variant.operator DVector<real_t> () ); } - case Variant::STRING_ARRAY: { return _convert_array<DA,DVector<String> >( p_variant.operator DVector<String> () ); } - case Variant::VECTOR2_ARRAY: { return _convert_array<DA,DVector<Vector2> >( p_variant.operator DVector<Vector2> () ); } - case Variant::VECTOR3_ARRAY: { return _convert_array<DA,DVector<Vector3> >( p_variant.operator DVector<Vector3> () ); } - case Variant::COLOR_ARRAY: { return _convert_array<DA,DVector<Color> >( p_variant.operator DVector<Color>() ); } + case Variant::POOL_BYTE_ARRAY: { return _convert_array<DA,PoolVector<uint8_t> >( p_variant.operator PoolVector<uint8_t> () ); } + case Variant::POOL_INT_ARRAY: { return _convert_array<DA,PoolVector<int> >( p_variant.operator PoolVector<int> () ); } + case Variant::POOL_REAL_ARRAY: { return _convert_array<DA,PoolVector<real_t> >( p_variant.operator PoolVector<real_t> () ); } + case Variant::POOL_STRING_ARRAY: { return _convert_array<DA,PoolVector<String> >( p_variant.operator PoolVector<String> () ); } + case Variant::POOL_VECTOR2_ARRAY: { return _convert_array<DA,PoolVector<Vector2> >( p_variant.operator PoolVector<Vector2> () ); } + case Variant::POOL_VECTOR3_ARRAY: { return _convert_array<DA,PoolVector<Vector3> >( p_variant.operator PoolVector<Vector3> () ); } + case Variant::POOL_COLOR_ARRAY: { return _convert_array<DA,PoolVector<Color> >( p_variant.operator PoolVector<Color>() ); } default: { return DA(); } } @@ -1914,64 +1914,64 @@ Variant::operator Array() const { return _convert_array_from_variant<Array >(*this); } -Variant::operator DVector<uint8_t>() const { +Variant::operator PoolVector<uint8_t>() const { - if (type==RAW_ARRAY) - return *reinterpret_cast<const DVector<uint8_t>* >(_data._mem); + if (type==POOL_BYTE_ARRAY) + return *reinterpret_cast<const PoolVector<uint8_t>* >(_data._mem); else - return _convert_array_from_variant<DVector<uint8_t> >(*this); + return _convert_array_from_variant<PoolVector<uint8_t> >(*this); } -Variant::operator DVector<int>() const { +Variant::operator PoolVector<int>() const { - if (type==INT_ARRAY) - return *reinterpret_cast<const DVector<int>* >(_data._mem); + if (type==POOL_INT_ARRAY) + return *reinterpret_cast<const PoolVector<int>* >(_data._mem); else - return _convert_array_from_variant<DVector<int> >(*this); + return _convert_array_from_variant<PoolVector<int> >(*this); } -Variant::operator DVector<real_t>() const { +Variant::operator PoolVector<real_t>() const { - if (type==REAL_ARRAY) - return *reinterpret_cast<const DVector<real_t>* >(_data._mem); + if (type==POOL_REAL_ARRAY) + return *reinterpret_cast<const PoolVector<real_t>* >(_data._mem); else - return _convert_array_from_variant<DVector<real_t> >(*this); + return _convert_array_from_variant<PoolVector<real_t> >(*this); } -Variant::operator DVector<String>() const { +Variant::operator PoolVector<String>() const { - if (type==STRING_ARRAY) - return *reinterpret_cast<const DVector<String>* >(_data._mem); + if (type==POOL_STRING_ARRAY) + return *reinterpret_cast<const PoolVector<String>* >(_data._mem); else - return _convert_array_from_variant<DVector<String> >(*this); + return _convert_array_from_variant<PoolVector<String> >(*this); } -Variant::operator DVector<Vector3>() const { +Variant::operator PoolVector<Vector3>() const { - if (type==VECTOR3_ARRAY) - return *reinterpret_cast<const DVector<Vector3>* >(_data._mem); + if (type==POOL_VECTOR3_ARRAY) + return *reinterpret_cast<const PoolVector<Vector3>* >(_data._mem); else - return _convert_array_from_variant<DVector<Vector3> >(*this); + return _convert_array_from_variant<PoolVector<Vector3> >(*this); } -Variant::operator DVector<Vector2>() const { +Variant::operator PoolVector<Vector2>() const { - if (type==VECTOR2_ARRAY) - return *reinterpret_cast<const DVector<Vector2>* >(_data._mem); + if (type==POOL_VECTOR2_ARRAY) + return *reinterpret_cast<const PoolVector<Vector2>* >(_data._mem); else - return _convert_array_from_variant<DVector<Vector2> >(*this); + return _convert_array_from_variant<PoolVector<Vector2> >(*this); } -Variant::operator DVector<Color>() const { +Variant::operator PoolVector<Color>() const { - if (type==COLOR_ARRAY) - return *reinterpret_cast<const DVector<Color>* >(_data._mem); + if (type==POOL_COLOR_ARRAY) + return *reinterpret_cast<const PoolVector<Color>* >(_data._mem); else - return _convert_array_from_variant<DVector<Color> >(*this); + return _convert_array_from_variant<PoolVector<Color> >(*this); } @@ -1990,13 +1990,13 @@ Variant::operator Vector<RID>() const { Variant::operator Vector<Vector2>() const { - DVector<Vector2> from=operator DVector<Vector2>(); + PoolVector<Vector2> from=operator PoolVector<Vector2>(); Vector<Vector2> to; int len=from.size(); if (len==0) return Vector<Vector2>(); to.resize(len); - DVector<Vector2>::Read r = from.read(); + PoolVector<Vector2>::Read r = from.read(); Vector2 *w = &to[0]; for (int i=0;i<len;i++) { @@ -2005,16 +2005,16 @@ Variant::operator Vector<Vector2>() const { return to; } -Variant::operator DVector<Plane>() const { +Variant::operator PoolVector<Plane>() const { Array va= operator Array(); - DVector<Plane> planes; + PoolVector<Plane> planes; int va_size=va.size(); if (va_size==0) return planes; planes.resize(va_size); - DVector<Plane>::Write w = planes.write(); + PoolVector<Plane>::Write w = planes.write(); for(int i=0;i<va_size;i++) w[i]=va[i]; @@ -2022,17 +2022,17 @@ Variant::operator DVector<Plane>() const { return planes; } -Variant::operator DVector<Face3>() const { +Variant::operator PoolVector<Face3>() const { - DVector<Vector3> va= operator DVector<Vector3>(); - DVector<Face3> faces; + PoolVector<Vector3> va= operator PoolVector<Vector3>(); + PoolVector<Face3> faces; int va_size=va.size(); if (va_size==0) return faces; faces.resize(va_size/3); - DVector<Face3>::Write w = faces.write(); - DVector<Vector3>::Read r = va.read(); + PoolVector<Face3>::Write w = faces.write(); + PoolVector<Vector3>::Read r = va.read(); for(int i=0;i<va_size;i++) w[i/3].vertex[i%3]=r[i]; @@ -2072,7 +2072,7 @@ Variant::operator Vector<Variant>() const { Variant::operator Vector<uint8_t>() const { - DVector<uint8_t> from=operator DVector<uint8_t>(); + PoolVector<uint8_t> from=operator PoolVector<uint8_t>(); Vector<uint8_t> to; int len=from.size(); to.resize(len); @@ -2084,7 +2084,7 @@ Variant::operator Vector<uint8_t>() const { } Variant::operator Vector<int>() const { - DVector<int> from=operator DVector<int>(); + PoolVector<int> from=operator PoolVector<int>(); Vector<int> to; int len=from.size(); to.resize(len); @@ -2096,7 +2096,7 @@ Variant::operator Vector<int>() const { } Variant::operator Vector<real_t>() const { - DVector<real_t> from=operator DVector<real_t>(); + PoolVector<real_t> from=operator PoolVector<real_t>(); Vector<real_t> to; int len=from.size(); to.resize(len); @@ -2109,7 +2109,7 @@ Variant::operator Vector<real_t>() const { Variant::operator Vector<String>() const { - DVector<String> from=operator DVector<String>(); + PoolVector<String> from=operator PoolVector<String>(); Vector<String> to; int len=from.size(); to.resize(len); @@ -2122,13 +2122,13 @@ Variant::operator Vector<String>() const { } Variant::operator Vector<Vector3>() const { - DVector<Vector3> from=operator DVector<Vector3>(); + PoolVector<Vector3> from=operator PoolVector<Vector3>(); Vector<Vector3> to; int len=from.size(); if (len==0) return Vector<Vector3>(); to.resize(len); - DVector<Vector3>::Read r = from.read(); + PoolVector<Vector3>::Read r = from.read(); Vector3 *w = &to[0]; for (int i=0;i<len;i++) { @@ -2139,13 +2139,13 @@ Variant::operator Vector<Vector3>() const { } Variant::operator Vector<Color>() const { - DVector<Color> from=operator DVector<Color>(); + PoolVector<Color> from=operator PoolVector<Color>(); Vector<Color> to; int len=from.size(); if (len==0) return Vector<Color>(); to.resize(len); - DVector<Color>::Read r = from.read(); + PoolVector<Color>::Read r = from.read(); Color *w = &to[0]; for (int i=0;i<len;i++) { @@ -2165,9 +2165,9 @@ Variant::operator Orientation() const { Variant::operator IP_Address() const { - if (type==REAL_ARRAY || type==INT_ARRAY || type==RAW_ARRAY) { + if (type==POOL_REAL_ARRAY || type==POOL_INT_ARRAY || type==POOL_BYTE_ARRAY) { - DVector<int> addr=operator DVector<int>(); + PoolVector<int> addr=operator PoolVector<int>(); if (addr.size()==4) { return IP_Address(addr.get(0),addr.get(1),addr.get(2),addr.get(3)); } @@ -2320,16 +2320,16 @@ Variant::Variant(const Plane& p_plane) { memnew_placement( _data._mem, Plane( p_plane ) ); } -Variant::Variant(const AABB& p_aabb) { +Variant::Variant(const Rect3& p_aabb) { - type=_AABB; - _data._aabb = memnew( AABB( p_aabb ) ); + type=RECT3; + _data._rect3 = memnew( Rect3( p_aabb ) ); } -Variant::Variant(const Matrix3& p_matrix) { +Variant::Variant(const Basis& p_matrix) { - type=MATRIX3; - _data._matrix3= memnew( Matrix3( p_matrix ) ); + type=BASIS; + _data._basis= memnew( Basis( p_matrix ) ); } @@ -2346,10 +2346,10 @@ Variant::Variant(const Transform& p_transform) { } -Variant::Variant(const Matrix32& p_transform) { +Variant::Variant(const Transform2D& p_transform) { - type=MATRIX32; - _data._matrix32 = memnew( Matrix32( p_transform ) ); + type=TRANSFORM2D; + _data._transform2d = memnew( Transform2D( p_transform ) ); } Variant::Variant(const Color& p_color) { @@ -2418,7 +2418,7 @@ Variant::Variant(const Array& p_array) { } -Variant::Variant(const DVector<Plane>& p_array) { +Variant::Variant(const PoolVector<Plane>& p_array) { type=ARRAY; @@ -2467,11 +2467,11 @@ Variant::Variant(const Vector<Vector2>& p_array) { type=NIL; - DVector<Vector2> v; + PoolVector<Vector2> v; int len=p_array.size(); if (len>0) { v.resize(len); - DVector<Vector2>::Write w = v.write(); + PoolVector<Vector2>::Write w = v.write(); const Vector2 *r = p_array.ptr(); for (int i=0;i<len;i++) @@ -2481,59 +2481,59 @@ Variant::Variant(const Vector<Vector2>& p_array) { } -Variant::Variant(const DVector<uint8_t>& p_raw_array) { +Variant::Variant(const PoolVector<uint8_t>& p_raw_array) { - type=RAW_ARRAY; - memnew_placement( _data._mem, DVector<uint8_t>(p_raw_array) ); + type=POOL_BYTE_ARRAY; + memnew_placement( _data._mem, PoolVector<uint8_t>(p_raw_array) ); } -Variant::Variant(const DVector<int>& p_int_array) { +Variant::Variant(const PoolVector<int>& p_int_array) { - type=INT_ARRAY; - memnew_placement( _data._mem, DVector<int>(p_int_array) ); + type=POOL_INT_ARRAY; + memnew_placement( _data._mem, PoolVector<int>(p_int_array) ); } -Variant::Variant(const DVector<real_t>& p_real_array) { +Variant::Variant(const PoolVector<real_t>& p_real_array) { - type=REAL_ARRAY; - memnew_placement( _data._mem, DVector<real_t>(p_real_array) ); + type=POOL_REAL_ARRAY; + memnew_placement( _data._mem, PoolVector<real_t>(p_real_array) ); } -Variant::Variant(const DVector<String>& p_string_array) { +Variant::Variant(const PoolVector<String>& p_string_array) { - type=STRING_ARRAY; - memnew_placement( _data._mem, DVector<String>(p_string_array) ); + type=POOL_STRING_ARRAY; + memnew_placement( _data._mem, PoolVector<String>(p_string_array) ); } -Variant::Variant(const DVector<Vector3>& p_vector3_array) { +Variant::Variant(const PoolVector<Vector3>& p_vector3_array) { - type=VECTOR3_ARRAY; - memnew_placement( _data._mem, DVector<Vector3>(p_vector3_array) ); + type=POOL_VECTOR3_ARRAY; + memnew_placement( _data._mem, PoolVector<Vector3>(p_vector3_array) ); } -Variant::Variant(const DVector<Vector2>& p_vector2_array) { +Variant::Variant(const PoolVector<Vector2>& p_vector2_array) { - type=VECTOR2_ARRAY; - memnew_placement( _data._mem, DVector<Vector2>(p_vector2_array) ); + type=POOL_VECTOR2_ARRAY; + memnew_placement( _data._mem, PoolVector<Vector2>(p_vector2_array) ); } -Variant::Variant(const DVector<Color>& p_color_array) { +Variant::Variant(const PoolVector<Color>& p_color_array) { - type=COLOR_ARRAY; - memnew_placement( _data._mem, DVector<Color>(p_color_array) ); + type=POOL_COLOR_ARRAY; + memnew_placement( _data._mem, PoolVector<Color>(p_color_array) ); } -Variant::Variant(const DVector<Face3>& p_face_array) { +Variant::Variant(const PoolVector<Face3>& p_face_array) { - DVector<Vector3> vertices; + PoolVector<Vector3> vertices; int face_count=p_face_array.size(); vertices.resize(face_count*3); if (face_count) { - DVector<Face3>::Read r = p_face_array.read(); - DVector<Vector3>::Write w = vertices.write(); + PoolVector<Face3>::Read r = p_face_array.read(); + PoolVector<Vector3>::Write w = vertices.write(); for(int i=0;i<face_count;i++) { @@ -2541,8 +2541,8 @@ Variant::Variant(const DVector<Face3>& p_face_array) { w[i*3+j]=r[i].vertex[j]; } - r=DVector<Face3>::Read(); - w=DVector<Vector3>::Write(); + r=PoolVector<Face3>::Read(); + w=PoolVector<Vector3>::Write(); } @@ -2567,7 +2567,7 @@ Variant::Variant(const Vector<Variant>& p_array) { Variant::Variant(const Vector<uint8_t>& p_array) { type=NIL; - DVector<uint8_t> v; + PoolVector<uint8_t> v; int len=p_array.size(); v.resize(len); for (int i=0;i<len;i++) @@ -2578,7 +2578,7 @@ Variant::Variant(const Vector<uint8_t>& p_array) { Variant::Variant(const Vector<int>& p_array) { type=NIL; - DVector<int> v; + PoolVector<int> v; int len=p_array.size(); v.resize(len); for (int i=0;i<len;i++) @@ -2589,7 +2589,7 @@ Variant::Variant(const Vector<int>& p_array) { Variant::Variant(const Vector<real_t>& p_array) { type=NIL; - DVector<real_t> v; + PoolVector<real_t> v; int len=p_array.size(); v.resize(len); for (int i=0;i<len;i++) @@ -2600,7 +2600,7 @@ Variant::Variant(const Vector<real_t>& p_array) { Variant::Variant(const Vector<String>& p_array) { type=NIL; - DVector<String> v; + PoolVector<String> v; int len=p_array.size(); v.resize(len); for (int i=0;i<len;i++) @@ -2611,11 +2611,11 @@ Variant::Variant(const Vector<String>& p_array) { Variant::Variant(const Vector<Vector3>& p_array) { type=NIL; - DVector<Vector3> v; + PoolVector<Vector3> v; int len=p_array.size(); if (len>0) { v.resize(len); - DVector<Vector3>::Write w = v.write(); + PoolVector<Vector3>::Write w = v.write(); const Vector3 *r = p_array.ptr(); for (int i=0;i<len;i++) @@ -2627,7 +2627,7 @@ Variant::Variant(const Vector<Vector3>& p_array) { Variant::Variant(const Vector<Color>& p_array) { type=NIL; - DVector<Color> v; + PoolVector<Color> v; int len=p_array.size(); v.resize(len); for (int i=0;i<len;i++) @@ -2700,13 +2700,13 @@ uint32_t Variant::hash() const { hash = hash_djb2_one_float(reinterpret_cast<const Rect2*>(_data._mem)->size.x,hash); return hash_djb2_one_float(reinterpret_cast<const Rect2*>(_data._mem)->size.y,hash); } break; - case MATRIX32: { + case TRANSFORM2D: { uint32_t hash = 5831; for(int i=0;i<3;i++) { for(int j=0;j<2;j++) { - hash = hash_djb2_one_float(_data._matrix32->elements[i][j],hash); + hash = hash_djb2_one_float(_data._transform2d->elements[i][j],hash); } } @@ -2731,13 +2731,13 @@ uint32_t Variant::hash() const { } break;*/ - case _AABB: { + case RECT3: { uint32_t hash = 5831; for(int i=0;i<3;i++) { - hash = hash_djb2_one_float(_data._aabb->pos[i],hash); - hash = hash_djb2_one_float(_data._aabb->size[i],hash); + hash = hash_djb2_one_float(_data._rect3->pos[i],hash); + hash = hash_djb2_one_float(_data._rect3->size[i],hash); } @@ -2752,13 +2752,13 @@ uint32_t Variant::hash() const { return hash_djb2_one_float(reinterpret_cast<const Quat*>(_data._mem)->w,hash); } break; - case MATRIX3: { + case BASIS: { uint32_t hash = 5831; for(int i=0;i<3;i++) { for(int j=0;j<3;j++) { - hash = hash_djb2_one_float(_data._matrix3->elements[i][j],hash); + hash = hash_djb2_one_float(_data._basis->elements[i][j],hash); } } @@ -2824,39 +2824,39 @@ uint32_t Variant::hash() const { return arr.hash(); } break; - case RAW_ARRAY: { + case POOL_BYTE_ARRAY: { - const DVector<uint8_t>& arr = *reinterpret_cast<const DVector<uint8_t>* >(_data._mem); + const PoolVector<uint8_t>& arr = *reinterpret_cast<const PoolVector<uint8_t>* >(_data._mem); int len = arr.size(); - DVector<uint8_t>::Read r = arr.read(); + PoolVector<uint8_t>::Read r = arr.read(); return hash_djb2_buffer((uint8_t*)&r[0],len); } break; - case INT_ARRAY: { + case POOL_INT_ARRAY: { - const DVector<int>& arr = *reinterpret_cast<const DVector<int>* >(_data._mem); + const PoolVector<int>& arr = *reinterpret_cast<const PoolVector<int>* >(_data._mem); int len = arr.size(); - DVector<int>::Read r = arr.read(); + PoolVector<int>::Read r = arr.read(); return hash_djb2_buffer((uint8_t*)&r[0],len*sizeof(int)); } break; - case REAL_ARRAY: { + case POOL_REAL_ARRAY: { - const DVector<real_t>& arr = *reinterpret_cast<const DVector<real_t>* >(_data._mem); + const PoolVector<real_t>& arr = *reinterpret_cast<const PoolVector<real_t>* >(_data._mem); int len = arr.size(); - DVector<real_t>::Read r = arr.read(); + PoolVector<real_t>::Read r = arr.read(); return hash_djb2_buffer((uint8_t*)&r[0],len*sizeof(real_t)); } break; - case STRING_ARRAY: { + case POOL_STRING_ARRAY: { uint32_t hash=5831; - const DVector<String>& arr = *reinterpret_cast<const DVector<String>* >(_data._mem); + const PoolVector<String>& arr = *reinterpret_cast<const PoolVector<String>* >(_data._mem); int len = arr.size(); - DVector<String>::Read r = arr.read(); + PoolVector<String>::Read r = arr.read(); for(int i=0;i<len;i++) { hash = hash_djb2_one_32(r[i].hash(),hash); @@ -2864,12 +2864,12 @@ uint32_t Variant::hash() const { return hash; } break; - case VECTOR2_ARRAY: { + case POOL_VECTOR2_ARRAY: { uint32_t hash=5831; - const DVector<Vector2>& arr = *reinterpret_cast<const DVector<Vector2>* >(_data._mem); + const PoolVector<Vector2>& arr = *reinterpret_cast<const PoolVector<Vector2>* >(_data._mem); int len = arr.size(); - DVector<Vector2>::Read r = arr.read(); + PoolVector<Vector2>::Read r = arr.read(); for(int i=0;i<len;i++) { hash = hash_djb2_one_float(r[i].x,hash); @@ -2879,12 +2879,12 @@ uint32_t Variant::hash() const { return hash; } break; - case VECTOR3_ARRAY: { + case POOL_VECTOR3_ARRAY: { uint32_t hash=5831; - const DVector<Vector3>& arr = *reinterpret_cast<const DVector<Vector3>* >(_data._mem); + const PoolVector<Vector3>& arr = *reinterpret_cast<const PoolVector<Vector3>* >(_data._mem); int len = arr.size(); - DVector<Vector3>::Read r = arr.read(); + PoolVector<Vector3>::Read r = arr.read(); for(int i=0;i<len;i++) { hash = hash_djb2_one_float(r[i].x,hash); @@ -2895,12 +2895,12 @@ uint32_t Variant::hash() const { return hash; } break; - case COLOR_ARRAY: { + case POOL_COLOR_ARRAY: { uint32_t hash=5831; - const DVector<Color>& arr = *reinterpret_cast<const DVector<Color>* >(_data._mem); + const PoolVector<Color>& arr = *reinterpret_cast<const PoolVector<Color>* >(_data._mem); int len = arr.size(); - DVector<Color>::Read r = arr.read(); + PoolVector<Color>::Read r = arr.read(); for(int i=0;i<len;i++) { hash = hash_djb2_one_float(r[i].r,hash); @@ -3066,7 +3066,7 @@ String Variant::get_call_error_text(Object* p_base, const StringName& p_method,c return "Call OK"; } - String class_name = p_base->get_type(); + String class_name = p_base->get_class(); Ref<Script> script = p_base->get_script(); if (script.is_valid() && script->get_path().is_resource_file()) { diff --git a/core/variant.h b/core/variant.h index 90be593bd9..9d29fd64c3 100644 --- a/core/variant.h +++ b/core/variant.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -63,13 +63,13 @@ struct PropertyInfo; struct MethodInfo; -typedef DVector<uint8_t> ByteArray; -typedef DVector<int> IntArray; -typedef DVector<real_t> RealArray; -typedef DVector<String> StringArray; -typedef DVector<Vector2> Vector2Array; -typedef DVector<Vector3> Vector3Array; -typedef DVector<Color> ColorArray; +typedef PoolVector<uint8_t> PoolByteArray; +typedef PoolVector<int> PoolIntArray; +typedef PoolVector<real_t> PoolRealArray; +typedef PoolVector<String> PoolStringArray; +typedef PoolVector<Vector2> PoolVector2Array; +typedef PoolVector<Vector3> PoolVector3Array; +typedef PoolVector<Color> PoolColorArray; class Variant { public: @@ -89,11 +89,11 @@ public: VECTOR2, // 5 RECT2, VECTOR3, - MATRIX32, + TRANSFORM2D, PLANE, QUAT, // 10 - _AABB, //sorry naming convention fail :( not like it's used often - MATRIX3, + RECT3, //sorry naming convention fail :( not like it's used often + BASIS, TRANSFORM, // misc types @@ -107,13 +107,13 @@ public: ARRAY, // arrays - RAW_ARRAY, - INT_ARRAY, - REAL_ARRAY, - STRING_ARRAY, // 25 - VECTOR2_ARRAY, - VECTOR3_ARRAY, - COLOR_ARRAY, + POOL_BYTE_ARRAY, + POOL_INT_ARRAY, + POOL_REAL_ARRAY, + POOL_STRING_ARRAY, // 25 + POOL_VECTOR2_ARRAY, + POOL_VECTOR3_ARRAY, + POOL_COLOR_ARRAY, VARIANT_MAX @@ -141,11 +141,11 @@ private: union { bool _bool; - int _int; + int64_t _int; double _real; - Matrix32 *_matrix32; - AABB* _aabb; - Matrix3 *_matrix3; + Transform2D *_transform2d; + Rect3* _rect3; + Basis *_basis; Transform *_transform; RefPtr *_resource; InputEvent *_input_event; @@ -208,11 +208,11 @@ public: operator Rect2() const; operator Vector3() const; operator Plane() const; - operator AABB() const; + operator Rect3() const; operator Quat() const; - operator Matrix3() const; + operator Basis() const; operator Transform() const; - operator Matrix32() const; + operator Transform2D() const; operator Color() const; operator Image() const; @@ -227,14 +227,14 @@ public: operator Dictionary() const; operator Array() const; - operator DVector<uint8_t>() const; - operator DVector<int>() const; - operator DVector<real_t>() const; - operator DVector<String>() const; - operator DVector<Vector3>() const; - operator DVector<Color>() const; - operator DVector<Plane>() const; - operator DVector<Face3>() const; + operator PoolVector<uint8_t>() const; + operator PoolVector<int>() const; + operator PoolVector<real_t>() const; + operator PoolVector<String>() const; + operator PoolVector<Vector3>() const; + operator PoolVector<Color>() const; + operator PoolVector<Plane>() const; + operator PoolVector<Face3>() const; operator Vector<Variant>() const; @@ -246,7 +246,7 @@ public: operator Vector<Color>() const; operator Vector<RID>() const; operator Vector<Vector2>() const; - operator DVector<Vector2>() const; + operator PoolVector<Vector2>() const; operator Vector<Plane>() const; // some core type enums to convert to @@ -280,10 +280,10 @@ public: Variant(const Rect2& p_rect2); Variant(const Vector3& p_vector3); Variant(const Plane& p_plane); - Variant(const AABB& p_aabb); + Variant(const Rect3& p_aabb); Variant(const Quat& p_quat); - Variant(const Matrix3& p_transform); - Variant(const Matrix32& p_transform); + Variant(const Basis& p_transform); + Variant(const Transform2D& p_transform); Variant(const Transform& p_transform); Variant(const Color& p_color); Variant(const Image& p_image); @@ -295,14 +295,14 @@ public: Variant(const Dictionary& p_dictionary); Variant(const Array& p_array); - Variant(const DVector<Plane>& p_array); // helper - Variant(const DVector<uint8_t>& p_raw_array); - Variant(const DVector<int>& p_int_array); - Variant(const DVector<real_t>& p_real_array); - Variant(const DVector<String>& p_string_array); - Variant(const DVector<Vector3>& p_vector3_array); - Variant(const DVector<Color>& p_color_array); - Variant(const DVector<Face3>& p_face_array); + Variant(const PoolVector<Plane>& p_array); // helper + Variant(const PoolVector<uint8_t>& p_raw_array); + Variant(const PoolVector<int>& p_int_array); + Variant(const PoolVector<real_t>& p_real_array); + Variant(const PoolVector<String>& p_string_array); + Variant(const PoolVector<Vector3>& p_vector3_array); + Variant(const PoolVector<Color>& p_color_array); + Variant(const PoolVector<Face3>& p_face_array); Variant(const Vector<Variant>& p_array); @@ -315,7 +315,7 @@ public: Variant(const Vector<Plane>& p_array); // helper Variant(const Vector<RID>& p_array); // helper Variant(const Vector<Vector2>& p_array); // helper - Variant(const DVector<Vector2>& p_array); // helper + Variant(const PoolVector<Vector2>& p_array); // helper Variant(const IP_Address& p_address); @@ -336,6 +336,7 @@ public: OP_MULTIPLY, OP_DIVIDE, OP_NEGATE, + OP_POSITIVE, OP_MODULE, OP_STRING_CONCAT, //bitwise diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 9b6fa27cf4..9a61dd73df 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,6 +32,7 @@ #include "core_string_names.h" #include "script_language.h" + typedef void (*VariantFunc)(Variant& r_ret,Variant& p_self,const Variant** p_args); typedef void (*VariantConstructFunc)(Variant& r_ret,const Variant** p_args); @@ -146,6 +147,15 @@ struct _VariantCall { }; // void addfunc(Variant::Type p_type, const StringName& p_name,VariantFunc p_func); + + static void make_func_return_variant(Variant::Type p_type,const StringName& p_name) { + +#ifdef DEBUG_ENABLED + type_funcs[p_type].functions[p_name].returns=true; +#endif + } + + static void addfunc(Variant::Type p_type, Variant::Type p_return,const StringName& p_name,VariantFunc p_func, const Vector<Variant>& p_defaultarg,const Arg& p_argtype1=Arg(),const Arg& p_argtype2=Arg(),const Arg& p_argtype3=Arg(),const Arg& p_argtype4=Arg(),const Arg& p_argtype5=Arg()) { FuncData funcdata; @@ -300,12 +310,12 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var String *s = reinterpret_cast<String*>(p_self._data._mem); CharString charstr = s->ascii(); - ByteArray retval; + PoolByteArray retval; size_t len = charstr.length(); retval.resize(len); - ByteArray::Write w = retval.write(); + PoolByteArray::Write w = retval.write(); copymem(w.ptr(), charstr.ptr(), len); - w = DVector<uint8_t>::Write(); + w = PoolVector<uint8_t>::Write(); r_ret = retval; } @@ -315,12 +325,12 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var String *s = reinterpret_cast<String*>(p_self._data._mem); CharString charstr = s->utf8(); - ByteArray retval; + PoolByteArray retval; size_t len = charstr.length(); retval.resize(len); - ByteArray::Write w = retval.write(); + PoolByteArray::Write w = retval.write(); copymem(w.ptr(), charstr.ptr(), len); - w = DVector<uint8_t>::Write(); + w = PoolVector<uint8_t>::Write(); r_ret = retval; } @@ -370,6 +380,8 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var VCALL_LOCALMEM4R(Vector3, cubic_interpolate); VCALL_LOCALMEM1R(Vector3, dot); VCALL_LOCALMEM1R(Vector3, cross); + VCALL_LOCALMEM1R(Vector3, outer); + VCALL_LOCALMEM0R(Vector3, to_diagonal_matrix); VCALL_LOCALMEM0R(Vector3, abs); VCALL_LOCALMEM0R(Vector3, floor); VCALL_LOCALMEM0R(Vector3, ceil); @@ -413,10 +425,6 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var r_ret=Variant(); } - static void _call_Vector2_floorf(Variant& r_ret,Variant& p_self,const Variant** p_args) { - r_ret = reinterpret_cast<Vector2*>(p_self._data._mem)->floor(); - }; - VCALL_LOCALMEM0R(Quat,length); VCALL_LOCALMEM0R(Quat,length_squared); VCALL_LOCALMEM0R(Quat,normalized); @@ -455,8 +463,6 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var VCALL_LOCALMEM0R(Dictionary,hash); VCALL_LOCALMEM0R(Dictionary,keys); VCALL_LOCALMEM0R(Dictionary,values); - VCALL_LOCALMEM1R(Dictionary,parse_json); - VCALL_LOCALMEM0R(Dictionary,to_json); VCALL_LOCALMEM2(Array,set); VCALL_LOCALMEM1R(Array,get); @@ -472,6 +478,8 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var VCALL_LOCALMEM1(Array,resize); VCALL_LOCALMEM2(Array,insert); VCALL_LOCALMEM1(Array,remove); + VCALL_LOCALMEM0R(Array,front); + VCALL_LOCALMEM0R(Array,back); VCALL_LOCALMEM2R(Array,find); VCALL_LOCALMEM2R(Array,rfind); VCALL_LOCALMEM1R(Array,find_last); @@ -483,12 +491,12 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var VCALL_LOCALMEM0(Array,invert); VCALL_LOCALMEM0R(Array,is_shared); - static void _call_ByteArray_get_string_from_ascii(Variant& r_ret,Variant& p_self,const Variant** p_args) { + static void _call_PoolByteArray_get_string_from_ascii(Variant& r_ret,Variant& p_self,const Variant** p_args) { - ByteArray* ba = reinterpret_cast<ByteArray*>(p_self._data._mem); + PoolByteArray* ba = reinterpret_cast<PoolByteArray*>(p_self._data._mem); String s; if (ba->size()>=0) { - ByteArray::Read r = ba->read(); + PoolByteArray::Read r = ba->read(); CharString cs; cs.resize(ba->size()+1); copymem(cs.ptr(),r.ptr(),ba->size()); @@ -499,94 +507,94 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var r_ret=s; } - static void _call_ByteArray_get_string_from_utf8(Variant& r_ret,Variant& p_self,const Variant** p_args) { + static void _call_PoolByteArray_get_string_from_utf8(Variant& r_ret,Variant& p_self,const Variant** p_args) { - ByteArray* ba = reinterpret_cast<ByteArray*>(p_self._data._mem); + PoolByteArray* ba = reinterpret_cast<PoolByteArray*>(p_self._data._mem); String s; if (ba->size()>=0) { - ByteArray::Read r = ba->read(); + PoolByteArray::Read r = ba->read(); s.parse_utf8((const char*)r.ptr(),ba->size()); } r_ret=s; } - VCALL_LOCALMEM0R(ByteArray,size); - VCALL_LOCALMEM2(ByteArray,set); - VCALL_LOCALMEM1R(ByteArray,get); - VCALL_LOCALMEM1(ByteArray,push_back); - VCALL_LOCALMEM1(ByteArray,resize); - VCALL_LOCALMEM2R(ByteArray,insert); - VCALL_LOCALMEM1(ByteArray,remove); - VCALL_LOCALMEM1(ByteArray,append); - VCALL_LOCALMEM1(ByteArray,append_array); - VCALL_LOCALMEM0(ByteArray,invert); - VCALL_LOCALMEM2R(ByteArray,subarray); - - VCALL_LOCALMEM0R(IntArray,size); - VCALL_LOCALMEM2(IntArray,set); - VCALL_LOCALMEM1R(IntArray,get); - VCALL_LOCALMEM1(IntArray,push_back); - VCALL_LOCALMEM1(IntArray,resize); - VCALL_LOCALMEM2R(IntArray,insert); - VCALL_LOCALMEM1(IntArray,remove); - VCALL_LOCALMEM1(IntArray,append); - VCALL_LOCALMEM1(IntArray,append_array); - VCALL_LOCALMEM0(IntArray,invert); - - VCALL_LOCALMEM0R(RealArray,size); - VCALL_LOCALMEM2(RealArray,set); - VCALL_LOCALMEM1R(RealArray,get); - VCALL_LOCALMEM1(RealArray,push_back); - VCALL_LOCALMEM1(RealArray,resize); - VCALL_LOCALMEM2R(RealArray,insert); - VCALL_LOCALMEM1(RealArray,remove); - VCALL_LOCALMEM1(RealArray,append); - VCALL_LOCALMEM1(RealArray,append_array); - VCALL_LOCALMEM0(RealArray,invert); - - VCALL_LOCALMEM0R(StringArray,size); - VCALL_LOCALMEM2(StringArray,set); - VCALL_LOCALMEM1R(StringArray,get); - VCALL_LOCALMEM1(StringArray,push_back); - VCALL_LOCALMEM1(StringArray,resize); - VCALL_LOCALMEM2R(StringArray,insert); - VCALL_LOCALMEM1(StringArray,remove); - VCALL_LOCALMEM1(StringArray,append); - VCALL_LOCALMEM1(StringArray,append_array); - VCALL_LOCALMEM0(StringArray,invert); - - VCALL_LOCALMEM0R(Vector2Array,size); - VCALL_LOCALMEM2(Vector2Array,set); - VCALL_LOCALMEM1R(Vector2Array,get); - VCALL_LOCALMEM1(Vector2Array,push_back); - VCALL_LOCALMEM1(Vector2Array,resize); - VCALL_LOCALMEM2R(Vector2Array,insert); - VCALL_LOCALMEM1(Vector2Array,remove); - VCALL_LOCALMEM1(Vector2Array,append); - VCALL_LOCALMEM1(Vector2Array,append_array); - VCALL_LOCALMEM0(Vector2Array,invert); - - VCALL_LOCALMEM0R(Vector3Array,size); - VCALL_LOCALMEM2(Vector3Array,set); - VCALL_LOCALMEM1R(Vector3Array,get); - VCALL_LOCALMEM1(Vector3Array,push_back); - VCALL_LOCALMEM1(Vector3Array,resize); - VCALL_LOCALMEM2R(Vector3Array,insert); - VCALL_LOCALMEM1(Vector3Array,remove); - VCALL_LOCALMEM1(Vector3Array,append); - VCALL_LOCALMEM1(Vector3Array,append_array); - VCALL_LOCALMEM0(Vector3Array,invert); - - VCALL_LOCALMEM0R(ColorArray,size); - VCALL_LOCALMEM2(ColorArray,set); - VCALL_LOCALMEM1R(ColorArray,get); - VCALL_LOCALMEM1(ColorArray,push_back); - VCALL_LOCALMEM1(ColorArray,resize); - VCALL_LOCALMEM2R(ColorArray,insert); - VCALL_LOCALMEM1(ColorArray,remove); - VCALL_LOCALMEM1(ColorArray,append); - VCALL_LOCALMEM1(ColorArray,append_array); - VCALL_LOCALMEM0(ColorArray,invert); + VCALL_LOCALMEM0R(PoolByteArray,size); + VCALL_LOCALMEM2(PoolByteArray,set); + VCALL_LOCALMEM1R(PoolByteArray,get); + VCALL_LOCALMEM1(PoolByteArray,push_back); + VCALL_LOCALMEM1(PoolByteArray,resize); + VCALL_LOCALMEM2R(PoolByteArray,insert); + VCALL_LOCALMEM1(PoolByteArray,remove); + VCALL_LOCALMEM1(PoolByteArray,append); + VCALL_LOCALMEM1(PoolByteArray,append_array); + VCALL_LOCALMEM0(PoolByteArray,invert); + VCALL_LOCALMEM2R(PoolByteArray,subarray); + + VCALL_LOCALMEM0R(PoolIntArray,size); + VCALL_LOCALMEM2(PoolIntArray,set); + VCALL_LOCALMEM1R(PoolIntArray,get); + VCALL_LOCALMEM1(PoolIntArray,push_back); + VCALL_LOCALMEM1(PoolIntArray,resize); + VCALL_LOCALMEM2R(PoolIntArray,insert); + VCALL_LOCALMEM1(PoolIntArray,remove); + VCALL_LOCALMEM1(PoolIntArray,append); + VCALL_LOCALMEM1(PoolIntArray,append_array); + VCALL_LOCALMEM0(PoolIntArray,invert); + + VCALL_LOCALMEM0R(PoolRealArray,size); + VCALL_LOCALMEM2(PoolRealArray,set); + VCALL_LOCALMEM1R(PoolRealArray,get); + VCALL_LOCALMEM1(PoolRealArray,push_back); + VCALL_LOCALMEM1(PoolRealArray,resize); + VCALL_LOCALMEM2R(PoolRealArray,insert); + VCALL_LOCALMEM1(PoolRealArray,remove); + VCALL_LOCALMEM1(PoolRealArray,append); + VCALL_LOCALMEM1(PoolRealArray,append_array); + VCALL_LOCALMEM0(PoolRealArray,invert); + + VCALL_LOCALMEM0R(PoolStringArray,size); + VCALL_LOCALMEM2(PoolStringArray,set); + VCALL_LOCALMEM1R(PoolStringArray,get); + VCALL_LOCALMEM1(PoolStringArray,push_back); + VCALL_LOCALMEM1(PoolStringArray,resize); + VCALL_LOCALMEM2R(PoolStringArray,insert); + VCALL_LOCALMEM1(PoolStringArray,remove); + VCALL_LOCALMEM1(PoolStringArray,append); + VCALL_LOCALMEM1(PoolStringArray,append_array); + VCALL_LOCALMEM0(PoolStringArray,invert); + + VCALL_LOCALMEM0R(PoolVector2Array,size); + VCALL_LOCALMEM2(PoolVector2Array,set); + VCALL_LOCALMEM1R(PoolVector2Array,get); + VCALL_LOCALMEM1(PoolVector2Array,push_back); + VCALL_LOCALMEM1(PoolVector2Array,resize); + VCALL_LOCALMEM2R(PoolVector2Array,insert); + VCALL_LOCALMEM1(PoolVector2Array,remove); + VCALL_LOCALMEM1(PoolVector2Array,append); + VCALL_LOCALMEM1(PoolVector2Array,append_array); + VCALL_LOCALMEM0(PoolVector2Array,invert); + + VCALL_LOCALMEM0R(PoolVector3Array,size); + VCALL_LOCALMEM2(PoolVector3Array,set); + VCALL_LOCALMEM1R(PoolVector3Array,get); + VCALL_LOCALMEM1(PoolVector3Array,push_back); + VCALL_LOCALMEM1(PoolVector3Array,resize); + VCALL_LOCALMEM2R(PoolVector3Array,insert); + VCALL_LOCALMEM1(PoolVector3Array,remove); + VCALL_LOCALMEM1(PoolVector3Array,append); + VCALL_LOCALMEM1(PoolVector3Array,append_array); + VCALL_LOCALMEM0(PoolVector3Array,invert); + + VCALL_LOCALMEM0R(PoolColorArray,size); + VCALL_LOCALMEM2(PoolColorArray,set); + VCALL_LOCALMEM1R(PoolColorArray,get); + VCALL_LOCALMEM1(PoolColorArray,push_back); + VCALL_LOCALMEM1(PoolColorArray,resize); + VCALL_LOCALMEM2R(PoolColorArray,insert); + VCALL_LOCALMEM1(PoolColorArray,remove); + VCALL_LOCALMEM1(PoolColorArray,append); + VCALL_LOCALMEM1(PoolColorArray,append_array); + VCALL_LOCALMEM0(PoolColorArray,invert); #define VCALL_PTR0(m_type,m_method)\ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Variant** p_args) { reinterpret_cast<m_type*>(p_self._data._ptr)->m_method(); } @@ -617,13 +625,9 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var VCALL_PTR0R(Image,get_width); VCALL_PTR0R(Image,get_height); VCALL_PTR0R(Image,empty); - VCALL_PTR3R(Image,get_pixel); - VCALL_PTR4(Image, put_pixel); VCALL_PTR0R(Image,get_used_rect); - VCALL_PTR3R(Image,brushed); VCALL_PTR1R(Image,load); VCALL_PTR1R(Image,save_png); - VCALL_PTR3(Image,brush_transfer); VCALL_PTR1R(Image,get_rect); VCALL_PTR1R(Image,compressed); VCALL_PTR0R(Image,decompressed); @@ -633,93 +637,93 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var VCALL_PTR1R(Image, converted); VCALL_PTR0(Image, fix_alpha_edges); - VCALL_PTR0R( AABB, get_area ); - VCALL_PTR0R( AABB, has_no_area ); - VCALL_PTR0R( AABB, has_no_surface ); - VCALL_PTR1R( AABB, intersects ); - VCALL_PTR1R( AABB, encloses ); - VCALL_PTR1R( AABB, merge ); - VCALL_PTR1R( AABB, intersection ); - VCALL_PTR1R( AABB, intersects_plane ); - VCALL_PTR2R( AABB, intersects_segment ); - VCALL_PTR1R( AABB, has_point ); - VCALL_PTR1R( AABB, get_support ); - VCALL_PTR0R( AABB, get_longest_axis ); - VCALL_PTR0R( AABB, get_longest_axis_index ); - VCALL_PTR0R( AABB, get_longest_axis_size ); - VCALL_PTR0R( AABB, get_shortest_axis ); - VCALL_PTR0R( AABB, get_shortest_axis_index ); - VCALL_PTR0R( AABB, get_shortest_axis_size ); - VCALL_PTR1R( AABB, expand ); - VCALL_PTR1R( AABB, grow ); - VCALL_PTR1R( AABB, get_endpoint ); - - VCALL_PTR0R( Matrix32, inverse ); - VCALL_PTR0R( Matrix32, affine_inverse ); - VCALL_PTR0R( Matrix32, get_rotation ); - VCALL_PTR0R( Matrix32, get_origin ); - VCALL_PTR0R( Matrix32, get_scale ); - VCALL_PTR0R( Matrix32, orthonormalized ); - VCALL_PTR1R( Matrix32, rotated ); - VCALL_PTR1R( Matrix32, scaled ); - VCALL_PTR1R( Matrix32, translated ); - VCALL_PTR2R( Matrix32, interpolate_with ); - - static void _call_Matrix32_xform(Variant& r_ret,Variant& p_self,const Variant** p_args) { + VCALL_PTR0R( Rect3, get_area ); + VCALL_PTR0R( Rect3, has_no_area ); + VCALL_PTR0R( Rect3, has_no_surface ); + VCALL_PTR1R( Rect3, intersects ); + VCALL_PTR1R( Rect3, encloses ); + VCALL_PTR1R( Rect3, merge ); + VCALL_PTR1R( Rect3, intersection ); + VCALL_PTR1R( Rect3, intersects_plane ); + VCALL_PTR2R( Rect3, intersects_segment ); + VCALL_PTR1R( Rect3, has_point ); + VCALL_PTR1R( Rect3, get_support ); + VCALL_PTR0R( Rect3, get_longest_axis ); + VCALL_PTR0R( Rect3, get_longest_axis_index ); + VCALL_PTR0R( Rect3, get_longest_axis_size ); + VCALL_PTR0R( Rect3, get_shortest_axis ); + VCALL_PTR0R( Rect3, get_shortest_axis_index ); + VCALL_PTR0R( Rect3, get_shortest_axis_size ); + VCALL_PTR1R( Rect3, expand ); + VCALL_PTR1R( Rect3, grow ); + VCALL_PTR1R( Rect3, get_endpoint ); + + VCALL_PTR0R( Transform2D, inverse ); + VCALL_PTR0R( Transform2D, affine_inverse ); + VCALL_PTR0R( Transform2D, get_rotation ); + VCALL_PTR0R( Transform2D, get_origin ); + VCALL_PTR0R( Transform2D, get_scale ); + VCALL_PTR0R( Transform2D, orthonormalized ); + VCALL_PTR1R( Transform2D, rotated ); + VCALL_PTR1R( Transform2D, scaled ); + VCALL_PTR1R( Transform2D, translated ); + VCALL_PTR2R( Transform2D, interpolate_with ); + + static void _call_Transform2D_xform(Variant& r_ret,Variant& p_self,const Variant** p_args) { switch(p_args[0]->type) { - case Variant::VECTOR2: r_ret=reinterpret_cast<Matrix32*>(p_self._data._ptr)->xform( p_args[0]->operator Vector2()); return; - case Variant::RECT2: r_ret=reinterpret_cast<Matrix32*>(p_self._data._ptr)->xform( p_args[0]->operator Rect2()); return; + case Variant::VECTOR2: r_ret=reinterpret_cast<Transform2D*>(p_self._data._ptr)->xform( p_args[0]->operator Vector2()); return; + case Variant::RECT2: r_ret=reinterpret_cast<Transform2D*>(p_self._data._ptr)->xform( p_args[0]->operator Rect2()); return; default: r_ret=Variant(); } } - static void _call_Matrix32_xform_inv(Variant& r_ret,Variant& p_self,const Variant** p_args) { + static void _call_Transform2D_xform_inv(Variant& r_ret,Variant& p_self,const Variant** p_args) { switch(p_args[0]->type) { - case Variant::VECTOR2: r_ret=reinterpret_cast<Matrix32*>(p_self._data._ptr)->xform_inv( p_args[0]->operator Vector2()); return; - case Variant::RECT2: r_ret=reinterpret_cast<Matrix32*>(p_self._data._ptr)->xform_inv( p_args[0]->operator Rect2()); return; + case Variant::VECTOR2: r_ret=reinterpret_cast<Transform2D*>(p_self._data._ptr)->xform_inv( p_args[0]->operator Vector2()); return; + case Variant::RECT2: r_ret=reinterpret_cast<Transform2D*>(p_self._data._ptr)->xform_inv( p_args[0]->operator Rect2()); return; default: r_ret=Variant(); } } - static void _call_Matrix32_basis_xform(Variant& r_ret,Variant& p_self,const Variant** p_args) { + static void _call_Transform2D_basis_xform(Variant& r_ret,Variant& p_self,const Variant** p_args) { switch(p_args[0]->type) { - case Variant::VECTOR2: r_ret=reinterpret_cast<Matrix32*>(p_self._data._ptr)->basis_xform( p_args[0]->operator Vector2()); return; + case Variant::VECTOR2: r_ret=reinterpret_cast<Transform2D*>(p_self._data._ptr)->basis_xform( p_args[0]->operator Vector2()); return; default: r_ret=Variant(); } } - static void _call_Matrix32_basis_xform_inv(Variant& r_ret,Variant& p_self,const Variant** p_args) { + static void _call_Transform2D_basis_xform_inv(Variant& r_ret,Variant& p_self,const Variant** p_args) { switch(p_args[0]->type) { - case Variant::VECTOR2: r_ret=reinterpret_cast<Matrix32*>(p_self._data._ptr)->basis_xform_inv( p_args[0]->operator Vector2()); return; + case Variant::VECTOR2: r_ret=reinterpret_cast<Transform2D*>(p_self._data._ptr)->basis_xform_inv( p_args[0]->operator Vector2()); return; default: r_ret=Variant(); } } - VCALL_PTR0R( Matrix3, inverse ); - VCALL_PTR0R( Matrix3, transposed ); - VCALL_PTR0R( Matrix3, determinant ); - VCALL_PTR2R( Matrix3, rotated ); - VCALL_PTR1R( Matrix3, scaled ); - VCALL_PTR0R( Matrix3, get_scale ); - VCALL_PTR0R( Matrix3, get_euler ); - VCALL_PTR1R( Matrix3, tdotx ); - VCALL_PTR1R( Matrix3, tdoty ); - VCALL_PTR1R( Matrix3, tdotz ); - VCALL_PTR1R( Matrix3, xform ); - VCALL_PTR1R( Matrix3, xform_inv ); - VCALL_PTR0R( Matrix3, get_orthogonal_index ); - VCALL_PTR0R( Matrix3, orthonormalized ); + VCALL_PTR0R( Basis, inverse ); + VCALL_PTR0R( Basis, transposed ); + VCALL_PTR0R( Basis, determinant ); + VCALL_PTR2R( Basis, rotated ); + VCALL_PTR1R( Basis, scaled ); + VCALL_PTR0R( Basis, get_scale ); + VCALL_PTR0R( Basis, get_euler ); + VCALL_PTR1R( Basis, tdotx ); + VCALL_PTR1R( Basis, tdoty ); + VCALL_PTR1R( Basis, tdotz ); + VCALL_PTR1R( Basis, xform ); + VCALL_PTR1R( Basis, xform_inv ); + VCALL_PTR0R( Basis, get_orthogonal_index ); + VCALL_PTR0R( Basis, orthonormalized ); VCALL_PTR0R( Transform, inverse ); @@ -736,7 +740,7 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var case Variant::VECTOR3: r_ret=reinterpret_cast<Transform*>(p_self._data._ptr)->xform( p_args[0]->operator Vector3()); return; case Variant::PLANE: r_ret=reinterpret_cast<Transform*>(p_self._data._ptr)->xform( p_args[0]->operator Plane()); return; - case Variant::_AABB: r_ret=reinterpret_cast<Transform*>(p_self._data._ptr)->xform( p_args[0]->operator AABB()); return; + case Variant::RECT3: r_ret=reinterpret_cast<Transform*>(p_self._data._ptr)->xform( p_args[0]->operator Rect3()); return; default: r_ret=Variant(); } @@ -748,7 +752,7 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var case Variant::VECTOR3: r_ret=reinterpret_cast<Transform*>(p_self._data._ptr)->xform_inv( p_args[0]->operator Vector3()); return; case Variant::PLANE: r_ret=reinterpret_cast<Transform*>(p_self._data._ptr)->xform_inv( p_args[0]->operator Plane()); return; - case Variant::_AABB: r_ret=reinterpret_cast<Transform*>(p_self._data._ptr)->xform_inv( p_args[0]->operator AABB()); return; + case Variant::RECT3: r_ret=reinterpret_cast<Transform*>(p_self._data._ptr)->xform_inv( p_args[0]->operator Rect3()); return; default: r_ret=Variant(); } } @@ -800,15 +804,15 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var r_ret=Rect2(*p_args[0],*p_args[1],*p_args[2],*p_args[3]); } - static void Matrix32_init2(Variant& r_ret,const Variant** p_args) { + static void Transform2D_init2(Variant& r_ret,const Variant** p_args) { - Matrix32 m(*p_args[0], *p_args[1]); + Transform2D m(*p_args[0], *p_args[1]); r_ret=m; } - static void Matrix32_init3(Variant& r_ret,const Variant** p_args) { + static void Transform2D_init3(Variant& r_ret,const Variant** p_args) { - Matrix32 m; + Transform2D m; m[0]=*p_args[0]; m[1]=*p_args[1]; m[2]=*p_args[2]; @@ -869,23 +873,23 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var r_ret=Color::hex(*p_args[0]); } - static void AABB_init1(Variant& r_ret,const Variant** p_args) { + static void Rect3_init1(Variant& r_ret,const Variant** p_args) { - r_ret=AABB(*p_args[0],*p_args[1]); + r_ret=Rect3(*p_args[0],*p_args[1]); } - static void Matrix3_init1(Variant& r_ret,const Variant** p_args) { + static void Basis_init1(Variant& r_ret,const Variant** p_args) { - Matrix3 m; + Basis m; m.set_axis(0,*p_args[0]); m.set_axis(1,*p_args[1]); m.set_axis(2,*p_args[2]); r_ret=m; } - static void Matrix3_init2(Variant& r_ret,const Variant** p_args) { + static void Basis_init2(Variant& r_ret,const Variant** p_args) { - r_ret=Matrix3(p_args[0]->operator Vector3(),p_args[1]->operator real_t()); + r_ret=Basis(p_args[0]->operator Vector3(),p_args[1]->operator real_t()); } static void Transform_init1(Variant& r_ret,const Variant** p_args) { @@ -900,7 +904,7 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var static void Transform_init2(Variant& r_ret,const Variant** p_args) { - r_ret=Transform(p_args[0]->operator Matrix3(),p_args[1]->operator Vector3()); + r_ret=Transform(p_args[0]->operator Basis(),p_args[1]->operator Vector3()); } static void Image_init1(Variant& r_ret, const Variant** p_args) { @@ -1050,11 +1054,11 @@ Variant Variant::construct(const Variant::Type p_type, const Variant** p_args, i case VECTOR2: return Vector2(); // 5 case RECT2: return Rect2(); case VECTOR3: return Vector3(); - case MATRIX32: return Matrix32(); + case TRANSFORM2D: return Transform2D(); case PLANE: return Plane(); case QUAT: return Quat(); - case _AABB: return AABB(); //sorry naming convention fail :( not like it's used often // 10 - case MATRIX3: return Matrix3(); + case RECT3: return Rect3(); //sorry naming convention fail :( not like it's used often // 10 + case BASIS: return Basis(); case TRANSFORM: return Transform(); // misc types @@ -1066,13 +1070,13 @@ Variant Variant::construct(const Variant::Type p_type, const Variant** p_args, i case INPUT_EVENT: return InputEvent();; case DICTIONARY: return Dictionary();; case ARRAY: return Array();; // 20 - case RAW_ARRAY: return ByteArray();; - case INT_ARRAY: return IntArray();; - case REAL_ARRAY: return RealArray();; - case STRING_ARRAY: return StringArray();; - case VECTOR2_ARRAY: return Vector2Array();; // 25 - case VECTOR3_ARRAY: return Vector3Array();; // 25 - case COLOR_ARRAY: return ColorArray();; + case POOL_BYTE_ARRAY: return PoolByteArray();; + case POOL_INT_ARRAY: return PoolIntArray();; + case POOL_REAL_ARRAY: return PoolRealArray();; + case POOL_STRING_ARRAY: return PoolStringArray();; + case POOL_VECTOR2_ARRAY: return PoolVector2Array();; // 25 + case POOL_VECTOR3_ARRAY: return PoolVector3Array();; // 25 + case POOL_COLOR_ARRAY: return PoolColorArray();; default: return Variant(); } @@ -1121,8 +1125,8 @@ Variant Variant::construct(const Variant::Type p_type, const Variant** p_args, i case VECTOR3: return (Vector3(*p_args[0])); case PLANE: return (Plane(*p_args[0])); case QUAT: return (Quat(*p_args[0])); - case _AABB: return (AABB(*p_args[0])); //sorry naming convention fail :( not like it's used often // 10 - case MATRIX3: return (Matrix3(p_args[0]->operator Matrix3())); + case RECT3: return (Rect3(*p_args[0])); //sorry naming convention fail :( not like it's used often // 10 + case BASIS: return (Basis(p_args[0]->operator Basis())); case TRANSFORM: return (Transform(p_args[0]->operator Transform())); // misc types @@ -1136,13 +1140,13 @@ Variant Variant::construct(const Variant::Type p_type, const Variant** p_args, i case ARRAY: return p_args[0]->operator Array(); // arrays - case RAW_ARRAY: return (ByteArray(*p_args[0])); - case INT_ARRAY: return (IntArray(*p_args[0])); - case REAL_ARRAY: return (RealArray(*p_args[0])); - case STRING_ARRAY: return (StringArray(*p_args[0])); - case VECTOR2_ARRAY: return (Vector2Array(*p_args[0])); // 25 - case VECTOR3_ARRAY: return (Vector3Array(*p_args[0])); // 25 - case COLOR_ARRAY: return (ColorArray(*p_args[0])); + case POOL_BYTE_ARRAY: return (PoolByteArray(*p_args[0])); + case POOL_INT_ARRAY: return (PoolIntArray(*p_args[0])); + case POOL_REAL_ARRAY: return (PoolRealArray(*p_args[0])); + case POOL_STRING_ARRAY: return (PoolStringArray(*p_args[0])); + case POOL_VECTOR2_ARRAY: return (PoolVector2Array(*p_args[0])); // 25 + case POOL_VECTOR3_ARRAY: return (PoolVector3Array(*p_args[0])); // 25 + case POOL_COLOR_ARRAY: return (PoolColorArray(*p_args[0])); default: return Variant(); } } @@ -1385,15 +1389,15 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC1(STRING,BOOL,String,ends_with,STRING,"text",varray()); ADDFUNC1(STRING,BOOL,String,is_subsequence_of,STRING,"text",varray()); ADDFUNC1(STRING,BOOL,String,is_subsequence_ofi,STRING,"text",varray()); - ADDFUNC0(STRING,STRING_ARRAY,String,bigrams,varray()); + ADDFUNC0(STRING,POOL_STRING_ARRAY,String,bigrams,varray()); ADDFUNC1(STRING,REAL,String,similarity,STRING,"text",varray()); ADDFUNC2(STRING,STRING,String,replace,STRING,"what",STRING,"forwhat",varray()); ADDFUNC2(STRING,STRING,String,replacen,STRING,"what",STRING,"forwhat",varray()); ADDFUNC2(STRING,STRING,String,insert,INT,"pos",STRING,"what",varray()); ADDFUNC0(STRING,STRING,String,capitalize,varray()); - ADDFUNC2(STRING,STRING_ARRAY,String,split,STRING,"divisor",BOOL,"allow_empty",varray(true)); - ADDFUNC2(STRING,REAL_ARRAY,String,split_floats,STRING,"divisor",BOOL,"allow_empty",varray(true)); + ADDFUNC2(STRING,POOL_STRING_ARRAY,String,split,STRING,"divisor",BOOL,"allow_empty",varray(true)); + ADDFUNC2(STRING,POOL_REAL_ARRAY,String,split_floats,STRING,"divisor",BOOL,"allow_empty",varray(true)); ADDFUNC0(STRING,STRING,String,to_upper,varray()); ADDFUNC0(STRING,STRING,String,to_lower,varray()); @@ -1409,8 +1413,8 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC0(STRING,INT,String,hash,varray()); ADDFUNC0(STRING,STRING,String,md5_text,varray()); ADDFUNC0(STRING,STRING,String,sha256_text,varray()); - ADDFUNC0(STRING,RAW_ARRAY,String,md5_buffer,varray()); - ADDFUNC0(STRING,RAW_ARRAY,String,sha256_buffer,varray()); + ADDFUNC0(STRING,POOL_BYTE_ARRAY,String,md5_buffer,varray()); + ADDFUNC0(STRING,POOL_BYTE_ARRAY,String,sha256_buffer,varray()); ADDFUNC0(STRING,BOOL,String,empty,varray()); ADDFUNC0(STRING,BOOL,String,is_abs_path,varray()); ADDFUNC0(STRING,BOOL,String,is_rel_path,varray()); @@ -1434,8 +1438,9 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC1(STRING,STRING,String,pad_decimals,INT,"digits",varray()); ADDFUNC1(STRING,STRING,String,pad_zeros,INT,"digits",varray()); - ADDFUNC0(STRING,RAW_ARRAY,String,to_ascii,varray()); - ADDFUNC0(STRING,RAW_ARRAY,String,to_utf8,varray()); + ADDFUNC0(STRING,POOL_BYTE_ARRAY,String,to_ascii,varray()); + ADDFUNC0(STRING,POOL_BYTE_ARRAY,String,to_utf8,varray()); + ADDFUNC0(VECTOR2,VECTOR2,Vector2,normalized,varray()); @@ -1451,7 +1456,6 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC1(VECTOR2,VECTOR2,Vector2,rotated,REAL,"phi",varray()); ADDFUNC0(VECTOR2,VECTOR2,Vector2,tangent,varray()); ADDFUNC0(VECTOR2,VECTOR2,Vector2,floor,varray()); - ADDFUNC0(VECTOR2,VECTOR2,Vector2,floorf,varray()); ADDFUNC1(VECTOR2,VECTOR2,Vector2,snapped,VECTOR2,"by",varray()); ADDFUNC0(VECTOR2,REAL,Vector2,get_aspect,varray()); ADDFUNC1(VECTOR2,REAL,Vector2,dot,VECTOR2,"with",varray()); @@ -1483,6 +1487,9 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC4(VECTOR3,VECTOR3,Vector3,cubic_interpolate,VECTOR3,"b",VECTOR3,"pre_a",VECTOR3,"post_b",REAL,"t",varray()); ADDFUNC1(VECTOR3,REAL,Vector3,dot,VECTOR3,"b",varray()); ADDFUNC1(VECTOR3,VECTOR3,Vector3,cross,VECTOR3,"b",varray()); + ADDFUNC1(VECTOR3,BASIS,Vector3,outer,VECTOR3,"b",varray()); + ADDFUNC0(VECTOR3,BASIS,Vector3,to_diagonal_matrix,varray()); + ADDFUNC0(VECTOR3,VECTOR3,Vector3,abs,varray()); ADDFUNC0(VECTOR3,VECTOR3,Vector3,abs,varray()); ADDFUNC0(VECTOR3,VECTOR3,Vector3,floor,varray()); ADDFUNC0(VECTOR3,VECTOR3,Vector3,ceil,varray()); @@ -1526,18 +1533,14 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC0(IMAGE, INT, Image, get_width, varray()); ADDFUNC0(IMAGE, INT, Image, get_height, varray()); ADDFUNC0(IMAGE, BOOL, Image, empty, varray()); - ADDFUNC3(IMAGE, COLOR, Image, get_pixel, INT, "x", INT, "y", INT, "mipmap_level", varray(0)); - ADDFUNC4(IMAGE, NIL, Image, put_pixel, INT, "x", INT, "y", COLOR, "color", INT, "mipmap_level", varray(0)); - ADDFUNC3(IMAGE, IMAGE, Image, brushed, IMAGE, "src", IMAGE, "brush", VECTOR2, "pos", varray(0)); ADDFUNC1(IMAGE, INT, Image, load, STRING, "path", varray(0)); ADDFUNC1(IMAGE, INT, Image, save_png, STRING, "path", varray(0)); - ADDFUNC3(IMAGE, NIL, Image, brush_transfer, IMAGE, "src", IMAGE, "brush", VECTOR2, "pos", varray(0)); ADDFUNC0(IMAGE, RECT2, Image, get_used_rect, varray(0)); ADDFUNC1(IMAGE, IMAGE, Image, get_rect, RECT2, "area", varray(0)); ADDFUNC1(IMAGE, IMAGE, Image, compressed, INT, "format", varray(0)); ADDFUNC0(IMAGE, IMAGE, Image, decompressed, varray(0)); ADDFUNC3(IMAGE, IMAGE, Image, resized, INT, "x", INT, "y", INT, "interpolation", varray(((int)Image::INTERPOLATE_BILINEAR))); - ADDFUNC0(IMAGE, RAW_ARRAY, Image, get_data, varray()); + ADDFUNC0(IMAGE, POOL_BYTE_ARRAY, Image, get_data, varray()); ADDFUNC3(IMAGE, NIL, Image, blit_rect, IMAGE, "src", RECT2, "src_rect", VECTOR2, "dest", varray(0)); ADDFUNC1(IMAGE, IMAGE, Image, converted, INT, "format", varray(0)); ADDFUNC0(IMAGE, NIL, Image, fix_alpha_edges, varray()); @@ -1562,9 +1565,6 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC0(DICTIONARY,ARRAY,Dictionary,keys,varray()); ADDFUNC0(DICTIONARY,ARRAY,Dictionary,values,varray()); - ADDFUNC1(DICTIONARY,INT,Dictionary,parse_json,STRING,"json",varray()); - ADDFUNC0(DICTIONARY,STRING,Dictionary,to_json,varray()); - ADDFUNC0(ARRAY,INT,Array,size,varray()); ADDFUNC0(ARRAY,BOOL,Array,empty,varray()); ADDFUNC0(ARRAY,NIL,Array,clear,varray()); @@ -1576,6 +1576,8 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC2(ARRAY,NIL,Array,insert,INT,"pos",NIL,"value",varray()); ADDFUNC1(ARRAY,NIL,Array,remove,INT,"pos",varray()); ADDFUNC1(ARRAY,NIL,Array,erase,NIL,"value",varray()); + ADDFUNC0(ARRAY,NIL,Array,front,varray()); + ADDFUNC0(ARRAY,NIL,Array,back,varray()); ADDFUNC2(ARRAY,INT,Array,find,NIL,"what",INT,"from",varray(0)); ADDFUNC2(ARRAY,INT,Array,rfind,NIL,"what",INT,"from",varray(-1)); ADDFUNC1(ARRAY,INT,Array,find_last,NIL,"value",varray()); @@ -1588,133 +1590,133 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC0(ARRAY,NIL,Array,invert,varray()); ADDFUNC0(ARRAY,BOOL,Array,is_shared,varray()); - ADDFUNC0(RAW_ARRAY,INT,ByteArray,size,varray()); - ADDFUNC2(RAW_ARRAY,NIL,ByteArray,set,INT,"idx",INT,"byte",varray()); - ADDFUNC1(RAW_ARRAY,NIL,ByteArray,push_back,INT,"byte",varray()); - ADDFUNC1(RAW_ARRAY,NIL,ByteArray,append,INT,"byte",varray()); - ADDFUNC1(RAW_ARRAY,NIL,ByteArray,append_array,RAW_ARRAY,"array",varray()); - ADDFUNC1(RAW_ARRAY,NIL,ByteArray,remove,INT,"idx",varray()); - ADDFUNC2(RAW_ARRAY,INT,ByteArray,insert,INT,"idx",INT,"byte",varray()); - ADDFUNC1(RAW_ARRAY,NIL,ByteArray,resize,INT,"idx",varray()); - ADDFUNC0(RAW_ARRAY,NIL,ByteArray,invert,varray()); - ADDFUNC2(RAW_ARRAY,RAW_ARRAY,ByteArray,subarray,INT,"from",INT,"to",varray()); - - ADDFUNC0(RAW_ARRAY,STRING,ByteArray,get_string_from_ascii,varray()); - ADDFUNC0(RAW_ARRAY,STRING,ByteArray,get_string_from_utf8,varray()); - - - ADDFUNC0(INT_ARRAY,INT,IntArray,size,varray()); - ADDFUNC2(INT_ARRAY,NIL,IntArray,set,INT,"idx",INT,"integer",varray()); - ADDFUNC1(INT_ARRAY,NIL,IntArray,push_back,INT,"integer",varray()); - ADDFUNC1(INT_ARRAY,NIL,IntArray,append,INT,"integer",varray()); - ADDFUNC1(INT_ARRAY,NIL,IntArray,append_array,INT_ARRAY,"array",varray()); - ADDFUNC1(INT_ARRAY,NIL,IntArray,remove,INT,"idx",varray()); - ADDFUNC2(INT_ARRAY,INT,IntArray,insert,INT,"idx",INT,"integer",varray()); - ADDFUNC1(INT_ARRAY,NIL,IntArray,resize,INT,"idx",varray()); - ADDFUNC0(INT_ARRAY,NIL,IntArray,invert,varray()); - - ADDFUNC0(REAL_ARRAY,INT,RealArray,size,varray()); - ADDFUNC2(REAL_ARRAY,NIL,RealArray,set,INT,"idx",REAL,"value",varray()); - ADDFUNC1(REAL_ARRAY,NIL,RealArray,push_back,REAL,"value",varray()); - ADDFUNC1(REAL_ARRAY,NIL,RealArray,append,REAL,"value",varray()); - ADDFUNC1(REAL_ARRAY,NIL,RealArray,append_array,REAL_ARRAY,"array",varray()); - ADDFUNC1(REAL_ARRAY,NIL,RealArray,remove,INT,"idx",varray()); - ADDFUNC2(REAL_ARRAY,INT,RealArray,insert,INT,"idx",REAL,"value",varray()); - ADDFUNC1(REAL_ARRAY,NIL,RealArray,resize,INT,"idx",varray()); - ADDFUNC0(REAL_ARRAY,NIL,RealArray,invert,varray()); - - ADDFUNC0(STRING_ARRAY,INT,StringArray,size,varray()); - ADDFUNC2(STRING_ARRAY,NIL,StringArray,set,INT,"idx",STRING,"string",varray()); - ADDFUNC1(STRING_ARRAY,NIL,StringArray,push_back,STRING,"string",varray()); - ADDFUNC1(STRING_ARRAY,NIL,StringArray,append,STRING,"string",varray()); - ADDFUNC1(STRING_ARRAY,NIL,StringArray,append_array,STRING_ARRAY,"array",varray()); - ADDFUNC1(STRING_ARRAY,NIL,StringArray,remove,INT,"idx",varray()); - ADDFUNC2(STRING_ARRAY,INT,StringArray,insert,INT,"idx",STRING,"string",varray()); - ADDFUNC1(STRING_ARRAY,NIL,StringArray,resize,INT,"idx",varray()); - ADDFUNC0(STRING_ARRAY,NIL,StringArray,invert,varray()); - - ADDFUNC0(VECTOR2_ARRAY,INT,Vector2Array,size,varray()); - ADDFUNC2(VECTOR2_ARRAY,NIL,Vector2Array,set,INT,"idx",VECTOR2,"vector2",varray()); - ADDFUNC1(VECTOR2_ARRAY,NIL,Vector2Array,push_back,VECTOR2,"vector2",varray()); - ADDFUNC1(VECTOR2_ARRAY,NIL,Vector2Array,append,VECTOR2,"vector2",varray()); - ADDFUNC1(VECTOR2_ARRAY,NIL,Vector2Array,append_array,VECTOR2_ARRAY,"array",varray()); - ADDFUNC1(VECTOR2_ARRAY,NIL,Vector2Array,remove,INT,"idx",varray()); - ADDFUNC2(VECTOR2_ARRAY,INT,Vector2Array,insert,INT,"idx",VECTOR2,"vector2",varray()); - ADDFUNC1(VECTOR2_ARRAY,NIL,Vector2Array,resize,INT,"idx",varray()); - ADDFUNC0(VECTOR2_ARRAY,NIL,Vector2Array,invert,varray()); - - ADDFUNC0(VECTOR3_ARRAY,INT,Vector3Array,size,varray()); - ADDFUNC2(VECTOR3_ARRAY,NIL,Vector3Array,set,INT,"idx",VECTOR3,"vector3",varray()); - ADDFUNC1(VECTOR3_ARRAY,NIL,Vector3Array,push_back,VECTOR3,"vector3",varray()); - ADDFUNC1(VECTOR3_ARRAY,NIL,Vector3Array,append,VECTOR3,"vector3",varray()); - ADDFUNC1(VECTOR3_ARRAY,NIL,Vector3Array,append_array,VECTOR3_ARRAY,"array",varray()); - ADDFUNC1(VECTOR3_ARRAY,NIL,Vector3Array,remove,INT,"idx",varray()); - ADDFUNC2(VECTOR3_ARRAY,INT,Vector3Array,insert,INT,"idx",VECTOR3,"vector3",varray()); - ADDFUNC1(VECTOR3_ARRAY,NIL,Vector3Array,resize,INT,"idx",varray()); - ADDFUNC0(VECTOR3_ARRAY,NIL,Vector3Array,invert,varray()); - - ADDFUNC0(COLOR_ARRAY,INT,ColorArray,size,varray()); - ADDFUNC2(COLOR_ARRAY,NIL,ColorArray,set,INT,"idx",COLOR,"color",varray()); - ADDFUNC1(COLOR_ARRAY,NIL,ColorArray,push_back,COLOR,"color",varray()); - ADDFUNC1(COLOR_ARRAY,NIL,ColorArray,append,COLOR,"color",varray()); - ADDFUNC1(COLOR_ARRAY,NIL,ColorArray,append_array,COLOR_ARRAY,"array",varray()); - ADDFUNC1(COLOR_ARRAY,NIL,ColorArray,remove,INT,"idx",varray()); - ADDFUNC2(COLOR_ARRAY,INT,ColorArray,insert,INT,"idx",COLOR,"color",varray()); - ADDFUNC1(COLOR_ARRAY,NIL,ColorArray,resize,INT,"idx",varray()); - ADDFUNC0(COLOR_ARRAY,NIL,ColorArray,invert,varray()); + ADDFUNC0(POOL_BYTE_ARRAY,INT,PoolByteArray,size,varray()); + ADDFUNC2(POOL_BYTE_ARRAY,NIL,PoolByteArray,set,INT,"idx",INT,"byte",varray()); + ADDFUNC1(POOL_BYTE_ARRAY,NIL,PoolByteArray,push_back,INT,"byte",varray()); + ADDFUNC1(POOL_BYTE_ARRAY,NIL,PoolByteArray,append,INT,"byte",varray()); + ADDFUNC1(POOL_BYTE_ARRAY,NIL,PoolByteArray,append_array,POOL_BYTE_ARRAY,"array",varray()); + ADDFUNC1(POOL_BYTE_ARRAY,NIL,PoolByteArray,remove,INT,"idx",varray()); + ADDFUNC2(POOL_BYTE_ARRAY,INT,PoolByteArray,insert,INT,"idx",INT,"byte",varray()); + ADDFUNC1(POOL_BYTE_ARRAY,NIL,PoolByteArray,resize,INT,"idx",varray()); + ADDFUNC0(POOL_BYTE_ARRAY,NIL,PoolByteArray,invert,varray()); + ADDFUNC2(POOL_BYTE_ARRAY,POOL_BYTE_ARRAY,PoolByteArray,subarray,INT,"from",INT,"to",varray()); + + ADDFUNC0(POOL_BYTE_ARRAY,STRING,PoolByteArray,get_string_from_ascii,varray()); + ADDFUNC0(POOL_BYTE_ARRAY,STRING,PoolByteArray,get_string_from_utf8,varray()); + + + ADDFUNC0(POOL_INT_ARRAY,INT,PoolIntArray,size,varray()); + ADDFUNC2(POOL_INT_ARRAY,NIL,PoolIntArray,set,INT,"idx",INT,"integer",varray()); + ADDFUNC1(POOL_INT_ARRAY,NIL,PoolIntArray,push_back,INT,"integer",varray()); + ADDFUNC1(POOL_INT_ARRAY,NIL,PoolIntArray,append,INT,"integer",varray()); + ADDFUNC1(POOL_INT_ARRAY,NIL,PoolIntArray,append_array,POOL_INT_ARRAY,"array",varray()); + ADDFUNC1(POOL_INT_ARRAY,NIL,PoolIntArray,remove,INT,"idx",varray()); + ADDFUNC2(POOL_INT_ARRAY,INT,PoolIntArray,insert,INT,"idx",INT,"integer",varray()); + ADDFUNC1(POOL_INT_ARRAY,NIL,PoolIntArray,resize,INT,"idx",varray()); + ADDFUNC0(POOL_INT_ARRAY,NIL,PoolIntArray,invert,varray()); + + ADDFUNC0(POOL_REAL_ARRAY,INT,PoolRealArray,size,varray()); + ADDFUNC2(POOL_REAL_ARRAY,NIL,PoolRealArray,set,INT,"idx",REAL,"value",varray()); + ADDFUNC1(POOL_REAL_ARRAY,NIL,PoolRealArray,push_back,REAL,"value",varray()); + ADDFUNC1(POOL_REAL_ARRAY,NIL,PoolRealArray,append,REAL,"value",varray()); + ADDFUNC1(POOL_REAL_ARRAY,NIL,PoolRealArray,append_array,POOL_REAL_ARRAY,"array",varray()); + ADDFUNC1(POOL_REAL_ARRAY,NIL,PoolRealArray,remove,INT,"idx",varray()); + ADDFUNC2(POOL_REAL_ARRAY,INT,PoolRealArray,insert,INT,"idx",REAL,"value",varray()); + ADDFUNC1(POOL_REAL_ARRAY,NIL,PoolRealArray,resize,INT,"idx",varray()); + ADDFUNC0(POOL_REAL_ARRAY,NIL,PoolRealArray,invert,varray()); + + ADDFUNC0(POOL_STRING_ARRAY,INT,PoolStringArray,size,varray()); + ADDFUNC2(POOL_STRING_ARRAY,NIL,PoolStringArray,set,INT,"idx",STRING,"string",varray()); + ADDFUNC1(POOL_STRING_ARRAY,NIL,PoolStringArray,push_back,STRING,"string",varray()); + ADDFUNC1(POOL_STRING_ARRAY,NIL,PoolStringArray,append,STRING,"string",varray()); + ADDFUNC1(POOL_STRING_ARRAY,NIL,PoolStringArray,append_array,POOL_STRING_ARRAY,"array",varray()); + ADDFUNC1(POOL_STRING_ARRAY,NIL,PoolStringArray,remove,INT,"idx",varray()); + ADDFUNC2(POOL_STRING_ARRAY,INT,PoolStringArray,insert,INT,"idx",STRING,"string",varray()); + ADDFUNC1(POOL_STRING_ARRAY,NIL,PoolStringArray,resize,INT,"idx",varray()); + ADDFUNC0(POOL_STRING_ARRAY,NIL,PoolStringArray,invert,varray()); + + ADDFUNC0(POOL_VECTOR2_ARRAY,INT,PoolVector2Array,size,varray()); + ADDFUNC2(POOL_VECTOR2_ARRAY,NIL,PoolVector2Array,set,INT,"idx",VECTOR2,"vector2",varray()); + ADDFUNC1(POOL_VECTOR2_ARRAY,NIL,PoolVector2Array,push_back,VECTOR2,"vector2",varray()); + ADDFUNC1(POOL_VECTOR2_ARRAY,NIL,PoolVector2Array,append,VECTOR2,"vector2",varray()); + ADDFUNC1(POOL_VECTOR2_ARRAY,NIL,PoolVector2Array,append_array,POOL_VECTOR2_ARRAY,"array",varray()); + ADDFUNC1(POOL_VECTOR2_ARRAY,NIL,PoolVector2Array,remove,INT,"idx",varray()); + ADDFUNC2(POOL_VECTOR2_ARRAY,INT,PoolVector2Array,insert,INT,"idx",VECTOR2,"vector2",varray()); + ADDFUNC1(POOL_VECTOR2_ARRAY,NIL,PoolVector2Array,resize,INT,"idx",varray()); + ADDFUNC0(POOL_VECTOR2_ARRAY,NIL,PoolVector2Array,invert,varray()); + + ADDFUNC0(POOL_VECTOR3_ARRAY,INT,PoolVector3Array,size,varray()); + ADDFUNC2(POOL_VECTOR3_ARRAY,NIL,PoolVector3Array,set,INT,"idx",VECTOR3,"vector3",varray()); + ADDFUNC1(POOL_VECTOR3_ARRAY,NIL,PoolVector3Array,push_back,VECTOR3,"vector3",varray()); + ADDFUNC1(POOL_VECTOR3_ARRAY,NIL,PoolVector3Array,append,VECTOR3,"vector3",varray()); + ADDFUNC1(POOL_VECTOR3_ARRAY,NIL,PoolVector3Array,append_array,POOL_VECTOR3_ARRAY,"array",varray()); + ADDFUNC1(POOL_VECTOR3_ARRAY,NIL,PoolVector3Array,remove,INT,"idx",varray()); + ADDFUNC2(POOL_VECTOR3_ARRAY,INT,PoolVector3Array,insert,INT,"idx",VECTOR3,"vector3",varray()); + ADDFUNC1(POOL_VECTOR3_ARRAY,NIL,PoolVector3Array,resize,INT,"idx",varray()); + ADDFUNC0(POOL_VECTOR3_ARRAY,NIL,PoolVector3Array,invert,varray()); + + ADDFUNC0(POOL_COLOR_ARRAY,INT,PoolColorArray,size,varray()); + ADDFUNC2(POOL_COLOR_ARRAY,NIL,PoolColorArray,set,INT,"idx",COLOR,"color",varray()); + ADDFUNC1(POOL_COLOR_ARRAY,NIL,PoolColorArray,push_back,COLOR,"color",varray()); + ADDFUNC1(POOL_COLOR_ARRAY,NIL,PoolColorArray,append,COLOR,"color",varray()); + ADDFUNC1(POOL_COLOR_ARRAY,NIL,PoolColorArray,append_array,POOL_COLOR_ARRAY,"array",varray()); + ADDFUNC1(POOL_COLOR_ARRAY,NIL,PoolColorArray,remove,INT,"idx",varray()); + ADDFUNC2(POOL_COLOR_ARRAY,INT,PoolColorArray,insert,INT,"idx",COLOR,"color",varray()); + ADDFUNC1(POOL_COLOR_ARRAY,NIL,PoolColorArray,resize,INT,"idx",varray()); + ADDFUNC0(POOL_COLOR_ARRAY,NIL,PoolColorArray,invert,varray()); //pointerbased - ADDFUNC0(_AABB,REAL,AABB,get_area,varray()); - ADDFUNC0(_AABB,BOOL,AABB,has_no_area,varray()); - ADDFUNC0(_AABB,BOOL,AABB,has_no_surface,varray()); - ADDFUNC1(_AABB,BOOL,AABB,intersects,_AABB,"with",varray()); - ADDFUNC1(_AABB,BOOL,AABB,encloses,_AABB,"with",varray()); - ADDFUNC1(_AABB,_AABB,AABB,merge,_AABB,"with",varray()); - ADDFUNC1(_AABB,_AABB,AABB,intersection,_AABB,"with",varray()); - ADDFUNC1(_AABB,BOOL,AABB,intersects_plane,PLANE,"plane",varray()); - ADDFUNC2(_AABB,BOOL,AABB,intersects_segment,VECTOR3,"from",VECTOR3,"to",varray()); - ADDFUNC1(_AABB,BOOL,AABB,has_point,VECTOR3,"point",varray()); - ADDFUNC1(_AABB,VECTOR3,AABB,get_support,VECTOR3,"dir",varray()); - ADDFUNC0(_AABB,VECTOR3,AABB,get_longest_axis,varray()); - ADDFUNC0(_AABB,INT,AABB,get_longest_axis_index,varray()); - ADDFUNC0(_AABB,REAL,AABB,get_longest_axis_size,varray()); - ADDFUNC0(_AABB,VECTOR3,AABB,get_shortest_axis,varray()); - ADDFUNC0(_AABB,INT,AABB,get_shortest_axis_index,varray()); - ADDFUNC0(_AABB,REAL,AABB,get_shortest_axis_size,varray()); - ADDFUNC1(_AABB,_AABB,AABB,expand,VECTOR3,"to_point",varray()); - ADDFUNC1(_AABB,_AABB,AABB,grow,REAL,"by",varray()); - ADDFUNC1(_AABB,VECTOR3,AABB,get_endpoint,INT,"idx",varray()); - - ADDFUNC0(MATRIX32,MATRIX32,Matrix32,inverse,varray()); - ADDFUNC0(MATRIX32,MATRIX32,Matrix32,affine_inverse,varray()); - ADDFUNC0(MATRIX32,REAL,Matrix32,get_rotation,varray()); - ADDFUNC0(MATRIX32,VECTOR2,Matrix32,get_origin,varray()); - ADDFUNC0(MATRIX32,VECTOR2,Matrix32,get_scale,varray()); - ADDFUNC0(MATRIX32,MATRIX32,Matrix32,orthonormalized,varray()); - ADDFUNC1(MATRIX32,MATRIX32,Matrix32,rotated,REAL,"phi",varray()); - ADDFUNC1(MATRIX32,MATRIX32,Matrix32,scaled,VECTOR2,"scale",varray()); - ADDFUNC1(MATRIX32,MATRIX32,Matrix32,translated,VECTOR2,"offset",varray()); - ADDFUNC1(MATRIX32,MATRIX32,Matrix32,xform,NIL,"v",varray()); - ADDFUNC1(MATRIX32,MATRIX32,Matrix32,xform_inv,NIL,"v",varray()); - ADDFUNC1(MATRIX32,MATRIX32,Matrix32,basis_xform,NIL,"v",varray()); - ADDFUNC1(MATRIX32,MATRIX32,Matrix32,basis_xform_inv,NIL,"v",varray()); - ADDFUNC2(MATRIX32,MATRIX32,Matrix32,interpolate_with,MATRIX32,"m",REAL,"c",varray()); - - ADDFUNC0(MATRIX3,MATRIX3,Matrix3,inverse,varray()); - ADDFUNC0(MATRIX3,MATRIX3,Matrix3,transposed,varray()); - ADDFUNC0(MATRIX3,MATRIX3,Matrix3,orthonormalized,varray()); - ADDFUNC0(MATRIX3,REAL,Matrix3,determinant,varray()); - ADDFUNC2(MATRIX3,MATRIX3,Matrix3,rotated,VECTOR3,"axis",REAL,"phi",varray()); - ADDFUNC1(MATRIX3,MATRIX3,Matrix3,scaled,VECTOR3,"scale",varray()); - ADDFUNC0(MATRIX3,VECTOR3,Matrix3,get_scale,varray()); - ADDFUNC0(MATRIX3,VECTOR3,Matrix3,get_euler,varray()); - ADDFUNC1(MATRIX3,REAL,Matrix3,tdotx,VECTOR3,"with",varray()); - ADDFUNC1(MATRIX3,REAL,Matrix3,tdoty,VECTOR3,"with",varray()); - ADDFUNC1(MATRIX3,REAL,Matrix3,tdotz,VECTOR3,"with",varray()); - ADDFUNC1(MATRIX3,VECTOR3,Matrix3,xform,VECTOR3,"v",varray()); - ADDFUNC1(MATRIX3,VECTOR3,Matrix3,xform_inv,VECTOR3,"v",varray()); - ADDFUNC0(MATRIX3,INT,Matrix3,get_orthogonal_index,varray()); + ADDFUNC0(RECT3,REAL,Rect3,get_area,varray()); + ADDFUNC0(RECT3,BOOL,Rect3,has_no_area,varray()); + ADDFUNC0(RECT3,BOOL,Rect3,has_no_surface,varray()); + ADDFUNC1(RECT3,BOOL,Rect3,intersects,RECT3,"with",varray()); + ADDFUNC1(RECT3,BOOL,Rect3,encloses,RECT3,"with",varray()); + ADDFUNC1(RECT3,RECT3,Rect3,merge,RECT3,"with",varray()); + ADDFUNC1(RECT3,RECT3,Rect3,intersection,RECT3,"with",varray()); + ADDFUNC1(RECT3,BOOL,Rect3,intersects_plane,PLANE,"plane",varray()); + ADDFUNC2(RECT3,BOOL,Rect3,intersects_segment,VECTOR3,"from",VECTOR3,"to",varray()); + ADDFUNC1(RECT3,BOOL,Rect3,has_point,VECTOR3,"point",varray()); + ADDFUNC1(RECT3,VECTOR3,Rect3,get_support,VECTOR3,"dir",varray()); + ADDFUNC0(RECT3,VECTOR3,Rect3,get_longest_axis,varray()); + ADDFUNC0(RECT3,INT,Rect3,get_longest_axis_index,varray()); + ADDFUNC0(RECT3,REAL,Rect3,get_longest_axis_size,varray()); + ADDFUNC0(RECT3,VECTOR3,Rect3,get_shortest_axis,varray()); + ADDFUNC0(RECT3,INT,Rect3,get_shortest_axis_index,varray()); + ADDFUNC0(RECT3,REAL,Rect3,get_shortest_axis_size,varray()); + ADDFUNC1(RECT3,RECT3,Rect3,expand,VECTOR3,"to_point",varray()); + ADDFUNC1(RECT3,RECT3,Rect3,grow,REAL,"by",varray()); + ADDFUNC1(RECT3,VECTOR3,Rect3,get_endpoint,INT,"idx",varray()); + + ADDFUNC0(TRANSFORM2D,TRANSFORM2D,Transform2D,inverse,varray()); + ADDFUNC0(TRANSFORM2D,TRANSFORM2D,Transform2D,affine_inverse,varray()); + ADDFUNC0(TRANSFORM2D,REAL,Transform2D,get_rotation,varray()); + ADDFUNC0(TRANSFORM2D,VECTOR2,Transform2D,get_origin,varray()); + ADDFUNC0(TRANSFORM2D,VECTOR2,Transform2D,get_scale,varray()); + ADDFUNC0(TRANSFORM2D,TRANSFORM2D,Transform2D,orthonormalized,varray()); + ADDFUNC1(TRANSFORM2D,TRANSFORM2D,Transform2D,rotated,REAL,"phi",varray()); + ADDFUNC1(TRANSFORM2D,TRANSFORM2D,Transform2D,scaled,VECTOR2,"scale",varray()); + ADDFUNC1(TRANSFORM2D,TRANSFORM2D,Transform2D,translated,VECTOR2,"offset",varray()); + ADDFUNC1(TRANSFORM2D,TRANSFORM2D,Transform2D,xform,NIL,"v",varray()); + ADDFUNC1(TRANSFORM2D,TRANSFORM2D,Transform2D,xform_inv,NIL,"v",varray()); + ADDFUNC1(TRANSFORM2D,TRANSFORM2D,Transform2D,basis_xform,NIL,"v",varray()); + ADDFUNC1(TRANSFORM2D,TRANSFORM2D,Transform2D,basis_xform_inv,NIL,"v",varray()); + ADDFUNC2(TRANSFORM2D,TRANSFORM2D,Transform2D,interpolate_with,TRANSFORM2D,"m",REAL,"c",varray()); + + ADDFUNC0(BASIS,BASIS,Basis,inverse,varray()); + ADDFUNC0(BASIS,BASIS,Basis,transposed,varray()); + ADDFUNC0(BASIS,BASIS,Basis,orthonormalized,varray()); + ADDFUNC0(BASIS,REAL,Basis,determinant,varray()); + ADDFUNC2(BASIS,BASIS,Basis,rotated,VECTOR3,"axis",REAL,"phi",varray()); + ADDFUNC1(BASIS,BASIS,Basis,scaled,VECTOR3,"scale",varray()); + ADDFUNC0(BASIS,VECTOR3,Basis,get_scale,varray()); + ADDFUNC0(BASIS,VECTOR3,Basis,get_euler,varray()); + ADDFUNC1(BASIS,REAL,Basis,tdotx,VECTOR3,"with",varray()); + ADDFUNC1(BASIS,REAL,Basis,tdoty,VECTOR3,"with",varray()); + ADDFUNC1(BASIS,REAL,Basis,tdotz,VECTOR3,"with",varray()); + ADDFUNC1(BASIS,VECTOR3,Basis,xform,VECTOR3,"v",varray()); + ADDFUNC1(BASIS,VECTOR3,Basis,xform_inv,VECTOR3,"v",varray()); + ADDFUNC0(BASIS,INT,Basis,get_orthogonal_index,varray()); ADDFUNC0(TRANSFORM,TRANSFORM,Transform,inverse,varray()); ADDFUNC0(TRANSFORM,TRANSFORM,Transform,affine_inverse,varray()); @@ -1745,8 +1747,8 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl _VariantCall::add_constructor(_VariantCall::Rect2_init1,Variant::RECT2,"pos",Variant::VECTOR2,"size",Variant::VECTOR2); _VariantCall::add_constructor(_VariantCall::Rect2_init2,Variant::RECT2,"x",Variant::REAL,"y",Variant::REAL,"width",Variant::REAL,"height",Variant::REAL); - _VariantCall::add_constructor(_VariantCall::Matrix32_init2,Variant::MATRIX32,"rot",Variant::REAL,"pos",Variant::VECTOR2); - _VariantCall::add_constructor(_VariantCall::Matrix32_init3,Variant::MATRIX32,"x_axis",Variant::VECTOR2,"y_axis",Variant::VECTOR2,"origin",Variant::VECTOR2); + _VariantCall::add_constructor(_VariantCall::Transform2D_init2,Variant::TRANSFORM2D,"rot",Variant::REAL,"pos",Variant::VECTOR2); + _VariantCall::add_constructor(_VariantCall::Transform2D_init3,Variant::TRANSFORM2D,"x_axis",Variant::VECTOR2,"y_axis",Variant::VECTOR2,"origin",Variant::VECTOR2); _VariantCall::add_constructor(_VariantCall::Vector3_init1,Variant::VECTOR3,"x",Variant::REAL,"y",Variant::REAL,"z",Variant::REAL); @@ -1760,13 +1762,13 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl _VariantCall::add_constructor(_VariantCall::Color_init1,Variant::COLOR,"r",Variant::REAL,"g",Variant::REAL,"b",Variant::REAL,"a",Variant::REAL); _VariantCall::add_constructor(_VariantCall::Color_init2,Variant::COLOR,"r",Variant::REAL,"g",Variant::REAL,"b",Variant::REAL); - _VariantCall::add_constructor(_VariantCall::AABB_init1,Variant::_AABB,"pos",Variant::VECTOR3,"size",Variant::VECTOR3); + _VariantCall::add_constructor(_VariantCall::Rect3_init1,Variant::RECT3,"pos",Variant::VECTOR3,"size",Variant::VECTOR3); - _VariantCall::add_constructor(_VariantCall::Matrix3_init1,Variant::MATRIX3,"x_axis",Variant::VECTOR3,"y_axis",Variant::VECTOR3,"z_axis",Variant::VECTOR3); - _VariantCall::add_constructor(_VariantCall::Matrix3_init2,Variant::MATRIX3,"axis",Variant::VECTOR3,"phi",Variant::REAL); + _VariantCall::add_constructor(_VariantCall::Basis_init1,Variant::BASIS,"x_axis",Variant::VECTOR3,"y_axis",Variant::VECTOR3,"z_axis",Variant::VECTOR3); + _VariantCall::add_constructor(_VariantCall::Basis_init2,Variant::BASIS,"axis",Variant::VECTOR3,"phi",Variant::REAL); _VariantCall::add_constructor(_VariantCall::Transform_init1,Variant::TRANSFORM,"x_axis",Variant::VECTOR3,"y_axis",Variant::VECTOR3,"z_axis",Variant::VECTOR3,"origin",Variant::VECTOR3); - _VariantCall::add_constructor(_VariantCall::Transform_init2,Variant::TRANSFORM,"basis",Variant::MATRIX3,"origin",Variant::VECTOR3); + _VariantCall::add_constructor(_VariantCall::Transform_init2,Variant::TRANSFORM,"basis",Variant::BASIS,"origin",Variant::VECTOR3); _VariantCall::add_constructor(_VariantCall::Image_init1,Variant::IMAGE,"width",Variant::INT,"height",Variant::INT,"mipmaps",Variant::BOOL,"format",Variant::INT); @@ -1781,50 +1783,65 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl _VariantCall::add_constant(Variant::INPUT_EVENT,"KEY",InputEvent::KEY); _VariantCall::add_constant(Variant::INPUT_EVENT,"MOUSE_MOTION",InputEvent::MOUSE_MOTION); _VariantCall::add_constant(Variant::INPUT_EVENT,"MOUSE_BUTTON",InputEvent::MOUSE_BUTTON); - _VariantCall::add_constant(Variant::INPUT_EVENT,"JOYSTICK_MOTION",InputEvent::JOYSTICK_MOTION); - _VariantCall::add_constant(Variant::INPUT_EVENT,"JOYSTICK_BUTTON",InputEvent::JOYSTICK_BUTTON); + _VariantCall::add_constant(Variant::INPUT_EVENT,"JOYPAD_MOTION",InputEvent::JOYPAD_MOTION); + _VariantCall::add_constant(Variant::INPUT_EVENT,"JOYPAD_BUTTON",InputEvent::JOYPAD_BUTTON); _VariantCall::add_constant(Variant::INPUT_EVENT,"SCREEN_TOUCH",InputEvent::SCREEN_TOUCH); _VariantCall::add_constant(Variant::INPUT_EVENT,"SCREEN_DRAG",InputEvent::SCREEN_DRAG); _VariantCall::add_constant(Variant::INPUT_EVENT,"ACTION",InputEvent::ACTION); - _VariantCall::add_constant(Variant::IMAGE,"COMPRESS_BC",Image::COMPRESS_BC); + _VariantCall::add_constant(Variant::IMAGE,"COMPRESS_16BIT",Image::COMPRESS_16BIT); + _VariantCall::add_constant(Variant::IMAGE,"COMPRESS_S3TC",Image::COMPRESS_S3TC); _VariantCall::add_constant(Variant::IMAGE,"COMPRESS_PVRTC2",Image::COMPRESS_PVRTC2); _VariantCall::add_constant(Variant::IMAGE,"COMPRESS_PVRTC4",Image::COMPRESS_PVRTC4); _VariantCall::add_constant(Variant::IMAGE,"COMPRESS_ETC",Image::COMPRESS_ETC); - - _VariantCall::add_constant(Variant::IMAGE,"FORMAT_GRAYSCALE",Image::FORMAT_GRAYSCALE); - _VariantCall::add_constant(Variant::IMAGE,"FORMAT_INTENSITY",Image::FORMAT_INTENSITY); - _VariantCall::add_constant(Variant::IMAGE,"FORMAT_GRAYSCALE_ALPHA",Image::FORMAT_GRAYSCALE_ALPHA); - _VariantCall::add_constant(Variant::IMAGE,"FORMAT_RGB",Image::FORMAT_RGB); - _VariantCall::add_constant(Variant::IMAGE,"FORMAT_RGBA",Image::FORMAT_RGBA); - _VariantCall::add_constant(Variant::IMAGE,"FORMAT_INDEXED",Image::FORMAT_INDEXED); - _VariantCall::add_constant(Variant::IMAGE,"FORMAT_INDEXED_ALPHA",Image::FORMAT_INDEXED_ALPHA); - _VariantCall::add_constant(Variant::IMAGE,"FORMAT_YUV_422",Image::FORMAT_YUV_422); - _VariantCall::add_constant(Variant::IMAGE,"FORMAT_YUV_444",Image::FORMAT_YUV_444); - _VariantCall::add_constant(Variant::IMAGE,"FORMAT_BC1",Image::FORMAT_BC1); - _VariantCall::add_constant(Variant::IMAGE,"FORMAT_BC2",Image::FORMAT_BC2); - _VariantCall::add_constant(Variant::IMAGE,"FORMAT_BC3",Image::FORMAT_BC3); - _VariantCall::add_constant(Variant::IMAGE,"FORMAT_BC4",Image::FORMAT_BC4); - _VariantCall::add_constant(Variant::IMAGE,"FORMAT_BC5",Image::FORMAT_BC5); + _VariantCall::add_constant(Variant::IMAGE,"COMPRESS_ETC2",Image::COMPRESS_ETC2); + + + + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_L8",Image::FORMAT_L8); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_LA8",Image::FORMAT_LA8); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_R8",Image::FORMAT_R8); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_RG8",Image::FORMAT_RG8); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_RGB8",Image::FORMAT_RGB8); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_RGBA8",Image::FORMAT_RGBA8); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_RGB565",Image::FORMAT_RGB565); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_RGBA4444",Image::FORMAT_RGBA4444); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_RGBA5551",Image::FORMAT_DXT1); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_RF",Image::FORMAT_RF); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_RGF",Image::FORMAT_RGF); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_RGBF",Image::FORMAT_RGBF); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_RGBAF",Image::FORMAT_RGBAF); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_RH",Image::FORMAT_RH); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_RGH",Image::FORMAT_RGH); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_RGBH",Image::FORMAT_RGBH); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_RGBAH",Image::FORMAT_RGBAH); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_DXT1",Image::FORMAT_DXT1); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_DXT3",Image::FORMAT_DXT3); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_DXT5",Image::FORMAT_DXT5); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_ATI1",Image::FORMAT_ATI1); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_ATI2",Image::FORMAT_ATI2); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_BPTC_RGBA",Image::FORMAT_BPTC_RGBA); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_BPTC_RGBF",Image::FORMAT_BPTC_RGBF); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_BPTC_RGBFU",Image::FORMAT_BPTC_RGBFU); _VariantCall::add_constant(Variant::IMAGE,"FORMAT_PVRTC2",Image::FORMAT_PVRTC2); - _VariantCall::add_constant(Variant::IMAGE,"FORMAT_PVRTC2_ALPHA",Image::FORMAT_PVRTC2_ALPHA); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_PVRTC2A",Image::FORMAT_PVRTC2A); _VariantCall::add_constant(Variant::IMAGE,"FORMAT_PVRTC4",Image::FORMAT_PVRTC4); - _VariantCall::add_constant(Variant::IMAGE,"FORMAT_PVRTC4_ALPHA",Image::FORMAT_PVRTC4_ALPHA); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_PVRTC4A",Image::FORMAT_PVRTC4A); _VariantCall::add_constant(Variant::IMAGE,"FORMAT_ETC",Image::FORMAT_ETC); - _VariantCall::add_constant(Variant::IMAGE,"FORMAT_ATC",Image::FORMAT_ATC); - _VariantCall::add_constant(Variant::IMAGE,"FORMAT_ATC_ALPHA_EXPLICIT",Image::FORMAT_ATC_ALPHA_EXPLICIT); - _VariantCall::add_constant(Variant::IMAGE,"FORMAT_ATC_ALPHA_INTERPOLATED",Image::FORMAT_ATC_ALPHA_INTERPOLATED); - _VariantCall::add_constant(Variant::IMAGE,"FORMAT_CUSTOM",Image::FORMAT_CUSTOM); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_ETC2_R11",Image::FORMAT_ETC2_R11); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_ETC2_R11S",Image::FORMAT_ETC2_R11S); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_ETC2_RG11",Image::FORMAT_ETC2_RG11); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_ETC2_RG11S",Image::FORMAT_ETC2_RG11S); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_ETC2_RGB8",Image::FORMAT_ETC2_RGB8); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_ETC2_RGBA8",Image::FORMAT_ETC2_RGBA8); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_ETC2_RGB8A1",Image::FORMAT_ETC2_RGB8A1); + _VariantCall::add_constant(Variant::IMAGE,"FORMAT_MAX",Image::FORMAT_MAX); _VariantCall::add_constant(Variant::IMAGE,"INTERPOLATE_NEAREST",Image::INTERPOLATE_NEAREST); _VariantCall::add_constant(Variant::IMAGE,"INTERPOLATE_BILINEAR",Image::INTERPOLATE_BILINEAR); _VariantCall::add_constant(Variant::IMAGE,"INTERPOLATE_CUBIC",Image::INTERPOLATE_CUBIC); - _VariantCall::add_constant(Variant::INT, "IP_TYPE_NONE", IP_Address::TYPE_NONE); - _VariantCall::add_constant(Variant::INT, "IP_TYPE_IPV4", IP_Address::TYPE_IPV4); - _VariantCall::add_constant(Variant::INT, "IP_TYPE_IPV6", IP_Address::TYPE_IPV6); - _VariantCall::add_constant(Variant::INT, "IP_TYPE_ANY", IP_Address::TYPE_ANY); } void unregister_variant_methods() { diff --git a/core/variant_construct_string.cpp b/core/variant_construct_string.cpp index 6395501603..8db756aa79 100644 --- a/core/variant_construct_string.cpp +++ b/core/variant_construct_string.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/variant_op.cpp b/core/variant_op.cpp index fd64b58bd5..1e67d81ae2 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -47,12 +47,12 @@ bool Variant::booleanize(bool &r_valid) const { case STRING: return (*reinterpret_cast<const String*>(_data._mem))!=""; case VECTOR2: case RECT2: - case MATRIX32: + case TRANSFORM2D: case VECTOR3: case PLANE: - case _AABB: + case RECT3: case QUAT: - case MATRIX3: + case BASIS: case TRANSFORM: case COLOR: case IMAGE: r_valid=false; return false; @@ -62,13 +62,13 @@ bool Variant::booleanize(bool &r_valid) const { case INPUT_EVENT: case DICTIONARY: case ARRAY: - case RAW_ARRAY: - case INT_ARRAY: - case REAL_ARRAY: - case STRING_ARRAY: - case VECTOR2_ARRAY: - case VECTOR3_ARRAY: - case COLOR_ARRAY: + case POOL_BYTE_ARRAY: + case POOL_INT_ARRAY: + case POOL_REAL_ARRAY: + case POOL_STRING_ARRAY: + case POOL_VECTOR2_ARRAY: + case POOL_VECTOR3_ARRAY: + case POOL_COLOR_ARRAY: r_valid=false; return false; default: {} @@ -97,6 +97,12 @@ case m_name: {\ _RETURN( -p_a._data.m_type);\ }; +#define DEFAULT_OP_NUM_POS(m_name,m_type)\ +case m_name: {\ +\ + _RETURN( p_a._data.m_type);\ +}; + #define DEFAULT_OP_NUM_VEC(m_op,m_name,m_type)\ case m_name: {\ switch(p_b.type) {\ @@ -136,6 +142,10 @@ case m_name: {\ _RETURN( -*reinterpret_cast<const m_type*>(p_a._data._mem));\ } +#define DEFAULT_OP_LOCALMEM_POS(m_name,m_type)\ +case m_name: {\ + _RETURN( *reinterpret_cast<const m_type*>(p_a._data._mem));\ +} #define DEFAULT_OP_LOCALMEM_NUM(m_op,m_name,m_type)\ case m_name: {switch(p_b.type) {\ @@ -176,16 +186,16 @@ case m_name: { \ r_valid=false;\ return;\ }\ - const DVector<m_type> &array_a=*reinterpret_cast<const DVector<m_type> *>(p_a._data._mem);\ - const DVector<m_type> &array_b=*reinterpret_cast<const DVector<m_type> *>(p_b._data._mem);\ + const PoolVector<m_type> &array_a=*reinterpret_cast<const PoolVector<m_type> *>(p_a._data._mem);\ + const PoolVector<m_type> &array_b=*reinterpret_cast<const PoolVector<m_type> *>(p_b._data._mem);\ \ int a_len = array_a.size();\ if (a_len m_opa array_b.size()){\ _RETURN( m_ret_s);\ }else {\ \ - DVector<m_type>::Read ra = array_a.read();\ - DVector<m_type>::Read rb = array_b.read();\ + PoolVector<m_type>::Read ra = array_a.read();\ + PoolVector<m_type>::Read rb = array_b.read();\ \ for(int i=0;i<a_len;i++) {\ if (ra[i] m_opb rb[i])\ @@ -202,9 +212,9 @@ case m_name: { \ r_valid=false;\ _RETURN( NIL);\ }\ - const DVector<m_type> &array_a=*reinterpret_cast<const DVector<m_type> *>(p_a._data._mem);\ - const DVector<m_type> &array_b=*reinterpret_cast<const DVector<m_type> *>(p_b._data._mem);\ - DVector<m_type> sum = array_a;\ + const PoolVector<m_type> &array_a=*reinterpret_cast<const PoolVector<m_type> *>(p_a._data._mem);\ + const PoolVector<m_type> &array_b=*reinterpret_cast<const PoolVector<m_type> *>(p_b._data._mem);\ + PoolVector<m_type> sum = array_a;\ sum.append_array(array_b);\ _RETURN( sum );\ } @@ -252,12 +262,12 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& DEFAULT_OP_STR(==,STRING,String); DEFAULT_OP_LOCALMEM(==,VECTOR2,Vector2); DEFAULT_OP_LOCALMEM(==,RECT2,Rect2); - DEFAULT_OP_PTRREF(==,MATRIX32,_matrix32); + DEFAULT_OP_PTRREF(==,TRANSFORM2D,_transform2d); DEFAULT_OP_LOCALMEM(==,VECTOR3,Vector3); DEFAULT_OP_LOCALMEM(==,PLANE,Plane); DEFAULT_OP_LOCALMEM(==,QUAT,Quat); - DEFAULT_OP_PTRREF(==,_AABB,_aabb); - DEFAULT_OP_PTRREF(==,MATRIX3,_matrix3); + DEFAULT_OP_PTRREF(==,RECT3,_rect3); + DEFAULT_OP_PTRREF(==,BASIS,_basis); DEFAULT_OP_PTRREF(==,TRANSFORM,_transform); DEFAULT_OP_LOCALMEM(==,COLOR,Color); @@ -306,13 +316,13 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& } break; - DEFAULT_OP_ARRAY_EQ(RAW_ARRAY,uint8_t); - DEFAULT_OP_ARRAY_EQ(INT_ARRAY,int); - DEFAULT_OP_ARRAY_EQ(REAL_ARRAY,real_t); - DEFAULT_OP_ARRAY_EQ(STRING_ARRAY,String); - DEFAULT_OP_ARRAY_EQ(VECTOR2_ARRAY,Vector3); - DEFAULT_OP_ARRAY_EQ(VECTOR3_ARRAY,Vector3); - DEFAULT_OP_ARRAY_EQ(COLOR_ARRAY,Color); + DEFAULT_OP_ARRAY_EQ(POOL_BYTE_ARRAY,uint8_t); + DEFAULT_OP_ARRAY_EQ(POOL_INT_ARRAY,int); + DEFAULT_OP_ARRAY_EQ(POOL_REAL_ARRAY,real_t); + DEFAULT_OP_ARRAY_EQ(POOL_STRING_ARRAY,String); + DEFAULT_OP_ARRAY_EQ(POOL_VECTOR2_ARRAY,Vector3); + DEFAULT_OP_ARRAY_EQ(POOL_VECTOR3_ARRAY,Vector3); + DEFAULT_OP_ARRAY_EQ(POOL_COLOR_ARRAY,Color); case VARIANT_MAX: { r_valid=false; @@ -344,12 +354,12 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& DEFAULT_OP_STR(<,STRING,String); DEFAULT_OP_LOCALMEM(<,VECTOR2,Vector2); DEFAULT_OP_FAIL(RECT2); - DEFAULT_OP_FAIL(MATRIX32); + DEFAULT_OP_FAIL(TRANSFORM2D); DEFAULT_OP_LOCALMEM(<,VECTOR3,Vector3); DEFAULT_OP_FAIL(PLANE); DEFAULT_OP_FAIL(QUAT); - DEFAULT_OP_FAIL(_AABB); - DEFAULT_OP_FAIL(MATRIX3); + DEFAULT_OP_FAIL(RECT3); + DEFAULT_OP_FAIL(BASIS); DEFAULT_OP_FAIL(TRANSFORM); DEFAULT_OP_FAIL(COLOR); @@ -383,13 +393,13 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& _RETURN( false ); } break; - DEFAULT_OP_ARRAY_LT(RAW_ARRAY,uint8_t); - DEFAULT_OP_ARRAY_LT(INT_ARRAY,int); - DEFAULT_OP_ARRAY_LT(REAL_ARRAY,real_t); - DEFAULT_OP_ARRAY_LT(STRING_ARRAY,String); - DEFAULT_OP_ARRAY_LT(VECTOR2_ARRAY,Vector3); - DEFAULT_OP_ARRAY_LT(VECTOR3_ARRAY,Vector3); - DEFAULT_OP_ARRAY_LT(COLOR_ARRAY,Color); + DEFAULT_OP_ARRAY_LT(POOL_BYTE_ARRAY,uint8_t); + DEFAULT_OP_ARRAY_LT(POOL_INT_ARRAY,int); + DEFAULT_OP_ARRAY_LT(POOL_REAL_ARRAY,real_t); + DEFAULT_OP_ARRAY_LT(POOL_STRING_ARRAY,String); + DEFAULT_OP_ARRAY_LT(POOL_VECTOR2_ARRAY,Vector3); + DEFAULT_OP_ARRAY_LT(POOL_VECTOR3_ARRAY,Vector3); + DEFAULT_OP_ARRAY_LT(POOL_COLOR_ARRAY,Color); case VARIANT_MAX: { r_valid=false; return; @@ -410,12 +420,12 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& DEFAULT_OP_STR(<=,STRING,String); DEFAULT_OP_LOCALMEM(<=,VECTOR2,Vector2); DEFAULT_OP_FAIL(RECT2); - DEFAULT_OP_FAIL(MATRIX32); + DEFAULT_OP_FAIL(TRANSFORM2D); DEFAULT_OP_LOCALMEM(<=,VECTOR3,Vector3); DEFAULT_OP_FAIL(PLANE); DEFAULT_OP_FAIL(QUAT); - DEFAULT_OP_FAIL(_AABB); - DEFAULT_OP_FAIL(MATRIX3); + DEFAULT_OP_FAIL(RECT3); + DEFAULT_OP_FAIL(BASIS); DEFAULT_OP_FAIL(TRANSFORM); DEFAULT_OP_FAIL(COLOR); @@ -430,13 +440,13 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& DEFAULT_OP_FAIL(INPUT_EVENT); DEFAULT_OP_FAIL(DICTIONARY); DEFAULT_OP_FAIL(ARRAY); - DEFAULT_OP_FAIL(RAW_ARRAY); - DEFAULT_OP_FAIL(INT_ARRAY); - DEFAULT_OP_FAIL(REAL_ARRAY); - DEFAULT_OP_FAIL(STRING_ARRAY); - DEFAULT_OP_FAIL(VECTOR2_ARRAY); - DEFAULT_OP_FAIL(VECTOR3_ARRAY); - DEFAULT_OP_FAIL(COLOR_ARRAY); + DEFAULT_OP_FAIL(POOL_BYTE_ARRAY); + DEFAULT_OP_FAIL(POOL_INT_ARRAY); + DEFAULT_OP_FAIL(POOL_REAL_ARRAY); + DEFAULT_OP_FAIL(POOL_STRING_ARRAY); + DEFAULT_OP_FAIL(POOL_VECTOR2_ARRAY); + DEFAULT_OP_FAIL(POOL_VECTOR3_ARRAY); + DEFAULT_OP_FAIL(POOL_COLOR_ARRAY); case VARIANT_MAX: { r_valid=false; return; @@ -474,12 +484,12 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& DEFAULT_OP_STR(+,STRING,String); DEFAULT_OP_LOCALMEM(+,VECTOR2,Vector2); DEFAULT_OP_FAIL(RECT2); - DEFAULT_OP_FAIL(MATRIX32); + DEFAULT_OP_FAIL(TRANSFORM2D); DEFAULT_OP_LOCALMEM(+,VECTOR3,Vector3); DEFAULT_OP_FAIL(PLANE); DEFAULT_OP_LOCALMEM(+, QUAT, Quat); - DEFAULT_OP_FAIL(_AABB); - DEFAULT_OP_FAIL(MATRIX3); + DEFAULT_OP_FAIL(RECT3); + DEFAULT_OP_FAIL(BASIS); DEFAULT_OP_FAIL(TRANSFORM); DEFAULT_OP_FAIL(COLOR); @@ -507,13 +517,13 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& sum[i+asize]=array_b[i]; _RETURN( sum ); } - DEFAULT_OP_ARRAY_ADD(RAW_ARRAY,uint8_t); - DEFAULT_OP_ARRAY_ADD(INT_ARRAY,int); - DEFAULT_OP_ARRAY_ADD(REAL_ARRAY,real_t); - DEFAULT_OP_ARRAY_ADD(STRING_ARRAY,String); - DEFAULT_OP_ARRAY_ADD(VECTOR2_ARRAY,Vector2); - DEFAULT_OP_ARRAY_ADD(VECTOR3_ARRAY,Vector3); - DEFAULT_OP_ARRAY_ADD(COLOR_ARRAY,Color); + DEFAULT_OP_ARRAY_ADD(POOL_BYTE_ARRAY,uint8_t); + DEFAULT_OP_ARRAY_ADD(POOL_INT_ARRAY,int); + DEFAULT_OP_ARRAY_ADD(POOL_REAL_ARRAY,real_t); + DEFAULT_OP_ARRAY_ADD(POOL_STRING_ARRAY,String); + DEFAULT_OP_ARRAY_ADD(POOL_VECTOR2_ARRAY,Vector2); + DEFAULT_OP_ARRAY_ADD(POOL_VECTOR3_ARRAY,Vector3); + DEFAULT_OP_ARRAY_ADD(POOL_COLOR_ARRAY,Color); case VARIANT_MAX: { r_valid=false; return; @@ -532,12 +542,12 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& DEFAULT_OP_FAIL(STRING); DEFAULT_OP_LOCALMEM(-,VECTOR2,Vector2); DEFAULT_OP_FAIL(RECT2); - DEFAULT_OP_FAIL(MATRIX32); + DEFAULT_OP_FAIL(TRANSFORM2D); DEFAULT_OP_LOCALMEM(-,VECTOR3,Vector3); DEFAULT_OP_FAIL(PLANE); DEFAULT_OP_LOCALMEM(-, QUAT, Quat); - DEFAULT_OP_FAIL(_AABB); - DEFAULT_OP_FAIL(MATRIX3); + DEFAULT_OP_FAIL(RECT3); + DEFAULT_OP_FAIL(BASIS); DEFAULT_OP_FAIL(TRANSFORM); DEFAULT_OP_FAIL(COLOR); @@ -548,13 +558,13 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& DEFAULT_OP_FAIL(INPUT_EVENT); DEFAULT_OP_FAIL(DICTIONARY); DEFAULT_OP_FAIL(ARRAY); - DEFAULT_OP_FAIL(RAW_ARRAY); - DEFAULT_OP_FAIL(INT_ARRAY); - DEFAULT_OP_FAIL(REAL_ARRAY); - DEFAULT_OP_FAIL(STRING_ARRAY); - DEFAULT_OP_FAIL(VECTOR2_ARRAY); - DEFAULT_OP_FAIL(VECTOR3_ARRAY); - DEFAULT_OP_FAIL(COLOR_ARRAY); + DEFAULT_OP_FAIL(POOL_BYTE_ARRAY); + DEFAULT_OP_FAIL(POOL_INT_ARRAY); + DEFAULT_OP_FAIL(POOL_REAL_ARRAY); + DEFAULT_OP_FAIL(POOL_STRING_ARRAY); + DEFAULT_OP_FAIL(POOL_VECTOR2_ARRAY); + DEFAULT_OP_FAIL(POOL_VECTOR3_ARRAY); + DEFAULT_OP_FAIL(POOL_COLOR_ARRAY); case VARIANT_MAX: { r_valid=false; return; @@ -573,13 +583,13 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& DEFAULT_OP_FAIL(STRING); DEFAULT_OP_LOCALMEM_NUM(*,VECTOR2,Vector2); DEFAULT_OP_FAIL(RECT2); - case MATRIX32: { + case TRANSFORM2D: { - if (p_b.type==MATRIX32) { - _RETURN( *p_a._data._matrix32 * *p_b._data._matrix32 ); + if (p_b.type==TRANSFORM2D) { + _RETURN( *p_a._data._transform2d * *p_b._data._transform2d ); }; if (p_b.type==VECTOR2) { - _RETURN( p_a._data._matrix32->xform( *(const Vector2*)p_b._data._mem) ); + _RETURN( p_a._data._transform2d->xform( *(const Vector2*)p_b._data._mem) ); }; r_valid=false; return; @@ -605,18 +615,18 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& r_valid=false; return; } break; - DEFAULT_OP_FAIL(_AABB); - case MATRIX3: { + DEFAULT_OP_FAIL(RECT3); + case BASIS: { switch(p_b.type) { case VECTOR3: { - _RETURN( p_a._data._matrix3->xform( *(const Vector3*)p_b._data._mem) ); + _RETURN( p_a._data._basis->xform( *(const Vector3*)p_b._data._mem) ); } ; - case MATRIX3: { + case BASIS: { - _RETURN( *p_a._data._matrix3 * *p_b._data._matrix3 ); + _RETURN( *p_a._data._basis * *p_b._data._basis ); }; default: {} @@ -650,13 +660,13 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& DEFAULT_OP_FAIL(INPUT_EVENT); DEFAULT_OP_FAIL(DICTIONARY); DEFAULT_OP_FAIL(ARRAY); - DEFAULT_OP_FAIL(RAW_ARRAY); - DEFAULT_OP_FAIL(INT_ARRAY); - DEFAULT_OP_FAIL(REAL_ARRAY); - DEFAULT_OP_FAIL(STRING_ARRAY); - DEFAULT_OP_FAIL(VECTOR2_ARRAY); - DEFAULT_OP_FAIL(VECTOR3_ARRAY); - DEFAULT_OP_FAIL(COLOR_ARRAY); + DEFAULT_OP_FAIL(POOL_BYTE_ARRAY); + DEFAULT_OP_FAIL(POOL_INT_ARRAY); + DEFAULT_OP_FAIL(POOL_REAL_ARRAY); + DEFAULT_OP_FAIL(POOL_STRING_ARRAY); + DEFAULT_OP_FAIL(POOL_VECTOR2_ARRAY); + DEFAULT_OP_FAIL(POOL_VECTOR3_ARRAY); + DEFAULT_OP_FAIL(POOL_COLOR_ARRAY); case VARIANT_MAX: { r_valid=false; return; @@ -673,7 +683,7 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& case INT: { switch(p_b.type) { case BOOL: { - int b = p_b._data._bool; + int64_t b = p_b._data._bool; if (b==0) { r_valid=false; @@ -683,7 +693,7 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& } break; case INT: { - int b = p_b._data._int; + int64_t b = p_b._data._int; if (b==0) { r_valid=false; @@ -702,7 +712,7 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& DEFAULT_OP_FAIL(STRING); DEFAULT_OP_LOCALMEM_NUM(/,VECTOR2,Vector2); DEFAULT_OP_FAIL(RECT2); - DEFAULT_OP_FAIL(MATRIX32); + DEFAULT_OP_FAIL(TRANSFORM2D); DEFAULT_OP_LOCALMEM_NUM(/,VECTOR3,Vector3); DEFAULT_OP_FAIL(PLANE); case QUAT: { @@ -712,8 +722,8 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& } _RETURN( *reinterpret_cast<const Quat*>(p_a._data._mem) / p_b._data._real); } break; - DEFAULT_OP_FAIL(_AABB); - DEFAULT_OP_FAIL(MATRIX3); + DEFAULT_OP_FAIL(RECT3); + DEFAULT_OP_FAIL(BASIS); DEFAULT_OP_FAIL(TRANSFORM); DEFAULT_OP_FAIL(COLOR); @@ -724,13 +734,13 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& DEFAULT_OP_FAIL(INPUT_EVENT); DEFAULT_OP_FAIL(DICTIONARY); DEFAULT_OP_FAIL(ARRAY); - DEFAULT_OP_FAIL(RAW_ARRAY); - DEFAULT_OP_FAIL(INT_ARRAY); - DEFAULT_OP_FAIL(REAL_ARRAY); - DEFAULT_OP_FAIL(STRING_ARRAY); - DEFAULT_OP_FAIL(VECTOR2_ARRAY); - DEFAULT_OP_FAIL(VECTOR3_ARRAY); - DEFAULT_OP_FAIL(COLOR_ARRAY); + DEFAULT_OP_FAIL(POOL_BYTE_ARRAY); + DEFAULT_OP_FAIL(POOL_INT_ARRAY); + DEFAULT_OP_FAIL(POOL_REAL_ARRAY); + DEFAULT_OP_FAIL(POOL_STRING_ARRAY); + DEFAULT_OP_FAIL(POOL_VECTOR2_ARRAY); + DEFAULT_OP_FAIL(POOL_VECTOR3_ARRAY); + DEFAULT_OP_FAIL(POOL_COLOR_ARRAY); case VARIANT_MAX: { r_valid=false; return; @@ -740,6 +750,48 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& } } break; + case OP_POSITIVE: { + // Simple case when user defines variable as +value. + switch(p_a.type) { + + DEFAULT_OP_FAIL(NIL); + DEFAULT_OP_FAIL(STRING); + DEFAULT_OP_FAIL(RECT2); + DEFAULT_OP_FAIL(TRANSFORM2D); + DEFAULT_OP_FAIL(RECT3); + DEFAULT_OP_FAIL(BASIS); + DEFAULT_OP_FAIL(TRANSFORM); + DEFAULT_OP_NUM_POS(BOOL,_bool); + DEFAULT_OP_NUM_POS(INT,_int); + DEFAULT_OP_NUM_POS(REAL,_real); + DEFAULT_OP_LOCALMEM_POS(VECTOR3,Vector3); + DEFAULT_OP_LOCALMEM_POS(PLANE,Plane); + DEFAULT_OP_LOCALMEM_POS(QUAT,Quat); + DEFAULT_OP_LOCALMEM_POS(VECTOR2,Vector2); + + DEFAULT_OP_FAIL(COLOR); + DEFAULT_OP_FAIL(IMAGE); + DEFAULT_OP_FAIL(NODE_PATH); + DEFAULT_OP_FAIL(_RID); + DEFAULT_OP_FAIL(OBJECT); + DEFAULT_OP_FAIL(INPUT_EVENT); + DEFAULT_OP_FAIL(DICTIONARY); + DEFAULT_OP_FAIL(ARRAY); + DEFAULT_OP_FAIL(POOL_BYTE_ARRAY); + DEFAULT_OP_FAIL(POOL_INT_ARRAY); + DEFAULT_OP_FAIL(POOL_REAL_ARRAY); + DEFAULT_OP_FAIL(POOL_STRING_ARRAY); + DEFAULT_OP_FAIL(POOL_VECTOR2_ARRAY); + DEFAULT_OP_FAIL(POOL_VECTOR3_ARRAY); + DEFAULT_OP_FAIL(POOL_COLOR_ARRAY); + case VARIANT_MAX: { + r_valid=false; + return; + + } break; + + } + } break; case OP_NEGATE: { switch(p_a.type) { @@ -750,12 +802,12 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& DEFAULT_OP_FAIL(STRING); DEFAULT_OP_LOCALMEM_NEG(VECTOR2,Vector2); DEFAULT_OP_FAIL(RECT2); - DEFAULT_OP_FAIL(MATRIX32); + DEFAULT_OP_FAIL(TRANSFORM2D); DEFAULT_OP_LOCALMEM_NEG(VECTOR3,Vector3); DEFAULT_OP_LOCALMEM_NEG(PLANE,Plane); DEFAULT_OP_LOCALMEM_NEG(QUAT,Quat); - DEFAULT_OP_FAIL(_AABB); - DEFAULT_OP_FAIL(MATRIX3); + DEFAULT_OP_FAIL(RECT3); + DEFAULT_OP_FAIL(BASIS); DEFAULT_OP_FAIL(TRANSFORM); DEFAULT_OP_FAIL(COLOR); @@ -766,21 +818,19 @@ void Variant::evaluate(const Operator& p_op, const Variant& p_a, const Variant& DEFAULT_OP_FAIL(INPUT_EVENT); DEFAULT_OP_FAIL(DICTIONARY); DEFAULT_OP_FAIL(ARRAY); - DEFAULT_OP_FAIL(RAW_ARRAY); - DEFAULT_OP_FAIL(INT_ARRAY); - DEFAULT_OP_FAIL(REAL_ARRAY); - DEFAULT_OP_FAIL(STRING_ARRAY); - DEFAULT_OP_FAIL(VECTOR2_ARRAY); - DEFAULT_OP_FAIL(VECTOR3_ARRAY); - DEFAULT_OP_FAIL(COLOR_ARRAY); + DEFAULT_OP_FAIL(POOL_BYTE_ARRAY); + DEFAULT_OP_FAIL(POOL_INT_ARRAY); + DEFAULT_OP_FAIL(POOL_REAL_ARRAY); + DEFAULT_OP_FAIL(POOL_STRING_ARRAY); + DEFAULT_OP_FAIL(POOL_VECTOR2_ARRAY); + DEFAULT_OP_FAIL(POOL_VECTOR3_ARRAY); + DEFAULT_OP_FAIL(POOL_COLOR_ARRAY); case VARIANT_MAX: { r_valid=false; return; } break; - } - } break; case OP_MODULE: { if (p_a.type==INT && p_b.type==INT) { @@ -999,10 +1049,10 @@ Variant Variant::get_named(const StringName& p_index, bool *r_valid) const { } break; #define DEFAULT_OP_DVECTOR_SET(m_name, dv_type, skip_cond)\ - DEFAULT_OP_ARRAY_CMD(m_name, DVector<dv_type>, if(skip_cond) return;, arr->set(index, p_value);return) + DEFAULT_OP_ARRAY_CMD(m_name, PoolVector<dv_type>, if(skip_cond) return;, arr->set(index, p_value);return) #define DEFAULT_OP_DVECTOR_GET(m_name, dv_type)\ - DEFAULT_OP_ARRAY_CMD(m_name, const DVector<dv_type>, ;, return arr->get(index)) + DEFAULT_OP_ARRAY_CMD(m_name, const PoolVector<dv_type>, ;, return arr->get(index)) void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid) { @@ -1107,7 +1157,7 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid) } } } break; - case MATRIX32: { + case TRANSFORM2D: { if (p_value.type!=Variant::VECTOR2) return; @@ -1119,7 +1169,7 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid) if (index<0) index += 3; if (index>=0 && index<3) { - Matrix32 *v=_data._matrix32; + Transform2D *v=_data._transform2d; valid=true; v->elements[index]=p_value; @@ -1129,7 +1179,7 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid) //scalar name const String *str=reinterpret_cast<const String*>(p_index._data._mem); - Matrix32 *v=_data._matrix32; + Transform2D *v=_data._transform2d; if (*str=="x") { valid=true; v->elements[0]=p_value; @@ -1255,7 +1305,7 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid) } } break; - case _AABB: { + case RECT3: { if (p_value.type!=Variant::VECTOR3) return; @@ -1265,7 +1315,7 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid) //scalar name const String *str=reinterpret_cast<const String*>(p_index._data._mem); - AABB *v=_data._aabb; + Rect3 *v=_data._rect3; if (*str=="pos") { valid=true; v->pos=p_value; @@ -1281,7 +1331,7 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid) } } } break; //sorry naming convention fail :( not like it's used often // 10 - case MATRIX3: { + case BASIS: { if (p_value.type!=Variant::VECTOR3) return; @@ -1293,7 +1343,7 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid) if (index<0) index += 3; if (index>=0 && index<3) { - Matrix3 *v=_data._matrix3; + Basis *v=_data._basis; valid=true; v->set_axis(index,p_value); @@ -1302,7 +1352,7 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid) } else if (p_index.get_type()==Variant::STRING) { const String *str=reinterpret_cast<const String*>(p_index._data._mem); - Matrix3 *v=_data._matrix3; + Basis *v=_data._basis; if (*str=="x") { valid=true; @@ -1348,7 +1398,7 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid) if (*str=="basis") { - if (p_value.type!=Variant::MATRIX3) + if (p_value.type!=Variant::BASIS) return; valid=true; v->basis=p_value; @@ -1694,7 +1744,7 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid) } - if (ie.type==InputEvent::JOYSTICK_BUTTON) { + if (ie.type==InputEvent::JOYPAD_BUTTON) { if (str=="button_index") { if (p_value.type!=Variant::REAL && p_value.type!=Variant::INT) @@ -1719,7 +1769,7 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid) } - if (ie.type==InputEvent::JOYSTICK_MOTION) { + if (ie.type==InputEvent::JOYPAD_MOTION) { if (str=="axis") { if (p_value.type!=Variant::REAL && p_value.type!=Variant::INT) @@ -1837,13 +1887,13 @@ void Variant::set(const Variant& p_index, const Variant& p_value, bool *r_valid) return; } break; // 20 DEFAULT_OP_ARRAY_CMD(ARRAY, Array, ;, (*arr)[index]=p_value;return) - DEFAULT_OP_DVECTOR_SET(RAW_ARRAY, uint8_t, p_value.type != Variant::REAL && p_value.type != Variant::INT) - DEFAULT_OP_DVECTOR_SET(INT_ARRAY, int, p_value.type != Variant::REAL && p_value.type != Variant::INT) - DEFAULT_OP_DVECTOR_SET(REAL_ARRAY, real_t, p_value.type != Variant::REAL && p_value.type != Variant::INT) - DEFAULT_OP_DVECTOR_SET(STRING_ARRAY, String, p_value.type != Variant::STRING) // 25 - DEFAULT_OP_DVECTOR_SET(VECTOR2_ARRAY, Vector2, p_value.type != Variant::VECTOR2) - DEFAULT_OP_DVECTOR_SET(VECTOR3_ARRAY, Vector3, p_value.type != Variant::VECTOR3) - DEFAULT_OP_DVECTOR_SET(COLOR_ARRAY, Color, p_value.type != Variant::COLOR) + DEFAULT_OP_DVECTOR_SET(POOL_BYTE_ARRAY, uint8_t, p_value.type != Variant::REAL && p_value.type != Variant::INT) + DEFAULT_OP_DVECTOR_SET(POOL_INT_ARRAY, int, p_value.type != Variant::REAL && p_value.type != Variant::INT) + DEFAULT_OP_DVECTOR_SET(POOL_REAL_ARRAY, real_t, p_value.type != Variant::REAL && p_value.type != Variant::INT) + DEFAULT_OP_DVECTOR_SET(POOL_STRING_ARRAY, String, p_value.type != Variant::STRING) // 25 + DEFAULT_OP_DVECTOR_SET(POOL_VECTOR2_ARRAY, Vector2, p_value.type != Variant::VECTOR2) + DEFAULT_OP_DVECTOR_SET(POOL_VECTOR3_ARRAY, Vector3, p_value.type != Variant::VECTOR3) + DEFAULT_OP_DVECTOR_SET(POOL_COLOR_ARRAY, Color, p_value.type != Variant::COLOR) default: return; } @@ -1957,7 +2007,7 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const { } } break; - case MATRIX32: { + case TRANSFORM2D: { if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) { @@ -1966,7 +2016,7 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const { if (index<0) index += 3; if (index>=0 && index<3) { - const Matrix32 *v=_data._matrix32; + const Transform2D *v=_data._transform2d; valid=true; return v->elements[index]; @@ -1975,7 +2025,7 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const { //scalar name const String *str=reinterpret_cast<const String*>(p_index._data._mem); - const Matrix32 *v=_data._matrix32; + const Transform2D *v=_data._transform2d; if (*str=="x") { valid=true; return v->elements[0]; @@ -2036,13 +2086,13 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const { } } break; - case _AABB: { + case RECT3: { if (p_index.get_type()==Variant::STRING) { //scalar name const String *str=reinterpret_cast<const String*>(p_index._data._mem); - const AABB *v=_data._aabb; + const Rect3 *v=_data._rect3; if (*str=="pos") { valid=true; return v->pos; @@ -2055,7 +2105,7 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const { } } } break; //sorry naming convention fail :( not like it's used often // 10 - case MATRIX3: { + case BASIS: { if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) { @@ -2063,7 +2113,7 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const { if (index<0) index += 3; if (index>=0 && index<3) { - const Matrix3 *v=_data._matrix3; + const Basis *v=_data._basis; valid=true; return v->get_axis(index); @@ -2071,7 +2121,7 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const { } else if (p_index.get_type()==Variant::STRING) { const String *str=reinterpret_cast<const String*>(p_index._data._mem); - const Matrix3 *v=_data._matrix3; + const Basis *v=_data._basis; if (*str=="x") { valid=true; @@ -2317,7 +2367,7 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const { } - if (ie.type==InputEvent::JOYSTICK_BUTTON) { + if (ie.type==InputEvent::JOYPAD_BUTTON) { if (str=="button_index") { valid=true; @@ -2332,7 +2382,7 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const { } - if (ie.type==InputEvent::JOYSTICK_MOTION) { + if (ie.type==InputEvent::JOYPAD_MOTION) { if (str=="axis") { valid=true; @@ -2421,13 +2471,13 @@ Variant Variant::get(const Variant& p_index, bool *r_valid) const { } } break; // 20 DEFAULT_OP_ARRAY_CMD(ARRAY, const Array, ;, return (*arr)[index]) - DEFAULT_OP_DVECTOR_GET(RAW_ARRAY, uint8_t) - DEFAULT_OP_DVECTOR_GET(INT_ARRAY, int) - DEFAULT_OP_DVECTOR_GET(REAL_ARRAY, real_t) - DEFAULT_OP_DVECTOR_GET(STRING_ARRAY, String) - DEFAULT_OP_DVECTOR_GET(VECTOR2_ARRAY, Vector2) - DEFAULT_OP_DVECTOR_GET(VECTOR3_ARRAY, Vector3) - DEFAULT_OP_DVECTOR_GET(COLOR_ARRAY, Color) + DEFAULT_OP_DVECTOR_GET(POOL_BYTE_ARRAY, uint8_t) + DEFAULT_OP_DVECTOR_GET(POOL_INT_ARRAY, int) + DEFAULT_OP_DVECTOR_GET(POOL_REAL_ARRAY, real_t) + DEFAULT_OP_DVECTOR_GET(POOL_STRING_ARRAY, String) + DEFAULT_OP_DVECTOR_GET(POOL_VECTOR2_ARRAY, Vector2) + DEFAULT_OP_DVECTOR_GET(POOL_VECTOR3_ARRAY, Vector3) + DEFAULT_OP_DVECTOR_GET(POOL_COLOR_ARRAY, Color) default: return Variant(); } @@ -2507,14 +2557,14 @@ bool Variant::in(const Variant& p_index, bool *r_valid) const { return false; } break; - case RAW_ARRAY: { + case POOL_BYTE_ARRAY: { if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) { int index = p_index; - const DVector<uint8_t> *arr=reinterpret_cast<const DVector<uint8_t>* >(_data._mem); + const PoolVector<uint8_t> *arr=reinterpret_cast<const PoolVector<uint8_t>* >(_data._mem); int l=arr->size(); if (l) { - DVector<uint8_t>::Read r = arr->read(); + PoolVector<uint8_t>::Read r = arr->read(); for(int i=0;i<l;i++) { if (r[i]==index) return true; @@ -2526,14 +2576,14 @@ bool Variant::in(const Variant& p_index, bool *r_valid) const { } } break; - case INT_ARRAY: { + case POOL_INT_ARRAY: { if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) { int index = p_index; - const DVector<int> *arr=reinterpret_cast<const DVector<int>* >(_data._mem); + const PoolVector<int> *arr=reinterpret_cast<const PoolVector<int>* >(_data._mem); int l=arr->size(); if (l) { - DVector<int>::Read r = arr->read(); + PoolVector<int>::Read r = arr->read(); for(int i=0;i<l;i++) { if (r[i]==index) return true; @@ -2544,15 +2594,15 @@ bool Variant::in(const Variant& p_index, bool *r_valid) const { return false; } } break; - case REAL_ARRAY: { + case POOL_REAL_ARRAY: { if (p_index.get_type()==Variant::INT || p_index.get_type()==Variant::REAL) { real_t index = p_index; - const DVector<real_t> *arr=reinterpret_cast<const DVector<real_t>* >(_data._mem); + const PoolVector<real_t> *arr=reinterpret_cast<const PoolVector<real_t>* >(_data._mem); int l=arr->size(); if (l) { - DVector<real_t>::Read r = arr->read(); + PoolVector<real_t>::Read r = arr->read(); for(int i=0;i<l;i++) { if (r[i]==index) return true; @@ -2564,15 +2614,15 @@ bool Variant::in(const Variant& p_index, bool *r_valid) const { } } break; - case STRING_ARRAY: { + case POOL_STRING_ARRAY: { if (p_index.get_type()==Variant::STRING) { String index = p_index; - const DVector<String> *arr=reinterpret_cast<const DVector<String>* >(_data._mem); + const PoolVector<String> *arr=reinterpret_cast<const PoolVector<String>* >(_data._mem); int l=arr->size(); if (l) { - DVector<String>::Read r = arr->read(); + PoolVector<String>::Read r = arr->read(); for(int i=0;i<l;i++) { if (r[i]==index) return true; @@ -2584,15 +2634,15 @@ bool Variant::in(const Variant& p_index, bool *r_valid) const { } } break; //25 - case VECTOR2_ARRAY: { + case POOL_VECTOR2_ARRAY: { if (p_index.get_type()==Variant::VECTOR2) { Vector2 index = p_index; - const DVector<Vector2> *arr=reinterpret_cast<const DVector<Vector2>* >(_data._mem); + const PoolVector<Vector2> *arr=reinterpret_cast<const PoolVector<Vector2>* >(_data._mem); int l=arr->size(); if (l) { - DVector<Vector2>::Read r = arr->read(); + PoolVector<Vector2>::Read r = arr->read(); for(int i=0;i<l;i++) { if (r[i]==index) return true; @@ -2604,15 +2654,15 @@ bool Variant::in(const Variant& p_index, bool *r_valid) const { } } break; - case VECTOR3_ARRAY: { + case POOL_VECTOR3_ARRAY: { if (p_index.get_type()==Variant::VECTOR3) { Vector3 index = p_index; - const DVector<Vector3> *arr=reinterpret_cast<const DVector<Vector3>* >(_data._mem); + const PoolVector<Vector3> *arr=reinterpret_cast<const PoolVector<Vector3>* >(_data._mem); int l=arr->size(); if (l) { - DVector<Vector3>::Read r = arr->read(); + PoolVector<Vector3>::Read r = arr->read(); for(int i=0;i<l;i++) { if (r[i]==index) return true; @@ -2624,17 +2674,17 @@ bool Variant::in(const Variant& p_index, bool *r_valid) const { } } break; - case COLOR_ARRAY: { + case POOL_COLOR_ARRAY: { if (p_index.get_type()==Variant::COLOR) { Color index = p_index; - const DVector<Color> *arr=reinterpret_cast<const DVector<Color>* >(_data._mem); + const PoolVector<Color> *arr=reinterpret_cast<const PoolVector<Color>* >(_data._mem); int l=arr->size(); if (l) { - DVector<Color>::Read r = arr->read(); + PoolVector<Color>::Read r = arr->read(); for(int i=0;i<l;i++) { if (r[i]==index) return true; @@ -2679,7 +2729,7 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const { p_list->push_back( PropertyInfo(Variant::REAL,"z")); } break; - case MATRIX32: { + case TRANSFORM2D: { p_list->push_back( PropertyInfo(Variant::VECTOR2,"x")); p_list->push_back( PropertyInfo(Variant::VECTOR2,"y")); @@ -2703,12 +2753,12 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const { p_list->push_back( PropertyInfo(Variant::REAL,"w")); } break; - case _AABB: { + case RECT3: { p_list->push_back( PropertyInfo(Variant::VECTOR3,"pos")); p_list->push_back( PropertyInfo(Variant::VECTOR3,"size")); p_list->push_back( PropertyInfo(Variant::VECTOR3,"end")); } break; //sorry naming convention fail :( not like it's used often // 10 - case MATRIX3: { + case BASIS: { p_list->push_back( PropertyInfo(Variant::VECTOR3,"x")); p_list->push_back( PropertyInfo(Variant::VECTOR3,"y")); @@ -2717,7 +2767,7 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const { } break; case TRANSFORM: { - p_list->push_back( PropertyInfo(Variant::MATRIX3,"basis")); + p_list->push_back( PropertyInfo(Variant::BASIS,"basis")); p_list->push_back( PropertyInfo(Variant::VECTOR3,"origin")); } break; @@ -2813,7 +2863,7 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const { } - if (ie.type==InputEvent::JOYSTICK_BUTTON) { + if (ie.type==InputEvent::JOYPAD_BUTTON) { p_list->push_back( PropertyInfo(Variant::INT,"button_index") ); p_list->push_back( PropertyInfo(Variant::BOOL,"pressed") ); @@ -2821,7 +2871,7 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const { } - if (ie.type==InputEvent::JOYSTICK_MOTION) { + if (ie.type==InputEvent::JOYPAD_MOTION) { p_list->push_back( PropertyInfo(Variant::INT,"axis") ); p_list->push_back( PropertyInfo(Variant::REAL,"value") ); @@ -2864,12 +2914,12 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const { } } break; // 20 case ARRAY: - case RAW_ARRAY: - case INT_ARRAY: - case REAL_ARRAY: - case STRING_ARRAY: - case VECTOR3_ARRAY: - case COLOR_ARRAY: { + case POOL_BYTE_ARRAY: + case POOL_INT_ARRAY: + case POOL_REAL_ARRAY: + case POOL_STRING_ARRAY: + case POOL_VECTOR3_ARRAY: + case POOL_COLOR_ARRAY: { //nothing } break; @@ -2941,56 +2991,56 @@ bool Variant::iter_init(Variant& r_iter,bool &valid) const { r_iter=0; return true; } break; - case RAW_ARRAY: { - const DVector<uint8_t> *arr=reinterpret_cast<const DVector<uint8_t>*>(_data._mem); + case POOL_BYTE_ARRAY: { + const PoolVector<uint8_t> *arr=reinterpret_cast<const PoolVector<uint8_t>*>(_data._mem); if (arr->size()==0) return false; r_iter=0; return true; } break; - case INT_ARRAY: { - const DVector<int> *arr=reinterpret_cast<const DVector<int>*>(_data._mem); + case POOL_INT_ARRAY: { + const PoolVector<int> *arr=reinterpret_cast<const PoolVector<int>*>(_data._mem); if (arr->size()==0) return false; r_iter=0; return true; } break; - case REAL_ARRAY: { - const DVector<real_t> *arr=reinterpret_cast<const DVector<real_t>*>(_data._mem); + case POOL_REAL_ARRAY: { + const PoolVector<real_t> *arr=reinterpret_cast<const PoolVector<real_t>*>(_data._mem); if (arr->size()==0) return false; r_iter=0; return true; } break; - case STRING_ARRAY: { - const DVector<String> *arr=reinterpret_cast<const DVector<String>*>(_data._mem); + case POOL_STRING_ARRAY: { + const PoolVector<String> *arr=reinterpret_cast<const PoolVector<String>*>(_data._mem); if (arr->size()==0) return false; r_iter=0; return true; } break; - case VECTOR2_ARRAY: { + case POOL_VECTOR2_ARRAY: { - const DVector<Vector2> *arr=reinterpret_cast<const DVector<Vector2>*>(_data._mem); + const PoolVector<Vector2> *arr=reinterpret_cast<const PoolVector<Vector2>*>(_data._mem); if (arr->size()==0) return false; r_iter=0; return true; } break; - case VECTOR3_ARRAY: { + case POOL_VECTOR3_ARRAY: { - const DVector<Vector3> *arr=reinterpret_cast<const DVector<Vector3>*>(_data._mem); + const PoolVector<Vector3> *arr=reinterpret_cast<const PoolVector<Vector3>*>(_data._mem); if (arr->size()==0) return false; r_iter=0; return true; } break; - case COLOR_ARRAY: { + case POOL_COLOR_ARRAY: { - const DVector<Color> *arr=reinterpret_cast<const DVector<Color>*>(_data._mem); + const PoolVector<Color> *arr=reinterpret_cast<const PoolVector<Color>*>(_data._mem); if (arr->size()==0) return false; r_iter=0; @@ -3072,8 +3122,8 @@ bool Variant::iter_next(Variant& r_iter,bool &valid) const { r_iter=idx; return true; } break; - case RAW_ARRAY: { - const DVector<uint8_t> *arr=reinterpret_cast<const DVector<uint8_t>*>(_data._mem); + case POOL_BYTE_ARRAY: { + const PoolVector<uint8_t> *arr=reinterpret_cast<const PoolVector<uint8_t>*>(_data._mem); int idx=r_iter; idx++; if (idx>=arr->size()) @@ -3082,8 +3132,8 @@ bool Variant::iter_next(Variant& r_iter,bool &valid) const { return true; } break; - case INT_ARRAY: { - const DVector<int> *arr=reinterpret_cast<const DVector<int>*>(_data._mem); + case POOL_INT_ARRAY: { + const PoolVector<int> *arr=reinterpret_cast<const PoolVector<int>*>(_data._mem); int idx=r_iter; idx++; if (idx>=arr->size()) @@ -3092,8 +3142,8 @@ bool Variant::iter_next(Variant& r_iter,bool &valid) const { return true; } break; - case REAL_ARRAY: { - const DVector<real_t> *arr=reinterpret_cast<const DVector<real_t>*>(_data._mem); + case POOL_REAL_ARRAY: { + const PoolVector<real_t> *arr=reinterpret_cast<const PoolVector<real_t>*>(_data._mem); int idx=r_iter; idx++; if (idx>=arr->size()) @@ -3102,8 +3152,8 @@ bool Variant::iter_next(Variant& r_iter,bool &valid) const { return true; } break; - case STRING_ARRAY: { - const DVector<String> *arr=reinterpret_cast<const DVector<String>*>(_data._mem); + case POOL_STRING_ARRAY: { + const PoolVector<String> *arr=reinterpret_cast<const PoolVector<String>*>(_data._mem); int idx=r_iter; idx++; if (idx>=arr->size()) @@ -3111,9 +3161,9 @@ bool Variant::iter_next(Variant& r_iter,bool &valid) const { r_iter=idx; return true; } break; - case VECTOR2_ARRAY: { + case POOL_VECTOR2_ARRAY: { - const DVector<Vector2> *arr=reinterpret_cast<const DVector<Vector2>*>(_data._mem); + const PoolVector<Vector2> *arr=reinterpret_cast<const PoolVector<Vector2>*>(_data._mem); int idx=r_iter; idx++; if (idx>=arr->size()) @@ -3121,9 +3171,9 @@ bool Variant::iter_next(Variant& r_iter,bool &valid) const { r_iter=idx; return true; } break; - case VECTOR3_ARRAY: { + case POOL_VECTOR3_ARRAY: { - const DVector<Vector3> *arr=reinterpret_cast<const DVector<Vector3>*>(_data._mem); + const PoolVector<Vector3> *arr=reinterpret_cast<const PoolVector<Vector3>*>(_data._mem); int idx=r_iter; idx++; if (idx>=arr->size()) @@ -3131,9 +3181,9 @@ bool Variant::iter_next(Variant& r_iter,bool &valid) const { r_iter=idx; return true; } break; - case COLOR_ARRAY: { + case POOL_COLOR_ARRAY: { - const DVector<Color> *arr=reinterpret_cast<const DVector<Color>*>(_data._mem); + const PoolVector<Color> *arr=reinterpret_cast<const PoolVector<Color>*>(_data._mem); int idx=r_iter; idx++; if (idx>=arr->size()) @@ -3204,8 +3254,8 @@ Variant Variant::iter_get(const Variant& r_iter,bool &r_valid) const { #endif return arr->get(idx); } break; - case RAW_ARRAY: { - const DVector<uint8_t> *arr=reinterpret_cast<const DVector<uint8_t>*>(_data._mem); + case POOL_BYTE_ARRAY: { + const PoolVector<uint8_t> *arr=reinterpret_cast<const PoolVector<uint8_t>*>(_data._mem); int idx=r_iter; #ifdef DEBUG_ENABLED if (idx<0 || idx>=arr->size()) { @@ -3215,8 +3265,8 @@ Variant Variant::iter_get(const Variant& r_iter,bool &r_valid) const { #endif return arr->get(idx); } break; - case INT_ARRAY: { - const DVector<int> *arr=reinterpret_cast<const DVector<int>*>(_data._mem); + case POOL_INT_ARRAY: { + const PoolVector<int> *arr=reinterpret_cast<const PoolVector<int>*>(_data._mem); int idx=r_iter; #ifdef DEBUG_ENABLED if (idx<0 || idx>=arr->size()) { @@ -3226,8 +3276,8 @@ Variant Variant::iter_get(const Variant& r_iter,bool &r_valid) const { #endif return arr->get(idx); } break; - case REAL_ARRAY: { - const DVector<real_t> *arr=reinterpret_cast<const DVector<real_t>*>(_data._mem); + case POOL_REAL_ARRAY: { + const PoolVector<real_t> *arr=reinterpret_cast<const PoolVector<real_t>*>(_data._mem); int idx=r_iter; #ifdef DEBUG_ENABLED if (idx<0 || idx>=arr->size()) { @@ -3237,8 +3287,8 @@ Variant Variant::iter_get(const Variant& r_iter,bool &r_valid) const { #endif return arr->get(idx); } break; - case STRING_ARRAY: { - const DVector<String> *arr=reinterpret_cast<const DVector<String>*>(_data._mem); + case POOL_STRING_ARRAY: { + const PoolVector<String> *arr=reinterpret_cast<const PoolVector<String>*>(_data._mem); int idx=r_iter; #ifdef DEBUG_ENABLED if (idx<0 || idx>=arr->size()) { @@ -3248,9 +3298,9 @@ Variant Variant::iter_get(const Variant& r_iter,bool &r_valid) const { #endif return arr->get(idx); } break; - case VECTOR2_ARRAY: { + case POOL_VECTOR2_ARRAY: { - const DVector<Vector2> *arr=reinterpret_cast<const DVector<Vector2>*>(_data._mem); + const PoolVector<Vector2> *arr=reinterpret_cast<const PoolVector<Vector2>*>(_data._mem); int idx=r_iter; #ifdef DEBUG_ENABLED if (idx<0 || idx>=arr->size()) { @@ -3260,9 +3310,9 @@ Variant Variant::iter_get(const Variant& r_iter,bool &r_valid) const { #endif return arr->get(idx); } break; - case VECTOR3_ARRAY: { + case POOL_VECTOR3_ARRAY: { - const DVector<Vector3> *arr=reinterpret_cast<const DVector<Vector3>*>(_data._mem); + const PoolVector<Vector3> *arr=reinterpret_cast<const PoolVector<Vector3>*>(_data._mem); int idx=r_iter; #ifdef DEBUG_ENABLED if (idx<0 || idx>=arr->size()) { @@ -3272,9 +3322,9 @@ Variant Variant::iter_get(const Variant& r_iter,bool &r_valid) const { #endif return arr->get(idx); } break; - case COLOR_ARRAY: { + case POOL_COLOR_ARRAY: { - const DVector<Color> *arr=reinterpret_cast<const DVector<Color>*>(_data._mem); + const PoolVector<Color> *arr=reinterpret_cast<const PoolVector<Color>*>(_data._mem); int idx=r_iter; #ifdef DEBUG_ENABLED if (idx<0 || idx>=arr->size()) { @@ -3308,8 +3358,8 @@ void Variant::blend(const Variant& a, const Variant& b, float c, Variant &r_dst) switch(a.type) { case NIL: { r_dst=Variant(); } return; case INT:{ - int va=a._data._int; - int vb=b._data._int; + int64_t va=a._data._int; + int64_t vb=b._data._int; r_dst=int(va + vb * c + 0.5); } return; case REAL:{ @@ -3324,10 +3374,10 @@ void Variant::blend(const Variant& a, const Variant& b, float c, Variant &r_dst) r_dst=Rect2(ra->pos + rb->pos * c, ra->size + rb->size * c); } return; case VECTOR3:{ r_dst=*reinterpret_cast<const Vector3*>(a._data._mem)+*reinterpret_cast<const Vector3*>(b._data._mem)*c; } return; - case _AABB:{ - const AABB *ra = reinterpret_cast<const AABB*>(a._data._mem); - const AABB *rb = reinterpret_cast<const AABB*>(b._data._mem); - r_dst=AABB(ra->pos + rb->pos * c, ra->size + rb->size * c); + case RECT3:{ + const Rect3 *ra = reinterpret_cast<const Rect3*>(a._data._mem); + const Rect3 *rb = reinterpret_cast<const Rect3*>(b._data._mem); + r_dst=Rect3(ra->pos + rb->pos * c, ra->size + rb->size * c); } return; case QUAT:{ Quat empty_rot; @@ -3373,8 +3423,8 @@ void Variant::interpolate(const Variant& a, const Variant& b, float c,Variant &r case NIL:{ r_dst=Variant(); } return; case BOOL:{ r_dst=a; } return; case INT:{ - int va=a._data._int; - int vb=b._data._int; + int64_t va=a._data._int; + int64_t vb=b._data._int; r_dst=int((1.0-c) * va + vb * c); } return; case REAL:{ @@ -3426,11 +3476,11 @@ void Variant::interpolate(const Variant& a, const Variant& b, float c,Variant &r case VECTOR2:{ r_dst=reinterpret_cast<const Vector2*>(a._data._mem)->linear_interpolate(*reinterpret_cast<const Vector2*>(b._data._mem),c); } return; case RECT2:{ r_dst = Rect2( reinterpret_cast<const Rect2*>(a._data._mem)->pos.linear_interpolate(reinterpret_cast<const Rect2*>(b._data._mem)->pos,c), reinterpret_cast<const Rect2*>(a._data._mem)->size.linear_interpolate(reinterpret_cast<const Rect2*>(b._data._mem)->size,c) ); } return; case VECTOR3:{ r_dst=reinterpret_cast<const Vector3*>(a._data._mem)->linear_interpolate(*reinterpret_cast<const Vector3*>(b._data._mem),c); } return; - case MATRIX32:{ r_dst=a._data._matrix32->interpolate_with(*b._data._matrix32,c); } return; + case TRANSFORM2D:{ r_dst=a._data._transform2d->interpolate_with(*b._data._transform2d,c); } return; case PLANE:{ r_dst=a; } return; case QUAT:{ r_dst=reinterpret_cast<const Quat*>(a._data._mem)->slerp(*reinterpret_cast<const Quat*>(b._data._mem),c); } return; - case _AABB:{ r_dst=AABB( a._data._aabb->pos.linear_interpolate(b._data._aabb->pos,c), a._data._aabb->size.linear_interpolate(b._data._aabb->size,c) ); } return; - case MATRIX3:{ r_dst=Transform(*a._data._matrix3).interpolate_with(Transform(*b._data._matrix3),c).basis; } return; + case RECT3:{ r_dst=Rect3( a._data._rect3->pos.linear_interpolate(b._data._rect3->pos,c), a._data._rect3->size.linear_interpolate(b._data._rect3->size,c) ); } return; + case BASIS:{ r_dst=Transform(*a._data._basis).interpolate_with(Transform(*b._data._basis),c).basis; } return; case TRANSFORM:{ r_dst=a._data._transform->interpolate_with(*b._data._transform,c); } return; case COLOR:{ r_dst=reinterpret_cast<const Color*>(a._data._mem)->linear_interpolate(*reinterpret_cast<const Color*>(b._data._mem),c); } return; case IMAGE:{ r_dst=a; } return; @@ -3440,25 +3490,25 @@ void Variant::interpolate(const Variant& a, const Variant& b, float c,Variant &r case INPUT_EVENT:{ r_dst=a; } return; case DICTIONARY:{ } return; case ARRAY:{ r_dst=a; } return; - case RAW_ARRAY:{ r_dst=a; } return; - case INT_ARRAY:{ r_dst=a; } return; - case REAL_ARRAY:{ r_dst=a; } return; - case STRING_ARRAY:{ r_dst=a; } return; - case VECTOR2_ARRAY:{ - const DVector<Vector2> *arr_a=reinterpret_cast<const DVector<Vector2>* >(a._data._mem); - const DVector<Vector2> *arr_b=reinterpret_cast<const DVector<Vector2>* >(b._data._mem); + case POOL_BYTE_ARRAY:{ r_dst=a; } return; + case POOL_INT_ARRAY:{ r_dst=a; } return; + case POOL_REAL_ARRAY:{ r_dst=a; } return; + case POOL_STRING_ARRAY:{ r_dst=a; } return; + case POOL_VECTOR2_ARRAY:{ + const PoolVector<Vector2> *arr_a=reinterpret_cast<const PoolVector<Vector2>* >(a._data._mem); + const PoolVector<Vector2> *arr_b=reinterpret_cast<const PoolVector<Vector2>* >(b._data._mem); int sz = arr_a->size(); if (sz==0 || arr_b->size()!=sz) { r_dst=a; } else { - DVector<Vector2> v; + PoolVector<Vector2> v; v.resize(sz); { - DVector<Vector2>::Write vw=v.write(); - DVector<Vector2>::Read ar=arr_a->read(); - DVector<Vector2>::Read br=arr_b->read(); + PoolVector<Vector2>::Write vw=v.write(); + PoolVector<Vector2>::Read ar=arr_a->read(); + PoolVector<Vector2>::Read br=arr_b->read(); for(int i=0;i<sz;i++) { vw[i]=ar[i].linear_interpolate(br[i],c); @@ -3470,23 +3520,23 @@ void Variant::interpolate(const Variant& a, const Variant& b, float c,Variant &r } return; - case VECTOR3_ARRAY:{ + case POOL_VECTOR3_ARRAY:{ - const DVector<Vector3> *arr_a=reinterpret_cast<const DVector<Vector3>* >(a._data._mem); - const DVector<Vector3> *arr_b=reinterpret_cast<const DVector<Vector3>* >(b._data._mem); + const PoolVector<Vector3> *arr_a=reinterpret_cast<const PoolVector<Vector3>* >(a._data._mem); + const PoolVector<Vector3> *arr_b=reinterpret_cast<const PoolVector<Vector3>* >(b._data._mem); int sz = arr_a->size(); if (sz==0 || arr_b->size()!=sz) { r_dst=a; } else { - DVector<Vector3> v; + PoolVector<Vector3> v; v.resize(sz); { - DVector<Vector3>::Write vw=v.write(); - DVector<Vector3>::Read ar=arr_a->read(); - DVector<Vector3>::Read br=arr_b->read(); + PoolVector<Vector3>::Write vw=v.write(); + PoolVector<Vector3>::Read ar=arr_a->read(); + PoolVector<Vector3>::Read br=arr_b->read(); for(int i=0;i<sz;i++) { vw[i]=ar[i].linear_interpolate(br[i],c); @@ -3497,7 +3547,7 @@ void Variant::interpolate(const Variant& a, const Variant& b, float c,Variant &r } } return; - case COLOR_ARRAY:{ r_dst=a; } return; + case POOL_COLOR_ARRAY:{ r_dst=a; } return; default: { r_dst=a; diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp index 5ed2415e36..402c8d41da 100644 --- a/core/variant_parser.cpp +++ b/core/variant_parser.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -614,7 +614,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in value=Vector3(args[0],args[1],args[2]); return OK; - } else if (id=="Matrix32"){ + } else if (id=="Transform2D" || id=="Matrix32"){ //compatibility Vector<float> args; Error err = _parse_construct<float>(p_stream,args,line,r_err_str); @@ -624,7 +624,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in if (args.size()!=6) { r_err_str="Expected 6 arguments for constructor"; } - Matrix32 m; + Transform2D m; m[0]=Vector2(args[0],args[1]); m[1]=Vector2(args[2],args[3]); m[2]=Vector2(args[4],args[5]); @@ -657,7 +657,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in value=Quat(args[0],args[1],args[2],args[3]); return OK; - } else if (id=="AABB"){ + } else if (id=="Rect3" || id=="AABB"){ Vector<float> args; Error err = _parse_construct<float>(p_stream,args,line,r_err_str); @@ -668,10 +668,10 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in r_err_str="Expected 6 arguments for constructor"; } - value=AABB(Vector3(args[0],args[1],args[2]),Vector3(args[3],args[4],args[5])); + value=Rect3(Vector3(args[0],args[1],args[2]),Vector3(args[3],args[4],args[5])); return OK; - } else if (id=="Matrix3"){ + } else if (id=="Basis" || id=="Matrix3"){ //compatibility Vector<float> args; Error err = _parse_construct<float>(p_stream,args,line,r_err_str); @@ -682,7 +682,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in r_err_str="Expected 9 arguments for constructor"; } - value=Matrix3(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8]); + value=Basis(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8]); return OK; } else if (id=="Transform"){ @@ -695,7 +695,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in r_err_str="Expected 12 arguments for constructor"; } - value=Transform(Matrix3(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8]),Vector3(args[9],args[10],args[11])); + value=Transform(Basis(args[0],args[1],args[2],args[3],args[4],args[5],args[6],args[7],args[8]),Vector3(args[9],args[10],args[11])); return OK; } else if (id=="Color") { @@ -755,8 +755,17 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in } get_token(p_stream,token,line,r_err_str); - if (token.type!=TK_NUMBER) { - r_err_str="Expected number (mipmaps)"; + + bool has_mipmaps=false; + + if (token.type==TK_NUMBER) { + has_mipmaps=bool(token.value); + } else if (token.type==TK_IDENTIFIER && String(token.value)=="true") { + has_mipmaps=true; + } else if (token.type==TK_IDENTIFIER && String(token.value)=="false") { + has_mipmaps=false; + } else { + r_err_str="Expected number/true/false (mipmaps)"; return ERR_PARSE_ERROR; } @@ -778,36 +787,22 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in String sformat=token.value; - Image::Format format; - - if (sformat=="GRAYSCALE") format=Image::FORMAT_GRAYSCALE; - else if (sformat=="INTENSITY") format=Image::FORMAT_INTENSITY; - else if (sformat=="GRAYSCALE_ALPHA") format=Image::FORMAT_GRAYSCALE_ALPHA; - else if (sformat=="RGB") format=Image::FORMAT_RGB; - else if (sformat=="RGBA") format=Image::FORMAT_RGBA; - else if (sformat=="INDEXED") format=Image::FORMAT_INDEXED; - else if (sformat=="INDEXED_ALPHA") format=Image::FORMAT_INDEXED_ALPHA; - else if (sformat=="BC1") format=Image::FORMAT_BC1; - else if (sformat=="BC2") format=Image::FORMAT_BC2; - else if (sformat=="BC3") format=Image::FORMAT_BC3; - else if (sformat=="BC4") format=Image::FORMAT_BC4; - else if (sformat=="BC5") format=Image::FORMAT_BC5; - else if (sformat=="PVRTC2") format=Image::FORMAT_PVRTC2; - else if (sformat=="PVRTC2_ALPHA") format=Image::FORMAT_PVRTC2_ALPHA; - else if (sformat=="PVRTC4") format=Image::FORMAT_PVRTC4; - else if (sformat=="PVRTC4_ALPHA") format=Image::FORMAT_PVRTC4_ALPHA; - else if (sformat=="ATC") format=Image::FORMAT_ATC; - else if (sformat=="ATC_ALPHA_EXPLICIT") format=Image::FORMAT_ATC_ALPHA_EXPLICIT; - else if (sformat=="ATC_ALPHA_INTERPOLATED") format=Image::FORMAT_ATC_ALPHA_INTERPOLATED; - else if (sformat=="CUSTOM") format=Image::FORMAT_CUSTOM; - else { - r_err_str="Invalid image format: '"+sformat+"'"; + Image::Format format=Image::FORMAT_MAX; + + for(int i=0;i<Image::FORMAT_MAX;i++) { + if (Image::get_format_name(format)==sformat) { + format=Image::Format(i); + } + } + + if (format==Image::FORMAT_MAX) { + r_err_str="Unknown image format: "+String(sformat); return ERR_PARSE_ERROR; - }; + } int len = Image::get_image_data_size(width,height,format,mipmaps); - DVector<uint8_t> buffer; + PoolVector<uint8_t> buffer; buffer.resize(len); if (buffer.size()!=len) { @@ -815,7 +810,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in } { - DVector<uint8_t>::Write w=buffer.write(); + PoolVector<uint8_t>::Write w=buffer.write(); for(int i=0;i<len;i++) { get_token(p_stream,token,line,r_err_str); @@ -1088,7 +1083,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in return ERR_PARSE_ERROR; } - ie.type=InputEvent::JOYSTICK_BUTTON; + ie.type=InputEvent::JOYPAD_BUTTON; get_token(p_stream,token,line,r_err_str); if (token.type!=TK_NUMBER) { @@ -1112,7 +1107,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in return ERR_PARSE_ERROR; } - ie.type=InputEvent::JOYSTICK_MOTION; + ie.type=InputEvent::JOYPAD_MOTION; get_token(p_stream,token,line,r_err_str); if (token.type!=TK_NUMBER) { @@ -1154,18 +1149,18 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in return OK; - } else if (id=="ByteArray") { + } else if (id=="PoolByteArray"|| id=="ByteArray") { Vector<uint8_t> args; Error err = _parse_construct<uint8_t>(p_stream,args,line,r_err_str); if (err) return err; - DVector<uint8_t> arr; + PoolVector<uint8_t> arr; { int len=args.size(); arr.resize(len); - DVector<uint8_t>::Write w = arr.write(); + PoolVector<uint8_t>::Write w = arr.write(); for(int i=0;i<len;i++) { w[i]=args[i]; } @@ -1175,18 +1170,18 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in return OK; - } else if (id=="IntArray") { + } else if (id=="PoolIntArray"|| id=="IntArray") { Vector<int> args; Error err = _parse_construct<int>(p_stream,args,line,r_err_str); if (err) return err; - DVector<int> arr; + PoolVector<int> arr; { int len=args.size(); arr.resize(len); - DVector<int>::Write w = arr.write(); + PoolVector<int>::Write w = arr.write(); for(int i=0;i<len;i++) { w[i]=int(args[i]); } @@ -1196,18 +1191,18 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in return OK; - } else if (id=="FloatArray") { + } else if (id=="PoolFloatArray"|| id=="FloatArray") { Vector<float> args; Error err = _parse_construct<float>(p_stream,args,line,r_err_str); if (err) return err; - DVector<float> arr; + PoolVector<float> arr; { int len=args.size(); arr.resize(len); - DVector<float>::Write w = arr.write(); + PoolVector<float>::Write w = arr.write(); for(int i=0;i<len;i++) { w[i]=args[i]; } @@ -1216,7 +1211,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in value=arr; return OK; - } else if (id=="StringArray") { + } else if (id=="PoolStringArray"|| id=="StringArray") { get_token(p_stream,token,line,r_err_str); @@ -1256,11 +1251,11 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in } - DVector<String> arr; + PoolVector<String> arr; { int len=cs.size(); arr.resize(len); - DVector<String>::Write w = arr.write(); + PoolVector<String>::Write w = arr.write(); for(int i=0;i<len;i++) { w[i]=cs[i]; } @@ -1271,18 +1266,18 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in return OK; - } else if (id=="Vector2Array") { + } else if (id=="PoolVector2Array"|| id=="Vector2Array") { Vector<float> args; Error err = _parse_construct<float>(p_stream,args,line,r_err_str); if (err) return err; - DVector<Vector2> arr; + PoolVector<Vector2> arr; { int len=args.size()/2; arr.resize(len); - DVector<Vector2>::Write w = arr.write(); + PoolVector<Vector2>::Write w = arr.write(); for(int i=0;i<len;i++) { w[i]=Vector2(args[i*2+0],args[i*2+1]); } @@ -1292,18 +1287,18 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in return OK; - } else if (id=="Vector3Array") { + } else if (id=="PoolVector3Array"|| id=="Vector3Array") { Vector<float> args; Error err = _parse_construct<float>(p_stream,args,line,r_err_str); if (err) return err; - DVector<Vector3> arr; + PoolVector<Vector3> arr; { int len=args.size()/3; arr.resize(len); - DVector<Vector3>::Write w = arr.write(); + PoolVector<Vector3>::Write w = arr.write(); for(int i=0;i<len;i++) { w[i]=Vector3(args[i*3+0],args[i*3+1],args[i*3+2]); } @@ -1313,18 +1308,18 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in return OK; - } else if (id=="ColorArray") { + } else if (id=="PoolColorArray"|| id=="ColorArray") { Vector<float> args; Error err = _parse_construct<float>(p_stream,args,line,r_err_str); if (err) return err; - DVector<Color> arr; + PoolVector<Color> arr; { int len=args.size()/4; arr.resize(len); - DVector<Color>::Write w = arr.write(); + PoolVector<Color>::Write w = arr.write(); for(int i=0;i<len;i++) { w[i]=Color(args[i*4+0],args[i*4+1],args[i*4+2],args[i*4+3]); } @@ -1392,7 +1387,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in return err; ERR_FAIL_COND_V(params.size()!=2,ERR_PARSE_ERROR); InputEvent ie; - ie.type=InputEvent::JOYSTICK_BUTTON; + ie.type=InputEvent::JOYPAD_BUTTON; ie.device=params[0].to_int(); ie.joy_button.button_index=params[1].to_int(); @@ -1408,7 +1403,7 @@ Error VariantParser::parse_value(Token& token,Variant &value,Stream *p_stream,in ERR_FAIL_COND_V(params.size()!=2,ERR_PARSE_ERROR); InputEvent ie; - ie.type=InputEvent::JOYSTICK_MOTION; + ie.type=InputEvent::JOYPAD_MOTION; ie.device=params[0].to_int(); int axis=params[1].to_int(); ie.joy_motion.axis=axis>>1; @@ -1903,10 +1898,10 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud,"Plane( "+rtosfix(p.normal.x) +", "+rtosfix(p.normal.y)+", "+rtosfix(p.normal.z)+", "+rtosfix(p.d)+" )" ); } break; - case Variant::_AABB: { + case Variant::RECT3: { - AABB aabb = p_variant; - p_store_string_func(p_store_string_ud,"AABB( "+rtosfix(aabb.pos.x) +", "+rtosfix(aabb.pos.y) +", "+rtosfix(aabb.pos.z) +", "+rtosfix(aabb.size.x) +", "+rtosfix(aabb.size.y) +", "+rtosfix(aabb.size.z)+" )" ); + Rect3 aabb = p_variant; + p_store_string_func(p_store_string_ud,"Rect3( "+rtosfix(aabb.pos.x) +", "+rtosfix(aabb.pos.y) +", "+rtosfix(aabb.pos.z) +", "+rtosfix(aabb.size.x) +", "+rtosfix(aabb.size.y) +", "+rtosfix(aabb.size.z)+" )" ); } break; case Variant::QUAT: { @@ -1915,10 +1910,10 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud,"Quat( "+rtosfix(quat.x)+", "+rtosfix(quat.y)+", "+rtosfix(quat.z)+", "+rtosfix(quat.w)+" )"); } break; - case Variant::MATRIX32: { + case Variant::TRANSFORM2D: { - String s="Matrix32( "; - Matrix32 m3 = p_variant; + String s="Transform2D( "; + Transform2D m3 = p_variant; for (int i=0;i<3;i++) { for (int j=0;j<2;j++) { @@ -1931,10 +1926,10 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud,s+" )"); } break; - case Variant::MATRIX3: { + case Variant::BASIS: { - String s="Matrix3( "; - Matrix3 m3 = p_variant; + String s="Basis( "; + Basis m3 = p_variant; for (int i=0;i<3;i++) { for (int j=0;j<3;j++) { @@ -1951,7 +1946,7 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str String s="Transform( "; Transform t = p_variant; - Matrix3 &m3 = t.basis; + Basis &m3 = t.basis; for (int i=0;i<3;i++) { for (int j=0;j<3;j++) { @@ -1986,41 +1981,14 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str String imgstr="Image( "; imgstr+=itos(img.get_width()); imgstr+=", "+itos(img.get_height()); - imgstr+=", "+itos(img.get_mipmaps()); - imgstr+=", "; - - switch(img.get_format()) { - - case Image::FORMAT_GRAYSCALE: imgstr+="GRAYSCALE"; break; - case Image::FORMAT_INTENSITY: imgstr+="INTENSITY"; break; - case Image::FORMAT_GRAYSCALE_ALPHA: imgstr+="GRAYSCALE_ALPHA"; break; - case Image::FORMAT_RGB: imgstr+="RGB"; break; - case Image::FORMAT_RGBA: imgstr+="RGBA"; break; - case Image::FORMAT_INDEXED : imgstr+="INDEXED"; break; - case Image::FORMAT_INDEXED_ALPHA: imgstr+="INDEXED_ALPHA"; break; - case Image::FORMAT_BC1: imgstr+="BC1"; break; - case Image::FORMAT_BC2: imgstr+="BC2"; break; - case Image::FORMAT_BC3: imgstr+="BC3"; break; - case Image::FORMAT_BC4: imgstr+="BC4"; break; - case Image::FORMAT_BC5: imgstr+="BC5"; break; - case Image::FORMAT_PVRTC2: imgstr+="PVRTC2"; break; - case Image::FORMAT_PVRTC2_ALPHA: imgstr+="PVRTC2_ALPHA"; break; - case Image::FORMAT_PVRTC4: imgstr+="PVRTC4"; break; - case Image::FORMAT_PVRTC4_ALPHA: imgstr+="PVRTC4_ALPHA"; break; - case Image::FORMAT_ETC: imgstr+="ETC"; break; - case Image::FORMAT_ATC: imgstr+="ATC"; break; - case Image::FORMAT_ATC_ALPHA_EXPLICIT: imgstr+="ATC_ALPHA_EXPLICIT"; break; - case Image::FORMAT_ATC_ALPHA_INTERPOLATED: imgstr+="ATC_ALPHA_INTERPOLATED"; break; - case Image::FORMAT_CUSTOM: imgstr+="CUSTOM"; break; - default: {} - } - + imgstr+=", "+String(img.has_mipmaps()?"true":"false"); + imgstr+=", "+Image::get_format_name(img.get_format()); String s; - DVector<uint8_t> data = img.get_data(); + PoolVector<uint8_t> data = img.get_data(); int len = data.size(); - DVector<uint8_t>::Read r = data.read(); + PoolVector<uint8_t>::Read r = data.read(); const uint8_t *ptr=r.ptr();; for (int i=0;i<len;i++) { @@ -2097,11 +2065,11 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str str+="MBUTTON,"+itos(ev.mouse_button.button_index); } break; - case InputEvent::JOYSTICK_BUTTON: { + case InputEvent::JOYPAD_BUTTON: { str+="JBUTTON,"+itos(ev.joy_button.button_index); } break; - case InputEvent::JOYSTICK_MOTION: { + case InputEvent::JOYPAD_MOTION: { str+="JAXIS,"+itos(ev.joy_motion.axis)+","+itos(ev.joy_motion.axis_value); } break; case InputEvent::NONE: { @@ -2156,13 +2124,13 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str } break; - case Variant::RAW_ARRAY: { + case Variant::POOL_BYTE_ARRAY: { - p_store_string_func(p_store_string_ud,"ByteArray( "); + p_store_string_func(p_store_string_ud,"PoolByteArray( "); String s; - DVector<uint8_t> data = p_variant; + PoolVector<uint8_t> data = p_variant; int len = data.size(); - DVector<uint8_t>::Read r = data.read(); + PoolVector<uint8_t>::Read r = data.read(); const uint8_t *ptr=r.ptr();; for (int i=0;i<len;i++) { @@ -2176,12 +2144,12 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud," )"); } break; - case Variant::INT_ARRAY: { + case Variant::POOL_INT_ARRAY: { - p_store_string_func(p_store_string_ud,"IntArray( "); - DVector<int> data = p_variant; + p_store_string_func(p_store_string_ud,"PoolIntArray( "); + PoolVector<int> data = p_variant; int len = data.size(); - DVector<int>::Read r = data.read(); + PoolVector<int>::Read r = data.read(); const int *ptr=r.ptr();; for (int i=0;i<len;i++) { @@ -2196,12 +2164,12 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud," )"); } break; - case Variant::REAL_ARRAY: { + case Variant::POOL_REAL_ARRAY: { - p_store_string_func(p_store_string_ud,"FloatArray( "); - DVector<real_t> data = p_variant; + p_store_string_func(p_store_string_ud,"PoolFloatArray( "); + PoolVector<real_t> data = p_variant; int len = data.size(); - DVector<real_t>::Read r = data.read(); + PoolVector<real_t>::Read r = data.read(); const real_t *ptr=r.ptr();; for (int i=0;i<len;i++) { @@ -2214,12 +2182,12 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud," )"); } break; - case Variant::STRING_ARRAY: { + case Variant::POOL_STRING_ARRAY: { - p_store_string_func(p_store_string_ud,"StringArray( "); - DVector<String> data = p_variant; + p_store_string_func(p_store_string_ud,"PoolStringArray( "); + PoolVector<String> data = p_variant; int len = data.size(); - DVector<String>::Read r = data.read(); + PoolVector<String>::Read r = data.read(); const String *ptr=r.ptr();; String s; //write_string("\n"); @@ -2237,12 +2205,12 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud," )"); } break; - case Variant::VECTOR2_ARRAY: { + case Variant::POOL_VECTOR2_ARRAY: { - p_store_string_func(p_store_string_ud,"Vector2Array( "); - DVector<Vector2> data = p_variant; + p_store_string_func(p_store_string_ud,"PoolVector2Array( "); + PoolVector<Vector2> data = p_variant; int len = data.size(); - DVector<Vector2>::Read r = data.read(); + PoolVector<Vector2>::Read r = data.read(); const Vector2 *ptr=r.ptr();; for (int i=0;i<len;i++) { @@ -2255,12 +2223,12 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud," )"); } break; - case Variant::VECTOR3_ARRAY: { + case Variant::POOL_VECTOR3_ARRAY: { - p_store_string_func(p_store_string_ud,"Vector3Array( "); - DVector<Vector3> data = p_variant; + p_store_string_func(p_store_string_ud,"PoolVector3Array( "); + PoolVector<Vector3> data = p_variant; int len = data.size(); - DVector<Vector3>::Read r = data.read(); + PoolVector<Vector3>::Read r = data.read(); const Vector3 *ptr=r.ptr();; for (int i=0;i<len;i++) { @@ -2273,13 +2241,13 @@ Error VariantWriter::write(const Variant& p_variant, StoreStringFunc p_store_str p_store_string_func(p_store_string_ud," )"); } break; - case Variant::COLOR_ARRAY: { + case Variant::POOL_COLOR_ARRAY: { - p_store_string_func(p_store_string_ud,"ColorArray( "); + p_store_string_func(p_store_string_ud,"PoolColorArray( "); - DVector<Color> data = p_variant; + PoolVector<Color> data = p_variant; int len = data.size(); - DVector<Color>::Read r = data.read(); + PoolVector<Color>::Read r = data.read(); const Color *ptr=r.ptr();; for (int i=0;i<len;i++) { diff --git a/core/variant_parser.h b/core/variant_parser.h index 5857820efa..c69673b0e4 100644 --- a/core/variant_parser.h +++ b/core/variant_parser.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/vector.h b/core/vector.h index cafb4a4aa3..3119657cbb 100644 --- a/core/vector.h +++ b/core/vector.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,7 +32,7 @@ /** * @class Vector * @author Juan Linietsky - * Vector container. Regular Vector Container. Use with care and for smaller arrays when possible. Use DVector for large arrays. + * Vector container. Regular Vector Container. Use with care and for smaller arrays when possible. Use PoolVector for large arrays. */ #include "os/memory.h" #include "error_macros.h" @@ -46,19 +46,20 @@ class Vector { // internal helpers - _FORCE_INLINE_ SafeRefCount* _get_refcount() const { + _FORCE_INLINE_ uint32_t* _get_refcount() const { if (!_ptr) return NULL; - return reinterpret_cast<SafeRefCount*>((uint8_t*)_ptr-sizeof(int)-sizeof(SafeRefCount)); + return reinterpret_cast<uint32_t*>(_ptr)-2; } - _FORCE_INLINE_ int* _get_size() const { + _FORCE_INLINE_ uint32_t* _get_size() const { if (!_ptr) - return NULL; - return reinterpret_cast<int*>((uint8_t*)_ptr-sizeof(int)); + return NULL; + + return reinterpret_cast<uint32_t*>(_ptr)-1; } _FORCE_INLINE_ T* _get_data() const { @@ -71,7 +72,7 @@ class Vector { _FORCE_INLINE_ size_t _get_alloc_size(size_t p_elements) const { //return nearest_power_of_2_templated(p_elements*sizeof(T)+sizeof(SafeRefCount)+sizeof(int)); - return nearest_power_of_2(p_elements*sizeof(T)+sizeof(SafeRefCount)+sizeof(int)); + return nearest_power_of_2(p_elements*sizeof(T)); } _FORCE_INLINE_ bool _get_alloc_size_checked(size_t p_elements, size_t *out) const { @@ -79,8 +80,8 @@ class Vector { size_t o; size_t p; if (_mul_overflow(p_elements, sizeof(T), &o)) return false; - if (_add_overflow(o, sizeof(SafeRefCount)+sizeof(int), &p)) return false; - *out = nearest_power_of_2(p); + *out = nearest_power_of_2(o); + if (_add_overflow(o, 32, &p)) return false; //no longer allocated here return true; #else // Speed is more important than correctness here, do the operations unchecked @@ -104,7 +105,7 @@ public: _FORCE_INLINE_ void clear() { resize(0); } _FORCE_INLINE_ int size() const { - int* size = _get_size(); + uint32_t* size = (uint32_t*)_get_size(); if (size) return *size; else @@ -190,22 +191,22 @@ void Vector<T>::_unref(void *p_data) { if (!p_data) return; - SafeRefCount *src = reinterpret_cast<SafeRefCount*>((uint8_t*)p_data-sizeof(int)-sizeof(SafeRefCount)); + uint32_t *refc = _get_refcount(); - if (!src->unref()) + if (atomic_decrement(refc)>0) return; // still in use // clean up - int *count = (int*)(src+1); + uint32_t *count = _get_size(); T *data = (T*)(count+1); - for (int i=0;i<*count;i++) { + for (uint32_t i=0;i<*count;i++) { // call destructors data[i].~T(); } // free mem - memfree((uint8_t*)p_data-sizeof(int)-sizeof(SafeRefCount)); + Memory::free_static((uint8_t*)p_data,true); } @@ -215,18 +216,22 @@ void Vector<T>::_copy_on_write() { if (!_ptr) return; - if (_get_refcount()->get() > 1 ) { + uint32_t *refc = _get_refcount(); + + if (*refc > 1) { /* in use by more than me */ - void* mem_new = memalloc(_get_alloc_size(*_get_size())); - SafeRefCount *src_new=(SafeRefCount *)mem_new; - src_new->init(); - int * _size = (int*)(src_new+1); - *_size=*_get_size(); + uint32_t current_size = *_get_size(); + + uint32_t* mem_new = (uint32_t*)Memory::alloc_static(_get_alloc_size(current_size),true); - T*_data=(T*)(_size+1); + + *(mem_new-2)=1; //refcount + *(mem_new-1)=current_size; //size + + T*_data=(T*)(mem_new); // initialize new elements - for (int i=0;i<*_size;i++) { + for (uint32_t i=0;i<current_size;i++) { memnew_placement(&_data[i], T( _get_data()[i] ) ); } @@ -280,16 +285,17 @@ Error Vector<T>::resize(int p_size) { if (size()==0) { // alloc from scratch - void* ptr=memalloc(alloc_size); + uint32_t *ptr=(uint32_t*)Memory::alloc_static(alloc_size,true); ERR_FAIL_COND_V( !ptr ,ERR_OUT_OF_MEMORY); - _ptr=(T*)((uint8_t*)ptr+sizeof(int)+sizeof(SafeRefCount)); - _get_refcount()->init(); // init refcount - *_get_size()=0; // init size (currently, none) + *(ptr-1)=0; //size, currently none + *(ptr-2)=1; //refcount + + _ptr=(T*)ptr; } else { - void *_ptrnew = (T*)memrealloc((uint8_t*)_ptr-sizeof(int)-sizeof(SafeRefCount), alloc_size); + void *_ptrnew = (T*)Memory::realloc_static(_ptr, alloc_size,true); ERR_FAIL_COND_V( !_ptrnew ,ERR_OUT_OF_MEMORY); - _ptr=(T*)((uint8_t*)_ptrnew+sizeof(int)+sizeof(SafeRefCount)); + _ptr=(T*)(_ptrnew); } // construct the newly created elements @@ -305,16 +311,16 @@ Error Vector<T>::resize(int p_size) { } else if (p_size<size()) { // deinitialize no longer needed elements - for (int i=p_size;i<*_get_size();i++) { + for (uint32_t i=p_size;i<*_get_size();i++) { T* t = &_get_data()[i]; t->~T(); } - void *_ptrnew = (T*)memrealloc((uint8_t*)_ptr-sizeof(int)-sizeof(SafeRefCount), alloc_size); + void *_ptrnew = (T*)Memory::realloc_static(_ptr, alloc_size,true); ERR_FAIL_COND_V( !_ptrnew ,ERR_OUT_OF_MEMORY); - _ptr=(T*)((uint8_t*)_ptrnew+sizeof(int)+sizeof(SafeRefCount)); + _ptr=(T*)(_ptrnew); *_get_size()=p_size; @@ -382,8 +388,9 @@ void Vector<T>::_copy_from(const Vector& p_from) { if (!p_from._ptr) return; //nothing to do - if (p_from._get_refcount()->ref()) // could reference + if (atomic_conditional_increment(p_from._get_refcount())>0) { // could reference _ptr=p_from._ptr; + } } diff --git a/core/vmap.h b/core/vmap.h index 6880abf260..3708cbed5b 100644 --- a/core/vmap.h +++ b/core/vmap.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/core/vset.h b/core/vset.h index cafcb0bb2f..e0b5181263 100644 --- a/core/vset.h +++ b/core/vset.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/doc/base/classes.xml b/doc/base/classes.xml index f1155be854..04bf8f677e 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -2519,6 +2519,11 @@ Emitted when frame is changed. </description> </signal> + <signal name="finished"> + <description> + Emitted when the animation is finished (when it plays the last frame). If the animation is looping, this signal is emitted everytime the last frame is drawn, before looping. + </description> + </signal> </signals> <constants> </constants> @@ -4656,6 +4661,20 @@ Remove the first occurrence of a value from the array. </description> </method> + <method name="front"> + <return type="Variant"> + </return> + <description> + Returns the first element of the array if the array is not empty (size>0). + </description> + </method> + <method name="back"> + <return type="Variant"> + </return> + <description> + Returns the last element of the array if the array is not empty (size>0). + </description> + </method> <method name="find"> <return type="int"> </return> @@ -11845,6 +11864,13 @@ Get the main editor control. Use this as a parent for main screens. </description> </method> + <method name="edit_resource"> + <argument index="0" name="p_resource" type="Resource"> + </argument> + <description> + Tells the editor to handle the edit of the given resource. Ex: If you pass a Script as a argument, the editor will open the scriptEditor. + </description> + </method> <method name="get_name" qualifiers="virtual"> <return type="String"> </return> @@ -12267,17 +12293,19 @@ </argument> <description> Add a custom property info to a property. The dictionary must contain: name:[String](the name of the property) and type:[int](see TYPE_* in [@Global Scope]), and optionally hint:[int](see PROPERTY_HINT_* in [@Global Scope]), hint_string:[String]. - Example:[codeblock] - editor_settings.set("category/property_name", 0) + Example: + [codeblock] + editor_settings.set("category/property_name", 0) - var property_info = { - "name": "category/property_name", - "type": TYPE_INT, - "hint": PROPERTY_HINT_ENUM, - "hint_string": "one,two,three" - } + var property_info = { + "name": "category/property_name", + "type": TYPE_INT, + "hint": PROPERTY_HINT_ENUM, + "hint_string": "one,two,three" + } - editor_settings.add_property_info(property_info)[/codeblock] + editor_settings.add_property_info(property_info) + [/codeblock] </description> </method> <method name="erase"> @@ -13422,12 +13450,12 @@ </theme_item> </theme_items> </class> -<class name="FixedMaterial" inherits="Material" category="Core"> +<class name="FixedSpatialMaterial" inherits="Material" category="Core"> <brief_description> Simple Material with a fixed parameter set. </brief_description> <description> - FixedMaterial is a simple type of material [Resource], which contains a fixed amount of parameters. It is the only type of material supported in fixed-pipeline devices and APIs. It is also an often a better alternative to [ShaderMaterial] for most simple use cases. + FixedSpatialMaterial is a simple type of material [Resource], which contains a fixed amount of parameters. It is the only type of material supported in fixed-pipeline devices and APIs. It is also an often a better alternative to [ShaderMaterial] for most simple use cases. </description> <methods> <method name="get_fixed_flag" qualifiers="const"> @@ -15526,7 +15554,7 @@ <return type="int"> </return> <description> - Returns a status string like STATUS_REQUESTING. Need to call [method poll] in order to get status updates. + Returns a STATUS_* enum constant. Need to call [method poll] in order to get status updates. </description> </method> <method name="has_response" qualifiers="const"> @@ -16068,7 +16096,7 @@ </return> <argument index="0" name="host" type="String"> </argument> - <argument index="1" name="ip_type" type="int" default="int.IP_TYPE_ANY"> + <argument index="1" name="ip_type" type="int" default="IP.TYPE_ANY"> </argument> <description> Resolve a given hostname, blocking. Resolved hostname is returned as an IPv4 or IPv6 depending on "ip_type". @@ -16079,7 +16107,7 @@ </return> <argument index="0" name="host" type="String"> </argument> - <argument index="1" name="ip_type" type="int" default="int.IP_TYPE_ANY"> + <argument index="1" name="ip_type" type="int" default="IP.TYPE_ANY"> </argument> <description> Create a queue item for resolving a given hostname to an IPv4 or IPv6 depending on "ip_type". The queue ID is returned, or RESOLVER_INVALID_ID on error. @@ -16316,15 +16344,15 @@ </constant> <constant name="COMPRESS_ETC" value="3"> </constant> - <constant name="FORMAT_GRAYSCALE" value="0"> + <constant name="FORMAT_L8" value="0"> </constant> <constant name="FORMAT_INTENSITY" value="1"> </constant> - <constant name="FORMAT_GRAYSCALE_ALPHA" value="2"> + <constant name="FORMAT_LA8" value="2"> </constant> - <constant name="FORMAT_RGB" value="3"> + <constant name="FORMAT_RGB8" value="3"> </constant> - <constant name="FORMAT_RGBA" value="4"> + <constant name="FORMAT_RGBA8" value="4"> </constant> <constant name="FORMAT_INDEXED" value="5"> </constant> @@ -16334,23 +16362,23 @@ </constant> <constant name="FORMAT_YUV_444" value="8"> </constant> - <constant name="FORMAT_BC1" value="9"> + <constant name="FORMAT_DXT1" value="9"> </constant> - <constant name="FORMAT_BC2" value="10"> + <constant name="FORMAT_DXT3" value="10"> </constant> - <constant name="FORMAT_BC3" value="11"> + <constant name="FORMAT_DXT5" value="11"> </constant> - <constant name="FORMAT_BC4" value="12"> + <constant name="FORMAT_ATI1" value="12"> </constant> - <constant name="FORMAT_BC5" value="13"> + <constant name="FORMAT_ATI2" value="13"> </constant> <constant name="FORMAT_PVRTC2" value="14"> </constant> - <constant name="FORMAT_PVRTC2_ALPHA" value="15"> + <constant name="FORMAT_PVRTC2A" value="15"> </constant> <constant name="FORMAT_PVRTC4" value="16"> </constant> - <constant name="FORMAT_PVRTC4_ALPHA" value="17"> + <constant name="FORMAT_PVRTC4A" value="17"> </constant> <constant name="FORMAT_ETC" value="18"> </constant> @@ -18023,7 +18051,7 @@ <argument index="1" name="action" type="String"> </argument> <description> - Return whether the given event is part of an existing action. + Return whether the given event is part of an existing action. This method ignores keyboard modifiers if the given [InputEvent] is not pressed (for proper release detection). See [method action_has_event] if you don't want this behavior. </description> </method> <method name="get_action_from_id" qualifiers="const"> @@ -20668,7 +20696,8 @@ 3x3 matrix datatype. </brief_description> <description> - 3x3 matrix used for 3D rotation and scale. Contains 3 vector fields x,y and z. Can also be accessed as array of 3D vectors. Almost always used as orthogonal basis for a [Transform]. + 3x3 matrix used for 3D rotation and scale. Contains 3 vector fields x,y and z as its columns, which can be interpreted as the local basis vectors of a transformation. Can also be accessed as array of 3D vectors. Almost always used as orthogonal basis for a [Transform]. + For such use, it is composed of a scaling and a rotation matrix, in that order (M = R.S). </description> <methods> <method name="Matrix3"> @@ -20677,7 +20706,7 @@ <argument index="0" name="from" type="Quat"> </argument> <description> - Create a matrix from a quaternion. + Create a rotation matrix from the given quaternion. </description> </method> <method name="Matrix3"> @@ -20688,7 +20717,7 @@ <argument index="1" name="phi" type="float"> </argument> <description> - Create a matrix from an axis vector and an angle. + Create a rotation matrix which rotates around the given axis by the specified angle. </description> </method> <method name="Matrix3"> @@ -20715,33 +20744,36 @@ <return type="Vector3"> </return> <description> - Return euler angles from the matrix. + Return Euler angles (in the XYZ convention: first Z, then Y, and X last) from the matrix. Returned vector contains the rotation angles in the format (third,second,first). + This function only works if the matrix represents a proper rotation. </description> </method> <method name="get_orthogonal_index"> <return type="int"> </return> <description> + This function considers a discretization of rotations into 24 points on unit sphere, lying along the vectors (x,y,z) with each component being either -1,0 or 1, and returns the index of the point best representing the orientation of the object. It is mainly used by the grid map editor. For further details, refer to Godot source code. </description> </method> <method name="get_scale"> <return type="Vector3"> </return> <description> + Assuming that the matrix is the combination of a rotation and scaling, return the absolute value of scaling factors along each axis. </description> </method> <method name="inverse"> <return type="Matrix3"> </return> <description> - Return the affine inverse of the matrix. + Return the inverse of the matrix. </description> </method> <method name="orthonormalized"> <return type="Matrix3"> </return> <description> - Return the orthonormalized version of the matrix (useful to call from time to time to avoid rounding error). + Return the orthonormalized version of the matrix (useful to call from time to time to avoid rounding error for orthogonal matrices). This performs a Gram-Schmidt orthonormalization on the basis of the matrix. </description> </method> <method name="rotated"> @@ -20752,16 +20784,16 @@ <argument index="1" name="phi" type="float"> </argument> <description> - Return the rotated version of the matrix, by a given axis and angle. + Introduce an additional rotation around the given axis by phi. Only relevant when the matrix is being used as a part of [Transform]. </description> - </method> + </method> <method name="scaled"> <return type="Matrix3"> </return> <argument index="0" name="scale" type="Vector3"> </argument> <description> - Return the scaled version of the matrix, by a 3D scale. + Introduce an additional scaling specified by the given 3D scaling factor. Only relevant when the matrix is being used as a part of [Transform]. </description> </method> <method name="tdotx"> @@ -20804,7 +20836,7 @@ <argument index="0" name="v" type="Vector3"> </argument> <description> - Return a vector transformed by the matrix and return it. + Return a vector transformed (multiplied) by the matrix and return it. </description> </method> <method name="xform_inv"> @@ -20813,7 +20845,7 @@ <argument index="0" name="v" type="Vector3"> </argument> <description> - Return a vector transformed by the transposed matrix and return it. + Return a vector transformed (multiplied) by the transposed matrix and return it. Note that this is a multiplication by inverse only when the matrix represents a rotation-reflection. </description> </method> </methods> @@ -20870,6 +20902,7 @@ <return type="Matrix32"> </return> <description> + Return the inverse of the matrix. </description> </method> <method name="basis_xform"> @@ -25361,15 +25394,10 @@ </return> <argument index="0" name="port" type="int"> </argument> - <argument index="1" name="ip_type" type="int" default="int.IP_TYPE_ANY"> - </argument> - <argument index="2" name="recv_buf_size" type="int" default="65536"> + <argument index="1" name="recv_buf_size" type="int" default="65536"> </argument> <description> - Make this [PacketPeerUDP] listen on the "port" using protocol "ip_type" and a buffer size "recv_buf_size". Listens on all available adresses. - IP_TYPE_IPV4 = IPv4 only - IP_TYPE_IPV6 = IPv6 only - IP_TYPE_ANY = Dual stack (supports both IPv6 and IPv4 connections). + Make this [PacketPeerUDP] listen on the "port" with a buffer size "recv_buf_size". Listens on all available addresses. </description> </method> <method name="set_send_address"> @@ -25379,10 +25407,8 @@ </argument> <argument index="1" name="port" type="int"> </argument> - <argument index="2" name="ip_type" type="int" default="int.IP_TYPE_ANY"> - </argument> <description> - Set the destination address and port for sending packets and variables, a hostname will be resolved using "ip_type" (v4/v6/any) if valid. + Set the destination address and port for sending packets and variables, a hostname will be resolved using if valid. </description> </method> <method name="wait"> @@ -28704,12 +28730,24 @@ <description> </description> </method> + <method name="apply_torque_impulse"> + <argument index="0" name="j" type="Vector3"> + </argument> + <description> + </description> + </method> <method name="get_angular_velocity" qualifiers="const"> <return type="Vector3"> </return> <description> </description> </method> + <method name="get_center_of_mass" qualifiers="const"> + <return type="Vector3"/> + </return> + <description> + </description> + </method> <method name="get_contact_collider" qualifiers="const"> <return type="RID"> </return> @@ -28788,7 +28826,7 @@ <description> </description> </method> - <method name="get_inverse_inertia" qualifiers="const"> + <method name="get_inverse_inertia_tensor" qualifiers="const"> <return type="Vector3"> </return> <description> @@ -28806,6 +28844,12 @@ <description> </description> </method> + <method name="get_principal_inertia_axes"> + <return type="Matrix3"> + </return> + <description> + </description> + </method> <method name="get_space_state"> <return type="PhysicsDirectSpaceState"> </return> @@ -30917,6 +30961,13 @@ Clear the popup menu, in effect removing all items. </description> </method> + <method name="is_hide_on_item_selection"> + <return type="bool"> + </return> + <description> + Returns a boolean that indicates whether or not the PopupMenu will hide on item selection. + </description> + </method> <method name="get_item_ID" qualifiers="const"> <return type="int"> </return> @@ -31036,6 +31087,13 @@ Removes the item at index "idx" from the menu. Note that the indexes of items after the removed item are going to be shifted by one. </description> </method> + <method name="set_hide_on_item_selection"> + <argument index="0" name="enable" type="bool"> + </argument> + <description> + Sets whether or not the PopupMenu will hide on item selection. + </description> + </method> <method name="set_item_ID"> <argument index="0" name="idx" type="int"> </argument> @@ -31452,7 +31510,7 @@ Quaternion. </brief_description> <description> - Quaternion is a 4 dimensional vector that is used to represent a rotation. It mainly exists to perform SLERP (spherical-linear interpolation) between to rotations obtained by a Matrix3 cheaply. Adding quaternions also cheaply adds the rotations, however quaternions need to be often normalized, or else they suffer from precision issues. + Quaternion is a 4 dimensional vector that is used to represent a rotation. It mainly exists to perform SLERP (spherical-linear interpolation) between two rotations. Multiplying quaternions also cheaply reproduces rotation sequences. However quaternions need to be often renormalized, or else they suffer from precision issues. </description> <methods> <method name="Quat"> @@ -31477,6 +31535,7 @@ <argument index="1" name="angle" type="float"> </argument> <description> + Returns a quaternion that will rotate around the given axis by the specified angle. </description> </method> <method name="Quat"> @@ -31485,6 +31544,7 @@ <argument index="0" name="from" type="Matrix3"> </argument> <description> + Returns the rotation matrix corresponding to the given quaternion. </description> </method> <method name="cubic_slerp"> @@ -31507,14 +31567,14 @@ <argument index="0" name="b" type="Quat"> </argument> <description> - Returns the dot product between two quaternions. + Returns the dot product of two quaternions. </description> </method> <method name="inverse"> <return type="Quat"> </return> <description> - Returns the inverse of the quaternion (applies to the inverse rotation too). + Returns the inverse of the quaternion. </description> </method> <method name="length"> @@ -33504,7 +33564,7 @@ <return type="Array"> </return> <description> - Return a list of the bodies colliding with this one. + Return a list of the bodies colliding with this one. By default, number of max contacts reported is at 0 , see [method set_max_contacts_reported] to increase it. </description> </method> <method name="get_friction" qualifiers="const"> @@ -33865,7 +33925,7 @@ <return type="Array"> </return> <description> - Return a list of the bodies colliding with this one. + Return a list of the bodies colliding with this one. By default, number of max contacts reported is at 0 , see [method set_max_contacts_reported] to increase it. You must also enable contact monitor, see [method set_contact_monitor] </description> </method> <method name="get_continuous_collision_detection_mode" qualifiers="const"> @@ -39192,10 +39252,8 @@ </argument> <argument index="1" name="port" type="int"> </argument> - <argument index="2" name="ip_type" type="int" default="int.IP_TYPE_ANY"> - </argument> <description> - Connect to the specified host:port pair. A hostname will be resolved using "ip_type" (v4/v6/any) if valid. Returns [OK] on success or [FAILED] on failure. + Connect to the specified host:port pair. A hostname will be resolved if valid. Returns [OK] on success or [FAILED] on failure. </description> </method> <method name="disconnect"> @@ -40518,15 +40576,10 @@ </return> <argument index="0" name="port" type="int"> </argument> - <argument index="1" name="ip_type" type="int" default="int.IP_TYPE_ANY"> - </argument> - <argument index="2" name="accepted_hosts" type="StringArray" default="StringArray([])"> + <argument index="1" name="accepted_hosts" type="StringArray" default="StringArray([])"> </argument> <description> - Listen on a port using protocol "ip_type", alternatively give a white-list of accepted hosts. - IP_TYPE_IPV4 = IPv4 only - IP_TYPE_IPV6 = IPv6 only - IP_TYPE_ANY = Dual stack (supports both IPv6 and IPv4 connections). + Listen on a port using protocol, alternatively give a white-list of accepted hosts. </description> </method> <method name="stop"> @@ -43013,7 +43066,7 @@ 3D Transformation. </brief_description> <description> - Transform is used to store transformations, including translations. It consists of a Matrix3 "basis" and Vector3 "origin". Transform is used to represent transformations of any object in space. It is similar to a 4x3 matrix. + Transform is used to store translation, rotation and scaling transformations. It consists of a Matrix3 "basis" and Vector3 "origin". Transform is used to represent transformations of objects in space, and as such, determine their position, orientation and scale. It is similar to a 3x4 matrix. </description> <methods> <method name="Transform"> @@ -43028,7 +43081,7 @@ <argument index="3" name="origin" type="Vector3"> </argument> <description> - Construct the Transform from four Vector3. Each axis creates the basis. + Construct the Transform from four Vector3. Each axis corresponds to local basis vectors (some of which may be scaled). </description> </method> <method name="Transform"> @@ -43057,7 +43110,7 @@ <argument index="0" name="from" type="Quat"> </argument> <description> - Construct the Transform from a Quat. The origin will be Vector3(0, 0, 0) + Construct the Transform from a Quat. The origin will be Vector3(0, 0, 0). </description> </method> <method name="Transform"> @@ -43066,21 +43119,21 @@ <argument index="0" name="from" type="Matrix3"> </argument> <description> - Construct the Transform from a Matrix3. The origin will be Vector3(0, 0, 0) + Construct the Transform from a Matrix3. The origin will be Vector3(0, 0, 0). </description> </method> <method name="affine_inverse"> <return type="Transform"> </return> <description> - Returns the inverse of the transfrom, even if the transform has scale or the axis vectors are not orthogonal. + Returns the inverse of the transfrom, under the assumption that the transformation is composed of rotation, scaling and translation. </description> </method> <method name="inverse"> <return type="Transform"> </return> <description> - Returns the inverse of the transform. + Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling). </description> </method> <method name="looking_at"> @@ -43109,7 +43162,7 @@ <argument index="1" name="phi" type="float"> </argument> <description> - Rotate the transform locally. + Rotate the transform around given axis by phi. </description> </method> <method name="scaled"> @@ -43118,7 +43171,7 @@ <argument index="0" name="scale" type="Vector3"> </argument> <description> - Scale the transform locally. + Scale the transform by the specified 3D scaling factors. </description> </method> <method name="translated"> @@ -43127,7 +43180,7 @@ <argument index="0" name="ofs" type="Vector3"> </argument> <description> - Translate the transform locally. + Translate the transform by the specified displacement. </description> </method> <method name="xform"> @@ -43136,7 +43189,7 @@ <argument index="0" name="v" type="var"> </argument> <description> - Transforms vector "v" by this transform. + Transforms the given vector "v" by this transform. </description> </method> <method name="xform_inv"> @@ -43151,7 +43204,7 @@ </methods> <members> <member name="basis" type="Matrix3"> - The basis contains 3 [Vector3]. X axis, Y axis, and Z axis. + The basis is a matrix containing 3 [Vector3] as its columns: X axis, Y axis, and Z axis. These vectors can be interpreted as the basis vectors of local coordinate system travelling with the object. </member> <member name="origin" type="Vector3"> The origin of the transform. Which is the translation offset. @@ -44951,13 +45004,6 @@ do_property]. Remove the fractional part of x and y. </description> </method> - <method name="floorf"> - <return type="Vector2"> - </return> - <description> - Remove the fractional part of x and y. - </description> - </method> <method name="get_aspect"> <return type="float"> </return> @@ -45292,6 +45338,15 @@ do_property]. Return a copy of the normalized vector to unit length. This is the same as v / v.length(). </description> </method> + <method name="outer"> + <return type="Matrix3"> + </return> + <argument index="0" name="b" type="Vector3"> + </argument> + <description> + Return the outer product with b. + </description> + </method> <method name="reflect"> <return type="Vector3"> </return> @@ -45330,6 +45385,13 @@ do_property]. Return a copy of the vector, snapped to the lowest neared multiple. </description> </method> + <method name="to_diagonal_matrix"> + <return type="Matrix3"> + </return> + <description> + Return a diagonal matrix with the vector as main diagonal. + </description> + </method> </methods> <members> <member name="x" type="float"> diff --git a/doc/tools/makedocs.py b/doc/tools/makedocs.py index 731e04f6fc..4c4b5d6fb9 100644 --- a/doc/tools/makedocs.py +++ b/doc/tools/makedocs.py @@ -3,7 +3,7 @@ # # makedocs.py: Generate documentation for Open Project Wiki -# Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. +# Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. # Contributor: Jorge Araya Navarro <elcorreo@deshackra.com> # diff --git a/drivers/SCsub b/drivers/SCsub index 08a189272f..73a3f7898a 100644 --- a/drivers/SCsub +++ b/drivers/SCsub @@ -20,7 +20,7 @@ if (env["xaudio2"] == "yes"): SConscript("xaudio2/SCsub") # Graphics drivers -SConscript('gles2/SCsub') +SConscript('gles3/SCsub') SConscript('gl_context/SCsub') # Core dependencies diff --git a/drivers/alsa/audio_driver_alsa.cpp b/drivers/alsa/audio_driver_alsa.cpp index 6a3bd9bb22..b026241579 100644 --- a/drivers/alsa/audio_driver_alsa.cpp +++ b/drivers/alsa/audio_driver_alsa.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -45,7 +45,7 @@ Error AudioDriverALSA::init() { samples_in = NULL; samples_out = NULL; - mix_rate = 44100; + mix_rate = GLOBAL_DEF("audio/mix_rate",44100); output_format = OUTPUT_STEREO; channels = 2; @@ -70,67 +70,62 @@ Error AudioDriverALSA::init() { ERR_FAIL_COND_V( status<0, ERR_CANT_OPEN ); snd_pcm_hw_params_alloca(&hwparams); - status = snd_pcm_hw_params_any(pcm_handle, hwparams); + status = snd_pcm_hw_params_any(pcm_handle, hwparams); CHECK_FAIL( status<0 ); status = snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED); - CHECK_FAIL( status<0 ); //not interested in anything else status = snd_pcm_hw_params_set_format(pcm_handle, hwparams, SND_PCM_FORMAT_S16_LE); - CHECK_FAIL( status<0 ); //todo: support 4 and 6 status = snd_pcm_hw_params_set_channels(pcm_handle, hwparams, 2); - CHECK_FAIL( status<0 ); status = snd_pcm_hw_params_set_rate_near(pcm_handle, hwparams, &mix_rate, NULL); - - CHECK_FAIL( status<0 ); int latency = GLOBAL_DEF("audio/output_latency",25); buffer_size = nearest_power_of_2( latency * mix_rate / 1000 ); - status = snd_pcm_hw_params_set_period_size_near(pcm_handle, hwparams, &buffer_size, NULL); - + // set buffer size from project settings + status = snd_pcm_hw_params_set_buffer_size_near(pcm_handle, hwparams, &buffer_size); + CHECK_FAIL( status<0 ); + // make period size 1/8 + period_size = buffer_size >> 3; + status = snd_pcm_hw_params_set_period_size_near(pcm_handle, hwparams, &period_size, NULL); CHECK_FAIL( status<0 ); unsigned int periods=2; status = snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, &periods, NULL); - CHECK_FAIL( status<0 ); status = snd_pcm_hw_params(pcm_handle,hwparams); - CHECK_FAIL( status<0 ); //snd_pcm_hw_params_free(&hwparams); snd_pcm_sw_params_alloca(&swparams); + status = snd_pcm_sw_params_current(pcm_handle, swparams); CHECK_FAIL( status<0 ); - status = snd_pcm_sw_params_set_avail_min(pcm_handle, swparams, buffer_size); - + status = snd_pcm_sw_params_set_avail_min(pcm_handle, swparams, period_size); CHECK_FAIL( status<0 ); status = snd_pcm_sw_params_set_start_threshold(pcm_handle, swparams, 1); - CHECK_FAIL( status<0 ); status = snd_pcm_sw_params(pcm_handle, swparams); - CHECK_FAIL( status<0 ); - samples_in = memnew_arr(int32_t, buffer_size*channels); - samples_out = memnew_arr(int16_t, buffer_size*channels); + samples_in = memnew_arr(int32_t, period_size*channels); + samples_out = memnew_arr(int16_t, period_size*channels); snd_pcm_nonblock(pcm_handle, 0); @@ -144,36 +139,28 @@ void AudioDriverALSA::thread_func(void* p_udata) { AudioDriverALSA* ad = (AudioDriverALSA*)p_udata; - while (!ad->exit_thread) { - - if (!ad->active) { - - for (unsigned int i=0; i < ad->buffer_size*ad->channels; i++) { - + for (unsigned int i=0; i < ad->period_size*ad->channels; i++) { ad->samples_out[i] = 0; }; } else { - ad->lock(); - ad->audio_server_process(ad->buffer_size, ad->samples_in); + ad->audio_server_process(ad->period_size, ad->samples_in); ad->unlock(); - for(unsigned int i=0;i<ad->buffer_size*ad->channels;i++) { - + for(unsigned int i=0;i<ad->period_size*ad->channels;i++) { ad->samples_out[i]=ad->samples_in[i]>>16; } }; - int todo = ad->buffer_size; // * ad->channels * 2; + int todo = ad->period_size; int total = 0; while (todo) { - if (ad->exit_thread) break; uint8_t* src = (uint8_t*)ad->samples_out; @@ -184,7 +171,8 @@ void AudioDriverALSA::thread_func(void* p_udata) { break; if ( wrote == -EAGAIN ) { - usleep(1000); //can't write yet (though this is blocking..) + //can't write yet (though this is blocking..) + usleep(1000); continue; } wrote = snd_pcm_recover(ad->pcm_handle, wrote, 0); @@ -197,9 +185,9 @@ void AudioDriverALSA::thread_func(void* p_udata) { } continue; }; + total += wrote; todo -= wrote; - }; }; diff --git a/drivers/alsa/audio_driver_alsa.h b/drivers/alsa/audio_driver_alsa.h index 54fc8dccc9..df28294f56 100644 --- a/drivers/alsa/audio_driver_alsa.h +++ b/drivers/alsa/audio_driver_alsa.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -51,6 +51,7 @@ class AudioDriverALSA : public AudioDriverSW { OutputFormat output_format; snd_pcm_uframes_t buffer_size; + snd_pcm_uframes_t period_size; int channels; bool active; diff --git a/drivers/convex_decomp/b2d_decompose.cpp b/drivers/convex_decomp/b2d_decompose.cpp index 36fbfa1fee..82eade5b69 100644 --- a/drivers/convex_decomp/b2d_decompose.cpp +++ b/drivers/convex_decomp/b2d_decompose.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/convex_decomp/b2d_decompose.h b/drivers/convex_decomp/b2d_decompose.h index 2a66b033a7..3a35ca140d 100644 --- a/drivers/convex_decomp/b2d_decompose.h +++ b/drivers/convex_decomp/b2d_decompose.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/gl_context/SCsub b/drivers/gl_context/SCsub index a968c10cfd..4d66a9f9f1 100644 --- a/drivers/gl_context/SCsub +++ b/drivers/gl_context/SCsub @@ -4,18 +4,17 @@ Import('env') if (env["platform"] in ["haiku", "osx", "windows", "x11"]): # Thirdparty source files - if (env['builtin_glew'] != 'no'): # builtin - thirdparty_dir = "#thirdparty/glew/" - thirdparty_sources = [ - "glew.c", - ] - thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] + thirdparty_dir = "#thirdparty/glad/" + thirdparty_sources = [ + "glad.c", + ] + thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] - env.add_source_files(env.drivers_sources, thirdparty_sources) - env.Append(CPPFLAGS=['-DGLEW_STATIC']) - env.Append(CPPPATH=[thirdparty_dir]) + env.add_source_files(env.drivers_sources, thirdparty_sources) + env.Append(CPPPATH=[thirdparty_dir]) - env.Append(CPPFLAGS=['-DGLEW_ENABLED']) + env.Append(CPPFLAGS=['-DGLAD_ENABLED']) + env.Append(CPPFLAGS=['-DGLES_OVER_GL']) # Godot source files env.add_source_files(env.drivers_sources, "*.cpp") diff --git a/drivers/gl_context/context_gl.cpp b/drivers/gl_context/context_gl.cpp index 3e15783d5f..e99ec93e11 100644 --- a/drivers/gl_context/context_gl.cpp +++ b/drivers/gl_context/context_gl.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/gl_context/context_gl.h b/drivers/gl_context/context_gl.h index fd3bbee5de..535b492297 100644 --- a/drivers/gl_context/context_gl.h +++ b/drivers/gl_context/context_gl.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index a7edc8d935..2673c79232 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -376,7 +376,7 @@ Image RasterizerGLES2::_get_gl_image_and_format(const Image& p_image, Image::For switch(p_format) { - case Image::FORMAT_GRAYSCALE: { + case Image::FORMAT_L8: { r_gl_components=1; r_gl_format=GL_LUMINANCE; r_gl_internal_format=(srgb_supported && p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)?_EXT_SLUMINANCE_NV:GL_LUMINANCE; @@ -385,15 +385,15 @@ Image RasterizerGLES2::_get_gl_image_and_format(const Image& p_image, Image::For case Image::FORMAT_INTENSITY: { if (!image.empty()) - image.convert(Image::FORMAT_RGBA); + image.convert(Image::FORMAT_RGBA8); r_gl_components=4; r_gl_format=GL_RGBA; r_gl_internal_format=(srgb_supported && p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)?_GL_SRGB_ALPHA_EXT:GL_RGBA; r_has_alpha_cache=true; } break; - case Image::FORMAT_GRAYSCALE_ALPHA: { + case Image::FORMAT_LA8: { - //image.convert(Image::FORMAT_RGBA); + //image.convert(Image::FORMAT_RGBA8); r_gl_components=2; r_gl_format=GL_LUMINANCE_ALPHA; r_gl_internal_format=(srgb_supported && p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)?_EXT_SLUMINANCE_ALPHA_NV:GL_LUMINANCE_ALPHA; @@ -403,7 +403,7 @@ Image RasterizerGLES2::_get_gl_image_and_format(const Image& p_image, Image::For case Image::FORMAT_INDEXED: { if (!image.empty()) - image.convert(Image::FORMAT_RGB); + image.convert(Image::FORMAT_RGB8); r_gl_components=3; r_gl_format=GL_RGB; r_gl_internal_format=(srgb_supported && p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)?_GL_SRGB_EXT:GL_RGB; @@ -413,7 +413,7 @@ Image RasterizerGLES2::_get_gl_image_and_format(const Image& p_image, Image::For case Image::FORMAT_INDEXED_ALPHA: { if (!image.empty()) - image.convert(Image::FORMAT_RGBA); + image.convert(Image::FORMAT_RGBA8); r_gl_components=4; if (p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR) { @@ -432,7 +432,7 @@ Image RasterizerGLES2::_get_gl_image_and_format(const Image& p_image, Image::For r_has_alpha_cache=true; } break; - case Image::FORMAT_RGB: { + case Image::FORMAT_RGB8: { r_gl_components=3; @@ -450,7 +450,7 @@ Image RasterizerGLES2::_get_gl_image_and_format(const Image& p_image, Image::For r_gl_internal_format=GL_RGB; } } break; - case Image::FORMAT_RGBA: { + case Image::FORMAT_RGBA8: { r_gl_components=4; if (p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR) { @@ -470,7 +470,7 @@ Image RasterizerGLES2::_get_gl_image_and_format(const Image& p_image, Image::For r_has_alpha_cache=true; } break; - case Image::FORMAT_BC1: { + case Image::FORMAT_DXT1: { if (!s3tc_supported || (!s3tc_srgb_supported && p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) { @@ -501,7 +501,7 @@ Image RasterizerGLES2::_get_gl_image_and_format(const Image& p_image, Image::For }; } break; - case Image::FORMAT_BC2: { + case Image::FORMAT_DXT3: { if (!s3tc_supported || (!s3tc_srgb_supported && p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) { @@ -533,7 +533,7 @@ Image RasterizerGLES2::_get_gl_image_and_format(const Image& p_image, Image::For }; } break; - case Image::FORMAT_BC3: { + case Image::FORMAT_DXT5: { if (!s3tc_supported || (!s3tc_srgb_supported && p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) { @@ -564,7 +564,7 @@ Image RasterizerGLES2::_get_gl_image_and_format(const Image& p_image, Image::For }; } break; - case Image::FORMAT_BC4: { + case Image::FORMAT_ATI1: { if (!latc_supported) { @@ -595,7 +595,7 @@ Image RasterizerGLES2::_get_gl_image_and_format(const Image& p_image, Image::For }; } break; - case Image::FORMAT_BC5: { + case Image::FORMAT_ATI2: { if (!latc_supported ) { @@ -657,7 +657,7 @@ Image RasterizerGLES2::_get_gl_image_and_format(const Image& p_image, Image::For } } break; - case Image::FORMAT_PVRTC2_ALPHA: { + case Image::FORMAT_PVRTC2A: { if (!pvr_supported || (!pvr_srgb_supported && p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) { @@ -719,7 +719,7 @@ Image RasterizerGLES2::_get_gl_image_and_format(const Image& p_image, Image::For } } break; - case Image::FORMAT_PVRTC4_ALPHA: { + case Image::FORMAT_PVRTC4A: { if (!pvr_supported || (!pvr_srgb_supported && p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) { @@ -841,7 +841,7 @@ Image RasterizerGLES2::_get_gl_image_and_format(const Image& p_image, Image::For case Image::FORMAT_YUV_444: { if (!image.empty()) - image.convert(Image::FORMAT_RGB); + image.convert(Image::FORMAT_RGB8); r_gl_internal_format=GL_RGB; r_gl_components=3; @@ -998,7 +998,7 @@ void RasterizerGLES2::texture_set_data(RID p_texture,const Image& p_image,VS::Cu GLenum blit_target = (texture->target == GL_TEXTURE_CUBE_MAP)?_cube_side_enum[p_cube_side]:GL_TEXTURE_2D; texture->data_size=img.get_data().size(); - DVector<uint8_t>::Read read = img.get_data().read(); + PoolVector<uint8_t>::Read read = img.get_data().read(); glActiveTexture(GL_TEXTURE0); glBindTexture(texture->target, texture->tex_id); @@ -1133,7 +1133,7 @@ Image RasterizerGLES2::texture_get_data(RID p_texture,VS::CubeMapSide p_cube_sid ERR_FAIL_COND_V(!texture->active,Image()); ERR_FAIL_COND_V(texture->data_size==0,Image()); - DVector<uint8_t> data; + PoolVector<uint8_t> data; GLenum format,type=GL_UNSIGNED_BYTE; Image::Format fmt; int pixelsize=0; @@ -1145,7 +1145,7 @@ Image RasterizerGLES2::texture_get_data(RID p_texture,VS::CubeMapSide p_cube_sid switch(texture->format) { - case Image::FORMAT_GRAYSCALE: { + case Image::FORMAT_L8: { format=GL_LUMINANCE; type=GL_UNSIGNED_BYTE; @@ -1156,19 +1156,19 @@ Image RasterizerGLES2::texture_get_data(RID p_texture,VS::CubeMapSide p_cube_sid case Image::FORMAT_INTENSITY: { return Image(); } break; - case Image::FORMAT_GRAYSCALE_ALPHA: { + case Image::FORMAT_LA8: { format=GL_LUMINANCE_ALPHA; type=GL_UNSIGNED_BYTE; pixelsize=2; } break; - case Image::FORMAT_RGB: { + case Image::FORMAT_RGB8: { format=GL_RGB; type=GL_UNSIGNED_BYTE; pixelsize=3; } break; - case Image::FORMAT_RGBA: { + case Image::FORMAT_RGBA8: { format=GL_RGBA; type=GL_UNSIGNED_BYTE; @@ -1178,18 +1178,18 @@ Image RasterizerGLES2::texture_get_data(RID p_texture,VS::CubeMapSide p_cube_sid format=GL_RGB; type=GL_UNSIGNED_BYTE; - fmt=Image::FORMAT_RGB; + fmt=Image::FORMAT_RGB8; pixelsize=3; } break; case Image::FORMAT_INDEXED_ALPHA: { format=GL_RGBA; type=GL_UNSIGNED_BYTE; - fmt=Image::FORMAT_RGBA; + fmt=Image::FORMAT_RGBA8; pixelsize=4; } break; - case Image::FORMAT_BC1: { + case Image::FORMAT_DXT1: { pixelsize=1; //doesn't matter much format=GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; @@ -1198,14 +1198,14 @@ Image RasterizerGLES2::texture_get_data(RID p_texture,VS::CubeMapSide p_cube_sid minw=minh=4; } break; - case Image::FORMAT_BC2: { + case Image::FORMAT_DXT3: { pixelsize=1; //doesn't matter much format=GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; compressed=true; minw=minh=4; } break; - case Image::FORMAT_BC3: { + case Image::FORMAT_DXT5: { pixelsize=1; //doesn't matter much format=GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; @@ -1213,7 +1213,7 @@ Image RasterizerGLES2::texture_get_data(RID p_texture,VS::CubeMapSide p_cube_sid minw=minh=4; } break; - case Image::FORMAT_BC4: { + case Image::FORMAT_ATI1: { format=GL_COMPRESSED_RED_RGTC1; pixelsize=1; //doesn't matter much @@ -1222,7 +1222,7 @@ Image RasterizerGLES2::texture_get_data(RID p_texture,VS::CubeMapSide p_cube_sid minw=minh=4; } break; - case Image::FORMAT_BC5: { + case Image::FORMAT_ATI2: { format=GL_COMPRESSED_RG_RGTC2; pixelsize=1; //doesn't matter much @@ -1235,7 +1235,7 @@ Image RasterizerGLES2::texture_get_data(RID p_texture,VS::CubeMapSide p_cube_sid } data.resize(texture->data_size); - DVector<uint8_t>::Write wb = data.write(); + PoolVector<uint8_t>::Write wb = data.write(); glActiveTexture(GL_TEXTURE0); int ofs=0; @@ -1264,7 +1264,7 @@ Image RasterizerGLES2::texture_get_data(RID p_texture,VS::CubeMapSide p_cube_sid } - wb=DVector<uint8_t>::Write(); + wb=PoolVector<uint8_t>::Write(); Image img(texture->alloc_width,texture->alloc_height,texture->mipmaps,fmt,data); @@ -1359,7 +1359,7 @@ Image::Format RasterizerGLES2::texture_get_format(RID p_texture) const { Texture * texture = texture_owner.get(p_texture); - ERR_FAIL_COND_V(!texture,Image::FORMAT_GRAYSCALE); + ERR_FAIL_COND_V(!texture,Image::FORMAT_L8); return texture->format; } @@ -2103,10 +2103,10 @@ void RasterizerGLES2::mesh_add_surface(RID p_mesh,VS::PrimitiveType p_primitive, uint8_t *array_ptr=NULL; uint8_t *index_array_ptr=NULL; - DVector<uint8_t> array_pre_vbo; - DVector<uint8_t>::Write vaw; - DVector<uint8_t> index_array_pre_vbo; - DVector<uint8_t>::Write iaw; + PoolVector<uint8_t> array_pre_vbo; + PoolVector<uint8_t>::Write vaw; + PoolVector<uint8_t> index_array_pre_vbo; + PoolVector<uint8_t>::Write iaw; /* create pointers */ if (use_VBO) { @@ -2191,11 +2191,11 @@ Error RasterizerGLES2::_surface_set_arrays(Surface *p_surface, uint8_t *p_mem,ui ERR_FAIL_COND_V( p_arrays[ai].get_type() != Variant::VECTOR3_ARRAY, ERR_INVALID_PARAMETER ); - DVector<Vector3> array = p_arrays[ai]; + PoolVector<Vector3> array = p_arrays[ai]; ERR_FAIL_COND_V( array.size() != p_surface->array_len, ERR_INVALID_PARAMETER ); - DVector<Vector3>::Read read = array.read(); + PoolVector<Vector3>::Read read = array.read(); const Vector3* src=read.ptr(); // setting vertices means regenerating the AABB @@ -2252,11 +2252,11 @@ Error RasterizerGLES2::_surface_set_arrays(Surface *p_surface, uint8_t *p_mem,ui ERR_FAIL_COND_V( p_arrays[ai].get_type() != Variant::VECTOR3_ARRAY, ERR_INVALID_PARAMETER ); - DVector<Vector3> array = p_arrays[ai]; + PoolVector<Vector3> array = p_arrays[ai]; ERR_FAIL_COND_V( array.size() != p_surface->array_len, ERR_INVALID_PARAMETER ); - DVector<Vector3>::Read read = array.read(); + PoolVector<Vector3>::Read read = array.read(); const Vector3* src=read.ptr(); // setting vertices means regenerating the AABB @@ -2292,12 +2292,12 @@ Error RasterizerGLES2::_surface_set_arrays(Surface *p_surface, uint8_t *p_mem,ui ERR_FAIL_COND_V( p_arrays[ai].get_type() != Variant::REAL_ARRAY, ERR_INVALID_PARAMETER ); - DVector<real_t> array = p_arrays[ai]; + PoolVector<real_t> array = p_arrays[ai]; ERR_FAIL_COND_V( array.size() != p_surface->array_len*4, ERR_INVALID_PARAMETER ); - DVector<real_t>::Read read = array.read(); + PoolVector<real_t>::Read read = array.read(); const real_t* src = read.ptr(); if (p_surface->array[VS::ARRAY_TANGENT].datatype==GL_BYTE) { @@ -2337,12 +2337,12 @@ Error RasterizerGLES2::_surface_set_arrays(Surface *p_surface, uint8_t *p_mem,ui ERR_FAIL_COND_V( p_arrays[ai].get_type() != Variant::COLOR_ARRAY, ERR_INVALID_PARAMETER ); - DVector<Color> array = p_arrays[ai]; + PoolVector<Color> array = p_arrays[ai]; ERR_FAIL_COND_V( array.size() != p_surface->array_len, ERR_INVALID_PARAMETER ); - DVector<Color>::Read read = array.read(); + PoolVector<Color>::Read read = array.read(); const Color* src = read.ptr(); bool alpha=false; @@ -2371,11 +2371,11 @@ Error RasterizerGLES2::_surface_set_arrays(Surface *p_surface, uint8_t *p_mem,ui ERR_FAIL_COND_V( p_arrays[ai].get_type() != Variant::VECTOR3_ARRAY && p_arrays[ai].get_type() != Variant::VECTOR2_ARRAY, ERR_INVALID_PARAMETER ); - DVector<Vector2> array = p_arrays[ai]; + PoolVector<Vector2> array = p_arrays[ai]; ERR_FAIL_COND_V( array.size() != p_surface->array_len , ERR_INVALID_PARAMETER); - DVector<Vector2>::Read read = array.read(); + PoolVector<Vector2>::Read read = array.read(); const Vector2 * src=read.ptr(); float scale=1.0; @@ -2417,12 +2417,12 @@ Error RasterizerGLES2::_surface_set_arrays(Surface *p_surface, uint8_t *p_mem,ui ERR_FAIL_COND_V( p_arrays[ai].get_type() != Variant::REAL_ARRAY, ERR_INVALID_PARAMETER ); - DVector<real_t> array = p_arrays[ai]; + PoolVector<real_t> array = p_arrays[ai]; ERR_FAIL_COND_V( array.size() != p_surface->array_len*VS::ARRAY_WEIGHTS_SIZE, ERR_INVALID_PARAMETER ); - DVector<real_t>::Read read = array.read(); + PoolVector<real_t>::Read read = array.read(); const real_t * src = read.ptr(); @@ -2460,12 +2460,12 @@ Error RasterizerGLES2::_surface_set_arrays(Surface *p_surface, uint8_t *p_mem,ui ERR_FAIL_COND_V( p_arrays[ai].get_type() != Variant::REAL_ARRAY, ERR_INVALID_PARAMETER ); - DVector<int> array = p_arrays[ai]; + PoolVector<int> array = p_arrays[ai]; ERR_FAIL_COND_V( array.size() != p_surface->array_len*VS::ARRAY_WEIGHTS_SIZE, ERR_INVALID_PARAMETER ); - DVector<int>::Read read = array.read(); + PoolVector<int>::Read read = array.read(); const int * src = read.ptr(); @@ -2511,13 +2511,13 @@ Error RasterizerGLES2::_surface_set_arrays(Surface *p_surface, uint8_t *p_mem,ui ERR_FAIL_COND_V( p_surface->index_array_len<=0, ERR_INVALID_DATA ); ERR_FAIL_COND_V( p_arrays[ai].get_type() != Variant::INT_ARRAY, ERR_INVALID_PARAMETER ); - DVector<int> indices = p_arrays[ai]; + PoolVector<int> indices = p_arrays[ai]; ERR_FAIL_COND_V( indices.size() == 0, ERR_INVALID_PARAMETER ); ERR_FAIL_COND_V( indices.size() != p_surface->index_array_len, ERR_INVALID_PARAMETER ); /* determine wether using 16 or 32 bits indices */ - DVector<int>::Read read = indices.read(); + PoolVector<int>::Read read = indices.read(); const int *src=read.ptr(); for (int i=0;i<p_surface->index_array_len;i++) { @@ -2553,18 +2553,18 @@ Error RasterizerGLES2::_surface_set_arrays(Surface *p_surface, uint8_t *p_mem,ui for(int i=0;i<total_bones;i++) p_surface->skeleton_bone_used[i]=false; } - DVector<Vector3> vertices = p_arrays[VS::ARRAY_VERTEX]; - DVector<int> bones = p_arrays[VS::ARRAY_BONES]; - DVector<float> weights = p_arrays[VS::ARRAY_WEIGHTS]; + PoolVector<Vector3> vertices = p_arrays[VS::ARRAY_VERTEX]; + PoolVector<int> bones = p_arrays[VS::ARRAY_BONES]; + PoolVector<float> weights = p_arrays[VS::ARRAY_WEIGHTS]; bool any_valid=false; if (vertices.size() && bones.size()==vertices.size()*4 && weights.size()==bones.size()) { //print_line("MAKING SKELETHONG"); int vs = vertices.size(); - DVector<Vector3>::Read rv =vertices.read(); - DVector<int>::Read rb=bones.read(); - DVector<float>::Read rw=weights.read(); + PoolVector<Vector3>::Read rv =vertices.read(); + PoolVector<int>::Read rb=bones.read(); + PoolVector<float>::Read rw=weights.read(); Vector<bool> first; first.resize(total_bones); @@ -3310,7 +3310,7 @@ Vector3 RasterizerGLES2::particles_get_emission_base_velocity(RID p_particles) c } -void RasterizerGLES2::particles_set_emission_points(RID p_particles, const DVector<Vector3>& p_points) { +void RasterizerGLES2::particles_set_emission_points(RID p_particles, const PoolVector<Vector3>& p_points) { Particles* particles = particles_owner.get( p_particles ); ERR_FAIL_COND(!particles); @@ -3318,10 +3318,10 @@ void RasterizerGLES2::particles_set_emission_points(RID p_particles, const DVect particles->data.emission_points=p_points; } -DVector<Vector3> RasterizerGLES2::particles_get_emission_points(RID p_particles) const { +PoolVector<Vector3> RasterizerGLES2::particles_get_emission_points(RID p_particles) const { Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND_V(!particles,DVector<Vector3>()); + ERR_FAIL_COND_V(!particles,PoolVector<Vector3>()); return particles->data.emission_points; @@ -4205,7 +4205,7 @@ void RasterizerGLES2::begin_frame() { //fragment_lighting=Globals::get_singleton()->get("rasterizer/use_fragment_lighting"); #ifdef TOOLS_ENABLED canvas_shader.set_conditional(CanvasShaderGLES2::USE_PIXEL_SNAP,GLOBAL_DEF("display/use_2d_pixel_snap",false)); - shadow_filter=ShadowFilterTechnique(int(Globals::get_singleton()->get("rasterizer/shadow_filter"))); + shadow_filter=ShadowFilterTechnique(int(GlobalConfig::get_singleton()->get("rasterizer/shadow_filter"))); #endif canvas_shader.set_conditional(CanvasShaderGLES2::SHADOW_PCF5,shadow_filter==SHADOW_FILTER_PCF5); @@ -4304,9 +4304,9 @@ void RasterizerGLES2::begin_frame() { void RasterizerGLES2::capture_viewport(Image* r_capture) { #if 0 - DVector<uint8_t> pixels; + PoolVector<uint8_t> pixels; pixels.resize(viewport.width*viewport.height*3); - DVector<uint8_t>::Write w = pixels.write(); + PoolVector<uint8_t>::Write w = pixels.write(); #ifdef GLEW_ENABLED glReadBuffer(GL_COLOR_ATTACHMENT0); #endif @@ -4318,15 +4318,15 @@ void RasterizerGLES2::capture_viewport(Image* r_capture) { glPixelStorei(GL_PACK_ALIGNMENT, 4); - w=DVector<uint8_t>::Write(); + w=PoolVector<uint8_t>::Write(); - r_capture->create(viewport.width,viewport.height,0,Image::FORMAT_RGB,pixels); + r_capture->create(viewport.width,viewport.height,0,Image::FORMAT_RGB8,pixels); #else - DVector<uint8_t> pixels; + PoolVector<uint8_t> pixels; pixels.resize(viewport.width*viewport.height*4); - DVector<uint8_t>::Write w = pixels.write(); + PoolVector<uint8_t>::Write w = pixels.write(); glPixelStorei(GL_PACK_ALIGNMENT, 4); // uint64_t time = OS::get_singleton()->get_ticks_usec(); @@ -4359,8 +4359,8 @@ void RasterizerGLES2::capture_viewport(Image* r_capture) { } } - w=DVector<uint8_t>::Write(); - r_capture->create(viewport.width,viewport.height,0,Image::FORMAT_RGBA,pixels); + w=PoolVector<uint8_t>::Write(); + r_capture->create(viewport.width,viewport.height,0,Image::FORMAT_RGBA8,pixels); //r_capture->flip_y(); @@ -7307,7 +7307,7 @@ void RasterizerGLES2::end_scene() { if (current_env->bg_mode==VS::ENV_BG_COLOR) bgcolor = current_env->bg_param[VS::ENV_BG_PARAM_COLOR]; else - bgcolor = Globals::get_singleton()->get("render/default_clear_color"); + bgcolor = GlobalConfig::get_singleton()->get("render/default_clear_color"); bgcolor = _convert_color(bgcolor); float a = use_fb ? float(current_env->bg_param[VS::ENV_BG_PARAM_GLOW]) : 1.0; glClearColor(bgcolor.r,bgcolor.g,bgcolor.b,a); @@ -8685,7 +8685,7 @@ RID RasterizerGLES2::canvas_light_occluder_create() { return canvas_occluder_owner.make_rid(co); } -void RasterizerGLES2::canvas_light_occluder_set_polylines(RID p_occluder, const DVector<Vector2>& p_lines) { +void RasterizerGLES2::canvas_light_occluder_set_polylines(RID p_occluder, const PoolVector<Vector2>& p_lines) { CanvasOccluder *co = canvas_occluder_owner.get(p_occluder); ERR_FAIL_COND(!co); @@ -8709,18 +8709,18 @@ void RasterizerGLES2::canvas_light_occluder_set_polylines(RID p_occluder, const - DVector<float> geometry; - DVector<uint16_t> indices; + PoolVector<float> geometry; + PoolVector<uint16_t> indices; int lc = p_lines.size(); geometry.resize(lc*6); indices.resize(lc*3); - DVector<float>::Write vw=geometry.write(); - DVector<uint16_t>::Write iw=indices.write(); + PoolVector<float>::Write vw=geometry.write(); + PoolVector<uint16_t>::Write iw=indices.write(); - DVector<Vector2>::Read lr=p_lines.read(); + PoolVector<Vector2>::Read lr=p_lines.read(); const int POLY_HEIGHT = 16384; @@ -11452,7 +11452,7 @@ RasterizerGLES2::RasterizerGLES2(bool p_compress_arrays,bool p_keep_ram_copy,boo fragment_lighting=GLOBAL_DEF("rasterizer/use_fragment_lighting",true); read_depth_supported=true; //todo check for extension shadow_filter=ShadowFilterTechnique((int)(GLOBAL_DEF("rasterizer/shadow_filter",SHADOW_FILTER_PCF5))); - Globals::get_singleton()->set_custom_property_info("rasterizer/shadow_filter",PropertyInfo(Variant::INT,"rasterizer/shadow_filter",PROPERTY_HINT_ENUM,"None,PCF5,PCF13,ESM")); + GlobalConfig::get_singleton()->set_custom_property_info("rasterizer/shadow_filter",PropertyInfo(Variant::INT,"rasterizer/shadow_filter",PROPERTY_HINT_ENUM,"None,PCF5,PCF13,ESM")); use_fp16_fb=bool(GLOBAL_DEF("rasterizer/fp16_framebuffer",true)); use_shadow_mapping=true; use_fast_texture_filter=!bool(GLOBAL_DEF("rasterizer/trilinear_mipmap_filter",true)); diff --git a/drivers/gles2/rasterizer_gles2.h b/drivers/gles2/rasterizer_gles2.h index b18f89d8e7..c6057bfd88 100644 --- a/drivers/gles2/rasterizer_gles2.h +++ b/drivers/gles2/rasterizer_gles2.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -154,7 +154,7 @@ class RasterizerGLES2 : public Rasterizer { flags=width=height=0; tex_id=0; data_size=0; - format=Image::FORMAT_GRAYSCALE; + format=Image::FORMAT_L8; gl_components_cache=0; format_has_alpha=false; has_alpha=false; diff --git a/drivers/gles2/rasterizer_instance_gles2.cpp b/drivers/gles2/rasterizer_instance_gles2.cpp index 9d43ecb085..647f526147 100644 --- a/drivers/gles2/rasterizer_instance_gles2.cpp +++ b/drivers/gles2/rasterizer_instance_gles2.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/gles2/rasterizer_instance_gles2.h b/drivers/gles2/rasterizer_instance_gles2.h index c41bd71c15..51754e0f8a 100644 --- a/drivers/gles2/rasterizer_instance_gles2.h +++ b/drivers/gles2/rasterizer_instance_gles2.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp index d4636ed444..adb9fe0e83 100644 --- a/drivers/gles2/shader_compiler_gles2.cpp +++ b/drivers/gles2/shader_compiler_gles2.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -299,8 +299,8 @@ String ShaderCompilerGLES2::dump_node_code(SL::Node *p_node,int p_level,bool p_a case SL::TYPE_VEC2: { Vector2 v = cnode->value; code="vec2("+_mknum(v.x)+", "+_mknum(v.y)+")"; } break; case SL::TYPE_VEC3: { Vector3 v = cnode->value; code="vec3("+_mknum(v.x)+", "+_mknum(v.y)+", "+_mknum(v.z)+")"; } break; case SL::TYPE_VEC4: { Plane v = cnode->value; code="vec4("+_mknum(v.normal.x)+", "+_mknum(v.normal.y)+", "+_mknum(v.normal.z)+", "+_mknum(v.d)+")"; } break; - case SL::TYPE_MAT2: { Matrix32 x = cnode->value; code="mat2( vec2("+_mknum(x[0][0])+", "+_mknum(x[0][1])+"), vec2("+_mknum(x[1][0])+", "+_mknum(x[1][1])+"))"; } break; - case SL::TYPE_MAT3: { Matrix3 x = cnode->value; code="mat3( vec3("+_mknum(x.get_axis(0).x)+", "+_mknum(x.get_axis(0).y)+", "+_mknum(x.get_axis(0).z)+"), vec3("+_mknum(x.get_axis(1).x)+", "+_mknum(x.get_axis(1).y)+", "+_mknum(x.get_axis(1).z)+"), vec3("+_mknum(x.get_axis(2).x)+", "+_mknum(x.get_axis(2).y)+", "+_mknum(x.get_axis(2).z)+"))"; } break; + case SL::TYPE_MAT2: { Transform2D x = cnode->value; code="mat2( vec2("+_mknum(x[0][0])+", "+_mknum(x[0][1])+"), vec2("+_mknum(x[1][0])+", "+_mknum(x[1][1])+"))"; } break; + case SL::TYPE_MAT3: { Basis x = cnode->value; code="mat3( vec3("+_mknum(x.get_axis(0).x)+", "+_mknum(x.get_axis(0).y)+", "+_mknum(x.get_axis(0).z)+"), vec3("+_mknum(x.get_axis(1).x)+", "+_mknum(x.get_axis(1).y)+", "+_mknum(x.get_axis(1).z)+"), vec3("+_mknum(x.get_axis(2).x)+", "+_mknum(x.get_axis(2).y)+", "+_mknum(x.get_axis(2).z)+"))"; } break; case SL::TYPE_MAT4: { Transform x = cnode->value; code="mat4( vec4("+_mknum(x.basis.get_axis(0).x)+", "+_mknum(x.basis.get_axis(0).y)+", "+_mknum(x.basis.get_axis(0).z)+",0.0), vec4("+_mknum(x.basis.get_axis(1).x)+", "+_mknum(x.basis.get_axis(1).y)+", "+_mknum(x.basis.get_axis(1).z)+",0.0), vec4("+_mknum(x.basis.get_axis(2).x)+", "+_mknum(x.basis.get_axis(2).y)+", "+_mknum(x.basis.get_axis(2).z)+",0.0), vec4("+_mknum(x.origin.x)+", "+_mknum(x.origin.y)+", "+_mknum(x.origin.z)+",1.0))"; } break; default: code="<error: "+Variant::get_type_name(cnode->value.get_type())+" ("+itos(cnode->datatype)+">"; } diff --git a/drivers/gles2/shader_compiler_gles2.h b/drivers/gles2/shader_compiler_gles2.h index 688003ecf6..3c39e101ca 100644 --- a/drivers/gles2/shader_compiler_gles2.h +++ b/drivers/gles2/shader_compiler_gles2.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/gles2/shader_gles2.cpp b/drivers/gles2/shader_gles2.cpp index d397323171..2ee89e9895 100644 --- a/drivers/gles2/shader_gles2.cpp +++ b/drivers/gles2/shader_gles2.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/gles2/shader_gles2.h b/drivers/gles2/shader_gles2.h index 68ae8af63f..ea9958741a 100644 --- a/drivers/gles2/shader_gles2.h +++ b/drivers/gles2/shader_gles2.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/gles2/shaders/canvas.glsl b/drivers/gles2/shaders/canvas.glsl index 5f4767940d..eeab42ee64 100644 --- a/drivers/gles2/shaders/canvas.glsl +++ b/drivers/gles2/shaders/canvas.glsl @@ -105,8 +105,8 @@ precision mediump float; precision mediump int; #endif - // texunit:0 -uniform sampler2D texture; + +uniform sampler2D texture; // texunit:0 varying vec2 uv_interp; varying vec4 color_interp; @@ -319,7 +319,7 @@ LIGHT_SHADER_CODE #ifdef USE_DEPTH_SHADOWS -#define SHADOW_DEPTH(m_tex,m_uv) (texture2D((m_tex),(m_uv)).z) +#define SHADOW_DEPTH(m_tex,m_uv) (texture2D((m_tex),(m_uv)).r) #else @@ -395,5 +395,6 @@ LIGHT_SHADER_CODE // color.rgb*=color.a; gl_FragColor = color; + } diff --git a/drivers/gles2/shaders/copy.glsl b/drivers/gles2/shaders/copy.glsl index ae7185a1d6..cb42970921 100644 --- a/drivers/gles2/shaders/copy.glsl +++ b/drivers/gles2/shaders/copy.glsl @@ -71,6 +71,11 @@ uniform sampler2D source; #endif varying vec2 uv2_interp; + +#ifdef USE_DEPTH +uniform highp sampler2D source_depth; //texunit:1 +#endif + #ifdef USE_GLOW uniform sampler2D glow_source; @@ -547,5 +552,10 @@ void main() { gl_FragColor = color; + +#ifdef USE_DEPTH + gl_FragDepth = texture(source_depth,uv_interp).r; +#endif + } diff --git a/drivers/gles3/SCsub b/drivers/gles3/SCsub new file mode 100644 index 0000000000..a17335b41b --- /dev/null +++ b/drivers/gles3/SCsub @@ -0,0 +1,5 @@ +Import('env') + +env.add_source_files(env.drivers_sources,"*.cpp") + +SConscript("shaders/SCsub") diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp new file mode 100644 index 0000000000..3c3768be67 --- /dev/null +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -0,0 +1,1531 @@ +#include "rasterizer_canvas_gles3.h" +#include "os/os.h" + +static _FORCE_INLINE_ void store_transform2d(const Transform2D& p_mtx, float* p_array) { + + p_array[ 0]=p_mtx.elements[0][0]; + p_array[ 1]=p_mtx.elements[0][1]; + p_array[ 2]=0; + p_array[ 3]=0; + p_array[ 4]=p_mtx.elements[1][0]; + p_array[ 5]=p_mtx.elements[1][1]; + p_array[ 6]=0; + p_array[ 7]=0; + p_array[ 8]=0; + p_array[ 9]=0; + p_array[10]=1; + p_array[11]=0; + p_array[12]=p_mtx.elements[2][0]; + p_array[13]=p_mtx.elements[2][1]; + p_array[14]=0; + p_array[15]=1; +} + + +static _FORCE_INLINE_ void store_transform(const Transform& p_mtx, float* p_array) { + p_array[ 0]=p_mtx.basis.elements[0][0]; + p_array[ 1]=p_mtx.basis.elements[1][0]; + p_array[ 2]=p_mtx.basis.elements[2][0]; + p_array[ 3]=0; + p_array[ 4]=p_mtx.basis.elements[0][1]; + p_array[ 5]=p_mtx.basis.elements[1][1]; + p_array[ 6]=p_mtx.basis.elements[2][1]; + p_array[ 7]=0; + p_array[ 8]=p_mtx.basis.elements[0][2]; + p_array[ 9]=p_mtx.basis.elements[1][2]; + p_array[10]=p_mtx.basis.elements[2][2]; + p_array[11]=0; + p_array[12]=p_mtx.origin.x; + p_array[13]=p_mtx.origin.y; + p_array[14]=p_mtx.origin.z; + p_array[15]=1; +} + +static _FORCE_INLINE_ void store_camera(const CameraMatrix& p_mtx, float* p_array) { + + for (int i=0;i<4;i++) { + for (int j=0;j<4;j++) { + + p_array[i*4+j]=p_mtx.matrix[i][j]; + } + } +} + + +RID RasterizerCanvasGLES3::light_internal_create() { + + LightInternal * li = memnew( LightInternal ); + + glGenBuffers(1, &li->ubo); + glBindBuffer(GL_UNIFORM_BUFFER, li->ubo); + glBufferData(GL_UNIFORM_BUFFER, sizeof(LightInternal::UBOData), &state.canvas_item_ubo_data, GL_DYNAMIC_DRAW); + glBindBuffer(GL_UNIFORM_BUFFER, 0); + + return light_internal_owner.make_rid(li); +} + +void RasterizerCanvasGLES3::light_internal_update(RID p_rid, Light* p_light) { + + LightInternal * li = light_internal_owner.getornull(p_rid); + ERR_FAIL_COND(!li); + + store_transform2d(p_light->light_shader_xform,li->ubo_data.light_matrix); + store_transform2d(p_light->xform_cache.affine_inverse(),li->ubo_data.local_matrix); + store_camera(p_light->shadow_matrix_cache,li->ubo_data.shadow_matrix); + + for(int i=0;i<4;i++) { + + li->ubo_data.color[i]=p_light->color[i]*p_light->energy; + li->ubo_data.shadow_color[i]=p_light->shadow_color[i]; + } + + li->ubo_data.light_pos[0]=p_light->light_shader_pos.x; + li->ubo_data.light_pos[1]=p_light->light_shader_pos.y; + li->ubo_data.shadowpixel_size=1.0/p_light->shadow_buffer_size; + li->ubo_data.light_outside_alpha=p_light->mode==VS::CANVAS_LIGHT_MODE_MASK?1.0:0.0; + li->ubo_data.light_height=p_light->height; + if (p_light->radius_cache==0) + li->ubo_data.shadow_gradient=0; + else + li->ubo_data.shadow_gradient=p_light->shadow_gradient_length/(p_light->radius_cache*1.1);; + + li->ubo_data.shadow_distance_mult=(p_light->radius_cache*1.1); + + + glBindBuffer(GL_UNIFORM_BUFFER, li->ubo); + glBufferSubData(GL_UNIFORM_BUFFER, 0,sizeof(LightInternal::UBOData), &li->ubo_data); + glBindBuffer(GL_UNIFORM_BUFFER, 0); + +} + +void RasterizerCanvasGLES3::light_internal_free(RID p_rid) { + + LightInternal * li = light_internal_owner.getornull(p_rid); + ERR_FAIL_COND(!li); + + glDeleteBuffers(1,&li->ubo); + light_internal_owner.free(p_rid); + memdelete(li); + +} + +void RasterizerCanvasGLES3::canvas_begin(){ + + if (storage->frame.current_rt && storage->frame.clear_request) { + // a clear request may be pending, so do it + + glClearColor( storage->frame.clear_request_color.r, storage->frame.clear_request_color.g, storage->frame.clear_request_color.b, storage->frame.clear_request_color.a ); + glClear(GL_COLOR_BUFFER_BIT); + storage->frame.clear_request=false; + + } + + /*canvas_shader.unbind(); + canvas_shader.set_custom_shader(0); + canvas_shader.set_conditional(CanvasShaderGLES2::USE_MODULATE,false); + canvas_shader.bind(); + canvas_shader.set_uniform(CanvasShaderGLES2::TEXTURE, 0); + canvas_use_modulate=false;*/ + + reset_canvas(); + + state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_TEXTURE_RECT,true); + state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_LIGHTING,false); + state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_SHADOWS,false); + state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_NEAREST,false); + state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_PCF5,false); + state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_PCF13,false); + state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_DISTANCE_FIELD,false); + + + state.canvas_shader.set_custom_shader(0); + state.canvas_shader.bind(); + state.canvas_shader.set_uniform(CanvasShaderGLES3::FINAL_MODULATE,Color(1,1,1,1)); + state.canvas_shader.set_uniform(CanvasShaderGLES3::MODELVIEW_MATRIX,Transform2D()); + state.canvas_shader.set_uniform(CanvasShaderGLES3::EXTRA_MATRIX,Transform2D()); + + + + +// state.canvas_shader.set_uniform(CanvasShaderGLES3::PROJECTION_MATRIX,state.vp); + //state.canvas_shader.set_uniform(CanvasShaderGLES3::MODELVIEW_MATRIX,Transform()); + //state.canvas_shader.set_uniform(CanvasShaderGLES3::EXTRA_MATRIX,Transform()); + + glBindBufferBase(GL_UNIFORM_BUFFER,0,state.canvas_item_ubo); + glBindVertexArray(data.canvas_quad_array); + state.using_texture_rect=true; + + +} + + +void RasterizerCanvasGLES3::canvas_end(){ + + + glBindVertexArray(0); + glBindBufferBase(GL_UNIFORM_BUFFER,0,0); + + state.using_texture_rect=false; + +} + + + +RasterizerStorageGLES3::Texture* RasterizerCanvasGLES3::_bind_canvas_texture(const RID& p_texture) { + + if (p_texture==state.current_tex) { + return state.current_tex_ptr; + } + + if (p_texture.is_valid()) { + + + RasterizerStorageGLES3::Texture*texture=storage->texture_owner.getornull(p_texture); + + if (!texture) { + state.current_tex=RID(); + state.current_tex_ptr=NULL; + glBindTexture(GL_TEXTURE_2D,storage->resources.white_tex); + return NULL; + } + + if (texture->render_target) + texture->render_target->used_in_frame=true; + + glBindTexture(GL_TEXTURE_2D,texture->tex_id); + state.current_tex=p_texture; + state.current_tex_ptr=texture; + + return texture; + + + } else { + + + glBindTexture(GL_TEXTURE_2D,storage->resources.white_tex); + state.current_tex=RID(); + state.current_tex_ptr=NULL; + } + + + return NULL; +} + +void RasterizerCanvasGLES3::_set_texture_rect_mode(bool p_enable) { + + if (state.using_texture_rect==p_enable) + return; + + if (p_enable) { + glBindVertexArray(data.canvas_quad_array); + + + } else { + glBindVertexArray(0); + glBindBuffer(GL_ARRAY_BUFFER,0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,0); + + + } + + state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_TEXTURE_RECT,p_enable); + state.canvas_shader.bind(); + state.canvas_shader.set_uniform(CanvasShaderGLES3::FINAL_MODULATE,state.canvas_item_modulate); + state.canvas_shader.set_uniform(CanvasShaderGLES3::MODELVIEW_MATRIX,state.final_transform); + state.canvas_shader.set_uniform(CanvasShaderGLES3::EXTRA_MATRIX,state.extra_matrix); + + + state.using_texture_rect=p_enable; +} + + +void RasterizerCanvasGLES3::_draw_polygon(int p_vertex_count, const int* p_indices, const Vector2* p_vertices, const Vector2* p_uvs, const Color* p_colors,const RID& p_texture,bool p_singlecolor) { + + bool do_colors=false; + Color m; + if (p_singlecolor) { + m = *p_colors; + glVertexAttrib4f(VS::ARRAY_COLOR,m.r,m.g,m.b,m.a); + } else if (!p_colors) { + + glVertexAttrib4f(VS::ARRAY_COLOR,1,1,1,1); + } else + do_colors=true; + + RasterizerStorageGLES3::Texture *texture = _bind_canvas_texture(p_texture); + +#ifndef GLES_NO_CLIENT_ARRAYS + glEnableVertexAttribArray(VS::ARRAY_VERTEX); + glVertexAttribPointer( VS::ARRAY_VERTEX, 2 ,GL_FLOAT, false, sizeof(Vector2), p_vertices ); + if (do_colors) { + + glEnableVertexAttribArray(VS::ARRAY_COLOR); + glVertexAttribPointer( VS::ARRAY_COLOR, 4 ,GL_FLOAT, false, sizeof(Color), p_colors ); + } else { + glDisableVertexAttribArray(VS::ARRAY_COLOR); + } + + if (texture && p_uvs) { + + glEnableVertexAttribArray(VS::ARRAY_TEX_UV); + glVertexAttribPointer( VS::ARRAY_TEX_UV, 2 ,GL_FLOAT, false, sizeof(Vector2), p_uvs ); + } else { + glDisableVertexAttribArray(VS::ARRAY_TEX_UV); + } + + if (p_indices) { + glDrawElements(GL_TRIANGLES, p_vertex_count, GL_UNSIGNED_INT, p_indices ); + } else { + glDrawArrays(GL_TRIANGLES,0,p_vertex_count); + } + + +#else //WebGL specific impl. + glBindBuffer(GL_ARRAY_BUFFER, gui_quad_buffer); + float *b = GlobalVertexBuffer; + int ofs = 0; + if(p_vertex_count > MAX_POLYGON_VERTICES){ + print_line("Too many vertices to render"); + return; + } + glEnableVertexAttribArray(VS::ARRAY_VERTEX); + glVertexAttribPointer( VS::ARRAY_VERTEX, 2 ,GL_FLOAT, false, sizeof(float)*2, ((float*)0)+ofs ); + for(int i=0;i<p_vertex_count;i++) { + b[ofs++]=p_vertices[i].x; + b[ofs++]=p_vertices[i].y; + } + + if (p_colors && do_colors) { + + glEnableVertexAttribArray(VS::ARRAY_COLOR); + glVertexAttribPointer( VS::ARRAY_COLOR, 4 ,GL_FLOAT, false, sizeof(float)*4, ((float*)0)+ofs ); + for(int i=0;i<p_vertex_count;i++) { + b[ofs++]=p_colors[i].r; + b[ofs++]=p_colors[i].g; + b[ofs++]=p_colors[i].b; + b[ofs++]=p_colors[i].a; + } + + } else { + glDisableVertexAttribArray(VS::ARRAY_COLOR); + } + + + if (p_uvs) { + + glEnableVertexAttribArray(VS::ARRAY_TEX_UV); + glVertexAttribPointer( VS::ARRAY_TEX_UV, 2 ,GL_FLOAT, false, sizeof(float)*2, ((float*)0)+ofs ); + for(int i=0;i<p_vertex_count;i++) { + b[ofs++]=p_uvs[i].x; + b[ofs++]=p_uvs[i].y; + } + + } else { + glDisableVertexAttribArray(VS::ARRAY_TEX_UV); + } + + glBufferSubData(GL_ARRAY_BUFFER,0,ofs*4,&b[0]); + + //bind the indices buffer. + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, indices_buffer); + + static const int _max_draw_poly_indices = 16*1024; // change this size if needed!!! + ERR_FAIL_COND(p_vertex_count > _max_draw_poly_indices); + static uint16_t _draw_poly_indices[_max_draw_poly_indices]; + for (int i=0; i<p_vertex_count; i++) { + _draw_poly_indices[i] = p_indices[i]; + //OS::get_singleton()->print("ind: %d ", p_indices[i]); + }; + + //copy the data to GPU. + glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, p_vertex_count * sizeof(uint16_t), &_draw_poly_indices[0]); + + //draw the triangles. + glDrawElements(GL_TRIANGLES, p_vertex_count, GL_UNSIGNED_SHORT, 0); + + glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); +#endif + + storage->frame.canvas_draw_commands++; + +} + +void RasterizerCanvasGLES3::_draw_gui_primitive(int p_points, const Vector2 *p_vertices, const Color* p_colors, const Vector2 *p_uvs) { + + + + static const GLenum prim[5]={GL_POINTS,GL_POINTS,GL_LINES,GL_TRIANGLES,GL_TRIANGLE_FAN}; + + + //#define GLES_USE_PRIMITIVE_BUFFER + + int version=0; + int color_ofs=0; + int uv_ofs=0; + int stride=2; + + if (p_colors) { //color + version|=1; + color_ofs=stride; + stride+=4; + } + + if (p_uvs) { //uv + version|=2; + uv_ofs=stride; + stride+=2; + } + + + float b[(2+2+4)]; + + + for(int i=0;i<p_points;i++) { + b[stride*i+0]=p_vertices[i].x; + b[stride*i+1]=p_vertices[i].y; + } + + if (p_colors) { + + for(int i=0;i<p_points;i++) { + b[stride*i+color_ofs+0]=p_colors[i].r; + b[stride*i+color_ofs+1]=p_colors[i].g; + b[stride*i+color_ofs+2]=p_colors[i].b; + b[stride*i+color_ofs+3]=p_colors[i].a; + } + + } + + if (p_uvs) { + + for(int i=0;i<p_points;i++) { + b[stride*i+uv_ofs+0]=p_uvs[i].x; + b[stride*i+uv_ofs+1]=p_uvs[i].y; + } + + } + + glBindBuffer(GL_ARRAY_BUFFER,data.primitive_quad_buffer); + glBufferSubData(GL_ARRAY_BUFFER,0,p_points*stride*4,&b[0]); + glBindVertexArray(data.primitive_quad_buffer_arrays[version]); + glDrawArrays(prim[p_points],0,p_points); + glBindVertexArray(0); + glBindBuffer(GL_ARRAY_BUFFER,0); + + storage->frame.canvas_draw_commands++; +} + +void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item,Item *current_clip,bool &reclip) { + + int cc=p_item->commands.size(); + Item::Command **commands = p_item->commands.ptr(); + + + for(int i=0;i<cc;i++) { + + Item::Command *c=commands[i]; + + switch(c->type) { + case Item::Command::TYPE_LINE: { + + + Item::CommandLine* line = static_cast<Item::CommandLine*>(c); + _set_texture_rect_mode(false); + + + _bind_canvas_texture(RID()); + + glVertexAttrib4f(VS::ARRAY_COLOR,line->color.r,line->color.g,line->color.b,line->color.a); + + Vector2 verts[2]={ + Vector2(line->from.x,line->from.y), + Vector2(line->to.x,line->to.y) + }; + +#ifdef GLES_OVER_GL + if (line->antialiased) + glEnable(GL_LINE_SMOOTH); +#endif + //glLineWidth(line->width); + _draw_gui_primitive(2,verts,NULL,NULL); + +#ifdef GLES_OVER_GL + if (line->antialiased) + glDisable(GL_LINE_SMOOTH); +#endif + + + } break; + case Item::Command::TYPE_RECT: { + + Item::CommandRect* rect = static_cast<Item::CommandRect*>(c); + + _set_texture_rect_mode(true); + + //set color + glVertexAttrib4f(VS::ARRAY_COLOR,rect->modulate.r,rect->modulate.g,rect->modulate.b,rect->modulate.a); + + RasterizerStorageGLES3::Texture* texture = _bind_canvas_texture(rect->texture); + + if ( texture ) { + + bool untile=false; + + if (rect->flags&CANVAS_RECT_TILE && !(texture->flags&VS::TEXTURE_FLAG_REPEAT)) { + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); + untile=true; + } + + Size2 texpixel_size( 1.0/texture->width, 1.0/texture->height ); + Rect2 src_rect = (rect->flags&CANVAS_RECT_REGION) ? Rect2( rect->source.pos * texpixel_size, rect->source.size * texpixel_size ) : Rect2(0,0,1,1); + + if (rect->flags&CANVAS_RECT_FLIP_H) { + src_rect.size.x*=-1; + } + + if (rect->flags&CANVAS_RECT_FLIP_V) { + src_rect.size.y*=-1; + } + + if (rect->flags&CANVAS_RECT_TRANSPOSE) { + //err.. + } + + state.canvas_shader.set_uniform(CanvasShaderGLES3::COLOR_TEXPIXEL_SIZE,texpixel_size); + + + glVertexAttrib4f(1,rect->rect.pos.x,rect->rect.pos.y,rect->rect.size.x,rect->rect.size.y); + glVertexAttrib4f(2,src_rect.pos.x,src_rect.pos.y,src_rect.size.x,src_rect.size.y); + glDrawArrays(GL_TRIANGLE_FAN,0,4); + + + if (untile) { + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); + } + + } else { + + + glVertexAttrib4f(1,rect->rect.pos.x,rect->rect.pos.y,rect->rect.size.x,rect->rect.size.y); + glVertexAttrib4f(2,0,0,1,1); + glDrawArrays(GL_TRIANGLE_FAN,0,4); + + + } + + storage->frame.canvas_draw_commands++; + + } break; + + case Item::Command::TYPE_NINEPATCH: { + + Item::CommandNinePatch* np = static_cast<Item::CommandNinePatch*>(c); + + _set_texture_rect_mode(true); + + glVertexAttrib4f(VS::ARRAY_COLOR,np->color.r,np->color.g,np->color.b,np->color.a); + + + RasterizerStorageGLES3::Texture* texture = _bind_canvas_texture(np->texture); + + if ( !texture ) { + + glVertexAttrib4f(1,np->rect.pos.x,np->rect.pos.y,np->rect.size.x,np->rect.size.y); + glVertexAttrib4f(2,0,0,1,1); + glDrawArrays(GL_TRIANGLE_FAN,0,4); + continue; + } + + + Size2 texpixel_size( 1.0/texture->width, 1.0/texture->height ); + + state.canvas_shader.set_uniform(CanvasShaderGLES3::COLOR_TEXPIXEL_SIZE,texpixel_size); + +#define DSTRECT(m_x,m_y,m_w,m_h) glVertexAttrib4f(1,m_x,m_y,m_w,m_h) +#define SRCRECT(m_x,m_y,m_w,m_h) glVertexAttrib4f(2,(m_x)*texpixel_size.x,(m_y)*texpixel_size.y,(m_w)*texpixel_size.x,(m_h)*texpixel_size.y) + + //top left + DSTRECT(np->rect.pos.x,np->rect.pos.y,np->margin[MARGIN_LEFT],np->margin[MARGIN_TOP]); + SRCRECT(0,0,np->margin[MARGIN_LEFT],np->margin[MARGIN_TOP]); + glDrawArrays(GL_TRIANGLE_FAN,0,4); + + //top right + DSTRECT(np->rect.pos.x+np->rect.size.x-np->margin[MARGIN_RIGHT],np->rect.pos.y,np->margin[MARGIN_RIGHT],np->margin[MARGIN_TOP]); + SRCRECT(texture->width-np->margin[MARGIN_RIGHT],0,np->margin[MARGIN_RIGHT],np->margin[MARGIN_TOP]); + glDrawArrays(GL_TRIANGLE_FAN,0,4); + + //bottom right + DSTRECT(np->rect.pos.x+np->rect.size.x-np->margin[MARGIN_RIGHT],np->rect.pos.y+np->rect.size.y-np->margin[MARGIN_BOTTOM],np->margin[MARGIN_RIGHT],np->margin[MARGIN_BOTTOM]); + SRCRECT(texture->width-np->margin[MARGIN_RIGHT],texture->height-np->margin[MARGIN_BOTTOM],np->margin[MARGIN_RIGHT],np->margin[MARGIN_BOTTOM]); + glDrawArrays(GL_TRIANGLE_FAN,0,4); + + //bottom left + DSTRECT(np->rect.pos.x,np->rect.pos.y+np->rect.size.y-np->margin[MARGIN_BOTTOM],np->margin[MARGIN_LEFT],np->margin[MARGIN_BOTTOM]); + SRCRECT(0,texture->height-np->margin[MARGIN_BOTTOM],np->margin[MARGIN_LEFT],np->margin[MARGIN_BOTTOM]); + glDrawArrays(GL_TRIANGLE_FAN,0,4); + + + //top + DSTRECT(np->rect.pos.x+np->margin[MARGIN_LEFT],np->rect.pos.y,np->rect.size.width-np->margin[MARGIN_LEFT]-np->margin[MARGIN_RIGHT],np->margin[MARGIN_TOP]); + SRCRECT(np->margin[MARGIN_LEFT],0,texture->width-np->margin[MARGIN_LEFT]-np->margin[MARGIN_RIGHT],np->margin[MARGIN_TOP]); + glDrawArrays(GL_TRIANGLE_FAN,0,4); + + //bottom + DSTRECT(np->rect.pos.x+np->margin[MARGIN_LEFT],np->rect.pos.y+np->rect.size.y-np->margin[MARGIN_BOTTOM],np->rect.size.width-np->margin[MARGIN_LEFT]-np->margin[MARGIN_RIGHT],np->margin[MARGIN_TOP]); + SRCRECT(np->margin[MARGIN_LEFT],texture->height-np->margin[MARGIN_BOTTOM],texture->width-np->margin[MARGIN_LEFT]-np->margin[MARGIN_LEFT],np->margin[MARGIN_TOP]); + glDrawArrays(GL_TRIANGLE_FAN,0,4); + + + //left + DSTRECT(np->rect.pos.x,np->rect.pos.y+np->margin[MARGIN_TOP],np->margin[MARGIN_LEFT],np->rect.size.height-np->margin[MARGIN_TOP]-np->margin[MARGIN_BOTTOM]); + SRCRECT(0,np->margin[MARGIN_TOP],np->margin[MARGIN_LEFT],texture->height-np->margin[MARGIN_TOP]-np->margin[MARGIN_BOTTOM]); + glDrawArrays(GL_TRIANGLE_FAN,0,4); + + //right + DSTRECT(np->rect.pos.x+np->rect.size.width-np->margin[MARGIN_RIGHT],np->rect.pos.y+np->margin[MARGIN_TOP],np->margin[MARGIN_RIGHT],np->rect.size.height-np->margin[MARGIN_TOP]-np->margin[MARGIN_BOTTOM]); + SRCRECT(texture->width-np->margin[MARGIN_RIGHT],np->margin[MARGIN_TOP],np->margin[MARGIN_RIGHT],texture->height-np->margin[MARGIN_TOP]-np->margin[MARGIN_BOTTOM]); + glDrawArrays(GL_TRIANGLE_FAN,0,4); + + if (np->draw_center) { + + //center + DSTRECT(np->rect.pos.x+np->margin[MARGIN_LEFT],np->rect.pos.y+np->margin[MARGIN_TOP],np->rect.size.x-np->margin[MARGIN_LEFT]-np->margin[MARGIN_RIGHT],np->rect.size.height-np->margin[MARGIN_TOP]-np->margin[MARGIN_BOTTOM]); + SRCRECT(np->margin[MARGIN_LEFT],np->margin[MARGIN_TOP],texture->width-np->margin[MARGIN_LEFT]-np->margin[MARGIN_RIGHT],texture->height-np->margin[MARGIN_TOP]-np->margin[MARGIN_BOTTOM]); + glDrawArrays(GL_TRIANGLE_FAN,0,4); + + } + +#undef SRCRECT +#undef DSTRECT + + storage->frame.canvas_draw_commands++; + } break; + + case Item::Command::TYPE_PRIMITIVE: { + + Item::CommandPrimitive* primitive = static_cast<Item::CommandPrimitive*>(c); + _set_texture_rect_mode(false); + + ERR_CONTINUE( primitive->points.size()<1); + + RasterizerStorageGLES3::Texture* texture = _bind_canvas_texture(primitive->texture); + + if (texture ) { + Size2 texpixel_size( 1.0/texture->width, 1.0/texture->height ); + state.canvas_shader.set_uniform(CanvasShaderGLES3::COLOR_TEXPIXEL_SIZE,texpixel_size); + + } + if (primitive->colors.size()==1 && primitive->points.size()>1) { + + Color c = primitive->colors[0]; + glVertexAttrib4f(VS::ARRAY_COLOR,c.r,c.g,c.b,c.a); + + } else if (primitive->colors.empty()) { + glVertexAttrib4f(VS::ARRAY_COLOR,1,1,1,1); + } + + _draw_gui_primitive(primitive->points.size(),primitive->points.ptr(),primitive->colors.ptr(),primitive->uvs.ptr()); + + } break; + case Item::Command::TYPE_POLYGON: { + + Item::CommandPolygon* polygon = static_cast<Item::CommandPolygon*>(c); + _set_texture_rect_mode(false); + + RasterizerStorageGLES3::Texture* texture = _bind_canvas_texture(polygon->texture); + + if (texture ) { + Size2 texpixel_size( 1.0/texture->width, 1.0/texture->height ); + state.canvas_shader.set_uniform(CanvasShaderGLES3::COLOR_TEXPIXEL_SIZE,texpixel_size); + + } + _draw_polygon(polygon->count,polygon->indices.ptr(),polygon->points.ptr(),polygon->uvs.ptr(),polygon->colors.ptr(),polygon->texture,polygon->colors.size()==1); + + } break; + case Item::Command::TYPE_CIRCLE: { + + _set_texture_rect_mode(false); + + Item::CommandCircle* circle = static_cast<Item::CommandCircle*>(c); + static const int numpoints=32; + Vector2 points[numpoints+1]; + points[numpoints]=circle->pos; + int indices[numpoints*3]; + + for(int i=0;i<numpoints;i++) { + + points[i]=circle->pos+Vector2( Math::sin(i*Math_PI*2.0/numpoints),Math::cos(i*Math_PI*2.0/numpoints) )*circle->radius; + indices[i*3+0]=i; + indices[i*3+1]=(i+1)%numpoints; + indices[i*3+2]=numpoints; + } + _draw_polygon(numpoints*3,indices,points,NULL,&circle->color,RID(),true); + //canvas_draw_circle(circle->indices.size(),circle->indices.ptr(),circle->points.ptr(),circle->uvs.ptr(),circle->colors.ptr(),circle->texture,circle->colors.size()==1); + } break; + case Item::Command::TYPE_TRANSFORM: { + + Item::CommandTransform* transform = static_cast<Item::CommandTransform*>(c); + state.extra_matrix=transform->xform; + state.canvas_shader.set_uniform(CanvasShaderGLES3::EXTRA_MATRIX,state.extra_matrix); + + } break; + case Item::Command::TYPE_CLIP_IGNORE: { + + Item::CommandClipIgnore* ci = static_cast<Item::CommandClipIgnore*>(c); + if (current_clip) { + + if (ci->ignore!=reclip) { + if (ci->ignore) { + + glDisable(GL_SCISSOR_TEST); + reclip=true; + } else { + + glEnable(GL_SCISSOR_TEST); + //glScissor(viewport.x+current_clip->final_clip_rect.pos.x,viewport.y+ (viewport.height-(current_clip->final_clip_rect.pos.y+current_clip->final_clip_rect.size.height)), + //current_clip->final_clip_rect.size.width,current_clip->final_clip_rect.size.height); + + int x = current_clip->final_clip_rect.pos.x; + int y = storage->frame.current_rt->height - ( current_clip->final_clip_rect.pos.y + current_clip->final_clip_rect.size.y ); + int w = current_clip->final_clip_rect.size.x; + int h = current_clip->final_clip_rect.size.y; + + glScissor(x,y,w,h); + + reclip=false; + } + } + } + + + + } break; + } + } +} + +#if 0 +void RasterizerGLES2::_canvas_item_setup_shader_params(CanvasItemMaterial *material,Shader* shader) { + + if (canvas_shader.bind()) + rebind_texpixel_size=true; + + if (material->shader_version!=shader->version) { + //todo optimize uniforms + material->shader_version=shader->version; + } + + if (shader->has_texscreen && framebuffer.active) { + + int x = viewport.x; + int y = window_size.height-(viewport.height+viewport.y); + + canvas_shader.set_uniform(CanvasShaderGLES2::TEXSCREEN_SCREEN_MULT,Vector2(float(viewport.width)/framebuffer.width,float(viewport.height)/framebuffer.height)); + canvas_shader.set_uniform(CanvasShaderGLES2::TEXSCREEN_SCREEN_CLAMP,Color(float(x)/framebuffer.width,float(y)/framebuffer.height,float(x+viewport.width)/framebuffer.width,float(y+viewport.height)/framebuffer.height)); + canvas_shader.set_uniform(CanvasShaderGLES2::TEXSCREEN_TEX,max_texture_units-1); + glActiveTexture(GL_TEXTURE0+max_texture_units-1); + glBindTexture(GL_TEXTURE_2D,framebuffer.sample_color); + if (framebuffer.scale==1 && !canvas_texscreen_used) { +#ifdef GLEW_ENABLED + if (current_rt) { + glReadBuffer(GL_COLOR_ATTACHMENT0); + } else { + glReadBuffer(GL_BACK); + } +#endif + if (current_rt) { + glCopyTexSubImage2D(GL_TEXTURE_2D,0,viewport.x,viewport.y,viewport.x,viewport.y,viewport.width,viewport.height); + canvas_shader.set_uniform(CanvasShaderGLES2::TEXSCREEN_SCREEN_CLAMP,Color(float(x)/framebuffer.width,float(viewport.y)/framebuffer.height,float(x+viewport.width)/framebuffer.width,float(y+viewport.height)/framebuffer.height)); + //window_size.height-(viewport.height+viewport.y) + } else { + glCopyTexSubImage2D(GL_TEXTURE_2D,0,x,y,x,y,viewport.width,viewport.height); + } +// if (current_clip) { +// // print_line(" a clip "); +// } + + canvas_texscreen_used=true; + } + + glActiveTexture(GL_TEXTURE0); + + } + + if (shader->has_screen_uv) { + canvas_shader.set_uniform(CanvasShaderGLES2::SCREEN_UV_MULT,Vector2(1.0/viewport.width,1.0/viewport.height)); + } + + + uses_texpixel_size=shader->uses_texpixel_size; + +} + +#endif + +void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list,int p_z,const Color& p_modulate,Light *p_light) { + + + + + Item *current_clip=NULL; + RasterizerStorageGLES3::Shader *shader_cache=NULL; + + bool rebind_shader=true; + + Size2 rt_size = Size2(storage->frame.current_rt->width,storage->frame.current_rt->height); + + + state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_DISTANCE_FIELD,false); + + glBindBuffer(GL_UNIFORM_BUFFER, state.canvas_item_ubo); + glBufferData(GL_UNIFORM_BUFFER, sizeof(CanvasItemUBO), &state.canvas_item_ubo_data, GL_DYNAMIC_DRAW); + glBindBuffer(GL_UNIFORM_BUFFER, 0); + + state.current_tex=RID(); + state.current_tex_ptr=NULL; + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,storage->resources.white_tex); + + + int last_blend_mode=-1; + + RID canvas_last_material; + + bool prev_distance_field=false; + + while(p_item_list) { + + Item *ci=p_item_list; + + + if (prev_distance_field!=ci->distance_field) { + + state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_DISTANCE_FIELD,ci->distance_field); + prev_distance_field=ci->distance_field; + rebind_shader=true; + } + + + if (current_clip!=ci->final_clip_owner) { + + current_clip=ci->final_clip_owner; + + //setup clip + if (current_clip) { + + glEnable(GL_SCISSOR_TEST); + glScissor(current_clip->final_clip_rect.pos.x,(rt_size.height-(current_clip->final_clip_rect.pos.y+current_clip->final_clip_rect.size.height)),current_clip->final_clip_rect.size.width,current_clip->final_clip_rect.size.height); + + + } else { + + glDisable(GL_SCISSOR_TEST); + } + } +#if 0 + if (ci->copy_back_buffer && framebuffer.active && framebuffer.scale==1) { + + Rect2 rect; + int x,y; + + if (ci->copy_back_buffer->full) { + + x = viewport.x; + y = window_size.height-(viewport.height+viewport.y); + } else { + x = viewport.x+ci->copy_back_buffer->screen_rect.pos.x; + y = window_size.height-(viewport.y+ci->copy_back_buffer->screen_rect.pos.y+ci->copy_back_buffer->screen_rect.size.y); + } + glActiveTexture(GL_TEXTURE0+max_texture_units-1); + glBindTexture(GL_TEXTURE_2D,framebuffer.sample_color); + +#ifdef GLEW_ENABLED + if (current_rt) { + glReadBuffer(GL_COLOR_ATTACHMENT0); + } else { + glReadBuffer(GL_BACK); + } +#endif + if (current_rt) { + glCopyTexSubImage2D(GL_TEXTURE_2D,0,viewport.x,viewport.y,viewport.x,viewport.y,viewport.width,viewport.height); + //window_size.height-(viewport.height+viewport.y) + } else { + glCopyTexSubImage2D(GL_TEXTURE_2D,0,x,y,x,y,viewport.width,viewport.height); + } + + canvas_texscreen_used=true; + glActiveTexture(GL_TEXTURE0); + + } + +#endif + + + //begin rect + Item *material_owner = ci->material_owner?ci->material_owner:ci; + + RID material = material_owner->material; + + if (material!=canvas_last_material || rebind_shader) { + + RasterizerStorageGLES3::Material *material_ptr = storage->material_owner.getornull(material); + RasterizerStorageGLES3::Shader *shader_ptr = NULL; + + if (material_ptr) { + + shader_ptr = material_ptr->shader; + + if (shader_ptr && shader_ptr->mode!=VS::SHADER_CANVAS_ITEM) { + shader_ptr=NULL; //do not use non canvasitem shader + } + } + + + + if (shader_ptr && shader_ptr!=shader_cache) { + + state.canvas_shader.set_custom_shader(shader_ptr->custom_code_id); + state.canvas_shader.bind(); + + if (material_ptr->ubo_id) { + glBindBufferBase(GL_UNIFORM_BUFFER,2,material_ptr->ubo_id); + } + + int tc = material_ptr->textures.size(); + RID* textures = material_ptr->textures.ptr(); + ShaderLanguage::ShaderNode::Uniform::Hint* texture_hints = shader_ptr->texture_hints.ptr(); + + for(int i=0;i<tc;i++) { + + glActiveTexture(GL_TEXTURE1+i); + + RasterizerStorageGLES3::Texture *t = storage->texture_owner.getornull( textures[i] ); + if (!t) { + + switch(texture_hints[i]) { + case ShaderLanguage::ShaderNode::Uniform::HINT_BLACK_ALBEDO: + case ShaderLanguage::ShaderNode::Uniform::HINT_BLACK: { + glBindTexture(GL_TEXTURE_2D,storage->resources.black_tex); + } break; + case ShaderLanguage::ShaderNode::Uniform::HINT_ANISO: { + glBindTexture(GL_TEXTURE_2D,storage->resources.aniso_tex); + } break; + case ShaderLanguage::ShaderNode::Uniform::HINT_NORMAL: { + glBindTexture(GL_TEXTURE_2D,storage->resources.normal_tex); + } break; + default: { + glBindTexture(GL_TEXTURE_2D,storage->resources.white_tex); + } break; + } + + //check hints + + continue; + } + + if (storage->config.srgb_decode_supported && t->using_srgb) { + //no srgb in 2D + glTexParameteri(t->target,_TEXTURE_SRGB_DECODE_EXT,_SKIP_DECODE_EXT); + t->using_srgb=false; + } + + glBindTexture(t->target,t->tex_id); + } + + + } else if (!shader_ptr) { + state.canvas_shader.set_custom_shader(0); + state.canvas_shader.bind(); + + } + + shader_cache=shader_ptr; + + canvas_last_material=material; + rebind_shader=false; + + } + + int blend_mode = shader_cache ? shader_cache->canvas_item.blend_mode : RasterizerStorageGLES3::Shader::CanvasItem::BLEND_MODE_MIX; + bool unshaded = shader_cache && (shader_cache->canvas_item.light_mode==RasterizerStorageGLES3::Shader::CanvasItem::LIGHT_MODE_UNSHADED || blend_mode!=RasterizerStorageGLES3::Shader::CanvasItem::BLEND_MODE_MIX); + bool reclip=false; + + if (last_blend_mode!=blend_mode) { + + switch(blend_mode) { + + case RasterizerStorageGLES3::Shader::CanvasItem::BLEND_MODE_MIX: { + glBlendEquation(GL_FUNC_ADD); + if (storage->frame.current_rt && storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT]) { + glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + } + else { + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + } + + } break; + case RasterizerStorageGLES3::Shader::CanvasItem::BLEND_MODE_ADD: { + + glBlendEquation(GL_FUNC_ADD); + glBlendFunc(GL_SRC_ALPHA,GL_ONE); + + } break; + case RasterizerStorageGLES3::Shader::CanvasItem::BLEND_MODE_SUB: { + + glBlendEquation(GL_FUNC_REVERSE_SUBTRACT); + glBlendFunc(GL_SRC_ALPHA,GL_ONE); + } break; + case RasterizerStorageGLES3::Shader::CanvasItem::BLEND_MODE_MUL: { + glBlendEquation(GL_FUNC_ADD); + glBlendFunc(GL_DST_COLOR,GL_ZERO); + } break; + case RasterizerStorageGLES3::Shader::CanvasItem::BLEND_MODE_PMALPHA: { + glBlendEquation(GL_FUNC_ADD); + glBlendFunc(GL_ONE,GL_ONE_MINUS_SRC_ALPHA); + } break; + + } + + last_blend_mode=blend_mode; + } + + state.canvas_item_modulate = unshaded ? ci->final_modulate : Color( + ci->final_modulate.r * p_modulate.r, + ci->final_modulate.g * p_modulate.g, + ci->final_modulate.b * p_modulate.b, + ci->final_modulate.a * p_modulate.a ); + + state.final_transform = ci->final_transform; + state.extra_matrix=Transform2D(); + + state.canvas_shader.set_uniform(CanvasShaderGLES3::FINAL_MODULATE,state.canvas_item_modulate); + state.canvas_shader.set_uniform(CanvasShaderGLES3::MODELVIEW_MATRIX,state.final_transform); + state.canvas_shader.set_uniform(CanvasShaderGLES3::EXTRA_MATRIX,state.extra_matrix); + + + if (unshaded || (state.canvas_item_modulate.a>0.001 && (!shader_cache || shader_cache->canvas_item.light_mode!=RasterizerStorageGLES3::Shader::CanvasItem::LIGHT_MODE_LIGHT_ONLY) && !ci->light_masked )) + _canvas_item_render_commands(ci,current_clip,reclip); + + if ((blend_mode==RasterizerStorageGLES3::Shader::CanvasItem::BLEND_MODE_MIX || RasterizerStorageGLES3::Shader::CanvasItem::BLEND_MODE_PMALPHA) && p_light && !unshaded) { + + Light *light = p_light; + bool light_used=false; + VS::CanvasLightMode mode=VS::CANVAS_LIGHT_MODE_ADD; + state.canvas_item_modulate=ci->final_modulate; // remove the canvas modulate + + + while(light) { + + + if (ci->light_mask&light->item_mask && p_z>=light->z_min && p_z<=light->z_max && ci->global_rect_cache.intersects_transformed(light->xform_cache,light->rect_cache)) { + + //intersects this light + + if (!light_used || mode!=light->mode) { + + mode=light->mode; + + switch(mode) { + + case VS::CANVAS_LIGHT_MODE_ADD: { + glBlendEquation(GL_FUNC_ADD); + glBlendFunc(GL_SRC_ALPHA,GL_ONE); + + } break; + case VS::CANVAS_LIGHT_MODE_SUB: { + glBlendEquation(GL_FUNC_REVERSE_SUBTRACT); + glBlendFunc(GL_SRC_ALPHA,GL_ONE); + } break; + case VS::CANVAS_LIGHT_MODE_MIX: + case VS::CANVAS_LIGHT_MODE_MASK: { + glBlendEquation(GL_FUNC_ADD); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + } break; + } + + } + + if (!light_used) { + + state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_LIGHTING,true); + light_used=true; + + } + + + bool has_shadow = light->shadow_buffer.is_valid() && ci->light_mask&light->item_shadow_mask; + + + state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_SHADOWS,has_shadow); + if (has_shadow) { + state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_USE_GRADIENT,light->shadow_gradient_length>0); + switch(light->shadow_filter) { + + case VS::CANVAS_LIGHT_FILTER_NONE: state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_NEAREST,true); break; + case VS::CANVAS_LIGHT_FILTER_PCF3: state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_PCF3,true); break; + case VS::CANVAS_LIGHT_FILTER_PCF5: state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_PCF5,true); break; + case VS::CANVAS_LIGHT_FILTER_PCF9: state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_PCF9,true); break; + case VS::CANVAS_LIGHT_FILTER_PCF13: state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_PCF13,true); break; + } + + + } + + bool light_rebind = state.canvas_shader.bind(); + + if (light_rebind) { + + state.canvas_shader.set_uniform(CanvasShaderGLES3::FINAL_MODULATE,state.canvas_item_modulate); + state.canvas_shader.set_uniform(CanvasShaderGLES3::MODELVIEW_MATRIX,state.final_transform); + state.canvas_shader.set_uniform(CanvasShaderGLES3::EXTRA_MATRIX,Transform2D()); + + } + + glBindBufferBase(GL_UNIFORM_BUFFER,1,static_cast<LightInternal*>(light->light_internal.get_data())->ubo); + + if (has_shadow) { + + RasterizerStorageGLES3::CanvasLightShadow *cls = storage->canvas_light_shadow_owner.get(light->shadow_buffer); + glActiveTexture(GL_TEXTURE0+storage->config.max_texture_image_units-2); + glBindTexture(GL_TEXTURE_2D,cls->distance); + + /*canvas_shader.set_uniform(CanvasShaderGLES3::SHADOW_MATRIX,light->shadow_matrix_cache); + canvas_shader.set_uniform(CanvasShaderGLES3::SHADOW_ESM_MULTIPLIER,light->shadow_esm_mult); + canvas_shader.set_uniform(CanvasShaderGLES3::LIGHT_SHADOW_COLOR,light->shadow_color);*/ + + } + + glActiveTexture(GL_TEXTURE0+storage->config.max_texture_image_units-1); + RasterizerStorageGLES3::Texture *t = storage->texture_owner.getornull(light->texture); + if (!t) { + glBindTexture(GL_TEXTURE_2D,storage->resources.white_tex); + } else { + + glBindTexture(t->target,t->tex_id); + } + + glActiveTexture(GL_TEXTURE0); + _canvas_item_render_commands(ci,current_clip,reclip); //redraw using light + + } + + light=light->next_ptr; + } + + if (light_used) { + + + state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_LIGHTING,false); + state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_SHADOWS,false); + state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_NEAREST,false); + state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_PCF3,false); + state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_PCF5,false); + state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_PCF9,false); + state.canvas_shader.set_conditional(CanvasShaderGLES3::SHADOW_FILTER_PCF13,false); + + state.canvas_shader.bind(); + + last_blend_mode=-1; + + /* + //this is set again, so it should not be needed anyway? + state.canvas_item_modulate = unshaded ? ci->final_modulate : Color( + ci->final_modulate.r * p_modulate.r, + ci->final_modulate.g * p_modulate.g, + ci->final_modulate.b * p_modulate.b, + ci->final_modulate.a * p_modulate.a ); + + + state.canvas_shader.set_uniform(CanvasShaderGLES3::MODELVIEW_MATRIX,state.final_transform); + state.canvas_shader.set_uniform(CanvasShaderGLES3::EXTRA_MATRIX,Matrix32()); + state.canvas_shader.set_uniform(CanvasShaderGLES3::FINAL_MODULATE,state.canvas_item_modulate); + + glBlendEquation(GL_FUNC_ADD); + + if (storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT]) { + glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + } else { + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + } + + //@TODO RESET canvas_blend_mode + */ + } + + + } + + if (reclip) { + + glEnable(GL_SCISSOR_TEST); + glScissor(current_clip->final_clip_rect.pos.x,(rt_size.height-(current_clip->final_clip_rect.pos.y+current_clip->final_clip_rect.size.height)),current_clip->final_clip_rect.size.width,current_clip->final_clip_rect.size.height); + + + } + + + + p_item_list=p_item_list->next; + } + + if (current_clip) { + glDisable(GL_SCISSOR_TEST); + } + +} + +void RasterizerCanvasGLES3::canvas_debug_viewport_shadows(Light* p_lights_with_shadow){ + + Light* light=p_lights_with_shadow; + + canvas_begin(); //reset + glVertexAttrib4f(VS::ARRAY_COLOR,1,1,1,1); + int h = 10; + int w = storage->frame.current_rt->width; + int ofs = h; + glDisable(GL_BLEND); + + //print_line(" debug lights "); + while(light) { + + + // print_line("debug light"); + if (light->shadow_buffer.is_valid()) { + + // print_line("sb is valid"); + RasterizerStorageGLES3::CanvasLightShadow * sb = storage->canvas_light_shadow_owner.get(light->shadow_buffer); + if (sb) { + glBindTexture(GL_TEXTURE_2D,sb->distance); + //glBindTexture(GL_TEXTURE_2D,storage->resources.white_tex); + draw_generic_textured_rect(Rect2(h,ofs,w-h*2,h),Rect2(0,0,1,1)); + ofs+=h*2; + + } + } + + light=light->shadows_next_ptr; + } +} + + +void RasterizerCanvasGLES3::canvas_light_shadow_buffer_update(RID p_buffer, const Transform2D& p_light_xform, int p_light_mask,float p_near, float p_far, LightOccluderInstance* p_occluders, CameraMatrix *p_xform_cache) { + + RasterizerStorageGLES3::CanvasLightShadow *cls = storage->canvas_light_shadow_owner.get(p_buffer); + ERR_FAIL_COND(!cls); + + + glDisable(GL_BLEND); + glDisable(GL_SCISSOR_TEST); + glDisable(GL_DITHER); + glDisable(GL_CULL_FACE); + glDepthFunc(GL_LEQUAL); + glEnable(GL_DEPTH_TEST); + glDepthMask(true); + + glBindFramebuffer(GL_FRAMEBUFFER, cls->fbo); + + glEnableVertexAttribArray(VS::ARRAY_VERTEX); + state.canvas_shadow_shader.bind(); + + glViewport(0, 0, cls->size,cls->height); + glClearDepth(1.0f); + glClearColor(1,1,1,1); + glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); + + VS::CanvasOccluderPolygonCullMode cull=VS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED; + + + for(int i=0;i<4;i++) { + + //make sure it remains orthogonal, makes easy to read angle later + + Transform light; + light.origin[0]=p_light_xform[2][0]; + light.origin[1]=p_light_xform[2][1]; + light.basis[0][0]=p_light_xform[0][0]; + light.basis[0][1]=p_light_xform[1][0]; + light.basis[1][0]=p_light_xform[0][1]; + light.basis[1][1]=p_light_xform[1][1]; + + //light.basis.scale(Vector3(to_light.elements[0].length(),to_light.elements[1].length(),1)); + + /// p_near=1; + CameraMatrix projection; + { + real_t fov = 90; + real_t nearp = p_near; + real_t farp = p_far; + real_t aspect = 1.0; + + real_t ymax = nearp * Math::tan( Math::deg2rad( fov * 0.5 ) ); + real_t ymin = - ymax; + real_t xmin = ymin * aspect; + real_t xmax = ymax * aspect; + + projection.set_frustum( xmin, xmax, ymin, ymax, nearp, farp ); + } + + Vector3 cam_target=Basis(Vector3(0,0,Math_PI*2*(i/4.0))).xform(Vector3(0,1,0)); + projection = projection * CameraMatrix(Transform().looking_at(cam_target,Vector3(0,0,-1)).affine_inverse()); + + state.canvas_shadow_shader.set_uniform(CanvasShadowShaderGLES3::PROJECTION_MATRIX,projection); + state.canvas_shadow_shader.set_uniform(CanvasShadowShaderGLES3::LIGHT_MATRIX,light); + state.canvas_shadow_shader.set_uniform(CanvasShadowShaderGLES3::DISTANCE_NORM,1.0/p_far); + + + if (i==0) + *p_xform_cache=projection; + + glViewport(0, (cls->height/4)*i, cls->size,cls->height/4); + + LightOccluderInstance *instance=p_occluders; + + while(instance) { + + RasterizerStorageGLES3::CanvasOccluder *cc = storage->canvas_occluder_owner.get(instance->polygon_buffer); + if (!cc || cc->len==0 || !(p_light_mask&instance->light_mask)) { + + instance=instance->next; + continue; + } + + state.canvas_shadow_shader.set_uniform(CanvasShadowShaderGLES3::WORLD_MATRIX,instance->xform_cache); + if (cull!=instance->cull_cache) { + + cull=instance->cull_cache; + switch(cull) { + case VS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED: { + + glDisable(GL_CULL_FACE); + + } break; + case VS::CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE: { + + glEnable(GL_CULL_FACE); + glCullFace(GL_FRONT); + } break; + case VS::CANVAS_OCCLUDER_POLYGON_CULL_COUNTER_CLOCKWISE: { + + glEnable(GL_CULL_FACE); + glCullFace(GL_BACK); + + } break; + } + } +/* + if (i==0) { + for(int i=0;i<cc->lines.size();i++) { + Vector2 p = instance->xform_cache.xform(cc->lines.get(i)); + Plane pp(Vector3(p.x,p.y,0),1); + pp.normal = light.xform(pp.normal); + pp = projection.xform4(pp); + print_line(itos(i)+": "+pp.normal/pp.d); + //pp=light_mat.xform4(pp); + //print_line(itos(i)+": "+pp.normal/pp.d); + } + } +*/ + glBindBuffer(GL_ARRAY_BUFFER,cc->vertex_id); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,cc->index_id); + glVertexAttribPointer(VS::ARRAY_VERTEX, 3, GL_FLOAT, false, 0, 0); + glDrawElements(GL_TRIANGLES,cc->len*3,GL_UNSIGNED_SHORT,0); + + + instance=instance->next; + } + + + } + + glDisableVertexAttribArray(VS::ARRAY_VERTEX); + glBindBuffer(GL_ARRAY_BUFFER,0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,0); +} +void RasterizerCanvasGLES3::reset_canvas() { + + + if (storage->frame.current_rt) { + glBindFramebuffer(GL_FRAMEBUFFER, storage->frame.current_rt->fbo); + glColorMask(1,1,1,1); //don't touch alpha + } + + + glBindVertexArray(0); + glDisable(GL_CULL_FACE); + glDisable(GL_DEPTH_TEST); + glDisable(GL_SCISSOR_TEST); + glEnable(GL_BLEND); + glBlendEquation(GL_FUNC_ADD); + if (storage->frame.current_rt && storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT]) { + glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + } + else { + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + } + //glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); + //glLineWidth(1.0); + glBindBuffer(GL_ARRAY_BUFFER,0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,0); + for(int i=0;i<VS::ARRAY_MAX;i++) { + glDisableVertexAttribArray(i); + } + + glActiveTexture(GL_TEXTURE0); + glBindTexture( GL_TEXTURE_2D, storage->resources.white_tex ); + + + glVertexAttrib4f(VS::ARRAY_COLOR,1,1,1,1); + + Transform canvas_transform; + + if (storage->frame.current_rt) { + + float csy = 1.0; + if (storage->frame.current_rt && storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_VFLIP]) { + csy = -1.0; + } + canvas_transform.translate(-(storage->frame.current_rt->width / 2.0f), -(storage->frame.current_rt->height / 2.0f), 0.0f); + canvas_transform.scale( Vector3( 2.0f / storage->frame.current_rt->width, csy * -2.0f / storage->frame.current_rt->height, 1.0f ) ); + } else { + Vector2 ssize = OS::get_singleton()->get_window_size(); + canvas_transform.translate(-(ssize.width / 2.0f), -(ssize.height / 2.0f), 0.0f); + canvas_transform.scale( Vector3( 2.0f / ssize.width, -2.0f / ssize.height, 1.0f ) ); + + } + + state.vp=canvas_transform; + + store_transform(canvas_transform,state.canvas_item_ubo_data.projection_matrix); + for(int i=0;i<4;i++) { + state.canvas_item_ubo_data.time[i]=storage->frame.time[i]; + } + + glBindBuffer(GL_UNIFORM_BUFFER, state.canvas_item_ubo); + glBufferSubData(GL_UNIFORM_BUFFER, 0, sizeof(CanvasItemUBO), &state.canvas_item_ubo_data); + glBindBuffer(GL_UNIFORM_BUFFER, 0); + + + state.canvas_texscreen_used=false; + + +} + + +void RasterizerCanvasGLES3::draw_generic_textured_rect(const Rect2& p_rect, const Rect2& p_src) { + + + glVertexAttrib4f(1,p_rect.pos.x,p_rect.pos.y,p_rect.size.x,p_rect.size.y); + glVertexAttrib4f(2,p_src.pos.x,p_src.pos.y,p_src.size.x,p_src.size.y); + glDrawArrays(GL_TRIANGLE_FAN,0,4); +} + +void RasterizerCanvasGLES3::initialize() { + + + { + //quad buffers + + glGenBuffers(1,&data.canvas_quad_vertices); + glBindBuffer(GL_ARRAY_BUFFER,data.canvas_quad_vertices); + { + const float qv[8]={ + 0,0, + 0,1, + 1,1, + 1,0 + }; + + glBufferData(GL_ARRAY_BUFFER,sizeof(float)*8,qv,GL_STATIC_DRAW); + } + + glBindBuffer(GL_ARRAY_BUFFER,0); //unbind + + + glGenVertexArrays(1,&data.canvas_quad_array); + glBindVertexArray(data.canvas_quad_array); + glBindBuffer(GL_ARRAY_BUFFER,data.canvas_quad_vertices); + glVertexAttribPointer(0,2,GL_FLOAT,GL_FALSE,sizeof(float)*2,0); + glEnableVertexAttribArray(0); + glBindVertexArray(0); + glBindBuffer(GL_ARRAY_BUFFER,0); //unbind + } + + { + + glGenBuffers(1,&data.primitive_quad_buffer); + glBindBuffer(GL_ARRAY_BUFFER,data.primitive_quad_buffer); + glBufferData(GL_ARRAY_BUFFER,sizeof(float)*2+sizeof(float)*2+sizeof(float)*4,NULL,GL_DYNAMIC_DRAW); //allocate max size + glBindBuffer(GL_ARRAY_BUFFER,0); + + + for(int i=0;i<4;i++) { + glGenVertexArrays(1,&data.primitive_quad_buffer_arrays[i]); + glBindVertexArray(data.primitive_quad_buffer_arrays[i]); + glBindBuffer(GL_ARRAY_BUFFER,data.primitive_quad_buffer); + + int uv_ofs=0; + int color_ofs=0; + int stride=2*4; + + if (i&1) { //color + color_ofs=stride; + stride+=4*4; + } + + if (i&2) { //uv + uv_ofs=stride; + stride+=2*4; + } + + + glEnableVertexAttribArray(VS::ARRAY_VERTEX); + glVertexAttribPointer(VS::ARRAY_VERTEX,2,GL_FLOAT,GL_FALSE,stride,((uint8_t*)NULL)+0); + + if (i&1) { + glEnableVertexAttribArray(VS::ARRAY_COLOR); + glVertexAttribPointer(VS::ARRAY_COLOR,4,GL_FLOAT,GL_FALSE,stride,((uint8_t*)NULL)+color_ofs); + } + + if (i&2) { + glEnableVertexAttribArray(VS::ARRAY_TEX_UV); + glVertexAttribPointer(VS::ARRAY_TEX_UV,2,GL_FLOAT,GL_FALSE,stride,((uint8_t*)NULL)+uv_ofs); + } + + glBindVertexArray(0); + } + } + + + store_transform(Transform(),state.canvas_item_ubo_data.projection_matrix); + + + glGenBuffers(1, &state.canvas_item_ubo); + glBindBuffer(GL_UNIFORM_BUFFER, state.canvas_item_ubo); + glBufferData(GL_UNIFORM_BUFFER, sizeof(CanvasItemUBO), &state.canvas_item_ubo_data, GL_DYNAMIC_DRAW); + glBindBuffer(GL_UNIFORM_BUFFER, 0); + + state.canvas_shader.init(); + state.canvas_shader.set_base_material_tex_index(1); + state.canvas_shadow_shader.init(); + + state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_RGBA_SHADOWS,storage->config.use_rgba_2d_shadows); + state.canvas_shadow_shader.set_conditional(CanvasShadowShaderGLES3::USE_RGBA_SHADOWS,storage->config.use_rgba_2d_shadows); + + +} + + +void RasterizerCanvasGLES3::finalize() { + + glDeleteBuffers(1,&data.canvas_quad_vertices); + glDeleteVertexArrays(1,&data.canvas_quad_array); +} + +RasterizerCanvasGLES3::RasterizerCanvasGLES3() +{ + +} diff --git a/drivers/gles3/rasterizer_canvas_gles3.h b/drivers/gles3/rasterizer_canvas_gles3.h new file mode 100644 index 0000000000..6630ec38c4 --- /dev/null +++ b/drivers/gles3/rasterizer_canvas_gles3.h @@ -0,0 +1,107 @@ +#ifndef RASTERIZERCANVASGLES3_H +#define RASTERIZERCANVASGLES3_H + +#include "servers/visual/rasterizer.h" +#include "rasterizer_storage_gles3.h" +#include "shaders/canvas_shadow.glsl.h" + + +class RasterizerCanvasGLES3 : public RasterizerCanvas { +public: + + struct CanvasItemUBO { + + float projection_matrix[16]; + float time[4]; + + }; + + struct Data { + + GLuint canvas_quad_vertices; + GLuint canvas_quad_array; + + GLuint primitive_quad_buffer; + GLuint primitive_quad_buffer_arrays[4]; + + } data; + + struct State { + CanvasItemUBO canvas_item_ubo_data; + GLuint canvas_item_ubo; + bool canvas_texscreen_used; + CanvasShaderGLES3 canvas_shader; + CanvasShadowShaderGLES3 canvas_shadow_shader; + + bool using_texture_rect; + + + RID current_tex; + RasterizerStorageGLES3::Texture *current_tex_ptr; + + Transform vp; + + Color canvas_item_modulate; + Transform2D extra_matrix; + Transform2D final_transform; + + } state; + + RasterizerStorageGLES3 *storage; + + struct LightInternal : public RID_Data { + + struct UBOData { + + float light_matrix[16]; + float local_matrix[16]; + float shadow_matrix[16]; + float color[4]; + float shadow_color[4]; + float light_pos[2]; + float shadowpixel_size; + float shadow_gradient; + float light_height; + float light_outside_alpha; + float shadow_distance_mult; + } ubo_data; + + GLuint ubo; + }; + + RID_Owner<LightInternal> light_internal_owner; + + virtual RID light_internal_create(); + virtual void light_internal_update(RID p_rid, Light* p_light); + virtual void light_internal_free(RID p_rid); + + + virtual void canvas_begin(); + virtual void canvas_end(); + + _FORCE_INLINE_ void _set_texture_rect_mode(bool p_enable); + _FORCE_INLINE_ RasterizerStorageGLES3::Texture* _bind_canvas_texture(const RID& p_texture); + + _FORCE_INLINE_ void _draw_gui_primitive(int p_points, const Vector2 *p_vertices, const Color* p_colors, const Vector2 *p_uvs); + _FORCE_INLINE_ void _draw_polygon(int p_vertex_count, const int* p_indices, const Vector2* p_vertices, const Vector2* p_uvs, const Color* p_colors,const RID& p_texture,bool p_singlecolor); + _FORCE_INLINE_ void _canvas_item_render_commands(Item *p_item,Item *current_clip,bool &reclip); + + + virtual void canvas_render_items(Item *p_item_list,int p_z,const Color& p_modulate,Light *p_light); + virtual void canvas_debug_viewport_shadows(Light* p_lights_with_shadow); + + virtual void canvas_light_shadow_buffer_update(RID p_buffer, const Transform2D& p_light_xform, int p_light_mask,float p_near, float p_far, LightOccluderInstance* p_occluders, CameraMatrix *p_xform_cache); + + + virtual void reset_canvas(); + + void draw_generic_textured_rect(const Rect2& p_rect, const Rect2& p_src); + + + void initialize(); + void finalize(); + + RasterizerCanvasGLES3(); +}; + +#endif // RASTERIZERCANVASGLES3_H diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp new file mode 100644 index 0000000000..efad6c7e55 --- /dev/null +++ b/drivers/gles3/rasterizer_gles3.cpp @@ -0,0 +1,366 @@ +#include "rasterizer_gles3.h" +#include "os/os.h" +#include "globals.h" +#include "gl_context/context_gl.h" +#include <string.h> +RasterizerStorage *RasterizerGLES3::get_storage() { + + return storage; +} + +RasterizerCanvas *RasterizerGLES3::get_canvas() { + + return canvas; +} + +RasterizerScene *RasterizerGLES3::get_scene() { + + return scene; +} + +#define _EXT_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 +#define _EXT_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 +#define _EXT_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 +#define _EXT_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 +#define _EXT_DEBUG_SOURCE_API_ARB 0x8246 +#define _EXT_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 +#define _EXT_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 +#define _EXT_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 +#define _EXT_DEBUG_SOURCE_APPLICATION_ARB 0x824A +#define _EXT_DEBUG_SOURCE_OTHER_ARB 0x824B +#define _EXT_DEBUG_TYPE_ERROR_ARB 0x824C +#define _EXT_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D +#define _EXT_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E +#define _EXT_DEBUG_TYPE_PORTABILITY_ARB 0x824F +#define _EXT_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 +#define _EXT_DEBUG_TYPE_OTHER_ARB 0x8251 +#define _EXT_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 +#define _EXT_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 +#define _EXT_DEBUG_LOGGED_MESSAGES_ARB 0x9145 +#define _EXT_DEBUG_SEVERITY_HIGH_ARB 0x9146 +#define _EXT_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 +#define _EXT_DEBUG_SEVERITY_LOW_ARB 0x9148 +#define _EXT_DEBUG_OUTPUT 0x92E0 + +#ifdef WINDOWS_ENABLED +#define GLAPIENTRY APIENTRY +#else +#define GLAPIENTRY +#endif + +static void GLAPIENTRY _gl_debug_print(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const GLvoid *userParam) +{ + + if (type==_EXT_DEBUG_TYPE_OTHER_ARB) + return; + + print_line("mesege"); + char debSource[256], debType[256], debSev[256]; + if(source == _EXT_DEBUG_SOURCE_API_ARB) + strcpy(debSource, "OpenGL"); + else if(source == _EXT_DEBUG_SOURCE_WINDOW_SYSTEM_ARB) + strcpy(debSource, "Windows"); + else if(source == _EXT_DEBUG_SOURCE_SHADER_COMPILER_ARB) + strcpy(debSource, "Shader Compiler"); + else if(source == _EXT_DEBUG_SOURCE_THIRD_PARTY_ARB) + strcpy(debSource, "Third Party"); + else if(source == _EXT_DEBUG_SOURCE_APPLICATION_ARB) + strcpy(debSource, "Application"); + else if(source == _EXT_DEBUG_SOURCE_OTHER_ARB) + strcpy(debSource, "Other"); + + if(type == _EXT_DEBUG_TYPE_ERROR_ARB) + strcpy(debType, "Error"); + else if(type == _EXT_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB) + strcpy(debType, "Deprecated behavior"); + else if(type == _EXT_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB) + strcpy(debType, "Undefined behavior"); + else if(type == _EXT_DEBUG_TYPE_PORTABILITY_ARB) + strcpy(debType, "Portability"); + else if(type == _EXT_DEBUG_TYPE_PERFORMANCE_ARB) + strcpy(debType, "Performance"); + else if(type == _EXT_DEBUG_TYPE_OTHER_ARB) + strcpy(debType, "Other"); + + if(severity == _EXT_DEBUG_SEVERITY_HIGH_ARB) + strcpy(debSev, "High"); + else if(severity == _EXT_DEBUG_SEVERITY_MEDIUM_ARB) + strcpy(debSev, "Medium"); + else if(severity == _EXT_DEBUG_SEVERITY_LOW_ARB) + strcpy(debSev, "Low"); + + String output = String()+ "GL ERROR: Source: " + debSource + "\tType: " + debType + "\tID: " + itos(id) + "\tSeverity: " + debSev + "\tMessage: " + message; + + ERR_PRINTS(output); + +} + + +typedef void (*DEBUGPROCARB)(GLenum source, + GLenum type, + GLuint id, + GLenum severity, + GLsizei length, + const char* message, + const void* userParam); + +typedef void (* DebugMessageCallbackARB) (DEBUGPROCARB callback, const void *userParam); + +void RasterizerGLES3::initialize() { + + if (OS::get_singleton()->is_stdout_verbose()) { + print_line("Using GLES3 video driver"); + } + +#ifdef GLEW_ENABLED + GLuint res = glewInit(); + ERR_FAIL_COND(res!=GLEW_OK); + if (OS::get_singleton()->is_stdout_verbose()) { + print_line(String("GLES2: Using GLEW ") + (const char*) glewGetString(GLEW_VERSION)); + } + + // Check for GL 2.1 compatibility, if not bail out + if (!glewIsSupported("GL_VERSION_3_0")) { + ERR_PRINT("Your system's graphic drivers seem not to support OpenGL 3.0+ / GLES 3.0, sorry :(\n" + "Try a drivers update, buy a new GPU or try software rendering on Linux; Godot will now crash with a segmentation fault."); + OS::get_singleton()->alert("Your system's graphic drivers seem not to support OpenGL 3.0+ / GLES 3.0, sorry :(\n" + "Godot Engine will self-destruct as soon as you acknowledge this error message.", + "Fatal error: Insufficient OpenGL / GLES drivers"); + // TODO: If it's even possible, we should stop the execution without segfault and memory leaks :) + } +#endif + +#ifdef GLAD_ENABLED + + if(!gladLoadGL()) { + ERR_PRINT("Error initializing GLAD"); + } + +#ifdef __APPLE__ + // FIXME glDebugMessageCallbackARB does not seem to work on Mac OS X and opengl 3, this may be an issue with our opengl canvas.. +#else + glEnable(_EXT_DEBUG_OUTPUT_SYNCHRONOUS_ARB); + glDebugMessageCallbackARB(_gl_debug_print, NULL); + glEnable(_EXT_DEBUG_OUTPUT); +#endif + +#endif + + +/* glDebugMessageControlARB(GL_DEBUG_SOURCE_API_ARB,GL_DEBUG_TYPE_ERROR_ARB,GL_DEBUG_SEVERITY_HIGH_ARB,0,NULL,GL_TRUE); + glDebugMessageControlARB(GL_DEBUG_SOURCE_API_ARB,GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB,GL_DEBUG_SEVERITY_HIGH_ARB,0,NULL,GL_TRUE); + glDebugMessageControlARB(GL_DEBUG_SOURCE_API_ARB,GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB,GL_DEBUG_SEVERITY_HIGH_ARB,0,NULL,GL_TRUE); + glDebugMessageControlARB(GL_DEBUG_SOURCE_API_ARB,GL_DEBUG_TYPE_PORTABILITY_ARB,GL_DEBUG_SEVERITY_HIGH_ARB,0,NULL,GL_TRUE); + glDebugMessageControlARB(GL_DEBUG_SOURCE_API_ARB,GL_DEBUG_TYPE_PERFORMANCE_ARB,GL_DEBUG_SEVERITY_HIGH_ARB,0,NULL,GL_TRUE); + glDebugMessageControlARB(GL_DEBUG_SOURCE_API_ARB,GL_DEBUG_TYPE_OTHER_ARB,GL_DEBUG_SEVERITY_HIGH_ARB,0,NULL,GL_TRUE); + glDebugMessageInsertARB( + + GL_DEBUG_SOURCE_API_ARB, + GL_DEBUG_TYPE_OTHER_ARB, 1, + GL_DEBUG_SEVERITY_HIGH_ARB,5, "hello"); + +*/ + storage->initialize(); + canvas->initialize(); + scene->initialize(); +} + +void RasterizerGLES3::begin_frame(){ + + uint64_t tick = OS::get_singleton()->get_ticks_usec(); + + double time_total = double(tick)/1000000.0; + + storage->frame.time[0]=time_total; + storage->frame.time[1]=Math::fmod(time_total,3600); + storage->frame.time[2]=Math::fmod(time_total,900); + storage->frame.time[3]=Math::fmod(time_total,60); + storage->frame.count++; + storage->frame.delta = double(tick-storage->frame.prev_tick)/1000000.0; + if (storage->frame.prev_tick==0) { + //to avoid hiccups + storage->frame.delta=0.001; + } + + storage->frame.prev_tick=tick; + + + + storage->update_dirty_multimeshes(); + storage->update_dirty_skeletons(); + storage->update_dirty_shaders(); + storage->update_dirty_materials(); + storage->update_particles(); + + storage->info.render_object_count=0; + storage->info.render_material_switch_count=0; + storage->info.render_surface_switch_count=0; + storage->info.render_shader_rebind_count=0; + storage->info.render_vertices_count=0; + + + scene->iteration(); + + + + +} + +void RasterizerGLES3::set_current_render_target(RID p_render_target){ + + if (!p_render_target.is_valid() && storage->frame.current_rt && storage->frame.clear_request) { + //handle pending clear request, if the framebuffer was not cleared + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->fbo); + print_line("unbind clear of: "+storage->frame.clear_request_color); + glClearColor( + storage->frame.clear_request_color.r, + storage->frame.clear_request_color.g, + storage->frame.clear_request_color.b, + storage->frame.clear_request_color.a ); + + glClear(GL_COLOR_BUFFER_BIT); + + } + + if (p_render_target.is_valid()) { + RasterizerStorageGLES3::RenderTarget * rt = storage->render_target_owner.getornull(p_render_target); + if (!rt) { + storage->frame.current_rt=NULL; + } + ERR_FAIL_COND(!rt); + storage->frame.current_rt=rt; + storage->frame.clear_request=false; + + glViewport(0,0,rt->width,rt->height); + + } else { + storage->frame.current_rt=NULL; + storage->frame.clear_request=false; + glViewport(0,0,OS::get_singleton()->get_window_size().width,OS::get_singleton()->get_window_size().height); + glBindFramebuffer(GL_FRAMEBUFFER,storage->config.system_fbo); + } +} + +void RasterizerGLES3::restore_render_target() { + + ERR_FAIL_COND(storage->frame.current_rt==NULL); + RasterizerStorageGLES3::RenderTarget * rt = storage->frame.current_rt; + glBindFramebuffer(GL_FRAMEBUFFER,rt->fbo); + glViewport(0,0,rt->width,rt->height); + +} + +void RasterizerGLES3::clear_render_target(const Color& p_color) { + + ERR_FAIL_COND(!storage->frame.current_rt); + + storage->frame.clear_request=true; + storage->frame.clear_request_color=p_color; + +} + +void RasterizerGLES3::blit_render_target_to_screen(RID p_render_target,const Rect2& p_screen_rect,int p_screen){ + + ERR_FAIL_COND( storage->frame.current_rt ); + + RasterizerStorageGLES3::RenderTarget *rt = storage->render_target_owner.getornull(p_render_target); + ERR_FAIL_COND(!rt); + + canvas->canvas_begin(); + glDisable(GL_BLEND); + glBindFramebuffer(GL_FRAMEBUFFER,storage->config.system_fbo); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,rt->color); + canvas->draw_generic_textured_rect(p_screen_rect,Rect2(0,0,1,-1)); + glBindTexture(GL_TEXTURE_2D,0); + canvas->canvas_end(); +} + +void RasterizerGLES3::end_frame(){ + +#if 0 + canvas->canvas_begin(); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,storage->resources.white_tex); + glDisable(GL_BLEND); + glDisable(GL_DEPTH_TEST); + glDisable(GL_CULL_FACE); + + + float vtx[8]={0,0, + 0,1, + 1,1, + 1,0 + }; + + glBindBuffer(GL_ARRAY_BUFFER,0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,0); + + glEnableVertexAttribArray(VS::ARRAY_VERTEX); + glVertexAttribPointer( VS::ARRAY_VERTEX, 2 ,GL_FLOAT, false, 0, vtx ); + + +// glBindBuffer(GL_ARRAY_BUFFER,canvas->data.canvas_quad_vertices); +// glEnableVertexAttribArray(VS::ARRAY_VERTEX); +// glVertexAttribPointer( VS::ARRAY_VERTEX, 2 ,GL_FLOAT, false, 0, 0 ); + + glBindVertexArray(canvas->data.canvas_quad_array); + + canvas->draw_generic_textured_rect(Rect2(0,0,15,15),Rect2(0,0,1,1)); +#endif + OS::get_singleton()->swap_buffers(); + +/* print_line("objects: "+itos(storage->info.render_object_count)); + print_line("material chages: "+itos(storage->info.render_material_switch_count)); + print_line("surface changes: "+itos(storage->info.render_surface_switch_count)); + print_line("shader changes: "+itos(storage->info.render_shader_rebind_count)); + print_line("vertices: "+itos(storage->info.render_vertices_count)); +*/ +} + +void RasterizerGLES3::finalize(){ + + storage->finalize(); + canvas->finalize(); +} + + +Rasterizer *RasterizerGLES3::_create_current() { + + return memnew( RasterizerGLES3 ); +} + +void RasterizerGLES3::make_current() { + _create_func=_create_current; +} + + +void RasterizerGLES3::register_config() { + + GLOBAL_DEF("rendering/gles3/render_architecture",0); + GlobalConfig::get_singleton()->set_custom_property_info("rendering/gles3/render_architecture",PropertyInfo(Variant::INT,"",PROPERTY_HINT_ENUM,"Desktop,Mobile")); + GLOBAL_DEF("rendering/quality/use_nearest_mipmap_filter",false); + GLOBAL_DEF("rendering/quality/anisotropic_filter_level",4.0); + +} + +RasterizerGLES3::RasterizerGLES3() +{ + + storage = memnew( RasterizerStorageGLES3 ); + canvas = memnew( RasterizerCanvasGLES3 ); + scene = memnew( RasterizerSceneGLES3 ); + canvas->storage=storage; + storage->canvas=canvas; + scene->storage=storage; + storage->scene=scene; + + + +} + +RasterizerGLES3::~RasterizerGLES3() { + + memdelete(storage); + memdelete(canvas); +} diff --git a/drivers/gles3/rasterizer_gles3.h b/drivers/gles3/rasterizer_gles3.h new file mode 100644 index 0000000000..f70dac506d --- /dev/null +++ b/drivers/gles3/rasterizer_gles3.h @@ -0,0 +1,41 @@ +#ifndef RASTERIZERGLES3_H +#define RASTERIZERGLES3_H + +#include "servers/visual/rasterizer.h" +#include "rasterizer_storage_gles3.h" +#include "rasterizer_canvas_gles3.h" +#include "rasterizer_scene_gles3.h" + + +class RasterizerGLES3 : public Rasterizer { + + static Rasterizer *_create_current(); + + RasterizerStorageGLES3 *storage; + RasterizerCanvasGLES3 *canvas; + RasterizerSceneGLES3 *scene; + +public: + + virtual RasterizerStorage *get_storage(); + virtual RasterizerCanvas *get_canvas(); + virtual RasterizerScene *get_scene(); + + virtual void initialize(); + virtual void begin_frame(); + virtual void set_current_render_target(RID p_render_target); + virtual void restore_render_target(); + virtual void clear_render_target(const Color& p_color); + virtual void blit_render_target_to_screen(RID p_render_target,const Rect2& p_screen_rect,int p_screen=0); + virtual void end_frame(); + virtual void finalize(); + + static void make_current(); + + + static void register_config(); + RasterizerGLES3(); + ~RasterizerGLES3(); +}; + +#endif // RASTERIZERGLES3_H diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp new file mode 100644 index 0000000000..5611b4b63a --- /dev/null +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -0,0 +1,5008 @@ +#include "rasterizer_scene_gles3.h" +#include "globals.h" +#include "os/os.h" +#include "rasterizer_canvas_gles3.h" + +static const GLenum _cube_side_enum[6]={ + + GL_TEXTURE_CUBE_MAP_NEGATIVE_X, + GL_TEXTURE_CUBE_MAP_POSITIVE_X, + GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, + GL_TEXTURE_CUBE_MAP_POSITIVE_Y, + GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, + GL_TEXTURE_CUBE_MAP_POSITIVE_Z, + +}; + + +static _FORCE_INLINE_ void store_transform2d(const Transform2D& p_mtx, float* p_array) { + + p_array[ 0]=p_mtx.elements[0][0]; + p_array[ 1]=p_mtx.elements[0][1]; + p_array[ 2]=0; + p_array[ 3]=0; + p_array[ 4]=p_mtx.elements[1][0]; + p_array[ 5]=p_mtx.elements[1][1]; + p_array[ 6]=0; + p_array[ 7]=0; + p_array[ 8]=0; + p_array[ 9]=0; + p_array[10]=1; + p_array[11]=0; + p_array[12]=p_mtx.elements[2][0]; + p_array[13]=p_mtx.elements[2][1]; + p_array[14]=0; + p_array[15]=1; +} + + +static _FORCE_INLINE_ void store_transform(const Transform& p_mtx, float* p_array) { + p_array[ 0]=p_mtx.basis.elements[0][0]; + p_array[ 1]=p_mtx.basis.elements[1][0]; + p_array[ 2]=p_mtx.basis.elements[2][0]; + p_array[ 3]=0; + p_array[ 4]=p_mtx.basis.elements[0][1]; + p_array[ 5]=p_mtx.basis.elements[1][1]; + p_array[ 6]=p_mtx.basis.elements[2][1]; + p_array[ 7]=0; + p_array[ 8]=p_mtx.basis.elements[0][2]; + p_array[ 9]=p_mtx.basis.elements[1][2]; + p_array[10]=p_mtx.basis.elements[2][2]; + p_array[11]=0; + p_array[12]=p_mtx.origin.x; + p_array[13]=p_mtx.origin.y; + p_array[14]=p_mtx.origin.z; + p_array[15]=1; +} + +static _FORCE_INLINE_ void store_camera(const CameraMatrix& p_mtx, float* p_array) { + + for (int i=0;i<4;i++) { + for (int j=0;j<4;j++) { + + p_array[i*4+j]=p_mtx.matrix[i][j]; + } + } +} + +/* SHADOW ATLAS API */ + +RID RasterizerSceneGLES3::shadow_atlas_create() { + + ShadowAtlas *shadow_atlas = memnew( ShadowAtlas ); + shadow_atlas->fbo=0; + shadow_atlas->depth=0; + shadow_atlas->size=0; + shadow_atlas->smallest_subdiv=0; + + for(int i=0;i<4;i++) { + shadow_atlas->size_order[i]=i; + } + + + return shadow_atlas_owner.make_rid(shadow_atlas); +} + +void RasterizerSceneGLES3::shadow_atlas_set_size(RID p_atlas,int p_size){ + + ShadowAtlas *shadow_atlas = shadow_atlas_owner.getornull(p_atlas); + ERR_FAIL_COND(!shadow_atlas); + ERR_FAIL_COND(p_size<0); + + p_size = nearest_power_of_2(p_size); + + if (p_size==shadow_atlas->size) + return; + + if (shadow_atlas->fbo) { + glDeleteTextures(1,&shadow_atlas->depth); + glDeleteFramebuffers(1,&shadow_atlas->fbo); + + shadow_atlas->depth=0; + shadow_atlas->fbo=0; + + print_line("erasing atlas"); + } + for(int i=0;i<4;i++) { + //clear subdivisions + shadow_atlas->quadrants[i].shadows.resize(0); + shadow_atlas->quadrants[i].shadows.resize( 1<<shadow_atlas->quadrants[i].subdivision ); + } + + //erase shadow atlas reference from lights + for (Map<RID,uint32_t>::Element *E=shadow_atlas->shadow_owners.front();E;E=E->next()) { + LightInstance *li = light_instance_owner.getornull(E->key()); + ERR_CONTINUE(!li); + li->shadow_atlases.erase(p_atlas); + } + + //clear owners + shadow_atlas->shadow_owners.clear(); + + shadow_atlas->size=p_size; + + if (shadow_atlas->size) { + glGenFramebuffers(1, &shadow_atlas->fbo); + glBindFramebuffer(GL_FRAMEBUFFER, shadow_atlas->fbo); + + // Create a texture for storing the depth + glActiveTexture(GL_TEXTURE0); + glGenTextures(1, &shadow_atlas->depth); + glBindTexture(GL_TEXTURE_2D, shadow_atlas->depth); + glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, shadow_atlas->size, shadow_atlas->size, 0, + GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, + GL_TEXTURE_2D, shadow_atlas->depth, 0); + + glViewport(0,0,shadow_atlas->size,shadow_atlas->size); + glClearDepth(0); + glClear(GL_DEPTH_BUFFER_BIT); + + } +} + + +void RasterizerSceneGLES3::shadow_atlas_set_quadrant_subdivision(RID p_atlas,int p_quadrant,int p_subdivision){ + + ShadowAtlas *shadow_atlas = shadow_atlas_owner.getornull(p_atlas); + ERR_FAIL_COND(!shadow_atlas); + ERR_FAIL_INDEX(p_quadrant,4); + ERR_FAIL_INDEX(p_subdivision,16384); + + + uint32_t subdiv = nearest_power_of_2(p_subdivision); + if (subdiv&0xaaaaaaaa) { //sqrt(subdiv) must be integer + subdiv<<=1; + } + + subdiv=int(Math::sqrt(subdiv)); + + //obtain the number that will be x*x + + if (shadow_atlas->quadrants[p_quadrant].subdivision==subdiv) + return; + + //erase all data from quadrant + for(int i=0;i<shadow_atlas->quadrants[p_quadrant].shadows.size();i++) { + + if (shadow_atlas->quadrants[p_quadrant].shadows[i].owner.is_valid()) { + shadow_atlas->shadow_owners.erase(shadow_atlas->quadrants[p_quadrant].shadows[i].owner); + LightInstance *li = light_instance_owner.getornull(shadow_atlas->quadrants[p_quadrant].shadows[i].owner); + ERR_CONTINUE(!li); + li->shadow_atlases.erase(p_atlas); + } + } + + shadow_atlas->quadrants[p_quadrant].shadows.resize(0); + shadow_atlas->quadrants[p_quadrant].shadows.resize(subdiv*subdiv); + shadow_atlas->quadrants[p_quadrant].subdivision=subdiv; + + //cache the smallest subdiv (for faster allocation in light update) + + shadow_atlas->smallest_subdiv=1<<30; + + for(int i=0;i<4;i++) { + if (shadow_atlas->quadrants[i].subdivision) { + shadow_atlas->smallest_subdiv=MIN(shadow_atlas->smallest_subdiv,shadow_atlas->quadrants[i].subdivision); + } + } + + if (shadow_atlas->smallest_subdiv==1<<30) { + shadow_atlas->smallest_subdiv=0; + } + + //resort the size orders, simple bublesort for 4 elements.. + + int swaps=0; + do { + swaps=0; + + for(int i=0;i<3;i++) { + if (shadow_atlas->quadrants[shadow_atlas->size_order[i]].subdivision < shadow_atlas->quadrants[shadow_atlas->size_order[i+1]].subdivision) { + SWAP(shadow_atlas->size_order[i],shadow_atlas->size_order[i+1]); + swaps++; + } + } + } while(swaps>0); + + + + + +} + +bool RasterizerSceneGLES3::_shadow_atlas_find_shadow(ShadowAtlas *shadow_atlas,int *p_in_quadrants,int p_quadrant_count,int p_current_subdiv,uint64_t p_tick,int &r_quadrant,int &r_shadow) { + + + for(int i=p_quadrant_count-1;i>=0;i--) { + + int qidx = p_in_quadrants[i]; + + if (shadow_atlas->quadrants[qidx].subdivision==p_current_subdiv) { + return false; + } + + //look for an empty space + int sc = shadow_atlas->quadrants[qidx].shadows.size(); + ShadowAtlas::Quadrant::Shadow *sarr = shadow_atlas->quadrants[qidx].shadows.ptr(); + + int found_free_idx=-1; //found a free one + int found_used_idx=-1; //found existing one, must steal it + uint64_t min_pass; // pass of the existing one, try to use the least recently used one (LRU fashion) + + for(int j=0;j<sc;j++) { + if (!sarr[j].owner.is_valid()) { + found_free_idx=j; + break; + } + + LightInstance *sli = light_instance_owner.getornull(sarr[j].owner); + ERR_CONTINUE(!sli); + + if (sli->last_scene_pass!=scene_pass) { + + //was just allocated, don't kill it so soon, wait a bit.. + if (p_tick-sarr[j].alloc_tick < shadow_atlas_realloc_tolerance_msec) + continue; + + if (found_used_idx==-1 || sli->last_scene_pass<min_pass) { + found_used_idx=j; + min_pass=sli->last_scene_pass; + } + } + } + + if (found_free_idx==-1 && found_used_idx==-1) + continue; //nothing found + + if (found_free_idx==-1 && found_used_idx!=-1) { + found_free_idx=found_used_idx; + } + + r_quadrant=qidx; + r_shadow=found_free_idx; + + return true; + } + + return false; + +} + + +bool RasterizerSceneGLES3::shadow_atlas_update_light(RID p_atlas, RID p_light_intance, float p_coverage, uint64_t p_light_version){ + + + ShadowAtlas *shadow_atlas = shadow_atlas_owner.getornull(p_atlas); + ERR_FAIL_COND_V(!shadow_atlas,false); + + LightInstance *li = light_instance_owner.getornull(p_light_intance); + ERR_FAIL_COND_V(!li,false); + + if (shadow_atlas->size==0 || shadow_atlas->smallest_subdiv==0) { + return false; + } + + uint32_t quad_size = shadow_atlas->size>>1; + int desired_fit = MIN(quad_size/shadow_atlas->smallest_subdiv,nearest_power_of_2(quad_size*p_coverage)); + + + int valid_quadrants[4]; + int valid_quadrant_count=0; + int best_size=-1; //best size found + int best_subdiv=-1; //subdiv for the best size + + //find the quadrants this fits into, and the best possible size it can fit into + for(int i=0;i<4;i++) { + int q = shadow_atlas->size_order[i]; + int sd = shadow_atlas->quadrants[q].subdivision; + if (sd==0) + continue; //unused + + int max_fit = quad_size / sd; + + if (best_size!=-1 && max_fit>best_size) + break; //too large + + valid_quadrants[valid_quadrant_count++]=q; + best_subdiv=sd; + + if (max_fit>=desired_fit) { + best_size=max_fit; + } + } + + ERR_FAIL_COND_V(valid_quadrant_count==0,false); + + uint64_t tick = OS::get_singleton()->get_ticks_msec(); + + + //see if it already exists + + if (shadow_atlas->shadow_owners.has(p_light_intance)) { + //it does! + uint32_t key = shadow_atlas->shadow_owners[p_light_intance]; + uint32_t q = (key>>ShadowAtlas::QUADRANT_SHIFT)&0x3; + uint32_t s = key&ShadowAtlas::SHADOW_INDEX_MASK; + + bool should_realloc=shadow_atlas->quadrants[q].subdivision!=best_subdiv && (shadow_atlas->quadrants[q].shadows[s].alloc_tick-tick > shadow_atlas_realloc_tolerance_msec); + bool should_redraw=shadow_atlas->quadrants[q].shadows[s].version!=p_light_version; + + + + if (!should_realloc) { + shadow_atlas->quadrants[q].shadows[s].version=p_light_version; + //already existing, see if it should redraw or it's just OK + return should_redraw; + } + + int new_quadrant,new_shadow; + + //find a better place + if (_shadow_atlas_find_shadow(shadow_atlas,valid_quadrants,valid_quadrant_count,shadow_atlas->quadrants[q].subdivision,tick,new_quadrant,new_shadow)) { + //found a better place! + ShadowAtlas::Quadrant::Shadow *sh = &shadow_atlas->quadrants[new_quadrant].shadows[new_shadow]; + if (sh->owner.is_valid()) { + //is taken, but is invalid, erasing it + shadow_atlas->shadow_owners.erase(sh->owner); + LightInstance *sli = light_instance_owner.get(sh->owner); + sli->shadow_atlases.erase(p_atlas); + } + + //erase previous + shadow_atlas->quadrants[q].shadows[s].version=0; + shadow_atlas->quadrants[q].shadows[s].owner=RID(); + + sh->owner=p_light_intance; + sh->alloc_tick=tick; + sh->version=p_light_version; + + //make new key + key=new_quadrant<<ShadowAtlas::QUADRANT_SHIFT; + key|=new_shadow; + //update it in map + shadow_atlas->shadow_owners[p_light_intance]=key; + //make it dirty, as it should redraw anyway + return true; + } + + //no better place for this shadow found, keep current + + //already existing, see if it should redraw or it's just OK + + shadow_atlas->quadrants[q].shadows[s].version=p_light_version; + + return should_redraw; + } + + int new_quadrant,new_shadow; + + //find a better place + if (_shadow_atlas_find_shadow(shadow_atlas,valid_quadrants,valid_quadrant_count,-1,tick,new_quadrant,new_shadow)) { + //found a better place! + ShadowAtlas::Quadrant::Shadow *sh = &shadow_atlas->quadrants[new_quadrant].shadows[new_shadow]; + if (sh->owner.is_valid()) { + //is taken, but is invalid, erasing it + shadow_atlas->shadow_owners.erase(sh->owner); + LightInstance *sli = light_instance_owner.get(sh->owner); + sli->shadow_atlases.erase(p_atlas); + } + + sh->owner=p_light_intance; + sh->alloc_tick=tick; + sh->version=p_light_version; + + //make new key + uint32_t key=new_quadrant<<ShadowAtlas::QUADRANT_SHIFT; + key|=new_shadow; + //update it in map + shadow_atlas->shadow_owners[p_light_intance]=key; + //make it dirty, as it should redraw anyway + + return true; + } + + //no place to allocate this light, apologies + + return false; + + + + +} + +void RasterizerSceneGLES3::set_directional_shadow_count(int p_count) { + + directional_shadow.light_count=p_count; + directional_shadow.current_light=0; +} + +int RasterizerSceneGLES3::get_directional_light_shadow_size(RID p_light_intance) { + + ERR_FAIL_COND_V(directional_shadow.light_count==0,0); + + int shadow_size; + + if (directional_shadow.light_count==1) { + shadow_size = directional_shadow.size; + } else { + shadow_size = directional_shadow.size/2; //more than 4 not supported anyway + } + + LightInstance *light_instance = light_instance_owner.getornull(p_light_intance); + ERR_FAIL_COND_V(!light_instance,0); + + switch(light_instance->light_ptr->directional_shadow_mode) { + case VS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL: break; //none + case VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS: + case VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS: shadow_size/=2; break; + } + + return shadow_size; + +} +////////////////////////////////////////////////////// + +RID RasterizerSceneGLES3::reflection_atlas_create() { + + ReflectionAtlas *reflection_atlas = memnew( ReflectionAtlas ); + reflection_atlas->subdiv=0; + reflection_atlas->color=0; + reflection_atlas->size=0; + for(int i=0;i<6;i++) { + reflection_atlas->fbo[i]=0; + } + + return reflection_atlas_owner.make_rid(reflection_atlas); +} + +void RasterizerSceneGLES3::reflection_atlas_set_size(RID p_ref_atlas,int p_size) { + + ReflectionAtlas *reflection_atlas = reflection_atlas_owner.getornull(p_ref_atlas); + ERR_FAIL_COND(!reflection_atlas); + + int size = nearest_power_of_2(p_size); + + if (size==reflection_atlas->size) + return; + if (reflection_atlas->size) { + for(int i=0;i<6;i++) { + glDeleteFramebuffers(1,&reflection_atlas->fbo[i]); + reflection_atlas->fbo[i]=0; + } + glDeleteTextures(1,&reflection_atlas->color); + reflection_atlas->color=0; + } + + reflection_atlas->size=size; + + for(int i=0;i<reflection_atlas->reflections.size();i++) { + //erase probes reference to this + if (reflection_atlas->reflections[i].owner.is_valid()) { + ReflectionProbeInstance *reflection_probe_instance = reflection_probe_instance_owner.getornull(reflection_atlas->reflections[i].owner); + reflection_atlas->reflections[i].owner=RID(); + + ERR_CONTINUE(!reflection_probe_instance); + reflection_probe_instance->reflection_atlas_index=-1; + reflection_probe_instance->atlas=RID(); + reflection_probe_instance->render_step=-1; + } + } + + + if (reflection_atlas->size) { + + bool use_float=true; + + + GLenum internal_format = use_float?GL_RGBA16F:GL_RGB10_A2; + GLenum format = GL_RGBA; + GLenum type = use_float?GL_HALF_FLOAT:GL_UNSIGNED_INT_2_10_10_10_REV; + + + // Create a texture for storing the color + glActiveTexture(GL_TEXTURE0); + glGenTextures(1, &reflection_atlas->color); + glBindTexture(GL_TEXTURE_2D, reflection_atlas->color); + + int mmsize=reflection_atlas->size; + + for(int i=0;i<6;i++) { + glTexImage2D(GL_TEXTURE_2D, i, internal_format, mmsize, mmsize, 0, + format, type, NULL); + + mmsize>>=1; + } + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 5); + + mmsize=reflection_atlas->size; + + for(int i=0;i<6;i++) { + glGenFramebuffers(1, &reflection_atlas->fbo[i]); + glBindFramebuffer(GL_FRAMEBUFFER, reflection_atlas->fbo[i]); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, reflection_atlas->color, i); + + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + ERR_CONTINUE(status!=GL_FRAMEBUFFER_COMPLETE); + + glDisable(GL_SCISSOR_TEST); + glViewport(0,0,mmsize,mmsize); + glClearColor(0,0,0,0); + glClear(GL_COLOR_BUFFER_BIT); //it needs to be cleared, to avoid generating garbage + + mmsize>>=1; + + } + + + } + + + +} +void RasterizerSceneGLES3::reflection_atlas_set_subdivision(RID p_ref_atlas,int p_subdiv) { + + ReflectionAtlas *reflection_atlas = reflection_atlas_owner.getornull(p_ref_atlas); + ERR_FAIL_COND(!reflection_atlas); + + uint32_t subdiv = nearest_power_of_2(p_subdiv); + if (subdiv&0xaaaaaaaa) { //sqrt(subdiv) must be integer + subdiv<<=1; + } + + subdiv=int(Math::sqrt(subdiv)); + + if (reflection_atlas->subdiv==subdiv) + return; + + + if (subdiv) { + + for(int i=0;i<reflection_atlas->reflections.size();i++) { + //erase probes reference to this + if (reflection_atlas->reflections[i].owner.is_valid()) { + ReflectionProbeInstance *reflection_probe_instance = reflection_probe_instance_owner.getornull(reflection_atlas->reflections[i].owner); + reflection_atlas->reflections[i].owner=RID(); + + ERR_CONTINUE(!reflection_probe_instance); + reflection_probe_instance->reflection_atlas_index=-1; + reflection_probe_instance->atlas=RID(); + reflection_probe_instance->render_step=-1; + } + } + } + + reflection_atlas->subdiv=subdiv; + + reflection_atlas->reflections.resize(subdiv*subdiv); +} + + +//////////////////////////////////////////////////// + +RID RasterizerSceneGLES3::reflection_probe_instance_create(RID p_probe) { + + RasterizerStorageGLES3::ReflectionProbe *probe = storage->reflection_probe_owner.getornull(p_probe); + ERR_FAIL_COND_V(!probe,RID()); + + ReflectionProbeInstance *rpi = memnew( ReflectionProbeInstance ); + + rpi->probe_ptr=probe; + rpi->self=reflection_probe_instance_owner.make_rid(rpi); + rpi->probe=p_probe; + rpi->reflection_atlas_index=-1; + rpi->render_step=-1; + rpi->last_pass=0; + + return rpi->self; +} + +void RasterizerSceneGLES3::reflection_probe_instance_set_transform(RID p_instance,const Transform& p_transform) { + + ReflectionProbeInstance *rpi = reflection_probe_instance_owner.getornull(p_instance); + ERR_FAIL_COND(!rpi); + rpi->transform=p_transform; + +} + +void RasterizerSceneGLES3::reflection_probe_release_atlas_index(RID p_instance) { + + ReflectionProbeInstance *rpi = reflection_probe_instance_owner.getornull(p_instance); + ERR_FAIL_COND(!rpi); + if (rpi->reflection_atlas_index==-1) + return; + + ReflectionAtlas *reflection_atlas = reflection_atlas_owner.getornull(rpi->atlas); + ERR_FAIL_COND(!reflection_atlas); + + ERR_FAIL_INDEX(rpi->reflection_atlas_index,reflection_atlas->reflections.size()); + + ERR_FAIL_COND(reflection_atlas->reflections[rpi->reflection_atlas_index].owner!=rpi->self); + + reflection_atlas->reflections[rpi->reflection_atlas_index].owner=RID(); + + rpi->reflection_atlas_index=-1; + rpi->atlas=RID(); + rpi->render_step=-1; + +} + +bool RasterizerSceneGLES3::reflection_probe_instance_needs_redraw(RID p_instance) { + + ReflectionProbeInstance *rpi = reflection_probe_instance_owner.getornull(p_instance); + ERR_FAIL_COND_V(!rpi,false); + + return rpi->reflection_atlas_index==-1 || rpi->probe_ptr->update_mode==VS::REFLECTION_PROBE_UPDATE_ALWAYS; +} + +bool RasterizerSceneGLES3::reflection_probe_instance_has_reflection(RID p_instance){ + + ReflectionProbeInstance *rpi = reflection_probe_instance_owner.getornull(p_instance); + ERR_FAIL_COND_V(!rpi,false); + + return rpi->reflection_atlas_index!=-1; +} + +bool RasterizerSceneGLES3::reflection_probe_instance_begin_render(RID p_instance,RID p_reflection_atlas) { + + ReflectionProbeInstance *rpi = reflection_probe_instance_owner.getornull(p_instance); + ERR_FAIL_COND_V(!rpi,false); + + rpi->render_step=0; + + if (rpi->reflection_atlas_index!=-1) { + return true; //got one already + } + + ReflectionAtlas *reflection_atlas = reflection_atlas_owner.getornull(p_reflection_atlas); + ERR_FAIL_COND_V(!reflection_atlas,false); + + + if (reflection_atlas->size==0 || reflection_atlas->subdiv==0) { + return false; + } + + + int best_free=-1; + int best_used=-1; + uint64_t best_used_frame; + + for(int i=0;i<reflection_atlas->reflections.size();i++) { + if (reflection_atlas->reflections[i].owner==RID()) { + best_free=i; + break; + } + + if (rpi->render_step<0 && reflection_atlas->reflections[i].last_frame<storage->frame.count && + (best_used==-1 || reflection_atlas->reflections[i].last_frame<best_used_frame)) { + best_used=i; + best_used_frame=reflection_atlas->reflections[i].last_frame; + } + } + + if (best_free==-1 && best_used==-1) { + return false ;// sorry, can not do. Try again next frame. + } + + if (best_free==-1) { + //find best from what is used + best_free=best_used; + + ReflectionProbeInstance *victim_rpi = reflection_probe_instance_owner.getornull(reflection_atlas->reflections[best_free].owner); + ERR_FAIL_COND_V(!victim_rpi,false); + victim_rpi->atlas=RID(); + victim_rpi->reflection_atlas_index=-1; + + } + + reflection_atlas->reflections[best_free].owner=p_instance; + reflection_atlas->reflections[best_free].last_frame=storage->frame.count; + + rpi->reflection_atlas_index=best_free; + rpi->atlas=p_reflection_atlas; + rpi->render_step=0; + + return true; +} + +bool RasterizerSceneGLES3::reflection_probe_instance_postprocess_step(RID p_instance) { + + ReflectionProbeInstance *rpi = reflection_probe_instance_owner.getornull(p_instance); + ERR_FAIL_COND_V(!rpi,true); + + ReflectionAtlas *reflection_atlas = reflection_atlas_owner.getornull(rpi->atlas); + ERR_FAIL_COND_V(!reflection_atlas,false); + + ERR_FAIL_COND_V(rpi->render_step>=6,true); + + glBindFramebuffer(GL_FRAMEBUFFER,reflection_atlas->fbo[rpi->render_step]); + state.cube_to_dp_shader.bind(); + + int target_size=reflection_atlas->size/reflection_atlas->subdiv; + + int cubemap_index=reflection_cubemaps.size()-1; + + for(int i=reflection_cubemaps.size()-1;i>=0;i--) { + //find appropriate cubemap to render to + if (reflection_cubemaps[i].size>target_size*2) + break; + + cubemap_index=i; + } + + glDisable(GL_BLEND); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_CUBE_MAP,reflection_cubemaps[cubemap_index].cubemap); + glDisable(GL_CULL_FACE); + + storage->shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_DUAL_PARABOLOID,true); + storage->shaders.cubemap_filter.bind(); + + int cell_size = reflection_atlas->size / reflection_atlas->subdiv; + for(int i=0;i<rpi->render_step;i++) { + cell_size>>=1; //mipmaps! + } + int x = (rpi->reflection_atlas_index % reflection_atlas->subdiv) * cell_size; + int y = (rpi->reflection_atlas_index / reflection_atlas->subdiv) * cell_size; + int width=cell_size; + int height=cell_size; + + storage->shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_DIRECT_WRITE,rpi->render_step==0); + storage->shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::LOW_QUALITY,rpi->probe_ptr->update_mode==VS::REFLECTION_PROBE_UPDATE_ALWAYS); + for(int i=0;i<2;i++) { + + storage->shaders.cubemap_filter.set_uniform(CubemapFilterShaderGLES3::Z_FLIP,i>0); + storage->shaders.cubemap_filter.set_uniform(CubemapFilterShaderGLES3::ROUGHNESS,rpi->render_step/5.0); + + uint32_t local_width=width,local_height=height; + uint32_t local_x=x,local_y=y; + + local_height/=2; + local_y+=i*local_height; + + glViewport(local_x,local_y,local_width,local_height); + + _copy_screen(); + } + storage->shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_DIRECT_WRITE,false); + storage->shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::LOW_QUALITY,false); + + + rpi->render_step++; + + return rpi->render_step==6; +} + +/* ENVIRONMENT API */ + +RID RasterizerSceneGLES3::environment_create(){ + + + Environment *env = memnew( Environment ); + + return environment_owner.make_rid(env); +} + +void RasterizerSceneGLES3::environment_set_background(RID p_env,VS::EnvironmentBG p_bg){ + + Environment *env=environment_owner.getornull(p_env); + ERR_FAIL_COND(!env); + env->bg_mode=p_bg; +} + +void RasterizerSceneGLES3::environment_set_skybox(RID p_env, RID p_skybox){ + + Environment *env=environment_owner.getornull(p_env); + ERR_FAIL_COND(!env); + + env->skybox=p_skybox; + +} + +void RasterizerSceneGLES3::environment_set_skybox_scale(RID p_env,float p_scale) { + + Environment *env=environment_owner.getornull(p_env); + ERR_FAIL_COND(!env); + + env->skybox_scale=p_scale; + +} + +void RasterizerSceneGLES3::environment_set_bg_color(RID p_env,const Color& p_color){ + + Environment *env=environment_owner.getornull(p_env); + ERR_FAIL_COND(!env); + + env->bg_color=p_color; + +} +void RasterizerSceneGLES3::environment_set_bg_energy(RID p_env,float p_energy) { + + Environment *env=environment_owner.getornull(p_env); + ERR_FAIL_COND(!env); + + env->bg_energy=p_energy; + +} + +void RasterizerSceneGLES3::environment_set_canvas_max_layer(RID p_env,int p_max_layer){ + + Environment *env=environment_owner.getornull(p_env); + ERR_FAIL_COND(!env); + + env->canvas_max_layer=p_max_layer; + +} +void RasterizerSceneGLES3::environment_set_ambient_light(RID p_env, const Color& p_color, float p_energy, float p_skybox_contribution){ + + Environment *env=environment_owner.getornull(p_env); + ERR_FAIL_COND(!env); + + env->ambient_color=p_color; + env->ambient_energy=p_energy; + env->ambient_skybox_contribution=p_skybox_contribution; + +} + + + +void RasterizerSceneGLES3::environment_set_dof_blur_far(RID p_env,bool p_enable,float p_distance,float p_transition,float p_amount,VS::EnvironmentDOFBlurQuality p_quality){ + + Environment *env=environment_owner.getornull(p_env); + ERR_FAIL_COND(!env); + + env->dof_blur_far_enabled=p_enable; + env->dof_blur_far_distance=p_distance; + env->dof_blur_far_transition=p_transition; + env->dof_blur_far_amount=p_amount; + env->dof_blur_far_quality=p_quality; + + +} + +void RasterizerSceneGLES3::environment_set_dof_blur_near(RID p_env,bool p_enable,float p_distance,float p_transition,float p_amount,VS::EnvironmentDOFBlurQuality p_quality){ + + Environment *env=environment_owner.getornull(p_env); + ERR_FAIL_COND(!env); + + env->dof_blur_near_enabled=p_enable; + env->dof_blur_near_distance=p_distance; + env->dof_blur_near_transition=p_transition; + env->dof_blur_near_amount=p_amount; + env->dof_blur_near_quality=p_quality; + + +} +void RasterizerSceneGLES3::environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_bloom_treshold, VS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_treshold, float p_hdr_bleed_scale, bool p_bicubic_upscale) { + + Environment *env=environment_owner.getornull(p_env); + ERR_FAIL_COND(!env); + + env->glow_enabled=p_enable; + env->glow_levels=p_level_flags; + env->glow_intensity=p_intensity; + env->glow_strength=p_strength; + env->glow_bloom=p_bloom_treshold; + env->glow_blend_mode=p_blend_mode; + env->glow_hdr_bleed_treshold=p_hdr_bleed_treshold; + env->glow_hdr_bleed_scale=p_hdr_bleed_scale; + env->glow_bicubic_upscale=p_bicubic_upscale; + +} +void RasterizerSceneGLES3::environment_set_fog(RID p_env,bool p_enable,float p_begin,float p_end,RID p_gradient_texture){ + +} + +void RasterizerSceneGLES3::environment_set_ssr(RID p_env,bool p_enable, int p_max_steps,float p_accel,float p_fade,float p_depth_tolerance,bool p_smooth,bool p_roughness) { + + Environment *env=environment_owner.getornull(p_env); + ERR_FAIL_COND(!env); + + env->ssr_enabled=p_enable; + env->ssr_max_steps=p_max_steps; + env->ssr_accel=p_accel; + env->ssr_fade=p_fade; + env->ssr_depth_tolerance=p_depth_tolerance; + env->ssr_smooth=p_smooth; + env->ssr_roughness=p_roughness; + +} + + +void RasterizerSceneGLES3::environment_set_ssao(RID p_env,bool p_enable, float p_radius, float p_intensity, float p_radius2, float p_intensity2, float p_bias, float p_light_affect,const Color &p_color,bool p_blur) { + + Environment *env=environment_owner.getornull(p_env); + ERR_FAIL_COND(!env); + + env->ssao_enabled=p_enable; + env->ssao_radius=p_radius; + env->ssao_intensity=p_intensity; + env->ssao_radius2=p_radius2; + env->ssao_intensity2=p_intensity2; + env->ssao_bias=p_bias; + env->ssao_light_affect=p_light_affect; + env->ssao_color=p_color; + env->ssao_filter=p_blur; + +} + +void RasterizerSceneGLES3::environment_set_tonemap(RID p_env,VS::EnvironmentToneMapper p_tone_mapper,float p_exposure,float p_white,bool p_auto_exposure,float p_min_luminance,float p_max_luminance,float p_auto_exp_speed,float p_auto_exp_scale) { + + Environment *env=environment_owner.getornull(p_env); + ERR_FAIL_COND(!env); + + + env->tone_mapper=p_tone_mapper; + env->tone_mapper_exposure=p_exposure; + env->tone_mapper_exposure_white=p_white; + env->auto_exposure=p_auto_exposure; + env->auto_exposure_speed=p_auto_exp_speed; + env->auto_exposure_min=p_min_luminance; + env->auto_exposure_max=p_max_luminance; + env->auto_exposure_grey=p_auto_exp_scale; + +} + + +void RasterizerSceneGLES3::environment_set_adjustment(RID p_env,bool p_enable,float p_brightness,float p_contrast,float p_saturation,RID p_ramp) { + + +} + + +RID RasterizerSceneGLES3::light_instance_create(RID p_light) { + + + LightInstance *light_instance = memnew( LightInstance ); + + light_instance->last_pass=0; + light_instance->last_scene_pass=0; + light_instance->last_scene_shadow_pass=0; + + light_instance->light=p_light; + light_instance->light_ptr=storage->light_owner.getornull(p_light); + + ERR_FAIL_COND_V(!light_instance->light_ptr,RID()); + + light_instance->self=light_instance_owner.make_rid(light_instance); + + return light_instance->self; +} + +void RasterizerSceneGLES3::light_instance_set_transform(RID p_light_instance,const Transform& p_transform){ + + LightInstance *light_instance = light_instance_owner.getornull(p_light_instance); + ERR_FAIL_COND(!light_instance); + + light_instance->transform=p_transform; +} + +void RasterizerSceneGLES3::light_instance_set_shadow_transform(RID p_light_instance,const CameraMatrix& p_projection,const Transform& p_transform,float p_far,float p_split,int p_pass) { + + LightInstance *light_instance = light_instance_owner.getornull(p_light_instance); + ERR_FAIL_COND(!light_instance); + + if (light_instance->light_ptr->type!=VS::LIGHT_DIRECTIONAL) { + p_pass=0; + } + + ERR_FAIL_INDEX(p_pass,4); + + light_instance->shadow_transform[p_pass].camera=p_projection; + light_instance->shadow_transform[p_pass].transform=p_transform; + light_instance->shadow_transform[p_pass].farplane=p_far; + light_instance->shadow_transform[p_pass].split=p_split; + +} + + +void RasterizerSceneGLES3::light_instance_mark_visible(RID p_light_instance) { + + LightInstance *light_instance = light_instance_owner.getornull(p_light_instance); + ERR_FAIL_COND(!light_instance); + + light_instance->last_scene_pass=scene_pass; +} + + +////////////////////// + +RID RasterizerSceneGLES3::gi_probe_instance_create() { + + GIProbeInstance *gipi = memnew(GIProbeInstance); + + return gi_probe_instance_owner.make_rid(gipi); +} + +void RasterizerSceneGLES3::gi_probe_instance_set_light_data(RID p_probe, RID p_base, RID p_data) { + + GIProbeInstance *gipi = gi_probe_instance_owner.getornull(p_probe); + ERR_FAIL_COND(!gipi); + gipi->data=p_data; + gipi->probe=storage->gi_probe_owner.getornull(p_base); + if (p_data.is_valid()) { + RasterizerStorageGLES3::GIProbeData *gipd = storage->gi_probe_data_owner.getornull(p_data); + ERR_FAIL_COND(!gipd); + if (gipd) { + gipi->tex_cache=gipd->tex_id; + gipi->cell_size_cache.x=1.0/gipd->width; + gipi->cell_size_cache.y=1.0/gipd->height; + gipi->cell_size_cache.z=1.0/gipd->depth; + } + } +} +void RasterizerSceneGLES3::gi_probe_instance_set_transform_to_data(RID p_probe,const Transform& p_xform) { + + GIProbeInstance *gipi = gi_probe_instance_owner.getornull(p_probe); + ERR_FAIL_COND(!gipi); + gipi->transform_to_data=p_xform; + +} + +void RasterizerSceneGLES3::gi_probe_instance_set_bounds(RID p_probe,const Vector3& p_bounds) { + + GIProbeInstance *gipi = gi_probe_instance_owner.getornull(p_probe); + ERR_FAIL_COND(!gipi); + gipi->bounds=p_bounds; + +} + +//////////////////////////// +//////////////////////////// +//////////////////////////// + +bool RasterizerSceneGLES3::_setup_material(RasterizerStorageGLES3::Material* p_material,bool p_alpha_pass) { + + if (p_material->shader->spatial.cull_mode==RasterizerStorageGLES3::Shader::Spatial::CULL_MODE_DISABLED) { + glDisable(GL_CULL_FACE); + } else { + glEnable(GL_CULL_FACE); + } + + if (state.current_line_width!=p_material->line_width) { + //glLineWidth(MAX(p_material->line_width,1.0)); + state.current_line_width=p_material->line_width; + } + + if (state.current_depth_draw!=p_material->shader->spatial.depth_draw_mode) { + switch(p_material->shader->spatial.depth_draw_mode) { + case RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS: + case RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_OPAQUE: { + + glDepthMask(!p_alpha_pass); + } break; + case RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALWAYS: { + glDepthMask(GL_TRUE); + } break; + case RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_NEVER: { + glDepthMask(GL_FALSE); + } break; + } + + state.current_depth_draw=p_material->shader->spatial.depth_draw_mode; + } + + //glPolygonMode(GL_FRONT_AND_BACK,GL_LINE); + + /* + if (p_material->flags[VS::MATERIAL_FLAG_WIREFRAME]) + glPolygonMode(GL_FRONT_AND_BACK,GL_LINE); + else + glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); + */ + + //if (p_material->line_width) + // glLineWidth(p_material->line_width); + +#if 0 + //blend mode + if (state.current_blend_mode!=p_material->shader->spatial.blend_mode) { + + switch(p_material->shader->spatial.blend_mode) { + + case RasterizerStorageGLES3::Shader::Spatial::BLEND_MODE_MIX: { + glBlendEquation(GL_FUNC_ADD); + if (storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT]) { + glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + } else { + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + } + + } break; + case RasterizerStorageGLES3::Shader::Spatial::BLEND_MODE_ADD: { + + glBlendEquation(GL_FUNC_ADD); + glBlendFunc(p_alpha_pass?GL_SRC_ALPHA:GL_ONE,GL_ONE); + + } break; + case RasterizerStorageGLES3::Shader::Spatial::BLEND_MODE_SUB: { + + glBlendEquation(GL_FUNC_REVERSE_SUBTRACT); + glBlendFunc(GL_SRC_ALPHA,GL_ONE); + } break; + case RasterizerStorageGLES3::Shader::Spatial::BLEND_MODE_MUL: { + glBlendEquation(GL_FUNC_ADD); + if (storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT]) { + glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + } else { + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + } + + } break; + } + + state.current_blend_mode=p_material->shader->spatial.blend_mode; + + } +#endif + //material parameters + + + state.scene_shader.set_custom_shader(p_material->shader->custom_code_id); + bool rebind = state.scene_shader.bind(); + + + if (p_material->ubo_id) { + + glBindBufferBase(GL_UNIFORM_BUFFER,1,p_material->ubo_id); + } + + + + int tc = p_material->textures.size(); + RID* textures = p_material->textures.ptr(); + ShaderLanguage::ShaderNode::Uniform::Hint* texture_hints = p_material->shader->texture_hints.ptr(); + + state.current_main_tex=0; + + for(int i=0;i<tc;i++) { + + glActiveTexture(GL_TEXTURE0+i); + + GLenum target; + GLuint tex; + + RasterizerStorageGLES3::Texture *t = storage->texture_owner.getornull( textures[i] ); + + if (!t) { + //check hints + target=GL_TEXTURE_2D; + + switch(texture_hints[i]) { + case ShaderLanguage::ShaderNode::Uniform::HINT_BLACK_ALBEDO: + case ShaderLanguage::ShaderNode::Uniform::HINT_BLACK: { + tex=storage->resources.black_tex; + } break; + case ShaderLanguage::ShaderNode::Uniform::HINT_ANISO: { + tex=storage->resources.aniso_tex; + } break; + case ShaderLanguage::ShaderNode::Uniform::HINT_NORMAL: { + tex=storage->resources.normal_tex; + } break; + default: { + tex=storage->resources.white_tex; + } break; + } + + + } else { + + if (storage->config.srgb_decode_supported) { + //if SRGB decode extension is present, simply switch the texture to whathever is needed + bool must_srgb=false; + + if (t->srgb && (texture_hints[i]==ShaderLanguage::ShaderNode::Uniform::HINT_ALBEDO || texture_hints[i]==ShaderLanguage::ShaderNode::Uniform::HINT_BLACK_ALBEDO)) { + must_srgb=true; + } + + if (t->using_srgb!=must_srgb) { + if (must_srgb) { + glTexParameteri(t->target,_TEXTURE_SRGB_DECODE_EXT,_DECODE_EXT); +#ifdef TOOLS_ENABLED + if (!(t->flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) { + t->flags|=VS::TEXTURE_FLAG_CONVERT_TO_LINEAR; + //notify that texture must be set to linear beforehand, so it works in other platforms when exported + } +#endif + + } else { + glTexParameteri(t->target,_TEXTURE_SRGB_DECODE_EXT,_SKIP_DECODE_EXT); + } + t->using_srgb=must_srgb; + } + } + + target=t->target; + tex = t->tex_id; + + } + + glBindTexture(target,tex); + + if (i==0) { + state.current_main_tex=tex; + } + } + + + return rebind; + +} + + +void RasterizerSceneGLES3::_setup_geometry(RenderList::Element *e) { + + switch(e->instance->base_type) { + + case VS::INSTANCE_MESH: { + + RasterizerStorageGLES3::Surface *s = static_cast<RasterizerStorageGLES3::Surface*>(e->geometry); + + if (s->morph_targets.size() && e->instance->morph_values.size()) { + //blend shapes, use transform feedback + storage->mesh_render_blend_shapes(s,e->instance->morph_values.ptr()); + //rebind shader + state.scene_shader.bind(); + } else { + + glBindVertexArray(s->array_id); // everything is so easy nowadays + } + + } break; + + case VS::INSTANCE_MULTIMESH: { + + RasterizerStorageGLES3::MultiMesh *multi_mesh = static_cast<RasterizerStorageGLES3::MultiMesh*>(e->owner); + RasterizerStorageGLES3::Surface *s = static_cast<RasterizerStorageGLES3::Surface*>(e->geometry); + glBindVertexArray(s->instancing_array_id); // use the instancing array ID + glBindBuffer(GL_ARRAY_BUFFER,multi_mesh->buffer); //modify the buffer + + int stride = (multi_mesh->xform_floats+multi_mesh->color_floats)*4; + glEnableVertexAttribArray(8); + glVertexAttribPointer(8,4,GL_FLOAT,GL_FALSE,stride,((uint8_t*)NULL)+0); + glVertexAttribDivisor(8,1); + glEnableVertexAttribArray(9); + glVertexAttribPointer(9,4,GL_FLOAT,GL_FALSE,stride,((uint8_t*)NULL)+4*4); + glVertexAttribDivisor(9,1); + + int color_ofs; + + if (multi_mesh->transform_format==VS::MULTIMESH_TRANSFORM_3D) { + glEnableVertexAttribArray(10); + glVertexAttribPointer(10,4,GL_FLOAT,GL_FALSE,stride,((uint8_t*)NULL)+8*4); + glVertexAttribDivisor(10,1); + color_ofs=12*4; + } else { + glDisableVertexAttribArray(10); + glVertexAttrib4f(10,0,0,1,0); + color_ofs=8*4; + } + + switch(multi_mesh->color_format) { + + case VS::MULTIMESH_COLOR_NONE: { + glDisableVertexAttribArray(11); + glVertexAttrib4f(11,1,1,1,1); + } break; + case VS::MULTIMESH_COLOR_8BIT: { + glEnableVertexAttribArray(11); + glVertexAttribPointer(11,4,GL_UNSIGNED_BYTE,GL_TRUE,stride,((uint8_t*)NULL)+color_ofs); + glVertexAttribDivisor(11,1); + + } break; + case VS::MULTIMESH_COLOR_FLOAT: { + glEnableVertexAttribArray(11); + glVertexAttribPointer(11,4,GL_FLOAT,GL_FALSE,stride,((uint8_t*)NULL)+color_ofs); + glVertexAttribDivisor(11,1); + } break; + } + + } break; + } + +} + +static const GLenum gl_primitive[]={ + GL_POINTS, + GL_LINES, + GL_LINE_STRIP, + GL_LINE_LOOP, + GL_TRIANGLES, + GL_TRIANGLE_STRIP, + GL_TRIANGLE_FAN +}; + + + +void RasterizerSceneGLES3::_render_geometry(RenderList::Element *e) { + + switch(e->instance->base_type) { + + case VS::INSTANCE_MESH: { + + RasterizerStorageGLES3::Surface *s = static_cast<RasterizerStorageGLES3::Surface*>(e->geometry); + + if (s->index_array_len>0) { + + + glDrawElements(gl_primitive[s->primitive],s->index_array_len, (s->array_len>=(1<<16))?GL_UNSIGNED_INT:GL_UNSIGNED_SHORT,0); + + storage->info.render_vertices_count+=s->index_array_len; + + } else { + + glDrawArrays(gl_primitive[s->primitive],0,s->array_len); + + storage->info.render_vertices_count+=s->array_len; + + } + + + + + } break; + case VS::INSTANCE_MULTIMESH: { + + RasterizerStorageGLES3::MultiMesh *multi_mesh = static_cast<RasterizerStorageGLES3::MultiMesh*>(e->owner); + RasterizerStorageGLES3::Surface *s = static_cast<RasterizerStorageGLES3::Surface*>(e->geometry); + + int amount = MAX(multi_mesh->size,multi_mesh->visible_instances); + + if (s->index_array_len>0) { + + glDrawElementsInstanced(gl_primitive[s->primitive],s->index_array_len, (s->array_len>=(1<<16))?GL_UNSIGNED_INT:GL_UNSIGNED_SHORT,0,amount); + + storage->info.render_vertices_count+=s->index_array_len * amount; + + } else { + + glDrawArraysInstanced(gl_primitive[s->primitive],0,s->array_len,amount); + + storage->info.render_vertices_count+=s->array_len * amount; + + } + + } break; + case VS::INSTANCE_IMMEDIATE: { + + bool restore_tex=false; + const RasterizerStorageGLES3::Immediate *im = static_cast<const RasterizerStorageGLES3::Immediate*>( e->geometry ); + + if (im->building) { + return; + } + + glBindBuffer(GL_ARRAY_BUFFER, state.immediate_buffer); + glBindVertexArray(state.immediate_array); + + + for(const List< RasterizerStorageGLES3::Immediate::Chunk>::Element *E=im->chunks.front();E;E=E->next()) { + + const RasterizerStorageGLES3::Immediate::Chunk &c=E->get(); + if (c.vertices.empty()) { + continue; + } + + int vertices = c.vertices.size(); + uint32_t buf_ofs=0; + + storage->info.render_vertices_count+=vertices; + + if (c.texture.is_valid() && storage->texture_owner.owns(c.texture)) { + + const RasterizerStorageGLES3::Texture *t = storage->texture_owner.get(c.texture); + glActiveTexture(GL_TEXTURE0); + glBindTexture(t->target,t->tex_id); + restore_tex=true; + + + } else if (restore_tex) { + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,state.current_main_tex); + restore_tex=false; + } + + + + if (!c.normals.empty()) { + + glEnableVertexAttribArray(VS::ARRAY_NORMAL); + glBufferSubData(GL_ARRAY_BUFFER,0,sizeof(Vector3)*vertices,c.normals.ptr()); + glVertexAttribPointer(VS::ARRAY_NORMAL, 3, GL_FLOAT, false,sizeof(Vector3)*vertices,((uint8_t*)NULL)+buf_ofs); + buf_ofs+=sizeof(Vector3)*vertices; + + } else { + + glDisableVertexAttribArray(VS::ARRAY_NORMAL); + } + + if (!c.tangents.empty()) { + + glEnableVertexAttribArray(VS::ARRAY_TANGENT); + glBufferSubData(GL_ARRAY_BUFFER,0,sizeof(Plane)*vertices,c.tangents.ptr()); + glVertexAttribPointer(VS::ARRAY_TANGENT, 4, GL_FLOAT, false,sizeof(Plane)*vertices,((uint8_t*)NULL)+buf_ofs); + buf_ofs+=sizeof(Plane)*vertices; + + } else { + + glDisableVertexAttribArray(VS::ARRAY_TANGENT); + } + + if (!c.colors.empty()) { + + glEnableVertexAttribArray(VS::ARRAY_COLOR); + glBufferSubData(GL_ARRAY_BUFFER,0,sizeof(Color)*vertices,c.colors.ptr()); + glVertexAttribPointer(VS::ARRAY_COLOR, 4, GL_FLOAT, false,sizeof(Color),((uint8_t*)NULL)+buf_ofs); + buf_ofs+=sizeof(Color)*vertices; + + } else { + + glDisableVertexAttribArray(VS::ARRAY_COLOR); + glVertexAttrib4f(VS::ARRAY_COLOR,1,1,1,1); + } + + + if (!c.uvs.empty()) { + + glEnableVertexAttribArray(VS::ARRAY_TEX_UV); + glBufferSubData(GL_ARRAY_BUFFER,0,sizeof(Vector2)*vertices,c.uvs.ptr()); + glVertexAttribPointer(VS::ARRAY_TEX_UV, 2, GL_FLOAT, false,sizeof(Vector2),((uint8_t*)NULL)+buf_ofs); + buf_ofs+=sizeof(Vector2)*vertices; + + } else { + + glDisableVertexAttribArray(VS::ARRAY_TEX_UV); + } + + if (!c.uvs2.empty()) { + + glEnableVertexAttribArray(VS::ARRAY_TEX_UV2); + glBufferSubData(GL_ARRAY_BUFFER,0,sizeof(Vector2)*vertices,c.uvs2.ptr()); + glVertexAttribPointer(VS::ARRAY_TEX_UV2, 2, GL_FLOAT, false,sizeof(Vector2),((uint8_t*)NULL)+buf_ofs); + buf_ofs+=sizeof(Vector2)*vertices; + + } else { + + glDisableVertexAttribArray(VS::ARRAY_TEX_UV2); + } + + + glEnableVertexAttribArray(VS::ARRAY_VERTEX); + glBufferSubData(GL_ARRAY_BUFFER,0,sizeof(Vector3)*vertices,c.vertices.ptr()); + glVertexAttribPointer(VS::ARRAY_VERTEX, 3, GL_FLOAT, false,sizeof(Vector3),((uint8_t*)NULL)+buf_ofs); + glDrawArrays(gl_primitive[c.primitive],0,c.vertices.size()); + + + } + + + if (restore_tex) { + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,state.current_main_tex); + restore_tex=false; + } + } break; + + } + +} + +void RasterizerSceneGLES3::_setup_light(RenderList::Element *e,const Transform& p_view_transform) { + + int omni_indices[16]; + int omni_count=0; + int spot_indices[16]; + int spot_count=0; + int reflection_indices[16]; + int reflection_count=0; + + int maxobj = MIN(16,state.max_forward_lights_per_object); + + int lc = e->instance->light_instances.size(); + if (lc) { + + const RID* lights=e->instance->light_instances.ptr(); + + for(int i=0;i<lc;i++) { + LightInstance *li=light_instance_owner.getptr(lights[i]); + if (li->last_pass!=render_pass) //not visible + continue; + + if (li->light_ptr->type==VS::LIGHT_OMNI) { + if (omni_count<maxobj && e->instance->layer_mask&li->light_ptr->cull_mask) { + omni_indices[omni_count++]=li->light_index; + } + } + + if (li->light_ptr->type==VS::LIGHT_SPOT) { + if (spot_count<maxobj && e->instance->layer_mask&li->light_ptr->cull_mask) { + spot_indices[spot_count++]=li->light_index; + } + } + } + } + + state.scene_shader.set_uniform(SceneShaderGLES3::OMNI_LIGHT_COUNT,omni_count); + + if (omni_count) { + glUniform1iv(state.scene_shader.get_uniform(SceneShaderGLES3::OMNI_LIGHT_INDICES),omni_count,omni_indices); + } + + state.scene_shader.set_uniform(SceneShaderGLES3::SPOT_LIGHT_COUNT,spot_count); + if (spot_count) { + glUniform1iv(state.scene_shader.get_uniform(SceneShaderGLES3::SPOT_LIGHT_INDICES),spot_count,spot_indices); + } + + + int rc = e->instance->reflection_probe_instances.size(); + + + if (rc) { + + + const RID* reflections=e->instance->reflection_probe_instances.ptr(); + + for(int i=0;i<rc;i++) { + ReflectionProbeInstance *rpi=reflection_probe_instance_owner.getptr(reflections[i]); + if (rpi->last_pass!=render_pass) //not visible + continue; + + if (reflection_count<maxobj) { + reflection_indices[reflection_count++]=rpi->reflection_index; + } + } + } + + state.scene_shader.set_uniform(SceneShaderGLES3::REFLECTION_COUNT,reflection_count); + if (reflection_count) { + glUniform1iv(state.scene_shader.get_uniform(SceneShaderGLES3::REFLECTION_INDICES),reflection_count,reflection_indices); + } + + int gi_probe_count = e->instance->gi_probe_instances.size(); + if (gi_probe_count) { + const RID * ridp = e->instance->gi_probe_instances.ptr(); + + GIProbeInstance *gipi = gi_probe_instance_owner.getptr(ridp[0]); + + glActiveTexture(GL_TEXTURE0+storage->config.max_texture_image_units-6); + glBindTexture(GL_TEXTURE_3D,gipi->tex_cache); + state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_XFORM1, gipi->transform_to_data * p_view_transform); + state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_BOUNDS1, gipi->bounds); + state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_MULTIPLIER1, gipi->probe?gipi->probe->dynamic_range*gipi->probe->energy:0.0); + state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_BLEND_AMBIENT1, gipi->probe?!gipi->probe->interior:false); + state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_CELL_SIZE1, gipi->cell_size_cache); + if (gi_probe_count>1) { + + GIProbeInstance *gipi2 = gi_probe_instance_owner.getptr(ridp[1]); + + glActiveTexture(GL_TEXTURE0+storage->config.max_texture_image_units-7); + glBindTexture(GL_TEXTURE_3D,gipi2->tex_cache); + state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_XFORM2, gipi2->transform_to_data * p_view_transform); + state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_BOUNDS2, gipi2->bounds); + state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_CELL_SIZE2, gipi2->cell_size_cache); + state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_MULTIPLIER2, gipi2->probe?gipi2->probe->dynamic_range*gipi2->probe->energy:0.0); + state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE_BLEND_AMBIENT2, gipi2->probe?!gipi2->probe->interior:false); + state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE2_ENABLED, true ); + } else { + + state.scene_shader.set_uniform(SceneShaderGLES3::GI_PROBE2_ENABLED, false ); + } + } +} + + +void RasterizerSceneGLES3::_setup_transform(InstanceBase *p_instance,const Transform& p_view_transform,const CameraMatrix& p_projection) { + + if (p_instance->billboard || p_instance->billboard_y || p_instance->depth_scale) { + + Transform xf=p_instance->transform; + if (p_instance->depth_scale) { + + if (p_projection.matrix[3][3]) { + //orthogonal matrix, try to do about the same + //with viewport size + //real_t w = Math::abs( 1.0/(2.0*(p_projection.matrix[0][0])) ); + real_t h = Math::abs( 1.0/(2.0*p_projection.matrix[1][1]) ); + float sc = (h*2.0); //consistent with Y-fov + xf.basis.scale( Vector3(sc,sc,sc)); + } else { + //just scale by depth + real_t sc = Plane(p_view_transform.origin,-p_view_transform.get_basis().get_axis(2)).distance_to(xf.origin); + xf.basis.scale( Vector3(sc,sc,sc)); + } + } + + if (p_instance->billboard && storage->frame.current_rt) { + + Vector3 scale = xf.basis.get_scale(); + + if (storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_VFLIP]) { + xf.set_look_at(xf.origin, xf.origin + p_view_transform.get_basis().get_axis(2), -p_view_transform.get_basis().get_axis(1)); + } else { + xf.set_look_at(xf.origin, xf.origin + p_view_transform.get_basis().get_axis(2), p_view_transform.get_basis().get_axis(1)); + } + + xf.basis.scale(scale); + } + + if (p_instance->billboard_y && storage->frame.current_rt) { + + Vector3 scale = xf.basis.get_scale(); + Vector3 look_at = p_view_transform.get_origin(); + look_at.y = 0.0; + Vector3 look_at_norm = look_at.normalized(); + + if (storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_VFLIP]) { + xf.set_look_at(xf.origin,xf.origin + look_at_norm, Vector3(0.0, -1.0, 0.0)); + } else { + xf.set_look_at(xf.origin,xf.origin + look_at_norm, Vector3(0.0, 1.0, 0.0)); + } + xf.basis.scale(scale); + } + state.scene_shader.set_uniform(SceneShaderGLES3::WORLD_TRANSFORM, xf); + + } else { + state.scene_shader.set_uniform(SceneShaderGLES3::WORLD_TRANSFORM, p_instance->transform); + } +} + +void RasterizerSceneGLES3::_set_cull(bool p_front,bool p_reverse_cull) { + + bool front = p_front; + if (p_reverse_cull) + front=!front; + + if (front!=state.cull_front) { + + glCullFace(front?GL_FRONT:GL_BACK); + state.cull_front=front; + } +} + + + +void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements,int p_element_count,const Transform& p_view_transform,const CameraMatrix& p_projection,GLuint p_base_env,bool p_reverse_cull,bool p_alpha_pass,bool p_shadow,bool p_directional_add,bool p_directional_shadows) { + + if (storage->frame.current_rt && storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_VFLIP]) { + //p_reverse_cull=!p_reverse_cull; + glFrontFace(GL_CCW); + } else { + glFrontFace(GL_CW); + } + + glBindBufferBase(GL_UNIFORM_BUFFER,0,state.scene_ubo); //bind globals ubo + + + if (!p_shadow && !p_directional_add) { + glBindBufferBase(GL_UNIFORM_BUFFER,2,state.env_radiance_ubo); //bind environment radiance info + glActiveTexture(GL_TEXTURE0+storage->config.max_texture_image_units-1); + glBindTexture(GL_TEXTURE_2D,state.brdf_texture); + + if (p_base_env) { + glActiveTexture(GL_TEXTURE0+storage->config.max_texture_image_units-2); + glBindTexture(GL_TEXTURE_2D,p_base_env); + state.scene_shader.set_conditional(SceneShaderGLES3::USE_RADIANCE_MAP,true); + } else { + state.scene_shader.set_conditional(SceneShaderGLES3::USE_RADIANCE_MAP,false); + + } + } else { + + state.scene_shader.set_conditional(SceneShaderGLES3::USE_RADIANCE_MAP,false); + } + + + state.cull_front=false; + glCullFace(GL_BACK); + + state.scene_shader.set_conditional(SceneShaderGLES3::USE_SKELETON,false); + + state.current_blend_mode=-1; + state.current_line_width=-1; + state.current_depth_draw=-1; + + RasterizerStorageGLES3::Material* prev_material=NULL; + RasterizerStorageGLES3::Geometry* prev_geometry=NULL; + VS::InstanceType prev_base_type = VS::INSTANCE_MAX; + + int current_blend_mode=-1; + + int prev_shading=-1; + RID prev_skeleton; + + state.scene_shader.set_conditional(SceneShaderGLES3::SHADELESS,true); //by default unshaded (easier to set) + + bool first=true; + + storage->info.render_object_count+=p_element_count; + + for (int i=0;i<p_element_count;i++) { + + RenderList::Element *e = p_elements[i]; + RasterizerStorageGLES3::Material* material= e->material; + RID skeleton = e->instance->skeleton; + + bool rebind=first; + + int shading = (e->sort_key>>RenderList::SORT_KEY_SHADING_SHIFT)&RenderList::SORT_KEY_SHADING_MASK; + + if (!p_shadow) { + + + + if (p_directional_add) { + if (e->sort_key&RenderList::SORT_KEY_UNSHADED_FLAG || !(e->instance->layer_mask&directional_light->light_ptr->cull_mask)) { + continue; + } + + shading&=~1; //ignore the ignore directional for base pass + } + + if (shading!=prev_shading) { + + if (e->sort_key&RenderList::SORT_KEY_UNSHADED_FLAG) { + + state.scene_shader.set_conditional(SceneShaderGLES3::SHADELESS,true); + state.scene_shader.set_conditional(SceneShaderGLES3::USE_FORWARD_LIGHTING,false); + state.scene_shader.set_conditional(SceneShaderGLES3::USE_LIGHT_DIRECTIONAL,false); + state.scene_shader.set_conditional(SceneShaderGLES3::LIGHT_DIRECTIONAL_SHADOW,false); + state.scene_shader.set_conditional(SceneShaderGLES3::LIGHT_USE_PSSM4,false); + state.scene_shader.set_conditional(SceneShaderGLES3::LIGHT_USE_PSSM2,false); + state.scene_shader.set_conditional(SceneShaderGLES3::LIGHT_USE_PSSM_BLEND,false); + state.scene_shader.set_conditional(SceneShaderGLES3::LIGHT_USE_PSSM_BLEND,false); + state.scene_shader.set_conditional(SceneShaderGLES3::SHADOW_MODE_PCF_5,false); + state.scene_shader.set_conditional(SceneShaderGLES3::SHADOW_MODE_PCF_13,false); + state.scene_shader.set_conditional(SceneShaderGLES3::USE_GI_PROBES,false); + + + + //state.scene_shader.set_conditional(SceneShaderGLES3::SHADELESS,true); + } else { + + state.scene_shader.set_conditional(SceneShaderGLES3::USE_GI_PROBES,e->instance->gi_probe_instances.size()>0); + + state.scene_shader.set_conditional(SceneShaderGLES3::SHADELESS,false); + state.scene_shader.set_conditional(SceneShaderGLES3::USE_FORWARD_LIGHTING,!p_directional_add); + state.scene_shader.set_conditional(SceneShaderGLES3::USE_LIGHT_DIRECTIONAL,false); + state.scene_shader.set_conditional(SceneShaderGLES3::LIGHT_DIRECTIONAL_SHADOW,false); + state.scene_shader.set_conditional(SceneShaderGLES3::LIGHT_USE_PSSM4,false); + state.scene_shader.set_conditional(SceneShaderGLES3::LIGHT_USE_PSSM2,false); + state.scene_shader.set_conditional(SceneShaderGLES3::LIGHT_USE_PSSM_BLEND,false); + state.scene_shader.set_conditional(SceneShaderGLES3::SHADOW_MODE_PCF_5,shadow_filter_mode==SHADOW_FILTER_PCF5); + state.scene_shader.set_conditional(SceneShaderGLES3::SHADOW_MODE_PCF_13,shadow_filter_mode==SHADOW_FILTER_PCF13); + + + if (p_directional_add || (directional_light && (e->sort_key&RenderList::SORT_KEY_NO_DIRECTIONAL_FLAG)==0)) { + state.scene_shader.set_conditional(SceneShaderGLES3::USE_LIGHT_DIRECTIONAL,true); + + if (p_directional_shadows && directional_light->light_ptr->shadow) { + state.scene_shader.set_conditional(SceneShaderGLES3::LIGHT_DIRECTIONAL_SHADOW,true); + + switch(directional_light->light_ptr->directional_shadow_mode) { + case VS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL: break; //none + case VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS: + state.scene_shader.set_conditional(SceneShaderGLES3::LIGHT_USE_PSSM2,true); + state.scene_shader.set_conditional(SceneShaderGLES3::LIGHT_USE_PSSM_BLEND,directional_light->light_ptr->directional_blend_splits); + break; + case VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS: + state.scene_shader.set_conditional(SceneShaderGLES3::LIGHT_USE_PSSM4,true); + state.scene_shader.set_conditional(SceneShaderGLES3::LIGHT_USE_PSSM_BLEND,directional_light->light_ptr->directional_blend_splits); + break; + } + } + + } + + } + + + + rebind=true; + } + + + if (p_alpha_pass || p_directional_add) { + int desired_blend_mode; + if (p_directional_add) { + desired_blend_mode=RasterizerStorageGLES3::Shader::Spatial::BLEND_MODE_ADD; + } else { + desired_blend_mode=material->shader->spatial.blend_mode; + } + + if (desired_blend_mode!=current_blend_mode) { + + + switch(desired_blend_mode) { + + case RasterizerStorageGLES3::Shader::Spatial::BLEND_MODE_MIX: { + glBlendEquation(GL_FUNC_ADD); + if (storage->frame.current_rt && storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT]) { + glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + } + else { + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + } + + } break; + case RasterizerStorageGLES3::Shader::Spatial::BLEND_MODE_ADD: { + + glBlendEquation(GL_FUNC_ADD); + glBlendFunc(p_alpha_pass?GL_SRC_ALPHA:GL_ONE,GL_ONE); + + } break; + case RasterizerStorageGLES3::Shader::Spatial::BLEND_MODE_SUB: { + + glBlendEquation(GL_FUNC_REVERSE_SUBTRACT); + glBlendFunc(GL_SRC_ALPHA,GL_ONE); + } break; + case RasterizerStorageGLES3::Shader::Spatial::BLEND_MODE_MUL: { + glBlendEquation(GL_FUNC_ADD); + if (storage->frame.current_rt && storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT]) { + glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + } + else { + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + } + + } break; + + } + + current_blend_mode=desired_blend_mode; + } + + } + + + } + + if (prev_skeleton!=skeleton) { + if (prev_skeleton.is_valid() != skeleton.is_valid()) { + state.scene_shader.set_conditional(SceneShaderGLES3::USE_SKELETON,skeleton.is_valid()); + rebind=true; + } + if (skeleton.is_valid()) { + RasterizerStorageGLES3::Skeleton *sk = storage->skeleton_owner.getornull(skeleton); + if (sk->size) { + glBindBufferBase(GL_UNIFORM_BUFFER,7,sk->ubo); + } + } + } + + if ((prev_base_type==VS::INSTANCE_MULTIMESH) != (e->instance->base_type==VS::INSTANCE_MULTIMESH)) { + state.scene_shader.set_conditional(SceneShaderGLES3::USE_INSTANCING,e->instance->base_type==VS::INSTANCE_MULTIMESH); + rebind=true; + } + + if (material!=prev_material || rebind) { + + storage->info.render_material_switch_count++; + + rebind = _setup_material(material,p_alpha_pass); + + if (rebind) { + storage->info.render_shader_rebind_count++; + } + } + + if (!(e->sort_key&RenderList::SORT_KEY_UNSHADED_FLAG) && !p_directional_add && !p_shadow) { + _setup_light(e,p_view_transform); + + } + + + if (prev_base_type != e->instance->base_type || prev_geometry!=e->geometry) { + + _setup_geometry(e); + storage->info.render_surface_switch_count++; + + } + + _set_cull(e->sort_key&RenderList::SORT_KEY_MIRROR_FLAG,p_reverse_cull); + + state.scene_shader.set_uniform(SceneShaderGLES3::NORMAL_MULT, e->instance->mirror?-1.0:1.0); + + _setup_transform(e->instance,p_view_transform,p_projection); + + _render_geometry(e); + + prev_material=material; + prev_base_type=e->instance->base_type; + prev_geometry=e->geometry; + prev_shading=shading; + prev_skeleton=skeleton; + first=false; + + } + + + + glFrontFace(GL_CW); + glBindVertexArray(0); + + state.scene_shader.set_conditional(SceneShaderGLES3::USE_INSTANCING,false); + state.scene_shader.set_conditional(SceneShaderGLES3::USE_SKELETON,false); + state.scene_shader.set_conditional(SceneShaderGLES3::USE_RADIANCE_MAP,false); + state.scene_shader.set_conditional(SceneShaderGLES3::USE_FORWARD_LIGHTING,false); + state.scene_shader.set_conditional(SceneShaderGLES3::USE_LIGHT_DIRECTIONAL,false); + state.scene_shader.set_conditional(SceneShaderGLES3::LIGHT_DIRECTIONAL_SHADOW,false); + state.scene_shader.set_conditional(SceneShaderGLES3::LIGHT_USE_PSSM4,false); + state.scene_shader.set_conditional(SceneShaderGLES3::LIGHT_USE_PSSM2,false); + state.scene_shader.set_conditional(SceneShaderGLES3::LIGHT_USE_PSSM_BLEND,false); + state.scene_shader.set_conditional(SceneShaderGLES3::SHADELESS,false); + state.scene_shader.set_conditional(SceneShaderGLES3::SHADOW_MODE_PCF_5,false); + state.scene_shader.set_conditional(SceneShaderGLES3::SHADOW_MODE_PCF_13,false); + state.scene_shader.set_conditional(SceneShaderGLES3::USE_GI_PROBES,false); + +} + + +void RasterizerSceneGLES3::_add_geometry( RasterizerStorageGLES3::Geometry* p_geometry, InstanceBase *p_instance, RasterizerStorageGLES3::GeometryOwner *p_owner,int p_material,bool p_shadow) { + + RasterizerStorageGLES3::Material *m=NULL; + RID m_src=p_instance->material_override.is_valid() ? p_instance->material_override :(p_material>=0?p_instance->materials[p_material]:p_geometry->material); + + +/* +#ifdef DEBUG_ENABLED + if (current_debug==VS::SCENARIO_DEBUG_OVERDRAW) { + m_src=overdraw_material; + } + +#endif +*/ + + if (m_src.is_valid()) { + m=storage->material_owner.getornull( m_src ); + + if (!m->shader) { + m=NULL; + } + } + + if (!m) { + m=storage->material_owner.getptr( default_material ); + } + + ERR_FAIL_COND(!m); + + + + bool has_base_alpha=(m->shader->spatial.uses_alpha); + bool has_blend_alpha=m->shader->spatial.blend_mode!=RasterizerStorageGLES3::Shader::Spatial::BLEND_MODE_MIX || m->shader->spatial.ontop; + bool has_alpha = has_base_alpha || has_blend_alpha; + bool shadow = false; + + bool mirror = p_instance->mirror; + + if (m->shader->spatial.cull_mode==RasterizerStorageGLES3::Shader::Spatial::CULL_MODE_FRONT) { + mirror=!mirror; + } + + if (m->shader->spatial.uses_sss) { + state.used_sss=true; + } + + if (p_shadow) { + + if (has_blend_alpha || (has_base_alpha && m->shader->spatial.depth_draw_mode!=RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS)) + return; //bye + + if (!m->shader->spatial.uses_vertex && !m->shader->spatial.uses_discard && m->shader->spatial.depth_draw_mode!=RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS) { + //shader does not use discard and does not write a vertex position, use generic material + if (p_instance->cast_shadows == VS::SHADOW_CASTING_SETTING_DOUBLE_SIDED) + m = storage->material_owner.getptr(default_material_twosided); + else + m = storage->material_owner.getptr(default_material); + } + + has_alpha=false; + + } + + + + RenderList::Element *e = has_alpha ? render_list.add_alpha_element() : render_list.add_element(); + + if (!e) + return; + + e->geometry=p_geometry; + e->material=m; + e->instance=p_instance; + e->owner=p_owner; + e->sort_key=0; + + if (e->geometry->last_pass!=render_pass) { + e->geometry->last_pass=render_pass; + e->geometry->index=current_geometry_index++; + } + + if (!p_shadow && directional_light && (directional_light->light_ptr->cull_mask&e->instance->layer_mask)==0) { + e->sort_key|=RenderList::SORT_KEY_NO_DIRECTIONAL_FLAG; + } + + e->sort_key|=uint64_t(e->geometry->index)<<RenderList::SORT_KEY_GEOMETRY_INDEX_SHIFT; + e->sort_key|=uint64_t(e->instance->base_type)<<RenderList::SORT_KEY_GEOMETRY_TYPE_SHIFT; + + if (!p_shadow) { + + + if (e->material->last_pass!=render_pass) { + e->material->last_pass=render_pass; + e->material->index=current_material_index++; + } + + e->sort_key|=uint64_t(e->material->index)<<RenderList::SORT_KEY_MATERIAL_INDEX_SHIFT; + e->sort_key|=uint64_t(e->instance->depth_layer)<<RenderList::SORT_KEY_DEPTH_LAYER_SHIFT; + + if (!has_blend_alpha && has_alpha && m->shader->spatial.depth_draw_mode==RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS) { + + //if nothing exists, add this element as opaque too + RenderList::Element *oe = render_list.add_element(); + + if (!oe) + return; + + copymem(oe,e,sizeof(RenderList::Element)); + } + + if (e->instance->gi_probe_instances.size()) { + e->sort_key|=RenderList::SORT_KEY_GI_PROBES_FLAG; + } + } + + //if (e->geometry->type==RasterizerStorageGLES3::Geometry::GEOMETRY_MULTISURFACE) + // e->sort_flags|=RenderList::SORT_FLAG_INSTANCING; + + + if (mirror) { + e->sort_key|=RenderList::SORT_KEY_MIRROR_FLAG; + } + + //e->light_type=0xFF; // no lights! + + if (shadow || m->shader->spatial.unshaded /*|| current_debug==VS::SCENARIO_DEBUG_SHADELESS*/) { + + e->sort_key|=RenderList::SORT_KEY_UNSHADED_FLAG; + } +} + +void RasterizerSceneGLES3::_draw_skybox(RasterizerStorageGLES3::SkyBox *p_skybox,const CameraMatrix& p_projection,const Transform& p_transform,bool p_vflip,float p_scale) { + + if (!p_skybox) + return; + + RasterizerStorageGLES3::Texture *tex = storage->texture_owner.getornull(p_skybox->cubemap); + + ERR_FAIL_COND(!tex); + glActiveTexture(GL_TEXTURE0); + glBindTexture(tex->target,tex->tex_id); + + + if (storage->config.srgb_decode_supported && tex->srgb && !tex->using_srgb) { + + glTexParameteri(tex->target,_TEXTURE_SRGB_DECODE_EXT,_DECODE_EXT); + tex->using_srgb=true; +#ifdef TOOLS_ENABLED + if (!(tex->flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) { + tex->flags|=VS::TEXTURE_FLAG_CONVERT_TO_LINEAR; + //notify that texture must be set to linear beforehand, so it works in other platforms when exported + } +#endif + } + + glDepthMask(GL_TRUE); + glEnable(GL_DEPTH_TEST); + glDisable(GL_CULL_FACE); + glDisable(GL_BLEND); + glDepthFunc(GL_LEQUAL); + glColorMask(1,1,1,1); + + float flip_sign = p_vflip?-1:1; + + Vector3 vertices[8]={ + Vector3(-1,-1*flip_sign,1), + Vector3( 0, 1, 0), + Vector3( 1,-1*flip_sign,1), + Vector3( 1, 1, 0), + Vector3( 1, 1*flip_sign,1), + Vector3( 1, 0, 0), + Vector3(-1, 1*flip_sign,1), + Vector3( 0, 0, 0) + + }; + + + + //skybox uv vectors + float vw,vh,zn; + p_projection.get_viewport_size(vw,vh); + zn=p_projection.get_z_near(); + + float scale=p_scale; + + for(int i=0;i<4;i++) { + + Vector3 uv=vertices[i*2+1]; + uv.x=(uv.x*2.0-1.0)*vw*scale; + uv.y=-(uv.y*2.0-1.0)*vh*scale; + uv.z=-zn; + vertices[i*2+1] = p_transform.basis.xform(uv).normalized(); + vertices[i*2+1].z = -vertices[i*2+1].z; + } + + glBindBuffer(GL_ARRAY_BUFFER,state.skybox_verts); + glBufferSubData(GL_ARRAY_BUFFER,0,sizeof(Vector3)*8,vertices); + glBindBuffer(GL_ARRAY_BUFFER,0); //unbind + + glBindVertexArray(state.skybox_array); + + storage->shaders.copy.set_conditional(CopyShaderGLES3::USE_CUBEMAP,true); + storage->shaders.copy.bind(); + + glDrawArrays(GL_TRIANGLE_FAN,0,4); + + glBindVertexArray(0); + glColorMask(1,1,1,1); + + storage->shaders.copy.set_conditional(CopyShaderGLES3::USE_CUBEMAP,false); + +} + + +void RasterizerSceneGLES3::_setup_environment(Environment *env,const CameraMatrix& p_cam_projection,const Transform& p_cam_transform) { + + + //store camera into ubo + store_camera(p_cam_projection,state.ubo_data.projection_matrix); + store_transform(p_cam_transform,state.ubo_data.camera_matrix); + store_transform(p_cam_transform.affine_inverse(),state.ubo_data.camera_inverse_matrix); + + //time global variables + for(int i=0;i<4;i++) { + state.ubo_data.time[i]=storage->frame.time[i]; + } + + //bg and ambient + if (env) { + state.ubo_data.bg_energy=env->bg_energy; + state.ubo_data.ambient_energy=env->ambient_energy; + Color linear_ambient_color = env->ambient_color.to_linear(); + state.ubo_data.ambient_light_color[0]=linear_ambient_color.r; + state.ubo_data.ambient_light_color[1]=linear_ambient_color.g; + state.ubo_data.ambient_light_color[2]=linear_ambient_color.b; + state.ubo_data.ambient_light_color[3]=linear_ambient_color.a; + + Color bg_color; + + switch(env->bg_mode) { + case VS::ENV_BG_CLEAR_COLOR: { + bg_color=storage->frame.clear_request_color.to_linear(); + } break; + case VS::ENV_BG_COLOR: { + bg_color=env->bg_color.to_linear(); + } break; + default: { + bg_color=Color(0,0,0,1); + } break; + } + + state.ubo_data.bg_color[0]=bg_color.r; + state.ubo_data.bg_color[1]=bg_color.g; + state.ubo_data.bg_color[2]=bg_color.b; + state.ubo_data.bg_color[3]=bg_color.a; + + state.env_radiance_data.ambient_contribution=env->ambient_skybox_contribution; + state.ubo_data.ambient_occlusion_affect_light=env->ssao_light_affect; + } else { + state.ubo_data.bg_energy=1.0; + state.ubo_data.ambient_energy=1.0; + //use from clear color instead, since there is no ambient + Color linear_ambient_color = storage->frame.clear_request_color.to_linear(); + state.ubo_data.ambient_light_color[0]=linear_ambient_color.r; + state.ubo_data.ambient_light_color[1]=linear_ambient_color.g; + state.ubo_data.ambient_light_color[2]=linear_ambient_color.b; + state.ubo_data.ambient_light_color[3]=linear_ambient_color.a; + + state.ubo_data.bg_color[0]=linear_ambient_color.r; + state.ubo_data.bg_color[1]=linear_ambient_color.g; + state.ubo_data.bg_color[2]=linear_ambient_color.b; + state.ubo_data.bg_color[3]=linear_ambient_color.a; + + state.env_radiance_data.ambient_contribution=0; + state.ubo_data.ambient_occlusion_affect_light=0; + + } + + { + //directional shadow + + state.ubo_data.shadow_directional_pixel_size[0]=1.0/directional_shadow.size; + state.ubo_data.shadow_directional_pixel_size[1]=1.0/directional_shadow.size; + + glActiveTexture(GL_TEXTURE0+storage->config.max_texture_image_units-4); + glBindTexture(GL_TEXTURE_2D,directional_shadow.depth); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LESS); + } + + + + glBindBuffer(GL_UNIFORM_BUFFER, state.scene_ubo); + glBufferSubData(GL_UNIFORM_BUFFER, 0,sizeof(State::SceneDataUBO), &state.ubo_data); + glBindBuffer(GL_UNIFORM_BUFFER, 0); + + //fill up environment + + store_transform(p_cam_transform,state.env_radiance_data.transform); + + + glBindBuffer(GL_UNIFORM_BUFFER, state.env_radiance_ubo); + glBufferSubData(GL_UNIFORM_BUFFER, 0,sizeof(State::EnvironmentRadianceUBO), &state.env_radiance_data); + glBindBuffer(GL_UNIFORM_BUFFER, 0); + +} + +void RasterizerSceneGLES3::_setup_directional_light(int p_index,const Transform& p_camera_inverse_transform,bool p_use_shadows) { + + LightInstance *li = directional_lights[p_index]; + + LightDataUBO ubo_data; //used for filling + + float sign = li->light_ptr->negative?-1:1; + + Color linear_col = li->light_ptr->color.to_linear(); + ubo_data.light_color_energy[0]=linear_col.r*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY];; + ubo_data.light_color_energy[1]=linear_col.g*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY];; + ubo_data.light_color_energy[2]=linear_col.b*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY];; + ubo_data.light_color_energy[3]=0; + + //omni, keep at 0 + ubo_data.light_pos_inv_radius[0]=0.0; + ubo_data.light_pos_inv_radius[1]=0.0; + ubo_data.light_pos_inv_radius[2]=0.0; + ubo_data.light_pos_inv_radius[3]=0.0; + + Vector3 direction = p_camera_inverse_transform.basis.xform(li->transform.basis.xform(Vector3(0,0,-1))).normalized(); + ubo_data.light_direction_attenuation[0]=direction.x; + ubo_data.light_direction_attenuation[1]=direction.y; + ubo_data.light_direction_attenuation[2]=direction.z; + ubo_data.light_direction_attenuation[3]=1.0; + + ubo_data.light_params[0]=0; + ubo_data.light_params[1]=li->light_ptr->param[VS::LIGHT_PARAM_SPECULAR]; + ubo_data.light_params[2]=0; + ubo_data.light_params[3]=0; + + Color shadow_color = li->light_ptr->shadow_color.to_linear(); + ubo_data.light_shadow_color[0]=shadow_color.r; + ubo_data.light_shadow_color[1]=shadow_color.g; + ubo_data.light_shadow_color[2]=shadow_color.b; + ubo_data.light_shadow_color[3]=1.0; + + + if (p_use_shadows && li->light_ptr->shadow) { + + int shadow_count=0; + + switch(li->light_ptr->directional_shadow_mode) { + case VS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL: { + shadow_count=1; + } break; + case VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS: { + shadow_count=2; + } break; + case VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS: { + shadow_count=4; + } break; + + } + + for(int j=0;j<shadow_count;j++) { + + + uint32_t x=li->directional_rect.pos.x; + uint32_t y=li->directional_rect.pos.y; + uint32_t width=li->directional_rect.size.x; + uint32_t height=li->directional_rect.size.y; + + + + if (li->light_ptr->directional_shadow_mode==VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS) { + + + width/=2; + height/=2; + + if (j==0) { + + } else if (j==1) { + x+=width; + } else if (j==2) { + y+=height; + } else if (j==3) { + x+=width; + y+=height; + + } + + + + } else if (li->light_ptr->directional_shadow_mode==VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS) { + + height/=2; + + if (j==0) { + + } else { + y+=height; + } + + } + + ubo_data.shadow_split_offsets[j]=1.0/li->shadow_transform[j].split; + + Transform modelview = (p_camera_inverse_transform * li->shadow_transform[j].transform).inverse(); + + CameraMatrix bias; + bias.set_light_bias(); + CameraMatrix rectm; + Rect2 atlas_rect = Rect2(float(x)/directional_shadow.size,float(y)/directional_shadow.size,float(width)/directional_shadow.size,float(height)/directional_shadow.size); + rectm.set_light_atlas_rect(atlas_rect); + + + CameraMatrix shadow_mtx = rectm * bias * li->shadow_transform[j].camera * modelview; + + store_camera(shadow_mtx,&ubo_data.shadow_matrix1[16*j]); + + ubo_data.light_clamp[0]=atlas_rect.pos.x; + ubo_data.light_clamp[1]=atlas_rect.pos.y; + ubo_data.light_clamp[2]=atlas_rect.size.x; + ubo_data.light_clamp[3]=atlas_rect.size.y; + + } + + } + + glBindBuffer(GL_UNIFORM_BUFFER, state.directional_ubo); + glBufferSubData(GL_UNIFORM_BUFFER, 0, sizeof(LightDataUBO), &ubo_data); + glBindBuffer(GL_UNIFORM_BUFFER, 0); + + directional_light=li; + + glBindBufferBase(GL_UNIFORM_BUFFER,3,state.directional_ubo); + +} + +void RasterizerSceneGLES3::_setup_lights(RID *p_light_cull_result,int p_light_cull_count,const Transform& p_camera_inverse_transform,const CameraMatrix& p_camera_projection,RID p_shadow_atlas) { + + + state.omni_light_count=0; + state.spot_light_count=0; + state.directional_light_count=0; + + directional_light=NULL; + + ShadowAtlas *shadow_atlas = shadow_atlas_owner.getornull(p_shadow_atlas); + + + for(int i=0;i<p_light_cull_count;i++) { + + ERR_BREAK( i>=RenderList::MAX_LIGHTS ); + + LightInstance *li = light_instance_owner.getptr(p_light_cull_result[i]); + + LightDataUBO ubo_data; //used for filling + + switch(li->light_ptr->type) { + + case VS::LIGHT_DIRECTIONAL: { + + if (state.directional_light_count<RenderList::MAX_DIRECTIONAL_LIGHTS) { + directional_lights[state.directional_light_count++]=li; + } + + + } break; + case VS::LIGHT_OMNI: { + + float sign = li->light_ptr->negative?-1:1; + + Color linear_col = li->light_ptr->color.to_linear(); + ubo_data.light_color_energy[0]=linear_col.r*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY];; + ubo_data.light_color_energy[1]=linear_col.g*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY];; + ubo_data.light_color_energy[2]=linear_col.b*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY];; + ubo_data.light_color_energy[3]=0; + + + Vector3 pos = p_camera_inverse_transform.xform(li->transform.origin); + + //directional, keep at 0 + ubo_data.light_pos_inv_radius[0]=pos.x; + ubo_data.light_pos_inv_radius[1]=pos.y; + ubo_data.light_pos_inv_radius[2]=pos.z; + ubo_data.light_pos_inv_radius[3]=1.0/MAX(0.001,li->light_ptr->param[VS::LIGHT_PARAM_RANGE]); + + ubo_data.light_direction_attenuation[0]=0; + ubo_data.light_direction_attenuation[1]=0; + ubo_data.light_direction_attenuation[2]=0; + ubo_data.light_direction_attenuation[3]=li->light_ptr->param[VS::LIGHT_PARAM_ATTENUATION]; + + ubo_data.light_params[0]=0; + ubo_data.light_params[1]=0; + ubo_data.light_params[2]=li->light_ptr->param[VS::LIGHT_PARAM_SPECULAR]; + ubo_data.light_params[3]=0; + + Color shadow_color = li->light_ptr->shadow_color.to_linear(); + ubo_data.light_shadow_color[0]=shadow_color.r; + ubo_data.light_shadow_color[1]=shadow_color.g; + ubo_data.light_shadow_color[2]=shadow_color.b; + ubo_data.light_shadow_color[3]=1.0; + + if (li->light_ptr->shadow && shadow_atlas && shadow_atlas->shadow_owners.has(li->self)) { + // fill in the shadow information + + uint32_t key = shadow_atlas->shadow_owners[li->self]; + + uint32_t quadrant = (key >> ShadowAtlas::QUADRANT_SHIFT)&0x3; + uint32_t shadow = key & ShadowAtlas::SHADOW_INDEX_MASK; + + ERR_CONTINUE(shadow>=shadow_atlas->quadrants[quadrant].shadows.size()); + + uint32_t atlas_size = shadow_atlas->size; + uint32_t quadrant_size = atlas_size>>1; + + uint32_t x=(quadrant&1)*quadrant_size; + uint32_t y=(quadrant>>1)*quadrant_size; + + uint32_t shadow_size = (quadrant_size / shadow_atlas->quadrants[quadrant].subdivision); + x+=(shadow % shadow_atlas->quadrants[quadrant].subdivision) * shadow_size; + y+=(shadow / shadow_atlas->quadrants[quadrant].subdivision) * shadow_size; + + uint32_t width=shadow_size; + uint32_t height=shadow_size; + + + if (li->light_ptr->omni_shadow_detail==VS::LIGHT_OMNI_SHADOW_DETAIL_HORIZONTAL) { + + height/=2; + } else { + width/=2; + + } + + Transform proj = (p_camera_inverse_transform * li->transform).inverse(); + + store_transform(proj,ubo_data.shadow_matrix1); + + ubo_data.light_params[3]=1.0; //means it has shadow + ubo_data.light_clamp[0]=float(x)/atlas_size; + ubo_data.light_clamp[1]=float(y)/atlas_size; + ubo_data.light_clamp[2]=float(width)/atlas_size; + ubo_data.light_clamp[3]=float(height)/atlas_size; + + } + + + li->light_index=state.omni_light_count; + copymem(&state.omni_array_tmp[li->light_index*state.ubo_light_size],&ubo_data,state.ubo_light_size); + state.omni_light_count++; + + + +#if 0 + if (li->light_ptr->shadow_enabled) { + li->shadow_projection[0] = Transform(camera_transform_inverse * li->transform).inverse(); + lights_use_shadow=true; + } +#endif + } break; + case VS::LIGHT_SPOT: { + + float sign = li->light_ptr->negative?-1:1; + + Color linear_col = li->light_ptr->color.to_linear(); + ubo_data.light_color_energy[0]=linear_col.r*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY];; + ubo_data.light_color_energy[1]=linear_col.g*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY];; + ubo_data.light_color_energy[2]=linear_col.b*sign*li->light_ptr->param[VS::LIGHT_PARAM_ENERGY];; + ubo_data.light_color_energy[3]=0; + + Vector3 pos = p_camera_inverse_transform.xform(li->transform.origin); + + //directional, keep at 0 + ubo_data.light_pos_inv_radius[0]=pos.x; + ubo_data.light_pos_inv_radius[1]=pos.y; + ubo_data.light_pos_inv_radius[2]=pos.z; + ubo_data.light_pos_inv_radius[3]=1.0/MAX(0.001,li->light_ptr->param[VS::LIGHT_PARAM_RANGE]); + + Vector3 direction = p_camera_inverse_transform.basis.xform(li->transform.basis.xform(Vector3(0,0,-1))).normalized(); + ubo_data.light_direction_attenuation[0]=direction.x; + ubo_data.light_direction_attenuation[1]=direction.y; + ubo_data.light_direction_attenuation[2]=direction.z; + ubo_data.light_direction_attenuation[3]=li->light_ptr->param[VS::LIGHT_PARAM_ATTENUATION]; + + ubo_data.light_params[0]=li->light_ptr->param[VS::LIGHT_PARAM_SPOT_ATTENUATION]; + ubo_data.light_params[1]=Math::cos(Math::deg2rad(li->light_ptr->param[VS::LIGHT_PARAM_SPOT_ANGLE])); + ubo_data.light_params[2]=li->light_ptr->param[VS::LIGHT_PARAM_SPECULAR]; + ubo_data.light_params[3]=0; + + Color shadow_color = li->light_ptr->shadow_color.to_linear(); + ubo_data.light_shadow_color[0]=shadow_color.r; + ubo_data.light_shadow_color[1]=shadow_color.g; + ubo_data.light_shadow_color[2]=shadow_color.b; + ubo_data.light_shadow_color[3]=1.0; + + if (li->light_ptr->shadow && shadow_atlas && shadow_atlas->shadow_owners.has(li->self)) { + // fill in the shadow information + + uint32_t key = shadow_atlas->shadow_owners[li->self]; + + uint32_t quadrant = (key >> ShadowAtlas::QUADRANT_SHIFT)&0x3; + uint32_t shadow = key & ShadowAtlas::SHADOW_INDEX_MASK; + + ERR_CONTINUE(shadow>=shadow_atlas->quadrants[quadrant].shadows.size()); + + uint32_t atlas_size = shadow_atlas->size; + uint32_t quadrant_size = atlas_size>>1; + + uint32_t x=(quadrant&1)*quadrant_size; + uint32_t y=(quadrant>>1)*quadrant_size; + + uint32_t shadow_size = (quadrant_size / shadow_atlas->quadrants[quadrant].subdivision); + x+=(shadow % shadow_atlas->quadrants[quadrant].subdivision) * shadow_size; + y+=(shadow / shadow_atlas->quadrants[quadrant].subdivision) * shadow_size; + + uint32_t width=shadow_size; + uint32_t height=shadow_size; + + Rect2 rect(float(x)/atlas_size,float(y)/atlas_size,float(width)/atlas_size,float(height)/atlas_size); + + ubo_data.light_params[3]=1.0; //means it has shadow + ubo_data.light_clamp[0]=rect.pos.x; + ubo_data.light_clamp[1]=rect.pos.y; + ubo_data.light_clamp[2]=rect.size.x; + ubo_data.light_clamp[3]=rect.size.y; + + Transform modelview = (p_camera_inverse_transform * li->transform).inverse(); + + CameraMatrix bias; + bias.set_light_bias(); + CameraMatrix rectm; + rectm.set_light_atlas_rect(rect); + + CameraMatrix shadow_mtx = rectm * bias * li->shadow_transform[0].camera * modelview; + + store_camera(shadow_mtx,ubo_data.shadow_matrix1); + + + } + + li->light_index=state.spot_light_count; + copymem(&state.spot_array_tmp[li->light_index*state.ubo_light_size],&ubo_data,state.ubo_light_size); + state.spot_light_count++; + +#if 0 + if (li->light_ptr->shadow_enabled) { + CameraMatrix bias; + bias.set_light_bias(); + Transform modelview=Transform(camera_transform_inverse * li->transform).inverse(); + li->shadow_projection[0] = bias * li->projection * modelview; + lights_use_shadow=true; + } +#endif + } break; + + } + + + li->last_pass=render_pass; + + //update UBO for forward rendering, blit to texture for clustered + + } + + + + if (state.omni_light_count) { + + glBindBuffer(GL_UNIFORM_BUFFER, state.omni_array_ubo); + glBufferSubData(GL_UNIFORM_BUFFER, 0, state.omni_light_count*state.ubo_light_size, state.omni_array_tmp); + glBindBuffer(GL_UNIFORM_BUFFER, 0); + + glBindBufferBase(GL_UNIFORM_BUFFER,4,state.omni_array_ubo); + } + + if (state.spot_light_count) { + + glBindBuffer(GL_UNIFORM_BUFFER, state.spot_array_ubo); + glBufferSubData(GL_UNIFORM_BUFFER, 0, state.spot_light_count*state.ubo_light_size, state.spot_array_tmp); + glBindBuffer(GL_UNIFORM_BUFFER, 0); + + glBindBufferBase(GL_UNIFORM_BUFFER,5,state.spot_array_ubo); + } + + + +} + +void RasterizerSceneGLES3::_setup_reflections(RID *p_reflection_probe_cull_result,int p_reflection_probe_cull_count,const Transform& p_camera_inverse_transform,const CameraMatrix& p_camera_projection,RID p_reflection_atlas,Environment *p_env) { + + state.reflection_probe_count=0; + + for(int i=0;i<p_reflection_probe_cull_count;i++) { + + ReflectionProbeInstance *rpi=reflection_probe_instance_owner.getornull(p_reflection_probe_cull_result[i]); + ERR_CONTINUE(!rpi); + + ReflectionAtlas *reflection_atlas=reflection_atlas_owner.getornull(p_reflection_atlas); + ERR_CONTINUE(!reflection_atlas); + + ERR_CONTINUE(rpi->reflection_atlas_index<0); + + + if (state.reflection_probe_count>=state.max_ubo_reflections) + break; + + rpi->last_pass=render_pass; + + + ReflectionProbeDataUBO reflection_ubo; + + reflection_ubo.box_extents[0]=rpi->probe_ptr->extents.x; + reflection_ubo.box_extents[1]=rpi->probe_ptr->extents.y; + reflection_ubo.box_extents[2]=rpi->probe_ptr->extents.z; + reflection_ubo.box_extents[3]=0; + + + + reflection_ubo.box_ofs[0]=rpi->probe_ptr->origin_offset.x; + reflection_ubo.box_ofs[1]=rpi->probe_ptr->origin_offset.y; + reflection_ubo.box_ofs[2]=rpi->probe_ptr->origin_offset.z; + reflection_ubo.box_ofs[3]=0; + + reflection_ubo.params[0]=rpi->probe_ptr->intensity; + reflection_ubo.params[1]=0; + reflection_ubo.params[2]=rpi->probe_ptr->interior?1.0:0.0; + reflection_ubo.params[3]=rpi->probe_ptr->box_projection?1.0:0.0; + + if (rpi->probe_ptr->interior) { + Color ambient_linear = rpi->probe_ptr->interior_ambient.to_linear(); + reflection_ubo.ambient[0]=ambient_linear.r*rpi->probe_ptr->interior_ambient_energy; + reflection_ubo.ambient[1]=ambient_linear.g*rpi->probe_ptr->interior_ambient_energy; + reflection_ubo.ambient[2]=ambient_linear.b*rpi->probe_ptr->interior_ambient_energy; + reflection_ubo.ambient[3]=rpi->probe_ptr->interior_ambient_probe_contrib; + } else { + Color ambient_linear; + float contrib=0; + if (p_env) { + ambient_linear=p_env->ambient_color.to_linear(); + ambient_linear.r*=p_env->ambient_energy; + ambient_linear.g*=p_env->ambient_energy; + ambient_linear.b*=p_env->ambient_energy; + contrib=p_env->ambient_skybox_contribution; + } + + reflection_ubo.ambient[0]=ambient_linear.r; + reflection_ubo.ambient[1]=ambient_linear.g; + reflection_ubo.ambient[2]=ambient_linear.b; + reflection_ubo.ambient[3]=0; + } + + int cell_size = reflection_atlas->size / reflection_atlas->subdiv; + int x = (rpi->reflection_atlas_index % reflection_atlas->subdiv) * cell_size; + int y = (rpi->reflection_atlas_index / reflection_atlas->subdiv) * cell_size; + int width=cell_size; + int height=cell_size; + + reflection_ubo.atlas_clamp[0]=float(x)/reflection_atlas->size; + reflection_ubo.atlas_clamp[1]=float(y)/reflection_atlas->size; + reflection_ubo.atlas_clamp[2]=float(width)/reflection_atlas->size; + reflection_ubo.atlas_clamp[3]=float(height/2)/reflection_atlas->size; + + Transform proj = (p_camera_inverse_transform * rpi->transform).inverse(); + store_transform(proj,reflection_ubo.local_matrix); + + rpi->reflection_index=state.reflection_probe_count; + copymem(&state.reflection_array_tmp[rpi->reflection_index*sizeof(ReflectionProbeDataUBO)],&reflection_ubo,sizeof(ReflectionProbeDataUBO)); + state.reflection_probe_count++; + + } + + + if (state.reflection_probe_count) { + + + glBindBuffer(GL_UNIFORM_BUFFER, state.reflection_array_ubo); + glBufferSubData(GL_UNIFORM_BUFFER, 0, state.reflection_probe_count*sizeof(ReflectionProbeDataUBO), state.reflection_array_tmp); + glBindBuffer(GL_UNIFORM_BUFFER, 0); + + glBindBufferBase(GL_UNIFORM_BUFFER,6,state.reflection_array_ubo); + } + +} + + +void RasterizerSceneGLES3::_copy_screen() { + + glBindVertexArray( storage->resources.quadie_array); + glDrawArrays(GL_TRIANGLE_FAN,0,4); + glBindVertexArray(0); + +} + +void RasterizerSceneGLES3::_copy_to_front_buffer(Environment *env) { + + //copy to front buffer + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->fbo); + + glDepthMask(GL_FALSE); + glDisable(GL_DEPTH_TEST); + glDisable(GL_CULL_FACE); + glDisable(GL_BLEND); + glDepthFunc(GL_LEQUAL); + glColorMask(1,1,1,1); + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->buffers.diffuse); + + storage->shaders.copy.set_conditional(CopyShaderGLES3::DISABLE_ALPHA,true); + + if (!env) { + //no environment, simply convert from linear to srgb + storage->shaders.copy.set_conditional(CopyShaderGLES3::LINEAR_TO_SRGB,true); + } else { + storage->shaders.copy.set_conditional(CopyShaderGLES3::LINEAR_TO_SRGB,true); + + } + + storage->shaders.copy.bind(); + + _copy_screen(); + + + //turn off everything used + storage->shaders.copy.set_conditional(CopyShaderGLES3::LINEAR_TO_SRGB,false); + storage->shaders.copy.set_conditional(CopyShaderGLES3::DISABLE_ALPHA,false); + + +} + +void RasterizerSceneGLES3::_copy_texture_to_front_buffer(GLuint p_texture) { + + //copy to front buffer + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->fbo); + + glDepthMask(GL_FALSE); + glDisable(GL_DEPTH_TEST); + glDisable(GL_CULL_FACE); + glDisable(GL_BLEND); + glDepthFunc(GL_LEQUAL); + glColorMask(1,1,1,1); + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,p_texture); + + glViewport(0,0,storage->frame.current_rt->width*0.5,storage->frame.current_rt->height*0.5); + + storage->shaders.copy.set_conditional(CopyShaderGLES3::DISABLE_ALPHA,true); + storage->shaders.copy.bind(); + + _copy_screen(); + + //turn off everything used + storage->shaders.copy.set_conditional(CopyShaderGLES3::LINEAR_TO_SRGB,false); + storage->shaders.copy.set_conditional(CopyShaderGLES3::DISABLE_ALPHA,false); + + +} + +void RasterizerSceneGLES3::_fill_render_list(InstanceBase** p_cull_result,int p_cull_count,bool p_shadow){ + + current_geometry_index=0; + current_material_index=0; + state.used_sss=false; + + //fill list + + for(int i=0;i<p_cull_count;i++) { + + InstanceBase *inst = p_cull_result[i]; + switch(inst->base_type) { + + case VS::INSTANCE_MESH: { + + RasterizerStorageGLES3::Mesh *mesh = storage->mesh_owner.getptr(inst->base); + ERR_CONTINUE(!mesh); + + int ssize = mesh->surfaces.size(); + + for (int i=0;i<ssize;i++) { + + int mat_idx = inst->materials[i].is_valid() ? i : -1; + RasterizerStorageGLES3::Surface *s = mesh->surfaces[i]; + _add_geometry(s,inst,NULL,mat_idx,p_shadow); + } + + //mesh->last_pass=frame; + + } break; + case VS::INSTANCE_MULTIMESH: { + + RasterizerStorageGLES3::MultiMesh *multi_mesh = storage->multimesh_owner.getptr(inst->base); + ERR_CONTINUE(!multi_mesh); + + if (multi_mesh->size==0 || multi_mesh->visible_instances==0) + continue; + + RasterizerStorageGLES3::Mesh *mesh = storage->mesh_owner.getptr(multi_mesh->mesh); + if (!mesh) + continue; //mesh not assigned + + int ssize = mesh->surfaces.size(); + + for (int i=0;i<ssize;i++) { + + RasterizerStorageGLES3::Surface *s = mesh->surfaces[i]; + _add_geometry(s,inst,multi_mesh,-1,p_shadow); + } + + } break; + case VS::INSTANCE_IMMEDIATE: { + + } break; + + } + } +} + + +void RasterizerSceneGLES3::_render_mrts(Environment *env,const CameraMatrix &p_cam_projection) { + + + glDepthMask(GL_FALSE); + glDisable(GL_DEPTH_TEST); + glDisable(GL_CULL_FACE); + glDisable(GL_BLEND); + + + if (env->ssao_enabled) { + //copy diffuse to front buffer + glBindFramebuffer(GL_READ_FRAMEBUFFER, storage->frame.current_rt->buffers.fbo); + glReadBuffer(GL_COLOR_ATTACHMENT0); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, storage->frame.current_rt->fbo); + glBlitFramebuffer(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, 0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT, GL_NEAREST); + + glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); + + + //copy from depth, convert to linear + GLint ss[2]; + ss[0]=storage->frame.current_rt->width; + ss[1]=storage->frame.current_rt->height; + + for(int i=0;i<storage->frame.current_rt->effects.ssao.depth_mipmap_fbos.size();i++) { + + state.ssao_minify_shader.set_conditional(SsaoMinifyShaderGLES3::MINIFY_START,i==0); + state.ssao_minify_shader.bind(); + state.ssao_minify_shader.set_uniform(SsaoMinifyShaderGLES3::CAMERA_Z_FAR,p_cam_projection.get_z_far()); + state.ssao_minify_shader.set_uniform(SsaoMinifyShaderGLES3::CAMERA_Z_NEAR,p_cam_projection.get_z_near()); + state.ssao_minify_shader.set_uniform(SsaoMinifyShaderGLES3::SOURCE_MIPMAP,MAX(0,i-1)); + glUniform2iv(state.ssao_minify_shader.get_uniform(SsaoMinifyShaderGLES3::FROM_SIZE),1,ss); + ss[0]>>=1; + ss[1]>>=1; + + glActiveTexture(GL_TEXTURE0); + if (i==0) { + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->depth); + } else { + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->effects.ssao.linear_depth); + } + + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->effects.ssao.depth_mipmap_fbos[i]); //copy to front first + glViewport(0,0,ss[0],ss[1]); + + _copy_screen(); + + } + ss[0]=storage->frame.current_rt->width; + ss[1]=storage->frame.current_rt->height; + + glViewport(0,0,ss[0],ss[1]); + + + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_GREATER); + // do SSAO! + state.ssao_shader.set_conditional(SsaoShaderGLES3::ENABLE_RADIUS2,env->ssao_radius2>0.001); + state.ssao_shader.bind(); + state.ssao_shader.set_uniform(SsaoShaderGLES3::CAMERA_Z_FAR,p_cam_projection.get_z_far()); + state.ssao_shader.set_uniform(SsaoShaderGLES3::CAMERA_Z_NEAR,p_cam_projection.get_z_near()); + glUniform2iv(state.ssao_shader.get_uniform(SsaoShaderGLES3::SCREEN_SIZE),1,ss); + float radius = env->ssao_radius; + state.ssao_shader.set_uniform(SsaoShaderGLES3::RADIUS,radius); + float intensity = env->ssao_intensity; + state.ssao_shader.set_uniform(SsaoShaderGLES3::INTENSITY_DIV_R6,intensity / pow(radius, 6.0f)); + + if (env->ssao_radius2>0.001) { + + float radius2 = env->ssao_radius2; + state.ssao_shader.set_uniform(SsaoShaderGLES3::RADIUS2,radius2); + float intensity2 = env->ssao_intensity2; + state.ssao_shader.set_uniform(SsaoShaderGLES3::INTENSITY_DIV_R62,intensity2 / pow(radius2, 6.0f)); + + } + + float proj_info[4]={ + -2.0f / (ss[0]*p_cam_projection.matrix[0][0]), + -2.0f / (ss[1]*p_cam_projection.matrix[1][1]), + ( 1.0f - p_cam_projection.matrix[0][2]) / p_cam_projection.matrix[0][0], + ( 1.0f + p_cam_projection.matrix[1][2]) / p_cam_projection.matrix[1][1] + }; + + glUniform4fv(state.ssao_shader.get_uniform(SsaoShaderGLES3::PROJ_INFO),1,proj_info); + float pixels_per_meter = float(p_cam_projection.get_pixels_per_meter(ss[0])); + + state.ssao_shader.set_uniform(SsaoShaderGLES3::PROJ_SCALE,pixels_per_meter); + state.ssao_shader.set_uniform(SsaoShaderGLES3::BIAS,env->ssao_bias); + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->depth); + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->effects.ssao.linear_depth); + glActiveTexture(GL_TEXTURE2); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->buffers.effect); + + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->effects.ssao.blur_fbo[0]); //copy to front first + Color white(1,1,1,1); + glClearBufferfv(GL_COLOR,0,white.components); // specular + + _copy_screen(); + + //do the batm, i mean blur + + state.ssao_blur_shader.bind(); + + if (env->ssao_filter) { + for(int i=0;i<2;i++) { + + state.ssao_blur_shader.set_uniform(SsaoBlurShaderGLES3::CAMERA_Z_FAR,p_cam_projection.get_z_far()); + state.ssao_blur_shader.set_uniform(SsaoBlurShaderGLES3::CAMERA_Z_NEAR,p_cam_projection.get_z_near()); + GLint axis[2]={i,1-i}; + glUniform2iv(state.ssao_blur_shader.get_uniform(SsaoBlurShaderGLES3::AXIS),1,axis); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->effects.ssao.blur_red[i]); + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->depth); + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->effects.ssao.blur_fbo[1-i]); + if (i==0) { + glClearBufferfv(GL_COLOR,0,white.components); // specular + } + _copy_screen(); + + } + } + + glDisable(GL_DEPTH_TEST); + glDepthFunc(GL_LEQUAL); + + // just copy diffuse while applying SSAO + + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::SSAO_MERGE,true); + state.effect_blur_shader.bind(); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::SSAO_COLOR,env->ssao_color); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->color); //previous level, since mipmaps[0] starts one level bigger + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->effects.ssao.blur_red[0]); //previous level, since mipmaps[0] starts one level bigger + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->effects.mip_maps[0].sizes[0].fbo); // copy to base level + _copy_screen(); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::SSAO_MERGE,false); + + } else { + + //copy diffuse to effect buffer + glBindFramebuffer(GL_READ_FRAMEBUFFER, storage->frame.current_rt->buffers.fbo); + glReadBuffer(GL_COLOR_ATTACHMENT0); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, storage->frame.current_rt->effects.mip_maps[0].sizes[0].fbo); + glBlitFramebuffer(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, 0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT, GL_NEAREST); + + glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); + + } + + + if (state.used_sss) {//sss enabled + //copy diffuse while performing sss + + //copy normal and roughness to effect buffer + glBindFramebuffer(GL_READ_FRAMEBUFFER, storage->frame.current_rt->buffers.fbo); + glReadBuffer(GL_COLOR_ATTACHMENT3); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, storage->frame.current_rt->buffers.effect_fbo); + glBlitFramebuffer(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, 0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, GL_COLOR_BUFFER_BIT , GL_NEAREST); + + state.sss_shader.set_conditional(SubsurfScatteringShaderGLES3::USE_11_SAMPLES,subsurface_scatter_quality==SSS_QUALITY_LOW); + state.sss_shader.set_conditional(SubsurfScatteringShaderGLES3::USE_17_SAMPLES,subsurface_scatter_quality==SSS_QUALITY_MEDIUM); + state.sss_shader.set_conditional(SubsurfScatteringShaderGLES3::USE_25_SAMPLES,subsurface_scatter_quality==SSS_QUALITY_HIGH); + state.sss_shader.set_conditional(SubsurfScatteringShaderGLES3::ENABLE_FOLLOW_SURFACE,subsurface_scatter_follow_surface); + state.sss_shader.bind(); + state.sss_shader.set_uniform(SubsurfScatteringShaderGLES3::MAX_RADIUS,subsurface_scatter_size); + state.sss_shader.set_uniform(SubsurfScatteringShaderGLES3::FOVY,p_cam_projection.get_fov()); + state.sss_shader.set_uniform(SubsurfScatteringShaderGLES3::CAMERA_Z_NEAR,p_cam_projection.get_z_near()); + state.sss_shader.set_uniform(SubsurfScatteringShaderGLES3::CAMERA_Z_FAR,p_cam_projection.get_z_far()); + state.sss_shader.set_uniform(SubsurfScatteringShaderGLES3::DIR,Vector2(1,0)); + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->effects.mip_maps[0].color); + + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->buffers.effect); + glActiveTexture(GL_TEXTURE2); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->depth); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_NONE); + + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->fbo); //copy to front first + + _copy_screen(); + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->color); + state.sss_shader.set_uniform(SubsurfScatteringShaderGLES3::DIR,Vector2(0,1)); + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->effects.mip_maps[0].sizes[0].fbo); // copy to base level + _copy_screen(); + + } + + + + if (env->ssr_enabled) { + + //copy normal and roughness to effect buffer + glBindFramebuffer(GL_READ_FRAMEBUFFER, storage->frame.current_rt->buffers.fbo); + glReadBuffer(GL_COLOR_ATTACHMENT2); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, storage->frame.current_rt->buffers.effect_fbo); + glBlitFramebuffer(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, 0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, GL_COLOR_BUFFER_BIT , GL_NEAREST); + + + //blur diffuse into effect mipmaps using separatable convolution + //storage->shaders.copy.set_conditional(CopyShaderGLES3::GAUSSIAN_HORIZONTAL,true); + for(int i=0;i<storage->frame.current_rt->effects.mip_maps[1].sizes.size();i++) { + + + int vp_w = storage->frame.current_rt->effects.mip_maps[1].sizes[i].width; + int vp_h = storage->frame.current_rt->effects.mip_maps[1].sizes[i].height; + glViewport(0,0,vp_w,vp_h); + //horizontal pass + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GAUSSIAN_HORIZONTAL,true); + state.effect_blur_shader.bind(); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::PIXEL_SIZE,Vector2(1.0/vp_w,1.0/vp_h)); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::LOD,float(i)); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->effects.mip_maps[0].color); //previous level, since mipmaps[0] starts one level bigger + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->effects.mip_maps[1].sizes[i].fbo); + _copy_screen(); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GAUSSIAN_HORIZONTAL,false); + + //vertical pass + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GAUSSIAN_VERTICAL,true); + state.effect_blur_shader.bind(); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::PIXEL_SIZE,Vector2(1.0/vp_w,1.0/vp_h)); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::LOD,float(i)); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->effects.mip_maps[1].color); + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->effects.mip_maps[0].sizes[i+1].fbo); //next level, since mipmaps[0] starts one level bigger + _copy_screen(); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GAUSSIAN_VERTICAL,false); + } + + + //perform SSR + + state.ssr_shader.set_conditional(ScreenSpaceReflectionShaderGLES3::SMOOTH_ACCEL,env->ssr_accel>0 && env->ssr_smooth); + state.ssr_shader.set_conditional(ScreenSpaceReflectionShaderGLES3::REFLECT_ROUGHNESS,env->ssr_accel>0 && env->ssr_roughness); + + state.ssr_shader.bind(); + + int ssr_w = storage->frame.current_rt->effects.mip_maps[1].sizes[0].width; + int ssr_h = storage->frame.current_rt->effects.mip_maps[1].sizes[0].height; + + + state.ssr_shader.set_uniform(ScreenSpaceReflectionShaderGLES3::PIXEL_SIZE,Vector2(1.0/(ssr_w*0.5),1.0/(ssr_h*0.5))); + state.ssr_shader.set_uniform(ScreenSpaceReflectionShaderGLES3::CAMERA_Z_NEAR,p_cam_projection.get_z_near()); + state.ssr_shader.set_uniform(ScreenSpaceReflectionShaderGLES3::CAMERA_Z_FAR,p_cam_projection.get_z_far()); + state.ssr_shader.set_uniform(ScreenSpaceReflectionShaderGLES3::PROJECTION,p_cam_projection); + state.ssr_shader.set_uniform(ScreenSpaceReflectionShaderGLES3::INVERSE_PROJECTION,p_cam_projection.inverse()); + state.ssr_shader.set_uniform(ScreenSpaceReflectionShaderGLES3::VIEWPORT_SIZE,Size2(ssr_w,ssr_h)); + //state.ssr_shader.set_uniform(ScreenSpaceReflectionShaderGLES3::FRAME_INDEX,int(render_pass)); + state.ssr_shader.set_uniform(ScreenSpaceReflectionShaderGLES3::FILTER_MIPMAP_LEVELS,float(storage->frame.current_rt->effects.mip_maps[0].sizes.size())); + state.ssr_shader.set_uniform(ScreenSpaceReflectionShaderGLES3::NUM_STEPS,env->ssr_max_steps); + state.ssr_shader.set_uniform(ScreenSpaceReflectionShaderGLES3::ACCELERATION,env->ssr_accel); + state.ssr_shader.set_uniform(ScreenSpaceReflectionShaderGLES3::DEPTH_TOLERANCE,env->ssr_depth_tolerance); + state.ssr_shader.set_uniform(ScreenSpaceReflectionShaderGLES3::DISTANCE_FADE,env->ssr_fade); + + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->effects.mip_maps[0].color); + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->buffers.effect); + glActiveTexture(GL_TEXTURE2); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->depth); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_NONE); + + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->effects.mip_maps[1].sizes[0].fbo); + glViewport(0,0,ssr_w,ssr_h); + + _copy_screen(); + glViewport(0,0,storage->frame.current_rt->width,storage->frame.current_rt->height); + + } + + + + glBindFramebuffer(GL_READ_FRAMEBUFFER, storage->frame.current_rt->buffers.fbo); + glReadBuffer(GL_COLOR_ATTACHMENT1); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, storage->frame.current_rt->fbo); + //glDrawBuffer(GL_COLOR_ATTACHMENT0); + glBlitFramebuffer(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, 0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, GL_COLOR_BUFFER_BIT, GL_NEAREST); + glReadBuffer(GL_COLOR_ATTACHMENT0); + + glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); + + //copy reflection over diffuse, resolving SSR if needed + state.resolve_shader.set_conditional(ResolveShaderGLES3::USE_SSR,env->ssr_enabled); + state.resolve_shader.bind(); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->color); + if (env->ssr_enabled) { + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->effects.mip_maps[1].color); + } + + + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->effects.mip_maps[0].sizes[0].fbo); + glEnable(GL_BLEND); + glBlendEquation(GL_FUNC_ADD); + glBlendFunc(GL_ONE,GL_ONE); //use additive to accumulate one over the other + + _copy_screen(); + + glDisable(GL_BLEND); //end additive + + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::SIMPLE_COPY,true); + state.effect_blur_shader.bind(); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::LOD,float(0)); + + { + GLuint db = GL_COLOR_ATTACHMENT0; + glDrawBuffers(1,&db); + } + + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->buffers.fbo); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->effects.mip_maps[0].color); + + _copy_screen(); + + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::SIMPLE_COPY,false); + + +} + +void RasterizerSceneGLES3::_post_process(Environment *env,const CameraMatrix &p_cam_projection){ + + //copy to front buffer + + glDepthMask(GL_FALSE); + glDisable(GL_DEPTH_TEST); + glDisable(GL_CULL_FACE); + glDisable(GL_BLEND); + glDepthFunc(GL_LEQUAL); + glColorMask(1,1,1,1); + + //turn off everything used + + //copy specular to front buffer + //copy diffuse to effect buffer + + + glReadBuffer(GL_COLOR_ATTACHMENT0); + glBindFramebuffer(GL_READ_FRAMEBUFFER, storage->frame.current_rt->buffers.fbo); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, storage->frame.current_rt->effects.mip_maps[0].sizes[0].fbo); + glBlitFramebuffer(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, 0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height, GL_COLOR_BUFFER_BIT, GL_NEAREST); + + glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); + + if (!env) { + //no environment, simply return and convert to SRGB + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->fbo); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->effects.mip_maps[0].color); + storage->shaders.copy.set_conditional(CopyShaderGLES3::LINEAR_TO_SRGB,true); + storage->shaders.copy.set_conditional(CopyShaderGLES3::DISABLE_ALPHA,true); + storage->shaders.copy.bind(); + + _copy_screen(); + + storage->shaders.copy.set_conditional(CopyShaderGLES3::LINEAR_TO_SRGB,false); + storage->shaders.copy.set_conditional(CopyShaderGLES3::DISABLE_ALPHA,false); //compute luminance + + return; + + } + + + //order of operation + //1) DOF Blur (first blur, then copy to buffer applying the blur) + //2) Motion Blur + //3) Bloom + //4) Tonemap + //5) Adjustments + + GLuint composite_from = storage->frame.current_rt->effects.mip_maps[0].color; + + + if (env->dof_blur_far_enabled) { + + //blur diffuse into effect mipmaps using separatable convolution + //storage->shaders.copy.set_conditional(CopyShaderGLES3::GAUSSIAN_HORIZONTAL,true); + + int vp_h = storage->frame.current_rt->height; + int vp_w = storage->frame.current_rt->width; + + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_FAR_BLUR,true); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_QUALITY_LOW,env->dof_blur_far_quality==VS::ENV_DOF_BLUR_QUALITY_LOW); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_QUALITY_MEDIUM,env->dof_blur_far_quality==VS::ENV_DOF_BLUR_QUALITY_MEDIUM); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_QUALITY_HIGH,env->dof_blur_far_quality==VS::ENV_DOF_BLUR_QUALITY_HIGH); + + state.effect_blur_shader.bind(); + int qsteps[3]={4,10,20}; + + float radius = (env->dof_blur_far_amount*env->dof_blur_far_amount) / qsteps[env->dof_blur_far_quality]; + + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::DOF_BEGIN,env->dof_blur_far_distance); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::DOF_END,env->dof_blur_far_distance+env->dof_blur_far_transition); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::DOF_DIR,Vector2(1,0)); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::DOF_RADIUS,radius); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::PIXEL_SIZE,Vector2(1.0/vp_w,1.0/vp_h)); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::CAMERA_Z_NEAR,p_cam_projection.get_z_near()); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::CAMERA_Z_FAR,p_cam_projection.get_z_far()); + + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->depth); + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,composite_from); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->fbo); //copy to front first + + _copy_screen(); + + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->color); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::DOF_DIR,Vector2(0,1)); + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->effects.mip_maps[0].sizes[0].fbo); // copy to base level + _copy_screen(); + + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_FAR_BLUR,false); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_FAR_BLUR,false); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_QUALITY_LOW,false); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_QUALITY_MEDIUM,false); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_QUALITY_HIGH,false); + + + composite_from=storage->frame.current_rt->effects.mip_maps[0].color; + + } + + if (env->dof_blur_near_enabled) { + + //blur diffuse into effect mipmaps using separatable convolution + //storage->shaders.copy.set_conditional(CopyShaderGLES3::GAUSSIAN_HORIZONTAL,true); + + int vp_h = storage->frame.current_rt->height; + int vp_w = storage->frame.current_rt->width; + + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_NEAR_BLUR,true); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_NEAR_FIRST_TAP,true); + + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_QUALITY_LOW,env->dof_blur_near_quality==VS::ENV_DOF_BLUR_QUALITY_LOW); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_QUALITY_MEDIUM,env->dof_blur_near_quality==VS::ENV_DOF_BLUR_QUALITY_MEDIUM); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_QUALITY_HIGH,env->dof_blur_near_quality==VS::ENV_DOF_BLUR_QUALITY_HIGH); + + state.effect_blur_shader.bind(); + int qsteps[3]={4,10,20}; + + float radius = (env->dof_blur_near_amount*env->dof_blur_near_amount) / qsteps[env->dof_blur_near_quality]; + + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::DOF_BEGIN,env->dof_blur_near_distance); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::DOF_END,env->dof_blur_near_distance-env->dof_blur_near_transition); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::DOF_DIR,Vector2(1,0)); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::DOF_RADIUS,radius); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::PIXEL_SIZE,Vector2(1.0/vp_w,1.0/vp_h)); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::CAMERA_Z_NEAR,p_cam_projection.get_z_near()); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::CAMERA_Z_FAR,p_cam_projection.get_z_far()); + + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->depth); + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,composite_from); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->fbo); //copy to front first + + _copy_screen(); + //manually do the blend if this is the first operation resolving from the diffuse buffer + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_NEAR_BLUR_MERGE,composite_from == storage->frame.current_rt->buffers.diffuse); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_NEAR_FIRST_TAP,false); + state.effect_blur_shader.bind(); + + + + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::DOF_BEGIN,env->dof_blur_near_distance); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::DOF_END,env->dof_blur_near_distance-env->dof_blur_near_transition); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::DOF_DIR,Vector2(0,1)); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::DOF_RADIUS,radius); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::PIXEL_SIZE,Vector2(1.0/vp_w,1.0/vp_h)); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::CAMERA_Z_NEAR,p_cam_projection.get_z_near()); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::CAMERA_Z_FAR,p_cam_projection.get_z_far()); + + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->color); + + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->effects.mip_maps[0].sizes[0].fbo); // copy to base level + + if (composite_from != storage->frame.current_rt->buffers.diffuse) { + + glEnable(GL_BLEND); + glBlendEquation(GL_FUNC_ADD); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + } else { + glActiveTexture(GL_TEXTURE2); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->buffers.diffuse); + + } + + _copy_screen(); + + if (composite_from != storage->frame.current_rt->buffers.diffuse) { + + glDisable(GL_BLEND); + } + + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_NEAR_BLUR,false); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_NEAR_FIRST_TAP,false); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_NEAR_BLUR_MERGE,false); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_QUALITY_LOW,false); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_QUALITY_MEDIUM,false); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::DOF_QUALITY_HIGH,false); + + + composite_from=storage->frame.current_rt->effects.mip_maps[0].color; + + } + + if ( env->auto_exposure) { + + //compute auto exposure + //first step, copy from image to luminance buffer + state.exposure_shader.set_conditional(ExposureShaderGLES3::EXPOSURE_BEGIN,true); + state.exposure_shader.bind(); + int ss[2]={ + storage->frame.current_rt->width, + storage->frame.current_rt->height, + }; + int ds[2]={ + exposure_shrink_size, + exposure_shrink_size, + }; + + glUniform2iv(state.exposure_shader.get_uniform(ExposureShaderGLES3::SOURCE_RENDER_SIZE),1,ss); + glUniform2iv(state.exposure_shader.get_uniform(ExposureShaderGLES3::TARGET_SIZE),1,ds); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->buffers.diffuse); + + + glBindFramebuffer(GL_FRAMEBUFFER,exposure_shrink[0].fbo); + glViewport(0,0,exposure_shrink_size,exposure_shrink_size); + + _copy_screen(); + + + + + + //second step, shrink to 2x2 pixels + state.exposure_shader.set_conditional(ExposureShaderGLES3::EXPOSURE_BEGIN,false); + state.exposure_shader.bind(); + //shrink from second to previous to last level + + int s_size=exposure_shrink_size/3; + for(int i=1;i<exposure_shrink.size()-1;i++) { + + glBindFramebuffer(GL_FRAMEBUFFER,exposure_shrink[i].fbo); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,exposure_shrink[i-1].color); + + _copy_screen(); + + glViewport(0,0,s_size,s_size); + + s_size/=3; + + } + //third step, shrink to 1x1 pixel taking in consideration the previous exposure + state.exposure_shader.set_conditional(ExposureShaderGLES3::EXPOSURE_END,true); + + uint64_t tick = OS::get_singleton()->get_ticks_usec(); + uint64_t tick_diff = storage->frame.current_rt->last_exposure_tick==0?0:tick-storage->frame.current_rt->last_exposure_tick; + storage->frame.current_rt->last_exposure_tick=tick; + + if (tick_diff==0 || tick_diff>1000000) { + state.exposure_shader.set_conditional(ExposureShaderGLES3::EXPOSURE_FORCE_SET,true); + + } + + state.exposure_shader.bind(); + + glBindFramebuffer(GL_FRAMEBUFFER,exposure_shrink[exposure_shrink.size()-1].fbo); + glViewport(0,0,1,1); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,exposure_shrink[exposure_shrink.size()-2].color); + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->exposure.color); //read from previous + + + state.exposure_shader.set_uniform(ExposureShaderGLES3::EXPOSURE_ADJUST,env->auto_exposure_speed*(tick_diff/1000000.0)); + state.exposure_shader.set_uniform(ExposureShaderGLES3::MAX_LUMINANCE,env->auto_exposure_max); + state.exposure_shader.set_uniform(ExposureShaderGLES3::MIN_LUMINANCE,env->auto_exposure_min); + + _copy_screen(); + + state.exposure_shader.set_conditional(ExposureShaderGLES3::EXPOSURE_FORCE_SET,false); + state.exposure_shader.set_conditional(ExposureShaderGLES3::EXPOSURE_END,false); + + //last step, swap with the framebuffer exposure, so the right exposure is kept int he framebuffer + SWAP(exposure_shrink[exposure_shrink.size()-1].fbo,storage->frame.current_rt->exposure.fbo); + SWAP(exposure_shrink[exposure_shrink.size()-1].color,storage->frame.current_rt->exposure.color); + + + glViewport(0,0,storage->frame.current_rt->width,storage->frame.current_rt->height); + + } + + + int max_glow_level=-1; + int glow_mask=0; + + + if (env->glow_enabled) { + + + for(int i=0;i<VS::MAX_GLOW_LEVELS;i++) { + if (env->glow_levels&(1<<i)) { + + if (i>=storage->frame.current_rt->effects.mip_maps[1].sizes.size()) { + max_glow_level=storage->frame.current_rt->effects.mip_maps[1].sizes.size()-1; + glow_mask|=1<<max_glow_level; + + } else { + max_glow_level=i; + glow_mask|=(1<<i); + } + + } + } + + + //blur diffuse into effect mipmaps using separatable convolution + //storage->shaders.copy.set_conditional(CopyShaderGLES3::GAUSSIAN_HORIZONTAL,true); + + for(int i=0;i<(max_glow_level+1);i++) { + + + int vp_w = storage->frame.current_rt->effects.mip_maps[1].sizes[i].width; + int vp_h = storage->frame.current_rt->effects.mip_maps[1].sizes[i].height; + glViewport(0,0,vp_w,vp_h); + //horizontal pass + if (i==0) { + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GLOW_FIRST_PASS,true); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GLOW_USE_AUTO_EXPOSURE,env->auto_exposure); + } + + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GLOW_GAUSSIAN_HORIZONTAL,true); + state.effect_blur_shader.bind(); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::PIXEL_SIZE,Vector2(1.0/vp_w,1.0/vp_h)); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::LOD,float(i)); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::GLOW_STRENGTH,env->glow_strength); + + glActiveTexture(GL_TEXTURE0); + if (i==0) { + glBindTexture(GL_TEXTURE_2D,composite_from); + + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::EXPOSURE,env->tone_mapper_exposure); + if (env->auto_exposure) { + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::AUTO_EXPOSURE_GREY,env->auto_exposure_grey); + } + + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->exposure.color); + + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::GLOW_BLOOM,env->glow_bloom); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::GLOW_HDR_TRESHOLD,env->glow_hdr_bleed_treshold); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::GLOW_HDR_SCALE,env->glow_hdr_bleed_scale); + + } else { + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->effects.mip_maps[0].color); //previous level, since mipmaps[0] starts one level bigger + } + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->effects.mip_maps[1].sizes[i].fbo); + _copy_screen(); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GLOW_GAUSSIAN_HORIZONTAL,false); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GLOW_FIRST_PASS,false); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GLOW_USE_AUTO_EXPOSURE,false); + + //vertical pass + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GLOW_GAUSSIAN_VERTICAL,true); + state.effect_blur_shader.bind(); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::PIXEL_SIZE,Vector2(1.0/vp_w,1.0/vp_h)); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::LOD,float(i)); + state.effect_blur_shader.set_uniform(EffectBlurShaderGLES3::GLOW_STRENGTH,env->glow_strength); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->effects.mip_maps[1].color); + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->effects.mip_maps[0].sizes[i+1].fbo); //next level, since mipmaps[0] starts one level bigger + _copy_screen(); + state.effect_blur_shader.set_conditional(EffectBlurShaderGLES3::GLOW_GAUSSIAN_VERTICAL,false); + } + + glViewport(0,0,storage->frame.current_rt->width,storage->frame.current_rt->height); + + } + + + + + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->fbo); + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,composite_from); + + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_FILMIC_TONEMAPPER,env->tone_mapper==VS::ENV_TONE_MAPPER_FILMIC); + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_ACES_TONEMAPPER,env->tone_mapper==VS::ENV_TONE_MAPPER_ACES); + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_REINDHART_TONEMAPPER,env->tone_mapper==VS::ENV_TONE_MAPPER_REINHARDT); + + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_AUTO_EXPOSURE,env->auto_exposure); + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_FILTER_BICUBIC,env->glow_bicubic_upscale); + + + + if (max_glow_level>=0) { + + + for(int i=0;i<(max_glow_level+1);i++) { + + if (glow_mask&(1<<i)) { + if (i==0) { + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_LEVEL1,true); + } + if (i==1) { + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_LEVEL2,true); + } + if (i==2) { + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_LEVEL3,true); + } + if (i==3) { + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_LEVEL4,true); + } + if (i==4) { + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_LEVEL5,true); + } + if (i==5) { + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_LEVEL6,true); + } + if (i==6) { + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_LEVEL7,true); + } + } + } + + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_SCREEN,env->glow_blend_mode==VS::GLOW_BLEND_MODE_SCREEN); + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_SOFTLIGHT,env->glow_blend_mode==VS::GLOW_BLEND_MODE_SOFTLIGHT); + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_REPLACE,env->glow_blend_mode==VS::GLOW_BLEND_MODE_REPLACE); + glActiveTexture(GL_TEXTURE2); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->effects.mip_maps[0].color); + + } + + state.tonemap_shader.bind(); + + state.tonemap_shader.set_uniform(TonemapShaderGLES3::EXPOSURE,env->tone_mapper_exposure); + state.tonemap_shader.set_uniform(TonemapShaderGLES3::WHITE,env->tone_mapper_exposure_white); + + if (max_glow_level>=0) { + + state.tonemap_shader.set_uniform(TonemapShaderGLES3::GLOW_INTENSITY,env->glow_intensity); + int ss[2]={ + storage->frame.current_rt->width, + storage->frame.current_rt->height, + }; + glUniform2iv(state.tonemap_shader.get_uniform(TonemapShaderGLES3::GLOW_TEXTURE_SIZE),1,ss); + + } + + if (env->auto_exposure) { + + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->exposure.color); + state.tonemap_shader.set_uniform(TonemapShaderGLES3::AUTO_EXPOSURE_GREY,env->auto_exposure_grey); + + } + + + + _copy_screen(); + + //turn off everything used + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_AUTO_EXPOSURE,false); + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_FILMIC_TONEMAPPER,false); + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_ACES_TONEMAPPER,false); + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_REINDHART_TONEMAPPER,false); + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_LEVEL1,false); + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_LEVEL2,false); + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_LEVEL3,false); + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_LEVEL4,false); + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_LEVEL5,false); + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_LEVEL6,false); + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_LEVEL7,false); + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_REPLACE,false); + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_SCREEN,false); + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_SOFTLIGHT,false); + state.tonemap_shader.set_conditional(TonemapShaderGLES3::USE_GLOW_FILTER_BICUBIC,false); + +} + +void RasterizerSceneGLES3::render_scene(const Transform& p_cam_transform,const CameraMatrix& p_cam_projection,bool p_cam_ortogonal,InstanceBase** p_cull_result,int p_cull_count,RID* p_light_cull_result,int p_light_cull_count,RID* p_reflection_probe_cull_result,int p_reflection_probe_cull_count,RID p_environment,RID p_shadow_atlas,RID p_reflection_atlas,RID p_reflection_probe,int p_reflection_probe_pass){ + + //first of all, make a new render pass + render_pass++; + + + //fill up ubo + + Environment *env = environment_owner.getornull(p_environment); + ShadowAtlas *shadow_atlas = shadow_atlas_owner.getornull(p_shadow_atlas); + ReflectionAtlas *reflection_atlas = reflection_atlas_owner.getornull(p_reflection_atlas); + + if (shadow_atlas && shadow_atlas->size) { + glActiveTexture(GL_TEXTURE0+storage->config.max_texture_image_units-3); + glBindTexture(GL_TEXTURE_2D,shadow_atlas->depth); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, GL_LESS); + state.ubo_data.shadow_atlas_pixel_size[0]=1.0/shadow_atlas->size; + state.ubo_data.shadow_atlas_pixel_size[1]=1.0/shadow_atlas->size; + } + + + if (reflection_atlas && reflection_atlas->size) { + glActiveTexture(GL_TEXTURE0+storage->config.max_texture_image_units-5); + glBindTexture(GL_TEXTURE_2D,reflection_atlas->color); + } + + if (p_reflection_probe.is_valid()) { + state.ubo_data.reflection_multiplier=0.0; + } else { + state.ubo_data.reflection_multiplier=1.0; + } + + state.ubo_data.subsurface_scatter_width=subsurface_scatter_size; + + + state.ubo_data.shadow_z_offset=0; + state.ubo_data.shadow_slope_scale=0; + state.ubo_data.shadow_dual_paraboloid_render_side=0; + state.ubo_data.shadow_dual_paraboloid_render_zfar=0; + + _setup_environment(env,p_cam_projection,p_cam_transform); + + bool fb_cleared=false; + + glDepthFunc(GL_LEQUAL); + + + if (storage->frame.current_rt && true) { + //pre z pass + + + glDisable(GL_BLEND); + glDepthMask(GL_TRUE); + glEnable(GL_DEPTH_TEST); + glDisable(GL_SCISSOR_TEST); + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->buffers.fbo); + glDrawBuffers(0,NULL); + + glViewport(0,0,storage->frame.current_rt->width,storage->frame.current_rt->height); + + glColorMask(0,0,0,0); + + glClearDepth(1.0); + glClear(GL_DEPTH_BUFFER_BIT); + + + render_list.clear(); + _fill_render_list(p_cull_result,p_cull_count,true); + render_list.sort_by_depth(false); + state.scene_shader.set_conditional(SceneShaderGLES3::RENDER_DEPTH,true); + _render_list(render_list.elements,render_list.element_count,p_cam_transform,p_cam_projection,0,false,false,true,false,false); + state.scene_shader.set_conditional(SceneShaderGLES3::RENDER_DEPTH,false); + + glColorMask(1,1,1,1); + + fb_cleared=true; + render_pass++; + } + + + _setup_lights(p_light_cull_result,p_light_cull_count,p_cam_transform.affine_inverse(),p_cam_projection,p_shadow_atlas); + _setup_reflections(p_reflection_probe_cull_result,p_reflection_probe_cull_count,p_cam_transform.affine_inverse(),p_cam_projection,p_reflection_atlas,env); + + render_list.clear(); + + + bool use_mrt=false; + + + _fill_render_list(p_cull_result,p_cull_count,false); + // + + + glEnable(GL_BLEND); + glDepthMask(GL_TRUE); + glEnable(GL_DEPTH_TEST); + glDisable(GL_SCISSOR_TEST); + + //rendering to a probe cubemap side + ReflectionProbeInstance *probe = reflection_probe_instance_owner.getornull(p_reflection_probe); + GLuint current_fbo; + + + + if (probe) { + + ReflectionAtlas *ref_atlas = reflection_atlas_owner.getptr(probe->atlas); + ERR_FAIL_COND(!ref_atlas); + + int target_size=ref_atlas->size/ref_atlas->subdiv; + + int cubemap_index=reflection_cubemaps.size()-1; + + for(int i=reflection_cubemaps.size()-1;i>=0;i--) { + //find appropriate cubemap to render to + if (reflection_cubemaps[i].size>target_size*2) + break; + + cubemap_index=i; + } + + current_fbo=reflection_cubemaps[cubemap_index].fbo_id[p_reflection_probe_pass]; + use_mrt=false; + state.scene_shader.set_conditional(SceneShaderGLES3::USE_MULTIPLE_RENDER_TARGETS,false); + + glViewport(0,0,reflection_cubemaps[cubemap_index].size,reflection_cubemaps[cubemap_index].size); + glBindFramebuffer(GL_FRAMEBUFFER,current_fbo); + + } else { + + use_mrt = state.used_sss || (env && (env->ssao_enabled || env->ssr_enabled)); //only enable MRT rendering if any of these is enabled + + glViewport(0,0,storage->frame.current_rt->width,storage->frame.current_rt->height); + + if (use_mrt) { + + current_fbo=storage->frame.current_rt->buffers.fbo; + + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->buffers.fbo); + state.scene_shader.set_conditional(SceneShaderGLES3::USE_MULTIPLE_RENDER_TARGETS,true); + + + Vector<GLenum> draw_buffers; + draw_buffers.push_back(GL_COLOR_ATTACHMENT0); + draw_buffers.push_back(GL_COLOR_ATTACHMENT1); + draw_buffers.push_back(GL_COLOR_ATTACHMENT2); + if (state.used_sss) { + draw_buffers.push_back(GL_COLOR_ATTACHMENT3); + } + glDrawBuffers(draw_buffers.size(),draw_buffers.ptr()); + + Color black(0,0,0,0); + glClearBufferfv(GL_COLOR,1,black.components); // specular + glClearBufferfv(GL_COLOR,2,black.components); // normal metal rough + if (state.used_sss) { + glClearBufferfv(GL_COLOR,3,black.components); // normal metal rough + } + + } else { + + + + current_fbo = storage->frame.current_rt->buffers.fbo; + glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->buffers.fbo); + state.scene_shader.set_conditional(SceneShaderGLES3::USE_MULTIPLE_RENDER_TARGETS,false); + + Vector<GLenum> draw_buffers; + draw_buffers.push_back(GL_COLOR_ATTACHMENT0); + glDrawBuffers(draw_buffers.size(),draw_buffers.ptr()); + + } + } + + if (!fb_cleared) { + glClearDepth(1.0); + glClear(GL_DEPTH_BUFFER_BIT); + } + + Color clear_color(0,0,0,0); + + RasterizerStorageGLES3::SkyBox *skybox=NULL; + GLuint env_radiance_tex=0; + + if (!env || env->bg_mode==VS::ENV_BG_CLEAR_COLOR) { + + if (storage->frame.clear_request) { + + clear_color = storage->frame.clear_request_color.to_linear(); + storage->frame.clear_request=false; + + } + + } else if (env->bg_mode==VS::ENV_BG_COLOR) { + + clear_color = env->bg_color.to_linear(); + storage->frame.clear_request=false; + } else if (env->bg_mode==VS::ENV_BG_SKYBOX) { + + skybox = storage->skybox_owner.getornull(env->skybox); + + if (skybox) { + env_radiance_tex=skybox->radiance; + } + storage->frame.clear_request=false; + + } else { + storage->frame.clear_request=false; + } + + glClearBufferfv(GL_COLOR,0,clear_color.components); // specular + + + state.texscreen_copied=false; + + glBlendEquation(GL_FUNC_ADD); + + if (storage->frame.current_rt && storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT]) { + glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + } else { + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + } + + glDisable(GL_BLEND); + + render_list.sort_by_key(false); + + if (storage->frame.current_rt && storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_TRANSPARENT]) { + glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + } else { + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + } + + + + if (state.directional_light_count==0) { + directional_light=NULL; + _render_list(render_list.elements,render_list.element_count,p_cam_transform,p_cam_projection,env_radiance_tex,false,false,false,false,shadow_atlas!=NULL); + } else { + for(int i=0;i<state.directional_light_count;i++) { + directional_light=directional_lights[i]; + if (i>0) { + glEnable(GL_BLEND); + } + _setup_directional_light(i,p_cam_transform.affine_inverse(),shadow_atlas!=NULL); + _render_list(render_list.elements,render_list.element_count,p_cam_transform,p_cam_projection,env_radiance_tex,false,false,false,i>0,shadow_atlas!=NULL); + + } + } + + + state.scene_shader.set_conditional(SceneShaderGLES3::USE_MULTIPLE_RENDER_TARGETS,false); + + if (use_mrt) { + GLenum gldb = GL_COLOR_ATTACHMENT0; + glDrawBuffers(1,&gldb); + } + + if (env && env->bg_mode==VS::ENV_BG_SKYBOX) { + + //if (use_mrt) { + // glBindFramebuffer(GL_FRAMEBUFFER,storage->frame.current_rt->buffers.fbo); //switch to alpha fbo for skybox, only diffuse/ambient matters + // + + _draw_skybox(skybox,p_cam_projection,p_cam_transform,storage->frame.current_rt && storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_VFLIP],env->skybox_scale); + } + + + + + + //_render_list_forward(&alpha_render_list,camera_transform,camera_transform_inverse,camera_projection,false,fragment_lighting,true); + //glColorMask(1,1,1,1); + +// state.scene_shader.set_conditional( SceneShaderGLES3::USE_FOG,false); + + + if (use_mrt) { + _render_mrts(env,p_cam_projection); + } + + glPolygonMode(GL_FRONT_AND_BACK,GL_FILL); + glEnable(GL_BLEND); + glDepthMask(GL_TRUE); + glEnable(GL_DEPTH_TEST); + glDisable(GL_SCISSOR_TEST); + + render_list.sort_by_depth(true); + + if (state.directional_light_count==0) { + directional_light=NULL; + _render_list(&render_list.elements[render_list.max_elements-render_list.alpha_element_count],render_list.alpha_element_count,p_cam_transform,p_cam_projection,env_radiance_tex,false,true,false,false,shadow_atlas!=NULL); + } else { + for(int i=0;i<state.directional_light_count;i++) { + directional_light=directional_lights[i]; + _setup_directional_light(i,p_cam_transform.affine_inverse(),shadow_atlas!=NULL); + _render_list(&render_list.elements[render_list.max_elements-render_list.alpha_element_count],render_list.alpha_element_count,p_cam_transform,p_cam_projection,env_radiance_tex,false,true,false,i>0,shadow_atlas!=NULL); + + } + } + + if (probe) { + //rendering a probe, do no more! + return; + } + + + _post_process(env,p_cam_projection); + + + if (false && shadow_atlas) { + + //_copy_texture_to_front_buffer(shadow_atlas->depth); + storage->canvas->canvas_begin(); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,shadow_atlas->depth); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_NONE); + storage->canvas->draw_generic_textured_rect(Rect2(0,0,storage->frame.current_rt->width/2,storage->frame.current_rt->height/2),Rect2(0,0,1,1)); + + } + + if (false && storage->frame.current_rt) { + + //_copy_texture_to_front_buffer(shadow_atlas->depth); + storage->canvas->canvas_begin(); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,exposure_shrink[4].color); +// glBindTexture(GL_TEXTURE_2D,storage->frame.current_rt->exposure.color); + storage->canvas->draw_generic_textured_rect(Rect2(0,0,storage->frame.current_rt->width/16,storage->frame.current_rt->height/16),Rect2(0,0,1,1)); + + } + + if (false && reflection_atlas && storage->frame.current_rt) { + + //_copy_texture_to_front_buffer(shadow_atlas->depth); + storage->canvas->canvas_begin(); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,reflection_atlas->color); + storage->canvas->draw_generic_textured_rect(Rect2(0,0,storage->frame.current_rt->width/2,storage->frame.current_rt->height/2),Rect2(0,0,1,1)); + + } + + if (false && directional_shadow.fbo) { + + //_copy_texture_to_front_buffer(shadow_atlas->depth); + storage->canvas->canvas_begin(); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,directional_shadow.depth); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_NONE); + storage->canvas->draw_generic_textured_rect(Rect2(0,0,storage->frame.current_rt->width/2,storage->frame.current_rt->height/2),Rect2(0,0,1,1)); + + } + + if (false && env_radiance_tex) { + + //_copy_texture_to_front_buffer(shadow_atlas->depth); + storage->canvas->canvas_begin(); + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,env_radiance_tex); + storage->canvas->draw_generic_textured_rect(Rect2(0,0,storage->frame.current_rt->width/2,storage->frame.current_rt->height/2),Rect2(0,0,1,1)); + + } + + +#if 0 + if (use_fb) { + + + + for(int i=0;i<VS::ARRAY_MAX;i++) { + glDisableVertexAttribArray(i); + } + glBindBuffer(GL_ARRAY_BUFFER,0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,0); + glDisable(GL_BLEND); + glDisable(GL_DEPTH_TEST); + glDisable(GL_CULL_FACE); + glDisable(GL_SCISSOR_TEST); + glDepthMask(false); + + if (current_env && current_env->fx_enabled[VS::ENV_FX_HDR]) { + + int hdr_tm = current_env->fx_param[VS::ENV_FX_PARAM_HDR_TONEMAPPER]; + switch(hdr_tm) { + case VS::ENV_FX_HDR_TONE_MAPPER_LINEAR: { + + + } break; + case VS::ENV_FX_HDR_TONE_MAPPER_LOG: { + copy_shader.set_conditional(CopyShaderGLES2::USE_LOG_TONEMAPPER,true); + + } break; + case VS::ENV_FX_HDR_TONE_MAPPER_REINHARDT: { + copy_shader.set_conditional(CopyShaderGLES2::USE_REINHARDT_TONEMAPPER,true); + } break; + case VS::ENV_FX_HDR_TONE_MAPPER_REINHARDT_AUTOWHITE: { + + copy_shader.set_conditional(CopyShaderGLES2::USE_REINHARDT_TONEMAPPER,true); + copy_shader.set_conditional(CopyShaderGLES2::USE_AUTOWHITE,true); + } break; + } + + + _process_hdr(); + } + if (current_env && current_env->fx_enabled[VS::ENV_FX_GLOW]) { + _process_glow_bloom(); + int glow_transfer_mode=current_env->fx_param[VS::ENV_FX_PARAM_GLOW_BLUR_BLEND_MODE]; + if (glow_transfer_mode==1) + copy_shader.set_conditional(CopyShaderGLES2::USE_GLOW_SCREEN,true); + if (glow_transfer_mode==2) + copy_shader.set_conditional(CopyShaderGLES2::USE_GLOW_SOFTLIGHT,true); + } + + glBindFramebuffer(GL_FRAMEBUFFER, current_rt?current_rt->fbo:base_framebuffer); + + Size2 size; + if (current_rt) { + glBindFramebuffer(GL_FRAMEBUFFER, current_rt->fbo); + glViewport( 0,0,viewport.width,viewport.height); + size=Size2(viewport.width,viewport.height); + } else { + glBindFramebuffer(GL_FRAMEBUFFER, base_framebuffer); + glViewport( viewport.x, window_size.height-(viewport.height+viewport.y), viewport.width,viewport.height ); + size=Size2(viewport.width,viewport.height); + } + + //time to copy!!! + copy_shader.set_conditional(CopyShaderGLES2::USE_BCS,current_env && current_env->fx_enabled[VS::ENV_FX_BCS]); + copy_shader.set_conditional(CopyShaderGLES2::USE_SRGB,current_env && current_env->fx_enabled[VS::ENV_FX_SRGB]); + copy_shader.set_conditional(CopyShaderGLES2::USE_GLOW,current_env && current_env->fx_enabled[VS::ENV_FX_GLOW]); + copy_shader.set_conditional(CopyShaderGLES2::USE_HDR,current_env && current_env->fx_enabled[VS::ENV_FX_HDR]); + copy_shader.set_conditional(CopyShaderGLES2::USE_NO_ALPHA,true); + copy_shader.set_conditional(CopyShaderGLES2::USE_FXAA,current_env && current_env->fx_enabled[VS::ENV_FX_FXAA]); + + copy_shader.bind(); + //copy_shader.set_uniform(CopyShaderGLES2::SOURCE,0); + + if (current_env && current_env->fx_enabled[VS::ENV_FX_GLOW]) { + + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D, framebuffer.blur[0].color ); + glUniform1i(copy_shader.get_uniform_location(CopyShaderGLES2::GLOW_SOURCE),1); + + } + + if (current_env && current_env->fx_enabled[VS::ENV_FX_HDR]) { + + glActiveTexture(GL_TEXTURE2); + glBindTexture(GL_TEXTURE_2D, current_vd->lum_color ); + glUniform1i(copy_shader.get_uniform_location(CopyShaderGLES2::HDR_SOURCE),2); + copy_shader.set_uniform(CopyShaderGLES2::TONEMAP_EXPOSURE,float(current_env->fx_param[VS::ENV_FX_PARAM_HDR_EXPOSURE])); + copy_shader.set_uniform(CopyShaderGLES2::TONEMAP_WHITE,float(current_env->fx_param[VS::ENV_FX_PARAM_HDR_WHITE])); + + } + + if (current_env && current_env->fx_enabled[VS::ENV_FX_FXAA]) + copy_shader.set_uniform(CopyShaderGLES2::PIXEL_SIZE,Size2(1.0/size.x,1.0/size.y)); + + + if (current_env && current_env->fx_enabled[VS::ENV_FX_BCS]) { + + Vector3 bcs; + bcs.x=current_env->fx_param[VS::ENV_FX_PARAM_BCS_BRIGHTNESS]; + bcs.y=current_env->fx_param[VS::ENV_FX_PARAM_BCS_CONTRAST]; + bcs.z=current_env->fx_param[VS::ENV_FX_PARAM_BCS_SATURATION]; + copy_shader.set_uniform(CopyShaderGLES2::BCS,bcs); + } + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, framebuffer.color ); + glUniform1i(copy_shader.get_uniform_location(CopyShaderGLES2::SOURCE),0); + + _copy_screen_quad(); + + copy_shader.set_conditional(CopyShaderGLES2::USE_BCS,false); + copy_shader.set_conditional(CopyShaderGLES2::USE_SRGB,false); + copy_shader.set_conditional(CopyShaderGLES2::USE_GLOW,false); + copy_shader.set_conditional(CopyShaderGLES2::USE_HDR,false); + copy_shader.set_conditional(CopyShaderGLES2::USE_NO_ALPHA,false); + copy_shader.set_conditional(CopyShaderGLES2::USE_FXAA,false); + copy_shader.set_conditional(CopyShaderGLES2::USE_GLOW_SCREEN,false); + copy_shader.set_conditional(CopyShaderGLES2::USE_GLOW_SOFTLIGHT,false); + copy_shader.set_conditional(CopyShaderGLES2::USE_REINHARDT_TONEMAPPER,false); + copy_shader.set_conditional(CopyShaderGLES2::USE_AUTOWHITE,false); + copy_shader.set_conditional(CopyShaderGLES2::USE_LOG_TONEMAPPER,false); + + state.scene_shader.set_conditional(SceneShaderGLES3::USE_8BIT_HDR,false); + + + if (current_env && current_env->fx_enabled[VS::ENV_FX_HDR] && GLOBAL_DEF("rasterizer/debug_hdr",false)) { + _debug_luminances(); + } + } + + current_env=NULL; + current_debug=VS::SCENARIO_DEBUG_DISABLED; + if (GLOBAL_DEF("rasterizer/debug_shadow_maps",false)) { + _debug_shadows(); + } +// _debug_luminances(); +// _debug_samplers(); + + if (using_canvas_bg) { + using_canvas_bg=false; + glColorMask(1,1,1,1); //don't touch alpha + } +#endif +} + +void RasterizerSceneGLES3::render_shadow(RID p_light,RID p_shadow_atlas,int p_pass,InstanceBase** p_cull_result,int p_cull_count) { + + render_pass++; + + directional_light=NULL; + + LightInstance *light_instance = light_instance_owner.getornull(p_light); + ERR_FAIL_COND(!light_instance); + RasterizerStorageGLES3::Light *light = storage->light_owner.getornull(light_instance->light); + ERR_FAIL_COND(!light); + + uint32_t x,y,width,height,vp_height; + + + float dp_direction=0.0; + float zfar=0; + bool flip_facing=false; + int custom_vp_size=0; + GLuint fbo; + int current_cubemap=-1; + float bias=0; + float normal_bias=0; + + CameraMatrix light_projection; + Transform light_transform; + + + if (light->type==VS::LIGHT_DIRECTIONAL) { + //set pssm stuff + if (light_instance->last_scene_shadow_pass!=scene_pass) { + //assign rect if unassigned + light_instance->light_directional_index = directional_shadow.current_light; + light_instance->last_scene_shadow_pass=scene_pass; + directional_shadow.current_light++; + + if (directional_shadow.light_count==1) { + light_instance->directional_rect=Rect2(0,0,directional_shadow.size,directional_shadow.size); + } else if (directional_shadow.light_count==2) { + light_instance->directional_rect=Rect2(0,0,directional_shadow.size,directional_shadow.size/2); + if (light_instance->light_directional_index==1) { + light_instance->directional_rect.pos.x+=light_instance->directional_rect.size.x; + } + } else { //3 and 4 + light_instance->directional_rect=Rect2(0,0,directional_shadow.size/2,directional_shadow.size/2); + if (light_instance->light_directional_index&1) { + light_instance->directional_rect.pos.x+=light_instance->directional_rect.size.x; + } + if (light_instance->light_directional_index/2) { + light_instance->directional_rect.pos.y+=light_instance->directional_rect.size.y; + } + } + } + + light_projection=light_instance->shadow_transform[p_pass].camera; + light_transform=light_instance->shadow_transform[p_pass].transform; + + x=light_instance->directional_rect.pos.x; + y=light_instance->directional_rect.pos.y; + width=light_instance->directional_rect.size.x; + height=light_instance->directional_rect.size.y; + + + + if (light->directional_shadow_mode==VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS) { + + + width/=2; + height/=2; + + if (p_pass==0) { + + } else if (p_pass==1) { + x+=width; + } else if (p_pass==2) { + y+=height; + } else if (p_pass==3) { + x+=width; + y+=height; + + } + + + + } else if (light->directional_shadow_mode==VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS) { + + height/=2; + + if (p_pass==0) { + + } else { + y+=height; + } + + } + + zfar=light->param[VS::LIGHT_PARAM_RANGE]; + bias=light->param[VS::LIGHT_PARAM_SHADOW_BIAS]; + normal_bias=light->param[VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS]; + fbo=directional_shadow.fbo; + vp_height=directional_shadow.size; + + } else { + //set from shadow atlas + + ShadowAtlas *shadow_atlas = shadow_atlas_owner.getornull(p_shadow_atlas); + ERR_FAIL_COND(!shadow_atlas); + ERR_FAIL_COND(!shadow_atlas->shadow_owners.has(p_light)); + + fbo=shadow_atlas->fbo; + vp_height=shadow_atlas->size; + + uint32_t key = shadow_atlas->shadow_owners[p_light]; + + uint32_t quadrant = (key >> ShadowAtlas::QUADRANT_SHIFT)&0x3; + uint32_t shadow = key & ShadowAtlas::SHADOW_INDEX_MASK; + + ERR_FAIL_INDEX(shadow,shadow_atlas->quadrants[quadrant].shadows.size()); + + uint32_t quadrant_size = shadow_atlas->size>>1; + + x=(quadrant&1)*quadrant_size; + y=(quadrant>>1)*quadrant_size; + + uint32_t shadow_size = (quadrant_size / shadow_atlas->quadrants[quadrant].subdivision); + x+=(shadow % shadow_atlas->quadrants[quadrant].subdivision) * shadow_size; + y+=(shadow / shadow_atlas->quadrants[quadrant].subdivision) * shadow_size; + + width=shadow_size; + height=shadow_size; + + if (light->type==VS::LIGHT_OMNI) { + + + if (light->omni_shadow_mode==VS::LIGHT_OMNI_SHADOW_CUBE) { + + int cubemap_index=shadow_cubemaps.size()-1; + + for(int i=shadow_cubemaps.size()-1;i>=0;i--) { + //find appropriate cubemap to render to + if (shadow_cubemaps[i].size>shadow_size*2) + break; + + cubemap_index=i; + } + + fbo=shadow_cubemaps[cubemap_index].fbo_id[p_pass]; + light_projection=light_instance->shadow_transform[0].camera; + light_transform=light_instance->shadow_transform[0].transform; + custom_vp_size=shadow_cubemaps[cubemap_index].size; + zfar=light->param[VS::LIGHT_PARAM_RANGE]; + + current_cubemap=cubemap_index; + + + } else { + + light_projection=light_instance->shadow_transform[0].camera; + light_transform=light_instance->shadow_transform[0].transform; + + if (light->omni_shadow_detail==VS::LIGHT_OMNI_SHADOW_DETAIL_HORIZONTAL) { + + height/=2; + y+=p_pass*height; + } else { + width/=2; + x+=p_pass*width; + + } + + dp_direction = p_pass==0?1.0:-1.0; + flip_facing = (p_pass == 1); + zfar=light->param[VS::LIGHT_PARAM_RANGE]; + bias=light->param[VS::LIGHT_PARAM_SHADOW_BIAS]; + + state.scene_shader.set_conditional(SceneShaderGLES3::RENDER_DEPTH_DUAL_PARABOLOID,true); + } + + } else if (light->type==VS::LIGHT_SPOT) { + + light_projection=light_instance->shadow_transform[0].camera; + light_transform=light_instance->shadow_transform[0].transform; + + dp_direction = 1.0; + flip_facing = false; + zfar=light->param[VS::LIGHT_PARAM_RANGE]; + bias=light->param[VS::LIGHT_PARAM_SHADOW_BIAS]; + normal_bias=light->param[VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS]; + } + + } + + //todo hacer que se redibuje cuando corresponde + + + render_list.clear(); + _fill_render_list(p_cull_result,p_cull_count,true); + + render_list.sort_by_depth(false); //shadow is front to back for performance + + glDepthMask(true); + glColorMask(1,1,1,1); + glDisable(GL_BLEND); + glDisable(GL_DITHER); + glEnable(GL_DEPTH_TEST); + glBindFramebuffer(GL_FRAMEBUFFER,fbo); + + if (custom_vp_size) { + glViewport(0,0,custom_vp_size,custom_vp_size); + glScissor(0,0,custom_vp_size,custom_vp_size); + + + } else { + glViewport(x,y,width,height); + glScissor(x,y,width,height); + } + + glEnable(GL_SCISSOR_TEST); + glClearDepth(1.0); + glClear(GL_DEPTH_BUFFER_BIT); + glDisable(GL_SCISSOR_TEST); + + state.ubo_data.shadow_z_offset=bias; + state.ubo_data.shadow_slope_scale=normal_bias; + state.ubo_data.shadow_dual_paraboloid_render_side=dp_direction; + state.ubo_data.shadow_dual_paraboloid_render_zfar=zfar; + + _setup_environment(NULL,light_projection,light_transform); + + state.scene_shader.set_conditional(SceneShaderGLES3::RENDER_DEPTH,true); + + _render_list(render_list.elements,render_list.element_count,light_transform,light_projection,0,!flip_facing,false,true,false,false); + + state.scene_shader.set_conditional(SceneShaderGLES3::RENDER_DEPTH,false); + state.scene_shader.set_conditional(SceneShaderGLES3::RENDER_DEPTH_DUAL_PARABOLOID,false); + + + if (light->type==VS::LIGHT_OMNI && light->omni_shadow_mode==VS::LIGHT_OMNI_SHADOW_CUBE && p_pass==5) { + //convert the chosen cubemap to dual paraboloid! + + ShadowAtlas *shadow_atlas = shadow_atlas_owner.getornull(p_shadow_atlas); + + glBindFramebuffer(GL_FRAMEBUFFER,shadow_atlas->fbo); + state.cube_to_dp_shader.bind(); + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_CUBE_MAP,shadow_cubemaps[current_cubemap].cubemap); + glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_COMPARE_MODE, GL_NONE); + glDisable(GL_CULL_FACE); + + for(int i=0;i<2;i++) { + + state.cube_to_dp_shader.set_uniform(CubeToDpShaderGLES3::Z_FLIP,i==1); + state.cube_to_dp_shader.set_uniform(CubeToDpShaderGLES3::Z_NEAR,light_projection.get_z_near()); + state.cube_to_dp_shader.set_uniform(CubeToDpShaderGLES3::Z_FAR,light_projection.get_z_far()); + state.cube_to_dp_shader.set_uniform(CubeToDpShaderGLES3::BIAS,light->param[VS::LIGHT_PARAM_SHADOW_BIAS]); + + uint32_t local_width=width,local_height=height; + uint32_t local_x=x,local_y=y; + if (light->omni_shadow_detail==VS::LIGHT_OMNI_SHADOW_DETAIL_HORIZONTAL) { + + local_height/=2; + local_y+=i*local_height; + } else { + local_width/=2; + local_x+=i*local_width; + } + + glViewport(local_x,local_y,local_width,local_height); + glScissor(local_x,local_y,local_width,local_height); + glEnable(GL_SCISSOR_TEST); + glClearDepth(1.0); + glClear(GL_DEPTH_BUFFER_BIT); + glDisable(GL_SCISSOR_TEST); + //glDisable(GL_DEPTH_TEST); + glDisable(GL_BLEND); + + _copy_screen(); + + } + + } + + glColorMask(1,1,1,1); + + +} + +void RasterizerSceneGLES3::set_scene_pass(uint64_t p_pass) { + scene_pass=p_pass; +} + +bool RasterizerSceneGLES3::free(RID p_rid) { + + if (light_instance_owner.owns(p_rid)) { + + + LightInstance *light_instance = light_instance_owner.getptr(p_rid); + + //remove from shadow atlases.. + for(Set<RID>::Element *E=light_instance->shadow_atlases.front();E;E=E->next()) { + ShadowAtlas *shadow_atlas = shadow_atlas_owner.get(E->get()); + ERR_CONTINUE(!shadow_atlas->shadow_owners.has(p_rid)); + uint32_t key = shadow_atlas->shadow_owners[p_rid]; + uint32_t q = (key>>ShadowAtlas::QUADRANT_SHIFT)&0x3; + uint32_t s = key&ShadowAtlas::SHADOW_INDEX_MASK; + + shadow_atlas->quadrants[q].shadows[s].owner=RID(); + shadow_atlas->shadow_owners.erase(p_rid); + } + + + light_instance_owner.free(p_rid); + memdelete(light_instance); + + } else if (shadow_atlas_owner.owns(p_rid)) { + + ShadowAtlas *shadow_atlas = shadow_atlas_owner.get(p_rid); + shadow_atlas_set_size(p_rid,0); + shadow_atlas_owner.free(p_rid); + memdelete(shadow_atlas); + } else if (reflection_atlas_owner.owns(p_rid)) { + + ReflectionAtlas *reflection_atlas = reflection_atlas_owner.get(p_rid); + reflection_atlas_set_size(p_rid,0); + reflection_atlas_owner.free(p_rid); + memdelete(reflection_atlas); + } else if (reflection_probe_instance_owner.owns(p_rid)) { + + ReflectionProbeInstance *reflection_instance = reflection_probe_instance_owner.get(p_rid); + + reflection_probe_release_atlas_index(p_rid); + reflection_probe_instance_owner.free(p_rid); + memdelete(reflection_instance); + + } else { + return false; + } + + + return true; + +} + +// http://holger.dammertz.org/stuff/notes_HammersleyOnHemisphere.html +static _FORCE_INLINE_ float radicalInverse_VdC(uint32_t bits) { + bits = (bits << 16u) | (bits >> 16u); + bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u); + bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u); + bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u); + bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u); + return float(bits) * 2.3283064365386963e-10f; // / 0x100000000 +} + +static _FORCE_INLINE_ Vector2 Hammersley(uint32_t i, uint32_t N) { + return Vector2(float(i) / float(N), radicalInverse_VdC(i)); +} + +static _FORCE_INLINE_ Vector3 ImportanceSampleGGX(Vector2 Xi, float Roughness, Vector3 N) { + float a = Roughness * Roughness; // DISNEY'S ROUGHNESS [see Burley'12 siggraph] + + // Compute distribution direction + float Phi = 2.0f * Math_PI * Xi.x; + float CosTheta = Math::sqrt((1.0f - Xi.y) / (1.0f + (a*a - 1.0f) * Xi.y)); + float SinTheta = Math::sqrt((float)Math::abs(1.0f - CosTheta * CosTheta)); + + // Convert to spherical direction + Vector3 H; + H.x = SinTheta * Math::cos(Phi); + H.y = SinTheta * Math::sin(Phi); + H.z = CosTheta; + + Vector3 UpVector = Math::abs(N.z) < 0.999 ? Vector3(0.0, 0.0, 1.0) : Vector3(1.0, 0.0, 0.0); + Vector3 TangentX = UpVector.cross(N); + TangentX.normalize(); + Vector3 TangentY = N.cross(TangentX); + + // Tangent to world space + return TangentX * H.x + TangentY * H.y + N * H.z; +} + +static _FORCE_INLINE_ float GGX(float NdotV, float a) { + float k = a / 2.0; + return NdotV / (NdotV * (1.0 - k) + k); +} + +// http://graphicrants.blogspot.com.au/2013/08/specular-brdf-reference.html +float _FORCE_INLINE_ G_Smith(float a, float nDotV, float nDotL) +{ + return GGX(nDotL, a * a) * GGX(nDotV, a * a); +} + +void RasterizerSceneGLES3::_generate_brdf() { + + int brdf_size=GLOBAL_DEF("rendering/gles3/brdf_texture_size",64); + + + + PoolVector<uint8_t> brdf; + brdf.resize(brdf_size*brdf_size*2); + + PoolVector<uint8_t>::Write w = brdf.write(); + + + for(int i=0;i<brdf_size;i++) { + for(int j=0;j<brdf_size;j++) { + + float Roughness = float(j)/(brdf_size-1); + float NoV = float(i+1)/(brdf_size); //avoid storing nov0 + + Vector3 V; + V.x = Math::sqrt( 1.0 - NoV * NoV ); + V.y = 0.0; + V.z = NoV; + + Vector3 N = Vector3(0.0, 0.0, 1.0); + + float A = 0; + float B = 0; + + for(int s=0;s<512;s++) { + + + Vector2 xi = Hammersley(s,512); + Vector3 H = ImportanceSampleGGX( xi, Roughness, N ); + Vector3 L = 2.0 * V.dot(H) * H - V; + + float NoL = CLAMP( L.z, 0.0, 1.0 ); + float NoH = CLAMP( H.z, 0.0, 1.0 ); + float VoH = CLAMP( V.dot(H), 0.0, 1.0 ); + + if ( NoL > 0.0 ) { + float G = G_Smith( Roughness, NoV, NoL ); + float G_Vis = G * VoH / (NoH * NoV); + float Fc = pow(1.0 - VoH, 5.0); + + A += (1.0 - Fc) * G_Vis; + B += Fc * G_Vis; + } + } + + A/=512.0; + B/=512.0; + + int tofs = ((brdf_size-j-1)*brdf_size+i)*2; + w[tofs+0]=CLAMP(A*255,0,255); + w[tofs+1]=CLAMP(B*255,0,255); + } + } + + + //set up brdf texture + + + glGenTextures(1, &state.brdf_texture); + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,state.brdf_texture); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RG8, brdf_size, brdf_size, 0, GL_RG, GL_UNSIGNED_BYTE,w.ptr()); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glBindTexture(GL_TEXTURE_2D,0); + +} + +void RasterizerSceneGLES3::initialize() { + + + render_pass=0; + + state.scene_shader.init(); + + default_shader = storage->shader_create(VS::SHADER_SPATIAL); + default_material = storage->material_create(); + storage->material_set_shader(default_material,default_shader); + + default_shader_twosided = storage->shader_create(VS::SHADER_SPATIAL); + default_material_twosided = storage->material_create(); + storage->shader_set_code(default_shader_twosided,"render_mode cull_disabled;\n"); + storage->material_set_shader(default_material_twosided,default_shader_twosided); + + + glGenBuffers(1, &state.scene_ubo); + glBindBuffer(GL_UNIFORM_BUFFER, state.scene_ubo); + glBufferData(GL_UNIFORM_BUFFER, sizeof(State::SceneDataUBO), &state.scene_ubo, GL_DYNAMIC_DRAW); + glBindBuffer(GL_UNIFORM_BUFFER, 0); + + glGenBuffers(1, &state.env_radiance_ubo); + glBindBuffer(GL_UNIFORM_BUFFER, state.env_radiance_ubo); + glBufferData(GL_UNIFORM_BUFFER, sizeof(State::EnvironmentRadianceUBO), &state.env_radiance_ubo, GL_DYNAMIC_DRAW); + glBindBuffer(GL_UNIFORM_BUFFER, 0); + + + render_list.max_elements=GLOBAL_DEF("rendering/gles3/max_renderable_elements",(int)RenderList::DEFAULT_MAX_ELEMENTS); + if (render_list.max_elements>1000000) + render_list.max_elements=1000000; + if (render_list.max_elements<1024) + render_list.max_elements=1024; + + + + { + //quad buffers + + glGenBuffers(1,&state.skybox_verts); + glBindBuffer(GL_ARRAY_BUFFER,state.skybox_verts); + glBufferData(GL_ARRAY_BUFFER,sizeof(Vector3)*8,NULL,GL_DYNAMIC_DRAW); + glBindBuffer(GL_ARRAY_BUFFER,0); //unbind + + + glGenVertexArrays(1,&state.skybox_array); + glBindVertexArray(state.skybox_array); + glBindBuffer(GL_ARRAY_BUFFER,state.skybox_verts); + glVertexAttribPointer(VS::ARRAY_VERTEX,3,GL_FLOAT,GL_FALSE,sizeof(Vector3)*2,0); + glEnableVertexAttribArray(VS::ARRAY_VERTEX); + glVertexAttribPointer(VS::ARRAY_TEX_UV,3,GL_FLOAT,GL_FALSE,sizeof(Vector3)*2,((uint8_t*)NULL)+sizeof(Vector3)); + glEnableVertexAttribArray(VS::ARRAY_TEX_UV); + glBindVertexArray(0); + glBindBuffer(GL_ARRAY_BUFFER,0); //unbind + } + render_list.init(); + state.cube_to_dp_shader.init(); + _generate_brdf(); + + shadow_atlas_realloc_tolerance_msec=500; + + + + + + int max_shadow_cubemap_sampler_size=512; + + int cube_size = max_shadow_cubemap_sampler_size; + + glActiveTexture(GL_TEXTURE0); + + while(cube_size>=32) { + + ShadowCubeMap cube; + cube.size=cube_size; + + glGenTextures(1,&cube.cubemap); + glBindTexture(GL_TEXTURE_CUBE_MAP,cube.cubemap); + //gen cubemap first + for(int i=0;i<6;i++) { + + glTexImage2D(_cube_side_enum[i], 0, GL_DEPTH_COMPONENT, cube.size, cube.size, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); + } + + glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + // Remove artifact on the edges of the shadowmap + glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); + + //gen renderbuffers second, because it needs a complete cubemap + for(int i=0;i<6;i++) { + + glGenFramebuffers(1, &cube.fbo_id[i]); + glBindFramebuffer(GL_FRAMEBUFFER, cube.fbo_id[i]); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,_cube_side_enum[i], cube.cubemap, 0); + + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + ERR_CONTINUE(status!=GL_FRAMEBUFFER_COMPLETE); + } + + shadow_cubemaps.push_back(cube); + + cube_size>>=1; + } + + { + //directional light shadow + directional_shadow.light_count=0; + directional_shadow.size=nearest_power_of_2(GLOBAL_DEF("rendering/shadows/directional_shadow_size",2048)); + glGenFramebuffers(1,&directional_shadow.fbo); + glBindFramebuffer(GL_FRAMEBUFFER,directional_shadow.fbo); + glGenTextures(1,&directional_shadow.depth); + glBindTexture(GL_TEXTURE_2D,directional_shadow.depth); + glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, directional_shadow.size, directional_shadow.size, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,GL_TEXTURE_2D, directional_shadow.depth, 0); + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + if (status!=GL_FRAMEBUFFER_COMPLETE) { + ERR_PRINT("Directional shadow framebuffer status invalid"); + } + } + + { + //spot and omni ubos + + int max_ubo_size; + glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE,&max_ubo_size); + const int ubo_light_size=160; + state.ubo_light_size=ubo_light_size; + state.max_ubo_lights=MIN(RenderList::MAX_LIGHTS,max_ubo_size/ubo_light_size); + print_line("max ubo light: "+itos(state.max_ubo_lights)); + + state.spot_array_tmp = (uint8_t*)memalloc(ubo_light_size*state.max_ubo_lights); + state.omni_array_tmp = (uint8_t*)memalloc(ubo_light_size*state.max_ubo_lights); + + + glGenBuffers(1, &state.spot_array_ubo); + glBindBuffer(GL_UNIFORM_BUFFER, state.spot_array_ubo); + glBufferData(GL_UNIFORM_BUFFER, ubo_light_size*state.max_ubo_lights, NULL, GL_DYNAMIC_DRAW); + glBindBuffer(GL_UNIFORM_BUFFER, 0); + + glGenBuffers(1, &state.omni_array_ubo); + glBindBuffer(GL_UNIFORM_BUFFER, state.omni_array_ubo); + glBufferData(GL_UNIFORM_BUFFER, ubo_light_size*state.max_ubo_lights, NULL, GL_DYNAMIC_DRAW); + glBindBuffer(GL_UNIFORM_BUFFER, 0); + + glGenBuffers(1, &state.directional_ubo); + glBindBuffer(GL_UNIFORM_BUFFER, state.directional_ubo); + glBufferData(GL_UNIFORM_BUFFER, sizeof(LightDataUBO), NULL, GL_DYNAMIC_DRAW); + glBindBuffer(GL_UNIFORM_BUFFER, 0); + + state.max_forward_lights_per_object=8; + + + state.scene_shader.add_custom_define("#define MAX_LIGHT_DATA_STRUCTS "+itos(state.max_ubo_lights)+"\n"); + state.scene_shader.add_custom_define("#define MAX_FORWARD_LIGHTS "+itos(state.max_forward_lights_per_object)+"\n"); + + state.max_ubo_reflections=MIN(RenderList::MAX_REFLECTIONS,max_ubo_size/sizeof(ReflectionProbeDataUBO)); + print_line("max ubo reflections: "+itos(state.max_ubo_reflections)+" ubo size: "+itos(sizeof(ReflectionProbeDataUBO))); + + state.reflection_array_tmp = (uint8_t*)memalloc(sizeof(ReflectionProbeDataUBO)*state.max_ubo_reflections); + + glGenBuffers(1, &state.reflection_array_ubo); + glBindBuffer(GL_UNIFORM_BUFFER, state.reflection_array_ubo); + glBufferData(GL_UNIFORM_BUFFER, sizeof(ReflectionProbeDataUBO)*state.max_ubo_reflections, NULL, GL_DYNAMIC_DRAW); + glBindBuffer(GL_UNIFORM_BUFFER, 0); + + state.scene_shader.add_custom_define("#define MAX_REFLECTION_DATA_STRUCTS "+itos(state.max_ubo_reflections)+"\n"); + + state.max_skeleton_bones=MIN(2048,max_ubo_size/(12*sizeof(float))); + state.scene_shader.add_custom_define("#define MAX_SKELETON_BONES "+itos(state.max_skeleton_bones)+"\n"); + + + } + + GLOBAL_DEF("rendering/gles3/shadow_filter_mode",1); + GlobalConfig::get_singleton()->set_custom_property_info("rendering/gles3/shadow_filter_mode",PropertyInfo(Variant::INT,"rendering/gles3/shadow_filter_mode",PROPERTY_HINT_ENUM,"Disabled,PCF5,PCF13")); + shadow_filter_mode=SHADOW_FILTER_NEAREST; + + { //reflection cubemaps + int max_reflection_cubemap_sampler_size=512; + + int cube_size = max_reflection_cubemap_sampler_size; + + glActiveTexture(GL_TEXTURE0); + + bool use_float=true; + + GLenum internal_format = use_float?GL_RGBA16F:GL_RGB10_A2; + GLenum format = GL_RGBA; + GLenum type = use_float?GL_HALF_FLOAT:GL_UNSIGNED_INT_2_10_10_10_REV; + + while(cube_size>=32) { + + ReflectionCubeMap cube; + cube.size=cube_size; + + glGenTextures(1,&cube.depth); + glBindTexture(GL_TEXTURE_2D,cube.depth); + glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, cube.size, cube.size, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + + glGenTextures(1,&cube.cubemap); + glBindTexture(GL_TEXTURE_CUBE_MAP,cube.cubemap); + //gen cubemap first + for(int i=0;i<6;i++) { + + glTexImage2D(_cube_side_enum[i], 0, internal_format, cube.size, cube.size, 0, format, type, NULL); + } + + glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + // Remove artifact on the edges of the reflectionmap + glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); + + //gen renderbuffers second, because it needs a complete cubemap + for(int i=0;i<6;i++) { + + glGenFramebuffers(1, &cube.fbo_id[i]); + glBindFramebuffer(GL_FRAMEBUFFER, cube.fbo_id[i]); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,_cube_side_enum[i], cube.cubemap, 0); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,GL_TEXTURE_2D, cube.depth, 0); + + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + ERR_CONTINUE(status!=GL_FRAMEBUFFER_COMPLETE); + } + + reflection_cubemaps.push_back(cube); + + cube_size>>=1; + } + } + + { + + + uint32_t immediate_buffer_size=GLOBAL_DEF("rendering/buffers/immediate_buffer_size_kb",2048); + + glGenBuffers(1, &state.immediate_buffer); + glBindBuffer(GL_ARRAY_BUFFER, state.immediate_buffer); + glBufferData(GL_ARRAY_BUFFER, immediate_buffer_size*1024, NULL, GL_DYNAMIC_DRAW); + glBindBuffer(GL_ARRAY_BUFFER, 0); + + glGenVertexArrays(1,&state.immediate_array); + + + + } + +#ifdef GLES_OVER_GL +//"desktop" opengl needs this. + glEnable(GL_PROGRAM_POINT_SIZE); + +#endif + + state.resolve_shader.init(); + state.ssr_shader.init(); + state.effect_blur_shader.init(); + state.sss_shader.init(); + state.ssao_minify_shader.init(); + state.ssao_shader.init(); + state.ssao_blur_shader.init(); + state.exposure_shader.init(); + state.tonemap_shader.init(); + + + { + GLOBAL_DEF("rendering/ssurf_scattering/quality",1); + GlobalConfig::get_singleton()->set_custom_property_info("rendering/ssurf_scattering/quality",PropertyInfo(Variant::INT,"rendering/ssurf_scattering/quality",PROPERTY_HINT_ENUM,"Low,Medium,High")); + GLOBAL_DEF("rendering/ssurf_scattering/max_size",1.0); + GlobalConfig::get_singleton()->set_custom_property_info("rendering/ssurf_scattering/max_size",PropertyInfo(Variant::INT,"rendering/ssurf_scattering/max_size",PROPERTY_HINT_RANGE,"0.01,8,0.01")); + GLOBAL_DEF("rendering/ssurf_scattering/follow_surface",false); + + GLOBAL_DEF("rendering/reflections/high_quality_vct_gi",true); + + + } + + exposure_shrink_size=243; + int max_exposure_shrink_size=exposure_shrink_size; + + while(max_exposure_shrink_size>0) { + + RasterizerStorageGLES3::RenderTarget::Exposure e; + + glGenFramebuffers(1, &e.fbo); + glBindFramebuffer(GL_FRAMEBUFFER, e.fbo); + + glGenTextures(1, &e.color); + glBindTexture(GL_TEXTURE_2D, e.color); + glTexImage2D(GL_TEXTURE_2D, 0, GL_R32F, max_exposure_shrink_size, max_exposure_shrink_size, 0, GL_RED, GL_FLOAT, NULL); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, e.color, 0); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + exposure_shrink.push_back(e); + max_exposure_shrink_size/=3; + + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + ERR_CONTINUE(status!=GL_FRAMEBUFFER_COMPLETE); + + + } + +} + +void RasterizerSceneGLES3::iteration() { + + shadow_filter_mode=ShadowFilterMode(int(GlobalConfig::get_singleton()->get("rendering/gles3/shadow_filter_mode"))); + subsurface_scatter_follow_surface=GlobalConfig::get_singleton()->get("rendering/gles3/subsurface_scattering/follow_surface"); + subsurface_scatter_quality=SubSurfaceScatterQuality(int(GlobalConfig::get_singleton()->get("rendering/gles3/subsurface_scattering/quality"))); + subsurface_scatter_size=GlobalConfig::get_singleton()->get("rendering/gles3/subsurface_scattering/max_size"); + + + state.scene_shader.set_conditional(SceneShaderGLES3::VCT_QUALITY_HIGH,GlobalConfig::get_singleton()->get("rendering/gles3/high_quality_vct_gi")); +} + +void RasterizerSceneGLES3::finalize(){ + + +} + + +RasterizerSceneGLES3::RasterizerSceneGLES3() +{ + +} diff --git a/drivers/gles3/rasterizer_scene_gles3.h b/drivers/gles3/rasterizer_scene_gles3.h new file mode 100644 index 0000000000..7838345e59 --- /dev/null +++ b/drivers/gles3/rasterizer_scene_gles3.h @@ -0,0 +1,733 @@ +#ifndef RASTERIZERSCENEGLES3_H +#define RASTERIZERSCENEGLES3_H + +#include "rasterizer_storage_gles3.h" +#include "drivers/gles3/shaders/scene.glsl.h" +#include "drivers/gles3/shaders/cube_to_dp.glsl.h" +#include "drivers/gles3/shaders/resolve.glsl.h" +#include "drivers/gles3/shaders/screen_space_reflection.glsl.h" +#include "drivers/gles3/shaders/effect_blur.glsl.h" +#include "drivers/gles3/shaders/subsurf_scattering.glsl.h" +#include "drivers/gles3/shaders/ssao_minify.glsl.h" +#include "drivers/gles3/shaders/ssao.glsl.h" +#include "drivers/gles3/shaders/ssao_blur.glsl.h" +#include "drivers/gles3/shaders/exposure.glsl.h" +#include "drivers/gles3/shaders/tonemap.glsl.h" + +class RasterizerSceneGLES3 : public RasterizerScene { +public: + + enum ShadowFilterMode { + SHADOW_FILTER_NEAREST, + SHADOW_FILTER_PCF5, + SHADOW_FILTER_PCF13, + }; + + + ShadowFilterMode shadow_filter_mode; + + uint64_t shadow_atlas_realloc_tolerance_msec; + + enum SubSurfaceScatterQuality { + SSS_QUALITY_LOW, + SSS_QUALITY_MEDIUM, + SSS_QUALITY_HIGH, + }; + + SubSurfaceScatterQuality subsurface_scatter_quality; + float subsurface_scatter_size; + bool subsurface_scatter_follow_surface; + + uint64_t render_pass; + uint64_t scene_pass; + uint32_t current_material_index; + uint32_t current_geometry_index; + + RID default_material; + RID default_material_twosided; + RID default_shader; + RID default_shader_twosided; + + RasterizerStorageGLES3 *storage; + + Vector<RasterizerStorageGLES3::RenderTarget::Exposure> exposure_shrink; + int exposure_shrink_size; + + struct State { + + + + bool texscreen_copied; + int current_blend_mode; + float current_line_width; + int current_depth_draw; + GLuint current_main_tex; + + SceneShaderGLES3 scene_shader; + CubeToDpShaderGLES3 cube_to_dp_shader; + ResolveShaderGLES3 resolve_shader; + ScreenSpaceReflectionShaderGLES3 ssr_shader; + EffectBlurShaderGLES3 effect_blur_shader; + SubsurfScatteringShaderGLES3 sss_shader; + SsaoMinifyShaderGLES3 ssao_minify_shader; + SsaoShaderGLES3 ssao_shader; + SsaoBlurShaderGLES3 ssao_blur_shader; + ExposureShaderGLES3 exposure_shader; + TonemapShaderGLES3 tonemap_shader; + + + struct SceneDataUBO { + + float projection_matrix[16]; + float camera_inverse_matrix[16]; + float camera_matrix[16]; + float time[4]; + float ambient_light_color[4]; + float bg_color[4]; + float ambient_energy; + float bg_energy; + float shadow_z_offset; + float shadow_slope_scale; + float shadow_dual_paraboloid_render_zfar; + float shadow_dual_paraboloid_render_side; + float shadow_atlas_pixel_size[2]; + float shadow_directional_pixel_size[2]; + float reflection_multiplier; + float subsurface_scatter_width; + float ambient_occlusion_affect_light; + + } ubo_data; + + GLuint scene_ubo; + + struct EnvironmentRadianceUBO { + + float transform[16]; + float box_min[4]; //unused for now + float box_max[4]; + float ambient_contribution; + + } env_radiance_data; + + GLuint env_radiance_ubo; + + GLuint brdf_texture; + + GLuint skybox_verts; + GLuint skybox_array; + + GLuint directional_ubo; + + GLuint spot_array_ubo; + GLuint omni_array_ubo; + GLuint reflection_array_ubo; + + GLuint immediate_buffer; + GLuint immediate_array; + + uint32_t ubo_light_size; + uint8_t *spot_array_tmp; + uint8_t *omni_array_tmp; + uint8_t *reflection_array_tmp; + + int max_ubo_lights; + int max_forward_lights_per_object; + int max_ubo_reflections; + int max_skeleton_bones; + + + + int spot_light_count; + int omni_light_count; + int directional_light_count; + int reflection_probe_count; + + bool cull_front; + bool used_sss; + + } state; + + + /* SHADOW ATLAS API */ + + struct ShadowAtlas : public RID_Data { + + enum { + QUADRANT_SHIFT=27, + SHADOW_INDEX_MASK=(1<<QUADRANT_SHIFT)-1, + SHADOW_INVALID=0xFFFFFFFF + }; + + struct Quadrant { + + uint32_t subdivision; + + struct Shadow { + RID owner; + uint64_t version; + uint64_t alloc_tick; + + Shadow() { + version=0; + alloc_tick=0; + } + }; + + Vector<Shadow> shadows; + + Quadrant() { + subdivision=0; //not in use + } + + } quadrants[4]; + + int size_order[4]; + uint32_t smallest_subdiv; + + int size; + + GLuint fbo; + GLuint depth; + + Map<RID,uint32_t> shadow_owners; + }; + + struct ShadowCubeMap { + + GLuint fbo_id[6]; + GLuint cubemap; + int size; + }; + + Vector<ShadowCubeMap> shadow_cubemaps; + + RID_Owner<ShadowAtlas> shadow_atlas_owner; + + RID shadow_atlas_create(); + void shadow_atlas_set_size(RID p_atlas,int p_size); + void shadow_atlas_set_quadrant_subdivision(RID p_atlas,int p_quadrant,int p_subdivision); + bool _shadow_atlas_find_shadow(ShadowAtlas *shadow_atlas, int *p_in_quadrants, int p_quadrant_count, int p_current_subdiv, uint64_t p_tick, int &r_quadrant, int &r_shadow); + bool shadow_atlas_update_light(RID p_atlas,RID p_light_intance,float p_coverage,uint64_t p_light_version); + + + struct DirectionalShadow { + GLuint fbo; + GLuint depth; + int light_count; + int size; + int current_light; + } directional_shadow; + + virtual int get_directional_light_shadow_size(RID p_light_intance); + virtual void set_directional_shadow_count(int p_count); + + /* REFLECTION PROBE ATLAS API */ + + struct ReflectionAtlas : public RID_Data { + + int subdiv; + int size; + + struct Reflection { + RID owner; + uint64_t last_frame; + }; + + GLuint fbo[6]; + GLuint color; + + Vector<Reflection> reflections; + }; + + mutable RID_Owner<ReflectionAtlas> reflection_atlas_owner; + + virtual RID reflection_atlas_create(); + virtual void reflection_atlas_set_size(RID p_ref_atlas,int p_size); + virtual void reflection_atlas_set_subdivision(RID p_ref_atlas,int p_subdiv); + + /* REFLECTION CUBEMAPS */ + + struct ReflectionCubeMap { + + GLuint fbo_id[6]; + GLuint cubemap; + GLuint depth; + int size; + }; + + Vector<ReflectionCubeMap> reflection_cubemaps; + + /* REFLECTION PROBE INSTANCE */ + + struct ReflectionProbeInstance : public RID_Data { + + RasterizerStorageGLES3::ReflectionProbe *probe_ptr; + RID probe; + RID self; + RID atlas; + + int reflection_atlas_index; + + int render_step; + + + + uint64_t last_pass; + int reflection_index; + + Transform transform; + }; + + struct ReflectionProbeDataUBO { + + float box_extents[4]; + float box_ofs[4]; + float params[4]; // intensity, 0, 0, boxproject + float ambient[4]; //color, probe contrib + float atlas_clamp[4]; + float local_matrix[16]; //up to here for spot and omni, rest is for directional + //notes: for ambientblend, use distance to edge to blend between already existing global environment + }; + + + mutable RID_Owner<ReflectionProbeInstance> reflection_probe_instance_owner; + + virtual RID reflection_probe_instance_create(RID p_probe); + virtual void reflection_probe_instance_set_transform(RID p_instance,const Transform& p_transform); + virtual void reflection_probe_release_atlas_index(RID p_instance); + virtual bool reflection_probe_instance_needs_redraw(RID p_instance); + virtual bool reflection_probe_instance_has_reflection(RID p_instance); + virtual bool reflection_probe_instance_begin_render(RID p_instance, RID p_reflection_atlas); + virtual bool reflection_probe_instance_postprocess_step(RID p_instance); + + + + + /* ENVIRONMENT API */ + + struct Environment : public RID_Data { + + VS::EnvironmentBG bg_mode; + + RID skybox; + float skybox_scale; + + Color bg_color; + float bg_energy; + float skybox_ambient; + + Color ambient_color; + float ambient_energy; + float ambient_skybox_contribution; + + int canvas_max_layer; + + bool ssr_enabled; + int ssr_max_steps; + float ssr_accel; + float ssr_fade; + float ssr_depth_tolerance; + bool ssr_smooth; + bool ssr_roughness; + + + bool ssao_enabled; + float ssao_intensity; + float ssao_radius; + float ssao_intensity2; + float ssao_radius2; + float ssao_bias; + float ssao_light_affect; + Color ssao_color; + bool ssao_filter; + + bool glow_enabled; + int glow_levels; + float glow_intensity; + float glow_strength; + float glow_bloom; + VS::EnvironmentGlowBlendMode glow_blend_mode; + float glow_hdr_bleed_treshold; + float glow_hdr_bleed_scale; + bool glow_bicubic_upscale; + + VS::EnvironmentToneMapper tone_mapper; + float tone_mapper_exposure; + float tone_mapper_exposure_white; + bool auto_exposure; + float auto_exposure_speed; + float auto_exposure_min; + float auto_exposure_max; + float auto_exposure_grey; + + bool dof_blur_far_enabled; + float dof_blur_far_distance; + float dof_blur_far_transition; + float dof_blur_far_amount; + VS::EnvironmentDOFBlurQuality dof_blur_far_quality; + + bool dof_blur_near_enabled; + float dof_blur_near_distance; + float dof_blur_near_transition; + float dof_blur_near_amount; + VS::EnvironmentDOFBlurQuality dof_blur_near_quality; + + Environment() { + bg_mode=VS::ENV_BG_CLEAR_COLOR; + skybox_scale=1.0; + bg_energy=1.0; + skybox_ambient=0; + ambient_energy=1.0; + ambient_skybox_contribution=0.0; + canvas_max_layer=0; + + ssr_enabled=false; + ssr_max_steps=64; + ssr_accel=0.04; + ssr_fade=2.0; + ssr_depth_tolerance=0.2; + ssr_smooth=true; + ssr_roughness=true; + + ssao_enabled=false; + ssao_intensity=1.0; + ssao_radius=1.0; + ssao_intensity2=1.0; + ssao_radius2=0.0; + ssao_bias=0.01; + ssao_light_affect=0; + ssao_filter=true; + + tone_mapper=VS::ENV_TONE_MAPPER_LINEAR; + tone_mapper_exposure=1.0; + tone_mapper_exposure_white=1.0; + auto_exposure=false; + auto_exposure_speed=0.5; + auto_exposure_min=0.05; + auto_exposure_max=8; + auto_exposure_grey=0.4; + + glow_enabled=false; + glow_levels=(1<<2)|(1<<4); + glow_intensity=0.8; + glow_strength=1.0; + glow_bloom=0.0; + glow_blend_mode=VS::GLOW_BLEND_MODE_SOFTLIGHT; + glow_hdr_bleed_treshold=1.0; + glow_hdr_bleed_scale=2.0; + glow_bicubic_upscale=false; + + dof_blur_far_enabled=false; + dof_blur_far_distance=10; + dof_blur_far_transition=5; + dof_blur_far_amount=0.1; + dof_blur_far_quality=VS::ENV_DOF_BLUR_QUALITY_MEDIUM; + + dof_blur_near_enabled=false; + dof_blur_near_distance=2; + dof_blur_near_transition=1; + dof_blur_near_amount=0.1; + dof_blur_near_quality=VS::ENV_DOF_BLUR_QUALITY_MEDIUM; + + } + }; + + RID_Owner<Environment> environment_owner; + + virtual RID environment_create(); + + virtual void environment_set_background(RID p_env,VS::EnvironmentBG p_bg); + virtual void environment_set_skybox(RID p_env,RID p_skybox); + virtual void environment_set_skybox_scale(RID p_env,float p_scale); + virtual void environment_set_bg_color(RID p_env,const Color& p_color); + virtual void environment_set_bg_energy(RID p_env,float p_energy); + virtual void environment_set_canvas_max_layer(RID p_env,int p_max_layer); + virtual void environment_set_ambient_light(RID p_env,const Color& p_color,float p_energy=1.0,float p_skybox_contribution=0.0); + + virtual void environment_set_dof_blur_near(RID p_env,bool p_enable,float p_distance,float p_transition,float p_far_amount,VS::EnvironmentDOFBlurQuality p_quality); + virtual void environment_set_dof_blur_far(RID p_env,bool p_enable,float p_distance,float p_transition,float p_far_amount,VS::EnvironmentDOFBlurQuality p_quality); + virtual void environment_set_glow(RID p_env,bool p_enable,int p_level_flags,float p_intensity,float p_strength,float p_bloom_treshold,VS::EnvironmentGlowBlendMode p_blend_mode,float p_hdr_bleed_treshold,float p_hdr_bleed_scale,bool p_bicubic_upscale); + virtual void environment_set_fog(RID p_env,bool p_enable,float p_begin,float p_end,RID p_gradient_texture); + + virtual void environment_set_ssr(RID p_env,bool p_enable, int p_max_steps,float p_accel,float p_fade,float p_depth_tolerance,bool p_smooth,bool p_roughness); + virtual void environment_set_ssao(RID p_env,bool p_enable, float p_radius, float p_radius2, float p_intensity2, float p_intensity, float p_bias, float p_light_affect,const Color &p_color,bool p_blur); + + + virtual void environment_set_tonemap(RID p_env,VS::EnvironmentToneMapper p_tone_mapper,float p_exposure,float p_white,bool p_auto_exposure,float p_min_luminance,float p_max_luminance,float p_auto_exp_speed,float p_auto_exp_scale); + + virtual void environment_set_adjustment(RID p_env,bool p_enable,float p_brightness,float p_contrast,float p_saturation,RID p_ramp); + + + /* LIGHT INSTANCE */ + + struct LightDataUBO { + + float light_pos_inv_radius[4]; + float light_direction_attenuation[4]; + float light_color_energy[4]; + float light_params[4]; //spot attenuation, spot angle, specular, shadow enabled + float light_clamp[4]; + float light_shadow_color[4]; + float shadow_matrix1[16]; //up to here for spot and omni, rest is for directional + float shadow_matrix2[16]; + float shadow_matrix3[16]; + float shadow_matrix4[16]; + float shadow_split_offsets[4]; + + }; + + struct LightInstance : public RID_Data { + + struct ShadowTransform { + + CameraMatrix camera; + Transform transform; + float farplane; + float split; + }; + + + + ShadowTransform shadow_transform[4]; + + RID self; + RID light; + RasterizerStorageGLES3::Light *light_ptr; + Transform transform; + + Vector3 light_vector; + Vector3 spot_vector; + float linear_att; + + uint64_t shadow_pass; + uint64_t last_scene_pass; + uint64_t last_scene_shadow_pass; + uint64_t last_pass; + uint16_t light_index; + uint16_t light_directional_index; + + uint32_t current_shadow_atlas_key; + + Vector2 dp; + + Rect2 directional_rect; + + + Set<RID> shadow_atlases; //shadow atlases where this light is registered + + LightInstance() { } + + }; + + mutable RID_Owner<LightInstance> light_instance_owner; + + virtual RID light_instance_create(RID p_light); + virtual void light_instance_set_transform(RID p_light_instance,const Transform& p_transform); + virtual void light_instance_set_shadow_transform(RID p_light_instance,const CameraMatrix& p_projection,const Transform& p_transform,float p_far,float p_split,int p_pass); + virtual void light_instance_mark_visible(RID p_light_instance); + + /* REFLECTION INSTANCE */ + + struct GIProbeInstance : public RID_Data { + RID data; + RasterizerStorageGLES3::GIProbe *probe; + GLuint tex_cache; + Vector3 cell_size_cache; + Vector3 bounds; + Transform transform_to_data; + + GIProbeInstance() { probe=NULL; tex_cache=0; } + }; + + + + mutable RID_Owner<GIProbeInstance> gi_probe_instance_owner; + + virtual RID gi_probe_instance_create(); + virtual void gi_probe_instance_set_light_data(RID p_probe,RID p_base,RID p_data); + virtual void gi_probe_instance_set_transform_to_data(RID p_probe,const Transform& p_xform); + virtual void gi_probe_instance_set_bounds(RID p_probe,const Vector3& p_bounds); + + /* RENDER LIST */ + + struct RenderList { + + enum { + DEFAULT_MAX_ELEMENTS=65536, + SORT_FLAG_SKELETON=1, + SORT_FLAG_INSTANCING=2, + MAX_DIRECTIONAL_LIGHTS=16, + MAX_LIGHTS=4096, + MAX_REFLECTIONS=1024, + + + SORT_KEY_DEPTH_LAYER_SHIFT=60, + SORT_KEY_UNSHADED_FLAG=uint64_t(1)<<59, + SORT_KEY_NO_DIRECTIONAL_FLAG=uint64_t(1)<<58, + SORT_KEY_GI_PROBES_FLAG=uint64_t(1)<<57, + SORT_KEY_SHADING_SHIFT=57, + SORT_KEY_SHADING_MASK=7, + SORT_KEY_MATERIAL_INDEX_SHIFT=40, + SORT_KEY_GEOMETRY_INDEX_SHIFT=20, + SORT_KEY_GEOMETRY_TYPE_SHIFT=15, + SORT_KEY_SKELETON_FLAG=2, + SORT_KEY_MIRROR_FLAG=1 + + }; + + int max_elements; + + struct Element { + + RasterizerScene::InstanceBase *instance; + RasterizerStorageGLES3::Geometry *geometry; + RasterizerStorageGLES3::Material *material; + RasterizerStorageGLES3::GeometryOwner *owner; + uint64_t sort_key; + + }; + + + Element *_elements; + Element **elements; + + int element_count; + int alpha_element_count; + + + void clear() { + + element_count=0; + alpha_element_count=0; + } + + //should eventually be replaced by radix + + struct SortByKey { + + _FORCE_INLINE_ bool operator()(const Element* A, const Element* B ) const { + return A->sort_key < B->sort_key; + } + }; + + void sort_by_key(bool p_alpha) { + + SortArray<Element*,SortByKey> sorter; + if (p_alpha) { + sorter.sort(&elements[max_elements-alpha_element_count],alpha_element_count); + } else { + sorter.sort(elements,element_count); + } + } + + struct SortByDepth { + + _FORCE_INLINE_ bool operator()(const Element* A, const Element* B ) const { + return A->instance->depth > B->instance->depth; + } + }; + + void sort_by_depth(bool p_alpha) { + + SortArray<Element*,SortByDepth> sorter; + if (p_alpha) { + sorter.sort(&elements[max_elements-alpha_element_count],alpha_element_count); + } else { + sorter.sort(elements,element_count); + } + } + + + _FORCE_INLINE_ Element* add_element() { + + if (element_count+alpha_element_count>=max_elements) + return NULL; + elements[element_count]=&_elements[element_count]; + return elements[element_count++]; + } + + _FORCE_INLINE_ Element* add_alpha_element() { + + if (element_count+alpha_element_count>=max_elements) + return NULL; + int idx = max_elements-alpha_element_count-1; + elements[idx]=&_elements[idx]; + alpha_element_count++; + return elements[idx]; + } + + void init() { + + element_count = 0; + alpha_element_count =0; + elements=memnew_arr(Element*,max_elements); + _elements=memnew_arr(Element,max_elements); + for (int i=0;i<max_elements;i++) + elements[i]=&_elements[i]; // assign elements + + } + + + RenderList() { + + max_elements=DEFAULT_MAX_ELEMENTS; + } + + ~RenderList() { + memdelete_arr(elements); + memdelete_arr(_elements); + } + }; + + + LightInstance *directional_light; + LightInstance *directional_lights[RenderList::MAX_DIRECTIONAL_LIGHTS]; + + + + RenderList render_list; + + _FORCE_INLINE_ void _set_cull(bool p_front,bool p_reverse_cull); + + _FORCE_INLINE_ bool _setup_material(RasterizerStorageGLES3::Material* p_material,bool p_alpha_pass); + _FORCE_INLINE_ void _setup_transform(InstanceBase *p_instance,const Transform& p_view_transform,const CameraMatrix& p_projection); + _FORCE_INLINE_ void _setup_geometry(RenderList::Element *e); + _FORCE_INLINE_ void _render_geometry(RenderList::Element *e); + _FORCE_INLINE_ void _setup_light(RenderList::Element *e,const Transform& p_view_transform); + + void _render_list(RenderList::Element **p_elements, int p_element_count, const Transform& p_view_transform, const CameraMatrix& p_projection, GLuint p_base_env, bool p_reverse_cull, bool p_alpha_pass, bool p_shadow, bool p_directional_add, bool p_directional_shadows); + + + _FORCE_INLINE_ void _add_geometry( RasterizerStorageGLES3::Geometry* p_geometry, InstanceBase *p_instance, RasterizerStorageGLES3::GeometryOwner *p_owner,int p_material,bool p_shadow); + + void _draw_skybox(RasterizerStorageGLES3::SkyBox *p_skybox, const CameraMatrix& p_projection, const Transform& p_transform, bool p_vflip, float p_scale); + + void _setup_environment(Environment *env, const CameraMatrix &p_cam_projection, const Transform& p_cam_transform); + void _setup_directional_light(int p_index, const Transform &p_camera_inverse_transformm, bool p_use_shadows); + void _setup_lights(RID *p_light_cull_result, int p_light_cull_count, const Transform &p_camera_inverse_transform, const CameraMatrix& p_camera_projection, RID p_shadow_atlas); + void _setup_reflections(RID *p_reflection_probe_cull_result, int p_reflection_probe_cull_count, const Transform& p_camera_inverse_transform, const CameraMatrix& p_camera_projection, RID p_reflection_atlas, Environment *p_env); + + void _copy_screen(); + void _copy_to_front_buffer(Environment *env); + void _copy_texture_to_front_buffer(GLuint p_texture); //used for debug + + void _fill_render_list(InstanceBase** p_cull_result,int p_cull_count,bool p_shadow); + + void _render_mrts(Environment *env, const CameraMatrix &p_cam_projection); + void _post_process(Environment *env, const CameraMatrix &p_cam_projection); + + virtual void render_scene(const Transform& p_cam_transform,const CameraMatrix& p_cam_projection,bool p_cam_ortogonal,InstanceBase** p_cull_result,int p_cull_count,RID* p_light_cull_result,int p_light_cull_count,RID* p_reflection_probe_cull_result,int p_reflection_probe_cull_count,RID p_environment,RID p_shadow_atlas,RID p_reflection_atlas,RID p_reflection_probe,int p_reflection_probe_pass); + virtual void render_shadow(RID p_light,RID p_shadow_atlas,int p_pass,InstanceBase** p_cull_result,int p_cull_count); + virtual bool free(RID p_rid); + + void _generate_brdf(); + + virtual void set_scene_pass(uint64_t p_pass); + + void iteration(); + void initialize(); + void finalize(); + RasterizerSceneGLES3(); +}; + +#endif // RASTERIZERSCENEGLES3_H diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp new file mode 100644 index 0000000000..a4fea29b47 --- /dev/null +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -0,0 +1,6495 @@ +#include "rasterizer_storage_gles3.h" +#include "rasterizer_canvas_gles3.h" +#include "rasterizer_scene_gles3.h" +#include "globals.h" + +/* TEXTURE API */ + +#define _EXT_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00 +#define _EXT_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01 +#define _EXT_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02 +#define _EXT_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03 + +#define _EXT_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT 0x8A54 +#define _EXT_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT 0x8A55 +#define _EXT_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT 0x8A56 +#define _EXT_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT 0x8A57 + + +#define _EXT_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define _EXT_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define _EXT_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 + +#define _EXT_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 +#define _EXT_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 +#define _EXT_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 +#define _EXT_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 + + +#define _EXT_COMPRESSED_RED_RGTC1_EXT 0x8DBB +#define _EXT_COMPRESSED_RED_RGTC1 0x8DBB +#define _EXT_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC +#define _EXT_COMPRESSED_RG_RGTC2 0x8DBD +#define _EXT_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE +#define _EXT_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC +#define _EXT_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD +#define _EXT_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE +#define _EXT_ETC1_RGB8_OES 0x8D64 + + + +#define _EXT_SLUMINANCE_NV 0x8C46 +#define _EXT_SLUMINANCE_ALPHA_NV 0x8C44 +#define _EXT_SRGB8_NV 0x8C41 +#define _EXT_SLUMINANCE8_NV 0x8C47 +#define _EXT_SLUMINANCE8_ALPHA8_NV 0x8C45 + + +#define _EXT_COMPRESSED_SRGB_S3TC_DXT1_NV 0x8C4C +#define _EXT_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV 0x8C4D +#define _EXT_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV 0x8C4E +#define _EXT_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV 0x8C4F + + + +#define _EXT_ATC_RGB_AMD 0x8C92 +#define _EXT_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93 +#define _EXT_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE + + +#define _EXT_TEXTURE_CUBE_MAP_SEAMLESS 0x884F + +#define _GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define _GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF + +#define _EXT_COMPRESSED_R11_EAC 0x9270 +#define _EXT_COMPRESSED_SIGNED_R11_EAC 0x9271 +#define _EXT_COMPRESSED_RG11_EAC 0x9272 +#define _EXT_COMPRESSED_SIGNED_RG11_EAC 0x9273 +#define _EXT_COMPRESSED_RGB8_ETC2 0x9274 +#define _EXT_COMPRESSED_SRGB8_ETC2 0x9275 +#define _EXT_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 +#define _EXT_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 +#define _EXT_COMPRESSED_RGBA8_ETC2_EAC 0x9278 +#define _EXT_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 + +#define _EXT_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C +#define _EXT_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D +#define _EXT_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E +#define _EXT_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F + +Image RasterizerStorageGLES3::_get_gl_image_and_format(const Image& p_image, Image::Format p_format, uint32_t p_flags,GLenum& r_gl_format,GLenum& r_gl_internal_format,GLenum &r_gl_type,bool &r_compressed,bool &srgb) { + + + r_compressed=false; + r_gl_format=0; + Image image=p_image; + srgb=false; + + bool need_decompress=false; + + switch(p_format) { + + case Image::FORMAT_L8: { + r_gl_internal_format=GL_R8; + r_gl_format=GL_RED; + r_gl_type=GL_UNSIGNED_BYTE; + + } break; + case Image::FORMAT_LA8: { + + r_gl_internal_format=GL_RG8; + r_gl_format=GL_RG; + r_gl_type=GL_UNSIGNED_BYTE; + } break; + case Image::FORMAT_R8: { + + r_gl_internal_format=GL_R8; + r_gl_format=GL_RED; + r_gl_type=GL_UNSIGNED_BYTE; + + } break; + case Image::FORMAT_RG8: { + + r_gl_internal_format=GL_RG8; + r_gl_format=GL_RG; + r_gl_type=GL_UNSIGNED_BYTE; + + } break; + case Image::FORMAT_RGB8: { + + r_gl_internal_format=(config.srgb_decode_supported || p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)?GL_SRGB8:GL_RGB8; + r_gl_format=GL_RGB; + r_gl_type=GL_UNSIGNED_BYTE; + srgb=true; + + } break; + case Image::FORMAT_RGBA8: { + + r_gl_format=GL_RGBA; + r_gl_internal_format=(config.srgb_decode_supported || p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)?GL_SRGB8_ALPHA8:GL_RGBA8; + r_gl_type=GL_UNSIGNED_BYTE; + srgb=true; + + } break; + case Image::FORMAT_RGB565: { +//#warning TODO: Convert tod 555 if 565 is not supported (GLES3.3-) + r_gl_internal_format=GL_RGB5; + //r_gl_internal_format=GL_RGB565; + r_gl_format=GL_RGB; + r_gl_type=GL_UNSIGNED_SHORT_5_6_5; + + } break; + case Image::FORMAT_RGBA4444: { + + r_gl_internal_format=GL_RGBA4; + r_gl_format=GL_RGBA; + r_gl_type=GL_UNSIGNED_SHORT_4_4_4_4; + + } break; + case Image::FORMAT_RGBA5551: { + + r_gl_internal_format=GL_RGB5_A1; + r_gl_format=GL_RGBA; + r_gl_type=GL_UNSIGNED_SHORT_5_5_5_1; + + + } break; + case Image::FORMAT_RF: { + + + r_gl_internal_format=GL_R32F; + r_gl_format=GL_RED; + r_gl_type=GL_FLOAT; + + } break; + case Image::FORMAT_RGF: { + + r_gl_internal_format=GL_RG32F; + r_gl_format=GL_RG; + r_gl_type=GL_FLOAT; + + } break; + case Image::FORMAT_RGBF: { + + r_gl_internal_format=GL_RGB32F; + r_gl_format=GL_RGB; + r_gl_type=GL_FLOAT; + + } break; + case Image::FORMAT_RGBAF: { + + r_gl_internal_format=GL_RGBA32F; + r_gl_format=GL_RGBA; + r_gl_type=GL_FLOAT; + + } break; + case Image::FORMAT_RH: { + r_gl_internal_format=GL_R32F; + r_gl_format=GL_RED; + r_gl_type=GL_HALF_FLOAT; + } break; + case Image::FORMAT_RGH: { + r_gl_internal_format=GL_RG32F; + r_gl_format=GL_RG; + r_gl_type=GL_HALF_FLOAT; + + } break; + case Image::FORMAT_RGBH: { + r_gl_internal_format=GL_RGB32F; + r_gl_format=GL_RGB; + r_gl_type=GL_HALF_FLOAT; + + } break; + case Image::FORMAT_RGBAH: { + r_gl_internal_format=GL_RGBA32F; + r_gl_format=GL_RGBA; + r_gl_type=GL_HALF_FLOAT; + + } break; + case Image::FORMAT_DXT1: { + + if (config.s3tc_supported) { + + + r_gl_internal_format=(config.srgb_decode_supported || p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)?_EXT_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV:_EXT_COMPRESSED_RGBA_S3TC_DXT1_EXT; + r_gl_format=GL_RGBA; + r_gl_type=GL_UNSIGNED_BYTE; + r_compressed=true; + srgb=true; + + } else { + + need_decompress=true; + } + + + } break; + case Image::FORMAT_DXT3: { + + + if (config.s3tc_supported) { + + + r_gl_internal_format=(config.srgb_decode_supported || p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)?_EXT_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV:_EXT_COMPRESSED_RGBA_S3TC_DXT3_EXT; + r_gl_format=GL_RGBA; + r_gl_type=GL_UNSIGNED_BYTE; + r_compressed=true; + srgb=true; + + } else { + + need_decompress=true; + } + + + } break; + case Image::FORMAT_DXT5: { + + if (config.s3tc_supported) { + + + r_gl_internal_format=(config.srgb_decode_supported || p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)?_EXT_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV:_EXT_COMPRESSED_RGBA_S3TC_DXT5_EXT; + r_gl_format=GL_RGBA; + r_gl_type=GL_UNSIGNED_BYTE; + r_compressed=true; + srgb=true; + + } else { + + need_decompress=true; + } + + + } break; + case Image::FORMAT_ATI1: { + + if (config.latc_supported) { + + + r_gl_internal_format=_EXT_COMPRESSED_LUMINANCE_LATC1_EXT; + r_gl_format=GL_RGBA; + r_gl_type=GL_UNSIGNED_BYTE; + r_compressed=true; + srgb=true; + + } else { + + need_decompress=true; + } + + + + } break; + case Image::FORMAT_ATI2: { + + if (config.latc_supported) { + + + r_gl_internal_format=_EXT_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT; + r_gl_format=GL_RGBA; + r_gl_type=GL_UNSIGNED_BYTE; + r_compressed=true; + } else { + + need_decompress=true; + } + + } break; + case Image::FORMAT_BPTC_RGBA: { + + if (config.bptc_supported) { + + + r_gl_internal_format=(config.srgb_decode_supported || p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)?_EXT_COMPRESSED_SRGB_ALPHA_BPTC_UNORM:_EXT_COMPRESSED_RGBA_BPTC_UNORM; + r_gl_format=GL_RGBA; + r_gl_type=GL_UNSIGNED_BYTE; + r_compressed=true; + srgb=true; + + } else { + + need_decompress=true; + } + } break; + case Image::FORMAT_BPTC_RGBF: { + + if (config.bptc_supported) { + + + r_gl_internal_format=_EXT_COMPRESSED_RGB_BPTC_SIGNED_FLOAT; + r_gl_format=GL_RGB; + r_gl_type=GL_FLOAT; + r_compressed=true; + } else { + + need_decompress=true; + } + } break; + case Image::FORMAT_BPTC_RGBFU: { + if (config.bptc_supported) { + + + r_gl_internal_format=_EXT_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT; + r_gl_format=GL_RGB; + r_gl_type=GL_FLOAT; + r_compressed=true; + } else { + + need_decompress=true; + } + } break; + case Image::FORMAT_PVRTC2: { + + if (config.pvrtc_supported) { + + + r_gl_internal_format=(config.srgb_decode_supported || p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)?_EXT_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT:_EXT_COMPRESSED_RGB_PVRTC_2BPPV1_IMG; + r_gl_format=GL_RGBA; + r_gl_type=GL_UNSIGNED_BYTE; + r_compressed=true; + srgb=true; + + } else { + + need_decompress=true; + } + } break; + case Image::FORMAT_PVRTC2A: { + + if (config.pvrtc_supported) { + + + r_gl_internal_format=(config.srgb_decode_supported || p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)?_EXT_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT:_EXT_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; + r_gl_format=GL_RGBA; + r_gl_type=GL_UNSIGNED_BYTE; + r_compressed=true; + srgb=true; + + } else { + + need_decompress=true; + } + + + } break; + case Image::FORMAT_PVRTC4: { + + if (config.pvrtc_supported) { + + + r_gl_internal_format=(config.srgb_decode_supported || p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)?_EXT_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT:_EXT_COMPRESSED_RGB_PVRTC_4BPPV1_IMG; + r_gl_format=GL_RGBA; + r_gl_type=GL_UNSIGNED_BYTE; + r_compressed=true; + srgb=true; + + } else { + + need_decompress=true; + } + + } break; + case Image::FORMAT_PVRTC4A: { + + if (config.pvrtc_supported) { + + + r_gl_internal_format=(config.srgb_decode_supported || p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)?_EXT_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT:_EXT_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; + r_gl_format=GL_RGBA; + r_gl_type=GL_UNSIGNED_BYTE; + r_compressed=true; + srgb=true; + + } else { + + need_decompress=true; + } + + + } break; + case Image::FORMAT_ETC: { + + if (config.etc_supported) { + + r_gl_internal_format=_EXT_ETC1_RGB8_OES; + r_gl_format=GL_RGBA; + r_gl_type=GL_UNSIGNED_BYTE; + r_compressed=true; + + } else { + + need_decompress=true; + } + + } break; + case Image::FORMAT_ETC2_R11: { + + if (config.etc2_supported) { + + r_gl_internal_format=_EXT_COMPRESSED_R11_EAC; + r_gl_format=GL_RED; + r_gl_type=GL_UNSIGNED_BYTE; + r_compressed=true; + + } else { + + need_decompress=true; + } + } break; + case Image::FORMAT_ETC2_R11S: { + + if (config.etc2_supported) { + + r_gl_internal_format=_EXT_COMPRESSED_SIGNED_R11_EAC; + r_gl_format=GL_RED; + r_gl_type=GL_UNSIGNED_BYTE; + r_compressed=true; + + } else { + + need_decompress=true; + } + } break; + case Image::FORMAT_ETC2_RG11: { + + if (config.etc2_supported) { + + r_gl_internal_format=_EXT_COMPRESSED_RG11_EAC; + r_gl_format=GL_RG; + r_gl_type=GL_UNSIGNED_BYTE; + r_compressed=true; + + } else { + + need_decompress=true; + } + } break; + case Image::FORMAT_ETC2_RG11S: { + if (config.etc2_supported) { + + r_gl_internal_format=_EXT_COMPRESSED_SIGNED_RG11_EAC; + r_gl_format=GL_RG; + r_gl_type=GL_UNSIGNED_BYTE; + r_compressed=true; + + } else { + need_decompress=true; + } + } break; + case Image::FORMAT_ETC2_RGB8: { + + if (config.etc2_supported) { + + r_gl_internal_format=(config.srgb_decode_supported || p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)?_EXT_COMPRESSED_SRGB8_ETC2:_EXT_COMPRESSED_RGB8_ETC2; + r_gl_format=GL_RGB; + r_gl_type=GL_UNSIGNED_BYTE; + r_compressed=true; + srgb=true; + + + } else { + + need_decompress=true; + } + } break; + case Image::FORMAT_ETC2_RGBA8: { + + if (config.etc2_supported) { + + r_gl_internal_format=(config.srgb_decode_supported || p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)?_EXT_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:_EXT_COMPRESSED_RGBA8_ETC2_EAC; + r_gl_format=GL_RGBA; + r_gl_type=GL_UNSIGNED_BYTE; + r_compressed=true; + srgb=true; + + + } else { + + need_decompress=true; + } + } break; + case Image::FORMAT_ETC2_RGB8A1: { + + if (config.etc2_supported) { + + r_gl_internal_format=(config.srgb_decode_supported || p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)?_EXT_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:_EXT_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2; + r_gl_format=GL_RGBA; + r_gl_type=GL_UNSIGNED_BYTE; + r_compressed=true; + srgb=true; + + + } else { + + need_decompress=true; + } + } break; + default: { + + ERR_FAIL_V(Image()); + } + } + + if (need_decompress) { + + if (!image.empty()) { + image.decompress(); + ERR_FAIL_COND_V(image.is_compressed(),image); + image.convert(Image::FORMAT_RGBA8); + } + + + r_gl_format=GL_RGBA; + r_gl_internal_format=(config.srgb_decode_supported || p_flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)?GL_SRGB8_ALPHA8:GL_RGBA8; + r_gl_type=GL_UNSIGNED_BYTE; + r_compressed=false; + srgb=true; + + return image; + + } + + + return image; +} + +static const GLenum _cube_side_enum[6]={ + + GL_TEXTURE_CUBE_MAP_NEGATIVE_X, + GL_TEXTURE_CUBE_MAP_POSITIVE_X, + GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, + GL_TEXTURE_CUBE_MAP_POSITIVE_Y, + GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, + GL_TEXTURE_CUBE_MAP_POSITIVE_Z, + +}; + +RID RasterizerStorageGLES3::texture_create() { + + Texture *texture = memnew(Texture); + ERR_FAIL_COND_V(!texture,RID()); + glGenTextures(1, &texture->tex_id); + texture->active=false; + texture->total_data_size=0; + + return texture_owner.make_rid( texture ); + +} + +void RasterizerStorageGLES3::texture_allocate(RID p_texture,int p_width, int p_height,Image::Format p_format,uint32_t p_flags) { + + int components; + GLenum format; + GLenum internal_format; + GLenum type; + + bool compressed; + bool srgb; + + if (p_flags&VS::TEXTURE_FLAG_USED_FOR_STREAMING) { + p_flags&=~VS::TEXTURE_FLAG_MIPMAPS; // no mipies for video + } + + + Texture *texture = texture_owner.get( p_texture ); + ERR_FAIL_COND(!texture); + texture->width=p_width; + texture->height=p_height; + texture->format=p_format; + texture->flags=p_flags; + texture->stored_cube_sides=0; + texture->target = (p_flags & VS::TEXTURE_FLAG_CUBEMAP) ? GL_TEXTURE_CUBE_MAP : GL_TEXTURE_2D; + + _get_gl_image_and_format(Image(),texture->format,texture->flags,format,internal_format,type,compressed,srgb); + + texture->alloc_width = texture->width; + texture->alloc_height = texture->height; + + + texture->gl_format_cache=format; + texture->gl_type_cache=type; + texture->gl_internal_format_cache=internal_format; + texture->compressed=compressed; + texture->srgb=srgb; + texture->data_size=0; + texture->mipmaps=1; + + + glActiveTexture(GL_TEXTURE0); + glBindTexture(texture->target, texture->tex_id); + + + if (p_flags&VS::TEXTURE_FLAG_USED_FOR_STREAMING) { + //prealloc if video + glTexImage2D(texture->target, 0, internal_format, p_width, p_height, 0, format, type,NULL); + } + + texture->active=true; +} + +void RasterizerStorageGLES3::texture_set_data(RID p_texture,const Image& p_image,VS::CubeMapSide p_cube_side) { + + Texture * texture = texture_owner.get(p_texture); + + ERR_FAIL_COND(!texture); + ERR_FAIL_COND(!texture->active); + ERR_FAIL_COND(texture->render_target); + ERR_FAIL_COND(texture->format != p_image.get_format() ); + ERR_FAIL_COND( p_image.empty() ); + + GLenum type; + GLenum format; + GLenum internal_format; + bool compressed; + bool srgb; + + + if (config.keep_original_textures && !(texture->flags&VS::TEXTURE_FLAG_USED_FOR_STREAMING)) { + texture->images[p_cube_side]=p_image; + } + + Image img = _get_gl_image_and_format(p_image, p_image.get_format(),texture->flags,format,internal_format,type,compressed,srgb); + + if (config.shrink_textures_x2 && (p_image.has_mipmaps() || !p_image.is_compressed()) && !(texture->flags&VS::TEXTURE_FLAG_USED_FOR_STREAMING)) { + + texture->alloc_height = MAX(1,texture->alloc_height/2); + texture->alloc_width = MAX(1,texture->alloc_width/2); + + if (texture->alloc_width == img.get_width()/2 && texture->alloc_height == img.get_height()/2) { + + img.shrink_x2(); + } else if (img.get_format() <= Image::FORMAT_RGB565) { + + img.resize(texture->alloc_width, texture->alloc_height, Image::INTERPOLATE_BILINEAR); + + } + }; + + + GLenum blit_target = (texture->target == GL_TEXTURE_CUBE_MAP)?_cube_side_enum[p_cube_side]:GL_TEXTURE_2D; + + texture->data_size=img.get_data().size(); + PoolVector<uint8_t>::Read read = img.get_data().read(); + + glActiveTexture(GL_TEXTURE0); + glBindTexture(texture->target, texture->tex_id); + + texture->ignore_mipmaps = compressed && !img.has_mipmaps(); + + if (texture->flags&VS::TEXTURE_FLAG_MIPMAPS && !texture->ignore_mipmaps) + glTexParameteri(texture->target,GL_TEXTURE_MIN_FILTER,config.use_fast_texture_filter?GL_LINEAR_MIPMAP_NEAREST:GL_LINEAR_MIPMAP_LINEAR); + else { + if (texture->flags&VS::TEXTURE_FLAG_FILTER) { + glTexParameteri(texture->target,GL_TEXTURE_MIN_FILTER,GL_LINEAR); + } else { + glTexParameteri(texture->target,GL_TEXTURE_MIN_FILTER,GL_NEAREST); + + } + } + + + if (config.srgb_decode_supported && srgb) { + + if (texture->flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR) { + + glTexParameteri(texture->target,_TEXTURE_SRGB_DECODE_EXT,_DECODE_EXT); + texture->using_srgb=true; + } else { + glTexParameteri(texture->target,_TEXTURE_SRGB_DECODE_EXT,_SKIP_DECODE_EXT); + texture->using_srgb=false; + } + } + + if (texture->flags&VS::TEXTURE_FLAG_FILTER) { + + glTexParameteri(texture->target,GL_TEXTURE_MAG_FILTER,GL_LINEAR); // Linear Filtering + + } else { + + glTexParameteri(texture->target,GL_TEXTURE_MAG_FILTER,GL_NEAREST); // raw Filtering + } + + if ((texture->flags&VS::TEXTURE_FLAG_REPEAT || texture->flags&VS::TEXTURE_FLAG_MIRRORED_REPEAT) && texture->target != GL_TEXTURE_CUBE_MAP) { + + if (texture->flags&VS::TEXTURE_FLAG_MIRRORED_REPEAT){ + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT ); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_MIRRORED_REPEAT ); + } + else{ + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); + } + } else { + + //glTexParameterf( texture->target, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE ); + glTexParameterf( texture->target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); + glTexParameterf( texture->target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); + } + + //set swizle for older format compatibility + switch(texture->format) { + + case Image::FORMAT_L8: { + glTexParameteri(texture->target,GL_TEXTURE_SWIZZLE_R,GL_RED); + glTexParameteri(texture->target,GL_TEXTURE_SWIZZLE_G,GL_RED); + glTexParameteri(texture->target,GL_TEXTURE_SWIZZLE_B,GL_RED); + glTexParameteri(texture->target,GL_TEXTURE_SWIZZLE_A,GL_ONE); + + } break; + case Image::FORMAT_LA8: { + + glTexParameteri(texture->target,GL_TEXTURE_SWIZZLE_R,GL_RED); + glTexParameteri(texture->target,GL_TEXTURE_SWIZZLE_G,GL_RED); + glTexParameteri(texture->target,GL_TEXTURE_SWIZZLE_B,GL_RED); + glTexParameteri(texture->target,GL_TEXTURE_SWIZZLE_A,GL_GREEN); + } break; + default: { + glTexParameteri(texture->target,GL_TEXTURE_SWIZZLE_R,GL_RED); + glTexParameteri(texture->target,GL_TEXTURE_SWIZZLE_G,GL_GREEN); + glTexParameteri(texture->target,GL_TEXTURE_SWIZZLE_B,GL_BLUE); + glTexParameteri(texture->target,GL_TEXTURE_SWIZZLE_A,GL_ALPHA); + + } break; + + } + if (config.use_anisotropic_filter) { + + if (texture->flags&VS::TEXTURE_FLAG_ANISOTROPIC_FILTER) { + + glTexParameterf(texture->target, _GL_TEXTURE_MAX_ANISOTROPY_EXT, config.anisotropic_level); + } else { + glTexParameterf(texture->target, _GL_TEXTURE_MAX_ANISOTROPY_EXT, 1); + } + } + + int mipmaps= (texture->flags&VS::TEXTURE_FLAG_MIPMAPS && img.has_mipmaps()) ? img.get_mipmap_count() +1: 1; + + + int w=img.get_width(); + int h=img.get_height(); + + int tsize=0; + for(int i=0;i<mipmaps;i++) { + + int size,ofs; + img.get_mipmap_offset_and_size(i,ofs,size); + + //print_line("mipmap: "+itos(i)+" size: "+itos(size)+" w: "+itos(mm_w)+", h: "+itos(mm_h)); + + if (texture->compressed) { + glPixelStorei(GL_UNPACK_ALIGNMENT, 4); + glCompressedTexImage2D( blit_target, i, format,w,h,0,size,&read[ofs] ); + + } else { + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + if (texture->flags&VS::TEXTURE_FLAG_USED_FOR_STREAMING) { + glTexSubImage2D( blit_target, i, 0,0,w, h,format,type,&read[ofs] ); + } else { + glTexImage2D(blit_target, i, internal_format, w, h, 0, format, type,&read[ofs]); + } + + } + tsize+=size; + + w = MAX(1,w>>1); + h = MAX(1,h>>1); + + } + + info.texture_mem-=texture->total_data_size; + texture->total_data_size=tsize; + info.texture_mem+=texture->total_data_size; + + //printf("texture: %i x %i - size: %i - total: %i\n",texture->width,texture->height,tsize,_rinfo.texture_mem); + + texture->stored_cube_sides|=(1<<p_cube_side); + + if (texture->flags&VS::TEXTURE_FLAG_MIPMAPS && mipmaps==1 && !texture->ignore_mipmaps && (!(texture->flags&VS::TEXTURE_FLAG_CUBEMAP) || texture->stored_cube_sides==(1<<6)-1)) { + //generate mipmaps if they were requested and the image does not contain them + glGenerateMipmap(texture->target); + } + + texture->mipmaps=mipmaps; + + //texture_set_flags(p_texture,texture->flags); + + +} + +Image RasterizerStorageGLES3::texture_get_data(RID p_texture,VS::CubeMapSide p_cube_side) const { + + Texture * texture = texture_owner.get(p_texture); + + ERR_FAIL_COND_V(!texture,Image()); + ERR_FAIL_COND_V(!texture->active,Image()); + ERR_FAIL_COND_V(texture->data_size==0,Image()); + ERR_FAIL_COND_V(texture->render_target,Image()); + + if (!texture->images[p_cube_side].empty()) + return texture->images[p_cube_side]; + +#ifdef GLES_OVER_GL + + PoolVector<uint8_t> data; + + int data_size = Image::get_image_data_size(texture->alloc_width,texture->alloc_height,texture->format,texture->mipmaps>1?-1:0); + + data.resize(data_size*2); //add some memory at the end, just in case for buggy drivers + PoolVector<uint8_t>::Write wb = data.write(); + + glActiveTexture(GL_TEXTURE0); + + glBindTexture(texture->target,texture->tex_id); + + glBindBuffer(GL_PIXEL_PACK_BUFFER, 0); + + print_line("GET FORMAT: "+Image::get_format_name(texture->format)+" mipmaps: "+itos(texture->mipmaps)); + + + for(int i=0;i<texture->mipmaps;i++) { + + int ofs=0; + if (i>0) { + ofs=Image::get_image_data_size(texture->alloc_width,texture->alloc_height,texture->format,i-1); + } + + if (texture->compressed) { + + glPixelStorei(GL_PACK_ALIGNMENT, 4); + glGetCompressedTexImage(texture->target,i,&wb[ofs]); + + } else { + + glPixelStorei(GL_PACK_ALIGNMENT, 1); + + glGetTexImage(texture->target,i,texture->gl_format_cache,texture->gl_type_cache,&wb[ofs]); + } + } + + + wb=PoolVector<uint8_t>::Write(); + + data.resize(data_size); + + Image img(texture->alloc_width,texture->alloc_height,texture->mipmaps>1?true:false,texture->format,data); + + return img; +#else + + ERR_EXPLAIN("Sorry, It's not posible to obtain images back in OpenGL ES"); + return Image(); +#endif +} + +void RasterizerStorageGLES3::texture_set_flags(RID p_texture,uint32_t p_flags) { + + Texture *texture = texture_owner.get( p_texture ); + ERR_FAIL_COND(!texture); + if (texture->render_target) { + + p_flags&=VS::TEXTURE_FLAG_FILTER;//can change only filter + } + + bool had_mipmaps = texture->flags&VS::TEXTURE_FLAG_MIPMAPS; + + glActiveTexture(GL_TEXTURE0); + glBindTexture(texture->target, texture->tex_id); + uint32_t cube = texture->flags & VS::TEXTURE_FLAG_CUBEMAP; + texture->flags=p_flags|cube; // can't remove a cube from being a cube + + + if ((texture->flags&VS::TEXTURE_FLAG_REPEAT || texture->flags&VS::TEXTURE_FLAG_MIRRORED_REPEAT) && texture->target != GL_TEXTURE_CUBE_MAP) { + + if (texture->flags&VS::TEXTURE_FLAG_MIRRORED_REPEAT){ + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT ); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_MIRRORED_REPEAT ); + } + else { + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT ); + glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT ); + } + } else { + //glTexParameterf( texture->target, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE ); + glTexParameterf( texture->target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); + glTexParameterf( texture->target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); + + } + + + if (config.use_anisotropic_filter) { + + if (texture->flags&VS::TEXTURE_FLAG_ANISOTROPIC_FILTER) { + + glTexParameterf(texture->target, _GL_TEXTURE_MAX_ANISOTROPY_EXT, config.anisotropic_level); + } else { + glTexParameterf(texture->target, _GL_TEXTURE_MAX_ANISOTROPY_EXT, 1); + } + } + + if (texture->flags&VS::TEXTURE_FLAG_MIPMAPS && !texture->ignore_mipmaps) { + if (!had_mipmaps && texture->mipmaps==1) { + glGenerateMipmap(texture->target); + } + glTexParameteri(texture->target,GL_TEXTURE_MIN_FILTER,config.use_fast_texture_filter?GL_LINEAR_MIPMAP_NEAREST:GL_LINEAR_MIPMAP_LINEAR); + + } else{ + if (texture->flags&VS::TEXTURE_FLAG_FILTER) { + glTexParameteri(texture->target,GL_TEXTURE_MIN_FILTER,GL_LINEAR); + } else { + glTexParameteri(texture->target,GL_TEXTURE_MIN_FILTER,GL_NEAREST); + + } + } + + + if (config.srgb_decode_supported && texture->srgb) { + + if (texture->flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR) { + + glTexParameteri(texture->target,_TEXTURE_SRGB_DECODE_EXT,_DECODE_EXT); + texture->using_srgb=true; + } else { + glTexParameteri(texture->target,_TEXTURE_SRGB_DECODE_EXT,_SKIP_DECODE_EXT); + texture->using_srgb=false; + } + } + + if (texture->flags&VS::TEXTURE_FLAG_FILTER) { + + glTexParameteri(texture->target,GL_TEXTURE_MAG_FILTER,GL_LINEAR); // Linear Filtering + + } else { + + glTexParameteri(texture->target,GL_TEXTURE_MAG_FILTER,GL_NEAREST); // raw Filtering + } + +} +uint32_t RasterizerStorageGLES3::texture_get_flags(RID p_texture) const { + + Texture * texture = texture_owner.get(p_texture); + + ERR_FAIL_COND_V(!texture,0); + + return texture->flags; + +} +Image::Format RasterizerStorageGLES3::texture_get_format(RID p_texture) const { + + Texture * texture = texture_owner.get(p_texture); + + ERR_FAIL_COND_V(!texture,Image::FORMAT_L8); + + return texture->format; +} +uint32_t RasterizerStorageGLES3::texture_get_width(RID p_texture) const { + + Texture * texture = texture_owner.get(p_texture); + + ERR_FAIL_COND_V(!texture,0); + + return texture->width; +} +uint32_t RasterizerStorageGLES3::texture_get_height(RID p_texture) const { + + Texture * texture = texture_owner.get(p_texture); + + ERR_FAIL_COND_V(!texture,0); + + return texture->height; +} + + +void RasterizerStorageGLES3::texture_set_size_override(RID p_texture,int p_width, int p_height) { + + Texture * texture = texture_owner.get(p_texture); + + ERR_FAIL_COND(!texture); + ERR_FAIL_COND(texture->render_target); + + ERR_FAIL_COND(p_width<=0 || p_width>16384); + ERR_FAIL_COND(p_height<=0 || p_height>16384); + //real texture size is in alloc width and height + texture->width=p_width; + texture->height=p_height; + +} + +void RasterizerStorageGLES3::texture_set_path(RID p_texture,const String& p_path) { + Texture * texture = texture_owner.get(p_texture); + ERR_FAIL_COND(!texture); + + texture->path=p_path; + +} + +String RasterizerStorageGLES3::texture_get_path(RID p_texture) const{ + + Texture * texture = texture_owner.get(p_texture); + ERR_FAIL_COND_V(!texture,String()); + return texture->path; +} +void RasterizerStorageGLES3::texture_debug_usage(List<VS::TextureInfo> *r_info){ + + List<RID> textures; + texture_owner.get_owned_list(&textures); + + for (List<RID>::Element *E=textures.front();E;E=E->next()) { + + Texture *t = texture_owner.get(E->get()); + if (!t) + continue; + VS::TextureInfo tinfo; + tinfo.path=t->path; + tinfo.format=t->format; + tinfo.size.x=t->alloc_width; + tinfo.size.y=t->alloc_height; + tinfo.bytes=t->total_data_size; + r_info->push_back(tinfo); + } + +} + +void RasterizerStorageGLES3::texture_set_shrink_all_x2_on_set_data(bool p_enable) { + + config.shrink_textures_x2=p_enable; +} + +void RasterizerStorageGLES3::textures_keep_original(bool p_enable) { + + config.keep_original_textures=p_enable; +} + +RID RasterizerStorageGLES3::texture_create_radiance_cubemap(RID p_source,int p_resolution) const { + + Texture * texture = texture_owner.get(p_source); + ERR_FAIL_COND_V(!texture,RID()); + ERR_FAIL_COND_V(!(texture->flags&VS::TEXTURE_FLAG_CUBEMAP),RID()); + + bool use_float=true; + + if (p_resolution<0) { + p_resolution=texture->width; + } + + + glBindVertexArray(0); + glDisable(GL_CULL_FACE); + glDisable(GL_DEPTH_TEST); + glDisable(GL_SCISSOR_TEST); + glDisable(GL_BLEND); + + + glActiveTexture(GL_TEXTURE0); + glBindTexture(texture->target, texture->tex_id); + + if (config.srgb_decode_supported && texture->srgb && !texture->using_srgb) { + + glTexParameteri(texture->target,_TEXTURE_SRGB_DECODE_EXT,_DECODE_EXT); + texture->using_srgb=true; +#ifdef TOOLS_ENABLED + if (!(texture->flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) { + texture->flags|=VS::TEXTURE_FLAG_CONVERT_TO_LINEAR; + //notify that texture must be set to linear beforehand, so it works in other platforms when exported + } +#endif + } + + + glActiveTexture(GL_TEXTURE1); + GLuint new_cubemap; + glGenTextures(1, &new_cubemap); + glBindTexture(GL_TEXTURE_CUBE_MAP, new_cubemap); + + + GLuint tmp_fb; + + glGenFramebuffers(1, &tmp_fb); + glBindFramebuffer(GL_FRAMEBUFFER, tmp_fb); + + + int size = p_resolution; + + int lod=0; + + shaders.cubemap_filter.bind(); + + int mipmaps=6; + + int mm_level=mipmaps; + + GLenum internal_format = use_float?GL_RGBA16F:GL_RGB10_A2; + GLenum format = GL_RGBA; + GLenum type = use_float?GL_HALF_FLOAT:GL_UNSIGNED_INT_2_10_10_10_REV; + + + while(mm_level) { + + for(int i=0;i<6;i++) { + glTexImage2D(_cube_side_enum[i], lod, internal_format, size, size, 0, format, type, NULL); + } + + lod++; + mm_level--; + + if (size>1) + size>>=1; + } + + glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_BASE_LEVEL, 0); + glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAX_LEVEL, lod-1); + + lod=0; + mm_level=mipmaps; + + size = p_resolution; + + shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_DUAL_PARABOLOID,false); + + while(mm_level) { + + for(int i=0;i<6;i++) { + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, _cube_side_enum[i], new_cubemap, lod); + + glViewport(0,0,size,size); + glBindVertexArray(resources.quadie_array); + + shaders.cubemap_filter.set_uniform(CubemapFilterShaderGLES3::FACE_ID,i); + shaders.cubemap_filter.set_uniform(CubemapFilterShaderGLES3::ROUGHNESS,lod/float(mipmaps-1)); + + + glDrawArrays(GL_TRIANGLE_FAN,0,4); + glBindVertexArray(0); +#ifdef DEBUG_ENABLED + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + ERR_CONTINUE(status!=GL_FRAMEBUFFER_COMPLETE); +#endif + } + + + + if (size>1) + size>>=1; + lod++; + mm_level--; + + } + + + //restore ranges + glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_BASE_LEVEL, 0); + glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAX_LEVEL, lod-1); + + glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); + glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); + + glBindFramebuffer(GL_FRAMEBUFFER, config.system_fbo); + glDeleteFramebuffers(1, &tmp_fb); + + Texture * ctex = memnew( Texture ); + + ctex->flags=VS::TEXTURE_FLAG_CUBEMAP|VS::TEXTURE_FLAG_MIPMAPS|VS::TEXTURE_FLAG_FILTER; + ctex->width=p_resolution; + ctex->height=p_resolution; + ctex->alloc_width=p_resolution; + ctex->alloc_height=p_resolution; + ctex->format=use_float?Image::FORMAT_RGBAH:Image::FORMAT_RGBA8; + ctex->target=GL_TEXTURE_CUBE_MAP; + ctex->gl_format_cache=format; + ctex->gl_internal_format_cache=internal_format; + ctex->gl_type_cache=type; + ctex->data_size=0; + ctex->compressed=false; + ctex->srgb=false; + ctex->total_data_size=0; + ctex->ignore_mipmaps=false; + ctex->mipmaps=mipmaps; + ctex->active=true; + ctex->tex_id=new_cubemap; + ctex->stored_cube_sides=(1<<6)-1; + ctex->render_target=NULL; + + return texture_owner.make_rid(ctex); +} + + +RID RasterizerStorageGLES3::skybox_create() { + + SkyBox *skybox = memnew( SkyBox ); + skybox->radiance=0; + return skybox_owner.make_rid(skybox); +} + +void RasterizerStorageGLES3::skybox_set_texture(RID p_skybox, RID p_cube_map, int p_radiance_size){ + + SkyBox *skybox = skybox_owner.getornull(p_skybox); + ERR_FAIL_COND(!skybox); + + if (skybox->cubemap.is_valid()) { + skybox->cubemap=RID(); + glDeleteTextures(1,&skybox->radiance); + skybox->radiance=0; + } + + skybox->cubemap=p_cube_map; + if (!skybox->cubemap.is_valid()) + return; //cleared + + Texture *texture = texture_owner.getornull(skybox->cubemap); + if (!texture || !(texture->flags&VS::TEXTURE_FLAG_CUBEMAP)) { + skybox->cubemap=RID(); + ERR_FAIL_COND(!texture || !(texture->flags&VS::TEXTURE_FLAG_CUBEMAP)); + } + + glBindVertexArray(0); + glDisable(GL_CULL_FACE); + glDisable(GL_DEPTH_TEST); + glDisable(GL_SCISSOR_TEST); + glDisable(GL_BLEND); + + + glActiveTexture(GL_TEXTURE0); + glBindTexture(texture->target, texture->tex_id); + + if (config.srgb_decode_supported && texture->srgb && !texture->using_srgb) { + + glTexParameteri(texture->target,_TEXTURE_SRGB_DECODE_EXT,_DECODE_EXT); + texture->using_srgb=true; +#ifdef TOOLS_ENABLED + if (!(texture->flags&VS::TEXTURE_FLAG_CONVERT_TO_LINEAR)) { + texture->flags|=VS::TEXTURE_FLAG_CONVERT_TO_LINEAR; + //notify that texture must be set to linear beforehand, so it works in other platforms when exported + } +#endif + } + + + glActiveTexture(GL_TEXTURE1); + glGenTextures(1, &skybox->radiance); + glBindTexture(GL_TEXTURE_2D, skybox->radiance); + + GLuint tmp_fb; + + glGenFramebuffers(1, &tmp_fb); + glBindFramebuffer(GL_FRAMEBUFFER, tmp_fb); + + + int size = p_radiance_size; + + int lod=0; + + + int mipmaps=6; + + int mm_level=mipmaps; + + bool use_float=true; + + GLenum internal_format = use_float?GL_RGBA16F:GL_RGB10_A2; + GLenum format = GL_RGBA; + GLenum type = use_float?GL_HALF_FLOAT:GL_UNSIGNED_INT_2_10_10_10_REV; + + while(mm_level) { + + glTexImage2D(GL_TEXTURE_2D, lod, internal_format, size, size*2, 0, format, type, NULL); + lod++; + mm_level--; + + if (size>1) + size>>=1; + } + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, lod-1); + + lod=0; + mm_level=mipmaps; + + size = p_radiance_size; + + shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_DUAL_PARABOLOID,true); + shaders.cubemap_filter.bind(); + + while(mm_level) { + + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, skybox->radiance, lod); +#ifdef DEBUG_ENABLED + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + ERR_CONTINUE(status!=GL_FRAMEBUFFER_COMPLETE); +#endif + + for(int i=0;i<2;i++) { + glViewport(0,i*size,size,size); + glBindVertexArray(resources.quadie_array); + + shaders.cubemap_filter.set_uniform(CubemapFilterShaderGLES3::Z_FLIP,i>0); + shaders.cubemap_filter.set_uniform(CubemapFilterShaderGLES3::ROUGHNESS,lod/float(mipmaps-1)); + + + glDrawArrays(GL_TRIANGLE_FAN,0,4); + glBindVertexArray(0); + } + + if (size>1) + size>>=1; + lod++; + mm_level--; + + } + shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_DUAL_PARABOLOID,false); + + + //restore ranges + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, lod-1); + + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + glBindFramebuffer(GL_FRAMEBUFFER, config.system_fbo); + glDeleteFramebuffers(1, &tmp_fb); + +} + + +/* SHADER API */ + + +RID RasterizerStorageGLES3::shader_create(VS::ShaderMode p_mode){ + + Shader *shader = memnew( Shader ); + shader->mode=p_mode; + RID rid = shader_owner.make_rid(shader); + shader_set_mode(rid,p_mode); + _shader_make_dirty(shader); + shader->self=rid; + + return rid; +} + +void RasterizerStorageGLES3::_shader_make_dirty(Shader* p_shader) { + + if (p_shader->dirty_list.in_list()) + return; + + _shader_dirty_list.add(&p_shader->dirty_list); +} + +void RasterizerStorageGLES3::shader_set_mode(RID p_shader,VS::ShaderMode p_mode){ + + ERR_FAIL_INDEX(p_mode,VS::SHADER_MAX); + Shader *shader=shader_owner.get(p_shader); + ERR_FAIL_COND(!shader); + + if (shader->custom_code_id && p_mode==shader->mode) + return; + + + if (shader->custom_code_id) { + + shader->shader->free_custom_shader(shader->custom_code_id); + shader->custom_code_id=0; + } + + shader->mode=p_mode; + + ShaderGLES3* shaders[VS::SHADER_MAX]={ + &scene->state.scene_shader, + &canvas->state.canvas_shader, + &this->shaders.particles, + + }; + + shader->shader=shaders[p_mode]; + + shader->custom_code_id = shader->shader->create_custom_shader(); + + _shader_make_dirty(shader); + +} +VS::ShaderMode RasterizerStorageGLES3::shader_get_mode(RID p_shader) const { + + const Shader *shader=shader_owner.get(p_shader); + ERR_FAIL_COND_V(!shader,VS::SHADER_MAX); + + return shader->mode; +} +void RasterizerStorageGLES3::shader_set_code(RID p_shader, const String& p_code){ + + Shader *shader=shader_owner.get(p_shader); + ERR_FAIL_COND(!shader); + + shader->code=p_code; + _shader_make_dirty(shader); +} +String RasterizerStorageGLES3::shader_get_code(RID p_shader) const{ + + const Shader *shader=shader_owner.get(p_shader); + ERR_FAIL_COND_V(!shader,String()); + + + return shader->code; +} + +void RasterizerStorageGLES3::_update_shader(Shader* p_shader) const { + + + _shader_dirty_list.remove( &p_shader->dirty_list ); + + p_shader->valid=false; + + p_shader->uniforms.clear(); + + ShaderCompilerGLES3::GeneratedCode gen_code; + ShaderCompilerGLES3::IdentifierActions *actions=NULL; + + + + switch(p_shader->mode) { + case VS::SHADER_CANVAS_ITEM: { + + p_shader->canvas_item.light_mode=Shader::CanvasItem::LIGHT_MODE_NORMAL; + p_shader->canvas_item.blend_mode=Shader::CanvasItem::BLEND_MODE_MIX; + + shaders.actions_canvas.render_mode_values["blend_add"]=Pair<int*,int>(&p_shader->canvas_item.blend_mode,Shader::CanvasItem::BLEND_MODE_ADD); + shaders.actions_canvas.render_mode_values["blend_mix"]=Pair<int*,int>(&p_shader->canvas_item.blend_mode,Shader::CanvasItem::BLEND_MODE_MIX); + shaders.actions_canvas.render_mode_values["blend_sub"]=Pair<int*,int>(&p_shader->canvas_item.blend_mode,Shader::CanvasItem::BLEND_MODE_SUB); + shaders.actions_canvas.render_mode_values["blend_mul"]=Pair<int*,int>(&p_shader->canvas_item.blend_mode,Shader::CanvasItem::BLEND_MODE_MUL); + shaders.actions_canvas.render_mode_values["blend_premul_alpha"]=Pair<int*,int>(&p_shader->canvas_item.blend_mode,Shader::CanvasItem::BLEND_MODE_PMALPHA); + + shaders.actions_canvas.render_mode_values["unshaded"]=Pair<int*,int>(&p_shader->canvas_item.light_mode,Shader::CanvasItem::LIGHT_MODE_UNSHADED); + shaders.actions_canvas.render_mode_values["light_only"]=Pair<int*,int>(&p_shader->canvas_item.light_mode,Shader::CanvasItem::LIGHT_MODE_LIGHT_ONLY); + + actions=&shaders.actions_canvas; + actions->uniforms=&p_shader->uniforms; + + } break; + + case VS::SHADER_SPATIAL: { + + p_shader->spatial.blend_mode=Shader::Spatial::BLEND_MODE_MIX; + p_shader->spatial.depth_draw_mode=Shader::Spatial::DEPTH_DRAW_OPAQUE; + p_shader->spatial.cull_mode=Shader::Spatial::CULL_MODE_BACK; + p_shader->spatial.uses_alpha=false; + p_shader->spatial.uses_discard=false; + p_shader->spatial.unshaded=false; + p_shader->spatial.ontop=false; + p_shader->spatial.uses_sss=false; + p_shader->spatial.uses_vertex=false; + + shaders.actions_scene.render_mode_values["blend_add"]=Pair<int*,int>(&p_shader->spatial.blend_mode,Shader::Spatial::BLEND_MODE_ADD); + shaders.actions_scene.render_mode_values["blend_mix"]=Pair<int*,int>(&p_shader->spatial.blend_mode,Shader::Spatial::BLEND_MODE_MIX); + shaders.actions_scene.render_mode_values["blend_sub"]=Pair<int*,int>(&p_shader->spatial.blend_mode,Shader::Spatial::BLEND_MODE_SUB); + shaders.actions_scene.render_mode_values["blend_mul"]=Pair<int*,int>(&p_shader->spatial.blend_mode,Shader::Spatial::BLEND_MODE_MUL); + + shaders.actions_scene.render_mode_values["depth_draw_opaque"]=Pair<int*,int>(&p_shader->spatial.depth_draw_mode,Shader::Spatial::DEPTH_DRAW_OPAQUE); + shaders.actions_scene.render_mode_values["depth_draw_always"]=Pair<int*,int>(&p_shader->spatial.depth_draw_mode,Shader::Spatial::DEPTH_DRAW_ALWAYS); + shaders.actions_scene.render_mode_values["depth_draw_never"]=Pair<int*,int>(&p_shader->spatial.depth_draw_mode,Shader::Spatial::DEPTH_DRAW_NEVER); + shaders.actions_scene.render_mode_values["depth_draw_alpha_prepass"]=Pair<int*,int>(&p_shader->spatial.depth_draw_mode,Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS); + + shaders.actions_scene.render_mode_values["cull_front"]=Pair<int*,int>(&p_shader->spatial.cull_mode,Shader::Spatial::CULL_MODE_FRONT); + shaders.actions_scene.render_mode_values["cull_back"]=Pair<int*,int>(&p_shader->spatial.cull_mode,Shader::Spatial::CULL_MODE_BACK); + shaders.actions_scene.render_mode_values["cull_disabled"]=Pair<int*,int>(&p_shader->spatial.cull_mode,Shader::Spatial::CULL_MODE_DISABLED); + + shaders.actions_scene.render_mode_flags["unshaded"]=&p_shader->spatial.unshaded; + shaders.actions_scene.render_mode_flags["ontop"]=&p_shader->spatial.ontop; + + shaders.actions_scene.usage_flag_pointers["ALPHA"]=&p_shader->spatial.uses_alpha; + shaders.actions_scene.usage_flag_pointers["VERTEX"]=&p_shader->spatial.uses_vertex; + + shaders.actions_scene.usage_flag_pointers["SSS_STRENGTH"]=&p_shader->spatial.uses_sss; + shaders.actions_scene.usage_flag_pointers["DISCARD"]=&p_shader->spatial.uses_discard; + + actions=&shaders.actions_scene; + actions->uniforms=&p_shader->uniforms; + + + } + case VS::SHADER_PARTICLES: { + + actions=&shaders.actions_particles; + actions->uniforms=&p_shader->uniforms; + } + + } + + + Error err = shaders.compiler.compile(p_shader->mode,p_shader->code,actions,p_shader->path,gen_code); + + + ERR_FAIL_COND(err!=OK); + + p_shader->shader->set_custom_shader_code(p_shader->custom_code_id,gen_code.vertex,gen_code.vertex_global,gen_code.fragment,gen_code.light,gen_code.fragment_global,gen_code.uniforms,gen_code.texture_uniforms,gen_code.defines); + + p_shader->ubo_size=gen_code.uniform_total_size; + p_shader->ubo_offsets=gen_code.uniform_offsets; + p_shader->texture_count=gen_code.texture_uniforms.size(); + p_shader->texture_hints=gen_code.texture_hints; + + p_shader->uses_vertex_time=gen_code.uses_vertex_time; + p_shader->uses_fragment_time=gen_code.uses_fragment_time; + + //all materials using this shader will have to be invalidated, unfortunately + + for (SelfList<Material>* E = p_shader->materials.first();E;E=E->next() ) { + + _material_make_dirty(E->self()); + } + + p_shader->valid=true; + p_shader->version++; + + +} + +void RasterizerStorageGLES3::update_dirty_shaders() { + + while( _shader_dirty_list.first() ) { + _update_shader(_shader_dirty_list.first()->self() ); + } +} + +void RasterizerStorageGLES3::shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list) const{ + + Shader *shader=shader_owner.get(p_shader); + ERR_FAIL_COND(!shader); + + + if (shader->dirty_list.in_list()) + _update_shader(shader); // ok should be not anymore dirty + + + Map<int,StringName> order; + + + for(Map<StringName,ShaderLanguage::ShaderNode::Uniform>::Element *E=shader->uniforms.front();E;E=E->next()) { + + + order[E->get().order]=E->key(); + } + + + for(Map<int,StringName>::Element *E=order.front();E;E=E->next()) { + + PropertyInfo pi; + ShaderLanguage::ShaderNode::Uniform &u=shader->uniforms[E->get()]; + pi.name=E->get(); + switch(u.type) { + case ShaderLanguage::TYPE_VOID: pi.type=Variant::NIL; break; + case ShaderLanguage::TYPE_BOOL: pi.type=Variant::BOOL; break; + case ShaderLanguage::TYPE_BVEC2: pi.type=Variant::INT; pi.hint=PROPERTY_HINT_FLAGS; pi.hint_string="x,y"; break; + case ShaderLanguage::TYPE_BVEC3: pi.type=Variant::INT; pi.hint=PROPERTY_HINT_FLAGS; pi.hint_string="x,y,z"; break; + case ShaderLanguage::TYPE_BVEC4: pi.type=Variant::INT; pi.hint=PROPERTY_HINT_FLAGS; pi.hint_string="x,y,z,w"; break; + case ShaderLanguage::TYPE_UINT: + case ShaderLanguage::TYPE_INT: { + pi.type=Variant::INT; + if (u.hint==ShaderLanguage::ShaderNode::Uniform::HINT_RANGE) { + pi.hint=PROPERTY_HINT_RANGE; + pi.hint_string=rtos(u.hint_range[0])+","+rtos(u.hint_range[1]); + } + + } break; + case ShaderLanguage::TYPE_IVEC2: + case ShaderLanguage::TYPE_IVEC3: + case ShaderLanguage::TYPE_IVEC4: + case ShaderLanguage::TYPE_UVEC2: + case ShaderLanguage::TYPE_UVEC3: + case ShaderLanguage::TYPE_UVEC4: { + + pi.type=Variant::POOL_INT_ARRAY; + } break; + case ShaderLanguage::TYPE_FLOAT: { + pi.type=Variant::REAL; + if (u.hint==ShaderLanguage::ShaderNode::Uniform::HINT_RANGE) { + pi.hint=PROPERTY_HINT_RANGE; + pi.hint_string=rtos(u.hint_range[0])+","+rtos(u.hint_range[1])+","+rtos(u.hint_range[2]); + } + + } break; + case ShaderLanguage::TYPE_VEC2: pi.type=Variant::VECTOR2; break; + case ShaderLanguage::TYPE_VEC3: pi.type=Variant::VECTOR3; break; + case ShaderLanguage::TYPE_VEC4: { + if (u.hint==ShaderLanguage::ShaderNode::Uniform::HINT_COLOR) { + pi.type=Variant::COLOR; + } else { + pi.type=Variant::PLANE; + } + } break; + case ShaderLanguage::TYPE_MAT2: pi.type=Variant::TRANSFORM2D; break; + case ShaderLanguage::TYPE_MAT3: pi.type=Variant::BASIS; break; + case ShaderLanguage::TYPE_MAT4: pi.type=Variant::TRANSFORM; break; + case ShaderLanguage::TYPE_SAMPLER2D: + case ShaderLanguage::TYPE_ISAMPLER2D: + case ShaderLanguage::TYPE_USAMPLER2D: { + + pi.type=Variant::OBJECT; + pi.hint=PROPERTY_HINT_RESOURCE_TYPE; + pi.hint_string="Texture"; + } break; + case ShaderLanguage::TYPE_SAMPLERCUBE: { + + pi.type=Variant::OBJECT; + pi.hint=PROPERTY_HINT_RESOURCE_TYPE; + pi.hint_string="CubeMap"; + } break; + }; + + p_param_list->push_back(pi); + + } +} + +void RasterizerStorageGLES3::shader_set_default_texture_param(RID p_shader, const StringName& p_name, RID p_texture){ + + Shader *shader=shader_owner.get(p_shader); + ERR_FAIL_COND(!shader); + ERR_FAIL_COND(p_texture.is_valid() && !texture_owner.owns(p_texture)); + + if (p_texture.is_valid()) + shader->default_textures[p_name]=p_texture; + else + shader->default_textures.erase(p_name); + + _shader_make_dirty(shader); +} +RID RasterizerStorageGLES3::shader_get_default_texture_param(RID p_shader, const StringName& p_name) const{ + + const Shader *shader=shader_owner.get(p_shader); + ERR_FAIL_COND_V(!shader,RID()); + + const Map<StringName,RID>::Element *E=shader->default_textures.find(p_name); + if (!E) + return RID(); + return E->get(); +} + + +/* COMMON MATERIAL API */ + +void RasterizerStorageGLES3::_material_make_dirty(Material* p_material) const { + + if (p_material->dirty_list.in_list()) + return; + + _material_dirty_list.add(&p_material->dirty_list); +} + +RID RasterizerStorageGLES3::material_create(){ + + Material *material = memnew( Material ); + + return material_owner.make_rid(material); +} + +void RasterizerStorageGLES3::material_set_shader(RID p_material, RID p_shader){ + + Material *material = material_owner.get( p_material ); + ERR_FAIL_COND(!material); + + Shader *shader=shader_owner.getornull(p_shader); + + if (material->shader) { + //if shader, remove from previous shader material list + material->shader->materials.remove( &material->list ); + } + material->shader=shader; + + if (shader) { + shader->materials.add(&material->list); + } + + _material_make_dirty(material); + +} + +RID RasterizerStorageGLES3::material_get_shader(RID p_material) const{ + + const Material *material = material_owner.get( p_material ); + ERR_FAIL_COND_V(!material,RID()); + + if (material->shader) + return material->shader->self; + + return RID(); +} + +void RasterizerStorageGLES3::material_set_param(RID p_material, const StringName& p_param, const Variant& p_value){ + + Material *material = material_owner.get( p_material ); + ERR_FAIL_COND(!material); + + if (p_value.get_type()==Variant::NIL) + material->params.erase(p_param); + else + material->params[p_param]=p_value; + + _material_make_dirty(material); + +} +Variant RasterizerStorageGLES3::material_get_param(RID p_material, const StringName& p_param) const{ + + const Material *material = material_owner.get( p_material ); + ERR_FAIL_COND_V(!material,RID()); + + if (material->params.has(p_param)) + return material->params[p_param]; + + return Variant(); +} + +void RasterizerStorageGLES3::material_set_line_width(RID p_material, float p_width) { + + Material *material = material_owner.get( p_material ); + ERR_FAIL_COND(!material); + + material->line_width=p_width; + + +} + +bool RasterizerStorageGLES3::material_is_animated(RID p_material) { + + Material *material = material_owner.get( p_material ); + ERR_FAIL_COND_V(!material,false); + if (material->dirty_list.in_list()) { + _update_material(material); + } + + return material->is_animated_cache; + +} +bool RasterizerStorageGLES3::material_casts_shadows(RID p_material) { + + Material *material = material_owner.get( p_material ); + ERR_FAIL_COND_V(!material,false); + if (material->dirty_list.in_list()) { + _update_material(material); + } + + return material->can_cast_shadow_cache; +} + +void RasterizerStorageGLES3::material_add_instance_owner(RID p_material, RasterizerScene::InstanceBase *p_instance) { + + Material *material = material_owner.get( p_material ); + ERR_FAIL_COND(!material); + + Map<RasterizerScene::InstanceBase*,int>::Element *E=material->instance_owners.find(p_instance); + if (E) { + E->get()++; + } else { + material->instance_owners[p_instance]=1; + } +} + +void RasterizerStorageGLES3::material_remove_instance_owner(RID p_material, RasterizerScene::InstanceBase *p_instance) { + + Material *material = material_owner.get( p_material ); + ERR_FAIL_COND(!material); + + Map<RasterizerScene::InstanceBase*,int>::Element *E=material->instance_owners.find(p_instance); + ERR_FAIL_COND(!E); + E->get()--; + + if (E->get()==0) { + material->instance_owners.erase(E); + } +} + + + +_FORCE_INLINE_ static void _fill_std140_variant_ubo_value(ShaderLanguage::DataType type, const Variant& value, uint8_t *data,bool p_linear_color) { + switch(type) { + case ShaderLanguage::TYPE_BOOL: { + + bool v = value; + + GLuint *gui = (GLuint*)data; + *gui = v ? GL_TRUE : GL_FALSE; + } break; + case ShaderLanguage::TYPE_BVEC2: { + + int v = value; + GLuint *gui = (GLuint*)data; + gui[0]=v&1 ? GL_TRUE : GL_FALSE; + gui[1]=v&2 ? GL_TRUE : GL_FALSE; + + } break; + case ShaderLanguage::TYPE_BVEC3: { + + int v = value; + GLuint *gui = (GLuint*)data; + gui[0]=v&1 ? GL_TRUE : GL_FALSE; + gui[1]=v&2 ? GL_TRUE : GL_FALSE; + gui[2]=v&4 ? GL_TRUE : GL_FALSE; + + } break; + case ShaderLanguage::TYPE_BVEC4: { + + int v = value; + GLuint *gui = (GLuint*)data; + gui[0]=v&1 ? GL_TRUE : GL_FALSE; + gui[1]=v&2 ? GL_TRUE : GL_FALSE; + gui[2]=v&4 ? GL_TRUE : GL_FALSE; + gui[3]=v&8 ? GL_TRUE : GL_FALSE; + + } break; + case ShaderLanguage::TYPE_INT: { + + int v = value; + GLint *gui = (GLint*)data; + gui[0]=v; + + } break; + case ShaderLanguage::TYPE_IVEC2: { + + PoolVector<int> iv = value; + int s = iv.size(); + GLint *gui = (GLint*)data; + + PoolVector<int>::Read r = iv.read(); + + for(int i=0;i<2;i++) { + if (i<s) + gui[i]=r[i]; + else + gui[i]=0; + + } + + } break; + case ShaderLanguage::TYPE_IVEC3: { + + PoolVector<int> iv = value; + int s = iv.size(); + GLint *gui = (GLint*)data; + + PoolVector<int>::Read r = iv.read(); + + for(int i=0;i<3;i++) { + if (i<s) + gui[i]=r[i]; + else + gui[i]=0; + + } + } break; + case ShaderLanguage::TYPE_IVEC4: { + + + PoolVector<int> iv = value; + int s = iv.size(); + GLint *gui = (GLint*)data; + + PoolVector<int>::Read r = iv.read(); + + for(int i=0;i<4;i++) { + if (i<s) + gui[i]=r[i]; + else + gui[i]=0; + + } + } break; + case ShaderLanguage::TYPE_UINT: { + + int v = value; + GLuint *gui = (GLuint*)data; + gui[0]=v; + + } break; + case ShaderLanguage::TYPE_UVEC2: { + + PoolVector<int> iv = value; + int s = iv.size(); + GLuint *gui = (GLuint*)data; + + PoolVector<int>::Read r = iv.read(); + + for(int i=0;i<2;i++) { + if (i<s) + gui[i]=r[i]; + else + gui[i]=0; + + } + } break; + case ShaderLanguage::TYPE_UVEC3: { + PoolVector<int> iv = value; + int s = iv.size(); + GLuint *gui = (GLuint*)data; + + PoolVector<int>::Read r = iv.read(); + + for(int i=0;i<3;i++) { + if (i<s) + gui[i]=r[i]; + else + gui[i]=0; + } + + } break; + case ShaderLanguage::TYPE_UVEC4: { + PoolVector<int> iv = value; + int s = iv.size(); + GLuint *gui = (GLuint*)data; + + PoolVector<int>::Read r = iv.read(); + + for(int i=0;i<4;i++) { + if (i<s) + gui[i]=r[i]; + else + gui[i]=0; + } + } break; + case ShaderLanguage::TYPE_FLOAT: { + float v = value; + GLfloat *gui = (GLfloat*)data; + gui[0]=v; + + } break; + case ShaderLanguage::TYPE_VEC2: { + Vector2 v = value; + GLfloat *gui = (GLfloat*)data; + gui[0]=v.x; + gui[1]=v.y; + + } break; + case ShaderLanguage::TYPE_VEC3: { + Vector3 v = value; + GLfloat *gui = (GLfloat*)data; + gui[0]=v.x; + gui[1]=v.y; + gui[2]=v.z; + + } break; + case ShaderLanguage::TYPE_VEC4: { + + GLfloat *gui = (GLfloat*)data; + + if (value.get_type()==Variant::COLOR) { + Color v=value; + + if (p_linear_color) { + v=v.to_linear(); + } + + gui[0]=v.r; + gui[1]=v.g; + gui[2]=v.b; + gui[3]=v.a; + } else if (value.get_type()==Variant::RECT2) { + Rect2 v=value; + + gui[0]=v.pos.x; + gui[1]=v.pos.y; + gui[2]=v.size.x; + gui[3]=v.size.y; + } else if (value.get_type()==Variant::QUAT) { + Quat v=value; + + gui[0]=v.x; + gui[1]=v.y; + gui[2]=v.z; + gui[3]=v.w; + } else { + Plane v=value; + + gui[0]=v.normal.x; + gui[1]=v.normal.y; + gui[2]=v.normal.x; + gui[3]=v.d; + + } + } break; + case ShaderLanguage::TYPE_MAT2: { + Transform2D v = value; + GLfloat *gui = (GLfloat*)data; + + gui[ 0]=v.elements[0][0]; + gui[ 1]=v.elements[0][1]; + gui[ 2]=v.elements[1][0]; + gui[ 3]=v.elements[1][1]; + } break; + case ShaderLanguage::TYPE_MAT3: { + + + Basis v = value; + GLfloat *gui = (GLfloat*)data; + + gui[ 0]=v.elements[0][0]; + gui[ 1]=v.elements[1][0]; + gui[ 2]=v.elements[2][0]; + gui[ 3]=0; + gui[ 4]=v.elements[0][1]; + gui[ 5]=v.elements[1][1]; + gui[ 6]=v.elements[2][1]; + gui[ 7]=0; + gui[ 8]=v.elements[0][2]; + gui[ 9]=v.elements[1][2]; + gui[10]=v.elements[2][2]; + gui[11]=0; + } break; + case ShaderLanguage::TYPE_MAT4: { + + Transform v = value; + GLfloat *gui = (GLfloat*)data; + + gui[ 0]=v.basis.elements[0][0]; + gui[ 1]=v.basis.elements[1][0]; + gui[ 2]=v.basis.elements[2][0]; + gui[ 3]=0; + gui[ 4]=v.basis.elements[0][1]; + gui[ 5]=v.basis.elements[1][1]; + gui[ 6]=v.basis.elements[2][1]; + gui[ 7]=0; + gui[ 8]=v.basis.elements[0][2]; + gui[ 9]=v.basis.elements[1][2]; + gui[10]=v.basis.elements[2][2]; + gui[11]=0; + gui[12]=v.origin.x; + gui[13]=v.origin.y; + gui[14]=v.origin.z; + gui[15]=1; + } break; + default: {} + } + +} + +_FORCE_INLINE_ static void _fill_std140_ubo_value(ShaderLanguage::DataType type, const Vector<ShaderLanguage::ConstantNode::Value>& value, uint8_t *data) { + + switch(type) { + case ShaderLanguage::TYPE_BOOL: { + + GLuint *gui = (GLuint*)data; + *gui = value[0].boolean ? GL_TRUE : GL_FALSE; + } break; + case ShaderLanguage::TYPE_BVEC2: { + + GLuint *gui = (GLuint*)data; + gui[0]=value[0].boolean ? GL_TRUE : GL_FALSE; + gui[1]=value[1].boolean ? GL_TRUE : GL_FALSE; + + } break; + case ShaderLanguage::TYPE_BVEC3: { + + GLuint *gui = (GLuint*)data; + gui[0]=value[0].boolean ? GL_TRUE : GL_FALSE; + gui[1]=value[1].boolean ? GL_TRUE : GL_FALSE; + gui[2]=value[2].boolean ? GL_TRUE : GL_FALSE; + + } break; + case ShaderLanguage::TYPE_BVEC4: { + + GLuint *gui = (GLuint*)data; + gui[0]=value[0].boolean ? GL_TRUE : GL_FALSE; + gui[1]=value[1].boolean ? GL_TRUE : GL_FALSE; + gui[2]=value[2].boolean ? GL_TRUE : GL_FALSE; + gui[3]=value[3].boolean ? GL_TRUE : GL_FALSE; + + } break; + case ShaderLanguage::TYPE_INT: { + + GLint *gui = (GLint*)data; + gui[0]=value[0].sint; + + } break; + case ShaderLanguage::TYPE_IVEC2: { + + GLint *gui = (GLint*)data; + + for(int i=0;i<2;i++) { + gui[i]=value[i].sint; + + } + + } break; + case ShaderLanguage::TYPE_IVEC3: { + + GLint *gui = (GLint*)data; + + for(int i=0;i<3;i++) { + gui[i]=value[i].sint; + + } + + } break; + case ShaderLanguage::TYPE_IVEC4: { + + GLint *gui = (GLint*)data; + + for(int i=0;i<4;i++) { + gui[i]=value[i].sint; + + } + + } break; + case ShaderLanguage::TYPE_UINT: { + + + GLuint *gui = (GLuint*)data; + gui[0]=value[0].uint; + + } break; + case ShaderLanguage::TYPE_UVEC2: { + + GLint *gui = (GLint*)data; + + for(int i=0;i<2;i++) { + gui[i]=value[i].uint; + } + } break; + case ShaderLanguage::TYPE_UVEC3: { + GLint *gui = (GLint*)data; + + for(int i=0;i<3;i++) { + gui[i]=value[i].uint; + } + + } break; + case ShaderLanguage::TYPE_UVEC4: { + GLint *gui = (GLint*)data; + + for(int i=0;i<4;i++) { + gui[i]=value[i].uint; + } + } break; + case ShaderLanguage::TYPE_FLOAT: { + + GLfloat *gui = (GLfloat*)data; + gui[0]=value[0].real; + + } break; + case ShaderLanguage::TYPE_VEC2: { + + GLfloat *gui = (GLfloat*)data; + + for(int i=0;i<2;i++) { + gui[i]=value[i].real; + } + + } break; + case ShaderLanguage::TYPE_VEC3: { + + GLfloat *gui = (GLfloat*)data; + + for(int i=0;i<3;i++) { + gui[i]=value[i].real; + } + + } break; + case ShaderLanguage::TYPE_VEC4: { + + GLfloat *gui = (GLfloat*)data; + + for(int i=0;i<4;i++) { + gui[i]=value[i].real; + } + } break; + case ShaderLanguage::TYPE_MAT2: { + GLfloat *gui = (GLfloat*)data; + + for(int i=0;i<2;i++) { + gui[i]=value[i].real; + } + } break; + case ShaderLanguage::TYPE_MAT3: { + + + + GLfloat *gui = (GLfloat*)data; + + gui[ 0]=value[0].real; + gui[ 1]=value[1].real; + gui[ 2]=value[2].real; + gui[ 3]=0; + gui[ 4]=value[3].real; + gui[ 5]=value[4].real; + gui[ 6]=value[5].real; + gui[ 7]=0; + gui[ 8]=value[6].real; + gui[ 9]=value[7].real; + gui[10]=value[8].real; + gui[11]=0; + } break; + case ShaderLanguage::TYPE_MAT4: { + + GLfloat *gui = (GLfloat*)data; + + for(int i=0;i<16;i++) { + gui[i]=value[i].real; + } + } break; + default: {} + } + +} + + +_FORCE_INLINE_ static void _fill_std140_ubo_empty(ShaderLanguage::DataType type, uint8_t *data) { + + switch(type) { + + case ShaderLanguage::TYPE_BOOL: + case ShaderLanguage::TYPE_INT: + case ShaderLanguage::TYPE_UINT: + case ShaderLanguage::TYPE_FLOAT: { + zeromem(data,4); + } break; + case ShaderLanguage::TYPE_BVEC2: + case ShaderLanguage::TYPE_IVEC2: + case ShaderLanguage::TYPE_UVEC2: + case ShaderLanguage::TYPE_VEC2: { + zeromem(data,8); + } break; + case ShaderLanguage::TYPE_BVEC3: + case ShaderLanguage::TYPE_IVEC3: + case ShaderLanguage::TYPE_UVEC3: + case ShaderLanguage::TYPE_VEC3: + case ShaderLanguage::TYPE_BVEC4: + case ShaderLanguage::TYPE_IVEC4: + case ShaderLanguage::TYPE_UVEC4: + case ShaderLanguage::TYPE_VEC4: + case ShaderLanguage::TYPE_MAT2:{ + + zeromem(data,16); + } break; + case ShaderLanguage::TYPE_MAT3:{ + + zeromem(data,48); + } break; + case ShaderLanguage::TYPE_MAT4:{ + zeromem(data,64); + } break; + + default: {} + } + +} + +void RasterizerStorageGLES3::_update_material(Material* material) { + + if (material->dirty_list.in_list()) + _material_dirty_list.remove( &material->dirty_list ); + + + if (material->shader && material->shader->dirty_list.in_list()) { + _update_shader(material->shader); + } + //update caches + + { + bool can_cast_shadow = false; + bool is_animated = false; + + if (material->shader && material->shader->mode==VS::SHADER_SPATIAL) { + if (!material->shader->spatial.uses_alpha && material->shader->spatial.blend_mode==Shader::Spatial::BLEND_MODE_MIX) { + can_cast_shadow=true; + } + + if (material->shader->spatial.uses_discard && material->shader->uses_fragment_time) { + is_animated=true; + } + + if (material->shader->spatial.uses_vertex && material->shader->uses_vertex_time) { + is_animated=true; + } + + } + + if (can_cast_shadow!=material->can_cast_shadow_cache || is_animated!=material->is_animated_cache) { + material->can_cast_shadow_cache=can_cast_shadow; + material->is_animated_cache=is_animated; + + for(Map<Geometry*,int>::Element *E=material->geometry_owners.front();E;E=E->next()) { + E->key()->material_changed_notify(); + } + + for(Map<RasterizerScene::InstanceBase*,int>::Element *E=material->instance_owners.front();E;E=E->next()) { + E->key()->base_material_changed(); + } + + } + + } + + + //clear ubo if it needs to be cleared + if (material->ubo_size) { + + if (!material->shader || material->shader->ubo_size!=material->ubo_size) { + //by by ubo + glDeleteBuffers(1,&material->ubo_id); + material->ubo_id=0; + material->ubo_size=0; + } + } + + //create ubo if it needs to be created + if (material->ubo_size==0 && material->shader && material->shader->ubo_size) { + + glGenBuffers(1, &material->ubo_id); + glBindBuffer(GL_UNIFORM_BUFFER, material->ubo_id); + glBufferData(GL_UNIFORM_BUFFER, material->shader->ubo_size, NULL, GL_DYNAMIC_DRAW); + glBindBuffer(GL_UNIFORM_BUFFER, 0); + material->ubo_size=material->shader->ubo_size; + } + + //fill up the UBO if it needs to be filled + if (material->shader && material->ubo_size) { + uint8_t* local_ubo = (uint8_t*)alloca(material->ubo_size); + + for(Map<StringName,ShaderLanguage::ShaderNode::Uniform>::Element *E=material->shader->uniforms.front();E;E=E->next()) { + + if (E->get().order<0) + continue; // texture, does not go here + + //regular uniform + uint8_t *data = &local_ubo[ material->shader->ubo_offsets[E->get().order] ]; + + Map<StringName,Variant>::Element *V = material->params.find(E->key()); + + if (V) { + //user provided + _fill_std140_variant_ubo_value(E->get().type,V->get(),data,material->shader->mode==VS::SHADER_SPATIAL); + + } else if (E->get().default_value.size()){ + //default value + _fill_std140_ubo_value(E->get().type,E->get().default_value,data); + //value=E->get().default_value; + } else { + //zero because it was not provided + _fill_std140_ubo_empty(E->get().type,data); + } + + + } + + glBindBuffer(GL_UNIFORM_BUFFER,material->ubo_id); + glBufferSubData(GL_UNIFORM_BUFFER, 0, material->ubo_size, local_ubo); + glBindBuffer(GL_UNIFORM_BUFFER, 0); + } + + //set up the texture array, for easy access when it needs to be drawn + if (material->shader && material->shader->texture_count) { + + material->textures.resize(material->shader->texture_count); + + for(Map<StringName,ShaderLanguage::ShaderNode::Uniform>::Element *E=material->shader->uniforms.front();E;E=E->next()) { + + if (E->get().texture_order<0) + continue; // not a texture, does not go here + + RID texture; + + Map<StringName,Variant>::Element *V = material->params.find(E->key()); + if (V) { + texture=V->get(); + } + + if (!texture.is_valid()) { + Map<StringName,RID>::Element *W = material->shader->default_textures.find(E->key()); + if (W) { + texture=W->get(); + } + } + + material->textures[ E->get().texture_order ]=texture; + + + } + + + } else { + material->textures.clear(); + } + +} + +void RasterizerStorageGLES3::_material_add_geometry(RID p_material,Geometry *p_geometry) { + + Material * material = material_owner.getornull(p_material); + ERR_FAIL_COND(!material); + + Map<Geometry*,int>::Element *I = material->geometry_owners.find(p_geometry); + + if (I) { + I->get()++; + } else { + material->geometry_owners[p_geometry]=1; + } + +} + +void RasterizerStorageGLES3::_material_remove_geometry(RID p_material,Geometry *p_geometry) { + + Material * material = material_owner.getornull(p_material); + ERR_FAIL_COND(!material); + + Map<Geometry*,int>::Element *I = material->geometry_owners.find(p_geometry); + ERR_FAIL_COND(!I); + + I->get()--; + if (I->get()==0) { + material->geometry_owners.erase(I); + } +} + + +void RasterizerStorageGLES3::update_dirty_materials() { + + while( _material_dirty_list.first() ) { + + Material *material = _material_dirty_list.first()->self(); + + _update_material(material); + } +} + +/* MESH API */ + +RID RasterizerStorageGLES3::mesh_create(){ + + Mesh * mesh = memnew( Mesh ); + + return mesh_owner.make_rid(mesh); +} + + +void RasterizerStorageGLES3::mesh_add_surface(RID p_mesh,uint32_t p_format,VS::PrimitiveType p_primitive,const PoolVector<uint8_t>& p_array,int p_vertex_count,const PoolVector<uint8_t>& p_index_array,int p_index_count,const Rect3& p_aabb,const Vector<PoolVector<uint8_t> >& p_blend_shapes,const Vector<Rect3>& p_bone_aabbs){ + + PoolVector<uint8_t> array = p_array; + + Mesh *mesh = mesh_owner.getornull(p_mesh); + ERR_FAIL_COND(!mesh); + + ERR_FAIL_COND(!(p_format&VS::ARRAY_FORMAT_VERTEX)); + + //must have index and bones, both. + { + uint32_t bones_weight = VS::ARRAY_FORMAT_BONES|VS::ARRAY_FORMAT_WEIGHTS; + ERR_EXPLAIN("Array must have both bones and weights in format or none."); + ERR_FAIL_COND( (p_format&bones_weight) && (p_format&bones_weight)!=bones_weight ); + } + + + bool has_morph = p_blend_shapes.size(); + + Surface::Attrib attribs[VS::ARRAY_MAX]; + + int stride=0; + + for(int i=0;i<VS::ARRAY_MAX;i++) { + + attribs[i].index=i; + + if (! (p_format&(1<<i) ) ) { + attribs[i].enabled=false; + attribs[i].integer=false; + continue; + } + + attribs[i].enabled=true; + attribs[i].offset=stride; + attribs[i].integer=false; + + switch(i) { + + case VS::ARRAY_VERTEX: { + + if (p_format&VS::ARRAY_FLAG_USE_2D_VERTICES) { + attribs[i].size=2; + } else { + attribs[i].size=(p_format&VS::ARRAY_COMPRESS_VERTEX)?4:3; + } + + if (p_format&VS::ARRAY_COMPRESS_VERTEX) { + attribs[i].type=GL_HALF_FLOAT; + stride+=attribs[i].size*2; + } else { + attribs[i].type=GL_FLOAT; + stride+=attribs[i].size*4; + } + + attribs[i].normalized=GL_FALSE; + + } break; + case VS::ARRAY_NORMAL: { + + attribs[i].size=3; + + if (p_format&VS::ARRAY_COMPRESS_NORMAL) { + attribs[i].type=GL_BYTE; + stride+=4; //pad extra byte + attribs[i].normalized=GL_TRUE; + } else { + attribs[i].type=GL_FLOAT; + stride+=12; + attribs[i].normalized=GL_FALSE; + } + + + + } break; + case VS::ARRAY_TANGENT: { + + attribs[i].size=4; + + if (p_format&VS::ARRAY_COMPRESS_TANGENT) { + attribs[i].type=GL_BYTE; + stride+=4; + attribs[i].normalized=GL_TRUE; + } else { + attribs[i].type=GL_FLOAT; + stride+=16; + attribs[i].normalized=GL_FALSE; + } + + + } break; + case VS::ARRAY_COLOR: { + + attribs[i].size=4; + + if (p_format&VS::ARRAY_COMPRESS_COLOR) { + attribs[i].type=GL_UNSIGNED_BYTE; + stride+=4; + attribs[i].normalized=GL_TRUE; + } else { + attribs[i].type=GL_FLOAT; + stride+=16; + attribs[i].normalized=GL_FALSE; + } + + + } break; + case VS::ARRAY_TEX_UV: { + + attribs[i].size=2; + + if (p_format&VS::ARRAY_COMPRESS_TEX_UV) { + attribs[i].type=GL_HALF_FLOAT; + stride+=4; + } else { + attribs[i].type=GL_FLOAT; + stride+=8; + } + + attribs[i].normalized=GL_FALSE; + + + } break; + case VS::ARRAY_TEX_UV2: { + + attribs[i].size=2; + + if (p_format&VS::ARRAY_COMPRESS_TEX_UV2) { + attribs[i].type=GL_HALF_FLOAT; + stride+=4; + } else { + attribs[i].type=GL_FLOAT; + stride+=8; + } + attribs[i].normalized=GL_FALSE; + + + + } break; + case VS::ARRAY_BONES: { + + attribs[i].size=4; + + if (p_format&VS::ARRAY_FLAG_USE_16_BIT_BONES) { + attribs[i].type=GL_UNSIGNED_SHORT; + stride+=8; + } else { + attribs[i].type=GL_UNSIGNED_BYTE; + stride+=4; + } + + attribs[i].normalized=GL_FALSE; + attribs[i].integer=true; + + + + } break; + case VS::ARRAY_WEIGHTS: { + + attribs[i].size=4; + + if (p_format&VS::ARRAY_COMPRESS_WEIGHTS) { + + attribs[i].type=GL_UNSIGNED_SHORT; + stride+=8; + attribs[i].normalized=GL_TRUE; + } else { + attribs[i].type=GL_FLOAT; + stride+=16; + attribs[i].normalized=GL_FALSE; + } + + } break; + case VS::ARRAY_INDEX: { + + attribs[i].size=1; + + if (p_vertex_count>=(1<<16)) { + attribs[i].type=GL_UNSIGNED_INT; + attribs[i].stride=4; + } else { + attribs[i].type=GL_UNSIGNED_SHORT; + attribs[i].stride=2; + } + + attribs[i].normalized=GL_FALSE; + + } break; + + } + } + + for(int i=0;i<VS::ARRAY_MAX-1;i++) { + attribs[i].stride=stride; + } + + //validate sizes + + int array_size = stride * p_vertex_count; + int index_array_size=0; + + print_line("desired size: "+itos(array_size)+" vcount "+itos(p_vertex_count)+" should be: "+itos(array.size()+p_vertex_count*2)+" but is "+itos(array.size())); + if (array.size()!=array_size && array.size()+p_vertex_count*2 == array_size) { + //old format, convert + array = PoolVector<uint8_t>(); + + array.resize( p_array.size()+p_vertex_count*2 ); + + PoolVector<uint8_t>::Write w = array.write(); + PoolVector<uint8_t>::Read r = p_array.read(); + + uint16_t *w16 = (uint16_t*)w.ptr(); + const uint16_t *r16 = (uint16_t*)r.ptr(); + + uint16_t one = Math::make_half_float(1); + + for(int i=0;i<p_vertex_count;i++) { + + *w16++ = *r16++; + *w16++ = *r16++; + *w16++ = *r16++; + *w16++ = one; + for(int j=0;j<(stride/2)-4;j++) { + *w16++ = *r16++; + } + } + + } + + ERR_FAIL_COND(array.size()!=array_size); + + if (p_format&VS::ARRAY_FORMAT_INDEX) { + + index_array_size=attribs[VS::ARRAY_INDEX].stride*p_index_count; + } + + + ERR_FAIL_COND(p_index_array.size()!=index_array_size); + + ERR_FAIL_COND(p_blend_shapes.size()!=mesh->morph_target_count); + + for(int i=0;i<p_blend_shapes.size();i++) { + ERR_FAIL_COND(p_blend_shapes[i].size()!=array_size); + } + + //ok all valid, create stuff + + Surface * surface = memnew( Surface ); + + surface->active=true; + surface->array_len=p_vertex_count; + surface->index_array_len=p_index_count; + surface->array_byte_size=array.size(); + surface->index_array_byte_size=p_index_array.size(); + surface->primitive=p_primitive; + surface->mesh=mesh; + surface->format=p_format; + surface->skeleton_bone_aabb=p_bone_aabbs; + surface->skeleton_bone_used.resize(surface->skeleton_bone_aabb.size()); + surface->aabb=p_aabb; + surface->max_bone=p_bone_aabbs.size(); + + for(int i=0;i<surface->skeleton_bone_used.size();i++) { + if (surface->skeleton_bone_aabb[i].size.x<0 || surface->skeleton_bone_aabb[i].size.y<0 || surface->skeleton_bone_aabb[i].size.z<0) { + surface->skeleton_bone_used[i]=false; + } else { + surface->skeleton_bone_used[i]=true; + } + } + + for(int i=0;i<VS::ARRAY_MAX;i++) { + surface->attribs[i]=attribs[i]; + } + + { + + PoolVector<uint8_t>::Read vr = array.read(); + + glGenBuffers(1,&surface->vertex_id); + glBindBuffer(GL_ARRAY_BUFFER,surface->vertex_id); + glBufferData(GL_ARRAY_BUFFER,array_size,vr.ptr(),GL_STATIC_DRAW); + glBindBuffer(GL_ARRAY_BUFFER,0); //unbind + + + if (p_format&VS::ARRAY_FORMAT_INDEX) { + + PoolVector<uint8_t>::Read ir = p_index_array.read(); + + glGenBuffers(1,&surface->index_id); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,surface->index_id); + glBufferData(GL_ELEMENT_ARRAY_BUFFER,index_array_size,ir.ptr(),GL_STATIC_DRAW); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,0); //unbind + + + } + + //generate arrays for faster state switching + + for(int ai=0;ai<2;ai++) { + + if (ai==0) { + //for normal draw + glGenVertexArrays(1,&surface->array_id); + glBindVertexArray(surface->array_id); + glBindBuffer(GL_ARRAY_BUFFER,surface->vertex_id); + } else if (ai==1) { + //for instancing draw (can be changed and no one cares) + glGenVertexArrays(1,&surface->instancing_array_id); + glBindVertexArray(surface->instancing_array_id); + glBindBuffer(GL_ARRAY_BUFFER,surface->vertex_id); + } + + + for(int i=0;i<VS::ARRAY_MAX-1;i++) { + + if (!attribs[i].enabled) + continue; + + if (attribs[i].integer) { + glVertexAttribIPointer(attribs[i].index,attribs[i].size,attribs[i].type,attribs[i].stride,((uint8_t*)0)+attribs[i].offset); + } else { + glVertexAttribPointer(attribs[i].index,attribs[i].size,attribs[i].type,attribs[i].normalized,attribs[i].stride,((uint8_t*)0)+attribs[i].offset); + } + glEnableVertexAttribArray(attribs[i].index); + + } + + if (surface->index_id) { + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,surface->index_id); + } + + glBindVertexArray(0); + glBindBuffer(GL_ARRAY_BUFFER,0); //unbind + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,0); + } + + } + + { + + //blend shapes + + for(int i=0;i<p_blend_shapes.size();i++) { + + Surface::MorphTarget mt; + + PoolVector<uint8_t>::Read vr = p_blend_shapes[i].read(); + + glGenBuffers(1,&mt.vertex_id); + glBindBuffer(GL_ARRAY_BUFFER,mt.vertex_id); + glBufferData(GL_ARRAY_BUFFER,array_size,vr.ptr(),GL_STATIC_DRAW); + glBindBuffer(GL_ARRAY_BUFFER,0); //unbind + + glGenVertexArrays(1,&mt.array_id); + glBindVertexArray(mt.array_id); + glBindBuffer(GL_ARRAY_BUFFER,mt.vertex_id); + + for(int j=0;j<VS::ARRAY_MAX-1;j++) { + + if (!attribs[j].enabled) + continue; + + if (attribs[j].integer) { + glVertexAttribIPointer(attribs[j].index,attribs[j].size,attribs[j].type,attribs[j].stride,((uint8_t*)0)+attribs[j].offset); + } else { + glVertexAttribPointer(attribs[j].index,attribs[j].size,attribs[j].type,attribs[j].normalized,attribs[j].stride,((uint8_t*)0)+attribs[j].offset); + } + glEnableVertexAttribArray(attribs[j].index); + + } + + glBindVertexArray(0); + glBindBuffer(GL_ARRAY_BUFFER,0); //unbind + + surface->morph_targets.push_back(mt); + + } + } + + mesh->surfaces.push_back(surface); + mesh->instance_change_notify(); +} + +void RasterizerStorageGLES3::mesh_set_morph_target_count(RID p_mesh,int p_amount){ + + Mesh *mesh = mesh_owner.getornull(p_mesh); + ERR_FAIL_COND(!mesh); + + + ERR_FAIL_COND(mesh->surfaces.size()!=0); + ERR_FAIL_COND(p_amount<0); + + mesh->morph_target_count=p_amount; + +} +int RasterizerStorageGLES3::mesh_get_morph_target_count(RID p_mesh) const{ + + const Mesh *mesh = mesh_owner.getornull(p_mesh); + ERR_FAIL_COND_V(!mesh,0); + + return mesh->morph_target_count; +} + + +void RasterizerStorageGLES3::mesh_set_morph_target_mode(RID p_mesh,VS::MorphTargetMode p_mode){ + + Mesh *mesh = mesh_owner.getornull(p_mesh); + ERR_FAIL_COND(!mesh); + + mesh->morph_target_mode=p_mode; + +} +VS::MorphTargetMode RasterizerStorageGLES3::mesh_get_morph_target_mode(RID p_mesh) const{ + + const Mesh *mesh = mesh_owner.getornull(p_mesh); + ERR_FAIL_COND_V(!mesh,VS::MORPH_MODE_NORMALIZED); + + return mesh->morph_target_mode; +} + +void RasterizerStorageGLES3::mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material){ + + Mesh *mesh = mesh_owner.getornull(p_mesh); + ERR_FAIL_COND(!mesh); + ERR_FAIL_INDEX(p_surface,mesh->surfaces.size()); + + if (mesh->surfaces[p_surface]->material==p_material) + return; + + if (mesh->surfaces[p_surface]->material.is_valid()) { + _material_remove_geometry(mesh->surfaces[p_surface]->material,mesh->surfaces[p_surface]); + } + + mesh->surfaces[p_surface]->material=p_material; + + if (mesh->surfaces[p_surface]->material.is_valid()) { + _material_add_geometry(mesh->surfaces[p_surface]->material,mesh->surfaces[p_surface]); + } + + mesh->instance_material_change_notify(); + + +} +RID RasterizerStorageGLES3::mesh_surface_get_material(RID p_mesh, int p_surface) const{ + + const Mesh *mesh = mesh_owner.getornull(p_mesh); + ERR_FAIL_COND_V(!mesh,RID()); + ERR_FAIL_INDEX_V(p_surface,mesh->surfaces.size(),RID()); + + return mesh->surfaces[p_surface]->material; +} + +int RasterizerStorageGLES3::mesh_surface_get_array_len(RID p_mesh, int p_surface) const{ + + const Mesh *mesh = mesh_owner.getornull(p_mesh); + ERR_FAIL_COND_V(!mesh,0); + ERR_FAIL_INDEX_V(p_surface,mesh->surfaces.size(),0); + + return mesh->surfaces[p_surface]->array_len; + +} +int RasterizerStorageGLES3::mesh_surface_get_array_index_len(RID p_mesh, int p_surface) const{ + + const Mesh *mesh = mesh_owner.getornull(p_mesh); + ERR_FAIL_COND_V(!mesh,0); + ERR_FAIL_INDEX_V(p_surface,mesh->surfaces.size(),0); + + return mesh->surfaces[p_surface]->index_array_len; +} + +PoolVector<uint8_t> RasterizerStorageGLES3::mesh_surface_get_array(RID p_mesh, int p_surface) const{ + + const Mesh *mesh = mesh_owner.getornull(p_mesh); + ERR_FAIL_COND_V(!mesh,PoolVector<uint8_t>()); + ERR_FAIL_INDEX_V(p_surface,mesh->surfaces.size(),PoolVector<uint8_t>()); + + Surface *surface = mesh->surfaces[p_surface]; + + glBindBuffer(GL_ARRAY_BUFFER,surface->vertex_id); + void * data = glMapBufferRange(GL_ARRAY_BUFFER,0,surface->array_byte_size,GL_MAP_READ_BIT); + + ERR_FAIL_COND_V(!data,PoolVector<uint8_t>()); + + PoolVector<uint8_t> ret; + ret.resize(surface->array_byte_size); + + { + + PoolVector<uint8_t>::Write w = ret.write(); + copymem(w.ptr(),data,surface->array_byte_size); + } + glUnmapBuffer(GL_ARRAY_BUFFER); + + + return ret; +} + +PoolVector<uint8_t> RasterizerStorageGLES3::mesh_surface_get_index_array(RID p_mesh, int p_surface) const { + const Mesh *mesh = mesh_owner.getornull(p_mesh); + ERR_FAIL_COND_V(!mesh,PoolVector<uint8_t>()); + ERR_FAIL_INDEX_V(p_surface,mesh->surfaces.size(),PoolVector<uint8_t>()); + + Surface *surface = mesh->surfaces[p_surface]; + + ERR_FAIL_COND_V(surface->index_array_len==0,PoolVector<uint8_t>()); + + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,surface->index_id); + void * data = glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER,0,surface->index_array_byte_size,GL_MAP_READ_BIT); + + ERR_FAIL_COND_V(!data,PoolVector<uint8_t>()); + + PoolVector<uint8_t> ret; + ret.resize(surface->index_array_byte_size); + + { + + PoolVector<uint8_t>::Write w = ret.write(); + copymem(w.ptr(),data,surface->index_array_byte_size); + } + + glUnmapBuffer(GL_ELEMENT_ARRAY_BUFFER); + + return ret; +} + + +uint32_t RasterizerStorageGLES3::mesh_surface_get_format(RID p_mesh, int p_surface) const{ + + const Mesh *mesh = mesh_owner.getornull(p_mesh); + + ERR_FAIL_COND_V(!mesh,0); + ERR_FAIL_INDEX_V(p_surface,mesh->surfaces.size(),0); + + return mesh->surfaces[p_surface]->format; + +} + +VS::PrimitiveType RasterizerStorageGLES3::mesh_surface_get_primitive_type(RID p_mesh, int p_surface) const{ + + const Mesh *mesh = mesh_owner.getornull(p_mesh); + ERR_FAIL_COND_V(!mesh,VS::PRIMITIVE_MAX); + ERR_FAIL_INDEX_V(p_surface,mesh->surfaces.size(),VS::PRIMITIVE_MAX); + + return mesh->surfaces[p_surface]->primitive; +} + +Rect3 RasterizerStorageGLES3::mesh_surface_get_aabb(RID p_mesh, int p_surface) const { + + const Mesh *mesh = mesh_owner.getornull(p_mesh); + ERR_FAIL_COND_V(!mesh,Rect3()); + ERR_FAIL_INDEX_V(p_surface,mesh->surfaces.size(),Rect3()); + + return mesh->surfaces[p_surface]->aabb; + + +} +Vector<PoolVector<uint8_t> > RasterizerStorageGLES3::mesh_surface_get_blend_shapes(RID p_mesh, int p_surface) const{ + + const Mesh *mesh = mesh_owner.getornull(p_mesh); + ERR_FAIL_COND_V(!mesh,Vector<PoolVector<uint8_t> >()); + ERR_FAIL_INDEX_V(p_surface,mesh->surfaces.size(),Vector<PoolVector<uint8_t> >()); + + Vector<PoolVector<uint8_t> > bsarr; + + for(int i=0;i<mesh->surfaces[p_surface]->morph_targets.size();i++) { + + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,mesh->surfaces[p_surface]->morph_targets[i].vertex_id); + void * data = glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER,0,mesh->surfaces[p_surface]->array_byte_size,GL_MAP_READ_BIT); + + ERR_FAIL_COND_V(!data,Vector<PoolVector<uint8_t> >()); + + PoolVector<uint8_t> ret; + ret.resize(mesh->surfaces[p_surface]->array_byte_size); + + { + + PoolVector<uint8_t>::Write w = ret.write(); + copymem(w.ptr(),data,mesh->surfaces[p_surface]->array_byte_size); + } + + bsarr.push_back(ret); + + glUnmapBuffer(GL_ELEMENT_ARRAY_BUFFER); + } + + return bsarr; + +} +Vector<Rect3> RasterizerStorageGLES3::mesh_surface_get_skeleton_aabb(RID p_mesh, int p_surface) const{ + + const Mesh *mesh = mesh_owner.getornull(p_mesh); + ERR_FAIL_COND_V(!mesh,Vector<Rect3 >()); + ERR_FAIL_INDEX_V(p_surface,mesh->surfaces.size(),Vector<Rect3 >()); + + return mesh->surfaces[p_surface]->skeleton_bone_aabb; + +} + + +void RasterizerStorageGLES3::mesh_remove_surface(RID p_mesh, int p_surface){ + + Mesh *mesh = mesh_owner.getornull(p_mesh); + ERR_FAIL_COND(!mesh); + ERR_FAIL_INDEX(p_surface,mesh->surfaces.size()); + + Surface *surface = mesh->surfaces[p_surface]; + + if (surface->material.is_valid()) { + _material_remove_geometry(surface->material,mesh->surfaces[p_surface]); + } + + glDeleteBuffers(1,&surface->vertex_id); + if (surface->index_id) { + glDeleteBuffers(1,&surface->index_id); + } + + glDeleteVertexArrays(1,&surface->array_id); + + for(int i=0;i<surface->morph_targets.size();i++) { + + glDeleteBuffers(1,&surface->morph_targets[i].vertex_id); + glDeleteVertexArrays(1,&surface->morph_targets[i].array_id); + } + + mesh->instance_material_change_notify(); + + memdelete(surface); + + mesh->surfaces.remove(p_surface); + + mesh->instance_change_notify(); +} +int RasterizerStorageGLES3::mesh_get_surface_count(RID p_mesh) const{ + + const Mesh *mesh = mesh_owner.getornull(p_mesh); + ERR_FAIL_COND_V(!mesh,0); + return mesh->surfaces.size(); + +} + +void RasterizerStorageGLES3::mesh_set_custom_aabb(RID p_mesh,const Rect3& p_aabb){ + + Mesh *mesh = mesh_owner.getornull(p_mesh); + ERR_FAIL_COND(!mesh); + + mesh->custom_aabb=p_aabb; +} +Rect3 RasterizerStorageGLES3::mesh_get_custom_aabb(RID p_mesh) const{ + + const Mesh *mesh = mesh_owner.getornull(p_mesh); + ERR_FAIL_COND_V(!mesh,Rect3()); + + return mesh->custom_aabb; + +} + +Rect3 RasterizerStorageGLES3::mesh_get_aabb(RID p_mesh,RID p_skeleton) const{ + + Mesh *mesh = mesh_owner.get( p_mesh ); + ERR_FAIL_COND_V(!mesh,Rect3()); + + if (mesh->custom_aabb!=Rect3()) + return mesh->custom_aabb; + + Skeleton *sk=NULL; + if (p_skeleton.is_valid()) + sk=skeleton_owner.get(p_skeleton); + + Rect3 aabb; + + if (sk && sk->size!=0) { + + + for (int i=0;i<mesh->surfaces.size();i++) { + + Rect3 laabb; + if (mesh->surfaces[i]->format&VS::ARRAY_FORMAT_BONES && mesh->surfaces[i]->skeleton_bone_aabb.size()) { + + + int bs = mesh->surfaces[i]->skeleton_bone_aabb.size(); + const Rect3 *skbones = mesh->surfaces[i]->skeleton_bone_aabb.ptr(); + const bool *skused = mesh->surfaces[i]->skeleton_bone_used.ptr(); + + int sbs = sk->size; + ERR_CONTINUE(bs>sbs); + float *skb = sk->bones.ptr(); + + + + bool first=true; + if (sk->use_2d) { + for(int j=0;j<bs;j++) { + + if (!skused[j]) + continue; + + float *dataptr = &skb[8*j]; + + Transform mtx; + + mtx.basis.elements[0][0]=dataptr[ 0]; + mtx.basis.elements[0][1]=dataptr[ 1]; + mtx.origin[0]=dataptr[ 3]; + mtx.basis.elements[1][0]=dataptr[ 4]; + mtx.basis.elements[1][1]=dataptr[ 5]; + mtx.origin[1]=dataptr[ 7]; + + Rect3 baabb = mtx.xform( skbones[j] ); + if (first) { + laabb=baabb; + first=false; + } else { + laabb.merge_with(baabb); + } + } + } else { + for(int j=0;j<bs;j++) { + + if (!skused[j]) + continue; + + float *dataptr = &skb[12*j]; + + Transform mtx; + mtx.basis.elements[0][0]=dataptr[ 0]; + mtx.basis.elements[0][1]=dataptr[ 1]; + mtx.basis.elements[0][2]=dataptr[ 2]; + mtx.origin.x=dataptr[ 3]; + mtx.basis.elements[1][0]=dataptr[ 4]; + mtx.basis.elements[1][1]=dataptr[ 5]; + mtx.basis.elements[1][2]=dataptr[ 6]; + mtx.origin.y=dataptr[ 7]; + mtx.basis.elements[2][0]=dataptr[ 8]; + mtx.basis.elements[2][1]=dataptr[ 9]; + mtx.basis.elements[2][2]=dataptr[10]; + mtx.origin.z=dataptr[11]; + + Rect3 baabb = mtx.xform ( skbones[j] ); + if (first) { + laabb=baabb; + first=false; + } else { + laabb.merge_with(baabb); + } + } + } + + } else { + + laabb=mesh->surfaces[i]->aabb; + } + + if (i==0) + aabb=laabb; + else + aabb.merge_with(laabb); + } + } else { + + for (int i=0;i<mesh->surfaces.size();i++) { + + if (i==0) + aabb=mesh->surfaces[i]->aabb; + else + aabb.merge_with(mesh->surfaces[i]->aabb); + } + + } + + return aabb; + +} +void RasterizerStorageGLES3::mesh_clear(RID p_mesh){ + + Mesh *mesh = mesh_owner.getornull(p_mesh); + ERR_FAIL_COND(!mesh); + + while(mesh->surfaces.size()) { + mesh_remove_surface(p_mesh,0); + } +} + +void RasterizerStorageGLES3::mesh_render_blend_shapes(Surface *s, float *p_weights) { + + glBindVertexArray(s->array_id); + + BlendShapeShaderGLES3::Conditionals cond[VS::ARRAY_MAX-1]={ + BlendShapeShaderGLES3::ENABLE_NORMAL, //will be ignored + BlendShapeShaderGLES3::ENABLE_NORMAL, + BlendShapeShaderGLES3::ENABLE_TANGENT, + BlendShapeShaderGLES3::ENABLE_COLOR, + BlendShapeShaderGLES3::ENABLE_UV, + BlendShapeShaderGLES3::ENABLE_UV2, + BlendShapeShaderGLES3::ENABLE_SKELETON, + BlendShapeShaderGLES3::ENABLE_SKELETON, + }; + + int stride=0; + + if (s->format&VS::ARRAY_FLAG_USE_2D_VERTICES) { + stride=2*4; + } else { + stride=3*4; + } + + static const int sizes[VS::ARRAY_MAX-1]={ + 3*4, + 3*4, + 4*4, + 4*4, + 2*4, + 2*4, + 4*4, + 4*4 + }; + + for(int i=1;i<VS::ARRAY_MAX-1;i++) { + shaders.blend_shapes.set_conditional(cond[i],s->format&(1<<i)); //enable conditional for format + if (s->format&(1<<i)) { + stride+=sizes[i]; + } + } + + + //copy all first + float base_weight=1.0; + + int mtc = s->morph_targets.size(); + + if (s->mesh->morph_target_mode==VS::MORPH_MODE_NORMALIZED) { + + for(int i=0;i<mtc;i++) { + base_weight-=p_weights[i]; + } + } + + + + shaders.blend_shapes.set_conditional(BlendShapeShaderGLES3::ENABLE_BLEND,false); //first pass does not blend + shaders.blend_shapes.set_conditional(BlendShapeShaderGLES3::USE_2D_VERTEX,s->format&VS::ARRAY_FLAG_USE_2D_VERTICES); //use 2D vertices if needed + + shaders.blend_shapes.bind(); + + shaders.blend_shapes.set_uniform(BlendShapeShaderGLES3::BLEND_AMOUNT,base_weight); + glEnable(GL_RASTERIZER_DISCARD); + + glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, resources.transform_feedback_buffers[0]); + glBeginTransformFeedback(GL_POINTS); + glDrawArrays(GL_POINTS,0,s->array_len); + glEndTransformFeedback(); + + + shaders.blend_shapes.set_conditional(BlendShapeShaderGLES3::ENABLE_BLEND,true); //first pass does not blend + shaders.blend_shapes.bind(); + + for(int ti=0;ti<mtc;ti++) { + float weight = p_weights[ti]; + + if (weight<0.001) //not bother with this one + continue; + + glBindVertexArray(s->morph_targets[ti].array_id); + glBindBuffer(GL_ARRAY_BUFFER, resources.transform_feedback_buffers[0]); + glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, resources.transform_feedback_buffers[1]); + + shaders.blend_shapes.set_uniform(BlendShapeShaderGLES3::BLEND_AMOUNT,weight); + + int ofs=0; + for(int i=0;i<VS::ARRAY_MAX-1;i++) { + + if (s->format&(1<<i)) { + glEnableVertexAttribArray(i+8); + switch(i) { + + case VS::ARRAY_VERTEX: { + if (s->format&VS::ARRAY_FLAG_USE_2D_VERTICES) { + glVertexAttribPointer(i+8,2,GL_FLOAT,GL_FALSE,stride,((uint8_t*)0)+ofs); + ofs+=2*4; + } else { + glVertexAttribPointer(i+8,3,GL_FLOAT,GL_FALSE,stride,((uint8_t*)0)+ofs); + ofs+=3*4; + } + } break; + case VS::ARRAY_NORMAL: { + glVertexAttribPointer(i+8,3,GL_FLOAT,GL_FALSE,stride,((uint8_t*)0)+ofs); + ofs+=3*4; + } break; + case VS::ARRAY_TANGENT: { + glVertexAttribPointer(i+8,4,GL_FLOAT,GL_FALSE,stride,((uint8_t*)0)+ofs); + ofs+=4*4; + + } break; + case VS::ARRAY_COLOR: { + glVertexAttribPointer(i+8,4,GL_FLOAT,GL_FALSE,stride,((uint8_t*)0)+ofs); + ofs+=4*4; + + } break; + case VS::ARRAY_TEX_UV: { + glVertexAttribPointer(i+8,2,GL_FLOAT,GL_FALSE,stride,((uint8_t*)0)+ofs); + ofs+=2*4; + + } break; + case VS::ARRAY_TEX_UV2: { + glVertexAttribPointer(i+8,2,GL_FLOAT,GL_FALSE,stride,((uint8_t*)0)+ofs); + ofs+=2*4; + + } break; + case VS::ARRAY_BONES: { + glVertexAttribIPointer(i+8,4,GL_UNSIGNED_INT,stride,((uint8_t*)0)+ofs); + ofs+=4*4; + + } break; + case VS::ARRAY_WEIGHTS: { + glVertexAttribPointer(i+8,4,GL_FLOAT,GL_FALSE,stride,((uint8_t*)0)+ofs); + ofs+=4*4; + + } break; + } + + } else { + glDisableVertexAttribArray(i+8); + } + } + + glBeginTransformFeedback(GL_POINTS); + glDrawArrays(GL_POINTS,0,s->array_len); + glEndTransformFeedback(); + + + SWAP(resources.transform_feedback_buffers[0],resources.transform_feedback_buffers[1]); + + } + + glDisable(GL_RASTERIZER_DISCARD); + glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, 0); + + + glBindVertexArray(resources.transform_feedback_array); + glBindBuffer(GL_ARRAY_BUFFER, resources.transform_feedback_buffers[0]); + + int ofs=0; + for(int i=0;i<VS::ARRAY_MAX-1;i++) { + + if (s->format&(1<<i)) { + glEnableVertexAttribArray(i); + switch(i) { + + case VS::ARRAY_VERTEX: { + if (s->format&VS::ARRAY_FLAG_USE_2D_VERTICES) { + glVertexAttribPointer(i,2,GL_FLOAT,GL_FALSE,stride,((uint8_t*)0)+ofs); + ofs+=2*4; + } else { + glVertexAttribPointer(i,3,GL_FLOAT,GL_FALSE,stride,((uint8_t*)0)+ofs); + ofs+=3*4; + } + } break; + case VS::ARRAY_NORMAL: { + glVertexAttribPointer(i,3,GL_FLOAT,GL_FALSE,stride,((uint8_t*)0)+ofs); + ofs+=3*4; + } break; + case VS::ARRAY_TANGENT: { + glVertexAttribPointer(i,4,GL_FLOAT,GL_FALSE,stride,((uint8_t*)0)+ofs); + ofs+=4*4; + + } break; + case VS::ARRAY_COLOR: { + glVertexAttribPointer(i,4,GL_FLOAT,GL_FALSE,stride,((uint8_t*)0)+ofs); + ofs+=4*4; + + } break; + case VS::ARRAY_TEX_UV: { + glVertexAttribPointer(i,2,GL_FLOAT,GL_FALSE,stride,((uint8_t*)0)+ofs); + ofs+=2*4; + + } break; + case VS::ARRAY_TEX_UV2: { + glVertexAttribPointer(i,2,GL_FLOAT,GL_FALSE,stride,((uint8_t*)0)+ofs); + ofs+=2*4; + + } break; + case VS::ARRAY_BONES: { + glVertexAttribIPointer(i,4,GL_UNSIGNED_INT,stride,((uint8_t*)0)+ofs); + ofs+=4*4; + + } break; + case VS::ARRAY_WEIGHTS: { + glVertexAttribPointer(i,4,GL_FLOAT,GL_FALSE,stride,((uint8_t*)0)+ofs); + ofs+=4*4; + + } break; + } + + } else { + glDisableVertexAttribArray(i); + } + } + + if (s->index_array_len) { + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,s->index_id); + } + +} + +/* MULTIMESH API */ + + +RID RasterizerStorageGLES3::multimesh_create(){ + + MultiMesh *multimesh = memnew( MultiMesh ); + return multimesh_owner.make_rid(multimesh); +} + +void RasterizerStorageGLES3::multimesh_allocate(RID p_multimesh, int p_instances, VS::MultimeshTransformFormat p_transform_format, VS::MultimeshColorFormat p_color_format){ + + MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh); + ERR_FAIL_COND(!multimesh); + + if (multimesh->size==p_instances && multimesh->transform_format==p_transform_format && multimesh->color_format==p_color_format) + return; + + if (multimesh->buffer) { + glDeleteBuffers(1,&multimesh->buffer); + multimesh->data.resize(0); + } + + multimesh->size=p_instances; + multimesh->transform_format=p_transform_format; + multimesh->color_format=p_color_format; + + if (multimesh->size) { + + if (multimesh->transform_format==VS::MULTIMESH_TRANSFORM_2D) { + multimesh->xform_floats=8; + } else { + multimesh->xform_floats=12; + + } + + if (multimesh->color_format==VS::MULTIMESH_COLOR_NONE) { + multimesh->color_floats=0; + } else if (multimesh->color_format==VS::MULTIMESH_COLOR_8BIT) { + multimesh->color_floats=1; + } else if (multimesh->color_format==VS::MULTIMESH_COLOR_FLOAT) { + multimesh->color_floats=4; + } + + int format_floats = multimesh->color_floats+multimesh->xform_floats; + multimesh->data.resize(format_floats*p_instances); + for(int i=0;i<p_instances;i+=format_floats) { + + int color_from=0; + + if (multimesh->transform_format==VS::MULTIMESH_TRANSFORM_2D) { + multimesh->data[i+0]=1.0; + multimesh->data[i+1]=0.0; + multimesh->data[i+2]=0.0; + multimesh->data[i+3]=0.0; + multimesh->data[i+4]=0.0; + multimesh->data[i+5]=1.0; + multimesh->data[i+6]=0.0; + multimesh->data[i+7]=0.0; + color_from=8; + } else { + multimesh->data[i+0]=1.0; + multimesh->data[i+1]=0.0; + multimesh->data[i+2]=0.0; + multimesh->data[i+3]=0.0; + multimesh->data[i+4]=0.0; + multimesh->data[i+5]=1.0; + multimesh->data[i+6]=0.0; + multimesh->data[i+7]=0.0; + multimesh->data[i+8]=0.0; + multimesh->data[i+9]=0.0; + multimesh->data[i+10]=1.0; + multimesh->data[i+11]=0.0; + color_from=12; + } + + if (multimesh->color_format==VS::MULTIMESH_COLOR_NONE) { + //none + } else if (multimesh->color_format==VS::MULTIMESH_COLOR_8BIT) { + + union { + uint32_t colu; + float colf; + } cu; + + cu.colu=0xFFFFFFFF; + multimesh->data[i+color_from+0]=cu.colf; + + } else if (multimesh->color_format==VS::MULTIMESH_COLOR_FLOAT) { + multimesh->data[i+color_from+0]=1.0; + multimesh->data[i+color_from+1]=1.0; + multimesh->data[i+color_from+2]=1.0; + multimesh->data[i+color_from+3]=1.0; + } + } + + glGenBuffers(1,&multimesh->buffer); + glBindBuffer(GL_ARRAY_BUFFER,multimesh->buffer); + glBufferData(GL_ARRAY_BUFFER,multimesh->data.size()*sizeof(float),NULL,GL_DYNAMIC_DRAW); + glBindBuffer(GL_ARRAY_BUFFER,0); + + } + + multimesh->dirty_data=true; + multimesh->dirty_aabb=true; + + if (!multimesh->update_list.in_list()) { + multimesh_update_list.add(&multimesh->update_list); + } + +} + +int RasterizerStorageGLES3::multimesh_get_instance_count(RID p_multimesh) const{ + + MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh); + ERR_FAIL_COND_V(!multimesh,0); + + return multimesh->size; +} + +void RasterizerStorageGLES3::multimesh_set_mesh(RID p_multimesh,RID p_mesh){ + + MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh); + ERR_FAIL_COND(!multimesh); + + multimesh->mesh=p_mesh; + + multimesh->dirty_aabb=true; + + if (!multimesh->update_list.in_list()) { + multimesh_update_list.add(&multimesh->update_list); + } +} + +void RasterizerStorageGLES3::multimesh_instance_set_transform(RID p_multimesh,int p_index,const Transform& p_transform){ + + MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh); + ERR_FAIL_COND(!multimesh); + ERR_FAIL_INDEX(p_index,multimesh->size); + ERR_FAIL_COND(multimesh->transform_format==VS::MULTIMESH_TRANSFORM_2D); + + int stride = multimesh->color_floats+multimesh->xform_floats; + float *dataptr=&multimesh->data[stride*p_index]; + + dataptr[ 0]=p_transform.basis.elements[0][0]; + dataptr[ 1]=p_transform.basis.elements[0][1]; + dataptr[ 2]=p_transform.basis.elements[0][2]; + dataptr[ 3]=p_transform.origin.x; + dataptr[ 4]=p_transform.basis.elements[1][0]; + dataptr[ 5]=p_transform.basis.elements[1][1]; + dataptr[ 6]=p_transform.basis.elements[1][2]; + dataptr[ 7]=p_transform.origin.y; + dataptr[ 8]=p_transform.basis.elements[2][0]; + dataptr[ 9]=p_transform.basis.elements[2][1]; + dataptr[10]=p_transform.basis.elements[2][2]; + dataptr[11]=p_transform.origin.z; + + multimesh->dirty_data=true; + multimesh->dirty_aabb=true; + + if (!multimesh->update_list.in_list()) { + multimesh_update_list.add(&multimesh->update_list); + } +} + +void RasterizerStorageGLES3::multimesh_instance_set_transform_2d(RID p_multimesh,int p_index,const Transform2D& p_transform){ + + MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh); + ERR_FAIL_COND(!multimesh); + ERR_FAIL_INDEX(p_index,multimesh->size); + ERR_FAIL_COND(multimesh->transform_format==VS::MULTIMESH_TRANSFORM_3D); + + int stride = multimesh->color_floats+multimesh->xform_floats; + float *dataptr=&multimesh->data[stride*p_index]; + + dataptr[ 0]=p_transform.elements[0][0]; + dataptr[ 1]=p_transform.elements[1][0]; + dataptr[ 2]=0; + dataptr[ 3]=p_transform.elements[2][0]; + dataptr[ 4]=p_transform.elements[0][1]; + dataptr[ 5]=p_transform.elements[1][1]; + dataptr[ 6]=0; + dataptr[ 7]=p_transform.elements[2][1]; + + multimesh->dirty_data=true; + multimesh->dirty_aabb=true; + + if (!multimesh->update_list.in_list()) { + multimesh_update_list.add(&multimesh->update_list); + } +} +void RasterizerStorageGLES3::multimesh_instance_set_color(RID p_multimesh,int p_index,const Color& p_color){ + + MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh); + ERR_FAIL_COND(!multimesh); + ERR_FAIL_INDEX(p_index,multimesh->size); + ERR_FAIL_COND(multimesh->color_format==VS::MULTIMESH_COLOR_NONE); + + int stride = multimesh->color_floats+multimesh->xform_floats; + float *dataptr=&multimesh->data[stride*p_index+multimesh->xform_floats]; + + if (multimesh->color_format==VS::MULTIMESH_COLOR_8BIT) { + + uint8_t *data8=(uint8_t*)dataptr; + data8[0]=CLAMP(p_color.r*255.0,0,255); + data8[1]=CLAMP(p_color.g*255.0,0,255); + data8[2]=CLAMP(p_color.b*255.0,0,255); + data8[3]=CLAMP(p_color.a*255.0,0,255); + + } else if (multimesh->color_format==VS::MULTIMESH_COLOR_FLOAT) { + dataptr[ 0]=p_color.r; + dataptr[ 1]=p_color.g; + dataptr[ 2]=p_color.b; + dataptr[ 3]=p_color.a; + } + + + multimesh->dirty_data=true; + multimesh->dirty_aabb=true; + + if (!multimesh->update_list.in_list()) { + multimesh_update_list.add(&multimesh->update_list); + } +} + +RID RasterizerStorageGLES3::multimesh_get_mesh(RID p_multimesh) const{ + + MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh); + ERR_FAIL_COND_V(!multimesh,RID()); + + return multimesh->mesh; +} + + +Transform RasterizerStorageGLES3::multimesh_instance_get_transform(RID p_multimesh,int p_index) const{ + + MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh); + ERR_FAIL_COND_V(!multimesh,Transform()); + ERR_FAIL_INDEX_V(p_index,multimesh->size,Transform()); + ERR_FAIL_COND_V(multimesh->transform_format==VS::MULTIMESH_TRANSFORM_2D,Transform()); + + int stride = multimesh->color_floats+multimesh->xform_floats; + float *dataptr=&multimesh->data[stride*p_index]; + + Transform xform; + + xform.basis.elements[0][0]=dataptr[ 0]; + xform.basis.elements[0][1]=dataptr[ 1]; + xform.basis.elements[0][2]=dataptr[ 2]; + xform.origin.x=dataptr[ 3]; + xform.basis.elements[1][0]=dataptr[ 4]; + xform.basis.elements[1][1]=dataptr[ 5]; + xform.basis.elements[1][2]=dataptr[ 6]; + xform.origin.y=dataptr[ 7]; + xform.basis.elements[2][0]=dataptr[ 8]; + xform.basis.elements[2][1]=dataptr[ 9]; + xform.basis.elements[2][2]=dataptr[10]; + xform.origin.z=dataptr[11]; + + return xform; +} +Transform2D RasterizerStorageGLES3::multimesh_instance_get_transform_2d(RID p_multimesh,int p_index) const{ + + MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh); + ERR_FAIL_COND_V(!multimesh,Transform2D()); + ERR_FAIL_INDEX_V(p_index,multimesh->size,Transform2D()); + ERR_FAIL_COND_V(multimesh->transform_format==VS::MULTIMESH_TRANSFORM_3D,Transform2D()); + + int stride = multimesh->color_floats+multimesh->xform_floats; + float *dataptr=&multimesh->data[stride*p_index]; + + Transform2D xform; + + xform.elements[0][0]=dataptr[ 0]; + xform.elements[1][0]=dataptr[ 1]; + xform.elements[2][0]=dataptr[ 3]; + xform.elements[0][1]=dataptr[ 4]; + xform.elements[1][1]=dataptr[ 5]; + xform.elements[2][1]=dataptr[ 7]; + + return xform; +} + +Color RasterizerStorageGLES3::multimesh_instance_get_color(RID p_multimesh,int p_index) const{ + + MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh); + ERR_FAIL_COND_V(!multimesh,Color()); + ERR_FAIL_INDEX_V(p_index,multimesh->size,Color()); + ERR_FAIL_COND_V(multimesh->color_format==VS::MULTIMESH_COLOR_NONE,Color()); + + int stride = multimesh->color_floats+multimesh->xform_floats; + float *dataptr=&multimesh->data[stride*p_index+multimesh->color_floats]; + + if (multimesh->color_format==VS::MULTIMESH_COLOR_8BIT) { + union { + uint32_t colu; + float colf; + } cu; + + return Color::hex(BSWAP32(cu.colu)); + + } else if (multimesh->color_format==VS::MULTIMESH_COLOR_FLOAT) { + Color c; + c.r=dataptr[ 0]; + c.g=dataptr[ 1]; + c.b=dataptr[ 2]; + c.a=dataptr[ 3]; + + return c; + } + + return Color(); + +} + +void RasterizerStorageGLES3::multimesh_set_visible_instances(RID p_multimesh,int p_visible){ + + MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh); + ERR_FAIL_COND(!multimesh); + + multimesh->visible_instances=p_visible; +} +int RasterizerStorageGLES3::multimesh_get_visible_instances(RID p_multimesh) const{ + + MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh); + ERR_FAIL_COND_V(!multimesh,-1); + + return multimesh->visible_instances; +} + +Rect3 RasterizerStorageGLES3::multimesh_get_aabb(RID p_multimesh) const{ + + MultiMesh *multimesh = multimesh_owner.getornull(p_multimesh); + ERR_FAIL_COND_V(!multimesh,Rect3()); + + const_cast<RasterizerStorageGLES3*>(this)->update_dirty_multimeshes(); //update pending AABBs + + return multimesh->aabb; +} + +void RasterizerStorageGLES3::update_dirty_multimeshes() { + + while(multimesh_update_list.first()) { + + MultiMesh *multimesh = multimesh_update_list.first()->self(); + + if (multimesh->size && multimesh->dirty_data) { + + + glBindBuffer(GL_ARRAY_BUFFER,multimesh->buffer); + glBufferSubData(GL_ARRAY_BUFFER,0,multimesh->data.size()*sizeof(float),multimesh->data.ptr()); + glBindBuffer(GL_ARRAY_BUFFER,0); + + + } + + + + if (multimesh->size && multimesh->dirty_aabb) { + + Rect3 mesh_aabb; + + if (multimesh->mesh.is_valid()) { + mesh_aabb=mesh_get_aabb(multimesh->mesh,RID()); + } else { + mesh_aabb.size+=Vector3(0.001,0.001,0.001); + } + + int stride=multimesh->color_floats+multimesh->xform_floats; + int count = multimesh->data.size(); + float *data=multimesh->data.ptr(); + + Rect3 aabb; + + if (multimesh->transform_format==VS::MULTIMESH_TRANSFORM_2D) { + + for(int i=0;i<count;i+=stride) { + + float *dataptr=&data[i]; + Transform xform; + xform.basis[0][0]=dataptr[ 0]; + xform.basis[0][1]=dataptr[ 1]; + xform.origin[0]=dataptr[ 3]; + xform.basis[1][0]=dataptr[ 4]; + xform.basis[1][1]=dataptr[ 5]; + xform.origin[1]=dataptr[ 7]; + + Rect3 laabb = xform.xform(mesh_aabb); + if (i==0) + aabb=laabb; + else + aabb.merge_with(laabb); + } + } else { + + for(int i=0;i<count;i+=stride) { + + float *dataptr=&data[i]; + Transform xform; + + xform.basis.elements[0][0]=dataptr[ 0]; + xform.basis.elements[0][1]=dataptr[ 1]; + xform.basis.elements[0][2]=dataptr[ 2]; + xform.origin.x=dataptr[ 3]; + xform.basis.elements[1][0]=dataptr[ 4]; + xform.basis.elements[1][1]=dataptr[ 5]; + xform.basis.elements[1][2]=dataptr[ 6]; + xform.origin.y=dataptr[ 7]; + xform.basis.elements[2][0]=dataptr[ 8]; + xform.basis.elements[2][1]=dataptr[ 9]; + xform.basis.elements[2][2]=dataptr[10]; + xform.origin.z=dataptr[11]; + + Rect3 laabb = xform.xform(mesh_aabb); + if (i==0) + aabb=laabb; + else + aabb.merge_with(laabb); + } + } + + multimesh->aabb=aabb; + } + multimesh->dirty_aabb=false; + multimesh->dirty_data=false; + + multimesh->instance_change_notify(); + + multimesh_update_list.remove(multimesh_update_list.first()); + } +} + +/* IMMEDIATE API */ + + +RID RasterizerStorageGLES3::immediate_create() { + + Immediate *im = memnew( Immediate ); + return immediate_owner.make_rid(im); + +} + +void RasterizerStorageGLES3::immediate_begin(RID p_immediate, VS::PrimitiveType p_rimitive, RID p_texture){ + + Immediate *im = immediate_owner.get(p_immediate); + ERR_FAIL_COND(!im); + ERR_FAIL_COND(im->building); + + Immediate::Chunk ic; + ic.texture=p_texture; + ic.primitive=p_rimitive; + im->chunks.push_back(ic); + im->mask=0; + im->building=true; + + +} +void RasterizerStorageGLES3::immediate_vertex(RID p_immediate,const Vector3& p_vertex){ + + Immediate *im = immediate_owner.get(p_immediate); + ERR_FAIL_COND(!im); + ERR_FAIL_COND(!im->building); + + Immediate::Chunk *c = &im->chunks.back()->get(); + + + if (c->vertices.empty() && im->chunks.size()==1) { + + im->aabb.pos=p_vertex; + im->aabb.size=Vector3(); + } else { + im->aabb.expand_to(p_vertex); + } + + if (im->mask&VS::ARRAY_FORMAT_NORMAL) + c->normals.push_back(chunk_normal); + if (im->mask&VS::ARRAY_FORMAT_TANGENT) + c->tangents.push_back(chunk_tangent); + if (im->mask&VS::ARRAY_FORMAT_COLOR) + c->colors.push_back(chunk_color); + if (im->mask&VS::ARRAY_FORMAT_TEX_UV) + c->uvs.push_back(chunk_uv); + if (im->mask&VS::ARRAY_FORMAT_TEX_UV2) + c->uvs2.push_back(chunk_uv2); + im->mask|=VS::ARRAY_FORMAT_VERTEX; + c->vertices.push_back(p_vertex); + +} + + +void RasterizerStorageGLES3::immediate_normal(RID p_immediate,const Vector3& p_normal){ + + Immediate *im = immediate_owner.get(p_immediate); + ERR_FAIL_COND(!im); + ERR_FAIL_COND(!im->building); + + im->mask|=VS::ARRAY_FORMAT_NORMAL; + chunk_normal=p_normal; + +} +void RasterizerStorageGLES3::immediate_tangent(RID p_immediate,const Plane& p_tangent){ + + Immediate *im = immediate_owner.get(p_immediate); + ERR_FAIL_COND(!im); + ERR_FAIL_COND(!im->building); + + im->mask|=VS::ARRAY_FORMAT_TANGENT; + chunk_tangent=p_tangent; + +} +void RasterizerStorageGLES3::immediate_color(RID p_immediate,const Color& p_color){ + + Immediate *im = immediate_owner.get(p_immediate); + ERR_FAIL_COND(!im); + ERR_FAIL_COND(!im->building); + + im->mask|=VS::ARRAY_FORMAT_COLOR; + chunk_color=p_color; + +} +void RasterizerStorageGLES3::immediate_uv(RID p_immediate,const Vector2& tex_uv){ + + Immediate *im = immediate_owner.get(p_immediate); + ERR_FAIL_COND(!im); + ERR_FAIL_COND(!im->building); + + im->mask|=VS::ARRAY_FORMAT_TEX_UV; + chunk_uv=tex_uv; + +} +void RasterizerStorageGLES3::immediate_uv2(RID p_immediate,const Vector2& tex_uv){ + + Immediate *im = immediate_owner.get(p_immediate); + ERR_FAIL_COND(!im); + ERR_FAIL_COND(!im->building); + + im->mask|=VS::ARRAY_FORMAT_TEX_UV2; + chunk_uv2=tex_uv; + +} + +void RasterizerStorageGLES3::immediate_end(RID p_immediate){ + + Immediate *im = immediate_owner.get(p_immediate); + ERR_FAIL_COND(!im); + ERR_FAIL_COND(!im->building); + + im->building=false; + + im->instance_change_notify(); + +} +void RasterizerStorageGLES3::immediate_clear(RID p_immediate) { + + Immediate *im = immediate_owner.get(p_immediate); + ERR_FAIL_COND(!im); + ERR_FAIL_COND(im->building); + + im->chunks.clear(); + im->instance_change_notify(); + +} + +Rect3 RasterizerStorageGLES3::immediate_get_aabb(RID p_immediate) const { + + Immediate *im = immediate_owner.get(p_immediate); + ERR_FAIL_COND_V(!im,Rect3()); + return im->aabb; +} + +void RasterizerStorageGLES3::immediate_set_material(RID p_immediate,RID p_material) { + + Immediate *im = immediate_owner.get(p_immediate); + ERR_FAIL_COND(!im); + im->material=p_material; + im->instance_material_change_notify(); + +} + +RID RasterizerStorageGLES3::immediate_get_material(RID p_immediate) const { + + const Immediate *im = immediate_owner.get(p_immediate); + ERR_FAIL_COND_V(!im,RID()); + return im->material; + +} + +/* SKELETON API */ + +RID RasterizerStorageGLES3::skeleton_create(){ + + Skeleton *skeleton = memnew( Skeleton ); + return skeleton_owner.make_rid(skeleton); +} + +void RasterizerStorageGLES3::skeleton_allocate(RID p_skeleton,int p_bones,bool p_2d_skeleton){ + + Skeleton *skeleton = skeleton_owner.getornull(p_skeleton); + ERR_FAIL_COND(!skeleton); + ERR_FAIL_COND(p_bones<0); + + if (skeleton->size==p_bones && skeleton->use_2d==p_2d_skeleton) + return; + + if (skeleton->ubo) { + glDeleteBuffers(1,&skeleton->ubo); + skeleton->ubo=0; + } + + skeleton->size=p_bones; + if (p_2d_skeleton) { + skeleton->bones.resize(p_bones*8); + for(int i=0;i<skeleton->bones.size();i+=8) { + skeleton->bones[i+0]=1; + skeleton->bones[i+1]=0; + skeleton->bones[i+2]=0; + skeleton->bones[i+3]=0; + skeleton->bones[i+4]=0; + skeleton->bones[i+5]=1; + skeleton->bones[i+6]=0; + skeleton->bones[i+7]=0; + } + + } else { + skeleton->bones.resize(p_bones*12); + for(int i=0;i<skeleton->bones.size();i+=12) { + skeleton->bones[i+0]=1; + skeleton->bones[i+1]=0; + skeleton->bones[i+2]=0; + skeleton->bones[i+3]=0; + skeleton->bones[i+4]=0; + skeleton->bones[i+5]=1; + skeleton->bones[i+6]=0; + skeleton->bones[i+7]=0; + skeleton->bones[i+8]=0; + skeleton->bones[i+9]=0; + skeleton->bones[i+10]=1; + skeleton->bones[i+11]=0; + } + + } + + + + if (p_bones) { + glGenBuffers(1, &skeleton->ubo); + glBindBuffer(GL_UNIFORM_BUFFER, skeleton->ubo); + glBufferData(GL_UNIFORM_BUFFER, skeleton->bones.size()*sizeof(float), NULL, GL_DYNAMIC_DRAW); + glBindBuffer(GL_UNIFORM_BUFFER, 0); + } + + if (!skeleton->update_list.in_list()) { + skeleton_update_list.add(&skeleton->update_list); + } + + + +} +int RasterizerStorageGLES3::skeleton_get_bone_count(RID p_skeleton) const{ + + Skeleton *skeleton = skeleton_owner.getornull(p_skeleton); + ERR_FAIL_COND_V(!skeleton,0); + + return skeleton->size; +} + +void RasterizerStorageGLES3::skeleton_bone_set_transform(RID p_skeleton,int p_bone, const Transform& p_transform){ + + Skeleton *skeleton = skeleton_owner.getornull(p_skeleton); + + ERR_FAIL_COND(!skeleton); + ERR_FAIL_INDEX(p_bone,skeleton->size); + ERR_FAIL_COND(skeleton->use_2d); + + float * bones = skeleton->bones.ptr(); + bones[p_bone*12+ 0]=p_transform.basis.elements[0][0]; + bones[p_bone*12+ 1]=p_transform.basis.elements[0][1]; + bones[p_bone*12+ 2]=p_transform.basis.elements[0][2]; + bones[p_bone*12+ 3]=p_transform.origin.x; + bones[p_bone*12+ 4]=p_transform.basis.elements[1][0]; + bones[p_bone*12+ 5]=p_transform.basis.elements[1][1]; + bones[p_bone*12+ 6]=p_transform.basis.elements[1][2]; + bones[p_bone*12+ 7]=p_transform.origin.y; + bones[p_bone*12+ 8]=p_transform.basis.elements[2][0]; + bones[p_bone*12+ 9]=p_transform.basis.elements[2][1]; + bones[p_bone*12+10]=p_transform.basis.elements[2][2]; + bones[p_bone*12+11]=p_transform.origin.z; + + if (!skeleton->update_list.in_list()) { + skeleton_update_list.add(&skeleton->update_list); + } + +} + + +Transform RasterizerStorageGLES3::skeleton_bone_get_transform(RID p_skeleton,int p_bone) const{ + + Skeleton *skeleton = skeleton_owner.getornull(p_skeleton); + + ERR_FAIL_COND_V(!skeleton,Transform()); + ERR_FAIL_INDEX_V(p_bone,skeleton->size,Transform()); + ERR_FAIL_COND_V(skeleton->use_2d,Transform()); + + float * bones = skeleton->bones.ptr(); + Transform mtx; + mtx.basis.elements[0][0]=bones[p_bone*12+ 0]; + mtx.basis.elements[0][1]=bones[p_bone*12+ 1]; + mtx.basis.elements[0][2]=bones[p_bone*12+ 2]; + mtx.origin.x=bones[p_bone*12+ 3]; + mtx.basis.elements[1][0]=bones[p_bone*12+ 4]; + mtx.basis.elements[1][1]=bones[p_bone*12+ 5]; + mtx.basis.elements[1][2]=bones[p_bone*12+ 6]; + mtx.origin.y=bones[p_bone*12+ 7]; + mtx.basis.elements[2][0]=bones[p_bone*12+ 8]; + mtx.basis.elements[2][1]=bones[p_bone*12+ 9]; + mtx.basis.elements[2][2]=bones[p_bone*12+10]; + mtx.origin.z=bones[p_bone*12+11]; + + return mtx; +} +void RasterizerStorageGLES3::skeleton_bone_set_transform_2d(RID p_skeleton,int p_bone, const Transform2D& p_transform){ + + Skeleton *skeleton = skeleton_owner.getornull(p_skeleton); + + ERR_FAIL_COND(!skeleton); + ERR_FAIL_INDEX(p_bone,skeleton->size); + ERR_FAIL_COND(!skeleton->use_2d); + + float * bones = skeleton->bones.ptr(); + bones[p_bone*12+ 0]=p_transform.elements[0][0]; + bones[p_bone*12+ 1]=p_transform.elements[1][0]; + bones[p_bone*12+ 2]=0; + bones[p_bone*12+ 3]=p_transform.elements[2][0]; + bones[p_bone*12+ 4]=p_transform.elements[0][1]; + bones[p_bone*12+ 5]=p_transform.elements[1][1]; + bones[p_bone*12+ 6]=0; + bones[p_bone*12+ 7]=p_transform.elements[2][1]; + + if (!skeleton->update_list.in_list()) { + skeleton_update_list.add(&skeleton->update_list); + } + +} +Transform2D RasterizerStorageGLES3::skeleton_bone_get_transform_2d(RID p_skeleton,int p_bone) const{ + + Skeleton *skeleton = skeleton_owner.getornull(p_skeleton); + + + ERR_FAIL_COND_V(!skeleton,Transform2D()); + ERR_FAIL_INDEX_V(p_bone,skeleton->size,Transform2D()); + ERR_FAIL_COND_V(!skeleton->use_2d,Transform2D()); + + Transform2D mtx; + + float * bones = skeleton->bones.ptr(); + mtx.elements[0][0]=bones[p_bone*12+ 0]; + mtx.elements[1][0]=bones[p_bone*12+ 1]; + mtx.elements[2][0]=bones[p_bone*12+ 3]; + mtx.elements[0][1]=bones[p_bone*12+ 4]; + mtx.elements[1][1]=bones[p_bone*12+ 5]; + mtx.elements[2][1]=bones[p_bone*12+ 7]; + + return mtx; +} + +void RasterizerStorageGLES3::update_dirty_skeletons() { + + while(skeleton_update_list.first()) { + + Skeleton *skeleton = skeleton_update_list.first()->self(); + if (skeleton->size) { + glBindBuffer(GL_UNIFORM_BUFFER, skeleton->ubo); + glBufferSubData(GL_UNIFORM_BUFFER,0,skeleton->bones.size()*sizeof(float),skeleton->bones.ptr()); + glBindBuffer(GL_UNIFORM_BUFFER, 0); + } + + for (Set<RasterizerScene::InstanceBase*>::Element *E=skeleton->instances.front();E;E=E->next()) { + E->get()->base_changed(); + } + + skeleton_update_list.remove(skeleton_update_list.first()); + } + +} + +/* Light API */ + +RID RasterizerStorageGLES3::light_create(VS::LightType p_type){ + + Light *light = memnew( Light ); + light->type=p_type; + + light->param[VS::LIGHT_PARAM_ENERGY]=1.0; + light->param[VS::LIGHT_PARAM_SPECULAR]=0.5; + light->param[VS::LIGHT_PARAM_RANGE]=1.0; + light->param[VS::LIGHT_PARAM_SPOT_ANGLE]=45; + light->param[VS::LIGHT_PARAM_SHADOW_MAX_DISTANCE]=0; + light->param[VS::LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET]=0.1; + light->param[VS::LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET]=0.3; + light->param[VS::LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET]=0.6; + light->param[VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS]=0.1; + light->param[VS::LIGHT_PARAM_SHADOW_BIAS_SPLIT_SCALE]=0.1; + + + light->color=Color(1,1,1,1); + light->shadow=false; + light->negative=false; + light->cull_mask=0xFFFFFFFF; + light->directional_shadow_mode=VS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL; + light->omni_shadow_mode=VS::LIGHT_OMNI_SHADOW_DUAL_PARABOLOID; + light->omni_shadow_detail=VS::LIGHT_OMNI_SHADOW_DETAIL_VERTICAL; + light->directional_blend_splits=false; + + light->version=0; + + return light_owner.make_rid(light); +} + +void RasterizerStorageGLES3::light_set_color(RID p_light,const Color& p_color){ + + Light * light = light_owner.getornull(p_light); + ERR_FAIL_COND(!light); + + light->color=p_color; +} +void RasterizerStorageGLES3::light_set_param(RID p_light,VS::LightParam p_param,float p_value){ + + Light * light = light_owner.getornull(p_light); + ERR_FAIL_COND(!light); + ERR_FAIL_INDEX(p_param,VS::LIGHT_PARAM_MAX); + + switch(p_param) { + case VS::LIGHT_PARAM_RANGE: + case VS::LIGHT_PARAM_SPOT_ANGLE: + case VS::LIGHT_PARAM_SHADOW_MAX_DISTANCE: + case VS::LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET: + case VS::LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET: + case VS::LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET: + case VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS: + case VS::LIGHT_PARAM_SHADOW_BIAS: + case VS::LIGHT_PARAM_SHADOW_BIAS_SPLIT_SCALE: { + + light->version++; + light->instance_change_notify(); + } break; + } + + light->param[p_param]=p_value; +} +void RasterizerStorageGLES3::light_set_shadow(RID p_light,bool p_enabled){ + + Light * light = light_owner.getornull(p_light); + ERR_FAIL_COND(!light); + light->shadow=p_enabled; + + light->version++; + light->instance_change_notify(); +} + +void RasterizerStorageGLES3::light_set_shadow_color(RID p_light,const Color& p_color) { + + Light * light = light_owner.getornull(p_light); + ERR_FAIL_COND(!light); + light->shadow_color=p_color; + +} + +void RasterizerStorageGLES3::light_set_projector(RID p_light,RID p_texture){ + + Light * light = light_owner.getornull(p_light); + ERR_FAIL_COND(!light); + + light->projector=p_texture; +} + +void RasterizerStorageGLES3::light_set_negative(RID p_light,bool p_enable){ + + Light * light = light_owner.getornull(p_light); + ERR_FAIL_COND(!light); + + light->negative=p_enable; +} +void RasterizerStorageGLES3::light_set_cull_mask(RID p_light,uint32_t p_mask){ + + Light * light = light_owner.getornull(p_light); + ERR_FAIL_COND(!light); + + light->cull_mask=p_mask; + + light->version++; + light->instance_change_notify(); + +} + +void RasterizerStorageGLES3::light_omni_set_shadow_mode(RID p_light,VS::LightOmniShadowMode p_mode) { + + Light * light = light_owner.getornull(p_light); + ERR_FAIL_COND(!light); + + light->omni_shadow_mode=p_mode; + + light->version++; + light->instance_change_notify(); + + +} + +VS::LightOmniShadowMode RasterizerStorageGLES3::light_omni_get_shadow_mode(RID p_light) { + + const Light * light = light_owner.getornull(p_light); + ERR_FAIL_COND_V(!light,VS::LIGHT_OMNI_SHADOW_CUBE); + + return light->omni_shadow_mode; +} + + +void RasterizerStorageGLES3::light_omni_set_shadow_detail(RID p_light,VS::LightOmniShadowDetail p_detail) { + + Light * light = light_owner.getornull(p_light); + ERR_FAIL_COND(!light); + + light->omni_shadow_detail=p_detail; + light->version++; + light->instance_change_notify(); +} + + +void RasterizerStorageGLES3::light_directional_set_shadow_mode(RID p_light,VS::LightDirectionalShadowMode p_mode){ + + Light * light = light_owner.getornull(p_light); + ERR_FAIL_COND(!light); + + light->directional_shadow_mode=p_mode; + light->version++; + light->instance_change_notify(); + +} + +void RasterizerStorageGLES3::light_directional_set_blend_splits(RID p_light,bool p_enable) { + + Light * light = light_owner.getornull(p_light); + ERR_FAIL_COND(!light); + + light->directional_blend_splits=p_enable; + light->version++; + light->instance_change_notify(); + +} + + +bool RasterizerStorageGLES3::light_directional_get_blend_splits(RID p_light) const { + + const Light * light = light_owner.getornull(p_light); + ERR_FAIL_COND_V(!light,false); + + return light->directional_blend_splits; +} + +VS::LightDirectionalShadowMode RasterizerStorageGLES3::light_directional_get_shadow_mode(RID p_light) { + + const Light * light = light_owner.getornull(p_light); + ERR_FAIL_COND_V(!light,VS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL); + + return light->directional_shadow_mode; +} + + +VS::LightType RasterizerStorageGLES3::light_get_type(RID p_light) const { + + const Light * light = light_owner.getornull(p_light); + ERR_FAIL_COND_V(!light,VS::LIGHT_DIRECTIONAL); + + return light->type; +} + +float RasterizerStorageGLES3::light_get_param(RID p_light,VS::LightParam p_param) { + + const Light * light = light_owner.getornull(p_light); + ERR_FAIL_COND_V(!light,VS::LIGHT_DIRECTIONAL); + + return light->param[p_param]; +} + +Color RasterizerStorageGLES3::light_get_color(RID p_light) { + + const Light * light = light_owner.getornull(p_light); + ERR_FAIL_COND_V(!light,Color()); + + return light->color; + +} + +bool RasterizerStorageGLES3::light_has_shadow(RID p_light) const { + + const Light * light = light_owner.getornull(p_light); + ERR_FAIL_COND_V(!light,VS::LIGHT_DIRECTIONAL); + + return light->shadow; +} + +uint64_t RasterizerStorageGLES3::light_get_version(RID p_light) const { + + const Light * light = light_owner.getornull(p_light); + ERR_FAIL_COND_V(!light,0); + + return light->version; +} + + +Rect3 RasterizerStorageGLES3::light_get_aabb(RID p_light) const { + + const Light * light = light_owner.getornull(p_light); + ERR_FAIL_COND_V(!light,Rect3()); + + switch( light->type ) { + + case VS::LIGHT_SPOT: { + + float len=light->param[VS::LIGHT_PARAM_RANGE]; + float size=Math::tan(Math::deg2rad(light->param[VS::LIGHT_PARAM_SPOT_ANGLE]))*len; + return Rect3( Vector3( -size,-size,-len ), Vector3( size*2, size*2, len ) ); + } break; + case VS::LIGHT_OMNI: { + + float r = light->param[VS::LIGHT_PARAM_RANGE]; + return Rect3( -Vector3(r,r,r), Vector3(r,r,r)*2 ); + } break; + case VS::LIGHT_DIRECTIONAL: { + + return Rect3(); + } break; + default: {} + } + + ERR_FAIL_V( Rect3() ); + return Rect3(); +} + +/* PROBE API */ + +RID RasterizerStorageGLES3::reflection_probe_create(){ + + ReflectionProbe *reflection_probe = memnew( ReflectionProbe ); + + reflection_probe->intensity=1.0; + reflection_probe->interior_ambient=Color(); + reflection_probe->interior_ambient_energy=1.0; + reflection_probe->max_distance=0; + reflection_probe->extents=Vector3(1,1,1); + reflection_probe->origin_offset=Vector3(0,0,0); + reflection_probe->interior=false; + reflection_probe->box_projection=false; + reflection_probe->enable_shadows=false; + reflection_probe->cull_mask=(1<<20)-1; + reflection_probe->update_mode=VS::REFLECTION_PROBE_UPDATE_ONCE; + + return reflection_probe_owner.make_rid(reflection_probe); +} + +void RasterizerStorageGLES3::reflection_probe_set_update_mode(RID p_probe, VS::ReflectionProbeUpdateMode p_mode) { + + ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); + ERR_FAIL_COND(!reflection_probe); + + reflection_probe->update_mode=p_mode; + reflection_probe->instance_change_notify(); + +} + +void RasterizerStorageGLES3::reflection_probe_set_intensity(RID p_probe, float p_intensity) { + + ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); + ERR_FAIL_COND(!reflection_probe); + + reflection_probe->intensity=p_intensity; + +} + +void RasterizerStorageGLES3::reflection_probe_set_interior_ambient(RID p_probe, const Color& p_ambient) { + + ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); + ERR_FAIL_COND(!reflection_probe); + + reflection_probe->interior_ambient=p_ambient; + +} + +void RasterizerStorageGLES3::reflection_probe_set_interior_ambient_energy(RID p_probe, float p_energy) { + + ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); + ERR_FAIL_COND(!reflection_probe); + + reflection_probe->interior_ambient_energy=p_energy; + +} + +void RasterizerStorageGLES3::reflection_probe_set_interior_ambient_probe_contribution(RID p_probe, float p_contrib) { + + ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); + ERR_FAIL_COND(!reflection_probe); + + reflection_probe->interior_ambient_probe_contrib=p_contrib; + +} + + +void RasterizerStorageGLES3::reflection_probe_set_max_distance(RID p_probe, float p_distance){ + + ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); + ERR_FAIL_COND(!reflection_probe); + + reflection_probe->max_distance=p_distance; + reflection_probe->instance_change_notify(); + +} +void RasterizerStorageGLES3::reflection_probe_set_extents(RID p_probe, const Vector3& p_extents){ + + ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); + ERR_FAIL_COND(!reflection_probe); + + reflection_probe->extents=p_extents; + reflection_probe->instance_change_notify(); + +} +void RasterizerStorageGLES3::reflection_probe_set_origin_offset(RID p_probe, const Vector3& p_offset){ + + ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); + ERR_FAIL_COND(!reflection_probe); + + reflection_probe->origin_offset=p_offset; + reflection_probe->instance_change_notify(); + +} + +void RasterizerStorageGLES3::reflection_probe_set_as_interior(RID p_probe, bool p_enable){ + + ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); + ERR_FAIL_COND(!reflection_probe); + + reflection_probe->interior=p_enable; + +} +void RasterizerStorageGLES3::reflection_probe_set_enable_box_projection(RID p_probe, bool p_enable){ + + ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); + ERR_FAIL_COND(!reflection_probe); + + reflection_probe->box_projection=p_enable; + +} + +void RasterizerStorageGLES3::reflection_probe_set_enable_shadows(RID p_probe, bool p_enable){ + + ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); + ERR_FAIL_COND(!reflection_probe); + + reflection_probe->enable_shadows=p_enable; + reflection_probe->instance_change_notify(); + +} +void RasterizerStorageGLES3::reflection_probe_set_cull_mask(RID p_probe, uint32_t p_layers){ + + ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); + ERR_FAIL_COND(!reflection_probe); + + reflection_probe->cull_mask=p_layers; + reflection_probe->instance_change_notify(); + +} + +Rect3 RasterizerStorageGLES3::reflection_probe_get_aabb(RID p_probe) const { + const ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); + ERR_FAIL_COND_V(!reflection_probe,Rect3()); + + Rect3 aabb; + aabb.pos=-reflection_probe->extents; + aabb.size=reflection_probe->extents*2.0; + + return aabb; + + +} +VS::ReflectionProbeUpdateMode RasterizerStorageGLES3::reflection_probe_get_update_mode(RID p_probe) const{ + + const ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); + ERR_FAIL_COND_V(!reflection_probe,VS::REFLECTION_PROBE_UPDATE_ALWAYS); + + return reflection_probe->update_mode; +} + +uint32_t RasterizerStorageGLES3::reflection_probe_get_cull_mask(RID p_probe) const { + + const ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); + ERR_FAIL_COND_V(!reflection_probe,0); + + return reflection_probe->cull_mask; + +} + +Vector3 RasterizerStorageGLES3::reflection_probe_get_extents(RID p_probe) const { + + const ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); + ERR_FAIL_COND_V(!reflection_probe,Vector3()); + + return reflection_probe->extents; + +} +Vector3 RasterizerStorageGLES3::reflection_probe_get_origin_offset(RID p_probe) const{ + + const ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); + ERR_FAIL_COND_V(!reflection_probe,Vector3()); + + return reflection_probe->origin_offset; + +} + +bool RasterizerStorageGLES3::reflection_probe_renders_shadows(RID p_probe) const { + + const ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); + ERR_FAIL_COND_V(!reflection_probe,false); + + return reflection_probe->enable_shadows; + +} + +float RasterizerStorageGLES3::reflection_probe_get_origin_max_distance(RID p_probe) const{ + + const ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe); + ERR_FAIL_COND_V(!reflection_probe,0); + + return reflection_probe->max_distance; + +} + +/* ROOM API */ + +RID RasterizerStorageGLES3::room_create(){ + + return RID(); +} +void RasterizerStorageGLES3::room_add_bounds(RID p_room, const PoolVector<Vector2>& p_convex_polygon,float p_height,const Transform& p_transform){ + + +} +void RasterizerStorageGLES3::room_clear_bounds(RID p_room){ + + +} + +/* PORTAL API */ + +// portals are only (x/y) points, forming a convex shape, which its clockwise +// order points outside. (z is 0); + +RID RasterizerStorageGLES3::portal_create(){ + + return RID(); +} +void RasterizerStorageGLES3::portal_set_shape(RID p_portal, const Vector<Point2>& p_shape){ + + +} +void RasterizerStorageGLES3::portal_set_enabled(RID p_portal, bool p_enabled){ + + +} +void RasterizerStorageGLES3::portal_set_disable_distance(RID p_portal, float p_distance){ + + +} +void RasterizerStorageGLES3::portal_set_disabled_color(RID p_portal, const Color& p_color){ + + +} + +RID RasterizerStorageGLES3::gi_probe_create() { + + GIProbe *gip = memnew( GIProbe ); + + gip->bounds=Rect3(Vector3(),Vector3(1,1,1)); + gip->dynamic_range=1.0; + gip->energy=1.0; + gip->interior=false; + gip->compress=false; + gip->version=1; + gip->cell_size=1.0; + + return gi_probe_owner.make_rid(gip); +} + +void RasterizerStorageGLES3::gi_probe_set_bounds(RID p_probe,const Rect3& p_bounds){ + + GIProbe *gip = gi_probe_owner.getornull(p_probe); + ERR_FAIL_COND(!gip); + + gip->bounds=p_bounds; + gip->version++; + gip->instance_change_notify(); +} +Rect3 RasterizerStorageGLES3::gi_probe_get_bounds(RID p_probe) const{ + + const GIProbe *gip = gi_probe_owner.getornull(p_probe); + ERR_FAIL_COND_V(!gip,Rect3()); + + return gip->bounds; +} + +void RasterizerStorageGLES3::gi_probe_set_cell_size(RID p_probe,float p_size) { + + GIProbe *gip = gi_probe_owner.getornull(p_probe); + ERR_FAIL_COND(!gip); + + gip->cell_size=p_size; + gip->version++; + gip->instance_change_notify(); +} + +float RasterizerStorageGLES3::gi_probe_get_cell_size(RID p_probe) const { + + const GIProbe *gip = gi_probe_owner.getornull(p_probe); + ERR_FAIL_COND_V(!gip,0); + + return gip->cell_size; + +} + +void RasterizerStorageGLES3::gi_probe_set_to_cell_xform(RID p_probe,const Transform& p_xform) { + + GIProbe *gip = gi_probe_owner.getornull(p_probe); + ERR_FAIL_COND(!gip); + + gip->to_cell=p_xform; +} + +Transform RasterizerStorageGLES3::gi_probe_get_to_cell_xform(RID p_probe) const { + + const GIProbe *gip = gi_probe_owner.getornull(p_probe); + ERR_FAIL_COND_V(!gip,Transform()); + + return gip->to_cell; + +} + + + +void RasterizerStorageGLES3::gi_probe_set_dynamic_data(RID p_probe,const PoolVector<int>& p_data){ + GIProbe *gip = gi_probe_owner.getornull(p_probe); + ERR_FAIL_COND(!gip); + + gip->dynamic_data=p_data; + gip->version++; + gip->instance_change_notify(); + +} +PoolVector<int> RasterizerStorageGLES3::gi_probe_get_dynamic_data(RID p_probe) const{ + + const GIProbe *gip = gi_probe_owner.getornull(p_probe); + ERR_FAIL_COND_V(!gip,PoolVector<int>()); + + return gip->dynamic_data; +} + +void RasterizerStorageGLES3::gi_probe_set_dynamic_range(RID p_probe,int p_range){ + + GIProbe *gip = gi_probe_owner.getornull(p_probe); + ERR_FAIL_COND(!gip); + + gip->dynamic_range=p_range; + +} +int RasterizerStorageGLES3::gi_probe_get_dynamic_range(RID p_probe) const{ + + const GIProbe *gip = gi_probe_owner.getornull(p_probe); + ERR_FAIL_COND_V(!gip,0); + + return gip->dynamic_range; +} + +void RasterizerStorageGLES3::gi_probe_set_energy(RID p_probe,float p_range){ + + GIProbe *gip = gi_probe_owner.getornull(p_probe); + ERR_FAIL_COND(!gip); + + gip->energy=p_range; + +} + +void RasterizerStorageGLES3::gi_probe_set_interior(RID p_probe,bool p_enable) { + + GIProbe *gip = gi_probe_owner.getornull(p_probe); + ERR_FAIL_COND(!gip); + + gip->interior=p_enable; + +} + +bool RasterizerStorageGLES3::gi_probe_is_interior(RID p_probe) const{ + + const GIProbe *gip = gi_probe_owner.getornull(p_probe); + ERR_FAIL_COND_V(!gip,false); + + return gip->interior; + +} + + +void RasterizerStorageGLES3::gi_probe_set_compress(RID p_probe,bool p_enable) { + + GIProbe *gip = gi_probe_owner.getornull(p_probe); + ERR_FAIL_COND(!gip); + + gip->compress=p_enable; + +} + +bool RasterizerStorageGLES3::gi_probe_is_compressed(RID p_probe) const{ + + const GIProbe *gip = gi_probe_owner.getornull(p_probe); + ERR_FAIL_COND_V(!gip,false); + + return gip->compress; + +} +float RasterizerStorageGLES3::gi_probe_get_energy(RID p_probe) const{ + + const GIProbe *gip = gi_probe_owner.getornull(p_probe); + ERR_FAIL_COND_V(!gip,0); + + return gip->energy; +} + + + +uint32_t RasterizerStorageGLES3::gi_probe_get_version(RID p_probe) { + + const GIProbe *gip = gi_probe_owner.getornull(p_probe); + ERR_FAIL_COND_V(!gip,0); + + return gip->version; +} + +RasterizerStorage::GIProbeCompression RasterizerStorageGLES3::gi_probe_get_dynamic_data_get_preferred_compression() const { + if (config.s3tc_supported) { + return GI_PROBE_S3TC; + } else { + return GI_PROBE_UNCOMPRESSED; + } +} + +RID RasterizerStorageGLES3::gi_probe_dynamic_data_create(int p_width, int p_height, int p_depth, GIProbeCompression p_compression) { + + GIProbeData *gipd = memnew( GIProbeData ); + + gipd->width=p_width; + gipd->height=p_height; + gipd->depth=p_depth; + gipd->compression=p_compression; + + glActiveTexture(GL_TEXTURE0); + glGenTextures(1,&gipd->tex_id); + glBindTexture(GL_TEXTURE_3D,gipd->tex_id); + + int level=0; + int min_size=1; + + if (gipd->compression==GI_PROBE_S3TC) { + min_size=4; + } + + print_line("dyndata create"); + while(true) { + + if (gipd->compression==GI_PROBE_S3TC) { + int size = p_width * p_height * p_depth; + glCompressedTexImage3D(GL_TEXTURE_3D,level,_EXT_COMPRESSED_RGBA_S3TC_DXT5_EXT,p_width,p_height,p_depth,0, size,NULL); + } else { + glTexImage3D(GL_TEXTURE_3D,level,GL_RGBA8,p_width,p_height,p_depth,0,GL_RGBA,GL_UNSIGNED_BYTE,NULL); + } + + if (p_width<=min_size || p_height<=min_size || p_depth<=min_size) + break; + p_width>>=1; + p_height>>=1; + p_depth>>=1; + level++; + } + + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_BASE_LEVEL, 0); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAX_LEVEL, level); + + gipd->levels=level+1; + + return gi_probe_data_owner.make_rid(gipd); +} + +void RasterizerStorageGLES3::gi_probe_dynamic_data_update(RID p_gi_probe_data, int p_depth_slice, int p_slice_count, int p_mipmap, const void *p_data) { + + GIProbeData *gipd = gi_probe_data_owner.getornull(p_gi_probe_data); + ERR_FAIL_COND(!gipd); +/* + Vector<uint8_t> data; + data.resize((gipd->width>>p_mipmap)*(gipd->height>>p_mipmap)*(gipd->depth>>p_mipmap)*4); + + for(int i=0;i<(gipd->width>>p_mipmap);i++) { + for(int j=0;j<(gipd->height>>p_mipmap);j++) { + for(int k=0;k<(gipd->depth>>p_mipmap);k++) { + + int ofs = (k*(gipd->height>>p_mipmap)*(gipd->width>>p_mipmap)) + j *(gipd->width>>p_mipmap) + i; + ofs*=4; + data[ofs+0]=i*0xFF/(gipd->width>>p_mipmap); + data[ofs+1]=j*0xFF/(gipd->height>>p_mipmap); + data[ofs+2]=k*0xFF/(gipd->depth>>p_mipmap); + data[ofs+3]=0xFF; + } + } + } +*/ + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_3D,gipd->tex_id); + if (gipd->compression==GI_PROBE_S3TC) { + int size = (gipd->width>>p_mipmap) * (gipd->height>>p_mipmap) * p_slice_count; + glCompressedTexSubImage3D(GL_TEXTURE_3D,p_mipmap,0,0,p_depth_slice,gipd->width>>p_mipmap,gipd->height>>p_mipmap,p_slice_count,_EXT_COMPRESSED_RGBA_S3TC_DXT5_EXT,size, p_data); + } else { + glTexSubImage3D(GL_TEXTURE_3D,p_mipmap,0,0,p_depth_slice,gipd->width>>p_mipmap,gipd->height>>p_mipmap,p_slice_count,GL_RGBA,GL_UNSIGNED_BYTE,p_data); + } + //glTexImage3D(GL_TEXTURE_3D,p_mipmap,GL_RGBA8,gipd->width>>p_mipmap,gipd->height>>p_mipmap,gipd->depth>>p_mipmap,0,GL_RGBA,GL_UNSIGNED_BYTE,p_data); + //glTexImage3D(GL_TEXTURE_3D,p_mipmap,GL_RGBA8,gipd->width>>p_mipmap,gipd->height>>p_mipmap,gipd->depth>>p_mipmap,0,GL_RGBA,GL_UNSIGNED_BYTE,data.ptr()); + +} + +/////// + + + +RID RasterizerStorageGLES3::particles_create() { + + Particles *particles = memnew( Particles ); + + + return particles_owner.make_rid(particles); +} + +void RasterizerStorageGLES3::particles_set_emitting(RID p_particles,bool p_emitting) { + + Particles *particles = particles_owner.getornull(p_particles); + ERR_FAIL_COND(!particles); + particles->emitting=p_emitting; + +} +void RasterizerStorageGLES3::particles_set_amount(RID p_particles,int p_amount) { + + Particles *particles = particles_owner.getornull(p_particles); + ERR_FAIL_COND(!particles); + + int floats = p_amount*24; + float * data = memnew_arr(float,floats); + + for(int i=0;i<floats;i++) { + data[i]=0; + } + + + glBindBuffer(GL_ARRAY_BUFFER,particles->particle_buffers[0]); + glBufferData(GL_ARRAY_BUFFER,floats*sizeof(float),data,GL_DYNAMIC_DRAW); + + glBindBuffer(GL_ARRAY_BUFFER,particles->particle_buffers[1]); + glBufferData(GL_ARRAY_BUFFER,floats*sizeof(float),data,GL_DYNAMIC_DRAW); + + glBindBuffer(GL_ARRAY_BUFFER,0); + + particles->prev_ticks=0; + particles->phase=0; + particles->prev_phase=0; + + memdelete_arr(data); + +} + +void RasterizerStorageGLES3::particles_set_lifetime(RID p_particles,float p_lifetime){ + + Particles *particles = particles_owner.getornull(p_particles); + ERR_FAIL_COND(!particles); + particles->lifetime=p_lifetime; +} +void RasterizerStorageGLES3::particles_set_pre_process_time(RID p_particles,float p_time) { + + Particles *particles = particles_owner.getornull(p_particles); + ERR_FAIL_COND(!particles); + particles->pre_process_time=p_time; + +} +void RasterizerStorageGLES3::particles_set_explosiveness_ratio(RID p_particles,float p_ratio) { + + Particles *particles = particles_owner.getornull(p_particles); + ERR_FAIL_COND(!particles); + particles->explosiveness=p_ratio; +} +void RasterizerStorageGLES3::particles_set_randomness_ratio(RID p_particles,float p_ratio) { + + Particles *particles = particles_owner.getornull(p_particles); + ERR_FAIL_COND(!particles); + particles->randomness=p_ratio; + +} +void RasterizerStorageGLES3::particles_set_custom_aabb(RID p_particles,const Rect3& p_aabb) { + + Particles *particles = particles_owner.getornull(p_particles); + ERR_FAIL_COND(!particles); + particles->custom_aabb=p_aabb; + +} +void RasterizerStorageGLES3::particles_set_gravity(RID p_particles,const Vector3& p_gravity) { + + Particles *particles = particles_owner.getornull(p_particles); + ERR_FAIL_COND(!particles); + + particles->gravity=p_gravity; + +} +void RasterizerStorageGLES3::particles_set_use_local_coordinates(RID p_particles,bool p_enable) { + + Particles *particles = particles_owner.getornull(p_particles); + ERR_FAIL_COND(!particles); + + particles->use_local_coords=p_enable; +} +void RasterizerStorageGLES3::particles_set_process_material(RID p_particles,RID p_material) { + + Particles *particles = particles_owner.getornull(p_particles); + ERR_FAIL_COND(!particles); + + particles->process_material=p_material; +} + +void RasterizerStorageGLES3::particles_set_emission_shape(RID p_particles, VS::ParticlesEmissionShape p_shape) { + + Particles *particles = particles_owner.getornull(p_particles); + ERR_FAIL_COND(!particles); + + particles->emission_shape=p_shape; +} +void RasterizerStorageGLES3::particles_set_emission_sphere_radius(RID p_particles,float p_radius) { + + Particles *particles = particles_owner.getornull(p_particles); + ERR_FAIL_COND(!particles); + + particles->emission_sphere_radius=p_radius; +} +void RasterizerStorageGLES3::particles_set_emission_box_extents(RID p_particles,const Vector3& p_extents) { + + Particles *particles = particles_owner.getornull(p_particles); + ERR_FAIL_COND(!particles); + + particles->emission_box_extents=p_extents; +} +void RasterizerStorageGLES3::particles_set_emission_points(RID p_particles,const PoolVector<Vector3>& p_points) { + + Particles *particles = particles_owner.getornull(p_particles); + ERR_FAIL_COND(!particles); + + particles->emission_points=p_points; +} + + +void RasterizerStorageGLES3::particles_set_draw_order(RID p_particles,VS::ParticlesDrawOrder p_order) { + + Particles *particles = particles_owner.getornull(p_particles); + ERR_FAIL_COND(!particles); + + particles->draw_order=p_order; +} + +void RasterizerStorageGLES3::particles_set_draw_passes(RID p_particles,int p_count) { + + Particles *particles = particles_owner.getornull(p_particles); + ERR_FAIL_COND(!particles); + + particles->draw_passes.resize(p_count); +} +void RasterizerStorageGLES3::particles_set_draw_pass_material(RID p_particles,int p_pass, RID p_material) { + + Particles *particles = particles_owner.getornull(p_particles); + ERR_FAIL_COND(!particles); + ERR_FAIL_INDEX(p_pass,particles->draw_passes.size()); + particles->draw_passes[p_pass].material=p_material; + +} +void RasterizerStorageGLES3::particles_set_draw_pass_mesh(RID p_particles,int p_pass, RID p_mesh) { + + Particles *particles = particles_owner.getornull(p_particles); + ERR_FAIL_COND(!particles); + ERR_FAIL_INDEX(p_pass,particles->draw_passes.size()); + particles->draw_passes[p_pass].mesh=p_mesh; + +} + +Rect3 RasterizerStorageGLES3::particles_get_current_aabb(RID p_particles) { + + const Particles *particles = particles_owner.getornull(p_particles); + ERR_FAIL_COND_V(!particles,Rect3()); + + return particles->computed_aabb; +} + +void RasterizerStorageGLES3::update_particles() { + + glEnable(GL_RASTERIZER_DISCARD); + glBindVertexArray(0); + + + while (particle_update_list.first()) { + + //use transform feedback to process particles + + Particles *particles = particle_update_list.first()->self(); + + + Material *material = material_owner.getornull(particles->process_material); + if (!material || !material->shader || material->shader->mode!=VS::SHADER_PARTICLES) { + + shaders.particles.set_custom_shader(0); + } else { + shaders.particles.set_custom_shader( material->shader->custom_code_id ); + + if (material->ubo_id) { + + glBindBufferBase(GL_UNIFORM_BUFFER,0,material->ubo_id); + } + + int tc = material->textures.size(); + RID* textures = material->textures.ptr(); + ShaderLanguage::ShaderNode::Uniform::Hint* texture_hints = material->shader->texture_hints.ptr(); + + + for(int i=0;i<tc;i++) { + + glActiveTexture(GL_TEXTURE0+i); + + GLenum target; + GLuint tex; + + RasterizerStorageGLES3::Texture *t = texture_owner.getornull( textures[i] ); + + if (!t) { + //check hints + target=GL_TEXTURE_2D; + + switch(texture_hints[i]) { + case ShaderLanguage::ShaderNode::Uniform::HINT_BLACK_ALBEDO: + case ShaderLanguage::ShaderNode::Uniform::HINT_BLACK: { + tex=resources.black_tex; + } break; + case ShaderLanguage::ShaderNode::Uniform::HINT_ANISO: { + tex=resources.aniso_tex; + } break; + case ShaderLanguage::ShaderNode::Uniform::HINT_NORMAL: { + tex=resources.normal_tex; + } break; + default: { + tex=resources.white_tex; + } break; + } + + + } else { + + target=t->target; + tex = t->tex_id; + + } + + glBindTexture(target,tex); + } + + } + + shaders.particles.bind(); + + shaders.particles.set_uniform(ParticlesShaderGLES3::ORIGIN,particles->origin); + + float new_phase = Math::fmod(particles->phase+(frame.delta/particles->lifetime),1.0); + + shaders.particles.set_uniform(ParticlesShaderGLES3::SYSTEM_PHASE,new_phase); + shaders.particles.set_uniform(ParticlesShaderGLES3::PREV_SYSTEM_PHASE,particles->phase); + particles->phase = new_phase; + + shaders.particles.set_uniform(ParticlesShaderGLES3::TOTAL_PARTICLES,particles->amount); + shaders.particles.set_uniform(ParticlesShaderGLES3::TIME,0.0); + shaders.particles.set_uniform(ParticlesShaderGLES3::EXPLOSIVENESS,particles->explosiveness); + shaders.particles.set_uniform(ParticlesShaderGLES3::DELTA,frame.delta); + shaders.particles.set_uniform(ParticlesShaderGLES3::GRAVITY,particles->gravity); + shaders.particles.set_uniform(ParticlesShaderGLES3::ATTRACTOR_COUNT,0); + + + + + glBindBuffer(GL_ARRAY_BUFFER,particles->particle_buffers[0]); + glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, particles->particle_buffers[1]); + + for(int i=0;i<6;i++) { + glEnableVertexAttribArray(i); + glVertexAttribPointer(i,4,GL_FLOAT,GL_FALSE,sizeof(float)*4*6,((uint8_t*)0)+(i*16)); + } + + + glBeginTransformFeedback(GL_POINTS); + glDrawArrays(GL_POINTS,0,particles->amount); + glEndTransformFeedback(); + + particle_update_list.remove(particle_update_list.first()); + + SWAP(particles->particle_buffers[0],particles->particle_buffers[1]); + } + + glDisable(GL_RASTERIZER_DISCARD); + + for(int i=0;i<6;i++) { + glDisableVertexAttribArray(i); + } + +} + +//////// + +void RasterizerStorageGLES3::instance_add_skeleton(RID p_skeleton,RasterizerScene::InstanceBase *p_instance) { + + Skeleton *skeleton = skeleton_owner.getornull(p_skeleton); + ERR_FAIL_COND(!skeleton); + + skeleton->instances.insert(p_instance); +} + +void RasterizerStorageGLES3::instance_remove_skeleton(RID p_skeleton,RasterizerScene::InstanceBase *p_instance) { + + Skeleton *skeleton = skeleton_owner.getornull(p_skeleton); + ERR_FAIL_COND(!skeleton); + + skeleton->instances.erase(p_instance); +} + + +void RasterizerStorageGLES3::instance_add_dependency(RID p_base,RasterizerScene::InstanceBase *p_instance) { + + Instantiable *inst=NULL; + switch(p_instance->base_type) { + case VS::INSTANCE_MESH: { + inst = mesh_owner.getornull(p_base); + ERR_FAIL_COND(!inst); + } break; + case VS::INSTANCE_MULTIMESH: { + inst = multimesh_owner.getornull(p_base); + ERR_FAIL_COND(!inst); + } break; + case VS::INSTANCE_IMMEDIATE: { + inst = immediate_owner.getornull(p_base); + ERR_FAIL_COND(!inst); + } break; + case VS::INSTANCE_REFLECTION_PROBE: { + inst = reflection_probe_owner.getornull(p_base); + ERR_FAIL_COND(!inst); + } break; + case VS::INSTANCE_LIGHT: { + inst = light_owner.getornull(p_base); + ERR_FAIL_COND(!inst); + } break; + case VS::INSTANCE_GI_PROBE: { + inst = gi_probe_owner.getornull(p_base); + ERR_FAIL_COND(!inst); + } break; + default: { + if (!inst) { + ERR_FAIL(); + } + } + } + + inst->instance_list.add( &p_instance->dependency_item ); +} + +void RasterizerStorageGLES3::instance_remove_dependency(RID p_base,RasterizerScene::InstanceBase *p_instance){ + + Instantiable *inst=NULL; + + switch(p_instance->base_type) { + case VS::INSTANCE_MESH: { + inst = mesh_owner.getornull(p_base); + ERR_FAIL_COND(!inst); + } break; + case VS::INSTANCE_MULTIMESH: { + inst = multimesh_owner.getornull(p_base); + ERR_FAIL_COND(!inst); + } break; + case VS::INSTANCE_IMMEDIATE: { + inst = immediate_owner.getornull(p_base); + ERR_FAIL_COND(!inst); + } break; + case VS::INSTANCE_REFLECTION_PROBE: { + inst = reflection_probe_owner.getornull(p_base); + ERR_FAIL_COND(!inst); + } break; + case VS::INSTANCE_LIGHT: { + inst = light_owner.getornull(p_base); + ERR_FAIL_COND(!inst); + } break; + case VS::INSTANCE_GI_PROBE: { + inst = gi_probe_owner.getornull(p_base); + ERR_FAIL_COND(!inst); + } break; + default: { + + if (!inst) { + ERR_FAIL(); + } + } + } + + ERR_FAIL_COND(!inst); + + inst->instance_list.remove( &p_instance->dependency_item ); +} + + +/* RENDER TARGET */ + + +void RasterizerStorageGLES3::_render_target_clear(RenderTarget *rt) { + + if (rt->fbo) { + glDeleteFramebuffers(1,&rt->fbo); + glDeleteTextures(1,&rt->color); + rt->fbo=0; + } + + if (rt->buffers.fbo) { + glDeleteFramebuffers(1,&rt->buffers.fbo); + glDeleteRenderbuffers(1,&rt->buffers.depth); + glDeleteRenderbuffers(1,&rt->buffers.diffuse); + glDeleteRenderbuffers(1,&rt->buffers.specular); + glDeleteRenderbuffers(1,&rt->buffers.normal_rough); + glDeleteRenderbuffers(1,&rt->buffers.motion_sss); + glDeleteFramebuffers(1,&rt->buffers.effect_fbo); + glDeleteTextures(1,&rt->buffers.effect); + + rt->buffers.fbo=0; + } + + if (rt->depth) { + glDeleteTextures(1,&rt->depth); + rt->depth=0; + } + + if (rt->effects.ssao.blur_fbo[0]) { + glDeleteFramebuffers(1,&rt->effects.ssao.blur_fbo[0]); + glDeleteTextures(1,&rt->effects.ssao.blur_red[0]); + glDeleteFramebuffers(1,&rt->effects.ssao.blur_fbo[1]); + glDeleteTextures(1,&rt->effects.ssao.blur_red[1]); + for(int i=0;i<rt->effects.ssao.depth_mipmap_fbos.size();i++) { + glDeleteFramebuffers(1,&rt->effects.ssao.depth_mipmap_fbos[i]); + } + + rt->effects.ssao.depth_mipmap_fbos.clear(); + + glDeleteTextures(1,&rt->effects.ssao.linear_depth); + } + + if (rt->exposure.fbo) { + glDeleteFramebuffers(1,&rt->exposure.fbo); + glDeleteTextures(1,&rt->exposure.color); + } + Texture *tex = texture_owner.get(rt->texture); + tex->alloc_height=0; + tex->alloc_width=0; + tex->width=0; + tex->height=0; + + for(int i=0;i<2;i++) { + for(int j=0;j<rt->effects.mip_maps[i].sizes.size();j++) { + glDeleteFramebuffers(1,&rt->effects.mip_maps[i].sizes[j].fbo); + } + + glDeleteTextures(1,&rt->effects.mip_maps[i].color); + rt->effects.mip_maps[i].sizes.clear(); + rt->effects.mip_maps[i].levels=0; + } +/* + if (rt->effects.screen_space_depth) { + glDeleteTextures(1,&rt->effects.screen_space_depth); + rt->effects.screen_space_depth=0; + + } +*/ +} + +void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt){ + + if (rt->width<=0 || rt->height<=0) + return; + + + GLuint color_internal_format; + GLuint color_format; + GLuint color_type; + Image::Format image_format; + + + + if (!rt->flags[RENDER_TARGET_HDR] || rt->flags[RENDER_TARGET_NO_3D]) { + + color_internal_format=GL_RGBA8; + color_format=GL_RGBA; + color_type=GL_UNSIGNED_BYTE; + image_format=Image::FORMAT_RGBA8; + } else { + color_internal_format=GL_RGBA16F; + color_format=GL_RGBA; + color_type=GL_HALF_FLOAT; + image_format=Image::FORMAT_RGBAH; + } + + + { + /* FRONT FBO */ + + glActiveTexture(GL_TEXTURE0); + + glGenFramebuffers(1, &rt->fbo); + glBindFramebuffer(GL_FRAMEBUFFER, rt->fbo); + + + glGenTextures(1, &rt->depth); + glBindTexture(GL_TEXTURE_2D, rt->depth); + glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, rt->width, rt->height, 0, + GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, + GL_TEXTURE_2D, rt->depth, 0); + + glGenTextures(1, &rt->color); + glBindTexture(GL_TEXTURE_2D, rt->color); + + glTexImage2D(GL_TEXTURE_2D, 0, color_internal_format, rt->width, rt->height, 0, color_format, color_type, NULL); + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->color, 0); + + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + glBindFramebuffer(GL_FRAMEBUFFER, config.system_fbo); + + ERR_FAIL_COND( status != GL_FRAMEBUFFER_COMPLETE ); + + Texture *tex = texture_owner.get(rt->texture); + tex->format=image_format; + tex->gl_format_cache=color_format; + tex->gl_type_cache=color_type; + tex->gl_internal_format_cache=color_internal_format; + tex->tex_id=rt->color; + tex->width=rt->width; + tex->alloc_width=rt->width; + tex->height=rt->height; + tex->alloc_height=rt->height; + + + texture_set_flags(rt->texture,tex->flags); + + } + + + /* BACK FBO */ + + if (config.render_arch==RENDER_ARCH_DESKTOP && !rt->flags[RENDER_TARGET_NO_3D]) { + + + + static const int msaa_value[]={0,2,4,8,16}; + int msaa=msaa_value[rt->msaa]; + + //regular fbo + glGenFramebuffers(1, &rt->buffers.fbo); + glBindFramebuffer(GL_FRAMEBUFFER, rt->buffers.fbo); + + glGenRenderbuffers(1, &rt->buffers.depth); + glBindRenderbuffer(GL_RENDERBUFFER, rt->buffers.depth); + if (msaa==0) + glRenderbufferStorage(GL_RENDERBUFFER,GL_DEPTH24_STENCIL8,rt->width,rt->height); + else + glRenderbufferStorageMultisample(GL_RENDERBUFFER,msaa,GL_DEPTH24_STENCIL8,rt->width,rt->height); + + glFramebufferRenderbuffer(GL_FRAMEBUFFER,GL_DEPTH_ATTACHMENT,GL_RENDERBUFFER,rt->buffers.depth); + + glGenRenderbuffers(1, &rt->buffers.diffuse); + glBindRenderbuffer(GL_RENDERBUFFER, rt->buffers.diffuse); + + if (msaa==0) + glRenderbufferStorage(GL_RENDERBUFFER,color_internal_format,rt->width,rt->height); + else + glRenderbufferStorageMultisample(GL_RENDERBUFFER,msaa,GL_RGBA16F,rt->width,rt->height); + + glFramebufferRenderbuffer(GL_FRAMEBUFFER,GL_COLOR_ATTACHMENT0,GL_RENDERBUFFER,rt->buffers.diffuse); + + glGenRenderbuffers(1, &rt->buffers.specular); + glBindRenderbuffer(GL_RENDERBUFFER, rt->buffers.specular); + + if (msaa==0) + glRenderbufferStorage(GL_RENDERBUFFER,GL_RGBA16F,rt->width,rt->height); + else + glRenderbufferStorageMultisample(GL_RENDERBUFFER,msaa,color_internal_format,rt->width,rt->height); + + glFramebufferRenderbuffer(GL_FRAMEBUFFER,GL_COLOR_ATTACHMENT1,GL_RENDERBUFFER,rt->buffers.specular); + + glGenRenderbuffers(1, &rt->buffers.normal_rough); + glBindRenderbuffer(GL_RENDERBUFFER, rt->buffers.normal_rough); + + if (msaa==0) + glRenderbufferStorage(GL_RENDERBUFFER,GL_RGBA8,rt->width,rt->height); + else + glRenderbufferStorageMultisample(GL_RENDERBUFFER,msaa,GL_RGBA8,rt->width,rt->height); + + glFramebufferRenderbuffer(GL_FRAMEBUFFER,GL_COLOR_ATTACHMENT2,GL_RENDERBUFFER,rt->buffers.normal_rough); + + + glGenRenderbuffers(1, &rt->buffers.motion_sss); + glBindRenderbuffer(GL_RENDERBUFFER, rt->buffers.motion_sss); + + if (msaa==0) + glRenderbufferStorage(GL_RENDERBUFFER,GL_RGBA8,rt->width,rt->height); + else + glRenderbufferStorageMultisample(GL_RENDERBUFFER,msaa,GL_RGBA8,rt->width,rt->height); + + glFramebufferRenderbuffer(GL_FRAMEBUFFER,GL_COLOR_ATTACHMENT3,GL_RENDERBUFFER,rt->buffers.motion_sss); + + + + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + glBindFramebuffer(GL_FRAMEBUFFER, config.system_fbo); + + if (status != GL_FRAMEBUFFER_COMPLETE) { + printf("err status: %x\n",status); + _render_target_clear(rt); + ERR_FAIL_COND( status != GL_FRAMEBUFFER_COMPLETE ); + } + + glBindRenderbuffer(GL_RENDERBUFFER,0); + + // effect resolver + + glGenFramebuffers(1, &rt->buffers.effect_fbo); + glBindFramebuffer(GL_FRAMEBUFFER, rt->buffers.effect_fbo); + + glGenTextures(1, &rt->buffers.effect); + glBindTexture(GL_TEXTURE_2D, rt->buffers.effect); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, rt->width, rt->height, 0, + GL_RGBA, GL_UNSIGNED_BYTE, NULL); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, + GL_TEXTURE_2D, rt->buffers.effect, 0); + + + if (status != GL_FRAMEBUFFER_COMPLETE) { + printf("err status: %x\n",status); + _render_target_clear(rt); + ERR_FAIL_COND( status != GL_FRAMEBUFFER_COMPLETE ); + } + + glBindFramebuffer(GL_FRAMEBUFFER, config.system_fbo); + + if (status != GL_FRAMEBUFFER_COMPLETE) { + _render_target_clear(rt); + ERR_FAIL_COND( status != GL_FRAMEBUFFER_COMPLETE ); + } + + for(int i=0;i<2;i++) { + + ERR_FAIL_COND( rt->effects.mip_maps[i].sizes.size() ); + int w=rt->width; + int h=rt->height; + + + if (i>0) { + w>>=1; + h>>=1; + } + + + glGenTextures(1, &rt->effects.mip_maps[i].color); + glBindTexture(GL_TEXTURE_2D, rt->effects.mip_maps[i].color); + + int level=0; + + while(true) { + + RenderTarget::Effects::MipMaps::Size mm; + + glTexImage2D(GL_TEXTURE_2D, level, color_internal_format, w, h, 0, color_format, color_type, NULL); + mm.width=w; + mm.height=h; + rt->effects.mip_maps[i].sizes.push_back(mm); + + w>>=1; + h>>=1; + + if (w<2 || h<2) + break; + + level++; + + } + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, level); + + + for(int j=0;j<rt->effects.mip_maps[i].sizes.size();j++) { + + RenderTarget::Effects::MipMaps::Size &mm=rt->effects.mip_maps[i].sizes[j]; + + glGenFramebuffers(1, &mm.fbo); + glBindFramebuffer(GL_FRAMEBUFFER, mm.fbo); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,rt->effects.mip_maps[i].color ,j); + + status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + if (status != GL_FRAMEBUFFER_COMPLETE) { + _render_target_clear(rt); + ERR_FAIL_COND( status != GL_FRAMEBUFFER_COMPLETE ); + } + + + float zero[4]={1,0,1,0}; + glClearBufferfv(GL_COLOR,0,zero); + + + } + + glBindFramebuffer(GL_FRAMEBUFFER, config.system_fbo); + rt->effects.mip_maps[i].levels=level; + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); + //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + + } + ///////////////// ssao + + //AO strength textures + for(int i=0;i<2;i++) { + + glGenFramebuffers(1, &rt->effects.ssao.blur_fbo[i]); + glBindFramebuffer(GL_FRAMEBUFFER, rt->effects.ssao.blur_fbo[i]); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, + GL_TEXTURE_2D, rt->depth, 0); + + glGenTextures(1, &rt->effects.ssao.blur_red[i]); + glBindTexture(GL_TEXTURE_2D, rt->effects.ssao.blur_red[i]); + + glTexImage2D(GL_TEXTURE_2D, 0, GL_R8, rt->width, rt->height, 0, GL_RED, GL_UNSIGNED_BYTE, NULL); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->effects.ssao.blur_red[i], 0); + + status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + if (status != GL_FRAMEBUFFER_COMPLETE) { + _render_target_clear(rt); + ERR_FAIL_COND( status != GL_FRAMEBUFFER_COMPLETE ); + } + + } + //5 mip levels for depth texture, but base is read separately + + glGenTextures(1, &rt->effects.ssao.linear_depth); + glBindTexture(GL_TEXTURE_2D, rt->effects.ssao.linear_depth); + + int ssao_w=rt->width/2; + int ssao_h=rt->height/2; + + + for(int i=0;i<4;i++) { //5, but 4 mips, base is read directly to save bw + + glTexImage2D(GL_TEXTURE_2D, i, GL_R16UI, ssao_w, ssao_h, 0, GL_RED_INTEGER, GL_UNSIGNED_SHORT, NULL); + ssao_w>>=1; + ssao_h>>=1; + } + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 3); + + for(int i=0;i<4;i++) { //5, but 4 mips, base is read directly to save bw + + GLuint fbo; + glGenFramebuffers(1, &fbo); + glBindFramebuffer(GL_FRAMEBUFFER, fbo); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->effects.ssao.linear_depth, i); + rt->effects.ssao.depth_mipmap_fbos.push_back(fbo); + } + + + //////Exposure + + glGenFramebuffers(1, &rt->exposure.fbo); + glBindFramebuffer(GL_FRAMEBUFFER, rt->exposure.fbo); + + glGenTextures(1, &rt->exposure.color); + glBindTexture(GL_TEXTURE_2D, rt->exposure.color); + glTexImage2D(GL_TEXTURE_2D, 0, GL_R32F, 1, 1, 0, GL_RED, GL_FLOAT, NULL); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->exposure.color, 0); + + status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + if (status != GL_FRAMEBUFFER_COMPLETE) { + _render_target_clear(rt); + ERR_FAIL_COND( status != GL_FRAMEBUFFER_COMPLETE ); + } + + } +} + + +RID RasterizerStorageGLES3::render_target_create(){ + + RenderTarget *rt = memnew( RenderTarget ); + + Texture * t = memnew( Texture ); + + t->flags=0; + t->width=0; + t->height=0; + t->alloc_height=0; + t->alloc_width=0; + t->format=Image::FORMAT_R8; + t->target=GL_TEXTURE_2D; + t->gl_format_cache=0; + t->gl_internal_format_cache=0; + t->gl_type_cache=0; + t->data_size=0; + t->compressed=false; + t->srgb=false; + t->total_data_size=0; + t->ignore_mipmaps=false; + t->mipmaps=0; + t->active=true; + t->tex_id=0; + + + rt->texture=texture_owner.make_rid(t); + + return render_target_owner.make_rid(rt); +} + +void RasterizerStorageGLES3::render_target_set_size(RID p_render_target,int p_width, int p_height){ + + RenderTarget *rt = render_target_owner.getornull(p_render_target); + ERR_FAIL_COND(!rt); + + if (rt->width==p_width && rt->height==p_height) + return; + + _render_target_clear(rt); + rt->width=p_width; + rt->height=p_height; + _render_target_allocate(rt); + +} + + +RID RasterizerStorageGLES3::render_target_get_texture(RID p_render_target) const{ + + RenderTarget *rt = render_target_owner.getornull(p_render_target); + ERR_FAIL_COND_V(!rt,RID()); + + return rt->texture; +} + +void RasterizerStorageGLES3::render_target_set_flag(RID p_render_target,RenderTargetFlags p_flag,bool p_value) { + + RenderTarget *rt = render_target_owner.getornull(p_render_target); + ERR_FAIL_COND(!rt); + + rt->flags[p_flag]=p_value; + + switch(p_flag) { + case RENDER_TARGET_NO_3D: + case RENDER_TARGET_TRANSPARENT: { + //must reset for these formats + _render_target_clear(rt); + _render_target_allocate(rt); + + } break; + default: {} + } +} + +bool RasterizerStorageGLES3::render_target_renedered_in_frame(RID p_render_target){ + + return false; +} + +void RasterizerStorageGLES3::render_target_set_msaa(RID p_render_target,VS::ViewportMSAA p_msaa) { + + RenderTarget *rt = render_target_owner.getornull(p_render_target); + ERR_FAIL_COND(!rt); + + if (rt->msaa==p_msaa) + return; + + _render_target_clear(rt); + rt->msaa=p_msaa; + _render_target_allocate(rt); + +} + +/* CANVAS SHADOW */ + + +RID RasterizerStorageGLES3::canvas_light_shadow_buffer_create(int p_width) { + + CanvasLightShadow *cls = memnew( CanvasLightShadow ); + if (p_width>config.max_texture_size) + p_width=config.max_texture_size; + + cls->size=p_width; + cls->height=16; + + glActiveTexture(GL_TEXTURE0); + + glGenFramebuffers(1, &cls->fbo); + glBindFramebuffer(GL_FRAMEBUFFER, cls->fbo); + + glGenRenderbuffers(1, &cls->depth); + glBindRenderbuffer(GL_RENDERBUFFER, cls->depth ); + glRenderbufferStorage(GL_RENDERBUFFER,GL_DEPTH_COMPONENT24, cls->size, cls->height); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, cls->depth); + glBindRenderbuffer(GL_RENDERBUFFER, 0 ); + + glGenTextures(1,&cls->distance); + glBindTexture(GL_TEXTURE_2D, cls->distance); + if (config.use_rgba_2d_shadows) { + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, cls->size, cls->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); + } else { + glTexImage2D(GL_TEXTURE_2D, 0, GL_R32F, cls->size, cls->height, 0, GL_RED, GL_FLOAT, NULL); + } + + + + + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, cls->distance, 0); + + + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + //printf("errnum: %x\n",status); + glBindFramebuffer(GL_FRAMEBUFFER, config.system_fbo); + + ERR_FAIL_COND_V( status != GL_FRAMEBUFFER_COMPLETE, RID() ); + + return canvas_light_shadow_owner.make_rid(cls); +} + +/* LIGHT SHADOW MAPPING */ + + +RID RasterizerStorageGLES3::canvas_light_occluder_create() { + + CanvasOccluder *co = memnew( CanvasOccluder ); + co->index_id=0; + co->vertex_id=0; + co->len=0; + + return canvas_occluder_owner.make_rid(co); +} + +void RasterizerStorageGLES3::canvas_light_occluder_set_polylines(RID p_occluder, const PoolVector<Vector2>& p_lines) { + + CanvasOccluder *co = canvas_occluder_owner.get(p_occluder); + ERR_FAIL_COND(!co); + + co->lines=p_lines; + + if (p_lines.size()!=co->len) { + + if (co->index_id) + glDeleteBuffers(1,&co->index_id); + if (co->vertex_id) + glDeleteBuffers(1,&co->vertex_id); + + co->index_id=0; + co->vertex_id=0; + co->len=0; + + } + + if (p_lines.size()) { + + + + PoolVector<float> geometry; + PoolVector<uint16_t> indices; + int lc = p_lines.size(); + + geometry.resize(lc*6); + indices.resize(lc*3); + + PoolVector<float>::Write vw=geometry.write(); + PoolVector<uint16_t>::Write iw=indices.write(); + + + PoolVector<Vector2>::Read lr=p_lines.read(); + + const int POLY_HEIGHT = 16384; + + for(int i=0;i<lc/2;i++) { + + vw[i*12+0]=lr[i*2+0].x; + vw[i*12+1]=lr[i*2+0].y; + vw[i*12+2]=POLY_HEIGHT; + + vw[i*12+3]=lr[i*2+1].x; + vw[i*12+4]=lr[i*2+1].y; + vw[i*12+5]=POLY_HEIGHT; + + vw[i*12+6]=lr[i*2+1].x; + vw[i*12+7]=lr[i*2+1].y; + vw[i*12+8]=-POLY_HEIGHT; + + vw[i*12+9]=lr[i*2+0].x; + vw[i*12+10]=lr[i*2+0].y; + vw[i*12+11]=-POLY_HEIGHT; + + iw[i*6+0]=i*4+0; + iw[i*6+1]=i*4+1; + iw[i*6+2]=i*4+2; + + iw[i*6+3]=i*4+2; + iw[i*6+4]=i*4+3; + iw[i*6+5]=i*4+0; + + } + + //if same buffer len is being set, just use BufferSubData to avoid a pipeline flush + + + if (!co->vertex_id) { + glGenBuffers(1,&co->vertex_id); + glBindBuffer(GL_ARRAY_BUFFER,co->vertex_id); + glBufferData(GL_ARRAY_BUFFER,lc*6*sizeof(real_t),vw.ptr(),GL_STATIC_DRAW); + } else { + + glBindBuffer(GL_ARRAY_BUFFER,co->vertex_id); + glBufferSubData(GL_ARRAY_BUFFER,0,lc*6*sizeof(real_t),vw.ptr()); + + } + + glBindBuffer(GL_ARRAY_BUFFER,0); //unbind + + if (!co->index_id) { + + glGenBuffers(1,&co->index_id); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,co->index_id); + glBufferData(GL_ELEMENT_ARRAY_BUFFER,lc*3*sizeof(uint16_t),iw.ptr(),GL_STATIC_DRAW); + } else { + + + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,co->index_id); + glBufferSubData(GL_ELEMENT_ARRAY_BUFFER,0,lc*3*sizeof(uint16_t),iw.ptr()); + } + + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,0); //unbind + + co->len=lc; + + } + +} + +VS::InstanceType RasterizerStorageGLES3::get_base_type(RID p_rid) const { + + if (mesh_owner.owns(p_rid)) { + return VS::INSTANCE_MESH; + } + + if (multimesh_owner.owns(p_rid)) { + return VS::INSTANCE_MULTIMESH; + } + + if (immediate_owner.owns(p_rid)) { + return VS::INSTANCE_IMMEDIATE; + } + + if (light_owner.owns(p_rid)) { + return VS::INSTANCE_LIGHT; + } + + if (reflection_probe_owner.owns(p_rid)) { + return VS::INSTANCE_REFLECTION_PROBE; + } + + if (gi_probe_owner.owns(p_rid)) { + return VS::INSTANCE_GI_PROBE; + } + + return VS::INSTANCE_NONE; +} + +bool RasterizerStorageGLES3::free(RID p_rid){ + + if (render_target_owner.owns(p_rid)) { + + RenderTarget *rt = render_target_owner.getornull(p_rid); + _render_target_clear(rt); + Texture *t=texture_owner.get(rt->texture); + texture_owner.free(rt->texture); + memdelete(t); + render_target_owner.free(p_rid); + memdelete(rt); + + } else if (texture_owner.owns(p_rid)) { + // delete the texture + Texture *texture = texture_owner.get(p_rid); + ERR_FAIL_COND_V(texture->render_target,true); //cant free the render target texture, dude + info.texture_mem-=texture->total_data_size; + texture_owner.free(p_rid); + memdelete(texture); + } else if (skybox_owner.owns(p_rid)) { + // delete the skybox + SkyBox *skybox = skybox_owner.get(p_rid); + skybox_set_texture(p_rid,RID(),256); + skybox_owner.free(p_rid); + memdelete(skybox); + + } else if (shader_owner.owns(p_rid)) { + + // delete the texture + Shader *shader = shader_owner.get(p_rid); + + + if (shader->shader) + shader->shader->free_custom_shader(shader->custom_code_id); + + if (shader->dirty_list.in_list()) + _shader_dirty_list.remove(&shader->dirty_list); + + while (shader->materials.first()) { + + Material *mat = shader->materials.first()->self(); + + mat->shader=NULL; + _material_make_dirty(mat); + + shader->materials.remove( shader->materials.first() ); + } + + //material_shader.free_custom_shader(shader->custom_code_id); + shader_owner.free(p_rid); + memdelete(shader); + + } else if (material_owner.owns(p_rid)) { + + // delete the texture + Material *material = material_owner.get(p_rid); + + if (material->shader) { + material->shader->materials.remove( & material->list ); + } + + if (material->ubo_id) { + glDeleteBuffers(1,&material->ubo_id); + } + + //remove from owners + for (Map<Geometry*,int>::Element *E=material->geometry_owners.front();E;E=E->next()) { + + Geometry *g = E->key(); + g->material=RID(); + } + for (Map<RasterizerScene::InstanceBase*,int>::Element *E=material->instance_owners.front();E;E=E->next()) { + RasterizerScene::InstanceBase*ins=E->key(); + if (ins->material_override==p_rid) { + ins->material_override=RID(); + } + + for(int i=0;i<ins->materials.size();i++) { + if (ins->materials[i]==p_rid) { + ins->materials[i]=RID(); + } + } + + } + + material_owner.free(p_rid); + memdelete(material); + + } else if (skeleton_owner.owns(p_rid)) { + + // delete the texture + Skeleton *skeleton = skeleton_owner.get(p_rid); + if (skeleton->update_list.in_list()) { + skeleton_update_list.remove(&skeleton->update_list); + } + + for (Set<RasterizerScene::InstanceBase*>::Element *E=skeleton->instances.front();E;E=E->next()) { + E->get()->skeleton=RID(); + } + + skeleton_allocate(p_rid,0,false); + skeleton_owner.free(p_rid); + memdelete(skeleton); + + } else if (mesh_owner.owns(p_rid)) { + + // delete the texture + Mesh *mesh = mesh_owner.get(p_rid); + mesh->instance_remove_deps(); + mesh_clear(p_rid); + + mesh_owner.free(p_rid); + memdelete(mesh); + + } else if (multimesh_owner.owns(p_rid)) { + + // delete the texture + MultiMesh *multimesh = multimesh_owner.get(p_rid); + multimesh->instance_remove_deps(); + + multimesh_allocate(p_rid,0,VS::MULTIMESH_TRANSFORM_2D,VS::MULTIMESH_COLOR_NONE); //frees multimesh + update_dirty_multimeshes(); + + multimesh_owner.free(p_rid); + memdelete(multimesh); + } else if (immediate_owner.owns(p_rid)) { + + Immediate *immediate = immediate_owner.get(p_rid); + immediate->instance_remove_deps(); + + immediate_owner.free(p_rid); + memdelete(immediate); + } else if (light_owner.owns(p_rid)) { + + // delete the texture + Light *light = light_owner.get(p_rid); + light->instance_remove_deps(); + + light_owner.free(p_rid); + memdelete(light); + + } else if (reflection_probe_owner.owns(p_rid)) { + + // delete the texture + ReflectionProbe *reflection_probe = reflection_probe_owner.get(p_rid); + reflection_probe->instance_remove_deps(); + + reflection_probe_owner.free(p_rid); + memdelete(reflection_probe); + + } else if (gi_probe_owner.owns(p_rid)) { + + // delete the texture + GIProbe *gi_probe = gi_probe_owner.get(p_rid); + + + gi_probe_owner.free(p_rid); + memdelete(gi_probe); + } else if (gi_probe_data_owner.owns(p_rid)) { + + // delete the texture + GIProbeData *gi_probe_data = gi_probe_data_owner.get(p_rid); + + print_line("dyndata delete"); + glDeleteTextures(1,&gi_probe_data->tex_id); + gi_probe_owner.free(p_rid); + memdelete(gi_probe_data); + + } else if (canvas_occluder_owner.owns(p_rid)) { + + + CanvasOccluder *co = canvas_occluder_owner.get(p_rid); + if (co->index_id) + glDeleteBuffers(1,&co->index_id); + if (co->vertex_id) + glDeleteBuffers(1,&co->vertex_id); + + canvas_occluder_owner.free(p_rid); + memdelete(co); + + } else if (canvas_light_shadow_owner.owns(p_rid)) { + + CanvasLightShadow *cls = canvas_light_shadow_owner.get(p_rid); + glDeleteFramebuffers(1,&cls->fbo); + glDeleteRenderbuffers(1,&cls->depth); + glDeleteTextures(1,&cls->distance); + canvas_light_shadow_owner.free(p_rid); + memdelete(cls); + } else { + return false; + } + + return true; +} + +//////////////////////////////////////////// + + +void RasterizerStorageGLES3::initialize() { + + config.render_arch=RENDER_ARCH_DESKTOP; + //config.fbo_deferred=int(Globals::get_singleton()->get("rendering/gles3/lighting_technique")); + + config.system_fbo=0; + + + //// extensions config + /// + + { + + int max_extensions=0; + print_line("getting extensions"); + glGetIntegerv(GL_NUM_EXTENSIONS,&max_extensions); + print_line("total "+itos(max_extensions)); + for(int i=0;i<max_extensions;i++) { + const GLubyte *s = glGetStringi( GL_EXTENSIONS,i ); + if (!s) + break; + config.extensions.insert((const char*)s); + } + } + + config.shrink_textures_x2=false; + config.use_fast_texture_filter=int(GlobalConfig::get_singleton()->get("rendering/quality/use_nearest_mipmap_filter")); + config.use_anisotropic_filter = config.extensions.has("GL_EXT_texture_filter_anisotropic"); + + config.s3tc_supported=config.extensions.has("GL_EXT_texture_compression_dxt1") || config.extensions.has("GL_EXT_texture_compression_s3tc") || config.extensions.has("WEBGL_compressed_texture_s3tc"); + config.etc_supported=config.extensions.has("GL_OES_compressed_ETC1_RGB8_texture"); + config.latc_supported=config.extensions.has("GL_EXT_texture_compression_latc"); + config.bptc_supported=config.extensions.has("GL_ARB_texture_compression_bptc"); +#ifdef GLES_OVER_GL + config.etc2_supported=false; +#else + config.etc2_supported=true; +#endif + config.pvrtc_supported=config.extensions.has("GL_IMG_texture_compression_pvrtc"); + config.srgb_decode_supported=config.extensions.has("GL_EXT_texture_sRGB_decode"); + + + + config.anisotropic_level=1.0; + config.use_anisotropic_filter=config.extensions.has("GL_EXT_texture_filter_anisotropic"); + if (config.use_anisotropic_filter) { + glGetFloatv(_GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT,&config.anisotropic_level); + config.anisotropic_level=MIN(int(GlobalConfig::get_singleton()->get("rendering/quality/anisotropic_filter_level")),config.anisotropic_level); + } + + + frame.clear_request=false; + + shaders.copy.init(); + + { + //default textures + + + glGenTextures(1, &resources.white_tex); + unsigned char whitetexdata[8*8*3]; + for(int i=0;i<8*8*3;i++) { + whitetexdata[i]=255; + } + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,resources.white_tex); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 8, 8, 0, GL_RGB, GL_UNSIGNED_BYTE,whitetexdata); + glGenerateMipmap(GL_TEXTURE_2D); + glBindTexture(GL_TEXTURE_2D,0); + + glGenTextures(1, &resources.black_tex); + unsigned char blacktexdata[8*8*3]; + for(int i=0;i<8*8*3;i++) { + blacktexdata[i]=0; + } + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,resources.black_tex); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 8, 8, 0, GL_RGB, GL_UNSIGNED_BYTE,blacktexdata); + glGenerateMipmap(GL_TEXTURE_2D); + glBindTexture(GL_TEXTURE_2D,0); + + glGenTextures(1, &resources.normal_tex); + unsigned char normaltexdata[8*8*3]; + for(int i=0;i<8*8*3;i+=3) { + normaltexdata[i+0]=128; + normaltexdata[i+1]=128; + normaltexdata[i+2]=255; + } + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,resources.normal_tex); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 8, 8, 0, GL_RGB, GL_UNSIGNED_BYTE,normaltexdata); + glGenerateMipmap(GL_TEXTURE_2D); + glBindTexture(GL_TEXTURE_2D,0); + + + glGenTextures(1, &resources.aniso_tex); + unsigned char anisotexdata[8*8*3]; + for(int i=0;i<8*8*3;i+=3) { + anisotexdata[i+0]=255; + anisotexdata[i+1]=128; + anisotexdata[i+2]=0; + } + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D,resources.aniso_tex); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 8, 8, 0, GL_RGB, GL_UNSIGNED_BYTE,anisotexdata); + glGenerateMipmap(GL_TEXTURE_2D); + glBindTexture(GL_TEXTURE_2D,0); + + } + + glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS,&config.max_texture_image_units); + glGetIntegerv(GL_MAX_TEXTURE_SIZE,&config.max_texture_size); + +#ifdef GLES_OVER_GL + config.use_rgba_2d_shadows=false; +#else + config.use_rgba_2d_shadows=true; +#endif + + + //generic quadie for copying + + { + //quad buffers + + glGenBuffers(1,&resources.quadie); + glBindBuffer(GL_ARRAY_BUFFER,resources.quadie); + { + const float qv[16]={ + -1,-1, + 0, 0, + -1, 1, + 0, 1, + 1, 1, + 1, 1, + 1,-1, + 1, 0, + }; + + glBufferData(GL_ARRAY_BUFFER,sizeof(float)*16,qv,GL_STATIC_DRAW); + } + + glBindBuffer(GL_ARRAY_BUFFER,0); //unbind + + + glGenVertexArrays(1,&resources.quadie_array); + glBindVertexArray(resources.quadie_array); + glBindBuffer(GL_ARRAY_BUFFER,resources.quadie); + glVertexAttribPointer(VS::ARRAY_VERTEX,2,GL_FLOAT,GL_FALSE,sizeof(float)*4,0); + glEnableVertexAttribArray(0); + glVertexAttribPointer(VS::ARRAY_TEX_UV,2,GL_FLOAT,GL_FALSE,sizeof(float)*4,((uint8_t*)NULL)+8); + glEnableVertexAttribArray(4); + glBindVertexArray(0); + glBindBuffer(GL_ARRAY_BUFFER,0); //unbind + } + + //generic quadie for copying without touching skybox + + { + //transform feedback buffers + uint32_t xf_feedback_size = GLOBAL_DEF("rendering/buffers/blend_shape_max_buffer_size_kb",4096); + for(int i=0;i<2;i++) { + + glGenBuffers(1,&resources.transform_feedback_buffers[i]); + glBindBuffer(GL_ARRAY_BUFFER,resources.transform_feedback_buffers[i]); + glBufferData(GL_ARRAY_BUFFER,xf_feedback_size*1024,NULL,GL_STREAM_DRAW); + } + + shaders.blend_shapes.init();; + + glGenVertexArrays(1,&resources.transform_feedback_array); + + } + + shaders.cubemap_filter.init(); + shaders.particles.init(); + + glEnable(_EXT_TEXTURE_CUBE_MAP_SEAMLESS); + + frame.count=0; + frame.prev_tick=0; + frame.delta=0; + config.keep_original_textures=false; +} + +void RasterizerStorageGLES3::finalize() { + + glDeleteTextures(1, &resources.white_tex); + glDeleteTextures(1, &resources.black_tex); + glDeleteTextures(1, &resources.normal_tex); + +} + + +RasterizerStorageGLES3::RasterizerStorageGLES3() +{ + +} diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h new file mode 100644 index 0000000000..66593b202f --- /dev/null +++ b/drivers/gles3/rasterizer_storage_gles3.h @@ -0,0 +1,1247 @@ +#ifndef RASTERIZERSTORAGEGLES3_H +#define RASTERIZERSTORAGEGLES3_H + +#include "servers/visual/rasterizer.h" +#include "servers/visual/shader_language.h" +#include "shader_gles3.h" +#include "shaders/copy.glsl.h" +#include "shaders/canvas.glsl.h" +#include "shaders/blend_shape.glsl.h" +#include "shaders/cubemap_filter.glsl.h" +#include "shaders/particles.glsl.h" +#include "self_list.h" +#include "shader_compiler_gles3.h" + +class RasterizerCanvasGLES3; +class RasterizerSceneGLES3; + +#define _TEXTURE_SRGB_DECODE_EXT 0x8A48 +#define _DECODE_EXT 0x8A49 +#define _SKIP_DECODE_EXT 0x8A4A + +class RasterizerStorageGLES3 : public RasterizerStorage { +public: + + RasterizerCanvasGLES3 *canvas; + RasterizerSceneGLES3 *scene; + + enum RenderArchitecture { + RENDER_ARCH_MOBILE, + RENDER_ARCH_DESKTOP, + }; + + struct Config { + + RenderArchitecture render_arch; + + GLuint system_fbo; //on some devices, such as apple, screen is rendered to yet another fbo. + + bool shrink_textures_x2; + bool use_fast_texture_filter; + bool use_anisotropic_filter; + + bool s3tc_supported; + bool latc_supported; + bool bptc_supported; + bool etc_supported; + bool etc2_supported; + bool pvrtc_supported; + + bool srgb_decode_supported; + + bool use_rgba_2d_shadows; + + float anisotropic_level; + + int max_texture_image_units; + int max_texture_size; + + Set<String> extensions; + + bool keep_original_textures; + } config; + + mutable struct Shaders { + + CopyShaderGLES3 copy; + + ShaderCompilerGLES3 compiler; + + CubemapFilterShaderGLES3 cubemap_filter; + + BlendShapeShaderGLES3 blend_shapes; + + ParticlesShaderGLES3 particles; + + ShaderCompilerGLES3::IdentifierActions actions_canvas; + ShaderCompilerGLES3::IdentifierActions actions_scene; + ShaderCompilerGLES3::IdentifierActions actions_particles; + } shaders; + + struct Resources { + + GLuint white_tex; + GLuint black_tex; + GLuint normal_tex; + GLuint aniso_tex; + + GLuint quadie; + GLuint quadie_array; + + GLuint transform_feedback_buffers[2]; + GLuint transform_feedback_array; + + } resources; + + struct Info { + + uint64_t texture_mem; + + uint32_t render_object_count; + uint32_t render_material_switch_count; + uint32_t render_surface_switch_count; + uint32_t render_shader_rebind_count; + uint32_t render_vertices_count; + + } info; + + +///////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////DATA/////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////////// + + + + + + + + + + struct Instantiable : public RID_Data { + + SelfList<RasterizerScene::InstanceBase>::List instance_list; + + _FORCE_INLINE_ void instance_change_notify() { + + SelfList<RasterizerScene::InstanceBase> *instances = instance_list.first(); + while(instances) { + + instances->self()->base_changed(); + instances=instances->next(); + } + } + + _FORCE_INLINE_ void instance_material_change_notify() { + + SelfList<RasterizerScene::InstanceBase> *instances = instance_list.first(); + while(instances) { + + instances->self()->base_material_changed(); + instances=instances->next(); + } + } + + _FORCE_INLINE_ void instance_remove_deps() { + SelfList<RasterizerScene::InstanceBase> *instances = instance_list.first(); + while(instances) { + + SelfList<RasterizerScene::InstanceBase> *next = instances->next(); + instances->self()->base_removed(); + instances=next; + } + } + + + Instantiable() { } + virtual ~Instantiable() { + + } + }; + + struct GeometryOwner : public Instantiable { + + virtual ~GeometryOwner() {} + }; + struct Geometry : Instantiable { + + enum Type { + GEOMETRY_INVALID, + GEOMETRY_SURFACE, + GEOMETRY_IMMEDIATE, + GEOMETRY_MULTISURFACE, + }; + + + Type type; + RID material; + uint64_t last_pass; + uint32_t index; + + virtual void material_changed_notify() {} + + Geometry() { + last_pass=0; + index=0; + } + + }; + + + +///////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////API//////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////////// + + + /* TEXTURE API */ + + struct RenderTarget; + + struct Texture : public RID_Data { + + String path; + uint32_t flags; + int width,height; + int alloc_width, alloc_height; + Image::Format format; + + GLenum target; + GLenum gl_format_cache; + GLenum gl_internal_format_cache; + GLenum gl_type_cache; + int data_size; //original data size, useful for retrieving back + bool compressed; + bool srgb; + int total_data_size; + bool ignore_mipmaps; + + int mipmaps; + + bool active; + GLuint tex_id; + + bool using_srgb; + + uint16_t stored_cube_sides; + + RenderTarget *render_target; + + Image images[6]; + + Texture() { + + using_srgb=false; + stored_cube_sides=0; + ignore_mipmaps=false; + render_target=NULL; + flags=width=height=0; + tex_id=0; + data_size=0; + format=Image::FORMAT_L8; + active=false; + compressed=false; + total_data_size=0; + target=GL_TEXTURE_2D; + mipmaps=0; + + } + + ~Texture() { + + if (tex_id!=0) { + + glDeleteTextures(1,&tex_id); + } + } + }; + + mutable RID_Owner<Texture> texture_owner; + + Image _get_gl_image_and_format(const Image& p_image, Image::Format p_format, uint32_t p_flags, GLenum& r_gl_format, GLenum& r_gl_internal_format, GLenum &r_type, bool &r_compressed, bool &srgb); + + virtual RID texture_create(); + virtual void texture_allocate(RID p_texture,int p_width, int p_height,Image::Format p_format,uint32_t p_flags=VS::TEXTURE_FLAGS_DEFAULT); + virtual void texture_set_data(RID p_texture,const Image& p_image,VS::CubeMapSide p_cube_side=VS::CUBEMAP_LEFT); + virtual Image texture_get_data(RID p_texture,VS::CubeMapSide p_cube_side=VS::CUBEMAP_LEFT) const; + virtual void texture_set_flags(RID p_texture,uint32_t p_flags); + virtual uint32_t texture_get_flags(RID p_texture) const; + virtual Image::Format texture_get_format(RID p_texture) const; + virtual uint32_t texture_get_width(RID p_texture) const; + virtual uint32_t texture_get_height(RID p_texture) const; + virtual void texture_set_size_override(RID p_texture,int p_width, int p_height); + + virtual void texture_set_path(RID p_texture,const String& p_path); + virtual String texture_get_path(RID p_texture) const; + + virtual void texture_set_shrink_all_x2_on_set_data(bool p_enable); + + virtual void texture_debug_usage(List<VS::TextureInfo> *r_info); + + virtual RID texture_create_radiance_cubemap(RID p_source,int p_resolution=-1) const; + + virtual void textures_keep_original(bool p_enable); + + /* SKYBOX API */ + + struct SkyBox : public RID_Data { + + RID cubemap; + GLuint radiance; + int radiance_size; + }; + + mutable RID_Owner<SkyBox> skybox_owner; + + virtual RID skybox_create(); + virtual void skybox_set_texture(RID p_skybox,RID p_cube_map,int p_radiance_size); + + /* SHADER API */ + + struct Material; + + struct Shader : public RID_Data { + + RID self; + + VS::ShaderMode mode; + ShaderGLES3 *shader; + String code; + SelfList<Material>::List materials; + + + + Map<StringName,ShaderLanguage::ShaderNode::Uniform> uniforms; + Vector<uint32_t> ubo_offsets; + uint32_t ubo_size; + + uint32_t texture_count; + + uint32_t custom_code_id; + uint32_t version; + + SelfList<Shader> dirty_list; + + Map<StringName,RID> default_textures; + + Vector<ShaderLanguage::ShaderNode::Uniform::Hint> texture_hints; + + bool valid; + + String path; + + struct CanvasItem { + + enum BlendMode { + BLEND_MODE_MIX, + BLEND_MODE_ADD, + BLEND_MODE_SUB, + BLEND_MODE_MUL, + BLEND_MODE_PMALPHA, + }; + + int blend_mode; + + enum LightMode { + LIGHT_MODE_NORMAL, + LIGHT_MODE_UNSHADED, + LIGHT_MODE_LIGHT_ONLY + }; + + int light_mode; + + } canvas_item; + + struct Spatial { + + enum BlendMode { + BLEND_MODE_MIX, + BLEND_MODE_ADD, + BLEND_MODE_SUB, + BLEND_MODE_MUL, + }; + + int blend_mode; + + enum DepthDrawMode { + DEPTH_DRAW_OPAQUE, + DEPTH_DRAW_ALWAYS, + DEPTH_DRAW_NEVER, + DEPTH_DRAW_ALPHA_PREPASS, + }; + + int depth_draw_mode; + + enum CullMode { + CULL_MODE_FRONT, + CULL_MODE_BACK, + CULL_MODE_DISABLED, + }; + + int cull_mode; + + bool uses_alpha; + bool unshaded; + bool ontop; + bool uses_vertex; + bool uses_discard; + bool uses_sss; + + } spatial; + + struct Particles { + + + } particles; + + + bool uses_vertex_time; + bool uses_fragment_time; + + Shader() : dirty_list(this) { + + shader=NULL; + valid=false; + custom_code_id=0; + version=1; + } + }; + + mutable SelfList<Shader>::List _shader_dirty_list; + void _shader_make_dirty(Shader* p_shader); + + mutable RID_Owner<Shader> shader_owner; + + virtual RID shader_create(VS::ShaderMode p_mode=VS::SHADER_SPATIAL); + + virtual void shader_set_mode(RID p_shader,VS::ShaderMode p_mode); + virtual VS::ShaderMode shader_get_mode(RID p_shader) const; + + virtual void shader_set_code(RID p_shader, const String& p_code); + virtual String shader_get_code(RID p_shader) const; + virtual void shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list) const; + + virtual void shader_set_default_texture_param(RID p_shader, const StringName& p_name, RID p_texture); + virtual RID shader_get_default_texture_param(RID p_shader, const StringName& p_name) const; + + void _update_shader(Shader* p_shader) const; + + void update_dirty_shaders(); + + + + /* COMMON MATERIAL API */ + + struct Material : public RID_Data { + + Shader *shader; + GLuint ubo_id; + uint32_t ubo_size; + Map<StringName,Variant> params; + SelfList<Material> list; + SelfList<Material> dirty_list; + Vector<RID> textures; + float line_width; + + uint32_t index; + uint64_t last_pass; + + Map<Geometry*,int> geometry_owners; + Map<RasterizerScene::InstanceBase*,int> instance_owners; + + bool can_cast_shadow_cache; + bool is_animated_cache; + + Material() : list(this), dirty_list(this) { + can_cast_shadow_cache=false; + is_animated_cache=false; + shader=NULL; + line_width=1.0; + ubo_id=0; + ubo_size=0; + last_pass=0; + } + + }; + + mutable SelfList<Material>::List _material_dirty_list; + void _material_make_dirty(Material *p_material) const; + void _material_add_geometry(RID p_material,Geometry *p_instantiable); + void _material_remove_geometry(RID p_material, Geometry *p_instantiable); + + + mutable RID_Owner<Material> material_owner; + + virtual RID material_create(); + + virtual void material_set_shader(RID p_material, RID p_shader); + virtual RID material_get_shader(RID p_material) const; + + virtual void material_set_param(RID p_material, const StringName& p_param, const Variant& p_value); + virtual Variant material_get_param(RID p_material, const StringName& p_param) const; + + virtual void material_set_line_width(RID p_material, float p_width); + + virtual bool material_is_animated(RID p_material); + virtual bool material_casts_shadows(RID p_material); + + virtual void material_add_instance_owner(RID p_material, RasterizerScene::InstanceBase *p_instance); + virtual void material_remove_instance_owner(RID p_material, RasterizerScene::InstanceBase *p_instance); + + void _update_material(Material* material); + + void update_dirty_materials(); + + /* MESH API */ + + + + + + + struct Mesh; + struct Surface : public Geometry { + + struct Attrib { + + bool enabled; + bool integer; + GLuint index; + GLint size; + GLenum type; + GLboolean normalized; + GLsizei stride; + uint32_t offset; + }; + + Attrib attribs[VS::ARRAY_MAX]; + + + + Mesh *mesh; + uint32_t format; + + GLuint array_id; + GLuint instancing_array_id; + GLuint vertex_id; + GLuint index_id; + + Vector<Rect3> skeleton_bone_aabb; + Vector<bool> skeleton_bone_used; + + //bool packed; + + struct MorphTarget { + GLuint vertex_id; + GLuint array_id; + }; + + Vector<MorphTarget> morph_targets; + + Rect3 aabb; + + int array_len; + int index_array_len; + int max_bone; + + int array_byte_size; + int index_array_byte_size; + + + VS::PrimitiveType primitive; + + bool active; + + virtual void material_changed_notify() { + mesh->instance_material_change_notify(); + } + + Surface() { + + array_byte_size=0; + index_array_byte_size=0; + mesh=NULL; + format=0; + array_id=0; + vertex_id=0; + index_id=0; + array_len=0; + type=GEOMETRY_SURFACE; + primitive=VS::PRIMITIVE_POINTS; + index_array_len=0; + active=false; + + } + + ~Surface() { + + } + }; + + + struct Mesh : public GeometryOwner { + + bool active; + Vector<Surface*> surfaces; + int morph_target_count; + VS::MorphTargetMode morph_target_mode; + Rect3 custom_aabb; + mutable uint64_t last_pass; + Mesh() { + morph_target_mode=VS::MORPH_MODE_NORMALIZED; + morph_target_count=0; + last_pass=0; + active=false; + } + }; + + mutable RID_Owner<Mesh> mesh_owner; + + virtual RID mesh_create(); + + virtual void mesh_add_surface(RID p_mesh,uint32_t p_format,VS::PrimitiveType p_primitive,const PoolVector<uint8_t>& p_array,int p_vertex_count,const PoolVector<uint8_t>& p_index_array,int p_index_count,const Rect3& p_aabb,const Vector<PoolVector<uint8_t> >& p_blend_shapes=Vector<PoolVector<uint8_t> >(),const Vector<Rect3>& p_bone_aabbs=Vector<Rect3>()); + + virtual void mesh_set_morph_target_count(RID p_mesh,int p_amount); + virtual int mesh_get_morph_target_count(RID p_mesh) const; + + + virtual void mesh_set_morph_target_mode(RID p_mesh,VS::MorphTargetMode p_mode); + virtual VS::MorphTargetMode mesh_get_morph_target_mode(RID p_mesh) const; + + virtual void mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material); + virtual RID mesh_surface_get_material(RID p_mesh, int p_surface) const; + + virtual int mesh_surface_get_array_len(RID p_mesh, int p_surface) const; + virtual int mesh_surface_get_array_index_len(RID p_mesh, int p_surface) const; + + virtual PoolVector<uint8_t> mesh_surface_get_array(RID p_mesh, int p_surface) const; + virtual PoolVector<uint8_t> mesh_surface_get_index_array(RID p_mesh, int p_surface) const; + + + virtual uint32_t mesh_surface_get_format(RID p_mesh, int p_surface) const; + virtual VS::PrimitiveType mesh_surface_get_primitive_type(RID p_mesh, int p_surface) const; + + virtual Rect3 mesh_surface_get_aabb(RID p_mesh, int p_surface) const; + virtual Vector<PoolVector<uint8_t> > mesh_surface_get_blend_shapes(RID p_mesh, int p_surface) const; + virtual Vector<Rect3> mesh_surface_get_skeleton_aabb(RID p_mesh, int p_surface) const; + + virtual void mesh_remove_surface(RID p_mesh, int p_surface); + virtual int mesh_get_surface_count(RID p_mesh) const; + + virtual void mesh_set_custom_aabb(RID p_mesh,const Rect3& p_aabb); + virtual Rect3 mesh_get_custom_aabb(RID p_mesh) const; + + virtual Rect3 mesh_get_aabb(RID p_mesh, RID p_skeleton) const; + virtual void mesh_clear(RID p_mesh); + + void mesh_render_blend_shapes(Surface *s, float *p_weights); + + /* MULTIMESH API */ + + struct MultiMesh : public GeometryOwner { + RID mesh; + int size; + VS::MultimeshTransformFormat transform_format; + VS::MultimeshColorFormat color_format; + Vector<float> data; + Rect3 aabb; + SelfList<MultiMesh> update_list; + GLuint buffer; + int visible_instances; + + int xform_floats; + int color_floats; + + bool dirty_aabb; + bool dirty_data; + + MultiMesh() : update_list(this) { + dirty_aabb=true; + dirty_data=true; + xform_floats=0; + color_floats=0; + visible_instances=-1; + size=0; + buffer=0; + transform_format=VS::MULTIMESH_TRANSFORM_2D; + color_format=VS::MULTIMESH_COLOR_NONE; + } + }; + + mutable RID_Owner<MultiMesh> multimesh_owner; + + SelfList<MultiMesh>::List multimesh_update_list; + + void update_dirty_multimeshes(); + + virtual RID multimesh_create(); + + virtual void multimesh_allocate(RID p_multimesh,int p_instances,VS::MultimeshTransformFormat p_transform_format,VS::MultimeshColorFormat p_color_format); + virtual int multimesh_get_instance_count(RID p_multimesh) const; + + virtual void multimesh_set_mesh(RID p_multimesh,RID p_mesh); + virtual void multimesh_instance_set_transform(RID p_multimesh,int p_index,const Transform& p_transform); + virtual void multimesh_instance_set_transform_2d(RID p_multimesh,int p_index,const Transform2D& p_transform); + virtual void multimesh_instance_set_color(RID p_multimesh,int p_index,const Color& p_color); + + virtual RID multimesh_get_mesh(RID p_multimesh) const; + + virtual Transform multimesh_instance_get_transform(RID p_multimesh,int p_index) const; + virtual Transform2D multimesh_instance_get_transform_2d(RID p_multimesh,int p_index) const; + virtual Color multimesh_instance_get_color(RID p_multimesh,int p_index) const; + + virtual void multimesh_set_visible_instances(RID p_multimesh,int p_visible); + virtual int multimesh_get_visible_instances(RID p_multimesh) const; + + virtual Rect3 multimesh_get_aabb(RID p_multimesh) const; + + /* IMMEDIATE API */ + + struct Immediate : public Geometry { + + struct Chunk { + + RID texture; + VS::PrimitiveType primitive; + Vector<Vector3> vertices; + Vector<Vector3> normals; + Vector<Plane> tangents; + Vector<Color> colors; + Vector<Vector2> uvs; + Vector<Vector2> uvs2; + }; + + List<Chunk> chunks; + bool building; + int mask; + Rect3 aabb; + + Immediate() { type=GEOMETRY_IMMEDIATE; building=false;} + + }; + + Vector3 chunk_vertex; + Vector3 chunk_normal; + Plane chunk_tangent; + Color chunk_color; + Vector2 chunk_uv; + Vector2 chunk_uv2; + + mutable RID_Owner<Immediate> immediate_owner; + + virtual RID immediate_create(); + virtual void immediate_begin(RID p_immediate,VS::PrimitiveType p_rimitive,RID p_texture=RID()); + virtual void immediate_vertex(RID p_immediate,const Vector3& p_vertex); + virtual void immediate_normal(RID p_immediate,const Vector3& p_normal); + virtual void immediate_tangent(RID p_immediate,const Plane& p_tangent); + virtual void immediate_color(RID p_immediate,const Color& p_color); + virtual void immediate_uv(RID p_immediate,const Vector2& tex_uv); + virtual void immediate_uv2(RID p_immediate,const Vector2& tex_uv); + virtual void immediate_end(RID p_immediate); + virtual void immediate_clear(RID p_immediate); + virtual void immediate_set_material(RID p_immediate,RID p_material); + virtual RID immediate_get_material(RID p_immediate) const; + virtual Rect3 immediate_get_aabb(RID p_immediate) const; + + /* SKELETON API */ + + struct Skeleton : RID_Data { + int size; + bool use_2d; + Vector<float> bones; //4x3 or 4x2 depending on what is needed + GLuint ubo; + SelfList<Skeleton> update_list; + Set<RasterizerScene::InstanceBase*> instances; //instances using skeleton + + Skeleton() : update_list(this) { + size=0; + use_2d=false; + ubo=0; + } + }; + + mutable RID_Owner<Skeleton> skeleton_owner; + + SelfList<Skeleton>::List skeleton_update_list; + + void update_dirty_skeletons(); + + virtual RID skeleton_create(); + virtual void skeleton_allocate(RID p_skeleton,int p_bones,bool p_2d_skeleton=false); + virtual int skeleton_get_bone_count(RID p_skeleton) const; + virtual void skeleton_bone_set_transform(RID p_skeleton,int p_bone, const Transform& p_transform); + virtual Transform skeleton_bone_get_transform(RID p_skeleton,int p_bone) const; + virtual void skeleton_bone_set_transform_2d(RID p_skeleton,int p_bone, const Transform2D& p_transform); + virtual Transform2D skeleton_bone_get_transform_2d(RID p_skeleton,int p_bone) const; + + /* Light API */ + + + struct Light : Instantiable { + + VS::LightType type; + float param[VS::LIGHT_PARAM_MAX]; + Color color; + Color shadow_color; + RID projector; + bool shadow; + bool negative; + uint32_t cull_mask; + VS::LightOmniShadowMode omni_shadow_mode; + VS::LightOmniShadowDetail omni_shadow_detail; + VS::LightDirectionalShadowMode directional_shadow_mode; + bool directional_blend_splits; + uint64_t version; + }; + + mutable RID_Owner<Light> light_owner; + + virtual RID light_create(VS::LightType p_type); + + virtual void light_set_color(RID p_light,const Color& p_color); + virtual void light_set_param(RID p_light,VS::LightParam p_param,float p_value); + virtual void light_set_shadow(RID p_light,bool p_enabled); + virtual void light_set_shadow_color(RID p_light,const Color& p_color); + virtual void light_set_projector(RID p_light,RID p_texture); + virtual void light_set_negative(RID p_light,bool p_enable); + virtual void light_set_cull_mask(RID p_light,uint32_t p_mask); + + + virtual void light_omni_set_shadow_mode(RID p_light,VS::LightOmniShadowMode p_mode); + virtual void light_omni_set_shadow_detail(RID p_light,VS::LightOmniShadowDetail p_detail); + + virtual void light_directional_set_shadow_mode(RID p_light,VS::LightDirectionalShadowMode p_mode); + virtual void light_directional_set_blend_splits(RID p_light,bool p_enable); + virtual bool light_directional_get_blend_splits(RID p_light) const; + + virtual VS::LightDirectionalShadowMode light_directional_get_shadow_mode(RID p_light); + virtual VS::LightOmniShadowMode light_omni_get_shadow_mode(RID p_light); + + virtual bool light_has_shadow(RID p_light) const; + + virtual VS::LightType light_get_type(RID p_light) const; + virtual float light_get_param(RID p_light,VS::LightParam p_param); + virtual Color light_get_color(RID p_light); + + virtual Rect3 light_get_aabb(RID p_light) const; + virtual uint64_t light_get_version(RID p_light) const; + + /* PROBE API */ + + struct ReflectionProbe : Instantiable { + + VS::ReflectionProbeUpdateMode update_mode; + float intensity; + Color interior_ambient; + float interior_ambient_energy; + float interior_ambient_probe_contrib; + float max_distance; + Vector3 extents; + Vector3 origin_offset; + bool interior; + bool box_projection; + bool enable_shadows; + uint32_t cull_mask; + + }; + + mutable RID_Owner<ReflectionProbe> reflection_probe_owner; + + virtual RID reflection_probe_create(); + + virtual void reflection_probe_set_update_mode(RID p_probe, VS::ReflectionProbeUpdateMode p_mode); + virtual void reflection_probe_set_intensity(RID p_probe, float p_intensity); + virtual void reflection_probe_set_interior_ambient(RID p_probe, const Color& p_ambient); + virtual void reflection_probe_set_interior_ambient_energy(RID p_probe, float p_energy); + virtual void reflection_probe_set_interior_ambient_probe_contribution(RID p_probe, float p_contrib); + virtual void reflection_probe_set_max_distance(RID p_probe, float p_distance); + virtual void reflection_probe_set_extents(RID p_probe, const Vector3& p_extents); + virtual void reflection_probe_set_origin_offset(RID p_probe, const Vector3& p_offset); + virtual void reflection_probe_set_as_interior(RID p_probe, bool p_enable); + virtual void reflection_probe_set_enable_box_projection(RID p_probe, bool p_enable); + virtual void reflection_probe_set_enable_shadows(RID p_probe, bool p_enable); + virtual void reflection_probe_set_cull_mask(RID p_probe, uint32_t p_layers); + + virtual Rect3 reflection_probe_get_aabb(RID p_probe) const; + virtual VS::ReflectionProbeUpdateMode reflection_probe_get_update_mode(RID p_probe) const; + virtual uint32_t reflection_probe_get_cull_mask(RID p_probe) const; + + virtual Vector3 reflection_probe_get_extents(RID p_probe) const; + virtual Vector3 reflection_probe_get_origin_offset(RID p_probe) const; + virtual float reflection_probe_get_origin_max_distance(RID p_probe) const; + virtual bool reflection_probe_renders_shadows(RID p_probe) const; + + + + + /* ROOM API */ + + virtual RID room_create(); + virtual void room_add_bounds(RID p_room, const PoolVector<Vector2>& p_convex_polygon,float p_height,const Transform& p_transform); + virtual void room_clear_bounds(RID p_room); + + /* PORTAL API */ + + // portals are only (x/y) points, forming a convex shape, which its clockwise + // order points outside. (z is 0); + + virtual RID portal_create(); + virtual void portal_set_shape(RID p_portal, const Vector<Point2>& p_shape); + virtual void portal_set_enabled(RID p_portal, bool p_enabled); + virtual void portal_set_disable_distance(RID p_portal, float p_distance); + virtual void portal_set_disabled_color(RID p_portal, const Color& p_color); + + + + + + + + /* GI PROBE API */ + + struct GIProbe : public Instantiable { + + + Rect3 bounds; + Transform to_cell; + float cell_size; + + int dynamic_range; + float energy; + bool interior; + bool compress; + + uint32_t version; + + PoolVector<int> dynamic_data; + + + }; + + mutable RID_Owner<GIProbe> gi_probe_owner; + + virtual RID gi_probe_create(); + + virtual void gi_probe_set_bounds(RID p_probe,const Rect3& p_bounds); + virtual Rect3 gi_probe_get_bounds(RID p_probe) const; + + virtual void gi_probe_set_cell_size(RID p_probe, float p_size); + virtual float gi_probe_get_cell_size(RID p_probe) const; + + virtual void gi_probe_set_to_cell_xform(RID p_probe,const Transform& p_xform); + virtual Transform gi_probe_get_to_cell_xform(RID p_probe) const; + + virtual void gi_probe_set_dynamic_data(RID p_probe,const PoolVector<int>& p_data); + virtual PoolVector<int> gi_probe_get_dynamic_data(RID p_probe) const; + + virtual void gi_probe_set_dynamic_range(RID p_probe,int p_range); + virtual int gi_probe_get_dynamic_range(RID p_probe) const; + + virtual void gi_probe_set_energy(RID p_probe,float p_range); + virtual float gi_probe_get_energy(RID p_probe) const; + + virtual void gi_probe_set_interior(RID p_probe,bool p_enable); + virtual bool gi_probe_is_interior(RID p_probe) const; + + virtual void gi_probe_set_compress(RID p_probe,bool p_enable); + virtual bool gi_probe_is_compressed(RID p_probe) const; + + virtual uint32_t gi_probe_get_version(RID p_probe); + + struct GIProbeData : public RID_Data { + + int width; + int height; + int depth; + int levels; + GLuint tex_id; + GIProbeCompression compression; + + GIProbeData() { + } + }; + + mutable RID_Owner<GIProbeData> gi_probe_data_owner; + + virtual GIProbeCompression gi_probe_get_dynamic_data_get_preferred_compression() const; + virtual RID gi_probe_dynamic_data_create(int p_width,int p_height,int p_depth,GIProbeCompression p_compression); + virtual void gi_probe_dynamic_data_update(RID p_gi_probe_data,int p_depth_slice,int p_slice_count,int p_mipmap,const void* p_data); + + /* PARTICLES */ + + struct Particles : public Instantiable { + + bool emitting; + int amount; + float lifetime; + float pre_process_time; + float explosiveness; + float randomness; + Rect3 custom_aabb; + Vector3 gravity; + bool use_local_coords; + RID process_material; + + VS::ParticlesEmissionShape emission_shape; + float emission_sphere_radius; + Vector3 emission_box_extents; + PoolVector<Vector3> emission_points; + GLuint emission_point_texture; + + VS::ParticlesDrawOrder draw_order; + struct DrawPass { + RID mesh; + RID material; + }; + + Vector<DrawPass> draw_passes; + + Rect3 computed_aabb; + + GLuint particle_buffers[2]; + + SelfList<Particles> particle_element; + + float phase; + float prev_phase; + uint64_t prev_ticks; + + Transform origin; + + Particles() : particle_element(this) { + emitting=false; + amount=0; + lifetime=1.0;; + pre_process_time=0.0; + explosiveness=0.0; + randomness=0.0; + use_local_coords=true; + + draw_order=VS::PARTICLES_DRAW_ORDER_INDEX; + emission_shape=VS::PARTICLES_EMSSION_POINT; + emission_sphere_radius=1.0; + emission_box_extents=Vector3(1,1,1); + emission_point_texture=0; + particle_buffers[0]=0; + particle_buffers[1]=0; + + prev_ticks=0; + + glGenBuffers(2,particle_buffers); + } + + ~Particles() { + + glDeleteBuffers(2,particle_buffers); + } + + + }; + + SelfList<Particles>::List particle_update_list; + + void update_particles(); + + + mutable RID_Owner<Particles> particles_owner; + + virtual RID particles_create(); + + virtual void particles_set_emitting(RID p_particles,bool p_emitting); + virtual void particles_set_amount(RID p_particles,int p_amount); + virtual void particles_set_lifetime(RID p_particles,float p_lifetime); + virtual void particles_set_pre_process_time(RID p_particles,float p_time); + virtual void particles_set_explosiveness_ratio(RID p_particles,float p_ratio); + virtual void particles_set_randomness_ratio(RID p_particles,float p_ratio); + virtual void particles_set_custom_aabb(RID p_particles,const Rect3& p_aabb); + virtual void particles_set_gravity(RID p_particles,const Vector3& p_gravity); + virtual void particles_set_use_local_coordinates(RID p_particles,bool p_enable); + virtual void particles_set_process_material(RID p_particles,RID p_material); + + virtual void particles_set_emission_shape(RID p_particles,VS::ParticlesEmissionShape p_shape); + virtual void particles_set_emission_sphere_radius(RID p_particles,float p_radius); + virtual void particles_set_emission_box_extents(RID p_particles,const Vector3& p_extents); + virtual void particles_set_emission_points(RID p_particles,const PoolVector<Vector3>& p_points); + + + virtual void particles_set_draw_order(RID p_particles,VS::ParticlesDrawOrder p_order); + + virtual void particles_set_draw_passes(RID p_particles,int p_count); + virtual void particles_set_draw_pass_material(RID p_particles,int p_pass, RID p_material); + virtual void particles_set_draw_pass_mesh(RID p_particles,int p_pass, RID p_mesh); + + virtual Rect3 particles_get_current_aabb(RID p_particles); + + /* INSTANCE */ + + virtual void instance_add_skeleton(RID p_skeleton,RasterizerScene::InstanceBase *p_instance); + virtual void instance_remove_skeleton(RID p_skeleton,RasterizerScene::InstanceBase *p_instance); + + virtual void instance_add_dependency(RID p_base,RasterizerScene::InstanceBase *p_instance); + virtual void instance_remove_dependency(RID p_base,RasterizerScene::InstanceBase *p_instance); + + /* RENDER TARGET */ + + struct RenderTarget : public RID_Data { + + GLuint fbo; + GLuint color; + GLuint depth; + + struct Buffers { + GLuint fbo; + GLuint depth; + GLuint specular; + GLuint diffuse; + GLuint normal_rough; + GLuint motion_sss; + + GLuint effect_fbo; + GLuint effect; + + } buffers; + + struct Effects { + + struct MipMaps { + + struct Size { + GLuint fbo; + int width; + int height; + }; + + Vector<Size> sizes; + GLuint color; + int levels; + + MipMaps() { color=0; levels=0;} + }; + + MipMaps mip_maps[2]; //first mipmap chain starts from full-screen + //GLuint depth2; //depth for the second mipmap chain, in case of desiring upsampling + + struct SSAO { + GLuint blur_fbo[2]; // blur fbo + GLuint blur_red[2]; // 8 bits red buffer + + GLuint linear_depth; + + Vector<GLuint> depth_mipmap_fbos; //fbos for depth mipmapsla ver + + SSAO() { blur_fbo[0]=0; blur_fbo[1]=0; linear_depth=0; } + } ssao; + + Effects() {} + + } effects; + + struct Exposure { + GLuint fbo; + GLuint color; + + Exposure() { fbo=0; } + } exposure; + + uint64_t last_exposure_tick; + + int width,height; + + bool flags[RENDER_TARGET_FLAG_MAX]; + + bool used_in_frame; + VS::ViewportMSAA msaa; + + RID texture; + + RenderTarget() { + + msaa=VS::VIEWPORT_MSAA_DISABLED; + width=0; + height=0; + depth=0; + fbo=0; + buffers.fbo=0; + used_in_frame=false; + + flags[RENDER_TARGET_VFLIP]=false; + flags[RENDER_TARGET_TRANSPARENT]=false; + flags[RENDER_TARGET_NO_3D]=false; + flags[RENDER_TARGET_HDR]=true; + flags[RENDER_TARGET_NO_SAMPLING]=false; + + last_exposure_tick=0; + } + }; + + mutable RID_Owner<RenderTarget> render_target_owner; + + void _render_target_clear(RenderTarget *rt); + void _render_target_allocate(RenderTarget *rt); + + virtual RID render_target_create(); + virtual void render_target_set_size(RID p_render_target,int p_width, int p_height); + virtual RID render_target_get_texture(RID p_render_target) const; + + virtual void render_target_set_flag(RID p_render_target,RenderTargetFlags p_flag,bool p_value); + virtual bool render_target_renedered_in_frame(RID p_render_target); + virtual void render_target_set_msaa(RID p_render_target,VS::ViewportMSAA p_msaa); + + /* CANVAS SHADOW */ + + struct CanvasLightShadow : public RID_Data { + + int size; + int height; + GLuint fbo; + GLuint depth; + GLuint distance; //for older devices + }; + + RID_Owner<CanvasLightShadow> canvas_light_shadow_owner; + + virtual RID canvas_light_shadow_buffer_create(int p_width); + + /* LIGHT SHADOW MAPPING */ + + struct CanvasOccluder : public RID_Data { + + GLuint vertex_id; // 0 means, unconfigured + GLuint index_id; // 0 means, unconfigured + PoolVector<Vector2> lines; + int len; + }; + + RID_Owner<CanvasOccluder> canvas_occluder_owner; + + virtual RID canvas_light_occluder_create(); + virtual void canvas_light_occluder_set_polylines(RID p_occluder, const PoolVector<Vector2>& p_lines); + + virtual VS::InstanceType get_base_type(RID p_rid) const; + + virtual bool free(RID p_rid); + + + struct Frame { + + RenderTarget *current_rt; + + bool clear_request; + Color clear_request_color; + int canvas_draw_commands; + float time[4]; + float delta; + uint64_t prev_tick; + uint64_t count; + } frame; + + void initialize(); + void finalize(); + + + + RasterizerStorageGLES3(); +}; + + +#endif // RASTERIZERSTORAGEGLES3_H diff --git a/drivers/gles3/shader_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp new file mode 100644 index 0000000000..26b9aeada4 --- /dev/null +++ b/drivers/gles3/shader_compiler_gles3.cpp @@ -0,0 +1,738 @@ +#include "shader_compiler_gles3.h" +#include "os/os.h" + +#define SL ShaderLanguage + +static String _mktab(int p_level) { + + String tb; + for(int i=0;i<p_level;i++) { + tb+="\t"; + } + + return tb; +} + +static String _typestr(SL::DataType p_type) { + + return ShaderLanguage::get_datatype_name(p_type); +} + +static int _get_datatype_size(SL::DataType p_type) { + + switch(p_type) { + + case SL::TYPE_VOID: return 0; + case SL::TYPE_BOOL: return 4; + case SL::TYPE_BVEC2: return 8; + case SL::TYPE_BVEC3: return 16; + case SL::TYPE_BVEC4: return 16; + case SL::TYPE_INT: return 4; + case SL::TYPE_IVEC2: return 8; + case SL::TYPE_IVEC3: return 16; + case SL::TYPE_IVEC4: return 16; + case SL::TYPE_UINT: return 4; + case SL::TYPE_UVEC2: return 8; + case SL::TYPE_UVEC3: return 16; + case SL::TYPE_UVEC4: return 16; + case SL::TYPE_FLOAT: return 4; + case SL::TYPE_VEC2: return 8; + case SL::TYPE_VEC3: return 16; + case SL::TYPE_VEC4: return 16; + case SL::TYPE_MAT2: return 16; + case SL::TYPE_MAT3: return 48; + case SL::TYPE_MAT4: return 64; + case SL::TYPE_SAMPLER2D: return 16; + case SL::TYPE_ISAMPLER2D: return 16; + case SL::TYPE_USAMPLER2D: return 16; + case SL::TYPE_SAMPLERCUBE: return 16; + } + + ERR_FAIL_V(0); +} + + + +static String _prestr(SL::DataPrecision p_pres) { + + + switch(p_pres) { + case SL::PRECISION_LOWP: return "lowp "; + case SL::PRECISION_MEDIUMP: return "mediump "; + case SL::PRECISION_HIGHP: return "highp "; + case SL::PRECISION_DEFAULT: return ""; + } + return ""; +} + + +static String _opstr(SL::Operator p_op) { + + return SL::get_operator_text(p_op); +} + +static String _mkid(const String& p_id) { + + return "m_"+p_id; +} + +static String f2sp0(float p_float) { + + if (int(p_float)==p_float) + return itos(p_float)+".0"; + else + return rtoss(p_float); +} + +static String get_constant_text(SL::DataType p_type, const Vector<SL::ConstantNode::Value>& p_values) { + + switch(p_type) { + case SL::TYPE_BOOL: return p_values[0].boolean?"true":"false"; + case SL::TYPE_BVEC2: + case SL::TYPE_BVEC3: + case SL::TYPE_BVEC4: { + + + String text="bvec"+itos(p_type-SL::TYPE_BOOL+1)+"("; + for(int i=0;i<p_values.size();i++) { + if (i>0) + text+=","; + + text+=p_values[i].boolean?"true":"false"; + } + text+=")"; + return text; + } + + case SL::TYPE_INT: return itos(p_values[0].sint); + case SL::TYPE_IVEC2: + case SL::TYPE_IVEC3: + case SL::TYPE_IVEC4: { + + String text="ivec"+itos(p_type-SL::TYPE_INT+1)+"("; + for(int i=0;i<p_values.size();i++) { + if (i>0) + text+=","; + + text+=itos(p_values[i].sint); + } + text+=")"; + return text; + + } break; + case SL::TYPE_UINT: return itos(p_values[0].uint)+"u"; + case SL::TYPE_UVEC2: + case SL::TYPE_UVEC3: + case SL::TYPE_UVEC4: { + + String text="uvec"+itos(p_type-SL::TYPE_UINT+1)+"("; + for(int i=0;i<p_values.size();i++) { + if (i>0) + text+=","; + + text+=itos(p_values[i].uint)+"u"; + } + text+=")"; + return text; + } break; + case SL::TYPE_FLOAT: return f2sp0(p_values[0].real)+"f"; + case SL::TYPE_VEC2: + case SL::TYPE_VEC3: + case SL::TYPE_VEC4: { + + String text="vec"+itos(p_type-SL::TYPE_FLOAT+1)+"("; + for(int i=0;i<p_values.size();i++) { + if (i>0) + text+=","; + + text+=f2sp0(p_values[i].real); + } + text+=")"; + return text; + + } break; + default: ERR_FAIL_V(String()); + } +} + +void ShaderCompilerGLES3::_dump_function_deps(SL::ShaderNode* p_node, const StringName& p_for_func, const Map<StringName,String>& p_func_code, String& r_to_add, Set<StringName> &added) { + + int fidx=-1; + + for(int i=0;i<p_node->functions.size();i++) { + if (p_node->functions[i].name==p_for_func) { + fidx=i; + break; + } + } + + ERR_FAIL_COND(fidx==-1); + + for (Set<StringName>::Element *E=p_node->functions[fidx].uses_function.front();E;E=E->next()) { + + if (added.has(E->get())) { + continue; //was added already + } + + _dump_function_deps(p_node,E->get(),p_func_code,r_to_add,added); + + SL::FunctionNode *fnode=NULL; + + for(int i=0;i<p_node->functions.size();i++) { + if (p_node->functions[i].name==E->get()) { + fnode=p_node->functions[i].function; + break; + } + } + + ERR_FAIL_COND(!fnode); + + r_to_add+="\n"; + + String header; + header=_typestr(fnode->return_type)+" "+_mkid(fnode->name)+"("; + for(int i=0;i<fnode->arguments.size();i++) { + + if (i>0) + header+=", "; + header+=_prestr(fnode->arguments[i].precision)+_typestr(fnode->arguments[i].type)+" "+_mkid(fnode->arguments[i].name); + } + + header+=")\n"; + r_to_add+=header; + r_to_add+=p_func_code[E->get()]; + + added.insert(E->get()); + } +} + +String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, GeneratedCode& r_gen_code, IdentifierActions &p_actions, const DefaultIdentifierActions &p_default_actions) { + + String code; + + switch(p_node->type) { + + case SL::Node::TYPE_SHADER: { + + SL::ShaderNode *pnode=(SL::ShaderNode*)p_node; + + for(int i=0;i<pnode->render_modes.size();i++) { + + if (p_default_actions.render_mode_defines.has(pnode->render_modes[i]) && !used_rmode_defines.has(pnode->render_modes[i])) { + + r_gen_code.defines.push_back(p_default_actions.render_mode_defines[pnode->render_modes[i]].utf8()); + used_rmode_defines.insert(pnode->render_modes[i]); + } + + if (p_actions.render_mode_flags.has(pnode->render_modes[i])) { + *p_actions.render_mode_flags[pnode->render_modes[i]]=true; + } + + if (p_actions.render_mode_values.has(pnode->render_modes[i])) { + Pair<int*,int> &p = p_actions.render_mode_values[pnode->render_modes[i]]; + *p.first=p.second; + } + } + + + int max_texture_uniforms=0; + int max_uniforms=0; + + for(Map<StringName,SL::ShaderNode::Uniform>::Element *E=pnode->uniforms.front();E;E=E->next()) { + if (SL::is_sampler_type(E->get().type)) + max_texture_uniforms++; + else + max_uniforms++; + } + + r_gen_code.texture_uniforms.resize(max_texture_uniforms); + r_gen_code.texture_hints.resize(max_texture_uniforms); + + Vector<int> uniform_sizes; + Vector<int> uniform_alignments; + Vector<StringName> uniform_defines; + uniform_sizes.resize(max_uniforms); + uniform_alignments.resize(max_uniforms); + uniform_defines.resize(max_uniforms); + + for(Map<StringName,SL::ShaderNode::Uniform>::Element *E=pnode->uniforms.front();E;E=E->next()) { + + String ucode; + + if (SL::is_sampler_type(E->get().type)) { + ucode="uniform "; + } + + ucode+=_prestr(E->get().precission); + ucode+=_typestr(E->get().type); + ucode+=" "+_mkid(E->key()); + ucode+=";\n"; + if (SL::is_sampler_type(E->get().type)) { + r_gen_code.vertex_global+=ucode; + r_gen_code.fragment_global+=ucode; + r_gen_code.texture_uniforms[E->get().texture_order]=_mkid(E->key()); + r_gen_code.texture_hints[E->get().texture_order]=E->get().hint; + } else { + if (r_gen_code.uniforms.empty()) { + + r_gen_code.defines.push_back(String("#define USE_MATERIAL\n").ascii()); + } + uniform_defines[E->get().order]=ucode; + uniform_sizes[E->get().order]=_get_datatype_size(E->get().type); + uniform_alignments[E->get().order]=MIN(16,_get_datatype_size(E->get().type)); + } + + p_actions.uniforms->insert(E->key(),E->get()); + + } + + for(int i=0;i<max_uniforms;i++) { + r_gen_code.uniforms+=uniform_defines[i]; + } + // add up + for(int i=0;i<uniform_sizes.size();i++) { + + if (i>0) { + + int align = uniform_sizes[i-1] % uniform_alignments[i]; + if (align!=0) { + uniform_sizes[i-1]+=uniform_alignments[i]-align; + } + + uniform_sizes[i]=uniform_sizes[i]+uniform_sizes[i-1]; + + } + } + //offset + r_gen_code.uniform_offsets.resize(uniform_sizes.size()); + for(int i=0;i<uniform_sizes.size();i++) { + + if (i>0) + r_gen_code.uniform_offsets[i]=uniform_sizes[i-1]; + else + r_gen_code.uniform_offsets[i]=0; + + + } +/* + for(Map<StringName,SL::ShaderNode::Uniform>::Element *E=pnode->uniforms.front();E;E=E->next()) { + + if (SL::is_sampler_type(E->get().type)) { + continue; + } + + print_line("u - "+String(E->key())+" offset: "+itos(r_gen_code.uniform_offsets[E->get().order])); + + } + +*/ + if (uniform_sizes.size()) { + r_gen_code.uniform_total_size=uniform_sizes[ uniform_sizes.size() -1 ]; + } else { + r_gen_code.uniform_total_size=0; + } + + for(Map<StringName,SL::ShaderNode::Varying>::Element *E=pnode->varyings.front();E;E=E->next()) { + + String vcode; + vcode+=_prestr(E->get().precission); + vcode+=_typestr(E->get().type); + vcode+=" "+String(E->key()); + vcode+=";\n"; + r_gen_code.vertex_global+="out "+vcode; + r_gen_code.fragment_global+="in "+vcode; + } + + Map<StringName,String> function_code; + + //code for functions + for(int i=0;i<pnode->functions.size();i++) { + SL::FunctionNode *fnode=pnode->functions[i].function; + function_code[fnode->name]=_dump_node_code(fnode->body,p_level+1,r_gen_code,p_actions,p_default_actions); + } + + //place functions in actual code + + Set<StringName> added_vtx; + Set<StringName> added_fragment; //share for light + + for(int i=0;i<pnode->functions.size();i++) { + + SL::FunctionNode *fnode=pnode->functions[i].function; + + current_func_name=fnode->name; + + if (fnode->name=="vertex") { + + _dump_function_deps(pnode,fnode->name,function_code,r_gen_code.vertex_global,added_vtx); + r_gen_code.vertex=function_code["vertex"]; + } + + if (fnode->name=="fragment") { + + _dump_function_deps(pnode,fnode->name,function_code,r_gen_code.fragment_global,added_fragment); + r_gen_code.fragment=function_code["fragment"]; + } + + if (fnode->name=="light") { + + _dump_function_deps(pnode,fnode->name,function_code,r_gen_code.fragment_global,added_fragment); + r_gen_code.light=function_code["light"]; + } + } + + //code+=dump_node_code(pnode->body,p_level); + } break; + case SL::Node::TYPE_FUNCTION: { + + } break; + case SL::Node::TYPE_BLOCK: { + SL::BlockNode *bnode=(SL::BlockNode*)p_node; + + //variables + code+=_mktab(p_level-1)+"{\n"; + for(Map<StringName,SL::BlockNode::Variable>::Element *E=bnode->variables.front();E;E=E->next()) { + + code+=_mktab(p_level)+_prestr(E->get().precision)+_typestr(E->get().type)+" "+_mkid(E->key())+";\n"; + } + + for(int i=0;i<bnode->statements.size();i++) { + + String scode = _dump_node_code(bnode->statements[i],p_level,r_gen_code,p_actions,p_default_actions); + + if (bnode->statements[i]->type==SL::Node::TYPE_CONTROL_FLOW || bnode->statements[i]->type==SL::Node::TYPE_CONTROL_FLOW) { + code+=scode; //use directly + } else { + code+=_mktab(p_level)+scode+";\n"; + } + } + code+=_mktab(p_level-1)+"}\n"; + + + } break; + case SL::Node::TYPE_VARIABLE: { + SL::VariableNode *vnode=(SL::VariableNode*)p_node; + + if (p_default_actions.usage_defines.has(vnode->name) && !used_name_defines.has(vnode->name)) { + String define = p_default_actions.usage_defines[vnode->name]; + if (define.begins_with("@")) { + define = p_default_actions.usage_defines[define.substr(1,define.length())]; + } + r_gen_code.defines.push_back(define.utf8()); + used_name_defines.insert(vnode->name); + } + + if (p_actions.usage_flag_pointers.has(vnode->name) && !used_flag_pointers.has(vnode->name)) { + *p_actions.usage_flag_pointers[vnode->name]=true; + used_flag_pointers.insert(vnode->name); + } + + if (p_default_actions.renames.has(vnode->name)) + code=p_default_actions.renames[vnode->name]; + else + code=_mkid(vnode->name); + + if (vnode->name==time_name) { + if (current_func_name==vertex_name) { + r_gen_code.uses_vertex_time=true; + } + if (current_func_name==fragment_name) { + r_gen_code.uses_fragment_time=true; + } + } + + } break; + case SL::Node::TYPE_CONSTANT: { + SL::ConstantNode *cnode=(SL::ConstantNode*)p_node; + return get_constant_text(cnode->datatype,cnode->values); + + } break; + case SL::Node::TYPE_OPERATOR: { + SL::OperatorNode *onode=(SL::OperatorNode*)p_node; + + + switch(onode->op) { + + case SL::OP_ASSIGN: + case SL::OP_ASSIGN_ADD: + case SL::OP_ASSIGN_SUB: + case SL::OP_ASSIGN_MUL: + case SL::OP_ASSIGN_DIV: + case SL::OP_ASSIGN_SHIFT_LEFT: + case SL::OP_ASSIGN_SHIFT_RIGHT: + case SL::OP_ASSIGN_MOD: + case SL::OP_ASSIGN_BIT_AND: + case SL::OP_ASSIGN_BIT_OR: + case SL::OP_ASSIGN_BIT_XOR: + code=_dump_node_code(onode->arguments[0],p_level,r_gen_code,p_actions,p_default_actions)+_opstr(onode->op)+_dump_node_code(onode->arguments[1],p_level,r_gen_code,p_actions,p_default_actions); + break; + case SL::OP_BIT_INVERT: + case SL::OP_NEGATE: + case SL::OP_NOT: + case SL::OP_DECREMENT: + case SL::OP_INCREMENT: + code=_opstr(onode->op)+_dump_node_code(onode->arguments[0],p_level,r_gen_code,p_actions,p_default_actions); + break; + case SL::OP_POST_DECREMENT: + case SL::OP_POST_INCREMENT: + code=_dump_node_code(onode->arguments[0],p_level,r_gen_code,p_actions,p_default_actions)+_opstr(onode->op); + break; + case SL::OP_CALL: + case SL::OP_CONSTRUCT: { + + ERR_FAIL_COND_V(onode->arguments[0]->type!=SL::Node::TYPE_VARIABLE,String()); + + SL::VariableNode *vnode=(SL::VariableNode*)onode->arguments[0]; + + if (onode->op==SL::OP_CONSTRUCT) { + code+=String(vnode->name); + } else { + + if (internal_functions.has(vnode->name)) { + code+=vnode->name; + } else if (p_default_actions.renames.has(vnode->name)) { + code+=p_default_actions.renames[vnode->name]; + } else { + code+=_mkid(vnode->name); + } + } + + code+="("; + + for(int i=1;i<onode->arguments.size();i++) { + if (i>1) + code+=", "; + code+=_dump_node_code(onode->arguments[i],p_level,r_gen_code,p_actions,p_default_actions); + } + code+=")"; + } break; + default: { + + code="("+_dump_node_code(onode->arguments[0],p_level,r_gen_code,p_actions,p_default_actions)+_opstr(onode->op)+_dump_node_code(onode->arguments[1],p_level,r_gen_code,p_actions,p_default_actions)+")"; + break; + + } + } + + } break; + case SL::Node::TYPE_CONTROL_FLOW: { + SL::ControlFlowNode *cfnode=(SL::ControlFlowNode*)p_node; + if (cfnode->flow_op==SL::FLOW_OP_IF) { + + code+=_mktab(p_level)+"if ("+_dump_node_code(cfnode->expressions[0],p_level,r_gen_code,p_actions,p_default_actions)+")\n"; + code+=_dump_node_code(cfnode->blocks[0],p_level+1,r_gen_code,p_actions,p_default_actions); + if (cfnode->blocks.size()==2) { + + code+=_mktab(p_level)+"else\n"; + code+=_dump_node_code(cfnode->blocks[1],p_level+1,r_gen_code,p_actions,p_default_actions); + } + + + } else if (cfnode->flow_op==SL::FLOW_OP_RETURN) { + + if (cfnode->blocks.size()) { + code="return "+_dump_node_code(cfnode->blocks[0],p_level,r_gen_code,p_actions,p_default_actions); + } else { + code="return"; + } + } + + } break; + case SL::Node::TYPE_MEMBER: { + SL::MemberNode *mnode=(SL::MemberNode*)p_node; + code=_dump_node_code(mnode->owner,p_level,r_gen_code,p_actions,p_default_actions)+"."+mnode->name; + + } break; + } + + return code; + +} + + +Error ShaderCompilerGLES3::compile(VS::ShaderMode p_mode, const String& p_code, IdentifierActions* p_actions, const String &p_path,GeneratedCode& r_gen_code) { + + + + Error err = parser.compile(p_code,ShaderTypes::get_singleton()->get_functions(p_mode),ShaderTypes::get_singleton()->get_modes(p_mode)); + + if (err!=OK) { +#if 1 + + Vector<String> shader = p_code.split("\n"); + for(int i=0;i<shader.size();i++) { + print_line(itos(i)+" "+shader[i]); + } +#endif + + _err_print_error(NULL,p_path.utf8().get_data(),parser.get_error_line(),parser.get_error_text().utf8().get_data(),ERR_HANDLER_SHADER); + return err; + } + + r_gen_code.defines.clear(); + r_gen_code.vertex=String(); + r_gen_code.vertex_global=String(); + r_gen_code.fragment=String(); + r_gen_code.fragment_global=String(); + r_gen_code.light=String(); + r_gen_code.uses_fragment_time=false; + r_gen_code.uses_vertex_time=false; + + + + used_name_defines.clear(); + used_rmode_defines.clear(); + + _dump_node_code(parser.get_shader(),1,r_gen_code,*p_actions,actions[p_mode]); + + return OK; + +} + + +ShaderCompilerGLES3::ShaderCompilerGLES3() { + + /** CANVAS ITEM SHADER **/ + + actions[VS::SHADER_CANVAS_ITEM].renames["SRC_VERTEX"]="vertex"; + actions[VS::SHADER_CANVAS_ITEM].renames["VERTEX"]="outvec.xy"; + actions[VS::SHADER_CANVAS_ITEM].renames["VERTEX_COLOR"]="vertex_color"; + actions[VS::SHADER_CANVAS_ITEM].renames["UV"]="uv_interp"; + actions[VS::SHADER_CANVAS_ITEM].renames["POINT_SIZE"]="gl_PointSize"; + + actions[VS::SHADER_CANVAS_ITEM].renames["WORLD_MATRIX"]="modelview_matrix"; + actions[VS::SHADER_CANVAS_ITEM].renames["PROJECTION_MATRIX"]="projection_matrix"; + actions[VS::SHADER_CANVAS_ITEM].renames["EXTRA_MATRIX"]=="extra_matrix"; + actions[VS::SHADER_CANVAS_ITEM].renames["TIME"]="time"; + + actions[VS::SHADER_CANVAS_ITEM].renames["COLOR"]="color"; + actions[VS::SHADER_CANVAS_ITEM].renames["NORMAL"]="normal"; + actions[VS::SHADER_CANVAS_ITEM].renames["NORMALMAP"]="normal_map"; + actions[VS::SHADER_CANVAS_ITEM].renames["NORMALMAP_DEPTH"]="normal_depth"; + actions[VS::SHADER_CANVAS_ITEM].renames["UV"]="uv_interp"; + actions[VS::SHADER_CANVAS_ITEM].renames["COLOR"]="color"; + actions[VS::SHADER_CANVAS_ITEM].renames["TEXTURE"]="color_texture"; + actions[VS::SHADER_CANVAS_ITEM].renames["TEXTURE_PIXEL_SIZE"]="color_texpixel_size"; + actions[VS::SHADER_CANVAS_ITEM].renames["SCREEN_UV"]="screen_uv"; + actions[VS::SHADER_CANVAS_ITEM].renames["SCREEN_TEXTURE"]="screen_texture"; + actions[VS::SHADER_CANVAS_ITEM].renames["POINT_COORD"]="gl_PointCoord"; + + actions[VS::SHADER_CANVAS_ITEM].renames["LIGHT_VEC"]="light_vec"; + actions[VS::SHADER_CANVAS_ITEM].renames["LIGHT_HEIGHT"]="light_height"; + actions[VS::SHADER_CANVAS_ITEM].renames["LIGHT_COLOR"]="light_color"; + actions[VS::SHADER_CANVAS_ITEM].renames["LIGHT_UV"]="light_uv"; + //actions[VS::SHADER_CANVAS_ITEM].renames["LIGHT_SHADOW_COLOR"]="light_shadow_color"; + actions[VS::SHADER_CANVAS_ITEM].renames["LIGHT"]="light"; + actions[VS::SHADER_CANVAS_ITEM].renames["SHADOW_COLOR"]="shadow_color"; + + actions[VS::SHADER_CANVAS_ITEM].usage_defines["COLOR"]="#define COLOR_USED\n"; + actions[VS::SHADER_CANVAS_ITEM].usage_defines["SCREEN_TEXTURE"]="#define SCREEN_TEXTURE_USED\n"; + actions[VS::SHADER_CANVAS_ITEM].usage_defines["SCREEN_UV"]="#define SCREEN_UV_USED\n"; + actions[VS::SHADER_CANVAS_ITEM].usage_defines["NORMAL"]="#define NORMAL_USED\n"; + actions[VS::SHADER_CANVAS_ITEM].usage_defines["NORMALMAP"]="#define NORMALMAP_USED\n"; + actions[VS::SHADER_CANVAS_ITEM].usage_defines["SHADOW_COLOR"]="#define SHADOW_COLOR_USED\n"; + + actions[VS::SHADER_CANVAS_ITEM].render_mode_defines["skip_transform"]="#define SKIP_TRANSFORM_USED\n"; + + /** SPATIAL SHADER **/ + + + actions[VS::SHADER_SPATIAL].renames["WORLD_MATRIX"]="world_transform"; + actions[VS::SHADER_SPATIAL].renames["INV_CAMERA_MATRIX"]="camera_inverse_matrix"; + actions[VS::SHADER_SPATIAL].renames["PROJECTION_MATRIX"]="projection_matrix"; + + + actions[VS::SHADER_SPATIAL].renames["VERTEX"]="vertex.xyz"; + actions[VS::SHADER_SPATIAL].renames["NORMAL"]="normal"; + actions[VS::SHADER_SPATIAL].renames["TANGENT"]="tangent"; + actions[VS::SHADER_SPATIAL].renames["BINORMAL"]="binormal"; + actions[VS::SHADER_SPATIAL].renames["UV"]="uv_interp"; + actions[VS::SHADER_SPATIAL].renames["UV2"]="uv2_interp"; + actions[VS::SHADER_SPATIAL].renames["COLOR"]="color_interp"; + actions[VS::SHADER_SPATIAL].renames["POINT_SIZE"]="gl_PointSize"; + //actions[VS::SHADER_SPATIAL].renames["INSTANCE_ID"]=ShaderLanguage::TYPE_INT; + + //builtins + + actions[VS::SHADER_SPATIAL].renames["TIME"]="time"; + //actions[VS::SHADER_SPATIAL].renames["VIEWPORT_SIZE"]=ShaderLanguage::TYPE_VEC2; + + actions[VS::SHADER_SPATIAL].renames["FRAGCOORD"]="gl_FragCoord"; + actions[VS::SHADER_SPATIAL].renames["FRONT_FACING"]="gl_FrotFacing"; + actions[VS::SHADER_SPATIAL].renames["NORMALMAP"]="normalmap"; + actions[VS::SHADER_SPATIAL].renames["NORMALMAP_DEPTH"]="normaldepth"; + actions[VS::SHADER_SPATIAL].renames["ALBEDO"]="albedo"; + actions[VS::SHADER_SPATIAL].renames["ALPHA"]="alpha"; + actions[VS::SHADER_SPATIAL].renames["SPECULAR"]="specular"; + actions[VS::SHADER_SPATIAL].renames["ROUGHNESS"]="roughness"; + actions[VS::SHADER_SPATIAL].renames["RIM"]="rim"; + actions[VS::SHADER_SPATIAL].renames["RIM_TINT"]="rim_tint"; + actions[VS::SHADER_SPATIAL].renames["CLEARCOAT"]="clearcoat"; + actions[VS::SHADER_SPATIAL].renames["CLEARCOAT_GLOSS"]="clearcoat_gloss"; + actions[VS::SHADER_SPATIAL].renames["ANISOTROPY"]="anisotropy"; + actions[VS::SHADER_SPATIAL].renames["ANISOTROPY_FLOW"]="anisotropy_flow"; + actions[VS::SHADER_SPATIAL].renames["SSS_SPREAD"]="sss_spread"; + actions[VS::SHADER_SPATIAL].renames["SSS_STRENGTH"]="sss_strength"; + actions[VS::SHADER_SPATIAL].renames["AO"]="ao"; + actions[VS::SHADER_SPATIAL].renames["EMISSION"]="emission"; + actions[VS::SHADER_SPATIAL].renames["DISCARD"]="_discard"; +// actions[VS::SHADER_SPATIAL].renames["SCREEN_UV"]=ShaderLanguage::TYPE_VEC2; + actions[VS::SHADER_SPATIAL].renames["POINT_COORD"]="gl_PointCoord"; + + + actions[VS::SHADER_SPATIAL].usage_defines["TANGENT"]="#define ENABLE_TANGENT_INTERP\n"; + actions[VS::SHADER_SPATIAL].usage_defines["BINORMAL"]="@TANGENT"; + actions[VS::SHADER_SPATIAL].usage_defines["RIM"]="#define LIGHT_USE_RIM\n"; + actions[VS::SHADER_SPATIAL].usage_defines["RIM_TINT"]="@RIM"; + actions[VS::SHADER_SPATIAL].usage_defines["CLEARCOAT"]="#define LIGHT_USE_CLEARCOAT\n"; + actions[VS::SHADER_SPATIAL].usage_defines["CLEARCOAT_GLOSS"]="@CLEARCOAT"; + actions[VS::SHADER_SPATIAL].usage_defines["ANISOTROPY"]="#define LIGHT_USE_ANISOTROPY\n"; + actions[VS::SHADER_SPATIAL].usage_defines["ANISOTROPY_FLOW"]="@ANISOTROPY"; + actions[VS::SHADER_SPATIAL].usage_defines["AO"]="#define ENABLE_AO\n"; + actions[VS::SHADER_SPATIAL].usage_defines["UV"]="#define ENABLE_UV_INTERP\n"; + actions[VS::SHADER_SPATIAL].usage_defines["UV2"]="#define ENABLE_UV2_INTERP\n"; + actions[VS::SHADER_SPATIAL].usage_defines["NORMALMAP"]="#define ENABLE_NORMALMAP\n"; + actions[VS::SHADER_SPATIAL].usage_defines["NORMALMAP_DEPTH"]="@NORMALMAP"; + actions[VS::SHADER_SPATIAL].usage_defines["COLOR"]="#define ENABLE_COLOR_INTERP\n"; + + actions[VS::SHADER_SPATIAL].usage_defines["SSS_STRENGTH"]="#define ENABLE_SSS_MOTION\n"; + + actions[VS::SHADER_SPATIAL].renames["SSS_STRENGTH"]="sss_strength"; + + + actions[VS::SHADER_SPATIAL].render_mode_defines["skip_transform"]="#define SKIP_TRANSFORM_USED\n"; + + + /* PARTICLES SHADER */ + + actions[VS::SHADER_PARTICLES].renames["COLOR"]="color"; + actions[VS::SHADER_PARTICLES].renames["VELOCITY"]="out_velocity_active.xyz"; + actions[VS::SHADER_PARTICLES].renames["MASS"]="mass"; + actions[VS::SHADER_PARTICLES].renames["ACTIVE"]="active"; + actions[VS::SHADER_PARTICLES].renames["RESTART"]="restart"; + actions[VS::SHADER_PARTICLES].renames["CUSTOM"]="out_custom"; + actions[VS::SHADER_PARTICLES].renames["TRANSFORM"]="xform"; + actions[VS::SHADER_PARTICLES].renames["TIME"]="time"; + actions[VS::SHADER_PARTICLES].renames["LIFETIME"]="lifetime"; + actions[VS::SHADER_PARTICLES].renames["DELTA"]="delta"; + actions[VS::SHADER_PARTICLES].renames["SEED"]="seed"; + actions[VS::SHADER_PARTICLES].renames["ORIGIN"]="origin"; + actions[VS::SHADER_PARTICLES].renames["INDEX"]="index"; + + actions[VS::SHADER_SPATIAL].render_mode_defines["disable_force"]="#define DISABLE_FORCE\n"; + actions[VS::SHADER_SPATIAL].render_mode_defines["disable_velocity"]="#define DISABLE_VELOCITY\n"; + + + vertex_name="vertex"; + fragment_name="fragment"; + time_name="TIME"; + + + List<String> func_list; + + ShaderLanguage::get_builtin_funcs(&func_list); + + for (List<String>::Element *E=func_list.front();E;E=E->next()) { + internal_functions.insert(E->get()); + } +} diff --git a/drivers/gles3/shader_compiler_gles3.h b/drivers/gles3/shader_compiler_gles3.h new file mode 100644 index 0000000000..1beee66ad7 --- /dev/null +++ b/drivers/gles3/shader_compiler_gles3.h @@ -0,0 +1,77 @@ +#ifndef SHADERCOMPILERGLES3_H +#define SHADERCOMPILERGLES3_H + +#include "servers/visual/shader_language.h" +#include "servers/visual/shader_types.h" +#include "servers/visual_server.h" +#include "pair.h" + +class ShaderCompilerGLES3 { +public: + struct IdentifierActions { + + Map<StringName,Pair<int*,int> > render_mode_values; + Map<StringName,bool*> render_mode_flags; + Map<StringName,bool*> usage_flag_pointers; + + Map<StringName,ShaderLanguage::ShaderNode::Uniform> *uniforms; + }; + + struct GeneratedCode { + + Vector<CharString> defines; + Vector<StringName> texture_uniforms; + Vector<ShaderLanguage::ShaderNode::Uniform::Hint> texture_hints; + + Vector<uint32_t> uniform_offsets; + uint32_t uniform_total_size; + String uniforms; + String vertex_global; + String vertex; + String fragment_global; + String fragment; + String light; + + bool uses_fragment_time; + bool uses_vertex_time; + + }; + +private: + + ShaderLanguage parser; + + struct DefaultIdentifierActions { + + Map<StringName,String> renames; + Map<StringName,String> render_mode_defines; + Map<StringName,String> usage_defines; + }; + + void _dump_function_deps(ShaderLanguage::ShaderNode *p_node, const StringName& p_for_func, const Map<StringName, String> &p_func_code, String& r_to_add,Set<StringName> &added); + String _dump_node_code(ShaderLanguage::Node *p_node, int p_level, GeneratedCode &r_gen_code, IdentifierActions& p_actions, const DefaultIdentifierActions& p_default_actions); + + + StringName current_func_name; + StringName vertex_name; + StringName fragment_name; + StringName time_name; + + Set<StringName> used_name_defines; + Set<StringName> used_flag_pointers; + Set<StringName> used_rmode_defines; + Set<StringName> internal_functions; + + + DefaultIdentifierActions actions[VS::SHADER_MAX]; + +public: + + + Error compile(VS::ShaderMode p_mode, const String& p_code, IdentifierActions* p_actions, const String& p_path, GeneratedCode& r_gen_code); + + + ShaderCompilerGLES3(); +}; + +#endif // SHADERCOMPILERGLES3_H diff --git a/drivers/gles3/shader_gles3.cpp b/drivers/gles3/shader_gles3.cpp new file mode 100644 index 0000000000..13b2160ec6 --- /dev/null +++ b/drivers/gles3/shader_gles3.cpp @@ -0,0 +1,839 @@ +/*************************************************************************/ +/* shader_gles2.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ +#include "shader_gles3.h" + + +#include "print_string.h" + +//#define DEBUG_OPENGL + +#ifdef DEBUG_OPENGL + +#define DEBUG_TEST_ERROR(m_section)\ +{\ + uint32_t err = glGetError();\ + if (err) {\ + print_line("OpenGL Error #"+itos(err)+" at: "+m_section);\ + }\ +} +#else + +#define DEBUG_TEST_ERROR(m_section) + +#endif + +ShaderGLES3 *ShaderGLES3::active=NULL; + + + +//#define DEBUG_SHADER + +#ifdef DEBUG_SHADER + +#define DEBUG_PRINT(m_text) print_line(m_text); + +#else + +#define DEBUG_PRINT(m_text) + +#endif + + +void ShaderGLES3::bind_uniforms() { + + if (!uniforms_dirty) { + return; + }; + + // upload default uniforms + const Map<uint32_t,Variant>::Element *E =uniform_defaults.front(); + + while(E) { + int idx=E->key(); + int location=version->uniform_location[idx]; + + if (location<0) { + E=E->next(); + continue; + + } + + const Variant &v=E->value(); + _set_uniform_variant(location, v); + //print_line("uniform "+itos(location)+" value "+v+ " type "+Variant::get_type_name(v.get_type())); + E=E->next(); + }; + + const Map<uint32_t,CameraMatrix>::Element* C = uniform_cameras.front(); + while (C) { + + int location = version->uniform_location[C->key()]; + if (location<0) { + C=C->next(); + continue; + } + + glUniformMatrix4fv(location,1,false,&(C->get().matrix[0][0])); + C = C->next(); + }; + + uniforms_dirty = false; +}; + +GLint ShaderGLES3::get_uniform_location(int p_idx) const { + + ERR_FAIL_COND_V(!version, -1); + + return version->uniform_location[p_idx]; +}; + +bool ShaderGLES3::bind() { + + if (active!=this || !version || new_conditional_version.key!=conditional_version.key) { + conditional_version=new_conditional_version; + version = get_current_version(); + } else { + + return false; + } + + ERR_FAIL_COND_V(!version,false); + + glUseProgram( version->id ); + + DEBUG_TEST_ERROR("Use Program"); + + active=this; + uniforms_dirty = true; +/* + * why on earth is this code here? + for (int i=0;i<texunit_pair_count;i++) { + + glUniform1i(texunit_pairs[i].location, texunit_pairs[i].index); + DEBUG_TEST_ERROR("Uniform 1 i"); + } + +*/ + return true; +} + +void ShaderGLES3::unbind() { + + version=NULL; + glUseProgram(0); + uniforms_dirty = true; + active=NULL; +} + + +static void _display_error_with_code(const String& p_error,const Vector<const char*>& p_code) { + + + int line=1; + String total_code; + + for(int i=0;i<p_code.size();i++) { + total_code+=String(p_code[i]); + } + + Vector<String> lines = String(total_code).split("\n"); + + for(int j=0;j<lines.size();j++) { + + print_line(itos(line)+": "+lines[j]); + line++; + } + + ERR_PRINTS(p_error); + +} + +ShaderGLES3::Version* ShaderGLES3::get_current_version() { + + Version *_v=version_map.getptr(conditional_version); + + if (_v) { + + if (conditional_version.code_version!=0) { + CustomCode *cc=custom_code_map.getptr(conditional_version.code_version); + ERR_FAIL_COND_V(!cc,_v); + if (cc->version==_v->code_version) + return _v; + } else { + return _v; + } + + } + + + + if (!_v) + version_map[conditional_version]=Version(); + + + Version &v = version_map[conditional_version]; + + if (!_v) { + + v.uniform_location = memnew_arr( GLint, uniform_count ); + + } else { + if (v.ok) { + //bye bye shaders + glDeleteShader( v.vert_id ); + glDeleteShader( v.frag_id ); + glDeleteProgram( v.id ); + v.id=0; + } + + } + + + + v.ok=false; + /* SETUP CONDITIONALS */ + + Vector<const char*> strings; +#ifdef GLES_OVER_GL + strings.push_back("#version 330\n"); +#else + strings.push_back("#version 300 es\n"); +#endif + + + + int define_line_ofs=1; + + for(int i=0;i<custom_defines.size();i++) { + + strings.push_back(custom_defines[i].get_data()); + define_line_ofs++; + } + + for(int j=0;j<conditional_count;j++) { + + bool enable=((1<<j)&conditional_version.version); + strings.push_back(enable?conditional_defines[j]:""); + if (enable) + define_line_ofs++; + + if (enable) { + DEBUG_PRINT(conditional_defines[j]); + } + + } + + + + //keep them around during the function + CharString code_string; + CharString code_string2; + CharString code_globals; + CharString material_string; + + + //print_line("code version? "+itos(conditional_version.code_version)); + + CustomCode *cc=NULL; + + if ( conditional_version.code_version>0 ) { + //do custom code related stuff + + ERR_FAIL_COND_V( !custom_code_map.has( conditional_version.code_version ), NULL ); + cc=&custom_code_map[conditional_version.code_version]; + v.code_version=cc->version; + define_line_ofs+=2; + + } + + + /* CREATE PROGRAM */ + + v.id = glCreateProgram(); + + ERR_FAIL_COND_V(v.id==0, NULL); + + /* VERTEX SHADER */ + + + if (cc) { + for(int i=0;i<cc->custom_defines.size();i++) { + + strings.push_back(cc->custom_defines[i].get_data()); + DEBUG_PRINT("CD #"+itos(i)+": "+String(cc->custom_defines[i])); + } + } + + int strings_base_size=strings.size(); + + //vertex precision is high + strings.push_back("precision highp float;\n"); + strings.push_back("precision highp int;\n"); + +#if 0 + if (cc) { + + String _code_string = "#define VERTEX_SHADER_CODE "+cc->vertex+"\n"; + String _code_globals = "#define VERTEX_SHADER_GLOBALS "+cc->vertex_globals+"\n"; + + code_string=_code_string.ascii(); + code_globals=_code_globals.ascii(); + DEBUG_PRINT( code_globals.get_data() ); + DEBUG_PRINT( code_string.get_data() ); + strings.push_back(code_globals); + strings.push_back(code_string); + } +#endif + + + strings.push_back(vertex_code0.get_data()); + if (cc) { + code_globals=cc->vertex_globals.ascii(); + strings.push_back(code_globals.get_data()); + } + + strings.push_back(vertex_code1.get_data()); + + if (cc) { + material_string=cc->uniforms.ascii(); + strings.push_back(material_string.get_data()); + } + + strings.push_back(vertex_code2.get_data()); + + if (cc) { + code_string=cc->vertex.ascii(); + strings.push_back(code_string.get_data()); + } + + strings.push_back(vertex_code3.get_data()); +#ifdef DEBUG_SHADER + + DEBUG_PRINT("\nVertex Code:\n\n"+String(code_string.get_data())); + for(int i=0;i<strings.size();i++) { + + //print_line("vert strings "+itos(i)+":"+String(strings[i])); + } +#endif + + + v.vert_id = glCreateShader(GL_VERTEX_SHADER); + glShaderSource(v.vert_id,strings.size(),&strings[0],NULL); + glCompileShader(v.vert_id); + + GLint status; + + glGetShaderiv(v.vert_id,GL_COMPILE_STATUS,&status); + if (status==GL_FALSE) { + // error compiling + GLsizei iloglen; + glGetShaderiv(v.vert_id,GL_INFO_LOG_LENGTH,&iloglen); + + if (iloglen<0) { + + glDeleteShader(v.vert_id); + glDeleteProgram( v.id ); + v.id=0; + + ERR_PRINT("NO LOG, WTF"); + } else { + + if (iloglen==0) { + + iloglen = 4096; //buggy driver (Adreno 220+....) + } + + + char *ilogmem = (char*)memalloc(iloglen+1); + ilogmem[iloglen]=0; + glGetShaderInfoLog(v.vert_id, iloglen, &iloglen, ilogmem); + + String err_string=get_shader_name()+": Vertex Program Compilation Failed:\n"; + + err_string+=ilogmem; + _display_error_with_code(err_string,strings); + memfree(ilogmem); + glDeleteShader(v.vert_id); + glDeleteProgram( v.id ); + v.id=0; + + } + + ERR_FAIL_V(NULL); + } + + + /* FRAGMENT SHADER */ + + strings.resize(strings_base_size); + //fragment precision is medium + strings.push_back("precision highp float;\n"); + strings.push_back("precision highp int;\n"); + +#if 0 + if (cc) { + + String _code_string = "#define FRAGMENT_SHADER_CODE "+cc->fragment+"\n"; + String _code_globals = "#define FRAGMENT_SHADER_GLOBALS "+cc->fragment_globals+"\n"; + + code_string=_code_string.ascii(); + code_globals=_code_globals.ascii(); + DEBUG_PRINT( code_globals.get_data() ); + DEBUG_PRINT( code_string.get_data() ); + strings.push_back(code_globals); + strings.push_back(code_string); + } +#endif + + + strings.push_back(fragment_code0.get_data()); + if (cc) { + code_globals=cc->fragment_globals.ascii(); + strings.push_back(code_globals.get_data()); + } + + strings.push_back(fragment_code1.get_data()); + + if (cc) { + material_string=cc->uniforms.ascii(); + strings.push_back(material_string.get_data()); + } + + strings.push_back(fragment_code2.get_data()); + + if (cc) { + code_string=cc->fragment.ascii(); + strings.push_back(code_string.get_data()); + } + + strings.push_back(fragment_code3.get_data()); + + if (cc) { + code_string2=cc->light.ascii(); + strings.push_back(code_string2.get_data()); + } + + strings.push_back(fragment_code4.get_data()); + +#ifdef DEBUG_SHADER + DEBUG_PRINT("\nFragment Code:\n\n"+String(code_string.get_data())); + for(int i=0;i<strings.size();i++) { + + //print_line("frag strings "+itos(i)+":"+String(strings[i])); + } +#endif + + v.frag_id = glCreateShader(GL_FRAGMENT_SHADER); + glShaderSource(v.frag_id,strings.size(),&strings[0],NULL); + glCompileShader(v.frag_id); + + glGetShaderiv(v.frag_id,GL_COMPILE_STATUS,&status); + if (status==GL_FALSE) { + // error compiling + GLsizei iloglen; + glGetShaderiv(v.frag_id,GL_INFO_LOG_LENGTH,&iloglen); + + if (iloglen<0) { + + glDeleteShader(v.frag_id); + glDeleteShader(v.vert_id); + glDeleteProgram( v.id ); + v.id=0; + ERR_PRINT("NO LOG, WTF"); + } else { + + if (iloglen==0) { + + iloglen = 4096; //buggy driver (Adreno 220+....) + } + + char *ilogmem = (char*)memalloc(iloglen+1); + ilogmem[iloglen]=0; + glGetShaderInfoLog(v.frag_id, iloglen, &iloglen, ilogmem); + + String err_string=get_shader_name()+": Fragment Program Compilation Failed:\n"; + + err_string+=ilogmem; + _display_error_with_code(err_string,strings); + ERR_PRINT(err_string.ascii().get_data()); + memfree(ilogmem); + glDeleteShader(v.frag_id); + glDeleteShader(v.vert_id); + glDeleteProgram( v.id ); + v.id=0; + + } + + ERR_FAIL_V( NULL ); + } + + glAttachShader(v.id,v.frag_id); + glAttachShader(v.id,v.vert_id); + + // bind attributes before linking + for (int i=0;i<attribute_pair_count;i++) { + + glBindAttribLocation(v.id, attribute_pairs[i].index, attribute_pairs[i].name ); + } + + //if feedback exists, set it up + + if (feedback_count) { + Vector<const char*> feedback; + for(int i=0;i<feedback_count;i++) { + + if (feedbacks[i].conditional==-1 || (1<<feedbacks[i].conditional)&conditional_version.version) { + //conditional for this feedback is enabled + print_line("tf varying: "+itos(feedback.size())+" "+String(feedbacks[i].name)); + feedback.push_back(feedbacks[i].name); + } + } + + if (feedback.size()) { + glTransformFeedbackVaryings(v.id,feedback.size(),feedback.ptr(),GL_INTERLEAVED_ATTRIBS ); + } + + } + + glLinkProgram(v.id); + + glGetProgramiv(v.id, GL_LINK_STATUS, &status); + + if (status==GL_FALSE) { + // error linking + GLsizei iloglen; + glGetProgramiv(v.id,GL_INFO_LOG_LENGTH,&iloglen); + + if (iloglen<0) { + + glDeleteShader(v.frag_id); + glDeleteShader(v.vert_id); + glDeleteProgram( v.id ); + v.id=0; + ERR_FAIL_COND_V(iloglen<=0, NULL); + } + + if (iloglen==0) { + + iloglen = 4096; //buggy driver (Adreno 220+....) + } + + + char *ilogmem = (char*)Memory::alloc_static(iloglen+1); + ilogmem[iloglen]=0; + glGetProgramInfoLog(v.id, iloglen, &iloglen, ilogmem); + + String err_string=get_shader_name()+": Program LINK FAILED:\n"; + + err_string+=ilogmem; + _display_error_with_code(err_string,strings); + ERR_PRINT(err_string.ascii().get_data()); + Memory::free_static(ilogmem); + glDeleteShader(v.frag_id); + glDeleteShader(v.vert_id); + glDeleteProgram( v.id ); + v.id=0; + + ERR_FAIL_V(NULL); + } + + /* UNIFORMS */ + + glUseProgram(v.id); + + + //print_line("uniforms: "); + for(int j=0;j<uniform_count;j++) { + + + v.uniform_location[j]=glGetUniformLocation(v.id,uniform_names[j]); + // print_line("uniform "+String(uniform_names[j])+" location "+itos(v.uniform_location[j])); + } + + // set texture uniforms + for (int i=0;i<texunit_pair_count;i++) { + + GLint loc = glGetUniformLocation(v.id,texunit_pairs[i].name); + if (loc>=0) { + if (texunit_pairs[i].index<0) { + glUniform1i(loc,max_image_units+texunit_pairs[i].index); //negative, goes down + } else { + + glUniform1i(loc,texunit_pairs[i].index); + } + } + } + + // assign uniform block bind points + for (int i=0;i<ubo_count;i++) { + + GLint loc = glGetUniformBlockIndex(v.id,ubo_pairs[i].name); + if (loc>=0) + glUniformBlockBinding(v.id,loc,ubo_pairs[i].index); + } + + if ( cc ) { + + v.texture_uniform_locations.resize(cc->texture_uniforms.size()); + for(int i=0;i<cc->texture_uniforms.size();i++) { + + v.texture_uniform_locations[i]=glGetUniformLocation(v.id,String(cc->texture_uniforms[i]).ascii().get_data()); + glUniform1i(v.texture_uniform_locations[i],i+base_material_tex_index); + } + } + + glUseProgram(0); + + + v.ok=true; + + return &v; +} + +GLint ShaderGLES3::get_uniform_location(const String& p_name) const { + + ERR_FAIL_COND_V(!version,-1); + return glGetUniformLocation(version->id,p_name.ascii().get_data()); +} + + +void ShaderGLES3::setup(const char** p_conditional_defines, int p_conditional_count,const char** p_uniform_names,int p_uniform_count, const AttributePair* p_attribute_pairs, int p_attribute_count, const TexUnitPair *p_texunit_pairs, int p_texunit_pair_count, const UBOPair *p_ubo_pairs, int p_ubo_pair_count, const Feedback* p_feedback, int p_feedback_count,const char*p_vertex_code, const char *p_fragment_code,int p_vertex_code_start,int p_fragment_code_start) { + + ERR_FAIL_COND(version); + conditional_version.key=0; + new_conditional_version.key=0; + uniform_count=p_uniform_count; + conditional_count=p_conditional_count; + conditional_defines=p_conditional_defines; + uniform_names=p_uniform_names; + vertex_code=p_vertex_code; + fragment_code=p_fragment_code; + texunit_pairs=p_texunit_pairs; + texunit_pair_count=p_texunit_pair_count; + vertex_code_start=p_vertex_code_start; + fragment_code_start=p_fragment_code_start; + attribute_pairs=p_attribute_pairs; + attribute_pair_count=p_attribute_count; + ubo_pairs=p_ubo_pairs; + ubo_count=p_ubo_pair_count; + feedbacks=p_feedback; + feedback_count=p_feedback_count; + + //split vertex and shader code (thank you, retarded shader compiler programmers from you know what company). + { + String globals_tag="\nVERTEX_SHADER_GLOBALS"; + String material_tag="\nMATERIAL_UNIFORMS"; + String code_tag="\nVERTEX_SHADER_CODE"; + String code = vertex_code; + int cpos = code.find(globals_tag); + if (cpos==-1) { + vertex_code0=code.ascii(); + } else { + vertex_code0=code.substr(0,cpos).ascii(); + code = code.substr(cpos+globals_tag.length(),code.length()); + + cpos = code.find(material_tag); + + if (cpos==-1) { + vertex_code1=code.ascii(); + } else { + + vertex_code1=code.substr(0,cpos).ascii(); + String code2 = code.substr(cpos+material_tag.length(),code.length()); + + cpos = code2.find(code_tag); + if (cpos==-1) { + vertex_code2=code2.ascii(); + } else { + + vertex_code2=code2.substr(0,cpos).ascii(); + vertex_code3 = code2.substr(cpos+code_tag.length(),code2.length()).ascii(); + } + + } + } + } + + { + String globals_tag="\nFRAGMENT_SHADER_GLOBALS"; + String material_tag="\nMATERIAL_UNIFORMS"; + String code_tag="\nFRAGMENT_SHADER_CODE"; + String light_code_tag="\nLIGHT_SHADER_CODE"; + String code = fragment_code; + int cpos = code.find(globals_tag); + if (cpos==-1) { + fragment_code0=code.ascii(); + } else { + fragment_code0=code.substr(0,cpos).ascii(); + //print_line("CODE0:\n"+String(fragment_code0.get_data())); + code = code.substr(cpos+globals_tag.length(),code.length()); + cpos = code.find(material_tag); + + if (cpos==-1) { + fragment_code1=code.ascii(); + } else { + + fragment_code1=code.substr(0,cpos).ascii(); + //print_line("CODE1:\n"+String(fragment_code1.get_data())); + + String code2 = code.substr(cpos+material_tag.length(),code.length()); + cpos = code2.find(code_tag); + + if (cpos==-1) { + fragment_code2=code2.ascii(); + } else { + + fragment_code2=code2.substr(0,cpos).ascii(); + //print_line("CODE2:\n"+String(fragment_code2.get_data())); + + String code3 = code2.substr(cpos+code_tag.length(),code2.length()); + + cpos = code3.find(light_code_tag); + if (cpos==-1) { + fragment_code3=code3.ascii(); + } else { + + fragment_code3=code3.substr(0,cpos).ascii(); + // print_line("CODE3:\n"+String(fragment_code3.get_data())); + fragment_code4 = code3.substr(cpos+light_code_tag.length(),code3.length()).ascii(); + //print_line("CODE4:\n"+String(fragment_code4.get_data())); + } + } + } + } + } + + glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS,&max_image_units); + +} + +void ShaderGLES3::finish() { + + const VersionKey *V=NULL; + while((V=version_map.next(V))) { + + Version &v=version_map[*V]; + glDeleteShader( v.vert_id ); + glDeleteShader( v.frag_id ); + glDeleteProgram( v.id ); + memdelete_arr( v.uniform_location ); + + } + +} + + +void ShaderGLES3::clear_caches() { + + const VersionKey *V=NULL; + while((V=version_map.next(V))) { + + Version &v=version_map[*V]; + glDeleteShader( v.vert_id ); + glDeleteShader( v.frag_id ); + glDeleteProgram( v.id ); + memdelete_arr( v.uniform_location ); + } + + version_map.clear(); + + custom_code_map.clear(); + version=NULL; + last_custom_code=1; + uniforms_dirty = true; + +} + +uint32_t ShaderGLES3::create_custom_shader() { + + custom_code_map[last_custom_code]=CustomCode(); + custom_code_map[last_custom_code].version=1; + return last_custom_code++; +} + +void ShaderGLES3::set_custom_shader_code(uint32_t p_code_id, const String& p_vertex, const String& p_vertex_globals, const String& p_fragment, const String& p_light, const String& p_fragment_globals, const String &p_uniforms, const Vector<StringName> &p_texture_uniforms, const Vector<CharString> &p_custom_defines) { + + ERR_FAIL_COND(!custom_code_map.has(p_code_id)); + CustomCode *cc=&custom_code_map[p_code_id]; + + + cc->vertex=p_vertex; + cc->vertex_globals=p_vertex_globals; + cc->fragment=p_fragment; + cc->fragment_globals=p_fragment_globals; + cc->light=p_light; + cc->texture_uniforms=p_texture_uniforms; + cc->uniforms=p_uniforms; + cc->custom_defines=p_custom_defines; + cc->version++; +} + +void ShaderGLES3::set_custom_shader(uint32_t p_code_id) { + + new_conditional_version.code_version=p_code_id; +} + +void ShaderGLES3::free_custom_shader(uint32_t p_code_id) { + + /* if (! custom_code_map.has( p_code_id )) { + print_line("no code id "+itos(p_code_id)); + } else { + print_line("freed code id "+itos(p_code_id)); + + }*/ + + ERR_FAIL_COND(! custom_code_map.has( p_code_id )); + if (conditional_version.code_version==p_code_id) + conditional_version.code_version=0; //bye + + custom_code_map.erase(p_code_id); + +} + +void ShaderGLES3::set_base_material_tex_index(int p_idx) { + + base_material_tex_index=p_idx; +} + +ShaderGLES3::ShaderGLES3() { + version=NULL; + last_custom_code=1; + uniforms_dirty = true; + base_material_tex_index=0; + +} + + +ShaderGLES3::~ShaderGLES3() { + + finish(); +} + + + diff --git a/drivers/gles3/shader_gles3.h b/drivers/gles3/shader_gles3.h new file mode 100644 index 0000000000..ee8db2ac8c --- /dev/null +++ b/drivers/gles3/shader_gles3.h @@ -0,0 +1,399 @@ +/*************************************************************************/ +/* shader_gles2.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ +#ifndef SHADER_GLES3_H +#define SHADER_GLES3_H + +#include <stdio.h> + +#include "platform_config.h" +#ifndef GLES3_INCLUDE_H +#include <GLES3/gl3.h> +#else +#include GLES3_INCLUDE_H +#endif + +#include "hash_map.h" +#include "map.h" +#include "variant.h" +#include "camera_matrix.h" + +/** + @author Juan Linietsky <reduzio@gmail.com> +*/ + + +class ShaderGLES3 { +protected: + + struct Enum { + + uint64_t mask; + uint64_t shift; + const char *defines[16]; + }; + + struct EnumValue { + + uint64_t set_mask; + uint64_t clear_mask; + }; + + struct AttributePair { + + const char *name; + int index; + }; + + struct UniformPair { + const char* name; + Variant::Type type_hint; + }; + + struct TexUnitPair { + + const char *name; + int index; + }; + + struct UBOPair { + + const char *name; + int index; + }; + + struct Feedback { + + const char *name; + int conditional; + }; + + bool uniforms_dirty; +private: + + //@TODO Optimize to a fixed set of shader pools and use a LRU + int uniform_count; + int texunit_pair_count; + int conditional_count; + int ubo_count; + int feedback_count; + int vertex_code_start; + int fragment_code_start; + int attribute_pair_count; + + struct CustomCode { + + String vertex; + String vertex_globals; + String fragment; + String fragment_globals; + String light; + String uniforms; + uint32_t version; + Vector<StringName> texture_uniforms; + Vector<CharString> custom_defines; + + }; + + + struct Version { + + GLuint id; + GLuint vert_id; + GLuint frag_id; + GLint *uniform_location; + Vector<GLint> texture_uniform_locations; + uint32_t code_version; + bool ok; + Version() { code_version=0; ok=false; uniform_location=NULL; } + }; + + Version *version; + + union VersionKey { + + struct { + uint32_t version; + uint32_t code_version; + }; + uint64_t key; + bool operator==(const VersionKey& p_key) const { return key==p_key.key; } + bool operator<(const VersionKey& p_key) const { return key<p_key.key; } + + }; + + struct VersionKeyHash { + + static _FORCE_INLINE_ uint32_t hash( const VersionKey& p_key) { return HashMapHahserDefault::hash(p_key.key); }; + }; + + //this should use a way more cachefriendly version.. + HashMap<VersionKey,Version,VersionKeyHash> version_map; + + HashMap<uint32_t,CustomCode> custom_code_map; + uint32_t last_custom_code; + + + VersionKey conditional_version; + VersionKey new_conditional_version; + + virtual String get_shader_name() const=0; + + const char** conditional_defines; + const char** uniform_names; + const AttributePair *attribute_pairs; + const TexUnitPair *texunit_pairs; + const UBOPair *ubo_pairs; + const Feedback *feedbacks; + const char* vertex_code; + const char* fragment_code; + CharString fragment_code0; + CharString fragment_code1; + CharString fragment_code2; + CharString fragment_code3; + CharString fragment_code4; + + CharString vertex_code0; + CharString vertex_code1; + CharString vertex_code2; + CharString vertex_code3; + + Vector<CharString> custom_defines; + + int base_material_tex_index; + + Version * get_current_version(); + + static ShaderGLES3 *active; + + int max_image_units; + + _FORCE_INLINE_ void _set_uniform_variant(GLint p_uniform,const Variant& p_value) { + + if (p_uniform<0) + return; // do none + switch(p_value.get_type()) { + + case Variant::BOOL: + case Variant::INT: { + + int val=p_value; + glUniform1i( p_uniform, val ); + } break; + case Variant::REAL: { + + real_t val=p_value; + glUniform1f( p_uniform, val ); + } break; + case Variant::COLOR: { + + Color val=p_value; + glUniform4f( p_uniform, val.r, val.g,val.b,val.a ); + } break; + case Variant::VECTOR2: { + + Vector2 val=p_value; + glUniform2f( p_uniform, val.x,val.y ); + } break; + case Variant::VECTOR3: { + + Vector3 val=p_value; + glUniform3f( p_uniform, val.x,val.y,val.z ); + } break; + case Variant::PLANE: { + + Plane val=p_value; + glUniform4f( p_uniform, val.normal.x,val.normal.y,val.normal.z,val.d ); + } break; + case Variant::QUAT: { + + Quat val=p_value; + glUniform4f( p_uniform, val.x,val.y,val.z,val.w ); + } break; + + case Variant::TRANSFORM2D: { + + Transform2D tr=p_value; + GLfloat matrix[16]={ /* build a 16x16 matrix */ + tr.elements[0][0], + tr.elements[0][1], + 0, + 0, + tr.elements[1][0], + tr.elements[1][1], + 0, + 0, + 0, + 0, + 1, + 0, + tr.elements[2][0], + tr.elements[2][1], + 0, + 1 + }; + + glUniformMatrix4fv(p_uniform,1,false,matrix); + + } break; + case Variant::BASIS: + case Variant::TRANSFORM: { + + Transform tr=p_value; + GLfloat matrix[16]={ /* build a 16x16 matrix */ + tr.basis.elements[0][0], + tr.basis.elements[1][0], + tr.basis.elements[2][0], + 0, + tr.basis.elements[0][1], + tr.basis.elements[1][1], + tr.basis.elements[2][1], + 0, + tr.basis.elements[0][2], + tr.basis.elements[1][2], + tr.basis.elements[2][2], + 0, + tr.origin.x, + tr.origin.y, + tr.origin.z, + 1 + }; + + + glUniformMatrix4fv(p_uniform,1,false,matrix); + } break; + default: { ERR_FAIL(); } // do nothing + + } + } + + Map<uint32_t,Variant> uniform_defaults; + Map<uint32_t,CameraMatrix> uniform_cameras; + + +protected: + + _FORCE_INLINE_ int _get_uniform(int p_which) const; + _FORCE_INLINE_ void _set_conditional(int p_which, bool p_value); + + void setup(const char** p_conditional_defines, int p_conditional_count,const char** p_uniform_names,int p_uniform_count, const AttributePair* p_attribute_pairs, int p_attribute_count, const TexUnitPair *p_texunit_pairs, int p_texunit_pair_count, const UBOPair *p_ubo_pairs,int p_ubo_pair_count, const Feedback* p_feedback, int p_feedback_count,const char*p_vertex_code, const char *p_fragment_code,int p_vertex_code_start,int p_fragment_code_start); + + ShaderGLES3(); +public: + + enum { + CUSTOM_SHADER_DISABLED=0 + }; + + GLint get_uniform_location(const String& p_name) const; + GLint get_uniform_location(int p_uniform) const; + + static _FORCE_INLINE_ ShaderGLES3 *get_active() { return active; }; + bool bind(); + void unbind(); + void bind_uniforms(); + + + inline GLuint get_program() const { return version?version->id:0; } + + void clear_caches(); + + uint32_t create_custom_shader(); + void set_custom_shader_code(uint32_t p_id,const String& p_vertex, const String& p_vertex_globals,const String& p_fragment,const String& p_p_light,const String& p_fragment_globals,const String& p_uniforms,const Vector<StringName>& p_texture_uniforms,const Vector<CharString> &p_custom_defines); + void set_custom_shader(uint32_t p_id); + void free_custom_shader(uint32_t p_id); + + void set_uniform_default(int p_idx, const Variant& p_value) { + + if (p_value.get_type()==Variant::NIL) { + + uniform_defaults.erase(p_idx); + } else { + + uniform_defaults[p_idx]=p_value; + } + uniforms_dirty = true; + } + + uint32_t get_version() const { return new_conditional_version.version; } + + void set_uniform_camera(int p_idx, const CameraMatrix& p_mat) { + + uniform_cameras[p_idx] = p_mat; + uniforms_dirty = true; + }; + + _FORCE_INLINE_ void set_texture_uniform(int p_idx, const Variant& p_value) { + + ERR_FAIL_COND(!version); + ERR_FAIL_INDEX(p_idx,version->texture_uniform_locations.size()); + _set_uniform_variant( version->texture_uniform_locations[p_idx], p_value ); + } + + _FORCE_INLINE_ GLint get_texture_uniform_location(int p_idx) { + + ERR_FAIL_COND_V(!version,-1); + ERR_FAIL_INDEX_V(p_idx,version->texture_uniform_locations.size(),-1); + return version->texture_uniform_locations[p_idx]; + } + + virtual void init()=0; + void finish(); + + void set_base_material_tex_index(int p_idx); + + void add_custom_define(const String& p_define) { + custom_defines.push_back(p_define.utf8()); + } + + virtual ~ShaderGLES3(); + +}; + + +// called a lot, made inline + + +int ShaderGLES3::_get_uniform(int p_which) const { + + ERR_FAIL_INDEX_V( p_which, uniform_count,-1 ); + ERR_FAIL_COND_V( !version, -1 ); + return version->uniform_location[p_which]; +} + +void ShaderGLES3::_set_conditional(int p_which, bool p_value) { + + ERR_FAIL_INDEX(p_which,conditional_count); + if (p_value) + new_conditional_version.version|=(1<<p_which); + else + new_conditional_version.version&=~(1<<p_which); +} + +#endif + diff --git a/drivers/gles3/shaders/SCsub b/drivers/gles3/shaders/SCsub new file mode 100644 index 0000000000..f9baeae97d --- /dev/null +++ b/drivers/gles3/shaders/SCsub @@ -0,0 +1,22 @@ +Import('env') + +if env['BUILDERS'].has_key('GLES3_GLSL'): + env.GLES3_GLSL('copy.glsl'); + env.GLES3_GLSL('resolve.glsl'); + env.GLES3_GLSL('canvas.glsl'); + env.GLES3_GLSL('canvas_shadow.glsl'); + env.GLES3_GLSL('scene.glsl'); + env.GLES3_GLSL('cubemap_filter.glsl'); + env.GLES3_GLSL('cube_to_dp.glsl'); + env.GLES3_GLSL('blend_shape.glsl'); + env.GLES3_GLSL('screen_space_reflection.glsl'); + env.GLES3_GLSL('effect_blur.glsl'); + env.GLES3_GLSL('subsurf_scattering.glsl'); + env.GLES3_GLSL('ssao.glsl'); + env.GLES3_GLSL('ssao_minify.glsl'); + env.GLES3_GLSL('ssao_blur.glsl'); + env.GLES3_GLSL('exposure.glsl'); + env.GLES3_GLSL('tonemap.glsl'); + env.GLES3_GLSL('particles.glsl'); + + diff --git a/drivers/gles3/shaders/blend_shape.glsl b/drivers/gles3/shaders/blend_shape.glsl new file mode 100644 index 0000000000..4e0d066823 --- /dev/null +++ b/drivers/gles3/shaders/blend_shape.glsl @@ -0,0 +1,197 @@ +[vertex] + + +/* +from VisualServer: + +ARRAY_VERTEX=0, +ARRAY_NORMAL=1, +ARRAY_TANGENT=2, +ARRAY_COLOR=3, +ARRAY_TEX_UV=4, +ARRAY_TEX_UV2=5, +ARRAY_BONES=6, +ARRAY_WEIGHTS=7, +ARRAY_INDEX=8, +*/ + +#ifdef USE_2D_VERTEX +#define VFORMAT vec2 +#else +#define VFORMAT vec3 +#endif + +/* INPUT ATTRIBS */ + +layout(location=0) in highp VFORMAT vertex_attrib; +layout(location=1) in vec3 normal_attrib; + +#ifdef ENABLE_TANGENT +layout(location=2) in vec4 tangent_attrib; +#endif + +#ifdef ENABLE_COLOR +layout(location=3) in vec4 color_attrib; +#endif + +#ifdef ENABLE_UV +layout(location=4) in vec2 uv_attrib; +#endif + +#ifdef ENABLE_UV2 +layout(location=5) in vec2 uv2_attrib; +#endif + +#ifdef ENABLE_SKELETON +layout(location=6) in ivec4 bone_attrib; +layout(location=7) in vec4 weight_attrib; +#endif + +/* BLEND ATTRIBS */ + +#ifdef ENABLE_BLEND + +layout(location=8) in highp VFORMAT vertex_attrib_blend; +layout(location=9) in vec3 normal_attrib_blend; + +#ifdef ENABLE_TANGENT +layout(location=10) in vec4 tangent_attrib_blend; +#endif + +#ifdef ENABLE_COLOR +layout(location=11) in vec4 color_attrib_blend; +#endif + +#ifdef ENABLE_UV +layout(location=12) in vec2 uv_attrib_blend; +#endif + +#ifdef ENABLE_UV2 +layout(location=13) in vec2 uv2_attrib_blend; +#endif + +#ifdef ENABLE_SKELETON +layout(location=14) in ivec4 bone_attrib_blend; +layout(location=15) in vec4 weight_attrib_blend; +#endif + +#endif + +/* OUTPUTS */ + +out VFORMAT vertex_out; //tfb: + +#ifdef ENABLE_NORMAL +out vec3 normal_out; //tfb:ENABLE_NORMAL +#endif + +#ifdef ENABLE_TANGENT +out vec4 tangent_out; //tfb:ENABLE_TANGENT +#endif + +#ifdef ENABLE_COLOR +out vec4 color_out; //tfb:ENABLE_COLOR +#endif + +#ifdef ENABLE_UV +out vec2 uv_out; //tfb:ENABLE_UV +#endif + +#ifdef ENABLE_UV2 +out vec2 uv2_out; //tfb:ENABLE_UV2 +#endif + +#ifdef ENABLE_SKELETON +out ivec4 bone_out; //tfb:ENABLE_SKELETON +out vec4 weight_out; //tfb:ENABLE_SKELETON +#endif + +uniform float blend_amount; + +void main() { + + +#ifdef ENABLE_BLEND + + vertex_out = vertex_attrib_blend + vertex_attrib * blend_amount; + +#ifdef ENABLE_NORMAL + normal_out = normal_attrib_blend + normal_attrib * blend_amount; +#endif + +#ifdef ENABLE_TANGENT + + tangent_out.xyz = tangent_attrib_blend.xyz + tangent_attrib.xyz * blend_amount; + tangent_out.w = tangent_attrib_blend.w; //just copy, no point in blending his +#endif + +#ifdef ENABLE_COLOR + + color_out = color_attrib_blend + color_attrib * blend_amount; +#endif + +#ifdef ENABLE_UV + + uv_out = uv_attrib_blend + uv_attrib * blend_amount; +#endif + +#ifdef ENABLE_UV2 + + uv2_out = uv2_attrib_blend + uv2_attrib * blend_amount; +#endif + + +#ifdef ENABLE_SKELETON + + bone_out = bone_attrib_blend; + weight_out = weight_attrib_blend + weight_attrib * blend_amount; +#endif + +#else //ENABLE_BLEND + + + vertex_out = vertex_attrib * blend_amount; + +#ifdef ENABLE_NORMAL + normal_out = normal_attrib * blend_amount; +#endif + +#ifdef ENABLE_TANGENT + + tangent_out.xyz = tangent_attrib.xyz * blend_amount; + tangent_out.w = tangent_attrib.w; //just copy, no point in blending his +#endif + +#ifdef ENABLE_COLOR + + color_out = color_attrib * blend_amount; +#endif + +#ifdef ENABLE_UV + + uv_out = uv_attrib * blend_amount; +#endif + +#ifdef ENABLE_UV2 + + uv2_out = uv2_attrib * blend_amount; +#endif + + +#ifdef ENABLE_SKELETON + + bone_out = bone_attrib; + weight_out = weight_attrib * blend_amount; +#endif + +#endif + gl_Position = vec4(0.0); +} + +[fragment] + + +void main() { + +} + diff --git a/drivers/gles3/shaders/canvas.glsl b/drivers/gles3/shaders/canvas.glsl new file mode 100644 index 0000000000..cf2e0f776f --- /dev/null +++ b/drivers/gles3/shaders/canvas.glsl @@ -0,0 +1,456 @@ +[vertex] + + +layout(location=0) in highp vec2 vertex; +layout(location=3) in vec4 color_attrib; + +#ifdef USE_TEXTURE_RECT + +layout(location=1) in highp vec4 dst_rect; +layout(location=2) in highp vec4 src_rect; + +#else + +layout(location=4) in highp vec2 uv_attrib; + +//skeletn +#endif + + +layout(std140) uniform CanvasItemData { //ubo:0 + + highp mat4 projection_matrix; + highp vec4 time; +}; + +uniform highp mat4 modelview_matrix; +uniform highp mat4 extra_matrix; + + +out mediump vec2 uv_interp; +out mediump vec4 color_interp; + +#ifdef USE_LIGHTING + +layout(std140) uniform LightData { //ubo:1 + + //light matrices + highp mat4 light_matrix; + highp mat4 light_local_matrix; + highp mat4 shadow_matrix; + highp vec4 light_color; + highp vec4 light_shadow_color; + highp vec2 light_pos; + highp float shadowpixel_size; + highp float shadow_gradient; + highp float light_height; + highp float light_outside_alpha; + highp float shadow_distance_mult; +}; + + +out vec4 light_uv_interp; + +#if defined(NORMAL_USED) +out vec4 local_rot; +#endif + +#ifdef USE_SHADOWS +out highp vec2 pos; +#endif + +#endif + + +VERTEX_SHADER_GLOBALS + +#if defined(USE_MATERIAL) + +layout(std140) uniform UniformData { //ubo:2 + +MATERIAL_UNIFORMS + +}; + +#endif + +void main() { + + vec4 vertex_color = color_attrib; + + +#ifdef USE_TEXTURE_RECT + + + uv_interp = src_rect.xy + abs(src_rect.zw) * vertex; + highp vec4 outvec = vec4(dst_rect.xy + dst_rect.zw * mix(vertex,vec2(1.0,1.0)-vertex,lessThan(src_rect.zw,vec2(0.0,0.0))),0.0,1.0); + +#else + uv_interp = uv_attrib; + highp vec4 outvec = vec4(vertex,0.0,1.0); +#endif + + +{ + vec2 src_vtx=outvec.xy; + +VERTEX_SHADER_CODE + +} + +#if !defined(SKIP_TRANSFORM_USED) + outvec = extra_matrix * outvec; + outvec = modelview_matrix * outvec; +#endif + + color_interp = vertex_color; + +#ifdef USE_PIXEL_SNAP + + outvec.xy=floor(outvec+0.5); +#endif + + + gl_Position = projection_matrix * outvec; + +#ifdef USE_LIGHTING + + light_uv_interp.xy = (light_matrix * outvec).xy; + light_uv_interp.zw =(light_local_matrix * outvec).xy; +#ifdef USE_SHADOWS + pos=outvec.xy; +#endif + +#if defined(NORMAL_USED) + local_rot.xy=normalize( (modelview_matrix * ( extra_matrix * vec4(1.0,0.0,0.0,0.0) )).xy ); + local_rot.zw=normalize( (modelview_matrix * ( extra_matrix * vec4(0.0,1.0,0.0,0.0) )).xy ); +#ifdef USE_TEXTURE_RECT + local_rot.xy*=sign(src_rect.z); + local_rot.zw*=sign(src_rect.w); +#endif + +#endif + +#endif + +} + +[fragment] + + + +uniform mediump sampler2D color_texture; // texunit:0 +uniform highp vec2 color_texpixel_size; + +in mediump vec2 uv_interp; +in mediump vec4 color_interp; + + +#if defined(SCREEN_TEXTURE_USED) + +uniform sampler2D screen_texture; // texunit:-3 + +#endif + +layout(std140) uniform CanvasItemData { + + highp mat4 projection_matrix; + highp vec4 time; +}; + + +#ifdef USE_LIGHTING + +layout(std140) uniform LightData { + + highp mat4 light_matrix; + highp mat4 light_local_matrix; + highp mat4 shadow_matrix; + highp vec4 light_color; + highp vec4 light_shadow_color; + highp vec2 light_pos; + highp float shadowpixel_size; + highp float shadow_gradient; + highp float light_height; + highp float light_outside_alpha; + highp float shadow_distance_mult; +}; + +uniform lowp sampler2D light_texture; // texunit:-1 +in vec4 light_uv_interp; + + +#if defined(NORMAL_USED) +in vec4 local_rot; +#endif + +#ifdef USE_SHADOWS + +uniform highp sampler2D shadow_texture; // texunit:-2 +in highp vec2 pos; + +#endif + +#endif + +uniform mediump vec4 final_modulate; + +FRAGMENT_SHADER_GLOBALS + + +layout(location=0) out mediump vec4 frag_color; + + +#if defined(USE_MATERIAL) + +layout(std140) uniform UniformData { + +MATERIAL_UNIFORMS + +}; + +#endif + +void main() { + + vec4 color = color_interp; +#if defined(NORMAL_USED) + vec3 normal = vec3(0.0,0.0,1.0); +#endif + +#if !defined(COLOR_USED) +//default behavior, texture by color + +#ifdef USE_DISTANCE_FIELD + const float smoothing = 1.0/32.0; + float distance = texture(color_texture, uv_interp).a; + color.a = smoothstep(0.5 - smoothing, 0.5 + smoothing, distance) * color.a; +#else + color *= texture( color_texture, uv_interp ); + +#endif + +#endif + +#if defined(ENABLE_SCREEN_UV) + vec2 screen_uv = gl_FragCoord.xy*screen_uv_mult; +#endif + + +{ + float normal_depth=1.0; + +#if defined(NORMALMAP_USED) + vec3 normal_map=vec3(0.0,0.0,1.0); +#endif + +FRAGMENT_SHADER_CODE + +#if defined(NORMALMAP_USED) + normal = mix(vec3(0.0,0.0,1.0), normal_map * vec3(2.0,-2.0,1.0) - vec3( 1.0, -1.0, 0.0 ), normal_depth ); +#endif + +} +#ifdef DEBUG_ENCODED_32 + highp float enc32 = dot( color,highp vec4(1.0 / (256.0 * 256.0 * 256.0),1.0 / (256.0 * 256.0),1.0 / 256.0,1) ); + color = vec4(vec3(enc32),1.0); +#endif + + + color*=final_modulate; + + + + +#ifdef USE_LIGHTING + + vec2 light_vec = light_uv_interp.zw;; //for shadow and normal mapping + +#if defined(NORMAL_USED) + normal.xy = mat2(local_rot.xy,local_rot.zw) * normal.xy; +#endif + + float att=1.0; + + vec2 light_uv = light_uv_interp.xy; + vec4 light = texture(light_texture,light_uv) * light_color; +#if defined(SHADOW_COLOR_USED) + vec4 shadow_color=vec4(0.0,0.0,0.0,0.0); +#endif + + if (any(lessThan(light_uv_interp.xy,vec2(0.0,0.0))) || any(greaterThanEqual(light_uv_interp.xy,vec2(1.0,1.0)))) { + color.a*=light_outside_alpha; //invisible + + } else { + +#if defined(USE_LIGHT_SHADER_CODE) +//light is written by the light shader + { + vec4 light_out=light*color; +LIGHT_SHADER_CODE + color=light_out; + } + +#else + +#if defined(NORMAL_USED) + vec3 light_normal = normalize(vec3(light_vec,-light_height)); + light*=max(dot(-light_normal,normal),0.0); +#endif + + color*=light; +/* +#ifdef USE_NORMAL + color.xy=local_rot.xy;//normal.xy; + color.zw=vec2(0.0,1.0); +#endif +*/ + +//light shader code +#endif + + +#ifdef USE_SHADOWS + + float angle_to_light = -atan(light_vec.x,light_vec.y); + float PI = 3.14159265358979323846264; + /*int i = int(mod(floor((angle_to_light+7.0*PI/6.0)/(4.0*PI/6.0))+1.0, 3.0)); // +1 pq os indices estao em ordem 2,0,1 nos arrays + float ang*/ + + float su,sz; + + float abs_angle = abs(angle_to_light); + vec2 point; + float sh; + if (abs_angle<45.0*PI/180.0) { + point = light_vec; + sh=0.0+(1.0/8.0); + } else if (abs_angle>135.0*PI/180.0) { + point = -light_vec; + sh = 0.5+(1.0/8.0); + } else if (angle_to_light>0.0) { + + point = vec2(light_vec.y,-light_vec.x); + sh = 0.25+(1.0/8.0); + } else { + + point = vec2(-light_vec.y,light_vec.x); + sh = 0.75+(1.0/8.0); + + } + + + highp vec4 s = shadow_matrix * vec4(point,0.0,1.0); + s.xyz/=s.w; + su=s.x*0.5+0.5; + sz=s.z*0.5+0.5; + //sz=lightlength(light_vec); + + highp float shadow_attenuation=0.0; + +#ifdef USE_RGBA_SHADOWS + +#define SHADOW_DEPTH(m_tex,m_uv) dot(texture2D((m_tex),(m_uv)),vec4(1.0 / (256.0 * 256.0 * 256.0),1.0 / (256.0 * 256.0),1.0 / 256.0,1) ) + +#else + +#define SHADOW_DEPTH(m_tex,m_uv) (texture2D((m_tex),(m_uv)).r) + +#endif + + + +#ifdef SHADOW_USE_GRADIENT + +#define SHADOW_TEST(m_ofs) { highp float sd = SHADOW_DEPTH(shadow_texture,vec2(m_ofs,sh)); shadow_attenuation+=1.0-smoothstep(sd,sd+shadow_gradient,sz); } + +#else + +#define SHADOW_TEST(m_ofs) { highp float sd = SHADOW_DEPTH(shadow_texture,vec2(m_ofs,sh)); shadow_attenuation+=step(sz,sd); } + +#endif + + +#ifdef SHADOW_FILTER_NEAREST + + SHADOW_TEST(su+shadowpixel_size); + +#endif + + +#ifdef SHADOW_FILTER_PCF3 + + SHADOW_TEST(su+shadowpixel_size); + SHADOW_TEST(su); + SHADOW_TEST(su-shadowpixel_size); + shadow_attenuation/=3.0; + +#endif + + +#ifdef SHADOW_FILTER_PCF5 + + SHADOW_TEST(su+shadowpixel_size*3.0); + SHADOW_TEST(su+shadowpixel_size*2.0); + SHADOW_TEST(su+shadowpixel_size); + SHADOW_TEST(su); + SHADOW_TEST(su-shadowpixel_size); + SHADOW_TEST(su-shadowpixel_size*2.0); + SHADOW_TEST(su-shadowpixel_size*3.0); + shadow_attenuation/=5.0; + +#endif + + +#ifdef SHADOW_FILTER_PCF9 + + SHADOW_TEST(su+shadowpixel_size*4.0); + SHADOW_TEST(su+shadowpixel_size*3.0); + SHADOW_TEST(su+shadowpixel_size*2.0); + SHADOW_TEST(su+shadowpixel_size); + SHADOW_TEST(su); + SHADOW_TEST(su-shadowpixel_size); + SHADOW_TEST(su-shadowpixel_size*2.0); + SHADOW_TEST(su-shadowpixel_size*3.0); + SHADOW_TEST(su-shadowpixel_size*4.0); + shadow_attenuation/=9.0; + +#endif + +#ifdef SHADOW_FILTER_PCF13 + + SHADOW_TEST(su+shadowpixel_size*6.0); + SHADOW_TEST(su+shadowpixel_size*5.0); + SHADOW_TEST(su+shadowpixel_size*4.0); + SHADOW_TEST(su+shadowpixel_size*3.0); + SHADOW_TEST(su+shadowpixel_size*2.0); + SHADOW_TEST(su+shadowpixel_size); + SHADOW_TEST(su); + SHADOW_TEST(su-shadowpixel_size); + SHADOW_TEST(su-shadowpixel_size*2.0); + SHADOW_TEST(su-shadowpixel_size*3.0); + SHADOW_TEST(su-shadowpixel_size*4.0); + SHADOW_TEST(su-shadowpixel_size*5.0); + SHADOW_TEST(su-shadowpixel_size*6.0); + shadow_attenuation/=13.0; + +#endif + + +#if defined(SHADOW_COLOR_USED) + color=mix(shadow_color,color,shadow_attenuation); +#else + //color*=shadow_attenuation; + color=mix(light_shadow_color,color,shadow_attenuation); +#endif +//use shadows +#endif + } + +//use lighting +#endif +// color.rgb*=color.a; + frag_color = color; + +} + diff --git a/drivers/gles3/shaders/canvas_shadow.glsl b/drivers/gles3/shaders/canvas_shadow.glsl new file mode 100644 index 0000000000..c757990de0 --- /dev/null +++ b/drivers/gles3/shaders/canvas_shadow.glsl @@ -0,0 +1,49 @@ +[vertex] + + + +uniform highp mat4 projection_matrix; +uniform highp mat4 light_matrix; +uniform highp mat4 world_matrix; +uniform highp float distance_norm; + +layout(location=0) in highp vec3 vertex; + +out highp vec4 position_interp; + +void main() { + + gl_Position = projection_matrix * (light_matrix * (world_matrix * vec4(vertex,1.0))); + position_interp=gl_Position; +} + +[fragment] + +in highp vec4 position_interp; + +#ifdef USE_RGBA_SHADOWS + +layout(location=0) out lowp vec4 distance_buf; + +#else + +layout(location=0) out highp float distance_buf; + +#endif + +void main() { + + highp float depth = ((position_interp.z / position_interp.w) + 1.0) * 0.5 + 0.0;//bias; + +#ifdef USE_RGBA_SHADOWS + + highp vec4 comp = fract(depth * vec4(256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0)); + comp -= comp.xxyz * vec4(0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0); + distance_buf=comp; +#else + + distance_buf=depth; + +#endif +} + diff --git a/drivers/gles3/shaders/copy.glsl b/drivers/gles3/shaders/copy.glsl new file mode 100644 index 0000000000..a87d62f2d7 --- /dev/null +++ b/drivers/gles3/shaders/copy.glsl @@ -0,0 +1,105 @@ +[vertex] + + +layout(location=0) in highp vec4 vertex_attrib; +#ifdef USE_CUBEMAP +layout(location=4) in vec3 cube_in; +#else +layout(location=4) in vec2 uv_in; +#endif +layout(location=5) in vec2 uv2_in; + +#ifdef USE_CUBEMAP +out vec3 cube_interp; +#else +out vec2 uv_interp; +#endif + +out vec2 uv2_interp; + +void main() { + +#ifdef USE_CUBEMAP + cube_interp = cube_in; +#else + uv_interp = uv_in; +#endif + uv2_interp = uv2_in; + gl_Position = vertex_attrib; +} + +[fragment] + + +#ifdef USE_CUBEMAP +in vec3 cube_interp; +uniform samplerCube source_cube; //texunit:0 +#else +in vec2 uv_interp; +uniform sampler2D source; //texunit:0 +#endif + + +float sRGB_gamma_correct(float c){ + float a = 0.055; + if(c < 0.0031308) + return 12.92*c; + else + return (1.0+a)*pow(c, 1.0/2.4) - a; +} + + +uniform float stuff; +uniform vec2 pixel_size; + +in vec2 uv2_interp; + +layout(location = 0) out vec4 frag_color; + +void main() { + + //vec4 color = color_interp; + +#ifdef USE_CUBEMAP + vec4 color = texture( source_cube, normalize(cube_interp) ); + +#else + vec4 color = texture( source, uv_interp ); +#endif + +#ifdef LINEAR_TO_SRGB + //regular Linear -> SRGB conversion + vec3 a = vec3(0.055); + color.rgb = mix( (vec3(1.0)+a)*pow(color.rgb,vec3(1.0/2.4))-a , 12.92*color.rgb , lessThan(color.rgb,vec3(0.0031308))); +#endif + +#ifdef DEBUG_GRADIENT + color.rg=uv_interp; + color.b=0.0; +#endif + +#ifdef DISABLE_ALPHA + color.a=1.0; +#endif + + +#ifdef GAUSSIAN_HORIZONTAL + color*=0.38774; + color+=texture( source, uv_interp+vec2( 1.0, 0.0)*pixel_size )*0.24477; + color+=texture( source, uv_interp+vec2( 2.0, 0.0)*pixel_size )*0.06136; + color+=texture( source, uv_interp+vec2(-1.0, 0.0)*pixel_size )*0.24477; + color+=texture( source, uv_interp+vec2(-2.0, 0.0)*pixel_size )*0.06136; +#endif + +#ifdef GAUSSIAN_VERTICAL + color*=0.38774; + color+=texture( source, uv_interp+vec2( 0.0, 1.0)*pixel_size )*0.24477; + color+=texture( source, uv_interp+vec2( 0.0, 2.0)*pixel_size )*0.06136; + color+=texture( source, uv_interp+vec2( 0.0,-1.0)*pixel_size )*0.24477; + color+=texture( source, uv_interp+vec2( 0.0,-2.0)*pixel_size )*0.06136; +#endif + + + frag_color = color; +} + diff --git a/drivers/gles3/shaders/cube_to_dp.glsl b/drivers/gles3/shaders/cube_to_dp.glsl new file mode 100644 index 0000000000..5ffc78c0b9 --- /dev/null +++ b/drivers/gles3/shaders/cube_to_dp.glsl @@ -0,0 +1,79 @@ +[vertex] + + +layout(location=0) in highp vec4 vertex_attrib; +layout(location=4) in vec2 uv_in; + +out vec2 uv_interp; + +void main() { + + uv_interp = uv_in; + gl_Position = vertex_attrib; +} + +[fragment] + + +uniform highp samplerCube source_cube; //texunit:0 +in vec2 uv_interp; + +uniform bool z_flip; +uniform highp float z_far; +uniform highp float z_near; +uniform highp float bias; + +void main() { + + highp vec3 normal = vec3( uv_interp * 2.0 - 1.0, 0.0 ); +/* + if(z_flip) { + normal.z = 0.5 - 0.5*((normal.x * normal.x) + (normal.y * normal.y)); + } else { + normal.z = -0.5 + 0.5*((normal.x * normal.x) + (normal.y * normal.y)); + } +*/ + + //normal.z = sqrt(1.0-dot(normal.xy,normal.xy)); + //normal.xy*=1.0+normal.z; + + normal.z = 0.5 - 0.5*((normal.x * normal.x) + (normal.y * normal.y)); + normal = normalize(normal); + +/* + normal.z=0.5; + normal=normalize(normal); +*/ + if (!z_flip) { + normal.z=-normal.z; + } + + //normal = normalize(vec3( uv_interp * 2.0 - 1.0, 1.0 )); + float depth = texture(source_cube,normal).r; + + // absolute values for direction cosines, bigger value equals closer to basis axis + vec3 unorm = abs(normal); + + if ( (unorm.x >= unorm.y) && (unorm.x >= unorm.z) ) { + // x code + unorm = normal.x > 0.0 ? vec3( 1.0, 0.0, 0.0 ) : vec3( -1.0, 0.0, 0.0 ) ; + } else if ( (unorm.y > unorm.x) && (unorm.y >= unorm.z) ) { + // y code + unorm = normal.y > 0.0 ? vec3( 0.0, 1.0, 0.0 ) : vec3( 0.0, -1.0, 0.0 ) ; + } else if ( (unorm.z > unorm.x) && (unorm.z > unorm.y) ) { + // z code + unorm = normal.z > 0.0 ? vec3( 0.0, 0.0, 1.0 ) : vec3( 0.0, 0.0, -1.0 ) ; + } else { + // oh-no we messed up code + // has to be + unorm = vec3( 1.0, 0.0, 0.0 ); + } + + float depth_fix = 1.0 / dot(normal,unorm); + + + depth = 2.0 * depth - 1.0; + float linear_depth = 2.0 * z_near * z_far / (z_far + z_near - depth * (z_far - z_near)); + gl_FragDepth = (linear_depth*depth_fix+bias) / z_far; +} + diff --git a/drivers/gles3/shaders/cubemap_filter.glsl b/drivers/gles3/shaders/cubemap_filter.glsl new file mode 100644 index 0000000000..768d20ad22 --- /dev/null +++ b/drivers/gles3/shaders/cubemap_filter.glsl @@ -0,0 +1,218 @@ +[vertex] + + +layout(location=0) in highp vec2 vertex; + +layout(location=4) in highp vec2 uv; + +out highp vec2 uv_interp; + +void main() { + + uv_interp=uv; + gl_Position=vec4(vertex,0,1); +} + +[fragment] + + +precision highp float; +precision highp int; + + +uniform samplerCube source_cube; //texunit:0 +uniform int face_id; +uniform float roughness; +in highp vec2 uv_interp; + + +layout(location = 0) out vec4 frag_color; + + +#define M_PI 3.14159265359 + + +vec3 texelCoordToVec(vec2 uv, int faceID) +{ + mat3 faceUvVectors[6]; +/* + // -x + faceUvVectors[1][0] = vec3(0.0, 0.0, 1.0); // u -> +z + faceUvVectors[1][1] = vec3(0.0, -1.0, 0.0); // v -> -y + faceUvVectors[1][2] = vec3(-1.0, 0.0, 0.0); // -x face + + // +x + faceUvVectors[0][0] = vec3(0.0, 0.0, -1.0); // u -> -z + faceUvVectors[0][1] = vec3(0.0, -1.0, 0.0); // v -> -y + faceUvVectors[0][2] = vec3(1.0, 0.0, 0.0); // +x face + + // -y + faceUvVectors[3][0] = vec3(1.0, 0.0, 0.0); // u -> +x + faceUvVectors[3][1] = vec3(0.0, 0.0, -1.0); // v -> -z + faceUvVectors[3][2] = vec3(0.0, -1.0, 0.0); // -y face + + // +y + faceUvVectors[2][0] = vec3(1.0, 0.0, 0.0); // u -> +x + faceUvVectors[2][1] = vec3(0.0, 0.0, 1.0); // v -> +z + faceUvVectors[2][2] = vec3(0.0, 1.0, 0.0); // +y face + + // -z + faceUvVectors[5][0] = vec3(-1.0, 0.0, 0.0); // u -> -x + faceUvVectors[5][1] = vec3(0.0, -1.0, 0.0); // v -> -y + faceUvVectors[5][2] = vec3(0.0, 0.0, -1.0); // -z face + + // +z + faceUvVectors[4][0] = vec3(1.0, 0.0, 0.0); // u -> +x + faceUvVectors[4][1] = vec3(0.0, -1.0, 0.0); // v -> -y + faceUvVectors[4][2] = vec3(0.0, 0.0, 1.0); // +z face +*/ + + // -x + faceUvVectors[0][0] = vec3(0.0, 0.0, 1.0); // u -> +z + faceUvVectors[0][1] = vec3(0.0, -1.0, 0.0); // v -> -y + faceUvVectors[0][2] = vec3(-1.0, 0.0, 0.0); // -x face + + // +x + faceUvVectors[1][0] = vec3(0.0, 0.0, -1.0); // u -> -z + faceUvVectors[1][1] = vec3(0.0, -1.0, 0.0); // v -> -y + faceUvVectors[1][2] = vec3(1.0, 0.0, 0.0); // +x face + + // -y + faceUvVectors[2][0] = vec3(1.0, 0.0, 0.0); // u -> +x + faceUvVectors[2][1] = vec3(0.0, 0.0, -1.0); // v -> -z + faceUvVectors[2][2] = vec3(0.0, -1.0, 0.0); // -y face + + // +y + faceUvVectors[3][0] = vec3(1.0, 0.0, 0.0); // u -> +x + faceUvVectors[3][1] = vec3(0.0, 0.0, 1.0); // v -> +z + faceUvVectors[3][2] = vec3(0.0, 1.0, 0.0); // +y face + + // -z + faceUvVectors[4][0] = vec3(-1.0, 0.0, 0.0); // u -> -x + faceUvVectors[4][1] = vec3(0.0, -1.0, 0.0); // v -> -y + faceUvVectors[4][2] = vec3(0.0, 0.0, -1.0); // -z face + + // +z + faceUvVectors[5][0] = vec3(1.0, 0.0, 0.0); // u -> +x + faceUvVectors[5][1] = vec3(0.0, -1.0, 0.0); // v -> -y + faceUvVectors[5][2] = vec3(0.0, 0.0, 1.0); // +z face + + // out = u * s_faceUv[0] + v * s_faceUv[1] + s_faceUv[2]. + vec3 result = (faceUvVectors[faceID][0] * uv.x) + (faceUvVectors[faceID][1] * uv.y) + faceUvVectors[faceID][2]; + return normalize(result); +} + +vec3 ImportanceSampleGGX(vec2 Xi, float Roughness, vec3 N) +{ + float a = Roughness * Roughness; // DISNEY'S ROUGHNESS [see Burley'12 siggraph] + + // Compute distribution direction + float Phi = 2.0 * M_PI * Xi.x; + float CosTheta = sqrt((1.0 - Xi.y) / (1.0 + (a*a - 1.0) * Xi.y)); + float SinTheta = sqrt(1.0 - CosTheta * CosTheta); + + // Convert to spherical direction + vec3 H; + H.x = SinTheta * cos(Phi); + H.y = SinTheta * sin(Phi); + H.z = CosTheta; + + vec3 UpVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); + vec3 TangentX = normalize(cross(UpVector, N)); + vec3 TangentY = cross(N, TangentX); + + // Tangent to world space + return TangentX * H.x + TangentY * H.y + N * H.z; +} + +// http://graphicrants.blogspot.com.au/2013/08/specular-brdf-reference.html +float GGX(float NdotV, float a) +{ + float k = a / 2.0; + return NdotV / (NdotV * (1.0 - k) + k); +} + +// http://graphicrants.blogspot.com.au/2013/08/specular-brdf-reference.html +float G_Smith(float a, float nDotV, float nDotL) +{ + return GGX(nDotL, a * a) * GGX(nDotV, a * a); +} + +float radicalInverse_VdC(uint bits) { + bits = (bits << 16u) | (bits >> 16u); + bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u); + bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u); + bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u); + bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u); + return float(bits) * 2.3283064365386963e-10; // / 0x100000000 +} + +vec2 Hammersley(uint i, uint N) { + return vec2(float(i)/float(N), radicalInverse_VdC(i)); +} + + + +#ifdef LOW_QUALITY + +#define SAMPLE_COUNT 64u + +#else + +#define SAMPLE_COUNT 512u + +#endif + +uniform bool z_flip; + +void main() { + +#ifdef USE_DUAL_PARABOLOID + + vec3 N = vec3( uv_interp * 2.0 - 1.0, 0.0 ); + N.z = 0.5 - 0.5*((N.x * N.x) + (N.y * N.y)); + N = normalize(N); + + if (!z_flip) { + N.y=-N.y; //y is flipped to improve blending between both sides + } else { + N.z=-N.z; + } + + +#else + vec2 uv = (uv_interp * 2.0) - 1.0; + vec3 N = texelCoordToVec(uv, face_id); +#endif + //vec4 color = color_interp; + +#ifdef USE_DIRECT_WRITE + + frag_color=vec4(texture(N,source_cube).rgb,1.0); + +#else + + vec4 sum = vec4(0.0, 0.0, 0.0, 0.0); + + for(uint sampleNum = 0u; sampleNum < SAMPLE_COUNT; sampleNum++) { + vec2 xi = Hammersley(sampleNum, SAMPLE_COUNT); + + vec3 H = ImportanceSampleGGX( xi, roughness, N ); + vec3 V = N; + vec3 L = normalize(2.0 * dot( V, H ) * H - V); + + float ndotl = clamp(dot(N, L),0.0,1.0); + + if (ndotl>0.0) { + sum.rgb += textureLod(source_cube, H, 0.0).rgb *ndotl; + sum.a += ndotl; + } + } + sum /= sum.a; + + frag_color = vec4(sum.rgb, 1.0); + +#endif + +} + diff --git a/drivers/gles3/shaders/effect_blur.glsl b/drivers/gles3/shaders/effect_blur.glsl new file mode 100644 index 0000000000..89afa12f60 --- /dev/null +++ b/drivers/gles3/shaders/effect_blur.glsl @@ -0,0 +1,278 @@ +[vertex] + + +layout(location=0) in highp vec4 vertex_attrib; +layout(location=4) in vec2 uv_in; + +out vec2 uv_interp; + + +void main() { + + uv_interp = uv_in; + gl_Position = vertex_attrib; +} + +[fragment] + + +in vec2 uv_interp; +uniform sampler2D source_color; //texunit:0 + +#ifdef SSAO_MERGE +uniform sampler2D source_ssao; //texunit:1 +#endif + +uniform float lod; +uniform vec2 pixel_size; + + +layout(location = 0) out vec4 frag_color; + +#ifdef SSAO_MERGE + +uniform vec4 ssao_color; + +#endif + +#if defined (GLOW_GAUSSIAN_HORIZONTAL) || defined(GLOW_GAUSSIAN_VERTICAL) + +uniform float glow_strength; + +#endif + +#if defined(DOF_FAR_BLUR) || defined (DOF_NEAR_BLUR) + +#ifdef DOF_QUALITY_LOW +const int dof_kernel_size=5; +const int dof_kernel_from=2; +const float dof_kernel[5] = float[] (0.153388,0.221461,0.250301,0.221461,0.153388); +#endif + +#ifdef DOF_QUALITY_MEDIUM +const int dof_kernel_size=11; +const int dof_kernel_from=5; +const float dof_kernel[11] = float[] (0.055037,0.072806,0.090506,0.105726,0.116061,0.119726,0.116061,0.105726,0.090506,0.072806,0.055037); + +#endif + +#ifdef DOF_QUALITY_HIGH +const int dof_kernel_size=21; +const int dof_kernel_from=10; +const float dof_kernel[21] = float[] (0.028174,0.032676,0.037311,0.041944,0.046421,0.050582,0.054261,0.057307,0.059587,0.060998,0.061476,0.060998,0.059587,0.057307,0.054261,0.050582,0.046421,0.041944,0.037311,0.032676,0.028174); +#endif + +uniform sampler2D dof_source_depth; //texunit:1 +uniform float dof_begin; +uniform float dof_end; +uniform vec2 dof_dir; +uniform float dof_radius; + +#ifdef DOF_NEAR_BLUR_MERGE + +uniform sampler2D source_dof_original; //texunit:2 +#endif + +#endif + + +#ifdef GLOW_FIRST_PASS + +uniform float exposure; +uniform float white; + +#ifdef GLOW_USE_AUTO_EXPOSURE + +uniform highp sampler2D source_auto_exposure; //texunit:1 +uniform highp float auto_exposure_grey; + +#endif + +uniform float glow_bloom; +uniform float glow_hdr_treshold; +uniform float glow_hdr_scale; + +#endif + +uniform float camera_z_far; +uniform float camera_z_near; + +void main() { + + + +#ifdef GAUSSIAN_HORIZONTAL + vec2 pix_size = pixel_size; + pix_size*=0.5; //reading from larger buffer, so use more samples + vec4 color =textureLod( source_color, uv_interp+vec2( 0.0, 0.0)*pix_size,lod )*0.214607; + color+=textureLod( source_color, uv_interp+vec2( 1.0, 0.0)*pix_size,lod )*0.189879; + color+=textureLod( source_color, uv_interp+vec2( 2.0, 0.0)*pix_size,lod )*0.157305; + color+=textureLod( source_color, uv_interp+vec2( 3.0, 0.0)*pix_size,lod )*0.071303; + color+=textureLod( source_color, uv_interp+vec2(-1.0, 0.0)*pix_size,lod )*0.189879; + color+=textureLod( source_color, uv_interp+vec2(-2.0, 0.0)*pix_size,lod )*0.157305; + color+=textureLod( source_color, uv_interp+vec2(-3.0, 0.0)*pix_size,lod )*0.071303; + frag_color = color; +#endif + +#ifdef GAUSSIAN_VERTICAL + vec4 color =textureLod( source_color, uv_interp+vec2( 0.0, 0.0)*pixel_size,lod )*0.38774; + color+=textureLod( source_color, uv_interp+vec2( 0.0, 1.0)*pixel_size,lod )*0.24477; + color+=textureLod( source_color, uv_interp+vec2( 0.0, 2.0)*pixel_size,lod )*0.06136; + color+=textureLod( source_color, uv_interp+vec2( 0.0,-1.0)*pixel_size,lod )*0.24477; + color+=textureLod( source_color, uv_interp+vec2( 0.0,-2.0)*pixel_size,lod )*0.06136; + frag_color = color; +#endif + +//glow uses larger sigma for a more rounded blur effect + +#ifdef GLOW_GAUSSIAN_HORIZONTAL + vec2 pix_size = pixel_size; + pix_size*=0.5; //reading from larger buffer, so use more samples + vec4 color =textureLod( source_color, uv_interp+vec2( 0.0, 0.0)*pix_size,lod )*0.174938; + color+=textureLod( source_color, uv_interp+vec2( 1.0, 0.0)*pix_size,lod )*0.165569; + color+=textureLod( source_color, uv_interp+vec2( 2.0, 0.0)*pix_size,lod )*0.140367; + color+=textureLod( source_color, uv_interp+vec2( 3.0, 0.0)*pix_size,lod )*0.106595; + color+=textureLod( source_color, uv_interp+vec2(-1.0, 0.0)*pix_size,lod )*0.165569; + color+=textureLod( source_color, uv_interp+vec2(-2.0, 0.0)*pix_size,lod )*0.140367; + color+=textureLod( source_color, uv_interp+vec2(-3.0, 0.0)*pix_size,lod )*0.106595; + color*=glow_strength; + frag_color = color; +#endif + +#ifdef GLOW_GAUSSIAN_VERTICAL + vec4 color =textureLod( source_color, uv_interp+vec2(0.0, 0.0)*pixel_size,lod )*0.288713; + color+=textureLod( source_color, uv_interp+vec2(0.0, 1.0)*pixel_size,lod )*0.233062; + color+=textureLod( source_color, uv_interp+vec2(0.0, 2.0)*pixel_size,lod )*0.122581; + color+=textureLod( source_color, uv_interp+vec2(0.0,-1.0)*pixel_size,lod )*0.233062; + color+=textureLod( source_color, uv_interp+vec2(0.0,-2.0)*pixel_size,lod )*0.122581; + color*=glow_strength; + frag_color = color; +#endif + +#ifdef DOF_FAR_BLUR + + vec4 color_accum = vec4(0.0); + + float depth = textureLod( dof_source_depth, uv_interp, 0.0).r; + depth = depth * 2.0 - 1.0; + depth = 2.0 * camera_z_near * camera_z_far / (camera_z_far + camera_z_near - depth * (camera_z_far - camera_z_near)); + + float amount = smoothstep(dof_begin,dof_end,depth); + float k_accum=0.0; + + for(int i=0;i<dof_kernel_size;i++) { + + int int_ofs = i-dof_kernel_from; + vec2 tap_uv = uv_interp + dof_dir * float(int_ofs) * amount * dof_radius; + + float tap_k = dof_kernel[i]; + + float tap_depth = texture( dof_source_depth, tap_uv, 0.0).r; + tap_depth = tap_depth * 2.0 - 1.0; + tap_depth = 2.0 * camera_z_near * camera_z_far / (camera_z_far + camera_z_near - tap_depth * (camera_z_far - camera_z_near)); + + float tap_amount = mix(smoothstep(dof_begin,dof_end,tap_depth),1.0,int_ofs==0); + tap_amount*=tap_amount*tap_amount; //prevent undesired glow effect + + vec4 tap_color = textureLod( source_color, tap_uv, 0.0) * tap_k; + + k_accum+=tap_k*tap_amount; + color_accum+=tap_color*tap_amount; + + + } + + if (k_accum>0.0) { + color_accum/=k_accum; + } + + frag_color = color_accum;///k_accum; + +#endif + +#ifdef DOF_NEAR_BLUR + + vec4 color_accum = vec4(0.0); + + float max_accum=0; + + for(int i=0;i<dof_kernel_size;i++) { + + int int_ofs = i-dof_kernel_from; + vec2 tap_uv = uv_interp + dof_dir * float(int_ofs) * dof_radius; + float ofs_influence = max(0.0,1.0-float(abs(int_ofs))/float(dof_kernel_from)); + + float tap_k = dof_kernel[i]; + + vec4 tap_color = textureLod( source_color, tap_uv, 0.0); + + float tap_depth = texture( dof_source_depth, tap_uv, 0.0).r; + tap_depth = tap_depth * 2.0 - 1.0; + tap_depth = 2.0 * camera_z_near * camera_z_far / (camera_z_far + camera_z_near - tap_depth * (camera_z_far - camera_z_near)); + float tap_amount = 1.0-smoothstep(dof_end,dof_begin,tap_depth); + tap_amount*=tap_amount*tap_amount; //prevent undesired glow effect + +#ifdef DOF_NEAR_FIRST_TAP + + tap_color.a= 1.0-smoothstep(dof_end,dof_begin,tap_depth); + +#endif + + max_accum=max(max_accum,tap_amount*ofs_influence); + + color_accum+=tap_color*tap_k; + + } + + color_accum.a=max(color_accum.a,sqrt(max_accum)); + + +#ifdef DOF_NEAR_BLUR_MERGE + + vec4 original = textureLod( source_dof_original, uv_interp, 0.0); + color_accum = mix(original,color_accum,color_accum.a); + +#endif + +#ifndef DOF_NEAR_FIRST_TAP + //color_accum=vec4(vec3(color_accum.a),1.0); +#endif + frag_color = color_accum; + +#endif + + + +#ifdef GLOW_FIRST_PASS + +#ifdef GLOW_USE_AUTO_EXPOSURE + + frag_color/=texelFetch(source_auto_exposure,ivec2(0,0),0).r/auto_exposure_grey; +#endif + frag_color*=exposure; + + float luminance = max(frag_color.r,max(frag_color.g,frag_color.b)); + float feedback = max( smoothstep(glow_hdr_treshold,glow_hdr_treshold+glow_hdr_scale,luminance), glow_bloom ); + + frag_color *= feedback; + +#endif + + +#ifdef SIMPLE_COPY + vec4 color =textureLod( source_color, uv_interp,0.0); + frag_color = color; +#endif + +#ifdef SSAO_MERGE + + vec4 color =textureLod( source_color, uv_interp,0.0); + float ssao =textureLod( source_ssao, uv_interp,0.0).r; + + frag_color = vec4( mix(color.rgb,color.rgb*mix(ssao_color.rgb,vec3(1.0),ssao),color.a), 1.0 ); + +#endif + + +} + diff --git a/drivers/gles3/shaders/exposure.glsl b/drivers/gles3/shaders/exposure.glsl new file mode 100644 index 0000000000..001b90a0f1 --- /dev/null +++ b/drivers/gles3/shaders/exposure.glsl @@ -0,0 +1,98 @@ +[vertex] + + +layout(location=0) in highp vec4 vertex_attrib; + + +void main() { + + gl_Position = vertex_attrib; + +} + +[fragment] + + +uniform highp sampler2D source_exposure; //texunit:0 + +#ifdef EXPOSURE_BEGIN + +uniform highp ivec2 source_render_size; +uniform highp ivec2 target_size; + +#endif + +#ifdef EXPOSURE_END + +uniform highp sampler2D prev_exposure; //texunit:1 +uniform highp float exposure_adjust; +uniform highp float min_luminance; +uniform highp float max_luminance; + +#endif + +layout(location = 0) out highp float exposure; + + + +void main() { + + + +#ifdef EXPOSURE_BEGIN + + + ivec2 src_pos = ivec2(gl_FragCoord.xy)*source_render_size/target_size; + +#if 1 + //more precise and expensive, but less jittery + ivec2 next_pos = ivec2(gl_FragCoord.xy+ivec2(1))*source_render_size/target_size; + next_pos = max(next_pos,src_pos+ivec2(1)); //so it at least reads one pixel + highp vec3 source_color=vec3(0.0); + for(int i=src_pos.x;i<next_pos.x;i++) { + for(int j=src_pos.y;j<next_pos.y;j++) { + source_color += texelFetch(source_exposure,ivec2(i,j),0).rgb; + } + } + + source_color/=float( (next_pos.x-src_pos.x)*(next_pos.y-src_pos.y) ); +#else + highp vec3 source_color = texelFetch(source_exposure,src_pos,0).rgb; + +#endif + + exposure = max(source_color.r,max(source_color.g,source_color.b)); + +#else + + ivec2 coord = ivec2(gl_FragCoord.xy); + exposure = texelFetch(source_exposure,coord*3+ivec2(0,0),0).r; + exposure += texelFetch(source_exposure,coord*3+ivec2(1,0),0).r; + exposure += texelFetch(source_exposure,coord*3+ivec2(2,0),0).r; + exposure += texelFetch(source_exposure,coord*3+ivec2(0,1),0).r; + exposure += texelFetch(source_exposure,coord*3+ivec2(1,1),0).r; + exposure += texelFetch(source_exposure,coord*3+ivec2(2,1),0).r; + exposure += texelFetch(source_exposure,coord*3+ivec2(0,2),0).r; + exposure += texelFetch(source_exposure,coord*3+ivec2(1,2),0).r; + exposure += texelFetch(source_exposure,coord*3+ivec2(2,2),0).r; + exposure *= (1.0/9.0); + +#ifdef EXPOSURE_END + +#ifdef EXPOSURE_FORCE_SET + //will stay as is +#else + highp float prev_lum = texelFetch(prev_exposure,ivec2(0,0),0).r; //1 pixel previous exposure + exposure = clamp( prev_lum + (exposure-prev_lum)*exposure_adjust,min_luminance,max_luminance); + +#endif //EXPOSURE_FORCE_SET + + +#endif //EXPOSURE_END + +#endif //EXPOSURE_BEGIN + + +} + + diff --git a/drivers/gles3/shaders/particles.glsl b/drivers/gles3/shaders/particles.glsl new file mode 100644 index 0000000000..e72f12cc5e --- /dev/null +++ b/drivers/gles3/shaders/particles.glsl @@ -0,0 +1,167 @@ +[vertex] + + + +layout(location=0) in highp vec4 color; +layout(location=1) in highp vec4 velocity_active; +layout(location=2) in highp vec4 custom; +layout(location=3) in highp vec4 xform_1; +layout(location=4) in highp vec4 xform_2; +layout(location=5) in highp vec4 xform_3; + + +struct Attractor { + + vec3 pos; + vec3 dir; + float radius; + float eat_radius; + float strength; + float attenuation; +}; + +#define MAX_ATTRACTORS 64 + +uniform mat4 origin; +uniform float system_phase; +uniform float prev_system_phase; +uniform float total_particles; +uniform float explosiveness; +uniform vec4 time; +uniform float delta; +uniform vec3 gravity; +uniform int attractor_count; +uniform Attractor attractors[MAX_ATTRACTORS]; + + +out highp vec4 out_color; //tfb: +out highp vec4 out_velocity_active; //tfb: +out highp vec4 out_custom; //tfb: +out highp vec4 out_xform_1; //tfb: +out highp vec4 out_xform_2; //tfb: +out highp vec4 out_xform_3; //tfb: + +VERTEX_SHADER_GLOBALS + +#if defined(USE_MATERIAL) + +layout(std140) uniform UniformData { //ubo:0 + +MATERIAL_UNIFORMS + +}; + +#endif + +void main() { + + bool apply_forces=true; + bool apply_velocity=true; + + float mass = 1.0; + + float restart_phase = float(gl_InstanceID)/total_particles; + restart_phase*= explosiveness; + bool restart=false; + bool active = out_velocity_active.a > 0.5; + + if (system_phase > prev_system_phase) { + restart = prev_system_phase < restart_phase && system_phase >= restart_phase; + } else { + restart = prev_system_phase < restart_phase || system_phase >= restart_phase; + } + + if (restart) { + active=true; + } + + out_color=color; + out_velocity_active=velocity_active; + out_custom=custom; + + mat4 xform = transpose(mat4(xform_1,xform_2,xform_3,vec4(vec3(0.0),1.0))); + + + out_rot_active=rot_active; + + if (active) { + //execute shader + + { + VERTEX_SHADER_CODE + } + +#if !defined(DISABLE_FORCE) + + { + + vec3 force = gravity; + for(int i=0;i<attractor_count;i++) { + + vec3 rel_vec = out_pos_lifetime.xyz - attractors[i].pos; + float dist = rel_vec.length(); + if (attractors[i].radius < dist) + continue; + if (attractors[i].eat_radius>0 && attractors[i].eat_radius > dist) { + out_velocity_active.a=0.0; + } + + rel_vec = normalize(rel_vec); + + float attenuation = pow(dist / attractors[i].radius,attractors[i].attenuation); + + if (attractors[i].dir==vec3(0.0)) { + //towards center + force+=attractors[i].strength * rel_vec * attenuation * mass; + } else { + force+=attractors[i].strength * attractors[i].dir * attenuation *mass; + + } + } + + out_velocity_seed.xyz += force * delta; + } +#endif + +#if !defined(DISABLE_VELOCITY) + + { + + out_pos_lifetime.xyz += out_velocity_seed.xyz * delta; + } +#endif + } + + xform = transpose(xform); + + out_velocity_active.a = mix(0.0,1.0,active); + + out_xform_1 = xform[0]; + out_xform_2 = xform[1]; + out_xform_3 = xform[2]; + + +} + +[fragment] + +//any code here is never executed, stuff is filled just so it works + +FRAGMENT_SHADER_GLOBALS + +#if defined(USE_MATERIAL) + +layout(std140) uniform UniformData { + +MATERIAL_UNIFORMS + +}; + +#endif + +void main() { + + { + FRAGMENT_SHADER_CODE + } +} diff --git a/drivers/gles3/shaders/resolve.glsl b/drivers/gles3/shaders/resolve.glsl new file mode 100644 index 0000000000..6acc712299 --- /dev/null +++ b/drivers/gles3/shaders/resolve.glsl @@ -0,0 +1,41 @@ +[vertex] + + +layout(location=0) in highp vec4 vertex_attrib; +layout(location=4) in vec2 uv_in; + +out vec2 uv_interp; + + +void main() { + + uv_interp = uv_in; + gl_Position = vertex_attrib; +} + +[fragment] + + +in vec2 uv_interp; +uniform sampler2D source_specular; //texunit:0 +uniform sampler2D source_ssr; //texunit:1 + +uniform float stuff; + +in vec2 uv2_interp; + +layout(location = 0) out vec4 frag_color; + +void main() { + + vec4 specular = texture( source_specular, uv_interp ); + +#ifdef USE_SSR + + vec4 ssr = textureLod(source_ssr,uv_interp,0.0); + specular.rgb = mix(specular.rgb,ssr.rgb*specular.a,ssr.a); +#endif + + frag_color = vec4(specular.rgb,1.0); +} + diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl new file mode 100644 index 0000000000..c5af010c96 --- /dev/null +++ b/drivers/gles3/shaders/scene.glsl @@ -0,0 +1,1432 @@ +[vertex] + + +/* +from VisualServer: + +ARRAY_VERTEX=0, +ARRAY_NORMAL=1, +ARRAY_TANGENT=2, +ARRAY_COLOR=3, +ARRAY_TEX_UV=4, +ARRAY_TEX_UV2=5, +ARRAY_BONES=6, +ARRAY_WEIGHTS=7, +ARRAY_INDEX=8, +*/ + +//hack to use uv if no uv present so it works with lightmap + + +/* INPUT ATTRIBS */ + +layout(location=0) in highp vec4 vertex_attrib; +layout(location=1) in vec3 normal_attrib; +#if defined(ENABLE_TANGENT_INTERP) || defined(ENABLE_NORMALMAP) || defined(LIGHT_USE_ANISOTROPY) +layout(location=2) in vec4 tangent_attrib; +#endif + +#if defined(ENABLE_COLOR_INTERP) +layout(location=3) in vec4 color_attrib; +#endif + +#if defined(ENABLE_UV_INTERP) +layout(location=4) in vec2 uv_attrib; +#endif + +#if defined(ENABLE_UV2_INTERP) +layout(location=5) in vec2 uv2_attrib; +#endif + +uniform float normal_mult; + +#ifdef USE_SKELETON +layout(location=6) in ivec4 bone_indices; // attrib:6 +layout(location=7) in vec4 bone_weights; // attrib:7 +#endif + +#ifdef USE_INSTANCING + +layout(location=8) in highp vec4 instance_xform0; +layout(location=9) in highp vec4 instance_xform1; +layout(location=10) in highp vec4 instance_xform2; +layout(location=11) in lowp vec4 instance_color; + +#endif + +layout(std140) uniform SceneData { //ubo:0 + + highp mat4 projection_matrix; + highp mat4 camera_inverse_matrix; + highp mat4 camera_matrix; + highp vec4 time; + + highp vec4 ambient_light_color; + highp vec4 bg_color; + float ambient_energy; + float bg_energy; + + float shadow_z_offset; + float shadow_z_slope_scale; + float shadow_dual_paraboloid_render_zfar; + float shadow_dual_paraboloid_render_side; + + vec2 shadow_atlas_pixel_size; + vec2 directional_shadow_pixel_size; + + float reflection_multiplier; + float subsurface_scatter_width; + float ambient_occlusion_affect_light; + +}; + +uniform highp mat4 world_transform; + +#ifdef USE_LIGHT_DIRECTIONAL + +layout(std140) uniform DirectionalLightData { //ubo:3 + + highp vec4 light_pos_inv_radius; + mediump vec4 light_direction_attenuation; + mediump vec4 light_color_energy; + mediump vec4 light_params; //cone attenuation, angle, specular, shadow enabled, + mediump vec4 light_clamp; + mediump vec4 shadow_color; + highp mat4 shadow_matrix1; + highp mat4 shadow_matrix2; + highp mat4 shadow_matrix3; + highp mat4 shadow_matrix4; + mediump vec4 shadow_split_offsets; +}; + +#endif + + +/* Varyings */ + +out highp vec3 vertex_interp; +out vec3 normal_interp; + +#if defined(ENABLE_COLOR_INTERP) +out vec4 color_interp; +#endif + +#if defined(ENABLE_UV_INTERP) +out vec2 uv_interp; +#endif + +#if defined(ENABLE_UV2_INTERP) +out vec2 uv2_interp; +#endif + + +#if defined(ENABLE_TANGENT_INTERP) || defined(ENABLE_NORMALMAP) || defined(LIGHT_USE_ANISOTROPY) +out vec3 tangent_interp; +out vec3 binormal_interp; +#endif + + +#if !defined(USE_DEPTH_SHADOWS) && defined(USE_SHADOW_PASS) + +varying vec4 position_interp; + +#endif + + +VERTEX_SHADER_GLOBALS + + +#if defined(USE_MATERIAL) + +layout(std140) uniform UniformData { //ubo:1 + +MATERIAL_UNIFORMS + +}; + +#endif + +#ifdef RENDER_DEPTH_DUAL_PARABOLOID + +out highp float dp_clip; + +#endif + +#ifdef USE_SKELETON + +layout(std140) uniform SkeletonData { //ubo:7 + + mat3x4 skeleton[MAX_SKELETON_BONES]; +}; + +#endif + +void main() { + + highp vec4 vertex = vertex_attrib; // vec4(vertex_attrib.xyz * data_attrib.x,1.0); + highp mat4 modelview = camera_inverse_matrix * world_transform; + vec3 normal = normal_attrib * normal_mult; + +#if defined(ENABLE_TANGENT_INTERP) || defined(ENABLE_NORMALMAP) || defined(LIGHT_USE_ANISOTROPY) + vec3 tangent = tangent_attrib.xyz; + tangent*=normal_mult; + float binormalf = tangent_attrib.a; +#endif + +#if defined(ENABLE_COLOR_INTERP) + color_interp = color_attrib; +#endif + + +#ifdef USE_SKELETON + + { + //skeleton transform + highp mat3x4 m=skeleton[bone_indices.x]*bone_weights.x; + m+=skeleton[bone_indices.y]*bone_weights.y; + m+=skeleton[bone_indices.z]*bone_weights.z; + m+=skeleton[bone_indices.w]*bone_weights.w; + + vertex.xyz = vertex * m; + + normal = vec4(normal,0.0) * m; +#if defined(ENABLE_TANGENT_INTERP) || defined(ENABLE_NORMALMAP) || defined(LIGHT_USE_ANISOTROPY) + tangent.xyz = vec4(tangent.xyz,0.0) * mn; +#endif + } +#endif // USE_SKELETON1 + + +#ifdef USE_INSTANCING + + { + highp mat3x4 m=mat3x4(instance_xform0,instance_xform1,instance_xform2); + + vertex.xyz = vertex * m; + normal = vec4(normal,0.0) * m; +#if defined(ENABLE_TANGENT_INTERP) || defined(ENABLE_NORMALMAP) || defined(LIGHT_USE_ANISOTROPY) + tangent.xyz = vec4(tangent.xyz,0.0) * mn; +#endif + +#if defined(ENABLE_COLOR_INTERP) + color_interp*=instance_color; +#endif + } +#endif //USE_INSTANCING + +#if !defined(SKIP_TRANSFORM_USED) + + vertex = modelview * vertex; + normal = normalize((modelview * vec4(normal,0.0)).xyz); +#endif + +#if defined(ENABLE_TANGENT_INTERP) || defined(ENABLE_NORMALMAP) || defined(LIGHT_USE_ANISOTROPY) +# if !defined(SKIP_TRANSFORM_USED) + + tangent=normalize((modelview * vec4(tangent,0.0)).xyz); +# endif + vec3 binormal = normalize( cross(normal,tangent) * binormalf ); +#endif + + + + +#if defined(ENABLE_UV_INTERP) + uv_interp = uv_attrib; +#endif + +#if defined(ENABLE_UV2_INTERP) + uv2_interp = uv2_attrib; +#endif + +{ + +VERTEX_SHADER_CODE + +} + + vertex_interp = vertex.xyz; + normal_interp = normal; + +#if defined(ENABLE_TANGENT_INTERP) || defined(ENABLE_NORMALMAP) || defined(LIGHT_USE_ANISOTROPY) + tangent_interp = tangent; + binormal_interp = binormal; +#endif + +#ifdef RENDER_DEPTH + + +#ifdef RENDER_DEPTH_DUAL_PARABOLOID + + vertex_interp.z*= shadow_dual_paraboloid_render_side; + normal_interp.z*= shadow_dual_paraboloid_render_side; + + dp_clip=vertex_interp.z; //this attempts to avoid noise caused by objects sent to the other parabolloid side due to bias + + //for dual paraboloid shadow mapping, this is the fastest but least correct way, as it curves straight edges + + highp vec3 vtx = vertex_interp+normalize(vertex_interp)*shadow_z_offset; + highp float distance = length(vtx); + vtx = normalize(vtx); + vtx.xy/=1.0-vtx.z; + vtx.z=(distance/shadow_dual_paraboloid_render_zfar); + vtx.z=vtx.z * 2.0 - 1.0; + + vertex.xyz=vtx; + vertex.w=1.0; + + +#else + + float z_ofs = shadow_z_offset; + z_ofs += (1.0-abs(normal_interp.z))*shadow_z_slope_scale; + vertex_interp.z-=z_ofs; + +#endif //RENDER_DEPTH_DUAL_PARABOLOID + +#endif //RENDER_DEPTH + + +#if !defined(SKIP_TRANSFORM_USED) && !defined(RENDER_DEPTH_DUAL_PARABOLOID) + gl_Position = projection_matrix * vec4(vertex_interp,1.0); +#else + gl_Position = vertex; +#endif + + +} + + +[fragment] + + + +#define M_PI 3.14159265359 + +/* Varyings */ + +#if defined(ENABLE_COLOR_INTERP) +in vec4 color_interp; +#endif + +#if defined(ENABLE_UV_INTERP) +in vec2 uv_interp; +#endif + +#if defined(ENABLE_UV2_INTERP) +in vec2 uv2_interp; +#endif + +#if defined(ENABLE_TANGENT_INTERP) || defined(ENABLE_NORMALMAP) || defined(LIGHT_USE_ANISOTROPY) +in vec3 tangent_interp; +in vec3 binormal_interp; +#endif + +in highp vec3 vertex_interp; +in vec3 normal_interp; + + +/* PBR CHANNELS */ + +//used on forward mainly +uniform bool no_ambient_light; + +uniform sampler2D brdf_texture; //texunit:-1 + +#ifdef USE_RADIANCE_MAP + +uniform sampler2D radiance_map; //texunit:-2 + + +layout(std140) uniform Radiance { //ubo:2 + + mat4 radiance_inverse_xform; + vec3 radiance_box_min; + vec3 radiance_box_max; + float radiance_ambient_contribution; + +}; + +#endif + +/* Material Uniforms */ + + +FRAGMENT_SHADER_GLOBALS + + +#if defined(USE_MATERIAL) + +layout(std140) uniform UniformData { + +MATERIAL_UNIFORMS + +}; + +#endif + + +layout(std140) uniform SceneData { + + highp mat4 projection_matrix; + highp mat4 camera_inverse_matrix; + highp mat4 camera_matrix; + highp vec4 time; + + highp vec4 ambient_light_color; + highp vec4 bg_color; + float ambient_energy; + float bg_energy; + + float shadow_z_offset; + float shadow_z_slope_scale; + float shadow_dual_paraboloid_render_zfar; + float shadow_dual_paraboloid_render_side; + + vec2 shadow_atlas_pixel_size; + vec2 directional_shadow_pixel_size; + + float reflection_multiplier; + float subsurface_scatter_width; + float ambient_occlusion_affect_light; + +}; + +//directional light data + +#ifdef USE_LIGHT_DIRECTIONAL + +layout(std140) uniform DirectionalLightData { + + highp vec4 light_pos_inv_radius; + mediump vec4 light_direction_attenuation; + mediump vec4 light_color_energy; + mediump vec4 light_params; //cone attenuation, angle, specular, shadow enabled, + mediump vec4 light_clamp; + mediump vec4 shadow_color; + highp mat4 shadow_matrix1; + highp mat4 shadow_matrix2; + highp mat4 shadow_matrix3; + highp mat4 shadow_matrix4; + mediump vec4 shadow_split_offsets; +}; + + +uniform highp sampler2DShadow directional_shadow; //texunit:-4 + +#endif + +//omni and spot + +struct LightData { + + highp vec4 light_pos_inv_radius; + mediump vec4 light_direction_attenuation; + mediump vec4 light_color_energy; + mediump vec4 light_params; //cone attenuation, angle, specular, shadow enabled, + mediump vec4 light_clamp; + mediump vec4 shadow_color; + highp mat4 shadow_matrix; + +}; + + +layout(std140) uniform OmniLightData { //ubo:4 + + LightData omni_lights[MAX_LIGHT_DATA_STRUCTS]; +}; + +layout(std140) uniform SpotLightData { //ubo:5 + + LightData spot_lights[MAX_LIGHT_DATA_STRUCTS]; +}; + + +uniform highp sampler2DShadow shadow_atlas; //texunit:-3 + + +struct ReflectionData { + + mediump vec4 box_extents; + mediump vec4 box_offset; + mediump vec4 params; // intensity, 0, interior , boxproject + mediump vec4 ambient; //ambient color, energy + mediump vec4 atlas_clamp; + highp mat4 local_matrix; //up to here for spot and omni, rest is for directional + //notes: for ambientblend, use distance to edge to blend between already existing global environment +}; + +layout(std140) uniform ReflectionProbeData { //ubo:6 + + ReflectionData reflections[MAX_REFLECTION_DATA_STRUCTS]; +}; +uniform mediump sampler2D reflection_atlas; //texunit:-5 + + +#ifdef USE_FORWARD_LIGHTING + +uniform int omni_light_indices[MAX_FORWARD_LIGHTS]; +uniform int omni_light_count; + +uniform int spot_light_indices[MAX_FORWARD_LIGHTS]; +uniform int spot_light_count; + +uniform int reflection_indices[MAX_FORWARD_LIGHTS]; +uniform int reflection_count; + +#endif + + + +#ifdef USE_MULTIPLE_RENDER_TARGETS + +layout(location=0) out vec4 diffuse_buffer; +layout(location=1) out vec4 specular_buffer; +layout(location=2) out vec4 normal_mr_buffer; +#if defined (ENABLE_SSS_MOTION) +layout(location=3) out vec4 motion_ssr_buffer; +#endif + +#else + +layout(location=0) out vec4 frag_color; + +#endif + + +// GGX Specular +// Source: http://www.filmicworlds.com/images/ggx-opt/optimized-ggx.hlsl +float G1V(float dotNV, float k) +{ + return 1.0 / (dotNV * (1.0 - k) + k); +} + + +float SchlickFresnel(float u) +{ + float m = 1.0-u; + float m2 = m*m; + return m2*m2*m; // pow(m,5) +} + +float GTR1(float NdotH, float a) +{ + if (a >= 1.0) return 1.0/M_PI; + float a2 = a*a; + float t = 1.0 + (a2-1.0)*NdotH*NdotH; + return (a2-1.0) / (M_PI*log(a2)*t); +} + +void light_compute(vec3 N, vec3 L,vec3 V,vec3 B, vec3 T,vec3 light_color,vec3 diffuse_color, vec3 specular_color, float specular_blob_intensity, float roughness, float rim,float rim_tint, float clearcoat, float clearcoat_gloss,float anisotropy,inout vec3 diffuse, inout vec3 specular) { + + float dotNL = max(dot(N,L), 0.0 ); + float dotNV = max(dot(N,V), 0.0 ); + +#if defined(LIGHT_USE_RIM) + float rim_light = pow(1.0-dotNV,(1.0-roughness)*16.0); + diffuse += rim_light * rim * mix(vec3(1.0),diffuse_color,rim_tint) * light_color; +#endif + + diffuse += dotNL * light_color * diffuse_color; + + if (roughness > 0.0) { + + float alpha = roughness * roughness; + + vec3 H = normalize(V + L); + + float dotNH = max(dot(N,H), 0.0 ); + float dotLH = max(dot(L,H), 0.0 ); + + // D +#if defined(LIGHT_USE_ANISOTROPY) + + float aspect = sqrt(1.0-anisotropy*0.9); + float rx = roughness/aspect; + float ry = roughness*aspect; + float ax = rx*rx; + float ay = ry*ry; + float dotXH = dot( T, H ); + float dotYH = dot( B, H ); + float pi = M_PI; + float denom = dotXH*dotXH / (ax*ax) + dotYH*dotYH / (ay*ay) + dotNH*dotNH; + float D = 1.0 / ( pi * ax*ay * denom*denom ); + +#else + float alphaSqr = alpha * alpha; + float pi = M_PI; + float denom = dotNH * dotNH * (alphaSqr - 1.0) + 1.0; + float D = alphaSqr / (pi * denom * denom); +#endif + // F + float F0 = 1.0; + float dotLH5 = SchlickFresnel( dotLH ); + float F = F0 + (1.0 - F0) * (dotLH5); + + // V + float k = alpha / 2.0f; + float vis = G1V(dotNL, k) * G1V(dotNV, k); + + float speci = dotNL * D * F * vis; + + specular += speci * light_color /* specular_color*/ * specular_blob_intensity; + +#if defined(LIGHT_USE_CLEARCOAT) + float Dr = GTR1(dotNH, mix(.1,.001,clearcoat_gloss)); + float Fr = mix(.04, 1.0, dotLH5); + float Gr = G1V(dotNL, .25) * G1V(dotNV, .25); + + specular += .25*clearcoat*Gr*Fr*Dr; +#endif + } + + +} + + +float sample_shadow(highp sampler2DShadow shadow, vec2 shadow_pixel_size, vec2 pos, float depth, vec4 clamp_rect) { + +#ifdef SHADOW_MODE_PCF_13 + + float avg=textureProj(shadow,vec4(pos,depth,1.0)); + avg+=textureProj(shadow,vec4(pos+vec2(shadow_pixel_size.x,0.0),depth,1.0)); + avg+=textureProj(shadow,vec4(pos+vec2(-shadow_pixel_size.x,0.0),depth,1.0)); + avg+=textureProj(shadow,vec4(pos+vec2(0.0,shadow_pixel_size.y),depth,1.0)); + avg+=textureProj(shadow,vec4(pos+vec2(0.0,-shadow_pixel_size.y),depth,1.0)); + avg+=textureProj(shadow,vec4(pos+vec2(shadow_pixel_size.x,shadow_pixel_size.y),depth,1.0)); + avg+=textureProj(shadow,vec4(pos+vec2(-shadow_pixel_size.x,shadow_pixel_size.y),depth,1.0)); + avg+=textureProj(shadow,vec4(pos+vec2(shadow_pixel_size.x,-shadow_pixel_size.y),depth,1.0)); + avg+=textureProj(shadow,vec4(pos+vec2(-shadow_pixel_size.x,-shadow_pixel_size.y),depth,1.0)); + avg+=textureProj(shadow,vec4(pos+vec2(shadow_pixel_size.x*2.0,0.0),depth,1.0)); + avg+=textureProj(shadow,vec4(pos+vec2(-shadow_pixel_size.x*2.0,0.0),depth,1.0)); + avg+=textureProj(shadow,vec4(pos+vec2(0.0,shadow_pixel_size.y*2.0),depth,1.0)); + avg+=textureProj(shadow,vec4(pos+vec2(0.0,-shadow_pixel_size.y*2.0),depth,1.0)); + return avg*(1.0/13.0); + +#endif + +#ifdef SHADOW_MODE_PCF_5 + + float avg=textureProj(shadow,vec4(pos,depth,1.0)); + avg+=textureProj(shadow,vec4(pos+vec2(shadow_pixel_size.x,0.0),depth,1.0)); + avg+=textureProj(shadow,vec4(pos+vec2(-shadow_pixel_size.x,0.0),depth,1.0)); + avg+=textureProj(shadow,vec4(pos+vec2(0.0,shadow_pixel_size.y),depth,1.0)); + avg+=textureProj(shadow,vec4(pos+vec2(0.0,-shadow_pixel_size.y),depth,1.0)); + return avg*(1.0/5.0); +#endif + +#if !defined(SHADOW_MODE_PCF_5) && !defined(SHADOW_MODE_PCF_13) + + return textureProj(shadow,vec4(pos,depth,1.0)); +#endif + +} + +#ifdef RENDER_DEPTH_DUAL_PARABOLOID + +in highp float dp_clip; + +#endif + +#if 0 +//need to save texture depth for this + +vec3 light_transmittance(float translucency,vec3 light_vec, vec3 normal, vec3 pos, float distance) { + + float scale = 8.25 * (1.0 - translucency) / subsurface_scatter_width; + float d = scale * distance; + + /** + * Armed with the thickness, we can now calculate the color by means of the + * precalculated transmittance profile. + * (It can be precomputed into a texture, for maximum performance): + */ + float dd = -d * d; + vec3 profile = vec3(0.233, 0.455, 0.649) * exp(dd / 0.0064) + + vec3(0.1, 0.336, 0.344) * exp(dd / 0.0484) + + vec3(0.118, 0.198, 0.0) * exp(dd / 0.187) + + vec3(0.113, 0.007, 0.007) * exp(dd / 0.567) + + vec3(0.358, 0.004, 0.0) * exp(dd / 1.99) + + vec3(0.078, 0.0, 0.0) * exp(dd / 7.41); + + /** + * Using the profile, we finally approximate the transmitted lighting from + * the back of the object: + */ + return profile * clamp(0.3 + dot(light_vec, normal),0.0,1.0); +} +#endif + +void light_process_omni(int idx, vec3 vertex, vec3 eye_vec,vec3 normal,vec3 binormal, vec3 tangent, vec3 albedo, vec3 specular, float roughness, float rim, float rim_tint, float clearcoat, float clearcoat_gloss,float anisotropy,inout vec3 diffuse_light, inout vec3 specular_light) { + + vec3 light_rel_vec = omni_lights[idx].light_pos_inv_radius.xyz-vertex; + float normalized_distance = length( light_rel_vec )*omni_lights[idx].light_pos_inv_radius.w; + vec3 light_attenuation = vec3(pow( max(1.0 - normalized_distance, 0.0), omni_lights[idx].light_direction_attenuation.w )); + + if (omni_lights[idx].light_params.w>0.5) { + //there is a shadowmap + + highp vec3 splane=(omni_lights[idx].shadow_matrix * vec4(vertex,1.0)).xyz; + float shadow_len=length(splane); + splane=normalize(splane); + vec4 clamp_rect=omni_lights[idx].light_clamp; + + if (splane.z>=0.0) { + + splane.z+=1.0; + + clamp_rect.y+=clamp_rect.w; + + } else { + + splane.z=1.0 - splane.z; + + //if (clamp_rect.z<clamp_rect.w) { + // clamp_rect.x+=clamp_rect.z; + //} else { + // clamp_rect.y+=clamp_rect.w; + //} + + } + + splane.xy/=splane.z; + splane.xy=splane.xy * 0.5 + 0.5; + splane.z = shadow_len * omni_lights[idx].light_pos_inv_radius.w; + + splane.xy = clamp_rect.xy+splane.xy*clamp_rect.zw; + + light_attenuation*=mix(omni_lights[idx].shadow_color.rgb,vec3(1.0),sample_shadow(shadow_atlas,shadow_atlas_pixel_size,splane.xy,splane.z,clamp_rect)); + } + + light_compute(normal,normalize(light_rel_vec),eye_vec,binormal,tangent,omni_lights[idx].light_color_energy.rgb*light_attenuation,albedo,specular,omni_lights[idx].light_params.z,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,diffuse_light,specular_light); + +} + +void light_process_spot(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 binormal, vec3 tangent,vec3 albedo, vec3 specular, float roughness, float rim,float rim_tint, float clearcoat, float clearcoat_gloss,float anisotropy, inout vec3 diffuse_light, inout vec3 specular_light) { + + vec3 light_rel_vec = spot_lights[idx].light_pos_inv_radius.xyz-vertex; + float normalized_distance = length( light_rel_vec )*spot_lights[idx].light_pos_inv_radius.w; + vec3 light_attenuation = vec3(pow( max(1.0 - normalized_distance, 0.0), spot_lights[idx].light_direction_attenuation.w )); + vec3 spot_dir = spot_lights[idx].light_direction_attenuation.xyz; + float spot_cutoff=spot_lights[idx].light_params.y; + float scos = max(dot(-normalize(light_rel_vec), spot_dir),spot_cutoff); + float spot_rim = (1.0 - scos) / (1.0 - spot_cutoff); + light_attenuation *= 1.0 - pow( spot_rim, spot_lights[idx].light_params.x); + + if (spot_lights[idx].light_params.w>0.5) { + //there is a shadowmap + highp vec4 splane=(spot_lights[idx].shadow_matrix * vec4(vertex,1.0)); + splane.xyz/=splane.w; + light_attenuation*=mix(spot_lights[idx].shadow_color.rgb,vec3(1.0),sample_shadow(shadow_atlas,shadow_atlas_pixel_size,splane.xy,splane.z,spot_lights[idx].light_clamp)); + } + + light_compute(normal,normalize(light_rel_vec),eye_vec,binormal,tangent,spot_lights[idx].light_color_energy.rgb*light_attenuation,albedo,specular,spot_lights[idx].light_params.z,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,diffuse_light,specular_light); + +} + +void reflection_process(int idx, vec3 vertex, vec3 normal,vec3 binormal, vec3 tangent,float roughness,float anisotropy,vec3 ambient,vec3 skybox,vec2 brdf, inout highp vec4 reflection_accum,inout highp vec4 ambient_accum) { + + vec3 ref_vec = normalize(reflect(vertex,normal)); + vec3 local_pos = (reflections[idx].local_matrix * vec4(vertex,1.0)).xyz; + vec3 box_extents = reflections[idx].box_extents.xyz; + + if (any(greaterThan(abs(local_pos),box_extents))) { //out of the reflection box + return; + } + + vec3 inner_pos = abs(local_pos / box_extents); + float blend = max(inner_pos.x,max(inner_pos.y,inner_pos.z)); + //make blend more rounded + blend=mix(length(inner_pos),blend,blend); + blend*=blend; + blend=1.001-blend; + + if (reflections[idx].params.x>0.0){// compute reflection + + vec3 local_ref_vec = (reflections[idx].local_matrix * vec4(ref_vec,0.0)).xyz; + + if (reflections[idx].params.w > 0.5) { //box project + + vec3 nrdir = normalize(local_ref_vec); + vec3 rbmax = (box_extents - local_pos)/nrdir; + vec3 rbmin = (-box_extents - local_pos)/nrdir; + + + vec3 rbminmax = mix(rbmin,rbmax,greaterThan(nrdir,vec3(0.0,0.0,0.0))); + + float fa = min(min(rbminmax.x, rbminmax.y), rbminmax.z); + vec3 posonbox = local_pos + nrdir * fa; + local_ref_vec = posonbox - reflections[idx].box_offset.xyz; + } + + + + vec3 splane=normalize(local_ref_vec); + vec4 clamp_rect=reflections[idx].atlas_clamp; + + splane.z*=-1.0; + if (splane.z>=0.0) { + splane.z+=1.0; + clamp_rect.y+=clamp_rect.w; + } else { + splane.z=1.0 - splane.z; + splane.y=-splane.y; + } + + splane.xy/=splane.z; + splane.xy=splane.xy * 0.5 + 0.5; + + splane.xy = splane.xy * clamp_rect.zw + clamp_rect.xy; + splane.xy = clamp(splane.xy,clamp_rect.xy,clamp_rect.xy+clamp_rect.zw); + + highp vec4 reflection; + reflection.rgb = textureLod(reflection_atlas,splane.xy,roughness*5.0).rgb * brdf.x + brdf.y; + + if (reflections[idx].params.z < 0.5) { + reflection.rgb = mix(skybox,reflection.rgb,blend); + } + reflection.rgb*=reflections[idx].params.x; + reflection.a = blend; + reflection.rgb*=reflection.a; + + reflection_accum+=reflection; + } + + if (reflections[idx].ambient.a>0.0) { //compute ambient using skybox + + + vec3 local_amb_vec = (reflections[idx].local_matrix * vec4(normal,0.0)).xyz; + + vec3 splane=normalize(local_amb_vec); + vec4 clamp_rect=reflections[idx].atlas_clamp; + + splane.z*=-1.0; + if (splane.z>=0.0) { + splane.z+=1.0; + clamp_rect.y+=clamp_rect.w; + } else { + splane.z=1.0 - splane.z; + splane.y=-splane.y; + } + + splane.xy/=splane.z; + splane.xy=splane.xy * 0.5 + 0.5; + + splane.xy = splane.xy * clamp_rect.zw + clamp_rect.xy; + splane.xy = clamp(splane.xy,clamp_rect.xy,clamp_rect.xy+clamp_rect.zw); + + highp vec4 ambient_out; + ambient_out.a=blend; + ambient_out.rgb = textureLod(reflection_atlas,splane.xy,5.0).rgb; + ambient_out.rgb=mix(reflections[idx].ambient.rgb,ambient_out.rgb,reflections[idx].ambient.a); + if (reflections[idx].params.z < 0.5) { + ambient_out.rgb = mix(ambient,ambient_out.rgb,blend); + } + + ambient_out.rgb *= ambient_out.a; + ambient_accum+=ambient_out; + } else { + + highp vec4 ambient_out; + ambient_out.a=blend; + ambient_out.rgb=reflections[idx].ambient.rgb; + if (reflections[idx].params.z < 0.5) { + ambient_out.rgb = mix(ambient,ambient_out.rgb,blend); + } + ambient_out.rgb *= ambient_out.a; + ambient_accum+=ambient_out; + + } +} + +#ifdef USE_GI_PROBES + +uniform mediump sampler3D gi_probe1; //texunit:-6 +uniform highp mat4 gi_probe_xform1; +uniform highp vec3 gi_probe_bounds1; +uniform highp vec3 gi_probe_cell_size1; +uniform highp float gi_probe_multiplier1; +uniform bool gi_probe_blend_ambient1; + +uniform mediump sampler3D gi_probe2; //texunit:-7 +uniform highp mat4 gi_probe_xform2; +uniform highp vec3 gi_probe_bounds2; +uniform highp vec3 gi_probe_cell_size2; +uniform highp float gi_probe_multiplier2; +uniform bool gi_probe2_enabled; +uniform bool gi_probe_blend_ambient2; + +vec3 voxel_cone_trace(sampler3D probe, vec3 cell_size, vec3 pos, vec3 ambient, bool blend_ambient, vec3 direction, float tan_half_angle, float max_distance) { + + + float dist = dot(direction,mix(vec3(-1.0),vec3(1.0),greaterThan(direction,vec3(0.0))))*2.0; + float alpha=0.0; + vec3 color = vec3(0.0); + + while(dist < max_distance && alpha < 0.95) { + float diameter = max(1.0, 2.0 * tan_half_angle * dist); + vec4 scolor = textureLod(probe, (pos + dist * direction) * cell_size, log2(diameter) ); + float a = (1.0 - alpha); + color += scolor.rgb * a; + alpha += a * scolor.a; + dist += diameter * 0.5; + } + + //color.rgb = mix(color.rgb,mix(ambient,color.rgb,alpha),blend_ambient); + + return color; +} + +void gi_probe_compute(sampler3D probe, mat4 probe_xform, vec3 bounds,vec3 cell_size,vec3 pos, vec3 ambient, vec3 environment, bool blend_ambient,float multiplier, mat3 normal_mtx,vec3 ref_vec, float roughness, out vec4 out_spec, out vec4 out_diff) { + + + + vec3 probe_pos = (probe_xform * vec4(pos,1.0)).xyz; + vec3 ref_pos = (probe_xform * vec4(pos+ref_vec,1.0)).xyz; + + ref_vec = normalize(ref_pos - probe_pos); + +/* out_diff.rgb = voxel_cone_trace(probe,cell_size,probe_pos,normalize((probe_xform * vec4(ref_vec,0.0)).xyz),0.0 ,100.0); + out_diff.a = 1.0; + return;*/ + //out_diff = vec4(textureLod(probe,probe_pos*cell_size,3.0).rgb,1.0); + //return; + + if (any(bvec2(any(lessThan(probe_pos,vec3(0.0))),any(greaterThan(probe_pos,bounds))))) + return; + + vec3 blendv = probe_pos/bounds * 2.0 - 1.0; + float blend = 1.001-max(blendv.x,max(blendv.y,blendv.z)); + blend=1.0; + + float max_distance = length(bounds); + + //radiance +#ifdef VCT_QUALITY_HIGH + +#define MAX_CONE_DIRS 6 + vec3 cone_dirs[MAX_CONE_DIRS] = vec3[] ( + vec3(0, 0, 1), + vec3(0.866025, 0, 0.5), + vec3(0.267617, 0.823639, 0.5), + vec3(-0.700629, 0.509037, 0.5), + vec3(-0.700629, -0.509037, 0.5), + vec3(0.267617, -0.823639, 0.5) + ); + + float cone_weights[MAX_CONE_DIRS] = float[](0.25, 0.15, 0.15, 0.15, 0.15, 0.15); + float cone_angle_tan = 0.577; + float min_ref_tan = 0.0; +#else + +#define MAX_CONE_DIRS 4 + + vec3 cone_dirs[MAX_CONE_DIRS] = vec3[] ( + vec3(0.707107, 0, 0.707107), + vec3(0, 0.707107, 0.707107), + vec3(-0.707107, 0, 0.707107), + vec3(0, -0.707107, 0.707107) + ); + + float cone_weights[MAX_CONE_DIRS] = float[](0.25, 0.25, 0.25, 0.25); + float cone_angle_tan = 0.98269; + max_distance*=0.5; + float min_ref_tan = 0.2; + +#endif + vec3 light=vec3(0.0); + for(int i=0;i<MAX_CONE_DIRS;i++) { + + vec3 dir = normalize( (probe_xform * vec4(pos + normal_mtx * cone_dirs[i],1.0)).xyz - probe_pos); + light+=cone_weights[i] * voxel_cone_trace(probe,cell_size,probe_pos,ambient,blend_ambient,dir,cone_angle_tan,max_distance); + + } + + light*=multiplier; + + out_diff = vec4(light*blend,blend); + + //irradiance + + vec3 irr_light = voxel_cone_trace(probe,cell_size,probe_pos,environment,blend_ambient,ref_vec,max(min_ref_tan,tan(roughness * 0.5 * M_PI)) ,max_distance); + + irr_light *= multiplier; + //irr_light=vec3(0.0); + + out_spec = vec4(irr_light*blend,blend); +} + + +void gi_probes_compute(vec3 pos, vec3 normal, float roughness, vec3 specular, inout vec3 out_specular, inout vec3 out_ambient) { + + roughness = roughness * roughness; + + vec3 ref_vec = normalize(reflect(normalize(pos),normal)); + + //find arbitrary tangent and bitangent, then build a matrix + vec3 v0 = abs(normal.z) < 0.999 ? vec3(0, 0, 1) : vec3(0, 1, 0); + vec3 tangent = normalize(cross(v0, normal)); + vec3 bitangent = normalize(cross(tangent, normal)); + mat3 normal_mat = mat3(tangent,bitangent,normal); + + vec4 diff_accum = vec4(0.0); + vec4 spec_accum = vec4(0.0); + + vec3 ambient = out_ambient; + out_ambient = vec3(0.0); + + vec3 environment = out_specular; + + out_specular = vec3(0.0); + + gi_probe_compute(gi_probe1,gi_probe_xform1,gi_probe_bounds1,gi_probe_cell_size1,pos,ambient,environment,gi_probe_blend_ambient1,gi_probe_multiplier1,normal_mat,ref_vec,roughness,spec_accum,diff_accum); + + if (gi_probe2_enabled) { + + gi_probe_compute(gi_probe2,gi_probe_xform2,gi_probe_bounds2,gi_probe_cell_size2,pos,ambient,environment,gi_probe_blend_ambient2,gi_probe_multiplier2,normal_mat,ref_vec,roughness,spec_accum,diff_accum); + } + + if (diff_accum.a>0.0) { + diff_accum.rgb/=diff_accum.a; + } + + if (spec_accum.a>0.0) { + spec_accum.rgb/=spec_accum.a; + } + + out_specular+=spec_accum.rgb; + out_ambient+=diff_accum.rgb; + +} + +#endif + + +void main() { + +#ifdef RENDER_DEPTH_DUAL_PARABOLOID + + if (dp_clip>0.0) + discard; +#endif + + //lay out everything, whathever is unused is optimized away anyway + highp vec3 vertex = vertex_interp; + vec3 albedo = vec3(0.8,0.8,0.8); + vec3 specular = vec3(0.2,0.2,0.2); + vec3 emission = vec3(0.0,0.0,0.0); + float roughness = 1.0; + float rim = 0.0; + float rim_tint = 0.0; + float clearcoat=0.0; + float clearcoat_gloss=0.0; + float anisotropy = 1.0; + vec2 anisotropy_flow = vec2(1.0,0.0); + +#if defined(ENABLE_AO) + float ao=1.0; +#endif + + float alpha = 1.0; + +#ifdef METERIAL_DOUBLESIDED + float side=float(gl_FrontFacing)*2.0-1.0; +#else + float side=1.0; +#endif + + +#if defined(ENABLE_TANGENT_INTERP) || defined(ENABLE_NORMALMAP) || defined(LIGHT_USE_ANISOTROPY) + vec3 binormal = normalize(binormal_interp)*side; + vec3 tangent = normalize(tangent_interp)*side; +#else + vec3 binormal = vec3(0.0); + vec3 tangent = vec3(0.0); +#endif + vec3 normal = normalize(normal_interp)*side; + +#if defined(ENABLE_UV_INTERP) + vec2 uv = uv_interp; +#endif + +#if defined(ENABLE_UV2_INTERP) + vec2 uv2 = uv2_interp; +#endif + +#if defined(ENABLE_COLOR_INTERP) + vec4 color = color_interp; +#endif + +#if defined(ENABLE_NORMALMAP) + + vec3 normalmap = vec3(0.0); +#endif + + float normaldepth=1.0; + + + +#if defined(ENABLE_DISCARD) + bool discard_=false; +#endif + +#if defined (ENABLE_SSS_MOTION) + float sss_strength=0.0; +#endif + +{ + + +FRAGMENT_SHADER_CODE + +} + + + +#if defined(ENABLE_NORMALMAP) + + normalmap.xy=normalmap.xy*2.0-1.0; + normalmap.z=sqrt(1.0-dot(normalmap.xy,normalmap.xy)); //always ignore Z, as it can be RG packed, Z may be pos/neg, etc. + + normal = normalize( mix(normal_interp,tangent * normalmap.x + binormal * normalmap.y + normal * normalmap.z,normaldepth) ) * side; + +#endif + +#if defined(LIGHT_USE_ANISOTROPY) + + if (anisotropy>0.01) { + //rotation matrix + mat3 rot = mat3( tangent, binormal, normal ); + //make local to space + tangent = normalize(rot * vec3(anisotropy_flow.x,anisotropy_flow.y,0.0)); + binormal = normalize(rot * vec3(-anisotropy_flow.y,anisotropy_flow.x,0.0)); + } + +#endif + +#if defined(ENABLE_DISCARD) + if (discard_) { + //easy to eliminate dead code + discard; + } +#endif + +#ifdef ENABLE_CLIP_ALPHA + if (albedo.a<0.99) { + //used for doublepass and shadowmapping + discard; + } +#endif + +/////////////////////// LIGHTING ////////////////////////////// + + //apply energy conservation + + vec3 specular_light = vec3(0.0,0.0,0.0); + vec3 ambient_light; + vec3 diffuse_light = vec3(0.0,0.0,0.0); + + vec3 eye_vec = -normalize( vertex_interp ); + +#ifndef RENDER_DEPTH + float ndotv = clamp(dot(normal,eye_vec),0.0,1.0); + + vec2 brdf = texture(brdf_texture, vec2(roughness, ndotv)).xy; +#endif + +#ifdef USE_RADIANCE_MAP + + if (no_ambient_light) { + ambient_light=vec3(0.0,0.0,0.0); + } else { + { + + + + float lod = roughness * 5.0; + + { //read radiance from dual paraboloid + + vec3 ref_vec = reflect(-eye_vec,normal); //2.0 * ndotv * normal - view; // reflect(v, n); + ref_vec=normalize((radiance_inverse_xform * vec4(ref_vec,0.0)).xyz); + + vec3 norm = normalize(ref_vec); + float y_ofs=0.0; + if (norm.z>=0.0) { + + norm.z+=1.0; + y_ofs+=0.5; + } else { + norm.z=1.0 - norm.z; + norm.y=-norm.y; + } + + norm.xy/=norm.z; + norm.xy=norm.xy * vec2(0.5,0.25) + vec2(0.5,0.25+y_ofs); + specular_light = textureLod(radiance_map, norm.xy, lod).xyz * brdf.x + brdf.y; + + } + //no longer a cubemap + //vec3 radiance = textureLod(radiance_cube, r, lod).xyz * ( brdf.x + brdf.y); + + } + + { + + /*vec3 ambient_dir=normalize((radiance_inverse_xform * vec4(normal,0.0)).xyz); + vec3 env_ambient=textureLod(radiance_cube, ambient_dir, 5.0).xyz; + + ambient_light=mix(ambient_light_color.rgb,env_ambient,radiance_ambient_contribution);*/ + ambient_light=vec3(0.0,0.0,0.0); + } + } + +#else + + if (no_ambient_light){ + ambient_light=vec3(0.0,0.0,0.0); + } else { + ambient_light=ambient_light_color.rgb; + } +#endif + + +#ifdef USE_LIGHT_DIRECTIONAL + + vec3 light_attenuation=vec3(1.0); + +#ifdef LIGHT_DIRECTIONAL_SHADOW + + if (gl_FragCoord.w > shadow_split_offsets.w) { + + vec3 pssm_coord; + +#ifdef LIGHT_USE_PSSM_BLEND + float pssm_blend; + vec3 pssm_coord2; + bool use_blend=true; + vec3 light_pssm_split_inv = 1.0/shadow_split_offsets.xyz; + float w_inv = 1.0/gl_FragCoord.w; +#endif + + +#ifdef LIGHT_USE_PSSM4 + + + if (gl_FragCoord.w > shadow_split_offsets.y) { + + if (gl_FragCoord.w > shadow_split_offsets.x) { + + highp vec4 splane=(shadow_matrix1 * vec4(vertex,1.0)); + pssm_coord=splane.xyz/splane.w; + + +#if defined(LIGHT_USE_PSSM_BLEND) + + splane=(shadow_matrix2 * vec4(vertex,1.0)); + pssm_coord2=splane.xyz/splane.w; + pssm_blend=smoothstep(0.0,light_pssm_split_inv.x,w_inv); +#endif + + } else { + + highp vec4 splane=(shadow_matrix2 * vec4(vertex,1.0)); + pssm_coord=splane.xyz/splane.w; + +#if defined(LIGHT_USE_PSSM_BLEND) + splane=(shadow_matrix3 * vec4(vertex,1.0)); + pssm_coord2=splane.xyz/splane.w; + pssm_blend=smoothstep(light_pssm_split_inv.x,light_pssm_split_inv.y,w_inv); +#endif + + } + } else { + + + if (gl_FragCoord.w > shadow_split_offsets.z) { + + highp vec4 splane=(shadow_matrix3 * vec4(vertex,1.0)); + pssm_coord=splane.xyz/splane.w; + +#if defined(LIGHT_USE_PSSM_BLEND) + splane=(shadow_matrix4 * vec4(vertex,1.0)); + pssm_coord2=splane.xyz/splane.w; + pssm_blend=smoothstep(light_pssm_split_inv.y,light_pssm_split_inv.z,w_inv); +#endif + + } else { + highp vec4 splane=(shadow_matrix4 * vec4(vertex,1.0)); + pssm_coord=splane.xyz/splane.w; + +#if defined(LIGHT_USE_PSSM_BLEND) + use_blend=false; + +#endif + + } + } + +#endif //LIGHT_USE_PSSM4 + +#ifdef LIGHT_USE_PSSM2 + + if (gl_FragCoord.w > shadow_split_offsets.x) { + + highp vec4 splane=(shadow_matrix1 * vec4(vertex,1.0)); + pssm_coord=splane.xyz/splane.w; + + +#if defined(LIGHT_USE_PSSM_BLEND) + + splane=(shadow_matrix2 * vec4(vertex,1.0)); + pssm_coord2=splane.xyz/splane.w; + pssm_blend=smoothstep(0.0,light_pssm_split_inv.x,w_inv); +#endif + + } else { + highp vec4 splane=(shadow_matrix2 * vec4(vertex,1.0)); + pssm_coord=splane.xyz/splane.w; +#if defined(LIGHT_USE_PSSM_BLEND) + use_blend=false; + +#endif + + } + +#endif //LIGHT_USE_PSSM2 + +#if !defined(LIGHT_USE_PSSM4) && !defined(LIGHT_USE_PSSM2) + { //regular orthogonal + highp vec4 splane=(shadow_matrix1 * vec4(vertex,1.0)); + pssm_coord=splane.xyz/splane.w; + } +#endif + + + //one one sample + light_attenuation=mix(shadow_color.rgb,vec3(1.0),sample_shadow(directional_shadow,directional_shadow_pixel_size,pssm_coord.xy,pssm_coord.z,light_clamp)); + + +#if defined(LIGHT_USE_PSSM_BLEND) + if (use_blend) { + vec3 light_attenuation2=mix(shadow_color.rgb,vec3(1.0),sample_shadow(directional_shadow,directional_shadow_pixel_size,pssm_coord2.xy,pssm_coord2.z,light_clamp)); + light_attenuation=mix(light_attenuation,light_attenuation2,pssm_blend); + } +#endif + + } + +#endif //LIGHT_DIRECTIONAL_SHADOW + + light_compute(normal,-light_direction_attenuation.xyz,eye_vec,binormal,tangent,light_color_energy.rgb*light_attenuation,albedo,specular,light_params.z,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,diffuse_light,specular_light); + + +#endif //#USE_LIGHT_DIRECTIONAL + +#ifdef USE_GI_PROBES + gi_probes_compute(vertex,normal,roughness,specular,specular_light,ambient_light); +#endif + + +#ifdef USE_FORWARD_LIGHTING + + highp vec4 reflection_accum = vec4(0.0,0.0,0.0,0.0); + highp vec4 ambient_accum = vec4(0.0,0.0,0.0,0.0); + + + + for(int i=0;i<reflection_count;i++) { + reflection_process(reflection_indices[i],vertex,normal,binormal,tangent,roughness,anisotropy,ambient_light,specular_light,brdf,reflection_accum,ambient_accum); + } + + if (reflection_accum.a>0.0) { + specular_light+=reflection_accum.rgb/reflection_accum.a; + } + if (ambient_accum.a>0.0) { + ambient_light+=ambient_accum.rgb/ambient_accum.a; + } + + for(int i=0;i<omni_light_count;i++) { + light_process_omni(omni_light_indices[i],vertex,eye_vec,normal,binormal,tangent,albedo,specular,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,diffuse_light,specular_light); + } + + for(int i=0;i<spot_light_count;i++) { + light_process_spot(spot_light_indices[i],vertex,eye_vec,normal,binormal,tangent,albedo,specular,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,diffuse_light,specular_light); + } + + + +#endif + + + + +#if defined(USE_LIGHT_SHADER_CODE) +//light is written by the light shader +{ + +LIGHT_SHADER_CODE + +} +#endif + +#ifdef RENDER_DEPTH +//nothing happens, so a tree-ssa optimizer will result in no fragment shader :) +#else + + specular_light*=reflection_multiplier; + ambient_light*=albedo; //ambient must be multiplied by albedo at the end + +#if defined(ENABLE_AO) + ambient_light*=ao; +#endif + + //energy conservation + diffuse_light=mix(diffuse_light,vec3(0.0),specular); + ambient_light=mix(ambient_light,vec3(0.0),specular); + specular_light *= max(vec3(0.04),specular); + +#ifdef USE_MULTIPLE_RENDER_TARGETS + +#if defined(ENABLE_AO) + + float ambient_scale=0.0; // AO is supplied by material +#else + //approximate ambient scale for SSAO, since we will lack full ambient + float max_emission=max(emission.r,max(emission.g,emission.b)); + float max_ambient=max(ambient_light.r,max(ambient_light.g,ambient_light.b)); + float max_diffuse=max(diffuse_light.r,max(diffuse_light.g,diffuse_light.b)); + float total_ambient = max_ambient+max_diffuse+max_emission; + float ambient_scale = (total_ambient>0.0) ? (max_ambient+ambient_occlusion_affect_light*max_diffuse)/total_ambient : 0.0; +#endif //ENABLE_AO + + diffuse_buffer=vec4(emission+diffuse_light+ambient_light,ambient_scale); + specular_buffer=vec4(specular_light,max(specular.r,max(specular.g,specular.b))); + + + normal_mr_buffer=vec4(normalize(normal)*0.5+0.5,roughness); + +#if defined (ENABLE_SSS_MOTION) + motion_ssr_buffer = vec4(vec3(0.0),sss_strength); +#endif + +#else + + +#ifdef SHADELESS + frag_color=vec4(albedo,alpha); +#else + frag_color=vec4(emission+ambient_light+diffuse_light+specular_light,alpha); +#endif //SHADELESS + + +#endif //USE_MULTIPLE_RENDER_TARGETS + + + +#endif //RENDER_DEPTH + + +} + + diff --git a/drivers/gles3/shaders/screen_space_reflection.glsl b/drivers/gles3/shaders/screen_space_reflection.glsl new file mode 100644 index 0000000000..ec4bdf86c9 --- /dev/null +++ b/drivers/gles3/shaders/screen_space_reflection.glsl @@ -0,0 +1,345 @@ +[vertex] + + +layout(location=0) in highp vec4 vertex_attrib; +layout(location=4) in vec2 uv_in; + +out vec2 uv_interp; +out vec2 pos_interp; + +void main() { + + uv_interp = uv_in; + gl_Position = vertex_attrib; + pos_interp.xy=gl_Position.xy; +} + +[fragment] + + +in vec2 uv_interp; +in vec2 pos_interp; + +uniform sampler2D source_diffuse; //texunit:0 +uniform sampler2D source_normal_roughness; //texunit:1 +uniform sampler2D source_depth; //texunit:2 + +uniform float camera_z_near; +uniform float camera_z_far; + +uniform vec2 viewport_size; +uniform vec2 pixel_size; + +uniform float filter_mipmap_levels; + +uniform mat4 inverse_projection; +uniform mat4 projection; + +uniform int num_steps; +uniform float depth_tolerance; +uniform float distance_fade; +uniform float acceleration; + +layout(location = 0) out vec4 frag_color; + + +vec2 view_to_screen(vec3 view_pos,out float w) { + vec4 projected = projection * vec4(view_pos, 1.0); + projected.xyz /= projected.w; + projected.xy = projected.xy * 0.5 + 0.5; + w=projected.w; + return projected.xy; +} + + + +#define M_PI 3.14159265359 + + +void main() { + + + //// + + vec4 diffuse = texture( source_diffuse, uv_interp ); + vec4 normal_roughness = texture( source_normal_roughness, uv_interp); + + vec3 normal; + + normal = normal_roughness.xyz*2.0-1.0; + + float roughness = normal_roughness.w; + + float depth_tex = texture(source_depth,uv_interp).r; + + vec4 world_pos = inverse_projection * vec4( uv_interp*2.0-1.0, depth_tex*2.0-1.0, 1.0 ); + vec3 vertex = world_pos.xyz/world_pos.w; + + vec3 view_dir = normalize(vertex); + vec3 ray_dir = normalize(reflect(view_dir, normal)); + + if (dot(ray_dir,normal)<0.001) { + frag_color=vec4(0.0); + return; + } + //ray_dir = normalize(view_dir - normal * dot(normal,view_dir) * 2.0); + + //ray_dir = normalize(vec3(1,1,-1)); + + + //////////////// + + + //make ray length and clip it against the near plane (don't want to trace beyond visible) + float ray_len = (vertex.z + ray_dir.z * camera_z_far) > -camera_z_near ? (-camera_z_near - vertex.z) / ray_dir.z : camera_z_far; + vec3 ray_end = vertex + ray_dir*ray_len; + + float w_begin; + vec2 vp_line_begin = view_to_screen(vertex,w_begin); + float w_end; + vec2 vp_line_end = view_to_screen( ray_end, w_end); + vec2 vp_line_dir = vp_line_end-vp_line_begin; + + //we need to interpolate w along the ray, to generate perspective correct reflections + + w_begin = 1.0/w_begin; + w_end = 1.0/w_end; + + + float z_begin = vertex.z*w_begin; + float z_end = ray_end.z*w_end; + + vec2 line_begin = vp_line_begin/pixel_size; + vec2 line_dir = vp_line_dir/pixel_size; + float z_dir = z_end - z_begin; + float w_dir = w_end - w_begin; + + + // clip the line to the viewport edges + + float scale_max_x = min(1, 0.99 * (1.0 - vp_line_begin.x) / max(1e-5, vp_line_dir.x)); + float scale_max_y = min(1, 0.99 * (1.0 - vp_line_begin.y) / max(1e-5, vp_line_dir.y)); + float scale_min_x = min(1, 0.99 * vp_line_begin.x / max(1e-5, -vp_line_dir.x)); + float scale_min_y = min(1, 0.99 * vp_line_begin.y / max(1e-5, -vp_line_dir.y)); + float line_clip = min(scale_max_x, scale_max_y) * min(scale_min_x, scale_min_y); + line_dir *= line_clip; + z_dir *= line_clip; + w_dir *=line_clip; + + //clip z and w advance to line advance + vec2 line_advance = normalize(line_dir); //down to pixel + float step_size = length(line_advance)/length(line_dir); + float z_advance = z_dir*step_size; // adapt z advance to line advance + float w_advance = w_dir*step_size; // adapt w advance to line advance + + //make line advance faster if direction is closer to pixel edges (this avoids sampling the same pixel twice) + float advance_angle_adj = 1.0/max(abs(line_advance.x),abs(line_advance.y)); + line_advance*=advance_angle_adj; // adapt z advance to line advance + z_advance*=advance_angle_adj; + w_advance*=advance_angle_adj; + + vec2 pos = line_begin; + float z = z_begin; + float w = w_begin; + float z_from=z/w; + float z_to=z_from; + float depth; + vec2 prev_pos=pos; + + bool found=false; + + //if acceleration > 0, distance between pixels gets larger each step. This allows covering a larger area + float accel=1.0+acceleration; + float steps_taken=0; + + for(float i=0;i<num_steps;i++) { + + pos+=line_advance; + z+=z_advance; + w+=w_advance; + + //convert to linear depth + depth = texture(source_depth, pos*pixel_size).r * 2.0 - 1.0; + depth = 2.0 * camera_z_near * camera_z_far / (camera_z_far + camera_z_near - depth * (camera_z_far - camera_z_near)); + depth=-depth; + + z_from = z_to; + z_to = z/w; + + if (depth>z_to) { + //if depth was surpassed + if (depth<=max(z_to,z_from)+depth_tolerance) { + //check the depth tolerance + found=true; + } + break; + } + + steps_taken+=1.0; + prev_pos=pos; + z_advance*=accel; + w_advance*=accel; + line_advance*=accel; + } + + + + + if (found) { + + float margin_blend=1.0; + + + vec2 margin = vec2((viewport_size.x+viewport_size.y)*0.5*0.05); //make a uniform margin + if (any(bvec4(lessThan(pos,-margin),greaterThan(pos,viewport_size+margin)))) { + //clip outside screen + margin + frag_color=vec4(0.0); + return; + } + + { + //blend fading out towards external margin + vec2 margin_grad = mix(pos-viewport_size,-pos,lessThan(pos,vec2(0.0))); + margin_blend = 1.0-smoothstep(0.0,margin.x,max(margin_grad.x,margin_grad.y)); + //margin_blend=1.0; + + } + + vec2 final_pos; + float grad; + +#ifdef SMOOTH_ACCEL + //if the distance between point and prev point is >1, then take some samples in the middle for smoothing out the image + vec2 blend_dir = pos - prev_pos; + float steps = min(8.0,length(blend_dir)); + if (steps>2.0) { + vec2 blend_step = blend_dir/steps; + float blend_z = (z_to-z_from)/steps; + vec2 new_pos; + float subgrad=0.0; + for(float i=0.0;i<steps;i++) { + + new_pos = (prev_pos+blend_step*i); + float z = z_from+blend_z*i; + + depth = texture(source_depth, new_pos*pixel_size).r * 2.0 - 1.0; + depth = 2.0 * camera_z_near * camera_z_far / (camera_z_far + camera_z_near - depth * (camera_z_far - camera_z_near)); + depth=-depth; + + subgrad=i/steps; + if (depth>z) + break; + } + + final_pos = new_pos; + grad=(steps_taken+subgrad)/num_steps; + + } else { +#endif + grad=steps_taken/num_steps; + final_pos=pos; +#ifdef SMOOTH_ACCEL + } + +#endif + + + +#ifdef REFLECT_ROUGHNESS + + + vec4 final_color; + //if roughness is enabled, do screen space cone tracing + if (roughness > 0.001) { + /////////////////////////////////////////////////////////////////////////////////////// + //use a blurred version (in consecutive mipmaps) of the screen to simulate roughness + + float gloss = 1.0-roughness; + float cone_angle = roughness * M_PI * 0.5; + vec2 cone_dir = final_pos - line_begin; + float cone_len = length(cone_dir); + cone_dir = normalize(cone_dir); //will be used normalized from now on + float max_mipmap = filter_mipmap_levels -1; + float gloss_mult=gloss; + + float rem_alpha=1.0; + final_color = vec4(0.0); + + for(int i=0;i<7;i++) { + + float op_len = 2.0 * tan(cone_angle) * cone_len; //oposite side of iso triangle + float radius; + { + //fit to sphere inside cone (sphere ends at end of cone), something like this: + // ___ + // \O/ + // V + // + // as it avoids bleeding from beyond the reflection as much as possible. As a plus + // it also makes the rough reflection more elongated. + float a = op_len; + float h = cone_len; + float a2 = a * a; + float fh2 = 4.0f * h * h; + radius = (a * (sqrt(a2 + fh2) - a)) / (4.0f * h); + } + + //find the place where screen must be sampled + vec2 sample_pos = ( line_begin + cone_dir * (cone_len - radius) ) * pixel_size; + //radius is in pixels, so it's natural that log2(radius) maps to the right mipmap for the amount of pixels + float mipmap = clamp( log2( radius ), 0.0, max_mipmap ); + + //mipmap = max(mipmap-1.0,0.0); + //do sampling + + vec4 sample_color; + { + sample_color = textureLod(source_diffuse,sample_pos,mipmap); + } + + //multiply by gloss + sample_color.rgb*=gloss_mult; + sample_color.a=gloss_mult; + + rem_alpha -= sample_color.a; + if(rem_alpha < 0.0) { + sample_color.rgb *= (1.0 - abs(rem_alpha)); + } + + final_color+=sample_color; + + if (final_color.a>=0.95) { + // This code of accumulating gloss and aborting on near one + // makes sense when you think of cone tracing. + // Think of it as if roughness was 0, then we could abort on the first + // iteration. For lesser roughness values, we need more iterations, but + // each needs to have less influence given the sphere is smaller + break; + } + + cone_len-=radius*2.0; //go to next (smaller) circle. + + gloss_mult*=gloss; + + + } + } else { + final_color = textureLod(source_diffuse,final_pos*pixel_size,0.0); + } + + frag_color = vec4(final_color.rgb,pow(clamp(1.0-grad,0.0,1.0),distance_fade)*margin_blend); + +#else + frag_color = vec4(textureLod(source_diffuse,final_pos*pixel_size,0.0).rgb,pow(clamp(1.0-grad,0.0,1.0),distance_fade)*margin_blend); +#endif + + + + } else { + frag_color = vec4(0.0,0.0,0.0,0.0); + } + + + +} + diff --git a/drivers/gles3/shaders/ssao.glsl b/drivers/gles3/shaders/ssao.glsl new file mode 100644 index 0000000000..75f49ef37a --- /dev/null +++ b/drivers/gles3/shaders/ssao.glsl @@ -0,0 +1,247 @@ +[vertex] + + +layout(location=0) in highp vec4 vertex_attrib; + +void main() { + + gl_Position = vertex_attrib; + gl_Position.z=1.0; +} + +[fragment] + + +#define NUM_SAMPLES (11) + +// If using depth mip levels, the log of the maximum pixel offset before we need to switch to a lower +// miplevel to maintain reasonable spatial locality in the cache +// If this number is too small (< 3), too many taps will land in the same pixel, and we'll get bad variance that manifests as flashing. +// If it is too high (> 5), we'll get bad performance because we're not using the MIP levels effectively +#define LOG_MAX_OFFSET (3) + +// This must be less than or equal to the MAX_MIP_LEVEL defined in SSAO.cpp +#define MAX_MIP_LEVEL (4) + +// This is the number of turns around the circle that the spiral pattern makes. This should be prime to prevent +// taps from lining up. This particular choice was tuned for NUM_SAMPLES == 9 +#define NUM_SPIRAL_TURNS (7) + + +uniform sampler2D source_depth; //texunit:0 +uniform usampler2D source_depth_mipmaps; //texunit:1 +uniform sampler2D source_normal; //texunit:2 + +uniform ivec2 screen_size; +uniform float camera_z_far; +uniform float camera_z_near; + +uniform float intensity_div_r6; +uniform float radius; + +#ifdef ENABLE_RADIUS2 +uniform float intensity_div_r62; +uniform float radius2; +#endif + +uniform float bias; +uniform float proj_scale; + +layout(location = 0) out float visibility; + +uniform vec4 proj_info; + +vec3 reconstructCSPosition(vec2 S, float z) { + return vec3((S.xy * proj_info.xy + proj_info.zw) * z, z); +} + +vec3 getPosition(ivec2 ssP) { + vec3 P; + P.z = texelFetch(source_depth, ssP, 0).r; + + P.z = P.z * 2.0 - 1.0; + P.z = 2.0 * camera_z_near * camera_z_far / (camera_z_far + camera_z_near - P.z * (camera_z_far - camera_z_near)); + P.z = -P.z; + + // Offset to pixel center + P = reconstructCSPosition(vec2(ssP) + vec2(0.5), P.z); + return P; +} + +/** Reconstructs screen-space unit normal from screen-space position */ +vec3 reconstructCSFaceNormal(vec3 C) { + return normalize(cross(dFdy(C), dFdx(C))); +} + + + +/** Returns a unit vector and a screen-space radius for the tap on a unit disk (the caller should scale by the actual disk radius) */ +vec2 tapLocation(int sampleNumber, float spinAngle, out float ssR){ + // Radius relative to ssR + float alpha = float(sampleNumber + 0.5) * (1.0 / NUM_SAMPLES); + float angle = alpha * (NUM_SPIRAL_TURNS * 6.28) + spinAngle; + + ssR = alpha; + return vec2(cos(angle), sin(angle)); +} + + +/** Read the camera-space position of the point at screen-space pixel ssP + unitOffset * ssR. Assumes length(unitOffset) == 1 */ +vec3 getOffsetPosition(ivec2 ssC, vec2 unitOffset, float ssR) { + // Derivation: + // mipLevel = floor(log(ssR / MAX_OFFSET)); + int mipLevel = clamp(int(floor(log2(ssR))) - LOG_MAX_OFFSET, 0, MAX_MIP_LEVEL); + + ivec2 ssP = ivec2(ssR * unitOffset) + ssC; + + vec3 P; + + // We need to divide by 2^mipLevel to read the appropriately scaled coordinate from a MIP-map. + // Manually clamp to the texture size because texelFetch bypasses the texture unit + ivec2 mipP = clamp(ssP >> mipLevel, ivec2(0), (screen_size >> mipLevel) - ivec2(1)); + + + if (mipLevel < 1) { + //read from depth buffer + P.z = texelFetch(source_depth, mipP, 0).r; + P.z = P.z * 2.0 - 1.0; + P.z = 2.0 * camera_z_near * camera_z_far / (camera_z_far + camera_z_near - P.z * (camera_z_far - camera_z_near)); + P.z = -P.z; + + } else { + //read from mipmaps + uint d = texelFetch(source_depth_mipmaps, mipP, mipLevel-1).r; + P.z = -(float(d)/65535.0)*camera_z_far; + } + + + // Offset to pixel center + P = reconstructCSPosition(vec2(ssP) + vec2(0.5), P.z); + + return P; +} + + + +/** Compute the occlusion due to sample with index \a i about the pixel at \a ssC that corresponds + to camera-space point \a C with unit normal \a n_C, using maximum screen-space sampling radius \a ssDiskRadius + + Note that units of H() in the HPG12 paper are meters, not + unitless. The whole falloff/sampling function is therefore + unitless. In this implementation, we factor out (9 / radius). + + Four versions of the falloff function are implemented below +*/ +float sampleAO(in ivec2 ssC, in vec3 C, in vec3 n_C, in float ssDiskRadius,in float p_radius, in int tapIndex, in float randomPatternRotationAngle) { + // Offset on the unit disk, spun for this pixel + float ssR; + vec2 unitOffset = tapLocation(tapIndex, randomPatternRotationAngle, ssR); + ssR *= ssDiskRadius; + + // The occluding point in camera space + vec3 Q = getOffsetPosition(ssC, unitOffset, ssR); + + vec3 v = Q - C; + + float vv = dot(v, v); + float vn = dot(v, n_C); + + const float epsilon = 0.01; + float radius2 = p_radius*p_radius; + + // A: From the HPG12 paper + // Note large epsilon to avoid overdarkening within cracks + //return float(vv < radius2) * max((vn - bias) / (epsilon + vv), 0.0) * radius2 * 0.6; + + // B: Smoother transition to zero (lowers contrast, smoothing out corners). [Recommended] + float f=max(radius2 - vv, 0.0); + return f * f * f * max((vn - bias) / (epsilon + vv), 0.0); + + // C: Medium contrast (which looks better at high radii), no division. Note that the + // contribution still falls off with radius^2, but we've adjusted the rate in a way that is + // more computationally efficient and happens to be aesthetically pleasing. + // return 4.0 * max(1.0 - vv * invRadius2, 0.0) * max(vn - bias, 0.0); + + // D: Low contrast, no division operation + // return 2.0 * float(vv < radius * radius) * max(vn - bias, 0.0); +} + + + +void main() { + + + // Pixel being shaded + ivec2 ssC = ivec2(gl_FragCoord.xy); + + // World space point being shaded + vec3 C = getPosition(ssC); + +/* if (C.z <= -camera_z_far*0.999) { + // We're on the skybox + visibility=1.0; + return; + }*/ + + //visibility=-C.z/camera_z_far; + //return; + + //vec3 n_C = texelFetch(source_normal,ssC,0).rgb * 2.0 - 1.0; + + vec3 n_C = reconstructCSFaceNormal(C); + n_C = -n_C; + + + // Hash function used in the HPG12 AlchemyAO paper + float randomPatternRotationAngle = (3 * ssC.x ^ ssC.y + ssC.x * ssC.y) * 10; + + // Reconstruct normals from positions. These will lead to 1-pixel black lines + // at depth discontinuities, however the blur will wipe those out so they are not visible + // in the final image. + + // Choose the screen-space sample radius + // proportional to the projected area of the sphere + float ssDiskRadius = -proj_scale * radius / C.z; + + float sum = 0.0; + for (int i = 0; i < NUM_SAMPLES; ++i) { + sum += sampleAO(ssC, C, n_C, ssDiskRadius, radius,i, randomPatternRotationAngle); + } + + float A = max(0.0, 1.0 - sum * intensity_div_r6 * (5.0 / NUM_SAMPLES)); + +#ifdef ENABLE_RADIUS2 + + //go again for radius2 + randomPatternRotationAngle = (5 * ssC.x ^ ssC.y + ssC.x * ssC.y) * 11; + + // Reconstruct normals from positions. These will lead to 1-pixel black lines + // at depth discontinuities, however the blur will wipe those out so they are not visible + // in the final image. + + // Choose the screen-space sample radius + // proportional to the projected area of the sphere + ssDiskRadius = -proj_scale * radius2 / C.z; + + sum = 0.0; + for (int i = 0; i < NUM_SAMPLES; ++i) { + sum += sampleAO(ssC, C, n_C, ssDiskRadius,radius2, i, randomPatternRotationAngle); + } + + A= min(A,max(0.0, 1.0 - sum * intensity_div_r62 * (5.0 / NUM_SAMPLES))); +#endif + // Bilateral box-filter over a quad for free, respecting depth edges + // (the difference that this makes is subtle) + if (abs(dFdx(C.z)) < 0.02) { + A -= dFdx(A) * ((ssC.x & 1) - 0.5); + } + if (abs(dFdy(C.z)) < 0.02) { + A -= dFdy(A) * ((ssC.y & 1) - 0.5); + } + + visibility = A; + +} + + + diff --git a/drivers/gles3/shaders/ssao_blur.glsl b/drivers/gles3/shaders/ssao_blur.glsl new file mode 100644 index 0000000000..31f3841a2a --- /dev/null +++ b/drivers/gles3/shaders/ssao_blur.glsl @@ -0,0 +1,113 @@ +[vertex] + + +layout(location=0) in highp vec4 vertex_attrib; + + +void main() { + + gl_Position = vertex_attrib; + gl_Position.z=1.0; +} + +[fragment] + + +uniform sampler2D source_ssao; //texunit:0 +uniform sampler2D source_depth; //texunit:1 + + +layout(location = 0) out float visibility; + + +////////////////////////////////////////////////////////////////////////////////////////////// +// Tunable Parameters: + +/** Increase to make depth edges crisper. Decrease to reduce flicker. */ +#define EDGE_SHARPNESS (1.0) + +/** Step in 2-pixel intervals since we already blurred against neighbors in the + first AO pass. This constant can be increased while R decreases to improve + performance at the expense of some dithering artifacts. + + Morgan found that a scale of 3 left a 1-pixel checkerboard grid that was + unobjectionable after shading was applied but eliminated most temporal incoherence + from using small numbers of sample taps. + */ +#define SCALE (3) + +/** Filter radius in pixels. This will be multiplied by SCALE. */ +#define R (4) + + +////////////////////////////////////////////////////////////////////////////////////////////// + + +// Gaussian coefficients +const float gaussian[R + 1] = +// float[](0.356642, 0.239400, 0.072410, 0.009869); +// float[](0.398943, 0.241971, 0.053991, 0.004432, 0.000134); // stddev = 1.0 + float[](0.153170, 0.144893, 0.122649, 0.092902, 0.062970); // stddev = 2.0 +// float[](0.111220, 0.107798, 0.098151, 0.083953, 0.067458, 0.050920, 0.036108); // stddev = 3.0 + +/** (1, 0) or (0, 1)*/ +uniform ivec2 axis; + +uniform float camera_z_far; +uniform float camera_z_near; + +void main() { + + ivec2 ssC = ivec2(gl_FragCoord.xy); + + float depth = texelFetch(source_depth, ssC, 0).r; + + depth = depth * 2.0 - 1.0; + depth = 2.0 * camera_z_near * camera_z_far / (camera_z_far + camera_z_near - depth * (camera_z_far - camera_z_near)); + + float depth_divide = 1.0 / camera_z_far; + + depth*=depth_divide; + + //if (depth > camera_z_far*0.999) { + // discard;//skybox + //} + + float sum = texelFetch(source_ssao, ssC, 0).r; + + // Base weight for depth falloff. Increase this for more blurriness, + // decrease it for better edge discrimination + float BASE = gaussian[0]; + float totalWeight = BASE; + sum *= totalWeight; + + + for (int r = -R; r <= R; ++r) { + // We already handled the zero case above. This loop should be unrolled and the static branch optimized out, + // so the IF statement has no runtime cost + if (r != 0) { + + ivec2 ppos = ssC + axis * (r * SCALE); + float value = texelFetch(source_ssao, ppos, 0).r; + float temp_depth = texelFetch(source_depth, ssC, 0).r; + + temp_depth = temp_depth * 2.0 - 1.0; + temp_depth = 2.0 * camera_z_near * camera_z_far / (camera_z_far + camera_z_near - temp_depth * (camera_z_far - camera_z_near)); + temp_depth *= depth_divide; + + // spatial domain: offset gaussian tap + float weight = 0.3 + gaussian[abs(r)]; + + // range domain (the "bilateral" weight). As depth difference increases, decrease weight. + weight *= max(0.0, 1.0 + - (EDGE_SHARPNESS * 2000.0) * abs(temp_depth - depth) + ); + + sum += value * weight; + totalWeight += weight; + } + } + + const float epsilon = 0.0001; + visibility = sum / (totalWeight + epsilon); +} diff --git a/drivers/gles3/shaders/ssao_minify.glsl b/drivers/gles3/shaders/ssao_minify.glsl new file mode 100644 index 0000000000..df9045c28a --- /dev/null +++ b/drivers/gles3/shaders/ssao_minify.glsl @@ -0,0 +1,55 @@ +[vertex] + + +layout(location=0) in highp vec4 vertex_attrib; + +void main() { + + gl_Position = vertex_attrib; +} + +[fragment] + + +#ifdef MINIFY_START + +#define SDEPTH_TYPE highp sampler2D +uniform float camera_z_far; +uniform float camera_z_near; + +#else + +#define SDEPTH_TYPE mediump usampler2D + +#endif + +uniform SDEPTH_TYPE source_depth; //texunit:0 + +uniform ivec2 from_size; +uniform int source_mipmap; + +layout(location = 0) out mediump uint depth; + +void main() { + + + ivec2 ssP = ivec2(gl_FragCoord.xy); + + // Rotated grid subsampling to avoid XY directional bias or Z precision bias while downsampling. + // On DX9, the bit-and can be implemented with floating-point modulo + +#ifdef MINIFY_START + float fdepth = texelFetch(source_depth, clamp(ssP * 2 + ivec2(ssP.y & 1, ssP.x & 1), ivec2(0), from_size - ivec2(1)), source_mipmap).r; + fdepth = fdepth * 2.0 - 1.0; + fdepth = 2.0 * camera_z_near * camera_z_far / (camera_z_far + camera_z_near - fdepth * (camera_z_far - camera_z_near)); + fdepth /= camera_z_far; + depth = uint(clamp(fdepth*65535,0.0,65535.0)); + +#else + depth = texelFetch(source_depth, clamp(ssP * 2 + ivec2(ssP.y & 1, ssP.x & 1), ivec2(0), from_size - ivec2(1)), source_mipmap).r; +#endif + + +} + + diff --git a/drivers/gles3/shaders/subsurf_scattering.glsl b/drivers/gles3/shaders/subsurf_scattering.glsl new file mode 100644 index 0000000000..eb329dbaed --- /dev/null +++ b/drivers/gles3/shaders/subsurf_scattering.glsl @@ -0,0 +1,172 @@ +[vertex] + + +layout(location=0) in highp vec4 vertex_attrib; +layout(location=4) in vec2 uv_in; + +out vec2 uv_interp; + + +void main() { + + uv_interp = uv_in; + gl_Position = vertex_attrib; +} + +[fragment] + +//#define QUALIFIER uniform // some guy on the interweb says it may be faster with this +#define QUALIFIER const + +#ifdef USE_25_SAMPLES + +const int kernel_size=25; +QUALIFIER vec4 kernel[25] = vec4[] ( + vec4(0.530605, 0.613514, 0.739601, 0.0), + vec4(0.000973794, 1.11862e-005, 9.43437e-007, -3.0), + vec4(0.00333804, 7.85443e-005, 1.2945e-005, -2.52083), + vec4(0.00500364, 0.00020094, 5.28848e-005, -2.08333), + vec4(0.00700976, 0.00049366, 0.000151938, -1.6875), + vec4(0.0094389, 0.00139119, 0.000416598, -1.33333), + vec4(0.0128496, 0.00356329, 0.00132016, -1.02083), + vec4(0.017924, 0.00711691, 0.00347194, -0.75), + vec4(0.0263642, 0.0119715, 0.00684598, -0.520833), + vec4(0.0410172, 0.0199899, 0.0118481, -0.333333), + vec4(0.0493588, 0.0367726, 0.0219485, -0.1875), + vec4(0.0402784, 0.0657244, 0.04631, -0.0833333), + vec4(0.0211412, 0.0459286, 0.0378196, -0.0208333), + vec4(0.0211412, 0.0459286, 0.0378196, 0.0208333), + vec4(0.0402784, 0.0657244, 0.04631, 0.0833333), + vec4(0.0493588, 0.0367726, 0.0219485, 0.1875), + vec4(0.0410172, 0.0199899, 0.0118481, 0.333333), + vec4(0.0263642, 0.0119715, 0.00684598, 0.520833), + vec4(0.017924, 0.00711691, 0.00347194, 0.75), + vec4(0.0128496, 0.00356329, 0.00132016, 1.02083), + vec4(0.0094389, 0.00139119, 0.000416598, 1.33333), + vec4(0.00700976, 0.00049366, 0.000151938, 1.6875), + vec4(0.00500364, 0.00020094, 5.28848e-005, 2.08333), + vec4(0.00333804, 7.85443e-005, 1.2945e-005, 2.52083), + vec4(0.000973794, 1.11862e-005, 9.43437e-007, 3.0) +); + +#endif //USE_25_SAMPLES + +#ifdef USE_17_SAMPLES + +const int kernel_size=17; + +QUALIFIER vec4 kernel[17] = vec4[]( + vec4(0.536343, 0.624624, 0.748867, 0.0), + vec4(0.00317394, 0.000134823, 3.77269e-005, -2.0), + vec4(0.0100386, 0.000914679, 0.000275702, -1.53125), + vec4(0.0144609, 0.00317269, 0.00106399, -1.125), + vec4(0.0216301, 0.00794618, 0.00376991, -0.78125), + vec4(0.0347317, 0.0151085, 0.00871983, -0.5), + vec4(0.0571056, 0.0287432, 0.0172844, -0.28125), + vec4(0.0582416, 0.0659959, 0.0411329, -0.125), + vec4(0.0324462, 0.0656718, 0.0532821, -0.03125), + vec4(0.0324462, 0.0656718, 0.0532821, 0.03125), + vec4(0.0582416, 0.0659959, 0.0411329, 0.125), + vec4(0.0571056, 0.0287432, 0.0172844, 0.28125), + vec4(0.0347317, 0.0151085, 0.00871983, 0.5), + vec4(0.0216301, 0.00794618, 0.00376991, 0.78125), + vec4(0.0144609, 0.00317269, 0.00106399, 1.125), + vec4(0.0100386, 0.000914679, 0.000275702, 1.53125), + vec4(0.00317394, 0.000134823, 3.77269e-005, 2.0) +); + +#endif //USE_17_SAMPLES + + +#ifdef USE_11_SAMPLES + +const int kernel_size=11; + +QUALIFIER vec4 kernel[11] = vec4[]( + vec4(0.560479, 0.669086, 0.784728, 0.0), + vec4(0.00471691, 0.000184771, 5.07566e-005, -2.0), + vec4(0.0192831, 0.00282018, 0.00084214, -1.28), + vec4(0.03639, 0.0130999, 0.00643685, -0.72), + vec4(0.0821904, 0.0358608, 0.0209261, -0.32), + vec4(0.0771802, 0.113491, 0.0793803, -0.08), + vec4(0.0771802, 0.113491, 0.0793803, 0.08), + vec4(0.0821904, 0.0358608, 0.0209261, 0.32), + vec4(0.03639, 0.0130999, 0.00643685, 0.72), + vec4(0.0192831, 0.00282018, 0.00084214, 1.28), + vec4(0.00471691, 0.000184771, 5.07565e-005, 2.0) +); + +#endif //USE_11_SAMPLES + + +uniform float max_radius; +uniform float fovy; +uniform float camera_z_far; +uniform float camera_z_near; +uniform vec2 dir; +in vec2 uv_interp; + +uniform sampler2D source_diffuse; //texunit:0 +uniform sampler2D source_motion_ss; //texunit:1 +uniform sampler2D source_depth; //texunit:2 + +layout(location = 0) out vec4 frag_color; + +void main() { + + float strength = texture(source_motion_ss,uv_interp).a; + strength*=strength; //stored as sqrt + + // Fetch color of current pixel: + vec4 base_color = texture(source_diffuse, uv_interp); + + if (strength>0.0) { + + + // Fetch linear depth of current pixel: + float depth = texture(source_depth, uv_interp).r * 2.0 - 1.0; + depth = 2.0 * camera_z_near * camera_z_far / (camera_z_far + camera_z_near - depth * (camera_z_far - camera_z_near)); + depth=-depth; + + + // Calculate the radius scale (1.0 for a unit plane sitting on the + // projection window): + float distance = 1.0 / tan(0.5 * fovy); + float scale = distance / -depth; //remember depth is negative by default in OpenGL + + // Calculate the final step to fetch the surrounding pixels: + vec2 step = max_radius * scale * dir; + step *= strength; // Modulate it using the alpha channel. + step *= 1.0 / 3.0; // Divide by 3 as the kernels range from -3 to 3. + + // Accumulate the center sample: + vec3 color_accum = base_color.rgb; + color_accum *= kernel[0].rgb; + + // Accumulate the other samples: + for (int i = 1; i < kernel_size; i++) { + // Fetch color and depth for current sample: + vec2 offset = uv_interp + kernel[i].a * step; + vec3 color = texture(source_diffuse, offset).rgb; + +#ifdef ENABLE_FOLLOW_SURFACE + // If the difference in depth is huge, we lerp color back to "colorM": + float depth_cmp = texture(source_depth, offset).r *2.0 - 1.0; + depth_cmp = 2.0 * camera_z_near * camera_z_far / (camera_z_far + camera_z_near - depth_cmp * (camera_z_far - camera_z_near)); + depth_cmp=-depth_cmp; + + float s = clamp(300.0f * distance * + max_radius * abs(depth - depth_cmp),0.0,1.0); + color = mix(color, base_color.rgb, s); +#endif + + // Accumulate: + color_accum += kernel[i].rgb * color; + } + + frag_color = vec4(color_accum,base_color.a); //keep alpha (used for SSAO) + } else { + frag_color = base_color; + } +} + diff --git a/drivers/gles3/shaders/tonemap.glsl b/drivers/gles3/shaders/tonemap.glsl new file mode 100644 index 0000000000..8f7e0c7be3 --- /dev/null +++ b/drivers/gles3/shaders/tonemap.glsl @@ -0,0 +1,263 @@ +[vertex] + + +layout(location=0) in highp vec4 vertex_attrib; +layout(location=4) in vec2 uv_in; + +out vec2 uv_interp; + + + +void main() { + + gl_Position = vertex_attrib; + uv_interp = uv_in; + +} + +[fragment] + + +in vec2 uv_interp; + +uniform highp sampler2D source; //texunit:0 + +uniform float exposure; +uniform float white; + +#ifdef USE_AUTO_EXPOSURE + +uniform highp sampler2D source_auto_exposure; //texunit:1 +uniform highp float auto_exposure_grey; + +#endif + +#if defined(USE_GLOW_LEVEL1) || defined(USE_GLOW_LEVEL2) || defined(USE_GLOW_LEVEL3) || defined(USE_GLOW_LEVEL4) || defined(USE_GLOW_LEVEL5) || defined(USE_GLOW_LEVEL6) || defined(USE_GLOW_LEVEL7) + +uniform highp sampler2D source_glow; //texunit:2 +uniform highp float glow_intensity; + +#endif + +layout(location = 0) out vec4 frag_color; + +#ifdef USE_GLOW_FILTER_BICUBIC + +// w0, w1, w2, and w3 are the four cubic B-spline basis functions +float w0(float a) +{ + return (1.0/6.0)*(a*(a*(-a + 3.0) - 3.0) + 1.0); +} + +float w1(float a) +{ + return (1.0/6.0)*(a*a*(3.0*a - 6.0) + 4.0); +} + +float w2(float a) +{ + return (1.0/6.0)*(a*(a*(-3.0*a + 3.0) + 3.0) + 1.0); +} + +float w3(float a) +{ + return (1.0/6.0)*(a*a*a); +} + +// g0 and g1 are the two amplitude functions +float g0(float a) +{ + return w0(a) + w1(a); +} + +float g1(float a) +{ + return w2(a) + w3(a); +} + +// h0 and h1 are the two offset functions +float h0(float a) +{ + return -1.0 + w1(a) / (w0(a) + w1(a)); +} + +float h1(float a) +{ + return 1.0 + w3(a) / (w2(a) + w3(a)); +} + +uniform ivec2 glow_texture_size; + +vec4 texture2D_bicubic(sampler2D tex, vec2 uv,int p_lod) +{ + float lod=float(p_lod); + vec2 tex_size = vec2(glow_texture_size >> p_lod); + vec2 pixel_size =1.0/tex_size; + uv = uv*tex_size + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + + float g0x = g0(fuv.x); + float g1x = g1(fuv.x); + float h0x = h0(fuv.x); + float h1x = h1(fuv.x); + float h0y = h0(fuv.y); + float h1y = h1(fuv.y); + + vec2 p0 = (vec2(iuv.x + h0x, iuv.y + h0y) - 0.5) * pixel_size; + vec2 p1 = (vec2(iuv.x + h1x, iuv.y + h0y) - 0.5) * pixel_size; + vec2 p2 = (vec2(iuv.x + h0x, iuv.y + h1y) - 0.5) * pixel_size; + vec2 p3 = (vec2(iuv.x + h1x, iuv.y + h1y) - 0.5) * pixel_size; + + return g0(fuv.y) * (g0x * textureLod(tex, p0,lod) + + g1x * textureLod(tex, p1,lod)) + + g1(fuv.y) * (g0x * textureLod(tex, p2,lod) + + g1x * textureLod(tex, p3,lod)); +} + + + +#define GLOW_TEXTURE_SAMPLE(m_tex,m_uv,m_lod) texture2D_bicubic(m_tex,m_uv,m_lod) + +#else + +#define GLOW_TEXTURE_SAMPLE(m_tex,m_uv,m_lod) textureLod(m_tex,m_uv,float(m_lod)) + +#endif + + +void main() { + + ivec2 coord = ivec2(gl_FragCoord.xy); + vec3 color = texelFetch(source,coord,0).rgb; + + +#ifdef USE_AUTO_EXPOSURE + + color/=texelFetch(source_auto_exposure,ivec2(0,0),0).r/auto_exposure_grey; +#endif + + color*=exposure; + + +#if defined(USE_GLOW_LEVEL1) || defined(USE_GLOW_LEVEL2) || defined(USE_GLOW_LEVEL3) || defined(USE_GLOW_LEVEL4) || defined(USE_GLOW_LEVEL5) || defined(USE_GLOW_LEVEL6) || defined(USE_GLOW_LEVEL7) + vec3 glow = vec3(0.0); + +#ifdef USE_GLOW_LEVEL1 + + glow+=GLOW_TEXTURE_SAMPLE(source_glow,uv_interp,1).rgb; +#endif + +#ifdef USE_GLOW_LEVEL2 + glow+=GLOW_TEXTURE_SAMPLE(source_glow,uv_interp,2).rgb; +#endif + +#ifdef USE_GLOW_LEVEL3 + glow+=GLOW_TEXTURE_SAMPLE(source_glow,uv_interp,3).rgb; +#endif + +#ifdef USE_GLOW_LEVEL4 + glow+=GLOW_TEXTURE_SAMPLE(source_glow,uv_interp,4).rgb; +#endif + +#ifdef USE_GLOW_LEVEL5 + glow+=GLOW_TEXTURE_SAMPLE(source_glow,uv_interp,5).rgb; +#endif + +#ifdef USE_GLOW_LEVEL6 + glow+=GLOW_TEXTURE_SAMPLE(source_glow,uv_interp,6).rgb; +#endif + +#ifdef USE_GLOW_LEVEL7 + glow+=GLOW_TEXTURE_SAMPLE(source_glow,uv_interp,7).rgb; +#endif + + + glow *= glow_intensity; + + + +#ifdef USE_GLOW_REPLACE + + color.rgb = glow; + +#endif + +#ifdef USE_GLOW_SCREEN + + color.rgb = clamp((color.rgb + glow) - (color.rgb * glow), 0.0, 1.0); + +#endif + +#ifdef USE_GLOW_SOFTLIGHT + + { + + glow = (glow * 0.5) + 0.5; + color.r = (glow.r <= 0.5) ? (color.r - (1.0 - 2.0 * glow.r) * color.r * (1.0 - color.r)) : (((glow.r > 0.5) && (color.r <= 0.25)) ? (color.r + (2.0 * glow.r - 1.0) * (4.0 * color.r * (4.0 * color.r + 1.0) * (color.r - 1.0) + 7.0 * color.r)) : (color.r + (2.0 * glow.r - 1.0) * (sqrt(color.r) - color.r))); + color.g = (glow.g <= 0.5) ? (color.g - (1.0 - 2.0 * glow.g) * color.g * (1.0 - color.g)) : (((glow.g > 0.5) && (color.g <= 0.25)) ? (color.g + (2.0 * glow.g - 1.0) * (4.0 * color.g * (4.0 * color.g + 1.0) * (color.g - 1.0) + 7.0 * color.g)) : (color.g + (2.0 * glow.g - 1.0) * (sqrt(color.g) - color.g))); + color.b = (glow.b <= 0.5) ? (color.b - (1.0 - 2.0 * glow.b) * color.b * (1.0 - color.b)) : (((glow.b > 0.5) && (color.b <= 0.25)) ? (color.b + (2.0 * glow.b - 1.0) * (4.0 * color.b * (4.0 * color.b + 1.0) * (color.b - 1.0) + 7.0 * color.b)) : (color.b + (2.0 * glow.b - 1.0) * (sqrt(color.b) - color.b))); + } + +#endif + +#if !defined(USE_GLOW_SCREEN) && !defined(USE_GLOW_SOFTLIGHT) && !defined(USE_GLOW_REPLACE) + color.rgb+=glow; +#endif + + +#endif + + +#ifdef USE_REINDHART_TONEMAPPER + + { + color.rgb = ( color.rgb * ( 1.0 + ( color.rgb / ( white) ) ) ) / ( 1.0 + color.rgb ); + + } +#endif + +#ifdef USE_FILMIC_TONEMAPPER + + { + + float A = 0.15; + float B = 0.50; + float C = 0.10; + float D = 0.20; + float E = 0.02; + float F = 0.30; + float W = 11.2; + + vec3 coltn = ((color.rgb*(A*color.rgb+C*B)+D*E)/(color.rgb*(A*color.rgb+B)+D*F))-E/F; + float whitetn = ((white*(A*white+C*B)+D*E)/(white*(A*white+B)+D*F))-E/F; + + color.rgb=coltn/whitetn; + + } +#endif + +#ifdef USE_ACES_TONEMAPPER + + { + float a = 2.51f; + float b = 0.03f; + float c = 2.43f; + float d = 0.59f; + float e = 0.14f; + color.rgb = clamp((color.rgb*(a*color.rgb+b))/(color.rgb*(c*color.rgb+d)+e),vec3(0.0),vec3(1.0)); + } + +#endif + + //regular Linear -> SRGB conversion + vec3 a = vec3(0.055); + color.rgb = mix( (vec3(1.0)+a)*pow(color.rgb,vec3(1.0/2.4))-a , 12.92*color.rgb , lessThan(color.rgb,vec3(0.0031308))); + + + + + frag_color=vec4(color.rgb,1.0); +} + + diff --git a/drivers/png/image_loader_png.cpp b/drivers/png/image_loader_png.cpp index ab3f3e78fc..de095c20ac 100644 --- a/drivers/png/image_loader_png.cpp +++ b/drivers/png/image_loader_png.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -114,25 +114,36 @@ Error ImageLoaderPNG::_load_image(void *rf_up,png_rw_ptr p_func,Image *p_image) printf("Color type:%i\n", color); */ + bool update_info=false; + if (depth<8) { //only bit dept 8 per channel is handled png_set_packing(png); + update_info=true; + }; + if (png_get_color_type(png,info)==PNG_COLOR_TYPE_PALETTE) { + png_set_palette_to_rgb(png); + update_info=true; + } + if (depth > 8) { png_set_strip_16(png); - png_read_update_info(png, info); + update_info=true; } if (png_get_valid(png,info,PNG_INFO_tRNS)) { // png_set_expand_gray_1_2_4_to_8(png); png_set_tRNS_to_alpha(png); + update_info=true; + } + + if (update_info) { png_read_update_info(png, info); png_get_IHDR(png, info, &width, &height, &depth, &color, NULL, NULL, NULL); } - int palette_colors = 0; - int palette_components = 0; int components = 0; Image::Format fmt; @@ -141,38 +152,24 @@ Error ImageLoaderPNG::_load_image(void *rf_up,png_rw_ptr p_func,Image *p_image) case PNG_COLOR_TYPE_GRAY: { - fmt=Image::FORMAT_GRAYSCALE; + fmt=Image::FORMAT_L8; components=1; } break; case PNG_COLOR_TYPE_GRAY_ALPHA: { - fmt=Image::FORMAT_GRAYSCALE_ALPHA; + fmt=Image::FORMAT_LA8; components=2; } break; case PNG_COLOR_TYPE_RGB: { - fmt=Image::FORMAT_RGB; + fmt=Image::FORMAT_RGB8; components=3; } break; case PNG_COLOR_TYPE_RGB_ALPHA: { - fmt=Image::FORMAT_RGBA; + fmt=Image::FORMAT_RGBA8; components=4; - } break; - case PNG_COLOR_TYPE_PALETTE: { - - int ntrans = 0; - png_get_tRNS(png, info, NULL, &ntrans, NULL); - //printf("transparent colors %i\n", ntrans); - - fmt = ntrans > 0 ? Image::FORMAT_INDEXED_ALPHA : Image::FORMAT_INDEXED; - palette_components = ntrans > 0 ? 4 : 3; - components = 1; - - png_colorp colors; - png_get_PLTE(png, info, &colors, &palette_colors); - - } break; + } break; default: { ERR_PRINT("INVALID PNG TYPE"); @@ -184,11 +181,11 @@ Error ImageLoaderPNG::_load_image(void *rf_up,png_rw_ptr p_func,Image *p_image) //int rowsize = png_get_rowbytes(png, info); int rowsize = components * width; - DVector<uint8_t> dstbuff; + PoolVector<uint8_t> dstbuff; - dstbuff.resize( rowsize * height + palette_components * 256 ); // alloc the entire palette? - yes always + dstbuff.resize( rowsize * height ); - DVector<uint8_t>::Write dstbuff_write = dstbuff.write(); + PoolVector<uint8_t>::Write dstbuff_write = dstbuff.write(); uint8_t* data = dstbuff_write.ptr(); @@ -200,38 +197,6 @@ Error ImageLoaderPNG::_load_image(void *rf_up,png_rw_ptr p_func,Image *p_image) png_read_image(png, (png_bytep*)row_p); - if (palette_colors) { - - uint8_t *r_pal = &data[components*width*height]; // end of the array - png_colorp colors; - int num; - png_get_PLTE(png, info, &colors, &num); - - int ofs = 0; - for (int i=0; i < palette_colors; i++) { - - r_pal[ofs + 0] = colors[i].red; - r_pal[ofs + 1] = colors[i].green; - r_pal[ofs + 2] = colors[i].blue; - if (palette_components == 4) { - r_pal[ofs + 3] = 255; - }; - ofs += palette_components; - }; - - if (fmt == Image::FORMAT_INDEXED_ALPHA) { - png_color_16p alphas; - png_bytep alpha_idx; - int count; - png_get_tRNS(png, info, &alpha_idx, &count, &alphas); - for (int i=0; i<count; i++) { - - //printf("%i: loading alpha fron transparent color %i, values %i, %i, %i, %i, %i\n", i, (int)alpha_idx[i], (int)alphas[i].index, (int)alphas[i].red, (int)alphas[i].green, (int)alphas[i].blue, (int)alphas[i].gray); - //r_pal[alpha_idx[i]] = alphas[i].gray >> 8; - r_pal[i*4+3] = alpha_idx[i]; - }; - }; - }; memdelete_arr( row_p ); @@ -300,10 +265,10 @@ static Image _load_mem_png(const uint8_t* p_png,int p_size) { } -static Image _lossless_unpack_png(const DVector<uint8_t>& p_data) { +static Image _lossless_unpack_png(const PoolVector<uint8_t>& p_data) { int len = p_data.size(); - DVector<uint8_t>::Read r = p_data.read(); + PoolVector<uint8_t>::Read r = p_data.read(); ERR_FAIL_COND_V(r[0]!='P' || r[1]!='N' || r[2]!='G' || r[3]!=' ',Image()); return _load_mem_png(&r[4],len-4); @@ -311,25 +276,25 @@ static Image _lossless_unpack_png(const DVector<uint8_t>& p_data) { static void _write_png_data(png_structp png_ptr,png_bytep data, png_size_t p_length) { - DVector<uint8_t> &v = *(DVector<uint8_t>*)png_get_io_ptr(png_ptr); + PoolVector<uint8_t> &v = *(PoolVector<uint8_t>*)png_get_io_ptr(png_ptr); int vs = v.size(); v.resize(vs+p_length); - DVector<uint8_t>::Write w = v.write(); + PoolVector<uint8_t>::Write w = v.write(); copymem(&w[vs],data,p_length); //print_line("png write: "+itos(p_length)); } -static DVector<uint8_t> _lossless_pack_png(const Image& p_image) { +static PoolVector<uint8_t> _lossless_pack_png(const Image& p_image) { Image img = p_image; - if (img.get_format() > Image::FORMAT_INDEXED_ALPHA) + if (img.is_compressed()) img.decompress(); - ERR_FAIL_COND_V(img.get_format() > Image::FORMAT_INDEXED_ALPHA, DVector<uint8_t>()); + ERR_FAIL_COND_V(img.is_compressed(), PoolVector<uint8_t>()); png_structp png_ptr; png_infop info_ptr; @@ -339,16 +304,16 @@ static DVector<uint8_t> _lossless_pack_png(const Image& p_image) { /* initialize stuff */ png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); - ERR_FAIL_COND_V(!png_ptr,DVector<uint8_t>()); + ERR_FAIL_COND_V(!png_ptr,PoolVector<uint8_t>()); info_ptr = png_create_info_struct(png_ptr); - ERR_FAIL_COND_V(!info_ptr,DVector<uint8_t>()); + ERR_FAIL_COND_V(!info_ptr,PoolVector<uint8_t>()); if (setjmp(png_jmpbuf(png_ptr))) { - ERR_FAIL_V(DVector<uint8_t>()); + ERR_FAIL_V(PoolVector<uint8_t>()); } - DVector<uint8_t> ret; + PoolVector<uint8_t> ret; ret.push_back('P'); ret.push_back('N'); ret.push_back('G'); @@ -358,7 +323,7 @@ static DVector<uint8_t> _lossless_pack_png(const Image& p_image) { /* write header */ if (setjmp(png_jmpbuf(png_ptr))) { - ERR_FAIL_V(DVector<uint8_t>()); + ERR_FAIL_V(PoolVector<uint8_t>()); } int pngf=0; @@ -366,22 +331,22 @@ static DVector<uint8_t> _lossless_pack_png(const Image& p_image) { switch(img.get_format()) { - case Image::FORMAT_GRAYSCALE: { + case Image::FORMAT_L8: { pngf=PNG_COLOR_TYPE_GRAY; cs=1; } break; - case Image::FORMAT_GRAYSCALE_ALPHA: { + case Image::FORMAT_LA8: { pngf=PNG_COLOR_TYPE_GRAY_ALPHA; cs=2; } break; - case Image::FORMAT_RGB: { + case Image::FORMAT_RGB8: { pngf=PNG_COLOR_TYPE_RGB; cs=3; } break; - case Image::FORMAT_RGBA: { + case Image::FORMAT_RGBA8: { pngf=PNG_COLOR_TYPE_RGB_ALPHA; cs=4; @@ -390,12 +355,12 @@ static DVector<uint8_t> _lossless_pack_png(const Image& p_image) { if (img.detect_alpha()) { - img.convert(Image::FORMAT_RGBA); + img.convert(Image::FORMAT_RGBA8); pngf=PNG_COLOR_TYPE_RGB_ALPHA; cs=4; } else { - img.convert(Image::FORMAT_RGB); + img.convert(Image::FORMAT_RGB8); pngf=PNG_COLOR_TYPE_RGB; cs=3; } @@ -414,11 +379,11 @@ static DVector<uint8_t> _lossless_pack_png(const Image& p_image) { /* write bytes */ if (setjmp(png_jmpbuf(png_ptr))) { - ERR_FAIL_V(DVector<uint8_t>()); + ERR_FAIL_V(PoolVector<uint8_t>()); } - DVector<uint8_t>::Read r = img.get_data().read(); + PoolVector<uint8_t>::Read r = img.get_data().read(); row_pointers = (png_bytep*)memalloc(sizeof(png_bytep)*h); for(int i=0;i<h;i++) { @@ -432,7 +397,7 @@ static DVector<uint8_t> _lossless_pack_png(const Image& p_image) { /* end write */ if (setjmp(png_jmpbuf(png_ptr))) { - ERR_FAIL_V(DVector<uint8_t>()); + ERR_FAIL_V(PoolVector<uint8_t>()); } png_write_end(png_ptr, NULL); diff --git a/drivers/png/image_loader_png.h b/drivers/png/image_loader_png.h index c146e3f5a1..a98ad513db 100644 --- a/drivers/png/image_loader_png.h +++ b/drivers/png/image_loader_png.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/png/resource_saver_png.cpp b/drivers/png/resource_saver_png.cpp index e7987f27bf..a9a199bb59 100644 --- a/drivers/png/resource_saver_png.cpp +++ b/drivers/png/resource_saver_png.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -56,9 +56,9 @@ Error ResourceSaverPNG::save(const String &p_path,const RES& p_resource,uint32_t if (err == OK) { - bool global_filter = Globals::get_singleton()->get("image_loader/filter"); - bool global_mipmaps = Globals::get_singleton()->get("image_loader/gen_mipmaps"); - bool global_repeat = Globals::get_singleton()->get("image_loader/repeat"); + bool global_filter = GlobalConfig::get_singleton()->get("image_loader/filter"); + bool global_mipmaps = GlobalConfig::get_singleton()->get("image_loader/gen_mipmaps"); + bool global_repeat = GlobalConfig::get_singleton()->get("image_loader/repeat"); String text; @@ -98,10 +98,10 @@ Error ResourceSaverPNG::save(const String &p_path,const RES& p_resource,uint32_t Error ResourceSaverPNG::save_image(const String &p_path, Image &p_img) { - if (p_img.get_format() > Image::FORMAT_INDEXED_ALPHA) + if (p_img.is_compressed()) p_img.decompress(); - ERR_FAIL_COND_V(p_img.get_format() > Image::FORMAT_INDEXED_ALPHA, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V(p_img.is_compressed(), ERR_INVALID_PARAMETER); png_structp png_ptr; png_infop info_ptr; @@ -140,22 +140,22 @@ Error ResourceSaverPNG::save_image(const String &p_path, Image &p_img) { switch(p_img.get_format()) { - case Image::FORMAT_GRAYSCALE: { + case Image::FORMAT_L8: { pngf=PNG_COLOR_TYPE_GRAY; cs=1; } break; - case Image::FORMAT_GRAYSCALE_ALPHA: { + case Image::FORMAT_LA8: { pngf=PNG_COLOR_TYPE_GRAY_ALPHA; cs=2; } break; - case Image::FORMAT_RGB: { + case Image::FORMAT_RGB8: { pngf=PNG_COLOR_TYPE_RGB; cs=3; } break; - case Image::FORMAT_RGBA: { + case Image::FORMAT_RGBA8: { pngf=PNG_COLOR_TYPE_RGB_ALPHA; cs=4; @@ -164,12 +164,12 @@ Error ResourceSaverPNG::save_image(const String &p_path, Image &p_img) { if (p_img.detect_alpha()) { - p_img.convert(Image::FORMAT_RGBA); + p_img.convert(Image::FORMAT_RGBA8); pngf=PNG_COLOR_TYPE_RGB_ALPHA; cs=4; } else { - p_img.convert(Image::FORMAT_RGB); + p_img.convert(Image::FORMAT_RGB8); pngf=PNG_COLOR_TYPE_RGB; cs=3; } @@ -193,7 +193,7 @@ Error ResourceSaverPNG::save_image(const String &p_path, Image &p_img) { } - DVector<uint8_t>::Read r = p_img.get_data().read(); + PoolVector<uint8_t>::Read r = p_img.get_data().read(); row_pointers = (png_bytep*)memalloc(sizeof(png_bytep)*h); for(int i=0;i<h;i++) { @@ -222,7 +222,7 @@ Error ResourceSaverPNG::save_image(const String &p_path, Image &p_img) { bool ResourceSaverPNG::recognize(const RES& p_resource) const { - return (p_resource.is_valid() && p_resource->is_type("ImageTexture")); + return (p_resource.is_valid() && p_resource->is_class("ImageTexture")); } void ResourceSaverPNG::get_recognized_extensions(const RES& p_resource,List<String> *p_extensions) const{ diff --git a/drivers/png/resource_saver_png.h b/drivers/png/resource_saver_png.h index d2e0753b40..c71877d728 100644 --- a/drivers/png/resource_saver_png.h +++ b/drivers/png/resource_saver_png.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp index 954d2c20f2..3a1317cbf6 100644 --- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp +++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,48 +36,56 @@ Error AudioDriverPulseAudio::init() { - active = false; - thread_exited = false; - exit_thread = false; + active = false; + thread_exited = false; + exit_thread = false; pcm_open = false; samples_in = NULL; samples_out = NULL; - mix_rate = 44100; + mix_rate = GLOBAL_DEF("audio/mix_rate",44100); output_format = OUTPUT_STEREO; channels = 2; - pa_sample_spec spec; - spec.format = PA_SAMPLE_S16LE; - spec.channels = channels; - spec.rate = mix_rate; - - int error_code; - pulse = pa_simple_new(NULL, // default server - "Godot", // application name - PA_STREAM_PLAYBACK, - NULL, // default device - "Sound", // stream description - &spec, - NULL, // use default channel map - NULL, // use default buffering attributes - &error_code - ); - - if (pulse == NULL) { - - fprintf(stderr, "PulseAudio ERR: %s\n", pa_strerror(error_code));\ - ERR_FAIL_COND_V(pulse == NULL, ERR_CANT_OPEN); - } + pa_sample_spec spec; + spec.format = PA_SAMPLE_S16LE; + spec.channels = channels; + spec.rate = mix_rate; + + int latency = GLOBAL_DEF("audio/output_latency", 25); + buffer_size = nearest_power_of_2(latency * mix_rate / 1000); + + pa_buffer_attr attr; + // set to appropriate buffer size from global settings + attr.tlength = buffer_size; + // set them to be automatically chosen + attr.prebuf = (uint32_t)-1; + attr.maxlength = (uint32_t)-1; + attr.minreq = (uint32_t)-1; + + int error_code; + pulse = pa_simple_new( NULL, // default server + "Godot", // application name + PA_STREAM_PLAYBACK, + NULL, // default device + "Sound", // stream description + &spec, + NULL, // use default channel map + &attr, // use buffering attributes from above + &error_code + ); + + if (pulse == NULL) { + fprintf(stderr, "PulseAudio ERR: %s\n", pa_strerror(error_code));\ + ERR_FAIL_COND_V(pulse == NULL, ERR_CANT_OPEN); + } - int latency = GLOBAL_DEF("audio/output_latency", 25); - buffer_size = nearest_power_of_2(latency * mix_rate / 1000); - samples_in = memnew_arr(int32_t, buffer_size * channels); - samples_out = memnew_arr(int16_t, buffer_size * channels); + samples_in = memnew_arr(int32_t, buffer_size * channels); + samples_out = memnew_arr(int16_t, buffer_size * channels); - mutex = Mutex::create(); - thread = Thread::create(AudioDriverPulseAudio::thread_func, this); + mutex = Mutex::create(); + thread = Thread::create(AudioDriverPulseAudio::thread_func, this); return OK; } @@ -95,47 +103,40 @@ float AudioDriverPulseAudio::get_latency() { void AudioDriverPulseAudio::thread_func(void* p_udata) { - AudioDriverPulseAudio* ad = (AudioDriverPulseAudio*)p_udata; + AudioDriverPulseAudio* ad = (AudioDriverPulseAudio*)p_udata; while (!ad->exit_thread) { - if (!ad->active) { - - for (unsigned int i=0; i < ad->buffer_size * ad->channels; i++) { - + for (unsigned int i=0; i < ad->buffer_size * ad->channels; i++) { ad->samples_out[i] = 0; - } + } } else { - ad->lock(); ad->audio_server_process(ad->buffer_size, ad->samples_in); ad->unlock(); - for (unsigned int i=0; i < ad->buffer_size * ad->channels;i ++) { - - ad->samples_out[i] = ad->samples_in[i] >> 16; + for (unsigned int i=0; i < ad->buffer_size * ad->channels;i ++) { + ad->samples_out[i] = ad->samples_in[i] >> 16; } - } - - // pa_simple_write always consumes the entire buffer - - int error_code; - int byte_size = ad->buffer_size * sizeof(int16_t) * ad->channels; - if (pa_simple_write(ad->pulse, ad->samples_out, byte_size, &error_code) < 0) { + } - // can't recover here - fprintf(stderr, "PulseAudio failed and can't recover: %s\n", pa_strerror(error_code)); - ad->active = false; - ad->exit_thread = true; - break; - } + // pa_simple_write always consumes the entire buffer - } - - ad->thread_exited = true; + int error_code; + int byte_size = ad->buffer_size * sizeof(int16_t) * ad->channels; + if (pa_simple_write(ad->pulse, ad->samples_out, byte_size, &error_code) < 0) { + // can't recover here + fprintf(stderr, "PulseAudio failed and can't recover: %s\n", pa_strerror(error_code)); + ad->active = false; + ad->exit_thread = true; + break; + } + } + + ad->thread_exited = true; } void AudioDriverPulseAudio::start() { @@ -184,10 +185,10 @@ void AudioDriverPulseAudio::finish() { }; memdelete(thread); - if (mutex) { + if (mutex) { memdelete(mutex); - mutex = NULL; - } + mutex = NULL; + } thread = NULL; } @@ -195,9 +196,9 @@ void AudioDriverPulseAudio::finish() { AudioDriverPulseAudio::AudioDriverPulseAudio() { mutex = NULL; - thread = NULL; - pulse = NULL; - latency=0; + thread = NULL; + pulse = NULL; + latency=0; } AudioDriverPulseAudio::~AudioDriverPulseAudio() { diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.h b/drivers/pulseaudio/audio_driver_pulseaudio.h index 8a2fbfd38b..aa7b7a9188 100644 --- a/drivers/pulseaudio/audio_driver_pulseaudio.h +++ b/drivers/pulseaudio/audio_driver_pulseaudio.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/register_driver_types.cpp b/drivers/register_driver_types.cpp index e0f35e81c4..d1d5f42944 100644 --- a/drivers/register_driver_types.cpp +++ b/drivers/register_driver_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/register_driver_types.h b/drivers/register_driver_types.h index 0d9ffff2c9..9a79d79ab8 100644 --- a/drivers/register_driver_types.h +++ b/drivers/register_driver_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/rtaudio/audio_driver_rtaudio.cpp b/drivers/rtaudio/audio_driver_rtaudio.cpp index fbe7ac68d4..a798990449 100644 --- a/drivers/rtaudio/audio_driver_rtaudio.cpp +++ b/drivers/rtaudio/audio_driver_rtaudio.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -47,9 +47,7 @@ const char* AudioDriverRtAudio::get_name() const { } -// Two-channel sawtooth wave generator. -int AudioDriverRtAudio::callback( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, - double streamTime, RtAudioStreamStatus status, void *userData ) { +int AudioDriverRtAudio::callback( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, double streamTime, RtAudioStreamStatus status, void *userData ) { if (status) { if (status & RTAUDIO_INPUT_OVERFLOW) { @@ -64,8 +62,6 @@ int AudioDriverRtAudio::callback( void *outputBuffer, void *inputBuffer, unsigne AudioDriverRtAudio *self = (AudioDriverRtAudio*)userData; if (self->mutex->try_lock()!=OK) { - - // what should i do.. for(unsigned int i=0;i<nBufferFrames;i++) buffer[i]=0; @@ -100,61 +96,89 @@ Error AudioDriverRtAudio::init() { else output_format=OUTPUT_STEREO; - RtAudio::StreamParameters parameters; parameters.deviceId = dac->getDefaultOutputDevice(); RtAudio::StreamOptions options; + + // set the desired numberOfBuffers + unsigned int target_number_of_buffers = 4; + options.numberOfBuffers = target_number_of_buffers; + // options. // RtAudioStreamFlags flags; /*!< A bit-mask of stream flags (RTAUDIO_NONINTERLEAVED, RTAUDIO_MINIMIZE_LATENCY, RTAUDIO_HOG_DEVICE). */// // unsigned int numberOfBuffers; /*!< Number of stream buffers. */ // std::string streamName; /*!< A stream name (currently used only in Jack). */ // int priority; /*!< Scheduling priority of callback thread (only used with flag RTAUDIO_SCHEDULE_REALTIME). */ - parameters.firstChannel = 0; mix_rate = GLOBAL_DEF("audio/mix_rate",44100); int latency = GLOBAL_DEF("audio/output_latency",25); - unsigned int buffer_size = nearest_power_of_2( latency * mix_rate / 1000 ); + // calculate desired buffer_size, taking the desired numberOfBuffers into account (latency depends on numberOfBuffers*buffer_size) + unsigned int buffer_size = nearest_power_of_2( latency * mix_rate / 1000 / target_number_of_buffers); + if (OS::get_singleton()->is_stdout_verbose()) { print_line("audio buffer size: "+itos(buffer_size)); } -// bool success=false; - - while( true) { - - switch(output_format) { - - case OUTPUT_MONO: parameters.nChannels = 1; break; - case OUTPUT_STEREO: parameters.nChannels = 2; break; - case OUTPUT_QUAD: parameters.nChannels = 4; break; - case OUTPUT_5_1: parameters.nChannels = 6; break; - }; + short int tries = 2; + while(true) { + while( true) { + switch(output_format) { + case OUTPUT_MONO: parameters.nChannels = 1; break; + case OUTPUT_STEREO: parameters.nChannels = 2; break; + case OUTPUT_QUAD: parameters.nChannels = 4; break; + case OUTPUT_5_1: parameters.nChannels = 6; break; + }; - try { - dac->openStream( ¶meters, NULL, RTAUDIO_SINT32, - mix_rate, &buffer_size, &callback, this,&options ); - mutex = Mutex::create(true); - active=true; + try { + dac->openStream( ¶meters, NULL, RTAUDIO_SINT32, mix_rate, &buffer_size, &callback, this,&options ); + mutex = Mutex::create(true); + active=true; + + break; + } catch ( RtAudioError& e ) { + // try with less channels + ERR_PRINT("Unable to open audio, retrying with fewer channels.."); + + switch(output_format) { + case OUTPUT_MONO: ERR_EXPLAIN("Unable to open audio."); ERR_FAIL_V( ERR_UNAVAILABLE ); break; + case OUTPUT_STEREO: output_format=OUTPUT_MONO; break; + case OUTPUT_QUAD: output_format=OUTPUT_STEREO; break; + case OUTPUT_5_1: output_format=OUTPUT_QUAD; break; + }; + } + } + // compare actual numberOfBuffers with the desired one. If not equal, close and reopen the stream with adjusted buffer size, so the desired output_latency is still correct + if(target_number_of_buffers != options.numberOfBuffers) { + if(tries <= 0) { + ERR_EXPLAIN("RtAudio: Unable to set correct number of buffers."); + ERR_FAIL_V( ERR_UNAVAILABLE ); + break; + } + + try { + dac->closeStream(); + } catch ( RtAudioError& e ) { + ERR_PRINT(e.what()); + ERR_FAIL_V( ERR_UNAVAILABLE ); + break; + } + if (OS::get_singleton()->is_stdout_verbose()) + print_line("RtAudio: Desired number of buffers (" + itos(target_number_of_buffers) + ") not available. Using " + itos(options.numberOfBuffers) + " instead. Reopening stream with adjusted buffer_size."); + + // new buffer size dependent on the ratio between set and actual numberOfBuffers + buffer_size = buffer_size / (options.numberOfBuffers / target_number_of_buffers); + target_number_of_buffers = options.numberOfBuffers; + tries--; + } else { break; - } catch ( RtAudioError& e ) { - // try with less channels - - ERR_PRINT("Unable to open audio, retrying with fewer channels.."); - - switch(output_format) { - - case OUTPUT_MONO: ERR_EXPLAIN("Unable to open audio."); ERR_FAIL_V( ERR_UNAVAILABLE ); break; - case OUTPUT_STEREO: output_format=OUTPUT_MONO; break; - case OUTPUT_QUAD: output_format=OUTPUT_STEREO; break; - case OUTPUT_5_1: output_format=OUTPUT_QUAD; break; - }; } - } + + } return OK; } @@ -190,7 +214,6 @@ void AudioDriverRtAudio::unlock() { void AudioDriverRtAudio::finish() { - if ( active && dac->isStreamOpen() ) dac->closeStream(); if (mutex) @@ -203,6 +226,7 @@ void AudioDriverRtAudio::finish() { AudioDriverRtAudio::AudioDriverRtAudio() { + mutex=NULL; mix_rate=44100; output_format=OUTPUT_STEREO; diff --git a/drivers/rtaudio/audio_driver_rtaudio.h b/drivers/rtaudio/audio_driver_rtaudio.h index 82055f6d17..aa7fae038a 100644 --- a/drivers/rtaudio/audio_driver_rtaudio.h +++ b/drivers/rtaudio/audio_driver_rtaudio.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/unix/dir_access_unix.cpp b/drivers/unix/dir_access_unix.cpp index b3bea8ac27..3bb30700db 100644 --- a/drivers/unix/dir_access_unix.cpp +++ b/drivers/unix/dir_access_unix.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/unix/dir_access_unix.h b/drivers/unix/dir_access_unix.h index b2f1aed10f..324d2a379c 100644 --- a/drivers/unix/dir_access_unix.h +++ b/drivers/unix/dir_access_unix.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp index 2838e7d913..ee51db6694 100644 --- a/drivers/unix/file_access_unix.cpp +++ b/drivers/unix/file_access_unix.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/unix/file_access_unix.h b/drivers/unix/file_access_unix.h index d6a172bf47..57b643dc26 100644 --- a/drivers/unix/file_access_unix.h +++ b/drivers/unix/file_access_unix.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/unix/ip_unix.cpp b/drivers/unix/ip_unix.cpp index d998c63dfa..ffb37b4f59 100644 --- a/drivers/unix/ip_unix.cpp +++ b/drivers/unix/ip_unix.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,22 +37,25 @@ #ifndef AI_ADDRCONFIG #define AI_ADDRCONFIG 0x00000400 #endif - #ifndef AI_V4MAPPED - #define AI_V4MAPPED 0x00000800 - #endif - #ifdef UWP_ENABLED #include <ws2tcpip.h> #include <winsock2.h> #include <windows.h> #include <stdio.h> - #else - #define WINVER 0x0600 - #include <ws2tcpip.h> - #include <winsock2.h> - #include <windows.h> - #include <stdio.h> - #include <iphlpapi.h> - #endif + #ifndef UWP_ENABLED + #if defined(__MINGW32__ ) && (!defined(__MINGW64_VERSION_MAJOR) || __MINGW64_VERSION_MAJOR < 4) + // MinGW-w64 on Ubuntu 12.04 (our Travis build env) has bugs in this code where + // some includes are missing in dependencies of iphlpapi.h for WINVER >= 0x0600 (Vista). + // We don't use this Vista code for now, so working it around by disabling it. + // MinGW-w64 >= 4.0 seems to be better judging by its headers. + #undef _WIN32_WINNT + #define _WIN32_WINNT 0x0501 // Windows XP, disable Vista API + #include <iphlpapi.h> + #undef _WIN32_WINNT + #define _WIN32_WINNT 0x0600 // Reenable Vista API + #else + #include <iphlpapi.h> + #endif // MINGW hack + #endif #else #include <netdb.h> #ifdef ANDROID_ENABLED @@ -75,32 +78,29 @@ static IP_Address _sockaddr2ip(struct sockaddr* p_addr) { IP_Address ip; if (p_addr->sa_family == AF_INET) { struct sockaddr_in* addr = (struct sockaddr_in*)p_addr; - ip.field32[0] = *((unsigned long*)&addr->sin_addr); - ip.type = IP_Address::TYPE_IPV4; + ip.set_ipv4((uint8_t *)&(addr->sin_addr)); } else { struct sockaddr_in6* addr6 = (struct sockaddr_in6*)p_addr; - for (int i=0; i<16; i++) - ip.field8[i] = addr6->sin6_addr.s6_addr[i]; - ip.type = IP_Address::TYPE_IPV6; + ip.set_ipv6(addr6->sin6_addr.s6_addr); }; return ip; }; -IP_Address IP_Unix::_resolve_hostname(const String& p_hostname, IP_Address::AddrType p_type) { +IP_Address IP_Unix::_resolve_hostname(const String& p_hostname, Type p_type) { struct addrinfo hints; struct addrinfo* result; memset(&hints, 0, sizeof(struct addrinfo)); - if (p_type == IP_Address::TYPE_IPV4) { + if (p_type == TYPE_IPV4) { hints.ai_family = AF_INET; - } else if (p_type == IP_Address::TYPE_IPV6) { + } else if (p_type == TYPE_IPV6) { hints.ai_family = AF_INET6; hints.ai_flags = 0; } else { hints.ai_family = AF_UNSPEC; - hints.ai_flags = (AI_V4MAPPED | AI_ADDRCONFIG); + hints.ai_flags = AI_ADDRCONFIG; }; int s = getaddrinfo(p_hostname.utf8().get_data(), NULL, &hints, &result); @@ -184,15 +184,12 @@ void IP_Unix::get_local_addresses(List<IP_Address> *r_addresses) const { SOCKADDR_IN* ipv4 = reinterpret_cast<SOCKADDR_IN*>(address->Address.lpSockaddr); - ip.field32[0] = *((unsigned long*)&ipv4->sin_addr); - ip.type = IP_Address::TYPE_IPV4; + ip.set_ipv4((uint8_t *)&(ipv4->sin_addr)); } else { // ipv6 SOCKADDR_IN6* ipv6 = reinterpret_cast<SOCKADDR_IN6*>(address->Address.lpSockaddr); - for (int i=0; i<16; i++) { - ip.field8[i] = ipv6->sin6_addr.s6_addr[i]; - }; - ip.type = IP_Address::TYPE_IPV6; + + ip.set_ipv6(ipv6->sin6_addr.s6_addr); }; diff --git a/drivers/unix/ip_unix.h b/drivers/unix/ip_unix.h index d198a330e7..eb7ebf8bb0 100644 --- a/drivers/unix/ip_unix.h +++ b/drivers/unix/ip_unix.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,9 +34,9 @@ #if defined(UNIX_ENABLED) || defined(WINDOWS_ENABLED) class IP_Unix : public IP { - OBJ_TYPE(IP_Unix, IP); + GDCLASS(IP_Unix, IP); - virtual IP_Address _resolve_hostname(const String& p_hostname, IP_Address::AddrType p_type); + virtual IP_Address _resolve_hostname(const String& p_hostname, IP::Type p_type); static IP* _create_unix(); public: diff --git a/drivers/unix/memory_pool_static_malloc.cpp b/drivers/unix/memory_pool_static_malloc.cpp index f89b55de12..139597f9cb 100644 --- a/drivers/unix/memory_pool_static_malloc.cpp +++ b/drivers/unix/memory_pool_static_malloc.cpp @@ -1,434 +1,2 @@ -/*************************************************************************/ -/* memory_pool_static_malloc.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "memory_pool_static_malloc.h" -#include "error_macros.h" -#include "os/memory.h" -#include <stdlib.h> -#include <stdio.h> -#include "os/copymem.h" -#include "os/os.h" - -/** - * NOTE NOTE NOTE NOTE - * in debug mode, this prepends the memory size to the allocated block - * so BE CAREFUL! - */ - -void* MemoryPoolStaticMalloc::alloc(size_t p_bytes,const char *p_description) { - - #if DEFAULT_ALIGNMENT == 1 - - return _alloc(p_bytes, p_description); - - #else - - size_t total; - #if defined(_add_overflow) - if (_add_overflow(p_bytes, DEFAULT_ALIGNMENT, &total)) return NULL; - #else - total = p_bytes + DEFAULT_ALIGNMENT; - #endif - uint8_t* ptr = (uint8_t*)_alloc(total, p_description); - ERR_FAIL_COND_V( !ptr, ptr ); - int ofs = (DEFAULT_ALIGNMENT - ((uintptr_t)ptr & (DEFAULT_ALIGNMENT - 1))); - ptr[ofs-1] = ofs; - return (void*)(ptr + ofs); - #endif -}; - -void* MemoryPoolStaticMalloc::_alloc(size_t p_bytes,const char *p_description) { - - ERR_FAIL_COND_V(p_bytes==0,0); - - MutexLock lock(mutex); - -#ifdef DEBUG_MEMORY_ENABLED - - size_t total; - #if defined(_add_overflow) - if (_add_overflow(p_bytes, sizeof(RingPtr), &total)) return NULL; - #else - total = p_bytes + sizeof(RingPtr); - #endif - void *mem=malloc(total); /// add for size and ringlist - - if (!mem) { - printf("**ERROR: out of memory while allocating %lu bytes by %s?\n", (unsigned long) p_bytes, p_description); - printf("**ERROR: memory usage is %lu\n", (unsigned long) get_total_usage()); - }; - - ERR_FAIL_COND_V(!mem,0); //out of memory, or unreasonable request - - /* setup the ringlist element */ - - RingPtr *ringptr = (RingPtr*)mem; - - /* setup the ringlist element data (description and size ) */ - - ringptr->size = p_bytes; - ringptr->descr=p_description; - - if (ringlist) { /* existing ringlist */ - - /* assign next */ - ringptr->next = ringlist->next; - ringlist->next = ringptr; - /* assign prev */ - ringptr->prev = ringlist; - ringptr->next->prev = ringptr; - } else { /* non existing ringlist */ - - ringptr->next=ringptr; - ringptr->prev=ringptr; - ringlist=ringptr; - - } - - total_mem+=p_bytes; - - /* update statistics */ - if (total_mem > max_mem ) - max_mem = total_mem; - - total_pointers++; - - if (total_pointers > max_pointers) - max_pointers=total_pointers; - - return ringptr + 1; /* return memory after ringptr */ - -#else - void *mem=malloc(p_bytes); - - ERR_FAIL_COND_V(!mem,0); //out of memory, or unreasonable request - return mem; -#endif -} - - -void* MemoryPoolStaticMalloc::realloc(void *p_memory,size_t p_bytes) { - - #if DEFAULT_ALIGNMENT == 1 - - return _realloc(p_memory,p_bytes); - #else - if (!p_memory) - return alloc(p_bytes); - - size_t total; - #if defined(_add_overflow) - if (_add_overflow(p_bytes, DEFAULT_ALIGNMENT, &total)) return NULL; - #else - total = p_bytes + DEFAULT_ALIGNMENT; - #endif - uint8_t* mem = (uint8_t*)p_memory; - int ofs = *(mem-1); - mem = mem - ofs; - uint8_t* ptr = (uint8_t*)_realloc(mem, total); - ERR_FAIL_COND_V(ptr == NULL, NULL); - int new_ofs = (DEFAULT_ALIGNMENT - ((uintptr_t)ptr & (DEFAULT_ALIGNMENT - 1))); - if (new_ofs != ofs) { - - //printf("realloc moving %i bytes\n", p_bytes); - movemem((ptr + new_ofs), (ptr + ofs), p_bytes); - ptr[new_ofs-1] = new_ofs; - }; - return ptr + new_ofs; - #endif -}; - -void* MemoryPoolStaticMalloc::_realloc(void *p_memory,size_t p_bytes) { - - if (p_memory==NULL) { - - return alloc( p_bytes ); - } - - if (p_bytes==0) { - - this->free(p_memory); - ERR_FAIL_COND_V( p_bytes < 0 , NULL ); - return NULL; - } - - MutexLock lock(mutex); - -#ifdef DEBUG_MEMORY_ENABLED - - - RingPtr *ringptr = (RingPtr*)p_memory; - ringptr--; /* go back an element to find the tingptr */ - - bool single_element = (ringptr->next == ringptr) && (ringptr->prev == ringptr); - bool is_list = ( ringlist == ringptr ); - - RingPtr *new_ringptr=(RingPtr*)::realloc(ringptr, p_bytes+sizeof(RingPtr)); - - ERR_FAIL_COND_V( new_ringptr == 0, NULL ); /// reallocation failed - - /* actualize mem used */ - total_mem -= new_ringptr->size; - new_ringptr->size = p_bytes; - total_mem += new_ringptr->size; - - if (total_mem > max_mem ) //update statistics - max_mem = total_mem; - - if (new_ringptr == ringptr ) - return ringptr + 1; // block didn't move, don't do anything - - if (single_element) { - - new_ringptr->next=new_ringptr; - new_ringptr->prev=new_ringptr; - } else { - - new_ringptr->next->prev=new_ringptr; - new_ringptr->prev->next=new_ringptr; - } - - if (is_list) - ringlist=new_ringptr; - - - return new_ringptr + 1; - -#else - return ::realloc( p_memory, p_bytes ); -#endif -} - -void MemoryPoolStaticMalloc::free(void *p_ptr) { - - ERR_FAIL_COND( !MemoryPoolStatic::get_singleton()); - - #if DEFAULT_ALIGNMENT == 1 - - _free(p_ptr); - #else - - uint8_t* mem = (uint8_t*)p_ptr; - int ofs = *(mem-1); - mem = mem - ofs; - - _free(mem); - #endif -}; - - -void MemoryPoolStaticMalloc::_free(void *p_ptr) { - - MutexLock lock(mutex); - -#ifdef DEBUG_MEMORY_ENABLED - - if (p_ptr==0) { - printf("**ERROR: STATIC ALLOC: Attempted free of NULL pointer.\n"); - return; - }; - - RingPtr *ringptr = (RingPtr*)p_ptr; - - ringptr--; /* go back an element to find the ringptr */ - - -#if 0 - { // check for existing memory on free. - RingPtr *p = ringlist; - - bool found=false; - - if (ringlist) { - do { - if (p==ringptr) { - found=true; - break; - } - - p=p->next; - } while (p!=ringlist); - } - - if (!found) { - printf("**ERROR: STATIC ALLOC: Attempted free of unknown pointer at %p\n",(ringptr+1)); - return; - } - - } -#endif - /* proceed to erase */ - - bool single_element = (ringptr->next == ringptr) && (ringptr->prev == ringptr); - bool is_list = ( ringlist == ringptr ); - - if (single_element) { - /* just get rid of it */ - ringlist=0; - - } else { - /* auto-remove from ringlist */ - if (is_list) - ringlist=ringptr->next; - - ringptr->prev->next = ringptr->next; - ringptr->next->prev = ringptr->prev; - } - - total_mem -= ringptr->size; - total_pointers--; - // catch more errors - zeromem(ringptr,sizeof(RingPtr)+ringptr->size); - ::free(ringptr); //just free that pointer - -#else - ERR_FAIL_COND(p_ptr==0); - - ::free(p_ptr); -#endif -} - - -size_t MemoryPoolStaticMalloc::get_available_mem() const { - - return 0xffffffff; -} - -size_t MemoryPoolStaticMalloc::get_total_usage() { - -#ifdef DEBUG_MEMORY_ENABLED - - return total_mem; -#else - return 0; -#endif - -} - -size_t MemoryPoolStaticMalloc::get_max_usage() { - - return max_mem; -} - -/* Most likely available only if memory debugger was compiled in */ -int MemoryPoolStaticMalloc::get_alloc_count() { - - return total_pointers; -} -void * MemoryPoolStaticMalloc::get_alloc_ptr(int p_alloc_idx) { - - return 0; -} -const char* MemoryPoolStaticMalloc::get_alloc_description(int p_alloc_idx) { - - - return ""; -} -size_t MemoryPoolStaticMalloc::get_alloc_size(int p_alloc_idx) { - - return 0; -} - -void MemoryPoolStaticMalloc::dump_mem_to_file(const char* p_file) { - -#ifdef DEBUG_MEMORY_ENABLED - - ERR_FAIL_COND( !ringlist ); /** WTF BUG !? */ - RingPtr *p = ringlist; - FILE *f = fopen(p_file,"wb"); - - do { - fprintf(f,"%p-%i-%s\n", p+1, (int)p->size, (p->descr?p->descr:"") ); - p=p->next; - } while (p!=ringlist); - - fclose(f); -#endif - -} - -MemoryPoolStaticMalloc::MemoryPoolStaticMalloc() { - -#ifdef DEBUG_MEMORY_ENABLED - total_mem=0; - total_pointers=0; - ringlist=0; - max_mem=0; - max_pointers=0; - - -#endif - - mutex=NULL; -#ifndef NO_THREADS - - mutex=Mutex::create(); // at this point, this should work -#endif - -} - - -MemoryPoolStaticMalloc::~MemoryPoolStaticMalloc() { - - Mutex *old_mutex=mutex; - mutex=NULL; - if (old_mutex) - memdelete(old_mutex); - -#ifdef DEBUG_MEMORY_ENABLED - - if (OS::get_singleton()->is_stdout_verbose()) { - if (total_mem > 0 ) { - printf("**ERROR: STATIC ALLOC: ** MEMORY LEAKS DETECTED **\n"); - printf("**ERROR: STATIC ALLOC: %i bytes of memory in use at exit.\n",(int)total_mem); - - if (1){ - printf("**ERROR: STATIC ALLOC: Following is the list of leaked allocations: \n"); - - ERR_FAIL_COND( !ringlist ); /** WTF BUG !? */ - RingPtr *p = ringlist; - - do { - printf("\t%p - %i bytes - %s\n", (RingPtr*)(p+1), (int)p->size, (p->descr?p->descr:"") ); - p=p->next; - } while (p!=ringlist); - - printf("**ERROR: STATIC ALLOC: End of Report.\n"); - }; - - printf("mem - max %i, pointers %i, leaks %i.\n",(int)max_mem,max_pointers,(int)total_mem); - } else { - - printf("INFO: mem - max %i, pointers %i, no leaks.\n",(int)max_mem,max_pointers); - } - } - -#endif -} diff --git a/drivers/unix/memory_pool_static_malloc.h b/drivers/unix/memory_pool_static_malloc.h index 78ad82ee22..e69de29bb2 100644 --- a/drivers/unix/memory_pool_static_malloc.h +++ b/drivers/unix/memory_pool_static_malloc.h @@ -1,82 +0,0 @@ -/*************************************************************************/ -/* memory_pool_static_malloc.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef MEMORY_POOL_STATIC_MALLOC_H -#define MEMORY_POOL_STATIC_MALLOC_H - -#include "os/memory_pool_static.h" -#include "os/mutex.h" -/** - @author Juan Linietsky <red@lunatea> -*/ -class MemoryPoolStaticMalloc : public MemoryPoolStatic { - - struct RingPtr { - - size_t size; - const char *descr; /* description of memory */ - RingPtr *next; - RingPtr *prev; - }; - - RingPtr *ringlist; - size_t total_mem; - int total_pointers; - - size_t max_mem; - int max_pointers; - - Mutex *mutex; - - void* _alloc(size_t p_bytes,const char *p_description=""); ///< Pointer in p_description shold be to a const char const like "hello" - void* _realloc(void *p_memory,size_t p_bytes); ///< Pointer in - void _free(void *p_ptr); ///< Pointer in p_description shold be to a const char const - -public: - - virtual void* alloc(size_t p_bytes,const char *p_description=""); ///< Pointer in p_description shold be to a const char const like "hello" - virtual void free(void *p_ptr); ///< Pointer in p_description shold be to a const char const - virtual void* realloc(void *p_memory,size_t p_bytes); ///< Pointer in - virtual size_t get_available_mem() const; - virtual size_t get_total_usage(); - virtual size_t get_max_usage(); - - /* Most likely available only if memory debugger was compiled in */ - virtual int get_alloc_count(); - virtual void * get_alloc_ptr(int p_alloc_idx); - virtual const char* get_alloc_description(int p_alloc_idx); - virtual size_t get_alloc_size(int p_alloc_idx); - - void dump_mem_to_file(const char* p_file); - - MemoryPoolStaticMalloc(); - ~MemoryPoolStaticMalloc(); - -}; - -#endif diff --git a/drivers/unix/mutex_posix.cpp b/drivers/unix/mutex_posix.cpp index fb4fa4a891..c9b5bdce75 100644 --- a/drivers/unix/mutex_posix.cpp +++ b/drivers/unix/mutex_posix.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/unix/mutex_posix.h b/drivers/unix/mutex_posix.h index a1993be221..a71400924a 100644 --- a/drivers/unix/mutex_posix.h +++ b/drivers/unix/mutex_posix.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index 271cf302ef..283cff0486 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -30,11 +30,11 @@ #ifdef UNIX_ENABLED -#include "memory_pool_static_malloc.h" -#include "os/memory_pool_dynamic_static.h" + #include "thread_posix.h" #include "semaphore_posix.h" #include "mutex_posix.h" +#include "rw_lock_posix.h" #include "core/os/thread_dummy.h" //#include "core/io/file_access_buffered_fa.h" @@ -88,6 +88,10 @@ void OS_Unix::print_error(const char* p_function,const char* p_file,int p_line,c print("\E[1;35mSCRIPT ERROR: %s: \E[0m\E[1m%s\n",p_function,err_details); print("\E[0;35m At: %s:%i.\E[0m\n",p_file,p_line); break; + case ERR_SHADER: + print("\E[1;36mSHADER ERROR: %s: \E[0m\E[1m%s\n",p_function,err_details); + print("\E[0;36m At: %s:%i.\E[0m\n",p_file,p_line); + break; } } @@ -112,8 +116,6 @@ int OS_Unix::unix_initialize_audio(int p_audio_driver) { return 0; } -static MemoryPoolStaticMalloc *mempool_static=NULL; -static MemoryPoolDynamicStatic *mempool_dynamic=NULL; void OS_Unix::initialize_core() { @@ -126,6 +128,7 @@ void OS_Unix::initialize_core() { ThreadPosix::make_default(); SemaphorePosix::make_default(); MutexPosix::make_default(); + RWLockPosix::make_default(); #endif FileAccess::make_default<FileAccessUnix>(FileAccess::ACCESS_RESOURCES); FileAccess::make_default<FileAccessUnix>(FileAccess::ACCESS_USERDATA); @@ -141,8 +144,6 @@ void OS_Unix::initialize_core() { PacketPeerUDPPosix::make_default(); IP_Unix::make_default(); #endif - mempool_static = new MemoryPoolStaticMalloc; - mempool_dynamic = memnew( MemoryPoolDynamicStatic ); ticks_start=0; ticks_start=get_ticks_usec(); @@ -151,9 +152,6 @@ void OS_Unix::initialize_core() { void OS_Unix::finalize_core() { - if (mempool_dynamic) - memdelete( mempool_dynamic ); - delete mempool_static; } @@ -468,7 +466,7 @@ String OS_Unix::get_data_dir() const { if (has_environment("HOME")) { - bool use_godot = Globals::get_singleton()->get("application/use_shared_user_dir"); + bool use_godot = GlobalConfig::get_singleton()->get("application/use_shared_user_dir"); if (use_godot) return get_environment("HOME")+"/.godot/app_userdata/"+an; else @@ -476,7 +474,7 @@ String OS_Unix::get_data_dir() const { } } - return Globals::get_singleton()->get_resource_path(); + return GlobalConfig::get_singleton()->get_resource_path(); } @@ -522,9 +520,6 @@ String OS_Unix::get_executable_path() const { delete[] resolved_path; return path; -#elif defined(EMSCRIPTEN) - // We return nothing - return String(); #else ERR_PRINT("Warning, don't know how to obtain executable path on this OS! Please override this function properly."); return OS::get_executable_path(); diff --git a/drivers/unix/os_unix.h b/drivers/unix/os_unix.h index a889bba0ff..b28adc2ee0 100644 --- a/drivers/unix/os_unix.h +++ b/drivers/unix/os_unix.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/unix/packet_peer_udp_posix.cpp b/drivers/unix/packet_peer_udp_posix.cpp index ed295f0459..4d9ef6cdae 100644 --- a/drivers/unix/packet_peer_udp_posix.cpp +++ b/drivers/unix/packet_peer_udp_posix.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -76,12 +76,14 @@ Error PacketPeerUDPPosix::get_packet(const uint8_t **r_buffer,int &r_buffer_size uint32_t size; uint8_t type; rb.read(&type, 1, true); - if (type == IP_Address::TYPE_IPV4) { - rb.read((uint8_t*)&packet_ip.field8,4,true); - packet_ip.type = IP_Address::TYPE_IPV4; + if (type == IP::TYPE_IPV4) { + uint8_t ip[4]; + rb.read(ip,4,true); + packet_ip.set_ipv4(ip); } else { - rb.read((uint8_t*)&packet_ip.field8,16,true); - packet_ip.type = IP_Address::TYPE_IPV6; + uint8_t ipv6[16]; + rb.read(ipv6,16,true); + packet_ip.set_ipv6(ipv6); }; rb.read((uint8_t*)&packet_port,4,true); rb.read((uint8_t*)&size,4,true); @@ -94,12 +96,12 @@ Error PacketPeerUDPPosix::get_packet(const uint8_t **r_buffer,int &r_buffer_size } Error PacketPeerUDPPosix::put_packet(const uint8_t *p_buffer,int p_buffer_size){ - ERR_FAIL_COND_V(peer_addr.type == IP_Address::TYPE_NONE, ERR_UNCONFIGURED); + ERR_FAIL_COND_V(peer_addr == IP_Address(), ERR_UNCONFIGURED); - int sock = _get_socket(peer_addr.type); + int sock = _get_socket(); ERR_FAIL_COND_V( sock == -1, FAILED ); struct sockaddr_storage addr; - size_t addr_size = _set_sockaddr(&addr, peer_addr, peer_port); + size_t addr_size = _set_sockaddr(&addr, peer_addr, peer_port, ip_type); errno = 0; int err; @@ -119,24 +121,16 @@ int PacketPeerUDPPosix::get_max_packet_size() const{ return 512; // uhm maybe not } -Error PacketPeerUDPPosix::listen(int p_port, IP_Address::AddrType p_type, int p_recv_buffer_size) { +Error PacketPeerUDPPosix::listen(int p_port, int p_recv_buffer_size) { close(); - int sock = _get_socket(p_type); + int sock = _get_socket(); if (sock == -1 ) return ERR_CANT_CREATE; - if(p_type == IP_Address::TYPE_IPV6) { - // Use IPv6 only socket - int yes = 1; - if(setsockopt(sockfd, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&yes, sizeof(yes)) != 0) { - WARN_PRINT("Unable to unset IPv4 address mapping over IPv6"); - } - } - sockaddr_storage addr = {0}; - size_t addr_size = _set_listen_sockaddr(&addr, p_port, p_type, NULL); + size_t addr_size = _set_listen_sockaddr(&addr, p_port, ip_type, NULL); if (bind(sock, (struct sockaddr*)&addr, addr_size) == -1 ) { close(); @@ -171,7 +165,7 @@ Error PacketPeerUDPPosix::_poll(bool p_wait) { uint32_t port = 0; if (from.ss_family == AF_INET) { - uint8_t type = (uint8_t)IP_Address::TYPE_IPV4; + uint8_t type = (uint8_t)IP::TYPE_IPV4; rb.write(&type, 1); struct sockaddr_in* sin_from = (struct sockaddr_in*)&from; rb.write((uint8_t*)&sin_from->sin_addr, 4); @@ -179,7 +173,7 @@ Error PacketPeerUDPPosix::_poll(bool p_wait) { } else if (from.ss_family == AF_INET6) { - uint8_t type = (uint8_t)IP_Address::TYPE_IPV6; + uint8_t type = (uint8_t)IP::TYPE_IPV6; rb.write(&type, 1); struct sockaddr_in6* s6_from = (struct sockaddr_in6*)&from; @@ -189,7 +183,7 @@ Error PacketPeerUDPPosix::_poll(bool p_wait) { } else { // WARN_PRINT("Ignoring packet with unknown address family"); - uint8_t type = (uint8_t)IP_Address::TYPE_NONE; + uint8_t type = (uint8_t)IP::TYPE_NONE; rb.write(&type, 1); }; @@ -225,12 +219,12 @@ int PacketPeerUDPPosix::get_packet_port() const{ return packet_port; } -int PacketPeerUDPPosix::_get_socket(IP_Address::AddrType p_type) { +int PacketPeerUDPPosix::_get_socket() { if (sockfd != -1) return sockfd; - sockfd = _socket_create(p_type, SOCK_DGRAM, IPPROTO_UDP); + sockfd = _socket_create(ip_type, SOCK_DGRAM, IPPROTO_UDP); return sockfd; } @@ -259,6 +253,7 @@ PacketPeerUDPPosix::PacketPeerUDPPosix() { packet_port=0; queue_count=0; peer_port=0; + ip_type = IP::TYPE_ANY; } PacketPeerUDPPosix::~PacketPeerUDPPosix() { diff --git a/drivers/unix/packet_peer_udp_posix.h b/drivers/unix/packet_peer_udp_posix.h index 13b6969e53..89b8886cf5 100644 --- a/drivers/unix/packet_peer_udp_posix.h +++ b/drivers/unix/packet_peer_udp_posix.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -52,7 +52,7 @@ class PacketPeerUDPPosix : public PacketPeerUDP { IP_Address peer_addr; int peer_port; - _FORCE_INLINE_ int _get_socket(IP_Address::AddrType p_type); + _FORCE_INLINE_ int _get_socket(); static PacketPeerUDP* _create(); virtual Error _poll(bool p_block); @@ -65,7 +65,7 @@ public: virtual int get_max_packet_size() const; - virtual Error listen(int p_port, IP_Address::AddrType p_address_type, int p_recv_buffer_size=65536); + virtual Error listen(int p_port, int p_recv_buffer_size=65536); virtual void close(); virtual Error wait(); virtual bool is_listening() const; diff --git a/drivers/unix/rw_lock_posix.cpp b/drivers/unix/rw_lock_posix.cpp new file mode 100644 index 0000000000..b51e5fd420 --- /dev/null +++ b/drivers/unix/rw_lock_posix.cpp @@ -0,0 +1,77 @@ + +#if defined(UNIX_ENABLED) || defined(PTHREAD_ENABLED) + +#include "os/memory.h" +#include "rw_lock_posix.h" +#include "error_macros.h" +#include <stdio.h> + +void RWLockPosix::read_lock() { + + int err =pthread_rwlock_rdlock(&rwlock); + if (err!=0) { + perror("wtf: "); + } + ERR_FAIL_COND(err!=0); +} + +void RWLockPosix::read_unlock() { + + pthread_rwlock_unlock(&rwlock); +} + +Error RWLockPosix::read_try_lock() { + + if (pthread_rwlock_tryrdlock(&rwlock)!=0) { + return ERR_BUSY; + } else { + return OK; + } + +} + +void RWLockPosix::write_lock() { + + int err = pthread_rwlock_wrlock(&rwlock); + ERR_FAIL_COND(err!=0); +} + +void RWLockPosix::write_unlock() { + + pthread_rwlock_unlock(&rwlock); +} + +Error RWLockPosix::write_try_lock() { + if (pthread_rwlock_trywrlock(&rwlock)!=0) { + return ERR_BUSY; + } else { + return OK; + } +} + + +RWLock *RWLockPosix::create_func_posix() { + + return memnew( RWLockPosix ); +} + +void RWLockPosix::make_default() { + + create_func=create_func_posix; +} + + +RWLockPosix::RWLockPosix() { + + //rwlock=PTHREAD_RWLOCK_INITIALIZER; fails on OSX + pthread_rwlock_init(&rwlock,NULL); +} + + +RWLockPosix::~RWLockPosix() { + + pthread_rwlock_destroy(&rwlock); + +} + +#endif diff --git a/drivers/unix/rw_lock_posix.h b/drivers/unix/rw_lock_posix.h new file mode 100644 index 0000000000..bcc102f6a6 --- /dev/null +++ b/drivers/unix/rw_lock_posix.h @@ -0,0 +1,37 @@ +#ifndef RWLOCKPOSIX_H +#define RWLOCKPOSIX_H + +#if defined(UNIX_ENABLED) || defined(PTHREAD_ENABLED) + +#include <pthread.h> +#include "os/rw_lock.h" + +class RWLockPosix : public RWLock { + + + pthread_rwlock_t rwlock; + + static RWLock *create_func_posix(); + +public: + + virtual void read_lock(); + virtual void read_unlock(); + virtual Error read_try_lock(); + + virtual void write_lock(); + virtual void write_unlock(); + virtual Error write_try_lock(); + + static void make_default(); + + RWLockPosix(); + + ~RWLockPosix(); + +}; + +#endif + + +#endif // RWLOCKPOSIX_H diff --git a/drivers/unix/semaphore_posix.cpp b/drivers/unix/semaphore_posix.cpp index 3ae94ae5d9..83b34a42dd 100644 --- a/drivers/unix/semaphore_posix.cpp +++ b/drivers/unix/semaphore_posix.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/unix/semaphore_posix.h b/drivers/unix/semaphore_posix.h index 0a3cf36749..96d1ff5c06 100644 --- a/drivers/unix/semaphore_posix.h +++ b/drivers/unix/semaphore_posix.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/unix/socket_helpers.h b/drivers/unix/socket_helpers.h index 5e8e8dfd7a..962f228c3c 100644 --- a/drivers/unix/socket_helpers.h +++ b/drivers/unix/socket_helpers.h @@ -16,31 +16,42 @@ // helpers for sockaddr -> IP_Address and back, should work for posix and winsock. All implementations should use this -static size_t _set_sockaddr(struct sockaddr_storage* p_addr, const IP_Address& p_ip, int p_port) { +static size_t _set_sockaddr(struct sockaddr_storage* p_addr, const IP_Address& p_ip, int p_port, IP::Type p_sock_type = IP::TYPE_ANY) { memset(p_addr, 0, sizeof(struct sockaddr_storage)); - if (p_ip.type == IP_Address::TYPE_IPV6) { + + ERR_FAIL_COND_V(p_ip==IP_Address(),0); + + // IPv6 socket + if (p_sock_type == IP::TYPE_IPV6 || p_sock_type == IP::TYPE_ANY) { + + // IPv6 only socket with IPv4 address + ERR_FAIL_COND_V(p_sock_type == IP::TYPE_IPV6 && p_ip.is_ipv4(),0); struct sockaddr_in6* addr6 = (struct sockaddr_in6*)p_addr; addr6->sin6_family = AF_INET6; addr6->sin6_port = htons(p_port); - copymem(&addr6->sin6_addr.s6_addr, p_ip.field8, 16); + copymem(&addr6->sin6_addr.s6_addr, p_ip.get_ipv6(), 16); return sizeof(sockaddr_in6); - } else { + } else { // IPv4 socket + // IPv4 socket with IPv6 address + ERR_FAIL_COND_V(!p_ip.is_ipv4(),0); + + uint32_t ipv4 = *((uint32_t *)p_ip.get_ipv4()); struct sockaddr_in* addr4 = (struct sockaddr_in*)p_addr; - addr4->sin_family = AF_INET; // host byte order + addr4->sin_family = AF_INET; addr4->sin_port = htons(p_port); // short, network byte order - addr4->sin_addr = *((struct in_addr*)&p_ip.field32[0]); + copymem(&addr4->sin_addr.s_addr, p_ip.get_ipv4(), 16); return sizeof(sockaddr_in); }; }; -static size_t _set_listen_sockaddr(struct sockaddr_storage* p_addr, int p_port, IP_Address::AddrType p_address_type, const List<String> *p_accepted_hosts) { +static size_t _set_listen_sockaddr(struct sockaddr_storage* p_addr, int p_port, IP::Type p_sock_type, const List<String> *p_accepted_hosts) { memset(p_addr, 0, sizeof(struct sockaddr_storage)); - if (p_address_type == IP_Address::TYPE_IPV4) { + if (p_sock_type == IP::TYPE_IPV4) { struct sockaddr_in* addr4 = (struct sockaddr_in*)p_addr; addr4->sin_family = AF_INET; addr4->sin_port = htons(p_port); @@ -56,20 +67,20 @@ static size_t _set_listen_sockaddr(struct sockaddr_storage* p_addr, int p_port, }; }; -static int _socket_create(IP_Address::AddrType p_type, int type, int protocol) { +static int _socket_create(IP::Type p_type, int type, int protocol) { - ERR_FAIL_COND_V(p_type > IP_Address::TYPE_ANY || p_type < IP_Address::TYPE_NONE, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V(p_type > IP::TYPE_ANY || p_type < IP::TYPE_NONE, ERR_INVALID_PARAMETER); - int family = p_type == IP_Address::TYPE_IPV4 ? AF_INET : AF_INET6; + int family = p_type == IP::TYPE_IPV4 ? AF_INET : AF_INET6; int sockfd = socket(family, type, protocol); ERR_FAIL_COND_V( sockfd == -1, -1 ); if(family == AF_INET6) { - // Ensure IPv4 over IPv6 is enabled - int no = 0; - if(setsockopt(sockfd, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&no, sizeof(no)) != 0) { - WARN_PRINT("Unable to set IPv4 address mapping over IPv6"); + // Select IPv4 over IPv6 mapping + int opt = p_type != IP::TYPE_ANY; + if(setsockopt(sockfd, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&opt, sizeof(opt)) != 0) { + WARN_PRINT("Unable to set/unset IPv4 address mapping over IPv6"); } } @@ -80,19 +91,16 @@ static int _socket_create(IP_Address::AddrType p_type, int type, int protocol) { static void _set_ip_addr_port(IP_Address& r_ip, int& r_port, struct sockaddr_storage* p_addr) { if (p_addr->ss_family == AF_INET) { - r_ip.type = IP_Address::TYPE_IPV4; struct sockaddr_in* addr4 = (struct sockaddr_in*)p_addr; - r_ip.field32[0] = (uint32_t)addr4->sin_addr.s_addr; + r_ip.set_ipv4((uint8_t *)&(addr4->sin_addr.s_addr)); r_port = ntohs(addr4->sin_port); } else if (p_addr->ss_family == AF_INET6) { - r_ip.type = IP_Address::TYPE_IPV6; - struct sockaddr_in6* addr6 = (struct sockaddr_in6*)p_addr; - copymem(&addr6->sin6_addr.s6_addr, r_ip.field8, 16); + r_ip.set_ipv6(addr6->sin6_addr.s6_addr); r_port = ntohs(addr6->sin6_port); }; diff --git a/drivers/unix/stream_peer_tcp_posix.cpp b/drivers/unix/stream_peer_tcp_posix.cpp index b1636abd69..f2a1417920 100644 --- a/drivers/unix/stream_peer_tcp_posix.cpp +++ b/drivers/unix/stream_peer_tcp_posix.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -98,7 +98,7 @@ Error StreamPeerTCPPosix::_poll_connection(bool p_block) const { }; struct sockaddr_storage their_addr; - size_t addr_size = _set_sockaddr(&their_addr, peer_host, peer_port); + size_t addr_size = _set_sockaddr(&their_addr, peer_host, peer_port, ip_type); if (::connect(sockfd, (struct sockaddr *)&their_addr,addr_size) == -1) { @@ -107,7 +107,12 @@ Error StreamPeerTCPPosix::_poll_connection(bool p_block) const { return OK; }; - return OK; + if (errno == EINPROGRESS || errno == EALREADY) { + return OK; + } + + status = STATUS_ERROR; + return ERR_CONNECTION_ERROR; } else { status = STATUS_CONNECTED; @@ -117,8 +122,9 @@ Error StreamPeerTCPPosix::_poll_connection(bool p_block) const { return OK; }; -void StreamPeerTCPPosix::set_socket(int p_sockfd, IP_Address p_host, int p_port) { +void StreamPeerTCPPosix::set_socket(int p_sockfd, IP_Address p_host, int p_port, IP::Type p_ip_type) { + ip_type = p_ip_type; sockfd = p_sockfd; #ifndef NO_FCNTL fcntl(sockfd, F_SETFL, O_NONBLOCK); @@ -135,9 +141,9 @@ void StreamPeerTCPPosix::set_socket(int p_sockfd, IP_Address p_host, int p_port) Error StreamPeerTCPPosix::connect(const IP_Address& p_host, uint16_t p_port) { - ERR_FAIL_COND_V( p_host.type == IP_Address::TYPE_NONE, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V( p_host == IP_Address(), ERR_INVALID_PARAMETER); - sockfd = _socket_create(p_host.type, SOCK_STREAM, IPPROTO_TCP); + sockfd = _socket_create(ip_type, SOCK_STREAM, IPPROTO_TCP); if (sockfd == -1) { ERR_PRINT("Socket creation failed!"); disconnect(); @@ -153,7 +159,7 @@ Error StreamPeerTCPPosix::connect(const IP_Address& p_host, uint16_t p_port) { #endif struct sockaddr_storage their_addr; - size_t addr_size = _set_sockaddr(&their_addr, p_host, p_port); + size_t addr_size = _set_sockaddr(&their_addr, p_host, p_port, ip_type); errno = 0; if (::connect(sockfd, (struct sockaddr *)&their_addr,addr_size) == -1 && errno != EINPROGRESS) { @@ -387,6 +393,7 @@ StreamPeerTCPPosix::StreamPeerTCPPosix() { sockfd = -1; status = STATUS_NONE; peer_port = 0; + ip_type = IP::TYPE_ANY; }; StreamPeerTCPPosix::~StreamPeerTCPPosix() { diff --git a/drivers/unix/stream_peer_tcp_posix.h b/drivers/unix/stream_peer_tcp_posix.h index a379efe3ca..1df509cac4 100644 --- a/drivers/unix/stream_peer_tcp_posix.h +++ b/drivers/unix/stream_peer_tcp_posix.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -69,7 +69,7 @@ public: virtual int get_available_bytes() const; - void set_socket(int p_sockfd, IP_Address p_host, int p_port); + void set_socket(int p_sockfd, IP_Address p_host, int p_port, IP::Type p_ip_type); virtual IP_Address get_connected_host() const; virtual uint16_t get_connected_port() const; diff --git a/drivers/unix/tcp_server_posix.cpp b/drivers/unix/tcp_server_posix.cpp index 7028c1a107..0178f08b8c 100644 --- a/drivers/unix/tcp_server_posix.cpp +++ b/drivers/unix/tcp_server_posix.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -68,20 +68,13 @@ void TCPServerPosix::make_default() { TCP_Server::_create = TCPServerPosix::_create; }; -Error TCPServerPosix::listen(uint16_t p_port, IP_Address::AddrType p_type, const List<String> *p_accepted_hosts) { +Error TCPServerPosix::listen(uint16_t p_port,const List<String> *p_accepted_hosts) { int sockfd; - sockfd = _socket_create(p_type, SOCK_STREAM, IPPROTO_TCP); + sockfd = _socket_create(ip_type, SOCK_STREAM, IPPROTO_TCP); ERR_FAIL_COND_V(sockfd == -1, FAILED); - if(p_type == IP_Address::TYPE_IPV6) { - // Use IPv6 only socket - int yes = 1; - if(setsockopt(sockfd, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&yes, sizeof(yes)) != 0) { - WARN_PRINT("Unable to unset IPv4 address mapping over IPv6"); - } - } #ifndef NO_FCNTL fcntl(sockfd, F_SETFL, O_NONBLOCK); #else @@ -95,7 +88,7 @@ Error TCPServerPosix::listen(uint16_t p_port, IP_Address::AddrType p_type, const } struct sockaddr_storage addr; - size_t addr_size = _set_listen_sockaddr(&addr, p_port, p_type, p_accepted_hosts); + size_t addr_size = _set_listen_sockaddr(&addr, p_port, ip_type, p_accepted_hosts); // automatically fill with my IP TODO: use p_accepted_hosts @@ -164,7 +157,7 @@ Ref<StreamPeerTCP> TCPServerPosix::take_connection() { int port; _set_ip_addr_port(ip, port, &their_addr); - conn->set_socket(fd, ip, port); + conn->set_socket(fd, ip, port, ip_type); return conn; }; @@ -183,6 +176,7 @@ void TCPServerPosix::stop() { TCPServerPosix::TCPServerPosix() { listen_sockfd = -1; + ip_type = IP::TYPE_ANY; }; TCPServerPosix::~TCPServerPosix() { diff --git a/drivers/unix/tcp_server_posix.h b/drivers/unix/tcp_server_posix.h index a700b6ae0e..6f9fa8cb5b 100644 --- a/drivers/unix/tcp_server_posix.h +++ b/drivers/unix/tcp_server_posix.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -40,7 +40,7 @@ class TCPServerPosix : public TCP_Server { public: - virtual Error listen(uint16_t p_port, IP_Address::AddrType p_type, const List<String> *p_accepted_hosts=NULL); + virtual Error listen(uint16_t p_port,const List<String> *p_accepted_hosts=NULL); virtual bool is_connection_available() const; virtual Ref<StreamPeerTCP> take_connection(); diff --git a/drivers/unix/thread_posix.cpp b/drivers/unix/thread_posix.cpp index c71e09685b..ecea67c37b 100644 --- a/drivers/unix/thread_posix.cpp +++ b/drivers/unix/thread_posix.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/unix/thread_posix.h b/drivers/unix/thread_posix.h index 06a17c2ae6..cf360e164a 100644 --- a/drivers/unix/thread_posix.h +++ b/drivers/unix/thread_posix.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp index 00d9afe51e..c7082dbc7c 100644 --- a/drivers/windows/dir_access_windows.cpp +++ b/drivers/windows/dir_access_windows.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/windows/dir_access_windows.h b/drivers/windows/dir_access_windows.h index 6861291fd9..4d9fdd08e2 100644 --- a/drivers/windows/dir_access_windows.h +++ b/drivers/windows/dir_access_windows.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -44,7 +44,7 @@ struct DirAccessWindowsPrivate; class DirAccessWindows : public DirAccess { enum { - MAX_DRIVES=25 + MAX_DRIVES=26 }; diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp index 00e54e2b3e..183cec96ec 100644 --- a/drivers/windows/file_access_windows.cpp +++ b/drivers/windows/file_access_windows.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -28,8 +28,6 @@ /*************************************************************************/ #ifdef WINDOWS_ENABLED -#define WINVER 0x0500 - #include <windows.h> #include "shlwapi.h" #include "file_access_windows.h" diff --git a/drivers/windows/file_access_windows.h b/drivers/windows/file_access_windows.h index b02b6f66a7..9f06918b72 100644 --- a/drivers/windows/file_access_windows.h +++ b/drivers/windows/file_access_windows.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/windows/mutex_windows.cpp b/drivers/windows/mutex_windows.cpp index f533626c30..6ae7e52124 100644 --- a/drivers/windows/mutex_windows.cpp +++ b/drivers/windows/mutex_windows.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/windows/mutex_windows.h b/drivers/windows/mutex_windows.h index 4cff027906..4202735f2b 100644 --- a/drivers/windows/mutex_windows.h +++ b/drivers/windows/mutex_windows.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/windows/rw_lock_windows.cpp b/drivers/windows/rw_lock_windows.cpp new file mode 100644 index 0000000000..0da7bf4bd5 --- /dev/null +++ b/drivers/windows/rw_lock_windows.cpp @@ -0,0 +1,72 @@ + +#if defined(WINDOWS_ENABLED) + +#include "os/memory.h" +#include "rw_lock_windows.h" +#include "error_macros.h" +#include <stdio.h> + +void RWLockWindows::read_lock() { + + AcquireSRWLockShared(&lock); + +} + +void RWLockWindows::read_unlock() { + + ReleaseSRWLockShared(&lock); +} + +Error RWLockWindows::read_try_lock() { + + if (TryAcquireSRWLockShared(&lock)==0) { + return ERR_BUSY; + } else { + return OK; + } + +} + +void RWLockWindows::write_lock() { + + AcquireSRWLockExclusive(&lock); + +} + +void RWLockWindows::write_unlock() { + + ReleaseSRWLockExclusive(&lock); +} + +Error RWLockWindows::write_try_lock() { + if (TryAcquireSRWLockExclusive(&lock)==0) { + return ERR_BUSY; + } else { + return OK; + } +} + + +RWLock *RWLockWindows::create_func_windows() { + + return memnew( RWLockWindows ); +} + +void RWLockWindows::make_default() { + + create_func=create_func_windows; +} + + +RWLockWindows::RWLockWindows() { + + InitializeSRWLock(&lock); +} + + +RWLockWindows::~RWLockWindows() { + + +} + +#endif diff --git a/drivers/windows/rw_lock_windows.h b/drivers/windows/rw_lock_windows.h new file mode 100644 index 0000000000..c089c31c33 --- /dev/null +++ b/drivers/windows/rw_lock_windows.h @@ -0,0 +1,37 @@ +#ifndef RWLOCKWINDOWS_H +#define RWLOCKWINDOWS_H + +#if defined(WINDOWS_ENABLED) + +#include <windows.h> +#include "os/rw_lock.h" + +class RWLockWindows : public RWLock { + + + SRWLOCK lock; + + static RWLock *create_func_windows(); + +public: + + virtual void read_lock(); + virtual void read_unlock(); + virtual Error read_try_lock(); + + virtual void write_lock(); + virtual void write_unlock(); + virtual Error write_try_lock(); + + static void make_default(); + + RWLockWindows(); + + ~RWLockWindows(); + +}; + +#endif + + +#endif // RWLOCKWINDOWS_H diff --git a/drivers/windows/semaphore_windows.cpp b/drivers/windows/semaphore_windows.cpp index 5ea98f341f..cdd1a7b888 100644 --- a/drivers/windows/semaphore_windows.cpp +++ b/drivers/windows/semaphore_windows.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/windows/semaphore_windows.h b/drivers/windows/semaphore_windows.h index e8836e49dc..564087a691 100644 --- a/drivers/windows/semaphore_windows.h +++ b/drivers/windows/semaphore_windows.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/windows/shell_windows.cpp b/drivers/windows/shell_windows.cpp index 283a453be1..a96bc6a7db 100644 --- a/drivers/windows/shell_windows.cpp +++ b/drivers/windows/shell_windows.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/windows/shell_windows.h b/drivers/windows/shell_windows.h index 6f97964a09..92203df98a 100644 --- a/drivers/windows/shell_windows.h +++ b/drivers/windows/shell_windows.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/windows/thread_windows.cpp b/drivers/windows/thread_windows.cpp index 2056113412..dbe2f93fd4 100644 --- a/drivers/windows/thread_windows.cpp +++ b/drivers/windows/thread_windows.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/windows/thread_windows.h b/drivers/windows/thread_windows.h index 1c90504dde..c8f395e062 100644 --- a/drivers/windows/thread_windows.h +++ b/drivers/windows/thread_windows.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/xaudio2/audio_driver_xaudio2.cpp b/drivers/xaudio2/audio_driver_xaudio2.cpp index c7a8962102..5be857164c 100644 --- a/drivers/xaudio2/audio_driver_xaudio2.cpp +++ b/drivers/xaudio2/audio_driver_xaudio2.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/drivers/xaudio2/audio_driver_xaudio2.h b/drivers/xaudio2/audio_driver_xaudio2.h index 1c6a90500d..ad880b24d5 100644 --- a/drivers/xaudio2/audio_driver_xaudio2.h +++ b/drivers/xaudio2/audio_driver_xaudio2.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/main/SCsub b/main/SCsub index a83563f44d..a09b7c4396 100644 --- a/main/SCsub +++ b/main/SCsub @@ -7,6 +7,8 @@ env.add_source_files(env.main_sources, "*.cpp") Export('env') +SConscript('tests/SCsub') + lib = env.Library("main", env.main_sources) env.Prepend(LIBS=[lib]) diff --git a/main/input_default.cpp b/main/input_default.cpp index 0995f7132d..6f27bcdc5a 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -126,16 +126,16 @@ bool InputDefault::is_action_pressed(const StringName& p_action) const{ if(mouse_button_mask&(1<<iemb.button_index)) return true; } break; - case InputEvent::JOYSTICK_BUTTON: { + case InputEvent::JOYPAD_BUTTON: { - const InputEventJoystickButton &iejb=E->get().joy_button; + const InputEventJoypadButton &iejb=E->get().joy_button; int c = _combine_device(iejb.button_index,device); if (joy_buttons_pressed.has(c)) return true; } break; - case InputEvent::JOYSTICK_MOTION: { + case InputEvent::JOYPAD_MOTION: { - const InputEventJoystickMotion &iejm=E->get().joy_motion; + const InputEventJoypadMotion &iejm=E->get().joy_motion; int c = _combine_device(iejm.axis,device); if (_joy_axis.has(c)) { if (iejm.axis_value < 0) { @@ -235,7 +235,7 @@ static String _hex_str(uint8_t p_byte) { void InputDefault::joy_connection_changed(int p_idx, bool p_connected, String p_name, String p_guid) { _THREAD_SAFE_METHOD_ - Joystick js; + Joypad js; js.name = p_connected ? p_name : ""; js.uid = p_connected ? p_guid : ""; js.mapping = -1; @@ -356,7 +356,7 @@ void InputDefault::parse_input_event(const InputEvent& p_event) { } } break; - case InputEvent::JOYSTICK_BUTTON: { + case InputEvent::JOYPAD_BUTTON: { int c = _combine_device(p_event.joy_button.button_index,p_event.device); @@ -365,7 +365,7 @@ void InputDefault::parse_input_event(const InputEvent& p_event) { else joy_buttons_pressed.erase(c); } break; - case InputEvent::JOYSTICK_MOTION: { + case InputEvent::JOYPAD_MOTION: { set_joy_axis(p_event.device, p_event.joy_motion.axis, p_event.joy_motion.axis_value); } break; @@ -377,13 +377,13 @@ void InputDefault::parse_input_event(const InputEvent& p_event) { if (InputMap::get_singleton()->event_is_action(p_event,E->key())) { - Action action; - action.fixed_frame=OS::get_singleton()->get_fixed_frames(); - action.idle_frame=OS::get_singleton()->get_idle_frames(); - action.pressed=p_event.is_pressed(); - - action_state[E->key()]=action; - + if(is_action_pressed(E->key()) != p_event.is_pressed()) { + Action action; + action.fixed_frame=OS::get_singleton()->get_fixed_frames(); + action.idle_frame=OS::get_singleton()->get_idle_frames(); + action.pressed=p_event.is_pressed(); + action_state[E->key()]=action; + } } } } @@ -791,7 +791,7 @@ InputDefault::InputDefault() { uint32_t InputDefault::joy_button(uint32_t p_last_id, int p_device, int p_button, bool p_pressed) { _THREAD_SAFE_METHOD_; - Joystick& joy = joy_names[p_device]; + Joypad& joy = joy_names[p_device]; //printf("got button %i, mapping is %i\n", p_button, joy.mapping); if (joy.last_buttons[p_button] == p_pressed) { return p_last_id; @@ -831,7 +831,7 @@ uint32_t InputDefault::joy_axis(uint32_t p_last_id, int p_device, int p_axis, co _THREAD_SAFE_METHOD_; - Joystick& joy = joy_names[p_device]; + Joypad& joy = joy_names[p_device]; if (joy.last_axis[p_axis] == p_value.value) { return p_last_id; @@ -935,7 +935,7 @@ uint32_t InputDefault::joy_axis(uint32_t p_last_id, int p_device, int p_axis, co uint32_t InputDefault::joy_hat(uint32_t p_last_id, int p_device, int p_val) { _THREAD_SAFE_METHOD_; - const Joystick& joy = joy_names[p_device]; + const Joypad& joy = joy_names[p_device]; JoyEvent* map; @@ -969,7 +969,7 @@ uint32_t InputDefault::joy_hat(uint32_t p_last_id, int p_device, int p_val) { uint32_t InputDefault::_button_event(uint32_t p_last_id, int p_device, int p_index, bool p_pressed) { InputEvent ievent; - ievent.type = InputEvent::JOYSTICK_BUTTON; + ievent.type = InputEvent::JOYPAD_BUTTON; ievent.device = p_device; ievent.ID = ++p_last_id; ievent.joy_button.button_index = p_index; @@ -983,7 +983,7 @@ uint32_t InputDefault::_button_event(uint32_t p_last_id, int p_device, int p_ind uint32_t InputDefault::_axis_event(uint32_t p_last_id, int p_device, int p_axis, float p_value) { InputEvent ievent; - ievent.type = InputEvent::JOYSTICK_MOTION; + ievent.type = InputEvent::JOYPAD_MOTION; ievent.device = p_device; ievent.ID = ++p_last_id; ievent.joy_motion.axis = p_axis; @@ -1148,9 +1148,9 @@ String InputDefault::get_joy_guid_remapped(int p_device) const { return joy_names[p_device].uid; } -Array InputDefault::get_connected_joysticks() { +Array InputDefault::get_connected_joypads() { Array ret; - Map<int, Joystick>::Element *elem = joy_names.front(); + Map<int, Joypad>::Element *elem = joy_names.front(); while (elem) { if (elem->get().connected) { ret.push_back(elem->key()); diff --git a/main/input_default.h b/main/input_default.h index 2db6d28abf..33a852ab10 100644 --- a/main/input_default.h +++ b/main/input_default.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class InputDefault : public Input { - OBJ_TYPE( InputDefault, Input ); + GDCLASS( InputDefault, Input ); _THREAD_SAFE_CLASS_ int mouse_button_mask; @@ -84,7 +84,7 @@ class InputDefault : public Input { SpeedTrack(); }; - struct Joystick { + struct Joypad { StringName name; StringName uid; bool connected; @@ -95,7 +95,7 @@ class InputDefault : public Input { int mapping; int hat_current; - Joystick() { + Joypad() { for (int i = 0; i < JOY_AXIS_MAX; i++) { @@ -114,7 +114,7 @@ class InputDefault : public Input { }; SpeedTrack mouse_speed_track; - Map<int, Joystick> joy_names; + Map<int, Joypad> joy_names; int fallback_mapping; RES custom_cursor; public: @@ -184,12 +184,12 @@ public: virtual float get_joy_axis(int p_device,int p_axis) const; String get_joy_name(int p_idx); - virtual Array get_connected_joysticks(); + virtual Array get_connected_joypads(); virtual Vector2 get_joy_vibration_strength(int p_device); virtual float get_joy_vibration_duration(int p_device); virtual uint64_t get_joy_vibration_timestamp(int p_device); void joy_connection_changed(int p_idx, bool p_connected, String p_name, String p_guid = ""); - void parse_joystick_mapping(String p_mapping, bool p_update_existing); + void parse_joypad_mapping(String p_mapping, bool p_update_existing); virtual Vector3 get_accelerometer() const; virtual Vector3 get_magnetometer() const; diff --git a/main/main.cpp b/main/main.cpp index 6c840a6c23..8d8aa9b5cb 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -47,7 +47,7 @@ #include "script_language.h" #include "io/resource_loader.h" -#include "bin/tests/test_main.h" +#include "main/tests/test_main.h" #include "os/dir_access.h" #include "core/io/ip.h" #include "scene/resources/packed_scene.h" @@ -78,7 +78,7 @@ #include "main/input_default.h" #include "performance.h" -static Globals *globals=NULL; +static GlobalConfig *globals=NULL; static InputMap *input_map=NULL; static bool _start_success=false; static ScriptDebugger *script_debugger=NULL; @@ -127,7 +127,7 @@ static String unescape_cmdline(const String& p_str) { void Main::print_help(const char* p_binary) { - OS::get_singleton()->print(VERSION_FULL_NAME" (c) 2008-2016 Juan Linietsky, Ariel Manzur.\n"); + OS::get_singleton()->print(VERSION_FULL_NAME" (c) 2008-2017 Juan Linietsky, Ariel Manzur.\n"); OS::get_singleton()->print("Usage: %s [options] [scene]\n",p_binary); OS::get_singleton()->print("Options:\n"); OS::get_singleton()->print("\t-path [dir] : Path to a game, containing engine.cfg\n"); @@ -195,7 +195,7 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas RID_OwnerBase::init_rid(); OS::get_singleton()->initialize_core(); - ObjectTypeDB::init(); + ClassDB::init(); MAIN_PRINT("Main: Initialize CORE"); @@ -207,14 +207,15 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas Thread::_main_thread_id = Thread::get_caller_ID(); - globals = memnew( Globals ); + globals = memnew( GlobalConfig ); input_map = memnew( InputMap ); + register_core_settings(); //here globals is present path_remap = memnew( PathRemap ); translation_server = memnew( TranslationServer ); performance = memnew( Performance ); - globals->add_singleton(Globals::Singleton("Performance",performance)); + globals->add_singleton(GlobalConfig::Singleton("Performance",performance)); MAIN_PRINT("Main: Parse CMDLine"); @@ -538,7 +539,7 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas if (I->next()) { - Globals::get_singleton()->set("editor_scene",game_path=I->next()->get()); + GlobalConfig::get_singleton()->set("editor_scene",game_path=I->next()->get()); } else { goto error; @@ -562,7 +563,7 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas if (I->next()) { int editor_pid=I->next()->get().to_int(); - Globals::get_singleton()->set("editor_pid",editor_pid); + GlobalConfig::get_singleton()->set("editor_pid",editor_pid); N=I->next()->next(); } else { goto error; @@ -592,11 +593,13 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas } - GLOBAL_DEF("debug/max_remote_stdout_chars_per_second",2048); + GLOBAL_DEF("network/debug/max_remote_stdout_chars_per_second",2048); + GLOBAL_DEF("network/debug/remote_port",6007); + if (debug_mode == "remote") { ScriptDebuggerRemote *sdr = memnew( ScriptDebuggerRemote ); - uint16_t debug_port = GLOBAL_DEF("debug/remote_port",6007); + uint16_t debug_port = GLOBAL_GET("network/debug/remote_port"); if (debug_host.find(":")!=-1) { debug_port=debug_host.get_slicec(':',1).to_int(); debug_host=debug_host.get_slicec(':',0); @@ -614,6 +617,7 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas } + FileAccessNetwork::configure(); if (remotefs!="") { @@ -678,10 +682,10 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas use_custom_res=false; } - if (bool(Globals::get_singleton()->get("application/disable_stdout"))) { + if (bool(GlobalConfig::get_singleton()->get("application/disable_stdout"))) { quiet_stdout=true; } - if (bool(Globals::get_singleton()->get("application/disable_stderr"))) { + if (bool(GlobalConfig::get_singleton()->get("application/disable_stderr"))) { _print_error_enabled = false; }; @@ -692,7 +696,7 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas #ifdef TOOLS_ENABLED - if (main_args.size()==0 && (!Globals::get_singleton()->has("application/main_loop_type")) && (!Globals::get_singleton()->has("application/main_scene") || String(Globals::get_singleton()->get("application/main_scene"))=="")) + if (main_args.size()==0 && (!GlobalConfig::get_singleton()->has("application/main_loop_type")) && (!GlobalConfig::get_singleton()->has("application/main_scene") || String(GlobalConfig::get_singleton()->get("application/main_scene"))=="")) use_custom_res=false; //project manager (run without arguments) #endif @@ -703,25 +707,25 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas input_map->load_from_globals(); //keys for game if (video_driver=="") // specified in engine.cfg - video_driver=_GLOBAL_DEF("display/driver",Variant((const char*)OS::get_singleton()->get_video_driver_name(0))); + video_driver=_GLOBAL_DEF("display/driver/name",Variant((const char*)OS::get_singleton()->get_video_driver_name(0))); - if (!force_res && use_custom_res && globals->has("display/width")) - video_mode.width=globals->get("display/width"); - if (!force_res &&use_custom_res && globals->has("display/height")) - video_mode.height=globals->get("display/height"); - if (!editor && (!bool(globals->get("display/allow_hidpi")) || force_lowdpi)) { + if (!force_res && use_custom_res && globals->has("display/window/width")) + video_mode.width=globals->get("display/window/width"); + if (!force_res &&use_custom_res && globals->has("display/window/height")) + video_mode.height=globals->get("display/window/height"); + if (!editor && (!bool(globals->get("display/window/allow_hidpi")) || force_lowdpi)) { OS::get_singleton()->_allow_hidpi=false; } - if (use_custom_res && globals->has("display/fullscreen")) - video_mode.fullscreen=globals->get("display/fullscreen"); - if (use_custom_res && globals->has("display/resizable")) - video_mode.resizable=globals->get("display/resizable"); - if (use_custom_res && globals->has("display/borderless_window")) - video_mode.borderless_window = globals->get("display/borderless_window"); - - if (!force_res && use_custom_res && globals->has("display/test_width") && globals->has("display/test_height")) { - int tw = globals->get("display/test_width"); - int th = globals->get("display/test_height"); + if (use_custom_res && globals->has("display/window/fullscreen")) + video_mode.fullscreen=globals->get("display/window/fullscreen"); + if (use_custom_res && globals->has("display/window/resizable")) + video_mode.resizable=globals->get("display/window/resizable"); + if (use_custom_res && globals->has("display/window/borderless")) + video_mode.borderless_window = globals->get("display/window/borderless"); + + if (!force_res && use_custom_res && globals->has("display/window/test_width") && globals->has("display/window/test_height")) { + int tw = globals->get("display/window/test_width"); + int th = globals->get("display/window/test_height"); if (tw>0 && th>0) { video_mode.width=tw; video_mode.height=th; @@ -729,19 +733,19 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas } - GLOBAL_DEF("display/width",video_mode.width); - GLOBAL_DEF("display/height",video_mode.height); - GLOBAL_DEF("display/allow_hidpi",false); - GLOBAL_DEF("display/fullscreen",video_mode.fullscreen); - GLOBAL_DEF("display/resizable",video_mode.resizable); - GLOBAL_DEF("display/borderless_window", video_mode.borderless_window); - use_vsync = GLOBAL_DEF("display/use_vsync", use_vsync); - GLOBAL_DEF("display/test_width",0); - GLOBAL_DEF("display/test_height",0); - OS::get_singleton()->_pixel_snap=GLOBAL_DEF("display/use_2d_pixel_snap",false); - OS::get_singleton()->_keep_screen_on=GLOBAL_DEF("display/keep_screen_on",true); + GLOBAL_DEF("display/window/width",video_mode.width); + GLOBAL_DEF("display/window/height",video_mode.height); + GLOBAL_DEF("display/window/allow_hidpi",false); + GLOBAL_DEF("display/window/fullscreen",video_mode.fullscreen); + GLOBAL_DEF("display/window/resizable",video_mode.resizable); + GLOBAL_DEF("display/window/borderless", video_mode.borderless_window); + use_vsync = GLOBAL_DEF("display/window/use_vsync", use_vsync); + GLOBAL_DEF("display/window/test_width",0); + GLOBAL_DEF("display/window/test_height",0); + OS::get_singleton()->_pixel_snap=GLOBAL_DEF("rendering/2d/use_pixel_snap",false); + OS::get_singleton()->_keep_screen_on=GLOBAL_DEF("display/energy_saving/keep_screen_on",true); if (rtm==-1) { - rtm=GLOBAL_DEF("render/thread_model",OS::RENDER_THREAD_SAFE); + rtm=GLOBAL_DEF("rendering/threads/thread_model",OS::RENDER_THREAD_SAFE); if (rtm>=1) //hack for now rtm=1; @@ -796,7 +800,7 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas } { - String orientation = GLOBAL_DEF("display/orientation","landscape"); + String orientation = GLOBAL_DEF("display/handheld/orientation","landscape"); if (orientation=="portrait") OS::get_singleton()->set_screen_orientation(OS::SCREEN_PORTRAIT); @@ -815,11 +819,13 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas } - OS::get_singleton()->set_iterations_per_second(GLOBAL_DEF("physics/fixed_fps",60)); - OS::get_singleton()->set_target_fps(GLOBAL_DEF("debug/force_fps",0)); + OS::get_singleton()->set_iterations_per_second(GLOBAL_DEF("physics/common/fixed_fps",60)); + OS::get_singleton()->set_target_fps(GLOBAL_DEF("debug/fps/force_fps",0)); + + GLOBAL_DEF("debug/stdout/print_fps", OS::get_singleton()->is_stdout_verbose()); if (!OS::get_singleton()->_verbose_stdout) //overrided - OS::get_singleton()->_verbose_stdout=GLOBAL_DEF("debug/verbose_stdout",false); + OS::get_singleton()->_verbose_stdout=GLOBAL_DEF("debug/stdout/verbose_stdout",false); if (frame_delay==0) { frame_delay=GLOBAL_DEF("application/frame_delay_msec",0); @@ -829,7 +835,7 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas message_queue = memnew( MessageQueue ); - Globals::get_singleton()->register_global_defaults(); + GlobalConfig::get_singleton()->register_global_defaults(); if (p_second_phase) return setup2(); @@ -918,10 +924,13 @@ Error Main::setup2() { path_remap->load_remaps(); + Color clear = GLOBAL_DEF("rendering/viewport/default_clear_color",Color(0.3,0.3,0.3)); + VisualServer::get_singleton()->set_default_clear_color(clear); + if (show_logo) { //boot logo! String boot_logo_path=GLOBAL_DEF("application/boot_splash",String()); bool boot_logo_scale=GLOBAL_DEF("application/boot_splash_fullsize",true); - Globals::get_singleton()->set_custom_property_info("application/boot_splash",PropertyInfo(Variant::STRING,"application/boot_splash",PROPERTY_HINT_FILE,"*.png")); + GlobalConfig::get_singleton()->set_custom_property_info("application/boot_splash",PropertyInfo(Variant::STRING,"application/boot_splash",PROPERTY_HINT_FILE,"*.png")); Image boot_logo; @@ -936,13 +945,11 @@ Error Main::setup2() { if (!boot_logo.empty()) { OS::get_singleton()->_msec_splash=OS::get_singleton()->get_ticks_msec(); - Color clear = GLOBAL_DEF("render/default_clear_color",Color(0.3,0.3,0.3)); - VisualServer::get_singleton()->set_default_clear_color(clear); Color boot_bg = GLOBAL_DEF("application/boot_bg_color", clear); VisualServer::get_singleton()->set_boot_image(boot_logo, boot_bg,boot_logo_scale); #ifndef TOOLS_ENABLED //no tools, so free the boot logo (no longer needed) - // Globals::get_singleton()->set("application/boot_logo",Image()); + // GlobalConfig::get_singleton()->set("application/boot_logo",Image()); #endif } else { @@ -963,13 +970,13 @@ Error Main::setup2() { } MAIN_PRINT("Main: DCC"); - VisualServer::get_singleton()->set_default_clear_color(GLOBAL_DEF("render/default_clear_color",Color(0.3,0.3,0.3))); + VisualServer::get_singleton()->set_default_clear_color(GLOBAL_DEF("rendering/viewport/default_clear_color",Color(0.3,0.3,0.3))); MAIN_PRINT("Main: END"); GLOBAL_DEF("application/icon",String()); - Globals::get_singleton()->set_custom_property_info("application/icon",PropertyInfo(Variant::STRING,"application/icon",PROPERTY_HINT_FILE,"*.png,*.webp")); + GlobalConfig::get_singleton()->set_custom_property_info("application/icon",PropertyInfo(Variant::STRING,"application/icon",PROPERTY_HINT_FILE,"*.png,*.webp")); - if (bool(GLOBAL_DEF("display/emulate_touchscreen",false))) { + if (bool(GLOBAL_DEF("display/handheld/emulate_touchscreen",false))) { if (!OS::get_singleton()->has_touchscreen_ui_hint() && Input::get_singleton() && !editor) { //only if no touchscreen ui hint, set emulation InputDefault *id = Input::get_singleton()->cast_to<InputDefault>(); @@ -987,25 +994,25 @@ Error Main::setup2() { register_scene_types(); register_server_types(); - GLOBAL_DEF("display/custom_mouse_cursor",String()); - GLOBAL_DEF("display/custom_mouse_cursor_hotspot",Vector2()); - Globals::get_singleton()->set_custom_property_info("display/custom_mouse_cursor",PropertyInfo(Variant::STRING,"display/custom_mouse_cursor",PROPERTY_HINT_FILE,"*.png,*.webp")); + GLOBAL_DEF("display/mouse_cursor/custom_image",String()); + GLOBAL_DEF("display/mouse_cursor/custom_image_hotspot",Vector2()); + GlobalConfig::get_singleton()->set_custom_property_info("display/mouse_cursor/custom_image",PropertyInfo(Variant::STRING,"display/mouse_cursor/custom_image",PROPERTY_HINT_FILE,"*.png,*.webp")); - if (String(Globals::get_singleton()->get("display/custom_mouse_cursor"))!=String()) { + if (String(GlobalConfig::get_singleton()->get("display/mouse_cursor/custom_image"))!=String()) { //print_line("use custom cursor"); - Ref<Texture> cursor=ResourceLoader::load(Globals::get_singleton()->get("display/custom_mouse_cursor")); + Ref<Texture> cursor=ResourceLoader::load(GlobalConfig::get_singleton()->get("display/mouse_cursor/custom_image")); if (cursor.is_valid()) { // print_line("loaded ok"); - Vector2 hotspot = Globals::get_singleton()->get("display/custom_mouse_cursor_hotspot"); + Vector2 hotspot = GlobalConfig::get_singleton()->get("display/mouse_cursor/custom_image_hotspot"); Input::get_singleton()->set_custom_mouse_cursor(cursor,hotspot); } } #ifdef TOOLS_ENABLED - ObjectTypeDB::set_current_api(ObjectTypeDB::API_EDITOR); + ClassDB::set_current_api(ClassDB::API_EDITOR); EditorNode::register_editor_types(); - ObjectTypeDB::set_current_api(ObjectTypeDB::API_CORE); + ClassDB::set_current_api(ClassDB::API_CORE); #endif @@ -1033,8 +1040,12 @@ Error Main::setup2() { _start_success=true; locale=String(); - ObjectTypeDB::set_current_api(ObjectTypeDB::API_NONE); //no more api is registered at this point + ClassDB::set_current_api(ClassDB::API_NONE); //no more api is registered at this point + if (OS::get_singleton()->is_stdout_verbose()) { + print_line("CORE API HASH: "+itos(ClassDB::get_api_hash(ClassDB::API_CORE))); + print_line("EDITOR API HASH: "+itos(ClassDB::get_api_hash(ClassDB::API_EDITOR))); + } MAIN_PRINT("Main: Done"); return OK; @@ -1118,8 +1129,7 @@ bool Main::start() { } } - if (editor) - Globals::get_singleton()->set("editor_active",true); + GLOBAL_DEF("editor/active",editor); String main_loop_type; @@ -1190,7 +1200,7 @@ bool Main::start() { StringName instance_type=script_res->get_instance_base_type(); - Object *obj = ObjectTypeDB::instance(instance_type); + Object *obj = ClassDB::instance(instance_type); MainLoop *script_loop = obj?obj->cast_to<MainLoop>():NULL; if (!script_loop) { if (obj) @@ -1215,12 +1225,12 @@ bool Main::start() { main_loop_type="SceneTree"; if (!main_loop) { - if (!ObjectTypeDB::type_exists(main_loop_type)) { + if (!ClassDB::class_exists(main_loop_type)) { OS::get_singleton()->alert("godot: error: MainLoop type doesn't exist: "+main_loop_type); return false; } else { - Object *ml = ObjectTypeDB::instance(main_loop_type); + Object *ml = ClassDB::instance(main_loop_type); if (!ml) { ERR_EXPLAIN("Can't instance MainLoop type"); ERR_FAIL_V(false); @@ -1237,7 +1247,7 @@ bool Main::start() { } } - if (main_loop->is_type("SceneTree")) { + if (main_loop->is_class("SceneTree")) { SceneTree *sml = main_loop->cast_to<SceneTree>(); @@ -1270,9 +1280,9 @@ bool Main::start() { if (!editor) { //standard helpers that can be changed from main config - String stretch_mode = GLOBAL_DEF("display/stretch_mode","disabled"); - String stretch_aspect = GLOBAL_DEF("display/stretch_aspect","ignore"); - Size2i stretch_size = Size2(GLOBAL_DEF("display/width",0),GLOBAL_DEF("display/height",0)); + String stretch_mode = GLOBAL_DEF("display/stretch/mode","disabled"); + String stretch_aspect = GLOBAL_DEF("display/stretch/aspect","ignore"); + Size2i stretch_size = Size2(GLOBAL_DEF("display/screen/width",0),GLOBAL_DEF("display/screen/height",0)); SceneTree::StretchMode sml_sm=SceneTree::STRETCH_MODE_DISABLED; if (stretch_mode=="2d") @@ -1291,19 +1301,40 @@ bool Main::start() { sml->set_screen_stretch(sml_sm,sml_aspect,stretch_size); sml->set_auto_accept_quit(GLOBAL_DEF("application/auto_accept_quit",true)); - String appname = Globals::get_singleton()->get("application/name"); + String appname = GlobalConfig::get_singleton()->get("application/name"); appname = TranslationServer::get_singleton()->translate(appname); OS::get_singleton()->set_window_title(appname); + int shadow_atlas_size = GLOBAL_DEF("rendering/shadow_atlas/size",2048); + int shadow_atlas_q0_subdiv = GLOBAL_DEF("rendering/shadow_atlas/quadrant_0_subdiv",2); + int shadow_atlas_q1_subdiv = GLOBAL_DEF("rendering/shadow_atlas/quadrant_1_subdiv",2); + int shadow_atlas_q2_subdiv = GLOBAL_DEF("rendering/shadow_atlas/quadrant_2_subdiv",3); + int shadow_atlas_q3_subdiv = GLOBAL_DEF("rendering/shadow_atlas/quadrant_3_subdiv",4); + + sml->get_root()->set_shadow_atlas_size(shadow_atlas_size); + sml->get_root()->set_shadow_atlas_quadrant_subdiv(0,Viewport::ShadowAtlasQuadrantSubdiv(shadow_atlas_q0_subdiv)); + sml->get_root()->set_shadow_atlas_quadrant_subdiv(1,Viewport::ShadowAtlasQuadrantSubdiv(shadow_atlas_q1_subdiv)); + sml->get_root()->set_shadow_atlas_quadrant_subdiv(2,Viewport::ShadowAtlasQuadrantSubdiv(shadow_atlas_q2_subdiv)); + sml->get_root()->set_shadow_atlas_quadrant_subdiv(3,Viewport::ShadowAtlasQuadrantSubdiv(shadow_atlas_q3_subdiv)); } else { - GLOBAL_DEF("display/stretch_mode","disabled"); - Globals::get_singleton()->set_custom_property_info("display/stretch_mode",PropertyInfo(Variant::STRING,"display/stretch_mode",PROPERTY_HINT_ENUM,"disabled,2d,viewport")); - GLOBAL_DEF("display/stretch_aspect","ignore"); - Globals::get_singleton()->set_custom_property_info("display/stretch_aspect",PropertyInfo(Variant::STRING,"display/stretch_aspect",PROPERTY_HINT_ENUM,"ignore,keep,keep_width,keep_height")); + GLOBAL_DEF("display/stretch/mode","disabled"); + GlobalConfig::get_singleton()->set_custom_property_info("display/stretch/mode",PropertyInfo(Variant::STRING,"display/stretch/mode",PROPERTY_HINT_ENUM,"disabled,2d,viewport")); + GLOBAL_DEF("display/stretch/aspect","ignore"); + GlobalConfig::get_singleton()->set_custom_property_info("display/stretch/aspect",PropertyInfo(Variant::STRING,"display/stretch/aspect",PROPERTY_HINT_ENUM,"ignore,keep,keep_width,keep_height")); sml->set_auto_accept_quit(GLOBAL_DEF("application/auto_accept_quit",true)); - + GLOBAL_DEF("rendering/shadow_atlas/size",2048); + GlobalConfig::get_singleton()->set_custom_property_info("rendering/shadow_atlas/size",PropertyInfo(Variant::INT,"rendering/shadow_atlas/size",PROPERTY_HINT_RANGE,"256,16384")); + + GLOBAL_DEF("rendering/shadow_atlas/quadrant_0_subdiv",2); + GLOBAL_DEF("rendering/shadow_atlas/quadrant_1_subdiv",2); + GLOBAL_DEF("rendering/shadow_atlas/quadrant_2_subdiv",3); + GLOBAL_DEF("rendering/shadow_atlas/quadrant_3_subdiv",4); + GlobalConfig::get_singleton()->set_custom_property_info("rendering/shadow_atlas/quadrant_0_subdiv",PropertyInfo(Variant::INT,"rendering/shadow_atlas/quadrant_0_subdiv",PROPERTY_HINT_ENUM,"Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows")); + GlobalConfig::get_singleton()->set_custom_property_info("rendering/shadow_atlas/quadrant_1_subdiv",PropertyInfo(Variant::INT,"rendering/shadow_atlas/quadrant_1_subdiv",PROPERTY_HINT_ENUM,"Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows")); + GlobalConfig::get_singleton()->set_custom_property_info("rendering/shadow_atlas/quadrant_2_subdiv",PropertyInfo(Variant::INT,"rendering/shadow_atlas/quadrant_2_subdiv",PROPERTY_HINT_ENUM,"Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows")); + GlobalConfig::get_singleton()->set_custom_property_info("rendering/shadow_atlas/quadrant_3_subdiv",PropertyInfo(Variant::INT,"rendering/shadow_atlas/quadrant_3_subdiv",PROPERTY_HINT_ENUM,"Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows")); } @@ -1317,7 +1348,7 @@ bool Main::start() { if (!absolute) { - if (Globals::get_singleton()->is_using_datapack()) { + if (GlobalConfig::get_singleton()->is_using_datapack()) { local_game_path="res://"+local_game_path; @@ -1341,7 +1372,7 @@ bool Main::start() { } } - local_game_path=Globals::get_singleton()->localize_path(local_game_path); + local_game_path=GlobalConfig::get_singleton()->localize_path(local_game_path); #ifdef TOOLS_ENABLED if (editor) { @@ -1385,7 +1416,7 @@ bool Main::start() { if (game_path!="" || script!="") { //autoload List<PropertyInfo> props; - Globals::get_singleton()->get_property_list(&props); + GlobalConfig::get_singleton()->get_property_list(&props); //first pass, add the constants so they exist before any script is loaded for(List<PropertyInfo>::Element *E=props.front();E;E=E->next()) { @@ -1394,7 +1425,7 @@ bool Main::start() { if (!s.begins_with("autoload/")) continue; String name = s.get_slicec('/',1); - String path = Globals::get_singleton()->get(s); + String path = GlobalConfig::get_singleton()->get(s); bool global_var=false; if (path.begins_with("*")) { global_var=true; @@ -1416,7 +1447,7 @@ bool Main::start() { if (!s.begins_with("autoload/")) continue; String name = s.get_slicec('/',1); - String path = Globals::get_singleton()->get(s); + String path = GlobalConfig::get_singleton()->get(s); bool global_var=false; if (path.begins_with("*")) { global_var=true; @@ -1427,17 +1458,17 @@ bool Main::start() { ERR_EXPLAIN("Can't autoload: "+path); ERR_CONTINUE(res.is_null()); Node *n=NULL; - if (res->is_type("PackedScene")) { + if (res->is_class("PackedScene")) { Ref<PackedScene> ps = res; n=ps->instance(); - } else if (res->is_type("Script")) { + } else if (res->is_class("Script")) { Ref<Script> s = res; StringName ibt = s->get_instance_base_type(); - bool valid_type = ObjectTypeDB::is_type(ibt,"Node"); + bool valid_type = ClassDB::is_parent_class(ibt,"Node"); ERR_EXPLAIN("Script does not inherit a Node: "+path); ERR_CONTINUE( !valid_type ); - Object *obj = ObjectTypeDB::instance(ibt); + Object *obj = ClassDB::instance(ibt); ERR_EXPLAIN("Cannot instance script for autoload, expected 'Node' inheritance, got: "+String(ibt)); ERR_CONTINUE( obj==NULL ); @@ -1659,7 +1690,7 @@ bool Main::iteration() { if (frame>1000000) { - if (GLOBAL_DEF("debug/print_fps", OS::get_singleton()->is_stdout_verbose())) { + if (GLOBAL_DEF("debug/stdout/print_fps", OS::get_singleton()->is_stdout_verbose())) { print_line("FPS: "+itos(frames)); }; @@ -1669,10 +1700,6 @@ bool Main::iteration() { idle_process_max=0; fixed_process_max=0; - if (GLOBAL_DEF("debug/print_metrics", false)) { - - //PerformanceMetrics::print(); - }; frame%=1000000; frames=0; diff --git a/main/main.h b/main/main.h index bc8b18776e..42c8a984bf 100644 --- a/main/main.h +++ b/main/main.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/main/performance.cpp b/main/performance.cpp index 13ae0504f6..2ca73c6d4b 100644 --- a/main/performance.cpp +++ b/main/performance.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -40,7 +40,7 @@ Performance *Performance::singleton=NULL; void Performance::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_monitor","monitor"),&Performance::get_monitor); + ClassDB::bind_method(_MD("get_monitor","monitor"),&Performance::get_monitor); BIND_CONSTANT( TIME_FPS ); BIND_CONSTANT( TIME_PROCESS ); @@ -121,10 +121,10 @@ float Performance::get_monitor(Monitor p_monitor) const { case TIME_FPS: return OS::get_singleton()->get_frames_per_second(); case TIME_PROCESS: return _process_time; case TIME_FIXED_PROCESS: return _fixed_process_time; - case MEMORY_STATIC: return Memory::get_static_mem_usage(); - case MEMORY_DYNAMIC: return Memory::get_dynamic_mem_usage(); - case MEMORY_STATIC_MAX: return Memory::get_static_mem_max_usage(); - case MEMORY_DYNAMIC_MAX: return Memory::get_dynamic_mem_available(); + case MEMORY_STATIC: return Memory::get_mem_usage(); + case MEMORY_DYNAMIC: return MemoryPool::total_memory; + case MEMORY_STATIC_MAX: return MemoryPool::max_memory; + case MEMORY_DYNAMIC_MAX: return 0; case MEMORY_MESSAGE_BUFFER_MAX: return MessageQueue::get_singleton()->get_max_buffer_usage(); case OBJECT_COUNT: return ObjectDB::get_object_count(); case OBJECT_RESOURCE_COUNT: return ResourceCache::get_cached_resource_count(); diff --git a/main/performance.h b/main/performance.h index 81e42710ca..8b5626b681 100644 --- a/main/performance.h +++ b/main/performance.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ class Performance : public Object { - OBJ_TYPE(Performance,Object); + GDCLASS(Performance,Object); static Performance *singleton; static void _bind_methods(); diff --git a/main/splash.h b/main/splash.h index b96aff8754..3423f1b932 100644 --- a/main/splash.h +++ b/main/splash.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/bin/tests/SCsub b/main/tests/SCsub index 03495c0649..03495c0649 100644 --- a/bin/tests/SCsub +++ b/main/tests/SCsub diff --git a/bin/tests/test_containers.cpp b/main/tests/test_containers.cpp index 4bc297d0ba..4bc297d0ba 100644 --- a/bin/tests/test_containers.cpp +++ b/main/tests/test_containers.cpp diff --git a/bin/tests/test_containers.h b/main/tests/test_containers.h index 72d5c0ff7a..72d5c0ff7a 100644 --- a/bin/tests/test_containers.h +++ b/main/tests/test_containers.h diff --git a/bin/tests/test_gdscript.cpp b/main/tests/test_gdscript.cpp index 43d65f782b..1ee27ec661 100644 --- a/bin/tests/test_gdscript.cpp +++ b/main/tests/test_gdscript.cpp @@ -581,6 +581,28 @@ static void _disassemble_class(const Ref<GDScript>& p_class,const Vector<String> incr+=4; } break; + case GDFunction::OPCODE_SET_MEMBER: { + + txt+=" set_member "; + txt+="[\""; + txt+=func.get_global_name(code[ip+1]); + txt+="\"]="; + txt+=DADDR(2); + incr+=3; + + + } break; + case GDFunction::OPCODE_GET_MEMBER: { + + txt+=" get_member "; + txt+=DADDR(2); + txt+="="; + txt+="[\""; + txt+=func.get_global_name(code[ip+1]); + txt+="\"]"; + incr+=3; + + } break; case GDFunction::OPCODE_ASSIGN: { txt+=" assign "; diff --git a/bin/tests/test_gdscript.h b/main/tests/test_gdscript.h index 225654e2a8..225654e2a8 100644 --- a/bin/tests/test_gdscript.h +++ b/main/tests/test_gdscript.h diff --git a/bin/tests/test_gui.cpp b/main/tests/test_gui.cpp index f4341fd7b3..ab3df3b022 100644 --- a/bin/tests/test_gui.cpp +++ b/main/tests/test_gui.cpp @@ -93,7 +93,7 @@ public: TestCube *testcube = memnew( TestCube ); vp->add_child(testcube); - testcube->set_transform(Transform( Matrix3().rotated(Vector3(0,1,0),Math_PI*0.25), Vector3(0,0,-8))); + testcube->set_transform(Transform( Basis().rotated(Vector3(0,1,0),Math_PI*0.25), Vector3(0,0,-8))); Sprite *sp = memnew( Sprite ); sp->set_texture( vp->get_render_target_texture() ); @@ -370,7 +370,7 @@ public: tabc->set_size( Point2( 180,250 ) ); - Ref<ImageTexture> text = memnew( ImageTexture ); + /*Ref<ImageTexture> text = memnew( ImageTexture ); text->load("test_data/concave.png"); Sprite* sprite = memnew(Sprite); @@ -383,7 +383,7 @@ public: sprite->set_texture(text); sprite->add_child(sprite2); sprite2->set_pos(Point2(50, 50)); - sprite2->show(); + sprite2->show();*/ } diff --git a/bin/tests/test_gui.h b/main/tests/test_gui.h index 5526320b0c..5526320b0c 100644 --- a/bin/tests/test_gui.h +++ b/main/tests/test_gui.h diff --git a/bin/tests/test_image.cpp b/main/tests/test_image.cpp index bf9851cf01..bf9851cf01 100644 --- a/bin/tests/test_image.cpp +++ b/main/tests/test_image.cpp diff --git a/bin/tests/test_image.h b/main/tests/test_image.h index 09b33e799e..09b33e799e 100644 --- a/bin/tests/test_image.h +++ b/main/tests/test_image.h diff --git a/bin/tests/test_io.cpp b/main/tests/test_io.cpp index a8e8d7d0fd..42664e73cd 100644 --- a/bin/tests/test_io.cpp +++ b/main/tests/test_io.cpp @@ -101,10 +101,10 @@ MainLoop* test() { ResourceSaver::save("test_data/rock.xml",texture); print_line("localize paths"); - print_line(Globals::get_singleton()->localize_path("algo.xml")); - print_line(Globals::get_singleton()->localize_path("c:\\windows\\algo.xml")); - print_line(Globals::get_singleton()->localize_path(Globals::get_singleton()->get_resource_path()+"/something/something.xml")); - print_line(Globals::get_singleton()->localize_path("somedir/algo.xml")); + print_line(GlobalConfig::get_singleton()->localize_path("algo.xml")); + print_line(GlobalConfig::get_singleton()->localize_path("c:\\windows\\algo.xml")); + print_line(GlobalConfig::get_singleton()->localize_path(GlobalConfig::get_singleton()->get_resource_path()+"/something/something.xml")); + print_line(GlobalConfig::get_singleton()->localize_path("somedir/algo.xml")); { diff --git a/bin/tests/test_io.h b/main/tests/test_io.h index c839590ab9..c839590ab9 100644 --- a/bin/tests/test_io.h +++ b/main/tests/test_io.h diff --git a/bin/tests/test_main.cpp b/main/tests/test_main.cpp index 363aede96e..1f7f2d7dda 100644 --- a/bin/tests/test_main.cpp +++ b/main/tests/test_main.cpp @@ -37,13 +37,10 @@ #include "test_gui.h" #include "test_render.h" #include "test_sound.h" -#include "test_misc.h" #include "test_physics.h" #include "test_physics_2d.h" -#include "test_python.h" + #include "test_io.h" -#include "test_particles.h" -#include "test_detailer.h" #include "test_shader_lang.h" #include "test_gdscript.h" #include "test_image.h" @@ -56,7 +53,6 @@ const char ** tests_get_names() { "containers", "math", "render", - "particles", "multimesh", "gui", "io", @@ -96,11 +92,6 @@ MainLoop* test_main(String p_test,const List<String>& p_args) { return TestPhysics2D::test(); } - if (p_test=="misc") { - - return TestMisc::test(); - } - if (p_test=="render") { return TestRender::test(); @@ -123,16 +114,6 @@ MainLoop* test_main(String p_test,const List<String>& p_args) { return TestIO::test(); } - if (p_test=="particles") { - - return TestParticles::test(); - } - - if (p_test=="multimesh") { - - return TestMultiMesh::test(); - } - if (p_test=="shaderlang") { return TestShaderLang::test(); @@ -163,19 +144,6 @@ MainLoop* test_main(String p_test,const List<String>& p_args) { return TestImage::test(); } - if (p_test=="detailer") { - - return TestMultiMesh::test(); - } - -#ifdef PYTHON_ENABLED - - if (p_test=="python") { - - return TestPython::test(); - } -#endif - return NULL; } diff --git a/bin/tests/test_main.h b/main/tests/test_main.h index c8d571a7dd..c8d571a7dd 100644 --- a/bin/tests/test_main.h +++ b/main/tests/test_main.h diff --git a/bin/tests/test_math.cpp b/main/tests/test_math.cpp index 9329002f76..f3d9ddba87 100644 --- a/bin/tests/test_math.cpp +++ b/main/tests/test_math.cpp @@ -478,6 +478,37 @@ uint32_t ihash3( uint32_t a) MainLoop* test() { + print_line("Dvectors: "+itos(MemoryPool::allocs_used)); + print_line("Mem used: "+itos(MemoryPool::total_memory)); + print_line("MAx mem used: "+itos(MemoryPool::max_memory)); + + PoolVector<int> ints; + ints.resize(20); + + { + PoolVector<int>::Write w; + w = ints.write(); + for(int i=0;i<ints.size();i++) { + w[i]=i; + } + } + + PoolVector<int> posho = ints; + + { + PoolVector<int>::Read r = posho.read(); + for(int i=0;i<posho.size();i++) { + print_line(itos(i)+" : " +itos(r[i])); + } + } + + print_line("later Dvectors: "+itos(MemoryPool::allocs_used)); + print_line("later Mem used: "+itos(MemoryPool::total_memory)); + print_line("Mlater Ax mem used: "+itos(MemoryPool::max_memory)); + + + return NULL; + List<String> cmdlargs = OS::get_singleton()->get_cmdline_args(); if (cmdlargs.empty()) { @@ -518,7 +549,7 @@ MainLoop* test() { Vector<int> hashes; List<StringName> tl; - ObjectTypeDB::get_type_list(&tl); + ClassDB::get_class_list(&tl); for (List<StringName>::Element *E=tl.front();E;E=E->next()) { @@ -578,19 +609,19 @@ MainLoop* test() { float a=0.3; //Quat q(v,a); - Matrix3 m(v,a); + Basis m(v,a); Vector3 v2(7,3,1); v2.normalize(); float a2=0.8; //Quat q(v,a); - Matrix3 m2(v2,a2); + Basis m2(v2,a2); Quat q=m; Quat q2=m2; - Matrix3 m3 = m.inverse() * m2; + Basis m3 = m.inverse() * m2; Quat q3 = (q.inverse() * q2);//.normalized(); print_line(Quat(m3)); @@ -611,11 +642,11 @@ MainLoop* test() { print_line(ret); return NULL; - Matrix3 m3; + Basis m3; m3.rotate(Vector3(1,0,0),0.2); m3.rotate(Vector3(0,1,0),1.77); m3.rotate(Vector3(0,0,1),212); - Matrix3 m32; + Basis m32; m32.set_euler(m3.get_euler()); print_line("ELEULEEEEEEEEEEEEEEEEEER: "+m3.get_euler()+" vs "+m32.get_euler()); @@ -704,8 +735,8 @@ MainLoop* test() { print_line(String("res://..").simplify_path()); - DVector<uint8_t> a; - DVector<uint8_t> b; + PoolVector<uint8_t> a; + PoolVector<uint8_t> b; a.resize(20); b=a; @@ -753,11 +784,11 @@ MainLoop* test() { print_line(Variant(a)); - Matrix32 mat2_1; + Transform2D mat2_1; mat2_1.rotate(0.5); - Matrix32 mat2_2; + Transform2D mat2_2; mat2_2.translate(Vector2(1,2)); - Matrix32 mat2_3 = mat2_1 * mat2_2; + Transform2D mat2_3 = mat2_1 * mat2_2; mat2_3.affine_invert(); print_line(mat2_3.elements[0]); diff --git a/bin/tests/test_math.h b/main/tests/test_math.h index 492c3a1837..492c3a1837 100644 --- a/bin/tests/test_math.h +++ b/main/tests/test_math.h diff --git a/bin/tests/test_physics.cpp b/main/tests/test_physics.cpp index f202d0dda1..ea5b1cae85 100644 --- a/bin/tests/test_physics.cpp +++ b/main/tests/test_physics.cpp @@ -40,7 +40,7 @@ class TestPhysicsMainLoop : public MainLoop { - OBJ_TYPE( TestPhysicsMainLoop, MainLoop ); + GDCLASS( TestPhysicsMainLoop, MainLoop ); enum { LINK_COUNT = 20, @@ -81,7 +81,7 @@ protected: static void _bind_methods() { - ObjectTypeDB::bind_method("body_changed_transform",&TestPhysicsMainLoop::body_changed_transform); + ClassDB::bind_method("body_changed_transform",&TestPhysicsMainLoop::body_changed_transform); } RID create_body(PhysicsServer::ShapeType p_shape, PhysicsServer::BodyMode p_body,const Transform p_location,bool p_active_default=true,const Transform&p_shape_xform=Transform()) { @@ -138,10 +138,6 @@ protected: /* SPHERE SHAPE */ RID sphere_mesh = vs->make_sphere_mesh(10,20,0.5); - RID sphere_material = vs->fixed_material_create(); - //vs->material_set_flag( sphere_material, VisualServer::MATERIAL_FLAG_WIREFRAME, true ); - vs->fixed_material_set_param( sphere_material, VisualServer::FIXED_MATERIAL_PARAM_DIFFUSE, Color(0.7,0.8,3.0) ); - vs->mesh_surface_set_material( sphere_mesh, 0, sphere_material ); type_mesh_map[PhysicsServer::SHAPE_SPHERE]=sphere_mesh; RID sphere_shape=ps->shape_create(PhysicsServer::SHAPE_SPHERE); @@ -150,13 +146,10 @@ protected: /* BOX SHAPE */ - DVector<Plane> box_planes = Geometry::build_box_planes(Vector3(0.5,0.5,0.5)); - RID box_material = vs->fixed_material_create(); - vs->fixed_material_set_param( box_material, VisualServer::FIXED_MATERIAL_PARAM_DIFFUSE, Color(1.0,0.2,0.2) ); + PoolVector<Plane> box_planes = Geometry::build_box_planes(Vector3(0.5,0.5,0.5)); RID box_mesh = vs->mesh_create(); Geometry::MeshData box_data = Geometry::build_convex_mesh(box_planes); vs->mesh_add_surface_from_mesh_data(box_mesh,box_data); - vs->mesh_surface_set_material( box_mesh, 0, box_material ); type_mesh_map[PhysicsServer::SHAPE_BOX]=box_mesh; RID box_shape=ps->shape_create(PhysicsServer::SHAPE_BOX); @@ -166,14 +159,12 @@ protected: /* CAPSULE SHAPE */ - DVector<Plane> capsule_planes = Geometry::build_capsule_planes(0.5,0.7,12,Vector3::AXIS_Z); - RID capsule_material = vs->fixed_material_create(); - vs->fixed_material_set_param( capsule_material, VisualServer::FIXED_MATERIAL_PARAM_DIFFUSE, Color(0.3,0.4,1.0) ); + PoolVector<Plane> capsule_planes = Geometry::build_capsule_planes(0.5,0.7,12,Vector3::AXIS_Z); RID capsule_mesh = vs->mesh_create(); Geometry::MeshData capsule_data = Geometry::build_convex_mesh(capsule_planes); vs->mesh_add_surface_from_mesh_data(capsule_mesh,capsule_data); - vs->mesh_surface_set_material( capsule_mesh, 0, capsule_material ); + type_mesh_map[PhysicsServer::SHAPE_CAPSULE]=capsule_mesh; RID capsule_shape=ps->shape_create(PhysicsServer::SHAPE_CAPSULE); @@ -185,15 +176,13 @@ protected: /* CONVEX SHAPE */ - DVector<Plane> convex_planes = Geometry::build_cylinder_planes(0.5,0.7,5,Vector3::AXIS_Z); - RID convex_material = vs->fixed_material_create(); - vs->fixed_material_set_param( convex_material, VisualServer::FIXED_MATERIAL_PARAM_DIFFUSE, Color(0.8,0.2,0.9)); + PoolVector<Plane> convex_planes = Geometry::build_cylinder_planes(0.5,0.7,5,Vector3::AXIS_Z); RID convex_mesh = vs->mesh_create(); Geometry::MeshData convex_data = Geometry::build_convex_mesh(convex_planes); QuickHull::build(convex_data.vertices,convex_data); vs->mesh_add_surface_from_mesh_data(convex_mesh,convex_data); - vs->mesh_surface_set_material( convex_mesh, 0, convex_material ); + type_mesh_map[PhysicsServer::SHAPE_CONVEX_POLYGON]=convex_mesh; RID convex_shape=ps->shape_create(PhysicsServer::SHAPE_CONVEX_POLYGON); @@ -223,11 +212,9 @@ protected: d.resize(VS::ARRAY_MAX); d[VS::ARRAY_VERTEX]=p_faces; d[VS::ARRAY_NORMAL]=normals; - vs->mesh_add_surface(trimesh_mesh, VS::PRIMITIVE_TRIANGLES, d ); - RID trimesh_mat = vs->fixed_material_create(); - vs->fixed_material_set_param( trimesh_mat, VisualServer::FIXED_MATERIAL_PARAM_DIFFUSE, Color(1.0,0.5,0.8)); + vs->mesh_add_surface_from_arrays(trimesh_mesh, VS::PRIMITIVE_TRIANGLES, d ); //vs->material_set_flag( trimesh_mat, VisualServer::MATERIAL_FLAG_UNSHADED,true); - vs->mesh_surface_set_material( trimesh_mesh, 0, trimesh_mat ); + RID triins = vs->instance_create2(trimesh_mesh,scenario); @@ -314,7 +301,7 @@ public: } - if (p_event.type == InputEvent::JOYSTICK_MOTION) { + if (p_event.type == InputEvent::JOYPAD_MOTION) { if (p_event.joy_motion.axis == 0) { @@ -364,7 +351,7 @@ public: vs->viewport_set_scenario( viewport, scenario ); vs->camera_set_perspective(camera,60,0.1,40.0); - vs->camera_set_transform(camera,Transform( Matrix3(), Vector3(0,9,12))); + vs->camera_set_transform(camera,Transform( Basis(), Vector3(0,9,12))); //vs->scenario_set_debug(scenario,VS::SCENARIO_DEBUG_WIREFRAME); Transform gxf; @@ -454,7 +441,7 @@ public: RID tribody = ps->body_create( PhysicsServer::BODY_MODE_STATIC, trimesh_shape); - Transform tritrans = Transform( Matrix3(), Vector3(0,0,-2) ); + Transform tritrans = Transform( Basis(), Vector3(0,0,-2) ); ps->body_set_state( tribody, PhysicsServer::BODY_STATE_TRANSFORM, tritrans ); vs->instance_set_transform( triins, tritrans ); RID trimesh_material = vs->fixed_material_create(); @@ -464,7 +451,7 @@ public: } virtual bool iteration(float p_time) { - if (mover) { + if (mover.is_valid()) { static float joy_speed = 10; PhysicsServer * ps = PhysicsServer::get_singleton(); Transform t = ps->body_get_state(mover,PhysicsServer::BODY_STATE_TRANSFORM); @@ -490,7 +477,7 @@ public: #if 0 PhysicsServer * ps = PhysicsServer::get_singleton(); - mover = create_body(PhysicsServer::SHAPE_BOX,PhysicsServer::BODY_MODE_STATIC,Transform(Matrix3(),Vector3(0,0,-24))); + mover = create_body(PhysicsServer::SHAPE_BOX,PhysicsServer::BODY_MODE_STATIC,Transform(Basis(),Vector3(0,0,-24))); RID b = create_body(PhysicsServer::SHAPE_CAPSULE,PhysicsServer::BODY_MODE_RIGID,Transform()); ps->joint_create_double_pin(b,Vector3(0,0,1.0),mover,Vector3(0,0,0)); @@ -521,17 +508,17 @@ public: PhysicsServer * ps = PhysicsServer::get_singleton(); - mover = create_body(PhysicsServer::SHAPE_BOX,PhysicsServer::BODY_MODE_STATIC,Transform(Matrix3(),Vector3(0,0,-24))); + mover = create_body(PhysicsServer::SHAPE_BOX,PhysicsServer::BODY_MODE_STATIC,Transform(Basis(),Vector3(0,0,-24))); RID b = create_body(PhysicsServer::SHAPE_BOX,PhysicsServer::BODY_MODE_RIGID,Transform()); - ps->joint_create_double_hinge(b,Transform(Matrix3(),Vector3(1,1,1.0)),mover,Transform(Matrix3(),Vector3(0,0,0))); + ps->joint_create_double_hinge(b,Transform(Basis(),Vector3(1,1,1.0)),mover,Transform(Basis(),Vector3(0,0,0))); ps->body_add_collision_exception(mover,b); /* for(int i=0;i<20;i++) { RID c = create_body(PhysicsServer::SHAPE_CAPSULE,PhysicsServer::BODY_MODE_RIGID,Transform()); - ps->joint_create_double_hinge(b,Transform(Matrix3(),Vector3(0,0,-0.7)),c,Transform(Matrix3(),Vector3(0,0,0.7))); + ps->joint_create_double_hinge(b,Transform(Basis(),Vector3(0,0,-0.7)),c,Transform(Basis(),Vector3(0,0,0.7))); ps->body_add_collision_exception(c,b); b=c; } @@ -547,16 +534,11 @@ public: PhysicsServer * ps = PhysicsServer::get_singleton(); - DVector<Plane> capsule_planes = Geometry::build_capsule_planes(0.5,1,12,5,Vector3::AXIS_Y); - RID capsule_material = vs->fixed_material_create(); - - vs->fixed_material_set_param( capsule_material, VisualServer::FIXED_MATERIAL_PARAM_DIFFUSE, Color(1,1,1) ); - + PoolVector<Plane> capsule_planes = Geometry::build_capsule_planes(0.5,1,12,5,Vector3::AXIS_Y); RID capsule_mesh = vs->mesh_create(); Geometry::MeshData capsule_data = Geometry::build_convex_mesh(capsule_planes); vs->mesh_add_surface_from_mesh_data(capsule_mesh,capsule_data); - vs->mesh_surface_set_material( capsule_mesh, 0, capsule_material ); type_mesh_map[PhysicsServer::SHAPE_CAPSULE]=capsule_mesh; RID capsule_shape=ps->shape_create(PhysicsServer::SHAPE_CAPSULE); @@ -578,7 +560,7 @@ public: ps->body_set_force_integration_callback(character,this,"body_changed_transform",mesh_instance); - ps->body_set_state( character, PhysicsServer::BODY_STATE_TRANSFORM,Transform(Matrix3(),Vector3(-2,5,-2))); + ps->body_set_state( character, PhysicsServer::BODY_STATE_TRANSFORM,Transform(Basis(),Vector3(-2,5,-2))); bodies.push_back(character); @@ -629,8 +611,8 @@ public: void test_activate() { - create_body(PhysicsServer::SHAPE_BOX,PhysicsServer::BODY_MODE_RIGID,Transform(Matrix3(),Vector3(0,2,0)),true); - //create_body(PhysicsServer::SHAPE_SPHERE,PhysicsServer::BODY_MODE_RIGID,Transform(Matrix3(),Vector3(0,6,0)),true); + create_body(PhysicsServer::SHAPE_BOX,PhysicsServer::BODY_MODE_RIGID,Transform(Basis(),Vector3(0,2,0)),true); + //create_body(PhysicsServer::SHAPE_SPHERE,PhysicsServer::BODY_MODE_RIGID,Transform(Basis(),Vector3(0,6,0)),true); create_static_plane( Plane( Vector3(0,1,0), -1) ); } diff --git a/bin/tests/test_physics.h b/main/tests/test_physics.h index 5b6a54f2d4..5b6a54f2d4 100644 --- a/bin/tests/test_physics.h +++ b/main/tests/test_physics.h diff --git a/bin/tests/test_physics_2d.cpp b/main/tests/test_physics_2d.cpp index 845e20b6c3..2074d532b1 100644 --- a/bin/tests/test_physics_2d.cpp +++ b/main/tests/test_physics_2d.cpp @@ -42,7 +42,7 @@ static const unsigned char convex_png[]={ class TestPhysics2DMainLoop : public MainLoop { - OBJ_TYPE( TestPhysics2DMainLoop, MainLoop ); + GDCLASS( TestPhysics2DMainLoop, MainLoop ); RID circle_img; @@ -51,7 +51,7 @@ class TestPhysics2DMainLoop : public MainLoop { RID canvas; RID ray; RID ray_query; - Matrix32 view_xform; + Transform2D view_xform; Vector2 ray_from,ray_to; @@ -74,7 +74,7 @@ class TestPhysics2DMainLoop : public MainLoop { { - DVector<uint8_t> pixels; + PoolVector<uint8_t> pixels; pixels.resize(32*2*2); for(int i=0;i<2;i++) { @@ -85,7 +85,7 @@ class TestPhysics2DMainLoop : public MainLoop { } } - Image image(32,2,0,Image::FORMAT_GRAYSCALE_ALPHA,pixels); + Image image(32,2,0,Image::FORMAT_LA8,pixels); body_shape_data[Physics2DServer::SHAPE_SEGMENT].image=vs->texture_create_from_image(image); @@ -100,7 +100,7 @@ class TestPhysics2DMainLoop : public MainLoop { { - DVector<uint8_t> pixels; + PoolVector<uint8_t> pixels; pixels.resize(32*32*2); for(int i=0;i<32;i++) { @@ -113,7 +113,7 @@ class TestPhysics2DMainLoop : public MainLoop { } } - Image image(32,32,0,Image::FORMAT_GRAYSCALE_ALPHA,pixels); + Image image(32,32,0,Image::FORMAT_LA8,pixels); body_shape_data[Physics2DServer::SHAPE_CIRCLE].image=vs->texture_create_from_image(image); @@ -128,7 +128,7 @@ class TestPhysics2DMainLoop : public MainLoop { { - DVector<uint8_t> pixels; + PoolVector<uint8_t> pixels; pixels.resize(32*32*2); for(int i=0;i<32;i++) { @@ -141,7 +141,7 @@ class TestPhysics2DMainLoop : public MainLoop { } } - Image image(32,32,0,Image::FORMAT_GRAYSCALE_ALPHA,pixels); + Image image(32,32,0,Image::FORMAT_LA8,pixels); body_shape_data[Physics2DServer::SHAPE_RECTANGLE].image=vs->texture_create_from_image(image); @@ -157,7 +157,7 @@ class TestPhysics2DMainLoop : public MainLoop { { - DVector<uint8_t> pixels; + PoolVector<uint8_t> pixels; pixels.resize(32*64*2); for(int i=0;i<64;i++) { @@ -173,7 +173,7 @@ class TestPhysics2DMainLoop : public MainLoop { } } - Image image(32,64,0,Image::FORMAT_GRAYSCALE_ALPHA,pixels); + Image image(32,64,0,Image::FORMAT_LA8,pixels); body_shape_data[Physics2DServer::SHAPE_CAPSULE].image=vs->texture_create_from_image(image); @@ -195,7 +195,7 @@ class TestPhysics2DMainLoop : public MainLoop { RID convex_polygon_shape = ps->shape_create(Physics2DServer::SHAPE_CONVEX_POLYGON); - DVector<Vector2> arr; + PoolVector<Vector2> arr; Point2 sb(32,32); arr.push_back(Point2(20,3)-sb); arr.push_back(Point2(58,23)-sb); @@ -262,7 +262,7 @@ protected: } } - RID _add_body(Physics2DServer::ShapeType p_shape, const Matrix32& p_xform) { + RID _add_body(Physics2DServer::ShapeType p_shape, const Transform2D& p_xform) { VisualServer *vs = VisualServer::get_singleton(); Physics2DServer *ps = Physics2DServer::get_singleton(); @@ -304,7 +304,7 @@ protected: } - void _add_concave(const Vector<Vector2>& p_points,const Matrix32& p_xform=Matrix32()) { + void _add_concave(const Vector<Vector2>& p_points,const Transform2D& p_xform=Transform2D()) { Physics2DServer *ps = Physics2DServer::get_singleton(); VisualServer *vs = VisualServer::get_singleton(); @@ -354,8 +354,8 @@ protected: static void _bind_methods() { - ObjectTypeDB::bind_method(_MD("_body_moved"),&TestPhysics2DMainLoop::_body_moved); - ObjectTypeDB::bind_method(_MD("_ray_query_callback"),&TestPhysics2DMainLoop::_ray_query_callback); + ClassDB::bind_method(_MD("_body_moved"),&TestPhysics2DMainLoop::_body_moved); + ClassDB::bind_method(_MD("_ray_query_callback"),&TestPhysics2DMainLoop::_ray_query_callback); } @@ -381,8 +381,8 @@ public: RID vp = vs->viewport_create(); canvas = vs->canvas_create(); vs->viewport_attach_canvas(vp,canvas); - vs->viewport_attach_to_screen(vp); - Matrix32 smaller; + vs->viewport_attach_to_screen(vp,Rect2(Vector2(),OS::get_singleton()->get_window_size())); + Transform2D smaller; //smaller.scale(Vector2(0.6,0.6)); //smaller.elements[2]=Vector2(100,0); @@ -410,12 +410,12 @@ public: Physics2DServer::ShapeType type = types[i%4]; // type=Physics2DServer::SHAPE_SEGMENT; - _add_body(type,Matrix32(i*0.8,Point2(152+i*40,100-40*i))); + _add_body(type,Transform2D(i*0.8,Point2(152+i*40,100-40*i))); //if (i==0) // ps->body_set_mode(b,Physics2DServer::BODY_MODE_STATIC); } - //RID b= _add_body(Physics2DServer::SHAPE_CIRCLE,Matrix32(0,Point2(101,140))); + //RID b= _add_body(Physics2DServer::SHAPE_CIRCLE,Transform2D(0,Point2(101,140))); //ps->body_set_mode(b,Physics2DServer::BODY_MODE_STATIC); Point2 prev; diff --git a/bin/tests/test_physics_2d.h b/main/tests/test_physics_2d.h index e2eb1f4023..e2eb1f4023 100644 --- a/bin/tests/test_physics_2d.h +++ b/main/tests/test_physics_2d.h diff --git a/bin/tests/test_render.cpp b/main/tests/test_render.cpp index 9c3a287afa..3049ba7d45 100644 --- a/bin/tests/test_render.cpp +++ b/main/tests/test_render.cpp @@ -87,7 +87,7 @@ public: Vector<Vector3> vts; /* - DVector<Plane> sp = Geometry::build_sphere_planes(2,5,5); + PoolVector<Plane> sp = Geometry::build_sphere_planes(2,5,5); Geometry::MeshData md2 = Geometry::build_convex_mesh(sp); vts=md2.vertices; */ @@ -95,7 +95,7 @@ public: static const int s = 20; for(int i=0;i<s;i++) { - Matrix3 rot(Vector3(0,1,0),i*Math_PI/s); + Basis rot(Vector3(0,1,0),i*Math_PI/s); for(int j=0;j<s;j++) { Vector3 v; @@ -173,10 +173,13 @@ public: // vs->camera_set_perspective( camera, 60.0,0.1, 100.0 ); viewport = vs->viewport_create(); - vs->viewport_attach_to_screen(viewport); + Size2i screen_size = OS::get_singleton()->get_window_size(); + vs->viewport_set_size(viewport,screen_size.x,screen_size.y); + vs->viewport_attach_to_screen(viewport,Rect2(Vector2(),screen_size)); + vs->viewport_set_active(viewport,true); vs->viewport_attach_camera( viewport, camera ); vs->viewport_set_scenario( viewport, scenario ); - vs->camera_set_transform(camera, Transform( Matrix3(), Vector3(0,3,30 ) ) ); + vs->camera_set_transform(camera, Transform( Basis(), Vector3(0,3,30 ) ) ); vs->camera_set_perspective( camera, 60, 0.1, 1000); @@ -192,7 +195,7 @@ public: //* lightaux = vs->light_create( VisualServer::LIGHT_DIRECTIONAL ); //vs->light_set_color( lightaux, VisualServer::LIGHT_COLOR_AMBIENT, Color(0.0,0.0,0.0) ); - vs->light_set_color( lightaux, VisualServer::LIGHT_COLOR_DIFFUSE, Color(1.0,1.0,1.0) ); + vs->light_set_color( lightaux, Color(1.0,1.0,1.0) ); //vs->light_set_shadow( lightaux, true ); light = vs->instance_create2( lightaux, scenario ); Transform lla; @@ -205,8 +208,8 @@ public: //* lightaux = vs->light_create( VisualServer::LIGHT_OMNI ); // vs->light_set_color( lightaux, VisualServer::LIGHT_COLOR_AMBIENT, Color(0.0,0.0,1.0) ); - vs->light_set_color( lightaux, VisualServer::LIGHT_COLOR_DIFFUSE, Color(1.0,1.0,0.0) ); - vs->light_set_param( lightaux, VisualServer::LIGHT_PARAM_RADIUS, 4 ); + vs->light_set_color( lightaux, Color(1.0,1.0,0.0) ); + vs->light_set_param( lightaux, VisualServer::LIGHT_PARAM_RANGE, 4 ); vs->light_set_param( lightaux, VisualServer::LIGHT_PARAM_ENERGY, 8 ); //vs->light_set_shadow( lightaux, true ); //light = vs->instance_create( lightaux ); @@ -229,7 +232,7 @@ public: for(List<InstanceInfo>::Element *E=instances.front();E;E=E->next()) { - Transform pre( Matrix3(E->get().rot_axis, ofs), Vector3() ); + Transform pre( Basis(E->get().rot_axis, ofs), Vector3() ); vs->instance_set_transform( E->get().instance, pre * E->get().base ); /* if( !E->next() ) { diff --git a/bin/tests/test_render.h b/main/tests/test_render.h index 6993e75b9f..6993e75b9f 100644 --- a/bin/tests/test_render.h +++ b/main/tests/test_render.h diff --git a/main/tests/test_shader_lang.cpp b/main/tests/test_shader_lang.cpp new file mode 100644 index 0000000000..1a677bcbe2 --- /dev/null +++ b/main/tests/test_shader_lang.cpp @@ -0,0 +1,361 @@ +/*************************************************************************/ +/* test_shader_lang.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ +#include "test_shader_lang.h" + + +#include "os/main_loop.h" +#include "os/os.h" +#include "os/file_access.h" + +#include "scene/gui/control.h" +#include "scene/gui/text_edit.h" +#include "print_string.h" +#include "servers/visual/shader_language.h" +//#include "drivers/gles2/shader_compiler_gles2.h" + + +typedef ShaderLanguage SL; + +namespace TestShaderLang { + + +static String _mktab(int p_level) { + + String tb; + for(int i=0;i<p_level;i++) { + tb+="\t"; + } + + return tb; +} + +static String _typestr(SL::DataType p_type) { + + return ShaderLanguage::get_datatype_name(p_type); + + return ""; +} + + +static String _prestr(SL::DataPrecision p_pres) { + + + switch(p_pres) { + case SL::PRECISION_LOWP: return "lowp "; + case SL::PRECISION_MEDIUMP: return "mediump "; + case SL::PRECISION_HIGHP: return "highp "; + case SL::PRECISION_DEFAULT: return ""; + } + return ""; +} + + +static String _opstr(SL::Operator p_op) { + + return ShaderLanguage::get_operator_text(p_op); + + +} + + +static String get_constant_text(SL::DataType p_type, const Vector<SL::ConstantNode::Value>& p_values) { + + switch(p_type) { + case SL::TYPE_BOOL: return p_values[0].boolean?"true":"false"; + case SL::TYPE_BVEC2: return String()+"bvec2("+(p_values[0].boolean?"true":"false")+(p_values[1].boolean?"true":"false")+")"; + case SL::TYPE_BVEC3: return String()+"bvec3("+(p_values[0].boolean?"true":"false")+","+(p_values[1].boolean?"true":"false")+","+(p_values[2].boolean?"true":"false")+")"; + case SL::TYPE_BVEC4: return String()+"bvec4("+(p_values[0].boolean?"true":"false")+","+(p_values[1].boolean?"true":"false")+","+(p_values[2].boolean?"true":"false")+","+(p_values[3].boolean?"true":"false")+")"; + case SL::TYPE_INT: return rtos(p_values[0].sint); + case SL::TYPE_IVEC2: return String()+"ivec2("+rtos(p_values[0].sint)+","+rtos(p_values[1].sint)+")"; + case SL::TYPE_IVEC3: return String()+"ivec3("+rtos(p_values[0].sint)+","+rtos(p_values[1].sint)+","+rtos(p_values[2].sint)+")"; + case SL::TYPE_IVEC4: return String()+"ivec4("+rtos(p_values[0].sint)+","+rtos(p_values[1].sint)+","+rtos(p_values[2].sint)+","+rtos(p_values[3].sint)+")"; + case SL::TYPE_UINT: return rtos(p_values[0].real); + case SL::TYPE_UVEC2: return String()+"uvec2("+rtos(p_values[0].real)+","+rtos(p_values[1].real)+")"; + case SL::TYPE_UVEC3: return String()+"uvec3("+rtos(p_values[0].real)+","+rtos(p_values[1].real)+","+rtos(p_values[2].real)+")"; + case SL::TYPE_UVEC4: return String()+"uvec4("+rtos(p_values[0].real)+","+rtos(p_values[1].real)+","+rtos(p_values[2].real)+","+rtos(p_values[3].real)+")"; + case SL::TYPE_FLOAT: return rtos(p_values[0].real); + case SL::TYPE_VEC2: return String()+"vec2("+rtos(p_values[0].real)+","+rtos(p_values[1].real)+")"; + case SL::TYPE_VEC3: return String()+"vec3("+rtos(p_values[0].real)+","+rtos(p_values[1].real)+","+rtos(p_values[2].real)+")"; + case SL::TYPE_VEC4: return String()+"vec4("+rtos(p_values[0].real)+","+rtos(p_values[1].real)+","+rtos(p_values[2].real)+","+rtos(p_values[3].real)+")"; + default: ERR_FAIL_V(String()); + } +} + +static String dump_node_code(SL::Node *p_node,int p_level) { + + String code; + + switch(p_node->type) { + + case SL::Node::TYPE_SHADER: { + + SL::ShaderNode *pnode=(SL::ShaderNode*)p_node; + + for(Map<StringName,SL::ShaderNode::Uniform>::Element *E=pnode->uniforms.front();E;E=E->next()) { + + String ucode="uniform "; + ucode+=_prestr(E->get().precission); + ucode+=_typestr(E->get().type); + ucode+=" "+String(E->key()); + + if (E->get().default_value.size()) { + ucode+=" = "+get_constant_text(E->get().type,E->get().default_value); + } + + static const char*hint_name[SL::ShaderNode::Uniform::HINT_MAX]={ + "", + "color", + "range", + "albedo", + "normal", + "black", + "white" + }; + + if (E->get().hint) + ucode+=" : "+String(hint_name[E->get().hint]); + + code+=ucode+"\n"; + + } + + for(Map<StringName,SL::ShaderNode::Varying>::Element *E=pnode->varyings.front();E;E=E->next()) { + + String vcode="varying "; + vcode+=_prestr(E->get().precission); + vcode+=_typestr(E->get().type); + vcode+=" "+String(E->key()); + + code+=vcode+"\n"; + + } + for(int i=0;i<pnode->functions.size();i++) { + + SL::FunctionNode *fnode=pnode->functions[i].function; + + String header; + header=_typestr(fnode->return_type)+" "+fnode->name+"("; + for(int i=0;i<fnode->arguments.size();i++) { + + if (i>0) + header+=", "; + header+=_prestr(fnode->arguments[i].precision)+_typestr(fnode->arguments[i].type)+" "+fnode->arguments[i].name; + } + + header+=")\n"; + code+=header; + code+=dump_node_code(fnode->body,p_level+1); + } + + //code+=dump_node_code(pnode->body,p_level); + } break; + case SL::Node::TYPE_FUNCTION: { + + } break; + case SL::Node::TYPE_BLOCK: { + SL::BlockNode *bnode=(SL::BlockNode*)p_node; + + //variables + code+=_mktab(p_level-1)+"{\n"; + for(Map<StringName,SL::BlockNode::Variable>::Element *E=bnode->variables.front();E;E=E->next()) { + + code+=_mktab(p_level)+_prestr(E->get().precision)+_typestr(E->get().type)+" "+E->key()+";\n"; + } + + for(int i=0;i<bnode->statements.size();i++) { + + String scode = dump_node_code(bnode->statements[i],p_level); + + if (bnode->statements[i]->type==SL::Node::TYPE_CONTROL_FLOW || bnode->statements[i]->type==SL::Node::TYPE_CONTROL_FLOW) { + code+=scode; //use directly + } else { + code+=_mktab(p_level)+scode+";\n"; + } + } + code+=_mktab(p_level-1)+"}\n"; + + + } break; + case SL::Node::TYPE_VARIABLE: { + SL::VariableNode *vnode=(SL::VariableNode*)p_node; + code=vnode->name; + + } break; + case SL::Node::TYPE_CONSTANT: { + SL::ConstantNode *cnode=(SL::ConstantNode*)p_node; + return get_constant_text(cnode->datatype,cnode->values); + + } break; + case SL::Node::TYPE_OPERATOR: { + SL::OperatorNode *onode=(SL::OperatorNode*)p_node; + + + switch(onode->op) { + + case SL::OP_ASSIGN: + case SL::OP_ASSIGN_ADD: + case SL::OP_ASSIGN_SUB: + case SL::OP_ASSIGN_MUL: + case SL::OP_ASSIGN_DIV: + case SL::OP_ASSIGN_SHIFT_LEFT: + case SL::OP_ASSIGN_SHIFT_RIGHT: + case SL::OP_ASSIGN_MOD: + case SL::OP_ASSIGN_BIT_AND: + case SL::OP_ASSIGN_BIT_OR: + case SL::OP_ASSIGN_BIT_XOR: + code=dump_node_code(onode->arguments[0],p_level)+_opstr(onode->op)+dump_node_code(onode->arguments[1],p_level); + break; + case SL::OP_BIT_INVERT: + case SL::OP_NEGATE: + case SL::OP_NOT: + case SL::OP_DECREMENT: + case SL::OP_INCREMENT: + code=_opstr(onode->op)+dump_node_code(onode->arguments[0],p_level); + break; + case SL::OP_POST_DECREMENT: + case SL::OP_POST_INCREMENT: + code=dump_node_code(onode->arguments[0],p_level)+_opstr(onode->op); + break; + case SL::OP_CALL: + case SL::OP_CONSTRUCT: + code=dump_node_code(onode->arguments[0],p_level)+"("; + for(int i=1;i<onode->arguments.size();i++) { + if (i>1) + code+=", "; + code+=dump_node_code(onode->arguments[i],p_level); + } + code+=")"; + break; + default: { + + code="("+dump_node_code(onode->arguments[0],p_level)+_opstr(onode->op)+dump_node_code(onode->arguments[1],p_level)+")"; + break; + + } + } + + } break; + case SL::Node::TYPE_CONTROL_FLOW: { + SL::ControlFlowNode *cfnode=(SL::ControlFlowNode*)p_node; + if (cfnode->flow_op==SL::FLOW_OP_IF) { + + code+=_mktab(p_level)+"if ("+dump_node_code(cfnode->expressions[0],p_level)+")\n"; + code+=dump_node_code(cfnode->blocks[0],p_level+1); + if (cfnode->blocks.size()==2) { + + code+=_mktab(p_level)+"else\n"; + code+=dump_node_code(cfnode->blocks[1],p_level+1); + } + + + } else if (cfnode->flow_op==SL::FLOW_OP_RETURN) { + + if (cfnode->blocks.size()) { + code="return "+dump_node_code(cfnode->blocks[0],p_level); + } else { + code="return"; + } + } + + } break; + case SL::Node::TYPE_MEMBER: { + SL::MemberNode *mnode=(SL::MemberNode*)p_node; + code=dump_node_code(mnode->owner,p_level)+"."+mnode->name; + + } break; + } + + return code; + +} + +static Error recreate_code(void *p_str,SL::ShaderNode *p_program) { + + + String *str=(String*)p_str; + + *str=dump_node_code(p_program,0); + + return OK; +} + + +MainLoop* test() { + + List<String> cmdlargs = OS::get_singleton()->get_cmdline_args(); + + if (cmdlargs.empty()) { + //try editor! + print_line("usage: godot -test shader_lang <shader>"); + return NULL; + } + + String test = cmdlargs.back()->get(); + + FileAccess *fa = FileAccess::open(test,FileAccess::READ); + + if (!fa) { + ERR_FAIL_V(NULL); + } + + String code; + + while(true) { + CharType c = fa->get_8(); + if (fa->eof_reached()) + break; + code+=c; + } + + SL sl; + print_line("tokens:\n\n"+sl.token_debug(code)); + + Map<StringName,Map<StringName,SL::DataType> > dt; + dt["fragment"]["ALBEDO"]=SL::TYPE_VEC3; + + Set<String> rm; + rm.insert("popo"); + + Error err = sl.compile(code,dt,rm); + + if (err) { + + print_line("Error at line: "+rtos(sl.get_error_line())+": "+sl.get_error_text()); + return NULL; + } else { + String code; + recreate_code(&code,sl.get_shader()); + print_line("code:\n\n"+code); + } + + return NULL; +} + + +} diff --git a/bin/tests/test_shader_lang.h b/main/tests/test_shader_lang.h index f129fb224a..f129fb224a 100644 --- a/bin/tests/test_shader_lang.h +++ b/main/tests/test_shader_lang.h diff --git a/bin/tests/test_sound.cpp b/main/tests/test_sound.cpp index 44cc117e02..44cc117e02 100644 --- a/bin/tests/test_sound.cpp +++ b/main/tests/test_sound.cpp diff --git a/bin/tests/test_sound.h b/main/tests/test_sound.h index 91b87a2261..91b87a2261 100644 --- a/bin/tests/test_sound.h +++ b/main/tests/test_sound.h diff --git a/bin/tests/test_string.cpp b/main/tests/test_string.cpp index 4990c58896..d99ad4476f 100644 --- a/bin/tests/test_string.cpp +++ b/main/tests/test_string.cpp @@ -842,7 +842,7 @@ bool test_29() { IP_Address ip0("2001:0db8:85a3:0000:0000:8a2e:0370:7334"); OS::get_singleton()->print("ip0 is %ls\n", String(ip0).c_str()); - IP_Address ip(0x0123, 0x4567, 0x89ab, 0xcdef, IP_Address::TYPE_IPV6); + IP_Address ip(0x0123, 0x4567, 0x89ab, 0xcdef, true); OS::get_singleton()->print("ip6 is %ls\n", String(ip).c_str()); IP_Address ip2("fe80::52e5:49ff:fe93:1baf"); diff --git a/bin/tests/test_string.h b/main/tests/test_string.h index 7b3cd9a019..7b3cd9a019 100644 --- a/bin/tests/test_string.h +++ b/main/tests/test_string.h diff --git a/methods.py b/methods.py index 91afd9e70b..a9fb0afd7c 100755..100644 --- a/methods.py +++ b/methods.py @@ -122,7 +122,7 @@ def build_glsl_header(filename): uline = line[:line.lower().find("//")] uline = uline[uline.find("uniform") + len("uniform"):] uline = uline.replace(";", "") - uline = uline.replace("{", "") + uline = uline.replace("{", "").strip() lines = uline.split(",") for x in lines: @@ -228,6 +228,7 @@ def build_glsl_header(filename): fd.write("\t_FORCE_INLINE_ void set_conditional(Conditionals p_conditional,bool p_enable) { _set_conditional(p_conditional,p_enable); }\n\n") fd.write("\t#define _FU if (get_uniform(p_uniform)<0) return; ERR_FAIL_COND( get_active()!=this );\n\n ") + fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, bool p_value) { _FU glUniform1i(get_uniform(p_uniform),p_value?1:0); }\n\n") fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, float p_value) { _FU glUniform1f(get_uniform(p_uniform),p_value); }\n\n") fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, double p_value) { _FU glUniform1f(get_uniform(p_uniform),p_value); }\n\n") fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, uint8_t p_value) { _FU glUniform1i(get_uniform(p_uniform),p_value); }\n\n") @@ -655,6 +656,7 @@ class LegacyGLHeaderStruct: self.fragment_lines = [] self.uniforms = [] self.attributes = [] + self.feedbacks = [] self.fbos = [] self.conditionals = [] self.enums = {} @@ -753,7 +755,29 @@ def include_file_in_legacygl_header(filename, header_data, depth): header_data.texunits += [(x, texunit)] header_data.texunit_names += [x] - elif (line.find("uniform") != -1): + elif (line.find("uniform") != -1 and line.lower().find("ubo:") != -1): + # uniform buffer object + ubostr = line[line.find(":") + 1:].strip() + ubo = str(int(ubostr)) + uline = line[:line.lower().find("//")] + uline = uline[uline.find("uniform") + len("uniform"):] + uline = uline.replace("highp", "") + uline = uline.replace(";", "") + uline = uline.replace("{", "").strip() + lines = uline.split(",") + for x in lines: + + x = x.strip() + x = x[x.rfind(" ") + 1:] + if (x.find("[") != -1): + # unfiorm array + x = x[:x.find("[")] + + if (not x in header_data.ubo_names): + header_data.ubos += [(x, ubo)] + header_data.ubo_names += [x] + + elif (line.find("uniform") != -1 and line.find("{") == -1 and line.find(";") != -1): uline = line.replace("uniform", "") uline = uline.replace(";", "") lines = uline.split(",") @@ -768,7 +792,7 @@ def include_file_in_legacygl_header(filename, header_data, depth): if (not x in header_data.uniforms): header_data.uniforms += [x] - if ((line.strip().find("in ") == 0 or line.strip().find("attribute ") == 0) and line.find("attrib:") != -1): + if (line.strip().find("attribute ") == 0 and line.find("attrib:") != -1): uline = line.replace("in ", "") uline = uline.replace("attribute ", "") uline = uline.replace("highp ", "") @@ -782,6 +806,19 @@ def include_file_in_legacygl_header(filename, header_data, depth): bind = bind.replace("attrib:", "").strip() header_data.attributes += [(name, bind)] + if (line.strip().find("out ") == 0 and line.find("tfb:") != -1): + uline = line.replace("out ", "") + uline = uline.replace("highp ", "") + uline = uline.replace(";", "") + uline = uline[uline.find(" "):].strip() + + if (uline.find("//") != -1): + name, bind = uline.split("//") + if (bind.find("tfb:") != -1): + name = name.strip() + bind = bind.replace("tfb:", "").strip() + header_data.feedbacks += [(name, bind)] + line = line.replace("\r", "") line = line.replace("\n", "") # line=line.replace("\\","\\\\") @@ -991,12 +1028,14 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs): fd.write("\t\tstatic const Enum *_enums=NULL;\n") fd.write("\t\tstatic const EnumValue *_enum_values=NULL;\n") + conditionals_found = [] if (len(header_data.conditionals)): fd.write("\t\tstatic const char* _conditional_strings[]={\n") if (len(header_data.conditionals)): for x in header_data.conditionals: fd.write("\t\t\t\"#define " + x + "\\n\",\n") + conditionals_found.append(x) fd.write("\t\t};\n\n") else: fd.write("\t\tstatic const char **_conditional_strings=NULL;\n") @@ -1021,6 +1060,25 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs): else: fd.write("\t\tstatic AttributePair *_attribute_pairs=NULL;\n") + feedback_count = 0 + + if (len(header_data.feedbacks)): + + fd.write("\t\tstatic const Feedback _feedbacks[]={\n") + for x in header_data.feedbacks: + name = x[0] + cond = x[1] + if (cond in conditionals_found): + fd.write("\t\t\t{\"" + name + "\"," + str(conditionals_found.index(cond)) + "},\n") + else: + fd.write("\t\t\t{\"" + name + "\",-1},\n") + + feedback_count += 1 + + fd.write("\t\t};\n\n") + else: + fd.write("\t\tstatic const Feedback* _feedbacks=NULL;\n") + if (len(header_data.texunits)): fd.write("\t\tstatic TexUnitPair _texunit_pairs[]={\n") for x in header_data.texunits: @@ -1029,6 +1087,14 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs): else: fd.write("\t\tstatic TexUnitPair *_texunit_pairs=NULL;\n") + if (len(header_data.ubos)): + fd.write("\t\tstatic UBOPair _ubo_pairs[]={\n") + for x in header_data.ubos: + fd.write("\t\t\t{\"" + x[0] + "\"," + x[1] + "},\n") + fd.write("\t\t};\n\n") + else: + fd.write("\t\tstatic UBOPair *_ubo_pairs=NULL;\n") + fd.write("\t\tstatic const char _vertex_code[]={\n") for x in header_data.vertex_lines: for i in range(len(x)): @@ -1050,9 +1116,9 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs): fd.write("\t\tstatic const int _fragment_code_start=" + str(header_data.fragment_offset) + ";\n") if output_attribs: - fd.write("\t\tsetup(_conditional_strings," + str(len(header_data.conditionals)) + ",_uniform_strings," + str(len(header_data.uniforms)) + ",_attribute_pairs," + str(len(header_data.attributes)) + ", _texunit_pairs," + str(len(header_data.texunits)) + ",_vertex_code,_fragment_code,_vertex_code_start,_fragment_code_start);\n") + fd.write("\t\tsetup(_conditional_strings," + str(len(header_data.conditionals)) + ",_uniform_strings," + str(len(header_data.uniforms)) + ",_attribute_pairs," + str(len(header_data.attributes)) + ", _texunit_pairs," + str(len(header_data.texunits)) + ",_ubo_pairs," + str(len(header_data.ubos)) + ",_feedbacks," + str(feedback_count) + ",_vertex_code,_fragment_code,_vertex_code_start,_fragment_code_start);\n") else: - fd.write("\t\tsetup(_conditional_strings," + str(len(header_data.conditionals)) + ",_uniform_strings," + str(len(header_data.uniforms)) + ",_texunit_pairs," + str(len(header_data.texunits)) + ",_enums," + str(len(header_data.enums)) + ",_enum_values," + str(enum_value_count) + ",_vertex_code,_fragment_code,_vertex_code_start,_fragment_code_start);\n") + fd.write("\t\tsetup(_conditional_strings," + str(len(header_data.conditionals)) + ",_uniform_strings," + str(len(header_data.uniforms)) + ",_texunit_pairs," + str(len(header_data.texunits)) + ",_enums," + str(len(header_data.enums)) + ",_enum_values," + str(enum_value_count) + ",_ubo_pairs," + str(len(header_data.ubos)) + ",_feedbacks," + str(feedback_count) + ",_vertex_code,_fragment_code,_vertex_code_start,_fragment_code_start);\n") fd.write("\t};\n\n") @@ -1084,6 +1150,12 @@ def build_gles2_headers(target, source, env): build_legacygl_header(str(x), include="drivers/gles2/shader_gles2.h", class_suffix="GLES2", output_attribs=True) +def build_gles3_headers(target, source, env): + + for x in source: + build_legacygl_header(str(x), include="drivers/gles3/shader_gles3.h", class_suffix="GLES3", output_attribs=True) + + def update_version(): rev = "custom_build" diff --git a/modules/chibi/cp_config.h b/modules/chibi/cp_config.h index 2ad704ace7..35312b68be 100644 --- a/modules/chibi/cp_config.h +++ b/modules/chibi/cp_config.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_envelope.cpp b/modules/chibi/cp_envelope.cpp index 9892b6d4b0..36259e8d63 100644 --- a/modules/chibi/cp_envelope.cpp +++ b/modules/chibi/cp_envelope.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_envelope.h b/modules/chibi/cp_envelope.h index d1ada53f7d..af27f5f185 100644 --- a/modules/chibi/cp_envelope.h +++ b/modules/chibi/cp_envelope.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_file_access_wrapper.h b/modules/chibi/cp_file_access_wrapper.h index 5b361c0ea8..ade077c1ef 100644 --- a/modules/chibi/cp_file_access_wrapper.h +++ b/modules/chibi/cp_file_access_wrapper.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_instrument.cpp b/modules/chibi/cp_instrument.cpp index 7a732e33a4..606a4217e0 100644 --- a/modules/chibi/cp_instrument.cpp +++ b/modules/chibi/cp_instrument.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_instrument.h b/modules/chibi/cp_instrument.h index d8eb8333ee..e51612a38d 100644 --- a/modules/chibi/cp_instrument.h +++ b/modules/chibi/cp_instrument.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_loader.h b/modules/chibi/cp_loader.h index 9d1074d1b8..1630444481 100644 --- a/modules/chibi/cp_loader.h +++ b/modules/chibi/cp_loader.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_loader_it.cpp b/modules/chibi/cp_loader_it.cpp index 20a3960a23..bfffd9b509 100644 --- a/modules/chibi/cp_loader_it.cpp +++ b/modules/chibi/cp_loader_it.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_loader_it.h b/modules/chibi/cp_loader_it.h index 38a1cdd9c4..5ce62a6a49 100644 --- a/modules/chibi/cp_loader_it.h +++ b/modules/chibi/cp_loader_it.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_loader_it_info.cpp b/modules/chibi/cp_loader_it_info.cpp index 0360f7f9a4..a474fcd2f9 100644 --- a/modules/chibi/cp_loader_it_info.cpp +++ b/modules/chibi/cp_loader_it_info.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_loader_it_instruments.cpp b/modules/chibi/cp_loader_it_instruments.cpp index ccb24bd81c..446e841c5f 100644 --- a/modules/chibi/cp_loader_it_instruments.cpp +++ b/modules/chibi/cp_loader_it_instruments.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_loader_it_patterns.cpp b/modules/chibi/cp_loader_it_patterns.cpp index d951a91620..528d99fff7 100644 --- a/modules/chibi/cp_loader_it_patterns.cpp +++ b/modules/chibi/cp_loader_it_patterns.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_loader_it_samples.cpp b/modules/chibi/cp_loader_it_samples.cpp index ced7252a6c..60db9b7f74 100644 --- a/modules/chibi/cp_loader_it_samples.cpp +++ b/modules/chibi/cp_loader_it_samples.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_loader_mod.cpp b/modules/chibi/cp_loader_mod.cpp index f867b77914..4a47ce5c43 100644 --- a/modules/chibi/cp_loader_mod.cpp +++ b/modules/chibi/cp_loader_mod.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_loader_mod.h b/modules/chibi/cp_loader_mod.h index 636f4f00f2..57f7128bc0 100644 --- a/modules/chibi/cp_loader_mod.h +++ b/modules/chibi/cp_loader_mod.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_loader_s3m.cpp b/modules/chibi/cp_loader_s3m.cpp index 0fc15c1e2f..eb5fad12e1 100644 --- a/modules/chibi/cp_loader_s3m.cpp +++ b/modules/chibi/cp_loader_s3m.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_loader_s3m.h b/modules/chibi/cp_loader_s3m.h index 175e5e80fe..04ee0b2917 100644 --- a/modules/chibi/cp_loader_s3m.h +++ b/modules/chibi/cp_loader_s3m.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_loader_xm.cpp b/modules/chibi/cp_loader_xm.cpp index bff8615a32..65c7bc7ee1 100644 --- a/modules/chibi/cp_loader_xm.cpp +++ b/modules/chibi/cp_loader_xm.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_loader_xm.h b/modules/chibi/cp_loader_xm.h index 9ae480cc8f..0889569b38 100644 --- a/modules/chibi/cp_loader_xm.h +++ b/modules/chibi/cp_loader_xm.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_mixer.h b/modules/chibi/cp_mixer.h index 7ad22ac146..d8564bae00 100644 --- a/modules/chibi/cp_mixer.h +++ b/modules/chibi/cp_mixer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_note.h b/modules/chibi/cp_note.h index 5cfa3f11ec..f9a3ef39fc 100644 --- a/modules/chibi/cp_note.h +++ b/modules/chibi/cp_note.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_order.h b/modules/chibi/cp_order.h index 03ecc00bba..8df67df40c 100644 --- a/modules/chibi/cp_order.h +++ b/modules/chibi/cp_order.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_pattern.cpp b/modules/chibi/cp_pattern.cpp index 83e165bf87..8671b6247d 100644 --- a/modules/chibi/cp_pattern.cpp +++ b/modules/chibi/cp_pattern.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_pattern.h b/modules/chibi/cp_pattern.h index 4065caa5e5..fc3b032523 100644 --- a/modules/chibi/cp_pattern.h +++ b/modules/chibi/cp_pattern.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_player_data.cpp b/modules/chibi/cp_player_data.cpp index 3f3e9a5202..c8cbfbd06e 100644 --- a/modules/chibi/cp_player_data.cpp +++ b/modules/chibi/cp_player_data.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_player_data.h b/modules/chibi/cp_player_data.h index 282592b8f4..c59df5f0d9 100644 --- a/modules/chibi/cp_player_data.h +++ b/modules/chibi/cp_player_data.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_player_data_control.cpp b/modules/chibi/cp_player_data_control.cpp index d9aaed904f..2ef1c1de8c 100644 --- a/modules/chibi/cp_player_data_control.cpp +++ b/modules/chibi/cp_player_data_control.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_player_data_effects.cpp b/modules/chibi/cp_player_data_effects.cpp index 3a52a3b91b..6c774afb16 100644 --- a/modules/chibi/cp_player_data_effects.cpp +++ b/modules/chibi/cp_player_data_effects.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_player_data_envelopes.cpp b/modules/chibi/cp_player_data_envelopes.cpp index 96af42d19f..a720eaf734 100644 --- a/modules/chibi/cp_player_data_envelopes.cpp +++ b/modules/chibi/cp_player_data_envelopes.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_player_data_events.cpp b/modules/chibi/cp_player_data_events.cpp index fb5090461b..7ec3f1931c 100644 --- a/modules/chibi/cp_player_data_events.cpp +++ b/modules/chibi/cp_player_data_events.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_player_data_filter.cpp b/modules/chibi/cp_player_data_filter.cpp index 30db807eed..e04ae126fd 100644 --- a/modules/chibi/cp_player_data_filter.cpp +++ b/modules/chibi/cp_player_data_filter.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_player_data_nna.cpp b/modules/chibi/cp_player_data_nna.cpp index 844f043694..3c50bfb01f 100644 --- a/modules/chibi/cp_player_data_nna.cpp +++ b/modules/chibi/cp_player_data_nna.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_player_data_notes.cpp b/modules/chibi/cp_player_data_notes.cpp index 621be019e1..1bfe24bc20 100644 --- a/modules/chibi/cp_player_data_notes.cpp +++ b/modules/chibi/cp_player_data_notes.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_player_data_utils.cpp b/modules/chibi/cp_player_data_utils.cpp index 170a849863..1ee3f30b33 100644 --- a/modules/chibi/cp_player_data_utils.cpp +++ b/modules/chibi/cp_player_data_utils.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_sample.cpp b/modules/chibi/cp_sample.cpp index 55c2c910a5..bea8835548 100644 --- a/modules/chibi/cp_sample.cpp +++ b/modules/chibi/cp_sample.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_sample.h b/modules/chibi/cp_sample.h index 4b3d218106..c02b220c84 100644 --- a/modules/chibi/cp_sample.h +++ b/modules/chibi/cp_sample.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_sample_defs.h b/modules/chibi/cp_sample_defs.h index 169963c98e..5ae57aed82 100644 --- a/modules/chibi/cp_sample_defs.h +++ b/modules/chibi/cp_sample_defs.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_sample_manager.cpp b/modules/chibi/cp_sample_manager.cpp index 5c2988e3f9..2ad0a720b4 100644 --- a/modules/chibi/cp_sample_manager.cpp +++ b/modules/chibi/cp_sample_manager.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_sample_manager.h b/modules/chibi/cp_sample_manager.h index 74bcafc0cf..b6d47a3013 100644 --- a/modules/chibi/cp_sample_manager.h +++ b/modules/chibi/cp_sample_manager.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_song.cpp b/modules/chibi/cp_song.cpp index 4aa1a4228d..197e44f69d 100644 --- a/modules/chibi/cp_song.cpp +++ b/modules/chibi/cp_song.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_song.h b/modules/chibi/cp_song.h index da5d106a63..ba0fa3e80a 100644 --- a/modules/chibi/cp_song.h +++ b/modules/chibi/cp_song.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_tables.cpp b/modules/chibi/cp_tables.cpp index 8c62150f31..a7ed34ff31 100644 --- a/modules/chibi/cp_tables.cpp +++ b/modules/chibi/cp_tables.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/cp_tables.h b/modules/chibi/cp_tables.h index ac7ee562b7..4baa1c6488 100644 --- a/modules/chibi/cp_tables.h +++ b/modules/chibi/cp_tables.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/event_stream_chibi.cpp b/modules/chibi/event_stream_chibi.cpp index b88f4ee70e..73d1c01e33 100644 --- a/modules/chibi/event_stream_chibi.cpp +++ b/modules/chibi/event_stream_chibi.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -298,9 +298,9 @@ void CPSampleManagerImpl::unlock_data(CPSample_ID p_id){ sd->locks--; if (sd->locks==0) { - sd->w=DVector<uint8_t>::Write(); + sd->w=PoolVector<uint8_t>::Write(); AudioServer::get_singleton()->sample_set_data(sd->rid,sd->lock); - sd->lock=DVector<uint8_t>(); + sd->lock=PoolVector<uint8_t>(); } } @@ -860,7 +860,7 @@ void initialize_chibi() { sample_manager = memnew( CPSampleManagerImpl ); resource_loader = memnew( ResourceFormatLoaderChibi ); - ObjectTypeDB::register_type<EventStreamChibi>(); + ClassDB::register_class<EventStreamChibi>(); ResourceLoader::add_resource_format_loader( resource_loader ); } diff --git a/modules/chibi/event_stream_chibi.h b/modules/chibi/event_stream_chibi.h index cc7b0ace86..0244ee0a95 100644 --- a/modules/chibi/event_stream_chibi.h +++ b/modules/chibi/event_stream_chibi.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -54,8 +54,8 @@ class CPSampleManagerImpl : public CPSampleManager { int loop_begin; int loop_end; int locks; - DVector<uint8_t> lock; - DVector<uint8_t>::Write w; + PoolVector<uint8_t> lock; + PoolVector<uint8_t>::Write w; CPSample_Loop_Type loop_type; }; @@ -223,7 +223,7 @@ class EventStreamChibi; class EventStreamPlaybackChibi : public EventStreamPlayback { - OBJ_TYPE(EventStreamPlaybackChibi,EventStreamPlayback); + GDCLASS(EventStreamPlaybackChibi,EventStreamPlayback); CPMixerImpl mixer; uint64_t total_usec; @@ -275,7 +275,7 @@ public: class EventStreamChibi : public EventStream { - OBJ_TYPE(EventStreamChibi,EventStream); + GDCLASS(EventStreamChibi,EventStream); friend class ResourceFormatLoaderChibi; friend class EventStreamPlaybackChibi; diff --git a/modules/chibi/register_types.cpp b/modules/chibi/register_types.cpp index b2ba16fa03..1a0c808819 100644 --- a/modules/chibi/register_types.cpp +++ b/modules/chibi/register_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/chibi/register_types.h b/modules/chibi/register_types.h index 159823b85d..08856c0744 100644 --- a/modules/chibi/register_types.h +++ b/modules/chibi/register_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/cscript/godot_c.h b/modules/cscript/godot_c.h index b0465d8524..3bf86d1aeb 100644 --- a/modules/cscript/godot_c.h +++ b/modules/cscript/godot_c.h @@ -123,8 +123,8 @@ void GDAPI godot_array_free(godot_array p_array); #define INPUT_EVENT_TYPE_KEY 1 #define INPUT_EVENT_TYPE_MOUSE_MOTION 2 #define INPUT_EVENT_TYPE_MOUSE_BUTTON 3 -#define INPUT_EVENT_TYPE_JOYSTICK_MOTION 4 -#define INPUT_EVENT_TYPE_JOYSTICK_BUTTON 5 +#define INPUT_EVENT_TYPE_JOYPAD_MOTION 4 +#define INPUT_EVENT_TYPE_JOYPAD_BUTTON 5 #define INPUT_EVENT_TYPE_SCREEN_TOUCH 6 #define INPUT_EVENT_TYPE_SCREEN_DRAG 7 #define INPUT_EVENT_TYPE_ACTION 8 @@ -166,12 +166,12 @@ int GDAPI godot_input_event_mouse_motion_get_relative_y(godot_input_event p_even int GDAPI godot_input_event_mouse_motion_get_speed_x(godot_input_event p_event); int GDAPI godot_input_event_mouse_motion_get_speed_y(godot_input_event p_event); -int GDAPI godot_input_event_joystick_motion_get_axis(godot_input_event p_event); -float GDAPI godot_input_event_joystick_motion_get_axis_value(godot_input_event p_event); +int GDAPI godot_input_event_joypad_motion_get_axis(godot_input_event p_event); +float GDAPI godot_input_event_joypad_motion_get_axis_value(godot_input_event p_event); -int GDAPI godot_input_event_joystick_button_get_button_index(godot_input_event p_event); -godot_bool GDAPI godot_input_event_joystick_button_is_pressed(godot_input_event p_event); -float GDAPI godot_input_event_joystick_button_get_pressure(godot_input_event p_event); +int GDAPI godot_input_event_joypad_button_get_button_index(godot_input_event p_event); +godot_bool GDAPI godot_input_event_joypad_button_is_pressed(godot_input_event p_event); +float GDAPI godot_input_event_joypad_button_get_pressure(godot_input_event p_event); int GDAPI godot_input_event_screen_touch_get_index(godot_input_event p_event); diff --git a/modules/cscript/register_types.cpp b/modules/cscript/register_types.cpp index 267e5245ed..d2101bbd49 100644 --- a/modules/cscript/register_types.cpp +++ b/modules/cscript/register_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/cscript/register_types.h b/modules/cscript/register_types.h index a0f41eee5d..6614ee3a19 100644 --- a/modules/cscript/register_types.h +++ b/modules/cscript/register_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/dds/register_types.cpp b/modules/dds/register_types.cpp index 0d28e2bbef..917305f543 100644 --- a/modules/dds/register_types.cpp +++ b/modules/dds/register_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/dds/register_types.h b/modules/dds/register_types.h index f9ecfb8ef9..69f47006e2 100644 --- a/modules/dds/register_types.h +++ b/modules/dds/register_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/dds/texture_loader_dds.cpp b/modules/dds/texture_loader_dds.cpp index 0cc84f02f7..1de98a6b1f 100644 --- a/modules/dds/texture_loader_dds.cpp +++ b/modules/dds/texture_loader_dds.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -74,21 +74,20 @@ struct DDSFormatInfo { static const DDSFormatInfo dds_format_info[DDS_MAX]={ - {"DXT1",true,false,4,8,Image::FORMAT_BC1}, - {"DXT3",true,false,4,16,Image::FORMAT_BC2}, - {"DXT5",true,false,4,16,Image::FORMAT_BC3}, - {"ATI1",true,false,4,8,Image::FORMAT_BC4}, - {"ATI2",true,false,4,16,Image::FORMAT_BC5}, - {"BGRA8",false,false,1,4,Image::FORMAT_RGBA}, - {"BGR8",false,false,1,3,Image::FORMAT_RGB}, - {"RGBA8",false,false,1,4,Image::FORMAT_RGBA}, - {"RGB8",false,false,1,3,Image::FORMAT_RGB}, - {"BGR5A1",false,false,1,2,Image::FORMAT_RGBA}, - {"BGR565",false,false,1,2,Image::FORMAT_RGB}, - {"BGR10A2",false,false,1,4,Image::FORMAT_RGBA}, - {"INDEXED",false,true,1,1,Image::FORMAT_INDEXED}, - {"GRAYSCALE",false,false,1,1,Image::FORMAT_GRAYSCALE}, - {"GRAYSCALE_ALPHA",false,false,1,2,Image::FORMAT_GRAYSCALE_ALPHA} + {"DXT1",true,false,4,8,Image::FORMAT_DXT1}, + {"DXT3",true,false,4,16,Image::FORMAT_DXT3}, + {"DXT5",true,false,4,16,Image::FORMAT_DXT5}, + {"ATI1",true,false,4,8,Image::FORMAT_ATI1}, + {"ATI2",true,false,4,16,Image::FORMAT_ATI2}, + {"BGRA8",false,false,1,4,Image::FORMAT_RGBA8}, + {"BGR8",false,false,1,3,Image::FORMAT_RGB8}, + {"RGBA8",false,false,1,4,Image::FORMAT_RGBA8}, + {"RGB8",false,false,1,3,Image::FORMAT_RGB8}, + {"BGR5A1",false,false,1,2,Image::FORMAT_RGBA8}, + {"BGR565",false,false,1,2,Image::FORMAT_RGB8}, + {"BGR10A2",false,false,1,4,Image::FORMAT_RGBA8}, + {"GRAYSCALE",false,false,1,1,Image::FORMAT_L8}, + {"GRAYSCALE_ALPHA",false,false,1,2,Image::FORMAT_LA8} }; @@ -224,7 +223,7 @@ RES ResourceFormatDDS::load(const String &p_path, const String& p_original_path, // print_line("found format: "+String(dds_format_info[dds_format].name)); - DVector<uint8_t> src_data; + PoolVector<uint8_t> src_data; const DDSFormatInfo &info=dds_format_info[dds_format]; uint32_t w = width; @@ -248,9 +247,9 @@ RES ResourceFormatDDS::load(const String &p_path, const String& p_original_path, } src_data.resize(size); - DVector<uint8_t>::Write wb = src_data.write(); + PoolVector<uint8_t>::Write wb = src_data.write(); f->get_buffer(wb.ptr(),size); - wb=DVector<uint8_t>::Write(); + wb=PoolVector<uint8_t>::Write(); } else if (info.palette) { @@ -282,7 +281,7 @@ RES ResourceFormatDDS::load(const String &p_path, const String& p_original_path, } src_data.resize(size + 256*colsize ); - DVector<uint8_t>::Write wb = src_data.write(); + PoolVector<uint8_t>::Write wb = src_data.write(); f->get_buffer(wb.ptr(),size); for(int i=0;i<256;i++) { @@ -297,7 +296,7 @@ RES ResourceFormatDDS::load(const String &p_path, const String& p_original_path, } - wb=DVector<uint8_t>::Write(); + wb=PoolVector<uint8_t>::Write(); } else { //uncompressed generic... @@ -317,7 +316,7 @@ RES ResourceFormatDDS::load(const String &p_path, const String& p_original_path, size=size*2; src_data.resize(size); - DVector<uint8_t>::Write wb = src_data.write(); + PoolVector<uint8_t>::Write wb = src_data.write(); f->get_buffer(wb.ptr(),size); @@ -450,7 +449,7 @@ RES ResourceFormatDDS::load(const String &p_path, const String& p_original_path, } - wb=DVector<uint8_t>::Write(); + wb=PoolVector<uint8_t>::Write(); } @@ -474,7 +473,7 @@ void ResourceFormatDDS::get_recognized_extensions(List<String> *p_extensions) co bool ResourceFormatDDS::handles_type(const String& p_type) const { - return ObjectTypeDB::is_type(p_type,"Texture"); + return ClassDB::is_parent_class(p_type,"Texture"); } String ResourceFormatDDS::get_resource_type(const String &p_path) const { diff --git a/modules/dds/texture_loader_dds.h b/modules/dds/texture_loader_dds.h index 371eb1858c..d09af680c7 100644 --- a/modules/dds/texture_loader_dds.h +++ b/modules/dds/texture_loader_dds.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/enet/networked_multiplayer_enet.cpp b/modules/enet/networked_multiplayer_enet.cpp index a82283591d..43d9988de1 100644 --- a/modules/enet/networked_multiplayer_enet.cpp +++ b/modules/enet/networked_multiplayer_enet.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -77,7 +77,7 @@ Error NetworkedMultiplayerENet::create_server(int p_port, int p_max_clients, int Error NetworkedMultiplayerENet::create_client(const IP_Address& p_ip, int p_port, int p_in_bandwidth, int p_out_bandwidth){ ERR_FAIL_COND_V(active,ERR_ALREADY_IN_USE); - ERR_FAIL_COND_V(p_ip.type != IP_Address::TYPE_IPV4, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V(!p_ip.is_ipv4(), ERR_INVALID_PARAMETER); host = enet_host_create (NULL /* create a client host */, 1 /* only allow 1 outgoing connection */, @@ -91,7 +91,7 @@ Error NetworkedMultiplayerENet::create_client(const IP_Address& p_ip, int p_port _setup_compressor(); ENetAddress address; - address.host=p_ip.field32[0]; + address.host=*((uint32_t *)p_ip.get_ipv4()); address.port=p_port; //enet_address_set_host (& address, "localhost"); @@ -150,8 +150,7 @@ void NetworkedMultiplayerENet::poll(){ } IP_Address ip; - ip.type = IP_Address::TYPE_IPV4; - ip.field32[0]=event.peer -> address.host; + ip.set_ipv4((uint8_t *)&(event.peer -> address.host)); int *new_id = memnew( int ); *new_id = event.data; @@ -644,12 +643,12 @@ void NetworkedMultiplayerENet::enet_compressor_destroy(void * context){ void NetworkedMultiplayerENet::_bind_methods() { - ObjectTypeDB::bind_method(_MD("create_server","port","max_clients","in_bandwidth","out_bandwidth"),&NetworkedMultiplayerENet::create_server,DEFVAL(32),DEFVAL(0),DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("create_client","ip","port","in_bandwidth","out_bandwidth"),&NetworkedMultiplayerENet::create_client,DEFVAL(0),DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("close_connection"),&NetworkedMultiplayerENet::close_connection); - ObjectTypeDB::bind_method(_MD("set_compression_mode","mode"),&NetworkedMultiplayerENet::set_compression_mode); - ObjectTypeDB::bind_method(_MD("get_compression_mode"),&NetworkedMultiplayerENet::get_compression_mode); - ObjectTypeDB::bind_method(_MD("set_bind_ip", "ip"),&NetworkedMultiplayerENet::set_bind_ip); + ClassDB::bind_method(_MD("create_server","port","max_clients","in_bandwidth","out_bandwidth"),&NetworkedMultiplayerENet::create_server,DEFVAL(32),DEFVAL(0),DEFVAL(0)); + ClassDB::bind_method(_MD("create_client","ip","port","in_bandwidth","out_bandwidth"),&NetworkedMultiplayerENet::create_client,DEFVAL(0),DEFVAL(0)); + ClassDB::bind_method(_MD("close_connection"),&NetworkedMultiplayerENet::close_connection); + ClassDB::bind_method(_MD("set_compression_mode","mode"),&NetworkedMultiplayerENet::set_compression_mode); + ClassDB::bind_method(_MD("get_compression_mode"),&NetworkedMultiplayerENet::get_compression_mode); + ClassDB::bind_method(_MD("set_bind_ip", "ip"),&NetworkedMultiplayerENet::set_bind_ip); BIND_CONSTANT( COMPRESS_NONE ); BIND_CONSTANT( COMPRESS_RANGE_CODER ); @@ -685,6 +684,6 @@ NetworkedMultiplayerENet::~NetworkedMultiplayerENet(){ // sets IP for ENet to bind when using create_server // if no IP is set, then ENet bind to ENET_HOST_ANY void NetworkedMultiplayerENet::set_bind_ip(const IP_Address& p_ip){ - ERR_FAIL_COND(p_ip.type != IP_Address::TYPE_IPV4); - bind_ip=p_ip.field32[0]; + ERR_FAIL_COND(!p_ip.is_ipv4()); + bind_ip=*(uint32_t *)p_ip.get_ipv4(); } diff --git a/modules/enet/networked_multiplayer_enet.h b/modules/enet/networked_multiplayer_enet.h index 3db318c96a..dcf8c2429b 100644 --- a/modules/enet/networked_multiplayer_enet.h +++ b/modules/enet/networked_multiplayer_enet.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class NetworkedMultiplayerENet : public NetworkedMultiplayerPeer { - OBJ_TYPE(NetworkedMultiplayerENet,NetworkedMultiplayerPeer) + GDCLASS(NetworkedMultiplayerENet,NetworkedMultiplayerPeer) public: enum CompressionMode { COMPRESS_NONE, diff --git a/modules/enet/register_types.cpp b/modules/enet/register_types.cpp index 630b76ced8..2b4dd35d33 100644 --- a/modules/enet/register_types.cpp +++ b/modules/enet/register_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -40,7 +40,7 @@ void register_enet_types() { enet_ok=true; } - ObjectTypeDB::register_type<NetworkedMultiplayerENet>(); + ClassDB::register_class<NetworkedMultiplayerENet>(); } void unregister_enet_types() { diff --git a/modules/enet/register_types.h b/modules/enet/register_types.h index 50f34dc67f..14cb1ba868 100644 --- a/modules/enet/register_types.h +++ b/modules/enet/register_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/etc1/image_etc.cpp b/modules/etc1/image_etc.cpp index cf2384240b..845084fef7 100644 --- a/modules/etc1/image_etc.cpp +++ b/modules/etc1/image_etc.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,19 +37,19 @@ static void _decompress_etc(Image *p_img) { int imgw = p_img->get_width(); int imgh = p_img->get_height(); - DVector<uint8_t> src=p_img->get_data(); - DVector<uint8_t> dst; + PoolVector<uint8_t> src=p_img->get_data(); + PoolVector<uint8_t> dst; - DVector<uint8_t>::Read r = src.read(); + PoolVector<uint8_t>::Read r = src.read(); - int mmc=p_img->get_mipmaps(); + int mmc=p_img->get_mipmap_count(); for(int i=0;i<=mmc;i++) { dst.resize(dst.size()+imgw*imgh*3); const uint8_t *srcbr=&r[p_img->get_mipmap_offset(i)]; - DVector<uint8_t>::Write w = dst.write(); + PoolVector<uint8_t>::Write w = dst.write(); uint8_t *wptr = &w[dst.size()-imgw*imgh*3]; @@ -91,11 +91,11 @@ static void _decompress_etc(Image *p_img) { } - r=DVector<uint8_t>::Read(); + r=PoolVector<uint8_t>::Read(); //print_line("Re Creating ETC into regular image: w "+itos(p_img->get_width())+" h "+itos(p_img->get_height())+" mm "+itos(p_img->get_mipmaps())); - *p_img=Image(p_img->get_width(),p_img->get_height(),p_img->get_mipmaps(),Image::FORMAT_RGB,dst); - if (p_img->get_mipmaps()) - p_img->generate_mipmaps(-1,true); + *p_img=Image(p_img->get_width(),p_img->get_height(),p_img->has_mipmaps(),Image::FORMAT_RGB8,dst); + if (p_img->has_mipmaps()) + p_img->generate_mipmaps(true); } @@ -108,18 +108,18 @@ static void _compress_etc(Image *p_img) { ERR_FAIL_COND( nearest_power_of_2(imgw)!=imgw || nearest_power_of_2(imgh)!=imgh ); - if (img.get_format()!=Image::FORMAT_RGB) - img.convert(Image::FORMAT_RGB); + if (img.get_format()!=Image::FORMAT_RGB8) + img.convert(Image::FORMAT_RGB8); - int mmc=img.get_mipmaps(); + int mmc=img.get_mipmap_count(); if (mmc==0) img.generate_mipmaps(); // force mipmaps, so it works on most hardware - DVector<uint8_t> res_data; - DVector<uint8_t> dst_data; - DVector<uint8_t>::Read r = img.get_data().read(); + PoolVector<uint8_t> res_data; + PoolVector<uint8_t> dst_data; + PoolVector<uint8_t>::Read r = img.get_data().read(); int mc=0; @@ -134,7 +134,7 @@ static void _compress_etc(Image *p_img) { const uint8_t *src = &r[img.get_mipmap_offset(i)]; int mmsize = MAX(bw,1)*MAX(bh,1)*8; dst_data.resize(dst_data.size()+mmsize); - DVector<uint8_t>::Write w=dst_data.write(); + PoolVector<uint8_t>::Write w=dst_data.write(); uint8_t *dst = &w[dst_data.size()-mmsize]; @@ -186,7 +186,7 @@ static void _compress_etc(Image *p_img) { } - *p_img=Image(p_img->get_width(),p_img->get_height(),mc-1,Image::FORMAT_ETC,dst_data); + *p_img=Image(p_img->get_width(),p_img->get_height(),(mc-1)?true:false,Image::FORMAT_ETC,dst_data); } diff --git a/modules/etc1/image_etc.h b/modules/etc1/image_etc.h index edcff39bfd..6ab10126f8 100644 --- a/modules/etc1/image_etc.h +++ b/modules/etc1/image_etc.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/etc1/register_types.cpp b/modules/etc1/register_types.cpp index e9eba6c864..d02ef83478 100644 --- a/modules/etc1/register_types.cpp +++ b/modules/etc1/register_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/etc1/register_types.h b/modules/etc1/register_types.h index bc26699d54..fe92496cea 100644 --- a/modules/etc1/register_types.h +++ b/modules/etc1/register_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/etc1/texture_loader_pkm.cpp b/modules/etc1/texture_loader_pkm.cpp index 275afc1fd6..42c9937b8f 100644 --- a/modules/etc1/texture_loader_pkm.cpp +++ b/modules/etc1/texture_loader_pkm.cpp @@ -43,13 +43,13 @@ RES ResourceFormatPKM::load(const String &p_path, const String& p_original_path, h.origWidth = f->get_16(); h.origHeight = f->get_16(); - DVector<uint8_t> src_data; + PoolVector<uint8_t> src_data; uint32_t size = h.texWidth * h.texHeight / 2; src_data.resize(size); - DVector<uint8_t>::Write wb = src_data.write(); + PoolVector<uint8_t>::Write wb = src_data.write(); f->get_buffer(wb.ptr(),size); - wb=DVector<uint8_t>::Write(); + wb=PoolVector<uint8_t>::Write(); int mipmaps = h.format; int width = h.origWidth; @@ -73,7 +73,7 @@ void ResourceFormatPKM::get_recognized_extensions(List<String> *p_extensions) co bool ResourceFormatPKM::handles_type(const String& p_type) const { - return ObjectTypeDB::is_type(p_type,"Texture"); + return ClassDB::is_parent_class(p_type,"Texture"); } String ResourceFormatPKM::get_resource_type(const String &p_path) const { diff --git a/modules/freetype/register_types.cpp b/modules/freetype/register_types.cpp index 2b9f47f54c..2579a925d4 100644 --- a/modules/freetype/register_types.cpp +++ b/modules/freetype/register_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/freetype/register_types.h b/modules/freetype/register_types.h index 326cd2e6ea..2837898123 100644 --- a/modules/freetype/register_types.h +++ b/modules/freetype/register_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/freetype/uwpdef.h b/modules/freetype/uwpdef.h index c7dce80461..b4aabb1929 100644 --- a/modules/freetype/uwpdef.h +++ b/modules/freetype/uwpdef.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/gdscript/gd_compiler.cpp b/modules/gdscript/gd_compiler.cpp index b75b13551e..7483af298c 100644 --- a/modules/gdscript/gd_compiler.cpp +++ b/modules/gdscript/gd_compiler.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -29,6 +29,31 @@ #include "gd_compiler.h" #include "gd_script.h" +bool GDCompiler::_is_class_member_property(CodeGen & codegen, const StringName & p_name) { + + if (!codegen.function_node || codegen.function_node->_static) + return false; + + return _is_class_member_property(codegen.script,p_name); +} + +bool GDCompiler::_is_class_member_property(GDScript *owner, const StringName & p_name) { + + + GDScript *scr = owner; + GDNativeClass *nc=NULL; + while(scr) { + + if (scr->native.is_valid()) + nc=scr->native.ptr(); + scr=scr->_base; + } + + ERR_FAIL_COND_V(!nc,false); + + return ClassDB::has_property(nc->get_name(),p_name); +} + void GDCompiler::_set_error(const String& p_error,const GDParser::Node *p_node) { @@ -164,6 +189,17 @@ int GDCompiler::_parse_expression(CodeGen& codegen,const GDParser::Node *p_expre StringName identifier = in->name; + + if (_is_class_member_property(codegen,identifier)) { + //get property + codegen.opcodes.push_back(GDFunction::OPCODE_GET_MEMBER); // perform operator + codegen.opcodes.push_back(codegen.get_name_map_pos(identifier)); // argument 2 (unary only takes one parameter) + int dst_addr=(p_stack_level)|(GDFunction::ADDR_TYPE_STACK<<GDFunction::ADDR_BITS); + codegen.opcodes.push_back(dst_addr); // append the stack level as destination address of the opcode + codegen.alloc_stack(p_stack_level); + return dst_addr; + } + // TRY STACK! if (!p_initializer && codegen.stack_identifiers.has(identifier)) { @@ -208,7 +244,7 @@ int GDCompiler::_parse_expression(CodeGen& codegen,const GDParser::Node *p_expre if (nc) { bool success=false; - int constant = ObjectTypeDB::get_integer_constant(nc->get_name(),identifier,&success); + int constant = ClassDB::get_integer_constant(nc->get_name(),identifier,&success); if (success) { Variant key=constant; int idx; @@ -776,6 +812,8 @@ int GDCompiler::_parse_expression(CodeGen& codegen,const GDParser::Node *p_expre /* Find chain of sets */ + StringName assign_property; + List<GDParser::OperatorNode*> chain; { @@ -784,8 +822,20 @@ int GDCompiler::_parse_expression(CodeGen& codegen,const GDParser::Node *p_expre while(true) { chain.push_back(n); - if (n->arguments[0]->type!=GDParser::Node::TYPE_OPERATOR) + if (n->arguments[0]->type!=GDParser::Node::TYPE_OPERATOR) { + + //check for a built-in property + if (n->arguments[0]->type==GDParser::Node::TYPE_IDENTIFIER) { + + GDParser::IdentifierNode *identifier = static_cast<GDParser::IdentifierNode*>(n->arguments[0]); + if (_is_class_member_property(codegen,identifier->name)) { + assign_property = identifier->name; + + } + + } break; + } n = static_cast<GDParser::OperatorNode*>(n->arguments[0]); if (n->op!=GDParser::OperatorNode::OP_INDEX && n->op!=GDParser::OperatorNode::OP_INDEX_NAMED) break; @@ -810,6 +860,17 @@ int GDCompiler::_parse_expression(CodeGen& codegen,const GDParser::Node *p_expre Vector<int> setchain; + + if (assign_property!=StringName()) { + + // recover and assign at the end, this allows stuff like + // position.x+=2.0 + // in Node2D + setchain.push_back(prev_pos); + setchain.push_back(codegen.get_name_map_pos(assign_property)); + setchain.push_back(GDFunction::OPCODE_SET_MEMBER); + } + for(List<GDParser::OperatorNode*>::Element *E=chain.back();E;E=E->prev()) { @@ -840,7 +901,7 @@ int GDCompiler::_parse_expression(CodeGen& codegen,const GDParser::Node *p_expre } - if (key_idx<0) + if (key_idx<0) //error return key_idx; codegen.opcodes.push_back(named ? GDFunction::OPCODE_GET_NAMED : GDFunction::OPCODE_GET); @@ -852,7 +913,10 @@ int GDCompiler::_parse_expression(CodeGen& codegen,const GDParser::Node *p_expre codegen.opcodes.push_back(dst_pos); + //add in reverse order, since it will be reverted + + setchain.push_back(dst_pos); setchain.push_back(key_idx); setchain.push_back(prev_pos); @@ -881,7 +945,7 @@ int GDCompiler::_parse_expression(CodeGen& codegen,const GDParser::Node *p_expre } - if (set_index<0) + if (set_index<0) //error return set_index; if (set_index&GDFunction::ADDR_TYPE_STACK<<GDFunction::ADDR_BITS) { @@ -891,7 +955,7 @@ int GDCompiler::_parse_expression(CodeGen& codegen,const GDParser::Node *p_expre int set_value = _parse_assign_right_expression(codegen,on,slevel+1); - if (set_value<0) + if (set_value<0) //error return set_value; codegen.opcodes.push_back(named?GDFunction::OPCODE_SET_NAMED:GDFunction::OPCODE_SET); @@ -899,20 +963,36 @@ int GDCompiler::_parse_expression(CodeGen& codegen,const GDParser::Node *p_expre codegen.opcodes.push_back(set_index); codegen.opcodes.push_back(set_value); - for(int i=0;i<setchain.size();i+=4) { + for(int i=0;i<setchain.size();i++) { - codegen.opcodes.push_back(setchain[i+0]); - codegen.opcodes.push_back(setchain[i+1]); - codegen.opcodes.push_back(setchain[i+2]); - codegen.opcodes.push_back(setchain[i+3]); + codegen.opcodes.push_back(setchain[i]); } return retval; + } else if (on->arguments[0]->type==GDParser::Node::TYPE_IDENTIFIER && _is_class_member_property(codegen,static_cast<GDParser::IdentifierNode*>(on->arguments[0])->name)) { + //assignment to member property + + int slevel = p_stack_level; + + int src_address = _parse_assign_right_expression(codegen,on,slevel); + if (src_address<0) + return -1; + + StringName name = static_cast<GDParser::IdentifierNode*>(on->arguments[0])->name; + + codegen.opcodes.push_back(GDFunction::OPCODE_SET_MEMBER); + codegen.opcodes.push_back(codegen.get_name_map_pos(name)); + codegen.opcodes.push_back(src_address); + + return GDFunction::ADDR_TYPE_NIL<<GDFunction::ADDR_BITS; } else { - //ASSIGNMENT MODE!! + + + + //REGULAR ASSIGNMENT MODE!! int slevel = p_stack_level; @@ -1211,6 +1291,11 @@ Error GDCompiler::_parse_block(CodeGen& codegen,const GDParser::BlockNode *p_blo const GDParser::LocalVarNode *lv = static_cast<const GDParser::LocalVarNode*>(s); + if (_is_class_member_property(codegen,lv->name)) { + _set_error("Name for local variable '"+String(lv->name)+"' can't shadow class property of the same name.",lv); + return ERR_ALREADY_EXISTS; + } + codegen.add_stack_identifier(lv->name,p_stack_level++); codegen.alloc_stack(p_stack_level); new_identifiers++; @@ -1249,6 +1334,10 @@ Error GDCompiler::_parse_function(GDScript *p_script,const GDParser::ClassNode * if (p_func) { for(int i=0;i<p_func->arguments.size();i++) { + if (_is_class_member_property(p_script,p_func->arguments[i])) { + _set_error("Name for argument '"+String(p_func->arguments[i])+"' can't shadow class property of the same name.",p_func); + return ERR_ALREADY_EXISTS; + } codegen.add_stack_identifier(p_func->arguments[i],i); #ifdef TOOLS_ENABLED argnames.push_back(p_func->arguments[i]); @@ -1653,6 +1742,10 @@ Error GDCompiler::_parse_class(GDScript *p_script, GDScript *p_owner, const GDPa _set_error("Member '"+name+"' already exists (in current or parent class)",p_class); return ERR_ALREADY_EXISTS; } + if (_is_class_member_property(p_script,name)) { + _set_error("Member '"+name+"' already exists as a class property.",p_class); + return ERR_ALREADY_EXISTS; + } if (p_class->variables[i]._export.type!=Variant::NIL) { @@ -1691,6 +1784,11 @@ Error GDCompiler::_parse_class(GDScript *p_script, GDScript *p_owner, const GDPa StringName name = p_class->constant_expressions[i].identifier; ERR_CONTINUE( p_class->constant_expressions[i].expression->type!=GDParser::Node::TYPE_CONSTANT ); + if (_is_class_member_property(p_script,name)) { + _set_error("Member '"+name+"' already exists as a class property.",p_class); + return ERR_ALREADY_EXISTS; + } + GDParser::ConstantNode *constant = static_cast<GDParser::ConstantNode*>(p_class->constant_expressions[i].expression); p_script->constants.insert(name,constant->value); @@ -1723,7 +1821,7 @@ Error GDCompiler::_parse_class(GDScript *p_script, GDScript *p_owner, const GDPa } if (native.is_valid()) { - if (ObjectTypeDB::has_signal(native->get_name(),name)) { + if (ClassDB::has_signal(native->get_name(),name)) { _set_error("Signal '"+name+"' redefined (original in native class '"+String(native->get_name())+"')",p_class); return ERR_ALREADY_EXISTS; } diff --git a/modules/gdscript/gd_compiler.h b/modules/gdscript/gd_compiler.h index 7cf575e3d6..dd211a852c 100644 --- a/modules/gdscript/gd_compiler.h +++ b/modules/gdscript/gd_compiler.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,6 +37,7 @@ class GDCompiler { const GDParser *parser; struct CodeGen { + GDScript *script; const GDParser::ClassNode *class_node; const GDParser::FunctionNode *function_node; @@ -134,6 +135,9 @@ class GDCompiler { Ref<GDScript> _parse_class(GDParser::ClassNode *p_class); #endif + bool _is_class_member_property(CodeGen & codegen, const StringName & p_name); + bool _is_class_member_property(GDScript *owner, const StringName & p_name); + void _set_error(const String& p_error,const GDParser::Node *p_node); bool _create_unary_operator(CodeGen& codegen,const GDParser::OperatorNode *on,Variant::Operator op, int p_stack_level); diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp index c3e59836a2..00b080190f 100644 --- a/modules/gdscript/gd_editor.cpp +++ b/modules/gdscript/gd_editor.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -325,7 +325,7 @@ void GDScriptLanguage::get_public_constants(List<Pair<String,Variant> > *p_const p_constants->push_back(pi); } -String GDScriptLanguage::make_function(const String& p_class,const String& p_name,const StringArray& p_args) const { +String GDScriptLanguage::make_function(const String& p_class,const String& p_name,const PoolStringArray& p_args) const { String s="func "+p_name+"("; if (p_args.size()) { @@ -368,7 +368,7 @@ static GDCompletionIdentifier _get_type_from_variant(const Variant& p_variant) { // t.obj_type=obj->cast_to<GDNativeClass>()->get_name(); // t.value=Variant(); //} else { - t.obj_type=obj->get_type(); + t.obj_type=obj->get_class(); //} } } @@ -614,10 +614,10 @@ static bool _guess_expression_type(GDCompletionContext& context,const GDParser:: } } - if (ObjectTypeDB::has_method(base.obj_type,id)) { + if (ClassDB::has_method(base.obj_type,id)) { #ifdef TOOLS_ENABLED - MethodBind *mb = ObjectTypeDB::get_method(base.obj_type,id); + MethodBind *mb = ClassDB::get_method(base.obj_type,id); PropertyInfo pi = mb->get_argument_info(-1); //try calling the function if constant and all args are constant, should not crash.. @@ -643,14 +643,14 @@ static bool _guess_expression_type(GDCompletionContext& context,const GDParser:: } } - if (all_valid && String(id)=="get_node" && ObjectTypeDB::is_type(base.obj_type,"Node") && args.size()) { + if (all_valid && String(id)=="get_node" && ClassDB::is_parent_class(base.obj_type,"Node") && args.size()) { String arg1=args[0]; if (arg1.begins_with("/root/")) { String which = arg1.get_slice("/",2); if (which!="") { List<PropertyInfo> props; - Globals::get_singleton()->get_property_list(&props); + GlobalConfig::get_singleton()->get_property_list(&props); //print_line("find singleton"); for(List<PropertyInfo>::Element *E=props.front();E;E=E->next()) { @@ -662,7 +662,7 @@ static bool _guess_expression_type(GDCompletionContext& context,const GDParser:: String name = s.get_slice("/",1); //print_line("name: "+name+", which: "+which); if (name==which) { - String script = Globals::get_singleton()->get(s); + String script = GlobalConfig::get_singleton()->get(s); if (!script.begins_with("res://")) { script="res://"+script; @@ -940,6 +940,15 @@ static bool _guess_expression_type(GDCompletionContext& context,const GDParser:: static bool _guess_identifier_type_in_block(GDCompletionContext& context,int p_line,const StringName& p_identifier,GDCompletionIdentifier &r_type) { + GDCompletionIdentifier gdi = _get_native_class(context); + if (gdi.obj_type!=StringName()) { + bool valid; + Variant::Type t = ClassDB::get_property_type(gdi.obj_type,p_identifier,&valid); + if (t!=Variant::NIL && valid) { + r_type.type=t; + return true; + } + } const GDParser::Node *last_assign=NULL; int last_assign_line=-1; @@ -1068,7 +1077,7 @@ static bool _guess_identifier_type(GDCompletionContext& context,int p_line,const //this kinda sucks but meh List<MethodInfo> vmethods; - ObjectTypeDB::get_virtual_methods(id.obj_type,&vmethods); + ClassDB::get_virtual_methods(id.obj_type,&vmethods); for (List<MethodInfo>::Element *E=vmethods.front();E;E=E->next()) { @@ -1142,7 +1151,7 @@ static bool _guess_identifier_type(GDCompletionContext& context,int p_line,const //autoloads as singletons List<PropertyInfo> props; - Globals::get_singleton()->get_property_list(&props); + GlobalConfig::get_singleton()->get_property_list(&props); for(List<PropertyInfo>::Element *E=props.front();E;E=E->next()) { @@ -1152,7 +1161,7 @@ static bool _guess_identifier_type(GDCompletionContext& context,int p_line,const String name = s.get_slice("/",1); if (name==String(p_identifier)) { - String path = Globals::get_singleton()->get(s); + String path = GlobalConfig::get_singleton()->get(s); if (path.begins_with("*")) { String script =path.substr(1,path.length()); @@ -1298,26 +1307,43 @@ static void _find_identifiers_in_class(GDCompletionContext& context,bool p_stati base=script->get_native(); } else if (nc.is_valid()) { + StringName type = nc->get_name(); + if (!p_only_functions) { - StringName type = nc->get_name(); + List<String> constants; - ObjectTypeDB::get_integer_constant_list(type,&constants); + ClassDB::get_integer_constant_list(type,&constants); for(List<String>::Element *E=constants.front();E;E=E->next()) { result.insert(E->get()); } - List<MethodInfo> methods; - ObjectTypeDB::get_method_list(type,&methods); - for(List<MethodInfo>::Element *E=methods.front();E;E=E->next()) { - if (E->get().name.begins_with("_")) + List<PropertyInfo> pinfo; + + ClassDB::get_property_list(type,&pinfo); + + for (List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) { + if (E->get().usage&(PROPERTY_USAGE_GROUP|PROPERTY_USAGE_CATEGORY)) continue; - if (E->get().arguments.size()) - result.insert(E->get().name+"("); - else - result.insert(E->get().name+"()"); + if (E->get().name.find("/")!=-1) + continue; + result.insert(E->get().name); } + } + List<MethodInfo> methods; + ClassDB::get_method_list(type,&methods); + for(List<MethodInfo>::Element *E=methods.front();E;E=E->next()) { + if (E->get().name.begins_with("_")) + continue; + if (E->get().arguments.size()) + result.insert(E->get().name+"("); + else + result.insert(E->get().name+"()"); + } + + + break; } else break; @@ -1367,7 +1393,7 @@ static void _find_identifiers(GDCompletionContext& context,int p_line,bool p_onl } static const char*_type_names[Variant::VARIANT_MAX]={ - "null","bool","int","float","String","Vector2","Rect2","Vector3","Matrix32","Plane","Quat","AABB","Matrix3","Transform", + "null","bool","int","float","String","Vector2","Rect2","Vector3","Transform2D","Plane","Quat","AABB","Basis","Transform", "Color","Image","NodePath","RID","Object","InputEvent","Dictionary","Array","RawArray","IntArray","FloatArray","StringArray", "Vector2Array","Vector3Array","ColorArray"}; @@ -1377,7 +1403,7 @@ static void _find_identifiers(GDCompletionContext& context,int p_line,bool p_onl //autoload singletons List<PropertyInfo> props; - Globals::get_singleton()->get_property_list(&props); + GlobalConfig::get_singleton()->get_property_list(&props); for(List<PropertyInfo>::Element *E=props.front();E;E=E->next()) { @@ -1385,7 +1411,7 @@ static void _find_identifiers(GDCompletionContext& context,int p_line,bool p_onl if (!s.begins_with("autoload/")) continue; String name = s.get_slice("/",1); - String path = Globals::get_singleton()->get(s); + String path = GlobalConfig::get_singleton()->get(s); if (path.begins_with("*")) { result.insert(name); } @@ -1470,7 +1496,7 @@ static void _find_type_arguments(GDCompletionContext& context,const GDParser::No if (id.type==Variant::INPUT_EVENT && String(p_method)=="is_action" && p_argidx==0) { List<PropertyInfo> pinfo; - Globals::get_singleton()->get_property_list(&pinfo); + GlobalConfig::get_singleton()->get_property_list(&pinfo); for(List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) { const PropertyInfo &pi=E->get(); @@ -1486,7 +1512,7 @@ static void _find_type_arguments(GDCompletionContext& context,const GDParser::No } else if (id.type==Variant::OBJECT && id.obj_type!=StringName()) { - MethodBind *m = ObjectTypeDB::get_method(id.obj_type,p_method); + MethodBind *m = ClassDB::get_method(id.obj_type,p_method); if (!m) { //not in static method, see script @@ -1699,7 +1725,7 @@ static void _find_type_arguments(GDCompletionContext& context,const GDParser::No if (p_argidx==0) { List<MethodInfo> sigs; - ObjectTypeDB::get_signal_list(id.obj_type,&sigs); + ClassDB::get_signal_list(id.obj_type,&sigs); if (id.script.is_valid()) { id.script->get_script_signal_list(&sigs); @@ -1735,10 +1761,10 @@ static void _find_type_arguments(GDCompletionContext& context,const GDParser::No }*/ } else { - if (p_argidx==0 && (String(p_method)=="get_node" || String(p_method)=="has_node") && ObjectTypeDB::is_type(id.obj_type,"Node")) { + if (p_argidx==0 && (String(p_method)=="get_node" || String(p_method)=="has_node") && ClassDB::is_parent_class(id.obj_type,"Node")) { List<PropertyInfo> props; - Globals::get_singleton()->get_property_list(&props); + GlobalConfig::get_singleton()->get_property_list(&props); for(List<PropertyInfo>::Element *E=props.front();E;E=E->next()) { @@ -1970,7 +1996,7 @@ static void _find_call_arguments(GDCompletionContext& context,const GDParser::No //guess type.. /* List<MethodInfo> methods; - ObjectTypeDB::get_method_list(type,&methods); + ClassDB::get_method_list(type,&methods); for(List<MethodInfo>::Element *E=methods.front();E;E=E->next()) { //if (E->get().arguments.size()) // result.insert(E->get().name+"("); @@ -2063,13 +2089,13 @@ static void _find_call_arguments(GDCompletionContext& context,const GDParser::No StringName type = nc->get_name(); List<String> constants; - ObjectTypeDB::get_integer_constant_list(type,&constants); + ClassDB::get_integer_constant_list(type,&constants); for(List<String>::Element *E=constants.front();E;E=E->next()) { result.insert(E->get()); } List<MethodInfo> methods; - ObjectTypeDB::get_method_list(type,&methods); + ClassDB::get_method_list(type,&methods); for(List<MethodInfo>::Element *E=methods.front();E;E=E->next()) { if (E->get().arguments.size()) result.insert(E->get().name+"("); @@ -2129,6 +2155,27 @@ Error GDScriptLanguage::complete_code(const String& p_code, const String& p_base case GDParser::COMPLETION_PARENT_FUNCTION: { } break; + case GDParser::COMPLETION_GET_NODE: { + + if (p_owner) { + List<String> opts; + p_owner->get_argument_options("get_node",0,&opts); + + for (List<String>::Element *E=opts.front();E;E=E->next()) { + + String opt = E->get().strip_edges(); + if (opt.begins_with("\"") && opt.ends_with("\"")) { + String idopt=opt.substr(1,opt.length()-2); + if (idopt.replace("/","_").is_valid_identifier()) { + options.insert(idopt); + } else { + options.insert(opt); + } + } + } + + } + } break; case GDParser::COMPLETION_METHOD: isfunction=true; case GDParser::COMPLETION_INDEX: { @@ -2149,10 +2196,21 @@ Error GDScriptLanguage::complete_code(const String& p_code, const String& p_base if (gdn.is_valid()) { StringName cn = gdn->get_name(); List<String> cnames; - ObjectTypeDB::get_integer_constant_list(cn,&cnames); + ClassDB::get_integer_constant_list(cn,&cnames); for (List<String>::Element *E=cnames.front();E;E=E->next()) { options.insert(E->get()); } + + List<PropertyInfo> pinfo; + ClassDB::get_property_list(cn,&pinfo); + + for (List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) { + if (E->get().usage&(PROPERTY_USAGE_GROUP|PROPERTY_USAGE_CATEGORY)) + continue; + if (E->get().name.find("/")!=-1) + continue; + options.insert(E->get().name); + } } } else if (t.type==Variant::OBJECT && t.obj_type!=StringName()) { @@ -2288,10 +2346,23 @@ Error GDScriptLanguage::complete_code(const String& p_code, const String& p_base if (!isfunction) { - ObjectTypeDB::get_integer_constant_list(t.obj_type,r_options); + ClassDB::get_integer_constant_list(t.obj_type,r_options); + + List<PropertyInfo> pinfo; + ClassDB::get_property_list(t.obj_type,&pinfo); + + for (List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) { + if (E->get().usage&(PROPERTY_USAGE_GROUP|PROPERTY_USAGE_CATEGORY)) + continue; + if (E->get().name.find("/")!=-1) + continue; + r_options->push_back(E->get().name); + } } + + List<MethodInfo> mi; - ObjectTypeDB::get_method_list(t.obj_type,&mi); + ClassDB::get_method_list(t.obj_type,&mi); for (List<MethodInfo>::Element *E=mi.front();E;E=E->next()) { if (E->get().name.begins_with("_")) @@ -2320,8 +2391,8 @@ Error GDScriptLanguage::complete_code(const String& p_code, const String& p_base "# Key", "# MouseMotion", "# MouseButton", - "# JoystickMotion", - "# JoystickButton", + "# JoypadMotion", + "# JoypadButton", "# ScreenTouch", "# ScreenDrag", "# Action" @@ -2397,7 +2468,7 @@ Error GDScriptLanguage::complete_code(const String& p_code, const String& p_base if (cid.obj_type!=StringName()) { List<MethodInfo> vm; - ObjectTypeDB::get_virtual_methods(cid.obj_type,&vm); + ClassDB::get_virtual_methods(cid.obj_type,&vm); for(List<MethodInfo>::Element *E=vm.front();E;E=E->next()) { MethodInfo &mi=E->get(); @@ -2433,7 +2504,7 @@ Error GDScriptLanguage::complete_code(const String& p_code, const String& p_base if (t.type==Variant::OBJECT && t.obj_type!=StringName()) { List<MethodInfo> sigs; - ObjectTypeDB::get_signal_list(t.obj_type,&sigs); + ClassDB::get_signal_list(t.obj_type,&sigs); for (List<MethodInfo>::Element *E=sigs.front();E;E=E->next()) { options.insert("\""+E->get().name+"\""); } @@ -2531,7 +2602,7 @@ Error GDScriptLanguage::lookup_code(const String& p_code, const String& p_symbol //before parsing, try the usual stuff - if (ObjectTypeDB::type_exists(p_symbol)) { + if (ClassDB::class_exists(p_symbol)) { r_result.type=ScriptLanguage::LookupResult::RESULT_CLASS; r_result.class_name=p_symbol; return OK; @@ -2612,7 +2683,7 @@ Error GDScriptLanguage::lookup_code(const String& p_code, const String& p_symbol GDCompletionIdentifier identifier = _get_native_class(context); print_line("identifier: "+String(identifier.obj_type)); - if (ObjectTypeDB::has_method(identifier.obj_type,p_symbol)) { + if (ClassDB::has_method(identifier.obj_type,p_symbol)) { r_result.type=ScriptLanguage::LookupResult::RESULT_CLASS_METHOD; r_result.class_name=identifier.obj_type; @@ -2653,7 +2724,7 @@ Error GDScriptLanguage::lookup_code(const String& p_code, const String& p_symbol GDCompletionIdentifier identifier = _get_native_class(context); - if (ObjectTypeDB::has_method(identifier.obj_type,p_symbol)) { + if (ClassDB::has_method(identifier.obj_type,p_symbol)) { r_result.type=ScriptLanguage::LookupResult::RESULT_CLASS_METHOD; r_result.class_name=identifier.obj_type; @@ -2663,6 +2734,19 @@ Error GDScriptLanguage::lookup_code(const String& p_code, const String& p_symbol } else { + GDCompletionIdentifier gdi = _get_native_class(context); + if (gdi.obj_type!=StringName()) { + bool valid; + Variant::Type t = ClassDB::get_property_type(gdi.obj_type,p_symbol,&valid); + if (t!=Variant::NIL && valid) { + r_result.type=ScriptLanguage::LookupResult::RESULT_CLASS_PROPERTY; + r_result.class_name=gdi.obj_type; + r_result.class_member=p_symbol; + return OK; + + } + } + const GDParser::BlockNode *block=context.block; //search in blocks going up (local var?) while(block) { @@ -2731,7 +2815,7 @@ Error GDScriptLanguage::lookup_code(const String& p_code, const String& p_symbol //guess in autoloads as singletons List<PropertyInfo> props; - Globals::get_singleton()->get_property_list(&props); + GlobalConfig::get_singleton()->get_property_list(&props); for(List<PropertyInfo>::Element *E=props.front();E;E=E->next()) { @@ -2741,7 +2825,7 @@ Error GDScriptLanguage::lookup_code(const String& p_code, const String& p_symbol String name = s.get_slice("/",1); if (name==String(p_symbol)) { - String path = Globals::get_singleton()->get(s); + String path = GlobalConfig::get_singleton()->get(s); if (path.begins_with("*")) { String script =path.substr(1,path.length()); @@ -2777,7 +2861,7 @@ Error GDScriptLanguage::lookup_code(const String& p_code, const String& p_symbol } else { r_result.type=ScriptLanguage::LookupResult::RESULT_CLASS; - r_result.class_name=obj->get_type(); + r_result.class_name=obj->get_class(); } return OK; } @@ -2858,7 +2942,7 @@ Error GDScriptLanguage::lookup_code(const String& p_code, const String& p_symbol } } - if (ObjectTypeDB::has_method(t.obj_type,p_symbol)) { + if (ClassDB::has_method(t.obj_type,p_symbol)) { r_result.type=ScriptLanguage::LookupResult::RESULT_CLASS_METHOD; r_result.class_name=t.obj_type; @@ -2868,7 +2952,7 @@ Error GDScriptLanguage::lookup_code(const String& p_code, const String& p_symbol } bool success; - ObjectTypeDB::get_integer_constant(t.obj_type,p_symbol,&success); + ClassDB::get_integer_constant(t.obj_type,p_symbol,&success); if (success) { r_result.type=ScriptLanguage::LookupResult::RESULT_CLASS_CONSTANT; r_result.class_name=t.obj_type; @@ -2876,7 +2960,8 @@ Error GDScriptLanguage::lookup_code(const String& p_code, const String& p_symbol return OK; } - ObjectTypeDB::get_property_type(t.obj_type,p_symbol,&success); + + ClassDB::get_property_type(t.obj_type,p_symbol,&success); if (success) { r_result.type=ScriptLanguage::LookupResult::RESULT_CLASS_PROPERTY; @@ -2936,7 +3021,7 @@ Error GDScriptLanguage::lookup_code(const String& p_code, const String& p_symbol if (cid.obj_type!=StringName()) { List<MethodInfo> vm; - ObjectTypeDB::get_virtual_methods(cid.obj_type,&vm); + ClassDB::get_virtual_methods(cid.obj_type,&vm); for(List<MethodInfo>::Element *E=vm.front();E;E=E->next()) { if (p_symbol==E->get().name) { diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp index 094e21bb4f..e3217e9218 100644 --- a/modules/gdscript/gd_function.cpp +++ b/modules/gdscript/gd_function.cpp @@ -119,9 +119,9 @@ static String _get_var_type(const Variant* p_type) { #ifdef DEBUG_ENABLED if (ObjectDB::instance_validate(bobj)) { if (bobj->get_script_instance()) - basestr= bobj->get_type()+" ("+bobj->get_script_instance()->get_script()->get_path().get_file()+")"; + basestr= bobj->get_class()+" ("+bobj->get_script_instance()->get_script()->get_path().get_file()+")"; else - basestr = bobj->get_type(); + basestr = bobj->get_class(); } else { basestr="previously freed instance"; } @@ -395,11 +395,11 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a if (!nc) { - err_text="Right operand of 'extends' is not a class (type: '"+obj_B->get_type()+"')."; + err_text="Right operand of 'extends' is not a class (type: '"+obj_B->get_class()+"')."; break; } - extends_ok=ObjectTypeDB::is_type(obj_A->get_type_name(),nc->get_name()); + extends_ok=ClassDB::is_parent_class(obj_A->get_class_name(),nc->get_name()); } *dst=extends_ok; @@ -487,7 +487,7 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a case OPCODE_GET_NAMED: { - CHECK_SPACE(3); + CHECK_SPACE(4); GET_VARIANT_PTR(src,1); GET_VARIANT_PTR(dst,3); @@ -519,6 +519,46 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a #endif ip+=4; } continue; + case OPCODE_SET_MEMBER: { + + CHECK_SPACE(3); + int indexname = _code_ptr[ip+1]; + ERR_BREAK(indexname<0 || indexname>=_global_names_count); + const StringName *index = &_global_names_ptr[indexname]; + GET_VARIANT_PTR(src,2); + + bool valid; + bool ok = ClassDB::set_property(p_instance->owner,*index,*src,&valid); +#ifdef DEBUG_ENABLED + if (!ok) { + err_text="Internal error setting property: "+String(*index); + break; + } else if (!valid) { + err_text="Error setting property '"+String(*index)+"' with value of type "+Variant::get_type_name(src->get_type())+"."; + break; + + } +#endif + ip+=3; + } continue; + case OPCODE_GET_MEMBER: { + + CHECK_SPACE(3); + int indexname = _code_ptr[ip+1]; + ERR_BREAK(indexname<0 || indexname>=_global_names_count); + const StringName *index = &_global_names_ptr[indexname]; + GET_VARIANT_PTR(dst,2); + bool ok = ClassDB::get_property(p_instance->owner,*index,*dst); + +#ifdef DEBUG_ENABLED + if (!ok) { + err_text="Internal error getting property: "+String(*index); + break; + } +#endif + ip+=3; + + } continue; case OPCODE_ASSIGN: { CHECK_SPACE(3); @@ -788,7 +828,7 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a if (*methodname!=GDScriptLanguage::get_singleton()->strings._init) { - MethodBind *mb = ObjectTypeDB::get_method(gds->native->get_name(),*methodname); + MethodBind *mb = ClassDB::get_method(gds->native->get_name(),*methodname); if (!mb) { err.error=Variant::CallError::CALL_ERROR_INVALID_METHOD; } else { @@ -1435,9 +1475,9 @@ Variant GDFunctionState::resume(const Variant& p_arg) { void GDFunctionState::_bind_methods() { - ObjectTypeDB::bind_method(_MD("resume:Variant","arg"),&GDFunctionState::resume,DEFVAL(Variant())); - ObjectTypeDB::bind_method(_MD("is_valid"),&GDFunctionState::is_valid); - ObjectTypeDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"_signal_callback",&GDFunctionState::_signal_callback,MethodInfo("_signal_callback")); + ClassDB::bind_method(_MD("resume:Variant","arg"),&GDFunctionState::resume,DEFVAL(Variant())); + ClassDB::bind_method(_MD("is_valid"),&GDFunctionState::is_valid); + ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"_signal_callback",&GDFunctionState::_signal_callback,MethodInfo("_signal_callback")); } diff --git a/modules/gdscript/gd_function.h b/modules/gdscript/gd_function.h index f1c5b13ca1..e5262e8ad7 100644 --- a/modules/gdscript/gd_function.h +++ b/modules/gdscript/gd_function.h @@ -23,6 +23,8 @@ public: OPCODE_GET, OPCODE_SET_NAMED, OPCODE_GET_NAMED, + OPCODE_SET_MEMBER, + OPCODE_GET_MEMBER, OPCODE_ASSIGN, OPCODE_ASSIGN_TRUE, OPCODE_ASSIGN_FALSE, @@ -204,7 +206,7 @@ public: class GDFunctionState : public Reference { - OBJ_TYPE(GDFunctionState,Reference); + GDCLASS(GDFunctionState,Reference); friend class GDFunction; GDFunction *function; GDFunction::CallState state; diff --git a/modules/gdscript/gd_functions.cpp b/modules/gdscript/gd_functions.cpp index e4add4e574..35ceeeb1aa 100644 --- a/modules/gdscript/gd_functions.cpp +++ b/modules/gdscript/gd_functions.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,6 +35,7 @@ #include "os/os.h" #include "variant_parser.h" #include "io/marshalls.h" +#include "io/json.h" const char *GDFunctions::get_func_name(Function p_func) { @@ -103,6 +104,9 @@ const char *GDFunctions::get_func_name(Function p_func) { "load", "inst2dict", "dict2inst", + "validate_json", + "parse_json", + "to_json", "hash", "Color8", "ColorN", @@ -537,7 +541,7 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va case TYPE_EXISTS: { VALIDATE_ARG_COUNT(1); - r_ret = ObjectTypeDB::type_exists(*p_args[0]); + r_ret = ClassDB::class_exists(*p_args[0]); } break; case TEXT_CHAR: { @@ -669,7 +673,7 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va case VAR_TO_BYTES: { VALIDATE_ARG_COUNT(1); - ByteArray barr; + PoolByteArray barr; int len; Error err = encode_variant(*p_args[0],NULL,len); if (err) { @@ -682,7 +686,7 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va barr.resize(len); { - ByteArray::Write w = barr.write(); + PoolByteArray::Write w = barr.write(); encode_variant(*p_args[0],w.ptr(),len); } @@ -690,24 +694,24 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va } break; case BYTES_TO_VAR: { VALIDATE_ARG_COUNT(1); - if (p_args[0]->get_type()!=Variant::RAW_ARRAY) { + if (p_args[0]->get_type()!=Variant::POOL_BYTE_ARRAY) { r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument=0; - r_error.expected=Variant::RAW_ARRAY; + r_error.expected=Variant::POOL_BYTE_ARRAY; r_ret=Variant(); return; } - ByteArray varr=*p_args[0]; + PoolByteArray varr=*p_args[0]; Variant ret; { - ByteArray::Read r=varr.read(); + PoolByteArray::Read r=varr.read(); Error err = decode_variant(ret,r.ptr(),varr.size(),NULL); if (err!=OK) { r_ret=RTR("Not enough bytes for decoding bytes, or invalid format."); r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument=0; - r_error.expected=Variant::RAW_ARRAY; + r_error.expected=Variant::POOL_BYTE_ARRAY; return; } @@ -847,6 +851,7 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va if (p_args[0]->get_type()!=Variant::STRING) { r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument=0; + r_error.expected=Variant::STRING; r_ret=Variant(); } else { r_ret=ResourceLoader::load(*p_args[0]); @@ -1025,6 +1030,57 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va } } break; + case VALIDATE_JSON: { + + VALIDATE_ARG_COUNT(1); + + if (p_args[0]->get_type()!=Variant::STRING) { + r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.argument=0; + r_error.expected=Variant::STRING; + r_ret=Variant(); + return; + } + + String errs; + int errl; + + Error err = JSON::parse(*p_args[0],r_ret,errs,errl); + + if (err!=OK) { + r_ret=itos(errl)+":"+errs; + } else { + r_ret=""; + } + + } break; + case PARSE_JSON: { + + VALIDATE_ARG_COUNT(1); + + if (p_args[0]->get_type()!=Variant::STRING) { + r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; + r_error.argument=0; + r_error.expected=Variant::STRING; + r_ret=Variant(); + return; + } + + String errs; + int errl; + + Error err = JSON::parse(*p_args[0],r_ret,errs,errl); + + if (err!=OK) { + r_ret=Variant(); + } + + } break; + case TO_JSON: { + VALIDATE_ARG_COUNT(1); + + r_ret = JSON::print(*p_args[0]); + } break; case HASH: { VALIDATE_ARG_COUNT(1); @@ -1506,13 +1562,13 @@ MethodInfo GDFunctions::get_info(Function p_func) { } break; case VAR_TO_BYTES: { MethodInfo mi("var2bytes",PropertyInfo(Variant::NIL,"var")); - mi.return_val.type=Variant::RAW_ARRAY; + mi.return_val.type=Variant::POOL_BYTE_ARRAY; return mi; } break; case BYTES_TO_VAR: { - MethodInfo mi("bytes2var:Variant",PropertyInfo(Variant::RAW_ARRAY,"bytes")); + MethodInfo mi("bytes2var:Variant",PropertyInfo(Variant::POOL_BYTE_ARRAY,"bytes")); mi.return_val.type=Variant::NIL; return mi; } break; @@ -1541,6 +1597,24 @@ MethodInfo GDFunctions::get_info(Function p_func) { mi.return_val.type=Variant::OBJECT; return mi; } break; + case VALIDATE_JSON: { + + MethodInfo mi("validate_json:Variant",PropertyInfo(Variant::STRING,"json")); + mi.return_val.type=Variant::STRING; + return mi; + } break; + case PARSE_JSON: { + + MethodInfo mi("parse_json:Variant",PropertyInfo(Variant::STRING,"json")); + mi.return_val.type=Variant::NIL; + return mi; + } break; + case TO_JSON: { + + MethodInfo mi("to_json",PropertyInfo(Variant::NIL,"var:Variant")); + mi.return_val.type=Variant::STRING; + return mi; + } break; case HASH: { MethodInfo mi("hash",PropertyInfo(Variant::NIL,"var:Variant")); diff --git a/modules/gdscript/gd_functions.h b/modules/gdscript/gd_functions.h index 5c8b61db37..6e30b4dbb5 100644 --- a/modules/gdscript/gd_functions.h +++ b/modules/gdscript/gd_functions.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -97,6 +97,9 @@ public: RESOURCE_LOAD, INST2DICT, DICT2INST, + VALIDATE_JSON, + PARSE_JSON, + TO_JSON, HASH, COLOR8, COLORN, diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp index 131b9a0853..adf13e0a3b 100644 --- a/modules/gdscript/gd_parser.cpp +++ b/modules/gdscript/gd_parser.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -265,6 +265,98 @@ GDParser::Node* GDParser::_parse_expression(Node *p_parent,bool p_static,bool p_ tokenizer->advance(); expr=subexpr; + } else if (tokenizer->get_token()==GDTokenizer::TK_DOLLAR) { + tokenizer->advance(); + + String path; + + bool need_identifier=true; + bool done=false; + + while(!done) { + + switch(tokenizer->get_token()) { + case GDTokenizer::TK_CURSOR: { + completion_cursor=StringName(); + completion_type=COMPLETION_GET_NODE; + completion_class=current_class; + completion_function=current_function; + completion_line=tokenizer->get_token_line(); + completion_cursor=path; + completion_argument=0; + completion_block=current_block; + completion_found=true; + tokenizer->advance(); + } break; + case GDTokenizer::TK_CONSTANT: { + + if (!need_identifier) { + done=true; + break; + } + + if (tokenizer->get_token_constant().get_type()!=Variant::STRING) { + _set_error("Expected string constant or identifier after '$' or '/'."); + return NULL; + } + + path+=String(tokenizer->get_token_constant()); + tokenizer->advance(); + need_identifier=false; + + } break; + case GDTokenizer::TK_IDENTIFIER: { + if (!need_identifier) { + done=true; + break; + } + + path+=String(tokenizer->get_token_identifier()); + tokenizer->advance(); + need_identifier=false; + + } break; + case GDTokenizer::TK_OP_DIV: { + + if (need_identifier) { + done=true; + break; + } + + path+="/"; + tokenizer->advance(); + need_identifier=true; + + } break; + default: { + done=true; + break; + } + } + } + + if (path=="") { + _set_error("Path expected after $."); + return NULL; + + } + + OperatorNode *op = alloc_node<OperatorNode>(); + op->op=OperatorNode::OP_CALL; + + op->arguments.push_back(alloc_node<SelfNode>()); + + IdentifierNode *funcname = alloc_node<IdentifierNode>(); + funcname->name="get_node"; + + op->arguments.push_back(funcname); + + ConstantNode *nodepath = alloc_node<ConstantNode>(); + nodepath->value = NodePath(StringName(path)); + op->arguments.push_back(nodepath); + + expr=op; + } else if (tokenizer->get_token()==GDTokenizer::TK_CURSOR) { tokenizer->advance(); continue; //no point in cursor in the middle of expression @@ -540,14 +632,15 @@ GDParser::Node* GDParser::_parse_expression(Node *p_parent,bool p_static,bool p_ expr = id; } - } else if (/*tokenizer->get_token()==GDTokenizer::TK_OP_ADD ||*/ tokenizer->get_token()==GDTokenizer::TK_OP_SUB || tokenizer->get_token()==GDTokenizer::TK_OP_NOT || tokenizer->get_token()==GDTokenizer::TK_OP_BIT_INVERT) { + } else if (tokenizer->get_token()==GDTokenizer::TK_OP_ADD || tokenizer->get_token()==GDTokenizer::TK_OP_SUB || tokenizer->get_token()==GDTokenizer::TK_OP_NOT || tokenizer->get_token()==GDTokenizer::TK_OP_BIT_INVERT) { - //single prefix operators like !expr -expr ++expr --expr + //single prefix operators like !expr +expr -expr ++expr --expr alloc_node<OperatorNode>(); Expression e; e.is_op=true; switch(tokenizer->get_token()) { + case GDTokenizer::TK_OP_ADD: e.op=OperatorNode::OP_POS; break; case GDTokenizer::TK_OP_SUB: e.op=OperatorNode::OP_NEG; break; case GDTokenizer::TK_OP_NOT: e.op=OperatorNode::OP_NOT; break; case GDTokenizer::TK_OP_BIT_INVERT: e.op=OperatorNode::OP_BIT_INVERT;; break; @@ -995,6 +1088,7 @@ GDParser::Node* GDParser::_parse_expression(Node *p_parent,bool p_static,bool p_ case OperatorNode::OP_BIT_INVERT: priority=0; unary=true; break; case OperatorNode::OP_NEG: priority=1; unary=true; break; + case OperatorNode::OP_POS: priority=1; unary=true; break; case OperatorNode::OP_MUL: priority=2; break; case OperatorNode::OP_DIV: priority=2; break; @@ -1476,6 +1570,15 @@ GDParser::Node* GDParser::_reduce_expression(Node *p_node,bool p_to_const) { return op; } + if (op->arguments[0]->type==Node::TYPE_OPERATOR) { + OperatorNode *on = static_cast<OperatorNode*>(op->arguments[0]); + if (on->op != OperatorNode::OP_INDEX && on->op != OperatorNode::OP_INDEX_NAMED) { + _set_error("Can't assign to an expression",tokenizer->get_token_line()-1); + error_line=op->line; + return op; + } + } + } break; default: { break; } } @@ -1512,6 +1615,7 @@ GDParser::Node* GDParser::_reduce_expression(Node *p_node,bool p_to_const) { //unary operators case OperatorNode::OP_NEG: { _REDUCE_UNARY(Variant::OP_NEGATE); } break; + case OperatorNode::OP_POS: { _REDUCE_UNARY(Variant::OP_POSITIVE); } break; case OperatorNode::OP_NOT: { _REDUCE_UNARY(Variant::OP_NOT); } break; case OperatorNode::OP_BIT_INVERT: { _REDUCE_UNARY(Variant::OP_BIT_NEGATE); } break; //binary operators (in precedence order) @@ -2564,7 +2668,7 @@ void GDParser::_parse_class(ClassNode *p_class) { if (tokenizer->get_token()==GDTokenizer::TK_IDENTIFIER && tokenizer->get_token_identifier()=="FLAGS") { - current_export.hint=PROPERTY_HINT_ALL_FLAGS; + //current_export.hint=PROPERTY_HINT_ALL_FLAGS; tokenizer->advance(); if (tokenizer->get_token()==GDTokenizer::TK_PARENTHESIS_CLOSE) { @@ -2919,7 +3023,7 @@ void GDParser::_parse_class(ClassNode *p_class) { } else if (tokenizer->get_token()==GDTokenizer::TK_IDENTIFIER) { String identifier = tokenizer->get_token_identifier(); - if (!ObjectTypeDB::is_type(identifier,"Resource")) { + if (!ClassDB::is_parent_class(identifier,"Resource")) { current_export=PropertyInfo(); _set_error("Export hint not a type or resource."); @@ -3137,7 +3241,7 @@ void GDParser::_parse_class(ClassNode *p_class) { return; } member._export.hint=PROPERTY_HINT_RESOURCE_TYPE; - member._export.hint_string=res->get_type(); + member._export.hint_string=res->get_class(); } } } diff --git a/modules/gdscript/gd_parser.h b/modules/gdscript/gd_parser.h index 75653e0916..e8f5f0f981 100644 --- a/modules/gdscript/gd_parser.h +++ b/modules/gdscript/gd_parser.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -209,6 +209,7 @@ public: OP_INDEX_NAMED, //unary operators OP_NEG, + OP_POS, OP_NOT, OP_BIT_INVERT, OP_PREINC, @@ -375,6 +376,7 @@ public: enum CompletionType { COMPLETION_NONE, COMPLETION_BUILT_IN_TYPE_CONSTANT, + COMPLETION_GET_NODE, COMPLETION_FUNCTION, COMPLETION_IDENTIFIER, COMPLETION_PARENT_FUNCTION, diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index 0ea10950df..0b81780b0c 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -50,7 +50,7 @@ GDNativeClass::GDNativeClass(const StringName& p_name) { bool GDNativeClass::_get(const StringName& p_name,Variant &r_ret) const { bool ok; - int v = ObjectTypeDB::get_integer_constant(name, p_name, &ok); + int v = ClassDB::get_integer_constant(name, p_name, &ok); if (ok) { r_ret=v; @@ -63,7 +63,7 @@ bool GDNativeClass::_get(const StringName& p_name,Variant &r_ret) const { void GDNativeClass::_bind_methods() { - ObjectTypeDB::bind_method(_MD("new"),&GDNativeClass::_new); + ClassDB::bind_method(_MD("new"),&GDNativeClass::_new); } @@ -86,7 +86,7 @@ Variant GDNativeClass::_new() { Object *GDNativeClass::instance() { - return ObjectTypeDB::instance(name); + return ClassDB::instance(name); } @@ -111,14 +111,29 @@ GDInstance* GDScript::_create_instance(const Variant** p_args,int p_argcount,Obj /* STEP 2, INITIALIZE AND CONSRTUCT */ +#ifndef NO_THREADS + GDScriptLanguage::singleton->lock->lock(); +#endif + instances.insert(instance->owner); +#ifndef NO_THREADS + GDScriptLanguage::singleton->lock->unlock(); +#endif + initializer->call(instance,p_args,p_argcount,r_error); if (r_error.error!=Variant::CallError::CALL_OK) { instance->script=Ref<GDScript>(); instance->owner->set_script_instance(NULL); +#ifndef NO_THREADS + GDScriptLanguage::singleton->lock->lock(); +#endif instances.erase(p_owner); +#ifndef NO_THREADS + GDScriptLanguage::singleton->lock->unlock(); +#endif + ERR_FAIL_COND_V(r_error.error!=Variant::CallError::CALL_OK, NULL); //error constructing } @@ -388,12 +403,12 @@ ScriptInstance* GDScript::instance_create(Object *p_this) { top=top->_base; if (top->native.is_valid()) { - if (!ObjectTypeDB::is_type(p_this->get_type_name(),top->native->get_name())) { + if (!ClassDB::is_parent_class(p_this->get_class_name(),top->native->get_name())) { if (ScriptDebugger::get_singleton()) { - GDScriptLanguage::get_singleton()->debug_break_parse(get_path(),0,"Script inherits from native type '"+String(top->native->get_name())+"', so it can't be instanced in object of type: '"+p_this->get_type()+"'"); + GDScriptLanguage::get_singleton()->debug_break_parse(get_path(),0,"Script inherits from native type '"+String(top->native->get_name())+"', so it can't be instanced in object of type: '"+p_this->get_class()+"'"); } - ERR_EXPLAIN("Script inherits from native type '"+String(top->native->get_name())+"', so it can't be instanced in object of type: '"+p_this->get_type()+"'"); + ERR_EXPLAIN("Script inherits from native type '"+String(top->native->get_name())+"', so it can't be instanced in object of type: '"+p_this->get_class()+"'"); ERR_FAIL_V(NULL); } @@ -405,7 +420,16 @@ ScriptInstance* GDScript::instance_create(Object *p_this) { } bool GDScript::instance_has(const Object *p_this) const { - return instances.has((Object*)p_this); +#ifndef NO_THREADS + GDScriptLanguage::singleton->lock->lock(); +#endif + bool hasit = instances.has((Object*)p_this); + +#ifndef NO_THREADS + GDScriptLanguage::singleton->lock->unlock(); +#endif + + return hasit; } bool GDScript::has_source_code() const { @@ -596,8 +620,16 @@ void GDScript::_set_subclass_path(Ref<GDScript>& p_sc,const String& p_path) { Error GDScript::reload(bool p_keep_state) { +#ifndef NO_THREADS + GDScriptLanguage::singleton->lock->lock(); +#endif + bool has_instances = instances.size(); + +#ifndef NO_THREADS + GDScriptLanguage::singleton->lock->unlock(); +#endif - ERR_FAIL_COND_V(!p_keep_state && instances.size(),ERR_ALREADY_IN_USE); + ERR_FAIL_COND_V(!p_keep_state && has_instances,ERR_ALREADY_IN_USE); String basedir=path; @@ -751,9 +783,9 @@ void GDScript::_get_property_list(List<PropertyInfo> *p_properties) const { void GDScript::_bind_methods() { - ObjectTypeDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"new",&GDScript::_new,MethodInfo(Variant::OBJECT,"new")); + ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"new",&GDScript::_new,MethodInfo(Variant::OBJECT,"new")); - ObjectTypeDB::bind_method(_MD("get_as_byte_code"),&GDScript::get_as_byte_code); + ClassDB::bind_method(_MD("get_as_byte_code"),&GDScript::get_as_byte_code); } @@ -830,7 +862,7 @@ Error GDScript::load_byte_code(const String& p_path) { Error GDScript::load_source_code(const String& p_path) { - DVector<uint8_t> sourcef; + PoolVector<uint8_t> sourcef; Error err; FileAccess *f=FileAccess::open(p_path,FileAccess::READ,&err); if (err) { @@ -840,7 +872,7 @@ Error GDScript::load_source_code(const String& p_path) { int len = f->get_len(); sourcef.resize(len+1); - DVector<uint8_t>::Write w = sourcef.write(); + PoolVector<uint8_t>::Write w = sourcef.write(); int r = f->get_buffer(w.ptr(),len); f->close(); memdelete(f); @@ -1423,7 +1455,15 @@ GDInstance::GDInstance() { GDInstance::~GDInstance() { if (script.is_valid() && owner) { - script->instances.erase(owner); +#ifndef NO_THREADS + GDScriptLanguage::singleton->lock->lock(); +#endif + + script->instances.erase(owner); +#ifndef NO_THREADS + GDScriptLanguage::singleton->lock->unlock(); +#endif + } } @@ -1477,7 +1517,7 @@ void GDScriptLanguage::init() { //populate native classes List<StringName> class_list; - ObjectTypeDB::get_type_list(&class_list); + ClassDB::get_class_list(&class_list); for(List<StringName>::Element *E=class_list.front();E;E=E->next()) { StringName n = E->get(); @@ -1493,9 +1533,9 @@ void GDScriptLanguage::init() { //populate singletons - List<Globals::Singleton> singletons; - Globals::get_singleton()->get_singletons(&singletons); - for(List<Globals::Singleton>::Element *E=singletons.front();E;E=E->next()) { + List<GlobalConfig::Singleton> singletons; + GlobalConfig::get_singleton()->get_singletons(&singletons); + for(List<GlobalConfig::Singleton>::Element *E=singletons.front();E;E=E->next()) { _add_global(E->get().name,E->get().ptr); } @@ -1940,7 +1980,7 @@ GDScriptLanguage::GDScriptLanguage() { script_frame_time=0; _debug_call_stack_pos=0; - int dmcs=GLOBAL_DEF("debug/script_max_call_stack",1024); + int dmcs=GLOBAL_DEF("debug/script/max_call_stack",1024); if (ScriptDebugger::get_singleton()) { //debugging enabled! diff --git a/modules/gdscript/gd_script.h b/modules/gdscript/gd_script.h index 051e80634f..960b06f3ff 100644 --- a/modules/gdscript/gd_script.h +++ b/modules/gdscript/gd_script.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ #include "gd_function.h" class GDNativeClass : public Reference { - OBJ_TYPE(GDNativeClass,Reference); + GDCLASS(GDNativeClass,Reference); StringName name; protected: @@ -55,7 +55,7 @@ public: class GDScript : public Script { - OBJ_TYPE(GDScript,Script); + GDCLASS(GDScript,Script); bool tool; bool valid; @@ -294,11 +294,13 @@ class GDScriptLanguage : public ScriptLanguage { void _add_global(const StringName& p_name,const Variant& p_value); +friend class GDInstance; Mutex *lock; + friend class GDScript; SelfList<GDScript>::List script_list; @@ -406,7 +408,7 @@ public: virtual Script *create_script() const; virtual bool has_named_classes() const; virtual int find_function(const String& p_function,const String& p_code) const; - virtual String make_function(const String& p_class,const String& p_name,const StringArray& p_args) const; + virtual String make_function(const String& p_class,const String& p_name,const PoolStringArray& p_args) const; virtual Error complete_code(const String& p_code, const String& p_base_path, Object*p_owner,List<String>* r_options,String& r_call_hint); #ifdef TOOLS_ENABLED virtual Error lookup_code(const String& p_code, const String& p_symbol, const String& p_base_path, Object*p_owner, LookupResult& r_result); diff --git a/modules/gdscript/gd_tokenizer.cpp b/modules/gdscript/gd_tokenizer.cpp index 39c4530d96..30ac988295 100644 --- a/modules/gdscript/gd_tokenizer.cpp +++ b/modules/gdscript/gd_tokenizer.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -460,6 +460,9 @@ void GDTokenizerText::_advance() { case ':': _make_token(TK_COLON); //for methods maybe but now useless. break; + case '$': + _make_token(TK_DOLLAR); //for the get_node() shortener + break; case '^': { if (GETCHAR(1)=='=') { _make_token(TK_OP_ASSIGN_BIT_XOR); @@ -728,14 +731,14 @@ void GDTokenizerText::_advance() { INCPOS(str.length()); if (hexa_found) { - int val = str.hex_to_int(); + int64_t val = str.hex_to_int64(); _make_constant(val); } else if (period_found || exponent_found) { - real_t val = str.to_double(); + double val = str.to_double(); //print_line("*%*%*%*% to convert: "+str+" result: "+rtos(val)); _make_constant(val); } else { - int val = str.to_int(); + int64_t val = str.to_int64(); _make_constant(val); } @@ -785,13 +788,12 @@ void GDTokenizerText::_advance() { {Variant::STRING,"String"}, {Variant::VECTOR2,"Vector2"}, {Variant::RECT2,"Rect2"}, - {Variant::MATRIX32,"Matrix32"}, + {Variant::TRANSFORM2D,"Transform2D"}, {Variant::VECTOR3,"Vector3"}, - {Variant::_AABB,"AABB"}, - {Variant::_AABB,"Rect3"}, + {Variant::RECT3,"Rect3"}, {Variant::PLANE,"Plane"}, {Variant::QUAT,"Quat"}, - {Variant::MATRIX3,"Matrix3"}, + {Variant::BASIS,"Basis"}, {Variant::TRANSFORM,"Transform"}, {Variant::COLOR,"Color"}, {Variant::IMAGE,"Image"}, @@ -801,13 +803,13 @@ void GDTokenizerText::_advance() { {Variant::NODE_PATH,"NodePath"}, {Variant::DICTIONARY,"Dictionary"}, {Variant::ARRAY,"Array"}, - {Variant::RAW_ARRAY,"RawArray"}, - {Variant::INT_ARRAY,"IntArray"}, - {Variant::REAL_ARRAY,"FloatArray"}, - {Variant::STRING_ARRAY,"StringArray"}, - {Variant::VECTOR2_ARRAY,"Vector2Array"}, - {Variant::VECTOR3_ARRAY,"Vector3Array"}, - {Variant::COLOR_ARRAY,"ColorArray"}, + {Variant::POOL_BYTE_ARRAY,"PoolByteArray"}, + {Variant::POOL_INT_ARRAY,"PoolIntArray"}, + {Variant::POOL_REAL_ARRAY,"PoolFloatArray"}, + {Variant::POOL_STRING_ARRAY,"PoolStringArray"}, + {Variant::POOL_VECTOR2_ARRAY,"PoolVector2Array"}, + {Variant::POOL_VECTOR3_ARRAY,"PoolVector3Array"}, + {Variant::POOL_COLOR_ARRAY,"PoolColorArray"}, {Variant::VARIANT_MAX,NULL}, }; @@ -1057,7 +1059,7 @@ void GDTokenizerText::advance(int p_amount) { ////////////////////////////////////////////////////////////////////////////////////////////////////// -#define BYTECODE_VERSION 11 +#define BYTECODE_VERSION 12 Error GDTokenizerBuffer::set_code_buffer(const Vector<uint8_t> & p_buffer) { diff --git a/modules/gdscript/gd_tokenizer.h b/modules/gdscript/gd_tokenizer.h index b91229ab1e..18e5547d36 100644 --- a/modules/gdscript/gd_tokenizer.h +++ b/modules/gdscript/gd_tokenizer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -123,6 +123,7 @@ public: TK_PERIOD, TK_QUESTION_MARK, TK_COLON, + TK_DOLLAR, TK_NEWLINE, TK_CONST_PI, TK_ERROR, diff --git a/modules/gdscript/register_types.cpp b/modules/gdscript/register_types.cpp index 95b18cae4d..11bdf783f8 100644 --- a/modules/gdscript/register_types.cpp +++ b/modules/gdscript/register_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -48,7 +48,7 @@ ResourceFormatSaverGDScript *resource_saver_gd=NULL; class EditorExportGDScript : public EditorExportPlugin { - OBJ_TYPE(EditorExportGDScript,EditorExportPlugin); + GDCLASS(EditorExportGDScript,EditorExportPlugin); public: @@ -138,8 +138,8 @@ static void register_editor_plugin() { void register_gdscript_types() { - ObjectTypeDB::register_type<GDScript>(); - ObjectTypeDB::register_virtual_type<GDFunctionState>(); + ClassDB::register_class<GDScript>(); + ClassDB::register_virtual_class<GDFunctionState>(); script_language_gd=memnew( GDScriptLanguage ); //script_language_gd->init(); diff --git a/modules/gdscript/register_types.h b/modules/gdscript/register_types.h index aed11cd1d4..5778dfcadc 100644 --- a/modules/gdscript/register_types.h +++ b/modules/gdscript/register_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/gridmap/config.py b/modules/gridmap/config.py index 5698a37295..1ab13c4aeb 100644 --- a/modules/gridmap/config.py +++ b/modules/gridmap/config.py @@ -1,7 +1,8 @@ def can_build(platform): - return True + # FIXME: Disabled temporary for gles3 implementation + return False def configure(env): diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp index 6e73244b57..b5fa55846c 100644 --- a/modules/gridmap/grid_map.cpp +++ b/modules/gridmap/grid_map.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -61,9 +61,9 @@ bool GridMap::_set(const StringName& p_name, const Variant& p_value) { } else if (name=="theme/bake") { set_bake(p_value); /* } else if (name=="cells") { - DVector<int> cells = p_value; + PoolVector<int> cells = p_value; int amount=cells.size(); - DVector<int>::Read r = cells.read(); + PoolVector<int>::Read r = cells.read(); ERR_FAIL_COND_V(amount&1,false); // not even cell_map.clear();; for(int i=0;i<amount/3;i++) { @@ -86,9 +86,9 @@ bool GridMap::_set(const StringName& p_name, const Variant& p_value) { baked=d["baked"]; if (d.has("cells")) { - DVector<int> cells = d["cells"]; + PoolVector<int> cells = d["cells"]; int amount=cells.size(); - DVector<int>::Read r = cells.read(); + PoolVector<int>::Read r = cells.read(); ERR_FAIL_COND_V(amount%3,false); // not even cell_map.clear();; for(int i=0;i<amount/3;i++) { @@ -183,10 +183,10 @@ bool GridMap::_get(const StringName& p_name,Variant &r_ret) const { Dictionary d; - DVector<int> cells; + PoolVector<int> cells; cells.resize(cell_map.size()*3); { - DVector<int>::Write w = cells.write(); + PoolVector<int>::Write w = cells.write(); int i=0; for (Map<IndexKey,Cell>::Element *E=cell_map.front();E;E=E->next(),i++) { @@ -252,7 +252,7 @@ void GridMap::_get_property_list( List<PropertyInfo> *p_list) const { for(const Map<int,Area*>::Element *E=area_map.front();E;E=E->next()) { String base="areas/"+itos(E->key())+"/"; - p_list->push_back( PropertyInfo( Variant::_AABB, base+"bounds", PROPERTY_HINT_NONE,"",PROPERTY_USAGE_STORAGE) ); + p_list->push_back( PropertyInfo( Variant::RECT3, base+"bounds", PROPERTY_HINT_NONE,"",PROPERTY_USAGE_STORAGE) ); p_list->push_back( PropertyInfo( Variant::STRING, base+"name", PROPERTY_HINT_NONE,"",PROPERTY_USAGE_STORAGE) ); p_list->push_back( PropertyInfo( Variant::REAL, base+"disable_distance", PROPERTY_HINT_NONE,"",PROPERTY_USAGE_STORAGE) ); p_list->push_back( PropertyInfo( Variant::COLOR, base+"disable_color", PROPERTY_HINT_NONE,"",PROPERTY_USAGE_STORAGE) ); @@ -665,7 +665,7 @@ void GridMap::_octant_update(const OctantKey &p_key) { VS::get_singleton()->mesh_clear(g.collision_debug); } - DVector<Vector3> col_debug; + PoolVector<Vector3> col_debug; /* * foreach item in this octant, @@ -678,8 +678,8 @@ void GridMap::_octant_update(const OctantKey &p_key) { ii.multimesh->set_instance_count(ii.cells.size()); - AABB aabb; - AABB mesh_aabb = ii.mesh.is_null()?AABB():ii.mesh->get_aabb(); + Rect3 aabb; + Rect3 mesh_aabb = ii.mesh.is_null()?Rect3():ii.mesh->get_aabb(); Vector3 ofs(cell_size*0.5*int(center_x),cell_size*0.5*int(center_y),cell_size*0.5*int(center_z)); @@ -863,15 +863,15 @@ void GridMap::_octant_bake(const OctantKey &p_key, const Ref<TriangleMesh>& p_tm if (ii.mesh->surface_get_primitive_type(i)!=Mesh::PRIMITIVE_TRIANGLES) continue; Array a = ii.mesh->surface_get_arrays(i); - DVector<Vector3> av=a[VS::ARRAY_VERTEX]; + PoolVector<Vector3> av=a[VS::ARRAY_VERTEX]; int avs = av.size(); - DVector<Vector3>::Read vr = av.read(); + PoolVector<Vector3>::Read vr = av.read(); - DVector<int> ai=a[VS::ARRAY_INDEX]; + PoolVector<int> ai=a[VS::ARRAY_INDEX]; int ais=ai.size(); if (ais) { - DVector<int>::Read ir=ai.read(); + PoolVector<int>::Read ir=ai.read(); for(int j=0;j<ais;j++) { p_prebake->push_back(xform.xform(vr[ir[j]])); @@ -920,7 +920,7 @@ void GridMap::_octant_bake(const OctantKey &p_key, const Ref<TriangleMesh>& p_tm Vector3 vertex = v.vertex + octant_ofs; //print_line("V GET: "+vertex); - Vector3 normal = tm->get_area_normal( AABB( Vector3(-ofs,-ofs,-ofs)+vertex,Vector3(ofs,ofs,ofs)*2.0)); + Vector3 normal = tm->get_area_normal( Rect3( Vector3(-ofs,-ofs,-ofs)+vertex,Vector3(ofs,ofs,ofs)*2.0)); if (normal==Vector3()) { print_line("couldn't find for vertex: "+vertex); } @@ -960,9 +960,9 @@ void GridMap::_octant_bake(const OctantKey &p_key, const Ref<TriangleMesh>& p_tm st->add_to_format(VS::ARRAY_FORMAT_COLOR); if (m.is_valid()) { - Ref<FixedMaterial> fm = m; + Ref<FixedSpatialMaterial> fm = m; if (fm.is_valid()) - fm->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY,true); + fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_COLOR_ARRAY,true); } } } @@ -1185,60 +1185,60 @@ void GridMap::_update_dirty_map_callback() { void GridMap::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_theme","theme:MeshLibrary"),&GridMap::set_theme); - ObjectTypeDB::bind_method(_MD("get_theme:MeshLibrary"),&GridMap::get_theme); + ClassDB::bind_method(_MD("set_theme","theme:MeshLibrary"),&GridMap::set_theme); + ClassDB::bind_method(_MD("get_theme:MeshLibrary"),&GridMap::get_theme); - ObjectTypeDB::bind_method(_MD("set_bake","enable"),&GridMap::set_bake); - ObjectTypeDB::bind_method(_MD("is_baking_enabled"),&GridMap::is_baking_enabled); + ClassDB::bind_method(_MD("set_bake","enable"),&GridMap::set_bake); + ClassDB::bind_method(_MD("is_baking_enabled"),&GridMap::is_baking_enabled); - ObjectTypeDB::bind_method(_MD("set_cell_size","size"),&GridMap::set_cell_size); - ObjectTypeDB::bind_method(_MD("get_cell_size"),&GridMap::get_cell_size); + ClassDB::bind_method(_MD("set_cell_size","size"),&GridMap::set_cell_size); + ClassDB::bind_method(_MD("get_cell_size"),&GridMap::get_cell_size); - ObjectTypeDB::bind_method(_MD("set_octant_size","size"),&GridMap::set_octant_size); - ObjectTypeDB::bind_method(_MD("get_octant_size"),&GridMap::get_octant_size); + ClassDB::bind_method(_MD("set_octant_size","size"),&GridMap::set_octant_size); + ClassDB::bind_method(_MD("get_octant_size"),&GridMap::get_octant_size); - ObjectTypeDB::bind_method(_MD("set_cell_item","x","y","z","item","orientation"),&GridMap::set_cell_item,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("get_cell_item","x","y","z"),&GridMap::get_cell_item); - ObjectTypeDB::bind_method(_MD("get_cell_item_orientation","x","y","z"),&GridMap::get_cell_item_orientation); + ClassDB::bind_method(_MD("set_cell_item","x","y","z","item","orientation"),&GridMap::set_cell_item,DEFVAL(0)); + ClassDB::bind_method(_MD("get_cell_item","x","y","z"),&GridMap::get_cell_item); + ClassDB::bind_method(_MD("get_cell_item_orientation","x","y","z"),&GridMap::get_cell_item_orientation); -// ObjectTypeDB::bind_method(_MD("_recreate_octants"),&GridMap::_recreate_octants); - ObjectTypeDB::bind_method(_MD("_update_dirty_map_callback"),&GridMap::_update_dirty_map_callback); - ObjectTypeDB::bind_method(_MD("resource_changed","resource"),&GridMap::resource_changed); +// ClassDB::bind_method(_MD("_recreate_octants"),&GridMap::_recreate_octants); + ClassDB::bind_method(_MD("_update_dirty_map_callback"),&GridMap::_update_dirty_map_callback); + ClassDB::bind_method(_MD("resource_changed","resource"),&GridMap::resource_changed); - ObjectTypeDB::bind_method(_MD("set_center_x","enable"),&GridMap::set_center_x); - ObjectTypeDB::bind_method(_MD("get_center_x"),&GridMap::get_center_x); - ObjectTypeDB::bind_method(_MD("set_center_y","enable"),&GridMap::set_center_y); - ObjectTypeDB::bind_method(_MD("get_center_y"),&GridMap::get_center_y); - ObjectTypeDB::bind_method(_MD("set_center_z","enable"),&GridMap::set_center_z); - ObjectTypeDB::bind_method(_MD("get_center_z"),&GridMap::get_center_z); + ClassDB::bind_method(_MD("set_center_x","enable"),&GridMap::set_center_x); + ClassDB::bind_method(_MD("get_center_x"),&GridMap::get_center_x); + ClassDB::bind_method(_MD("set_center_y","enable"),&GridMap::set_center_y); + ClassDB::bind_method(_MD("get_center_y"),&GridMap::get_center_y); + ClassDB::bind_method(_MD("set_center_z","enable"),&GridMap::set_center_z); + ClassDB::bind_method(_MD("get_center_z"),&GridMap::get_center_z); - ObjectTypeDB::bind_method(_MD("set_clip","enabled","clipabove","floor","axis"),&GridMap::set_clip,DEFVAL(true),DEFVAL(0),DEFVAL(Vector3::AXIS_X)); + ClassDB::bind_method(_MD("set_clip","enabled","clipabove","floor","axis"),&GridMap::set_clip,DEFVAL(true),DEFVAL(0),DEFVAL(Vector3::AXIS_X)); - ObjectTypeDB::bind_method(_MD("create_area","id","area"),&GridMap::create_area); - ObjectTypeDB::bind_method(_MD("area_get_bounds","area","bounds"),&GridMap::area_get_bounds); - ObjectTypeDB::bind_method(_MD("area_set_exterior_portal","area","enable"),&GridMap::area_set_exterior_portal); - ObjectTypeDB::bind_method(_MD("area_set_name","area","name"),&GridMap::area_set_name); - ObjectTypeDB::bind_method(_MD("area_get_name","area"),&GridMap::area_get_name); - ObjectTypeDB::bind_method(_MD("area_is_exterior_portal","area"),&GridMap::area_is_exterior_portal); - ObjectTypeDB::bind_method(_MD("area_set_portal_disable_distance","area","distance"),&GridMap::area_set_portal_disable_distance); - ObjectTypeDB::bind_method(_MD("area_get_portal_disable_distance","area"),&GridMap::area_get_portal_disable_distance); - ObjectTypeDB::bind_method(_MD("area_set_portal_disable_color","area","color"),&GridMap::area_set_portal_disable_color); - ObjectTypeDB::bind_method(_MD("area_get_portal_disable_color","area"),&GridMap::area_get_portal_disable_color); - ObjectTypeDB::bind_method(_MD("erase_area","area"),&GridMap::erase_area); - ObjectTypeDB::bind_method(_MD("get_unused_area_id","area"),&GridMap::get_unused_area_id); - ObjectTypeDB::bind_method(_MD("bake_geometry"),&GridMap::bake_geometry); + ClassDB::bind_method(_MD("create_area","id","area"),&GridMap::create_area); + ClassDB::bind_method(_MD("area_get_bounds","area","bounds"),&GridMap::area_get_bounds); + ClassDB::bind_method(_MD("area_set_exterior_portal","area","enable"),&GridMap::area_set_exterior_portal); + ClassDB::bind_method(_MD("area_set_name","area","name"),&GridMap::area_set_name); + ClassDB::bind_method(_MD("area_get_name","area"),&GridMap::area_get_name); + ClassDB::bind_method(_MD("area_is_exterior_portal","area"),&GridMap::area_is_exterior_portal); + ClassDB::bind_method(_MD("area_set_portal_disable_distance","area","distance"),&GridMap::area_set_portal_disable_distance); + ClassDB::bind_method(_MD("area_get_portal_disable_distance","area"),&GridMap::area_get_portal_disable_distance); + ClassDB::bind_method(_MD("area_set_portal_disable_color","area","color"),&GridMap::area_set_portal_disable_color); + ClassDB::bind_method(_MD("area_get_portal_disable_color","area"),&GridMap::area_get_portal_disable_color); + ClassDB::bind_method(_MD("erase_area","area"),&GridMap::erase_area); + ClassDB::bind_method(_MD("get_unused_area_id","area"),&GridMap::get_unused_area_id); + ClassDB::bind_method(_MD("bake_geometry"),&GridMap::bake_geometry); - ObjectTypeDB::bind_method(_MD("_baked_light_changed"),&GridMap::_baked_light_changed); - ObjectTypeDB::bind_method(_MD("set_use_baked_light","use"),&GridMap::set_use_baked_light); - ObjectTypeDB::bind_method(_MD("is_using_baked_light","use"),&GridMap::is_using_baked_light); + ClassDB::bind_method(_MD("_baked_light_changed"),&GridMap::_baked_light_changed); + ClassDB::bind_method(_MD("set_use_baked_light","use"),&GridMap::set_use_baked_light); + ClassDB::bind_method(_MD("is_using_baked_light","use"),&GridMap::is_using_baked_light); - ObjectTypeDB::bind_method(_MD("_get_baked_light_meshes"),&GridMap::_get_baked_light_meshes); + ClassDB::bind_method(_MD("_get_baked_light_meshes"),&GridMap::_get_baked_light_meshes); - ObjectTypeDB::set_method_flags("GridMap","bake_geometry",METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + ClassDB::set_method_flags("GridMap","bake_geometry",METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); - ObjectTypeDB::bind_method(_MD("clear"),&GridMap::clear); + ClassDB::bind_method(_MD("clear"),&GridMap::clear); BIND_CONSTANT( INVALID_CELL_ITEM ); @@ -1435,7 +1435,7 @@ void GridMap::_update_area_instances() { } -Error GridMap::create_area(int p_id,const AABB& p_bounds) { +Error GridMap::create_area(int p_id,const Rect3& p_bounds) { ERR_FAIL_COND_V(area_map.has(p_id),ERR_ALREADY_EXISTS); ERR_EXPLAIN("ID 0 is taken as global area, start from 1"); @@ -1484,12 +1484,12 @@ Error GridMap::create_area(int p_id,const AABB& p_bounds) { return OK; } -AABB GridMap::area_get_bounds(int p_area) const { +Rect3 GridMap::area_get_bounds(int p_area) const { - ERR_FAIL_COND_V(!area_map.has(p_area),AABB()); + ERR_FAIL_COND_V(!area_map.has(p_area),Rect3()); const Area *a = area_map[p_area]; - AABB aabb; + Rect3 aabb; aabb.pos=Vector3(a->from.x,a->from.y,a->from.z); aabb.size=Vector3(a->to.x,a->to.y,a->to.z)-aabb.pos; @@ -1667,7 +1667,7 @@ void GridMap::bake_geometry() { } - DVector<Vector3> vv; + PoolVector<Vector3> vv; vv.fill_with(vertices); //print_line("TOTAL VERTICES: "+itos(vv.size())); tmesh = Ref<TriangleMesh>( memnew( TriangleMesh )); diff --git a/modules/gridmap/grid_map.h b/modules/gridmap/grid_map.h index 0116ea094f..04d140cdc6 100644 --- a/modules/gridmap/grid_map.h +++ b/modules/gridmap/grid_map.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -44,7 +44,7 @@ class BakedLightInstance; class GridMap : public Spatial { - OBJ_TYPE( GridMap, Spatial ); + GDCLASS( GridMap, Spatial ); enum { MAP_DIRTY_TRANSFORMS=1, @@ -268,8 +268,8 @@ public: void set_clip(bool p_enabled, bool p_clip_above=true, int p_floor=0, Vector3::Axis p_axis=Vector3::AXIS_X); - Error create_area(int p_id,const AABB& p_area); - AABB area_get_bounds(int p_area) const; + Error create_area(int p_id,const Rect3& p_area); + Rect3 area_get_bounds(int p_area) const; void area_set_exterior_portal(int p_area,bool p_enable); void area_set_name(int p_area,const String& p_name); String area_get_name(int p_area) const; diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index 9bdad6713d..109f6338db 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -99,70 +99,70 @@ void GridMapEditor::_menu_option(int p_option) { } break; case MENU_OPTION_CURSOR_ROTATE_Y: { - Matrix3 r; + Basis r; if (input_action==INPUT_DUPLICATE) { r.set_orthogonal_index(selection.duplicate_rot); - r.rotate(Vector3(0,1,0),Math_PI/2.0); + r.rotate(Vector3(0,1,0),-Math_PI/2.0); selection.duplicate_rot=r.get_orthogonal_index(); _update_duplicate_indicator(); break; } r.set_orthogonal_index(cursor_rot); - r.rotate(Vector3(0,1,0),Math_PI/2.0); + r.rotate(Vector3(0,1,0),-Math_PI/2.0); cursor_rot=r.get_orthogonal_index(); _update_cursor_transform(); } break; case MENU_OPTION_CURSOR_ROTATE_X: { - Matrix3 r; + Basis r; if (input_action==INPUT_DUPLICATE) { r.set_orthogonal_index(selection.duplicate_rot); - r.rotate(Vector3(1,0,0),Math_PI/2.0); + r.rotate(Vector3(1,0,0),-Math_PI/2.0); selection.duplicate_rot=r.get_orthogonal_index(); _update_duplicate_indicator(); break; } r.set_orthogonal_index(cursor_rot); - r.rotate(Vector3(1,0,0),Math_PI/2.0); + r.rotate(Vector3(1,0,0),-Math_PI/2.0); cursor_rot=r.get_orthogonal_index(); _update_cursor_transform(); } break; case MENU_OPTION_CURSOR_ROTATE_Z: { - Matrix3 r; + Basis r; if (input_action==INPUT_DUPLICATE) { r.set_orthogonal_index(selection.duplicate_rot); - r.rotate(Vector3(0,0,1),Math_PI/2.0); + r.rotate(Vector3(0,0,1),-Math_PI/2.0); selection.duplicate_rot=r.get_orthogonal_index(); _update_duplicate_indicator(); break; } r.set_orthogonal_index(cursor_rot); - r.rotate(Vector3(0,0,1),Math_PI/2.0); + r.rotate(Vector3(0,0,1),-Math_PI/2.0); cursor_rot=r.get_orthogonal_index(); _update_cursor_transform(); } break; case MENU_OPTION_CURSOR_BACK_ROTATE_Y: { - Matrix3 r; + Basis r; r.set_orthogonal_index(cursor_rot); - r.rotate(Vector3(0,1,0),-Math_PI/2.0); + r.rotate(Vector3(0,1,0),Math_PI/2.0); cursor_rot=r.get_orthogonal_index(); _update_cursor_transform(); } break; case MENU_OPTION_CURSOR_BACK_ROTATE_X: { - Matrix3 r; + Basis r; r.set_orthogonal_index(cursor_rot); - r.rotate(Vector3(1,0,0),-Math_PI/2.0); + r.rotate(Vector3(1,0,0),Math_PI/2.0); cursor_rot=r.get_orthogonal_index(); _update_cursor_transform(); } break; case MENU_OPTION_CURSOR_BACK_ROTATE_Z: { - Matrix3 r; + Basis r; r.set_orthogonal_index(cursor_rot); - r.rotate(Vector3(0,0,1),-Math_PI/2.0); + r.rotate(Vector3(0,0,1),Math_PI/2.0); cursor_rot=r.get_orthogonal_index(); _update_cursor_transform(); } break; @@ -191,7 +191,7 @@ void GridMapEditor::_menu_option(int p_option) { if (!selection.active) break; int area = node->get_unused_area_id(); - Error err = node->create_area(area,AABB(selection.begin,selection.end-selection.begin+Vector3(1,1,1))); + Error err = node->create_area(area,Rect3(selection.begin,selection.end-selection.begin+Vector3(1,1,1))); if (err!=OK) { @@ -318,7 +318,7 @@ bool GridMapEditor::do_input_action(Camera* p_camera,const Point2& p_point,bool p.d=edit_floor[edit_axis]*node->get_cell_size(); Vector3 inters; - if (!p.intersects_segment(from, from + normal * settings_pick_distance->get_val(), &inters)) + if (!p.intersects_segment(from, from + normal * settings_pick_distance->get_value(), &inters)) return false; @@ -358,7 +358,7 @@ bool GridMapEditor::do_input_action(Camera* p_camera,const Point2& p_point,bool } last_mouseover=Vector3(cell[0],cell[1],cell[2]); - VS::get_singleton()->instance_set_transform(grid_instance[edit_axis],Transform(Matrix3(),grid_ofs)); + VS::get_singleton()->instance_set_transform(grid_instance[edit_axis],Transform(Basis(),grid_ofs)); if (cursor_instance.is_valid()) { @@ -459,7 +459,7 @@ void GridMapEditor::_update_duplicate_indicator() { Transform xf; xf.scale(Vector3(1,1,1)*(Vector3(1,1,1)+(selection.end-selection.begin))*node->get_cell_size()); xf.origin=(selection.begin+(selection.current-selection.click))*node->get_cell_size(); - Matrix3 rot; + Basis rot; rot.set_orthogonal_index(selection.duplicate_rot); xf.basis = rot * xf.basis; @@ -481,7 +481,7 @@ void GridMapEditor::_duplicate_paste() { List< __Item > items; - Matrix3 rot; + Basis rot; rot.set_orthogonal_index(selection.duplicate_rot); for(int i=selection.begin.x;i<=selection.end.x;i++) { @@ -498,7 +498,7 @@ void GridMapEditor::_duplicate_paste() { Vector3 rel=Vector3(i,j,k)-selection.begin; rel = rot.xform(rel); - Matrix3 orm; + Basis orm; orm.set_orthogonal_index(orientation); orm = rot * orm; @@ -548,12 +548,12 @@ bool GridMapEditor::forward_spatial_input_event(Camera* p_camera,const InputEven if (p_event.mouse_button.button_index==BUTTON_WHEEL_UP && (p_event.mouse_button.mod.command || p_event.mouse_button.mod.shift)) { if (p_event.mouse_button.pressed) - floor->set_val( floor->get_val() +1); + floor->set_value( floor->get_value() +1); return true; //eaten } else if (p_event.mouse_button.button_index==BUTTON_WHEEL_DOWN && (p_event.mouse_button.mod.command || p_event.mouse_button.mod.shift)) { if (p_event.mouse_button.pressed) - floor->set_val( floor->get_val() -1); + floor->set_value( floor->get_value() -1); return true; } @@ -664,7 +664,7 @@ bool GridMapEditor::forward_spatial_input_event(Camera* p_camera,const InputEven for(List<int>::Element *E=areas.front();E;E=E->next()) { int area = E->get(); - AABB aabb = node->area_get_bounds(area); + Rect3 aabb = node->area_get_bounds(area); aabb.pos*=node->get_cell_size(); aabb.size*=node->get_cell_size(); @@ -731,7 +731,7 @@ void GridMapEditor::update_pallete() { theme_pallete->set_icon_mode(ItemList::ICON_MODE_LEFT); } - float min_size = EDITOR_DEF("grid_map/preview_size",64); + float min_size = EDITOR_DEF("editors/grid_map/preview_size",64); theme_pallete->set_fixed_icon_size(Size2(min_size, min_size)); theme_pallete->set_fixed_column_width(min_size*3/2); theme_pallete->set_max_text_lines(2); @@ -972,7 +972,7 @@ void GridMapEditor::update_grid() { grid_ofs[edit_axis]=edit_floor[edit_axis]*node->get_cell_size(); edit_grid_xform.origin=grid_ofs; - edit_grid_xform.basis=Matrix3(); + edit_grid_xform.basis=Basis(); for(int i=0;i<3;i++) { @@ -981,7 +981,7 @@ void GridMapEditor::update_grid() { } updating=true; - floor->set_val(edit_floor[edit_axis]); + floor->set_value(edit_floor[edit_axis]); updating=false; } @@ -1126,7 +1126,7 @@ void GridMapEditor::_update_areas_display() { RID mesh = VisualServer::get_singleton()->mesh_create(); - DVector<Plane> planes; + PoolVector<Plane> planes; for(int i=0;i<3;i++) { Vector3 axis; @@ -1142,7 +1142,7 @@ void GridMapEditor::_update_areas_display() { ad.mesh=mesh; ad.instance = VisualServer::get_singleton()->instance_create2(mesh,node->get_world()->get_scenario()); Transform xform; - AABB aabb = node->area_get_bounds(area); + Rect3 aabb = node->area_get_bounds(area); xform.origin=aabb.pos * node->get_cell_size(); xform.basis.scale(aabb.size * node->get_cell_size()); VisualServer::get_singleton()->instance_set_transform(ad.instance,global_xf * xform); @@ -1181,15 +1181,15 @@ void GridMapEditor::_floor_changed(float p_value) { void GridMapEditor::_bind_methods() { - ObjectTypeDB::bind_method("_menu_option",&GridMapEditor::_menu_option); - ObjectTypeDB::bind_method("_configure",&GridMapEditor::_configure); - ObjectTypeDB::bind_method("_item_selected_cbk",&GridMapEditor::_item_selected_cbk); - ObjectTypeDB::bind_method("_edit_mode_changed",&GridMapEditor::_edit_mode_changed); - ObjectTypeDB::bind_method("_area_renamed",&GridMapEditor::_area_renamed); - ObjectTypeDB::bind_method("_area_selected",&GridMapEditor::_area_selected); - ObjectTypeDB::bind_method("_floor_changed",&GridMapEditor::_floor_changed); + ClassDB::bind_method("_menu_option",&GridMapEditor::_menu_option); + ClassDB::bind_method("_configure",&GridMapEditor::_configure); + ClassDB::bind_method("_item_selected_cbk",&GridMapEditor::_item_selected_cbk); + ClassDB::bind_method("_edit_mode_changed",&GridMapEditor::_edit_mode_changed); + ClassDB::bind_method("_area_renamed",&GridMapEditor::_area_renamed); + ClassDB::bind_method("_area_selected",&GridMapEditor::_area_selected); + ClassDB::bind_method("_floor_changed",&GridMapEditor::_floor_changed); - ObjectTypeDB::bind_method(_MD("_set_display_mode","mode"), &GridMapEditor::_set_display_mode); + ClassDB::bind_method(_MD("_set_display_mode","mode"), &GridMapEditor::_set_display_mode); } @@ -1201,7 +1201,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { editor=p_editor; undo_redo=p_editor->get_undo_redo(); - int mw = EDITOR_DEF("grid_map/palette_min_width",230); + int mw = EDITOR_DEF("editors/grid_map/palette_min_width",230); Control *ec = memnew( Control); ec->set_custom_minimum_size(Size2(mw,0)); add_child(ec); @@ -1257,17 +1257,16 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { settings_vbc = memnew(VBoxContainer); settings_vbc->set_custom_minimum_size(Size2(200, 0)); settings_dialog->add_child(settings_vbc); - settings_dialog->set_child_rect(settings_vbc); settings_pick_distance = memnew(SpinBox); settings_pick_distance->set_max(10000.0f); settings_pick_distance->set_min(500.0f); settings_pick_distance->set_step(1.0f); - settings_pick_distance->set_val(EDITOR_DEF("grid_map/pick_distance", 5000.0)); + settings_pick_distance->set_value(EDITOR_DEF("editors/grid_map/pick_distance", 5000.0)); settings_vbc->add_margin_child("Pick Distance:", settings_pick_distance); clip_mode=CLIP_DISABLED; - options->get_popup()->connect("item_pressed", this,"_menu_option"); + options->get_popup()->connect("id_pressed", this,"_menu_option"); HBoxContainer *hb = memnew( HBoxContainer ); add_child(hb); @@ -1296,6 +1295,8 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { hb->add_child(mode_list); mode_list->connect("pressed", this, "_set_display_mode", varray(DISPLAY_LIST)); + EDITOR_DEF("editors/grid_map/preview_size",64) + display_mode = DISPLAY_THUMBNAIL; selected_area=-1; @@ -1341,8 +1342,8 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { //selection mesh create - DVector<Vector3> lines; - DVector<Vector3> triangles; + PoolVector<Vector3> lines; + PoolVector<Vector3> triangles; for (int i=0;i<6;i++) { @@ -1376,7 +1377,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { for(int i=0;i<12;i++) { - AABB base(Vector3(0,0,0),Vector3(1,1,1)); + Rect3 base(Vector3(0,0,0),Vector3(1,1,1)); Vector3 a,b; base.get_edge(i,a,b); lines.push_back(a); @@ -1480,7 +1481,7 @@ void GridMapEditorPlugin::edit(Object *p_object) { bool GridMapEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("GridMap"); + return p_object->is_class("GridMap"); } void GridMapEditorPlugin::make_visible(bool p_visible) { diff --git a/modules/gridmap/grid_map_editor_plugin.h b/modules/gridmap/grid_map_editor_plugin.h index 535c51bcbf..2c0ff99dc6 100644 --- a/modules/gridmap/grid_map_editor_plugin.h +++ b/modules/gridmap/grid_map_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -40,7 +40,7 @@ class SpatialEditorPlugin; class GridMapEditor : public VBoxContainer { - OBJ_TYPE(GridMapEditor, VBoxContainer ); + GDCLASS(GridMapEditor, VBoxContainer ); enum { @@ -238,7 +238,7 @@ public: class GridMapEditorPlugin : public EditorPlugin { - OBJ_TYPE( GridMapEditorPlugin, EditorPlugin ); + GDCLASS( GridMapEditorPlugin, EditorPlugin ); GridMapEditor *gridmap_editor; EditorNode *editor; diff --git a/modules/gridmap/register_types.cpp b/modules/gridmap/register_types.cpp index 9dcc04b22a..b4a0d3b0b7 100644 --- a/modules/gridmap/register_types.cpp +++ b/modules/gridmap/register_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ void register_gridmap_types() { #ifndef _3D_DISABLED - ObjectTypeDB::register_type<GridMap>(); + ClassDB::register_class<GridMap>(); #ifdef TOOLS_ENABLED EditorPlugins::add_by_type<GridMapEditorPlugin>(); #endif diff --git a/modules/gridmap/register_types.h b/modules/gridmap/register_types.h index 7b5c10f9e5..cc7c13961a 100644 --- a/modules/gridmap/register_types.h +++ b/modules/gridmap/register_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/ik/SCsub b/modules/ik/SCsub deleted file mode 100644 index 0882406761..0000000000 --- a/modules/ik/SCsub +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env python - -Import('env') - -env.add_source_files(env.modules_sources, "*.cpp") - -Export('env') diff --git a/modules/ik/config.py b/modules/ik/config.py deleted file mode 100644 index 5698a37295..0000000000 --- a/modules/ik/config.py +++ /dev/null @@ -1,8 +0,0 @@ - - -def can_build(platform): - return True - - -def configure(env): - pass diff --git a/modules/ik/ik.cpp b/modules/ik/ik.cpp deleted file mode 100644 index 35b3ba7e83..0000000000 --- a/modules/ik/ik.cpp +++ /dev/null @@ -1,326 +0,0 @@ -/*************************************************************************/ -/* ik.cpp */ -/* Copyright (c) 2016 Sergey Lapin <slapinid@gmail.com> */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ - -#include "ik.h" - -bool InverseKinematics::_get(const StringName& p_name,Variant &r_ret) const -{ - - if (String(p_name)=="ik_bone") { - - r_ret=get_bone_name(); - return true; - } - - return false; -} - -bool InverseKinematics::_set(const StringName& p_name, const Variant& p_value) -{ - - if (String(p_name)=="ik_bone") { - - set_bone_name(p_value); - changed = true; - return true; - } - - return false; -} - -void InverseKinematics::_get_property_list( List<PropertyInfo>* p_list ) const -{ - - Skeleton *parent=NULL; - if(get_parent()) - parent=get_parent()->cast_to<Skeleton>(); - - if (parent) { - - String names; - for(int i=0;i<parent->get_bone_count();i++) { - if(i>0) - names+=","; - names+=parent->get_bone_name(i); - } - - p_list->push_back(PropertyInfo(Variant::STRING,"ik_bone",PROPERTY_HINT_ENUM,names)); - } else { - - p_list->push_back(PropertyInfo(Variant::STRING,"ik_bone")); - - } - -} - -void InverseKinematics::_check_bind() -{ - - if (get_parent() && get_parent()->cast_to<Skeleton>()) { - Skeleton *sk = get_parent()->cast_to<Skeleton>(); - int idx = sk->find_bone(ik_bone); - if (idx!=-1) { - ik_bone_no = idx; - bound=true; - } - skel = sk; - } -} - -void InverseKinematics::_check_unbind() -{ - - if (bound) { - - if (get_parent() && get_parent()->cast_to<Skeleton>()) { - Skeleton *sk = get_parent()->cast_to<Skeleton>(); - int idx = sk->find_bone(ik_bone); - if (idx!=-1) - ik_bone_no = idx; - else - ik_bone_no = 0; - skel = sk; - - } - bound=false; - } -} - - -void InverseKinematics::set_bone_name(const String& p_name) -{ - - if (is_inside_tree()) - _check_unbind(); - - ik_bone=p_name; - - if (is_inside_tree()) - _check_bind(); - changed = true; -} - -String InverseKinematics::get_bone_name() const -{ - - return ik_bone; -} - -void InverseKinematics::set_iterations(int itn) -{ - - if (is_inside_tree()) - _check_unbind(); - - iterations=itn; - - if (is_inside_tree()) - _check_bind(); - changed = true; -} - -int InverseKinematics::get_iterations() const -{ - - return iterations; -} - -void InverseKinematics::set_chain_size(int cs) -{ - if (is_inside_tree()) - _check_unbind(); - - chain_size=cs; - chain.clear(); - if (bound) - update_parameters(); - - if (is_inside_tree()) - _check_bind(); - changed = true; -} - -int InverseKinematics::get_chain_size() const -{ - - return chain_size; -} - -void InverseKinematics::set_precision(float p) -{ - - if (is_inside_tree()) - _check_unbind(); - - precision=p; - - if (is_inside_tree()) - _check_bind(); - changed = true; -} - -float InverseKinematics::get_precision() const -{ - - return precision; -} - -void InverseKinematics::set_speed(float p) -{ - - if (is_inside_tree()) - _check_unbind(); - - speed=p; - - if (is_inside_tree()) - _check_bind(); - changed = true; -} - -float InverseKinematics::get_speed() const -{ - - return speed; -} - -void InverseKinematics::update_parameters() -{ - tail_bone = -1; - for (int i = 0; i < skel->get_bone_count(); i++) - if (skel->get_bone_parent(i) == ik_bone_no) - tail_bone = i; - int cur_bone = ik_bone_no; - int its = chain_size; - while (its > 0 && cur_bone >= 0) { - chain.push_back(cur_bone); - cur_bone = skel->get_bone_parent(cur_bone); - its--; - } -} - -void InverseKinematics::_notification(int p_what) -{ - - switch(p_what) { - - case NOTIFICATION_ENTER_TREE: { - - _check_bind(); - if (bound) { - update_parameters(); - changed = false; - set_process(true); - } - } break; - case NOTIFICATION_PROCESS: { - - Spatial *sksp = skel->cast_to<Spatial>(); - if (!bound) - break; - if (!sksp) - break; - if (changed) { - update_parameters(); - changed = false; - } - Vector3 to = get_translation(); - for (int hump = 0; hump < iterations; hump++) { - int depth = 0; - float olderr = 1000.0; - float psign = 1.0; - bool reached = false; - - for (List<int>::Element *b = chain.front(); b; b = b->next()) { - int cur_bone = b->get(); - Vector3 d = skel->get_bone_global_pose(tail_bone).origin; - Vector3 rg = to; - float err = d.distance_squared_to(rg); - if (err < precision) { - if (!reached && err < precision) - reached = true; - break; - } else - if (reached) - reached = false; - if (err > olderr) - psign = -psign; - Transform mod = skel->get_bone_global_pose(cur_bone); - Quat q1 = Quat(mod.basis).normalized(); - Transform mod2 = mod.looking_at(to, Vector3(0.0, 1.0, 0.0)); - Quat q2 = Quat(mod2.basis).normalized(); - if (psign < 0.0) - q2 = q2.inverse(); - Quat q = q1.slerp(q2, speed / (1.0 + 500.0 * depth)).normalized(); - Transform fin = Transform(q); - fin.origin = mod.origin; - skel->set_bone_global_pose(cur_bone, fin); - depth++; - } - if (reached) - break; - - } - - } break; - case NOTIFICATION_EXIT_TREE: { - set_process(false); - - _check_unbind(); - } break; - } -} -void InverseKinematics::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_bone_name","ik_bone"),&InverseKinematics::set_bone_name); - ObjectTypeDB::bind_method(_MD("get_bone_name"),&InverseKinematics::get_bone_name); - ObjectTypeDB::bind_method(_MD("set_iterations","iterations"),&InverseKinematics::set_iterations); - ObjectTypeDB::bind_method(_MD("get_iterations"),&InverseKinematics::get_iterations); - ObjectTypeDB::bind_method(_MD("set_chain_size","chain_size"),&InverseKinematics::set_chain_size); - ObjectTypeDB::bind_method(_MD("get_chain_size"),&InverseKinematics::get_chain_size); - ObjectTypeDB::bind_method(_MD("set_precision","precision"),&InverseKinematics::set_precision); - ObjectTypeDB::bind_method(_MD("get_precision"),&InverseKinematics::get_precision); - ObjectTypeDB::bind_method(_MD("set_speed","speed"),&InverseKinematics::set_speed); - ObjectTypeDB::bind_method(_MD("get_speed"),&InverseKinematics::get_speed); - ADD_PROPERTY(PropertyInfo(Variant::INT, "iterations"), _SCS("set_iterations"), _SCS("get_iterations")); - ADD_PROPERTY(PropertyInfo(Variant::INT, "chain_size"), _SCS("set_chain_size"), _SCS("get_chain_size")); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "precision"), _SCS("set_precision"), _SCS("get_precision")); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "speed"), _SCS("set_speed"), _SCS("get_speed")); -} - -InverseKinematics::InverseKinematics() -{ - bound=false; - chain_size = 2; - iterations = 100; - precision = 0.001; - speed = 0.2; - -} - diff --git a/modules/ik/ik.h b/modules/ik/ik.h deleted file mode 100644 index b57d69b026..0000000000 --- a/modules/ik/ik.h +++ /dev/null @@ -1,74 +0,0 @@ -/*************************************************************************/ -/* ik.h */ -/* Copyright (c) 2016 Sergey Lapin <slapinid@gmail.com> */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef IK_H -#define IK_H - -#include "scene/3d/skeleton.h" -class InverseKinematics : public Spatial { - OBJ_TYPE(InverseKinematics, Spatial); - bool bound; - String ik_bone; - int ik_bone_no; - int tail_bone; - int chain_size; - Skeleton *skel; - List<int> chain; - void _check_bind(); - void _check_unbind(); - int iterations; - float precision; - float speed; - bool changed; - -protected: - bool _set(const StringName& p_name, const Variant& p_value); - bool _get(const StringName& p_name,Variant &r_ret) const; - void _get_property_list( List<PropertyInfo> *p_list) const; - - void _notification(int p_what); - static void _bind_methods(); - void update_parameters(); -public: - Skeleton *get_skeleton(); - void set_bone_name(const String& p_name); - String get_bone_name() const; - void set_iterations(int itn); - int get_iterations() const; - void set_chain_size(int cs); - int get_chain_size() const; - void set_precision(float p); - float get_precision() const; - void set_speed(float p); - float get_speed() const; - InverseKinematics(); -}; - -#endif - diff --git a/modules/ik/register_types.cpp b/modules/ik/register_types.cpp deleted file mode 100644 index e7df7f55b2..0000000000 --- a/modules/ik/register_types.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/*************************************************************************/ -/* register_types.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "register_types.h" -#ifndef _3D_DISABLED -#include "object_type_db.h" -#include "ik.h" -#endif - -void register_ik_types() { - -#ifndef _3D_DISABLED - ObjectTypeDB::register_type<InverseKinematics>(); -#endif -} - - - -void unregister_ik_types() { - - -} diff --git a/modules/ik/register_types.h b/modules/ik/register_types.h deleted file mode 100644 index 828917ade7..0000000000 --- a/modules/ik/register_types.h +++ /dev/null @@ -1,30 +0,0 @@ -/*************************************************************************/ -/* register_types.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -void register_ik_types(); -void unregister_ik_types(); diff --git a/modules/jpg/image_loader_jpegd.cpp b/modules/jpg/image_loader_jpegd.cpp index 03c3b19fc0..1152d42e1b 100644 --- a/modules/jpg/image_loader_jpegd.cpp +++ b/modules/jpg/image_loader_jpegd.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -56,11 +56,11 @@ Error jpeg_load_image_from_buffer(Image *p_image,const uint8_t* p_buffer, int p_ const int dst_bpl = image_width * comps; - DVector<uint8_t> data; + PoolVector<uint8_t> data; data.resize(dst_bpl * image_height); - DVector<uint8_t>::Write dw = data.write(); + PoolVector<uint8_t>::Write dw = data.write(); jpgd::uint8 *pImage_data = (jpgd::uint8*)dw.ptr(); @@ -84,11 +84,11 @@ Error jpeg_load_image_from_buffer(Image *p_image,const uint8_t* p_buffer, int p_ Image::Format fmt; if (comps==1) - fmt=Image::FORMAT_GRAYSCALE; + fmt=Image::FORMAT_L8; else - fmt=Image::FORMAT_RGBA; + fmt=Image::FORMAT_RGBA8; - dw = DVector<uint8_t>::Write(); + dw = PoolVector<uint8_t>::Write(); p_image->create(image_width,image_height,0,fmt,data); return OK; @@ -99,12 +99,12 @@ Error jpeg_load_image_from_buffer(Image *p_image,const uint8_t* p_buffer, int p_ Error ImageLoaderJPG::load_image(Image *p_image,FileAccess *f) { - DVector<uint8_t> src_image; + PoolVector<uint8_t> src_image; int src_image_len = f->get_len(); ERR_FAIL_COND_V(src_image_len == 0, ERR_FILE_CORRUPT); src_image.resize(src_image_len); - DVector<uint8_t>::Write w = src_image.write(); + PoolVector<uint8_t>::Write w = src_image.write(); f->get_buffer(&w[0],src_image_len); @@ -113,7 +113,7 @@ Error ImageLoaderJPG::load_image(Image *p_image,FileAccess *f) { Error err = jpeg_load_image_from_buffer(p_image,w.ptr(),src_image_len); - w = DVector<uint8_t>::Write(); + w = PoolVector<uint8_t>::Write(); return err; diff --git a/modules/jpg/image_loader_jpegd.h b/modules/jpg/image_loader_jpegd.h index 2c52309ab1..aeb219aa5d 100644 --- a/modules/jpg/image_loader_jpegd.h +++ b/modules/jpg/image_loader_jpegd.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/jpg/register_types.cpp b/modules/jpg/register_types.cpp index a648423cdf..bcd467f5fc 100644 --- a/modules/jpg/register_types.cpp +++ b/modules/jpg/register_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/jpg/register_types.h b/modules/jpg/register_types.h index 0e06c4ff81..62132bf461 100644 --- a/modules/jpg/register_types.h +++ b/modules/jpg/register_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/mpc/SCsub b/modules/mpc/SCsub deleted file mode 100644 index 76b7cbea7a..0000000000 --- a/modules/mpc/SCsub +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env python - -Import('env') -Import('env_modules') - -env_mpc = env_modules.Clone() - -# Thirdparty source files -if (env['builtin_libmpcdec'] != 'no'): - thirdparty_dir = "#thirdparty/libmpcdec/" - thirdparty_sources = [ - "huffman.c", - "mpc_bits_reader.c", - "mpc_decoder.c", - "mpc_demux.c", - "mpc_reader.c", - "requant.c", - "streaminfo.c", - "synth_filter.c", - ] - - thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] - - env_mpc.add_source_files(env.modules_sources, thirdparty_sources) - env_mpc.Append(CPPPATH=[thirdparty_dir]) - -# Godot source files -env_mpc.add_source_files(env.modules_sources, "*.cpp") diff --git a/modules/mpc/audio_stream_mpc.cpp b/modules/mpc/audio_stream_mpc.cpp deleted file mode 100644 index 9713eb3c77..0000000000 --- a/modules/mpc/audio_stream_mpc.cpp +++ /dev/null @@ -1,414 +0,0 @@ -/*************************************************************************/ -/* audio_stream_mpc.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "audio_stream_mpc.h" - - -Error AudioStreamPlaybackMPC::_open_file() { - - if (f) { - memdelete(f); - f=NULL; - } - Error err; - //printf("mpc open file %ls\n", file.c_str()); - f=FileAccess::open(file,FileAccess::READ,&err); - - if (err) { - f=NULL; - ERR_FAIL_V(err); - return err; - } - - //printf("file size is %i\n", f->get_len()); - //f->seek_end(0); - streamlen=f->get_len(); - //f->seek(0); - if (streamlen<=0) { - memdelete(f); - f=NULL; - ERR_FAIL_V(ERR_INVALID_DATA); - } - - data_ofs=0; - if (preload) { - - data.resize(streamlen); - DVector<uint8_t>::Write w = data.write(); - f->get_buffer(&w[0],streamlen); - memdelete(f); - f=NULL; - - } - - return OK; -} - -void AudioStreamPlaybackMPC::_close_file() { - - if (f) { - memdelete(f); - f=NULL; - } - data.resize(0); - streamlen=0; - data_ofs=0; -} - -int AudioStreamPlaybackMPC::_read_file(void *p_dst,int p_bytes) { - - if (f) - return f->get_buffer((uint8_t*)p_dst,p_bytes); - - DVector<uint8_t>::Read r = data.read(); - if (p_bytes+data_ofs > streamlen) { - p_bytes=streamlen-data_ofs; - } - - copymem(p_dst,&r[data_ofs],p_bytes); - //print_line("read file: "+itos(p_bytes)); - data_ofs+=p_bytes; - return p_bytes; -} - -bool AudioStreamPlaybackMPC::_seek_file(int p_pos){ - - if (p_pos<0 || p_pos>streamlen) - return false; - - if (f) { - f->seek(p_pos); - return true; - } - - //print_line("read file to: "+itos(p_pos)); - data_ofs=p_pos; - return true; - -} -int AudioStreamPlaybackMPC::_tell_file() const{ - - if (f) - return f->get_pos(); - - //print_line("tell file, get: "+itos(data_ofs)); - return data_ofs; - -} - -int AudioStreamPlaybackMPC::_sizeof_file() const{ - - //print_line("sizeof file, get: "+itos(streamlen)); - return streamlen; -} - -bool AudioStreamPlaybackMPC::_canseek_file() const{ - - //print_line("canseek file, get true"); - return true; -} - -///////////////////// - -mpc_int32_t AudioStreamPlaybackMPC::_mpc_read(mpc_reader *p_reader,void *p_dst, mpc_int32_t p_bytes) { - - AudioStreamPlaybackMPC *smpc=(AudioStreamPlaybackMPC *)p_reader->data; - return smpc->_read_file(p_dst,p_bytes); -} - -mpc_bool_t AudioStreamPlaybackMPC::_mpc_seek(mpc_reader *p_reader,mpc_int32_t p_offset) { - - AudioStreamPlaybackMPC *smpc=(AudioStreamPlaybackMPC *)p_reader->data; - return smpc->_seek_file(p_offset); - -} -mpc_int32_t AudioStreamPlaybackMPC::_mpc_tell(mpc_reader *p_reader) { - - AudioStreamPlaybackMPC *smpc=(AudioStreamPlaybackMPC *)p_reader->data; - return smpc->_tell_file(); - -} -mpc_int32_t AudioStreamPlaybackMPC::_mpc_get_size(mpc_reader *p_reader) { - - AudioStreamPlaybackMPC *smpc=(AudioStreamPlaybackMPC *)p_reader->data; - return smpc->_sizeof_file(); - - -} -mpc_bool_t AudioStreamPlaybackMPC::_mpc_canseek(mpc_reader *p_reader) { - - AudioStreamPlaybackMPC *smpc=(AudioStreamPlaybackMPC *)p_reader->data; - return smpc->_canseek_file(); -} - - - - -int AudioStreamPlaybackMPC::mix(int16_t* p_bufer,int p_frames) { - - if (!active || paused) - return 0; - - int todo=p_frames; - - while(todo>MPC_DECODER_BUFFER_LENGTH/si.channels) { - - mpc_frame_info frame; - - frame.buffer=sample_buffer; - - mpc_status err = mpc_demux_decode(demux, &frame); - if (frame.bits!=-1) { - - int16_t *dst_buff = p_bufer; - -#ifdef MPC_FIXED_POINT - - for( int i = 0; i < frame.samples * si.channels; i++) { - int tmp = sample_buffer[i] >> MPC_FIXED_POINT_FRACTPART; - if (tmp > ((1 << 15) - 1)) tmp = ((1 << 15) - 1); - if (tmp < -(1 << 15)) tmp = -(1 << 15); - dst_buff[i] = tmp; - } -#else - for( int i = 0; i < frame.samples * si.channels; i++) { - - int tmp = Math::fast_ftoi(sample_buffer[i]*32767.0); - if (tmp > ((1 << 15) - 1)) tmp = ((1 << 15) - 1); - if (tmp < -(1 << 15)) tmp = -(1 << 15); - dst_buff[i] = tmp; - - } - -#endif - - int frames = frame.samples; - p_bufer+=si.channels*frames; - todo-=frames; - } else { - - if (err != MPC_STATUS_OK) { - - stop(); - ERR_PRINT("Error decoding MPC"); - break; - } else { - - //finished - if (!loop) { - stop(); - break; - } else { - - - loops++; - mpc_demux_exit(demux); - _seek_file(0); - demux = mpc_demux_init(&reader); - //do loop somehow - - } - } - } - } - - return p_frames-todo; -} - -Error AudioStreamPlaybackMPC::_reload() { - - ERR_FAIL_COND_V(demux!=NULL, ERR_FILE_ALREADY_IN_USE); - - Error err = _open_file(); - ERR_FAIL_COND_V(err!=OK,ERR_CANT_OPEN); - - demux = mpc_demux_init(&reader); - ERR_FAIL_COND_V(!demux,ERR_CANT_CREATE); - mpc_demux_get_info(demux, &si); - - return OK; -} - -void AudioStreamPlaybackMPC::set_file(const String& p_file) { - - file=p_file; - - Error err = _open_file(); - ERR_FAIL_COND(err!=OK); - demux = mpc_demux_init(&reader); - ERR_FAIL_COND(!demux); - mpc_demux_get_info(demux, &si); - stream_min_size=MPC_DECODER_BUFFER_LENGTH*2/si.channels; - stream_rate=si.sample_freq; - stream_channels=si.channels; - - mpc_demux_exit(demux); - demux=NULL; - _close_file(); - -} - - -String AudioStreamPlaybackMPC::get_file() const { - - return file; -} - - -void AudioStreamPlaybackMPC::play(float p_offset) { - - - if (active) - stop(); - active=false; - - Error err = _open_file(); - ERR_FAIL_COND(err!=OK); - if (_reload()!=OK) - return; - active=true; - loops=0; - -} - -void AudioStreamPlaybackMPC::stop() { - - - if (!active) - return; - if (demux) { - mpc_demux_exit(demux); - demux=NULL; - } - _close_file(); - active=false; - -} -bool AudioStreamPlaybackMPC::is_playing() const { - - return active; -} - - -void AudioStreamPlaybackMPC::set_loop(bool p_enable) { - - loop=p_enable; -} -bool AudioStreamPlaybackMPC::has_loop() const { - - return loop; -} - -float AudioStreamPlaybackMPC::get_length() const { - - return 0; -} - -String AudioStreamPlaybackMPC::get_stream_name() const { - - return ""; -} - -int AudioStreamPlaybackMPC::get_loop_count() const { - - return 0; -} - -float AudioStreamPlaybackMPC::get_pos() const { - - return 0; -} -void AudioStreamPlaybackMPC::seek_pos(float p_time) { - - -} - - -void AudioStreamPlaybackMPC::_bind_methods() { - - ObjectTypeDB::bind_method(_MD("set_file","name"),&AudioStreamPlaybackMPC::set_file); - ObjectTypeDB::bind_method(_MD("get_file"),&AudioStreamPlaybackMPC::get_file); - - ADD_PROPERTYNZ( PropertyInfo(Variant::STRING,"file",PROPERTY_HINT_FILE,"mpc"), _SCS("set_file"), _SCS("get_file")); - -} - -AudioStreamPlaybackMPC::AudioStreamPlaybackMPC() { - - preload=false; - f=NULL; - streamlen=0; - data_ofs=0; - active=false; - paused=false; - loop=false; - demux=NULL; - reader.data=this; - reader.read=_mpc_read; - reader.seek=_mpc_seek; - reader.tell=_mpc_tell; - reader.get_size=_mpc_get_size; - reader.canseek=_mpc_canseek; - loops=0; - -} - -AudioStreamPlaybackMPC::~AudioStreamPlaybackMPC() { - - stop(); - - if (f) - memdelete(f); -} - - - -RES ResourceFormatLoaderAudioStreamMPC::load(const String &p_path, const String& p_original_path, Error *r_error) { - if (r_error) - *r_error=OK; //streamed so it will always work.. - AudioStreamMPC *mpc_stream = memnew(AudioStreamMPC); - mpc_stream->set_file(p_path); - return Ref<AudioStreamMPC>(mpc_stream); -} - -void ResourceFormatLoaderAudioStreamMPC::get_recognized_extensions(List<String> *p_extensions) const { - - p_extensions->push_back("mpc"); -} -bool ResourceFormatLoaderAudioStreamMPC::handles_type(const String& p_type) const { - - return (p_type=="AudioStream") || (p_type=="AudioStreamMPC"); -} - -String ResourceFormatLoaderAudioStreamMPC::get_resource_type(const String &p_path) const { - - if (p_path.extension().to_lower()=="mpc") - return "AudioStreamMPC"; - return ""; -} - diff --git a/modules/mpc/audio_stream_mpc.h b/modules/mpc/audio_stream_mpc.h deleted file mode 100644 index c982bdc358..0000000000 --- a/modules/mpc/audio_stream_mpc.h +++ /dev/null @@ -1,146 +0,0 @@ -/*************************************************************************/ -/* audio_stream_mpc.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef AUDIO_STREAM_MPC_H -#define AUDIO_STREAM_MPC_H - -#include "io/resource_loader.h" -#include "os/file_access.h" -#include "os/thread_safe.h" -#include "scene/resources/audio_stream.h" - -#include <mpc/mpcdec.h> - -class AudioStreamPlaybackMPC : public AudioStreamPlayback { - - OBJ_TYPE( AudioStreamPlaybackMPC, AudioStreamPlayback ); - - bool preload; - FileAccess *f; - String file; - DVector<uint8_t> data; - int data_ofs; - int streamlen; - - - bool active; - bool paused; - bool loop; - int loops; - - // mpc - mpc_reader reader; - mpc_demux* demux; - mpc_streaminfo si; - MPC_SAMPLE_FORMAT sample_buffer[MPC_DECODER_BUFFER_LENGTH]; - - static mpc_int32_t _mpc_read(mpc_reader *p_reader,void *p_dst, mpc_int32_t p_bytes); - static mpc_bool_t _mpc_seek(mpc_reader *p_reader,mpc_int32_t p_offset); - static mpc_int32_t _mpc_tell(mpc_reader *p_reader); - static mpc_int32_t _mpc_get_size(mpc_reader *p_reader); - static mpc_bool_t _mpc_canseek(mpc_reader *p_reader); - - int stream_min_size; - int stream_rate; - int stream_channels; - -protected: - Error _open_file(); - void _close_file(); - int _read_file(void *p_dst,int p_bytes); - bool _seek_file(int p_pos); - int _tell_file() const; - int _sizeof_file() const; - bool _canseek_file() const; - - - Error _reload(); - static void _bind_methods(); - -public: - - void set_file(const String& p_file); - String get_file() const; - - virtual void play(float p_offset=0); - virtual void stop(); - virtual bool is_playing() const; - - - virtual void set_loop(bool p_enable); - virtual bool has_loop() const; - - virtual float get_length() const; - - virtual String get_stream_name() const; - - virtual int get_loop_count() const; - - virtual float get_pos() const; - virtual void seek_pos(float p_time); - - virtual int get_channels() const { return stream_channels; } - virtual int get_mix_rate() const { return stream_rate; } - - virtual int get_minimum_buffer_size() const { return stream_min_size; } - virtual int mix(int16_t* p_bufer,int p_frames); - - virtual void set_loop_restart_time(float p_time) { } - - AudioStreamPlaybackMPC(); - ~AudioStreamPlaybackMPC(); -}; - -class AudioStreamMPC : public AudioStream { - - OBJ_TYPE( AudioStreamMPC, AudioStream ); - - String file; -public: - - Ref<AudioStreamPlayback> instance_playback() { - Ref<AudioStreamPlaybackMPC> pb = memnew( AudioStreamPlaybackMPC ); - pb->set_file(file); - return pb; - } - - void set_file(const String& p_file) { file=p_file; } - - -}; - -class ResourceFormatLoaderAudioStreamMPC : public ResourceFormatLoader { -public: - virtual RES load(const String &p_path,const String& p_original_path="",Error *r_error=NULL); - virtual void get_recognized_extensions(List<String> *p_extensions) const; - virtual bool handles_type(const String& p_type) const; - virtual String get_resource_type(const String &p_path) const; - -}; - -#endif // AUDIO_STREAM_MPC_H diff --git a/modules/mpc/config.py b/modules/mpc/config.py deleted file mode 100644 index fb920482f5..0000000000 --- a/modules/mpc/config.py +++ /dev/null @@ -1,7 +0,0 @@ - -def can_build(platform): - return True - - -def configure(env): - pass diff --git a/modules/mpc/register_types.cpp b/modules/mpc/register_types.cpp deleted file mode 100644 index f6a1f59dca..0000000000 --- a/modules/mpc/register_types.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/*************************************************************************/ -/* register_types.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "register_types.h" - -#include "audio_stream_mpc.h" - -static ResourceFormatLoaderAudioStreamMPC* mpc_stream_loader = NULL; - -void register_mpc_types() { - - mpc_stream_loader=memnew( ResourceFormatLoaderAudioStreamMPC ); - ResourceLoader::add_resource_format_loader(mpc_stream_loader); - ObjectTypeDB::register_type<AudioStreamMPC>(); -} - -void unregister_mpc_types() { - - memdelete( mpc_stream_loader ); -} diff --git a/modules/mpc/register_types.h b/modules/mpc/register_types.h deleted file mode 100644 index 3d0661ed62..0000000000 --- a/modules/mpc/register_types.h +++ /dev/null @@ -1,30 +0,0 @@ -/*************************************************************************/ -/* register_types.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -void register_mpc_types(); -void unregister_mpc_types(); diff --git a/modules/ogg/register_types.cpp b/modules/ogg/register_types.cpp index 823ca510ca..ed796ec092 100644 --- a/modules/ogg/register_types.cpp +++ b/modules/ogg/register_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/ogg/register_types.h b/modules/ogg/register_types.h index b5268a1df4..cc67b4d2f0 100644 --- a/modules/ogg/register_types.h +++ b/modules/ogg/register_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/openssl/register_types.cpp b/modules/openssl/register_types.cpp index 4aba9f530e..6cc9fa3669 100644 --- a/modules/openssl/register_types.cpp +++ b/modules/openssl/register_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,7 +32,7 @@ void register_openssl_types() { - ObjectTypeDB::register_type<StreamPeerOpenSSL>(); + ClassDB::register_class<StreamPeerOpenSSL>(); StreamPeerOpenSSL::initialize_ssl(); } diff --git a/modules/openssl/register_types.h b/modules/openssl/register_types.h index 2db140cc80..3bcee59bfd 100644 --- a/modules/openssl/register_types.h +++ b/modules/openssl/register_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/openssl/stream_peer_openssl.cpp b/modules/openssl/stream_peer_openssl.cpp index b9bec4ca0b..140ea1b9e7 100644 --- a/modules/openssl/stream_peer_openssl.cpp +++ b/modules/openssl/stream_peer_openssl.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -564,9 +564,9 @@ StreamPeerSSL* StreamPeerOpenSSL::_create_func() { Vector<X509*> StreamPeerOpenSSL::certs; -void StreamPeerOpenSSL::_load_certs(const ByteArray& p_array) { +void StreamPeerOpenSSL::_load_certs(const PoolByteArray& p_array) { - ByteArray::Read r = p_array.read(); + PoolByteArray::Read r = p_array.read(); BIO* mem = BIO_new(BIO_s_mem()); BIO_puts(mem,(const char*)r.ptr()); while(true) { @@ -590,19 +590,19 @@ void StreamPeerOpenSSL::initialize_ssl() { SSL_load_error_strings(); // Load SSL error strings ERR_load_BIO_strings(); // Load BIO error strings OpenSSL_add_all_algorithms(); // Load all available encryption algorithms - String certs_path =GLOBAL_DEF("ssl/certificates",""); - Globals::get_singleton()->set_custom_property_info("ssl/certificates",PropertyInfo(Variant::STRING,"ssl/certificates",PROPERTY_HINT_FILE,"*.crt")); + String certs_path =GLOBAL_DEF("network/ssl/certificates",""); + GlobalConfig::get_singleton()->set_custom_property_info("network/ssl/certificates",PropertyInfo(Variant::STRING,"network/ssl/certificates",PROPERTY_HINT_FILE,"*.crt")); if (certs_path!="") { FileAccess *f=FileAccess::open(certs_path,FileAccess::READ); if (f) { - ByteArray arr; + PoolByteArray arr; int flen = f->get_len(); arr.resize(flen+1); { - ByteArray::Write w = arr.write(); + PoolByteArray::Write w = arr.write(); f->get_buffer(w.ptr(),flen); w[flen]=0; //end f string } @@ -613,8 +613,8 @@ void StreamPeerOpenSSL::initialize_ssl() { print_line("Loaded certs from '"+certs_path+"': "+itos(certs.size())); } } - String config_path =GLOBAL_DEF("ssl/config",""); - Globals::get_singleton()->set_custom_property_info("ssl/config",PropertyInfo(Variant::STRING,"ssl/config",PROPERTY_HINT_FILE,"*.cnf")); + String config_path =GLOBAL_DEF("network/ssl/config",""); + GlobalConfig::get_singleton()->set_custom_property_info("network/ssl/config",PropertyInfo(Variant::STRING,"network/ssl/config",PROPERTY_HINT_FILE,"*.cnf")); if (config_path!="") { Vector<uint8_t> data = FileAccess::get_file_as_array(config_path); diff --git a/modules/openssl/stream_peer_openssl.h b/modules/openssl/stream_peer_openssl.h index 853ede2036..d79fb97ff8 100644 --- a/modules/openssl/stream_peer_openssl.h +++ b/modules/openssl/stream_peer_openssl.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -79,7 +79,7 @@ private: static Vector<X509*> certs; - static void _load_certs(const ByteArray& p_array); + static void _load_certs(const PoolByteArray& p_array); protected: static void _bind_methods(); public: diff --git a/modules/opus/audio_stream_opus.cpp b/modules/opus/audio_stream_opus.cpp index ab53fee0c9..f438dde689 100644 --- a/modules/opus/audio_stream_opus.cpp +++ b/modules/opus/audio_stream_opus.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Author: George Marques <george@gmarqu.es> */ /* */ diff --git a/modules/opus/audio_stream_opus.h b/modules/opus/audio_stream_opus.h index abf0b5c150..5093456ccd 100644 --- a/modules/opus/audio_stream_opus.h +++ b/modules/opus/audio_stream_opus.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Author: George Marques <george@gmarqu.es> */ /* */ @@ -40,7 +40,7 @@ class AudioStreamPlaybackOpus : public AudioStreamPlayback { - OBJ_TYPE(AudioStreamPlaybackOpus,AudioStreamPlayback) + GDCLASS(AudioStreamPlaybackOpus,AudioStreamPlayback) enum { MIN_MIX=1024 @@ -115,7 +115,7 @@ public: class AudioStreamOpus: public AudioStream { - OBJ_TYPE(AudioStreamOpus,AudioStream) + GDCLASS(AudioStreamOpus,AudioStream) String file; public: diff --git a/modules/opus/register_types.cpp b/modules/opus/register_types.cpp index a4d71a52c7..a177bc9463 100644 --- a/modules/opus/register_types.cpp +++ b/modules/opus/register_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ void register_opus_types() { opus_stream_loader = memnew( ResourceFormatLoaderAudioStreamOpus ); ResourceLoader::add_resource_format_loader(opus_stream_loader); - ObjectTypeDB::register_type<AudioStreamOpus>(); + ClassDB::register_class<AudioStreamOpus>(); } void unregister_opus_types() { diff --git a/modules/opus/register_types.h b/modules/opus/register_types.h index f4386c373a..09181b4f03 100644 --- a/modules/opus/register_types.h +++ b/modules/opus/register_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/pbm/bitmap_loader_pbm.cpp b/modules/pbm/bitmap_loader_pbm.cpp index 1d08b10824..6caaf10334 100644 --- a/modules/pbm/bitmap_loader_pbm.cpp +++ b/modules/pbm/bitmap_loader_pbm.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,11 +31,11 @@ #include "scene/resources/bit_mask.h" -static bool _get_token(FileAccessRef& f,uint8_t &saved,DVector<uint8_t>& r_token,bool p_binary=false,bool p_single_chunk=false) { +static bool _get_token(FileAccessRef& f,uint8_t &saved,PoolVector<uint8_t>& r_token,bool p_binary=false,bool p_single_chunk=false) { int token_max = r_token.size(); - DVector<uint8_t>::Write w; + PoolVector<uint8_t>::Write w; if (token_max) w=r_token.write(); int ofs=0; @@ -53,7 +53,7 @@ static bool _get_token(FileAccessRef& f,uint8_t &saved,DVector<uint8_t>& r_token } if (f->eof_reached()) { if (ofs) { - w=DVector<uint8_t>::Write(); + w=PoolVector<uint8_t>::Write(); r_token.resize(ofs); return true; } else { @@ -81,7 +81,7 @@ static bool _get_token(FileAccessRef& f,uint8_t &saved,DVector<uint8_t>& r_token if (ofs && !p_single_chunk) { - w=DVector<uint8_t>::Write(); + w=PoolVector<uint8_t>::Write(); r_token.resize(ofs); saved=b; @@ -98,7 +98,7 @@ static bool _get_token(FileAccessRef& f,uint8_t &saved,DVector<uint8_t>& r_token resized=true; } if (resized) { - w=DVector<uint8_t>::Write(); + w=PoolVector<uint8_t>::Write(); r_token.resize(token_max); w=r_token.write(); } @@ -109,10 +109,10 @@ static bool _get_token(FileAccessRef& f,uint8_t &saved,DVector<uint8_t>& r_token return false; } -static int _get_number_from_token(DVector<uint8_t>& r_token) { +static int _get_number_from_token(PoolVector<uint8_t>& r_token) { int len = r_token.size(); - DVector<uint8_t>::Read r = r_token.read(); + PoolVector<uint8_t>::Read r = r_token.read(); return String::to_int((const char*)r.ptr(),len); } @@ -133,7 +133,7 @@ RES ResourceFormatPBM::load(const String &p_path,const String& p_original_path,E if (!f) _RETURN(ERR_CANT_OPEN); - DVector<uint8_t> token; + PoolVector<uint8_t> token; if (!_get_token(f,saved,token)) { _RETURN(ERR_PARSE_ERROR); @@ -186,7 +186,7 @@ RES ResourceFormatPBM::load(const String &p_path,const String& p_original_path,E _RETURN(ERR_FILE_CORRUPT); } - DVector<uint8_t>::Read r=token.read(); + PoolVector<uint8_t>::Read r=token.read(); for(int i=0;i<height;i++) { for(int j=0;j<width;j++) { @@ -210,7 +210,7 @@ RES ResourceFormatPBM::load(const String &p_path,const String& p_original_path,E _RETURN(ERR_FILE_CORRUPT); } - DVector<uint8_t>::Read r=token.read(); + PoolVector<uint8_t>::Read r=token.read(); int bitwidth = width; if (bitwidth % 8) bitwidth+=8-(bitwidth%8); diff --git a/modules/pbm/bitmap_loader_pbm.h b/modules/pbm/bitmap_loader_pbm.h index 4f7144b3e0..b60b38fcca 100644 --- a/modules/pbm/bitmap_loader_pbm.h +++ b/modules/pbm/bitmap_loader_pbm.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/pbm/register_types.cpp b/modules/pbm/register_types.cpp index 181083773a..0dd39ce1e4 100644 --- a/modules/pbm/register_types.cpp +++ b/modules/pbm/register_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/pbm/register_types.h b/modules/pbm/register_types.h index 20c8133c2c..c9a125083d 100644 --- a/modules/pbm/register_types.h +++ b/modules/pbm/register_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/pvr/register_types.cpp b/modules/pvr/register_types.cpp index e5e18fb3d1..2464e78984 100644 --- a/modules/pvr/register_types.cpp +++ b/modules/pvr/register_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/pvr/register_types.h b/modules/pvr/register_types.h index d600f54d51..ac2ab748df 100644 --- a/modules/pvr/register_types.h +++ b/modules/pvr/register_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/pvr/texture_loader_pvr.cpp b/modules/pvr/texture_loader_pvr.cpp index 3ab3240512..9f8db98e05 100644 --- a/modules/pvr/texture_loader_pvr.cpp +++ b/modules/pvr/texture_loader_pvr.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -99,13 +99,13 @@ RES ResourceFormatPVR::load(const String &p_path,const String& p_original_path,E print_line("surfcount: "+itos(surfcount)); */ - DVector<uint8_t> data; + PoolVector<uint8_t> data; data.resize(surfsize); ERR_FAIL_COND_V(data.size()==0,RES()); - DVector<uint8_t>::Write w = data.write(); + PoolVector<uint8_t>::Write w = data.write(); f->get_buffer(&w[0],surfsize); err = f->get_error(); ERR_FAIL_COND_V(err!=OK,RES()); @@ -116,33 +116,33 @@ RES ResourceFormatPVR::load(const String &p_path,const String& p_original_path,E switch(flags&0xFF) { case 0x18: - case 0xC: format=(flags&PVR_HAS_ALPHA)?Image::FORMAT_PVRTC2_ALPHA:Image::FORMAT_PVRTC2; break; + case 0xC: format=(flags&PVR_HAS_ALPHA)?Image::FORMAT_PVRTC2A:Image::FORMAT_PVRTC2; break; case 0x19: - case 0xD: format=(flags&PVR_HAS_ALPHA)?Image::FORMAT_PVRTC4_ALPHA:Image::FORMAT_PVRTC4; break; + case 0xD: format=(flags&PVR_HAS_ALPHA)?Image::FORMAT_PVRTC4A:Image::FORMAT_PVRTC4; break; case 0x16: - format=Image::FORMAT_GRAYSCALE; break; + format=Image::FORMAT_L8; break; case 0x17: - format=Image::FORMAT_GRAYSCALE_ALPHA; break; + format=Image::FORMAT_LA8; break; case 0x20: case 0x80: case 0x81: - format=Image::FORMAT_BC1; break; + format=Image::FORMAT_DXT1; break; case 0x21: case 0x22: case 0x82: case 0x83: - format=Image::FORMAT_BC2; break; + format=Image::FORMAT_DXT3; break; case 0x23: case 0x24: case 0x84: case 0x85: - format=Image::FORMAT_BC3; break; + format=Image::FORMAT_DXT5; break; case 0x4: case 0x15: - format=Image::FORMAT_RGB; break; + format=Image::FORMAT_RGB8; break; case 0x5: case 0x12: - format=Image::FORMAT_RGBA; break; + format=Image::FORMAT_RGBA8; break; case 0x36: format=Image::FORMAT_ETC; break; default: @@ -151,7 +151,7 @@ RES ResourceFormatPVR::load(const String &p_path,const String& p_original_path,E } - w = DVector<uint8_t>::Write(); + w = PoolVector<uint8_t>::Write(); int tex_flags=Texture::FLAG_FILTER|Texture::FLAG_REPEAT; @@ -180,7 +180,7 @@ void ResourceFormatPVR::get_recognized_extensions(List<String> *p_extensions) co } bool ResourceFormatPVR::handles_type(const String& p_type) const { - return ObjectTypeDB::is_type(p_type,"Texture"); + return ClassDB::is_parent_class(p_type,"Texture"); } String ResourceFormatPVR::get_resource_type(const String &p_path) const { @@ -198,24 +198,24 @@ static void _compress_pvrtc4(Image * p_img) { bool make_mipmaps=false; if (img.get_width()%8 || img.get_height()%8) { - make_mipmaps=img.get_mipmaps()>0; + make_mipmaps=img.has_mipmaps(); img.resize(img.get_width()+(8-(img.get_width()%8)),img.get_height()+(8-(img.get_height()%8))); } - img.convert(Image::FORMAT_RGBA); - if (img.get_mipmaps()==0 && make_mipmaps) + img.convert(Image::FORMAT_RGBA8); + if (!img.has_mipmaps() && make_mipmaps) img.generate_mipmaps(); bool use_alpha=img.detect_alpha(); Image new_img; - new_img.create(img.get_width(),img.get_height(),true,use_alpha?Image::FORMAT_PVRTC4_ALPHA:Image::FORMAT_PVRTC4); - DVector<uint8_t> data=new_img.get_data(); + new_img.create(img.get_width(),img.get_height(),true,use_alpha?Image::FORMAT_PVRTC4A:Image::FORMAT_PVRTC4); + PoolVector<uint8_t> data=new_img.get_data(); { - DVector<uint8_t>::Write wr=data.write(); - DVector<uint8_t>::Read r=img.get_data().read(); + PoolVector<uint8_t>::Write wr=data.write(); + PoolVector<uint8_t>::Read r=img.get_data().read(); - for(int i=0;i<=new_img.get_mipmaps();i++) { + for(int i=0;i<=new_img.get_mipmap_count();i++) { int ofs,size,w,h; img.get_mipmap_offset_size_and_dimensions(i,ofs,size,w,h); @@ -234,7 +234,7 @@ static void _compress_pvrtc4(Image * p_img) { } - *p_img = Image(new_img.get_width(),new_img.get_height(),new_img.get_mipmaps(),new_img.get_format(),data); + *p_img = Image(new_img.get_width(),new_img.get_height(),new_img.has_mipmaps(),new_img.get_format(),data); } @@ -673,17 +673,17 @@ static void _pvrtc_decompress(Image* p_img) { // decompress_pvrtc((PVRTCBlock*)p_comp_img,p_2bit,p_width,p_height,1,p_dst); // } - ERR_FAIL_COND( p_img->get_format()!=Image::FORMAT_PVRTC2 && p_img->get_format()!=Image::FORMAT_PVRTC2_ALPHA && p_img->get_format()!=Image::FORMAT_PVRTC4 && p_img->get_format()!=Image::FORMAT_PVRTC4_ALPHA); + ERR_FAIL_COND( p_img->get_format()!=Image::FORMAT_PVRTC2 && p_img->get_format()!=Image::FORMAT_PVRTC2A && p_img->get_format()!=Image::FORMAT_PVRTC4 && p_img->get_format()!=Image::FORMAT_PVRTC4A); - bool _2bit = (p_img->get_format()==Image::FORMAT_PVRTC2 || p_img->get_format()==Image::FORMAT_PVRTC2_ALPHA ); + bool _2bit = (p_img->get_format()==Image::FORMAT_PVRTC2 || p_img->get_format()==Image::FORMAT_PVRTC2A ); - DVector<uint8_t> data = p_img->get_data(); - DVector<uint8_t>::Read r = data.read(); + PoolVector<uint8_t> data = p_img->get_data(); + PoolVector<uint8_t>::Read r = data.read(); - DVector<uint8_t> newdata; + PoolVector<uint8_t> newdata; newdata.resize( p_img->get_width() * p_img->get_height() * 4); - DVector<uint8_t>::Write w=newdata.write(); + PoolVector<uint8_t>::Write w=newdata.write(); decompress_pvrtc((PVRTCBlock*)r.ptr(),_2bit,p_img->get_width(),p_img->get_height(),0,(unsigned char*)w.ptr()); @@ -691,11 +691,11 @@ static void _pvrtc_decompress(Image* p_img) { // print_line(itos(w[i])); //} - w=DVector<uint8_t>::Write(); - r=DVector<uint8_t>::Read(); + w=PoolVector<uint8_t>::Write(); + r=PoolVector<uint8_t>::Read(); - bool make_mipmaps=p_img->get_mipmaps()>0; - Image newimg(p_img->get_width(),p_img->get_height(),0,Image::FORMAT_RGBA,newdata); + bool make_mipmaps=p_img->has_mipmaps(); + Image newimg(p_img->get_width(),p_img->get_height(),false,Image::FORMAT_RGBA8,newdata); if (make_mipmaps) newimg.generate_mipmaps(); *p_img=newimg; diff --git a/modules/pvr/texture_loader_pvr.h b/modules/pvr/texture_loader_pvr.h index 5efb3b2507..bad48b4569 100644 --- a/modules/pvr/texture_loader_pvr.h +++ b/modules/pvr/texture_loader_pvr.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/regex/regex.cpp b/modules/regex/regex.cpp index 0197da46fb..e67040b5a3 100644 --- a/modules/regex/regex.cpp +++ b/modules/regex/regex.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -1481,26 +1481,26 @@ RegEx::~RegEx() { void RegExMatch::_bind_methods() { - ObjectTypeDB::bind_method(_MD("expand","template"),&RegExMatch::expand); - ObjectTypeDB::bind_method(_MD("get_group_count"),&RegExMatch::get_group_count); - ObjectTypeDB::bind_method(_MD("get_group_array"),&RegExMatch::get_group_array); - ObjectTypeDB::bind_method(_MD("get_names"),&RegExMatch::get_names); - ObjectTypeDB::bind_method(_MD("get_name_dict"),&RegExMatch::get_name_dict); - ObjectTypeDB::bind_method(_MD("get_string","name"),&RegExMatch::get_string, DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("get_start","name"),&RegExMatch::get_start, DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("get_end","name"),&RegExMatch::get_end, DEFVAL(0)); + ClassDB::bind_method(_MD("expand","template"),&RegExMatch::expand); + ClassDB::bind_method(_MD("get_group_count"),&RegExMatch::get_group_count); + ClassDB::bind_method(_MD("get_group_array"),&RegExMatch::get_group_array); + ClassDB::bind_method(_MD("get_names"),&RegExMatch::get_names); + ClassDB::bind_method(_MD("get_name_dict"),&RegExMatch::get_name_dict); + ClassDB::bind_method(_MD("get_string","name"),&RegExMatch::get_string, DEFVAL(0)); + ClassDB::bind_method(_MD("get_start","name"),&RegExMatch::get_start, DEFVAL(0)); + ClassDB::bind_method(_MD("get_end","name"),&RegExMatch::get_end, DEFVAL(0)); } void RegEx::_bind_methods() { - ObjectTypeDB::bind_method(_MD("clear"),&RegEx::clear); - ObjectTypeDB::bind_method(_MD("compile","pattern"),&RegEx::compile); - ObjectTypeDB::bind_method(_MD("search","text","start","end"),&RegEx::search, DEFVAL(0), DEFVAL(-1)); - ObjectTypeDB::bind_method(_MD("sub","text","replacement","all","start","end"),&RegEx::sub, DEFVAL(false), DEFVAL(0), DEFVAL(-1)); - ObjectTypeDB::bind_method(_MD("is_valid"),&RegEx::is_valid); - ObjectTypeDB::bind_method(_MD("get_pattern"),&RegEx::get_pattern); - ObjectTypeDB::bind_method(_MD("get_group_count"),&RegEx::get_group_count); - ObjectTypeDB::bind_method(_MD("get_names"),&RegEx::get_names); + ClassDB::bind_method(_MD("clear"),&RegEx::clear); + ClassDB::bind_method(_MD("compile","pattern"),&RegEx::compile); + ClassDB::bind_method(_MD("search","text","start","end"),&RegEx::search, DEFVAL(0), DEFVAL(-1)); + ClassDB::bind_method(_MD("sub","text","replacement","all","start","end"),&RegEx::sub, DEFVAL(false), DEFVAL(0), DEFVAL(-1)); + ClassDB::bind_method(_MD("is_valid"),&RegEx::is_valid); + ClassDB::bind_method(_MD("get_pattern"),&RegEx::get_pattern); + ClassDB::bind_method(_MD("get_group_count"),&RegEx::get_group_count); + ClassDB::bind_method(_MD("get_names"),&RegEx::get_names); ADD_PROPERTY(PropertyInfo(Variant::STRING, "pattern"), _SCS("compile"), _SCS("get_pattern")); } diff --git a/modules/regex/regex.h b/modules/regex/regex.h index 803aa72b3f..193d818da3 100644 --- a/modules/regex/regex.h +++ b/modules/regex/regex.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -40,7 +40,7 @@ class RegExNode; class RegExMatch : public Reference { - OBJ_TYPE(RegExMatch, Reference); + GDCLASS(RegExMatch, Reference); struct Group { Variant name; @@ -80,7 +80,7 @@ public: class RegEx : public Resource { - OBJ_TYPE(RegEx, Resource); + GDCLASS(RegEx, Resource); RegExNode* root; Vector<Variant> group_names; diff --git a/modules/regex/register_types.cpp b/modules/regex/register_types.cpp index 050cf3efff..d44c7e563c 100644 --- a/modules/regex/register_types.cpp +++ b/modules/regex/register_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,8 +33,8 @@ void register_regex_types() { - ObjectTypeDB::register_type<RegExMatch>(); - ObjectTypeDB::register_type<RegEx>(); + ClassDB::register_class<RegExMatch>(); + ClassDB::register_class<RegEx>(); } void unregister_regex_types() { diff --git a/modules/regex/register_types.h b/modules/regex/register_types.h index df3b508e14..5d676b6daa 100644 --- a/modules/regex/register_types.h +++ b/modules/regex/register_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/register_module_types.h b/modules/register_module_types.h index 683ce7c6b8..7d9a130ea1 100644 --- a/modules/register_module_types.h +++ b/modules/register_module_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/squish/image_compress_squish.cpp b/modules/squish/image_compress_squish.cpp index ac7c935ceb..7410658603 100644 --- a/modules/squish/image_compress_squish.cpp +++ b/modules/squish/image_compress_squish.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ void image_compress_squish(Image *p_image) { int w=p_image->get_width(); int h=p_image->get_height(); - if (p_image->get_mipmaps() == 0) { + if (!p_image->has_mipmaps() ) { ERR_FAIL_COND( !w || w % 4 != 0); ERR_FAIL_COND( !h || h % 4 != 0); } else { @@ -45,33 +45,33 @@ void image_compress_squish(Image *p_image) { ERR_FAIL_COND( !h || h !=nearest_power_of_2(h) ); }; - if (p_image->get_format()>=Image::FORMAT_BC1) + if (p_image->get_format()>=Image::FORMAT_DXT1) return; //do not compress, already compressed int shift=0; int squish_comp=squish::kColourRangeFit; Image::Format target_format; - if (p_image->get_format()==Image::FORMAT_GRAYSCALE_ALPHA) { + if (p_image->get_format()==Image::FORMAT_LA8) { //compressed normalmap - target_format = Image::FORMAT_BC3; squish_comp|=squish::kDxt5;; + target_format = Image::FORMAT_DXT5; squish_comp|=squish::kDxt5;; } else if (p_image->detect_alpha()!=Image::ALPHA_NONE) { - target_format = Image::FORMAT_BC2; squish_comp|=squish::kDxt3;; + target_format = Image::FORMAT_DXT3; squish_comp|=squish::kDxt3;; } else { - target_format = Image::FORMAT_BC1; shift=1; squish_comp|=squish::kDxt1;; + target_format = Image::FORMAT_DXT1; shift=1; squish_comp|=squish::kDxt1;; } - p_image->convert(Image::FORMAT_RGBA); //always expects rgba + p_image->convert(Image::FORMAT_RGBA8); //always expects rgba - int mm_count = p_image->get_mipmaps(); + int mm_count = p_image->get_mipmap_count(); - DVector<uint8_t> data; + PoolVector<uint8_t> data; int target_size = Image::get_image_data_size(w,h,target_format,mm_count); data.resize(target_size); - DVector<uint8_t>::Read rb = p_image->get_data().read(); - DVector<uint8_t>::Write wb = data.write(); + PoolVector<uint8_t>::Read rb = p_image->get_data().read(); + PoolVector<uint8_t>::Write wb = data.write(); int dst_ofs=0; @@ -84,9 +84,9 @@ void image_compress_squish(Image *p_image) { h>>=1; } - rb = DVector<uint8_t>::Read(); - wb = DVector<uint8_t>::Write(); + rb = PoolVector<uint8_t>::Read(); + wb = PoolVector<uint8_t>::Write(); - p_image->create(p_image->get_width(),p_image->get_height(),p_image->get_mipmaps(),target_format,data); + p_image->create(p_image->get_width(),p_image->get_height(),p_image->has_mipmaps(),target_format,data); } diff --git a/modules/squish/image_compress_squish.h b/modules/squish/image_compress_squish.h index 19dd900674..198889402a 100644 --- a/modules/squish/image_compress_squish.h +++ b/modules/squish/image_compress_squish.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/squish/register_types.cpp b/modules/squish/register_types.cpp index 9e9621eb64..995711c758 100644 --- a/modules/squish/register_types.cpp +++ b/modules/squish/register_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/squish/register_types.h b/modules/squish/register_types.h index bbde6a44bf..0db4301997 100644 --- a/modules/squish/register_types.h +++ b/modules/squish/register_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/theora/register_types.cpp b/modules/theora/register_types.cpp index 282b59b0ec..58f63465c9 100644 --- a/modules/theora/register_types.cpp +++ b/modules/theora/register_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ void register_theora_types() { theora_stream_loader = memnew( ResourceFormatLoaderVideoStreamTheora ); ResourceLoader::add_resource_format_loader(theora_stream_loader); - ObjectTypeDB::register_type<VideoStreamTheora>(); + ClassDB::register_class<VideoStreamTheora>(); } void unregister_theora_types() { diff --git a/modules/theora/register_types.h b/modules/theora/register_types.h index 18bdbf0c4c..582aa785c7 100644 --- a/modules/theora/register_types.h +++ b/modules/theora/register_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/theora/video_stream_theora.cpp b/modules/theora/video_stream_theora.cpp index 3ddfee3a1d..b847f17bb7 100644 --- a/modules/theora/video_stream_theora.cpp +++ b/modules/theora/video_stream_theora.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -88,7 +88,7 @@ void VideoStreamPlaybackTheora::video_write(void){ { int pixels = size.x * size.y; frame_data.resize(pixels * 4); - DVector<uint8_t>::Write w = frame_data.write(); + PoolVector<uint8_t>::Write w = frame_data.write(); char* dst = (char*)w.ptr(); int p = 0; for (int i=0; i<size.y; i++) { @@ -103,7 +103,7 @@ void VideoStreamPlaybackTheora::video_write(void){ dst[p++] = 255; }; } - format = Image::FORMAT_RGBA; + format = Image::FORMAT_RGBA8; } // */ @@ -112,7 +112,7 @@ void VideoStreamPlaybackTheora::video_write(void){ int pitch = 4; frame_data.resize(size.x * size.y * pitch); { - DVector<uint8_t>::Write w = frame_data.write(); + PoolVector<uint8_t>::Write w = frame_data.write(); char* dst = (char*)w.ptr(); //uv_offset=(ti.pic_x/2)+(yuv[1].stride)*(ti.pic_y/2); @@ -130,10 +130,10 @@ void VideoStreamPlaybackTheora::video_write(void){ yuv420_2_rgb8888((uint8_t*)dst, (uint8_t*)yuv[0].data, (uint8_t*)yuv[2].data, (uint8_t*)yuv[1].data, size.x, size.y, yuv[0].stride, yuv[1].stride, size.x<<2, 0); }; - format = Image::FORMAT_RGBA; + format = Image::FORMAT_RGBA8; } - Image img(size.x,size.y,0,Image::FORMAT_RGBA,frame_data); //zero copy image creation + Image img(size.x,size.y,0,Image::FORMAT_RGBA8,frame_data); //zero copy image creation texture->set_data(img); //zero copy send to visual server @@ -143,7 +143,7 @@ void VideoStreamPlaybackTheora::video_write(void){ int pitch = 3; frame_data.resize(size.x * size.y * pitch); - DVector<uint8_t>::Write w = frame_data.write(); + PoolVector<uint8_t>::Write w = frame_data.write(); char* dst = (char*)w.ptr(); for(int i=0;i<size.y;i++) { @@ -174,7 +174,7 @@ void VideoStreamPlaybackTheora::video_write(void){ int pitch = 4; frame_data.resize(size.x * size.y * pitch); - DVector<uint8_t>::Write w = frame_data.write(); + PoolVector<uint8_t>::Write w = frame_data.write(); char* dst = (char*)w.ptr(); uv_offset=(ti.pic_x/2)+(yuv[1].stride)*(ti.pic_y / div); @@ -202,13 +202,13 @@ void VideoStreamPlaybackTheora::video_write(void){ } } - format = Image::FORMAT_RGBA; + format = Image::FORMAT_RGBA8; } else { int pitch = 2; frame_data.resize(size.x * size.y * pitch); - DVector<uint8_t>::Write w = frame_data.write(); + PoolVector<uint8_t>::Write w = frame_data.write(); char* dst = (char*)w.ptr(); uv_offset=(ti.pic_x/2)+(yuv[1].stride)*(ti.pic_y / div); @@ -470,7 +470,7 @@ void VideoStreamPlaybackTheora::set_file(const String& p_file) { size.x = w; size.y = h; - texture->create(w,h,Image::FORMAT_RGBA,Texture::FLAG_FILTER|Texture::FLAG_VIDEO_SURFACE); + texture->create(w,h,Image::FORMAT_RGBA8,Texture::FLAG_FILTER|Texture::FLAG_VIDEO_SURFACE); }else{ /* tear down the partial theora setup */ @@ -747,7 +747,7 @@ void VideoStreamPlaybackTheora::play() { } playing = true; - delay_compensation=Globals::get_singleton()->get("audio/video_delay_compensation_ms"); + delay_compensation=GlobalConfig::get_singleton()->get("audio/video_delay_compensation_ms"); delay_compensation/=1000.0; diff --git a/modules/theora/video_stream_theora.h b/modules/theora/video_stream_theora.h index 04a5c56ee5..0e1f5fa864 100644 --- a/modules/theora/video_stream_theora.h +++ b/modules/theora/video_stream_theora.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -43,7 +43,7 @@ class VideoStreamPlaybackTheora : public VideoStreamPlayback { - OBJ_TYPE(VideoStreamPlaybackTheora, VideoStreamPlayback); + GDCLASS(VideoStreamPlaybackTheora, VideoStreamPlayback); enum { MAX_FRAMES = 4, @@ -51,7 +51,7 @@ class VideoStreamPlaybackTheora : public VideoStreamPlayback { //Image frames[MAX_FRAMES]; Image::Format format; - DVector<uint8_t> frame_data; + PoolVector<uint8_t> frame_data; int frames_pending; FileAccess* file; String file_name; @@ -165,7 +165,7 @@ public: class VideoStreamTheora : public VideoStream { - OBJ_TYPE(VideoStreamTheora,VideoStream); + GDCLASS(VideoStreamTheora,VideoStream); String file; int audio_track; diff --git a/modules/visual_script/register_types.cpp b/modules/visual_script/register_types.cpp index ad54149b51..79bf3d50b2 100644 --- a/modules/visual_script/register_types.cpp +++ b/modules/visual_script/register_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -48,58 +48,58 @@ void register_visual_script_types() { //script_language_gd->init(); ScriptServer::register_language(visual_script_language); - ObjectTypeDB::register_type<VisualScript>(); - ObjectTypeDB::register_virtual_type<VisualScriptNode>(); - ObjectTypeDB::register_virtual_type<VisualScriptFunctionState>(); - ObjectTypeDB::register_type<VisualScriptFunction>(); - ObjectTypeDB::register_type<VisualScriptOperator>(); - ObjectTypeDB::register_type<VisualScriptVariableSet>(); - ObjectTypeDB::register_type<VisualScriptVariableGet>(); - ObjectTypeDB::register_type<VisualScriptConstant>(); - ObjectTypeDB::register_type<VisualScriptIndexGet>(); - ObjectTypeDB::register_type<VisualScriptIndexSet>(); - ObjectTypeDB::register_type<VisualScriptGlobalConstant>(); - ObjectTypeDB::register_type<VisualScriptClassConstant>(); - ObjectTypeDB::register_type<VisualScriptMathConstant>(); - ObjectTypeDB::register_type<VisualScriptBasicTypeConstant>(); - ObjectTypeDB::register_type<VisualScriptEngineSingleton>(); - ObjectTypeDB::register_type<VisualScriptSceneNode>(); - ObjectTypeDB::register_type<VisualScriptSceneTree>(); - ObjectTypeDB::register_type<VisualScriptResourcePath>(); - ObjectTypeDB::register_type<VisualScriptSelf>(); - ObjectTypeDB::register_type<VisualScriptCustomNode>(); - ObjectTypeDB::register_type<VisualScriptSubCall>(); - ObjectTypeDB::register_type<VisualScriptComment>(); - ObjectTypeDB::register_type<VisualScriptConstructor>(); - ObjectTypeDB::register_type<VisualScriptLocalVar>(); - ObjectTypeDB::register_type<VisualScriptLocalVarSet>(); - ObjectTypeDB::register_type<VisualScriptInputAction>(); - ObjectTypeDB::register_type<VisualScriptDeconstruct>(); - ObjectTypeDB::register_type<VisualScriptPreload>(); - ObjectTypeDB::register_type<VisualScriptTypeCast>(); - - - ObjectTypeDB::register_type<VisualScriptFunctionCall>(); - ObjectTypeDB::register_type<VisualScriptPropertySet>(); - ObjectTypeDB::register_type<VisualScriptPropertyGet>(); -// ObjectTypeDB::register_type<VisualScriptScriptCall>(); - ObjectTypeDB::register_type<VisualScriptEmitSignal>(); - - ObjectTypeDB::register_type<VisualScriptReturn>(); - ObjectTypeDB::register_type<VisualScriptCondition>(); - ObjectTypeDB::register_type<VisualScriptWhile>(); - ObjectTypeDB::register_type<VisualScriptIterator>(); - ObjectTypeDB::register_type<VisualScriptSequence>(); - ObjectTypeDB::register_type<VisualScriptInputFilter>(); - ObjectTypeDB::register_type<VisualScriptSwitch >(); - - ObjectTypeDB::register_type<VisualScriptYield>(); - ObjectTypeDB::register_type<VisualScriptYieldSignal>(); - - ObjectTypeDB::register_type<VisualScriptBuiltinFunc>(); - - - ObjectTypeDB::register_type<VisualScriptExpression>(); + ClassDB::register_class<VisualScript>(); + ClassDB::register_virtual_class<VisualScriptNode>(); + ClassDB::register_virtual_class<VisualScriptFunctionState>(); + ClassDB::register_class<VisualScriptFunction>(); + ClassDB::register_class<VisualScriptOperator>(); + ClassDB::register_class<VisualScriptVariableSet>(); + ClassDB::register_class<VisualScriptVariableGet>(); + ClassDB::register_class<VisualScriptConstant>(); + ClassDB::register_class<VisualScriptIndexGet>(); + ClassDB::register_class<VisualScriptIndexSet>(); + ClassDB::register_class<VisualScriptGlobalConstant>(); + ClassDB::register_class<VisualScriptClassConstant>(); + ClassDB::register_class<VisualScriptMathConstant>(); + ClassDB::register_class<VisualScriptBasicTypeConstant>(); + ClassDB::register_class<VisualScriptEngineSingleton>(); + ClassDB::register_class<VisualScriptSceneNode>(); + ClassDB::register_class<VisualScriptSceneTree>(); + ClassDB::register_class<VisualScriptResourcePath>(); + ClassDB::register_class<VisualScriptSelf>(); + ClassDB::register_class<VisualScriptCustomNode>(); + ClassDB::register_class<VisualScriptSubCall>(); + ClassDB::register_class<VisualScriptComment>(); + ClassDB::register_class<VisualScriptConstructor>(); + ClassDB::register_class<VisualScriptLocalVar>(); + ClassDB::register_class<VisualScriptLocalVarSet>(); + ClassDB::register_class<VisualScriptInputAction>(); + ClassDB::register_class<VisualScriptDeconstruct>(); + ClassDB::register_class<VisualScriptPreload>(); + ClassDB::register_class<VisualScriptTypeCast>(); + + + ClassDB::register_class<VisualScriptFunctionCall>(); + ClassDB::register_class<VisualScriptPropertySet>(); + ClassDB::register_class<VisualScriptPropertyGet>(); +// ClassDB::register_type<VisualScriptScriptCall>(); + ClassDB::register_class<VisualScriptEmitSignal>(); + + ClassDB::register_class<VisualScriptReturn>(); + ClassDB::register_class<VisualScriptCondition>(); + ClassDB::register_class<VisualScriptWhile>(); + ClassDB::register_class<VisualScriptIterator>(); + ClassDB::register_class<VisualScriptSequence>(); + ClassDB::register_class<VisualScriptInputFilter>(); + ClassDB::register_class<VisualScriptSwitch >(); + + ClassDB::register_class<VisualScriptYield>(); + ClassDB::register_class<VisualScriptYieldSignal>(); + + ClassDB::register_class<VisualScriptBuiltinFunc>(); + + + ClassDB::register_class<VisualScriptExpression>(); register_visual_script_nodes(); register_visual_script_func_nodes(); diff --git a/modules/visual_script/register_types.h b/modules/visual_script/register_types.h index 0a5805eb0b..f6904420bd 100644 --- a/modules/visual_script/register_types.h +++ b/modules/visual_script/register_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index bd042c8989..08796b3868 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -104,11 +104,11 @@ Array VisualScriptNode::_get_default_input_values() const { void VisualScriptNode::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_visual_script:VisualScript"),&VisualScriptNode::get_visual_script); - ObjectTypeDB::bind_method(_MD("set_default_input_value","port_idx","value:Variant"),&VisualScriptNode::set_default_input_value); - ObjectTypeDB::bind_method(_MD("get_default_input_value:Variant","port_idx"),&VisualScriptNode::get_default_input_value); - ObjectTypeDB::bind_method(_MD("_set_default_input_values","values"),&VisualScriptNode::_set_default_input_values); - ObjectTypeDB::bind_method(_MD("_get_default_input_values"),&VisualScriptNode::_get_default_input_values); + ClassDB::bind_method(_MD("get_visual_script:VisualScript"),&VisualScriptNode::get_visual_script); + ClassDB::bind_method(_MD("set_default_input_value","port_idx","value:Variant"),&VisualScriptNode::set_default_input_value); + ClassDB::bind_method(_MD("get_default_input_value:Variant","port_idx"),&VisualScriptNode::get_default_input_value); + ClassDB::bind_method(_MD("_set_default_input_values","values"),&VisualScriptNode::_set_default_input_values); + ClassDB::bind_method(_MD("_get_default_input_values"),&VisualScriptNode::_get_default_input_values); ADD_PROPERTY(PropertyInfo(Variant::ARRAY,"_default_input_values",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_default_input_values"),_SCS("_get_default_input_values")); ADD_SIGNAL(MethodInfo("ports_changed")); @@ -122,7 +122,7 @@ VisualScriptNode::TypeGuess VisualScriptNode::guess_output_type(TypeGuess* p_inp tg.type=pinfo.type; if (pinfo.hint==PROPERTY_HINT_RESOURCE_TYPE) { - tg.obj_type=pinfo.hint_string; + tg.GDCLASS=pinfo.hint_string; } return tg; @@ -1317,63 +1317,63 @@ void VisualScript::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_node_ports_changed"),&VisualScript::_node_ports_changed); - - ObjectTypeDB::bind_method(_MD("add_function","name"),&VisualScript::add_function); - ObjectTypeDB::bind_method(_MD("has_function","name"),&VisualScript::has_function); - ObjectTypeDB::bind_method(_MD("remove_function","name"),&VisualScript::remove_function); - ObjectTypeDB::bind_method(_MD("rename_function","name","new_name"),&VisualScript::rename_function); - ObjectTypeDB::bind_method(_MD("set_function_scroll","ofs"),&VisualScript::set_function_scroll); - ObjectTypeDB::bind_method(_MD("get_function_scroll"),&VisualScript::get_function_scroll); - - ObjectTypeDB::bind_method(_MD("add_node","func","id","node","pos"),&VisualScript::add_node,DEFVAL(Point2())); - ObjectTypeDB::bind_method(_MD("remove_node","func","id"),&VisualScript::remove_node); - ObjectTypeDB::bind_method(_MD("get_function_node_id","name"),&VisualScript::get_function_node_id); - - ObjectTypeDB::bind_method(_MD("get_node","func","id"),&VisualScript::get_node); - ObjectTypeDB::bind_method(_MD("has_node","func","id"),&VisualScript::has_node); - ObjectTypeDB::bind_method(_MD("set_node_pos","func","id","pos"),&VisualScript::set_node_pos); - ObjectTypeDB::bind_method(_MD("get_node_pos","func","id"),&VisualScript::get_node_pos); - - ObjectTypeDB::bind_method(_MD("sequence_connect","func","from_node","from_output","to_node"),&VisualScript::sequence_connect); - ObjectTypeDB::bind_method(_MD("sequence_disconnect","func","from_node","from_output","to_node"),&VisualScript::sequence_disconnect); - ObjectTypeDB::bind_method(_MD("has_sequence_connection","func","from_node","from_output","to_node"),&VisualScript::has_sequence_connection); - - ObjectTypeDB::bind_method(_MD("data_connect","func","from_node","from_port","to_node","to_port"),&VisualScript::data_connect); - ObjectTypeDB::bind_method(_MD("data_disconnect","func","from_node","from_port","to_node","to_port"),&VisualScript::data_disconnect); - ObjectTypeDB::bind_method(_MD("has_data_connection","func","from_node","from_port","to_node","to_port"),&VisualScript::has_data_connection); - - ObjectTypeDB::bind_method(_MD("add_variable","name","default_value","export"),&VisualScript::add_variable,DEFVAL(Variant()),DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("has_variable","name"),&VisualScript::has_variable); - ObjectTypeDB::bind_method(_MD("remove_variable","name"),&VisualScript::remove_variable); - ObjectTypeDB::bind_method(_MD("set_variable_default_value","name","value"),&VisualScript::set_variable_default_value); - ObjectTypeDB::bind_method(_MD("get_variable_default_value","name"),&VisualScript::get_variable_default_value); - ObjectTypeDB::bind_method(_MD("set_variable_info","name","value"),&VisualScript::_set_variable_info); - ObjectTypeDB::bind_method(_MD("get_variable_info","name"),&VisualScript::_get_variable_info); - ObjectTypeDB::bind_method(_MD("set_variable_export","name","enable"),&VisualScript::set_variable_export); - ObjectTypeDB::bind_method(_MD("get_variable_export","name"),&VisualScript::get_variable_export); - ObjectTypeDB::bind_method(_MD("rename_variable","name","new_name"),&VisualScript::rename_variable); - - ObjectTypeDB::bind_method(_MD("add_custom_signal","name"),&VisualScript::add_custom_signal); - ObjectTypeDB::bind_method(_MD("has_custom_signal","name"),&VisualScript::has_custom_signal); - ObjectTypeDB::bind_method(_MD("custom_signal_add_argument","name","type","argname","index"),&VisualScript::custom_signal_add_argument,DEFVAL(-1)); - ObjectTypeDB::bind_method(_MD("custom_signal_set_argument_type","name","argidx","type"),&VisualScript::custom_signal_set_argument_type); - ObjectTypeDB::bind_method(_MD("custom_signal_get_argument_type","name","argidx"),&VisualScript::custom_signal_get_argument_type); - ObjectTypeDB::bind_method(_MD("custom_signal_set_argument_name","name","argidx","argname"),&VisualScript::custom_signal_set_argument_name); - ObjectTypeDB::bind_method(_MD("custom_signal_get_argument_name","name","argidx"),&VisualScript::custom_signal_get_argument_name); - ObjectTypeDB::bind_method(_MD("custom_signal_remove_argument","argidx"),&VisualScript::custom_signal_remove_argument); - ObjectTypeDB::bind_method(_MD("custom_signal_get_argument_count","name"),&VisualScript::custom_signal_get_argument_count); - ObjectTypeDB::bind_method(_MD("custom_signal_swap_argument","name","argidx","withidx"),&VisualScript::custom_signal_swap_argument); - ObjectTypeDB::bind_method(_MD("remove_custom_signal","name"),&VisualScript::remove_custom_signal); - ObjectTypeDB::bind_method(_MD("rename_custom_signal","name","new_name"),&VisualScript::rename_custom_signal); - - //ObjectTypeDB::bind_method(_MD("set_variable_info","name","info"),&VScript::set_variable_info); - //ObjectTypeDB::bind_method(_MD("get_variable_info","name"),&VScript::set_variable_info); - - ObjectTypeDB::bind_method(_MD("set_instance_base_type","type"),&VisualScript::set_instance_base_type); - - ObjectTypeDB::bind_method(_MD("_set_data","data"),&VisualScript::_set_data); - ObjectTypeDB::bind_method(_MD("_get_data"),&VisualScript::_get_data); + ClassDB::bind_method(_MD("_node_ports_changed"),&VisualScript::_node_ports_changed); + + ClassDB::bind_method(_MD("add_function","name"),&VisualScript::add_function); + ClassDB::bind_method(_MD("has_function","name"),&VisualScript::has_function); + ClassDB::bind_method(_MD("remove_function","name"),&VisualScript::remove_function); + ClassDB::bind_method(_MD("rename_function","name","new_name"),&VisualScript::rename_function); + ClassDB::bind_method(_MD("set_function_scroll","ofs"),&VisualScript::set_function_scroll); + ClassDB::bind_method(_MD("get_function_scroll"),&VisualScript::get_function_scroll); + + ClassDB::bind_method(_MD("add_node","func","id","node","pos"),&VisualScript::add_node,DEFVAL(Point2())); + ClassDB::bind_method(_MD("remove_node","func","id"),&VisualScript::remove_node); + ClassDB::bind_method(_MD("get_function_node_id","name"),&VisualScript::get_function_node_id); + + ClassDB::bind_method(_MD("get_node","func","id"),&VisualScript::get_node); + ClassDB::bind_method(_MD("has_node","func","id"),&VisualScript::has_node); + ClassDB::bind_method(_MD("set_node_pos","func","id","pos"),&VisualScript::set_node_pos); + ClassDB::bind_method(_MD("get_node_pos","func","id"),&VisualScript::get_node_pos); + + ClassDB::bind_method(_MD("sequence_connect","func","from_node","from_output","to_node"),&VisualScript::sequence_connect); + ClassDB::bind_method(_MD("sequence_disconnect","func","from_node","from_output","to_node"),&VisualScript::sequence_disconnect); + ClassDB::bind_method(_MD("has_sequence_connection","func","from_node","from_output","to_node"),&VisualScript::has_sequence_connection); + + ClassDB::bind_method(_MD("data_connect","func","from_node","from_port","to_node","to_port"),&VisualScript::data_connect); + ClassDB::bind_method(_MD("data_disconnect","func","from_node","from_port","to_node","to_port"),&VisualScript::data_disconnect); + ClassDB::bind_method(_MD("has_data_connection","func","from_node","from_port","to_node","to_port"),&VisualScript::has_data_connection); + + ClassDB::bind_method(_MD("add_variable","name","default_value","export"),&VisualScript::add_variable,DEFVAL(Variant()),DEFVAL(false)); + ClassDB::bind_method(_MD("has_variable","name"),&VisualScript::has_variable); + ClassDB::bind_method(_MD("remove_variable","name"),&VisualScript::remove_variable); + ClassDB::bind_method(_MD("set_variable_default_value","name","value"),&VisualScript::set_variable_default_value); + ClassDB::bind_method(_MD("get_variable_default_value","name"),&VisualScript::get_variable_default_value); + ClassDB::bind_method(_MD("set_variable_info","name","value"),&VisualScript::_set_variable_info); + ClassDB::bind_method(_MD("get_variable_info","name"),&VisualScript::_get_variable_info); + ClassDB::bind_method(_MD("set_variable_export","name","enable"),&VisualScript::set_variable_export); + ClassDB::bind_method(_MD("get_variable_export","name"),&VisualScript::get_variable_export); + ClassDB::bind_method(_MD("rename_variable","name","new_name"),&VisualScript::rename_variable); + + ClassDB::bind_method(_MD("add_custom_signal","name"),&VisualScript::add_custom_signal); + ClassDB::bind_method(_MD("has_custom_signal","name"),&VisualScript::has_custom_signal); + ClassDB::bind_method(_MD("custom_signal_add_argument","name","type","argname","index"),&VisualScript::custom_signal_add_argument,DEFVAL(-1)); + ClassDB::bind_method(_MD("custom_signal_set_argument_type","name","argidx","type"),&VisualScript::custom_signal_set_argument_type); + ClassDB::bind_method(_MD("custom_signal_get_argument_type","name","argidx"),&VisualScript::custom_signal_get_argument_type); + ClassDB::bind_method(_MD("custom_signal_set_argument_name","name","argidx","argname"),&VisualScript::custom_signal_set_argument_name); + ClassDB::bind_method(_MD("custom_signal_get_argument_name","name","argidx"),&VisualScript::custom_signal_get_argument_name); + ClassDB::bind_method(_MD("custom_signal_remove_argument","argidx"),&VisualScript::custom_signal_remove_argument); + ClassDB::bind_method(_MD("custom_signal_get_argument_count","name"),&VisualScript::custom_signal_get_argument_count); + ClassDB::bind_method(_MD("custom_signal_swap_argument","name","argidx","withidx"),&VisualScript::custom_signal_swap_argument); + ClassDB::bind_method(_MD("remove_custom_signal","name"),&VisualScript::remove_custom_signal); + ClassDB::bind_method(_MD("rename_custom_signal","name","new_name"),&VisualScript::rename_custom_signal); + + //ClassDB::bind_method(_MD("set_variable_info","name","info"),&VScript::set_variable_info); + //ClassDB::bind_method(_MD("get_variable_info","name"),&VScript::set_variable_info); + + ClassDB::bind_method(_MD("set_instance_base_type","type"),&VisualScript::set_instance_base_type); + + ClassDB::bind_method(_MD("_set_data","data"),&VisualScript::_set_data); + ClassDB::bind_method(_MD("_get_data"),&VisualScript::_get_data); ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY,"data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_data"),_SCS("_get_data")); @@ -1573,7 +1573,7 @@ Variant VisualScriptInstance::_call_internal(const StringName& p_method, void* p p_pass++; //increment pass current_node_id=node->get_id(); - VSDEBUG("==========AT NODE: "+itos(current_node_id)+" base: "+node->get_base_node()->get_type()); + VSDEBUG("==========AT NODE: "+itos(current_node_id)+" base: "+node->get_base_node()->get_class_name()); VSDEBUG("AT STACK POS: "+itos(flow_stack_pos)); @@ -2436,10 +2436,10 @@ Variant VisualScriptFunctionState::resume(Array p_args) { void VisualScriptFunctionState::_bind_methods() { - ObjectTypeDB::bind_method(_MD("connect_to_signal","obj","signals","args"),&VisualScriptFunctionState::connect_to_signal); - ObjectTypeDB::bind_method(_MD("resume:Array","args"),&VisualScriptFunctionState::resume,DEFVAL(Variant())); - ObjectTypeDB::bind_method(_MD("is_valid"),&VisualScriptFunctionState::is_valid); - ObjectTypeDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"_signal_callback",&VisualScriptFunctionState::_signal_callback,MethodInfo("_signal_callback")); + ClassDB::bind_method(_MD("connect_to_signal","obj","signals","args"),&VisualScriptFunctionState::connect_to_signal); + ClassDB::bind_method(_MD("resume:Array","args"),&VisualScriptFunctionState::resume,DEFVAL(Variant())); + ClassDB::bind_method(_MD("is_valid"),&VisualScriptFunctionState::is_valid); + ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"_signal_callback",&VisualScriptFunctionState::_signal_callback,MethodInfo("_signal_callback")); } VisualScriptFunctionState::VisualScriptFunctionState() { @@ -2525,7 +2525,7 @@ int VisualScriptLanguage::find_function(const String& p_function,const String& p return -1; } -String VisualScriptLanguage::make_function(const String& p_class,const String& p_name,const StringArray& p_args) const { +String VisualScriptLanguage::make_function(const String& p_class,const String& p_name,const PoolStringArray& p_args) const { return String(); } @@ -2815,7 +2815,7 @@ VisualScriptLanguage::VisualScriptLanguage() { _debug_parse_err_node=-1; _debug_parse_err_file=""; _debug_call_stack_pos=0; - int dmcs=GLOBAL_DEF("debug/script_max_call_stack",1024); + int dmcs=GLOBAL_DEF("debug/script/max_call_stack",1024); if (ScriptDebugger::get_singleton()) { //debugging enabled! _debug_max_call_stack = dmcs; diff --git a/modules/visual_script/visual_script.h b/modules/visual_script/visual_script.h index 63b018b0c2..acd1c3a670 100644 --- a/modules/visual_script/visual_script.h +++ b/modules/visual_script/visual_script.h @@ -9,7 +9,7 @@ class VisualScriptNodeInstance; class VisualScript; class VisualScriptNode : public Resource { - OBJ_TYPE(VisualScriptNode,Resource) + GDCLASS(VisualScriptNode,Resource) friend class VisualScript; @@ -24,8 +24,6 @@ friend class VisualScript; void validate_input_default_values(); protected: - virtual bool _use_builtin_script() const { return false; } - void _notification(int p_what); void ports_changed_notify(); static void _bind_methods(); @@ -64,7 +62,7 @@ public: Variant::Type type; InputEvent::Type ev_type; - StringName obj_type; + StringName GDCLASS; Ref<Script> script; TypeGuess() { type=Variant::NIL; ev_type=InputEvent::NONE; } @@ -143,7 +141,7 @@ public: class VisualScript : public Script { - OBJ_TYPE( VisualScript, Script ) + GDCLASS( VisualScript, Script ) RES_BASE_EXTENSION("vs"); @@ -437,7 +435,7 @@ public: class VisualScriptFunctionState : public Reference { - OBJ_TYPE(VisualScriptFunctionState,Reference); + GDCLASS(VisualScriptFunctionState,Reference); friend class VisualScriptInstance; ObjectID instance_id; @@ -562,7 +560,7 @@ public: virtual Script *create_script() const; virtual bool has_named_classes() const; virtual int find_function(const String& p_function,const String& p_code) const; - virtual String make_function(const String& p_class,const String& p_name,const StringArray& p_args) const; + virtual String make_function(const String& p_class,const String& p_name,const PoolStringArray& p_args) const; virtual void auto_indent_code(String& p_code,int p_from_line,int p_to_line) const; virtual void add_global_constant(const StringName& p_variable,const Variant& p_value); diff --git a/modules/visual_script/visual_script_builtin_funcs.cpp b/modules/visual_script/visual_script_builtin_funcs.cpp index a7602f97bb..27242384ac 100644 --- a/modules/visual_script/visual_script_builtin_funcs.cpp +++ b/modules/visual_script/visual_script_builtin_funcs.cpp @@ -404,7 +404,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_input_value_port_info(int p_idx) const } break; case BYTES_TO_VAR: { - return PropertyInfo(Variant::RAW_ARRAY,"bytes"); + return PropertyInfo(Variant::POOL_BYTE_ARRAY,"bytes"); } break; case COLORN: { @@ -556,7 +556,7 @@ PropertyInfo VisualScriptBuiltinFunc::get_output_value_port_info(int p_idx) cons } break; case VAR_TO_BYTES: { - t=Variant::RAW_ARRAY; + t=Variant::POOL_BYTE_ARRAY; } break; case BYTES_TO_VAR: { @@ -992,7 +992,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func,const Variant** p_inp case VisualScriptBuiltinFunc::TYPE_EXISTS: { - *r_return = ObjectTypeDB::type_exists(*p_inputs[0]); + *r_return = ClassDB::class_exists(*p_inputs[0]); } break; case VisualScriptBuiltinFunc::TEXT_CHAR: { @@ -1069,7 +1069,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func,const Variant** p_inp case VisualScriptBuiltinFunc::VAR_TO_BYTES: { - ByteArray barr; + PoolByteArray barr; int len; Error err = encode_variant(*p_inputs[0],NULL,len); if (err) { @@ -1082,7 +1082,7 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func,const Variant** p_inp barr.resize(len); { - ByteArray::Write w = barr.write(); + PoolByteArray::Write w = barr.write(); encode_variant(*p_inputs[0],w.ptr(),len); } @@ -1090,24 +1090,24 @@ void VisualScriptBuiltinFunc::exec_func(BuiltinFunc p_func,const Variant** p_inp } break; case VisualScriptBuiltinFunc::BYTES_TO_VAR: { - if (p_inputs[0]->get_type()!=Variant::RAW_ARRAY) { + if (p_inputs[0]->get_type()!=Variant::POOL_BYTE_ARRAY) { r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument=0; - r_error.expected=Variant::RAW_ARRAY; + r_error.expected=Variant::POOL_BYTE_ARRAY; return; } - ByteArray varr=*p_inputs[0]; + PoolByteArray varr=*p_inputs[0]; Variant ret; { - ByteArray::Read r=varr.read(); + PoolByteArray::Read r=varr.read(); Error err = decode_variant(ret,r.ptr(),varr.size(),NULL); if (err!=OK) { r_error_str=RTR("Not enough bytes for decoding bytes, or invalid format."); r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT; r_error.argument=0; - r_error.expected=Variant::RAW_ARRAY; + r_error.expected=Variant::POOL_BYTE_ARRAY; return; } @@ -1166,8 +1166,8 @@ VisualScriptNodeInstance* VisualScriptBuiltinFunc::instance(VisualScriptInstance void VisualScriptBuiltinFunc::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_func","which"),&VisualScriptBuiltinFunc::set_func); - ObjectTypeDB::bind_method(_MD("get_func"),&VisualScriptBuiltinFunc::get_func); + ClassDB::bind_method(_MD("set_func","which"),&VisualScriptBuiltinFunc::set_func); + ClassDB::bind_method(_MD("get_func"),&VisualScriptBuiltinFunc::get_func); String cc; diff --git a/modules/visual_script/visual_script_builtin_funcs.h b/modules/visual_script/visual_script_builtin_funcs.h index 329e7bad42..a285517c7e 100644 --- a/modules/visual_script/visual_script_builtin_funcs.h +++ b/modules/visual_script/visual_script_builtin_funcs.h @@ -6,7 +6,7 @@ class VisualScriptBuiltinFunc : public VisualScriptNode { - OBJ_TYPE(VisualScriptBuiltinFunc,VisualScriptNode) + GDCLASS(VisualScriptBuiltinFunc,VisualScriptNode) public: enum BuiltinFunc { diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp index 02d3c453c4..6f3ea3b4ad 100644 --- a/modules/visual_script/visual_script_editor.cpp +++ b/modules/visual_script/visual_script_editor.cpp @@ -11,7 +11,7 @@ #ifdef TOOLS_ENABLED class VisualScriptEditorSignalEdit : public Object { - OBJ_TYPE(VisualScriptEditorSignalEdit,Object) + GDCLASS(VisualScriptEditorSignalEdit,Object) StringName sig; public: @@ -22,7 +22,7 @@ public: protected: static void _bind_methods() { - ObjectTypeDB::bind_method("_sig_changed",&VisualScriptEditorSignalEdit::_sig_changed); + ClassDB::bind_method("_sig_changed",&VisualScriptEditorSignalEdit::_sig_changed); } void _sig_changed() { @@ -160,7 +160,7 @@ public: class VisualScriptEditorVariableEdit : public Object { - OBJ_TYPE(VisualScriptEditorVariableEdit,Object) + GDCLASS(VisualScriptEditorVariableEdit,Object) StringName var; public: @@ -171,8 +171,8 @@ public: protected: static void _bind_methods() { - ObjectTypeDB::bind_method("_var_changed",&VisualScriptEditorVariableEdit::_var_changed); - ObjectTypeDB::bind_method("_var_value_changed",&VisualScriptEditorVariableEdit::_var_value_changed); + ClassDB::bind_method("_var_changed",&VisualScriptEditorVariableEdit::_var_changed); + ClassDB::bind_method("_var_value_changed",&VisualScriptEditorVariableEdit::_var_value_changed); } void _var_changed() { @@ -326,11 +326,11 @@ static Color _color_from_type(Variant::Type p_type) { case Variant::VECTOR2: color = Color::html("bd91f1"); break; case Variant::RECT2: color = Color::html("f191a5"); break; case Variant::VECTOR3: color = Color::html("d67dee"); break; - case Variant::MATRIX32: color = Color::html("c4ec69"); break; + case Variant::TRANSFORM2D: color = Color::html("c4ec69"); break; case Variant::PLANE: color = Color::html("f77070"); break; case Variant::QUAT: color = Color::html("ec69a3"); break; - case Variant::_AABB: color = Color::html("ee7991"); break; - case Variant::MATRIX3: color = Color::html("e3ec69"); break; + case Variant::RECT3: color = Color::html("ee7991"); break; + case Variant::BASIS: color = Color::html("e3ec69"); break; case Variant::TRANSFORM: color = Color::html("f6a86e"); break; case Variant::COLOR: color = Color::html("9dff70"); break; @@ -342,13 +342,13 @@ static Color _color_from_type(Variant::Type p_type) { case Variant::DICTIONARY: color = Color::html("77edb1"); break; case Variant::ARRAY: color = Color::html("e0e0e0"); break; - case Variant::RAW_ARRAY: color = Color::html("aaf4c8"); break; - case Variant::INT_ARRAY: color = Color::html("afdcf5"); break; - case Variant::REAL_ARRAY: color = Color::html("97e7f8"); break; - case Variant::STRING_ARRAY: color = Color::html("9dc4f2"); break; - case Variant::VECTOR2_ARRAY: color = Color::html("d1b3f5"); break; - case Variant::VECTOR3_ARRAY: color = Color::html("df9bf2"); break; - case Variant::COLOR_ARRAY: color = Color::html("e9ff97"); break; + case Variant::POOL_BYTE_ARRAY: color = Color::html("aaf4c8"); break; + case Variant::POOL_INT_ARRAY: color = Color::html("afdcf5"); break; + case Variant::POOL_REAL_ARRAY: color = Color::html("97e7f8"); break; + case Variant::POOL_STRING_ARRAY: color = Color::html("9dc4f2"); break; + case Variant::POOL_VECTOR2_ARRAY: color = Color::html("d1b3f5"); break; + case Variant::POOL_VECTOR3_ARRAY: color = Color::html("df9bf2"); break; + case Variant::POOL_COLOR_ARRAY: color = Color::html("e9ff97"); break; default: color.set_hsv(p_type/float(Variant::VARIANT_MAX),0.7,0.7); @@ -438,11 +438,11 @@ void VisualScriptEditor::_update_graph(int p_only_id) { Control::get_icon("MiniVector2","EditorIcons"), Control::get_icon("MiniRect2","EditorIcons"), Control::get_icon("MiniVector3","EditorIcons"), - Control::get_icon("MiniMatrix32","EditorIcons"), + Control::get_icon("MiniTransform2D","EditorIcons"), Control::get_icon("MiniPlane","EditorIcons"), Control::get_icon("MiniQuat","EditorIcons"), Control::get_icon("MiniAabb","EditorIcons"), - Control::get_icon("MiniMatrix3","EditorIcons"), + Control::get_icon("MiniBasis","EditorIcons"), Control::get_icon("MiniTransform","EditorIcons"), Control::get_icon("MiniColor","EditorIcons"), Control::get_icon("MiniImage","EditorIcons"), @@ -485,8 +485,8 @@ void VisualScriptEditor::_update_graph(int p_only_id) { gnode->set_overlay(GraphNode::OVERLAY_BREAKPOINT); } - if (EditorSettings::get_singleton()->has("visual_script_editor/color_"+node->get_category())) { - gnode->set_modulate(EditorSettings::get_singleton()->get("visual_script_editor/color_"+node->get_category())); + if (EditorSettings::get_singleton()->has("editors/visual_script/color_"+node->get_category())) { + gnode->set_modulate(EditorSettings::get_singleton()->get("editors/visual_script/color_"+node->get_category())); } @@ -990,7 +990,7 @@ void VisualScriptEditor::_member_button(Object *p_item, int p_column, int p_butt virtuals_in_menu.clear(); List<MethodInfo> mi; - ObjectTypeDB::get_method_list(script->get_instance_base_type(),&mi); + ClassDB::get_method_list(script->get_instance_base_type(),&mi); for (List<MethodInfo>::Element *E=mi.front();E;E=E->next()) { MethodInfo mi=E->get(); if (mi.flags&METHOD_FLAG_VIRTUAL) { @@ -1917,7 +1917,7 @@ void VisualScriptEditor::drop_data_fw(const Point2& p_point,const Variant& p_dat call.instance(); call->set_call_mode(VisualScriptFunctionCall::CALL_MODE_NODE_PATH); call->set_base_path(sn->get_path_to(node));; - call->set_base_type(node->get_type()); + call->set_base_type(node->get_class()); n=call; method_select->select_method_from_instance(node); @@ -1986,7 +1986,7 @@ void VisualScriptEditor::drop_data_fw(const Point2& p_point,const Variant& p_dat Ref<VisualScriptPropertySet> pset; pset.instance(); pset->set_call_mode(VisualScriptPropertySet::CALL_MODE_INSTANCE); - pset->set_base_type(obj->get_type()); + pset->set_base_type(obj->get_class()); /*if (use_value) { pset->set_use_builtin_value(true); pset->set_builtin_value(d["value"]); @@ -1997,7 +1997,7 @@ void VisualScriptEditor::drop_data_fw(const Point2& p_point,const Variant& p_dat Ref<VisualScriptPropertyGet> pget; pget.instance(); pget->set_call_mode(VisualScriptPropertyGet::CALL_MODE_INSTANCE); - pget->set_base_type(obj->get_type()); + pget->set_base_type(obj->get_class()); vnode=pget; @@ -2171,7 +2171,7 @@ String VisualScriptEditor::get_name(){ } else if (script->get_name()!="") name=script->get_name(); else - name=script->get_type()+"("+itos(script->get_instance_ID())+")"; + name=script->get_class()+"("+itos(script->get_instance_ID())+")"; return name; @@ -2321,7 +2321,7 @@ bool VisualScriptEditor::goto_method(const String& p_method){ return true; } -void VisualScriptEditor::add_callback(const String& p_function,StringArray p_args){ +void VisualScriptEditor::add_callback(const String& p_function,PoolStringArray p_args){ if (script->has_function(p_function)) { edited_func=p_function; @@ -2704,7 +2704,7 @@ VisualScriptNode::TypeGuess VisualScriptEditor::_guess_output_type(int p_node,i if (obj) { g.type=Variant::OBJECT; - g.obj_type=obj->get_type(); + g.GDCLASS=obj->get_class(); g.script=obj->get_script(); } } @@ -2745,8 +2745,8 @@ void VisualScriptEditor::_port_action_menu(int p_option) { if (tg.type==Variant::OBJECT) { n->set_call_mode(VisualScriptFunctionCall::CALL_MODE_INSTANCE); - if (tg.obj_type!=StringName()) { - n->set_base_type(tg.obj_type); + if (tg.GDCLASS!=StringName()) { + n->set_base_type(tg.GDCLASS); } else { n->set_base_type("Object"); } @@ -2780,8 +2780,8 @@ void VisualScriptEditor::_port_action_menu(int p_option) { if (tg.type==Variant::OBJECT) { n->set_call_mode(VisualScriptPropertySet::CALL_MODE_INSTANCE); - if (tg.obj_type!=StringName()) { - n->set_base_type(tg.obj_type); + if (tg.GDCLASS!=StringName()) { + n->set_base_type(tg.GDCLASS); } else { n->set_base_type("Object"); } @@ -2811,8 +2811,8 @@ void VisualScriptEditor::_port_action_menu(int p_option) { if (tg.type==Variant::OBJECT) { n->set_call_mode(VisualScriptPropertyGet::CALL_MODE_INSTANCE); - if (tg.obj_type!=StringName()) { - n->set_base_type(tg.obj_type); + if (tg.GDCLASS!=StringName()) { + n->set_base_type(tg.GDCLASS); } else { n->set_base_type("Object"); } @@ -3232,55 +3232,55 @@ void VisualScriptEditor::_menu_option(int p_what) { void VisualScriptEditor::_bind_methods() { - ObjectTypeDB::bind_method("_member_button",&VisualScriptEditor::_member_button); - ObjectTypeDB::bind_method("_member_edited",&VisualScriptEditor::_member_edited); - ObjectTypeDB::bind_method("_member_selected",&VisualScriptEditor::_member_selected); - ObjectTypeDB::bind_method("_update_members",&VisualScriptEditor::_update_members); - ObjectTypeDB::bind_method("_change_base_type",&VisualScriptEditor::_change_base_type); - ObjectTypeDB::bind_method("_change_base_type_callback",&VisualScriptEditor::_change_base_type_callback); - ObjectTypeDB::bind_method("_override_pressed",&VisualScriptEditor::_override_pressed); - ObjectTypeDB::bind_method("_node_selected",&VisualScriptEditor::_node_selected); - ObjectTypeDB::bind_method("_node_moved",&VisualScriptEditor::_node_moved); - ObjectTypeDB::bind_method("_move_node",&VisualScriptEditor::_move_node); - ObjectTypeDB::bind_method("_begin_node_move",&VisualScriptEditor::_begin_node_move); - ObjectTypeDB::bind_method("_end_node_move",&VisualScriptEditor::_end_node_move); - ObjectTypeDB::bind_method("_remove_node",&VisualScriptEditor::_remove_node); - ObjectTypeDB::bind_method("_update_graph",&VisualScriptEditor::_update_graph,DEFVAL(-1)); - ObjectTypeDB::bind_method("_node_ports_changed",&VisualScriptEditor::_node_ports_changed); - ObjectTypeDB::bind_method("_available_node_doubleclicked",&VisualScriptEditor::_available_node_doubleclicked); - ObjectTypeDB::bind_method("_default_value_edited",&VisualScriptEditor::_default_value_edited); - ObjectTypeDB::bind_method("_default_value_changed",&VisualScriptEditor::_default_value_changed); - ObjectTypeDB::bind_method("_menu_option",&VisualScriptEditor::_menu_option); - ObjectTypeDB::bind_method("_graph_ofs_changed",&VisualScriptEditor::_graph_ofs_changed); - ObjectTypeDB::bind_method("_center_on_node",&VisualScriptEditor::_center_on_node); - ObjectTypeDB::bind_method("_comment_node_resized",&VisualScriptEditor::_comment_node_resized); - ObjectTypeDB::bind_method("_button_resource_previewed",&VisualScriptEditor::_button_resource_previewed); - ObjectTypeDB::bind_method("_port_action_menu",&VisualScriptEditor::_port_action_menu); - ObjectTypeDB::bind_method("_selected_connect_node_method_or_setget",&VisualScriptEditor::_selected_connect_node_method_or_setget); - ObjectTypeDB::bind_method("_expression_text_changed",&VisualScriptEditor::_expression_text_changed); + ClassDB::bind_method("_member_button",&VisualScriptEditor::_member_button); + ClassDB::bind_method("_member_edited",&VisualScriptEditor::_member_edited); + ClassDB::bind_method("_member_selected",&VisualScriptEditor::_member_selected); + ClassDB::bind_method("_update_members",&VisualScriptEditor::_update_members); + ClassDB::bind_method("_change_base_type",&VisualScriptEditor::_change_base_type); + ClassDB::bind_method("_change_base_type_callback",&VisualScriptEditor::_change_base_type_callback); + ClassDB::bind_method("_override_pressed",&VisualScriptEditor::_override_pressed); + ClassDB::bind_method("_node_selected",&VisualScriptEditor::_node_selected); + ClassDB::bind_method("_node_moved",&VisualScriptEditor::_node_moved); + ClassDB::bind_method("_move_node",&VisualScriptEditor::_move_node); + ClassDB::bind_method("_begin_node_move",&VisualScriptEditor::_begin_node_move); + ClassDB::bind_method("_end_node_move",&VisualScriptEditor::_end_node_move); + ClassDB::bind_method("_remove_node",&VisualScriptEditor::_remove_node); + ClassDB::bind_method("_update_graph",&VisualScriptEditor::_update_graph,DEFVAL(-1)); + ClassDB::bind_method("_node_ports_changed",&VisualScriptEditor::_node_ports_changed); + ClassDB::bind_method("_available_node_doubleclicked",&VisualScriptEditor::_available_node_doubleclicked); + ClassDB::bind_method("_default_value_edited",&VisualScriptEditor::_default_value_edited); + ClassDB::bind_method("_default_value_changed",&VisualScriptEditor::_default_value_changed); + ClassDB::bind_method("_menu_option",&VisualScriptEditor::_menu_option); + ClassDB::bind_method("_graph_ofs_changed",&VisualScriptEditor::_graph_ofs_changed); + ClassDB::bind_method("_center_on_node",&VisualScriptEditor::_center_on_node); + ClassDB::bind_method("_comment_node_resized",&VisualScriptEditor::_comment_node_resized); + ClassDB::bind_method("_button_resource_previewed",&VisualScriptEditor::_button_resource_previewed); + ClassDB::bind_method("_port_action_menu",&VisualScriptEditor::_port_action_menu); + ClassDB::bind_method("_selected_connect_node_method_or_setget",&VisualScriptEditor::_selected_connect_node_method_or_setget); + ClassDB::bind_method("_expression_text_changed",&VisualScriptEditor::_expression_text_changed); - ObjectTypeDB::bind_method("get_drag_data_fw",&VisualScriptEditor::get_drag_data_fw); - ObjectTypeDB::bind_method("can_drop_data_fw",&VisualScriptEditor::can_drop_data_fw); - ObjectTypeDB::bind_method("drop_data_fw",&VisualScriptEditor::drop_data_fw); + ClassDB::bind_method("get_drag_data_fw",&VisualScriptEditor::get_drag_data_fw); + ClassDB::bind_method("can_drop_data_fw",&VisualScriptEditor::can_drop_data_fw); + ClassDB::bind_method("drop_data_fw",&VisualScriptEditor::drop_data_fw); - ObjectTypeDB::bind_method("_input",&VisualScriptEditor::_input); - ObjectTypeDB::bind_method("_on_nodes_delete",&VisualScriptEditor::_on_nodes_delete); - ObjectTypeDB::bind_method("_on_nodes_duplicate",&VisualScriptEditor::_on_nodes_duplicate); + ClassDB::bind_method("_input",&VisualScriptEditor::_input); + ClassDB::bind_method("_on_nodes_delete",&VisualScriptEditor::_on_nodes_delete); + ClassDB::bind_method("_on_nodes_duplicate",&VisualScriptEditor::_on_nodes_duplicate); - ObjectTypeDB::bind_method("_hide_timer",&VisualScriptEditor::_hide_timer); + ClassDB::bind_method("_hide_timer",&VisualScriptEditor::_hide_timer); - ObjectTypeDB::bind_method("_graph_connected",&VisualScriptEditor::_graph_connected); - ObjectTypeDB::bind_method("_graph_disconnected",&VisualScriptEditor::_graph_disconnected); - ObjectTypeDB::bind_method("_graph_connect_to_empty",&VisualScriptEditor::_graph_connect_to_empty); + ClassDB::bind_method("_graph_connected",&VisualScriptEditor::_graph_connected); + ClassDB::bind_method("_graph_disconnected",&VisualScriptEditor::_graph_disconnected); + ClassDB::bind_method("_graph_connect_to_empty",&VisualScriptEditor::_graph_connect_to_empty); - ObjectTypeDB::bind_method("_update_graph_connections",&VisualScriptEditor::_update_graph_connections); - ObjectTypeDB::bind_method("_node_filter_changed",&VisualScriptEditor::_node_filter_changed); + ClassDB::bind_method("_update_graph_connections",&VisualScriptEditor::_update_graph_connections); + ClassDB::bind_method("_node_filter_changed",&VisualScriptEditor::_node_filter_changed); - ObjectTypeDB::bind_method("_selected_method",&VisualScriptEditor::_selected_method); - ObjectTypeDB::bind_method("_draw_color_over_button",&VisualScriptEditor::_draw_color_over_button); + ClassDB::bind_method("_selected_method",&VisualScriptEditor::_selected_method); + ClassDB::bind_method("_draw_color_over_button",&VisualScriptEditor::_draw_color_over_button); @@ -3306,7 +3306,7 @@ VisualScriptEditor::VisualScriptEditor() { edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("visual_script_editor/cut_nodes"), EDIT_CUT_NODES); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("visual_script_editor/paste_nodes"), EDIT_PASTE_NODES); - edit_menu->get_popup()->connect("item_pressed",this,"_menu_option"); + edit_menu->get_popup()->connect("id_pressed",this,"_menu_option"); main_hsplit = memnew( HSplitContainer ); add_child(main_hsplit); @@ -3422,7 +3422,7 @@ VisualScriptEditor::VisualScriptEditor() { edit_signal_edit = memnew( PropertyEditor ); edit_signal_edit->hide_top_label(); edit_signal_dialog->add_child(edit_signal_edit); - edit_signal_dialog->set_child_rect(edit_signal_edit); + edit_signal_edit->edit(signal_editor); edit_variable_dialog = memnew( AcceptDialog ); @@ -3434,7 +3434,7 @@ VisualScriptEditor::VisualScriptEditor() { edit_variable_edit = memnew( PropertyEditor ); edit_variable_edit->hide_top_label(); edit_variable_dialog->add_child(edit_variable_edit); - edit_variable_dialog->set_child_rect(edit_variable_edit); + edit_variable_edit->edit(variable_editor); select_base_type=memnew(CreateDialog); @@ -3446,7 +3446,7 @@ VisualScriptEditor::VisualScriptEditor() { undo_redo = EditorNode::get_singleton()->get_undo_redo(); new_function_menu = memnew( PopupMenu ); - new_function_menu->connect("item_pressed",this,"_override_pressed"); + new_function_menu->connect("id_pressed",this,"_override_pressed"); add_child(new_function_menu); updating_members=false; @@ -3468,7 +3468,7 @@ VisualScriptEditor::VisualScriptEditor() { port_action_popup = memnew( PopupMenu ); add_child(port_action_popup); - port_action_popup->connect("item_pressed",this,"_port_action_menu"); + port_action_popup->connect("id_pressed",this,"_port_action_menu"); } @@ -3500,12 +3500,12 @@ void VisualScriptEditor::free_clipboard() { static void register_editor_callback() { ScriptEditor::register_create_script_editor_function(create_editor); - EditorSettings::get_singleton()->set("visual_script_editor/color_functions",Color(1,0.9,0.9)); - EditorSettings::get_singleton()->set("visual_script_editor/color_data",Color(0.9,1.0,0.9)); - EditorSettings::get_singleton()->set("visual_script_editor/color_operators",Color(0.9,0.9,1.0)); - EditorSettings::get_singleton()->set("visual_script_editor/color_flow_control",Color(1.0,1.0,0.8)); - EditorSettings::get_singleton()->set("visual_script_editor/color_custom",Color(0.8,1.0,1.0)); - EditorSettings::get_singleton()->set("visual_script_editor/color_constants",Color(1.0,0.8,1.0)); + EditorSettings::get_singleton()->set("editors/visual_script/color_functions",Color(1,0.9,0.9)); + EditorSettings::get_singleton()->set("editors/visual_script/color_data",Color(0.9,1.0,0.9)); + EditorSettings::get_singleton()->set("editors/visual_script/color_operators",Color(0.9,0.9,1.0)); + EditorSettings::get_singleton()->set("editors/visual_script/color_flow_control",Color(1.0,1.0,0.8)); + EditorSettings::get_singleton()->set("editors/visual_script/color_custom",Color(0.8,1.0,1.0)); + EditorSettings::get_singleton()->set("editors/visual_script/color_constants",Color(1.0,0.8,1.0)); ED_SHORTCUT("visual_script_editor/delete_selected", TTR("Delete Selected")); diff --git a/modules/visual_script/visual_script_editor.h b/modules/visual_script/visual_script_editor.h index 483ae1644c..e120bdc655 100644 --- a/modules/visual_script/visual_script_editor.h +++ b/modules/visual_script/visual_script_editor.h @@ -15,7 +15,7 @@ class VisualScriptEditorVariableEdit; class VisualScriptEditor : public ScriptEditorBase { - OBJ_TYPE(VisualScriptEditor,ScriptEditorBase) + GDCLASS(VisualScriptEditor,ScriptEditorBase) enum { TYPE_SEQUENCE=1000, @@ -225,7 +225,7 @@ public: virtual void reload(bool p_soft); virtual void get_breakpoints(List<int> *p_breakpoints); virtual bool goto_method(const String& p_method); - virtual void add_callback(const String& p_function,StringArray p_args); + virtual void add_callback(const String& p_function,PoolStringArray p_args); virtual void update_settings(); virtual void set_debugger_active(bool p_active); virtual void set_tooltip_request_func(String p_method,Object* p_obj); diff --git a/modules/visual_script/visual_script_expression.h b/modules/visual_script/visual_script_expression.h index 4edae133c7..a67656a4b1 100644 --- a/modules/visual_script/visual_script_expression.h +++ b/modules/visual_script/visual_script_expression.h @@ -6,7 +6,7 @@ class VisualScriptExpression : public VisualScriptNode { - OBJ_TYPE(VisualScriptExpression,VisualScriptNode) + GDCLASS(VisualScriptExpression,VisualScriptNode) friend class VisualScriptNodeInstanceExpression; struct Input { diff --git a/modules/visual_script/visual_script_flow_control.cpp b/modules/visual_script/visual_script_flow_control.cpp index 97338da187..0e526f8a42 100644 --- a/modules/visual_script/visual_script_flow_control.cpp +++ b/modules/visual_script/visual_script_flow_control.cpp @@ -81,10 +81,10 @@ bool VisualScriptReturn::is_return_value_enabled() const { void VisualScriptReturn::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_return_type","type"),&VisualScriptReturn::set_return_type); - ObjectTypeDB::bind_method(_MD("get_return_type"),&VisualScriptReturn::get_return_type); - ObjectTypeDB::bind_method(_MD("set_enable_return_value","enable"),&VisualScriptReturn::set_enable_return_value); - ObjectTypeDB::bind_method(_MD("is_return_value_enabled"),&VisualScriptReturn::is_return_value_enabled); + ClassDB::bind_method(_MD("set_return_type","type"),&VisualScriptReturn::set_return_type); + ClassDB::bind_method(_MD("get_return_type"),&VisualScriptReturn::get_return_type); + ClassDB::bind_method(_MD("set_enable_return_value","enable"),&VisualScriptReturn::set_enable_return_value); + ClassDB::bind_method(_MD("is_return_value_enabled"),&VisualScriptReturn::is_return_value_enabled); String argt="Any"; for(int i=1;i<Variant::VARIANT_MAX;i++) { @@ -544,8 +544,8 @@ int VisualScriptSequence::get_steps() const { void VisualScriptSequence::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_steps","steps"),&VisualScriptSequence::set_steps); - ObjectTypeDB::bind_method(_MD("get_steps"),&VisualScriptSequence::get_steps); + ClassDB::bind_method(_MD("set_steps","steps"),&VisualScriptSequence::set_steps); + ClassDB::bind_method(_MD("get_steps"),&VisualScriptSequence::get_steps); ADD_PROPERTY(PropertyInfo(Variant::INT,"steps",PROPERTY_HINT_RANGE,"1,64,1"),_SCS("set_steps"),_SCS("get_steps")); @@ -871,9 +871,9 @@ String VisualScriptInputFilter::get_output_sequence_port_text(int p_port) const } break; - case InputEvent::JOYSTICK_MOTION: { + case InputEvent::JOYPAD_MOTION: { - InputEventJoystickMotion jm = filters[p_port].joy_motion; + InputEventJoypadMotion jm = filters[p_port].joy_motion; text="JoyMotion Axis "+itos(jm.axis>>1); if (jm.axis&1) @@ -882,8 +882,8 @@ String VisualScriptInputFilter::get_output_sequence_port_text(int p_port) const text+=" < "+rtos(-jm.axis_value); } break; - case InputEvent::JOYSTICK_BUTTON: { - InputEventJoystickButton jb = filters[p_port].joy_button; + case InputEvent::JOYPAD_BUTTON: { + InputEventJoypadButton jb = filters[p_port].joy_button; text="JoyButton "+itos(jb.button_index); if (jb.pressed) @@ -908,7 +908,7 @@ String VisualScriptInputFilter::get_output_sequence_port_text(int p_port) const List<PropertyInfo> pinfo; - Globals::get_singleton()->get_property_list(&pinfo); + GlobalConfig::get_singleton()->get_property_list(&pinfo); int index=1; text="No Action"; @@ -985,13 +985,13 @@ bool VisualScriptInputFilter::_set(const StringName& p_name, const Variant& p_va if (what=="type") { filters[idx]=InputEvent(); filters[idx].type=InputEvent::Type(int(p_value)); - if (filters[idx].type==InputEvent::JOYSTICK_MOTION) { + if (filters[idx].type==InputEvent::JOYPAD_MOTION) { filters[idx].joy_motion.axis_value=0.5; //for treshold } else if (filters[idx].type==InputEvent::KEY) { filters[idx].key.pressed=true; //put these as true to make it more user friendly } else if (filters[idx].type==InputEvent::MOUSE_BUTTON) { filters[idx].mouse_button.pressed=true; - } else if (filters[idx].type==InputEvent::JOYSTICK_BUTTON) { + } else if (filters[idx].type==InputEvent::JOYPAD_BUTTON) { filters[idx].joy_button.pressed=true; } else if (filters[idx].type==InputEvent::SCREEN_TOUCH) { filters[idx].screen_touch.pressed=true; @@ -1108,7 +1108,7 @@ bool VisualScriptInputFilter::_set(const StringName& p_name, const Variant& p_va return true; } break; - case InputEvent::JOYSTICK_MOTION: { + case InputEvent::JOYPAD_MOTION: { if (what=="axis") { filters[idx].joy_motion.axis=int(p_value)<<1|filters[idx].joy_motion.axis; @@ -1124,7 +1124,7 @@ bool VisualScriptInputFilter::_set(const StringName& p_name, const Variant& p_va } break; - case InputEvent::JOYSTICK_BUTTON: { + case InputEvent::JOYPAD_BUTTON: { if (what=="button_index") { filters[idx].joy_button.button_index=p_value; @@ -1164,7 +1164,7 @@ bool VisualScriptInputFilter::_set(const StringName& p_name, const Variant& p_va if (what=="action_name") { List<PropertyInfo> pinfo; - Globals::get_singleton()->get_property_list(&pinfo); + GlobalConfig::get_singleton()->get_property_list(&pinfo); int index=1; for(List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) { @@ -1326,7 +1326,7 @@ bool VisualScriptInputFilter::_get(const StringName& p_name,Variant &r_ret) cons return true; } break; - case InputEvent::JOYSTICK_MOTION: { + case InputEvent::JOYPAD_MOTION: { if (what=="axis_index") { r_ret=filters[idx].joy_motion.axis>>1; @@ -1341,7 +1341,7 @@ bool VisualScriptInputFilter::_get(const StringName& p_name,Variant &r_ret) cons } break; - case InputEvent::JOYSTICK_BUTTON: { + case InputEvent::JOYPAD_BUTTON: { if (what=="button_index") { r_ret=filters[idx].joy_button.button_index; @@ -1378,7 +1378,7 @@ bool VisualScriptInputFilter::_get(const StringName& p_name,Variant &r_ret) cons if (what=="action_name") { List<PropertyInfo> pinfo; - Globals::get_singleton()->get_property_list(&pinfo); + GlobalConfig::get_singleton()->get_property_list(&pinfo); int index=1; for(List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) { @@ -1417,8 +1417,8 @@ static const char* event_type_names[InputEvent::TYPE_MAX]={ "Key", "MouseMotion", "MouseButton", - "JoystickMotion", - "JoystickButton", + "JoypadMotion", + "JoypadButton", "ScreenTouch", "ScreenDrag", "Action" @@ -1489,13 +1489,13 @@ void VisualScriptInputFilter::_get_property_list( List<PropertyInfo> *p_list) co p_list->push_back(PropertyInfo(Variant::BOOL,base+"mod_meta")); } break; - case InputEvent::JOYSTICK_MOTION: { + case InputEvent::JOYPAD_MOTION: { p_list->push_back(PropertyInfo(Variant::INT,base+"axis_index")); p_list->push_back(PropertyInfo(Variant::INT,base+"mode",PROPERTY_HINT_ENUM,"Min,Max")); p_list->push_back(PropertyInfo(Variant::REAL,base+"treshold",PROPERTY_HINT_RANGE,"0,1,0.01")); } break; - case InputEvent::JOYSTICK_BUTTON: { + case InputEvent::JOYPAD_BUTTON: { p_list->push_back(PropertyInfo(Variant::INT,base+"button_index")); p_list->push_back(PropertyInfo(Variant::BOOL,base+"pressed")); @@ -1517,7 +1517,7 @@ void VisualScriptInputFilter::_get_property_list( List<PropertyInfo> *p_list) co actions="None"; List<PropertyInfo> pinfo; - Globals::get_singleton()->get_property_list(&pinfo); + GlobalConfig::get_singleton()->get_property_list(&pinfo); Vector<String> al; for(List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) { @@ -1632,10 +1632,10 @@ public: } break; - case InputEvent::JOYSTICK_MOTION: { + case InputEvent::JOYPAD_MOTION: { - InputEventJoystickMotion jm = ie.joy_motion; - InputEventJoystickMotion jm2 = event.joy_motion; + InputEventJoypadMotion jm = ie.joy_motion; + InputEventJoypadMotion jm2 = event.joy_motion; int axis = jm.axis>>1; @@ -1656,9 +1656,9 @@ public: } break; - case InputEvent::JOYSTICK_BUTTON: { - InputEventJoystickButton jb = ie.joy_button; - InputEventJoystickButton jb2 = event.joy_button; + case InputEvent::JOYPAD_BUTTON: { + InputEventJoypadButton jb = ie.joy_button; + InputEventJoypadButton jb2 = event.joy_button; if ( jb.button_index==jb2.button_index && jb.pressed == jb2.pressed @@ -1869,7 +1869,7 @@ public: return 1; //not found sorry } - if (ObjectTypeDB::is_type(obj->get_type_name(),base_type)) { + if (ClassDB::is_parent_class(obj->get_class_name(),base_type)) { *p_outputs[0]=*p_inputs[0]; //copy return 0; } else @@ -1893,11 +1893,11 @@ VisualScriptNodeInstance* VisualScriptTypeCast::instance(VisualScriptInstance* p void VisualScriptTypeCast::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_base_type","type"),&VisualScriptTypeCast::set_base_type); - ObjectTypeDB::bind_method(_MD("get_base_type"),&VisualScriptTypeCast::get_base_type); + ClassDB::bind_method(_MD("set_base_type","type"),&VisualScriptTypeCast::set_base_type); + ClassDB::bind_method(_MD("get_base_type"),&VisualScriptTypeCast::get_base_type); - ObjectTypeDB::bind_method(_MD("set_base_script","path"),&VisualScriptTypeCast::set_base_script); - ObjectTypeDB::bind_method(_MD("get_base_script"),&VisualScriptTypeCast::get_base_script); + ClassDB::bind_method(_MD("set_base_script","path"),&VisualScriptTypeCast::set_base_script); + ClassDB::bind_method(_MD("get_base_script"),&VisualScriptTypeCast::get_base_script); List<String> script_extensions; diff --git a/modules/visual_script/visual_script_flow_control.h b/modules/visual_script/visual_script_flow_control.h index e0da84a534..26e981cb1e 100644 --- a/modules/visual_script/visual_script_flow_control.h +++ b/modules/visual_script/visual_script_flow_control.h @@ -5,7 +5,7 @@ class VisualScriptReturn : public VisualScriptNode { - OBJ_TYPE(VisualScriptReturn,VisualScriptNode) + GDCLASS(VisualScriptReturn,VisualScriptNode) Variant::Type type; @@ -48,7 +48,7 @@ public: class VisualScriptCondition : public VisualScriptNode { - OBJ_TYPE(VisualScriptCondition,VisualScriptNode) + GDCLASS(VisualScriptCondition,VisualScriptNode) @@ -84,7 +84,7 @@ public: class VisualScriptWhile : public VisualScriptNode { - OBJ_TYPE(VisualScriptWhile,VisualScriptNode) + GDCLASS(VisualScriptWhile,VisualScriptNode) @@ -121,7 +121,7 @@ public: class VisualScriptIterator : public VisualScriptNode { - OBJ_TYPE(VisualScriptIterator,VisualScriptNode) + GDCLASS(VisualScriptIterator,VisualScriptNode) @@ -158,7 +158,7 @@ public: class VisualScriptSequence : public VisualScriptNode { - OBJ_TYPE(VisualScriptSequence,VisualScriptNode) + GDCLASS(VisualScriptSequence,VisualScriptNode) int steps; @@ -199,7 +199,7 @@ public: class VisualScriptSwitch : public VisualScriptNode { - OBJ_TYPE(VisualScriptSwitch,VisualScriptNode) + GDCLASS(VisualScriptSwitch,VisualScriptNode) struct Case { Variant::Type type; @@ -248,7 +248,7 @@ public: class VisualScriptInputFilter : public VisualScriptNode { - OBJ_TYPE(VisualScriptInputFilter,VisualScriptNode) + GDCLASS(VisualScriptInputFilter,VisualScriptNode) Vector<InputEvent> filters; @@ -290,7 +290,7 @@ public: class VisualScriptTypeCast : public VisualScriptNode { - OBJ_TYPE(VisualScriptTypeCast,VisualScriptNode) + GDCLASS(VisualScriptTypeCast,VisualScriptNode) StringName base_type; diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp index 5a21cb40e9..9f3ba8a8cb 100644 --- a/modules/visual_script/visual_script_func_nodes.cpp +++ b/modules/visual_script/visual_script_func_nodes.cpp @@ -92,7 +92,7 @@ StringName VisualScriptFunctionCall::_get_base_type() const { else if (call_mode==CALL_MODE_NODE_PATH && get_visual_script().is_valid()) { Node *path = _get_base_node(); if (path) - return path->get_type(); + return path->get_class(); } @@ -110,7 +110,7 @@ int VisualScriptFunctionCall::get_input_value_port_count() const{ } else { - MethodBind *mb = ObjectTypeDB::get_method(_get_base_type(),function); + MethodBind *mb = ClassDB::get_method(_get_base_type(),function); if (mb) { return mb->get_argument_count() + (call_mode==CALL_MODE_INSTANCE?1:0) + (rpc_call_mode>=RPC_RELIABLE_TO_ID?1:0) - use_default_args; } @@ -129,7 +129,7 @@ int VisualScriptFunctionCall::get_output_value_port_count() const{ } else { int ret; - MethodBind *mb = ObjectTypeDB::get_method(_get_base_type(),function); + MethodBind *mb = ClassDB::get_method(_get_base_type(),function); if (mb) { ret = mb->has_return() ? 1 : 0; } else @@ -182,7 +182,7 @@ PropertyInfo VisualScriptFunctionCall::get_input_value_port_info(int p_idx) cons } else { - MethodBind *mb = ObjectTypeDB::get_method(_get_base_type(),function); + MethodBind *mb = ClassDB::get_method(_get_base_type(),function); if (mb) { return mb->get_argument_info(p_idx); } @@ -220,7 +220,7 @@ PropertyInfo VisualScriptFunctionCall::get_output_value_port_info(int p_idx) con PropertyInfo ret; - /*MethodBind *mb = ObjectTypeDB::get_method(_get_base_type(),function); + /*MethodBind *mb = ClassDB::get_method(_get_base_type(),function); if (mb) { ret = mb->get_argument_info(-1); @@ -332,9 +332,9 @@ void VisualScriptFunctionCall::set_singleton(const StringName& p_path) { return; singleton=p_path; - Object *obj = Globals::get_singleton()->get_singleton_object(singleton); + Object *obj = GlobalConfig::get_singleton()->get_singleton_object(singleton); if (obj) { - base_type=obj->get_type(); + base_type=obj->get_class(); } _change_notify(); @@ -356,7 +356,7 @@ void VisualScriptFunctionCall::_update_method_cache() { Node* node=_get_base_node(); if (node) { - type=node->get_type(); + type=node->get_class(); base_type=type; //cache, too script = node->get_script(); } @@ -370,9 +370,9 @@ void VisualScriptFunctionCall::_update_method_cache() { } else if (call_mode==CALL_MODE_SINGLETON) { - Object *obj = Globals::get_singleton()->get_singleton_object(singleton); + Object *obj = GlobalConfig::get_singleton()->get_singleton_object(singleton); if (obj) { - type=obj->get_type(); + type=obj->get_class(); script=obj->get_script(); } @@ -397,7 +397,7 @@ void VisualScriptFunctionCall::_update_method_cache() { // print_line("BASE: "+String(type)+" FUNC: "+String(function)); - MethodBind *mb = ObjectTypeDB::get_method(type,function); + MethodBind *mb = ClassDB::get_method(type,function); if (mb) { use_default_args=mb->get_default_argument_count(); method_cache = MethodInfo(); @@ -567,11 +567,11 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo& property) const if (call_mode!=CALL_MODE_SINGLETON) { property.usage=0; } else { - List<Globals::Singleton> names; - Globals::get_singleton()->get_singletons(&names); + List<GlobalConfig::Singleton> names; + GlobalConfig::get_singleton()->get_singletons(&names); property.hint=PROPERTY_HINT_ENUM; String sl; - for (List<Globals::Singleton>::Element *E=names.front();E;E=E->next()) { + for (List<GlobalConfig::Singleton>::Element *E=names.front();E;E=E->next()) { if (sl!=String()) sl+=","; sl+=E->get().name; @@ -607,7 +607,7 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo& property) const property.hint_string=itos(get_visual_script()->get_instance_ID()); } else if (call_mode==CALL_MODE_SINGLETON) { - Object *obj = Globals::get_singleton()->get_singleton_object(singleton); + Object *obj = GlobalConfig::get_singleton()->get_singleton_object(singleton); if (obj) { property.hint=PROPERTY_HINT_METHOD_OF_INSTANCE; property.hint_string=itos(obj->get_instance_ID()); @@ -661,7 +661,7 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo& property) const mc = Variant::get_method_default_arguments(basic_type,function).size(); } else { - MethodBind *mb = ObjectTypeDB::get_method(_get_base_type(),function); + MethodBind *mb = ClassDB::get_method(_get_base_type(),function); if (mb) { mc=mb->get_default_argument_count(); @@ -687,38 +687,38 @@ void VisualScriptFunctionCall::_validate_property(PropertyInfo& property) const void VisualScriptFunctionCall::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_base_type","base_type"),&VisualScriptFunctionCall::set_base_type); - ObjectTypeDB::bind_method(_MD("get_base_type"),&VisualScriptFunctionCall::get_base_type); + ClassDB::bind_method(_MD("set_base_type","base_type"),&VisualScriptFunctionCall::set_base_type); + ClassDB::bind_method(_MD("get_base_type"),&VisualScriptFunctionCall::get_base_type); - ObjectTypeDB::bind_method(_MD("set_base_script","base_script"),&VisualScriptFunctionCall::set_base_script); - ObjectTypeDB::bind_method(_MD("get_base_script"),&VisualScriptFunctionCall::get_base_script); + ClassDB::bind_method(_MD("set_base_script","base_script"),&VisualScriptFunctionCall::set_base_script); + ClassDB::bind_method(_MD("get_base_script"),&VisualScriptFunctionCall::get_base_script); - ObjectTypeDB::bind_method(_MD("set_basic_type","basic_type"),&VisualScriptFunctionCall::set_basic_type); - ObjectTypeDB::bind_method(_MD("get_basic_type"),&VisualScriptFunctionCall::get_basic_type); + ClassDB::bind_method(_MD("set_basic_type","basic_type"),&VisualScriptFunctionCall::set_basic_type); + ClassDB::bind_method(_MD("get_basic_type"),&VisualScriptFunctionCall::get_basic_type); - ObjectTypeDB::bind_method(_MD("set_singleton","singleton"),&VisualScriptFunctionCall::set_singleton); - ObjectTypeDB::bind_method(_MD("get_singleton"),&VisualScriptFunctionCall::get_singleton); + ClassDB::bind_method(_MD("set_singleton","singleton"),&VisualScriptFunctionCall::set_singleton); + ClassDB::bind_method(_MD("get_singleton"),&VisualScriptFunctionCall::get_singleton); - ObjectTypeDB::bind_method(_MD("set_function","function"),&VisualScriptFunctionCall::set_function); - ObjectTypeDB::bind_method(_MD("get_function"),&VisualScriptFunctionCall::get_function); + ClassDB::bind_method(_MD("set_function","function"),&VisualScriptFunctionCall::set_function); + ClassDB::bind_method(_MD("get_function"),&VisualScriptFunctionCall::get_function); - ObjectTypeDB::bind_method(_MD("set_call_mode","mode"),&VisualScriptFunctionCall::set_call_mode); - ObjectTypeDB::bind_method(_MD("get_call_mode"),&VisualScriptFunctionCall::get_call_mode); + ClassDB::bind_method(_MD("set_call_mode","mode"),&VisualScriptFunctionCall::set_call_mode); + ClassDB::bind_method(_MD("get_call_mode"),&VisualScriptFunctionCall::get_call_mode); - ObjectTypeDB::bind_method(_MD("set_base_path","base_path"),&VisualScriptFunctionCall::set_base_path); - ObjectTypeDB::bind_method(_MD("get_base_path"),&VisualScriptFunctionCall::get_base_path); + ClassDB::bind_method(_MD("set_base_path","base_path"),&VisualScriptFunctionCall::set_base_path); + ClassDB::bind_method(_MD("get_base_path"),&VisualScriptFunctionCall::get_base_path); - ObjectTypeDB::bind_method(_MD("set_use_default_args","amount"),&VisualScriptFunctionCall::set_use_default_args); - ObjectTypeDB::bind_method(_MD("get_use_default_args"),&VisualScriptFunctionCall::get_use_default_args); + ClassDB::bind_method(_MD("set_use_default_args","amount"),&VisualScriptFunctionCall::set_use_default_args); + ClassDB::bind_method(_MD("get_use_default_args"),&VisualScriptFunctionCall::get_use_default_args); - ObjectTypeDB::bind_method(_MD("_set_argument_cache","argument_cache"),&VisualScriptFunctionCall::_set_argument_cache); - ObjectTypeDB::bind_method(_MD("_get_argument_cache"),&VisualScriptFunctionCall::_get_argument_cache); + ClassDB::bind_method(_MD("_set_argument_cache","argument_cache"),&VisualScriptFunctionCall::_set_argument_cache); + ClassDB::bind_method(_MD("_get_argument_cache"),&VisualScriptFunctionCall::_get_argument_cache); - ObjectTypeDB::bind_method(_MD("set_rpc_call_mode","mode"),&VisualScriptFunctionCall::set_rpc_call_mode); - ObjectTypeDB::bind_method(_MD("get_rpc_call_mode"),&VisualScriptFunctionCall::get_rpc_call_mode); + ClassDB::bind_method(_MD("set_rpc_call_mode","mode"),&VisualScriptFunctionCall::set_rpc_call_mode); + ClassDB::bind_method(_MD("get_rpc_call_mode"),&VisualScriptFunctionCall::get_rpc_call_mode); - ObjectTypeDB::bind_method(_MD("set_validate","enable"),&VisualScriptFunctionCall::set_validate); - ObjectTypeDB::bind_method(_MD("get_validate"),&VisualScriptFunctionCall::get_validate); + ClassDB::bind_method(_MD("set_validate","enable"),&VisualScriptFunctionCall::set_validate); + ClassDB::bind_method(_MD("get_validate"),&VisualScriptFunctionCall::get_validate); String bt; for(int i=0;i<Variant::VARIANT_MAX;i++) { @@ -881,7 +881,7 @@ public: } break; case VisualScriptFunctionCall::CALL_MODE_SINGLETON: { - Object *object=Globals::get_singleton()->get_singleton_object(singleton); + Object *object=GlobalConfig::get_singleton()->get_singleton_object(singleton); if (!object) { r_error.error=Variant::CallError::CALL_ERROR_INVALID_METHOD; r_error_str="Invalid singleton name: '"+String(singleton)+"'"; @@ -971,8 +971,8 @@ static const char* event_type_names[InputEvent::TYPE_MAX]={ "Key", "MouseMotion", "MouseButton", - "JoystickMotion", - "JoystickButton", + "JoypadMotion", + "JoypadButton", "ScreenTouch", "ScreenDrag", "Action" @@ -1034,7 +1034,7 @@ StringName VisualScriptPropertySet::_get_base_type() const { else if (call_mode==CALL_MODE_NODE_PATH && get_visual_script().is_valid()) { Node *path = _get_base_node(); if (path) - return path->get_type(); + return path->get_class(); } @@ -1122,7 +1122,7 @@ void VisualScriptPropertySet::_update_base_type() { Node* node=_get_base_node(); if (node) { - base_type=node->get_type(); + base_type=node->get_class(); } } else if (call_mode==CALL_MODE_SELF) { @@ -1247,7 +1247,7 @@ void VisualScriptPropertySet::_update_cache() { node=_get_base_node(); if (node) { - type=node->get_type(); + type=node->get_class(); base_type=type; //cache, too script = node->get_script(); } @@ -1284,7 +1284,7 @@ void VisualScriptPropertySet::_update_cache() { node->get_property_list(&pinfo); } else { - ObjectTypeDB::get_property_list(type,&pinfo); + ClassDB::get_property_list(type,&pinfo); } if (script.is_valid()) { @@ -1453,29 +1453,29 @@ void VisualScriptPropertySet::_validate_property(PropertyInfo& property) const { void VisualScriptPropertySet::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_base_type","base_type"),&VisualScriptPropertySet::set_base_type); - ObjectTypeDB::bind_method(_MD("get_base_type"),&VisualScriptPropertySet::get_base_type); + ClassDB::bind_method(_MD("set_base_type","base_type"),&VisualScriptPropertySet::set_base_type); + ClassDB::bind_method(_MD("get_base_type"),&VisualScriptPropertySet::get_base_type); - ObjectTypeDB::bind_method(_MD("set_base_script","base_script"),&VisualScriptPropertySet::set_base_script); - ObjectTypeDB::bind_method(_MD("get_base_script"),&VisualScriptPropertySet::get_base_script); + ClassDB::bind_method(_MD("set_base_script","base_script"),&VisualScriptPropertySet::set_base_script); + ClassDB::bind_method(_MD("get_base_script"),&VisualScriptPropertySet::get_base_script); - ObjectTypeDB::bind_method(_MD("set_basic_type","basic_type"),&VisualScriptPropertySet::set_basic_type); - ObjectTypeDB::bind_method(_MD("get_basic_type"),&VisualScriptPropertySet::get_basic_type); + ClassDB::bind_method(_MD("set_basic_type","basic_type"),&VisualScriptPropertySet::set_basic_type); + ClassDB::bind_method(_MD("get_basic_type"),&VisualScriptPropertySet::get_basic_type); - ObjectTypeDB::bind_method(_MD("_set_type_cache","type_cache"),&VisualScriptPropertySet::_set_type_cache); - ObjectTypeDB::bind_method(_MD("_get_type_cache"),&VisualScriptPropertySet::_get_type_cache); + ClassDB::bind_method(_MD("_set_type_cache","type_cache"),&VisualScriptPropertySet::_set_type_cache); + ClassDB::bind_method(_MD("_get_type_cache"),&VisualScriptPropertySet::_get_type_cache); - ObjectTypeDB::bind_method(_MD("set_event_type","event_type"),&VisualScriptPropertySet::set_event_type); - ObjectTypeDB::bind_method(_MD("get_event_type"),&VisualScriptPropertySet::get_event_type); + ClassDB::bind_method(_MD("set_event_type","event_type"),&VisualScriptPropertySet::set_event_type); + ClassDB::bind_method(_MD("get_event_type"),&VisualScriptPropertySet::get_event_type); - ObjectTypeDB::bind_method(_MD("set_property","property"),&VisualScriptPropertySet::set_property); - ObjectTypeDB::bind_method(_MD("get_property"),&VisualScriptPropertySet::get_property); + ClassDB::bind_method(_MD("set_property","property"),&VisualScriptPropertySet::set_property); + ClassDB::bind_method(_MD("get_property"),&VisualScriptPropertySet::get_property); - ObjectTypeDB::bind_method(_MD("set_call_mode","mode"),&VisualScriptPropertySet::set_call_mode); - ObjectTypeDB::bind_method(_MD("get_call_mode"),&VisualScriptPropertySet::get_call_mode); + ClassDB::bind_method(_MD("set_call_mode","mode"),&VisualScriptPropertySet::set_call_mode); + ClassDB::bind_method(_MD("get_call_mode"),&VisualScriptPropertySet::get_call_mode); - ObjectTypeDB::bind_method(_MD("set_base_path","base_path"),&VisualScriptPropertySet::set_base_path); - ObjectTypeDB::bind_method(_MD("get_base_path"),&VisualScriptPropertySet::get_base_path); + ClassDB::bind_method(_MD("set_base_path","base_path"),&VisualScriptPropertySet::set_base_path); + ClassDB::bind_method(_MD("get_base_path"),&VisualScriptPropertySet::get_base_path); @@ -1554,7 +1554,7 @@ public: if (!valid) { r_error.error=Variant::CallError::CALL_ERROR_INVALID_METHOD; - r_error_str="Invalid set value '"+String(*p_inputs[0])+"' on property '"+String(property)+"' of type "+object->get_type(); + r_error_str="Invalid set value '"+String(*p_inputs[0])+"' on property '"+String(property)+"' of type "+object->get_class(); } } break; case VisualScriptPropertySet::CALL_MODE_NODE_PATH: { @@ -1579,7 +1579,7 @@ public: if (!valid) { r_error.error=Variant::CallError::CALL_ERROR_INVALID_METHOD; - r_error_str="Invalid set value '"+String(*p_inputs[0])+"' on property '"+String(property)+"' of type "+another->get_type(); + r_error_str="Invalid set value '"+String(*p_inputs[0])+"' on property '"+String(property)+"' of type "+another->get_class(); } } break; @@ -1669,7 +1669,7 @@ void VisualScriptPropertyGet::_update_base_type() { Node* node=_get_base_node(); if (node) { - base_type=node->get_type(); + base_type=node->get_class(); } } else if (call_mode==CALL_MODE_SELF) { @@ -1724,7 +1724,7 @@ StringName VisualScriptPropertyGet::_get_base_type() const { else if (call_mode==CALL_MODE_NODE_PATH && get_visual_script().is_valid()) { Node *path = _get_base_node(); if (path) - return path->get_type(); + return path->get_class(); } @@ -1868,7 +1868,7 @@ void VisualScriptPropertyGet::_update_cache() { node=_get_base_node(); if (node) { - type=node->get_type(); + type=node->get_class(); base_type=type; //cache, too script = node->get_script(); } @@ -1903,7 +1903,7 @@ void VisualScriptPropertyGet::_update_cache() { Variant::Type type_ret; - type_ret=ObjectTypeDB::get_property_type(base_type,property,&valid); + type_ret=ClassDB::get_property_type(base_type,property,&valid); if (valid) { type_cache=type_ret; @@ -2117,30 +2117,30 @@ void VisualScriptPropertyGet::_validate_property(PropertyInfo& property) const { void VisualScriptPropertyGet::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_base_type","base_type"),&VisualScriptPropertyGet::set_base_type); - ObjectTypeDB::bind_method(_MD("get_base_type"),&VisualScriptPropertyGet::get_base_type); + ClassDB::bind_method(_MD("set_base_type","base_type"),&VisualScriptPropertyGet::set_base_type); + ClassDB::bind_method(_MD("get_base_type"),&VisualScriptPropertyGet::get_base_type); - ObjectTypeDB::bind_method(_MD("set_base_script","base_script"),&VisualScriptPropertyGet::set_base_script); - ObjectTypeDB::bind_method(_MD("get_base_script"),&VisualScriptPropertyGet::get_base_script); + ClassDB::bind_method(_MD("set_base_script","base_script"),&VisualScriptPropertyGet::set_base_script); + ClassDB::bind_method(_MD("get_base_script"),&VisualScriptPropertyGet::get_base_script); - ObjectTypeDB::bind_method(_MD("set_basic_type","basic_type"),&VisualScriptPropertyGet::set_basic_type); - ObjectTypeDB::bind_method(_MD("get_basic_type"),&VisualScriptPropertyGet::get_basic_type); + ClassDB::bind_method(_MD("set_basic_type","basic_type"),&VisualScriptPropertyGet::set_basic_type); + ClassDB::bind_method(_MD("get_basic_type"),&VisualScriptPropertyGet::get_basic_type); - ObjectTypeDB::bind_method(_MD("_set_type_cache","type_cache"),&VisualScriptPropertyGet::_set_type_cache); - ObjectTypeDB::bind_method(_MD("_get_type_cache"),&VisualScriptPropertyGet::_get_type_cache); + ClassDB::bind_method(_MD("_set_type_cache","type_cache"),&VisualScriptPropertyGet::_set_type_cache); + ClassDB::bind_method(_MD("_get_type_cache"),&VisualScriptPropertyGet::_get_type_cache); - ObjectTypeDB::bind_method(_MD("set_event_type","event_type"),&VisualScriptPropertyGet::set_event_type); - ObjectTypeDB::bind_method(_MD("get_event_type"),&VisualScriptPropertyGet::get_event_type); + ClassDB::bind_method(_MD("set_event_type","event_type"),&VisualScriptPropertyGet::set_event_type); + ClassDB::bind_method(_MD("get_event_type"),&VisualScriptPropertyGet::get_event_type); - ObjectTypeDB::bind_method(_MD("set_property","property"),&VisualScriptPropertyGet::set_property); - ObjectTypeDB::bind_method(_MD("get_property"),&VisualScriptPropertyGet::get_property); + ClassDB::bind_method(_MD("set_property","property"),&VisualScriptPropertyGet::set_property); + ClassDB::bind_method(_MD("get_property"),&VisualScriptPropertyGet::get_property); - ObjectTypeDB::bind_method(_MD("set_call_mode","mode"),&VisualScriptPropertyGet::set_call_mode); - ObjectTypeDB::bind_method(_MD("get_call_mode"),&VisualScriptPropertyGet::get_call_mode); + ClassDB::bind_method(_MD("set_call_mode","mode"),&VisualScriptPropertyGet::set_call_mode); + ClassDB::bind_method(_MD("get_call_mode"),&VisualScriptPropertyGet::get_call_mode); - ObjectTypeDB::bind_method(_MD("set_base_path","base_path"),&VisualScriptPropertyGet::set_base_path); - ObjectTypeDB::bind_method(_MD("get_base_path"),&VisualScriptPropertyGet::get_base_path); + ClassDB::bind_method(_MD("set_base_path","base_path"),&VisualScriptPropertyGet::set_base_path); + ClassDB::bind_method(_MD("get_base_path"),&VisualScriptPropertyGet::get_base_path); String bt; for(int i=0;i<Variant::VARIANT_MAX;i++) { @@ -2420,8 +2420,8 @@ void VisualScriptEmitSignal::_validate_property(PropertyInfo& property) const { void VisualScriptEmitSignal::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_signal","name"),&VisualScriptEmitSignal::set_signal); - ObjectTypeDB::bind_method(_MD("get_signal"),&VisualScriptEmitSignal::get_signal); + ClassDB::bind_method(_MD("set_signal","name"),&VisualScriptEmitSignal::set_signal); + ClassDB::bind_method(_MD("get_signal"),&VisualScriptEmitSignal::get_signal); ADD_PROPERTY(PropertyInfo(Variant::STRING,"signal/signal"),_SCS("set_signal"),_SCS("get_signal")); diff --git a/modules/visual_script/visual_script_func_nodes.h b/modules/visual_script/visual_script_func_nodes.h index 43ef276cf4..7d33549e21 100644 --- a/modules/visual_script/visual_script_func_nodes.h +++ b/modules/visual_script/visual_script_func_nodes.h @@ -6,7 +6,7 @@ class VisualScriptFunctionCall : public VisualScriptNode { - OBJ_TYPE(VisualScriptFunctionCall,VisualScriptNode) + GDCLASS(VisualScriptFunctionCall,VisualScriptNode) public: enum CallMode { CALL_MODE_SELF, @@ -117,7 +117,7 @@ VARIANT_ENUM_CAST(VisualScriptFunctionCall::RPCCallMode ); class VisualScriptPropertySet : public VisualScriptNode { - OBJ_TYPE(VisualScriptPropertySet,VisualScriptNode) + GDCLASS(VisualScriptPropertySet,VisualScriptNode) public: enum CallMode { CALL_MODE_SELF, @@ -208,7 +208,7 @@ VARIANT_ENUM_CAST(VisualScriptPropertySet::CallMode ); class VisualScriptPropertyGet : public VisualScriptNode { - OBJ_TYPE(VisualScriptPropertyGet,VisualScriptNode) + GDCLASS(VisualScriptPropertyGet,VisualScriptNode) public: enum CallMode { CALL_MODE_SELF, @@ -299,7 +299,7 @@ VARIANT_ENUM_CAST(VisualScriptPropertyGet::CallMode ); class VisualScriptEmitSignal : public VisualScriptNode { - OBJ_TYPE(VisualScriptEmitSignal,VisualScriptNode) + GDCLASS(VisualScriptEmitSignal,VisualScriptNode) private: diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp index 7ada292b13..0ccdfedb81 100644 --- a/modules/visual_script/visual_script_nodes.cpp +++ b/modules/visual_script/visual_script_nodes.cpp @@ -334,7 +334,7 @@ bool VisualScriptOperator::has_input_sequence_port() const{ int VisualScriptOperator::get_input_value_port_count() const{ - return (op==Variant::OP_BIT_NEGATE || op==Variant::OP_NOT || op==Variant::OP_NEGATE) ? 1 : 2; + return (op==Variant::OP_BIT_NEGATE || op==Variant::OP_NOT || op==Variant::OP_NEGATE || op==Variant::OP_POSITIVE) ? 1 : 2; } int VisualScriptOperator::get_output_value_port_count() const{ @@ -361,6 +361,7 @@ PropertyInfo VisualScriptOperator::get_input_value_port_info(int p_idx) const{ {Variant::NIL,Variant::NIL}, //OP_MULTIPLY, {Variant::NIL,Variant::NIL}, //OP_DIVIDE, {Variant::NIL,Variant::NIL}, //OP_NEGATE, + {Variant::NIL,Variant::NIL}, //OP_POSITIVE, {Variant::INT,Variant::INT}, //OP_MODULE, {Variant::STRING,Variant::STRING}, //OP_STRING_CONCAT, //bitwise @@ -403,6 +404,7 @@ PropertyInfo VisualScriptOperator::get_output_value_port_info(int p_idx) const{ Variant::NIL, //OP_MULTIPLY, Variant::NIL, //OP_DIVIDE, Variant::NIL, //OP_NEGATE, + Variant::NIL, //OP_POSITIVE, Variant::INT, //OP_MODULE, Variant::STRING, //OP_STRING_CONCAT, //bitwise @@ -444,6 +446,7 @@ static const char* op_names[]={ "Multiply", //OP_MULTIPLY, "Divide", //OP_DIVIDE, "Negate", //OP_NEGATE, + "Positive", //OP_POSITIVE, "Remainder", //OP_MODULE, "Concat", //OP_STRING_CONCAT, //bitwise @@ -485,6 +488,7 @@ String VisualScriptOperator::get_text() const { L"A x B", //OP_MULTIPLY, L"A \u00F7 B", //OP_DIVIDE, L"\u00AC A", //OP_NEGATE, + L"+ A", //OP_POSITIVE, L"A mod B", //OP_MODULE, L"A .. B", //OP_STRING_CONCAT, //bitwise @@ -535,11 +539,11 @@ Variant::Type VisualScriptOperator::get_typed() const { void VisualScriptOperator::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_operator","op"),&VisualScriptOperator::set_operator); - ObjectTypeDB::bind_method(_MD("get_operator"),&VisualScriptOperator::get_operator); + ClassDB::bind_method(_MD("set_operator","op"),&VisualScriptOperator::set_operator); + ClassDB::bind_method(_MD("get_operator"),&VisualScriptOperator::get_operator); - ObjectTypeDB::bind_method(_MD("set_typed","type"),&VisualScriptOperator::set_typed); - ObjectTypeDB::bind_method(_MD("get_typed"),&VisualScriptOperator::get_typed); + ClassDB::bind_method(_MD("set_typed","type"),&VisualScriptOperator::set_typed); + ClassDB::bind_method(_MD("get_typed"),&VisualScriptOperator::get_typed); String types; for(int i=0;i<Variant::OP_MAX;i++) { @@ -713,8 +717,8 @@ void VisualScriptVariableGet::_validate_property(PropertyInfo& property) const { void VisualScriptVariableGet::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_variable","name"),&VisualScriptVariableGet::set_variable); - ObjectTypeDB::bind_method(_MD("get_variable"),&VisualScriptVariableGet::get_variable); + ClassDB::bind_method(_MD("set_variable","name"),&VisualScriptVariableGet::set_variable); + ClassDB::bind_method(_MD("get_variable"),&VisualScriptVariableGet::get_variable); ADD_PROPERTY(PropertyInfo(Variant::STRING,"variable/name"),_SCS("set_variable"),_SCS("get_variable")); @@ -849,8 +853,8 @@ void VisualScriptVariableSet::_validate_property(PropertyInfo& property) const { void VisualScriptVariableSet::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_variable","name"),&VisualScriptVariableSet::set_variable); - ObjectTypeDB::bind_method(_MD("get_variable"),&VisualScriptVariableSet::get_variable); + ClassDB::bind_method(_MD("set_variable","name"),&VisualScriptVariableSet::set_variable); + ClassDB::bind_method(_MD("get_variable"),&VisualScriptVariableSet::get_variable); ADD_PROPERTY(PropertyInfo(Variant::STRING,"variable/name"),_SCS("set_variable"),_SCS("get_variable")); @@ -991,11 +995,11 @@ void VisualScriptConstant::_validate_property(PropertyInfo& property) const { void VisualScriptConstant::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_constant_type","type"),&VisualScriptConstant::set_constant_type); - ObjectTypeDB::bind_method(_MD("get_constant_type"),&VisualScriptConstant::get_constant_type); + ClassDB::bind_method(_MD("set_constant_type","type"),&VisualScriptConstant::set_constant_type); + ClassDB::bind_method(_MD("get_constant_type"),&VisualScriptConstant::get_constant_type); - ObjectTypeDB::bind_method(_MD("set_constant_value","value"),&VisualScriptConstant::set_constant_value); - ObjectTypeDB::bind_method(_MD("get_constant_value"),&VisualScriptConstant::get_constant_value); + ClassDB::bind_method(_MD("set_constant_value","value"),&VisualScriptConstant::set_constant_value); + ClassDB::bind_method(_MD("get_constant_value"),&VisualScriptConstant::get_constant_value); String argt="Null"; for(int i=1;i<Variant::VARIANT_MAX;i++) { @@ -1074,7 +1078,7 @@ PropertyInfo VisualScriptPreload::get_output_value_port_info(int p_idx) const{ PropertyInfo pinfo=PropertyInfo(Variant::OBJECT,"res"); if (preload.is_valid()) { pinfo.hint=PROPERTY_HINT_RESOURCE_TYPE; - pinfo.hint_string=preload->get_type(); + pinfo.hint_string=preload->get_class(); } return pinfo; @@ -1094,7 +1098,7 @@ String VisualScriptPreload::get_text() const { } else if (preload->get_name()!=String()) { return preload->get_name(); } else { - return preload->get_type(); + return preload->get_class(); } } else { return "<empty>"; @@ -1119,8 +1123,8 @@ Ref<Resource> VisualScriptPreload::get_preload() const{ void VisualScriptPreload::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_preload","resource"),&VisualScriptPreload::set_preload); - ObjectTypeDB::bind_method(_MD("get_preload"),&VisualScriptPreload::get_preload); + ClassDB::bind_method(_MD("set_preload","resource"),&VisualScriptPreload::set_preload); + ClassDB::bind_method(_MD("get_preload"),&VisualScriptPreload::get_preload); ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"resource",PROPERTY_HINT_RESOURCE_TYPE,"Resource"),_SCS("set_preload"),_SCS("get_preload")); @@ -1421,8 +1425,8 @@ VisualScriptNodeInstance* VisualScriptGlobalConstant::instance(VisualScriptInsta void VisualScriptGlobalConstant::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_global_constant","index"),&VisualScriptGlobalConstant::set_global_constant); - ObjectTypeDB::bind_method(_MD("get_global_constant"),&VisualScriptGlobalConstant::get_global_constant); + ClassDB::bind_method(_MD("set_global_constant","index"),&VisualScriptGlobalConstant::set_global_constant); + ClassDB::bind_method(_MD("get_global_constant"),&VisualScriptGlobalConstant::get_global_constant); String cc; @@ -1536,7 +1540,7 @@ public: VisualScriptNodeInstance* VisualScriptClassConstant::instance(VisualScriptInstance* p_instance) { VisualScriptNodeInstanceClassConstant * instance = memnew(VisualScriptNodeInstanceClassConstant ); - instance->value=ObjectTypeDB::get_integer_constant(base_type,name,&instance->valid); + instance->value=ClassDB::get_integer_constant(base_type,name,&instance->valid); return instance; } @@ -1545,7 +1549,7 @@ void VisualScriptClassConstant::_validate_property(PropertyInfo& property) const if (property.name=="constant") { List<String> constants; - ObjectTypeDB::get_integer_constant_list(base_type,&constants,true); + ClassDB::get_integer_constant_list(base_type,&constants,true); property.hint_string=""; for(List<String>::Element *E=constants.front();E;E=E->next()) { @@ -1559,11 +1563,11 @@ void VisualScriptClassConstant::_validate_property(PropertyInfo& property) const void VisualScriptClassConstant::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_class_constant","name"),&VisualScriptClassConstant::set_class_constant); - ObjectTypeDB::bind_method(_MD("get_class_constant"),&VisualScriptClassConstant::get_class_constant); + ClassDB::bind_method(_MD("set_class_constant","name"),&VisualScriptClassConstant::set_class_constant); + ClassDB::bind_method(_MD("get_class_constant"),&VisualScriptClassConstant::get_class_constant); - ObjectTypeDB::bind_method(_MD("set_base_type","name"),&VisualScriptClassConstant::set_base_type); - ObjectTypeDB::bind_method(_MD("get_base_type"),&VisualScriptClassConstant::get_base_type); + ClassDB::bind_method(_MD("set_base_type","name"),&VisualScriptClassConstant::set_base_type); + ClassDB::bind_method(_MD("get_base_type"),&VisualScriptClassConstant::get_base_type); ADD_PROPERTY(PropertyInfo(Variant::STRING,"base_type",PROPERTY_HINT_TYPE_STRING,"Object"),_SCS("set_base_type"),_SCS("get_base_type")); ADD_PROPERTY(PropertyInfo(Variant::STRING,"constant",PROPERTY_HINT_ENUM,""),_SCS("set_class_constant"),_SCS("get_class_constant")); @@ -1699,11 +1703,11 @@ void VisualScriptBasicTypeConstant::_validate_property(PropertyInfo& property) c void VisualScriptBasicTypeConstant::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_basic_type","name"),&VisualScriptBasicTypeConstant::set_basic_type); - ObjectTypeDB::bind_method(_MD("get_basic_type"),&VisualScriptBasicTypeConstant::get_basic_type); + ClassDB::bind_method(_MD("set_basic_type","name"),&VisualScriptBasicTypeConstant::set_basic_type); + ClassDB::bind_method(_MD("get_basic_type"),&VisualScriptBasicTypeConstant::get_basic_type); - ObjectTypeDB::bind_method(_MD("set_basic_type_constant","name"),&VisualScriptBasicTypeConstant::set_basic_type_constant); - ObjectTypeDB::bind_method(_MD("get_basic_type_constant"),&VisualScriptBasicTypeConstant::get_basic_type_constant); + ClassDB::bind_method(_MD("set_basic_type_constant","name"),&VisualScriptBasicTypeConstant::set_basic_type_constant); + ClassDB::bind_method(_MD("get_basic_type_constant"),&VisualScriptBasicTypeConstant::get_basic_type_constant); String argt="Null"; @@ -1827,8 +1831,8 @@ VisualScriptNodeInstance* VisualScriptMathConstant::instance(VisualScriptInstanc void VisualScriptMathConstant::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_math_constant","which"),&VisualScriptMathConstant::set_math_constant); - ObjectTypeDB::bind_method(_MD("get_math_constant"),&VisualScriptMathConstant::get_math_constant); + ClassDB::bind_method(_MD("set_math_constant","which"),&VisualScriptMathConstant::set_math_constant); + ClassDB::bind_method(_MD("get_math_constant"),&VisualScriptMathConstant::get_math_constant); String cc; @@ -1929,17 +1933,17 @@ public: VisualScriptNodeInstance* VisualScriptEngineSingleton::instance(VisualScriptInstance* p_instance) { VisualScriptNodeInstanceEngineSingleton * instance = memnew(VisualScriptNodeInstanceEngineSingleton ); - instance->singleton=Globals::get_singleton()->get_singleton_object(singleton); + instance->singleton=GlobalConfig::get_singleton()->get_singleton_object(singleton); return instance; } VisualScriptEngineSingleton::TypeGuess VisualScriptEngineSingleton::guess_output_type(TypeGuess* p_inputs, int p_output) const { - Object *obj=Globals::get_singleton()->get_singleton_object(singleton); + Object *obj=GlobalConfig::get_singleton()->get_singleton_object(singleton); TypeGuess tg; tg.type=Variant::OBJECT; if (obj) { - tg.obj_type=obj->get_type(); + tg.GDCLASS=obj->get_class(); tg.script=obj->get_script(); } @@ -1949,16 +1953,16 @@ VisualScriptEngineSingleton::TypeGuess VisualScriptEngineSingleton::guess_output void VisualScriptEngineSingleton::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_singleton","name"),&VisualScriptEngineSingleton::set_singleton); - ObjectTypeDB::bind_method(_MD("get_singleton"),&VisualScriptEngineSingleton::get_singleton); + ClassDB::bind_method(_MD("set_singleton","name"),&VisualScriptEngineSingleton::set_singleton); + ClassDB::bind_method(_MD("get_singleton"),&VisualScriptEngineSingleton::get_singleton); String cc; - List<Globals::Singleton> singletons; + List<GlobalConfig::Singleton> singletons; - Globals::get_singleton()->get_singletons(&singletons); + GlobalConfig::get_singleton()->get_singletons(&singletons); - for (List<Globals::Singleton>::Element *E=singletons.front();E;E=E->next()) { + for (List<GlobalConfig::Singleton>::Element *E=singletons.front();E;E=E->next()) { if (E->get().name=="VS" || E->get().name=="PS" || E->get().name=="PS2D" || E->get().name=="AS" || E->get().name=="TS" || E->get().name=="SS" || E->get().name=="SS2D") continue; //skip these, too simple named @@ -2113,7 +2117,7 @@ VisualScriptSceneNode::TypeGuess VisualScriptSceneNode::guess_output_type(TypeGu VisualScriptSceneNode::TypeGuess tg; tg.type=Variant::OBJECT; - tg.obj_type="Node"; + tg.GDCLASS="Node"; #ifdef TOOLS_ENABLED Ref<Script> script = get_visual_script(); @@ -2142,7 +2146,7 @@ VisualScriptSceneNode::TypeGuess VisualScriptSceneNode::guess_output_type(TypeGu Node* another = script_node->get_node(path); if (another) { - tg.obj_type=another->get_type(); + tg.GDCLASS=another->get_class(); tg.script=another->get_script(); } #endif @@ -2186,8 +2190,8 @@ void VisualScriptSceneNode::_validate_property(PropertyInfo& property) const { void VisualScriptSceneNode::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_node_path","path"),&VisualScriptSceneNode::set_node_path); - ObjectTypeDB::bind_method(_MD("get_node_path"),&VisualScriptSceneNode::get_node_path); + ClassDB::bind_method(_MD("set_node_path","path"),&VisualScriptSceneNode::set_node_path); + ClassDB::bind_method(_MD("get_node_path"),&VisualScriptSceneNode::get_node_path); ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH,"node_path",PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE),_SCS("set_node_path"),_SCS("get_node_path")); } @@ -2292,7 +2296,7 @@ VisualScriptSceneTree::TypeGuess VisualScriptSceneTree::guess_output_type(TypeGu TypeGuess tg; tg.type=Variant::OBJECT; - tg.obj_type="SceneTree"; + tg.GDCLASS="SceneTree"; return tg; } @@ -2397,8 +2401,8 @@ VisualScriptNodeInstance* VisualScriptResourcePath::instance(VisualScriptInstanc void VisualScriptResourcePath::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_resource_path","path"),&VisualScriptResourcePath::set_resource_path); - ObjectTypeDB::bind_method(_MD("get_resource_path"),&VisualScriptResourcePath::get_resource_path); + ClassDB::bind_method(_MD("set_resource_path","path"),&VisualScriptResourcePath::set_resource_path); + ClassDB::bind_method(_MD("get_resource_path"),&VisualScriptResourcePath::get_resource_path); ADD_PROPERTY(PropertyInfo(Variant::STRING,"path",PROPERTY_HINT_FILE),_SCS("set_resource_path"),_SCS("get_resource_path")); } @@ -2490,13 +2494,13 @@ VisualScriptSelf::TypeGuess VisualScriptSelf::guess_output_type(TypeGuess* p_inp VisualScriptSceneNode::TypeGuess tg; tg.type=Variant::OBJECT; - tg.obj_type="Object"; + tg.GDCLASS="Object"; Ref<Script> script = get_visual_script(); if (!script.is_valid()) return tg; - tg.obj_type=script->get_instance_base_type(); + tg.GDCLASS=script->get_instance_base_type(); tg.script=script; return tg; @@ -2813,7 +2817,7 @@ String VisualScriptSubCall::get_text() const { return script->get_name(); if (script->get_path().is_resource_file()) return script->get_path().get_file(); - return script->get_type(); + return script->get_class(); } return ""; } @@ -2997,14 +3001,14 @@ VisualScriptNodeInstance* VisualScriptComment::instance(VisualScriptInstance* p_ void VisualScriptComment::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_title","title"),&VisualScriptComment::set_title); - ObjectTypeDB::bind_method(_MD("get_title"),&VisualScriptComment::get_title); + ClassDB::bind_method(_MD("set_title","title"),&VisualScriptComment::set_title); + ClassDB::bind_method(_MD("get_title"),&VisualScriptComment::get_title); - ObjectTypeDB::bind_method(_MD("set_description","description"),&VisualScriptComment::set_description); - ObjectTypeDB::bind_method(_MD("get_description"),&VisualScriptComment::get_description); + ClassDB::bind_method(_MD("set_description","description"),&VisualScriptComment::set_description); + ClassDB::bind_method(_MD("get_description"),&VisualScriptComment::get_description); - ObjectTypeDB::bind_method(_MD("set_size","size"),&VisualScriptComment::set_size); - ObjectTypeDB::bind_method(_MD("get_size"),&VisualScriptComment::get_size); + ClassDB::bind_method(_MD("set_size","size"),&VisualScriptComment::set_size); + ClassDB::bind_method(_MD("get_size"),&VisualScriptComment::get_size); ADD_PROPERTY( PropertyInfo(Variant::STRING,"title"),_SCS("set_title"),_SCS("get_title")); ADD_PROPERTY( PropertyInfo(Variant::STRING,"description",PROPERTY_HINT_MULTILINE_TEXT),_SCS("set_description"),_SCS("get_description")); @@ -3136,11 +3140,11 @@ VisualScriptNodeInstance* VisualScriptConstructor::instance(VisualScriptInstance void VisualScriptConstructor::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_constructor_type","type"),&VisualScriptConstructor::set_constructor_type); - ObjectTypeDB::bind_method(_MD("get_constructor_type"),&VisualScriptConstructor::get_constructor_type); + ClassDB::bind_method(_MD("set_constructor_type","type"),&VisualScriptConstructor::set_constructor_type); + ClassDB::bind_method(_MD("get_constructor_type"),&VisualScriptConstructor::get_constructor_type); - ObjectTypeDB::bind_method(_MD("set_constructor","constructor"),&VisualScriptConstructor::set_constructor); - ObjectTypeDB::bind_method(_MD("get_constructor"),&VisualScriptConstructor::get_constructor); + ClassDB::bind_method(_MD("set_constructor","constructor"),&VisualScriptConstructor::set_constructor); + ClassDB::bind_method(_MD("get_constructor"),&VisualScriptConstructor::get_constructor); ADD_PROPERTY( PropertyInfo(Variant::INT,"type",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_constructor_type"),_SCS("get_constructor_type")); ADD_PROPERTY( PropertyInfo(Variant::DICTIONARY,"constructor",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_constructor"),_SCS("get_constructor")); @@ -3279,11 +3283,11 @@ VisualScriptNodeInstance* VisualScriptLocalVar::instance(VisualScriptInstance* p void VisualScriptLocalVar::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_var_name","name"),&VisualScriptLocalVar::set_var_name); - ObjectTypeDB::bind_method(_MD("get_var_name"),&VisualScriptLocalVar::get_var_name); + ClassDB::bind_method(_MD("set_var_name","name"),&VisualScriptLocalVar::set_var_name); + ClassDB::bind_method(_MD("get_var_name"),&VisualScriptLocalVar::get_var_name); - ObjectTypeDB::bind_method(_MD("set_var_type","type"),&VisualScriptLocalVar::set_var_type); - ObjectTypeDB::bind_method(_MD("get_var_type"),&VisualScriptLocalVar::get_var_type); + ClassDB::bind_method(_MD("set_var_type","type"),&VisualScriptLocalVar::set_var_type); + ClassDB::bind_method(_MD("get_var_type"),&VisualScriptLocalVar::get_var_type); String argt="Any"; for(int i=1;i<Variant::VARIANT_MAX;i++) { @@ -3416,11 +3420,11 @@ VisualScriptNodeInstance* VisualScriptLocalVarSet::instance(VisualScriptInstance void VisualScriptLocalVarSet::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_var_name","name"),&VisualScriptLocalVarSet::set_var_name); - ObjectTypeDB::bind_method(_MD("get_var_name"),&VisualScriptLocalVarSet::get_var_name); + ClassDB::bind_method(_MD("set_var_name","name"),&VisualScriptLocalVarSet::set_var_name); + ClassDB::bind_method(_MD("get_var_name"),&VisualScriptLocalVarSet::get_var_name); - ObjectTypeDB::bind_method(_MD("set_var_type","type"),&VisualScriptLocalVarSet::set_var_type); - ObjectTypeDB::bind_method(_MD("get_var_type"),&VisualScriptLocalVarSet::get_var_type); + ClassDB::bind_method(_MD("set_var_type","type"),&VisualScriptLocalVarSet::set_var_type); + ClassDB::bind_method(_MD("get_var_type"),&VisualScriptLocalVarSet::get_var_type); String argt="Any"; for(int i=1;i<Variant::VARIANT_MAX;i++) { @@ -3596,7 +3600,7 @@ void VisualScriptInputAction::_validate_property(PropertyInfo& property) const { String actions; List<PropertyInfo> pinfo; - Globals::get_singleton()->get_property_list(&pinfo); + GlobalConfig::get_singleton()->get_property_list(&pinfo); Vector<String> al; for(List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) { @@ -3626,11 +3630,11 @@ void VisualScriptInputAction::_validate_property(PropertyInfo& property) const { void VisualScriptInputAction::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_action_name","name"),&VisualScriptInputAction::set_action_name); - ObjectTypeDB::bind_method(_MD("get_action_name"),&VisualScriptInputAction::get_action_name); + ClassDB::bind_method(_MD("set_action_name","name"),&VisualScriptInputAction::set_action_name); + ClassDB::bind_method(_MD("get_action_name"),&VisualScriptInputAction::get_action_name); - ObjectTypeDB::bind_method(_MD("set_action_mode","mode"),&VisualScriptInputAction::set_action_mode); - ObjectTypeDB::bind_method(_MD("get_action_mode"),&VisualScriptInputAction::get_action_mode); + ClassDB::bind_method(_MD("set_action_mode","mode"),&VisualScriptInputAction::set_action_mode); + ClassDB::bind_method(_MD("get_action_mode"),&VisualScriptInputAction::get_action_mode); ADD_PROPERTY( PropertyInfo(Variant::STRING,"action"),_SCS("set_action_name"),_SCS("get_action_name")); ADD_PROPERTY( PropertyInfo(Variant::INT,"mode",PROPERTY_HINT_ENUM,"Pressed,Released,JustPressed,JustReleased"),_SCS("set_action_mode"),_SCS("get_action_mode")); @@ -3830,21 +3834,21 @@ void VisualScriptDeconstruct::_validate_property(PropertyInfo& property) const { void VisualScriptDeconstruct::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_deconstruct_type","type"),&VisualScriptDeconstruct::set_deconstruct_type); - ObjectTypeDB::bind_method(_MD("get_deconstruct_type"),&VisualScriptDeconstruct::get_deconstruct_type); + ClassDB::bind_method(_MD("set_deconstruct_type","type"),&VisualScriptDeconstruct::set_deconstruct_type); + ClassDB::bind_method(_MD("get_deconstruct_type"),&VisualScriptDeconstruct::get_deconstruct_type); - ObjectTypeDB::bind_method(_MD("set_deconstruct_input_type","input_type"),&VisualScriptDeconstruct::set_deconstruct_input_type); - ObjectTypeDB::bind_method(_MD("get_deconstruct_input_type"),&VisualScriptDeconstruct::get_deconstruct_input_type); + ClassDB::bind_method(_MD("set_deconstruct_input_type","input_type"),&VisualScriptDeconstruct::set_deconstruct_input_type); + ClassDB::bind_method(_MD("get_deconstruct_input_type"),&VisualScriptDeconstruct::get_deconstruct_input_type); - ObjectTypeDB::bind_method(_MD("_set_elem_cache","_cache"),&VisualScriptDeconstruct::_set_elem_cache); - ObjectTypeDB::bind_method(_MD("_get_elem_cache"),&VisualScriptDeconstruct::_get_elem_cache); + ClassDB::bind_method(_MD("_set_elem_cache","_cache"),&VisualScriptDeconstruct::_set_elem_cache); + ClassDB::bind_method(_MD("_get_elem_cache"),&VisualScriptDeconstruct::_get_elem_cache); String argt="Any"; for(int i=1;i<Variant::VARIANT_MAX;i++) { argt+=","+Variant::get_type_name(Variant::Type(i)); } - String iet="None,Key,MouseMotion,MouseButton,JoystickMotion,JoystickButton,ScreenTouch,ScreenDrag,Action"; + String iet="None,Key,MouseMotion,MouseButton,JoypadMotion,JoypadButton,ScreenTouch,ScreenDrag,Action"; ADD_PROPERTY( PropertyInfo(Variant::INT,"type",PROPERTY_HINT_ENUM,argt),_SCS("set_deconstruct_type"),_SCS("get_deconstruct_type")); ADD_PROPERTY( PropertyInfo(Variant::INT,"input_type",PROPERTY_HINT_ENUM,iet),_SCS("set_deconstruct_input_type"),_SCS("get_deconstruct_input_type")); @@ -3900,6 +3904,7 @@ void register_visual_script_nodes() { VisualScriptLanguage::singleton->add_register_func("operators/math/multiply",create_op_node<Variant::OP_MULTIPLY>); VisualScriptLanguage::singleton->add_register_func("operators/math/divide",create_op_node<Variant::OP_DIVIDE>); VisualScriptLanguage::singleton->add_register_func("operators/math/negate",create_op_node<Variant::OP_NEGATE>); + VisualScriptLanguage::singleton->add_register_func("operators/math/positive",create_op_node<Variant::OP_POSITIVE>); VisualScriptLanguage::singleton->add_register_func("operators/math/remainder",create_op_node<Variant::OP_MODULE>); VisualScriptLanguage::singleton->add_register_func("operators/math/string_concat",create_op_node<Variant::OP_STRING_CONCAT>); //bitwise diff --git a/modules/visual_script/visual_script_nodes.h b/modules/visual_script/visual_script_nodes.h index 94eeadca57..7a06fbf5e8 100644 --- a/modules/visual_script/visual_script_nodes.h +++ b/modules/visual_script/visual_script_nodes.h @@ -5,7 +5,7 @@ class VisualScriptFunction : public VisualScriptNode { - OBJ_TYPE(VisualScriptFunction,VisualScriptNode) + GDCLASS(VisualScriptFunction,VisualScriptNode) struct Argument { @@ -72,7 +72,7 @@ public: class VisualScriptOperator : public VisualScriptNode { - OBJ_TYPE(VisualScriptOperator,VisualScriptNode) + GDCLASS(VisualScriptOperator,VisualScriptNode) Variant::Type typed; @@ -114,7 +114,7 @@ public: class VisualScriptVariableGet : public VisualScriptNode { - OBJ_TYPE(VisualScriptVariableGet,VisualScriptNode) + GDCLASS(VisualScriptVariableGet,VisualScriptNode) StringName variable; @@ -153,7 +153,7 @@ public: class VisualScriptVariableSet : public VisualScriptNode { - OBJ_TYPE(VisualScriptVariableSet,VisualScriptNode) + GDCLASS(VisualScriptVariableSet,VisualScriptNode) StringName variable; @@ -192,7 +192,7 @@ public: class VisualScriptConstant : public VisualScriptNode { - OBJ_TYPE(VisualScriptConstant,VisualScriptNode) + GDCLASS(VisualScriptConstant,VisualScriptNode) Variant::Type type; @@ -236,7 +236,7 @@ public: class VisualScriptPreload : public VisualScriptNode { - OBJ_TYPE(VisualScriptPreload,VisualScriptNode) + GDCLASS(VisualScriptPreload,VisualScriptNode) Ref<Resource> preload; @@ -274,7 +274,7 @@ public: class VisualScriptIndexGet : public VisualScriptNode { - OBJ_TYPE(VisualScriptIndexGet,VisualScriptNode) + GDCLASS(VisualScriptIndexGet,VisualScriptNode) public: @@ -305,7 +305,7 @@ public: class VisualScriptIndexSet : public VisualScriptNode { - OBJ_TYPE(VisualScriptIndexSet,VisualScriptNode) + GDCLASS(VisualScriptIndexSet,VisualScriptNode) public: @@ -337,7 +337,7 @@ public: class VisualScriptGlobalConstant : public VisualScriptNode { - OBJ_TYPE(VisualScriptGlobalConstant,VisualScriptNode) + GDCLASS(VisualScriptGlobalConstant,VisualScriptNode) int index; @@ -373,7 +373,7 @@ public: class VisualScriptClassConstant : public VisualScriptNode { - OBJ_TYPE(VisualScriptClassConstant,VisualScriptNode) + GDCLASS(VisualScriptClassConstant,VisualScriptNode) StringName base_type; StringName name; @@ -414,7 +414,7 @@ public: class VisualScriptBasicTypeConstant : public VisualScriptNode { - OBJ_TYPE(VisualScriptBasicTypeConstant,VisualScriptNode) + GDCLASS(VisualScriptBasicTypeConstant,VisualScriptNode) Variant::Type type; StringName name; @@ -457,7 +457,7 @@ public: class VisualScriptMathConstant : public VisualScriptNode { - OBJ_TYPE(VisualScriptMathConstant,VisualScriptNode) + GDCLASS(VisualScriptMathConstant,VisualScriptNode) public: enum MathConstant { @@ -508,7 +508,7 @@ VARIANT_ENUM_CAST( VisualScriptMathConstant::MathConstant ) class VisualScriptEngineSingleton : public VisualScriptNode { - OBJ_TYPE(VisualScriptEngineSingleton,VisualScriptNode) + GDCLASS(VisualScriptEngineSingleton,VisualScriptNode) String singleton; @@ -549,7 +549,7 @@ public: class VisualScriptSceneNode : public VisualScriptNode { - OBJ_TYPE(VisualScriptSceneNode,VisualScriptNode) + GDCLASS(VisualScriptSceneNode,VisualScriptNode) NodePath path; protected: @@ -590,7 +590,7 @@ public: class VisualScriptSceneTree : public VisualScriptNode { - OBJ_TYPE(VisualScriptSceneTree,VisualScriptNode) + GDCLASS(VisualScriptSceneTree,VisualScriptNode) protected: @@ -627,7 +627,7 @@ public: class VisualScriptResourcePath : public VisualScriptNode { - OBJ_TYPE(VisualScriptResourcePath,VisualScriptNode) + GDCLASS(VisualScriptResourcePath,VisualScriptNode) String path; protected: @@ -664,7 +664,7 @@ public: class VisualScriptSelf : public VisualScriptNode { - OBJ_TYPE(VisualScriptSelf,VisualScriptNode) + GDCLASS(VisualScriptSelf,VisualScriptNode) protected: @@ -701,13 +701,11 @@ public: class VisualScriptCustomNode: public VisualScriptNode { - OBJ_TYPE(VisualScriptCustomNode,VisualScriptNode) + GDCLASS(VisualScriptCustomNode,VisualScriptNode) protected: - virtual bool _use_builtin_script() const { return true; } - static void _bind_methods(); public: @@ -752,7 +750,7 @@ public: class VisualScriptSubCall: public VisualScriptNode { - OBJ_TYPE(VisualScriptSubCall,VisualScriptNode) + GDCLASS(VisualScriptSubCall,VisualScriptNode) protected: @@ -785,7 +783,7 @@ public: class VisualScriptComment: public VisualScriptNode { - OBJ_TYPE(VisualScriptComment,VisualScriptNode) + GDCLASS(VisualScriptComment,VisualScriptNode) String title; @@ -829,7 +827,7 @@ public: class VisualScriptConstructor: public VisualScriptNode { - OBJ_TYPE(VisualScriptConstructor,VisualScriptNode) + GDCLASS(VisualScriptConstructor,VisualScriptNode) Variant::Type type; @@ -874,7 +872,7 @@ public: class VisualScriptLocalVar: public VisualScriptNode { - OBJ_TYPE(VisualScriptLocalVar,VisualScriptNode) + GDCLASS(VisualScriptLocalVar,VisualScriptNode) StringName name; Variant::Type type; @@ -914,7 +912,7 @@ public: class VisualScriptLocalVarSet: public VisualScriptNode { - OBJ_TYPE(VisualScriptLocalVarSet,VisualScriptNode) + GDCLASS(VisualScriptLocalVarSet,VisualScriptNode) StringName name; Variant::Type type; @@ -956,7 +954,7 @@ public: class VisualScriptInputAction: public VisualScriptNode { - OBJ_TYPE(VisualScriptInputAction,VisualScriptNode) + GDCLASS(VisualScriptInputAction,VisualScriptNode) public: enum Mode { MODE_PRESSED, @@ -1007,7 +1005,7 @@ VARIANT_ENUM_CAST( VisualScriptInputAction::Mode ) class VisualScriptDeconstruct: public VisualScriptNode { - OBJ_TYPE(VisualScriptDeconstruct,VisualScriptNode) + GDCLASS(VisualScriptDeconstruct,VisualScriptNode) struct Element { diff --git a/modules/visual_script/visual_script_yield_nodes.cpp b/modules/visual_script/visual_script_yield_nodes.cpp index 221c46b6fd..8b251e667c 100644 --- a/modules/visual_script/visual_script_yield_nodes.cpp +++ b/modules/visual_script/visual_script_yield_nodes.cpp @@ -157,11 +157,11 @@ void VisualScriptYield::_validate_property(PropertyInfo& property) const { void VisualScriptYield::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_yield_mode","mode"),&VisualScriptYield::set_yield_mode); - ObjectTypeDB::bind_method(_MD("get_yield_mode"),&VisualScriptYield::get_yield_mode); + ClassDB::bind_method(_MD("set_yield_mode","mode"),&VisualScriptYield::set_yield_mode); + ClassDB::bind_method(_MD("get_yield_mode"),&VisualScriptYield::get_yield_mode); - ObjectTypeDB::bind_method(_MD("set_wait_time","sec"),&VisualScriptYield::set_wait_time); - ObjectTypeDB::bind_method(_MD("get_wait_time"),&VisualScriptYield::get_wait_time); + ClassDB::bind_method(_MD("set_wait_time","sec"),&VisualScriptYield::set_wait_time); + ClassDB::bind_method(_MD("get_wait_time"),&VisualScriptYield::get_wait_time); ADD_PROPERTY(PropertyInfo(Variant::INT,"mode",PROPERTY_HINT_ENUM,"Frame,FixedFrame,Time",PROPERTY_USAGE_NOEDITOR),_SCS("set_yield_mode"),_SCS("get_yield_mode")); ADD_PROPERTY(PropertyInfo(Variant::REAL,"wait_time"),_SCS("set_wait_time"),_SCS("get_wait_time")); @@ -270,7 +270,7 @@ StringName VisualScriptYieldSignal::_get_base_type() const { else if (call_mode==CALL_MODE_NODE_PATH && get_visual_script().is_valid()) { Node *path = _get_base_node(); if (path) - return path->get_type(); + return path->get_class(); } @@ -290,7 +290,7 @@ int VisualScriptYieldSignal::get_output_value_port_count() const{ MethodInfo sr; - if (!ObjectTypeDB::get_signal(_get_base_type(),signal,&sr)) + if (!ClassDB::get_signal(_get_base_type(),signal,&sr)) return 0; return sr.arguments.size(); @@ -315,7 +315,7 @@ PropertyInfo VisualScriptYieldSignal::get_output_value_port_info(int p_idx) cons MethodInfo sr; - if (!ObjectTypeDB::get_signal(_get_base_type(),signal,&sr)) + if (!ClassDB::get_signal(_get_base_type(),signal,&sr)) return PropertyInfo(); //no signal ERR_FAIL_INDEX_V(p_idx,sr.arguments.size(),PropertyInfo()); return sr.arguments[p_idx]; @@ -440,7 +440,7 @@ void VisualScriptYieldSignal::_validate_property(PropertyInfo& property) const { List<MethodInfo> methods; - ObjectTypeDB::get_signal_list(_get_base_type(),&methods); + ClassDB::get_signal_list(_get_base_type(),&methods); List<String> mstring; for (List<MethodInfo>::Element *E=methods.front();E;E=E->next()) { @@ -468,17 +468,17 @@ void VisualScriptYieldSignal::_validate_property(PropertyInfo& property) const { void VisualScriptYieldSignal::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_base_type","base_type"),&VisualScriptYieldSignal::set_base_type); - ObjectTypeDB::bind_method(_MD("get_base_type"),&VisualScriptYieldSignal::get_base_type); + ClassDB::bind_method(_MD("set_base_type","base_type"),&VisualScriptYieldSignal::set_base_type); + ClassDB::bind_method(_MD("get_base_type"),&VisualScriptYieldSignal::get_base_type); - ObjectTypeDB::bind_method(_MD("set_signal","signal"),&VisualScriptYieldSignal::set_signal); - ObjectTypeDB::bind_method(_MD("get_signal"),&VisualScriptYieldSignal::get_signal); + ClassDB::bind_method(_MD("set_signal","signal"),&VisualScriptYieldSignal::set_signal); + ClassDB::bind_method(_MD("get_signal"),&VisualScriptYieldSignal::get_signal); - ObjectTypeDB::bind_method(_MD("set_call_mode","mode"),&VisualScriptYieldSignal::set_call_mode); - ObjectTypeDB::bind_method(_MD("get_call_mode"),&VisualScriptYieldSignal::get_call_mode); + ClassDB::bind_method(_MD("set_call_mode","mode"),&VisualScriptYieldSignal::set_call_mode); + ClassDB::bind_method(_MD("get_call_mode"),&VisualScriptYieldSignal::get_call_mode); - ObjectTypeDB::bind_method(_MD("set_base_path","base_path"),&VisualScriptYieldSignal::set_base_path); - ObjectTypeDB::bind_method(_MD("get_base_path"),&VisualScriptYieldSignal::get_base_path); + ClassDB::bind_method(_MD("set_base_path","base_path"),&VisualScriptYieldSignal::set_base_path); + ClassDB::bind_method(_MD("get_base_path"),&VisualScriptYieldSignal::get_base_path); diff --git a/modules/visual_script/visual_script_yield_nodes.h b/modules/visual_script/visual_script_yield_nodes.h index ae7f8c15c1..210d6ec995 100644 --- a/modules/visual_script/visual_script_yield_nodes.h +++ b/modules/visual_script/visual_script_yield_nodes.h @@ -5,7 +5,7 @@ class VisualScriptYield : public VisualScriptNode { - OBJ_TYPE(VisualScriptYield,VisualScriptNode) + GDCLASS(VisualScriptYield,VisualScriptNode) public: enum YieldMode { @@ -60,7 +60,7 @@ VARIANT_ENUM_CAST( VisualScriptYield::YieldMode ) class VisualScriptYieldSignal : public VisualScriptNode { - OBJ_TYPE(VisualScriptYieldSignal,VisualScriptNode) + GDCLASS(VisualScriptYieldSignal,VisualScriptNode) public: enum CallMode { CALL_MODE_SELF, diff --git a/modules/vorbis/audio_stream_ogg_vorbis.cpp b/modules/vorbis/audio_stream_ogg_vorbis.cpp index 4ce7940a01..7abcd0a8b7 100644 --- a/modules/vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/vorbis/audio_stream_ogg_vorbis.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/vorbis/audio_stream_ogg_vorbis.h b/modules/vorbis/audio_stream_ogg_vorbis.h index 8d8d7392b5..bc2bfa2ae6 100644 --- a/modules/vorbis/audio_stream_ogg_vorbis.h +++ b/modules/vorbis/audio_stream_ogg_vorbis.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -38,7 +38,7 @@ class AudioStreamPlaybackOGGVorbis : public AudioStreamPlayback { - OBJ_TYPE(AudioStreamPlaybackOGGVorbis,AudioStreamPlayback); + GDCLASS(AudioStreamPlaybackOGGVorbis,AudioStreamPlayback); enum { MIN_MIX=1024 @@ -115,7 +115,7 @@ public: class AudioStreamOGGVorbis : public AudioStream { - OBJ_TYPE(AudioStreamOGGVorbis,AudioStream); + GDCLASS(AudioStreamOGGVorbis,AudioStream); String file; public: diff --git a/modules/vorbis/register_types.cpp b/modules/vorbis/register_types.cpp index ae63b5af3c..de929d9350 100644 --- a/modules/vorbis/register_types.cpp +++ b/modules/vorbis/register_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ void register_vorbis_types() { vorbis_stream_loader = memnew( ResourceFormatLoaderAudioStreamOGGVorbis ); ResourceLoader::add_resource_format_loader(vorbis_stream_loader); - ObjectTypeDB::register_type<AudioStreamOGGVorbis>(); + ClassDB::register_class<AudioStreamOGGVorbis>(); } void unregister_vorbis_types() { diff --git a/modules/vorbis/register_types.h b/modules/vorbis/register_types.h index 6baaed7ce8..b2adb55acd 100644 --- a/modules/vorbis/register_types.h +++ b/modules/vorbis/register_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/webm/libvpx/SCsub b/modules/webm/libvpx/SCsub index 365cabd072..241d6e30cd 100644 --- a/modules/webm/libvpx/SCsub +++ b/modules/webm/libvpx/SCsub @@ -263,14 +263,17 @@ if env["platform"] == 'uwp': else: webm_cpu_x86 = True else: + import platform + is_x11_or_server_arm = ((env["platform"] == 'x11' or env["platform"] == 'server') and platform.machine().startswith('arm')) + is_ios_x86 = (env["platform"] == 'iphone' and env["ios_sim"] == "yes") is_android_x86 = (env["platform"] == 'android' and env["android_arch"] == 'x86') if is_android_x86: cpu_bits = '32' if osx_fat: webm_cpu_x86 = True else: - webm_cpu_x86 = (cpu_bits == '32' or cpu_bits == '64') and (env["platform"] == 'windows' or env["platform"] == 'x11' or env["platform"] == 'osx' or env["platform"] == 'haiku' or is_android_x86) - webm_cpu_arm = env["platform"] == 'iphone' or env["platform"] == 'bb10' or (env["platform"] == 'android' and env["android_arch"] != 'x86') + webm_cpu_x86 = not is_x11_or_server_arm and (cpu_bits == '32' or cpu_bits == '64') and (env["platform"] == 'windows' or env["platform"] == 'x11' or env["platform"] == 'osx' or env["platform"] == 'haiku' or is_android_x86 or is_ios_x86) + webm_cpu_arm = is_x11_or_server_arm or (not is_ios_x86 and env["platform"] == 'iphone') or env["platform"] == 'bb10' or (not is_android_x86 and env["platform"] == 'android') if webm_cpu_x86: import subprocess @@ -308,7 +311,7 @@ if webm_cpu_x86: else: if env["platform"] == 'windows' or env["platform"] == 'uwp': env_libvpx["ASFORMAT"] = 'win' - elif env["platform"] == 'osx': + elif env["platform"] == 'osx' or env["platform"] == "iphone": env_libvpx["ASFORMAT"] = 'macho' else: env_libvpx["ASFORMAT"] = 'elf' @@ -330,7 +333,7 @@ if webm_cpu_x86: if webm_cpu_arm: if env["platform"] == 'iphone': env_libvpx["ASFLAGS"] = '-arch armv7' - elif env["platform"] == 'android': + elif env["platform"] == 'android' or env["platform"] == 'x11' or env["platform"] == 'server': env_libvpx["ASFLAGS"] = '-mfpu=neon' elif env["platform"] == 'uwp': env_libvpx["AS"] = 'armasm' diff --git a/modules/webm/register_types.cpp b/modules/webm/register_types.cpp index 07031caad1..e50eb337ae 100644 --- a/modules/webm/register_types.cpp +++ b/modules/webm/register_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ void register_webm_types() { webm_stream_loader = memnew(ResourceFormatLoaderVideoStreamWebm); ResourceLoader::add_resource_format_loader(webm_stream_loader); - ObjectTypeDB::register_type<VideoStreamWebm>(); + ClassDB::register_class<VideoStreamWebm>(); } void unregister_webm_types() { diff --git a/modules/webm/register_types.h b/modules/webm/register_types.h index 62f08646a4..3df0d7bbaa 100644 --- a/modules/webm/register_types.h +++ b/modules/webm/register_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/webm/video_stream_webm.cpp b/modules/webm/video_stream_webm.cpp index dc2266804d..d132e89690 100644 --- a/modules/webm/video_stream_webm.cpp +++ b/modules/webm/video_stream_webm.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -127,7 +127,7 @@ bool VideoStreamPlaybackWebm::open_file(const String &p_file) { } frame_data.resize((webm->getWidth() * webm->getHeight()) << 2); - texture->create(webm->getWidth(), webm->getHeight(), Image::FORMAT_RGBA, Texture::FLAG_FILTER | Texture::FLAG_VIDEO_SURFACE); + texture->create(webm->getWidth(), webm->getHeight(), Image::FORMAT_RGBA8, Texture::FLAG_FILTER | Texture::FLAG_VIDEO_SURFACE); return true; } @@ -167,7 +167,7 @@ void VideoStreamPlaybackWebm::play() { stop(); - delay_compensation = Globals::get_singleton()->get("audio/video_delay_compensation_ms"); + delay_compensation = GlobalConfig::get_singleton()->get("audio/video_delay_compensation_ms"); delay_compensation /= 1000.0; playing = true; @@ -293,7 +293,7 @@ void VideoStreamPlaybackWebm::update(float p_delta) { if (err == VPXDecoder::NO_ERROR && image.w == webm->getWidth() && image.h == webm->getHeight()) { - DVector<uint8_t>::Write w = frame_data.write(); + PoolVector<uint8_t>::Write w = frame_data.write(); bool converted = false; if (image.chromaShiftW == 1 && image.chromaShiftH == 1) { @@ -318,7 +318,7 @@ void VideoStreamPlaybackWebm::update(float p_delta) { } if (converted) - texture->set_data(Image(image.w, image.h, 0, Image::FORMAT_RGBA, frame_data)); //Zero copy send to visual server + texture->set_data(Image(image.w, image.h, 0, Image::FORMAT_RGBA8, frame_data)); //Zero copy send to visual server } break; diff --git a/modules/webm/video_stream_webm.h b/modules/webm/video_stream_webm.h index d1e02d0663..cb4ef53f6d 100644 --- a/modules/webm/video_stream_webm.h +++ b/modules/webm/video_stream_webm.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ class OpusVorbisDecoder; class VideoStreamPlaybackWebm : public VideoStreamPlayback { - OBJ_TYPE(VideoStreamPlaybackWebm, VideoStreamPlayback) + GDCLASS(VideoStreamPlaybackWebm, VideoStreamPlayback) String file_name; int audio_track; @@ -56,7 +56,7 @@ class VideoStreamPlaybackWebm : public VideoStreamPlayback { double delay_compensation; double time, video_frame_delay, video_pos; - DVector<uint8_t> frame_data; + PoolVector<uint8_t> frame_data; Ref<ImageTexture> texture; int16_t *pcm; @@ -102,7 +102,7 @@ private: class VideoStreamWebm : public VideoStream { - OBJ_TYPE(VideoStreamWebm, VideoStream) + GDCLASS(VideoStreamWebm, VideoStream) String file; int audio_track; diff --git a/modules/webp/image_loader_webp.cpp b/modules/webp/image_loader_webp.cpp index 0fe2db3261..3508c6a663 100644 --- a/modules/webp/image_loader_webp.cpp +++ b/modules/webp/image_loader_webp.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,48 +36,48 @@ #include <webp/decode.h> #include <webp/encode.h> -static DVector<uint8_t> _webp_lossy_pack(const Image& p_image,float p_quality) { +static PoolVector<uint8_t> _webp_lossy_pack(const Image& p_image,float p_quality) { - ERR_FAIL_COND_V(p_image.empty(),DVector<uint8_t>()); + ERR_FAIL_COND_V(p_image.empty(),PoolVector<uint8_t>()); Image img=p_image; if (img.detect_alpha()) - img.convert(Image::FORMAT_RGBA); + img.convert(Image::FORMAT_RGBA8); else - img.convert(Image::FORMAT_RGB); + img.convert(Image::FORMAT_RGB8); Size2 s(img.get_width(),img.get_height()); - DVector<uint8_t> data = img.get_data(); - DVector<uint8_t>::Read r = data.read(); + PoolVector<uint8_t> data = img.get_data(); + PoolVector<uint8_t>::Read r = data.read(); uint8_t *dst_buff=NULL; size_t dst_size=0; - if (img.get_format()==Image::FORMAT_RGB) { + if (img.get_format()==Image::FORMAT_RGB8) { dst_size = WebPEncodeRGB(r.ptr(),s.width,s.height,3*s.width,CLAMP(p_quality*100.0,0,100.0),&dst_buff); } else { dst_size = WebPEncodeRGBA(r.ptr(),s.width,s.height,4*s.width,CLAMP(p_quality*100.0,0,100.0),&dst_buff); } - ERR_FAIL_COND_V(dst_size==0,DVector<uint8_t>()); - DVector<uint8_t> dst; + ERR_FAIL_COND_V(dst_size==0,PoolVector<uint8_t>()); + PoolVector<uint8_t> dst; dst.resize(4+dst_size); - DVector<uint8_t>::Write w = dst.write(); + PoolVector<uint8_t>::Write w = dst.write(); w[0]='W'; w[1]='E'; w[2]='B'; w[3]='P'; copymem(&w[4],dst_buff,dst_size); free(dst_buff); - w=DVector<uint8_t>::Write(); + w=PoolVector<uint8_t>::Write(); return dst; } -static Image _webp_lossy_unpack(const DVector<uint8_t>& p_buffer) { +static Image _webp_lossy_unpack(const PoolVector<uint8_t>& p_buffer) { int size = p_buffer.size()-4; ERR_FAIL_COND_V(size<=0,Image()); - DVector<uint8_t>::Read r = p_buffer.read(); + PoolVector<uint8_t>::Read r = p_buffer.read(); ERR_FAIL_COND_V(r[0]!='W' || r[1]!='E' || r[2]!='B' || r[3]!='P',Image()); WebPBitstreamFeatures features; @@ -90,11 +90,11 @@ static Image _webp_lossy_unpack(const DVector<uint8_t>& p_buffer) { //print_line("height: "+itos(features.height)); //print_line("alpha: "+itos(features.has_alpha)); - DVector<uint8_t> dst_image; + PoolVector<uint8_t> dst_image; int datasize = features.width*features.height*(features.has_alpha?4:3); dst_image.resize(datasize); - DVector<uint8_t>::Write dst_w = dst_image.write(); + PoolVector<uint8_t>::Write dst_w = dst_image.write(); bool errdec=false; if (features.has_alpha) { @@ -107,9 +107,9 @@ static Image _webp_lossy_unpack(const DVector<uint8_t>& p_buffer) { //ERR_EXPLAIN("Error decoding webp! - "+p_file); ERR_FAIL_COND_V(errdec,Image()); - dst_w = DVector<uint8_t>::Write(); + dst_w = PoolVector<uint8_t>::Write(); - return Image(features.width,features.height,0,features.has_alpha?Image::FORMAT_RGBA:Image::FORMAT_RGB,dst_image); + return Image(features.width,features.height,0,features.has_alpha?Image::FORMAT_RGBA8:Image::FORMAT_RGB8,dst_image); } @@ -118,12 +118,12 @@ Error ImageLoaderWEBP::load_image(Image *p_image,FileAccess *f) { uint32_t size = f->get_len(); - DVector<uint8_t> src_image; + PoolVector<uint8_t> src_image; src_image.resize(size); WebPBitstreamFeatures features; - DVector<uint8_t>::Write src_w = src_image.write(); + PoolVector<uint8_t>::Write src_w = src_image.write(); f->get_buffer(src_w.ptr(),size); ERR_FAIL_COND_V(f->eof_reached(), ERR_FILE_EOF); @@ -137,14 +137,14 @@ Error ImageLoaderWEBP::load_image(Image *p_image,FileAccess *f) { print_line("height: "+itos(features.height)); print_line("alpha: "+itos(features.has_alpha)); - src_w = DVector<uint8_t>::Write(); + src_w = PoolVector<uint8_t>::Write(); - DVector<uint8_t> dst_image; + PoolVector<uint8_t> dst_image; int datasize = features.width*features.height*(features.has_alpha?4:3); dst_image.resize(datasize); - DVector<uint8_t>::Read src_r = src_image.read(); - DVector<uint8_t>::Write dst_w = dst_image.write(); + PoolVector<uint8_t>::Read src_r = src_image.read(); + PoolVector<uint8_t>::Write dst_w = dst_image.write(); bool errdec=false; @@ -158,10 +158,10 @@ Error ImageLoaderWEBP::load_image(Image *p_image,FileAccess *f) { //ERR_EXPLAIN("Error decoding webp! - "+p_file); ERR_FAIL_COND_V(errdec,ERR_FILE_CORRUPT); - src_r = DVector<uint8_t>::Read(); - dst_w = DVector<uint8_t>::Write(); + src_r = PoolVector<uint8_t>::Read(); + dst_w = PoolVector<uint8_t>::Write(); - *p_image = Image(features.width,features.height,0,features.has_alpha?Image::FORMAT_RGBA:Image::FORMAT_RGB,dst_image); + *p_image = Image(features.width,features.height,0,features.has_alpha?Image::FORMAT_RGBA8:Image::FORMAT_RGB8,dst_image); return OK; diff --git a/modules/webp/image_loader_webp.h b/modules/webp/image_loader_webp.h index 24f79708db..eb1b32ac95 100644 --- a/modules/webp/image_loader_webp.h +++ b/modules/webp/image_loader_webp.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/webp/register_types.cpp b/modules/webp/register_types.cpp index 039876bbb9..7a4e35dc4c 100644 --- a/modules/webp/register_types.cpp +++ b/modules/webp/register_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/modules/webp/register_types.h b/modules/webp/register_types.h index a200188e47..ce1f29937b 100644 --- a/modules/webp/register_types.h +++ b/modules/webp/register_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/audio_driver_jandroid.cpp b/platform/android/audio_driver_jandroid.cpp index 419ed977b5..8c57eaaab6 100644 --- a/platform/android/audio_driver_jandroid.cpp +++ b/platform/android/audio_driver_jandroid.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/audio_driver_jandroid.h b/platform/android/audio_driver_jandroid.h index f79057efe5..01ce31be8f 100644 --- a/platform/android/audio_driver_jandroid.h +++ b/platform/android/audio_driver_jandroid.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/audio_driver_opensl.cpp b/platform/android/audio_driver_opensl.cpp index b7ef1424e5..5e3cfcbbab 100644 --- a/platform/android/audio_driver_opensl.cpp +++ b/platform/android/audio_driver_opensl.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/audio_driver_opensl.h b/platform/android/audio_driver_opensl.h index 1b04f32fd2..8839d20bab 100644 --- a/platform/android/audio_driver_opensl.h +++ b/platform/android/audio_driver_opensl.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/detect.py b/platform/android/detect.py index 7f197895f1..d1073e0c7b 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -130,18 +130,17 @@ def configure(env): else: env.extra_suffix = ".armv7" + env.extra_suffix + mt_link = True if (sys.platform.startswith("linux")): - if (platform.machine().endswith('64')): - host_subpath = "linux-x86_64" - else: - host_subpath = "linux-x86" + host_subpath = "linux-x86_64" elif (sys.platform.startswith("darwin")): host_subpath = "darwin-x86_64" elif (sys.platform.startswith('win')): if (platform.machine().endswith('64')): host_subpath = "windows-x86_64" else: - host_subpath = "windows-x86" + mt_link = False + host_subpath = "windows" compiler_path = env["ANDROID_NDK_ROOT"] + \ "/toolchains/llvm/prebuilt/" + host_subpath + "/bin" @@ -205,14 +204,15 @@ def configure(env): env['SHLIBSUFFIX'] = '.so' env['LINKFLAGS'] = ['-shared', '--sysroot=' + - sysroot, '-Wl,--warn-shared-textrel', - '-Wl,--threads'] + sysroot, '-Wl,--warn-shared-textrel'] env.Append(LINKFLAGS=string.split( '-Wl,--fix-cortex-a8')) env.Append(LINKFLAGS=string.split( '-Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now')) env.Append(LINKFLAGS=string.split( '-Wl,-soname,libgodot_android.so -Wl,--gc-sections')) + if mt_link: + env.Append(LINKFLAGS=['-Wl,--threads']) env.Append(LINKFLAGS=target_opts) env.Append(LINKFLAGS=common_opts) diff --git a/platform/android/dir_access_android.cpp b/platform/android/dir_access_android.cpp index 79ba83b3ee..f1a488cec2 100644 --- a/platform/android/dir_access_android.cpp +++ b/platform/android/dir_access_android.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/dir_access_android.h b/platform/android/dir_access_android.h index 9477ca48fd..15c29a9a02 100644 --- a/platform/android/dir_access_android.h +++ b/platform/android/dir_access_android.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/dir_access_jandroid.cpp b/platform/android/dir_access_jandroid.cpp index 06be1f747d..bbd041f6c7 100644 --- a/platform/android/dir_access_jandroid.cpp +++ b/platform/android/dir_access_jandroid.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/dir_access_jandroid.h b/platform/android/dir_access_jandroid.h index 356828dcc1..bfd7912aaf 100644 --- a/platform/android/dir_access_jandroid.h +++ b/platform/android/dir_access_jandroid.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 4735a91f43..e836258e04 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -190,7 +190,7 @@ NULL}; class EditorExportPlatformAndroid : public EditorExportPlatform { - OBJ_TYPE( EditorExportPlatformAndroid,EditorExportPlatform ); + GDCLASS( EditorExportPlatformAndroid,EditorExportPlatform ); enum { @@ -531,9 +531,9 @@ void EditorExportPlatformAndroid::_fix_resources(Vector<uint8_t>& p_manifest) { Vector<String> string_table; - printf("stirng block len: %i\n",string_block_len); - printf("stirng count: %i\n",string_count); - printf("flags: %x\n",string_flags); + //printf("stirng block len: %i\n",string_block_len); + //printf("stirng count: %i\n",string_count); + //printf("flags: %x\n",string_flags); for(uint32_t i=0;i<string_count;i++) { @@ -553,8 +553,8 @@ void EditorExportPlatformAndroid::_fix_resources(Vector<uint8_t>& p_manifest) { String lang = str.substr(str.find_last("-")+1,str.length()).replace("-","_"); String prop = "application/name_"+lang; - if (Globals::get_singleton()->has(prop)) { - str = Globals::get_singleton()->get(prop); + if (GlobalConfig::get_singleton()->has(prop)) { + str = GlobalConfig::get_singleton()->get(prop); } else { str = get_project_name(); } @@ -617,7 +617,7 @@ void EditorExportPlatformAndroid::_fix_resources(Vector<uint8_t>& p_manifest) { p_manifest=ret; - printf("end\n"); + //printf("end\n"); } String EditorExportPlatformAndroid::get_project_name() const { @@ -626,7 +626,7 @@ String EditorExportPlatformAndroid::get_project_name() const { if (this->name!="") { aname=this->name; } else { - aname = Globals::get_singleton()->get("application/name"); + aname = GlobalConfig::get_singleton()->get("application/name"); } @@ -778,16 +778,16 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool else nspace=""; - printf("ATTR %i NSPACE: %i\n",i,attr_nspace); - printf("ATTR %i NAME: %i (%s)\n",i,attr_name,attrname.utf8().get_data()); - printf("ATTR %i VALUE: %i (%s)\n",i,attr_value,value.utf8().get_data()); - printf("ATTR %i FLAGS: %x\n",i,attr_flags); - printf("ATTR %i RESID: %x\n",i,attr_resid); + //printf("ATTR %i NSPACE: %i\n",i,attr_nspace); + //printf("ATTR %i NAME: %i (%s)\n",i,attr_name,attrname.utf8().get_data()); + //printf("ATTR %i VALUE: %i (%s)\n",i,attr_value,value.utf8().get_data()); + //printf("ATTR %i FLAGS: %x\n",i,attr_flags); + //printf("ATTR %i RESID: %x\n",i,attr_resid); //replace project information if (tname=="manifest" && attrname=="package") { - print_line("FOUND PACKAGE"); + print_line("FOUND package"); string_table[attr_value]=get_package_name(); } @@ -796,14 +796,14 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool //print_line("attrname: "+attrname); if (tname=="manifest" && /*nspace=="android" &&*/ attrname=="versionCode") { - print_line("FOUND versioncode"); + print_line("FOUND versionCode"); encode_uint32(version_code,&p_manifest[iofs+16]); } if (tname=="manifest" && /*nspace=="android" &&*/ attrname=="versionName") { - print_line("FOUND versionname"); + print_line("FOUND versionName"); if (attr_value==0xFFFFFFFF) { WARN_PRINT("Version name in a resource, should be plaintext") } else @@ -834,10 +834,10 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool } else if (value.begins_with("godot.")) { String perm = value.get_slice(".",1); - print_line("PERM: "+perm+" HAS: "+itos(perms.has(perm))); if (perms.has(perm) || (p_give_internet && perm=="INTERNET")) { + print_line("PERM: "+perm); string_table[attr_value]="android.permission."+perm; } @@ -871,12 +871,12 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool } break; } - printf("chunk %x: size: %d\n",chunk,size); + //printf("chunk %x: size: %d\n",chunk,size); ofs+=size; } - printf("end\n"); + //printf("end\n"); //create new andriodmanifest binary @@ -893,14 +893,14 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool encode_uint32(ofs,&ret[string_table_begins+i*4]); ofs+=string_table[i].length()*2+2+2; - print_line("ofs: "+itos(i)+": "+itos(ofs)); + //print_line("ofs: "+itos(i)+": "+itos(ofs)); } ret.resize(ret.size()+ofs); uint8_t *chars=&ret[ret.size()-ofs]; for(int i=0;i<string_table.size();i++) { String s = string_table[i]; - print_line("savint string :"+s); + //print_line("savint string :"+s); encode_uint16(s.length(),chars); chars+=2; for(int j=0;j<s.length();j++) { //include zero? @@ -934,7 +934,7 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool encode_uint32(new_stable_end-8,&ret[12]); //update new string table size - print_line("file size: "+itos(ret.size())); + //print_line("file size: "+itos(ret.size())); p_manifest=ret; @@ -949,7 +949,7 @@ void EditorExportPlatformAndroid::_fix_manifest(Vector<uint8_t>& p_manifest,bool header[i]=decode_uint32(&p_manifest[i*4]); } - print_line("STO: "+itos(header[3])); + //print_line("STO: "+itos(header[3])); uint32_t st_offset=9*4; //ERR_FAIL_COND(header[3]!=0x24) uint32_t string_count=header[4]; @@ -1148,7 +1148,7 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d if (!found) { - String appicon = Globals::get_singleton()->get("application/icon"); + String appicon = GlobalConfig::get_singleton()->get("application/icon"); if (appicon!="" && appicon.ends_with(".png")) { FileAccess*f = FileAccess::open(appicon,FileAccess::READ); if (f) { @@ -1212,9 +1212,9 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d if (p_flags&EXPORT_DUMB_CLIENT) { - /*String host = EditorSettings::get_singleton()->get("file_server/host"); - int port = EditorSettings::get_singleton()->get("file_server/post"); - String passwd = EditorSettings::get_singleton()->get("file_server/password"); + /*String host = EditorSettings::get_singleton()->get("filesystem/file_server/host"); + int port = EditorSettings::get_singleton()->get("filesystem/file_server/post"); + String passwd = EditorSettings::get_singleton()->get("filesystem/file_server/password"); cl.push_back("-rfs"); cl.push_back(host+":"+itos(port)); if (passwd!="") { @@ -1305,7 +1305,7 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d if (_signed) { - String jarsigner=EditorSettings::get_singleton()->get("android/jarsigner"); + String jarsigner=EditorSettings::get_singleton()->get("export/android/jarsigner"); if (!FileAccess::exists(jarsigner)) { EditorNode::add_io_error("'jarsigner' could not be found.\nPlease supply a path in the editor settings.\nResulting apk is unsigned."); return OK; @@ -1315,9 +1315,9 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d String password; String user; if (p_debug) { - keystore=EditorSettings::get_singleton()->get("android/debug_keystore"); - password=EditorSettings::get_singleton()->get("android/debug_keystore_pass"); - user=EditorSettings::get_singleton()->get("android/debug_keystore_user"); + keystore=EditorSettings::get_singleton()->get("export/android/debug_keystore"); + password=EditorSettings::get_singleton()->get("export/android/debug_keystore_pass"); + user=EditorSettings::get_singleton()->get("export/android/debug_keystore_user"); ep.step("Signing Debug APK..",103); @@ -1340,7 +1340,7 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d args.push_back("SHA1"); args.push_back("-sigalg"); args.push_back("MD5withRSA"); - String tsa_url=EditorSettings::get_singleton()->get("android/timestamping_authority_url"); + String tsa_url=EditorSettings::get_singleton()->get("export/android/timestamping_authority_url"); if (tsa_url != "") { args.push_back("-tsa"); args.push_back(tsa_url); @@ -1506,7 +1506,7 @@ void EditorExportPlatformAndroid::_device_poll_thread(void *ud) { while(!ea->quit_request) { - String adb=EditorSettings::get_singleton()->get("android/adb"); + String adb=EditorSettings::get_singleton()->get("export/android/adb"); if (FileAccess::exists(adb)) { String devices; @@ -1628,8 +1628,8 @@ void EditorExportPlatformAndroid::_device_poll_thread(void *ud) { } - if (EditorSettings::get_singleton()->get("android/shutdown_adb_on_exit")) { - String adb=EditorSettings::get_singleton()->get("android/adb"); + if (EditorSettings::get_singleton()->get("export/android/shutdown_adb_on_exit")) { + String adb=EditorSettings::get_singleton()->get("export/android/adb"); if (!FileAccess::exists(adb)) { return; //adb not configured } @@ -1647,7 +1647,7 @@ Error EditorExportPlatformAndroid::run(int p_device, int p_flags) { EditorProgress ep("run","Running on "+devices[p_device].name,3); - String adb=EditorSettings::get_singleton()->get("android/adb"); + String adb=EditorSettings::get_singleton()->get("export/android/adb"); if (adb=="") { EditorNode::add_io_error("ADB executable not configured in settings, can't run."); @@ -1659,7 +1659,7 @@ Error EditorExportPlatformAndroid::run(int p_device, int p_flags) { ep.step("Exporting APK",0); - bool use_adb_over_usb = bool(EDITOR_DEF("android/use_remote_debug_over_adb",true)); + bool use_adb_over_usb = bool(EDITOR_DEF("export/android/use_remote_debug_over_adb",true)); if (use_adb_over_usb) { p_flags|=EXPORT_REMOTE_DEBUG_LOCALHOST; @@ -1719,7 +1719,7 @@ Error EditorExportPlatformAndroid::run(int p_device, int p_flags) { args.push_back("--remove-all"); err = OS::get_singleton()->execute(adb,args,true,NULL,NULL,&rv); - int port = Globals::get_singleton()->get("debug/debug_port"); + int port = GlobalConfig::get_singleton()->get("network/debug/remote_port"); args.clear(); args.push_back("reverse"); args.push_back("tcp:"+itos(port)); @@ -1728,7 +1728,7 @@ Error EditorExportPlatformAndroid::run(int p_device, int p_flags) { err = OS::get_singleton()->execute(adb,args,true,NULL,NULL,&rv); print_line("Reverse result: "+itos(rv)); - int fs_port = EditorSettings::get_singleton()->get("file_server/port"); + int fs_port = EditorSettings::get_singleton()->get("filesystem/file_server/port"); args.clear(); args.push_back("reverse"); @@ -1766,7 +1766,7 @@ Error EditorExportPlatformAndroid::run(int p_device, int p_flags) { String EditorExportPlatformAndroid::get_package_name() { String pname = package; - String basename = Globals::get_singleton()->get("application/name"); + String basename = GlobalConfig::get_singleton()->get("application/name"); basename=basename.to_lower(); String name; @@ -1822,7 +1822,7 @@ EditorExportPlatformAndroid::EditorExportPlatformAndroid() { bool EditorExportPlatformAndroid::can_export(String *r_error) const { bool valid=true; - String adb=EditorSettings::get_singleton()->get("android/adb"); + String adb=EditorSettings::get_singleton()->get("export/android/adb"); String err; if (!FileAccess::exists(adb)) { @@ -1831,7 +1831,7 @@ bool EditorExportPlatformAndroid::can_export(String *r_error) const { err+="ADB executable not configured in editor settings.\n"; } - String js = EditorSettings::get_singleton()->get("android/jarsigner"); + String js = EditorSettings::get_singleton()->get("export/android/jarsigner"); if (!FileAccess::exists(js)) { @@ -1839,7 +1839,7 @@ bool EditorExportPlatformAndroid::can_export(String *r_error) const { err+="OpenJDK 6 jarsigner not configured in editor settings.\n"; } - String dk = EditorSettings::get_singleton()->get("android/debug_keystore"); + String dk = EditorSettings::get_singleton()->get("export/android/debug_keystore"); if (!FileAccess::exists(dk)) { @@ -1893,20 +1893,20 @@ EditorExportPlatformAndroid::~EditorExportPlatformAndroid() { void register_android_exporter() { String exe_ext=OS::get_singleton()->get_name()=="Windows"?"exe":""; - EDITOR_DEF("android/adb",""); + EDITOR_DEF("export/android/adb",""); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"android/adb",PROPERTY_HINT_GLOBAL_FILE,exe_ext)); - EDITOR_DEF("android/jarsigner",""); + EDITOR_DEF("export/android/jarsigner",""); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"android/jarsigner",PROPERTY_HINT_GLOBAL_FILE,exe_ext)); - EDITOR_DEF("android/debug_keystore",""); + EDITOR_DEF("export/android/debug_keystore",""); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"android/debug_keystore",PROPERTY_HINT_GLOBAL_FILE,"keystore")); - EDITOR_DEF("android/debug_keystore_user","androiddebugkey"); - EDITOR_DEF("android/debug_keystore_pass","android"); + EDITOR_DEF("export/android/debug_keystore_user","androiddebugkey"); + EDITOR_DEF("export/android/debug_keystore_pass","android"); //EDITOR_DEF("android/release_keystore",""); //EDITOR_DEF("android/release_username",""); //EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"android/release_keystore",PROPERTY_HINT_GLOBAL_FILE,"*.keystore")); - EDITOR_DEF("android/timestamping_authority_url",""); - EDITOR_DEF("android/use_remote_debug_over_adb",false); - EDITOR_DEF("android/shutdown_adb_on_exit",true); + EDITOR_DEF("export/android/timestamping_authority_url",""); + EDITOR_DEF("export/android/use_remote_debug_over_adb",false); + EDITOR_DEF("export/android/shutdown_adb_on_exit",true); Ref<EditorExportPlatformAndroid> exporter = Ref<EditorExportPlatformAndroid>( memnew(EditorExportPlatformAndroid) ); EditorImportExport::get_singleton()->add_export_platform(exporter); diff --git a/platform/android/export/export.h b/platform/android/export/export.h index a9421e692e..468b484177 100644 --- a/platform/android/export/export.h +++ b/platform/android/export/export.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/file_access_android.cpp b/platform/android/file_access_android.cpp index aefa16ca9c..2828d3c074 100644 --- a/platform/android/file_access_android.cpp +++ b/platform/android/file_access_android.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/file_access_android.h b/platform/android/file_access_android.h index 3fcd7836c3..3d54eb2027 100644 --- a/platform/android/file_access_android.h +++ b/platform/android/file_access_android.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/file_access_jandroid.cpp b/platform/android/file_access_jandroid.cpp index 3d2e525bbc..4755f1d029 100644 --- a/platform/android/file_access_jandroid.cpp +++ b/platform/android/file_access_jandroid.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/file_access_jandroid.h b/platform/android/file_access_jandroid.h index d576af93d6..38f441ea71 100644 --- a/platform/android/file_access_jandroid.h +++ b/platform/android/file_access_jandroid.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/globals/global_defaults.cpp b/platform/android/globals/global_defaults.cpp index 9a4252bde0..52b59b2dc1 100644 --- a/platform/android/globals/global_defaults.cpp +++ b/platform/android/globals/global_defaults.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,10 +32,11 @@ void register_android_global_defaults() { - GLOBAL_DEF("rasterizer.Android/use_fragment_lighting",false); +/* GLOBAL_DEF("rasterizer.Android/use_fragment_lighting",false); GLOBAL_DEF("rasterizer.Android/fp16_framebuffer",false); GLOBAL_DEF("display.Android/driver","GLES2"); // GLOBAL_DEF("rasterizer.Android/trilinear_mipmap_filter",false); - Globals::get_singleton()->set_custom_property_info("display.Android/driver",PropertyInfo(Variant::STRING,"display.Android/driver",PROPERTY_HINT_ENUM,"GLES2")); + GlobalConfig::get_singleton()->set_custom_property_info("display.Android/driver",PropertyInfo(Variant::STRING,"display.Android/driver",PROPERTY_HINT_ENUM,"GLES2")); + */ } diff --git a/platform/android/globals/global_defaults.h b/platform/android/globals/global_defaults.h index 6f240572d8..49d7f6393c 100644 --- a/platform/android/globals/global_defaults.h +++ b/platform/android/globals/global_defaults.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/godot_android.cpp b/platform/android/godot_android.cpp index 2371274d9d..c4d1a85c5f 100644 --- a/platform/android/godot_android.cpp +++ b/platform/android/godot_android.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -57,7 +57,7 @@ extern "C" { class JNISingleton : public Object { - OBJ_TYPE( JNISingleton, Object ); + GDCLASS( JNISingleton, Object ); struct MethodData { @@ -153,7 +153,7 @@ public: } break; case Variant::STRING_ARRAY: { - DVector<String> sarray = *p_args[i]; + PoolVector<String> sarray = *p_args[i]; jobjectArray arr = env->NewObjectArray(sarray.size(),env->FindClass("java/lang/String"),env->NewStringUTF("")); for(int j=0;j<sarray.size();j++) { @@ -165,18 +165,18 @@ public: } break; case Variant::INT_ARRAY: { - DVector<int> array = *p_args[i]; + PoolVector<int> array = *p_args[i]; jintArray arr = env->NewIntArray(array.size()); - DVector<int>::Read r = array.read(); + PoolVector<int>::Read r = array.read(); env->SetIntArrayRegion(arr,0,array.size(),r.ptr()); v[i].l=arr; } break; case Variant::REAL_ARRAY: { - DVector<float> array = *p_args[i]; + PoolVector<float> array = *p_args[i]; jfloatArray arr = env->NewFloatArray(array.size()); - DVector<float>::Read r = array.read(); + PoolVector<float>::Read r = array.read(); env->SetFloatArrayRegion(arr,0,array.size(),r.ptr()); v[i].l=arr; @@ -225,7 +225,7 @@ public: jobjectArray arr = (jobjectArray)env->CallObjectMethodA(instance,E->get().method,v); int stringCount = env->GetArrayLength(arr); - DVector<String> sarr; + PoolVector<String> sarr; for (int i=0; i<stringCount; i++) { jstring string = (jstring) env->GetObjectArrayElement(arr, i); @@ -241,12 +241,12 @@ public: jintArray arr = (jintArray)env->CallObjectMethodA(instance,E->get().method,v); int fCount = env->GetArrayLength(arr); - DVector<int> sarr; + PoolVector<int> sarr; sarr.resize(fCount); - DVector<int>::Write w = sarr.write(); + PoolVector<int>::Write w = sarr.write(); env->GetIntArrayRegion(arr,0,fCount,w.ptr()); - w = DVector<int>::Write(); + w = PoolVector<int>::Write(); ret=sarr; } break; case Variant::REAL_ARRAY: { @@ -254,12 +254,12 @@ public: jfloatArray arr = (jfloatArray)env->CallObjectMethodA(instance,E->get().method,v); int fCount = env->GetArrayLength(arr); - DVector<float> sarr; + PoolVector<float> sarr; sarr.resize(fCount); - DVector<float>::Write w = sarr.write(); + PoolVector<float>::Write w = sarr.write(); env->GetFloatArrayRegion(arr,0,fCount,w.ptr()); - w = DVector<float>::Write(); + w = PoolVector<float>::Write(); ret=sarr; } break; default: { @@ -654,7 +654,7 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd) { #else Error err = Main::setup("apk",0,NULL); - String modules = Globals::get_singleton()->get("android/modules"); + String modules = GlobalConfig::get_singleton()->get("android/modules"); Vector<String> mods = modules.split(",",false); mods.push_back("GodotOS"); __android_log_print(ANDROID_LOG_INFO,"godot","mod count: %i",mods.size()); @@ -912,7 +912,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_Godot_registerSingleton(JNIEnv s->set_instance(env->NewGlobalRef(p_object)); jni_singletons[singname]=s; - Globals::get_singleton()->add_singleton(Globals::Singleton(singname,s)); + GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton(singname,s)); } @@ -983,7 +983,7 @@ JNIEXPORT jstring JNICALL Java_org_godotengine_godot_Godot_getGlobal(JNIEnv * en String js = env->GetStringUTFChars( path, NULL ); - return env->NewStringUTF(Globals::get_singleton()->get(js).operator String().utf8().get_data()); + return env->NewStringUTF(GlobalConfig::get_singleton()->get(js).operator String().utf8().get_data()); } diff --git a/platform/android/java/src/org/godotengine/godot/Dictionary.java b/platform/android/java/src/org/godotengine/godot/Dictionary.java index e003c245bb..72f0b7a60e 100644 --- a/platform/android/java/src/org/godotengine/godot/Dictionary.java +++ b/platform/android/java/src/org/godotengine/godot/Dictionary.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/java/src/org/godotengine/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java index 4b80db7e33..d2533378dc 100644 --- a/platform/android/java/src/org/godotengine/godot/Godot.java +++ b/platform/android/java/src/org/godotengine/godot/Godot.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -295,6 +295,25 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC }); } } + + public void alert(final String message, final String title) { + runOnUiThread(new Runnable() { + @Override + public void run() { + AlertDialog.Builder builder = new AlertDialog.Builder(getInstance()); + builder.setMessage(message).setTitle(title); + builder.setPositiveButton( + "OK", + new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int id) { + dialog.cancel(); + } + }); + AlertDialog dialog = builder.create(); + dialog.show(); + } + }); + } private static Godot _self; diff --git a/platform/android/java/src/org/godotengine/godot/GodotDownloaderAlarmReceiver.java b/platform/android/java/src/org/godotengine/godot/GodotDownloaderAlarmReceiver.java index ea6c070fae..5a07d680b3 100644 --- a/platform/android/java/src/org/godotengine/godot/GodotDownloaderAlarmReceiver.java +++ b/platform/android/java/src/org/godotengine/godot/GodotDownloaderAlarmReceiver.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/java/src/org/godotengine/godot/GodotDownloaderService.java b/platform/android/java/src/org/godotengine/godot/GodotDownloaderService.java index 4ea3f13021..878528f7c7 100644 --- a/platform/android/java/src/org/godotengine/godot/GodotDownloaderService.java +++ b/platform/android/java/src/org/godotengine/godot/GodotDownloaderService.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/java/src/org/godotengine/godot/GodotIO.java b/platform/android/java/src/org/godotengine/godot/GodotIO.java index 128a9b2f7b..33c1c03ace 100644 --- a/platform/android/java/src/org/godotengine/godot/GodotIO.java +++ b/platform/android/java/src/org/godotengine/godot/GodotIO.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/java/src/org/godotengine/godot/GodotLib.java b/platform/android/java/src/org/godotengine/godot/GodotLib.java index 9a2ea7df10..57856cfd6b 100644 --- a/platform/android/java/src/org/godotengine/godot/GodotLib.java +++ b/platform/android/java/src/org/godotengine/godot/GodotLib.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/java/src/org/godotengine/godot/GodotPaymentV3.java b/platform/android/java/src/org/godotengine/godot/GodotPaymentV3.java index b7de31ada3..6eee8da91b 100644 --- a/platform/android/java/src/org/godotengine/godot/GodotPaymentV3.java +++ b/platform/android/java/src/org/godotengine/godot/GodotPaymentV3.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/java/src/org/godotengine/godot/GodotView.java b/platform/android/java/src/org/godotengine/godot/GodotView.java index e210161e8b..db67144bcc 100644 --- a/platform/android/java/src/org/godotengine/godot/GodotView.java +++ b/platform/android/java/src/org/godotengine/godot/GodotView.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/java/src/org/godotengine/godot/input/GodotEditText.java b/platform/android/java/src/org/godotengine/godot/input/GodotEditText.java index aa92eeae0f..f0dae03a81 100644 --- a/platform/android/java/src/org/godotengine/godot/input/GodotEditText.java +++ b/platform/android/java/src/org/godotengine/godot/input/GodotEditText.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/java/src/org/godotengine/godot/input/GodotTextInputWrapper.java b/platform/android/java/src/org/godotengine/godot/input/GodotTextInputWrapper.java index 13c8c8b3ec..80cded6fb5 100644 --- a/platform/android/java/src/org/godotengine/godot/input/GodotTextInputWrapper.java +++ b/platform/android/java/src/org/godotengine/godot/input/GodotTextInputWrapper.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/java/src/org/godotengine/godot/payments/ConsumeTask.java b/platform/android/java/src/org/godotengine/godot/payments/ConsumeTask.java index 16b669fbe8..13a24994f8 100644 --- a/platform/android/java/src/org/godotengine/godot/payments/ConsumeTask.java +++ b/platform/android/java/src/org/godotengine/godot/payments/ConsumeTask.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/java/src/org/godotengine/godot/payments/GenericConsumeTask.java b/platform/android/java/src/org/godotengine/godot/payments/GenericConsumeTask.java index 175d401c87..20feaef581 100644 --- a/platform/android/java/src/org/godotengine/godot/payments/GenericConsumeTask.java +++ b/platform/android/java/src/org/godotengine/godot/payments/GenericConsumeTask.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/java/src/org/godotengine/godot/payments/HandlePurchaseTask.java b/platform/android/java/src/org/godotengine/godot/payments/HandlePurchaseTask.java index e63230c4f8..1aa210265d 100644 --- a/platform/android/java/src/org/godotengine/godot/payments/HandlePurchaseTask.java +++ b/platform/android/java/src/org/godotengine/godot/payments/HandlePurchaseTask.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/java/src/org/godotengine/godot/payments/PaymentsCache.java b/platform/android/java/src/org/godotengine/godot/payments/PaymentsCache.java index 0635385f53..88fd1a0fe4 100644 --- a/platform/android/java/src/org/godotengine/godot/payments/PaymentsCache.java +++ b/platform/android/java/src/org/godotengine/godot/payments/PaymentsCache.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/java/src/org/godotengine/godot/payments/PaymentsManager.java b/platform/android/java/src/org/godotengine/godot/payments/PaymentsManager.java index 753c0a6f93..73d1cc3bc8 100644 --- a/platform/android/java/src/org/godotengine/godot/payments/PaymentsManager.java +++ b/platform/android/java/src/org/godotengine/godot/payments/PaymentsManager.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/java/src/org/godotengine/godot/payments/PurchaseTask.java b/platform/android/java/src/org/godotengine/godot/payments/PurchaseTask.java index 9e92d8b5a5..d154ef0c78 100644 --- a/platform/android/java/src/org/godotengine/godot/payments/PurchaseTask.java +++ b/platform/android/java/src/org/godotengine/godot/payments/PurchaseTask.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/java/src/org/godotengine/godot/payments/ReleaseAllConsumablesTask.java b/platform/android/java/src/org/godotengine/godot/payments/ReleaseAllConsumablesTask.java index 2dc7dcf6b1..c74269890d 100644 --- a/platform/android/java/src/org/godotengine/godot/payments/ReleaseAllConsumablesTask.java +++ b/platform/android/java/src/org/godotengine/godot/payments/ReleaseAllConsumablesTask.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/java/src/org/godotengine/godot/payments/ValidateTask.java b/platform/android/java/src/org/godotengine/godot/payments/ValidateTask.java index f3532f311f..dafab13ad7 100644 --- a/platform/android/java/src/org/godotengine/godot/payments/ValidateTask.java +++ b/platform/android/java/src/org/godotengine/godot/payments/ValidateTask.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/java/src/org/godotengine/godot/utils/Crypt.java b/platform/android/java/src/org/godotengine/godot/utils/Crypt.java index ef7793c1e6..f8936bef2b 100644 --- a/platform/android/java/src/org/godotengine/godot/utils/Crypt.java +++ b/platform/android/java/src/org/godotengine/godot/utils/Crypt.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/java/src/org/godotengine/godot/utils/CustomSSLSocketFactory.java b/platform/android/java/src/org/godotengine/godot/utils/CustomSSLSocketFactory.java index f2b0e8786e..823c75d186 100644 --- a/platform/android/java/src/org/godotengine/godot/utils/CustomSSLSocketFactory.java +++ b/platform/android/java/src/org/godotengine/godot/utils/CustomSSLSocketFactory.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/java/src/org/godotengine/godot/utils/HttpRequester.java b/platform/android/java/src/org/godotengine/godot/utils/HttpRequester.java index 5687b3c1e1..9dd08a9563 100644 --- a/platform/android/java/src/org/godotengine/godot/utils/HttpRequester.java +++ b/platform/android/java/src/org/godotengine/godot/utils/HttpRequester.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/java/src/org/godotengine/godot/utils/RequestParams.java b/platform/android/java/src/org/godotengine/godot/utils/RequestParams.java index d66dfe9531..bb00f1f468 100644 --- a/platform/android/java/src/org/godotengine/godot/utils/RequestParams.java +++ b/platform/android/java/src/org/godotengine/godot/utils/RequestParams.java @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/java_class_wrapper.cpp b/platform/android/java_class_wrapper.cpp index cc1e5b61d1..296ac0a831 100644 --- a/platform/android/java_class_wrapper.cpp +++ b/platform/android/java_class_wrapper.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -562,7 +562,7 @@ JavaObject::~JavaObject(){ void JavaClassWrapper::_bind_methods() { - ObjectTypeDB::bind_method(_MD("wrap:JavaClass","name"),&JavaClassWrapper::wrap); + ClassDB::bind_method(_MD("wrap:JavaClass","name"),&JavaClassWrapper::wrap); } diff --git a/platform/android/java_class_wrapper.h b/platform/android/java_class_wrapper.h index 012e7854fe..f0156563b2 100644 --- a/platform/android/java_class_wrapper.h +++ b/platform/android/java_class_wrapper.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ class JavaObject; class JavaClass : public Reference { - OBJ_TYPE(JavaClass,Reference); + GDCLASS(JavaClass,Reference); enum ArgumentType { @@ -98,14 +98,14 @@ class JavaClass : public Reference { case ARG_TYPE_CLASS: r_type=Variant::OBJECT; break; case ARG_ARRAY_BIT|ARG_TYPE_VOID: r_type=Variant::NIL; break; case ARG_ARRAY_BIT|ARG_TYPE_BOOLEAN: r_type=Variant::ARRAY; break; - case ARG_ARRAY_BIT|ARG_TYPE_BYTE: r_type=Variant::RAW_ARRAY; likelyhood=1.0; break; - case ARG_ARRAY_BIT|ARG_TYPE_CHAR: r_type=Variant::RAW_ARRAY; likelyhood=0.5; break; - case ARG_ARRAY_BIT|ARG_TYPE_SHORT: r_type=Variant::INT_ARRAY; likelyhood=0.3; break; - case ARG_ARRAY_BIT|ARG_TYPE_INT: r_type=Variant::INT_ARRAY; likelyhood=1.0; break; - case ARG_ARRAY_BIT|ARG_TYPE_LONG: r_type=Variant::INT_ARRAY; likelyhood=0.5; break; - case ARG_ARRAY_BIT|ARG_TYPE_FLOAT: r_type=Variant::REAL_ARRAY; likelyhood=1.0; break; - case ARG_ARRAY_BIT|ARG_TYPE_DOUBLE: r_type=Variant::REAL_ARRAY; likelyhood=0.5; break; - case ARG_ARRAY_BIT|ARG_TYPE_STRING: r_type=Variant::STRING_ARRAY; break; + case ARG_ARRAY_BIT|ARG_TYPE_BYTE: r_type=Variant::POOL_BYTE_ARRAY; likelyhood=1.0; break; + case ARG_ARRAY_BIT|ARG_TYPE_CHAR: r_type=Variant::POOL_BYTE_ARRAY; likelyhood=0.5; break; + case ARG_ARRAY_BIT|ARG_TYPE_SHORT: r_type=Variant::POOL_INT_ARRAY; likelyhood=0.3; break; + case ARG_ARRAY_BIT|ARG_TYPE_INT: r_type=Variant::POOL_INT_ARRAY; likelyhood=1.0; break; + case ARG_ARRAY_BIT|ARG_TYPE_LONG: r_type=Variant::POOL_INT_ARRAY; likelyhood=0.5; break; + case ARG_ARRAY_BIT|ARG_TYPE_FLOAT: r_type=Variant::POOL_REAL_ARRAY; likelyhood=1.0; break; + case ARG_ARRAY_BIT|ARG_TYPE_DOUBLE: r_type=Variant::POOL_REAL_ARRAY; likelyhood=0.5; break; + case ARG_ARRAY_BIT|ARG_TYPE_STRING: r_type=Variant::POOL_STRING_ARRAY; break; case ARG_ARRAY_BIT|ARG_TYPE_CLASS: r_type=Variant::ARRAY; break; } } @@ -131,7 +131,7 @@ public: class JavaObject : public Reference { - OBJ_TYPE(JavaObject,Reference); + GDCLASS(JavaObject,Reference); Ref<JavaClass> base_class; friend class JavaClass; @@ -150,7 +150,7 @@ public: class JavaClassWrapper : public Object { - OBJ_TYPE(JavaClassWrapper,Object); + GDCLASS(JavaClassWrapper,Object); Map<String,Ref<JavaClass> > class_cache; diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp index e5b655e5d5..63d53e35a3 100644 --- a/platform/android/java_glue.cpp +++ b/platform/android/java_glue.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -120,9 +120,9 @@ jvalret _variant_to_jvalue(JNIEnv *env, Variant::Type p_type, const Variant* p_a v.val.l=jStr; v.obj=jStr; } break; - case Variant::STRING_ARRAY: { + case Variant::POOL_STRING_ARRAY: { - DVector<String> sarray = *p_arg; + PoolVector<String> sarray = *p_arg; jobjectArray arr = env->NewObjectArray(sarray.size(),env->FindClass("java/lang/String"),env->NewStringUTF("")); for(int j=0;j<sarray.size();j++) { @@ -179,30 +179,30 @@ jvalret _variant_to_jvalue(JNIEnv *env, Variant::Type p_type, const Variant* p_a v.obj=jdict; } break; - case Variant::INT_ARRAY: { + case Variant::POOL_INT_ARRAY: { - DVector<int> array = *p_arg; + PoolVector<int> array = *p_arg; jintArray arr = env->NewIntArray(array.size()); - DVector<int>::Read r = array.read(); + PoolVector<int>::Read r = array.read(); env->SetIntArrayRegion(arr,0,array.size(),r.ptr()); v.val.l=arr; v.obj=arr; } break; - case Variant::RAW_ARRAY: { - DVector<uint8_t> array = *p_arg; + case Variant::POOL_BYTE_ARRAY: { + PoolVector<uint8_t> array = *p_arg; jbyteArray arr = env->NewByteArray(array.size()); - DVector<uint8_t>::Read r = array.read(); + PoolVector<uint8_t>::Read r = array.read(); env->SetByteArrayRegion(arr,0,array.size(),reinterpret_cast<const signed char*>(r.ptr())); v.val.l=arr; v.obj=arr; } break; - case Variant::REAL_ARRAY: { + case Variant::POOL_REAL_ARRAY: { - DVector<float> array = *p_arg; + PoolVector<float> array = *p_arg; jfloatArray arr = env->NewFloatArray(array.size()); - DVector<float>::Read r = array.read(); + PoolVector<float>::Read r = array.read(); env->SetFloatArrayRegion(arr,0,array.size(),r.ptr()); v.val.l=arr; v.obj=arr; @@ -259,7 +259,7 @@ Variant _jobject_to_variant(JNIEnv * env, jobject obj) { jobjectArray arr = (jobjectArray)obj; int stringCount = env->GetArrayLength(arr); //print_line("String array! " + String::num(stringCount)); - DVector<String> sarr; + PoolVector<String> sarr; for (int i=0; i<stringCount; i++) { jstring string = (jstring) env->GetObjectArrayElement(arr, i); @@ -290,12 +290,12 @@ Variant _jobject_to_variant(JNIEnv * env, jobject obj) { jintArray arr = (jintArray)obj; int fCount = env->GetArrayLength(arr); - DVector<int> sarr; + PoolVector<int> sarr; sarr.resize(fCount); - DVector<int>::Write w = sarr.write(); + PoolVector<int>::Write w = sarr.write(); env->GetIntArrayRegion(arr,0,fCount,w.ptr()); - w = DVector<int>::Write(); + w = PoolVector<int>::Write(); return sarr; }; @@ -303,12 +303,12 @@ Variant _jobject_to_variant(JNIEnv * env, jobject obj) { jbyteArray arr = (jbyteArray)obj; int fCount = env->GetArrayLength(arr); - DVector<uint8_t> sarr; + PoolVector<uint8_t> sarr; sarr.resize(fCount); - DVector<uint8_t>::Write w = sarr.write(); + PoolVector<uint8_t>::Write w = sarr.write(); env->GetByteArrayRegion(arr,0,fCount,reinterpret_cast<signed char*>(w.ptr())); - w = DVector<uint8_t>::Write(); + w = PoolVector<uint8_t>::Write(); return sarr; }; @@ -324,10 +324,10 @@ Variant _jobject_to_variant(JNIEnv * env, jobject obj) { jdoubleArray arr = (jdoubleArray)obj; int fCount = env->GetArrayLength(arr); - RealArray sarr; + PoolRealArray sarr; sarr.resize(fCount); - RealArray::Write w = sarr.write(); + PoolRealArray::Write w = sarr.write(); for (int i=0; i<fCount; i++) { @@ -343,11 +343,11 @@ Variant _jobject_to_variant(JNIEnv * env, jobject obj) { jfloatArray arr = (jfloatArray)obj; int fCount = env->GetArrayLength(arr); - RealArray sarr; + PoolRealArray sarr; sarr.resize(fCount); - RealArray::Write w = sarr.write(); + PoolRealArray::Write w = sarr.write(); for (int i=0; i<fCount; i++) { @@ -384,7 +384,7 @@ Variant _jobject_to_variant(JNIEnv * env, jobject obj) { jmethodID get_keys = env->GetMethodID(oclass, "get_keys", "()[Ljava/lang/String;"); jobjectArray arr = (jobjectArray)env->CallObjectMethod(obj, get_keys); - StringArray keys = _jobject_to_variant(env, arr); + PoolStringArray keys = _jobject_to_variant(env, arr); env->DeleteLocalRef(arr); jmethodID get_values = env->GetMethodID(oclass, "get_values", "()[Ljava/lang/Object;"); @@ -410,7 +410,7 @@ Variant _jobject_to_variant(JNIEnv * env, jobject obj) { class JNISingleton : public Object { - OBJ_TYPE( JNISingleton, Object ); + GDCLASS( JNISingleton, Object ); struct MethodData { @@ -527,7 +527,7 @@ public: ret = String::utf8(env->GetStringUTFChars((jstring)o, NULL)); env->DeleteLocalRef(o); } break; - case Variant::STRING_ARRAY: { + case Variant::POOL_STRING_ARRAY: { jobjectArray arr = (jobjectArray)env->CallObjectMethodA(instance,E->get().method,v); @@ -535,31 +535,31 @@ public: env->DeleteLocalRef(arr); } break; - case Variant::INT_ARRAY: { + case Variant::POOL_INT_ARRAY: { jintArray arr = (jintArray)env->CallObjectMethodA(instance,E->get().method,v); int fCount = env->GetArrayLength(arr); - DVector<int> sarr; + PoolVector<int> sarr; sarr.resize(fCount); - DVector<int>::Write w = sarr.write(); + PoolVector<int>::Write w = sarr.write(); env->GetIntArrayRegion(arr,0,fCount,w.ptr()); - w = DVector<int>::Write(); + w = PoolVector<int>::Write(); ret=sarr; env->DeleteLocalRef(arr); } break; - case Variant::REAL_ARRAY: { + case Variant::POOL_REAL_ARRAY: { jfloatArray arr = (jfloatArray)env->CallObjectMethodA(instance,E->get().method,v); int fCount = env->GetArrayLength(arr); - DVector<float> sarr; + PoolVector<float> sarr; sarr.resize(fCount); - DVector<float>::Write w = sarr.write(); + PoolVector<float>::Write w = sarr.write(); env->GetFloatArrayRegion(arr,0,fCount,w.ptr()); - w = DVector<float>::Write(); + w = PoolVector<float>::Write(); ret=sarr; env->DeleteLocalRef(arr); } break; @@ -642,7 +642,7 @@ struct JAndroidPointerEvent { static List<JAndroidPointerEvent> pointer_events; static List<InputEvent> key_events; -static List<OS_Android::JoystickEvent> joy_events; +static List<OS_Android::JoypadEvent> joy_events; static bool initialized=false; static Mutex *input_mutex=NULL; static Mutex *suspend_mutex=NULL; @@ -679,6 +679,7 @@ static jmethodID _isVideoPlaying=0; static jmethodID _pauseVideo=0; static jmethodID _stopVideo=0; static jmethodID _setKeepScreenOn=0; +static jmethodID _alertDialog=0; static void _gfx_init_func(void* ud, bool gl2) { @@ -783,6 +784,13 @@ static void _set_keep_screen_on(bool p_enabled) { env->CallVoidMethod(_godot_instance, _setKeepScreenOn, p_enabled); } +static void _alert(const String& p_message, const String& p_title) { + JNIEnv* env = ThreadAndroid::get_env(); + jstring jStrMessage = env->NewStringUTF(p_message.utf8().get_data()); + jstring jStrTitle = env->NewStringUTF(p_title.utf8().get_data()); + env->CallVoidMethod(_godot_instance, _alertDialog, jStrMessage, jStrTitle); +} + JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv * env, jobject obj, jobject activity,jboolean p_need_reload_hook, jobjectArray p_cmdline,jobject p_asset_manager) { __android_log_print(ANDROID_LOG_INFO,"godot","**INIT EVENT! - %p\n",env); @@ -820,6 +828,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv * e _on_video_init = env->GetMethodID(cls, "onVideoInit", "(Z)V"); _setKeepScreenOn = env->GetMethodID(cls,"setKeepScreenOn","(Z)V"); + _alertDialog = env->GetMethodID(cls,"alert","(Ljava/lang/String;Ljava/lang/String;)V"); jclass clsio = env->FindClass("org/godotengine/godot/Godot"); if (cls) { @@ -883,7 +892,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv * e __android_log_print(ANDROID_LOG_INFO,"godot","CMDLINE LEN %i - APK EXPANSION %I\n",cmdlen,int(use_apk_expansion)); - os_android = new OS_Android(_gfx_init_func,env,_open_uri,_get_data_dir,_get_locale, _get_model, _get_screen_dpi, _show_vk, _hide_vk,_set_screen_orient,_get_unique_id, _get_system_dir, _play_video,_is_video_playing, _pause_video, _stop_video, _set_keep_screen_on, use_apk_expansion); + os_android = new OS_Android(_gfx_init_func,env,_open_uri,_get_data_dir,_get_locale, _get_model, _get_screen_dpi, _show_vk, _hide_vk,_set_screen_orient,_get_unique_id, _get_system_dir, _play_video,_is_video_playing, _pause_video, _stop_video, _set_keep_screen_on, _alert, use_apk_expansion); os_android->set_need_reload_hooks(p_need_reload_hook); char wd[500]; @@ -912,7 +921,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv * e __android_log_print(ANDROID_LOG_INFO,"godot","*****SETUP OK"); //video driver is determined here, because once initialized, it cant be changed - String vd = Globals::get_singleton()->get("display/driver"); + String vd = GlobalConfig::get_singleton()->get("display/driver"); env->CallVoidMethod(_godot_instance, _on_video_init, (jboolean)true); @@ -967,7 +976,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_quit(JNIEnv * env, jo static void _initialize_java_modules() { - String modules = Globals::get_singleton()->get("android/modules"); + String modules = GlobalConfig::get_singleton()->get("android/modules"); Vector<String> mods = modules.split(",",false); print_line("ANDROID MODULES : " + modules); __android_log_print(ANDROID_LOG_INFO,"godot","mod count: %i",mods.size()); @@ -1042,7 +1051,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_step(JNIEnv * env, jo // because of the way android forces you to do everything with threads java_class_wrapper = memnew( JavaClassWrapper(_godot_instance )); - Globals::get_singleton()->add_singleton(Globals::Singleton("JavaClassWrapper",java_class_wrapper)); + GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("JavaClassWrapper",java_class_wrapper)); _initialize_java_modules(); Main::setup2(); @@ -1081,7 +1090,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_step(JNIEnv * env, jo while (joy_events.size()) { - OS_Android::JoystickEvent event = joy_events.front()->get(); + OS_Android::JoypadEvent event = joy_events.front()->get(); os_android->process_joy_event(event); joy_events.pop_front(); @@ -1406,7 +1415,7 @@ static unsigned int android_get_keysym(unsigned int p_code) { JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joybutton(JNIEnv * env, jobject obj, jint p_device, jint p_button, jboolean p_pressed) { - OS_Android::JoystickEvent jevent; + OS_Android::JoypadEvent jevent; jevent.device = p_device; jevent.type = OS_Android::JOY_EVENT_BUTTON; jevent.index = p_button; @@ -1419,7 +1428,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joybutton(JNIEnv * en JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joyaxis(JNIEnv * env, jobject obj, jint p_device, jint p_axis, jfloat p_value) { - OS_Android::JoystickEvent jevent; + OS_Android::JoypadEvent jevent; jevent.device = p_device; jevent.type = OS_Android::JOY_EVENT_AXIS; jevent.index = p_axis; @@ -1431,7 +1440,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joyaxis(JNIEnv * env, } JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joyhat(JNIEnv * env, jobject obj, jint p_device, jint p_hat_x, jint p_hat_y) { - OS_Android::JoystickEvent jevent; + OS_Android::JoypadEvent jevent; jevent.device = p_device; jevent.type = OS_Android::JOY_EVENT_HAT; int hat = 0; @@ -1561,8 +1570,8 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_singleton(JNIEnv * en s->set_instance(env->NewGlobalRef(p_object)); jni_singletons[singname]=s; - Globals::get_singleton()->add_singleton(Globals::Singleton(singname,s)); - Globals::get_singleton()->set(singname,s); + GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton(singname,s)); + GlobalConfig::get_singleton()->set(singname,s); } @@ -1579,10 +1588,10 @@ static Variant::Type get_jni_type(const String& p_type) { {"float",Variant::REAL}, {"double", Variant::REAL}, {"java.lang.String",Variant::STRING}, - {"[I",Variant::INT_ARRAY}, - {"[B",Variant::RAW_ARRAY}, - {"[F",Variant::REAL_ARRAY}, - {"[Ljava.lang.String;",Variant::STRING_ARRAY}, + {"[I",Variant::POOL_INT_ARRAY}, + {"[B",Variant::POOL_BYTE_ARRAY}, + {"[F",Variant::POOL_REAL_ARRAY}, + {"[Ljava.lang.String;",Variant::POOL_STRING_ARRAY}, {"org.godotengine.godot.Dictionary", Variant::DICTIONARY}, {NULL,Variant::NIL} }; @@ -1640,7 +1649,7 @@ JNIEXPORT jstring JNICALL Java_org_godotengine_godot_GodotLib_getGlobal(JNIEnv * String js = env->GetStringUTFChars( path, NULL ); - return env->NewStringUTF(Globals::get_singleton()->get(js).operator String().utf8().get_data()); + return env->NewStringUTF(GlobalConfig::get_singleton()->get(js).operator String().utf8().get_data()); } diff --git a/platform/android/java_glue.h b/platform/android/java_glue.h index f1c83f01e8..bc4628b9d4 100644 --- a/platform/android/java_glue.h +++ b/platform/android/java_glue.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index 862709fc7d..e625c0d7ec 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -246,9 +246,11 @@ void OS_Android::print(const char *p_format, ... ) { } -void OS_Android::alert(const String& p_alert) { +void OS_Android::alert(const String& p_alert,const String& p_title) { print("ALERT: %s\n",p_alert.utf8().get_data()); + if (alert_func) + alert_func(p_alert, p_title); } @@ -368,7 +370,7 @@ void OS_Android::main_loop_focusin(){ } -void OS_Android::process_joy_event(OS_Android::JoystickEvent p_event) { +void OS_Android::process_joy_event(OS_Android::JoypadEvent p_event) { switch (p_event.type) { case JOY_EVENT_BUTTON: @@ -746,7 +748,7 @@ String OS_Android::get_data_dir() const { return "."; - //return Globals::get_singleton()->get_singleton_object("GodotOS")->call("get_data_dir"); + //return GlobalConfig::get_singleton()->get_singleton_object("GodotOS")->call("get_data_dir"); } @@ -812,7 +814,7 @@ String OS_Android::get_joy_guid(int p_device) const { return input->get_joy_guid_remapped(p_device); } -OS_Android::OS_Android(GFXInitFunc p_gfx_init_func,void*p_gfx_init_ud, OpenURIFunc p_open_uri_func, GetDataDirFunc p_get_data_dir_func,GetLocaleFunc p_get_locale_func,GetModelFunc p_get_model_func, GetScreenDPIFunc p_get_screen_dpi_func, ShowVirtualKeyboardFunc p_show_vk, HideVirtualKeyboardFunc p_hide_vk, SetScreenOrientationFunc p_screen_orient,GetUniqueIDFunc p_get_unique_id,GetSystemDirFunc p_get_sdir_func, VideoPlayFunc p_video_play_func, VideoIsPlayingFunc p_video_is_playing_func, VideoPauseFunc p_video_pause_func, VideoStopFunc p_video_stop_func, SetKeepScreenOnFunc p_set_keep_screen_on_func, bool p_use_apk_expansion) { +OS_Android::OS_Android(GFXInitFunc p_gfx_init_func,void*p_gfx_init_ud, OpenURIFunc p_open_uri_func, GetDataDirFunc p_get_data_dir_func,GetLocaleFunc p_get_locale_func,GetModelFunc p_get_model_func, GetScreenDPIFunc p_get_screen_dpi_func, ShowVirtualKeyboardFunc p_show_vk, HideVirtualKeyboardFunc p_hide_vk, SetScreenOrientationFunc p_screen_orient,GetUniqueIDFunc p_get_unique_id,GetSystemDirFunc p_get_sdir_func, VideoPlayFunc p_video_play_func, VideoIsPlayingFunc p_video_is_playing_func, VideoPauseFunc p_video_pause_func, VideoStopFunc p_video_stop_func, SetKeepScreenOnFunc p_set_keep_screen_on_func, AlertFunc p_alert_func, bool p_use_apk_expansion) { use_apk_expansion=p_use_apk_expansion; default_videomode.width=800; @@ -846,6 +848,7 @@ OS_Android::OS_Android(GFXInitFunc p_gfx_init_func,void*p_gfx_init_ud, OpenURIFu set_screen_orientation_func=p_screen_orient; set_keep_screen_on_func = p_set_keep_screen_on_func; + alert_func = p_alert_func; use_reload_hooks=false; } diff --git a/platform/android/os_android.h b/platform/android/os_android.h index d383fd2036..5e1fc10fd6 100644 --- a/platform/android/os_android.h +++ b/platform/android/os_android.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -75,6 +75,7 @@ typedef bool (*VideoIsPlayingFunc)(); typedef void (*VideoPauseFunc)(); typedef void (*VideoStopFunc)(); typedef void (*SetKeepScreenOnFunc)(bool p_enabled); +typedef void (*AlertFunc)(const String&, const String&); class OS_Android : public OS_Unix { public: @@ -90,7 +91,7 @@ public: JOY_EVENT_HAT = 2 }; - struct JoystickEvent { + struct JoypadEvent { int device; int type; @@ -154,6 +155,7 @@ private: VideoPauseFunc video_pause_func; VideoStopFunc video_stop_func; SetKeepScreenOnFunc set_keep_screen_on_func; + AlertFunc alert_func; public: @@ -181,7 +183,7 @@ public: virtual void vprint(const char* p_format, va_list p_list, bool p_stderr=false); virtual void print(const char *p_format, ... ); - virtual void alert(const String& p_alert); + virtual void alert(const String& p_alert,const String& p_title="ALERT!"); virtual void set_mouse_show(bool p_show); @@ -247,7 +249,7 @@ public: void process_magnetometer(const Vector3& p_magnetometer); void process_gyroscope(const Vector3& p_gyroscope); void process_touch(int p_what,int p_pointer, const Vector<TouchPos>& p_points); - void process_joy_event(JoystickEvent p_event); + void process_joy_event(JoypadEvent p_event); void process_event(InputEvent p_event); void init_video_mode(int p_video_width,int p_video_height); @@ -260,7 +262,7 @@ public: virtual String get_joy_guid(int p_device) const; void joy_connection_changed(int p_device, bool p_connected, String p_name); - OS_Android(GFXInitFunc p_gfx_init_func,void*p_gfx_init_ud, OpenURIFunc p_open_uri_func, GetDataDirFunc p_get_data_dir_func,GetLocaleFunc p_get_locale_func,GetModelFunc p_get_model_func, GetScreenDPIFunc p_get_screen_dpi_func, ShowVirtualKeyboardFunc p_show_vk, HideVirtualKeyboardFunc p_hide_vk, SetScreenOrientationFunc p_screen_orient,GetUniqueIDFunc p_get_unique_id,GetSystemDirFunc p_get_sdir_func, VideoPlayFunc p_video_play_func, VideoIsPlayingFunc p_video_is_playing_func, VideoPauseFunc p_video_pause_func, VideoStopFunc p_video_stop_func, SetKeepScreenOnFunc p_set_keep_screen_on_func, bool p_use_apk_expansion); + OS_Android(GFXInitFunc p_gfx_init_func,void*p_gfx_init_ud, OpenURIFunc p_open_uri_func, GetDataDirFunc p_get_data_dir_func,GetLocaleFunc p_get_locale_func,GetModelFunc p_get_model_func, GetScreenDPIFunc p_get_screen_dpi_func, ShowVirtualKeyboardFunc p_show_vk, HideVirtualKeyboardFunc p_hide_vk, SetScreenOrientationFunc p_screen_orient,GetUniqueIDFunc p_get_unique_id,GetSystemDirFunc p_get_sdir_func, VideoPlayFunc p_video_play_func, VideoIsPlayingFunc p_video_is_playing_func, VideoPauseFunc p_video_pause_func, VideoStopFunc p_video_stop_func, SetKeepScreenOnFunc p_set_keep_screen_on_func, AlertFunc p_alert_func, bool p_use_apk_expansion); ~OS_Android(); }; diff --git a/platform/android/platform_config.h b/platform/android/platform_config.h index 143f16c1fa..cdef185ff0 100644 --- a/platform/android/platform_config.h +++ b/platform/android/platform_config.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/thread_jandroid.cpp b/platform/android/thread_jandroid.cpp index 73818b282f..aa40d995d9 100644 --- a/platform/android/thread_jandroid.cpp +++ b/platform/android/thread_jandroid.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/android/thread_jandroid.h b/platform/android/thread_jandroid.h index c8ad6c8735..6f52b730f1 100644 --- a/platform/android/thread_jandroid.h +++ b/platform/android/thread_jandroid.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/bb10/audio_driver_bb10.cpp b/platform/bb10/audio_driver_bb10.cpp index ef8adaf061..7b5c0800a8 100644 --- a/platform/bb10/audio_driver_bb10.cpp +++ b/platform/bb10/audio_driver_bb10.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/bb10/audio_driver_bb10.h b/platform/bb10/audio_driver_bb10.h index 0148448511..738bcf2619 100644 --- a/platform/bb10/audio_driver_bb10.h +++ b/platform/bb10/audio_driver_bb10.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/bb10/export/export.cpp b/platform/bb10/export/export.cpp index 14d87aef41..cc994c8f24 100644 --- a/platform/bb10/export/export.cpp +++ b/platform/bb10/export/export.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -43,7 +43,7 @@ class EditorExportPlatformBB10 : public EditorExportPlatform { - OBJ_TYPE( EditorExportPlatformBB10,EditorExportPlatform ); + GDCLASS( EditorExportPlatformBB10,EditorExportPlatform ); String custom_package; @@ -248,7 +248,7 @@ void EditorExportPlatformBB10::_fix_descriptor(Vector<uint8_t>& p_descriptor) { if (this->name!="") { aname=this->name; } else { - aname = Globals::get_singleton()->get("application/name"); + aname = GlobalConfig::get_singleton()->get("application/name"); } @@ -432,7 +432,7 @@ Error EditorExportPlatformBB10::export_project(const String& p_path, bool p_debu if (!found) { - String appicon = Globals::get_singleton()->get("application/icon"); + String appicon = GlobalConfig::get_singleton()->get("application/icon"); if (appicon!="" && appicon.ends_with(".png")) { FileAccess*f = FileAccess::open(appicon,FileAccess::READ); if (f) { @@ -469,7 +469,7 @@ Error EditorExportPlatformBB10::export_project(const String& p_path, bool p_debu ep.step("Creating BAR Package..",104); - String bb_packager=EditorSettings::get_singleton()->get("blackberry/host_tools"); + String bb_packager=EditorSettings::get_singleton()->get("export/blackberry/host_tools"); bb_packager=bb_packager.plus_file("blackberry-nativepackager"); if (OS::get_singleton()->get_name()=="Windows") bb_packager+=".bat"; @@ -485,7 +485,7 @@ Error EditorExportPlatformBB10::export_project(const String& p_path, bool p_debu args.push_back(p_path); if (p_debug) { - String debug_token=EditorSettings::get_singleton()->get("blackberry/debug_token"); + String debug_token=EditorSettings::get_singleton()->get("export/blackberry/debug_token"); if (!FileAccess::exists(debug_token)) { EditorNode::add_io_error("Debug token not found!"); } else { @@ -554,7 +554,7 @@ void EditorExportPlatformBB10::_device_poll_thread(void *ud) { while(!ea->quit_request) { - String bb_deploy=EditorSettings::get_singleton()->get("blackberry/host_tools"); + String bb_deploy=EditorSettings::get_singleton()->get("export/blackberry/host_tools"); bb_deploy=bb_deploy.plus_file("blackberry-deploy"); bool windows = OS::get_singleton()->get_name()=="Windows"; if (windows) @@ -567,10 +567,10 @@ void EditorExportPlatformBB10::_device_poll_thread(void *ud) { for (int i=0;i<MAX_DEVICES;i++) { - String host = EditorSettings::get_singleton()->get("blackberry/device_"+itos(i+1)+"/host"); + String host = EditorSettings::get_singleton()->get("export/blackberry/device_"+itos(i+1)+"/host"); if (host==String()) continue; - String pass = EditorSettings::get_singleton()->get("blackberry/device_"+itos(i+1)+"/password"); + String pass = EditorSettings::get_singleton()->get("export/blackberry/device_"+itos(i+1)+"/password"); if (pass==String()) continue; @@ -661,7 +661,7 @@ Error EditorExportPlatformBB10::run(int p_device, int p_flags) { ERR_FAIL_INDEX_V(p_device,devices.size(),ERR_INVALID_PARAMETER); - String bb_deploy=EditorSettings::get_singleton()->get("blackberry/host_tools"); + String bb_deploy=EditorSettings::get_singleton()->get("export/blackberry/host_tools"); bb_deploy=bb_deploy.plus_file("blackberry-deploy"); if (OS::get_singleton()->get_name()=="Windows") bb_deploy+=".bat"; @@ -714,8 +714,8 @@ Error EditorExportPlatformBB10::run(int p_device, int p_flags) { args.push_back("-installApp"); args.push_back("-launchApp"); args.push_back("-device"); - String host = EditorSettings::get_singleton()->get("blackberry/device_"+itos(p_device+1)+"/host"); - String pass = EditorSettings::get_singleton()->get("blackberry/device_"+itos(p_device+1)+"/password"); + String host = EditorSettings::get_singleton()->get("export/blackberry/device_"+itos(p_device+1)+"/host"); + String pass = EditorSettings::get_singleton()->get("export/blackberry/device_"+itos(p_device+1)+"/password"); args.push_back(host); args.push_back("-password"); args.push_back(pass); @@ -761,7 +761,7 @@ EditorExportPlatformBB10::EditorExportPlatformBB10() { bool EditorExportPlatformBB10::can_export(String *r_error) const { bool valid=true; - String bb_deploy=EditorSettings::get_singleton()->get("blackberry/host_tools"); + String bb_deploy=EditorSettings::get_singleton()->get("export/blackberry/host_tools"); String err; if (!FileAccess::exists(bb_deploy.plus_file("blackberry-deploy"))) { @@ -775,7 +775,7 @@ bool EditorExportPlatformBB10::can_export(String *r_error) const { err+="No export template found.\nDownload and install export templates.\n"; } - String debug_token=EditorSettings::get_singleton()->get("blackberry/debug_token"); + String debug_token=EditorSettings::get_singleton()->get("export/blackberry/debug_token"); if (!FileAccess::exists(debug_token)) { valid=false; @@ -806,20 +806,20 @@ EditorExportPlatformBB10::~EditorExportPlatformBB10() { void register_bb10_exporter() { - EDITOR_DEF("blackberry/host_tools",""); - EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"blackberry/host_tools",PROPERTY_HINT_GLOBAL_DIR)); - EDITOR_DEF("blackberry/debug_token",""); - EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"blackberry/debug_token",PROPERTY_HINT_GLOBAL_FILE,"bar")); - EDITOR_DEF("blackberry/device_1/host",""); - EDITOR_DEF("blackberry/device_1/password",""); - EDITOR_DEF("blackberry/device_2/host",""); - EDITOR_DEF("blackberry/device_2/password",""); - EDITOR_DEF("blackberry/device_3/host",""); - EDITOR_DEF("blackberry/device_3/password",""); - EDITOR_DEF("blackberry/device_4/host",""); - EDITOR_DEF("blackberry/device_4/password",""); - EDITOR_DEF("blackberry/device_5/host",""); - EDITOR_DEF("blackberry/device_5/password",""); + EDITOR_DEF("export/blackberry/host_tools",""); + EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"export/blackberry/host_tools",PROPERTY_HINT_GLOBAL_DIR)); + EDITOR_DEF("export/blackberry/debug_token",""); + EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"export/blackberry/debug_token",PROPERTY_HINT_GLOBAL_FILE,"bar")); + EDITOR_DEF("export/blackberry/device_1/host",""); + EDITOR_DEF("export/blackberry/device_1/password",""); + EDITOR_DEF("export/blackberry/device_2/host",""); + EDITOR_DEF("export/blackberry/device_2/password",""); + EDITOR_DEF("export/blackberry/device_3/host",""); + EDITOR_DEF("export/blackberry/device_3/password",""); + EDITOR_DEF("export/blackberry/device_4/host",""); + EDITOR_DEF("export/blackberry/device_4/password",""); + EDITOR_DEF("export/blackberry/device_5/host",""); + EDITOR_DEF("export/blackberry/device_5/password",""); Ref<EditorExportPlatformBB10> exporter = Ref<EditorExportPlatformBB10>( memnew(EditorExportPlatformBB10) ); EditorImportExport::get_singleton()->add_export_platform(exporter); diff --git a/platform/bb10/export/export.h b/platform/bb10/export/export.h index bd9cad5cb3..d8407c4152 100644 --- a/platform/bb10/export/export.h +++ b/platform/bb10/export/export.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/bb10/godot_bb10.cpp b/platform/bb10/godot_bb10.cpp index cba9d200cb..4b8270b495 100644 --- a/platform/bb10/godot_bb10.cpp +++ b/platform/bb10/godot_bb10.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/bb10/os_bb10.cpp b/platform/bb10/os_bb10.cpp index 58ea26b8c9..ed40355eb5 100644 --- a/platform/bb10/os_bb10.cpp +++ b/platform/bb10/os_bb10.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/bb10/os_bb10.h b/platform/bb10/os_bb10.h index 4ee5af8323..8011550987 100644 --- a/platform/bb10/os_bb10.h +++ b/platform/bb10/os_bb10.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/bb10/payment_service.cpp b/platform/bb10/payment_service.cpp index 77ec122b3b..3138dc2c1d 100644 --- a/platform/bb10/payment_service.cpp +++ b/platform/bb10/payment_service.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -38,11 +38,11 @@ extern char* launch_dir_ptr; void PaymentService::_bind_methods() { - ObjectTypeDB::bind_method(_MD("request_product_info"),&PaymentService::request_product_info); - ObjectTypeDB::bind_method(_MD("purchase"),&PaymentService::purchase); + ClassDB::bind_method(_MD("request_product_info"),&PaymentService::request_product_info); + ClassDB::bind_method(_MD("purchase"),&PaymentService::purchase); - ObjectTypeDB::bind_method(_MD("get_pending_event_count"),&PaymentService::get_pending_event_count); - ObjectTypeDB::bind_method(_MD("pop_pending_event"),&PaymentService::pop_pending_event); + ClassDB::bind_method(_MD("get_pending_event_count"),&PaymentService::get_pending_event_count); + ClassDB::bind_method(_MD("pop_pending_event"),&PaymentService::pop_pending_event); }; Error PaymentService::request_product_info(Variant p_params) { diff --git a/platform/bb10/payment_service.h b/platform/bb10/payment_service.h index 856b8df306..b31a954ef8 100644 --- a/platform/bb10/payment_service.h +++ b/platform/bb10/payment_service.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,7 +39,7 @@ class PaymentService : public Object { - OBJ_TYPE(PaymentService, Object); + GDCLASS(PaymentService, Object); static void _bind_methods(); diff --git a/platform/bb10/platform_config.h b/platform/bb10/platform_config.h index 143f16c1fa..cdef185ff0 100644 --- a/platform/bb10/platform_config.h +++ b/platform/bb10/platform_config.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/haiku/audio_driver_media_kit.cpp b/platform/haiku/audio_driver_media_kit.cpp index c7eed1c7cd..2af93061f8 100644 --- a/platform/haiku/audio_driver_media_kit.cpp +++ b/platform/haiku/audio_driver_media_kit.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/haiku/audio_driver_media_kit.h b/platform/haiku/audio_driver_media_kit.h index cdaf602831..fbf6bc20de 100644 --- a/platform/haiku/audio_driver_media_kit.h +++ b/platform/haiku/audio_driver_media_kit.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/haiku/context_gl_haiku.cpp b/platform/haiku/context_gl_haiku.cpp index bf890d14bf..c43e3f3928 100644 --- a/platform/haiku/context_gl_haiku.cpp +++ b/platform/haiku/context_gl_haiku.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/haiku/context_gl_haiku.h b/platform/haiku/context_gl_haiku.h index c7f80543aa..1fd62e89ba 100644 --- a/platform/haiku/context_gl_haiku.h +++ b/platform/haiku/context_gl_haiku.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/haiku/godot_haiku.cpp b/platform/haiku/godot_haiku.cpp index 71c9d30239..fccfa4336f 100644 --- a/platform/haiku/godot_haiku.cpp +++ b/platform/haiku/godot_haiku.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/haiku/haiku_application.cpp b/platform/haiku/haiku_application.cpp index 2b9604f563..1f35c6f58e 100644 --- a/platform/haiku/haiku_application.cpp +++ b/platform/haiku/haiku_application.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/haiku/haiku_application.h b/platform/haiku/haiku_application.h index 74316b9b1f..d85e6e4829 100644 --- a/platform/haiku/haiku_application.h +++ b/platform/haiku/haiku_application.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/haiku/haiku_direct_window.cpp b/platform/haiku/haiku_direct_window.cpp index 583453af1e..1def361367 100644 --- a/platform/haiku/haiku_direct_window.cpp +++ b/platform/haiku/haiku_direct_window.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/haiku/haiku_direct_window.h b/platform/haiku/haiku_direct_window.h index b4fdb6edb2..49785f79cb 100644 --- a/platform/haiku/haiku_direct_window.h +++ b/platform/haiku/haiku_direct_window.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/haiku/haiku_gl_view.cpp b/platform/haiku/haiku_gl_view.cpp index da0957c81d..66c143ea67 100644 --- a/platform/haiku/haiku_gl_view.cpp +++ b/platform/haiku/haiku_gl_view.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/haiku/haiku_gl_view.h b/platform/haiku/haiku_gl_view.h index 05c288e83b..6d64aab42e 100644 --- a/platform/haiku/haiku_gl_view.h +++ b/platform/haiku/haiku_gl_view.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/haiku/key_mapping_haiku.cpp b/platform/haiku/key_mapping_haiku.cpp index 43981b8855..f41a77c3fb 100644 --- a/platform/haiku/key_mapping_haiku.cpp +++ b/platform/haiku/key_mapping_haiku.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/haiku/key_mapping_haiku.h b/platform/haiku/key_mapping_haiku.h index 1309ee034d..81f5569fd0 100644 --- a/platform/haiku/key_mapping_haiku.h +++ b/platform/haiku/key_mapping_haiku.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp index f5674fb0eb..10e1b055be 100644 --- a/platform/haiku/os_haiku.cpp +++ b/platform/haiku/os_haiku.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/haiku/os_haiku.h b/platform/haiku/os_haiku.h index e1d6b5b7b9..fc873f49ad 100644 --- a/platform/haiku/os_haiku.h +++ b/platform/haiku/os_haiku.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/haiku/platform_config.h b/platform/haiku/platform_config.h index 72dc0e5149..a3aa918ba8 100644 --- a/platform/haiku/platform_config.h +++ b/platform/haiku/platform_config.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,4 +31,4 @@ // for ifaddrs.h needed in drivers/unix/ip_unix.cpp #define _BSD_SOURCE 1 -#define GLES2_INCLUDE_H <GL/glew.h> +#define GLES3_INCLUDE_H "glad/glad.h" diff --git a/platform/iphone/app_delegate.h b/platform/iphone/app_delegate.h index 54bfe78cf7..09c401b329 100644 --- a/platform/iphone/app_delegate.h +++ b/platform/iphone/app_delegate.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm index dab75e08c8..feb87e742f 100644 --- a/platform/iphone/app_delegate.mm +++ b/platform/iphone/app_delegate.mm @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -162,14 +162,14 @@ static int frame_count = 0; NSString* str = (NSString*)value; String uval = String::utf8([str UTF8String]); - Globals::get_singleton()->set("Info.plist/"+ukey, uval); + GlobalConfig::get_singleton()->set("Info.plist/"+ukey, uval); } else if ([value isKindOfClass:[NSNumber class]]) { NSNumber* n = (NSNumber*)value; double dval = [n doubleValue]; - Globals::get_singleton()->set("Info.plist/"+ukey, dval); + GlobalConfig::get_singleton()->set("Info.plist/"+ukey, dval); }; // do stuff } @@ -186,7 +186,7 @@ static int frame_count = 0; ++frame_count; #ifdef APPIRATER_ENABLED - int aid = Globals::get_singleton()->get("ios/app_id"); + int aid = GlobalConfig::get_singleton()->get("ios/app_id"); [Appirater appLaunched:YES app_id:aid]; #endif @@ -266,11 +266,11 @@ static int frame_count = 0; #ifdef MODULE_GAME_ANALYTICS_ENABLED printf("********************* didFinishLaunchingWithOptions\n"); - if(!Globals::get_singleton()->has("mobileapptracker/advertiser_id")) + if(!GlobalConfig::get_singleton()->has("mobileapptracker/advertiser_id")) { return; } - if(!Globals::get_singleton()->has("mobileapptracker/conversion_key")) + if(!GlobalConfig::get_singleton()->has("mobileapptracker/conversion_key")) { return; } diff --git a/platform/iphone/audio_driver_iphone.cpp b/platform/iphone/audio_driver_iphone.cpp index 0916c31f36..556576cdc3 100644 --- a/platform/iphone/audio_driver_iphone.cpp +++ b/platform/iphone/audio_driver_iphone.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/audio_driver_iphone.h b/platform/iphone/audio_driver_iphone.h index 0b143adf94..cbcb0cffce 100644 --- a/platform/iphone/audio_driver_iphone.h +++ b/platform/iphone/audio_driver_iphone.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/game_center.h b/platform/iphone/game_center.h index 62477a0da2..abbeaaf86f 100644 --- a/platform/iphone/game_center.h +++ b/platform/iphone/game_center.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class GameCenter : public Object { - OBJ_TYPE(GameCenter, Object); + GDCLASS(GameCenter, Object); static GameCenter* instance; static void _bind_methods(); diff --git a/platform/iphone/game_center.mm b/platform/iphone/game_center.mm index a5b90514da..03ee327d65 100644 --- a/platform/iphone/game_center.mm +++ b/platform/iphone/game_center.mm @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -48,18 +48,18 @@ extern "C" { GameCenter* GameCenter::instance = NULL; void GameCenter::_bind_methods() { - ObjectTypeDB::bind_method(_MD("connect"),&GameCenter::connect); - ObjectTypeDB::bind_method(_MD("is_connected"),&GameCenter::is_connected); - - ObjectTypeDB::bind_method(_MD("post_score"),&GameCenter::post_score); - ObjectTypeDB::bind_method(_MD("award_achievement"),&GameCenter::award_achievement); - ObjectTypeDB::bind_method(_MD("reset_achievements"),&GameCenter::reset_achievements); - ObjectTypeDB::bind_method(_MD("request_achievements"),&GameCenter::request_achievements); - ObjectTypeDB::bind_method(_MD("request_achievement_descriptions"),&GameCenter::request_achievement_descriptions); - ObjectTypeDB::bind_method(_MD("show_game_center"),&GameCenter::show_game_center); - - ObjectTypeDB::bind_method(_MD("get_pending_event_count"),&GameCenter::get_pending_event_count); - ObjectTypeDB::bind_method(_MD("pop_pending_event"),&GameCenter::pop_pending_event); + ClassDB::bind_method(_MD("connect"),&GameCenter::connect); + ClassDB::bind_method(_MD("is_connected"),&GameCenter::is_connected); + + ClassDB::bind_method(_MD("post_score"),&GameCenter::post_score); + ClassDB::bind_method(_MD("award_achievement"),&GameCenter::award_achievement); + ClassDB::bind_method(_MD("reset_achievements"),&GameCenter::reset_achievements); + ClassDB::bind_method(_MD("request_achievements"),&GameCenter::request_achievements); + ClassDB::bind_method(_MD("request_achievement_descriptions"),&GameCenter::request_achievement_descriptions); + ClassDB::bind_method(_MD("show_game_center"),&GameCenter::show_game_center); + + ClassDB::bind_method(_MD("get_pending_event_count"),&GameCenter::get_pending_event_count); + ClassDB::bind_method(_MD("pop_pending_event"),&GameCenter::pop_pending_event); }; diff --git a/platform/iphone/gl_view.h b/platform/iphone/gl_view.h index 9c27c6a025..49e7810f08 100755 --- a/platform/iphone/gl_view.h +++ b/platform/iphone/gl_view.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/gl_view.mm b/platform/iphone/gl_view.mm index 607352ab0b..3df29c5178 100755 --- a/platform/iphone/gl_view.mm +++ b/platform/iphone/gl_view.mm @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -76,7 +76,7 @@ void _hide_keyboard() { }; bool _play_video(String p_path, float p_volume, String p_audio_track, String p_subtitle_track) { - p_path = Globals::get_singleton()->globalize_path(p_path); + p_path = GlobalConfig::get_singleton()->globalize_path(p_path); NSString* file_path = [[[NSString alloc] initWithUTF8String:p_path.utf8().get_data()] autorelease]; diff --git a/platform/iphone/globals/global_defaults.cpp b/platform/iphone/globals/global_defaults.cpp index 23261ceb02..76b5c9aa01 100755 --- a/platform/iphone/globals/global_defaults.cpp +++ b/platform/iphone/globals/global_defaults.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,9 +32,10 @@ void register_iphone_global_defaults() { - GLOBAL_DEF("rasterizer.iOS/use_fragment_lighting",false); + /*GLOBAL_DEF("rasterizer.iOS/use_fragment_lighting",false); GLOBAL_DEF("rasterizer.iOS/fp16_framebuffer",false); GLOBAL_DEF("display.iOS/driver","GLES2"); - Globals::get_singleton()->set_custom_property_info("display.iOS/driver",PropertyInfo(Variant::STRING,"display.iOS/driver",PROPERTY_HINT_ENUM,"GLES1,GLES2")); + GlobalConfig::get_singleton()->set_custom_property_info("display.iOS/driver",PropertyInfo(Variant::STRING,"display.iOS/driver",PROPERTY_HINT_ENUM,"GLES1,GLES2")); GLOBAL_DEF("display.iOS/use_cadisplaylink",true); + */ } diff --git a/platform/iphone/globals/global_defaults.h b/platform/iphone/globals/global_defaults.h index 0f4bf64c9b..1432b74425 100644 --- a/platform/iphone/globals/global_defaults.h +++ b/platform/iphone/globals/global_defaults.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/godot_iphone.cpp b/platform/iphone/godot_iphone.cpp index 2ecfe1545e..27804e5c03 100644 --- a/platform/iphone/godot_iphone.cpp +++ b/platform/iphone/godot_iphone.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/icloud.h b/platform/iphone/icloud.h index dcf3677c85..ba50c4be15 100644 --- a/platform/iphone/icloud.h +++ b/platform/iphone/icloud.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ class ICloud : public Object { - OBJ_TYPE(ICloud, Object); + GDCLASS(ICloud, Object); static ICloud* instance; static void _bind_methods(); diff --git a/platform/iphone/icloud.mm b/platform/iphone/icloud.mm index 0b3efe41fc..de70bb7e14 100644 --- a/platform/iphone/icloud.mm +++ b/platform/iphone/icloud.mm @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -44,14 +44,14 @@ extern "C" { ICloud* ICloud::instance = NULL; void ICloud::_bind_methods() { - ObjectTypeDB::bind_method(_MD("remove_key"),&ICloud::remove_key); - ObjectTypeDB::bind_method(_MD("set_key_values"),&ICloud::set_key_values); - ObjectTypeDB::bind_method(_MD("get_key_value"),&ICloud::get_key_value); - ObjectTypeDB::bind_method(_MD("synchronize_key_values"),&ICloud::synchronize_key_values); - ObjectTypeDB::bind_method(_MD("get_all_key_values"),&ICloud::get_all_key_values); - - ObjectTypeDB::bind_method(_MD("get_pending_event_count"),&ICloud::get_pending_event_count); - ObjectTypeDB::bind_method(_MD("pop_pending_event"),&ICloud::pop_pending_event); + ClassDB::bind_method(_MD("remove_key"),&ICloud::remove_key); + ClassDB::bind_method(_MD("set_key_values"),&ICloud::set_key_values); + ClassDB::bind_method(_MD("get_key_value"),&ICloud::get_key_value); + ClassDB::bind_method(_MD("synchronize_key_values"),&ICloud::synchronize_key_values); + ClassDB::bind_method(_MD("get_all_key_values"),&ICloud::get_all_key_values); + + ClassDB::bind_method(_MD("get_pending_event_count"),&ICloud::get_pending_event_count); + ClassDB::bind_method(_MD("pop_pending_event"),&ICloud::pop_pending_event); }; int ICloud::get_pending_event_count() { diff --git a/platform/iphone/in_app_store.h b/platform/iphone/in_app_store.h index bd4215231e..59a745c0f7 100644 --- a/platform/iphone/in_app_store.h +++ b/platform/iphone/in_app_store.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class InAppStore : public Object { - OBJ_TYPE(InAppStore, Object); + GDCLASS(InAppStore, Object); static InAppStore* instance; static void _bind_methods(); diff --git a/platform/iphone/in_app_store.mm b/platform/iphone/in_app_store.mm index a2efe2711b..49026ceb0a 100644 --- a/platform/iphone/in_app_store.mm +++ b/platform/iphone/in_app_store.mm @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -66,13 +66,13 @@ NSMutableDictionary* pending_transactions = [NSMutableDictionary dictionary]; InAppStore* InAppStore::instance = NULL; void InAppStore::_bind_methods() { - ObjectTypeDB::bind_method(_MD("request_product_info"),&InAppStore::request_product_info); - ObjectTypeDB::bind_method(_MD("purchase"),&InAppStore::purchase); + ClassDB::bind_method(_MD("request_product_info"),&InAppStore::request_product_info); + ClassDB::bind_method(_MD("purchase"),&InAppStore::purchase); - ObjectTypeDB::bind_method(_MD("get_pending_event_count"),&InAppStore::get_pending_event_count); - ObjectTypeDB::bind_method(_MD("pop_pending_event"),&InAppStore::pop_pending_event); - ObjectTypeDB::bind_method(_MD("finish_transaction"),&InAppStore::finish_transaction); - ObjectTypeDB::bind_method(_MD("set_auto_finish_transaction"),&InAppStore::set_auto_finish_transaction); + ClassDB::bind_method(_MD("get_pending_event_count"),&InAppStore::get_pending_event_count); + ClassDB::bind_method(_MD("pop_pending_event"),&InAppStore::pop_pending_event); + ClassDB::bind_method(_MD("finish_transaction"),&InAppStore::finish_transaction); + ClassDB::bind_method(_MD("set_auto_finish_transaction"),&InAppStore::set_auto_finish_transaction); }; @interface ProductsDelegate : NSObject<SKProductsRequestDelegate> { diff --git a/platform/iphone/ios.h b/platform/iphone/ios.h index 8861417284..345bf127f2 100644 --- a/platform/iphone/ios.h +++ b/platform/iphone/ios.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class iOS : public Object { - OBJ_TYPE(iOS, Object); + GDCLASS(iOS, Object); static void _bind_methods(); diff --git a/platform/iphone/ios.mm b/platform/iphone/ios.mm index 949d3bcb27..a068d4aa31 100644 --- a/platform/iphone/ios.mm +++ b/platform/iphone/ios.mm @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,7 +32,7 @@ void iOS::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_rate_url","app_id"),&iOS::get_rate_url); + ClassDB::bind_method(_MD("get_rate_url","app_id"),&iOS::get_rate_url); }; String iOS::get_rate_url(int p_app_id) const { diff --git a/platform/iphone/main.m b/platform/iphone/main.m index ea46a69672..02a45737c5 100644 --- a/platform/iphone/main.m +++ b/platform/iphone/main.m @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp index 93496e8225..1d12501aea 100644 --- a/platform/iphone/os_iphone.cpp +++ b/platform/iphone/os_iphone.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -331,7 +331,7 @@ void OSIPhone::update_accelerometer(float p_x, float p_y, float p_z) { if (p_x != last_accel.x) { //printf("updating accel x %f\n", p_x); InputEvent ev; - ev.type = InputEvent::JOYSTICK_MOTION; + ev.type = InputEvent::JOYPAD_MOTION; ev.device = 0; ev.joy_motion.axis = JOY_ANALOG_0_X; ev.joy_motion.axis_value = (p_x / (float)ACCEL_RANGE); @@ -342,7 +342,7 @@ void OSIPhone::update_accelerometer(float p_x, float p_y, float p_z) { if (p_y != last_accel.y) { //printf("updating accel y %f\n", p_y); InputEvent ev; - ev.type = InputEvent::JOYSTICK_MOTION; + ev.type = InputEvent::JOYPAD_MOTION; ev.device = 0; ev.joy_motion.axis = JOY_ANALOG_0_Y; ev.joy_motion.axis_value = (p_y / (float)ACCEL_RANGE); @@ -353,7 +353,7 @@ void OSIPhone::update_accelerometer(float p_x, float p_y, float p_z) { if (p_z != last_accel.z) { //printf("updating accel z %f\n", p_z); InputEvent ev; - ev.type = InputEvent::JOYSTICK_MOTION; + ev.type = InputEvent::JOYPAD_MOTION; ev.device = 0; ev.joy_motion.axis = JOY_ANALOG_1_X; ev.joy_motion.axis_value = ( (1.0 - p_z) / (float)ACCEL_RANGE); diff --git a/platform/iphone/os_iphone.h b/platform/iphone/os_iphone.h index 9f919940c0..331b20afbf 100644 --- a/platform/iphone/os_iphone.h +++ b/platform/iphone/os_iphone.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/platform_config.h b/platform/iphone/platform_config.h index e40f670185..c8468f0152 100644 --- a/platform/iphone/platform_config.h +++ b/platform/iphone/platform_config.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/platform_refcount.h b/platform/iphone/platform_refcount.h index 3bf8652b4a..d32fb4514c 100644 --- a/platform/iphone/platform_refcount.h +++ b/platform/iphone/platform_refcount.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/rasterizer_iphone.cpp b/platform/iphone/rasterizer_iphone.cpp index 99e83343d0..ee0457cfb1 100644 --- a/platform/iphone/rasterizer_iphone.cpp +++ b/platform/iphone/rasterizer_iphone.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -134,21 +134,21 @@ static Image _get_gl_image_and_format(const Image& p_image, Image::Format p_form switch(p_format) { - case Image::FORMAT_GRAYSCALE: { + case Image::FORMAT_L8: { r_gl_components=1; r_gl_format=GL_LUMINANCE; } break; case Image::FORMAT_INTENSITY: { - image.convert(Image::FORMAT_RGBA); + image.convert(Image::FORMAT_RGBA8); r_gl_components=4; r_gl_format=GL_RGBA; r_has_alpha_cache=true; } break; - case Image::FORMAT_GRAYSCALE_ALPHA: { + case Image::FORMAT_LA8: { - image.convert(Image::FORMAT_RGBA); + image.convert(Image::FORMAT_RGBA8); r_gl_components=4; r_gl_format=GL_RGBA; r_has_alpha_cache=true; @@ -156,7 +156,7 @@ static Image _get_gl_image_and_format(const Image& p_image, Image::Format p_form case Image::FORMAT_INDEXED: { - image.convert(Image::FORMAT_RGB); + image.convert(Image::FORMAT_RGB8); r_gl_components=3; r_gl_format=GL_RGB; @@ -164,17 +164,17 @@ static Image _get_gl_image_and_format(const Image& p_image, Image::Format p_form case Image::FORMAT_INDEXED_ALPHA: { - image.convert(Image::FORMAT_RGBA); + image.convert(Image::FORMAT_RGBA8); r_gl_components=4; r_gl_format=GL_RGB; r_has_alpha_cache=true; } break; - case Image::FORMAT_RGB: { + case Image::FORMAT_RGB8: { r_gl_components=3; r_gl_format=GL_RGB; } break; - case Image::FORMAT_RGBA: { + case Image::FORMAT_RGBA8: { r_gl_components=4; r_gl_format=GL_RGBA; @@ -286,7 +286,7 @@ void RasterizerIPhone::texture_blit_rect(RID p_texture,int p_x,int p_y, const Im GLenum blit_target = GL_TEXTURE_2D; //(texture->target == GL_TEXTURE_CUBE_MAP)?_cube_side_enum[p_cube_side]:GL_TEXTURE_2D; - DVector<uint8_t>::Read read = img.get_data().read(); + PoolVector<uint8_t>::Read read = img.get_data().read(); glBindTexture(texture->target, texture->tex_id); glTexSubImage2D( blit_target, 0, p_x,p_y,img.get_width(),img.get_height(),format,GL_UNSIGNED_BYTE,read.ptr() ); @@ -344,7 +344,7 @@ Image::Format RasterizerIPhone::texture_get_format(RID p_texture) const { Texture * texture = texture_owner.get(p_texture); - ERR_FAIL_COND_V(!texture,Image::FORMAT_GRAYSCALE); + ERR_FAIL_COND_V(!texture,Image::FORMAT_L8); return texture->format; } @@ -486,7 +486,7 @@ RID RasterizerIPhone::material_create() { return material_owner.make_rid( memnew( Material ) ); } -void RasterizerIPhone::fixed_material_set_parameter(RID p_material, VS::FixedMaterialParam p_parameter, const Variant& p_value) { +void RasterizerIPhone::fixed_material_set_parameter(RID p_material, VS::FixedSpatialMaterialParam p_parameter, const Variant& p_value) { Material *m=material_owner.get( p_material ); ERR_FAIL_COND(!m); @@ -494,7 +494,7 @@ void RasterizerIPhone::fixed_material_set_parameter(RID p_material, VS::FixedMat m->parameters[p_parameter] = p_value; } -Variant RasterizerIPhone::fixed_material_get_parameter(RID p_material,VS::FixedMaterialParam p_parameter) const { +Variant RasterizerIPhone::fixed_material_get_parameter(RID p_material,VS::FixedSpatialMaterialParam p_parameter) const { Material *m=material_owner.get( p_material ); ERR_FAIL_COND_V(!m, Variant()); @@ -503,7 +503,7 @@ Variant RasterizerIPhone::fixed_material_get_parameter(RID p_material,VS::FixedM return m->parameters[p_parameter]; } -void RasterizerIPhone::fixed_material_set_texture(RID p_material,VS::FixedMaterialParam p_parameter, RID p_texture) { +void RasterizerIPhone::fixed_material_set_texture(RID p_material,VS::FixedSpatialMaterialParam p_parameter, RID p_texture) { Material *m=material_owner.get( p_material ); ERR_FAIL_COND(!m); @@ -511,7 +511,7 @@ void RasterizerIPhone::fixed_material_set_texture(RID p_material,VS::FixedMateri m->textures[p_parameter] = p_texture; } -RID RasterizerIPhone::fixed_material_get_texture(RID p_material,VS::FixedMaterialParam p_parameter) const { +RID RasterizerIPhone::fixed_material_get_texture(RID p_material,VS::FixedSpatialMaterialParam p_parameter) const { Material *m=material_owner.get( p_material ); ERR_FAIL_COND_V(!m, RID()); @@ -535,7 +535,7 @@ VS::MaterialBlendMode RasterizerIPhone::fixed_material_get_detail_blend_mode(RID return m->detail_blend_mode; } -void RasterizerIPhone::fixed_material_set_texcoord_mode(RID p_material,VS::FixedMaterialParam p_parameter, VS::FixedMaterialTexCoordMode p_mode) { +void RasterizerIPhone::fixed_material_set_texcoord_mode(RID p_material,VS::FixedSpatialMaterialParam p_parameter, VS::FixedSpatialMaterialTexCoordMode p_mode) { Material *m=material_owner.get( p_material ); ERR_FAIL_COND(!m); @@ -543,7 +543,7 @@ void RasterizerIPhone::fixed_material_set_texcoord_mode(RID p_material,VS::Fixed m->texcoord_mode[p_parameter] = p_mode; } -VS::FixedMaterialTexCoordMode RasterizerIPhone::fixed_material_get_texcoord_mode(RID p_material,VS::FixedMaterialParam p_parameter) const { +VS::FixedSpatialMaterialTexCoordMode RasterizerIPhone::fixed_material_get_texcoord_mode(RID p_material,VS::FixedSpatialMaterialParam p_parameter) const { Material *m=material_owner.get( p_material ); ERR_FAIL_COND_V(!m, VS::FIXED_MATERIAL_TEXCOORD_TEXGEN); @@ -552,7 +552,7 @@ VS::FixedMaterialTexCoordMode RasterizerIPhone::fixed_material_get_texcoord_mode return m->texcoord_mode[p_parameter]; // for now } -void RasterizerIPhone::fixed_material_set_texgen_mode(RID p_material,VS::FixedMaterialTexGenMode p_mode) { +void RasterizerIPhone::fixed_material_set_texgen_mode(RID p_material,VS::FixedSpatialMaterialTexGenMode p_mode) { Material *m=material_owner.get( p_material ); ERR_FAIL_COND(!m); @@ -560,7 +560,7 @@ void RasterizerIPhone::fixed_material_set_texgen_mode(RID p_material,VS::FixedMa m->texgen_mode = p_mode; }; -VS::FixedMaterialTexGenMode RasterizerIPhone::fixed_material_get_texgen_mode(RID p_material) const { +VS::FixedSpatialMaterialTexGenMode RasterizerIPhone::fixed_material_get_texgen_mode(RID p_material) const { Material *m=material_owner.get( p_material ); ERR_FAIL_COND_V(!m, VS::FIXED_MATERIAL_TEXGEN_SPHERE); @@ -770,7 +770,7 @@ Error RasterizerIPhone::mesh_surface_set_array(RID p_mesh, int p_surface,VS::Arr ERR_FAIL_COND_V( surface->index_array_len<=0, ERR_INVALID_DATA ); ERR_FAIL_COND_V( p_array.get_type() != Variant::INT_ARRAY, ERR_INVALID_PARAMETER ); - DVector<int> indices = p_array; + PoolVector<int> indices = p_array; ERR_FAIL_COND_V( indices.size() == 0, ERR_INVALID_PARAMETER ); ERR_FAIL_COND_V( indices.size() != surface->index_array_len, ERR_INVALID_PARAMETER ); @@ -780,7 +780,7 @@ Error RasterizerIPhone::mesh_surface_set_array(RID p_mesh, int p_surface,VS::Arr glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,surface->index_id); }; - DVector<int>::Read read = indices.read(); + PoolVector<int>::Read read = indices.read(); const int *src=read.ptr(); for (int i=0;i<surface->index_array_len;i++) { @@ -822,14 +822,14 @@ Error RasterizerIPhone::mesh_surface_set_array(RID p_mesh, int p_surface,VS::Arr ERR_FAIL_COND_V( p_array.get_type() != Variant::VECTOR3_ARRAY, ERR_INVALID_PARAMETER ); - DVector<Vector3> array = p_array; + PoolVector<Vector3> array = p_array; ERR_FAIL_COND_V( array.size() != surface->array_len, ERR_INVALID_PARAMETER ); if (surface->array_local == 0) { glBindBuffer(GL_ARRAY_BUFFER,surface->vertex_id); }; - DVector<Vector3>::Read read = array.read(); + PoolVector<Vector3>::Read read = array.read(); const Vector3* src=read.ptr(); // setting vertices means regenerating the AABB @@ -868,7 +868,7 @@ Error RasterizerIPhone::mesh_surface_set_array(RID p_mesh, int p_surface,VS::Arr ERR_FAIL_COND_V( p_array.get_type() != Variant::REAL_ARRAY, ERR_INVALID_PARAMETER ); - DVector<real_t> array = p_array; + PoolVector<real_t> array = p_array; ERR_FAIL_COND_V( array.size() != surface->array_len*4, ERR_INVALID_PARAMETER ); @@ -877,7 +877,7 @@ Error RasterizerIPhone::mesh_surface_set_array(RID p_mesh, int p_surface,VS::Arr }; - DVector<real_t>::Read read = array.read(); + PoolVector<real_t>::Read read = array.read(); const real_t* src = read.ptr(); for (int i=0;i<surface->array_len;i++) { @@ -908,7 +908,7 @@ Error RasterizerIPhone::mesh_surface_set_array(RID p_mesh, int p_surface,VS::Arr ERR_FAIL_COND_V( p_array.get_type() != Variant::COLOR_ARRAY, ERR_INVALID_PARAMETER ); - DVector<Color> array = p_array; + PoolVector<Color> array = p_array; ERR_FAIL_COND_V( array.size() != surface->array_len, ERR_INVALID_PARAMETER ); @@ -916,7 +916,7 @@ Error RasterizerIPhone::mesh_surface_set_array(RID p_mesh, int p_surface,VS::Arr glBindBuffer(GL_ARRAY_BUFFER,surface->vertex_id); - DVector<Color>::Read read = array.read(); + PoolVector<Color>::Read read = array.read(); const Color* src = read.ptr(); surface->has_alpha_cache=false; @@ -943,14 +943,14 @@ Error RasterizerIPhone::mesh_surface_set_array(RID p_mesh, int p_surface,VS::Arr ERR_FAIL_COND_V( p_array.get_type() != Variant::VECTOR3_ARRAY, ERR_INVALID_PARAMETER ); - DVector<Vector3> array = p_array; + PoolVector<Vector3> array = p_array; ERR_FAIL_COND_V( array.size() != surface->array_len , ERR_INVALID_PARAMETER); if (surface->array_local == 0) glBindBuffer(GL_ARRAY_BUFFER,surface->vertex_id); - DVector<Vector3>::Read read = array.read(); + PoolVector<Vector3>::Read read = array.read(); const Vector3 * src=read.ptr(); @@ -975,14 +975,14 @@ Error RasterizerIPhone::mesh_surface_set_array(RID p_mesh, int p_surface,VS::Arr ERR_FAIL_COND_V( p_array.get_type() != Variant::REAL_ARRAY, ERR_INVALID_PARAMETER ); - DVector<real_t> array = p_array; + PoolVector<real_t> array = p_array; ERR_FAIL_COND_V( array.size() != surface->array_len*VS::ARRAY_WEIGHTS_SIZE, ERR_INVALID_PARAMETER ); if (surface->array_local == 0) glBindBuffer(GL_ARRAY_BUFFER,surface->vertex_id); - DVector<real_t>::Read read = array.read(); + PoolVector<real_t>::Read read = array.read(); const real_t * src = read.ptr(); diff --git a/platform/iphone/rasterizer_iphone.h b/platform/iphone/rasterizer_iphone.h index add656b190..cec367e2fa 100644 --- a/platform/iphone/rasterizer_iphone.h +++ b/platform/iphone/rasterizer_iphone.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -74,7 +74,7 @@ class RasterizerIPhone : public Rasterizer { flags=width=height=0; tex_id=0; - format=Image::FORMAT_GRAYSCALE; + format=Image::FORMAT_L8; gl_components_cache=0; format_has_alpha=false; has_alpha=false; @@ -100,11 +100,11 @@ class RasterizerIPhone : public Rasterizer { RID textures[VisualServer::FIXED_MATERIAL_PARAM_MAX]; Transform uv_transform; - VS::FixedMaterialTexCoordMode texcoord_mode[VisualServer::FIXED_MATERIAL_PARAM_MAX]; + VS::FixedSpatialMaterialTexCoordMode texcoord_mode[VisualServer::FIXED_MATERIAL_PARAM_MAX]; VS::MaterialBlendMode detail_blend_mode; - VS::FixedMaterialTexGenMode texgen_mode; + VS::FixedSpatialMaterialTexGenMode texgen_mode; Material() { @@ -624,20 +624,20 @@ public: virtual RID material_create(); - virtual void fixed_material_set_parameter(RID p_material, VS::FixedMaterialParam p_parameter, const Variant& p_value); - virtual Variant fixed_material_get_parameter(RID p_material,VS::FixedMaterialParam p_parameter) const; + virtual void fixed_material_set_parameter(RID p_material, VS::FixedSpatialMaterialParam p_parameter, const Variant& p_value); + virtual Variant fixed_material_get_parameter(RID p_material,VS::FixedSpatialMaterialParam p_parameter) const; - virtual void fixed_material_set_texture(RID p_material,VS::FixedMaterialParam p_parameter, RID p_texture); - virtual RID fixed_material_get_texture(RID p_material,VS::FixedMaterialParam p_parameter) const; + virtual void fixed_material_set_texture(RID p_material,VS::FixedSpatialMaterialParam p_parameter, RID p_texture); + virtual RID fixed_material_get_texture(RID p_material,VS::FixedSpatialMaterialParam p_parameter) const; virtual void fixed_material_set_detail_blend_mode(RID p_material,VS::MaterialBlendMode p_mode); virtual VS::MaterialBlendMode fixed_material_get_detail_blend_mode(RID p_material) const; - virtual void fixed_material_set_texgen_mode(RID p_material,VS::FixedMaterialTexGenMode p_mode); - virtual VS::FixedMaterialTexGenMode fixed_material_get_texgen_mode(RID p_material) const; + virtual void fixed_material_set_texgen_mode(RID p_material,VS::FixedSpatialMaterialTexGenMode p_mode); + virtual VS::FixedSpatialMaterialTexGenMode fixed_material_get_texgen_mode(RID p_material) const; - virtual void fixed_material_set_texcoord_mode(RID p_material,VS::FixedMaterialParam p_parameter, VS::FixedMaterialTexCoordMode p_mode); - virtual VS::FixedMaterialTexCoordMode fixed_material_get_texcoord_mode(RID p_material,VS::FixedMaterialParam p_parameter) const; + virtual void fixed_material_set_texcoord_mode(RID p_material,VS::FixedSpatialMaterialParam p_parameter, VS::FixedSpatialMaterialTexCoordMode p_mode); + virtual VS::FixedSpatialMaterialTexCoordMode fixed_material_get_texcoord_mode(RID p_material,VS::FixedSpatialMaterialParam p_parameter) const; virtual void fixed_material_set_uv_transform(RID p_material,const Transform& p_transform); virtual Transform fixed_material_get_uv_transform(RID p_material) const; diff --git a/platform/iphone/sem_iphone.cpp b/platform/iphone/sem_iphone.cpp index e9c54a002e..d8913feb5f 100644 --- a/platform/iphone/sem_iphone.cpp +++ b/platform/iphone/sem_iphone.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/sem_iphone.h b/platform/iphone/sem_iphone.h index bfeaf244e5..e00dd8f3dd 100644 --- a/platform/iphone/sem_iphone.h +++ b/platform/iphone/sem_iphone.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/view_controller.h b/platform/iphone/view_controller.h index 52c8ac9953..f919c06af2 100644 --- a/platform/iphone/view_controller.h +++ b/platform/iphone/view_controller.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/iphone/view_controller.mm b/platform/iphone/view_controller.mm index 647ded30a7..8b3dc7c984 100644 --- a/platform/iphone/view_controller.mm +++ b/platform/iphone/view_controller.mm @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/javascript/audio_driver_javascript.cpp b/platform/javascript/audio_driver_javascript.cpp index 1b949e64f9..579cbaed3c 100644 --- a/platform/javascript/audio_driver_javascript.cpp +++ b/platform/javascript/audio_driver_javascript.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/javascript/audio_driver_javascript.h b/platform/javascript/audio_driver_javascript.h index c674a8566e..528b45569d 100644 --- a/platform/javascript/audio_driver_javascript.h +++ b/platform/javascript/audio_driver_javascript.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/javascript/audio_server_javascript.cpp b/platform/javascript/audio_server_javascript.cpp index 71a7e77266..d1fba030a5 100644 --- a/platform/javascript/audio_server_javascript.cpp +++ b/platform/javascript/audio_server_javascript.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -87,7 +87,7 @@ const void* AudioServerJavascript::sample_get_data_ptr(RID p_sample) const{ return NULL; } -void AudioServerJavascript::sample_set_data(RID p_sample, const DVector<uint8_t>& p_buffer){ +void AudioServerJavascript::sample_set_data(RID p_sample, const PoolVector<uint8_t>& p_buffer){ Sample *sample = sample_owner.get(p_sample); ERR_FAIL_COND(!sample); @@ -95,7 +95,7 @@ void AudioServerJavascript::sample_set_data(RID p_sample, const DVector<uint8_t> Vector<float> buffer; buffer.resize(sample->length*chans); - DVector<uint8_t>::Read r=p_buffer.read(); + PoolVector<uint8_t>::Read r=p_buffer.read(); if (sample->format==SAMPLE_FORMAT_PCM8) { const int8_t*ptr = (const int8_t*)r.ptr(); for(int i=0;i<sample->length*chans;i++) { @@ -116,10 +116,10 @@ void AudioServerJavascript::sample_set_data(RID p_sample, const DVector<uint8_t> } -DVector<uint8_t> AudioServerJavascript::sample_get_data(RID p_sample) const{ +PoolVector<uint8_t> AudioServerJavascript::sample_get_data(RID p_sample) const{ - return DVector<uint8_t>(); + return PoolVector<uint8_t>(); } void AudioServerJavascript::sample_set_mix_rate(RID p_sample,int p_rate){ diff --git a/platform/javascript/audio_server_javascript.h b/platform/javascript/audio_server_javascript.h index e27192cd93..8e61e94dfc 100644 --- a/platform/javascript/audio_server_javascript.h +++ b/platform/javascript/audio_server_javascript.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class AudioServerJavascript : public AudioServer { - OBJ_TYPE(AudioServerJavascript,AudioServer); + GDCLASS(AudioServerJavascript,AudioServer); enum { INTERNAL_BUFFER_SIZE=4096, @@ -131,8 +131,8 @@ public: virtual const void* sample_get_data_ptr(RID p_sample) const; - virtual void sample_set_data(RID p_sample, const DVector<uint8_t>& p_buffer); - virtual DVector<uint8_t> sample_get_data(RID p_sample) const; + virtual void sample_set_data(RID p_sample, const PoolVector<uint8_t>& p_buffer); + virtual PoolVector<uint8_t> sample_get_data(RID p_sample) const; virtual void sample_set_mix_rate(RID p_sample,int p_rate); virtual int sample_get_mix_rate(RID p_sample) const; diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index 9bc204a94a..2cb6874000 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -76,6 +76,7 @@ def configure(env): if("module_opus_enabled" in env and env["module_opus_enabled"] != "no"): env.opus_fixed_point = "yes" + # These flags help keep the file size down env.Append(CPPFLAGS=["-fno-exceptions", '-DNO_SAFE_CAST', '-fno-rtti']) env.Append(CPPFLAGS=['-DJAVASCRIPT_ENABLED', '-DUNIX_ENABLED', '-DPTHREAD_NO_RENAME', '-DNO_FCNTL', '-DMPC_FIXED_POINT', '-DTYPED_METHOD_BIND', '-DNO_THREADS']) env.Append(CPPFLAGS=['-DGLES2_ENABLED']) @@ -85,11 +86,17 @@ def configure(env): if env['wasm'] == 'yes': env.Append(LINKFLAGS=['-s', 'BINARYEN=1']) - env.Append(LINKFLAGS=['-s', '\'BINARYEN_METHOD="native-wasm"\'']) + # Maximum memory size is baked into the WebAssembly binary during + # compilation, so we need to enable memory growth to allow setting + # TOTAL_MEMORY at runtime. The value set at runtime must be higher than + # what is set during compilation, check TOTAL_MEMORY in Emscripten's + # src/settings.js for the default. + env.Append(LINKFLAGS=['-s', 'ALLOW_MEMORY_GROWTH=1']) env["PROGSUFFIX"] += ".webassembly" else: env.Append(CPPFLAGS=['-s', 'ASM_JS=1']) env.Append(LINKFLAGS=['-s', 'ASM_JS=1']) + env.Append(LINKFLAGS=['--separate-asm']) if env['javascript_eval'] == 'yes': env.Append(CPPFLAGS=['-DJAVASCRIPT_EVAL_ENABLED']) diff --git a/platform/javascript/dom_keys.h b/platform/javascript/dom_keys.h index 282b632e93..5ef212ce4a 100644 --- a/platform/javascript/dom_keys.h +++ b/platform/javascript/dom_keys.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index 721aef3e50..c151bff45c 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -40,7 +40,7 @@ #include "string.h" class EditorExportPlatformJavaScript : public EditorExportPlatform { - OBJ_TYPE( EditorExportPlatformJavaScript,EditorExportPlatform ); + GDCLASS( EditorExportPlatformJavaScript,EditorExportPlatform ); String custom_release_package; String custom_debug_package; @@ -181,9 +181,9 @@ void EditorExportPlatformJavaScript::_fix_html(Vector<uint8_t>& p_html, const St String current_line = lines[i]; current_line = current_line.replace("$GODOT_TMEM",itos((1<<(max_memory+5))*1024*1024)); current_line = current_line.replace("$GODOT_BASE",p_name); - current_line = current_line.replace("$GODOT_CANVAS_WIDTH",Globals::get_singleton()->get("display/width")); - current_line = current_line.replace("$GODOT_CANVAS_HEIGHT",Globals::get_singleton()->get("display/height")); - current_line = current_line.replace("$GODOT_HEAD_TITLE",!html_title.empty()?html_title:(String) Globals::get_singleton()->get("application/name")); + current_line = current_line.replace("$GODOT_CANVAS_WIDTH",GlobalConfig::get_singleton()->get("display/width")); + current_line = current_line.replace("$GODOT_CANVAS_HEIGHT",GlobalConfig::get_singleton()->get("display/height")); + current_line = current_line.replace("$GODOT_HEAD_TITLE",!html_title.empty()?html_title:(String) GlobalConfig::get_singleton()->get("application/name")); current_line = current_line.replace("$GODOT_HEAD_INCLUDE",html_head_include); current_line = current_line.replace("$GODOT_STYLE_FONT_FAMILY",html_font_family); current_line = current_line.replace("$GODOT_STYLE_INCLUDE",html_style_include); @@ -320,6 +320,11 @@ Error EditorExportPlatformJavaScript::export_project(const String& p_path, bool file=p_path.get_file().basename()+".js"; } + if (file=="godot.asm.js") { + + file=p_path.get_file().basename()+".asm.js"; + } + if (file=="godot.mem") { file=p_path.get_file().basename()+".mem"; diff --git a/platform/javascript/export/export.h b/platform/javascript/export/export.h index 2105141e58..59c0a67e6d 100644 --- a/platform/javascript/export/export.h +++ b/platform/javascript/export/export.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/javascript/javascript_eval.cpp b/platform/javascript/javascript_eval.cpp index e642300bda..7bbe0ae99b 100644 --- a/platform/javascript/javascript_eval.cpp +++ b/platform/javascript/javascript_eval.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/javascript/javascript_eval.h b/platform/javascript/javascript_eval.h index e5f6268076..679224d519 100644 --- a/platform/javascript/javascript_eval.h +++ b/platform/javascript/javascript_eval.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class JavaScript : public Object { private: - OBJ_TYPE( JavaScript, Object ); + GDCLASS( JavaScript, Object ); static JavaScript *singleton; diff --git a/platform/javascript/javascript_main.cpp b/platform/javascript/javascript_main.cpp index d9342cfe10..4c47594810 100644 --- a/platform/javascript/javascript_main.cpp +++ b/platform/javascript/javascript_main.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -66,11 +66,12 @@ static void _glut_mouse_button(int button, int state, int x, int y) { if (ev.mouse_button.button_index<4) { if (ev.mouse_button.pressed) { - _mouse_button_mask|=1<<ev.mouse_button.button_index; + _mouse_button_mask |= 1 << (ev.mouse_button.button_index-1); } else { - _mouse_button_mask&=~(1<<ev.mouse_button.button_index); + _mouse_button_mask &= ~(1 << (ev.mouse_button.button_index-1)); } } + ev.mouse_button.button_mask=_mouse_button_mask; uint32_t m = glutGetModifiers(); ev.mouse_button.mod.alt=(m&GLUT_ACTIVE_ALT)!=0; @@ -79,6 +80,11 @@ static void _glut_mouse_button(int button, int state, int x, int y) { os->push_input(ev); + if (ev.mouse_button.button_index==BUTTON_WHEEL_UP || ev.mouse_button.button_index==BUTTON_WHEEL_DOWN) { + // GLUT doesn't send release events for mouse wheel, so send manually + ev.mouse_button.pressed=false; + os->push_input(ev); + } } @@ -148,7 +154,7 @@ int main(int argc, char *argv[]) { /* Initialize the window */ printf("let it go!\n"); glutInit(&argc, argv); - os = new OS_JavaScript(_gfx_init,NULL,NULL,NULL,NULL); + os = new OS_JavaScript(_gfx_init,NULL,NULL); #if 0 char *args[]={"-test","gui","-v",NULL}; Error err = Main::setup("apk",3,args); @@ -162,7 +168,6 @@ int main(int argc, char *argv[]) { glutMouseFunc(_glut_mouse_button); glutMotionFunc(_glut_mouse_motion); - glutMotionFunc(_glut_mouse_motion); glutPassiveMotionFunc(_glut_mouse_motion); diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index e802a7e9cb..47c8ea89d7 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,6 +37,7 @@ #include "main/main.h" #include "core/globals.h" +#include "stdlib.h" #include "emscripten.h" #include "dom_keys.h" @@ -77,6 +78,59 @@ void OS_JavaScript::set_opengl_extensions(const char* p_gl_extensions) { gl_extensions=p_gl_extensions; } +static EM_BOOL _browser_resize_callback(int event_type, const EmscriptenUiEvent *ui_event, void *user_data) { + + ERR_FAIL_COND_V(event_type!=EMSCRIPTEN_EVENT_RESIZE, false); + + OS_JavaScript* os = static_cast<OS_JavaScript*>(user_data); + + // the order in which _browser_resize_callback and + // _fullscreen_change_callback are called is browser-dependent, + // so try adjusting for fullscreen in both + if (os->is_window_fullscreen() || os->is_window_maximized()) { + + OS::VideoMode vm = os->get_video_mode(); + vm.width = ui_event->windowInnerWidth; + vm.height = ui_event->windowInnerHeight; + os->set_video_mode(vm); + emscripten_set_canvas_size(ui_event->windowInnerWidth, ui_event->windowInnerHeight); + } + return false; +} + +static Size2 _windowed_size; + +static EM_BOOL _fullscreen_change_callback(int event_type, const EmscriptenFullscreenChangeEvent *event, void *user_data) { + + ERR_FAIL_COND_V(event_type!=EMSCRIPTEN_EVENT_FULLSCREENCHANGE, false); + + OS_JavaScript* os = static_cast<OS_JavaScript*>(user_data); + String id = String::utf8(event->id); + + // empty id is canvas + if (id.empty() || id=="canvas") { + + OS::VideoMode vm = os->get_video_mode(); + // this event property is the only reliable information on + // browser fullscreen state + vm.fullscreen = event->isFullscreen; + + if (event->isFullscreen) { + vm.width = event->screenWidth; + vm.height = event->screenHeight; + os->set_video_mode(vm); + emscripten_set_canvas_size(vm.width, vm.height); + } + else { + os->set_video_mode(vm); + if (!os->is_window_maximized()) { + os->set_window_size(_windowed_size); + } + } + } + return false; +} + static InputEvent _setup_key_event(const EmscriptenKeyboardEvent *emscripten_event) { InputEvent ev; @@ -89,7 +143,9 @@ static InputEvent _setup_key_event(const EmscriptenKeyboardEvent *emscripten_eve ev.key.scancode = dom2godot_scancode(emscripten_event->keyCode); String unicode = String::utf8(emscripten_event->key); + // check if empty or multi-character (e.g. `CapsLock`) if (unicode.length()!=1) { + // might be empty as well, but better than nonsense unicode = String::utf8(emscripten_event->charValue); } if (unicode.length()==1) { @@ -151,7 +207,30 @@ void OS_JavaScript::initialize(const VideoMode& p_desired,int p_video_driver,int if (gfx_init_func) gfx_init_func(gfx_init_ud,use_gl2,p_desired.width,p_desired.height,p_desired.fullscreen); - default_videomode=p_desired; + // nothing to do here, can't fulfil fullscreen request due to + // browser security, window size is already set from HTML + video_mode=p_desired; + video_mode.fullscreen=false; + _windowed_size=get_window_size(); + + // find locale, emscripten only sets "C" + char locale_ptr[16]; + EM_ASM_({ + var locale = ""; + if (Module.locale) { + // best case: server-side script reads Accept-Language early and + // defines the locale to be read here + locale = Module.locale; + } else { + // no luck, use what the JS engine can tell us + // if this turns out not compatible enough, add tests for + // browserLanguage, systemLanguage and userLanguage + locale = navigator.languages ? navigator.languages[0] : navigator.language; + } + locale = locale.split('.')[0]; + stringToUTF8(locale, $0, 16); + }, locale_ptr); + setenv("LANG", locale_ptr, true); print_line("Init Audio"); @@ -210,30 +289,27 @@ void OS_JavaScript::initialize(const VideoMode& p_desired,int p_video_driver,int input = memnew( InputDefault ); - EMSCRIPTEN_RESULT result = emscripten_set_keydown_callback(NULL, this , true, &_keydown_callback); - if (result!=EMSCRIPTEN_RESULT_SUCCESS) { - ERR_PRINTS( "Error while setting Emscripten keydown callback: Code " + itos(result) ); - } - result = emscripten_set_keypress_callback(NULL, this, true, &_keypress_callback); - if (result!=EMSCRIPTEN_RESULT_SUCCESS) { - ERR_PRINTS( "Error while setting Emscripten keypress callback: Code " + itos(result) ); - } - result = emscripten_set_keyup_callback(NULL, this, true, &_keyup_callback); - if (result!=EMSCRIPTEN_RESULT_SUCCESS) { - ERR_PRINTS( "Error while setting Emscripten keyup callback: Code " + itos(result) ); - } - result = emscripten_set_gamepadconnected_callback(NULL, true, &joy_callback_func); - if (result!=EMSCRIPTEN_RESULT_SUCCESS) { - ERR_PRINTS( "Error while setting Emscripten gamepadconnected callback: Code " + itos(result) ); - } - result = emscripten_set_gamepaddisconnected_callback(NULL, true, &joy_callback_func); - if (result!=EMSCRIPTEN_RESULT_SUCCESS) { - ERR_PRINTS( "Error while setting Emscripten gamepaddisconnected callback: Code " + itos(result) ); - } +#define EM_CHECK(ev) if (result!=EMSCRIPTEN_RESULT_SUCCESS)\ + ERR_PRINTS("Error while setting " #ev " callback: Code " + itos(result)) +#define SET_EM_CALLBACK(ev, cb) result = emscripten_set_##ev##_callback(NULL, this, true, &cb); EM_CHECK(ev) +#define SET_EM_CALLBACK_NODATA(ev, cb) result = emscripten_set_##ev##_callback(NULL, true, &cb); EM_CHECK(ev) + + EMSCRIPTEN_RESULT result; + SET_EM_CALLBACK(keydown, _keydown_callback) + SET_EM_CALLBACK(keypress, _keypress_callback) + SET_EM_CALLBACK(keyup, _keyup_callback) + SET_EM_CALLBACK(resize, _browser_resize_callback) + SET_EM_CALLBACK(fullscreenchange, _fullscreen_change_callback) + SET_EM_CALLBACK_NODATA(gamepadconnected, joy_callback_func) + SET_EM_CALLBACK_NODATA(gamepaddisconnected, joy_callback_func) + +#undef SET_EM_CALLBACK_NODATA +#undef SET_EM_CALLBACK +#undef EM_CHECK #ifdef JAVASCRIPT_EVAL_ENABLED javascript_eval = memnew(JavaScript); - Globals::get_singleton()->add_singleton(Globals::Singleton("JavaScript", javascript_eval)); + GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("JavaScript", javascript_eval)); #endif } @@ -254,32 +330,11 @@ void OS_JavaScript::finalize() { memdelete(input); } +void OS_JavaScript::alert(const String& p_alert,const String& p_title) { -void OS_JavaScript::vprint(const char* p_format, va_list p_list, bool p_stderr) { - - if (p_stderr) { - - vfprintf(stderr,p_format,p_list); - fflush(stderr); - } else { - - vprintf(p_format,p_list); - fflush(stdout); - } -} - -void OS_JavaScript::print(const char *p_format, ... ) { - - va_list argp; - va_start(argp, p_format); - vprintf(p_format, argp ); - va_end(argp); - -} - -void OS_JavaScript::alert(const String& p_alert) { - - print("ALERT: %s\n",p_alert.utf8().get_data()); + EM_ASM_({ + window.alert(UTF8ToString($0)); + }, p_alert.utf8().get_data()); } @@ -298,17 +353,22 @@ bool OS_JavaScript::is_mouse_grab_enabled() const { //*sigh* technology has evolved so much since i was a kid.. return false; } + Point2 OS_JavaScript::get_mouse_pos() const { - return Point2(); + return input->get_mouse_pos(); } + int OS_JavaScript::get_mouse_button_state() const { - return 0; + return last_button_mask; } -void OS_JavaScript::set_window_title(const String& p_title) { +void OS_JavaScript::set_window_title(const String& p_title) { + EM_ASM_({ + document.title = UTF8ToString($0); + }, p_title.utf8().get_data()); } //interesting byt not yet @@ -317,22 +377,92 @@ void OS_JavaScript::set_window_title(const String& p_title) { void OS_JavaScript::set_video_mode(const VideoMode& p_video_mode,int p_screen) { - + video_mode = p_video_mode; } OS::VideoMode OS_JavaScript::get_video_mode(int p_screen) const { - return default_videomode; + return video_mode; +} + +Size2 OS_JavaScript::get_screen_size(int p_screen) const { + + ERR_FAIL_COND_V(p_screen!=0, Size2()); + + EmscriptenFullscreenChangeEvent ev; + EMSCRIPTEN_RESULT result = emscripten_get_fullscreen_status(&ev); + ERR_FAIL_COND_V(result!=EMSCRIPTEN_RESULT_SUCCESS, Size2()); + return Size2(ev.screenWidth, ev.screenHeight); +} + +void OS_JavaScript::set_window_size(const Size2 p_size) { + + window_maximized = false; + if (is_window_fullscreen()) { + set_window_fullscreen(false); + } + _windowed_size = p_size; + video_mode.width = p_size.x; + video_mode.height = p_size.y; + emscripten_set_canvas_size(p_size.x, p_size.y); } Size2 OS_JavaScript::get_window_size() const { - return Vector2(default_videomode.width,default_videomode.height); + int canvas[3]; + emscripten_get_canvas_size(canvas, canvas+1, canvas+2); + return Size2(canvas[0], canvas[1]); +} + +void OS_JavaScript::set_window_maximized(bool p_enabled) { + + window_maximized = p_enabled; + if (p_enabled) { + + if (is_window_fullscreen()) { + // _browser_resize callback will set canvas size + set_window_fullscreen(false); + } + else { + video_mode.width = EM_ASM_INT_V(return window.innerWidth); + video_mode.height = EM_ASM_INT_V(return window.innerHeight); + emscripten_set_canvas_size(video_mode.width, video_mode.height); + } + } + else { + set_window_size(_windowed_size); + } +} + +void OS_JavaScript::set_window_fullscreen(bool p_enable) { + + if (p_enable==is_window_fullscreen()) { + return; + } + + // only requesting changes here, if successful, canvas is resized in + // _browser_resize_callback or _fullscreen_change_callback + EMSCRIPTEN_RESULT result; + if (p_enable) { + EM_ASM(Module.requestFullscreen(false, false);); + } + else { + result = emscripten_exit_fullscreen(); + if (result!=EMSCRIPTEN_RESULT_SUCCESS) { + ERR_PRINTS("Failed to exit fullscreen: Code " + itos(result)); + } + } +} + +bool OS_JavaScript::is_window_fullscreen() const { + + return video_mode.fullscreen; } void OS_JavaScript::get_fullscreen_mode_list(List<VideoMode> *p_list,int p_screen) const { - p_list->push_back(default_videomode); + Size2 screen = get_screen_size(); + p_list->push_back(OS::VideoMode(screen.width, screen.height, true)); } String OS_JavaScript::get_name() { @@ -389,7 +519,7 @@ bool OS_JavaScript::main_loop_iterate() { } - process_joysticks(); + process_joypads(); return Main::iteration(); } @@ -423,6 +553,9 @@ void OS_JavaScript::push_input(const InputEvent& p_ev) { if (ev.type==InputEvent::MOUSE_MOTION) { input->set_mouse_pos(Point2(ev.mouse_motion.x, ev.mouse_motion.y)); } + else if (ev.type==InputEvent::MOUSE_BUTTON) { + last_button_mask = ev.mouse_button.button_mask; + } input->parse_input_event(p_ev); } @@ -649,48 +782,38 @@ void OS_JavaScript::main_loop_request_quit() { main_loop->notification(MainLoop::NOTIFICATION_WM_QUIT_REQUEST); } -void OS_JavaScript::set_display_size(Size2 p_size) { - - default_videomode.width=p_size.x; - default_videomode.height=p_size.y; -} - void OS_JavaScript::reload_gfx() { if (gfx_init_func) - gfx_init_func(gfx_init_ud,use_gl2,default_videomode.width,default_videomode.height,default_videomode.fullscreen); + gfx_init_func(gfx_init_ud,use_gl2,video_mode.width,video_mode.height,video_mode.fullscreen); if (rasterizer) rasterizer->reload_vram(); } Error OS_JavaScript::shell_open(String p_uri) { - - if (open_uri_func) - return open_uri_func(p_uri)?ERR_CANT_OPEN:OK; - return ERR_UNAVAILABLE; -}; + EM_ASM_({ + window.open(UTF8ToString($0), '_blank'); + }, p_uri.utf8().get_data()); + return OK; +} String OS_JavaScript::get_resource_dir() const { return "/"; //javascript has it's own filesystem for resources inside the APK } -String OS_JavaScript::get_locale() const { - - if (get_locale_func) - return get_locale_func(); - return OS_Unix::get_locale(); -} - - String OS_JavaScript::get_data_dir() const { //if (get_data_dir_func) // return get_data_dir_func(); return "/userfs"; - //return Globals::get_singleton()->get_singleton_object("GodotOS")->call("get_data_dir"); + //return GlobalConfig::get_singleton()->get_singleton_object("GodotOS")->call("get_data_dir"); }; +String OS_JavaScript::get_executable_path() const { + + return String(); +} void OS_JavaScript::_close_notification_funcs(const String& p_file,int p_flags) { @@ -701,7 +824,7 @@ void OS_JavaScript::_close_notification_funcs(const String& p_file,int p_flags) } } -void OS_JavaScript::process_joysticks() { +void OS_JavaScript::process_joypads() { int joy_count = emscripten_get_num_gamepads(); for (int i = 0; i < joy_count; i++) { @@ -757,24 +880,18 @@ String OS_JavaScript::get_joy_guid(int p_device) const { return input->get_joy_guid_remapped(p_device); } -OS_JavaScript::OS_JavaScript(GFXInitFunc p_gfx_init_func,void*p_gfx_init_ud, OpenURIFunc p_open_uri_func, GetDataDirFunc p_get_data_dir_func,GetLocaleFunc p_get_locale_func) { - - - default_videomode.width=800; - default_videomode.height=600; - default_videomode.fullscreen=true; - default_videomode.resizable=false; +OS_JavaScript::OS_JavaScript(GFXInitFunc p_gfx_init_func,void*p_gfx_init_ud, GetDataDirFunc p_get_data_dir_func) { gfx_init_func=p_gfx_init_func; gfx_init_ud=p_gfx_init_ud; + last_button_mask=0; main_loop=NULL; last_id=1; gl_extensions=NULL; rasterizer=NULL; + window_maximized=false; - open_uri_func=p_open_uri_func; get_data_dir_func=p_get_data_dir_func; - get_locale_func=p_get_locale_func; FileAccessUnix::close_notification_func=_close_notification_funcs; time_to_save_sync=-1; diff --git a/platform/javascript/os_javascript.h b/platform/javascript/os_javascript.h index 5b7904805b..370322e93d 100644 --- a/platform/javascript/os_javascript.h +++ b/platform/javascript/os_javascript.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -45,9 +45,7 @@ #include "javascript_eval.h" typedef void (*GFXInitFunc)(void *ud,bool gl2,int w, int h, bool fs); -typedef int (*OpenURIFunc)(const String&); typedef String (*GetDataDirFunc)(); -typedef String (*GetLocaleFunc)(); class OS_JavaScript : public OS_Unix { public: @@ -61,6 +59,7 @@ private: Vector<TouchPos> touch; Point2 last_mouse; + int last_button_mask; unsigned int last_id; GFXInitFunc gfx_init_func; void*gfx_init_ud; @@ -82,12 +81,11 @@ private: const char* gl_extensions; InputDefault *input; - VideoMode default_videomode; + bool window_maximized; + VideoMode video_mode; MainLoop * main_loop; - OpenURIFunc open_uri_func; GetDataDirFunc get_data_dir_func; - GetLocaleFunc get_locale_func; #ifdef JAVASCRIPT_EVAL_ENABLED JavaScript* javascript_eval; @@ -95,7 +93,7 @@ private: static void _close_notification_funcs(const String& p_file,int p_flags); - void process_joysticks(); + void process_joypads(); public: @@ -121,9 +119,12 @@ public: //static OS* get_singleton(); - virtual void vprint(const char* p_format, va_list p_list, bool p_stderr=false); - virtual void print(const char *p_format, ... ); - virtual void alert(const String& p_alert); + virtual void print_error(const char* p_function, const char* p_file, int p_line, const char *p_code, const char* p_rationale, ErrorType p_type) { + + OS::print_error(p_function, p_file, p_line, p_code, p_rationale, p_type); + } + + virtual void alert(const String& p_alert,const String& p_title="ALERT!"); virtual void set_mouse_show(bool p_show); @@ -140,7 +141,15 @@ public: virtual VideoMode get_video_mode(int p_screen=0) const; virtual void get_fullscreen_mode_list(List<VideoMode> *p_list,int p_screen=0) const; + virtual Size2 get_screen_size(int p_screen=0) const; + + virtual void set_window_size(const Size2); virtual Size2 get_window_size() const; + virtual void set_window_maximized(bool p_enabled); + virtual bool is_window_maximized() const { return window_maximized; } + virtual void set_window_fullscreen(bool p_enable); + virtual bool is_window_fullscreen() const; + virtual String get_name(); virtual MainLoop *get_main_loop() const; @@ -158,14 +167,13 @@ public: virtual bool has_touchscreen_ui_hint() const; void set_opengl_extensions(const char* p_gl_extensions); - void set_display_size(Size2 p_size); void reload_gfx(); virtual Error shell_open(String p_uri); virtual String get_data_dir() const; + String get_executable_path() const; virtual String get_resource_dir() const; - virtual String get_locale() const; void process_accelerometer(const Vector3& p_accelerometer); void process_touch(int p_what,int p_pointer, const Vector<TouchPos>& p_points); @@ -175,7 +183,7 @@ public: virtual String get_joy_guid(int p_device) const; bool joy_connection_changed(int p_type, const EmscriptenGamepadEvent *p_event); - OS_JavaScript(GFXInitFunc p_gfx_init_func,void*p_gfx_init_ud, OpenURIFunc p_open_uri_func, GetDataDirFunc p_get_data_dir_func,GetLocaleFunc p_get_locale_func); + OS_JavaScript(GFXInitFunc p_gfx_init_func,void*p_gfx_init_ud, GetDataDirFunc p_get_data_dir_func); ~OS_JavaScript(); }; diff --git a/platform/javascript/platform_config.h b/platform/javascript/platform_config.h index 143f16c1fa..cdef185ff0 100644 --- a/platform/javascript/platform_config.h +++ b/platform/javascript/platform_config.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/osx/SCsub b/platform/osx/SCsub index c8e0e17612..00f23687cf 100644 --- a/platform/osx/SCsub +++ b/platform/osx/SCsub @@ -9,7 +9,7 @@ files = [ 'sem_osx.cpp', # 'context_gl_osx.cpp', 'dir_access_osx.mm', - 'joystick_osx.cpp', + 'joypad_osx.cpp', ] env.Program('#bin/godot', files) diff --git a/platform/osx/audio_driver_osx.cpp b/platform/osx/audio_driver_osx.cpp index d9d91b22fb..87901f6ec4 100644 --- a/platform/osx/audio_driver_osx.cpp +++ b/platform/osx/audio_driver_osx.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/osx/audio_driver_osx.h b/platform/osx/audio_driver_osx.h index 92893c64dc..19b396de57 100644 --- a/platform/osx/audio_driver_osx.h +++ b/platform/osx/audio_driver_osx.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/osx/context_gl_osx.cpp b/platform/osx/context_gl_osx.cpp index df1c14c643..d0819bbfb6 100644 --- a/platform/osx/context_gl_osx.cpp +++ b/platform/osx/context_gl_osx.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/osx/context_gl_osx.h b/platform/osx/context_gl_osx.h index 565a0ee02a..6a02aa23d1 100644 --- a/platform/osx/context_gl_osx.h +++ b/platform/osx/context_gl_osx.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/osx/detect.py b/platform/osx/detect.py index 9191f1aabc..ccd86177ab 100644 --- a/platform/osx/detect.py +++ b/platform/osx/detect.py @@ -80,10 +80,12 @@ def configure(env): env.Append(CPPFLAGS=["-DAPPLE_STYLE_KEYS"]) env.Append(CPPFLAGS=['-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DOSX_ENABLED']) + env.Append(CPPFLAGS=["-mmacosx-version-min=10.9"]) env.Append(LIBS=['pthread']) #env.Append(CPPFLAGS=['-F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks', '-isysroot', '/Developer/SDKs/MacOSX10.4u.sdk', '-mmacosx-version-min=10.4']) #env.Append(LINKFLAGS=['-mmacosx-version-min=10.4', '-isysroot', '/Developer/SDKs/MacOSX10.4u.sdk', '-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk']) env.Append(LINKFLAGS=['-framework', 'Cocoa', '-framework', 'Carbon', '-framework', 'OpenGL', '-framework', 'AGL', '-framework', 'AudioUnit', '-lz', '-framework', 'IOKit', '-framework', 'ForceFeedback']) + env.Append(LINKFLAGS=["-mmacosx-version-min=10.9"]) if (env["CXX"] == "clang++"): env.Append(CPPFLAGS=['-DTYPED_METHOD_BIND']) diff --git a/platform/osx/dir_access_osx.h b/platform/osx/dir_access_osx.h index d20eee1e2e..c30d380dd3 100644 --- a/platform/osx/dir_access_osx.h +++ b/platform/osx/dir_access_osx.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/osx/dir_access_osx.mm b/platform/osx/dir_access_osx.mm index 5615858262..476da2635e 100644 --- a/platform/osx/dir_access_osx.mm +++ b/platform/osx/dir_access_osx.mm @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp index 30f4c58150..1cb41cede2 100644 --- a/platform/osx/export/export.cpp +++ b/platform/osx/export/export.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -43,7 +43,7 @@ class EditorExportPlatformOSX : public EditorExportPlatform { - OBJ_TYPE( EditorExportPlatformOSX,EditorExportPlatform ); + GDCLASS( EditorExportPlatformOSX,EditorExportPlatform ); String custom_release_package; String custom_debug_package; @@ -207,7 +207,7 @@ void EditorExportPlatformOSX::_make_icon(const Image& p_icon,Vector<uint8_t>& ic while(size>=16) { Image copy = p_icon; - copy.convert(Image::FORMAT_RGBA); + copy.convert(Image::FORMAT_RGBA8); copy.resize(size,size); it->create_from_image(copy); String path = EditorSettings::get_singleton()->get_settings_path()+"/tmp/icon.png"; @@ -324,8 +324,8 @@ Error EditorExportPlatformOSX::export_project(const String& p_path, bool p_debug String pkg_name; if (app_name!="") pkg_name=app_name; - else if (String(Globals::get_singleton()->get("application/name"))!="") - pkg_name=String(Globals::get_singleton()->get("application/name")); + else if (String(GlobalConfig::get_singleton()->get("application/name"))!="") + pkg_name=String(GlobalConfig::get_singleton()->get("application/name")); else pkg_name="Unnamed"; @@ -371,7 +371,7 @@ Error EditorExportPlatformOSX::export_project(const String& p_path, bool p_debug if (file=="Contents/Resources/icon.icns") { //see if there is an icon - String iconpath = Globals::get_singleton()->get("application/icon"); + String iconpath = GlobalConfig::get_singleton()->get("application/icon"); print_line("icon? "+iconpath); if (iconpath!="") { Image icon; diff --git a/platform/osx/export/export.h b/platform/osx/export/export.h index 8e0b83b457..98e63ff48e 100644 --- a/platform/osx/export/export.h +++ b/platform/osx/export/export.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/osx/godot_main_osx.mm b/platform/osx/godot_main_osx.mm index 7beb5248b4..8eedd7f6fc 100644 --- a/platform/osx/godot_main_osx.mm +++ b/platform/osx/godot_main_osx.mm @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/osx/godot_osx.h b/platform/osx/godot_osx.h index de363d8483..b6f2b06f26 100644 --- a/platform/osx/godot_osx.h +++ b/platform/osx/godot_osx.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/osx/godot_osx.mm b/platform/osx/godot_osx.mm index 02a1382b1a..2296fb016f 100644 --- a/platform/osx/godot_osx.mm +++ b/platform/osx/godot_osx.mm @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/osx/joystick_osx.cpp b/platform/osx/joypad_osx.cpp index ffb6ac326b..5d25017aa6 100644 --- a/platform/osx/joystick_osx.cpp +++ b/platform/osx/joypad_osx.cpp @@ -1,11 +1,11 @@ /*************************************************************************/ -/* joystick_osx.cpp */ +/* joypad_osx.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -26,14 +26,15 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "joystick_osx.h" +#include "joypad_osx.h" + #include <machine/endian.h> -#define GODOT_JOY_LOOP_RUN_MODE CFSTR("GodotJoystick") +#define GODOT_JOY_LOOP_RUN_MODE CFSTR("GodotJoypad") -static JoystickOSX* self = NULL; +static JoypadOSX* self = NULL; -joystick::joystick() { +joypad::joypad() { device_ref = NULL; ff_device = NULL; ff_axes = NULL; @@ -56,7 +57,7 @@ joystick::joystick() { ff_effect.dwSize = sizeof(ff_effect); } -void joystick::free() { +void joypad::free() { if (device_ref) { IOHIDDeviceUnscheduleFromRunLoop(device_ref, CFRunLoopGetCurrent(), GODOT_JOY_LOOP_RUN_MODE); } @@ -68,7 +69,7 @@ void joystick::free() { } } -bool joystick::has_element(IOHIDElementCookie p_cookie, Vector<rec_element> *p_list) const { +bool joypad::has_element(IOHIDElementCookie p_cookie, Vector<rec_element> *p_list) const { for (int i = 0; i < p_list->size(); i++) { if (p_cookie == p_list->get(i).cookie) { return true; @@ -77,7 +78,7 @@ bool joystick::has_element(IOHIDElementCookie p_cookie, Vector<rec_element> *p_l return false; } -int joystick::get_hid_element_state(rec_element *p_element) const { +int joypad::get_hid_element_state(rec_element *p_element) const { int value = 0; if (p_element && p_element->ref) { IOHIDValueRef valueRef; @@ -95,7 +96,7 @@ int joystick::get_hid_element_state(rec_element *p_element) const { } return value; } -void joystick::add_hid_element(IOHIDElementRef p_element) { +void joypad::add_hid_element(IOHIDElementRef p_element) { const CFTypeID elementTypeID = p_element ? CFGetTypeID(p_element) : 0; if (p_element && (elementTypeID == IOHIDElementGetTypeID())) { @@ -198,26 +199,26 @@ void joystick::add_hid_element(IOHIDElementRef p_element) { } static void hid_element_added(const void *p_value, void *p_parameter) { - joystick *joy = (joystick*) p_parameter; + joypad *joy = (joypad*) p_parameter; joy->add_hid_element((IOHIDElementRef) p_value); } -void joystick::add_hid_elements(CFArrayRef p_array) { +void joypad::add_hid_elements(CFArrayRef p_array) { CFRange range = { 0, CFArrayGetCount(p_array) }; CFArrayApplyFunction(p_array, range,hid_element_added,this); } -static void joystick_removed_callback(void *ctx, IOReturn result, void *sender) { +static void joypad_removed_callback(void *ctx, IOReturn result, void *sender) { int id = (intptr_t) ctx; self->_device_removed(id); } -static void joystick_added_callback(void *ctx, IOReturn res, void *sender, IOHIDDeviceRef ioHIDDeviceObject) { +static void joypad_added_callback(void *ctx, IOReturn res, void *sender, IOHIDDeviceRef ioHIDDeviceObject) { self->_device_added(res, ioHIDDeviceObject); } -static bool is_joystick(IOHIDDeviceRef p_device_ref) { +static bool is_joypad(IOHIDDeviceRef p_device_ref) { CFTypeRef refCF = NULL; int usage_page = 0; int usage = 0; @@ -241,32 +242,32 @@ static bool is_joystick(IOHIDDeviceRef p_device_ref) { return true; } -void JoystickOSX::_device_added(IOReturn p_res, IOHIDDeviceRef p_device) { +void JoypadOSX::_device_added(IOReturn p_res, IOHIDDeviceRef p_device) { if (p_res != kIOReturnSuccess || have_device(p_device)) { return; } - joystick new_joystick; - if (is_joystick(p_device)) { - configure_joystick(p_device, &new_joystick); + joypad new_joypad; + if (is_joypad(p_device)) { + configure_joypad(p_device, &new_joypad); #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 if (IOHIDDeviceGetService != NULL) { #endif const io_service_t ioservice = IOHIDDeviceGetService(p_device); - if ((ioservice) && (FFIsForceFeedback(ioservice) == FF_OK) && new_joystick.config_force_feedback(ioservice)) { - new_joystick.ffservice = ioservice; + if ((ioservice) && (FFIsForceFeedback(ioservice) == FF_OK) && new_joypad.config_force_feedback(ioservice)) { + new_joypad.ffservice = ioservice; } #if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 } #endif - device_list.push_back(new_joystick); + device_list.push_back(new_joypad); } - IOHIDDeviceRegisterRemovalCallback(p_device, joystick_removed_callback, (void*) (intptr_t) new_joystick.id); + IOHIDDeviceRegisterRemovalCallback(p_device, joypad_removed_callback, (void*) (intptr_t) new_joypad.id); IOHIDDeviceScheduleWithRunLoop(p_device, CFRunLoopGetCurrent(), GODOT_JOY_LOOP_RUN_MODE); } -void JoystickOSX::_device_removed(int p_id) { +void JoypadOSX::_device_removed(int p_id) { int device = get_joy_index(p_id); ERR_FAIL_COND(device == -1); @@ -289,7 +290,7 @@ static String _hex_str(uint8_t p_byte) { return ret; } -bool JoystickOSX::configure_joystick(IOHIDDeviceRef p_device_ref, joystick* p_joy) { +bool JoypadOSX::configure_joypad(IOHIDDeviceRef p_device_ref, joypad* p_joy) { CFTypeRef refCF = NULL; @@ -302,7 +303,7 @@ bool JoystickOSX::configure_joystick(IOHIDDeviceRef p_device_ref, joystick* p_jo refCF = IOHIDDeviceGetProperty(p_device_ref, CFSTR(kIOHIDManufacturerKey)); } if ((!refCF) || (!CFStringGetCString((CFStringRef) refCF, c_name, sizeof (c_name), kCFStringEncodingUTF8))) { - name = "Unidentified Joystick"; + name = "Unidentified Joypad"; } name = c_name; @@ -345,7 +346,7 @@ bool JoystickOSX::configure_joystick(IOHIDDeviceRef p_device_ref, joystick* p_jo } #define FF_ERR() { if (ret != FF_OK) { FFReleaseDevice(ff_device); return false; } } -bool joystick::config_force_feedback(io_service_t p_service) { +bool joypad::config_force_feedback(io_service_t p_service) { HRESULT ret = FFCreateDevice(p_service, &ff_device); ERR_FAIL_COND_V(ret != FF_OK, false); @@ -367,7 +368,7 @@ bool joystick::config_force_feedback(io_service_t p_service) { #undef FF_ERR #define TEST_FF(ff) (features.supportedEffects & (ff)) -bool joystick::check_ff_features() { +bool joypad::check_ff_features() { FFCAPABILITIES features; HRESULT ret = FFDeviceGetForceFeedbackCapabilities(ff_device, &features); @@ -432,7 +433,7 @@ static int process_hat_value(int p_min, int p_max, int p_value) { return hat_value; } -void JoystickOSX::poll_joysticks() const { +void JoypadOSX::poll_joypads() const { while (CFRunLoopRunInMode(GODOT_JOY_LOOP_RUN_MODE,0,TRUE) == kCFRunLoopRunHandledSource) { /* no-op. Pending callbacks will fire. */ } @@ -454,11 +455,11 @@ static const InputDefault::JoyAxis axis_correct(int p_value, int p_min, int p_ma return jx; } -uint32_t JoystickOSX::process_joysticks(uint32_t p_last_id){ - poll_joysticks(); +uint32_t JoypadOSX::process_joypads(uint32_t p_last_id){ + poll_joypads(); for (int i = 0; i < device_list.size(); i++) { - joystick &joy = device_list[i]; + joypad &joy = device_list[i]; for (int j = 0; j < joy.axis_elements.size(); j++) { rec_element &elem = joy.axis_elements[j]; @@ -482,11 +483,11 @@ uint32_t JoystickOSX::process_joysticks(uint32_t p_last_id){ Vector2 strength = input->get_joy_vibration_strength(joy.id); float duration = input->get_joy_vibration_duration(joy.id); if (strength.x == 0 && strength.y == 0) { - joystick_vibration_stop(joy.id, timestamp); + joypad_vibration_stop(joy.id, timestamp); } else { float gain = MAX(strength.x, strength.y); - joystick_vibration_start(joy.id, gain, duration, timestamp); + joypad_vibration_start(joy.id, gain, duration, timestamp); } } } @@ -494,8 +495,8 @@ uint32_t JoystickOSX::process_joysticks(uint32_t p_last_id){ return p_last_id; } -void JoystickOSX::joystick_vibration_start(int p_id, float p_magnitude, float p_duration, uint64_t p_timestamp) { - joystick *joy = &device_list[get_joy_index(p_id)]; +void JoypadOSX::joypad_vibration_start(int p_id, float p_magnitude, float p_duration, uint64_t p_timestamp) { + joypad *joy = &device_list[get_joy_index(p_id)]; joy->ff_timestamp = p_timestamp; joy->ff_effect.dwDuration = p_duration * FF_SECONDS; joy->ff_effect.dwGain = p_magnitude * FF_FFNOMINALMAX; @@ -503,14 +504,14 @@ void JoystickOSX::joystick_vibration_start(int p_id, float p_magnitude, float p_ FFEffectStart(joy->ff_object, 1, 0); } -void JoystickOSX::joystick_vibration_stop(int p_id, uint64_t p_timestamp) { - joystick* joy = &device_list[get_joy_index(p_id)]; +void JoypadOSX::joypad_vibration_stop(int p_id, uint64_t p_timestamp) { + joypad* joy = &device_list[get_joy_index(p_id)]; joy->ff_timestamp = p_timestamp; FFEffectStop(joy->ff_object); } -int JoystickOSX::get_free_joy_id() { - for (int i = 0; i < JOYSTICKS_MAX; i++) { +int JoypadOSX::get_free_joy_id() { + for (int i = 0; i < JOYPADS_MAX; i++) { if (!attached_devices[i]) { attached_devices[i] = true; return i; @@ -519,14 +520,14 @@ int JoystickOSX::get_free_joy_id() { return -1; } -int JoystickOSX::get_joy_index(int p_id) const { +int JoypadOSX::get_joy_index(int p_id) const { for (int i = 0; i < device_list.size(); i++) { if (device_list[i].id == p_id) return i; } return -1; } -bool JoystickOSX::have_device(IOHIDDeviceRef p_device) const { +bool JoypadOSX::have_device(IOHIDDeviceRef p_device) const { for (int i = 0; i < device_list.size(); i++) { if (device_list[i].device_ref == p_device) { return true; @@ -561,14 +562,14 @@ static CFDictionaryRef create_match_dictionary(const UInt32 page, const UInt32 u return retval; } -void JoystickOSX::config_hid_manager(CFArrayRef p_matching_array) const { +void JoypadOSX::config_hid_manager(CFArrayRef p_matching_array) const { CFRunLoopRef runloop = CFRunLoopGetCurrent(); IOReturn ret = IOHIDManagerOpen(hid_manager, kIOHIDOptionsTypeNone); ERR_FAIL_COND(ret != kIOReturnSuccess); IOHIDManagerSetDeviceMatchingMultiple(hid_manager, p_matching_array); - IOHIDManagerRegisterDeviceMatchingCallback(hid_manager, joystick_added_callback, NULL); + IOHIDManagerRegisterDeviceMatchingCallback(hid_manager, joypad_added_callback, NULL); IOHIDManagerScheduleWithRunLoop(hid_manager, runloop, GODOT_JOY_LOOP_RUN_MODE); while (CFRunLoopRunInMode(GODOT_JOY_LOOP_RUN_MODE,0,TRUE) == kCFRunLoopRunHandledSource) { @@ -576,12 +577,12 @@ void JoystickOSX::config_hid_manager(CFArrayRef p_matching_array) const { } } -JoystickOSX::JoystickOSX() +JoypadOSX::JoypadOSX() { self = this; input = (InputDefault*)Input::get_singleton(); - for (int i = 0; i < JOYSTICKS_MAX; i++) { + for (int i = 0; i < JOYPADS_MAX; i++) { attached_devices[i] = false; } @@ -609,7 +610,7 @@ JoystickOSX::JoystickOSX() } } -JoystickOSX::~JoystickOSX() { +JoypadOSX::~JoypadOSX() { for (int i = 0; i < device_list.size(); i++) { device_list[i].free(); diff --git a/platform/osx/joystick_osx.h b/platform/osx/joypad_osx.h index 38a4e3b1d3..aafd82880d 100644 --- a/platform/osx/joystick_osx.h +++ b/platform/osx/joypad_osx.h @@ -1,11 +1,11 @@ /*************************************************************************/ -/* joystick_osx.h */ +/* joypad_osx.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -26,8 +26,8 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef JOYSTICKOSX_H -#define JOYSTICKOSX_H +#ifndef JOYPADOSX_H +#define JOYPADOSX_H #ifdef MACOS_10_0_4 #include <IOKit/hidsystem/IOHIDUsageTables.h> @@ -54,7 +54,7 @@ struct rec_element { }; }; -struct joystick { +struct joypad { IOHIDDeviceRef device_ref; Vector<rec_element> axis_elements; @@ -82,44 +82,44 @@ struct joystick { int get_hid_element_state(rec_element *p_element) const; void free(); - joystick(); + joypad(); }; -class JoystickOSX { +class JoypadOSX { enum { - JOYSTICKS_MAX = 16, + JOYPADS_MAX = 16, }; private: InputDefault *input; IOHIDManagerRef hid_manager; - bool attached_devices[JOYSTICKS_MAX]; - Vector<joystick> device_list; + bool attached_devices[JOYPADS_MAX]; + Vector<joypad> device_list; bool have_device(IOHIDDeviceRef p_device) const; - bool configure_joystick(IOHIDDeviceRef p_device_ref, joystick *p_joy); + bool configure_joypad(IOHIDDeviceRef p_device_ref, joypad *p_joy); int get_free_joy_id(); int get_joy_index(int p_id) const; - void poll_joysticks() const; - void setup_joystick_objects(); + void poll_joypads() const; + void setup_joypad_objects(); void config_hid_manager(CFArrayRef p_matching_array) const; - void joystick_vibration_start(int p_id, float p_magnitude, float p_duration, uint64_t p_timestamp); - void joystick_vibration_stop(int p_id, uint64_t p_timestamp); + void joypad_vibration_start(int p_id, float p_magnitude, float p_duration, uint64_t p_timestamp); + void joypad_vibration_stop(int p_id, uint64_t p_timestamp); public: - uint32_t process_joysticks(uint32_t p_last_id); + uint32_t process_joypads(uint32_t p_last_id); void _device_added(IOReturn p_res, IOHIDDeviceRef p_device); void _device_removed(int p_id); - JoystickOSX(); - ~JoystickOSX(); + JoypadOSX(); + ~JoypadOSX(); }; -#endif // JOYSTICKOSX_H +#endif // JOYPADOSX_H diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h index e23ae49a35..fc64c2b867 100644 --- a/platform/osx/os_osx.h +++ b/platform/osx/os_osx.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,11 +31,11 @@ #include "os/input.h" -#include "joystick_osx.h" +#include "joypad_osx.h" #include "drivers/unix/os_unix.h" #include "main/input_default.h" #include "servers/visual_server.h" -#include "servers/visual/visual_server_wrap_mt.h" +// #include "servers/visual/visual_server_wrap_mt.h" #include "servers/visual/rasterizer.h" #include "servers/physics_server.h" #include "servers/audio/audio_server_sw.h" @@ -58,7 +58,8 @@ class OS_OSX : public OS_Unix { public: bool force_quit; - Rasterizer *rasterizer; +// rasterizer seems to no longer be given to visual server, its using GLES3 directly? +// Rasterizer *rasterizer; VisualServer *visual_server; List<String> args; @@ -77,7 +78,7 @@ public: SpatialSound2DServerSW *spatial_sound_2d_server; InputDefault *input; - JoystickOSX *joystick_osx; + JoypadOSX *joypad_osx; /* objc */ diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index cc893cc7a0..a66f6abba5 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -38,13 +38,14 @@ #include "servers/visual/visual_server_raster.h" //#include "drivers/opengl/rasterizer_gl.h" //#include "drivers/gles2/rasterizer_gles2.h" +#include "drivers/gles3/rasterizer_gles3.h" #include "os_osx.h" #include <stdio.h> #include <stdlib.h> #include "print_string.h" #include "servers/physics/physics_server_sw.h" -#include "drivers/gles2/rasterizer_instance_gles2.h" -#include "servers/visual/visual_server_wrap_mt.h" +// #include "drivers/gles2/rasterizer_instance_gles2.h" +// #include "servers/visual/visual_server_wrap_mt.h" #include "main/main.h" #include "os/keyboard.h" #include "dir_access_osx.h" @@ -986,13 +987,11 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi window_size.width = p_desired.width; window_size.height = p_desired.height; -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6 && display_scale>1) { [window_view setWantsBestResolutionOpenGLSurface:YES]; //if (current_videomode.resizable) [window_object setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; } -#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/ // [window_object setTitle:[NSString stringWithUTF8String:"GodotEnginies"]]; [window_object setContentView:window_view]; @@ -1000,10 +999,8 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi [window_object setAcceptsMouseMovedEvents:YES]; [window_object center]; -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6) [window_object setRestorable:NO]; -#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/ unsigned int attributeCount = 0; @@ -1022,10 +1019,8 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi ADD_ATTR(NSOpenGLPFADoubleBuffer); ADD_ATTR(NSOpenGLPFAClosestPolicy); -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 - if (false/* use gl3*/) - ADD_ATTR2(NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core); -#endif /*MAC_OS_X_VERSION_MAX_ALLOWED*/ +// we now need OpenGL 3 or better, maybe even change this to 3_3Core ? + ADD_ATTR2(NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core); ADD_ATTR2(NSOpenGLPFAColorSize, colorBits); @@ -1084,15 +1079,19 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi AudioDriverManagerSW::add_driver(&audio_driver_osx); + // only opengl support here... + RasterizerGLES3::register_config(); + RasterizerGLES3::make_current(); - rasterizer = instance_RasterizerGLES2(); - - visual_server = memnew( VisualServerRaster(rasterizer) ); - - if (get_render_thread_mode()!=RENDER_THREAD_UNSAFE) { +// rasterizer = instance_RasterizerGLES2(); +// visual_server = memnew( VisualServerRaster(rasterizer) ); - visual_server =memnew(VisualServerWrapMT(visual_server,get_render_thread_mode()==RENDER_SEPARATE_THREAD)); - } + visual_server = memnew( VisualServerRaster ); + // FIXME: Reimplement threaded rendering? Or remove? +// if (get_render_thread_mode()!=RENDER_THREAD_UNSAFE) { +// +// visual_server =memnew(VisualServerWrapMT(visual_server,get_render_thread_mode()==RENDER_SEPARATE_THREAD)); +// } visual_server->init(); visual_server->cursor_set_visible(false, 0); @@ -1123,7 +1122,7 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi physics_2d_server->init(); input = memnew( InputDefault ); - joystick_osx = memnew( JoystickOSX ); + joypad_osx = memnew( JoypadOSX ); _ensure_data_dir(); @@ -1166,7 +1165,7 @@ void OS_OSX::finalize() { spatial_sound_2d_server->finish(); memdelete(spatial_sound_2d_server); - memdelete(joystick_osx); + memdelete(joypad_osx); memdelete(input); memdelete(sample_manager); @@ -1176,7 +1175,7 @@ void OS_OSX::finalize() { visual_server->finish(); memdelete(visual_server); - memdelete(rasterizer); +// memdelete(rasterizer); physics_server->finish(); memdelete(physics_server); @@ -1313,7 +1312,7 @@ void OS_OSX::set_window_title(const String& p_title) { void OS_OSX::set_icon(const Image& p_icon) { Image img=p_icon; - img.convert(Image::FORMAT_RGBA); + img.convert(Image::FORMAT_RGBA8); NSBitmapImageRep *imgrep= [[[NSBitmapImageRep alloc] initWithBitmapDataPlanes: NULL pixelsWide: p_icon.get_width() pixelsHigh: p_icon.get_height() @@ -1328,8 +1327,8 @@ void OS_OSX::set_icon(const Image& p_icon) { uint8_t *pixels = [imgrep bitmapData]; int len = img.get_width()*img.get_height(); - DVector<uint8_t> data = img.get_data(); - DVector<uint8_t>::Read r = data.read(); + PoolVector<uint8_t> data = img.get_data(); + PoolVector<uint8_t>::Read r = data.read(); /* Premultiply the alpha channel */ for (int i = 0; i<len ; i++) { @@ -1739,7 +1738,7 @@ void OS_OSX::run() { while (!force_quit) { process_events(); // get rid of pending events - last_id = joystick_osx->process_joysticks(last_id); + last_id = joypad_osx->process_joypads(last_id); if (Main::iteration()==true) break; }; diff --git a/platform/osx/platform_config.h b/platform/osx/platform_config.h index f02a4bc444..834d0141a3 100644 --- a/platform/osx/platform_config.h +++ b/platform/osx/platform_config.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -27,5 +27,6 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include <alloca.h> -#define GLES2_INCLUDE_H "GL/glew.h" + +#define GLES3_INCLUDE_H "glad/glad.h" #define PTHREAD_RENAME_SELF diff --git a/platform/osx/sem_osx.cpp b/platform/osx/sem_osx.cpp index 6909097fec..ca710d8b1e 100644 --- a/platform/osx/sem_osx.cpp +++ b/platform/osx/sem_osx.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/osx/sem_osx.h b/platform/osx/sem_osx.h index ec5ddac4e0..da2fac434c 100644 --- a/platform/osx/sem_osx.h +++ b/platform/osx/sem_osx.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/server/detect.py b/platform/server/detect.py index 4d86ffd376..8bc85f342d 100644 --- a/platform/server/detect.py +++ b/platform/server/detect.py @@ -76,7 +76,6 @@ def configure(env): env.ParseConfig('pkg-config libwebp --cflags --libs') if (env['builtin_freetype'] == 'no'): - env['builtin_libpng'] = 'no' # Freetype links against libpng env.ParseConfig('pkg-config freetype2 --cflags --libs') if (env['builtin_libpng'] == 'no'): diff --git a/platform/server/godot_server.cpp b/platform/server/godot_server.cpp index 1c55c03bd7..37e73d663d 100644 --- a/platform/server/godot_server.cpp +++ b/platform/server/godot_server.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/server/os_server.cpp b/platform/server/os_server.cpp index 5404980ff3..e35ad1adf8 100644 --- a/platform/server/os_server.cpp +++ b/platform/server/os_server.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -26,8 +26,8 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "servers/visual/visual_server_raster.h" -#include "servers/visual/rasterizer_dummy.h" +//#include "servers/visual/visual_server_raster.h" +//#include "servers/visual/rasterizer_dummy.h" #include "os_server.h" #include <stdio.h> #include <stdlib.h> @@ -57,9 +57,9 @@ void OS_Server::initialize(const VideoMode& p_desired,int p_video_driver,int p_a current_videomode=p_desired; main_loop=NULL; - rasterizer = memnew( RasterizerDummy ); + //rasterizer = memnew( RasterizerDummy ); - visual_server = memnew( VisualServerRaster(rasterizer) ); + //visual_server = memnew( VisualServerRaster(rasterizer) ); AudioDriverManagerSW::get_driver(p_audio_driver)->set_singleton(); @@ -114,7 +114,7 @@ void OS_Server::finalize() { visual_server->finish(); memdelete(visual_server); - memdelete(rasterizer); + //memdelete(rasterizer); physics_server->finish(); memdelete(physics_server); diff --git a/platform/server/os_server.h b/platform/server/os_server.h index 2081d5f2f4..6aa1b9e14b 100644 --- a/platform/server/os_server.h +++ b/platform/server/os_server.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -51,7 +51,7 @@ class OS_Server : public OS_Unix { - Rasterizer *rasterizer; +// Rasterizer *rasterizer; VisualServer *visual_server; VideoMode current_videomode; List<String> args; diff --git a/platform/server/platform_config.h b/platform/server/platform_config.h index 143f16c1fa..cdef185ff0 100644 --- a/platform/server/platform_config.h +++ b/platform/server/platform_config.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/uwp/SCsub b/platform/uwp/SCsub index 430d4ef9e7..0167ea9e02 100644 --- a/platform/uwp/SCsub +++ b/platform/uwp/SCsub @@ -8,7 +8,7 @@ files = [ '#platform/windows/packet_peer_udp_winsock.cpp', '#platform/windows/stream_peer_winsock.cpp', '#platform/windows/key_mapping_win.cpp', - 'joystick_uwp.cpp', + 'joypad_uwp.cpp', 'gl_context_egl.cpp', 'app.cpp', 'os_uwp.cpp', diff --git a/platform/uwp/app.cpp b/platform/uwp/app.cpp index 539c1815f6..0bae148c6b 100644 --- a/platform/uwp/app.cpp +++ b/platform/uwp/app.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/uwp/app.h b/platform/uwp/app.h index f82de4d240..6df9c5699e 100644 --- a/platform/uwp/app.h +++ b/platform/uwp/app.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index aab9ae8e39..1844df5eef 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -434,7 +434,7 @@ public: class EditorExportPlatformUWP : public EditorExportPlatform { - OBJ_TYPE(EditorExportPlatformUWP, EditorExportPlatform); + GDCLASS(EditorExportPlatformUWP, EditorExportPlatform); Ref<ImageTexture> logo; @@ -1571,7 +1571,7 @@ Vector<uint8_t> EditorExportPlatformUWP::_fix_manifest(const Vector<uint8_t> &p_ String architecture = arch == ARM ? "ARM" : arch == X86 ? "x86" : "x64"; result = result.replace("$architecture$", architecture); - result = result.replace("$display_name$", display_name.empty() ? (String)Globals::get_singleton()->get("application/name") : display_name); + result = result.replace("$display_name$", display_name.empty() ? (String)GlobalConfig::get_singleton()->get("application/name") : display_name); result = result.replace("$publisher_display_name$", publisher_display_name); result = result.replace("$app_description$", description); result = result.replace("$bg_color$", background_color); diff --git a/platform/uwp/export/export.h b/platform/uwp/export/export.h index f25065341d..2d6e02bb10 100644 --- a/platform/uwp/export/export.h +++ b/platform/uwp/export/export.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/uwp/gl_context_egl.cpp b/platform/uwp/gl_context_egl.cpp index f7b514b3c0..c9c03db8a1 100644 --- a/platform/uwp/gl_context_egl.cpp +++ b/platform/uwp/gl_context_egl.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/uwp/gl_context_egl.h b/platform/uwp/gl_context_egl.h index 8124c2903d..858eaa6d12 100644 --- a/platform/uwp/gl_context_egl.h +++ b/platform/uwp/gl_context_egl.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/uwp/joystick_uwp.cpp b/platform/uwp/joypad_uwp.cpp index ad0516992b..7f0837d7be 100644 --- a/platform/uwp/joystick_uwp.cpp +++ b/platform/uwp/joypad_uwp.cpp @@ -1,11 +1,11 @@ /*************************************************************************/ -/* joystick_uwp.cpp */ +/* joypad_uwp.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -27,20 +27,20 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "joystick_uwp.h" +#include "joypad_uwp.h" using namespace Windows::Gaming::Input; using namespace Windows::Foundation; -void JoystickUWP::register_events() { +void JoypadUWP::register_events() { Gamepad::GamepadAdded += - ref new EventHandler<Gamepad^>(this, &JoystickUWP::OnGamepadAdded); + ref new EventHandler<Gamepad^>(this, &JoypadUWP::OnGamepadAdded); Gamepad::GamepadRemoved += - ref new EventHandler<Gamepad^>(this, &JoystickUWP::OnGamepadRemoved); + ref new EventHandler<Gamepad^>(this, &JoypadUWP::OnGamepadRemoved); } -uint32_t JoystickUWP::process_controllers(uint32_t p_last_id) { +uint32_t JoypadUWP::process_controllers(uint32_t p_last_id) { for (int i = 0; i < MAX_CONTROLLERS; i++) { @@ -74,20 +74,20 @@ uint32_t JoystickUWP::process_controllers(uint32_t p_last_id) { return p_last_id; } -JoystickUWP::JoystickUWP() { +JoypadUWP::JoypadUWP() { for (int i = 0; i < MAX_CONTROLLERS; i++) controllers[i].id = i; } -JoystickUWP::JoystickUWP(InputDefault * p_input) { +JoypadUWP::JoypadUWP(InputDefault * p_input) { input = p_input; - JoystickUWP(); + JoypadUWP(); } -void JoystickUWP::OnGamepadAdded(Platform::Object ^ sender, Windows::Gaming::Input::Gamepad ^ value) { +void JoypadUWP::OnGamepadAdded(Platform::Object ^ sender, Windows::Gaming::Input::Gamepad ^ value) { short idx = -1; @@ -109,7 +109,7 @@ void JoystickUWP::OnGamepadAdded(Platform::Object ^ sender, Windows::Gaming::Inp input->joy_connection_changed(controllers[idx].id, true, "Xbox Controller", "__UWP_GAMEPAD__"); } -void JoystickUWP::OnGamepadRemoved(Platform::Object ^ sender, Windows::Gaming::Input::Gamepad ^ value) { +void JoypadUWP::OnGamepadRemoved(Platform::Object ^ sender, Windows::Gaming::Input::Gamepad ^ value) { short idx = -1; @@ -136,7 +136,7 @@ void JoystickUWP::OnGamepadRemoved(Platform::Object ^ sender, Windows::Gaming::I input->joy_connection_changed(idx, false, "Xbox Controller"); } -InputDefault::JoyAxis JoystickUWP::axis_correct(double p_val, bool p_negate, bool p_trigger) const { +InputDefault::JoyAxis JoypadUWP::axis_correct(double p_val, bool p_negate, bool p_trigger) const { InputDefault::JoyAxis jx; diff --git a/platform/uwp/joystick_uwp.h b/platform/uwp/joypad_uwp.h index 47ec738a18..90505b409a 100644 --- a/platform/uwp/joystick_uwp.h +++ b/platform/uwp/joypad_uwp.h @@ -1,11 +1,11 @@ /*************************************************************************/ -/* joystick_uwp.h */ +/* joypad_uwp.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -26,20 +26,20 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#ifndef JOYSTICK_UWP_H -#define JOYSTICK_UWP_H +#ifndef JOYPAD_UWP_H +#define JOYPAD_UWP_H #include "main/input_default.h" -ref class JoystickUWP sealed { +ref class JoypadUWP sealed { internal: void register_events(); uint32_t process_controllers(uint32_t p_last_id); - JoystickUWP(); - JoystickUWP(InputDefault* p_input); + JoypadUWP(); + JoypadUWP(InputDefault* p_input); private: diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp index fb1dc3be19..34977bc048 100644 --- a/platform/uwp/os_uwp.cpp +++ b/platform/uwp/os_uwp.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -285,8 +285,8 @@ void OSUWP::initialize(const VideoMode& p_desired,int p_video_driver,int p_audio input = memnew( InputDefault ); - joystick = ref new JoystickUWP(input); - joystick->register_events(); + joypad = ref new JoypadUWP(input); + joypad->register_events(); AudioDriverManagerSW::get_driver(p_audio_driver)->set_singleton(); @@ -429,7 +429,7 @@ void OSUWP::finalize() { physics_2d_server->finish(); memdelete(physics_2d_server); - joystick = nullptr; + joypad = nullptr; } void OSUWP::finalize_core() { @@ -725,7 +725,7 @@ uint64_t OSUWP::get_ticks_usec() const { void OSUWP::process_events() { - last_id = joystick->process_controllers(last_id); + last_id = joypad->process_controllers(last_id); process_key_events(); } diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h index 47eb095e11..82376dd2f6 100644 --- a/platform/uwp/os_uwp.h +++ b/platform/uwp/os_uwp.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -55,7 +55,7 @@ #include <stdio.h> #include "main/input_default.h" -#include "joystick_uwp.h" +#include "joypad_uwp.h" /** @author Juan Linietsky <reduzio@gmail.com> @@ -85,7 +85,7 @@ public: private: enum { - JOYSTICKS_MAX = 8, + JOYPADS_MAX = 8, JOY_AXIS_COUNT = 6, MAX_JOY_AXIS = 32768, // I've no idea KEY_EVENT_BUFFER_SIZE=512 @@ -137,7 +137,7 @@ private: InputDefault *input; - JoystickUWP^ joystick; + JoypadUWP^ joypad; Windows::System::Display::DisplayRequest^ display_request; diff --git a/platform/uwp/platform_config.h b/platform/uwp/platform_config.h index 88b1fefed8..7939e1c9ee 100644 --- a/platform/uwp/platform_config.h +++ b/platform/uwp/platform_config.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/uwp/thread_uwp.cpp b/platform/uwp/thread_uwp.cpp index a5a0920df6..4008a1eeb0 100644 --- a/platform/uwp/thread_uwp.cpp +++ b/platform/uwp/thread_uwp.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/uwp/thread_uwp.h b/platform/uwp/thread_uwp.h index 95b9aeb62b..06c19c0139 100644 --- a/platform/uwp/thread_uwp.h +++ b/platform/uwp/thread_uwp.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/windows/SCsub b/platform/windows/SCsub index 32c23b906a..ae8c07384f 100644 --- a/platform/windows/SCsub +++ b/platform/windows/SCsub @@ -11,7 +11,7 @@ common_win = [ "tcp_server_winsock.cpp", "packet_peer_udp_winsock.cpp", "stream_peer_winsock.cpp", - "joystick.cpp", + "joypad.cpp", ] restarget = "godot_res" + env["OBJSUFFIX"] diff --git a/platform/windows/context_gl_win.cpp b/platform/windows/context_gl_win.cpp index fd9e895370..6b60ade5f0 100644 --- a/platform/windows/context_gl_win.cpp +++ b/platform/windows/context_gl_win.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -40,7 +40,6 @@ // // -#define WINVER 0x0500 #include "context_gl_win.h" //#include "drivers/opengl/glwrapper.h" @@ -110,6 +109,7 @@ bool ContextGL_Win::is_using_vsync() const { return use_vsync; } +#define _WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 Error ContextGL_Win::initialize() { @@ -162,10 +162,10 @@ Error ContextGL_Win::initialize() { if (opengl_3_context) { int attribs[] = { - WGL_CONTEXT_MAJOR_VERSION_ARB, 3,//we want a 3.1 context - WGL_CONTEXT_MINOR_VERSION_ARB, 2, + WGL_CONTEXT_MAJOR_VERSION_ARB, 3,//we want a 3.3 context + WGL_CONTEXT_MINOR_VERSION_ARB, 3, //and it shall be forward compatible so that we can only use up to date functionality - WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB, + WGL_CONTEXT_FLAGS_ARB, WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB|_WGL_CONTEXT_DEBUG_BIT_ARB, 0}; //zero indicates the end of the array PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB = NULL; //pointer to the method @@ -182,7 +182,7 @@ Error ContextGL_Win::initialize() { if (!(new_hRC=wglCreateContextAttribsARB(hDC,0, attribs))) { wglDeleteContext(hRC); - MessageBox(NULL,"Can't Create An OpenGL 3.1 Rendering Context.","ERROR",MB_OK|MB_ICONEXCLAMATION); + MessageBox(NULL,"Can't Create An OpenGL 3.3 Rendering Context.","ERROR",MB_OK|MB_ICONEXCLAMATION); return ERR_CANT_CREATE; // Return false } wglMakeCurrent(hDC,NULL); @@ -191,11 +191,11 @@ Error ContextGL_Win::initialize() { if (!wglMakeCurrent(hDC,hRC)) // Try To Activate The Rendering Context { - MessageBox(NULL,"Can't Activate The GL 3.1 Rendering Context.","ERROR",MB_OK|MB_ICONEXCLAMATION); + MessageBox(NULL,"Can't Activate The GL 3.3 Rendering Context.","ERROR",MB_OK|MB_ICONEXCLAMATION); return ERR_CANT_CREATE; // Return FALSE } - printf("Activated GL 3.1 context"); + printf("Activated GL 3.3 context"); } wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC) wglGetProcAddress ("wglSwapIntervalEXT"); diff --git a/platform/windows/context_gl_win.h b/platform/windows/context_gl_win.h index e1ab6fb26a..96b54c6c14 100644 --- a/platform/windows/context_gl_win.h +++ b/platform/windows/context_gl_win.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/windows/ctxgl_procaddr.cpp b/platform/windows/ctxgl_procaddr.cpp index 1072197f89..bc8611dce4 100644 --- a/platform/windows/ctxgl_procaddr.cpp +++ b/platform/windows/ctxgl_procaddr.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/windows/ctxgl_procaddr.h b/platform/windows/ctxgl_procaddr.h index 2118e20e02..72f39e71ac 100644 --- a/platform/windows/ctxgl_procaddr.h +++ b/platform/windows/ctxgl_procaddr.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/windows/detect.py b/platform/windows/detect.py index df5bc49aa4..1f3c7a7654 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -207,6 +207,10 @@ def build_res_file(target, source, env): def configure(env): env.Append(CPPPATH=['#platform/windows']) + + # Targeted Windows version: Vista (and later) + env.Append(CPPFLAGS=['-D_WIN32_WINNT=0x0600']) + env['is_mingw'] = False if (os.name == "nt" and os.getenv("VCINSTALLDIR")): # build using visual studio @@ -246,7 +250,7 @@ def configure(env): env.Append(CCFLAGS=['/DWIN32']) env.Append(CCFLAGS=['/DTYPED_METHOD_BIND']) - env.Append(CCFLAGS=['/DGLES2_ENABLED']) + env.Append(CCFLAGS=['/DOPENGL_ENABLED']) LIBS = ['winmm', 'opengl32', 'dsound', 'kernel32', 'ole32', 'oleaut32', 'user32', 'gdi32', 'IPHLPAPI', 'Shlwapi', 'wsock32', 'Ws2_32', 'shell32', 'advapi32', 'dinput8', 'dxguid'] env.Append(LINKFLAGS=[p + env["LIBSUFFIX"] for p in LIBS]) @@ -315,7 +319,7 @@ def configure(env): mingw_prefix = "" if (env["bits"] == "default"): - env["bits"] = "32" + env["bits"] = "64" if "PROGRAMFILES(X86)" in os.environ else "32" if (env["bits"] == "32"): env.Append(LINKFLAGS=['-static']) @@ -370,7 +374,7 @@ def configure(env): env.Append(CCFLAGS=['-DWINDOWS_ENABLED', '-mwindows']) env.Append(CPPFLAGS=['-DRTAUDIO_ENABLED']) - env.Append(CCFLAGS=['-DGLES2_ENABLED']) + env.Append(CCFLAGS=['-DOPENGL_ENABLED']) env.Append(LIBS=['mingw32', 'opengl32', 'dsound', 'ole32', 'd3d9', 'winmm', 'gdi32', 'iphlpapi', 'shlwapi', 'wsock32', 'ws2_32', 'kernel32', 'oleaut32', 'dinput8', 'dxguid']) # if (env["bits"]=="32"): diff --git a/platform/windows/export/export.cpp b/platform/windows/export/export.cpp index 9bf9ba93fe..1ad61844d0 100644 --- a/platform/windows/export/export.cpp +++ b/platform/windows/export/export.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/windows/export/export.h b/platform/windows/export/export.h index aa3578fb98..b437efc48e 100644 --- a/platform/windows/export/export.h +++ b/platform/windows/export/export.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/windows/godot_win.cpp b/platform/windows/godot_win.cpp index c89d02bb05..5260f7f641 100644 --- a/platform/windows/godot_win.cpp +++ b/platform/windows/godot_win.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/windows/joystick.cpp b/platform/windows/joypad.cpp index e69bfe6a52..6ea23ebb28 100644 --- a/platform/windows/joystick.cpp +++ b/platform/windows/joypad.cpp @@ -1,11 +1,11 @@ /*************************************************************************/ -/* joystick.cpp */ +/* joypad.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -26,8 +26,7 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -//author: Andreas Haas <hondres, liugam3@gmail.com> -#include "joystick.h" +#include "joypad.h" #include <iostream> #include <wbemidl.h> #include <oleauto.h> @@ -39,15 +38,15 @@ DWORD WINAPI _xinput_get_state(DWORD dwUserIndex, XINPUT_STATE* pState) { return ERROR_DEVICE_NOT_CONNECTED; } DWORD WINAPI _xinput_set_state(DWORD dwUserIndex, XINPUT_VIBRATION* pVibration) { return ERROR_DEVICE_NOT_CONNECTED; } -joystick_windows::joystick_windows() { +JoypadWindows::JoypadWindows() { } -joystick_windows::joystick_windows(InputDefault* _input, HWND* hwnd) { +JoypadWindows::JoypadWindows(InputDefault* _input, HWND* hwnd) { input = _input; hWnd = hwnd; - joystick_count = 0; + joypad_count = 0; dinput = NULL; xinput_dll = NULL; xinput_get_state = NULL; @@ -55,8 +54,8 @@ joystick_windows::joystick_windows(InputDefault* _input, HWND* hwnd) { load_xinput(); - for (int i = 0; i < JOYSTICKS_MAX; i++) - attached_joysticks[i] = false; + for (int i = 0; i < JOYPADS_MAX; i++) + attached_joypads[i] = false; HRESULT result; @@ -64,35 +63,35 @@ joystick_windows::joystick_windows(InputDefault* _input, HWND* hwnd) { if (FAILED(result)) { printf("failed init DINPUT: %ld\n", result); } - probe_joysticks(); + probe_joypads(); } -joystick_windows::~joystick_windows() { +JoypadWindows::~JoypadWindows() { - close_joystick(); + close_joypad(); dinput->Release(); unload_xinput(); } -bool joystick_windows::have_device(const GUID &p_guid) { +bool JoypadWindows::have_device(const GUID &p_guid) { - for (int i = 0; i < JOYSTICKS_MAX; i++) { + for (int i = 0; i < JOYPADS_MAX; i++) { - if (d_joysticks[i].guid == p_guid) { + if (d_joypads[i].guid == p_guid) { - d_joysticks[i].confirmed = true; + d_joypads[i].confirmed = true; return true; } } return false; } -int joystick_windows::check_free_joy_slot() const { +int JoypadWindows::check_free_joy_slot() const { - for (int i = 0; i < JOYSTICKS_MAX; i++) { + for (int i = 0; i < JOYPADS_MAX; i++) { - if (!attached_joysticks[i]) + if (!attached_joypads[i]) return i; } return -1; @@ -100,7 +99,7 @@ int joystick_windows::check_free_joy_slot() const { // adapted from SDL2, works a lot better than the MSDN version -bool joystick_windows::is_xinput_device(const GUID *p_guid) { +bool JoypadWindows::is_xinput_device(const GUID *p_guid) { static GUID IID_ValveStreamingGamepad = { MAKELONG(0x28DE, 0x11FF), 0x0000, 0x0000, { 0x00, 0x00, 0x50, 0x49, 0x44, 0x56, 0x49, 0x44 } }; static GUID IID_X360WiredGamepad = { MAKELONG(0x045E, 0x02A1), 0x0000, 0x0000, { 0x00, 0x00, 0x50, 0x49, 0x44, 0x56, 0x49, 0x44 } }; @@ -144,7 +143,7 @@ bool joystick_windows::is_xinput_device(const GUID *p_guid) { return false; } -bool joystick_windows::setup_dinput_joystick(const DIDEVICEINSTANCE* instance) { +bool JoypadWindows::setup_dinput_joypad(const DIDEVICEINSTANCE* instance) { HRESULT hr; int num = check_free_joy_slot(); @@ -152,8 +151,8 @@ bool joystick_windows::setup_dinput_joystick(const DIDEVICEINSTANCE* instance) { if (have_device(instance->guidInstance) || num == -1) return false; - d_joysticks[joystick_count] = dinput_gamepad(); - dinput_gamepad* joy = &d_joysticks[joystick_count]; + d_joypads[joypad_count] = dinput_gamepad(); + dinput_gamepad* joy = &d_joypads[joypad_count]; const DWORD devtype = (instance->dwDevType & 0xFF); @@ -177,7 +176,7 @@ bool joystick_windows::setup_dinput_joystick(const DIDEVICEINSTANCE* instance) { guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]); - id_to_change = joystick_count; + id_to_change = joypad_count; joy->di_joy->SetDataFormat(&c_dfDIJoystick2); joy->di_joy->SetCooperativeLevel(*hWnd, DISCL_FOREGROUND); @@ -188,13 +187,13 @@ bool joystick_windows::setup_dinput_joystick(const DIDEVICEINSTANCE* instance) { input->joy_connection_changed(num, true, instance->tszProductName, uid); joy->attached = true; joy->id = num; - attached_joysticks[num] = true; + attached_joypads[num] = true; joy->confirmed = true; - joystick_count++; + joypad_count++; return true; } -void joystick_windows::setup_joystick_object(const DIDEVICEOBJECTINSTANCE *ob, int p_joy_id) { +void JoypadWindows::setup_joypad_object(const DIDEVICEOBJECTINSTANCE *ob, int p_joy_id) { if (ob->dwType & DIDFT_AXIS) { @@ -225,7 +224,7 @@ void joystick_windows::setup_joystick_object(const DIDEVICEOBJECTINSTANCE *ob, i prop_range.lMin = -MAX_JOY_AXIS; prop_range.lMax = +MAX_JOY_AXIS; - dinput_gamepad &joy = d_joysticks[p_joy_id]; + dinput_gamepad &joy = d_joypads[p_joy_id]; res = IDirectInputDevice8_SetProperty(joy.di_joy, DIPROP_RANGE, &prop_range.diph); @@ -246,100 +245,100 @@ void joystick_windows::setup_joystick_object(const DIDEVICEOBJECTINSTANCE *ob, i } } -BOOL CALLBACK joystick_windows::enumCallback(const DIDEVICEINSTANCE* instance, void* pContext) { +BOOL CALLBACK JoypadWindows::enumCallback(const DIDEVICEINSTANCE* instance, void* pContext) { - joystick_windows* self = (joystick_windows*)pContext; + JoypadWindows* self = (JoypadWindows*)pContext; if (self->is_xinput_device(&instance->guidProduct)) {; return DIENUM_CONTINUE; } - self->setup_dinput_joystick(instance); + self->setup_dinput_joypad(instance); return DIENUM_CONTINUE; } -BOOL CALLBACK joystick_windows::objectsCallback(const DIDEVICEOBJECTINSTANCE *instance, void *context) { +BOOL CALLBACK JoypadWindows::objectsCallback(const DIDEVICEOBJECTINSTANCE *instance, void *context) { - joystick_windows* self = (joystick_windows*)context; - self->setup_joystick_object(instance, self->id_to_change); + JoypadWindows* self = (JoypadWindows*)context; + self->setup_joypad_object(instance, self->id_to_change); return DIENUM_CONTINUE; } -void joystick_windows::close_joystick(int id) { +void JoypadWindows::close_joypad(int id) { if (id == -1) { - for (int i = 0; i < JOYSTICKS_MAX; i++) { + for (int i = 0; i < JOYPADS_MAX; i++) { - close_joystick(i); + close_joypad(i); } return; } - if (!d_joysticks[id].attached) return; + if (!d_joypads[id].attached) return; - d_joysticks[id].di_joy->Unacquire(); - d_joysticks[id].di_joy->Release(); - d_joysticks[id].attached = false; - attached_joysticks[d_joysticks[id].id] = false; - d_joysticks[id].guid.Data1 = d_joysticks[id].guid.Data2 = d_joysticks[id].guid.Data3 = 0; - input->joy_connection_changed(d_joysticks[id].id, false, ""); - joystick_count--; + d_joypads[id].di_joy->Unacquire(); + d_joypads[id].di_joy->Release(); + d_joypads[id].attached = false; + attached_joypads[d_joypads[id].id] = false; + d_joypads[id].guid.Data1 = d_joypads[id].guid.Data2 = d_joypads[id].guid.Data3 = 0; + input->joy_connection_changed(d_joypads[id].id, false, ""); + joypad_count--; } -void joystick_windows::probe_joysticks() { +void JoypadWindows::probe_joypads() { DWORD dwResult; for (DWORD i = 0; i < XUSER_MAX_COUNT; i++) { - ZeroMemory(&x_joysticks[i].state, sizeof(XINPUT_STATE)); + ZeroMemory(&x_joypads[i].state, sizeof(XINPUT_STATE)); - dwResult = xinput_get_state(i, &x_joysticks[i].state); + dwResult = xinput_get_state(i, &x_joypads[i].state); if ( dwResult == ERROR_SUCCESS) { int id = check_free_joy_slot(); - if (id != -1 && !x_joysticks[i].attached) { - - x_joysticks[i].attached = true; - x_joysticks[i].id = id; - x_joysticks[i].ff_timestamp = 0; - x_joysticks[i].ff_end_timestamp = 0; - x_joysticks[i].vibrating = false; - attached_joysticks[id] = true; + if (id != -1 && !x_joypads[i].attached) { + + x_joypads[i].attached = true; + x_joypads[i].id = id; + x_joypads[i].ff_timestamp = 0; + x_joypads[i].ff_end_timestamp = 0; + x_joypads[i].vibrating = false; + attached_joypads[id] = true; input->joy_connection_changed(id, true, "XInput Gamepad","__XINPUT_DEVICE__"); } } - else if (x_joysticks[i].attached) { + else if (x_joypads[i].attached) { - x_joysticks[i].attached = false; - attached_joysticks[x_joysticks[i].id] = false; - input->joy_connection_changed(x_joysticks[i].id, false, ""); + x_joypads[i].attached = false; + attached_joypads[x_joypads[i].id] = false; + input->joy_connection_changed(x_joypads[i].id, false, ""); } } - for (int i = 0; i < joystick_count; i++) { + for (int i = 0; i < joypad_count; i++) { - d_joysticks[i].confirmed = false; + d_joypads[i].confirmed = false; } dinput->EnumDevices(DI8DEVCLASS_GAMECTRL, enumCallback, this, DIEDFL_ATTACHEDONLY); - for (int i = 0; i < joystick_count; i++) { + for (int i = 0; i < joypad_count; i++) { - if (!d_joysticks[i].confirmed) { + if (!d_joypads[i].confirmed) { - close_joystick(i); + close_joypad(i); } } } -unsigned int joystick_windows::process_joysticks(unsigned int p_last_id) { +unsigned int JoypadWindows::process_joypads(unsigned int p_last_id) { HRESULT hr; for (int i = 0; i < XUSER_MAX_COUNT; i++) { - xinput_gamepad &joy = x_joysticks[i]; + xinput_gamepad &joy = x_joypads[i]; if (!joy.attached) { continue; } @@ -368,20 +367,20 @@ unsigned int joystick_windows::process_joysticks(unsigned int p_last_id) { Vector2 strength = input->get_joy_vibration_strength(joy.id); float duration = input->get_joy_vibration_duration(joy.id); if (strength.x == 0 && strength.y == 0) { - joystick_vibration_stop_xinput(i, timestamp); + joypad_vibration_stop_xinput(i, timestamp); } else { - joystick_vibration_start_xinput(i, strength.x, strength.y, duration, timestamp); + joypad_vibration_start_xinput(i, strength.x, strength.y, duration, timestamp); } } else if (joy.vibrating && joy.ff_end_timestamp != 0) { uint64_t current_time = OS::get_singleton()->get_ticks_usec(); if (current_time >= joy.ff_end_timestamp) - joystick_vibration_stop_xinput(i, current_time); + joypad_vibration_stop_xinput(i, current_time); } } - for (int i = 0; i < JOYSTICKS_MAX; i++) { + for (int i = 0; i < JOYPADS_MAX; i++) { - dinput_gamepad* joy = &d_joysticks[i]; + dinput_gamepad* joy = &d_joypads[i]; if (!joy->attached) continue; @@ -438,7 +437,7 @@ unsigned int joystick_windows::process_joysticks(unsigned int p_last_id) { return p_last_id; } -unsigned int joystick_windows::post_hat(unsigned int p_last_id, int p_device, DWORD p_dpad) { +unsigned int JoypadWindows::post_hat(unsigned int p_last_id, int p_device, DWORD p_dpad) { int dpad_val = 0; @@ -487,7 +486,7 @@ unsigned int joystick_windows::post_hat(unsigned int p_last_id, int p_device, DW return input->joy_hat(p_last_id, p_device, dpad_val); }; -InputDefault::JoyAxis joystick_windows::axis_correct(int p_val, bool p_xinput, bool p_trigger, bool p_negate) const { +InputDefault::JoyAxis JoypadWindows::axis_correct(int p_val, bool p_xinput, bool p_trigger, bool p_negate) const { InputDefault::JoyAxis jx; if (Math::abs(p_val) < MIN_JOY_AXIS) { @@ -519,8 +518,8 @@ InputDefault::JoyAxis joystick_windows::axis_correct(int p_val, bool p_xinput, b return jx; } -void joystick_windows::joystick_vibration_start_xinput(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration, uint64_t p_timestamp) { - xinput_gamepad &joy = x_joysticks[p_device]; +void JoypadWindows::joypad_vibration_start_xinput(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration, uint64_t p_timestamp) { + xinput_gamepad &joy = x_joypads[p_device]; if (joy.attached) { XINPUT_VIBRATION effect; effect.wLeftMotorSpeed = (65535 * p_strong_magnitude); @@ -533,8 +532,8 @@ void joystick_windows::joystick_vibration_start_xinput(int p_device, float p_wea } } -void joystick_windows::joystick_vibration_stop_xinput(int p_device, uint64_t p_timestamp) { - xinput_gamepad &joy = x_joysticks[p_device]; +void JoypadWindows::joypad_vibration_stop_xinput(int p_device, uint64_t p_timestamp) { + xinput_gamepad &joy = x_joypads[p_device]; if (joy.attached) { XINPUT_VIBRATION effect; effect.wLeftMotorSpeed = 0; @@ -547,7 +546,7 @@ void joystick_windows::joystick_vibration_stop_xinput(int p_device, uint64_t p_t } -void joystick_windows::load_xinput() { +void JoypadWindows::load_xinput() { xinput_get_state = &_xinput_get_state; xinput_set_state = &_xinput_set_state; @@ -576,7 +575,7 @@ void joystick_windows::load_xinput() { xinput_set_state = set_func; } -void joystick_windows::unload_xinput() { +void JoypadWindows::unload_xinput() { if (xinput_dll) { diff --git a/platform/windows/joystick.h b/platform/windows/joypad.h index 77dee0466f..63eee8c015 100644 --- a/platform/windows/joystick.h +++ b/platform/windows/joypad.h @@ -1,11 +1,11 @@ /*************************************************************************/ -/* joystick.h */ +/* joypad.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -26,9 +26,8 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -//author: Andreas Haas <hondres, liugam3@gmail.com> -#ifndef JOYSTICK_H -#define JOYSTICK_H +#ifndef JOYPAD_H +#define JOYPAD_H #include "os_windows.h" #define DIRECTINPUT_VERSION 0x0800 @@ -48,19 +47,19 @@ if(x != NULL) \ #define XUSER_MAX_COUNT 4 #endif -class joystick_windows +class JoypadWindows { public: - joystick_windows(); - joystick_windows(InputDefault* _input, HWND* hwnd); - ~joystick_windows(); + JoypadWindows(); + JoypadWindows(InputDefault* _input, HWND* hwnd); + ~JoypadWindows(); - void probe_joysticks(); - unsigned int process_joysticks(unsigned int p_last_id); + void probe_joypads(); + unsigned int process_joypads(unsigned int p_last_id); private: enum { - JOYSTICKS_MAX = 16, + JOYPADS_MAX = 16, JOY_AXIS_COUNT = 6, MIN_JOY_AXIS = 10, MAX_JOY_AXIS = 32768, @@ -120,16 +119,16 @@ private: InputDefault* input; int id_to_change; - int joystick_count; - bool attached_joysticks[JOYSTICKS_MAX]; - dinput_gamepad d_joysticks[JOYSTICKS_MAX]; - xinput_gamepad x_joysticks[XUSER_MAX_COUNT]; + int joypad_count; + bool attached_joypads[JOYPADS_MAX]; + dinput_gamepad d_joypads[JOYPADS_MAX]; + xinput_gamepad x_joypads[XUSER_MAX_COUNT]; static BOOL CALLBACK enumCallback(const DIDEVICEINSTANCE* p_instance, void* p_context); static BOOL CALLBACK objectsCallback(const DIDEVICEOBJECTINSTANCE* instance, void* context); - void setup_joystick_object(const DIDEVICEOBJECTINSTANCE* ob, int p_joy_id); - void close_joystick(int id = -1); + void setup_joypad_object(const DIDEVICEOBJECTINSTANCE* ob, int p_joy_id); + void close_joypad(int id = -1); void load_xinput(); void unload_xinput(); @@ -138,9 +137,9 @@ private: bool have_device(const GUID &p_guid); bool is_xinput_device(const GUID* p_guid); - bool setup_dinput_joystick(const DIDEVICEINSTANCE* instance); - void joystick_vibration_start_xinput(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration, uint64_t p_timestamp); - void joystick_vibration_stop_xinput(int p_device, uint64_t p_timestamp); + bool setup_dinput_joypad(const DIDEVICEINSTANCE* instance); + void joypad_vibration_start_xinput(int p_device, float p_weak_magnitude, float p_strong_magnitude, float p_duration, uint64_t p_timestamp); + void joypad_vibration_stop_xinput(int p_device, uint64_t p_timestamp); InputDefault::JoyAxis axis_correct(int p_val, bool p_xinput = false, bool p_trigger = false, bool p_negate = false) const; XInputGetState_t xinput_get_state; diff --git a/platform/windows/key_mapping_win.cpp b/platform/windows/key_mapping_win.cpp index 23fa29d68f..9ab222e9ee 100644 --- a/platform/windows/key_mapping_win.cpp +++ b/platform/windows/key_mapping_win.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -26,8 +26,8 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#define WINVER 0x0500 #include "key_mapping_win.h" + #include <stdio.h> struct _WinTranslatePair { diff --git a/platform/windows/key_mapping_win.h b/platform/windows/key_mapping_win.h index da649d0115..2f1b36d9f2 100644 --- a/platform/windows/key_mapping_win.h +++ b/platform/windows/key_mapping_win.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/windows/lang_table.h b/platform/windows/lang_table.h index c9551b2d38..bacbf89e85 100644 --- a/platform/windows/lang_table.h +++ b/platform/windows/lang_table.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 3987044d80..6256cb58e0 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -26,14 +26,15 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -#include "drivers/gles2/rasterizer_gles2.h" #include "os_windows.h" -#include "drivers/unix/memory_pool_static_malloc.h" -#include "os/memory_pool_dynamic_static.h" + +#include "drivers/gles3/rasterizer_gles3.h" + #include "drivers/windows/thread_windows.h" #include "drivers/windows/semaphore_windows.h" #include "drivers/windows/mutex_windows.h" +#include "drivers/windows/rw_lock_windows.h" #include "main/main.h" #include "drivers/windows/file_access_windows.h" #include "drivers/windows/dir_access_windows.h" @@ -41,16 +42,16 @@ #include "servers/visual/visual_server_raster.h" #include "servers/audio/audio_server_sw.h" -#include "servers/visual/visual_server_wrap_mt.h" +//#include "servers/visual/visual_server_wrap_mt.h" #include "tcp_server_winsock.h" #include "packet_peer_udp_winsock.h" #include "stream_peer_winsock.h" #include "lang_table.h" -#include "os/memory_pool_dynamic_prealloc.h" + #include "globals.h" #include "io/marshalls.h" -#include "joystick.h" +#include "joypad.h" #include "shlobj.h" #include <regstr.h> @@ -166,8 +167,6 @@ const char * OS_Windows::get_audio_driver_name(int p_driver) const { return AudioDriverManagerSW::get_driver(p_driver)->get_name(); } -static MemoryPoolStatic *mempool_static=NULL; -static MemoryPoolDynamic *mempool_dynamic=NULL; void OS_Windows::initialize_core() { @@ -182,6 +181,7 @@ void OS_Windows::initialize_core() { ThreadWindows::make_default(); SemaphoreWindows::make_default(); MutexWindows::make_default(); + RWLockWindows::make_default(); FileAccess::make_default<FileAccessWindows>(FileAccess::ACCESS_RESOURCES); FileAccess::make_default<FileAccessWindows>(FileAccess::ACCESS_USERDATA); @@ -195,15 +195,6 @@ void OS_Windows::initialize_core() { StreamPeerWinsock::make_default(); PacketPeerUDPWinsock::make_default(); - mempool_static = new MemoryPoolStaticMalloc; -#if 1 - mempool_dynamic = memnew( MemoryPoolDynamicStatic ); -#else -#define DYNPOOL_SIZE 4*1024*1024 - void * buffer = malloc( DYNPOOL_SIZE ); - mempool_dynamic = memnew( MemoryPoolDynamicPrealloc(buffer,DYNPOOL_SIZE) ); - -#endif // We need to know how often the clock is updated if( !QueryPerformanceFrequency((LARGE_INTEGER *)&ticks_per_second) ) @@ -686,7 +677,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) { print_line("input lang change"); } break; - #if WINVER >= 0x0700 // for windows 7 + #if WINVER >= 0x0601 // for windows 7 case WM_TOUCH: { BOOL bHandled = FALSE; @@ -723,7 +714,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd,UINT uMsg, WPARAM wParam, LPARAM lParam) { #endif case WM_DEVICECHANGE: { - joystick->probe_joysticks(); + joypad->probe_joypads(); } break; case WM_SETCURSOR: { @@ -1078,21 +1069,26 @@ void OS_Windows::initialize(const VideoMode& p_desired,int p_video_driver,int p_ }; -#if defined(OPENGL_ENABLED) || defined(GLES2_ENABLED) || defined(LEGACYGL_ENABLED) - gl_context = memnew( ContextGL_Win(hWnd,false) ); +#if defined(OPENGL_ENABLED) + gl_context = memnew( ContextGL_Win(hWnd,true) ); gl_context->initialize(); - rasterizer = memnew( RasterizerGLES2 ); + + RasterizerGLES3::register_config(); + + RasterizerGLES3::make_current(); #else - #ifdef DX9_ENABLED + // FIXME: Does DX support still work now that rasterizer is no longer used? +#ifdef DX9_ENABLED rasterizer = memnew( RasterizerDX9(hWnd) ); - #endif +#endif #endif - visual_server = memnew( VisualServerRaster(rasterizer) ); - if (get_render_thread_mode()!=RENDER_THREAD_UNSAFE) { - - visual_server =memnew(VisualServerWrapMT(visual_server,get_render_thread_mode()==RENDER_SEPARATE_THREAD)); - } + visual_server = memnew( VisualServerRaster ); + // FIXME: Reimplement threaded rendering? Or remove? +// if (get_render_thread_mode()!=RENDER_THREAD_UNSAFE) { +// +// visual_server =memnew(VisualServerWrapMT(visual_server,get_render_thread_mode()==RENDER_SEPARATE_THREAD)); +// } // physics_server = memnew( PhysicsServerSW ); @@ -1124,7 +1120,7 @@ void OS_Windows::initialize(const VideoMode& p_desired,int p_video_driver,int p_ visual_server->init(); input = memnew( InputDefault ); - joystick = memnew (joystick_windows(input, &hWnd)); + joypad = memnew (JoypadWindows(input, &hWnd)); AudioDriverManagerSW::get_driver(p_audio_driver)->set_singleton(); @@ -1257,7 +1253,7 @@ void OS_Windows::finalize() { main_loop=NULL; - memdelete(joystick); + memdelete(joypad); memdelete(input); visual_server->finish(); @@ -1300,10 +1296,6 @@ void OS_Windows::finalize_core() { memdelete(process_map); - if (mempool_dynamic) - memdelete( mempool_dynamic ); - delete mempool_static; - TCPServerWinsock::cleanup(); StreamPeerWinsock::cleanup(); @@ -1329,10 +1321,18 @@ void OS_Windows::vprint(const char* p_format, va_list p_list, bool p_stderr) { MultiByteToWideChar(CP_UTF8,0,buf,len,wbuf,wlen); wbuf[wlen]=0; +// Recent MinGW and MSVC compilers seem to disagree on the case here +#ifdef __MINGW32__ + if (p_stderr) + fwprintf(stderr, L"%S", wbuf); + else + wprintf(L"%S", wbuf); +#else // MSVC if (p_stderr) - fwprintf(stderr,L"%s",wbuf); + fwprintf(stderr, L"%s", wbuf); else - wprintf(L"%s",wbuf); + wprintf(L"%s", wbuf); +#endif #ifdef STDOUT_FILE //vwfprintf(stdo,p_format,p_list); @@ -1729,6 +1729,10 @@ void OS_Windows::print_error(const char* p_function, const char* p_file, int p_l print("SCRIPT ERROR: %s: %s\n", p_function, err_details); print(" At: %s:%i\n", p_file, p_line); break; + case ERR_SHADER: + print("SHADER ERROR: %s: %s\n", p_function, err_details); + print(" At: %s:%i\n", p_file, p_line); + break; } } else { @@ -1744,6 +1748,7 @@ void OS_Windows::print_error(const char* p_function, const char* p_file, int p_l case ERR_ERROR: basecol = FOREGROUND_RED; break; case ERR_WARNING: basecol = FOREGROUND_RED | FOREGROUND_GREEN; break; case ERR_SCRIPT: basecol = FOREGROUND_RED | FOREGROUND_BLUE; break; + case ERR_SHADER: basecol = FOREGROUND_GREEN | FOREGROUND_BLUE; break; } basecol |= current_bg; @@ -1755,6 +1760,7 @@ void OS_Windows::print_error(const char* p_function, const char* p_file, int p_l case ERR_ERROR: print("ERROR: "); break; case ERR_WARNING: print("WARNING: "); break; case ERR_SCRIPT: print("SCRIPT ERROR: "); break; + case ERR_SHADER: print("SHADER ERROR: "); break; } SetConsoleTextAttribute(hCon, current_fg | current_bg | FOREGROUND_INTENSITY); @@ -1765,6 +1771,7 @@ void OS_Windows::print_error(const char* p_function, const char* p_file, int p_l case ERR_ERROR: print(" At: "); break; case ERR_WARNING: print(" At: "); break; case ERR_SCRIPT: print(" At: "); break; + case ERR_SHADER: print(" At: "); break; } SetConsoleTextAttribute(hCon, current_fg | current_bg); @@ -1777,6 +1784,7 @@ void OS_Windows::print_error(const char* p_function, const char* p_file, int p_l case ERR_ERROR: print("ERROR: %s: ", p_function); break; case ERR_WARNING: print("WARNING: %s: ", p_function); break; case ERR_SCRIPT: print("SCRIPT ERROR: %s: ", p_function); break; + case ERR_SHADER: print("SCRIPT ERROR: %s: ", p_function); break; } SetConsoleTextAttribute(hCon, current_fg | current_bg | FOREGROUND_INTENSITY); @@ -1787,6 +1795,7 @@ void OS_Windows::print_error(const char* p_function, const char* p_file, int p_l case ERR_ERROR: print(" At: "); break; case ERR_WARNING: print(" At: "); break; case ERR_SCRIPT: print(" At: "); break; + case ERR_SHADER: print(" At: "); break; } SetConsoleTextAttribute(hCon, current_fg | current_bg); @@ -1919,7 +1928,7 @@ void OS_Windows::process_events() { MSG msg; - last_id = joystick->process_joysticks(last_id); + last_id = joypad->process_joypads(last_id); while(PeekMessageW(&msg,NULL,0,0,PM_REMOVE)) { @@ -2083,8 +2092,8 @@ void OS_Windows::set_icon(const Image& p_icon) { Image icon=p_icon; - if (icon.get_format()!=Image::FORMAT_RGBA) - icon.convert(Image::FORMAT_RGBA); + if (icon.get_format()!=Image::FORMAT_RGBA8) + icon.convert(Image::FORMAT_RGBA8); int w = icon.get_width(); int h = icon.get_height(); @@ -2107,7 +2116,7 @@ void OS_Windows::set_icon(const Image& p_icon) { encode_uint32(0,&icon_bmp[36]); uint8_t *wr=&icon_bmp[40]; - DVector<uint8_t>::Read r= icon.get_data().read(); + PoolVector<uint8_t>::Read r= icon.get_data().read(); for(int i=0;i<h;i++) { @@ -2361,7 +2370,7 @@ String OS_Windows::get_data_dir() const { if (has_environment("APPDATA")) { - bool use_godot = Globals::get_singleton()->get("application/use_shared_user_dir"); + bool use_godot = GlobalConfig::get_singleton()->get("application/use_shared_user_dir"); if (!use_godot) return (OS::get_singleton()->get_environment("APPDATA")+"/"+an).replace("\\","/"); else @@ -2369,7 +2378,7 @@ String OS_Windows::get_data_dir() const { } } - return Globals::get_singleton()->get_resource_path(); + return GlobalConfig::get_singleton()->get_resource_path(); } diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index 11fa094b88..7ca89e6366 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -29,8 +29,6 @@ #ifndef OS_WINDOWS_H #define OS_WINDOWS_H -#define WINVER 0x0600 - #include "os/input.h" #include "os/os.h" #include "context_gl_win.h" @@ -63,7 +61,7 @@ /** @author Juan Linietsky <reduzio@gmail.com> */ -class joystick_windows; +class JoypadWindows; class OS_Windows : public OS { enum { @@ -95,7 +93,7 @@ class OS_Windows : public OS { int old_x,old_y; Point2i center; unsigned int last_id; -#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) || defined(GLES2_ENABLED) +#if defined(OPENGL_ENABLED) ContextGL_Win *gl_context; #endif VisualServer *visual_server; @@ -135,7 +133,7 @@ class OS_Windows : public OS { CursorShape cursor_shape; InputDefault *input; - joystick_windows *joystick; + JoypadWindows *joypad; #ifdef RTAUDIO_ENABLED AudioDriverRtAudio driver_rtaudio; diff --git a/platform/windows/packet_peer_udp_winsock.cpp b/platform/windows/packet_peer_udp_winsock.cpp index 73c6116aa3..ef497c428d 100644 --- a/platform/windows/packet_peer_udp_winsock.cpp +++ b/platform/windows/packet_peer_udp_winsock.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -53,12 +53,14 @@ Error PacketPeerUDPWinsock::get_packet(const uint8_t **r_buffer,int &r_buffer_si uint32_t size; uint8_t type; rb.read(&type, 1, true); - if (type == IP_Address::TYPE_IPV4) { - rb.read((uint8_t*)&packet_ip.field8,4,true); - packet_ip.type = IP_Address::TYPE_IPV4; + if (type == IP::TYPE_IPV4) { + uint8_t ip[4]; + rb.read(ip,4,true); + packet_ip.set_ipv4(ip); } else { - rb.read((uint8_t*)&packet_ip.field8,16,true); - packet_ip.type = IP_Address::TYPE_IPV6; + uint8_t ip[16]; + rb.read(ip,16,true); + packet_ip.set_ipv6(ip); }; rb.read((uint8_t*)&packet_port,4,true); rb.read((uint8_t*)&size,4,true); @@ -71,10 +73,10 @@ Error PacketPeerUDPWinsock::get_packet(const uint8_t **r_buffer,int &r_buffer_si } Error PacketPeerUDPWinsock::put_packet(const uint8_t *p_buffer,int p_buffer_size){ - int sock = _get_socket(peer_addr.type); + int sock = _get_socket(); ERR_FAIL_COND_V( sock == -1, FAILED ); struct sockaddr_storage addr; - size_t addr_size = _set_sockaddr(&addr, peer_addr, peer_port); + size_t addr_size = _set_sockaddr(&addr, peer_addr, peer_port, ip_type); _set_blocking(true); @@ -112,23 +114,15 @@ void PacketPeerUDPWinsock::_set_blocking(bool p_blocking) { }; } -Error PacketPeerUDPWinsock::listen(int p_port, IP_Address::AddrType p_type, int p_recv_buffer_size) { +Error PacketPeerUDPWinsock::listen(int p_port, int p_recv_buffer_size) { close(); - int sock = _get_socket(p_type); + int sock = _get_socket(); if (sock == -1 ) return ERR_CANT_CREATE; - if(p_type == IP_Address::TYPE_IPV6) { - // Use IPv6 only socket - int yes = 1; - if(setsockopt(sockfd, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&yes, sizeof(yes)) != 0) { - WARN_PRINT("Unable to unset IPv4 address mapping over IPv6"); - } - } - struct sockaddr_storage addr = {0}; - size_t addr_size = _set_listen_sockaddr(&addr, p_port, p_type, NULL); + size_t addr_size = _set_listen_sockaddr(&addr, p_port, ip_type, NULL); if (bind(sock, (struct sockaddr*)&addr, addr_size) == -1 ) { close(); @@ -170,7 +164,7 @@ Error PacketPeerUDPWinsock::_poll(bool p_wait) { uint32_t port = 0; if (from.ss_family == AF_INET) { - uint8_t type = (uint8_t)IP_Address::TYPE_IPV4; + uint8_t type = (uint8_t)IP::TYPE_IPV4; rb.write(&type, 1); struct sockaddr_in* sin_from = (struct sockaddr_in*)&from; rb.write((uint8_t*)&sin_from->sin_addr, 4); @@ -178,7 +172,7 @@ Error PacketPeerUDPWinsock::_poll(bool p_wait) { } else if (from.ss_family == AF_INET6) { - uint8_t type = (uint8_t)IP_Address::TYPE_IPV6; + uint8_t type = (uint8_t)IP::TYPE_IPV6; rb.write(&type, 1); struct sockaddr_in6* s6_from = (struct sockaddr_in6*)&from; @@ -188,7 +182,7 @@ Error PacketPeerUDPWinsock::_poll(bool p_wait) { } else { // WARN_PRINT("Ignoring packet with unknown address family"); - uint8_t type = (uint8_t)IP_Address::TYPE_NONE; + uint8_t type = (uint8_t)IP::TYPE_NONE; rb.write(&type, 1); }; @@ -242,12 +236,12 @@ int PacketPeerUDPWinsock::get_packet_port() const{ return packet_port; } -int PacketPeerUDPWinsock::_get_socket(IP_Address::AddrType p_type) { +int PacketPeerUDPWinsock::_get_socket() { if (sockfd != -1) return sockfd; - sockfd = _socket_create(p_type, SOCK_DGRAM, IPPROTO_UDP); + sockfd = _socket_create(ip_type, SOCK_DGRAM, IPPROTO_UDP); return sockfd; } @@ -277,6 +271,7 @@ PacketPeerUDPWinsock::PacketPeerUDPWinsock() { packet_port=0; queue_count=0; peer_port=0; + ip_type = IP::TYPE_ANY; } PacketPeerUDPWinsock::~PacketPeerUDPWinsock() { diff --git a/platform/windows/packet_peer_udp_winsock.h b/platform/windows/packet_peer_udp_winsock.h index 9837ef6621..2199115889 100644 --- a/platform/windows/packet_peer_udp_winsock.h +++ b/platform/windows/packet_peer_udp_winsock.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -50,7 +50,7 @@ class PacketPeerUDPWinsock : public PacketPeerUDP { IP_Address peer_addr; int peer_port; - _FORCE_INLINE_ int _get_socket(IP_Address::AddrType p_type); + _FORCE_INLINE_ int _get_socket(); static PacketPeerUDP* _create(); @@ -67,7 +67,7 @@ public: virtual int get_max_packet_size() const; - virtual Error listen(int p_port, IP_Address::AddrType p_address_type, int p_recv_buffer_size=65536); + virtual Error listen(int p_port, int p_recv_buffer_size=65536); virtual void close(); virtual Error wait(); virtual bool is_listening() const; diff --git a/platform/windows/platform_config.h b/platform/windows/platform_config.h index 31512a1054..0e16753156 100644 --- a/platform/windows/platform_config.h +++ b/platform/windows/platform_config.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -30,4 +30,4 @@ //#else //#include <alloca.h> //#endif -#define GLES2_INCLUDE_H "GL/glew.h" +#define GLES3_INCLUDE_H "glad/glad.h" diff --git a/platform/windows/stream_peer_winsock.cpp b/platform/windows/stream_peer_winsock.cpp index 44c17c73e5..a48a02c7a7 100644 --- a/platform/windows/stream_peer_winsock.cpp +++ b/platform/windows/stream_peer_winsock.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -88,7 +88,7 @@ Error StreamPeerWinsock::_poll_connection(bool p_block) const { }; struct sockaddr_storage their_addr; - size_t addr_size = _set_sockaddr(&their_addr, peer_host, peer_port); + size_t addr_size = _set_sockaddr(&their_addr, peer_host, peer_port, ip_type); if (::connect(sockfd, (struct sockaddr *)&their_addr,addr_size) == SOCKET_ERROR) { @@ -98,7 +98,12 @@ Error StreamPeerWinsock::_poll_connection(bool p_block) const { return OK; }; - return OK; + if (errno == WSAEINPROGRESS || errno == WSAEALREADY) { + return OK; + } + + status = STATUS_ERROR; + return ERR_CONNECTION_ERROR; } else { status = STATUS_CONNECTED; @@ -284,8 +289,9 @@ void StreamPeerWinsock::disconnect() { peer_port = 0; }; -void StreamPeerWinsock::set_socket(int p_sockfd, IP_Address p_host, int p_port) { +void StreamPeerWinsock::set_socket(int p_sockfd, IP_Address p_host, int p_port, IP::Type p_ip_type) { + ip_type = p_ip_type; sockfd = p_sockfd; status = STATUS_CONNECTING; peer_host = p_host; @@ -294,9 +300,9 @@ void StreamPeerWinsock::set_socket(int p_sockfd, IP_Address p_host, int p_port) Error StreamPeerWinsock::connect(const IP_Address& p_host, uint16_t p_port) { - ERR_FAIL_COND_V( p_host.type == IP_Address::TYPE_NONE, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V( p_host == IP_Address(), ERR_INVALID_PARAMETER); - sockfd = _socket_create(p_host.type, SOCK_STREAM, IPPROTO_TCP); + sockfd = _socket_create(ip_type, SOCK_STREAM, IPPROTO_TCP); if (sockfd == INVALID_SOCKET) { ERR_PRINT("Socket creation failed!"); disconnect(); @@ -312,7 +318,7 @@ Error StreamPeerWinsock::connect(const IP_Address& p_host, uint16_t p_port) { }; struct sockaddr_storage their_addr; - size_t addr_size = _set_sockaddr(&their_addr, p_host, p_port); + size_t addr_size = _set_sockaddr(&their_addr, p_host, p_port, ip_type); if (::connect(sockfd, (struct sockaddr *)&their_addr,addr_size) == SOCKET_ERROR) { @@ -362,6 +368,7 @@ StreamPeerWinsock::StreamPeerWinsock() { sockfd = INVALID_SOCKET; status = STATUS_NONE; peer_port = 0; + ip_type = IP::TYPE_ANY; }; StreamPeerWinsock::~StreamPeerWinsock() { diff --git a/platform/windows/stream_peer_winsock.h b/platform/windows/stream_peer_winsock.h index bbff661490..e17a7167e1 100644 --- a/platform/windows/stream_peer_winsock.h +++ b/platform/windows/stream_peer_winsock.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -68,7 +68,7 @@ public: virtual int get_available_bytes() const; - void set_socket(int p_sockfd, IP_Address p_host, int p_port); + void set_socket(int p_sockfd, IP_Address p_host, int p_port, IP::Type p_ip_type); virtual IP_Address get_connected_host() const; virtual uint16_t get_connected_port() const; diff --git a/platform/windows/tcp_server_winsock.cpp b/platform/windows/tcp_server_winsock.cpp index 38a6b04100..1c3682adfa 100644 --- a/platform/windows/tcp_server_winsock.cpp +++ b/platform/windows/tcp_server_winsock.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -63,20 +63,12 @@ void TCPServerWinsock::cleanup() { }; -Error TCPServerWinsock::listen(uint16_t p_port, IP_Address::AddrType p_type,const List<String> *p_accepted_hosts) { +Error TCPServerWinsock::listen(uint16_t p_port,const List<String> *p_accepted_hosts) { int sockfd; - sockfd = _socket_create(p_type, SOCK_STREAM, IPPROTO_TCP); + sockfd = _socket_create(ip_type, SOCK_STREAM, IPPROTO_TCP); ERR_FAIL_COND_V(sockfd == INVALID_SOCKET, FAILED); - if(p_type == IP_Address::TYPE_IPV6) { - // Use IPv6 only socket - int yes = 1; - if(setsockopt(sockfd, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&yes, sizeof(yes)) != 0) { - WARN_PRINT("Unable to unset IPv4 address mapping over IPv6"); - } - } - unsigned long par = 1; if (ioctlsocket(sockfd, FIONBIO, &par)) { perror("setting non-block mode"); @@ -85,7 +77,7 @@ Error TCPServerWinsock::listen(uint16_t p_port, IP_Address::AddrType p_type,cons }; struct sockaddr_storage my_addr; - size_t addr_size = _set_listen_sockaddr(&my_addr, p_port, p_type, p_accepted_hosts); + size_t addr_size = _set_listen_sockaddr(&my_addr, p_port, ip_type, p_accepted_hosts); int reuse=1; if(setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, (char *)&reuse, sizeof(reuse)) < 0) { @@ -158,7 +150,7 @@ Ref<StreamPeerTCP> TCPServerWinsock::take_connection() { int port; _set_ip_addr_port(ip, port, &their_addr); - conn->set_socket(fd, ip, port); + conn->set_socket(fd, ip, port, ip_type); return conn; }; @@ -176,6 +168,7 @@ void TCPServerWinsock::stop() { TCPServerWinsock::TCPServerWinsock() { listen_sockfd = INVALID_SOCKET; + ip_type = IP::TYPE_ANY; }; TCPServerWinsock::~TCPServerWinsock() { diff --git a/platform/windows/tcp_server_winsock.h b/platform/windows/tcp_server_winsock.h index 115fdb4234..5c544436a7 100644 --- a/platform/windows/tcp_server_winsock.h +++ b/platform/windows/tcp_server_winsock.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,7 +39,7 @@ class TCPServerWinsock : public TCP_Server { public: - virtual Error listen(uint16_t p_port, IP_Address::AddrType p_type,const List<String> *p_accepted_hosts=NULL); + virtual Error listen(uint16_t p_port,const List<String> *p_accepted_hosts=NULL); virtual bool is_connection_available() const; virtual Ref<StreamPeerTCP> take_connection(); diff --git a/platform/x11/SCsub b/platform/x11/SCsub index 0defd4f025..4ae8ac07f7 100644 --- a/platform/x11/SCsub +++ b/platform/x11/SCsub @@ -7,7 +7,7 @@ common_x11 = [\ "context_gl_x11.cpp",\ "os_x11.cpp",\ "key_mapping_x11.cpp",\ - "joystick_linux.cpp",\ + "joypad_linux.cpp",\ ] env.Program('#bin/godot', ['godot_x11.cpp'] + common_x11) diff --git a/platform/x11/context_gl_x11.cpp b/platform/x11/context_gl_x11.cpp index cd325dfc99..4adb47938c 100644 --- a/platform/x11/context_gl_x11.cpp +++ b/platform/x11/context_gl_x11.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -76,6 +76,13 @@ static GLWrapperFuncPtr wrapper_get_proc_address(const char* p_function) { }*/ +static bool ctxErrorOccurred = false; +static int ctxErrorHandler( Display *dpy, XErrorEvent *ev ) +{ + ctxErrorOccurred = true; + return 0; +} + Error ContextGL_X11::initialize() { @@ -133,20 +140,31 @@ Error ContextGL_X11::initialize() { //}; + int (*oldHandler)(Display*, XErrorEvent*) = + XSetErrorHandler(&ctxErrorHandler); + + if (!opengl_3_context) { //oldstyle context: p->glx_context = glXCreateContext(x11_display, vi, 0, GL_TRUE); } else { static int context_attribs[] = { GLX_CONTEXT_MAJOR_VERSION_ARB, 3, - GLX_CONTEXT_MINOR_VERSION_ARB, 0, + GLX_CONTEXT_MINOR_VERSION_ARB, 3, + GLX_CONTEXT_FLAGS_ARB , GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB/*|GLX_CONTEXT_DEBUG_BIT_ARB*/, None }; p->glx_context = glXCreateContextAttribsARB(x11_display, fbc[0], NULL, true, context_attribs); - ERR_FAIL_COND_V(!p->glx_context,ERR_UNCONFIGURED); + ERR_EXPLAIN("Could not obtain an OpenGL 3.3 context!"); + ERR_FAIL_COND_V(ctxErrorOccurred || !p->glx_context,ERR_UNCONFIGURED); } + XSync( x11_display, False ); + XSetErrorHandler( oldHandler ); + + print_line("ALL IS GOOD"); + glXMakeCurrent(x11_display, x11_window, p->glx_context); /* diff --git a/platform/x11/context_gl_x11.h b/platform/x11/context_gl_x11.h index 4474542c0b..efe377ad92 100644 --- a/platform/x11/context_gl_x11.h +++ b/platform/x11/context_gl_x11.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/x11/detect.py b/platform/x11/detect.py index d8cd79297e..b5f6359d21 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -139,8 +139,14 @@ def configure(env): if (env['builtin_libwebp'] == 'no'): env.ParseConfig('pkg-config libwebp --cflags --libs') + # freetype depends on libpng and zlib, so bundling one of them while keeping others + # as shared libraries leads to weird issues + if (env['builtin_freetype'] == 'yes' or env['builtin_libpng'] == 'yes' or env['builtin_zlib'] == 'yes'): + env['builtin_freetype'] = 'yes' + env['builtin_libpng'] = 'yes' + env['builtin_zlib'] = 'yes' + if (env['builtin_freetype'] == 'no'): - env['builtin_libpng'] = 'no' # Freetype links against libpng env.ParseConfig('pkg-config freetype2 --cflags --libs') if (env['builtin_libpng'] == 'no'): @@ -176,9 +182,6 @@ def configure(env): env.Append(CPPFLAGS=['-DOPENGL_ENABLED']) - if (env['builtin_glew'] == 'no'): - env.ParseConfig('pkg-config glew --cflags --libs') - if os.system("pkg-config --exists alsa") == 0: print("Enabling ALSA") env.Append(CPPFLAGS=["-DALSA_ENABLED"]) @@ -207,10 +210,14 @@ def configure(env): else: print("PulseAudio development libraries not found, disabling driver") + if (env['builtin_zlib'] == 'no'): + env.ParseConfig('pkg-config zlib --cflags --libs') + env.Append(CPPFLAGS=['-DX11_ENABLED', '-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DGLES_OVER_GL']) - env.Append(LIBS=['GL', 'pthread', 'z']) + env.Append(LIBS=['GL', 'pthread']) + if (platform.system() == "Linux"): - env.Append(LIBS='dl') + env.Append(LIBS=['dl']) # env.Append(CPPFLAGS=['-DMPC_FIXED_POINT']) # host compiler is default.. @@ -224,9 +231,10 @@ def configure(env): import methods - env.Append(BUILDERS={'GLSL120': env.Builder(action=methods.build_legacygl_headers, suffix='glsl.h', src_suffix='.glsl')}) - env.Append(BUILDERS={'GLSL': env.Builder(action=methods.build_glsl_headers, suffix='glsl.h', src_suffix='.glsl')}) - env.Append(BUILDERS={'GLSL120GLES': env.Builder(action=methods.build_gles2_headers, suffix='glsl.h', src_suffix='.glsl')}) + # FIXME: Commented out when moving to gles3 + #env.Append(BUILDERS={'GLSL120': env.Builder(action=methods.build_legacygl_headers, suffix='glsl.h', src_suffix='.glsl')}) + #env.Append(BUILDERS={'GLSL': env.Builder(action=methods.build_glsl_headers, suffix='glsl.h', src_suffix='.glsl')}) + #env.Append(BUILDERS={'GLSL120GLES': env.Builder(action=methods.build_gles2_headers, suffix='glsl.h', src_suffix='.glsl')}) #env.Append( BUILDERS = { 'HLSL9' : env.Builder(action = methods.build_hlsl_dx9_headers, suffix = 'hlsl.h',src_suffix = '.hlsl') } ) if (env["use_static_cpp"] == "yes"): diff --git a/platform/x11/export/export.cpp b/platform/x11/export/export.cpp index c6675ace72..c1af323453 100644 --- a/platform/x11/export/export.cpp +++ b/platform/x11/export/export.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/x11/export/export.h b/platform/x11/export/export.h index 9dc13d7459..5beaba2cfb 100644 --- a/platform/x11/export/export.h +++ b/platform/x11/export/export.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/x11/godot_x11.cpp b/platform/x11/godot_x11.cpp index c500f939c4..f85ba17020 100644 --- a/platform/x11/godot_x11.cpp +++ b/platform/x11/godot_x11.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/x11/joystick_linux.cpp b/platform/x11/joypad_linux.cpp index 3b854a8d46..362999661e 100644 --- a/platform/x11/joystick_linux.cpp +++ b/platform/x11/joypad_linux.cpp @@ -1,11 +1,11 @@ /*************************************************************************/ -/* joystick_linux.cpp */ +/* joypad_linux.cpp */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -27,10 +27,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ -//author: Andreas Haas <hondres, liugam3@gmail.com> #ifdef JOYDEV_ENABLED -#include "joystick_linux.h" +#include "joypad_linux.h" #include <linux/input.h> #include <unistd.h> @@ -49,7 +48,7 @@ static const char* ignore_str = "/dev/input/js"; #endif -joystick_linux::Joystick::Joystick() { +JoypadLinux::Joypad::Joypad() { fd = -1; dpad = 0; devpath = ""; @@ -58,7 +57,7 @@ joystick_linux::Joystick::Joystick() { } } -joystick_linux::Joystick::~Joystick() { +JoypadLinux::Joypad::~Joypad() { for (int i = 0; i < MAX_ABS; i++) { if (abs_info[i]) { @@ -67,7 +66,7 @@ joystick_linux::Joystick::~Joystick() { } } -void joystick_linux::Joystick::reset() { +void JoypadLinux::Joypad::reset() { dpad = 0; fd = -1; @@ -80,7 +79,7 @@ void joystick_linux::Joystick::reset() { } } -joystick_linux::joystick_linux(InputDefault *in) +JoypadLinux::JoypadLinux(InputDefault *in) { exit_udev = false; input = in; @@ -88,37 +87,37 @@ joystick_linux::joystick_linux(InputDefault *in) joy_thread = Thread::create(joy_thread_func, this); } -joystick_linux::~joystick_linux() { +JoypadLinux::~JoypadLinux() { exit_udev = true; Thread::wait_to_finish(joy_thread); memdelete(joy_thread); memdelete(joy_mutex); - close_joystick(); + close_joypad(); } -void joystick_linux::joy_thread_func(void *p_user) { +void JoypadLinux::joy_thread_func(void *p_user) { if (p_user) { - joystick_linux* joy = (joystick_linux*) p_user; - joy->run_joystick_thread(); + JoypadLinux* joy = (JoypadLinux*) p_user; + joy->run_joypad_thread(); } return; } -void joystick_linux::run_joystick_thread() { +void JoypadLinux::run_joypad_thread() { #ifdef UDEV_ENABLED udev *_udev = udev_new(); ERR_FAIL_COND(!_udev); - enumerate_joysticks(_udev); - monitor_joysticks(_udev); + enumerate_joypads(_udev); + monitor_joypads(_udev); udev_unref(_udev); #else - monitor_joysticks(); + monitor_joypads(); #endif } #ifdef UDEV_ENABLED -void joystick_linux::enumerate_joysticks(udev *p_udev) { +void JoypadLinux::enumerate_joypads(udev *p_udev) { udev_enumerate *enumerate; udev_list_entry *devices, *dev_list_entry; @@ -126,7 +125,7 @@ void joystick_linux::enumerate_joysticks(udev *p_udev) { enumerate = udev_enumerate_new(p_udev); udev_enumerate_add_match_subsystem(enumerate,"input"); - udev_enumerate_add_match_property(enumerate, "ID_INPUT_JOYSTICK", "1"); + udev_enumerate_add_match_property(enumerate, "ID_INPUT_JOYPAD", "1"); udev_enumerate_scan_devices(enumerate); devices = udev_enumerate_get_list_entry(enumerate); @@ -141,7 +140,7 @@ void joystick_linux::enumerate_joysticks(udev *p_udev) { String devnode_str = devnode; if (devnode_str.find(ignore_str) == -1) { joy_mutex->lock(); - open_joystick(devnode); + open_joypad(devnode); joy_mutex->unlock(); } } @@ -150,7 +149,7 @@ void joystick_linux::enumerate_joysticks(udev *p_udev) { udev_enumerate_unref(enumerate); } -void joystick_linux::monitor_joysticks(udev *p_udev) { +void JoypadLinux::monitor_joypads(udev *p_udev) { udev_device *dev = NULL; udev_monitor *mon = udev_monitor_new_from_netlink(p_udev, "udev"); @@ -188,9 +187,9 @@ void joystick_linux::monitor_joysticks(udev *p_udev) { if (devnode_str.find(ignore_str) == -1) { if (action == "add") - open_joystick(devnode); + open_joypad(devnode); else if (String(action) == "remove") - close_joystick(get_joy_from_path(devnode)); + close_joypad(get_joy_from_path(devnode)); } } @@ -204,7 +203,7 @@ void joystick_linux::monitor_joysticks(udev *p_udev) { } #endif -void joystick_linux::monitor_joysticks() { +void JoypadLinux::monitor_joypads() { while (!exit_udev) { joy_mutex->lock(); @@ -212,7 +211,7 @@ void joystick_linux::monitor_joysticks() { char fname[64]; sprintf(fname, "/dev/input/event%d", i); if (attached_devices.find(fname) == -1) { - open_joystick(fname); + open_joypad(fname); } } joy_mutex->unlock(); @@ -220,37 +219,37 @@ void joystick_linux::monitor_joysticks() { } } -int joystick_linux::get_free_joy_slot() const { +int JoypadLinux::get_free_joy_slot() const { - for (int i = 0; i < JOYSTICKS_MAX; i++) { + for (int i = 0; i < JOYPADS_MAX; i++) { - if (joysticks[i].fd == -1) return i; + if (joypads[i].fd == -1) return i; } return -1; } -int joystick_linux::get_joy_from_path(String p_path) const { +int JoypadLinux::get_joy_from_path(String p_path) const { - for (int i = 0; i < JOYSTICKS_MAX; i++) { + for (int i = 0; i < JOYPADS_MAX; i++) { - if (joysticks[i].devpath == p_path) { + if (joypads[i].devpath == p_path) { return i; } } return -2; } -void joystick_linux::close_joystick(int p_id) { +void JoypadLinux::close_joypad(int p_id) { if (p_id == -1) { - for (int i=0; i<JOYSTICKS_MAX; i++) { + for (int i=0; i<JOYPADS_MAX; i++) { - close_joystick(i); + close_joypad(i); }; return; } else if (p_id < 0) return; - Joystick &joy = joysticks[p_id]; + Joypad &joy = joypads[p_id]; if (joy.fd != -1) { @@ -273,9 +272,9 @@ static String _hex_str(uint8_t p_byte) { return ret; } -void joystick_linux::setup_joystick_properties(int p_id) { +void JoypadLinux::setup_joypad_properties(int p_id) { - Joystick* joy = &joysticks[p_id]; + Joypad* joy = &joypads[p_id]; unsigned long keybit[NBITS(KEY_MAX)] = { 0 }; unsigned long absbit[NBITS(ABS_MAX)] = { 0 }; @@ -328,7 +327,7 @@ void joystick_linux::setup_joystick_properties(int p_id) { } } -void joystick_linux::open_joystick(const char *p_path) { +void JoypadLinux::open_joypad(const char *p_path) { int joy_num = get_free_joy_slot(); int fd = open(p_path, O_RDWR | O_NONBLOCK); @@ -349,7 +348,7 @@ void joystick_linux::open_joystick(const char *p_path) { } //check if the device supports basic gamepad events, prevents certain keyboards from - //being detected as joysticks + //being detected as joypads if (!(test_bit(EV_KEY, evbit) && test_bit(EV_ABS, evbit) && (test_bit(ABS_X, absbit) || test_bit(ABS_Y, absbit) || test_bit(ABS_HAT0X, absbit) || test_bit(ABS_GAS, absbit) || test_bit(ABS_RUDDER, absbit)) && @@ -372,12 +371,12 @@ void joystick_linux::open_joystick(const char *p_path) { return; } - joysticks[joy_num].reset(); + joypads[joy_num].reset(); - Joystick &joy = joysticks[joy_num]; + Joypad &joy = joypads[joy_num]; joy.fd = fd; joy.devpath = String(p_path); - setup_joystick_properties(joy_num); + setup_joypad_properties(joy_num); sprintf(uid, "%04x%04x", __bswap_16(inpid.bustype), 0); if (inpid.vendor && inpid.product && inpid.version) { @@ -401,14 +400,14 @@ void joystick_linux::open_joystick(const char *p_path) { } } -void joystick_linux::joystick_vibration_start(int p_id, float p_weak_magnitude, float p_strong_magnitude, float p_duration, uint64_t p_timestamp) +void JoypadLinux::joypad_vibration_start(int p_id, float p_weak_magnitude, float p_strong_magnitude, float p_duration, uint64_t p_timestamp) { - Joystick& joy = joysticks[p_id]; + Joypad& joy = joypads[p_id]; if (!joy.force_feedback || joy.fd == -1 || p_weak_magnitude < 0.f || p_weak_magnitude > 1.f || p_strong_magnitude < 0.f || p_strong_magnitude > 1.f) { return; } if (joy.ff_effect_id != -1) { - joystick_vibration_stop(p_id, p_timestamp); + joypad_vibration_stop(p_id, p_timestamp); } struct ff_effect effect; @@ -433,9 +432,9 @@ void joystick_linux::joystick_vibration_start(int p_id, float p_weak_magnitude, joy.ff_effect_timestamp = p_timestamp; } -void joystick_linux::joystick_vibration_stop(int p_id, uint64_t p_timestamp) +void JoypadLinux::joypad_vibration_stop(int p_id, uint64_t p_timestamp) { - Joystick& joy = joysticks[p_id]; + Joypad& joy = joypads[p_id]; if (!joy.force_feedback || joy.fd == -1 || joy.ff_effect_id == -1) { return; } @@ -448,7 +447,7 @@ void joystick_linux::joystick_vibration_stop(int p_id, uint64_t p_timestamp) joy.ff_effect_timestamp = p_timestamp; } -InputDefault::JoyAxis joystick_linux::axis_correct(const input_absinfo *p_abs, int p_value) const { +InputDefault::JoyAxis JoypadLinux::axis_correct(const input_absinfo *p_abs, int p_value) const { int min = p_abs->minimum; int max = p_abs->maximum; @@ -468,17 +467,17 @@ InputDefault::JoyAxis joystick_linux::axis_correct(const input_absinfo *p_abs, i return jx; } -uint32_t joystick_linux::process_joysticks(uint32_t p_event_id) { +uint32_t JoypadLinux::process_joypads(uint32_t p_event_id) { if (joy_mutex->try_lock() != OK) { return p_event_id; } - for (int i=0; i<JOYSTICKS_MAX; i++) { + for (int i=0; i<JOYPADS_MAX; i++) { - if (joysticks[i].fd == -1) continue; + if (joypads[i].fd == -1) continue; input_event events[32]; - Joystick* joy = &joysticks[i]; + Joypad* joy = &joypads[i]; int len; @@ -539,7 +538,7 @@ uint32_t joystick_linux::process_joysticks(uint32_t p_event_id) { } } if (len == 0 || (len < 0 && errno != EAGAIN)) { - close_joystick(i); + close_joypad(i); }; if (joy->force_feedback) { @@ -548,9 +547,9 @@ uint32_t joystick_linux::process_joysticks(uint32_t p_event_id) { Vector2 strength = input->get_joy_vibration_strength(i); float duration = input->get_joy_vibration_duration(i); if (strength.x == 0 && strength.y == 0) { - joystick_vibration_stop(i, timestamp); + joypad_vibration_stop(i, timestamp); } else { - joystick_vibration_start(i, strength.x, strength.y, duration, timestamp); + joypad_vibration_start(i, strength.x, strength.y, duration, timestamp); } } } diff --git a/platform/x11/joystick_linux.h b/platform/x11/joypad_linux.h index 7ea2664ebb..18ad199f6b 100644 --- a/platform/x11/joystick_linux.h +++ b/platform/x11/joypad_linux.h @@ -1,11 +1,11 @@ /*************************************************************************/ -/* joystick_linux.h */ +/* joypad_linux.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -28,8 +28,9 @@ /*************************************************************************/ //author: Andreas Haas <hondres, liugam3@gmail.com> -#ifndef JOYSTICK_LINUX_H -#define JOYSTICK_LINUX_H +#ifndef JOYPAD_LINUX_H +#define JOYPAD_LINUX_H + #ifdef JOYDEV_ENABLED #include "main/input_default.h" #include "os/thread.h" @@ -37,21 +38,21 @@ struct input_absinfo; -class joystick_linux +class JoypadLinux { public: - joystick_linux(InputDefault *in); - ~joystick_linux(); - uint32_t process_joysticks(uint32_t p_event_id); + JoypadLinux(InputDefault *in); + ~JoypadLinux(); + uint32_t process_joypads(uint32_t p_event_id); private: enum { - JOYSTICKS_MAX = 16, + JOYPADS_MAX = 16, MAX_ABS = 63, MAX_KEY = 767, // Hack because <linux/input.h> can't be included here }; - struct Joystick { + struct Joypad { InputDefault::JoyAxis curr_axis[MAX_ABS]; int key_map[MAX_KEY]; int abs_map[MAX_ABS]; @@ -65,8 +66,8 @@ private: int ff_effect_id; uint64_t ff_effect_timestamp; - Joystick(); - ~Joystick(); + Joypad(); + ~Joypad(); void reset(); }; @@ -74,7 +75,7 @@ private: Mutex *joy_mutex; Thread *joy_thread; InputDefault *input; - Joystick joysticks[JOYSTICKS_MAX]; + Joypad joypads[JOYPADS_MAX]; Vector<String> attached_devices; static void joy_thread_func(void *p_user); @@ -82,21 +83,21 @@ private: int get_joy_from_path(String path) const; int get_free_joy_slot() const; - void setup_joystick_properties(int p_id); - void close_joystick(int p_id = -1); + void setup_joypad_properties(int p_id); + void close_joypad(int p_id = -1); #ifdef UDEV_ENABLED - void enumerate_joysticks(struct udev *_udev); - void monitor_joysticks(struct udev *_udev); + void enumerate_joypads(struct udev *_udev); + void monitor_joypads(struct udev *_udev); #endif - void monitor_joysticks(); - void run_joystick_thread(); - void open_joystick(const char* path); + void monitor_joypads(); + void run_joypad_thread(); + void open_joypad(const char* path); - void joystick_vibration_start(int p_id, float p_weak_magnitude, float p_strong_magnitude, float p_duration, uint64_t p_timestamp); - void joystick_vibration_stop(int p_id, uint64_t p_timestamp); + void joypad_vibration_start(int p_id, float p_weak_magnitude, float p_strong_magnitude, float p_duration, uint64_t p_timestamp); + void joypad_vibration_stop(int p_id, uint64_t p_timestamp); InputDefault::JoyAxis axis_correct(const input_absinfo *abs, int value) const; }; #endif -#endif // JOYSTICK_LINUX_H +#endif // JOYPAD_LINUX_H diff --git a/platform/x11/key_mapping_x11.cpp b/platform/x11/key_mapping_x11.cpp index 6443d14897..7b92ed95de 100644 --- a/platform/x11/key_mapping_x11.cpp +++ b/platform/x11/key_mapping_x11.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/x11/key_mapping_x11.h b/platform/x11/key_mapping_x11.h index e3aede8388..9749b2ec2a 100644 --- a/platform/x11/key_mapping_x11.h +++ b/platform/x11/key_mapping_x11.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 0172dca4c4..9a4b19f2db 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -27,7 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "servers/visual/visual_server_raster.h" -#include "drivers/gles2/rasterizer_gles2.h" +#include "drivers/gles3/rasterizer_gles3.h" #include "os_x11.h" #include "key_mapping_x11.h" #include <stdio.h> @@ -74,7 +74,7 @@ int OS_X11::get_video_driver_count() const { } const char * OS_X11::get_video_driver_name(int p_driver) const { - return "GLES2"; + return "GLES3"; } OS::VideoMode OS_X11::get_default_video_mode() const { @@ -203,19 +203,22 @@ void OS_X11::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi //print_line("def videomode "+itos(current_videomode.width)+","+itos(current_videomode.height)); #if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) - context_gl = memnew( ContextGL_X11( x11_display, x11_window,current_videomode, false ) ); + + context_gl = memnew( ContextGL_X11( x11_display, x11_window,current_videomode, true ) ); context_gl->initialize(); - rasterizer = memnew( RasterizerGLES2 ); + RasterizerGLES3::register_config(); -#endif - visual_server = memnew( VisualServerRaster(rasterizer) ); + RasterizerGLES3::make_current(); +#endif + visual_server = memnew( VisualServerRaster ); +#if 0 if (get_render_thread_mode()!=RENDER_THREAD_UNSAFE) { visual_server =memnew(VisualServerWrapMT(visual_server,get_render_thread_mode()==RENDER_SEPARATE_THREAD)); } - +#endif // borderless fullscreen window mode if (current_videomode.fullscreen) { // needed for lxde/openbox, possibly others @@ -455,7 +458,7 @@ void OS_X11::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi input = memnew( InputDefault ); #ifdef JOYDEV_ENABLED - joystick = memnew( joystick_linux(input)); + joypad = memnew( JoypadLinux(input)); #endif _ensure_data_dir(); } @@ -476,7 +479,7 @@ void OS_X11::finalize() { //} #ifdef JOYDEV_ENABLED - memdelete(joystick); + memdelete(joypad); #endif memdelete(input); @@ -487,7 +490,7 @@ void OS_X11::finalize() { visual_server->finish(); memdelete(visual_server); - memdelete(rasterizer); + //memdelete(rasterizer); physics_server->finish(); memdelete(physics_server); @@ -1878,7 +1881,7 @@ void OS_X11::set_icon(const Image& p_icon) { if (!p_icon.empty()) { Image img=p_icon; - img.convert(Image::FORMAT_RGBA); + img.convert(Image::FORMAT_RGBA8); int w = img.get_width(); int h = img.get_height(); @@ -1891,7 +1894,7 @@ void OS_X11::set_icon(const Image& p_icon) { pd[0]=w; pd[1]=h; - DVector<uint8_t>::Read r = img.get_data().read(); + PoolVector<uint8_t>::Read r = img.get_data().read(); long * wr = &pd[2]; uint8_t const * pr = r.ptr(); @@ -1929,7 +1932,7 @@ void OS_X11::run() { process_xevents(); // get rid of pending events #ifdef JOYDEV_ENABLED - event_id = joystick->process_joysticks(event_id); + event_id = joypad->process_joypads(event_id); #endif if (Main::iteration()==true) break; @@ -1990,6 +1993,11 @@ OS_X11::OS_X11() { AudioDriverManagerSW::add_driver(&driver_alsa); #endif + if(AudioDriverManagerSW::get_driver_count() == 0){ + WARN_PRINT("No sound driver found... Defaulting to dummy driver"); + AudioDriverManagerSW::add_driver(&driver_dummy); + } + minimized = false; xim_style=0L; mouse_mode=MOUSE_MODE_VISIBLE; diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h index efa7e44afe..bf676b5edf 100644 --- a/platform/x11/os_x11.h +++ b/platform/x11/os_x11.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ #include "drivers/unix/os_unix.h" #include "context_gl_x11.h" #include "servers/visual_server.h" -#include "servers/visual/visual_server_wrap_mt.h" +//#include "servers/visual/visual_server_wrap_mt.h" #include "servers/visual/rasterizer.h" #include "servers/physics_server.h" #include "servers/audio/audio_server_sw.h" @@ -44,10 +44,11 @@ #include "drivers/rtaudio/audio_driver_rtaudio.h" #include "drivers/alsa/audio_driver_alsa.h" #include "drivers/pulseaudio/audio_driver_pulseaudio.h" +#include "servers/audio/audio_driver_dummy.h" #include "servers/physics_2d/physics_2d_server_sw.h" #include "servers/physics_2d/physics_2d_server_wrap_mt.h" #include "main/input_default.h" -#include "joystick_linux.h" +#include "joypad_linux.h" #include <X11/keysym.h> #include <X11/Xlib.h> @@ -99,7 +100,7 @@ class OS_X11 : public OS_Unix { #if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) ContextGL_X11 *context_gl; #endif - Rasterizer *rasterizer; + //Rasterizer *rasterizer; VisualServer *visual_server; VideoMode current_videomode; List<String> args; @@ -154,7 +155,7 @@ class OS_X11 : public OS_Unix { InputDefault *input; #ifdef JOYDEV_ENABLED - joystick_linux *joystick; + JoypadLinux *joypad; #endif #ifdef RTAUDIO_ENABLED @@ -168,6 +169,7 @@ class OS_X11 : public OS_Unix { #ifdef PULSEAUDIO_ENABLED AudioDriverPulseAudio driver_pulseaudio; #endif + AudioDriverDummy driver_dummy; Atom net_wm_icon; diff --git a/platform/x11/platform_config.h b/platform/x11/platform_config.h index 015953157d..342270b74a 100644 --- a/platform/x11/platform_config.h +++ b/platform/x11/platform_config.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,4 +34,4 @@ #define PTHREAD_BSD_SET_NAME #endif -#define GLES2_INCLUDE_H "GL/glew.h" +#define GLES3_INCLUDE_H "glad/glad.h" diff --git a/prop_renames.txt b/prop_renames.txt new file mode 100644 index 0000000000..9821a32b68 --- /dev/null +++ b/prop_renames.txt @@ -0,0 +1,524 @@ +[Object] +script/script = script + +[Node] +pause/pause_mode = pause_mode + +[Control] + +anchor/left = anchor_left +anchor/right = anchor_right +anchor/bottom = anchor_bottom +anchor/top = anchor_top + +focus_neighbour/left=focus_neighbour_left +focus_neighbour/right=focus_neighbour_right +focus_neighbour/bottom=focus_neighbour_bottom +focus_neighbour/top=focus_neighbour_top +focus/ignore_mouse = focus_ignore_mouse +focus/stop_mouse = focus_stop_mouse + +size_flags/horizontal = size_flags_horizontal +size_flags/vertical = size_flags_vertical +size_flags/stretch_ratio = size_flags_stretch_ratio +theme/theme = theme + +[CanvasItem] + +visibility/visible = visible +visibility/behind_parent = show_behind_parent +visibility/on_top = show_on_top +visibility/light_mask = light_mask +material/material = material +material/use_parent = use_parent_material + + +[Resource] + +resource/path = resource_path +resource/name = resource_name + + +[Area2D] + +collision/layers = collision_layers +collision/mask = collision_mask + +[Camera2D] + +limit/left = limit_left +limit/right = limit_right +limit/bottom = limit_bottom +limit/top = limit_top +limit/smoothed = limit_smoothed + +draw_margin/h_enabled = draw_margin_h_enabled +draw_margin/v_enabled = draw_margin_v_enabled + +smoothing/enable = smoothing_enabled +smoothing/speed = smoothing_speed + +drag_margin/left = drag_margin_left +drag_margin/top = drag_margin_top +drag_margin/right = drag_margin_right +drag_margin/bottom = drag_margin_bottom + +[CollisionObject2D] + +input/pickable = input_pickable + +[Joint2D] + +bias/bias = bias +collision/exclude_nodes = disable_collision + +[Light2D] + +range/height = range_height +range/z_min = range_z_min +range/z_max = range_z_max +range/layer_max = range_layer_max +range/item_cull_mask = range_item_cull_max + +shadow/enabled = shadow_enabled +shadow/color = shadow_color +shadow/buffer_size = shadow_buffer_size +shadow/gradient_length = shadow_gradient_length +shadow/filter = shadow_filter +shadow/item_cull_mask = shadow_item_cull_mask + +[Node2D] + +transform/pos = position +transform/rot = rotation +transform/scale = scale +z/z = z +z/relative = z_as_relative + +[ParallaxBackground] + +scroll/offset = scroll_offset +scroll/base_offset = scroll_base_offset +scroll/base_scale = scroll_base_scale +scroll/limit_begin = scroll_limit_begin +scroll/limit_end = scroll_limit_end +scroll/ignore_camera_zoom = scroll_ignore_camera_zoom + +[ParallaxLayer] + +motion/scale = motion_scale +motion/offset = motion_offset +motion/mirroring = motion_mirroring + +[PhysicsBody2D] + +collision/layers = collision_layers +collision/mask = collision_mask + +[Polygon2D] + +texture/texture = texture +texture/offset = texture_offset +texture/rotation = texture_rotation +texture/scale = texture_scale + +invert/enable = invert_enable +invert/border = invert_border + +[SamplePlayer2D] + +config/polyphony = polyphony +config/samples = samples +config/pitch_random = random_pitch + +[SoundPlayer2D] + +params/volume_db = volume_db +params/pitch_scale = pitch_scale +params/attenuation/min_distance = attenuation_min_distance +params/attenuation/max_distance = attenuation_max_distance +params/attenuation/distance_exp = attenuation_distance_exp + +[TileMap] + +cell/size = cell_size +cell/quadrant_size = cell_quadrant_size +cell/half_offset = cell_half_offset +cell/tile_origin = cell_tile_origin +cell/y_sort = cell_y_sort + +collision/use_kinematic = collision_use_kinematic +collision/friction = collision_friction +collision/bounce = collision_bounce +collision/layers = collision_layers +collision/mask = collision_mask + +occluder/light_mask = occluder_light_mask + +[VisibilityEnabler2D] + +enabler/pause_animations = pause_animations +enabler/freeze_bodies = freeze_bodies +enabler/pause_particles = pause_particles +enabler/pause_animated_sprites = pause_animated_sprites +enabler/process_parent = process_parent +enabler/fixed_process_parent = fixed_process_parent + + +[YSort] + +sort/enabled = sort_enabled + + +[Area] + +collision/layers = collision_layers +collision/mask = collision_mask + + +[CollisionObject] + +input/ray_pickable = input_ray_pickable +input/capture_on_drag = input_capture_on_drag + +[Light] + +light/color = light_color +light/energy = light_energy +light/negative = light_negative +light/specular = light_specular +light/cull_mask = light_cull_mask + +shadow/enabled = shadow_enabled +shadow/color = shadow_color +shadow/bias = shadow_bias +shadow/max_distance = shadow_max_distance +editor/editor_only = editor_only + +[DirectionalLight] + +directional_shadow/mode = directional_shadow_mode +directional_shadow/split_1 = directional_shadow_split_1 +directional_shadow/split_2 = directional_shadow_split_2 +directional_shadow/split_3 = directional_shadow_split_3 +directional_shadow/blend_splits = directional_shadow_blend_splits +directional_shadow/normal_bias = directional_shadow_normal_bias +directional_shadow/bias_split_scale = directional_shadow_bias_split_scale + +[OmniLight] + +omni/range = omni_range +omni/attenuation = omni_attenuation +omni/shadow_mode = omni_shadow_mode +omni/shadow_detail = omni_shadow_detail + +[SpotLight] + +spot/range = spot_range +spot/attenuation = spot_attenuation +spot/angle = spot_angle +spot/spot_attenuation = spot_angle_attenuation + +[MeshInstance] + +mesh/mesh = mesh +mesh/skeleton = skeleton + + +[PhysicsBody] + +collision/layers = collision_layers +collision/mask = collision_mask + +[Quad] + +quad/axis = axis +quad/size = size +quad/offset = offset +quad/centered = centered + +[Spatial] + +transform/local = transform +transform/transiation = translation +transform/rotation = rotation +transform/scale = scale +visibility/visible = visible + +[SpatialPlayer] + +params/volume_db = volume_db +params/pitch_scale = pitch_scale +params/attenuation/min_distance = attenuation_min_distance +params/attenuation/max_distance = attenuation_max_distance +params/attenuation/distance_exp = attenuation_distance_exp +params/emission_cone/degrees = emission_cone_degrees +params/emission_cone/attenuation_db = emission_cone_attenuation_db + +[SpatialSamplePlayer] + +config/polyphony = polyphony +config/samples = samples + +[Sprite3D] + +flags/transparent = transparent +flags/shaded = shaded +flags/alpha_cut = alpha_cut + +[VehicleWheel] + +type/traction = use_as_traction +type/steering = use_as_steering + +wheel/radius = wheel_radius +wheel/rest_length = wheel_rest_length +wheel/friction_slip = wheel_friction_sleep + +suspension/travel = suspension_travel +suspension/stiffness = suspension_stiffness +suspension/max_force = suspension_max_force +damping/compression = damping_compression +damping/relaxation = damping_relaxation + +[VehicleBody] + +motion/engine_force = engine_force +motion/breake = breake +motion/steering = steering +body/mass = mass +body/friction = friction + +[VisibilityEnabler] + +enabler/pause_animations = pause_animations +enabler/freeze_bodies = freeze_bodies + +[GeometryInstance] + +geometry/material_override = material_override +geometry/cast_shadow = cast_shadow +geometry/extra_cull_margin = extra_cull_margin +geometry/billboard = use_as_billboard +geometry/billboard_y = use_as_y_billboard +geometry/depth_scale = use_depth_scale +geometry/visible_in_all_rooms = visible_in_all_rooms +geometry/use_baked_light = use_in_baked_light + + + +[AnimationPlayer] + +playback/process_mode = playback_process_mode +playback/default_blend_time = playback_default_blend_time +root/root = root_node + +[AnimationTreePlayer] + +playback/process_mode = playback_process_mode + +[EventPlayer] + +stream/stream = stream +stream/play = play +stream/loop = loop +stream/volume_db = volume_db +stream/pitch_scale = pitch_scale +stream/tempo_scale = tempo_scale +stream/autoplay = autoplay +stream/paused = paused + +[StreamPlayer] + +stream/stream = stream +stream/play = play +stream/loop = loop +stream/volume_db = volume_db +stream/autoplay = autoplay +stream/paused = paused +stream/loop_restart_time = loop_restart_time +stream/buffering_ms = buffering_ms + +[SpatialStreamPlayer] + +stream/stream = stream +stream/play = play +stream/loop = loop +stream/volume_db = volume_db +stream/autoplay = autoplay +stream/paused = paused +stream/loop_restart_time = loop_restart_time +stream/buffering_ms = buffering_ms + +[WindowDialog] + +window/title = window_title + +[AcceptDialog] + +dialog/text = dialog_text +dialog/hide_on_ok = dialog_hide_on_ok + +[LineEdit] + +placeholder/text = placeholder_text +placeholder/alpha = placeholder_alpha +caret/caret_blink = caret_blink +caret/caret_blink_speed = caret_blink_speed + +[Patch9Frame] + +patch_margin/left = patch_margin_left +patch_margin/right = patch_margin_right +patch_margin/top = patch_margin_top +patch_margin/bottom = patch_margin_bottom + + +[Popup] + +popup/exclusive = popup_exclusive + +[ProgressBar] + +percent/visible = percent_visible + +[Range] + +range/min = min_value +range/max = max_value +range/step = step +range/page = page +range/value = value +range/exp_edit = exp_edit +range/rounded = rounded + + +[RigidBody2D] + +velocity/linear = linear_velocity +velocity/angular = angular_velocity +damp_override_linear = linear_damp +damp_override_angular = angular_damp + + +[RigidBody] + +velocity/linear = linear_velocity +velocity/angular = angular_velocity +damp_override_linear = linear_damp +damp_override_angular = angular_damp + +[Tween] + +playback/process_mode = playback_process_mode + +[RichTextLabel] + +bbcode/enabled = bbcode_enabled +bbcode/bbcode = bbcode_text + +[ScrollContainer] + +scroll/horizontal = scroll_horizontal +scroll/vertical = scroll_vertical + +[SplitContainer] + +split/offset = split_offset +split/collapsed = collapsed +split/dragger_visibility = dragger_visibility + +[TextEdit] + +caret/block_caret = caret_block_mode +caret/caret_blink = caret_blink +caret/caret_blink_speed = caret_blink_speed + +[TextureButton] + +textures/normal = texture_normal +textures/pressed = texture_pressed +textures/hover = texture_hover +textures/disabled = texture_disabled +textures/focused = texture_focused +textures/click_mask = texture_click_mask +params/scale = texture_scale +params/modulate = self_modulate + +[TextureProgress] + +texture/under = texture_under +texture/over = texture_over +texture/progress = texture_progress +mode = fill_mode +radial_fill/initial_angle = radial_initial_angle +radial_fill/fill_degrees = radial_fill_degrees +radial_fill/center_offset = radial_center_offset + +[VideoPlayer] + +stream/audio_track = audio_track +stream/stream = stream +stream/volume_db = volume_db +stream/autoplay = stream_autoplay +stream/paused = stream_paused + +[DynamicFont] + +font/size = size +extra_spacing/top = extra_spacing_top +extra_spacing/bottom = extra_spacing_bottom +extra_spacing/char = extra_spacing_char +extra_spacing/space = extra_spacing_space +font/use_mipmaps = use_mipmaps +font/use_filter = use_filter +font/font=font_data + +[StyleBox] + +content_margin/left = content_margin_left +content_margin/right = content_margin_right +content_margin/bottom = content_margin_bottom +content_margin/top = content_margin_top + + +[StyleBoxTexture] + +margin/left = margin_left +margin/top = margin_top +margin/bottom = margin_bottom +margin/right = margin_right + +expand_margin/left = expand_margin_left +expand_margin/top = expand_margin_top +expand_margin/bottom = expand_margin_bottom +expand_margin/right = expand_margin_right + +modulate/color = modulate_color + + +[AnimatedSprite] + +modulate = self_modulate + +[Sprite] + +modulate = self_modulate + +[Patch9Frame] + +modulate = self_modulate + +[TextureFrame] + +modulate = self_modulate + + + + + + + + + + diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp index 73774e12d9..4300c25e9f 100644 --- a/scene/2d/animated_sprite.cpp +++ b/scene/2d/animated_sprite.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -222,32 +222,32 @@ void SpriteFrames::_set_animations(const Array& p_animations) { void SpriteFrames::_bind_methods() { - ObjectTypeDB::bind_method(_MD("add_animation","anim"),&SpriteFrames::add_animation); - ObjectTypeDB::bind_method(_MD("has_animation","anim"),&SpriteFrames::has_animation); - ObjectTypeDB::bind_method(_MD("remove_animation","anim"),&SpriteFrames::remove_animation); - ObjectTypeDB::bind_method(_MD("rename_animation","anim","newname"),&SpriteFrames::rename_animation); + ClassDB::bind_method(_MD("add_animation","anim"),&SpriteFrames::add_animation); + ClassDB::bind_method(_MD("has_animation","anim"),&SpriteFrames::has_animation); + ClassDB::bind_method(_MD("remove_animation","anim"),&SpriteFrames::remove_animation); + ClassDB::bind_method(_MD("rename_animation","anim","newname"),&SpriteFrames::rename_animation); - ObjectTypeDB::bind_method(_MD("set_animation_speed","anim","speed"),&SpriteFrames::set_animation_speed); - ObjectTypeDB::bind_method(_MD("get_animation_speed","anim"),&SpriteFrames::get_animation_speed); + ClassDB::bind_method(_MD("set_animation_speed","anim","speed"),&SpriteFrames::set_animation_speed); + ClassDB::bind_method(_MD("get_animation_speed","anim"),&SpriteFrames::get_animation_speed); - ObjectTypeDB::bind_method(_MD("set_animation_loop","anim","loop"),&SpriteFrames::set_animation_loop); - ObjectTypeDB::bind_method(_MD("get_animation_loop","anim"),&SpriteFrames::get_animation_loop); + ClassDB::bind_method(_MD("set_animation_loop","anim","loop"),&SpriteFrames::set_animation_loop); + ClassDB::bind_method(_MD("get_animation_loop","anim"),&SpriteFrames::get_animation_loop); - ObjectTypeDB::bind_method(_MD("add_frame","anim","frame","atpos"),&SpriteFrames::add_frame,DEFVAL(-1)); - ObjectTypeDB::bind_method(_MD("get_frame_count","anim"),&SpriteFrames::get_frame_count); - ObjectTypeDB::bind_method(_MD("get_frame","anim","idx"),&SpriteFrames::get_frame); - ObjectTypeDB::bind_method(_MD("set_frame","anim","idx","txt"),&SpriteFrames::set_frame); - ObjectTypeDB::bind_method(_MD("remove_frame","anim","idx"),&SpriteFrames::remove_frame); - ObjectTypeDB::bind_method(_MD("clear","anim"),&SpriteFrames::clear); - ObjectTypeDB::bind_method(_MD("clear_all"),&SpriteFrames::clear_all); + ClassDB::bind_method(_MD("add_frame","anim","frame","atpos"),&SpriteFrames::add_frame,DEFVAL(-1)); + ClassDB::bind_method(_MD("get_frame_count","anim"),&SpriteFrames::get_frame_count); + ClassDB::bind_method(_MD("get_frame","anim","idx"),&SpriteFrames::get_frame); + ClassDB::bind_method(_MD("set_frame","anim","idx","txt"),&SpriteFrames::set_frame); + ClassDB::bind_method(_MD("remove_frame","anim","idx"),&SpriteFrames::remove_frame); + ClassDB::bind_method(_MD("clear","anim"),&SpriteFrames::clear); + ClassDB::bind_method(_MD("clear_all"),&SpriteFrames::clear_all); - ObjectTypeDB::bind_method(_MD("_set_frames"),&SpriteFrames::_set_frames); - ObjectTypeDB::bind_method(_MD("_get_frames"),&SpriteFrames::_get_frames); + ClassDB::bind_method(_MD("_set_frames"),&SpriteFrames::_set_frames); + ClassDB::bind_method(_MD("_get_frames"),&SpriteFrames::_get_frames); ADD_PROPERTYNZ( PropertyInfo(Variant::ARRAY,"frames",PROPERTY_HINT_NONE,"",0),_SCS("_set_frames"),_SCS("_get_frames")); //compatibility - ObjectTypeDB::bind_method(_MD("_set_animations"),&SpriteFrames::_set_animations); - ObjectTypeDB::bind_method(_MD("_get_animations"),&SpriteFrames::_get_animations); + ClassDB::bind_method(_MD("_set_animations"),&SpriteFrames::_set_animations); + ClassDB::bind_method(_MD("_get_animations"),&SpriteFrames::_get_animations); ADD_PROPERTYNZ( PropertyInfo(Variant::ARRAY,"animations",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_animations"),_SCS("_get_animations")); //compatibility @@ -332,7 +332,7 @@ void AnimatedSprite::_validate_property(PropertyInfo& property) const { void AnimatedSprite::_notification(int p_what) { switch(p_what) { - case NOTIFICATION_PROCESS: { + case NOTIFICATION_INTERNAL_PROCESS: { if (frames.is_null()) return; @@ -362,6 +362,9 @@ void AnimatedSprite::_notification(int p_what) { } } else { frame++; + if (frame==fc-1) { + emit_signal(SceneStringNames::get_singleton()->animation_finished); + } } update(); @@ -425,7 +428,7 @@ void AnimatedSprite::_notification(int p_what) { dst_rect.size.y=-dst_rect.size.y; //texture->draw_rect(ci,dst_rect,false,modulate); - texture->draw_rect_region(ci,dst_rect,Rect2(Vector2(),texture->get_size()),modulate); + texture->draw_rect_region(ci,dst_rect,Rect2(Vector2(),texture->get_size())); // VisualServer::get_singleton()->canvas_item_add_texture_rect_region(ci,dst_rect,texture->get_rid(),src_rect,modulate); } break; @@ -541,17 +544,6 @@ bool AnimatedSprite::is_flipped_v() const { } -void AnimatedSprite::set_modulate(const Color& p_color) { - - modulate=p_color; - update(); -} - -Color AnimatedSprite::get_modulate() const{ - - return modulate; -} - Rect2 AnimatedSprite::get_item_rect() const { @@ -590,7 +582,7 @@ void AnimatedSprite::_set_playing(bool p_playing) { return; playing=p_playing; _reset_timeout(); - set_process(playing); + set_process_internal(playing); } bool AnimatedSprite::_is_playing() const { @@ -661,41 +653,39 @@ String AnimatedSprite::get_configuration_warning() const { void AnimatedSprite::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_sprite_frames","sprite_frames:SpriteFrames"),&AnimatedSprite::set_sprite_frames); - ObjectTypeDB::bind_method(_MD("get_sprite_frames:SpriteFrames"),&AnimatedSprite::get_sprite_frames); + ClassDB::bind_method(_MD("set_sprite_frames","sprite_frames:SpriteFrames"),&AnimatedSprite::set_sprite_frames); + ClassDB::bind_method(_MD("get_sprite_frames:SpriteFrames"),&AnimatedSprite::get_sprite_frames); - ObjectTypeDB::bind_method(_MD("set_animation","animation"),&AnimatedSprite::set_animation); - ObjectTypeDB::bind_method(_MD("get_animation"),&AnimatedSprite::get_animation); + ClassDB::bind_method(_MD("set_animation","animation"),&AnimatedSprite::set_animation); + ClassDB::bind_method(_MD("get_animation"),&AnimatedSprite::get_animation); - ObjectTypeDB::bind_method(_MD("_set_playing","playing"),&AnimatedSprite::_set_playing); - ObjectTypeDB::bind_method(_MD("_is_playing"),&AnimatedSprite::_is_playing); + ClassDB::bind_method(_MD("_set_playing","playing"),&AnimatedSprite::_set_playing); + ClassDB::bind_method(_MD("_is_playing"),&AnimatedSprite::_is_playing); - ObjectTypeDB::bind_method(_MD("play","anim"),&AnimatedSprite::play,DEFVAL(StringName())); - ObjectTypeDB::bind_method(_MD("stop"),&AnimatedSprite::stop); - ObjectTypeDB::bind_method(_MD("is_playing"),&AnimatedSprite::is_playing); + ClassDB::bind_method(_MD("play","anim"),&AnimatedSprite::play,DEFVAL(StringName())); + ClassDB::bind_method(_MD("stop"),&AnimatedSprite::stop); + ClassDB::bind_method(_MD("is_playing"),&AnimatedSprite::is_playing); - ObjectTypeDB::bind_method(_MD("set_centered","centered"),&AnimatedSprite::set_centered); - ObjectTypeDB::bind_method(_MD("is_centered"),&AnimatedSprite::is_centered); + ClassDB::bind_method(_MD("set_centered","centered"),&AnimatedSprite::set_centered); + ClassDB::bind_method(_MD("is_centered"),&AnimatedSprite::is_centered); - ObjectTypeDB::bind_method(_MD("set_offset","offset"),&AnimatedSprite::set_offset); - ObjectTypeDB::bind_method(_MD("get_offset"),&AnimatedSprite::get_offset); + ClassDB::bind_method(_MD("set_offset","offset"),&AnimatedSprite::set_offset); + ClassDB::bind_method(_MD("get_offset"),&AnimatedSprite::get_offset); - ObjectTypeDB::bind_method(_MD("set_flip_h","flip_h"),&AnimatedSprite::set_flip_h); - ObjectTypeDB::bind_method(_MD("is_flipped_h"),&AnimatedSprite::is_flipped_h); + ClassDB::bind_method(_MD("set_flip_h","flip_h"),&AnimatedSprite::set_flip_h); + ClassDB::bind_method(_MD("is_flipped_h"),&AnimatedSprite::is_flipped_h); - ObjectTypeDB::bind_method(_MD("set_flip_v","flip_v"),&AnimatedSprite::set_flip_v); - ObjectTypeDB::bind_method(_MD("is_flipped_v"),&AnimatedSprite::is_flipped_v); + ClassDB::bind_method(_MD("set_flip_v","flip_v"),&AnimatedSprite::set_flip_v); + ClassDB::bind_method(_MD("is_flipped_v"),&AnimatedSprite::is_flipped_v); - ObjectTypeDB::bind_method(_MD("set_frame","frame"),&AnimatedSprite::set_frame); - ObjectTypeDB::bind_method(_MD("get_frame"),&AnimatedSprite::get_frame); + ClassDB::bind_method(_MD("set_frame","frame"),&AnimatedSprite::set_frame); + ClassDB::bind_method(_MD("get_frame"),&AnimatedSprite::get_frame); - ObjectTypeDB::bind_method(_MD("set_modulate","modulate"),&AnimatedSprite::set_modulate); - ObjectTypeDB::bind_method(_MD("get_modulate"),&AnimatedSprite::get_modulate); - - ObjectTypeDB::bind_method(_MD("_res_changed"),&AnimatedSprite::_res_changed); + ClassDB::bind_method(_MD("_res_changed"),&AnimatedSprite::_res_changed); ADD_SIGNAL(MethodInfo("frame_changed")); + ADD_SIGNAL(MethodInfo("animation_finished")); ADD_PROPERTYNZ( PropertyInfo( Variant::OBJECT, "frames",PROPERTY_HINT_RESOURCE_TYPE,"SpriteFrames"), _SCS("set_sprite_frames"),_SCS("get_sprite_frames")); ADD_PROPERTY( PropertyInfo( Variant::STRING, "animation"), _SCS("set_animation"),_SCS("get_animation")); @@ -705,7 +695,7 @@ void AnimatedSprite::_bind_methods() { ADD_PROPERTYNZ( PropertyInfo( Variant::VECTOR2, "offset"), _SCS("set_offset"),_SCS("get_offset")); ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "flip_h"), _SCS("set_flip_h"),_SCS("is_flipped_h")); ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "flip_v"), _SCS("set_flip_v"),_SCS("is_flipped_v")); - ADD_PROPERTYNO( PropertyInfo( Variant::COLOR, "modulate"), _SCS("set_modulate"),_SCS("get_modulate")); + } @@ -718,7 +708,6 @@ AnimatedSprite::AnimatedSprite() { frame=0; playing=false; animation="default"; - modulate=Color(1,1,1,1); timeout=0; diff --git a/scene/2d/animated_sprite.h b/scene/2d/animated_sprite.h index 968cd9aa30..fbeea7f69b 100644 --- a/scene/2d/animated_sprite.h +++ b/scene/2d/animated_sprite.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class SpriteFrames : public Resource { - OBJ_TYPE(SpriteFrames,Resource); + GDCLASS(SpriteFrames,Resource); struct Anim { @@ -109,7 +109,7 @@ public: class AnimatedSprite : public Node2D { - OBJ_TYPE(AnimatedSprite,Node2D); + GDCLASS(AnimatedSprite,Node2D); Ref<SpriteFrames> frames; bool playing; @@ -124,7 +124,6 @@ class AnimatedSprite : public Node2D { bool hflip; bool vflip; - Color modulate; void _res_changed(); diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp index e8954b7e98..883118dc41 100644 --- a/scene/2d/area_2d.cpp +++ b/scene/2d/area_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -587,62 +587,62 @@ bool Area2D::get_layer_mask_bit(int p_bit) const{ void Area2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_body_enter_tree","id"),&Area2D::_body_enter_tree); - ObjectTypeDB::bind_method(_MD("_body_exit_tree","id"),&Area2D::_body_exit_tree); + ClassDB::bind_method(_MD("_body_enter_tree","id"),&Area2D::_body_enter_tree); + ClassDB::bind_method(_MD("_body_exit_tree","id"),&Area2D::_body_exit_tree); - ObjectTypeDB::bind_method(_MD("_area_enter_tree","id"),&Area2D::_area_enter_tree); - ObjectTypeDB::bind_method(_MD("_area_exit_tree","id"),&Area2D::_area_exit_tree); + ClassDB::bind_method(_MD("_area_enter_tree","id"),&Area2D::_area_enter_tree); + ClassDB::bind_method(_MD("_area_exit_tree","id"),&Area2D::_area_exit_tree); - ObjectTypeDB::bind_method(_MD("set_space_override_mode","enable"),&Area2D::set_space_override_mode); - ObjectTypeDB::bind_method(_MD("get_space_override_mode"),&Area2D::get_space_override_mode); + ClassDB::bind_method(_MD("set_space_override_mode","enable"),&Area2D::set_space_override_mode); + ClassDB::bind_method(_MD("get_space_override_mode"),&Area2D::get_space_override_mode); - ObjectTypeDB::bind_method(_MD("set_gravity_is_point","enable"),&Area2D::set_gravity_is_point); - ObjectTypeDB::bind_method(_MD("is_gravity_a_point"),&Area2D::is_gravity_a_point); + ClassDB::bind_method(_MD("set_gravity_is_point","enable"),&Area2D::set_gravity_is_point); + ClassDB::bind_method(_MD("is_gravity_a_point"),&Area2D::is_gravity_a_point); - ObjectTypeDB::bind_method(_MD("set_gravity_distance_scale","distance_scale"),&Area2D::set_gravity_distance_scale); - ObjectTypeDB::bind_method(_MD("get_gravity_distance_scale"),&Area2D::get_gravity_distance_scale); + ClassDB::bind_method(_MD("set_gravity_distance_scale","distance_scale"),&Area2D::set_gravity_distance_scale); + ClassDB::bind_method(_MD("get_gravity_distance_scale"),&Area2D::get_gravity_distance_scale); - ObjectTypeDB::bind_method(_MD("set_gravity_vector","vector"),&Area2D::set_gravity_vector); - ObjectTypeDB::bind_method(_MD("get_gravity_vector"),&Area2D::get_gravity_vector); + ClassDB::bind_method(_MD("set_gravity_vector","vector"),&Area2D::set_gravity_vector); + ClassDB::bind_method(_MD("get_gravity_vector"),&Area2D::get_gravity_vector); - ObjectTypeDB::bind_method(_MD("set_gravity","gravity"),&Area2D::set_gravity); - ObjectTypeDB::bind_method(_MD("get_gravity"),&Area2D::get_gravity); + ClassDB::bind_method(_MD("set_gravity","gravity"),&Area2D::set_gravity); + ClassDB::bind_method(_MD("get_gravity"),&Area2D::get_gravity); - ObjectTypeDB::bind_method(_MD("set_linear_damp","linear_damp"),&Area2D::set_linear_damp); - ObjectTypeDB::bind_method(_MD("get_linear_damp"),&Area2D::get_linear_damp); + ClassDB::bind_method(_MD("set_linear_damp","linear_damp"),&Area2D::set_linear_damp); + ClassDB::bind_method(_MD("get_linear_damp"),&Area2D::get_linear_damp); - ObjectTypeDB::bind_method(_MD("set_angular_damp","angular_damp"),&Area2D::set_angular_damp); - ObjectTypeDB::bind_method(_MD("get_angular_damp"),&Area2D::get_angular_damp); + ClassDB::bind_method(_MD("set_angular_damp","angular_damp"),&Area2D::set_angular_damp); + ClassDB::bind_method(_MD("get_angular_damp"),&Area2D::get_angular_damp); - ObjectTypeDB::bind_method(_MD("set_priority","priority"),&Area2D::set_priority); - ObjectTypeDB::bind_method(_MD("get_priority"),&Area2D::get_priority); + ClassDB::bind_method(_MD("set_priority","priority"),&Area2D::set_priority); + ClassDB::bind_method(_MD("get_priority"),&Area2D::get_priority); - ObjectTypeDB::bind_method(_MD("set_collision_mask","collision_mask"),&Area2D::set_collision_mask); - ObjectTypeDB::bind_method(_MD("get_collision_mask"),&Area2D::get_collision_mask); + ClassDB::bind_method(_MD("set_collision_mask","collision_mask"),&Area2D::set_collision_mask); + ClassDB::bind_method(_MD("get_collision_mask"),&Area2D::get_collision_mask); - ObjectTypeDB::bind_method(_MD("set_layer_mask","layer_mask"),&Area2D::set_layer_mask); - ObjectTypeDB::bind_method(_MD("get_layer_mask"),&Area2D::get_layer_mask); + ClassDB::bind_method(_MD("set_layer_mask","layer_mask"),&Area2D::set_layer_mask); + ClassDB::bind_method(_MD("get_layer_mask"),&Area2D::get_layer_mask); - ObjectTypeDB::bind_method(_MD("set_collision_mask_bit","bit","value"),&Area2D::set_collision_mask_bit); - ObjectTypeDB::bind_method(_MD("get_collision_mask_bit","bit"),&Area2D::get_collision_mask_bit); + ClassDB::bind_method(_MD("set_collision_mask_bit","bit","value"),&Area2D::set_collision_mask_bit); + ClassDB::bind_method(_MD("get_collision_mask_bit","bit"),&Area2D::get_collision_mask_bit); - ObjectTypeDB::bind_method(_MD("set_layer_mask_bit","bit","value"),&Area2D::set_layer_mask_bit); - ObjectTypeDB::bind_method(_MD("get_layer_mask_bit","bit"),&Area2D::get_layer_mask_bit); + ClassDB::bind_method(_MD("set_layer_mask_bit","bit","value"),&Area2D::set_layer_mask_bit); + ClassDB::bind_method(_MD("get_layer_mask_bit","bit"),&Area2D::get_layer_mask_bit); - ObjectTypeDB::bind_method(_MD("set_enable_monitoring","enable"),&Area2D::set_enable_monitoring); - ObjectTypeDB::bind_method(_MD("is_monitoring_enabled"),&Area2D::is_monitoring_enabled); + ClassDB::bind_method(_MD("set_enable_monitoring","enable"),&Area2D::set_enable_monitoring); + ClassDB::bind_method(_MD("is_monitoring_enabled"),&Area2D::is_monitoring_enabled); - ObjectTypeDB::bind_method(_MD("set_monitorable","enable"),&Area2D::set_monitorable); - ObjectTypeDB::bind_method(_MD("is_monitorable"),&Area2D::is_monitorable); + ClassDB::bind_method(_MD("set_monitorable","enable"),&Area2D::set_monitorable); + ClassDB::bind_method(_MD("is_monitorable"),&Area2D::is_monitorable); - ObjectTypeDB::bind_method(_MD("get_overlapping_bodies"),&Area2D::get_overlapping_bodies); - ObjectTypeDB::bind_method(_MD("get_overlapping_areas"),&Area2D::get_overlapping_areas); + ClassDB::bind_method(_MD("get_overlapping_bodies"),&Area2D::get_overlapping_bodies); + ClassDB::bind_method(_MD("get_overlapping_areas"),&Area2D::get_overlapping_areas); - ObjectTypeDB::bind_method(_MD("overlaps_body","body"),&Area2D::overlaps_body); - ObjectTypeDB::bind_method(_MD("overlaps_area","area"),&Area2D::overlaps_area); + ClassDB::bind_method(_MD("overlaps_body","body"),&Area2D::overlaps_body); + ClassDB::bind_method(_MD("overlaps_area","area"),&Area2D::overlaps_area); - ObjectTypeDB::bind_method(_MD("_body_inout"),&Area2D::_body_inout); - ObjectTypeDB::bind_method(_MD("_area_inout"),&Area2D::_area_inout); + ClassDB::bind_method(_MD("_body_inout"),&Area2D::_body_inout); + ClassDB::bind_method(_MD("_area_inout"),&Area2D::_area_inout); ADD_SIGNAL( MethodInfo("body_enter_shape",PropertyInfo(Variant::INT,"body_id"),PropertyInfo(Variant::OBJECT,"body",PROPERTY_HINT_RESOURCE_TYPE,"PhysicsBody2D"),PropertyInfo(Variant::INT,"body_shape"),PropertyInfo(Variant::INT,"area_shape"))); @@ -666,8 +666,9 @@ void Area2D::_bind_methods() { ADD_PROPERTYNZ( PropertyInfo(Variant::INT,"priority",PROPERTY_HINT_RANGE,"0,128,1"),_SCS("set_priority"),_SCS("get_priority")); ADD_PROPERTYNO( PropertyInfo(Variant::BOOL,"monitoring"),_SCS("set_enable_monitoring"),_SCS("is_monitoring_enabled")); ADD_PROPERTYNO( PropertyInfo(Variant::BOOL,"monitorable"),_SCS("set_monitorable"),_SCS("is_monitorable")); - ADD_PROPERTYNO( PropertyInfo(Variant::INT,"collision/layers",PROPERTY_HINT_ALL_FLAGS),_SCS("set_layer_mask"),_SCS("get_layer_mask")); - ADD_PROPERTYNO( PropertyInfo(Variant::INT,"collision/mask",PROPERTY_HINT_ALL_FLAGS),_SCS("set_collision_mask"),_SCS("get_collision_mask")); + ADD_GROUP("Collision","collision_"); + ADD_PROPERTYNO( PropertyInfo(Variant::INT,"collision_layers",PROPERTY_HINT_LAYERS_2D_PHYSICS),_SCS("set_layer_mask"),_SCS("get_layer_mask")); + ADD_PROPERTYNO( PropertyInfo(Variant::INT,"collision_mask",PROPERTY_HINT_LAYERS_2D_PHYSICS),_SCS("set_collision_mask"),_SCS("get_collision_mask")); } diff --git a/scene/2d/area_2d.h b/scene/2d/area_2d.h index 7f3f9c93cf..e1adc16666 100644 --- a/scene/2d/area_2d.h +++ b/scene/2d/area_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class Area2D : public CollisionObject2D { - OBJ_TYPE( Area2D, CollisionObject2D ); + GDCLASS( Area2D, CollisionObject2D ); public: enum SpaceOverride { diff --git a/scene/2d/back_buffer_copy.cpp b/scene/2d/back_buffer_copy.cpp index a83a3ce041..bbeed322b1 100644 --- a/scene/2d/back_buffer_copy.cpp +++ b/scene/2d/back_buffer_copy.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -77,11 +77,11 @@ BackBufferCopy::CopyMode BackBufferCopy::get_copy_mode() const{ void BackBufferCopy::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_rect","rect"),&BackBufferCopy::set_rect); - ObjectTypeDB::bind_method(_MD("get_rect"),&BackBufferCopy::get_rect); + ClassDB::bind_method(_MD("set_rect","rect"),&BackBufferCopy::set_rect); + ClassDB::bind_method(_MD("get_rect"),&BackBufferCopy::get_rect); - ObjectTypeDB::bind_method(_MD("set_copy_mode","copy_mode"),&BackBufferCopy::set_copy_mode); - ObjectTypeDB::bind_method(_MD("get_copy_mode"),&BackBufferCopy::get_copy_mode); + ClassDB::bind_method(_MD("set_copy_mode","copy_mode"),&BackBufferCopy::set_copy_mode); + ClassDB::bind_method(_MD("get_copy_mode"),&BackBufferCopy::get_copy_mode); ADD_PROPERTY( PropertyInfo(Variant::INT,"copy_mode",PROPERTY_HINT_ENUM,"Disabled,Rect,Viewport"),_SCS("set_copy_mode"),_SCS("get_copy_mode")); ADD_PROPERTY( PropertyInfo(Variant::RECT2,"rect"),_SCS("set_rect"),_SCS("get_rect")); diff --git a/scene/2d/back_buffer_copy.h b/scene/2d/back_buffer_copy.h index f371dbdef4..22387f3e9d 100644 --- a/scene/2d/back_buffer_copy.h +++ b/scene/2d/back_buffer_copy.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,7 +32,7 @@ #include "scene/2d/node_2d.h" class BackBufferCopy : public Node2D { - OBJ_TYPE( BackBufferCopy,Node2D); + GDCLASS( BackBufferCopy,Node2D); public: enum CopyMode { COPY_MODE_DISABLED, diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index f33faaabd8..6c387c610f 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -47,7 +47,7 @@ void Camera2D::_update_scroll() { ERR_FAIL_COND( custom_viewport && !ObjectDB::get_instance(custom_viewport_id) ); - Matrix32 xform = get_camera_transform(); + Transform2D xform = get_camera_transform(); if (viewport) { viewport->set_canvas_transform( xform ); @@ -71,12 +71,12 @@ Vector2 Camera2D::get_zoom() const { }; -Matrix32 Camera2D::get_camera_transform() { +Transform2D Camera2D::get_camera_transform() { if (!get_tree()) - return Matrix32(); + return Transform2D(); - ERR_FAIL_COND_V( custom_viewport && !ObjectDB::get_instance(custom_viewport_id), Matrix32() ); + ERR_FAIL_COND_V( custom_viewport && !ObjectDB::get_instance(custom_viewport_id), Transform2D() ); Size2 screen_size = viewport->get_visible_rect().size; @@ -201,7 +201,7 @@ Matrix32 Camera2D::get_camera_transform() { camera_screen_center=screen_rect.pos+screen_rect.size*0.5; - Matrix32 xform; + Transform2D xform; if(rotating){ xform.set_rotation(angle); } @@ -272,7 +272,7 @@ void Camera2D::_notification(int p_what) { if (is_current()) { if (viewport && !(custom_viewport && !ObjectDB::get_instance(custom_viewport_id))) { - viewport->set_canvas_transform( Matrix32() ); + viewport->set_canvas_transform( Transform2D() ); } } remove_from_group(group_name); @@ -290,7 +290,7 @@ void Camera2D::_notification(int p_what) { if(current) area_axis_width = 3; - Matrix32 inv_camera_transform = get_camera_transform().affine_inverse(); + Transform2D inv_camera_transform = get_camera_transform().affine_inverse(); Size2 screen_size = get_viewport_rect().size; Vector2 screen_endpoints[4]= { @@ -300,7 +300,7 @@ void Camera2D::_notification(int p_what) { inv_camera_transform.xform(Vector2(0, screen_size.height)) }; - Matrix32 inv_transform = get_global_transform().affine_inverse(); // undo global space + Transform2D inv_transform = get_global_transform().affine_inverse(); // undo global space for(int i=0;i<4;i++) { draw_line(inv_transform.xform(screen_endpoints[i]), inv_transform.xform(screen_endpoints[(i+1)%4]), area_axis_color, area_axis_width); @@ -590,65 +590,65 @@ Node* Camera2D::get_custom_viewport() const { void Camera2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_offset","offset"),&Camera2D::set_offset); - ObjectTypeDB::bind_method(_MD("get_offset"),&Camera2D::get_offset); + ClassDB::bind_method(_MD("set_offset","offset"),&Camera2D::set_offset); + ClassDB::bind_method(_MD("get_offset"),&Camera2D::get_offset); - ObjectTypeDB::bind_method(_MD("set_anchor_mode","anchor_mode"),&Camera2D::set_anchor_mode); - ObjectTypeDB::bind_method(_MD("get_anchor_mode"),&Camera2D::get_anchor_mode); + ClassDB::bind_method(_MD("set_anchor_mode","anchor_mode"),&Camera2D::set_anchor_mode); + ClassDB::bind_method(_MD("get_anchor_mode"),&Camera2D::get_anchor_mode); - ObjectTypeDB::bind_method(_MD("set_rotating","rotating"),&Camera2D::set_rotating); - ObjectTypeDB::bind_method(_MD("is_rotating"),&Camera2D::is_rotating); + ClassDB::bind_method(_MD("set_rotating","rotating"),&Camera2D::set_rotating); + ClassDB::bind_method(_MD("is_rotating"),&Camera2D::is_rotating); - ObjectTypeDB::bind_method(_MD("make_current"),&Camera2D::make_current); - ObjectTypeDB::bind_method(_MD("clear_current"),&Camera2D::clear_current); - ObjectTypeDB::bind_method(_MD("_make_current"),&Camera2D::_make_current); + ClassDB::bind_method(_MD("make_current"),&Camera2D::make_current); + ClassDB::bind_method(_MD("clear_current"),&Camera2D::clear_current); + ClassDB::bind_method(_MD("_make_current"),&Camera2D::_make_current); - ObjectTypeDB::bind_method(_MD("_update_scroll"),&Camera2D::_update_scroll); + ClassDB::bind_method(_MD("_update_scroll"),&Camera2D::_update_scroll); - ObjectTypeDB::bind_method(_MD("_set_current","current"),&Camera2D::_set_current); - ObjectTypeDB::bind_method(_MD("is_current"),&Camera2D::is_current); + ClassDB::bind_method(_MD("_set_current","current"),&Camera2D::_set_current); + ClassDB::bind_method(_MD("is_current"),&Camera2D::is_current); - ObjectTypeDB::bind_method(_MD("set_limit","margin","limit"),&Camera2D::set_limit); - ObjectTypeDB::bind_method(_MD("get_limit","margin"),&Camera2D::get_limit); + ClassDB::bind_method(_MD("set_limit","margin","limit"),&Camera2D::set_limit); + ClassDB::bind_method(_MD("get_limit","margin"),&Camera2D::get_limit); - ObjectTypeDB::bind_method(_MD("set_limit_smoothing_enabled","limit_smoothing_enabled"),&Camera2D::set_limit_smoothing_enabled); - ObjectTypeDB::bind_method(_MD("is_limit_smoothing_enabled"),&Camera2D::is_limit_smoothing_enabled); + ClassDB::bind_method(_MD("set_limit_smoothing_enabled","limit_smoothing_enabled"),&Camera2D::set_limit_smoothing_enabled); + ClassDB::bind_method(_MD("is_limit_smoothing_enabled"),&Camera2D::is_limit_smoothing_enabled); - ObjectTypeDB::bind_method(_MD("set_v_drag_enabled","enabled"),&Camera2D::set_v_drag_enabled); - ObjectTypeDB::bind_method(_MD("is_v_drag_enabled"),&Camera2D::is_v_drag_enabled); + ClassDB::bind_method(_MD("set_v_drag_enabled","enabled"),&Camera2D::set_v_drag_enabled); + ClassDB::bind_method(_MD("is_v_drag_enabled"),&Camera2D::is_v_drag_enabled); - ObjectTypeDB::bind_method(_MD("set_h_drag_enabled","enabled"),&Camera2D::set_h_drag_enabled); - ObjectTypeDB::bind_method(_MD("is_h_drag_enabled"),&Camera2D::is_h_drag_enabled); + ClassDB::bind_method(_MD("set_h_drag_enabled","enabled"),&Camera2D::set_h_drag_enabled); + ClassDB::bind_method(_MD("is_h_drag_enabled"),&Camera2D::is_h_drag_enabled); - ObjectTypeDB::bind_method(_MD("set_v_offset","ofs"),&Camera2D::set_v_offset); - ObjectTypeDB::bind_method(_MD("get_v_offset"),&Camera2D::get_v_offset); + ClassDB::bind_method(_MD("set_v_offset","ofs"),&Camera2D::set_v_offset); + ClassDB::bind_method(_MD("get_v_offset"),&Camera2D::get_v_offset); - ObjectTypeDB::bind_method(_MD("set_h_offset","ofs"),&Camera2D::set_h_offset); - ObjectTypeDB::bind_method(_MD("get_h_offset"),&Camera2D::get_h_offset); + ClassDB::bind_method(_MD("set_h_offset","ofs"),&Camera2D::set_h_offset); + ClassDB::bind_method(_MD("get_h_offset"),&Camera2D::get_h_offset); - ObjectTypeDB::bind_method(_MD("set_drag_margin","margin","drag_margin"),&Camera2D::set_drag_margin); - ObjectTypeDB::bind_method(_MD("get_drag_margin","margin"),&Camera2D::get_drag_margin); + ClassDB::bind_method(_MD("set_drag_margin","margin","drag_margin"),&Camera2D::set_drag_margin); + ClassDB::bind_method(_MD("get_drag_margin","margin"),&Camera2D::get_drag_margin); - ObjectTypeDB::bind_method(_MD("get_camera_pos"),&Camera2D::get_camera_pos); - ObjectTypeDB::bind_method(_MD("get_camera_screen_center"),&Camera2D::get_camera_screen_center); + ClassDB::bind_method(_MD("get_camera_pos"),&Camera2D::get_camera_pos); + ClassDB::bind_method(_MD("get_camera_screen_center"),&Camera2D::get_camera_screen_center); - ObjectTypeDB::bind_method(_MD("set_zoom","zoom"),&Camera2D::set_zoom); - ObjectTypeDB::bind_method(_MD("get_zoom"),&Camera2D::get_zoom); + ClassDB::bind_method(_MD("set_zoom","zoom"),&Camera2D::set_zoom); + ClassDB::bind_method(_MD("get_zoom"),&Camera2D::get_zoom); - ObjectTypeDB::bind_method(_MD("set_custom_viewport","viewport:Viewport"),&Camera2D::set_custom_viewport); - ObjectTypeDB::bind_method(_MD("get_custom_viewport:Viewport"),&Camera2D::get_custom_viewport); + ClassDB::bind_method(_MD("set_custom_viewport","viewport:Viewport"),&Camera2D::set_custom_viewport); + ClassDB::bind_method(_MD("get_custom_viewport:Viewport"),&Camera2D::get_custom_viewport); - ObjectTypeDB::bind_method(_MD("set_follow_smoothing","follow_smoothing"),&Camera2D::set_follow_smoothing); - ObjectTypeDB::bind_method(_MD("get_follow_smoothing"),&Camera2D::get_follow_smoothing); + ClassDB::bind_method(_MD("set_follow_smoothing","follow_smoothing"),&Camera2D::set_follow_smoothing); + ClassDB::bind_method(_MD("get_follow_smoothing"),&Camera2D::get_follow_smoothing); - ObjectTypeDB::bind_method(_MD("set_enable_follow_smoothing","follow_smoothing"),&Camera2D::set_enable_follow_smoothing); - ObjectTypeDB::bind_method(_MD("is_follow_smoothing_enabled"),&Camera2D::is_follow_smoothing_enabled); + ClassDB::bind_method(_MD("set_enable_follow_smoothing","follow_smoothing"),&Camera2D::set_enable_follow_smoothing); + ClassDB::bind_method(_MD("is_follow_smoothing_enabled"),&Camera2D::is_follow_smoothing_enabled); - ObjectTypeDB::bind_method(_MD("force_update_scroll"),&Camera2D::force_update_scroll); - ObjectTypeDB::bind_method(_MD("reset_smoothing"),&Camera2D::reset_smoothing); - ObjectTypeDB::bind_method(_MD("align"),&Camera2D::align); + ClassDB::bind_method(_MD("force_update_scroll"),&Camera2D::force_update_scroll); + ClassDB::bind_method(_MD("reset_smoothing"),&Camera2D::reset_smoothing); + ClassDB::bind_method(_MD("align"),&Camera2D::align); - ObjectTypeDB::bind_method(_MD("_set_old_smoothing","follow_smoothing"),&Camera2D::_set_old_smoothing); + ClassDB::bind_method(_MD("_set_old_smoothing","follow_smoothing"),&Camera2D::_set_old_smoothing); ADD_PROPERTYNZ( PropertyInfo(Variant::VECTOR2,"offset"),_SCS("set_offset"),_SCS("get_offset")); ADD_PROPERTY( PropertyInfo(Variant::INT,"anchor_mode",PROPERTY_HINT_ENUM,"Fixed TopLeft,Drag Center"),_SCS("set_anchor_mode"),_SCS("get_anchor_mode")); @@ -656,25 +656,26 @@ void Camera2D::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::BOOL,"current"),_SCS("_set_current"),_SCS("is_current")); ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"zoom"),_SCS("set_zoom"),_SCS("get_zoom") ); - ADD_PROPERTYI( PropertyInfo(Variant::INT,"limit/left"),_SCS("set_limit"),_SCS("get_limit"),MARGIN_LEFT); - ADD_PROPERTYI( PropertyInfo(Variant::INT,"limit/top"),_SCS("set_limit"),_SCS("get_limit"),MARGIN_TOP); - ADD_PROPERTYI( PropertyInfo(Variant::INT,"limit/right"),_SCS("set_limit"),_SCS("get_limit"),MARGIN_RIGHT); - ADD_PROPERTYI( PropertyInfo(Variant::INT,"limit/bottom"),_SCS("set_limit"),_SCS("get_limit"),MARGIN_BOTTOM); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"limit/smoothed"),_SCS("set_limit_smoothing_enabled"),_SCS("is_limit_smoothing_enabled") ); - - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"drag_margin/h_enabled"),_SCS("set_h_drag_enabled"),_SCS("is_h_drag_enabled") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"drag_margin/v_enabled"),_SCS("set_v_drag_enabled"),_SCS("is_v_drag_enabled") ); - - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"smoothing/enable"),_SCS("set_enable_follow_smoothing"),_SCS("is_follow_smoothing_enabled") ); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"smoothing/speed"),_SCS("set_follow_smoothing"),_SCS("get_follow_smoothing") ); - - //compatibility - ADD_PROPERTY( PropertyInfo(Variant::REAL,"smoothing",PROPERTY_HINT_NONE,"",0),_SCS("_set_old_smoothing"),_SCS("get_follow_smoothing") ); - - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"drag_margin/left",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_drag_margin"),_SCS("get_drag_margin"),MARGIN_LEFT); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"drag_margin/top",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_drag_margin"),_SCS("get_drag_margin"),MARGIN_TOP); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"drag_margin/right",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_drag_margin"),_SCS("get_drag_margin"),MARGIN_RIGHT); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"drag_margin/bottom",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_drag_margin"),_SCS("get_drag_margin"),MARGIN_BOTTOM); + ADD_GROUP("Limit","limit_"); + ADD_PROPERTYI( PropertyInfo(Variant::INT,"limit_left"),_SCS("set_limit"),_SCS("get_limit"),MARGIN_LEFT); + ADD_PROPERTYI( PropertyInfo(Variant::INT,"limit_top"),_SCS("set_limit"),_SCS("get_limit"),MARGIN_TOP); + ADD_PROPERTYI( PropertyInfo(Variant::INT,"limit_right"),_SCS("set_limit"),_SCS("get_limit"),MARGIN_RIGHT); + ADD_PROPERTYI( PropertyInfo(Variant::INT,"limit_bottom"),_SCS("set_limit"),_SCS("get_limit"),MARGIN_BOTTOM); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"limit_smoothed"),_SCS("set_limit_smoothing_enabled"),_SCS("is_limit_smoothing_enabled") ); + + ADD_GROUP("Draw Margin","draw_margin_"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"drag_margin_h_enabled"),_SCS("set_h_drag_enabled"),_SCS("is_h_drag_enabled") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"drag_margin_v_enabled"),_SCS("set_v_drag_enabled"),_SCS("is_v_drag_enabled") ); + + ADD_GROUP("Smoothing","smoothing_"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"smoothing_enabled"),_SCS("set_enable_follow_smoothing"),_SCS("is_follow_smoothing_enabled") ); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"smoothing_speed"),_SCS("set_follow_smoothing"),_SCS("get_follow_smoothing") ); + + ADD_GROUP("Drag Margin","drag_margin_"); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"drag_margin_left",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_drag_margin"),_SCS("get_drag_margin"),MARGIN_LEFT); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"drag_margin_top",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_drag_margin"),_SCS("get_drag_margin"),MARGIN_TOP); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"drag_margin_right",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_drag_margin"),_SCS("get_drag_margin"),MARGIN_RIGHT); + ADD_PROPERTYI( PropertyInfo(Variant::REAL,"drag_margin_bottom",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_drag_margin"),_SCS("get_drag_margin"),MARGIN_BOTTOM); BIND_CONSTANT( ANCHOR_MODE_DRAG_CENTER ); diff --git a/scene/2d/camera_2d.h b/scene/2d/camera_2d.h index a4d6dc5b96..85d90b225a 100644 --- a/scene/2d/camera_2d.h +++ b/scene/2d/camera_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class Camera2D : public Node2D { - OBJ_TYPE( Camera2D, Node2D ); + GDCLASS( Camera2D, Node2D ); public: enum AnchorMode { @@ -80,7 +80,7 @@ protected: void _set_old_smoothing(float p_enable); protected: - virtual Matrix32 get_camera_transform(); + virtual Transform2D get_camera_transform(); void _notification(int p_what); static void _bind_methods(); public: diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index ed1d606ba8..b7d9ba7860 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -42,9 +42,6 @@ bool CanvasItemMaterial::_set(const StringName& p_name, const Variant& p_value) if (p_name==SceneStringNames::get_singleton()->shader_shader) { set_shader(p_value); return true; - } else if (p_name==SceneStringNames::get_singleton()->shading_mode) { - set_shading_mode(ShadingMode(p_value.operator int())); - return true; } else { if (shader.is_valid()) { @@ -58,7 +55,7 @@ bool CanvasItemMaterial::_set(const StringName& p_name, const Variant& p_value) } } if (pr) { - VisualServer::get_singleton()->canvas_item_material_set_shader_param(material,pr,p_value); + VisualServer::get_singleton()->material_set_param(_get_material(),pr,p_value); return true; } } @@ -74,18 +71,14 @@ bool CanvasItemMaterial::_get(const StringName& p_name,Variant &r_ret) const { r_ret=get_shader(); return true; - } else if (p_name==SceneStringNames::get_singleton()->shading_mode) { - - r_ret=shading_mode; - return true; } else { if (shader.is_valid()) { StringName pr = shader->remap_param(p_name); if (pr) { - r_ret=VisualServer::get_singleton()->canvas_item_material_get_shader_param(material,pr); + r_ret=VisualServer::get_singleton()->material_get_param(_get_material(),pr); return true; } } @@ -100,7 +93,6 @@ bool CanvasItemMaterial::_get(const StringName& p_name,Variant &r_ret) const { void CanvasItemMaterial::_get_property_list( List<PropertyInfo> *p_list) const { p_list->push_back( PropertyInfo( Variant::OBJECT, "shader/shader", PROPERTY_HINT_RESOURCE_TYPE,"CanvasItemShader,CanvasItemShaderGraph" ) ); - p_list->push_back( PropertyInfo( Variant::INT, "shader/shading_mode",PROPERTY_HINT_ENUM,"Normal,Unshaded,Light Only") ); if (!shader.is_null()) { @@ -119,7 +111,7 @@ void CanvasItemMaterial::set_shader(const Ref<Shader>& p_shader) { if (shader.is_valid()) rid=shader->get_rid(); - VS::get_singleton()->canvas_item_material_set_shader(material,rid); + VS::get_singleton()->material_set_shader(_get_material(),rid); _change_notify(); //properties for shader exposed emit_changed(); } @@ -131,42 +123,23 @@ Ref<Shader> CanvasItemMaterial::get_shader() const{ void CanvasItemMaterial::set_shader_param(const StringName& p_param,const Variant& p_value){ - VS::get_singleton()->canvas_item_material_set_shader_param(material,p_param,p_value); + VS::get_singleton()->material_set_param(_get_material(),p_param,p_value); } Variant CanvasItemMaterial::get_shader_param(const StringName& p_param) const{ - return VS::get_singleton()->canvas_item_material_get_shader_param(material,p_param); -} - -RID CanvasItemMaterial::get_rid() const { - - return material; -} - -void CanvasItemMaterial::set_shading_mode(ShadingMode p_mode) { - - shading_mode=p_mode; - VS::get_singleton()->canvas_item_material_set_shading_mode(material,VS::CanvasItemShadingMode(p_mode)); + return VS::get_singleton()->material_get_param(_get_material(),p_param); } -CanvasItemMaterial::ShadingMode CanvasItemMaterial::get_shading_mode() const { - return shading_mode; -} void CanvasItemMaterial::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_shader","shader:Shader"),&CanvasItemMaterial::set_shader); - ObjectTypeDB::bind_method(_MD("get_shader:Shader"),&CanvasItemMaterial::get_shader); - ObjectTypeDB::bind_method(_MD("set_shader_param","param","value"),&CanvasItemMaterial::set_shader_param); - ObjectTypeDB::bind_method(_MD("get_shader_param","param"),&CanvasItemMaterial::get_shader_param); - ObjectTypeDB::bind_method(_MD("set_shading_mode","mode"),&CanvasItemMaterial::set_shading_mode); - ObjectTypeDB::bind_method(_MD("get_shading_mode"),&CanvasItemMaterial::get_shading_mode); + ClassDB::bind_method(_MD("set_shader","shader:Shader"),&CanvasItemMaterial::set_shader); + ClassDB::bind_method(_MD("get_shader:Shader"),&CanvasItemMaterial::get_shader); + ClassDB::bind_method(_MD("set_shader_param","param","value"),&CanvasItemMaterial::set_shader_param); + ClassDB::bind_method(_MD("get_shader_param","param"),&CanvasItemMaterial::get_shader_param); - BIND_CONSTANT( SHADING_NORMAL ); - BIND_CONSTANT( SHADING_UNSHADED ); - BIND_CONSTANT( SHADING_ONLY_LIGHT ); } @@ -189,13 +162,13 @@ void CanvasItemMaterial::get_argument_options(const StringName& p_function,int p CanvasItemMaterial::CanvasItemMaterial() { - material=VS::get_singleton()->canvas_item_material_create(); - shading_mode=SHADING_NORMAL; + + } CanvasItemMaterial::~CanvasItemMaterial(){ - VS::get_singleton()->free(material); + } @@ -261,16 +234,13 @@ void CanvasItem::show() { if (!hidden) return; - hidden=false; VisualServer::get_singleton()->canvas_item_set_visible(canvas_item,true); if (!is_inside_tree()) return; - if (is_visible()) { - _propagate_visibility_changed(true); - } + _propagate_visibility_changed(true); _change_notify("visibility/visible"); } @@ -280,15 +250,13 @@ void CanvasItem::hide() { if (hidden) return; - bool propagate=is_inside_tree() && is_visible(); hidden=true; VisualServer::get_singleton()->canvas_item_set_visible(canvas_item,false); if (!is_inside_tree()) return; - if (propagate) - _propagate_visibility_changed(false); + _propagate_visibility_changed(false); _change_notify("visibility/visible"); } @@ -357,10 +325,10 @@ void CanvasItem::_update_callback() { pending_update=false; // don't change to false until finished drawing (avoid recursive update) } -Matrix32 CanvasItem::get_global_transform_with_canvas() const { +Transform2D CanvasItem::get_global_transform_with_canvas() const { const CanvasItem *ci = this; - Matrix32 xform; + Transform2D xform; const CanvasItem *last_valid=NULL; while(ci) { @@ -374,9 +342,11 @@ Matrix32 CanvasItem::get_global_transform_with_canvas() const { return last_valid->canvas_layer->get_transform() * xform; else if (is_inside_tree()) return get_viewport()->get_canvas_transform() * xform; + + return xform; } -Matrix32 CanvasItem::get_global_transform() const { +Transform2D CanvasItem::get_global_transform() const { if (global_invalid) { @@ -394,42 +364,17 @@ Matrix32 CanvasItem::get_global_transform() const { } - -void CanvasItem::_queue_sort_children() { - - if (pending_children_sort) - return; - - pending_children_sort=true; - MessageQueue::get_singleton()->push_call(this,"_sort_children"); -} - -void CanvasItem::_sort_children() { - - pending_children_sort=false; +void CanvasItem::_toplevel_raise_self() { if (!is_inside_tree()) return; - for(int i=0;i<get_child_count();i++) { - - Node *n = get_child(i); - CanvasItem *ci=n->cast_to<CanvasItem>(); - - if (ci) { - if (ci->toplevel || ci->group!="") - continue; - VisualServer::get_singleton()->canvas_item_raise(n->cast_to<CanvasItem>()->canvas_item); - } - } -} - -void CanvasItem::_raise_self() { + if (canvas_layer) + VisualServer::get_singleton()->canvas_item_set_draw_index(canvas_item,canvas_layer->get_sort_index()); + else + VisualServer::get_singleton()->canvas_item_set_draw_index(canvas_item,get_viewport()->gui_get_canvas_sort_index()); - if (!is_inside_tree()) - return; - VisualServer::get_singleton()->canvas_item_raise(canvas_item); } @@ -461,14 +406,19 @@ void CanvasItem::_enter_canvas() { group = "root_canvas"+itos(canvas.get_id()); add_to_group(group); - get_tree()->call_group(SceneTree::GROUP_CALL_UNIQUE,group,"_raise_self"); + if (canvas_layer) + canvas_layer->reset_sort_index(); + else + get_viewport()->gui_reset_canvas_sort_index(); + + get_tree()->call_group(SceneTree::GROUP_CALL_UNIQUE,group,"_toplevel_raise_self"); } else { CanvasItem *parent = get_parent_item(); canvas_layer=parent->canvas_layer; VisualServer::get_singleton()->canvas_item_set_parent(canvas_item,parent->get_canvas_item()); - parent->_queue_sort_children(); + VisualServer::get_singleton()->canvas_item_set_draw_index(canvas_item,get_index()); } pending_update=false; @@ -495,7 +445,6 @@ void CanvasItem::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { first_draw=true; - pending_children_sort=false; if (get_parent()) { CanvasItem *ci = get_parent()->cast_to<CanvasItem>(); if (ci) @@ -508,13 +457,15 @@ void CanvasItem::_notification(int p_what) { } break; case NOTIFICATION_MOVED_IN_PARENT: { + if (!is_inside_tree()) + break; if (group!="") { - get_tree()->call_group(SceneTree::GROUP_CALL_UNIQUE,group,"_raise_self"); + get_tree()->call_group(SceneTree::GROUP_CALL_UNIQUE,group,"_toplevel_raise_self"); } else { CanvasItem *p = get_parent_item(); ERR_FAIL_COND(!p); - p->_queue_sort_children(); + VisualServer::get_singleton()->canvas_item_set_draw_index(canvas_item,get_index()); } @@ -569,15 +520,15 @@ void CanvasItem::update() { MessageQueue::get_singleton()->push_call(this,"_update_callback"); } -void CanvasItem::set_opacity(float p_opacity) { +void CanvasItem::set_modulate(const Color& p_modulate) { - opacity=p_opacity; - VisualServer::get_singleton()->canvas_item_set_opacity(canvas_item,opacity); + modulate=p_modulate; + VisualServer::get_singleton()->canvas_item_set_modulate(canvas_item,modulate); } -float CanvasItem::get_opacity() const { +Color CanvasItem::get_modulate() const { - return opacity; + return modulate; } @@ -614,29 +565,17 @@ CanvasItem *CanvasItem::get_parent_item() const { } -void CanvasItem::set_self_opacity(float p_self_opacity) { +void CanvasItem::set_self_modulate(const Color& p_self_modulate) { - self_opacity=p_self_opacity; - VisualServer::get_singleton()->canvas_item_set_self_opacity(canvas_item,self_opacity); + self_modulate=p_self_modulate; + VisualServer::get_singleton()->canvas_item_set_self_modulate(canvas_item,self_modulate); } -float CanvasItem::get_self_opacity() const { +Color CanvasItem::get_self_modulate() const { - return self_opacity; + return self_modulate; } -void CanvasItem::set_blend_mode(BlendMode p_blend_mode) { - - ERR_FAIL_INDEX(p_blend_mode,5); - blend_mode=p_blend_mode; - VisualServer::get_singleton()->canvas_item_set_blend_mode(canvas_item,VS::MaterialBlendMode(blend_mode)); - -} - -CanvasItem::BlendMode CanvasItem::get_blend_mode() const { - - return blend_mode; -} void CanvasItem::set_light_mask(int p_light_mask) { @@ -752,12 +691,12 @@ void CanvasItem::draw_set_transform(const Point2& p_offset, float p_rot, const S ERR_FAIL(); } - Matrix32 xform(p_rot,p_offset); + Transform2D xform(p_rot,p_offset); xform.scale_basis(p_scale); VisualServer::get_singleton()->canvas_item_add_set_transform(canvas_item,xform); } -void CanvasItem::draw_set_transform_matrix(const Matrix32& p_matrix) { +void CanvasItem::draw_set_transform_matrix(const Transform2D& p_matrix) { if (!drawing) { ERR_EXPLAIN("Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal."); @@ -913,7 +852,7 @@ void CanvasItem::set_draw_behind_parent(bool p_enable) { if (behind==p_enable) return; behind=p_enable; - VisualServer::get_singleton()->canvas_item_set_on_top(canvas_item,!behind); + VisualServer::get_singleton()->canvas_item_set_draw_behind_parent(canvas_item,behind); } @@ -953,7 +892,7 @@ Vector2 CanvasItem::make_canvas_pos_local(const Vector2& screen_point) const { ERR_FAIL_COND_V(!is_inside_tree(),screen_point); - Matrix32 local_matrix = (get_canvas_transform() * + Transform2D local_matrix = (get_canvas_transform() * get_global_transform()).affine_inverse(); return local_matrix.xform(screen_point); @@ -983,101 +922,98 @@ Vector2 CanvasItem::get_local_mouse_pos() const{ void CanvasItem::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_sort_children"),&CanvasItem::_sort_children); - ObjectTypeDB::bind_method(_MD("_raise_self"),&CanvasItem::_raise_self); - ObjectTypeDB::bind_method(_MD("_update_callback"),&CanvasItem::_update_callback); - ObjectTypeDB::bind_method(_MD("_set_visible_"),&CanvasItem::_set_visible_); - ObjectTypeDB::bind_method(_MD("_is_visible_"),&CanvasItem::_is_visible_); - - ObjectTypeDB::bind_method(_MD("edit_set_state","state"),&CanvasItem::edit_set_state); - ObjectTypeDB::bind_method(_MD("edit_get_state:Variant"),&CanvasItem::edit_get_state); - ObjectTypeDB::bind_method(_MD("edit_set_rect","rect"),&CanvasItem::edit_set_rect); - ObjectTypeDB::bind_method(_MD("edit_rotate","degrees"),&CanvasItem::edit_rotate); - - ObjectTypeDB::bind_method(_MD("get_item_rect"),&CanvasItem::get_item_rect); - ObjectTypeDB::bind_method(_MD("get_item_and_children_rect"),&CanvasItem::get_item_and_children_rect); - //ObjectTypeDB::bind_method(_MD("get_transform"),&CanvasItem::get_transform); - - ObjectTypeDB::bind_method(_MD("get_canvas_item"),&CanvasItem::get_canvas_item); - - ObjectTypeDB::bind_method(_MD("is_visible"),&CanvasItem::is_visible); - ObjectTypeDB::bind_method(_MD("is_hidden"),&CanvasItem::is_hidden); - ObjectTypeDB::bind_method(_MD("show"),&CanvasItem::show); - ObjectTypeDB::bind_method(_MD("hide"),&CanvasItem::hide); - ObjectTypeDB::bind_method(_MD("set_hidden","hidden"),&CanvasItem::set_hidden); - - ObjectTypeDB::bind_method(_MD("update"),&CanvasItem::update); - - ObjectTypeDB::bind_method(_MD("set_as_toplevel","enable"),&CanvasItem::set_as_toplevel); - ObjectTypeDB::bind_method(_MD("is_set_as_toplevel"),&CanvasItem::is_set_as_toplevel); - - ObjectTypeDB::bind_method(_MD("set_blend_mode","blend_mode"),&CanvasItem::set_blend_mode); - ObjectTypeDB::bind_method(_MD("get_blend_mode"),&CanvasItem::get_blend_mode); - - ObjectTypeDB::bind_method(_MD("set_light_mask","light_mask"),&CanvasItem::set_light_mask); - ObjectTypeDB::bind_method(_MD("get_light_mask"),&CanvasItem::get_light_mask); - - ObjectTypeDB::bind_method(_MD("set_opacity","opacity"),&CanvasItem::set_opacity); - ObjectTypeDB::bind_method(_MD("get_opacity"),&CanvasItem::get_opacity); - ObjectTypeDB::bind_method(_MD("set_self_opacity","self_opacity"),&CanvasItem::set_self_opacity); - ObjectTypeDB::bind_method(_MD("get_self_opacity"),&CanvasItem::get_self_opacity); - - ObjectTypeDB::bind_method(_MD("set_draw_behind_parent","enable"),&CanvasItem::set_draw_behind_parent); - ObjectTypeDB::bind_method(_MD("is_draw_behind_parent_enabled"),&CanvasItem::is_draw_behind_parent_enabled); - - ObjectTypeDB::bind_method(_MD("_set_on_top","on_top"),&CanvasItem::_set_on_top); - ObjectTypeDB::bind_method(_MD("_is_on_top"),&CanvasItem::_is_on_top); - //ObjectTypeDB::bind_method(_MD("get_transform"),&CanvasItem::get_transform); - - ObjectTypeDB::bind_method(_MD("draw_line","from","to","color","width","antialiased"),&CanvasItem::draw_line,DEFVAL(1.0),DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("draw_rect","rect","color"),&CanvasItem::draw_rect); - ObjectTypeDB::bind_method(_MD("draw_circle","pos","radius","color"),&CanvasItem::draw_circle); - ObjectTypeDB::bind_method(_MD("draw_texture","texture:Texture","pos","modulate"),&CanvasItem::draw_texture,DEFVAL(Color(1,1,1,1))); - ObjectTypeDB::bind_method(_MD("draw_texture_rect","texture:Texture","rect","tile","modulate","transpose"),&CanvasItem::draw_texture_rect,DEFVAL(Color(1,1,1)),DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("draw_texture_rect_region","texture:Texture","rect","src_rect","modulate","transpose"),&CanvasItem::draw_texture_rect_region,DEFVAL(Color(1,1,1)),DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("draw_style_box","style_box:StyleBox","rect"),&CanvasItem::draw_style_box); - ObjectTypeDB::bind_method(_MD("draw_primitive","points","colors","uvs","texture:Texture","width"),&CanvasItem::draw_primitive,DEFVAL(Variant()),DEFVAL(1.0)); - ObjectTypeDB::bind_method(_MD("draw_polygon","points","colors","uvs","texture:Texture"),&CanvasItem::draw_polygon,DEFVAL(Vector2Array()),DEFVAL(Variant())); - ObjectTypeDB::bind_method(_MD("draw_colored_polygon","points","color","uvs","texture:Texture"),&CanvasItem::draw_colored_polygon,DEFVAL(Vector2Array()),DEFVAL(Variant())); - ObjectTypeDB::bind_method(_MD("draw_string","font:Font","pos","text","modulate","clip_w"),&CanvasItem::draw_string,DEFVAL(Color(1,1,1)),DEFVAL(-1)); - ObjectTypeDB::bind_method(_MD("draw_char","font:Font","pos","char","next","modulate"),&CanvasItem::draw_char,DEFVAL(Color(1,1,1))); - - ObjectTypeDB::bind_method(_MD("draw_set_transform","pos","rot","scale"),&CanvasItem::draw_set_transform); - ObjectTypeDB::bind_method(_MD("draw_set_transform_matrix","xform"),&CanvasItem::draw_set_transform_matrix); - ObjectTypeDB::bind_method(_MD("get_transform"),&CanvasItem::get_transform); - ObjectTypeDB::bind_method(_MD("get_global_transform"),&CanvasItem::get_global_transform); - ObjectTypeDB::bind_method(_MD("get_global_transform_with_canvas"),&CanvasItem::get_global_transform_with_canvas); - ObjectTypeDB::bind_method(_MD("get_viewport_transform"),&CanvasItem::get_viewport_transform); - ObjectTypeDB::bind_method(_MD("get_viewport_rect"),&CanvasItem::get_viewport_rect); - ObjectTypeDB::bind_method(_MD("get_canvas_transform"),&CanvasItem::get_canvas_transform); - ObjectTypeDB::bind_method(_MD("get_local_mouse_pos"),&CanvasItem::get_local_mouse_pos); - ObjectTypeDB::bind_method(_MD("get_global_mouse_pos"),&CanvasItem::get_global_mouse_pos); - ObjectTypeDB::bind_method(_MD("get_canvas"),&CanvasItem::get_canvas); - ObjectTypeDB::bind_method(_MD("get_world_2d"),&CanvasItem::get_world_2d); - //ObjectTypeDB::bind_method(_MD("get_viewport"),&CanvasItem::get_viewport); - - ObjectTypeDB::bind_method(_MD("set_material","material:CanvasItemMaterial"),&CanvasItem::set_material); - ObjectTypeDB::bind_method(_MD("get_material:CanvasItemMaterial"),&CanvasItem::get_material); - - ObjectTypeDB::bind_method(_MD("set_use_parent_material","enable"),&CanvasItem::set_use_parent_material); - ObjectTypeDB::bind_method(_MD("get_use_parent_material"),&CanvasItem::get_use_parent_material); - - ObjectTypeDB::bind_method(_MD("make_canvas_pos_local","screen_point"), + ClassDB::bind_method(_MD("_toplevel_raise_self"),&CanvasItem::_toplevel_raise_self); + ClassDB::bind_method(_MD("_update_callback"),&CanvasItem::_update_callback); + ClassDB::bind_method(_MD("_set_visible_"),&CanvasItem::_set_visible_); + ClassDB::bind_method(_MD("_is_visible_"),&CanvasItem::_is_visible_); + + ClassDB::bind_method(_MD("edit_set_state","state"),&CanvasItem::edit_set_state); + ClassDB::bind_method(_MD("edit_get_state:Variant"),&CanvasItem::edit_get_state); + ClassDB::bind_method(_MD("edit_set_rect","rect"),&CanvasItem::edit_set_rect); + ClassDB::bind_method(_MD("edit_rotate","degrees"),&CanvasItem::edit_rotate); + + ClassDB::bind_method(_MD("get_item_rect"),&CanvasItem::get_item_rect); + ClassDB::bind_method(_MD("get_item_and_children_rect"),&CanvasItem::get_item_and_children_rect); + //ClassDB::bind_method(_MD("get_transform"),&CanvasItem::get_transform); + + ClassDB::bind_method(_MD("get_canvas_item"),&CanvasItem::get_canvas_item); + + ClassDB::bind_method(_MD("is_visible"),&CanvasItem::is_visible); + ClassDB::bind_method(_MD("is_hidden"),&CanvasItem::is_hidden); + ClassDB::bind_method(_MD("show"),&CanvasItem::show); + ClassDB::bind_method(_MD("hide"),&CanvasItem::hide); + ClassDB::bind_method(_MD("set_hidden","hidden"),&CanvasItem::set_hidden); + + ClassDB::bind_method(_MD("update"),&CanvasItem::update); + + ClassDB::bind_method(_MD("set_as_toplevel","enable"),&CanvasItem::set_as_toplevel); + ClassDB::bind_method(_MD("is_set_as_toplevel"),&CanvasItem::is_set_as_toplevel); + + ClassDB::bind_method(_MD("set_light_mask","light_mask"),&CanvasItem::set_light_mask); + ClassDB::bind_method(_MD("get_light_mask"),&CanvasItem::get_light_mask); + + ClassDB::bind_method(_MD("set_modulate","modulate"),&CanvasItem::set_modulate); + ClassDB::bind_method(_MD("get_modulate"),&CanvasItem::get_modulate); + ClassDB::bind_method(_MD("set_self_modulate","self_modulate"),&CanvasItem::set_self_modulate); + ClassDB::bind_method(_MD("get_self_modulate"),&CanvasItem::get_self_modulate); + + ClassDB::bind_method(_MD("set_draw_behind_parent","enable"),&CanvasItem::set_draw_behind_parent); + ClassDB::bind_method(_MD("is_draw_behind_parent_enabled"),&CanvasItem::is_draw_behind_parent_enabled); + + ClassDB::bind_method(_MD("_set_on_top","on_top"),&CanvasItem::_set_on_top); + ClassDB::bind_method(_MD("_is_on_top"),&CanvasItem::_is_on_top); + //ClassDB::bind_method(_MD("get_transform"),&CanvasItem::get_transform); + + ClassDB::bind_method(_MD("draw_line","from","to","color","width","antialiased"),&CanvasItem::draw_line,DEFVAL(1.0),DEFVAL(false)); + ClassDB::bind_method(_MD("draw_rect","rect","color"),&CanvasItem::draw_rect); + ClassDB::bind_method(_MD("draw_circle","pos","radius","color"),&CanvasItem::draw_circle); + ClassDB::bind_method(_MD("draw_texture","texture:Texture","pos","modulate"),&CanvasItem::draw_texture,DEFVAL(Color(1,1,1,1))); + ClassDB::bind_method(_MD("draw_texture_rect","texture:Texture","rect","tile","modulate","transpose"),&CanvasItem::draw_texture_rect,DEFVAL(Color(1,1,1)),DEFVAL(false)); + ClassDB::bind_method(_MD("draw_texture_rect_region","texture:Texture","rect","src_rect","modulate","transpose"),&CanvasItem::draw_texture_rect_region,DEFVAL(Color(1,1,1)),DEFVAL(false)); + ClassDB::bind_method(_MD("draw_style_box","style_box:StyleBox","rect"),&CanvasItem::draw_style_box); + ClassDB::bind_method(_MD("draw_primitive","points","colors","uvs","texture:Texture","width"),&CanvasItem::draw_primitive,DEFVAL(Variant()),DEFVAL(1.0)); + ClassDB::bind_method(_MD("draw_polygon","points","colors","uvs","texture:Texture"),&CanvasItem::draw_polygon,DEFVAL(PoolVector2Array()),DEFVAL(Variant())); + ClassDB::bind_method(_MD("draw_colored_polygon","points","color","uvs","texture:Texture"),&CanvasItem::draw_colored_polygon,DEFVAL(PoolVector2Array()),DEFVAL(Variant())); + ClassDB::bind_method(_MD("draw_string","font:Font","pos","text","modulate","clip_w"),&CanvasItem::draw_string,DEFVAL(Color(1,1,1)),DEFVAL(-1)); + ClassDB::bind_method(_MD("draw_char","font:Font","pos","char","next","modulate"),&CanvasItem::draw_char,DEFVAL(Color(1,1,1))); + + ClassDB::bind_method(_MD("draw_set_transform","pos","rot","scale"),&CanvasItem::draw_set_transform); + ClassDB::bind_method(_MD("draw_set_transform_matrix","xform"),&CanvasItem::draw_set_transform_matrix); + ClassDB::bind_method(_MD("get_transform"),&CanvasItem::get_transform); + ClassDB::bind_method(_MD("get_global_transform"),&CanvasItem::get_global_transform); + ClassDB::bind_method(_MD("get_global_transform_with_canvas"),&CanvasItem::get_global_transform_with_canvas); + ClassDB::bind_method(_MD("get_viewport_transform"),&CanvasItem::get_viewport_transform); + ClassDB::bind_method(_MD("get_viewport_rect"),&CanvasItem::get_viewport_rect); + ClassDB::bind_method(_MD("get_canvas_transform"),&CanvasItem::get_canvas_transform); + ClassDB::bind_method(_MD("get_local_mouse_pos"),&CanvasItem::get_local_mouse_pos); + ClassDB::bind_method(_MD("get_global_mouse_pos"),&CanvasItem::get_global_mouse_pos); + ClassDB::bind_method(_MD("get_canvas"),&CanvasItem::get_canvas); + ClassDB::bind_method(_MD("get_world_2d"),&CanvasItem::get_world_2d); + //ClassDB::bind_method(_MD("get_viewport"),&CanvasItem::get_viewport); + + ClassDB::bind_method(_MD("set_material","material:CanvasItemMaterial"),&CanvasItem::set_material); + ClassDB::bind_method(_MD("get_material:CanvasItemMaterial"),&CanvasItem::get_material); + + ClassDB::bind_method(_MD("set_use_parent_material","enable"),&CanvasItem::set_use_parent_material); + ClassDB::bind_method(_MD("get_use_parent_material"),&CanvasItem::get_use_parent_material); + + ClassDB::bind_method(_MD("make_canvas_pos_local","screen_point"), &CanvasItem::make_canvas_pos_local); - ObjectTypeDB::bind_method(_MD("make_input_local","event"),&CanvasItem::make_input_local); + ClassDB::bind_method(_MD("make_input_local","event"),&CanvasItem::make_input_local); BIND_VMETHOD(MethodInfo("_draw")); - ADD_PROPERTYNO( PropertyInfo(Variant::BOOL,"visibility/visible"), _SCS("_set_visible_"),_SCS("_is_visible_") ); - ADD_PROPERTYNO( PropertyInfo(Variant::REAL,"visibility/opacity",PROPERTY_HINT_RANGE, "0,1,0.01"), _SCS("set_opacity"),_SCS("get_opacity") ); - ADD_PROPERTYNO( PropertyInfo(Variant::REAL,"visibility/self_opacity",PROPERTY_HINT_RANGE, "0,1,0.01"), _SCS("set_self_opacity"),_SCS("get_self_opacity") ); - ADD_PROPERTYNZ( PropertyInfo(Variant::BOOL,"visibility/behind_parent"), _SCS("set_draw_behind_parent"),_SCS("is_draw_behind_parent_enabled") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"visibility/on_top",PROPERTY_HINT_NONE,"",0), _SCS("_set_on_top"),_SCS("_is_on_top") ); //compatibility - - ADD_PROPERTYNZ( PropertyInfo(Variant::INT,"visibility/blend_mode",PROPERTY_HINT_ENUM, "Mix,Add,Sub,Mul,PMAlpha"), _SCS("set_blend_mode"),_SCS("get_blend_mode") ); - ADD_PROPERTYNO( PropertyInfo(Variant::INT,"visibility/light_mask",PROPERTY_HINT_ALL_FLAGS), _SCS("set_light_mask"),_SCS("get_light_mask") ); - ADD_PROPERTYNZ( PropertyInfo(Variant::OBJECT,"material/material",PROPERTY_HINT_RESOURCE_TYPE, "CanvasItemMaterial"), _SCS("set_material"),_SCS("get_material") ); - ADD_PROPERTYNZ( PropertyInfo(Variant::BOOL,"material/use_parent"), _SCS("set_use_parent_material"),_SCS("get_use_parent_material") ); + ADD_GROUP("Visibility",""); + ADD_PROPERTYNO( PropertyInfo(Variant::BOOL,"visible"), _SCS("_set_visible_"),_SCS("_is_visible_") ); + ADD_PROPERTYNO( PropertyInfo(Variant::COLOR,"modulate"), _SCS("set_modulate"),_SCS("get_modulate") ); + ADD_PROPERTYNO( PropertyInfo(Variant::COLOR,"self_modulate"), _SCS("set_self_modulate"),_SCS("get_self_modulate") ); + ADD_PROPERTYNZ( PropertyInfo(Variant::BOOL,"show_behind_parent"), _SCS("set_draw_behind_parent"),_SCS("is_draw_behind_parent_enabled") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"show_on_top",PROPERTY_HINT_NONE,"",0), _SCS("_set_on_top"),_SCS("_is_on_top") ); //compatibility + ADD_PROPERTYNO( PropertyInfo(Variant::INT,"light_mask",PROPERTY_HINT_LAYERS_2D_RENDER), _SCS("set_light_mask"),_SCS("get_light_mask") ); + + ADD_GROUP("Material",""); + ADD_PROPERTYNZ( PropertyInfo(Variant::OBJECT,"material",PROPERTY_HINT_RESOURCE_TYPE, "CanvasItemMaterial"), _SCS("set_material"),_SCS("get_material") ); + ADD_PROPERTYNZ( PropertyInfo(Variant::BOOL,"use_parent_material"), _SCS("set_use_parent_material"),_SCS("get_use_parent_material") ); //exporting these two things doesn't really make much sense i think //ADD_PROPERTY( PropertyInfo(Variant::BOOL,"transform/toplevel"), _SCS("set_as_toplevel"),_SCS("is_set_as_toplevel") ); //ADD_PROPERTY(PropertyInfo(Variant::BOOL,"transform/notify"),_SCS("set_transform_notify"),_SCS("is_transform_notify_enabled")); @@ -1105,9 +1041,9 @@ void CanvasItem::_bind_methods() { } -Matrix32 CanvasItem::get_canvas_transform() const { +Transform2D CanvasItem::get_canvas_transform() const { - ERR_FAIL_COND_V(!is_inside_tree(),Matrix32()); + ERR_FAIL_COND_V(!is_inside_tree(),Transform2D()); if (canvas_layer) return canvas_layer->get_transform(); @@ -1118,9 +1054,9 @@ Matrix32 CanvasItem::get_canvas_transform() const { } -Matrix32 CanvasItem::get_viewport_transform() const { +Transform2D CanvasItem::get_viewport_transform() const { - ERR_FAIL_COND_V(!is_inside_tree(),Matrix32()); + ERR_FAIL_COND_V(!is_inside_tree(),Transform2D()); if (canvas_layer) { @@ -1176,12 +1112,10 @@ CanvasItem::CanvasItem() : xform_change(this) { canvas_item=VisualServer::get_singleton()->canvas_item_create(); hidden=false; pending_update=false; - opacity=1; - self_opacity=1; + modulate=Color(1,1,1,1); + self_modulate=Color(1,1,1,1); toplevel=false; - pending_children_sort=false; first_draw=false; - blend_mode=BLEND_MODE_MIX; drawing=false; behind=false; block_transform_notify=false; diff --git a/scene/2d/canvas_item.h b/scene/2d/canvas_item.h index 7849a66185..fded547275 100644 --- a/scene/2d/canvas_item.h +++ b/scene/2d/canvas_item.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,6 +33,7 @@ #include "scene/resources/texture.h" #include "scene/main/scene_main_loop.h" #include "scene/resources/shader.h" +#include "scene/resources/material.h" class CanvasLayer; class Viewport; @@ -40,22 +41,18 @@ class Font; class StyleBox; -class CanvasItemMaterial : public Resource{ +class CanvasItemMaterial : public Material { - OBJ_TYPE(CanvasItemMaterial,Resource); - RID material; + GDCLASS(CanvasItemMaterial,Material); Ref<Shader> shader; public: - enum ShadingMode { + /*enum ShadingMode { SHADING_NORMAL, SHADING_UNSHADED, SHADING_ONLY_LIGHT, - }; + };*/ protected: - - ShadingMode shading_mode; - bool _set(const StringName& p_name, const Variant& p_value); bool _get(const StringName& p_name,Variant &r_ret) const; void _get_property_list( List<PropertyInfo> *p_list) const; @@ -72,20 +69,16 @@ public: void set_shader_param(const StringName& p_param,const Variant& p_value); Variant get_shader_param(const StringName& p_param) const; - void set_shading_mode(ShadingMode p_mode); - ShadingMode get_shading_mode() const; - - virtual RID get_rid() const; CanvasItemMaterial(); ~CanvasItemMaterial(); }; -VARIANT_ENUM_CAST( CanvasItemMaterial::ShadingMode ); + class CanvasItem : public Node { - OBJ_TYPE( CanvasItem, Node ); + GDCLASS( CanvasItem, Node ); public: enum BlendMode { @@ -107,20 +100,18 @@ private: CanvasLayer *canvas_layer; - float opacity; - float self_opacity; + Color modulate; + Color self_modulate; List<CanvasItem*> children_items; List<CanvasItem*>::Element *C; - BlendMode blend_mode; int light_mask; bool first_draw; bool hidden; bool pending_update; bool toplevel; - bool pending_children_sort; bool drawing; bool block_transform_notify; bool behind; @@ -129,11 +120,11 @@ private: Ref<CanvasItemMaterial> material; - mutable Matrix32 global_transform; + mutable Transform2D global_transform; mutable bool global_invalid; - void _raise_self(); + void _toplevel_raise_self(); void _propagate_visibility_changed(bool p_visible); @@ -145,9 +136,6 @@ private: void _enter_canvas(); void _exit_canvas(); - void _queue_sort_children(); - void _sort_children(); - void _notify_transform(CanvasItem *p_node); void _set_on_top(bool p_on_top) { set_draw_behind_parent(!p_on_top); } @@ -193,17 +181,14 @@ public: void update(); - void set_blend_mode(BlendMode p_blend_mode); - BlendMode get_blend_mode() const; - virtual void set_light_mask(int p_light_mask); int get_light_mask() const; - void set_opacity(float p_opacity); - float get_opacity() const; + void set_modulate(const Color& p_modulate); + Color get_modulate() const; - void set_self_opacity(float p_self_opacity); - float get_self_opacity() const; + void set_self_modulate(const Color& p_self_modulate); + Color get_self_modulate() const; /* DRAWING API */ @@ -222,7 +207,7 @@ public: float draw_char(const Ref<Font>& p_font,const Point2& p_pos, const String& p_char,const String& p_next="",const Color& p_modulate=Color(1,1,1)); void draw_set_transform(const Point2& p_offset, float p_rot, const Size2& p_scale); - void draw_set_transform_matrix(const Matrix32& p_matrix); + void draw_set_transform_matrix(const Transform2D& p_matrix); /* RECT / TRANSFORM */ @@ -235,10 +220,10 @@ public: CanvasItem *get_parent_item() const; virtual Rect2 get_item_rect() const=0; - virtual Matrix32 get_transform() const=0; + virtual Transform2D get_transform() const=0; - virtual Matrix32 get_global_transform() const; - virtual Matrix32 get_global_transform_with_canvas() const; + virtual Transform2D get_global_transform() const; + virtual Transform2D get_global_transform_with_canvas() const; Rect2 get_item_and_children_rect() const; @@ -249,8 +234,8 @@ public: bool is_block_transform_notify_enabled() const; - Matrix32 get_canvas_transform() const; - Matrix32 get_viewport_transform() const; + Transform2D get_canvas_transform() const; + Transform2D get_viewport_transform() const; Rect2 get_viewport_rect() const; RID get_viewport_rid() const; RID get_canvas() const; diff --git a/scene/2d/canvas_modulate.cpp b/scene/2d/canvas_modulate.cpp index e4a0500123..583f03eab1 100644 --- a/scene/2d/canvas_modulate.cpp +++ b/scene/2d/canvas_modulate.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -62,8 +62,8 @@ void CanvasModulate::_notification(int p_what) { void CanvasModulate::_bind_methods(){ - ObjectTypeDB::bind_method(_MD("set_color","color"),&CanvasModulate::set_color); - ObjectTypeDB::bind_method(_MD("get_color"),&CanvasModulate::get_color); + ClassDB::bind_method(_MD("set_color","color"),&CanvasModulate::set_color); + ClassDB::bind_method(_MD("get_color"),&CanvasModulate::get_color); ADD_PROPERTY(PropertyInfo(Variant::COLOR,"color"),_SCS("set_color"),_SCS("get_color")); } diff --git a/scene/2d/canvas_modulate.h b/scene/2d/canvas_modulate.h index ed642c788d..a0bb27b1c5 100644 --- a/scene/2d/canvas_modulate.h +++ b/scene/2d/canvas_modulate.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class CanvasModulate : public Node2D { - OBJ_TYPE(CanvasModulate,Node2D); + GDCLASS(CanvasModulate,Node2D); Color color; protected: diff --git a/scene/2d/collision_object_2d.cpp b/scene/2d/collision_object_2d.cpp index b5a6cc435f..817651f57c 100644 --- a/scene/2d/collision_object_2d.cpp +++ b/scene/2d/collision_object_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -221,20 +221,20 @@ void CollisionObject2D::_update_pickable() { void CollisionObject2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("add_shape","shape:Shape2D","transform"),&CollisionObject2D::add_shape,DEFVAL(Matrix32())); - ObjectTypeDB::bind_method(_MD("get_shape_count"),&CollisionObject2D::get_shape_count); - ObjectTypeDB::bind_method(_MD("set_shape","shape_idx","shape:Shape"),&CollisionObject2D::set_shape); - ObjectTypeDB::bind_method(_MD("set_shape_transform","shape_idx","transform"),&CollisionObject2D::set_shape_transform); - ObjectTypeDB::bind_method(_MD("set_shape_as_trigger","shape_idx","enable"),&CollisionObject2D::set_shape_as_trigger); - ObjectTypeDB::bind_method(_MD("get_shape:Shape2D","shape_idx"),&CollisionObject2D::get_shape); - ObjectTypeDB::bind_method(_MD("get_shape_transform","shape_idx"),&CollisionObject2D::get_shape_transform); - ObjectTypeDB::bind_method(_MD("is_shape_set_as_trigger","shape_idx"),&CollisionObject2D::is_shape_set_as_trigger); - ObjectTypeDB::bind_method(_MD("remove_shape","shape_idx"),&CollisionObject2D::remove_shape); - ObjectTypeDB::bind_method(_MD("clear_shapes"),&CollisionObject2D::clear_shapes); - ObjectTypeDB::bind_method(_MD("get_rid"),&CollisionObject2D::get_rid); - - ObjectTypeDB::bind_method(_MD("set_pickable","enabled"),&CollisionObject2D::set_pickable); - ObjectTypeDB::bind_method(_MD("is_pickable"),&CollisionObject2D::is_pickable); + ClassDB::bind_method(_MD("add_shape","shape:Shape2D","transform"),&CollisionObject2D::add_shape,DEFVAL(Transform2D())); + ClassDB::bind_method(_MD("get_shape_count"),&CollisionObject2D::get_shape_count); + ClassDB::bind_method(_MD("set_shape","shape_idx","shape:Shape"),&CollisionObject2D::set_shape); + ClassDB::bind_method(_MD("set_shape_transform","shape_idx","transform"),&CollisionObject2D::set_shape_transform); + ClassDB::bind_method(_MD("set_shape_as_trigger","shape_idx","enable"),&CollisionObject2D::set_shape_as_trigger); + ClassDB::bind_method(_MD("get_shape:Shape2D","shape_idx"),&CollisionObject2D::get_shape); + ClassDB::bind_method(_MD("get_shape_transform","shape_idx"),&CollisionObject2D::get_shape_transform); + ClassDB::bind_method(_MD("is_shape_set_as_trigger","shape_idx"),&CollisionObject2D::is_shape_set_as_trigger); + ClassDB::bind_method(_MD("remove_shape","shape_idx"),&CollisionObject2D::remove_shape); + ClassDB::bind_method(_MD("clear_shapes"),&CollisionObject2D::clear_shapes); + ClassDB::bind_method(_MD("get_rid"),&CollisionObject2D::get_rid); + + ClassDB::bind_method(_MD("set_pickable","enabled"),&CollisionObject2D::set_pickable); + ClassDB::bind_method(_MD("is_pickable"),&CollisionObject2D::is_pickable); BIND_VMETHOD( MethodInfo("_input_event",PropertyInfo(Variant::OBJECT,"viewport"),PropertyInfo(Variant::INPUT_EVENT,"event"),PropertyInfo(Variant::INT,"shape_idx"))); @@ -242,12 +242,14 @@ void CollisionObject2D::_bind_methods() { ADD_SIGNAL( MethodInfo("mouse_enter")); ADD_SIGNAL( MethodInfo("mouse_exit")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"input/pickable"),_SCS("set_pickable"),_SCS("is_pickable")); + ADD_GROUP("Pickable","input_"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"input_pickable"),_SCS("set_pickable"),_SCS("is_pickable")); + ADD_GROUP("",""); } -void CollisionObject2D::add_shape(const Ref<Shape2D>& p_shape, const Matrix32& p_transform) { +void CollisionObject2D::add_shape(const Ref<Shape2D>& p_shape, const Transform2D& p_transform) { ERR_FAIL_COND(p_shape.is_null()); @@ -283,7 +285,7 @@ void CollisionObject2D::set_shape(int p_shape_idx, const Ref<Shape2D>& p_shape) // _update_shapes(); } -void CollisionObject2D::set_shape_transform(int p_shape_idx, const Matrix32& p_transform) { +void CollisionObject2D::set_shape_transform(int p_shape_idx, const Transform2D& p_transform) { ERR_FAIL_INDEX(p_shape_idx,shapes.size()); shapes[p_shape_idx].xform=p_transform; @@ -302,9 +304,9 @@ Ref<Shape2D> CollisionObject2D::get_shape(int p_shape_idx) const { return shapes[p_shape_idx].shape; } -Matrix32 CollisionObject2D::get_shape_transform(int p_shape_idx) const { +Transform2D CollisionObject2D::get_shape_transform(int p_shape_idx) const { - ERR_FAIL_INDEX_V(p_shape_idx,shapes.size(),Matrix32()); + ERR_FAIL_INDEX_V(p_shape_idx,shapes.size(),Transform2D()); return shapes[p_shape_idx].xform; } diff --git a/scene/2d/collision_object_2d.h b/scene/2d/collision_object_2d.h index fc50c5c7cd..429b4fafe6 100644 --- a/scene/2d/collision_object_2d.h +++ b/scene/2d/collision_object_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,14 +34,14 @@ class CollisionObject2D : public Node2D { - OBJ_TYPE( CollisionObject2D, Node2D ); + GDCLASS( CollisionObject2D, Node2D ); bool area; RID rid; bool pickable; struct ShapeData { - Matrix32 xform; + Transform2D xform; Ref<Shape2D> shape; bool trigger; @@ -78,12 +78,12 @@ public: - void add_shape(const Ref<Shape2D>& p_shape, const Matrix32& p_transform=Matrix32()); + void add_shape(const Ref<Shape2D>& p_shape, const Transform2D& p_transform=Transform2D()); int get_shape_count() const; void set_shape(int p_shape_idx, const Ref<Shape2D>& p_shape); - void set_shape_transform(int p_shape_idx, const Matrix32& p_transform); + void set_shape_transform(int p_shape_idx, const Transform2D& p_transform); Ref<Shape2D> get_shape(int p_shape_idx) const; - Matrix32 get_shape_transform(int p_shape_idx) const; + Transform2D get_shape_transform(int p_shape_idx) const; void set_shape_as_trigger(int p_shape_idx, bool p_trigger); bool is_shape_set_as_trigger(int p_shape_idx) const; void remove_shape(int p_shape_idx); diff --git a/scene/2d/collision_polygon_2d.cpp b/scene/2d/collision_polygon_2d.cpp index 544f0e2088..04f096f229 100644 --- a/scene/2d/collision_polygon_2d.cpp +++ b/scene/2d/collision_polygon_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -68,16 +68,16 @@ void CollisionPolygon2D::_add_to_collision_object(Object *p_obj) { Ref<ConcavePolygonShape2D> concave = memnew( ConcavePolygonShape2D ); - DVector<Vector2> segments; + PoolVector<Vector2> segments; segments.resize(polygon.size()*2); - DVector<Vector2>::Write w=segments.write(); + PoolVector<Vector2>::Write w=segments.write(); for(int i=0;i<polygon.size();i++) { w[(i<<1)+0]=polygon[i]; w[(i<<1)+1]=polygon[(i+1)%polygon.size()]; } - w=DVector<Vector2>::Write(); + w=PoolVector<Vector2>::Write(); concave->set_segments(segments); co->add_shape(concave,get_transform()); @@ -313,24 +313,24 @@ String CollisionPolygon2D::get_configuration_warning() const { void CollisionPolygon2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_add_to_collision_object"),&CollisionPolygon2D::_add_to_collision_object); - ObjectTypeDB::bind_method(_MD("set_polygon","polygon"),&CollisionPolygon2D::set_polygon); - ObjectTypeDB::bind_method(_MD("get_polygon"),&CollisionPolygon2D::get_polygon); + ClassDB::bind_method(_MD("_add_to_collision_object"),&CollisionPolygon2D::_add_to_collision_object); + ClassDB::bind_method(_MD("set_polygon","polygon"),&CollisionPolygon2D::set_polygon); + ClassDB::bind_method(_MD("get_polygon"),&CollisionPolygon2D::get_polygon); - ObjectTypeDB::bind_method(_MD("set_build_mode","build_mode"),&CollisionPolygon2D::set_build_mode); - ObjectTypeDB::bind_method(_MD("get_build_mode"),&CollisionPolygon2D::get_build_mode); + ClassDB::bind_method(_MD("set_build_mode","build_mode"),&CollisionPolygon2D::set_build_mode); + ClassDB::bind_method(_MD("get_build_mode"),&CollisionPolygon2D::get_build_mode); - ObjectTypeDB::bind_method(_MD("set_trigger","trigger"),&CollisionPolygon2D::set_trigger); - ObjectTypeDB::bind_method(_MD("is_trigger"),&CollisionPolygon2D::is_trigger); + ClassDB::bind_method(_MD("set_trigger","trigger"),&CollisionPolygon2D::set_trigger); + ClassDB::bind_method(_MD("is_trigger"),&CollisionPolygon2D::is_trigger); - ObjectTypeDB::bind_method(_MD("_set_shape_range","shape_range"),&CollisionPolygon2D::_set_shape_range); - ObjectTypeDB::bind_method(_MD("_get_shape_range"),&CollisionPolygon2D::_get_shape_range); + ClassDB::bind_method(_MD("_set_shape_range","shape_range"),&CollisionPolygon2D::_set_shape_range); + ClassDB::bind_method(_MD("_get_shape_range"),&CollisionPolygon2D::_get_shape_range); - ObjectTypeDB::bind_method(_MD("get_collision_object_first_shape"),&CollisionPolygon2D::get_collision_object_first_shape); - ObjectTypeDB::bind_method(_MD("get_collision_object_last_shape"),&CollisionPolygon2D::get_collision_object_last_shape); + ClassDB::bind_method(_MD("get_collision_object_first_shape"),&CollisionPolygon2D::get_collision_object_first_shape); + ClassDB::bind_method(_MD("get_collision_object_last_shape"),&CollisionPolygon2D::get_collision_object_last_shape); ADD_PROPERTY( PropertyInfo(Variant::INT,"build_mode",PROPERTY_HINT_ENUM,"Solids,Segments"),_SCS("set_build_mode"),_SCS("get_build_mode")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2_ARRAY,"polygon"),_SCS("set_polygon"),_SCS("get_polygon")); + ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"polygon"),_SCS("set_polygon"),_SCS("get_polygon")); ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"shape_range",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_shape_range"),_SCS("_get_shape_range")); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"trigger"),_SCS("set_trigger"),_SCS("is_trigger")); diff --git a/scene/2d/collision_polygon_2d.h b/scene/2d/collision_polygon_2d.h index 9c0e4e0c01..dda850b41d 100644 --- a/scene/2d/collision_polygon_2d.h +++ b/scene/2d/collision_polygon_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ class CollisionPolygon2D : public Node2D { - OBJ_TYPE(CollisionPolygon2D,Node2D); + GDCLASS(CollisionPolygon2D,Node2D); public: enum BuildMode { diff --git a/scene/2d/collision_shape_2d.cpp b/scene/2d/collision_shape_2d.cpp index c737cf0faf..a92065d6fb 100644 --- a/scene/2d/collision_shape_2d.cpp +++ b/scene/2d/collision_shape_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -217,17 +217,17 @@ String CollisionShape2D::get_configuration_warning() const { void CollisionShape2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_shape","shape"),&CollisionShape2D::set_shape); - ObjectTypeDB::bind_method(_MD("get_shape"),&CollisionShape2D::get_shape); - ObjectTypeDB::bind_method(_MD("_shape_changed"),&CollisionShape2D::_shape_changed); - ObjectTypeDB::bind_method(_MD("_add_to_collision_object"),&CollisionShape2D::_add_to_collision_object); - ObjectTypeDB::bind_method(_MD("set_trigger","enable"),&CollisionShape2D::set_trigger); - ObjectTypeDB::bind_method(_MD("is_trigger"),&CollisionShape2D::is_trigger); + ClassDB::bind_method(_MD("set_shape","shape"),&CollisionShape2D::set_shape); + ClassDB::bind_method(_MD("get_shape"),&CollisionShape2D::get_shape); + ClassDB::bind_method(_MD("_shape_changed"),&CollisionShape2D::_shape_changed); + ClassDB::bind_method(_MD("_add_to_collision_object"),&CollisionShape2D::_add_to_collision_object); + ClassDB::bind_method(_MD("set_trigger","enable"),&CollisionShape2D::set_trigger); + ClassDB::bind_method(_MD("is_trigger"),&CollisionShape2D::is_trigger); - ObjectTypeDB::bind_method(_MD("_set_update_shape_index","index"),&CollisionShape2D::_set_update_shape_index); - ObjectTypeDB::bind_method(_MD("_get_update_shape_index"),&CollisionShape2D::_get_update_shape_index); + ClassDB::bind_method(_MD("_set_update_shape_index","index"),&CollisionShape2D::_set_update_shape_index); + ClassDB::bind_method(_MD("_get_update_shape_index"),&CollisionShape2D::_get_update_shape_index); - ObjectTypeDB::bind_method(_MD("get_collision_object_shape_index"),&CollisionShape2D::get_collision_object_shape_index); + ClassDB::bind_method(_MD("get_collision_object_shape_index"),&CollisionShape2D::get_collision_object_shape_index); ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"shape",PROPERTY_HINT_RESOURCE_TYPE,"Shape2D"),_SCS("set_shape"),_SCS("get_shape")); ADD_PROPERTY(PropertyInfo(Variant::BOOL,"trigger"),_SCS("set_trigger"),_SCS("is_trigger")); diff --git a/scene/2d/collision_shape_2d.h b/scene/2d/collision_shape_2d.h index 6f3f17d412..b5cc789416 100644 --- a/scene/2d/collision_shape_2d.h +++ b/scene/2d/collision_shape_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class CollisionShape2D : public Node2D { - OBJ_TYPE(CollisionShape2D,Node2D); + GDCLASS(CollisionShape2D,Node2D); Ref<Shape2D> shape; Rect2 rect; bool trigger; diff --git a/scene/2d/joints_2d.cpp b/scene/2d/joints_2d.cpp index 053fc2c9c2..987672df38 100644 --- a/scene/2d/joints_2d.cpp +++ b/scene/2d/joints_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -128,22 +128,22 @@ bool Joint2D::get_exclude_nodes_from_collision() const{ void Joint2D::_bind_methods() { - ObjectTypeDB::bind_method( _MD("set_node_a","node"), &Joint2D::set_node_a ); - ObjectTypeDB::bind_method( _MD("get_node_a"), &Joint2D::get_node_a ); + ClassDB::bind_method( _MD("set_node_a","node"), &Joint2D::set_node_a ); + ClassDB::bind_method( _MD("get_node_a"), &Joint2D::get_node_a ); - ObjectTypeDB::bind_method( _MD("set_node_b","node"), &Joint2D::set_node_b ); - ObjectTypeDB::bind_method( _MD("get_node_b"), &Joint2D::get_node_b ); + ClassDB::bind_method( _MD("set_node_b","node"), &Joint2D::set_node_b ); + ClassDB::bind_method( _MD("get_node_b"), &Joint2D::get_node_b ); - ObjectTypeDB::bind_method( _MD("set_bias","bias"), &Joint2D::set_bias ); - ObjectTypeDB::bind_method( _MD("get_bias"), &Joint2D::get_bias ); + ClassDB::bind_method( _MD("set_bias","bias"), &Joint2D::set_bias ); + ClassDB::bind_method( _MD("get_bias"), &Joint2D::get_bias ); - ObjectTypeDB::bind_method( _MD("set_exclude_nodes_from_collision","enable"), &Joint2D::set_exclude_nodes_from_collision ); - ObjectTypeDB::bind_method( _MD("get_exclude_nodes_from_collision"), &Joint2D::get_exclude_nodes_from_collision ); + ClassDB::bind_method( _MD("set_exclude_nodes_from_collision","enable"), &Joint2D::set_exclude_nodes_from_collision ); + ClassDB::bind_method( _MD("get_exclude_nodes_from_collision"), &Joint2D::get_exclude_nodes_from_collision ); ADD_PROPERTY( PropertyInfo( Variant::NODE_PATH, "node_a"), _SCS("set_node_a"),_SCS("get_node_a") ); ADD_PROPERTY( PropertyInfo( Variant::NODE_PATH, "node_b"), _SCS("set_node_b"),_SCS("get_node_b") ); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "bias/bias",PROPERTY_HINT_RANGE,"0,0.9,0.001"), _SCS("set_bias"),_SCS("get_bias") ); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "collision/exclude_nodes"), _SCS("set_exclude_nodes_from_collision"),_SCS("get_exclude_nodes_from_collision") ); + ADD_PROPERTY( PropertyInfo( Variant::REAL, "bias",PROPERTY_HINT_RANGE,"0,0.9,0.001"), _SCS("set_bias"),_SCS("get_bias") ); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "disable_collision"), _SCS("set_exclude_nodes_from_collision"),_SCS("get_exclude_nodes_from_collision") ); } @@ -225,8 +225,8 @@ real_t PinJoint2D::get_softness() const { void PinJoint2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_softness","softness"), &PinJoint2D::set_softness); - ObjectTypeDB::bind_method(_MD("get_softness"), &PinJoint2D::get_softness); + ClassDB::bind_method(_MD("set_softness","softness"), &PinJoint2D::set_softness); + ClassDB::bind_method(_MD("get_softness"), &PinJoint2D::get_softness); ADD_PROPERTY( PropertyInfo( Variant::REAL, "softness", PROPERTY_HINT_EXP_RANGE,"0.00,16,0.01"), _SCS("set_softness"), _SCS("get_softness")); } @@ -283,7 +283,7 @@ RID GrooveJoint2D::_configure_joint(){ else Physics2DServer::get_singleton()->body_remove_collision_exception(body_a->get_rid(),body_b->get_rid()); - Matrix32 gt = get_global_transform(); + Transform2D gt = get_global_transform(); Vector2 groove_A1 = gt.get_origin(); Vector2 groove_A2 = gt.xform( Vector2(0,length) ); Vector2 anchor_B = gt.xform( Vector2(0,initial_offset) ); @@ -321,10 +321,10 @@ real_t GrooveJoint2D::get_initial_offset() const { void GrooveJoint2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_length","length"),&GrooveJoint2D::set_length); - ObjectTypeDB::bind_method(_MD("get_length"),&GrooveJoint2D::get_length); - ObjectTypeDB::bind_method(_MD("set_initial_offset","offset"),&GrooveJoint2D::set_initial_offset); - ObjectTypeDB::bind_method(_MD("get_initial_offset"),&GrooveJoint2D::get_initial_offset); + ClassDB::bind_method(_MD("set_length","length"),&GrooveJoint2D::set_length); + ClassDB::bind_method(_MD("get_length"),&GrooveJoint2D::get_length); + ClassDB::bind_method(_MD("set_initial_offset","offset"),&GrooveJoint2D::set_initial_offset); + ClassDB::bind_method(_MD("get_initial_offset"),&GrooveJoint2D::get_initial_offset); ADD_PROPERTY( PropertyInfo( Variant::REAL, "length", PROPERTY_HINT_EXP_RANGE,"1,65535,1"), _SCS("set_length"),_SCS("get_length")); ADD_PROPERTY( PropertyInfo( Variant::REAL, "initial_offset", PROPERTY_HINT_EXP_RANGE,"1,65535,1"), _SCS("set_initial_offset"),_SCS("get_initial_offset")); @@ -384,7 +384,7 @@ RID DampedSpringJoint2D::_configure_joint(){ else Physics2DServer::get_singleton()->body_remove_collision_exception(body_a->get_rid(),body_b->get_rid()); - Matrix32 gt = get_global_transform(); + Transform2D gt = get_global_transform(); Vector2 anchor_A = gt.get_origin(); Vector2 anchor_B = gt.xform( Vector2(0,length) ); @@ -453,14 +453,14 @@ real_t DampedSpringJoint2D::get_damping() const { void DampedSpringJoint2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_length","length"),&DampedSpringJoint2D::set_length); - ObjectTypeDB::bind_method(_MD("get_length"),&DampedSpringJoint2D::get_length); - ObjectTypeDB::bind_method(_MD("set_rest_length","rest_length"),&DampedSpringJoint2D::set_rest_length); - ObjectTypeDB::bind_method(_MD("get_rest_length"),&DampedSpringJoint2D::get_rest_length); - ObjectTypeDB::bind_method(_MD("set_stiffness","stiffness"),&DampedSpringJoint2D::set_stiffness); - ObjectTypeDB::bind_method(_MD("get_stiffness"),&DampedSpringJoint2D::get_stiffness); - ObjectTypeDB::bind_method(_MD("set_damping","damping"),&DampedSpringJoint2D::set_damping); - ObjectTypeDB::bind_method(_MD("get_damping"),&DampedSpringJoint2D::get_damping); + ClassDB::bind_method(_MD("set_length","length"),&DampedSpringJoint2D::set_length); + ClassDB::bind_method(_MD("get_length"),&DampedSpringJoint2D::get_length); + ClassDB::bind_method(_MD("set_rest_length","rest_length"),&DampedSpringJoint2D::set_rest_length); + ClassDB::bind_method(_MD("get_rest_length"),&DampedSpringJoint2D::get_rest_length); + ClassDB::bind_method(_MD("set_stiffness","stiffness"),&DampedSpringJoint2D::set_stiffness); + ClassDB::bind_method(_MD("get_stiffness"),&DampedSpringJoint2D::get_stiffness); + ClassDB::bind_method(_MD("set_damping","damping"),&DampedSpringJoint2D::set_damping); + ClassDB::bind_method(_MD("get_damping"),&DampedSpringJoint2D::get_damping); ADD_PROPERTY( PropertyInfo( Variant::REAL, "length", PROPERTY_HINT_EXP_RANGE,"1,65535,1"), _SCS("set_length"),_SCS("get_length")); ADD_PROPERTY( PropertyInfo( Variant::REAL, "rest_length", PROPERTY_HINT_EXP_RANGE,"0,65535,1"), _SCS("set_rest_length"),_SCS("get_rest_length")); diff --git a/scene/2d/joints_2d.h b/scene/2d/joints_2d.h index 52ffd86e7c..3b3eec6bd6 100644 --- a/scene/2d/joints_2d.h +++ b/scene/2d/joints_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class Joint2D : public Node2D { - OBJ_TYPE(Joint2D,Node2D); + GDCLASS(Joint2D,Node2D); RID joint; @@ -75,7 +75,7 @@ public: class PinJoint2D : public Joint2D { - OBJ_TYPE(PinJoint2D,Joint2D); + GDCLASS(PinJoint2D,Joint2D); real_t softness; @@ -94,7 +94,7 @@ public: class GrooveJoint2D : public Joint2D { - OBJ_TYPE(GrooveJoint2D,Joint2D); + GDCLASS(GrooveJoint2D,Joint2D); real_t length; real_t initial_offset; @@ -117,7 +117,7 @@ public: class DampedSpringJoint2D : public Joint2D { - OBJ_TYPE(DampedSpringJoint2D,Joint2D); + GDCLASS(DampedSpringJoint2D,Joint2D); real_t stiffness; real_t damping; diff --git a/scene/2d/light_2d.cpp b/scene/2d/light_2d.cpp index 3e548a24b0..b9dc8fe130 100644 --- a/scene/2d/light_2d.cpp +++ b/scene/2d/light_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -235,26 +235,26 @@ int Light2D::get_layer_range_max() const { return layer_max; } -void Light2D::set_item_mask( int p_mask) { +void Light2D::set_item_cull_mask( int p_mask) { item_mask=p_mask; - VS::get_singleton()->canvas_light_set_item_mask(canvas_light,item_mask); + VS::get_singleton()->canvas_light_set_item_cull_mask(canvas_light,item_mask); } -int Light2D::get_item_mask() const { +int Light2D::get_item_cull_mask() const { return item_mask; } -void Light2D::set_item_shadow_mask( int p_mask) { +void Light2D::set_item_shadow_cull_mask( int p_mask) { item_shadow_mask=p_mask; - VS::get_singleton()->canvas_light_set_item_shadow_mask(canvas_light,item_shadow_mask); + VS::get_singleton()->canvas_light_set_item_shadow_cull_mask(canvas_light,item_shadow_mask); } -int Light2D::get_item_shadow_mask() const { +int Light2D::get_item_shadow_cull_mask() const { return item_shadow_mask; } @@ -292,17 +292,30 @@ int Light2D::get_shadow_buffer_size() const { return shadow_buffer_size; } -void Light2D::set_shadow_esm_multiplier( float p_multiplier) { +void Light2D::set_shadow_gradient_length( float p_multiplier) { - shadow_esm_multiplier=p_multiplier; - VS::get_singleton()->canvas_light_set_shadow_esm_multiplier(canvas_light,p_multiplier); + shadow_gradient_length=p_multiplier; + VS::get_singleton()->canvas_light_set_shadow_gradient_length(canvas_light,p_multiplier); } -float Light2D::get_shadow_esm_multiplier() const{ +float Light2D::get_shadow_gradient_length() const{ - return shadow_esm_multiplier; + return shadow_gradient_length; } + +void Light2D::set_shadow_filter( ShadowFilter p_filter) { + shadow_filter=p_filter; + VS::get_singleton()->canvas_light_set_shadow_filter(canvas_light,VS::CanvasLightShadowFilter(p_filter )); +} + +Light2D::ShadowFilter Light2D::get_shadow_filter() const { + + return shadow_filter; +} + + + void Light2D::set_shadow_color( const Color& p_shadow_color) { shadow_color=p_shadow_color; VS::get_singleton()->canvas_light_set_shadow_color(canvas_light,shadow_color); @@ -352,64 +365,67 @@ String Light2D::get_configuration_warning() const { void Light2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_enabled","enabled"),&Light2D::set_enabled); - ObjectTypeDB::bind_method(_MD("is_enabled"),&Light2D::is_enabled); + ClassDB::bind_method(_MD("set_enabled","enabled"),&Light2D::set_enabled); + ClassDB::bind_method(_MD("is_enabled"),&Light2D::is_enabled); + + ClassDB::bind_method(_MD("set_editor_only","editor_only"), &Light2D::set_editor_only ); + ClassDB::bind_method(_MD("is_editor_only"), &Light2D::is_editor_only ); - ObjectTypeDB::bind_method(_MD("set_editor_only","editor_only"), &Light2D::set_editor_only ); - ObjectTypeDB::bind_method(_MD("is_editor_only"), &Light2D::is_editor_only ); + ClassDB::bind_method(_MD("set_texture","texture"),&Light2D::set_texture); + ClassDB::bind_method(_MD("get_texture"),&Light2D::get_texture); - ObjectTypeDB::bind_method(_MD("set_texture","texture"),&Light2D::set_texture); - ObjectTypeDB::bind_method(_MD("get_texture"),&Light2D::get_texture); + ClassDB::bind_method(_MD("set_texture_offset","texture_offset"),&Light2D::set_texture_offset); + ClassDB::bind_method(_MD("get_texture_offset"),&Light2D::get_texture_offset); - ObjectTypeDB::bind_method(_MD("set_texture_offset","texture_offset"),&Light2D::set_texture_offset); - ObjectTypeDB::bind_method(_MD("get_texture_offset"),&Light2D::get_texture_offset); + ClassDB::bind_method(_MD("set_color","color"),&Light2D::set_color); + ClassDB::bind_method(_MD("get_color"),&Light2D::get_color); - ObjectTypeDB::bind_method(_MD("set_color","color"),&Light2D::set_color); - ObjectTypeDB::bind_method(_MD("get_color"),&Light2D::get_color); + ClassDB::bind_method(_MD("set_height","height"),&Light2D::set_height); + ClassDB::bind_method(_MD("get_height"),&Light2D::get_height); - ObjectTypeDB::bind_method(_MD("set_height","height"),&Light2D::set_height); - ObjectTypeDB::bind_method(_MD("get_height"),&Light2D::get_height); + ClassDB::bind_method(_MD("set_energy","energy"),&Light2D::set_energy); + ClassDB::bind_method(_MD("get_energy"),&Light2D::get_energy); - ObjectTypeDB::bind_method(_MD("set_energy","energy"),&Light2D::set_energy); - ObjectTypeDB::bind_method(_MD("get_energy"),&Light2D::get_energy); + ClassDB::bind_method(_MD("set_texture_scale","texture_scale"),&Light2D::set_texture_scale); + ClassDB::bind_method(_MD("get_texture_scale"),&Light2D::get_texture_scale); - ObjectTypeDB::bind_method(_MD("set_texture_scale","texture_scale"),&Light2D::set_texture_scale); - ObjectTypeDB::bind_method(_MD("get_texture_scale"),&Light2D::get_texture_scale); + ClassDB::bind_method(_MD("set_z_range_min","z"),&Light2D::set_z_range_min); + ClassDB::bind_method(_MD("get_z_range_min"),&Light2D::get_z_range_min); - ObjectTypeDB::bind_method(_MD("set_z_range_min","z"),&Light2D::set_z_range_min); - ObjectTypeDB::bind_method(_MD("get_z_range_min"),&Light2D::get_z_range_min); + ClassDB::bind_method(_MD("set_z_range_max","z"),&Light2D::set_z_range_max); + ClassDB::bind_method(_MD("get_z_range_max"),&Light2D::get_z_range_max); - ObjectTypeDB::bind_method(_MD("set_z_range_max","z"),&Light2D::set_z_range_max); - ObjectTypeDB::bind_method(_MD("get_z_range_max"),&Light2D::get_z_range_max); + ClassDB::bind_method(_MD("set_layer_range_min","layer"),&Light2D::set_layer_range_min); + ClassDB::bind_method(_MD("get_layer_range_min"),&Light2D::get_layer_range_min); - ObjectTypeDB::bind_method(_MD("set_layer_range_min","layer"),&Light2D::set_layer_range_min); - ObjectTypeDB::bind_method(_MD("get_layer_range_min"),&Light2D::get_layer_range_min); + ClassDB::bind_method(_MD("set_layer_range_max","layer"),&Light2D::set_layer_range_max); + ClassDB::bind_method(_MD("get_layer_range_max"),&Light2D::get_layer_range_max); - ObjectTypeDB::bind_method(_MD("set_layer_range_max","layer"),&Light2D::set_layer_range_max); - ObjectTypeDB::bind_method(_MD("get_layer_range_max"),&Light2D::get_layer_range_max); + ClassDB::bind_method(_MD("set_item_cull_mask","item_cull_mask"),&Light2D::set_item_cull_mask); + ClassDB::bind_method(_MD("get_item_cull_mask"),&Light2D::get_item_cull_mask); - ObjectTypeDB::bind_method(_MD("set_item_mask","item_mask"),&Light2D::set_item_mask); - ObjectTypeDB::bind_method(_MD("get_item_mask"),&Light2D::get_item_mask); + ClassDB::bind_method(_MD("set_item_shadow_cull_mask","item_shadow_cull_mask"),&Light2D::set_item_shadow_cull_mask); + ClassDB::bind_method(_MD("get_item_shadow_cull_mask"),&Light2D::get_item_shadow_cull_mask); - ObjectTypeDB::bind_method(_MD("set_item_shadow_mask","item_shadow_mask"),&Light2D::set_item_shadow_mask); - ObjectTypeDB::bind_method(_MD("get_item_shadow_mask"),&Light2D::get_item_shadow_mask); + ClassDB::bind_method(_MD("set_mode","mode"),&Light2D::set_mode); + ClassDB::bind_method(_MD("get_mode"),&Light2D::get_mode); - ObjectTypeDB::bind_method(_MD("set_mode","mode"),&Light2D::set_mode); - ObjectTypeDB::bind_method(_MD("get_mode"),&Light2D::get_mode); + ClassDB::bind_method(_MD("set_shadow_enabled","enabled"),&Light2D::set_shadow_enabled); + ClassDB::bind_method(_MD("is_shadow_enabled"),&Light2D::is_shadow_enabled); - ObjectTypeDB::bind_method(_MD("set_shadow_enabled","enabled"),&Light2D::set_shadow_enabled); - ObjectTypeDB::bind_method(_MD("is_shadow_enabled"),&Light2D::is_shadow_enabled); + ClassDB::bind_method(_MD("set_shadow_buffer_size","size"),&Light2D::set_shadow_buffer_size); + ClassDB::bind_method(_MD("get_shadow_buffer_size"),&Light2D::get_shadow_buffer_size); - ObjectTypeDB::bind_method(_MD("set_shadow_buffer_size","size"),&Light2D::set_shadow_buffer_size); - ObjectTypeDB::bind_method(_MD("get_shadow_buffer_size"),&Light2D::get_shadow_buffer_size); + ClassDB::bind_method(_MD("set_shadow_gradient_length","multiplier"),&Light2D::set_shadow_gradient_length); + ClassDB::bind_method(_MD("get_shadow_gradient_length"),&Light2D::get_shadow_gradient_length); - ObjectTypeDB::bind_method(_MD("set_shadow_esm_multiplier","multiplier"),&Light2D::set_shadow_esm_multiplier); - ObjectTypeDB::bind_method(_MD("get_shadow_esm_multiplier"),&Light2D::get_shadow_esm_multiplier); + ClassDB::bind_method(_MD("set_shadow_filter","filter"),&Light2D::set_shadow_filter); + ClassDB::bind_method(_MD("get_shadow_filter"),&Light2D::get_shadow_filter); - ObjectTypeDB::bind_method(_MD("set_shadow_color","shadow_color"),&Light2D::set_shadow_color); - ObjectTypeDB::bind_method(_MD("get_shadow_color"),&Light2D::get_shadow_color); + ClassDB::bind_method(_MD("set_shadow_color","shadow_color"),&Light2D::set_shadow_color); + ClassDB::bind_method(_MD("get_shadow_color"),&Light2D::get_shadow_color); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"enabled"),_SCS("set_enabled"),_SCS("is_enabled")); @@ -420,17 +436,21 @@ void Light2D::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::COLOR,"color"),_SCS("set_color"),_SCS("get_color")); ADD_PROPERTY( PropertyInfo(Variant::REAL,"energy",PROPERTY_HINT_RANGE,"0.01,100,0.01"),_SCS("set_energy"),_SCS("get_energy")); ADD_PROPERTY( PropertyInfo(Variant::INT,"mode",PROPERTY_HINT_ENUM,"Add,Sub,Mix,Mask"),_SCS("set_mode"),_SCS("get_mode")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"range/height",PROPERTY_HINT_RANGE,"-100,100,0.1"),_SCS("set_height"),_SCS("get_height")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"range/z_min",PROPERTY_HINT_RANGE,itos(VS::CANVAS_ITEM_Z_MIN)+","+itos(VS::CANVAS_ITEM_Z_MAX)+",1"),_SCS("set_z_range_min"),_SCS("get_z_range_min")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"range/z_max",PROPERTY_HINT_RANGE,itos(VS::CANVAS_ITEM_Z_MIN)+","+itos(VS::CANVAS_ITEM_Z_MAX)+",1"),_SCS("set_z_range_max"),_SCS("get_z_range_max")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"range/layer_min",PROPERTY_HINT_RANGE,"-512,512,1"),_SCS("set_layer_range_min"),_SCS("get_layer_range_min")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"range/layer_max",PROPERTY_HINT_RANGE,"-512,512,1"),_SCS("set_layer_range_max"),_SCS("get_layer_range_max")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"range/item_mask",PROPERTY_HINT_ALL_FLAGS),_SCS("set_item_mask"),_SCS("get_item_mask")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"shadow/enabled"),_SCS("set_shadow_enabled"),_SCS("is_shadow_enabled")); - ADD_PROPERTY( PropertyInfo(Variant::COLOR,"shadow/color"),_SCS("set_shadow_color"),_SCS("get_shadow_color")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"shadow/buffer_size",PROPERTY_HINT_RANGE,"32,16384,1"),_SCS("set_shadow_buffer_size"),_SCS("get_shadow_buffer_size")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"shadow/esm_multiplier",PROPERTY_HINT_RANGE,"1,4096,0.1"),_SCS("set_shadow_esm_multiplier"),_SCS("get_shadow_esm_multiplier")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"shadow/item_mask",PROPERTY_HINT_ALL_FLAGS),_SCS("set_item_shadow_mask"),_SCS("get_item_shadow_mask")); + ADD_GROUP("Range","range_"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"range_height",PROPERTY_HINT_RANGE,"-100,100,0.1"),_SCS("set_height"),_SCS("get_height")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"range_z_min",PROPERTY_HINT_RANGE,itos(VS::CANVAS_ITEM_Z_MIN)+","+itos(VS::CANVAS_ITEM_Z_MAX)+",1"),_SCS("set_z_range_min"),_SCS("get_z_range_min")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"range_z_max",PROPERTY_HINT_RANGE,itos(VS::CANVAS_ITEM_Z_MIN)+","+itos(VS::CANVAS_ITEM_Z_MAX)+",1"),_SCS("set_z_range_max"),_SCS("get_z_range_max")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"range_layer_min",PROPERTY_HINT_RANGE,"-512,512,1"),_SCS("set_layer_range_min"),_SCS("get_layer_range_min")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"range_layer_max",PROPERTY_HINT_RANGE,"-512,512,1"),_SCS("set_layer_range_max"),_SCS("get_layer_range_max")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"range_item_cull_mask",PROPERTY_HINT_LAYERS_2D_RENDER),_SCS("set_item_cull_mask"),_SCS("get_item_cull_mask")); + + ADD_GROUP("Shadow","shadow_"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"shadow_enabled"),_SCS("set_shadow_enabled"),_SCS("is_shadow_enabled")); + ADD_PROPERTY( PropertyInfo(Variant::COLOR,"shadow_color"),_SCS("set_shadow_color"),_SCS("get_shadow_color")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"shadow_buffer_size",PROPERTY_HINT_RANGE,"32,16384,1"),_SCS("set_shadow_buffer_size"),_SCS("get_shadow_buffer_size")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"shadow_gradient_length",PROPERTY_HINT_RANGE,"1,4096,0.1"),_SCS("set_shadow_gradient_length"),_SCS("get_shadow_gradient_length")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"shadow_filter",PROPERTY_HINT_ENUM,"None,PCF3,PCF5,PCF9,PCF13"),_SCS("set_shadow_filter"),_SCS("get_shadow_filter")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"shadow_item_cull_mask",PROPERTY_HINT_LAYERS_2D_RENDER),_SCS("set_item_shadow_cull_mask"),_SCS("get_item_shadow_cull_mask")); BIND_CONSTANT( MODE_ADD ); BIND_CONSTANT( MODE_SUB ); @@ -457,9 +477,10 @@ Light2D::Light2D() { item_shadow_mask=1; mode=MODE_ADD; shadow_buffer_size=2048; - shadow_esm_multiplier=80; + shadow_gradient_length=0; energy=1.0; shadow_color=Color(0,0,0,0); + shadow_filter=SHADOW_FILTER_NONE; } diff --git a/scene/2d/light_2d.h b/scene/2d/light_2d.h index 57c89b15e7..2bdcca5d01 100644 --- a/scene/2d/light_2d.h +++ b/scene/2d/light_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class Light2D : public Node2D { - OBJ_TYPE(Light2D,Node2D); + GDCLASS(Light2D,Node2D); public: enum Mode { MODE_ADD, @@ -42,6 +42,14 @@ public: MODE_MASK, }; + enum ShadowFilter { + SHADOW_FILTER_NONE, + SHADOW_FILTER_PCF3, + SHADOW_FILTER_PCF5, + SHADOW_FILTER_PCF9, + SHADOW_FILTER_PCF13, + }; + private: RID canvas_light; bool enabled; @@ -59,10 +67,12 @@ private: int item_mask; int item_shadow_mask; int shadow_buffer_size; - float shadow_esm_multiplier; + float shadow_gradient_length; Mode mode; Ref<Texture> texture; Vector2 texture_offset; + ShadowFilter shadow_filter; + void _update_light_visibility(); protected: @@ -112,11 +122,11 @@ public: void set_layer_range_max( int p_max_layer); int get_layer_range_max() const; - void set_item_mask( int p_mask); - int get_item_mask() const; + void set_item_cull_mask( int p_mask); + int get_item_cull_mask() const; - void set_item_shadow_mask( int p_mask); - int get_item_shadow_mask() const; + void set_item_shadow_cull_mask( int p_mask); + int get_item_shadow_cull_mask() const; void set_mode( Mode p_mode ); Mode get_mode() const; @@ -127,8 +137,11 @@ public: void set_shadow_buffer_size( int p_size ); int get_shadow_buffer_size() const; - void set_shadow_esm_multiplier( float p_multiplier); - float get_shadow_esm_multiplier() const; + void set_shadow_gradient_length( float p_multiplier); + float get_shadow_gradient_length() const; + + void set_shadow_filter( ShadowFilter p_filter); + ShadowFilter get_shadow_filter() const; void set_shadow_color( const Color& p_shadow_color); Color get_shadow_color() const; @@ -143,5 +156,7 @@ public: }; VARIANT_ENUM_CAST(Light2D::Mode); +VARIANT_ENUM_CAST(Light2D::ShadowFilter); + #endif // LIGHT_2D_H diff --git a/scene/2d/light_occluder_2d.cpp b/scene/2d/light_occluder_2d.cpp index 58c3e2191e..8d447c3e8b 100644 --- a/scene/2d/light_occluder_2d.cpp +++ b/scene/2d/light_occluder_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -29,14 +29,14 @@ #include "light_occluder_2d.h" -void OccluderPolygon2D::set_polygon(const DVector<Vector2>& p_polygon) { +void OccluderPolygon2D::set_polygon(const PoolVector<Vector2>& p_polygon) { polygon=p_polygon; VS::get_singleton()->canvas_occluder_polygon_set_shape(occ_polygon,p_polygon,closed); emit_changed(); } -DVector<Vector2> OccluderPolygon2D::get_polygon() const{ +PoolVector<Vector2> OccluderPolygon2D::get_polygon() const{ return polygon; } @@ -78,18 +78,18 @@ RID OccluderPolygon2D::get_rid() const { void OccluderPolygon2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_closed","closed"),&OccluderPolygon2D::set_closed); - ObjectTypeDB::bind_method(_MD("is_closed"),&OccluderPolygon2D::is_closed); + ClassDB::bind_method(_MD("set_closed","closed"),&OccluderPolygon2D::set_closed); + ClassDB::bind_method(_MD("is_closed"),&OccluderPolygon2D::is_closed); - ObjectTypeDB::bind_method(_MD("set_cull_mode","cull_mode"),&OccluderPolygon2D::set_cull_mode); - ObjectTypeDB::bind_method(_MD("get_cull_mode"),&OccluderPolygon2D::get_cull_mode); + ClassDB::bind_method(_MD("set_cull_mode","cull_mode"),&OccluderPolygon2D::set_cull_mode); + ClassDB::bind_method(_MD("get_cull_mode"),&OccluderPolygon2D::get_cull_mode); - ObjectTypeDB::bind_method(_MD("set_polygon","polygon"),&OccluderPolygon2D::set_polygon); - ObjectTypeDB::bind_method(_MD("get_polygon"),&OccluderPolygon2D::get_polygon); + ClassDB::bind_method(_MD("set_polygon","polygon"),&OccluderPolygon2D::set_polygon); + ClassDB::bind_method(_MD("get_polygon"),&OccluderPolygon2D::get_polygon); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"closed"),_SCS("set_closed"),_SCS("is_closed")); ADD_PROPERTY( PropertyInfo(Variant::INT,"cull_mode",PROPERTY_HINT_ENUM,"Disabled,ClockWise,CounterClockWise"),_SCS("set_cull_mode"),_SCS("get_cull_mode")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2_ARRAY,"polygon"),_SCS("set_polygon"),_SCS("get_polygon")); + ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"polygon"),_SCS("set_polygon"),_SCS("get_polygon")); BIND_CONSTANT(CULL_DISABLED); BIND_CONSTANT(CULL_CLOCKWISE); @@ -141,7 +141,7 @@ void LightOccluder2D::_notification(int p_what) { if (occluder_polygon.is_valid()) { - DVector<Vector2> poly = occluder_polygon->get_polygon(); + PoolVector<Vector2> poly = occluder_polygon->get_polygon(); if (poly.size()) { if (occluder_polygon->is_closed()) { @@ -151,7 +151,7 @@ void LightOccluder2D::_notification(int p_what) { } else { int ps=poly.size(); - DVector<Vector2>::Read r = poly.read(); + PoolVector<Vector2>::Read r = poly.read(); for(int i=0;i<ps-1;i++) { draw_line(r[i],r[i+1],Color(0,0,0,0.6),3); @@ -224,18 +224,18 @@ String LightOccluder2D::get_configuration_warning() const { void LightOccluder2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_occluder_polygon","polygon:OccluderPolygon2D"),&LightOccluder2D::set_occluder_polygon); - ObjectTypeDB::bind_method(_MD("get_occluder_polygon:OccluderPolygon2D"),&LightOccluder2D::get_occluder_polygon); + ClassDB::bind_method(_MD("set_occluder_polygon","polygon:OccluderPolygon2D"),&LightOccluder2D::set_occluder_polygon); + ClassDB::bind_method(_MD("get_occluder_polygon:OccluderPolygon2D"),&LightOccluder2D::get_occluder_polygon); - ObjectTypeDB::bind_method(_MD("set_occluder_light_mask","mask"),&LightOccluder2D::set_occluder_light_mask); - ObjectTypeDB::bind_method(_MD("get_occluder_light_mask"),&LightOccluder2D::get_occluder_light_mask); + ClassDB::bind_method(_MD("set_occluder_light_mask","mask"),&LightOccluder2D::set_occluder_light_mask); + ClassDB::bind_method(_MD("get_occluder_light_mask"),&LightOccluder2D::get_occluder_light_mask); #ifdef DEBUG_ENABLED - ObjectTypeDB::bind_method("_poly_changed",&LightOccluder2D::_poly_changed); + ClassDB::bind_method("_poly_changed",&LightOccluder2D::_poly_changed); #endif ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"occluder",PROPERTY_HINT_RESOURCE_TYPE,"OccluderPolygon2D"),_SCS("set_occluder_polygon"),_SCS("get_occluder_polygon")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"light_mask",PROPERTY_HINT_ALL_FLAGS),_SCS("set_occluder_light_mask"),_SCS("get_occluder_light_mask")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"light_mask",PROPERTY_HINT_LAYERS_2D_RENDER),_SCS("set_occluder_light_mask"),_SCS("get_occluder_light_mask")); } LightOccluder2D::LightOccluder2D() { diff --git a/scene/2d/light_occluder_2d.h b/scene/2d/light_occluder_2d.h index 69ed860a84..777785cd1d 100644 --- a/scene/2d/light_occluder_2d.h +++ b/scene/2d/light_occluder_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class OccluderPolygon2D : public Resource { - OBJ_TYPE(OccluderPolygon2D,Resource); + GDCLASS(OccluderPolygon2D,Resource); public: enum CullMode { @@ -45,7 +45,7 @@ private: RID occ_polygon; - DVector<Vector2> polygon; + PoolVector<Vector2> polygon; bool closed; CullMode cull; @@ -54,8 +54,8 @@ protected: static void _bind_methods(); public: - void set_polygon(const DVector<Vector2>& p_polygon); - DVector<Vector2> get_polygon() const; + void set_polygon(const PoolVector<Vector2>& p_polygon); + PoolVector<Vector2> get_polygon() const; void set_closed(bool p_closed); bool is_closed() const; @@ -72,7 +72,7 @@ public: VARIANT_ENUM_CAST(OccluderPolygon2D::CullMode); class LightOccluder2D : public Node2D { - OBJ_TYPE(LightOccluder2D,Node2D); + GDCLASS(LightOccluder2D,Node2D); RID occluder; bool enabled; diff --git a/scene/2d/navigation2d.cpp b/scene/2d/navigation2d.cpp index 82c1327a8f..2d0fbf1cfc 100644 --- a/scene/2d/navigation2d.cpp +++ b/scene/2d/navigation2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,12 +36,12 @@ void Navigation2D::_navpoly_link(int p_id) { NavMesh &nm=navpoly_map[p_id]; ERR_FAIL_COND(nm.linked); - DVector<Vector2> vertices=nm.navpoly->get_vertices(); + PoolVector<Vector2> vertices=nm.navpoly->get_vertices(); int len = vertices.size(); if (len==0) return; - DVector<Vector2>::Read r=vertices.read(); + PoolVector<Vector2>::Read r=vertices.read(); for(int i=0;i<nm.navpoly->get_polygon_count();i++) { @@ -212,7 +212,7 @@ void Navigation2D::_navpoly_unlink(int p_id) { } -int Navigation2D::navpoly_create(const Ref<NavigationPolygon>& p_mesh, const Matrix32& p_xform, Object *p_owner) { +int Navigation2D::navpoly_create(const Ref<NavigationPolygon>& p_mesh, const Transform2D& p_xform, Object *p_owner) { int id = last_id++; NavMesh nm; @@ -227,7 +227,7 @@ int Navigation2D::navpoly_create(const Ref<NavigationPolygon>& p_mesh, const Mat return id; } -void Navigation2D::navpoly_set_transform(int p_id, const Matrix32& p_xform){ +void Navigation2D::navpoly_set_transform(int p_id, const Transform2D& p_xform){ ERR_FAIL_COND(!navpoly_map.has(p_id)); NavMesh &nm=navpoly_map[p_id]; @@ -804,13 +804,13 @@ Object* Navigation2D::get_closest_point_owner(const Vector2& p_point) { void Navigation2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("navpoly_create","mesh:NavigationPolygon","xform","owner"),&Navigation2D::navpoly_create,DEFVAL(Variant())); - ObjectTypeDB::bind_method(_MD("navpoly_set_transform","id","xform"),&Navigation2D::navpoly_set_transform); - ObjectTypeDB::bind_method(_MD("navpoly_remove","id"),&Navigation2D::navpoly_remove); + ClassDB::bind_method(_MD("navpoly_create","mesh:NavigationPolygon","xform","owner"),&Navigation2D::navpoly_create,DEFVAL(Variant())); + ClassDB::bind_method(_MD("navpoly_set_transform","id","xform"),&Navigation2D::navpoly_set_transform); + ClassDB::bind_method(_MD("navpoly_remove","id"),&Navigation2D::navpoly_remove); - ObjectTypeDB::bind_method(_MD("get_simple_path","start","end","optimize"),&Navigation2D::get_simple_path,DEFVAL(true)); - ObjectTypeDB::bind_method(_MD("get_closest_point","to_point"),&Navigation2D::get_closest_point); - ObjectTypeDB::bind_method(_MD("get_closest_point_owner","to_point"),&Navigation2D::get_closest_point_owner); + ClassDB::bind_method(_MD("get_simple_path","start","end","optimize"),&Navigation2D::get_simple_path,DEFVAL(true)); + ClassDB::bind_method(_MD("get_closest_point","to_point"),&Navigation2D::get_closest_point); + ClassDB::bind_method(_MD("get_closest_point_owner","to_point"),&Navigation2D::get_closest_point_owner); } diff --git a/scene/2d/navigation2d.h b/scene/2d/navigation2d.h index 415470295b..63827ebb6d 100644 --- a/scene/2d/navigation2d.h +++ b/scene/2d/navigation2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class Navigation2D : public Node2D { - OBJ_TYPE( Navigation2D, Node2D); + GDCLASS( Navigation2D, Node2D); union Point { @@ -119,7 +119,7 @@ class Navigation2D : public Node2D { struct NavMesh { Object *owner; - Matrix32 xform; + Transform2D xform; bool linked; Ref<NavigationPolygon> navpoly; List<Polygon> polygons; @@ -164,8 +164,8 @@ protected: public: //API should be as dynamic as possible - int navpoly_create(const Ref<NavigationPolygon>& p_mesh,const Matrix32& p_xform,Object* p_owner=NULL); - void navpoly_set_transform(int p_id, const Matrix32& p_xform); + int navpoly_create(const Ref<NavigationPolygon>& p_mesh,const Transform2D& p_xform,Object* p_owner=NULL); + void navpoly_set_transform(int p_id, const Transform2D& p_xform); void navpoly_remove(int p_id); Vector<Vector2> get_simple_path(const Vector2& p_start, const Vector2& p_end,bool p_optimize=true); diff --git a/scene/2d/navigation_polygon.cpp b/scene/2d/navigation_polygon.cpp index 95f71104d0..5c1837ad65 100644 --- a/scene/2d/navigation_polygon.cpp +++ b/scene/2d/navigation_polygon.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,12 +31,12 @@ #include "triangulator.h" #include "core_string_names.h" -void NavigationPolygon::set_vertices(const DVector<Vector2>& p_vertices) { +void NavigationPolygon::set_vertices(const PoolVector<Vector2>& p_vertices) { vertices=p_vertices; } -DVector<Vector2> NavigationPolygon::get_vertices() const{ +PoolVector<Vector2> NavigationPolygon::get_vertices() const{ return vertices; } @@ -89,7 +89,7 @@ void NavigationPolygon::add_polygon(const Vector<int>& p_polygon){ } -void NavigationPolygon::add_outline_at_index(const DVector<Vector2>& p_outline,int p_index) { +void NavigationPolygon::add_outline_at_index(const PoolVector<Vector2>& p_outline,int p_index) { outlines.insert(p_index,p_outline); } @@ -108,7 +108,7 @@ void NavigationPolygon::clear_polygons(){ polygons.clear(); } -void NavigationPolygon::add_outline(const DVector<Vector2>& p_outline) { +void NavigationPolygon::add_outline(const PoolVector<Vector2>& p_outline) { outlines.push_back(p_outline); } @@ -118,7 +118,7 @@ int NavigationPolygon::get_outline_count() const{ return outlines.size(); } -void NavigationPolygon::set_outline(int p_idx,const DVector<Vector2>& p_outline) { +void NavigationPolygon::set_outline(int p_idx,const PoolVector<Vector2>& p_outline) { ERR_FAIL_INDEX(p_idx,outlines.size()); outlines[p_idx]=p_outline; } @@ -130,8 +130,8 @@ void NavigationPolygon::remove_outline(int p_idx) { } -DVector<Vector2> NavigationPolygon::get_outline(int p_idx) const { - ERR_FAIL_INDEX_V(p_idx,outlines.size(),DVector<Vector2>()); +PoolVector<Vector2> NavigationPolygon::get_outline(int p_idx) const { + ERR_FAIL_INDEX_V(p_idx,outlines.size(),PoolVector<Vector2>()); return outlines[p_idx]; } @@ -147,11 +147,11 @@ void NavigationPolygon::make_polygons_from_outlines(){ for(int i=0;i<outlines.size();i++) { - DVector<Vector2> ol = outlines[i]; + PoolVector<Vector2> ol = outlines[i]; int olsize = ol.size(); if (olsize<3) continue; - DVector<Vector2>::Read r=ol.read(); + PoolVector<Vector2>::Read r=ol.read(); for(int j=0;j<olsize;j++) { outside_point.x = MAX( r[j].x, outside_point.x ); outside_point.y = MAX( r[j].y, outside_point.y ); @@ -165,11 +165,11 @@ void NavigationPolygon::make_polygons_from_outlines(){ for(int i=0;i<outlines.size();i++) { - DVector<Vector2> ol = outlines[i]; + PoolVector<Vector2> ol = outlines[i]; int olsize = ol.size(); if (olsize<3) continue; - DVector<Vector2>::Read r=ol.read(); + PoolVector<Vector2>::Read r=ol.read(); int interscount=0; //test if this is an outer outline @@ -178,11 +178,11 @@ void NavigationPolygon::make_polygons_from_outlines(){ if (i==k) continue; //no self intersect - DVector<Vector2> ol2 = outlines[k]; + PoolVector<Vector2> ol2 = outlines[k]; int olsize2 = ol2.size(); if (olsize2<3) continue; - DVector<Vector2>::Read r2=ol2.read(); + PoolVector<Vector2>::Read r2=ol2.read(); for(int l=0;l<olsize2;l++) { @@ -247,30 +247,30 @@ void NavigationPolygon::make_polygons_from_outlines(){ void NavigationPolygon::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_vertices","vertices"),&NavigationPolygon::set_vertices); - ObjectTypeDB::bind_method(_MD("get_vertices"),&NavigationPolygon::get_vertices); + ClassDB::bind_method(_MD("set_vertices","vertices"),&NavigationPolygon::set_vertices); + ClassDB::bind_method(_MD("get_vertices"),&NavigationPolygon::get_vertices); - ObjectTypeDB::bind_method(_MD("add_polygon","polygon"),&NavigationPolygon::add_polygon); - ObjectTypeDB::bind_method(_MD("get_polygon_count"),&NavigationPolygon::get_polygon_count); - ObjectTypeDB::bind_method(_MD("get_polygon","idx"),&NavigationPolygon::get_polygon); - ObjectTypeDB::bind_method(_MD("clear_polygons"),&NavigationPolygon::clear_polygons); + ClassDB::bind_method(_MD("add_polygon","polygon"),&NavigationPolygon::add_polygon); + ClassDB::bind_method(_MD("get_polygon_count"),&NavigationPolygon::get_polygon_count); + ClassDB::bind_method(_MD("get_polygon","idx"),&NavigationPolygon::get_polygon); + ClassDB::bind_method(_MD("clear_polygons"),&NavigationPolygon::clear_polygons); - ObjectTypeDB::bind_method(_MD("add_outline","outline"),&NavigationPolygon::add_outline); - ObjectTypeDB::bind_method(_MD("add_outline_at_index","outline","index"),&NavigationPolygon::add_outline_at_index); - ObjectTypeDB::bind_method(_MD("get_outline_count"),&NavigationPolygon::get_outline_count); - ObjectTypeDB::bind_method(_MD("set_outline","idx","outline"),&NavigationPolygon::set_outline); - ObjectTypeDB::bind_method(_MD("get_outline","idx"),&NavigationPolygon::get_outline); - ObjectTypeDB::bind_method(_MD("remove_outline","idx"),&NavigationPolygon::remove_outline); - ObjectTypeDB::bind_method(_MD("clear_outlines"),&NavigationPolygon::clear_outlines); - ObjectTypeDB::bind_method(_MD("make_polygons_from_outlines"),&NavigationPolygon::make_polygons_from_outlines); + ClassDB::bind_method(_MD("add_outline","outline"),&NavigationPolygon::add_outline); + ClassDB::bind_method(_MD("add_outline_at_index","outline","index"),&NavigationPolygon::add_outline_at_index); + ClassDB::bind_method(_MD("get_outline_count"),&NavigationPolygon::get_outline_count); + ClassDB::bind_method(_MD("set_outline","idx","outline"),&NavigationPolygon::set_outline); + ClassDB::bind_method(_MD("get_outline","idx"),&NavigationPolygon::get_outline); + ClassDB::bind_method(_MD("remove_outline","idx"),&NavigationPolygon::remove_outline); + ClassDB::bind_method(_MD("clear_outlines"),&NavigationPolygon::clear_outlines); + ClassDB::bind_method(_MD("make_polygons_from_outlines"),&NavigationPolygon::make_polygons_from_outlines); - ObjectTypeDB::bind_method(_MD("_set_polygons","polygons"),&NavigationPolygon::_set_polygons); - ObjectTypeDB::bind_method(_MD("_get_polygons"),&NavigationPolygon::_get_polygons); + ClassDB::bind_method(_MD("_set_polygons","polygons"),&NavigationPolygon::_set_polygons); + ClassDB::bind_method(_MD("_get_polygons"),&NavigationPolygon::_get_polygons); - ObjectTypeDB::bind_method(_MD("_set_outlines","outlines"),&NavigationPolygon::_set_outlines); - ObjectTypeDB::bind_method(_MD("_get_outlines"),&NavigationPolygon::_get_outlines); + ClassDB::bind_method(_MD("_set_outlines","outlines"),&NavigationPolygon::_set_outlines); + ClassDB::bind_method(_MD("_get_outlines"),&NavigationPolygon::_get_outlines); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR3_ARRAY,"vertices",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_vertices"),_SCS("get_vertices")); + ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR3_ARRAY,"vertices",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_vertices"),_SCS("get_vertices")); ADD_PROPERTY(PropertyInfo(Variant::ARRAY,"polygons",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_polygons"),_SCS("_get_polygons")); ADD_PROPERTY(PropertyInfo(Variant::ARRAY,"outlines",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_outlines"),_SCS("_get_outlines")); } @@ -368,7 +368,7 @@ void NavigationPolygonInstance::_notification(int p_what) { if (is_inside_tree() && (get_tree()->is_editor_hint() || get_tree()->is_debugging_navigation_hint()) && navpoly.is_valid()) { - DVector<Vector2> verts=navpoly->get_vertices(); + PoolVector<Vector2> verts=navpoly->get_vertices(); int vsize = verts.size(); if (vsize<3) return; @@ -385,7 +385,7 @@ void NavigationPolygonInstance::_notification(int p_what) { vertices.resize(vsize); colors.resize(vsize); { - DVector<Vector2>::Read vr = verts.read(); + PoolVector<Vector2>::Read vr = verts.read(); for(int i=0;i<vsize;i++) { vertices[i]=vr[i]; colors[i]=color; @@ -480,13 +480,13 @@ String NavigationPolygonInstance::get_configuration_warning() const { void NavigationPolygonInstance::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_navigation_polygon","navpoly:NavigationPolygon"),&NavigationPolygonInstance::set_navigation_polygon); - ObjectTypeDB::bind_method(_MD("get_navigation_polygon:NavigationPolygon"),&NavigationPolygonInstance::get_navigation_polygon); + ClassDB::bind_method(_MD("set_navigation_polygon","navpoly:NavigationPolygon"),&NavigationPolygonInstance::set_navigation_polygon); + ClassDB::bind_method(_MD("get_navigation_polygon:NavigationPolygon"),&NavigationPolygonInstance::get_navigation_polygon); - ObjectTypeDB::bind_method(_MD("set_enabled","enabled"),&NavigationPolygonInstance::set_enabled); - ObjectTypeDB::bind_method(_MD("is_enabled"),&NavigationPolygonInstance::is_enabled); + ClassDB::bind_method(_MD("set_enabled","enabled"),&NavigationPolygonInstance::set_enabled); + ClassDB::bind_method(_MD("is_enabled"),&NavigationPolygonInstance::is_enabled); - ObjectTypeDB::bind_method(_MD("_navpoly_changed"),&NavigationPolygonInstance::_navpoly_changed); + ClassDB::bind_method(_MD("_navpoly_changed"),&NavigationPolygonInstance::_navpoly_changed); ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"navpoly",PROPERTY_HINT_RESOURCE_TYPE,"NavigationPolygon"),_SCS("set_navigation_polygon"),_SCS("get_navigation_polygon")); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"enabled"),_SCS("set_enabled"),_SCS("is_enabled")); diff --git a/scene/2d/navigation_polygon.h b/scene/2d/navigation_polygon.h index c40933cf7a..7f1762b6f5 100644 --- a/scene/2d/navigation_polygon.h +++ b/scene/2d/navigation_polygon.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,14 +34,14 @@ class NavigationPolygon : public Resource { - OBJ_TYPE( NavigationPolygon, Resource ); + GDCLASS( NavigationPolygon, Resource ); - DVector<Vector2> vertices; + PoolVector<Vector2> vertices; struct Polygon { Vector<int> indices; }; Vector<Polygon> polygons; - Vector< DVector<Vector2> > outlines; + Vector< PoolVector<Vector2> > outlines; protected: @@ -57,16 +57,16 @@ public: - void set_vertices(const DVector<Vector2>& p_vertices); - DVector<Vector2> get_vertices() const; + void set_vertices(const PoolVector<Vector2>& p_vertices); + PoolVector<Vector2> get_vertices() const; void add_polygon(const Vector<int>& p_polygon); int get_polygon_count() const; - void add_outline(const DVector<Vector2>& p_outline); - void add_outline_at_index(const DVector<Vector2>& p_outline,int p_index); - void set_outline(int p_idx,const DVector<Vector2>& p_outline); - DVector<Vector2> get_outline(int p_idx) const; + void add_outline(const PoolVector<Vector2>& p_outline); + void add_outline_at_index(const PoolVector<Vector2>& p_outline,int p_index); + void set_outline(int p_idx,const PoolVector<Vector2>& p_outline); + PoolVector<Vector2> get_outline(int p_idx) const; void remove_outline(int p_idx); int get_outline_count() const; @@ -84,7 +84,7 @@ class Navigation2D; class NavigationPolygonInstance : public Node2D { - OBJ_TYPE(NavigationPolygonInstance,Node2D); + GDCLASS(NavigationPolygonInstance,Node2D); bool enabled; int nav_id; diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp index b3f925cb14..fb71a5b536 100644 --- a/scene/2d/node_2d.cpp +++ b/scene/2d/node_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -51,8 +51,8 @@ bool Node2D::edit_has_pivot() const { Variant Node2D::edit_get_state() const { Array state; - state.push_back(get_pos()); - state.push_back(get_rot()); + state.push_back(get_position()); + state.push_back(get_rotation()); state.push_back(get_scale()); return state; @@ -92,7 +92,7 @@ void Node2D::edit_set_rect(const Rect2& p_edit_rect) { Point2 new_pos = p_edit_rect.pos + p_edit_rect.size*zero_offset;//p_edit_rect.pos - r.pos; - Matrix32 postxf; + Transform2D postxf; postxf.set_rotation_and_scale(angle,_scale); new_pos = postxf.xform(new_pos); @@ -124,7 +124,7 @@ void Node2D::_update_xform_values() { void Node2D::_update_transform() { - Matrix32 mat(angle,pos); + Transform2D mat(angle,pos); _mat.set_rotation_and_scale(angle,_scale); _mat.elements[2]=pos; @@ -137,7 +137,7 @@ void Node2D::_update_transform() { _notify_transform(); } -void Node2D::set_pos(const Point2& p_pos) { +void Node2D::set_position(const Point2& p_pos) { if (_xform_dirty) ((Node2D*)this)->_update_xform_values(); @@ -148,7 +148,7 @@ void Node2D::set_pos(const Point2& p_pos) { } -void Node2D::set_rot(float p_radians) { +void Node2D::set_rotation(float p_radians) { if (_xform_dirty) ((Node2D*)this)->_update_xform_values(); @@ -157,9 +157,9 @@ void Node2D::set_rot(float p_radians) { _change_notify("transform/rot"); } -void Node2D::set_rotd(float p_degrees) { +void Node2D::set_rotation_in_degrees(float p_degrees) { - set_rot(Math::deg2rad(p_degrees)); + set_rotation(Math::deg2rad(p_degrees)); } // Kept for compatibility after rename to set_rotd. @@ -167,7 +167,7 @@ void Node2D::set_rotd(float p_degrees) { void Node2D::_set_rotd(float p_degrees) { WARN_PRINT("Deprecated method Node2D._set_rotd(): This method was renamed to set_rotd. Please adapt your code accordingly, as the old method will be obsoleted."); - set_rotd(p_degrees); + set_rotation_in_degrees(p_degrees); } void Node2D::set_scale(const Size2& p_scale) { @@ -184,28 +184,28 @@ void Node2D::set_scale(const Size2& p_scale) { } -Point2 Node2D::get_pos() const { +Point2 Node2D::get_position() const { if (_xform_dirty) ((Node2D*)this)->_update_xform_values(); return pos; } -float Node2D::get_rot() const { +float Node2D::get_rotation() const { if (_xform_dirty) ((Node2D*)this)->_update_xform_values(); return angle; } -float Node2D::get_rotd() const { +float Node2D::get_rotation_in_degrees() const { - return Math::rad2deg(get_rot()); + return Math::rad2deg(get_rotation()); } // Kept for compatibility after rename to get_rotd. // Could be removed after a couple releases. float Node2D::_get_rotd() const { WARN_PRINT("Deprecated method Node2D._get_rotd(): This method was renamed to get_rotd. Please adapt your code accordingly, as the old method will be obsoleted."); - return get_rotd(); + return get_rotation_in_degrees(); } Size2 Node2D::get_scale() const { if (_xform_dirty) @@ -222,7 +222,7 @@ void Node2D::_notification(int p_what) { } } -Matrix32 Node2D::get_transform() const { +Transform2D Node2D::get_transform() const { return _mat; } @@ -240,17 +240,17 @@ Rect2 Node2D::get_item_rect() const { void Node2D::rotate(float p_radians) { - set_rot( get_rot() + p_radians); + set_rotation( get_rotation() + p_radians); } void Node2D::translate(const Vector2& p_amount) { - set_pos( get_pos() + p_amount ); + set_position( get_position() + p_amount ); } void Node2D::global_translate(const Vector2& p_amount) { - set_global_pos( get_global_pos() + p_amount ); + set_global_position( get_global_position() + p_amount ); } void Node2D::scale(const Size2& p_amount) { @@ -261,66 +261,66 @@ void Node2D::scale(const Size2& p_amount) { void Node2D::move_x(float p_delta,bool p_scaled){ - Matrix32 t = get_transform(); + Transform2D t = get_transform(); Vector2 m = t[0]; if (!p_scaled) m.normalize(); - set_pos(t[2]+m*p_delta); + set_position(t[2]+m*p_delta); } void Node2D::move_y(float p_delta,bool p_scaled){ - Matrix32 t = get_transform(); + Transform2D t = get_transform(); Vector2 m = t[1]; if (!p_scaled) m.normalize(); - set_pos(t[2]+m*p_delta); + set_position(t[2]+m*p_delta); } -Point2 Node2D::get_global_pos() const { +Point2 Node2D::get_global_position() const { return get_global_transform().get_origin(); } -void Node2D::set_global_pos(const Point2& p_pos) { +void Node2D::set_global_position(const Point2& p_pos) { - Matrix32 inv; + Transform2D inv; CanvasItem *pi = get_parent_item(); if (pi) { inv = pi->get_global_transform().affine_inverse(); - set_pos(inv.xform(p_pos)); + set_position(inv.xform(p_pos)); } else { - set_pos(p_pos); + set_position(p_pos); } } -float Node2D::get_global_rot() const { +float Node2D::get_global_rotation() const { return get_global_transform().get_rotation(); } -void Node2D::set_global_rot(float p_radians) { +void Node2D::set_global_rotation(float p_radians) { CanvasItem *pi = get_parent_item(); if (pi) { const float parent_global_rot = pi->get_global_transform().get_rotation(); - set_rot(p_radians - parent_global_rot); + set_rotation(p_radians - parent_global_rot); } else { - set_rot(p_radians); + set_rotation(p_radians); } } -float Node2D::get_global_rotd() const { +float Node2D::get_global_rotation_in_degrees() const { - return Math::rad2deg(get_global_rot()); + return Math::rad2deg(get_global_rotation()); } -void Node2D::set_global_rotd(float p_degrees) { +void Node2D::set_global_rotation_in_degrees(float p_degrees) { - set_global_rot(Math::deg2rad(p_degrees)); + set_global_rotation(Math::deg2rad(p_degrees)); } @@ -342,7 +342,7 @@ void Node2D::set_global_scale(const Size2& p_scale) { } -void Node2D::set_transform(const Matrix32& p_transform) { +void Node2D::set_transform(const Transform2D& p_transform) { _mat=p_transform; _xform_dirty=true; @@ -355,7 +355,7 @@ void Node2D::set_transform(const Matrix32& p_transform) { _notify_transform(); } -void Node2D::set_global_transform(const Matrix32& p_transform) { +void Node2D::set_global_transform(const Transform2D& p_transform) { CanvasItem *pi = get_parent_item(); if (pi) @@ -394,14 +394,14 @@ int Node2D::get_z() const{ return z; } -Matrix32 Node2D::get_relative_transform_to_parent(const Node *p_parent) const { +Transform2D Node2D::get_relative_transform_to_parent(const Node *p_parent) const { if (p_parent==this) - return Matrix32(); + return Transform2D(); Node2D *parent_2d = get_parent()->cast_to<Node2D>(); - ERR_FAIL_COND_V(!parent_2d,Matrix32()); + ERR_FAIL_COND_V(!parent_2d,Transform2D()); if (p_parent==parent_2d) return get_transform(); else @@ -423,56 +423,67 @@ void Node2D::_bind_methods() { // TODO: Obsolete those two methods (old name) properly (GH-4397) - ObjectTypeDB::bind_method(_MD("_get_rotd"),&Node2D::_get_rotd); - ObjectTypeDB::bind_method(_MD("_set_rotd","degrees"),&Node2D::_set_rotd); - - ObjectTypeDB::bind_method(_MD("set_pos","pos"),&Node2D::set_pos); - ObjectTypeDB::bind_method(_MD("set_rot","radians"),&Node2D::set_rot); - ObjectTypeDB::bind_method(_MD("set_rotd","degrees"),&Node2D::set_rotd); - ObjectTypeDB::bind_method(_MD("set_scale","scale"),&Node2D::set_scale); - - ObjectTypeDB::bind_method(_MD("get_pos"),&Node2D::get_pos); - ObjectTypeDB::bind_method(_MD("get_rot"),&Node2D::get_rot); - ObjectTypeDB::bind_method(_MD("get_rotd"),&Node2D::get_rotd); - ObjectTypeDB::bind_method(_MD("get_scale"),&Node2D::get_scale); - - ObjectTypeDB::bind_method(_MD("rotate","radians"),&Node2D::rotate); - ObjectTypeDB::bind_method(_MD("move_local_x","delta","scaled"),&Node2D::move_x,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("move_local_y","delta","scaled"),&Node2D::move_y,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("translate","offset"),&Node2D::translate); - ObjectTypeDB::bind_method(_MD("global_translate","offset"),&Node2D::global_translate); - ObjectTypeDB::bind_method(_MD("scale","ratio"),&Node2D::scale); - - ObjectTypeDB::bind_method(_MD("set_global_pos","pos"),&Node2D::set_global_pos); - ObjectTypeDB::bind_method(_MD("get_global_pos"),&Node2D::get_global_pos); - ObjectTypeDB::bind_method(_MD("set_global_rot","radians"),&Node2D::set_global_rot); - ObjectTypeDB::bind_method(_MD("get_global_rot"),&Node2D::get_global_rot); - ObjectTypeDB::bind_method(_MD("set_global_rotd","degrees"),&Node2D::set_global_rotd); - ObjectTypeDB::bind_method(_MD("get_global_rotd"),&Node2D::get_global_rotd); - ObjectTypeDB::bind_method(_MD("set_global_scale","scale"),&Node2D::set_global_scale); - ObjectTypeDB::bind_method(_MD("get_global_scale"),&Node2D::get_global_scale); - - ObjectTypeDB::bind_method(_MD("set_transform","xform"),&Node2D::set_transform); - ObjectTypeDB::bind_method(_MD("set_global_transform","xform"),&Node2D::set_global_transform); - - ObjectTypeDB::bind_method(_MD("look_at","point"),&Node2D::look_at); - ObjectTypeDB::bind_method(_MD("get_angle_to","point"),&Node2D::get_angle_to); - - ObjectTypeDB::bind_method(_MD("set_z","z"),&Node2D::set_z); - ObjectTypeDB::bind_method(_MD("get_z"),&Node2D::get_z); - - ObjectTypeDB::bind_method(_MD("set_z_as_relative","enable"),&Node2D::set_z_as_relative); - ObjectTypeDB::bind_method(_MD("is_z_relative"),&Node2D::is_z_relative); - - ObjectTypeDB::bind_method(_MD("edit_set_pivot","pivot"),&Node2D::edit_set_pivot); - - ObjectTypeDB::bind_method(_MD("get_relative_transform_to_parent","parent"),&Node2D::get_relative_transform_to_parent); - - ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2,"transform/pos"),_SCS("set_pos"),_SCS("get_pos")); - ADD_PROPERTYNZ(PropertyInfo(Variant::REAL,"transform/rot",PROPERTY_HINT_RANGE,"-1440,1440,0.1"),_SCS("set_rotd"),_SCS("get_rotd")); - ADD_PROPERTYNO(PropertyInfo(Variant::VECTOR2,"transform/scale"),_SCS("set_scale"),_SCS("get_scale")); - ADD_PROPERTYNZ(PropertyInfo(Variant::INT,"z/z",PROPERTY_HINT_RANGE,itos(VS::CANVAS_ITEM_Z_MIN)+","+itos(VS::CANVAS_ITEM_Z_MAX)+",1"),_SCS("set_z"),_SCS("get_z")); - ADD_PROPERTYNO(PropertyInfo(Variant::BOOL,"z/relative"),_SCS("set_z_as_relative"),_SCS("is_z_relative")); + ClassDB::bind_method(_MD("_get_rotd"),&Node2D::_get_rotd); + ClassDB::bind_method(_MD("_set_rotd","degrees"),&Node2D::_set_rotd); + + ClassDB::bind_method(_MD("set_position","pos"),&Node2D::set_position); + ClassDB::bind_method(_MD("set_rotation","radians"),&Node2D::set_rotation); + ClassDB::bind_method(_MD("set_rotation_in_degrees","degrees"),&Node2D::set_rotation_in_degrees); + ClassDB::bind_method(_MD("set_scale","scale"),&Node2D::set_scale); + + ClassDB::bind_method(_MD("get_position"),&Node2D::get_position); + ClassDB::bind_method(_MD("get_rotation"),&Node2D::get_rotation); + ClassDB::bind_method(_MD("get_rotation_in_degrees"),&Node2D::get_rotation_in_degrees); + ClassDB::bind_method(_MD("get_scale"),&Node2D::get_scale); + + ClassDB::bind_method(_MD("rotate","radians"),&Node2D::rotate); + ClassDB::bind_method(_MD("move_local_x","delta","scaled"),&Node2D::move_x,DEFVAL(false)); + ClassDB::bind_method(_MD("move_local_y","delta","scaled"),&Node2D::move_y,DEFVAL(false)); + ClassDB::bind_method(_MD("translate","offset"),&Node2D::translate); + ClassDB::bind_method(_MD("global_translate","offset"),&Node2D::global_translate); + ClassDB::bind_method(_MD("scale","ratio"),&Node2D::scale); + + ClassDB::bind_method(_MD("set_global_position","pos"),&Node2D::set_global_position); + ClassDB::bind_method(_MD("get_global_position"),&Node2D::get_global_position); + ClassDB::bind_method(_MD("set_global_rotation","radians"),&Node2D::set_global_rotation); + ClassDB::bind_method(_MD("get_global_rotation"),&Node2D::get_global_rotation); + ClassDB::bind_method(_MD("set_global_rotation_in_degrees","degrees"),&Node2D::set_global_rotation_in_degrees); + ClassDB::bind_method(_MD("get_global_rotation_in_degrees"),&Node2D::get_global_rotation_in_degrees); + ClassDB::bind_method(_MD("set_global_scale","scale"),&Node2D::set_global_scale); + ClassDB::bind_method(_MD("get_global_scale"),&Node2D::get_global_scale); + + ClassDB::bind_method(_MD("set_transform","xform"),&Node2D::set_transform); + ClassDB::bind_method(_MD("set_global_transform","xform"),&Node2D::set_global_transform); + + ClassDB::bind_method(_MD("look_at","point"),&Node2D::look_at); + ClassDB::bind_method(_MD("get_angle_to","point"),&Node2D::get_angle_to); + + ClassDB::bind_method(_MD("set_z","z"),&Node2D::set_z); + ClassDB::bind_method(_MD("get_z"),&Node2D::get_z); + + ClassDB::bind_method(_MD("set_z_as_relative","enable"),&Node2D::set_z_as_relative); + ClassDB::bind_method(_MD("is_z_relative"),&Node2D::is_z_relative); + + ClassDB::bind_method(_MD("edit_set_pivot","pivot"),&Node2D::edit_set_pivot); + + ClassDB::bind_method(_MD("get_relative_transform_to_parent","parent"),&Node2D::get_relative_transform_to_parent); + + ADD_GROUP("Transform",""); + ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2,"position"),_SCS("set_position"),_SCS("get_position")); + ADD_PROPERTYNZ(PropertyInfo(Variant::REAL,"rotation",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_rotation"),_SCS("get_rotation")); + ADD_PROPERTYNZ(PropertyInfo(Variant::REAL,"rotation_deg",PROPERTY_HINT_RANGE,"-1440,1440,0.1",PROPERTY_USAGE_EDITOR),_SCS("set_rotation_in_degrees"),_SCS("get_rotation_in_degrees")); + ADD_PROPERTYNO(PropertyInfo(Variant::VECTOR2,"scale"),_SCS("set_scale"),_SCS("get_scale")); + ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D,"transform",PROPERTY_HINT_NONE,"",0),_SCS("set_transform"),_SCS("get_transform")); + + ADD_PROPERTY(PropertyInfo(Variant::REAL,"global_position",PROPERTY_HINT_NONE,"",0),_SCS("set_global_position"),_SCS("get_global_position")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"global_rotation",PROPERTY_HINT_NONE,"",0),_SCS("set_global_rotation"),_SCS("get_global_rotation")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"global_rotation_deg",PROPERTY_HINT_NONE,"",0),_SCS("set_global_rotation_in_degrees"),_SCS("get_global_rotation_in_degrees")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"global_scale",PROPERTY_HINT_NONE,"",0),_SCS("set_global_scale"),_SCS("get_global_scale")); + ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D,"global_transform",PROPERTY_HINT_NONE,"",0),_SCS("set_global_transform"),_SCS("get_global_transform")); + + ADD_GROUP("Z",""); + ADD_PROPERTYNZ(PropertyInfo(Variant::INT,"z",PROPERTY_HINT_RANGE,itos(VS::CANVAS_ITEM_Z_MIN)+","+itos(VS::CANVAS_ITEM_Z_MAX)+",1"),_SCS("set_z"),_SCS("get_z")); + ADD_PROPERTYNO(PropertyInfo(Variant::BOOL,"z_as_relative"),_SCS("set_z_as_relative"),_SCS("is_z_relative")); } diff --git a/scene/2d/node_2d.h b/scene/2d/node_2d.h index b31ee08af6..2cceef0f06 100644 --- a/scene/2d/node_2d.h +++ b/scene/2d/node_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class Node2D : public CanvasItem { - OBJ_TYPE(Node2D, CanvasItem ); + GDCLASS(Node2D, CanvasItem ); Point2 pos; float angle; @@ -41,7 +41,7 @@ class Node2D : public CanvasItem { int z; bool z_relative; - Matrix32 _mat; + Transform2D _mat; bool _xform_dirty; @@ -69,9 +69,9 @@ public: virtual Point2 edit_get_pivot() const; virtual bool edit_has_pivot() const; - void set_pos(const Point2& p_pos); - void set_rot(float p_radians); - void set_rotd(float p_degrees); + void set_position(const Point2& p_pos); + void set_rotation(float p_radians); + void set_rotation_in_degrees(float p_degrees); void set_scale(const Size2& p_scale); void rotate(float p_radians); @@ -81,22 +81,22 @@ public: void global_translate(const Vector2& p_amount); void scale(const Size2& p_amount); - Point2 get_pos() const; - float get_rot() const; - float get_rotd() const; + Point2 get_position() const; + float get_rotation() const; + float get_rotation_in_degrees() const; Size2 get_scale() const; - Point2 get_global_pos() const; - float get_global_rot() const; - float get_global_rotd() const; + Point2 get_global_position() const; + float get_global_rotation() const; + float get_global_rotation_in_degrees() const; Size2 get_global_scale() const; virtual Rect2 get_item_rect() const; - void set_transform(const Matrix32& p_transform); - void set_global_transform(const Matrix32& p_transform); - void set_global_pos(const Point2& p_pos); - void set_global_rot(float p_radians); - void set_global_rotd(float p_degrees); + void set_transform(const Transform2D& p_transform); + void set_global_transform(const Transform2D& p_transform); + void set_global_position(const Point2& p_pos); + void set_global_rotation(float p_radians); + void set_global_rotation_in_degrees(float p_degrees); void set_global_scale(const Size2& p_scale); void set_z(int p_z); @@ -108,9 +108,9 @@ public: void set_z_as_relative(bool p_enabled); bool is_z_relative() const; - Matrix32 get_relative_transform_to_parent(const Node *p_parent) const; + Transform2D get_relative_transform_to_parent(const Node *p_parent) const; - Matrix32 get_transform() const; + Transform2D get_transform() const; Node2D(); }; diff --git a/scene/2d/parallax_background.cpp b/scene/2d/parallax_background.cpp index 1b6ab66fcc..1e6a449fce 100644 --- a/scene/2d/parallax_background.cpp +++ b/scene/2d/parallax_background.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -50,7 +50,7 @@ void ParallaxBackground::_notification(int p_what) { } -void ParallaxBackground::_camera_moved(const Matrix32& p_transform) { +void ParallaxBackground::_camera_moved(const Transform2D& p_transform) { set_scroll_offset(p_transform.get_origin()); @@ -189,27 +189,28 @@ Vector2 ParallaxBackground::get_final_offset() const { void ParallaxBackground::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_camera_moved"),&ParallaxBackground::_camera_moved); - ObjectTypeDB::bind_method(_MD("set_scroll_offset","ofs"),&ParallaxBackground::set_scroll_offset); - ObjectTypeDB::bind_method(_MD("get_scroll_offset"),&ParallaxBackground::get_scroll_offset); - ObjectTypeDB::bind_method(_MD("set_scroll_base_offset","ofs"),&ParallaxBackground::set_scroll_base_offset); - ObjectTypeDB::bind_method(_MD("get_scroll_base_offset"),&ParallaxBackground::get_scroll_base_offset); - ObjectTypeDB::bind_method(_MD("set_scroll_base_scale","scale"),&ParallaxBackground::set_scroll_base_scale); - ObjectTypeDB::bind_method(_MD("get_scroll_base_scale"),&ParallaxBackground::get_scroll_base_scale); - ObjectTypeDB::bind_method(_MD("set_limit_begin","ofs"),&ParallaxBackground::set_limit_begin); - ObjectTypeDB::bind_method(_MD("get_limit_begin"),&ParallaxBackground::get_limit_begin); - ObjectTypeDB::bind_method(_MD("set_limit_end","ofs"),&ParallaxBackground::set_limit_end); - ObjectTypeDB::bind_method(_MD("get_limit_end"),&ParallaxBackground::get_limit_end); - ObjectTypeDB::bind_method(_MD("set_ignore_camera_zoom","ignore"), &ParallaxBackground::set_ignore_camera_zoom); - ObjectTypeDB::bind_method(_MD("is_ignore_camera_zoom"), &ParallaxBackground::is_ignore_camera_zoom); - - - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"scroll/offset"),_SCS("set_scroll_offset"),_SCS("get_scroll_offset")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"scroll/base_offset"),_SCS("set_scroll_base_offset"),_SCS("get_scroll_base_offset")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"scroll/base_scale"),_SCS("set_scroll_base_scale"),_SCS("get_scroll_base_scale")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"scroll/limit_begin"),_SCS("set_limit_begin"),_SCS("get_limit_begin")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"scroll/limit_end"),_SCS("set_limit_end"),_SCS("get_limit_end")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "scroll/ignore_camera_zoom"), _SCS("set_ignore_camera_zoom"), _SCS("is_ignore_camera_zoom")); + ClassDB::bind_method(_MD("_camera_moved"),&ParallaxBackground::_camera_moved); + ClassDB::bind_method(_MD("set_scroll_offset","ofs"),&ParallaxBackground::set_scroll_offset); + ClassDB::bind_method(_MD("get_scroll_offset"),&ParallaxBackground::get_scroll_offset); + ClassDB::bind_method(_MD("set_scroll_base_offset","ofs"),&ParallaxBackground::set_scroll_base_offset); + ClassDB::bind_method(_MD("get_scroll_base_offset"),&ParallaxBackground::get_scroll_base_offset); + ClassDB::bind_method(_MD("set_scroll_base_scale","scale"),&ParallaxBackground::set_scroll_base_scale); + ClassDB::bind_method(_MD("get_scroll_base_scale"),&ParallaxBackground::get_scroll_base_scale); + ClassDB::bind_method(_MD("set_limit_begin","ofs"),&ParallaxBackground::set_limit_begin); + ClassDB::bind_method(_MD("get_limit_begin"),&ParallaxBackground::get_limit_begin); + ClassDB::bind_method(_MD("set_limit_end","ofs"),&ParallaxBackground::set_limit_end); + ClassDB::bind_method(_MD("get_limit_end"),&ParallaxBackground::get_limit_end); + ClassDB::bind_method(_MD("set_ignore_camera_zoom","ignore"), &ParallaxBackground::set_ignore_camera_zoom); + ClassDB::bind_method(_MD("is_ignore_camera_zoom"), &ParallaxBackground::is_ignore_camera_zoom); + + + ADD_GROUP("Scroll","scroll_"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"scroll_offset"),_SCS("set_scroll_offset"),_SCS("get_scroll_offset")); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"scroll_base_offset"),_SCS("set_scroll_base_offset"),_SCS("get_scroll_base_offset")); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"scroll_base_scale"),_SCS("set_scroll_base_scale"),_SCS("get_scroll_base_scale")); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"scroll_limit_begin"),_SCS("set_limit_begin"),_SCS("get_limit_begin")); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"scroll_limit_end"),_SCS("set_limit_end"),_SCS("get_limit_end")); + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "scroll_ignore_camera_zoom"), _SCS("set_ignore_camera_zoom"), _SCS("is_ignore_camera_zoom")); } diff --git a/scene/2d/parallax_background.h b/scene/2d/parallax_background.h index c00cd52f26..caef4962e8 100644 --- a/scene/2d/parallax_background.h +++ b/scene/2d/parallax_background.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class ParallaxBackground : public CanvasLayer { - OBJ_TYPE( ParallaxBackground, CanvasLayer ); + GDCLASS( ParallaxBackground, CanvasLayer ); Point2 offset; float scale; @@ -50,7 +50,7 @@ class ParallaxBackground : public CanvasLayer { void _update_scroll(); protected: - void _camera_moved(const Matrix32& p_transform); + void _camera_moved(const Transform2D& p_transform); void _notification(int p_what); static void _bind_methods(); diff --git a/scene/2d/parallax_layer.cpp b/scene/2d/parallax_layer.cpp index 05136de5d6..9aa6640727 100644 --- a/scene/2d/parallax_layer.cpp +++ b/scene/2d/parallax_layer.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -107,7 +107,7 @@ void ParallaxLayer::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { - orig_offset=get_pos(); + orig_offset=get_position(); orig_scale=get_scale(); _update_mirroring(); } break; @@ -132,7 +132,7 @@ void ParallaxLayer::set_base_offset_and_scale(const Point2& p_offset,float p_sca new_ofs.y -= den*ceil(new_ofs.y/den); } - set_pos(new_ofs); + set_position(new_ofs); set_scale(Vector2(1,1)*p_scale); @@ -150,16 +150,17 @@ String ParallaxLayer::get_configuration_warning() const { void ParallaxLayer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_motion_scale","scale"),&ParallaxLayer::set_motion_scale); - ObjectTypeDB::bind_method(_MD("get_motion_scale"),&ParallaxLayer::get_motion_scale); - ObjectTypeDB::bind_method(_MD("set_motion_offset","offset"),&ParallaxLayer::set_motion_offset); - ObjectTypeDB::bind_method(_MD("get_motion_offset"),&ParallaxLayer::get_motion_offset); - ObjectTypeDB::bind_method(_MD("set_mirroring","mirror"),&ParallaxLayer::set_mirroring); - ObjectTypeDB::bind_method(_MD("get_mirroring"),&ParallaxLayer::get_mirroring); - - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"motion/scale"),_SCS("set_motion_scale"),_SCS("get_motion_scale")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"motion/offset"),_SCS("set_motion_offset"),_SCS("get_motion_offset")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"motion/mirroring"),_SCS("set_mirroring"),_SCS("get_mirroring")); + ClassDB::bind_method(_MD("set_motion_scale","scale"),&ParallaxLayer::set_motion_scale); + ClassDB::bind_method(_MD("get_motion_scale"),&ParallaxLayer::get_motion_scale); + ClassDB::bind_method(_MD("set_motion_offset","offset"),&ParallaxLayer::set_motion_offset); + ClassDB::bind_method(_MD("get_motion_offset"),&ParallaxLayer::get_motion_offset); + ClassDB::bind_method(_MD("set_mirroring","mirror"),&ParallaxLayer::set_mirroring); + ClassDB::bind_method(_MD("get_mirroring"),&ParallaxLayer::get_mirroring); + + ADD_GROUP("Motion","motion_"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"motion_scale"),_SCS("set_motion_scale"),_SCS("get_motion_scale")); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"motion_offset"),_SCS("set_motion_offset"),_SCS("get_motion_offset")); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"motion_mirroring"),_SCS("set_mirroring"),_SCS("get_mirroring")); } diff --git a/scene/2d/parallax_layer.h b/scene/2d/parallax_layer.h index 6b1d73ea66..1b3d67af5e 100644 --- a/scene/2d/parallax_layer.h +++ b/scene/2d/parallax_layer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class ParallaxLayer : public Node2D { - OBJ_TYPE( ParallaxLayer, Node2D ); + GDCLASS( ParallaxLayer, Node2D ); Point2 orig_offset; Point2 orig_scale; diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp index 29dad630d6..cb866165ff 100644 --- a/scene/2d/particles_2d.cpp +++ b/scene/2d/particles_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -113,23 +113,23 @@ void ParticleAttractor2D::_set_owner(Particles2D* p_owner) { void ParticleAttractor2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_enabled","enabled"),&ParticleAttractor2D::set_enabled); - ObjectTypeDB::bind_method(_MD("is_enabled"),&ParticleAttractor2D::is_enabled); + ClassDB::bind_method(_MD("set_enabled","enabled"),&ParticleAttractor2D::set_enabled); + ClassDB::bind_method(_MD("is_enabled"),&ParticleAttractor2D::is_enabled); - ObjectTypeDB::bind_method(_MD("set_radius","radius"),&ParticleAttractor2D::set_radius); - ObjectTypeDB::bind_method(_MD("get_radius"),&ParticleAttractor2D::get_radius); + ClassDB::bind_method(_MD("set_radius","radius"),&ParticleAttractor2D::set_radius); + ClassDB::bind_method(_MD("get_radius"),&ParticleAttractor2D::get_radius); - ObjectTypeDB::bind_method(_MD("set_disable_radius","radius"),&ParticleAttractor2D::set_disable_radius); - ObjectTypeDB::bind_method(_MD("get_disable_radius"),&ParticleAttractor2D::get_disable_radius); + ClassDB::bind_method(_MD("set_disable_radius","radius"),&ParticleAttractor2D::set_disable_radius); + ClassDB::bind_method(_MD("get_disable_radius"),&ParticleAttractor2D::get_disable_radius); - ObjectTypeDB::bind_method(_MD("set_gravity","gravity"),&ParticleAttractor2D::set_gravity); - ObjectTypeDB::bind_method(_MD("get_gravity"),&ParticleAttractor2D::get_gravity); + ClassDB::bind_method(_MD("set_gravity","gravity"),&ParticleAttractor2D::set_gravity); + ClassDB::bind_method(_MD("get_gravity"),&ParticleAttractor2D::get_gravity); - ObjectTypeDB::bind_method(_MD("set_absorption","absorption"),&ParticleAttractor2D::set_absorption); - ObjectTypeDB::bind_method(_MD("get_absorption"),&ParticleAttractor2D::get_absorption); + ClassDB::bind_method(_MD("set_absorption","absorption"),&ParticleAttractor2D::set_absorption); + ClassDB::bind_method(_MD("get_absorption"),&ParticleAttractor2D::get_absorption); - ObjectTypeDB::bind_method(_MD("set_particles_path","path"),&ParticleAttractor2D::set_particles_path); - ObjectTypeDB::bind_method(_MD("get_particles_path"),&ParticleAttractor2D::get_particles_path); + ClassDB::bind_method(_MD("set_particles_path","path"),&ParticleAttractor2D::set_particles_path); + ClassDB::bind_method(_MD("get_particles_path"),&ParticleAttractor2D::get_particles_path); ADD_PROPERTY(PropertyInfo(Variant::BOOL,"enabled"),_SCS("set_enabled"),_SCS("is_enabled")); ADD_PROPERTY(PropertyInfo(Variant::REAL,"radius",PROPERTY_HINT_RANGE,"0.1,16000,0.1"),_SCS("set_radius"),_SCS("get_radius")); @@ -270,13 +270,13 @@ void Particles2D::_process_particles(float p_delta) { Particle *pdata=&particles[0]; int particle_count=particles.size(); - Matrix32 xform; + Transform2D xform; if (!local_space) xform=get_global_transform(); active_count=0; - DVector<Point2>::Read r; + PoolVector<Point2>::Read r; int emission_point_count=0; if (emission_points.size()) { @@ -293,13 +293,13 @@ void Particles2D::_process_particles(float p_delta) { } int idx=0; - Matrix32 m; + Transform2D m; if (local_space) { m= get_global_transform().affine_inverse(); } for (Set<ParticleAttractor2D*>::Element *E=attractors.front();E;E=E->next()) { - attractor_cache[idx].pos=m.xform( E->get()->get_global_pos() ); + attractor_cache[idx].pos=m.xform( E->get()->get_global_position() ); attractor_cache[idx].attractor=E->get(); idx++; } @@ -391,7 +391,7 @@ void Particles2D::_process_particles(float p_delta) { float orbitvel = (param[PARAM_ORBIT_VELOCITY]+param[PARAM_ORBIT_VELOCITY]*randomness[PARAM_ORBIT_VELOCITY]*_rand_from_seed(&rand_seed)); if (orbitvel!=0) { Vector2 rel = p.pos - xform.elements[2]; - Matrix32 rot(orbitvel*frame_time,Vector2()); + Transform2D rot(orbitvel*frame_time,Vector2()); p.pos = rot.xform(rel) + xform.elements[2]; } @@ -507,7 +507,7 @@ void Particles2D::_notification(int p_what) { if (texture.is_valid()) texrid = texture->get_rid(); - Matrix32 invxform; + Transform2D invxform; if (!local_space) invxform=get_global_transform().affine_inverse(); @@ -563,7 +563,7 @@ void Particles2D::_notification(int p_what) { } } - float initial_size = param[PARAM_INITIAL_SIZE]+param[PARAM_INITIAL_SIZE]*_rand_from_seed(&rand_seed)*randomness[PARAM_FINAL_SIZE]; + float initial_size = param[PARAM_INITIAL_SIZE]+param[PARAM_INITIAL_SIZE]*_rand_from_seed(&rand_seed)*randomness[PARAM_INITIAL_SIZE]; float final_size = param[PARAM_FINAL_SIZE]+param[PARAM_FINAL_SIZE]*_rand_from_seed(&rand_seed)*randomness[PARAM_FINAL_SIZE]; float size_mult=initial_size*(1.0-ptime) + final_size*ptime; @@ -573,7 +573,7 @@ void Particles2D::_notification(int p_what) { //Rect2 r = Rect2(Vecto,rectsize); - Matrix32 xform; + Transform2D xform; if (p.rot) { @@ -992,12 +992,12 @@ int Particles2D::get_v_frames() const{ -void Particles2D::set_emission_points(const DVector<Vector2>& p_points) { +void Particles2D::set_emission_points(const PoolVector<Vector2>& p_points) { emission_points=p_points; } -DVector<Vector2> Particles2D::get_emission_points() const{ +PoolVector<Vector2> Particles2D::get_emission_points() const{ return emission_points; } @@ -1013,80 +1013,80 @@ void Particles2D::reset() { void Particles2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_emitting","active"),&Particles2D::set_emitting); - ObjectTypeDB::bind_method(_MD("is_emitting"),&Particles2D::is_emitting); + ClassDB::bind_method(_MD("set_emitting","active"),&Particles2D::set_emitting); + ClassDB::bind_method(_MD("is_emitting"),&Particles2D::is_emitting); - ObjectTypeDB::bind_method(_MD("set_amount","amount"),&Particles2D::set_amount); - ObjectTypeDB::bind_method(_MD("get_amount"),&Particles2D::get_amount); + ClassDB::bind_method(_MD("set_amount","amount"),&Particles2D::set_amount); + ClassDB::bind_method(_MD("get_amount"),&Particles2D::get_amount); - ObjectTypeDB::bind_method(_MD("set_lifetime","lifetime"),&Particles2D::set_lifetime); - ObjectTypeDB::bind_method(_MD("get_lifetime"),&Particles2D::get_lifetime); + ClassDB::bind_method(_MD("set_lifetime","lifetime"),&Particles2D::set_lifetime); + ClassDB::bind_method(_MD("get_lifetime"),&Particles2D::get_lifetime); - ObjectTypeDB::bind_method(_MD("set_time_scale","time_scale"),&Particles2D::set_time_scale); - ObjectTypeDB::bind_method(_MD("get_time_scale"),&Particles2D::get_time_scale); + ClassDB::bind_method(_MD("set_time_scale","time_scale"),&Particles2D::set_time_scale); + ClassDB::bind_method(_MD("get_time_scale"),&Particles2D::get_time_scale); - ObjectTypeDB::bind_method(_MD("set_pre_process_time","time"),&Particles2D::set_pre_process_time); - ObjectTypeDB::bind_method(_MD("get_pre_process_time"),&Particles2D::get_pre_process_time); + ClassDB::bind_method(_MD("set_pre_process_time","time"),&Particles2D::set_pre_process_time); + ClassDB::bind_method(_MD("get_pre_process_time"),&Particles2D::get_pre_process_time); - ObjectTypeDB::bind_method(_MD("set_emit_timeout","value"),&Particles2D::set_emit_timeout); - ObjectTypeDB::bind_method(_MD("get_emit_timeout"),&Particles2D::get_emit_timeout); + ClassDB::bind_method(_MD("set_emit_timeout","value"),&Particles2D::set_emit_timeout); + ClassDB::bind_method(_MD("get_emit_timeout"),&Particles2D::get_emit_timeout); - ObjectTypeDB::bind_method(_MD("set_param","param","value"),&Particles2D::set_param); - ObjectTypeDB::bind_method(_MD("get_param","param"),&Particles2D::get_param); + ClassDB::bind_method(_MD("set_param","param","value"),&Particles2D::set_param); + ClassDB::bind_method(_MD("get_param","param"),&Particles2D::get_param); - ObjectTypeDB::bind_method(_MD("set_randomness","param","value"),&Particles2D::set_randomness); - ObjectTypeDB::bind_method(_MD("get_randomness","param"),&Particles2D::get_randomness); + ClassDB::bind_method(_MD("set_randomness","param","value"),&Particles2D::set_randomness); + ClassDB::bind_method(_MD("get_randomness","param"),&Particles2D::get_randomness); - ObjectTypeDB::bind_method(_MD("set_texture:Texture","texture"),&Particles2D::set_texture); - ObjectTypeDB::bind_method(_MD("get_texture:Texture"),&Particles2D::get_texture); + ClassDB::bind_method(_MD("set_texture:Texture","texture"),&Particles2D::set_texture); + ClassDB::bind_method(_MD("get_texture:Texture"),&Particles2D::get_texture); - ObjectTypeDB::bind_method(_MD("set_color","color"),&Particles2D::set_color); - ObjectTypeDB::bind_method(_MD("get_color"),&Particles2D::get_color); + ClassDB::bind_method(_MD("set_color","color"),&Particles2D::set_color); + ClassDB::bind_method(_MD("get_color"),&Particles2D::get_color); - ObjectTypeDB::bind_method(_MD("set_color_ramp:ColorRamp","color_ramp"),&Particles2D::set_color_ramp); - ObjectTypeDB::bind_method(_MD("get_color_ramp:ColorRamp"),&Particles2D::get_color_ramp); + ClassDB::bind_method(_MD("set_color_ramp:ColorRamp","color_ramp"),&Particles2D::set_color_ramp); + ClassDB::bind_method(_MD("get_color_ramp:ColorRamp"),&Particles2D::get_color_ramp); - ObjectTypeDB::bind_method(_MD("set_emissor_offset","offset"),&Particles2D::set_emissor_offset); - ObjectTypeDB::bind_method(_MD("get_emissor_offset"),&Particles2D::get_emissor_offset); + ClassDB::bind_method(_MD("set_emissor_offset","offset"),&Particles2D::set_emissor_offset); + ClassDB::bind_method(_MD("get_emissor_offset"),&Particles2D::get_emissor_offset); - ObjectTypeDB::bind_method(_MD("set_flip_h","enable"),&Particles2D::set_flip_h); - ObjectTypeDB::bind_method(_MD("is_flipped_h"),&Particles2D::is_flipped_h); + ClassDB::bind_method(_MD("set_flip_h","enable"),&Particles2D::set_flip_h); + ClassDB::bind_method(_MD("is_flipped_h"),&Particles2D::is_flipped_h); - ObjectTypeDB::bind_method(_MD("set_flip_v","enable"),&Particles2D::set_flip_v); - ObjectTypeDB::bind_method(_MD("is_flipped_v"),&Particles2D::is_flipped_v); + ClassDB::bind_method(_MD("set_flip_v","enable"),&Particles2D::set_flip_v); + ClassDB::bind_method(_MD("is_flipped_v"),&Particles2D::is_flipped_v); - ObjectTypeDB::bind_method(_MD("set_h_frames","enable"),&Particles2D::set_h_frames); - ObjectTypeDB::bind_method(_MD("get_h_frames"),&Particles2D::get_h_frames); + ClassDB::bind_method(_MD("set_h_frames","enable"),&Particles2D::set_h_frames); + ClassDB::bind_method(_MD("get_h_frames"),&Particles2D::get_h_frames); - ObjectTypeDB::bind_method(_MD("set_v_frames","enable"),&Particles2D::set_v_frames); - ObjectTypeDB::bind_method(_MD("get_v_frames"),&Particles2D::get_v_frames); + ClassDB::bind_method(_MD("set_v_frames","enable"),&Particles2D::set_v_frames); + ClassDB::bind_method(_MD("get_v_frames"),&Particles2D::get_v_frames); - ObjectTypeDB::bind_method(_MD("set_emission_half_extents","extents"),&Particles2D::set_emission_half_extents); - ObjectTypeDB::bind_method(_MD("get_emission_half_extents"),&Particles2D::get_emission_half_extents); + ClassDB::bind_method(_MD("set_emission_half_extents","extents"),&Particles2D::set_emission_half_extents); + ClassDB::bind_method(_MD("get_emission_half_extents"),&Particles2D::get_emission_half_extents); - ObjectTypeDB::bind_method(_MD("set_color_phases","phases"),&Particles2D::set_color_phases); - ObjectTypeDB::bind_method(_MD("get_color_phases"),&Particles2D::get_color_phases); + ClassDB::bind_method(_MD("set_color_phases","phases"),&Particles2D::set_color_phases); + ClassDB::bind_method(_MD("get_color_phases"),&Particles2D::get_color_phases); - ObjectTypeDB::bind_method(_MD("set_color_phase_color","phase","color"),&Particles2D::set_color_phase_color); - ObjectTypeDB::bind_method(_MD("get_color_phase_color","phase"),&Particles2D::get_color_phase_color); + ClassDB::bind_method(_MD("set_color_phase_color","phase","color"),&Particles2D::set_color_phase_color); + ClassDB::bind_method(_MD("get_color_phase_color","phase"),&Particles2D::get_color_phase_color); - ObjectTypeDB::bind_method(_MD("set_color_phase_pos","phase","pos"),&Particles2D::set_color_phase_pos); - ObjectTypeDB::bind_method(_MD("get_color_phase_pos","phase"),&Particles2D::get_color_phase_pos); + ClassDB::bind_method(_MD("set_color_phase_pos","phase","pos"),&Particles2D::set_color_phase_pos); + ClassDB::bind_method(_MD("get_color_phase_pos","phase"),&Particles2D::get_color_phase_pos); - ObjectTypeDB::bind_method(_MD("pre_process","time"),&Particles2D::pre_process); - ObjectTypeDB::bind_method(_MD("reset"),&Particles2D::reset); + ClassDB::bind_method(_MD("pre_process","time"),&Particles2D::pre_process); + ClassDB::bind_method(_MD("reset"),&Particles2D::reset); - ObjectTypeDB::bind_method(_MD("set_use_local_space","enable"),&Particles2D::set_use_local_space); - ObjectTypeDB::bind_method(_MD("is_using_local_space"),&Particles2D::is_using_local_space); + ClassDB::bind_method(_MD("set_use_local_space","enable"),&Particles2D::set_use_local_space); + ClassDB::bind_method(_MD("is_using_local_space"),&Particles2D::is_using_local_space); - ObjectTypeDB::bind_method(_MD("set_initial_velocity","velocity"),&Particles2D::set_initial_velocity); - ObjectTypeDB::bind_method(_MD("get_initial_velocity"),&Particles2D::get_initial_velocity); + ClassDB::bind_method(_MD("set_initial_velocity","velocity"),&Particles2D::set_initial_velocity); + ClassDB::bind_method(_MD("get_initial_velocity"),&Particles2D::get_initial_velocity); - ObjectTypeDB::bind_method(_MD("set_explosiveness","amount"),&Particles2D::set_explosiveness); - ObjectTypeDB::bind_method(_MD("get_explosiveness"),&Particles2D::get_explosiveness); + ClassDB::bind_method(_MD("set_explosiveness","amount"),&Particles2D::set_explosiveness); + ClassDB::bind_method(_MD("get_explosiveness"),&Particles2D::get_explosiveness); - ObjectTypeDB::bind_method(_MD("set_emission_points","points"),&Particles2D::set_emission_points); - ObjectTypeDB::bind_method(_MD("get_emission_points"),&Particles2D::get_emission_points); + ClassDB::bind_method(_MD("set_emission_points","points"),&Particles2D::set_emission_points); + ClassDB::bind_method(_MD("get_emission_points"),&Particles2D::get_emission_points); ADD_PROPERTY(PropertyInfo(Variant::INT,"config/amount",PROPERTY_HINT_EXP_RANGE,"1,1024"),_SCS("set_amount"),_SCS("get_amount") ); ADD_PROPERTY(PropertyInfo(Variant::REAL,"config/lifetime",PROPERTY_HINT_EXP_RANGE,"0.1,3600,0.1"),_SCS("set_lifetime"),_SCS("get_lifetime") ); @@ -1125,7 +1125,7 @@ void Particles2D::_bind_methods() { ADD_PROPERTYNO(PropertyInfo(Variant::COLOR, "color/color"),_SCS("set_color"),_SCS("get_color")); ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"color/color_ramp",PROPERTY_HINT_RESOURCE_TYPE,"ColorRamp"),_SCS("set_color_ramp"),_SCS("get_color_ramp")); - ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2_ARRAY,"emission_points",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_emission_points"),_SCS("get_emission_points")); + ADD_PROPERTYNZ(PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"emission_points",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_emission_points"),_SCS("get_emission_points")); BIND_CONSTANT( PARAM_DIRECTION ); BIND_CONSTANT( PARAM_SPREAD ); diff --git a/scene/2d/particles_2d.h b/scene/2d/particles_2d.h index b1ae1f5bc1..91f42c5222 100644 --- a/scene/2d/particles_2d.h +++ b/scene/2d/particles_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ class Particles2D; class ParticleAttractor2D : public Node2D { - OBJ_TYPE(ParticleAttractor2D,Node2D); + GDCLASS(ParticleAttractor2D,Node2D); friend class Particles2D; @@ -84,7 +84,7 @@ public: class Particles2D : public Node2D { - OBJ_TYPE(Particles2D, Node2D); + GDCLASS(Particles2D, Node2D); public: enum Parameter { @@ -117,7 +117,6 @@ private: float randomness[PARAM_MAX]; struct Particle { - bool active; Point2 pos; Vector2 velocity; @@ -152,7 +151,7 @@ private: Point2 emissor_offset; Vector2 initial_velocity; Vector2 extents; - DVector<Vector2> emission_points; + PoolVector<Vector2> emission_points; float time; int active_count; @@ -246,8 +245,8 @@ public: void set_initial_velocity(const Vector2& p_velocity); Vector2 get_initial_velocity() const; - void set_emission_points(const DVector<Vector2>& p_points); - DVector<Vector2> get_emission_points() const; + void set_emission_points(const PoolVector<Vector2>& p_points); + PoolVector<Vector2> get_emission_points() const; void pre_process(float p_delta); void reset(); diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index 41ca7b1d0f..0508a715eb 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -85,9 +85,9 @@ Ref<Curve2D> Path2D::get_curve() const{ void Path2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_curve","curve:Curve2D"),&Path2D::set_curve); - ObjectTypeDB::bind_method(_MD("get_curve:Curve2D","curve"),&Path2D::get_curve); - ObjectTypeDB::bind_method(_MD("_curve_changed"),&Path2D::_curve_changed); + ClassDB::bind_method(_MD("set_curve","curve:Curve2D"),&Path2D::set_curve); + ClassDB::bind_method(_MD("get_curve:Curve2D","curve"),&Path2D::get_curve); + ClassDB::bind_method(_MD("_curve_changed"),&Path2D::_curve_changed); ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve2D"), _SCS("set_curve"),_SCS("get_curve")); } @@ -124,7 +124,7 @@ void PathFollow2D::_update_transform() { pos+=n*h_offset; pos+=t*v_offset; - set_rot(t.angle()); + set_rotation(t.angle()); } else { @@ -132,7 +132,7 @@ void PathFollow2D::_update_transform() { pos.y+=v_offset; } - set_pos(pos); + set_position(pos); } @@ -252,26 +252,26 @@ String PathFollow2D::get_configuration_warning() const { void PathFollow2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_offset","offset"),&PathFollow2D::set_offset); - ObjectTypeDB::bind_method(_MD("get_offset"),&PathFollow2D::get_offset); + ClassDB::bind_method(_MD("set_offset","offset"),&PathFollow2D::set_offset); + ClassDB::bind_method(_MD("get_offset"),&PathFollow2D::get_offset); - ObjectTypeDB::bind_method(_MD("set_h_offset","h_offset"),&PathFollow2D::set_h_offset); - ObjectTypeDB::bind_method(_MD("get_h_offset"),&PathFollow2D::get_h_offset); + ClassDB::bind_method(_MD("set_h_offset","h_offset"),&PathFollow2D::set_h_offset); + ClassDB::bind_method(_MD("get_h_offset"),&PathFollow2D::get_h_offset); - ObjectTypeDB::bind_method(_MD("set_v_offset","v_offset"),&PathFollow2D::set_v_offset); - ObjectTypeDB::bind_method(_MD("get_v_offset"),&PathFollow2D::get_v_offset); + ClassDB::bind_method(_MD("set_v_offset","v_offset"),&PathFollow2D::set_v_offset); + ClassDB::bind_method(_MD("get_v_offset"),&PathFollow2D::get_v_offset); - ObjectTypeDB::bind_method(_MD("set_unit_offset","unit_offset"),&PathFollow2D::set_unit_offset); - ObjectTypeDB::bind_method(_MD("get_unit_offset"),&PathFollow2D::get_unit_offset); + ClassDB::bind_method(_MD("set_unit_offset","unit_offset"),&PathFollow2D::set_unit_offset); + ClassDB::bind_method(_MD("get_unit_offset"),&PathFollow2D::get_unit_offset); - ObjectTypeDB::bind_method(_MD("set_rotate","enable"),&PathFollow2D::set_rotate); - ObjectTypeDB::bind_method(_MD("is_rotating"),&PathFollow2D::is_rotating); + ClassDB::bind_method(_MD("set_rotate","enable"),&PathFollow2D::set_rotate); + ClassDB::bind_method(_MD("is_rotating"),&PathFollow2D::is_rotating); - ObjectTypeDB::bind_method(_MD("set_cubic_interpolation","enable"),&PathFollow2D::set_cubic_interpolation); - ObjectTypeDB::bind_method(_MD("get_cubic_interpolation"),&PathFollow2D::get_cubic_interpolation); + ClassDB::bind_method(_MD("set_cubic_interpolation","enable"),&PathFollow2D::set_cubic_interpolation); + ClassDB::bind_method(_MD("get_cubic_interpolation"),&PathFollow2D::get_cubic_interpolation); - ObjectTypeDB::bind_method(_MD("set_loop","loop"),&PathFollow2D::set_loop); - ObjectTypeDB::bind_method(_MD("has_loop"),&PathFollow2D::has_loop); + ClassDB::bind_method(_MD("set_loop","loop"),&PathFollow2D::set_loop); + ClassDB::bind_method(_MD("has_loop"),&PathFollow2D::has_loop); } diff --git a/scene/2d/path_2d.h b/scene/2d/path_2d.h index 84725e7123..4fc26dbf9b 100644 --- a/scene/2d/path_2d.h +++ b/scene/2d/path_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class Path2D : public Node2D { - OBJ_TYPE( Path2D, Node2D ); + GDCLASS( Path2D, Node2D ); Ref<Curve2D> curve; @@ -58,7 +58,7 @@ public: class PathFollow2D : public Node2D { - OBJ_TYPE(PathFollow2D,Node2D); + GDCLASS(PathFollow2D,Node2D); public: diff --git a/scene/2d/path_texture.cpp b/scene/2d/path_texture.cpp index 3f7c514317..626928a244 100644 --- a/scene/2d/path_texture.cpp +++ b/scene/2d/path_texture.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/path_texture.h b/scene/2d/path_texture.h index 11a60b1390..cc502a2fa4 100644 --- a/scene/2d/path_texture.h +++ b/scene/2d/path_texture.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,7 +32,7 @@ #include "scene/2d/node_2d.h" class PathTexture : public Node2D { - OBJ_TYPE( PathTexture, Node2D ); + GDCLASS( PathTexture, Node2D ); Ref<Texture> begin; Ref<Texture> repeat; diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index 0c5c353766..0c2aa002c4 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -81,29 +81,31 @@ uint32_t PhysicsBody2D::_get_layers() const{ void PhysicsBody2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_layer_mask","mask"),&PhysicsBody2D::set_layer_mask); - ObjectTypeDB::bind_method(_MD("get_layer_mask"),&PhysicsBody2D::get_layer_mask); - ObjectTypeDB::bind_method(_MD("set_collision_mask","mask"),&PhysicsBody2D::set_collision_mask); - ObjectTypeDB::bind_method(_MD("get_collision_mask"),&PhysicsBody2D::get_collision_mask); - - - ObjectTypeDB::bind_method(_MD("set_collision_mask_bit","bit","value"),&PhysicsBody2D::set_collision_mask_bit); - ObjectTypeDB::bind_method(_MD("get_collision_mask_bit","bit"),&PhysicsBody2D::get_collision_mask_bit); - - ObjectTypeDB::bind_method(_MD("set_layer_mask_bit","bit","value"),&PhysicsBody2D::set_layer_mask_bit); - ObjectTypeDB::bind_method(_MD("get_layer_mask_bit","bit"),&PhysicsBody2D::get_layer_mask_bit); - - ObjectTypeDB::bind_method(_MD("_set_layers","mask"),&PhysicsBody2D::_set_layers); - ObjectTypeDB::bind_method(_MD("_get_layers"),&PhysicsBody2D::_get_layers); - ObjectTypeDB::bind_method(_MD("set_one_way_collision_direction","dir"),&PhysicsBody2D::set_one_way_collision_direction); - ObjectTypeDB::bind_method(_MD("get_one_way_collision_direction"),&PhysicsBody2D::get_one_way_collision_direction); - ObjectTypeDB::bind_method(_MD("set_one_way_collision_max_depth","depth"),&PhysicsBody2D::set_one_way_collision_max_depth); - ObjectTypeDB::bind_method(_MD("get_one_way_collision_max_depth"),&PhysicsBody2D::get_one_way_collision_max_depth); - ObjectTypeDB::bind_method(_MD("add_collision_exception_with","body:PhysicsBody2D"),&PhysicsBody2D::add_collision_exception_with); - ObjectTypeDB::bind_method(_MD("remove_collision_exception_with","body:PhysicsBody2D"),&PhysicsBody2D::remove_collision_exception_with); - ADD_PROPERTY(PropertyInfo(Variant::INT,"layers",PROPERTY_HINT_ALL_FLAGS,"",0),_SCS("_set_layers"),_SCS("_get_layers")); //for backwards compat - ADD_PROPERTY(PropertyInfo(Variant::INT,"collision/layers",PROPERTY_HINT_ALL_FLAGS),_SCS("set_layer_mask"),_SCS("get_layer_mask")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"collision/mask",PROPERTY_HINT_ALL_FLAGS),_SCS("set_collision_mask"),_SCS("get_collision_mask")); + ClassDB::bind_method(_MD("set_layer_mask","mask"),&PhysicsBody2D::set_layer_mask); + ClassDB::bind_method(_MD("get_layer_mask"),&PhysicsBody2D::get_layer_mask); + ClassDB::bind_method(_MD("set_collision_mask","mask"),&PhysicsBody2D::set_collision_mask); + ClassDB::bind_method(_MD("get_collision_mask"),&PhysicsBody2D::get_collision_mask); + + + ClassDB::bind_method(_MD("set_collision_mask_bit","bit","value"),&PhysicsBody2D::set_collision_mask_bit); + ClassDB::bind_method(_MD("get_collision_mask_bit","bit"),&PhysicsBody2D::get_collision_mask_bit); + + ClassDB::bind_method(_MD("set_layer_mask_bit","bit","value"),&PhysicsBody2D::set_layer_mask_bit); + ClassDB::bind_method(_MD("get_layer_mask_bit","bit"),&PhysicsBody2D::get_layer_mask_bit); + + ClassDB::bind_method(_MD("_set_layers","mask"),&PhysicsBody2D::_set_layers); + ClassDB::bind_method(_MD("_get_layers"),&PhysicsBody2D::_get_layers); + ClassDB::bind_method(_MD("set_one_way_collision_direction","dir"),&PhysicsBody2D::set_one_way_collision_direction); + ClassDB::bind_method(_MD("get_one_way_collision_direction"),&PhysicsBody2D::get_one_way_collision_direction); + ClassDB::bind_method(_MD("set_one_way_collision_max_depth","depth"),&PhysicsBody2D::set_one_way_collision_max_depth); + ClassDB::bind_method(_MD("get_one_way_collision_max_depth"),&PhysicsBody2D::get_one_way_collision_max_depth); + ClassDB::bind_method(_MD("add_collision_exception_with","body:PhysicsBody2D"),&PhysicsBody2D::add_collision_exception_with); + ClassDB::bind_method(_MD("remove_collision_exception_with","body:PhysicsBody2D"),&PhysicsBody2D::remove_collision_exception_with); + ADD_PROPERTY(PropertyInfo(Variant::INT,"layers",PROPERTY_HINT_LAYERS_2D_PHYSICS,"",0),_SCS("_set_layers"),_SCS("_get_layers")); //for backwards compat + ADD_GROUP("Collision","collision_"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"collision_layers",PROPERTY_HINT_LAYERS_2D_PHYSICS),_SCS("set_layer_mask"),_SCS("get_layer_mask")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"collision_mask",PROPERTY_HINT_LAYERS_2D_PHYSICS),_SCS("set_collision_mask"),_SCS("get_collision_mask")); + ADD_GROUP("",""); ADD_PROPERTYNZ(PropertyInfo(Variant::VECTOR2,"one_way_collision/direction"),_SCS("set_one_way_collision_direction"),_SCS("get_one_way_collision_direction")); ADD_PROPERTYNZ(PropertyInfo(Variant::REAL,"one_way_collision/max_depth"),_SCS("set_one_way_collision_max_depth"),_SCS("get_one_way_collision_max_depth")); } @@ -224,7 +226,7 @@ void StaticBody2D::_update_xform() { setting=true; - Matrix32 new_xform = get_global_transform(); //obtain the new one + Transform2D new_xform = get_global_transform(); //obtain the new one set_block_transform_notify(true); Physics2DServer::get_singleton()->body_set_state(get_rid(),Physics2DServer::BODY_STATE_TRANSFORM,*pre_xform); //then simulate motion! @@ -268,15 +270,15 @@ real_t StaticBody2D::get_bounce() const{ void StaticBody2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_constant_linear_velocity","vel"),&StaticBody2D::set_constant_linear_velocity); - ObjectTypeDB::bind_method(_MD("set_constant_angular_velocity","vel"),&StaticBody2D::set_constant_angular_velocity); - ObjectTypeDB::bind_method(_MD("get_constant_linear_velocity"),&StaticBody2D::get_constant_linear_velocity); - ObjectTypeDB::bind_method(_MD("get_constant_angular_velocity"),&StaticBody2D::get_constant_angular_velocity); - ObjectTypeDB::bind_method(_MD("set_friction","friction"),&StaticBody2D::set_friction); - ObjectTypeDB::bind_method(_MD("get_friction"),&StaticBody2D::get_friction); + ClassDB::bind_method(_MD("set_constant_linear_velocity","vel"),&StaticBody2D::set_constant_linear_velocity); + ClassDB::bind_method(_MD("set_constant_angular_velocity","vel"),&StaticBody2D::set_constant_angular_velocity); + ClassDB::bind_method(_MD("get_constant_linear_velocity"),&StaticBody2D::get_constant_linear_velocity); + ClassDB::bind_method(_MD("get_constant_angular_velocity"),&StaticBody2D::get_constant_angular_velocity); + ClassDB::bind_method(_MD("set_friction","friction"),&StaticBody2D::set_friction); + ClassDB::bind_method(_MD("get_friction"),&StaticBody2D::get_friction); - ObjectTypeDB::bind_method(_MD("set_bounce","bounce"),&StaticBody2D::set_bounce); - ObjectTypeDB::bind_method(_MD("get_bounce"),&StaticBody2D::get_bounce); + ClassDB::bind_method(_MD("set_bounce","bounce"),&StaticBody2D::set_bounce); + ClassDB::bind_method(_MD("get_bounce"),&StaticBody2D::get_bounce); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2,"constant_linear_velocity"),_SCS("set_constant_linear_velocity"),_SCS("get_constant_linear_velocity")); ADD_PROPERTY(PropertyInfo(Variant::REAL,"constant_angular_velocity"),_SCS("set_constant_angular_velocity"),_SCS("get_constant_angular_velocity")); @@ -879,75 +881,75 @@ bool RigidBody2D::is_contact_monitor_enabled() const { void RigidBody2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_mode","mode"),&RigidBody2D::set_mode); - ObjectTypeDB::bind_method(_MD("get_mode"),&RigidBody2D::get_mode); + ClassDB::bind_method(_MD("set_mode","mode"),&RigidBody2D::set_mode); + ClassDB::bind_method(_MD("get_mode"),&RigidBody2D::get_mode); - ObjectTypeDB::bind_method(_MD("set_mass","mass"),&RigidBody2D::set_mass); - ObjectTypeDB::bind_method(_MD("get_mass"),&RigidBody2D::get_mass); + ClassDB::bind_method(_MD("set_mass","mass"),&RigidBody2D::set_mass); + ClassDB::bind_method(_MD("get_mass"),&RigidBody2D::get_mass); - ObjectTypeDB::bind_method(_MD("get_inertia"),&RigidBody2D::get_inertia); - ObjectTypeDB::bind_method(_MD("set_inertia","inertia"),&RigidBody2D::set_inertia); + ClassDB::bind_method(_MD("get_inertia"),&RigidBody2D::get_inertia); + ClassDB::bind_method(_MD("set_inertia","inertia"),&RigidBody2D::set_inertia); - ObjectTypeDB::bind_method(_MD("set_weight","weight"),&RigidBody2D::set_weight); - ObjectTypeDB::bind_method(_MD("get_weight"),&RigidBody2D::get_weight); + ClassDB::bind_method(_MD("set_weight","weight"),&RigidBody2D::set_weight); + ClassDB::bind_method(_MD("get_weight"),&RigidBody2D::get_weight); - ObjectTypeDB::bind_method(_MD("set_friction","friction"),&RigidBody2D::set_friction); - ObjectTypeDB::bind_method(_MD("get_friction"),&RigidBody2D::get_friction); + ClassDB::bind_method(_MD("set_friction","friction"),&RigidBody2D::set_friction); + ClassDB::bind_method(_MD("get_friction"),&RigidBody2D::get_friction); - ObjectTypeDB::bind_method(_MD("set_bounce","bounce"),&RigidBody2D::set_bounce); - ObjectTypeDB::bind_method(_MD("get_bounce"),&RigidBody2D::get_bounce); + ClassDB::bind_method(_MD("set_bounce","bounce"),&RigidBody2D::set_bounce); + ClassDB::bind_method(_MD("get_bounce"),&RigidBody2D::get_bounce); - ObjectTypeDB::bind_method(_MD("set_gravity_scale","gravity_scale"),&RigidBody2D::set_gravity_scale); - ObjectTypeDB::bind_method(_MD("get_gravity_scale"),&RigidBody2D::get_gravity_scale); + ClassDB::bind_method(_MD("set_gravity_scale","gravity_scale"),&RigidBody2D::set_gravity_scale); + ClassDB::bind_method(_MD("get_gravity_scale"),&RigidBody2D::get_gravity_scale); - ObjectTypeDB::bind_method(_MD("set_linear_damp","linear_damp"),&RigidBody2D::set_linear_damp); - ObjectTypeDB::bind_method(_MD("get_linear_damp"),&RigidBody2D::get_linear_damp); + ClassDB::bind_method(_MD("set_linear_damp","linear_damp"),&RigidBody2D::set_linear_damp); + ClassDB::bind_method(_MD("get_linear_damp"),&RigidBody2D::get_linear_damp); - ObjectTypeDB::bind_method(_MD("set_angular_damp","angular_damp"),&RigidBody2D::set_angular_damp); - ObjectTypeDB::bind_method(_MD("get_angular_damp"),&RigidBody2D::get_angular_damp); + ClassDB::bind_method(_MD("set_angular_damp","angular_damp"),&RigidBody2D::set_angular_damp); + ClassDB::bind_method(_MD("get_angular_damp"),&RigidBody2D::get_angular_damp); - ObjectTypeDB::bind_method(_MD("set_linear_velocity","linear_velocity"),&RigidBody2D::set_linear_velocity); - ObjectTypeDB::bind_method(_MD("get_linear_velocity"),&RigidBody2D::get_linear_velocity); + ClassDB::bind_method(_MD("set_linear_velocity","linear_velocity"),&RigidBody2D::set_linear_velocity); + ClassDB::bind_method(_MD("get_linear_velocity"),&RigidBody2D::get_linear_velocity); - ObjectTypeDB::bind_method(_MD("set_angular_velocity","angular_velocity"),&RigidBody2D::set_angular_velocity); - ObjectTypeDB::bind_method(_MD("get_angular_velocity"),&RigidBody2D::get_angular_velocity); + ClassDB::bind_method(_MD("set_angular_velocity","angular_velocity"),&RigidBody2D::set_angular_velocity); + ClassDB::bind_method(_MD("get_angular_velocity"),&RigidBody2D::get_angular_velocity); - ObjectTypeDB::bind_method(_MD("set_max_contacts_reported","amount"),&RigidBody2D::set_max_contacts_reported); - ObjectTypeDB::bind_method(_MD("get_max_contacts_reported"),&RigidBody2D::get_max_contacts_reported); + ClassDB::bind_method(_MD("set_max_contacts_reported","amount"),&RigidBody2D::set_max_contacts_reported); + ClassDB::bind_method(_MD("get_max_contacts_reported"),&RigidBody2D::get_max_contacts_reported); - ObjectTypeDB::bind_method(_MD("set_use_custom_integrator","enable"),&RigidBody2D::set_use_custom_integrator); - ObjectTypeDB::bind_method(_MD("is_using_custom_integrator"),&RigidBody2D::is_using_custom_integrator); + ClassDB::bind_method(_MD("set_use_custom_integrator","enable"),&RigidBody2D::set_use_custom_integrator); + ClassDB::bind_method(_MD("is_using_custom_integrator"),&RigidBody2D::is_using_custom_integrator); - ObjectTypeDB::bind_method(_MD("set_contact_monitor","enabled"),&RigidBody2D::set_contact_monitor); - ObjectTypeDB::bind_method(_MD("is_contact_monitor_enabled"),&RigidBody2D::is_contact_monitor_enabled); + ClassDB::bind_method(_MD("set_contact_monitor","enabled"),&RigidBody2D::set_contact_monitor); + ClassDB::bind_method(_MD("is_contact_monitor_enabled"),&RigidBody2D::is_contact_monitor_enabled); - ObjectTypeDB::bind_method(_MD("set_continuous_collision_detection_mode","mode"),&RigidBody2D::set_continuous_collision_detection_mode); - ObjectTypeDB::bind_method(_MD("get_continuous_collision_detection_mode"),&RigidBody2D::get_continuous_collision_detection_mode); + ClassDB::bind_method(_MD("set_continuous_collision_detection_mode","mode"),&RigidBody2D::set_continuous_collision_detection_mode); + ClassDB::bind_method(_MD("get_continuous_collision_detection_mode"),&RigidBody2D::get_continuous_collision_detection_mode); - ObjectTypeDB::bind_method(_MD("set_axis_velocity","axis_velocity"),&RigidBody2D::set_axis_velocity); - ObjectTypeDB::bind_method(_MD("apply_impulse","offset","impulse"),&RigidBody2D::apply_impulse); + ClassDB::bind_method(_MD("set_axis_velocity","axis_velocity"),&RigidBody2D::set_axis_velocity); + ClassDB::bind_method(_MD("apply_impulse","offset","impulse"),&RigidBody2D::apply_impulse); - ObjectTypeDB::bind_method(_MD("set_applied_force","force"),&RigidBody2D::set_applied_force); - ObjectTypeDB::bind_method(_MD("get_applied_force"),&RigidBody2D::get_applied_force); + ClassDB::bind_method(_MD("set_applied_force","force"),&RigidBody2D::set_applied_force); + ClassDB::bind_method(_MD("get_applied_force"),&RigidBody2D::get_applied_force); - ObjectTypeDB::bind_method(_MD("set_applied_torque","torque"),&RigidBody2D::set_applied_torque); - ObjectTypeDB::bind_method(_MD("get_applied_torque"),&RigidBody2D::get_applied_torque); + ClassDB::bind_method(_MD("set_applied_torque","torque"),&RigidBody2D::set_applied_torque); + ClassDB::bind_method(_MD("get_applied_torque"),&RigidBody2D::get_applied_torque); - ObjectTypeDB::bind_method(_MD("add_force","offset","force"),&RigidBody2D::add_force); + ClassDB::bind_method(_MD("add_force","offset","force"),&RigidBody2D::add_force); - ObjectTypeDB::bind_method(_MD("set_sleeping","sleeping"),&RigidBody2D::set_sleeping); - ObjectTypeDB::bind_method(_MD("is_sleeping"),&RigidBody2D::is_sleeping); + ClassDB::bind_method(_MD("set_sleeping","sleeping"),&RigidBody2D::set_sleeping); + ClassDB::bind_method(_MD("is_sleeping"),&RigidBody2D::is_sleeping); - ObjectTypeDB::bind_method(_MD("set_can_sleep","able_to_sleep"),&RigidBody2D::set_can_sleep); - ObjectTypeDB::bind_method(_MD("is_able_to_sleep"),&RigidBody2D::is_able_to_sleep); + ClassDB::bind_method(_MD("set_can_sleep","able_to_sleep"),&RigidBody2D::set_can_sleep); + ClassDB::bind_method(_MD("is_able_to_sleep"),&RigidBody2D::is_able_to_sleep); - ObjectTypeDB::bind_method(_MD("test_motion","motion","margin","result:Physics2DTestMotionResult"),&RigidBody2D::_test_motion,DEFVAL(0.08),DEFVAL(Variant())); + ClassDB::bind_method(_MD("test_motion","motion","margin","result:Physics2DTestMotionResult"),&RigidBody2D::_test_motion,DEFVAL(0.08),DEFVAL(Variant())); - ObjectTypeDB::bind_method(_MD("_direct_state_changed"),&RigidBody2D::_direct_state_changed); - ObjectTypeDB::bind_method(_MD("_body_enter_tree"),&RigidBody2D::_body_enter_tree); - ObjectTypeDB::bind_method(_MD("_body_exit_tree"),&RigidBody2D::_body_exit_tree); + ClassDB::bind_method(_MD("_direct_state_changed"),&RigidBody2D::_direct_state_changed); + ClassDB::bind_method(_MD("_body_enter_tree"),&RigidBody2D::_body_enter_tree); + ClassDB::bind_method(_MD("_body_exit_tree"),&RigidBody2D::_body_exit_tree); - ObjectTypeDB::bind_method(_MD("get_colliding_bodies"),&RigidBody2D::get_colliding_bodies); + ClassDB::bind_method(_MD("get_colliding_bodies"),&RigidBody2D::get_colliding_bodies); BIND_VMETHOD(MethodInfo("_integrate_forces",PropertyInfo(Variant::OBJECT,"state:Physics2DDirectBodyState"))); @@ -963,10 +965,12 @@ void RigidBody2D::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::BOOL,"contact_monitor"),_SCS("set_contact_monitor"),_SCS("is_contact_monitor_enabled")); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"sleeping"),_SCS("set_sleeping"),_SCS("is_sleeping")); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"can_sleep"),_SCS("set_can_sleep"),_SCS("is_able_to_sleep")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"velocity/linear"),_SCS("set_linear_velocity"),_SCS("get_linear_velocity")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"velocity/angular"),_SCS("set_angular_velocity"),_SCS("get_angular_velocity")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"damp_override/linear",PROPERTY_HINT_RANGE,"-1,128,0.01"),_SCS("set_linear_damp"),_SCS("get_linear_damp")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"damp_override/angular",PROPERTY_HINT_RANGE,"-1,128,0.01"),_SCS("set_angular_damp"),_SCS("get_angular_damp")); + ADD_GROUP("Linear","linear_"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"linear_velocity"),_SCS("set_linear_velocity"),_SCS("get_linear_velocity")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"linear_damp",PROPERTY_HINT_RANGE,"-1,128,0.01"),_SCS("set_linear_damp"),_SCS("get_linear_damp")); + ADD_GROUP("Angular","angular_"); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"angular_velocity"),_SCS("set_angular_velocity"),_SCS("get_angular_velocity")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"angular_damp",PROPERTY_HINT_RANGE,"-1,128,0.01"),_SCS("set_angular_damp"),_SCS("get_angular_damp")); ADD_SIGNAL( MethodInfo("body_enter_shape",PropertyInfo(Variant::INT,"body_id"),PropertyInfo(Variant::OBJECT,"body"),PropertyInfo(Variant::INT,"body_shape"),PropertyInfo(Variant::INT,"local_shape"))); ADD_SIGNAL( MethodInfo("body_exit_shape",PropertyInfo(Variant::INT,"body_id"),PropertyInfo(Variant::OBJECT,"body"),PropertyInfo(Variant::INT,"body_shape"),PropertyInfo(Variant::INT,"local_shape"))); @@ -1042,7 +1046,7 @@ Variant KinematicBody2D::_get_collider() const { void KinematicBody2D::revert_motion() { - Matrix32 gt = get_global_transform(); + Transform2D gt = get_global_transform(); gt.elements[2]-=travel; travel=Vector2(); set_global_transform(gt); @@ -1058,7 +1062,7 @@ Vector2 KinematicBody2D::move(const Vector2& p_motion) { #if 1 - Matrix32 gt = get_global_transform(); + Transform2D gt = get_global_transform(); Physics2DServer::MotionResult result; colliding = Physics2DServer::get_singleton()->body_test_motion(get_rid(),gt,p_motion,margin,&result); @@ -1148,7 +1152,7 @@ Vector2 KinematicBody2D::move(const Vector2& p_motion) { - Matrix32 gt = get_global_transform(); + Transform2D gt = get_global_transform(); gt.elements[2]+=recover_motion; set_global_transform(gt); @@ -1199,7 +1203,7 @@ Vector2 KinematicBody2D::move(const Vector2& p_motion) { } else { //it collided, let's get the rest info in unsafe advance - Matrix32 ugt = get_global_transform(); + Transform2D ugt = get_global_transform(); ugt.elements[2]+=p_motion*unsafe; Physics2DDirectSpaceState::ShapeRestInfo rest_info; bool c2 = dss->rest_info(get_shape(best_shape)->get_rid(), ugt*get_shape_transform(best_shape), Vector2(), margin,&rest_info,exclude,get_layer_mask(),mask); @@ -1223,7 +1227,7 @@ Vector2 KinematicBody2D::move(const Vector2& p_motion) { } Vector2 motion=p_motion*safe; - Matrix32 gt = get_global_transform(); + Transform2D gt = get_global_transform(); gt.elements[2]+=motion; set_global_transform(gt); @@ -1311,10 +1315,10 @@ Array KinematicBody2D::get_move_and_slide_colliders() const{ Vector2 KinematicBody2D::move_to(const Vector2& p_position) { - return move(p_position-get_global_pos()); + return move(p_position-get_global_position()); } -bool KinematicBody2D::test_move(const Matrix32& p_from,const Vector2& p_motion) { +bool KinematicBody2D::test_move(const Transform2D& p_from,const Vector2& p_motion) { ERR_FAIL_COND_V(!is_inside_tree(),false); @@ -1381,29 +1385,29 @@ float KinematicBody2D::get_collision_margin() const{ void KinematicBody2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("move","rel_vec"),&KinematicBody2D::move); - ObjectTypeDB::bind_method(_MD("move_to","position"),&KinematicBody2D::move_to); - ObjectTypeDB::bind_method(_MD("move_and_slide","linear_velocity","floor_normal","slope_stop_min_velocity","max_bounces"),&KinematicBody2D::move_and_slide,DEFVAL(Vector2(0,0)),DEFVAL(5),DEFVAL(4)); + ClassDB::bind_method(_MD("move","rel_vec"),&KinematicBody2D::move); + ClassDB::bind_method(_MD("move_to","position"),&KinematicBody2D::move_to); + ClassDB::bind_method(_MD("move_and_slide","linear_velocity","floor_normal","slope_stop_min_velocity","max_bounces"),&KinematicBody2D::move_and_slide,DEFVAL(Vector2(0,0)),DEFVAL(5),DEFVAL(4)); - ObjectTypeDB::bind_method(_MD("test_move","from","rel_vec"),&KinematicBody2D::test_move); - ObjectTypeDB::bind_method(_MD("get_travel"),&KinematicBody2D::get_travel); - ObjectTypeDB::bind_method(_MD("revert_motion"),&KinematicBody2D::revert_motion); + ClassDB::bind_method(_MD("test_move","from","rel_vec"),&KinematicBody2D::test_move); + ClassDB::bind_method(_MD("get_travel"),&KinematicBody2D::get_travel); + ClassDB::bind_method(_MD("revert_motion"),&KinematicBody2D::revert_motion); - ObjectTypeDB::bind_method(_MD("is_colliding"),&KinematicBody2D::is_colliding); + ClassDB::bind_method(_MD("is_colliding"),&KinematicBody2D::is_colliding); - ObjectTypeDB::bind_method(_MD("get_collision_pos"),&KinematicBody2D::get_collision_pos); - ObjectTypeDB::bind_method(_MD("get_collision_normal"),&KinematicBody2D::get_collision_normal); - ObjectTypeDB::bind_method(_MD("get_collider_velocity"),&KinematicBody2D::get_collider_velocity); - ObjectTypeDB::bind_method(_MD("get_collider:Object"),&KinematicBody2D::_get_collider); - ObjectTypeDB::bind_method(_MD("get_collider_shape"),&KinematicBody2D::get_collider_shape); - ObjectTypeDB::bind_method(_MD("get_collider_metadata:Variant"),&KinematicBody2D::get_collider_metadata); - ObjectTypeDB::bind_method(_MD("get_move_and_slide_colliders"),&KinematicBody2D::get_move_and_slide_colliders); - ObjectTypeDB::bind_method(_MD("is_move_and_slide_on_floor"),&KinematicBody2D::is_move_and_slide_on_floor); - ObjectTypeDB::bind_method(_MD("is_move_and_slide_on_ceiling"),&KinematicBody2D::is_move_and_slide_on_ceiling); - ObjectTypeDB::bind_method(_MD("is_move_and_slide_on_wall"),&KinematicBody2D::is_move_and_slide_on_wall); + ClassDB::bind_method(_MD("get_collision_pos"),&KinematicBody2D::get_collision_pos); + ClassDB::bind_method(_MD("get_collision_normal"),&KinematicBody2D::get_collision_normal); + ClassDB::bind_method(_MD("get_collider_velocity"),&KinematicBody2D::get_collider_velocity); + ClassDB::bind_method(_MD("get_collider:Variant"),&KinematicBody2D::_get_collider); + ClassDB::bind_method(_MD("get_collider_shape"),&KinematicBody2D::get_collider_shape); + ClassDB::bind_method(_MD("get_collider_metadata:Variant"),&KinematicBody2D::get_collider_metadata); + ClassDB::bind_method(_MD("get_move_and_slide_colliders"),&KinematicBody2D::get_move_and_slide_colliders); + ClassDB::bind_method(_MD("is_move_and_slide_on_floor"),&KinematicBody2D::is_move_and_slide_on_floor); + ClassDB::bind_method(_MD("is_move_and_slide_on_ceiling"),&KinematicBody2D::is_move_and_slide_on_ceiling); + ClassDB::bind_method(_MD("is_move_and_slide_on_wall"),&KinematicBody2D::is_move_and_slide_on_wall); - ObjectTypeDB::bind_method(_MD("set_collision_margin","pixels"),&KinematicBody2D::set_collision_margin); - ObjectTypeDB::bind_method(_MD("get_collision_margin","pixels"),&KinematicBody2D::get_collision_margin); + ClassDB::bind_method(_MD("set_collision_margin","pixels"),&KinematicBody2D::set_collision_margin); + ClassDB::bind_method(_MD("get_collision_margin","pixels"),&KinematicBody2D::get_collision_margin); ADD_PROPERTY( PropertyInfo(Variant::REAL,"collision/margin",PROPERTY_HINT_RANGE,"0.001,256,0.001"),_SCS("set_collision_margin"),_SCS("get_collision_margin")); diff --git a/scene/2d/physics_body_2d.h b/scene/2d/physics_body_2d.h index ea29d873bd..2637238c04 100644 --- a/scene/2d/physics_body_2d.h +++ b/scene/2d/physics_body_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ class PhysicsBody2D : public CollisionObject2D { - OBJ_TYPE(PhysicsBody2D,CollisionObject2D); + GDCLASS(PhysicsBody2D,CollisionObject2D); uint32_t mask; uint32_t collision_mask; @@ -83,7 +83,7 @@ public: class StaticBody2D : public PhysicsBody2D { - OBJ_TYPE(StaticBody2D,PhysicsBody2D); + GDCLASS(StaticBody2D,PhysicsBody2D); Vector2 constant_linear_velocity; real_t constant_angular_velocity; @@ -118,7 +118,7 @@ public: class RigidBody2D : public PhysicsBody2D { - OBJ_TYPE(RigidBody2D,PhysicsBody2D); + GDCLASS(RigidBody2D,PhysicsBody2D); public: enum Mode { @@ -290,7 +290,7 @@ VARIANT_ENUM_CAST(RigidBody2D::CCDMode); class KinematicBody2D : public PhysicsBody2D { - OBJ_TYPE(KinematicBody2D,PhysicsBody2D); + GDCLASS(KinematicBody2D,PhysicsBody2D); float margin; bool colliding; @@ -319,7 +319,7 @@ public: Vector2 move(const Vector2& p_motion); Vector2 move_to(const Vector2& p_position); - bool test_move(const Matrix32 &p_from, const Vector2& p_motion); + bool test_move(const Transform2D &p_from, const Vector2& p_motion); bool is_colliding() const; Vector2 get_travel() const; diff --git a/scene/2d/polygon_2d.cpp b/scene/2d/polygon_2d.cpp index 12893524d1..30e22a8437 100644 --- a/scene/2d/polygon_2d.cpp +++ b/scene/2d/polygon_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ Rect2 Polygon2D::get_item_rect() const { if (rect_cache_dirty){ int l =polygon.size(); - DVector<Vector2>::Read r = polygon.read(); + PoolVector<Vector2>::Read r = polygon.read(); item_rect=Rect2(); for(int i=0;i<l;i++) { Vector2 pos = r[i] + offset; @@ -84,7 +84,7 @@ void Polygon2D::_notification(int p_what) { int len = points.size(); { - DVector<Vector2>::Read polyr =polygon.read(); + PoolVector<Vector2>::Read polyr =polygon.read(); for(int i=0;i<len;i++) { points[i]=polyr[i]+offset; } @@ -148,7 +148,7 @@ void Polygon2D::_notification(int p_what) { if (texture.is_valid()) { - Matrix32 texmat(tex_rot,tex_ofs); + Transform2D texmat(tex_rot,tex_ofs); texmat.scale(tex_scale); Size2 tex_size=Vector2(1,1); @@ -157,7 +157,7 @@ void Polygon2D::_notification(int p_what) { if (points.size()==uv.size()) { - DVector<Vector2>::Read uvr = uv.read(); + PoolVector<Vector2>::Read uvr = uv.read(); for(int i=0;i<len;i++) { uvs[i]=texmat.xform(uvr[i])/tex_size; @@ -176,7 +176,7 @@ void Polygon2D::_notification(int p_what) { int color_len=vertex_colors.size(); colors.resize(len); { - DVector<Color>::Read color_r=vertex_colors.read(); + PoolVector<Color>::Read color_r=vertex_colors.read(); for(int i=0;i<color_len && i<len;i++){ colors[i]=color_r[i]; } @@ -194,25 +194,25 @@ void Polygon2D::_notification(int p_what) { } -void Polygon2D::set_polygon(const DVector<Vector2>& p_polygon) { +void Polygon2D::set_polygon(const PoolVector<Vector2>& p_polygon) { polygon=p_polygon; rect_cache_dirty=true; update(); } -DVector<Vector2> Polygon2D::get_polygon() const{ +PoolVector<Vector2> Polygon2D::get_polygon() const{ return polygon; } -void Polygon2D::set_uv(const DVector<Vector2>& p_uv) { +void Polygon2D::set_uv(const PoolVector<Vector2>& p_uv) { uv=p_uv; update(); } -DVector<Vector2> Polygon2D::get_uv() const{ +PoolVector<Vector2> Polygon2D::get_uv() const{ return uv; } @@ -227,12 +227,12 @@ Color Polygon2D::get_color() const{ return color; } -void Polygon2D::set_vertex_colors(const DVector<Color>& p_colors){ +void Polygon2D::set_vertex_colors(const PoolVector<Color>& p_colors){ vertex_colors=p_colors; update(); } -DVector<Color> Polygon2D::get_vertex_colors() const{ +PoolVector<Color> Polygon2D::get_vertex_colors() const{ return vertex_colors; } @@ -333,56 +333,60 @@ Vector2 Polygon2D::get_offset() const { void Polygon2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_polygon","polygon"),&Polygon2D::set_polygon); - ObjectTypeDB::bind_method(_MD("get_polygon"),&Polygon2D::get_polygon); + ClassDB::bind_method(_MD("set_polygon","polygon"),&Polygon2D::set_polygon); + ClassDB::bind_method(_MD("get_polygon"),&Polygon2D::get_polygon); - ObjectTypeDB::bind_method(_MD("set_uv","uv"),&Polygon2D::set_uv); - ObjectTypeDB::bind_method(_MD("get_uv"),&Polygon2D::get_uv); + ClassDB::bind_method(_MD("set_uv","uv"),&Polygon2D::set_uv); + ClassDB::bind_method(_MD("get_uv"),&Polygon2D::get_uv); - ObjectTypeDB::bind_method(_MD("set_color","color"),&Polygon2D::set_color); - ObjectTypeDB::bind_method(_MD("get_color"),&Polygon2D::get_color); + ClassDB::bind_method(_MD("set_color","color"),&Polygon2D::set_color); + ClassDB::bind_method(_MD("get_color"),&Polygon2D::get_color); - ObjectTypeDB::bind_method(_MD("set_vertex_colors","vertex_colors"),&Polygon2D::set_vertex_colors); - ObjectTypeDB::bind_method(_MD("get_vertex_colors"),&Polygon2D::get_vertex_colors); + ClassDB::bind_method(_MD("set_vertex_colors","vertex_colors"),&Polygon2D::set_vertex_colors); + ClassDB::bind_method(_MD("get_vertex_colors"),&Polygon2D::get_vertex_colors); - ObjectTypeDB::bind_method(_MD("set_texture","texture"),&Polygon2D::set_texture); - ObjectTypeDB::bind_method(_MD("get_texture"),&Polygon2D::get_texture); + ClassDB::bind_method(_MD("set_texture","texture"),&Polygon2D::set_texture); + ClassDB::bind_method(_MD("get_texture"),&Polygon2D::get_texture); - ObjectTypeDB::bind_method(_MD("set_texture_offset","texture_offset"),&Polygon2D::set_texture_offset); - ObjectTypeDB::bind_method(_MD("get_texture_offset"),&Polygon2D::get_texture_offset); + ClassDB::bind_method(_MD("set_texture_offset","texture_offset"),&Polygon2D::set_texture_offset); + ClassDB::bind_method(_MD("get_texture_offset"),&Polygon2D::get_texture_offset); - ObjectTypeDB::bind_method(_MD("set_texture_rotation","texture_rotation"),&Polygon2D::set_texture_rotation); - ObjectTypeDB::bind_method(_MD("get_texture_rotation"),&Polygon2D::get_texture_rotation); + ClassDB::bind_method(_MD("set_texture_rotation","texture_rotation"),&Polygon2D::set_texture_rotation); + ClassDB::bind_method(_MD("get_texture_rotation"),&Polygon2D::get_texture_rotation); - ObjectTypeDB::bind_method(_MD("_set_texture_rotationd","texture_rotation"),&Polygon2D::_set_texture_rotationd); - ObjectTypeDB::bind_method(_MD("_get_texture_rotationd"),&Polygon2D::_get_texture_rotationd); + ClassDB::bind_method(_MD("_set_texture_rotationd","texture_rotation"),&Polygon2D::_set_texture_rotationd); + ClassDB::bind_method(_MD("_get_texture_rotationd"),&Polygon2D::_get_texture_rotationd); - ObjectTypeDB::bind_method(_MD("set_texture_scale","texture_scale"),&Polygon2D::set_texture_scale); - ObjectTypeDB::bind_method(_MD("get_texture_scale"),&Polygon2D::get_texture_scale); + ClassDB::bind_method(_MD("set_texture_scale","texture_scale"),&Polygon2D::set_texture_scale); + ClassDB::bind_method(_MD("get_texture_scale"),&Polygon2D::get_texture_scale); - ObjectTypeDB::bind_method(_MD("set_invert","invert"),&Polygon2D::set_invert); - ObjectTypeDB::bind_method(_MD("get_invert"),&Polygon2D::get_invert); + ClassDB::bind_method(_MD("set_invert","invert"),&Polygon2D::set_invert); + ClassDB::bind_method(_MD("get_invert"),&Polygon2D::get_invert); - ObjectTypeDB::bind_method(_MD("set_invert_border","invert_border"),&Polygon2D::set_invert_border); - ObjectTypeDB::bind_method(_MD("get_invert_border"),&Polygon2D::get_invert_border); + ClassDB::bind_method(_MD("set_invert_border","invert_border"),&Polygon2D::set_invert_border); + ClassDB::bind_method(_MD("get_invert_border"),&Polygon2D::get_invert_border); - ObjectTypeDB::bind_method(_MD("set_offset","offset"),&Polygon2D::set_offset); - ObjectTypeDB::bind_method(_MD("get_offset"),&Polygon2D::get_offset); + ClassDB::bind_method(_MD("set_offset","offset"),&Polygon2D::set_offset); + ClassDB::bind_method(_MD("get_offset"),&Polygon2D::get_offset); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2_ARRAY,"polygon"),_SCS("set_polygon"),_SCS("get_polygon")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2_ARRAY,"uv"),_SCS("set_uv"),_SCS("get_uv")); + ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"polygon"),_SCS("set_polygon"),_SCS("get_polygon")); + ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"uv"),_SCS("set_uv"),_SCS("get_uv")); ADD_PROPERTY( PropertyInfo(Variant::COLOR,"color"),_SCS("set_color"),_SCS("get_color")); - ADD_PROPERTY( PropertyInfo(Variant::COLOR_ARRAY,"vertex_colors"),_SCS("set_vertex_colors"),_SCS("get_vertex_colors")); + ADD_PROPERTY( PropertyInfo(Variant::POOL_COLOR_ARRAY,"vertex_colors"),_SCS("set_vertex_colors"),_SCS("get_vertex_colors")); ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"offset"),_SCS("set_offset"),_SCS("get_offset")); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"texture/texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"texture/offset"),_SCS("set_texture_offset"),_SCS("get_texture_offset")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"texture/scale"),_SCS("set_texture_scale"),_SCS("get_texture_scale")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"texture/rotation",PROPERTY_HINT_RANGE,"-1440,1440,0.1"),_SCS("_set_texture_rotationd"),_SCS("_get_texture_rotationd")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"invert/enable"),_SCS("set_invert"),_SCS("get_invert")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"invert/border",PROPERTY_HINT_RANGE,"0.1,16384,0.1"),_SCS("set_invert_border"),_SCS("get_invert_border")); + ADD_GROUP("Texture",""); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture")); + ADD_GROUP("Texture","texture_"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"texture_offset"),_SCS("set_texture_offset"),_SCS("get_texture_offset")); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"texture_scale"),_SCS("set_texture_scale"),_SCS("get_texture_scale")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"texture_rotation",PROPERTY_HINT_RANGE,"-1440,1440,0.1"),_SCS("_set_texture_rotationd"),_SCS("_get_texture_rotationd")); + + ADD_GROUP("Invert","invert_"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"invert_enable"),_SCS("set_invert"),_SCS("get_invert")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"invert_border",PROPERTY_HINT_RANGE,"0.1,16384,0.1"),_SCS("set_invert_border"),_SCS("get_invert_border")); } diff --git a/scene/2d/polygon_2d.h b/scene/2d/polygon_2d.h index cecb9081f7..8434dae40c 100644 --- a/scene/2d/polygon_2d.h +++ b/scene/2d/polygon_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,11 +33,11 @@ class Polygon2D : public Node2D { - OBJ_TYPE(Polygon2D,Node2D); + GDCLASS(Polygon2D,Node2D); - DVector<Vector2> polygon; - DVector<Vector2> uv; - DVector<Color> vertex_colors; + PoolVector<Vector2> polygon; + PoolVector<Vector2> uv; + PoolVector<Color> vertex_colors; Color color; Ref<Texture> texture; Size2 tex_scale; @@ -60,17 +60,17 @@ protected: static void _bind_methods(); public: - void set_polygon(const DVector<Vector2>& p_polygon); - DVector<Vector2> get_polygon() const; + void set_polygon(const PoolVector<Vector2>& p_polygon); + PoolVector<Vector2> get_polygon() const; - void set_uv(const DVector<Vector2>& p_uv); - DVector<Vector2> get_uv() const; + void set_uv(const PoolVector<Vector2>& p_uv); + PoolVector<Vector2> get_uv() const; void set_color(const Color& p_color); Color get_color() const; - void set_vertex_colors(const DVector<Color>& p_colors); - DVector<Color> get_vertex_colors() const; + void set_vertex_colors(const PoolVector<Color>& p_colors); + PoolVector<Color> get_vertex_colors() const; void set_texture(const Ref<Texture>& p_texture); Ref<Texture> get_texture() const; diff --git a/scene/2d/position_2d.cpp b/scene/2d/position_2d.cpp index c293305cb2..a25be18cb9 100644 --- a/scene/2d/position_2d.cpp +++ b/scene/2d/position_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/2d/position_2d.h b/scene/2d/position_2d.h index 23821e62d4..fb68c265b3 100644 --- a/scene/2d/position_2d.h +++ b/scene/2d/position_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class Position2D : public Node2D { - OBJ_TYPE(Position2D,Node2D) + GDCLASS(Position2D,Node2D) void _draw_cross(); protected: diff --git a/scene/2d/ray_cast_2d.cpp b/scene/2d/ray_cast_2d.cpp index bd7f4faae5..14dfc10d9f 100644 --- a/scene/2d/ray_cast_2d.cpp +++ b/scene/2d/ray_cast_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -161,7 +161,7 @@ void RayCast2D::_notification(int p_what) { if (!get_tree()->is_editor_hint() && !get_tree()->is_debugging_collisions_hint()) break; - Matrix32 xf; + Transform2D xf; xf.rotate(cast_to.angle()); xf.translate(Vector2(0,cast_to.length())); @@ -201,7 +201,7 @@ void RayCast2D::_update_raycast_state() { Physics2DDirectSpaceState *dss = Physics2DServer::get_singleton()->space_get_direct_state(w2d->get_space()); ERR_FAIL_COND( !dss ); - Matrix32 gt = get_global_transform(); + Transform2D gt = get_global_transform(); Vector2 to = cast_to; if (to==Vector2()) @@ -263,41 +263,41 @@ void RayCast2D::clear_exceptions(){ void RayCast2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_enabled","enabled"),&RayCast2D::set_enabled); - ObjectTypeDB::bind_method(_MD("is_enabled"),&RayCast2D::is_enabled); + ClassDB::bind_method(_MD("set_enabled","enabled"),&RayCast2D::set_enabled); + ClassDB::bind_method(_MD("is_enabled"),&RayCast2D::is_enabled); - ObjectTypeDB::bind_method(_MD("set_cast_to","local_point"),&RayCast2D::set_cast_to); - ObjectTypeDB::bind_method(_MD("get_cast_to"),&RayCast2D::get_cast_to); + ClassDB::bind_method(_MD("set_cast_to","local_point"),&RayCast2D::set_cast_to); + ClassDB::bind_method(_MD("get_cast_to"),&RayCast2D::get_cast_to); - ObjectTypeDB::bind_method(_MD("is_colliding"),&RayCast2D::is_colliding); - ObjectTypeDB::bind_method(_MD("force_raycast_update"),&RayCast2D::force_raycast_update); + ClassDB::bind_method(_MD("is_colliding"),&RayCast2D::is_colliding); + ClassDB::bind_method(_MD("force_raycast_update"),&RayCast2D::force_raycast_update); - ObjectTypeDB::bind_method(_MD("get_collider"),&RayCast2D::get_collider); - ObjectTypeDB::bind_method(_MD("get_collider_shape"),&RayCast2D::get_collider_shape); - ObjectTypeDB::bind_method(_MD("get_collision_point"),&RayCast2D::get_collision_point); - ObjectTypeDB::bind_method(_MD("get_collision_normal"),&RayCast2D::get_collision_normal); + ClassDB::bind_method(_MD("get_collider"),&RayCast2D::get_collider); + ClassDB::bind_method(_MD("get_collider_shape"),&RayCast2D::get_collider_shape); + ClassDB::bind_method(_MD("get_collision_point"),&RayCast2D::get_collision_point); + ClassDB::bind_method(_MD("get_collision_normal"),&RayCast2D::get_collision_normal); - ObjectTypeDB::bind_method(_MD("add_exception_rid","rid"),&RayCast2D::add_exception_rid); - ObjectTypeDB::bind_method(_MD("add_exception","node"),&RayCast2D::add_exception); + ClassDB::bind_method(_MD("add_exception_rid","rid"),&RayCast2D::add_exception_rid); + ClassDB::bind_method(_MD("add_exception","node"),&RayCast2D::add_exception); - ObjectTypeDB::bind_method(_MD("remove_exception_rid","rid"),&RayCast2D::remove_exception_rid); - ObjectTypeDB::bind_method(_MD("remove_exception","node"),&RayCast2D::remove_exception); + ClassDB::bind_method(_MD("remove_exception_rid","rid"),&RayCast2D::remove_exception_rid); + ClassDB::bind_method(_MD("remove_exception","node"),&RayCast2D::remove_exception); - ObjectTypeDB::bind_method(_MD("clear_exceptions"),&RayCast2D::clear_exceptions); + ClassDB::bind_method(_MD("clear_exceptions"),&RayCast2D::clear_exceptions); - ObjectTypeDB::bind_method(_MD("set_layer_mask","mask"),&RayCast2D::set_layer_mask); - ObjectTypeDB::bind_method(_MD("get_layer_mask"),&RayCast2D::get_layer_mask); + ClassDB::bind_method(_MD("set_layer_mask","mask"),&RayCast2D::set_layer_mask); + ClassDB::bind_method(_MD("get_layer_mask"),&RayCast2D::get_layer_mask); - ObjectTypeDB::bind_method(_MD("set_type_mask","mask"),&RayCast2D::set_type_mask); - ObjectTypeDB::bind_method(_MD("get_type_mask"),&RayCast2D::get_type_mask); + ClassDB::bind_method(_MD("set_type_mask","mask"),&RayCast2D::set_type_mask); + ClassDB::bind_method(_MD("get_type_mask"),&RayCast2D::get_type_mask); - ObjectTypeDB::bind_method(_MD("set_exclude_parent_body","mask"),&RayCast2D::set_exclude_parent_body); - ObjectTypeDB::bind_method(_MD("get_exclude_parent_body"),&RayCast2D::get_exclude_parent_body); + ClassDB::bind_method(_MD("set_exclude_parent_body","mask"),&RayCast2D::set_exclude_parent_body); + ClassDB::bind_method(_MD("get_exclude_parent_body"),&RayCast2D::get_exclude_parent_body); ADD_PROPERTY(PropertyInfo(Variant::BOOL,"enabled"),_SCS("set_enabled"),_SCS("is_enabled")); ADD_PROPERTY(PropertyInfo(Variant::BOOL,"exclude_parent"),_SCS("set_exclude_parent_body"),_SCS("get_exclude_parent_body")); ADD_PROPERTY(PropertyInfo(Variant::VECTOR2,"cast_to"),_SCS("set_cast_to"),_SCS("get_cast_to")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"layer_mask",PROPERTY_HINT_ALL_FLAGS),_SCS("set_layer_mask"),_SCS("get_layer_mask")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"layer_mask",PROPERTY_HINT_LAYERS_2D_PHYSICS),_SCS("set_layer_mask"),_SCS("get_layer_mask")); ADD_PROPERTY(PropertyInfo(Variant::INT,"type_mask",PROPERTY_HINT_FLAGS,"Static,Kinematic,Rigid,Character,Area"),_SCS("set_type_mask"),_SCS("get_type_mask")); } diff --git a/scene/2d/ray_cast_2d.h b/scene/2d/ray_cast_2d.h index 9bdcc2e199..3e7a39ffde 100644 --- a/scene/2d/ray_cast_2d.h +++ b/scene/2d/ray_cast_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class RayCast2D : public Node2D { - OBJ_TYPE(RayCast2D,Node2D); + GDCLASS(RayCast2D,Node2D); bool enabled; diff --git a/scene/2d/remote_transform_2d.cpp b/scene/2d/remote_transform_2d.cpp index 4de648a1db..c7ec84a8d7 100644 --- a/scene/2d/remote_transform_2d.cpp +++ b/scene/2d/remote_transform_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -118,8 +118,8 @@ String RemoteTransform2D::get_configuration_warning() const { void RemoteTransform2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_remote_node","path"),&RemoteTransform2D::set_remote_node); - ObjectTypeDB::bind_method(_MD("get_remote_node"),&RemoteTransform2D::get_remote_node); + ClassDB::bind_method(_MD("set_remote_node","path"),&RemoteTransform2D::set_remote_node); + ClassDB::bind_method(_MD("get_remote_node"),&RemoteTransform2D::get_remote_node); ADD_PROPERTY( PropertyInfo(Variant::NODE_PATH,"remote_path"),_SCS("set_remote_node"),_SCS("get_remote_node")); } diff --git a/scene/2d/remote_transform_2d.h b/scene/2d/remote_transform_2d.h index 0ea1438f0a..52c28ffd4f 100644 --- a/scene/2d/remote_transform_2d.h +++ b/scene/2d/remote_transform_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -30,7 +30,7 @@ class RemoteTransform2D : public Node2D { - OBJ_TYPE(RemoteTransform2D,Node2D); + GDCLASS(RemoteTransform2D,Node2D); NodePath remote_node; diff --git a/scene/2d/sample_player_2d.cpp b/scene/2d/sample_player_2d.cpp index 7c997b3f12..62eabea98e 100644 --- a/scene/2d/sample_player_2d.cpp +++ b/scene/2d/sample_player_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -220,30 +220,31 @@ String SamplePlayer2D::get_configuration_warning() const { void SamplePlayer2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_sample_library","library:SampleLibrary"),&SamplePlayer2D::set_sample_library); - ObjectTypeDB::bind_method(_MD("get_sample_library:SampleLibrary"),&SamplePlayer2D::get_sample_library); + ClassDB::bind_method(_MD("set_sample_library","library:SampleLibrary"),&SamplePlayer2D::set_sample_library); + ClassDB::bind_method(_MD("get_sample_library:SampleLibrary"),&SamplePlayer2D::get_sample_library); - ObjectTypeDB::bind_method(_MD("set_polyphony","max_voices"),&SamplePlayer2D::set_polyphony); - ObjectTypeDB::bind_method(_MD("get_polyphony"),&SamplePlayer2D::get_polyphony); + ClassDB::bind_method(_MD("set_polyphony","max_voices"),&SamplePlayer2D::set_polyphony); + ClassDB::bind_method(_MD("get_polyphony"),&SamplePlayer2D::get_polyphony); - ObjectTypeDB::bind_method(_MD("play","sample","voice"),&SamplePlayer2D::play,DEFVAL(NEXT_VOICE)); + ClassDB::bind_method(_MD("play","sample","voice"),&SamplePlayer2D::play,DEFVAL(NEXT_VOICE)); //voices,DEV - ObjectTypeDB::bind_method(_MD("voice_set_pitch_scale","voice","ratio"),&SamplePlayer2D::voice_set_pitch_scale); - ObjectTypeDB::bind_method(_MD("voice_set_volume_scale_db","voice","db"),&SamplePlayer2D::voice_set_volume_scale_db); + ClassDB::bind_method(_MD("voice_set_pitch_scale","voice","ratio"),&SamplePlayer2D::voice_set_pitch_scale); + ClassDB::bind_method(_MD("voice_set_volume_scale_db","voice","db"),&SamplePlayer2D::voice_set_volume_scale_db); - ObjectTypeDB::bind_method(_MD("is_voice_active","voice"),&SamplePlayer2D::is_voice_active); - ObjectTypeDB::bind_method(_MD("stop_voice","voice"),&SamplePlayer2D::stop_voice); - ObjectTypeDB::bind_method(_MD("stop_all"),&SamplePlayer2D::stop_all); + ClassDB::bind_method(_MD("is_voice_active","voice"),&SamplePlayer2D::is_voice_active); + ClassDB::bind_method(_MD("stop_voice","voice"),&SamplePlayer2D::stop_voice); + ClassDB::bind_method(_MD("stop_all"),&SamplePlayer2D::stop_all); - ObjectTypeDB::bind_method(_MD("set_random_pitch_scale","val"),&SamplePlayer2D::set_random_pitch_scale); - ObjectTypeDB::bind_method(_MD("get_random_pitch_scale"),&SamplePlayer2D::get_random_pitch_scale); + ClassDB::bind_method(_MD("set_random_pitch_scale","val"),&SamplePlayer2D::set_random_pitch_scale); + ClassDB::bind_method(_MD("get_random_pitch_scale"),&SamplePlayer2D::get_random_pitch_scale); BIND_CONSTANT( INVALID_VOICE ); BIND_CONSTANT( NEXT_VOICE ); - ADD_PROPERTY( PropertyInfo( Variant::INT, "config/polyphony", PROPERTY_HINT_RANGE, "1,64,1"),_SCS("set_polyphony"),_SCS("get_polyphony")); - ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "config/samples", PROPERTY_HINT_RESOURCE_TYPE,"SampleLibrary"),_SCS("set_sample_library"),_SCS("get_sample_library")); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "config/pitch_random", PROPERTY_HINT_RESOURCE_TYPE,"SampleLibrary"),_SCS("set_random_pitch_scale"),_SCS("get_random_pitch_scale")); + ADD_GROUP("Config",""); + ADD_PROPERTY( PropertyInfo( Variant::INT, "polyphony", PROPERTY_HINT_RANGE, "1,64,1"),_SCS("set_polyphony"),_SCS("get_polyphony")); + ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "samples", PROPERTY_HINT_RESOURCE_TYPE,"SampleLibrary"),_SCS("set_sample_library"),_SCS("get_sample_library")); + ADD_PROPERTY( PropertyInfo( Variant::REAL, "pitch_random", PROPERTY_HINT_RESOURCE_TYPE,"SampleLibrary"),_SCS("set_random_pitch_scale"),_SCS("get_random_pitch_scale")); } diff --git a/scene/2d/sample_player_2d.h b/scene/2d/sample_player_2d.h index 5ab7f024d3..5cf598327b 100644 --- a/scene/2d/sample_player_2d.h +++ b/scene/2d/sample_player_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class SamplePlayer2D : public SoundPlayer2D { - OBJ_TYPE(SamplePlayer2D,SoundPlayer2D); + GDCLASS(SamplePlayer2D,SoundPlayer2D); public: enum { diff --git a/scene/2d/screen_button.cpp b/scene/2d/screen_button.cpp index fac94f19dc..3aacd7091a 100644 --- a/scene/2d/screen_button.cpp +++ b/scene/2d/screen_button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -338,27 +338,27 @@ bool TouchScreenButton::is_passby_press_enabled() const{ void TouchScreenButton::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_texture","texture"),&TouchScreenButton::set_texture); - ObjectTypeDB::bind_method(_MD("get_texture"),&TouchScreenButton::get_texture); + ClassDB::bind_method(_MD("set_texture","texture"),&TouchScreenButton::set_texture); + ClassDB::bind_method(_MD("get_texture"),&TouchScreenButton::get_texture); - ObjectTypeDB::bind_method(_MD("set_texture_pressed","texture_pressed"),&TouchScreenButton::set_texture_pressed); - ObjectTypeDB::bind_method(_MD("get_texture_pressed"),&TouchScreenButton::get_texture_pressed); + ClassDB::bind_method(_MD("set_texture_pressed","texture_pressed"),&TouchScreenButton::set_texture_pressed); + ClassDB::bind_method(_MD("get_texture_pressed"),&TouchScreenButton::get_texture_pressed); - ObjectTypeDB::bind_method(_MD("set_bitmask","bitmask"),&TouchScreenButton::set_bitmask); - ObjectTypeDB::bind_method(_MD("get_bitmask"),&TouchScreenButton::get_bitmask); + ClassDB::bind_method(_MD("set_bitmask","bitmask"),&TouchScreenButton::set_bitmask); + ClassDB::bind_method(_MD("get_bitmask"),&TouchScreenButton::get_bitmask); - ObjectTypeDB::bind_method(_MD("set_action","action"),&TouchScreenButton::set_action); - ObjectTypeDB::bind_method(_MD("get_action"),&TouchScreenButton::get_action); + ClassDB::bind_method(_MD("set_action","action"),&TouchScreenButton::set_action); + ClassDB::bind_method(_MD("get_action"),&TouchScreenButton::get_action); - ObjectTypeDB::bind_method(_MD("set_visibility_mode","mode"),&TouchScreenButton::set_visibility_mode); - ObjectTypeDB::bind_method(_MD("get_visibility_mode"),&TouchScreenButton::get_visibility_mode); + ClassDB::bind_method(_MD("set_visibility_mode","mode"),&TouchScreenButton::set_visibility_mode); + ClassDB::bind_method(_MD("get_visibility_mode"),&TouchScreenButton::get_visibility_mode); - ObjectTypeDB::bind_method(_MD("set_passby_press","enabled"),&TouchScreenButton::set_passby_press); - ObjectTypeDB::bind_method(_MD("is_passby_press_enabled"),&TouchScreenButton::is_passby_press_enabled); + ClassDB::bind_method(_MD("set_passby_press","enabled"),&TouchScreenButton::set_passby_press); + ClassDB::bind_method(_MD("is_passby_press_enabled"),&TouchScreenButton::is_passby_press_enabled); - ObjectTypeDB::bind_method(_MD("is_pressed"),&TouchScreenButton::is_pressed); + ClassDB::bind_method(_MD("is_pressed"),&TouchScreenButton::is_pressed); - ObjectTypeDB::bind_method(_MD("_input"),&TouchScreenButton::_input); + ClassDB::bind_method(_MD("_input"),&TouchScreenButton::_input); ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"normal",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture")); ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"pressed",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture_pressed"),_SCS("get_texture_pressed")); diff --git a/scene/2d/screen_button.h b/scene/2d/screen_button.h index ff3b50bf5e..34e02d644b 100644 --- a/scene/2d/screen_button.h +++ b/scene/2d/screen_button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class TouchScreenButton : public Node2D { - OBJ_TYPE(TouchScreenButton,Node2D); + GDCLASS(TouchScreenButton,Node2D); public: enum VisibilityMode { diff --git a/scene/2d/sound_player_2d.cpp b/scene/2d/sound_player_2d.cpp index 41ce87faf9..96382caa25 100644 --- a/scene/2d/sound_player_2d.cpp +++ b/scene/2d/sound_player_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -87,8 +87,8 @@ float SoundPlayer2D::get_param( Param p_param) const { void SoundPlayer2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_param","param","value"),&SoundPlayer2D::set_param); - ObjectTypeDB::bind_method(_MD("get_param","param"),&SoundPlayer2D::get_param); + ClassDB::bind_method(_MD("set_param","param","value"),&SoundPlayer2D::set_param); + ClassDB::bind_method(_MD("get_param","param"),&SoundPlayer2D::get_param); BIND_CONSTANT( PARAM_VOLUME_DB ); BIND_CONSTANT( PARAM_PITCH_SCALE ); @@ -97,11 +97,13 @@ void SoundPlayer2D::_bind_methods() { BIND_CONSTANT( PARAM_ATTENUATION_DISTANCE_EXP ); BIND_CONSTANT( PARAM_MAX ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/volume_db",PROPERTY_HINT_RANGE, "-80,24,0.01"),_SCS("set_param"),_SCS("get_param"),PARAM_VOLUME_DB); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/pitch_scale",PROPERTY_HINT_RANGE, "0.001,32,0.001"),_SCS("set_param"),_SCS("get_param"),PARAM_PITCH_SCALE); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/attenuation/min_distance",PROPERTY_HINT_EXP_RANGE, "16,16384,1"),_SCS("set_param"),_SCS("get_param"),PARAM_ATTENUATION_MIN_DISTANCE); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/attenuation/max_distance",PROPERTY_HINT_EXP_RANGE, "16,16384,1"),_SCS("set_param"),_SCS("get_param"),PARAM_ATTENUATION_MAX_DISTANCE); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/attenuation/distance_exp",PROPERTY_HINT_EXP_EASING, "attenuation"),_SCS("set_param"),_SCS("get_param"),PARAM_ATTENUATION_DISTANCE_EXP); + ADD_GROUP("Parameters",""); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "volume_db",PROPERTY_HINT_RANGE, "-80,24,0.01"),_SCS("set_param"),_SCS("get_param"),PARAM_VOLUME_DB); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "pitch_scale",PROPERTY_HINT_RANGE, "0.001,32,0.001"),_SCS("set_param"),_SCS("get_param"),PARAM_PITCH_SCALE); + ADD_GROUP("Attenuation","attenuation_"); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "attenuation_min_distance",PROPERTY_HINT_EXP_RANGE, "16,16384,1"),_SCS("set_param"),_SCS("get_param"),PARAM_ATTENUATION_MIN_DISTANCE); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "attenuation_max_distance",PROPERTY_HINT_EXP_RANGE, "16,16384,1"),_SCS("set_param"),_SCS("get_param"),PARAM_ATTENUATION_MAX_DISTANCE); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "attenuation_distance_exp",PROPERTY_HINT_EXP_EASING, "attenuation"),_SCS("set_param"),_SCS("get_param"),PARAM_ATTENUATION_DISTANCE_EXP); } diff --git a/scene/2d/sound_player_2d.h b/scene/2d/sound_player_2d.h index 0e75887235..bfabda4ec9 100644 --- a/scene/2d/sound_player_2d.h +++ b/scene/2d/sound_player_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ class SoundPlayer2D : public Node2D { - OBJ_TYPE(SoundPlayer2D,Node2D); + GDCLASS(SoundPlayer2D,Node2D); public: diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp index 8723db95d6..8bad8fcb38 100644 --- a/scene/2d/sprite.cpp +++ b/scene/2d/sprite.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -97,7 +97,7 @@ void Sprite::_notification(int p_what) { if (vflip) dst_rect.size.y=-dst_rect.size.y; - texture->draw_rect_region(ci,dst_rect,src_rect,modulate); + texture->draw_rect_region(ci,dst_rect,src_rect); } break; } @@ -249,16 +249,6 @@ int Sprite::get_hframes() const { return hframes; } -void Sprite::set_modulate(const Color& p_color) { - - modulate=p_color; - update(); -} - -Color Sprite::get_modulate() const{ - - return modulate; -} Rect2 Sprite::get_item_rect() const { @@ -302,38 +292,35 @@ void Sprite::_validate_property(PropertyInfo& property) const { void Sprite::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_texture","texture:Texture"),&Sprite::set_texture); - ObjectTypeDB::bind_method(_MD("get_texture:Texture"),&Sprite::get_texture); - - ObjectTypeDB::bind_method(_MD("set_centered","centered"),&Sprite::set_centered); - ObjectTypeDB::bind_method(_MD("is_centered"),&Sprite::is_centered); + ClassDB::bind_method(_MD("set_texture","texture:Texture"),&Sprite::set_texture); + ClassDB::bind_method(_MD("get_texture:Texture"),&Sprite::get_texture); - ObjectTypeDB::bind_method(_MD("set_offset","offset"),&Sprite::set_offset); - ObjectTypeDB::bind_method(_MD("get_offset"),&Sprite::get_offset); + ClassDB::bind_method(_MD("set_centered","centered"),&Sprite::set_centered); + ClassDB::bind_method(_MD("is_centered"),&Sprite::is_centered); - ObjectTypeDB::bind_method(_MD("set_flip_h","flip_h"),&Sprite::set_flip_h); - ObjectTypeDB::bind_method(_MD("is_flipped_h"),&Sprite::is_flipped_h); + ClassDB::bind_method(_MD("set_offset","offset"),&Sprite::set_offset); + ClassDB::bind_method(_MD("get_offset"),&Sprite::get_offset); - ObjectTypeDB::bind_method(_MD("set_flip_v","flip_v"),&Sprite::set_flip_v); - ObjectTypeDB::bind_method(_MD("is_flipped_v"),&Sprite::is_flipped_v); + ClassDB::bind_method(_MD("set_flip_h","flip_h"),&Sprite::set_flip_h); + ClassDB::bind_method(_MD("is_flipped_h"),&Sprite::is_flipped_h); - ObjectTypeDB::bind_method(_MD("set_region","enabled"),&Sprite::set_region); - ObjectTypeDB::bind_method(_MD("is_region"),&Sprite::is_region); + ClassDB::bind_method(_MD("set_flip_v","flip_v"),&Sprite::set_flip_v); + ClassDB::bind_method(_MD("is_flipped_v"),&Sprite::is_flipped_v); - ObjectTypeDB::bind_method(_MD("set_region_rect","rect"),&Sprite::set_region_rect); - ObjectTypeDB::bind_method(_MD("get_region_rect"),&Sprite::get_region_rect); + ClassDB::bind_method(_MD("set_region","enabled"),&Sprite::set_region); + ClassDB::bind_method(_MD("is_region"),&Sprite::is_region); - ObjectTypeDB::bind_method(_MD("set_frame","frame"),&Sprite::set_frame); - ObjectTypeDB::bind_method(_MD("get_frame"),&Sprite::get_frame); + ClassDB::bind_method(_MD("set_region_rect","rect"),&Sprite::set_region_rect); + ClassDB::bind_method(_MD("get_region_rect"),&Sprite::get_region_rect); - ObjectTypeDB::bind_method(_MD("set_vframes","vframes"),&Sprite::set_vframes); - ObjectTypeDB::bind_method(_MD("get_vframes"),&Sprite::get_vframes); + ClassDB::bind_method(_MD("set_frame","frame"),&Sprite::set_frame); + ClassDB::bind_method(_MD("get_frame"),&Sprite::get_frame); - ObjectTypeDB::bind_method(_MD("set_hframes","hframes"),&Sprite::set_hframes); - ObjectTypeDB::bind_method(_MD("get_hframes"),&Sprite::get_hframes); + ClassDB::bind_method(_MD("set_vframes","vframes"),&Sprite::set_vframes); + ClassDB::bind_method(_MD("get_vframes"),&Sprite::get_vframes); - ObjectTypeDB::bind_method(_MD("set_modulate","modulate"),&Sprite::set_modulate); - ObjectTypeDB::bind_method(_MD("get_modulate"),&Sprite::get_modulate); + ClassDB::bind_method(_MD("set_hframes","hframes"),&Sprite::set_hframes); + ClassDB::bind_method(_MD("get_hframes"),&Sprite::get_hframes); ADD_SIGNAL(MethodInfo("frame_changed")); ADD_SIGNAL(MethodInfo("texture_changed")); @@ -346,7 +333,6 @@ void Sprite::_bind_methods() { ADD_PROPERTYNO( PropertyInfo( Variant::INT, "vframes",PROPERTY_HINT_RANGE,"1,16384,1"), _SCS("set_vframes"),_SCS("get_vframes")); ADD_PROPERTYNO( PropertyInfo( Variant::INT, "hframes",PROPERTY_HINT_RANGE,"1,16384,1"), _SCS("set_hframes"),_SCS("get_hframes")); ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "frame",PROPERTY_HINT_SPRITE_FRAME), _SCS("set_frame"),_SCS("get_frame")); - ADD_PROPERTYNO( PropertyInfo( Variant::COLOR, "modulate"), _SCS("set_modulate"),_SCS("get_modulate")); ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "region"), _SCS("set_region"),_SCS("is_region")); ADD_PROPERTYNZ( PropertyInfo( Variant::RECT2, "region_rect"), _SCS("set_region_rect"),_SCS("get_region_rect")); @@ -364,9 +350,6 @@ Sprite::Sprite() { vframes=1; hframes=1; - modulate=Color(1,1,1,1); - - } @@ -377,7 +360,7 @@ Sprite::Sprite() { /// /// - +#if 0 void ViewportSprite::edit_set_pivot(const Point2& p_pivot) { set_offset(p_pivot); @@ -565,17 +548,17 @@ String ViewportSprite::get_configuration_warning() const { void ViewportSprite::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_viewport_path","path"),&ViewportSprite::set_viewport_path); - ObjectTypeDB::bind_method(_MD("get_viewport_path"),&ViewportSprite::get_viewport_path); + ClassDB::bind_method(_MD("set_viewport_path","path"),&ViewportSprite::set_viewport_path); + ClassDB::bind_method(_MD("get_viewport_path"),&ViewportSprite::get_viewport_path); - ObjectTypeDB::bind_method(_MD("set_centered","centered"),&ViewportSprite::set_centered); - ObjectTypeDB::bind_method(_MD("is_centered"),&ViewportSprite::is_centered); + ClassDB::bind_method(_MD("set_centered","centered"),&ViewportSprite::set_centered); + ClassDB::bind_method(_MD("is_centered"),&ViewportSprite::is_centered); - ObjectTypeDB::bind_method(_MD("set_offset","offset"),&ViewportSprite::set_offset); - ObjectTypeDB::bind_method(_MD("get_offset"),&ViewportSprite::get_offset); + ClassDB::bind_method(_MD("set_offset","offset"),&ViewportSprite::set_offset); + ClassDB::bind_method(_MD("get_offset"),&ViewportSprite::get_offset); - ObjectTypeDB::bind_method(_MD("set_modulate","modulate"),&ViewportSprite::set_modulate); - ObjectTypeDB::bind_method(_MD("get_modulate"),&ViewportSprite::get_modulate); + ClassDB::bind_method(_MD("set_modulate","modulate"),&ViewportSprite::set_modulate); + ClassDB::bind_method(_MD("get_modulate"),&ViewportSprite::get_modulate); ADD_PROPERTYNZ( PropertyInfo( Variant::NODE_PATH, "viewport"), _SCS("set_viewport_path"),_SCS("get_viewport_path")); ADD_PROPERTYNO( PropertyInfo( Variant::BOOL, "centered"), _SCS("set_centered"),_SCS("is_centered")); @@ -589,3 +572,4 @@ ViewportSprite::ViewportSprite() { centered=true; modulate=Color(1,1,1,1); } +#endif diff --git a/scene/2d/sprite.h b/scene/2d/sprite.h index 32d3f476d1..05c0bd9eec 100644 --- a/scene/2d/sprite.h +++ b/scene/2d/sprite.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class Sprite : public Node2D { - OBJ_TYPE( Sprite, Node2D ); + GDCLASS( Sprite, Node2D ); Ref<Texture> texture; @@ -52,7 +52,6 @@ class Sprite : public Node2D { int vframes; int hframes; - Color modulate; protected: @@ -99,17 +98,15 @@ public: void set_hframes(int p_amount); int get_hframes() const; - void set_modulate(const Color& p_color); - Color get_modulate() const; - virtual Rect2 get_item_rect() const; Sprite(); }; +#if 0 class ViewportSprite : public Node2D { - OBJ_TYPE( ViewportSprite, Node2D ); + GDCLASS( ViewportSprite, Node2D ); Ref<Texture> texture; NodePath viewport_path; @@ -149,4 +146,5 @@ public: ViewportSprite(); }; +#endif #endif // SPRITE_H diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 1a4f88c30e..7bd3a5d932 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -114,16 +114,16 @@ void TileMap::_update_quadrant_transform() { if (!is_inside_tree()) return; - Matrix32 global_transform = get_global_transform(); + Transform2D global_transform = get_global_transform(); - Matrix32 nav_rel; + Transform2D nav_rel; if (navigation) nav_rel = get_relative_transform_to_parent(navigation); for (Map<PosKey,Quadrant>::Element *E=quadrant_map.front();E;E=E->next()) { Quadrant &q=E->get(); - Matrix32 xform; + Transform2D xform; xform.set_origin( q.pos ); xform = global_transform * xform; Physics2DServer::get_singleton()->body_set_state(q.body,Physics2DServer::BODY_STATE_TRANSFORM,xform); @@ -218,7 +218,7 @@ bool TileMap::get_center_y() const { return center_y; } -void TileMap::_fix_cell_transform(Matrix32& xform,const Cell& p_cell, const Vector2& p_offset, const Size2 &p_sc) { +void TileMap::_fix_cell_transform(Transform2D& xform,const Cell& p_cell, const Vector2& p_offset, const Size2 &p_sc) { Size2 s=p_sc; Vector2 offset = p_offset; @@ -268,16 +268,16 @@ void TileMap::_update_dirty_quadrants() { if (!pending_update) return; - if (!is_inside_tree()) - return; - if (!tile_set.is_valid()) + if (!is_inside_tree() || !tile_set.is_valid()) { + pending_update = false; return; + } VisualServer *vs = VisualServer::get_singleton(); Physics2DServer *ps = Physics2DServer::get_singleton(); Vector2 tofs = get_cell_draw_offset(); Vector2 tcenter = cell_size/2; - Matrix32 nav_rel; + Transform2D nav_rel; if (navigation) nav_rel = get_relative_transform_to_parent(navigation); @@ -348,7 +348,7 @@ void TileMap::_update_dirty_quadrants() { if (mat.is_valid()) vs->canvas_item_set_material(canvas_item,mat->get_rid()); vs->canvas_item_set_parent( canvas_item, get_canvas_item() ); - Matrix32 xform; + Transform2D xform; xform.set_origin( q.pos ); vs->canvas_item_set_transform( canvas_item, xform ); vs->canvas_item_set_light_mask(canvas_item,get_light_mask()); @@ -472,12 +472,12 @@ void TileMap::_update_dirty_quadrants() { if (shape.is_valid()) { Vector2 shape_ofs = tile_set->tile_get_shape_offset(c.id); - Matrix32 xform; + Transform2D xform; xform.set_origin(offset.floor()); _fix_cell_transform(xform,c,shape_ofs+center_ofs,s); - if (debug_canvas_item) { + if (debug_canvas_item.is_valid()) { vs->canvas_item_add_set_transform(debug_canvas_item,xform); shape->draw(debug_canvas_item,debug_collision_color); @@ -488,15 +488,15 @@ void TileMap::_update_dirty_quadrants() { } } - if (debug_canvas_item) { - vs->canvas_item_add_set_transform(debug_canvas_item,Matrix32()); + if (debug_canvas_item.is_valid()) { + vs->canvas_item_add_set_transform(debug_canvas_item,Transform2D()); } if (navigation) { Ref<NavigationPolygon> navpoly = tile_set->tile_get_navigation_polygon(c.id); if (navpoly.is_valid()) { Vector2 npoly_ofs = tile_set->tile_get_navigation_polygon_offset(c.id); - Matrix32 xform; + Transform2D xform; xform.set_origin(offset.floor()+q.pos); _fix_cell_transform(xform,c,npoly_ofs+center_ofs,s); @@ -515,7 +515,7 @@ void TileMap::_update_dirty_quadrants() { if (occluder.is_valid()) { Vector2 occluder_ofs = tile_set->tile_get_occluder_offset(c.id); - Matrix32 xform; + Transform2D xform; xform.set_origin(offset.floor()+q.pos); _fix_cell_transform(xform,c,occluder_ofs+center_ofs,s); @@ -541,26 +541,19 @@ void TileMap::_update_dirty_quadrants() { if (quadrant_order_dirty) { + int index=-0x80000000; //always must be drawn below children for (Map<PosKey,Quadrant>::Element *E=quadrant_map.front();E;E=E->next()) { Quadrant &q=E->get(); for (List<RID>::Element *E=q.canvas_items.front();E;E=E->next()) { - VS::get_singleton()->canvas_item_raise(E->get()); + VS::get_singleton()->canvas_item_set_draw_index(E->get(),index++); } } quadrant_order_dirty=false; } - for(int i=0;i<get_child_count();i++) { - - CanvasItem *c=get_child(i)->cast_to<CanvasItem>(); - - if (c) - VS::get_singleton()->canvas_item_raise(c->get_canvas_item()); - } - _recompute_rect_cache(); } @@ -605,7 +598,7 @@ void TileMap::_recompute_rect_cache() { Map<TileMap::PosKey,TileMap::Quadrant>::Element *TileMap::_create_quadrant(const PosKey& p_qk) { - Matrix32 xform; + Transform2D xform; //xform.set_origin(Point2(p_qk.x,p_qk.y)*cell_size*quadrant_size); Quadrant q; q.pos = _map_to_world(p_qk.x*_get_quadrant_size(),p_qk.y*_get_quadrant_size()); @@ -826,10 +819,10 @@ void TileMap::clear() { tile_map.clear(); } -void TileMap::_set_tile_data(const DVector<int>& p_data) { +void TileMap::_set_tile_data(const PoolVector<int>& p_data) { int c=p_data.size(); - DVector<int>::Read r = p_data.read(); + PoolVector<int>::Read r = p_data.read(); for(int i=0;i<c;i+=2) { @@ -864,11 +857,11 @@ void TileMap::_set_tile_data(const DVector<int>& p_data) { } -DVector<int> TileMap::_get_tile_data() const { +PoolVector<int> TileMap::_get_tile_data() const { - DVector<int> data; + PoolVector<int> data; data.resize(tile_map.size()*2); - DVector<int>::Write w = data.write(); + PoolVector<int>::Write w = data.write(); int idx=0; for(const Map<PosKey,Cell>::Element *E=tile_map.front();E;E=E->next()) { @@ -889,7 +882,7 @@ DVector<int> TileMap::_get_tile_data() const { } - w = DVector<int>::Write(); + w = PoolVector<int>::Write(); return data; @@ -1041,13 +1034,13 @@ TileMap::HalfOffset TileMap::get_half_offset() const { return half_offset; } -Matrix32 TileMap::get_cell_transform() const { +Transform2D TileMap::get_cell_transform() const { switch(mode) { case MODE_SQUARE: { - Matrix32 m; + Transform2D m; m[0]*=cell_size.x; m[1]*=cell_size.y; return m; @@ -1056,7 +1049,7 @@ Matrix32 TileMap::get_cell_transform() const { //isometric only makes sense when y is positive in both x and y vectors, otherwise //the drawing of tiles will overlap - Matrix32 m; + Transform2D m; m[0]=Vector2(cell_size.x*0.5,cell_size.y*0.5); m[1]=Vector2(-cell_size.x*0.5,cell_size.y*0.5); return m; @@ -1068,10 +1061,10 @@ Matrix32 TileMap::get_cell_transform() const { } break; } - return Matrix32(); + return Transform2D(); } -void TileMap::set_custom_transform(const Matrix32& p_xform) { +void TileMap::set_custom_transform(const Transform2D& p_xform) { _clear_quadrants(); custom_transform=p_xform; @@ -1080,7 +1073,7 @@ void TileMap::set_custom_transform(const Matrix32& p_xform) { } -Matrix32 TileMap::get_custom_transform() const{ +Transform2D TileMap::get_custom_transform() const{ return custom_transform; } @@ -1193,95 +1186,100 @@ void TileMap::set_light_mask(int p_light_mask) { void TileMap::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_tileset","tileset:TileSet"),&TileMap::set_tileset); - ObjectTypeDB::bind_method(_MD("get_tileset:TileSet"),&TileMap::get_tileset); + ClassDB::bind_method(_MD("set_tileset","tileset:TileSet"),&TileMap::set_tileset); + ClassDB::bind_method(_MD("get_tileset:TileSet"),&TileMap::get_tileset); - ObjectTypeDB::bind_method(_MD("set_mode","mode"),&TileMap::set_mode); - ObjectTypeDB::bind_method(_MD("get_mode"),&TileMap::get_mode); + ClassDB::bind_method(_MD("set_mode","mode"),&TileMap::set_mode); + ClassDB::bind_method(_MD("get_mode"),&TileMap::get_mode); - ObjectTypeDB::bind_method(_MD("set_half_offset","half_offset"),&TileMap::set_half_offset); - ObjectTypeDB::bind_method(_MD("get_half_offset"),&TileMap::get_half_offset); + ClassDB::bind_method(_MD("set_half_offset","half_offset"),&TileMap::set_half_offset); + ClassDB::bind_method(_MD("get_half_offset"),&TileMap::get_half_offset); - ObjectTypeDB::bind_method(_MD("set_custom_transform","custom_transform"),&TileMap::set_custom_transform); - ObjectTypeDB::bind_method(_MD("get_custom_transform"),&TileMap::get_custom_transform); + ClassDB::bind_method(_MD("set_custom_transform","custom_transform"),&TileMap::set_custom_transform); + ClassDB::bind_method(_MD("get_custom_transform"),&TileMap::get_custom_transform); - ObjectTypeDB::bind_method(_MD("set_cell_size","size"),&TileMap::set_cell_size); - ObjectTypeDB::bind_method(_MD("get_cell_size"),&TileMap::get_cell_size); + ClassDB::bind_method(_MD("set_cell_size","size"),&TileMap::set_cell_size); + ClassDB::bind_method(_MD("get_cell_size"),&TileMap::get_cell_size); - ObjectTypeDB::bind_method(_MD("_set_old_cell_size","size"),&TileMap::_set_old_cell_size); - ObjectTypeDB::bind_method(_MD("_get_old_cell_size"),&TileMap::_get_old_cell_size); + ClassDB::bind_method(_MD("_set_old_cell_size","size"),&TileMap::_set_old_cell_size); + ClassDB::bind_method(_MD("_get_old_cell_size"),&TileMap::_get_old_cell_size); - ObjectTypeDB::bind_method(_MD("set_quadrant_size","size"),&TileMap::set_quadrant_size); - ObjectTypeDB::bind_method(_MD("get_quadrant_size"),&TileMap::get_quadrant_size); + ClassDB::bind_method(_MD("set_quadrant_size","size"),&TileMap::set_quadrant_size); + ClassDB::bind_method(_MD("get_quadrant_size"),&TileMap::get_quadrant_size); - ObjectTypeDB::bind_method(_MD("set_tile_origin","origin"),&TileMap::set_tile_origin); - ObjectTypeDB::bind_method(_MD("get_tile_origin"),&TileMap::get_tile_origin); + ClassDB::bind_method(_MD("set_tile_origin","origin"),&TileMap::set_tile_origin); + ClassDB::bind_method(_MD("get_tile_origin"),&TileMap::get_tile_origin); - ObjectTypeDB::bind_method(_MD("set_center_x","enable"),&TileMap::set_center_x); - ObjectTypeDB::bind_method(_MD("get_center_x"),&TileMap::get_center_x); + ClassDB::bind_method(_MD("set_center_x","enable"),&TileMap::set_center_x); + ClassDB::bind_method(_MD("get_center_x"),&TileMap::get_center_x); - ObjectTypeDB::bind_method(_MD("set_center_y","enable"),&TileMap::set_center_y); - ObjectTypeDB::bind_method(_MD("get_center_y"),&TileMap::get_center_y); + ClassDB::bind_method(_MD("set_center_y","enable"),&TileMap::set_center_y); + ClassDB::bind_method(_MD("get_center_y"),&TileMap::get_center_y); - ObjectTypeDB::bind_method(_MD("set_y_sort_mode","enable"),&TileMap::set_y_sort_mode); - ObjectTypeDB::bind_method(_MD("is_y_sort_mode_enabled"),&TileMap::is_y_sort_mode_enabled); + ClassDB::bind_method(_MD("set_y_sort_mode","enable"),&TileMap::set_y_sort_mode); + ClassDB::bind_method(_MD("is_y_sort_mode_enabled"),&TileMap::is_y_sort_mode_enabled); - ObjectTypeDB::bind_method(_MD("set_collision_use_kinematic","use_kinematic"),&TileMap::set_collision_use_kinematic); - ObjectTypeDB::bind_method(_MD("get_collision_use_kinematic"),&TileMap::get_collision_use_kinematic); + ClassDB::bind_method(_MD("set_collision_use_kinematic","use_kinematic"),&TileMap::set_collision_use_kinematic); + ClassDB::bind_method(_MD("get_collision_use_kinematic"),&TileMap::get_collision_use_kinematic); - ObjectTypeDB::bind_method(_MD("set_collision_layer","mask"),&TileMap::set_collision_layer); - ObjectTypeDB::bind_method(_MD("get_collision_layer"),&TileMap::get_collision_layer); + ClassDB::bind_method(_MD("set_collision_layer","mask"),&TileMap::set_collision_layer); + ClassDB::bind_method(_MD("get_collision_layer"),&TileMap::get_collision_layer); - ObjectTypeDB::bind_method(_MD("set_collision_mask","mask"),&TileMap::set_collision_mask); - ObjectTypeDB::bind_method(_MD("get_collision_mask"),&TileMap::get_collision_mask); + ClassDB::bind_method(_MD("set_collision_mask","mask"),&TileMap::set_collision_mask); + ClassDB::bind_method(_MD("get_collision_mask"),&TileMap::get_collision_mask); - ObjectTypeDB::bind_method(_MD("set_collision_friction","value"),&TileMap::set_collision_friction); - ObjectTypeDB::bind_method(_MD("get_collision_friction"),&TileMap::get_collision_friction); + ClassDB::bind_method(_MD("set_collision_friction","value"),&TileMap::set_collision_friction); + ClassDB::bind_method(_MD("get_collision_friction"),&TileMap::get_collision_friction); - ObjectTypeDB::bind_method(_MD("set_collision_bounce","value"),&TileMap::set_collision_bounce); - ObjectTypeDB::bind_method(_MD("get_collision_bounce"),&TileMap::get_collision_bounce); + ClassDB::bind_method(_MD("set_collision_bounce","value"),&TileMap::set_collision_bounce); + ClassDB::bind_method(_MD("get_collision_bounce"),&TileMap::get_collision_bounce); - ObjectTypeDB::bind_method(_MD("set_occluder_light_mask","mask"),&TileMap::set_occluder_light_mask); - ObjectTypeDB::bind_method(_MD("get_occluder_light_mask"),&TileMap::get_occluder_light_mask); + ClassDB::bind_method(_MD("set_occluder_light_mask","mask"),&TileMap::set_occluder_light_mask); + ClassDB::bind_method(_MD("get_occluder_light_mask"),&TileMap::get_occluder_light_mask); - ObjectTypeDB::bind_method(_MD("set_cell","x","y","tile","flip_x","flip_y","transpose"),&TileMap::set_cell,DEFVAL(false),DEFVAL(false),DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("set_cellv","pos","tile","flip_x","flip_y","transpose"),&TileMap::set_cellv,DEFVAL(false),DEFVAL(false),DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("get_cell","x","y"),&TileMap::get_cell); - ObjectTypeDB::bind_method(_MD("get_cellv","pos"),&TileMap::get_cellv); - ObjectTypeDB::bind_method(_MD("is_cell_x_flipped","x","y"),&TileMap::is_cell_x_flipped); - ObjectTypeDB::bind_method(_MD("is_cell_y_flipped","x","y"),&TileMap::is_cell_y_flipped); - ObjectTypeDB::bind_method(_MD("is_cell_transposed","x","y"),&TileMap::is_cell_transposed); + ClassDB::bind_method(_MD("set_cell","x","y","tile","flip_x","flip_y","transpose"),&TileMap::set_cell,DEFVAL(false),DEFVAL(false),DEFVAL(false)); + ClassDB::bind_method(_MD("set_cellv","pos","tile","flip_x","flip_y","transpose"),&TileMap::set_cellv,DEFVAL(false),DEFVAL(false),DEFVAL(false)); + ClassDB::bind_method(_MD("get_cell","x","y"),&TileMap::get_cell); + ClassDB::bind_method(_MD("get_cellv","pos"),&TileMap::get_cellv); + ClassDB::bind_method(_MD("is_cell_x_flipped","x","y"),&TileMap::is_cell_x_flipped); + ClassDB::bind_method(_MD("is_cell_y_flipped","x","y"),&TileMap::is_cell_y_flipped); + ClassDB::bind_method(_MD("is_cell_transposed","x","y"),&TileMap::is_cell_transposed); - ObjectTypeDB::bind_method(_MD("clear"),&TileMap::clear); + ClassDB::bind_method(_MD("clear"),&TileMap::clear); - ObjectTypeDB::bind_method(_MD("get_used_cells"),&TileMap::get_used_cells); + ClassDB::bind_method(_MD("get_used_cells"),&TileMap::get_used_cells); - ObjectTypeDB::bind_method(_MD("map_to_world","mappos","ignore_half_ofs"),&TileMap::map_to_world,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("world_to_map","worldpos"),&TileMap::world_to_map); + ClassDB::bind_method(_MD("map_to_world","mappos","ignore_half_ofs"),&TileMap::map_to_world,DEFVAL(false)); + ClassDB::bind_method(_MD("world_to_map","worldpos"),&TileMap::world_to_map); - ObjectTypeDB::bind_method(_MD("_clear_quadrants"),&TileMap::_clear_quadrants); - ObjectTypeDB::bind_method(_MD("_recreate_quadrants"),&TileMap::_recreate_quadrants); - ObjectTypeDB::bind_method(_MD("_update_dirty_quadrants"),&TileMap::_update_dirty_quadrants); + ClassDB::bind_method(_MD("_clear_quadrants"),&TileMap::_clear_quadrants); + ClassDB::bind_method(_MD("_recreate_quadrants"),&TileMap::_recreate_quadrants); + ClassDB::bind_method(_MD("_update_dirty_quadrants"),&TileMap::_update_dirty_quadrants); - ObjectTypeDB::bind_method(_MD("_set_tile_data"),&TileMap::_set_tile_data); - ObjectTypeDB::bind_method(_MD("_get_tile_data"),&TileMap::_get_tile_data); + ClassDB::bind_method(_MD("_set_tile_data"),&TileMap::_set_tile_data); + ClassDB::bind_method(_MD("_get_tile_data"),&TileMap::_get_tile_data); ADD_PROPERTY( PropertyInfo(Variant::INT,"mode",PROPERTY_HINT_ENUM,"Square,Isometric,Custom"),_SCS("set_mode"),_SCS("get_mode")); ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"tile_set",PROPERTY_HINT_RESOURCE_TYPE,"TileSet"),_SCS("set_tileset"),_SCS("get_tileset")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"cell_size",PROPERTY_HINT_RANGE,"1,8192,1",0),_SCS("_set_old_cell_size"),_SCS("_get_old_cell_size")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"cell/size",PROPERTY_HINT_RANGE,"1,8192,1"),_SCS("set_cell_size"),_SCS("get_cell_size")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"cell/quadrant_size",PROPERTY_HINT_RANGE,"1,128,1"),_SCS("set_quadrant_size"),_SCS("get_quadrant_size")); - ADD_PROPERTY( PropertyInfo(Variant::MATRIX32,"cell/custom_transform"),_SCS("set_custom_transform"),_SCS("get_custom_transform")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"cell/half_offset",PROPERTY_HINT_ENUM,"Offset X,Offset Y,Disabled"),_SCS("set_half_offset"),_SCS("get_half_offset")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"cell/tile_origin",PROPERTY_HINT_ENUM,"Top Left,Center,Bottom Left"),_SCS("set_tile_origin"),_SCS("get_tile_origin")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"cell/y_sort"),_SCS("set_y_sort_mode"),_SCS("is_y_sort_mode_enabled")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"collision/use_kinematic",PROPERTY_HINT_NONE,""),_SCS("set_collision_use_kinematic"),_SCS("get_collision_use_kinematic")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"collision/friction",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_collision_friction"),_SCS("get_collision_friction")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"collision/bounce",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_collision_bounce"),_SCS("get_collision_bounce")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"collision/layers",PROPERTY_HINT_ALL_FLAGS),_SCS("set_collision_layer"),_SCS("get_collision_layer")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"collision/mask",PROPERTY_HINT_ALL_FLAGS),_SCS("set_collision_mask"),_SCS("get_collision_mask")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"occluder/light_mask",PROPERTY_HINT_ALL_FLAGS),_SCS("set_occluder_light_mask"),_SCS("get_occluder_light_mask")); + ADD_GROUP("Cell","cell_"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"cell_size",PROPERTY_HINT_RANGE,"1,8192,1"),_SCS("set_cell_size"),_SCS("get_cell_size")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"cell_quadrant_size",PROPERTY_HINT_RANGE,"1,128,1"),_SCS("set_quadrant_size"),_SCS("get_quadrant_size")); + ADD_PROPERTY( PropertyInfo(Variant::TRANSFORM2D,"cell_custom_transform"),_SCS("set_custom_transform"),_SCS("get_custom_transform")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"cell_half_offset",PROPERTY_HINT_ENUM,"Offset X,Offset Y,Disabled"),_SCS("set_half_offset"),_SCS("get_half_offset")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"cell_tile_origin",PROPERTY_HINT_ENUM,"Top Left,Center,Bottom Left"),_SCS("set_tile_origin"),_SCS("get_tile_origin")); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"cell_y_sort"),_SCS("set_y_sort_mode"),_SCS("is_y_sort_mode_enabled")); + + ADD_GROUP("Collision","collision_"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"collision_use_kinematic",PROPERTY_HINT_NONE,""),_SCS("set_collision_use_kinematic"),_SCS("get_collision_use_kinematic")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"collision_friction",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_collision_friction"),_SCS("get_collision_friction")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"collision_bounce",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_collision_bounce"),_SCS("get_collision_bounce")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"collision_layers",PROPERTY_HINT_LAYERS_2D_PHYSICS),_SCS("set_collision_layer"),_SCS("get_collision_layer")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"collision_mask",PROPERTY_HINT_LAYERS_2D_PHYSICS),_SCS("set_collision_mask"),_SCS("get_collision_mask")); + + ADD_GROUP("Occluder","occluder_"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"occluder_light_mask",PROPERTY_HINT_LAYERS_2D_RENDER),_SCS("set_occluder_light_mask"),_SCS("get_occluder_light_mask")); + ADD_GROUP("",""); ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"tile_data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_tile_data"),_SCS("_get_tile_data")); ADD_SIGNAL(MethodInfo("settings_changed")); diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h index b48fdde43f..ba6de62f8e 100644 --- a/scene/2d/tile_map.h +++ b/scene/2d/tile_map.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ class TileMap : public Node2D { - OBJ_TYPE( TileMap, Node2D ); + GDCLASS( TileMap, Node2D ); public: enum Mode { @@ -66,7 +66,7 @@ private: int quadrant_size; bool center_x,center_y; Mode mode; - Matrix32 custom_transform; + Transform2D custom_transform; HalfOffset half_offset; bool use_kinematic; Navigation2D *navigation; @@ -114,12 +114,12 @@ private: struct NavPoly { int id; - Matrix32 xform; + Transform2D xform; }; struct Occluder { RID id; - Matrix32 xform; + Transform2D xform; }; @@ -153,7 +153,7 @@ private: int occluder_light_mask; - void _fix_cell_transform(Matrix32& xform, const Cell& p_cell, const Vector2 &p_offset, const Size2 &p_sc); + void _fix_cell_transform(Transform2D& xform, const Cell& p_cell, const Vector2 &p_offset, const Size2 &p_sc); Map<PosKey,Quadrant>::Element *_create_quadrant(const PosKey& p_qk); void _erase_quadrant(Map<PosKey,Quadrant>::Element *Q); @@ -168,8 +168,8 @@ private: _FORCE_INLINE_ int _get_quadrant_size() const; - void _set_tile_data(const DVector<int>& p_data); - DVector<int> _get_tile_data() const; + void _set_tile_data(const PoolVector<int>& p_data); + PoolVector<int> _get_tile_data() const; void _set_old_cell_size(int p_size) { set_cell_size(Size2(p_size,p_size)); } int _get_old_cell_size() const { return cell_size.x; } @@ -240,10 +240,10 @@ public: void set_tile_origin(TileOrigin p_tile_origin); TileOrigin get_tile_origin() const; - void set_custom_transform(const Matrix32& p_xform); - Matrix32 get_custom_transform() const; + void set_custom_transform(const Transform2D& p_xform); + Transform2D get_custom_transform() const; - Matrix32 get_cell_transform() const; + Transform2D get_cell_transform() const; Vector2 get_cell_draw_offset() const; Vector2 map_to_world(const Vector2& p_pos, bool p_ignore_ofs=false) const; diff --git a/scene/2d/visibility_notifier_2d.cpp b/scene/2d/visibility_notifier_2d.cpp index 852bc187d2..4594273db2 100644 --- a/scene/2d/visibility_notifier_2d.cpp +++ b/scene/2d/visibility_notifier_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -129,9 +129,9 @@ bool VisibilityNotifier2D::is_on_screen() const { void VisibilityNotifier2D::_bind_methods(){ - ObjectTypeDB::bind_method(_MD("set_rect","rect"),&VisibilityNotifier2D::set_rect); - ObjectTypeDB::bind_method(_MD("get_rect"),&VisibilityNotifier2D::get_rect); - ObjectTypeDB::bind_method(_MD("is_on_screen"),&VisibilityNotifier2D::is_on_screen); + ClassDB::bind_method(_MD("set_rect","rect"),&VisibilityNotifier2D::set_rect); + ClassDB::bind_method(_MD("get_rect"),&VisibilityNotifier2D::get_rect); + ClassDB::bind_method(_MD("is_on_screen"),&VisibilityNotifier2D::is_on_screen); ADD_PROPERTY( PropertyInfo(Variant::RECT2,"rect"),_SCS("set_rect"),_SCS("get_rect")); @@ -354,16 +354,16 @@ String VisibilityEnabler2D::get_configuration_warning() const { void VisibilityEnabler2D::_bind_methods(){ - ObjectTypeDB::bind_method(_MD("set_enabler","enabler","enabled"),&VisibilityEnabler2D::set_enabler); - ObjectTypeDB::bind_method(_MD("is_enabler_enabled","enabler"),&VisibilityEnabler2D::is_enabler_enabled); - ObjectTypeDB::bind_method(_MD("_node_removed"),&VisibilityEnabler2D::_node_removed); + ClassDB::bind_method(_MD("set_enabler","enabler","enabled"),&VisibilityEnabler2D::set_enabler); + ClassDB::bind_method(_MD("is_enabler_enabled","enabler"),&VisibilityEnabler2D::is_enabler_enabled); + ClassDB::bind_method(_MD("_node_removed"),&VisibilityEnabler2D::_node_removed); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"enabler/pause_animations"),_SCS("set_enabler"),_SCS("is_enabler_enabled"), ENABLER_PAUSE_ANIMATIONS ); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"enabler/freeze_bodies"),_SCS("set_enabler"),_SCS("is_enabler_enabled"), ENABLER_FREEZE_BODIES); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"enabler/pause_particles"),_SCS("set_enabler"),_SCS("is_enabler_enabled"), ENABLER_PAUSE_PARTICLES); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"enabler/pause_animated_sprites"),_SCS("set_enabler"),_SCS("is_enabler_enabled"), ENABLER_PAUSE_ANIMATED_SPRITES); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"enabler/process_parent"),_SCS("set_enabler"),_SCS("is_enabler_enabled"), ENABLER_PARENT_PROCESS); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"enabler/fixed_process_parent"),_SCS("set_enabler"),_SCS("is_enabler_enabled"), ENABLER_PARENT_FIXED_PROCESS); + ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"pause_animations"),_SCS("set_enabler"),_SCS("is_enabler_enabled"), ENABLER_PAUSE_ANIMATIONS ); + ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"freeze_bodies"),_SCS("set_enabler"),_SCS("is_enabler_enabled"), ENABLER_FREEZE_BODIES); + ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"pause_particles"),_SCS("set_enabler"),_SCS("is_enabler_enabled"), ENABLER_PAUSE_PARTICLES); + ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"pause_animated_sprites"),_SCS("set_enabler"),_SCS("is_enabler_enabled"), ENABLER_PAUSE_ANIMATED_SPRITES); + ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"process_parent"),_SCS("set_enabler"),_SCS("is_enabler_enabled"), ENABLER_PARENT_PROCESS); + ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"fixed_process_parent"),_SCS("set_enabler"),_SCS("is_enabler_enabled"), ENABLER_PARENT_FIXED_PROCESS); BIND_CONSTANT( ENABLER_FREEZE_BODIES ); BIND_CONSTANT( ENABLER_PAUSE_ANIMATIONS ); diff --git a/scene/2d/visibility_notifier_2d.h b/scene/2d/visibility_notifier_2d.h index 354ccf4345..a896e270fe 100644 --- a/scene/2d/visibility_notifier_2d.h +++ b/scene/2d/visibility_notifier_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class Viewport; class VisibilityNotifier2D : public Node2D { - OBJ_TYPE(VisibilityNotifier2D,Node2D); + GDCLASS(VisibilityNotifier2D,Node2D); Set<Viewport*> viewports; @@ -67,7 +67,7 @@ public: class VisibilityEnabler2D : public VisibilityNotifier2D { - OBJ_TYPE(VisibilityEnabler2D,VisibilityNotifier2D); + GDCLASS(VisibilityEnabler2D,VisibilityNotifier2D); public: enum Enabler { diff --git a/scene/2d/y_sort.cpp b/scene/2d/y_sort.cpp index ed753ef745..588f343048 100644 --- a/scene/2d/y_sort.cpp +++ b/scene/2d/y_sort.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -43,10 +43,11 @@ bool YSort::is_sort_enabled() const { void YSort::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_sort_enabled","enabled"),&YSort::set_sort_enabled); - ObjectTypeDB::bind_method(_MD("is_sort_enabled"),&YSort::is_sort_enabled); + ClassDB::bind_method(_MD("set_sort_enabled","enabled"),&YSort::set_sort_enabled); + ClassDB::bind_method(_MD("is_sort_enabled"),&YSort::is_sort_enabled); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"sort/enabled"),_SCS("set_sort_enabled"),_SCS("is_sort_enabled")); + ADD_GROUP("Sort","sort_"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"sort_enabled"),_SCS("set_sort_enabled"),_SCS("is_sort_enabled")); } diff --git a/scene/2d/y_sort.h b/scene/2d/y_sort.h index c8fa152c75..ebfe695da1 100644 --- a/scene/2d/y_sort.h +++ b/scene/2d/y_sort.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,7 +32,7 @@ #include "scene/2d/node_2d.h" class YSort : public Node2D { - OBJ_TYPE(YSort,Node2D); + GDCLASS(YSort,Node2D); bool sort_enabled; static void _bind_methods(); public: diff --git a/scene/3d/area.cpp b/scene/3d/area.cpp index c1d0d1a97c..10b0faadb0 100644 --- a/scene/3d/area.cpp +++ b/scene/3d/area.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -576,63 +576,63 @@ bool Area::get_layer_mask_bit(int p_bit) const{ void Area::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_body_enter_tree","id"),&Area::_body_enter_tree); - ObjectTypeDB::bind_method(_MD("_body_exit_tree","id"),&Area::_body_exit_tree); + ClassDB::bind_method(_MD("_body_enter_tree","id"),&Area::_body_enter_tree); + ClassDB::bind_method(_MD("_body_exit_tree","id"),&Area::_body_exit_tree); - ObjectTypeDB::bind_method(_MD("_area_enter_tree","id"),&Area::_area_enter_tree); - ObjectTypeDB::bind_method(_MD("_area_exit_tree","id"),&Area::_area_exit_tree); + ClassDB::bind_method(_MD("_area_enter_tree","id"),&Area::_area_enter_tree); + ClassDB::bind_method(_MD("_area_exit_tree","id"),&Area::_area_exit_tree); - ObjectTypeDB::bind_method(_MD("set_space_override_mode","enable"),&Area::set_space_override_mode); - ObjectTypeDB::bind_method(_MD("get_space_override_mode"),&Area::get_space_override_mode); + ClassDB::bind_method(_MD("set_space_override_mode","enable"),&Area::set_space_override_mode); + ClassDB::bind_method(_MD("get_space_override_mode"),&Area::get_space_override_mode); - ObjectTypeDB::bind_method(_MD("set_gravity_is_point","enable"),&Area::set_gravity_is_point); - ObjectTypeDB::bind_method(_MD("is_gravity_a_point"),&Area::is_gravity_a_point); + ClassDB::bind_method(_MD("set_gravity_is_point","enable"),&Area::set_gravity_is_point); + ClassDB::bind_method(_MD("is_gravity_a_point"),&Area::is_gravity_a_point); - ObjectTypeDB::bind_method(_MD("set_gravity_distance_scale","distance_scale"),&Area::set_gravity_distance_scale); - ObjectTypeDB::bind_method(_MD("get_gravity_distance_scale"),&Area::get_gravity_distance_scale); + ClassDB::bind_method(_MD("set_gravity_distance_scale","distance_scale"),&Area::set_gravity_distance_scale); + ClassDB::bind_method(_MD("get_gravity_distance_scale"),&Area::get_gravity_distance_scale); - ObjectTypeDB::bind_method(_MD("set_gravity_vector","vector"),&Area::set_gravity_vector); - ObjectTypeDB::bind_method(_MD("get_gravity_vector"),&Area::get_gravity_vector); + ClassDB::bind_method(_MD("set_gravity_vector","vector"),&Area::set_gravity_vector); + ClassDB::bind_method(_MD("get_gravity_vector"),&Area::get_gravity_vector); - ObjectTypeDB::bind_method(_MD("set_gravity","gravity"),&Area::set_gravity); - ObjectTypeDB::bind_method(_MD("get_gravity"),&Area::get_gravity); + ClassDB::bind_method(_MD("set_gravity","gravity"),&Area::set_gravity); + ClassDB::bind_method(_MD("get_gravity"),&Area::get_gravity); - ObjectTypeDB::bind_method(_MD("set_angular_damp","angular_damp"),&Area::set_angular_damp); - ObjectTypeDB::bind_method(_MD("get_angular_damp"),&Area::get_angular_damp); + ClassDB::bind_method(_MD("set_angular_damp","angular_damp"),&Area::set_angular_damp); + ClassDB::bind_method(_MD("get_angular_damp"),&Area::get_angular_damp); - ObjectTypeDB::bind_method(_MD("set_linear_damp","linear_damp"),&Area::set_linear_damp); - ObjectTypeDB::bind_method(_MD("get_linear_damp"),&Area::get_linear_damp); + ClassDB::bind_method(_MD("set_linear_damp","linear_damp"),&Area::set_linear_damp); + ClassDB::bind_method(_MD("get_linear_damp"),&Area::get_linear_damp); - ObjectTypeDB::bind_method(_MD("set_priority","priority"),&Area::set_priority); - ObjectTypeDB::bind_method(_MD("get_priority"),&Area::get_priority); + ClassDB::bind_method(_MD("set_priority","priority"),&Area::set_priority); + ClassDB::bind_method(_MD("get_priority"),&Area::get_priority); - ObjectTypeDB::bind_method(_MD("set_collision_mask","collision_mask"),&Area::set_collision_mask); - ObjectTypeDB::bind_method(_MD("get_collision_mask"),&Area::get_collision_mask); + ClassDB::bind_method(_MD("set_collision_mask","collision_mask"),&Area::set_collision_mask); + ClassDB::bind_method(_MD("get_collision_mask"),&Area::get_collision_mask); - ObjectTypeDB::bind_method(_MD("set_layer_mask","layer_mask"),&Area::set_layer_mask); - ObjectTypeDB::bind_method(_MD("get_layer_mask"),&Area::get_layer_mask); + ClassDB::bind_method(_MD("set_layer_mask","layer_mask"),&Area::set_layer_mask); + ClassDB::bind_method(_MD("get_layer_mask"),&Area::get_layer_mask); - ObjectTypeDB::bind_method(_MD("set_collision_mask_bit","bit","value"),&Area::set_collision_mask_bit); - ObjectTypeDB::bind_method(_MD("get_collision_mask_bit","bit"),&Area::get_collision_mask_bit); + ClassDB::bind_method(_MD("set_collision_mask_bit","bit","value"),&Area::set_collision_mask_bit); + ClassDB::bind_method(_MD("get_collision_mask_bit","bit"),&Area::get_collision_mask_bit); - ObjectTypeDB::bind_method(_MD("set_layer_mask_bit","bit","value"),&Area::set_layer_mask_bit); - ObjectTypeDB::bind_method(_MD("get_layer_mask_bit","bit"),&Area::get_layer_mask_bit); + ClassDB::bind_method(_MD("set_layer_mask_bit","bit","value"),&Area::set_layer_mask_bit); + ClassDB::bind_method(_MD("get_layer_mask_bit","bit"),&Area::get_layer_mask_bit); - ObjectTypeDB::bind_method(_MD("set_monitorable","enable"),&Area::set_monitorable); - ObjectTypeDB::bind_method(_MD("is_monitorable"),&Area::is_monitorable); + ClassDB::bind_method(_MD("set_monitorable","enable"),&Area::set_monitorable); + ClassDB::bind_method(_MD("is_monitorable"),&Area::is_monitorable); - ObjectTypeDB::bind_method(_MD("set_enable_monitoring","enable"),&Area::set_enable_monitoring); - ObjectTypeDB::bind_method(_MD("is_monitoring_enabled"),&Area::is_monitoring_enabled); + ClassDB::bind_method(_MD("set_enable_monitoring","enable"),&Area::set_enable_monitoring); + ClassDB::bind_method(_MD("is_monitoring_enabled"),&Area::is_monitoring_enabled); - ObjectTypeDB::bind_method(_MD("get_overlapping_bodies"),&Area::get_overlapping_bodies); - ObjectTypeDB::bind_method(_MD("get_overlapping_areas"),&Area::get_overlapping_areas); + ClassDB::bind_method(_MD("get_overlapping_bodies"),&Area::get_overlapping_bodies); + ClassDB::bind_method(_MD("get_overlapping_areas"),&Area::get_overlapping_areas); - ObjectTypeDB::bind_method(_MD("overlaps_body","body"),&Area::overlaps_body); - ObjectTypeDB::bind_method(_MD("overlaps_area","area"),&Area::overlaps_area); + ClassDB::bind_method(_MD("overlaps_body","body"),&Area::overlaps_body); + ClassDB::bind_method(_MD("overlaps_area","area"),&Area::overlaps_area); - ObjectTypeDB::bind_method(_MD("_body_inout"),&Area::_body_inout); - ObjectTypeDB::bind_method(_MD("_area_inout"),&Area::_area_inout); + ClassDB::bind_method(_MD("_body_inout"),&Area::_body_inout); + ClassDB::bind_method(_MD("_area_inout"),&Area::_area_inout); ADD_SIGNAL( MethodInfo("body_enter_shape",PropertyInfo(Variant::INT,"body_id"),PropertyInfo(Variant::OBJECT,"body"),PropertyInfo(Variant::INT,"body_shape"),PropertyInfo(Variant::INT,"area_shape"))); @@ -655,8 +655,9 @@ void Area::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::INT,"priority",PROPERTY_HINT_RANGE,"0,128,1"),_SCS("set_priority"),_SCS("get_priority")); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"monitoring"),_SCS("set_enable_monitoring"),_SCS("is_monitoring_enabled")); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"monitorable"),_SCS("set_monitorable"),_SCS("is_monitorable")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"collision/layers",PROPERTY_HINT_ALL_FLAGS),_SCS("set_layer_mask"),_SCS("get_layer_mask")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"collision/mask",PROPERTY_HINT_ALL_FLAGS),_SCS("set_collision_mask"),_SCS("get_collision_mask")); + ADD_GROUP("Collision","collision_"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"collision_layers",PROPERTY_HINT_LAYERS_3D_PHYSICS),_SCS("set_layer_mask"),_SCS("get_layer_mask")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"collision_mask",PROPERTY_HINT_LAYERS_3D_PHYSICS),_SCS("set_collision_mask"),_SCS("get_collision_mask")); } diff --git a/scene/3d/area.h b/scene/3d/area.h index 440a7d2030..3260bad0a4 100644 --- a/scene/3d/area.h +++ b/scene/3d/area.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class Area : public CollisionObject { - OBJ_TYPE( Area, CollisionObject ); + GDCLASS( Area, CollisionObject ); public: enum SpaceOverride { diff --git a/scene/3d/baked_light_instance.cpp b/scene/3d/baked_light_instance.cpp index ca3a309568..59d8d7ecac 100644 --- a/scene/3d/baked_light_instance.cpp +++ b/scene/3d/baked_light_instance.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -28,82 +28,1741 @@ /*************************************************************************/ #include "baked_light_instance.h" #include "scene/scene_string_names.h" +#include "mesh_instance.h" +#include "light.h" +#include "math.h" +#define FINDMINMAX(x0,x1,x2,min,max) \ + min = max = x0; \ + if(x1<min) min=x1;\ + if(x1>max) max=x1;\ + if(x2<min) min=x2;\ + if(x2>max) max=x2; -RID BakedLightInstance::get_baked_light_instance() const { +static bool planeBoxOverlap(Vector3 normal,float d, Vector3 maxbox) +{ + int q; + Vector3 vmin,vmax; + for(q=0;q<=2;q++) + { + if(normal[q]>0.0f) + { + vmin[q]=-maxbox[q]; + vmax[q]=maxbox[q]; + } + else + { + vmin[q]=maxbox[q]; + vmax[q]=-maxbox[q]; + } + } + if(normal.dot(vmin)+d>0.0f) return false; + if(normal.dot(vmax)+d>=0.0f) return true; - if (baked_light.is_null()) - return RID(); - else - return get_instance(); + return false; +} + + +/*======================== X-tests ========================*/ +#define AXISTEST_X01(a, b, fa, fb) \ + p0 = a*v0.y - b*v0.z; \ + p2 = a*v2.y - b*v2.z; \ + if(p0<p2) {min=p0; max=p2;} else {min=p2; max=p0;} \ + rad = fa * boxhalfsize.y + fb * boxhalfsize.z; \ + if(min>rad || max<-rad) return false; + +#define AXISTEST_X2(a, b, fa, fb) \ + p0 = a*v0.y - b*v0.z; \ + p1 = a*v1.y - b*v1.z; \ + if(p0<p1) {min=p0; max=p1;} else {min=p1; max=p0;} \ + rad = fa * boxhalfsize.y + fb * boxhalfsize.z; \ + if(min>rad || max<-rad) return false; + +/*======================== Y-tests ========================*/ +#define AXISTEST_Y02(a, b, fa, fb) \ + p0 = -a*v0.x + b*v0.z; \ + p2 = -a*v2.x + b*v2.z; \ + if(p0<p2) {min=p0; max=p2;} else {min=p2; max=p0;} \ + rad = fa * boxhalfsize.x + fb * boxhalfsize.z; \ + if(min>rad || max<-rad) return false; + +#define AXISTEST_Y1(a, b, fa, fb) \ + p0 = -a*v0.x + b*v0.z; \ + p1 = -a*v1.x + b*v1.z; \ + if(p0<p1) {min=p0; max=p1;} else {min=p1; max=p0;} \ + rad = fa * boxhalfsize.x + fb * boxhalfsize.z; \ + if(min>rad || max<-rad) return false; + +/*======================== Z-tests ========================*/ + +#define AXISTEST_Z12(a, b, fa, fb) \ + p1 = a*v1.x - b*v1.y; \ + p2 = a*v2.x - b*v2.y; \ + if(p2<p1) {min=p2; max=p1;} else {min=p1; max=p2;} \ + rad = fa * boxhalfsize.x + fb * boxhalfsize.y; \ + if(min>rad || max<-rad) return false; + +#define AXISTEST_Z0(a, b, fa, fb) \ + p0 = a*v0.x - b*v0.y; \ + p1 = a*v1.x - b*v1.y; \ + if(p0<p1) {min=p0; max=p1;} else {min=p1; max=p0;} \ + rad = fa * boxhalfsize.x + fb * boxhalfsize.y; \ + if(min>rad || max<-rad) return false; + +static bool fast_tri_box_overlap(const Vector3& boxcenter,const Vector3 boxhalfsize,const Vector3 *triverts) { + + /* use separating axis theorem to test overlap between triangle and box */ + /* need to test for overlap in these directions: */ + /* 1) the {x,y,z}-directions (actually, since we use the AABB of the triangle */ + /* we do not even need to test these) */ + /* 2) normal of the triangle */ + /* 3) crossproduct(edge from tri, {x,y,z}-directin) */ + /* this gives 3x3=9 more tests */ + Vector3 v0,v1,v2; + float min,max,d,p0,p1,p2,rad,fex,fey,fez; + Vector3 normal,e0,e1,e2; + + /* This is the fastest branch on Sun */ + /* move everything so that the boxcenter is in (0,0,0) */ + + v0=triverts[0]-boxcenter; + v1=triverts[1]-boxcenter; + v2=triverts[2]-boxcenter; + + /* compute triangle edges */ + e0=v1-v0; /* tri edge 0 */ + e1=v2-v1; /* tri edge 1 */ + e2=v0-v2; /* tri edge 2 */ + + /* Bullet 3: */ + /* test the 9 tests first (this was faster) */ + fex = Math::abs(e0.x); + fey = Math::abs(e0.y); + fez = Math::abs(e0.z); + AXISTEST_X01(e0.z, e0.y, fez, fey); + AXISTEST_Y02(e0.z, e0.x, fez, fex); + AXISTEST_Z12(e0.y, e0.x, fey, fex); + + fex = Math::abs(e1.x); + fey = Math::abs(e1.y); + fez = Math::abs(e1.z); + AXISTEST_X01(e1.z, e1.y, fez, fey); + AXISTEST_Y02(e1.z, e1.x, fez, fex); + AXISTEST_Z0(e1.y, e1.x, fey, fex); + + fex = Math::abs(e2.x); + fey = Math::abs(e2.y); + fez = Math::abs(e2.z); + AXISTEST_X2(e2.z, e2.y, fez, fey); + AXISTEST_Y1(e2.z, e2.x, fez, fex); + AXISTEST_Z12(e2.y, e2.x, fey, fex); + /* Bullet 1: */ + /* first test overlap in the {x,y,z}-directions */ + /* find min, max of the triangle each direction, and test for overlap in */ + /* that direction -- this is equivalent to testing a minimal AABB around */ + /* the triangle against the AABB */ + + /* test in X-direction */ + FINDMINMAX(v0.x,v1.x,v2.x,min,max); + if(min>boxhalfsize.x || max<-boxhalfsize.x) return false; + + /* test in Y-direction */ + FINDMINMAX(v0.y,v1.y,v2.y,min,max); + if(min>boxhalfsize.y || max<-boxhalfsize.y) return false; + + /* test in Z-direction */ + FINDMINMAX(v0.z,v1.z,v2.z,min,max); + if(min>boxhalfsize.z || max<-boxhalfsize.z) return false; + + /* Bullet 2: */ + /* test if the box intersects the plane of the triangle */ + /* compute plane equation of triangle: normal*x+d=0 */ + normal=e0.cross(e1); + d=-normal.dot(v0); /* plane eq: normal.x+d=0 */ + if(!planeBoxOverlap(normal,d,boxhalfsize)) return false; + + return true; /* box and triangle overlaps */ } -void BakedLightInstance::set_baked_light(const Ref<BakedLight>& p_baked_light) { - baked_light=p_baked_light; +Vector<Color> BakedLight::_get_bake_texture(Image &p_image,const Color& p_color) { - RID base_rid; + Vector<Color> ret; + + if (p_image.empty()) { + + ret.resize(bake_texture_size*bake_texture_size); + for(int i=0;i<bake_texture_size*bake_texture_size;i++) { + ret[i]=p_color; + } + + return ret; + } - if (baked_light.is_valid()) - base_rid=baked_light->get_rid(); - else - base_rid=RID(); + p_image.convert(Image::FORMAT_RGBA8); + p_image.resize(bake_texture_size,bake_texture_size,Image::INTERPOLATE_CUBIC); - set_base(base_rid); - if (is_inside_world()) { + PoolVector<uint8_t>::Read r = p_image.get_data().read(); + ret.resize(bake_texture_size*bake_texture_size); - emit_signal(SceneStringNames::get_singleton()->baked_light_changed); + for(int i=0;i<bake_texture_size*bake_texture_size;i++) { + Color c; + c.r = r[i*4+0]/255.0; + c.g = r[i*4+1]/255.0; + c.b = r[i*4+2]/255.0; + c.a = r[i*4+3]/255.0; + ret[i]=c; -// for (List<Node*>::Element *E=baked_geometry.front();E;E=E->next()) { -// VS::get_singleton()->instance_geometry_set_baked_light(E->get()->get_instance(),baked_light.is_valid()?get_instance():RID()); -// } } - update_configuration_warning(); + return ret; } -Ref<BakedLight> BakedLightInstance::get_baked_light() const{ - return baked_light; +BakedLight::MaterialCache BakedLight::_get_material_cache(Ref<Material> p_material) { + + //this way of obtaining materials is inaccurate and also does not support some compressed formats very well + Ref<FixedSpatialMaterial> mat = p_material; + + Ref<Material> material = mat; //hack for now + + if (material_cache.has(material)) { + return material_cache[material]; + } + + MaterialCache mc; + + if (mat.is_valid()) { + + + Ref<ImageTexture> albedo_tex = mat->get_texture(FixedSpatialMaterial::TEXTURE_ALBEDO); + + Image img_albedo; + if (albedo_tex.is_valid()) { + + img_albedo = albedo_tex->get_data(); + } + + mc.albedo=_get_bake_texture(img_albedo,mat->get_albedo()); + + Ref<ImageTexture> emission_tex = mat->get_texture(FixedSpatialMaterial::TEXTURE_EMISSION); + + Color emission_col = mat->get_emission(); + emission_col.r*=mat->get_emission_energy(); + emission_col.g*=mat->get_emission_energy(); + emission_col.b*=mat->get_emission_energy(); + + Image img_emission; + + if (emission_tex.is_valid()) { + + img_emission = emission_tex->get_data(); + } + + mc.emission=_get_bake_texture(img_emission,emission_col); + + } else { + Image empty; + + mc.albedo=_get_bake_texture(empty,Color(0.7,0.7,0.7)); + mc.emission=_get_bake_texture(empty,Color(0,0,0)); + + + } + + material_cache[p_material]=mc; + return mc; + + } -AABB BakedLightInstance::get_aabb() const { - return AABB(Vector3(0,0,0),Vector3(1,1,1)); + +static _FORCE_INLINE_ Vector2 get_uv(const Vector3& p_pos, const Vector3 *p_vtx, const Vector2* p_uv) { + + if (p_pos.distance_squared_to(p_vtx[0])<CMP_EPSILON2) + return p_uv[0]; + if (p_pos.distance_squared_to(p_vtx[1])<CMP_EPSILON2) + return p_uv[1]; + if (p_pos.distance_squared_to(p_vtx[2])<CMP_EPSILON2) + return p_uv[2]; + + Vector3 v0 = p_vtx[1] - p_vtx[0]; + Vector3 v1 = p_vtx[2] - p_vtx[0]; + Vector3 v2 = p_pos - p_vtx[0]; + + float d00 = v0.dot( v0); + float d01 = v0.dot( v1); + float d11 = v1.dot( v1); + float d20 = v2.dot( v0); + float d21 = v2.dot( v1); + float denom = (d00 * d11 - d01 * d01); + if (denom==0) + return p_uv[0]; + float v = (d11 * d20 - d01 * d21) / denom; + float w = (d00 * d21 - d01 * d20) / denom; + float u = 1.0f - v - w; + + return p_uv[0]*u + p_uv[1]*v + p_uv[2]*w; } -DVector<Face3> BakedLightInstance::get_faces(uint32_t p_usage_flags) const { - return DVector<Face3>(); +void BakedLight::_plot_face(int p_idx, int p_level, const Vector3 *p_vtx, const Vector2* p_uv, const MaterialCache& p_material, const Rect3 &p_aabb) { + + + + if (p_level==cell_subdiv-1) { + //plot the face by guessing it's albedo and emission value + + //find best axis to map to, for scanning values + int closest_axis; + float closest_dot; + + Vector3 normal = Plane(p_vtx[0],p_vtx[1],p_vtx[2]).normal; + + for(int i=0;i<3;i++) { + + Vector3 axis; + axis[i]=1.0; + float dot=ABS(normal.dot(axis)); + if (i==0 || dot>closest_dot) { + closest_axis=i; + closest_dot=dot; + } + } + + Vector3 axis; + axis[closest_axis]=1.0; + Vector3 t1; + t1[(closest_axis+1)%3]=1.0; + Vector3 t2; + t2[(closest_axis+2)%3]=1.0; + + t1*=p_aabb.size[(closest_axis+1)%3]/float(color_scan_cell_width); + t2*=p_aabb.size[(closest_axis+2)%3]/float(color_scan_cell_width); + + Color albedo_accum; + Color emission_accum; + float alpha=0.0; + + //map to a grid average in the best axis for this face + for(int i=0;i<color_scan_cell_width;i++) { + + Vector3 ofs_i=float(i)*t1; + + for(int j=0;j<color_scan_cell_width;j++) { + + Vector3 ofs_j=float(j)*t2; + + Vector3 from = p_aabb.pos+ofs_i+ofs_j; + Vector3 to = from + t1 + t2 + axis * p_aabb.size[closest_axis]; + Vector3 half = (to-from)*0.5; + + //is in this cell? + if (!fast_tri_box_overlap(from+half,half,p_vtx)) { + continue; //face does not span this cell + } + + //go from -size to +size*2 to avoid skipping collisions + Vector3 ray_from = from + (t1+t2)*0.5 - axis * p_aabb.size[closest_axis]; + Vector3 ray_to = ray_from + axis * p_aabb.size[closest_axis]*2; + + Vector3 intersection; + + if (!Geometry::ray_intersects_triangle(ray_from,ray_to,p_vtx[0],p_vtx[1],p_vtx[2],&intersection)) { + //no intersect? look in edges + + float closest_dist=1e20; + for(int j=0;j<3;j++) { + Vector3 c; + Vector3 inters; + Geometry::get_closest_points_between_segments(p_vtx[j],p_vtx[(j+1)%3],ray_from,ray_to,inters,c); + float d=c.distance_to(intersection); + if (j==0 || d<closest_dist) { + closest_dist=d; + intersection=inters; + } + } + } + + Vector2 uv = get_uv(intersection,p_vtx,p_uv); + + + int uv_x = CLAMP(Math::fposmod(uv.x,1.0)*bake_texture_size,0,bake_texture_size-1); + int uv_y = CLAMP(Math::fposmod(uv.y,1.0)*bake_texture_size,0,bake_texture_size-1); + + int ofs = uv_y*bake_texture_size+uv_x; + albedo_accum.r+=p_material.albedo[ofs].r; + albedo_accum.g+=p_material.albedo[ofs].g; + albedo_accum.b+=p_material.albedo[ofs].b; + albedo_accum.a+=p_material.albedo[ofs].a; + + emission_accum.r+=p_material.emission[ofs].r; + emission_accum.g+=p_material.emission[ofs].g; + emission_accum.b+=p_material.emission[ofs].b; + alpha+=1.0; + + } + } + + + if (alpha==0) { + //could not in any way get texture information.. so use closest point to center + + Face3 f( p_vtx[0],p_vtx[1],p_vtx[2]); + Vector3 inters = f.get_closest_point_to(p_aabb.pos+p_aabb.size*0.5); + + Vector2 uv = get_uv(inters,p_vtx,p_uv); + + int uv_x = CLAMP(Math::fposmod(uv.x,1.0)*bake_texture_size,0,bake_texture_size-1); + int uv_y = CLAMP(Math::fposmod(uv.y,1.0)*bake_texture_size,0,bake_texture_size-1); + + int ofs = uv_y*bake_texture_size+uv_x; + + alpha = 1.0/(color_scan_cell_width*color_scan_cell_width); + + albedo_accum.r=p_material.albedo[ofs].r*alpha; + albedo_accum.g=p_material.albedo[ofs].g*alpha; + albedo_accum.b=p_material.albedo[ofs].b*alpha; + albedo_accum.a=p_material.albedo[ofs].a*alpha; + + emission_accum.r=p_material.emission[ofs].r*alpha; + emission_accum.g=p_material.emission[ofs].g*alpha; + emission_accum.b=p_material.emission[ofs].b*alpha; + + + zero_alphas++; + } else { + + float accdiv = 1.0/(color_scan_cell_width*color_scan_cell_width); + alpha*=accdiv; + + albedo_accum.r*=accdiv; + albedo_accum.g*=accdiv; + albedo_accum.b*=accdiv; + albedo_accum.a*=accdiv; + + emission_accum.r*=accdiv; + emission_accum.g*=accdiv; + emission_accum.b*=accdiv; + } + + //put this temporarily here, corrected in a later step + bake_cells_write[p_idx].albedo[0]+=albedo_accum.r; + bake_cells_write[p_idx].albedo[1]+=albedo_accum.g; + bake_cells_write[p_idx].albedo[2]+=albedo_accum.b; + bake_cells_write[p_idx].light[0]+=emission_accum.r; + bake_cells_write[p_idx].light[1]+=emission_accum.g; + bake_cells_write[p_idx].light[2]+=emission_accum.b; + bake_cells_write[p_idx].alpha+=alpha; + + static const Vector3 side_normals[6]={ + Vector3(-1, 0, 0), + Vector3( 1, 0, 0), + Vector3( 0,-1, 0), + Vector3( 0, 1, 0), + Vector3( 0, 0,-1), + Vector3( 0, 0, 1), + }; + + for(int i=0;i<6;i++) { + if (normal.dot(side_normals[i])>CMP_EPSILON) { + bake_cells_write[p_idx].used_sides|=(1<<i); + } + } + + + } else { + //go down + for(int i=0;i<8;i++) { + + Rect3 aabb=p_aabb; + aabb.size*=0.5; + + if (i&1) + aabb.pos.x+=aabb.size.x; + if (i&2) + aabb.pos.y+=aabb.size.y; + if (i&4) + aabb.pos.z+=aabb.size.z; + + { + Rect3 test_aabb=aabb; + //test_aabb.grow_by(test_aabb.get_longest_axis_size()*0.05); //grow a bit to avoid numerical error in real-time + Vector3 qsize = test_aabb.size*0.5; //quarter size, for fast aabb test + + if (!fast_tri_box_overlap(test_aabb.pos+qsize,qsize,p_vtx)) { + //if (!Face3(p_vtx[0],p_vtx[1],p_vtx[2]).intersects_aabb2(aabb)) { + //does not fit in child, go on + continue; + } + + } + + if (bake_cells_write[p_idx].childs[i]==CHILD_EMPTY) { + //sub cell must be created + + if (bake_cells_used==(1<<bake_cells_alloc)) { + //exhausted cells, creating more space + bake_cells_alloc++; + bake_cells_write=PoolVector<BakeCell>::Write(); + bake_cells.resize(1<<bake_cells_alloc); + bake_cells_write=bake_cells.write(); + } + + bake_cells_write[p_idx].childs[i]=bake_cells_used; + bake_cells_level_used[p_level+1]++; + bake_cells_used++; + + + } + + + _plot_face(bake_cells_write[p_idx].childs[i],p_level+1,p_vtx,p_uv,p_material,aabb); + } + } +} + + + +void BakedLight::_fixup_plot(int p_idx, int p_level,int p_x,int p_y, int p_z) { + + + + if (p_level==cell_subdiv-1) { + + + float alpha = bake_cells_write[p_idx].alpha; + + bake_cells_write[p_idx].albedo[0]/=alpha; + bake_cells_write[p_idx].albedo[1]/=alpha; + bake_cells_write[p_idx].albedo[2]/=alpha; + + //transfer emission to light + bake_cells_write[p_idx].light[0]/=alpha; + bake_cells_write[p_idx].light[1]/=alpha; + bake_cells_write[p_idx].light[2]/=alpha; + + bake_cells_write[p_idx].alpha=1.0; + + //remove neighbours from used sides + + for(int n=0;n<6;n++) { + + int ofs[3]={0,0,0}; + + ofs[n/2]=(n&1)?1:-1; + + //convert to x,y,z on this level + int x=p_x; + int y=p_y; + int z=p_z; + + x+=ofs[0]; + y+=ofs[1]; + z+=ofs[2]; + + int ofs_x=0; + int ofs_y=0; + int ofs_z=0; + int size = 1<<p_level; + int half=size/2; + + + if (x<0 || x>=size || y<0 || y>=size || z<0 || z>=size) { + //neighbour is out, can't use it + bake_cells_write[p_idx].used_sides&=~(1<<uint32_t(n)); + continue; + } + + uint32_t neighbour=0; + + for(int i=0;i<cell_subdiv-1;i++) { + + BakeCell *bc = &bake_cells_write[neighbour]; + + int child = 0; + if (x >= ofs_x + half) { + child|=1; + ofs_x+=half; + } + if (y >= ofs_y + half) { + child|=2; + ofs_y+=half; + } + if (z >= ofs_z + half) { + child|=4; + ofs_z+=half; + } + + neighbour = bc->childs[child]; + if (neighbour==CHILD_EMPTY) { + break; + } + + half>>=1; + } + + if (neighbour!=CHILD_EMPTY) { + bake_cells_write[p_idx].used_sides&=~(1<<uint32_t(n)); + } + } + } else { + + + //go down + + float alpha_average=0; + int half = cells_per_axis >> (p_level+1); + for(int i=0;i<8;i++) { + + uint32_t child = bake_cells_write[p_idx].childs[i]; + + if (child==CHILD_EMPTY) + continue; + + + int nx=p_x; + int ny=p_y; + int nz=p_z; + + if (i&1) + nx+=half; + if (i&2) + ny+=half; + if (i&4) + nz+=half; + + _fixup_plot(child,p_level+1,nx,ny,nz); + alpha_average+=bake_cells_write[child].alpha; + } + + bake_cells_write[p_idx].alpha=alpha_average/8.0; + bake_cells_write[p_idx].light[0]=0; + bake_cells_write[p_idx].light[1]=0; + bake_cells_write[p_idx].light[2]=0; + bake_cells_write[p_idx].albedo[0]=0; + bake_cells_write[p_idx].albedo[1]=0; + bake_cells_write[p_idx].albedo[2]=0; + + } + + //clean up light + bake_cells_write[p_idx].light_pass=0; + //find neighbours + + + } -String BakedLightInstance::get_configuration_warning() const { - if (get_baked_light().is_null()) { - return TTR("BakedLightInstance does not contain a BakedLight resource."); +void BakedLight::_bake_add_mesh(const Transform& p_xform,Ref<Mesh>& p_mesh) { + + + for(int i=0;i<p_mesh->get_surface_count();i++) { + + if (p_mesh->surface_get_primitive_type(i)!=Mesh::PRIMITIVE_TRIANGLES) + continue; //only triangles + + MaterialCache material = _get_material_cache(p_mesh->surface_get_material(i)); + + Array a = p_mesh->surface_get_arrays(i); + + + PoolVector<Vector3> vertices = a[Mesh::ARRAY_VERTEX]; + PoolVector<Vector3>::Read vr=vertices.read(); + PoolVector<Vector2> uv = a[Mesh::ARRAY_TEX_UV]; + PoolVector<Vector2>::Read uvr; + PoolVector<int> index = a[Mesh::ARRAY_INDEX]; + + bool read_uv=false; + + if (uv.size()) { + + uvr=uv.read(); + read_uv=true; + } + + if (index.size()) { + + int facecount = index.size()/3; + PoolVector<int>::Read ir=index.read(); + + for(int j=0;j<facecount;j++) { + + Vector3 vtxs[3]; + Vector2 uvs[3]; + + for(int k=0;k<3;k++) { + vtxs[k]=p_xform.xform(vr[ir[j*3+k]]); + } + + if (read_uv) { + for(int k=0;k<3;k++) { + uvs[k]=uvr[ir[j*3+k]]; + } + } + + //plot face + _plot_face(0,0,vtxs,uvs,material,bounds); + } + + + + } else { + + int facecount = vertices.size()/3; + + for(int j=0;j<facecount;j++) { + + Vector3 vtxs[3]; + Vector2 uvs[3]; + + for(int k=0;k<3;k++) { + vtxs[k]=p_xform.xform(vr[j*3+k]); + } + + if (read_uv) { + for(int k=0;k<3;k++) { + uvs[k]=uvr[j*3+k]; + } + } + + //plot face + _plot_face(0,0,vtxs,uvs,material,bounds); + } + + } + } +} + + + +void BakedLight::_bake_add_to_aabb(const Transform& p_xform,Ref<Mesh>& p_mesh,bool &first) { + + for(int i=0;i<p_mesh->get_surface_count();i++) { + + if (p_mesh->surface_get_primitive_type(i)!=Mesh::PRIMITIVE_TRIANGLES) + continue; //only triangles + + Array a = p_mesh->surface_get_arrays(i); + PoolVector<Vector3> vertices = a[Mesh::ARRAY_VERTEX]; + int vc = vertices.size(); + PoolVector<Vector3>::Read vr=vertices.read(); + + if (first) { + bounds.pos=p_xform.xform(vr[0]); + first=false; + } + + + for(int j=0;j<vc;j++) { + bounds.expand_to(p_xform.xform(vr[j])); + } + } +} + +void BakedLight::bake() { + + + bake_cells_alloc=16; + bake_cells.resize(1<<bake_cells_alloc); + bake_cells_used=1; + cells_per_axis=(1<<(cell_subdiv-1)); + zero_alphas=0; + + bool aabb_first=true; + print_line("Generating AABB"); + + bake_cells_level_used.resize(cell_subdiv); + for(int i=0;i<cell_subdiv;i++) { + bake_cells_level_used[i]=0; + } + + int count=0; + for (Set<GeometryInstance*>::Element *E=geometries.front();E;E=E->next()) { + + print_line("aabb geom "+itos(count)+"/"+itos(geometries.size())); + + GeometryInstance *geom = E->get(); + + if (geom->cast_to<MeshInstance>()) { + + MeshInstance *mesh_instance = geom->cast_to<MeshInstance>(); + Ref<Mesh> mesh = mesh_instance->get_mesh(); + if (mesh.is_valid()) { + + _bake_add_to_aabb(geom->get_relative_transform(this),mesh,aabb_first); + } + } + count++; + } + + print_line("AABB: "+bounds); + ERR_FAIL_COND(aabb_first); + + bake_cells_write = bake_cells.write(); + count=0; + + for (Set<GeometryInstance*>::Element *E=geometries.front();E;E=E->next()) { + + GeometryInstance *geom = E->get(); + print_line("plot geom "+itos(count)+"/"+itos(geometries.size())); + + if (geom->cast_to<MeshInstance>()) { + + MeshInstance *mesh_instance = geom->cast_to<MeshInstance>(); + Ref<Mesh> mesh = mesh_instance->get_mesh(); + if (mesh.is_valid()) { + + _bake_add_mesh(geom->get_relative_transform(this),mesh); + } + } + + count++; + } + + + _fixup_plot(0, 0,0,0,0); + + + bake_cells_write=PoolVector<BakeCell>::Write(); + + bake_cells.resize(bake_cells_used); + + + + print_line("total bake cells used: "+itos(bake_cells_used)); + for(int i=0;i<cell_subdiv;i++) { + print_line("level "+itos(i)+": "+itos(bake_cells_level_used[i])); + } + print_line("zero alphas: "+itos(zero_alphas)); + + + +} + + + +void BakedLight::_bake_directional(int p_idx, int p_level, int p_x,int p_y,int p_z,const Vector3& p_dir,const Color& p_color,int p_sign) { + + + + + if (p_level==cell_subdiv-1) { + + Vector3 end; + end.x = float(p_x+0.5) / cells_per_axis; + end.y = float(p_y+0.5) / cells_per_axis; + end.z = float(p_z+0.5) / cells_per_axis; + + end = bounds.pos + bounds.size*end; + + float max_ray_len = (bounds.size).length()*1.2; + + Vector3 begin = end + max_ray_len*-p_dir; + + //clip begin + + for(int i=0;i<3;i++) { + + if (ABS(p_dir[i])<CMP_EPSILON) { + continue; // parallel to axis, don't clip + } + + Plane p; + p.normal[i]=1.0; + p.d=bounds.pos[i]; + if (p_dir[i]<0) { + p.d+=bounds.size[i]; + } + + Vector3 inters; + if (p.intersects_segment(end,begin,&inters)) { + begin=inters; + } + + } + + + int idx = _plot_ray(begin,end); + + if (idx>=0 && light_pass!=bake_cells_write[idx].light_pass) { + //hit something, add or remove light to it + + Color albedo = Color(bake_cells_write[idx].albedo[0],bake_cells_write[idx].albedo[1],bake_cells_write[idx].albedo[2]); + bake_cells_write[idx].light[0]+=albedo.r*p_color.r*p_sign; + bake_cells_write[idx].light[1]+=albedo.g*p_color.g*p_sign; + bake_cells_write[idx].light[2]+=albedo.b*p_color.b*p_sign; + bake_cells_write[idx].light_pass=light_pass; + + } + + + } else { + + int half = cells_per_axis >> (p_level+1); + + //go down + for(int i=0;i<8;i++) { + + uint32_t child = bake_cells_write[p_idx].childs[i]; + + if (child==CHILD_EMPTY) + continue; + + int nx=p_x; + int ny=p_y; + int nz=p_z; + + if (i&1) + nx+=half; + if (i&2) + ny+=half; + if (i&4) + nz+=half; + + + _bake_directional(child,p_level+1,nx,ny,nz,p_dir,p_color,p_sign); + } } +} + + + + +void BakedLight::_bake_light(Light* p_light) { + + if (p_light->cast_to<DirectionalLight>()) { + + DirectionalLight * dl = p_light->cast_to<DirectionalLight>(); + + Transform rel_xf = dl->get_relative_transform(this); + + Vector3 light_dir = -rel_xf.basis.get_axis(2); + + Color color = dl->get_color(); + float nrg = dl->get_param(Light::PARAM_ENERGY);; + color.r*=nrg; + color.g*=nrg; + color.b*=nrg; + + light_pass++; + _bake_directional(0,0,0,0,0,light_dir,color,1); + + } +} + + +void BakedLight::_upscale_light(int p_idx,int p_level) { + + + //go down + + float light_accum[3]={0,0,0}; + float alpha_accum=0; + + bool check_children = p_level < (cell_subdiv -2); + + for(int i=0;i<8;i++) { + + uint32_t child = bake_cells_write[p_idx].childs[i]; + + if (child==CHILD_EMPTY) + continue; + + if (check_children) { + _upscale_light(child,p_level+1); + } + + light_accum[0]+=bake_cells_write[child].light[0]; + light_accum[1]+=bake_cells_write[child].light[1]; + light_accum[2]+=bake_cells_write[child].light[2]; + alpha_accum+=bake_cells_write[child].alpha; + + } + + bake_cells_write[p_idx].light[0]=light_accum[0]/8.0; + bake_cells_write[p_idx].light[1]=light_accum[1]/8.0; + bake_cells_write[p_idx].light[2]=light_accum[2]/8.0; + bake_cells_write[p_idx].alpha=alpha_accum/8.0; + +} + + +void BakedLight::bake_lights() { + + ERR_FAIL_COND(bake_cells.size()==0); + + bake_cells_write = bake_cells.write(); + + for(Set<Light*>::Element *E=lights.front();E;E=E->next()) { + + _bake_light(E->get()); + } + + + _upscale_light(0,0); + + bake_cells_write=PoolVector<BakeCell>::Write(); + +} + + + +Color BakedLight::_cone_trace(const Vector3& p_from, const Vector3& p_dir, float p_half_angle) { + + + Color color(0,0,0,0); + float tha = Math::tan(p_half_angle);//tan half angle + Vector3 from =(p_from-bounds.pos)/bounds.size; //convert to 0..1 + from/=cells_per_axis; //convert to voxels of size 1 + Vector3 dir = (p_dir/bounds.size).normalized(); + + float max_dist = Vector3(cells_per_axis,cells_per_axis,cells_per_axis).length(); + + float dist = 1.0; + // self occlusion in flat surfaces + + float alpha=0; + + + while(dist < max_dist && alpha < 0.95) { + +#if 0 + // smallest sample diameter possible is the voxel size + float diameter = MAX(1.0, 2.0 * tha * dist); + float lod = log2(diameter); + + Vector3 sample_pos = from + dist * dir; + + + Color samples_base[2][8]={{Color(0,0,0,0),Color(0,0,0,0),Color(0,0,0,0),Color(0,0,0,0),Color(0,0,0,0),Color(0,0,0,0),Color(0,0,0,0),Color(0,0,0,0)}, + {Color(0,0,0,0),Color(0,0,0,0),Color(0,0,0,0),Color(0,0,0,0),Color(0,0,0,0),Color(0,0,0,0),Color(0,0,0,0),Color(0,0,0,0)}}; + + float levelf = Math::fposmod(lod,1.0); + float fx = Math::fposmod(sample_pos.x,1.0); + float fy = Math::fposmod(sample_pos.y,1.0); + float fz = Math::fposmod(sample_pos.z,1.0); + + for(int l=0;l<2;l++){ + + int bx = Math::floor(sample_pos.x); + int by = Math::floor(sample_pos.y); + int bz = Math::floor(sample_pos.z); + + int lodn=int(Math::floor(lod))-l; + + bx>>=lodn; + by>>=lodn; + bz>>=lodn; + + int limit = MAX(0,cell_subdiv-lodn-1); + + for(int c=0;c<8;c++) { + + int x = bx; + int y = by; + int z = bz; + + if (c&1) { + x+=1; + } + if (c&2) { + y+=1; + } + if (c&4) { + z+=1; + } + + int ofs_x=0; + int ofs_y=0; + int ofs_z=0; + int size = cells_per_axis>>lodn; + int half=size/2; + + bool outside=x<0 || x>=size || y<0 || y>=size || z<0 || z>=size; + + if (outside) + continue; + + + uint32_t cell=0; + + for(int i=0;i<limit;i++) { + + BakeCell *bc = &bake_cells_write[cell]; + + int child = 0; + if (x >= ofs_x + half) { + child|=1; + ofs_x+=half; + } + if (y >= ofs_y + half) { + child|=2; + ofs_y+=half; + } + if (z >= ofs_z + half) { + child|=4; + ofs_z+=half; + } + + cell = bc->childs[child]; + if (cell==CHILD_EMPTY) + break; + + half>>=1; + } + + if (cell!=CHILD_EMPTY) { + + samples_base[l][c].r=bake_cells_write[cell].light[0]; + samples_base[l][c].g=bake_cells_write[cell].light[1]; + samples_base[l][c].b=bake_cells_write[cell].light[2]; + samples_base[l][c].a=bake_cells_write[cell].alpha; + } + + } + + + } + + Color m0x0 = samples_base[0][0].linear_interpolate(samples_base[0][1],fx); + Color m0x1 = samples_base[0][2].linear_interpolate(samples_base[0][3],fx); + Color m0y0 = m0x0.linear_interpolate(m0x1,fy); + m0x0 = samples_base[0][4].linear_interpolate(samples_base[0][5],fx); + m0x1 = samples_base[0][6].linear_interpolate(samples_base[0][7],fx); + Color m0y1 = m0x0.linear_interpolate(m0x1,fy); + Color m0z = m0y0.linear_interpolate(m0y1,fz); + + Color m1x0 = samples_base[1][0].linear_interpolate(samples_base[1][1],fx); + Color m1x1 = samples_base[1][2].linear_interpolate(samples_base[1][3],fx); + Color m1y0 = m1x0.linear_interpolate(m1x1,fy); + m1x0 = samples_base[1][4].linear_interpolate(samples_base[1][5],fx); + m1x1 = samples_base[1][6].linear_interpolate(samples_base[1][7],fx); + Color m1y1 = m1x0.linear_interpolate(m1x1,fy); + Color m1z = m1y0.linear_interpolate(m1y1,fz); + + Color m = m0z.linear_interpolate(m1z,levelf); +#else + float diameter = 1.0; + Vector3 sample_pos = from + dist * dir; + + Color m(0,0,0,0); + { + int x = Math::floor(sample_pos.x); + int y = Math::floor(sample_pos.y); + int z = Math::floor(sample_pos.z); + + int ofs_x=0; + int ofs_y=0; + int ofs_z=0; + int size = cells_per_axis; + int half=size/2; + + bool outside=x<0 || x>=size || y<0 || y>=size || z<0 || z>=size; + + if (!outside) { + + + uint32_t cell=0; + + for(int i=0;i<cell_subdiv-1;i++) { + + BakeCell *bc = &bake_cells_write[cell]; + + int child = 0; + if (x >= ofs_x + half) { + child|=1; + ofs_x+=half; + } + if (y >= ofs_y + half) { + child|=2; + ofs_y+=half; + } + if (z >= ofs_z + half) { + child|=4; + ofs_z+=half; + } + + cell = bc->childs[child]; + if (cell==CHILD_EMPTY) + break; + + half>>=1; + } + + if (cell!=CHILD_EMPTY) { + + m.r=bake_cells_write[cell].light[0]; + m.g=bake_cells_write[cell].light[1]; + m.b=bake_cells_write[cell].light[2]; + m.a=bake_cells_write[cell].alpha; + } + } + } + +#endif + // front-to-back compositing + float a = (1.0 - alpha); + color.r += a * m.r; + color.g += a * m.g; + color.b += a * m.b; + alpha += a * m.a; + //occlusion += a * voxelColor.a; + //occlusion += (a * voxelColor.a) / (1.0 + 0.03 * diameter); + dist += diameter * 0.5; // smoother + //dist += diameter; // faster but misses more voxels + } + + return color; +} + + + +void BakedLight::_bake_radiance(int p_idx, int p_level, int p_x,int p_y,int p_z) { + + + + + if (p_level==cell_subdiv-1) { + + const int NUM_CONES = 6; + Vector3 cone_directions[6] = { + Vector3(1, 0, 0), + Vector3(0.5, 0.866025, 0), + Vector3( 0.5, 0.267617, 0.823639), + Vector3( 0.5, -0.700629, 0.509037), + Vector3( 0.5, -0.700629, -0.509037), + Vector3( 0.5, 0.267617, -0.823639) + }; + float coneWeights[6] = {0.25, 0.15, 0.15, 0.15, 0.15, 0.15}; + + Vector3 pos = (Vector3(p_x,p_y,p_z)/float(cells_per_axis))*bounds.size+bounds.pos; + Vector3 voxel_size = bounds.size/float(cells_per_axis); + pos+=voxel_size*0.5; + + Color accum; + + bake_cells_write[p_idx].light[0]=0; + bake_cells_write[p_idx].light[1]=0; + bake_cells_write[p_idx].light[2]=0; + + int freepix=0; + for(int i=0;i<6;i++) { + + if (!(bake_cells_write[p_idx].used_sides&(1<<i))) + continue; + + if ((i&1)==0) + bake_cells_write[p_idx].light[i/2]=1.0; + freepix++; + continue; + + int ofs = i/2; + + Vector3 dir; + if ((i&1)==0) + dir[ofs]=1.0; + else + dir[ofs]=-1.0; + + for(int j=0;j<1;j++) { + + + Vector3 cone_dir; + cone_dir.x = cone_directions[j][(ofs+0)%3]; + cone_dir.y = cone_directions[j][(ofs+1)%3]; + cone_dir.z = cone_directions[j][(ofs+2)%3]; + + cone_dir[ofs]*=dir[ofs]; + + Color res = _cone_trace(pos+dir*voxel_size,cone_dir,Math::deg2rad(29.9849)); + accum.r+=res.r;//*coneWeights[j]; + accum.g+=res.g;//*coneWeights[j]; + accum.b+=res.b;//*coneWeights[j]; + } + + + } +#if 0 + if (freepix==0) { + bake_cells_write[p_idx].light[0]=0; + bake_cells_write[p_idx].light[1]=0; + bake_cells_write[p_idx].light[2]=0; + } + + if (freepix==1) { + bake_cells_write[p_idx].light[0]=1; + bake_cells_write[p_idx].light[1]=0; + bake_cells_write[p_idx].light[2]=0; + } + + if (freepix==2) { + bake_cells_write[p_idx].light[0]=0; + bake_cells_write[p_idx].light[1]=1; + bake_cells_write[p_idx].light[2]=0; + } + + if (freepix==3) { + bake_cells_write[p_idx].light[0]=1; + bake_cells_write[p_idx].light[1]=1; + bake_cells_write[p_idx].light[2]=0; + } + + if (freepix==4) { + bake_cells_write[p_idx].light[0]=0; + bake_cells_write[p_idx].light[1]=0; + bake_cells_write[p_idx].light[2]=1; + } + + if (freepix==5) { + bake_cells_write[p_idx].light[0]=1; + bake_cells_write[p_idx].light[1]=0; + bake_cells_write[p_idx].light[2]=1; + } + + if (freepix==6) { + bake_cells_write[p_idx].light[0]=0; + bake_cells_write[p_idx].light[0]=1; + bake_cells_write[p_idx].light[0]=1; + } +#endif + //bake_cells_write[p_idx].radiance[0]=accum.r; + //bake_cells_write[p_idx].radiance[1]=accum.g; + //bake_cells_write[p_idx].radiance[2]=accum.b; + + + } else { + + int half = cells_per_axis >> (p_level+1); + + //go down + for(int i=0;i<8;i++) { + + uint32_t child = bake_cells_write[p_idx].childs[i]; + + if (child==CHILD_EMPTY) + continue; + + int nx=p_x; + int ny=p_y; + int nz=p_z; + + if (i&1) + nx+=half; + if (i&2) + ny+=half; + if (i&4) + nz+=half; + + + _bake_radiance(child,p_level+1,nx,ny,nz); + } + } +} + +void BakedLight::bake_radiance() { + + ERR_FAIL_COND(bake_cells.size()==0); + + bake_cells_write = bake_cells.write(); + + _bake_radiance(0,0,0,0,0); + + bake_cells_write=PoolVector<BakeCell>::Write(); + +} +int BakedLight::_find_cell(int x,int y, int z) { + + + uint32_t cell=0; + + int ofs_x=0; + int ofs_y=0; + int ofs_z=0; + int size = cells_per_axis; + int half=size/2; + + if (x<0 || x>=size) + return -1; + if (y<0 || y>=size) + return -1; + if (z<0 || z>=size) + return -1; + + for(int i=0;i<cell_subdiv-1;i++) { + + BakeCell *bc = &bake_cells_write[cell]; + + int child = 0; + if (x >= ofs_x + half) { + child|=1; + ofs_x+=half; + } + if (y >= ofs_y + half) { + child|=2; + ofs_y+=half; + } + if (z >= ofs_z + half) { + child|=4; + ofs_z+=half; + } + + cell = bc->childs[child]; + if (cell==CHILD_EMPTY) + return -1; + + half>>=1; + } + + return cell; + +} + + +int BakedLight::_plot_ray(const Vector3& p_from, const Vector3& p_to) { + + Vector3 from = (p_from - bounds.pos) / bounds.size; + Vector3 to = (p_to - bounds.pos) / bounds.size; + + int x1 = Math::floor(from.x*cells_per_axis); + int y1 = Math::floor(from.y*cells_per_axis); + int z1 = Math::floor(from.z*cells_per_axis); + + int x2 = Math::floor(to.x*cells_per_axis); + int y2 = Math::floor(to.y*cells_per_axis); + int z2 = Math::floor(to.z*cells_per_axis); + + + int i, dx, dy, dz, l, m, n, x_inc, y_inc, z_inc, err_1, err_2, dx2, dy2, dz2; + int point[3]; + + point[0] = x1; + point[1] = y1; + point[2] = z1; + dx = x2 - x1; + dy = y2 - y1; + dz = z2 - z1; + x_inc = (dx < 0) ? -1 : 1; + l = ABS(dx); + y_inc = (dy < 0) ? -1 : 1; + m = ABS(dy); + z_inc = (dz < 0) ? -1 : 1; + n = ABS(dz); + dx2 = l << 1; + dy2 = m << 1; + dz2 = n << 1; + + if ((l >= m) && (l >= n)) { + err_1 = dy2 - l; + err_2 = dz2 - l; + for (i = 0; i < l; i++) { + int cell = _find_cell(point[0],point[1],point[2]); + if (cell>=0) + return cell; + + if (err_1 > 0) { + point[1] += y_inc; + err_1 -= dx2; + } + if (err_2 > 0) { + point[2] += z_inc; + err_2 -= dx2; + } + err_1 += dy2; + err_2 += dz2; + point[0] += x_inc; + } + } else if ((m >= l) && (m >= n)) { + err_1 = dx2 - m; + err_2 = dz2 - m; + for (i = 0; i < m; i++) { + int cell = _find_cell(point[0],point[1],point[2]); + if (cell>=0) + return cell; + if (err_1 > 0) { + point[0] += x_inc; + err_1 -= dy2; + } + if (err_2 > 0) { + point[2] += z_inc; + err_2 -= dy2; + } + err_1 += dx2; + err_2 += dz2; + point[1] += y_inc; + } + } else { + err_1 = dy2 - n; + err_2 = dx2 - n; + for (i = 0; i < n; i++) { + int cell = _find_cell(point[0],point[1],point[2]); + if (cell>=0) + return cell; + + if (err_1 > 0) { + point[1] += y_inc; + err_1 -= dz2; + } + if (err_2 > 0) { + point[0] += x_inc; + err_2 -= dz2; + } + err_1 += dy2; + err_2 += dx2; + point[2] += z_inc; + } + } + return _find_cell(point[0],point[1],point[2]); + +} + + +void BakedLight::set_cell_subdiv(int p_subdiv) { + + cell_subdiv=p_subdiv; + +// VS::get_singleton()->baked_light_set_subdivision(baked_light,p_subdiv); +} + +int BakedLight::get_cell_subdiv() const { + + return cell_subdiv; +} + + + +Rect3 BakedLight::get_aabb() const { + + return Rect3(Vector3(0,0,0),Vector3(1,1,1)); +} +PoolVector<Face3> BakedLight::get_faces(uint32_t p_usage_flags) const { + + return PoolVector<Face3>(); +} + + +String BakedLight::get_configuration_warning() const { return String(); } -void BakedLightInstance::_bind_methods() { +void BakedLight::_debug_mesh(int p_idx, int p_level, const Rect3 &p_aabb,DebugMode p_mode,Ref<MultiMesh> &p_multimesh,int &idx) { + + + if (p_level==cell_subdiv-1) { + + Vector3 center = p_aabb.pos+p_aabb.size*0.5; + Transform xform; + xform.origin=center; + xform.basis.scale(p_aabb.size*0.5); + p_multimesh->set_instance_transform(idx,xform); + Color col; + switch(p_mode) { + case DEBUG_ALBEDO: { + col=Color(bake_cells_write[p_idx].albedo[0],bake_cells_write[p_idx].albedo[1],bake_cells_write[p_idx].albedo[2]); + } break; + case DEBUG_LIGHT: { + col=Color(bake_cells_write[p_idx].light[0],bake_cells_write[p_idx].light[1],bake_cells_write[p_idx].light[2]); + Color colr=Color(bake_cells_write[p_idx].radiance[0],bake_cells_write[p_idx].radiance[1],bake_cells_write[p_idx].radiance[2]); + col.r+=colr.r; + col.g+=colr.g; + col.b+=colr.b; + } break; + + } + p_multimesh->set_instance_color(idx,col); + + + idx++; + + } else { + + for(int i=0;i<8;i++) { + + if (bake_cells_write[p_idx].childs[i]==CHILD_EMPTY) + continue; + + Rect3 aabb=p_aabb; + aabb.size*=0.5; + + if (i&1) + aabb.pos.x+=aabb.size.x; + if (i&2) + aabb.pos.y+=aabb.size.y; + if (i&4) + aabb.pos.z+=aabb.size.z; + + _debug_mesh(bake_cells_write[p_idx].childs[i],p_level+1,aabb,p_mode,p_multimesh,idx); + } + + } + +} + + +void BakedLight::create_debug_mesh(DebugMode p_mode) { + + Ref<MultiMesh> mm; + mm.instance(); + + mm->set_transform_format(MultiMesh::TRANSFORM_3D); + mm->set_color_format(MultiMesh::COLOR_8BIT); + mm->set_instance_count(bake_cells_level_used[cell_subdiv-1]); + + Ref<Mesh> mesh; + mesh.instance(); + + + + { + Array arr; + arr.resize(Mesh::ARRAY_MAX); + + PoolVector<Vector3> vertices; + PoolVector<Color> colors; + + int vtx_idx=0; + #define ADD_VTX(m_idx);\ + vertices.push_back( face_points[m_idx] );\ + colors.push_back( Color(1,1,1,1) );\ + vtx_idx++;\ + + for (int i=0;i<6;i++) { + + + Vector3 face_points[4]; + + for (int j=0;j<4;j++) { + + float v[3]; + v[0]=1.0; + v[1]=1-2*((j>>1)&1); + v[2]=v[1]*(1-2*(j&1)); + + for (int k=0;k<3;k++) { + + if (i<3) + face_points[j][(i+k)%3]=v[k]*(i>=3?-1:1); + else + face_points[3-j][(i+k)%3]=v[k]*(i>=3?-1:1); + } + } + + //tri 1 + ADD_VTX(0); + ADD_VTX(1); + ADD_VTX(2); + //tri 2 + ADD_VTX(2); + ADD_VTX(3); + ADD_VTX(0); + + } + + + arr[Mesh::ARRAY_VERTEX]=vertices; + arr[Mesh::ARRAY_COLOR]=colors; + mesh->add_surface_from_arrays(Mesh::PRIMITIVE_TRIANGLES,arr); + } + + { + Ref<FixedSpatialMaterial> fsm; + fsm.instance(); + fsm->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR,true); + fsm->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR,true); + fsm->set_flag(FixedSpatialMaterial::FLAG_UNSHADED,true); + fsm->set_albedo(Color(1,1,1,1)); + + mesh->surface_set_material(0,fsm); + } + + mm->set_mesh(mesh); + + + bake_cells_write = bake_cells.write(); + + + + int idx=0; + _debug_mesh(0,0,bounds,p_mode,mm,idx); + + print_line("written: "+itos(idx)+" total: "+itos(bake_cells_level_used[cell_subdiv-1])); + + + MultiMeshInstance *mmi = memnew( MultiMeshInstance ); + mmi->set_multimesh(mm); + add_child(mmi); +#ifdef TOOLS_ENABLED + if (get_tree()->get_edited_scene_root()==this){ + mmi->set_owner(this); + } else { + mmi->set_owner(get_owner()); + + } +#else + mmi->set_owner(get_owner()); +#endif + +} + +void BakedLight::_debug_mesh_albedo() { + create_debug_mesh(DEBUG_ALBEDO); +} + +void BakedLight::_debug_mesh_light() { + create_debug_mesh(DEBUG_LIGHT); +} + + +void BakedLight::_bind_methods() { + + ClassDB::bind_method(_MD("set_cell_subdiv","steps"),&BakedLight::set_cell_subdiv); + ClassDB::bind_method(_MD("get_cell_subdiv"),&BakedLight::get_cell_subdiv); + + ClassDB::bind_method(_MD("bake"),&BakedLight::bake); + ClassDB::set_method_flags(get_class_static(),_SCS("bake"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + + ClassDB::bind_method(_MD("bake_lights"),&BakedLight::bake_lights); + ClassDB::set_method_flags(get_class_static(),_SCS("bake_lights"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + + ClassDB::bind_method(_MD("bake_radiance"),&BakedLight::bake_radiance); + ClassDB::set_method_flags(get_class_static(),_SCS("bake_radiance"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + + ClassDB::bind_method(_MD("debug_mesh_albedo"),&BakedLight::_debug_mesh_albedo); + ClassDB::set_method_flags(get_class_static(),_SCS("debug_mesh_albedo"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); - ObjectTypeDB::bind_method(_MD("set_baked_light","baked_light"),&BakedLightInstance::set_baked_light); - ObjectTypeDB::bind_method(_MD("get_baked_light"),&BakedLightInstance::get_baked_light); - ObjectTypeDB::bind_method(_MD("get_baked_light_instance"),&BakedLightInstance::get_baked_light_instance); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"baked_light",PROPERTY_HINT_RESOURCE_TYPE,"BakedLight"),_SCS("set_baked_light"),_SCS("get_baked_light")); + ClassDB::bind_method(_MD("debug_mesh_light"),&BakedLight::_debug_mesh_light); + ClassDB::set_method_flags(get_class_static(),_SCS("debug_mesh_light"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + + ADD_PROPERTY(PropertyInfo(Variant::INT,"cell_subdiv"),_SCS("set_cell_subdiv"),_SCS("get_cell_subdiv")); ADD_SIGNAL( MethodInfo("baked_light_changed")); + } -BakedLightInstance::BakedLightInstance() { +BakedLight::BakedLight() { +// baked_light=VisualServer::get_singleton()->baked_light_create(); + VS::get_singleton()->instance_set_base(get_instance(),baked_light); + cell_subdiv=8; + bake_texture_size=128; + color_scan_cell_width=8; + light_pass=0; } -///////////////////////// +BakedLight::~BakedLight() { + + VS::get_singleton()->free(baked_light); +} + +///////////////////////// + +#if 0 void BakedLightSampler::set_param(Param p_param,float p_value) { ERR_FAIL_INDEX(p_param,PARAM_MAX); params[p_param]=p_value; @@ -139,11 +1798,11 @@ DVector<Face3> BakedLightSampler::get_faces(uint32_t p_usage_flags) const { void BakedLightSampler::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_param","param","value"),&BakedLightSampler::set_param); - ObjectTypeDB::bind_method(_MD("get_param","param"),&BakedLightSampler::get_param); + ClassDB::bind_method(_MD("set_param","param","value"),&BakedLightSampler::set_param); + ClassDB::bind_method(_MD("get_param","param"),&BakedLightSampler::get_param); - ObjectTypeDB::bind_method(_MD("set_resolution","resolution"),&BakedLightSampler::set_resolution); - ObjectTypeDB::bind_method(_MD("get_resolution"),&BakedLightSampler::get_resolution); + ClassDB::bind_method(_MD("set_resolution","resolution"),&BakedLightSampler::set_resolution); + ClassDB::bind_method(_MD("get_resolution"),&BakedLightSampler::get_resolution); BIND_CONSTANT( PARAM_RADIUS ); @@ -179,3 +1838,4 @@ BakedLightSampler::~BakedLightSampler(){ VS::get_singleton()->free(base); } +#endif diff --git a/scene/3d/baked_light_instance.h b/scene/3d/baked_light_instance.h index 002e55df1d..2fda26ecea 100644 --- a/scene/3d/baked_light_instance.h +++ b/scene/3d/baked_light_instance.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,39 +31,144 @@ #include "scene/3d/visual_instance.h" #include "scene/resources/baked_light.h" +#include "scene/3d/multimesh_instance.h" + class BakedLightBaker; +class Light; + +class BakedLight : public VisualInstance { + GDCLASS(BakedLight,VisualInstance); + +public: + enum DebugMode { + DEBUG_ALBEDO, + DEBUG_LIGHT + }; + +private: + RID baked_light; + int cell_subdiv; + Rect3 bounds; + int cells_per_axis; + + enum { + CHILD_EMPTY=0xFFFFFFFF, + }; + + + /* BAKE DATA */ + + struct BakeCell { + + uint32_t childs[8]; + float albedo[3]; //albedo in RGB24 + float light[3]; //accumulated light in 16:16 fixed point (needs to be integer for moving lights fast) + float radiance[3]; //accumulated light in 16:16 fixed point (needs to be integer for moving lights fast) + uint32_t used_sides; + float alpha; //used for upsampling + uint32_t light_pass; //used for baking light + + BakeCell() { + for(int i=0;i<8;i++) { + childs[i]=0xFFFFFFFF; + } + + for(int i=0;i<3;i++) { + light[i]=0; + albedo[i]=0; + radiance[i]=0; + } + alpha=0; + light_pass=0; + used_sides=0; + } + }; + + + int bake_texture_size; + int color_scan_cell_width; + + struct MaterialCache { + //128x128 textures + Vector<Color> albedo; + Vector<Color> emission; + }; + + + Vector<Color> _get_bake_texture(Image &p_image, const Color &p_color); -class BakedLightInstance : public VisualInstance { - OBJ_TYPE(BakedLightInstance,VisualInstance); - Ref<BakedLight> baked_light; + Map<Ref<Material>,MaterialCache> material_cache; + MaterialCache _get_material_cache(Ref<Material> p_material); + int bake_cells_alloc; + int bake_cells_used; + int zero_alphas; + Vector<int> bake_cells_level_used; + PoolVector<BakeCell> bake_cells; + PoolVector<BakeCell>::Write bake_cells_write; + + + void _plot_face(int p_idx,int p_level,const Vector3 *p_vtx,const Vector2* p_uv, const MaterialCache& p_material,const Rect3& p_aabb); + void _fixup_plot(int p_idx, int p_level, int p_x, int p_y, int p_z); + void _bake_add_mesh(const Transform& p_xform,Ref<Mesh>& p_mesh); + void _bake_add_to_aabb(const Transform& p_xform,Ref<Mesh>& p_mesh,bool &first); + + void _debug_mesh(int p_idx, int p_level, const Rect3 &p_aabb,DebugMode p_mode,Ref<MultiMesh> &p_multimesh,int &idx); + void _debug_mesh_albedo(); + void _debug_mesh_light(); + + + _FORCE_INLINE_ int _find_cell(int x,int y, int z); + int _plot_ray(const Vector3& p_from, const Vector3& p_to); + + uint32_t light_pass; + + + void _bake_directional(int p_idx, int p_level, int p_x,int p_y,int p_z,const Vector3& p_dir,const Color& p_color,int p_sign); + void _upscale_light(int p_idx,int p_level); + void _bake_light(Light* p_light); + + Color _cone_trace(const Vector3& p_from, const Vector3& p_dir, float p_half_angle); + void _bake_radiance(int p_idx, int p_level, int p_x,int p_y,int p_z); + +friend class GeometryInstance; + + Set<GeometryInstance*> geometries; +friend class Light; + + Set<Light*> lights; protected: static void _bind_methods(); public: + void set_cell_subdiv(int p_subdiv); + int get_cell_subdiv() const; - RID get_baked_light_instance() const; + void bake(); + void bake_lights(); + void bake_radiance(); - void set_baked_light(const Ref<BakedLight>& baked_light); - Ref<BakedLight> get_baked_light() const; - virtual AABB get_aabb() const; - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const; + void create_debug_mesh(DebugMode p_mode); + + virtual Rect3 get_aabb() const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; String get_configuration_warning() const; - BakedLightInstance(); + BakedLight(); + ~BakedLight(); }; - +#if 0 class BakedLightSampler : public VisualInstance { - OBJ_TYPE(BakedLightSampler,VisualInstance); + GDCLASS(BakedLightSampler,VisualInstance); public: @@ -87,7 +192,7 @@ protected: public: virtual AABB get_aabb() const; - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; void set_param(Param p_param,float p_value); float get_param(Param p_param) const; @@ -101,5 +206,5 @@ public: VARIANT_ENUM_CAST( BakedLightSampler::Param ); - +#endif #endif // BAKED_LIGHT_H diff --git a/scene/3d/body_shape.cpp b/scene/3d/body_shape.cpp index adb0d17753..ff8b0f15bf 100644 --- a/scene/3d/body_shape.cpp +++ b/scene/3d/body_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -83,8 +83,8 @@ void CollisionShape::_update_indicator() { if (shape.is_null()) return; - DVector<Vector3> points; - DVector<Vector3> normals; + PoolVector<Vector3> points; + PoolVector<Vector3> normals; VS::PrimitiveType pt = VS::PRIMITIVE_TRIANGLES; @@ -235,7 +235,7 @@ void CollisionShape::_update_indicator() { CapsuleShape *shapeptr=shape->cast_to<CapsuleShape>(); - DVector<Plane> planes = Geometry::build_capsule_planes(shapeptr->get_radius(), shapeptr->get_height()/2.0, 12, Vector3::AXIS_Z); + PoolVector<Plane> planes = Geometry::build_capsule_planes(shapeptr->get_radius(), shapeptr->get_height()/2.0, 12, Vector3::AXIS_Z); Geometry::MeshData md = Geometry::build_convex_mesh(planes); for(int i=0;i<md.faces.size();i++) { @@ -414,18 +414,18 @@ String CollisionShape::get_configuration_warning() const { void CollisionShape::_bind_methods() { //not sure if this should do anything - ObjectTypeDB::bind_method(_MD("resource_changed","resource"),&CollisionShape::resource_changed); - ObjectTypeDB::bind_method(_MD("set_shape","shape"),&CollisionShape::set_shape); - ObjectTypeDB::bind_method(_MD("get_shape"),&CollisionShape::get_shape); - ObjectTypeDB::bind_method(_MD("_add_to_collision_object"),&CollisionShape::_add_to_collision_object); - ObjectTypeDB::bind_method(_MD("set_trigger","enable"),&CollisionShape::set_trigger); - ObjectTypeDB::bind_method(_MD("is_trigger"),&CollisionShape::is_trigger); - ObjectTypeDB::bind_method(_MD("make_convex_from_brothers"),&CollisionShape::make_convex_from_brothers); - ObjectTypeDB::set_method_flags("CollisionShape","make_convex_from_brothers",METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); - ObjectTypeDB::bind_method(_MD("_set_update_shape_index","index"),&CollisionShape::_set_update_shape_index); - ObjectTypeDB::bind_method(_MD("_get_update_shape_index"),&CollisionShape::_get_update_shape_index); - - ObjectTypeDB::bind_method(_MD("get_collision_object_shape_index"),&CollisionShape::get_collision_object_shape_index); + ClassDB::bind_method(_MD("resource_changed","resource"),&CollisionShape::resource_changed); + ClassDB::bind_method(_MD("set_shape","shape"),&CollisionShape::set_shape); + ClassDB::bind_method(_MD("get_shape"),&CollisionShape::get_shape); + ClassDB::bind_method(_MD("_add_to_collision_object"),&CollisionShape::_add_to_collision_object); + ClassDB::bind_method(_MD("set_trigger","enable"),&CollisionShape::set_trigger); + ClassDB::bind_method(_MD("is_trigger"),&CollisionShape::is_trigger); + ClassDB::bind_method(_MD("make_convex_from_brothers"),&CollisionShape::make_convex_from_brothers); + ClassDB::set_method_flags("CollisionShape","make_convex_from_brothers",METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + ClassDB::bind_method(_MD("_set_update_shape_index","index"),&CollisionShape::_set_update_shape_index); + ClassDB::bind_method(_MD("_get_update_shape_index"),&CollisionShape::_get_update_shape_index); + + ClassDB::bind_method(_MD("get_collision_object_shape_index"),&CollisionShape::get_collision_object_shape_index); ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "shape", PROPERTY_HINT_RESOURCE_TYPE, "Shape"), _SCS("set_shape"), _SCS("get_shape")); ADD_PROPERTY(PropertyInfo(Variant::BOOL,"trigger"),_SCS("set_trigger"),_SCS("is_trigger")); @@ -620,7 +620,7 @@ RID CollisionShape::_get_visual_instance_rid() const { void CollisionShape::_bind_methods() { - ObjectTypeDB::bind_method("_get_visual_instance_rid",&CollisionShape::_get_visual_instance_rid); + ClassDB::bind_method("_get_visual_instance_rid",&CollisionShape::_get_visual_instance_rid); } CollisionShape::CollisionShape() { @@ -840,7 +840,7 @@ void CollisionShapeCylinder::update_indicator(RID p_indicator) { vs->poly_clear(p_indicator); Color col(0.4,1.0,1.0,0.5); - DVector<Plane> planes = Geometry::build_cylinder_planes(radius, height, 12, Vector3::AXIS_Z); + PoolVector<Plane> planes = Geometry::build_cylinder_planes(radius, height, 12, Vector3::AXIS_Z); Geometry::MeshData md = Geometry::build_convex_mesh(planes); for(int i=0;i<md.faces.size();i++) { @@ -906,7 +906,7 @@ void CollisionShapeCapsule::update_indicator(RID p_indicator) { vs->poly_clear(p_indicator); Color col(0.4,1.0,1.0,0.5); - DVector<Plane> planes = Geometry::build_capsule_planes(radius, height, 12, 3, Vector3::AXIS_Z); + PoolVector<Plane> planes = Geometry::build_capsule_planes(radius, height, 12, 3, Vector3::AXIS_Z); Geometry::MeshData md = Geometry::build_convex_mesh(planes); for(int i=0;i<md.faces.size();i++) { diff --git a/scene/3d/body_shape.h b/scene/3d/body_shape.h index a3289bf26a..a7c3678251 100644 --- a/scene/3d/body_shape.h +++ b/scene/3d/body_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class CollisionShape : public Spatial { - OBJ_TYPE( CollisionShape, Spatial ); + GDCLASS( CollisionShape, Spatial ); OBJ_CATEGORY("3D Physics Nodes"); Ref<Shape> shape; diff --git a/scene/3d/bone_attachment.cpp b/scene/3d/bone_attachment.cpp index 56b61d40e2..c3ab2df939 100644 --- a/scene/3d/bone_attachment.cpp +++ b/scene/3d/bone_attachment.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -137,3 +137,8 @@ BoneAttachment::BoneAttachment() bound=false; } + +void BoneAttachment::_bind_methods(){ + ClassDB::bind_method(_MD("set_bone_name","bone_name"),&BoneAttachment::set_bone_name); + ClassDB::bind_method(_MD("get_bone_name"),&BoneAttachment::get_bone_name); +} diff --git a/scene/3d/bone_attachment.h b/scene/3d/bone_attachment.h index f1c27a9650..9bcbb82865 100644 --- a/scene/3d/bone_attachment.h +++ b/scene/3d/bone_attachment.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class BoneAttachment : public Spatial { - OBJ_TYPE(BoneAttachment,Spatial); + GDCLASS(BoneAttachment,Spatial); bool bound; String bone_name; @@ -47,6 +47,8 @@ protected: void _get_property_list( List<PropertyInfo>* p_list ) const; void _notification(int p_what); + static void _bind_methods(); + public: void set_bone_name(const String& p_name); diff --git a/scene/3d/camera.cpp b/scene/3d/camera.cpp index 76543b67c6..6298e629a4 100644 --- a/scene/3d/camera.cpp +++ b/scene/3d/camera.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -96,8 +96,8 @@ bool Camera::_set(const StringName& p_name, const Variant& p_value) { } else { clear_current(); } - } else if (p_name=="visible_layers") { - set_visible_layers(p_value); + } else if (p_name=="cull_mask") { + set_cull_mask(p_value); } else if (p_name=="environment") { set_environment(p_value); } else @@ -130,8 +130,8 @@ bool Camera::_get(const StringName& p_name,Variant &r_ret) const { } else { r_ret=is_current(); } - } else if (p_name=="visible_layers") { - r_ret=get_visible_layers(); + } else if (p_name=="cull_mask") { + r_ret=get_cull_mask(); } else if (p_name=="h_offset") { r_ret=get_h_offset(); } else if (p_name=="v_offset") { @@ -176,7 +176,7 @@ void Camera::_get_property_list( List<PropertyInfo> *p_list) const { p_list->push_back( PropertyInfo( Variant::REAL, "far" , PROPERTY_HINT_EXP_RANGE, "0.01,4096.0,0.01") ); p_list->push_back( PropertyInfo( Variant::INT, "keep_aspect",PROPERTY_HINT_ENUM,"Keep Width,Keep Height") ); p_list->push_back( PropertyInfo( Variant::BOOL, "current" ) ); - p_list->push_back( PropertyInfo( Variant::INT, "visible_layers",PROPERTY_HINT_ALL_FLAGS ) ); + p_list->push_back( PropertyInfo( Variant::INT, "cull_mask",PROPERTY_HINT_LAYERS_3D_RENDER ) ); p_list->push_back( PropertyInfo( Variant::OBJECT, "environment",PROPERTY_HINT_RESOURCE_TYPE,"Environment" ) ); p_list->push_back( PropertyInfo( Variant::REAL, "h_offset" ) ); p_list->push_back( PropertyInfo( Variant::REAL, "v_offset" ) ); @@ -342,91 +342,6 @@ bool Camera::_can_gizmo_scale() const { } -RES Camera::_get_gizmo_geometry() const { - - - Ref<SurfaceTool> surface_tool( memnew( SurfaceTool )); - - Ref<FixedMaterial> mat( memnew( FixedMaterial )); - - mat->set_parameter( FixedMaterial::PARAM_DIFFUSE,Color(1.0,0.5,1.0,0.5) ); - mat->set_line_width(4); - mat->set_flag(Material::FLAG_DOUBLE_SIDED,true); - mat->set_flag(Material::FLAG_UNSHADED,true); - //mat->set_hint(Material::HINT_NO_DEPTH_DRAW,true); - - surface_tool->begin(Mesh::PRIMITIVE_LINES); - surface_tool->set_material(mat); - - switch(mode) { - - case PROJECTION_PERSPECTIVE: { - - - - Vector3 side=Vector3( Math::sin(Math::deg2rad(fov)), 0, -Math::cos(Math::deg2rad(fov)) ); - Vector3 nside=side; - nside.x=-nside.x; - Vector3 up=Vector3(0,side.x,0); - - -#define ADD_TRIANGLE( m_a, m_b, m_c)\ -{\ - surface_tool->add_vertex(m_a);\ - surface_tool->add_vertex(m_b);\ - surface_tool->add_vertex(m_b);\ - surface_tool->add_vertex(m_c);\ - surface_tool->add_vertex(m_c);\ - surface_tool->add_vertex(m_a);\ -} - - ADD_TRIANGLE( Vector3(), side+up, side-up ); - ADD_TRIANGLE( Vector3(), nside+up, nside-up ); - ADD_TRIANGLE( Vector3(), side+up, nside+up ); - ADD_TRIANGLE( Vector3(), side-up, nside-up ); - - side.x*=0.25; - nside.x*=0.25; - Vector3 tup( 0, up.y*3/2,side.z); - ADD_TRIANGLE( tup, side+up, nside+up ); - - } break; - case PROJECTION_ORTHOGONAL: { - -#define ADD_QUAD( m_a, m_b, m_c, m_d)\ -{\ - surface_tool->add_vertex(m_a);\ - surface_tool->add_vertex(m_b);\ - surface_tool->add_vertex(m_b);\ - surface_tool->add_vertex(m_c);\ - surface_tool->add_vertex(m_c);\ - surface_tool->add_vertex(m_d);\ - surface_tool->add_vertex(m_d);\ - surface_tool->add_vertex(m_a);\ -} - - float hsize=size*0.5; - Vector3 right(hsize,0,0); - Vector3 up(0,hsize,0); - Vector3 back(0,0,-1.0); - Vector3 front(0,0,0); - - ADD_QUAD( -up-right,-up+right,up+right,up-right); - ADD_QUAD( -up-right+back,-up+right+back,up+right+back,up-right+back); - ADD_QUAD( up+right,up+right+back,up-right+back,up-right); - ADD_QUAD( -up+right,-up+right+back,-up-right+back,-up-right); - - right.x*=0.25; - Vector3 tup( 0, up.y*3/2,back.z ); - ADD_TRIANGLE( tup, right+up+back, -right+up+back ); - - } break; - - } - - return surface_tool->commit(); - -} Vector3 Camera::project_ray_normal(const Point2& p_pos) const { @@ -631,34 +546,34 @@ Camera::KeepAspect Camera::get_keep_aspect_mode() const{ void Camera::_bind_methods() { - ObjectTypeDB::bind_method( _MD("project_ray_normal","screen_point"), &Camera::project_ray_normal); - ObjectTypeDB::bind_method( _MD("project_local_ray_normal","screen_point"), &Camera::project_local_ray_normal); - ObjectTypeDB::bind_method( _MD("project_ray_origin","screen_point"), &Camera::project_ray_origin); - ObjectTypeDB::bind_method( _MD("unproject_position","world_point"), &Camera::unproject_position); - ObjectTypeDB::bind_method( _MD("is_position_behind","world_point"), &Camera::is_position_behind); - ObjectTypeDB::bind_method( _MD("project_position","screen_point"), &Camera::project_position); - ObjectTypeDB::bind_method( _MD("set_perspective","fov","z_near","z_far"),&Camera::set_perspective ); - ObjectTypeDB::bind_method( _MD("set_orthogonal","size","z_near","z_far"),&Camera::set_orthogonal ); - ObjectTypeDB::bind_method( _MD("make_current"),&Camera::make_current ); - ObjectTypeDB::bind_method( _MD("clear_current"),&Camera::clear_current ); - ObjectTypeDB::bind_method( _MD("is_current"),&Camera::is_current ); - ObjectTypeDB::bind_method( _MD("get_camera_transform"),&Camera::get_camera_transform ); - ObjectTypeDB::bind_method( _MD("get_fov"),&Camera::get_fov ); - ObjectTypeDB::bind_method( _MD("get_size"),&Camera::get_size ); - ObjectTypeDB::bind_method( _MD("get_zfar"),&Camera::get_zfar ); - ObjectTypeDB::bind_method( _MD("get_znear"),&Camera::get_znear ); - ObjectTypeDB::bind_method( _MD("get_projection"),&Camera::get_projection ); - ObjectTypeDB::bind_method( _MD("set_h_offset","ofs"),&Camera::set_h_offset ); - ObjectTypeDB::bind_method( _MD("get_h_offset"),&Camera::get_h_offset ); - ObjectTypeDB::bind_method( _MD("set_v_offset","ofs"),&Camera::set_v_offset ); - ObjectTypeDB::bind_method( _MD("get_v_offset"),&Camera::get_v_offset ); - ObjectTypeDB::bind_method( _MD("set_visible_layers","mask"),&Camera::set_visible_layers ); - ObjectTypeDB::bind_method( _MD("get_visible_layers"),&Camera::get_visible_layers ); - ObjectTypeDB::bind_method( _MD("set_environment","env:Environment"),&Camera::set_environment ); - ObjectTypeDB::bind_method( _MD("get_environment:Environment"),&Camera::get_environment ); - ObjectTypeDB::bind_method( _MD("set_keep_aspect_mode","mode"),&Camera::set_keep_aspect_mode ); - ObjectTypeDB::bind_method( _MD("get_keep_aspect_mode"),&Camera::get_keep_aspect_mode ); - //ObjectTypeDB::bind_method( _MD("_camera_make_current"),&Camera::_camera_make_current ); + ClassDB::bind_method( _MD("project_ray_normal","screen_point"), &Camera::project_ray_normal); + ClassDB::bind_method( _MD("project_local_ray_normal","screen_point"), &Camera::project_local_ray_normal); + ClassDB::bind_method( _MD("project_ray_origin","screen_point"), &Camera::project_ray_origin); + ClassDB::bind_method( _MD("unproject_position","world_point"), &Camera::unproject_position); + ClassDB::bind_method( _MD("is_position_behind","world_point"), &Camera::is_position_behind); + ClassDB::bind_method( _MD("project_position","screen_point"), &Camera::project_position); + ClassDB::bind_method( _MD("set_perspective","fov","z_near","z_far"),&Camera::set_perspective ); + ClassDB::bind_method( _MD("set_orthogonal","size","z_near","z_far"),&Camera::set_orthogonal ); + ClassDB::bind_method( _MD("make_current"),&Camera::make_current ); + ClassDB::bind_method( _MD("clear_current"),&Camera::clear_current ); + ClassDB::bind_method( _MD("is_current"),&Camera::is_current ); + ClassDB::bind_method( _MD("get_camera_transform"),&Camera::get_camera_transform ); + ClassDB::bind_method( _MD("get_fov"),&Camera::get_fov ); + ClassDB::bind_method( _MD("get_size"),&Camera::get_size ); + ClassDB::bind_method( _MD("get_zfar"),&Camera::get_zfar ); + ClassDB::bind_method( _MD("get_znear"),&Camera::get_znear ); + ClassDB::bind_method( _MD("get_projection"),&Camera::get_projection ); + ClassDB::bind_method( _MD("set_h_offset","ofs"),&Camera::set_h_offset ); + ClassDB::bind_method( _MD("get_h_offset"),&Camera::get_h_offset ); + ClassDB::bind_method( _MD("set_v_offset","ofs"),&Camera::set_v_offset ); + ClassDB::bind_method( _MD("get_v_offset"),&Camera::get_v_offset ); + ClassDB::bind_method( _MD("set_cull_mask","mask"),&Camera::set_cull_mask ); + ClassDB::bind_method( _MD("get_cull_mask"),&Camera::get_cull_mask ); + ClassDB::bind_method( _MD("set_environment","env:Environment"),&Camera::set_environment ); + ClassDB::bind_method( _MD("get_environment:Environment"),&Camera::get_environment ); + ClassDB::bind_method( _MD("set_keep_aspect_mode","mode"),&Camera::set_keep_aspect_mode ); + ClassDB::bind_method( _MD("get_keep_aspect_mode"),&Camera::get_keep_aspect_mode ); + //ClassDB::bind_method( _MD("_camera_make_current"),&Camera::_camera_make_current ); BIND_CONSTANT( PROJECTION_PERSPECTIVE ); BIND_CONSTANT( PROJECTION_ORTHOGONAL ); @@ -694,13 +609,13 @@ Camera::Projection Camera::get_projection() const { return mode; } -void Camera::set_visible_layers(uint32_t p_layers) { +void Camera::set_cull_mask(uint32_t p_layers) { layers=p_layers; - VisualServer::get_singleton()->camera_set_visible_layers(camera,layers); + VisualServer::get_singleton()->camera_set_cull_mask(camera,layers); } -uint32_t Camera::get_visible_layers() const{ +uint32_t Camera::get_cull_mask() const{ return layers; } @@ -761,7 +676,7 @@ Camera::Camera() { layers=0xfffff; v_offset=0; h_offset=0; - VisualServer::get_singleton()->camera_set_visible_layers(camera,layers); + VisualServer::get_singleton()->camera_set_cull_mask(camera,layers); //active=false; } diff --git a/scene/3d/camera.h b/scene/3d/camera.h index 30c6928245..5301c06ee5 100644 --- a/scene/3d/camera.h +++ b/scene/3d/camera.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -38,7 +38,7 @@ */ class Camera : public Spatial { - OBJ_TYPE( Camera, Spatial ); + GDCLASS( Camera, Spatial ); public: enum Projection { @@ -75,7 +75,7 @@ private: Ref<Environment> environment; virtual bool _can_gizmo_scale() const; - virtual RES _get_gizmo_geometry() const; + //void _camera_make_current(Node *p_camera); @@ -126,8 +126,8 @@ public: bool is_position_behind(const Vector3& p_pos) const; Vector3 project_position(const Point2& p_point) const; - void set_visible_layers(uint32_t p_layers); - uint32_t get_visible_layers() const; + void set_cull_mask(uint32_t p_layers); + uint32_t get_cull_mask() const; Vector<Plane> get_frustum() const; diff --git a/scene/3d/character_camera.cpp b/scene/3d/character_camera.cpp index fc3dfcd645..b4cd46bd35 100644 --- a/scene/3d/character_camera.cpp +++ b/scene/3d/character_camera.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -255,8 +255,8 @@ void CharacterCamera::_compute_camera() { orbit.x=max_orbit_x; Matrix3 m; - m.rotate(Vector3(0,1,0),Math::deg2rad(orbit.y)); - m.rotate(Vector3(1,0,0),Math::deg2rad(orbit.x)); + m.rotate(Vector3(0,1,0),-Math::deg2rad(orbit.y)); + m.rotate(Vector3(1,0,0),-Math::deg2rad(orbit.x)); new_pos = (m.get_axis(2) * distance) + character_pos; @@ -432,8 +432,8 @@ void CharacterCamera::set_orbit(const Vector2& p_orbit) { float d = char_pos.distance_to(follow_pos); Matrix3 m; - m.rotate(Vector3(0,1,0),orbit.y); - m.rotate(Vector3(1,0,0),orbit.x); + m.rotate(Vector3(0,1,0),-orbit.y); + m.rotate(Vector3(1,0,0),-orbit.x); follow_pos=char_pos + m.get_axis(2) * d; @@ -475,8 +475,8 @@ void CharacterCamera::rotate_orbit(const Vector2& p_relative) { if (type == CAMERA_FOLLOW && is_inside_scene()) { Matrix3 m; - m.rotate(Vector3(0,1,0),Math::deg2rad(p_relative.y)); - m.rotate(Vector3(1,0,0),Math::deg2rad(p_relative.x)); + m.rotate(Vector3(0,1,0),-Math::deg2rad(p_relative.y)); + m.rotate(Vector3(1,0,0),-Math::deg2rad(p_relative.x)); Vector3 char_pos = get_global_transform().origin; char_pos.y+=height; @@ -634,30 +634,30 @@ float CharacterCamera::get_autoturn_speed() const { void CharacterCamera::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_camera_type","type"),&CharacterCamera::set_camera_type); - ObjectTypeDB::bind_method(_MD("get_camera_type"),&CharacterCamera::get_camera_type); - ObjectTypeDB::bind_method(_MD("set_orbit","orbit"),&CharacterCamera::set_orbit); - ObjectTypeDB::bind_method(_MD("get_orbit"),&CharacterCamera::get_orbit); - ObjectTypeDB::bind_method(_MD("set_orbit_x","x"),&CharacterCamera::set_orbit_x); - ObjectTypeDB::bind_method(_MD("set_orbit_y","y"),&CharacterCamera::set_orbit_y); - ObjectTypeDB::bind_method(_MD("set_min_orbit_x","x"),&CharacterCamera::set_min_orbit_x); - ObjectTypeDB::bind_method(_MD("get_min_orbit_x"),&CharacterCamera::get_min_orbit_x); - ObjectTypeDB::bind_method(_MD("set_max_orbit_x","x"),&CharacterCamera::set_max_orbit_x); - ObjectTypeDB::bind_method(_MD("get_max_orbit_x"),&CharacterCamera::get_max_orbit_x); - ObjectTypeDB::bind_method(_MD("rotate_orbit"),&CharacterCamera::rotate_orbit); - ObjectTypeDB::bind_method(_MD("set_distance","distance"),&CharacterCamera::set_distance); - ObjectTypeDB::bind_method(_MD("get_distance"),&CharacterCamera::get_distance); - ObjectTypeDB::bind_method(_MD("set_clip","enable"),&CharacterCamera::set_clip); - ObjectTypeDB::bind_method(_MD("has_clip"),&CharacterCamera::has_clip); - ObjectTypeDB::bind_method(_MD("set_autoturn","enable"),&CharacterCamera::set_autoturn); - ObjectTypeDB::bind_method(_MD("has_autoturn"),&CharacterCamera::has_autoturn); - ObjectTypeDB::bind_method(_MD("set_autoturn_tolerance","degrees"),&CharacterCamera::set_autoturn_tolerance); - ObjectTypeDB::bind_method(_MD("get_autoturn_tolerance"),&CharacterCamera::get_autoturn_tolerance); - ObjectTypeDB::bind_method(_MD("set_autoturn_speed","speed"),&CharacterCamera::set_autoturn_speed); - ObjectTypeDB::bind_method(_MD("get_autoturn_speed"),&CharacterCamera::get_autoturn_speed); - ObjectTypeDB::bind_method(_MD("set_use_lookat_target","use","lookat"),&CharacterCamera::set_use_lookat_target, DEFVAL(Vector3())); - - ObjectTypeDB::bind_method(_MD("_ray_collision"),&CharacterCamera::_ray_collision); + ClassDB::bind_method(_MD("set_camera_type","type"),&CharacterCamera::set_camera_type); + ClassDB::bind_method(_MD("get_camera_type"),&CharacterCamera::get_camera_type); + ClassDB::bind_method(_MD("set_orbit","orbit"),&CharacterCamera::set_orbit); + ClassDB::bind_method(_MD("get_orbit"),&CharacterCamera::get_orbit); + ClassDB::bind_method(_MD("set_orbit_x","x"),&CharacterCamera::set_orbit_x); + ClassDB::bind_method(_MD("set_orbit_y","y"),&CharacterCamera::set_orbit_y); + ClassDB::bind_method(_MD("set_min_orbit_x","x"),&CharacterCamera::set_min_orbit_x); + ClassDB::bind_method(_MD("get_min_orbit_x"),&CharacterCamera::get_min_orbit_x); + ClassDB::bind_method(_MD("set_max_orbit_x","x"),&CharacterCamera::set_max_orbit_x); + ClassDB::bind_method(_MD("get_max_orbit_x"),&CharacterCamera::get_max_orbit_x); + ClassDB::bind_method(_MD("rotate_orbit"),&CharacterCamera::rotate_orbit); + ClassDB::bind_method(_MD("set_distance","distance"),&CharacterCamera::set_distance); + ClassDB::bind_method(_MD("get_distance"),&CharacterCamera::get_distance); + ClassDB::bind_method(_MD("set_clip","enable"),&CharacterCamera::set_clip); + ClassDB::bind_method(_MD("has_clip"),&CharacterCamera::has_clip); + ClassDB::bind_method(_MD("set_autoturn","enable"),&CharacterCamera::set_autoturn); + ClassDB::bind_method(_MD("has_autoturn"),&CharacterCamera::has_autoturn); + ClassDB::bind_method(_MD("set_autoturn_tolerance","degrees"),&CharacterCamera::set_autoturn_tolerance); + ClassDB::bind_method(_MD("get_autoturn_tolerance"),&CharacterCamera::get_autoturn_tolerance); + ClassDB::bind_method(_MD("set_autoturn_speed","speed"),&CharacterCamera::set_autoturn_speed); + ClassDB::bind_method(_MD("get_autoturn_speed"),&CharacterCamera::get_autoturn_speed); + ClassDB::bind_method(_MD("set_use_lookat_target","use","lookat"),&CharacterCamera::set_use_lookat_target, DEFVAL(Vector3())); + + ClassDB::bind_method(_MD("_ray_collision"),&CharacterCamera::_ray_collision); BIND_CONSTANT( CAMERA_FIXED ); BIND_CONSTANT( CAMERA_FOLLOW ); diff --git a/scene/3d/character_camera.h b/scene/3d/character_camera.h index d636b4b1a5..5fde8c342e 100644 --- a/scene/3d/character_camera.h +++ b/scene/3d/character_camera.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ #if 0 class CharacterCamera : public Camera { - OBJ_TYPE( CharacterCamera, Camera ); + GDCLASS( CharacterCamera, Camera ); public: enum CameraType { diff --git a/scene/3d/collision_object.cpp b/scene/3d/collision_object.cpp index 373c356a45..29df7e6395 100644 --- a/scene/3d/collision_object.cpp +++ b/scene/3d/collision_object.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -228,30 +228,30 @@ bool CollisionObject::is_ray_pickable() const { void CollisionObject::_bind_methods() { - ObjectTypeDB::bind_method(_MD("add_shape","shape:Shape","transform"),&CollisionObject::add_shape,DEFVAL(Transform())); - ObjectTypeDB::bind_method(_MD("get_shape_count"),&CollisionObject::get_shape_count); - ObjectTypeDB::bind_method(_MD("set_shape","shape_idx","shape:Shape"),&CollisionObject::set_shape); - ObjectTypeDB::bind_method(_MD("set_shape_transform","shape_idx","transform"),&CollisionObject::set_shape_transform); -// ObjectTypeDB::bind_method(_MD("set_shape_transform","shape_idx","transform"),&CollisionObject::set_shape_transform); - ObjectTypeDB::bind_method(_MD("set_shape_as_trigger","shape_idx","enable"),&CollisionObject::set_shape_as_trigger); - ObjectTypeDB::bind_method(_MD("is_shape_set_as_trigger","shape_idx"),&CollisionObject::is_shape_set_as_trigger); - ObjectTypeDB::bind_method(_MD("get_shape:Shape","shape_idx"),&CollisionObject::get_shape); - ObjectTypeDB::bind_method(_MD("get_shape_transform","shape_idx"),&CollisionObject::get_shape_transform); - ObjectTypeDB::bind_method(_MD("remove_shape","shape_idx"),&CollisionObject::remove_shape); - ObjectTypeDB::bind_method(_MD("clear_shapes"),&CollisionObject::clear_shapes); - ObjectTypeDB::bind_method(_MD("set_ray_pickable","ray_pickable"),&CollisionObject::set_ray_pickable); - ObjectTypeDB::bind_method(_MD("is_ray_pickable"),&CollisionObject::is_ray_pickable); - ObjectTypeDB::bind_method(_MD("set_capture_input_on_drag","enable"),&CollisionObject::set_capture_input_on_drag); - ObjectTypeDB::bind_method(_MD("get_capture_input_on_drag"),&CollisionObject::get_capture_input_on_drag); - ObjectTypeDB::bind_method(_MD("get_rid"),&CollisionObject::get_rid); + ClassDB::bind_method(_MD("add_shape","shape:Shape","transform"),&CollisionObject::add_shape,DEFVAL(Transform())); + ClassDB::bind_method(_MD("get_shape_count"),&CollisionObject::get_shape_count); + ClassDB::bind_method(_MD("set_shape","shape_idx","shape:Shape"),&CollisionObject::set_shape); + ClassDB::bind_method(_MD("set_shape_transform","shape_idx","transform"),&CollisionObject::set_shape_transform); +// ClassDB::bind_method(_MD("set_shape_transform","shape_idx","transform"),&CollisionObject::set_shape_transform); + ClassDB::bind_method(_MD("set_shape_as_trigger","shape_idx","enable"),&CollisionObject::set_shape_as_trigger); + ClassDB::bind_method(_MD("is_shape_set_as_trigger","shape_idx"),&CollisionObject::is_shape_set_as_trigger); + ClassDB::bind_method(_MD("get_shape:Shape","shape_idx"),&CollisionObject::get_shape); + ClassDB::bind_method(_MD("get_shape_transform","shape_idx"),&CollisionObject::get_shape_transform); + ClassDB::bind_method(_MD("remove_shape","shape_idx"),&CollisionObject::remove_shape); + ClassDB::bind_method(_MD("clear_shapes"),&CollisionObject::clear_shapes); + ClassDB::bind_method(_MD("set_ray_pickable","ray_pickable"),&CollisionObject::set_ray_pickable); + ClassDB::bind_method(_MD("is_ray_pickable"),&CollisionObject::is_ray_pickable); + ClassDB::bind_method(_MD("set_capture_input_on_drag","enable"),&CollisionObject::set_capture_input_on_drag); + ClassDB::bind_method(_MD("get_capture_input_on_drag"),&CollisionObject::get_capture_input_on_drag); + ClassDB::bind_method(_MD("get_rid"),&CollisionObject::get_rid); BIND_VMETHOD( MethodInfo("_input_event",PropertyInfo(Variant::OBJECT,"camera"),PropertyInfo(Variant::INPUT_EVENT,"event"),PropertyInfo(Variant::VECTOR3,"click_pos"),PropertyInfo(Variant::VECTOR3,"click_normal"),PropertyInfo(Variant::INT,"shape_idx"))); ADD_SIGNAL( MethodInfo("input_event",PropertyInfo(Variant::OBJECT,"camera"),PropertyInfo(Variant::INPUT_EVENT,"event"),PropertyInfo(Variant::VECTOR3,"click_pos"),PropertyInfo(Variant::VECTOR3,"click_normal"),PropertyInfo(Variant::INT,"shape_idx"))); ADD_SIGNAL( MethodInfo("mouse_enter")); ADD_SIGNAL( MethodInfo("mouse_exit")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"input/ray_pickable"),_SCS("set_ray_pickable"),_SCS("is_ray_pickable")); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"input/capture_on_drag"),_SCS("set_capture_input_on_drag"),_SCS("get_capture_input_on_drag")); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"input_ray_pickable"),_SCS("set_ray_pickable"),_SCS("is_ray_pickable")); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"input_capture_on_drag"),_SCS("set_capture_input_on_drag"),_SCS("get_capture_input_on_drag")); } diff --git a/scene/3d/collision_object.h b/scene/3d/collision_object.h index f8daeb3ed2..b89b7e3361 100644 --- a/scene/3d/collision_object.h +++ b/scene/3d/collision_object.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class CollisionObject : public Spatial { - OBJ_TYPE( CollisionObject, Spatial ); + GDCLASS( CollisionObject, Spatial ); bool area; RID rid; diff --git a/scene/3d/collision_polygon.cpp b/scene/3d/collision_polygon.cpp index 2948966fb3..d0612986df 100644 --- a/scene/3d/collision_polygon.cpp +++ b/scene/3d/collision_polygon.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -56,11 +56,11 @@ void CollisionPolygon::_add_to_collision_object(Object *p_obj) { shape_from=co->get_shape_count(); for(int i=0;i<decomp.size();i++) { Ref<ConvexPolygonShape> convex = memnew( ConvexPolygonShape ); - DVector<Vector3> cp; + PoolVector<Vector3> cp; int cs = decomp[i].size(); cp.resize(cs*2); { - DVector<Vector3>::Write w = cp.write(); + PoolVector<Vector3>::Write w = cp.write(); int idx=0; for(int j=0;j<cs;j++) { @@ -84,16 +84,16 @@ void CollisionPolygon::_add_to_collision_object(Object *p_obj) { #if 0 Ref<ConcavePolygonShape> concave = memnew( ConcavePolygonShape ); - DVector<Vector2> segments; + PoolVector<Vector2> segments; segments.resize(polygon.size()*2); - DVector<Vector2>::Write w=segments.write(); + PoolVector<Vector2>::Write w=segments.write(); for(int i=0;i<polygon.size();i++) { w[(i<<1)+0]=polygon[i]; w[(i<<1)+1]=polygon[(i+1)%polygon.size()]; } - w=DVector<Vector2>::Write(); + w=PoolVector<Vector2>::Write(); concave->set_segments(segments); co->add_shape(concave,get_transform()); @@ -200,7 +200,7 @@ void CollisionPolygon::set_polygon(const Vector<Point2>& p_polygon) { Vector3 p1(polygon[i].x,polygon[i].y,depth*0.5); if (i==0) - aabb=AABB(p1,Vector3()); + aabb=Rect3(p1,Vector3()); else aabb.expand_to(p1); @@ -209,9 +209,9 @@ void CollisionPolygon::set_polygon(const Vector<Point2>& p_polygon) { } - if (aabb==AABB()) { + if (aabb==Rect3()) { - aabb=AABB(Vector3(-1,-1,-1),Vector3(2,2,2)); + aabb=Rect3(Vector3(-1,-1,-1),Vector3(2,2,2)); } else { aabb.pos-=aabb.size*0.3; aabb.size+=aabb.size*0.6; @@ -240,7 +240,7 @@ CollisionPolygon::BuildMode CollisionPolygon::get_build_mode() const{ return build_mode; } -AABB CollisionPolygon::get_item_rect() const { +Rect3 CollisionPolygon::get_item_rect() const { return aabb; } @@ -275,26 +275,26 @@ String CollisionPolygon::get_configuration_warning() const { void CollisionPolygon::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_add_to_collision_object"),&CollisionPolygon::_add_to_collision_object); + ClassDB::bind_method(_MD("_add_to_collision_object"),&CollisionPolygon::_add_to_collision_object); - ObjectTypeDB::bind_method(_MD("set_build_mode","build_mode"),&CollisionPolygon::set_build_mode); - ObjectTypeDB::bind_method(_MD("get_build_mode"),&CollisionPolygon::get_build_mode); + ClassDB::bind_method(_MD("set_build_mode","build_mode"),&CollisionPolygon::set_build_mode); + ClassDB::bind_method(_MD("get_build_mode"),&CollisionPolygon::get_build_mode); - ObjectTypeDB::bind_method(_MD("set_depth","depth"),&CollisionPolygon::set_depth); - ObjectTypeDB::bind_method(_MD("get_depth"),&CollisionPolygon::get_depth); + ClassDB::bind_method(_MD("set_depth","depth"),&CollisionPolygon::set_depth); + ClassDB::bind_method(_MD("get_depth"),&CollisionPolygon::get_depth); - ObjectTypeDB::bind_method(_MD("set_polygon","polygon"),&CollisionPolygon::set_polygon); - ObjectTypeDB::bind_method(_MD("get_polygon"),&CollisionPolygon::get_polygon); + ClassDB::bind_method(_MD("set_polygon","polygon"),&CollisionPolygon::set_polygon); + ClassDB::bind_method(_MD("get_polygon"),&CollisionPolygon::get_polygon); - ObjectTypeDB::bind_method(_MD("_set_shape_range","shape_range"),&CollisionPolygon::_set_shape_range); - ObjectTypeDB::bind_method(_MD("_get_shape_range"),&CollisionPolygon::_get_shape_range); + ClassDB::bind_method(_MD("_set_shape_range","shape_range"),&CollisionPolygon::_set_shape_range); + ClassDB::bind_method(_MD("_get_shape_range"),&CollisionPolygon::_get_shape_range); - ObjectTypeDB::bind_method(_MD("get_collision_object_first_shape"),&CollisionPolygon::get_collision_object_first_shape); - ObjectTypeDB::bind_method(_MD("get_collision_object_last_shape"),&CollisionPolygon::get_collision_object_last_shape); + ClassDB::bind_method(_MD("get_collision_object_first_shape"),&CollisionPolygon::get_collision_object_first_shape); + ClassDB::bind_method(_MD("get_collision_object_last_shape"),&CollisionPolygon::get_collision_object_last_shape); ADD_PROPERTY( PropertyInfo(Variant::INT,"build_mode",PROPERTY_HINT_ENUM,"Solids,Triangles"),_SCS("set_build_mode"),_SCS("get_build_mode")); ADD_PROPERTY( PropertyInfo(Variant::REAL,"depth"),_SCS("set_depth"),_SCS("get_depth")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2_ARRAY,"polygon"),_SCS("set_polygon"),_SCS("get_polygon")); + ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"polygon"),_SCS("set_polygon"),_SCS("get_polygon")); ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"shape_range",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_shape_range"),_SCS("_get_shape_range")); } @@ -304,7 +304,7 @@ CollisionPolygon::CollisionPolygon() { shape_to=-1; can_update_body=false; - aabb=AABB(Vector3(-1,-1,-1),Vector3(2,2,2)); + aabb=Rect3(Vector3(-1,-1,-1),Vector3(2,2,2)); build_mode=BUILD_SOLIDS; depth=1.0; diff --git a/scene/3d/collision_polygon.h b/scene/3d/collision_polygon.h index 63ff3e84e4..693cf0640a 100644 --- a/scene/3d/collision_polygon.h +++ b/scene/3d/collision_polygon.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ class CollisionPolygon : public Spatial { - OBJ_TYPE(CollisionPolygon,Spatial); + GDCLASS(CollisionPolygon,Spatial); public: enum BuildMode { @@ -48,7 +48,7 @@ protected: float depth; - AABB aabb; + Rect3 aabb; BuildMode build_mode; Vector<Point2> polygon; @@ -78,7 +78,7 @@ public: void set_polygon(const Vector<Point2>& p_polygon); Vector<Point2> get_polygon() const; - virtual AABB get_item_rect() const; + virtual Rect3 get_item_rect() const; int get_collision_object_first_shape() const { return shape_from; } int get_collision_object_last_shape() const { return shape_to; } diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp new file mode 100644 index 0000000000..13e7c175ed --- /dev/null +++ b/scene/3d/gi_probe.cpp @@ -0,0 +1,1407 @@ +#include "gi_probe.h" +#include "mesh_instance.h" + + +void GIProbeData::set_bounds(const Rect3& p_bounds) { + + VS::get_singleton()->gi_probe_set_bounds(probe,p_bounds); +} + +Rect3 GIProbeData::get_bounds() const{ + + return VS::get_singleton()->gi_probe_get_bounds(probe); +} + +void GIProbeData::set_cell_size(float p_size) { + + VS::get_singleton()->gi_probe_set_cell_size(probe,p_size); + +} + +float GIProbeData::get_cell_size() const { + + return VS::get_singleton()->gi_probe_get_cell_size(probe); + +} + +void GIProbeData::set_to_cell_xform(const Transform& p_xform) { + + VS::get_singleton()->gi_probe_set_to_cell_xform(probe,p_xform); + +} + +Transform GIProbeData::get_to_cell_xform() const { + + return VS::get_singleton()->gi_probe_get_to_cell_xform(probe); + +} + + +void GIProbeData::set_dynamic_data(const PoolVector<int>& p_data){ + + VS::get_singleton()->gi_probe_set_dynamic_data(probe,p_data); + +} +PoolVector<int> GIProbeData::get_dynamic_data() const{ + + return VS::get_singleton()->gi_probe_get_dynamic_data(probe); +} + +void GIProbeData::set_dynamic_range(int p_range){ + + VS::get_singleton()->gi_probe_set_dynamic_range(probe,p_range); + +} + +void GIProbeData::set_energy(float p_range) { + + VS::get_singleton()->gi_probe_set_energy(probe,p_range); +} + +float GIProbeData::get_energy() const{ + + return VS::get_singleton()->gi_probe_get_energy(probe); + +} + +void GIProbeData::set_interior(bool p_enable) { + + VS::get_singleton()->gi_probe_set_interior(probe,p_enable); + +} + +bool GIProbeData::is_interior() const{ + + return VS::get_singleton()->gi_probe_is_interior(probe); +} + + +bool GIProbeData::is_compressed() const{ + + return VS::get_singleton()->gi_probe_is_compressed(probe); +} + + +void GIProbeData::set_compress(bool p_enable) { + + VS::get_singleton()->gi_probe_set_compress(probe,p_enable); + +} + +int GIProbeData::get_dynamic_range() const{ + + + return VS::get_singleton()->gi_probe_get_dynamic_range(probe); +} + + +RID GIProbeData::get_rid() const { + + return probe; +} + + +void GIProbeData::_bind_methods() { + + ClassDB::bind_method(_MD("set_bounds","bounds"),&GIProbeData::set_bounds); + ClassDB::bind_method(_MD("get_bounds"),&GIProbeData::get_bounds); + + ClassDB::bind_method(_MD("set_cell_size","cell_size"),&GIProbeData::set_cell_size); + ClassDB::bind_method(_MD("get_cell_size"),&GIProbeData::get_cell_size); + + ClassDB::bind_method(_MD("set_to_cell_xform","to_cell_xform"),&GIProbeData::set_to_cell_xform); + ClassDB::bind_method(_MD("get_to_cell_xform"),&GIProbeData::get_to_cell_xform); + + ClassDB::bind_method(_MD("set_dynamic_data","dynamic_data"),&GIProbeData::set_dynamic_data); + ClassDB::bind_method(_MD("get_dynamic_data"),&GIProbeData::get_dynamic_data); + + ClassDB::bind_method(_MD("set_dynamic_range","dynamic_range"),&GIProbeData::set_dynamic_range); + ClassDB::bind_method(_MD("get_dynamic_range"),&GIProbeData::get_dynamic_range); + + ClassDB::bind_method(_MD("set_energy","energy"),&GIProbeData::set_energy); + ClassDB::bind_method(_MD("get_energy"),&GIProbeData::get_energy); + + ClassDB::bind_method(_MD("set_interior","interior"),&GIProbeData::set_interior); + ClassDB::bind_method(_MD("is_interior"),&GIProbeData::is_interior); + + ClassDB::bind_method(_MD("set_compress","compress"),&GIProbeData::set_compress); + ClassDB::bind_method(_MD("is_compressed"),&GIProbeData::is_compressed); + + ADD_PROPERTY(PropertyInfo(Variant::RECT3,"bounds",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_bounds"),_SCS("get_bounds")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"cell_size",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_cell_size"),_SCS("get_cell_size")); + ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM,"to_cell_xform",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_to_cell_xform"),_SCS("get_to_cell_xform")); + + ADD_PROPERTY(PropertyInfo(Variant::POOL_INT_ARRAY,"dynamic_data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_dynamic_data"),_SCS("get_dynamic_data")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"dynamic_range",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_dynamic_range"),_SCS("get_dynamic_range")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"energy",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_energy"),_SCS("get_energy")); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"interior",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_interior"),_SCS("is_interior")); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"compress",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_compress"),_SCS("is_compressed")); + +} + +GIProbeData::GIProbeData() { + + probe=VS::get_singleton()->gi_probe_create(); +} + +GIProbeData::~GIProbeData() { + + VS::get_singleton()->free(probe); +} + + +////////////////////// +////////////////////// + + +void GIProbe::set_probe_data(const Ref<GIProbeData>& p_data) { + + if (p_data.is_valid()) { + VS::get_singleton()->instance_set_base(get_instance(),p_data->get_rid()); + } else { + VS::get_singleton()->instance_set_base(get_instance(),RID()); + } + + probe_data=p_data; +} + +Ref<GIProbeData> GIProbe::get_probe_data() const { + + return probe_data; +} + +void GIProbe::set_subdiv(Subdiv p_subdiv) { + + ERR_FAIL_INDEX(p_subdiv,SUBDIV_MAX); + subdiv=p_subdiv; + update_gizmo(); +} + +GIProbe::Subdiv GIProbe::get_subdiv() const { + + return subdiv; +} + +void GIProbe::set_extents(const Vector3& p_extents) { + + extents=p_extents; + update_gizmo(); +} + +Vector3 GIProbe::get_extents() const { + + return extents; +} + +void GIProbe::set_dynamic_range(int p_dynamic_range) { + + dynamic_range=p_dynamic_range; +} +int GIProbe::get_dynamic_range() const { + + return dynamic_range; +} + +void GIProbe::set_energy(float p_energy) { + + energy=p_energy; + if (probe_data.is_valid()) { + probe_data->set_energy(energy); + } +} +float GIProbe::get_energy() const { + + return energy; +} + +void GIProbe::set_interior(bool p_enable) { + + interior=p_enable; + if (probe_data.is_valid()) { + probe_data->set_interior(p_enable); + } +} + +bool GIProbe::is_interior() const { + + return interior; +} + + +void GIProbe::set_compress(bool p_enable) { + + compress=p_enable; + if (probe_data.is_valid()) { + probe_data->set_compress(p_enable); + } +} + +bool GIProbe::is_compressed() const { + + return compress; +} + + +#include "math.h" + +#define FINDMINMAX(x0,x1,x2,min,max) \ + min = max = x0; \ + if(x1<min) min=x1;\ + if(x1>max) max=x1;\ + if(x2<min) min=x2;\ + if(x2>max) max=x2; + +static bool planeBoxOverlap(Vector3 normal,float d, Vector3 maxbox) +{ + int q; + Vector3 vmin,vmax; + for(q=0;q<=2;q++) + { + if(normal[q]>0.0f) + { + vmin[q]=-maxbox[q]; + vmax[q]=maxbox[q]; + } + else + { + vmin[q]=maxbox[q]; + vmax[q]=-maxbox[q]; + } + } + if(normal.dot(vmin)+d>0.0f) return false; + if(normal.dot(vmax)+d>=0.0f) return true; + + return false; +} + + +/*======================== X-tests ========================*/ +#define AXISTEST_X01(a, b, fa, fb) \ + p0 = a*v0.y - b*v0.z; \ + p2 = a*v2.y - b*v2.z; \ + if(p0<p2) {min=p0; max=p2;} else {min=p2; max=p0;} \ + rad = fa * boxhalfsize.y + fb * boxhalfsize.z; \ + if(min>rad || max<-rad) return false; + +#define AXISTEST_X2(a, b, fa, fb) \ + p0 = a*v0.y - b*v0.z; \ + p1 = a*v1.y - b*v1.z; \ + if(p0<p1) {min=p0; max=p1;} else {min=p1; max=p0;} \ + rad = fa * boxhalfsize.y + fb * boxhalfsize.z; \ + if(min>rad || max<-rad) return false; + +/*======================== Y-tests ========================*/ +#define AXISTEST_Y02(a, b, fa, fb) \ + p0 = -a*v0.x + b*v0.z; \ + p2 = -a*v2.x + b*v2.z; \ + if(p0<p2) {min=p0; max=p2;} else {min=p2; max=p0;} \ + rad = fa * boxhalfsize.x + fb * boxhalfsize.z; \ + if(min>rad || max<-rad) return false; + +#define AXISTEST_Y1(a, b, fa, fb) \ + p0 = -a*v0.x + b*v0.z; \ + p1 = -a*v1.x + b*v1.z; \ + if(p0<p1) {min=p0; max=p1;} else {min=p1; max=p0;} \ + rad = fa * boxhalfsize.x + fb * boxhalfsize.z; \ + if(min>rad || max<-rad) return false; + +/*======================== Z-tests ========================*/ + +#define AXISTEST_Z12(a, b, fa, fb) \ + p1 = a*v1.x - b*v1.y; \ + p2 = a*v2.x - b*v2.y; \ + if(p2<p1) {min=p2; max=p1;} else {min=p1; max=p2;} \ + rad = fa * boxhalfsize.x + fb * boxhalfsize.y; \ + if(min>rad || max<-rad) return false; + +#define AXISTEST_Z0(a, b, fa, fb) \ + p0 = a*v0.x - b*v0.y; \ + p1 = a*v1.x - b*v1.y; \ + if(p0<p1) {min=p0; max=p1;} else {min=p1; max=p0;} \ + rad = fa * boxhalfsize.x + fb * boxhalfsize.y; \ + if(min>rad || max<-rad) return false; + +static bool fast_tri_box_overlap(const Vector3& boxcenter,const Vector3 boxhalfsize,const Vector3 *triverts) { + + /* use separating axis theorem to test overlap between triangle and box */ + /* need to test for overlap in these directions: */ + /* 1) the {x,y,z}-directions (actually, since we use the AABB of the triangle */ + /* we do not even need to test these) */ + /* 2) normal of the triangle */ + /* 3) crossproduct(edge from tri, {x,y,z}-directin) */ + /* this gives 3x3=9 more tests */ + Vector3 v0,v1,v2; + float min,max,d,p0,p1,p2,rad,fex,fey,fez; + Vector3 normal,e0,e1,e2; + + /* This is the fastest branch on Sun */ + /* move everything so that the boxcenter is in (0,0,0) */ + + v0=triverts[0]-boxcenter; + v1=triverts[1]-boxcenter; + v2=triverts[2]-boxcenter; + + /* compute triangle edges */ + e0=v1-v0; /* tri edge 0 */ + e1=v2-v1; /* tri edge 1 */ + e2=v0-v2; /* tri edge 2 */ + + /* Bullet 3: */ + /* test the 9 tests first (this was faster) */ + fex = Math::abs(e0.x); + fey = Math::abs(e0.y); + fez = Math::abs(e0.z); + AXISTEST_X01(e0.z, e0.y, fez, fey); + AXISTEST_Y02(e0.z, e0.x, fez, fex); + AXISTEST_Z12(e0.y, e0.x, fey, fex); + + fex = Math::abs(e1.x); + fey = Math::abs(e1.y); + fez = Math::abs(e1.z); + AXISTEST_X01(e1.z, e1.y, fez, fey); + AXISTEST_Y02(e1.z, e1.x, fez, fex); + AXISTEST_Z0(e1.y, e1.x, fey, fex); + + fex = Math::abs(e2.x); + fey = Math::abs(e2.y); + fez = Math::abs(e2.z); + AXISTEST_X2(e2.z, e2.y, fez, fey); + AXISTEST_Y1(e2.z, e2.x, fez, fex); + AXISTEST_Z12(e2.y, e2.x, fey, fex); + + /* Bullet 1: */ + /* first test overlap in the {x,y,z}-directions */ + /* find min, max of the triangle each direction, and test for overlap in */ + /* that direction -- this is equivalent to testing a minimal AABB around */ + /* the triangle against the AABB */ + + /* test in X-direction */ + FINDMINMAX(v0.x,v1.x,v2.x,min,max); + if(min>boxhalfsize.x || max<-boxhalfsize.x) return false; + + /* test in Y-direction */ + FINDMINMAX(v0.y,v1.y,v2.y,min,max); + if(min>boxhalfsize.y || max<-boxhalfsize.y) return false; + + /* test in Z-direction */ + FINDMINMAX(v0.z,v1.z,v2.z,min,max); + if(min>boxhalfsize.z || max<-boxhalfsize.z) return false; + + /* Bullet 2: */ + /* test if the box intersects the plane of the triangle */ + /* compute plane equation of triangle: normal*x+d=0 */ + normal=e0.cross(e1); + d=-normal.dot(v0); /* plane eq: normal.x+d=0 */ + if(!planeBoxOverlap(normal,d,boxhalfsize)) return false; + + return true; /* box and triangle overlaps */ +} + + + +static _FORCE_INLINE_ Vector2 get_uv(const Vector3& p_pos, const Vector3 *p_vtx, const Vector2* p_uv) { + + if (p_pos.distance_squared_to(p_vtx[0])<CMP_EPSILON2) + return p_uv[0]; + if (p_pos.distance_squared_to(p_vtx[1])<CMP_EPSILON2) + return p_uv[1]; + if (p_pos.distance_squared_to(p_vtx[2])<CMP_EPSILON2) + return p_uv[2]; + + Vector3 v0 = p_vtx[1] - p_vtx[0]; + Vector3 v1 = p_vtx[2] - p_vtx[0]; + Vector3 v2 = p_pos - p_vtx[0]; + + float d00 = v0.dot( v0); + float d01 = v0.dot( v1); + float d11 = v1.dot( v1); + float d20 = v2.dot( v0); + float d21 = v2.dot( v1); + float denom = (d00 * d11 - d01 * d01); + if (denom==0) + return p_uv[0]; + float v = (d11 * d20 - d01 * d21) / denom; + float w = (d00 * d21 - d01 * d20) / denom; + float u = 1.0f - v - w; + + return p_uv[0]*u + p_uv[1]*v + p_uv[2]*w; +} + +void GIProbe::_plot_face(int p_idx, int p_level,int p_x,int p_y,int p_z, const Vector3 *p_vtx, const Vector2* p_uv, const Baker::MaterialCache& p_material, const Rect3 &p_aabb,Baker *p_baker) { + + + + if (p_level==p_baker->cell_subdiv-1) { + //plot the face by guessing it's albedo and emission value + + //find best axis to map to, for scanning values + int closest_axis; + float closest_dot; + + Vector3 normal = Plane(p_vtx[0],p_vtx[1],p_vtx[2]).normal; + + for(int i=0;i<3;i++) { + + Vector3 axis; + axis[i]=1.0; + float dot=ABS(normal.dot(axis)); + if (i==0 || dot>closest_dot) { + closest_axis=i; + closest_dot=dot; + } + } + + Vector3 axis; + axis[closest_axis]=1.0; + Vector3 t1; + t1[(closest_axis+1)%3]=1.0; + Vector3 t2; + t2[(closest_axis+2)%3]=1.0; + + t1*=p_aabb.size[(closest_axis+1)%3]/float(color_scan_cell_width); + t2*=p_aabb.size[(closest_axis+2)%3]/float(color_scan_cell_width); + + Color albedo_accum; + Color emission_accum; + Vector3 normal_accum; + + float alpha=0.0; + + //map to a grid average in the best axis for this face + for(int i=0;i<color_scan_cell_width;i++) { + + Vector3 ofs_i=float(i)*t1; + + for(int j=0;j<color_scan_cell_width;j++) { + + Vector3 ofs_j=float(j)*t2; + + Vector3 from = p_aabb.pos+ofs_i+ofs_j; + Vector3 to = from + t1 + t2 + axis * p_aabb.size[closest_axis]; + Vector3 half = (to-from)*0.5; + + //is in this cell? + if (!fast_tri_box_overlap(from+half,half,p_vtx)) { + continue; //face does not span this cell + } + + //go from -size to +size*2 to avoid skipping collisions + Vector3 ray_from = from + (t1+t2)*0.5 - axis * p_aabb.size[closest_axis]; + Vector3 ray_to = ray_from + axis * p_aabb.size[closest_axis]*2; + + Vector3 intersection; + + if (!Geometry::ray_intersects_triangle(ray_from,ray_to,p_vtx[0],p_vtx[1],p_vtx[2],&intersection)) { + //no intersect? look in edges + + float closest_dist=1e20; + for(int j=0;j<3;j++) { + Vector3 c; + Vector3 inters; + Geometry::get_closest_points_between_segments(p_vtx[j],p_vtx[(j+1)%3],ray_from,ray_to,inters,c); + float d=c.distance_to(intersection); + if (j==0 || d<closest_dist) { + closest_dist=d; + intersection=inters; + } + } + } + + Vector2 uv = get_uv(intersection,p_vtx,p_uv); + + + int uv_x = CLAMP(Math::fposmod(uv.x,1.0)*bake_texture_size,0,bake_texture_size-1); + int uv_y = CLAMP(Math::fposmod(uv.y,1.0)*bake_texture_size,0,bake_texture_size-1); + + int ofs = uv_y*bake_texture_size+uv_x; + albedo_accum.r+=p_material.albedo[ofs].r; + albedo_accum.g+=p_material.albedo[ofs].g; + albedo_accum.b+=p_material.albedo[ofs].b; + albedo_accum.a+=p_material.albedo[ofs].a; + + emission_accum.r+=p_material.emission[ofs].r; + emission_accum.g+=p_material.emission[ofs].g; + emission_accum.b+=p_material.emission[ofs].b; + + normal_accum+=normal; + + alpha+=1.0; + + } + } + + + if (alpha==0) { + //could not in any way get texture information.. so use closest point to center + + Face3 f( p_vtx[0],p_vtx[1],p_vtx[2]); + Vector3 inters = f.get_closest_point_to(p_aabb.pos+p_aabb.size*0.5); + + Vector2 uv = get_uv(inters,p_vtx,p_uv); + + int uv_x = CLAMP(Math::fposmod(uv.x,1.0)*bake_texture_size,0,bake_texture_size-1); + int uv_y = CLAMP(Math::fposmod(uv.y,1.0)*bake_texture_size,0,bake_texture_size-1); + + int ofs = uv_y*bake_texture_size+uv_x; + + alpha = 1.0/(color_scan_cell_width*color_scan_cell_width); + + albedo_accum.r=p_material.albedo[ofs].r*alpha; + albedo_accum.g=p_material.albedo[ofs].g*alpha; + albedo_accum.b=p_material.albedo[ofs].b*alpha; + albedo_accum.a=p_material.albedo[ofs].a*alpha; + + emission_accum.r=p_material.emission[ofs].r*alpha; + emission_accum.g=p_material.emission[ofs].g*alpha; + emission_accum.b=p_material.emission[ofs].b*alpha; + + normal_accum*=alpha; + + + } else { + + float accdiv = 1.0/(color_scan_cell_width*color_scan_cell_width); + alpha*=accdiv; + + albedo_accum.r*=accdiv; + albedo_accum.g*=accdiv; + albedo_accum.b*=accdiv; + albedo_accum.a*=accdiv; + + emission_accum.r*=accdiv; + emission_accum.g*=accdiv; + emission_accum.b*=accdiv; + + normal_accum*=accdiv; + + } + + //put this temporarily here, corrected in a later step + p_baker->bake_cells[p_idx].albedo[0]+=albedo_accum.r; + p_baker->bake_cells[p_idx].albedo[1]+=albedo_accum.g; + p_baker->bake_cells[p_idx].albedo[2]+=albedo_accum.b; + p_baker->bake_cells[p_idx].emission[0]+=emission_accum.r; + p_baker->bake_cells[p_idx].emission[1]+=emission_accum.g; + p_baker->bake_cells[p_idx].emission[2]+=emission_accum.b; + p_baker->bake_cells[p_idx].normal[0]+=normal_accum.x; + p_baker->bake_cells[p_idx].normal[1]+=normal_accum.y; + p_baker->bake_cells[p_idx].normal[2]+=normal_accum.z; + p_baker->bake_cells[p_idx].alpha+=alpha; + + static const Vector3 side_normals[6]={ + Vector3(-1, 0, 0), + Vector3( 1, 0, 0), + Vector3( 0,-1, 0), + Vector3( 0, 1, 0), + Vector3( 0, 0,-1), + Vector3( 0, 0, 1), + }; + + /* + for(int i=0;i<6;i++) { + if (normal.dot(side_normals[i])>CMP_EPSILON) { + p_baker->bake_cells[p_idx].used_sides|=(1<<i); + } + }*/ + + + } else { + //go down + + int half = (1<<(p_baker->cell_subdiv-1)) >> (p_level+1); + for(int i=0;i<8;i++) { + + Rect3 aabb=p_aabb; + aabb.size*=0.5; + + int nx=p_x; + int ny=p_y; + int nz=p_z; + + if (i&1) { + aabb.pos.x+=aabb.size.x; + nx+=half; + } + if (i&2) { + aabb.pos.y+=aabb.size.y; + ny+=half; + } + if (i&4) { + aabb.pos.z+=aabb.size.z; + nz+=half; + } + //make sure to not plot beyond limits + if (nx<0 || nx>=p_baker->axis_cell_size[0] || ny<0 || ny>=p_baker->axis_cell_size[1] || nz<0 || nz>=p_baker->axis_cell_size[2]) + continue; + + { + Rect3 test_aabb=aabb; + //test_aabb.grow_by(test_aabb.get_longest_axis_size()*0.05); //grow a bit to avoid numerical error in real-time + Vector3 qsize = test_aabb.size*0.5; //quarter size, for fast aabb test + + if (!fast_tri_box_overlap(test_aabb.pos+qsize,qsize,p_vtx)) { + //if (!Face3(p_vtx[0],p_vtx[1],p_vtx[2]).intersects_aabb2(aabb)) { + //does not fit in child, go on + continue; + } + + } + + if (p_baker->bake_cells[p_idx].childs[i]==Baker::CHILD_EMPTY) { + //sub cell must be created + + uint32_t child_idx = p_baker->bake_cells.size(); + p_baker->bake_cells[p_idx].childs[i]=child_idx; + p_baker->bake_cells.resize( p_baker->bake_cells.size() + 1); + p_baker->bake_cells[child_idx].level=p_level+1; + + } + + + _plot_face(p_baker->bake_cells[p_idx].childs[i],p_level+1,nx,ny,nz,p_vtx,p_uv,p_material,aabb,p_baker); + } + } +} + + + +void GIProbe::_fixup_plot(int p_idx, int p_level,int p_x,int p_y, int p_z,Baker *p_baker) { + + + + if (p_level==p_baker->cell_subdiv-1) { + + p_baker->leaf_voxel_count++; + float alpha = p_baker->bake_cells[p_idx].alpha; + + p_baker->bake_cells[p_idx].albedo[0]/=alpha; + p_baker->bake_cells[p_idx].albedo[1]/=alpha; + p_baker->bake_cells[p_idx].albedo[2]/=alpha; + + //transfer emission to light + p_baker->bake_cells[p_idx].emission[0]/=alpha; + p_baker->bake_cells[p_idx].emission[1]/=alpha; + p_baker->bake_cells[p_idx].emission[2]/=alpha; + + p_baker->bake_cells[p_idx].normal[0]/=alpha; + p_baker->bake_cells[p_idx].normal[1]/=alpha; + p_baker->bake_cells[p_idx].normal[2]/=alpha; + + Vector3 n(p_baker->bake_cells[p_idx].normal[0],p_baker->bake_cells[p_idx].normal[1],p_baker->bake_cells[p_idx].normal[2]); + if (n.length()<0.01) { + //too much fight over normal, zero it + p_baker->bake_cells[p_idx].normal[0]=0; + p_baker->bake_cells[p_idx].normal[1]=0; + p_baker->bake_cells[p_idx].normal[2]=0; + } else { + n.normalize(); + p_baker->bake_cells[p_idx].normal[0]=n.x; + p_baker->bake_cells[p_idx].normal[1]=n.y; + p_baker->bake_cells[p_idx].normal[2]=n.z; + } + + + p_baker->bake_cells[p_idx].alpha=1.0; + + /* + //remove neighbours from used sides + + for(int n=0;n<6;n++) { + + int ofs[3]={0,0,0}; + + ofs[n/2]=(n&1)?1:-1; + + //convert to x,y,z on this level + int x=p_x; + int y=p_y; + int z=p_z; + + x+=ofs[0]; + y+=ofs[1]; + z+=ofs[2]; + + int ofs_x=0; + int ofs_y=0; + int ofs_z=0; + int size = 1<<p_level; + int half=size/2; + + + if (x<0 || x>=size || y<0 || y>=size || z<0 || z>=size) { + //neighbour is out, can't use it + p_baker->bake_cells[p_idx].used_sides&=~(1<<uint32_t(n)); + continue; + } + + uint32_t neighbour=0; + + for(int i=0;i<p_baker->cell_subdiv-1;i++) { + + Baker::Cell *bc = &p_baker->bake_cells[neighbour]; + + int child = 0; + if (x >= ofs_x + half) { + child|=1; + ofs_x+=half; + } + if (y >= ofs_y + half) { + child|=2; + ofs_y+=half; + } + if (z >= ofs_z + half) { + child|=4; + ofs_z+=half; + } + + neighbour = bc->childs[child]; + if (neighbour==Baker::CHILD_EMPTY) { + break; + } + + half>>=1; + } + + if (neighbour!=Baker::CHILD_EMPTY) { + p_baker->bake_cells[p_idx].used_sides&=~(1<<uint32_t(n)); + } + } + */ + } else { + + + //go down + + float alpha_average=0; + int half = (1<<(p_baker->cell_subdiv-1)) >> (p_level+1); + for(int i=0;i<8;i++) { + + uint32_t child = p_baker->bake_cells[p_idx].childs[i]; + + if (child==Baker::CHILD_EMPTY) + continue; + + + int nx=p_x; + int ny=p_y; + int nz=p_z; + + if (i&1) + nx+=half; + if (i&2) + ny+=half; + if (i&4) + nz+=half; + + _fixup_plot(child,p_level+1,nx,ny,nz,p_baker); + alpha_average+=p_baker->bake_cells[child].alpha; + } + + p_baker->bake_cells[p_idx].alpha=alpha_average/8.0; + p_baker->bake_cells[p_idx].emission[0]=0; + p_baker->bake_cells[p_idx].emission[1]=0; + p_baker->bake_cells[p_idx].emission[2]=0; + p_baker->bake_cells[p_idx].normal[0]=0; + p_baker->bake_cells[p_idx].normal[1]=0; + p_baker->bake_cells[p_idx].normal[2]=0; + p_baker->bake_cells[p_idx].albedo[0]=0; + p_baker->bake_cells[p_idx].albedo[1]=0; + p_baker->bake_cells[p_idx].albedo[2]=0; + + } + +} + + + +Vector<Color> GIProbe::_get_bake_texture(Image &p_image,const Color& p_color) { + + Vector<Color> ret; + + if (p_image.empty()) { + + ret.resize(bake_texture_size*bake_texture_size); + for(int i=0;i<bake_texture_size*bake_texture_size;i++) { + ret[i]=p_color; + } + + return ret; + } + + p_image.convert(Image::FORMAT_RGBA8); + p_image.resize(bake_texture_size,bake_texture_size,Image::INTERPOLATE_CUBIC); + + + PoolVector<uint8_t>::Read r = p_image.get_data().read(); + ret.resize(bake_texture_size*bake_texture_size); + + for(int i=0;i<bake_texture_size*bake_texture_size;i++) { + Color c; + c.r = r[i*4+0]/255.0; + c.g = r[i*4+1]/255.0; + c.b = r[i*4+2]/255.0; + c.a = r[i*4+3]/255.0; + ret[i]=c; + + } + + return ret; +} + + +GIProbe::Baker::MaterialCache GIProbe::_get_material_cache(Ref<Material> p_material,Baker *p_baker) { + + //this way of obtaining materials is inaccurate and also does not support some compressed formats very well + Ref<FixedSpatialMaterial> mat = p_material; + + Ref<Material> material = mat; //hack for now + + if (p_baker->material_cache.has(material)) { + return p_baker->material_cache[material]; + } + + Baker::MaterialCache mc; + + if (mat.is_valid()) { + + + Ref<ImageTexture> albedo_tex = mat->get_texture(FixedSpatialMaterial::TEXTURE_ALBEDO); + + Image img_albedo; + if (albedo_tex.is_valid()) { + + img_albedo = albedo_tex->get_data(); + } + + mc.albedo=_get_bake_texture(img_albedo,mat->get_albedo()); + + Ref<ImageTexture> emission_tex = mat->get_texture(FixedSpatialMaterial::TEXTURE_EMISSION); + + Color emission_col = mat->get_emission(); + emission_col.r*=mat->get_emission_energy(); + emission_col.g*=mat->get_emission_energy(); + emission_col.b*=mat->get_emission_energy(); + + Image img_emission; + + if (emission_tex.is_valid()) { + + img_emission = emission_tex->get_data(); + } + + mc.emission=_get_bake_texture(img_emission,emission_col); + + } else { + Image empty; + + mc.albedo=_get_bake_texture(empty,Color(0.7,0.7,0.7)); + mc.emission=_get_bake_texture(empty,Color(0,0,0)); + + + } + + p_baker->material_cache[p_material]=mc; + return mc; + + +} + +void GIProbe::_plot_mesh(const Transform& p_xform, Ref<Mesh>& p_mesh, Baker *p_baker) { + + + for(int i=0;i<p_mesh->get_surface_count();i++) { + + if (p_mesh->surface_get_primitive_type(i)!=Mesh::PRIMITIVE_TRIANGLES) + continue; //only triangles + + Baker::MaterialCache material = _get_material_cache(p_mesh->surface_get_material(i),p_baker); + + Array a = p_mesh->surface_get_arrays(i); + + + PoolVector<Vector3> vertices = a[Mesh::ARRAY_VERTEX]; + PoolVector<Vector3>::Read vr=vertices.read(); + PoolVector<Vector2> uv = a[Mesh::ARRAY_TEX_UV]; + PoolVector<Vector2>::Read uvr; + PoolVector<int> index = a[Mesh::ARRAY_INDEX]; + + bool read_uv=false; + + if (uv.size()) { + + uvr=uv.read(); + read_uv=true; + } + + if (index.size()) { + + int facecount = index.size()/3; + PoolVector<int>::Read ir=index.read(); + + for(int j=0;j<facecount;j++) { + + Vector3 vtxs[3]; + Vector2 uvs[3]; + + for(int k=0;k<3;k++) { + vtxs[k]=p_xform.xform(vr[ir[j*3+k]]); + } + + if (read_uv) { + for(int k=0;k<3;k++) { + uvs[k]=uvr[ir[j*3+k]]; + } + } + + //test against original bounds + if (!fast_tri_box_overlap(-extents,extents*2,vtxs)) + continue; + //plot + _plot_face(0,0,0,0,0,vtxs,uvs,material,p_baker->po2_bounds,p_baker); + } + + + + } else { + + int facecount = vertices.size()/3; + + for(int j=0;j<facecount;j++) { + + Vector3 vtxs[3]; + Vector2 uvs[3]; + + for(int k=0;k<3;k++) { + vtxs[k]=p_xform.xform(vr[j*3+k]); + } + + if (read_uv) { + for(int k=0;k<3;k++) { + uvs[k]=uvr[j*3+k]; + } + } + + //test against original bounds + if (!fast_tri_box_overlap(-extents,extents*2,vtxs)) + continue; + //plot face + _plot_face(0,0,0,0,0,vtxs,uvs,material,p_baker->po2_bounds,p_baker); + } + + } + } +} + + + +void GIProbe::_find_meshes(Node *p_at_node,Baker *p_baker){ + + MeshInstance *mi = p_at_node->cast_to<MeshInstance>(); + if (mi && mi->get_flag(GeometryInstance::FLAG_USE_BAKED_LIGHT)) { + Ref<Mesh> mesh = mi->get_mesh(); + if (mesh.is_valid()) { + + Rect3 aabb = mesh->get_aabb(); + + Transform xf = get_global_transform().affine_inverse() * mi->get_global_transform(); + + if (Rect3(-extents,extents*2).intersects(xf.xform(aabb))) { + Baker::PlotMesh pm; + pm.local_xform=xf; + pm.mesh=mesh; + p_baker->mesh_list.push_back(pm); + + } + } + } + + for(int i=0;i<p_at_node->get_child_count();i++) { + + Node *child = p_at_node->get_child(i); + if (!child->get_owner()) + continue; //maybe a helper + + _find_meshes(child,p_baker); + + } +} + + + + +void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug){ + + Baker baker; + + static const int subdiv_value[SUBDIV_MAX]={7,8,9,10}; + + baker.cell_subdiv=subdiv_value[subdiv]; + baker.bake_cells.resize(1); + + //find out the actual real bounds, power of 2, which gets the highest subdivision + baker.po2_bounds=Rect3(-extents,extents*2.0); + int longest_axis = baker.po2_bounds.get_longest_axis_index(); + baker.axis_cell_size[longest_axis]=(1<<(baker.cell_subdiv-1)); + baker.leaf_voxel_count=0; + + for(int i=0;i<3;i++) { + + if (i==longest_axis) + continue; + + baker.axis_cell_size[i]=baker.axis_cell_size[longest_axis]; + float axis_size = baker.po2_bounds.size[longest_axis]; + + //shrink until fit subdiv + while (axis_size/2.0 >= baker.po2_bounds.size[i]) { + axis_size/=2.0; + baker.axis_cell_size[i]>>=1; + } + + baker.po2_bounds.size[i]=baker.po2_bounds.size[longest_axis]; + } + + + + Transform to_bounds; + to_bounds.basis.scale(Vector3(baker.po2_bounds.size[longest_axis],baker.po2_bounds.size[longest_axis],baker.po2_bounds.size[longest_axis])); + to_bounds.origin=baker.po2_bounds.pos; + + Transform to_grid; + to_grid.basis.scale(Vector3(baker.axis_cell_size[longest_axis],baker.axis_cell_size[longest_axis],baker.axis_cell_size[longest_axis])); + + baker.to_cell_space = to_grid * to_bounds.affine_inverse(); + + + _find_meshes(p_from_node?p_from_node:get_parent(),&baker); + + + + int pmc=0; + + for(List<Baker::PlotMesh>::Element *E=baker.mesh_list.front();E;E=E->next()) { + + print_line("plotting mesh "+itos(pmc++)+"/"+itos(baker.mesh_list.size())); + + _plot_mesh(E->get().local_xform,E->get().mesh,&baker); + } + + _fixup_plot(0,0,0,0,0,&baker); + + //create the data for visual server + + PoolVector<int> data; + + data.resize( 16+(8+1+1+1+1)*baker.bake_cells.size() ); //4 for header, rest for rest. + + { + PoolVector<int>::Write w = data.write(); + + uint32_t * w32 = (uint32_t*)w.ptr(); + + w32[0]=0;//version + w32[1]=baker.cell_subdiv; //subdiv + w32[2]=baker.axis_cell_size[0]; + w32[3]=baker.axis_cell_size[1]; + w32[4]=baker.axis_cell_size[2]; + w32[5]=baker.bake_cells.size(); + w32[6]=baker.leaf_voxel_count; + + int ofs=16; + + for(int i=0;i<baker.bake_cells.size();i++) { + + for(int j=0;j<8;j++) { + w32[ofs++]=baker.bake_cells[i].childs[j]; + } + + { //albedo + uint32_t rgba=uint32_t(CLAMP(baker.bake_cells[i].albedo[0]*255.0,0,255))<<16; + rgba|=uint32_t(CLAMP(baker.bake_cells[i].albedo[1]*255.0,0,255))<<8; + rgba|=uint32_t(CLAMP(baker.bake_cells[i].albedo[2]*255.0,0,255))<<0; + + w32[ofs++]=rgba; + + + } + { //emission + + Vector3 e(baker.bake_cells[i].emission[0],baker.bake_cells[i].emission[1],baker.bake_cells[i].emission[2]); + float l = e.length(); + if (l>0) { + e.normalize(); + l=CLAMP(l/8.0,0,1.0); + } + + uint32_t em=uint32_t(CLAMP(e[0]*255,0,255))<<24; + em|=uint32_t(CLAMP(e[1]*255,0,255))<<16; + em|=uint32_t(CLAMP(e[2]*255,0,255))<<8; + em|=uint32_t(CLAMP(l*255,0,255)); + + w32[ofs++]=em; + } + + //w32[ofs++]=baker.bake_cells[i].used_sides; + { //normal + + Vector3 n(baker.bake_cells[i].normal[0],baker.bake_cells[i].normal[1],baker.bake_cells[i].normal[2]); + n=n*Vector3(0.5,0.5,0.5)+Vector3(0.5,0.5,0.5); + uint32_t norm=0; + + + norm|=uint32_t(CLAMP( n.x*255.0, 0, 255))<<16; + norm|=uint32_t(CLAMP( n.y*255.0, 0, 255))<<8; + norm|=uint32_t(CLAMP( n.z*255.0, 0, 255))<<0; + + w32[ofs++]=norm; + } + + { + uint16_t alpha = CLAMP(uint32_t(baker.bake_cells[i].alpha*65535.0),0,65535); + uint16_t level = baker.bake_cells[i].level; + + w32[ofs++] = (uint32_t(level)<<16)|uint32_t(alpha); + } + + } + + } + + Ref<GIProbeData> probe_data; + probe_data.instance(); + probe_data->set_bounds(Rect3(-extents,extents*2.0)); + probe_data->set_cell_size(baker.po2_bounds.size[longest_axis]/baker.axis_cell_size[longest_axis]); + probe_data->set_dynamic_data(data); + probe_data->set_dynamic_range(dynamic_range); + probe_data->set_energy(energy); + probe_data->set_interior(interior); + probe_data->set_compress(compress); + probe_data->set_to_cell_xform(baker.to_cell_space); + + set_probe_data(probe_data); + + + if (p_create_visual_debug) { + // _create_debug_mesh(&baker); + } + + + +} + + +void GIProbe::_debug_mesh(int p_idx, int p_level, const Rect3 &p_aabb,Ref<MultiMesh> &p_multimesh,int &idx,Baker *p_baker) { + + + if (p_level==p_baker->cell_subdiv-1) { + + Vector3 center = p_aabb.pos+p_aabb.size*0.5; + Transform xform; + xform.origin=center; + xform.basis.scale(p_aabb.size*0.5); + p_multimesh->set_instance_transform(idx,xform); + Color col=Color(p_baker->bake_cells[p_idx].albedo[0],p_baker->bake_cells[p_idx].albedo[1],p_baker->bake_cells[p_idx].albedo[2]); + p_multimesh->set_instance_color(idx,col); + + idx++; + + } else { + + for(int i=0;i<8;i++) { + + if (p_baker->bake_cells[p_idx].childs[i]==Baker::CHILD_EMPTY) + continue; + + Rect3 aabb=p_aabb; + aabb.size*=0.5; + + if (i&1) + aabb.pos.x+=aabb.size.x; + if (i&2) + aabb.pos.y+=aabb.size.y; + if (i&4) + aabb.pos.z+=aabb.size.z; + + _debug_mesh(p_baker->bake_cells[p_idx].childs[i],p_level+1,aabb,p_multimesh,idx,p_baker); + } + + } + +} + + +void GIProbe::_create_debug_mesh(Baker *p_baker) { + + Ref<MultiMesh> mm; + mm.instance(); + + mm->set_transform_format(MultiMesh::TRANSFORM_3D); + mm->set_color_format(MultiMesh::COLOR_8BIT); + print_line("leaf voxels: "+itos(p_baker->leaf_voxel_count)); + mm->set_instance_count(p_baker->leaf_voxel_count); + + Ref<Mesh> mesh; + mesh.instance(); + + { + Array arr; + arr.resize(Mesh::ARRAY_MAX); + + PoolVector<Vector3> vertices; + PoolVector<Color> colors; + + int vtx_idx=0; + #define ADD_VTX(m_idx);\ + vertices.push_back( face_points[m_idx] );\ + colors.push_back( Color(1,1,1,1) );\ + vtx_idx++;\ + + for (int i=0;i<6;i++) { + + + Vector3 face_points[4]; + + for (int j=0;j<4;j++) { + + float v[3]; + v[0]=1.0; + v[1]=1-2*((j>>1)&1); + v[2]=v[1]*(1-2*(j&1)); + + for (int k=0;k<3;k++) { + + if (i<3) + face_points[j][(i+k)%3]=v[k]*(i>=3?-1:1); + else + face_points[3-j][(i+k)%3]=v[k]*(i>=3?-1:1); + } + } + + //tri 1 + ADD_VTX(0); + ADD_VTX(1); + ADD_VTX(2); + //tri 2 + ADD_VTX(2); + ADD_VTX(3); + ADD_VTX(0); + + } + + + arr[Mesh::ARRAY_VERTEX]=vertices; + arr[Mesh::ARRAY_COLOR]=colors; + mesh->add_surface_from_arrays(Mesh::PRIMITIVE_TRIANGLES,arr); + } + + { + Ref<FixedSpatialMaterial> fsm; + fsm.instance(); + fsm->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR,true); + fsm->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR,true); + fsm->set_flag(FixedSpatialMaterial::FLAG_UNSHADED,true); + fsm->set_albedo(Color(1,1,1,1)); + + mesh->surface_set_material(0,fsm); + } + + mm->set_mesh(mesh); + + + int idx=0; + _debug_mesh(0,0,p_baker->po2_bounds,mm,idx,p_baker); + + MultiMeshInstance *mmi = memnew( MultiMeshInstance ); + mmi->set_multimesh(mm); + add_child(mmi); +#ifdef TOOLS_ENABLED + if (get_tree()->get_edited_scene_root()==this){ + mmi->set_owner(this); + } else { + mmi->set_owner(get_owner()); + + } +#else + mmi->set_owner(get_owner()); +#endif + +} + +void GIProbe::_debug_bake() { + + bake(NULL,true); +} + +Rect3 GIProbe::get_aabb() const { + + return Rect3(-extents,extents*2); +} + +PoolVector<Face3> GIProbe::get_faces(uint32_t p_usage_flags) const { + + return PoolVector<Face3>(); +} + +void GIProbe::_bind_methods() { + + ClassDB::bind_method(_MD("set_probe_data","data"),&GIProbe::set_probe_data); + ClassDB::bind_method(_MD("get_probe_data"),&GIProbe::get_probe_data); + + ClassDB::bind_method(_MD("set_subdiv","subdiv"),&GIProbe::set_subdiv); + ClassDB::bind_method(_MD("get_subdiv"),&GIProbe::get_subdiv); + + ClassDB::bind_method(_MD("set_extents","extents"),&GIProbe::set_extents); + ClassDB::bind_method(_MD("get_extents"),&GIProbe::get_extents); + + ClassDB::bind_method(_MD("set_dynamic_range","max"),&GIProbe::set_dynamic_range); + ClassDB::bind_method(_MD("get_dynamic_range"),&GIProbe::get_dynamic_range); + + ClassDB::bind_method(_MD("set_energy","max"),&GIProbe::set_energy); + ClassDB::bind_method(_MD("get_energy"),&GIProbe::get_energy); + + ClassDB::bind_method(_MD("set_interior","enable"),&GIProbe::set_interior); + ClassDB::bind_method(_MD("is_interior"),&GIProbe::is_interior); + + ClassDB::bind_method(_MD("set_compress","enable"),&GIProbe::set_compress); + ClassDB::bind_method(_MD("is_compressed"),&GIProbe::is_compressed); + + ClassDB::bind_method(_MD("bake","from_node","create_visual_debug"),&GIProbe::bake,DEFVAL(Variant()),DEFVAL(false)); + ClassDB::bind_method(_MD("debug_bake"),&GIProbe::_debug_bake); + ClassDB::set_method_flags(get_class_static(),_SCS("debug_bake"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + + ADD_PROPERTY( PropertyInfo(Variant::INT,"subdiv",PROPERTY_HINT_ENUM,"64,128,256,512"),_SCS("set_subdiv"),_SCS("get_subdiv")); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"extents"),_SCS("set_extents"),_SCS("get_extents")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"dynamic_range",PROPERTY_HINT_RANGE,"1,16,1"),_SCS("set_dynamic_range"),_SCS("get_dynamic_range")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"energy",PROPERTY_HINT_RANGE,"0,16,0.01"),_SCS("set_energy"),_SCS("get_energy")); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"interior"),_SCS("set_interior"),_SCS("is_interior")); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"compress"),_SCS("set_compress"),_SCS("is_compressed")); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"data",PROPERTY_HINT_RESOURCE_TYPE,"GIProbeData"),_SCS("set_probe_data"),_SCS("get_probe_data")); + + + BIND_CONSTANT( SUBDIV_64 ); + BIND_CONSTANT( SUBDIV_128 ); + BIND_CONSTANT( SUBDIV_256 ); + BIND_CONSTANT( SUBDIV_MAX ); + +} + +GIProbe::GIProbe() { + + subdiv=SUBDIV_128; + dynamic_range=4; + energy=1.0; + extents=Vector3(10,10,10); + color_scan_cell_width=4; + bake_texture_size=128; + interior=false; + compress=false; + + gi_probe = VS::get_singleton()->gi_probe_create(); + + +} + +GIProbe::~GIProbe() { + + +} diff --git a/scene/3d/gi_probe.h b/scene/3d/gi_probe.h new file mode 100644 index 0000000000..e416b28791 --- /dev/null +++ b/scene/3d/gi_probe.h @@ -0,0 +1,190 @@ +#ifndef GIPROBE_H +#define GIPROBE_H + +#include "scene/3d/visual_instance.h" +#include "multimesh_instance.h" + +class GIProbeData : public Resource { + + GDCLASS(GIProbeData,Resource); + + RID probe; + +protected: + + static void _bind_methods(); +public: + + + + void set_bounds(const Rect3& p_bounds); + Rect3 get_bounds() const; + + void set_cell_size(float p_size); + float get_cell_size() const; + + void set_to_cell_xform(const Transform& p_xform); + Transform get_to_cell_xform() const; + + void set_dynamic_data(const PoolVector<int>& p_data); + PoolVector<int> get_dynamic_data() const; + + void set_dynamic_range(int p_range); + int get_dynamic_range() const; + + void set_energy(float p_range); + float get_energy() const; + + void set_interior(bool p_enable); + bool is_interior() const; + + void set_compress(bool p_enable); + bool is_compressed() const; + + virtual RID get_rid() const; + + GIProbeData(); + ~GIProbeData(); +}; + + + +class GIProbe : public VisualInstance { + GDCLASS(GIProbe,VisualInstance); +public: + enum Subdiv{ + SUBDIV_64, + SUBDIV_128, + SUBDIV_256, + SUBDIV_512, + SUBDIV_MAX + + }; +private: + + //stuff used for bake + struct Baker { + + enum { + CHILD_EMPTY=0xFFFFFFFF + }; + struct Cell { + + uint32_t childs[8]; + float albedo[3]; //albedo in RGB24 + float emission[3]; //accumulated light in 16:16 fixed point (needs to be integer for moving lights fast) + float normal[3]; + uint32_t used_sides; + float alpha; //used for upsampling + int level; + + Cell() { + for(int i=0;i<8;i++) { + childs[i]=CHILD_EMPTY; + } + + for(int i=0;i<3;i++) { + emission[i]=0; + albedo[i]=0; + normal[i]=0; + } + alpha=0; + used_sides=0; + level=0; + } + }; + + Vector<Cell> bake_cells; + int cell_subdiv; + + struct MaterialCache { + //128x128 textures + Vector<Color> albedo; + Vector<Color> emission; + }; + + + Vector<Color> _get_bake_texture(Image &p_image, const Color &p_color); + Map<Ref<Material>,MaterialCache> material_cache; + MaterialCache _get_material_cache(Ref<Material> p_material); + int leaf_voxel_count; + + + Rect3 po2_bounds; + int axis_cell_size[3]; + + struct PlotMesh { + Ref<Mesh> mesh; + Transform local_xform; + }; + + Transform to_cell_space; + + List<PlotMesh> mesh_list; + }; + + + Ref<GIProbeData> probe_data; + + RID gi_probe; + + Subdiv subdiv; + Vector3 extents; + int dynamic_range; + float energy; + bool interior; + bool compress; + + int color_scan_cell_width; + int bake_texture_size; + + Vector<Color> _get_bake_texture(Image &p_image,const Color& p_color); + Baker::MaterialCache _get_material_cache(Ref<Material> p_material,Baker *p_baker); + void _plot_face(int p_idx, int p_level, int p_x,int p_y,int p_z,const Vector3 *p_vtx, const Vector2* p_uv, const Baker::MaterialCache& p_material, const Rect3 &p_aabb,Baker *p_baker); + void _plot_mesh(const Transform& p_xform, Ref<Mesh>& p_mesh, Baker *p_baker); + void _find_meshes(Node *p_at_node,Baker *p_baker); + void _fixup_plot(int p_idx, int p_level,int p_x,int p_y, int p_z,Baker *p_baker); + + void _debug_mesh(int p_idx, int p_level, const Rect3 &p_aabb,Ref<MultiMesh> &p_multimesh,int &idx,Baker *p_baker); + void _create_debug_mesh(Baker *p_baker); + + void _debug_bake(); + +protected: + + static void _bind_methods(); +public: + + void set_probe_data(const Ref<GIProbeData>& p_data); + Ref<GIProbeData> get_probe_data() const; + + void set_subdiv(Subdiv p_subdiv); + Subdiv get_subdiv() const; + + void set_extents(const Vector3& p_extents); + Vector3 get_extents() const; + + void set_dynamic_range(int p_dynamic_range); + int get_dynamic_range() const; + + void set_energy(float p_energy); + float get_energy() const; + + void set_interior(bool p_enable); + bool is_interior() const; + + void set_compress(bool p_enable); + bool is_compressed() const; + + void bake(Node *p_from_node=NULL,bool p_create_visual_debug=false); + + virtual Rect3 get_aabb() const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; + + GIProbe(); + ~GIProbe(); +}; + +VARIANT_ENUM_CAST(GIProbe::Subdiv) + +#endif // GIPROBE_H diff --git a/scene/3d/immediate_geometry.cpp b/scene/3d/immediate_geometry.cpp index 99c7fd047f..08fc1f59e8 100644 --- a/scene/3d/immediate_geometry.cpp +++ b/scene/3d/immediate_geometry.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -92,13 +92,13 @@ void ImmediateGeometry::clear(){ } -AABB ImmediateGeometry::get_aabb() const { +Rect3 ImmediateGeometry::get_aabb() const { return aabb; } -DVector<Face3> ImmediateGeometry::get_faces(uint32_t p_usage_flags) const { +PoolVector<Face3> ImmediateGeometry::get_faces(uint32_t p_usage_flags) const { - return DVector<Face3>(); + return PoolVector<Face3>(); } @@ -154,16 +154,16 @@ void ImmediateGeometry::add_sphere(int p_lats, int p_lons, float p_radius, bool void ImmediateGeometry::_bind_methods() { - ObjectTypeDB::bind_method(_MD("begin","primitive","texture:Texture"),&ImmediateGeometry::begin,DEFVAL(Ref<Texture>())); - ObjectTypeDB::bind_method(_MD("set_normal","normal"),&ImmediateGeometry::set_normal); - ObjectTypeDB::bind_method(_MD("set_tangent","tangent"),&ImmediateGeometry::set_tangent); - ObjectTypeDB::bind_method(_MD("set_color","color"),&ImmediateGeometry::set_color); - ObjectTypeDB::bind_method(_MD("set_uv","uv"),&ImmediateGeometry::set_uv); - ObjectTypeDB::bind_method(_MD("set_uv2","uv"),&ImmediateGeometry::set_uv2); - ObjectTypeDB::bind_method(_MD("add_vertex","pos"),&ImmediateGeometry::add_vertex); - ObjectTypeDB::bind_method(_MD("add_sphere","lats","lons","radius","add_uv"),&ImmediateGeometry::add_sphere,DEFVAL(true)); - ObjectTypeDB::bind_method(_MD("end"),&ImmediateGeometry::end); - ObjectTypeDB::bind_method(_MD("clear"),&ImmediateGeometry::clear); + ClassDB::bind_method(_MD("begin","primitive","texture:Texture"),&ImmediateGeometry::begin,DEFVAL(Ref<Texture>())); + ClassDB::bind_method(_MD("set_normal","normal"),&ImmediateGeometry::set_normal); + ClassDB::bind_method(_MD("set_tangent","tangent"),&ImmediateGeometry::set_tangent); + ClassDB::bind_method(_MD("set_color","color"),&ImmediateGeometry::set_color); + ClassDB::bind_method(_MD("set_uv","uv"),&ImmediateGeometry::set_uv); + ClassDB::bind_method(_MD("set_uv2","uv"),&ImmediateGeometry::set_uv2); + ClassDB::bind_method(_MD("add_vertex","pos"),&ImmediateGeometry::add_vertex); + ClassDB::bind_method(_MD("add_sphere","lats","lons","radius","add_uv"),&ImmediateGeometry::add_sphere,DEFVAL(true)); + ClassDB::bind_method(_MD("end"),&ImmediateGeometry::end); + ClassDB::bind_method(_MD("clear"),&ImmediateGeometry::clear); } diff --git a/scene/3d/immediate_geometry.h b/scene/3d/immediate_geometry.h index fc7f4de634..e385a34da1 100644 --- a/scene/3d/immediate_geometry.h +++ b/scene/3d/immediate_geometry.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class ImmediateGeometry : public GeometryInstance { - OBJ_TYPE(ImmediateGeometry,GeometryInstance); + GDCLASS(ImmediateGeometry,GeometryInstance); RID im; @@ -42,7 +42,7 @@ class ImmediateGeometry : public GeometryInstance { // in VisualServer from becoming invalid if the texture is no longer used List<Ref<Texture> > cached_textures; bool empty; - AABB aabb; + Rect3 aabb; protected: static void _bind_methods(); @@ -66,8 +66,8 @@ public: - virtual AABB get_aabb() const; - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual Rect3 get_aabb() const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; ImmediateGeometry(); ~ImmediateGeometry(); diff --git a/scene/3d/interpolated_camera.cpp b/scene/3d/interpolated_camera.cpp index 96306d1180..c7464d3c5d 100644 --- a/scene/3d/interpolated_camera.cpp +++ b/scene/3d/interpolated_camera.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -134,15 +134,15 @@ real_t InterpolatedCamera::get_speed() const { void InterpolatedCamera::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_target_path","target_path"),&InterpolatedCamera::set_target_path); - ObjectTypeDB::bind_method(_MD("get_target_path"),&InterpolatedCamera::get_target_path); - ObjectTypeDB::bind_method(_MD("set_target","target:Camera"),&InterpolatedCamera::_set_target); + ClassDB::bind_method(_MD("set_target_path","target_path"),&InterpolatedCamera::set_target_path); + ClassDB::bind_method(_MD("get_target_path"),&InterpolatedCamera::get_target_path); + ClassDB::bind_method(_MD("set_target","target:Camera"),&InterpolatedCamera::_set_target); - ObjectTypeDB::bind_method(_MD("set_speed","speed"),&InterpolatedCamera::set_speed); - ObjectTypeDB::bind_method(_MD("get_speed"),&InterpolatedCamera::get_speed); + ClassDB::bind_method(_MD("set_speed","speed"),&InterpolatedCamera::set_speed); + ClassDB::bind_method(_MD("get_speed"),&InterpolatedCamera::get_speed); - ObjectTypeDB::bind_method(_MD("set_interpolation_enabled","target_path"),&InterpolatedCamera::set_interpolation_enabled); - ObjectTypeDB::bind_method(_MD("is_interpolation_enabled"),&InterpolatedCamera::is_interpolation_enabled); + ClassDB::bind_method(_MD("set_interpolation_enabled","target_path"),&InterpolatedCamera::set_interpolation_enabled); + ClassDB::bind_method(_MD("is_interpolation_enabled"),&InterpolatedCamera::is_interpolation_enabled); ADD_PROPERTY( PropertyInfo(Variant::NODE_PATH,"target"), _SCS("set_target_path"), _SCS("get_target_path") ); ADD_PROPERTY( PropertyInfo(Variant::REAL,"speed"), _SCS("set_speed"), _SCS("get_speed") ); diff --git a/scene/3d/interpolated_camera.h b/scene/3d/interpolated_camera.h index dbe84327fb..c78e6935da 100644 --- a/scene/3d/interpolated_camera.h +++ b/scene/3d/interpolated_camera.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class InterpolatedCamera : public Camera { - OBJ_TYPE(InterpolatedCamera,Camera); + GDCLASS(InterpolatedCamera,Camera); bool enabled; real_t speed; diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp index 5b221d1574..50ee3482c3 100644 --- a/scene/3d/light.cpp +++ b/scene/3d/light.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -30,413 +30,125 @@ #include "globals.h" #include "scene/resources/surface_tool.h" +#include "baked_light_instance.h" -static const char* _light_param_names[VS::LIGHT_PARAM_MAX]={ - "params/spot_attenuation", - "params/spot_angle", - "params/radius", - "params/energy", - "params/attenuation", - "shadow/darkening", - "shadow/z_offset", - "shadow/z_slope_scale", - "shadow/esm_multiplier", - "shadow/blur_passes" -}; - -void Light::set_parameter(Parameter p_param, float p_value) { +bool Light::_can_gizmo_scale() const { - ERR_FAIL_INDEX(p_param, PARAM_MAX); - vars[p_param]=p_value; - VisualServer::get_singleton()->light_set_param(light,(VisualServer::LightParam)p_param,p_value); - if (p_param==PARAM_RADIUS || p_param==PARAM_SPOT_ANGLE) - update_gizmo(); - _change_notify(_light_param_names[p_param]); -// _change_notify(_param_names[p_param]); + return false; } -float Light::get_parameter(Parameter p_param) const { - ERR_FAIL_INDEX_V(p_param, PARAM_MAX, 0); - return vars[p_param]; +void Light::set_param(Param p_param, float p_value) { -} - -void Light::set_color(LightColor p_color, const Color& p_value) { + ERR_FAIL_INDEX(p_param,PARAM_MAX); + param[p_param]=p_value; - ERR_FAIL_INDEX(p_color, 3); - colors[p_color]=p_value; - VisualServer::get_singleton()->light_set_color(light,(VisualServer::LightColor)p_color,p_value); - //_change_notify(_color_names[p_color]); + VS::get_singleton()->light_set_param(light,VS::LightParam(p_param),p_value); -} -Color Light::get_color(LightColor p_color) const { + if (p_param==PARAM_SPOT_ANGLE || p_param==PARAM_RANGE) { + update_gizmo();; + } - ERR_FAIL_INDEX_V(p_color, 3, Color()); - return colors[p_color]; } +float Light::get_param(Param p_param) const{ -void Light::set_project_shadows(bool p_enabled) { + ERR_FAIL_INDEX_V(p_param,PARAM_MAX,0); + return param[p_param]; - shadows=p_enabled; - VisualServer::get_singleton()->light_set_shadow(light, p_enabled); - _change_notify("shadow"); } -bool Light::has_project_shadows() const { - return shadows; -} +void Light::set_shadow(bool p_enable){ -void Light::set_projector(const Ref<Texture>& p_projector) { + shadow=p_enable; + VS::get_singleton()->light_set_shadow(light,p_enable); - projector=p_projector; - VisualServer::get_singleton()->light_set_projector(light, projector.is_null()?RID():projector->get_rid()); } +bool Light::has_shadow() const{ -Ref<Texture> Light::get_projector() const { - - return projector; + return shadow; } +void Light::set_negative(bool p_enable){ -bool Light::_can_gizmo_scale() const { - - return false; + negative=p_enable; + VS::get_singleton()->light_set_negative(light,p_enable); } +bool Light::is_negative() const{ - -static void _make_sphere(int p_lats, int p_lons, float p_radius, Ref<SurfaceTool> p_tool) { - - - p_tool->begin(Mesh::PRIMITIVE_TRIANGLES); - - for(int i = 1; i <= p_lats; i++) { - double lat0 = Math_PI * (-0.5 + (double) (i - 1) / p_lats); - double z0 = Math::sin(lat0); - double zr0 = Math::cos(lat0); - - double lat1 = Math_PI * (-0.5 + (double) i / p_lats); - double z1 = Math::sin(lat1); - double zr1 = Math::cos(lat1); - - for(int j = p_lons; j >= 1; j--) { - - double lng0 = 2 * Math_PI * (double) (j - 1) / p_lons; - double x0 = Math::cos(lng0); - double y0 = Math::sin(lng0); - - double lng1 = 2 * Math_PI * (double) (j) / p_lons; - double x1 = Math::cos(lng1); - double y1 = Math::sin(lng1); - - - Vector3 v[4]={ - Vector3(x1 * zr0, z0, y1 *zr0), - Vector3(x1 * zr1, z1, y1 *zr1), - Vector3(x0 * zr1, z1, y0 *zr1), - Vector3(x0 * zr0, z0, y0 *zr0) - }; - -#define ADD_POINT(m_idx) \ - p_tool->add_normal(v[m_idx]);\ - p_tool->add_vertex(v[m_idx]*p_radius); - - ADD_POINT(0); - ADD_POINT(1); - ADD_POINT(2); - - ADD_POINT(2); - ADD_POINT(3); - ADD_POINT(0); - } - } - + return negative; } -RES Light::_get_gizmo_geometry() const { - - - Ref<FixedMaterial> mat_area( memnew( FixedMaterial )); - - mat_area->set_parameter( FixedMaterial::PARAM_DIFFUSE,Color(0.7,0.6,0.0,0.05) ); - mat_area->set_parameter( FixedMaterial::PARAM_EMISSION,Color(0.7,0.7,0.7) ); - mat_area->set_blend_mode( Material::BLEND_MODE_ADD ); - mat_area->set_flag(Material::FLAG_DOUBLE_SIDED,true); -// mat_area->set_hint(Material::HINT_NO_DEPTH_DRAW,true); - - Ref<FixedMaterial> mat_light( memnew( FixedMaterial )); - - mat_light->set_parameter( FixedMaterial::PARAM_DIFFUSE, Color(1.0,1.0,0.8,0.9) ); - mat_light->set_flag(Material::FLAG_UNSHADED,true); - - Ref< Mesh > mesh; - - Ref<SurfaceTool> surftool( memnew( SurfaceTool )); - - switch(type) { - - case VisualServer::LIGHT_DIRECTIONAL: { - - - mat_area->set_parameter( FixedMaterial::PARAM_DIFFUSE,Color(0.9,0.8,0.1,0.8) ); - mat_area->set_blend_mode( Material::BLEND_MODE_MIX); - mat_area->set_flag(Material::FLAG_DOUBLE_SIDED,false); - mat_area->set_flag(Material::FLAG_UNSHADED,true); - - _make_sphere( 5,5,0.6, surftool ); - surftool->set_material(mat_light); - mesh=surftool->commit(mesh); - - // float radius=1; - - surftool->begin(Mesh::PRIMITIVE_TRIANGLES); - - const int arrow_points=5; - Vector3 arrow[arrow_points]={ - Vector3(0,0,2), - Vector3(1,1,2), - Vector3(1,1,-1), - Vector3(2,2,-1), - Vector3(0,0,-3) - }; - - int arrow_sides=4; +void Light::set_cull_mask(uint32_t p_cull_mask){ + cull_mask=p_cull_mask; + VS::get_singleton()->light_set_cull_mask(light,p_cull_mask); - for(int i = 0; i < arrow_sides ; i++) { - - - Matrix3 ma(Vector3(0,0,1),Math_PI*2*float(i)/arrow_sides); - Matrix3 mb(Vector3(0,0,1),Math_PI*2*float(i+1)/arrow_sides); - - - for(int j=0;j<arrow_points-1;j++) { - - Vector3 points[4]={ - ma.xform(arrow[j]), - mb.xform(arrow[j]), - mb.xform(arrow[j+1]), - ma.xform(arrow[j+1]), - }; - - Vector3 n = Plane(points[0],points[1],points[2]).normal; - - surftool->add_normal(n); - surftool->add_vertex(points[0]); - surftool->add_normal(n); - surftool->add_vertex(points[1]); - surftool->add_normal(n); - surftool->add_vertex(points[2]); - - surftool->add_normal(n); - surftool->add_vertex(points[0]); - surftool->add_normal(n); - surftool->add_vertex(points[2]); - surftool->add_normal(n); - surftool->add_vertex(points[3]); - - - } - - - } - - surftool->set_material(mat_area); - mesh=surftool->commit(mesh); - - - - } break; - case VisualServer::LIGHT_OMNI: { - - - _make_sphere( 20,20,vars[PARAM_RADIUS], surftool ); - surftool->set_material(mat_area); - mesh=surftool->commit(mesh); - _make_sphere(5,5, 0.1, surftool ); - surftool->set_material(mat_light); - mesh=surftool->commit(mesh); - } break; - - case VisualServer::LIGHT_SPOT: { - - _make_sphere( 5,5,0.1, surftool ); - surftool->set_material(mat_light); - mesh=surftool->commit(mesh); - - // make cone - int points=24; - float len=vars[PARAM_RADIUS]; - float size=Math::tan(Math::deg2rad(vars[PARAM_SPOT_ANGLE]))*len; - - surftool->begin(Mesh::PRIMITIVE_TRIANGLES); - - for(int i = 0; i < points; i++) { - - float x0=Math::sin(i * Math_PI * 2 / points); - float y0=Math::cos(i * Math_PI * 2 / points); - float x1=Math::sin((i+1) * Math_PI * 2 / points); - float y1=Math::cos((i+1) * Math_PI * 2 / points); - - Vector3 v1=Vector3(x0*size,y0*size,-len).normalized()*len; - Vector3 v2=Vector3(x1*size,y1*size,-len).normalized()*len; - - Vector3 v3=Vector3(0,0,0); - Vector3 v4=Vector3(0,0,v1.z); - - Vector3 n = Plane(v1,v2,v3).normal; - - - surftool->add_normal(n); - surftool->add_vertex(v1); - surftool->add_normal(n); - surftool->add_vertex(v2); - surftool->add_normal(n); - surftool->add_vertex(v3); - - n=Vector3(0,0,-1); - - surftool->add_normal(n); - surftool->add_vertex(v1); - surftool->add_normal(n); - surftool->add_vertex(v2); - surftool->add_normal(n); - surftool->add_vertex(v4); - - - } - - surftool->set_material(mat_area); - mesh=surftool->commit(mesh); - - - } break; - } - - return mesh; } +uint32_t Light::get_cull_mask() const{ - -AABB Light::get_aabb() const { - - if (type==VisualServer::LIGHT_DIRECTIONAL) { - - return AABB( Vector3(-1,-1,-1), Vector3(2, 2, 2 ) ); - - } else if (type==VisualServer::LIGHT_OMNI) { - - return AABB( Vector3(-1,-1,-1) * vars[PARAM_RADIUS], Vector3(2, 2, 2 ) * vars[PARAM_RADIUS]); - - } else if (type==VisualServer::LIGHT_SPOT) { - - float len=vars[PARAM_RADIUS]; - float size=Math::tan(Math::deg2rad(vars[PARAM_SPOT_ANGLE]))*len; - return AABB( Vector3( -size,-size,-len ), Vector3( size*2, size*2, len ) ); - } - - return AABB(); -} - -DVector<Face3> Light::get_faces(uint32_t p_usage_flags) const { - - return DVector<Face3>(); + return cull_mask; } +void Light::set_color(const Color& p_color){ -void Light::set_operator(Operator p_op) { - ERR_FAIL_INDEX(p_op,2); - op=p_op; - VisualServer::get_singleton()->light_set_operator(light,VS::LightOp(op)); - + color=p_color; + VS::get_singleton()->light_set_color(light,p_color); } +Color Light::get_color() const{ -void Light::set_bake_mode(BakeMode p_bake_mode) { - - bake_mode=p_bake_mode; + return color; } -Light::BakeMode Light::get_bake_mode() const { +void Light::set_shadow_color(const Color& p_shadow_color){ - return bake_mode; + shadow_color=p_shadow_color; + VS::get_singleton()->light_set_shadow_color(light,p_shadow_color); } +Color Light::get_shadow_color() const{ -Light::Operator Light::get_operator() const { - - return op; + return shadow_color; } -void Light::approximate_opengl_attenuation(float p_constant, float p_linear, float p_quadratic,float p_radius_treshold) { - - //this is horrible and must never be used - - float a = p_quadratic * p_radius_treshold; - float b = p_linear * p_radius_treshold; - float c = p_constant * p_radius_treshold -1; - - float radius=10000; - - if(a == 0) { // solve linear - float d = Math::abs(-c/b); - if(d<radius) - radius=d; - - - } else { // solve quadratic - // now ad^2 + bd + c = 0, solve quadratic equation: - - float denominator = 2*a; - if(denominator != 0) { +Rect3 Light::get_aabb() const { - float root = b*b - 4*a*c; - - if(root >=0) { + if (type==VisualServer::LIGHT_DIRECTIONAL) { - root = sqrt(root); + return Rect3( Vector3(-1,-1,-1), Vector3(2, 2, 2 ) ); - float solution1 = fabs( (-b + root) / denominator); - float solution2 = fabs( (-b - root) / denominator); + } else if (type==VisualServer::LIGHT_OMNI) { - if(solution1 > radius) - solution1 = radius; + return Rect3( Vector3(-1,-1,-1) * param[PARAM_RANGE], Vector3(2, 2, 2 ) * param[PARAM_RANGE]); - if(solution2 > radius) - solution2 = radius; + } else if (type==VisualServer::LIGHT_SPOT) { - radius = (solution1 > solution2 ? solution1 : solution2); - } - } + float len=param[PARAM_RANGE]; + float size=Math::tan(Math::deg2rad(param[PARAM_SPOT_ANGLE]))*len; + return Rect3( Vector3( -size,-size,-len ), Vector3( size*2, size*2, len ) ); } - float energy=1.0; - - /*if (p_constant>0) - energy=1.0/p_constant; //energy is this - else - energy=8.0; // some high number.. -*/ - - if (radius==10000) - radius=100; //bug? + return Rect3(); +} - set_parameter(PARAM_RADIUS,radius); - set_parameter(PARAM_ENERGY,energy); +PoolVector<Face3> Light::get_faces(uint32_t p_usage_flags) const { + return PoolVector<Face3>(); } + void Light::_update_visibility() { if (!is_inside_tree()) return; -bool editor_ok=true; + bool editor_ok=true; #ifdef TOOLS_ENABLED if (editor_only) { @@ -452,7 +164,7 @@ bool editor_ok=true; } #endif - VS::get_singleton()->instance_light_set_enabled(get_instance(),is_visible() && enabled && editor_ok); + //VS::get_singleton()->instance_light_set_enabled(get_instance(),is_visible() && editor_ok); _change_notify("geometry/visible"); } @@ -460,22 +172,40 @@ bool editor_ok=true; void Light::_notification(int p_what) { - if (p_what==NOTIFICATION_ENTER_TREE || p_what==NOTIFICATION_VISIBILITY_CHANGED) { + + if (p_what==NOTIFICATION_VISIBILITY_CHANGED) { + _update_visibility(); + } -} -void Light::set_enabled(bool p_enabled) { + if (p_what==NOTIFICATION_ENTER_TREE) { + _update_visibility(); - enabled=p_enabled; - _update_visibility(); -} + Node *node = this; + + while(node) { + + baked_light=node->cast_to<BakedLight>(); + if (baked_light) { + baked_light->lights.insert(this); + break; + } + + node=node->get_parent(); + } + } + + if (p_what==NOTIFICATION_EXIT_TREE) { -bool Light::is_enabled() const{ + if (baked_light) { + baked_light->lights.erase(this); + } + } - return enabled; } + void Light::set_editor_only(bool p_editor_only) { editor_only=p_editor_only; @@ -490,68 +220,58 @@ bool Light::is_editor_only() const{ void Light::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_parameter","variable","value"), &Light::set_parameter ); - ObjectTypeDB::bind_method(_MD("get_parameter","variable"), &Light::get_parameter ); - ObjectTypeDB::bind_method(_MD("set_color","color","value"), &Light::set_color ); - ObjectTypeDB::bind_method(_MD("get_color","color"), &Light::get_color ); - ObjectTypeDB::bind_method(_MD("set_project_shadows","enable"), &Light::set_project_shadows ); - ObjectTypeDB::bind_method(_MD("has_project_shadows"), &Light::has_project_shadows ); - ObjectTypeDB::bind_method(_MD("set_projector","projector:Texture"), &Light::set_projector ); - ObjectTypeDB::bind_method(_MD("get_projector:Texture"), &Light::get_projector ); - ObjectTypeDB::bind_method(_MD("set_operator","operator"), &Light::set_operator ); - ObjectTypeDB::bind_method(_MD("get_operator"), &Light::get_operator ); - ObjectTypeDB::bind_method(_MD("set_bake_mode","bake_mode"), &Light::set_bake_mode ); - ObjectTypeDB::bind_method(_MD("get_bake_mode"), &Light::get_bake_mode ); - ObjectTypeDB::bind_method(_MD("set_enabled","enabled"), &Light::set_enabled ); - ObjectTypeDB::bind_method(_MD("is_enabled"), &Light::is_enabled ); - ObjectTypeDB::bind_method(_MD("set_editor_only","editor_only"), &Light::set_editor_only ); - ObjectTypeDB::bind_method(_MD("is_editor_only"), &Light::is_editor_only ); - - - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "params/enabled"), _SCS("set_enabled"), _SCS("is_enabled")); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "params/editor_only"), _SCS("set_editor_only"), _SCS("is_editor_only")); - ADD_PROPERTY( PropertyInfo( Variant::INT, "params/bake_mode",PROPERTY_HINT_ENUM,"Disabled,Indirect,Indirect+Shadows,Full"), _SCS("set_bake_mode"), _SCS("get_bake_mode")); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/energy", PROPERTY_HINT_EXP_RANGE, "0,64,0.01"), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_ENERGY ); - /* - if (type == VisualServer::LIGHT_OMNI || type == VisualServer::LIGHT_SPOT) { - ADD_PROPERTY( PropertyInfo( Variant::REAL, "params/radius", PROPERTY_HINT_RANGE, "0.01,4096,0.01")); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "params/attenuation", PROPERTY_HINT_RANGE, "0,8,0.01")); - } - if (type == VisualServer::LIGHT_SPOT) { - ADD_PROPERTY( PropertyInfo( Variant::REAL, "params/spot_angle", PROPERTY_HINT_RANGE, "0.01,90.0,0.01")); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "params/spot_attenuation", PROPERTY_HINT_RANGE, "0,8,0.01")); + ClassDB::bind_method(_MD("set_editor_only","editor_only"), &Light::set_editor_only ); + ClassDB::bind_method(_MD("is_editor_only"), &Light::is_editor_only ); + + + ClassDB::bind_method(_MD("set_param","param","value"), &Light::set_param ); + ClassDB::bind_method(_MD("get_param","param"), &Light::get_param ); + + ClassDB::bind_method(_MD("set_shadow","enabled"), &Light::set_shadow ); + ClassDB::bind_method(_MD("has_shadow"), &Light::has_shadow ); + + ClassDB::bind_method(_MD("set_negative","enabled"), &Light::set_negative ); + ClassDB::bind_method(_MD("is_negative"), &Light::is_negative ); - }*/ + ClassDB::bind_method(_MD("set_cull_mask","cull_mask"), &Light::set_cull_mask ); + ClassDB::bind_method(_MD("get_cull_mask"), &Light::get_cull_mask ); - ADD_PROPERTYI( PropertyInfo( Variant::COLOR, "colors/diffuse"), _SCS("set_color"), _SCS("get_color"),COLOR_DIFFUSE); - ADD_PROPERTYI( PropertyInfo( Variant::COLOR, "colors/specular"), _SCS("set_color"), _SCS("get_color"),COLOR_SPECULAR); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "shadow/shadow"), _SCS("set_project_shadows"), _SCS("has_project_shadows")); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "shadow/darkening", PROPERTY_HINT_RANGE, "0,1,0.01"), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_SHADOW_DARKENING ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "shadow/z_offset", PROPERTY_HINT_RANGE, "0,128,0.001"), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_SHADOW_Z_OFFSET); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "shadow/z_slope_scale", PROPERTY_HINT_RANGE, "0,128,0.001"), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_SHADOW_Z_SLOPE_SCALE); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "shadow/esm_multiplier", PROPERTY_HINT_RANGE, "1.0,512.0,0.1"), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_SHADOW_ESM_MULTIPLIER); - ADD_PROPERTYI( PropertyInfo( Variant::INT, "shadow/blur_passes", PROPERTY_HINT_RANGE, "0,4,1"), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_SHADOW_BLUR_PASSES); - ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "projector",PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_projector"), _SCS("get_projector")); - ADD_PROPERTY( PropertyInfo( Variant::INT, "operator",PROPERTY_HINT_ENUM,"Add,Sub"), _SCS("set_operator"), _SCS("get_operator")); + ClassDB::bind_method(_MD("set_color","color"), &Light::set_color ); + ClassDB::bind_method(_MD("get_color"), &Light::get_color ); + ClassDB::bind_method(_MD("set_shadow_color","shadow_color"), &Light::set_shadow_color ); + ClassDB::bind_method(_MD("get_shadow_color"), &Light::get_shadow_color ); + + ADD_GROUP("Light","light_"); + ADD_PROPERTY( PropertyInfo( Variant::COLOR, "light_color",PROPERTY_HINT_COLOR_NO_ALPHA), _SCS("set_color"), _SCS("get_color")); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "light_energy",PROPERTY_HINT_RANGE,"0,16,0.01"), _SCS("set_param"), _SCS("get_param"), PARAM_ENERGY); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "light_negative"), _SCS("set_negative"), _SCS("is_negative")); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "light_specular",PROPERTY_HINT_RANGE,"0,1,0.01"), _SCS("set_param"), _SCS("get_param"), PARAM_SPECULAR); + ADD_PROPERTY( PropertyInfo( Variant::INT, "light_cull_mask",PROPERTY_HINT_LAYERS_3D_RENDER), _SCS("set_cull_mask"), _SCS("get_cull_mask")); + ADD_GROUP("Shadow","shadow_"); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "shadow_enabled"), _SCS("set_shadow"), _SCS("has_shadow")); + ADD_PROPERTY( PropertyInfo( Variant::COLOR, "shadow_color",PROPERTY_HINT_COLOR_NO_ALPHA), _SCS("set_shadow_color"), _SCS("get_shadow_color")); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "shadow_bias",PROPERTY_HINT_RANGE,"-16,16,0.01"), _SCS("set_param"), _SCS("get_param"), PARAM_SHADOW_BIAS); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "shadow_max_distance",PROPERTY_HINT_RANGE,"0,65536,0.1"), _SCS("set_param"), _SCS("get_param"), PARAM_SHADOW_MAX_DISTANCE); + ADD_GROUP("Editor",""); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "editor_only"), _SCS("set_editor_only"), _SCS("is_editor_only")); + ADD_GROUP("",""); - BIND_CONSTANT( PARAM_RADIUS ); BIND_CONSTANT( PARAM_ENERGY ); + BIND_CONSTANT( PARAM_SPECULAR ); + BIND_CONSTANT( PARAM_RANGE ); BIND_CONSTANT( PARAM_ATTENUATION ); BIND_CONSTANT( PARAM_SPOT_ANGLE ); BIND_CONSTANT( PARAM_SPOT_ATTENUATION ); - BIND_CONSTANT( PARAM_SHADOW_DARKENING ); - BIND_CONSTANT( PARAM_SHADOW_Z_OFFSET ); - - - BIND_CONSTANT( COLOR_DIFFUSE ); - BIND_CONSTANT( COLOR_SPECULAR ); - - BIND_CONSTANT( BAKE_MODE_DISABLED ); - BIND_CONSTANT( BAKE_MODE_INDIRECT ); - BIND_CONSTANT( BAKE_MODE_INDIRECT_AND_SHADOWS ); - BIND_CONSTANT( BAKE_MODE_FULL ); + BIND_CONSTANT( PARAM_SHADOW_MAX_DISTANCE ); + BIND_CONSTANT( PARAM_SHADOW_SPLIT_1_OFFSET ); + BIND_CONSTANT( PARAM_SHADOW_SPLIT_2_OFFSET ); + BIND_CONSTANT( PARAM_SHADOW_SPLIT_3_OFFSET ); + BIND_CONSTANT( PARAM_SHADOW_NORMAL_BIAS ); + BIND_CONSTANT( PARAM_SHADOW_BIAS ); + BIND_CONSTANT( PARAM_SHADOW_BIAS_SPLIT_SCALE ); + BIND_CONSTANT( PARAM_MAX ); } @@ -561,28 +281,29 @@ Light::Light(VisualServer::LightType p_type) { type=p_type; light=VisualServer::get_singleton()->light_create(p_type); + VS::get_singleton()->instance_set_base(get_instance(),light); + + baked_light=NULL; - set_parameter(PARAM_SPOT_ATTENUATION,1.0); - set_parameter(PARAM_SPOT_ANGLE,30.0); - set_parameter(PARAM_RADIUS,2.0); - set_parameter(PARAM_ENERGY,1.0); - set_parameter(PARAM_ATTENUATION,1.0); - set_parameter(PARAM_SHADOW_DARKENING,0.0); - set_parameter(PARAM_SHADOW_Z_OFFSET,0.05); - set_parameter(PARAM_SHADOW_Z_SLOPE_SCALE,0); - set_parameter(PARAM_SHADOW_ESM_MULTIPLIER,60); - set_parameter(PARAM_SHADOW_BLUR_PASSES,1); - - - set_color( COLOR_DIFFUSE, Color(1,1,1)); - set_color( COLOR_SPECULAR, Color(1,1,1)); - - op=OPERATOR_ADD; - set_project_shadows( false ); - set_base(light); - enabled=true; editor_only=false; - bake_mode=BAKE_MODE_DISABLED; + set_color(Color(1,1,1,1)); + set_shadow(false); + set_negative(false); + set_cull_mask(0xFFFFFFFF); + + set_param(PARAM_ENERGY,1); + set_param(PARAM_SPECULAR,0.5); + set_param(PARAM_RANGE,5); + set_param(PARAM_ATTENUATION,1); + set_param(PARAM_SPOT_ANGLE,45); + set_param(PARAM_SPOT_ATTENUATION,1); + set_param(PARAM_SHADOW_MAX_DISTANCE,0); + set_param(PARAM_SHADOW_SPLIT_1_OFFSET,0.1); + set_param(PARAM_SHADOW_SPLIT_2_OFFSET,0.2); + set_param(PARAM_SHADOW_SPLIT_3_OFFSET,0.5); + set_param(PARAM_SHADOW_NORMAL_BIAS,0.1); + set_param(PARAM_SHADOW_BIAS,0.1); + set_param(PARAM_SHADOW_BIAS_SPLIT_SCALE,0.1); } @@ -596,83 +317,119 @@ Light::Light() { Light::~Light() { + VS::get_singleton()->instance_set_base(get_instance(),RID()); + if (light.is_valid()) VisualServer::get_singleton()->free(light); } ///////////////////////////////////////// - void DirectionalLight::set_shadow_mode(ShadowMode p_mode) { shadow_mode=p_mode; - VS::get_singleton()->light_directional_set_shadow_mode(light,(VS::LightDirectionalShadowMode)p_mode); - + VS::get_singleton()->light_directional_set_shadow_mode(light,VS::LightDirectionalShadowMode(p_mode)); } -DirectionalLight::ShadowMode DirectionalLight::get_shadow_mode() const{ +DirectionalLight::ShadowMode DirectionalLight::get_shadow_mode() const { return shadow_mode; } -void DirectionalLight::set_shadow_param(ShadowParam p_param, float p_value) { +void DirectionalLight::set_blend_splits(bool p_enable) { - ERR_FAIL_INDEX(p_param,3); - shadow_param[p_param]=p_value; - VS::get_singleton()->light_directional_set_shadow_param(light,VS::LightDirectionalShadowParam(p_param),p_value); + blend_splits=p_enable; + VS::get_singleton()->light_directional_set_blend_splits(light,p_enable); } -float DirectionalLight::get_shadow_param(ShadowParam p_param) const { - ERR_FAIL_INDEX_V(p_param,3,0); - return shadow_param[p_param]; +bool DirectionalLight::is_blend_splits_enabled() const { + + return blend_splits; } + void DirectionalLight::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_shadow_mode","mode"),&DirectionalLight::set_shadow_mode); - ObjectTypeDB::bind_method(_MD("get_shadow_mode"),&DirectionalLight::get_shadow_mode); - ObjectTypeDB::bind_method(_MD("set_shadow_param","param","value"),&DirectionalLight::set_shadow_param); - ObjectTypeDB::bind_method(_MD("get_shadow_param","param"),&DirectionalLight::get_shadow_param); + ClassDB::bind_method( _MD("set_shadow_mode","mode"),&DirectionalLight::set_shadow_mode); + ClassDB::bind_method( _MD("get_shadow_mode"),&DirectionalLight::get_shadow_mode); - ADD_PROPERTY( PropertyInfo(Variant::INT,"shadow/mode",PROPERTY_HINT_ENUM,"Orthogonal,Perspective,PSSM 2 Splits,PSSM 4 Splits"),_SCS("set_shadow_mode"),_SCS("get_shadow_mode")); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"shadow/max_distance",PROPERTY_HINT_EXP_RANGE,"0.00,99999,0.01"),_SCS("set_shadow_param"),_SCS("get_shadow_param"), SHADOW_PARAM_MAX_DISTANCE); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"shadow/split_weight",PROPERTY_HINT_RANGE,"0.01,1.0,0.01"),_SCS("set_shadow_param"),_SCS("get_shadow_param"), SHADOW_PARAM_PSSM_SPLIT_WEIGHT); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"shadow/zoffset_scale",PROPERTY_HINT_RANGE,"0.01,1024.0,0.01"),_SCS("set_shadow_param"),_SCS("get_shadow_param"), SHADOW_PARAM_PSSM_ZOFFSET_SCALE); + ClassDB::bind_method( _MD("set_blend_splits","enabled"),&DirectionalLight::set_blend_splits); + ClassDB::bind_method( _MD("is_blend_splits_enabled"),&DirectionalLight::is_blend_splits_enabled); + + ADD_GROUP("Directional Shadow","directional_shadow_"); + ADD_PROPERTY( PropertyInfo( Variant::INT, "directional_shadow_mode",PROPERTY_HINT_ENUM,"Orthogonal,PSSM 2 Splits,PSSM 4 Splits"), _SCS("set_shadow_mode"), _SCS("get_shadow_mode")); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "directional_shadow_split_1",PROPERTY_HINT_RANGE,"0,1,0.001"), _SCS("set_param"), _SCS("get_param"), PARAM_SHADOW_SPLIT_1_OFFSET); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "directional_shadow_split_2",PROPERTY_HINT_RANGE,"0,1,0.001"), _SCS("set_param"), _SCS("get_param"), PARAM_SHADOW_SPLIT_2_OFFSET); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "directional_shadow_split_3",PROPERTY_HINT_RANGE,"0,1,0.001"), _SCS("set_param"), _SCS("get_param"), PARAM_SHADOW_SPLIT_3_OFFSET); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "directional_shadow_blend_splits"), _SCS("set_blend_splits"), _SCS("is_blend_splits_enabled")); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "directional_shadow_normal_bias",PROPERTY_HINT_RANGE,"0,16,0.01"), _SCS("set_param"), _SCS("get_param"), PARAM_SHADOW_NORMAL_BIAS); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "directional_shadow_bias_split_scale",PROPERTY_HINT_RANGE,"0,16,0.01"), _SCS("set_param"), _SCS("get_param"), PARAM_SHADOW_BIAS_SPLIT_SCALE); BIND_CONSTANT( SHADOW_ORTHOGONAL ); - BIND_CONSTANT( SHADOW_PERSPECTIVE ); BIND_CONSTANT( SHADOW_PARALLEL_2_SPLITS ); BIND_CONSTANT( SHADOW_PARALLEL_4_SPLITS ); - BIND_CONSTANT( SHADOW_PARAM_MAX_DISTANCE ); - BIND_CONSTANT( SHADOW_PARAM_PSSM_SPLIT_WEIGHT ); - BIND_CONSTANT( SHADOW_PARAM_PSSM_ZOFFSET_SCALE ); } DirectionalLight::DirectionalLight() : Light( VisualServer::LIGHT_DIRECTIONAL ) { - shadow_mode=SHADOW_ORTHOGONAL; - shadow_param[SHADOW_PARAM_MAX_DISTANCE]=0; - shadow_param[SHADOW_PARAM_PSSM_SPLIT_WEIGHT]=0.5; - shadow_param[SHADOW_PARAM_PSSM_ZOFFSET_SCALE]=2.0; + set_shadow_mode(SHADOW_PARALLEL_4_SPLITS); + blend_splits=false; +} +void OmniLight::set_shadow_mode(ShadowMode p_mode) { + shadow_mode=p_mode; + VS::get_singleton()->light_omni_set_shadow_mode(light,VS::LightOmniShadowMode(p_mode)); } +OmniLight::ShadowMode OmniLight::get_shadow_mode() const{ + + return shadow_mode; +} + +void OmniLight::set_shadow_detail(ShadowDetail p_detail){ + + shadow_detail=p_detail; + VS::get_singleton()->light_omni_set_shadow_detail(light,VS::LightOmniShadowDetail(p_detail)); +} +OmniLight::ShadowDetail OmniLight::get_shadow_detail() const{ + + return shadow_detail; +} + + + void OmniLight::_bind_methods() { - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/radius", PROPERTY_HINT_EXP_RANGE, "0.2,4096,0.01"), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_RADIUS ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/attenuation", PROPERTY_HINT_EXP_EASING, "attenuation"), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_ATTENUATION ); + ClassDB::bind_method( _MD("set_shadow_mode","mode"),&OmniLight::set_shadow_mode); + ClassDB::bind_method( _MD("get_shadow_mode"),&OmniLight::get_shadow_mode); + + ClassDB::bind_method( _MD("set_shadow_detail","detail"),&OmniLight::set_shadow_detail); + ClassDB::bind_method( _MD("get_shadow_detail"),&OmniLight::get_shadow_detail); + + ADD_GROUP("Omni","omni_"); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "omni_range",PROPERTY_HINT_RANGE,"0,65536,0.1"), _SCS("set_param"), _SCS("get_param"), PARAM_RANGE); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "omni_attenuation",PROPERTY_HINT_EXP_EASING), _SCS("set_param"), _SCS("get_param"), PARAM_ATTENUATION); + ADD_PROPERTY( PropertyInfo( Variant::INT, "omni_shadow_mode",PROPERTY_HINT_ENUM,"Dual Paraboloid,Cube"), _SCS("set_shadow_mode"), _SCS("get_shadow_mode")); + ADD_PROPERTY( PropertyInfo( Variant::INT, "omni_shadow_detail",PROPERTY_HINT_ENUM,"Vertical,Horizontal"), _SCS("set_shadow_detail"), _SCS("get_shadow_detail")); } -void SpotLight::_bind_methods() { +OmniLight::OmniLight() : Light( VisualServer::LIGHT_OMNI ) { + + set_shadow_mode(SHADOW_DUAL_PARABOLOID); + set_shadow_detail(SHADOW_DETAIL_HORIZONTAL); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/radius", PROPERTY_HINT_EXP_RANGE, "0.2,4096,0.01"), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_RADIUS ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/attenuation", PROPERTY_HINT_EXP_EASING, "attenuation"), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_ATTENUATION ); +} + +void SpotLight::_bind_methods() { - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/spot_angle", PROPERTY_HINT_RANGE, "0.01,89.9,0.01"), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_SPOT_ANGLE ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/spot_attenuation", PROPERTY_HINT_EXP_EASING, "spot_attenuation"), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_SPOT_ATTENUATION ); + ADD_GROUP("Spot","spot_"); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "spot_range",PROPERTY_HINT_RANGE,"0,65536,0.1"), _SCS("set_param"), _SCS("get_param"), PARAM_RANGE); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "spot_attenuation",PROPERTY_HINT_EXP_EASING), _SCS("set_param"), _SCS("get_param"), PARAM_ATTENUATION); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "spot_angle",PROPERTY_HINT_RANGE,"0,180,0.1"), _SCS("set_param"), _SCS("get_param"), PARAM_SPOT_ANGLE); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "spot_angle_attenuation",PROPERTY_HINT_EXP_EASING), _SCS("set_param"), _SCS("get_param"), PARAM_SPOT_ATTENUATION); } diff --git a/scene/3d/light.h b/scene/3d/light.h index b25c6a44b5..d27b9fed12 100644 --- a/scene/3d/light.h +++ b/scene/3d/light.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,65 +37,47 @@ /** @author Juan Linietsky <reduzio@gmail.com> */ -class Light : public VisualInstance { - - OBJ_TYPE( Light, VisualInstance ); - OBJ_CATEGORY("3D Light Nodes"); -public: - - enum Parameter { - PARAM_RADIUS=VisualServer::LIGHT_PARAM_RADIUS, - PARAM_ENERGY=VisualServer::LIGHT_PARAM_ENERGY, - PARAM_ATTENUATION=VisualServer::LIGHT_PARAM_ATTENUATION, - PARAM_SPOT_ANGLE=VisualServer::LIGHT_PARAM_SPOT_ANGLE, - PARAM_SPOT_ATTENUATION=VisualServer::LIGHT_PARAM_SPOT_ATTENUATION, - PARAM_SHADOW_DARKENING=VisualServer::LIGHT_PARAM_SHADOW_DARKENING, - PARAM_SHADOW_Z_OFFSET=VisualServer::LIGHT_PARAM_SHADOW_Z_OFFSET, - PARAM_SHADOW_Z_SLOPE_SCALE=VisualServer::LIGHT_PARAM_SHADOW_Z_SLOPE_SCALE, - PARAM_SHADOW_ESM_MULTIPLIER=VisualServer::LIGHT_PARAM_SHADOW_ESM_MULTIPLIER, - PARAM_SHADOW_BLUR_PASSES=VisualServer::LIGHT_PARAM_SHADOW_BLUR_PASSES, - PARAM_MAX=VisualServer::LIGHT_PARAM_MAX - }; +class BakedLight; - enum LightColor { - - COLOR_DIFFUSE=VisualServer::LIGHT_COLOR_DIFFUSE, - COLOR_SPECULAR=VisualServer::LIGHT_COLOR_SPECULAR - }; +class Light : public VisualInstance { - enum BakeMode { + GDCLASS( Light, VisualInstance ); + OBJ_CATEGORY("3D Light Nodes"); - BAKE_MODE_DISABLED, - BAKE_MODE_INDIRECT, - BAKE_MODE_INDIRECT_AND_SHADOWS, - BAKE_MODE_FULL +public: + enum Param { + PARAM_ENERGY = VS::LIGHT_PARAM_ENERGY, + PARAM_SPECULAR = VS::LIGHT_PARAM_SPECULAR, + PARAM_RANGE = VS::LIGHT_PARAM_RANGE, + PARAM_ATTENUATION = VS::LIGHT_PARAM_ATTENUATION, + PARAM_SPOT_ANGLE = VS::LIGHT_PARAM_SPOT_ANGLE, + PARAM_SPOT_ATTENUATION = VS::LIGHT_PARAM_SPOT_ATTENUATION, + PARAM_SHADOW_MAX_DISTANCE = VS::LIGHT_PARAM_SHADOW_MAX_DISTANCE, + PARAM_SHADOW_SPLIT_1_OFFSET = VS::LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET, + PARAM_SHADOW_SPLIT_2_OFFSET = VS::LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET, + PARAM_SHADOW_SPLIT_3_OFFSET = VS::LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET, + PARAM_SHADOW_NORMAL_BIAS = VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS, + PARAM_SHADOW_BIAS = VS::LIGHT_PARAM_SHADOW_BIAS, + PARAM_SHADOW_BIAS_SPLIT_SCALE = VS::LIGHT_PARAM_SHADOW_BIAS_SPLIT_SCALE, + PARAM_MAX = VS::LIGHT_PARAM_MAX }; - - enum Operator { - - OPERATOR_ADD, - OPERATOR_SUB - }; private: - - Ref<Texture> projector; - float vars[PARAM_MAX]; - Color colors[3]; - - - BakeMode bake_mode; - VisualServer::LightType type; - bool shadows; - bool enabled; + Color color; + float param[PARAM_MAX]; + Color shadow_color; + bool shadow; + bool negative; + uint32_t cull_mask; + VS::LightType type; bool editor_only; - Operator op; - void _update_visibility(); + + BakedLight *baked_light; // bind helpers protected: @@ -103,8 +85,7 @@ protected: RID light; virtual bool _can_gizmo_scale() const; - virtual RES _get_gizmo_geometry() const; - + static void _bind_methods(); void _notification(int p_what); @@ -114,67 +95,56 @@ public: VS::LightType get_light_type() const { return type; } - void set_parameter(Parameter p_var, float p_value); - float get_parameter(Parameter p_var) const; - - void set_color(LightColor p_color,const Color& p_value); - Color get_color(LightColor p_color) const; + void set_editor_only(bool p_editor_only); + bool is_editor_only() const; - void set_project_shadows(bool p_enabled); - bool has_project_shadows() const; + void set_param(Param p_param, float p_value); + float get_param(Param p_param) const; - void set_projector(const Ref<Texture>& p_projector); - Ref<Texture> get_projector() const; + void set_shadow(bool p_enable); + bool has_shadow() const; - void set_operator(Operator p_op); - Operator get_operator() const; + void set_negative(bool p_enable); + bool is_negative() const; - void set_bake_mode(BakeMode p_bake_mode); - BakeMode get_bake_mode() const; + void set_cull_mask(uint32_t p_cull_mask); + uint32_t get_cull_mask() const; - void set_enabled(bool p_enabled); - bool is_enabled() const; + void set_color(const Color& p_color); + Color get_color() const; - void set_editor_only(bool p_editor_only); - bool is_editor_only() const; + void set_shadow_color(const Color& p_shadow_color); + Color get_shadow_color() const; - virtual AABB get_aabb() const; - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const; - void approximate_opengl_attenuation(float p_constant, float p_linear, float p_quadratic, float p_radius_treshold=0.5); + virtual Rect3 get_aabb() const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; Light(); ~Light(); }; -VARIANT_ENUM_CAST( Light::Parameter ); -VARIANT_ENUM_CAST( Light::LightColor ); -VARIANT_ENUM_CAST( Light::Operator ); -VARIANT_ENUM_CAST( Light::BakeMode); +VARIANT_ENUM_CAST(Light::Param); class DirectionalLight : public Light { - OBJ_TYPE( DirectionalLight, Light ); + GDCLASS( DirectionalLight, Light ); public: enum ShadowMode { SHADOW_ORTHOGONAL, - SHADOW_PERSPECTIVE, SHADOW_PARALLEL_2_SPLITS, SHADOW_PARALLEL_4_SPLITS }; - enum ShadowParam { - SHADOW_PARAM_MAX_DISTANCE, - SHADOW_PARAM_PSSM_SPLIT_WEIGHT, - SHADOW_PARAM_PSSM_ZOFFSET_SCALE - }; private: + + bool blend_splits; ShadowMode shadow_mode; - float shadow_param[3]; + protected: static void _bind_methods(); public: @@ -182,33 +152,54 @@ public: void set_shadow_mode(ShadowMode p_mode); ShadowMode get_shadow_mode() const; - void set_shadow_max_distance(float p_distance); - float get_shadow_max_distance() const; - void set_shadow_param(ShadowParam p_param, float p_value); - float get_shadow_param(ShadowParam p_param) const; + void set_blend_splits(bool p_enable); + bool is_blend_splits_enabled() const; DirectionalLight(); }; -VARIANT_ENUM_CAST( DirectionalLight::ShadowMode ); -VARIANT_ENUM_CAST( DirectionalLight::ShadowParam ); - +VARIANT_ENUM_CAST(DirectionalLight::ShadowMode) class OmniLight : public Light { - OBJ_TYPE( OmniLight, Light ); + GDCLASS( OmniLight, Light ); +public: + // omni light + enum ShadowMode { + SHADOW_DUAL_PARABOLOID, + SHADOW_CUBE, + }; + + // omni light + enum ShadowDetail { + SHADOW_DETAIL_VERTICAL, + SHADOW_DETAIL_HORIZONTAL + }; + +private: + + ShadowMode shadow_mode; + ShadowDetail shadow_detail; protected: static void _bind_methods(); public: + void set_shadow_mode(ShadowMode p_mode); + ShadowMode get_shadow_mode() const; - OmniLight() : Light( VisualServer::LIGHT_OMNI ) { set_parameter(PARAM_SHADOW_Z_OFFSET,0.001);} + void set_shadow_detail(ShadowDetail p_detail); + ShadowDetail get_shadow_detail() const; + + OmniLight(); }; +VARIANT_ENUM_CAST(OmniLight::ShadowMode) +VARIANT_ENUM_CAST(OmniLight::ShadowDetail) + class SpotLight : public Light { - OBJ_TYPE( SpotLight, Light ); + GDCLASS( SpotLight, Light ); protected: static void _bind_methods(); public: diff --git a/scene/3d/listener.cpp b/scene/3d/listener.cpp index bf42a5c92e..a227f5cd70 100644 --- a/scene/3d/listener.cpp +++ b/scene/3d/listener.cpp @@ -146,10 +146,10 @@ RES Listener::_get_gizmo_geometry() const { void Listener::_bind_methods() { - ObjectTypeDB::bind_method( _MD("make_current"),&Listener::make_current ); - ObjectTypeDB::bind_method( _MD("clear_current"),&Listener::clear_current ); - ObjectTypeDB::bind_method( _MD("is_current"),&Listener::is_current ); - ObjectTypeDB::bind_method( _MD("get_listener_transform"),&Listener::get_listener_transform ); + ClassDB::bind_method( _MD("make_current"),&Listener::make_current ); + ClassDB::bind_method( _MD("clear_current"),&Listener::clear_current ); + ClassDB::bind_method( _MD("is_current"),&Listener::is_current ); + ClassDB::bind_method( _MD("get_listener_transform"),&Listener::get_listener_transform ); } Listener::Listener() { diff --git a/scene/3d/listener.h b/scene/3d/listener.h index bf0281a8e0..be1b793716 100644 --- a/scene/3d/listener.h +++ b/scene/3d/listener.h @@ -7,7 +7,7 @@ class Listener : public Spatial { - OBJ_TYPE(Listener, Spatial); + GDCLASS(Listener, Spatial); private: bool force_change; diff --git a/scene/3d/mesh_instance.cpp b/scene/3d/mesh_instance.cpp index ef956e8ad9..c4712ecc7a 100644 --- a/scene/3d/mesh_instance.cpp +++ b/scene/3d/mesh_instance.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -169,21 +169,21 @@ NodePath MeshInstance::get_skeleton_path() { return skeleton_path; } -AABB MeshInstance::get_aabb() const { +Rect3 MeshInstance::get_aabb() const { if (!mesh.is_null()) return mesh->get_aabb(); - return AABB(); + return Rect3(); } -DVector<Face3> MeshInstance::get_faces(uint32_t p_usage_flags) const { +PoolVector<Face3> MeshInstance::get_faces(uint32_t p_usage_flags) const { if (!(p_usage_flags&(FACES_SOLID|FACES_ENCLOSING))) - return DVector<Face3>(); + return PoolVector<Face3>(); if (mesh.is_null()) - return DVector<Face3>(); + return PoolVector<Face3>(); return mesh->get_faces(); } @@ -294,18 +294,19 @@ void MeshInstance::_mesh_changed() { void MeshInstance::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_mesh","mesh:Mesh"),&MeshInstance::set_mesh); - ObjectTypeDB::bind_method(_MD("get_mesh:Mesh"),&MeshInstance::get_mesh); - ObjectTypeDB::bind_method(_MD("set_skeleton_path","skeleton_path:NodePath"),&MeshInstance::set_skeleton_path); - ObjectTypeDB::bind_method(_MD("get_skeleton_path:NodePath"),&MeshInstance::get_skeleton_path); - ObjectTypeDB::bind_method(_MD("get_aabb"),&MeshInstance::get_aabb); - ObjectTypeDB::bind_method(_MD("create_trimesh_collision"),&MeshInstance::create_trimesh_collision); - ObjectTypeDB::set_method_flags("MeshInstance","create_trimesh_collision",METHOD_FLAGS_DEFAULT); - ObjectTypeDB::bind_method(_MD("create_convex_collision"),&MeshInstance::create_convex_collision); - ObjectTypeDB::set_method_flags("MeshInstance","create_convex_collision",METHOD_FLAGS_DEFAULT); - ObjectTypeDB::bind_method(_MD("_mesh_changed"),&MeshInstance::_mesh_changed); - ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "mesh/mesh", PROPERTY_HINT_RESOURCE_TYPE, "Mesh" ), _SCS("set_mesh"), _SCS("get_mesh")); - ADD_PROPERTY( PropertyInfo (Variant::NODE_PATH, "mesh/skeleton"), _SCS("set_skeleton_path"), _SCS("get_skeleton_path")); + ClassDB::bind_method(_MD("set_mesh","mesh:Mesh"),&MeshInstance::set_mesh); + ClassDB::bind_method(_MD("get_mesh:Mesh"),&MeshInstance::get_mesh); + ClassDB::bind_method(_MD("set_skeleton_path","skeleton_path:NodePath"),&MeshInstance::set_skeleton_path); + ClassDB::bind_method(_MD("get_skeleton_path:NodePath"),&MeshInstance::get_skeleton_path); + ClassDB::bind_method(_MD("get_aabb"),&MeshInstance::get_aabb); + ClassDB::bind_method(_MD("create_trimesh_collision"),&MeshInstance::create_trimesh_collision); + ClassDB::set_method_flags("MeshInstance","create_trimesh_collision",METHOD_FLAGS_DEFAULT); + ClassDB::bind_method(_MD("create_convex_collision"),&MeshInstance::create_convex_collision); + ClassDB::set_method_flags("MeshInstance","create_convex_collision",METHOD_FLAGS_DEFAULT); + ClassDB::bind_method(_MD("_mesh_changed"),&MeshInstance::_mesh_changed); + + ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "mesh", PROPERTY_HINT_RESOURCE_TYPE, "Mesh" ), _SCS("set_mesh"), _SCS("get_mesh")); + ADD_PROPERTY( PropertyInfo (Variant::NODE_PATH, "skeleton"), _SCS("set_skeleton_path"), _SCS("get_skeleton_path")); } MeshInstance::MeshInstance() diff --git a/scene/3d/mesh_instance.h b/scene/3d/mesh_instance.h index fd8faf38b4..4d28cc2942 100644 --- a/scene/3d/mesh_instance.h +++ b/scene/3d/mesh_instance.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ */ class MeshInstance : public GeometryInstance { - OBJ_TYPE( MeshInstance, GeometryInstance ); + GDCLASS( MeshInstance, GeometryInstance ); Ref<Mesh> mesh; NodePath skeleton_path; @@ -80,8 +80,8 @@ public: Node* create_convex_collision_node(); void create_convex_collision(); - virtual AABB get_aabb() const; - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual Rect3 get_aabb() const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; MeshInstance(); ~MeshInstance(); diff --git a/scene/3d/multimesh_instance.cpp b/scene/3d/multimesh_instance.cpp index 0e97a97943..31843fadaa 100644 --- a/scene/3d/multimesh_instance.cpp +++ b/scene/3d/multimesh_instance.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,8 +34,8 @@ void MultiMeshInstance::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_multimesh","multimesh"),&MultiMeshInstance::set_multimesh); - ObjectTypeDB::bind_method(_MD("get_multimesh"),&MultiMeshInstance::get_multimesh); + ClassDB::bind_method(_MD("set_multimesh","multimesh"),&MultiMeshInstance::set_multimesh); + ClassDB::bind_method(_MD("get_multimesh"),&MultiMeshInstance::get_multimesh); ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"multimesh",PROPERTY_HINT_RESOURCE_TYPE,"MultiMesh"), _SCS("set_multimesh"), _SCS("get_multimesh")); @@ -58,15 +58,15 @@ Ref<MultiMesh> MultiMeshInstance::get_multimesh() const { -DVector<Face3> MultiMeshInstance::get_faces(uint32_t p_usage_flags) const { +PoolVector<Face3> MultiMeshInstance::get_faces(uint32_t p_usage_flags) const { - return DVector<Face3>(); + return PoolVector<Face3>(); } -AABB MultiMeshInstance::get_aabb() const { +Rect3 MultiMeshInstance::get_aabb() const { if (multimesh.is_null()) - return AABB(); + return Rect3(); else return multimesh->get_aabb(); } diff --git a/scene/3d/multimesh_instance.h b/scene/3d/multimesh_instance.h index 7cd9a8ea82..535e4275a3 100644 --- a/scene/3d/multimesh_instance.h +++ b/scene/3d/multimesh_instance.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ */ class MultiMeshInstance : public GeometryInstance { - OBJ_TYPE( MultiMeshInstance, GeometryInstance ); + GDCLASS( MultiMeshInstance, GeometryInstance ); Ref<MultiMesh> multimesh; @@ -49,12 +49,12 @@ protected: public: - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; void set_multimesh(const Ref<MultiMesh>& p_multimesh); Ref<MultiMesh> get_multimesh() const; - virtual AABB get_aabb() const; + virtual Rect3 get_aabb() const; MultiMeshInstance(); ~MultiMeshInstance(); diff --git a/scene/3d/navigation.cpp b/scene/3d/navigation.cpp index 74f83b67da..40666a60dc 100644 --- a/scene/3d/navigation.cpp +++ b/scene/3d/navigation.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,12 +36,12 @@ void Navigation::_navmesh_link(int p_id) { print_line("LINK"); - DVector<Vector3> vertices=nm.navmesh->get_vertices(); + PoolVector<Vector3> vertices=nm.navmesh->get_vertices(); int len = vertices.size(); if (len==0) return; - DVector<Vector3>::Read r=vertices.read(); + PoolVector<Vector3>::Read r=vertices.read(); for(int i=0;i<nm.navmesh->get_polygon_count();i++) { @@ -730,18 +730,18 @@ Vector3 Navigation::get_up_vector() const{ void Navigation::_bind_methods() { - ObjectTypeDB::bind_method(_MD("navmesh_create","mesh:NavigationMesh","xform","owner"),&Navigation::navmesh_create,DEFVAL(Variant())); - ObjectTypeDB::bind_method(_MD("navmesh_set_transform","id","xform"),&Navigation::navmesh_set_transform); - ObjectTypeDB::bind_method(_MD("navmesh_remove","id"),&Navigation::navmesh_remove); + ClassDB::bind_method(_MD("navmesh_create","mesh:NavigationMesh","xform","owner"),&Navigation::navmesh_create,DEFVAL(Variant())); + ClassDB::bind_method(_MD("navmesh_set_transform","id","xform"),&Navigation::navmesh_set_transform); + ClassDB::bind_method(_MD("navmesh_remove","id"),&Navigation::navmesh_remove); - ObjectTypeDB::bind_method(_MD("get_simple_path","start","end","optimize"),&Navigation::get_simple_path,DEFVAL(true)); - ObjectTypeDB::bind_method(_MD("get_closest_point_to_segment","start","end","use_collision"),&Navigation::get_closest_point_to_segment,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("get_closest_point","to_point"),&Navigation::get_closest_point); - ObjectTypeDB::bind_method(_MD("get_closest_point_normal","to_point"),&Navigation::get_closest_point_normal); - ObjectTypeDB::bind_method(_MD("get_closest_point_owner","to_point"),&Navigation::get_closest_point_owner); + ClassDB::bind_method(_MD("get_simple_path","start","end","optimize"),&Navigation::get_simple_path,DEFVAL(true)); + ClassDB::bind_method(_MD("get_closest_point_to_segment","start","end","use_collision"),&Navigation::get_closest_point_to_segment,DEFVAL(false)); + ClassDB::bind_method(_MD("get_closest_point","to_point"),&Navigation::get_closest_point); + ClassDB::bind_method(_MD("get_closest_point_normal","to_point"),&Navigation::get_closest_point_normal); + ClassDB::bind_method(_MD("get_closest_point_owner","to_point"),&Navigation::get_closest_point_owner); - ObjectTypeDB::bind_method(_MD("set_up_vector","up"),&Navigation::set_up_vector); - ObjectTypeDB::bind_method(_MD("get_up_vector"),&Navigation::get_up_vector); + ClassDB::bind_method(_MD("set_up_vector","up"),&Navigation::set_up_vector); + ClassDB::bind_method(_MD("get_up_vector"),&Navigation::get_up_vector); ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"up_vector"),_SCS("set_up_vector"),_SCS("get_up_vector")); } diff --git a/scene/3d/navigation.h b/scene/3d/navigation.h index 1cfc416fc9..771e12466a 100644 --- a/scene/3d/navigation.h +++ b/scene/3d/navigation.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class Navigation : public Spatial { - OBJ_TYPE( Navigation, Spatial); + GDCLASS( Navigation, Spatial); union Point { diff --git a/scene/3d/navigation_mesh.cpp b/scene/3d/navigation_mesh.cpp index 386a0fab57..434b400e01 100644 --- a/scene/3d/navigation_mesh.cpp +++ b/scene/3d/navigation_mesh.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ void NavigationMesh::create_from_mesh(const Ref<Mesh>& p_mesh) { - vertices=DVector<Vector3>(); + vertices=PoolVector<Vector3>(); clear_polygons(); for(int i=0;i<p_mesh->get_surface_count();i++) { @@ -41,15 +41,15 @@ void NavigationMesh::create_from_mesh(const Ref<Mesh>& p_mesh) { if (p_mesh->surface_get_primitive_type(i)!=Mesh::PRIMITIVE_TRIANGLES) continue; Array arr = p_mesh->surface_get_arrays(i); - DVector<Vector3> varr = arr[Mesh::ARRAY_VERTEX]; - DVector<int> iarr = arr[Mesh::ARRAY_INDEX]; + PoolVector<Vector3> varr = arr[Mesh::ARRAY_VERTEX]; + PoolVector<int> iarr = arr[Mesh::ARRAY_INDEX]; if (varr.size()==0 || iarr.size()==0) continue; int from = vertices.size(); vertices.append_array(varr); int rlen = iarr.size(); - DVector<int>::Read r = iarr.read(); + PoolVector<int>::Read r = iarr.read(); for(int j=0;j<rlen;j+=3) { Vector<int> vi; @@ -63,12 +63,12 @@ void NavigationMesh::create_from_mesh(const Ref<Mesh>& p_mesh) { } } -void NavigationMesh::set_vertices(const DVector<Vector3>& p_vertices) { +void NavigationMesh::set_vertices(const PoolVector<Vector3>& p_vertices) { vertices=p_vertices; } -DVector<Vector3> NavigationMesh::get_vertices() const{ +PoolVector<Vector3> NavigationMesh::get_vertices() const{ return vertices; } @@ -122,8 +122,8 @@ Ref<Mesh> NavigationMesh::get_debug_mesh() { - DVector<Vector3> vertices = get_vertices(); - DVector<Vector3>::Read vr=vertices.read(); + PoolVector<Vector3> vertices = get_vertices(); + PoolVector<Vector3>::Read vr=vertices.read(); List<Face3> faces; for(int i=0;i<get_polygon_count();i++) { Vector<int> p = get_polygon(i); @@ -140,11 +140,11 @@ Ref<Mesh> NavigationMesh::get_debug_mesh() { Map<_EdgeKey,bool> edge_map; - DVector<Vector3> tmeshfaces; + PoolVector<Vector3> tmeshfaces; tmeshfaces.resize(faces.size()*3); { - DVector<Vector3>::Write tw=tmeshfaces.write(); + PoolVector<Vector3>::Write tw=tmeshfaces.write(); int tidx=0; @@ -185,10 +185,10 @@ Ref<Mesh> NavigationMesh::get_debug_mesh() { } } - DVector<Vector3> varr; + PoolVector<Vector3> varr; varr.resize(lines.size()); { - DVector<Vector3>::Write w = varr.write(); + PoolVector<Vector3>::Write w = varr.write(); int idx=0; for(List<Vector3>::Element *E=lines.front();E;E=E->next()) { w[idx++]=E->get(); @@ -201,25 +201,25 @@ Ref<Mesh> NavigationMesh::get_debug_mesh() { arr.resize(Mesh::ARRAY_MAX); arr[Mesh::ARRAY_VERTEX]=varr; - debug_mesh->add_surface(Mesh::PRIMITIVE_LINES,arr); + debug_mesh->add_surface_from_arrays(Mesh::PRIMITIVE_LINES,arr); return debug_mesh; } void NavigationMesh::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_vertices","vertices"),&NavigationMesh::set_vertices); - ObjectTypeDB::bind_method(_MD("get_vertices"),&NavigationMesh::get_vertices); + ClassDB::bind_method(_MD("set_vertices","vertices"),&NavigationMesh::set_vertices); + ClassDB::bind_method(_MD("get_vertices"),&NavigationMesh::get_vertices); - ObjectTypeDB::bind_method(_MD("add_polygon","polygon"),&NavigationMesh::add_polygon); - ObjectTypeDB::bind_method(_MD("get_polygon_count"),&NavigationMesh::get_polygon_count); - ObjectTypeDB::bind_method(_MD("get_polygon","idx"),&NavigationMesh::get_polygon); - ObjectTypeDB::bind_method(_MD("clear_polygons"),&NavigationMesh::clear_polygons); + ClassDB::bind_method(_MD("add_polygon","polygon"),&NavigationMesh::add_polygon); + ClassDB::bind_method(_MD("get_polygon_count"),&NavigationMesh::get_polygon_count); + ClassDB::bind_method(_MD("get_polygon","idx"),&NavigationMesh::get_polygon); + ClassDB::bind_method(_MD("clear_polygons"),&NavigationMesh::clear_polygons); - ObjectTypeDB::bind_method(_MD("_set_polygons","polygons"),&NavigationMesh::_set_polygons); - ObjectTypeDB::bind_method(_MD("_get_polygons"),&NavigationMesh::_get_polygons); + ClassDB::bind_method(_MD("_set_polygons","polygons"),&NavigationMesh::_set_polygons); + ClassDB::bind_method(_MD("_get_polygons"),&NavigationMesh::_get_polygons); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR3_ARRAY,"vertices",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_vertices"),_SCS("get_vertices")); + ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR3_ARRAY,"vertices",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_vertices"),_SCS("get_vertices")); ADD_PROPERTY(PropertyInfo(Variant::ARRAY,"polygons",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_polygons"),_SCS("_get_polygons")); } @@ -356,6 +356,11 @@ void NavigationMeshInstance::set_navigation_mesh(const Ref<NavigationMesh>& p_na if (navigation && navmesh.is_valid() && enabled) { nav_id = navigation->navmesh_create(navmesh,get_relative_transform(navigation),this); } + + if (debug_view && navmesh.is_valid()) { + debug_view->cast_to<MeshInstance>()->set_mesh( navmesh->get_debug_mesh() ); + } + update_gizmo(); update_configuration_warning(); @@ -389,11 +394,11 @@ String NavigationMeshInstance::get_configuration_warning() const { void NavigationMeshInstance::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_navigation_mesh","navmesh"),&NavigationMeshInstance::set_navigation_mesh); - ObjectTypeDB::bind_method(_MD("get_navigation_mesh"),&NavigationMeshInstance::get_navigation_mesh); + ClassDB::bind_method(_MD("set_navigation_mesh","navmesh"),&NavigationMeshInstance::set_navigation_mesh); + ClassDB::bind_method(_MD("get_navigation_mesh"),&NavigationMeshInstance::get_navigation_mesh); - ObjectTypeDB::bind_method(_MD("set_enabled","enabled"),&NavigationMeshInstance::set_enabled); - ObjectTypeDB::bind_method(_MD("is_enabled"),&NavigationMeshInstance::is_enabled); + ClassDB::bind_method(_MD("set_enabled","enabled"),&NavigationMeshInstance::set_enabled); + ClassDB::bind_method(_MD("is_enabled"),&NavigationMeshInstance::is_enabled); ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"navmesh",PROPERTY_HINT_RESOURCE_TYPE,"NavigationMesh"),_SCS("set_navigation_mesh"),_SCS("get_navigation_mesh")); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"enabled"),_SCS("set_enabled"),_SCS("is_enabled")); diff --git a/scene/3d/navigation_mesh.h b/scene/3d/navigation_mesh.h index c49965cd85..e025b7ce8b 100644 --- a/scene/3d/navigation_mesh.h +++ b/scene/3d/navigation_mesh.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,9 +36,9 @@ class Mesh; class NavigationMesh : public Resource { - OBJ_TYPE( NavigationMesh, Resource ); + GDCLASS( NavigationMesh, Resource ); - DVector<Vector3> vertices; + PoolVector<Vector3> vertices; struct Polygon { Vector<int> indices; }; @@ -65,8 +65,8 @@ public: void create_from_mesh(const Ref<Mesh>& p_mesh); - void set_vertices(const DVector<Vector3>& p_vertices); - DVector<Vector3> get_vertices() const; + void set_vertices(const PoolVector<Vector3>& p_vertices); + PoolVector<Vector3> get_vertices() const; void add_polygon(const Vector<int>& p_polygon); int get_polygon_count() const; @@ -83,7 +83,7 @@ class Navigation; class NavigationMeshInstance : public Spatial { - OBJ_TYPE(NavigationMeshInstance,Spatial); + GDCLASS(NavigationMeshInstance,Spatial); bool enabled; int nav_id; diff --git a/scene/3d/particles.cpp b/scene/3d/particles.cpp index 3ac5d8ed7b..9e37658cd9 100644 --- a/scene/3d/particles.cpp +++ b/scene/3d/particles.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -30,6 +30,7 @@ #include "servers/visual_server.h" #include "scene/resources/surface_tool.h" +#if 0 /* static const char* _var_names[Particles::VAR_MAX]={ "vars/lifetime", @@ -87,9 +88,9 @@ AABB Particles::get_aabb() const { return AABB( Vector3(-1,-1,-1), Vector3(2, 2, 2 ) ); } -DVector<Face3> Particles::get_faces(uint32_t p_usage_flags) const { +PoolVector<Face3> Particles::get_faces(uint32_t p_usage_flags) const { - return DVector<Face3>(); + return PoolVector<Face3>(); } @@ -129,16 +130,16 @@ AABB Particles::get_visibility_aabb() const { } -void Particles::set_emission_points(const DVector<Vector3>& p_points) { +void Particles::set_emission_points(const PoolVector<Vector3>& p_points) { using_points = p_points.size(); VisualServer::get_singleton()->particles_set_emission_points(particles,p_points); } -DVector<Vector3> Particles::get_emission_points() const { +PoolVector<Vector3> Particles::get_emission_points() const { if (!using_points) - return DVector<Vector3>(); + return PoolVector<Vector3>(); return VisualServer::get_singleton()->particles_get_emission_points(particles); @@ -318,10 +319,10 @@ RES Particles::_get_gizmo_geometry() const { Ref<SurfaceTool> surface_tool( memnew( SurfaceTool )); - Ref<FixedMaterial> mat( memnew( FixedMaterial )); + Ref<FixedSpatialMaterial> mat( memnew( FixedSpatialMaterial )); - mat->set_parameter( FixedMaterial::PARAM_DIFFUSE,Color(0.0,0.6,0.7,0.2) ); - mat->set_parameter( FixedMaterial::PARAM_EMISSION,Color(0.5,0.7,0.8) ); + mat->set_parameter( FixedSpatialMaterial::PARAM_DIFFUSE,Color(0.0,0.6,0.7,0.2) ); + mat->set_parameter( FixedSpatialMaterial::PARAM_EMISSION,Color(0.5,0.7,0.8) ); mat->set_blend_mode( Material::BLEND_MODE_ADD ); mat->set_flag(Material::FLAG_DOUBLE_SIDED,true); // mat->set_hint(Material::HINT_NO_DEPTH_DRAW,true); @@ -381,9 +382,9 @@ RES Particles::_get_gizmo_geometry() const { Ref<Mesh> mesh = surface_tool->commit(); - Ref<FixedMaterial> mat_aabb( memnew( FixedMaterial )); + Ref<FixedSpatialMaterial> mat_aabb( memnew( FixedSpatialMaterial )); - mat_aabb->set_parameter( FixedMaterial::PARAM_DIFFUSE,Color(0.8,0.8,0.9,0.7) ); + mat_aabb->set_parameter( FixedSpatialMaterial::PARAM_DIFFUSE,Color(0.8,0.8,0.9,0.7) ); mat_aabb->set_line_width(3); mat_aabb->set_flag( Material::FLAG_UNSHADED, true ); @@ -405,39 +406,39 @@ RES Particles::_get_gizmo_geometry() const { void Particles::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_amount","amount"),&Particles::set_amount); - ObjectTypeDB::bind_method(_MD("get_amount"),&Particles::get_amount); - ObjectTypeDB::bind_method(_MD("set_emitting","enabled"),&Particles::set_emitting); - ObjectTypeDB::bind_method(_MD("is_emitting"),&Particles::is_emitting); - ObjectTypeDB::bind_method(_MD("set_visibility_aabb","aabb"),&Particles::set_visibility_aabb); - ObjectTypeDB::bind_method(_MD("get_visibility_aabb"),&Particles::get_visibility_aabb); - ObjectTypeDB::bind_method(_MD("set_emission_half_extents","half_extents"),&Particles::set_emission_half_extents); - ObjectTypeDB::bind_method(_MD("get_emission_half_extents"),&Particles::get_emission_half_extents); - ObjectTypeDB::bind_method(_MD("set_emission_base_velocity","base_velocity"),&Particles::set_emission_base_velocity); - ObjectTypeDB::bind_method(_MD("get_emission_base_velocity"),&Particles::get_emission_base_velocity); - ObjectTypeDB::bind_method(_MD("set_emission_points","points"),&Particles::set_emission_points); - ObjectTypeDB::bind_method(_MD("get_emission_points"),&Particles::get_emission_points); - ObjectTypeDB::bind_method(_MD("set_gravity_normal","normal"),&Particles::set_gravity_normal); - ObjectTypeDB::bind_method(_MD("get_gravity_normal"),&Particles::get_gravity_normal); - ObjectTypeDB::bind_method(_MD("set_variable","variable","value"),&Particles::set_variable); - ObjectTypeDB::bind_method(_MD("get_variable","variable"),&Particles::get_variable); - ObjectTypeDB::bind_method(_MD("set_randomness","variable","randomness"),&Particles::set_randomness); - ObjectTypeDB::bind_method(_MD("get_randomness","variable"),&Particles::get_randomness); - ObjectTypeDB::bind_method(_MD("set_color_phase_pos","phase","pos"),&Particles::set_color_phase_pos); - ObjectTypeDB::bind_method(_MD("get_color_phase_pos","phase"),&Particles::get_color_phase_pos); - ObjectTypeDB::bind_method(_MD("set_color_phase_color","phase","color"),&Particles::set_color_phase_color); - ObjectTypeDB::bind_method(_MD("get_color_phase_color","phase"),&Particles::get_color_phase_color); - ObjectTypeDB::bind_method(_MD("set_material","material:Material"),&Particles::set_material); - ObjectTypeDB::bind_method(_MD("get_material:Material"),&Particles::get_material); - ObjectTypeDB::bind_method(_MD("set_emit_timeout","timeout"),&Particles::set_emit_timeout); - ObjectTypeDB::bind_method(_MD("get_emit_timeout"),&Particles::get_emit_timeout); - ObjectTypeDB::bind_method(_MD("set_height_from_velocity","enable"),&Particles::set_height_from_velocity); - ObjectTypeDB::bind_method(_MD("has_height_from_velocity"),&Particles::has_height_from_velocity); - ObjectTypeDB::bind_method(_MD("set_use_local_coordinates","enable"),&Particles::set_use_local_coordinates); - ObjectTypeDB::bind_method(_MD("is_using_local_coordinates"),&Particles::is_using_local_coordinates); - - ObjectTypeDB::bind_method(_MD("set_color_phases","count"),&Particles::set_color_phases); - ObjectTypeDB::bind_method(_MD("get_color_phases"),&Particles::get_color_phases); + ClassDB::bind_method(_MD("set_amount","amount"),&Particles::set_amount); + ClassDB::bind_method(_MD("get_amount"),&Particles::get_amount); + ClassDB::bind_method(_MD("set_emitting","enabled"),&Particles::set_emitting); + ClassDB::bind_method(_MD("is_emitting"),&Particles::is_emitting); + ClassDB::bind_method(_MD("set_visibility_aabb","aabb"),&Particles::set_visibility_aabb); + ClassDB::bind_method(_MD("get_visibility_aabb"),&Particles::get_visibility_aabb); + ClassDB::bind_method(_MD("set_emission_half_extents","half_extents"),&Particles::set_emission_half_extents); + ClassDB::bind_method(_MD("get_emission_half_extents"),&Particles::get_emission_half_extents); + ClassDB::bind_method(_MD("set_emission_base_velocity","base_velocity"),&Particles::set_emission_base_velocity); + ClassDB::bind_method(_MD("get_emission_base_velocity"),&Particles::get_emission_base_velocity); + ClassDB::bind_method(_MD("set_emission_points","points"),&Particles::set_emission_points); + ClassDB::bind_method(_MD("get_emission_points"),&Particles::get_emission_points); + ClassDB::bind_method(_MD("set_gravity_normal","normal"),&Particles::set_gravity_normal); + ClassDB::bind_method(_MD("get_gravity_normal"),&Particles::get_gravity_normal); + ClassDB::bind_method(_MD("set_variable","variable","value"),&Particles::set_variable); + ClassDB::bind_method(_MD("get_variable","variable"),&Particles::get_variable); + ClassDB::bind_method(_MD("set_randomness","variable","randomness"),&Particles::set_randomness); + ClassDB::bind_method(_MD("get_randomness","variable"),&Particles::get_randomness); + ClassDB::bind_method(_MD("set_color_phase_pos","phase","pos"),&Particles::set_color_phase_pos); + ClassDB::bind_method(_MD("get_color_phase_pos","phase"),&Particles::get_color_phase_pos); + ClassDB::bind_method(_MD("set_color_phase_color","phase","color"),&Particles::set_color_phase_color); + ClassDB::bind_method(_MD("get_color_phase_color","phase"),&Particles::get_color_phase_color); + ClassDB::bind_method(_MD("set_material","material:Material"),&Particles::set_material); + ClassDB::bind_method(_MD("get_material:Material"),&Particles::get_material); + ClassDB::bind_method(_MD("set_emit_timeout","timeout"),&Particles::set_emit_timeout); + ClassDB::bind_method(_MD("get_emit_timeout"),&Particles::get_emit_timeout); + ClassDB::bind_method(_MD("set_height_from_velocity","enable"),&Particles::set_height_from_velocity); + ClassDB::bind_method(_MD("has_height_from_velocity"),&Particles::has_height_from_velocity); + ClassDB::bind_method(_MD("set_use_local_coordinates","enable"),&Particles::set_use_local_coordinates); + ClassDB::bind_method(_MD("is_using_local_coordinates"),&Particles::is_using_local_coordinates); + + ClassDB::bind_method(_MD("set_color_phases","count"),&Particles::set_color_phases); + ClassDB::bind_method(_MD("get_color_phases"),&Particles::get_color_phases); ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "material", PROPERTY_HINT_RESOURCE_TYPE, "Material" ), _SCS("set_material"), _SCS("get_material") ); @@ -557,3 +558,4 @@ Particles::~Particles() { VisualServer::get_singleton()->free(particles); } +#endif diff --git a/scene/3d/particles.h b/scene/3d/particles.h index 42d27c41d7..b96bd4e69e 100644 --- a/scene/3d/particles.h +++ b/scene/3d/particles.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ /** @author Juan Linietsky <reduzio@gmail.com> */ - +#if 0 class Particles : public GeometryInstance { public: @@ -60,7 +60,7 @@ public: }; private: - OBJ_TYPE( Particles, GeometryInstance ); + GDCLASS( Particles, GeometryInstance ); RID particles; @@ -103,7 +103,7 @@ public: AABB get_aabb() const; - DVector<Face3> get_faces(uint32_t p_usage_flags) const; + PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; void set_amount(int p_amount); int get_amount() const; @@ -120,8 +120,8 @@ public: void set_emission_base_velocity(const Vector3& p_base_velocity); Vector3 get_emission_base_velocity() const; - void set_emission_points(const DVector<Vector3>& p_points); - DVector<Vector3> get_emission_points() const; + void set_emission_points(const PoolVector<Vector3>& p_points); + PoolVector<Vector3> get_emission_points() const; void set_gravity_normal(const Vector3& p_normal); Vector3 get_gravity_normal() const; @@ -163,3 +163,4 @@ public: VARIANT_ENUM_CAST( Particles::Variable ); #endif +#endif diff --git a/scene/3d/path.cpp b/scene/3d/path.cpp index d6cd3da7c3..5e8ded3867 100644 --- a/scene/3d/path.cpp +++ b/scene/3d/path.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -80,9 +80,9 @@ Ref<Curve3D> Path::get_curve() const{ void Path::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_curve","curve:Curve3D"),&Path::set_curve); - ObjectTypeDB::bind_method(_MD("get_curve:Curve3D","curve"),&Path::get_curve); - ObjectTypeDB::bind_method(_MD("_curve_changed"),&Path::_curve_changed); + ClassDB::bind_method(_MD("set_curve","curve:Curve3D"),&Path::set_curve); + ClassDB::bind_method(_MD("get_curve:Curve3D","curve"),&Path::get_curve); + ClassDB::bind_method(_MD("_curve_changed"),&Path::_curve_changed); ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve3D"), _SCS("set_curve"),_SCS("get_curve")); } @@ -137,7 +137,7 @@ void PathFollow::_update_transform() { float tilt = c->interpolate_baked_tilt(o); if (tilt!=0) { - Matrix3 rot(-n,tilt); //remember.. lookat will be znegative.. znegative!! we abide by opengl clan. + Basis rot(-n,tilt); //remember.. lookat will be znegative.. znegative!! we abide by opengl clan. up=rot.xform(up); } } @@ -257,26 +257,26 @@ void PathFollow::_get_property_list( List<PropertyInfo> *p_list) const{ void PathFollow::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_offset","offset"),&PathFollow::set_offset); - ObjectTypeDB::bind_method(_MD("get_offset"),&PathFollow::get_offset); + ClassDB::bind_method(_MD("set_offset","offset"),&PathFollow::set_offset); + ClassDB::bind_method(_MD("get_offset"),&PathFollow::get_offset); - ObjectTypeDB::bind_method(_MD("set_h_offset","h_offset"),&PathFollow::set_h_offset); - ObjectTypeDB::bind_method(_MD("get_h_offset"),&PathFollow::get_h_offset); + ClassDB::bind_method(_MD("set_h_offset","h_offset"),&PathFollow::set_h_offset); + ClassDB::bind_method(_MD("get_h_offset"),&PathFollow::get_h_offset); - ObjectTypeDB::bind_method(_MD("set_v_offset","v_offset"),&PathFollow::set_v_offset); - ObjectTypeDB::bind_method(_MD("get_v_offset"),&PathFollow::get_v_offset); + ClassDB::bind_method(_MD("set_v_offset","v_offset"),&PathFollow::set_v_offset); + ClassDB::bind_method(_MD("get_v_offset"),&PathFollow::get_v_offset); - ObjectTypeDB::bind_method(_MD("set_unit_offset","unit_offset"),&PathFollow::set_unit_offset); - ObjectTypeDB::bind_method(_MD("get_unit_offset"),&PathFollow::get_unit_offset); + ClassDB::bind_method(_MD("set_unit_offset","unit_offset"),&PathFollow::set_unit_offset); + ClassDB::bind_method(_MD("get_unit_offset"),&PathFollow::get_unit_offset); - ObjectTypeDB::bind_method(_MD("set_rotation_mode","rotation_mode"),&PathFollow::set_rotation_mode); - ObjectTypeDB::bind_method(_MD("get_rotation_mode"),&PathFollow::get_rotation_mode); + ClassDB::bind_method(_MD("set_rotation_mode","rotation_mode"),&PathFollow::set_rotation_mode); + ClassDB::bind_method(_MD("get_rotation_mode"),&PathFollow::get_rotation_mode); - ObjectTypeDB::bind_method(_MD("set_cubic_interpolation","enable"),&PathFollow::set_cubic_interpolation); - ObjectTypeDB::bind_method(_MD("get_cubic_interpolation"),&PathFollow::get_cubic_interpolation); + ClassDB::bind_method(_MD("set_cubic_interpolation","enable"),&PathFollow::set_cubic_interpolation); + ClassDB::bind_method(_MD("get_cubic_interpolation"),&PathFollow::get_cubic_interpolation); - ObjectTypeDB::bind_method(_MD("set_loop","loop"),&PathFollow::set_loop); - ObjectTypeDB::bind_method(_MD("has_loop"),&PathFollow::has_loop); + ClassDB::bind_method(_MD("set_loop","loop"),&PathFollow::set_loop); + ClassDB::bind_method(_MD("has_loop"),&PathFollow::has_loop); BIND_CONSTANT( ROTATION_NONE ); BIND_CONSTANT( ROTATION_Y ); diff --git a/scene/3d/path.h b/scene/3d/path.h index 2e3573df3e..ab6f459ba9 100644 --- a/scene/3d/path.h +++ b/scene/3d/path.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class Path : public Spatial { - OBJ_TYPE( Path, Spatial ); + GDCLASS( Path, Spatial ); Ref<Curve3D> curve; @@ -56,7 +56,7 @@ public: class PathFollow : public Spatial { - OBJ_TYPE(PathFollow,Spatial); + GDCLASS(PathFollow,Spatial); public: enum RotationMode { diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp index 116f967bd2..f6499aefe3 100644 --- a/scene/3d/physics_body.cpp +++ b/scene/3d/physics_body.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -147,24 +147,23 @@ uint32_t PhysicsBody::_get_layers() const{ } void PhysicsBody::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_layer_mask","mask"),&PhysicsBody::set_layer_mask); - ObjectTypeDB::bind_method(_MD("get_layer_mask"),&PhysicsBody::get_layer_mask); + ClassDB::bind_method(_MD("set_layer_mask","mask"),&PhysicsBody::set_layer_mask); + ClassDB::bind_method(_MD("get_layer_mask"),&PhysicsBody::get_layer_mask); - ObjectTypeDB::bind_method(_MD("set_collision_mask","mask"),&PhysicsBody::set_collision_mask); - ObjectTypeDB::bind_method(_MD("get_collision_mask"),&PhysicsBody::get_collision_mask); + ClassDB::bind_method(_MD("set_collision_mask","mask"),&PhysicsBody::set_collision_mask); + ClassDB::bind_method(_MD("get_collision_mask"),&PhysicsBody::get_collision_mask); - ObjectTypeDB::bind_method(_MD("set_collision_mask_bit","bit","value"),&PhysicsBody::set_collision_mask_bit); - ObjectTypeDB::bind_method(_MD("get_collision_mask_bit","bit"),&PhysicsBody::get_collision_mask_bit); + ClassDB::bind_method(_MD("set_collision_mask_bit","bit","value"),&PhysicsBody::set_collision_mask_bit); + ClassDB::bind_method(_MD("get_collision_mask_bit","bit"),&PhysicsBody::get_collision_mask_bit); - ObjectTypeDB::bind_method(_MD("set_layer_mask_bit","bit","value"),&PhysicsBody::set_layer_mask_bit); - ObjectTypeDB::bind_method(_MD("get_layer_mask_bit","bit"),&PhysicsBody::get_layer_mask_bit); + ClassDB::bind_method(_MD("set_layer_mask_bit","bit","value"),&PhysicsBody::set_layer_mask_bit); + ClassDB::bind_method(_MD("get_layer_mask_bit","bit"),&PhysicsBody::get_layer_mask_bit); - ObjectTypeDB::bind_method(_MD("_set_layers","mask"),&PhysicsBody::_set_layers); - ObjectTypeDB::bind_method(_MD("_get_layers"),&PhysicsBody::_get_layers); + ClassDB::bind_method(_MD("_set_layers","mask"),&PhysicsBody::_set_layers); + ClassDB::bind_method(_MD("_get_layers"),&PhysicsBody::_get_layers); - ADD_PROPERTY(PropertyInfo(Variant::INT,"layers",PROPERTY_HINT_ALL_FLAGS,"",0),_SCS("_set_layers"),_SCS("_get_layers")); //for backwards compat - ADD_PROPERTY(PropertyInfo(Variant::INT,"collision/layers",PROPERTY_HINT_ALL_FLAGS),_SCS("set_layer_mask"),_SCS("get_layer_mask")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"collision/mask",PROPERTY_HINT_ALL_FLAGS),_SCS("set_collision_mask"),_SCS("get_collision_mask")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"collision_layers",PROPERTY_HINT_LAYERS_3D_PHYSICS),_SCS("set_layer_mask"),_SCS("get_layer_mask")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"collision_mask",PROPERTY_HINT_LAYERS_3D_PHYSICS),_SCS("set_collision_mask"),_SCS("get_collision_mask")); } @@ -230,19 +229,19 @@ Vector3 StaticBody::get_constant_angular_velocity() const { void StaticBody::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_constant_linear_velocity","vel"),&StaticBody::set_constant_linear_velocity); - ObjectTypeDB::bind_method(_MD("set_constant_angular_velocity","vel"),&StaticBody::set_constant_angular_velocity); - ObjectTypeDB::bind_method(_MD("get_constant_linear_velocity"),&StaticBody::get_constant_linear_velocity); - ObjectTypeDB::bind_method(_MD("get_constant_angular_velocity"),&StaticBody::get_constant_angular_velocity); + ClassDB::bind_method(_MD("set_constant_linear_velocity","vel"),&StaticBody::set_constant_linear_velocity); + ClassDB::bind_method(_MD("set_constant_angular_velocity","vel"),&StaticBody::set_constant_angular_velocity); + ClassDB::bind_method(_MD("get_constant_linear_velocity"),&StaticBody::get_constant_linear_velocity); + ClassDB::bind_method(_MD("get_constant_angular_velocity"),&StaticBody::get_constant_angular_velocity); - ObjectTypeDB::bind_method(_MD("set_friction","friction"),&StaticBody::set_friction); - ObjectTypeDB::bind_method(_MD("get_friction"),&StaticBody::get_friction); + ClassDB::bind_method(_MD("set_friction","friction"),&StaticBody::set_friction); + ClassDB::bind_method(_MD("get_friction"),&StaticBody::get_friction); - ObjectTypeDB::bind_method(_MD("set_bounce","bounce"),&StaticBody::set_bounce); - ObjectTypeDB::bind_method(_MD("get_bounce"),&StaticBody::get_bounce); + ClassDB::bind_method(_MD("set_bounce","bounce"),&StaticBody::set_bounce); + ClassDB::bind_method(_MD("get_bounce"),&StaticBody::get_bounce); - ObjectTypeDB::bind_method(_MD("add_collision_exception_with","body:PhysicsBody"),&PhysicsBody::add_collision_exception_with); - ObjectTypeDB::bind_method(_MD("remove_collision_exception_with","body:PhysicsBody"),&PhysicsBody::remove_collision_exception_with); + ClassDB::bind_method(_MD("add_collision_exception_with","body:PhysicsBody"),&PhysicsBody::add_collision_exception_with); + ClassDB::bind_method(_MD("remove_collision_exception_with","body:PhysicsBody"),&PhysicsBody::remove_collision_exception_with); ADD_PROPERTY( PropertyInfo(Variant::REAL,"friction",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_friction"),_SCS("get_friction")); ADD_PROPERTY( PropertyInfo(Variant::REAL,"bounce",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_bounce"),_SCS("get_bounce")); @@ -800,66 +799,66 @@ Array RigidBody::get_colliding_bodies() const { void RigidBody::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_mode","mode"),&RigidBody::set_mode); - ObjectTypeDB::bind_method(_MD("get_mode"),&RigidBody::get_mode); + ClassDB::bind_method(_MD("set_mode","mode"),&RigidBody::set_mode); + ClassDB::bind_method(_MD("get_mode"),&RigidBody::get_mode); - ObjectTypeDB::bind_method(_MD("set_mass","mass"),&RigidBody::set_mass); - ObjectTypeDB::bind_method(_MD("get_mass"),&RigidBody::get_mass); + ClassDB::bind_method(_MD("set_mass","mass"),&RigidBody::set_mass); + ClassDB::bind_method(_MD("get_mass"),&RigidBody::get_mass); - ObjectTypeDB::bind_method(_MD("set_weight","weight"),&RigidBody::set_weight); - ObjectTypeDB::bind_method(_MD("get_weight"),&RigidBody::get_weight); + ClassDB::bind_method(_MD("set_weight","weight"),&RigidBody::set_weight); + ClassDB::bind_method(_MD("get_weight"),&RigidBody::get_weight); - ObjectTypeDB::bind_method(_MD("set_friction","friction"),&RigidBody::set_friction); - ObjectTypeDB::bind_method(_MD("get_friction"),&RigidBody::get_friction); + ClassDB::bind_method(_MD("set_friction","friction"),&RigidBody::set_friction); + ClassDB::bind_method(_MD("get_friction"),&RigidBody::get_friction); - ObjectTypeDB::bind_method(_MD("set_bounce","bounce"),&RigidBody::set_bounce); - ObjectTypeDB::bind_method(_MD("get_bounce"),&RigidBody::get_bounce); + ClassDB::bind_method(_MD("set_bounce","bounce"),&RigidBody::set_bounce); + ClassDB::bind_method(_MD("get_bounce"),&RigidBody::get_bounce); - ObjectTypeDB::bind_method(_MD("set_linear_velocity","linear_velocity"),&RigidBody::set_linear_velocity); - ObjectTypeDB::bind_method(_MD("get_linear_velocity"),&RigidBody::get_linear_velocity); + ClassDB::bind_method(_MD("set_linear_velocity","linear_velocity"),&RigidBody::set_linear_velocity); + ClassDB::bind_method(_MD("get_linear_velocity"),&RigidBody::get_linear_velocity); - ObjectTypeDB::bind_method(_MD("set_angular_velocity","angular_velocity"),&RigidBody::set_angular_velocity); - ObjectTypeDB::bind_method(_MD("get_angular_velocity"),&RigidBody::get_angular_velocity); + ClassDB::bind_method(_MD("set_angular_velocity","angular_velocity"),&RigidBody::set_angular_velocity); + ClassDB::bind_method(_MD("get_angular_velocity"),&RigidBody::get_angular_velocity); - ObjectTypeDB::bind_method(_MD("set_gravity_scale","gravity_scale"),&RigidBody::set_gravity_scale); - ObjectTypeDB::bind_method(_MD("get_gravity_scale"),&RigidBody::get_gravity_scale); + ClassDB::bind_method(_MD("set_gravity_scale","gravity_scale"),&RigidBody::set_gravity_scale); + ClassDB::bind_method(_MD("get_gravity_scale"),&RigidBody::get_gravity_scale); - ObjectTypeDB::bind_method(_MD("set_linear_damp","linear_damp"),&RigidBody::set_linear_damp); - ObjectTypeDB::bind_method(_MD("get_linear_damp"),&RigidBody::get_linear_damp); + ClassDB::bind_method(_MD("set_linear_damp","linear_damp"),&RigidBody::set_linear_damp); + ClassDB::bind_method(_MD("get_linear_damp"),&RigidBody::get_linear_damp); - ObjectTypeDB::bind_method(_MD("set_angular_damp","angular_damp"),&RigidBody::set_angular_damp); - ObjectTypeDB::bind_method(_MD("get_angular_damp"),&RigidBody::get_angular_damp); + ClassDB::bind_method(_MD("set_angular_damp","angular_damp"),&RigidBody::set_angular_damp); + ClassDB::bind_method(_MD("get_angular_damp"),&RigidBody::get_angular_damp); - ObjectTypeDB::bind_method(_MD("set_max_contacts_reported","amount"),&RigidBody::set_max_contacts_reported); - ObjectTypeDB::bind_method(_MD("get_max_contacts_reported"),&RigidBody::get_max_contacts_reported); + ClassDB::bind_method(_MD("set_max_contacts_reported","amount"),&RigidBody::set_max_contacts_reported); + ClassDB::bind_method(_MD("get_max_contacts_reported"),&RigidBody::get_max_contacts_reported); - ObjectTypeDB::bind_method(_MD("set_use_custom_integrator","enable"),&RigidBody::set_use_custom_integrator); - ObjectTypeDB::bind_method(_MD("is_using_custom_integrator"),&RigidBody::is_using_custom_integrator); + ClassDB::bind_method(_MD("set_use_custom_integrator","enable"),&RigidBody::set_use_custom_integrator); + ClassDB::bind_method(_MD("is_using_custom_integrator"),&RigidBody::is_using_custom_integrator); - ObjectTypeDB::bind_method(_MD("set_contact_monitor","enabled"),&RigidBody::set_contact_monitor); - ObjectTypeDB::bind_method(_MD("is_contact_monitor_enabled"),&RigidBody::is_contact_monitor_enabled); + ClassDB::bind_method(_MD("set_contact_monitor","enabled"),&RigidBody::set_contact_monitor); + ClassDB::bind_method(_MD("is_contact_monitor_enabled"),&RigidBody::is_contact_monitor_enabled); - ObjectTypeDB::bind_method(_MD("set_use_continuous_collision_detection","enable"),&RigidBody::set_use_continuous_collision_detection); - ObjectTypeDB::bind_method(_MD("is_using_continuous_collision_detection"),&RigidBody::is_using_continuous_collision_detection); + ClassDB::bind_method(_MD("set_use_continuous_collision_detection","enable"),&RigidBody::set_use_continuous_collision_detection); + ClassDB::bind_method(_MD("is_using_continuous_collision_detection"),&RigidBody::is_using_continuous_collision_detection); - ObjectTypeDB::bind_method(_MD("set_axis_velocity","axis_velocity"),&RigidBody::set_axis_velocity); - ObjectTypeDB::bind_method(_MD("apply_impulse","pos","impulse"),&RigidBody::apply_impulse); + ClassDB::bind_method(_MD("set_axis_velocity","axis_velocity"),&RigidBody::set_axis_velocity); + ClassDB::bind_method(_MD("apply_impulse","pos","impulse"),&RigidBody::apply_impulse); - ObjectTypeDB::bind_method(_MD("set_sleeping","sleeping"),&RigidBody::set_sleeping); - ObjectTypeDB::bind_method(_MD("is_sleeping"),&RigidBody::is_sleeping); + ClassDB::bind_method(_MD("set_sleeping","sleeping"),&RigidBody::set_sleeping); + ClassDB::bind_method(_MD("is_sleeping"),&RigidBody::is_sleeping); - ObjectTypeDB::bind_method(_MD("set_can_sleep","able_to_sleep"),&RigidBody::set_can_sleep); - ObjectTypeDB::bind_method(_MD("is_able_to_sleep"),&RigidBody::is_able_to_sleep); + ClassDB::bind_method(_MD("set_can_sleep","able_to_sleep"),&RigidBody::set_can_sleep); + ClassDB::bind_method(_MD("is_able_to_sleep"),&RigidBody::is_able_to_sleep); - ObjectTypeDB::bind_method(_MD("_direct_state_changed"),&RigidBody::_direct_state_changed); - ObjectTypeDB::bind_method(_MD("_body_enter_tree"),&RigidBody::_body_enter_tree); - ObjectTypeDB::bind_method(_MD("_body_exit_tree"),&RigidBody::_body_exit_tree); + ClassDB::bind_method(_MD("_direct_state_changed"),&RigidBody::_direct_state_changed); + ClassDB::bind_method(_MD("_body_enter_tree"),&RigidBody::_body_enter_tree); + ClassDB::bind_method(_MD("_body_exit_tree"),&RigidBody::_body_exit_tree); - ObjectTypeDB::bind_method(_MD("set_axis_lock","axis_lock"),&RigidBody::set_axis_lock); - ObjectTypeDB::bind_method(_MD("get_axis_lock"),&RigidBody::get_axis_lock); + ClassDB::bind_method(_MD("set_axis_lock","axis_lock"),&RigidBody::set_axis_lock); + ClassDB::bind_method(_MD("get_axis_lock"),&RigidBody::get_axis_lock); - ObjectTypeDB::bind_method(_MD("get_colliding_bodies"),&RigidBody::get_colliding_bodies); + ClassDB::bind_method(_MD("get_colliding_bodies"),&RigidBody::get_colliding_bodies); BIND_VMETHOD(MethodInfo("_integrate_forces",PropertyInfo(Variant::OBJECT,"state:PhysicsDirectBodyState"))); @@ -876,10 +875,12 @@ void RigidBody::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::BOOL,"sleeping"),_SCS("set_sleeping"),_SCS("is_sleeping")); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"can_sleep"),_SCS("set_can_sleep"),_SCS("is_able_to_sleep")); ADD_PROPERTY( PropertyInfo(Variant::INT,"axis_lock",PROPERTY_HINT_ENUM,"Disabled,Lock X,Lock Y,Lock Z"),_SCS("set_axis_lock"),_SCS("get_axis_lock")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"velocity/linear"),_SCS("set_linear_velocity"),_SCS("get_linear_velocity")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"velocity/angular"),_SCS("set_angular_velocity"),_SCS("get_angular_velocity")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"damp_override/linear",PROPERTY_HINT_RANGE,"-1,128,0.01"),_SCS("set_linear_damp"),_SCS("get_linear_damp")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"damp_override/angular",PROPERTY_HINT_RANGE,"-1,128,0.01"),_SCS("set_angular_damp"),_SCS("get_angular_damp")); + ADD_GROUP("Linear","linear_"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"linear_velocity"),_SCS("set_linear_velocity"),_SCS("get_linear_velocity")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"linear_damp",PROPERTY_HINT_RANGE,"-1,128,0.01"),_SCS("set_linear_damp"),_SCS("get_linear_damp")); + ADD_GROUP("Angular","angular_"); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"angular_velocity"),_SCS("set_angular_velocity"),_SCS("get_angular_velocity")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"angular_damp",PROPERTY_HINT_RANGE,"-1,128,0.01"),_SCS("set_angular_damp"),_SCS("get_angular_damp")); ADD_SIGNAL( MethodInfo("body_enter_shape",PropertyInfo(Variant::INT,"body_id"),PropertyInfo(Variant::OBJECT,"body"),PropertyInfo(Variant::INT,"body_shape"),PropertyInfo(Variant::INT,"local_shape"))); ADD_SIGNAL( MethodInfo("body_exit_shape",PropertyInfo(Variant::INT,"body_id"),PropertyInfo(Variant::OBJECT,"body"),PropertyInfo(Variant::INT,"body_shape"),PropertyInfo(Variant::INT,"local_shape"))); @@ -1294,34 +1295,34 @@ float KinematicBody::get_collision_margin() const{ void KinematicBody::_bind_methods() { - ObjectTypeDB::bind_method(_MD("move","rel_vec"),&KinematicBody::move); - ObjectTypeDB::bind_method(_MD("move_to","position"),&KinematicBody::move_to); + ClassDB::bind_method(_MD("move","rel_vec"),&KinematicBody::move); + ClassDB::bind_method(_MD("move_to","position"),&KinematicBody::move_to); - ObjectTypeDB::bind_method(_MD("can_teleport_to","position"),&KinematicBody::can_teleport_to); + ClassDB::bind_method(_MD("can_teleport_to","position"),&KinematicBody::can_teleport_to); - ObjectTypeDB::bind_method(_MD("is_colliding"),&KinematicBody::is_colliding); + ClassDB::bind_method(_MD("is_colliding"),&KinematicBody::is_colliding); - ObjectTypeDB::bind_method(_MD("get_collision_pos"),&KinematicBody::get_collision_pos); - ObjectTypeDB::bind_method(_MD("get_collision_normal"),&KinematicBody::get_collision_normal); - ObjectTypeDB::bind_method(_MD("get_collider_velocity"),&KinematicBody::get_collider_velocity); - ObjectTypeDB::bind_method(_MD("get_collider:Object"),&KinematicBody::_get_collider); - ObjectTypeDB::bind_method(_MD("get_collider_shape"),&KinematicBody::get_collider_shape); + ClassDB::bind_method(_MD("get_collision_pos"),&KinematicBody::get_collision_pos); + ClassDB::bind_method(_MD("get_collision_normal"),&KinematicBody::get_collision_normal); + ClassDB::bind_method(_MD("get_collider_velocity"),&KinematicBody::get_collider_velocity); + ClassDB::bind_method(_MD("get_collider:Variant"),&KinematicBody::_get_collider); + ClassDB::bind_method(_MD("get_collider_shape"),&KinematicBody::get_collider_shape); - ObjectTypeDB::bind_method(_MD("set_collide_with_static_bodies","enable"),&KinematicBody::set_collide_with_static_bodies); - ObjectTypeDB::bind_method(_MD("can_collide_with_static_bodies"),&KinematicBody::can_collide_with_static_bodies); + ClassDB::bind_method(_MD("set_collide_with_static_bodies","enable"),&KinematicBody::set_collide_with_static_bodies); + ClassDB::bind_method(_MD("can_collide_with_static_bodies"),&KinematicBody::can_collide_with_static_bodies); - ObjectTypeDB::bind_method(_MD("set_collide_with_kinematic_bodies","enable"),&KinematicBody::set_collide_with_kinematic_bodies); - ObjectTypeDB::bind_method(_MD("can_collide_with_kinematic_bodies"),&KinematicBody::can_collide_with_kinematic_bodies); + ClassDB::bind_method(_MD("set_collide_with_kinematic_bodies","enable"),&KinematicBody::set_collide_with_kinematic_bodies); + ClassDB::bind_method(_MD("can_collide_with_kinematic_bodies"),&KinematicBody::can_collide_with_kinematic_bodies); - ObjectTypeDB::bind_method(_MD("set_collide_with_rigid_bodies","enable"),&KinematicBody::set_collide_with_rigid_bodies); - ObjectTypeDB::bind_method(_MD("can_collide_with_rigid_bodies"),&KinematicBody::can_collide_with_rigid_bodies); + ClassDB::bind_method(_MD("set_collide_with_rigid_bodies","enable"),&KinematicBody::set_collide_with_rigid_bodies); + ClassDB::bind_method(_MD("can_collide_with_rigid_bodies"),&KinematicBody::can_collide_with_rigid_bodies); - ObjectTypeDB::bind_method(_MD("set_collide_with_character_bodies","enable"),&KinematicBody::set_collide_with_character_bodies); - ObjectTypeDB::bind_method(_MD("can_collide_with_character_bodies"),&KinematicBody::can_collide_with_character_bodies); + ClassDB::bind_method(_MD("set_collide_with_character_bodies","enable"),&KinematicBody::set_collide_with_character_bodies); + ClassDB::bind_method(_MD("can_collide_with_character_bodies"),&KinematicBody::can_collide_with_character_bodies); - ObjectTypeDB::bind_method(_MD("set_collision_margin","pixels"),&KinematicBody::set_collision_margin); - ObjectTypeDB::bind_method(_MD("get_collision_margin","pixels"),&KinematicBody::get_collision_margin); + ClassDB::bind_method(_MD("set_collision_margin","pixels"),&KinematicBody::set_collision_margin); + ClassDB::bind_method(_MD("get_collision_margin","pixels"),&KinematicBody::get_collision_margin); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"collide_with/static"),_SCS("set_collide_with_static_bodies"),_SCS("can_collide_with_static_bodies")); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"collide_with/kinematic"),_SCS("set_collide_with_kinematic_bodies"),_SCS("can_collide_with_kinematic_bodies")); diff --git a/scene/3d/physics_body.h b/scene/3d/physics_body.h index f95b4f017f..9f317745b3 100644 --- a/scene/3d/physics_body.h +++ b/scene/3d/physics_body.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ class PhysicsBody : public CollisionObject { - OBJ_TYPE(PhysicsBody,CollisionObject); + GDCLASS(PhysicsBody,CollisionObject); uint32_t layer_mask; uint32_t collision_mask; @@ -78,7 +78,7 @@ public: class StaticBody : public PhysicsBody { - OBJ_TYPE(StaticBody,PhysicsBody); + GDCLASS(StaticBody,PhysicsBody); Vector3 constant_linear_velocity; Vector3 constant_angular_velocity; @@ -114,7 +114,7 @@ public: class RigidBody : public PhysicsBody { - OBJ_TYPE(RigidBody,PhysicsBody); + GDCLASS(RigidBody,PhysicsBody); public: enum Mode { @@ -284,7 +284,7 @@ VARIANT_ENUM_CAST(RigidBody::AxisLock); class KinematicBody : public PhysicsBody { - OBJ_TYPE(KinematicBody,PhysicsBody); + GDCLASS(KinematicBody,PhysicsBody); float margin; bool collide_static; diff --git a/scene/3d/physics_joint.cpp b/scene/3d/physics_joint.cpp index 084d96975f..a27e558e45 100644 --- a/scene/3d/physics_joint.cpp +++ b/scene/3d/physics_joint.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -167,17 +167,17 @@ bool Joint::get_exclude_nodes_from_collision() const{ void Joint::_bind_methods() { - ObjectTypeDB::bind_method( _MD("set_node_a","node"), &Joint::set_node_a ); - ObjectTypeDB::bind_method( _MD("get_node_a"), &Joint::get_node_a ); + ClassDB::bind_method( _MD("set_node_a","node"), &Joint::set_node_a ); + ClassDB::bind_method( _MD("get_node_a"), &Joint::get_node_a ); - ObjectTypeDB::bind_method( _MD("set_node_b","node"), &Joint::set_node_b ); - ObjectTypeDB::bind_method( _MD("get_node_b"), &Joint::get_node_b ); + ClassDB::bind_method( _MD("set_node_b","node"), &Joint::set_node_b ); + ClassDB::bind_method( _MD("get_node_b"), &Joint::get_node_b ); - ObjectTypeDB::bind_method( _MD("set_solver_priority","priority"), &Joint::set_solver_priority ); - ObjectTypeDB::bind_method( _MD("get_solver_priority"), &Joint::get_solver_priority ); + ClassDB::bind_method( _MD("set_solver_priority","priority"), &Joint::set_solver_priority ); + ClassDB::bind_method( _MD("get_solver_priority"), &Joint::get_solver_priority ); - ObjectTypeDB::bind_method( _MD("set_exclude_nodes_from_collision","enable"), &Joint::set_exclude_nodes_from_collision ); - ObjectTypeDB::bind_method( _MD("get_exclude_nodes_from_collision"), &Joint::get_exclude_nodes_from_collision ); + ClassDB::bind_method( _MD("set_exclude_nodes_from_collision","enable"), &Joint::set_exclude_nodes_from_collision ); + ClassDB::bind_method( _MD("get_exclude_nodes_from_collision"), &Joint::get_exclude_nodes_from_collision ); ADD_PROPERTY( PropertyInfo( Variant::NODE_PATH, "nodes/node_a"), _SCS("set_node_a"),_SCS("get_node_a") ); ADD_PROPERTY( PropertyInfo( Variant::NODE_PATH, "nodes/node_b"), _SCS("set_node_b"),_SCS("get_node_b") ); @@ -202,8 +202,8 @@ Joint::Joint() { void PinJoint::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_param","param","value"),&PinJoint::set_param); - ObjectTypeDB::bind_method(_MD("get_param","param"),&PinJoint::get_param); + ClassDB::bind_method(_MD("set_param","param","value"),&PinJoint::set_param); + ClassDB::bind_method(_MD("get_param","param"),&PinJoint::get_param); ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/bias",PROPERTY_HINT_RANGE,"0.01,0.99,0.01"),_SCS("set_param"),_SCS("get_param"), PARAM_BIAS ); ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/damping",PROPERTY_HINT_RANGE,"0.01,8.0,0.01"),_SCS("set_param"),_SCS("get_param"), PARAM_DAMPING ); @@ -291,17 +291,17 @@ float HingeJoint::_get_lower_limit() const { void HingeJoint::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_param","param","value"),&HingeJoint::set_param); - ObjectTypeDB::bind_method(_MD("get_param","param"),&HingeJoint::get_param); + ClassDB::bind_method(_MD("set_param","param","value"),&HingeJoint::set_param); + ClassDB::bind_method(_MD("get_param","param"),&HingeJoint::get_param); - ObjectTypeDB::bind_method(_MD("set_flag","flag","enabled"),&HingeJoint::set_flag); - ObjectTypeDB::bind_method(_MD("get_flag","flag"),&HingeJoint::get_flag); + ClassDB::bind_method(_MD("set_flag","flag","enabled"),&HingeJoint::set_flag); + ClassDB::bind_method(_MD("get_flag","flag"),&HingeJoint::get_flag); - ObjectTypeDB::bind_method(_MD("_set_upper_limit","upper_limit"),&HingeJoint::_set_upper_limit); - ObjectTypeDB::bind_method(_MD("_get_upper_limit"),&HingeJoint::_get_upper_limit); + ClassDB::bind_method(_MD("_set_upper_limit","upper_limit"),&HingeJoint::_set_upper_limit); + ClassDB::bind_method(_MD("_get_upper_limit"),&HingeJoint::_get_upper_limit); - ObjectTypeDB::bind_method(_MD("_set_lower_limit","lower_limit"),&HingeJoint::_set_lower_limit); - ObjectTypeDB::bind_method(_MD("_get_lower_limit"),&HingeJoint::_get_lower_limit); + ClassDB::bind_method(_MD("_set_lower_limit","lower_limit"),&HingeJoint::_set_lower_limit); + ClassDB::bind_method(_MD("_get_lower_limit"),&HingeJoint::_get_lower_limit); ADD_PROPERTYI( PropertyInfo(Variant::REAL,"params/bias",PROPERTY_HINT_RANGE,"0.01,0.99,0.01"),_SCS("set_param"),_SCS("get_param"), PARAM_BIAS ); @@ -446,15 +446,15 @@ float SliderJoint::_get_lower_limit_angular() const { void SliderJoint::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_param","param","value"),&SliderJoint::set_param); - ObjectTypeDB::bind_method(_MD("get_param","param"),&SliderJoint::get_param); + ClassDB::bind_method(_MD("set_param","param","value"),&SliderJoint::set_param); + ClassDB::bind_method(_MD("get_param","param"),&SliderJoint::get_param); - ObjectTypeDB::bind_method(_MD("_set_upper_limit_angular","upper_limit_angular"),&SliderJoint::_set_upper_limit_angular); - ObjectTypeDB::bind_method(_MD("_get_upper_limit_angular"),&SliderJoint::_get_upper_limit_angular); + ClassDB::bind_method(_MD("_set_upper_limit_angular","upper_limit_angular"),&SliderJoint::_set_upper_limit_angular); + ClassDB::bind_method(_MD("_get_upper_limit_angular"),&SliderJoint::_get_upper_limit_angular); - ObjectTypeDB::bind_method(_MD("_set_lower_limit_angular","lower_limit_angular"),&SliderJoint::_set_lower_limit_angular); - ObjectTypeDB::bind_method(_MD("_get_lower_limit_angular"),&SliderJoint::_get_lower_limit_angular); + ClassDB::bind_method(_MD("_set_lower_limit_angular","lower_limit_angular"),&SliderJoint::_set_lower_limit_angular); + ClassDB::bind_method(_MD("_get_lower_limit_angular"),&SliderJoint::_get_lower_limit_angular); ADD_PROPERTYI( PropertyInfo(Variant::REAL,"linear_limit/upper_distance",PROPERTY_HINT_RANGE,"-1024,1024,0.01"),_SCS("set_param"),_SCS("get_param"), PARAM_LINEAR_LIMIT_UPPER); @@ -611,15 +611,15 @@ float ConeTwistJoint::_get_twist_span() const { void ConeTwistJoint::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_param","param","value"),&ConeTwistJoint::set_param); - ObjectTypeDB::bind_method(_MD("get_param","param"),&ConeTwistJoint::get_param); + ClassDB::bind_method(_MD("set_param","param","value"),&ConeTwistJoint::set_param); + ClassDB::bind_method(_MD("get_param","param"),&ConeTwistJoint::get_param); - ObjectTypeDB::bind_method(_MD("_set_swing_span","swing_span"),&ConeTwistJoint::_set_swing_span); - ObjectTypeDB::bind_method(_MD("_get_swing_span"),&ConeTwistJoint::_get_swing_span); + ClassDB::bind_method(_MD("_set_swing_span","swing_span"),&ConeTwistJoint::_set_swing_span); + ClassDB::bind_method(_MD("_get_swing_span"),&ConeTwistJoint::_get_swing_span); - ObjectTypeDB::bind_method(_MD("_set_twist_span","twist_span"),&ConeTwistJoint::_set_twist_span); - ObjectTypeDB::bind_method(_MD("_get_twist_span"),&ConeTwistJoint::_get_twist_span); + ClassDB::bind_method(_MD("_set_twist_span","twist_span"),&ConeTwistJoint::_set_twist_span); + ClassDB::bind_method(_MD("_get_twist_span"),&ConeTwistJoint::_get_twist_span); ADD_PROPERTY( PropertyInfo(Variant::REAL,"swing_span",PROPERTY_HINT_RANGE,"-180,180,0.1"),_SCS("_set_swing_span"),_SCS("_get_swing_span") ); @@ -770,41 +770,41 @@ float Generic6DOFJoint::_get_angular_lo_limit_z() const{ void Generic6DOFJoint::_bind_methods(){ - ObjectTypeDB::bind_method(_MD("_set_angular_hi_limit_x","angle"),&Generic6DOFJoint::_set_angular_hi_limit_x); - ObjectTypeDB::bind_method(_MD("_get_angular_hi_limit_x"),&Generic6DOFJoint::_get_angular_hi_limit_x); + ClassDB::bind_method(_MD("_set_angular_hi_limit_x","angle"),&Generic6DOFJoint::_set_angular_hi_limit_x); + ClassDB::bind_method(_MD("_get_angular_hi_limit_x"),&Generic6DOFJoint::_get_angular_hi_limit_x); - ObjectTypeDB::bind_method(_MD("_set_angular_lo_limit_x","angle"),&Generic6DOFJoint::_set_angular_lo_limit_x); - ObjectTypeDB::bind_method(_MD("_get_angular_lo_limit_x"),&Generic6DOFJoint::_get_angular_lo_limit_x); + ClassDB::bind_method(_MD("_set_angular_lo_limit_x","angle"),&Generic6DOFJoint::_set_angular_lo_limit_x); + ClassDB::bind_method(_MD("_get_angular_lo_limit_x"),&Generic6DOFJoint::_get_angular_lo_limit_x); - ObjectTypeDB::bind_method(_MD("_set_angular_hi_limit_y","angle"),&Generic6DOFJoint::_set_angular_hi_limit_y); - ObjectTypeDB::bind_method(_MD("_get_angular_hi_limit_y"),&Generic6DOFJoint::_get_angular_hi_limit_y); + ClassDB::bind_method(_MD("_set_angular_hi_limit_y","angle"),&Generic6DOFJoint::_set_angular_hi_limit_y); + ClassDB::bind_method(_MD("_get_angular_hi_limit_y"),&Generic6DOFJoint::_get_angular_hi_limit_y); - ObjectTypeDB::bind_method(_MD("_set_angular_lo_limit_y","angle"),&Generic6DOFJoint::_set_angular_lo_limit_y); - ObjectTypeDB::bind_method(_MD("_get_angular_lo_limit_y"),&Generic6DOFJoint::_get_angular_lo_limit_y); + ClassDB::bind_method(_MD("_set_angular_lo_limit_y","angle"),&Generic6DOFJoint::_set_angular_lo_limit_y); + ClassDB::bind_method(_MD("_get_angular_lo_limit_y"),&Generic6DOFJoint::_get_angular_lo_limit_y); - ObjectTypeDB::bind_method(_MD("_set_angular_hi_limit_z","angle"),&Generic6DOFJoint::_set_angular_hi_limit_z); - ObjectTypeDB::bind_method(_MD("_get_angular_hi_limit_z"),&Generic6DOFJoint::_get_angular_hi_limit_z); + ClassDB::bind_method(_MD("_set_angular_hi_limit_z","angle"),&Generic6DOFJoint::_set_angular_hi_limit_z); + ClassDB::bind_method(_MD("_get_angular_hi_limit_z"),&Generic6DOFJoint::_get_angular_hi_limit_z); - ObjectTypeDB::bind_method(_MD("_set_angular_lo_limit_z","angle"),&Generic6DOFJoint::_set_angular_lo_limit_z); - ObjectTypeDB::bind_method(_MD("_get_angular_lo_limit_z"),&Generic6DOFJoint::_get_angular_lo_limit_z); + ClassDB::bind_method(_MD("_set_angular_lo_limit_z","angle"),&Generic6DOFJoint::_set_angular_lo_limit_z); + ClassDB::bind_method(_MD("_get_angular_lo_limit_z"),&Generic6DOFJoint::_get_angular_lo_limit_z); - ObjectTypeDB::bind_method(_MD("set_param_x","param","value"),&Generic6DOFJoint::set_param_x); - ObjectTypeDB::bind_method(_MD("get_param_x","param"),&Generic6DOFJoint::get_param_x); + ClassDB::bind_method(_MD("set_param_x","param","value"),&Generic6DOFJoint::set_param_x); + ClassDB::bind_method(_MD("get_param_x","param"),&Generic6DOFJoint::get_param_x); - ObjectTypeDB::bind_method(_MD("set_param_y","param","value"),&Generic6DOFJoint::set_param_y); - ObjectTypeDB::bind_method(_MD("get_param_y","param"),&Generic6DOFJoint::get_param_y); + ClassDB::bind_method(_MD("set_param_y","param","value"),&Generic6DOFJoint::set_param_y); + ClassDB::bind_method(_MD("get_param_y","param"),&Generic6DOFJoint::get_param_y); - ObjectTypeDB::bind_method(_MD("set_param_z","param","value"),&Generic6DOFJoint::set_param_z); - ObjectTypeDB::bind_method(_MD("get_param_z","param"),&Generic6DOFJoint::get_param_z); + ClassDB::bind_method(_MD("set_param_z","param","value"),&Generic6DOFJoint::set_param_z); + ClassDB::bind_method(_MD("get_param_z","param"),&Generic6DOFJoint::get_param_z); - ObjectTypeDB::bind_method(_MD("set_flag_x","flag","value"),&Generic6DOFJoint::set_flag_x); - ObjectTypeDB::bind_method(_MD("get_flag_x","flag"),&Generic6DOFJoint::get_flag_x); + ClassDB::bind_method(_MD("set_flag_x","flag","value"),&Generic6DOFJoint::set_flag_x); + ClassDB::bind_method(_MD("get_flag_x","flag"),&Generic6DOFJoint::get_flag_x); - ObjectTypeDB::bind_method(_MD("set_flag_y","flag","value"),&Generic6DOFJoint::set_flag_y); - ObjectTypeDB::bind_method(_MD("get_flag_y","flag"),&Generic6DOFJoint::get_flag_y); + ClassDB::bind_method(_MD("set_flag_y","flag","value"),&Generic6DOFJoint::set_flag_y); + ClassDB::bind_method(_MD("get_flag_y","flag"),&Generic6DOFJoint::get_flag_y); - ObjectTypeDB::bind_method(_MD("set_flag_z","flag","value"),&Generic6DOFJoint::set_flag_z); - ObjectTypeDB::bind_method(_MD("get_flag_z","flag"),&Generic6DOFJoint::get_flag_z); + ClassDB::bind_method(_MD("set_flag_z","flag","value"),&Generic6DOFJoint::set_flag_z); + ClassDB::bind_method(_MD("get_flag_z","flag"),&Generic6DOFJoint::get_flag_z); ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"linear_limit_x/enabled"),_SCS("set_flag_x"),_SCS("get_flag_x"),FLAG_ENABLE_LINEAR_LIMIT); @@ -1170,22 +1170,22 @@ RID PhysicsJoint::_get_visual_instance_rid() const { void PhysicsJoint::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_get_visual_instance_rid"),&PhysicsJoint::_get_visual_instance_rid); - ObjectTypeDB::bind_method(_MD("set_body_A","path"),&PhysicsJoint::set_body_A); - ObjectTypeDB::bind_method(_MD("set_body_B"),&PhysicsJoint::set_body_B); - ObjectTypeDB::bind_method(_MD("get_body_A","path"),&PhysicsJoint::get_body_A); - ObjectTypeDB::bind_method(_MD("get_body_B"),&PhysicsJoint::get_body_B); + ClassDB::bind_method(_MD("_get_visual_instance_rid"),&PhysicsJoint::_get_visual_instance_rid); + ClassDB::bind_method(_MD("set_body_A","path"),&PhysicsJoint::set_body_A); + ClassDB::bind_method(_MD("set_body_B"),&PhysicsJoint::set_body_B); + ClassDB::bind_method(_MD("get_body_A","path"),&PhysicsJoint::get_body_A); + ClassDB::bind_method(_MD("get_body_B"),&PhysicsJoint::get_body_B); - ObjectTypeDB::bind_method(_MD("set_active","active"),&PhysicsJoint::set_active); - ObjectTypeDB::bind_method(_MD("is_active"),&PhysicsJoint::is_active); + ClassDB::bind_method(_MD("set_active","active"),&PhysicsJoint::set_active); + ClassDB::bind_method(_MD("is_active"),&PhysicsJoint::is_active); - ObjectTypeDB::bind_method(_MD("set_disable_collision","disable"),&PhysicsJoint::set_disable_collision); - ObjectTypeDB::bind_method(_MD("has_disable_collision"),&PhysicsJoint::has_disable_collision); + ClassDB::bind_method(_MD("set_disable_collision","disable"),&PhysicsJoint::set_disable_collision); + ClassDB::bind_method(_MD("has_disable_collision"),&PhysicsJoint::has_disable_collision); - ObjectTypeDB::bind_method("reconnect",&PhysicsJoint::reconnect); + ClassDB::bind_method("reconnect",&PhysicsJoint::reconnect); - ObjectTypeDB::bind_method(_MD("get_rid"),&PhysicsJoint::get_rid); + ClassDB::bind_method(_MD("get_rid"),&PhysicsJoint::get_rid); } diff --git a/scene/3d/physics_joint.h b/scene/3d/physics_joint.h index 55c26f296e..5debe87d38 100644 --- a/scene/3d/physics_joint.h +++ b/scene/3d/physics_joint.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class Joint : public Spatial { - OBJ_TYPE(Joint,Spatial); + GDCLASS(Joint,Spatial); RID ba,bb; @@ -81,7 +81,7 @@ public: class PinJoint : public Joint { - OBJ_TYPE(PinJoint,Joint); + GDCLASS(PinJoint,Joint); public: enum Param { @@ -108,7 +108,7 @@ VARIANT_ENUM_CAST(PinJoint::Param); class HingeJoint : public Joint { - OBJ_TYPE(HingeJoint,Joint); + GDCLASS(HingeJoint,Joint); public: enum Param { @@ -161,7 +161,7 @@ VARIANT_ENUM_CAST(HingeJoint::Flag); class SliderJoint : public Joint { - OBJ_TYPE(SliderJoint,Joint); + GDCLASS(SliderJoint,Joint); public: enum Param { @@ -221,7 +221,7 @@ VARIANT_ENUM_CAST(SliderJoint::Param); class ConeTwistJoint : public Joint { - OBJ_TYPE(ConeTwistJoint,Joint); + GDCLASS(ConeTwistJoint,Joint); public: enum Param { @@ -260,7 +260,7 @@ VARIANT_ENUM_CAST(ConeTwistJoint::Param); class Generic6DOFJoint : public Joint { - OBJ_TYPE(Generic6DOFJoint,Joint); + GDCLASS(Generic6DOFJoint,Joint); public: enum Param { @@ -351,7 +351,7 @@ VARIANT_ENUM_CAST(Generic6DOFJoint::Flag); #if 0 class PhysicsJoint : public Spatial { - OBJ_TYPE(PhysicsJoint,Spatial); + GDCLASS(PhysicsJoint,Spatial); OBJ_CATEGORY("3D Physics Nodes"); NodePath body_A; @@ -404,7 +404,7 @@ public: class PhysicsJointPin : public PhysicsJoint { - OBJ_TYPE( PhysicsJointPin, PhysicsJoint ); + GDCLASS( PhysicsJointPin, PhysicsJoint ); protected: diff --git a/scene/3d/portal.cpp b/scene/3d/portal.cpp index 23bc64615d..054b61a4ed 100644 --- a/scene/3d/portal.cpp +++ b/scene/3d/portal.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ bool Portal::_set(const StringName& p_name, const Variant& p_value) { if (p_name=="shape") { - DVector<float> src_coords=p_value; + PoolVector<float> src_coords=p_value; Vector<Point2> points; int src_coords_size = src_coords.size(); ERR_FAIL_COND_V(src_coords_size%2,false); @@ -63,7 +63,7 @@ bool Portal::_get(const StringName& p_name,Variant &r_ret) const { if (p_name=="shape") { Vector<Point2> points=get_shape(); - DVector<float> dst_coords; + PoolVector<float> dst_coords; dst_coords.resize(points.size()*2); for (int i=0;i<points.size();i++) { @@ -88,7 +88,7 @@ bool Portal::_get(const StringName& p_name,Variant &r_ret) const { void Portal::_get_property_list( List<PropertyInfo> *p_list) const { - p_list->push_back( PropertyInfo( Variant::REAL_ARRAY, "shape" ) ); + p_list->push_back( PropertyInfo( Variant::POOL_REAL_ARRAY, "shape" ) ); p_list->push_back( PropertyInfo( Variant::BOOL, "enabled" ) ); p_list->push_back( PropertyInfo( Variant::REAL, "disable_distance",PROPERTY_HINT_RANGE,"0,4096,0.01" ) ); p_list->push_back( PropertyInfo( Variant::COLOR, "disabled_color") ); @@ -96,59 +96,20 @@ void Portal::_get_property_list( List<PropertyInfo> *p_list) const { } -RES Portal::_get_gizmo_geometry() const { - Ref<SurfaceTool> surface_tool( memnew( SurfaceTool )); - Ref<FixedMaterial> mat( memnew( FixedMaterial )); - - mat->set_parameter( FixedMaterial::PARAM_DIFFUSE,Color(1.0,0.8,0.8,0.7) ); - mat->set_line_width(4); - mat->set_flag(Material::FLAG_DOUBLE_SIDED,true); - mat->set_flag(Material::FLAG_UNSHADED,true); -// mat->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER,true); - - surface_tool->begin(Mesh::PRIMITIVE_LINES); - surface_tool->set_material(mat); - - Vector<Point2> shape = get_shape(); - - Vector2 center; - for (int i=0;i<shape.size();i++) { - - int n=(i+1)%shape.size(); - Vector<Vector3> points; - surface_tool->add_vertex( Vector3( shape[i].x, shape[i].y,0 )); - surface_tool->add_vertex( Vector3( shape[n].x, shape[n].y,0 )); - center+=shape[i]; - - } - - if (shape.size()>0) { - - center/=shape.size(); - Vector<Vector3> points; - surface_tool->add_vertex( Vector3( center.x, center.y,0 )); - surface_tool->add_vertex( Vector3( center.x, center.y,1.0 )); - } - - return surface_tool->commit(); -} - - - -AABB Portal::get_aabb() const { +Rect3 Portal::get_aabb() const { return aabb; } -DVector<Face3> Portal::get_faces(uint32_t p_usage_flags) const { +PoolVector<Face3> Portal::get_faces(uint32_t p_usage_flags) const { if (!(p_usage_flags&FACES_ENCLOSING)) - return DVector<Face3>(); + return PoolVector<Face3>(); Vector<Point2> shape = get_shape(); if (shape.size()==0) - return DVector<Face3>(); + return PoolVector<Face3>(); Vector2 center; for (int i=0;i<shape.size();i++) { @@ -157,7 +118,7 @@ DVector<Face3> Portal::get_faces(uint32_t p_usage_flags) const { } - DVector<Face3> ret; + PoolVector<Face3> ret; center/=shape.size(); for (int i=0;i<shape.size();i++) { @@ -178,18 +139,19 @@ void Portal::set_shape(const Vector<Point2>& p_shape) { VisualServer::get_singleton()->portal_set_shape(portal, p_shape); + shape=p_shape; update_gizmo(); } Vector<Point2> Portal::get_shape() const { - return VisualServer::get_singleton()->portal_get_shape(portal); + return shape; } void Portal::set_connect_range(float p_range) { connect_range=p_range; - VisualServer::get_singleton()->portal_set_connect_range(portal,p_range); + //VisualServer::get_singleton()->portal_set_connect_range(portal,p_range); } float Portal::get_connect_range() const { @@ -235,20 +197,20 @@ Color Portal::get_disabled_color() const { void Portal::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_shape","points"),&Portal::set_shape); - ObjectTypeDB::bind_method(_MD("get_shape"),&Portal::get_shape); + ClassDB::bind_method(_MD("set_shape","points"),&Portal::set_shape); + ClassDB::bind_method(_MD("get_shape"),&Portal::get_shape); - ObjectTypeDB::bind_method(_MD("set_enabled","enable"),&Portal::set_enabled); - ObjectTypeDB::bind_method(_MD("is_enabled"),&Portal::is_enabled); + ClassDB::bind_method(_MD("set_enabled","enable"),&Portal::set_enabled); + ClassDB::bind_method(_MD("is_enabled"),&Portal::is_enabled); - ObjectTypeDB::bind_method(_MD("set_disable_distance","distance"),&Portal::set_disable_distance); - ObjectTypeDB::bind_method(_MD("get_disable_distance"),&Portal::get_disable_distance); + ClassDB::bind_method(_MD("set_disable_distance","distance"),&Portal::set_disable_distance); + ClassDB::bind_method(_MD("get_disable_distance"),&Portal::get_disable_distance); - ObjectTypeDB::bind_method(_MD("set_disabled_color","color"),&Portal::set_disabled_color); - ObjectTypeDB::bind_method(_MD("get_disabled_color"),&Portal::get_disabled_color); + ClassDB::bind_method(_MD("set_disabled_color","color"),&Portal::set_disabled_color); + ClassDB::bind_method(_MD("get_disabled_color"),&Portal::get_disabled_color); - ObjectTypeDB::bind_method(_MD("set_connect_range","range"),&Portal::set_connect_range); - ObjectTypeDB::bind_method(_MD("get_connect_range"),&Portal::get_connect_range); + ClassDB::bind_method(_MD("set_connect_range","range"),&Portal::set_connect_range); + ClassDB::bind_method(_MD("get_connect_range"),&Portal::get_connect_range); } diff --git a/scene/3d/portal.h b/scene/3d/portal.h index 149a56900f..077924c7e8 100644 --- a/scene/3d/portal.h +++ b/scene/3d/portal.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -44,18 +44,18 @@ class Portal : public VisualInstance { - OBJ_TYPE(Portal, VisualInstance); + GDCLASS(Portal, VisualInstance); RID portal; + Vector<Point2> shape; bool enabled; float disable_distance; Color disabled_color; float connect_range; - AABB aabb; + Rect3 aabb; - virtual RES _get_gizmo_geometry() const; protected: @@ -67,8 +67,8 @@ protected: public: - virtual AABB get_aabb() const; - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual Rect3 get_aabb() const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; void set_enabled(bool p_enabled); bool is_enabled() const; diff --git a/scene/3d/position_3d.cpp b/scene/3d/position_3d.cpp index 27130cbe6a..e7403053b2 100644 --- a/scene/3d/position_3d.cpp +++ b/scene/3d/position_3d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -29,37 +29,6 @@ #include "position_3d.h" #include "scene/resources/mesh.h" -RES Position3D::_get_gizmo_geometry() const { - - - Ref<Mesh> mesh = memnew( Mesh ); - - DVector<Vector3> cursor_points; - DVector<Color> cursor_colors; - float cs = 0.25; - cursor_points.push_back(Vector3(+cs,0,0)); - cursor_points.push_back(Vector3(-cs,0,0)); - cursor_points.push_back(Vector3(0,+cs,0)); - cursor_points.push_back(Vector3(0,-cs,0)); - cursor_points.push_back(Vector3(0,0,+cs)); - cursor_points.push_back(Vector3(0,0,-cs)); - cursor_colors.push_back(Color(1,0.5,0.5,1)); - cursor_colors.push_back(Color(1,0.5,0.5,1)); - cursor_colors.push_back(Color(0.5,1,0.5,1)); - cursor_colors.push_back(Color(0.5,1,0.5,1)); - cursor_colors.push_back(Color(0.5,0.5,1,1)); - cursor_colors.push_back(Color(0.5,0.5,1,1)); - - Ref<FixedMaterial> mat = memnew( FixedMaterial ); - mat->set_flag(Material::FLAG_UNSHADED,true); - mat->set_line_width(3); - Array d; - d[Mesh::ARRAY_VERTEX]=cursor_points; - d[Mesh::ARRAY_COLOR]=cursor_colors; - mesh->add_surface(Mesh::PRIMITIVE_LINES,d); - mesh->surface_set_material(0,mat); - return mesh; -} Position3D::Position3D() { diff --git a/scene/3d/position_3d.h b/scene/3d/position_3d.h index 6bac540fcb..e732c5321e 100644 --- a/scene/3d/position_3d.h +++ b/scene/3d/position_3d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,9 +33,8 @@ class Position3D : public Spatial { - OBJ_TYPE(Position3D,Spatial); + GDCLASS(Position3D,Spatial); - virtual RES _get_gizmo_geometry() const; public: diff --git a/scene/3d/proximity_group.cpp b/scene/3d/proximity_group.cpp index a2182302a0..c3cb20bfdd 100644 --- a/scene/3d/proximity_group.cpp +++ b/scene/3d/proximity_group.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -171,12 +171,12 @@ Vector3 ProximityGroup::get_grid_radius() const { void ProximityGroup::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_group_name","name"), &ProximityGroup::set_group_name); - ObjectTypeDB::bind_method(_MD("broadcast","name", "parameters"), &ProximityGroup::broadcast); - ObjectTypeDB::bind_method(_MD("set_dispatch_mode","mode"), &ProximityGroup::set_dispatch_mode); - ObjectTypeDB::bind_method(_MD("_proximity_group_broadcast","name","params"), &ProximityGroup::_proximity_group_broadcast); - ObjectTypeDB::bind_method(_MD("set_grid_radius","radius"), &ProximityGroup::set_grid_radius); - ObjectTypeDB::bind_method(_MD("get_grid_radius"), &ProximityGroup::get_grid_radius); + ClassDB::bind_method(_MD("set_group_name","name"), &ProximityGroup::set_group_name); + ClassDB::bind_method(_MD("broadcast","name", "parameters"), &ProximityGroup::broadcast); + ClassDB::bind_method(_MD("set_dispatch_mode","mode"), &ProximityGroup::set_dispatch_mode); + ClassDB::bind_method(_MD("_proximity_group_broadcast","name","params"), &ProximityGroup::_proximity_group_broadcast); + ClassDB::bind_method(_MD("set_grid_radius","radius"), &ProximityGroup::set_grid_radius); + ClassDB::bind_method(_MD("get_grid_radius"), &ProximityGroup::get_grid_radius); ADD_PROPERTY( PropertyInfo( Variant::VECTOR3, "grid_radius"), _SCS("set_grid_radius"), _SCS("get_grid_radius")); diff --git a/scene/3d/proximity_group.h b/scene/3d/proximity_group.h index 6d5c703827..58d2436975 100644 --- a/scene/3d/proximity_group.h +++ b/scene/3d/proximity_group.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class ProximityGroup : public Spatial { - OBJ_TYPE( ProximityGroup, Spatial ); + GDCLASS( ProximityGroup, Spatial ); OBJ_CATEGORY("3D"); public: diff --git a/scene/3d/quad.cpp b/scene/3d/quad.cpp index 1a7eeef180..d1cef0e851 100644 --- a/scene/3d/quad.cpp +++ b/scene/3d/quad.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -44,9 +44,9 @@ void Quad::_update() { - DVector<Vector3> points; + PoolVector<Vector3> points; points.resize(4); - DVector<Vector3>::Write pointsw = points.write(); + PoolVector<Vector3>::Write pointsw = points.write(); Vector2 s2 = size*0.5; Vector2 o = offset; @@ -66,38 +66,38 @@ void Quad::_update() { pointsw[3][a2]=-s2.y+offset.y; - aabb=AABB(pointsw[0],Vector3()); + aabb=Rect3(pointsw[0],Vector3()); for(int i=1;i<4;i++) aabb.expand_to(pointsw[i]); - pointsw = DVector<Vector3>::Write(); + pointsw = PoolVector<Vector3>::Write(); - DVector<Vector3> normals; + PoolVector<Vector3> normals; normals.resize(4); - DVector<Vector3>::Write normalsw = normals.write(); + PoolVector<Vector3>::Write normalsw = normals.write(); for(int i=0;i<4;i++) normalsw[i]=normal; - normalsw=DVector<Vector3>::Write(); + normalsw=PoolVector<Vector3>::Write(); - DVector<Vector2> uvs; + PoolVector<Vector2> uvs; uvs.resize(4); - DVector<Vector2>::Write uvsw = uvs.write(); + PoolVector<Vector2>::Write uvsw = uvs.write(); uvsw[0]=Vector2(0,0); uvsw[1]=Vector2(1,0); uvsw[2]=Vector2(1,1); uvsw[3]=Vector2(0,1); - uvsw = DVector<Vector2>::Write(); + uvsw = PoolVector<Vector2>::Write(); - DVector<int> indices; + PoolVector<int> indices; indices.resize(6); - DVector<int>::Write indicesw = indices.write(); + PoolVector<int>::Write indicesw = indices.write(); indicesw[0]=0; indicesw[1]=1; indicesw[2]=2; @@ -105,7 +105,7 @@ void Quad::_update() { indicesw[4]=3; indicesw[5]=0; - indicesw=DVector<int>::Write(); + indicesw=PoolVector<int>::Write(); Array arr; arr.resize(VS::ARRAY_MAX); @@ -120,7 +120,7 @@ void Quad::_update() { } else { configured=true; } - VS::get_singleton()->mesh_add_surface(mesh,VS::PRIMITIVE_TRIANGLES,arr); + VS::get_singleton()->mesh_add_surface_from_arrays(mesh,VS::PRIMITIVE_TRIANGLES,arr); pending_update=false; } @@ -187,34 +187,34 @@ void Quad::_notification(int p_what) { } } -DVector<Face3> Quad::get_faces(uint32_t p_usage_flags) const { +PoolVector<Face3> Quad::get_faces(uint32_t p_usage_flags) const { - return DVector<Face3>(); + return PoolVector<Face3>(); } -AABB Quad::get_aabb() const { +Rect3 Quad::get_aabb() const { return aabb; } void Quad::_bind_methods(){ - ObjectTypeDB::bind_method(_MD("set_axis","axis"),&Quad::set_axis); - ObjectTypeDB::bind_method(_MD("get_axis"),&Quad::get_axis); + ClassDB::bind_method(_MD("set_axis","axis"),&Quad::set_axis); + ClassDB::bind_method(_MD("get_axis"),&Quad::get_axis); - ObjectTypeDB::bind_method(_MD("set_size","size"),&Quad::set_size); - ObjectTypeDB::bind_method(_MD("get_size"),&Quad::get_size); + ClassDB::bind_method(_MD("set_size","size"),&Quad::set_size); + ClassDB::bind_method(_MD("get_size"),&Quad::get_size); - ObjectTypeDB::bind_method(_MD("set_centered","centered"),&Quad::set_centered); - ObjectTypeDB::bind_method(_MD("is_centered"),&Quad::is_centered); + ClassDB::bind_method(_MD("set_centered","centered"),&Quad::set_centered); + ClassDB::bind_method(_MD("is_centered"),&Quad::is_centered); - ObjectTypeDB::bind_method(_MD("set_offset","offset"),&Quad::set_offset); - ObjectTypeDB::bind_method(_MD("get_offset"),&Quad::get_offset); + ClassDB::bind_method(_MD("set_offset","offset"),&Quad::set_offset); + ClassDB::bind_method(_MD("get_offset"),&Quad::get_offset); - ADD_PROPERTY( PropertyInfo( Variant::INT, "quad/axis", PROPERTY_HINT_ENUM,"X,Y,Z" ), _SCS("set_axis"), _SCS("get_axis")); - ADD_PROPERTY( PropertyInfo( Variant::VECTOR2, "quad/size" ), _SCS("set_size"), _SCS("get_size")); - ADD_PROPERTY( PropertyInfo( Variant::VECTOR2, "quad/offset" ), _SCS("set_offset"), _SCS("get_offset")); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "quad/centered" ), _SCS("set_centered"), _SCS("is_centered")); + ADD_PROPERTY( PropertyInfo( Variant::INT, "axis", PROPERTY_HINT_ENUM,"X,Y,Z" ), _SCS("set_axis"), _SCS("get_axis")); + ADD_PROPERTY( PropertyInfo( Variant::VECTOR2, "size" ), _SCS("set_size"), _SCS("get_size")); + ADD_PROPERTY( PropertyInfo( Variant::VECTOR2, "offset" ), _SCS("set_offset"), _SCS("get_offset")); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "centered" ), _SCS("set_centered"), _SCS("is_centered")); } @@ -230,3 +230,7 @@ Quad::Quad() { configured=false; } + +Quad::~Quad() { + VisualServer::get_singleton()->free(mesh); +} diff --git a/scene/3d/quad.h b/scene/3d/quad.h index be55b0d1c9..af91d7a1f5 100644 --- a/scene/3d/quad.h +++ b/scene/3d/quad.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,14 +35,14 @@ class Quad : public GeometryInstance { - OBJ_TYPE(Quad,GeometryInstance); + GDCLASS(Quad,GeometryInstance); Vector3::Axis axis; bool centered; Vector2 offset; Vector2 size; - AABB aabb; + Rect3 aabb; bool configured; bool pending_update; RID mesh; @@ -67,10 +67,11 @@ public: void set_centered(bool p_enabled); bool is_centered() const; - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const; - virtual AABB get_aabb() const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual Rect3 get_aabb() const; Quad(); + ~Quad(); }; diff --git a/scene/3d/ray_cast.cpp b/scene/3d/ray_cast.cpp index 2b8df8265e..8216d7295f 100644 --- a/scene/3d/ray_cast.cpp +++ b/scene/3d/ray_cast.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -210,37 +210,37 @@ void RayCast::clear_exceptions(){ void RayCast::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_enabled","enabled"),&RayCast::set_enabled); - ObjectTypeDB::bind_method(_MD("is_enabled"),&RayCast::is_enabled); + ClassDB::bind_method(_MD("set_enabled","enabled"),&RayCast::set_enabled); + ClassDB::bind_method(_MD("is_enabled"),&RayCast::is_enabled); - ObjectTypeDB::bind_method(_MD("set_cast_to","local_point"),&RayCast::set_cast_to); - ObjectTypeDB::bind_method(_MD("get_cast_to"),&RayCast::get_cast_to); + ClassDB::bind_method(_MD("set_cast_to","local_point"),&RayCast::set_cast_to); + ClassDB::bind_method(_MD("get_cast_to"),&RayCast::get_cast_to); - ObjectTypeDB::bind_method(_MD("is_colliding"),&RayCast::is_colliding); - ObjectTypeDB::bind_method(_MD("force_raycast_update"),&RayCast::force_raycast_update); + ClassDB::bind_method(_MD("is_colliding"),&RayCast::is_colliding); + ClassDB::bind_method(_MD("force_raycast_update"),&RayCast::force_raycast_update); - ObjectTypeDB::bind_method(_MD("get_collider"),&RayCast::get_collider); - ObjectTypeDB::bind_method(_MD("get_collider_shape"),&RayCast::get_collider_shape); - ObjectTypeDB::bind_method(_MD("get_collision_point"),&RayCast::get_collision_point); - ObjectTypeDB::bind_method(_MD("get_collision_normal"),&RayCast::get_collision_normal); + ClassDB::bind_method(_MD("get_collider"),&RayCast::get_collider); + ClassDB::bind_method(_MD("get_collider_shape"),&RayCast::get_collider_shape); + ClassDB::bind_method(_MD("get_collision_point"),&RayCast::get_collision_point); + ClassDB::bind_method(_MD("get_collision_normal"),&RayCast::get_collision_normal); - ObjectTypeDB::bind_method(_MD("add_exception_rid","rid"),&RayCast::add_exception_rid); - ObjectTypeDB::bind_method(_MD("add_exception","node"),&RayCast::add_exception); + ClassDB::bind_method(_MD("add_exception_rid","rid"),&RayCast::add_exception_rid); + ClassDB::bind_method(_MD("add_exception","node"),&RayCast::add_exception); - ObjectTypeDB::bind_method(_MD("remove_exception_rid","rid"),&RayCast::remove_exception_rid); - ObjectTypeDB::bind_method(_MD("remove_exception","node"),&RayCast::remove_exception); + ClassDB::bind_method(_MD("remove_exception_rid","rid"),&RayCast::remove_exception_rid); + ClassDB::bind_method(_MD("remove_exception","node"),&RayCast::remove_exception); - ObjectTypeDB::bind_method(_MD("clear_exceptions"),&RayCast::clear_exceptions); + ClassDB::bind_method(_MD("clear_exceptions"),&RayCast::clear_exceptions); - ObjectTypeDB::bind_method(_MD("set_layer_mask","mask"),&RayCast::set_layer_mask); - ObjectTypeDB::bind_method(_MD("get_layer_mask"),&RayCast::get_layer_mask); + ClassDB::bind_method(_MD("set_layer_mask","mask"),&RayCast::set_layer_mask); + ClassDB::bind_method(_MD("get_layer_mask"),&RayCast::get_layer_mask); - ObjectTypeDB::bind_method(_MD("set_type_mask","mask"),&RayCast::set_type_mask); - ObjectTypeDB::bind_method(_MD("get_type_mask"),&RayCast::get_type_mask); + ClassDB::bind_method(_MD("set_type_mask","mask"),&RayCast::set_type_mask); + ClassDB::bind_method(_MD("get_type_mask"),&RayCast::get_type_mask); ADD_PROPERTY(PropertyInfo(Variant::BOOL,"enabled"),_SCS("set_enabled"),_SCS("is_enabled")); ADD_PROPERTY(PropertyInfo(Variant::VECTOR3,"cast_to"),_SCS("set_cast_to"),_SCS("get_cast_to")); - ADD_PROPERTY(PropertyInfo(Variant::INT,"layer_mask",PROPERTY_HINT_ALL_FLAGS),_SCS("set_layer_mask"),_SCS("get_layer_mask")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"layer_mask",PROPERTY_HINT_LAYERS_3D_PHYSICS),_SCS("set_layer_mask"),_SCS("get_layer_mask")); ADD_PROPERTY(PropertyInfo(Variant::INT,"type_mask",PROPERTY_HINT_FLAGS,"Static,Kinematic,Rigid,Character,Area"),_SCS("set_type_mask"),_SCS("get_type_mask")); } diff --git a/scene/3d/ray_cast.h b/scene/3d/ray_cast.h index 47553f08ed..32d24cc962 100644 --- a/scene/3d/ray_cast.h +++ b/scene/3d/ray_cast.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class RayCast : public Spatial { - OBJ_TYPE(RayCast,Spatial); + GDCLASS(RayCast,Spatial); bool enabled; diff --git a/scene/3d/reflection_probe.cpp b/scene/3d/reflection_probe.cpp new file mode 100644 index 0000000000..d9592d9484 --- /dev/null +++ b/scene/3d/reflection_probe.cpp @@ -0,0 +1,268 @@ +#include "reflection_probe.h" + + +void ReflectionProbe::set_intensity(float p_intensity) { + + intensity=p_intensity; + VS::get_singleton()->reflection_probe_set_intensity(probe,p_intensity); +} + +float ReflectionProbe::get_intensity() const{ + + return intensity; +} + + +void ReflectionProbe::set_interior_ambient(Color p_ambient) { + + interior_ambient=p_ambient; + VS::get_singleton()->reflection_probe_set_interior_ambient(probe,p_ambient); +} + +void ReflectionProbe::set_interior_ambient_energy(float p_energy) { + interior_ambient_energy=p_energy; + VS::get_singleton()->reflection_probe_set_interior_ambient_energy(probe,p_energy); +} + +float ReflectionProbe::get_interior_ambient_energy() const{ + return interior_ambient_energy; +} + + +Color ReflectionProbe::get_interior_ambient() const{ + + return interior_ambient; +} + +void ReflectionProbe::set_interior_ambient_probe_contribution(float p_contribution) { + + interior_ambient_probe_contribution=p_contribution; + VS::get_singleton()->reflection_probe_set_interior_ambient_probe_contribution(probe,p_contribution); +} + +float ReflectionProbe::get_interior_ambient_probe_contribution() const{ + + return interior_ambient_probe_contribution; +} + + +void ReflectionProbe::set_max_distance(float p_distance){ + + max_distance=p_distance; + VS::get_singleton()->reflection_probe_set_max_distance(probe,p_distance); +} +float ReflectionProbe::get_max_distance() const{ + + return max_distance; +} + + +void ReflectionProbe::set_extents(const Vector3& p_extents){ + + extents=p_extents; + + for(int i=0;i<3;i++) { + if (extents[i]<0.01) { + extents[i]=0.01; + } + + if (extents[i]-0.01<ABS(origin_offset[i])) { + origin_offset[i]=SGN(origin_offset[i])*(extents[i]-0.01); + _change_notify("origin_offset"); + } + } + + VS::get_singleton()->reflection_probe_set_extents(probe,extents); + VS::get_singleton()->reflection_probe_set_origin_offset(probe,origin_offset); + _change_notify("extents"); + update_gizmo(); + +} +Vector3 ReflectionProbe::get_extents() const{ + + return extents; +} + +void ReflectionProbe::set_origin_offset(const Vector3& p_extents){ + + origin_offset=p_extents; + + for(int i=0;i<3;i++) { + + if (extents[i]-0.01<ABS(origin_offset[i])) { + origin_offset[i]=SGN(origin_offset[i])*(extents[i]-0.01); + + } + } + VS::get_singleton()->reflection_probe_set_extents(probe,extents); + VS::get_singleton()->reflection_probe_set_origin_offset(probe,origin_offset); + + _change_notify("origin_offset"); + update_gizmo(); +} +Vector3 ReflectionProbe::get_origin_offset() const{ + + return origin_offset; +} + +void ReflectionProbe::set_enable_box_projection(bool p_enable){ + + box_projection=p_enable; + VS::get_singleton()->reflection_probe_set_enable_box_projection(probe,p_enable); + +} +bool ReflectionProbe::is_box_projection_enabled() const{ + + return box_projection; +} + + +void ReflectionProbe::set_as_interior(bool p_enable) { + + interior=p_enable; + VS::get_singleton()->reflection_probe_set_as_interior(probe,interior); + _change_notify(); + +} + +bool ReflectionProbe::is_set_as_interior() const { + + return interior; +} + + + +void ReflectionProbe::set_enable_shadows(bool p_enable) { + + enable_shadows=p_enable; + VS::get_singleton()->reflection_probe_set_enable_shadows(probe,p_enable); +} +bool ReflectionProbe::are_shadows_enabled() const { + + return enable_shadows; +} + +void ReflectionProbe::set_cull_mask(uint32_t p_layers) { + + cull_mask=p_layers; + VS::get_singleton()->reflection_probe_set_enable_shadows(probe,p_layers); +} +uint32_t ReflectionProbe::get_cull_mask() const { + + return cull_mask; +} + +void ReflectionProbe::set_update_mode(UpdateMode p_mode) { + update_mode=p_mode; + VS::get_singleton()->reflection_probe_set_update_mode(probe,VS::ReflectionProbeUpdateMode(p_mode)); +} + +ReflectionProbe::UpdateMode ReflectionProbe::get_update_mode() const { + return update_mode; +} + + +Rect3 ReflectionProbe::get_aabb() const { + + Rect3 aabb; + aabb.pos=-origin_offset; + aabb.size=origin_offset+extents; + return aabb; +} +PoolVector<Face3> ReflectionProbe::get_faces(uint32_t p_usage_flags) const { + + return PoolVector<Face3>(); +} + +void ReflectionProbe::_validate_property(PropertyInfo& property) const { + + if (property.name=="interior/ambient_color" || property.name=="interior/ambient_energy" || property.name=="interior/ambient_contrib") { + if (!interior) { + property.usage=PROPERTY_USAGE_NOEDITOR; + } + } +} + +void ReflectionProbe::_bind_methods() { + + ClassDB::bind_method(_MD("set_intensity","intensity"),&ReflectionProbe::set_intensity); + ClassDB::bind_method(_MD("get_intensity"),&ReflectionProbe::get_intensity); + + ClassDB::bind_method(_MD("set_interior_ambient","ambient"),&ReflectionProbe::set_interior_ambient); + ClassDB::bind_method(_MD("get_interior_ambient"),&ReflectionProbe::get_interior_ambient); + + ClassDB::bind_method(_MD("set_interior_ambient_energy","ambient_energy"),&ReflectionProbe::set_interior_ambient_energy); + ClassDB::bind_method(_MD("get_interior_ambient_energy"),&ReflectionProbe::get_interior_ambient_energy); + + ClassDB::bind_method(_MD("set_interior_ambient_probe_contribution","ambient_probe_contribution"),&ReflectionProbe::set_interior_ambient_probe_contribution); + ClassDB::bind_method(_MD("get_interior_ambient_probe_contribution"),&ReflectionProbe::get_interior_ambient_probe_contribution); + + ClassDB::bind_method(_MD("set_max_distance","max_distance"),&ReflectionProbe::set_max_distance); + ClassDB::bind_method(_MD("get_max_distance"),&ReflectionProbe::get_max_distance); + + ClassDB::bind_method(_MD("set_extents","extents"),&ReflectionProbe::set_extents); + ClassDB::bind_method(_MD("get_extents"),&ReflectionProbe::get_extents); + + ClassDB::bind_method(_MD("set_origin_offset","origin_offset"),&ReflectionProbe::set_origin_offset); + ClassDB::bind_method(_MD("get_origin_offset"),&ReflectionProbe::get_origin_offset); + + ClassDB::bind_method(_MD("set_as_interior","enable"),&ReflectionProbe::set_as_interior); + ClassDB::bind_method(_MD("is_set_as_interior"),&ReflectionProbe::is_set_as_interior); + + ClassDB::bind_method(_MD("set_enable_box_projection","enable"),&ReflectionProbe::set_enable_box_projection); + ClassDB::bind_method(_MD("is_box_projection_enabled"),&ReflectionProbe::is_box_projection_enabled); + + + ClassDB::bind_method(_MD("set_enable_shadows","enable"),&ReflectionProbe::set_enable_shadows); + ClassDB::bind_method(_MD("are_shadows_enabled"),&ReflectionProbe::are_shadows_enabled); + + ClassDB::bind_method(_MD("set_cull_mask","layers"),&ReflectionProbe::set_cull_mask); + ClassDB::bind_method(_MD("get_cull_mask"),&ReflectionProbe::get_cull_mask); + + ClassDB::bind_method(_MD("set_update_mode","mode"),&ReflectionProbe::set_update_mode); + ClassDB::bind_method(_MD("get_update_mode"),&ReflectionProbe::get_update_mode); + + ADD_PROPERTY( PropertyInfo(Variant::INT,"update_mode",PROPERTY_HINT_ENUM,"Once,Always"),_SCS("set_update_mode"),_SCS("get_update_mode")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"intensity",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_intensity"),_SCS("get_intensity")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"max_distance",PROPERTY_HINT_RANGE,"0,16384,0.1"),_SCS("set_max_distance"),_SCS("get_max_distance")); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"extents"),_SCS("set_extents"),_SCS("get_extents")); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"origin_offset"),_SCS("set_origin_offset"),_SCS("get_origin_offset")); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"box_projection"),_SCS("set_enable_box_projection"),_SCS("is_box_projection_enabled")); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"enable_shadows"),_SCS("set_enable_shadows"),_SCS("are_shadows_enabled")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"cull_mask",PROPERTY_HINT_LAYERS_3D_RENDER),_SCS("set_cull_mask"),_SCS("get_cull_mask")); + + ADD_GROUP("Interior","interior_"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"interior_enable"),_SCS("set_as_interior"),_SCS("is_set_as_interior")); + ADD_PROPERTY( PropertyInfo(Variant::COLOR,"interior_ambient_color",PROPERTY_HINT_COLOR_NO_ALPHA),_SCS("set_interior_ambient"),_SCS("get_interior_ambient")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"interior_ambient_energy",PROPERTY_HINT_RANGE,"0,16,0.01"),_SCS("set_interior_ambient_energy"),_SCS("get_interior_ambient_energy")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"interior_ambient_contrib",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_interior_ambient_probe_contribution"),_SCS("get_interior_ambient_probe_contribution")); + + + BIND_CONSTANT( UPDATE_ONCE ); + BIND_CONSTANT( UPDATE_ALWAYS ); + +} + +ReflectionProbe::ReflectionProbe() { + + intensity=1.0; + interior_ambient=Color(0,0,0); + interior_ambient_probe_contribution=0; + interior_ambient_energy=1.0; + max_distance=0; + extents=Vector3(1,1,1); + origin_offset=Vector3(0,0,0); + box_projection=false; + interior=false; + enable_shadows=false; + cull_mask=(1<<20)-1; + update_mode=UPDATE_ONCE; + + probe=VisualServer::get_singleton()->reflection_probe_create(); + VS::get_singleton()->instance_set_base(get_instance(),probe); +} + +ReflectionProbe::~ReflectionProbe() { + + VS::get_singleton()->free(probe); +} diff --git a/scene/3d/reflection_probe.h b/scene/3d/reflection_probe.h new file mode 100644 index 0000000000..410f590431 --- /dev/null +++ b/scene/3d/reflection_probe.h @@ -0,0 +1,92 @@ +#ifndef REFLECTIONPROBE_H +#define REFLECTIONPROBE_H + +#include "scene/3d/visual_instance.h" +#include "scene/resources/texture.h" +#include "scene/resources/sky_box.h" +#include "servers/visual_server.h" + +class ReflectionProbe : public VisualInstance { + GDCLASS(ReflectionProbe,VisualInstance); + +public: + + enum UpdateMode { + UPDATE_ONCE, + UPDATE_ALWAYS, + }; + + +private: + + RID probe; + float intensity; + float max_distance; + Vector3 extents; + Vector3 origin_offset; + bool box_projection; + bool enable_shadows; + bool interior; + Color interior_ambient; + float interior_ambient_energy; + float interior_ambient_probe_contribution; + + uint32_t cull_mask; + UpdateMode update_mode; + +protected: + + static void _bind_methods(); + void _validate_property(PropertyInfo& property) const; + +public: + + void set_intensity(float p_intensity); + float get_intensity() const; + + void set_interior_ambient(Color p_ambient); + Color get_interior_ambient() const; + + void set_interior_ambient_energy(float p_energy); + float get_interior_ambient_energy() const; + + void set_interior_ambient_probe_contribution(float p_contribution); + float get_interior_ambient_probe_contribution() const; + + void set_max_distance(float p_distance); + float get_max_distance() const; + + void set_extents(const Vector3& p_extents); + Vector3 get_extents() const; + + void set_origin_offset(const Vector3& p_extents); + Vector3 get_origin_offset() const; + + void set_as_interior(bool p_enable); + bool is_set_as_interior() const; + + void set_enable_box_projection(bool p_enable); + bool is_box_projection_enabled() const; + + void set_enable_shadows(bool p_enable); + bool are_shadows_enabled() const; + + void set_cull_mask(uint32_t p_layers); + uint32_t get_cull_mask() const; + + void set_update_mode(UpdateMode p_mode); + UpdateMode get_update_mode() const; + + virtual Rect3 get_aabb() const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; + + + + ReflectionProbe(); + ~ReflectionProbe(); +}; + + +VARIANT_ENUM_CAST( ReflectionProbe::UpdateMode ); + +#endif // REFLECTIONPROBE_H diff --git a/scene/3d/remote_transform.cpp b/scene/3d/remote_transform.cpp index d43870417a..931f075a84 100644 --- a/scene/3d/remote_transform.cpp +++ b/scene/3d/remote_transform.cpp @@ -6,7 +6,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -118,8 +118,8 @@ String RemoteTransform::get_configuration_warning() const { void RemoteTransform::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_remote_node","path"),&RemoteTransform::set_remote_node); - ObjectTypeDB::bind_method(_MD("get_remote_node"),&RemoteTransform::get_remote_node); + ClassDB::bind_method(_MD("set_remote_node","path"),&RemoteTransform::set_remote_node); + ClassDB::bind_method(_MD("get_remote_node"),&RemoteTransform::get_remote_node); ADD_PROPERTY( PropertyInfo(Variant::NODE_PATH,"remote_path"),_SCS("set_remote_node"),_SCS("get_remote_node")); } diff --git a/scene/3d/remote_transform.h b/scene/3d/remote_transform.h index 78f0fec1e9..e7aa95ad6e 100644 --- a/scene/3d/remote_transform.h +++ b/scene/3d/remote_transform.h @@ -5,7 +5,7 @@ class RemoteTransform : public Spatial { - OBJ_TYPE(RemoteTransform,Spatial); + GDCLASS(RemoteTransform,Spatial); NodePath remote_node; diff --git a/scene/3d/room_instance.cpp b/scene/3d/room_instance.cpp index 9e6867d2a2..0b19aaf151 100644 --- a/scene/3d/room_instance.cpp +++ b/scene/3d/room_instance.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -75,63 +75,20 @@ void Room::_notification(int p_what) { } -RES Room::_get_gizmo_geometry() const { - DVector<Face3> faces; - if (!room.is_null()) - faces=room->get_geometry_hint(); - int count=faces.size(); - if (count==0) - return RES(); - DVector<Face3>::Read facesr=faces.read(); - - const Face3* facesptr=facesr.ptr(); - - DVector<Vector3> points; - - Ref<SurfaceTool> surface_tool( memnew( SurfaceTool )); - - Ref<FixedMaterial> mat( memnew( FixedMaterial )); - - mat->set_parameter( FixedMaterial::PARAM_DIFFUSE,Color(0.2,0.8,0.9,0.3) ); - mat->set_line_width(4); - mat->set_flag(Material::FLAG_DOUBLE_SIDED,true); - mat->set_flag(Material::FLAG_UNSHADED,true); -// mat->set_hint(Material::HINT_NO_DEPTH_DRAW,true); - - surface_tool->begin(Mesh::PRIMITIVE_LINES); - surface_tool->set_material(mat); - - for (int i=0;i<count;i++) { - - surface_tool->add_vertex(facesptr[i].vertex[0]); - surface_tool->add_vertex(facesptr[i].vertex[1]); - - surface_tool->add_vertex(facesptr[i].vertex[1]); - surface_tool->add_vertex(facesptr[i].vertex[2]); - - surface_tool->add_vertex(facesptr[i].vertex[2]); - surface_tool->add_vertex(facesptr[i].vertex[0]); - - } - - return surface_tool->commit(); -} - - - -AABB Room::get_aabb() const { +Rect3 Room::get_aabb() const { if (room.is_null()) - return AABB(); + return Rect3(); - return room->get_bounds().get_aabb(); + return Rect3(); } -DVector<Face3> Room::get_faces(uint32_t p_usage_flags) const { - return DVector<Face3>(); +PoolVector<Face3> Room::get_faces(uint32_t p_usage_flags) const { + + return PoolVector<Face3>(); } @@ -154,9 +111,6 @@ void Room::set_room( const Ref<RoomBounds>& p_room ) { propagate_notification(NOTIFICATION_AREA_CHANGED); update_gizmo(); - if (room.is_valid()) - SpatialSoundServer::get_singleton()->room_set_bounds(sound_room,room->get_bounds()); - } @@ -165,21 +119,21 @@ Ref<RoomBounds> Room::get_room() const { return room; } -void Room::_parse_node_faces(DVector<Face3> &all_faces,const Node *p_node) const { +void Room::_parse_node_faces(PoolVector<Face3> &all_faces,const Node *p_node) const { const VisualInstance *vi=p_node->cast_to<VisualInstance>(); if (vi) { - DVector<Face3> faces=vi->get_faces(FACES_ENCLOSING); + PoolVector<Face3> faces=vi->get_faces(FACES_ENCLOSING); if (faces.size()) { int old_len=all_faces.size(); all_faces.resize( all_faces.size() + faces.size() ); int new_len=all_faces.size(); - DVector<Face3>::Write all_facesw=all_faces.write(); + PoolVector<Face3>::Write all_facesw=all_faces.write(); Face3 * all_facesptr=all_facesw.ptr(); - DVector<Face3>::Read facesr=faces.read(); + PoolVector<Face3>::Read facesr=faces.read(); const Face3 * facesptr=facesr.ptr(); Transform tr=vi->get_relative_transform(this); @@ -202,32 +156,6 @@ void Room::_parse_node_faces(DVector<Face3> &all_faces,const Node *p_node) const } -void Room::compute_room_from_subtree() { - - - DVector<Face3> all_faces; - _parse_node_faces(all_faces,this); - - - if (all_faces.size()==0) - return; - float error; - DVector<Face3> wrapped_faces = Geometry::wrap_geometry(all_faces,&error); - - - if (wrapped_faces.size()==0) - return; - - BSP_Tree tree(wrapped_faces,error); - - Ref<RoomBounds> room( memnew( RoomBounds ) ); - room->set_bounds(tree); - room->set_geometry_hint(wrapped_faces); - - set_room(room); - -} - void Room::set_simulate_acoustics(bool p_enable) { @@ -266,14 +194,13 @@ RID Room::get_sound_room() const { void Room::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_room","room:Room"),&Room::set_room ); - ObjectTypeDB::bind_method(_MD("get_room:Room"),&Room::get_room ); - ObjectTypeDB::bind_method(_MD("compute_room_from_subtree"),&Room::compute_room_from_subtree); + ClassDB::bind_method(_MD("set_room","room:Room"),&Room::set_room ); + ClassDB::bind_method(_MD("get_room:Room"),&Room::get_room ); - ObjectTypeDB::bind_method(_MD("set_simulate_acoustics","enable"),&Room::set_simulate_acoustics ); - ObjectTypeDB::bind_method(_MD("is_simulating_acoustics"),&Room::is_simulating_acoustics ); + ClassDB::bind_method(_MD("set_simulate_acoustics","enable"),&Room::set_simulate_acoustics ); + ClassDB::bind_method(_MD("is_simulating_acoustics"),&Room::is_simulating_acoustics ); diff --git a/scene/3d/room_instance.h b/scene/3d/room_instance.h index c7df4ceadd..145589a780 100644 --- a/scene/3d/room_instance.h +++ b/scene/3d/room_instance.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -45,9 +45,11 @@ */ + + class Room : public VisualInstance { - OBJ_TYPE( Room, VisualInstance ); + GDCLASS( Room, VisualInstance ); public: @@ -61,11 +63,11 @@ private: bool sound_enabled; int level; - void _parse_node_faces(DVector<Face3> &all_faces,const Node *p_node) const; + void _parse_node_faces(PoolVector<Face3> &all_faces,const Node *p_node) const; void _bounds_changed(); - virtual RES _get_gizmo_geometry() const; + protected: @@ -80,8 +82,8 @@ public: NOTIFICATION_AREA_CHANGED=60 }; - virtual AABB get_aabb() const; - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual Rect3 get_aabb() const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; void set_room( const Ref<RoomBounds>& p_room ); Ref<RoomBounds> get_room() const; @@ -89,7 +91,6 @@ public: void set_simulate_acoustics(bool p_enable); bool is_simulating_acoustics() const; - void compute_room_from_subtree(); RID get_sound_room() const; diff --git a/scene/3d/scenario_fx.cpp b/scene/3d/scenario_fx.cpp index f01c2263fb..95ba2c990a 100644 --- a/scene/3d/scenario_fx.cpp +++ b/scene/3d/scenario_fx.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -99,8 +99,8 @@ String WorldEnvironment::get_configuration_warning() const { void WorldEnvironment::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_environment","env:Environment"),&WorldEnvironment::set_environment); - ObjectTypeDB::bind_method(_MD("get_environment:Environment"),&WorldEnvironment::get_environment); + ClassDB::bind_method(_MD("set_environment","env:Environment"),&WorldEnvironment::set_environment); + ClassDB::bind_method(_MD("get_environment:Environment"),&WorldEnvironment::get_environment); ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"environment",PROPERTY_HINT_RESOURCE_TYPE,"Environment"),_SCS("set_environment"),_SCS("get_environment")); } diff --git a/scene/3d/scenario_fx.h b/scene/3d/scenario_fx.h index a73c455918..ef5b70039c 100644 --- a/scene/3d/scenario_fx.h +++ b/scene/3d/scenario_fx.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,7 +39,7 @@ class WorldEnvironment : public Spatial { - OBJ_TYPE(WorldEnvironment,Spatial ); + GDCLASS(WorldEnvironment,Spatial ); Ref<Environment> environment; diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp index c996a8123c..5e576b4960 100644 --- a/scene/3d/skeleton.cpp +++ b/scene/3d/skeleton.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -163,7 +163,7 @@ void Skeleton::_notification(int p_what) { Bone *bonesptr=&bones[0]; int len=bones.size(); - vs->skeleton_resize( skeleton, len ); // if same size, nothin really happens + vs->skeleton_allocate( skeleton, len ); // if same size, nothin really happens // pose changed, rebuild cache of inverses if (rest_global_inverse_dirty) { @@ -513,51 +513,6 @@ void Skeleton::_make_dirty() { } -RES Skeleton::_get_gizmo_geometry() const { - - if (!GLOBAL_DEF("debug/draw_skeleton", true)) - return RES(); - - if (bones.size()==0) - return RES(); - - Ref<SurfaceTool> surface_tool( memnew( SurfaceTool )); - - Ref<FixedMaterial> mat( memnew( FixedMaterial )); - - mat->set_parameter( FixedMaterial::PARAM_DIFFUSE,Color(0.6,1.0,0.3,0.1) ); - mat->set_line_width(4); - mat->set_flag(Material::FLAG_DOUBLE_SIDED,true); - mat->set_flag(Material::FLAG_UNSHADED,true); - mat->set_flag(Material::FLAG_ONTOP,true); -// mat->set_hint(Material::HINT_NO_DEPTH_DRAW,true); - - surface_tool->begin(Mesh::PRIMITIVE_LINES); - surface_tool->set_material(mat); - - - const Bone *bonesptr=&bones[0]; - int len=bones.size(); - - for (int i=0;i<len;i++) { - - const Bone &b=bonesptr[i]; - - Transform t; - if (b.parent<0) - continue; - - Vector3 v1=(bonesptr[b.parent].pose_global * bonesptr[b.parent].rest_global_inverse).xform(bonesptr[b.parent].rest_global_inverse.affine_inverse().origin); - Vector3 v2=(b.pose_global * b.rest_global_inverse).xform(b.rest_global_inverse.affine_inverse().origin); - - surface_tool->add_vertex(v1); - surface_tool->add_vertex(v2); - - } - - return surface_tool->commit(); - -} void Skeleton::localize_rests() { @@ -575,39 +530,39 @@ void Skeleton::_bind_methods() { - ObjectTypeDB::bind_method(_MD("add_bone","name"),&Skeleton::add_bone); - ObjectTypeDB::bind_method(_MD("find_bone","name"),&Skeleton::find_bone); - ObjectTypeDB::bind_method(_MD("get_bone_name","bone_idx"),&Skeleton::get_bone_name); + ClassDB::bind_method(_MD("add_bone","name"),&Skeleton::add_bone); + ClassDB::bind_method(_MD("find_bone","name"),&Skeleton::find_bone); + ClassDB::bind_method(_MD("get_bone_name","bone_idx"),&Skeleton::get_bone_name); - ObjectTypeDB::bind_method(_MD("get_bone_parent","bone_idx"),&Skeleton::get_bone_parent); - ObjectTypeDB::bind_method(_MD("set_bone_parent","bone_idx","parent_idx"),&Skeleton::set_bone_parent); + ClassDB::bind_method(_MD("get_bone_parent","bone_idx"),&Skeleton::get_bone_parent); + ClassDB::bind_method(_MD("set_bone_parent","bone_idx","parent_idx"),&Skeleton::set_bone_parent); - ObjectTypeDB::bind_method(_MD("get_bone_count"),&Skeleton::get_bone_count); + ClassDB::bind_method(_MD("get_bone_count"),&Skeleton::get_bone_count); - ObjectTypeDB::bind_method(_MD("unparent_bone_and_rest","bone_idx"),&Skeleton::unparent_bone_and_rest); + ClassDB::bind_method(_MD("unparent_bone_and_rest","bone_idx"),&Skeleton::unparent_bone_and_rest); - ObjectTypeDB::bind_method(_MD("get_bone_rest","bone_idx"),&Skeleton::get_bone_rest); - ObjectTypeDB::bind_method(_MD("set_bone_rest","bone_idx","rest"),&Skeleton::set_bone_rest); + ClassDB::bind_method(_MD("get_bone_rest","bone_idx"),&Skeleton::get_bone_rest); + ClassDB::bind_method(_MD("set_bone_rest","bone_idx","rest"),&Skeleton::set_bone_rest); - ObjectTypeDB::bind_method(_MD("set_bone_disable_rest","bone_idx","disable"),&Skeleton::set_bone_disable_rest); - ObjectTypeDB::bind_method(_MD("is_bone_rest_disabled","bone_idx"),&Skeleton::is_bone_rest_disabled); + ClassDB::bind_method(_MD("set_bone_disable_rest","bone_idx","disable"),&Skeleton::set_bone_disable_rest); + ClassDB::bind_method(_MD("is_bone_rest_disabled","bone_idx"),&Skeleton::is_bone_rest_disabled); - ObjectTypeDB::bind_method(_MD("bind_child_node_to_bone","bone_idx","node:Node"),&Skeleton::bind_child_node_to_bone); - ObjectTypeDB::bind_method(_MD("unbind_child_node_from_bone","bone_idx","node:Node"),&Skeleton::unbind_child_node_from_bone); - ObjectTypeDB::bind_method(_MD("get_bound_child_nodes_to_bone","bone_idx"),&Skeleton::_get_bound_child_nodes_to_bone); + ClassDB::bind_method(_MD("bind_child_node_to_bone","bone_idx","node:Node"),&Skeleton::bind_child_node_to_bone); + ClassDB::bind_method(_MD("unbind_child_node_from_bone","bone_idx","node:Node"),&Skeleton::unbind_child_node_from_bone); + ClassDB::bind_method(_MD("get_bound_child_nodes_to_bone","bone_idx"),&Skeleton::_get_bound_child_nodes_to_bone); - ObjectTypeDB::bind_method(_MD("clear_bones"),&Skeleton::clear_bones); + ClassDB::bind_method(_MD("clear_bones"),&Skeleton::clear_bones); - ObjectTypeDB::bind_method(_MD("get_bone_pose","bone_idx"),&Skeleton::get_bone_pose); - ObjectTypeDB::bind_method(_MD("set_bone_pose","bone_idx","pose"),&Skeleton::set_bone_pose); + ClassDB::bind_method(_MD("get_bone_pose","bone_idx"),&Skeleton::get_bone_pose); + ClassDB::bind_method(_MD("set_bone_pose","bone_idx","pose"),&Skeleton::set_bone_pose); - ObjectTypeDB::bind_method(_MD("set_bone_global_pose","bone_idx","pose"),&Skeleton::set_bone_global_pose); - ObjectTypeDB::bind_method(_MD("get_bone_global_pose","bone_idx"),&Skeleton::get_bone_global_pose); + ClassDB::bind_method(_MD("set_bone_global_pose","bone_idx","pose"),&Skeleton::set_bone_global_pose); + ClassDB::bind_method(_MD("get_bone_global_pose","bone_idx"),&Skeleton::get_bone_global_pose); - ObjectTypeDB::bind_method(_MD("get_bone_custom_pose","bone_idx"),&Skeleton::get_bone_custom_pose); - ObjectTypeDB::bind_method(_MD("set_bone_custom_pose","bone_idx","custom_pose"),&Skeleton::set_bone_custom_pose); + ClassDB::bind_method(_MD("get_bone_custom_pose","bone_idx"),&Skeleton::get_bone_custom_pose); + ClassDB::bind_method(_MD("set_bone_custom_pose","bone_idx","custom_pose"),&Skeleton::set_bone_custom_pose); - ObjectTypeDB::bind_method(_MD("get_bone_transform","bone_idx"),&Skeleton::get_bone_transform); + ClassDB::bind_method(_MD("get_bone_transform","bone_idx"),&Skeleton::get_bone_transform); BIND_CONSTANT( NOTIFICATION_UPDATE_SKELETON ); } diff --git a/scene/3d/skeleton.h b/scene/3d/skeleton.h index bfdb1d1499..04eb3e9009 100644 --- a/scene/3d/skeleton.h +++ b/scene/3d/skeleton.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ */ class Skeleton : public Spatial { - OBJ_TYPE( Skeleton, Spatial ); + GDCLASS( Skeleton, Spatial ); struct Bone { @@ -84,7 +84,6 @@ class Skeleton : public Spatial { return bound; } - virtual RES _get_gizmo_geometry() const; protected: diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp index 920e56130c..60580911da 100644 --- a/scene/3d/spatial.cpp +++ b/scene/3d/spatial.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -83,9 +83,9 @@ void Spatial::_notify_dirty() { void Spatial::_update_local_transform() const { - - data.local_transform.basis.set_euler(data.rotation); + data.local_transform.basis = Basis(); data.local_transform.basis.scale(data.scale); + data.local_transform.basis.rotate(data.rotation); data.dirty&=~DIRTY_LOCAL; } @@ -362,7 +362,7 @@ void Spatial::set_rotation(const Vector3& p_euler_rad){ } -void Spatial::set_rotation_deg(const Vector3& p_euler_deg) { +void Spatial::set_rotation_in_degrees(const Vector3& p_euler_deg) { set_rotation(p_euler_deg * Math_PI / 180.0); } @@ -370,13 +370,13 @@ void Spatial::set_rotation_deg(const Vector3& p_euler_deg) { void Spatial::_set_rotation_deg(const Vector3& p_euler_deg) { WARN_PRINT("Deprecated method Spatial._set_rotation_deg(): This method was renamed to set_rotation_deg. Please adapt your code accordingly, as the old method will be obsoleted."); - set_rotation_deg(p_euler_deg); + set_rotation_in_degrees(p_euler_deg); } void Spatial::set_scale(const Vector3& p_scale){ if (data.dirty&DIRTY_VECTORS) { - data.rotation=data.local_transform.basis.get_euler(); + data.rotation=data.local_transform.basis.get_rotation(); data.dirty&=~DIRTY_VECTORS; } @@ -398,14 +398,15 @@ Vector3 Spatial::get_rotation() const{ if (data.dirty&DIRTY_VECTORS) { data.scale=data.local_transform.basis.get_scale(); - data.rotation=data.local_transform.basis.get_euler(); + data.rotation=data.local_transform.basis.get_rotation(); + data.dirty&=~DIRTY_VECTORS; } return data.rotation; } -Vector3 Spatial::get_rotation_deg() const { +Vector3 Spatial::get_rotation_in_degrees() const { return get_rotation() * 180.0 / Math_PI; } @@ -415,14 +416,15 @@ Vector3 Spatial::get_rotation_deg() const { Vector3 Spatial::_get_rotation_deg() const { WARN_PRINT("Deprecated method Spatial._get_rotation_deg(): This method was renamed to get_rotation_deg. Please adapt your code accordingly, as the old method will be obsoleted."); - return get_rotation_deg(); + return get_rotation_in_degrees(); } Vector3 Spatial::get_scale() const{ if (data.dirty&DIRTY_VECTORS) { data.scale=data.local_transform.basis.get_scale(); - data.rotation=data.local_transform.basis.get_euler(); + data.rotation=data.local_transform.basis.get_rotation(); + data.dirty&=~DIRTY_VECTORS; } @@ -680,7 +682,7 @@ void Spatial::scale(const Vector3& p_ratio){ } void Spatial::global_rotate(const Vector3& p_normal,float p_radians){ - Matrix3 rotation(p_normal,p_radians); + Basis rotation(p_normal,p_radians); Transform t = get_global_transform(); t.basis= rotation * t.basis; set_global_transform(t); @@ -744,50 +746,50 @@ bool Spatial::is_local_transform_notification_enabled() const { void Spatial::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_transform","local"), &Spatial::set_transform); - ObjectTypeDB::bind_method(_MD("get_transform"), &Spatial::get_transform); - ObjectTypeDB::bind_method(_MD("set_translation","translation"), &Spatial::set_translation); - ObjectTypeDB::bind_method(_MD("get_translation"), &Spatial::get_translation); - ObjectTypeDB::bind_method(_MD("set_rotation","rotation_rad"), &Spatial::set_rotation); - ObjectTypeDB::bind_method(_MD("get_rotation"), &Spatial::get_rotation); - ObjectTypeDB::bind_method(_MD("set_rotation_deg","rotation_deg"), &Spatial::set_rotation_deg); - ObjectTypeDB::bind_method(_MD("get_rotation_deg"), &Spatial::get_rotation_deg); - ObjectTypeDB::bind_method(_MD("set_scale","scale"), &Spatial::set_scale); - ObjectTypeDB::bind_method(_MD("get_scale"), &Spatial::get_scale); - ObjectTypeDB::bind_method(_MD("set_global_transform","global"), &Spatial::set_global_transform); - ObjectTypeDB::bind_method(_MD("get_global_transform"), &Spatial::get_global_transform); - ObjectTypeDB::bind_method(_MD("get_parent_spatial"), &Spatial::get_parent_spatial); - ObjectTypeDB::bind_method(_MD("set_ignore_transform_notification","enabled"), &Spatial::set_ignore_transform_notification); - ObjectTypeDB::bind_method(_MD("set_as_toplevel","enable"), &Spatial::set_as_toplevel); - ObjectTypeDB::bind_method(_MD("is_set_as_toplevel"), &Spatial::is_set_as_toplevel); - ObjectTypeDB::bind_method(_MD("get_world:World"), &Spatial::get_world); + ClassDB::bind_method(_MD("set_transform","local"), &Spatial::set_transform); + ClassDB::bind_method(_MD("get_transform"), &Spatial::get_transform); + ClassDB::bind_method(_MD("set_translation","translation"), &Spatial::set_translation); + ClassDB::bind_method(_MD("get_translation"), &Spatial::get_translation); + ClassDB::bind_method(_MD("set_rotation","rotation_rad"), &Spatial::set_rotation); + ClassDB::bind_method(_MD("get_rotation"), &Spatial::get_rotation); + ClassDB::bind_method(_MD("set_rotation_deg","rotation_deg"), &Spatial::set_rotation_in_degrees); + ClassDB::bind_method(_MD("get_rotation_deg"), &Spatial::get_rotation_in_degrees); + ClassDB::bind_method(_MD("set_scale","scale"), &Spatial::set_scale); + ClassDB::bind_method(_MD("get_scale"), &Spatial::get_scale); + ClassDB::bind_method(_MD("set_global_transform","global"), &Spatial::set_global_transform); + ClassDB::bind_method(_MD("get_global_transform"), &Spatial::get_global_transform); + ClassDB::bind_method(_MD("get_parent_spatial"), &Spatial::get_parent_spatial); + ClassDB::bind_method(_MD("set_ignore_transform_notification","enabled"), &Spatial::set_ignore_transform_notification); + ClassDB::bind_method(_MD("set_as_toplevel","enable"), &Spatial::set_as_toplevel); + ClassDB::bind_method(_MD("is_set_as_toplevel"), &Spatial::is_set_as_toplevel); + ClassDB::bind_method(_MD("get_world:World"), &Spatial::get_world); // TODO: Obsolete those two methods (old name) properly (GH-4397) - ObjectTypeDB::bind_method(_MD("_set_rotation_deg","rotation_deg"), &Spatial::_set_rotation_deg); - ObjectTypeDB::bind_method(_MD("_get_rotation_deg"), &Spatial::_get_rotation_deg); + ClassDB::bind_method(_MD("_set_rotation_deg","rotation_deg"), &Spatial::_set_rotation_deg); + ClassDB::bind_method(_MD("_get_rotation_deg"), &Spatial::_get_rotation_deg); #ifdef TOOLS_ENABLED - ObjectTypeDB::bind_method(_MD("_update_gizmo"), &Spatial::_update_gizmo); - ObjectTypeDB::bind_method(_MD("_set_import_transform"), &Spatial::set_import_transform); - ObjectTypeDB::bind_method(_MD("_get_import_transform"), &Spatial::get_import_transform); + ClassDB::bind_method(_MD("_update_gizmo"), &Spatial::_update_gizmo); + ClassDB::bind_method(_MD("_set_import_transform"), &Spatial::set_import_transform); + ClassDB::bind_method(_MD("_get_import_transform"), &Spatial::get_import_transform); ADD_PROPERTY( PropertyInfo(Variant::TRANSFORM,"_import_transform",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_import_transform"),_SCS("_get_import_transform")); #endif - ObjectTypeDB::bind_method(_MD("update_gizmo"), &Spatial::update_gizmo); - ObjectTypeDB::bind_method(_MD("set_gizmo","gizmo:SpatialGizmo"), &Spatial::set_gizmo); - ObjectTypeDB::bind_method(_MD("get_gizmo:SpatialGizmo"), &Spatial::get_gizmo); + ClassDB::bind_method(_MD("update_gizmo"), &Spatial::update_gizmo); + ClassDB::bind_method(_MD("set_gizmo","gizmo:SpatialGizmo"), &Spatial::set_gizmo); + ClassDB::bind_method(_MD("get_gizmo:SpatialGizmo"), &Spatial::get_gizmo); - ObjectTypeDB::bind_method(_MD("show"), &Spatial::show); - ObjectTypeDB::bind_method(_MD("hide"), &Spatial::hide); - ObjectTypeDB::bind_method(_MD("is_visible"), &Spatial::is_visible); - ObjectTypeDB::bind_method(_MD("is_hidden"), &Spatial::is_hidden); - ObjectTypeDB::bind_method(_MD("set_hidden","hidden"), &Spatial::set_hidden); + ClassDB::bind_method(_MD("show"), &Spatial::show); + ClassDB::bind_method(_MD("hide"), &Spatial::hide); + ClassDB::bind_method(_MD("is_visible"), &Spatial::is_visible); + ClassDB::bind_method(_MD("is_hidden"), &Spatial::is_hidden); + ClassDB::bind_method(_MD("set_hidden","hidden"), &Spatial::set_hidden); - ObjectTypeDB::bind_method(_MD("_set_visible_"), &Spatial::_set_visible_); - ObjectTypeDB::bind_method(_MD("_is_visible_"), &Spatial::_is_visible_); + ClassDB::bind_method(_MD("_set_visible_"), &Spatial::_set_visible_); + ClassDB::bind_method(_MD("_is_visible_"), &Spatial::_is_visible_); - ObjectTypeDB::bind_method(_MD("set_notify_local_transform","enable"), &Spatial::set_notify_local_transform); - ObjectTypeDB::bind_method(_MD("is_local_transform_notification_enabled"), &Spatial::is_local_transform_notification_enabled); + ClassDB::bind_method(_MD("set_notify_local_transform","enable"), &Spatial::set_notify_local_transform); + ClassDB::bind_method(_MD("is_local_transform_notification_enabled"), &Spatial::is_local_transform_notification_enabled); void rotate(const Vector3& p_normal,float p_radians); void rotate_x(float p_radians); @@ -798,18 +800,18 @@ void Spatial::_bind_methods() { void global_rotate(const Vector3& p_normal,float p_radians); void global_translate(const Vector3& p_offset); - ObjectTypeDB::bind_method( _MD("rotate","normal","radians"),&Spatial::rotate ); - ObjectTypeDB::bind_method( _MD("global_rotate","normal","radians"),&Spatial::global_rotate ); - ObjectTypeDB::bind_method( _MD("rotate_x","radians"),&Spatial::rotate_x ); - ObjectTypeDB::bind_method( _MD("rotate_y","radians"),&Spatial::rotate_y ); - ObjectTypeDB::bind_method( _MD("rotate_z","radians"),&Spatial::rotate_z ); - ObjectTypeDB::bind_method( _MD("translate","offset"),&Spatial::translate ); - ObjectTypeDB::bind_method( _MD("global_translate","offset"),&Spatial::global_translate ); - ObjectTypeDB::bind_method( _MD("orthonormalize"),&Spatial::orthonormalize ); - ObjectTypeDB::bind_method( _MD("set_identity"),&Spatial::set_identity ); + ClassDB::bind_method( _MD("rotate","normal","radians"),&Spatial::rotate ); + ClassDB::bind_method( _MD("global_rotate","normal","radians"),&Spatial::global_rotate ); + ClassDB::bind_method( _MD("rotate_x","radians"),&Spatial::rotate_x ); + ClassDB::bind_method( _MD("rotate_y","radians"),&Spatial::rotate_y ); + ClassDB::bind_method( _MD("rotate_z","radians"),&Spatial::rotate_z ); + ClassDB::bind_method( _MD("translate","offset"),&Spatial::translate ); + ClassDB::bind_method( _MD("global_translate","offset"),&Spatial::global_translate ); + ClassDB::bind_method( _MD("orthonormalize"),&Spatial::orthonormalize ); + ClassDB::bind_method( _MD("set_identity"),&Spatial::set_identity ); - ObjectTypeDB::bind_method( _MD("look_at","target","up"),&Spatial::look_at ); - ObjectTypeDB::bind_method( _MD("look_at_from_pos","pos","target","up"),&Spatial::look_at_from_pos ); + ClassDB::bind_method( _MD("look_at","target","up"),&Spatial::look_at ); + ClassDB::bind_method( _MD("look_at_from_pos","pos","target","up"),&Spatial::look_at_from_pos ); BIND_CONSTANT( NOTIFICATION_TRANSFORM_CHANGED ); BIND_CONSTANT( NOTIFICATION_ENTER_WORLD ); @@ -817,12 +819,15 @@ void Spatial::_bind_methods() { BIND_CONSTANT( NOTIFICATION_VISIBILITY_CHANGED ); //ADD_PROPERTY( PropertyInfo(Variant::TRANSFORM,"transform/global",PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR ), _SCS("set_global_transform"), _SCS("get_global_transform") ); - ADD_PROPERTYNZ( PropertyInfo(Variant::TRANSFORM,"transform/local",PROPERTY_HINT_NONE,""), _SCS("set_transform"), _SCS("get_transform") ); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"transform/translation",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_EDITOR), _SCS("set_translation"), _SCS("get_translation") ); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"transform/rotation",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_EDITOR), _SCS("set_rotation_deg"), _SCS("get_rotation_deg") ); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"transform/rotation_rad",PROPERTY_HINT_NONE,"",0), _SCS("set_rotation"), _SCS("get_rotation") ); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"transform/scale",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_EDITOR), _SCS("set_scale"), _SCS("get_scale") ); - ADD_PROPERTYNO( PropertyInfo(Variant::BOOL,"visibility/visible"), _SCS("_set_visible_"), _SCS("_is_visible_") ); + ADD_GROUP("Transform",""); + ADD_PROPERTYNZ( PropertyInfo(Variant::TRANSFORM,"transform",PROPERTY_HINT_NONE,""), _SCS("set_transform"), _SCS("get_transform") ); + ADD_PROPERTYNZ( PropertyInfo(Variant::TRANSFORM,"global_transform",PROPERTY_HINT_NONE,"",0), _SCS("set_global_transform"), _SCS("get_global_transform") ); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"translation",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_EDITOR), _SCS("set_translation"), _SCS("get_translation") ); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"rotation_deg",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_EDITOR), _SCS("set_rotation_deg"), _SCS("get_rotation_deg") ); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"rotation",PROPERTY_HINT_NONE,"",0), _SCS("set_rotation"), _SCS("get_rotation") ); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"scale",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_EDITOR), _SCS("set_scale"), _SCS("get_scale") ); + ADD_GROUP("Visibility",""); + ADD_PROPERTYNO( PropertyInfo(Variant::BOOL,"visible"), _SCS("_set_visible_"), _SCS("_is_visible_") ); //ADD_PROPERTY( PropertyInfo(Variant::TRANSFORM,"transform/local"), _SCS("set_transform"), _SCS("get_transform") ); ADD_SIGNAL( MethodInfo("visibility_changed" ) ); diff --git a/scene/3d/spatial.h b/scene/3d/spatial.h index fdc9f95f0b..8121eaa8c2 100644 --- a/scene/3d/spatial.h +++ b/scene/3d/spatial.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -38,7 +38,7 @@ class SpatialGizmo : public Reference { - OBJ_TYPE(SpatialGizmo,Reference); + GDCLASS(SpatialGizmo,Reference); public: @@ -55,7 +55,7 @@ public: class Spatial : public Node { - OBJ_TYPE( Spatial, Node ); + GDCLASS( Spatial, Node ); OBJ_CATEGORY("3D"); enum TransformDirty { @@ -146,12 +146,12 @@ public: void set_translation(const Vector3& p_translation); void set_rotation(const Vector3& p_euler_rad); - void set_rotation_deg(const Vector3& p_euler_deg); + void set_rotation_in_degrees(const Vector3& p_euler_deg); void set_scale(const Vector3& p_scale); Vector3 get_translation() const; Vector3 get_rotation() const; - Vector3 get_rotation_deg() const; + Vector3 get_rotation_in_degrees() const; Vector3 get_scale() const; void set_transform(const Transform& p_transform); diff --git a/scene/3d/spatial_indexer.cpp b/scene/3d/spatial_indexer.cpp index d5be36b2cb..0cc6d1abd0 100644 --- a/scene/3d/spatial_indexer.cpp +++ b/scene/3d/spatial_indexer.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -112,7 +112,7 @@ void SpatialIndexer::_update_pairs() { void SpatialIndexer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_update_pairs"),&SpatialIndexer::_update_pairs); + ClassDB::bind_method(_MD("_update_pairs"),&SpatialIndexer::_update_pairs); } diff --git a/scene/3d/spatial_indexer.h b/scene/3d/spatial_indexer.h index 13ce8badea..94c579ba23 100644 --- a/scene/3d/spatial_indexer.h +++ b/scene/3d/spatial_indexer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ class ProximityArea; class SpatialIndexer : public Object { - OBJ_TYPE( SpatialIndexer, Object ); + GDCLASS( SpatialIndexer, Object ); template<class T> struct TK { diff --git a/scene/3d/spatial_player.cpp b/scene/3d/spatial_player.cpp index c7cf03e284..0a8b9053c1 100644 --- a/scene/3d/spatial_player.cpp +++ b/scene/3d/spatial_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -88,151 +88,11 @@ bool SpatialPlayer::_can_gizmo_scale() const { return false; } -RES SpatialPlayer::_get_gizmo_geometry() const { - - Ref<SurfaceTool> surface_tool( memnew( SurfaceTool )); - - Ref<FixedMaterial> mat( memnew( FixedMaterial )); - - mat->set_parameter( FixedMaterial::PARAM_DIFFUSE,Color(0.0,0.6,0.7,0.05) ); - mat->set_parameter( FixedMaterial::PARAM_EMISSION,Color(0.5,0.7,0.8) ); - mat->set_blend_mode( Material::BLEND_MODE_ADD ); - mat->set_flag(Material::FLAG_DOUBLE_SIDED,true); -// mat->set_hint(Material::HINT_NO_DEPTH_DRAW,true); - - - surface_tool->begin(Mesh::PRIMITIVE_TRIANGLES); - surface_tool->set_material(mat); - - int sides=16; - int sections=24; - -// float len=1; - float deg=Math::deg2rad(params[PARAM_EMISSION_CONE_DEGREES]); - if (deg==180) - deg=179.5; - - Vector3 to=Vector3(0,0,-1); - - for(int j=0;j<sections;j++) { - - Vector3 p1=Matrix3(Vector3(1,0,0),deg*j/sections).xform(to); - Vector3 p2=Matrix3(Vector3(1,0,0),deg*(j+1)/sections).xform(to); - - for(int i=0;i<sides;i++) { - - Vector3 p1r = Matrix3(Vector3(0,0,1),Math_PI*2*float(i)/sides).xform(p1); - Vector3 p1s = Matrix3(Vector3(0,0,1),Math_PI*2*float(i+1)/sides).xform(p1); - Vector3 p2s = Matrix3(Vector3(0,0,1),Math_PI*2*float(i+1)/sides).xform(p2); - Vector3 p2r = Matrix3(Vector3(0,0,1),Math_PI*2*float(i)/sides).xform(p2); - - surface_tool->add_normal(p1r.normalized()); - surface_tool->add_vertex(p1r); - surface_tool->add_normal(p1s.normalized()); - surface_tool->add_vertex(p1s); - surface_tool->add_normal(p2s.normalized()); - surface_tool->add_vertex(p2s); - - surface_tool->add_normal(p1r.normalized()); - surface_tool->add_vertex(p1r); - surface_tool->add_normal(p2s.normalized()); - surface_tool->add_vertex(p2s); - surface_tool->add_normal(p2r.normalized()); - surface_tool->add_vertex(p2r); - - if (j==sections-1) { - - surface_tool->add_normal(p2r.normalized()); - surface_tool->add_vertex(p2r); - surface_tool->add_normal(p2s.normalized()); - surface_tool->add_vertex(p2s); - surface_tool->add_normal(Vector3(0,0,1)); - surface_tool->add_vertex(Vector3()); - } - } - } - - - Ref<Mesh> mesh = surface_tool->commit(); - - Ref<FixedMaterial> mat_speaker( memnew( FixedMaterial )); - - mat_speaker->set_parameter( FixedMaterial::PARAM_DIFFUSE,Color(0.3,0.3,0.6) ); - mat_speaker->set_parameter( FixedMaterial::PARAM_SPECULAR,Color(0.5,0.5,0.6) ); - //mat_speaker->set_blend_mode( Material::BLEND_MODE_MIX); - //mat_speaker->set_flag(Material::FLAG_DOUBLE_SIDED,false); - //mat_speaker->set_flag(Material::FLAG_UNSHADED,true); - - surface_tool->begin(Mesh::PRIMITIVE_TRIANGLES); - surface_tool->set_material(mat_speaker); - -// float radius=1; - - - const int speaker_points=8; - Vector3 speaker[speaker_points]={ - Vector3(0,0,1)*0.15, - Vector3(1,1,1)*0.15, - Vector3(1,1,0)*0.15, - Vector3(2,2,-1)*0.15, - Vector3(1,1,-1)*0.15, - Vector3(0.8,0.8,-1.2)*0.15, - Vector3(0.5,0.5,-1.4)*0.15, - Vector3(0.0,0.0,-1.6)*0.15 - }; - - int speaker_sides=10; - - - for(int i = 0; i < speaker_sides ; i++) { - - - Matrix3 ma(Vector3(0,0,1),Math_PI*2*float(i)/speaker_sides); - Matrix3 mb(Vector3(0,0,1),Math_PI*2*float(i+1)/speaker_sides); - - - for(int j=0;j<speaker_points-1;j++) { - - Vector3 points[4]={ - ma.xform(speaker[j]), - mb.xform(speaker[j]), - mb.xform(speaker[j+1]), - ma.xform(speaker[j+1]), - }; - - Vector3 n = -Plane(points[0],points[1],points[2]).normal; - - surface_tool->add_normal(n); - surface_tool->add_vertex(points[0]); - surface_tool->add_normal(n); - surface_tool->add_vertex(points[2]); - surface_tool->add_normal(n); - surface_tool->add_vertex(points[1]); - - surface_tool->add_normal(n); - surface_tool->add_vertex(points[0]); - surface_tool->add_normal(n); - surface_tool->add_vertex(points[3]); - surface_tool->add_normal(n); - surface_tool->add_vertex(points[2]); - - - } - - - } - - - return surface_tool->commit(mesh); - -} - - void SpatialPlayer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_param","param","value"),&SpatialPlayer::set_param); - ObjectTypeDB::bind_method(_MD("get_param","param"),&SpatialPlayer::get_param); + ClassDB::bind_method(_MD("set_param","param","value"),&SpatialPlayer::set_param); + ClassDB::bind_method(_MD("get_param","param"),&SpatialPlayer::get_param); BIND_CONSTANT( PARAM_VOLUME_DB ); BIND_CONSTANT( PARAM_PITCH_SCALE ); @@ -243,13 +103,15 @@ void SpatialPlayer::_bind_methods() { BIND_CONSTANT( PARAM_EMISSION_CONE_ATTENUATION_DB ); BIND_CONSTANT( PARAM_MAX ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/volume_db",PROPERTY_HINT_RANGE, "-80,24,0.01"),_SCS("set_param"),_SCS("get_param"),PARAM_VOLUME_DB); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/pitch_scale",PROPERTY_HINT_RANGE, "0.001,32,0.001"),_SCS("set_param"),_SCS("get_param"),PARAM_PITCH_SCALE); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/attenuation/min_distance",PROPERTY_HINT_RANGE, "0.01,4096,0.01"),_SCS("set_param"),_SCS("get_param"),PARAM_ATTENUATION_MIN_DISTANCE); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/attenuation/max_distance",PROPERTY_HINT_RANGE, "0.01,4096,0.01"),_SCS("set_param"),_SCS("get_param"),PARAM_ATTENUATION_MAX_DISTANCE); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/attenuation/distance_exp",PROPERTY_HINT_EXP_EASING, "attenuation"),_SCS("set_param"),_SCS("get_param"),PARAM_ATTENUATION_DISTANCE_EXP); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/emission_cone/degrees",PROPERTY_HINT_RANGE, "0,180,0.01"),_SCS("set_param"),_SCS("get_param"),PARAM_EMISSION_CONE_DEGREES); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/emission_cone/attenuation_db",PROPERTY_HINT_RANGE, "-80,24,0.01"),_SCS("set_param"),_SCS("get_param"),PARAM_EMISSION_CONE_ATTENUATION_DB); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "volume_db",PROPERTY_HINT_RANGE, "-80,24,0.01"),_SCS("set_param"),_SCS("get_param"),PARAM_VOLUME_DB); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "pitch_scale",PROPERTY_HINT_RANGE, "0.001,32,0.001"),_SCS("set_param"),_SCS("get_param"),PARAM_PITCH_SCALE); + ADD_GROUP("Attenuation","attenuation_"); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "attenuation_min_distance",PROPERTY_HINT_RANGE, "0.01,4096,0.01"),_SCS("set_param"),_SCS("get_param"),PARAM_ATTENUATION_MIN_DISTANCE); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "attenuation_max_distance",PROPERTY_HINT_RANGE, "0.01,4096,0.01"),_SCS("set_param"),_SCS("get_param"),PARAM_ATTENUATION_MAX_DISTANCE); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "attenuation_distance_exp",PROPERTY_HINT_EXP_EASING, "attenuation"),_SCS("set_param"),_SCS("get_param"),PARAM_ATTENUATION_DISTANCE_EXP); + ADD_GROUP("Emission Cone","emission_cone_"); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "emission_cone_degrees",PROPERTY_HINT_RANGE, "0,180,0.01"),_SCS("set_param"),_SCS("get_param"),PARAM_EMISSION_CONE_DEGREES); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "emission_cone_attenuation_db",PROPERTY_HINT_RANGE, "-80,24,0.01"),_SCS("set_param"),_SCS("get_param"),PARAM_EMISSION_CONE_ATTENUATION_DB); } diff --git a/scene/3d/spatial_player.h b/scene/3d/spatial_player.h index 5a8687b854..16671a0cb5 100644 --- a/scene/3d/spatial_player.h +++ b/scene/3d/spatial_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -38,7 +38,7 @@ class SpatialPlayer : public Spatial { - OBJ_TYPE(SpatialPlayer,Spatial); + GDCLASS(SpatialPlayer,Spatial); public: @@ -60,7 +60,7 @@ private: RID source_rid; virtual bool _can_gizmo_scale() const; - virtual RES _get_gizmo_geometry() const; + protected: diff --git a/scene/3d/spatial_sample_player.cpp b/scene/3d/spatial_sample_player.cpp index 4c5b2c240e..3e1c0e9947 100644 --- a/scene/3d/spatial_sample_player.cpp +++ b/scene/3d/spatial_sample_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -204,26 +204,26 @@ String SpatialSamplePlayer::get_configuration_warning() const { void SpatialSamplePlayer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_sample_library","library:SampleLibrary"),&SpatialSamplePlayer::set_sample_library); - ObjectTypeDB::bind_method(_MD("get_sample_library:SampleLibrary"),&SpatialSamplePlayer::get_sample_library); + ClassDB::bind_method(_MD("set_sample_library","library:SampleLibrary"),&SpatialSamplePlayer::set_sample_library); + ClassDB::bind_method(_MD("get_sample_library:SampleLibrary"),&SpatialSamplePlayer::get_sample_library); - ObjectTypeDB::bind_method(_MD("set_polyphony","voices"),&SpatialSamplePlayer::set_polyphony); - ObjectTypeDB::bind_method(_MD("get_polyphony"),&SpatialSamplePlayer::get_polyphony); + ClassDB::bind_method(_MD("set_polyphony","voices"),&SpatialSamplePlayer::set_polyphony); + ClassDB::bind_method(_MD("get_polyphony"),&SpatialSamplePlayer::get_polyphony); - ObjectTypeDB::bind_method(_MD("play","sample","voice"),&SpatialSamplePlayer::play,DEFVAL(NEXT_VOICE)); + ClassDB::bind_method(_MD("play","sample","voice"),&SpatialSamplePlayer::play,DEFVAL(NEXT_VOICE)); //voices,DEV - ObjectTypeDB::bind_method(_MD("voice_set_pitch_scale","voice","ratio"),&SpatialSamplePlayer::voice_set_pitch_scale); - ObjectTypeDB::bind_method(_MD("voice_set_volume_scale_db","voice","db"),&SpatialSamplePlayer::voice_set_volume_scale_db); + ClassDB::bind_method(_MD("voice_set_pitch_scale","voice","ratio"),&SpatialSamplePlayer::voice_set_pitch_scale); + ClassDB::bind_method(_MD("voice_set_volume_scale_db","voice","db"),&SpatialSamplePlayer::voice_set_volume_scale_db); - ObjectTypeDB::bind_method(_MD("is_voice_active","voice"),&SpatialSamplePlayer::is_voice_active); - ObjectTypeDB::bind_method(_MD("stop_voice","voice"),&SpatialSamplePlayer::stop_voice); - ObjectTypeDB::bind_method(_MD("stop_all"),&SpatialSamplePlayer::stop_all); + ClassDB::bind_method(_MD("is_voice_active","voice"),&SpatialSamplePlayer::is_voice_active); + ClassDB::bind_method(_MD("stop_voice","voice"),&SpatialSamplePlayer::stop_voice); + ClassDB::bind_method(_MD("stop_all"),&SpatialSamplePlayer::stop_all); BIND_CONSTANT( INVALID_VOICE ); BIND_CONSTANT( NEXT_VOICE ); - ADD_PROPERTY( PropertyInfo( Variant::INT, "config/polyphony", PROPERTY_HINT_RANGE, "1,64,1"),_SCS("set_polyphony"),_SCS("get_polyphony")); - ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "config/samples", PROPERTY_HINT_RESOURCE_TYPE,"SampleLibrary"),_SCS("set_sample_library"),_SCS("get_sample_library")); + ADD_PROPERTY( PropertyInfo( Variant::INT, "polyphony", PROPERTY_HINT_RANGE, "1,64,1"),_SCS("set_polyphony"),_SCS("get_polyphony")); + ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "samples", PROPERTY_HINT_RESOURCE_TYPE,"SampleLibrary"),_SCS("set_sample_library"),_SCS("get_sample_library")); } diff --git a/scene/3d/spatial_sample_player.h b/scene/3d/spatial_sample_player.h index 257f6d0dc3..d30ff6e908 100644 --- a/scene/3d/spatial_sample_player.h +++ b/scene/3d/spatial_sample_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class SpatialSamplePlayer : public SpatialPlayer { - OBJ_TYPE(SpatialSamplePlayer,SpatialPlayer); + GDCLASS(SpatialSamplePlayer,SpatialPlayer); public: enum { diff --git a/scene/3d/spatial_stream_player.cpp b/scene/3d/spatial_stream_player.cpp index 11debb9bce..087e60b48b 100644 --- a/scene/3d/spatial_stream_player.cpp +++ b/scene/3d/spatial_stream_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -329,54 +329,54 @@ int SpatialStreamPlayer::get_buffering_msec() const{ void SpatialStreamPlayer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_stream","stream:AudioStream"),&SpatialStreamPlayer::set_stream); - ObjectTypeDB::bind_method(_MD("get_stream:AudioStream"),&SpatialStreamPlayer::get_stream); + ClassDB::bind_method(_MD("set_stream","stream:AudioStream"),&SpatialStreamPlayer::set_stream); + ClassDB::bind_method(_MD("get_stream:AudioStream"),&SpatialStreamPlayer::get_stream); - ObjectTypeDB::bind_method(_MD("play","offset"),&SpatialStreamPlayer::play,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("stop"),&SpatialStreamPlayer::stop); + ClassDB::bind_method(_MD("play","offset"),&SpatialStreamPlayer::play,DEFVAL(0)); + ClassDB::bind_method(_MD("stop"),&SpatialStreamPlayer::stop); - ObjectTypeDB::bind_method(_MD("is_playing"),&SpatialStreamPlayer::is_playing); + ClassDB::bind_method(_MD("is_playing"),&SpatialStreamPlayer::is_playing); - ObjectTypeDB::bind_method(_MD("set_paused","paused"),&SpatialStreamPlayer::set_paused); - ObjectTypeDB::bind_method(_MD("is_paused"),&SpatialStreamPlayer::is_paused); + ClassDB::bind_method(_MD("set_paused","paused"),&SpatialStreamPlayer::set_paused); + ClassDB::bind_method(_MD("is_paused"),&SpatialStreamPlayer::is_paused); - ObjectTypeDB::bind_method(_MD("set_loop","enabled"),&SpatialStreamPlayer::set_loop); - ObjectTypeDB::bind_method(_MD("has_loop"),&SpatialStreamPlayer::has_loop); + ClassDB::bind_method(_MD("set_loop","enabled"),&SpatialStreamPlayer::set_loop); + ClassDB::bind_method(_MD("has_loop"),&SpatialStreamPlayer::has_loop); - ObjectTypeDB::bind_method(_MD("set_volume","volume"),&SpatialStreamPlayer::set_volume); - ObjectTypeDB::bind_method(_MD("get_volume"),&SpatialStreamPlayer::get_volume); + ClassDB::bind_method(_MD("set_volume","volume"),&SpatialStreamPlayer::set_volume); + ClassDB::bind_method(_MD("get_volume"),&SpatialStreamPlayer::get_volume); - ObjectTypeDB::bind_method(_MD("set_volume_db","db"),&SpatialStreamPlayer::set_volume_db); - ObjectTypeDB::bind_method(_MD("get_volume_db"),&SpatialStreamPlayer::get_volume_db); + ClassDB::bind_method(_MD("set_volume_db","db"),&SpatialStreamPlayer::set_volume_db); + ClassDB::bind_method(_MD("get_volume_db"),&SpatialStreamPlayer::get_volume_db); - ObjectTypeDB::bind_method(_MD("set_buffering_msec","msec"),&SpatialStreamPlayer::set_buffering_msec); - ObjectTypeDB::bind_method(_MD("get_buffering_msec"),&SpatialStreamPlayer::get_buffering_msec); + ClassDB::bind_method(_MD("set_buffering_msec","msec"),&SpatialStreamPlayer::set_buffering_msec); + ClassDB::bind_method(_MD("get_buffering_msec"),&SpatialStreamPlayer::get_buffering_msec); - ObjectTypeDB::bind_method(_MD("set_loop_restart_time","secs"),&SpatialStreamPlayer::set_loop_restart_time); - ObjectTypeDB::bind_method(_MD("get_loop_restart_time"),&SpatialStreamPlayer::get_loop_restart_time); + ClassDB::bind_method(_MD("set_loop_restart_time","secs"),&SpatialStreamPlayer::set_loop_restart_time); + ClassDB::bind_method(_MD("get_loop_restart_time"),&SpatialStreamPlayer::get_loop_restart_time); - ObjectTypeDB::bind_method(_MD("get_stream_name"),&SpatialStreamPlayer::get_stream_name); - ObjectTypeDB::bind_method(_MD("get_loop_count"),&SpatialStreamPlayer::get_loop_count); + ClassDB::bind_method(_MD("get_stream_name"),&SpatialStreamPlayer::get_stream_name); + ClassDB::bind_method(_MD("get_loop_count"),&SpatialStreamPlayer::get_loop_count); - ObjectTypeDB::bind_method(_MD("get_pos"),&SpatialStreamPlayer::get_pos); - ObjectTypeDB::bind_method(_MD("seek_pos","time"),&SpatialStreamPlayer::seek_pos); + ClassDB::bind_method(_MD("get_pos"),&SpatialStreamPlayer::get_pos); + ClassDB::bind_method(_MD("seek_pos","time"),&SpatialStreamPlayer::seek_pos); - ObjectTypeDB::bind_method(_MD("set_autoplay","enabled"),&SpatialStreamPlayer::set_autoplay); - ObjectTypeDB::bind_method(_MD("has_autoplay"),&SpatialStreamPlayer::has_autoplay); + ClassDB::bind_method(_MD("set_autoplay","enabled"),&SpatialStreamPlayer::set_autoplay); + ClassDB::bind_method(_MD("has_autoplay"),&SpatialStreamPlayer::has_autoplay); - ObjectTypeDB::bind_method(_MD("get_length"),&SpatialStreamPlayer::get_length); + ClassDB::bind_method(_MD("get_length"),&SpatialStreamPlayer::get_length); - ObjectTypeDB::bind_method(_MD("_set_play","play"),&SpatialStreamPlayer::_set_play); - ObjectTypeDB::bind_method(_MD("_get_play"),&SpatialStreamPlayer::_get_play); + ClassDB::bind_method(_MD("_set_play","play"),&SpatialStreamPlayer::_set_play); + ClassDB::bind_method(_MD("_get_play"),&SpatialStreamPlayer::_get_play); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "stream/stream", PROPERTY_HINT_RESOURCE_TYPE,"AudioStream"), _SCS("set_stream"), _SCS("get_stream") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/play"), _SCS("_set_play"), _SCS("_get_play") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/loop"), _SCS("set_loop"), _SCS("has_loop") ); - ADD_PROPERTY( PropertyInfo(Variant::REAL, "stream/volume_db", PROPERTY_HINT_RANGE,"-80,24,0.01"), _SCS("set_volume_db"), _SCS("get_volume_db") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/autoplay"), _SCS("set_autoplay"), _SCS("has_autoplay") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/paused"), _SCS("set_paused"), _SCS("is_paused") ); - ADD_PROPERTY( PropertyInfo(Variant::INT, "stream/loop_restart_time"), _SCS("set_loop_restart_time"), _SCS("get_loop_restart_time") ); - ADD_PROPERTY( PropertyInfo(Variant::INT, "stream/buffering_ms"), _SCS("set_buffering_msec"), _SCS("get_buffering_msec") ); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE,"AudioStream"), _SCS("set_stream"), _SCS("get_stream") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "play"), _SCS("_set_play"), _SCS("_get_play") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "loop"), _SCS("set_loop"), _SCS("has_loop") ); + ADD_PROPERTY( PropertyInfo(Variant::REAL, "volume_db", PROPERTY_HINT_RANGE,"-80,24,0.01"), _SCS("set_volume_db"), _SCS("get_volume_db") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "autoplay"), _SCS("set_autoplay"), _SCS("has_autoplay") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "paused"), _SCS("set_paused"), _SCS("is_paused") ); + ADD_PROPERTY( PropertyInfo(Variant::INT, "loop_restart_time"), _SCS("set_loop_restart_time"), _SCS("get_loop_restart_time") ); + ADD_PROPERTY( PropertyInfo(Variant::INT, "buffering_ms"), _SCS("set_buffering_msec"), _SCS("get_buffering_msec") ); } diff --git a/scene/3d/spatial_stream_player.h b/scene/3d/spatial_stream_player.h index 0732b3fc10..27533d3f6e 100644 --- a/scene/3d/spatial_stream_player.h +++ b/scene/3d/spatial_stream_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class SpatialStreamPlayer : public SpatialPlayer { - OBJ_TYPE(SpatialStreamPlayer,SpatialPlayer); + GDCLASS(SpatialStreamPlayer,SpatialPlayer); _THREAD_SAFE_CLASS_ diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index 74cab30b17..a2a96d7d0e 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -207,13 +207,13 @@ void SpriteBase3D::_queue_update(){ } -AABB SpriteBase3D::get_aabb() const { +Rect3 SpriteBase3D::get_aabb() const { return aabb; } -DVector<Face3> SpriteBase3D::get_faces(uint32_t p_usage_flags) const { +PoolVector<Face3> SpriteBase3D::get_faces(uint32_t p_usage_flags) const { - return DVector<Face3>(); + return PoolVector<Face3>(); } @@ -246,41 +246,41 @@ SpriteBase3D::AlphaCutMode SpriteBase3D::get_alpha_cut_mode() const{ void SpriteBase3D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_centered","centered"),&SpriteBase3D::set_centered); - ObjectTypeDB::bind_method(_MD("is_centered"),&SpriteBase3D::is_centered); + ClassDB::bind_method(_MD("set_centered","centered"),&SpriteBase3D::set_centered); + ClassDB::bind_method(_MD("is_centered"),&SpriteBase3D::is_centered); - ObjectTypeDB::bind_method(_MD("set_offset","offset"),&SpriteBase3D::set_offset); - ObjectTypeDB::bind_method(_MD("get_offset"),&SpriteBase3D::get_offset); + ClassDB::bind_method(_MD("set_offset","offset"),&SpriteBase3D::set_offset); + ClassDB::bind_method(_MD("get_offset"),&SpriteBase3D::get_offset); - ObjectTypeDB::bind_method(_MD("set_flip_h","flip_h"),&SpriteBase3D::set_flip_h); - ObjectTypeDB::bind_method(_MD("is_flipped_h"),&SpriteBase3D::is_flipped_h); + ClassDB::bind_method(_MD("set_flip_h","flip_h"),&SpriteBase3D::set_flip_h); + ClassDB::bind_method(_MD("is_flipped_h"),&SpriteBase3D::is_flipped_h); - ObjectTypeDB::bind_method(_MD("set_flip_v","flip_v"),&SpriteBase3D::set_flip_v); - ObjectTypeDB::bind_method(_MD("is_flipped_v"),&SpriteBase3D::is_flipped_v); + ClassDB::bind_method(_MD("set_flip_v","flip_v"),&SpriteBase3D::set_flip_v); + ClassDB::bind_method(_MD("is_flipped_v"),&SpriteBase3D::is_flipped_v); - ObjectTypeDB::bind_method(_MD("set_modulate","modulate"),&SpriteBase3D::set_modulate); - ObjectTypeDB::bind_method(_MD("get_modulate"),&SpriteBase3D::get_modulate); + ClassDB::bind_method(_MD("set_modulate","modulate"),&SpriteBase3D::set_modulate); + ClassDB::bind_method(_MD("get_modulate"),&SpriteBase3D::get_modulate); - ObjectTypeDB::bind_method(_MD("set_opacity","opacity"),&SpriteBase3D::set_opacity); - ObjectTypeDB::bind_method(_MD("get_opacity"),&SpriteBase3D::get_opacity); + ClassDB::bind_method(_MD("set_opacity","opacity"),&SpriteBase3D::set_opacity); + ClassDB::bind_method(_MD("get_opacity"),&SpriteBase3D::get_opacity); - ObjectTypeDB::bind_method(_MD("set_pixel_size","pixel_size"),&SpriteBase3D::set_pixel_size); - ObjectTypeDB::bind_method(_MD("get_pixel_size"),&SpriteBase3D::get_pixel_size); + ClassDB::bind_method(_MD("set_pixel_size","pixel_size"),&SpriteBase3D::set_pixel_size); + ClassDB::bind_method(_MD("get_pixel_size"),&SpriteBase3D::get_pixel_size); - ObjectTypeDB::bind_method(_MD("set_axis","axis"),&SpriteBase3D::set_axis); - ObjectTypeDB::bind_method(_MD("get_axis"),&SpriteBase3D::get_axis); + ClassDB::bind_method(_MD("set_axis","axis"),&SpriteBase3D::set_axis); + ClassDB::bind_method(_MD("get_axis"),&SpriteBase3D::get_axis); - ObjectTypeDB::bind_method(_MD("set_draw_flag","flag","enabled"),&SpriteBase3D::set_draw_flag); - ObjectTypeDB::bind_method(_MD("get_draw_flag","flag"),&SpriteBase3D::get_draw_flag); + ClassDB::bind_method(_MD("set_draw_flag","flag","enabled"),&SpriteBase3D::set_draw_flag); + ClassDB::bind_method(_MD("get_draw_flag","flag"),&SpriteBase3D::get_draw_flag); - ObjectTypeDB::bind_method(_MD("set_alpha_cut_mode","mode"),&SpriteBase3D::set_alpha_cut_mode); - ObjectTypeDB::bind_method(_MD("get_alpha_cut_mode"),&SpriteBase3D::get_alpha_cut_mode); + ClassDB::bind_method(_MD("set_alpha_cut_mode","mode"),&SpriteBase3D::set_alpha_cut_mode); + ClassDB::bind_method(_MD("get_alpha_cut_mode"),&SpriteBase3D::get_alpha_cut_mode); - ObjectTypeDB::bind_method(_MD("get_item_rect"),&SpriteBase3D::get_item_rect); + ClassDB::bind_method(_MD("get_item_rect"),&SpriteBase3D::get_item_rect); - ObjectTypeDB::bind_method(_MD("_queue_update"),&SpriteBase3D::_queue_update); - ObjectTypeDB::bind_method(_MD("_im_update"),&SpriteBase3D::_im_update); + ClassDB::bind_method(_MD("_queue_update"),&SpriteBase3D::_queue_update); + ClassDB::bind_method(_MD("_im_update"),&SpriteBase3D::_im_update); ADD_PROPERTY( PropertyInfo( Variant::BOOL, "centered"), _SCS("set_centered"),_SCS("is_centered")); @@ -291,9 +291,10 @@ void SpriteBase3D::_bind_methods() { ADD_PROPERTY( PropertyInfo( Variant::REAL, "opacity",PROPERTY_HINT_RANGE,"0,1,0.01"), _SCS("set_opacity"),_SCS("get_opacity")); ADD_PROPERTY( PropertyInfo( Variant::REAL, "pixel_size",PROPERTY_HINT_RANGE,"0.0001,128,0.0001"), _SCS("set_pixel_size"),_SCS("get_pixel_size")); ADD_PROPERTY( PropertyInfo( Variant::INT, "axis",PROPERTY_HINT_ENUM,"X-Axis,Y-Axis,Z-Axis"), _SCS("set_axis"),_SCS("get_axis")); - ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "flags/transparent"), _SCS("set_draw_flag"),_SCS("get_draw_flag"),FLAG_TRANSPARENT); - ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "flags/shaded"), _SCS("set_draw_flag"),_SCS("get_draw_flag"),FLAG_SHADED); - ADD_PROPERTY( PropertyInfo( Variant::INT, "flags/alpha_cut",PROPERTY_HINT_ENUM,"Disabled,Discard,Opaque Pre-Pass"), _SCS("set_alpha_cut_mode"),_SCS("get_alpha_cut_mode")); + ADD_GROUP("Flags",""); + ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "transparent"), _SCS("set_draw_flag"),_SCS("get_draw_flag"),FLAG_TRANSPARENT); + ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "shaded"), _SCS("set_draw_flag"),_SCS("get_draw_flag"),FLAG_SHADED); + ADD_PROPERTY( PropertyInfo( Variant::INT, "alpha_cut",PROPERTY_HINT_ENUM,"Disabled,Discard,Opaque Pre-Pass"), _SCS("set_alpha_cut_mode"),_SCS("get_alpha_cut_mode")); BIND_CONSTANT( FLAG_TRANSPARENT ); @@ -444,7 +445,7 @@ void Sprite3D::_draw() { } } - AABB aabb; + Rect3 aabb; for(int i=0;i<4;i++) { VS::get_singleton()->immediate_normal(immediate,normal); @@ -598,23 +599,23 @@ void Sprite3D::_validate_property(PropertyInfo& property) const { void Sprite3D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_texture","texture:Texture"),&Sprite3D::set_texture); - ObjectTypeDB::bind_method(_MD("get_texture:Texture"),&Sprite3D::get_texture); + ClassDB::bind_method(_MD("set_texture","texture:Texture"),&Sprite3D::set_texture); + ClassDB::bind_method(_MD("get_texture:Texture"),&Sprite3D::get_texture); - ObjectTypeDB::bind_method(_MD("set_region","enabled"),&Sprite3D::set_region); - ObjectTypeDB::bind_method(_MD("is_region"),&Sprite3D::is_region); + ClassDB::bind_method(_MD("set_region","enabled"),&Sprite3D::set_region); + ClassDB::bind_method(_MD("is_region"),&Sprite3D::is_region); - ObjectTypeDB::bind_method(_MD("set_region_rect","rect"),&Sprite3D::set_region_rect); - ObjectTypeDB::bind_method(_MD("get_region_rect"),&Sprite3D::get_region_rect); + ClassDB::bind_method(_MD("set_region_rect","rect"),&Sprite3D::set_region_rect); + ClassDB::bind_method(_MD("get_region_rect"),&Sprite3D::get_region_rect); - ObjectTypeDB::bind_method(_MD("set_frame","frame"),&Sprite3D::set_frame); - ObjectTypeDB::bind_method(_MD("get_frame"),&Sprite3D::get_frame); + ClassDB::bind_method(_MD("set_frame","frame"),&Sprite3D::set_frame); + ClassDB::bind_method(_MD("get_frame"),&Sprite3D::get_frame); - ObjectTypeDB::bind_method(_MD("set_vframes","vframes"),&Sprite3D::set_vframes); - ObjectTypeDB::bind_method(_MD("get_vframes"),&Sprite3D::get_vframes); + ClassDB::bind_method(_MD("set_vframes","vframes"),&Sprite3D::set_vframes); + ClassDB::bind_method(_MD("get_vframes"),&Sprite3D::get_vframes); - ObjectTypeDB::bind_method(_MD("set_hframes","hframes"),&Sprite3D::set_hframes); - ObjectTypeDB::bind_method(_MD("get_hframes"),&Sprite3D::get_hframes); + ClassDB::bind_method(_MD("set_hframes","hframes"),&Sprite3D::set_hframes); + ClassDB::bind_method(_MD("get_hframes"),&Sprite3D::get_hframes); ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_texture"),_SCS("get_texture")); ADD_PROPERTY( PropertyInfo( Variant::INT, "vframes",PROPERTY_HINT_RANGE,"1,16384,1"), _SCS("set_vframes"),_SCS("get_vframes")); @@ -761,10 +762,10 @@ void AnimatedSprite3D::_draw() { void AnimatedSprite3D::_bind_methods(){ - ObjectTypeDB::bind_method(_MD("set_sprite_frames","sprite_frames:SpriteFrames"),&AnimatedSprite3D::set_sprite_frames); - ObjectTypeDB::bind_method(_MD("get_sprite_frames:Texture"),&AnimatedSprite3D::get_sprite_frames); - ObjectTypeDB::bind_method(_MD("set_frame","frame"),&AnimatedSprite3D::set_frame); - ObjectTypeDB::bind_method(_MD("get_frame"),&AnimatedSprite3D::get_frame); + ClassDB::bind_method(_MD("set_sprite_frames","sprite_frames:SpriteFrames"),&AnimatedSprite3D::set_sprite_frames); + ClassDB::bind_method(_MD("get_sprite_frames:Texture"),&AnimatedSprite3D::get_sprite_frames); + ClassDB::bind_method(_MD("set_frame","frame"),&AnimatedSprite3D::set_frame); + ClassDB::bind_method(_MD("get_frame"),&AnimatedSprite3D::get_frame); ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "frames", PROPERTY_HINT_RESOURCE_TYPE,"SpriteFrames"), _SCS("set_sprite_frames"),_SCS("get_sprite_frames")); ADD_PROPERTY( PropertyInfo( Variant::INT, "frame",PROPERTY_HINT_SPRITE_FRAME), _SCS("set_frame"),_SCS("get_frame")); @@ -960,7 +961,7 @@ void AnimatedSprite3D::_draw() { } } - AABB aabb; + Rect3 aabb; for(int i=0;i<4;i++) { VS::get_singleton()->immediate_normal(immediate,normal); @@ -1035,7 +1036,7 @@ void AnimatedSprite3D::_validate_property(PropertyInfo& property) const { void AnimatedSprite3D::_notification(int p_what) { switch(p_what) { - case NOTIFICATION_PROCESS: { + case NOTIFICATION_INTERNAL_PROCESS: { if (frames.is_null()) return; @@ -1238,7 +1239,7 @@ void AnimatedSprite3D::_set_playing(bool p_playing) { return; playing=p_playing; _reset_timeout(); - set_process(playing); + set_process_internal(playing); } bool AnimatedSprite3D::_is_playing() const { @@ -1309,24 +1310,24 @@ String AnimatedSprite3D::get_configuration_warning() const { void AnimatedSprite3D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_sprite_frames","sprite_frames:SpriteFrames"),&AnimatedSprite3D::set_sprite_frames); - ObjectTypeDB::bind_method(_MD("get_sprite_frames:SpriteFrames"),&AnimatedSprite3D::get_sprite_frames); + ClassDB::bind_method(_MD("set_sprite_frames","sprite_frames:SpriteFrames"),&AnimatedSprite3D::set_sprite_frames); + ClassDB::bind_method(_MD("get_sprite_frames:SpriteFrames"),&AnimatedSprite3D::get_sprite_frames); - ObjectTypeDB::bind_method(_MD("set_animation","animation"),&AnimatedSprite3D::set_animation); - ObjectTypeDB::bind_method(_MD("get_animation"),&AnimatedSprite3D::get_animation); + ClassDB::bind_method(_MD("set_animation","animation"),&AnimatedSprite3D::set_animation); + ClassDB::bind_method(_MD("get_animation"),&AnimatedSprite3D::get_animation); - ObjectTypeDB::bind_method(_MD("_set_playing","playing"),&AnimatedSprite3D::_set_playing); - ObjectTypeDB::bind_method(_MD("_is_playing"),&AnimatedSprite3D::_is_playing); + ClassDB::bind_method(_MD("_set_playing","playing"),&AnimatedSprite3D::_set_playing); + ClassDB::bind_method(_MD("_is_playing"),&AnimatedSprite3D::_is_playing); - ObjectTypeDB::bind_method(_MD("play","anim"),&AnimatedSprite3D::play,DEFVAL(StringName())); - ObjectTypeDB::bind_method(_MD("stop"),&AnimatedSprite3D::stop); - ObjectTypeDB::bind_method(_MD("is_playing"),&AnimatedSprite3D::is_playing); + ClassDB::bind_method(_MD("play","anim"),&AnimatedSprite3D::play,DEFVAL(StringName())); + ClassDB::bind_method(_MD("stop"),&AnimatedSprite3D::stop); + ClassDB::bind_method(_MD("is_playing"),&AnimatedSprite3D::is_playing); - ObjectTypeDB::bind_method(_MD("set_frame","frame"),&AnimatedSprite3D::set_frame); - ObjectTypeDB::bind_method(_MD("get_frame"),&AnimatedSprite3D::get_frame); + ClassDB::bind_method(_MD("set_frame","frame"),&AnimatedSprite3D::set_frame); + ClassDB::bind_method(_MD("get_frame"),&AnimatedSprite3D::get_frame); - ObjectTypeDB::bind_method(_MD("_res_changed"),&AnimatedSprite3D::_res_changed); + ClassDB::bind_method(_MD("_res_changed"),&AnimatedSprite3D::_res_changed); ADD_SIGNAL(MethodInfo("frame_changed")); diff --git a/scene/3d/sprite_3d.h b/scene/3d/sprite_3d.h index 31f8ec020f..f5d3957370 100644 --- a/scene/3d/sprite_3d.h +++ b/scene/3d/sprite_3d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class SpriteBase3D : public GeometryInstance { - OBJ_TYPE(SpriteBase3D,GeometryInstance); + GDCLASS(SpriteBase3D,GeometryInstance); public: enum DrawFlags { @@ -73,7 +73,7 @@ private: Vector3::Axis axis; float pixel_size; - AABB aabb; + Rect3 aabb; RID immediate; @@ -91,7 +91,7 @@ protected: void _notification(int p_what); static void _bind_methods(); virtual void _draw()=0; - _FORCE_INLINE_ void set_aabb(const AABB& p_aabb) { aabb=p_aabb; } + _FORCE_INLINE_ void set_aabb(const Rect3& p_aabb) { aabb=p_aabb; } _FORCE_INLINE_ RID& get_immediate() { return immediate; } void _queue_update(); public: @@ -134,8 +134,8 @@ public: virtual Rect2 get_item_rect() const=0; - virtual AABB get_aabb() const; - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual Rect3 get_aabb() const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; SpriteBase3D(); ~SpriteBase3D(); @@ -144,7 +144,7 @@ public: class Sprite3D : public SpriteBase3D { - OBJ_TYPE(Sprite3D,SpriteBase3D); + GDCLASS(Sprite3D,SpriteBase3D); Ref<Texture> texture; @@ -191,7 +191,7 @@ public: #if 0 class AnimatedSprite3D : public SpriteBase3D { - OBJ_TYPE(AnimatedSprite3D,SpriteBase3D); + GDCLASS(AnimatedSprite3D,SpriteBase3D); Ref<SpriteFrames> frames; @@ -224,7 +224,7 @@ public: class AnimatedSprite3D : public SpriteBase3D { - OBJ_TYPE(AnimatedSprite3D,SpriteBase3D); + GDCLASS(AnimatedSprite3D,SpriteBase3D); Ref<SpriteFrames> frames; bool playing; diff --git a/scene/3d/test_cube.cpp b/scene/3d/test_cube.cpp index 6440d95d55..c52e596032 100644 --- a/scene/3d/test_cube.cpp +++ b/scene/3d/test_cube.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,13 +31,13 @@ -AABB TestCube::get_aabb() const { +Rect3 TestCube::get_aabb() const { - return AABB( Vector3(-1,-1,-1), Vector3(2, 2, 2 ) ); + return Rect3( Vector3(-1,-1,-1), Vector3(2, 2, 2 ) ); } -DVector<Face3> TestCube::get_faces(uint32_t p_usage_flags) const { +PoolVector<Face3> TestCube::get_faces(uint32_t p_usage_flags) const { - return DVector<Face3>(); + return PoolVector<Face3>(); } diff --git a/scene/3d/test_cube.h b/scene/3d/test_cube.h index 332276ab89..4860bacd8d 100644 --- a/scene/3d/test_cube.h +++ b/scene/3d/test_cube.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,15 +39,15 @@ */ class TestCube : public GeometryInstance { - OBJ_TYPE( TestCube, GeometryInstance ); + GDCLASS( TestCube, GeometryInstance ); RID instance; public: - virtual AABB get_aabb() const; - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const; + virtual Rect3 get_aabb() const; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const; TestCube(); ~TestCube(); diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp index 7c7957640f..1cb443225c 100644 --- a/scene/3d/vehicle_body.cpp +++ b/scene/3d/vehicle_body.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -47,8 +47,8 @@ public: btVehicleJacobianEntry() {}; //constraint between two different rigidbodies btVehicleJacobianEntry( - const Matrix3& world2A, - const Matrix3& world2B, + const Basis& world2A, + const Basis& world2B, const Vector3& rel_pos1, const Vector3& rel_pos2, const Vector3& jointAxis, @@ -232,48 +232,52 @@ float VehicleWheel::get_friction_slip() const{ void VehicleWheel::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_radius","length"),&VehicleWheel::set_radius); - ObjectTypeDB::bind_method(_MD("get_radius"),&VehicleWheel::get_radius); + ClassDB::bind_method(_MD("set_radius","length"),&VehicleWheel::set_radius); + ClassDB::bind_method(_MD("get_radius"),&VehicleWheel::get_radius); - ObjectTypeDB::bind_method(_MD("set_suspension_rest_length","length"),&VehicleWheel::set_suspension_rest_length); - ObjectTypeDB::bind_method(_MD("get_suspension_rest_length"),&VehicleWheel::get_suspension_rest_length); + ClassDB::bind_method(_MD("set_suspension_rest_length","length"),&VehicleWheel::set_suspension_rest_length); + ClassDB::bind_method(_MD("get_suspension_rest_length"),&VehicleWheel::get_suspension_rest_length); - ObjectTypeDB::bind_method(_MD("set_suspension_travel","length"),&VehicleWheel::set_suspension_travel); - ObjectTypeDB::bind_method(_MD("get_suspension_travel"),&VehicleWheel::get_suspension_travel); + ClassDB::bind_method(_MD("set_suspension_travel","length"),&VehicleWheel::set_suspension_travel); + ClassDB::bind_method(_MD("get_suspension_travel"),&VehicleWheel::get_suspension_travel); - ObjectTypeDB::bind_method(_MD("set_suspension_stiffness","length"),&VehicleWheel::set_suspension_stiffness); - ObjectTypeDB::bind_method(_MD("get_suspension_stiffness"),&VehicleWheel::get_suspension_stiffness); + ClassDB::bind_method(_MD("set_suspension_stiffness","length"),&VehicleWheel::set_suspension_stiffness); + ClassDB::bind_method(_MD("get_suspension_stiffness"),&VehicleWheel::get_suspension_stiffness); - ObjectTypeDB::bind_method(_MD("set_suspension_max_force","length"),&VehicleWheel::set_suspension_max_force); - ObjectTypeDB::bind_method(_MD("get_suspension_max_force"),&VehicleWheel::get_suspension_max_force); + ClassDB::bind_method(_MD("set_suspension_max_force","length"),&VehicleWheel::set_suspension_max_force); + ClassDB::bind_method(_MD("get_suspension_max_force"),&VehicleWheel::get_suspension_max_force); - ObjectTypeDB::bind_method(_MD("set_damping_compression","length"),&VehicleWheel::set_damping_compression); - ObjectTypeDB::bind_method(_MD("get_damping_compression"),&VehicleWheel::get_damping_compression); + ClassDB::bind_method(_MD("set_damping_compression","length"),&VehicleWheel::set_damping_compression); + ClassDB::bind_method(_MD("get_damping_compression"),&VehicleWheel::get_damping_compression); - ObjectTypeDB::bind_method(_MD("set_damping_relaxation","length"),&VehicleWheel::set_damping_relaxation); - ObjectTypeDB::bind_method(_MD("get_damping_relaxation"),&VehicleWheel::get_damping_relaxation); + ClassDB::bind_method(_MD("set_damping_relaxation","length"),&VehicleWheel::set_damping_relaxation); + ClassDB::bind_method(_MD("get_damping_relaxation"),&VehicleWheel::get_damping_relaxation); - ObjectTypeDB::bind_method(_MD("set_use_as_traction","enable"),&VehicleWheel::set_use_as_traction); - ObjectTypeDB::bind_method(_MD("is_used_as_traction"),&VehicleWheel::is_used_as_traction); + ClassDB::bind_method(_MD("set_use_as_traction","enable"),&VehicleWheel::set_use_as_traction); + ClassDB::bind_method(_MD("is_used_as_traction"),&VehicleWheel::is_used_as_traction); - ObjectTypeDB::bind_method(_MD("set_use_as_steering","enable"),&VehicleWheel::set_use_as_steering); - ObjectTypeDB::bind_method(_MD("is_used_as_steering"),&VehicleWheel::is_used_as_steering); + ClassDB::bind_method(_MD("set_use_as_steering","enable"),&VehicleWheel::set_use_as_steering); + ClassDB::bind_method(_MD("is_used_as_steering"),&VehicleWheel::is_used_as_steering); - ObjectTypeDB::bind_method(_MD("set_friction_slip","length"),&VehicleWheel::set_friction_slip); - ObjectTypeDB::bind_method(_MD("get_friction_slip"),&VehicleWheel::get_friction_slip); + ClassDB::bind_method(_MD("set_friction_slip","length"),&VehicleWheel::set_friction_slip); + ClassDB::bind_method(_MD("get_friction_slip"),&VehicleWheel::get_friction_slip); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"type/traction"),_SCS("set_use_as_traction"),_SCS("is_used_as_traction")); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"type/steering"),_SCS("set_use_as_steering"),_SCS("is_used_as_steering")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"wheel/radius"),_SCS("set_radius"),_SCS("get_radius")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"wheel/rest_length"),_SCS("set_suspension_rest_length"),_SCS("get_suspension_rest_length")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"wheel/friction_slip"),_SCS("set_friction_slip"),_SCS("get_friction_slip")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"suspension/travel"),_SCS("set_suspension_travel"),_SCS("get_suspension_travel")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"suspension/stiffness"),_SCS("set_suspension_stiffness"),_SCS("get_suspension_stiffness")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"suspension/max_force"),_SCS("set_suspension_max_force"),_SCS("get_suspension_max_force")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"damping/compression"),_SCS("set_damping_compression"),_SCS("get_damping_compression")); - ADD_PROPERTY(PropertyInfo(Variant::REAL,"damping/relaxation"),_SCS("set_damping_relaxation"),_SCS("get_damping_relaxation")); + + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"use_as_traction"),_SCS("set_use_as_traction"),_SCS("is_used_as_traction")); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"use_as_steering"),_SCS("set_use_as_steering"),_SCS("is_used_as_steering")); + ADD_GROUP("Wheel","wheel_"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"wheel_radius"),_SCS("set_radius"),_SCS("get_radius")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"wheel_rest_length"),_SCS("set_suspension_rest_length"),_SCS("get_suspension_rest_length")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"wheel_friction_slip"),_SCS("set_friction_slip"),_SCS("get_friction_slip")); + ADD_GROUP("Suspension","suspension_"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"suspension_travel"),_SCS("set_suspension_travel"),_SCS("get_suspension_travel")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"suspension_stiffness"),_SCS("set_suspension_stiffness"),_SCS("get_suspension_stiffness")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"suspension_max_force"),_SCS("set_suspension_max_force"),_SCS("get_suspension_max_force")); + ADD_GROUP("Damping","damping_"); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"damping_compression"),_SCS("set_damping_compression"),_SCS("get_damping_compression")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"damping_relaxation"),_SCS("set_damping_relaxation"),_SCS("get_damping_relaxation")); } @@ -363,14 +367,14 @@ void VehicleBody::_update_wheel(int p_idx,PhysicsDirectBodyState *s) { real_t steering = wheel.steers?m_steeringValue:0.0; //print_line(itos(p_idx)+": "+rtos(steering)); - Matrix3 steeringMat(up,steering); + Basis steeringMat(up,steering); - Matrix3 rotatingMat(right,-wheel.m_rotation); + Basis rotatingMat(right,-wheel.m_rotation); // if (p_idx==1) // print_line("steeringMat " +steeringMat); - Matrix3 basis2( + Basis basis2( right[0],up[0],fwd[0], right[1],up[1],fwd[1], right[2],up[2],fwd[2] @@ -570,7 +574,7 @@ void VehicleBody::_resolve_single_bilateral(PhysicsDirectBodyState *s, const Vec Vector3 vel = vel1 - vel2; - Matrix3 b2trans; + Basis b2trans; float b2invmass=0; Vector3 b2lv; Vector3 b2av; @@ -590,7 +594,7 @@ void VehicleBody::_resolve_single_bilateral(PhysicsDirectBodyState *s, const Vec rel_pos1, rel_pos2, normal, - s->get_inverse_inertia(), + s->get_inverse_inertia_tensor().get_main_diagonal(), 1.0/mass, b2invinertia, b2invmass); @@ -724,7 +728,7 @@ void VehicleBody::_update_friction(PhysicsDirectBodyState *s) { //const btTransform& wheelTrans = getWheelTransformWS( i ); - Matrix3 wheelBasis0 = wheelInfo.m_worldTransform.basis;//get_global_transform().basis; + Basis wheelBasis0 = wheelInfo.m_worldTransform.basis;//get_global_transform().basis; m_axle[i] = wheelBasis0.get_axis(Vector3::AXIS_X); //m_axle[i] = wheelInfo.m_raycastInfo.m_wheelAxleWS; @@ -1019,30 +1023,32 @@ Vector3 VehicleBody::get_linear_velocity() const void VehicleBody::_bind_methods(){ - ObjectTypeDB::bind_method(_MD("set_mass","mass"),&VehicleBody::set_mass); - ObjectTypeDB::bind_method(_MD("get_mass"),&VehicleBody::get_mass); + ClassDB::bind_method(_MD("set_mass","mass"),&VehicleBody::set_mass); + ClassDB::bind_method(_MD("get_mass"),&VehicleBody::get_mass); - ObjectTypeDB::bind_method(_MD("set_friction","friction"),&VehicleBody::set_friction); - ObjectTypeDB::bind_method(_MD("get_friction"),&VehicleBody::get_friction); + ClassDB::bind_method(_MD("set_friction","friction"),&VehicleBody::set_friction); + ClassDB::bind_method(_MD("get_friction"),&VehicleBody::get_friction); - ObjectTypeDB::bind_method(_MD("set_engine_force","engine_force"),&VehicleBody::set_engine_force); - ObjectTypeDB::bind_method(_MD("get_engine_force"),&VehicleBody::get_engine_force); + ClassDB::bind_method(_MD("set_engine_force","engine_force"),&VehicleBody::set_engine_force); + ClassDB::bind_method(_MD("get_engine_force"),&VehicleBody::get_engine_force); - ObjectTypeDB::bind_method(_MD("set_brake","brake"),&VehicleBody::set_brake); - ObjectTypeDB::bind_method(_MD("get_brake"),&VehicleBody::get_brake); + ClassDB::bind_method(_MD("set_brake","brake"),&VehicleBody::set_brake); + ClassDB::bind_method(_MD("get_brake"),&VehicleBody::get_brake); - ObjectTypeDB::bind_method(_MD("set_steering","steering"),&VehicleBody::set_steering); - ObjectTypeDB::bind_method(_MD("get_steering"),&VehicleBody::get_steering); + ClassDB::bind_method(_MD("set_steering","steering"),&VehicleBody::set_steering); + ClassDB::bind_method(_MD("get_steering"),&VehicleBody::get_steering); - ObjectTypeDB::bind_method(_MD("get_linear_velocity"),&VehicleBody::get_linear_velocity); + ClassDB::bind_method(_MD("get_linear_velocity"),&VehicleBody::get_linear_velocity); - ObjectTypeDB::bind_method(_MD("_direct_state_changed"),&VehicleBody::_direct_state_changed); + ClassDB::bind_method(_MD("_direct_state_changed"),&VehicleBody::_direct_state_changed); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"motion/engine_force",PROPERTY_HINT_RANGE,"0.00,1024.0,0.01"),_SCS("set_engine_force"),_SCS("get_engine_force")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"motion/brake",PROPERTY_HINT_RANGE,"0.0,1.0,0.01"),_SCS("set_brake"),_SCS("get_brake")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"motion/steering",PROPERTY_HINT_RANGE,"-180,180.0,0.01"),_SCS("set_steering"),_SCS("get_steering")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"body/mass",PROPERTY_HINT_RANGE,"0.01,65536,0.01"),_SCS("set_mass"),_SCS("get_mass")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"body/friction",PROPERTY_HINT_RANGE,"0.01,1,0.01"),_SCS("set_friction"),_SCS("get_friction")); + ADD_GROUP("Motion",""); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"engine_force",PROPERTY_HINT_RANGE,"0.00,1024.0,0.01"),_SCS("set_engine_force"),_SCS("get_engine_force")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"brake",PROPERTY_HINT_RANGE,"0.0,1.0,0.01"),_SCS("set_brake"),_SCS("get_brake")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"steering",PROPERTY_HINT_RANGE,"-180,180.0,0.01"),_SCS("set_steering"),_SCS("get_steering")); + ADD_GROUP("Mass",""); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"mass",PROPERTY_HINT_RANGE,"0.01,65536,0.01"),_SCS("set_mass"),_SCS("get_mass")); + ADD_PROPERTY( PropertyInfo(Variant::REAL,"friction",PROPERTY_HINT_RANGE,"0.01,1,0.01"),_SCS("set_friction"),_SCS("get_friction")); } diff --git a/scene/3d/vehicle_body.h b/scene/3d/vehicle_body.h index 3a516be716..cd627f8998 100644 --- a/scene/3d/vehicle_body.h +++ b/scene/3d/vehicle_body.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class VehicleBody; class VehicleWheel : public Spatial { - OBJ_TYPE(VehicleWheel,Spatial); + GDCLASS(VehicleWheel,Spatial); friend class VehicleBody; @@ -136,7 +136,7 @@ public: class VehicleBody : public PhysicsBody { - OBJ_TYPE(VehicleBody,PhysicsBody); + GDCLASS(VehicleBody,PhysicsBody); real_t mass; real_t friction; diff --git a/scene/3d/visibility_notifier.cpp b/scene/3d/visibility_notifier.cpp index f3b5cde0eb..0d9d2ad725 100644 --- a/scene/3d/visibility_notifier.cpp +++ b/scene/3d/visibility_notifier.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -60,7 +60,7 @@ void VisibilityNotifier::_exit_camera(Camera* p_camera){ } -void VisibilityNotifier::set_aabb(const AABB& p_aabb){ +void VisibilityNotifier::set_aabb(const Rect3& p_aabb){ if (aabb==p_aabb) return; @@ -74,7 +74,7 @@ void VisibilityNotifier::set_aabb(const AABB& p_aabb){ update_gizmo(); } -AABB VisibilityNotifier::get_aabb() const{ +Rect3 VisibilityNotifier::get_aabb() const{ return aabb; } @@ -109,11 +109,11 @@ bool VisibilityNotifier::is_on_screen() const { void VisibilityNotifier::_bind_methods(){ - ObjectTypeDB::bind_method(_MD("set_aabb","rect"),&VisibilityNotifier::set_aabb); - ObjectTypeDB::bind_method(_MD("get_aabb"),&VisibilityNotifier::get_aabb); - ObjectTypeDB::bind_method(_MD("is_on_screen"),&VisibilityNotifier::is_on_screen); + ClassDB::bind_method(_MD("set_aabb","rect"),&VisibilityNotifier::set_aabb); + ClassDB::bind_method(_MD("get_aabb"),&VisibilityNotifier::get_aabb); + ClassDB::bind_method(_MD("is_on_screen"),&VisibilityNotifier::is_on_screen); - ADD_PROPERTY( PropertyInfo(Variant::_AABB,"aabb"),_SCS("set_aabb"),_SCS("get_aabb")); + ADD_PROPERTY( PropertyInfo(Variant::RECT3,"aabb"),_SCS("set_aabb"),_SCS("get_aabb")); ADD_SIGNAL( MethodInfo("enter_camera",PropertyInfo(Variant::OBJECT,"camera",PROPERTY_HINT_RESOURCE_TYPE,"Camera")) ); ADD_SIGNAL( MethodInfo("exit_camera",PropertyInfo(Variant::OBJECT,"camera",PROPERTY_HINT_RESOURCE_TYPE,"Camera")) ); @@ -124,7 +124,7 @@ void VisibilityNotifier::_bind_methods(){ VisibilityNotifier::VisibilityNotifier() { - aabb=AABB(Vector3(-1,-1,-1),Vector3(2,2,2)); + aabb=Rect3(Vector3(-1,-1,-1),Vector3(2,2,2)); } @@ -267,12 +267,12 @@ void VisibilityEnabler::_node_removed(Node* p_node) { void VisibilityEnabler::_bind_methods(){ - ObjectTypeDB::bind_method(_MD("set_enabler","enabler","enabled"),&VisibilityEnabler::set_enabler); - ObjectTypeDB::bind_method(_MD("is_enabler_enabled","enabler"),&VisibilityEnabler::is_enabler_enabled); - ObjectTypeDB::bind_method(_MD("_node_removed"),&VisibilityEnabler::_node_removed); + ClassDB::bind_method(_MD("set_enabler","enabler","enabled"),&VisibilityEnabler::set_enabler); + ClassDB::bind_method(_MD("is_enabler_enabled","enabler"),&VisibilityEnabler::is_enabler_enabled); + ClassDB::bind_method(_MD("_node_removed"),&VisibilityEnabler::_node_removed); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"enabler/pause_animations"),_SCS("set_enabler"),_SCS("is_enabler_enabled"), ENABLER_PAUSE_ANIMATIONS ); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"enabler/freeze_bodies"),_SCS("set_enabler"),_SCS("is_enabler_enabled"), ENABLER_FREEZE_BODIES); + ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"pause_animations"),_SCS("set_enabler"),_SCS("is_enabler_enabled"), ENABLER_PAUSE_ANIMATIONS ); + ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"freeze_bodies"),_SCS("set_enabler"),_SCS("is_enabler_enabled"), ENABLER_FREEZE_BODIES); BIND_CONSTANT( ENABLER_FREEZE_BODIES ); BIND_CONSTANT( ENABLER_PAUSE_ANIMATIONS ); diff --git a/scene/3d/visibility_notifier.h b/scene/3d/visibility_notifier.h index a4709b7cf4..aa53e1bcd1 100644 --- a/scene/3d/visibility_notifier.h +++ b/scene/3d/visibility_notifier.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,11 +34,11 @@ class Camera; class VisibilityNotifier : public Spatial { - OBJ_TYPE(VisibilityNotifier,Spatial); + GDCLASS(VisibilityNotifier,Spatial); Set<Camera*> cameras; - AABB aabb; + Rect3 aabb; protected: @@ -54,8 +54,8 @@ friend class SpatialIndexer; public: - void set_aabb(const AABB& p_aabb); - AABB get_aabb() const; + void set_aabb(const Rect3& p_aabb); + Rect3 get_aabb() const; bool is_on_screen() const; VisibilityNotifier(); @@ -64,7 +64,7 @@ public: class VisibilityEnabler : public VisibilityNotifier { - OBJ_TYPE(VisibilityEnabler,VisibilityNotifier); + GDCLASS(VisibilityEnabler,VisibilityNotifier); public: enum Enabler { diff --git a/scene/3d/visual_instance.cpp b/scene/3d/visual_instance.cpp index b4f7a4e5b4..466c273154 100644 --- a/scene/3d/visual_instance.cpp +++ b/scene/3d/visual_instance.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,15 +31,23 @@ #include "servers/visual_server.h" #include "room_instance.h" #include "scene/scene_string_names.h" -#include "baked_light_instance.h" #include "skeleton.h" -AABB VisualInstance::get_transformed_aabb() const { +Rect3 VisualInstance::get_transformed_aabb() const { return get_global_transform().xform( get_aabb() ); } +void VisualInstance::_update_visibility() { + + if (!is_inside_tree()) + return; + + _change_notify("visible"); + VS::get_singleton()->instance_set_visible(get_instance(),is_visible()); +} + void VisualInstance::_notification(int p_what) { @@ -52,7 +60,7 @@ void VisualInstance::_notification(int p_what) { Room *room=NULL; bool is_geom = cast_to<GeometryInstance>(); - while(parent) { + /* while(parent) { room = parent->cast_to<Room>(); if (room) @@ -64,7 +72,7 @@ void VisualInstance::_notification(int p_what) { } parent=parent->get_parent_spatial(); - } + }*/ @@ -80,6 +88,8 @@ void VisualInstance::_notification(int p_what) { */ VisualServer::get_singleton()->instance_set_scenario( instance, get_world()->get_scenario() ); + _update_visibility(); + } break; case NOTIFICATION_TRANSFORM_CHANGED: { @@ -92,10 +102,14 @@ void VisualInstance::_notification(int p_what) { VisualServer::get_singleton()->instance_set_scenario( instance, RID() ); VisualServer::get_singleton()->instance_set_room(instance,RID()); VisualServer::get_singleton()->instance_attach_skeleton( instance, RID() ); - VS::get_singleton()->instance_geometry_set_baked_light_sampler(instance, RID() ); + // VS::get_singleton()->instance_geometry_set_baked_light_sampler(instance, RID() ); + } break; + case NOTIFICATION_VISIBILITY_CHANGED: { + _update_visibility(); } break; + } } @@ -123,14 +137,14 @@ uint32_t VisualInstance::get_layer_mask() const { void VisualInstance::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_get_visual_instance_rid"),&VisualInstance::_get_visual_instance_rid); - ObjectTypeDB::bind_method(_MD("set_base","base"), &VisualInstance::set_base); - ObjectTypeDB::bind_method(_MD("set_layer_mask","mask"), &VisualInstance::set_layer_mask); - ObjectTypeDB::bind_method(_MD("get_layer_mask"), &VisualInstance::get_layer_mask); + ClassDB::bind_method(_MD("_get_visual_instance_rid"),&VisualInstance::_get_visual_instance_rid); + ClassDB::bind_method(_MD("set_base","base"), &VisualInstance::set_base); + ClassDB::bind_method(_MD("set_layer_mask","mask"), &VisualInstance::set_layer_mask); + ClassDB::bind_method(_MD("get_layer_mask"), &VisualInstance::get_layer_mask); - ObjectTypeDB::bind_method(_MD("get_transformed_aabb"), &VisualInstance::get_transformed_aabb); + ClassDB::bind_method(_MD("get_transformed_aabb"), &VisualInstance::get_transformed_aabb); - ADD_PROPERTY( PropertyInfo( Variant::INT, "layers",PROPERTY_HINT_ALL_FLAGS), _SCS("set_layer_mask"), _SCS("get_layer_mask")); + ADD_PROPERTY( PropertyInfo( Variant::INT, "layers",PROPERTY_HINT_LAYERS_3D_RENDER), _SCS("set_layer_mask"), _SCS("get_layer_mask")); } @@ -172,98 +186,73 @@ Ref<Material> GeometryInstance::get_material_override() const{ -void GeometryInstance::set_draw_range_begin(float p_dist){ +void GeometryInstance::set_lod_min_distance(float p_dist){ - draw_begin=p_dist; - VS::get_singleton()->instance_geometry_set_draw_range(get_instance(),draw_begin,draw_end); + lod_min_distance=p_dist; + VS::get_singleton()->instance_geometry_set_draw_range(get_instance(),lod_min_distance,lod_max_distance,lod_min_hysteresis,lod_max_hysteresis); } -float GeometryInstance::get_draw_range_begin() const{ +float GeometryInstance::get_lod_min_distance() const{ - return draw_begin; + return lod_min_distance; } -void GeometryInstance::set_draw_range_end(float p_dist) { +void GeometryInstance::set_lod_max_distance(float p_dist) { - draw_end=p_dist; - VS::get_singleton()->instance_geometry_set_draw_range(get_instance(),draw_begin,draw_end); + lod_max_distance=p_dist; + VS::get_singleton()->instance_geometry_set_draw_range(get_instance(),lod_min_distance,lod_max_distance,lod_min_hysteresis,lod_max_hysteresis); } -float GeometryInstance::get_draw_range_end() const { +float GeometryInstance::get_lod_max_distance() const { - return draw_end; + return lod_max_distance; } -void GeometryInstance::_notification(int p_what) { - - if (p_what==NOTIFICATION_ENTER_WORLD) { +void GeometryInstance::set_lod_min_hysteresis(float p_dist){ - if (flags[FLAG_USE_BAKED_LIGHT]) { + lod_min_hysteresis=p_dist; + VS::get_singleton()->instance_geometry_set_draw_range(get_instance(),lod_min_distance,lod_max_distance,lod_min_hysteresis,lod_max_hysteresis); +} - _find_baked_light(); - } +float GeometryInstance::get_lod_min_hysteresis() const{ - _update_visibility(); + return lod_min_hysteresis; +} - } else if (p_what==NOTIFICATION_EXIT_WORLD) { - if (flags[FLAG_USE_BAKED_LIGHT]) { +void GeometryInstance::set_lod_max_hysteresis(float p_dist) { - if (baked_light_instance) { - baked_light_instance->disconnect(SceneStringNames::get_singleton()->baked_light_changed,this,SceneStringNames::get_singleton()->_baked_light_changed); - baked_light_instance=NULL; - } - _baked_light_changed(); + lod_max_hysteresis=p_dist; + VS::get_singleton()->instance_geometry_set_draw_range(get_instance(),lod_min_distance,lod_max_distance,lod_min_hysteresis,lod_max_hysteresis); - } +} - } if (p_what==NOTIFICATION_VISIBILITY_CHANGED) { +float GeometryInstance::get_lod_max_hysteresis() const { - _update_visibility(); - } + return lod_max_hysteresis; +} -} +void GeometryInstance::_notification(int p_what) { -void GeometryInstance::_baked_light_changed() { + if (p_what==NOTIFICATION_ENTER_WORLD) { - if (!baked_light_instance) - VS::get_singleton()->instance_geometry_set_baked_light(get_instance(),RID()); - else - VS::get_singleton()->instance_geometry_set_baked_light(get_instance(),baked_light_instance->get_baked_light_instance()); + if (flags[FLAG_USE_BAKED_LIGHT]) { -} + } -void GeometryInstance::_find_baked_light() { - Node *n=get_parent(); - while(n) { + } else if (p_what==NOTIFICATION_EXIT_WORLD) { - BakedLightInstance *bl=n->cast_to<BakedLightInstance>(); - if (bl) { + if (flags[FLAG_USE_BAKED_LIGHT]) { - baked_light_instance=bl; - baked_light_instance->connect(SceneStringNames::get_singleton()->baked_light_changed,this,SceneStringNames::get_singleton()->_baked_light_changed); - _baked_light_changed(); - return; } - n=n->get_parent(); } - _baked_light_changed(); -} - -void GeometryInstance::_update_visibility() { - - if (!is_inside_tree()) - return; - - _change_notify("geometry/visible"); - VS::get_singleton()->instance_geometry_set_flag(get_instance(),VS::INSTANCE_FLAG_VISIBLE,is_visible() && flags[FLAG_VISIBLE]); } void GeometryInstance::set_flag(Flags p_flag,bool p_value) { @@ -283,22 +272,8 @@ void GeometryInstance::set_flag(Flags p_flag,bool p_value) { flags[p_flag]=p_value; VS::get_singleton()->instance_geometry_set_flag(get_instance(),(VS::InstanceFlags)p_flag,p_value); - if (p_flag==FLAG_VISIBLE) { - _update_visibility(); - } if (p_flag==FLAG_USE_BAKED_LIGHT) { - if (is_inside_world()) { - if (!p_value) { - if (baked_light_instance) { - baked_light_instance->disconnect(SceneStringNames::get_singleton()->baked_light_changed,this,SceneStringNames::get_singleton()->_baked_light_changed); - baked_light_instance=NULL; - } - _baked_light_changed(); - } else { - _find_baked_light(); - } - } } } @@ -331,17 +306,8 @@ GeometryInstance::ShadowCastingSetting GeometryInstance::get_cast_shadows_settin return shadow_casting_setting; } -void GeometryInstance::set_baked_light_texture_id(int p_id) { - baked_light_texture_id=p_id; - VS::get_singleton()->instance_geometry_set_baked_light_texture_index(get_instance(),baked_light_texture_id); -} - -int GeometryInstance::get_baked_light_texture_id() const{ - - return baked_light_texture_id; -} void GeometryInstance::set_extra_cull_margin(float p_margin) { @@ -357,50 +323,53 @@ float GeometryInstance::get_extra_cull_margin() const{ void GeometryInstance::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_material_override","material"), &GeometryInstance::set_material_override); - ObjectTypeDB::bind_method(_MD("get_material_override"), &GeometryInstance::get_material_override); + ClassDB::bind_method(_MD("set_material_override","material"), &GeometryInstance::set_material_override); + ClassDB::bind_method(_MD("get_material_override"), &GeometryInstance::get_material_override); - ObjectTypeDB::bind_method(_MD("set_flag","flag","value"), &GeometryInstance::set_flag); - ObjectTypeDB::bind_method(_MD("get_flag","flag"), &GeometryInstance::get_flag); + ClassDB::bind_method(_MD("set_flag","flag","value"), &GeometryInstance::set_flag); + ClassDB::bind_method(_MD("get_flag","flag"), &GeometryInstance::get_flag); - ObjectTypeDB::bind_method(_MD("set_cast_shadows_setting", "shadow_casting_setting"), &GeometryInstance::set_cast_shadows_setting); - ObjectTypeDB::bind_method(_MD("get_cast_shadows_setting"), &GeometryInstance::get_cast_shadows_setting); + ClassDB::bind_method(_MD("set_cast_shadows_setting", "shadow_casting_setting"), &GeometryInstance::set_cast_shadows_setting); + ClassDB::bind_method(_MD("get_cast_shadows_setting"), &GeometryInstance::get_cast_shadows_setting); - ObjectTypeDB::bind_method(_MD("set_draw_range_begin","mode"), &GeometryInstance::set_draw_range_begin); - ObjectTypeDB::bind_method(_MD("get_draw_range_begin"), &GeometryInstance::get_draw_range_begin); + ClassDB::bind_method(_MD("set_lod_max_hysteresis","mode"), &GeometryInstance::set_lod_max_hysteresis); + ClassDB::bind_method(_MD("get_lod_max_hysteresis"), &GeometryInstance::get_lod_max_hysteresis); - ObjectTypeDB::bind_method(_MD("set_draw_range_end","mode"), &GeometryInstance::set_draw_range_end); - ObjectTypeDB::bind_method(_MD("get_draw_range_end"), &GeometryInstance::get_draw_range_end); + ClassDB::bind_method(_MD("set_lod_max_distance","mode"), &GeometryInstance::set_lod_max_distance); + ClassDB::bind_method(_MD("get_lod_max_distance"), &GeometryInstance::get_lod_max_distance); - ObjectTypeDB::bind_method(_MD("set_baked_light_texture_id","id"), &GeometryInstance::set_baked_light_texture_id); - ObjectTypeDB::bind_method(_MD("get_baked_light_texture_id"), &GeometryInstance::get_baked_light_texture_id); + ClassDB::bind_method(_MD("set_lod_min_hysteresis","mode"), &GeometryInstance::set_lod_min_hysteresis); + ClassDB::bind_method(_MD("get_lod_min_hysteresis"), &GeometryInstance::get_lod_min_hysteresis); - ObjectTypeDB::bind_method(_MD("set_extra_cull_margin","margin"), &GeometryInstance::set_extra_cull_margin); - ObjectTypeDB::bind_method(_MD("get_extra_cull_margin"), &GeometryInstance::get_extra_cull_margin); + ClassDB::bind_method(_MD("set_lod_min_distance","mode"), &GeometryInstance::set_lod_min_distance); + ClassDB::bind_method(_MD("get_lod_min_distance"), &GeometryInstance::get_lod_min_distance); - ObjectTypeDB::bind_method(_MD("get_aabb"),&GeometryInstance::get_aabb); - ObjectTypeDB::bind_method(_MD("_baked_light_changed"), &GeometryInstance::_baked_light_changed); + ClassDB::bind_method(_MD("set_extra_cull_margin","margin"), &GeometryInstance::set_extra_cull_margin); + ClassDB::bind_method(_MD("get_extra_cull_margin"), &GeometryInstance::get_extra_cull_margin); - ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "geometry/visible"), _SCS("set_flag"), _SCS("get_flag"),FLAG_VISIBLE); - ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "geometry/material_override",PROPERTY_HINT_RESOURCE_TYPE,"Material"), _SCS("set_material_override"), _SCS("get_material_override")); - ADD_PROPERTY(PropertyInfo(Variant::INT, "geometry/cast_shadow", PROPERTY_HINT_ENUM, "Off,On,Double-Sided,Shadows Only"), _SCS("set_cast_shadows_setting"), _SCS("get_cast_shadows_setting")); - ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "geometry/receive_shadows"), _SCS("set_flag"), _SCS("get_flag"),FLAG_RECEIVE_SHADOWS); - ADD_PROPERTY( PropertyInfo( Variant::INT, "geometry/range_begin",PROPERTY_HINT_RANGE,"0,32768,0.01"), _SCS("set_draw_range_begin"), _SCS("get_draw_range_begin")); - ADD_PROPERTY( PropertyInfo( Variant::INT, "geometry/range_end",PROPERTY_HINT_RANGE,"0,32768,0.01"), _SCS("set_draw_range_end"), _SCS("get_draw_range_end")); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "geometry/extra_cull_margin",PROPERTY_HINT_RANGE,"0,16384,0"), _SCS("set_extra_cull_margin"), _SCS("get_extra_cull_margin")); - ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "geometry/billboard"), _SCS("set_flag"), _SCS("get_flag"),FLAG_BILLBOARD); - ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "geometry/billboard_y"), _SCS("set_flag"), _SCS("get_flag"),FLAG_BILLBOARD_FIX_Y); - ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "geometry/depth_scale"), _SCS("set_flag"), _SCS("get_flag"),FLAG_DEPH_SCALE); - ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "geometry/visible_in_all_rooms"), _SCS("set_flag"), _SCS("get_flag"),FLAG_VISIBLE_IN_ALL_ROOMS); - ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "geometry/use_baked_light"), _SCS("set_flag"), _SCS("get_flag"),FLAG_USE_BAKED_LIGHT); - ADD_PROPERTY( PropertyInfo( Variant::INT, "geometry/baked_light_tex_id"), _SCS("set_baked_light_texture_id"), _SCS("get_baked_light_texture_id")); + ClassDB::bind_method(_MD("get_aabb"),&GeometryInstance::get_aabb); + + + ADD_GROUP("Geometry",""); + ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "material_override",PROPERTY_HINT_RESOURCE_TYPE,"Material"), _SCS("set_material_override"), _SCS("get_material_override")); + ADD_PROPERTY(PropertyInfo(Variant::INT, "cast_shadow", PROPERTY_HINT_ENUM, "Off,On,Double-Sided,Shadows Only"), _SCS("set_cast_shadows_setting"), _SCS("get_cast_shadows_setting")); + ADD_PROPERTY( PropertyInfo( Variant::REAL, "extra_cull_margin",PROPERTY_HINT_RANGE,"0,16384,0"), _SCS("set_extra_cull_margin"), _SCS("get_extra_cull_margin")); + ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "use_as_billboard"), _SCS("set_flag"), _SCS("get_flag"),FLAG_BILLBOARD); + ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "use_as_y_billboard"), _SCS("set_flag"), _SCS("get_flag"),FLAG_BILLBOARD_FIX_Y); + ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "use_depth_scale"), _SCS("set_flag"), _SCS("get_flag"),FLAG_DEPH_SCALE); + ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "visible_in_all_rooms"), _SCS("set_flag"), _SCS("get_flag"),FLAG_VISIBLE_IN_ALL_ROOMS); + ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "use_in_baked_light"), _SCS("set_flag"), _SCS("get_flag"),FLAG_USE_BAKED_LIGHT); + + ADD_GROUP("LOD","lod_"); + ADD_PROPERTY( PropertyInfo( Variant::INT, "lod_min_distance",PROPERTY_HINT_RANGE,"0,32768,0.01"), _SCS("set_lod_min_distance"), _SCS("get_lod_min_distance")); + ADD_PROPERTY( PropertyInfo( Variant::INT, "lod_min_hysteresis",PROPERTY_HINT_RANGE,"0,32768,0.01"), _SCS("set_lod_min_hysteresis"), _SCS("get_lod_min_hysteresis")); + ADD_PROPERTY( PropertyInfo( Variant::INT, "lod_max_distance",PROPERTY_HINT_RANGE,"0,32768,0.01"), _SCS("set_lod_max_distance"), _SCS("get_lod_max_distance")); + ADD_PROPERTY( PropertyInfo( Variant::INT, "lod_max_hysteresis",PROPERTY_HINT_RANGE,"0,32768,0.01"), _SCS("set_lod_max_hysteresis"), _SCS("get_lod_max_hysteresis")); // ADD_SIGNAL( MethodInfo("visibility_changed")); - BIND_CONSTANT(FLAG_VISIBLE ); BIND_CONSTANT(FLAG_CAST_SHADOW ); - BIND_CONSTANT(FLAG_RECEIVE_SHADOWS ); BIND_CONSTANT(FLAG_BILLBOARD ); BIND_CONSTANT(FLAG_BILLBOARD_FIX_Y ); BIND_CONSTANT(FLAG_DEPH_SCALE ); @@ -415,20 +384,21 @@ void GeometryInstance::_bind_methods() { } GeometryInstance::GeometryInstance() { - draw_begin=0; - draw_end=0; + lod_min_distance=0; + lod_max_distance=0; + lod_min_hysteresis=0; + lod_max_hysteresis=0; + for(int i=0;i<FLAG_MAX;i++) { flags[i]=false; } - flags[FLAG_VISIBLE]=true; + flags[FLAG_CAST_SHADOW]=true; - flags[FLAG_RECEIVE_SHADOWS]=true; + shadow_casting_setting=SHADOW_CASTING_SETTING_ON; - baked_light_instance=NULL; - baked_light_texture_id=0; extra_cull_margin=0; - VS::get_singleton()->instance_geometry_set_baked_light_texture_index(get_instance(),0); +// VS::get_singleton()->instance_geometry_set_baked_light_texture_index(get_instance(),0); } diff --git a/scene/3d/visual_instance.h b/scene/3d/visual_instance.h index e286d5fa88..5955dae236 100644 --- a/scene/3d/visual_instance.h +++ b/scene/3d/visual_instance.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -38,7 +38,7 @@ */ class VisualInstance : public Spatial { - OBJ_TYPE( VisualInstance, Spatial ); + GDCLASS( VisualInstance, Spatial ); OBJ_CATEGORY("3D Visual Nodes"); RID instance; @@ -48,8 +48,10 @@ class VisualInstance : public Spatial { RID _get_visual_instance_rid() const; + protected: + void _update_visibility(); void _notification(int p_what); static void _bind_methods(); @@ -63,10 +65,10 @@ public: }; RID get_instance() const; - virtual AABB get_aabb() const=0; - virtual DVector<Face3> get_faces(uint32_t p_usage_flags) const=0; + virtual Rect3 get_aabb() const=0; + virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const=0; - virtual AABB get_transformed_aabb() const; // helper + virtual Rect3 get_transformed_aabb() const; // helper void set_base(const RID& p_base); @@ -79,17 +81,15 @@ public: }; -class BakedLightInstance; +class BakedLight; class GeometryInstance : public VisualInstance { - OBJ_TYPE( GeometryInstance, VisualInstance ); + GDCLASS( GeometryInstance, VisualInstance ); public: enum Flags { - FLAG_VISIBLE=VS::INSTANCE_FLAG_VISIBLE, FLAG_CAST_SHADOW=VS::INSTANCE_FLAG_CAST_SHADOW, - FLAG_RECEIVE_SHADOWS=VS::INSTANCE_FLAG_RECEIVE_SHADOWS, FLAG_BILLBOARD=VS::INSTANCE_FLAG_BILLBOARD, FLAG_BILLBOARD_FIX_Y=VS::INSTANCE_FLAG_BILLBOARD_FIX_Y, FLAG_DEPH_SCALE=VS::INSTANCE_FLAG_DEPH_SCALE, @@ -98,6 +98,7 @@ public: FLAG_MAX=VS::INSTANCE_FLAG_MAX, }; + enum ShadowCastingSetting { SHADOW_CASTING_SETTING_OFF=VS::SHADOW_CASTING_SETTING_OFF, SHADOW_CASTING_SETTING_ON = VS::SHADOW_CASTING_SETTING_ON, @@ -110,15 +111,13 @@ private: bool flags[FLAG_MAX]; ShadowCastingSetting shadow_casting_setting; Ref<Material> material_override; - float draw_begin; - float draw_end; - void _find_baked_light(); - BakedLightInstance *baked_light_instance; - int baked_light_texture_id; + float lod_min_distance; + float lod_max_distance; + float lod_min_hysteresis; + float lod_max_hysteresis; + float extra_cull_margin; - void _baked_light_changed(); - void _update_visibility(); protected: void _notification(int p_what); @@ -131,18 +130,21 @@ public: void set_cast_shadows_setting(ShadowCastingSetting p_shadow_casting_setting); ShadowCastingSetting get_cast_shadows_setting() const; - void set_draw_range_begin(float p_dist); - float get_draw_range_begin() const; + void set_lod_min_distance(float p_dist); + float get_lod_min_distance() const; + + void set_lod_max_distance(float p_dist); + float get_lod_max_distance() const; - void set_draw_range_end(float p_dist); - float get_draw_range_end() const; + void set_lod_min_hysteresis(float p_dist); + float get_lod_min_hysteresis() const; + + void set_lod_max_hysteresis(float p_dist); + float get_lod_max_hysteresis() const; void set_material_override(const Ref<Material>& p_material); Ref<Material> get_material_override() const; - void set_baked_light_texture_id(int p_id); - int get_baked_light_texture_id() const; - void set_extra_cull_margin(float p_margin); float get_extra_cull_margin() const; diff --git a/scene/animation/animation_cache.cpp b/scene/animation/animation_cache.cpp index 113e2c2278..4ab6e2e575 100644 --- a/scene/animation/animation_cache.cpp +++ b/scene/animation/animation_cache.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -292,7 +292,7 @@ void AnimationCache::set_all(float p_time, float p_delta) { Vector3 loc,scale; Quat rot; animation->transform_track_interpolate(i,p_time,&loc,&rot,&scale); - Transform tr( Matrix3(rot), loc ); + Transform tr( Basis(rot), loc ); tr.basis.scale(scale); set_track_transform(i,tr); @@ -368,8 +368,8 @@ void AnimationCache::set_animation(const Ref<Animation>& p_animation) { void AnimationCache::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_node_exit_tree"),&AnimationCache::_node_exit_tree); - ObjectTypeDB::bind_method(_MD("_animation_changed"),&AnimationCache::_animation_changed); + ClassDB::bind_method(_MD("_node_exit_tree"),&AnimationCache::_node_exit_tree); + ClassDB::bind_method(_MD("_animation_changed"),&AnimationCache::_animation_changed); } void AnimationCache::set_root(Node* p_root) { diff --git a/scene/animation/animation_cache.h b/scene/animation/animation_cache.h index c9b4ff298c..75e004c811 100644 --- a/scene/animation/animation_cache.h +++ b/scene/animation/animation_cache.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class AnimationCache : public Object { - OBJ_TYPE(AnimationCache,Object); + GDCLASS(AnimationCache,Object); struct Path { diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 30af9b0094..3f41a790b4 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -214,14 +214,14 @@ void AnimationPlayer::_notification(int p_what) { set_autoplay(""); //this line is the fix for autoplay issues with animatio } } break; - case NOTIFICATION_PROCESS: { + case NOTIFICATION_INTERNAL_PROCESS: { if (animation_process_mode==ANIMATION_PROCESS_FIXED) break; if (processing) _animation_process( get_process_delta_time() ); } break; - case NOTIFICATION_FIXED_PROCESS: { + case NOTIFICATION_INTERNAL_FIXED_PROCESS: { if (animation_process_mode==ANIMATION_PROCESS_IDLE) break; @@ -465,7 +465,7 @@ void AnimationPlayer::_animation_process_animation(AnimationData* p_anim,float p ERR_PRINTS("Position key at time "+rtos(p_time)+" in Animation Track '"+String(pa->owner->path)+"' not of type Vector2()"); } #endif - static_cast<Node2D*>(pa->object)->set_pos(value); + static_cast<Node2D*>(pa->object)->set_position(value); } break; case SP_NODE2D_ROT: { #ifdef DEBUG_ENABLED @@ -474,7 +474,7 @@ void AnimationPlayer::_animation_process_animation(AnimationData* p_anim,float p } #endif - static_cast<Node2D*>(pa->object)->set_rot(Math::deg2rad(value)); + static_cast<Node2D*>(pa->object)->set_rotation(Math::deg2rad(value)); } break; case SP_NODE2D_SCALE: { #ifdef DEBUG_ENABLED @@ -679,7 +679,7 @@ void AnimationPlayer::_animation_update_transforms() { ERR_PRINTS("Position key at time "+rtos(playback.current.pos)+" in Animation '"+get_current_animation()+"', Track '"+String(pa->owner->path)+"' not of type Vector2()"); } #endif - static_cast<Node2D*>(pa->object)->set_pos(pa->value_accum); + static_cast<Node2D*>(pa->object)->set_position(pa->value_accum); } break; case SP_NODE2D_ROT: { #ifdef DEBUG_ENABLED @@ -688,7 +688,7 @@ void AnimationPlayer::_animation_update_transforms() { } #endif - static_cast<Node2D*>(pa->object)->set_rot(Math::deg2rad(pa->value_accum)); + static_cast<Node2D*>(pa->object)->set_rotation(Math::deg2rad(pa->value_accum)); } break; case SP_NODE2D_SCALE: { #ifdef DEBUG_ENABLED @@ -733,7 +733,7 @@ void AnimationPlayer::_animation_process(float p_delta) { playing = false; _set_process(false); end_notify=false; - emit_signal(SceneStringNames::get_singleton()->finished); + emit_signal(SceneStringNames::get_singleton()->animation_finished,playback.assigned); } } @@ -1231,8 +1231,8 @@ void AnimationPlayer::_set_process(bool p_process,bool p_force) { switch(animation_process_mode) { - case ANIMATION_PROCESS_FIXED: set_fixed_process(p_process && active); break; - case ANIMATION_PROCESS_IDLE: set_process(p_process && active); break; + case ANIMATION_PROCESS_FIXED: set_fixed_process_internal(p_process && active); break; + case ANIMATION_PROCESS_IDLE: set_process_internal(p_process && active); break; } processing=p_process; @@ -1291,68 +1291,69 @@ void AnimationPlayer::get_argument_options(const StringName& p_function,int p_id void AnimationPlayer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_node_removed"),&AnimationPlayer::_node_removed); - ObjectTypeDB::bind_method(_MD("_animation_changed"),&AnimationPlayer::_animation_changed); + ClassDB::bind_method(_MD("_node_removed"),&AnimationPlayer::_node_removed); + ClassDB::bind_method(_MD("_animation_changed"),&AnimationPlayer::_animation_changed); - ObjectTypeDB::bind_method(_MD("add_animation","name","animation:Animation"),&AnimationPlayer::add_animation); - ObjectTypeDB::bind_method(_MD("remove_animation","name"),&AnimationPlayer::remove_animation); - ObjectTypeDB::bind_method(_MD("rename_animation","name","newname"),&AnimationPlayer::rename_animation); - ObjectTypeDB::bind_method(_MD("has_animation","name"),&AnimationPlayer::has_animation); - ObjectTypeDB::bind_method(_MD("get_animation:Animation","name"),&AnimationPlayer::get_animation); - ObjectTypeDB::bind_method(_MD("get_animation_list"),&AnimationPlayer::_get_animation_list); + ClassDB::bind_method(_MD("add_animation","name","animation:Animation"),&AnimationPlayer::add_animation); + ClassDB::bind_method(_MD("remove_animation","name"),&AnimationPlayer::remove_animation); + ClassDB::bind_method(_MD("rename_animation","name","newname"),&AnimationPlayer::rename_animation); + ClassDB::bind_method(_MD("has_animation","name"),&AnimationPlayer::has_animation); + ClassDB::bind_method(_MD("get_animation:Animation","name"),&AnimationPlayer::get_animation); + ClassDB::bind_method(_MD("get_animation_list"),&AnimationPlayer::_get_animation_list); - ObjectTypeDB::bind_method(_MD("animation_set_next", "anim_from", "anim_to"), &AnimationPlayer::animation_set_next); - ObjectTypeDB::bind_method(_MD("animation_get_next", "anim_from"), &AnimationPlayer::animation_get_next); + ClassDB::bind_method(_MD("animation_set_next", "anim_from", "anim_to"), &AnimationPlayer::animation_set_next); + ClassDB::bind_method(_MD("animation_get_next", "anim_from"), &AnimationPlayer::animation_get_next); - ObjectTypeDB::bind_method(_MD("set_blend_time","anim_from","anim_to","sec"),&AnimationPlayer::set_blend_time); - ObjectTypeDB::bind_method(_MD("get_blend_time","anim_from","anim_to"),&AnimationPlayer::get_blend_time); + ClassDB::bind_method(_MD("set_blend_time","anim_from","anim_to","sec"),&AnimationPlayer::set_blend_time); + ClassDB::bind_method(_MD("get_blend_time","anim_from","anim_to"),&AnimationPlayer::get_blend_time); - ObjectTypeDB::bind_method(_MD("set_default_blend_time","sec"),&AnimationPlayer::set_default_blend_time); - ObjectTypeDB::bind_method(_MD("get_default_blend_time"),&AnimationPlayer::get_default_blend_time); + ClassDB::bind_method(_MD("set_default_blend_time","sec"),&AnimationPlayer::set_default_blend_time); + ClassDB::bind_method(_MD("get_default_blend_time"),&AnimationPlayer::get_default_blend_time); - ObjectTypeDB::bind_method(_MD("play","name","custom_blend","custom_speed","from_end"),&AnimationPlayer::play,DEFVAL(""),DEFVAL(-1),DEFVAL(1.0),DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("play_backwards","name","custom_blend"),&AnimationPlayer::play_backwards,DEFVAL(""),DEFVAL(-1)); - ObjectTypeDB::bind_method(_MD("stop","reset"),&AnimationPlayer::stop,DEFVAL(true)); - ObjectTypeDB::bind_method(_MD("stop_all"),&AnimationPlayer::stop_all); - ObjectTypeDB::bind_method(_MD("is_playing"),&AnimationPlayer::is_playing); - ObjectTypeDB::bind_method(_MD("set_current_animation","anim"),&AnimationPlayer::set_current_animation); - ObjectTypeDB::bind_method(_MD("get_current_animation"),&AnimationPlayer::get_current_animation); - ObjectTypeDB::bind_method(_MD("queue","name"),&AnimationPlayer::queue); - ObjectTypeDB::bind_method(_MD("clear_queue"),&AnimationPlayer::clear_queue); + ClassDB::bind_method(_MD("play","name","custom_blend","custom_speed","from_end"),&AnimationPlayer::play,DEFVAL(""),DEFVAL(-1),DEFVAL(1.0),DEFVAL(false)); + ClassDB::bind_method(_MD("play_backwards","name","custom_blend"),&AnimationPlayer::play_backwards,DEFVAL(""),DEFVAL(-1)); + ClassDB::bind_method(_MD("stop","reset"),&AnimationPlayer::stop,DEFVAL(true)); + ClassDB::bind_method(_MD("stop_all"),&AnimationPlayer::stop_all); + ClassDB::bind_method(_MD("is_playing"),&AnimationPlayer::is_playing); + ClassDB::bind_method(_MD("set_current_animation","anim"),&AnimationPlayer::set_current_animation); + ClassDB::bind_method(_MD("get_current_animation"),&AnimationPlayer::get_current_animation); + ClassDB::bind_method(_MD("queue","name"),&AnimationPlayer::queue); + ClassDB::bind_method(_MD("clear_queue"),&AnimationPlayer::clear_queue); - ObjectTypeDB::bind_method(_MD("set_active","active"),&AnimationPlayer::set_active); - ObjectTypeDB::bind_method(_MD("is_active"),&AnimationPlayer::is_active); + ClassDB::bind_method(_MD("set_active","active"),&AnimationPlayer::set_active); + ClassDB::bind_method(_MD("is_active"),&AnimationPlayer::is_active); - ObjectTypeDB::bind_method(_MD("set_speed","speed"),&AnimationPlayer::set_speed); - ObjectTypeDB::bind_method(_MD("get_speed"),&AnimationPlayer::get_speed); + ClassDB::bind_method(_MD("set_speed","speed"),&AnimationPlayer::set_speed); + ClassDB::bind_method(_MD("get_speed"),&AnimationPlayer::get_speed); - ObjectTypeDB::bind_method(_MD("set_autoplay","name"),&AnimationPlayer::set_autoplay); - ObjectTypeDB::bind_method(_MD("get_autoplay"),&AnimationPlayer::get_autoplay); + ClassDB::bind_method(_MD("set_autoplay","name"),&AnimationPlayer::set_autoplay); + ClassDB::bind_method(_MD("get_autoplay"),&AnimationPlayer::get_autoplay); - ObjectTypeDB::bind_method(_MD("set_root","path"),&AnimationPlayer::set_root); - ObjectTypeDB::bind_method(_MD("get_root"),&AnimationPlayer::get_root); + ClassDB::bind_method(_MD("set_root","path"),&AnimationPlayer::set_root); + ClassDB::bind_method(_MD("get_root"),&AnimationPlayer::get_root); - ObjectTypeDB::bind_method(_MD("seek","pos_sec","update"),&AnimationPlayer::seek,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("get_pos"),&AnimationPlayer::get_current_animation_pos); + ClassDB::bind_method(_MD("seek","pos_sec","update"),&AnimationPlayer::seek,DEFVAL(false)); + ClassDB::bind_method(_MD("get_pos"),&AnimationPlayer::get_current_animation_pos); - ObjectTypeDB::bind_method(_MD("find_animation","animation:Animation"),&AnimationPlayer::find_animation); + ClassDB::bind_method(_MD("find_animation","animation:Animation"),&AnimationPlayer::find_animation); - ObjectTypeDB::bind_method(_MD("clear_caches"),&AnimationPlayer::clear_caches); + ClassDB::bind_method(_MD("clear_caches"),&AnimationPlayer::clear_caches); - ObjectTypeDB::bind_method(_MD("set_animation_process_mode","mode"),&AnimationPlayer::set_animation_process_mode); - ObjectTypeDB::bind_method(_MD("get_animation_process_mode"),&AnimationPlayer::get_animation_process_mode); + ClassDB::bind_method(_MD("set_animation_process_mode","mode"),&AnimationPlayer::set_animation_process_mode); + ClassDB::bind_method(_MD("get_animation_process_mode"),&AnimationPlayer::get_animation_process_mode); - ObjectTypeDB::bind_method(_MD("get_current_animation_pos"),&AnimationPlayer::get_current_animation_pos); - ObjectTypeDB::bind_method(_MD("get_current_animation_length"),&AnimationPlayer::get_current_animation_length); + ClassDB::bind_method(_MD("get_current_animation_pos"),&AnimationPlayer::get_current_animation_pos); + ClassDB::bind_method(_MD("get_current_animation_length"),&AnimationPlayer::get_current_animation_length); - ObjectTypeDB::bind_method(_MD("advance","delta"),&AnimationPlayer::advance); + ClassDB::bind_method(_MD("advance","delta"),&AnimationPlayer::advance); - ADD_PROPERTY( PropertyInfo( Variant::INT, "playback/process_mode", PROPERTY_HINT_ENUM, "Fixed,Idle"), _SCS("set_animation_process_mode"), _SCS("get_animation_process_mode")); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "playback/default_blend_time", PROPERTY_HINT_RANGE, "0,4096,0.01"), _SCS("set_default_blend_time"), _SCS("get_default_blend_time")); - ADD_PROPERTY( PropertyInfo( Variant::NODE_PATH, "root/root"), _SCS("set_root"), _SCS("get_root")); + ADD_GROUP("Playback","playback_"); + ADD_PROPERTY( PropertyInfo( Variant::INT, "playback_process_mode", PROPERTY_HINT_ENUM, "Fixed,Idle"), _SCS("set_animation_process_mode"), _SCS("get_animation_process_mode")); + ADD_PROPERTY( PropertyInfo( Variant::REAL, "playback_default_blend_time", PROPERTY_HINT_RANGE, "0,4096,0.01"), _SCS("set_default_blend_time"), _SCS("get_default_blend_time")); + ADD_PROPERTY( PropertyInfo( Variant::NODE_PATH, "root_node"), _SCS("set_root"), _SCS("get_root")); - ADD_SIGNAL( MethodInfo("finished") ); + ADD_SIGNAL( MethodInfo("animation_finished", PropertyInfo(Variant::STRING,"name")) ); ADD_SIGNAL( MethodInfo("animation_changed", PropertyInfo(Variant::STRING,"old_name"), PropertyInfo(Variant::STRING,"new_name")) ); ADD_SIGNAL( MethodInfo("animation_started", PropertyInfo(Variant::STRING,"name")) ); diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h index ac0265dbaa..94955bec60 100644 --- a/scene/animation/animation_player.h +++ b/scene/animation/animation_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,7 +39,7 @@ */ class AnimationPlayer : public Node { - OBJ_TYPE( AnimationPlayer, Node ); + GDCLASS( AnimationPlayer, Node ); OBJ_CATEGORY("Animation Nodes"); public: @@ -208,11 +208,11 @@ private: void _node_removed(Node *p_node); // bind helpers - DVector<String> _get_animation_list() const { + PoolVector<String> _get_animation_list() const { List<StringName> animations; get_animation_list(&animations); - DVector<String> ret; + PoolVector<String> ret; while(animations.size()) { ret.push_back( animations.front()->get()); diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp index 6ab1a3e5a1..dbcdb284be 100644 --- a/scene/animation/animation_tree_player.cpp +++ b/scene/animation/animation_tree_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -58,8 +58,8 @@ void AnimationTreePlayer::_set_process(bool p_process, bool p_force) switch (animation_process_mode) { - case ANIMATION_PROCESS_FIXED: set_fixed_process(p_process && active); break; - case ANIMATION_PROCESS_IDLE: set_process(p_process && active); break; + case ANIMATION_PROCESS_FIXED: set_fixed_process_internal(p_process && active); break; + case ANIMATION_PROCESS_IDLE: set_process_internal(p_process && active); break; } processing = p_process; @@ -416,8 +416,8 @@ void AnimationTreePlayer::_notification(int p_what) { if (!processing) { //make sure that a previous process state was not saved //only process if "processing" is set - set_fixed_process(false); - set_process(false); + set_fixed_process_internal(false); + set_process_internal(false); } } break; case NOTIFICATION_READY: { @@ -426,14 +426,14 @@ void AnimationTreePlayer::_notification(int p_what) { _update_sources(); } } break; - case NOTIFICATION_PROCESS: { + case NOTIFICATION_INTERNAL_PROCESS: { if (animation_process_mode==ANIMATION_PROCESS_FIXED) break; if (processing) _process_animation( get_process_delta_time() ); } break; - case NOTIFICATION_FIXED_PROCESS: { + case NOTIFICATION_INTERNAL_FIXED_PROCESS: { if (animation_process_mode==ANIMATION_PROCESS_IDLE) break; @@ -1740,11 +1740,11 @@ NodePath AnimationTreePlayer::get_master_player() const{ return master; } -DVector<String> AnimationTreePlayer::_get_node_list() { +PoolVector<String> AnimationTreePlayer::_get_node_list() { List<StringName> nl; get_node_list(&nl); - DVector<String> ret; + PoolVector<String> ret; ret.resize(nl.size()); int idx=0; for(List<StringName>::Element *E=nl.front();E;E=E->next()) { @@ -1828,105 +1828,106 @@ Error AnimationTreePlayer::node_rename(const StringName& p_node,const StringName void AnimationTreePlayer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("add_node","type","id"),&AnimationTreePlayer::add_node); + ClassDB::bind_method(_MD("add_node","type","id"),&AnimationTreePlayer::add_node); - ObjectTypeDB::bind_method(_MD("node_exists","node"),&AnimationTreePlayer::node_exists); - ObjectTypeDB::bind_method(_MD("node_rename","node","new_name"),&AnimationTreePlayer::node_rename); + ClassDB::bind_method(_MD("node_exists","node"),&AnimationTreePlayer::node_exists); + ClassDB::bind_method(_MD("node_rename","node","new_name"),&AnimationTreePlayer::node_rename); - ObjectTypeDB::bind_method(_MD("node_get_type","id"),&AnimationTreePlayer::node_get_type); - ObjectTypeDB::bind_method(_MD("node_get_input_count","id"),&AnimationTreePlayer::node_get_input_count); - ObjectTypeDB::bind_method(_MD("node_get_input_source","id","idx"),&AnimationTreePlayer::node_get_input_source); + ClassDB::bind_method(_MD("node_get_type","id"),&AnimationTreePlayer::node_get_type); + ClassDB::bind_method(_MD("node_get_input_count","id"),&AnimationTreePlayer::node_get_input_count); + ClassDB::bind_method(_MD("node_get_input_source","id","idx"),&AnimationTreePlayer::node_get_input_source); - ObjectTypeDB::bind_method(_MD("animation_node_set_animation","id","animation:Animation"),&AnimationTreePlayer::animation_node_set_animation); - ObjectTypeDB::bind_method(_MD("animation_node_get_animation:Animation","id"),&AnimationTreePlayer::animation_node_get_animation); + ClassDB::bind_method(_MD("animation_node_set_animation","id","animation:Animation"),&AnimationTreePlayer::animation_node_set_animation); + ClassDB::bind_method(_MD("animation_node_get_animation:Animation","id"),&AnimationTreePlayer::animation_node_get_animation); - ObjectTypeDB::bind_method(_MD("animation_node_set_master_animation","id","source"),&AnimationTreePlayer::animation_node_set_master_animation); - ObjectTypeDB::bind_method(_MD("animation_node_get_master_animation","id"),&AnimationTreePlayer::animation_node_get_master_animation); - ObjectTypeDB::bind_method(_MD("animation_node_set_filter_path","id","path","enable"),&AnimationTreePlayer::animation_node_set_filter_path); + ClassDB::bind_method(_MD("animation_node_set_master_animation","id","source"),&AnimationTreePlayer::animation_node_set_master_animation); + ClassDB::bind_method(_MD("animation_node_get_master_animation","id"),&AnimationTreePlayer::animation_node_get_master_animation); + ClassDB::bind_method(_MD("animation_node_set_filter_path","id","path","enable"),&AnimationTreePlayer::animation_node_set_filter_path); - ObjectTypeDB::bind_method(_MD("oneshot_node_set_fadein_time","id","time_sec"),&AnimationTreePlayer::oneshot_node_set_fadein_time); - ObjectTypeDB::bind_method(_MD("oneshot_node_get_fadein_time","id"),&AnimationTreePlayer::oneshot_node_get_fadein_time); + ClassDB::bind_method(_MD("oneshot_node_set_fadein_time","id","time_sec"),&AnimationTreePlayer::oneshot_node_set_fadein_time); + ClassDB::bind_method(_MD("oneshot_node_get_fadein_time","id"),&AnimationTreePlayer::oneshot_node_get_fadein_time); - ObjectTypeDB::bind_method(_MD("oneshot_node_set_fadeout_time","id","time_sec"),&AnimationTreePlayer::oneshot_node_set_fadeout_time); - ObjectTypeDB::bind_method(_MD("oneshot_node_get_fadeout_time","id"),&AnimationTreePlayer::oneshot_node_get_fadeout_time); + ClassDB::bind_method(_MD("oneshot_node_set_fadeout_time","id","time_sec"),&AnimationTreePlayer::oneshot_node_set_fadeout_time); + ClassDB::bind_method(_MD("oneshot_node_get_fadeout_time","id"),&AnimationTreePlayer::oneshot_node_get_fadeout_time); - ObjectTypeDB::bind_method(_MD("oneshot_node_set_autorestart","id","enable"),&AnimationTreePlayer::oneshot_node_set_autorestart); - ObjectTypeDB::bind_method(_MD("oneshot_node_set_autorestart_delay","id","delay_sec"),&AnimationTreePlayer::oneshot_node_set_autorestart_delay); - ObjectTypeDB::bind_method(_MD("oneshot_node_set_autorestart_random_delay","id","rand_sec"),&AnimationTreePlayer::oneshot_node_set_autorestart_random_delay); + ClassDB::bind_method(_MD("oneshot_node_set_autorestart","id","enable"),&AnimationTreePlayer::oneshot_node_set_autorestart); + ClassDB::bind_method(_MD("oneshot_node_set_autorestart_delay","id","delay_sec"),&AnimationTreePlayer::oneshot_node_set_autorestart_delay); + ClassDB::bind_method(_MD("oneshot_node_set_autorestart_random_delay","id","rand_sec"),&AnimationTreePlayer::oneshot_node_set_autorestart_random_delay); - ObjectTypeDB::bind_method(_MD("oneshot_node_has_autorestart","id"),&AnimationTreePlayer::oneshot_node_has_autorestart); - ObjectTypeDB::bind_method(_MD("oneshot_node_get_autorestart_delay","id"),&AnimationTreePlayer::oneshot_node_get_autorestart_delay); - ObjectTypeDB::bind_method(_MD("oneshot_node_get_autorestart_random_delay","id"),&AnimationTreePlayer::oneshot_node_get_autorestart_random_delay); + ClassDB::bind_method(_MD("oneshot_node_has_autorestart","id"),&AnimationTreePlayer::oneshot_node_has_autorestart); + ClassDB::bind_method(_MD("oneshot_node_get_autorestart_delay","id"),&AnimationTreePlayer::oneshot_node_get_autorestart_delay); + ClassDB::bind_method(_MD("oneshot_node_get_autorestart_random_delay","id"),&AnimationTreePlayer::oneshot_node_get_autorestart_random_delay); - ObjectTypeDB::bind_method(_MD("oneshot_node_start","id"),&AnimationTreePlayer::oneshot_node_start); - ObjectTypeDB::bind_method(_MD("oneshot_node_stop","id"),&AnimationTreePlayer::oneshot_node_stop); - ObjectTypeDB::bind_method(_MD("oneshot_node_is_active","id"),&AnimationTreePlayer::oneshot_node_is_active); - ObjectTypeDB::bind_method(_MD("oneshot_node_set_filter_path","id","path","enable"),&AnimationTreePlayer::oneshot_node_set_filter_path); + ClassDB::bind_method(_MD("oneshot_node_start","id"),&AnimationTreePlayer::oneshot_node_start); + ClassDB::bind_method(_MD("oneshot_node_stop","id"),&AnimationTreePlayer::oneshot_node_stop); + ClassDB::bind_method(_MD("oneshot_node_is_active","id"),&AnimationTreePlayer::oneshot_node_is_active); + ClassDB::bind_method(_MD("oneshot_node_set_filter_path","id","path","enable"),&AnimationTreePlayer::oneshot_node_set_filter_path); - ObjectTypeDB::bind_method(_MD("mix_node_set_amount","id","ratio"),&AnimationTreePlayer::mix_node_set_amount); - ObjectTypeDB::bind_method(_MD("mix_node_get_amount","id"),&AnimationTreePlayer::mix_node_get_amount); + ClassDB::bind_method(_MD("mix_node_set_amount","id","ratio"),&AnimationTreePlayer::mix_node_set_amount); + ClassDB::bind_method(_MD("mix_node_get_amount","id"),&AnimationTreePlayer::mix_node_get_amount); - ObjectTypeDB::bind_method(_MD("blend2_node_set_amount","id","blend"),&AnimationTreePlayer::blend2_node_set_amount); - ObjectTypeDB::bind_method(_MD("blend2_node_get_amount","id"),&AnimationTreePlayer::blend2_node_get_amount); - ObjectTypeDB::bind_method(_MD("blend2_node_set_filter_path","id","path","enable"),&AnimationTreePlayer::blend2_node_set_filter_path); + ClassDB::bind_method(_MD("blend2_node_set_amount","id","blend"),&AnimationTreePlayer::blend2_node_set_amount); + ClassDB::bind_method(_MD("blend2_node_get_amount","id"),&AnimationTreePlayer::blend2_node_get_amount); + ClassDB::bind_method(_MD("blend2_node_set_filter_path","id","path","enable"),&AnimationTreePlayer::blend2_node_set_filter_path); - ObjectTypeDB::bind_method(_MD("blend3_node_set_amount","id","blend"),&AnimationTreePlayer::blend3_node_set_amount); - ObjectTypeDB::bind_method(_MD("blend3_node_get_amount","id"),&AnimationTreePlayer::blend3_node_get_amount); + ClassDB::bind_method(_MD("blend3_node_set_amount","id","blend"),&AnimationTreePlayer::blend3_node_set_amount); + ClassDB::bind_method(_MD("blend3_node_get_amount","id"),&AnimationTreePlayer::blend3_node_get_amount); - ObjectTypeDB::bind_method(_MD("blend4_node_set_amount","id","blend"),&AnimationTreePlayer::blend4_node_set_amount); - ObjectTypeDB::bind_method(_MD("blend4_node_get_amount","id"),&AnimationTreePlayer::blend4_node_get_amount); + ClassDB::bind_method(_MD("blend4_node_set_amount","id","blend"),&AnimationTreePlayer::blend4_node_set_amount); + ClassDB::bind_method(_MD("blend4_node_get_amount","id"),&AnimationTreePlayer::blend4_node_get_amount); - ObjectTypeDB::bind_method(_MD("timescale_node_set_scale","id","scale"),&AnimationTreePlayer::timescale_node_set_scale); - ObjectTypeDB::bind_method(_MD("timescale_node_get_scale","id"),&AnimationTreePlayer::timescale_node_get_scale); + ClassDB::bind_method(_MD("timescale_node_set_scale","id","scale"),&AnimationTreePlayer::timescale_node_set_scale); + ClassDB::bind_method(_MD("timescale_node_get_scale","id"),&AnimationTreePlayer::timescale_node_get_scale); - ObjectTypeDB::bind_method(_MD("timeseek_node_seek","id","pos_sec"),&AnimationTreePlayer::timeseek_node_seek); + ClassDB::bind_method(_MD("timeseek_node_seek","id","pos_sec"),&AnimationTreePlayer::timeseek_node_seek); - ObjectTypeDB::bind_method(_MD("transition_node_set_input_count","id","count"),&AnimationTreePlayer::transition_node_set_input_count); - ObjectTypeDB::bind_method(_MD("transition_node_get_input_count","id"),&AnimationTreePlayer::transition_node_get_input_count); - ObjectTypeDB::bind_method(_MD("transition_node_delete_input","id","input_idx"),&AnimationTreePlayer::transition_node_delete_input); + ClassDB::bind_method(_MD("transition_node_set_input_count","id","count"),&AnimationTreePlayer::transition_node_set_input_count); + ClassDB::bind_method(_MD("transition_node_get_input_count","id"),&AnimationTreePlayer::transition_node_get_input_count); + ClassDB::bind_method(_MD("transition_node_delete_input","id","input_idx"),&AnimationTreePlayer::transition_node_delete_input); - ObjectTypeDB::bind_method(_MD("transition_node_set_input_auto_advance","id","input_idx","enable"),&AnimationTreePlayer::transition_node_set_input_auto_advance); - ObjectTypeDB::bind_method(_MD("transition_node_has_input_auto_advance","id","input_idx"),&AnimationTreePlayer::transition_node_has_input_auto_advance); + ClassDB::bind_method(_MD("transition_node_set_input_auto_advance","id","input_idx","enable"),&AnimationTreePlayer::transition_node_set_input_auto_advance); + ClassDB::bind_method(_MD("transition_node_has_input_auto_advance","id","input_idx"),&AnimationTreePlayer::transition_node_has_input_auto_advance); - ObjectTypeDB::bind_method(_MD("transition_node_set_xfade_time","id","time_sec"),&AnimationTreePlayer::transition_node_set_xfade_time); - ObjectTypeDB::bind_method(_MD("transition_node_get_xfade_time","id"),&AnimationTreePlayer::transition_node_get_xfade_time); + ClassDB::bind_method(_MD("transition_node_set_xfade_time","id","time_sec"),&AnimationTreePlayer::transition_node_set_xfade_time); + ClassDB::bind_method(_MD("transition_node_get_xfade_time","id"),&AnimationTreePlayer::transition_node_get_xfade_time); - ObjectTypeDB::bind_method(_MD("transition_node_set_current","id","input_idx"),&AnimationTreePlayer::transition_node_set_current); - ObjectTypeDB::bind_method(_MD("transition_node_get_current","id"),&AnimationTreePlayer::transition_node_get_current); + ClassDB::bind_method(_MD("transition_node_set_current","id","input_idx"),&AnimationTreePlayer::transition_node_set_current); + ClassDB::bind_method(_MD("transition_node_get_current","id"),&AnimationTreePlayer::transition_node_get_current); - ObjectTypeDB::bind_method(_MD("node_set_pos","id","screen_pos"),&AnimationTreePlayer::node_set_pos); - ObjectTypeDB::bind_method(_MD("node_get_pos","id"),&AnimationTreePlayer::node_get_pos); + ClassDB::bind_method(_MD("node_set_pos","id","screen_pos"),&AnimationTreePlayer::node_set_pos); + ClassDB::bind_method(_MD("node_get_pos","id"),&AnimationTreePlayer::node_get_pos); - ObjectTypeDB::bind_method(_MD("remove_node","id"),&AnimationTreePlayer::remove_node); - ObjectTypeDB::bind_method(_MD("connect","id","dst_id","dst_input_idx"),&AnimationTreePlayer::connect); - ObjectTypeDB::bind_method(_MD("is_connected","id","dst_id","dst_input_idx"),&AnimationTreePlayer::is_connected); - ObjectTypeDB::bind_method(_MD("disconnect","id","dst_input_idx"),&AnimationTreePlayer::disconnect); + ClassDB::bind_method(_MD("remove_node","id"),&AnimationTreePlayer::remove_node); + ClassDB::bind_method(_MD("connect","id","dst_id","dst_input_idx"),&AnimationTreePlayer::connect); + ClassDB::bind_method(_MD("is_connected","id","dst_id","dst_input_idx"),&AnimationTreePlayer::is_connected); + ClassDB::bind_method(_MD("disconnect","id","dst_input_idx"),&AnimationTreePlayer::disconnect); - ObjectTypeDB::bind_method(_MD("set_active","enabled"),&AnimationTreePlayer::set_active); - ObjectTypeDB::bind_method(_MD("is_active"),&AnimationTreePlayer::is_active); + ClassDB::bind_method(_MD("set_active","enabled"),&AnimationTreePlayer::set_active); + ClassDB::bind_method(_MD("is_active"),&AnimationTreePlayer::is_active); - ObjectTypeDB::bind_method(_MD("set_base_path","path"),&AnimationTreePlayer::set_base_path); - ObjectTypeDB::bind_method(_MD("get_base_path"),&AnimationTreePlayer::get_base_path); + ClassDB::bind_method(_MD("set_base_path","path"),&AnimationTreePlayer::set_base_path); + ClassDB::bind_method(_MD("get_base_path"),&AnimationTreePlayer::get_base_path); - ObjectTypeDB::bind_method(_MD("set_master_player","nodepath"),&AnimationTreePlayer::set_master_player); - ObjectTypeDB::bind_method(_MD("get_master_player"),&AnimationTreePlayer::get_master_player); + ClassDB::bind_method(_MD("set_master_player","nodepath"),&AnimationTreePlayer::set_master_player); + ClassDB::bind_method(_MD("get_master_player"),&AnimationTreePlayer::get_master_player); - ObjectTypeDB::bind_method(_MD("get_node_list"),&AnimationTreePlayer::_get_node_list); + ClassDB::bind_method(_MD("get_node_list"),&AnimationTreePlayer::_get_node_list); - ObjectTypeDB::bind_method(_MD("set_animation_process_mode","mode"),&AnimationTreePlayer::set_animation_process_mode); - ObjectTypeDB::bind_method(_MD("get_animation_process_mode"),&AnimationTreePlayer::get_animation_process_mode); + ClassDB::bind_method(_MD("set_animation_process_mode","mode"),&AnimationTreePlayer::set_animation_process_mode); + ClassDB::bind_method(_MD("get_animation_process_mode"),&AnimationTreePlayer::get_animation_process_mode); - ObjectTypeDB::bind_method(_MD("advance", "delta"), &AnimationTreePlayer::advance); + ClassDB::bind_method(_MD("advance", "delta"), &AnimationTreePlayer::advance); - ObjectTypeDB::bind_method(_MD("reset"),&AnimationTreePlayer::reset); + ClassDB::bind_method(_MD("reset"),&AnimationTreePlayer::reset); - ObjectTypeDB::bind_method(_MD("recompute_caches"),&AnimationTreePlayer::recompute_caches); + ClassDB::bind_method(_MD("recompute_caches"),&AnimationTreePlayer::recompute_caches); - ADD_PROPERTY(PropertyInfo(Variant::INT, "playback/process_mode", PROPERTY_HINT_ENUM, "Fixed,Idle"), _SCS("set_animation_process_mode"), _SCS("get_animation_process_mode")); + ADD_GROUP("Playback","playback_"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "playback_process_mode", PROPERTY_HINT_ENUM, "Fixed,Idle"), _SCS("set_animation_process_mode"), _SCS("get_animation_process_mode")); BIND_CONSTANT( NODE_OUTPUT ); BIND_CONSTANT( NODE_ANIMATION ); diff --git a/scene/animation/animation_tree_player.h b/scene/animation/animation_tree_player.h index 909748924f..ae2fe8c2bb 100644 --- a/scene/animation/animation_tree_player.h +++ b/scene/animation/animation_tree_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -38,7 +38,7 @@ class AnimationTreePlayer : public Node { - OBJ_TYPE( AnimationTreePlayer, Node ); + GDCLASS( AnimationTreePlayer, Node ); OBJ_CATEGORY("Animation Nodes"); public: @@ -282,7 +282,7 @@ private: Track* _find_track(const NodePath& p_path); void _recompute_caches(); void _recompute_caches(const StringName& p_node); - DVector<String> _get_node_list(); + PoolVector<String> _get_node_list(); void _compute_weights(float *p_fallback_weight, HashMap<NodePath,float> *p_weights, float p_coeff, const HashMap<NodePath,bool> *p_filter = NULL, float p_filtered_coeff = 0); diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index cbaaeb03e5..d2b95c78e6 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -155,21 +155,21 @@ void Tween::_notification(int p_what) { if (!processing) { //make sure that a previous process state was not saved //only process if "processing" is set - set_fixed_process(false); - set_process(false); + set_fixed_process_internal(false); + set_process_internal(false); } } break; case NOTIFICATION_READY: { } break; - case NOTIFICATION_PROCESS: { + case NOTIFICATION_INTERNAL_PROCESS: { if (tween_process_mode==TWEEN_PROCESS_FIXED) break; if (processing) _tween_process( get_process_delta_time() ); } break; - case NOTIFICATION_FIXED_PROCESS: { + case NOTIFICATION_INTERNAL_FIXED_PROCESS: { if (tween_process_mode==TWEEN_PROCESS_IDLE) break; @@ -186,46 +186,46 @@ void Tween::_notification(int p_what) { void Tween::_bind_methods() { - ObjectTypeDB::bind_method(_MD("is_active"),&Tween::is_active ); - ObjectTypeDB::bind_method(_MD("set_active","active"),&Tween::set_active ); - - ObjectTypeDB::bind_method(_MD("is_repeat"),&Tween::is_repeat ); - ObjectTypeDB::bind_method(_MD("set_repeat","repeat"),&Tween::set_repeat ); - - ObjectTypeDB::bind_method(_MD("set_speed","speed"),&Tween::set_speed); - ObjectTypeDB::bind_method(_MD("get_speed"),&Tween::get_speed); - - ObjectTypeDB::bind_method(_MD("set_tween_process_mode","mode"),&Tween::set_tween_process_mode); - ObjectTypeDB::bind_method(_MD("get_tween_process_mode"),&Tween::get_tween_process_mode); - - ObjectTypeDB::bind_method(_MD("start"),&Tween::start ); - ObjectTypeDB::bind_method(_MD("reset","object","key"),&Tween::reset, DEFVAL("") ); - ObjectTypeDB::bind_method(_MD("reset_all"),&Tween::reset_all ); - ObjectTypeDB::bind_method(_MD("stop","object","key"),&Tween::stop, DEFVAL("") ); - ObjectTypeDB::bind_method(_MD("stop_all"),&Tween::stop_all ); - ObjectTypeDB::bind_method(_MD("resume","object","key"),&Tween::resume, DEFVAL("") ); - ObjectTypeDB::bind_method(_MD("resume_all"),&Tween::resume_all ); - ObjectTypeDB::bind_method(_MD("remove","object","key"),&Tween::remove, DEFVAL("") ); - ObjectTypeDB::bind_method(_MD("_remove","object","key","first_only"),&Tween::_remove ); - ObjectTypeDB::bind_method(_MD("remove_all"),&Tween::remove_all ); - ObjectTypeDB::bind_method(_MD("seek","time"),&Tween::seek ); - ObjectTypeDB::bind_method(_MD("tell"),&Tween::tell ); - ObjectTypeDB::bind_method(_MD("get_runtime"),&Tween::get_runtime ); - - ObjectTypeDB::bind_method(_MD("interpolate_property","object","property","initial_val","final_val","times_in_sec","trans_type","ease_type","delay"),&Tween::interpolate_property, DEFVAL(0) ); - ObjectTypeDB::bind_method(_MD("interpolate_method","object","method","initial_val","final_val","times_in_sec","trans_type","ease_type","delay"),&Tween::interpolate_method, DEFVAL(0) ); - ObjectTypeDB::bind_method(_MD("interpolate_callback","object","times_in_sec","callback","arg1", "arg2","arg3","arg4","arg5"),&Tween::interpolate_callback, DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()) ); - ObjectTypeDB::bind_method(_MD("interpolate_deferred_callback","object","times_in_sec","callback","arg1","arg2","arg3","arg4","arg5"),&Tween::interpolate_deferred_callback, DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()) ); - ObjectTypeDB::bind_method(_MD("follow_property","object","property","initial_val","target","target_property","times_in_sec","trans_type","ease_type","delay"),&Tween::follow_property, DEFVAL(0) ); - ObjectTypeDB::bind_method(_MD("follow_method","object","method","initial_val","target","target_method","times_in_sec","trans_type","ease_type","delay"),&Tween::follow_method, DEFVAL(0) ); - ObjectTypeDB::bind_method(_MD("targeting_property","object","property","initial","initial_val","final_val","times_in_sec","trans_type","ease_type","delay"),&Tween::targeting_property, DEFVAL(0) ); - ObjectTypeDB::bind_method(_MD("targeting_method","object","method","initial","initial_method","final_val","times_in_sec","trans_type","ease_type","delay"),&Tween::targeting_method, DEFVAL(0) ); + ClassDB::bind_method(_MD("is_active"),&Tween::is_active ); + ClassDB::bind_method(_MD("set_active","active"),&Tween::set_active ); + + ClassDB::bind_method(_MD("is_repeat"),&Tween::is_repeat ); + ClassDB::bind_method(_MD("set_repeat","repeat"),&Tween::set_repeat ); + + ClassDB::bind_method(_MD("set_speed","speed"),&Tween::set_speed); + ClassDB::bind_method(_MD("get_speed"),&Tween::get_speed); + + ClassDB::bind_method(_MD("set_tween_process_mode","mode"),&Tween::set_tween_process_mode); + ClassDB::bind_method(_MD("get_tween_process_mode"),&Tween::get_tween_process_mode); + + ClassDB::bind_method(_MD("start"),&Tween::start ); + ClassDB::bind_method(_MD("reset","object","key"),&Tween::reset, DEFVAL("") ); + ClassDB::bind_method(_MD("reset_all"),&Tween::reset_all ); + ClassDB::bind_method(_MD("stop","object","key"),&Tween::stop, DEFVAL("") ); + ClassDB::bind_method(_MD("stop_all"),&Tween::stop_all ); + ClassDB::bind_method(_MD("resume","object","key"),&Tween::resume, DEFVAL("") ); + ClassDB::bind_method(_MD("resume_all"),&Tween::resume_all ); + ClassDB::bind_method(_MD("remove","object","key"),&Tween::remove, DEFVAL("") ); + ClassDB::bind_method(_MD("_remove","object","key","first_only"),&Tween::_remove ); + ClassDB::bind_method(_MD("remove_all"),&Tween::remove_all ); + ClassDB::bind_method(_MD("seek","time"),&Tween::seek ); + ClassDB::bind_method(_MD("tell"),&Tween::tell ); + ClassDB::bind_method(_MD("get_runtime"),&Tween::get_runtime ); + + ClassDB::bind_method(_MD("interpolate_property","object","property","initial_val","final_val","times_in_sec","trans_type","ease_type","delay"),&Tween::interpolate_property, DEFVAL(0) ); + ClassDB::bind_method(_MD("interpolate_method","object","method","initial_val","final_val","times_in_sec","trans_type","ease_type","delay"),&Tween::interpolate_method, DEFVAL(0) ); + ClassDB::bind_method(_MD("interpolate_callback","object","times_in_sec","callback","arg1", "arg2","arg3","arg4","arg5"),&Tween::interpolate_callback, DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()) ); + ClassDB::bind_method(_MD("interpolate_deferred_callback","object","times_in_sec","callback","arg1","arg2","arg3","arg4","arg5"),&Tween::interpolate_deferred_callback, DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()), DEFVAL(Variant()) ); + ClassDB::bind_method(_MD("follow_property","object","property","initial_val","target","target_property","times_in_sec","trans_type","ease_type","delay"),&Tween::follow_property, DEFVAL(0) ); + ClassDB::bind_method(_MD("follow_method","object","method","initial_val","target","target_method","times_in_sec","trans_type","ease_type","delay"),&Tween::follow_method, DEFVAL(0) ); + ClassDB::bind_method(_MD("targeting_property","object","property","initial","initial_val","final_val","times_in_sec","trans_type","ease_type","delay"),&Tween::targeting_property, DEFVAL(0) ); + ClassDB::bind_method(_MD("targeting_method","object","method","initial","initial_method","final_val","times_in_sec","trans_type","ease_type","delay"),&Tween::targeting_method, DEFVAL(0) ); ADD_SIGNAL( MethodInfo("tween_start", PropertyInfo( Variant::OBJECT,"object"), PropertyInfo( Variant::STRING,"key")) ); ADD_SIGNAL( MethodInfo("tween_step", PropertyInfo( Variant::OBJECT,"object"), PropertyInfo( Variant::STRING,"key"), PropertyInfo( Variant::REAL,"elapsed"), PropertyInfo( Variant::OBJECT,"value")) ); ADD_SIGNAL( MethodInfo("tween_complete", PropertyInfo( Variant::OBJECT,"object"), PropertyInfo( Variant::STRING,"key")) ); - ADD_PROPERTY( PropertyInfo( Variant::INT, "playback/process_mode", PROPERTY_HINT_ENUM, "Fixed,Idle"), _SCS("set_tween_process_mode"), _SCS("get_tween_process_mode")); + ADD_PROPERTY( PropertyInfo( Variant::INT, "playback_process_mode", PROPERTY_HINT_ENUM, "Fixed,Idle"), _SCS("set_tween_process_mode"), _SCS("get_tween_process_mode")); BIND_CONSTANT(TWEEN_PROCESS_FIXED); BIND_CONSTANT(TWEEN_PROCESS_IDLE); @@ -383,11 +383,11 @@ Variant Tween::_run_equation(InterpolateData& p_data) { } break; - case Variant::MATRIX3: + case Variant::BASIS: { - Matrix3 i = initial_val; - Matrix3 d = delta_val; - Matrix3 r; + Basis i = initial_val; + Basis d = delta_val; + Basis r; APPLY_EQUATION(elements[0][0]); APPLY_EQUATION(elements[0][1]); @@ -403,11 +403,11 @@ Variant Tween::_run_equation(InterpolateData& p_data) { } break; - case Variant::MATRIX32: + case Variant::TRANSFORM2D: { - Matrix3 i = initial_val; - Matrix3 d = delta_val; - Matrix3 r; + Basis i = initial_val; + Basis d = delta_val; + Basis r; APPLY_EQUATION(elements[0][0]); APPLY_EQUATION(elements[0][1]); @@ -433,11 +433,11 @@ Variant Tween::_run_equation(InterpolateData& p_data) { result = r; } break; - case Variant::_AABB: + case Variant::RECT3: { - AABB i = initial_val; - AABB d = delta_val; - AABB r; + Rect3 i = initial_val; + Rect3 d = delta_val; + Rect3 r; APPLY_EQUATION(pos.x); APPLY_EQUATION(pos.y); @@ -666,8 +666,8 @@ void Tween::_set_process(bool p_process,bool p_force) { switch(tween_process_mode) { - case TWEEN_PROCESS_FIXED: set_fixed_process(p_process && active); break; - case TWEEN_PROCESS_IDLE: set_process(p_process && active); break; + case TWEEN_PROCESS_FIXED: set_fixed_process_internal(p_process && active); break; + case TWEEN_PROCESS_IDLE: set_process_internal(p_process && active); break; } processing=p_process; @@ -953,11 +953,11 @@ bool Tween::_calc_delta_val(const Variant& p_initial_val, const Variant& p_final delta_val = final_val.operator Vector3() - initial_val.operator Vector3(); break; - case Variant::MATRIX3: + case Variant::BASIS: { - Matrix3 i = initial_val; - Matrix3 f = final_val; - delta_val = Matrix3(f.elements[0][0] - i.elements[0][0], + Basis i = initial_val; + Basis f = final_val; + delta_val = Basis(f.elements[0][0] - i.elements[0][0], f.elements[0][1] - i.elements[0][1], f.elements[0][2] - i.elements[0][2], f.elements[1][0] - i.elements[1][0], @@ -970,11 +970,11 @@ bool Tween::_calc_delta_val(const Variant& p_initial_val, const Variant& p_final } break; - case Variant::MATRIX32: + case Variant::TRANSFORM2D: { - Matrix32 i = initial_val; - Matrix32 f = final_val; - Matrix32 d = Matrix32(); + Transform2D i = initial_val; + Transform2D f = final_val; + Transform2D d = Transform2D(); d[0][0] = f.elements[0][0] - i.elements[0][0]; d[0][1] = f.elements[0][1] - i.elements[0][1]; d[1][0] = f.elements[1][0] - i.elements[1][0]; @@ -987,11 +987,11 @@ bool Tween::_calc_delta_val(const Variant& p_initial_val, const Variant& p_final case Variant::QUAT: delta_val = final_val.operator Quat() - initial_val.operator Quat(); break; - case Variant::_AABB: + case Variant::RECT3: { - AABB i = initial_val; - AABB f = final_val; - delta_val = AABB(f.pos - i.pos, f.size - i.size); + Rect3 i = initial_val; + Rect3 f = final_val; + delta_val = Rect3(f.pos - i.pos, f.size - i.size); } break; case Variant::TRANSFORM: diff --git a/scene/animation/tween.h b/scene/animation/tween.h index 844a012b9f..01c5b5680e 100644 --- a/scene/animation/tween.h +++ b/scene/animation/tween.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class Tween : public Node { - OBJ_TYPE( Tween, Node ); + GDCLASS( Tween, Node ); public: enum TweenProcessMode { diff --git a/scene/animation/tween_interpolaters.cpp b/scene/animation/tween_interpolaters.cpp index 058a7f12bc..5ba9673014 100644 --- a/scene/animation/tween_interpolaters.cpp +++ b/scene/animation/tween_interpolaters.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/audio/event_player.cpp b/scene/audio/event_player.cpp index f43c3c2a59..c46f4e3b89 100644 --- a/scene/audio/event_player.cpp +++ b/scene/audio/event_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -282,58 +282,58 @@ float EventPlayer::get_channel_last_note_time(int p_channel) const { void EventPlayer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_stream","stream:EventStream"),&EventPlayer::set_stream); - ObjectTypeDB::bind_method(_MD("get_stream:EventStream"),&EventPlayer::get_stream); + ClassDB::bind_method(_MD("set_stream","stream:EventStream"),&EventPlayer::set_stream); + ClassDB::bind_method(_MD("get_stream:EventStream"),&EventPlayer::get_stream); - ObjectTypeDB::bind_method(_MD("play"),&EventPlayer::play); - ObjectTypeDB::bind_method(_MD("stop"),&EventPlayer::stop); + ClassDB::bind_method(_MD("play"),&EventPlayer::play); + ClassDB::bind_method(_MD("stop"),&EventPlayer::stop); - ObjectTypeDB::bind_method(_MD("is_playing"),&EventPlayer::is_playing); + ClassDB::bind_method(_MD("is_playing"),&EventPlayer::is_playing); - ObjectTypeDB::bind_method(_MD("set_paused","paused"),&EventPlayer::set_paused); - ObjectTypeDB::bind_method(_MD("is_paused"),&EventPlayer::is_paused); + ClassDB::bind_method(_MD("set_paused","paused"),&EventPlayer::set_paused); + ClassDB::bind_method(_MD("is_paused"),&EventPlayer::is_paused); - ObjectTypeDB::bind_method(_MD("set_loop","enabled"),&EventPlayer::set_loop); - ObjectTypeDB::bind_method(_MD("has_loop"),&EventPlayer::has_loop); + ClassDB::bind_method(_MD("set_loop","enabled"),&EventPlayer::set_loop); + ClassDB::bind_method(_MD("has_loop"),&EventPlayer::has_loop); - ObjectTypeDB::bind_method(_MD("set_volume","volume"),&EventPlayer::set_volume); - ObjectTypeDB::bind_method(_MD("get_volume"),&EventPlayer::get_volume); + ClassDB::bind_method(_MD("set_volume","volume"),&EventPlayer::set_volume); + ClassDB::bind_method(_MD("get_volume"),&EventPlayer::get_volume); - ObjectTypeDB::bind_method(_MD("set_pitch_scale","pitch_scale"),&EventPlayer::set_pitch_scale); - ObjectTypeDB::bind_method(_MD("get_pitch_scale"),&EventPlayer::get_pitch_scale); + ClassDB::bind_method(_MD("set_pitch_scale","pitch_scale"),&EventPlayer::set_pitch_scale); + ClassDB::bind_method(_MD("get_pitch_scale"),&EventPlayer::get_pitch_scale); - ObjectTypeDB::bind_method(_MD("set_tempo_scale","tempo_scale"),&EventPlayer::set_tempo_scale); - ObjectTypeDB::bind_method(_MD("get_tempo_scale"),&EventPlayer::get_tempo_scale); + ClassDB::bind_method(_MD("set_tempo_scale","tempo_scale"),&EventPlayer::set_tempo_scale); + ClassDB::bind_method(_MD("get_tempo_scale"),&EventPlayer::get_tempo_scale); - ObjectTypeDB::bind_method(_MD("set_volume_db","db"),&EventPlayer::set_volume_db); - ObjectTypeDB::bind_method(_MD("get_volume_db"),&EventPlayer::get_volume_db); + ClassDB::bind_method(_MD("set_volume_db","db"),&EventPlayer::set_volume_db); + ClassDB::bind_method(_MD("get_volume_db"),&EventPlayer::get_volume_db); - ObjectTypeDB::bind_method(_MD("get_stream_name"),&EventPlayer::get_stream_name); - ObjectTypeDB::bind_method(_MD("get_loop_count"),&EventPlayer::get_loop_count); + ClassDB::bind_method(_MD("get_stream_name"),&EventPlayer::get_stream_name); + ClassDB::bind_method(_MD("get_loop_count"),&EventPlayer::get_loop_count); - ObjectTypeDB::bind_method(_MD("get_pos"),&EventPlayer::get_pos); - ObjectTypeDB::bind_method(_MD("seek_pos","time"),&EventPlayer::seek_pos); + ClassDB::bind_method(_MD("get_pos"),&EventPlayer::get_pos); + ClassDB::bind_method(_MD("seek_pos","time"),&EventPlayer::seek_pos); - ObjectTypeDB::bind_method(_MD("get_length"),&EventPlayer::get_length); + ClassDB::bind_method(_MD("get_length"),&EventPlayer::get_length); - ObjectTypeDB::bind_method(_MD("set_autoplay","enabled"),&EventPlayer::set_autoplay); - ObjectTypeDB::bind_method(_MD("has_autoplay"),&EventPlayer::has_autoplay); + ClassDB::bind_method(_MD("set_autoplay","enabled"),&EventPlayer::set_autoplay); + ClassDB::bind_method(_MD("has_autoplay"),&EventPlayer::has_autoplay); - ObjectTypeDB::bind_method(_MD("set_channel_volume","channel","channel_volume"),&EventPlayer::set_channel_volume); - ObjectTypeDB::bind_method(_MD("get_channel_volume","channel"),&EventPlayer::get_channel_volume); - ObjectTypeDB::bind_method(_MD("get_channel_last_note_time","channel"),&EventPlayer::get_channel_last_note_time); + ClassDB::bind_method(_MD("set_channel_volume","channel","channel_volume"),&EventPlayer::set_channel_volume); + ClassDB::bind_method(_MD("get_channel_volume","channel"),&EventPlayer::get_channel_volume); + ClassDB::bind_method(_MD("get_channel_last_note_time","channel"),&EventPlayer::get_channel_last_note_time); - ObjectTypeDB::bind_method(_MD("_set_play","play"),&EventPlayer::_set_play); - ObjectTypeDB::bind_method(_MD("_get_play"),&EventPlayer::_get_play); + ClassDB::bind_method(_MD("_set_play","play"),&EventPlayer::_set_play); + ClassDB::bind_method(_MD("_get_play"),&EventPlayer::_get_play); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "stream/stream", PROPERTY_HINT_RESOURCE_TYPE,"EventStream"), _SCS("set_stream"), _SCS("get_stream") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/play"), _SCS("_set_play"), _SCS("_get_play") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/loop"), _SCS("set_loop"), _SCS("has_loop") ); - ADD_PROPERTY( PropertyInfo(Variant::REAL, "stream/volume_db", PROPERTY_HINT_RANGE,"-80,24,0.01"), _SCS("set_volume_db"), _SCS("get_volume_db") ); - ADD_PROPERTY( PropertyInfo(Variant::REAL, "stream/pitch_scale", PROPERTY_HINT_RANGE,"0.001,16,0.001"), _SCS("set_pitch_scale"), _SCS("get_pitch_scale") ); - ADD_PROPERTY( PropertyInfo(Variant::REAL, "stream/tempo_scale", PROPERTY_HINT_RANGE,"0.001,16,0.001"), _SCS("set_tempo_scale"), _SCS("get_tempo_scale") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/autoplay"), _SCS("set_autoplay"), _SCS("has_autoplay") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/paused"), _SCS("set_paused"), _SCS("is_paused") ); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE,"EventStream"), _SCS("set_stream"), _SCS("get_stream") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "play"), _SCS("_set_play"), _SCS("_get_play") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "loop"), _SCS("set_loop"), _SCS("has_loop") ); + ADD_PROPERTY( PropertyInfo(Variant::REAL, "volume_db", PROPERTY_HINT_RANGE,"-80,24,0.01"), _SCS("set_volume_db"), _SCS("get_volume_db") ); + ADD_PROPERTY( PropertyInfo(Variant::REAL, "pitch_scale", PROPERTY_HINT_RANGE,"0.001,16,0.001"), _SCS("set_pitch_scale"), _SCS("get_pitch_scale") ); + ADD_PROPERTY( PropertyInfo(Variant::REAL, "tempo_scale", PROPERTY_HINT_RANGE,"0.001,16,0.001"), _SCS("set_tempo_scale"), _SCS("get_tempo_scale") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "autoplay"), _SCS("set_autoplay"), _SCS("has_autoplay") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "paused"), _SCS("set_paused"), _SCS("is_paused") ); } diff --git a/scene/audio/event_player.h b/scene/audio/event_player.h index c04e85fe77..715017e0d6 100644 --- a/scene/audio/event_player.h +++ b/scene/audio/event_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ #include "scene/resources/event_stream.h" class EventPlayer : public Node { - OBJ_TYPE(EventPlayer,Node); + GDCLASS(EventPlayer,Node); enum { diff --git a/scene/audio/sample_player.cpp b/scene/audio/sample_player.cpp index 3827d40a71..ba2d379311 100644 --- a/scene/audio/sample_player.cpp +++ b/scene/audio/sample_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -611,64 +611,64 @@ String SamplePlayer::get_configuration_warning() const { void SamplePlayer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_sample_library","library:SampleLibrary"),&SamplePlayer::set_sample_library ); - ObjectTypeDB::bind_method(_MD("get_sample_library:SampleLibrary"),&SamplePlayer::get_sample_library ); - - ObjectTypeDB::bind_method(_MD("set_polyphony","max_voices"),&SamplePlayer::set_polyphony ); - ObjectTypeDB::bind_method(_MD("get_polyphony"),&SamplePlayer::get_polyphony ); - - ObjectTypeDB::bind_method(_MD("play","name","unique"),&SamplePlayer::play, DEFVAL(false) ); - ObjectTypeDB::bind_method(_MD("stop","voice"),&SamplePlayer::stop ); - ObjectTypeDB::bind_method(_MD("stop_all"),&SamplePlayer::stop_all ); - - ObjectTypeDB::bind_method(_MD("set_mix_rate","voice","hz"),&SamplePlayer::set_mix_rate ); - ObjectTypeDB::bind_method(_MD("set_pitch_scale","voice","ratio"),&SamplePlayer::set_pitch_scale ); - ObjectTypeDB::bind_method(_MD("set_volume","voice","volume"),&SamplePlayer::set_volume ); - ObjectTypeDB::bind_method(_MD("set_volume_db","voice","db"),&SamplePlayer::set_volume_db ); - ObjectTypeDB::bind_method(_MD("set_pan","voice","pan","depth","height"),&SamplePlayer::set_pan,DEFVAL(0),DEFVAL(0) ); - ObjectTypeDB::bind_method(_MD("set_filter","voice","type","cutoff_hz","resonance","gain"),&SamplePlayer::set_filter,DEFVAL(0) ); - ObjectTypeDB::bind_method(_MD("set_chorus","voice","send"),&SamplePlayer::set_chorus ); - ObjectTypeDB::bind_method(_MD("set_reverb","voice","room_type","send"),&SamplePlayer::set_reverb ); - - ObjectTypeDB::bind_method(_MD("get_mix_rate","voice"),&SamplePlayer::get_mix_rate ); - ObjectTypeDB::bind_method(_MD("get_pitch_scale","voice"),&SamplePlayer::get_pitch_scale ); - ObjectTypeDB::bind_method(_MD("get_volume","voice"),&SamplePlayer::get_volume ); - ObjectTypeDB::bind_method(_MD("get_volume_db","voice"),&SamplePlayer::get_volume_db ); - ObjectTypeDB::bind_method(_MD("get_pan","voice"),&SamplePlayer::get_pan ); - ObjectTypeDB::bind_method(_MD("get_pan_depth","voice"),&SamplePlayer::get_pan_depth ); - ObjectTypeDB::bind_method(_MD("get_pan_height","voice"),&SamplePlayer::get_pan_height ); - ObjectTypeDB::bind_method(_MD("get_filter_type","voice"),&SamplePlayer::get_filter_type ); - ObjectTypeDB::bind_method(_MD("get_filter_cutoff","voice"),&SamplePlayer::get_filter_cutoff ); - ObjectTypeDB::bind_method(_MD("get_filter_resonance","voice"),&SamplePlayer::get_filter_resonance ); - ObjectTypeDB::bind_method(_MD("get_filter_gain","voice"),&SamplePlayer::get_filter_gain ); - ObjectTypeDB::bind_method(_MD("get_chorus","voice"),&SamplePlayer::get_chorus ); - ObjectTypeDB::bind_method(_MD("get_reverb_room","voice"),&SamplePlayer::get_reverb_room ); - ObjectTypeDB::bind_method(_MD("get_reverb","voice"),&SamplePlayer::get_reverb ); - - ObjectTypeDB::bind_method(_MD("set_default_pitch_scale","ratio"),&SamplePlayer::set_default_pitch_scale ); - ObjectTypeDB::bind_method(_MD("set_default_volume","volume"),&SamplePlayer::set_default_volume ); - ObjectTypeDB::bind_method(_MD("set_default_volume_db","db"),&SamplePlayer::set_default_volume_db ); - ObjectTypeDB::bind_method(_MD("set_default_pan","pan","depth","height"),&SamplePlayer::set_default_pan,DEFVAL(0),DEFVAL(0) ); - ObjectTypeDB::bind_method(_MD("set_default_filter","type","cutoff_hz","resonance","gain"),&SamplePlayer::set_default_filter,DEFVAL(0) ); - ObjectTypeDB::bind_method(_MD("set_default_chorus","send"),&SamplePlayer::set_default_chorus ); - ObjectTypeDB::bind_method(_MD("set_default_reverb","room_type","send"),&SamplePlayer::set_default_reverb ); - - ObjectTypeDB::bind_method(_MD("get_default_pitch_scale"),&SamplePlayer::get_default_pitch_scale ); - ObjectTypeDB::bind_method(_MD("get_default_volume"),&SamplePlayer::get_default_volume ); - ObjectTypeDB::bind_method(_MD("get_default_volume_db"),&SamplePlayer::get_default_volume_db ); - ObjectTypeDB::bind_method(_MD("get_default_pan"),&SamplePlayer::get_default_pan ); - ObjectTypeDB::bind_method(_MD("get_default_pan_depth"),&SamplePlayer::get_default_pan_depth ); - ObjectTypeDB::bind_method(_MD("get_default_pan_height"),&SamplePlayer::get_default_pan_height ); - ObjectTypeDB::bind_method(_MD("get_default_filter_type"),&SamplePlayer::get_default_filter_type ); - ObjectTypeDB::bind_method(_MD("get_default_filter_cutoff"),&SamplePlayer::get_default_filter_cutoff ); - ObjectTypeDB::bind_method(_MD("get_default_filter_resonance"),&SamplePlayer::get_default_filter_resonance ); - ObjectTypeDB::bind_method(_MD("get_default_filter_gain"),&SamplePlayer::get_default_filter_gain ); - ObjectTypeDB::bind_method(_MD("get_default_chorus"),&SamplePlayer::get_default_chorus ); - ObjectTypeDB::bind_method(_MD("get_default_reverb_room"),&SamplePlayer::get_default_reverb_room ); - ObjectTypeDB::bind_method(_MD("get_default_reverb"),&SamplePlayer::get_default_reverb ); - - ObjectTypeDB::bind_method(_MD("is_active"),&SamplePlayer::is_active ); - ObjectTypeDB::bind_method(_MD("is_voice_active","voice"),&SamplePlayer::is_voice_active ); + ClassDB::bind_method(_MD("set_sample_library","library:SampleLibrary"),&SamplePlayer::set_sample_library ); + ClassDB::bind_method(_MD("get_sample_library:SampleLibrary"),&SamplePlayer::get_sample_library ); + + ClassDB::bind_method(_MD("set_polyphony","max_voices"),&SamplePlayer::set_polyphony ); + ClassDB::bind_method(_MD("get_polyphony"),&SamplePlayer::get_polyphony ); + + ClassDB::bind_method(_MD("play","name","unique"),&SamplePlayer::play, DEFVAL(false) ); + ClassDB::bind_method(_MD("stop","voice"),&SamplePlayer::stop ); + ClassDB::bind_method(_MD("stop_all"),&SamplePlayer::stop_all ); + + ClassDB::bind_method(_MD("set_mix_rate","voice","hz"),&SamplePlayer::set_mix_rate ); + ClassDB::bind_method(_MD("set_pitch_scale","voice","ratio"),&SamplePlayer::set_pitch_scale ); + ClassDB::bind_method(_MD("set_volume","voice","volume"),&SamplePlayer::set_volume ); + ClassDB::bind_method(_MD("set_volume_db","voice","db"),&SamplePlayer::set_volume_db ); + ClassDB::bind_method(_MD("set_pan","voice","pan","depth","height"),&SamplePlayer::set_pan,DEFVAL(0),DEFVAL(0) ); + ClassDB::bind_method(_MD("set_filter","voice","type","cutoff_hz","resonance","gain"),&SamplePlayer::set_filter,DEFVAL(0) ); + ClassDB::bind_method(_MD("set_chorus","voice","send"),&SamplePlayer::set_chorus ); + ClassDB::bind_method(_MD("set_reverb","voice","room_type","send"),&SamplePlayer::set_reverb ); + + ClassDB::bind_method(_MD("get_mix_rate","voice"),&SamplePlayer::get_mix_rate ); + ClassDB::bind_method(_MD("get_pitch_scale","voice"),&SamplePlayer::get_pitch_scale ); + ClassDB::bind_method(_MD("get_volume","voice"),&SamplePlayer::get_volume ); + ClassDB::bind_method(_MD("get_volume_db","voice"),&SamplePlayer::get_volume_db ); + ClassDB::bind_method(_MD("get_pan","voice"),&SamplePlayer::get_pan ); + ClassDB::bind_method(_MD("get_pan_depth","voice"),&SamplePlayer::get_pan_depth ); + ClassDB::bind_method(_MD("get_pan_height","voice"),&SamplePlayer::get_pan_height ); + ClassDB::bind_method(_MD("get_filter_type","voice"),&SamplePlayer::get_filter_type ); + ClassDB::bind_method(_MD("get_filter_cutoff","voice"),&SamplePlayer::get_filter_cutoff ); + ClassDB::bind_method(_MD("get_filter_resonance","voice"),&SamplePlayer::get_filter_resonance ); + ClassDB::bind_method(_MD("get_filter_gain","voice"),&SamplePlayer::get_filter_gain ); + ClassDB::bind_method(_MD("get_chorus","voice"),&SamplePlayer::get_chorus ); + ClassDB::bind_method(_MD("get_reverb_room","voice"),&SamplePlayer::get_reverb_room ); + ClassDB::bind_method(_MD("get_reverb","voice"),&SamplePlayer::get_reverb ); + + ClassDB::bind_method(_MD("set_default_pitch_scale","ratio"),&SamplePlayer::set_default_pitch_scale ); + ClassDB::bind_method(_MD("set_default_volume","volume"),&SamplePlayer::set_default_volume ); + ClassDB::bind_method(_MD("set_default_volume_db","db"),&SamplePlayer::set_default_volume_db ); + ClassDB::bind_method(_MD("set_default_pan","pan","depth","height"),&SamplePlayer::set_default_pan,DEFVAL(0),DEFVAL(0) ); + ClassDB::bind_method(_MD("set_default_filter","type","cutoff_hz","resonance","gain"),&SamplePlayer::set_default_filter,DEFVAL(0) ); + ClassDB::bind_method(_MD("set_default_chorus","send"),&SamplePlayer::set_default_chorus ); + ClassDB::bind_method(_MD("set_default_reverb","room_type","send"),&SamplePlayer::set_default_reverb ); + + ClassDB::bind_method(_MD("get_default_pitch_scale"),&SamplePlayer::get_default_pitch_scale ); + ClassDB::bind_method(_MD("get_default_volume"),&SamplePlayer::get_default_volume ); + ClassDB::bind_method(_MD("get_default_volume_db"),&SamplePlayer::get_default_volume_db ); + ClassDB::bind_method(_MD("get_default_pan"),&SamplePlayer::get_default_pan ); + ClassDB::bind_method(_MD("get_default_pan_depth"),&SamplePlayer::get_default_pan_depth ); + ClassDB::bind_method(_MD("get_default_pan_height"),&SamplePlayer::get_default_pan_height ); + ClassDB::bind_method(_MD("get_default_filter_type"),&SamplePlayer::get_default_filter_type ); + ClassDB::bind_method(_MD("get_default_filter_cutoff"),&SamplePlayer::get_default_filter_cutoff ); + ClassDB::bind_method(_MD("get_default_filter_resonance"),&SamplePlayer::get_default_filter_resonance ); + ClassDB::bind_method(_MD("get_default_filter_gain"),&SamplePlayer::get_default_filter_gain ); + ClassDB::bind_method(_MD("get_default_chorus"),&SamplePlayer::get_default_chorus ); + ClassDB::bind_method(_MD("get_default_reverb_room"),&SamplePlayer::get_default_reverb_room ); + ClassDB::bind_method(_MD("get_default_reverb"),&SamplePlayer::get_default_reverb ); + + ClassDB::bind_method(_MD("is_active"),&SamplePlayer::is_active ); + ClassDB::bind_method(_MD("is_voice_active","voice"),&SamplePlayer::is_voice_active ); BIND_CONSTANT( FILTER_NONE); BIND_CONSTANT( FILTER_LOWPASS); diff --git a/scene/audio/sample_player.h b/scene/audio/sample_player.h index 833fac3868..8c4e6418aa 100644 --- a/scene/audio/sample_player.h +++ b/scene/audio/sample_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class SamplePlayer : public Node { - OBJ_TYPE( SamplePlayer, Node ); + GDCLASS( SamplePlayer, Node ); OBJ_CATEGORY("Audio Nodes"); public: diff --git a/scene/audio/sound_room_params.cpp b/scene/audio/sound_room_params.cpp index bb2285c97f..d08bc5d6b8 100644 --- a/scene/audio/sound_room_params.cpp +++ b/scene/audio/sound_room_params.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -134,14 +134,14 @@ bool SoundRoomParams::is_forcing_params_to_all_sources() { void SoundRoomParams::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_param","param","value"),&SoundRoomParams::set_param ); - ObjectTypeDB::bind_method(_MD("get_param","param"),&SoundRoomParams::get_param ); + ClassDB::bind_method(_MD("set_param","param","value"),&SoundRoomParams::set_param ); + ClassDB::bind_method(_MD("get_param","param"),&SoundRoomParams::get_param ); - ObjectTypeDB::bind_method(_MD("set_reverb_mode","reverb_mode","value"),&SoundRoomParams::set_reverb_mode ); - ObjectTypeDB::bind_method(_MD("get_reverb_mode","reverb_mode"),&SoundRoomParams::get_reverb_mode ); + ClassDB::bind_method(_MD("set_reverb_mode","reverb_mode","value"),&SoundRoomParams::set_reverb_mode ); + ClassDB::bind_method(_MD("get_reverb_mode","reverb_mode"),&SoundRoomParams::get_reverb_mode ); - ObjectTypeDB::bind_method(_MD("set_force_params_to_all_sources","enabled"),&SoundRoomParams::set_force_params_to_all_sources ); - ObjectTypeDB::bind_method(_MD("is_forcing_params_to_all_sources"),&SoundRoomParams::is_forcing_params_to_all_sources ); + ClassDB::bind_method(_MD("set_force_params_to_all_sources","enabled"),&SoundRoomParams::set_force_params_to_all_sources ); + ClassDB::bind_method(_MD("is_forcing_params_to_all_sources"),&SoundRoomParams::is_forcing_params_to_all_sources ); ADD_PROPERTY( PropertyInfo( Variant::INT, "reverb/mode", PROPERTY_HINT_ENUM, "Small,Medium,Large,Hall"), _SCS("set_reverb_mode"), _SCS("get_reverb_mode") ); diff --git a/scene/audio/sound_room_params.h b/scene/audio/sound_room_params.h index 4ca1eae2ce..3cdffda652 100644 --- a/scene/audio/sound_room_params.h +++ b/scene/audio/sound_room_params.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -38,7 +38,7 @@ #include "scene/3d/room_instance.h" class SoundRoomParams : public Node { - OBJ_TYPE( SoundRoomParams, Node ); + GDCLASS( SoundRoomParams, Node ); public: enum Params { diff --git a/scene/audio/stream_player.cpp b/scene/audio/stream_player.cpp index 99ecace1ed..2f53dc239f 100644 --- a/scene/audio/stream_player.cpp +++ b/scene/audio/stream_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -345,55 +345,55 @@ int StreamPlayer::get_buffering_msec() const{ void StreamPlayer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_stream","stream:AudioStream"),&StreamPlayer::set_stream); - ObjectTypeDB::bind_method(_MD("get_stream:AudioStream"),&StreamPlayer::get_stream); + ClassDB::bind_method(_MD("set_stream","stream:AudioStream"),&StreamPlayer::set_stream); + ClassDB::bind_method(_MD("get_stream:AudioStream"),&StreamPlayer::get_stream); - ObjectTypeDB::bind_method(_MD("play","offset"),&StreamPlayer::play,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("stop"),&StreamPlayer::stop); + ClassDB::bind_method(_MD("play","offset"),&StreamPlayer::play,DEFVAL(0)); + ClassDB::bind_method(_MD("stop"),&StreamPlayer::stop); - ObjectTypeDB::bind_method(_MD("is_playing"),&StreamPlayer::is_playing); + ClassDB::bind_method(_MD("is_playing"),&StreamPlayer::is_playing); - ObjectTypeDB::bind_method(_MD("set_paused","paused"),&StreamPlayer::set_paused); - ObjectTypeDB::bind_method(_MD("is_paused"),&StreamPlayer::is_paused); + ClassDB::bind_method(_MD("set_paused","paused"),&StreamPlayer::set_paused); + ClassDB::bind_method(_MD("is_paused"),&StreamPlayer::is_paused); - ObjectTypeDB::bind_method(_MD("set_loop","enabled"),&StreamPlayer::set_loop); - ObjectTypeDB::bind_method(_MD("has_loop"),&StreamPlayer::has_loop); + ClassDB::bind_method(_MD("set_loop","enabled"),&StreamPlayer::set_loop); + ClassDB::bind_method(_MD("has_loop"),&StreamPlayer::has_loop); - ObjectTypeDB::bind_method(_MD("set_volume","volume"),&StreamPlayer::set_volume); - ObjectTypeDB::bind_method(_MD("get_volume"),&StreamPlayer::get_volume); + ClassDB::bind_method(_MD("set_volume","volume"),&StreamPlayer::set_volume); + ClassDB::bind_method(_MD("get_volume"),&StreamPlayer::get_volume); - ObjectTypeDB::bind_method(_MD("set_volume_db","db"),&StreamPlayer::set_volume_db); - ObjectTypeDB::bind_method(_MD("get_volume_db"),&StreamPlayer::get_volume_db); + ClassDB::bind_method(_MD("set_volume_db","db"),&StreamPlayer::set_volume_db); + ClassDB::bind_method(_MD("get_volume_db"),&StreamPlayer::get_volume_db); - ObjectTypeDB::bind_method(_MD("set_buffering_msec","msec"),&StreamPlayer::set_buffering_msec); - ObjectTypeDB::bind_method(_MD("get_buffering_msec"),&StreamPlayer::get_buffering_msec); + ClassDB::bind_method(_MD("set_buffering_msec","msec"),&StreamPlayer::set_buffering_msec); + ClassDB::bind_method(_MD("get_buffering_msec"),&StreamPlayer::get_buffering_msec); - ObjectTypeDB::bind_method(_MD("set_loop_restart_time","secs"),&StreamPlayer::set_loop_restart_time); - ObjectTypeDB::bind_method(_MD("get_loop_restart_time"),&StreamPlayer::get_loop_restart_time); + ClassDB::bind_method(_MD("set_loop_restart_time","secs"),&StreamPlayer::set_loop_restart_time); + ClassDB::bind_method(_MD("get_loop_restart_time"),&StreamPlayer::get_loop_restart_time); - ObjectTypeDB::bind_method(_MD("get_stream_name"),&StreamPlayer::get_stream_name); - ObjectTypeDB::bind_method(_MD("get_loop_count"),&StreamPlayer::get_loop_count); + ClassDB::bind_method(_MD("get_stream_name"),&StreamPlayer::get_stream_name); + ClassDB::bind_method(_MD("get_loop_count"),&StreamPlayer::get_loop_count); - ObjectTypeDB::bind_method(_MD("get_pos"),&StreamPlayer::get_pos); - ObjectTypeDB::bind_method(_MD("seek_pos","time"),&StreamPlayer::seek_pos); + ClassDB::bind_method(_MD("get_pos"),&StreamPlayer::get_pos); + ClassDB::bind_method(_MD("seek_pos","time"),&StreamPlayer::seek_pos); - ObjectTypeDB::bind_method(_MD("set_autoplay","enabled"),&StreamPlayer::set_autoplay); - ObjectTypeDB::bind_method(_MD("has_autoplay"),&StreamPlayer::has_autoplay); + ClassDB::bind_method(_MD("set_autoplay","enabled"),&StreamPlayer::set_autoplay); + ClassDB::bind_method(_MD("has_autoplay"),&StreamPlayer::has_autoplay); - ObjectTypeDB::bind_method(_MD("get_length"),&StreamPlayer::get_length); + ClassDB::bind_method(_MD("get_length"),&StreamPlayer::get_length); - ObjectTypeDB::bind_method(_MD("_set_play","play"),&StreamPlayer::_set_play); - ObjectTypeDB::bind_method(_MD("_get_play"),&StreamPlayer::_get_play); - ObjectTypeDB::bind_method(_MD("_do_stop"),&StreamPlayer::_do_stop); + ClassDB::bind_method(_MD("_set_play","play"),&StreamPlayer::_set_play); + ClassDB::bind_method(_MD("_get_play"),&StreamPlayer::_get_play); + ClassDB::bind_method(_MD("_do_stop"),&StreamPlayer::_do_stop); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "stream/stream", PROPERTY_HINT_RESOURCE_TYPE,"AudioStream"), _SCS("set_stream"), _SCS("get_stream") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/play"), _SCS("_set_play"), _SCS("_get_play") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/loop"), _SCS("set_loop"), _SCS("has_loop") ); - ADD_PROPERTY( PropertyInfo(Variant::REAL, "stream/volume_db", PROPERTY_HINT_RANGE,"-80,24,0.01"), _SCS("set_volume_db"), _SCS("get_volume_db") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/autoplay"), _SCS("set_autoplay"), _SCS("has_autoplay") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/paused"), _SCS("set_paused"), _SCS("is_paused") ); - ADD_PROPERTY( PropertyInfo(Variant::REAL, "stream/loop_restart_time"), _SCS("set_loop_restart_time"), _SCS("get_loop_restart_time") ); - ADD_PROPERTY( PropertyInfo(Variant::INT, "stream/buffering_ms"), _SCS("set_buffering_msec"), _SCS("get_buffering_msec") ); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE,"AudioStream"), _SCS("set_stream"), _SCS("get_stream") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "play"), _SCS("_set_play"), _SCS("_get_play") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "loop"), _SCS("set_loop"), _SCS("has_loop") ); + ADD_PROPERTY( PropertyInfo(Variant::REAL, "volume_db", PROPERTY_HINT_RANGE,"-80,24,0.01"), _SCS("set_volume_db"), _SCS("get_volume_db") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "autoplay"), _SCS("set_autoplay"), _SCS("has_autoplay") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "paused"), _SCS("set_paused"), _SCS("is_paused") ); + ADD_PROPERTY( PropertyInfo(Variant::REAL, "loop_restart_time"), _SCS("set_loop_restart_time"), _SCS("get_loop_restart_time") ); + ADD_PROPERTY( PropertyInfo(Variant::INT, "buffering_ms"), _SCS("set_buffering_msec"), _SCS("get_buffering_msec") ); ADD_SIGNAL(MethodInfo("finished")); } diff --git a/scene/audio/stream_player.h b/scene/audio/stream_player.h index 4facc3c816..6031d86aa2 100644 --- a/scene/audio/stream_player.h +++ b/scene/audio/stream_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class StreamPlayer : public Node { - OBJ_TYPE(StreamPlayer,Node); + GDCLASS(StreamPlayer,Node); //_THREAD_SAFE_CLASS_ diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index 64d68738b2..45c491cd74 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -29,11 +29,24 @@ #include "base_button.h" #include "os/keyboard.h" #include "print_string.h" -#include "button_group.h" #include "scene/scene_string_names.h" #include "scene/main/viewport.h" -void BaseButton::_input_event(InputEvent p_event) { + +void BaseButton::_unpress_group() { + + if (!button_group.is_valid()) + return; + + for (Set<BaseButton*>::Element *E=button_group->buttons.front();E;E=E->next()) { + if (E->get()==this) + continue; + + E->get()->set_pressed(false); + } +} + +void BaseButton::_gui_input(InputEvent p_event) { if (status.disabled) // no interaction with disabled button @@ -69,6 +82,8 @@ void BaseButton::_input_event(InputEvent p_event) { } emit_signal("pressed"); + _unpress_group(); + } else { @@ -79,6 +94,8 @@ void BaseButton::_input_event(InputEvent p_event) { get_script_instance()->call(SceneStringNames::get_singleton()->_pressed,NULL,0,ce); } emit_signal("pressed"); + _unpress_group(); + toggled(status.pressed); emit_signal("toggled",status.pressed); @@ -90,10 +107,11 @@ void BaseButton::_input_event(InputEvent p_event) { emit_signal("button_up"); - if (status.press_attempt && status.pressing_inside) { +/* this is pointless if (status.press_attempt && status.pressing_inside) { // released(); emit_signal("released"); } +*/ status.press_attempt=false; } update(); @@ -138,6 +156,9 @@ void BaseButton::_input_event(InputEvent p_event) { } + _unpress_group(); + + } status.press_attempt=false; @@ -156,7 +177,7 @@ void BaseButton::_input_event(InputEvent p_event) { } } break; case InputEvent::ACTION: - case InputEvent::JOYSTICK_BUTTON: + case InputEvent::JOYPAD_BUTTON: case InputEvent::KEY: { @@ -211,6 +232,9 @@ void BaseButton::_input_event(InputEvent p_event) { } emit_signal("toggled",status.pressed); } + + _unpress_group(); + } accept_event(); @@ -265,24 +289,12 @@ void BaseButton::_notification(int p_what) { if (p_what==NOTIFICATION_ENTER_TREE) { - CanvasItem *ci=this; - while(ci) { - ButtonGroup *bg = ci->cast_to<ButtonGroup>(); - if (bg) { - - group=bg; - group->_add_button(this); - } - - ci=ci->get_parent_item(); - } } if (p_what==NOTIFICATION_EXIT_TREE) { - if (group) - group->_remove_button(this); + } if (p_what==NOTIFICATION_VISIBILITY_CHANGED && !is_visible()) { @@ -305,8 +317,9 @@ void BaseButton::pressed() { void BaseButton::toggled(bool p_pressed) { - if (get_script_instance()) + if (get_script_instance()) { get_script_instance()->call("toggled",p_pressed); + } } @@ -335,6 +348,11 @@ void BaseButton::set_pressed(bool p_pressed) { return; _change_notify("pressed"); status.pressed=p_pressed; + + if (p_pressed) { + _unpress_group(); + + } update(); } @@ -462,30 +480,56 @@ String BaseButton::get_tooltip(const Point2& p_pos) const { return tooltip; } + +void BaseButton::set_button_group(const Ref<ButtonGroup>& p_group) { + + if (button_group.is_valid()) { + button_group->buttons.erase(this); + } + + button_group=p_group; + + if (button_group.is_valid()) { + button_group->buttons.insert(this); + } + + update(); //checkbox changes to radio if set a buttongroup + +} + +Ref<ButtonGroup> BaseButton::get_button_group() const { + + return button_group; +} + + void BaseButton::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_input_event"),&BaseButton::_input_event); - ObjectTypeDB::bind_method(_MD("_unhandled_input"),&BaseButton::_unhandled_input); - ObjectTypeDB::bind_method(_MD("set_pressed","pressed"),&BaseButton::set_pressed); - ObjectTypeDB::bind_method(_MD("is_pressed"),&BaseButton::is_pressed); - ObjectTypeDB::bind_method(_MD("is_hovered"),&BaseButton::is_hovered); - ObjectTypeDB::bind_method(_MD("set_toggle_mode","enabled"),&BaseButton::set_toggle_mode); - ObjectTypeDB::bind_method(_MD("is_toggle_mode"),&BaseButton::is_toggle_mode); - ObjectTypeDB::bind_method(_MD("set_disabled","disabled"),&BaseButton::set_disabled); - ObjectTypeDB::bind_method(_MD("is_disabled"),&BaseButton::is_disabled); - ObjectTypeDB::bind_method(_MD("set_click_on_press","enable"),&BaseButton::set_click_on_press); - ObjectTypeDB::bind_method(_MD("get_click_on_press"),&BaseButton::get_click_on_press); - ObjectTypeDB::bind_method(_MD("get_draw_mode"),&BaseButton::get_draw_mode); - ObjectTypeDB::bind_method(_MD("set_enabled_focus_mode","mode"),&BaseButton::set_enabled_focus_mode); - ObjectTypeDB::bind_method(_MD("get_enabled_focus_mode"),&BaseButton::get_enabled_focus_mode); - ObjectTypeDB::bind_method(_MD("set_shortcut","shortcut"),&BaseButton::set_shortcut); - ObjectTypeDB::bind_method(_MD("get_shortcut"),&BaseButton::get_shortcut); + ClassDB::bind_method(_MD("_gui_input"),&BaseButton::_gui_input); + ClassDB::bind_method(_MD("_unhandled_input"),&BaseButton::_unhandled_input); + ClassDB::bind_method(_MD("set_pressed","pressed"),&BaseButton::set_pressed); + ClassDB::bind_method(_MD("is_pressed"),&BaseButton::is_pressed); + ClassDB::bind_method(_MD("is_hovered"),&BaseButton::is_hovered); + ClassDB::bind_method(_MD("set_toggle_mode","enabled"),&BaseButton::set_toggle_mode); + ClassDB::bind_method(_MD("is_toggle_mode"),&BaseButton::is_toggle_mode); + ClassDB::bind_method(_MD("set_disabled","disabled"),&BaseButton::set_disabled); + ClassDB::bind_method(_MD("is_disabled"),&BaseButton::is_disabled); + ClassDB::bind_method(_MD("set_click_on_press","enable"),&BaseButton::set_click_on_press); + ClassDB::bind_method(_MD("get_click_on_press"),&BaseButton::get_click_on_press); + ClassDB::bind_method(_MD("get_draw_mode"),&BaseButton::get_draw_mode); + ClassDB::bind_method(_MD("set_enabled_focus_mode","mode"),&BaseButton::set_enabled_focus_mode); + ClassDB::bind_method(_MD("get_enabled_focus_mode"),&BaseButton::get_enabled_focus_mode); + + ClassDB::bind_method(_MD("set_shortcut","shortcut"),&BaseButton::set_shortcut); + ClassDB::bind_method(_MD("get_shortcut"),&BaseButton::get_shortcut); + + ClassDB::bind_method(_MD("set_button_group","button_group"),&BaseButton::set_button_group); + ClassDB::bind_method(_MD("get_button_group"),&BaseButton::get_button_group); BIND_VMETHOD(MethodInfo("_pressed")); BIND_VMETHOD(MethodInfo("_toggled",PropertyInfo(Variant::BOOL,"pressed"))); ADD_SIGNAL( MethodInfo("pressed" ) ); - ADD_SIGNAL( MethodInfo("released" ) ); ADD_SIGNAL( MethodInfo("button_up") ); ADD_SIGNAL( MethodInfo("button_down") ); ADD_SIGNAL( MethodInfo("toggled", PropertyInfo( Variant::BOOL,"pressed") ) ); @@ -495,6 +539,7 @@ void BaseButton::_bind_methods() { ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "click_on_press"), _SCS("set_click_on_press"), _SCS("get_click_on_press")); ADD_PROPERTY( PropertyInfo( Variant::INT,"enabled_focus_mode", PROPERTY_HINT_ENUM, "None,Click,All" ), _SCS("set_enabled_focus_mode"), _SCS("get_enabled_focus_mode") ); ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "shortcut",PROPERTY_HINT_RESOURCE_TYPE,"ShortCut"), _SCS("set_shortcut"), _SCS("get_shortcut")); + ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "group",PROPERTY_HINT_RESOURCE_TYPE,"ButtonGroup"), _SCS("set_button_group"), _SCS("get_button_group")); BIND_CONSTANT( DRAW_NORMAL ); @@ -516,7 +561,11 @@ BaseButton::BaseButton() { status.pressing_button=0; set_focus_mode( FOCUS_ALL ); enabled_focus_mode = FOCUS_ALL; - group=NULL; + + + if (button_group.is_valid()) { + button_group->buttons.erase(this); + } } @@ -525,4 +574,30 @@ BaseButton::~BaseButton() { } +void ButtonGroup::get_buttons(List<BaseButton*> *r_buttons) { + for (Set<BaseButton*>::Element *E=buttons.front();E;E=E->next()) { + r_buttons->push_back(E->get()); + } +} + +BaseButton* ButtonGroup::get_pressed_button() { + + for (Set<BaseButton*>::Element *E=buttons.front();E;E=E->next()) { + if (E->get()->is_pressed()) + return E->get(); + } + + return NULL; + +} + +void ButtonGroup::_bind_methods() { + + ClassDB::bind_method(_MD("get_pressed_button:BaseButton"),&ButtonGroup::get_pressed_button); +} + +ButtonGroup::ButtonGroup() { + + set_local_to_scene(true); +} diff --git a/scene/gui/base_button.h b/scene/gui/base_button.h index 0056b00f33..898c19e811 100644 --- a/scene/gui/base_button.h +++ b/scene/gui/base_button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,7 +39,7 @@ class ButtonGroup; class BaseButton : public Control { - OBJ_TYPE( BaseButton, Control ); + GDCLASS( BaseButton, Control ); bool toggle_mode; FocusMode enabled_focus_mode; @@ -59,9 +59,11 @@ class BaseButton : public Control { } status; - ButtonGroup *group; + Ref<ButtonGroup> button_group; + void _unpress_group(); + protected: @@ -70,7 +72,7 @@ protected: virtual void pressed(); virtual void toggled(bool p_pressed); static void _bind_methods(); - virtual void _input_event(InputEvent p_event); + virtual void _gui_input(InputEvent p_event); virtual void _unhandled_input(InputEvent p_event); void _notification(int p_what); @@ -109,11 +111,29 @@ public: virtual String get_tooltip(const Point2& p_pos) const; + void set_button_group(const Ref<ButtonGroup>& p_group); + Ref<ButtonGroup> get_button_group() const; + BaseButton(); ~BaseButton(); }; -VARIANT_ENUM_CAST( BaseButton::DrawMode ); +VARIANT_ENUM_CAST( BaseButton::DrawMode ) + + +class ButtonGroup : public Resource { + + GDCLASS(ButtonGroup,Resource) +friend class BaseButton; + Set<BaseButton*> buttons; +protected: + static void _bind_methods(); +public: + + BaseButton* get_pressed_button(); + void get_buttons(List<BaseButton*> *r_buttons); + ButtonGroup(); +}; #endif diff --git a/scene/gui/box_container.cpp b/scene/gui/box_container.cpp index a6ffc30a83..f31f51a5cd 100644 --- a/scene/gui/box_container.cpp +++ b/scene/gui/box_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -280,7 +280,8 @@ BoxContainer::AlignMode BoxContainer::get_alignment() const { void BoxContainer::add_spacer(bool p_begin) { Control *c = memnew( Control ); - c->set_stop_mouse(false); + c->set_mouse_filter(MOUSE_FILTER_PASS); //allow spacer to pass mouse events + if (vertical) c->set_v_size_flags(SIZE_EXPAND_FILL); else @@ -296,14 +297,14 @@ BoxContainer::BoxContainer(bool p_vertical) { vertical=p_vertical; align = ALIGN_BEGIN; // set_ignore_mouse(true); - set_stop_mouse(false); + set_mouse_filter(MOUSE_FILTER_PASS); } void BoxContainer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("add_spacer","begin"),&BoxContainer::add_spacer); - ObjectTypeDB::bind_method(_MD("get_alignment"),&BoxContainer::get_alignment); - ObjectTypeDB::bind_method(_MD("set_alignment","alignment"),&BoxContainer::set_alignment); + ClassDB::bind_method(_MD("add_spacer","begin"),&BoxContainer::add_spacer); + ClassDB::bind_method(_MD("get_alignment"),&BoxContainer::get_alignment); + ClassDB::bind_method(_MD("set_alignment","alignment"),&BoxContainer::set_alignment); BIND_CONSTANT( ALIGN_BEGIN ); BIND_CONSTANT( ALIGN_CENTER ); diff --git a/scene/gui/box_container.h b/scene/gui/box_container.h index 6e63e8bdac..c428ec132c 100644 --- a/scene/gui/box_container.h +++ b/scene/gui/box_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class BoxContainer : public Container { - OBJ_TYPE(BoxContainer,Container); + GDCLASS(BoxContainer,Container); public: @@ -68,7 +68,7 @@ public: class HBoxContainer : public BoxContainer { - OBJ_TYPE(HBoxContainer,BoxContainer); + GDCLASS(HBoxContainer,BoxContainer); public: @@ -79,7 +79,7 @@ public: class MarginContainer; class VBoxContainer : public BoxContainer { - OBJ_TYPE(VBoxContainer,BoxContainer); + GDCLASS(VBoxContainer,BoxContainer); public: diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index 579f6e08c9..f28595b622 100644 --- a/scene/gui/button.cpp +++ b/scene/gui/button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ Size2 Button::get_minimum_size() const { - Size2 minsize=get_font("font")->get_string_size( text ); + Size2 minsize=get_font("font")->get_string_size( xl_text ); if (clip_text) minsize.width=0; @@ -48,7 +48,7 @@ Size2 Button::get_minimum_size() const { minsize.height=MAX( minsize.height, _icon->get_height() ); minsize.width+=_icon->get_width(); - if (text!="") + if (xl_text!="") minsize.width+=get_constant("hseparation"); } @@ -59,6 +59,13 @@ Size2 Button::get_minimum_size() const { void Button::_notification(int p_what) { + if (p_what==NOTIFICATION_TRANSLATION_CHANGED) { + + xl_text=XL_MESSAGE(text); + minimum_size_changed(); + update(); + } + if (p_what==NOTIFICATION_DRAW) { RID ci = get_canvas_item(); @@ -114,7 +121,7 @@ void Button::_notification(int p_what) { Point2 icon_ofs = (!_icon.is_null())?Point2( _icon->get_width() + get_constant("hseparation"), 0):Point2(); int text_clip=size.width - style->get_minimum_size().width - icon_ofs.width; - Point2 text_ofs = (size - style->get_minimum_size() - icon_ofs - font->get_string_size( text ) )/2.0; + Point2 text_ofs = (size - style->get_minimum_size() - icon_ofs - font->get_string_size( xl_text ) )/2.0; switch(align) { case ALIGN_LEFT: { @@ -128,14 +135,14 @@ void Button::_notification(int p_what) { text_ofs+=style->get_offset(); } break; case ALIGN_RIGHT: { - text_ofs.x=size.x - style->get_margin(MARGIN_RIGHT) - font->get_string_size( text ).x; + text_ofs.x=size.x - style->get_margin(MARGIN_RIGHT) - font->get_string_size( xl_text ).x; text_ofs.y+=style->get_offset().y; } break; } text_ofs.y+=font->get_ascent(); - font->draw( ci, text_ofs.floor(), text, color,clip_text?text_clip:-1); + font->draw( ci, text_ofs.floor(), xl_text, color,clip_text?text_clip:-1); if (!_icon.is_null()) { int valign = size.height-style->get_minimum_size().y; @@ -152,7 +159,8 @@ void Button::set_text(const String& p_text) { if (text==p_text) return; - text=XL_MESSAGE(p_text); + text=p_text; + xl_text=XL_MESSAGE(p_text); update(); _change_notify("text"); minimum_size_changed(); @@ -215,16 +223,16 @@ Button::TextAlign Button::get_text_align() const { void Button::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_text","text"),&Button::set_text); - ObjectTypeDB::bind_method(_MD("get_text"),&Button::get_text); - ObjectTypeDB::bind_method(_MD("set_button_icon","texture:Texture"),&Button::set_icon); - ObjectTypeDB::bind_method(_MD("get_button_icon:Texture"),&Button::get_icon); - ObjectTypeDB::bind_method(_MD("set_flat","enabled"),&Button::set_flat); - ObjectTypeDB::bind_method(_MD("set_clip_text","enabled"),&Button::set_clip_text); - ObjectTypeDB::bind_method(_MD("get_clip_text"),&Button::get_clip_text); - ObjectTypeDB::bind_method(_MD("set_text_align","align"),&Button::set_text_align); - ObjectTypeDB::bind_method(_MD("get_text_align"),&Button::get_text_align); - ObjectTypeDB::bind_method(_MD("is_flat"),&Button::is_flat); + ClassDB::bind_method(_MD("set_text","text"),&Button::set_text); + ClassDB::bind_method(_MD("get_text"),&Button::get_text); + ClassDB::bind_method(_MD("set_button_icon","texture:Texture"),&Button::set_icon); + ClassDB::bind_method(_MD("get_button_icon:Texture"),&Button::get_icon); + ClassDB::bind_method(_MD("set_flat","enabled"),&Button::set_flat); + ClassDB::bind_method(_MD("set_clip_text","enabled"),&Button::set_clip_text); + ClassDB::bind_method(_MD("get_clip_text"),&Button::get_clip_text); + ClassDB::bind_method(_MD("set_text_align","align"),&Button::set_text_align); + ClassDB::bind_method(_MD("get_text_align"),&Button::get_text_align); + ClassDB::bind_method(_MD("is_flat"),&Button::is_flat); BIND_CONSTANT( ALIGN_LEFT ); BIND_CONSTANT( ALIGN_CENTER ); @@ -242,7 +250,7 @@ Button::Button(const String &p_text) { flat=false; clip_text=false; - set_stop_mouse(true); + set_mouse_filter(MOUSE_FILTER_STOP); set_text(p_text); align=ALIGN_CENTER; } diff --git a/scene/gui/button.h b/scene/gui/button.h index c39237c9af..2fd3a0cace 100644 --- a/scene/gui/button.h +++ b/scene/gui/button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,9 +33,12 @@ /** @author Juan Linietsky <reduzio@gmail.com> */ + + + class Button : public BaseButton { - OBJ_TYPE( Button, BaseButton ); + GDCLASS( Button, BaseButton ); public: @@ -49,6 +52,7 @@ private: bool flat; String text; + String xl_text; Ref<Texture> icon; bool clip_text; TextAlign align; diff --git a/scene/gui/button_array.cpp b/scene/gui/button_array.cpp index df1872380d..3d7c0e2825 100644 --- a/scene/gui/button_array.cpp +++ b/scene/gui/button_array.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -267,9 +267,9 @@ void ButtonArray::_notification(int p_what) { } else { if (hover==i) draw_style_box(style_hover,r); - else + else if (!flat) draw_style_box(style_normal,r); - sbsize=style_selected->get_minimum_size(); + sbsize=style_normal->get_minimum_size(); sbofs=style_normal->get_offset(); f=font_normal; c=color_normal; @@ -300,7 +300,7 @@ void ButtonArray::_notification(int p_what) { } -void ButtonArray::_input_event(const InputEvent& p_event) { +void ButtonArray::_gui_input(const InputEvent& p_event) { if ( ( (orientation==HORIZONTAL && p_event.is_action("ui_left") ) || @@ -388,6 +388,17 @@ ButtonArray::Align ButtonArray::get_align() const { return align; } +void ButtonArray::set_flat(bool p_flat) { + + flat=p_flat; + update(); +} + +bool ButtonArray::is_flat() const { + + return flat; +} + void ButtonArray::add_button(const String& p_text,const String& p_tooltip) { @@ -516,22 +527,24 @@ void ButtonArray::get_translatable_strings(List<String> *p_strings) const { void ButtonArray::_bind_methods() { - ObjectTypeDB::bind_method(_MD("add_button","text","tooltip"),&ButtonArray::add_button,DEFVAL("")); - ObjectTypeDB::bind_method(_MD("add_icon_button","icon:Texture","text","tooltip"),&ButtonArray::add_icon_button,DEFVAL(""),DEFVAL("")); - ObjectTypeDB::bind_method(_MD("set_button_text","button_idx","text"),&ButtonArray::set_button_text); - ObjectTypeDB::bind_method(_MD("set_button_tooltip","button_idx","text"),&ButtonArray::set_button_tooltip); - ObjectTypeDB::bind_method(_MD("set_button_icon","button_idx","icon:Texture"),&ButtonArray::set_button_icon); - ObjectTypeDB::bind_method(_MD("get_button_text","button_idx"),&ButtonArray::get_button_text); - ObjectTypeDB::bind_method(_MD("get_button_tooltip","button_idx"),&ButtonArray::get_button_tooltip); - ObjectTypeDB::bind_method(_MD("get_button_icon:Texture","button_idx"),&ButtonArray::get_button_icon); - ObjectTypeDB::bind_method(_MD("get_button_count"),&ButtonArray::get_button_count); - ObjectTypeDB::bind_method(_MD("get_selected"),&ButtonArray::get_selected); - ObjectTypeDB::bind_method(_MD("get_hovered"),&ButtonArray::get_hovered); - ObjectTypeDB::bind_method(_MD("set_selected","button_idx"),&ButtonArray::set_selected); - ObjectTypeDB::bind_method(_MD("erase_button","button_idx"),&ButtonArray::erase_button); - ObjectTypeDB::bind_method(_MD("clear"),&ButtonArray::clear); - - ObjectTypeDB::bind_method(_MD("_input_event"),&ButtonArray::_input_event); + ClassDB::bind_method(_MD("add_button","text","tooltip"),&ButtonArray::add_button,DEFVAL("")); + ClassDB::bind_method(_MD("add_icon_button","icon:Texture","text","tooltip"),&ButtonArray::add_icon_button,DEFVAL(""),DEFVAL("")); + ClassDB::bind_method(_MD("set_button_text","button_idx","text"),&ButtonArray::set_button_text); + ClassDB::bind_method(_MD("set_button_tooltip","button_idx","text"),&ButtonArray::set_button_tooltip); + ClassDB::bind_method(_MD("set_button_icon","button_idx","icon:Texture"),&ButtonArray::set_button_icon); + ClassDB::bind_method(_MD("get_button_text","button_idx"),&ButtonArray::get_button_text); + ClassDB::bind_method(_MD("get_button_tooltip","button_idx"),&ButtonArray::get_button_tooltip); + ClassDB::bind_method(_MD("get_button_icon:Texture","button_idx"),&ButtonArray::get_button_icon); + ClassDB::bind_method(_MD("get_button_count"),&ButtonArray::get_button_count); + ClassDB::bind_method(_MD("set_flat","enabled"),&ButtonArray::set_flat); + ClassDB::bind_method(_MD("is_flat"),&ButtonArray::is_flat); + ClassDB::bind_method(_MD("get_selected"),&ButtonArray::get_selected); + ClassDB::bind_method(_MD("get_hovered"),&ButtonArray::get_hovered); + ClassDB::bind_method(_MD("set_selected","button_idx"),&ButtonArray::set_selected); + ClassDB::bind_method(_MD("erase_button","button_idx"),&ButtonArray::erase_button); + ClassDB::bind_method(_MD("clear"),&ButtonArray::clear); + + ClassDB::bind_method(_MD("_gui_input"),&ButtonArray::_gui_input); BIND_CONSTANT( ALIGN_BEGIN ); BIND_CONSTANT( ALIGN_CENTER ); @@ -539,6 +552,8 @@ void ButtonArray::_bind_methods() { BIND_CONSTANT( ALIGN_FILL ); BIND_CONSTANT( ALIGN_EXPAND_FILL ); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "flat" ), _SCS("set_flat"),_SCS("is_flat") ); + ADD_SIGNAL( MethodInfo("button_selected",PropertyInfo(Variant::INT,"button_idx"))); } @@ -549,5 +564,6 @@ ButtonArray::ButtonArray(Orientation p_orientation) { selected=-1; set_focus_mode(FOCUS_ALL); hover=-1; + flat=false; min_button_size = -1; } diff --git a/scene/gui/button_array.h b/scene/gui/button_array.h index 62997a8e36..37533695c9 100644 --- a/scene/gui/button_array.h +++ b/scene/gui/button_array.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class ButtonArray : public Control { - OBJ_TYPE(ButtonArray, Control); + GDCLASS(ButtonArray, Control); public: enum Align { ALIGN_BEGIN, @@ -59,6 +59,7 @@ private: int selected; int hover; + bool flat; double min_button_size; Vector<Button> buttons; @@ -73,12 +74,15 @@ protected: public: - void _input_event(const InputEvent& p_event); + void _gui_input(const InputEvent& p_event); void set_align(Align p_align); Align get_align() const; + void set_flat(bool p_flat); + bool is_flat() const; + void add_button(const String& p_button,const String& p_tooltip=""); void add_icon_button(const Ref<Texture>& p_icon,const String& p_button="",const String& p_tooltip=""); @@ -110,14 +114,14 @@ public: }; class HButtonArray : public ButtonArray { - OBJ_TYPE(HButtonArray,ButtonArray); + GDCLASS(HButtonArray,ButtonArray); public: HButtonArray() : ButtonArray(HORIZONTAL) {}; }; class VButtonArray : public ButtonArray { - OBJ_TYPE(VButtonArray,ButtonArray); + GDCLASS(VButtonArray,ButtonArray); public: VButtonArray() : ButtonArray(VERTICAL) {}; diff --git a/scene/gui/button_group.cpp b/scene/gui/button_group.cpp index 5d9f290f78..01a3f633c3 100644 --- a/scene/gui/button_group.cpp +++ b/scene/gui/button_group.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -27,6 +27,8 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "button_group.h" + +#if 0 #include "base_button.h" void ButtonGroup::_add_button(BaseButton *p_button) { @@ -149,12 +151,12 @@ int ButtonGroup::get_pressed_button_index() const { void ButtonGroup::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_pressed_button:BaseButton"),&ButtonGroup::get_pressed_button); - ObjectTypeDB::bind_method(_MD("get_pressed_button_index"),&ButtonGroup::get_pressed_button_index); - ObjectTypeDB::bind_method(_MD("get_focused_button:BaseButton"),&ButtonGroup::get_focused_button); - ObjectTypeDB::bind_method(_MD("get_button_list"),&ButtonGroup::_get_button_list); - ObjectTypeDB::bind_method(_MD("_pressed"),&ButtonGroup::_pressed); - ObjectTypeDB::bind_method(_MD("set_pressed_button","button:BaseButton"),&ButtonGroup::_pressed); + ClassDB::bind_method(_MD("get_pressed_button:BaseButton"),&ButtonGroup::get_pressed_button); + ClassDB::bind_method(_MD("get_pressed_button_index"),&ButtonGroup::get_pressed_button_index); + ClassDB::bind_method(_MD("get_focused_button:BaseButton"),&ButtonGroup::get_focused_button); + ClassDB::bind_method(_MD("get_button_list"),&ButtonGroup::_get_button_list); + ClassDB::bind_method(_MD("_pressed"),&ButtonGroup::_pressed); + ClassDB::bind_method(_MD("set_pressed_button","button:BaseButton"),&ButtonGroup::_pressed); ADD_SIGNAL( MethodInfo("button_selected",PropertyInfo(Variant::OBJECT,"button",PROPERTY_HINT_RESOURCE_TYPE,"BaseButton"))); } @@ -162,3 +164,4 @@ void ButtonGroup::_bind_methods() { ButtonGroup::ButtonGroup() : BoxContainer(true) { } +#endif diff --git a/scene/gui/button_group.h b/scene/gui/button_group.h index 4afba22228..38acd06984 100644 --- a/scene/gui/button_group.h +++ b/scene/gui/button_group.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,12 +31,12 @@ #include "scene/gui/box_container.h" - +#if 0 class BaseButton; class ButtonGroup : public BoxContainer { - OBJ_TYPE(ButtonGroup,BoxContainer); + GDCLASS(ButtonGroup,BoxContainer); Set<BaseButton*> buttons; @@ -63,4 +63,5 @@ public: ButtonGroup(); }; +#endif #endif // BUTTON_GROUP_H diff --git a/scene/gui/center_container.cpp b/scene/gui/center_container.cpp index 844175e4c1..4a42695c3a 100644 --- a/scene/gui/center_container.cpp +++ b/scene/gui/center_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -92,8 +92,8 @@ void CenterContainer::_notification(int p_what) { void CenterContainer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_use_top_left","enable"),&CenterContainer::set_use_top_left); - ObjectTypeDB::bind_method(_MD("is_using_top_left"),&CenterContainer::is_using_top_left); + ClassDB::bind_method(_MD("set_use_top_left","enable"),&CenterContainer::set_use_top_left); + ClassDB::bind_method(_MD("is_using_top_left"),&CenterContainer::is_using_top_left); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"use_top_left"),_SCS("set_use_top_left"),_SCS("is_using_top_left")); } diff --git a/scene/gui/center_container.h b/scene/gui/center_container.h index dc95533525..7acc14de19 100644 --- a/scene/gui/center_container.h +++ b/scene/gui/center_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class CenterContainer : public Container { - OBJ_TYPE( CenterContainer, Container ); + GDCLASS( CenterContainer, Container ); bool use_top_left; protected: diff --git a/scene/gui/check_box.cpp b/scene/gui/check_box.cpp index 1381d6eb60..c9803bc654 100644 --- a/scene/gui/check_box.cpp +++ b/scene/gui/check_box.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -56,14 +56,8 @@ void CheckBox::_notification(int p_what) { bool CheckBox::is_radio() { - Node* parent = this; - do { - parent = parent->get_parent(); - if (parent->cast_to<ButtonGroup>()) - break; - } while (parent); - return (parent != 0); + return get_button_group().is_valid(); } CheckBox::CheckBox(const String &p_text): diff --git a/scene/gui/check_box.h b/scene/gui/check_box.h index 95dd4891d4..6a4893936f 100644 --- a/scene/gui/check_box.h +++ b/scene/gui/check_box.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ */ class CheckBox : public Button { - OBJ_TYPE( CheckBox, Button ); + GDCLASS( CheckBox, Button ); protected: diff --git a/scene/gui/check_button.cpp b/scene/gui/check_button.cpp index f8c0c6b208..6404f066e8 100644 --- a/scene/gui/check_button.cpp +++ b/scene/gui/check_button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/check_button.h b/scene/gui/check_button.h index a1ed4c1896..1c5440a25d 100644 --- a/scene/gui/check_button.h +++ b/scene/gui/check_button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ */ class CheckButton : public Button { - OBJ_TYPE( CheckButton, Button ); + GDCLASS( CheckButton, Button ); protected: diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index 5e66544153..ac8ce68564 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,41 +34,20 @@ #include "os/input.h" #include "os/keyboard.h" -void update_material(Ref<CanvasItemMaterial>mat,const Color& p_color,float h,float s,float v) { - if (!mat.is_valid()) - return; - Ref<Shader> sdr = mat->get_shader(); - if (!sdr.is_valid()) - return; - - mat->set_shader_param("R",p_color.r); - mat->set_shader_param("G",p_color.g); - mat->set_shader_param("B",p_color.b); - mat->set_shader_param("H",h); - mat->set_shader_param("S",s); - mat->set_shader_param("V",v); - mat->set_shader_param("A",p_color.a); -} void ColorPicker::_notification(int p_what) { switch(p_what) { case NOTIFICATION_THEME_CHANGED: { - uv_material->set_shader(get_shader("uv_editor")); - w_material->set_shader(get_shader("w_editor")); - update_material(uv_material,color,h,s,v); - update_material(w_material,color,h,s,v); + //sample->set_texture(get_icon("color_sample")); + _update_controls(); } break; case NOTIFICATION_ENTER_TREE: { btn_pick->set_icon(get_icon("screen_picker", "ColorPicker")); - update_material(uv_material, color,h,s,v); - update_material(w_material, color,h,s,v); - uv_edit->get_child(0)->cast_to<Control>()->update(); - w_edit->get_child(0)->cast_to<Control>()->update(); _update_color(); } @@ -109,9 +88,7 @@ void ColorPicker::set_color(const Color& p_color) { if (!is_inside_tree()) return; - update_material(uv_material, color,h,s,v); - update_material(w_material, color,h,s,v); - + return; //it crashes, so returning uv_edit->get_child(0)->cast_to<Control>()->update(); w_edit->get_child(0)->cast_to<Control>()->update(); _update_color(); @@ -141,7 +118,7 @@ void ColorPicker::_value_changed(double) { return; for(int i=0;i<4;i++) { - color.components[i] = scroll[i]->get_val()/(raw_mode_enabled?1.0:255.0); + color.components[i] = scroll[i]->get_value()/(raw_mode_enabled?1.0:255.0); } set_color(color); @@ -162,7 +139,7 @@ void ColorPicker::_html_entered(const String& p_html) { if (!is_inside_tree()) return; - _update_color(); + set_color(color); emit_signal("color_changed",color); } @@ -176,9 +153,9 @@ void ColorPicker::_update_color() { if (raw_mode_enabled) { if (i == 3) scroll[i]->set_max(1); - scroll[i]->set_val(color.components[i]); + scroll[i]->set_value(color.components[i]); } else { - scroll[i]->set_val(color.components[i] * 255); + scroll[i]->set_value(color.components[i] * 255); } } @@ -192,10 +169,24 @@ void ColorPicker::_update_presets() { Size2 size=bt_add_preset->get_size(); preset->set_custom_minimum_size(Size2(size.width*presets.size(),size.height)); - Image i(size.x*presets.size(),size.y, false, Image::FORMAT_RGB); - for (int y=0;y<size.y;y++) - for (int x=0;x<size.x*presets.size();x++) - i.put_pixel(x,y,presets[(int)x/size.x]); + + PoolVector<uint8_t> img; + img.resize(size.x*presets.size()*size.y*3); + + { + PoolVector<uint8_t>::Write w=img.write(); + for (int y=0;y<size.y;y++) { + for (int x=0;x<size.x*presets.size();x++) { + int ofs = (y*(size.x*presets.size())+x)*3; + w[ofs+0]=uint8_t(CLAMP(presets[(int)x/size.x].r*255.0,0,255)); + w[ofs+1]=uint8_t(CLAMP(presets[(int)x/size.x].g*255.0,0,255)); + w[ofs+2]=uint8_t(CLAMP(presets[(int)x/size.x].b*255.0,0,255)); + } + } + } + + Image i(size.x*presets.size(),size.y, false, Image::FORMAT_RGB8,img); + Ref<ImageTexture> t; t.instance(); t->create_from_image(i); @@ -278,14 +269,39 @@ void ColorPicker::_hsv_draw(int p_wich,Control* c) if (!c) return; if (p_wich==0) { + Vector<Point2> points; + points.push_back(Vector2()); + points.push_back(Vector2(c->get_size().x,0)); + points.push_back(c->get_size()); + points.push_back(Vector2(0,c->get_size().y)); + Vector<Color> colors; + colors.push_back(Color(1,1,1)); + colors.push_back(Color(1,1,1)); + colors.push_back(Color()); + colors.push_back(Color()); + c->draw_polygon(points,colors); + Vector<Color> colors2; + Color col = color; + col.set_hsv(color.get_h(),1,1); + col.a = 0; + colors2.push_back(col); + col.a = 1; + colors2.push_back(col); + col.set_hsv(color.get_h(),1,0); + colors2.push_back(col); + col.a = 0; + colors2.push_back(col); + c->draw_polygon(points,colors); int x = CLAMP(c->get_size().x * s, 0, c->get_size().x); int y = CLAMP(c->get_size().y-c->get_size().y * v, 0, c->get_size().y); - Color col = color; + col = color; col.a=1; c->draw_line(Point2(x,0),Point2(x,c->get_size().y),col.inverted()); c->draw_line(Point2(0, y),Point2(c->get_size().x, y),col.inverted()); c->draw_line(Point2(x,y),Point2(x,y),Color(1,1,1),2); } else if (p_wich==1) { + Ref<Texture> hue = get_icon("color_hue","ColorPicker"); + c->draw_texture_rect(hue,Rect2(Point2(),c->get_size())); int y=c->get_size().y-c->get_size().y*h; Color col=Color(); col.set_hsv(h,1,1); @@ -296,7 +312,7 @@ void ColorPicker::_hsv_draw(int p_wich,Control* c) void ColorPicker::_uv_input(const InputEvent &ev) { if (ev.type == InputEvent::MOUSE_BUTTON) { const InputEventMouseButton &bev = ev.mouse_button; - if (bev.pressed) { + if (bev.pressed && bev.button_index==BUTTON_LEFT) { changing_color = true; float x = CLAMP((float)bev.x,0,256); float y = CLAMP((float)bev.y,0,256); @@ -329,7 +345,7 @@ void ColorPicker::_uv_input(const InputEvent &ev) { void ColorPicker::_w_input(const InputEvent &ev) { if (ev.type == InputEvent::MOUSE_BUTTON) { const InputEventMouseButton &bev = ev.mouse_button; - if (bev.pressed) { + if (bev.pressed && bev.button_index==BUTTON_LEFT) { changing_color = true; h=1-((float)bev.y)/256.0; @@ -394,15 +410,23 @@ void ColorPicker::_screen_input(const InputEvent &ev) } else if (ev.type==InputEvent::MOUSE_MOTION) { const InputEventMouse &mev = ev.mouse_motion; Viewport *r=get_tree()->get_root(); - if (!r->get_rect().has_point(Point2(mev.global_x,mev.global_y))) + if (!r->get_visible_rect().has_point(Point2(mev.global_x,mev.global_y))) return; Image img =r->get_screen_capture(); if (!img.empty()) { last_capture=img; r->queue_screen_capture(); } - if (!last_capture.empty()) - set_color(last_capture.get_pixel(mev.global_x,mev.global_y)); + if (!last_capture.empty()) { + int pw = last_capture.get_format()==Image::FORMAT_RGBA8?4:3; + int ofs = (mev.global_y*last_capture.get_width()+mev.global_x)*pw; + + PoolVector<uint8_t>::Read r = last_capture.get_data().read(); + + Color c( r[ofs+0]/255.0, r[ofs+1]/255.0, r[ofs+2]/255.0 ); + + set_color(c); + } } } @@ -418,7 +442,7 @@ void ColorPicker::_screen_pick_pressed() r->add_child(screen); screen->set_as_toplevel(true); screen->set_area_as_parent_rect(); - screen->connect("input_event",this,"_screen_input"); + screen->connect("gui_input",this,"_screen_input"); } screen->raise(); screen->show_modal(); @@ -427,24 +451,24 @@ void ColorPicker::_screen_pick_pressed() void ColorPicker::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_color","color"),&ColorPicker::set_color); - ObjectTypeDB::bind_method(_MD("get_color"),&ColorPicker::get_color); - ObjectTypeDB::bind_method(_MD("set_raw_mode","mode"),&ColorPicker::set_raw_mode); - ObjectTypeDB::bind_method(_MD("is_raw_mode"),&ColorPicker::is_raw_mode); - ObjectTypeDB::bind_method(_MD("set_edit_alpha","show"),&ColorPicker::set_edit_alpha); - ObjectTypeDB::bind_method(_MD("is_editing_alpha"),&ColorPicker::is_editing_alpha); - ObjectTypeDB::bind_method(_MD("add_preset"), &ColorPicker::add_preset); - ObjectTypeDB::bind_method(_MD("_value_changed"),&ColorPicker::_value_changed); - ObjectTypeDB::bind_method(_MD("_html_entered"),&ColorPicker::_html_entered); - ObjectTypeDB::bind_method(_MD("_text_type_toggled"),&ColorPicker::_text_type_toggled); - ObjectTypeDB::bind_method(_MD("_add_preset_pressed"), &ColorPicker::_add_preset_pressed); - ObjectTypeDB::bind_method(_MD("_screen_pick_pressed"), &ColorPicker::_screen_pick_pressed); - ObjectTypeDB::bind_method(_MD("_sample_draw"),&ColorPicker::_sample_draw); - ObjectTypeDB::bind_method(_MD("_hsv_draw"),&ColorPicker::_hsv_draw); - ObjectTypeDB::bind_method(_MD("_uv_input"),&ColorPicker::_uv_input); - ObjectTypeDB::bind_method(_MD("_w_input"),&ColorPicker::_w_input); - ObjectTypeDB::bind_method(_MD("_preset_input"),&ColorPicker::_preset_input); - ObjectTypeDB::bind_method(_MD("_screen_input"),&ColorPicker::_screen_input); + ClassDB::bind_method(_MD("set_color","color"),&ColorPicker::set_color); + ClassDB::bind_method(_MD("get_color"),&ColorPicker::get_color); + ClassDB::bind_method(_MD("set_raw_mode","mode"),&ColorPicker::set_raw_mode); + ClassDB::bind_method(_MD("is_raw_mode"),&ColorPicker::is_raw_mode); + ClassDB::bind_method(_MD("set_edit_alpha","show"),&ColorPicker::set_edit_alpha); + ClassDB::bind_method(_MD("is_editing_alpha"),&ColorPicker::is_editing_alpha); + ClassDB::bind_method(_MD("add_preset"), &ColorPicker::add_preset); + ClassDB::bind_method(_MD("_value_changed"),&ColorPicker::_value_changed); + ClassDB::bind_method(_MD("_html_entered"),&ColorPicker::_html_entered); + ClassDB::bind_method(_MD("_text_type_toggled"),&ColorPicker::_text_type_toggled); + ClassDB::bind_method(_MD("_add_preset_pressed"), &ColorPicker::_add_preset_pressed); + ClassDB::bind_method(_MD("_screen_pick_pressed"), &ColorPicker::_screen_pick_pressed); + ClassDB::bind_method(_MD("_sample_draw"),&ColorPicker::_sample_draw); + ClassDB::bind_method(_MD("_hsv_draw"),&ColorPicker::_hsv_draw); + ClassDB::bind_method(_MD("_uv_input"),&ColorPicker::_uv_input); + ClassDB::bind_method(_MD("_w_input"),&ColorPicker::_w_input); + ClassDB::bind_method(_MD("_preset_input"),&ColorPicker::_preset_input); + ClassDB::bind_method(_MD("_screen_input"),&ColorPicker::_screen_input); ADD_SIGNAL( MethodInfo("color_changed",PropertyInfo(Variant::COLOR,"color"))); } @@ -473,50 +497,30 @@ ColorPicker::ColorPicker() : HBoxContainer *hb_edit = memnew( HBoxContainer ); - uv_edit= memnew ( TextureFrame ); - Image i(256, 256, false, Image::FORMAT_RGB); - for (int y=0;y<256;y++) - for (int x=0;x<256;x++) - i.put_pixel(x,y,Color()); - Ref<ImageTexture> t; - t.instance(); - t->create_from_image(i); - uv_edit->set_texture(t); - uv_edit->set_ignore_mouse(false); - uv_edit->set_custom_minimum_size(Size2(256,256)); - uv_edit->connect("input_event", this, "_uv_input"); - Control *c= memnew( Control ); - uv_edit->add_child(c); - c->set_area_as_parent_rect(); - c->set_stop_mouse(false); - c->set_material(memnew ( CanvasItemMaterial )); + uv_edit= memnew ( Control ); + + + + + uv_edit->connect("gui_input", this, "_uv_input"); + uv_edit->set_mouse_filter(MOUSE_FILTER_PASS); + uv_edit->set_custom_minimum_size(Size2 (256,256)); Vector<Variant> args=Vector<Variant>(); args.push_back(0); - args.push_back(c); - c->connect("draw",this,"_hsv_draw",args); + args.push_back(uv_edit); + uv_edit->connect("draw",this,"_hsv_draw",args); add_child(hb_edit); - w_edit= memnew( TextureFrame ); - i = Image(15, 256, false, Image::FORMAT_RGB); - for (int y=0;y<256;y++) - for (int x=0;x<15;x++) - i.put_pixel(x,y,Color()); - Ref<ImageTexture> tw; - tw.instance(); - tw->create_from_image(i); - w_edit->set_texture(tw); - w_edit->set_ignore_mouse(false); - w_edit->set_custom_minimum_size(Size2(15,256)); - w_edit->connect("input_event", this, "_w_input"); - c= memnew( Control ); - w_edit->add_child(c); - c->set_area_as_parent_rect(); - c->set_stop_mouse(false); - c->set_material(memnew ( CanvasItemMaterial )); + + w_edit= memnew( Control ); + //w_edit->set_ignore_mouse(false); + w_edit->set_custom_minimum_size(Size2(30,256)); + w_edit->connect("gui_input", this, "_w_input"); args.clear(); args.push_back(1); - args.push_back(c); - c->connect("draw",this,"_hsv_draw",args); + args.push_back(w_edit); + w_edit->connect("draw",this,"_hsv_draw",args); + hb_edit->add_child(uv_edit); hb_edit->add_child(memnew( VSeparator )); @@ -580,39 +584,16 @@ ColorPicker::ColorPicker() : //_update_color(); updating=false; - uv_material.instance(); - Ref<Shader> s_uv = get_shader("uv_editor"); - uv_material->set_shader(s_uv); - - w_material.instance(); - - Ref<Shader> s_w = get_shader("w_editor"); - w_material->set_shader(s_w); - - uv_edit->set_material(uv_material); - w_edit->set_material(w_material); - set_color(Color(1,1,1)); - i.create(256,20,false,Image::FORMAT_RGB); - for (int y=0;y<20;y++) - for(int x=0;x<256;x++) - if ((x/4+y/4)%2) - i.put_pixel(x,y,Color(1,1,1)); - else - i.put_pixel(x,y,Color(0.6,0.6,0.6)); - Ref<ImageTexture> t_smpl; - t_smpl.instance(); - t_smpl->create_from_image(i); - sample->set_texture(t_smpl); HBoxContainer *bbc = memnew( HBoxContainer ); add_child(bbc); preset = memnew( TextureFrame ); bbc->add_child(preset); - preset->set_ignore_mouse(false); - preset->connect("input_event", this, "_preset_input"); + //preset->set_ignore_mouse(false); + preset->connect("gui_input", this, "_preset_input"); bt_add_preset = memnew ( Button ); bt_add_preset->set_icon(get_icon("add_preset")); @@ -660,6 +641,7 @@ void ColorPickerButton::set_color(const Color& p_color){ picker->set_color(p_color); update(); + emit_signal("color_changed",p_color); } Color ColorPickerButton::get_color() const{ @@ -683,12 +665,12 @@ ColorPicker *ColorPickerButton::get_picker() { void ColorPickerButton::_bind_methods(){ - ObjectTypeDB::bind_method(_MD("set_color","color"),&ColorPickerButton::set_color); - ObjectTypeDB::bind_method(_MD("get_color"),&ColorPickerButton::get_color); - ObjectTypeDB::bind_method(_MD("get_picker:ColorPicker"),&ColorPickerButton::get_picker); - ObjectTypeDB::bind_method(_MD("set_edit_alpha","show"),&ColorPickerButton::set_edit_alpha); - ObjectTypeDB::bind_method(_MD("is_editing_alpha"),&ColorPickerButton::is_editing_alpha); - ObjectTypeDB::bind_method(_MD("_color_changed"),&ColorPickerButton::_color_changed); + ClassDB::bind_method(_MD("set_color","color"),&ColorPickerButton::set_color); + ClassDB::bind_method(_MD("get_color"),&ColorPickerButton::get_color); + ClassDB::bind_method(_MD("get_picker:ColorPicker"),&ColorPickerButton::get_picker); + ClassDB::bind_method(_MD("set_edit_alpha","show"),&ColorPickerButton::set_edit_alpha); + ClassDB::bind_method(_MD("is_editing_alpha"),&ColorPickerButton::is_editing_alpha); + ClassDB::bind_method(_MD("_color_changed"),&ColorPickerButton::_color_changed); ADD_SIGNAL( MethodInfo("color_changed",PropertyInfo(Variant::COLOR,"color"))); ADD_PROPERTY( PropertyInfo(Variant::COLOR,"color"),_SCS("set_color"),_SCS("get_color") ); @@ -701,7 +683,7 @@ ColorPickerButton::ColorPickerButton() { popup = memnew( PopupPanel ); picker = memnew( ColorPicker ); popup->add_child(picker); - popup->set_child_rect(picker); + picker->connect("color_changed",this,"_color_changed"); add_child(popup); } diff --git a/scene/gui/color_picker.h b/scene/gui/color_picker.h index 5e2cc57274..c6a8ef7725 100644 --- a/scene/gui/color_picker.h +++ b/scene/gui/color_picker.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,26 +39,23 @@ #include "scene/gui/texture_frame.h" #include "scene/gui/tool_button.h" #include "scene/gui/check_button.h" -#include "scene/resources/material.h" class ColorPicker : public BoxContainer { - OBJ_TYPE(ColorPicker,BoxContainer); + GDCLASS(ColorPicker,BoxContainer); private: Control *screen; Image last_capture; - TextureFrame *uv_edit; - TextureFrame *w_edit; + Control *uv_edit; + Control *w_edit; TextureFrame *sample; TextureFrame *preset; Button *bt_add_preset; List<Color> presets; ToolButton *btn_pick; CheckButton *btn_mode; - Ref<CanvasItemMaterial> uv_material; - Ref<CanvasItemMaterial> w_material; HSlider *scroll[4]; SpinBox *values[4]; Label *labels[4]; @@ -115,7 +112,7 @@ public: class ColorPickerButton : public Button { - OBJ_TYPE(ColorPickerButton,Button); + GDCLASS(ColorPickerButton,Button); PopupPanel *popup; ColorPicker *picker; diff --git a/scene/gui/color_ramp_edit.cpp b/scene/gui/color_ramp_edit.cpp index b7347f00dc..c3ed3d821d 100644 --- a/scene/gui/color_ramp_edit.cpp +++ b/scene/gui/color_ramp_edit.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ ColorRampEdit::ColorRampEdit(){ popup = memnew( PopupPanel ); picker = memnew( ColorPicker ); popup->add_child(picker); - popup->set_child_rect(picker); + add_child(popup); checker = Ref<ImageTexture>(memnew( ImageTexture )); @@ -70,7 +70,7 @@ ColorRampEdit::~ColorRampEdit() { } -void ColorRampEdit::_input_event(const InputEvent& p_event) { +void ColorRampEdit::_gui_input(const InputEvent& p_event) { if (p_event.type==InputEvent::KEY && p_event.key.pressed && p_event.key.scancode==KEY_DELETE && grabbed!=-1) { @@ -446,7 +446,7 @@ Vector<ColorRamp::Point>& ColorRampEdit::get_points() { } void ColorRampEdit::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_input_event"),&ColorRampEdit::_input_event); - ObjectTypeDB::bind_method(_MD("_color_changed"),&ColorRampEdit::_color_changed); + ClassDB::bind_method(_MD("_gui_input"),&ColorRampEdit::_gui_input); + ClassDB::bind_method(_MD("_color_changed"),&ColorRampEdit::_color_changed); ADD_SIGNAL(MethodInfo("ramp_changed")); } diff --git a/scene/gui/color_ramp_edit.h b/scene/gui/color_ramp_edit.h index 61365d9f07..c6a20a539d 100644 --- a/scene/gui/color_ramp_edit.h +++ b/scene/gui/color_ramp_edit.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -38,7 +38,7 @@ class ColorRampEdit : public Control { - OBJ_TYPE(ColorRampEdit,Control); + GDCLASS(ColorRampEdit,Control); PopupPanel *popup; ColorPicker *picker; @@ -55,7 +55,7 @@ class ColorRampEdit : public Control { void _show_color_picker(); protected: - void _input_event(const InputEvent& p_event); + void _gui_input(const InputEvent& p_event); void _notification(int p_what); static void _bind_methods(); @@ -73,7 +73,7 @@ public: /*class ColorRampEditPanel : public Panel { - OBJ_TYPE(ColorRampEditPanel, Panel ); + GDCLASS(ColorRampEditPanel, Panel ); };*/ diff --git a/scene/gui/color_rect.cpp b/scene/gui/color_rect.cpp index a0e4df66b5..fee96d1ca9 100644 --- a/scene/gui/color_rect.cpp +++ b/scene/gui/color_rect.cpp @@ -23,8 +23,8 @@ void ColorFrame::_notification(int p_what) { void ColorFrame::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_frame_color","color"),&ColorFrame::set_frame_color); - ObjectTypeDB::bind_method(_MD("get_frame_color"),&ColorFrame::get_frame_color); + ClassDB::bind_method(_MD("set_frame_color","color"),&ColorFrame::set_frame_color); + ClassDB::bind_method(_MD("get_frame_color"),&ColorFrame::get_frame_color); ADD_PROPERTY(PropertyInfo(Variant::COLOR,"color"),_SCS("set_frame_color"),_SCS("get_frame_color") ); } diff --git a/scene/gui/color_rect.h b/scene/gui/color_rect.h index 3816d44052..f313bbc4f9 100644 --- a/scene/gui/color_rect.h +++ b/scene/gui/color_rect.h @@ -4,7 +4,7 @@ #include "scene/gui/control.h" class ColorFrame : public Control { - OBJ_TYPE(ColorFrame,Control) + GDCLASS(ColorFrame,Control) Color color; protected: diff --git a/scene/gui/container.cpp b/scene/gui/container.cpp index feaf516f42..a5a5c61082 100644 --- a/scene/gui/container.cpp +++ b/scene/gui/container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -156,11 +156,11 @@ void Container::_notification(int p_what) { void Container::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_sort_children"),&Container::_sort_children); - ObjectTypeDB::bind_method(_MD("_child_minsize_changed"),&Container::_child_minsize_changed); + ClassDB::bind_method(_MD("_sort_children"),&Container::_sort_children); + ClassDB::bind_method(_MD("_child_minsize_changed"),&Container::_child_minsize_changed); - ObjectTypeDB::bind_method(_MD("queue_sort"),&Container::queue_sort); - ObjectTypeDB::bind_method(_MD("fit_child_in_rect","child:Control","rect"),&Container::fit_child_in_rect); + ClassDB::bind_method(_MD("queue_sort"),&Container::queue_sort); + ClassDB::bind_method(_MD("fit_child_in_rect","child:Control","rect"),&Container::fit_child_in_rect); BIND_CONSTANT( NOTIFICATION_SORT_CHILDREN ); ADD_SIGNAL(MethodInfo("sort_children")); diff --git a/scene/gui/container.h b/scene/gui/container.h index 1c7587c155..bb47524972 100644 --- a/scene/gui/container.h +++ b/scene/gui/container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class Container : public Control { - OBJ_TYPE(Container,Control); + GDCLASS(Container,Control); bool pending_sort; void _sort_children(); diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 97f0db97c2..b3d86f85ea 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -96,7 +96,7 @@ Size2 Control::edit_get_minimum_size() const { void Control::edit_set_rect(const Rect2& p_edit_rect) { - Matrix32 postxf; + Transform2D postxf; postxf.set_rotation_and_scale(data.rotation,data.scale); Vector2 new_pos = postxf.xform(p_edit_rect.pos); @@ -116,30 +116,7 @@ bool Control::_set(const StringName& p_name, const Variant& p_value) { String name= p_name; if (!name.begins_with("custom")) { - if (name.begins_with("margin/")) { - String dname = name.get_slicec('/', 1); - if (dname == "left") { - set_margin(MARGIN_LEFT, p_value); - return true; - } - else if (dname == "top") { - set_margin(MARGIN_TOP, p_value); - return true; - } - else if (dname == "right") { - set_margin(MARGIN_RIGHT, p_value); - return true; - } - else if (dname == "bottom") { - set_margin(MARGIN_BOTTOM, p_value); - return true; - } - else { - return false; - } - } else { - return false; - } + return false; } if (p_value.get_type()==Variant::NIL) { @@ -235,30 +212,8 @@ bool Control::_get(const StringName& p_name,Variant &r_ret) const { String sname=p_name; if (!sname.begins_with("custom")) { - if (sname.begins_with("margin/")) { - String dname = sname.get_slicec('/', 1); - if (dname == "left") { - r_ret = get_margin(MARGIN_LEFT); - return true; - } - else if (dname == "top") { - r_ret = get_margin(MARGIN_TOP); - return true; - } - else if (dname == "right") { - r_ret = get_margin(MARGIN_RIGHT); - return true; - } - else if (dname == "bottom") { - r_ret = get_margin(MARGIN_BOTTOM); - return true; - } - else { - return false; - } - } else { - return false; - } + return false; + } if (sname.begins_with("custom_icons/")) { @@ -295,36 +250,6 @@ bool Control::_get(const StringName& p_name,Variant &r_ret) const { } void Control::_get_property_list( List<PropertyInfo> *p_list) const { - { - if (get_anchor(MARGIN_LEFT) == ANCHOR_RATIO) { - p_list->push_back(PropertyInfo(Variant::REAL, "margin/left", PROPERTY_HINT_RANGE, "-4096,4096,0.001")); - } - else { - p_list->push_back(PropertyInfo(Variant::INT, "margin/left", PROPERTY_HINT_RANGE, "-4096,4096")); - } - - if (get_anchor(MARGIN_TOP) == ANCHOR_RATIO) { - p_list->push_back(PropertyInfo(Variant::REAL, "margin/top", PROPERTY_HINT_RANGE, "-4096,4096,0.001")); - } - else { - p_list->push_back(PropertyInfo(Variant::INT, "margin/top", PROPERTY_HINT_RANGE, "-4096,4096")); - } - - if (get_anchor(MARGIN_RIGHT) == ANCHOR_RATIO) { - p_list->push_back(PropertyInfo(Variant::REAL, "margin/right", PROPERTY_HINT_RANGE, "-4096,4096,0.001")); - } - else { - p_list->push_back(PropertyInfo(Variant::INT, "margin/right", PROPERTY_HINT_RANGE, "-4096,4096")); - } - - if (get_anchor(MARGIN_BOTTOM) == ANCHOR_RATIO) { - p_list->push_back(PropertyInfo(Variant::REAL, "margin/bottom", PROPERTY_HINT_RANGE, "-4096,4096,0.001")); - } - else { - p_list->push_back(PropertyInfo(Variant::INT, "margin/bottom", PROPERTY_HINT_RANGE, "-4096,4096")); - } - } - Ref<Theme> theme; if (data.theme.is_valid()) { @@ -336,7 +261,7 @@ void Control::_get_property_list( List<PropertyInfo> *p_list) const { { List<StringName> names; - theme->get_icon_list(get_type_name(),&names); + theme->get_icon_list(get_class_name(),&names); for(List<StringName>::Element *E=names.front();E;E=E->next()) { uint32_t hint= PROPERTY_USAGE_EDITOR|PROPERTY_USAGE_CHECKABLE; @@ -348,7 +273,7 @@ void Control::_get_property_list( List<PropertyInfo> *p_list) const { } { List<StringName> names; - theme->get_shader_list(get_type_name(),&names); + theme->get_shader_list(get_class_name(),&names); for(List<StringName>::Element *E=names.front();E;E=E->next()) { uint32_t hint= PROPERTY_USAGE_EDITOR|PROPERTY_USAGE_CHECKABLE; @@ -360,7 +285,7 @@ void Control::_get_property_list( List<PropertyInfo> *p_list) const { } { List<StringName> names; - theme->get_stylebox_list(get_type_name(),&names); + theme->get_stylebox_list(get_class_name(),&names); for(List<StringName>::Element *E=names.front();E;E=E->next()) { uint32_t hint= PROPERTY_USAGE_EDITOR|PROPERTY_USAGE_CHECKABLE; @@ -372,7 +297,7 @@ void Control::_get_property_list( List<PropertyInfo> *p_list) const { } { List<StringName> names; - theme->get_font_list(get_type_name(),&names); + theme->get_font_list(get_class_name(),&names); for(List<StringName>::Element *E=names.front();E;E=E->next()) { uint32_t hint= PROPERTY_USAGE_EDITOR|PROPERTY_USAGE_CHECKABLE; @@ -384,7 +309,7 @@ void Control::_get_property_list( List<PropertyInfo> *p_list) const { } { List<StringName> names; - theme->get_color_list(get_type_name(),&names); + theme->get_color_list(get_class_name(),&names); for(List<StringName>::Element *E=names.front();E;E=E->next()) { uint32_t hint= PROPERTY_USAGE_EDITOR|PROPERTY_USAGE_CHECKABLE; @@ -396,7 +321,7 @@ void Control::_get_property_list( List<PropertyInfo> *p_list) const { } { List<StringName> names; - theme->get_constant_list(get_type_name(),&names); + theme->get_constant_list(get_class_name(),&names); for(List<StringName>::Element *E=names.front();E;E=E->next()) { uint32_t hint= PROPERTY_USAGE_EDITOR|PROPERTY_USAGE_CHECKABLE; @@ -449,7 +374,7 @@ void Control::remove_child_notify(Node *p_child) { void Control::_update_canvas_item_transform() { - Matrix32 xform=Matrix32(data.rotation,get_pos()); + Transform2D xform=Transform2D(data.rotation,get_pos()); xform.scale_basis(data.scale); VisualServer::get_singleton()->canvas_item_set_transform(get_canvas_item(),xform); @@ -480,10 +405,10 @@ void Control::_notification(int p_notification) { if (is_set_as_toplevel()) { data.SI=get_viewport()->_gui_add_subwindow_control(this); - /*if (data.theme.is_null() && data.parent && data.parent->data.theme_owner) { + if (data.theme.is_null() && data.parent && data.parent->data.theme_owner) { data.theme_owner=data.parent->data.theme_owner; notification(NOTIFICATION_THEME_CHANGED); - }*/ + } } else { @@ -519,10 +444,10 @@ void Control::_notification(int p_notification) { if (parent_control) { //do nothing, has a parent control - /*if (data.theme.is_null() && parent_control->data.theme_owner) { + if (data.theme.is_null() && parent_control->data.theme_owner) { data.theme_owner=parent_control->data.theme_owner; notification(NOTIFICATION_THEME_CHANGED); - }*/ + } } else if (subwindow) { //is a subwindow (process input before other controls for that canvas) data.SI=get_viewport()->_gui_add_subwindow_control(this); @@ -607,7 +532,7 @@ void Control::_notification(int p_notification) { _update_canvas_item_transform(); VisualServer::get_singleton()->canvas_item_set_custom_rect( get_canvas_item(),!data.disable_visibility_clip, Rect2(Point2(),get_size())); - + VisualServer::get_singleton()->canvas_item_set_clip( get_canvas_item(), data.clip_contents ); //emit_signal(SceneStringNames::get_singleton()->draw); } break; @@ -822,7 +747,7 @@ Ref<Texture> Control::get_icon(const StringName& p_name,const StringName& p_type return *tex; } - StringName type = p_type?p_type:get_type_name(); + StringName type = p_type?p_type:get_class_name(); // try with custom themes Control *theme_owner = data.theme_owner; @@ -852,7 +777,7 @@ Ref<Shader> Control::get_shader(const StringName& p_name,const StringName& p_typ return *sdr; } - StringName type = p_type?p_type:get_type_name(); + StringName type = p_type?p_type:get_class_name(); // try with custom themes Control *theme_owner = data.theme_owner; @@ -881,7 +806,7 @@ Ref<StyleBox> Control::get_stylebox(const StringName& p_name,const StringName& p return *style; } - StringName type = p_type?p_type:get_type_name(); + StringName type = p_type?p_type:get_class_name(); // try with custom themes Control *theme_owner = data.theme_owner; @@ -910,7 +835,7 @@ Ref<Font> Control::get_font(const StringName& p_name,const StringName& p_type) c return *font; } - StringName type = p_type?p_type:get_type_name(); + StringName type = p_type?p_type:get_class_name(); // try with custom themes Control *theme_owner = data.theme_owner; @@ -941,7 +866,7 @@ Color Control::get_color(const StringName& p_name,const StringName& p_type) cons return *color; } - StringName type = p_type?p_type:get_type_name(); + StringName type = p_type?p_type:get_class_name(); // try with custom themes Control *theme_owner = data.theme_owner; @@ -970,7 +895,7 @@ int Control::get_constant(const StringName& p_name,const StringName& p_type) con return *constant; } - StringName type = p_type?p_type:get_type_name(); + StringName type = p_type?p_type:get_class_name(); // try with custom themes Control *theme_owner = data.theme_owner; @@ -1053,7 +978,7 @@ bool Control::has_icon(const StringName& p_name,const StringName& p_type) const return true; } - StringName type = p_type?p_type:get_type_name(); + StringName type = p_type?p_type:get_class_name(); // try with custom themes Control *theme_owner = data.theme_owner; @@ -1082,7 +1007,7 @@ bool Control::has_shader(const StringName &p_name, const StringName &p_type) con return true; } - StringName type = p_type?p_type:get_type_name(); + StringName type = p_type?p_type:get_class_name(); // try with custom themes Control *theme_owner = data.theme_owner; @@ -1110,7 +1035,7 @@ bool Control::has_stylebox(const StringName& p_name,const StringName& p_type) co return true; } - StringName type = p_type?p_type:get_type_name(); + StringName type = p_type?p_type:get_class_name(); // try with custom themes Control *theme_owner = data.theme_owner; @@ -1139,7 +1064,7 @@ bool Control::has_font(const StringName& p_name,const StringName& p_type) const } - StringName type = p_type?p_type:get_type_name(); + StringName type = p_type?p_type:get_class_name(); // try with custom themes Control *theme_owner = data.theme_owner; @@ -1168,7 +1093,7 @@ bool Control::has_color(const StringName& p_name, const StringName& p_type) cons return true; } - StringName type = p_type?p_type:get_type_name(); + StringName type = p_type?p_type:get_class_name(); // try with custom themes Control *theme_owner = data.theme_owner; @@ -1198,7 +1123,7 @@ bool Control::has_constant(const StringName& p_name,const StringName& p_type) co } - StringName type = p_type?p_type:get_type_name(); + StringName type = p_type?p_type:get_class_name(); // try with custom themes Control *theme_owner = data.theme_owner; @@ -1258,14 +1183,10 @@ void Control::_size_changed() { margin_pos[i]=area-data.margin[i]; } break; - case ANCHOR_RATIO: { + case ANCHOR_CENTER: { - margin_pos[i]=area*data.margin[i]; + margin_pos[i]=(area/2)-data.margin[i]; } break; - case ANCHOR_CENTER: { - - margin_pos[i]=(area/2)-data.margin[i]; - } break; } } @@ -1334,12 +1255,9 @@ float Control::_s2a(float p_val, AnchorType p_anchor,float p_range) const { case ANCHOR_END: { return p_range-p_val; } break; - case ANCHOR_RATIO: { - return p_val/p_range; + case ANCHOR_CENTER: { + return (p_range/2)-p_val; } break; - case ANCHOR_CENTER: { - return (p_range/2)-p_val; - } break; } return 0; @@ -1356,11 +1274,8 @@ float Control::_a2s(float p_val, AnchorType p_anchor,float p_range) const { case ANCHOR_END: { return Math::floor(p_range-p_val); } break; - case ANCHOR_RATIO: { - return Math::floor(p_range*p_val); - } break; case ANCHOR_CENTER: { - return Math::floor((p_range/2)-p_val); + return Math::floor((p_range/2)-p_val); } break; } return 0; @@ -1387,7 +1302,7 @@ void Control::set_anchor(Margin p_margin,AnchorType p_anchor, bool p_keep_margin void Control::_set_anchor(Margin p_margin,AnchorType p_anchor) { #ifdef TOOLS_ENABLED if (is_inside_tree() && get_tree()->is_editor_hint()) { - set_anchor(p_margin, p_anchor, EDITOR_DEF("2d_editor/keep_margins_when_changing_anchors", false)); + set_anchor(p_margin, p_anchor, EDITOR_DEF("editors/2d/keep_margins_when_changing_anchors", false)); } else { set_anchor(p_margin, p_anchor, false); } @@ -1467,7 +1382,7 @@ Point2 Control::get_global_pos() const { void Control::set_global_pos(const Point2& p_point) { - Matrix32 inv; + Transform2D inv; if (data.parent_canvas_item) { @@ -2003,9 +1918,9 @@ Control::CursorShape Control::get_cursor_shape(const Point2& p_pos) const { return data.default_cursor; } -Matrix32 Control::get_transform() const { +Transform2D Control::get_transform() const { - Matrix32 xform=Matrix32(data.rotation,get_pos()); + Transform2D xform=Transform2D(data.rotation,get_pos()); xform.scale_basis(data.scale); return xform; } @@ -2066,7 +1981,7 @@ Control *Control::_get_focus_neighbour(Margin p_margin,int p_count) { Point2 points[4]; - Matrix32 xform = get_global_transform(); + Transform2D xform = get_global_transform(); Rect2 rect = get_item_rect(); points[0]=xform.xform(rect.pos); @@ -2126,7 +2041,7 @@ void Control::_window_find_focus_neighbour(const Vector2& p_dir, Node *p_at,cons Point2 points[4]; - Matrix32 xform = c->get_global_transform(); + Transform2D xform = c->get_global_transform(); Rect2 rect = c->get_item_rect(); points[0]=xform.xform(rect.pos); @@ -2246,25 +2161,17 @@ int Control::get_v_size_flags() const{ return data.v_size_flags; } -void Control::set_ignore_mouse(bool p_ignore) { - - data.ignore_mouse=p_ignore; -} - -bool Control::is_ignoring_mouse() const { +void Control::set_mouse_filter(MouseFilter p_filter) { - return data.ignore_mouse; + ERR_FAIL_INDEX(p_filter,3); + data.mouse_filter=p_filter; } -void Control::set_stop_mouse(bool p_stop) { +Control::MouseFilter Control::get_mouse_filter() const{ - data.stop_mouse=p_stop; + return data.mouse_filter; } -bool Control::is_stopping_mouse() const { - - return data.stop_mouse; -} Control *Control::get_focus_owner() const { @@ -2414,15 +2321,15 @@ void Control::get_argument_options(const StringName& p_function,int p_idx,List<S List<StringName> sn; String pf = p_function; if (pf=="add_color_override" || pf=="has_color" || pf=="has_color_override" || pf=="get_color") { - Theme::get_default()->get_color_list(get_type(),&sn); + Theme::get_default()->get_color_list(get_class(),&sn); } else if (pf=="add_style_override" || pf=="has_style" || pf=="has_style_override" || pf=="get_style") { - Theme::get_default()->get_stylebox_list(get_type(),&sn); + Theme::get_default()->get_stylebox_list(get_class(),&sn); } else if (pf=="add_font_override" || pf=="has_font" || pf=="has_font_override" || pf=="get_font") { - Theme::get_default()->get_font_list(get_type(),&sn); + Theme::get_default()->get_font_list(get_class(),&sn); } else if (pf=="add_constant_override" || pf=="has_constant" || pf=="has_constant_override" || pf=="get_constant") { - Theme::get_default()->get_constant_list(get_type(),&sn); + Theme::get_default()->get_constant_list(get_class(),&sn); } else if (pf=="add_color_override" || pf=="has_color" || pf=="has_color_override" || pf=="get_color") { - Theme::get_default()->get_color_list(get_type(),&sn); + Theme::get_default()->get_color_list(get_class(),&sn); } sn.sort_custom<StringName::AlphCompare>(); @@ -2433,163 +2340,190 @@ void Control::get_argument_options(const StringName& p_function,int p_idx,List<S } +void Control::set_clip_contents(bool p_clip) { + + data.clip_contents=p_clip; + update(); +} + +bool Control::is_clipping_contents() { + + return data.clip_contents; +} void Control::_bind_methods() { -// ObjectTypeDB::bind_method(_MD("_window_resize_event"),&Control::_window_resize_event); - ObjectTypeDB::bind_method(_MD("_size_changed"),&Control::_size_changed); - ObjectTypeDB::bind_method(_MD("_update_minimum_size"),&Control::_update_minimum_size); - - ObjectTypeDB::bind_method(_MD("accept_event"),&Control::accept_event); - ObjectTypeDB::bind_method(_MD("get_minimum_size"),&Control::get_minimum_size); - ObjectTypeDB::bind_method(_MD("get_combined_minimum_size"),&Control::get_combined_minimum_size); - ObjectTypeDB::bind_method(_MD("set_anchor","margin","anchor_mode","keep_margin"),&Control::set_anchor,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("_set_anchor","margin","anchor_mode"),&Control::_set_anchor); - ObjectTypeDB::bind_method(_MD("get_anchor","margin"),&Control::get_anchor); - ObjectTypeDB::bind_method(_MD("set_margin","margin","offset"),&Control::set_margin); - ObjectTypeDB::bind_method(_MD("set_anchor_and_margin","margin","anchor_mode","offset"),&Control::set_anchor_and_margin); - ObjectTypeDB::bind_method(_MD("set_begin","pos"),&Control::set_begin); - ObjectTypeDB::bind_method(_MD("set_end","pos"),&Control::set_end); - ObjectTypeDB::bind_method(_MD("set_pos","pos"),&Control::set_pos); - ObjectTypeDB::bind_method(_MD("set_size","size"),&Control::set_size); - ObjectTypeDB::bind_method(_MD("set_custom_minimum_size","size"),&Control::set_custom_minimum_size); - ObjectTypeDB::bind_method(_MD("set_global_pos","pos"),&Control::set_global_pos); - ObjectTypeDB::bind_method(_MD("set_rotation","radians"),&Control::set_rotation); - ObjectTypeDB::bind_method(_MD("set_rotation_deg","degrees"),&Control::set_rotation_deg); +// ClassDB::bind_method(_MD("_window_resize_event"),&Control::_window_resize_event); + ClassDB::bind_method(_MD("_size_changed"),&Control::_size_changed); + ClassDB::bind_method(_MD("_update_minimum_size"),&Control::_update_minimum_size); + + ClassDB::bind_method(_MD("accept_event"),&Control::accept_event); + ClassDB::bind_method(_MD("get_minimum_size"),&Control::get_minimum_size); + ClassDB::bind_method(_MD("get_combined_minimum_size"),&Control::get_combined_minimum_size); + ClassDB::bind_method(_MD("set_anchor","margin","anchor_mode","keep_margin"),&Control::set_anchor,DEFVAL(false)); + ClassDB::bind_method(_MD("_set_anchor","margin","anchor_mode"),&Control::_set_anchor); + ClassDB::bind_method(_MD("get_anchor","margin"),&Control::get_anchor); + ClassDB::bind_method(_MD("set_margin","margin","offset"),&Control::set_margin); + ClassDB::bind_method(_MD("set_anchor_and_margin","margin","anchor_mode","offset"),&Control::set_anchor_and_margin); + ClassDB::bind_method(_MD("set_begin","pos"),&Control::set_begin); + ClassDB::bind_method(_MD("set_end","pos"),&Control::set_end); + ClassDB::bind_method(_MD("set_pos","pos"),&Control::set_pos); + ClassDB::bind_method(_MD("set_size","size"),&Control::set_size); + ClassDB::bind_method(_MD("set_custom_minimum_size","size"),&Control::set_custom_minimum_size); + ClassDB::bind_method(_MD("set_global_pos","pos"),&Control::set_global_pos); + ClassDB::bind_method(_MD("set_rotation","radians"),&Control::set_rotation); + ClassDB::bind_method(_MD("set_rotation_deg","degrees"),&Control::set_rotation_deg); // TODO: Obsolete this method (old name) properly (GH-4397) - ObjectTypeDB::bind_method(_MD("_set_rotation_deg","degrees"),&Control::_set_rotation_deg); - ObjectTypeDB::bind_method(_MD("set_scale","scale"),&Control::set_scale); - ObjectTypeDB::bind_method(_MD("get_margin","margin"),&Control::get_margin); - ObjectTypeDB::bind_method(_MD("get_begin"),&Control::get_begin); - ObjectTypeDB::bind_method(_MD("get_end"),&Control::get_end); - ObjectTypeDB::bind_method(_MD("get_pos"),&Control::get_pos); - ObjectTypeDB::bind_method(_MD("get_size"),&Control::get_size); - ObjectTypeDB::bind_method(_MD("get_rotation"),&Control::get_rotation); - ObjectTypeDB::bind_method(_MD("get_rotation_deg"),&Control::get_rotation_deg); + ClassDB::bind_method(_MD("_set_rotation_deg","degrees"),&Control::_set_rotation_deg); + ClassDB::bind_method(_MD("set_scale","scale"),&Control::set_scale); + ClassDB::bind_method(_MD("get_margin","margin"),&Control::get_margin); + ClassDB::bind_method(_MD("get_begin"),&Control::get_begin); + ClassDB::bind_method(_MD("get_end"),&Control::get_end); + ClassDB::bind_method(_MD("get_pos"),&Control::get_pos); + ClassDB::bind_method(_MD("get_size"),&Control::get_size); + ClassDB::bind_method(_MD("get_rotation"),&Control::get_rotation); + ClassDB::bind_method(_MD("get_rotation_deg"),&Control::get_rotation_deg); // TODO: Obsolete this method (old name) properly (GH-4397) - ObjectTypeDB::bind_method(_MD("_get_rotation_deg"),&Control::_get_rotation_deg); - ObjectTypeDB::bind_method(_MD("get_scale"),&Control::get_scale); - ObjectTypeDB::bind_method(_MD("get_custom_minimum_size"),&Control::get_custom_minimum_size); - ObjectTypeDB::bind_method(_MD("get_parent_area_size"),&Control::get_size); - ObjectTypeDB::bind_method(_MD("get_global_pos"),&Control::get_global_pos); - ObjectTypeDB::bind_method(_MD("get_rect"),&Control::get_rect); - ObjectTypeDB::bind_method(_MD("get_global_rect"),&Control::get_global_rect); - ObjectTypeDB::bind_method(_MD("set_area_as_parent_rect","margin"),&Control::set_area_as_parent_rect,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("show_modal","exclusive"),&Control::show_modal,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("set_focus_mode","mode"),&Control::set_focus_mode); - ObjectTypeDB::bind_method(_MD("get_focus_mode"),&Control::get_focus_mode); - ObjectTypeDB::bind_method(_MD("has_focus"),&Control::has_focus); - ObjectTypeDB::bind_method(_MD("grab_focus"),&Control::grab_focus); - ObjectTypeDB::bind_method(_MD("release_focus"),&Control::release_focus); - ObjectTypeDB::bind_method(_MD("get_focus_owner:Control"),&Control::get_focus_owner); + ClassDB::bind_method(_MD("_get_rotation_deg"),&Control::_get_rotation_deg); + ClassDB::bind_method(_MD("get_scale"),&Control::get_scale); + ClassDB::bind_method(_MD("get_custom_minimum_size"),&Control::get_custom_minimum_size); + ClassDB::bind_method(_MD("get_parent_area_size"),&Control::get_size); + ClassDB::bind_method(_MD("get_global_pos"),&Control::get_global_pos); + ClassDB::bind_method(_MD("get_rect"),&Control::get_rect); + ClassDB::bind_method(_MD("get_global_rect"),&Control::get_global_rect); + ClassDB::bind_method(_MD("set_area_as_parent_rect","margin"),&Control::set_area_as_parent_rect,DEFVAL(0)); + ClassDB::bind_method(_MD("show_modal","exclusive"),&Control::show_modal,DEFVAL(false)); + ClassDB::bind_method(_MD("set_focus_mode","mode"),&Control::set_focus_mode); + ClassDB::bind_method(_MD("get_focus_mode"),&Control::get_focus_mode); + ClassDB::bind_method(_MD("has_focus"),&Control::has_focus); + ClassDB::bind_method(_MD("grab_focus"),&Control::grab_focus); + ClassDB::bind_method(_MD("release_focus"),&Control::release_focus); + ClassDB::bind_method(_MD("get_focus_owner:Control"),&Control::get_focus_owner); - ObjectTypeDB::bind_method(_MD("set_h_size_flags","flags"),&Control::set_h_size_flags); - ObjectTypeDB::bind_method(_MD("get_h_size_flags"),&Control::get_h_size_flags); + ClassDB::bind_method(_MD("set_h_size_flags","flags"),&Control::set_h_size_flags); + ClassDB::bind_method(_MD("get_h_size_flags"),&Control::get_h_size_flags); - ObjectTypeDB::bind_method(_MD("set_stretch_ratio","ratio"),&Control::set_stretch_ratio); - ObjectTypeDB::bind_method(_MD("get_stretch_ratio"),&Control::get_stretch_ratio); + ClassDB::bind_method(_MD("set_stretch_ratio","ratio"),&Control::set_stretch_ratio); + ClassDB::bind_method(_MD("get_stretch_ratio"),&Control::get_stretch_ratio); - ObjectTypeDB::bind_method(_MD("set_v_size_flags","flags"),&Control::set_v_size_flags); - ObjectTypeDB::bind_method(_MD("get_v_size_flags"),&Control::get_v_size_flags); + ClassDB::bind_method(_MD("set_v_size_flags","flags"),&Control::set_v_size_flags); + ClassDB::bind_method(_MD("get_v_size_flags"),&Control::get_v_size_flags); - ObjectTypeDB::bind_method(_MD("set_theme","theme:Theme"),&Control::set_theme); - ObjectTypeDB::bind_method(_MD("get_theme:Theme"),&Control::get_theme); + ClassDB::bind_method(_MD("set_theme","theme:Theme"),&Control::set_theme); + ClassDB::bind_method(_MD("get_theme:Theme"),&Control::get_theme); - ObjectTypeDB::bind_method(_MD("add_icon_override","name","texture:Texture"),&Control::add_icon_override); - ObjectTypeDB::bind_method(_MD("add_shader_override","name","shader:Shader"),&Control::add_shader_override); - ObjectTypeDB::bind_method(_MD("add_style_override","name","stylebox:StyleBox"),&Control::add_style_override); - ObjectTypeDB::bind_method(_MD("add_font_override","name","font:Font"),&Control::add_font_override); - ObjectTypeDB::bind_method(_MD("add_color_override","name","color"),&Control::add_color_override); - ObjectTypeDB::bind_method(_MD("add_constant_override","name","constant"),&Control::add_constant_override); + ClassDB::bind_method(_MD("add_icon_override","name","texture:Texture"),&Control::add_icon_override); + ClassDB::bind_method(_MD("add_shader_override","name","shader:Shader"),&Control::add_shader_override); + ClassDB::bind_method(_MD("add_style_override","name","stylebox:StyleBox"),&Control::add_style_override); + ClassDB::bind_method(_MD("add_font_override","name","font:Font"),&Control::add_font_override); + ClassDB::bind_method(_MD("add_color_override","name","color"),&Control::add_color_override); + ClassDB::bind_method(_MD("add_constant_override","name","constant"),&Control::add_constant_override); - ObjectTypeDB::bind_method(_MD("get_icon:Texture","name","type"),&Control::get_icon,DEFVAL("")); - ObjectTypeDB::bind_method(_MD("get_stylebox:StyleBox","name","type"),&Control::get_stylebox,DEFVAL("")); - ObjectTypeDB::bind_method(_MD("get_font:Font","name","type"),&Control::get_font,DEFVAL("")); - ObjectTypeDB::bind_method(_MD("get_color","name","type"),&Control::get_color,DEFVAL("")); - ObjectTypeDB::bind_method(_MD("get_constant","name","type"),&Control::get_constant,DEFVAL("")); + ClassDB::bind_method(_MD("get_icon:Texture","name","type"),&Control::get_icon,DEFVAL("")); + ClassDB::bind_method(_MD("get_stylebox:StyleBox","name","type"),&Control::get_stylebox,DEFVAL("")); + ClassDB::bind_method(_MD("get_font:Font","name","type"),&Control::get_font,DEFVAL("")); + ClassDB::bind_method(_MD("get_color","name","type"),&Control::get_color,DEFVAL("")); + ClassDB::bind_method(_MD("get_constant","name","type"),&Control::get_constant,DEFVAL("")); - ObjectTypeDB::bind_method(_MD("has_icon_override", "name"), &Control::has_icon_override); - ObjectTypeDB::bind_method(_MD("has_stylebox_override", "name"), &Control::has_stylebox_override); - ObjectTypeDB::bind_method(_MD("has_font_override", "name"), &Control::has_font_override); - ObjectTypeDB::bind_method(_MD("has_color_override", "name"), &Control::has_color_override); - ObjectTypeDB::bind_method(_MD("has_constant_override", "name"), &Control::has_constant_override); + ClassDB::bind_method(_MD("has_icon_override", "name"), &Control::has_icon_override); + ClassDB::bind_method(_MD("has_stylebox_override", "name"), &Control::has_stylebox_override); + ClassDB::bind_method(_MD("has_font_override", "name"), &Control::has_font_override); + ClassDB::bind_method(_MD("has_color_override", "name"), &Control::has_color_override); + ClassDB::bind_method(_MD("has_constant_override", "name"), &Control::has_constant_override); - ObjectTypeDB::bind_method(_MD("has_icon", "name", "type"), &Control::has_icon, DEFVAL("")); - ObjectTypeDB::bind_method(_MD("has_stylebox", "name", "type"), &Control::has_stylebox, DEFVAL("")); - ObjectTypeDB::bind_method(_MD("has_font", "name", "type"), &Control::has_font, DEFVAL("")); - ObjectTypeDB::bind_method(_MD("has_color", "name", "type"), &Control::has_color, DEFVAL("")); - ObjectTypeDB::bind_method(_MD("has_constant", "name", "type"), &Control::has_constant, DEFVAL("")); + ClassDB::bind_method(_MD("has_icon", "name", "type"), &Control::has_icon, DEFVAL("")); + ClassDB::bind_method(_MD("has_stylebox", "name", "type"), &Control::has_stylebox, DEFVAL("")); + ClassDB::bind_method(_MD("has_font", "name", "type"), &Control::has_font, DEFVAL("")); + ClassDB::bind_method(_MD("has_color", "name", "type"), &Control::has_color, DEFVAL("")); + ClassDB::bind_method(_MD("has_constant", "name", "type"), &Control::has_constant, DEFVAL("")); - ObjectTypeDB::bind_method(_MD("get_parent_control:Control"),&Control::get_parent_control); + ClassDB::bind_method(_MD("get_parent_control:Control"),&Control::get_parent_control); - ObjectTypeDB::bind_method(_MD("set_tooltip","tooltip"),&Control::set_tooltip); - ObjectTypeDB::bind_method(_MD("get_tooltip","atpos"),&Control::get_tooltip,DEFVAL(Point2())); - ObjectTypeDB::bind_method(_MD("_get_tooltip"),&Control::_get_tooltip); + ClassDB::bind_method(_MD("set_tooltip","tooltip"),&Control::set_tooltip); + ClassDB::bind_method(_MD("get_tooltip","atpos"),&Control::get_tooltip,DEFVAL(Point2())); + ClassDB::bind_method(_MD("_get_tooltip"),&Control::_get_tooltip); - ObjectTypeDB::bind_method(_MD("set_default_cursor_shape","shape"),&Control::set_default_cursor_shape); - ObjectTypeDB::bind_method(_MD("get_default_cursor_shape"),&Control::get_default_cursor_shape); - ObjectTypeDB::bind_method(_MD("get_cursor_shape","pos"),&Control::get_cursor_shape,DEFVAL(Point2())); + ClassDB::bind_method(_MD("set_default_cursor_shape","shape"),&Control::set_default_cursor_shape); + ClassDB::bind_method(_MD("get_default_cursor_shape"),&Control::get_default_cursor_shape); + ClassDB::bind_method(_MD("get_cursor_shape","pos"),&Control::get_cursor_shape,DEFVAL(Point2())); - ObjectTypeDB::bind_method(_MD("set_focus_neighbour","margin","neighbour"),&Control::set_focus_neighbour); - ObjectTypeDB::bind_method(_MD("get_focus_neighbour","margin"),&Control::get_focus_neighbour); + ClassDB::bind_method(_MD("set_focus_neighbour","margin","neighbour"),&Control::set_focus_neighbour); + ClassDB::bind_method(_MD("get_focus_neighbour","margin"),&Control::get_focus_neighbour); - ObjectTypeDB::bind_method(_MD("set_ignore_mouse","ignore"),&Control::set_ignore_mouse); - ObjectTypeDB::bind_method(_MD("is_ignoring_mouse"),&Control::is_ignoring_mouse); + ClassDB::bind_method(_MD("force_drag","data","preview"),&Control::force_drag); - ObjectTypeDB::bind_method(_MD("force_drag","data","preview"),&Control::force_drag); + ClassDB::bind_method(_MD("set_mouse_filter","filter"),&Control::set_mouse_filter); + ClassDB::bind_method(_MD("get_mouse_filter"),&Control::get_mouse_filter); - ObjectTypeDB::bind_method(_MD("set_stop_mouse","stop"),&Control::set_stop_mouse); - ObjectTypeDB::bind_method(_MD("is_stopping_mouse"),&Control::is_stopping_mouse); + ClassDB::bind_method(_MD("set_clip_contents","enable"),&Control::set_clip_contents); + ClassDB::bind_method(_MD("is_clipping_contents"),&Control::is_clipping_contents); - ObjectTypeDB::bind_method(_MD("grab_click_focus"),&Control::grab_click_focus); + ClassDB::bind_method(_MD("grab_click_focus"),&Control::grab_click_focus); - ObjectTypeDB::bind_method(_MD("set_drag_forwarding","target:Control"),&Control::set_drag_forwarding); - ObjectTypeDB::bind_method(_MD("set_drag_preview","control:Control"),&Control::set_drag_preview); + ClassDB::bind_method(_MD("set_drag_forwarding","target:Control"),&Control::set_drag_forwarding); + ClassDB::bind_method(_MD("set_drag_preview","control:Control"),&Control::set_drag_preview); - ObjectTypeDB::bind_method(_MD("warp_mouse","to_pos"),&Control::warp_mouse); + ClassDB::bind_method(_MD("warp_mouse","to_pos"),&Control::warp_mouse); - ObjectTypeDB::bind_method(_MD("minimum_size_changed"), &Control::minimum_size_changed); + ClassDB::bind_method(_MD("minimum_size_changed"), &Control::minimum_size_changed); - ObjectTypeDB::bind_method(_MD("_theme_changed"), &Control::_theme_changed); + ClassDB::bind_method(_MD("_theme_changed"), &Control::_theme_changed); - ObjectTypeDB::bind_method(_MD("_font_changed"), &Control::_font_changed); + ClassDB::bind_method(_MD("_font_changed"), &Control::_font_changed); - BIND_VMETHOD(MethodInfo("_input_event",PropertyInfo(Variant::INPUT_EVENT,"event"))); + BIND_VMETHOD(MethodInfo("_gui_input",PropertyInfo(Variant::INPUT_EVENT,"event"))); BIND_VMETHOD(MethodInfo(Variant::VECTOR2,"get_minimum_size")); BIND_VMETHOD(MethodInfo(Variant::OBJECT,"get_drag_data",PropertyInfo(Variant::VECTOR2,"pos"))); BIND_VMETHOD(MethodInfo(Variant::BOOL,"can_drop_data",PropertyInfo(Variant::VECTOR2,"pos"),PropertyInfo(Variant::NIL,"data"))); BIND_VMETHOD(MethodInfo("drop_data",PropertyInfo(Variant::VECTOR2,"pos"),PropertyInfo(Variant::NIL,"data"))); - ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"anchor/left", PROPERTY_HINT_ENUM, "Begin,End,Ratio,Center"), _SCS("_set_anchor"),_SCS("get_anchor"), MARGIN_LEFT ); - ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"anchor/top", PROPERTY_HINT_ENUM, "Begin,End,Ratio,Center"), _SCS("_set_anchor"),_SCS("get_anchor"), MARGIN_TOP ); - ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"anchor/right", PROPERTY_HINT_ENUM, "Begin,End,Ratio,Center"), _SCS("_set_anchor"),_SCS("get_anchor"), MARGIN_RIGHT ); - ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"anchor/bottom", PROPERTY_HINT_ENUM, "Begin,End,Ratio,Center"), _SCS("_set_anchor"),_SCS("get_anchor"), MARGIN_BOTTOM ); - - ADD_PROPERTYNZ( PropertyInfo(Variant::VECTOR2,"rect/pos", PROPERTY_HINT_NONE, "",PROPERTY_USAGE_EDITOR), _SCS("set_pos"),_SCS("get_pos") ); - ADD_PROPERTYNZ( PropertyInfo(Variant::VECTOR2,"rect/size", PROPERTY_HINT_NONE, "",PROPERTY_USAGE_EDITOR), _SCS("set_size"),_SCS("get_size") ); - ADD_PROPERTYNZ( PropertyInfo(Variant::VECTOR2,"rect/min_size"), _SCS("set_custom_minimum_size"),_SCS("get_custom_minimum_size") ); - ADD_PROPERTYNZ( PropertyInfo(Variant::REAL,"rect/rotation",PROPERTY_HINT_RANGE,"-1080,1080,0.01"), _SCS("set_rotation_deg"),_SCS("get_rotation_deg") ); - ADD_PROPERTYNO( PropertyInfo(Variant::VECTOR2,"rect/scale"), _SCS("set_scale"),_SCS("get_scale") ); - ADD_PROPERTYNZ( PropertyInfo(Variant::STRING,"hint/tooltip", PROPERTY_HINT_MULTILINE_TEXT), _SCS("set_tooltip"),_SCS("_get_tooltip") ); - ADD_PROPERTYINZ( PropertyInfo(Variant::NODE_PATH,"focus_neighbour/left" ), _SCS("set_focus_neighbour"),_SCS("get_focus_neighbour"),MARGIN_LEFT ); - ADD_PROPERTYINZ( PropertyInfo(Variant::NODE_PATH,"focus_neighbour/top" ), _SCS("set_focus_neighbour"),_SCS("get_focus_neighbour"),MARGIN_TOP ); - ADD_PROPERTYINZ( PropertyInfo(Variant::NODE_PATH,"focus_neighbour/right" ), _SCS("set_focus_neighbour"),_SCS("get_focus_neighbour"),MARGIN_RIGHT ); - ADD_PROPERTYINZ( PropertyInfo(Variant::NODE_PATH,"focus_neighbour/bottom" ), _SCS("set_focus_neighbour"),_SCS("get_focus_neighbour"),MARGIN_BOTTOM ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"focus/ignore_mouse"), _SCS("set_ignore_mouse"),_SCS("is_ignoring_mouse") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"focus/stop_mouse"), _SCS("set_stop_mouse"),_SCS("is_stopping_mouse") ); - - ADD_PROPERTY( PropertyInfo(Variant::INT,"size_flags/horizontal", PROPERTY_HINT_FLAGS, "Expand,Fill"), _SCS("set_h_size_flags"),_SCS("get_h_size_flags") ); - ADD_PROPERTY( PropertyInfo(Variant::INT,"size_flags/vertical", PROPERTY_HINT_FLAGS, "Expand,Fill"), _SCS("set_v_size_flags"),_SCS("get_v_size_flags") ); - ADD_PROPERTYNO( PropertyInfo(Variant::INT,"size_flags/stretch_ratio", PROPERTY_HINT_RANGE, "1,128,0.01"), _SCS("set_stretch_ratio"),_SCS("get_stretch_ratio") ); - ADD_PROPERTYNZ( PropertyInfo(Variant::OBJECT,"theme/theme", PROPERTY_HINT_RESOURCE_TYPE, "Theme"), _SCS("set_theme"),_SCS("get_theme") ); + ADD_GROUP("Anchor","anchor_"); + ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"anchor_left", PROPERTY_HINT_ENUM, "Begin,End,Center"), _SCS("_set_anchor"),_SCS("get_anchor"), MARGIN_LEFT ); + ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"anchor_top", PROPERTY_HINT_ENUM, "Begin,End,Center"), _SCS("_set_anchor"),_SCS("get_anchor"), MARGIN_TOP ); + ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"anchor_right", PROPERTY_HINT_ENUM, "Begin,End,Center"), _SCS("_set_anchor"),_SCS("get_anchor"), MARGIN_RIGHT ); + ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"anchor_bottom", PROPERTY_HINT_ENUM, "Begin,End,Center"), _SCS("_set_anchor"),_SCS("get_anchor"), MARGIN_BOTTOM ); + + ADD_GROUP("Margin","margin_"); + ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"margin_left", PROPERTY_HINT_RANGE, "-4096,4096"), _SCS("set_margin"),_SCS("get_margin"),MARGIN_LEFT ); + ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"margin_top", PROPERTY_HINT_RANGE, "-4096,4096"), _SCS("set_margin"),_SCS("get_margin"),MARGIN_TOP ); + ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"margin_right", PROPERTY_HINT_RANGE, "-4096,4096"), _SCS("set_margin"),_SCS("get_margin"),MARGIN_RIGHT ); + ADD_PROPERTYINZ( PropertyInfo(Variant::INT,"margin_bottom", PROPERTY_HINT_RANGE, "-4096,4096"), _SCS("set_margin"),_SCS("get_margin"),MARGIN_BOTTOM ); + + ADD_GROUP("Rect","rect_"); + ADD_PROPERTYNZ( PropertyInfo(Variant::VECTOR2,"rect_pos", PROPERTY_HINT_NONE, "",PROPERTY_USAGE_EDITOR), _SCS("set_pos"),_SCS("get_pos") ); + ADD_PROPERTYNZ( PropertyInfo(Variant::VECTOR2,"rect_size", PROPERTY_HINT_NONE, "",PROPERTY_USAGE_EDITOR), _SCS("set_size"),_SCS("get_size") ); + ADD_PROPERTYNZ( PropertyInfo(Variant::VECTOR2,"rect_min_size"), _SCS("set_custom_minimum_size"),_SCS("get_custom_minimum_size") ); + ADD_PROPERTYNZ( PropertyInfo(Variant::REAL,"rect_rotation",PROPERTY_HINT_RANGE,"-1080,1080,0.01"), _SCS("set_rotation_deg"),_SCS("get_rotation_deg") ); + ADD_PROPERTYNO( PropertyInfo(Variant::VECTOR2,"rect_scale"), _SCS("set_scale"),_SCS("get_scale") ); + ADD_PROPERTYNO( PropertyInfo(Variant::BOOL,"rect_clip_content"), _SCS("set_clip_contents"),_SCS("is_clipping_contents") ); + + + ADD_GROUP("Hint","hint_"); + ADD_PROPERTYNZ( PropertyInfo(Variant::STRING,"hint_tooltip", PROPERTY_HINT_MULTILINE_TEXT), _SCS("set_tooltip"),_SCS("_get_tooltip") ); + + ADD_GROUP("Focus","focus_"); + ADD_PROPERTYINZ( PropertyInfo(Variant::NODE_PATH,"focus_neighbour_left" ), _SCS("set_focus_neighbour"),_SCS("get_focus_neighbour"),MARGIN_LEFT ); + ADD_PROPERTYINZ( PropertyInfo(Variant::NODE_PATH,"focus_neighbour_top" ), _SCS("set_focus_neighbour"),_SCS("get_focus_neighbour"),MARGIN_TOP ); + ADD_PROPERTYINZ( PropertyInfo(Variant::NODE_PATH,"focus_neighbour_right" ), _SCS("set_focus_neighbour"),_SCS("get_focus_neighbour"),MARGIN_RIGHT ); + ADD_PROPERTYINZ( PropertyInfo(Variant::NODE_PATH,"focus_neighbour_bottom" ), _SCS("set_focus_neighbour"),_SCS("get_focus_neighbour"),MARGIN_BOTTOM ); + + ADD_GROUP("Mouse","mouse_"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"mouse_filter",PROPERTY_HINT_ENUM,"Stop,Pass,Ignore"), _SCS("set_mouse_filter"),_SCS("get_mouse_filter") ); + + ADD_GROUP("Size Flags","size_flags_"); + ADD_PROPERTYNO( PropertyInfo(Variant::INT,"size_flags_horizontal", PROPERTY_HINT_FLAGS, "Fill,Expand"), _SCS("set_h_size_flags"),_SCS("get_h_size_flags") ); + ADD_PROPERTYNO( PropertyInfo(Variant::INT,"size_flags_vertical", PROPERTY_HINT_FLAGS, "Fill,Expand"), _SCS("set_v_size_flags"),_SCS("get_v_size_flags") ); + ADD_PROPERTYNO( PropertyInfo(Variant::INT,"size_flags_stretch_ratio", PROPERTY_HINT_RANGE, "1,128,0.01"), _SCS("set_stretch_ratio"),_SCS("get_stretch_ratio") ); + ADD_GROUP("Theme",""); + ADD_PROPERTYNZ( PropertyInfo(Variant::OBJECT,"theme", PROPERTY_HINT_RESOURCE_TYPE, "Theme"), _SCS("set_theme"),_SCS("get_theme") ); + ADD_GROUP("",""); BIND_CONSTANT( ANCHOR_BEGIN ); BIND_CONSTANT( ANCHOR_END ); - BIND_CONSTANT( ANCHOR_RATIO ); BIND_CONSTANT( ANCHOR_CENTER ); BIND_CONSTANT( FOCUS_NONE ); BIND_CONSTANT( FOCUS_CLICK ); @@ -2626,8 +2560,12 @@ void Control::_bind_methods() { BIND_CONSTANT( SIZE_FILL ); BIND_CONSTANT( SIZE_EXPAND_FILL ); + BIND_CONSTANT( MOUSE_FILTER_STOP ); + BIND_CONSTANT( MOUSE_FILTER_PASS ); + BIND_CONSTANT( MOUSE_FILTER_IGNORE ); + ADD_SIGNAL( MethodInfo("resized") ); - ADD_SIGNAL( MethodInfo("input_event",PropertyInfo(Variant::INPUT_EVENT,"ev")) ); + ADD_SIGNAL( MethodInfo("gui_input",PropertyInfo(Variant::INPUT_EVENT,"ev")) ); ADD_SIGNAL( MethodInfo("mouse_enter") ); ADD_SIGNAL( MethodInfo("mouse_exit") ); ADD_SIGNAL( MethodInfo("focus_enter") ); @@ -2642,9 +2580,7 @@ Control::Control() { data.parent=NULL; - data.ignore_mouse=false; - data.stop_mouse=true; - + data.mouse_filter=MOUSE_FILTER_STOP; data.SI=NULL; data.MI=NULL; @@ -2665,7 +2601,7 @@ Control::Control() { data.block_minimum_size_adjust=false; data.disable_visibility_clip=false; - + data.clip_contents=false; for (int i=0;i<4;i++) { data.anchor[i]=ANCHOR_BEGIN; data.margin[i]=0; diff --git a/scene/gui/control.h b/scene/gui/control.h index 37efd80970..68795b054c 100644 --- a/scene/gui/control.h +++ b/scene/gui/control.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -46,7 +46,7 @@ class Panel; class Control : public CanvasItem { - OBJ_TYPE( Control, CanvasItem ); + GDCLASS( Control, CanvasItem ); OBJ_CATEGORY("GUI Nodes"); public: @@ -54,7 +54,6 @@ public: enum AnchorType { ANCHOR_BEGIN, ANCHOR_END, - ANCHOR_RATIO, ANCHOR_CENTER, }; @@ -66,12 +65,18 @@ public: enum SizeFlags { - SIZE_EXPAND=1, - SIZE_FILL=2, + SIZE_FILL=1, + SIZE_EXPAND=2, SIZE_EXPAND_FILL=SIZE_EXPAND|SIZE_FILL }; + enum MouseFilter { + MOUSE_FILTER_STOP, + MOUSE_FILTER_PASS, + MOUSE_FILTER_IGNORE + }; + enum CursorShape { CURSOR_ARROW, CURSOR_IBEAM, @@ -125,8 +130,9 @@ private: bool pending_min_size_update; Point2 custom_minimum_size; - bool ignore_mouse; - bool stop_mouse; + MouseFilter mouse_filter; + + bool clip_contents; bool block_minimum_size_adjust; bool disable_visibility_clip; @@ -162,7 +168,7 @@ private: } data; // used internally - Control* _find_control_at_pos(CanvasItem* p_node,const Point2& p_pos,const Matrix32& p_xform,Matrix32& r_inv_xform); + Control* _find_control_at_pos(CanvasItem* p_node,const Point2& p_pos,const Transform2D& p_xform,Transform2D& r_inv_xform); void _window_find_focus_neighbour(const Vector2& p_dir, Node *p_at, const Point2* p_points ,float p_min,float &r_closest_dist,Control **r_closest); @@ -208,7 +214,7 @@ protected: virtual void add_child_notify(Node *p_child); virtual void remove_child_notify(Node *p_child); - //virtual void _window_input_event(InputEvent p_event); + //virtual void _window_gui_input(InputEvent p_event); bool _set(const StringName& p_name, const Variant& p_value); bool _get(const StringName& p_name,Variant &r_ret) const; @@ -338,11 +344,8 @@ public: Control *get_focus_owner() const; - void set_ignore_mouse(bool p_ignore); - bool is_ignoring_mouse() const; - - void set_stop_mouse(bool p_stop); - bool is_stopping_mouse() const; + void set_mouse_filter(MouseFilter p_filter); + MouseFilter get_mouse_filter() const; /* SKINNING */ @@ -386,7 +389,7 @@ public: virtual CursorShape get_cursor_shape(const Point2& p_pos=Point2i()) const; virtual Rect2 get_item_rect() const; - virtual Matrix32 get_transform() const; + virtual Transform2D get_transform() const; bool is_toplevel_control() const; @@ -400,6 +403,8 @@ public: Control *get_root_parent_control() const; + void set_clip_contents(bool p_clip); + bool is_clipping_contents(); void set_block_minimum_size_adjust(bool p_block); bool is_minimum_size_adjust_blocked() const; @@ -418,5 +423,6 @@ VARIANT_ENUM_CAST(Control::AnchorType); VARIANT_ENUM_CAST(Control::FocusMode); VARIANT_ENUM_CAST(Control::SizeFlags); VARIANT_ENUM_CAST(Control::CursorShape); +VARIANT_ENUM_CAST(Control::MouseFilter); #endif diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index 49782bcb75..cc6fe7cae8 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -47,7 +47,7 @@ bool WindowDialog::has_point(const Point2& p_point) const { } -void WindowDialog::_input_event(const InputEvent& p_event) { +void WindowDialog::_gui_input(const InputEvent& p_event) { if (p_event.type == InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index==BUTTON_LEFT) { @@ -141,13 +141,13 @@ TextureButton *WindowDialog::get_close_button() { void WindowDialog::_bind_methods() { - ObjectTypeDB::bind_method( _MD("_input_event"),&WindowDialog::_input_event); - ObjectTypeDB::bind_method( _MD("set_title","title"),&WindowDialog::set_title); - ObjectTypeDB::bind_method( _MD("get_title"),&WindowDialog::get_title); - ObjectTypeDB::bind_method( _MD("_closed"),&WindowDialog::_closed); - ObjectTypeDB::bind_method( _MD("get_close_button:TextureButton"),&WindowDialog::get_close_button); + ClassDB::bind_method( _MD("_gui_input"),&WindowDialog::_gui_input); + ClassDB::bind_method( _MD("set_title","title"),&WindowDialog::set_title); + ClassDB::bind_method( _MD("get_title"),&WindowDialog::get_title); + ClassDB::bind_method( _MD("_closed"),&WindowDialog::_closed); + ClassDB::bind_method( _MD("get_close_button:TextureButton"),&WindowDialog::get_close_button); - ADD_PROPERTY( PropertyInfo(Variant::STRING,"window/title",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_DEFAULT_INTL),_SCS("set_title"),_SCS("get_title")); + ADD_PROPERTY( PropertyInfo(Variant::STRING,"window_title",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_DEFAULT_INTL),_SCS("set_title"),_SCS("get_title")); } WindowDialog::WindowDialog() { @@ -203,7 +203,7 @@ void AcceptDialog::_notification(int p_what) { cancel_pressed(); } if (p_what==NOTIFICATION_RESIZED) { - _update_child_rect(); + _update_child_rects(); } } @@ -233,7 +233,7 @@ void AcceptDialog::set_text(String p_text) { label->set_text(p_text); minimum_size_changed(); - _update_child_rect(); + _update_child_rects(); } void AcceptDialog::set_hide_on_ok(bool p_hide) { @@ -253,7 +253,9 @@ void AcceptDialog::register_text_enter(Node *p_line_edit) { p_line_edit->connect("text_entered", this,"_builtin_text_entered"); } -void AcceptDialog::_update_child_rect() { +void AcceptDialog::_update_child_rects() { + + Size2 label_size=label->get_minimum_size(); if (label->get_text().empty()) { label_size.height = 0; @@ -265,10 +267,17 @@ void AcceptDialog::_update_child_rect() { Vector2 cpos(margin,margin+label_size.height); Vector2 csize(size.x-margin*2,size.y-margin*3-hminsize.y-label_size.height); - if (child) { + for(int i=0;i<get_child_count();i++) { + Control *c = get_child(i)->cast_to<Control>(); + if (!c) + continue; + + if (c==hbc || c==label || c==get_close_button()) + continue; + + c->set_pos(cpos); + c->set_size(csize); - child->set_pos(cpos); - child->set_size(csize); } cpos.y+=csize.y+margin; @@ -283,13 +292,23 @@ Size2 AcceptDialog::get_minimum_size() const { int margin = get_constant("margin","Dialogs"); Size2 minsize = label->get_combined_minimum_size(); - if (child) { - Size2 cminsize = child->get_combined_minimum_size(); + + for(int i=0;i<get_child_count();i++) { + Control *c = get_child(i)->cast_to<Control>(); + if (!c) + continue; + + if (c==hbc || c==label || c==const_cast<AcceptDialog*>(this)->get_close_button()) + continue; + + Size2 cminsize = c->get_combined_minimum_size(); minsize.x=MAX(cminsize.x,minsize.x); minsize.y=MAX(cminsize.y,minsize.y); + } + Size2 hminsize = hbc->get_combined_minimum_size(); minsize.x = MAX(hminsize.x,minsize.x); minsize.y+=hminsize.y; @@ -302,23 +321,6 @@ Size2 AcceptDialog::get_minimum_size() const { } -void AcceptDialog::set_child_rect(Control *p_child) { - - ERR_FAIL_COND(p_child->get_parent()!=this); - - //p_child->set_area_as_parent_rect(get_constant("margin","Dialogs")); - child=p_child; - minimum_size_changed(); - _update_child_rect(); -} - -void AcceptDialog::remove_child_notify(Node *p_child) { - - if (p_child==child) { - child=NULL; - } -} - void AcceptDialog::_custom_action(const String& p_action) { emit_signal("custom_action",p_action); @@ -359,25 +361,25 @@ Button* AcceptDialog::add_cancel(const String &p_cancel) { void AcceptDialog::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_ok"),&AcceptDialog::_ok_pressed); - ObjectTypeDB::bind_method(_MD("get_ok"),&AcceptDialog::get_ok); - ObjectTypeDB::bind_method(_MD("get_label"),&AcceptDialog::get_label); - ObjectTypeDB::bind_method(_MD("set_hide_on_ok","enabled"),&AcceptDialog::set_hide_on_ok); - ObjectTypeDB::bind_method(_MD("get_hide_on_ok"),&AcceptDialog::get_hide_on_ok); - ObjectTypeDB::bind_method(_MD("add_button:Button","text","right","action"),&AcceptDialog::add_button,DEFVAL(false),DEFVAL("")); - ObjectTypeDB::bind_method(_MD("add_cancel:Button","name"),&AcceptDialog::add_cancel); - ObjectTypeDB::bind_method(_MD("_builtin_text_entered"),&AcceptDialog::_builtin_text_entered); - ObjectTypeDB::bind_method(_MD("register_text_enter:LineEdit","line_edit"),&AcceptDialog::register_text_enter); - ObjectTypeDB::bind_method(_MD("_custom_action"),&AcceptDialog::_custom_action); - ObjectTypeDB::bind_method(_MD("set_text","text"),&AcceptDialog::set_text); - ObjectTypeDB::bind_method(_MD("get_text"),&AcceptDialog::get_text); - ObjectTypeDB::bind_method(_MD("set_child_rect","child:Control"),&AcceptDialog::set_child_rect); + ClassDB::bind_method(_MD("_ok"),&AcceptDialog::_ok_pressed); + ClassDB::bind_method(_MD("get_ok"),&AcceptDialog::get_ok); + ClassDB::bind_method(_MD("get_label"),&AcceptDialog::get_label); + ClassDB::bind_method(_MD("set_hide_on_ok","enabled"),&AcceptDialog::set_hide_on_ok); + ClassDB::bind_method(_MD("get_hide_on_ok"),&AcceptDialog::get_hide_on_ok); + ClassDB::bind_method(_MD("add_button:Button","text","right","action"),&AcceptDialog::add_button,DEFVAL(false),DEFVAL("")); + ClassDB::bind_method(_MD("add_cancel:Button","name"),&AcceptDialog::add_cancel); + ClassDB::bind_method(_MD("_builtin_text_entered"),&AcceptDialog::_builtin_text_entered); + ClassDB::bind_method(_MD("register_text_enter:LineEdit","line_edit"),&AcceptDialog::register_text_enter); + ClassDB::bind_method(_MD("_custom_action"),&AcceptDialog::_custom_action); + ClassDB::bind_method(_MD("set_text","text"),&AcceptDialog::set_text); + ClassDB::bind_method(_MD("get_text"),&AcceptDialog::get_text); ADD_SIGNAL( MethodInfo("confirmed") ); ADD_SIGNAL( MethodInfo("custom_action",PropertyInfo(Variant::STRING,"action")) ); - ADD_PROPERTYNZ( PropertyInfo(Variant::STRING,"dialog/text",PROPERTY_HINT_MULTILINE_TEXT,"",PROPERTY_USAGE_DEFAULT_INTL),_SCS("set_text"),_SCS("get_text")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "dialog/hide_on_ok"),_SCS("set_hide_on_ok"),_SCS("get_hide_on_ok") ); + ADD_GROUP("Dialog","dialog"); + ADD_PROPERTYNZ( PropertyInfo(Variant::STRING,"dialog_text",PROPERTY_HINT_MULTILINE_TEXT,"",PROPERTY_USAGE_DEFAULT_INTL),_SCS("set_text"),_SCS("get_text")); + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "dialog_hide_on_ok"),_SCS("set_hide_on_ok"),_SCS("get_hide_on_ok") ); } @@ -417,8 +419,6 @@ AcceptDialog::AcceptDialog() { hide_on_ok=true; set_title(RTR("Alert!")); - - child=NULL; } @@ -429,7 +429,7 @@ AcceptDialog::~AcceptDialog() void ConfirmationDialog::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_cancel:Button"),&ConfirmationDialog::get_cancel); + ClassDB::bind_method(_MD("get_cancel:Button"),&ConfirmationDialog::get_cancel); } Button *ConfirmationDialog::get_cancel() { diff --git a/scene/gui/dialogs.h b/scene/gui/dialogs.h index d00bb41ff6..c7beeea7a3 100644 --- a/scene/gui/dialogs.h +++ b/scene/gui/dialogs.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -42,13 +42,13 @@ class WindowDialog : public Popup { - OBJ_TYPE(WindowDialog,Popup); + GDCLASS(WindowDialog,Popup); TextureButton *close_button; String title; bool dragging; - void _input_event(const InputEvent& p_event); + void _gui_input(const InputEvent& p_event); void _closed(); protected: virtual void _post_popup(); @@ -73,7 +73,7 @@ public: class PopupDialog : public Popup { - OBJ_TYPE(PopupDialog,Popup); + GDCLASS(PopupDialog,Popup); protected: void _notification(int p_what); @@ -89,9 +89,8 @@ class LineEdit; class AcceptDialog : public WindowDialog { - OBJ_TYPE(AcceptDialog,WindowDialog); + GDCLASS(AcceptDialog,WindowDialog); - Control *child; HBoxContainer *hbc; Label *label; Button *ok; @@ -103,13 +102,11 @@ class AcceptDialog : public WindowDialog { void _ok_pressed(); void _close_pressed(); void _builtin_text_entered(const String& p_text); - void _update_child_rect(); + void _update_child_rects(); static bool swap_ok_cancel; - virtual void remove_child_notify(Node *p_child); - protected: @@ -140,8 +137,6 @@ public: void set_text(String p_text); String get_text() const; - void set_child_rect(Control *p_child); - AcceptDialog(); ~AcceptDialog(); @@ -150,7 +145,7 @@ public: class ConfirmationDialog : public AcceptDialog { - OBJ_TYPE(ConfirmationDialog,AcceptDialog); + GDCLASS(ConfirmationDialog,AcceptDialog); Button *cancel; protected: static void _bind_methods(); diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index f942f15ed0..1cd04551c5 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -164,7 +164,7 @@ void FileDialog::_action_pressed() { TreeItem *ti=tree->get_next_selected(NULL); String fbase=dir_access->get_current_dir(); - DVector<String> files; + PoolVector<String> files; while(ti) { files.push_back( fbase.plus_file(ti->get_text(0)) ); @@ -403,11 +403,12 @@ void FileDialog::update_file_list() { while(!files.empty()) { bool match=patterns.empty(); + String match_str; for(List<String>::Element *E=patterns.front();E;E=E->next()) { if (files.front()->get().matchn(E->get())) { - + match_str=E->get(); match=true; break; } @@ -432,14 +433,14 @@ void FileDialog::update_file_list() { d["dir"]=false; ti->set_metadata(0,d); - if (file->get_text()==files.front()->get()) + if (file->get_text()==files.front()->get() || match_str==files.front()->get()) ti->select(0); } files.pop_front(); } - if (tree->get_root() && tree->get_root()->get_children()) + if (tree->get_root() && tree->get_root()->get_children() && tree->get_selected()==NULL) tree->get_root()->get_children()->select(0); files.clear(); @@ -685,44 +686,44 @@ bool FileDialog::default_show_hidden_files=false; void FileDialog::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_unhandled_input"),&FileDialog::_unhandled_input); - - ObjectTypeDB::bind_method(_MD("_tree_selected"),&FileDialog::_tree_selected); - ObjectTypeDB::bind_method(_MD("_tree_db_selected"),&FileDialog::_tree_dc_selected); - ObjectTypeDB::bind_method(_MD("_dir_entered"),&FileDialog::_dir_entered); - ObjectTypeDB::bind_method(_MD("_file_entered"),&FileDialog::_file_entered); - ObjectTypeDB::bind_method(_MD("_action_pressed"),&FileDialog::_action_pressed); - ObjectTypeDB::bind_method(_MD("_cancel_pressed"),&FileDialog::_cancel_pressed); - ObjectTypeDB::bind_method(_MD("_filter_selected"),&FileDialog::_filter_selected); - ObjectTypeDB::bind_method(_MD("_save_confirm_pressed"),&FileDialog::_save_confirm_pressed); - - ObjectTypeDB::bind_method(_MD("clear_filters"),&FileDialog::clear_filters); - ObjectTypeDB::bind_method(_MD("add_filter","filter"),&FileDialog::add_filter); - ObjectTypeDB::bind_method(_MD("set_filters","filters"),&FileDialog::set_filters); - ObjectTypeDB::bind_method(_MD("get_filters"),&FileDialog::get_filters); - ObjectTypeDB::bind_method(_MD("get_current_dir"),&FileDialog::get_current_dir); - ObjectTypeDB::bind_method(_MD("get_current_file"),&FileDialog::get_current_file); - ObjectTypeDB::bind_method(_MD("get_current_path"),&FileDialog::get_current_path); - ObjectTypeDB::bind_method(_MD("set_current_dir","dir"),&FileDialog::set_current_dir); - ObjectTypeDB::bind_method(_MD("set_current_file","file"),&FileDialog::set_current_file); - ObjectTypeDB::bind_method(_MD("set_current_path","path"),&FileDialog::set_current_path); - ObjectTypeDB::bind_method(_MD("set_mode","mode"),&FileDialog::set_mode); - ObjectTypeDB::bind_method(_MD("get_mode"),&FileDialog::get_mode); - ObjectTypeDB::bind_method(_MD("get_vbox:VBoxContainer"),&FileDialog::get_vbox); - ObjectTypeDB::bind_method(_MD("set_access","access"),&FileDialog::set_access); - ObjectTypeDB::bind_method(_MD("get_access"),&FileDialog::get_access); - ObjectTypeDB::bind_method(_MD("set_show_hidden_files","show"),&FileDialog::set_show_hidden_files); - ObjectTypeDB::bind_method(_MD("is_showing_hidden_files"),&FileDialog::is_showing_hidden_files); - ObjectTypeDB::bind_method(_MD("_select_drive"),&FileDialog::_select_drive); - ObjectTypeDB::bind_method(_MD("_make_dir"),&FileDialog::_make_dir); - ObjectTypeDB::bind_method(_MD("_make_dir_confirm"),&FileDialog::_make_dir_confirm); - ObjectTypeDB::bind_method(_MD("_update_file_list"),&FileDialog::update_file_list); - ObjectTypeDB::bind_method(_MD("_update_dir"),&FileDialog::update_dir); - - ObjectTypeDB::bind_method(_MD("invalidate"),&FileDialog::invalidate); + ClassDB::bind_method(_MD("_unhandled_input"),&FileDialog::_unhandled_input); + + ClassDB::bind_method(_MD("_tree_selected"),&FileDialog::_tree_selected); + ClassDB::bind_method(_MD("_tree_db_selected"),&FileDialog::_tree_dc_selected); + ClassDB::bind_method(_MD("_dir_entered"),&FileDialog::_dir_entered); + ClassDB::bind_method(_MD("_file_entered"),&FileDialog::_file_entered); + ClassDB::bind_method(_MD("_action_pressed"),&FileDialog::_action_pressed); + ClassDB::bind_method(_MD("_cancel_pressed"),&FileDialog::_cancel_pressed); + ClassDB::bind_method(_MD("_filter_selected"),&FileDialog::_filter_selected); + ClassDB::bind_method(_MD("_save_confirm_pressed"),&FileDialog::_save_confirm_pressed); + + ClassDB::bind_method(_MD("clear_filters"),&FileDialog::clear_filters); + ClassDB::bind_method(_MD("add_filter","filter"),&FileDialog::add_filter); + ClassDB::bind_method(_MD("set_filters","filters"),&FileDialog::set_filters); + ClassDB::bind_method(_MD("get_filters"),&FileDialog::get_filters); + ClassDB::bind_method(_MD("get_current_dir"),&FileDialog::get_current_dir); + ClassDB::bind_method(_MD("get_current_file"),&FileDialog::get_current_file); + ClassDB::bind_method(_MD("get_current_path"),&FileDialog::get_current_path); + ClassDB::bind_method(_MD("set_current_dir","dir"),&FileDialog::set_current_dir); + ClassDB::bind_method(_MD("set_current_file","file"),&FileDialog::set_current_file); + ClassDB::bind_method(_MD("set_current_path","path"),&FileDialog::set_current_path); + ClassDB::bind_method(_MD("set_mode","mode"),&FileDialog::set_mode); + ClassDB::bind_method(_MD("get_mode"),&FileDialog::get_mode); + ClassDB::bind_method(_MD("get_vbox:VBoxContainer"),&FileDialog::get_vbox); + ClassDB::bind_method(_MD("set_access","access"),&FileDialog::set_access); + ClassDB::bind_method(_MD("get_access"),&FileDialog::get_access); + ClassDB::bind_method(_MD("set_show_hidden_files","show"),&FileDialog::set_show_hidden_files); + ClassDB::bind_method(_MD("is_showing_hidden_files"),&FileDialog::is_showing_hidden_files); + ClassDB::bind_method(_MD("_select_drive"),&FileDialog::_select_drive); + ClassDB::bind_method(_MD("_make_dir"),&FileDialog::_make_dir); + ClassDB::bind_method(_MD("_make_dir_confirm"),&FileDialog::_make_dir_confirm); + ClassDB::bind_method(_MD("_update_file_list"),&FileDialog::update_file_list); + ClassDB::bind_method(_MD("_update_dir"),&FileDialog::update_dir); + + ClassDB::bind_method(_MD("invalidate"),&FileDialog::invalidate); ADD_SIGNAL(MethodInfo("file_selected",PropertyInfo( Variant::STRING,"path"))); - ADD_SIGNAL(MethodInfo("files_selected",PropertyInfo( Variant::STRING_ARRAY,"paths"))); + ADD_SIGNAL(MethodInfo("files_selected",PropertyInfo( Variant::POOL_STRING_ARRAY,"paths"))); ADD_SIGNAL(MethodInfo("dir_selected",PropertyInfo( Variant::STRING,"dir"))); BIND_CONSTANT( MODE_OPEN_FILE ); @@ -738,7 +739,7 @@ void FileDialog::_bind_methods() { ADD_PROPERTY( PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Open one,Open many,Open folder,Open any,Save"),_SCS("set_mode"),_SCS("get_mode") ); ADD_PROPERTY( PropertyInfo(Variant::INT, "access", PROPERTY_HINT_ENUM, "Resources,User data,File system"),_SCS("set_access"),_SCS("get_access") ); - ADD_PROPERTY( PropertyInfo(Variant::STRING_ARRAY, "filters"),_SCS("set_filters"),_SCS("get_filters") ); + ADD_PROPERTY( PropertyInfo(Variant::POOL_STRING_ARRAY, "filters"),_SCS("set_filters"),_SCS("get_filters") ); ADD_PROPERTY( PropertyInfo(Variant::BOOL, "show_hidden_files"),_SCS("set_show_hidden_files"),_SCS("is_showing_hidden_files") ); } @@ -763,7 +764,7 @@ FileDialog::FileDialog() { VBoxContainer *vbc = memnew( VBoxContainer ); add_child(vbc); - set_child_rect(vbc); + mode=MODE_SAVE_FILE; set_title(RTR("Save a File")); @@ -827,7 +828,7 @@ FileDialog::FileDialog() { makedialog->set_title(RTR("Create Folder")); VBoxContainer *makevb= memnew( VBoxContainer ); makedialog->add_child(makevb); - makedialog->set_child_rect(makevb); + makedirname = memnew( LineEdit ); makevb->add_margin_child(RTR("Name:"),makedirname); add_child(makedialog); @@ -867,11 +868,11 @@ FileDialog::~FileDialog() { void LineEditFileChooser::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_browse"),&LineEditFileChooser::_browse); - ObjectTypeDB::bind_method(_MD("_chosen"),&LineEditFileChooser::_chosen); - ObjectTypeDB::bind_method(_MD("get_button:Button"),&LineEditFileChooser::get_button); - ObjectTypeDB::bind_method(_MD("get_line_edit:LineEdit"),&LineEditFileChooser::get_line_edit); - ObjectTypeDB::bind_method(_MD("get_file_dialog:FileDialog"),&LineEditFileChooser::get_file_dialog); + ClassDB::bind_method(_MD("_browse"),&LineEditFileChooser::_browse); + ClassDB::bind_method(_MD("_chosen"),&LineEditFileChooser::_chosen); + ClassDB::bind_method(_MD("get_button:Button"),&LineEditFileChooser::get_button); + ClassDB::bind_method(_MD("get_line_edit:LineEdit"),&LineEditFileChooser::get_line_edit); + ClassDB::bind_method(_MD("get_file_dialog:FileDialog"),&LineEditFileChooser::get_file_dialog); } diff --git a/scene/gui/file_dialog.h b/scene/gui/file_dialog.h index 150b24cb3f..653b38e40d 100644 --- a/scene/gui/file_dialog.h +++ b/scene/gui/file_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -42,7 +42,7 @@ */ class FileDialog : public ConfirmationDialog { - OBJ_TYPE( FileDialog, ConfirmationDialog ); + GDCLASS( FileDialog, ConfirmationDialog ); public: @@ -167,7 +167,7 @@ public: class LineEditFileChooser : public HBoxContainer { - OBJ_TYPE( LineEditFileChooser, HBoxContainer ); + GDCLASS( LineEditFileChooser, HBoxContainer ); Button *button; LineEdit *line_edit; FileDialog *dialog; diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index 6366b5ee23..4d72bbbd0d 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -107,15 +107,15 @@ void GraphEdit::get_connection_list(List<Connection> *r_connections) const { void GraphEdit::set_scroll_ofs(const Vector2& p_ofs) { setting_scroll_ofs=true; - h_scroll->set_val(p_ofs.x); - v_scroll->set_val(p_ofs.y); + h_scroll->set_value(p_ofs.x); + v_scroll->set_value(p_ofs.y); _update_scroll(); setting_scroll_ofs=false; } Vector2 GraphEdit::get_scroll_ofs() const{ - return Vector2(h_scroll->get_val(),v_scroll->get_val()); + return Vector2(h_scroll->get_value(),v_scroll->get_value()); } void GraphEdit::_scroll_moved(double) { @@ -144,14 +144,14 @@ void GraphEdit::_update_scroll_offset() { continue; Point2 pos=gn->get_offset()*zoom; - pos-=Point2(h_scroll->get_val(),v_scroll->get_val()); + pos-=Point2(h_scroll->get_value(),v_scroll->get_value()); gn->set_pos(pos); if (gn->get_scale()!=Vector2(zoom,zoom)) { gn->set_scale(Vector2(zoom,zoom)); } } - connections_layer->set_pos(-Point2(h_scroll->get_val(),v_scroll->get_val())); + connections_layer->set_pos(-Point2(h_scroll->get_value(),v_scroll->get_value())); set_block_minimum_size_adjust(false); awaiting_scroll_offset_update=false; @@ -256,7 +256,7 @@ void GraphEdit::add_child_notify(Node *p_child) { gn->connect("raise_request",this,"_graph_node_raised",varray(gn)); gn->connect("item_rect_changed",connections_layer,"update"); _graph_node_moved(gn); - gn->set_stop_mouse(false); + gn->set_mouse_filter(MOUSE_FILTER_PASS); } @@ -302,7 +302,6 @@ void GraphEdit::_notification(int p_what) { draw_style_box( get_stylebox("bg"),Rect2(Point2(),get_size()) ); - VS::get_singleton()->canvas_item_set_clip(get_canvas_item(),true); if (is_using_snap()) { //draw grid @@ -793,11 +792,11 @@ void GraphEdit::set_selected(Node* p_child) { } } -void GraphEdit::_input_event(const InputEvent& p_ev) { +void GraphEdit::_gui_input(const InputEvent& p_ev) { if (p_ev.type==InputEvent::MOUSE_MOTION && (p_ev.mouse_motion.button_mask&BUTTON_MASK_MIDDLE || (p_ev.mouse_motion.button_mask&BUTTON_MASK_LEFT && Input::get_singleton()->is_key_pressed(KEY_SPACE)))) { - h_scroll->set_val( h_scroll->get_val() - p_ev.mouse_motion.relative_x ); - v_scroll->set_val( v_scroll->get_val() - p_ev.mouse_motion.relative_y ); + h_scroll->set_value( h_scroll->get_value() - p_ev.mouse_motion.relative_x ); + v_scroll->set_value( v_scroll->get_value() - p_ev.mouse_motion.relative_y ); } if (p_ev.type==InputEvent::MOUSE_MOTION && dragging) { @@ -1047,7 +1046,7 @@ void GraphEdit::set_zoom(float p_zoom) { zoom_minus->set_disabled(zoom==MIN_ZOOM); zoom_plus->set_disabled(zoom==MAX_ZOOM); - Vector2 sbofs = (Vector2( h_scroll->get_val(), v_scroll->get_val() ) + get_size()/2)/zoom; + Vector2 sbofs = (Vector2( h_scroll->get_value(), v_scroll->get_value() ) + get_size()/2)/zoom; zoom = p_zoom; top_layer->update(); @@ -1058,8 +1057,8 @@ void GraphEdit::set_zoom(float p_zoom) { if (is_visible()) { Vector2 ofs = sbofs*zoom - get_size()/2; - h_scroll->set_val( ofs.x ); - v_scroll->set_val( ofs.y ); + h_scroll->set_value( ofs.x ); + v_scroll->set_value( ofs.y ); } @@ -1181,13 +1180,13 @@ bool GraphEdit::is_using_snap() const{ int GraphEdit::get_snap() const{ - return snap_amount->get_val(); + return snap_amount->get_value(); } void GraphEdit::set_snap(int p_snap) { ERR_FAIL_COND(p_snap<5); - snap_amount->set_val(p_snap); + snap_amount->set_value(p_snap); update(); } void GraphEdit::_snap_toggled() { @@ -1202,44 +1201,44 @@ void GraphEdit::_snap_value_changed(double) { void GraphEdit::_bind_methods() { - ObjectTypeDB::bind_method(_MD("connect_node:Error","from","from_port","to","to_port"),&GraphEdit::connect_node); - ObjectTypeDB::bind_method(_MD("is_node_connected","from","from_port","to","to_port"),&GraphEdit::is_node_connected); - ObjectTypeDB::bind_method(_MD("disconnect_node","from","from_port","to","to_port"),&GraphEdit::disconnect_node); - ObjectTypeDB::bind_method(_MD("get_connection_list"),&GraphEdit::_get_connection_list); - ObjectTypeDB::bind_method(_MD("get_scroll_ofs"),&GraphEdit::get_scroll_ofs); - ObjectTypeDB::bind_method(_MD("set_scroll_ofs","ofs"),&GraphEdit::set_scroll_ofs); + ClassDB::bind_method(_MD("connect_node:Error","from","from_port","to","to_port"),&GraphEdit::connect_node); + ClassDB::bind_method(_MD("is_node_connected","from","from_port","to","to_port"),&GraphEdit::is_node_connected); + ClassDB::bind_method(_MD("disconnect_node","from","from_port","to","to_port"),&GraphEdit::disconnect_node); + ClassDB::bind_method(_MD("get_connection_list"),&GraphEdit::_get_connection_list); + ClassDB::bind_method(_MD("get_scroll_ofs"),&GraphEdit::get_scroll_ofs); + ClassDB::bind_method(_MD("set_scroll_ofs","ofs"),&GraphEdit::set_scroll_ofs); - ObjectTypeDB::bind_method(_MD("set_zoom","p_zoom"),&GraphEdit::set_zoom); - ObjectTypeDB::bind_method(_MD("get_zoom"),&GraphEdit::get_zoom); + ClassDB::bind_method(_MD("set_zoom","p_zoom"),&GraphEdit::set_zoom); + ClassDB::bind_method(_MD("get_zoom"),&GraphEdit::get_zoom); - ObjectTypeDB::bind_method(_MD("set_snap","pixels"),&GraphEdit::set_snap); - ObjectTypeDB::bind_method(_MD("get_snap"),&GraphEdit::get_snap); + ClassDB::bind_method(_MD("set_snap","pixels"),&GraphEdit::set_snap); + ClassDB::bind_method(_MD("get_snap"),&GraphEdit::get_snap); - ObjectTypeDB::bind_method(_MD("set_use_snap","enable"),&GraphEdit::set_use_snap); - ObjectTypeDB::bind_method(_MD("is_using_snap"),&GraphEdit::is_using_snap); + ClassDB::bind_method(_MD("set_use_snap","enable"),&GraphEdit::set_use_snap); + ClassDB::bind_method(_MD("is_using_snap"),&GraphEdit::is_using_snap); - ObjectTypeDB::bind_method(_MD("set_right_disconnects","enable"),&GraphEdit::set_right_disconnects); - ObjectTypeDB::bind_method(_MD("is_right_disconnects_enabled"),&GraphEdit::is_right_disconnects_enabled); + ClassDB::bind_method(_MD("set_right_disconnects","enable"),&GraphEdit::set_right_disconnects); + ClassDB::bind_method(_MD("is_right_disconnects_enabled"),&GraphEdit::is_right_disconnects_enabled); - ObjectTypeDB::bind_method(_MD("_graph_node_moved"),&GraphEdit::_graph_node_moved); - ObjectTypeDB::bind_method(_MD("_graph_node_raised"),&GraphEdit::_graph_node_raised); + ClassDB::bind_method(_MD("_graph_node_moved"),&GraphEdit::_graph_node_moved); + ClassDB::bind_method(_MD("_graph_node_raised"),&GraphEdit::_graph_node_raised); - ObjectTypeDB::bind_method(_MD("_top_layer_input"),&GraphEdit::_top_layer_input); - ObjectTypeDB::bind_method(_MD("_top_layer_draw"),&GraphEdit::_top_layer_draw); - ObjectTypeDB::bind_method(_MD("_scroll_moved"),&GraphEdit::_scroll_moved); - ObjectTypeDB::bind_method(_MD("_zoom_minus"),&GraphEdit::_zoom_minus); - ObjectTypeDB::bind_method(_MD("_zoom_reset"),&GraphEdit::_zoom_reset); - ObjectTypeDB::bind_method(_MD("_zoom_plus"),&GraphEdit::_zoom_plus); - ObjectTypeDB::bind_method(_MD("_snap_toggled"),&GraphEdit::_snap_toggled); - ObjectTypeDB::bind_method(_MD("_snap_value_changed"),&GraphEdit::_snap_value_changed); + ClassDB::bind_method(_MD("_top_layer_input"),&GraphEdit::_top_layer_input); + ClassDB::bind_method(_MD("_top_layer_draw"),&GraphEdit::_top_layer_draw); + ClassDB::bind_method(_MD("_scroll_moved"),&GraphEdit::_scroll_moved); + ClassDB::bind_method(_MD("_zoom_minus"),&GraphEdit::_zoom_minus); + ClassDB::bind_method(_MD("_zoom_reset"),&GraphEdit::_zoom_reset); + ClassDB::bind_method(_MD("_zoom_plus"),&GraphEdit::_zoom_plus); + ClassDB::bind_method(_MD("_snap_toggled"),&GraphEdit::_snap_toggled); + ClassDB::bind_method(_MD("_snap_value_changed"),&GraphEdit::_snap_value_changed); - ObjectTypeDB::bind_method(_MD("_input_event"),&GraphEdit::_input_event); - ObjectTypeDB::bind_method(_MD("_update_scroll_offset"),&GraphEdit::_update_scroll_offset); - ObjectTypeDB::bind_method(_MD("_connections_layer_draw"),&GraphEdit::_connections_layer_draw); + ClassDB::bind_method(_MD("_gui_input"),&GraphEdit::_gui_input); + ClassDB::bind_method(_MD("_update_scroll_offset"),&GraphEdit::_update_scroll_offset); + ClassDB::bind_method(_MD("_connections_layer_draw"),&GraphEdit::_connections_layer_draw); - ObjectTypeDB::bind_method(_MD("set_selected","node"),&GraphEdit::set_selected); + ClassDB::bind_method(_MD("set_selected","node"),&GraphEdit::set_selected); ADD_SIGNAL(MethodInfo("connection_request",PropertyInfo(Variant::STRING,"from"),PropertyInfo(Variant::INT,"from_slot"),PropertyInfo(Variant::STRING,"to"),PropertyInfo(Variant::INT,"to_slot"))); ADD_SIGNAL(MethodInfo("disconnection_request",PropertyInfo(Variant::STRING,"from"),PropertyInfo(Variant::INT,"from_slot"),PropertyInfo(Variant::STRING,"to"),PropertyInfo(Variant::INT,"to_slot"))); @@ -1262,10 +1261,10 @@ GraphEdit::GraphEdit() { top_layer=NULL; top_layer=memnew(GraphEditFilter(this)); add_child(top_layer); - top_layer->set_stop_mouse(false); + top_layer->set_mouse_filter(MOUSE_FILTER_PASS); top_layer->set_area_as_parent_rect(); top_layer->connect("draw",this,"_top_layer_draw"); - top_layer->set_stop_mouse(false); + top_layer->set_mouse_filter(MOUSE_FILTER_PASS); top_layer->connect("input_event",this,"_top_layer_input"); connections_layer = memnew( Control ); @@ -1331,13 +1330,13 @@ GraphEdit::GraphEdit() { snap_amount->set_min(5); snap_amount->set_max(100); snap_amount->set_step(1); - snap_amount->set_val(20); + snap_amount->set_value(20); snap_amount->connect("value_changed",this,"_snap_value_changed"); zoom_hb->add_child(snap_amount); setting_scroll_ofs=false; just_disconected=false; - + set_clip_contents(true); } diff --git a/scene/gui/graph_edit.h b/scene/gui/graph_edit.h index c5174f6699..86b976c4fe 100644 --- a/scene/gui/graph_edit.h +++ b/scene/gui/graph_edit.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -40,7 +40,7 @@ class GraphEdit; class GraphEditFilter : public Control { - OBJ_TYPE(GraphEditFilter,Control); + GDCLASS(GraphEditFilter,Control); friend class GraphEdit; GraphEdit *ge; @@ -54,7 +54,7 @@ public: class GraphEdit : public Control { - OBJ_TYPE(GraphEdit,Control); + GDCLASS(GraphEdit,Control); public: struct Connection { @@ -123,7 +123,7 @@ private: void _update_scroll(); void _scroll_moved(double); - void _input_event(const InputEvent& p_ev); + void _gui_input(const InputEvent& p_ev); Control *connections_layer; GraphEditFilter *top_layer; diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp index eec973ebef..8b7b84910d 100644 --- a/scene/gui/graph_node.cpp +++ b/scene/gui/graph_node.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -621,7 +621,7 @@ Color GraphNode::get_connection_output_color(int p_idx) { return conn_output_cache[p_idx].color; } -void GraphNode::_input_event(const InputEvent& p_ev) { +void GraphNode::_gui_input(const InputEvent& p_ev) { if (p_ev.type==InputEvent::MOUSE_BUTTON) { @@ -722,50 +722,50 @@ bool GraphNode::is_resizeable() const{ void GraphNode::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_title","title"),&GraphNode::set_title); - ObjectTypeDB::bind_method(_MD("get_title"),&GraphNode::get_title); - ObjectTypeDB::bind_method(_MD("_input_event"),&GraphNode::_input_event); + ClassDB::bind_method(_MD("set_title","title"),&GraphNode::set_title); + ClassDB::bind_method(_MD("get_title"),&GraphNode::get_title); + ClassDB::bind_method(_MD("_gui_input"),&GraphNode::_gui_input); - ObjectTypeDB::bind_method(_MD("set_slot","idx","enable_left","type_left","color_left","enable_right","type_right","color_right","custom_left","custom_right"),&GraphNode::set_slot,DEFVAL(Ref<Texture>()),DEFVAL(Ref<Texture>())); - ObjectTypeDB::bind_method(_MD("clear_slot","idx"),&GraphNode::clear_slot); - ObjectTypeDB::bind_method(_MD("clear_all_slots","idx"),&GraphNode::clear_all_slots); - ObjectTypeDB::bind_method(_MD("is_slot_enabled_left","idx"),&GraphNode::is_slot_enabled_left); - ObjectTypeDB::bind_method(_MD("get_slot_type_left","idx"),&GraphNode::get_slot_type_left); - ObjectTypeDB::bind_method(_MD("get_slot_color_left","idx"),&GraphNode::get_slot_color_left); - ObjectTypeDB::bind_method(_MD("is_slot_enabled_right","idx"),&GraphNode::is_slot_enabled_right); - ObjectTypeDB::bind_method(_MD("get_slot_type_right","idx"),&GraphNode::get_slot_type_right); - ObjectTypeDB::bind_method(_MD("get_slot_color_right","idx"),&GraphNode::get_slot_color_right); + ClassDB::bind_method(_MD("set_slot","idx","enable_left","type_left","color_left","enable_right","type_right","color_right","custom_left","custom_right"),&GraphNode::set_slot,DEFVAL(Ref<Texture>()),DEFVAL(Ref<Texture>())); + ClassDB::bind_method(_MD("clear_slot","idx"),&GraphNode::clear_slot); + ClassDB::bind_method(_MD("clear_all_slots","idx"),&GraphNode::clear_all_slots); + ClassDB::bind_method(_MD("is_slot_enabled_left","idx"),&GraphNode::is_slot_enabled_left); + ClassDB::bind_method(_MD("get_slot_type_left","idx"),&GraphNode::get_slot_type_left); + ClassDB::bind_method(_MD("get_slot_color_left","idx"),&GraphNode::get_slot_color_left); + ClassDB::bind_method(_MD("is_slot_enabled_right","idx"),&GraphNode::is_slot_enabled_right); + ClassDB::bind_method(_MD("get_slot_type_right","idx"),&GraphNode::get_slot_type_right); + ClassDB::bind_method(_MD("get_slot_color_right","idx"),&GraphNode::get_slot_color_right); - ObjectTypeDB::bind_method(_MD("set_offset","offset"),&GraphNode::set_offset); - ObjectTypeDB::bind_method(_MD("get_offset"),&GraphNode::get_offset); + ClassDB::bind_method(_MD("set_offset","offset"),&GraphNode::set_offset); + ClassDB::bind_method(_MD("get_offset"),&GraphNode::get_offset); - ObjectTypeDB::bind_method(_MD("set_comment","comment"),&GraphNode::set_comment); - ObjectTypeDB::bind_method(_MD("is_comment"),&GraphNode::is_comment); + ClassDB::bind_method(_MD("set_comment","comment"),&GraphNode::set_comment); + ClassDB::bind_method(_MD("is_comment"),&GraphNode::is_comment); - ObjectTypeDB::bind_method(_MD("set_resizeable","resizeable"),&GraphNode::set_resizeable); - ObjectTypeDB::bind_method(_MD("is_resizeable"),&GraphNode::is_resizeable); + ClassDB::bind_method(_MD("set_resizeable","resizeable"),&GraphNode::set_resizeable); + ClassDB::bind_method(_MD("is_resizeable"),&GraphNode::is_resizeable); - ObjectTypeDB::bind_method(_MD("set_selected","selected"),&GraphNode::set_selected); - ObjectTypeDB::bind_method(_MD("is_selected"),&GraphNode::is_selected); + ClassDB::bind_method(_MD("set_selected","selected"),&GraphNode::set_selected); + ClassDB::bind_method(_MD("is_selected"),&GraphNode::is_selected); - ObjectTypeDB::bind_method(_MD("get_connection_output_count"),&GraphNode::get_connection_output_count); - ObjectTypeDB::bind_method(_MD("get_connection_input_count"),&GraphNode::get_connection_input_count); + ClassDB::bind_method(_MD("get_connection_output_count"),&GraphNode::get_connection_output_count); + ClassDB::bind_method(_MD("get_connection_input_count"),&GraphNode::get_connection_input_count); - ObjectTypeDB::bind_method(_MD("get_connection_output_pos","idx"),&GraphNode::get_connection_output_pos); - ObjectTypeDB::bind_method(_MD("get_connection_output_type","idx"),&GraphNode::get_connection_output_type); - ObjectTypeDB::bind_method(_MD("get_connection_output_color","idx"),&GraphNode::get_connection_output_color); - ObjectTypeDB::bind_method(_MD("get_connection_input_pos","idx"),&GraphNode::get_connection_input_pos); - ObjectTypeDB::bind_method(_MD("get_connection_input_type","idx"),&GraphNode::get_connection_input_type); - ObjectTypeDB::bind_method(_MD("get_connection_input_color","idx"),&GraphNode::get_connection_input_color); + ClassDB::bind_method(_MD("get_connection_output_pos","idx"),&GraphNode::get_connection_output_pos); + ClassDB::bind_method(_MD("get_connection_output_type","idx"),&GraphNode::get_connection_output_type); + ClassDB::bind_method(_MD("get_connection_output_color","idx"),&GraphNode::get_connection_output_color); + ClassDB::bind_method(_MD("get_connection_input_pos","idx"),&GraphNode::get_connection_input_pos); + ClassDB::bind_method(_MD("get_connection_input_type","idx"),&GraphNode::get_connection_input_type); + ClassDB::bind_method(_MD("get_connection_input_color","idx"),&GraphNode::get_connection_input_color); - ObjectTypeDB::bind_method(_MD("set_modulate","color"),&GraphNode::set_modulate); - ObjectTypeDB::bind_method(_MD("get_modulate"),&GraphNode::get_modulate); + ClassDB::bind_method(_MD("set_modulate","color"),&GraphNode::set_modulate); + ClassDB::bind_method(_MD("get_modulate"),&GraphNode::get_modulate); - ObjectTypeDB::bind_method(_MD("set_show_close_button","show"),&GraphNode::set_show_close_button); - ObjectTypeDB::bind_method(_MD("is_close_button_visible"),&GraphNode::is_close_button_visible); + ClassDB::bind_method(_MD("set_show_close_button","show"),&GraphNode::set_show_close_button); + ClassDB::bind_method(_MD("is_close_button_visible"),&GraphNode::is_close_button_visible); - ObjectTypeDB::bind_method(_MD("set_overlay","overlay"),&GraphNode::set_overlay); - ObjectTypeDB::bind_method(_MD("get_overlay"),&GraphNode::get_overlay); + ClassDB::bind_method(_MD("set_overlay","overlay"),&GraphNode::set_overlay); + ClassDB::bind_method(_MD("get_overlay"),&GraphNode::get_overlay); ADD_PROPERTY( PropertyInfo(Variant::STRING,"title"),_SCS("set_title"),_SCS("get_title")); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"show_close"),_SCS("set_show_close_button"),_SCS("is_close_button_visible")); @@ -787,7 +787,7 @@ GraphNode::GraphNode() { overlay=OVERLAY_DISABLED; show_close=false; connpos_dirty=true; - set_stop_mouse(false); + set_mouse_filter(MOUSE_FILTER_PASS); modulate=Color(1,1,1,1); comment=false; resizeable=false; diff --git a/scene/gui/graph_node.h b/scene/gui/graph_node.h index cbfd34f556..a128426d38 100644 --- a/scene/gui/graph_node.h +++ b/scene/gui/graph_node.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class GraphNode : public Container { - OBJ_TYPE(GraphNode,Container); + GDCLASS(GraphNode,Container); public: enum Overlay { @@ -99,7 +99,7 @@ private: protected: - void _input_event(const InputEvent& p_ev); + void _gui_input(const InputEvent& p_ev); void _notification(int p_what); static void _bind_methods(); diff --git a/scene/gui/grid_container.cpp b/scene/gui/grid_container.cpp index 5e6622b3f8..7dffaa2fd5 100644 --- a/scene/gui/grid_container.cpp +++ b/scene/gui/grid_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -170,8 +170,8 @@ int GridContainer::get_columns() const{ void GridContainer::_bind_methods(){ - ObjectTypeDB::bind_method(_MD("set_columns","columns"),&GridContainer::set_columns); - ObjectTypeDB::bind_method(_MD("get_columns"),&GridContainer::get_columns); + ClassDB::bind_method(_MD("set_columns","columns"),&GridContainer::set_columns); + ClassDB::bind_method(_MD("get_columns"),&GridContainer::get_columns); ADD_PROPERTY( PropertyInfo(Variant::INT,"columns",PROPERTY_HINT_RANGE,"1,1024,1"),_SCS("set_columns"),_SCS("get_columns")); } @@ -230,6 +230,6 @@ Size2 GridContainer::get_minimum_size() const { GridContainer::GridContainer() { - set_stop_mouse(false); + set_mouse_filter(MOUSE_FILTER_PASS); columns=1; } diff --git a/scene/gui/grid_container.h b/scene/gui/grid_container.h index 588bb17fa1..cc1d04cdb2 100644 --- a/scene/gui/grid_container.h +++ b/scene/gui/grid_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class GridContainer : public Container { - OBJ_TYPE(GridContainer,Container); + GDCLASS(GridContainer,Container); int columns; protected: diff --git a/scene/gui/input_action.cpp b/scene/gui/input_action.cpp index c4e7a75298..77026dfdb1 100644 --- a/scene/gui/input_action.cpp +++ b/scene/gui/input_action.cpp @@ -24,7 +24,7 @@ bool ShortCut::is_shortcut(const InputEvent& p_event) const { same=(shortcut.key.scancode==p_event.key.scancode && shortcut.key.mod == p_event.key.mod); } break; - case InputEvent::JOYSTICK_BUTTON: { + case InputEvent::JOYPAD_BUTTON: { same=(shortcut.joy_button.button_index==p_event.joy_button.button_index); @@ -34,7 +34,7 @@ bool ShortCut::is_shortcut(const InputEvent& p_event) const { same=(shortcut.mouse_button.button_index==p_event.mouse_button.button_index); } break; - case InputEvent::JOYSTICK_MOTION: { + case InputEvent::JOYPAD_MOTION: { same=(shortcut.joy_motion.axis==p_event.joy_motion.axis && (shortcut.joy_motion.axis_value < 0) == (p_event.joy_motion.axis_value < 0)); @@ -69,7 +69,7 @@ String ShortCut::get_as_text() const { return str; } break; - case InputEvent::JOYSTICK_BUTTON: { + case InputEvent::JOYPAD_BUTTON: { String str = RTR("Device")+" "+itos(shortcut.device)+", "+RTR("Button")+" "+itos(shortcut.joy_button.button_index); str+="."; @@ -90,7 +90,7 @@ String ShortCut::get_as_text() const { return str; } break; - case InputEvent::JOYSTICK_MOTION: { + case InputEvent::JOYPAD_MOTION: { int ax = shortcut.joy_motion.axis; String str = RTR("Device")+" "+itos(shortcut.device)+", "+RTR("Axis")+" "+itos(ax)+"."; @@ -109,13 +109,13 @@ bool ShortCut::is_valid() const { void ShortCut::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_shortcut","event"),&ShortCut::set_shortcut); - ObjectTypeDB::bind_method(_MD("get_shortcut"),&ShortCut::get_shortcut); + ClassDB::bind_method(_MD("set_shortcut","event"),&ShortCut::set_shortcut); + ClassDB::bind_method(_MD("get_shortcut"),&ShortCut::get_shortcut); - ObjectTypeDB::bind_method(_MD("is_valid"),&ShortCut::is_valid); + ClassDB::bind_method(_MD("is_valid"),&ShortCut::is_valid); - ObjectTypeDB::bind_method(_MD("is_shortcut","event"),&ShortCut::is_shortcut); - ObjectTypeDB::bind_method(_MD("get_as_text"),&ShortCut::get_as_text); + ClassDB::bind_method(_MD("is_shortcut","event"),&ShortCut::is_shortcut); + ClassDB::bind_method(_MD("get_as_text"),&ShortCut::get_as_text); ADD_PROPERTY(PropertyInfo(Variant::INPUT_EVENT,"shortcut"),_SCS("set_shortcut"),_SCS("get_shortcut")); } diff --git a/scene/gui/input_action.h b/scene/gui/input_action.h index 8e0e1ef0bd..a83b3a70cd 100644 --- a/scene/gui/input_action.h +++ b/scene/gui/input_action.h @@ -5,7 +5,7 @@ class ShortCut : public Resource { - OBJ_TYPE(ShortCut,Resource); + GDCLASS(ShortCut,Resource); InputEvent shortcut; protected: diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 191627cadb..ece6171b6e 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -446,7 +446,7 @@ Size2 ItemList::Item::get_icon_size() const { return icon_region.size; } -void ItemList::_input_event(const InputEvent& p_event) { +void ItemList::_gui_input(const InputEvent& p_event) { if (defer_select_single>=0 && p_event.type==InputEvent::MOUSE_MOTION) { defer_select_single=-1; @@ -471,7 +471,7 @@ void ItemList::_input_event(const InputEvent& p_event) { Vector2 pos(mb.x,mb.y); Ref<StyleBox> bg = get_stylebox("bg"); pos-=bg->get_offset(); - pos.y+=scroll_bar->get_val(); + pos.y+=scroll_bar->get_value(); int closest = -1; @@ -561,12 +561,12 @@ void ItemList::_input_event(const InputEvent& p_event) { } if (p_event.type==InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index==BUTTON_WHEEL_UP && p_event.mouse_button.pressed) { - scroll_bar->set_val( scroll_bar->get_val()-scroll_bar->get_page()/8 ); + scroll_bar->set_value( scroll_bar->get_value()-scroll_bar->get_page()/8 ); } if (p_event.type==InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index==BUTTON_WHEEL_DOWN && p_event.mouse_button.pressed) { - scroll_bar->set_val( scroll_bar->get_val()+scroll_bar->get_page()/8 ); + scroll_bar->set_value( scroll_bar->get_value()+scroll_bar->get_page()/8 ); } @@ -578,7 +578,7 @@ void ItemList::_input_event(const InputEvent& p_event) { uint64_t now = OS::get_singleton()->get_ticks_msec(); uint64_t diff = now-search_time_msec; - if (diff<int(Globals::get_singleton()->get("gui/incr_search_max_interval_msec"))*2) { + if (diff<int(GlobalConfig::get_singleton()->get("gui/timers/incremental_search_max_interval_msec"))*2) { for(int i=current-1;i>=0;i--) { @@ -614,7 +614,7 @@ void ItemList::_input_event(const InputEvent& p_event) { uint64_t now = OS::get_singleton()->get_ticks_msec(); uint64_t diff = now-search_time_msec; - if (diff<int(Globals::get_singleton()->get("gui/incr_search_max_interval_msec"))*2) { + if (diff<int(GlobalConfig::get_singleton()->get("gui/timers/incremental_search_max_interval_msec"))*2) { for(int i=current+1;i<items.size();i++) { @@ -725,7 +725,7 @@ void ItemList::_input_event(const InputEvent& p_event) { uint64_t now = OS::get_singleton()->get_ticks_msec(); uint64_t diff = now-search_time_msec; - uint64_t max_interval = uint64_t(GLOBAL_DEF("gui/incr_search_max_interval_msec",2000)); + uint64_t max_interval = uint64_t(GLOBAL_DEF("gui/timers/incremental_search_max_interval_msec",2000)); search_time_msec = now; if (diff>max_interval) { @@ -788,7 +788,6 @@ void ItemList::_notification(int p_what) { if (p_what==NOTIFICATION_DRAW) { - VS::get_singleton()->canvas_item_set_clip(get_canvas_item(),true); Ref<StyleBox> bg = get_stylebox("bg"); int mw = scroll_bar->get_minimum_size().x; @@ -949,7 +948,7 @@ void ItemList::_notification(int p_what) { scroll_bar->set_max(max); //print_line("max: "+rtos(max)+" page "+rtos(page)); if (max<=page) { - scroll_bar->set_val(0); + scroll_bar->set_value(0); scroll_bar->hide(); } else { scroll_bar->show(); @@ -966,13 +965,13 @@ void ItemList::_notification(int p_what) { if (ensure_selected_visible && current>=0 && current <=items.size()) { Rect2 r = items[current].rect_cache; - int from = scroll_bar->get_val(); + int from = scroll_bar->get_value(); int to = from + scroll_bar->get_page(); if (r.pos.y < from) { - scroll_bar->set_val(r.pos.y); + scroll_bar->set_value(r.pos.y); } else if (r.pos.y+r.size.y > to) { - scroll_bar->set_val(r.pos.y+r.size.y - (to-from)); + scroll_bar->set_value(r.pos.y+r.size.y - (to-from)); } @@ -981,9 +980,9 @@ void ItemList::_notification(int p_what) { ensure_selected_visible=false; Vector2 base_ofs = bg->get_offset(); - base_ofs.y-=int(scroll_bar->get_val()); + base_ofs.y-=int(scroll_bar->get_value()); - Rect2 clip(Point2(),size-bg->get_minimum_size()+Vector2(0,scroll_bar->get_val())); + Rect2 clip(Point2(),size-bg->get_minimum_size()+Vector2(0,scroll_bar->get_value())); for(int i=0;i<items.size();i++) { @@ -1178,7 +1177,7 @@ int ItemList::get_item_at_pos(const Point2& p_pos, bool p_exact) const { Vector2 pos=p_pos; Ref<StyleBox> bg = get_stylebox("bg"); pos-=bg->get_offset(); - pos.y+=scroll_bar->get_val(); + pos.y+=scroll_bar->get_value(); int closest = -1; int closest_dist=0x7FFFFFFF; @@ -1285,83 +1284,83 @@ Vector<int> ItemList::get_selected_items() { void ItemList::_bind_methods(){ - ObjectTypeDB::bind_method(_MD("add_item","text","icon:Texture","selectable"),&ItemList::add_item,DEFVAL(Variant()),DEFVAL(true)); - ObjectTypeDB::bind_method(_MD("add_icon_item","icon:Texture","selectable"),&ItemList::add_icon_item,DEFVAL(true)); + ClassDB::bind_method(_MD("add_item","text","icon:Texture","selectable"),&ItemList::add_item,DEFVAL(Variant()),DEFVAL(true)); + ClassDB::bind_method(_MD("add_icon_item","icon:Texture","selectable"),&ItemList::add_icon_item,DEFVAL(true)); - ObjectTypeDB::bind_method(_MD("set_item_text","idx","text"),&ItemList::set_item_text); - ObjectTypeDB::bind_method(_MD("get_item_text","idx"),&ItemList::get_item_text); + ClassDB::bind_method(_MD("set_item_text","idx","text"),&ItemList::set_item_text); + ClassDB::bind_method(_MD("get_item_text","idx"),&ItemList::get_item_text); - ObjectTypeDB::bind_method(_MD("set_item_icon","idx","icon:Texture"),&ItemList::set_item_icon); - ObjectTypeDB::bind_method(_MD("get_item_icon:Texture","idx"),&ItemList::get_item_icon); + ClassDB::bind_method(_MD("set_item_icon","idx","icon:Texture"),&ItemList::set_item_icon); + ClassDB::bind_method(_MD("get_item_icon:Texture","idx"),&ItemList::get_item_icon); - ObjectTypeDB::bind_method(_MD("set_item_icon_region","idx","rect"),&ItemList::set_item_icon_region); - ObjectTypeDB::bind_method(_MD("get_item_icon_region","idx"),&ItemList::get_item_icon_region); + ClassDB::bind_method(_MD("set_item_icon_region","idx","rect"),&ItemList::set_item_icon_region); + ClassDB::bind_method(_MD("get_item_icon_region","idx"),&ItemList::get_item_icon_region); - ObjectTypeDB::bind_method(_MD("set_item_selectable","idx","selectable"),&ItemList::set_item_selectable); - ObjectTypeDB::bind_method(_MD("is_item_selectable","idx"),&ItemList::is_item_selectable); + ClassDB::bind_method(_MD("set_item_selectable","idx","selectable"),&ItemList::set_item_selectable); + ClassDB::bind_method(_MD("is_item_selectable","idx"),&ItemList::is_item_selectable); - ObjectTypeDB::bind_method(_MD("set_item_disabled","idx","disabled"),&ItemList::set_item_disabled); - ObjectTypeDB::bind_method(_MD("is_item_disabled","idx"),&ItemList::is_item_disabled); + ClassDB::bind_method(_MD("set_item_disabled","idx","disabled"),&ItemList::set_item_disabled); + ClassDB::bind_method(_MD("is_item_disabled","idx"),&ItemList::is_item_disabled); - ObjectTypeDB::bind_method(_MD("set_item_metadata","idx","metadata"),&ItemList::set_item_metadata); - ObjectTypeDB::bind_method(_MD("get_item_metadata","idx"),&ItemList::get_item_metadata); + ClassDB::bind_method(_MD("set_item_metadata","idx","metadata"),&ItemList::set_item_metadata); + ClassDB::bind_method(_MD("get_item_metadata","idx"),&ItemList::get_item_metadata); - ObjectTypeDB::bind_method(_MD("set_item_custom_bg_color","idx","custom_bg_color"),&ItemList::set_item_custom_bg_color); - ObjectTypeDB::bind_method(_MD("get_item_custom_bg_color","idx"),&ItemList::get_item_custom_bg_color); + ClassDB::bind_method(_MD("set_item_custom_bg_color","idx","custom_bg_color"),&ItemList::set_item_custom_bg_color); + ClassDB::bind_method(_MD("get_item_custom_bg_color","idx"),&ItemList::get_item_custom_bg_color); - ObjectTypeDB::bind_method(_MD("set_item_tooltip_enabled","idx","enable"),&ItemList::set_item_tooltip_enabled); - ObjectTypeDB::bind_method(_MD("is_item_tooltip_enabled","idx"),&ItemList::is_item_tooltip_enabled); + ClassDB::bind_method(_MD("set_item_tooltip_enabled","idx","enable"),&ItemList::set_item_tooltip_enabled); + ClassDB::bind_method(_MD("is_item_tooltip_enabled","idx"),&ItemList::is_item_tooltip_enabled); - ObjectTypeDB::bind_method(_MD("set_item_tooltip","idx","tooltip"),&ItemList::set_item_tooltip); - ObjectTypeDB::bind_method(_MD("get_item_tooltip","idx"),&ItemList::get_item_tooltip); + ClassDB::bind_method(_MD("set_item_tooltip","idx","tooltip"),&ItemList::set_item_tooltip); + ClassDB::bind_method(_MD("get_item_tooltip","idx"),&ItemList::get_item_tooltip); - ObjectTypeDB::bind_method(_MD("select","idx","single"),&ItemList::select,DEFVAL(true)); - ObjectTypeDB::bind_method(_MD("unselect","idx"),&ItemList::unselect); - ObjectTypeDB::bind_method(_MD("is_selected","idx"),&ItemList::is_selected); - ObjectTypeDB::bind_method(_MD("get_selected_items"),&ItemList::get_selected_items); + ClassDB::bind_method(_MD("select","idx","single"),&ItemList::select,DEFVAL(true)); + ClassDB::bind_method(_MD("unselect","idx"),&ItemList::unselect); + ClassDB::bind_method(_MD("is_selected","idx"),&ItemList::is_selected); + ClassDB::bind_method(_MD("get_selected_items"),&ItemList::get_selected_items); - ObjectTypeDB::bind_method(_MD("get_item_count"),&ItemList::get_item_count); - ObjectTypeDB::bind_method(_MD("remove_item","idx"),&ItemList::remove_item); + ClassDB::bind_method(_MD("get_item_count"),&ItemList::get_item_count); + ClassDB::bind_method(_MD("remove_item","idx"),&ItemList::remove_item); - ObjectTypeDB::bind_method(_MD("clear"),&ItemList::clear); - ObjectTypeDB::bind_method(_MD("sort_items_by_text"),&ItemList::sort_items_by_text); + ClassDB::bind_method(_MD("clear"),&ItemList::clear); + ClassDB::bind_method(_MD("sort_items_by_text"),&ItemList::sort_items_by_text); - ObjectTypeDB::bind_method(_MD("set_fixed_column_width","width"),&ItemList::set_fixed_column_width); - ObjectTypeDB::bind_method(_MD("get_fixed_column_width"),&ItemList::get_fixed_column_width); + ClassDB::bind_method(_MD("set_fixed_column_width","width"),&ItemList::set_fixed_column_width); + ClassDB::bind_method(_MD("get_fixed_column_width"),&ItemList::get_fixed_column_width); - ObjectTypeDB::bind_method(_MD("set_same_column_width","enable"),&ItemList::set_same_column_width); - ObjectTypeDB::bind_method(_MD("is_same_column_width"),&ItemList::is_same_column_width); + ClassDB::bind_method(_MD("set_same_column_width","enable"),&ItemList::set_same_column_width); + ClassDB::bind_method(_MD("is_same_column_width"),&ItemList::is_same_column_width); - ObjectTypeDB::bind_method(_MD("set_max_text_lines","lines"),&ItemList::set_max_text_lines); - ObjectTypeDB::bind_method(_MD("get_max_text_lines"),&ItemList::get_max_text_lines); + ClassDB::bind_method(_MD("set_max_text_lines","lines"),&ItemList::set_max_text_lines); + ClassDB::bind_method(_MD("get_max_text_lines"),&ItemList::get_max_text_lines); - ObjectTypeDB::bind_method(_MD("set_max_columns","amount"),&ItemList::set_max_columns); - ObjectTypeDB::bind_method(_MD("get_max_columns"),&ItemList::get_max_columns); + ClassDB::bind_method(_MD("set_max_columns","amount"),&ItemList::set_max_columns); + ClassDB::bind_method(_MD("get_max_columns"),&ItemList::get_max_columns); - ObjectTypeDB::bind_method(_MD("set_select_mode","mode"),&ItemList::set_select_mode); - ObjectTypeDB::bind_method(_MD("get_select_mode"),&ItemList::get_select_mode); + ClassDB::bind_method(_MD("set_select_mode","mode"),&ItemList::set_select_mode); + ClassDB::bind_method(_MD("get_select_mode"),&ItemList::get_select_mode); - ObjectTypeDB::bind_method(_MD("set_icon_mode","mode"),&ItemList::set_icon_mode); - ObjectTypeDB::bind_method(_MD("get_icon_mode"),&ItemList::get_icon_mode); + ClassDB::bind_method(_MD("set_icon_mode","mode"),&ItemList::set_icon_mode); + ClassDB::bind_method(_MD("get_icon_mode"),&ItemList::get_icon_mode); - ObjectTypeDB::bind_method(_MD("set_fixed_icon_size","size"),&ItemList::set_fixed_icon_size); - ObjectTypeDB::bind_method(_MD("get_fixed_icon_size"),&ItemList::get_fixed_icon_size); + ClassDB::bind_method(_MD("set_fixed_icon_size","size"),&ItemList::set_fixed_icon_size); + ClassDB::bind_method(_MD("get_fixed_icon_size"),&ItemList::get_fixed_icon_size); - ObjectTypeDB::bind_method(_MD("set_icon_scale","scale"),&ItemList::set_icon_scale); - ObjectTypeDB::bind_method(_MD("get_icon_scale"),&ItemList::get_icon_scale); + ClassDB::bind_method(_MD("set_icon_scale","scale"),&ItemList::set_icon_scale); + ClassDB::bind_method(_MD("get_icon_scale"),&ItemList::get_icon_scale); - ObjectTypeDB::bind_method(_MD("set_allow_rmb_select","allow"),&ItemList::set_allow_rmb_select); - ObjectTypeDB::bind_method(_MD("get_allow_rmb_select"),&ItemList::get_allow_rmb_select); + ClassDB::bind_method(_MD("set_allow_rmb_select","allow"),&ItemList::set_allow_rmb_select); + ClassDB::bind_method(_MD("get_allow_rmb_select"),&ItemList::get_allow_rmb_select); - ObjectTypeDB::bind_method(_MD("get_item_at_pos","pos","exact"),&ItemList::get_item_at_pos,DEFVAL(false)); + ClassDB::bind_method(_MD("get_item_at_pos","pos","exact"),&ItemList::get_item_at_pos,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("ensure_current_is_visible"),&ItemList::ensure_current_is_visible); + ClassDB::bind_method(_MD("ensure_current_is_visible"),&ItemList::ensure_current_is_visible); - ObjectTypeDB::bind_method(_MD("get_v_scroll"),&ItemList::get_v_scroll); + ClassDB::bind_method(_MD("get_v_scroll"),&ItemList::get_v_scroll); - ObjectTypeDB::bind_method(_MD("_scroll_changed"),&ItemList::_scroll_changed); - ObjectTypeDB::bind_method(_MD("_input_event"),&ItemList::_input_event); + ClassDB::bind_method(_MD("_scroll_changed"),&ItemList::_scroll_changed); + ClassDB::bind_method(_MD("_gui_input"),&ItemList::_gui_input); BIND_CONSTANT( ICON_MODE_TOP ); BIND_CONSTANT( ICON_MODE_LEFT ); @@ -1372,6 +1371,8 @@ void ItemList::_bind_methods(){ ADD_SIGNAL( MethodInfo("item_rmb_selected",PropertyInfo(Variant::INT,"index"),PropertyInfo(Variant::VECTOR2,"atpos"))); ADD_SIGNAL( MethodInfo("multi_selected",PropertyInfo(Variant::INT,"index"),PropertyInfo(Variant::BOOL,"selected"))); ADD_SIGNAL( MethodInfo("item_activated",PropertyInfo(Variant::INT,"index"))); + + GLOBAL_DEF("gui/timers/incremental_search_max_interval_msec",2000); } ItemList::ItemList() { @@ -1400,6 +1401,7 @@ ItemList::ItemList() { allow_rmb_select=false; icon_scale = 1.0f; + set_clip_contents(true); } ItemList::~ItemList() { diff --git a/scene/gui/item_list.h b/scene/gui/item_list.h index cb5908bc79..f4a864c782 100644 --- a/scene/gui/item_list.h +++ b/scene/gui/item_list.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class ItemList : public Control { - OBJ_TYPE( ItemList, Control ); + GDCLASS( ItemList, Control ); public: enum IconMode { @@ -102,7 +102,7 @@ private: real_t icon_scale; void _scroll_changed(double); - void _input_event(const InputEvent& p_event); + void _gui_input(const InputEvent& p_event); protected: diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index f95b151024..cd500a62bc 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -68,10 +68,18 @@ int Label::get_line_height() const { void Label::_notification(int p_what) { + if (p_what==NOTIFICATION_TRANSLATION_CHANGED) { + + xl_text=XL_MESSAGE(text); + minimum_size_changed(); + update(); + } + if (p_what==NOTIFICATION_DRAW) { - if (clip || autowrap) + if (clip || autowrap) { VisualServer::get_singleton()->canvas_item_set_clip(get_canvas_item(),true); + } if (word_cache_dirty) regenerate_word_cache(); @@ -239,8 +247,8 @@ void Label::_notification(int p_what) { for (int i=0;i<from->word_len;i++) { if (visible_chars < 0 || chars_total_shadow<visible_chars) { - CharType c = text[i+pos]; - CharType n = text[i+pos+1]; + CharType c = xl_text[i+pos]; + CharType n = xl_text[i+pos+1]; if (uppercase) { c=String::char_uppercase(c); n=String::char_uppercase(c); @@ -262,8 +270,8 @@ void Label::_notification(int p_what) { for (int i=0;i<from->word_len;i++) { if (visible_chars < 0 || chars_total<visible_chars) { - CharType c = text[i+pos]; - CharType n = text[i+pos+1]; + CharType c = xl_text[i+pos]; + CharType n = xl_text[i+pos+1]; if (uppercase) { c=String::char_uppercase(c); n=String::char_uppercase(c); @@ -318,9 +326,9 @@ int Label::get_longest_line_width() const { int max_line_width=0; int line_width=0; - for (int i=0;i<text.size();i++) { + for (int i=0;i<xl_text.size();i++) { - CharType current=text[i]; + CharType current=xl_text[i]; if (uppercase) current=String::char_uppercase(current); @@ -334,7 +342,7 @@ int Label::get_longest_line_width() const { } } else { - int char_width=font->get_char_size(current,text[i+1]).width; + int char_width=font->get_char_size(current,xl_text[i+1]).width; line_width+=char_width; } @@ -395,9 +403,9 @@ void Label::regenerate_word_cache() { WordCache *last=NULL; - for (int i=0;i<text.size()+1;i++) { + for (int i=0;i<xl_text.size()+1;i++) { - CharType current=i<text.length()?text[i]:' '; //always a space at the end, so the algo works + CharType current=i<xl_text.length()?xl_text[i]:' '; //always a space at the end, so the algo works if (uppercase) current=String::char_uppercase(current); @@ -437,7 +445,7 @@ void Label::regenerate_word_cache() { total_char_cache++; } - if (i<text.length() && text[i] == ' ') { + if (i<xl_text.length() && xl_text[i] == ' ') { total_char_cache--; // do not count spaces if (line_width > 0 || last==NULL || last->char_pos!=WordCache::CHAR_WRAPLINE) { space_count++; @@ -454,7 +462,7 @@ void Label::regenerate_word_cache() { word_pos=i; } - char_width=font->get_char_size(current,text[i+1]).width; + char_width=font->get_char_size(current,xl_text[i+1]).width; current_word_size+=char_width; line_width+=char_width; total_char_cache++; @@ -540,12 +548,11 @@ Label::VAlign Label::get_valign() const{ void Label::set_text(const String& p_string) { - String str = XL_MESSAGE(p_string); - if (text==str) + if (text==p_string) return; - - text=str; + text=p_string; + xl_text=XL_MESSAGE(p_string); word_cache_dirty=true; if (percent_visible<1) visible_chars=get_total_character_count()*percent_visible; @@ -641,30 +648,30 @@ int Label::get_total_character_count() const { void Label::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_align","align"),&Label::set_align); - ObjectTypeDB::bind_method(_MD("get_align"),&Label::get_align); - ObjectTypeDB::bind_method(_MD("set_valign","valign"),&Label::set_valign); - ObjectTypeDB::bind_method(_MD("get_valign"),&Label::get_valign); - ObjectTypeDB::bind_method(_MD("set_text","text"),&Label::set_text); - ObjectTypeDB::bind_method(_MD("get_text"),&Label::get_text); - ObjectTypeDB::bind_method(_MD("set_autowrap","enable"),&Label::set_autowrap); - ObjectTypeDB::bind_method(_MD("has_autowrap"),&Label::has_autowrap); - ObjectTypeDB::bind_method(_MD("set_clip_text","enable"),&Label::set_clip_text); - ObjectTypeDB::bind_method(_MD("is_clipping_text"),&Label::is_clipping_text); - ObjectTypeDB::bind_method(_MD("set_uppercase","enable"),&Label::set_uppercase); - ObjectTypeDB::bind_method(_MD("is_uppercase"),&Label::is_uppercase); - ObjectTypeDB::bind_method(_MD("get_line_height"),&Label::get_line_height); - ObjectTypeDB::bind_method(_MD("get_line_count"),&Label::get_line_count); - ObjectTypeDB::bind_method(_MD("get_visible_line_count"),&Label::get_visible_line_count); - ObjectTypeDB::bind_method(_MD("get_total_character_count"),&Label::get_total_character_count); - ObjectTypeDB::bind_method(_MD("set_visible_characters","amount"),&Label::set_visible_characters); - ObjectTypeDB::bind_method(_MD("get_visible_characters"),&Label::get_visible_characters); - ObjectTypeDB::bind_method(_MD("set_percent_visible","percent_visible"),&Label::set_percent_visible); - ObjectTypeDB::bind_method(_MD("get_percent_visible"),&Label::get_percent_visible); - ObjectTypeDB::bind_method(_MD("set_lines_skipped","lines_skipped"),&Label::set_lines_skipped); - ObjectTypeDB::bind_method(_MD("get_lines_skipped"),&Label::get_lines_skipped); - ObjectTypeDB::bind_method(_MD("set_max_lines_visible","lines_visible"),&Label::set_max_lines_visible); - ObjectTypeDB::bind_method(_MD("get_max_lines_visible"),&Label::get_max_lines_visible); + ClassDB::bind_method(_MD("set_align","align"),&Label::set_align); + ClassDB::bind_method(_MD("get_align"),&Label::get_align); + ClassDB::bind_method(_MD("set_valign","valign"),&Label::set_valign); + ClassDB::bind_method(_MD("get_valign"),&Label::get_valign); + ClassDB::bind_method(_MD("set_text","text"),&Label::set_text); + ClassDB::bind_method(_MD("get_text"),&Label::get_text); + ClassDB::bind_method(_MD("set_autowrap","enable"),&Label::set_autowrap); + ClassDB::bind_method(_MD("has_autowrap"),&Label::has_autowrap); + ClassDB::bind_method(_MD("set_clip_text","enable"),&Label::set_clip_text); + ClassDB::bind_method(_MD("is_clipping_text"),&Label::is_clipping_text); + ClassDB::bind_method(_MD("set_uppercase","enable"),&Label::set_uppercase); + ClassDB::bind_method(_MD("is_uppercase"),&Label::is_uppercase); + ClassDB::bind_method(_MD("get_line_height"),&Label::get_line_height); + ClassDB::bind_method(_MD("get_line_count"),&Label::get_line_count); + ClassDB::bind_method(_MD("get_visible_line_count"),&Label::get_visible_line_count); + ClassDB::bind_method(_MD("get_total_character_count"),&Label::get_total_character_count); + ClassDB::bind_method(_MD("set_visible_characters","amount"),&Label::set_visible_characters); + ClassDB::bind_method(_MD("get_visible_characters"),&Label::get_visible_characters); + ClassDB::bind_method(_MD("set_percent_visible","percent_visible"),&Label::set_percent_visible); + ClassDB::bind_method(_MD("get_percent_visible"),&Label::get_percent_visible); + ClassDB::bind_method(_MD("set_lines_skipped","lines_skipped"),&Label::set_lines_skipped); + ClassDB::bind_method(_MD("get_lines_skipped"),&Label::get_lines_skipped); + ClassDB::bind_method(_MD("set_max_lines_visible","lines_visible"),&Label::set_max_lines_visible); + ClassDB::bind_method(_MD("get_max_lines_visible"),&Label::get_max_lines_visible); BIND_CONSTANT( ALIGN_LEFT ); BIND_CONSTANT( ALIGN_CENTER ); @@ -692,14 +699,14 @@ Label::Label(const String &p_text) { align=ALIGN_LEFT; valign=VALIGN_TOP; - text=""; + xl_text=""; word_cache=NULL; word_cache_dirty=true; autowrap=false; line_count=0; set_v_size_flags(0); clip=false; - set_ignore_mouse(true); + set_mouse_filter(MOUSE_FILTER_IGNORE); total_char_cache=0; visible_chars=-1; percent_visible=1; diff --git a/scene/gui/label.h b/scene/gui/label.h index b472eca1a2..80e4c970f6 100644 --- a/scene/gui/label.h +++ b/scene/gui/label.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ */ class Label : public Control { - OBJ_TYPE( Label, Control ); + GDCLASS( Label, Control ); public: enum Align { @@ -58,6 +58,7 @@ private: Align align; VAlign valign; String text; + String xl_text; bool autowrap; bool clip; Size2 minsize; diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index eecc730f5c..e75785b1ff 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -41,7 +41,7 @@ static bool _is_text_char(CharType c) { return (c>='a' && c<='z') || (c>='A' && c<='Z') || (c>='0' && c<='9') || c=='_'; } -void LineEdit::_input_event(InputEvent p_event) { +void LineEdit::_gui_input(InputEvent p_event) { switch(p_event.type) { @@ -551,8 +551,8 @@ void LineEdit::_notification(int p_what) { #ifdef TOOLS_ENABLED case NOTIFICATION_ENTER_TREE: { if (get_tree()->is_editor_hint()) { - cursor_set_blink_enabled(EDITOR_DEF("text_editor/caret_blink", false)); - cursor_set_blink_speed(EDITOR_DEF("text_editor/caret_blink_speed", 0.65)); + cursor_set_blink_enabled(EDITOR_DEF("text_editor/cursor/caret_blink", false)); + cursor_set_blink_speed(EDITOR_DEF("text_editor/cursor/caret_blink_speed", 0.65)); if (!EditorSettings::get_singleton()->is_connected("settings_changed",this,"_editor_settings_changed")) { EditorSettings::get_singleton()->connect("settings_changed",this,"_editor_settings_changed"); @@ -918,6 +918,7 @@ void LineEdit::set_text(String p_text) { update(); cursor_pos=0; window_pos=0; + _text_changed(); } void LineEdit::clear() { @@ -1227,8 +1228,8 @@ PopupMenu *LineEdit::get_menu() const { #ifdef TOOLS_ENABLED void LineEdit::_editor_settings_changed() { - cursor_set_blink_enabled(EDITOR_DEF("text_editor/caret_blink", false)); - cursor_set_blink_speed(EDITOR_DEF("text_editor/caret_blink_speed", 0.65)); + cursor_set_blink_enabled(EDITOR_DEF("text_editor/cursor/caret_blink", false)); + cursor_set_blink_speed(EDITOR_DEF("text_editor/cursor/caret_blink_speed", 0.65)); } #endif @@ -1257,42 +1258,42 @@ void LineEdit::_text_changed() { void LineEdit::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_toggle_draw_caret"),&LineEdit::_toggle_draw_caret); + ClassDB::bind_method(_MD("_toggle_draw_caret"),&LineEdit::_toggle_draw_caret); #ifdef TOOLS_ENABLED - ObjectTypeDB::bind_method("_editor_settings_changed",&LineEdit::_editor_settings_changed); + ClassDB::bind_method("_editor_settings_changed",&LineEdit::_editor_settings_changed); #endif - ObjectTypeDB::bind_method(_MD("set_align", "align"), &LineEdit::set_align); - ObjectTypeDB::bind_method(_MD("get_align"), &LineEdit::get_align); - - ObjectTypeDB::bind_method(_MD("_input_event"),&LineEdit::_input_event); - ObjectTypeDB::bind_method(_MD("clear"),&LineEdit::clear); - ObjectTypeDB::bind_method(_MD("select_all"),&LineEdit::select_all); - ObjectTypeDB::bind_method(_MD("set_text","text"),&LineEdit::set_text); - ObjectTypeDB::bind_method(_MD("get_text"),&LineEdit::get_text); - ObjectTypeDB::bind_method(_MD("set_placeholder","text"),&LineEdit::set_placeholder); - ObjectTypeDB::bind_method(_MD("get_placeholder"),&LineEdit::get_placeholder); - ObjectTypeDB::bind_method(_MD("set_placeholder_alpha","alpha"),&LineEdit::set_placeholder_alpha); - ObjectTypeDB::bind_method(_MD("get_placeholder_alpha"),&LineEdit::get_placeholder_alpha); - ObjectTypeDB::bind_method(_MD("set_cursor_pos","pos"),&LineEdit::set_cursor_pos); - ObjectTypeDB::bind_method(_MD("get_cursor_pos"),&LineEdit::get_cursor_pos); - ObjectTypeDB::bind_method(_MD("set_expand_to_text_length","enabled"),&LineEdit::set_expand_to_text_length); - ObjectTypeDB::bind_method(_MD("get_expand_to_text_length"),&LineEdit::get_expand_to_text_length); - ObjectTypeDB::bind_method(_MD("cursor_set_blink_enabled", "enabled"),&LineEdit::cursor_set_blink_enabled); - ObjectTypeDB::bind_method(_MD("cursor_get_blink_enabled"),&LineEdit::cursor_get_blink_enabled); - ObjectTypeDB::bind_method(_MD("cursor_set_blink_speed", "blink_speed"),&LineEdit::cursor_set_blink_speed); - ObjectTypeDB::bind_method(_MD("cursor_get_blink_speed"),&LineEdit::cursor_get_blink_speed); - ObjectTypeDB::bind_method(_MD("set_max_length","chars"),&LineEdit::set_max_length); - ObjectTypeDB::bind_method(_MD("get_max_length"),&LineEdit::get_max_length); - ObjectTypeDB::bind_method(_MD("append_at_cursor","text"),&LineEdit::append_at_cursor); - ObjectTypeDB::bind_method(_MD("set_editable","enabled"),&LineEdit::set_editable); - ObjectTypeDB::bind_method(_MD("is_editable"),&LineEdit::is_editable); - ObjectTypeDB::bind_method(_MD("set_secret","enabled"),&LineEdit::set_secret); - ObjectTypeDB::bind_method(_MD("is_secret"),&LineEdit::is_secret); - ObjectTypeDB::bind_method(_MD("select","from","to"),&LineEdit::select,DEFVAL(0),DEFVAL(-1)); - ObjectTypeDB::bind_method(_MD("menu_option","option"),&LineEdit::menu_option); - ObjectTypeDB::bind_method(_MD("get_menu:PopupMenu"),&LineEdit::get_menu); + ClassDB::bind_method(_MD("set_align", "align"), &LineEdit::set_align); + ClassDB::bind_method(_MD("get_align"), &LineEdit::get_align); + + ClassDB::bind_method(_MD("_gui_input"),&LineEdit::_gui_input); + ClassDB::bind_method(_MD("clear"),&LineEdit::clear); + ClassDB::bind_method(_MD("select_all"),&LineEdit::select_all); + ClassDB::bind_method(_MD("set_text","text"),&LineEdit::set_text); + ClassDB::bind_method(_MD("get_text"),&LineEdit::get_text); + ClassDB::bind_method(_MD("set_placeholder","text"),&LineEdit::set_placeholder); + ClassDB::bind_method(_MD("get_placeholder"),&LineEdit::get_placeholder); + ClassDB::bind_method(_MD("set_placeholder_alpha","alpha"),&LineEdit::set_placeholder_alpha); + ClassDB::bind_method(_MD("get_placeholder_alpha"),&LineEdit::get_placeholder_alpha); + ClassDB::bind_method(_MD("set_cursor_pos","pos"),&LineEdit::set_cursor_pos); + ClassDB::bind_method(_MD("get_cursor_pos"),&LineEdit::get_cursor_pos); + ClassDB::bind_method(_MD("set_expand_to_text_length","enabled"),&LineEdit::set_expand_to_text_length); + ClassDB::bind_method(_MD("get_expand_to_text_length"),&LineEdit::get_expand_to_text_length); + ClassDB::bind_method(_MD("cursor_set_blink_enabled", "enabled"),&LineEdit::cursor_set_blink_enabled); + ClassDB::bind_method(_MD("cursor_get_blink_enabled"),&LineEdit::cursor_get_blink_enabled); + ClassDB::bind_method(_MD("cursor_set_blink_speed", "blink_speed"),&LineEdit::cursor_set_blink_speed); + ClassDB::bind_method(_MD("cursor_get_blink_speed"),&LineEdit::cursor_get_blink_speed); + ClassDB::bind_method(_MD("set_max_length","chars"),&LineEdit::set_max_length); + ClassDB::bind_method(_MD("get_max_length"),&LineEdit::get_max_length); + ClassDB::bind_method(_MD("append_at_cursor","text"),&LineEdit::append_at_cursor); + ClassDB::bind_method(_MD("set_editable","enabled"),&LineEdit::set_editable); + ClassDB::bind_method(_MD("is_editable"),&LineEdit::is_editable); + ClassDB::bind_method(_MD("set_secret","enabled"),&LineEdit::set_secret); + ClassDB::bind_method(_MD("is_secret"),&LineEdit::is_secret); + ClassDB::bind_method(_MD("select","from","to"),&LineEdit::select,DEFVAL(0),DEFVAL(-1)); + ClassDB::bind_method(_MD("menu_option","option"),&LineEdit::menu_option); + ClassDB::bind_method(_MD("get_menu:PopupMenu"),&LineEdit::get_menu); ADD_SIGNAL( MethodInfo("text_changed", PropertyInfo( Variant::STRING, "text" )) ); ADD_SIGNAL( MethodInfo("text_entered", PropertyInfo( Variant::STRING, "text" )) ); @@ -1311,16 +1312,18 @@ void LineEdit::_bind_methods() { BIND_CONSTANT( MENU_MAX ); ADD_PROPERTYNZ( PropertyInfo( Variant::STRING, "text" ), _SCS("set_text"),_SCS("get_text") ); - ADD_PROPERTYNZ( PropertyInfo( Variant::STRING, "placeholder/text" ), _SCS("set_placeholder"),_SCS("get_placeholder") ); - ADD_PROPERTYNZ( PropertyInfo( Variant::REAL, "placeholder/alpha",PROPERTY_HINT_RANGE,"0,1,0.001" ), _SCS("set_placeholder_alpha"),_SCS("get_placeholder_alpha") ); ADD_PROPERTYNZ(PropertyInfo(Variant::INT, "align", PROPERTY_HINT_ENUM, "Left,Center,Right,Fill"), _SCS("set_align"), _SCS("get_align")); ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "max_length" ), _SCS("set_max_length"),_SCS("get_max_length") ); ADD_PROPERTYNO( PropertyInfo( Variant::BOOL, "editable" ), _SCS("set_editable"),_SCS("is_editable") ); ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "secret" ), _SCS("set_secret"),_SCS("is_secret") ); ADD_PROPERTYNO( PropertyInfo( Variant::BOOL, "expand_to_len" ), _SCS("set_expand_to_text_length"),_SCS("get_expand_to_text_length") ); ADD_PROPERTY( PropertyInfo( Variant::INT,"focus_mode", PROPERTY_HINT_ENUM, "None,Click,All" ), _SCS("set_focus_mode"), _SCS("get_focus_mode") ); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret/caret_blink"), _SCS("cursor_set_blink_enabled"), _SCS("cursor_get_blink_enabled"));; - ADD_PROPERTYNZ(PropertyInfo(Variant::REAL, "caret/caret_blink_speed",PROPERTY_HINT_RANGE,"0.1,10,0.1"), _SCS("cursor_set_blink_speed"),_SCS("cursor_get_blink_speed") ); + ADD_GROUP("Placeholder","placeholder_"); + ADD_PROPERTYNZ( PropertyInfo( Variant::STRING, "placeholder_text" ), _SCS("set_placeholder"),_SCS("get_placeholder") ); + ADD_PROPERTYNZ( PropertyInfo( Variant::REAL, "placeholder_alpha",PROPERTY_HINT_RANGE,"0,1,0.001" ), _SCS("set_placeholder_alpha"),_SCS("get_placeholder_alpha") ); + ADD_GROUP("Caret","caret_"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret_blink"), _SCS("cursor_set_blink_enabled"), _SCS("cursor_get_blink_enabled"));; + ADD_PROPERTYNZ(PropertyInfo(Variant::REAL, "caret_blink_speed",PROPERTY_HINT_RANGE,"0.1,10,0.1"), _SCS("cursor_set_blink_speed"),_SCS("cursor_get_blink_speed") ); } LineEdit::LineEdit() { @@ -1338,7 +1341,7 @@ LineEdit::LineEdit() { set_focus_mode( FOCUS_ALL ); editable=true; set_default_cursor_shape(CURSOR_IBEAM); - set_stop_mouse(true); + set_mouse_filter(MOUSE_FILTER_STOP); draw_caret=true; caret_blink_enabled=false; @@ -1358,7 +1361,7 @@ LineEdit::LineEdit() { menu->add_item(TTR("Clear"),MENU_CLEAR); menu->add_separator(); menu->add_item(TTR("Undo"),MENU_UNDO,KEY_MASK_CMD|KEY_Z); - menu->connect("item_pressed",this,"menu_option"); + menu->connect("id_pressed",this,"menu_option"); expand_to_text_length=false; diff --git a/scene/gui/line_edit.h b/scene/gui/line_edit.h index 47d5706bbe..64c37861d0 100644 --- a/scene/gui/line_edit.h +++ b/scene/gui/line_edit.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ */ class LineEdit : public Control { - OBJ_TYPE( LineEdit, Control ); + GDCLASS( LineEdit, Control ); public: enum Align { @@ -119,7 +119,7 @@ private: void _editor_settings_changed(); #endif - void _input_event(InputEvent p_event); + void _gui_input(InputEvent p_event); void _notification(int p_what); diff --git a/scene/gui/link_button.cpp b/scene/gui/link_button.cpp index e6f85c5935..5b791064a8 100644 --- a/scene/gui/link_button.cpp +++ b/scene/gui/link_button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -130,11 +130,11 @@ void LinkButton::_notification(int p_what) { void LinkButton::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_text","text"),&LinkButton::set_text); - ObjectTypeDB::bind_method(_MD("get_text"),&LinkButton::get_text); + ClassDB::bind_method(_MD("set_text","text"),&LinkButton::set_text); + ClassDB::bind_method(_MD("get_text"),&LinkButton::get_text); - ObjectTypeDB::bind_method(_MD("set_underline_mode","underline_mode"),&LinkButton::set_underline_mode); - ObjectTypeDB::bind_method(_MD("get_underline_mode"),&LinkButton::get_underline_mode); + ClassDB::bind_method(_MD("set_underline_mode","underline_mode"),&LinkButton::set_underline_mode); + ClassDB::bind_method(_MD("get_underline_mode"),&LinkButton::get_underline_mode); BIND_CONSTANT( UNDERLINE_MODE_ALWAYS ); diff --git a/scene/gui/link_button.h b/scene/gui/link_button.h index a44fc2ec1b..42d7c05cff 100644 --- a/scene/gui/link_button.h +++ b/scene/gui/link_button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class LinkButton : public BaseButton { - OBJ_TYPE( LinkButton, BaseButton ); + GDCLASS( LinkButton, BaseButton ); public: enum UnderlineMode { diff --git a/scene/gui/margin_container.cpp b/scene/gui/margin_container.cpp index 5f798f445c..883364b2fd 100644 --- a/scene/gui/margin_container.cpp +++ b/scene/gui/margin_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/margin_container.h b/scene/gui/margin_container.h index df9a5c9361..542578dd01 100644 --- a/scene/gui/margin_container.h +++ b/scene/gui/margin_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,7 +32,7 @@ #include "scene/gui/container.h" class MarginContainer : public Container { - OBJ_TYPE(MarginContainer,Container); + GDCLASS(MarginContainer,Container); protected: void _notification(int p_what); diff --git a/scene/gui/menu_button.cpp b/scene/gui/menu_button.cpp index 725f1ddf17..755b296666 100644 --- a/scene/gui/menu_button.cpp +++ b/scene/gui/menu_button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,16 +34,14 @@ void MenuButton::_unhandled_key_input(InputEvent p_event) { - if (p_event.is_pressed() && !p_event.is_echo() && (p_event.type==InputEvent::KEY || p_event.type==InputEvent::ACTION || p_event.type==InputEvent::JOYSTICK_BUTTON)) { + if (p_event.is_pressed() && !p_event.is_echo() && (p_event.type==InputEvent::KEY || p_event.type==InputEvent::ACTION || p_event.type==InputEvent::JOYPAD_BUTTON)) { if (!get_parent() || !is_visible() || is_disabled()) return; - if (get_viewport()->get_modal_stack_top() && !get_viewport()->get_modal_stack_top()->is_a_parent_of(this)) - return; //ignore because of modal window + bool global_only = (get_viewport()->get_modal_stack_top() && !get_viewport()->get_modal_stack_top()->is_a_parent_of(this)); - - if (popup->activate_item_by_event(p_event)) + if (popup->activate_item_by_event(p_event,global_only)) accept_event(); } } @@ -64,7 +62,7 @@ void MenuButton::pressed() { } -void MenuButton::_input_event(InputEvent p_event) { +void MenuButton::_gui_input(InputEvent p_event) { /*if (p_event.type==InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index==BUTTON_LEFT) { clicked=p_event.mouse_button.pressed; @@ -81,7 +79,7 @@ void MenuButton::_input_event(InputEvent p_event) { }*/ - BaseButton::_input_event(p_event); + BaseButton::_gui_input(p_event); } PopupMenu *MenuButton::get_popup() { @@ -100,10 +98,10 @@ void MenuButton::_set_items(const Array& p_items) { void MenuButton::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_popup:PopupMenu"),&MenuButton::get_popup); - ObjectTypeDB::bind_method(_MD("_unhandled_key_input"),&MenuButton::_unhandled_key_input); - ObjectTypeDB::bind_method(_MD("_set_items"),&MenuButton::_set_items); - ObjectTypeDB::bind_method(_MD("_get_items"),&MenuButton::_get_items); + ClassDB::bind_method(_MD("get_popup:PopupMenu"),&MenuButton::get_popup); + ClassDB::bind_method(_MD("_unhandled_key_input"),&MenuButton::_unhandled_key_input); + ClassDB::bind_method(_MD("_set_items"),&MenuButton::_set_items); + ClassDB::bind_method(_MD("_get_items"),&MenuButton::_get_items); ADD_PROPERTY( PropertyInfo(Variant::ARRAY,"items",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_items"),_SCS("_get_items") ); diff --git a/scene/gui/menu_button.h b/scene/gui/menu_button.h index 650e4aba5c..5b5573456f 100644 --- a/scene/gui/menu_button.h +++ b/scene/gui/menu_button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ */ class MenuButton : public Button { - OBJ_TYPE( MenuButton, Button ); + GDCLASS( MenuButton, Button ); bool clicked; PopupMenu *popup; @@ -46,7 +46,7 @@ class MenuButton : public Button { Array _get_items() const; void _set_items(const Array& p_items); - void _input_event(InputEvent p_event); + void _gui_input(InputEvent p_event); protected: diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp index 587a68ae37..1b5b21ae92 100644 --- a/scene/gui/option_button.cpp +++ b/scene/gui/option_button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -287,32 +287,32 @@ void OptionButton::get_translatable_strings(List<String> *p_strings) const { void OptionButton::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_selected"),&OptionButton::_selected); - - ObjectTypeDB::bind_method(_MD("add_item","label","id"),&OptionButton::add_item,DEFVAL(-1)); - ObjectTypeDB::bind_method(_MD("add_icon_item","texture:Texture","label","id"),&OptionButton::add_icon_item); - ObjectTypeDB::bind_method(_MD("set_item_text","idx","text"),&OptionButton::set_item_text); - ObjectTypeDB::bind_method(_MD("set_item_icon","idx","texture:Texture"),&OptionButton::set_item_icon); - ObjectTypeDB::bind_method(_MD("set_item_disabled","idx","disabled"),&OptionButton::set_item_disabled); - ObjectTypeDB::bind_method(_MD("set_item_ID","idx","id"),&OptionButton::set_item_ID); - ObjectTypeDB::bind_method(_MD("set_item_metadata","idx","metadata"),&OptionButton::set_item_metadata); - ObjectTypeDB::bind_method(_MD("get_item_text","idx"),&OptionButton::get_item_text); - ObjectTypeDB::bind_method(_MD("get_item_icon:Texture","idx"),&OptionButton::get_item_icon); - ObjectTypeDB::bind_method(_MD("get_item_ID","idx"),&OptionButton::get_item_ID); - ObjectTypeDB::bind_method(_MD("get_item_metadata","idx"),&OptionButton::get_item_metadata); - ObjectTypeDB::bind_method(_MD("is_item_disabled","idx"),&OptionButton::is_item_disabled); - ObjectTypeDB::bind_method(_MD("get_item_count"),&OptionButton::get_item_count); - ObjectTypeDB::bind_method(_MD("add_separator"),&OptionButton::add_separator); - ObjectTypeDB::bind_method(_MD("clear"),&OptionButton::clear); - ObjectTypeDB::bind_method(_MD("select","idx"),&OptionButton::select); - ObjectTypeDB::bind_method(_MD("get_selected"),&OptionButton::get_selected); - ObjectTypeDB::bind_method(_MD("get_selected_ID"),&OptionButton::get_selected_ID); - ObjectTypeDB::bind_method(_MD("get_selected_metadata"),&OptionButton::get_selected_metadata); - ObjectTypeDB::bind_method(_MD("remove_item","idx"),&OptionButton::remove_item); - ObjectTypeDB::bind_method(_MD("_select_int"),&OptionButton::_select_int); - - ObjectTypeDB::bind_method(_MD("_set_items"),&OptionButton::_set_items); - ObjectTypeDB::bind_method(_MD("_get_items"),&OptionButton::_get_items); + ClassDB::bind_method(_MD("_selected"),&OptionButton::_selected); + + ClassDB::bind_method(_MD("add_item","label","id"),&OptionButton::add_item,DEFVAL(-1)); + ClassDB::bind_method(_MD("add_icon_item","texture:Texture","label","id"),&OptionButton::add_icon_item); + ClassDB::bind_method(_MD("set_item_text","idx","text"),&OptionButton::set_item_text); + ClassDB::bind_method(_MD("set_item_icon","idx","texture:Texture"),&OptionButton::set_item_icon); + ClassDB::bind_method(_MD("set_item_disabled","idx","disabled"),&OptionButton::set_item_disabled); + ClassDB::bind_method(_MD("set_item_ID","idx","id"),&OptionButton::set_item_ID); + ClassDB::bind_method(_MD("set_item_metadata","idx","metadata"),&OptionButton::set_item_metadata); + ClassDB::bind_method(_MD("get_item_text","idx"),&OptionButton::get_item_text); + ClassDB::bind_method(_MD("get_item_icon:Texture","idx"),&OptionButton::get_item_icon); + ClassDB::bind_method(_MD("get_item_ID","idx"),&OptionButton::get_item_ID); + ClassDB::bind_method(_MD("get_item_metadata","idx"),&OptionButton::get_item_metadata); + ClassDB::bind_method(_MD("is_item_disabled","idx"),&OptionButton::is_item_disabled); + ClassDB::bind_method(_MD("get_item_count"),&OptionButton::get_item_count); + ClassDB::bind_method(_MD("add_separator"),&OptionButton::add_separator); + ClassDB::bind_method(_MD("clear"),&OptionButton::clear); + ClassDB::bind_method(_MD("select","idx"),&OptionButton::select); + ClassDB::bind_method(_MD("get_selected"),&OptionButton::get_selected); + ClassDB::bind_method(_MD("get_selected_ID"),&OptionButton::get_selected_ID); + ClassDB::bind_method(_MD("get_selected_metadata"),&OptionButton::get_selected_metadata); + ClassDB::bind_method(_MD("remove_item","idx"),&OptionButton::remove_item); + ClassDB::bind_method(_MD("_select_int"),&OptionButton::_select_int); + + ClassDB::bind_method(_MD("_set_items"),&OptionButton::_set_items); + ClassDB::bind_method(_MD("_get_items"),&OptionButton::_get_items); ADD_PROPERTY( PropertyInfo(Variant::INT,"selected"), _SCS("_select_int"),_SCS("get_selected") ); ADD_PROPERTY( PropertyInfo(Variant::ARRAY,"items",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_items"),_SCS("_get_items") ); @@ -326,7 +326,7 @@ OptionButton::OptionButton() { popup->hide(); popup->set_as_toplevel(true); add_child(popup); - popup->connect("item_pressed", this,"_selected"); + popup->connect("id_pressed", this,"_selected"); current=-1; set_text_align(ALIGN_LEFT); diff --git a/scene/gui/option_button.h b/scene/gui/option_button.h index 70ebc66a46..681cb5a088 100644 --- a/scene/gui/option_button.h +++ b/scene/gui/option_button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ */ class OptionButton : public Button { - OBJ_TYPE( OptionButton, Button ); + GDCLASS( OptionButton, Button ); PopupMenu *popup; int current; diff --git a/scene/gui/panel.cpp b/scene/gui/panel.cpp index 682ea5b92c..c4b7199c3e 100644 --- a/scene/gui/panel.cpp +++ b/scene/gui/panel.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -41,7 +41,7 @@ void Panel::_notification(int p_what) { Panel::Panel() { - set_stop_mouse(true); + set_mouse_filter(MOUSE_FILTER_STOP); } diff --git a/scene/gui/panel.h b/scene/gui/panel.h index 9e2e7df7f0..34c73960e7 100644 --- a/scene/gui/panel.h +++ b/scene/gui/panel.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ */ class Panel : public Control{ - OBJ_TYPE(Panel,Control); + GDCLASS(Panel,Control); protected: void _notification(int p_what); diff --git a/scene/gui/panel_container.cpp b/scene/gui/panel_container.cpp index b5e3ef8c7b..451a85cf48 100644 --- a/scene/gui/panel_container.cpp +++ b/scene/gui/panel_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/panel_container.h b/scene/gui/panel_container.h index a40519c9f2..86f390fdf3 100644 --- a/scene/gui/panel_container.h +++ b/scene/gui/panel_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class PanelContainer : public Container { - OBJ_TYPE( PanelContainer, Container ); + GDCLASS( PanelContainer, Container ); protected: diff --git a/scene/gui/patch_9_frame.cpp b/scene/gui/patch_9_frame.cpp index 9ad6398359..e32f60a222 100644 --- a/scene/gui/patch_9_frame.cpp +++ b/scene/gui/patch_9_frame.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,7 +39,7 @@ void Patch9Frame::_notification(int p_what) { Size2 s=get_size(); RID ci = get_canvas_item(); - VS::get_singleton()->canvas_item_add_style_box(ci,Rect2(Point2(),s),region_rect,texture->get_rid(),Vector2(margin[MARGIN_LEFT],margin[MARGIN_TOP]),Vector2(margin[MARGIN_RIGHT],margin[MARGIN_BOTTOM]),draw_center,modulate); + VS::get_singleton()->canvas_item_add_nine_patch(ci,Rect2(Point2(),s),region_rect,texture->get_rid(),Vector2(margin[MARGIN_LEFT],margin[MARGIN_TOP]),Vector2(margin[MARGIN_RIGHT],margin[MARGIN_BOTTOM]),VS::NINE_PATCH_STRETCH,VS::NINE_PATCH_STRETCH,draw_center); // draw_texture_rect(texture,Rect2(Point2(),s),false,modulate); /* @@ -68,27 +68,26 @@ Size2 Patch9Frame::get_minimum_size() const { void Patch9Frame::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_texture","texture"), & Patch9Frame::set_texture ); - ObjectTypeDB::bind_method(_MD("get_texture"), & Patch9Frame::get_texture ); - ObjectTypeDB::bind_method(_MD("set_modulate","modulate"), & Patch9Frame::set_modulate ); - ObjectTypeDB::bind_method(_MD("get_modulate"), & Patch9Frame::get_modulate ); - ObjectTypeDB::bind_method(_MD("set_patch_margin","margin","value"), & Patch9Frame::set_patch_margin ); - ObjectTypeDB::bind_method(_MD("get_patch_margin","margin"), & Patch9Frame::get_patch_margin ); - ObjectTypeDB::bind_method(_MD("set_region_rect","rect"),&Patch9Frame::set_region_rect); - ObjectTypeDB::bind_method(_MD("get_region_rect"),&Patch9Frame::get_region_rect); - ObjectTypeDB::bind_method(_MD("set_draw_center","draw_center"), & Patch9Frame::set_draw_center ); - ObjectTypeDB::bind_method(_MD("get_draw_center"), & Patch9Frame::get_draw_center ); + ClassDB::bind_method(_MD("set_texture","texture"), & Patch9Frame::set_texture ); + ClassDB::bind_method(_MD("get_texture"), & Patch9Frame::get_texture ); + ClassDB::bind_method(_MD("set_patch_margin","margin","value"), & Patch9Frame::set_patch_margin ); + ClassDB::bind_method(_MD("get_patch_margin","margin"), & Patch9Frame::get_patch_margin ); + ClassDB::bind_method(_MD("set_region_rect","rect"),&Patch9Frame::set_region_rect); + ClassDB::bind_method(_MD("get_region_rect"),&Patch9Frame::get_region_rect); + ClassDB::bind_method(_MD("set_draw_center","draw_center"), & Patch9Frame::set_draw_center ); + ClassDB::bind_method(_MD("get_draw_center"), & Patch9Frame::get_draw_center ); ADD_SIGNAL(MethodInfo("texture_changed")); ADD_PROPERTYNZ( PropertyInfo( Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), _SCS("set_texture"),_SCS("get_texture") ); - ADD_PROPERTYNO( PropertyInfo( Variant::COLOR, "modulate"), _SCS("set_modulate"),_SCS("get_modulate") ); ADD_PROPERTYNO( PropertyInfo( Variant::BOOL, "draw_center"), _SCS("set_draw_center"),_SCS("get_draw_center") ); ADD_PROPERTYNZ( PropertyInfo( Variant::RECT2, "region_rect"), _SCS("set_region_rect"),_SCS("get_region_rect")); - ADD_PROPERTYINZ( PropertyInfo( Variant::INT, "patch_margin/left",PROPERTY_HINT_RANGE,"0,16384,1"), _SCS("set_patch_margin"),_SCS("get_patch_margin"),MARGIN_LEFT ); - ADD_PROPERTYINZ( PropertyInfo( Variant::INT, "patch_margin/top",PROPERTY_HINT_RANGE,"0,16384,1"), _SCS("set_patch_margin"),_SCS("get_patch_margin"),MARGIN_TOP ); - ADD_PROPERTYINZ( PropertyInfo( Variant::INT, "patch_margin/right",PROPERTY_HINT_RANGE,"0,16384,1"), _SCS("set_patch_margin"),_SCS("get_patch_margin"),MARGIN_RIGHT ); - ADD_PROPERTYINZ( PropertyInfo( Variant::INT, "patch_margin/bottom",PROPERTY_HINT_RANGE,"0,16384,1"), _SCS("set_patch_margin"),_SCS("get_patch_margin"),MARGIN_BOTTOM ); + + ADD_GROUP("Patch Margin","patch_margin_"); + ADD_PROPERTYINZ( PropertyInfo( Variant::INT, "patch_margin_left",PROPERTY_HINT_RANGE,"0,16384,1"), _SCS("set_patch_margin"),_SCS("get_patch_margin"),MARGIN_LEFT ); + ADD_PROPERTYINZ( PropertyInfo( Variant::INT, "patch_margin_top",PROPERTY_HINT_RANGE,"0,16384,1"), _SCS("set_patch_margin"),_SCS("get_patch_margin"),MARGIN_TOP ); + ADD_PROPERTYINZ( PropertyInfo( Variant::INT, "patch_margin_right",PROPERTY_HINT_RANGE,"0,16384,1"), _SCS("set_patch_margin"),_SCS("get_patch_margin"),MARGIN_RIGHT ); + ADD_PROPERTYINZ( PropertyInfo( Variant::INT, "patch_margin_bottom",PROPERTY_HINT_RANGE,"0,16384,1"), _SCS("set_patch_margin"),_SCS("get_patch_margin"),MARGIN_BOTTOM ); } @@ -110,16 +109,6 @@ Ref<Texture> Patch9Frame::get_texture() const { return texture; } -void Patch9Frame::set_modulate(const Color& p_tex) { - - modulate=p_tex; - update(); -} - -Color Patch9Frame::get_modulate() const{ - - return modulate; -} void Patch9Frame::set_patch_margin(Margin p_margin,int p_size) { @@ -184,8 +173,8 @@ Patch9Frame::Patch9Frame() { margin[MARGIN_RIGHT]=0; margin[MARGIN_BOTTOM]=0; margin[MARGIN_TOP]=0; - modulate=Color(1,1,1,1); - set_ignore_mouse(true); + + set_mouse_filter(MOUSE_FILTER_IGNORE); draw_center=true; } diff --git a/scene/gui/patch_9_frame.h b/scene/gui/patch_9_frame.h index 7763db567a..afbeca5ae8 100644 --- a/scene/gui/patch_9_frame.h +++ b/scene/gui/patch_9_frame.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,12 +35,11 @@ */ class Patch9Frame : public Control { - OBJ_TYPE(Patch9Frame,Control); + GDCLASS(Patch9Frame,Control); bool draw_center; int margin[4]; Rect2 region_rect; - Color modulate; Ref<Texture> texture; protected: @@ -53,9 +52,6 @@ public: void set_texture(const Ref<Texture>& p_tex); Ref<Texture> get_texture() const; - void set_modulate(const Color& p_tex); - Color get_modulate() const; - void set_patch_margin(Margin p_margin,int p_size); int get_patch_margin(Margin p_margin) const; diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp index 5b83c3f8b8..5126568e5f 100644 --- a/scene/gui/popup.cpp +++ b/scene/gui/popup.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,7 +31,7 @@ -void Popup::_input_event(InputEvent p_event) { +void Popup::_gui_input(InputEvent p_event) { } @@ -257,15 +257,16 @@ bool Popup::is_exclusive() const { void Popup::_bind_methods() { - ObjectTypeDB::bind_method(_MD("popup_centered","size"),&Popup::popup_centered,DEFVAL(Size2())); - ObjectTypeDB::bind_method(_MD("popup_centered_ratio","ratio"),&Popup::popup_centered_ratio,DEFVAL(0.75)); - ObjectTypeDB::bind_method(_MD("popup_centered_minsize","minsize"),&Popup::popup_centered_minsize,DEFVAL(Size2())); - ObjectTypeDB::bind_method(_MD("popup"),&Popup::popup); - ObjectTypeDB::bind_method(_MD("set_exclusive","enable"),&Popup::set_exclusive); - ObjectTypeDB::bind_method(_MD("is_exclusive"),&Popup::is_exclusive); + ClassDB::bind_method(_MD("popup_centered","size"),&Popup::popup_centered,DEFVAL(Size2())); + ClassDB::bind_method(_MD("popup_centered_ratio","ratio"),&Popup::popup_centered_ratio,DEFVAL(0.75)); + ClassDB::bind_method(_MD("popup_centered_minsize","minsize"),&Popup::popup_centered_minsize,DEFVAL(Size2())); + ClassDB::bind_method(_MD("popup"),&Popup::popup); + ClassDB::bind_method(_MD("set_exclusive","enable"),&Popup::set_exclusive); + ClassDB::bind_method(_MD("is_exclusive"),&Popup::is_exclusive); ADD_SIGNAL( MethodInfo("about_to_show") ); ADD_SIGNAL( MethodInfo("popup_hide") ); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "popup/exclusive"), _SCS("set_exclusive"),_SCS("is_exclusive") ); + ADD_GROUP("Popup","popup_"); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "popup_exclusive"), _SCS("set_exclusive"),_SCS("is_exclusive") ); BIND_CONSTANT(NOTIFICATION_POST_POPUP); BIND_CONSTANT(NOTIFICATION_POPUP_HIDE); diff --git a/scene/gui/popup.h b/scene/gui/popup.h index dccaf2ae69..17ae4a938a 100644 --- a/scene/gui/popup.h +++ b/scene/gui/popup.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ */ class Popup : public Control { - OBJ_TYPE( Popup, Control ); + GDCLASS( Popup, Control ); bool exclusive; bool popped_up; @@ -45,7 +45,7 @@ protected: virtual void _post_popup() {} - void _input_event(InputEvent p_event); + void _gui_input(InputEvent p_event); void _notification(int p_what); void _fix_size(); static void _bind_methods(); @@ -74,7 +74,7 @@ public: class PopupPanel : public Popup { - OBJ_TYPE(PopupPanel,Popup); + GDCLASS(PopupPanel,Popup); protected: diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index 2fbb093e8e..9eaf393a21 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -89,12 +89,14 @@ Size2 PopupMenu::get_minimum_size() const { size.height=font_h; } + size.width+=items[i].h_ofs; + if (items[i].checkable) { size.width+=check_w+hseparation; } - String text = items[i].shortcut.is_valid() ? String(tr(items[i].shortcut->get_name())) : items[i].text; + String text = items[i].shortcut.is_valid() ? String(tr(items[i].shortcut->get_name())) : items[i].xl_text; size.width+=font->get_string_size(text).width; if (i>0) size.height+=vseparation; @@ -106,6 +108,7 @@ Size2 PopupMenu::get_minimum_size() const { accel_max_w = MAX( accel_w, accel_max_w ); } + minsize.height+=size.height; max_w = MAX( max_w, size.width ); @@ -212,7 +215,7 @@ void PopupMenu::_submenu_timeout() { } -void PopupMenu::_input_event(const InputEvent &p_event) { +void PopupMenu::_gui_input(const InputEvent &p_event) { switch( p_event.type) { @@ -305,7 +308,7 @@ void PopupMenu::_input_event(const InputEvent &p_event) { ie.type=InputEvent::MOUSE_MOTION; ie.mouse_motion.x=b.x; ie.mouse_motion.y=b.y+s; - _input_event(ie); + _gui_input(ie); } } break; case BUTTON_WHEEL_UP: { @@ -325,7 +328,7 @@ void PopupMenu::_input_event(const InputEvent &p_event) { ie.type=InputEvent::MOUSE_MOTION; ie.mouse_motion.x=b.x; ie.mouse_motion.y=b.y-s; - _input_event(ie); + _gui_input(ie); } @@ -418,7 +421,16 @@ void PopupMenu::_notification(int p_what) { switch(p_what) { + case NOTIFICATION_TRANSLATION_CHANGED: { + + for(int i=0;i<items.size();i++) { + items[i].xl_text=XL_MESSAGE(items[i].text); + } + minimum_size_changed(); + update(); + + } break; case NOTIFICATION_DRAW: { RID ci = get_canvas_item(); @@ -450,6 +462,7 @@ void PopupMenu::_notification(int p_what) { float h; Size2 icon_size; + item_ofs.x+=items[i].h_ofs; if (!items[i].icon.is_null()) { icon_size = items[i].icon->get_size(); @@ -461,13 +474,13 @@ void PopupMenu::_notification(int p_what) { if (i==mouse_over) { - hover->draw(ci, Rect2( ofs+Point2(-hseparation,-vseparation), Size2( get_size().width - style->get_minimum_size().width + hseparation*2, h+vseparation*2 ) )); + hover->draw(ci, Rect2( item_ofs+Point2(-hseparation,-vseparation), Size2( get_size().width - style->get_minimum_size().width + hseparation*2, h+vseparation*2 ) )); } if (items[i].separator) { int sep_h=separator->get_center_size().height+separator->get_minimum_size().height; - separator->draw(ci, Rect2( ofs+Point2(0,Math::floor((h-sep_h)/2.0)), Size2( get_size().width - style->get_minimum_size().width , sep_h ) )); + separator->draw(ci, Rect2( item_ofs+Point2(0,Math::floor((h-sep_h)/2.0)), Size2( get_size().width - style->get_minimum_size().width , sep_h ) )); } @@ -492,7 +505,7 @@ void PopupMenu::_notification(int p_what) { } item_ofs.y+=font->get_ascent(); - String text = items[i].shortcut.is_valid() ? String(tr(items[i].shortcut->get_name())) : items[i].text; + String text = items[i].shortcut.is_valid() ? String(tr(items[i].shortcut->get_name())) : items[i].xl_text; if (!items[i].separator) { font->draw(ci,item_ofs+Point2(0,Math::floor((h-font_h)/2.0)),text,items[i].disabled?font_color_disabled:(i==mouse_over?font_color_hover:font_color)); @@ -533,6 +546,7 @@ void PopupMenu::add_icon_item(const Ref<Texture>& p_icon,const String& p_label,i Item item; item.icon=p_icon; item.text=p_label; + item.xl_text=XL_MESSAGE(p_label); item.accel=p_accel; item.ID=p_ID; items.push_back(item); @@ -541,7 +555,8 @@ void PopupMenu::add_icon_item(const Ref<Texture>& p_icon,const String& p_label,i void PopupMenu::add_item(const String& p_label,int p_ID,uint32_t p_accel) { Item item; - item.text=XL_MESSAGE(p_label); + item.text=p_label; + item.xl_text=XL_MESSAGE(p_label); item.accel=p_accel; item.ID=p_ID; items.push_back(item); @@ -551,7 +566,8 @@ void PopupMenu::add_item(const String& p_label,int p_ID,uint32_t p_accel) { void PopupMenu::add_submenu_item(const String& p_label, const String& p_submenu,int p_ID){ Item item; - item.text=XL_MESSAGE(p_label); + item.text=p_label; + item.xl_text=XL_MESSAGE(p_label); item.ID=p_ID; item.submenu=p_submenu; items.push_back(item); @@ -562,7 +578,8 @@ void PopupMenu::add_icon_check_item(const Ref<Texture>& p_icon,const String& p_l Item item; item.icon=p_icon; - item.text=XL_MESSAGE(p_label); + item.text=p_label; + item.xl_text=XL_MESSAGE(p_label); item.accel=p_accel; item.ID=p_ID; item.checkable=true; @@ -572,7 +589,8 @@ void PopupMenu::add_icon_check_item(const Ref<Texture>& p_icon,const String& p_l void PopupMenu::add_check_item(const String& p_label,int p_ID,uint32_t p_accel) { Item item; - item.text=XL_MESSAGE(p_label); + item.text=p_label; + item.xl_text=XL_MESSAGE(p_label); item.accel=p_accel; item.ID=p_ID; item.checkable=true; @@ -581,7 +599,7 @@ void PopupMenu::add_check_item(const String& p_label,int p_ID,uint32_t p_accel) } -void PopupMenu::add_icon_shortcut(const Ref<Texture>& p_icon,const Ref<ShortCut>& p_shortcut,int p_ID) { +void PopupMenu::add_icon_shortcut(const Ref<Texture>& p_icon, const Ref<ShortCut>& p_shortcut, int p_ID, bool p_global) { ERR_FAIL_COND(p_shortcut.is_null()); @@ -591,12 +609,13 @@ void PopupMenu::add_icon_shortcut(const Ref<Texture>& p_icon,const Ref<ShortCut> item.ID=p_ID; item.icon=p_icon; item.shortcut=p_shortcut; + item.shortcut_is_global=p_global; items.push_back(item); update(); } -void PopupMenu::add_shortcut(const Ref<ShortCut>& p_shortcut,int p_ID){ +void PopupMenu::add_shortcut(const Ref<ShortCut>& p_shortcut, int p_ID, bool p_global){ ERR_FAIL_COND(p_shortcut.is_null()); @@ -605,11 +624,12 @@ void PopupMenu::add_shortcut(const Ref<ShortCut>& p_shortcut,int p_ID){ Item item; item.ID=p_ID; item.shortcut=p_shortcut; + item.shortcut_is_global=p_global; items.push_back(item); update(); } -void PopupMenu::add_icon_check_shortcut(const Ref<Texture>& p_icon,const Ref<ShortCut>& p_shortcut,int p_ID){ +void PopupMenu::add_icon_check_shortcut(const Ref<Texture>& p_icon, const Ref<ShortCut>& p_shortcut, int p_ID, bool p_global){ ERR_FAIL_COND(p_shortcut.is_null()); @@ -620,11 +640,12 @@ void PopupMenu::add_icon_check_shortcut(const Ref<Texture>& p_icon,const Ref<Sho item.shortcut=p_shortcut; item.checkable=true; item.icon=p_icon; + item.shortcut_is_global=p_global; items.push_back(item); update(); } -void PopupMenu::add_check_shortcut(const Ref<ShortCut>& p_shortcut,int p_ID){ +void PopupMenu::add_check_shortcut(const Ref<ShortCut>& p_shortcut, int p_ID, bool p_global){ ERR_FAIL_COND(p_shortcut.is_null()); @@ -633,6 +654,7 @@ void PopupMenu::add_check_shortcut(const Ref<ShortCut>& p_shortcut,int p_ID){ Item item; item.ID=p_ID; item.shortcut=p_shortcut; + item.shortcut_is_global=p_global; item.checkable=true; items.push_back(item); update(); @@ -641,7 +663,8 @@ void PopupMenu::add_check_shortcut(const Ref<ShortCut>& p_shortcut,int p_ID){ void PopupMenu::set_item_text(int p_idx,const String& p_text) { ERR_FAIL_INDEX(p_idx,items.size()); - items[p_idx].text=XL_MESSAGE(p_text); + items[p_idx].text=p_text; + items[p_idx].xl_text=XL_MESSAGE(p_text); update(); @@ -811,12 +834,14 @@ void PopupMenu::set_item_tooltip(int p_idx,const String& p_tooltip) { update(); } -void PopupMenu::set_item_shortcut(int p_idx, const Ref<ShortCut>& p_shortcut) { +void PopupMenu::set_item_shortcut(int p_idx, const Ref<ShortCut>& p_shortcut, bool p_global) { ERR_FAIL_INDEX(p_idx,items.size()); if (items[p_idx].shortcut.is_valid()) { _unref_shortcut(items[p_idx].shortcut); } items[p_idx].shortcut=p_shortcut; + items[p_idx].shortcut_is_global=p_global; + if (items[p_idx].shortcut.is_valid()) { _ref_shortcut(items[p_idx].shortcut); @@ -826,6 +851,15 @@ void PopupMenu::set_item_shortcut(int p_idx, const Ref<ShortCut>& p_shortcut) { update(); } +void PopupMenu::set_item_h_offset(int p_idx, int p_offset) { + + ERR_FAIL_INDEX(p_idx,items.size()); + items[p_idx].h_ofs=p_offset; + update(); + +} + + bool PopupMenu::is_item_checkable(int p_idx) const { ERR_FAIL_INDEX_V(p_idx,items.size(),false); return items[p_idx].checkable; @@ -836,7 +870,7 @@ int PopupMenu::get_item_count() const { return items.size(); } -bool PopupMenu::activate_item_by_event(const InputEvent& p_event) { +bool PopupMenu::activate_item_by_event(const InputEvent& p_event, bool p_for_global_only) { uint32_t code=0; if (p_event.type==InputEvent::KEY) { @@ -860,7 +894,7 @@ bool PopupMenu::activate_item_by_event(const InputEvent& p_event) { continue; - if (items[i].shortcut.is_valid() && items[i].shortcut->is_shortcut(p_event)) { + if (items[i].shortcut.is_valid() && items[i].shortcut->is_shortcut(p_event) && (items[i].shortcut_is_global || !p_for_global_only)) { activate_item(i); return true; } @@ -879,7 +913,7 @@ bool PopupMenu::activate_item_by_event(const InputEvent& p_event) { if(!pm) continue; - if(pm->activate_item_by_event(p_event)) { + if(pm->activate_item_by_event(p_event,p_for_global_only)) { return true; } } @@ -893,17 +927,31 @@ void PopupMenu::activate_item(int p_item) { ERR_FAIL_INDEX(p_item,items.size()); ERR_FAIL_COND(items[p_item].separator); int id = items[p_item].ID>=0?items[p_item].ID:p_item; - emit_signal("item_pressed",id); + emit_signal("id_pressed",id); + emit_signal("index_pressed",p_item); //hide all parent PopupMenue's Node *next = get_parent(); PopupMenu *pop = next->cast_to<PopupMenu>(); while (pop) { - pop->hide(); - next = next->get_parent(); - pop = next->cast_to<PopupMenu>(); + // We close all parents that are chained together, + // with hide_on_item_selection enabled + if(hide_on_item_selection && pop->is_hide_on_item_selection()) { + pop->hide(); + next = next->get_parent(); + pop = next->cast_to<PopupMenu>(); + } + else { + // Break out of loop when the next parent has + // hide_on_item_selection disabled + break; + } + } + // Hides popup by default; unless otherwise specified + // by using set_hide_on_item_selection + if (hide_on_item_selection) { + hide(); } - hide(); } @@ -1019,6 +1067,16 @@ void PopupMenu::_set_items(const Array& p_items){ } +// Hide on item selection determines whether or not the popup will close after item selection +void PopupMenu::set_hide_on_item_selection(bool p_enabled) { + + hide_on_item_selection=p_enabled; +} + +bool PopupMenu::is_hide_on_item_selection() { + + return hide_on_item_selection; +} String PopupMenu::get_tooltip(const Point2& p_pos) const { @@ -1039,8 +1097,8 @@ void PopupMenu::get_translatable_strings(List<String> *p_strings) const { for(int i=0;i<items.size();i++) { - if (items[i].text!="") - p_strings->push_back(items[i].text); + if (items[i].xl_text!="") + p_strings->push_back(items[i].xl_text); } } @@ -1056,62 +1114,67 @@ void PopupMenu::clear_autohide_areas(){ void PopupMenu::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_input_event"),&PopupMenu::_input_event); - ObjectTypeDB::bind_method(_MD("add_icon_item","texture","label","id","accel"),&PopupMenu::add_icon_item,DEFVAL(-1),DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("add_item","label","id","accel"),&PopupMenu::add_item,DEFVAL(-1),DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("add_icon_check_item","texture","label","id","accel"),&PopupMenu::add_icon_check_item,DEFVAL(-1),DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("add_check_item","label","id","accel"),&PopupMenu::add_check_item,DEFVAL(-1),DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("add_submenu_item","label","submenu","id"),&PopupMenu::add_submenu_item,DEFVAL(-1)); - - ObjectTypeDB::bind_method(_MD("add_icon_shortcut","texture","shortcut:ShortCut","id"),&PopupMenu::add_icon_shortcut,DEFVAL(-1)); - ObjectTypeDB::bind_method(_MD("add_shortcut","shortcut:ShortCut","id"),&PopupMenu::add_shortcut,DEFVAL(-1)); - ObjectTypeDB::bind_method(_MD("add_icon_check_shortcut","texture","shortcut:ShortCut","id"),&PopupMenu::add_icon_check_shortcut,DEFVAL(-1)); - ObjectTypeDB::bind_method(_MD("add_check_shortcut","shortcut:ShortCut","id"),&PopupMenu::add_check_shortcut,DEFVAL(-1)); - - ObjectTypeDB::bind_method(_MD("set_item_text","idx","text"),&PopupMenu::set_item_text); - ObjectTypeDB::bind_method(_MD("set_item_icon","idx","icon"),&PopupMenu::set_item_icon); - ObjectTypeDB::bind_method(_MD("set_item_checked","idx","checked"),&PopupMenu::set_item_checked); - ObjectTypeDB::bind_method(_MD("set_item_ID","idx","id"),&PopupMenu::set_item_ID); - ObjectTypeDB::bind_method(_MD("set_item_accelerator","idx","accel"),&PopupMenu::set_item_accelerator); - ObjectTypeDB::bind_method(_MD("set_item_metadata","idx","metadata"),&PopupMenu::set_item_metadata); - ObjectTypeDB::bind_method(_MD("set_item_disabled","idx","disabled"),&PopupMenu::set_item_disabled); - ObjectTypeDB::bind_method(_MD("set_item_submenu","idx","submenu"),&PopupMenu::set_item_submenu); - ObjectTypeDB::bind_method(_MD("set_item_as_separator","idx","enable"),&PopupMenu::set_item_as_separator); - ObjectTypeDB::bind_method(_MD("set_item_as_checkable","idx","enable"),&PopupMenu::set_item_as_checkable); - ObjectTypeDB::bind_method(_MD("set_item_tooltip","idx","tooltip"),&PopupMenu::set_item_tooltip); - ObjectTypeDB::bind_method(_MD("set_item_shortcut","idx","shortcut:ShortCut"),&PopupMenu::set_item_shortcut); - - ObjectTypeDB::bind_method(_MD("toggle_item_checked","idx"), &PopupMenu::toggle_item_checked); - - ObjectTypeDB::bind_method(_MD("get_item_text","idx"),&PopupMenu::get_item_text); - ObjectTypeDB::bind_method(_MD("get_item_icon","idx"),&PopupMenu::get_item_icon); - ObjectTypeDB::bind_method(_MD("is_item_checked","idx"),&PopupMenu::is_item_checked); - ObjectTypeDB::bind_method(_MD("get_item_ID","idx"),&PopupMenu::get_item_ID); - ObjectTypeDB::bind_method(_MD("get_item_index","id"),&PopupMenu::get_item_index); - ObjectTypeDB::bind_method(_MD("get_item_accelerator","idx"),&PopupMenu::get_item_accelerator); - ObjectTypeDB::bind_method(_MD("get_item_metadata","idx"),&PopupMenu::get_item_metadata); - ObjectTypeDB::bind_method(_MD("is_item_disabled","idx"),&PopupMenu::is_item_disabled); - ObjectTypeDB::bind_method(_MD("get_item_submenu","idx"),&PopupMenu::get_item_submenu); - ObjectTypeDB::bind_method(_MD("is_item_separator","idx"),&PopupMenu::is_item_separator); - ObjectTypeDB::bind_method(_MD("is_item_checkable","idx"),&PopupMenu::is_item_checkable); - ObjectTypeDB::bind_method(_MD("get_item_tooltip","idx"),&PopupMenu::get_item_tooltip); - ObjectTypeDB::bind_method(_MD("get_item_shortcut:ShortCut","idx"),&PopupMenu::get_item_shortcut); - - ObjectTypeDB::bind_method(_MD("get_item_count"),&PopupMenu::get_item_count); - - ObjectTypeDB::bind_method(_MD("remove_item","idx"),&PopupMenu::remove_item); - - ObjectTypeDB::bind_method(_MD("add_separator"),&PopupMenu::add_separator); - ObjectTypeDB::bind_method(_MD("clear"),&PopupMenu::clear); - - ObjectTypeDB::bind_method(_MD("_set_items"),&PopupMenu::_set_items); - ObjectTypeDB::bind_method(_MD("_get_items"),&PopupMenu::_get_items); - - ObjectTypeDB::bind_method(_MD("_submenu_timeout"),&PopupMenu::_submenu_timeout); + ClassDB::bind_method(_MD("_gui_input"),&PopupMenu::_gui_input); + ClassDB::bind_method(_MD("add_icon_item","texture","label","id","accel"),&PopupMenu::add_icon_item,DEFVAL(-1),DEFVAL(0)); + ClassDB::bind_method(_MD("add_item","label","id","accel"),&PopupMenu::add_item,DEFVAL(-1),DEFVAL(0)); + ClassDB::bind_method(_MD("add_icon_check_item","texture","label","id","accel"),&PopupMenu::add_icon_check_item,DEFVAL(-1),DEFVAL(0)); + ClassDB::bind_method(_MD("add_check_item","label","id","accel"),&PopupMenu::add_check_item,DEFVAL(-1),DEFVAL(0)); + ClassDB::bind_method(_MD("add_submenu_item","label","submenu","id"),&PopupMenu::add_submenu_item,DEFVAL(-1)); + + ClassDB::bind_method(_MD("add_icon_shortcut","texture","shortcut:ShortCut","id","global"),&PopupMenu::add_icon_shortcut,DEFVAL(-1),DEFVAL(false)); + ClassDB::bind_method(_MD("add_shortcut","shortcut:ShortCut","id","global"),&PopupMenu::add_shortcut,DEFVAL(-1),DEFVAL(false)); + ClassDB::bind_method(_MD("add_icon_check_shortcut","texture","shortcut:ShortCut","id","global"),&PopupMenu::add_icon_check_shortcut,DEFVAL(-1),DEFVAL(false)); + ClassDB::bind_method(_MD("add_check_shortcut","shortcut:ShortCut","id","global"),&PopupMenu::add_check_shortcut,DEFVAL(-1),DEFVAL(false)); + + ClassDB::bind_method(_MD("set_item_text","idx","text"),&PopupMenu::set_item_text); + ClassDB::bind_method(_MD("set_item_icon","idx","icon"),&PopupMenu::set_item_icon); + ClassDB::bind_method(_MD("set_item_checked","idx","checked"),&PopupMenu::set_item_checked); + ClassDB::bind_method(_MD("set_item_ID","idx","id"),&PopupMenu::set_item_ID); + ClassDB::bind_method(_MD("set_item_accelerator","idx","accel"),&PopupMenu::set_item_accelerator); + ClassDB::bind_method(_MD("set_item_metadata","idx","metadata"),&PopupMenu::set_item_metadata); + ClassDB::bind_method(_MD("set_item_disabled","idx","disabled"),&PopupMenu::set_item_disabled); + ClassDB::bind_method(_MD("set_item_submenu","idx","submenu"),&PopupMenu::set_item_submenu); + ClassDB::bind_method(_MD("set_item_as_separator","idx","enable"),&PopupMenu::set_item_as_separator); + ClassDB::bind_method(_MD("set_item_as_checkable","idx","enable"),&PopupMenu::set_item_as_checkable); + ClassDB::bind_method(_MD("set_item_tooltip","idx","tooltip"),&PopupMenu::set_item_tooltip); + ClassDB::bind_method(_MD("set_item_shortcut","idx","shortcut:ShortCut","global"),&PopupMenu::set_item_shortcut,DEFVAL(false)); + + ClassDB::bind_method(_MD("toggle_item_checked","idx"), &PopupMenu::toggle_item_checked); + + ClassDB::bind_method(_MD("get_item_text","idx"),&PopupMenu::get_item_text); + ClassDB::bind_method(_MD("get_item_icon","idx"),&PopupMenu::get_item_icon); + ClassDB::bind_method(_MD("is_item_checked","idx"),&PopupMenu::is_item_checked); + ClassDB::bind_method(_MD("get_item_ID","idx"),&PopupMenu::get_item_ID); + ClassDB::bind_method(_MD("get_item_index","id"),&PopupMenu::get_item_index); + ClassDB::bind_method(_MD("get_item_accelerator","idx"),&PopupMenu::get_item_accelerator); + ClassDB::bind_method(_MD("get_item_metadata","idx"),&PopupMenu::get_item_metadata); + ClassDB::bind_method(_MD("is_item_disabled","idx"),&PopupMenu::is_item_disabled); + ClassDB::bind_method(_MD("get_item_submenu","idx"),&PopupMenu::get_item_submenu); + ClassDB::bind_method(_MD("is_item_separator","idx"),&PopupMenu::is_item_separator); + ClassDB::bind_method(_MD("is_item_checkable","idx"),&PopupMenu::is_item_checkable); + ClassDB::bind_method(_MD("get_item_tooltip","idx"),&PopupMenu::get_item_tooltip); + ClassDB::bind_method(_MD("get_item_shortcut:ShortCut","idx"),&PopupMenu::get_item_shortcut); + + ClassDB::bind_method(_MD("get_item_count"),&PopupMenu::get_item_count); + + ClassDB::bind_method(_MD("remove_item","idx"),&PopupMenu::remove_item); + + ClassDB::bind_method(_MD("add_separator"),&PopupMenu::add_separator); + ClassDB::bind_method(_MD("clear"),&PopupMenu::clear); + + ClassDB::bind_method(_MD("_set_items"),&PopupMenu::_set_items); + ClassDB::bind_method(_MD("_get_items"),&PopupMenu::_get_items); + + ClassDB::bind_method(_MD("set_hide_on_item_selection","enable"),&PopupMenu::set_hide_on_item_selection); + ClassDB::bind_method(_MD("is_hide_on_item_selection"),&PopupMenu::is_hide_on_item_selection); + + ClassDB::bind_method(_MD("_submenu_timeout"),&PopupMenu::_submenu_timeout); ADD_PROPERTY( PropertyInfo(Variant::ARRAY,"items",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_items"),_SCS("_get_items") ); + ADD_PROPERTYNO( PropertyInfo(Variant::BOOL, "hide_on_item_selection" ), _SCS("set_hide_on_item_selection"), _SCS("is_hide_on_item_selection") ); - ADD_SIGNAL( MethodInfo("item_pressed", PropertyInfo( Variant::INT,"ID") ) ); + ADD_SIGNAL( MethodInfo("id_pressed", PropertyInfo( Variant::INT,"ID") ) ); + ADD_SIGNAL( MethodInfo("index_pressed", PropertyInfo( Variant::INT,"index") ) ); } @@ -1128,6 +1191,7 @@ PopupMenu::PopupMenu() { set_focus_mode(FOCUS_ALL); set_as_toplevel(true); + set_hide_on_item_selection(true); submenu_timer = memnew( Timer ); submenu_timer->set_wait_time(0.3); diff --git a/scene/gui/popup_menu.h b/scene/gui/popup_menu.h index b3e8cd2713..b5fca9a451 100644 --- a/scene/gui/popup_menu.h +++ b/scene/gui/popup_menu.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,11 +39,12 @@ class PopupMenu : public Popup { - OBJ_TYPE(PopupMenu, Popup ); + GDCLASS(PopupMenu, Popup ); struct Item { Ref<Texture> icon; String text; + String xl_text; bool checked; bool checkable; bool separator; @@ -54,9 +55,11 @@ class PopupMenu : public Popup { String tooltip; uint32_t accel; int _ofs_cache; + int h_ofs; Ref<ShortCut> shortcut; + bool shortcut_is_global; - Item() { checked=false; checkable=false; separator=false; accel=0; disabled=false; _ofs_cache=0; } + Item() { checked=false; checkable=false; separator=false; accel=0; disabled=false; _ofs_cache=0; h_ofs=0; shortcut_is_global=false; } }; @@ -69,11 +72,12 @@ class PopupMenu : public Popup { String _get_accel_text(int p_item) const; int _get_mouse_over(const Point2& p_over) const; virtual Size2 get_minimum_size() const; - void _input_event(const InputEvent &p_event); + void _gui_input(const InputEvent &p_event); void _activate_submenu(int over); void _submenu_timeout(); bool invalidated_click; + bool hide_on_item_selection; Vector2 moved; Array _get_items() const; @@ -98,10 +102,10 @@ public: void add_check_item(const String& p_label,int p_ID=-1,uint32_t p_accel=0); void add_submenu_item(const String& p_label,const String& p_submenu, int p_ID=-1); - void add_icon_shortcut(const Ref<Texture>& p_icon,const Ref<ShortCut>& p_shortcut,int p_ID=-1); - void add_shortcut(const Ref<ShortCut>& p_shortcut,int p_ID=-1); - void add_icon_check_shortcut(const Ref<Texture>& p_icon,const Ref<ShortCut>& p_shortcut,int p_ID=-1); - void add_check_shortcut(const Ref<ShortCut>& p_shortcut,int p_ID=-1); + void add_icon_shortcut(const Ref<Texture>& p_icon,const Ref<ShortCut>& p_shortcut,int p_ID=-1,bool p_global=false); + void add_shortcut(const Ref<ShortCut>& p_shortcut,int p_ID=-1,bool p_global=false); + void add_icon_check_shortcut(const Ref<Texture>& p_icon,const Ref<ShortCut>& p_shortcut,int p_ID=-1,bool p_global=false); + void add_check_shortcut(const Ref<ShortCut>& p_shortcut,int p_ID=-1,bool p_global=false); void set_item_text(int p_idx,const String& p_text); void set_item_icon(int p_idx,const Ref<Texture>& p_icon); @@ -114,7 +118,8 @@ public: void set_item_as_separator(int p_idx, bool p_separator); void set_item_as_checkable(int p_idx, bool p_checkable); void set_item_tooltip(int p_idx,const String& p_tooltip); - void set_item_shortcut(int p_idx, const Ref<ShortCut>& p_shortcut); + void set_item_shortcut(int p_idx, const Ref<ShortCut>& p_shortcut,bool p_global=false); + void set_item_h_offset(int p_idx, int p_offset); void toggle_item_checked(int p_idx); @@ -134,7 +139,7 @@ public: int get_item_count() const; - bool activate_item_by_event(const InputEvent& p_event); + bool activate_item_by_event(const InputEvent& p_event,bool p_for_global_only=false); void activate_item(int p_item); void remove_item(int p_idx); @@ -153,6 +158,8 @@ public: void clear_autohide_areas(); void set_invalidate_click_until_motion(); + void set_hide_on_item_selection(bool p_enabled); + bool is_hide_on_item_selection(); PopupMenu(); ~PopupMenu(); diff --git a/scene/gui/progress_bar.cpp b/scene/gui/progress_bar.cpp index 8af94c3638..ee9369fb3a 100644 --- a/scene/gui/progress_bar.cpp +++ b/scene/gui/progress_bar.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -82,9 +82,10 @@ bool ProgressBar::is_percent_visible() const{ void ProgressBar::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_percent_visible","visible"),&ProgressBar::set_percent_visible); - ObjectTypeDB::bind_method(_MD("is_percent_visible"),&ProgressBar::is_percent_visible); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"percent/visible"),_SCS("set_percent_visible"),_SCS("is_percent_visible")); + ClassDB::bind_method(_MD("set_percent_visible","visible"),&ProgressBar::set_percent_visible); + ClassDB::bind_method(_MD("is_percent_visible"),&ProgressBar::is_percent_visible); + ADD_GROUP("Percent","percent_"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"percent_visible"),_SCS("set_percent_visible"),_SCS("is_percent_visible")); } ProgressBar::ProgressBar() { diff --git a/scene/gui/progress_bar.h b/scene/gui/progress_bar.h index f50df346ac..01306a2ac4 100644 --- a/scene/gui/progress_bar.h +++ b/scene/gui/progress_bar.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class ProgressBar : public Range { - OBJ_TYPE( ProgressBar, Range ); + GDCLASS( ProgressBar, Range ); bool percent_visible; protected: diff --git a/scene/gui/range.cpp b/scene/gui/range.cpp index e056c55f71..2f37ed0341 100644 --- a/scene/gui/range.cpp +++ b/scene/gui/range.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -66,7 +66,7 @@ void Range::Shared::emit_changed(const char *p_what) { } -void Range::set_val(double p_val) { +void Range::set_value(double p_val) { if(_rounded_values){ p_val = Math::round(p_val); @@ -88,14 +88,14 @@ void Range::set_val(double p_val) { void Range::set_min(double p_min) { shared->min=p_min; - set_val(shared->val); + set_value(shared->val); shared->emit_changed("range/min"); } void Range::set_max(double p_max) { shared->max=p_max; - set_val(shared->val); + set_value(shared->val); shared->emit_changed("range/max"); @@ -109,12 +109,12 @@ void Range::set_step(double p_step) { void Range::set_page(double p_page) { shared->page=p_page; - set_val(shared->val); + set_value(shared->val); shared->emit_changed("range/page"); } -double Range::get_val() const { +double Range::get_value() const { return shared->val; } @@ -136,16 +136,25 @@ double Range::get_page() const { } void Range::set_unit_value(double p_value) { + + double v; + if (shared->exp_unit_value && get_min()>0) { double exp_min = Math::log(get_min())/Math::log(2); double exp_max = Math::log(get_max())/Math::log(2); - double v = Math::pow(2,exp_min+(exp_max-exp_min)*p_value); - - set_val( v ); + v = Math::pow(2,exp_min+(exp_max-exp_min)*p_value); } else { - set_val( (get_max() - get_min()) * p_value + get_min() ); + + double percent = (get_max() - get_min()) * p_value; + if (get_step() > 0) { + double steps = round(percent / get_step()); + v = steps * get_step() + get_min(); + } else { + v = percent + get_min(); + } } + set_value( v ); } double Range::get_unit_value() const { @@ -153,13 +162,13 @@ double Range::get_unit_value() const { double exp_min = Math::log(get_min())/Math::log(2); double exp_max = Math::log(get_max())/Math::log(2); - double v = Math::log(get_val())/Math::log(2); + double v = Math::log(get_value())/Math::log(2); return (v - exp_min) / (exp_max - exp_min); } else { - return (get_val() - get_min()) / (get_max() - get_min()); + return (get_value() - get_min()) / (get_max() - get_min()); } } @@ -213,38 +222,36 @@ void Range::_unref_shared() { void Range::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_val"),&Range::get_val); - ObjectTypeDB::bind_method(_MD("get_value"),&Range::get_val); - ObjectTypeDB::bind_method(_MD("get_min"),&Range::get_min); - ObjectTypeDB::bind_method(_MD("get_max"),&Range::get_max); - ObjectTypeDB::bind_method(_MD("get_step"),&Range::get_step); - ObjectTypeDB::bind_method(_MD("get_page"),&Range::get_page); - ObjectTypeDB::bind_method(_MD("get_unit_value"),&Range::get_unit_value); - ObjectTypeDB::bind_method(_MD("set_val","value"),&Range::set_val); - ObjectTypeDB::bind_method(_MD("set_value","value"),&Range::set_val); - ObjectTypeDB::bind_method(_MD("set_min","minimum"),&Range::set_min); - ObjectTypeDB::bind_method(_MD("set_max","maximum"),&Range::set_max); - ObjectTypeDB::bind_method(_MD("set_step","step"),&Range::set_step); - ObjectTypeDB::bind_method(_MD("set_page","pagesize"),&Range::set_page); - ObjectTypeDB::bind_method(_MD("set_unit_value","value"),&Range::set_unit_value); - ObjectTypeDB::bind_method(_MD("set_rounded_values","enabled"),&Range::set_rounded_values); - ObjectTypeDB::bind_method(_MD("is_rounded_values"),&Range::is_rounded_values); - ObjectTypeDB::bind_method(_MD("set_exp_unit_value","enabled"),&Range::set_exp_unit_value); - ObjectTypeDB::bind_method(_MD("is_unit_value_exp"),&Range::is_unit_value_exp); - - ObjectTypeDB::bind_method(_MD("share","with"),&Range::_share); - ObjectTypeDB::bind_method(_MD("unshare"),&Range::unshare); + ClassDB::bind_method(_MD("get_value"),&Range::get_value); + ClassDB::bind_method(_MD("get_min"),&Range::get_min); + ClassDB::bind_method(_MD("get_max"),&Range::get_max); + ClassDB::bind_method(_MD("get_step"),&Range::get_step); + ClassDB::bind_method(_MD("get_page"),&Range::get_page); + ClassDB::bind_method(_MD("get_unit_value"),&Range::get_unit_value); + ClassDB::bind_method(_MD("set_value","value"),&Range::set_value); + ClassDB::bind_method(_MD("set_min","minimum"),&Range::set_min); + ClassDB::bind_method(_MD("set_max","maximum"),&Range::set_max); + ClassDB::bind_method(_MD("set_step","step"),&Range::set_step); + ClassDB::bind_method(_MD("set_page","pagesize"),&Range::set_page); + ClassDB::bind_method(_MD("set_unit_value","value"),&Range::set_unit_value); + ClassDB::bind_method(_MD("set_rounded_values","enabled"),&Range::set_rounded_values); + ClassDB::bind_method(_MD("is_rounded_values"),&Range::is_rounded_values); + ClassDB::bind_method(_MD("set_exp_unit_value","enabled"),&Range::set_exp_unit_value); + ClassDB::bind_method(_MD("is_unit_value_exp"),&Range::is_unit_value_exp); + + ClassDB::bind_method(_MD("share","with"),&Range::_share); + ClassDB::bind_method(_MD("unshare"),&Range::unshare); ADD_SIGNAL( MethodInfo("value_changed", PropertyInfo(Variant::REAL,"value"))); ADD_SIGNAL( MethodInfo("changed")); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "range/min" ), _SCS("set_min"), _SCS("get_min") ); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "range/max" ), _SCS("set_max"), _SCS("get_max") ); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "range/step" ), _SCS("set_step"), _SCS("get_step") ); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "range/page" ), _SCS("set_page"), _SCS("get_page") ); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "range/value" ), _SCS("set_val"), _SCS("get_val") ); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "range/exp_edit" ), _SCS("set_exp_unit_value"), _SCS("is_unit_value_exp") ); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "range/rounded" ), _SCS("set_rounded_values"), _SCS("is_rounded_values") ); + ADD_PROPERTY( PropertyInfo( Variant::REAL, "min_value" ), _SCS("set_min"), _SCS("get_min") ); + ADD_PROPERTY( PropertyInfo( Variant::REAL, "max_value" ), _SCS("set_max"), _SCS("get_max") ); + ADD_PROPERTY( PropertyInfo( Variant::REAL, "step" ), _SCS("set_step"), _SCS("get_step") ); + ADD_PROPERTY( PropertyInfo( Variant::REAL, "page" ), _SCS("set_page"), _SCS("get_page") ); + ADD_PROPERTY( PropertyInfo( Variant::REAL, "value" ), _SCS("set_value"), _SCS("get_value") ); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "exp_edit" ), _SCS("set_exp_unit_value"), _SCS("is_unit_value_exp") ); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "rounded" ), _SCS("set_rounded_values"), _SCS("is_rounded_values") ); } diff --git a/scene/gui/range.h b/scene/gui/range.h index 85c3687b7d..0872254fff 100644 --- a/scene/gui/range.h +++ b/scene/gui/range.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ */ class Range : public Control { - OBJ_TYPE( Range, Control ); + GDCLASS( Range, Control ); struct Shared { @@ -66,14 +66,14 @@ protected: bool _rounded_values; public: - void set_val(double p_val); + void set_value(double p_val); void set_min(double p_min); void set_max(double p_max); void set_step(double p_step); void set_page(double p_page); void set_unit_value(double p_value); - double get_val() const; + double get_value() const; double get_min() const; double get_max() const; double get_step() const; diff --git a/scene/gui/reference_frame.cpp b/scene/gui/reference_frame.cpp index d037664a62..37bc3ae6fb 100644 --- a/scene/gui/reference_frame.cpp +++ b/scene/gui/reference_frame.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/reference_frame.h b/scene/gui/reference_frame.h index 5d3694e6e8..8b4a16cb43 100644 --- a/scene/gui/reference_frame.h +++ b/scene/gui/reference_frame.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class ReferenceFrame : public Control { - OBJ_TYPE( ReferenceFrame, Control); + GDCLASS( ReferenceFrame, Control); protected: diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 73a3cda5f3..790b7500ea 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -610,7 +610,7 @@ void RichTextLabel::_scroll_changed(double) { if (updating_scroll) return; - if (scroll_follow && vscroll->get_val()>=(vscroll->get_max()-vscroll->get_page())) + if (scroll_follow && vscroll->get_value()>=(vscroll->get_max()-vscroll->get_page())) scroll_following=true; else scroll_following=false; @@ -687,15 +687,13 @@ void RichTextLabel::_notification(int p_what) { RID ci=get_canvas_item(); Size2 size = get_size(); - VisualServer::get_singleton()->canvas_item_set_clip(ci,true); - if (has_focus()) { VisualServer::get_singleton()->canvas_item_add_clip_ignore(ci,true); draw_style_box(get_stylebox("focus"),Rect2(Point2(),size)); VisualServer::get_singleton()->canvas_item_add_clip_ignore(ci,false); } - int ofs = vscroll->get_val(); + int ofs = vscroll->get_value(); //todo, change to binary search @@ -734,7 +732,7 @@ void RichTextLabel::_find_click(ItemFrame* p_frame,const Point2i& p_click,Item * Size2 size = get_size(); - int ofs = vscroll->get_val(); + int ofs = vscroll->get_value(); //todo, change to binary search int from_line = 0; @@ -789,7 +787,7 @@ Control::CursorShape RichTextLabel::get_cursor_shape(const Point2& p_pos) const } -void RichTextLabel::_input_event(InputEvent p_event) { +void RichTextLabel::_gui_input(InputEvent p_event) { switch(p_event.type) { @@ -838,12 +836,12 @@ void RichTextLabel::_input_event(InputEvent p_event) { if (b.button_index==BUTTON_WHEEL_UP) { if (scroll_active) - vscroll->set_val( vscroll->get_val()-vscroll->get_page()/8 ); + vscroll->set_value( vscroll->get_value()-vscroll->get_page()/8 ); } if (b.button_index==BUTTON_WHEEL_DOWN) { if (scroll_active) - vscroll->set_val( vscroll->get_val()+vscroll->get_page()/8 ); + vscroll->set_value( vscroll->get_value()+vscroll->get_page()/8 ); } } break; case InputEvent::KEY: { @@ -855,32 +853,32 @@ void RichTextLabel::_input_event(InputEvent p_event) { case KEY_PAGEUP: { if (vscroll->is_visible()) - vscroll->set_val( vscroll->get_val() - vscroll->get_page() ); + vscroll->set_value( vscroll->get_value() - vscroll->get_page() ); } break; case KEY_PAGEDOWN: { if (vscroll->is_visible()) - vscroll->set_val( vscroll->get_val() + vscroll->get_page() ); + vscroll->set_value( vscroll->get_value() + vscroll->get_page() ); } break; case KEY_UP: { if (vscroll->is_visible()) - vscroll->set_val( vscroll->get_val() - get_font("normal_font")->get_height() ); + vscroll->set_value( vscroll->get_value() - get_font("normal_font")->get_height() ); } break; case KEY_DOWN: { if (vscroll->is_visible()) - vscroll->set_val( vscroll->get_val() + get_font("normal_font")->get_height() ); + vscroll->set_value( vscroll->get_value() + get_font("normal_font")->get_height() ); } break; case KEY_HOME: { if (vscroll->is_visible()) - vscroll->set_val( 0 ); + vscroll->set_value( 0 ); } break; case KEY_END: { if (vscroll->is_visible()) - vscroll->set_val( vscroll->get_max() ); + vscroll->set_value( vscroll->get_max() ); } break; case KEY_INSERT: case KEY_C: { @@ -1113,7 +1111,7 @@ void RichTextLabel::_validate_line_caches(ItemFrame* p_frame) { vscroll->set_max(total_height); vscroll->set_page(size.height); if (scroll_follow && scroll_following) - vscroll->set_val(total_height-size.height); + vscroll->set_value(total_height-size.height); updating_scroll=false; @@ -1179,7 +1177,8 @@ void RichTextLabel::add_text(const String& p_text) { item->line=current_frame->lines.size(); _add_item(item,false); current_frame->lines.resize(current_frame->lines.size()+1); - current_frame->lines[current_frame->lines.size()-1].from=item; + if (item->type!=ITEM_NEWLINE) + current_frame->lines[current_frame->lines.size()-1].from=item; _invalidate_current_line(current_frame); } @@ -1410,7 +1409,7 @@ bool RichTextLabel::is_meta_underlined() const { void RichTextLabel::set_offset(int p_pixel) { - vscroll->set_val(p_pixel); + vscroll->set_value(p_pixel); } void RichTextLabel::set_scroll_active(bool p_active) { @@ -1430,7 +1429,7 @@ bool RichTextLabel::is_scroll_active() const { void RichTextLabel::set_scroll_follow(bool p_follow) { scroll_follow=p_follow; - if (!vscroll->is_visible() || vscroll->get_val()>=(vscroll->get_max()-vscroll->get_page())) + if (!vscroll->is_visible() || vscroll->get_value()>=(vscroll->get_max()-vscroll->get_page())) scroll_following=true; } @@ -1727,7 +1726,7 @@ void RichTextLabel::scroll_to_line(int p_line) { ERR_FAIL_INDEX(p_line,main->lines.size()); _validate_line_caches(main); - vscroll->set_val(main->lines[p_line].height_accum_cache-main->lines[p_line].height_cache); + vscroll->set_value(main->lines[p_line].height_accum_cache-main->lines[p_line].height_cache); } @@ -1794,7 +1793,7 @@ bool RichTextLabel::search(const String& p_string,bool p_from_selection) { } item=item->parent; } - vscroll->set_val(offset-fh); + vscroll->set_value(offset-fh); return true; } @@ -1901,61 +1900,62 @@ String RichTextLabel::get_text() { void RichTextLabel::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_input_event"),&RichTextLabel::_input_event); - ObjectTypeDB::bind_method(_MD("_scroll_changed"),&RichTextLabel::_scroll_changed); - ObjectTypeDB::bind_method(_MD("get_text"),&RichTextLabel::get_text); - ObjectTypeDB::bind_method(_MD("add_text","text"),&RichTextLabel::add_text); - ObjectTypeDB::bind_method(_MD("add_image","image:Texture"),&RichTextLabel::add_image); - ObjectTypeDB::bind_method(_MD("newline"),&RichTextLabel::add_newline); - ObjectTypeDB::bind_method(_MD("push_font","font"),&RichTextLabel::push_font); - ObjectTypeDB::bind_method(_MD("push_color","color"),&RichTextLabel::push_color); - ObjectTypeDB::bind_method(_MD("push_align","align"),&RichTextLabel::push_align); - ObjectTypeDB::bind_method(_MD("push_indent","level"),&RichTextLabel::push_indent); - ObjectTypeDB::bind_method(_MD("push_list","type"),&RichTextLabel::push_list); - ObjectTypeDB::bind_method(_MD("push_meta","data"),&RichTextLabel::push_meta); - ObjectTypeDB::bind_method(_MD("push_underline"),&RichTextLabel::push_underline); - ObjectTypeDB::bind_method(_MD("push_table","columns"),&RichTextLabel::push_table); - ObjectTypeDB::bind_method(_MD("set_table_column_expand","column","expand","ratio"),&RichTextLabel::set_table_column_expand); - ObjectTypeDB::bind_method(_MD("push_cell"),&RichTextLabel::push_cell); - ObjectTypeDB::bind_method(_MD("pop"),&RichTextLabel::pop); + ClassDB::bind_method(_MD("_gui_input"),&RichTextLabel::_gui_input); + ClassDB::bind_method(_MD("_scroll_changed"),&RichTextLabel::_scroll_changed); + ClassDB::bind_method(_MD("get_text"),&RichTextLabel::get_text); + ClassDB::bind_method(_MD("add_text","text"),&RichTextLabel::add_text); + ClassDB::bind_method(_MD("add_image","image:Texture"),&RichTextLabel::add_image); + ClassDB::bind_method(_MD("newline"),&RichTextLabel::add_newline); + ClassDB::bind_method(_MD("push_font","font"),&RichTextLabel::push_font); + ClassDB::bind_method(_MD("push_color","color"),&RichTextLabel::push_color); + ClassDB::bind_method(_MD("push_align","align"),&RichTextLabel::push_align); + ClassDB::bind_method(_MD("push_indent","level"),&RichTextLabel::push_indent); + ClassDB::bind_method(_MD("push_list","type"),&RichTextLabel::push_list); + ClassDB::bind_method(_MD("push_meta","data"),&RichTextLabel::push_meta); + ClassDB::bind_method(_MD("push_underline"),&RichTextLabel::push_underline); + ClassDB::bind_method(_MD("push_table","columns"),&RichTextLabel::push_table); + ClassDB::bind_method(_MD("set_table_column_expand","column","expand","ratio"),&RichTextLabel::set_table_column_expand); + ClassDB::bind_method(_MD("push_cell"),&RichTextLabel::push_cell); + ClassDB::bind_method(_MD("pop"),&RichTextLabel::pop); - ObjectTypeDB::bind_method(_MD("clear"),&RichTextLabel::clear); + ClassDB::bind_method(_MD("clear"),&RichTextLabel::clear); - ObjectTypeDB::bind_method(_MD("set_meta_underline","enable"),&RichTextLabel::set_meta_underline); - ObjectTypeDB::bind_method(_MD("is_meta_underlined"),&RichTextLabel::is_meta_underlined); + ClassDB::bind_method(_MD("set_meta_underline","enable"),&RichTextLabel::set_meta_underline); + ClassDB::bind_method(_MD("is_meta_underlined"),&RichTextLabel::is_meta_underlined); - ObjectTypeDB::bind_method(_MD("set_scroll_active","active"),&RichTextLabel::set_scroll_active); - ObjectTypeDB::bind_method(_MD("is_scroll_active"),&RichTextLabel::is_scroll_active); + ClassDB::bind_method(_MD("set_scroll_active","active"),&RichTextLabel::set_scroll_active); + ClassDB::bind_method(_MD("is_scroll_active"),&RichTextLabel::is_scroll_active); - ObjectTypeDB::bind_method(_MD("set_scroll_follow","follow"),&RichTextLabel::set_scroll_follow); - ObjectTypeDB::bind_method(_MD("is_scroll_following"),&RichTextLabel::is_scroll_following); + ClassDB::bind_method(_MD("set_scroll_follow","follow"),&RichTextLabel::set_scroll_follow); + ClassDB::bind_method(_MD("is_scroll_following"),&RichTextLabel::is_scroll_following); - ObjectTypeDB::bind_method(_MD("get_v_scroll"),&RichTextLabel::get_v_scroll); + ClassDB::bind_method(_MD("get_v_scroll"),&RichTextLabel::get_v_scroll); - ObjectTypeDB::bind_method(_MD("scroll_to_line","line"),&RichTextLabel::scroll_to_line); + ClassDB::bind_method(_MD("scroll_to_line","line"),&RichTextLabel::scroll_to_line); - ObjectTypeDB::bind_method(_MD("set_tab_size","spaces"),&RichTextLabel::set_tab_size); - ObjectTypeDB::bind_method(_MD("get_tab_size"),&RichTextLabel::get_tab_size); + ClassDB::bind_method(_MD("set_tab_size","spaces"),&RichTextLabel::set_tab_size); + ClassDB::bind_method(_MD("get_tab_size"),&RichTextLabel::get_tab_size); - ObjectTypeDB::bind_method(_MD("set_selection_enabled","enabled"),&RichTextLabel::set_selection_enabled); - ObjectTypeDB::bind_method(_MD("is_selection_enabled"),&RichTextLabel::is_selection_enabled); + ClassDB::bind_method(_MD("set_selection_enabled","enabled"),&RichTextLabel::set_selection_enabled); + ClassDB::bind_method(_MD("is_selection_enabled"),&RichTextLabel::is_selection_enabled); - ObjectTypeDB::bind_method(_MD("parse_bbcode", "bbcode"),&RichTextLabel::parse_bbcode); - ObjectTypeDB::bind_method(_MD("append_bbcode", "bbcode"),&RichTextLabel::append_bbcode); + ClassDB::bind_method(_MD("parse_bbcode", "bbcode"),&RichTextLabel::parse_bbcode); + ClassDB::bind_method(_MD("append_bbcode", "bbcode"),&RichTextLabel::append_bbcode); - ObjectTypeDB::bind_method(_MD("set_bbcode","text"),&RichTextLabel::set_bbcode); - ObjectTypeDB::bind_method(_MD("get_bbcode"),&RichTextLabel::get_bbcode); + ClassDB::bind_method(_MD("set_bbcode","text"),&RichTextLabel::set_bbcode); + ClassDB::bind_method(_MD("get_bbcode"),&RichTextLabel::get_bbcode); - ObjectTypeDB::bind_method(_MD("set_visible_characters","amount"),&RichTextLabel::set_visible_characters); - ObjectTypeDB::bind_method(_MD("get_visible_characters"),&RichTextLabel::get_visible_characters); + ClassDB::bind_method(_MD("set_visible_characters","amount"),&RichTextLabel::set_visible_characters); + ClassDB::bind_method(_MD("get_visible_characters"),&RichTextLabel::get_visible_characters); - ObjectTypeDB::bind_method(_MD("get_total_character_count"),&RichTextLabel::get_total_character_count); + ClassDB::bind_method(_MD("get_total_character_count"),&RichTextLabel::get_total_character_count); - ObjectTypeDB::bind_method(_MD("set_use_bbcode","enable"),&RichTextLabel::set_use_bbcode); - ObjectTypeDB::bind_method(_MD("is_using_bbcode"),&RichTextLabel::is_using_bbcode); + ClassDB::bind_method(_MD("set_use_bbcode","enable"),&RichTextLabel::set_use_bbcode); + ClassDB::bind_method(_MD("is_using_bbcode"),&RichTextLabel::is_using_bbcode); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"bbcode/enabled"),_SCS("set_use_bbcode"),_SCS("is_using_bbcode")); - ADD_PROPERTY(PropertyInfo(Variant::STRING,"bbcode/bbcode",PROPERTY_HINT_MULTILINE_TEXT),_SCS("set_bbcode"),_SCS("get_bbcode")); + ADD_GROUP("BBCode","bbcode_"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"bbcode_enabled"),_SCS("set_use_bbcode"),_SCS("is_using_bbcode")); + ADD_PROPERTY(PropertyInfo(Variant::STRING,"bbcode_text",PROPERTY_HINT_MULTILINE_TEXT),_SCS("set_bbcode"),_SCS("get_bbcode")); ADD_PROPERTY(PropertyInfo(Variant::INT,"visible_characters",PROPERTY_HINT_RANGE,"-1,128000,1"),_SCS("set_visible_characters"),_SCS("get_visible_characters")); ADD_SIGNAL( MethodInfo("meta_clicked",PropertyInfo(Variant::NIL,"meta"))); @@ -2044,6 +2044,7 @@ RichTextLabel::RichTextLabel() { visible_characters=-1; + set_clip_contents(true); } RichTextLabel::~RichTextLabel() { diff --git a/scene/gui/rich_text_label.h b/scene/gui/rich_text_label.h index 5147905a0e..39032185f8 100644 --- a/scene/gui/rich_text_label.h +++ b/scene/gui/rich_text_label.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class RichTextLabel : public Control { - OBJ_TYPE( RichTextLabel, Control ); + GDCLASS( RichTextLabel, Control ); public: enum Align { @@ -267,7 +267,7 @@ private: void _update_scroll(); void _scroll_changed(double); - void _input_event(InputEvent p_event); + void _gui_input(InputEvent p_event); Item *_get_next_item(Item* p_item, bool p_free=false); bool use_bbcode; diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp index d8365feb24..0b32ca4952 100644 --- a/scene/gui/scroll_bar.cpp +++ b/scene/gui/scroll_bar.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,7 +39,7 @@ void ScrollBar::set_can_focus_by_default(bool p_can_focus) { focus_by_default=p_can_focus; } -void ScrollBar::_input_event(InputEvent p_event) { +void ScrollBar::_gui_input(InputEvent p_event) { switch(p_event.type) { @@ -54,7 +54,7 @@ void ScrollBar::_input_event(InputEvent p_event) { //if (orientation==VERTICAL) // set_val( get_val() + get_page() / 4.0 ); //else - set_val( get_val() + get_page() / 4.0 ); + set_value( get_value() + get_page() / 4.0 ); accept_event(); } @@ -64,7 +64,7 @@ void ScrollBar::_input_event(InputEvent p_event) { //if (orientation==HORIZONTAL) // set_val( get_val() - get_page() / 4.0 ); //else - set_val( get_val() - get_page() / 4.0 ); + set_value( get_value() - get_page() / 4.0 ); accept_event(); } @@ -87,13 +87,13 @@ void ScrollBar::_input_event(InputEvent p_event) { if (ofs < decr_size ) { - set_val( get_val() - (custom_step>=0?custom_step:get_step()) ); + set_value( get_value() - (custom_step>=0?custom_step:get_step()) ); break; } if (ofs > total-incr_size ) { - set_val( get_val() + (custom_step>=0?custom_step:get_step()) ); + set_value( get_value() + (custom_step>=0?custom_step:get_step()) ); break; } @@ -101,7 +101,7 @@ void ScrollBar::_input_event(InputEvent p_event) { if ( ofs < grabber_ofs ) { - set_val( get_val() - get_page() ); + set_value( get_value() - get_page() ); break; } @@ -117,7 +117,7 @@ void ScrollBar::_input_event(InputEvent p_event) { } else { - set_val( get_val() + get_page() ); + set_value( get_value() + get_page() ); } @@ -194,14 +194,14 @@ void ScrollBar::_input_event(InputEvent p_event) { if (orientation!=HORIZONTAL) return; - set_val( get_val() - (custom_step>=0?custom_step:get_step()) ); + set_value( get_value() - (custom_step>=0?custom_step:get_step()) ); } break; case KEY_RIGHT: { if (orientation!=HORIZONTAL) return; - set_val( get_val() + (custom_step>=0?custom_step:get_step()) ); + set_value( get_value() + (custom_step>=0?custom_step:get_step()) ); } break; case KEY_UP: { @@ -209,7 +209,7 @@ void ScrollBar::_input_event(InputEvent p_event) { if (orientation!=VERTICAL) return; - set_val( get_val() - (custom_step>=0?custom_step:get_step()) ); + set_value( get_value() - (custom_step>=0?custom_step:get_step()) ); } break; @@ -217,17 +217,17 @@ void ScrollBar::_input_event(InputEvent p_event) { if (orientation!=VERTICAL) return; - set_val( get_val() + (custom_step>=0?custom_step:get_step()) ); + set_value( get_value() + (custom_step>=0?custom_step:get_step()) ); } break; case KEY_HOME: { - set_val( get_min() ); + set_value( get_min() ); } break; case KEY_END: { - set_val( get_max() ); + set_value( get_max() ); } break; @@ -302,7 +302,7 @@ void ScrollBar::_notification(int p_what) { } if (drag_slave) { - drag_slave->connect("input_event",this,"_drag_slave_input"); + drag_slave->connect("gui_input",this,"_drag_slave_input"); drag_slave->connect("exit_tree",this,"_drag_slave_exit",varray(),CONNECT_ONESHOT); } @@ -311,7 +311,7 @@ void ScrollBar::_notification(int p_what) { if (p_what==NOTIFICATION_EXIT_TREE) { if (drag_slave) { - drag_slave->disconnect("input_event",this,"_drag_slave_input"); + drag_slave->disconnect("gui_input",this,"_drag_slave_input"); drag_slave->disconnect("exit_tree",this,"_drag_slave_exit"); } @@ -325,7 +325,7 @@ void ScrollBar::_notification(int p_what) { if (drag_slave_touching_deaccel) { - Vector2 pos = Vector2(orientation==HORIZONTAL?get_val():0,orientation==VERTICAL?get_val():0); + Vector2 pos = Vector2(orientation==HORIZONTAL?get_value():0,orientation==VERTICAL?get_value():0); pos+=drag_slave_speed*get_fixed_process_delta_time(); bool turnoff=false; @@ -342,7 +342,7 @@ void ScrollBar::_notification(int p_what) { turnoff=true; } - set_val(pos.x); + set_value(pos.x); float sgn_x = drag_slave_speed.x<0? -1 : 1; float val_x = Math::abs(drag_slave_speed.x); @@ -367,7 +367,7 @@ void ScrollBar::_notification(int p_what) { turnoff=true; } - set_val(pos.y); + set_value(pos.y); float sgn_y = drag_slave_speed.y<0? -1 : 1; float val_y = Math::abs(drag_slave_speed.y); @@ -546,7 +546,7 @@ float ScrollBar::get_custom_step() const { void ScrollBar::_drag_slave_exit() { if (drag_slave) { - drag_slave->disconnect("input_event",this,"_drag_slave_input"); + drag_slave->disconnect("gui_input",this,"_drag_slave_input"); } drag_slave=NULL; } @@ -580,7 +580,7 @@ void ScrollBar::_drag_slave_input(const InputEvent& p_input) { drag_slave_accum=Vector2(); last_drag_slave_accum=Vector2(); //drag_slave_from=Vector2(h_scroll->get_val(),v_scroll->get_val()); - drag_slave_from= Vector2(orientation==HORIZONTAL?get_val():0,orientation==VERTICAL?get_val():0); + drag_slave_from= Vector2(orientation==HORIZONTAL?get_value():0,orientation==VERTICAL?get_value():0); drag_slave_touching=OS::get_singleton()->has_touchscreen_ui_hint(); drag_slave_touching_deaccel=false; @@ -619,11 +619,11 @@ void ScrollBar::_drag_slave_input(const InputEvent& p_input) { Vector2 diff = drag_slave_from+drag_slave_accum; if (orientation==HORIZONTAL) - set_val(diff.x); + set_value(diff.x); //else // drag_slave_accum.x=0; if (orientation==VERTICAL) - set_val(diff.y); + set_value(diff.y); //else // drag_slave_accum.y=0; time_since_motion=0; @@ -638,7 +638,7 @@ void ScrollBar::set_drag_slave(const NodePath& p_path) { if (is_inside_tree()) { if (drag_slave) { - drag_slave->disconnect("input_event",this,"_drag_slave_input"); + drag_slave->disconnect("gui_input",this,"_drag_slave_input"); drag_slave->disconnect("exit_tree",this,"_drag_slave_exit"); } } @@ -654,7 +654,7 @@ void ScrollBar::set_drag_slave(const NodePath& p_path) { } if (drag_slave) { - drag_slave->connect("input_event",this,"_drag_slave_input"); + drag_slave->connect("gui_input",this,"_drag_slave_input"); drag_slave->connect("exit_tree",this,"_drag_slave_exit",varray(),CONNECT_ONESHOT); } } @@ -804,11 +804,11 @@ bool ScrollBar::key(unsigned long p_unicode, unsigned long p_scan_code,bool b.pr void ScrollBar::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_input_event"),&ScrollBar::_input_event); - ObjectTypeDB::bind_method(_MD("set_custom_step","step"),&ScrollBar::set_custom_step); - ObjectTypeDB::bind_method(_MD("get_custom_step"),&ScrollBar::get_custom_step); - ObjectTypeDB::bind_method(_MD("_drag_slave_input"),&ScrollBar::_drag_slave_input); - ObjectTypeDB::bind_method(_MD("_drag_slave_exit"),&ScrollBar::_drag_slave_exit); + ClassDB::bind_method(_MD("_gui_input"),&ScrollBar::_gui_input); + ClassDB::bind_method(_MD("set_custom_step","step"),&ScrollBar::set_custom_step); + ClassDB::bind_method(_MD("get_custom_step"),&ScrollBar::get_custom_step); + ClassDB::bind_method(_MD("_drag_slave_input"),&ScrollBar::_drag_slave_input); + ClassDB::bind_method(_MD("_drag_slave_exit"),&ScrollBar::_drag_slave_exit); ADD_PROPERTY( PropertyInfo(Variant::REAL,"custom_step",PROPERTY_HINT_RANGE,"-1,4096"), _SCS("set_custom_step"),_SCS("get_custom_step")); @@ -832,7 +832,7 @@ ScrollBar::ScrollBar(Orientation p_orientation) if (focus_by_default) set_focus_mode( FOCUS_ALL ); - + set_step(0); } diff --git a/scene/gui/scroll_bar.h b/scene/gui/scroll_bar.h index c68db02b33..be8b394957 100644 --- a/scene/gui/scroll_bar.h +++ b/scene/gui/scroll_bar.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ */ class ScrollBar : public Range { - OBJ_TYPE( ScrollBar, Range ); + GDCLASS( ScrollBar, Range ); enum HiliteStatus { HILITE_NONE, @@ -87,7 +87,7 @@ class ScrollBar : public Range { void _drag_slave_exit(); void _drag_slave_input(const InputEvent& p_input); - void _input_event(InputEvent p_event); + void _gui_input(InputEvent p_event); protected: void _notification(int p_what); @@ -109,7 +109,7 @@ public: class HScrollBar : public ScrollBar { - OBJ_TYPE( HScrollBar, ScrollBar ); + GDCLASS( HScrollBar, ScrollBar ); public: HScrollBar() : ScrollBar(HORIZONTAL) { set_v_size_flags(0); } @@ -117,7 +117,7 @@ public: class VScrollBar : public ScrollBar { - OBJ_TYPE( VScrollBar, ScrollBar ); + GDCLASS( VScrollBar, ScrollBar ); public: VScrollBar() : ScrollBar(VERTICAL) { set_h_size_flags(0); } diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index 479bb96fe2..43c214b0be 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -79,23 +79,31 @@ void ScrollContainer::_cancel_drag() { drag_from=Vector2(); } -void ScrollContainer::_input_event(const InputEvent& p_input_event) { +void ScrollContainer::_gui_input(const InputEvent& p_gui_input) { - switch(p_input_event.type) { + switch(p_gui_input.type) { case InputEvent::MOUSE_BUTTON: { - const InputEventMouseButton &mb=p_input_event.mouse_button; + const InputEventMouseButton &mb=p_gui_input.mouse_button; - if (mb.button_index==BUTTON_WHEEL_UP && mb.pressed && v_scroll->is_visible()) { - - v_scroll->set_val( v_scroll->get_val()-v_scroll->get_page()/8 ); + if (mb.button_index==BUTTON_WHEEL_UP && mb.pressed) { + if (h_scroll->is_visible() && !v_scroll->is_visible()){ + // only horizontal is enabled, scroll horizontally + h_scroll->set_value( h_scroll->get_value()-h_scroll->get_page()/8 ); + } else if (v_scroll->is_visible()) { + v_scroll->set_value( v_scroll->get_value()-v_scroll->get_page()/8 ); + } } - if (mb.button_index==BUTTON_WHEEL_DOWN && mb.pressed && v_scroll->is_visible()) { - - v_scroll->set_val( v_scroll->get_val()+v_scroll->get_page()/8 ); + if (mb.button_index==BUTTON_WHEEL_DOWN && mb.pressed) { + if (h_scroll->is_visible() && !v_scroll->is_visible()){ + // only horizontal is enabled, scroll horizontally + h_scroll->set_value( h_scroll->get_value()+h_scroll->get_page()/8 ); + } else if (v_scroll->is_visible()) { + v_scroll->set_value( v_scroll->get_value()+v_scroll->get_page()/8 ); + } } if(!OS::get_singleton()->has_touchscreen_ui_hint()) @@ -120,7 +128,7 @@ void ScrollContainer::_input_event(const InputEvent& p_input_event) { drag_speed=Vector2(); drag_accum=Vector2(); last_drag_accum=Vector2(); - drag_from=Vector2(h_scroll->get_val(),v_scroll->get_val()); + drag_from=Vector2(h_scroll->get_value(),v_scroll->get_value()); drag_touching=OS::get_singleton()->has_touchscreen_ui_hint(); drag_touching_deaccel=false; time_since_motion=0; @@ -150,7 +158,7 @@ void ScrollContainer::_input_event(const InputEvent& p_input_event) { } break; case InputEvent::MOUSE_MOTION: { - const InputEventMouseMotion &mm=p_input_event.mouse_motion; + const InputEventMouseMotion &mm=p_gui_input.mouse_motion; if (drag_touching && ! drag_touching_deaccel) { @@ -159,11 +167,11 @@ void ScrollContainer::_input_event(const InputEvent& p_input_event) { Vector2 diff = drag_from+drag_accum; if (scroll_h) - h_scroll->set_val(diff.x); + h_scroll->set_value(diff.x); else drag_accum.x=0; if (scroll_v) - v_scroll->set_val(diff.y); + v_scroll->set_value(diff.y); else drag_accum.y=0; time_since_motion=0; @@ -253,7 +261,6 @@ void ScrollContainer::_notification(int p_what) { update_scrollbars(); - VisualServer::get_singleton()->canvas_item_set_clip(get_canvas_item(),true); } if (p_what==NOTIFICATION_FIXED_PROCESS) { @@ -262,7 +269,7 @@ void ScrollContainer::_notification(int p_what) { if (drag_touching_deaccel) { - Vector2 pos = Vector2(h_scroll->get_val(),v_scroll->get_val()); + Vector2 pos = Vector2(h_scroll->get_value(),v_scroll->get_value()); pos+=drag_speed*get_fixed_process_delta_time(); bool turnoff_h=false; @@ -287,9 +294,9 @@ void ScrollContainer::_notification(int p_what) { } if (scroll_h) - h_scroll->set_val(pos.x); + h_scroll->set_value(pos.x); if (scroll_v) - v_scroll->set_val(pos.y); + v_scroll->set_value(pos.y); float sgn_x = drag_speed.x<0? -1 : 1; float val_x = Math::abs(drag_speed.x); @@ -351,7 +358,7 @@ void ScrollContainer::update_scrollbars() { } else { v_scroll->show(); - scroll.y=v_scroll->get_val(); + scroll.y=v_scroll->get_value(); } @@ -368,14 +375,14 @@ void ScrollContainer::update_scrollbars() { h_scroll->show(); h_scroll->set_max(min.width); h_scroll->set_page(size.width - vmin.width); - scroll.x=h_scroll->get_val(); + scroll.x=h_scroll->get_value(); } } void ScrollContainer::_scroll_moved(float) { - scroll.x=h_scroll->get_val(); - scroll.y=v_scroll->get_val(); + scroll.x=h_scroll->get_value(); + scroll.y=v_scroll->get_value(); queue_sort(); update(); @@ -407,42 +414,66 @@ bool ScrollContainer::is_v_scroll_enabled() const{ int ScrollContainer::get_v_scroll() const { - return v_scroll->get_val(); + return v_scroll->get_value(); } void ScrollContainer::set_v_scroll(int p_pos) { - v_scroll->set_val(p_pos); + v_scroll->set_value(p_pos); _cancel_drag(); } int ScrollContainer::get_h_scroll() const { - return h_scroll->get_val(); + return h_scroll->get_value(); } void ScrollContainer::set_h_scroll(int p_pos) { - h_scroll->set_val(p_pos); + h_scroll->set_value(p_pos); _cancel_drag(); } +String ScrollContainer::get_configuration_warning() const { + + int found=0; + + for(int i=0;i<get_child_count();i++) { + + Control *c = get_child(i)->cast_to<Control>(); + if (!c) + continue; + if (c->is_set_as_toplevel()) + continue; + if (c == h_scroll || c == v_scroll) + continue; + + found++; + } + + if (found!=1) + return TTR("ScrollContainer is intended to work with a single child control.\nUse a container as child (VBox,HBox,etc), or a Control and set the custom minimum size manually."); + else + return ""; +} + void ScrollContainer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_scroll_moved"),&ScrollContainer::_scroll_moved); - ObjectTypeDB::bind_method(_MD("_input_event"),&ScrollContainer::_input_event); - ObjectTypeDB::bind_method(_MD("set_enable_h_scroll","enable"),&ScrollContainer::set_enable_h_scroll); - ObjectTypeDB::bind_method(_MD("is_h_scroll_enabled"),&ScrollContainer::is_h_scroll_enabled); - ObjectTypeDB::bind_method(_MD("set_enable_v_scroll","enable"),&ScrollContainer::set_enable_v_scroll); - ObjectTypeDB::bind_method(_MD("is_v_scroll_enabled"),&ScrollContainer::is_v_scroll_enabled); - ObjectTypeDB::bind_method(_MD("_update_scrollbar_pos"),&ScrollContainer::_update_scrollbar_pos); - ObjectTypeDB::bind_method(_MD("set_h_scroll","val"),&ScrollContainer::set_h_scroll); - ObjectTypeDB::bind_method(_MD("get_h_scroll"),&ScrollContainer::get_h_scroll); - ObjectTypeDB::bind_method(_MD("set_v_scroll","val"),&ScrollContainer::set_v_scroll); - ObjectTypeDB::bind_method(_MD("get_v_scroll"),&ScrollContainer::get_v_scroll); - - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "scroll/horizontal"), _SCS("set_enable_h_scroll"),_SCS("is_h_scroll_enabled")); - ADD_PROPERTY( PropertyInfo( Variant::BOOL, "scroll/vertical"), _SCS("set_enable_v_scroll"),_SCS("is_v_scroll_enabled")); + ClassDB::bind_method(_MD("_scroll_moved"),&ScrollContainer::_scroll_moved); + ClassDB::bind_method(_MD("_gui_input"),&ScrollContainer::_gui_input); + ClassDB::bind_method(_MD("set_enable_h_scroll","enable"),&ScrollContainer::set_enable_h_scroll); + ClassDB::bind_method(_MD("is_h_scroll_enabled"),&ScrollContainer::is_h_scroll_enabled); + ClassDB::bind_method(_MD("set_enable_v_scroll","enable"),&ScrollContainer::set_enable_v_scroll); + ClassDB::bind_method(_MD("is_v_scroll_enabled"),&ScrollContainer::is_v_scroll_enabled); + ClassDB::bind_method(_MD("_update_scrollbar_pos"),&ScrollContainer::_update_scrollbar_pos); + ClassDB::bind_method(_MD("set_h_scroll","val"),&ScrollContainer::set_h_scroll); + ClassDB::bind_method(_MD("get_h_scroll"),&ScrollContainer::get_h_scroll); + ClassDB::bind_method(_MD("set_v_scroll","val"),&ScrollContainer::set_v_scroll); + ClassDB::bind_method(_MD("get_v_scroll"),&ScrollContainer::get_v_scroll); + + ADD_GROUP("Scroll","scroll_"); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "scroll_horizontal"), _SCS("set_enable_h_scroll"),_SCS("is_h_scroll_enabled")); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "scroll_vertical"), _SCS("set_enable_v_scroll"),_SCS("is_v_scroll_enabled")); }; @@ -465,6 +496,6 @@ ScrollContainer::ScrollContainer() { scroll_h=true; scroll_v=true; - + set_clip_contents(true); }; diff --git a/scene/gui/scroll_container.h b/scene/gui/scroll_container.h index 50ae236714..114cd06306 100644 --- a/scene/gui/scroll_container.h +++ b/scene/gui/scroll_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class ScrollContainer : public Container { - OBJ_TYPE(ScrollContainer, Container); + GDCLASS(ScrollContainer, Container); HScrollBar* h_scroll; VScrollBar* v_scroll; @@ -64,7 +64,7 @@ protected: Size2 get_minimum_size() const; - void _input_event(const InputEvent& p_input_event); + void _gui_input(const InputEvent& p_gui_input); void _notification(int p_what); void _scroll_moved(float); @@ -86,6 +86,9 @@ public: bool is_v_scroll_enabled() const; virtual bool clips_input() const; + + virtual String get_configuration_warning() const; + ScrollContainer(); }; diff --git a/scene/gui/separator.cpp b/scene/gui/separator.cpp index 626b093a2f..32bd2239fc 100644 --- a/scene/gui/separator.cpp +++ b/scene/gui/separator.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/separator.h b/scene/gui/separator.h index 7a7dc92b93..5fb17e1c2e 100644 --- a/scene/gui/separator.h +++ b/scene/gui/separator.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ #include "scene/gui/control.h" class Separator : public Control { - OBJ_TYPE( Separator, Control ); + GDCLASS( Separator, Control ); protected: @@ -54,7 +54,7 @@ public: class VSeparator : public Separator { - OBJ_TYPE( VSeparator, Separator ); + GDCLASS( VSeparator, Separator ); public: @@ -64,7 +64,7 @@ public: class HSeparator : public Separator { - OBJ_TYPE( HSeparator, Separator ); + GDCLASS( HSeparator, Separator ); public: diff --git a/scene/gui/slider.cpp b/scene/gui/slider.cpp index 3b9ca40bd8..dacfc644ee 100644 --- a/scene/gui/slider.cpp +++ b/scene/gui/slider.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ Size2 Slider::get_minimum_size() const { return ms; } -void Slider::_input_event(InputEvent p_event) { +void Slider::_gui_input(InputEvent p_event) { @@ -63,9 +63,9 @@ void Slider::_input_event(InputEvent p_event) { } } else if (mb.pressed && mb.button_index==BUTTON_WHEEL_UP) { - set_val( get_val() + get_step()); + set_value( get_value() + get_step()); } else if (mb.pressed && mb.button_index==BUTTON_WHEEL_DOWN) { - set_val( get_val() - get_step()); + set_value( get_value() - get_step()); } } else if (p_event.type==InputEvent::MOUSE_MOTION) { @@ -89,26 +89,26 @@ void Slider::_input_event(InputEvent p_event) { if (orientation!=HORIZONTAL) return; - set_val( get_val() - (custom_step>=0?custom_step:get_step()) ); + set_value( get_value() - (custom_step>=0?custom_step:get_step()) ); accept_event(); } else if (p_event.is_action("ui_right") && p_event.is_pressed()) { if (orientation!=HORIZONTAL) return; - set_val( get_val() + (custom_step>=0?custom_step:get_step()) ); + set_value( get_value() + (custom_step>=0?custom_step:get_step()) ); accept_event(); } else if (p_event.is_action("ui_up") && p_event.is_pressed()) { if (orientation!=VERTICAL) return; - set_val( get_val() + (custom_step>=0?custom_step:get_step()) ); + set_value( get_value() + (custom_step>=0?custom_step:get_step()) ); accept_event(); } else if (p_event.is_action("ui_down") && p_event.is_pressed()) { if (orientation!=VERTICAL) return; - set_val( get_val() - (custom_step>=0?custom_step:get_step()) ); + set_value( get_value() - (custom_step>=0?custom_step:get_step()) ); accept_event(); } else if (p_event.type==InputEvent::KEY) { @@ -122,12 +122,12 @@ void Slider::_input_event(InputEvent p_event) { case KEY_HOME: { - set_val( get_min() ); + set_value( get_min() ); accept_event(); } break; case KEY_END: { - set_val( get_max() ); + set_value( get_max() ); accept_event(); } break; @@ -231,12 +231,12 @@ void Slider::set_ticks_on_borders(bool _tob){ void Slider::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_input_event"),&Slider::_input_event); - ObjectTypeDB::bind_method(_MD("set_ticks","count"),&Slider::set_ticks); - ObjectTypeDB::bind_method(_MD("get_ticks"),&Slider::get_ticks); + ClassDB::bind_method(_MD("_gui_input"),&Slider::_gui_input); + ClassDB::bind_method(_MD("set_ticks","count"),&Slider::set_ticks); + ClassDB::bind_method(_MD("get_ticks"),&Slider::get_ticks); - ObjectTypeDB::bind_method(_MD("get_ticks_on_borders"),&Slider::get_ticks_on_borders); - ObjectTypeDB::bind_method(_MD("set_ticks_on_borders","ticks_on_border"),&Slider::set_ticks_on_borders); + ClassDB::bind_method(_MD("get_ticks_on_borders"),&Slider::get_ticks_on_borders); + ClassDB::bind_method(_MD("set_ticks_on_borders","ticks_on_border"),&Slider::set_ticks_on_borders); ADD_PROPERTY( PropertyInfo( Variant::INT, "tick_count", PROPERTY_HINT_RANGE,"0,4096,1"), _SCS("set_ticks"), _SCS("get_ticks") ); ADD_PROPERTY( PropertyInfo( Variant::BOOL, "ticks_on_borders" ), _SCS("set_ticks_on_borders"), _SCS("get_ticks_on_borders") ); diff --git a/scene/gui/slider.h b/scene/gui/slider.h index cf009b9a75..89eb32737b 100644 --- a/scene/gui/slider.h +++ b/scene/gui/slider.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class Slider : public Range { - OBJ_TYPE( Slider, Range ); + GDCLASS( Slider, Range ); struct Grab { int pos; @@ -49,7 +49,7 @@ class Slider : public Range { protected: - void _input_event(InputEvent p_event); + void _gui_input(InputEvent p_event); void _notification(int p_what); static void _bind_methods(); bool ticks_on_borders; @@ -74,7 +74,7 @@ public: class HSlider : public Slider { - OBJ_TYPE( HSlider, Slider ); + GDCLASS( HSlider, Slider ); public: HSlider() : Slider(HORIZONTAL) { set_v_size_flags(0);} @@ -82,7 +82,7 @@ public: class VSlider : public Slider { - OBJ_TYPE( VSlider, Slider ); + GDCLASS( VSlider, Slider ); public: VSlider() : Slider(VERTICAL) { set_h_size_flags(0);} diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp index 9417c25424..772d753da9 100644 --- a/scene/gui/spin_box.cpp +++ b/scene/gui/spin_box.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,7 +39,7 @@ Size2 SpinBox::get_minimum_size() const { void SpinBox::_value_changed(double) { - String value = String::num(get_val(),Math::step_decimals(get_step())); + String value = String::num(get_value(),Math::step_decimals(get_step())); if (prefix!="") value=prefix+" "+value; if (suffix!="") @@ -54,7 +54,7 @@ void SpinBox::_text_entered(const String& p_string) { String value = p_string; if (prefix!="" && p_string.begins_with(prefix)) value = p_string.substr(prefix.length(), p_string.length()-prefix.length()); - set_val( value.to_double() ); + set_value( value.to_double() ); _value_changed(0); } @@ -76,7 +76,7 @@ void SpinBox::_range_click_timeout() { if (!drag.enabled && Input::get_singleton()->is_mouse_button_pressed(BUTTON_LEFT)) { bool up = get_local_mouse_pos().y < (get_size().height/2); - set_val( get_val() + (up?get_step():-get_step())); + set_value( get_value() + (up?get_step():-get_step())); if (range_click_timer->is_one_shot()) { range_click_timer->set_wait_time(0.075); @@ -90,8 +90,11 @@ void SpinBox::_range_click_timeout() { } -void SpinBox::_input_event(const InputEvent& p_event) { +void SpinBox::_gui_input(const InputEvent& p_event) { + if (!is_editable()) { + return; + } if (p_event.type==InputEvent::MOUSE_BUTTON && p_event.mouse_button.pressed) { const InputEventMouseButton &mb=p_event.mouse_button; @@ -104,25 +107,30 @@ void SpinBox::_input_event(const InputEvent& p_event) { case BUTTON_LEFT: { - set_val( get_val() + (up?get_step():-get_step())); + set_value( get_value() + (up?get_step():-get_step())); range_click_timer->set_wait_time(0.6); range_click_timer->set_one_shot(true); range_click_timer->start(); + line_edit->grab_focus(); } break; case BUTTON_RIGHT: { - set_val( (up?get_max():get_min()) ); - + set_value( (up?get_max():get_min()) ); + line_edit->grab_focus(); } break; case BUTTON_WHEEL_UP: { - - set_val( get_val() + get_step() ); + if (line_edit->has_focus()) { + set_value( get_value() + get_step() ); + accept_event(); + } } break; case BUTTON_WHEEL_DOWN: { - - set_val( get_val() - get_step() ); + if (line_edit->has_focus()) { + set_value( get_value() - get_step() ); + accept_event(); + } } break; } } @@ -158,13 +166,13 @@ void SpinBox::_input_event(const InputEvent& p_event) { drag.mouse_pos=cpos; drag.base_val=CLAMP(drag.base_val + get_step() * diff_y, get_min(), get_max()); - set_val( drag.base_val); + set_value( drag.base_val); } else if (drag.mouse_pos.distance_to(cpos)>2) { Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_CAPTURED); drag.enabled=true; - drag.base_val=get_val(); + drag.base_val=get_value(); drag.mouse_pos=cpos; drag.capture_pos=cpos; @@ -243,19 +251,19 @@ bool SpinBox::is_editable() const { void SpinBox::_bind_methods() { - //ObjectTypeDB::bind_method(_MD("_value_changed"),&SpinBox::_value_changed); - ObjectTypeDB::bind_method(_MD("_input_event"),&SpinBox::_input_event); - ObjectTypeDB::bind_method(_MD("_text_entered"),&SpinBox::_text_entered); - ObjectTypeDB::bind_method(_MD("set_suffix","suffix"),&SpinBox::set_suffix); - ObjectTypeDB::bind_method(_MD("get_suffix"),&SpinBox::get_suffix); - ObjectTypeDB::bind_method(_MD("set_prefix","prefix"),&SpinBox::set_prefix); - ObjectTypeDB::bind_method(_MD("get_prefix"),&SpinBox::get_prefix); - ObjectTypeDB::bind_method(_MD("set_editable","editable"),&SpinBox::set_editable); - ObjectTypeDB::bind_method(_MD("is_editable"),&SpinBox::is_editable); - ObjectTypeDB::bind_method(_MD("_line_edit_focus_exit"),&SpinBox::_line_edit_focus_exit); - ObjectTypeDB::bind_method(_MD("get_line_edit"),&SpinBox::get_line_edit); - ObjectTypeDB::bind_method(_MD("_line_edit_input"),&SpinBox::_line_edit_input); - ObjectTypeDB::bind_method(_MD("_range_click_timeout"),&SpinBox::_range_click_timeout); + //ClassDB::bind_method(_MD("_value_changed"),&SpinBox::_value_changed); + ClassDB::bind_method(_MD("_gui_input"),&SpinBox::_gui_input); + ClassDB::bind_method(_MD("_text_entered"),&SpinBox::_text_entered); + ClassDB::bind_method(_MD("set_suffix","suffix"),&SpinBox::set_suffix); + ClassDB::bind_method(_MD("get_suffix"),&SpinBox::get_suffix); + ClassDB::bind_method(_MD("set_prefix","prefix"),&SpinBox::set_prefix); + ClassDB::bind_method(_MD("get_prefix"),&SpinBox::get_prefix); + ClassDB::bind_method(_MD("set_editable","editable"),&SpinBox::set_editable); + ClassDB::bind_method(_MD("is_editable"),&SpinBox::is_editable); + ClassDB::bind_method(_MD("_line_edit_focus_exit"),&SpinBox::_line_edit_focus_exit); + ClassDB::bind_method(_MD("get_line_edit"),&SpinBox::get_line_edit); + ClassDB::bind_method(_MD("_line_edit_input"),&SpinBox::_line_edit_input); + ClassDB::bind_method(_MD("_range_click_timeout"),&SpinBox::_range_click_timeout); ADD_PROPERTY(PropertyInfo(Variant::BOOL,"editable"),_SCS("set_editable"),_SCS("is_editable")); @@ -275,7 +283,7 @@ SpinBox::SpinBox() { //connect("value_changed",this,"_value_changed"); line_edit->connect("text_entered",this,"_text_entered",Vector<Variant>(),CONNECT_DEFERRED); line_edit->connect("focus_exit",this,"_line_edit_focus_exit",Vector<Variant>(),CONNECT_DEFERRED); - line_edit->connect("input_event",this,"_line_edit_input"); + line_edit->connect("gui_input",this,"_line_edit_input"); drag.enabled=false; range_click_timer = memnew( Timer ); diff --git a/scene/gui/spin_box.h b/scene/gui/spin_box.h index acaea822ab..9974ec47bc 100644 --- a/scene/gui/spin_box.h +++ b/scene/gui/spin_box.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class SpinBox : public Range { - OBJ_TYPE( SpinBox, Range ); + GDCLASS( SpinBox, Range ); LineEdit *line_edit; int last_w; @@ -64,7 +64,7 @@ class SpinBox : public Range { protected: - void _input_event(const InputEvent& p_event); + void _gui_input(const InputEvent& p_event); void _notification(int p_what); diff --git a/scene/gui/split_container.cpp b/scene/gui/split_container.cpp index 6b36a60ea2..aae3b3fffa 100644 --- a/scene/gui/split_container.cpp +++ b/scene/gui/split_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -299,7 +299,7 @@ void SplitContainer::_notification(int p_what) { } } -void SplitContainer::_input_event(const InputEvent& p_event) { +void SplitContainer::_gui_input(const InputEvent& p_event) { if (collapsed || !_getch(0) || !_getch(1) || dragger_visibility!=DRAGGER_VISIBLE) return; @@ -422,21 +422,21 @@ bool SplitContainer::is_collapsed() const { void SplitContainer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_input_event"),&SplitContainer::_input_event); - ObjectTypeDB::bind_method(_MD("set_split_offset","offset"),&SplitContainer::set_split_offset); - ObjectTypeDB::bind_method(_MD("get_split_offset"),&SplitContainer::get_split_offset); + ClassDB::bind_method(_MD("_gui_input"),&SplitContainer::_gui_input); + ClassDB::bind_method(_MD("set_split_offset","offset"),&SplitContainer::set_split_offset); + ClassDB::bind_method(_MD("get_split_offset"),&SplitContainer::get_split_offset); - ObjectTypeDB::bind_method(_MD("set_collapsed","collapsed"),&SplitContainer::set_collapsed); - ObjectTypeDB::bind_method(_MD("is_collapsed"),&SplitContainer::is_collapsed); + ClassDB::bind_method(_MD("set_collapsed","collapsed"),&SplitContainer::set_collapsed); + ClassDB::bind_method(_MD("is_collapsed"),&SplitContainer::is_collapsed); - ObjectTypeDB::bind_method(_MD("set_dragger_visibility","mode"),&SplitContainer::set_dragger_visibility); - ObjectTypeDB::bind_method(_MD("get_dragger_visibility"),&SplitContainer::get_dragger_visibility); + ClassDB::bind_method(_MD("set_dragger_visibility","mode"),&SplitContainer::set_dragger_visibility); + ClassDB::bind_method(_MD("get_dragger_visibility"),&SplitContainer::get_dragger_visibility); ADD_SIGNAL( MethodInfo("dragged",PropertyInfo(Variant::INT,"offset"))); - ADD_PROPERTY( PropertyInfo(Variant::INT,"split/offset"),_SCS("set_split_offset"),_SCS("get_split_offset")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"split/collapsed"),_SCS("set_collapsed"),_SCS("is_collapsed")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"split/dragger_visibility",PROPERTY_HINT_ENUM,"Visible,Hidden,Hidden & Collapsed"),_SCS("set_dragger_visibility"),_SCS("get_dragger_visibility")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"split_offset"),_SCS("set_split_offset"),_SCS("get_split_offset")); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"collapsed"),_SCS("set_collapsed"),_SCS("is_collapsed")); + ADD_PROPERTY( PropertyInfo(Variant::INT,"dragger_visibility",PROPERTY_HINT_ENUM,"Visible,Hidden,Hidden & Collapsed"),_SCS("set_dragger_visibility"),_SCS("get_dragger_visibility")); BIND_CONSTANT( DRAGGER_VISIBLE ); BIND_CONSTANT( DRAGGER_HIDDEN ); diff --git a/scene/gui/split_container.h b/scene/gui/split_container.h index d2dc42165e..03b6b1a167 100644 --- a/scene/gui/split_container.h +++ b/scene/gui/split_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class SplitContainer : public Container { - OBJ_TYPE(SplitContainer,Container); + GDCLASS(SplitContainer,Container); public: enum DraggerVisibility { DRAGGER_VISIBLE, @@ -59,7 +59,7 @@ private: protected: - void _input_event(const InputEvent& p_event); + void _gui_input(const InputEvent& p_event); void _notification(int p_what); static void _bind_methods(); public: @@ -86,7 +86,7 @@ VARIANT_ENUM_CAST(SplitContainer::DraggerVisibility); class HSplitContainer : public SplitContainer { - OBJ_TYPE(HSplitContainer,SplitContainer); + GDCLASS(HSplitContainer,SplitContainer); public: @@ -96,7 +96,7 @@ public: class VSplitContainer : public SplitContainer { - OBJ_TYPE(VSplitContainer,SplitContainer); + GDCLASS(VSplitContainer,SplitContainer); public: diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 8557500488..11045eaafd 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -65,7 +65,7 @@ int TabContainer::_get_top_margin() const { -void TabContainer::_input_event(const InputEvent& p_event) { +void TabContainer::_gui_input(const InputEvent& p_event) { if (p_event.type==InputEvent::MOUSE_BUTTON && p_event.mouse_button.pressed && @@ -714,24 +714,24 @@ Popup* TabContainer::get_popup() const { void TabContainer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_input_event"),&TabContainer::_input_event); - ObjectTypeDB::bind_method(_MD("get_tab_count"),&TabContainer::get_tab_count); - ObjectTypeDB::bind_method(_MD("set_current_tab","tab_idx"),&TabContainer::set_current_tab); - ObjectTypeDB::bind_method(_MD("get_current_tab"),&TabContainer::get_current_tab); - ObjectTypeDB::bind_method(_MD("get_current_tab_control:Control"),&TabContainer::get_current_tab_control); - ObjectTypeDB::bind_method(_MD("get_tab_control:Control","idx"),&TabContainer::get_tab_control); - ObjectTypeDB::bind_method(_MD("set_tab_align","align"),&TabContainer::set_tab_align); - ObjectTypeDB::bind_method(_MD("get_tab_align"),&TabContainer::get_tab_align); - ObjectTypeDB::bind_method(_MD("set_tabs_visible","visible"),&TabContainer::set_tabs_visible); - ObjectTypeDB::bind_method(_MD("are_tabs_visible"),&TabContainer::are_tabs_visible); - ObjectTypeDB::bind_method(_MD("set_tab_title","tab_idx","title"),&TabContainer::set_tab_title); - ObjectTypeDB::bind_method(_MD("get_tab_title","tab_idx"),&TabContainer::get_tab_title); - ObjectTypeDB::bind_method(_MD("set_tab_icon","tab_idx","icon:Texture"),&TabContainer::set_tab_icon); - ObjectTypeDB::bind_method(_MD("get_tab_icon:Texture","tab_idx"),&TabContainer::get_tab_icon); - ObjectTypeDB::bind_method(_MD("set_popup","popup:Popup"),&TabContainer::set_popup); - ObjectTypeDB::bind_method(_MD("get_popup:Popup"),&TabContainer::get_popup); - - ObjectTypeDB::bind_method(_MD("_child_renamed_callback"),&TabContainer::_child_renamed_callback); + ClassDB::bind_method(_MD("_gui_input"),&TabContainer::_gui_input); + ClassDB::bind_method(_MD("get_tab_count"),&TabContainer::get_tab_count); + ClassDB::bind_method(_MD("set_current_tab","tab_idx"),&TabContainer::set_current_tab); + ClassDB::bind_method(_MD("get_current_tab"),&TabContainer::get_current_tab); + ClassDB::bind_method(_MD("get_current_tab_control:Control"),&TabContainer::get_current_tab_control); + ClassDB::bind_method(_MD("get_tab_control:Control","idx"),&TabContainer::get_tab_control); + ClassDB::bind_method(_MD("set_tab_align","align"),&TabContainer::set_tab_align); + ClassDB::bind_method(_MD("get_tab_align"),&TabContainer::get_tab_align); + ClassDB::bind_method(_MD("set_tabs_visible","visible"),&TabContainer::set_tabs_visible); + ClassDB::bind_method(_MD("are_tabs_visible"),&TabContainer::are_tabs_visible); + ClassDB::bind_method(_MD("set_tab_title","tab_idx","title"),&TabContainer::set_tab_title); + ClassDB::bind_method(_MD("get_tab_title","tab_idx"),&TabContainer::get_tab_title); + ClassDB::bind_method(_MD("set_tab_icon","tab_idx","icon:Texture"),&TabContainer::set_tab_icon); + ClassDB::bind_method(_MD("get_tab_icon:Texture","tab_idx"),&TabContainer::get_tab_icon); + ClassDB::bind_method(_MD("set_popup","popup:Popup"),&TabContainer::set_popup); + ClassDB::bind_method(_MD("get_popup:Popup"),&TabContainer::get_popup); + + ClassDB::bind_method(_MD("_child_renamed_callback"),&TabContainer::_child_renamed_callback); ADD_SIGNAL(MethodInfo("tab_changed",PropertyInfo(Variant::INT,"tab"))); ADD_SIGNAL(MethodInfo("pre_popup_pressed")); diff --git a/scene/gui/tab_container.h b/scene/gui/tab_container.h index 979ce927a0..8b6ca7704e 100644 --- a/scene/gui/tab_container.h +++ b/scene/gui/tab_container.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ #include "scene/gui/popup.h" class TabContainer : public Control { - OBJ_TYPE( TabContainer, Control ); + GDCLASS( TabContainer, Control ); public: enum TabAlign { @@ -61,7 +61,7 @@ private: protected: void _child_renamed_callback(); - void _input_event(const InputEvent& p_event); + void _gui_input(const InputEvent& p_event); void _notification(int p_what); virtual void add_child_notify(Node *p_child); virtual void remove_child_notify(Node *p_child); diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp index eb060aa6b8..98d3f6230d 100644 --- a/scene/gui/tabs.cpp +++ b/scene/gui/tabs.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -76,7 +76,7 @@ Size2 Tabs::get_minimum_size() const { } -void Tabs::_input_event(const InputEvent& p_event) { +void Tabs::_gui_input(const InputEvent& p_event) { if (p_event.type==InputEvent::MOUSE_MOTION) { @@ -649,19 +649,19 @@ void Tabs::set_tab_close_display_policy(CloseButtonDisplayPolicy p_policy) { void Tabs::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_input_event"),&Tabs::_input_event); - ObjectTypeDB::bind_method(_MD("get_tab_count"),&Tabs::get_tab_count); - ObjectTypeDB::bind_method(_MD("set_current_tab","tab_idx"),&Tabs::set_current_tab); - ObjectTypeDB::bind_method(_MD("get_current_tab"),&Tabs::get_current_tab); - ObjectTypeDB::bind_method(_MD("set_tab_title","tab_idx","title"),&Tabs::set_tab_title); - ObjectTypeDB::bind_method(_MD("get_tab_title","tab_idx"),&Tabs::get_tab_title); - ObjectTypeDB::bind_method(_MD("set_tab_icon","tab_idx","icon:Texture"),&Tabs::set_tab_icon); - ObjectTypeDB::bind_method(_MD("get_tab_icon:Texture","tab_idx"),&Tabs::get_tab_icon); - ObjectTypeDB::bind_method(_MD("remove_tab","tab_idx"),&Tabs::remove_tab); - ObjectTypeDB::bind_method(_MD("add_tab","title","icon:Texture"),&Tabs::add_tab); - ObjectTypeDB::bind_method(_MD("set_tab_align","align"),&Tabs::set_tab_align); - ObjectTypeDB::bind_method(_MD("get_tab_align"),&Tabs::get_tab_align); - ObjectTypeDB::bind_method(_MD("ensure_tab_visible","idx"),&Tabs::ensure_tab_visible); + ClassDB::bind_method(_MD("_gui_input"),&Tabs::_gui_input); + ClassDB::bind_method(_MD("get_tab_count"),&Tabs::get_tab_count); + ClassDB::bind_method(_MD("set_current_tab","tab_idx"),&Tabs::set_current_tab); + ClassDB::bind_method(_MD("get_current_tab"),&Tabs::get_current_tab); + ClassDB::bind_method(_MD("set_tab_title","tab_idx","title"),&Tabs::set_tab_title); + ClassDB::bind_method(_MD("get_tab_title","tab_idx"),&Tabs::get_tab_title); + ClassDB::bind_method(_MD("set_tab_icon","tab_idx","icon:Texture"),&Tabs::set_tab_icon); + ClassDB::bind_method(_MD("get_tab_icon:Texture","tab_idx"),&Tabs::get_tab_icon); + ClassDB::bind_method(_MD("remove_tab","tab_idx"),&Tabs::remove_tab); + ClassDB::bind_method(_MD("add_tab","title","icon:Texture"),&Tabs::add_tab); + ClassDB::bind_method(_MD("set_tab_align","align"),&Tabs::set_tab_align); + ClassDB::bind_method(_MD("get_tab_align"),&Tabs::get_tab_align); + ClassDB::bind_method(_MD("ensure_tab_visible","idx"),&Tabs::ensure_tab_visible); ADD_SIGNAL(MethodInfo("tab_changed",PropertyInfo(Variant::INT,"tab"))); ADD_SIGNAL(MethodInfo("right_button_pressed",PropertyInfo(Variant::INT,"tab"))); diff --git a/scene/gui/tabs.h b/scene/gui/tabs.h index 5a4533c3d2..9ba32297dc 100644 --- a/scene/gui/tabs.h +++ b/scene/gui/tabs.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class Tabs : public Control { - OBJ_TYPE( Tabs, Control ); + GDCLASS( Tabs, Control ); public: enum TabAlign { @@ -92,7 +92,7 @@ private: protected: - void _input_event(const InputEvent& p_event); + void _gui_input(const InputEvent& p_event); void _notification(int p_what); static void _bind_methods(); diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 871a3ca68f..cbc0c283de 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -347,7 +347,7 @@ void TextEdit::_update_scrollbars() { v_scroll->show(); v_scroll->set_max(total_rows); v_scroll->set_page(visible_rows); - v_scroll->set_val(cursor.line_ofs); + v_scroll->set_value(cursor.line_ofs); } else { cursor.line_ofs = 0; @@ -359,7 +359,7 @@ void TextEdit::_update_scrollbars() { h_scroll->show(); h_scroll->set_max(total_width); h_scroll->set_page(visible_width); - h_scroll->set_val(cursor.x_ofs); + h_scroll->set_value(cursor.x_ofs); } else { @@ -1468,13 +1468,13 @@ void TextEdit::_get_mouse_pos(const Point2i& p_mouse, int &r_row, int &r_col) co r_col=col; } -void TextEdit::_input_event(const InputEvent& p_input_event) { +void TextEdit::_gui_input(const InputEvent& p_gui_input) { - switch(p_input_event.type) { + switch(p_gui_input.type) { case InputEvent::MOUSE_BUTTON: { - const InputEventMouseButton &mb=p_input_event.mouse_button; + const InputEventMouseButton &mb=p_gui_input.mouse_button; if (completion_active && completion_rect.has_point(Point2(mb.x,mb.y))) { @@ -1515,16 +1515,16 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { if (mb.pressed) { if (mb.button_index==BUTTON_WHEEL_UP && !mb.mod.command) { - v_scroll->set_val( v_scroll->get_val() -3 ); + v_scroll->set_value( v_scroll->get_value() -3 ); } if (mb.button_index==BUTTON_WHEEL_DOWN && !mb.mod.command) { - v_scroll->set_val( v_scroll->get_val() +3 ); + v_scroll->set_value( v_scroll->get_value() +3 ); } if (mb.button_index==BUTTON_WHEEL_LEFT) { - h_scroll->set_val( h_scroll->get_val() -3 ); + h_scroll->set_value( h_scroll->get_value() -3 ); } if (mb.button_index==BUTTON_WHEEL_RIGHT) { - h_scroll->set_val( h_scroll->get_val() +3 ); + h_scroll->set_value( h_scroll->get_value() +3 ); } if (mb.button_index==BUTTON_LEFT) { @@ -1685,7 +1685,7 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { } break; case InputEvent::MOUSE_MOTION: { - const InputEventMouseMotion &mm=p_input_event.mouse_motion; + const InputEventMouseMotion &mm=p_gui_input.mouse_motion; if (select_identifiers_enabled) { if (mm.mod.command && mm.button_mask==0) { @@ -1728,7 +1728,7 @@ void TextEdit::_input_event(const InputEvent& p_input_event) { case InputEvent::KEY: { - InputEventKey k=p_input_event.key; + InputEventKey k=p_gui_input.key; #ifdef OSX_ENABLED @@ -3206,9 +3206,9 @@ void TextEdit::_scroll_moved(double p_to_val) { return; if (h_scroll->is_visible()) - cursor.x_ofs=h_scroll->get_val(); + cursor.x_ofs=h_scroll->get_value(); if (v_scroll->is_visible()) - cursor.line_ofs=v_scroll->get_val(); + cursor.line_ofs=v_scroll->get_value(); update(); } @@ -3327,7 +3327,7 @@ void TextEdit::set_text(String p_text){ cursor_set_column(0); update(); setting_text=false; - + _text_changed_emit(); //get_range()->set(0); }; @@ -3783,7 +3783,7 @@ int TextEdit::_get_column_pos_of_word(const String &p_key, const String &p_searc if (col > 0 && _is_text_char(p_search[col-1])) { col = -1; - } else if (_is_text_char(p_search[col+p_key.length()])) { + } else if ((col + p_key.length()) < p_search.length() && _is_text_char(p_search[col+p_key.length()])) { col = -1; } } @@ -3794,11 +3794,11 @@ int TextEdit::_get_column_pos_of_word(const String &p_key, const String &p_searc return col; } -DVector<int> TextEdit::_search_bind(const String &p_key,uint32_t p_search_flags, int p_from_line,int p_from_column) const { +PoolVector<int> TextEdit::_search_bind(const String &p_key,uint32_t p_search_flags, int p_from_line,int p_from_column) const { int col,line; if (search(p_key,p_search_flags,p_from_line,p_from_column,col,line)) { - DVector<int> result; + PoolVector<int> result; result.resize(2); result.set(0,line); result.set(1,col); @@ -3806,7 +3806,7 @@ DVector<int> TextEdit::_search_bind(const String &p_key,uint32_t p_search_flags, } else { - return DVector<int>(); + return PoolVector<int>(); } } @@ -4155,21 +4155,21 @@ void TextEdit::tag_saved_version() { int TextEdit::get_v_scroll() const { - return v_scroll->get_val(); + return v_scroll->get_value(); } void TextEdit::set_v_scroll(int p_scroll) { - v_scroll->set_val(p_scroll); + v_scroll->set_value(p_scroll); cursor.line_ofs=p_scroll; } int TextEdit::get_h_scroll() const { - return h_scroll->get_val(); + return h_scroll->get_value(); } void TextEdit::set_h_scroll(int p_scroll) { - h_scroll->set_val(p_scroll); + h_scroll->set_value(p_scroll); } void TextEdit::set_completion(bool p_enabled,const Vector<String>& p_prefixes) { @@ -4230,7 +4230,6 @@ void TextEdit::_update_completion_candidates() { String l = text[cursor.line]; int cofs = CLAMP(cursor.column,0,l.length()); - String s; //look for keywords first @@ -4279,14 +4278,14 @@ void TextEdit::_update_completion_candidates() { while(cofs>0 && l[cofs-1]>32 && _is_completable(l[cofs-1])) { s=String::chr(l[cofs-1])+s; - if (l[cofs-1]=='\'' || l[cofs-1]=='"') + if (l[cofs-1]=='\'' || l[cofs-1]=='"' || l[cofs-1]=='$') break; cofs--; } } - if (cursor.column > 0 && l[cursor.column - 1] == '(' && !pre_keyword && !completion_strings[0].begins_with("\"")) { + if (cursor.column > 0 && l[cursor.column - 1] == '(' && !pre_keyword && !completion_strings[0].begins_with("\"")) { cancel = true; } @@ -4308,8 +4307,9 @@ void TextEdit::_update_completion_candidates() { _cancel_completion(); return; } + if (s.is_subsequence_ofi(completion_strings[i])) { - // don't remove duplicates if no input is provided + // don't remove duplicates if no input is provided if (s != "" && completion_options.find(completion_strings[i]) != -1) { continue; } @@ -4345,6 +4345,7 @@ void TextEdit::_update_completion_candidates() { if (completion_options.size()==0) { //no options to complete, cancel _cancel_completion(); + return; } @@ -4607,88 +4608,90 @@ PopupMenu *TextEdit::get_menu() const { void TextEdit::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_input_event"),&TextEdit::_input_event); - ObjectTypeDB::bind_method(_MD("_scroll_moved"),&TextEdit::_scroll_moved); - ObjectTypeDB::bind_method(_MD("_cursor_changed_emit"),&TextEdit::_cursor_changed_emit); - ObjectTypeDB::bind_method(_MD("_text_changed_emit"),&TextEdit::_text_changed_emit); - ObjectTypeDB::bind_method(_MD("_push_current_op"),&TextEdit::_push_current_op); - ObjectTypeDB::bind_method(_MD("_click_selection_held"),&TextEdit::_click_selection_held); - ObjectTypeDB::bind_method(_MD("_toggle_draw_caret"),&TextEdit::_toggle_draw_caret); + ClassDB::bind_method(_MD("_gui_input"),&TextEdit::_gui_input); + ClassDB::bind_method(_MD("_scroll_moved"),&TextEdit::_scroll_moved); + ClassDB::bind_method(_MD("_cursor_changed_emit"),&TextEdit::_cursor_changed_emit); + ClassDB::bind_method(_MD("_text_changed_emit"),&TextEdit::_text_changed_emit); + ClassDB::bind_method(_MD("_push_current_op"),&TextEdit::_push_current_op); + ClassDB::bind_method(_MD("_click_selection_held"),&TextEdit::_click_selection_held); + ClassDB::bind_method(_MD("_toggle_draw_caret"),&TextEdit::_toggle_draw_caret); BIND_CONSTANT( SEARCH_MATCH_CASE ); BIND_CONSTANT( SEARCH_WHOLE_WORDS ); BIND_CONSTANT( SEARCH_BACKWARDS ); /* - ObjectTypeDB::bind_method(_MD("delete_char"),&TextEdit::delete_char); - ObjectTypeDB::bind_method(_MD("delete_line"),&TextEdit::delete_line); + ClassDB::bind_method(_MD("delete_char"),&TextEdit::delete_char); + ClassDB::bind_method(_MD("delete_line"),&TextEdit::delete_line); */ - ObjectTypeDB::bind_method(_MD("set_text","text"),&TextEdit::set_text); - ObjectTypeDB::bind_method(_MD("insert_text_at_cursor","text"),&TextEdit::insert_text_at_cursor); + ClassDB::bind_method(_MD("set_text","text"),&TextEdit::set_text); + ClassDB::bind_method(_MD("insert_text_at_cursor","text"),&TextEdit::insert_text_at_cursor); - ObjectTypeDB::bind_method(_MD("get_line_count"),&TextEdit::get_line_count); - ObjectTypeDB::bind_method(_MD("get_text"),&TextEdit::get_text); - ObjectTypeDB::bind_method(_MD("get_line","line"),&TextEdit::get_line); + ClassDB::bind_method(_MD("get_line_count"),&TextEdit::get_line_count); + ClassDB::bind_method(_MD("get_text"),&TextEdit::get_text); + ClassDB::bind_method(_MD("get_line","line"),&TextEdit::get_line); - ObjectTypeDB::bind_method(_MD("cursor_set_column","column","adjust_viewport"),&TextEdit::cursor_set_column,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("cursor_set_line","line","adjust_viewport"),&TextEdit::cursor_set_line,DEFVAL(false)); + ClassDB::bind_method(_MD("cursor_set_column","column","adjust_viewport"),&TextEdit::cursor_set_column,DEFVAL(false)); + ClassDB::bind_method(_MD("cursor_set_line","line","adjust_viewport"),&TextEdit::cursor_set_line,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("cursor_get_column"),&TextEdit::cursor_get_column); - ObjectTypeDB::bind_method(_MD("cursor_get_line"),&TextEdit::cursor_get_line); - ObjectTypeDB::bind_method(_MD("cursor_set_blink_enabled", "enable"),&TextEdit::cursor_set_blink_enabled); - ObjectTypeDB::bind_method(_MD("cursor_get_blink_enabled"),&TextEdit::cursor_get_blink_enabled); - ObjectTypeDB::bind_method(_MD("cursor_set_blink_speed", "blink_speed"),&TextEdit::cursor_set_blink_speed); - ObjectTypeDB::bind_method(_MD("cursor_get_blink_speed"),&TextEdit::cursor_get_blink_speed); - ObjectTypeDB::bind_method(_MD("cursor_set_block_mode", "enable"), &TextEdit::cursor_set_block_mode); - ObjectTypeDB::bind_method(_MD("cursor_is_block_mode"), &TextEdit::cursor_is_block_mode); + ClassDB::bind_method(_MD("cursor_get_column"),&TextEdit::cursor_get_column); + ClassDB::bind_method(_MD("cursor_get_line"),&TextEdit::cursor_get_line); + ClassDB::bind_method(_MD("cursor_set_blink_enabled", "enable"),&TextEdit::cursor_set_blink_enabled); + ClassDB::bind_method(_MD("cursor_get_blink_enabled"),&TextEdit::cursor_get_blink_enabled); + ClassDB::bind_method(_MD("cursor_set_blink_speed", "blink_speed"),&TextEdit::cursor_set_blink_speed); + ClassDB::bind_method(_MD("cursor_get_blink_speed"),&TextEdit::cursor_get_blink_speed); + ClassDB::bind_method(_MD("cursor_set_block_mode", "enable"), &TextEdit::cursor_set_block_mode); + ClassDB::bind_method(_MD("cursor_is_block_mode"), &TextEdit::cursor_is_block_mode); - ObjectTypeDB::bind_method(_MD("set_readonly","enable"),&TextEdit::set_readonly); - ObjectTypeDB::bind_method(_MD("set_wrap","enable"),&TextEdit::set_wrap); - ObjectTypeDB::bind_method(_MD("set_max_chars","amount"),&TextEdit::set_max_chars); + ClassDB::bind_method(_MD("set_readonly","enable"),&TextEdit::set_readonly); + ClassDB::bind_method(_MD("set_wrap","enable"),&TextEdit::set_wrap); + ClassDB::bind_method(_MD("set_max_chars","amount"),&TextEdit::set_max_chars); - ObjectTypeDB::bind_method(_MD("cut"),&TextEdit::cut); - ObjectTypeDB::bind_method(_MD("copy"),&TextEdit::copy); - ObjectTypeDB::bind_method(_MD("paste"),&TextEdit::paste); - ObjectTypeDB::bind_method(_MD("select_all"),&TextEdit::select_all); - ObjectTypeDB::bind_method(_MD("select","from_line","from_column","to_line","to_column"),&TextEdit::select); + ClassDB::bind_method(_MD("cut"),&TextEdit::cut); + ClassDB::bind_method(_MD("copy"),&TextEdit::copy); + ClassDB::bind_method(_MD("paste"),&TextEdit::paste); + ClassDB::bind_method(_MD("select_all"),&TextEdit::select_all); + ClassDB::bind_method(_MD("select","from_line","from_column","to_line","to_column"),&TextEdit::select); - ObjectTypeDB::bind_method(_MD("is_selection_active"),&TextEdit::is_selection_active); - ObjectTypeDB::bind_method(_MD("get_selection_from_line"),&TextEdit::get_selection_from_line); - ObjectTypeDB::bind_method(_MD("get_selection_from_column"),&TextEdit::get_selection_from_column); - ObjectTypeDB::bind_method(_MD("get_selection_to_line"),&TextEdit::get_selection_to_line); - ObjectTypeDB::bind_method(_MD("get_selection_to_column"),&TextEdit::get_selection_to_column); - ObjectTypeDB::bind_method(_MD("get_selection_text"),&TextEdit::get_selection_text); - ObjectTypeDB::bind_method(_MD("get_word_under_cursor"),&TextEdit::get_word_under_cursor); - ObjectTypeDB::bind_method(_MD("search","flags","from_line","from_column","to_line","to_column"),&TextEdit::_search_bind); + ClassDB::bind_method(_MD("is_selection_active"),&TextEdit::is_selection_active); + ClassDB::bind_method(_MD("get_selection_from_line"),&TextEdit::get_selection_from_line); + ClassDB::bind_method(_MD("get_selection_from_column"),&TextEdit::get_selection_from_column); + ClassDB::bind_method(_MD("get_selection_to_line"),&TextEdit::get_selection_to_line); + ClassDB::bind_method(_MD("get_selection_to_column"),&TextEdit::get_selection_to_column); + ClassDB::bind_method(_MD("get_selection_text"),&TextEdit::get_selection_text); + ClassDB::bind_method(_MD("get_word_under_cursor"),&TextEdit::get_word_under_cursor); + ClassDB::bind_method(_MD("search","flags","from_line","from_column","to_line","to_column"),&TextEdit::_search_bind); - ObjectTypeDB::bind_method(_MD("undo"),&TextEdit::undo); - ObjectTypeDB::bind_method(_MD("redo"),&TextEdit::redo); - ObjectTypeDB::bind_method(_MD("clear_undo_history"),&TextEdit::clear_undo_history); + ClassDB::bind_method(_MD("undo"),&TextEdit::undo); + ClassDB::bind_method(_MD("redo"),&TextEdit::redo); + ClassDB::bind_method(_MD("clear_undo_history"),&TextEdit::clear_undo_history); - ObjectTypeDB::bind_method(_MD("set_show_line_numbers", "enable"), &TextEdit::set_show_line_numbers); - ObjectTypeDB::bind_method(_MD("is_show_line_numbers_enabled"), &TextEdit::is_show_line_numbers_enabled); + ClassDB::bind_method(_MD("set_show_line_numbers", "enable"), &TextEdit::set_show_line_numbers); + ClassDB::bind_method(_MD("is_show_line_numbers_enabled"), &TextEdit::is_show_line_numbers_enabled); - ObjectTypeDB::bind_method(_MD("set_highlight_all_occurrences", "enable"), &TextEdit::set_highlight_all_occurrences); - ObjectTypeDB::bind_method(_MD("is_highlight_all_occurrences_enabled"), &TextEdit::is_highlight_all_occurrences_enabled); + ClassDB::bind_method(_MD("set_highlight_all_occurrences", "enable"), &TextEdit::set_highlight_all_occurrences); + ClassDB::bind_method(_MD("is_highlight_all_occurrences_enabled"), &TextEdit::is_highlight_all_occurrences_enabled); - ObjectTypeDB::bind_method(_MD("set_syntax_coloring","enable"),&TextEdit::set_syntax_coloring); - ObjectTypeDB::bind_method(_MD("is_syntax_coloring_enabled"),&TextEdit::is_syntax_coloring_enabled); + ClassDB::bind_method(_MD("set_syntax_coloring","enable"),&TextEdit::set_syntax_coloring); + ClassDB::bind_method(_MD("is_syntax_coloring_enabled"),&TextEdit::is_syntax_coloring_enabled); - ObjectTypeDB::bind_method(_MD("add_keyword_color","keyword","color"),&TextEdit::add_keyword_color); - ObjectTypeDB::bind_method(_MD("add_color_region","begin_key","end_key","color","line_only"),&TextEdit::add_color_region,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("clear_colors"),&TextEdit::clear_colors); - ObjectTypeDB::bind_method(_MD("menu_option"),&TextEdit::menu_option); - ObjectTypeDB::bind_method(_MD("get_menu:PopupMenu"),&TextEdit::get_menu); + ClassDB::bind_method(_MD("add_keyword_color","keyword","color"),&TextEdit::add_keyword_color); + ClassDB::bind_method(_MD("add_color_region","begin_key","end_key","color","line_only"),&TextEdit::add_color_region,DEFVAL(false)); + ClassDB::bind_method(_MD("clear_colors"),&TextEdit::clear_colors); + ClassDB::bind_method(_MD("menu_option"),&TextEdit::menu_option); + ClassDB::bind_method(_MD("get_menu:PopupMenu"),&TextEdit::get_menu); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "syntax_highlighting"), _SCS("set_syntax_coloring"), _SCS("is_syntax_coloring_enabled")); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "show_line_numbers"), _SCS("set_show_line_numbers"), _SCS("is_show_line_numbers_enabled")); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "highlight_all_occurrences"), _SCS("set_highlight_all_occurrences"), _SCS("is_highlight_all_occurrences_enabled")); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret/block_caret"), _SCS("cursor_set_block_mode"), _SCS("cursor_is_block_mode")); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret/caret_blink"), _SCS("cursor_set_blink_enabled"), _SCS("cursor_get_blink_enabled")); - ADD_PROPERTYNZ(PropertyInfo(Variant::REAL, "caret/caret_blink_speed",PROPERTY_HINT_RANGE,"0.1,10,0.1"), _SCS("cursor_set_blink_speed"),_SCS("cursor_get_blink_speed") ); + + ADD_GROUP("Caret","caret_"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret_block_mode"), _SCS("cursor_set_block_mode"), _SCS("cursor_is_block_mode")); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret_blink"), _SCS("cursor_set_blink_enabled"), _SCS("cursor_get_blink_enabled")); + ADD_PROPERTYNZ(PropertyInfo(Variant::REAL, "caret_blink_speed",PROPERTY_HINT_RANGE,"0.1,10,0.1"), _SCS("cursor_set_blink_speed"),_SCS("cursor_get_blink_speed") ); ADD_SIGNAL(MethodInfo("cursor_changed")); ADD_SIGNAL(MethodInfo("text_changed")); @@ -4705,6 +4708,7 @@ void TextEdit::_bind_methods() { BIND_CONSTANT( MENU_MAX ); + GLOBAL_DEF("gui/timers/text_edit_idle_detect_sec",3); } TextEdit::TextEdit() { @@ -4765,7 +4769,7 @@ TextEdit::TextEdit() { idle_detect = memnew( Timer ); add_child(idle_detect); idle_detect->set_one_shot(true); - idle_detect->set_wait_time(GLOBAL_DEF("display/text_edit_idle_detect_sec",3)); + idle_detect->set_wait_time(GLOBAL_GET("gui/timers/text_edit_idle_detect_sec")); idle_detect->connect("timeout", this,"_push_current_op"); click_select_held = memnew( Timer ); @@ -4832,7 +4836,7 @@ TextEdit::TextEdit() { menu->add_item(TTR("Clear"),MENU_CLEAR); menu->add_separator(); menu->add_item(TTR("Undo"),MENU_UNDO,KEY_MASK_CMD|KEY_Z); - menu->connect("item_pressed",this,"menu_option"); + menu->connect("id_pressed",this,"menu_option"); } diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 4cf096b7bf..c7467f9b13 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ class TextEdit : public Control { - OBJ_TYPE( TextEdit, Control ); + GDCLASS( TextEdit, Control ); struct Cursor { int last_fit_x; @@ -316,7 +316,7 @@ class TextEdit : public Control { int _get_column_pos_of_word(const String &p_key, const String &p_search, uint32_t p_search_flags, int p_from_column); - DVector<int> _search_bind(const String &p_key,uint32_t p_search_flags, int p_from_line,int p_from_column) const; + PoolVector<int> _search_bind(const String &p_key,uint32_t p_search_flags, int p_from_line,int p_from_column) const; PopupMenu *menu; @@ -333,7 +333,7 @@ protected: void _insert_text(int p_line, int p_column,const String& p_text,int *r_end_line=NULL,int *r_end_char=NULL); void _remove_text(int p_from_line, int p_from_column,int p_to_line,int p_to_column); void _insert_text_at_cursor(const String& p_text); - void _input_event(const InputEvent& p_input); + void _gui_input(const InputEvent& p_input); void _notification(int p_what); void _consume_pair_symbol(CharType ch); diff --git a/scene/gui/texture_button.cpp b/scene/gui/texture_button.cpp index df2f5edd48..83cd853572 100644 --- a/scene/gui/texture_button.cpp +++ b/scene/gui/texture_button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -136,32 +136,32 @@ void TextureButton::_notification(int p_what) { void TextureButton::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_normal_texture","texture:Texture"),&TextureButton::set_normal_texture); - ObjectTypeDB::bind_method(_MD("set_pressed_texture","texture:Texture"),&TextureButton::set_pressed_texture); - ObjectTypeDB::bind_method(_MD("set_hover_texture","texture:Texture"),&TextureButton::set_hover_texture); - ObjectTypeDB::bind_method(_MD("set_disabled_texture","texture:Texture"),&TextureButton::set_disabled_texture); - ObjectTypeDB::bind_method(_MD("set_focused_texture","texture:Texture"),&TextureButton::set_focused_texture); - ObjectTypeDB::bind_method(_MD("set_click_mask","mask:BitMap"),&TextureButton::set_click_mask); - ObjectTypeDB::bind_method(_MD("set_texture_scale","scale"),&TextureButton::set_texture_scale); - ObjectTypeDB::bind_method(_MD("set_modulate","color"),&TextureButton::set_modulate); - - ObjectTypeDB::bind_method(_MD("get_normal_texture:Texture"),&TextureButton::get_normal_texture); - ObjectTypeDB::bind_method(_MD("get_pressed_texture:Texture"),&TextureButton::get_pressed_texture); - ObjectTypeDB::bind_method(_MD("get_hover_texture:Texture"),&TextureButton::get_hover_texture); - ObjectTypeDB::bind_method(_MD("get_disabled_texture:Texture"),&TextureButton::get_disabled_texture); - ObjectTypeDB::bind_method(_MD("get_focused_texture:Texture"),&TextureButton::get_focused_texture); - ObjectTypeDB::bind_method(_MD("get_click_mask:BitMap"),&TextureButton::get_click_mask); - ObjectTypeDB::bind_method(_MD("get_texture_scale"),&TextureButton::get_texture_scale); - ObjectTypeDB::bind_method(_MD("get_modulate"),&TextureButton::get_modulate); - - ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"textures/normal",PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_normal_texture"), _SCS("get_normal_texture")); - ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"textures/pressed",PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_pressed_texture"), _SCS("get_pressed_texture")); - ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"textures/hover",PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_hover_texture"), _SCS("get_hover_texture")); - ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"textures/disabled",PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_disabled_texture"), _SCS("get_disabled_texture")); - ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"textures/focused",PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_focused_texture"), _SCS("get_focused_texture")); - ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"textures/click_mask",PROPERTY_HINT_RESOURCE_TYPE,"BitMap"), _SCS("set_click_mask"), _SCS("get_click_mask")) ; - ADD_PROPERTYNO(PropertyInfo(Variant::VECTOR2,"params/scale",PROPERTY_HINT_RANGE,"0.01,1024,0.01"), _SCS("set_texture_scale"), _SCS("get_texture_scale")); - ADD_PROPERTYNO(PropertyInfo(Variant::COLOR,"params/modulate"), _SCS("set_modulate"), _SCS("get_modulate")); + ClassDB::bind_method(_MD("set_normal_texture","texture:Texture"),&TextureButton::set_normal_texture); + ClassDB::bind_method(_MD("set_pressed_texture","texture:Texture"),&TextureButton::set_pressed_texture); + ClassDB::bind_method(_MD("set_hover_texture","texture:Texture"),&TextureButton::set_hover_texture); + ClassDB::bind_method(_MD("set_disabled_texture","texture:Texture"),&TextureButton::set_disabled_texture); + ClassDB::bind_method(_MD("set_focused_texture","texture:Texture"),&TextureButton::set_focused_texture); + ClassDB::bind_method(_MD("set_click_mask","mask:BitMap"),&TextureButton::set_click_mask); + ClassDB::bind_method(_MD("set_texture_scale","scale"),&TextureButton::set_texture_scale); + ClassDB::bind_method(_MD("set_modulate","color"),&TextureButton::set_modulate); + + ClassDB::bind_method(_MD("get_normal_texture:Texture"),&TextureButton::get_normal_texture); + ClassDB::bind_method(_MD("get_pressed_texture:Texture"),&TextureButton::get_pressed_texture); + ClassDB::bind_method(_MD("get_hover_texture:Texture"),&TextureButton::get_hover_texture); + ClassDB::bind_method(_MD("get_disabled_texture:Texture"),&TextureButton::get_disabled_texture); + ClassDB::bind_method(_MD("get_focused_texture:Texture"),&TextureButton::get_focused_texture); + ClassDB::bind_method(_MD("get_click_mask:BitMap"),&TextureButton::get_click_mask); + ClassDB::bind_method(_MD("get_texture_scale"),&TextureButton::get_texture_scale); + ClassDB::bind_method(_MD("get_modulate"),&TextureButton::get_modulate); + + ADD_GROUP("Textures","texture_"); + ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"texture_normal",PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_normal_texture"), _SCS("get_normal_texture")); + ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"texture_pressed",PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_pressed_texture"), _SCS("get_pressed_texture")); + ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"texture_hover",PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_hover_texture"), _SCS("get_hover_texture")); + ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"texture_disabled",PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_disabled_texture"), _SCS("get_disabled_texture")); + ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"texture_focused",PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_focused_texture"), _SCS("get_focused_texture")); + ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT,"texture_click_mask",PROPERTY_HINT_RESOURCE_TYPE,"BitMap"), _SCS("set_click_mask"), _SCS("get_click_mask")) ; + ADD_PROPERTYNO(PropertyInfo(Variant::VECTOR2,"texture_scale",PROPERTY_HINT_RANGE,"0.01,1024,0.01"), _SCS("set_texture_scale"), _SCS("get_texture_scale")); } diff --git a/scene/gui/texture_button.h b/scene/gui/texture_button.h index 0556df8061..b6cb531c71 100644 --- a/scene/gui/texture_button.h +++ b/scene/gui/texture_button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ #include "scene/resources/bit_mask.h" class TextureButton : public BaseButton { - OBJ_TYPE( TextureButton, BaseButton ); + GDCLASS( TextureButton, BaseButton ); Ref<Texture> normal; Ref<Texture> pressed; diff --git a/scene/gui/texture_frame.cpp b/scene/gui/texture_frame.cpp index 4aa45af863..bfa72ef067 100644 --- a/scene/gui/texture_frame.cpp +++ b/scene/gui/texture_frame.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -40,22 +40,22 @@ void TextureFrame::_notification(int p_what) { switch(stretch_mode) { case STRETCH_SCALE_ON_EXPAND: { Size2 s=expand?get_size():texture->get_size(); - draw_texture_rect(texture,Rect2(Point2(),s),false,modulate); + draw_texture_rect(texture,Rect2(Point2(),s),false); } break; case STRETCH_SCALE: { - draw_texture_rect(texture,Rect2(Point2(),get_size()),false,modulate); + draw_texture_rect(texture,Rect2(Point2(),get_size()),false); } break; case STRETCH_TILE: { - draw_texture_rect(texture,Rect2(Point2(),get_size()),true,modulate); + draw_texture_rect(texture,Rect2(Point2(),get_size()),true); } break; case STRETCH_KEEP: { - draw_texture_rect(texture,Rect2(Point2(),texture->get_size()),false,modulate); + draw_texture_rect(texture,Rect2(Point2(),texture->get_size()),false); } break; case STRETCH_KEEP_CENTERED: { Vector2 ofs = (get_size() - texture->get_size())/2; - draw_texture_rect(texture,Rect2(ofs,texture->get_size()),false,modulate); + draw_texture_rect(texture,Rect2(ofs,texture->get_size()),false); } break; case STRETCH_KEEP_ASPECT_CENTERED: case STRETCH_KEEP_ASPECT: { @@ -95,17 +95,14 @@ Size2 TextureFrame::get_minimum_size() const { void TextureFrame::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_texture","texture"), & TextureFrame::set_texture ); - ObjectTypeDB::bind_method(_MD("get_texture"), & TextureFrame::get_texture ); - ObjectTypeDB::bind_method(_MD("set_modulate","modulate"), & TextureFrame::set_modulate ); - ObjectTypeDB::bind_method(_MD("get_modulate"), & TextureFrame::get_modulate ); - ObjectTypeDB::bind_method(_MD("set_expand","enable"), & TextureFrame::set_expand ); - ObjectTypeDB::bind_method(_MD("has_expand"), & TextureFrame::has_expand ); - ObjectTypeDB::bind_method(_MD("set_stretch_mode","stretch_mode"), & TextureFrame::set_stretch_mode ); - ObjectTypeDB::bind_method(_MD("get_stretch_mode"), & TextureFrame::get_stretch_mode ); + ClassDB::bind_method(_MD("set_texture","texture"), & TextureFrame::set_texture ); + ClassDB::bind_method(_MD("get_texture"), & TextureFrame::get_texture ); + ClassDB::bind_method(_MD("set_expand","enable"), & TextureFrame::set_expand ); + ClassDB::bind_method(_MD("has_expand"), & TextureFrame::has_expand ); + ClassDB::bind_method(_MD("set_stretch_mode","stretch_mode"), & TextureFrame::set_stretch_mode ); + ClassDB::bind_method(_MD("get_stretch_mode"), & TextureFrame::get_stretch_mode ); ADD_PROPERTYNZ( PropertyInfo( Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), _SCS("set_texture"),_SCS("get_texture") ); - ADD_PROPERTYNO( PropertyInfo( Variant::COLOR, "modulate"), _SCS("set_modulate"),_SCS("get_modulate") ); ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "expand" ), _SCS("set_expand"),_SCS("has_expand") ); ADD_PROPERTYNO( PropertyInfo( Variant::INT, "stretch_mode",PROPERTY_HINT_ENUM,"Scale On Expand (Compat),Scale,Tile,Keep,Keep Centered,Keep Aspect,Keep Aspect Centered"), _SCS("set_stretch_mode"),_SCS("get_stretch_mode") ); @@ -134,17 +131,6 @@ Ref<Texture> TextureFrame::get_texture() const { return texture; } -void TextureFrame::set_modulate(const Color& p_tex) { - - modulate=p_tex; - update(); -} - -Color TextureFrame::get_modulate() const{ - - return modulate; -} - void TextureFrame::set_expand(bool p_expand) { @@ -172,8 +158,7 @@ TextureFrame::TextureFrame() { expand=false; - modulate=Color(1,1,1,1); - set_ignore_mouse(true); + set_mouse_filter(MOUSE_FILTER_IGNORE); stretch_mode=STRETCH_SCALE_ON_EXPAND; } diff --git a/scene/gui/texture_frame.h b/scene/gui/texture_frame.h index 0b47202532..c311748708 100644 --- a/scene/gui/texture_frame.h +++ b/scene/gui/texture_frame.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ */ class TextureFrame : public Control { - OBJ_TYPE(TextureFrame,Control); + GDCLASS(TextureFrame,Control); public: enum StretchMode { STRETCH_SCALE_ON_EXPAND, //default, for backwards compatibility @@ -49,7 +49,6 @@ public: }; private: bool expand; - Color modulate; Ref<Texture> texture; StretchMode stretch_mode; protected: @@ -63,8 +62,6 @@ public: void set_texture(const Ref<Texture>& p_tex); Ref<Texture> get_texture() const; - void set_modulate(const Color& p_tex); - Color get_modulate() const; void set_expand(bool p_expand); bool has_expand() const; diff --git a/scene/gui/texture_progress.cpp b/scene/gui/texture_progress.cpp index 2c576b6ba5..df0512fc96 100644 --- a/scene/gui/texture_progress.cpp +++ b/scene/gui/texture_progress.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -255,34 +255,36 @@ Point2 TextureProgress::get_radial_center_offset() void TextureProgress::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_under_texture","tex"),&TextureProgress::set_under_texture); - ObjectTypeDB::bind_method(_MD("get_under_texture"),&TextureProgress::get_under_texture); + ClassDB::bind_method(_MD("set_under_texture","tex"),&TextureProgress::set_under_texture); + ClassDB::bind_method(_MD("get_under_texture"),&TextureProgress::get_under_texture); - ObjectTypeDB::bind_method(_MD("set_progress_texture","tex"),&TextureProgress::set_progress_texture); - ObjectTypeDB::bind_method(_MD("get_progress_texture"),&TextureProgress::get_progress_texture); + ClassDB::bind_method(_MD("set_progress_texture","tex"),&TextureProgress::set_progress_texture); + ClassDB::bind_method(_MD("get_progress_texture"),&TextureProgress::get_progress_texture); - ObjectTypeDB::bind_method(_MD("set_over_texture","tex"),&TextureProgress::set_over_texture); - ObjectTypeDB::bind_method(_MD("get_over_texture"),&TextureProgress::get_over_texture); + ClassDB::bind_method(_MD("set_over_texture","tex"),&TextureProgress::set_over_texture); + ClassDB::bind_method(_MD("get_over_texture"),&TextureProgress::get_over_texture); - ObjectTypeDB::bind_method(_MD("set_fill_mode","mode"),&TextureProgress::set_fill_mode); - ObjectTypeDB::bind_method(_MD("get_fill_mode"), &TextureProgress::get_fill_mode); + ClassDB::bind_method(_MD("set_fill_mode","mode"),&TextureProgress::set_fill_mode); + ClassDB::bind_method(_MD("get_fill_mode"), &TextureProgress::get_fill_mode); - ObjectTypeDB::bind_method(_MD("set_radial_initial_angle","mode"),&TextureProgress::set_radial_initial_angle); - ObjectTypeDB::bind_method(_MD("get_radial_initial_angle"), &TextureProgress::get_radial_initial_angle); + ClassDB::bind_method(_MD("set_radial_initial_angle","mode"),&TextureProgress::set_radial_initial_angle); + ClassDB::bind_method(_MD("get_radial_initial_angle"), &TextureProgress::get_radial_initial_angle); - ObjectTypeDB::bind_method(_MD("set_radial_center_offset","mode"),&TextureProgress::set_radial_center_offset); - ObjectTypeDB::bind_method(_MD("get_radial_center_offset"), &TextureProgress::get_radial_center_offset); + ClassDB::bind_method(_MD("set_radial_center_offset","mode"),&TextureProgress::set_radial_center_offset); + ClassDB::bind_method(_MD("get_radial_center_offset"), &TextureProgress::get_radial_center_offset); - ObjectTypeDB::bind_method(_MD("set_fill_degrees","mode"),&TextureProgress::set_fill_degrees); - ObjectTypeDB::bind_method(_MD("get_fill_degrees"), &TextureProgress::get_fill_degrees); + ClassDB::bind_method(_MD("set_fill_degrees","mode"),&TextureProgress::set_fill_degrees); + ClassDB::bind_method(_MD("get_fill_degrees"), &TextureProgress::get_fill_degrees); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"texture/under",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_under_texture"),_SCS("get_under_texture")); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"texture/over",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_over_texture"),_SCS("get_over_texture")); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"texture/progress",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_progress_texture"),_SCS("get_progress_texture")); - ADD_PROPERTYNZ( PropertyInfo(Variant::INT,"mode",PROPERTY_HINT_ENUM,"Left to Right,Right to Left,Top to Bottom,Bottom to Top,Clockwise,Counter Clockwise"),_SCS("set_fill_mode"),_SCS("get_fill_mode")); - ADD_PROPERTYNZ( PropertyInfo(Variant::REAL,"radial_fill/initial_angle",PROPERTY_HINT_RANGE,"0.0,360.0,0.1,slider"),_SCS("set_radial_initial_angle"),_SCS("get_radial_initial_angle")); - ADD_PROPERTYNZ( PropertyInfo(Variant::REAL,"radial_fill/fill_degrees",PROPERTY_HINT_RANGE,"0.0,360.0,0.1,slider"),_SCS("set_fill_degrees"),_SCS("get_fill_degrees")); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"radial_fill/center_offset"),_SCS("set_radial_center_offset"),_SCS("get_radial_center_offset")); + ADD_GROUP("Textures","texture_"); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"texture_under",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_under_texture"),_SCS("get_under_texture")); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"texture_over",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_over_texture"),_SCS("get_over_texture")); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"texture_progress",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_progress_texture"),_SCS("get_progress_texture")); + ADD_PROPERTYNZ( PropertyInfo(Variant::INT,"fill_mode",PROPERTY_HINT_ENUM,"Left to Right,Right to Left,Top to Bottom,Bottom to Top,Clockwise,Counter Clockwise"),_SCS("set_fill_mode"),_SCS("get_fill_mode")); + ADD_GROUP("Radial Fill","radial_"); + ADD_PROPERTYNZ( PropertyInfo(Variant::REAL,"radial_initial_angle",PROPERTY_HINT_RANGE,"0.0,360.0,0.1,slider"),_SCS("set_radial_initial_angle"),_SCS("get_radial_initial_angle")); + ADD_PROPERTYNZ( PropertyInfo(Variant::REAL,"radial_fill_degrees",PROPERTY_HINT_RANGE,"0.0,360.0,0.1,slider"),_SCS("set_fill_degrees"),_SCS("get_fill_degrees")); + ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"radial_center_offset"),_SCS("set_radial_center_offset"),_SCS("get_radial_center_offset")); BIND_CONSTANT( FILL_LEFT_TO_RIGHT ); BIND_CONSTANT( FILL_RIGHT_TO_LEFT ); diff --git a/scene/gui/texture_progress.h b/scene/gui/texture_progress.h index a4bbd71e94..02794354ef 100644 --- a/scene/gui/texture_progress.h +++ b/scene/gui/texture_progress.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class TextureProgress : public Range { - OBJ_TYPE( TextureProgress, Range ); + GDCLASS( TextureProgress, Range ); Ref<Texture> under; Ref<Texture> progress; diff --git a/scene/gui/tool_button.cpp b/scene/gui/tool_button.cpp index fd27800384..817b506f10 100644 --- a/scene/gui/tool_button.cpp +++ b/scene/gui/tool_button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/gui/tool_button.h b/scene/gui/tool_button.h index f48d7d413c..ddeb34273b 100644 --- a/scene/gui/tool_button.h +++ b/scene/gui/tool_button.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,7 +32,7 @@ #include "scene/gui/button.h" class ToolButton : public Button { - OBJ_TYPE(ToolButton,Button); + GDCLASS(ToolButton,Button); public: ToolButton(); }; diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 912371142f..f4f1fd8b9c 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -569,6 +569,15 @@ void TreeItem::set_button(int p_column,int p_idx,const Ref<Texture>& p_button){ } +void TreeItem::set_button_color(int p_column,int p_idx,const Color& p_color) { + + ERR_FAIL_INDEX( p_column, cells.size() ); + ERR_FAIL_INDEX( p_idx, cells[p_column].buttons.size() ); + cells[p_column].buttons[p_idx].color=p_color; + _changed_notify(p_column); + +} + void TreeItem::set_editable(int p_column,bool p_editable) { ERR_FAIL_INDEX( p_column, cells.size() ); @@ -648,76 +657,76 @@ Color TreeItem::get_custom_bg_color(int p_column) const { void TreeItem::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_cell_mode","column","mode"),&TreeItem::set_cell_mode); - ObjectTypeDB::bind_method(_MD("get_cell_mode","column"),&TreeItem::get_cell_mode); + ClassDB::bind_method(_MD("set_cell_mode","column","mode"),&TreeItem::set_cell_mode); + ClassDB::bind_method(_MD("get_cell_mode","column"),&TreeItem::get_cell_mode); - ObjectTypeDB::bind_method(_MD("set_checked","column","checked"),&TreeItem::set_checked); - ObjectTypeDB::bind_method(_MD("is_checked","column"),&TreeItem::is_checked); + ClassDB::bind_method(_MD("set_checked","column","checked"),&TreeItem::set_checked); + ClassDB::bind_method(_MD("is_checked","column"),&TreeItem::is_checked); - ObjectTypeDB::bind_method(_MD("set_text","column","text"),&TreeItem::set_text); - ObjectTypeDB::bind_method(_MD("get_text","column"),&TreeItem::get_text); + ClassDB::bind_method(_MD("set_text","column","text"),&TreeItem::set_text); + ClassDB::bind_method(_MD("get_text","column"),&TreeItem::get_text); - ObjectTypeDB::bind_method(_MD("set_icon","column","texture:Texture"),&TreeItem::set_icon); - ObjectTypeDB::bind_method(_MD("get_icon:Texture","column"),&TreeItem::get_icon); + ClassDB::bind_method(_MD("set_icon","column","texture:Texture"),&TreeItem::set_icon); + ClassDB::bind_method(_MD("get_icon:Texture","column"),&TreeItem::get_icon); - ObjectTypeDB::bind_method(_MD("set_icon_region","column","region"),&TreeItem::set_icon_region); - ObjectTypeDB::bind_method(_MD("get_icon_region","column"),&TreeItem::get_icon_region); + ClassDB::bind_method(_MD("set_icon_region","column","region"),&TreeItem::set_icon_region); + ClassDB::bind_method(_MD("get_icon_region","column"),&TreeItem::get_icon_region); - ObjectTypeDB::bind_method(_MD("set_icon_max_width","column","width"),&TreeItem::set_icon_max_width); - ObjectTypeDB::bind_method(_MD("get_icon_max_width","column"),&TreeItem::get_icon_max_width); + ClassDB::bind_method(_MD("set_icon_max_width","column","width"),&TreeItem::set_icon_max_width); + ClassDB::bind_method(_MD("get_icon_max_width","column"),&TreeItem::get_icon_max_width); - ObjectTypeDB::bind_method(_MD("set_range","column","value"),&TreeItem::set_range); - ObjectTypeDB::bind_method(_MD("get_range","column"),&TreeItem::get_range); - ObjectTypeDB::bind_method(_MD("set_range_config","column","min","max","step","expr"),&TreeItem::set_range_config,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("get_range_config","column"),&TreeItem::_get_range_config); + ClassDB::bind_method(_MD("set_range","column","value"),&TreeItem::set_range); + ClassDB::bind_method(_MD("get_range","column"),&TreeItem::get_range); + ClassDB::bind_method(_MD("set_range_config","column","min","max","step","expr"),&TreeItem::set_range_config,DEFVAL(false)); + ClassDB::bind_method(_MD("get_range_config","column"),&TreeItem::_get_range_config); - ObjectTypeDB::bind_method(_MD("set_metadata","column","meta"),&TreeItem::set_metadata); - ObjectTypeDB::bind_method(_MD("get_metadata","column"),&TreeItem::get_metadata); + ClassDB::bind_method(_MD("set_metadata","column","meta"),&TreeItem::set_metadata); + ClassDB::bind_method(_MD("get_metadata","column"),&TreeItem::get_metadata); - ObjectTypeDB::bind_method(_MD("set_custom_draw","column","object","callback"),&TreeItem::set_custom_draw); + ClassDB::bind_method(_MD("set_custom_draw","column","object","callback"),&TreeItem::set_custom_draw); - ObjectTypeDB::bind_method(_MD("set_collapsed","enable"),&TreeItem::set_collapsed); - ObjectTypeDB::bind_method(_MD("is_collapsed"),&TreeItem::is_collapsed); + ClassDB::bind_method(_MD("set_collapsed","enable"),&TreeItem::set_collapsed); + ClassDB::bind_method(_MD("is_collapsed"),&TreeItem::is_collapsed); - ObjectTypeDB::bind_method(_MD("get_next:TreeItem"),&TreeItem::get_next); - ObjectTypeDB::bind_method(_MD("get_prev:TreeItem"),&TreeItem::get_prev); - ObjectTypeDB::bind_method(_MD("get_parent:TreeItem"),&TreeItem::get_parent); - ObjectTypeDB::bind_method(_MD("get_children:TreeItem"),&TreeItem::get_children); + ClassDB::bind_method(_MD("get_next:TreeItem"),&TreeItem::get_next); + ClassDB::bind_method(_MD("get_prev:TreeItem"),&TreeItem::get_prev); + ClassDB::bind_method(_MD("get_parent:TreeItem"),&TreeItem::get_parent); + ClassDB::bind_method(_MD("get_children:TreeItem"),&TreeItem::get_children); - ObjectTypeDB::bind_method(_MD("get_next_visible:TreeItem"),&TreeItem::get_next_visible); - ObjectTypeDB::bind_method(_MD("get_prev_visible:TreeItem"),&TreeItem::get_prev_visible); + ClassDB::bind_method(_MD("get_next_visible:TreeItem"),&TreeItem::get_next_visible); + ClassDB::bind_method(_MD("get_prev_visible:TreeItem"),&TreeItem::get_prev_visible); - ObjectTypeDB::bind_method(_MD("remove_child:TreeItem","child"),&TreeItem::_remove_child); + ClassDB::bind_method(_MD("remove_child:TreeItem","child"),&TreeItem::_remove_child); - ObjectTypeDB::bind_method(_MD("set_selectable","column","selectable"),&TreeItem::set_selectable); - ObjectTypeDB::bind_method(_MD("is_selectable","column"),&TreeItem::is_selectable); + ClassDB::bind_method(_MD("set_selectable","column","selectable"),&TreeItem::set_selectable); + ClassDB::bind_method(_MD("is_selectable","column"),&TreeItem::is_selectable); - ObjectTypeDB::bind_method(_MD("is_selected","column"),&TreeItem::is_selected); - ObjectTypeDB::bind_method(_MD("select","column"),&TreeItem::select); - ObjectTypeDB::bind_method(_MD("deselect","column"),&TreeItem::deselect); + ClassDB::bind_method(_MD("is_selected","column"),&TreeItem::is_selected); + ClassDB::bind_method(_MD("select","column"),&TreeItem::select); + ClassDB::bind_method(_MD("deselect","column"),&TreeItem::deselect); - ObjectTypeDB::bind_method(_MD("set_editable","column","enabled"),&TreeItem::set_editable); - ObjectTypeDB::bind_method(_MD("is_editable","column"),&TreeItem::is_editable); + ClassDB::bind_method(_MD("set_editable","column","enabled"),&TreeItem::set_editable); + ClassDB::bind_method(_MD("is_editable","column"),&TreeItem::is_editable); - ObjectTypeDB::bind_method(_MD("set_custom_color","column","color"),&TreeItem::set_custom_color); - ObjectTypeDB::bind_method(_MD("clear_custom_color","column"),&TreeItem::clear_custom_color); + ClassDB::bind_method(_MD("set_custom_color","column","color"),&TreeItem::set_custom_color); + ClassDB::bind_method(_MD("clear_custom_color","column"),&TreeItem::clear_custom_color); - ObjectTypeDB::bind_method(_MD("set_custom_bg_color","column","color","just_outline"),&TreeItem::set_custom_bg_color,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("clear_custom_bg_color","column"),&TreeItem::clear_custom_bg_color); - ObjectTypeDB::bind_method(_MD("get_custom_bg_color","column"),&TreeItem::get_custom_bg_color); + ClassDB::bind_method(_MD("set_custom_bg_color","column","color","just_outline"),&TreeItem::set_custom_bg_color,DEFVAL(false)); + ClassDB::bind_method(_MD("clear_custom_bg_color","column"),&TreeItem::clear_custom_bg_color); + ClassDB::bind_method(_MD("get_custom_bg_color","column"),&TreeItem::get_custom_bg_color); - ObjectTypeDB::bind_method(_MD("add_button","column","button:Texture","button_idx","disabled"),&TreeItem::add_button,DEFVAL(-1),DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("get_button_count","column"),&TreeItem::get_button_count); - ObjectTypeDB::bind_method(_MD("get_button:Texture","column","button_idx"),&TreeItem::get_button); - ObjectTypeDB::bind_method(_MD("set_button","column","button_idx","button:Texture"),&TreeItem::set_button); - ObjectTypeDB::bind_method(_MD("erase_button","column","button_idx"),&TreeItem::erase_button); - ObjectTypeDB::bind_method(_MD("is_button_disabled","column","button_idx"),&TreeItem::is_button_disabled); + ClassDB::bind_method(_MD("add_button","column","button:Texture","button_idx","disabled"),&TreeItem::add_button,DEFVAL(-1),DEFVAL(false)); + ClassDB::bind_method(_MD("get_button_count","column"),&TreeItem::get_button_count); + ClassDB::bind_method(_MD("get_button:Texture","column","button_idx"),&TreeItem::get_button); + ClassDB::bind_method(_MD("set_button","column","button_idx","button:Texture"),&TreeItem::set_button); + ClassDB::bind_method(_MD("erase_button","column","button_idx"),&TreeItem::erase_button); + ClassDB::bind_method(_MD("is_button_disabled","column","button_idx"),&TreeItem::is_button_disabled); - ObjectTypeDB::bind_method(_MD("set_tooltip","column","tooltip"),&TreeItem::set_tooltip); - ObjectTypeDB::bind_method(_MD("get_tooltip","column"),&TreeItem::get_tooltip); + ClassDB::bind_method(_MD("set_tooltip","column","tooltip"),&TreeItem::set_tooltip); + ClassDB::bind_method(_MD("get_tooltip","column"),&TreeItem::get_tooltip); - ObjectTypeDB::bind_method(_MD("move_to_top"),&TreeItem::move_to_top); - ObjectTypeDB::bind_method(_MD("move_to_bottom"),&TreeItem::move_to_bottom); + ClassDB::bind_method(_MD("move_to_top"),&TreeItem::move_to_top); + ClassDB::bind_method(_MD("move_to_bottom"),&TreeItem::move_to_bottom); BIND_CONSTANT( CELL_MODE_STRING ); BIND_CONSTANT( CELL_MODE_CHECK ); @@ -1061,7 +1070,7 @@ int Tree::draw_item(const Point2i& p_pos,const Point2& p_draw_ofs, const Size2& o.y+=(label_h-s.height)/2; o+=cache.button_pressed->get_offset(); - b->draw(ci,o,p_item->cells[i].buttons[j].disabled?Color(1,1,1,0.5):Color(1,1,1,1)); + b->draw(ci,o,p_item->cells[i].buttons[j].disabled?Color(1,1,1,0.5):p_item->cells[i].buttons[j].color); w-=s.width+cache.button_margin; bw+=s.width+cache.button_margin; } @@ -1331,7 +1340,7 @@ int Tree::draw_item(const Point2i& p_pos,const Point2& p_draw_ofs, const Size2& int root_ofs = children_pos.x + (hide_folding?cache.hseparation:cache.item_margin); int parent_ofs = p_pos.x + (hide_folding?cache.hseparation:cache.item_margin); Point2i root_pos = Point2i(root_ofs, children_pos.y + label_h/2)-cache.offset+p_draw_ofs; - if (c->get_children() > 0) + if (c->get_children() != NULL) root_pos -= Point2i(cache.arrow->get_width(),0); Point2i parent_pos = Point2i(parent_ofs - cache.arrow->get_width()/2, p_pos.y + label_h/2 + cache.arrow->get_height()/2)-cache.offset+p_draw_ofs; @@ -1396,11 +1405,7 @@ void Tree::select_single_item(TreeItem *p_selected, TreeItem *p_current, int p_c if (select_mode==SELECT_ROW) { - - if (p_selected==p_current) { - - if (!c.selected) { - + if (p_selected==p_current && !c.selected) { c.selected=true; selected_item=p_selected; selected_col=0; @@ -1410,24 +1415,17 @@ void Tree::select_single_item(TreeItem *p_selected, TreeItem *p_current, int p_c emitted_row=true; } //if (p_col==i) - // p_current->selected_signal.call(p_col); - } - - } else { + // p_current->selected_signal.call(p_col); - if (c.selected) { + } else if (c.selected) { c.selected=false; //p_current->deselected_signal.call(p_col); - } - } - } else if (select_mode==SELECT_SINGLE || select_mode==SELECT_MULTI) { if (!r_in_range && &selected_cell==&c) { - if (!selected_cell.selected) { selected_cell.selected=true; @@ -1438,6 +1436,8 @@ void Tree::select_single_item(TreeItem *p_selected, TreeItem *p_current, int p_c emit_signal("cell_selected"); if (select_mode==SELECT_MULTI) emit_signal("multi_selected",p_current,i,true); + else if(select_mode == SELECT_SINGLE) + emit_signal("item_selected"); } else if (select_mode==SELECT_MULTI && (selected_item!=p_selected || selected_col!=i)) { @@ -1955,7 +1955,7 @@ void Tree::popup_select(int p_option) { -void Tree::_input_event(InputEvent p_event) { +void Tree::_gui_input(InputEvent p_event) { switch (p_event.type) { @@ -2278,9 +2278,9 @@ void Tree::_input_event(InputEvent p_event) { if (mpos.y>=0) { if (h_scroll->is_visible()) - mpos.x+=h_scroll->get_val(); + mpos.x+=h_scroll->get_value(); if (v_scroll->is_visible()) - mpos.y+=v_scroll->get_val(); + mpos.y+=v_scroll->get_value(); int col,h,section; TreeItem *it = _find_item_at_pos(root,mpos,col,h,section); @@ -2329,7 +2329,7 @@ void Tree::_input_event(InputEvent p_event) { drag_accum-=b.relative_y; - v_scroll->set_val(drag_from+drag_accum); + v_scroll->set_value(drag_from+drag_accum); drag_speed=-b.speed_y; } @@ -2405,6 +2405,9 @@ void Tree::_input_event(InputEvent p_event) { } + if (range_drag_enabled) + break; + switch(b.button_index) { case BUTTON_RIGHT: case BUTTON_LEFT: { @@ -2468,7 +2471,7 @@ void Tree::_input_event(InputEvent p_event) { drag_speed=0; drag_accum=0; // last_drag_accum=0; - drag_from=v_scroll->get_val(); + drag_from=v_scroll->get_value(); drag_touching=OS::get_singleton()->has_touchscreen_ui_hint(); drag_touching_deaccel=false; if (drag_touching) { @@ -2480,11 +2483,11 @@ void Tree::_input_event(InputEvent p_event) { } break; case BUTTON_WHEEL_UP: { - v_scroll->set_val( v_scroll->get_val()-v_scroll->get_page()/8 ); + v_scroll->set_value( v_scroll->get_value()-v_scroll->get_page()/8 ); } break; case BUTTON_WHEEL_DOWN: { - v_scroll->set_val( v_scroll->get_val()+v_scroll->get_page()/8 ); + v_scroll->set_value( v_scroll->get_value()+v_scroll->get_page()/8 ); } break; } @@ -2563,7 +2566,7 @@ bool Tree::edit_selected() { value_editor->set_min( c.min ); value_editor->set_max( c.max ); value_editor->set_step( c.step ); - value_editor->set_val( c.val ); + value_editor->set_value( c.val ); value_editor->set_exp_unit_value( c.expr ); updating_value_editor=false; } @@ -2623,7 +2626,7 @@ void Tree::update_scrollbars() { v_scroll->show(); v_scroll->set_max(min.height); v_scroll->set_page(size.height - hmin.height - tbh); - cache.offset.y=v_scroll->get_val(); + cache.offset.y=v_scroll->get_value(); } if (min.width < size.width - vmin.width) { @@ -2635,7 +2638,7 @@ void Tree::update_scrollbars() { h_scroll->show(); h_scroll->set_max(min.width); h_scroll->set_page(size.width - vmin.width); - cache.offset.x=h_scroll->get_val(); + cache.offset.x=h_scroll->get_value(); } } @@ -2689,7 +2692,7 @@ void Tree::_notification(int p_what) { if (drag_touching_deaccel) { - float pos = v_scroll->get_val(); + float pos = v_scroll->get_value(); pos+=drag_speed*get_fixed_process_delta_time(); bool turnoff=false; @@ -2706,7 +2709,7 @@ void Tree::_notification(int p_what) { } - v_scroll->set_val(pos); + v_scroll->set_value(pos); float sgn = drag_speed<0? -1 : 1; float val = Math::abs(drag_speed); val-=1000*get_fixed_process_delta_time(); @@ -2746,8 +2749,8 @@ void Tree::_notification(int p_what) { } point *= cache.scroll_speed * get_fixed_process_delta_time(); point += get_scroll(); - h_scroll->set_val(point.x); - v_scroll->set_val(point.y); + h_scroll->set_value(point.x); + v_scroll->set_value(point.y); } } @@ -2757,8 +2760,6 @@ void Tree::_notification(int p_what) { update_scrollbars(); RID ci = get_canvas_item(); - VisualServer::get_singleton()->canvas_item_set_clip(ci,true); - Ref<StyleBox> bg = cache.bg; Ref<StyleBox> bg_focus = get_stylebox("bg_focus"); @@ -2923,8 +2924,7 @@ void Tree::item_selected(int p_column,TreeItem *p_item) { void Tree::item_deselected(int p_column,TreeItem *p_item) { - if (select_mode==SELECT_MULTI) { - + if (select_mode==SELECT_MULTI || select_mode == SELECT_SINGLE) { p_item->cells[p_column].selected=false; } update(); @@ -3185,10 +3185,10 @@ void Tree::ensure_cursor_is_visible() { int h = compute_item_height(selected)+cache.vseparation; int screenh=get_size().height-h_scroll->get_combined_minimum_size().height; - if (ofs+h>v_scroll->get_val()+screenh) + if (ofs+h>v_scroll->get_value()+screenh) v_scroll->call_deferred("set_val", ofs-screenh+h); - else if (ofs < v_scroll->get_val()) - v_scroll->set_val(ofs); + else if (ofs < v_scroll->get_value()) + v_scroll->set_value(ofs); } int Tree::get_pressed_button() const { @@ -3255,9 +3255,9 @@ Point2 Tree::get_scroll() const { Point2 ofs; if (h_scroll->is_visible()) - ofs.x=h_scroll->get_val(); + ofs.x=h_scroll->get_value(); if (v_scroll->is_visible()) - ofs.y=v_scroll->get_val(); + ofs.y=v_scroll->get_value(); return ofs; } @@ -3300,7 +3300,7 @@ void Tree::_do_incr_search(const String& p_add) { uint64_t time = OS::get_singleton()->get_ticks_usec() / 1000; // convert to msec uint64_t diff = time - last_keypress; - if (diff > uint64_t(GLOBAL_DEF("gui/incr_search_max_interval_msec",2000))) + if (diff > uint64_t(GLOBAL_DEF("gui/timers/incremental_search_max_interval_msec",2000))) incr_search=p_add; else incr_search+=p_add; @@ -3396,9 +3396,9 @@ int Tree::get_column_at_pos(const Point2& p_pos) const { return -1; if (h_scroll->is_visible()) - pos.x+=h_scroll->get_val(); + pos.x+=h_scroll->get_value(); if (v_scroll->is_visible()) - pos.y+=v_scroll->get_val(); + pos.y+=v_scroll->get_value(); int col,h,section; TreeItem *it = _find_item_at_pos(root,pos,col,h,section); @@ -3423,9 +3423,9 @@ int Tree::get_drop_section_at_pos(const Point2& p_pos) const { return -100; if (h_scroll->is_visible()) - pos.x+=h_scroll->get_val(); + pos.x+=h_scroll->get_value(); if (v_scroll->is_visible()) - pos.y+=v_scroll->get_val(); + pos.y+=v_scroll->get_value(); int col,h,section; TreeItem *it = _find_item_at_pos(root,pos,col,h,section); @@ -3450,9 +3450,9 @@ TreeItem* Tree::get_item_at_pos(const Point2& p_pos) const { return NULL; if (h_scroll->is_visible()) - pos.x+=h_scroll->get_val(); + pos.x+=h_scroll->get_value(); if (v_scroll->is_visible()) - pos.y+=v_scroll->get_val(); + pos.y+=v_scroll->get_value(); int col,h,section; TreeItem *it = _find_item_at_pos(root,pos,col,h,section); @@ -3478,9 +3478,9 @@ String Tree::get_tooltip(const Point2& p_pos) const { return Control::get_tooltip(p_pos); if (h_scroll->is_visible()) - pos.x+=h_scroll->get_val(); + pos.x+=h_scroll->get_value(); if (v_scroll->is_visible()) - pos.y+=v_scroll->get_val(); + pos.y+=v_scroll->get_value(); int col,h,section; TreeItem *it = _find_item_at_pos(root,pos,col,h,section); @@ -3564,59 +3564,59 @@ bool Tree::get_allow_rmb_select() const{ void Tree::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_range_click_timeout"),&Tree::_range_click_timeout); - ObjectTypeDB::bind_method(_MD("_input_event"),&Tree::_input_event); - ObjectTypeDB::bind_method(_MD("_popup_select"),&Tree::popup_select); - ObjectTypeDB::bind_method(_MD("_text_editor_enter"),&Tree::text_editor_enter); - ObjectTypeDB::bind_method(_MD("_text_editor_modal_close"),&Tree::_text_editor_modal_close); - ObjectTypeDB::bind_method(_MD("_value_editor_changed"),&Tree::value_editor_changed); - ObjectTypeDB::bind_method(_MD("_scroll_moved"),&Tree::_scroll_moved); + ClassDB::bind_method(_MD("_range_click_timeout"),&Tree::_range_click_timeout); + ClassDB::bind_method(_MD("_gui_input"),&Tree::_gui_input); + ClassDB::bind_method(_MD("_popup_select"),&Tree::popup_select); + ClassDB::bind_method(_MD("_text_editor_enter"),&Tree::text_editor_enter); + ClassDB::bind_method(_MD("_text_editor_modal_close"),&Tree::_text_editor_modal_close); + ClassDB::bind_method(_MD("_value_editor_changed"),&Tree::value_editor_changed); + ClassDB::bind_method(_MD("_scroll_moved"),&Tree::_scroll_moved); - ObjectTypeDB::bind_method(_MD("clear"),&Tree::clear); - ObjectTypeDB::bind_method(_MD("create_item:TreeItem","parent:TreeItem"),&Tree::_create_item,DEFVAL(Variant())); + ClassDB::bind_method(_MD("clear"),&Tree::clear); + ClassDB::bind_method(_MD("create_item:TreeItem","parent:TreeItem"),&Tree::_create_item,DEFVAL(Variant())); - ObjectTypeDB::bind_method(_MD("get_root:TreeItem"),&Tree::get_root); - ObjectTypeDB::bind_method(_MD("set_column_min_width","column","min_width"),&Tree::set_column_min_width); - ObjectTypeDB::bind_method(_MD("set_column_expand","column","expand"),&Tree::set_column_expand); - ObjectTypeDB::bind_method(_MD("get_column_width","column"),&Tree::get_column_width); + ClassDB::bind_method(_MD("get_root:TreeItem"),&Tree::get_root); + ClassDB::bind_method(_MD("set_column_min_width","column","min_width"),&Tree::set_column_min_width); + ClassDB::bind_method(_MD("set_column_expand","column","expand"),&Tree::set_column_expand); + ClassDB::bind_method(_MD("get_column_width","column"),&Tree::get_column_width); - ObjectTypeDB::bind_method(_MD("set_hide_root","enable"),&Tree::set_hide_root); - ObjectTypeDB::bind_method(_MD("get_next_selected:TreeItem","from:TreeItem"),&Tree::_get_next_selected); - ObjectTypeDB::bind_method(_MD("get_selected:TreeItem"),&Tree::get_selected); - ObjectTypeDB::bind_method(_MD("get_selected_column"),&Tree::get_selected_column); - ObjectTypeDB::bind_method(_MD("get_pressed_button"),&Tree::get_pressed_button); - ObjectTypeDB::bind_method(_MD("set_select_mode","mode"),&Tree::set_select_mode); + ClassDB::bind_method(_MD("set_hide_root","enable"),&Tree::set_hide_root); + ClassDB::bind_method(_MD("get_next_selected:TreeItem","from:TreeItem"),&Tree::_get_next_selected); + ClassDB::bind_method(_MD("get_selected:TreeItem"),&Tree::get_selected); + ClassDB::bind_method(_MD("get_selected_column"),&Tree::get_selected_column); + ClassDB::bind_method(_MD("get_pressed_button"),&Tree::get_pressed_button); + ClassDB::bind_method(_MD("set_select_mode","mode"),&Tree::set_select_mode); - ObjectTypeDB::bind_method(_MD("set_columns","amount"),&Tree::set_columns); - ObjectTypeDB::bind_method(_MD("get_columns"),&Tree::get_columns); + ClassDB::bind_method(_MD("set_columns","amount"),&Tree::set_columns); + ClassDB::bind_method(_MD("get_columns"),&Tree::get_columns); - ObjectTypeDB::bind_method(_MD("get_edited:TreeItem"),&Tree::get_edited); - ObjectTypeDB::bind_method(_MD("get_edited_column"),&Tree::get_edited_column); - ObjectTypeDB::bind_method(_MD("get_custom_popup_rect"),&Tree::get_custom_popup_rect); - ObjectTypeDB::bind_method(_MD("get_item_area_rect","item:TreeItem","column"),&Tree::_get_item_rect,DEFVAL(-1)); - ObjectTypeDB::bind_method(_MD("get_item_at_pos:TreeItem","pos"),&Tree::get_item_at_pos); - ObjectTypeDB::bind_method(_MD("get_column_at_pos","pos"),&Tree::get_column_at_pos); + ClassDB::bind_method(_MD("get_edited:TreeItem"),&Tree::get_edited); + ClassDB::bind_method(_MD("get_edited_column"),&Tree::get_edited_column); + ClassDB::bind_method(_MD("get_custom_popup_rect"),&Tree::get_custom_popup_rect); + ClassDB::bind_method(_MD("get_item_area_rect","item:TreeItem","column"),&Tree::_get_item_rect,DEFVAL(-1)); + ClassDB::bind_method(_MD("get_item_at_pos:TreeItem","pos"),&Tree::get_item_at_pos); + ClassDB::bind_method(_MD("get_column_at_pos","pos"),&Tree::get_column_at_pos); - ObjectTypeDB::bind_method(_MD("ensure_cursor_is_visible"),&Tree::ensure_cursor_is_visible); + ClassDB::bind_method(_MD("ensure_cursor_is_visible"),&Tree::ensure_cursor_is_visible); - ObjectTypeDB::bind_method(_MD("set_column_titles_visible","visible"),&Tree::set_column_titles_visible); - ObjectTypeDB::bind_method(_MD("are_column_titles_visible"),&Tree::are_column_titles_visible); + ClassDB::bind_method(_MD("set_column_titles_visible","visible"),&Tree::set_column_titles_visible); + ClassDB::bind_method(_MD("are_column_titles_visible"),&Tree::are_column_titles_visible); - ObjectTypeDB::bind_method(_MD("set_column_title","column","title"),&Tree::set_column_title); - ObjectTypeDB::bind_method(_MD("get_column_title","column"),&Tree::get_column_title); - ObjectTypeDB::bind_method(_MD("get_scroll"),&Tree::get_scroll); + ClassDB::bind_method(_MD("set_column_title","column","title"),&Tree::set_column_title); + ClassDB::bind_method(_MD("get_column_title","column"),&Tree::get_column_title); + ClassDB::bind_method(_MD("get_scroll"),&Tree::get_scroll); - ObjectTypeDB::bind_method(_MD("set_hide_folding","hide"),&Tree::set_hide_folding); - ObjectTypeDB::bind_method(_MD("is_folding_hidden"),&Tree::is_folding_hidden); + ClassDB::bind_method(_MD("set_hide_folding","hide"),&Tree::set_hide_folding); + ClassDB::bind_method(_MD("is_folding_hidden"),&Tree::is_folding_hidden); - ObjectTypeDB::bind_method(_MD("set_drop_mode_flags","flags"),&Tree::set_drop_mode_flags); - ObjectTypeDB::bind_method(_MD("get_drop_mode_flags"),&Tree::get_drop_mode_flags); + ClassDB::bind_method(_MD("set_drop_mode_flags","flags"),&Tree::set_drop_mode_flags); + ClassDB::bind_method(_MD("get_drop_mode_flags"),&Tree::get_drop_mode_flags); - ObjectTypeDB::bind_method(_MD("set_allow_rmb_select","allow"),&Tree::set_allow_rmb_select); - ObjectTypeDB::bind_method(_MD("get_allow_rmb_select"),&Tree::get_allow_rmb_select); + ClassDB::bind_method(_MD("set_allow_rmb_select","allow"),&Tree::set_allow_rmb_select); + ClassDB::bind_method(_MD("get_allow_rmb_select"),&Tree::get_allow_rmb_select); - ObjectTypeDB::bind_method(_MD("set_single_select_cell_editing_only_when_already_selected","enable"),&Tree::set_single_select_cell_editing_only_when_already_selected); - ObjectTypeDB::bind_method(_MD("get_single_select_cell_editing_only_when_already_selected"),&Tree::get_single_select_cell_editing_only_when_already_selected); + ClassDB::bind_method(_MD("set_single_select_cell_editing_only_when_already_selected","enable"),&Tree::set_single_select_cell_editing_only_when_already_selected); + ClassDB::bind_method(_MD("get_single_select_cell_editing_only_when_already_selected"),&Tree::get_single_select_cell_editing_only_when_already_selected); ADD_SIGNAL( MethodInfo("item_selected")); ADD_SIGNAL( MethodInfo("cell_selected")); @@ -3686,7 +3686,7 @@ Tree::Tree() { v_scroll->connect("value_changed", this,"_scroll_moved"); text_editor->connect("text_entered", this,"_text_editor_enter"); text_editor->connect("modal_close", this,"_text_editor_modal_close"); - popup_menu->connect("item_pressed", this,"_popup_select"); + popup_menu->connect("id_pressed", this,"_popup_select"); value_editor->connect("value_changed", this,"_value_editor_changed"); value_editor->set_as_toplevel(true); @@ -3709,7 +3709,7 @@ Tree::Tree() { blocked=0; cursor_can_exit_tree=true; - set_stop_mouse(true); + set_mouse_filter(MOUSE_FILTER_STOP); drag_speed=0; drag_touching=false; @@ -3728,6 +3728,8 @@ Tree::Tree() { force_select_on_already_selected=false; allow_rmb_select=false; + + set_clip_contents(true); } diff --git a/scene/gui/tree.h b/scene/gui/tree.h index 1936f926c8..8327e356b3 100644 --- a/scene/gui/tree.h +++ b/scene/gui/tree.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -45,7 +45,7 @@ class Tree; class TreeItem : public Object { - OBJ_TYPE(TreeItem,Object); + GDCLASS(TreeItem,Object); public: enum TreeCellMode { @@ -93,7 +93,8 @@ friend class Tree; int id; bool disabled; Ref<Texture> texture; - Button() { id=0; disabled=false; } + Color color; + Button() { id=0; disabled=false; color=Color(1,1,1,1); } }; Vector< Button > buttons; @@ -189,6 +190,7 @@ public: int get_button_by_id(int p_column,int p_id) const; bool is_button_disabled(int p_column,int p_idx) const; void set_button(int p_column,int p_idx,const Ref<Texture>& p_button); + void set_button_color(int p_column,int p_idx,const Color& p_color); /* range works for mode number or mode combo */ @@ -255,7 +257,7 @@ VARIANT_ENUM_CAST( TreeItem::TreeCellMode ); class Tree : public Control { - OBJ_TYPE( Tree, Control ); + GDCLASS( Tree, Control ); public: enum SelectMode { SELECT_SINGLE, @@ -343,7 +345,7 @@ friend class TreeItem; void popup_select(int p_option); - void _input_event(InputEvent p_event); + void _gui_input(InputEvent p_event); void _notification(int p_what); Size2 get_minimum_size() const; diff --git a/scene/gui/video_player.cpp b/scene/gui/video_player.cpp index 335672126c..f7d2ad1c63 100644 --- a/scene/gui/video_player.cpp +++ b/scene/gui/video_player.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -121,7 +121,7 @@ void VideoPlayer::_notification(int p_notification) { } } break; - case NOTIFICATION_PROCESS: { + case NOTIFICATION_INTERNAL_PROCESS: { if (stream.is_null()) return; @@ -233,7 +233,7 @@ void VideoPlayer::play() { return; playback->stop(); playback->play(); - set_process(true); + set_process_internal(true); AudioServer::get_singleton()->stream_set_active(stream_rid,true); AudioServer::get_singleton()->stream_set_volume_scale(stream_rid,volume); last_audio_time=0; @@ -249,7 +249,7 @@ void VideoPlayer::stop() { playback->stop(); AudioServer::get_singleton()->stream_set_active(stream_rid,false); resampler.flush(); - set_process(false); + set_process_internal(false); last_audio_time=0; }; @@ -266,7 +266,7 @@ void VideoPlayer::set_paused(bool p_paused) { paused=p_paused; if (playback.is_valid()) { playback->set_paused(p_paused); - set_process(!p_paused); + set_process_internal(!p_paused); }; last_audio_time = 0; }; @@ -357,47 +357,47 @@ bool VideoPlayer::has_autoplay() const { void VideoPlayer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_stream","stream:VideoStream"),&VideoPlayer::set_stream); - ObjectTypeDB::bind_method(_MD("get_stream:VideoStream"),&VideoPlayer::get_stream); + ClassDB::bind_method(_MD("set_stream","stream:VideoStream"),&VideoPlayer::set_stream); + ClassDB::bind_method(_MD("get_stream:VideoStream"),&VideoPlayer::get_stream); - ObjectTypeDB::bind_method(_MD("play"),&VideoPlayer::play); - ObjectTypeDB::bind_method(_MD("stop"),&VideoPlayer::stop); + ClassDB::bind_method(_MD("play"),&VideoPlayer::play); + ClassDB::bind_method(_MD("stop"),&VideoPlayer::stop); - ObjectTypeDB::bind_method(_MD("is_playing"),&VideoPlayer::is_playing); + ClassDB::bind_method(_MD("is_playing"),&VideoPlayer::is_playing); - ObjectTypeDB::bind_method(_MD("set_paused","paused"),&VideoPlayer::set_paused); - ObjectTypeDB::bind_method(_MD("is_paused"),&VideoPlayer::is_paused); + ClassDB::bind_method(_MD("set_paused","paused"),&VideoPlayer::set_paused); + ClassDB::bind_method(_MD("is_paused"),&VideoPlayer::is_paused); - ObjectTypeDB::bind_method(_MD("set_volume","volume"),&VideoPlayer::set_volume); - ObjectTypeDB::bind_method(_MD("get_volume"),&VideoPlayer::get_volume); + ClassDB::bind_method(_MD("set_volume","volume"),&VideoPlayer::set_volume); + ClassDB::bind_method(_MD("get_volume"),&VideoPlayer::get_volume); - ObjectTypeDB::bind_method(_MD("set_volume_db","db"),&VideoPlayer::set_volume_db); - ObjectTypeDB::bind_method(_MD("get_volume_db"),&VideoPlayer::get_volume_db); + ClassDB::bind_method(_MD("set_volume_db","db"),&VideoPlayer::set_volume_db); + ClassDB::bind_method(_MD("get_volume_db"),&VideoPlayer::get_volume_db); - ObjectTypeDB::bind_method(_MD("set_audio_track","track"),&VideoPlayer::set_audio_track); - ObjectTypeDB::bind_method(_MD("get_audio_track"),&VideoPlayer::get_audio_track); + ClassDB::bind_method(_MD("set_audio_track","track"),&VideoPlayer::set_audio_track); + ClassDB::bind_method(_MD("get_audio_track"),&VideoPlayer::get_audio_track); - ObjectTypeDB::bind_method(_MD("get_stream_name"),&VideoPlayer::get_stream_name); + ClassDB::bind_method(_MD("get_stream_name"),&VideoPlayer::get_stream_name); - ObjectTypeDB::bind_method(_MD("get_stream_pos"),&VideoPlayer::get_stream_pos); + ClassDB::bind_method(_MD("get_stream_pos"),&VideoPlayer::get_stream_pos); - ObjectTypeDB::bind_method(_MD("set_autoplay","enabled"),&VideoPlayer::set_autoplay); - ObjectTypeDB::bind_method(_MD("has_autoplay"),&VideoPlayer::has_autoplay); + ClassDB::bind_method(_MD("set_autoplay","enabled"),&VideoPlayer::set_autoplay); + ClassDB::bind_method(_MD("has_autoplay"),&VideoPlayer::has_autoplay); - ObjectTypeDB::bind_method(_MD("set_expand","enable"), &VideoPlayer::set_expand ); - ObjectTypeDB::bind_method(_MD("has_expand"), &VideoPlayer::has_expand ); + ClassDB::bind_method(_MD("set_expand","enable"), &VideoPlayer::set_expand ); + ClassDB::bind_method(_MD("has_expand"), &VideoPlayer::has_expand ); - ObjectTypeDB::bind_method(_MD("set_buffering_msec","msec"),&VideoPlayer::set_buffering_msec); - ObjectTypeDB::bind_method(_MD("get_buffering_msec"),&VideoPlayer::get_buffering_msec); + ClassDB::bind_method(_MD("set_buffering_msec","msec"),&VideoPlayer::set_buffering_msec); + ClassDB::bind_method(_MD("get_buffering_msec"),&VideoPlayer::get_buffering_msec); - ObjectTypeDB::bind_method(_MD("get_video_texture:Texture"), &VideoPlayer::get_video_texture ); + ClassDB::bind_method(_MD("get_video_texture:Texture"), &VideoPlayer::get_video_texture ); - ADD_PROPERTY( PropertyInfo(Variant::INT, "stream/audio_track",PROPERTY_HINT_RANGE,"0,128,1"), _SCS("set_audio_track"), _SCS("get_audio_track") ); - ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "stream/stream", PROPERTY_HINT_RESOURCE_TYPE,"VideoStream"), _SCS("set_stream"), _SCS("get_stream") ); + ADD_PROPERTY( PropertyInfo(Variant::INT, "audio_track",PROPERTY_HINT_RANGE,"0,128,1"), _SCS("set_audio_track"), _SCS("get_audio_track") ); + ADD_PROPERTY( PropertyInfo(Variant::OBJECT, "stream", PROPERTY_HINT_RESOURCE_TYPE,"VideoStream"), _SCS("set_stream"), _SCS("get_stream") ); // ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/loop"), _SCS("set_loop"), _SCS("has_loop") ); - ADD_PROPERTY( PropertyInfo(Variant::REAL, "stream/volume_db", PROPERTY_HINT_RANGE,"-80,24,0.01"), _SCS("set_volume_db"), _SCS("get_volume_db") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/autoplay"), _SCS("set_autoplay"), _SCS("has_autoplay") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "stream/paused"), _SCS("set_paused"), _SCS("is_paused") ); + ADD_PROPERTY( PropertyInfo(Variant::REAL, "volume_db", PROPERTY_HINT_RANGE,"-80,24,0.01"), _SCS("set_volume_db"), _SCS("get_volume_db") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "autoplay"), _SCS("set_autoplay"), _SCS("has_autoplay") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL, "paused"), _SCS("set_paused"), _SCS("is_paused") ); ADD_PROPERTY( PropertyInfo( Variant::BOOL, "expand" ), _SCS("set_expand"),_SCS("has_expand") ); } diff --git a/scene/gui/video_player.h b/scene/gui/video_player.h index 9ce1ba78f4..694cb253a4 100644 --- a/scene/gui/video_player.h +++ b/scene/gui/video_player.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class VideoPlayer : public Control { - OBJ_TYPE(VideoPlayer,Control); + GDCLASS(VideoPlayer,Control); struct InternalStream : public AudioServer::AudioStream { VideoPlayer *player; diff --git a/scene/gui/viewport_container.cpp b/scene/gui/viewport_container.cpp new file mode 100644 index 0000000000..37ecd3cb2f --- /dev/null +++ b/scene/gui/viewport_container.cpp @@ -0,0 +1,103 @@ +#include "viewport_container.h" +#include "scene/main/viewport.h" +Size2 ViewportContainer::get_minimum_size() const { + + + if (stretch) + return Size2(); + Size2 ms; + for(int i=0;i<get_child_count();i++) { + + Viewport *c = get_child(i)->cast_to<Viewport>(); + if (!c) + continue; + + Size2 minsize = c->get_size(); + ms.width = MAX(ms.width , minsize.width); + ms.height = MAX(ms.height , minsize.height); + } + + return ms; + +} + + +void ViewportContainer::set_stretch(bool p_enable) { + + stretch=p_enable; + queue_sort(); + update(); + +} + +bool ViewportContainer::is_stretch_enabled() const { + + return stretch; +} + + +void ViewportContainer::_notification(int p_what) { + + + if (p_what==NOTIFICATION_RESIZED) { + + if (!stretch) + return; + + for(int i=0;i<get_child_count();i++) { + + Viewport *c = get_child(i)->cast_to<Viewport>(); + if (!c) + continue; + + c->set_size(get_size()); + } + } + + if (p_what==NOTIFICATION_ENTER_TREE || p_what==NOTIFICATION_VISIBILITY_CHANGED) { + + for(int i=0;i<get_child_count();i++) { + + Viewport *c = get_child(i)->cast_to<Viewport>(); + if (!c) + continue; + + + if (is_visible()) + c->set_update_mode(Viewport::UPDATE_ALWAYS); + else + c->set_update_mode(Viewport::UPDATE_DISABLED); + } + + } + + if (p_what==NOTIFICATION_DRAW) { + + for(int i=0;i<get_child_count();i++) { + + + Viewport *c = get_child(i)->cast_to<Viewport>(); + if (!c) + continue; + + if (stretch) + draw_texture_rect(c->get_texture(),Rect2(Vector2(),get_size()*Size2(1,-1))); + else + draw_texture_rect(c->get_texture(),Rect2(Vector2(),c->get_size()*Size2(1,-1))); + } + } + +} + +void ViewportContainer::_bind_methods() { + + ClassDB::bind_method(_MD("set_stretch","enable"),&ViewportContainer::set_stretch); + ClassDB::bind_method(_MD("is_stretch_enabled"),&ViewportContainer::is_stretch_enabled); + + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"stretch"),_SCS("set_stretch"),_SCS("is_stretch_enabled")); +} + +ViewportContainer::ViewportContainer() { + + stretch=false; +} diff --git a/scene/gui/viewport_container.h b/scene/gui/viewport_container.h new file mode 100644 index 0000000000..632c54f2f4 --- /dev/null +++ b/scene/gui/viewport_container.h @@ -0,0 +1,25 @@ +#ifndef VIEWPORTCONTAINER_H +#define VIEWPORTCONTAINER_H + +#include "scene/gui/container.h" + +class ViewportContainer : public Container { + + GDCLASS( ViewportContainer, Container ); + + bool stretch; +protected: + + void _notification(int p_what); + static void _bind_methods(); +public: + + void set_stretch(bool p_enable); + bool is_stretch_enabled() const; + + virtual Size2 get_minimum_size() const; + + ViewportContainer(); +}; + +#endif // VIEWPORTCONTAINER_H diff --git a/scene/io/resource_format_image.cpp b/scene/io/resource_format_image.cpp index 55ad23ba93..cc3d9baa74 100644 --- a/scene/io/resource_format_image.cpp +++ b/scene/io/resource_format_image.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -125,7 +125,7 @@ RES ResourceFormatLoaderImage::load(const String &p_path, const String& p_origin if (max_texture_size && (image.get_width() > max_texture_size || image.get_height() > max_texture_size)) { - if (bool(Globals::get_singleton()->get("debug/max_texture_size_alert"))) { + if (bool(GlobalConfig::get_singleton()->get("debug/image_loader/max_texture_size_alert"))) { OS::get_singleton()->alert("Texture is too large: '"+p_path+"', at "+itos(image.get_width())+"x"+itos(image.get_height())+". Max allowed size is: "+itos(max_texture_size)+"x"+itos(max_texture_size)+".","BAD ARTIST, NO COOKIE!"); } @@ -185,7 +185,7 @@ uint32_t ResourceFormatLoaderImage::load_image_flags(const String &p_path) { if (flags_found.has("filter")) { if (flags_found["filter"]) flags|=Texture::FLAG_FILTER; - } else if (bool(GLOBAL_DEF("image_loader/filter",true))) { + } else if (bool(GLOBAL_DEF("rendering/image_loader/filter",true))) { flags|=Texture::FLAG_FILTER; } @@ -193,14 +193,14 @@ uint32_t ResourceFormatLoaderImage::load_image_flags(const String &p_path) { if (flags_found.has("gen_mipmaps")) { if (flags_found["gen_mipmaps"]) flags|=Texture::FLAG_MIPMAPS; - } else if (bool(GLOBAL_DEF("image_loader/gen_mipmaps",true))) { + } else if (bool(GLOBAL_DEF("rendering/image_loader/gen_mipmaps",true))) { flags|=Texture::FLAG_MIPMAPS; } if (flags_found.has("repeat")) { if (flags_found["repeat"]) flags|=Texture::FLAG_REPEAT; - } else if (bool(GLOBAL_DEF("image_loader/repeat",true))) { + } else if (bool(GLOBAL_DEF("rendering/image_loader/repeat",true))) { flags|=Texture::FLAG_REPEAT; } @@ -224,7 +224,7 @@ uint32_t ResourceFormatLoaderImage::load_image_flags(const String &p_path) { bool ResourceFormatLoaderImage::handles_type(const String& p_type) const { - return ObjectTypeDB::is_type(p_type,"Texture") || ObjectTypeDB::is_type(p_type,"CubeMap"); + return ClassDB::is_parent_class(p_type,"Texture") || ClassDB::is_parent_class(p_type,"CubeMap"); } void ResourceFormatLoaderImage::get_recognized_extensions(List<String> *p_extensions) const { @@ -252,11 +252,11 @@ String ResourceFormatLoaderImage::get_resource_type(const String &p_path) const ResourceFormatLoaderImage::ResourceFormatLoaderImage() { - max_texture_size = GLOBAL_DEF("debug/max_texture_size",0); - GLOBAL_DEF("debug/max_texture_size_alert",false); - debug_load_times=GLOBAL_DEF("debug/image_load_times",false); - GLOBAL_DEF("image_loader/filter",true); - GLOBAL_DEF("image_loader/gen_mipmaps",true); - GLOBAL_DEF("image_loader/repeat",false); + max_texture_size = GLOBAL_DEF("debug/image_loader/max_texture_size",0); + GLOBAL_DEF("debug/image_loader/max_texture_size_alert",false); + debug_load_times=GLOBAL_DEF("debug/image_loader/image_load_times",false); + GLOBAL_DEF("rendering/image_loader/filter",true); + GLOBAL_DEF("rendering/image_loader/gen_mipmaps",true); + GLOBAL_DEF("rendering/image_loader/repeat",false); } diff --git a/scene/io/resource_format_image.h b/scene/io/resource_format_image.h index cce6ffab83..6e4ead2a0b 100644 --- a/scene/io/resource_format_image.h +++ b/scene/io/resource_format_image.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/io/resource_format_wav.cpp b/scene/io/resource_format_wav.cpp index 9cf349eb7b..f75836d2df 100644 --- a/scene/io/resource_format_wav.cpp +++ b/scene/io/resource_format_wav.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -171,9 +171,9 @@ RES ResourceFormatLoaderWAV::load(const String &p_path, const String& p_original if (format_bits>8) len*=2; - DVector<uint8_t> data; + PoolVector<uint8_t> data; data.resize(len); - DVector<uint8_t>::Write dataw = data.write(); + PoolVector<uint8_t>::Write dataw = data.write(); void * data_ptr = dataw.ptr(); for (int i=0;i<frames;i++) { @@ -215,7 +215,7 @@ RES ResourceFormatLoaderWAV::load(const String &p_path, const String& p_original } - dataw=DVector<uint8_t>::Write(); + dataw=PoolVector<uint8_t>::Write(); sample->set_data(data); diff --git a/scene/io/resource_format_wav.h b/scene/io/resource_format_wav.h index 4918d5c2e7..3a278b455b 100644 --- a/scene/io/resource_format_wav.h +++ b/scene/io/resource_format_wav.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/main/canvas_layer.cpp b/scene/main/canvas_layer.cpp index 8e238c7d77..2e2e1d6c80 100644 --- a/scene/main/canvas_layer.cpp +++ b/scene/main/canvas_layer.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -43,7 +43,7 @@ int CanvasLayer::get_layer() const{ return layer; } -void CanvasLayer::set_transform(const Matrix32& p_xform) { +void CanvasLayer::set_transform(const Transform2D& p_xform) { transform=p_xform; locrotscale_dirty=true; @@ -52,7 +52,7 @@ void CanvasLayer::set_transform(const Matrix32& p_xform) { } -Matrix32 CanvasLayer::get_transform() const { +Transform2D CanvasLayer::get_transform() const { return transform; } @@ -246,37 +246,46 @@ Node* CanvasLayer::get_custom_viewport() const { return custom_viewport; } +void CanvasLayer::reset_sort_index() { + sort_index=0; +} + +int CanvasLayer::get_sort_index() { + + return sort_index++; +} + void CanvasLayer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_layer","layer"),&CanvasLayer::set_layer); - ObjectTypeDB::bind_method(_MD("get_layer"),&CanvasLayer::get_layer); + ClassDB::bind_method(_MD("set_layer","layer"),&CanvasLayer::set_layer); + ClassDB::bind_method(_MD("get_layer"),&CanvasLayer::get_layer); - ObjectTypeDB::bind_method(_MD("set_transform","transform"),&CanvasLayer::set_transform); - ObjectTypeDB::bind_method(_MD("get_transform"),&CanvasLayer::get_transform); + ClassDB::bind_method(_MD("set_transform","transform"),&CanvasLayer::set_transform); + ClassDB::bind_method(_MD("get_transform"),&CanvasLayer::get_transform); - ObjectTypeDB::bind_method(_MD("set_offset","offset"),&CanvasLayer::set_offset); - ObjectTypeDB::bind_method(_MD("get_offset"),&CanvasLayer::get_offset); + ClassDB::bind_method(_MD("set_offset","offset"),&CanvasLayer::set_offset); + ClassDB::bind_method(_MD("get_offset"),&CanvasLayer::get_offset); - ObjectTypeDB::bind_method(_MD("set_rotation","radians"),&CanvasLayer::set_rotation); - ObjectTypeDB::bind_method(_MD("get_rotation"),&CanvasLayer::get_rotation); + ClassDB::bind_method(_MD("set_rotation","radians"),&CanvasLayer::set_rotation); + ClassDB::bind_method(_MD("get_rotation"),&CanvasLayer::get_rotation); - ObjectTypeDB::bind_method(_MD("set_rotationd","degrees"),&CanvasLayer::set_rotationd); - ObjectTypeDB::bind_method(_MD("get_rotationd"),&CanvasLayer::get_rotationd); + ClassDB::bind_method(_MD("set_rotationd","degrees"),&CanvasLayer::set_rotationd); + ClassDB::bind_method(_MD("get_rotationd"),&CanvasLayer::get_rotationd); // TODO: Obsolete those two methods (old name) properly (GH-4397) - ObjectTypeDB::bind_method(_MD("_set_rotationd","degrees"),&CanvasLayer::_set_rotationd); - ObjectTypeDB::bind_method(_MD("_get_rotationd"),&CanvasLayer::_get_rotationd); + ClassDB::bind_method(_MD("_set_rotationd","degrees"),&CanvasLayer::_set_rotationd); + ClassDB::bind_method(_MD("_get_rotationd"),&CanvasLayer::_get_rotationd); - ObjectTypeDB::bind_method(_MD("set_scale","scale"),&CanvasLayer::set_scale); - ObjectTypeDB::bind_method(_MD("get_scale"),&CanvasLayer::get_scale); + ClassDB::bind_method(_MD("set_scale","scale"),&CanvasLayer::set_scale); + ClassDB::bind_method(_MD("get_scale"),&CanvasLayer::get_scale); - ObjectTypeDB::bind_method(_MD("set_custom_viewport","viewport:Viewport"),&CanvasLayer::set_custom_viewport); - ObjectTypeDB::bind_method(_MD("get_custom_viewport:Viewport"),&CanvasLayer::get_custom_viewport); + ClassDB::bind_method(_MD("set_custom_viewport","viewport:Viewport"),&CanvasLayer::set_custom_viewport); + ClassDB::bind_method(_MD("get_custom_viewport:Viewport"),&CanvasLayer::get_custom_viewport); - ObjectTypeDB::bind_method(_MD("get_world_2d:World2D"),&CanvasLayer::get_world_2d); -// ObjectTypeDB::bind_method(_MD("get_viewport"),&CanvasLayer::get_viewport); + ClassDB::bind_method(_MD("get_world_2d:World2D"),&CanvasLayer::get_world_2d); +// ClassDB::bind_method(_MD("get_viewport"),&CanvasLayer::get_viewport); ADD_PROPERTY( PropertyInfo(Variant::INT,"layer",PROPERTY_HINT_RANGE,"-128,128,1"),_SCS("set_layer"),_SCS("get_layer") ); //ADD_PROPERTY( PropertyInfo(Variant::MATRIX32,"transform",PROPERTY_HINT_RANGE),_SCS("set_transform"),_SCS("get_transform") ); @@ -296,4 +305,5 @@ CanvasLayer::CanvasLayer() { canvas = Ref<World2D>( memnew(World2D) ); custom_viewport=NULL; custom_viewport_id=0; + sort_index=0; } diff --git a/scene/main/canvas_layer.h b/scene/main/canvas_layer.h index a1311390be..8efbbd5a05 100644 --- a/scene/main/canvas_layer.h +++ b/scene/main/canvas_layer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,14 +36,14 @@ class Viewport; class CanvasLayer : public Node { - OBJ_TYPE( CanvasLayer, Node ); + GDCLASS( CanvasLayer, Node ); bool locrotscale_dirty; Vector2 ofs; Size2 scale; real_t rot; int layer; - Matrix32 transform; + Transform2D transform; Ref<World2D> canvas; ObjectID custom_viewport_id; // to check validity @@ -52,6 +52,8 @@ class CanvasLayer : public Node { RID viewport; Viewport *vp; + int sort_index; + // Deprecated, should be removed in a future version. void _set_rotationd(real_t p_rotation); real_t _get_rotationd() const; @@ -69,8 +71,8 @@ public: void set_layer(int p_xform); int get_layer() const; - void set_transform(const Matrix32& p_xform); - Matrix32 get_transform() const; + void set_transform(const Transform2D& p_xform); + Transform2D get_transform() const; void set_offset(const Vector2& p_offset); Vector2 get_offset() const; @@ -93,6 +95,9 @@ public: void set_custom_viewport(Node *p_viewport); Node* get_custom_viewport() const; + void reset_sort_index(); + int get_sort_index(); + CanvasLayer(); }; diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp index c713b5e4dc..25180b568f 100644 --- a/scene/main/http_request.cpp +++ b/scene/main/http_request.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -28,6 +28,10 @@ /*************************************************************************/ #include "http_request.h" +void HTTPRequest::set_ip_type(IP::Type p_type) { + client->set_ip_type(p_type); +} + void HTTPRequest::_redirect_request(const String& p_new_url) { @@ -35,7 +39,7 @@ void HTTPRequest::_redirect_request(const String& p_new_url) { Error HTTPRequest::_request() { - print_line("Requesting:\n\tURL: "+url+"\n\tString: "+request_string+"\n\tPort: "+itos(port)+"\n\tSSL: "+itos(use_ssl)+"\n\tValidate SSL: "+itos(validate_ssl)); + //print_line("Requesting:\n\tURL: "+url+"\n\tString: "+request_string+"\n\tPort: "+itos(port)+"\n\tSSL: "+itos(use_ssl)+"\n\tValidate SSL: "+itos(validate_ssl)); return client->connect(url,port,use_ssl,validate_ssl); } @@ -53,36 +57,36 @@ Error HTTPRequest::_parse_url(const String& p_url) { downloaded=0; redirections=0; - print_line("1 url: "+url); + //print_line("1 url: "+url); if (url.begins_with("http://")) { url=url.substr(7,url.length()-7); - print_line("no SSL"); + //print_line("no SSL"); } else if (url.begins_with("https://")) { url=url.substr(8,url.length()-8); use_ssl=true; port=443; - print_line("yes SSL"); + //print_line("yes SSL"); } else { ERR_EXPLAIN("Malformed URL"); ERR_FAIL_V(ERR_INVALID_PARAMETER); } - print_line("2 url: "+url); + //print_line("2 url: "+url); int slash_pos = url.find("/"); if (slash_pos!=-1) { request_string=url.substr(slash_pos,url.length()); url=url.substr(0,slash_pos); - print_line("request string: "+request_string); + //print_line("request string: "+request_string); } else { request_string="/"; - print_line("no request"); + //print_line("no request"); } - print_line("3 url: "+url); + //print_line("3 url: "+url); int colon_pos = url.find(":"); if (colon_pos!=-1) { @@ -91,7 +95,7 @@ Error HTTPRequest::_parse_url(const String& p_url) { ERR_FAIL_COND_V(port<1 || port > 65535,ERR_INVALID_PARAMETER); } - print_line("4 url: "+url); + //print_line("4 url: "+url); return OK; } @@ -146,11 +150,11 @@ Error HTTPRequest::request(const String& p_url, const Vector<String>& p_custom_h client->set_blocking_mode(false); err = _request(); if (err!=OK) { - call_deferred("_request_done",RESULT_CANT_CONNECT,0,StringArray(),ByteArray()); + call_deferred("_request_done",RESULT_CANT_CONNECT,0,PoolStringArray(),PoolByteArray()); return ERR_CANT_CONNECT; } - set_process(true); + set_process_internal(true); } @@ -166,7 +170,7 @@ void HTTPRequest::_thread_func(void *p_userdata) { Error err = hr->_request(); if (err!=OK) { - hr->call_deferred("_request_done",RESULT_CANT_CONNECT,0,StringArray(),ByteArray()); + hr->call_deferred("_request_done",RESULT_CANT_CONNECT,0,PoolStringArray(),PoolByteArray()); } else { while(!hr->thread_request_quit) { @@ -186,7 +190,7 @@ void HTTPRequest::cancel_request() { return; if (!use_threads) { - set_process(false); + set_process_internal(false); } else { thread_request_quit=true; Thread::wait_to_finish(thread); @@ -212,7 +216,7 @@ void HTTPRequest::cancel_request() { bool HTTPRequest::_handle_response(bool *ret_value) { if (!client->has_response()) { - call_deferred("_request_done",RESULT_NO_RESPONSE,0,StringArray(),ByteArray()); + call_deferred("_request_done",RESULT_NO_RESPONSE,0,PoolStringArray(),PoolByteArray()); *ret_value=true; return true; } @@ -224,7 +228,7 @@ bool HTTPRequest::_handle_response(bool *ret_value) { response_headers.resize(0); downloaded=0; for (List<String>::Element *E=rheaders.front();E;E=E->next()) { - print_line("HEADER: "+E->get()); + //print_line("HEADER: "+E->get()); response_headers.push_back(E->get()); } @@ -232,7 +236,7 @@ bool HTTPRequest::_handle_response(bool *ret_value) { //redirect if (max_redirects>=0 && redirections>=max_redirects) { - call_deferred("_request_done",RESULT_REDIRECT_LIMIT_REACHED,response_code,response_headers,ByteArray()); + call_deferred("_request_done",RESULT_REDIRECT_LIMIT_REACHED,response_code,response_headers,PoolByteArray()); *ret_value=true; return true; } @@ -245,7 +249,7 @@ bool HTTPRequest::_handle_response(bool *ret_value) { } } - print_line("NEW LOCATION: "+new_request); + //print_line("NEW LOCATION: "+new_request); if (new_request!="") { //process redirect @@ -261,7 +265,7 @@ bool HTTPRequest::_handle_response(bool *ret_value) { err = _request(); - print_line("new connection: "+itos(err)); + //print_line("new connection: "+itos(err)); if (err==OK) { request_sent=false; got_response=false; @@ -284,7 +288,7 @@ bool HTTPRequest::_update_connection() { switch( client->get_status() ) { case HTTPClient::STATUS_DISCONNECTED: { - call_deferred("_request_done",RESULT_CANT_CONNECT,0,StringArray(),ByteArray()); + call_deferred("_request_done",RESULT_CANT_CONNECT,0,PoolStringArray(),PoolByteArray()); return true; //end it, since it's doing something } break; case HTTPClient::STATUS_RESOLVING: { @@ -293,7 +297,7 @@ bool HTTPRequest::_update_connection() { return false; } break; case HTTPClient::STATUS_CANT_RESOLVE: { - call_deferred("_request_done",RESULT_CANT_RESOLVE,0,StringArray(),ByteArray()); + call_deferred("_request_done",RESULT_CANT_RESOLVE,0,PoolStringArray(),PoolByteArray()); return true; } break; @@ -304,7 +308,7 @@ bool HTTPRequest::_update_connection() { } break; //connecting to ip case HTTPClient::STATUS_CANT_CONNECT: { - call_deferred("_request_done",RESULT_CANT_CONNECT,0,StringArray(),ByteArray()); + call_deferred("_request_done",RESULT_CANT_CONNECT,0,PoolStringArray(),PoolByteArray()); return true; } break; @@ -322,7 +326,7 @@ bool HTTPRequest::_update_connection() { return ret_value; - call_deferred("_request_done",RESULT_SUCCESS,response_code,response_headers,ByteArray()); + call_deferred("_request_done",RESULT_SUCCESS,response_code,response_headers,PoolByteArray()); return true; } if (got_response && body_len<0) { @@ -332,7 +336,7 @@ bool HTTPRequest::_update_connection() { } - call_deferred("_request_done",RESULT_CHUNKED_BODY_SIZE_MISMATCH,response_code,response_headers,ByteArray()); + call_deferred("_request_done",RESULT_CHUNKED_BODY_SIZE_MISMATCH,response_code,response_headers,PoolByteArray()); return true; //request migh have been done } else { @@ -340,7 +344,7 @@ bool HTTPRequest::_update_connection() { Error err = client->request(method,request_string,headers,request_data); if (err!=OK) { - call_deferred("_request_done",RESULT_CONNECTION_ERROR,0,StringArray(),ByteArray()); + call_deferred("_request_done",RESULT_CONNECTION_ERROR,0,PoolStringArray(),PoolByteArray()); return true; } @@ -366,7 +370,7 @@ bool HTTPRequest::_update_connection() { if (!client->is_response_chunked() && client->get_response_body_length()==0) { - call_deferred("_request_done",RESULT_SUCCESS,response_code,response_headers,ByteArray()); + call_deferred("_request_done",RESULT_SUCCESS,response_code,response_headers,PoolByteArray()); return true; } @@ -377,7 +381,7 @@ bool HTTPRequest::_update_connection() { body_len=client->get_response_body_length(); if (body_size_limit>=0 && body_len>body_size_limit) { - call_deferred("_request_done",RESULT_BODY_SIZE_LIMIT_EXCEEDED,response_code,response_headers,ByteArray()); + call_deferred("_request_done",RESULT_BODY_SIZE_LIMIT_EXCEEDED,response_code,response_headers,PoolByteArray()); return true; } } @@ -386,7 +390,7 @@ bool HTTPRequest::_update_connection() { file=FileAccess::open(download_to_file,FileAccess::WRITE); if (!file) { - call_deferred("_request_done",RESULT_DOWNLOAD_FILE_CANT_OPEN,response_code,response_headers,ByteArray()); + call_deferred("_request_done",RESULT_DOWNLOAD_FILE_CANT_OPEN,response_code,response_headers,PoolByteArray()); return true; } } @@ -396,14 +400,14 @@ bool HTTPRequest::_update_connection() { //print_line("BODY: "+itos(body.size())); client->poll(); - ByteArray chunk = client->read_response_body_chunk(); + PoolByteArray chunk = client->read_response_body_chunk(); downloaded+=chunk.size(); if (file) { - ByteArray::Read r=chunk.read(); + PoolByteArray::Read r=chunk.read(); file->store_buffer(r.ptr(),chunk.size()); if (file->get_error()!=OK) { - call_deferred("_request_done",RESULT_DOWNLOAD_FILE_WRITE_ERROR,response_code,response_headers,ByteArray()); + call_deferred("_request_done",RESULT_DOWNLOAD_FILE_WRITE_ERROR,response_code,response_headers,PoolByteArray()); return true; } } else { @@ -411,7 +415,7 @@ bool HTTPRequest::_update_connection() { } if (body_size_limit>=0 && downloaded>body_size_limit) { - call_deferred("_request_done",RESULT_BODY_SIZE_LIMIT_EXCEEDED,response_code,response_headers,ByteArray()); + call_deferred("_request_done",RESULT_BODY_SIZE_LIMIT_EXCEEDED,response_code,response_headers,PoolByteArray()); return true; } @@ -431,11 +435,11 @@ bool HTTPRequest::_update_connection() { } break; // request resulted in body: { } break which must be read case HTTPClient::STATUS_CONNECTION_ERROR: { - call_deferred("_request_done",RESULT_CONNECTION_ERROR,0,StringArray(),ByteArray()); + call_deferred("_request_done",RESULT_CONNECTION_ERROR,0,PoolStringArray(),PoolByteArray()); return true; } break; case HTTPClient::STATUS_SSL_HANDSHAKE_ERROR: { - call_deferred("_request_done",RESULT_SSL_HANDSHAKE_ERROR,0,StringArray(),ByteArray()); + call_deferred("_request_done",RESULT_SSL_HANDSHAKE_ERROR,0,PoolStringArray(),PoolByteArray()); return true; } break; @@ -445,7 +449,7 @@ bool HTTPRequest::_update_connection() { } -void HTTPRequest::_request_done(int p_status, int p_code, const StringArray& headers, const ByteArray& p_data) { +void HTTPRequest::_request_done(int p_status, int p_code, const PoolStringArray& headers, const PoolByteArray& p_data) { cancel_request(); @@ -455,14 +459,14 @@ void HTTPRequest::_request_done(int p_status, int p_code, const StringArray& hea void HTTPRequest::_notification(int p_what) { - if (p_what==NOTIFICATION_PROCESS) { + if (p_what==NOTIFICATION_INTERNAL_PROCESS) { if (use_threads) return; bool done = _update_connection(); if (done) { - set_process(false); + set_process_internal(false); //cancel_request(); called from _request done now } } @@ -535,34 +539,35 @@ int HTTPRequest::get_body_size() const{ void HTTPRequest::_bind_methods() { - ObjectTypeDB::bind_method(_MD("request","url","custom_headers","ssl_validate_domain","method","request_data"),&HTTPRequest::request,DEFVAL(StringArray()),DEFVAL(true),DEFVAL(HTTPClient::METHOD_GET),DEFVAL(String())); - ObjectTypeDB::bind_method(_MD("cancel_request"),&HTTPRequest::cancel_request); + ClassDB::bind_method(_MD("set_ip_type","ip_type"),&HTTPRequest::set_ip_type); + ClassDB::bind_method(_MD("request","url","custom_headers","ssl_validate_domain","method","request_data"),&HTTPRequest::request,DEFVAL(PoolStringArray()),DEFVAL(true),DEFVAL(HTTPClient::METHOD_GET),DEFVAL(String())); + ClassDB::bind_method(_MD("cancel_request"),&HTTPRequest::cancel_request); - ObjectTypeDB::bind_method(_MD("get_http_client_status"),&HTTPRequest::get_http_client_status); + ClassDB::bind_method(_MD("get_http_client_status"),&HTTPRequest::get_http_client_status); - ObjectTypeDB::bind_method(_MD("set_use_threads","enable"),&HTTPRequest::set_use_threads); - ObjectTypeDB::bind_method(_MD("is_using_threads"),&HTTPRequest::is_using_threads); + ClassDB::bind_method(_MD("set_use_threads","enable"),&HTTPRequest::set_use_threads); + ClassDB::bind_method(_MD("is_using_threads"),&HTTPRequest::is_using_threads); - ObjectTypeDB::bind_method(_MD("set_body_size_limit","bytes"),&HTTPRequest::set_body_size_limit); - ObjectTypeDB::bind_method(_MD("get_body_size_limit"),&HTTPRequest::get_body_size_limit); + ClassDB::bind_method(_MD("set_body_size_limit","bytes"),&HTTPRequest::set_body_size_limit); + ClassDB::bind_method(_MD("get_body_size_limit"),&HTTPRequest::get_body_size_limit); - ObjectTypeDB::bind_method(_MD("set_max_redirects","amount"),&HTTPRequest::set_max_redirects); - ObjectTypeDB::bind_method(_MD("get_max_redirects"),&HTTPRequest::get_max_redirects); + ClassDB::bind_method(_MD("set_max_redirects","amount"),&HTTPRequest::set_max_redirects); + ClassDB::bind_method(_MD("get_max_redirects"),&HTTPRequest::get_max_redirects); - ObjectTypeDB::bind_method(_MD("set_download_file","path"),&HTTPRequest::set_download_file); - ObjectTypeDB::bind_method(_MD("get_download_file"),&HTTPRequest::get_download_file); + ClassDB::bind_method(_MD("set_download_file","path"),&HTTPRequest::set_download_file); + ClassDB::bind_method(_MD("get_download_file"),&HTTPRequest::get_download_file); - ObjectTypeDB::bind_method(_MD("get_downloaded_bytes"),&HTTPRequest::get_downloaded_bytes); - ObjectTypeDB::bind_method(_MD("get_body_size"),&HTTPRequest::get_body_size); + ClassDB::bind_method(_MD("get_downloaded_bytes"),&HTTPRequest::get_downloaded_bytes); + ClassDB::bind_method(_MD("get_body_size"),&HTTPRequest::get_body_size); - ObjectTypeDB::bind_method(_MD("_redirect_request"),&HTTPRequest::_redirect_request); - ObjectTypeDB::bind_method(_MD("_request_done"),&HTTPRequest::_request_done); + ClassDB::bind_method(_MD("_redirect_request"),&HTTPRequest::_redirect_request); + ClassDB::bind_method(_MD("_request_done"),&HTTPRequest::_request_done); ADD_PROPERTY(PropertyInfo(Variant::BOOL,"use_threads"),_SCS("set_use_threads"),_SCS("is_using_threads")); ADD_PROPERTY(PropertyInfo(Variant::INT,"body_size_limit",PROPERTY_HINT_RANGE,"-1,2000000000"),_SCS("set_body_size_limit"),_SCS("get_body_size_limit")); ADD_PROPERTY(PropertyInfo(Variant::INT,"max_redirects",PROPERTY_HINT_RANGE,"-1,1024"),_SCS("set_max_redirects"),_SCS("get_max_redirects")); - ADD_SIGNAL(MethodInfo("request_completed",PropertyInfo(Variant::INT,"result"),PropertyInfo(Variant::INT,"response_code"),PropertyInfo(Variant::STRING_ARRAY,"headers"),PropertyInfo(Variant::RAW_ARRAY,"body"))); + ADD_SIGNAL(MethodInfo("request_completed",PropertyInfo(Variant::INT,"result"),PropertyInfo(Variant::INT,"response_code"),PropertyInfo(Variant::POOL_STRING_ARRAY,"headers"),PropertyInfo(Variant::POOL_BYTE_ARRAY,"body"))); BIND_CONSTANT( RESULT_SUCCESS ); //BIND_CONSTANT( RESULT_NO_BODY ); diff --git a/scene/main/http_request.h b/scene/main/http_request.h index 705799f044..51c5ddeb69 100644 --- a/scene/main/http_request.h +++ b/scene/main/http_request.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ class HTTPRequest : public Node { - OBJ_TYPE(HTTPRequest,Node); + GDCLASS(HTTPRequest,Node); public: enum Result { @@ -71,12 +71,12 @@ private: bool request_sent; Ref<HTTPClient> client; - ByteArray body; + PoolByteArray body; volatile bool use_threads; bool got_response; int response_code; - DVector<String> response_headers; + PoolVector<String> response_headers; String download_to_file; @@ -107,7 +107,7 @@ private: Thread *thread; - void _request_done(int p_status, int p_code, const StringArray& headers, const ByteArray& p_data); + void _request_done(int p_status, int p_code, const PoolStringArray& headers, const PoolByteArray& p_data); static void _thread_func(void *p_userdata); protected: @@ -116,6 +116,7 @@ protected: static void _bind_methods(); public: + void set_ip_type(IP::Type p_type); Error request(const String& p_url, const Vector<String>& p_custom_headers=Vector<String>(), bool p_ssl_validate_domain=true, HTTPClient::Method p_method=HTTPClient::METHOD_GET, const String& p_request_data=""); //connects to a full url and perform request void cancel_request(); HTTPClient::Status get_http_client_status() const; diff --git a/scene/main/instance_placeholder.cpp b/scene/main/instance_placeholder.cpp index fb047ea5e4..5d1b0495c0 100644 --- a/scene/main/instance_placeholder.cpp +++ b/scene/main/instance_placeholder.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -101,13 +101,30 @@ void InstancePlaceholder::replace_by_instance(const Ref<PackedScene> &p_custom_s base->remove_child(this); base->add_child(scene); base->move_child(scene,pos); - } +Dictionary InstancePlaceholder::get_stored_values(bool p_with_order) { + + Dictionary ret; + PoolStringArray order; + + for(List<PropSet>::Element *E=stored_values.front();E;E=E->next()) { + ret[E->get().name] = E->get().value; + if (p_with_order) + order.push_back(E->get().name); + }; + + if (p_with_order) + ret[".order"] = order; + + return ret; +}; + void InstancePlaceholder::_bind_methods() { - ObjectTypeDB::bind_method(_MD("replace_by_instance","custom_scene:PackedScene"),&InstancePlaceholder::replace_by_instance,DEFVAL(Variant())); - ObjectTypeDB::bind_method(_MD("get_instance_path"),&InstancePlaceholder::get_instance_path); + ClassDB::bind_method(_MD("get_stored_values","with_order"),&InstancePlaceholder::get_stored_values,DEFVAL(false)); + ClassDB::bind_method(_MD("replace_by_instance","custom_scene:PackedScene"),&InstancePlaceholder::replace_by_instance,DEFVAL(Variant())); + ClassDB::bind_method(_MD("get_instance_path"),&InstancePlaceholder::get_instance_path); } InstancePlaceholder::InstancePlaceholder() { diff --git a/scene/main/instance_placeholder.h b/scene/main/instance_placeholder.h index ef76686196..069b1c9756 100644 --- a/scene/main/instance_placeholder.h +++ b/scene/main/instance_placeholder.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class PackedScene; class InstancePlaceholder : public Node { - OBJ_TYPE(InstancePlaceholder,Node); + GDCLASS(InstancePlaceholder,Node); String path; struct PropSet { @@ -57,6 +57,8 @@ public: void set_instance_path(const String& p_name); String get_instance_path() const; + Dictionary get_stored_values(bool p_with_order = false); + void replace_by_instance(const Ref<PackedScene>& p_custom_scene=Ref<PackedScene>()); InstancePlaceholder(); diff --git a/scene/main/node.cpp b/scene/main/node.cpp index f4fb48682c..672f54e187 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -89,6 +89,7 @@ void Node::_notification(int p_notification) { data.network_owner=this; } + if (data.input) add_to_group("_vp_input"+itos(get_viewport()->get_instance_ID())); if (data.unhandled_input) @@ -128,6 +129,26 @@ void Node::_notification(int p_notification) { if (get_script_instance()) { + if (get_script_instance()->has_method(SceneStringNames::get_singleton()->_input)) { + set_process_input(true); + } + + if (get_script_instance()->has_method(SceneStringNames::get_singleton()->_unhandled_input)) { + set_process_unhandled_input(true); + } + + if (get_script_instance()->has_method(SceneStringNames::get_singleton()->_unhandled_key_input)) { + set_process_unhandled_key_input(true); + } + + if (get_script_instance()->has_method(SceneStringNames::get_singleton()->_process)) { + set_process(true); + } + + if (get_script_instance()->has_method(SceneStringNames::get_singleton()->_fixed_process)) { + set_fixed_process(true); + } + Variant::CallError err; get_script_instance()->call_multilevel_reversed(SceneStringNames::get_singleton()->_ready,NULL,0); } @@ -166,13 +187,17 @@ void Node::_notification(int p_notification) { void Node::_propagate_ready() { + data.ready_notified=true; data.blocked++; for (int i=0;i<data.children.size();i++) { data.children[i]->_propagate_ready(); } data.blocked--; - notification(NOTIFICATION_READY); + if (data.ready_first) { + notification(NOTIFICATION_READY); + data.ready_first=false; + } } @@ -293,6 +318,7 @@ void Node::_propagate_exit_tree() { data.tree->tree_changed(); data.inside_tree=false; + data.ready_notified=false; data.tree=NULL; data.depth=-1; @@ -315,6 +341,12 @@ void Node::move_child(Node *p_child,int p_pos) { } + if (p_child->data.pos==p_pos) + return; //do nothing + + int motion_from = MIN(p_pos,p_child->data.pos); + int motion_to = MAX(p_pos,p_child->data.pos); + data.children.remove( p_child->data.pos ); data.children.insert( p_pos, p_child ); @@ -324,13 +356,13 @@ void Node::move_child(Node *p_child,int p_pos) { data.blocked++; //new pos first - for (int i=0;i<data.children.size();i++) { + for (int i=motion_from;i<=motion_to;i++) { data.children[i]->data.pos=i; } // notification second move_child_notify(p_child); - for (int i=0;i<data.children.size();i++) { + for (int i=motion_from;i<=motion_to;i++) { data.children[i]->notification( NOTIFICATION_MOVED_IN_PARENT ); } @@ -394,6 +426,33 @@ void Node::set_fixed_process(bool p_process) { _change_notify("fixed_process"); } +bool Node::is_fixed_processing() const { + + return data.fixed_process; +} + +void Node::set_fixed_process_internal(bool p_process_internal) { + + if (data.fixed_process_internal==p_process_internal) + return; + + data.fixed_process_internal=p_process_internal; + + if (data.fixed_process_internal) + add_to_group("fixed_process_internal",false); + else + remove_from_group("fixed_process_internal"); + + data.fixed_process_internal=p_process_internal; + _change_notify("fixed_process_internal"); +} + +bool Node::is_fixed_processing_internal() const { + + return data.fixed_process_internal; +} + + void Node::set_pause_mode(PauseMode p_mode) { if (data.pause_mode==p_mode) @@ -1108,6 +1167,14 @@ float Node::get_fixed_process_delta_time() const { return 0; } +float Node::get_process_delta_time() const { + + if (data.tree) + return data.tree->get_idle_process_time(); + else + return 0; +} + void Node::set_process(bool p_idle_process) { if (data.idle_process==p_idle_process) @@ -1124,22 +1191,31 @@ void Node::set_process(bool p_idle_process) { _change_notify("idle_process"); } -float Node::get_process_delta_time() const { - if (data.tree) - return data.tree->get_idle_process_time(); - else - return 0; +bool Node::is_processing() const { + + return data.idle_process; } -bool Node::is_fixed_processing() const { +void Node::set_process_internal(bool p_idle_process_internal) { - return data.fixed_process; + if (data.idle_process_internal==p_idle_process_internal) + return; + + data.idle_process_internal=p_idle_process_internal; + + if (data.idle_process_internal) + add_to_group("idle_process_internal",false); + else + remove_from_group("idle_process_internal"); + + data.idle_process_internal=p_idle_process_internal; + _change_notify("idle_process_internal"); } -bool Node::is_processing() const { +bool Node::is_processing_internal() const { - return data.idle_process; + return data.idle_process_internal; } @@ -1307,7 +1383,7 @@ String Node::_generate_serial_child_name(Node *p_child) { if (name=="") { - name = p_child->get_type(); + name = p_child->get_class(); } // Extract trailing number @@ -2226,7 +2302,7 @@ Node *Node::_duplicate(bool p_use_instancing) const { } else { - Object *obj = ObjectTypeDB::instance(get_type()); + Object *obj = ClassDB::instance(get_class()); ERR_FAIL_COND_V(!obj,NULL); node = obj->cast_to<Node>(); if (!node) @@ -2311,9 +2387,9 @@ void Node::_duplicate_and_reown(Node* p_new_parent, const Map<Node*,Node*>& p_re ERR_FAIL_COND(!node); } else { - Object *obj = ObjectTypeDB::instance(get_type()); + Object *obj = ClassDB::instance(get_class()); if (!obj) { - print_line("could not duplicate: "+String(get_type())); + print_line("could not duplicate: "+String(get_class())); } ERR_FAIL_COND(!obj); node = obj->cast_to<Node>(); @@ -2407,9 +2483,9 @@ Node *Node::duplicate_and_reown(const Map<Node*,Node*>& p_reown_map) const { Node *node=NULL; - Object *obj = ObjectTypeDB::instance(get_type()); + Object *obj = ClassDB::instance(get_class()); if (!obj) { - print_line("could not duplicate: "+String(get_type())); + print_line("could not duplicate: "+String(get_class())); } ERR_FAIL_COND_V(!obj,NULL); node = obj->cast_to<Node>(); @@ -2662,7 +2738,9 @@ void Node::_set_tree(SceneTree *p_tree) { _propagate_enter_tree(); - _propagate_ready(); //reverse_notification(NOTIFICATION_READY); + if (!data.parent || data.parent->data.ready_notified) { // No parent (root) or parent ready + _propagate_ready(); //reverse_notification(NOTIFICATION_READY); + } tree_changed_b=data.tree; @@ -2695,7 +2773,7 @@ static void _Node_debug_sn(Object *p_obj) { path=n->get_name(); else path=String(p->get_name())+"/"+p->get_path_to(n); - print_line(itos(p_obj->get_instance_ID())+"- Stray Node: "+path+" (Type: "+n->get_type()+")"); + print_line(itos(p_obj->get_instance_ID())+"- Stray Node: "+path+" (Type: "+n->get_class()+")"); } @@ -2804,93 +2882,105 @@ bool Node::is_displayed_folded() const { return data.display_folded; } +void Node::request_ready() { + data.ready_first=true; +} + void Node::_bind_methods() { - _GLOBAL_DEF("node/name_num_separator",0); - Globals::get_singleton()->set_custom_property_info("node/name_num_separator",PropertyInfo(Variant::INT,"node/name_num_separator",PROPERTY_HINT_ENUM, "None,Space,Underscore,Dash")); - - - ObjectTypeDB::bind_method(_MD("_add_child_below_node","node:Node","child_node:Node","legible_unique_name"),&Node::add_child_below_node,DEFVAL(false)); - - ObjectTypeDB::bind_method(_MD("set_name","name"),&Node::set_name); - ObjectTypeDB::bind_method(_MD("get_name"),&Node::get_name); - ObjectTypeDB::bind_method(_MD("add_child","node:Node","legible_unique_name"),&Node::add_child,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("remove_child","node:Node"),&Node::remove_child); - //ObjectTypeDB::bind_method(_MD("remove_and_delete_child","node:Node"),&Node::remove_and_delete_child); - ObjectTypeDB::bind_method(_MD("get_child_count"),&Node::get_child_count); - ObjectTypeDB::bind_method(_MD("get_children"),&Node::_get_children); - ObjectTypeDB::bind_method(_MD("get_child:Node","idx"),&Node::get_child); - ObjectTypeDB::bind_method(_MD("has_node","path"),&Node::has_node); - ObjectTypeDB::bind_method(_MD("get_node:Node","path"),&Node::get_node); - ObjectTypeDB::bind_method(_MD("get_parent:Node"),&Node::get_parent); - ObjectTypeDB::bind_method(_MD("find_node:Node","mask","recursive","owned"),&Node::find_node,DEFVAL(true),DEFVAL(true)); - ObjectTypeDB::bind_method(_MD("has_node_and_resource","path"),&Node::has_node_and_resource); - ObjectTypeDB::bind_method(_MD("get_node_and_resource","path"),&Node::_get_node_and_resource); - - ObjectTypeDB::bind_method(_MD("is_inside_tree"),&Node::is_inside_tree); - ObjectTypeDB::bind_method(_MD("is_a_parent_of","node:Node"),&Node::is_a_parent_of); - ObjectTypeDB::bind_method(_MD("is_greater_than","node:Node"),&Node::is_greater_than); - ObjectTypeDB::bind_method(_MD("get_path"),&Node::get_path); - ObjectTypeDB::bind_method(_MD("get_path_to","node:Node"),&Node::get_path_to); - ObjectTypeDB::bind_method(_MD("add_to_group","group","persistent"),&Node::add_to_group,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("remove_from_group","group"),&Node::remove_from_group); - ObjectTypeDB::bind_method(_MD("is_in_group","group"),&Node::is_in_group); - ObjectTypeDB::bind_method(_MD("move_child","child_node:Node","to_pos"),&Node::move_child); - ObjectTypeDB::bind_method(_MD("get_groups"),&Node::_get_groups); - ObjectTypeDB::bind_method(_MD("raise"),&Node::raise); - ObjectTypeDB::bind_method(_MD("set_owner","owner:Node"),&Node::set_owner); - ObjectTypeDB::bind_method(_MD("get_owner:Node"),&Node::get_owner); - ObjectTypeDB::bind_method(_MD("remove_and_skip"),&Node::remove_and_skip); - ObjectTypeDB::bind_method(_MD("get_index"),&Node::get_index); - ObjectTypeDB::bind_method(_MD("print_tree"),&Node::print_tree); - ObjectTypeDB::bind_method(_MD("set_filename","filename"),&Node::set_filename); - ObjectTypeDB::bind_method(_MD("get_filename"),&Node::get_filename); - ObjectTypeDB::bind_method(_MD("propagate_notification","what"),&Node::propagate_notification); - ObjectTypeDB::bind_method(_MD("set_fixed_process","enable"),&Node::set_fixed_process); - ObjectTypeDB::bind_method(_MD("get_fixed_process_delta_time"),&Node::get_fixed_process_delta_time); - ObjectTypeDB::bind_method(_MD("is_fixed_processing"),&Node::is_fixed_processing); - ObjectTypeDB::bind_method(_MD("set_process","enable"),&Node::set_process); - ObjectTypeDB::bind_method(_MD("get_process_delta_time"),&Node::get_process_delta_time); - ObjectTypeDB::bind_method(_MD("is_processing"),&Node::is_processing); - ObjectTypeDB::bind_method(_MD("set_process_input","enable"),&Node::set_process_input); - ObjectTypeDB::bind_method(_MD("is_processing_input"),&Node::is_processing_input); - ObjectTypeDB::bind_method(_MD("set_process_unhandled_input","enable"),&Node::set_process_unhandled_input); - ObjectTypeDB::bind_method(_MD("is_processing_unhandled_input"),&Node::is_processing_unhandled_input); - ObjectTypeDB::bind_method(_MD("set_process_unhandled_key_input","enable"),&Node::set_process_unhandled_key_input); - ObjectTypeDB::bind_method(_MD("is_processing_unhandled_key_input"),&Node::is_processing_unhandled_key_input); - ObjectTypeDB::bind_method(_MD("set_pause_mode","mode"),&Node::set_pause_mode); - ObjectTypeDB::bind_method(_MD("get_pause_mode"),&Node::get_pause_mode); - ObjectTypeDB::bind_method(_MD("can_process"),&Node::can_process); - ObjectTypeDB::bind_method(_MD("print_stray_nodes"),&Node::_print_stray_nodes); - ObjectTypeDB::bind_method(_MD("get_position_in_parent"),&Node::get_position_in_parent); - ObjectTypeDB::bind_method(_MD("set_display_folded","fold"),&Node::set_display_folded); - ObjectTypeDB::bind_method(_MD("is_displayed_folded"),&Node::is_displayed_folded); - - ObjectTypeDB::bind_method(_MD("get_tree:SceneTree"),&Node::get_tree); - - ObjectTypeDB::bind_method(_MD("duplicate:Node","use_instancing"),&Node::duplicate,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("replace_by","node:Node","keep_data"),&Node::replace_by,DEFVAL(false)); - - ObjectTypeDB::bind_method(_MD("set_scene_instance_load_placeholder","load_placeholder"),&Node::set_scene_instance_load_placeholder); - ObjectTypeDB::bind_method(_MD("get_scene_instance_load_placeholder"),&Node::get_scene_instance_load_placeholder); - - - ObjectTypeDB::bind_method(_MD("get_viewport"),&Node::get_viewport); - - ObjectTypeDB::bind_method(_MD("queue_free"),&Node::queue_delete); - - ObjectTypeDB::bind_method(_MD("set_network_mode","mode"),&Node::set_network_mode); - ObjectTypeDB::bind_method(_MD("get_network_mode"),&Node::get_network_mode); - - ObjectTypeDB::bind_method(_MD("is_network_master"),&Node::is_network_master); - - ObjectTypeDB::bind_method(_MD("rpc_config","method","mode"),&Node::rpc_config); - ObjectTypeDB::bind_method(_MD("rset_config","property","mode"),&Node::rset_config); + _GLOBAL_DEF("editor/node_name_num_separator",0); + GlobalConfig::get_singleton()->set_custom_property_info("editor/node_name_num_separator",PropertyInfo(Variant::INT,"editor/node_name_num_separator",PROPERTY_HINT_ENUM, "None,Space,Underscore,Dash")); + + + ClassDB::bind_method(_MD("_add_child_below_node","node:Node","child_node:Node","legible_unique_name"),&Node::add_child_below_node,DEFVAL(false)); + + ClassDB::bind_method(_MD("set_name","name"),&Node::set_name); + ClassDB::bind_method(_MD("get_name"),&Node::get_name); + ClassDB::bind_method(_MD("add_child","node:Node","legible_unique_name"),&Node::add_child,DEFVAL(false)); + ClassDB::bind_method(_MD("remove_child","node:Node"),&Node::remove_child); + //ClassDB::bind_method(_MD("remove_and_delete_child","node:Node"),&Node::remove_and_delete_child); + ClassDB::bind_method(_MD("get_child_count"),&Node::get_child_count); + ClassDB::bind_method(_MD("get_children"),&Node::_get_children); + ClassDB::bind_method(_MD("get_child:Node","idx"),&Node::get_child); + ClassDB::bind_method(_MD("has_node","path"),&Node::has_node); + ClassDB::bind_method(_MD("get_node:Node","path"),&Node::get_node); + ClassDB::bind_method(_MD("get_parent:Node"),&Node::get_parent); + ClassDB::bind_method(_MD("find_node:Node","mask","recursive","owned"),&Node::find_node,DEFVAL(true),DEFVAL(true)); + ClassDB::bind_method(_MD("has_node_and_resource","path"),&Node::has_node_and_resource); + ClassDB::bind_method(_MD("get_node_and_resource","path"),&Node::_get_node_and_resource); + + ClassDB::bind_method(_MD("is_inside_tree"),&Node::is_inside_tree); + ClassDB::bind_method(_MD("is_a_parent_of","node:Node"),&Node::is_a_parent_of); + ClassDB::bind_method(_MD("is_greater_than","node:Node"),&Node::is_greater_than); + ClassDB::bind_method(_MD("get_path"),&Node::get_path); + ClassDB::bind_method(_MD("get_path_to","node:Node"),&Node::get_path_to); + ClassDB::bind_method(_MD("add_to_group","group","persistent"),&Node::add_to_group,DEFVAL(false)); + ClassDB::bind_method(_MD("remove_from_group","group"),&Node::remove_from_group); + ClassDB::bind_method(_MD("is_in_group","group"),&Node::is_in_group); + ClassDB::bind_method(_MD("move_child","child_node:Node","to_pos"),&Node::move_child); + ClassDB::bind_method(_MD("get_groups"),&Node::_get_groups); + ClassDB::bind_method(_MD("raise"),&Node::raise); + ClassDB::bind_method(_MD("set_owner","owner:Node"),&Node::set_owner); + ClassDB::bind_method(_MD("get_owner:Node"),&Node::get_owner); + ClassDB::bind_method(_MD("remove_and_skip"),&Node::remove_and_skip); + ClassDB::bind_method(_MD("get_index"),&Node::get_index); + ClassDB::bind_method(_MD("print_tree"),&Node::print_tree); + ClassDB::bind_method(_MD("set_filename","filename"),&Node::set_filename); + ClassDB::bind_method(_MD("get_filename"),&Node::get_filename); + ClassDB::bind_method(_MD("propagate_notification","what"),&Node::propagate_notification); + ClassDB::bind_method(_MD("set_fixed_process","enable"),&Node::set_fixed_process); + ClassDB::bind_method(_MD("get_fixed_process_delta_time"),&Node::get_fixed_process_delta_time); + ClassDB::bind_method(_MD("is_fixed_processing"),&Node::is_fixed_processing); + ClassDB::bind_method(_MD("get_process_delta_time"),&Node::get_process_delta_time); + ClassDB::bind_method(_MD("set_process","enable"),&Node::set_process); + ClassDB::bind_method(_MD("is_processing"),&Node::is_processing); + ClassDB::bind_method(_MD("set_process_input","enable"),&Node::set_process_input); + ClassDB::bind_method(_MD("is_processing_input"),&Node::is_processing_input); + ClassDB::bind_method(_MD("set_process_unhandled_input","enable"),&Node::set_process_unhandled_input); + ClassDB::bind_method(_MD("is_processing_unhandled_input"),&Node::is_processing_unhandled_input); + ClassDB::bind_method(_MD("set_process_unhandled_key_input","enable"),&Node::set_process_unhandled_key_input); + ClassDB::bind_method(_MD("is_processing_unhandled_key_input"),&Node::is_processing_unhandled_key_input); + ClassDB::bind_method(_MD("set_pause_mode","mode"),&Node::set_pause_mode); + ClassDB::bind_method(_MD("get_pause_mode"),&Node::get_pause_mode); + ClassDB::bind_method(_MD("can_process"),&Node::can_process); + ClassDB::bind_method(_MD("print_stray_nodes"),&Node::_print_stray_nodes); + ClassDB::bind_method(_MD("get_position_in_parent"),&Node::get_position_in_parent); + ClassDB::bind_method(_MD("set_display_folded","fold"),&Node::set_display_folded); + ClassDB::bind_method(_MD("is_displayed_folded"),&Node::is_displayed_folded); + + ClassDB::bind_method(_MD("set_process_internal","enable"),&Node::set_process_internal); + ClassDB::bind_method(_MD("is_processing_internal"),&Node::is_processing_internal); + + ClassDB::bind_method(_MD("set_fixed_process_internal","enable"),&Node::set_fixed_process_internal); + ClassDB::bind_method(_MD("is_fixed_processing_internal"),&Node::is_fixed_processing_internal); + + ClassDB::bind_method(_MD("get_tree:SceneTree"),&Node::get_tree); + + ClassDB::bind_method(_MD("duplicate:Node","use_instancing"),&Node::duplicate,DEFVAL(false)); + ClassDB::bind_method(_MD("replace_by","node:Node","keep_data"),&Node::replace_by,DEFVAL(false)); + + ClassDB::bind_method(_MD("set_scene_instance_load_placeholder","load_placeholder"),&Node::set_scene_instance_load_placeholder); + ClassDB::bind_method(_MD("get_scene_instance_load_placeholder"),&Node::get_scene_instance_load_placeholder); + + + ClassDB::bind_method(_MD("get_viewport"),&Node::get_viewport); + + ClassDB::bind_method(_MD("queue_free"),&Node::queue_delete); + + ClassDB::bind_method(_MD("request_ready"),&Node::request_ready); + + ClassDB::bind_method(_MD("set_network_mode","mode"),&Node::set_network_mode); + ClassDB::bind_method(_MD("get_network_mode"),&Node::get_network_mode); + + ClassDB::bind_method(_MD("is_network_master"),&Node::is_network_master); + + ClassDB::bind_method(_MD("rpc_config","method","mode"),&Node::rpc_config); + ClassDB::bind_method(_MD("rset_config","property","mode"),&Node::rset_config); #ifdef TOOLS_ENABLED - ObjectTypeDB::bind_method(_MD("_set_import_path","import_path"),&Node::set_import_path); - ObjectTypeDB::bind_method(_MD("_get_import_path"),&Node::get_import_path); + ClassDB::bind_method(_MD("_set_import_path","import_path"),&Node::set_import_path); + ClassDB::bind_method(_MD("_get_import_path"),&Node::get_import_path); ADD_PROPERTYNZ( PropertyInfo(Variant::NODE_PATH,"_import_path",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_import_path"),_SCS("_get_import_path")); #endif @@ -2902,24 +2992,24 @@ void Node::_bind_methods() { mi.name="rpc"; - ObjectTypeDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"rpc",&Node::_rpc_bind,mi); + ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"rpc",&Node::_rpc_bind,mi); mi.name="rpc_unreliable"; - ObjectTypeDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"rpc_unreliable",&Node::_rpc_unreliable_bind,mi); + ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"rpc_unreliable",&Node::_rpc_unreliable_bind,mi); mi.arguments.push_front( PropertyInfo( Variant::INT, "peer_id") ); mi.name="rpc_id"; - ObjectTypeDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"rpc_id",&Node::_rpc_id_bind,mi); + ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"rpc_id",&Node::_rpc_id_bind,mi); mi.name="rpc_unreliable_id"; - ObjectTypeDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"rpc_unreliable_id",&Node::_rpc_unreliable_id_bind,mi); + ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"rpc_unreliable_id",&Node::_rpc_unreliable_id_bind,mi); } - ObjectTypeDB::bind_method(_MD("rset","property","value:Variant"),&Node::rset); - ObjectTypeDB::bind_method(_MD("rset_id","peer_id","property","value:Variant"),&Node::rset_id); - ObjectTypeDB::bind_method(_MD("rset_unreliable","property","value:Variant"),&Node::rset_unreliable); - ObjectTypeDB::bind_method(_MD("rset_unreliable_id","peer_id","property","value:Variant"),&Node::rset_unreliable_id); + ClassDB::bind_method(_MD("rset","property","value:Variant"),&Node::rset); + ClassDB::bind_method(_MD("rset_id","peer_id","property","value:Variant"),&Node::rset_id); + ClassDB::bind_method(_MD("rset_unreliable","property","value:Variant"),&Node::rset_unreliable); + ClassDB::bind_method(_MD("rset_unreliable_id","peer_id","property","value:Variant"),&Node::rset_unreliable_id); BIND_CONSTANT( NOTIFICATION_ENTER_TREE ); @@ -2937,6 +3027,9 @@ void Node::_bind_methods() { BIND_CONSTANT( NOTIFICATION_DRAG_BEGIN ); BIND_CONSTANT( NOTIFICATION_DRAG_END ); BIND_CONSTANT( NOTIFICATION_PATH_CHANGED); + BIND_CONSTANT( NOTIFICATION_TRANSLATION_CHANGED ); + BIND_CONSTANT( NOTIFICATION_INTERNAL_PROCESS ); + BIND_CONSTANT( NOTIFICATION_INTERNAL_FIXED_PROCESS ); BIND_CONSTANT( NETWORK_MODE_INHERIT ); @@ -2961,7 +3054,8 @@ void Node::_bind_methods() { // ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/fixed_process" ), _SCS("set_fixed_process"),_SCS("is_fixed_processing") ); //ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/input" ), _SCS("set_process_input"),_SCS("is_processing_input" ) ); //ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "process/unhandled_input" ), _SCS("set_process_unhandled_input"),_SCS("is_processing_unhandled_input" ) ); - ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "process/pause_mode",PROPERTY_HINT_ENUM,"Inherit,Stop,Process" ), _SCS("set_pause_mode"),_SCS("get_pause_mode" ) ); + ADD_GROUP("Pause","pause_"); + ADD_PROPERTYNZ( PropertyInfo( Variant::INT, "pause_mode",PROPERTY_HINT_ENUM,"Inherit,Stop,Process" ), _SCS("set_pause_mode"),_SCS("get_pause_mode" ) ); ADD_PROPERTYNZ( PropertyInfo( Variant::BOOL, "editor/display_folded",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR ), _SCS("set_display_folded"),_SCS("is_displayed_folded" ) ); BIND_VMETHOD( MethodInfo("_process",PropertyInfo(Variant::REAL,"delta")) ); @@ -2973,13 +3067,13 @@ void Node::_bind_methods() { BIND_VMETHOD( MethodInfo("_unhandled_input",PropertyInfo(Variant::INPUT_EVENT,"event")) ); BIND_VMETHOD( MethodInfo("_unhandled_key_input",PropertyInfo(Variant::INPUT_EVENT,"key_event")) ); - //ObjectTypeDB::bind_method(_MD("get_child",&Node::get_child,PH("index"))); - //ObjectTypeDB::bind_method(_MD("get_node",&Node::get_node,PH("path"))); + //ClassDB::bind_method(_MD("get_child",&Node::get_child,PH("index"))); + //ClassDB::bind_method(_MD("get_node",&Node::get_node,PH("path"))); } String Node::_get_name_num_separator() { - switch(Globals::get_singleton()->get("node/name_num_separator").operator int()) { + switch(GlobalConfig::get_singleton()->get("node/name_num_separator").operator int()) { case 0: return ""; case 1: return " "; case 2: return "_"; @@ -2998,7 +3092,10 @@ Node::Node() { data.tree=NULL; data.fixed_process=false; data.idle_process=false; + data.fixed_process_internal=false; + data.idle_process_internal=false; data.inside_tree=false; + data.ready_notified=false; data.owner=NULL; data.OW=NULL; @@ -3015,6 +3112,7 @@ Node::Node() { data.viewport=NULL; data.use_placeholder=false; data.display_folded=false; + data.ready_first=true; } diff --git a/scene/main/node.h b/scene/main/node.h index f18dc81195..e27404d46e 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -42,7 +42,7 @@ class Viewport; class SceneState; class Node : public Object { - OBJ_TYPE( Node, Object ); + GDCLASS( Node, Object ); OBJ_CATEGORY("Nodes"); public: @@ -103,6 +103,8 @@ private: StringName name; SceneTree *tree; bool inside_tree; + bool ready_notified; //this is a small hack, so if a node is added during _ready() to the tree, it corretly gets the _ready() notification + bool ready_first; #ifdef TOOLS_ENABLED NodePath import_path; //path used when imported, used by scene editors to keep tracking #endif @@ -128,6 +130,9 @@ private: bool fixed_process; bool idle_process; + bool fixed_process_internal; + bool idle_process_internal; + bool input; bool unhandled_input; bool unhandled_key_input; @@ -145,7 +150,6 @@ private: void _print_tree(const Node *p_node); - virtual bool _use_builtin_script() const { return true; } Node *_get_node(const NodePath& p_path) const; Node *_get_child_by_name(const StringName& p_name) const; @@ -222,6 +226,10 @@ public: NOTIFICATION_DRAG_BEGIN=21, NOTIFICATION_DRAG_END=22, NOTIFICATION_PATH_CHANGED=23, + NOTIFICATION_TRANSLATION_CHANGED=24, + NOTIFICATION_INTERNAL_PROCESS = 25, + NOTIFICATION_INTERNAL_FIXED_PROCESS = 26, + }; /* NODE/TREE */ @@ -301,6 +309,11 @@ public: float get_process_delta_time() const; bool is_processing() const; + void set_fixed_process_internal(bool p_process); + bool is_fixed_processing_internal() const; + + void set_process_internal(bool p_process); + bool is_processing_internal() const; void set_process_input(bool p_enable); bool is_processing_input() const; @@ -336,6 +349,8 @@ public: PauseMode get_pause_mode() const; bool can_process() const; + void request_ready(); + static void print_stray_nodes(); #ifdef TOOLS_ENABLED diff --git a/scene/main/resource_preloader.cpp b/scene/main/resource_preloader.cpp index 219eea770a..93a836a2eb 100644 --- a/scene/main/resource_preloader.cpp +++ b/scene/main/resource_preloader.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ void ResourcePreloader::_set_resources(const Array& p_data) { resources.clear(); ERR_FAIL_COND(p_data.size()!=2); - DVector<String> names=p_data[0]; + PoolVector<String> names=p_data[0]; Array resdata=p_data[1]; ERR_FAIL_COND(names.size()!=resdata.size()); @@ -52,7 +52,7 @@ void ResourcePreloader::_set_resources(const Array& p_data) { Array ResourcePreloader::_get_resources() const { - DVector<String> names; + PoolVector<String> names; Array arr; arr.resize(resources.size()); names.resize(resources.size()); @@ -139,9 +139,9 @@ RES ResourcePreloader::get_resource(const StringName& p_name) const { return resources[p_name]; } -DVector<String> ResourcePreloader::_get_resource_list() const { +PoolVector<String> ResourcePreloader::_get_resource_list() const { - DVector<String> res; + PoolVector<String> res; res.resize(resources.size()); int i=0; for(Map<StringName,RES >::Element *E=resources.front();E;E=E->next(),i++) { @@ -163,15 +163,15 @@ void ResourcePreloader::get_resource_list(List<StringName> *p_list) { void ResourcePreloader::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_set_resources"),&ResourcePreloader::_set_resources); - ObjectTypeDB::bind_method(_MD("_get_resources"),&ResourcePreloader::_get_resources); + ClassDB::bind_method(_MD("_set_resources"),&ResourcePreloader::_set_resources); + ClassDB::bind_method(_MD("_get_resources"),&ResourcePreloader::_get_resources); - ObjectTypeDB::bind_method(_MD("add_resource","name","resource"),&ResourcePreloader::add_resource); - ObjectTypeDB::bind_method(_MD("remove_resource","name"),&ResourcePreloader::remove_resource); - ObjectTypeDB::bind_method(_MD("rename_resource","name","newname"),&ResourcePreloader::rename_resource); - ObjectTypeDB::bind_method(_MD("has_resource","name"),&ResourcePreloader::has_resource); - ObjectTypeDB::bind_method(_MD("get_resource","name"),&ResourcePreloader::get_resource); - ObjectTypeDB::bind_method(_MD("get_resource_list"),&ResourcePreloader::_get_resource_list); + ClassDB::bind_method(_MD("add_resource","name","resource"),&ResourcePreloader::add_resource); + ClassDB::bind_method(_MD("remove_resource","name"),&ResourcePreloader::remove_resource); + ClassDB::bind_method(_MD("rename_resource","name","newname"),&ResourcePreloader::rename_resource); + ClassDB::bind_method(_MD("has_resource","name"),&ResourcePreloader::has_resource); + ClassDB::bind_method(_MD("get_resource","name"),&ResourcePreloader::get_resource); + ClassDB::bind_method(_MD("get_resource_list"),&ResourcePreloader::_get_resource_list); ADD_PROPERTY( PropertyInfo(Variant::ARRAY,"resources",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_resources"), _SCS("_get_resources")); diff --git a/scene/main/resource_preloader.h b/scene/main/resource_preloader.h index b06e558b59..4e585d1751 100644 --- a/scene/main/resource_preloader.h +++ b/scene/main/resource_preloader.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,14 +34,14 @@ class ResourcePreloader : public Node { - OBJ_TYPE(ResourcePreloader,Node); + GDCLASS(ResourcePreloader,Node); Map<StringName,RES > resources; void _set_resources(const Array& p_data); Array _get_resources() const; - DVector<String> _get_resource_list() const; + PoolVector<String> _get_resource_list() const; protected: diff --git a/scene/main/scene_main_loop.cpp b/scene/main/scene_main_loop.cpp index e3472c074a..487b740c34 100644 --- a/scene/main/scene_main_loop.cpp +++ b/scene/main/scene_main_loop.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -48,8 +48,8 @@ void SceneTreeTimer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_time_left","time"),&SceneTreeTimer::set_time_left); - ObjectTypeDB::bind_method(_MD("get_time_left"),&SceneTreeTimer::get_time_left); + ClassDB::bind_method(_MD("set_time_left","time"),&SceneTreeTimer::set_time_left); + ClassDB::bind_method(_MD("get_time_left"),&SceneTreeTimer::get_time_left); ADD_SIGNAL(MethodInfo("timeout")); } @@ -366,7 +366,7 @@ void SceneTree::input_text( const String& p_text ) { void SceneTree::input_event( const InputEvent& p_event ) { - if (is_editor_hint() && (p_event.type==InputEvent::JOYSTICK_MOTION || p_event.type==InputEvent::JOYSTICK_BUTTON)) + if (is_editor_hint() && (p_event.type==InputEvent::JOYPAD_MOTION || p_event.type==InputEvent::JOYPAD_BUTTON)) return; //avoid joy input on editor root_lock++; @@ -490,6 +490,8 @@ void SceneTree::input_event( const InputEvent& p_event ) { } + _call_idle_callbacks(); + } void SceneTree::init() { @@ -521,6 +523,7 @@ bool SceneTree::iteration(float p_time) { emit_signal("fixed_frame"); + _notify_group_pause("fixed_process_internal",Node::NOTIFICATION_INTERNAL_FIXED_PROCESS); _notify_group_pause("fixed_process",Node::NOTIFICATION_FIXED_PROCESS); _flush_ugc(); _flush_transform_notifications(); @@ -528,6 +531,7 @@ bool SceneTree::iteration(float p_time) { root_lock--; _flush_delete_queue(); + _call_idle_callbacks(); return _quit; } @@ -551,6 +555,7 @@ bool SceneTree::idle(float p_time){ _flush_transform_notifications(); + _notify_group_pause("idle_process_internal",Node::NOTIFICATION_INTERNAL_PROCESS); _notify_group_pause("idle_process",Node::NOTIFICATION_PROCESS); Size2 win_size=Size2( OS::get_singleton()->get_video_mode().width, OS::get_singleton()->get_video_mode().height ); @@ -590,6 +595,8 @@ bool SceneTree::idle(float p_time){ E=N; } + _call_idle_callbacks(); + return _quit; } @@ -645,6 +652,9 @@ void SceneTree::_notification(int p_notification) { get_root()->propagate_notification(p_notification); } break; + case NOTIFICATION_TRANSLATION_CHANGED: { + get_root()->propagate_notification(Node::NOTIFICATION_TRANSLATION_CHANGED); + } break; case NOTIFICATION_WM_UNFOCUS_REQUEST: { notify_group(GROUP_CALL_REALTIME|GROUP_CALL_MULIILEVEL,"input",NOTIFICATION_WM_UNFOCUS_REQUEST); @@ -745,12 +755,12 @@ Ref<Material> SceneTree::get_debug_navigation_material() { if (navigation_material.is_valid()) return navigation_material; - Ref<FixedMaterial> line_material = Ref<FixedMaterial>( memnew( FixedMaterial )); - line_material->set_flag(Material::FLAG_UNSHADED, true); + Ref<FixedSpatialMaterial> line_material = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial )); +/* line_material->set_flag(Material::FLAG_UNSHADED, true); line_material->set_line_width(3.0); - line_material->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true); - line_material->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY, true); - line_material->set_parameter(FixedMaterial::PARAM_DIFFUSE,get_debug_navigation_color()); + line_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA, true); + line_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_COLOR_ARRAY, true); + line_material->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,get_debug_navigation_color());*/ navigation_material=line_material; @@ -763,12 +773,12 @@ Ref<Material> SceneTree::get_debug_navigation_disabled_material(){ if (navigation_disabled_material.is_valid()) return navigation_disabled_material; - Ref<FixedMaterial> line_material = Ref<FixedMaterial>( memnew( FixedMaterial )); - line_material->set_flag(Material::FLAG_UNSHADED, true); + Ref<FixedSpatialMaterial> line_material = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial )); +/* line_material->set_flag(Material::FLAG_UNSHADED, true); line_material->set_line_width(3.0); - line_material->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true); - line_material->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY, true); - line_material->set_parameter(FixedMaterial::PARAM_DIFFUSE,get_debug_navigation_disabled_color()); + line_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA, true); + line_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_COLOR_ARRAY, true); + line_material->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,get_debug_navigation_disabled_color());*/ navigation_disabled_material=line_material; @@ -781,12 +791,12 @@ Ref<Material> SceneTree::get_debug_collision_material() { return collision_material; - Ref<FixedMaterial> line_material = Ref<FixedMaterial>( memnew( FixedMaterial )); - line_material->set_flag(Material::FLAG_UNSHADED, true); + Ref<FixedSpatialMaterial> line_material = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial )); + /*line_material->set_flag(Material::FLAG_UNSHADED, true); line_material->set_line_width(3.0); - line_material->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true); - line_material->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY, true); - line_material->set_parameter(FixedMaterial::PARAM_DIFFUSE,get_debug_collisions_color()); + line_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA, true); + line_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_COLOR_ARRAY, true); + line_material->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,get_debug_collisions_color());*/ collision_material=line_material; @@ -800,11 +810,11 @@ Ref<Mesh> SceneTree::get_debug_contact_mesh() { debug_contact_mesh = Ref<Mesh>( memnew( Mesh ) ); - Ref<FixedMaterial> mat = memnew( FixedMaterial ); - mat->set_flag(Material::FLAG_UNSHADED,true); + Ref<FixedSpatialMaterial> mat = memnew( FixedSpatialMaterial ); + /*mat->set_flag(Material::FLAG_UNSHADED,true); mat->set_flag(Material::FLAG_DOUBLE_SIDED,true); - mat->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA,true); - mat->set_parameter(FixedMaterial::PARAM_DIFFUSE,get_debug_collision_contact_color()); + mat->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true); + mat->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,get_debug_collision_contact_color());*/ Vector3 diamond[6]={ Vector3(-1, 0, 0), @@ -826,11 +836,11 @@ Ref<Mesh> SceneTree::get_debug_contact_mesh() { 1,3,5, }; - DVector<int> indices; + PoolVector<int> indices; for(int i=0;i<8*3;i++) indices.push_back(diamond_faces[i]); - DVector<Vector3> vertices; + PoolVector<Vector3> vertices; for(int i=0;i<6;i++) vertices.push_back(diamond[i]*0.1); @@ -840,7 +850,7 @@ Ref<Mesh> SceneTree::get_debug_contact_mesh() { arr[Mesh::ARRAY_INDEX]=indices; - debug_contact_mesh->add_surface(Mesh::PRIMITIVE_TRIANGLES,arr); + debug_contact_mesh->add_surface_from_arrays(Mesh::PRIMITIVE_TRIANGLES,arr); debug_contact_mesh->surface_set_material(0,mat); return debug_contact_mesh; @@ -1047,7 +1057,7 @@ static void _fill_array(Node *p_node, Array& array, int p_level) { array.push_back(p_level); array.push_back(p_node->get_name()); - array.push_back(p_node->get_type()); + array.push_back(p_node->get_class()); array.push_back(p_node->get_instance_ID()); for(int i=0;i<p_node->get_child_count();i++) { @@ -1098,7 +1108,11 @@ void SceneTree::_update_root_rect() { if (stretch_mode==STRETCH_MODE_DISABLED) { - root->set_rect(Rect2(Point2(),last_screen_size)); + + root->set_size(last_screen_size); + root->set_attach_to_screen_rect(Rect2(Point2(),last_screen_size)); + root->set_size_override_stretch(false); + root->set_size_override(false,Size2()); return; //user will take care } @@ -1174,21 +1188,18 @@ void SceneTree::_update_root_rect() { switch (stretch_mode) { case STRETCH_MODE_2D: { -// root->set_rect(Rect2(Point2(),video_mode)); - root->set_as_render_target(false); - root->set_rect(Rect2(margin,screen_size)); + root->set_size(screen_size); + root->set_attach_to_screen_rect(Rect2(margin,screen_size)); root->set_size_override_stretch(true); root->set_size_override(true,viewport_size); } break; case STRETCH_MODE_VIEWPORT: { - root->set_rect(Rect2(Point2(),viewport_size)); + root->set_size(viewport_size); + root->set_attach_to_screen_rect(Rect2(margin,screen_size)); root->set_size_override_stretch(false); root->set_size_override(false,Size2()); - root->set_as_render_target(true); - root->set_render_target_update_mode(Viewport::RENDER_TARGET_UPDATE_ALWAYS); - root->set_render_target_to_screen_rect(Rect2(margin,screen_size)); } break; @@ -1421,7 +1432,7 @@ void SceneTree::_live_edit_create_node_func(const NodePath& p_parent,const Strin continue; Node *n2 = n->get_node(p_parent); - Object *o = ObjectTypeDB::instance(p_type); + Object *o = ClassDB::instance(p_type); if (!o) continue; Node *no=o->cast_to<Node>(); @@ -2056,7 +2067,7 @@ void SceneTree::_network_process_packet(int p_from, const uint8_t* p_packet, int node->set(name,value,&valid); if (!valid) { - String error = "Error setting remote property '"+String(name)+"', not found in object of type "+node->get_type(); + String error = "Error setting remote property '"+String(name)+"', not found in object of type "+node->get_class(); ERR_PRINTS(error); } } @@ -2154,43 +2165,43 @@ void SceneTree::_network_poll() { void SceneTree::_bind_methods() { - //ObjectTypeDB::bind_method(_MD("call_group","call_flags","group","method","arg1","arg2"),&SceneMainLoop::_call_group,DEFVAL(Variant()),DEFVAL(Variant())); - ObjectTypeDB::bind_method(_MD("notify_group","call_flags","group","notification"),&SceneTree::notify_group); - ObjectTypeDB::bind_method(_MD("set_group","call_flags","group","property","value"),&SceneTree::set_group); + //ClassDB::bind_method(_MD("call_group","call_flags","group","method","arg1","arg2"),&SceneMainLoop::_call_group,DEFVAL(Variant()),DEFVAL(Variant())); + ClassDB::bind_method(_MD("notify_group","call_flags","group","notification"),&SceneTree::notify_group); + ClassDB::bind_method(_MD("set_group","call_flags","group","property","value"),&SceneTree::set_group); - ObjectTypeDB::bind_method(_MD("get_nodes_in_group","group"),&SceneTree::_get_nodes_in_group); + ClassDB::bind_method(_MD("get_nodes_in_group","group"),&SceneTree::_get_nodes_in_group); - ObjectTypeDB::bind_method(_MD("get_root:Viewport"),&SceneTree::get_root); - ObjectTypeDB::bind_method(_MD("has_group","name"),&SceneTree::has_group); + ClassDB::bind_method(_MD("get_root:Viewport"),&SceneTree::get_root); + ClassDB::bind_method(_MD("has_group","name"),&SceneTree::has_group); - ObjectTypeDB::bind_method(_MD("set_auto_accept_quit","enabled"),&SceneTree::set_auto_accept_quit); + ClassDB::bind_method(_MD("set_auto_accept_quit","enabled"),&SceneTree::set_auto_accept_quit); - ObjectTypeDB::bind_method(_MD("set_editor_hint","enable"),&SceneTree::set_editor_hint); - ObjectTypeDB::bind_method(_MD("is_editor_hint"),&SceneTree::is_editor_hint); - ObjectTypeDB::bind_method(_MD("set_debug_collisions_hint","enable"),&SceneTree::set_debug_collisions_hint); - ObjectTypeDB::bind_method(_MD("is_debugging_collisions_hint"),&SceneTree::is_debugging_collisions_hint); - ObjectTypeDB::bind_method(_MD("set_debug_navigation_hint","enable"),&SceneTree::set_debug_navigation_hint); - ObjectTypeDB::bind_method(_MD("is_debugging_navigation_hint"),&SceneTree::is_debugging_navigation_hint); + ClassDB::bind_method(_MD("set_editor_hint","enable"),&SceneTree::set_editor_hint); + ClassDB::bind_method(_MD("is_editor_hint"),&SceneTree::is_editor_hint); + ClassDB::bind_method(_MD("set_debug_collisions_hint","enable"),&SceneTree::set_debug_collisions_hint); + ClassDB::bind_method(_MD("is_debugging_collisions_hint"),&SceneTree::is_debugging_collisions_hint); + ClassDB::bind_method(_MD("set_debug_navigation_hint","enable"),&SceneTree::set_debug_navigation_hint); + ClassDB::bind_method(_MD("is_debugging_navigation_hint"),&SceneTree::is_debugging_navigation_hint); #ifdef TOOLS_ENABLED - ObjectTypeDB::bind_method(_MD("set_edited_scene_root","scene"),&SceneTree::set_edited_scene_root); - ObjectTypeDB::bind_method(_MD("get_edited_scene_root"),&SceneTree::get_edited_scene_root); + ClassDB::bind_method(_MD("set_edited_scene_root","scene"),&SceneTree::set_edited_scene_root); + ClassDB::bind_method(_MD("get_edited_scene_root"),&SceneTree::get_edited_scene_root); #endif - ObjectTypeDB::bind_method(_MD("set_pause","enable"),&SceneTree::set_pause); - ObjectTypeDB::bind_method(_MD("is_paused"),&SceneTree::is_paused); - ObjectTypeDB::bind_method(_MD("set_input_as_handled"),&SceneTree::set_input_as_handled); + ClassDB::bind_method(_MD("set_pause","enable"),&SceneTree::set_pause); + ClassDB::bind_method(_MD("is_paused"),&SceneTree::is_paused); + ClassDB::bind_method(_MD("set_input_as_handled"),&SceneTree::set_input_as_handled); - ObjectTypeDB::bind_method(_MD("create_timer:SceneTreeTimer","time_sec"),&SceneTree::create_timer); + ClassDB::bind_method(_MD("create_timer:SceneTreeTimer","time_sec"),&SceneTree::create_timer); - ObjectTypeDB::bind_method(_MD("get_node_count"),&SceneTree::get_node_count); - ObjectTypeDB::bind_method(_MD("get_frame"),&SceneTree::get_frame); - ObjectTypeDB::bind_method(_MD("quit"),&SceneTree::quit); + ClassDB::bind_method(_MD("get_node_count"),&SceneTree::get_node_count); + ClassDB::bind_method(_MD("get_frame"),&SceneTree::get_frame); + ClassDB::bind_method(_MD("quit"),&SceneTree::quit); - ObjectTypeDB::bind_method(_MD("set_screen_stretch","mode","aspect","minsize"),&SceneTree::set_screen_stretch); + ClassDB::bind_method(_MD("set_screen_stretch","mode","aspect","minsize"),&SceneTree::set_screen_stretch); - ObjectTypeDB::bind_method(_MD("queue_delete","obj"),&SceneTree::queue_delete); + ClassDB::bind_method(_MD("queue_delete","obj"),&SceneTree::queue_delete); @@ -2202,29 +2213,29 @@ void SceneTree::_bind_methods() { mi.arguments.push_back( PropertyInfo( Variant::STRING, "method")); - ObjectTypeDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"call_group",&SceneTree::_call_group,mi); + ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT,"call_group",&SceneTree::_call_group,mi); - ObjectTypeDB::bind_method(_MD("set_current_scene","child_node:Node"),&SceneTree::set_current_scene); - ObjectTypeDB::bind_method(_MD("get_current_scene:Node"),&SceneTree::get_current_scene); + ClassDB::bind_method(_MD("set_current_scene","child_node:Node"),&SceneTree::set_current_scene); + ClassDB::bind_method(_MD("get_current_scene:Node"),&SceneTree::get_current_scene); - ObjectTypeDB::bind_method(_MD("change_scene","path"),&SceneTree::change_scene); - ObjectTypeDB::bind_method(_MD("change_scene_to","packed_scene:PackedScene"),&SceneTree::change_scene_to); + ClassDB::bind_method(_MD("change_scene","path"),&SceneTree::change_scene); + ClassDB::bind_method(_MD("change_scene_to","packed_scene:PackedScene"),&SceneTree::change_scene_to); - ObjectTypeDB::bind_method(_MD("reload_current_scene"),&SceneTree::reload_current_scene); + ClassDB::bind_method(_MD("reload_current_scene"),&SceneTree::reload_current_scene); - ObjectTypeDB::bind_method(_MD("_change_scene"),&SceneTree::_change_scene); + ClassDB::bind_method(_MD("_change_scene"),&SceneTree::_change_scene); - ObjectTypeDB::bind_method(_MD("set_network_peer","peer:NetworkedMultiplayerPeer"),&SceneTree::set_network_peer); - ObjectTypeDB::bind_method(_MD("is_network_server"),&SceneTree::is_network_server); - ObjectTypeDB::bind_method(_MD("get_network_unique_id"),&SceneTree::get_network_unique_id); - ObjectTypeDB::bind_method(_MD("set_refuse_new_network_connections","refuse"),&SceneTree::set_refuse_new_network_connections); - ObjectTypeDB::bind_method(_MD("is_refusing_new_network_connections"),&SceneTree::is_refusing_new_network_connections); - ObjectTypeDB::bind_method(_MD("_network_peer_connected"),&SceneTree::_network_peer_connected); - ObjectTypeDB::bind_method(_MD("_network_peer_disconnected"),&SceneTree::_network_peer_disconnected); - ObjectTypeDB::bind_method(_MD("_connected_to_server"),&SceneTree::_connected_to_server); - ObjectTypeDB::bind_method(_MD("_connection_failed"),&SceneTree::_connection_failed); - ObjectTypeDB::bind_method(_MD("_server_disconnected"),&SceneTree::_server_disconnected); + ClassDB::bind_method(_MD("set_network_peer","peer:NetworkedMultiplayerPeer"),&SceneTree::set_network_peer); + ClassDB::bind_method(_MD("is_network_server"),&SceneTree::is_network_server); + ClassDB::bind_method(_MD("get_network_unique_id"),&SceneTree::get_network_unique_id); + ClassDB::bind_method(_MD("set_refuse_new_network_connections","refuse"),&SceneTree::set_refuse_new_network_connections); + ClassDB::bind_method(_MD("is_refusing_new_network_connections"),&SceneTree::is_refusing_new_network_connections); + ClassDB::bind_method(_MD("_network_peer_connected"),&SceneTree::_network_peer_connected); + ClassDB::bind_method(_MD("_network_peer_disconnected"),&SceneTree::_network_peer_disconnected); + ClassDB::bind_method(_MD("_connected_to_server"),&SceneTree::_connected_to_server); + ClassDB::bind_method(_MD("_connection_failed"),&SceneTree::_connection_failed); + ClassDB::bind_method(_MD("_server_disconnected"),&SceneTree::_server_disconnected); ADD_SIGNAL( MethodInfo("tree_changed") ); ADD_SIGNAL( MethodInfo("node_removed",PropertyInfo( Variant::OBJECT, "node") ) ); @@ -2234,7 +2245,7 @@ void SceneTree::_bind_methods() { ADD_SIGNAL( MethodInfo("idle_frame")); ADD_SIGNAL( MethodInfo("fixed_frame")); - ADD_SIGNAL( MethodInfo("files_dropped",PropertyInfo(Variant::STRING_ARRAY,"files"),PropertyInfo(Variant::INT,"screen")) ); + ADD_SIGNAL( MethodInfo("files_dropped",PropertyInfo(Variant::POOL_STRING_ARRAY,"files"),PropertyInfo(Variant::INT,"screen")) ); ADD_SIGNAL( MethodInfo("network_peer_connected",PropertyInfo(Variant::INT,"id"))); ADD_SIGNAL( MethodInfo("network_peer_disconnected",PropertyInfo(Variant::INT,"id"))); ADD_SIGNAL( MethodInfo("connected_to_server")); @@ -2258,6 +2269,23 @@ void SceneTree::_bind_methods() { SceneTree *SceneTree::singleton=NULL; + +SceneTree::IdleCallback SceneTree::idle_callbacks[SceneTree::MAX_IDLE_CALLBACKS]; +int SceneTree::idle_callback_count=0; + +void SceneTree::_call_idle_callbacks() { + + for(int i=0;i<idle_callback_count;i++) { + idle_callbacks[i](); + } +} + +void SceneTree::add_idle_callback(IdleCallback p_callback) { + ERR_FAIL_COND(idle_callback_count>=MAX_IDLE_CALLBACKS); + idle_callbacks[idle_callback_count++]=p_callback; +} + + SceneTree::SceneTree() { singleton=this; @@ -2266,11 +2294,12 @@ SceneTree::SceneTree() { editor_hint=false; debug_collisions_hint=false; debug_navigation_hint=false; - debug_collisions_color=GLOBAL_DEF("debug/collision_shape_color",Color(0.0,0.6,0.7,0.5)); - debug_collision_contact_color=GLOBAL_DEF("debug/collision_contact_color",Color(1.0,0.2,0.1,0.8)); - debug_navigation_color=GLOBAL_DEF("debug/navigation_geometry_color",Color(0.1,1.0,0.7,0.4)); - debug_navigation_disabled_color=GLOBAL_DEF("debug/navigation_disabled_geometry_color",Color(1.0,0.7,0.1,0.4)); - collision_debug_contacts=GLOBAL_DEF("debug/collision_max_contacts_displayed",10000); + debug_collisions_color=GLOBAL_DEF("debug/collision/shape_color",Color(0.0,0.6,0.7,0.5)); + debug_collision_contact_color=GLOBAL_DEF("debug/collision/contact_color",Color(1.0,0.2,0.1,0.8)); + debug_navigation_color=GLOBAL_DEF("debug/navigation/geometry_color",Color(0.1,1.0,0.7,0.4)); + debug_navigation_disabled_color=GLOBAL_DEF("debug/navigation/disabled_geometry_color",Color(1.0,0.7,0.1,0.4)); + collision_debug_contacts=GLOBAL_DEF("debug/collision/max_contacts_displayed",10000); + tree_version=1; @@ -2296,17 +2325,28 @@ SceneTree::SceneTree() { root->set_as_audio_listener_2d(true); current_scene=NULL; + int ref_atlas_size = GLOBAL_DEF("rendering/reflections/atlas_size",2048); + int ref_atlas_subdiv = GLOBAL_DEF("rendering/reflections/atlas_subdiv",8); + int msaa_mode = GLOBAL_DEF("rendering/quality/msaa",0); + GlobalConfig::get_singleton()->set_custom_property_info("rendering/quality/msaa",PropertyInfo(Variant::INT,"rendering/quality/msaa",PROPERTY_HINT_ENUM,"Disabled,2x,4x,8x,16x")); + root->set_msaa(Viewport::MSAA(msaa_mode)); + bool hdr = GLOBAL_DEF("rendering/quality/hdr",true); + root->set_hdr(hdr); + + VS::get_singleton()->scenario_set_reflection_atlas_size(root->get_world()->get_scenario(),ref_atlas_size,ref_atlas_subdiv); + + stretch_mode=STRETCH_MODE_DISABLED; stretch_aspect=STRETCH_ASPECT_IGNORE; last_screen_size=Size2( OS::get_singleton()->get_video_mode().width, OS::get_singleton()->get_video_mode().height ); - root->set_rect(Rect2(Point2(),last_screen_size)); + root->set_size(last_screen_size); if (ScriptDebugger::get_singleton()) { ScriptDebugger::get_singleton()->set_request_scene_tree_message_func(_debugger_request_tree,this); } - root->set_physics_object_picking(GLOBAL_DEF("physics/enable_object_picking",true)); + root->set_physics_object_picking(GLOBAL_DEF("physics/common/enable_object_picking",true)); #ifdef TOOLS_ENABLED edited_scene_root=NULL; diff --git a/scene/main/scene_main_loop.h b/scene/main/scene_main_loop.h index 1c0f88862c..164ffe2ef7 100644 --- a/scene/main/scene_main_loop.h +++ b/scene/main/scene_main_loop.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -53,7 +53,7 @@ class Mesh; class SceneTreeTimer : public Reference { - OBJ_TYPE(SceneTreeTimer,Reference); + GDCLASS(SceneTreeTimer,Reference); float time_left; protected: @@ -70,10 +70,12 @@ class SceneTree : public MainLoop { _THREAD_SAFE_CLASS_ - OBJ_TYPE( SceneTree, MainLoop ); + GDCLASS( SceneTree, MainLoop ); public: + typedef void (*IdleCallback)(); + enum StretchMode { STRETCH_MODE_DISABLED, @@ -303,6 +305,15 @@ friend class Viewport; static void _live_edit_reparent_node_funcs(void* self,const NodePath& p_at,const NodePath& p_new_place,const String& p_new_name,int p_at_pos) { reinterpret_cast<SceneTree*>(self)->_live_edit_reparent_node_func(p_at,p_new_place,p_new_name,p_at_pos); } #endif + + enum { + MAX_IDLE_CALLBACKS=256 + }; + + static IdleCallback idle_callbacks[MAX_IDLE_CALLBACKS]; + static int idle_callback_count; + void _call_idle_callbacks(); + protected: @@ -430,6 +441,7 @@ public: void set_refuse_new_network_connections(bool p_refuse); bool is_refusing_new_network_connections() const; + static void add_idle_callback(IdleCallback p_callback); SceneTree(); ~SceneTree(); diff --git a/scene/main/timer.cpp b/scene/main/timer.cpp index 7d9bbd7f4f..7852e2b46b 100644 --- a/scene/main/timer.cpp +++ b/scene/main/timer.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -45,8 +45,8 @@ void Timer::_notification(int p_what) { autostart=false; } } break; - case NOTIFICATION_PROCESS: { - if (timer_process_mode == TIMER_PROCESS_FIXED || !is_processing()) + case NOTIFICATION_INTERNAL_PROCESS: { + if (timer_process_mode == TIMER_PROCESS_FIXED || !is_processing_internal()) return; time_left -= get_process_delta_time(); @@ -61,8 +61,8 @@ void Timer::_notification(int p_what) { } } break; - case NOTIFICATION_FIXED_PROCESS: { - if (timer_process_mode == TIMER_PROCESS_IDLE || !is_fixed_processing()) + case NOTIFICATION_INTERNAL_FIXED_PROCESS: { + if (timer_process_mode == TIMER_PROCESS_IDLE || !is_fixed_processing_internal()) return; time_left -= get_fixed_process_delta_time(); @@ -147,15 +147,15 @@ void Timer::set_timer_process_mode(TimerProcessMode p_mode) { switch (timer_process_mode) { case TIMER_PROCESS_FIXED: - if (is_fixed_processing()) { - set_fixed_process(false); - set_process(true); + if (is_fixed_processing_internal()) { + set_fixed_process_internal(false); + set_process_internal(true); } break; case TIMER_PROCESS_IDLE: - if (is_processing()) { - set_process(false); - set_fixed_process(true); + if (is_processing_internal()) { + set_process_internal(false); + set_fixed_process_internal(true); } break; } @@ -171,33 +171,33 @@ Timer::TimerProcessMode Timer::get_timer_process_mode() const{ void Timer::_set_process(bool p_process, bool p_force) { switch (timer_process_mode) { - case TIMER_PROCESS_FIXED: set_fixed_process(p_process && active); break; - case TIMER_PROCESS_IDLE: set_process(p_process && active); break; + case TIMER_PROCESS_FIXED: set_fixed_process_internal(p_process && active); break; + case TIMER_PROCESS_IDLE: set_process_internal(p_process && active); break; } processing = p_process; } void Timer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_wait_time","time_sec"),&Timer::set_wait_time); - ObjectTypeDB::bind_method(_MD("get_wait_time"),&Timer::get_wait_time); + ClassDB::bind_method(_MD("set_wait_time","time_sec"),&Timer::set_wait_time); + ClassDB::bind_method(_MD("get_wait_time"),&Timer::get_wait_time); - ObjectTypeDB::bind_method(_MD("set_one_shot","enable"),&Timer::set_one_shot); - ObjectTypeDB::bind_method(_MD("is_one_shot"),&Timer::is_one_shot); + ClassDB::bind_method(_MD("set_one_shot","enable"),&Timer::set_one_shot); + ClassDB::bind_method(_MD("is_one_shot"),&Timer::is_one_shot); - ObjectTypeDB::bind_method(_MD("set_autostart","enable"),&Timer::set_autostart); - ObjectTypeDB::bind_method(_MD("has_autostart"),&Timer::has_autostart); + ClassDB::bind_method(_MD("set_autostart","enable"),&Timer::set_autostart); + ClassDB::bind_method(_MD("has_autostart"),&Timer::has_autostart); - ObjectTypeDB::bind_method(_MD("start"),&Timer::start); - ObjectTypeDB::bind_method(_MD("stop"),&Timer::stop); + ClassDB::bind_method(_MD("start"),&Timer::start); + ClassDB::bind_method(_MD("stop"),&Timer::stop); - ObjectTypeDB::bind_method(_MD("set_active", "active"), &Timer::set_active); - ObjectTypeDB::bind_method(_MD("is_active"), &Timer::is_active); + ClassDB::bind_method(_MD("set_active", "active"), &Timer::set_active); + ClassDB::bind_method(_MD("is_active"), &Timer::is_active); - ObjectTypeDB::bind_method(_MD("get_time_left"),&Timer::get_time_left); + ClassDB::bind_method(_MD("get_time_left"),&Timer::get_time_left); - ObjectTypeDB::bind_method(_MD("set_timer_process_mode", "mode"), &Timer::set_timer_process_mode); - ObjectTypeDB::bind_method(_MD("get_timer_process_mode"), &Timer::get_timer_process_mode); + ClassDB::bind_method(_MD("set_timer_process_mode", "mode"), &Timer::set_timer_process_mode); + ClassDB::bind_method(_MD("get_timer_process_mode"), &Timer::get_timer_process_mode); ADD_SIGNAL( MethodInfo("timeout") ); diff --git a/scene/main/timer.h b/scene/main/timer.h index 688be6e4f2..6b69f3f409 100644 --- a/scene/main/timer.h +++ b/scene/main/timer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class Timer : public Node { - OBJ_TYPE( Timer, Node ); + GDCLASS( Timer, Node ); float wait_time; bool one_shot; diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 0c243bd473..fe363d97f7 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -51,60 +51,121 @@ #include "globals.h" -int RenderTargetTexture::get_width() const { +void ViewportTexture::setup_local_to_scene() { + + if (vp) { + vp->viewport_textures.erase(this); + } + + vp=NULL; + + Node *local_scene = get_local_scene(); + if (!local_scene) { + return; + } + + Node *vpn = local_scene->get_node(path); + ERR_EXPLAIN("ViewportTexture: Path to node is invalid"); + ERR_FAIL_COND(!vpn); + + vp = vpn->cast_to<Viewport>(); + + ERR_EXPLAIN("ViewportTexture: Path to node does not point to a viewport"); + ERR_FAIL_COND(!vp); + + vp->viewport_textures.insert(this); +} + +void ViewportTexture::set_viewport_path_in_scene(const NodePath& p_path) { + + if (path==p_path) + return; + + path=p_path; + + if (get_local_scene()) { + setup_local_to_scene(); + } + +} + +NodePath ViewportTexture::get_viewport_path_in_scene() const { + + return path; +} + +int ViewportTexture::get_width() const { ERR_FAIL_COND_V(!vp,0); - return vp->rect.size.width; + return vp->size.width; } -int RenderTargetTexture::get_height() const{ +int ViewportTexture::get_height() const{ ERR_FAIL_COND_V(!vp,0); - return vp->rect.size.height; + return vp->size.height; } -Size2 RenderTargetTexture::get_size() const{ +Size2 ViewportTexture::get_size() const{ ERR_FAIL_COND_V(!vp,Size2()); - return vp->rect.size; + return vp->size; } -RID RenderTargetTexture::get_rid() const{ +RID ViewportTexture::get_rid() const{ ERR_FAIL_COND_V(!vp,RID()); - return vp->render_target_texture_rid; + return vp->texture_rid; } -bool RenderTargetTexture::has_alpha() const{ +bool ViewportTexture::has_alpha() const{ return false; } -void RenderTargetTexture::set_flags(uint32_t p_flags){ +void ViewportTexture::set_flags(uint32_t p_flags){ - ERR_FAIL_COND(!vp); - if (p_flags&FLAG_FILTER) - flags=FLAG_FILTER; - else - flags=0; + if (!vp) + return; - VS::get_singleton()->texture_set_flags(vp->render_target_texture_rid,flags); + vp->texture_flags=p_flags; + VS::get_singleton()->texture_set_flags(vp->texture_rid,p_flags); } -uint32_t RenderTargetTexture::get_flags() const{ +uint32_t ViewportTexture::get_flags() const{ - return flags; + if (!vp) + return 0; + + return vp->texture_flags; } -RenderTargetTexture::RenderTargetTexture(Viewport *p_vp){ +void ViewportTexture::_bind_methods() { + + ClassDB::bind_method(_MD("set_viewport_path_in_scene","path"),&ViewportTexture::set_viewport_path_in_scene); + ClassDB::bind_method(_MD("get_viewport_path_in_scene"),&ViewportTexture::get_viewport_path_in_scene); + + ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH,"viewport_path"),_SCS("set_viewport_path_in_scene"),_SCS("get_viewport_path_in_scene")); - vp=p_vp; - flags=0; +} + +ViewportTexture::ViewportTexture(){ + + vp=NULL; + set_local_to_scene(true); + +} + +ViewportTexture::~ViewportTexture(){ + + if (vp) { + vp->viewport_textures.erase(this); + } } ///////////////////////////////////// class TooltipPanel : public Panel { - OBJ_TYPE(TooltipPanel,Panel) + GDCLASS(TooltipPanel,Panel) public: TooltipPanel() {}; @@ -112,7 +173,7 @@ public: class TooltipLabel : public Label { - OBJ_TYPE(TooltipLabel,Label) + GDCLASS(TooltipLabel,Label) public: TooltipLabel() {}; @@ -141,9 +202,9 @@ void Viewport::_update_stretch_transform() { if (size_override_stretch && size_override) { //print_line("sive override size "+size_override_size); - //print_line("rect size "+rect.size); - stretch_transform=Matrix32(); - Size2 scale = rect.size/(size_override_size+size_override_margin*2); + //print_line("rect size "+size); + stretch_transform=Transform2D(); + Size2 scale = size/(size_override_size+size_override_margin*2); stretch_transform.scale(scale); stretch_transform.elements[2]=size_override_margin*scale; @@ -151,7 +212,7 @@ void Viewport::_update_stretch_transform() { } else { - stretch_transform=Matrix32(); + stretch_transform=Transform2D(); } _update_global_transform(); @@ -164,14 +225,14 @@ void Viewport::_update_rect() { return; - if (!render_target && parent_control) { + /*if (!render_target && parent_control) { Control *c = parent_control; rect.pos=Point2(); rect.size=c->get_size(); - } - + }*/ +/* VisualServer::ViewportRect vr; vr.x=rect.pos.x; vr.y=rect.pos.y; @@ -191,8 +252,8 @@ void Viewport::_update_rect() { } emit_signal("size_changed"); - render_target_texture->emit_changed(); - + texture->emit_changed(); +*/ } @@ -207,7 +268,7 @@ void Viewport::_parent_draw() { void Viewport::_parent_visibility_changed() { - +/* if (parent_control) { Control *c = parent_control; @@ -216,14 +277,14 @@ void Viewport::_parent_visibility_changed() { _update_listener(); _update_listener_2d(); } - +*/ } void Viewport::_vp_enter_tree() { - if (parent_control) { +/* if (parent_control) { Control *cparent=parent_control; RID parent_ci = cparent->get_canvas_item(); @@ -232,20 +293,21 @@ void Viewport::_vp_enter_tree() { VisualServer::get_singleton()->canvas_item_set_parent(canvas_item,parent_ci); VisualServer::get_singleton()->canvas_item_set_visible(canvas_item,false); - VisualServer::get_singleton()->canvas_item_attach_viewport(canvas_item,viewport); +// VisualServer::get_singleton()->canvas_item_attach_viewport(canvas_item,viewport); parent_control->connect("resized",this,"_parent_resized"); parent_control->connect("visibility_changed",this,"_parent_visibility_changed"); } else if (!parent){ - VisualServer::get_singleton()->viewport_attach_to_screen(viewport,0); +// VisualServer::get_singleton()->viewport_attach_to_screen(viewport,0); } - +*/ } void Viewport::_vp_exit_tree() { + /* if (parent_control) { parent_control->disconnect("resized",this,"_parent_resized"); @@ -268,7 +330,7 @@ void Viewport::_vp_exit_tree() { VisualServer::get_singleton()->viewport_detach(viewport); } - +*/ } @@ -326,31 +388,12 @@ void Viewport::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { if (get_parent()) { - Node *parent=get_parent(); - if (parent) { - parent_control=parent->cast_to<Control>(); - } - } - - - parent=NULL; - Node *parent_node=get_parent(); - - - while(parent_node) { - - parent = parent_node->cast_to<Viewport>(); - if (parent) - break; - - parent_node=parent_node->get_parent(); + parent = get_parent()->get_viewport(); + VisualServer::get_singleton()->viewport_set_parent_viewport(viewport,parent->get_viewport()); + } else { + parent=NULL; } - - if (!render_target) - _vp_enter_tree(); - - current_canvas=find_world_2d()->get_canvas(); VisualServer::get_singleton()->viewport_set_scenario(viewport,find_world()->get_scenario()); VisualServer::get_singleton()->viewport_attach_canvas(viewport,current_canvas); @@ -370,7 +413,7 @@ void Viewport::_notification(int p_what) { //3D PhysicsServer::get_singleton()->space_set_debug_contacts(find_world()->get_space(),get_tree()->get_collision_debug_contact_count()); contact_3d_debug_multimesh=VisualServer::get_singleton()->multimesh_create(); - VisualServer::get_singleton()->multimesh_set_instance_count(contact_3d_debug_multimesh,get_tree()->get_collision_debug_contact_count()); + VisualServer::get_singleton()->multimesh_allocate(contact_3d_debug_multimesh,get_tree()->get_collision_debug_contact_count(),VS::MULTIMESH_TRANSFORM_3D,VS::MULTIMESH_COLOR_8BIT); VisualServer::get_singleton()->multimesh_set_visible_instances(contact_3d_debug_multimesh,0); VisualServer::get_singleton()->multimesh_set_mesh(contact_3d_debug_multimesh,get_tree()->get_debug_contact_mesh()->get_rid()); contact_3d_debug_instance=VisualServer::get_singleton()->instance_create(); @@ -380,6 +423,7 @@ void Viewport::_notification(int p_what) { } + VS::get_singleton()->viewport_set_active(viewport,true); } break; case NOTIFICATION_READY: { #ifndef _3D_DISABLED @@ -418,8 +462,8 @@ void Viewport::_notification(int p_what) { if (world_2d.is_valid()) world_2d->_remove_viewport(this); - if (!render_target) - _vp_exit_tree(); + //if (!render_target) + // _vp_exit_tree(); VisualServer::get_singleton()->viewport_set_scenario(viewport,RID()); SpatialSoundServer::get_singleton()->listener_set_space(internal_listener, RID()); @@ -437,7 +481,10 @@ void Viewport::_notification(int p_what) { } remove_from_group("_viewports"); - parent_control=NULL; + + + VS::get_singleton()->viewport_set_active(viewport,false); + } break; case NOTIFICATION_FIXED_PROCESS: { @@ -452,7 +499,7 @@ void Viewport::_notification(int p_what) { if (get_tree()->is_debugging_collisions_hint() && contact_2d_debug.is_valid()) { VisualServer::get_singleton()->canvas_item_clear(contact_2d_debug); - VisualServer::get_singleton()->canvas_item_raise(contact_2d_debug); + VisualServer::get_singleton()->canvas_item_set_draw_index(contact_2d_debug,0xFFFFF); //very high index Vector<Vector2> points = Physics2DServer::get_singleton()->space_get_contacts(find_world_2d()->get_space()); int point_count = Physics2DServer::get_singleton()->space_get_contact_count(find_world_2d()->get_space()); @@ -474,27 +521,11 @@ void Viewport::_notification(int p_what) { VS::get_singleton()->multimesh_set_visible_instances(contact_3d_debug_multimesh,point_count); - if (point_count>0) { - AABB aabb; - - Transform t; - for(int i=0;i<point_count;i++) { - - if (i==0) - aabb.pos=points[i]; - else - aabb.expand_to(points[i]); - t.origin=points[i]; - VisualServer::get_singleton()->multimesh_instance_set_transform(contact_3d_debug_multimesh,i,t); - } - aabb.grow(aabb.get_longest_axis_size()*0.01); - VisualServer::get_singleton()->multimesh_set_aabb(contact_3d_debug_multimesh,aabb); - } } - if (physics_object_picking && (render_target || Input::get_singleton()->get_mouse_mode()!=Input::MOUSE_MODE_CAPTURED)) { + if (physics_object_picking && (to_screen_rect==Rect2() || Input::get_singleton()->get_mouse_mode()!=Input::MOUSE_MODE_CAPTURED)) { Vector2 last_pos(1e20,1e20); CollisionObject *last_object; @@ -708,15 +739,18 @@ RID Viewport::get_viewport() const { return viewport; } -void Viewport::set_rect(const Rect2& p_rect) { +void Viewport::set_size(const Size2 &p_size) { - if (rect==p_rect) + if (size==p_size.floor()) return; - rect=p_rect; + size=p_size.floor(); + VS::get_singleton()->viewport_set_size(viewport,size.width,size.height); _update_rect(); _update_stretch_transform(); + emit_signal("size_changed"); + } Rect2 Viewport::get_visible_rect() const { @@ -724,12 +758,12 @@ Rect2 Viewport::get_visible_rect() const { Rect2 r; - if (rect.pos==Vector2() && rect.size==Size2()) { + if (size==Size2()) { r=Rect2( Point2(), Size2( OS::get_singleton()->get_video_mode().width, OS::get_singleton()->get_video_mode().height ) ); } else { - r=Rect2( rect.pos , rect.size ); + r=Rect2( Point2() , size ); } if (size_override) { @@ -740,9 +774,9 @@ Rect2 Viewport::get_visible_rect() const { return r; } -Rect2 Viewport::get_rect() const { +Size2 Viewport::get_size() const { - return rect; + return size; } @@ -799,14 +833,14 @@ bool Viewport::is_audio_listener_2d() const { return audio_listener_2d; } -void Viewport::set_canvas_transform(const Matrix32& p_transform) { +void Viewport::set_canvas_transform(const Transform2D& p_transform) { canvas_transform=p_transform; VisualServer::get_singleton()->viewport_set_canvas_transform(viewport,find_world_2d()->get_canvas(),canvas_transform); - Matrix32 xform = (global_canvas_transform * canvas_transform).affine_inverse(); + Transform2D xform = (global_canvas_transform * canvas_transform).affine_inverse(); Size2 ss = get_visible_rect().size; - SpatialSound2DServer::get_singleton()->listener_set_transform(internal_listener_2d, Matrix32(0, xform.xform(ss*0.5))); + SpatialSound2DServer::get_singleton()->listener_set_transform(internal_listener_2d, Transform2D(0, xform.xform(ss*0.5))); Vector2 ss2 = ss*xform.get_scale(); float panrange = MAX(ss2.x,ss2.y); @@ -815,7 +849,7 @@ void Viewport::set_canvas_transform(const Matrix32& p_transform) { } -Matrix32 Viewport::get_canvas_transform() const{ +Transform2D Viewport::get_canvas_transform() const{ return canvas_transform; } @@ -825,13 +859,13 @@ Matrix32 Viewport::get_canvas_transform() const{ void Viewport::_update_global_transform() { - Matrix32 sxform = stretch_transform * global_canvas_transform; + Transform2D sxform = stretch_transform * global_canvas_transform; VisualServer::get_singleton()->viewport_set_global_canvas_transform(viewport,sxform); - Matrix32 xform = (sxform * canvas_transform).affine_inverse(); + Transform2D xform = (sxform * canvas_transform).affine_inverse(); Size2 ss = get_visible_rect().size; - SpatialSound2DServer::get_singleton()->listener_set_transform(internal_listener_2d, Matrix32(0, xform.xform(ss*0.5))); + SpatialSound2DServer::get_singleton()->listener_set_transform(internal_listener_2d, Transform2D(0, xform.xform(ss*0.5))); Vector2 ss2 = ss*xform.get_scale(); float panrange = MAX(ss2.x,ss2.y); @@ -840,7 +874,7 @@ void Viewport::_update_global_transform() { } -void Viewport::set_global_canvas_transform(const Matrix32& p_transform) { +void Viewport::set_global_canvas_transform(const Transform2D& p_transform) { global_canvas_transform=p_transform; @@ -849,7 +883,7 @@ void Viewport::set_global_canvas_transform(const Matrix32& p_transform) { } -Matrix32 Viewport::get_global_canvas_transform() const{ +Transform2D Viewport::get_global_canvas_transform() const{ return global_canvas_transform; } @@ -1171,7 +1205,7 @@ Camera* Viewport::get_camera() const { } -Matrix32 Viewport::get_final_transform() const { +Transform2D Viewport::get_final_transform() const { return stretch_transform * global_canvas_transform; } @@ -1219,10 +1253,10 @@ bool Viewport::is_size_override_stretch_enabled() const { return size_override_stretch; } - +#if 0 void Viewport::set_as_render_target(bool p_enable){ - if (render_target==p_enable) +/* if (render_target==p_enable) return; render_target=p_enable; @@ -1238,117 +1272,126 @@ void Viewport::set_as_render_target(bool p_enable){ if (p_enable) { - render_target_texture_rid = VS::get_singleton()->viewport_get_render_target_texture(viewport); + texture_rid = VS::get_singleton()->viewport_get_texture(viewport); } else { - render_target_texture_rid=RID(); + texture_rid=RID(); } - render_target_texture->set_flags(render_target_texture->flags); - render_target_texture->emit_changed(); + texture->set_flags(texture->flags); + texture->emit_changed(); update_configuration_warning(); + */ } bool Viewport::is_set_as_render_target() const{ return render_target; + } -void Viewport::set_render_target_update_mode(RenderTargetUpdateMode p_mode){ +#endif +void Viewport::set_update_mode(UpdateMode p_mode){ - render_target_update_mode=p_mode; - VS::get_singleton()->viewport_set_render_target_update_mode(viewport,VS::RenderTargetUpdateMode(p_mode)); + update_mode=p_mode; + VS::get_singleton()->viewport_set_update_mode(viewport,VS::ViewportUpdateMode(p_mode)); } -Viewport::RenderTargetUpdateMode Viewport::get_render_target_update_mode() const{ +Viewport::UpdateMode Viewport::get_update_mode() const{ - return render_target_update_mode; + return update_mode; } -//RID get_render_target_texture() const; +//RID get_texture() const; void Viewport::queue_screen_capture(){ - VS::get_singleton()->viewport_queue_screen_capture(viewport); + //VS::get_singleton()->viewport_queue_screen_capture(viewport); } Image Viewport::get_screen_capture() const { - return VS::get_singleton()->viewport_get_screen_capture(viewport); +// return VS::get_singleton()->viewport_get_screen_capture(viewport); + return Image(); } -Ref<RenderTargetTexture> Viewport::get_render_target_texture() const { +Ref<ViewportTexture> Viewport::get_texture() const { - return render_target_texture; + return default_texture; } -void Viewport::set_render_target_vflip(bool p_enable) { +void Viewport::set_vflip(bool p_enable) { - render_target_vflip=p_enable; - VisualServer::get_singleton()->viewport_set_render_target_vflip(viewport,p_enable); + vflip=p_enable; + VisualServer::get_singleton()->viewport_set_vflip(viewport,p_enable); } -bool Viewport::get_render_target_vflip() const{ +bool Viewport::get_vflip() const{ - return render_target_vflip; + return vflip; } -void Viewport::set_render_target_clear_on_new_frame(bool p_enable) { +void Viewport::set_clear_on_new_frame(bool p_enable) { - render_target_clear_on_new_frame=p_enable; - VisualServer::get_singleton()->viewport_set_render_target_clear_on_new_frame(viewport,p_enable); + clear_on_new_frame=p_enable; + //VisualServer::get_singleton()->viewport_set_clear_on_new_frame(viewport,p_enable); } -bool Viewport::get_render_target_clear_on_new_frame() const{ +bool Viewport::get_clear_on_new_frame() const{ - return render_target_clear_on_new_frame; + return clear_on_new_frame; } -void Viewport::render_target_clear() { +void Viewport::set_shadow_atlas_size(int p_size) { + + if (shadow_atlas_size==p_size) + return; - //render_target_clear=true; - VisualServer::get_singleton()->viewport_render_target_clear(viewport); + shadow_atlas_size=p_size; + VS::get_singleton()->viewport_set_shadow_atlas_size(viewport,p_size); } -void Viewport::set_render_target_filter(bool p_enable) { +int Viewport::get_shadow_atlas_size() const{ - if(!render_target) - return; + return shadow_atlas_size; +} - render_target_texture->set_flags(p_enable?int(Texture::FLAG_FILTER):int(0)); +void Viewport::set_shadow_atlas_quadrant_subdiv(int p_quadrant,ShadowAtlasQuadrantSubdiv p_subdiv){ -} -bool Viewport::get_render_target_filter() const{ + ERR_FAIL_INDEX(p_quadrant,4); + ERR_FAIL_INDEX(p_subdiv,SHADOW_ATLAS_QUADRANT_SUBDIV_MAX); - return (render_target_texture->get_flags()&Texture::FLAG_FILTER)!=0; -} + if (shadow_atlas_quadrant_subdiv[p_quadrant]==p_subdiv) + return; + + shadow_atlas_quadrant_subdiv[p_quadrant]=p_subdiv; + static const int subdiv[SHADOW_ATLAS_QUADRANT_SUBDIV_MAX]={0,1,4,16,64,256,1024}; -void Viewport::set_render_target_gen_mipmaps(bool p_enable) { + VS::get_singleton()->viewport_set_shadow_atlas_quadrant_subdivision(viewport,p_quadrant,subdiv[p_subdiv]); - //render_target_texture->set_flags(p_enable?int(Texture::FLAG_FILTER):int(0)); - render_target_gen_mipmaps=p_enable; +} +Viewport::ShadowAtlasQuadrantSubdiv Viewport::get_shadow_atlas_quadrant_subdiv(int p_quadrant) const{ + ERR_FAIL_INDEX_V(p_quadrant,4,SHADOW_ATLAS_QUADRANT_SUBDIV_DISABLED); + return shadow_atlas_quadrant_subdiv[p_quadrant]; } -bool Viewport::get_render_target_gen_mipmaps() const{ - //return (render_target_texture->get_flags()&Texture::FLAG_FILTER)!=0; - return render_target_gen_mipmaps; +void Viewport::clear() { + + //clear=true; +// VisualServer::get_singleton()->viewport_clear(viewport); } -Matrix32 Viewport::_get_input_pre_xform() const { +Transform2D Viewport::_get_input_pre_xform() const { - Matrix32 pre_xf; - if (render_target) { + Transform2D pre_xf; - if (to_screen_rect!=Rect2()) { - pre_xf.elements[2]=-to_screen_rect.pos; - pre_xf.scale(rect.size/to_screen_rect.size); - } - } else { + if (to_screen_rect!=Rect2()) { - pre_xf.elements[2]=-rect.pos; + pre_xf.elements[2]=-to_screen_rect.pos; + pre_xf.scale(size/to_screen_rect.size); } return pre_xf; @@ -1356,9 +1399,9 @@ Matrix32 Viewport::_get_input_pre_xform() const { Vector2 Viewport::_get_window_offset() const { - if (parent_control) { - return (parent_control->get_viewport()->get_final_transform() * parent_control->get_global_transform_with_canvas()).get_origin(); - } +// if (parent_control) { +// return (parent_control->get_viewport()->get_final_transform() * parent_control->get_global_transform_with_canvas()).get_origin(); +// } return Vector2(); } @@ -1372,7 +1415,7 @@ void Viewport::_make_input_local(InputEvent& ev) { Vector2 vp_ofs = _get_window_offset(); - Matrix32 ai = get_final_transform().affine_inverse() * _get_input_pre_xform(); + Transform2D ai = get_final_transform().affine_inverse() * _get_input_pre_xform(); Vector2 g = ai.xform(Vector2(ev.mouse_button.global_x,ev.mouse_button.global_y)); Vector2 l = ai.xform(Vector2(ev.mouse_button.x,ev.mouse_button.y)-vp_ofs); @@ -1387,7 +1430,7 @@ void Viewport::_make_input_local(InputEvent& ev) { Vector2 vp_ofs = _get_window_offset(); - Matrix32 ai = get_final_transform().affine_inverse() * _get_input_pre_xform(); + Transform2D ai = get_final_transform().affine_inverse() * _get_input_pre_xform(); Vector2 g = ai.xform(Vector2(ev.mouse_motion.global_x,ev.mouse_motion.global_y)); Vector2 l = ai.xform(Vector2(ev.mouse_motion.x,ev.mouse_motion.y)-vp_ofs); Vector2 r = ai.basis_xform(Vector2(ev.mouse_motion.relative_x,ev.mouse_motion.relative_y)); @@ -1408,7 +1451,7 @@ void Viewport::_make_input_local(InputEvent& ev) { Vector2 vp_ofs = _get_window_offset(); - Matrix32 ai = get_final_transform().affine_inverse() * _get_input_pre_xform(); + Transform2D ai = get_final_transform().affine_inverse() * _get_input_pre_xform(); Vector2 t = ai.xform(Vector2(ev.screen_touch.x,ev.screen_touch.y)-vp_ofs); @@ -1420,7 +1463,7 @@ void Viewport::_make_input_local(InputEvent& ev) { Vector2 vp_ofs = _get_window_offset(); - Matrix32 ai = get_final_transform().affine_inverse() * _get_input_pre_xform(); + Transform2D ai = get_final_transform().affine_inverse() * _get_input_pre_xform(); Vector2 t = ai.xform(Vector2(ev.screen_drag.x,ev.screen_drag.y)-vp_ofs); Vector2 r = ai.basis_xform(Vector2(ev.screen_drag.relative_x,ev.screen_drag.relative_y)); Vector2 s = ai.basis_xform(Vector2(ev.screen_drag.speed_x,ev.screen_drag.speed_y)); @@ -1454,10 +1497,8 @@ void Viewport::_vp_input(const InputEvent& p_ev) { } #endif - if (parent_control && !parent_control->is_visible()) - return; - if (render_target && to_screen_rect==Rect2()) + if (to_screen_rect==Rect2()) return; //if render target, can't get input events //this one handles system input, p_ev are in system coordinates @@ -1480,10 +1521,10 @@ void Viewport::_vp_unhandled_input(const InputEvent& p_ev) { } #endif - if (parent_control && !parent_control->is_visible()) - return; +// if (parent_control && !parent_control->is_visible()) +// return; - if (render_target && to_screen_rect==Rect2()) + if (to_screen_rect==Rect2()) return; //if render target, can't get input events //this one handles system input, p_ev are in system coordinates @@ -1623,17 +1664,17 @@ void Viewport::_gui_call_input(Control *p_control,const InputEvent& p_input) { Control *control = ci->cast_to<Control>(); if (control) { - control->call_multilevel(SceneStringNames::get_singleton()->_input_event,ev); + control->call_multilevel(SceneStringNames::get_singleton()->_gui_input,ev); if (gui.key_event_accepted) break; if (!control->is_inside_tree()) break; - control->emit_signal(SceneStringNames::get_singleton()->input_event,ev); + control->emit_signal(SceneStringNames::get_singleton()->gui_input,ev); if (!control->is_inside_tree() || control->is_set_as_toplevel()) break; if (gui.key_event_accepted) break; - if (!cant_stop_me_now && control->data.stop_mouse && (ev.type==InputEvent::MOUSE_BUTTON || ev.type==InputEvent::MOUSE_MOTION)) + if (!cant_stop_me_now && control->data.mouse_filter==Control::MOUSE_FILTER_STOP && (ev.type==InputEvent::MOUSE_BUTTON || ev.type==InputEvent::MOUSE_MOTION)) break; } @@ -1658,7 +1699,7 @@ Control* Viewport::_gui_find_control(const Point2& p_global) { if (!sw->is_visible()) continue; - Matrix32 xform; + Transform2D xform; CanvasItem *pci = sw->get_parent_item(); if (pci) xform=pci->get_global_transform_with_canvas(); @@ -1678,7 +1719,7 @@ Control* Viewport::_gui_find_control(const Point2& p_global) { if (!sw->is_visible()) continue; - Matrix32 xform; + Transform2D xform; CanvasItem *pci = sw->get_parent_item(); if (pci) xform=pci->get_global_transform_with_canvas(); @@ -1696,7 +1737,7 @@ Control* Viewport::_gui_find_control(const Point2& p_global) { } -Control* Viewport::_gui_find_control_at_pos(CanvasItem* p_node,const Point2& p_global,const Matrix32& p_xform,Matrix32& r_inv_xform) { +Control* Viewport::_gui_find_control_at_pos(CanvasItem* p_node,const Point2& p_global,const Transform2D& p_xform,Transform2D& r_inv_xform) { if (p_node->cast_to<Viewport>()) return NULL; @@ -1714,7 +1755,7 @@ Control* Viewport::_gui_find_control_at_pos(CanvasItem* p_node,const Point2& p_g return NULL; //canvas item hidden, discard } - Matrix32 matrix = p_xform * p_node->get_transform(); + Transform2D matrix = p_xform * p_node->get_transform(); // matrix.basis_determinant() == 0.0f implies that node does not exist on scene if(matrix.basis_determinant() == 0.0f) return NULL; @@ -1742,7 +1783,7 @@ Control* Viewport::_gui_find_control_at_pos(CanvasItem* p_node,const Point2& p_g matrix.affine_invert(); //conditions for considering this as a valid control for return - if (!c->data.ignore_mouse && c->has_point(matrix.xform(p_global)) && (!gui.drag_preview || (c!=gui.drag_preview && !gui.drag_preview->is_a_parent_of(c)))) { + if (c->data.mouse_filter!=Control::MOUSE_FILTER_IGNORE && c->has_point(matrix.xform(p_global)) && (!gui.drag_preview || (c!=gui.drag_preview && !gui.drag_preview->is_a_parent_of(c)))) { r_inv_xform=matrix; return c; } else @@ -1842,7 +1883,7 @@ void Viewport::_gui_input_event(InputEvent p_event) { Array arr; arr.push_back(gui.mouse_focus->get_path()); - arr.push_back(gui.mouse_focus->get_type()); + arr.push_back(gui.mouse_focus->get_class()); ScriptDebugger::get_singleton()->send_message("click_ctrl",arr); } @@ -2019,7 +2060,7 @@ void Viewport::_gui_input_event(InputEvent p_event) { } - Matrix32 localizer = over->get_global_transform_with_canvas().affine_inverse(); + Transform2D localizer = over->get_global_transform_with_canvas().affine_inverse(); Size2 pos = localizer.xform(mpos); Vector2 speed = localizer.basis_xform(Point2(p_event.mouse_motion.speed_x,p_event.mouse_motion.speed_y)); Vector2 rel = localizer.basis_xform(Point2(p_event.mouse_motion.relative_x,p_event.mouse_motion.relative_y)); @@ -2104,8 +2145,8 @@ void Viewport::_gui_input_event(InputEvent p_event) { } break; case InputEvent::ACTION: - case InputEvent::JOYSTICK_BUTTON: - case InputEvent::JOYSTICK_MOTION: + case InputEvent::JOYPAD_BUTTON: + case InputEvent::JOYPAD_MOTION: case InputEvent::KEY: { @@ -2117,9 +2158,9 @@ void Viewport::_gui_input_event(InputEvent p_event) { gui.key_event_accepted=false; if (gui.key_focus->can_process()) { - gui.key_focus->call_multilevel("_input_event",p_event); + gui.key_focus->call_multilevel(SceneStringNames::get_singleton()->_gui_input,p_event); if (gui.key_focus) //maybe lost it - gui.key_focus->emit_signal(SceneStringNames::get_singleton()->input_event,p_event); + gui.key_focus->emit_signal(SceneStringNames::get_singleton()->gui_input,p_event); } @@ -2427,7 +2468,7 @@ void Viewport::_gui_grab_click_focus(Control *p_control) { mb.y=click.y; mb.button_index=gui.mouse_focus_button; mb.pressed=false; - gui.mouse_focus->call_deferred("_input_event",ie); + gui.mouse_focus->call_deferred(SceneStringNames::get_singleton()->_gui_input,ie); gui.mouse_focus=p_control; @@ -2437,7 +2478,7 @@ void Viewport::_gui_grab_click_focus(Control *p_control) { mb.y=click.y; mb.button_index=gui.mouse_focus_button; mb.pressed=true; - gui.mouse_focus->call_deferred("_input_event",ie); + gui.mouse_focus->call_deferred(SceneStringNames::get_singleton()->_gui_input,ie); } } @@ -2521,17 +2562,18 @@ bool Viewport::is_using_own_world() const { return own_world.is_valid(); } -void Viewport::set_render_target_to_screen_rect(const Rect2& p_rect) { +void Viewport::set_attach_to_screen_rect(const Rect2& p_rect) { + VS::get_singleton()->viewport_attach_to_screen(viewport,p_rect); to_screen_rect=p_rect; - VisualServer::get_singleton()->viewport_set_render_target_to_screen_rect(viewport,to_screen_rect); } -Rect2 Viewport::get_render_target_to_screen_rect() const{ +Rect2 Viewport::get_attach_to_screen_rect() const{ return to_screen_rect; } + void Viewport::set_physics_object_picking(bool p_enable) { physics_object_picking=p_enable; @@ -2545,7 +2587,7 @@ void Viewport::set_physics_object_picking(bool p_enable) { Vector2 Viewport::get_camera_coords(const Vector2 &p_viewport_coords) const { - Matrix32 xf = get_final_transform(); + Transform2D xf = get_final_transform(); return xf.xform(p_viewport_coords); @@ -2553,7 +2595,7 @@ Vector2 Viewport::get_camera_coords(const Vector2 &p_viewport_coords) const { Vector2 Viewport::get_camera_rect_size() const { - return last_vp_rect.size; + return size; } @@ -2577,6 +2619,16 @@ bool Viewport::is_input_disabled() const { return disable_input; } +void Viewport::set_disable_3d(bool p_disable) { + disable_3d=p_disable; + VS::get_singleton()->viewport_set_disable_3d(viewport,p_disable); +} + +bool Viewport::is_3d_disabled() const { + + return disable_3d; +} + Variant Viewport::gui_get_drag_data() const { return gui.drag_data; } @@ -2587,129 +2639,200 @@ Control *Viewport::get_modal_stack_top() const { String Viewport::get_configuration_warning() const { - if (get_parent() && !get_parent()->cast_to<Control>() && !render_target) { + /*if (get_parent() && !get_parent()->cast_to<Control>() && !render_target) { return TTR("This viewport is not set as render target. If you intend for it to display its contents directly to the screen, make it a child of a Control so it can obtain a size. Otherwise, make it a RenderTarget and assign its internal texture to some node for display."); - } + }*/ return String(); } +void Viewport::gui_reset_canvas_sort_index() { + gui.canvas_sort_index=0; +} +int Viewport::gui_get_canvas_sort_index() { + + return gui.canvas_sort_index++; +} + +void Viewport::set_msaa(MSAA p_msaa) { + + ERR_FAIL_INDEX(p_msaa,5); + if (msaa==p_msaa) + return; + msaa=p_msaa; + VS::get_singleton()->viewport_set_msaa(viewport,VS::ViewportMSAA(p_msaa)); +} + +Viewport::MSAA Viewport::get_msaa() const { + + return msaa; +} + +void Viewport::set_hdr(bool p_hdr) { + + if (hdr==p_hdr) + return; + + hdr=p_hdr; + VS::get_singleton()->viewport_set_hdr(viewport,p_hdr); + +} + +bool Viewport::get_hdr() const{ + + return hdr; +} + + + void Viewport::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_rect","rect"), &Viewport::set_rect); - ObjectTypeDB::bind_method(_MD("get_rect"), &Viewport::get_rect); - ObjectTypeDB::bind_method(_MD("set_world_2d","world_2d:World2D"), &Viewport::set_world_2d); - ObjectTypeDB::bind_method(_MD("get_world_2d:World2D"), &Viewport::get_world_2d); - ObjectTypeDB::bind_method(_MD("find_world_2d:World2D"), &Viewport::find_world_2d); - ObjectTypeDB::bind_method(_MD("set_world","world:World"), &Viewport::set_world); - ObjectTypeDB::bind_method(_MD("get_world:World"), &Viewport::get_world); - ObjectTypeDB::bind_method(_MD("find_world:World"), &Viewport::find_world); + ClassDB::bind_method(_MD("set_size","size"), &Viewport::set_size); + ClassDB::bind_method(_MD("get_size"), &Viewport::get_size); + ClassDB::bind_method(_MD("set_world_2d","world_2d:World2D"), &Viewport::set_world_2d); + ClassDB::bind_method(_MD("get_world_2d:World2D"), &Viewport::get_world_2d); + ClassDB::bind_method(_MD("find_world_2d:World2D"), &Viewport::find_world_2d); + ClassDB::bind_method(_MD("set_world","world:World"), &Viewport::set_world); + ClassDB::bind_method(_MD("get_world:World"), &Viewport::get_world); + ClassDB::bind_method(_MD("find_world:World"), &Viewport::find_world); + + ClassDB::bind_method(_MD("set_canvas_transform","xform"), &Viewport::set_canvas_transform); + ClassDB::bind_method(_MD("get_canvas_transform"), &Viewport::get_canvas_transform); - ObjectTypeDB::bind_method(_MD("set_canvas_transform","xform"), &Viewport::set_canvas_transform); - ObjectTypeDB::bind_method(_MD("get_canvas_transform"), &Viewport::get_canvas_transform); + ClassDB::bind_method(_MD("set_global_canvas_transform","xform"), &Viewport::set_global_canvas_transform); + ClassDB::bind_method(_MD("get_global_canvas_transform"), &Viewport::get_global_canvas_transform); + ClassDB::bind_method(_MD("get_final_transform"), &Viewport::get_final_transform); - ObjectTypeDB::bind_method(_MD("set_global_canvas_transform","xform"), &Viewport::set_global_canvas_transform); - ObjectTypeDB::bind_method(_MD("get_global_canvas_transform"), &Viewport::get_global_canvas_transform); - ObjectTypeDB::bind_method(_MD("get_final_transform"), &Viewport::get_final_transform); + ClassDB::bind_method(_MD("get_visible_rect"), &Viewport::get_visible_rect); + ClassDB::bind_method(_MD("set_transparent_background","enable"), &Viewport::set_transparent_background); + ClassDB::bind_method(_MD("has_transparent_background"), &Viewport::has_transparent_background); - ObjectTypeDB::bind_method(_MD("get_visible_rect"), &Viewport::get_visible_rect); - ObjectTypeDB::bind_method(_MD("set_transparent_background","enable"), &Viewport::set_transparent_background); - ObjectTypeDB::bind_method(_MD("has_transparent_background"), &Viewport::has_transparent_background); + ClassDB::bind_method(_MD("_parent_visibility_changed"), &Viewport::_parent_visibility_changed); - ObjectTypeDB::bind_method(_MD("_parent_visibility_changed"), &Viewport::_parent_visibility_changed); + ClassDB::bind_method(_MD("_parent_resized"), &Viewport::_parent_resized); + ClassDB::bind_method(_MD("_vp_input"), &Viewport::_vp_input); + ClassDB::bind_method(_MD("_vp_input_text","text"), &Viewport::_vp_input_text); + ClassDB::bind_method(_MD("_vp_unhandled_input"), &Viewport::_vp_unhandled_input); - ObjectTypeDB::bind_method(_MD("_parent_resized"), &Viewport::_parent_resized); - ObjectTypeDB::bind_method(_MD("_vp_input"), &Viewport::_vp_input); - ObjectTypeDB::bind_method(_MD("_vp_input_text","text"), &Viewport::_vp_input_text); - ObjectTypeDB::bind_method(_MD("_vp_unhandled_input"), &Viewport::_vp_unhandled_input); + ClassDB::bind_method(_MD("set_size_override","enable","size","margin"), &Viewport::set_size_override,DEFVAL(Size2(-1,-1)),DEFVAL(Size2(0,0))); + ClassDB::bind_method(_MD("get_size_override"), &Viewport::get_size_override); + ClassDB::bind_method(_MD("is_size_override_enabled"), &Viewport::is_size_override_enabled); + ClassDB::bind_method(_MD("set_size_override_stretch","enabled"), &Viewport::set_size_override_stretch); + ClassDB::bind_method(_MD("is_size_override_stretch_enabled"), &Viewport::is_size_override_stretch_enabled); + ClassDB::bind_method(_MD("queue_screen_capture"), &Viewport::queue_screen_capture); + ClassDB::bind_method(_MD("get_screen_capture"), &Viewport::get_screen_capture); - ObjectTypeDB::bind_method(_MD("set_size_override","enable","size","margin"), &Viewport::set_size_override,DEFVAL(Size2(-1,-1)),DEFVAL(Size2(0,0))); - ObjectTypeDB::bind_method(_MD("get_size_override"), &Viewport::get_size_override); - ObjectTypeDB::bind_method(_MD("is_size_override_enabled"), &Viewport::is_size_override_enabled); - ObjectTypeDB::bind_method(_MD("set_size_override_stretch","enabled"), &Viewport::set_size_override_stretch); - ObjectTypeDB::bind_method(_MD("is_size_override_stretch_enabled"), &Viewport::is_size_override_stretch_enabled); - ObjectTypeDB::bind_method(_MD("queue_screen_capture"), &Viewport::queue_screen_capture); - ObjectTypeDB::bind_method(_MD("get_screen_capture"), &Viewport::get_screen_capture); - ObjectTypeDB::bind_method(_MD("set_as_render_target","enable"), &Viewport::set_as_render_target); - ObjectTypeDB::bind_method(_MD("is_set_as_render_target"), &Viewport::is_set_as_render_target); + ClassDB::bind_method(_MD("set_vflip","enable"), &Viewport::set_vflip); + ClassDB::bind_method(_MD("get_vflip"), &Viewport::get_vflip); - ObjectTypeDB::bind_method(_MD("set_render_target_vflip","enable"), &Viewport::set_render_target_vflip); - ObjectTypeDB::bind_method(_MD("get_render_target_vflip"), &Viewport::get_render_target_vflip); + ClassDB::bind_method(_MD("set_clear_on_new_frame","enable"), &Viewport::set_clear_on_new_frame); + ClassDB::bind_method(_MD("get_clear_on_new_frame"), &Viewport::get_clear_on_new_frame); - ObjectTypeDB::bind_method(_MD("set_render_target_clear_on_new_frame","enable"), &Viewport::set_render_target_clear_on_new_frame); - ObjectTypeDB::bind_method(_MD("get_render_target_clear_on_new_frame"), &Viewport::get_render_target_clear_on_new_frame); + ClassDB::bind_method(_MD("clear"), &Viewport::clear); + ClassDB::bind_method(_MD("set_update_mode","mode"), &Viewport::set_update_mode); + ClassDB::bind_method(_MD("get_update_mode"), &Viewport::get_update_mode); - ObjectTypeDB::bind_method(_MD("render_target_clear"), &Viewport::render_target_clear); + ClassDB::bind_method(_MD("set_msaa","msaa"), &Viewport::set_msaa); + ClassDB::bind_method(_MD("get_msaa"), &Viewport::get_msaa); - ObjectTypeDB::bind_method(_MD("set_render_target_filter","enable"), &Viewport::set_render_target_filter); - ObjectTypeDB::bind_method(_MD("get_render_target_filter"), &Viewport::get_render_target_filter); + ClassDB::bind_method(_MD("set_hdr","enable"), &Viewport::set_hdr); + ClassDB::bind_method(_MD("get_hdr"), &Viewport::get_hdr); - ObjectTypeDB::bind_method(_MD("set_render_target_gen_mipmaps","enable"), &Viewport::set_render_target_gen_mipmaps); - ObjectTypeDB::bind_method(_MD("get_render_target_gen_mipmaps"), &Viewport::get_render_target_gen_mipmaps); + ClassDB::bind_method(_MD("get_texture:ViewportTexture"), &Viewport::get_texture); - ObjectTypeDB::bind_method(_MD("set_render_target_update_mode","mode"), &Viewport::set_render_target_update_mode); - ObjectTypeDB::bind_method(_MD("get_render_target_update_mode"), &Viewport::get_render_target_update_mode); + ClassDB::bind_method(_MD("set_physics_object_picking","enable"), &Viewport::set_physics_object_picking); + ClassDB::bind_method(_MD("get_physics_object_picking"), &Viewport::get_physics_object_picking); - ObjectTypeDB::bind_method(_MD("get_render_target_texture:RenderTargetTexture"), &Viewport::get_render_target_texture); + ClassDB::bind_method(_MD("get_viewport"), &Viewport::get_viewport); + ClassDB::bind_method(_MD("input","local_event"), &Viewport::input); + ClassDB::bind_method(_MD("unhandled_input","local_event"), &Viewport::unhandled_input); - ObjectTypeDB::bind_method(_MD("set_physics_object_picking","enable"), &Viewport::set_physics_object_picking); - ObjectTypeDB::bind_method(_MD("get_physics_object_picking"), &Viewport::get_physics_object_picking); + ClassDB::bind_method(_MD("update_worlds"), &Viewport::update_worlds); - ObjectTypeDB::bind_method(_MD("get_viewport"), &Viewport::get_viewport); - ObjectTypeDB::bind_method(_MD("input","local_event"), &Viewport::input); - ObjectTypeDB::bind_method(_MD("unhandled_input","local_event"), &Viewport::unhandled_input); + ClassDB::bind_method(_MD("set_use_own_world","enable"), &Viewport::set_use_own_world); + ClassDB::bind_method(_MD("is_using_own_world"), &Viewport::is_using_own_world); - ObjectTypeDB::bind_method(_MD("update_worlds"), &Viewport::update_worlds); + ClassDB::bind_method(_MD("get_camera:Camera"), &Viewport::get_camera); - ObjectTypeDB::bind_method(_MD("set_use_own_world","enable"), &Viewport::set_use_own_world); - ObjectTypeDB::bind_method(_MD("is_using_own_world"), &Viewport::is_using_own_world); + ClassDB::bind_method(_MD("set_as_audio_listener","enable"), &Viewport::set_as_audio_listener); + ClassDB::bind_method(_MD("is_audio_listener","enable"), &Viewport::is_audio_listener); - ObjectTypeDB::bind_method(_MD("get_camera:Camera"), &Viewport::get_camera); + ClassDB::bind_method(_MD("set_as_audio_listener_2d","enable"), &Viewport::set_as_audio_listener_2d); + ClassDB::bind_method(_MD("is_audio_listener_2d","enable"), &Viewport::is_audio_listener_2d); + ClassDB::bind_method(_MD("set_attach_to_screen_rect","rect"), &Viewport::set_attach_to_screen_rect); - ObjectTypeDB::bind_method(_MD("set_as_audio_listener","enable"), &Viewport::set_as_audio_listener); - ObjectTypeDB::bind_method(_MD("is_audio_listener","enable"), &Viewport::is_audio_listener); + ClassDB::bind_method(_MD("get_mouse_pos"), &Viewport::get_mouse_pos); + ClassDB::bind_method(_MD("warp_mouse","to_pos"), &Viewport::warp_mouse); - ObjectTypeDB::bind_method(_MD("set_as_audio_listener_2d","enable"), &Viewport::set_as_audio_listener_2d); - ObjectTypeDB::bind_method(_MD("is_audio_listener_2d","enable"), &Viewport::is_audio_listener_2d); - ObjectTypeDB::bind_method(_MD("set_render_target_to_screen_rect","rect"), &Viewport::set_render_target_to_screen_rect); + ClassDB::bind_method(_MD("gui_has_modal_stack"), &Viewport::gui_has_modal_stack); + ClassDB::bind_method(_MD("gui_get_drag_data:Variant"), &Viewport::gui_get_drag_data); - ObjectTypeDB::bind_method(_MD("get_mouse_pos"), &Viewport::get_mouse_pos); - ObjectTypeDB::bind_method(_MD("warp_mouse","to_pos"), &Viewport::warp_mouse); + ClassDB::bind_method(_MD("set_disable_input","disable"), &Viewport::set_disable_input); + ClassDB::bind_method(_MD("is_input_disabled"), &Viewport::is_input_disabled); - ObjectTypeDB::bind_method(_MD("gui_has_modal_stack"), &Viewport::gui_has_modal_stack); - ObjectTypeDB::bind_method(_MD("gui_get_drag_data:Variant"), &Viewport::gui_get_drag_data); + ClassDB::bind_method(_MD("set_disable_3d","disable"), &Viewport::set_disable_3d); + ClassDB::bind_method(_MD("is_3d_disabled"), &Viewport::is_3d_disabled); - ObjectTypeDB::bind_method(_MD("set_disable_input","disable"), &Viewport::set_disable_input); - ObjectTypeDB::bind_method(_MD("is_input_disabled"), &Viewport::is_input_disabled); + ClassDB::bind_method(_MD("_gui_show_tooltip"), &Viewport::_gui_show_tooltip); + ClassDB::bind_method(_MD("_gui_remove_focus"), &Viewport::_gui_remove_focus); - ObjectTypeDB::bind_method(_MD("_gui_show_tooltip"), &Viewport::_gui_show_tooltip); - ObjectTypeDB::bind_method(_MD("_gui_remove_focus"), &Viewport::_gui_remove_focus); + ClassDB::bind_method(_MD("set_shadow_atlas_size","size"), &Viewport::set_shadow_atlas_size); + ClassDB::bind_method(_MD("get_shadow_atlas_size"), &Viewport::get_shadow_atlas_size); - ADD_PROPERTY( PropertyInfo(Variant::RECT2,"rect"), _SCS("set_rect"), _SCS("get_rect") ); + ClassDB::bind_method(_MD("set_shadow_atlas_quadrant_subdiv","quadrant","subdiv"), &Viewport::set_shadow_atlas_quadrant_subdiv); + ClassDB::bind_method(_MD("get_shadow_atlas_quadrant_subdiv","quadrant"), &Viewport::get_shadow_atlas_quadrant_subdiv); + + ADD_PROPERTY( PropertyInfo(Variant::RECT2,"size"), _SCS("set_size"), _SCS("get_size") ); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"own_world"), _SCS("set_use_own_world"), _SCS("is_using_own_world") ); ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"world",PROPERTY_HINT_RESOURCE_TYPE,"World"), _SCS("set_world"), _SCS("get_world") ); // ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"world_2d",PROPERTY_HINT_RESOURCE_TYPE,"World2D"), _SCS("set_world_2d"), _SCS("get_world_2d") ); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"transparent_bg"), _SCS("set_transparent_background"), _SCS("has_transparent_background") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"render_target/enabled"), _SCS("set_as_render_target"), _SCS("is_set_as_render_target") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"render_target/v_flip"), _SCS("set_render_target_vflip"), _SCS("get_render_target_vflip") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"render_target/clear_on_new_frame"), _SCS("set_render_target_clear_on_new_frame"), _SCS("get_render_target_clear_on_new_frame") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"render_target/filter"), _SCS("set_render_target_filter"), _SCS("get_render_target_filter") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"render_target/gen_mipmaps"), _SCS("set_render_target_gen_mipmaps"), _SCS("get_render_target_gen_mipmaps") ); - ADD_PROPERTY( PropertyInfo(Variant::INT,"render_target/update_mode",PROPERTY_HINT_ENUM,"Disabled,Once,When Visible,Always"), _SCS("set_render_target_update_mode"), _SCS("get_render_target_update_mode") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"audio_listener/enable_2d"), _SCS("set_as_audio_listener_2d"), _SCS("is_audio_listener_2d") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"audio_listener/enable_3d"), _SCS("set_as_audio_listener"), _SCS("is_audio_listener") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"physics/object_picking"), _SCS("set_physics_object_picking"), _SCS("get_physics_object_picking") ); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"gui/disable_input"), _SCS("set_disable_input"), _SCS("is_input_disabled") ); + ADD_GROUP("Rendering",""); + ADD_PROPERTY( PropertyInfo(Variant::INT,"msaa",PROPERTY_HINT_ENUM,"Disabled,2x,4x,8x,16x"), _SCS("set_msaa"), _SCS("get_msaa") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"hdr"), _SCS("set_hdr"), _SCS("get_hdr") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"disable_3d"), _SCS("set_disable_3d"), _SCS("is_3d_disabled") ); + ADD_GROUP("Render Target","render_target_"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"render_target_v_flip"), _SCS("set_vflip"), _SCS("get_vflip") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"render_target_clear_on_new_frame"), _SCS("set_clear_on_new_frame"), _SCS("get_clear_on_new_frame") ); + ADD_PROPERTY( PropertyInfo(Variant::INT,"render_target_update_mode",PROPERTY_HINT_ENUM,"Disabled,Once,When Visible,Always"), _SCS("set_update_mode"), _SCS("get_update_mode") ); + ADD_GROUP("Audio Listener","audio_listener_"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"audio_listener_enable_2d"), _SCS("set_as_audio_listener_2d"), _SCS("is_audio_listener_2d") ); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"audio_listener_enable_3d"), _SCS("set_as_audio_listener"), _SCS("is_audio_listener") ); + ADD_GROUP("Physics","physics_"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"physics_object_picking"), _SCS("set_physics_object_picking"), _SCS("get_physics_object_picking") ); + ADD_GROUP("GUI","gui_"); + ADD_PROPERTY( PropertyInfo(Variant::BOOL,"gui_disable_input"), _SCS("set_disable_input"), _SCS("is_input_disabled") ); + ADD_GROUP("Shadow Atlas","shadow_atlas_"); + ADD_PROPERTY( PropertyInfo(Variant::INT,"shadow_atlas_size"), _SCS("set_shadow_atlas_size"), _SCS("get_shadow_atlas_size") ); + ADD_PROPERTYI( PropertyInfo(Variant::INT,"shadow_atlas_quad_0",PROPERTY_HINT_ENUM,"Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows"), _SCS("set_shadow_atlas_quadrant_subdiv"), _SCS("get_shadow_atlas_quadrant_subdiv"),0 ); + ADD_PROPERTYI( PropertyInfo(Variant::INT,"shadow_atlas_quad_1",PROPERTY_HINT_ENUM,"Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows"), _SCS("set_shadow_atlas_quadrant_subdiv"), _SCS("get_shadow_atlas_quadrant_subdiv"),1 ); + ADD_PROPERTYI( PropertyInfo(Variant::INT,"shadow_atlas_quad_2",PROPERTY_HINT_ENUM,"Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows"), _SCS("set_shadow_atlas_quadrant_subdiv"), _SCS("get_shadow_atlas_quadrant_subdiv"),2 ); + ADD_PROPERTYI( PropertyInfo(Variant::INT,"shadow_atlas_quad_3",PROPERTY_HINT_ENUM,"Disabled,1 Shadow,4 Shadows,16 Shadows,64 Shadows,256 Shadows,1024 Shadows"), _SCS("set_shadow_atlas_quadrant_subdiv"), _SCS("get_shadow_atlas_quadrant_subdiv"),3 ); ADD_SIGNAL(MethodInfo("size_changed")); - BIND_CONSTANT( RENDER_TARGET_UPDATE_DISABLED ); - BIND_CONSTANT( RENDER_TARGET_UPDATE_ONCE ); - BIND_CONSTANT( RENDER_TARGET_UPDATE_WHEN_VISIBLE ); - BIND_CONSTANT( RENDER_TARGET_UPDATE_ALWAYS ); + BIND_CONSTANT( UPDATE_DISABLED ); + BIND_CONSTANT( UPDATE_ONCE ); + BIND_CONSTANT( UPDATE_WHEN_VISIBLE ); + BIND_CONSTANT( UPDATE_ALWAYS ); + + BIND_CONSTANT( SHADOW_ATLAS_QUADRANT_SUBDIV_DISABLED ); + BIND_CONSTANT( SHADOW_ATLAS_QUADRANT_SUBDIV_1 ); + BIND_CONSTANT( SHADOW_ATLAS_QUADRANT_SUBDIV_4 ); + BIND_CONSTANT( SHADOW_ATLAS_QUADRANT_SUBDIV_16 ); + BIND_CONSTANT( SHADOW_ATLAS_QUADRANT_SUBDIV_64 ); + BIND_CONSTANT( SHADOW_ATLAS_QUADRANT_SUBDIV_256 ); + BIND_CONSTANT( SHADOW_ATLAS_QUADRANT_SUBDIV_1024 ); + BIND_CONSTANT( SHADOW_ATLAS_QUADRANT_SUBDIV_MAX ); + + BIND_CONSTANT( MSAA_DISABLED ); + BIND_CONSTANT( MSAA_2X ); + BIND_CONSTANT( MSAA_4X ); + BIND_CONSTANT( MSAA_8X ); + BIND_CONSTANT( MSAA_16X ); } @@ -2723,6 +2846,13 @@ Viewport::Viewport() { world_2d = Ref<World2D>( memnew( World2D )); viewport = VisualServer::get_singleton()->viewport_create(); + texture_rid=VisualServer::get_singleton()->viewport_get_texture(viewport); + texture_flags=0; + + default_texture.instance(); + default_texture->vp=const_cast<Viewport*>(this); + viewport_textures.insert(default_texture.ptr()); + internal_listener = SpatialSoundServer::get_singleton()->listener_create(); audio_listener=false; internal_listener_2d = SpatialSound2DServer::get_singleton()->listener_create(); @@ -2734,19 +2864,27 @@ Viewport::Viewport() { size_override=false; size_override_stretch=false; size_override_size=Size2(1,1); - render_target_gen_mipmaps=false; - render_target=false; - render_target_vflip=false; - render_target_clear_on_new_frame=true; - //render_target_clear=true; - render_target_update_mode=RENDER_TARGET_UPDATE_WHEN_VISIBLE; - render_target_texture = Ref<RenderTargetTexture>( memnew( RenderTargetTexture(this) ) ); + gen_mipmaps=false; + + vflip=false; + clear_on_new_frame=true; + //clear=true; + update_mode=UPDATE_WHEN_VISIBLE; physics_object_picking=false; physics_object_capture=0; physics_object_over=0; physics_last_mousepos=Vector2(1e20,1e20); + shadow_atlas_size=0; + for(int i=0;i<4;i++) { + shadow_atlas_quadrant_subdiv[i]=SHADOW_ATLAS_QUADRANT_SUBDIV_MAX; + } + set_shadow_atlas_quadrant_subdiv(0,SHADOW_ATLAS_QUADRANT_SUBDIV_4); + set_shadow_atlas_quadrant_subdiv(1,SHADOW_ATLAS_QUADRANT_SUBDIV_4); + set_shadow_atlas_quadrant_subdiv(2,SHADOW_ATLAS_QUADRANT_SUBDIV_16); + set_shadow_atlas_quadrant_subdiv(3,SHADOW_ATLAS_QUADRANT_SUBDIV_64); + String id=itos(get_instance_ID()); input_group = "_vp_input"+id; @@ -2755,20 +2893,23 @@ Viewport::Viewport() { unhandled_key_input_group = "_vp_unhandled_key_input"+id; disable_input=false; + disable_3d=false; //window tooltip gui.tooltip_timer = -1; //gui.tooltip_timer->force_parent_owned(); - gui.tooltip_delay=GLOBAL_DEF("display/tooltip_delay",0.7); + gui.tooltip_delay=GLOBAL_DEF("gui/timers/tooltip_delay_sec",0.7); gui.tooltip=NULL; gui.tooltip_label=NULL; gui.drag_preview=NULL; gui.drag_attempted=false; + gui.canvas_sort_index=0; - parent_control=NULL; + msaa=MSAA_DISABLED; + hdr=false; } @@ -2776,11 +2917,14 @@ Viewport::Viewport() { Viewport::~Viewport() { + //erase itself from viewport textures + for(Set<ViewportTexture*>::Element *E=viewport_textures.front();E;E=E->next()) { + E->get()->vp=NULL; + } VisualServer::get_singleton()->free( viewport ); SpatialSoundServer::get_singleton()->free(internal_listener); SpatialSound2DServer::get_singleton()->free(internal_listener_2d); - if (render_target_texture.is_valid()) - render_target_texture->vp=NULL; //so if used, will crash + } diff --git a/scene/main/viewport.h b/scene/main/viewport.h index f657f0507d..1f30044cef 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -48,17 +48,24 @@ class Label; class Timer; class Viewport; -class RenderTargetTexture : public Texture { +class ViewportTexture : public Texture { - OBJ_TYPE( RenderTargetTexture, Texture ); + GDCLASS( ViewportTexture, Texture ); - int flags; -friend class Viewport; - Viewport *vp; + NodePath path; +friend class Viewport; + Viewport* vp; +protected: + static void _bind_methods(); public: + void set_viewport_path_in_scene(const NodePath& p_path); + NodePath get_viewport_path_in_scene() const; + + virtual void setup_local_to_scene(); + virtual int get_width() const; virtual int get_height() const; @@ -70,28 +77,49 @@ public: virtual void set_flags(uint32_t p_flags); virtual uint32_t get_flags() const; - RenderTargetTexture(Viewport *p_vp=NULL); + ViewportTexture(); + ~ViewportTexture(); }; class Viewport : public Node { - OBJ_TYPE( Viewport, Node ); + GDCLASS( Viewport, Node ); public: - enum RenderTargetUpdateMode { - RENDER_TARGET_UPDATE_DISABLED, - RENDER_TARGET_UPDATE_ONCE, //then goes to disabled - RENDER_TARGET_UPDATE_WHEN_VISIBLE, // default - RENDER_TARGET_UPDATE_ALWAYS + enum UpdateMode { + UPDATE_DISABLED, + UPDATE_ONCE, //then goes to disabled + UPDATE_WHEN_VISIBLE, // default + UPDATE_ALWAYS + }; + + enum ShadowAtlasQuadrantSubdiv { + SHADOW_ATLAS_QUADRANT_SUBDIV_DISABLED, + SHADOW_ATLAS_QUADRANT_SUBDIV_1, + SHADOW_ATLAS_QUADRANT_SUBDIV_4, + SHADOW_ATLAS_QUADRANT_SUBDIV_16, + SHADOW_ATLAS_QUADRANT_SUBDIV_64, + SHADOW_ATLAS_QUADRANT_SUBDIV_256, + SHADOW_ATLAS_QUADRANT_SUBDIV_1024, + SHADOW_ATLAS_QUADRANT_SUBDIV_MAX, + + }; + + enum MSAA { + MSAA_DISABLED, + MSAA_2X, + MSAA_4X, + MSAA_8X, + MSAA_16X, }; private: -friend class RenderTargetTexture; +friend class ViewportTexture; + - Control *parent_control; Viewport *parent; Listener *listener; @@ -101,7 +129,6 @@ friend class RenderTargetTexture; Set<Camera*> cameras; RID viewport; - RID canvas_item; RID current_canvas; bool audio_listener; @@ -110,19 +137,17 @@ friend class RenderTargetTexture; bool audio_listener_2d; RID internal_listener_2d; - Matrix32 canvas_transform; - Matrix32 global_canvas_transform; - Matrix32 stretch_transform; + Transform2D canvas_transform; + Transform2D global_canvas_transform; + Transform2D stretch_transform; - Rect2 rect; + Size2 size; Rect2 to_screen_rect; RID contact_2d_debug; RID contact_3d_debug_multimesh; RID contact_3d_debug_instance; - - bool size_override; bool size_override_stretch; Size2 size_override_size; @@ -131,10 +156,10 @@ friend class RenderTargetTexture; Rect2 last_vp_rect; bool transparent_bg; - bool render_target_vflip; - bool render_target_clear_on_new_frame; - bool render_target_filter; - bool render_target_gen_mipmaps; + bool vflip; + bool clear_on_new_frame; + bool filter; + bool gen_mipmaps; bool physics_object_picking; List<InputEvent> physics_picking_events; @@ -170,10 +195,20 @@ friend class RenderTargetTexture; void _update_stretch_transform(); void _update_global_transform(); - bool render_target; - RenderTargetUpdateMode render_target_update_mode; - RID render_target_texture_rid; - Ref<RenderTargetTexture> render_target_texture; + + bool disable_3d; + UpdateMode update_mode; + RID texture_rid; + uint32_t texture_flags; + + int shadow_atlas_size; + ShadowAtlasQuadrantSubdiv shadow_atlas_quadrant_subdiv[4]; + + MSAA msaa; + bool hdr; + + Ref<ViewportTexture> default_texture; + Set<ViewportTexture*> viewport_textures; struct GUI { @@ -197,11 +232,12 @@ friend class RenderTargetTexture; float tooltip_delay; List<Control*> modal_stack; unsigned int cancelled_input_ID; - Matrix32 focus_inv_xform; + Transform2D focus_inv_xform; bool subwindow_order_dirty; List<Control*> subwindows; bool roots_order_dirty; List<Control*> roots; + int canvas_sort_index; //for sorting items with canvas as root GUI(); @@ -214,14 +250,14 @@ friend class RenderTargetTexture; void _gui_sort_roots(); void _gui_sort_modal_stack(); Control* _gui_find_control(const Point2& p_global); - Control* _gui_find_control_at_pos(CanvasItem* p_node,const Point2& p_global,const Matrix32& p_xform,Matrix32& r_inv_xform); + Control* _gui_find_control_at_pos(CanvasItem* p_node,const Point2& p_global,const Transform2D& p_xform,Transform2D& r_inv_xform); void _gui_input_event(InputEvent p_event); void update_worlds(); - _FORCE_INLINE_ Matrix32 _get_input_pre_xform() const; + _FORCE_INLINE_ Transform2D _get_input_pre_xform() const; void _vp_enter_tree(); void _vp_exit_tree(); @@ -299,8 +335,10 @@ public: void set_as_audio_listener_2d(bool p_enable); bool is_audio_listener_2d() const; - void set_rect(const Rect2& p_rect); - Rect2 get_rect() const; + void set_size(const Size2& p_size); + + + Size2 get_size() const; Rect2 get_visible_rect() const; RID get_viewport() const; @@ -313,13 +351,13 @@ public: Ref<World2D> find_world_2d() const; - void set_canvas_transform(const Matrix32& p_transform); - Matrix32 get_canvas_transform() const; + void set_canvas_transform(const Transform2D& p_transform); + Transform2D get_canvas_transform() const; - void set_global_canvas_transform(const Matrix32& p_transform); - Matrix32 get_global_canvas_transform() const; + void set_global_canvas_transform(const Transform2D& p_transform); + Transform2D get_global_canvas_transform() const; - Matrix32 get_final_transform() const; + Transform2D get_final_transform() const; void set_transparent_background(bool p_enable); bool has_transparent_background() const; @@ -327,30 +365,34 @@ public: void set_size_override(bool p_enable,const Size2& p_size=Size2(-1,-1),const Vector2& p_margin=Vector2()); Size2 get_size_override() const; + bool is_size_override_enabled() const; void set_size_override_stretch(bool p_enable); bool is_size_override_stretch_enabled() const; - void set_as_render_target(bool p_enable); - bool is_set_as_render_target() const; + void set_vflip(bool p_enable); + bool get_vflip() const; - void set_render_target_vflip(bool p_enable); - bool get_render_target_vflip() const; + void set_clear_on_new_frame(bool p_enable); + bool get_clear_on_new_frame() const; + void clear(); - void set_render_target_clear_on_new_frame(bool p_enable); - bool get_render_target_clear_on_new_frame() const; - void render_target_clear(); - void set_render_target_filter(bool p_enable); - bool get_render_target_filter() const; + void set_update_mode(UpdateMode p_mode); + UpdateMode get_update_mode() const; + Ref<ViewportTexture> get_texture() const; - void set_render_target_gen_mipmaps(bool p_enable); - bool get_render_target_gen_mipmaps() const; + void set_shadow_atlas_size(int p_size); + int get_shadow_atlas_size() const; - void set_render_target_update_mode(RenderTargetUpdateMode p_mode); - RenderTargetUpdateMode get_render_target_update_mode() const; - Ref<RenderTargetTexture> get_render_target_texture() const; + void set_shadow_atlas_quadrant_subdiv(int p_quadrant,ShadowAtlasQuadrantSubdiv p_subdiv); + ShadowAtlasQuadrantSubdiv get_shadow_atlas_quadrant_subdiv(int p_quadrant) const; + void set_msaa(MSAA p_msaa); + MSAA get_msaa() const; + + void set_hdr(bool p_hdr); + bool get_hdr() const; Vector2 get_camera_coords(const Vector2& p_viewport_coords) const; Vector2 get_camera_rect_size() const; @@ -367,8 +409,11 @@ public: void set_disable_input(bool p_disable); bool is_input_disabled() const; - void set_render_target_to_screen_rect(const Rect2& p_rect); - Rect2 get_render_target_to_screen_rect() const; + void set_disable_3d(bool p_disable); + bool is_3d_disabled() const; + + void set_attach_to_screen_rect(const Rect2& p_rect); + Rect2 get_attach_to_screen_rect() const; Vector2 get_mouse_pos() const; void warp_mouse(const Vector2& p_pos); @@ -381,12 +426,20 @@ public: Variant gui_get_drag_data() const; Control *get_modal_stack_top() const; + void gui_reset_canvas_sort_index(); + int gui_get_canvas_sort_index(); + virtual String get_configuration_warning() const; + + Viewport(); ~Viewport(); }; -VARIANT_ENUM_CAST(Viewport::RenderTargetUpdateMode); +VARIANT_ENUM_CAST( Viewport::UpdateMode ); +VARIANT_ENUM_CAST( Viewport::ShadowAtlasQuadrantSubdiv ); +VARIANT_ENUM_CAST( Viewport::MSAA ); + #endif diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index 104aeb2b5e..2b7c95306f 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -66,6 +66,7 @@ #include "scene/gui/center_container.h" #include "scene/gui/scroll_container.h" #include "scene/gui/margin_container.h" +#include "scene/gui/viewport_container.h" #include "scene/gui/panel.h" #include "scene/gui/spin_box.h" #include "scene/gui/file_dialog.h" @@ -132,7 +133,7 @@ #include "scene/resources/surface_tool.h" #include "scene/resources/mesh_data_tool.h" -#include "scene/resources/scene_preloader.h" + #include "scene/resources/dynamic_font.h" #include "scene/resources/dynamic_font_stb.h" @@ -165,6 +166,7 @@ #include "scene/resources/sample.h" #include "scene/audio/sample_player.h" #include "scene/resources/texture.h" +#include "scene/resources/sky_box.h" #include "scene/resources/material.h" #include "scene/resources/mesh.h" #include "scene/resources/room.h" @@ -202,6 +204,8 @@ #include "scene/3d/mesh_instance.h" #include "scene/3d/quad.h" #include "scene/3d/light.h" +#include "scene/3d/reflection_probe.h" +#include "scene/3d/gi_probe.h" #include "scene/3d/particles.h" #include "scene/3d/portal.h" #include "scene/resources/environment.h" @@ -235,7 +239,6 @@ static ResourceFormatLoaderWAV *resource_loader_wav=NULL; #endif static ResourceFormatLoaderTheme *resource_loader_theme=NULL; -static ResourceFormatLoaderShader *resource_loader_shader=NULL; static ResourceFormatSaverText *resource_saver_text=NULL; static ResourceFormatLoaderText *resource_loader_text=NULL; @@ -269,15 +272,13 @@ void register_scene_types() { resource_loader_theme = memnew( ResourceFormatLoaderTheme ); ResourceLoader::add_resource_format_loader( resource_loader_theme ); - resource_loader_shader = memnew( ResourceFormatLoaderShader ); - ResourceLoader::add_resource_format_loader( resource_loader_shader ); - bool default_theme_hidpi=GLOBAL_DEF("display/use_hidpi_theme",false); - Globals::get_singleton()->set_custom_property_info("display/use_hidpi_theme",PropertyInfo(Variant::BOOL,"display/use_hidpi_theme",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED)); - String theme_path = GLOBAL_DEF("display/custom_theme",""); - Globals::get_singleton()->set_custom_property_info("display/custom_theme",PropertyInfo(Variant::STRING,"display/custom_theme",PROPERTY_HINT_FILE,"*.tres,*.res",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED)); - String font_path = GLOBAL_DEF("display/custom_theme_font",""); - Globals::get_singleton()->set_custom_property_info("display/custom_theme_font",PropertyInfo(Variant::STRING,"display/custom_theme_font",PROPERTY_HINT_FILE,"*.tres,*.res,*.fnt",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED)); + bool default_theme_hidpi=GLOBAL_DEF("gui/theme/use_hidpi",false); + GlobalConfig::get_singleton()->set_custom_property_info("gui/theme/use_hidpi",PropertyInfo(Variant::BOOL,"gui/theme/use_hidpi",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED)); + String theme_path = GLOBAL_DEF("gui/theme/custom",""); + GlobalConfig::get_singleton()->set_custom_property_info("gui/theme/custom",PropertyInfo(Variant::STRING,"gui/theme/custom",PROPERTY_HINT_FILE,"*.tres,*.res",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED)); + String font_path = GLOBAL_DEF("gui/theme/custom_font",""); + GlobalConfig::get_singleton()->set_custom_property_info("gui/theme/custom_font",PropertyInfo(Variant::STRING,"gui/theme/custom_font",PROPERTY_HINT_FILE,"*.tres,*.res,*.fnt",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED)); if (theme_path!=String()) { @@ -297,102 +298,102 @@ void register_scene_types() { OS::get_singleton()->yield(); //may take time to init - ObjectTypeDB::register_type<Object>(); + ClassDB::register_class<Object>(); - ObjectTypeDB::register_type<Node>(); - ObjectTypeDB::register_virtual_type<InstancePlaceholder>(); + ClassDB::register_class<Node>(); + ClassDB::register_virtual_class<InstancePlaceholder>(); - ObjectTypeDB::register_type<Viewport>(); - ObjectTypeDB::register_virtual_type<RenderTargetTexture>(); - ObjectTypeDB::register_type<HTTPRequest>(); - ObjectTypeDB::register_type<Timer>(); - ObjectTypeDB::register_type<CanvasLayer>(); - ObjectTypeDB::register_type<CanvasModulate>(); - ObjectTypeDB::register_type<ResourcePreloader>(); + ClassDB::register_class<Viewport>(); + ClassDB::register_class<ViewportTexture>(); + ClassDB::register_class<HTTPRequest>(); + ClassDB::register_class<Timer>(); + ClassDB::register_class<CanvasLayer>(); + ClassDB::register_class<CanvasModulate>(); + ClassDB::register_class<ResourcePreloader>(); /* REGISTER GUI */ - ObjectTypeDB::register_type<ButtonGroup>(); - ObjectTypeDB::register_virtual_type<BaseButton>(); + ClassDB::register_class<ButtonGroup>(); + ClassDB::register_virtual_class<BaseButton>(); OS::get_singleton()->yield(); //may take time to init - ObjectTypeDB::register_type<ShortCut>(); - ObjectTypeDB::register_type<Control>(); -// ObjectTypeDB::register_type<EmptyControl>(); - ObjectTypeDB::add_compatibility_type("EmptyControl","Control"); - ObjectTypeDB::register_type<Button>(); - ObjectTypeDB::register_type<Label>(); - ObjectTypeDB::register_type<HScrollBar>(); - ObjectTypeDB::register_type<VScrollBar>(); - ObjectTypeDB::register_type<ProgressBar>(); - ObjectTypeDB::register_type<HSlider>(); - ObjectTypeDB::register_type<VSlider>(); - ObjectTypeDB::register_type<Popup>(); - ObjectTypeDB::register_type<PopupPanel>(); - ObjectTypeDB::register_type<MenuButton>(); - ObjectTypeDB::register_type<CheckBox>(); - ObjectTypeDB::register_type<CheckButton>(); - ObjectTypeDB::register_type<ToolButton>(); - ObjectTypeDB::register_type<LinkButton>(); - ObjectTypeDB::register_type<Panel>(); - ObjectTypeDB::register_type<Range>(); + ClassDB::register_class<ShortCut>(); + ClassDB::register_class<Control>(); +// ClassDB::register_type<EmptyControl>(); + ClassDB::register_class<Button>(); + ClassDB::register_class<Label>(); + ClassDB::register_class<HScrollBar>(); + ClassDB::register_class<VScrollBar>(); + ClassDB::register_class<ProgressBar>(); + ClassDB::register_class<HSlider>(); + ClassDB::register_class<VSlider>(); + ClassDB::register_class<Popup>(); + ClassDB::register_class<PopupPanel>(); + ClassDB::register_class<MenuButton>(); + ClassDB::register_class<CheckBox>(); + ClassDB::register_class<CheckButton>(); + ClassDB::register_class<ToolButton>(); + ClassDB::register_class<LinkButton>(); + ClassDB::register_class<Panel>(); + ClassDB::register_class<Range>(); OS::get_singleton()->yield(); //may take time to init - ObjectTypeDB::register_type<TextureFrame>(); - ObjectTypeDB::register_type<ColorFrame>(); - ObjectTypeDB::register_type<Patch9Frame>(); - ObjectTypeDB::register_type<TabContainer>(); - ObjectTypeDB::register_type<Tabs>(); - ObjectTypeDB::register_virtual_type<Separator>(); - ObjectTypeDB::register_type<HSeparator>(); - ObjectTypeDB::register_type<VSeparator>(); - ObjectTypeDB::register_type<TextureButton>(); - ObjectTypeDB::register_type<Container>(); - ObjectTypeDB::register_virtual_type<BoxContainer>(); - ObjectTypeDB::register_type<HBoxContainer>(); - ObjectTypeDB::register_type<VBoxContainer>(); - ObjectTypeDB::register_type<GridContainer>(); - ObjectTypeDB::register_type<CenterContainer>(); - ObjectTypeDB::register_type<ScrollContainer>(); - ObjectTypeDB::register_type<PanelContainer>(); - ObjectTypeDB::register_virtual_type<SplitContainer>(); - ObjectTypeDB::register_type<HSplitContainer>(); - ObjectTypeDB::register_type<VSplitContainer>(); - ObjectTypeDB::register_type<GraphNode>(); - ObjectTypeDB::register_type<GraphEdit>(); + ClassDB::register_class<TextureFrame>(); + ClassDB::register_class<ColorFrame>(); + ClassDB::register_class<Patch9Frame>(); + ClassDB::register_class<TabContainer>(); + ClassDB::register_class<Tabs>(); + ClassDB::register_virtual_class<Separator>(); + ClassDB::register_class<HSeparator>(); + ClassDB::register_class<VSeparator>(); + ClassDB::register_class<TextureButton>(); + ClassDB::register_class<Container>(); + ClassDB::register_virtual_class<BoxContainer>(); + ClassDB::register_class<HBoxContainer>(); + ClassDB::register_class<VBoxContainer>(); + ClassDB::register_class<GridContainer>(); + ClassDB::register_class<CenterContainer>(); + ClassDB::register_class<ScrollContainer>(); + ClassDB::register_class<PanelContainer>(); + ClassDB::register_virtual_class<SplitContainer>(); + ClassDB::register_class<HSplitContainer>(); + ClassDB::register_class<VSplitContainer>(); + ClassDB::register_class<GraphNode>(); + ClassDB::register_class<GraphEdit>(); OS::get_singleton()->yield(); //may take time to init - ObjectTypeDB::register_virtual_type<ButtonArray>(); - ObjectTypeDB::register_type<HButtonArray>(); - ObjectTypeDB::register_type<VButtonArray>(); - ObjectTypeDB::register_type<TextureProgress>(); - ObjectTypeDB::register_type<ItemList>(); + ClassDB::register_virtual_class<ButtonArray>(); + ClassDB::register_class<HButtonArray>(); + ClassDB::register_class<VButtonArray>(); + ClassDB::register_class<TextureProgress>(); + ClassDB::register_class<ItemList>(); #ifndef ADVANCED_GUI_DISABLED - ObjectTypeDB::register_type<FileDialog>(); - ObjectTypeDB::register_type<LineEdit>(); - ObjectTypeDB::register_type<PopupMenu>(); - ObjectTypeDB::register_type<Tree>(); - - ObjectTypeDB::register_type<TextEdit>(); - - ObjectTypeDB::register_virtual_type<TreeItem>(); - ObjectTypeDB::register_type<OptionButton>(); - ObjectTypeDB::register_type<SpinBox>(); - ObjectTypeDB::register_type<ReferenceFrame>(); - ObjectTypeDB::register_type<ColorPicker>(); - ObjectTypeDB::register_type<ColorPickerButton>(); - ObjectTypeDB::register_type<RichTextLabel>(); - ObjectTypeDB::register_type<PopupDialog>(); - ObjectTypeDB::register_type<WindowDialog>(); - ObjectTypeDB::register_type<AcceptDialog>(); - ObjectTypeDB::register_type<ConfirmationDialog>(); - ObjectTypeDB::register_type<VideoPlayer>(); - ObjectTypeDB::register_type<MarginContainer>(); + ClassDB::register_class<FileDialog>(); + ClassDB::register_class<LineEdit>(); + ClassDB::register_class<PopupMenu>(); + ClassDB::register_class<Tree>(); + + ClassDB::register_class<TextEdit>(); + + ClassDB::register_virtual_class<TreeItem>(); + ClassDB::register_class<OptionButton>(); + ClassDB::register_class<SpinBox>(); + ClassDB::register_class<ReferenceFrame>(); + ClassDB::register_class<ColorPicker>(); + ClassDB::register_class<ColorPickerButton>(); + ClassDB::register_class<RichTextLabel>(); + ClassDB::register_class<PopupDialog>(); + ClassDB::register_class<WindowDialog>(); + ClassDB::register_class<AcceptDialog>(); + ClassDB::register_class<ConfirmationDialog>(); + ClassDB::register_class<VideoPlayer>(); + ClassDB::register_class<MarginContainer>(); + ClassDB::register_class<ViewportContainer>(); OS::get_singleton()->yield(); //may take time to init @@ -400,243 +401,239 @@ void register_scene_types() { /* REGISTER 3D */ - ObjectTypeDB::register_type<Spatial>(); - ObjectTypeDB::register_type<Skeleton>(); - ObjectTypeDB::register_type<AnimationPlayer>(); - ObjectTypeDB::register_type<Tween>(); + ClassDB::register_class<Spatial>(); + ClassDB::register_virtual_class<SpatialGizmo>(); + ClassDB::register_class<Skeleton>(); + ClassDB::register_class<AnimationPlayer>(); + ClassDB::register_class<Tween>(); OS::get_singleton()->yield(); //may take time to init #ifndef _3D_DISABLED - ObjectTypeDB::register_type<BoneAttachment>(); - ObjectTypeDB::register_virtual_type<VisualInstance>(); - ObjectTypeDB::register_type<Camera>(); - ObjectTypeDB::register_type<Listener>(); - ObjectTypeDB::register_type<InterpolatedCamera>(); - ObjectTypeDB::register_type<TestCube>(); - ObjectTypeDB::register_type<MeshInstance>(); - ObjectTypeDB::register_type<ImmediateGeometry>(); - ObjectTypeDB::register_type<Sprite3D>(); - ObjectTypeDB::register_type<AnimatedSprite3D>(); - ObjectTypeDB::register_virtual_type<Light>(); - ObjectTypeDB::register_type<DirectionalLight>(); - ObjectTypeDB::register_type<OmniLight>(); - ObjectTypeDB::register_type<SpotLight>(); - ObjectTypeDB::register_type<AnimationTreePlayer>(); - ObjectTypeDB::register_type<Portal>(); - ObjectTypeDB::register_type<Particles>(); - ObjectTypeDB::register_type<Position3D>(); - ObjectTypeDB::register_type<Quad>(); - ObjectTypeDB::register_type<NavigationMeshInstance>(); - ObjectTypeDB::register_type<NavigationMesh>(); - ObjectTypeDB::register_type<Navigation>(); + ClassDB::register_class<BoneAttachment>(); + ClassDB::register_virtual_class<VisualInstance>(); + ClassDB::register_class<Camera>(); + ClassDB::register_class<Listener>(); + ClassDB::register_class<InterpolatedCamera>(); + ClassDB::register_class<TestCube>(); + ClassDB::register_class<MeshInstance>(); + ClassDB::register_class<ImmediateGeometry>(); + ClassDB::register_class<Sprite3D>(); + ClassDB::register_class<AnimatedSprite3D>(); + ClassDB::register_virtual_class<Light>(); + ClassDB::register_class<DirectionalLight>(); + ClassDB::register_class<OmniLight>(); + ClassDB::register_class<SpotLight>(); + ClassDB::register_class<ReflectionProbe>(); + ClassDB::register_class<GIProbe>(); + ClassDB::register_class<GIProbeData>(); + ClassDB::register_class<AnimationTreePlayer>(); + ClassDB::register_class<Portal>(); + //ClassDB::register_type<Particles>(); + ClassDB::register_class<Position3D>(); + ClassDB::register_class<Quad>(); + ClassDB::register_class<NavigationMeshInstance>(); + ClassDB::register_class<NavigationMesh>(); + ClassDB::register_class<Navigation>(); OS::get_singleton()->yield(); //may take time to init - ObjectTypeDB::register_virtual_type<CollisionObject>(); - ObjectTypeDB::register_type<StaticBody>(); - ObjectTypeDB::register_type<RigidBody>(); - ObjectTypeDB::register_type<KinematicBody>(); - - - ObjectTypeDB::register_type<VehicleBody>(); - ObjectTypeDB::register_type<VehicleWheel>(); - ObjectTypeDB::register_type<Area>(); - ObjectTypeDB::register_type<ProximityGroup>(); - ObjectTypeDB::register_type<CollisionShape>(); - ObjectTypeDB::register_type<CollisionPolygon>(); - ObjectTypeDB::register_type<RayCast>(); - ObjectTypeDB::register_type<MultiMeshInstance>(); - ObjectTypeDB::register_type<Room>(); - ObjectTypeDB::register_type<Curve3D>(); - ObjectTypeDB::register_type<Path>(); - ObjectTypeDB::register_type<PathFollow>(); - ObjectTypeDB::register_type<VisibilityNotifier>(); - ObjectTypeDB::register_type<VisibilityEnabler>(); - ObjectTypeDB::register_type<BakedLightInstance>(); - ObjectTypeDB::register_type<BakedLightSampler>(); - ObjectTypeDB::register_type<WorldEnvironment>(); - ObjectTypeDB::register_type<RemoteTransform>(); - - ObjectTypeDB::register_virtual_type<Joint>(); - ObjectTypeDB::register_type<PinJoint>(); - ObjectTypeDB::register_type<HingeJoint>(); - ObjectTypeDB::register_type<SliderJoint>(); - ObjectTypeDB::register_type<ConeTwistJoint>(); - ObjectTypeDB::register_type<Generic6DOFJoint>(); + ClassDB::register_virtual_class<CollisionObject>(); + ClassDB::register_class<StaticBody>(); + ClassDB::register_class<RigidBody>(); + ClassDB::register_class<KinematicBody>(); + + + ClassDB::register_class<VehicleBody>(); + ClassDB::register_class<VehicleWheel>(); + ClassDB::register_class<Area>(); + ClassDB::register_class<ProximityGroup>(); + ClassDB::register_class<CollisionShape>(); + ClassDB::register_class<CollisionPolygon>(); + ClassDB::register_class<RayCast>(); + ClassDB::register_class<MultiMeshInstance>(); + ClassDB::register_class<Room>(); + ClassDB::register_class<Curve3D>(); + ClassDB::register_class<Path>(); + ClassDB::register_class<PathFollow>(); + ClassDB::register_class<VisibilityNotifier>(); + ClassDB::register_class<VisibilityEnabler>(); + ClassDB::register_class<BakedLight>(); + //ClassDB::register_type<BakedLightSampler>(); + ClassDB::register_class<WorldEnvironment>(); + ClassDB::register_class<RemoteTransform>(); + + ClassDB::register_virtual_class<Joint>(); + ClassDB::register_class<PinJoint>(); + ClassDB::register_class<HingeJoint>(); + ClassDB::register_class<SliderJoint>(); + ClassDB::register_class<ConeTwistJoint>(); + ClassDB::register_class<Generic6DOFJoint>(); //scenariofx OS::get_singleton()->yield(); //may take time to init - ObjectTypeDB::register_type<SpatialSamplePlayer>(); - ObjectTypeDB::register_type<SpatialStreamPlayer>(); - ObjectTypeDB::register_type<SoundRoomParams>(); + ClassDB::register_class<SpatialSamplePlayer>(); + ClassDB::register_class<SpatialStreamPlayer>(); + ClassDB::register_class<SoundRoomParams>(); #endif - ObjectTypeDB::register_type<MeshLibrary>(); - AcceptDialog::set_swap_ok_cancel( GLOBAL_DEF("display/swap_ok_cancel",bool(OS::get_singleton()->get_swap_ok_cancel())) ); - - ObjectTypeDB::register_type<SamplePlayer>(); - ObjectTypeDB::register_type<StreamPlayer>(); - ObjectTypeDB::register_type<EventPlayer>(); - - - ObjectTypeDB::register_type<CanvasItemMaterial>(); - ObjectTypeDB::register_virtual_type<CanvasItem>(); - ObjectTypeDB::register_type<Node2D>(); - ObjectTypeDB::register_type<Particles2D>(); - ObjectTypeDB::register_type<ParticleAttractor2D>(); - ObjectTypeDB::register_type<Sprite>(); - ObjectTypeDB::register_type<ViewportSprite>(); - ObjectTypeDB::register_type<SpriteFrames>(); - ObjectTypeDB::register_type<AnimatedSprite>(); - ObjectTypeDB::register_type<Position2D>(); - ObjectTypeDB::register_virtual_type<CollisionObject2D>(); - ObjectTypeDB::register_virtual_type<PhysicsBody2D>(); - ObjectTypeDB::register_type<StaticBody2D>(); - ObjectTypeDB::register_type<RigidBody2D>(); - ObjectTypeDB::register_type<KinematicBody2D>(); - ObjectTypeDB::register_type<Area2D>(); - ObjectTypeDB::register_type<CollisionShape2D>(); - ObjectTypeDB::register_type<CollisionPolygon2D>(); - ObjectTypeDB::register_type<RayCast2D>(); - ObjectTypeDB::register_type<VisibilityNotifier2D>(); - ObjectTypeDB::register_type<VisibilityEnabler2D>(); - ObjectTypeDB::register_type<Polygon2D>(); - ObjectTypeDB::register_type<Light2D>(); - ObjectTypeDB::register_type<LightOccluder2D>(); - ObjectTypeDB::register_type<OccluderPolygon2D>(); - ObjectTypeDB::register_type<YSort>(); - ObjectTypeDB::register_type<BackBufferCopy>(); - if (bool(GLOBAL_DEF("physics/remove_collision_helpers_at_runtime",false))) { - ObjectTypeDB::set_type_enabled("CollisionShape2D",false); - ObjectTypeDB::set_type_enabled("CollisionPolygon2D",false); - ObjectTypeDB::set_type_enabled("CollisionShape",false); - ObjectTypeDB::set_type_enabled("CollisionPolygon",false); - } + ClassDB::register_class<MeshLibrary>(); + AcceptDialog::set_swap_ok_cancel( GLOBAL_DEF("gui/common/swap_ok_cancel",bool(OS::get_singleton()->get_swap_ok_cancel())) ); + + ClassDB::register_class<SamplePlayer>(); + ClassDB::register_class<StreamPlayer>(); + ClassDB::register_class<EventPlayer>(); + + + ClassDB::register_class<CanvasItemMaterial>(); + ClassDB::register_virtual_class<CanvasItem>(); + ClassDB::register_class<Node2D>(); + ClassDB::register_class<Particles2D>(); + ClassDB::register_class<ParticleAttractor2D>(); + ClassDB::register_class<Sprite>(); +// ClassDB::register_type<ViewportSprite>(); + ClassDB::register_class<SpriteFrames>(); + ClassDB::register_class<AnimatedSprite>(); + ClassDB::register_class<Position2D>(); + ClassDB::register_virtual_class<CollisionObject2D>(); + ClassDB::register_virtual_class<PhysicsBody2D>(); + ClassDB::register_class<StaticBody2D>(); + ClassDB::register_class<RigidBody2D>(); + ClassDB::register_class<KinematicBody2D>(); + ClassDB::register_class<Area2D>(); + ClassDB::register_class<CollisionShape2D>(); + ClassDB::register_class<CollisionPolygon2D>(); + ClassDB::register_class<RayCast2D>(); + ClassDB::register_class<VisibilityNotifier2D>(); + ClassDB::register_class<VisibilityEnabler2D>(); + ClassDB::register_class<Polygon2D>(); + ClassDB::register_class<Light2D>(); + ClassDB::register_class<LightOccluder2D>(); + ClassDB::register_class<OccluderPolygon2D>(); + ClassDB::register_class<YSort>(); + ClassDB::register_class<BackBufferCopy>(); OS::get_singleton()->yield(); //may take time to init - ObjectTypeDB::register_type<Camera2D>(); - ObjectTypeDB::register_virtual_type<Joint2D>(); - ObjectTypeDB::register_type<PinJoint2D>(); - ObjectTypeDB::register_type<GrooveJoint2D>(); - ObjectTypeDB::register_type<DampedSpringJoint2D>(); - ObjectTypeDB::register_type<TileSet>(); - ObjectTypeDB::register_type<TileMap>(); - ObjectTypeDB::register_type<ParallaxBackground>(); - ObjectTypeDB::register_type<ParallaxLayer>(); - ObjectTypeDB::register_virtual_type<SoundPlayer2D>(); - ObjectTypeDB::register_type<SamplePlayer2D>(); - ObjectTypeDB::register_type<TouchScreenButton>(); - ObjectTypeDB::register_type<RemoteTransform2D>(); + ClassDB::register_class<Camera2D>(); + ClassDB::register_virtual_class<Joint2D>(); + ClassDB::register_class<PinJoint2D>(); + ClassDB::register_class<GrooveJoint2D>(); + ClassDB::register_class<DampedSpringJoint2D>(); + ClassDB::register_class<TileSet>(); + ClassDB::register_class<TileMap>(); + ClassDB::register_class<ParallaxBackground>(); + ClassDB::register_class<ParallaxLayer>(); + ClassDB::register_virtual_class<SoundPlayer2D>(); + ClassDB::register_class<SamplePlayer2D>(); + ClassDB::register_class<TouchScreenButton>(); + ClassDB::register_class<RemoteTransform2D>(); OS::get_singleton()->yield(); //may take time to init /* REGISTER RESOURCES */ - ObjectTypeDB::register_virtual_type<Shader>(); - ObjectTypeDB::register_virtual_type<ShaderGraph>(); - ObjectTypeDB::register_type<CanvasItemShader>(); - ObjectTypeDB::register_type<CanvasItemShaderGraph>(); + ClassDB::register_virtual_class<Shader>(); +// ClassDB::register_virtual_type<ShaderGraph>(); + ClassDB::register_class<CanvasItemShader>(); +// ClassDB::register_type<CanvasItemShaderGraph>(); #ifndef _3D_DISABLED - ObjectTypeDB::register_type<Mesh>(); - ObjectTypeDB::register_virtual_type<Material>(); - ObjectTypeDB::register_type<FixedMaterial>(); - ObjectTypeDB::register_type<ShaderMaterial>(); - ObjectTypeDB::register_type<RoomBounds>(); - ObjectTypeDB::register_type<MaterialShaderGraph>(); - ObjectTypeDB::register_type<MaterialShader>(); - ObjectTypeDB::add_compatibility_type("Shader","MaterialShader"); - ObjectTypeDB::add_compatibility_type("ParticleSystemMaterial","FixedMaterial"); - ObjectTypeDB::add_compatibility_type("UnshadedMaterial","FixedMaterial"); - ObjectTypeDB::register_type<MultiMesh>(); - ObjectTypeDB::register_type<MeshLibrary>(); + ClassDB::register_class<Mesh>(); + ClassDB::register_virtual_class<Material>(); + ClassDB::register_class<FixedSpatialMaterial>(); + SceneTree::add_idle_callback(FixedSpatialMaterial::flush_changes); + FixedSpatialMaterial::init_shaders(); +// ClassDB::register_type<ShaderMaterial>(); + ClassDB::register_class<RoomBounds>(); +// ClassDB::register_type<MaterialShaderGraph>(); + ClassDB::register_class<SpatialShader>(); + ClassDB::register_class<ParticlesShader>(); + ClassDB::register_class<MultiMesh>(); + ClassDB::register_class<MeshLibrary>(); OS::get_singleton()->yield(); //may take time to init - ObjectTypeDB::register_type<RayShape>(); - ObjectTypeDB::register_type<SphereShape>(); - ObjectTypeDB::register_type<BoxShape>(); - ObjectTypeDB::register_type<CapsuleShape>(); - ObjectTypeDB::register_type<PlaneShape>(); - ObjectTypeDB::register_type<ConvexPolygonShape>(); - ObjectTypeDB::register_type<ConcavePolygonShape>(); + ClassDB::register_class<RayShape>(); + ClassDB::register_class<SphereShape>(); + ClassDB::register_class<BoxShape>(); + ClassDB::register_class<CapsuleShape>(); + ClassDB::register_class<PlaneShape>(); + ClassDB::register_class<ConvexPolygonShape>(); + ClassDB::register_class<ConcavePolygonShape>(); - ObjectTypeDB::register_type<SurfaceTool>(); - ObjectTypeDB::register_type<MeshDataTool>(); - ObjectTypeDB::register_type<BakedLight>(); + ClassDB::register_class<SurfaceTool>(); + ClassDB::register_class<MeshDataTool>(); + //ClassDB::register_type<BakedLight>(); OS::get_singleton()->yield(); //may take time to init #endif - ObjectTypeDB::register_type<World>(); - ObjectTypeDB::register_type<Environment>(); - ObjectTypeDB::register_type<World2D>(); - ObjectTypeDB::register_virtual_type<Texture>(); - ObjectTypeDB::register_type<ImageTexture>(); - ObjectTypeDB::register_type<AtlasTexture>(); - ObjectTypeDB::register_type<LargeTexture>(); - ObjectTypeDB::register_type<CubeMap>(); - ObjectTypeDB::register_type<Animation>(); - ObjectTypeDB::register_virtual_type<Font>(); - ObjectTypeDB::register_type<BitmapFont>(); - - ObjectTypeDB::register_type<DynamicFontData>(); - ObjectTypeDB::register_type<DynamicFont>(); - - ObjectTypeDB::register_type<StyleBoxEmpty>(); - ObjectTypeDB::register_type<StyleBoxTexture>(); - ObjectTypeDB::register_type<StyleBoxFlat>(); - ObjectTypeDB::register_type<StyleBoxImageMask>(); - ObjectTypeDB::register_type<Theme>(); - - ObjectTypeDB::add_compatibility_type("Font","BitmapFont"); - - - ObjectTypeDB::register_type<PolygonPathFinder>(); - ObjectTypeDB::register_type<BitMap>(); - ObjectTypeDB::register_type<ColorRamp>(); + ClassDB::register_class<World>(); + ClassDB::register_class<Environment>(); + ClassDB::register_class<World2D>(); + ClassDB::register_virtual_class<Texture>(); + ClassDB::register_virtual_class<SkyBox>(); + ClassDB::register_class<ImageSkyBox>(); + ClassDB::register_class<ImageTexture>(); + ClassDB::register_class<AtlasTexture>(); + ClassDB::register_class<LargeTexture>(); + ClassDB::register_class<CubeMap>(); + ClassDB::register_class<Animation>(); + ClassDB::register_virtual_class<Font>(); + ClassDB::register_class<BitmapFont>(); + + ClassDB::register_class<DynamicFontData>(); + ClassDB::register_class<DynamicFont>(); + + ClassDB::register_class<StyleBoxEmpty>(); + ClassDB::register_class<StyleBoxTexture>(); + ClassDB::register_class<StyleBoxFlat>(); + ClassDB::register_class<Theme>(); + + ClassDB::register_class<PolygonPathFinder>(); + ClassDB::register_class<BitMap>(); + ClassDB::register_class<ColorRamp>(); OS::get_singleton()->yield(); //may take time to init - ObjectTypeDB::register_type<Sample>(); - ObjectTypeDB::register_type<SampleLibrary>(); - ObjectTypeDB::register_virtual_type<AudioStream>(); - ObjectTypeDB::register_virtual_type<AudioStreamPlayback>(); + ClassDB::register_class<Sample>(); + ClassDB::register_class<SampleLibrary>(); + ClassDB::register_virtual_class<AudioStream>(); + ClassDB::register_virtual_class<AudioStreamPlayback>(); //TODO: Adapt to the new AudioStream API or drop (GH-3307) -// ObjectTypeDB::register_type<AudioStreamGibberish>(); - ObjectTypeDB::register_virtual_type<VideoStream>(); +// ClassDB::register_type<AudioStreamGibberish>(); + ClassDB::register_virtual_class<VideoStream>(); OS::get_singleton()->yield(); //may take time to init - ObjectTypeDB::register_virtual_type<Shape2D>(); - ObjectTypeDB::register_type<LineShape2D>(); - ObjectTypeDB::register_type<SegmentShape2D>(); - ObjectTypeDB::register_type<RayShape2D>(); - ObjectTypeDB::register_type<CircleShape2D>(); - ObjectTypeDB::register_type<RectangleShape2D>(); - ObjectTypeDB::register_type<CapsuleShape2D>(); - ObjectTypeDB::register_type<ConvexPolygonShape2D>(); - ObjectTypeDB::register_type<ConcavePolygonShape2D>(); - ObjectTypeDB::register_type<Curve2D>(); - ObjectTypeDB::register_type<Path2D>(); - ObjectTypeDB::register_type<PathFollow2D>(); - - ObjectTypeDB::register_type<Navigation2D>(); - ObjectTypeDB::register_type<NavigationPolygon>(); - ObjectTypeDB::register_type<NavigationPolygonInstance>(); + ClassDB::register_virtual_class<Shape2D>(); + ClassDB::register_class<LineShape2D>(); + ClassDB::register_class<SegmentShape2D>(); + ClassDB::register_class<RayShape2D>(); + ClassDB::register_class<CircleShape2D>(); + ClassDB::register_class<RectangleShape2D>(); + ClassDB::register_class<CapsuleShape2D>(); + ClassDB::register_class<ConvexPolygonShape2D>(); + ClassDB::register_class<ConcavePolygonShape2D>(); + ClassDB::register_class<Curve2D>(); + ClassDB::register_class<Path2D>(); + ClassDB::register_class<PathFollow2D>(); + + ClassDB::register_class<Navigation2D>(); + ClassDB::register_class<NavigationPolygon>(); + ClassDB::register_class<NavigationPolygonInstance>(); OS::get_singleton()->yield(); //may take time to init - ObjectTypeDB::register_virtual_type<SceneState>(); - ObjectTypeDB::register_type<PackedScene>(); + ClassDB::register_virtual_class<SceneState>(); + ClassDB::register_class<PackedScene>(); - ObjectTypeDB::register_type<SceneTree>(); - ObjectTypeDB::register_virtual_type<SceneTreeTimer>(); //sorry, you can't create it + ClassDB::register_class<SceneTree>(); + ClassDB::register_virtual_class<SceneTreeTimer>(); //sorry, you can't create it OS::get_singleton()->yield(); //may take time to init @@ -647,6 +644,12 @@ void register_scene_types() { resource_loader_text = memnew( ResourceFormatLoaderText ); ResourceLoader::add_resource_format_loader(resource_loader_text,true); + for(int i=0;i<20;i++) { + GLOBAL_DEF("layer_names/2d_render/layer_"+itos(i+1),""); + GLOBAL_DEF("layer_names/2d_physics/layer_"+itos(i+1),""); + GLOBAL_DEF("layer_names/3d_render/layer_"+itos(i+1),""); + GLOBAL_DEF("layer_names/3d_physics/layer_"+itos(i+1),""); + } } void unregister_scene_types() { @@ -657,6 +660,7 @@ void unregister_scene_types() { memdelete( resource_loader_wav ); memdelete( resource_loader_dynamic_font ); + #ifdef TOOLS_ENABLED @@ -664,7 +668,6 @@ void unregister_scene_types() { memdelete( resource_loader_theme ); - memdelete( resource_loader_shader ); if (resource_saver_text) { memdelete(resource_saver_text); @@ -672,5 +675,7 @@ void unregister_scene_types() { if (resource_loader_text) { memdelete(resource_loader_text); } + + FixedSpatialMaterial::finish_shaders(); SceneStringNames::free(); } diff --git a/scene/register_scene_types.h b/scene/register_scene_types.h index 15e1eb2980..090254c5f7 100644 --- a/scene/register_scene_types.h +++ b/scene/register_scene_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index 1d15b6f2bc..1fbb149bf3 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -72,6 +72,8 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) { track_set_path(track,p_value); else if (what=="interp") track_set_interpolation_type(track,InterpolationType(p_value.operator int())); + else if (what=="loop_wrap") + track_set_interpolation_loop_wrap(track,p_value); else if (what=="imported") track_set_imported(track,p_value); else if (what == "keys" || what=="key_values") { @@ -79,14 +81,14 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) { if (track_get_type(track)==TYPE_TRANSFORM) { TransformTrack *tt = static_cast<TransformTrack*>(tracks[track]); - DVector<float> values=p_value; + PoolVector<float> values=p_value; int vcount=values.size(); #if 0 // old compatibility hack if ((vcount%11) == 0) { - DVector<float>::Read r = values.read(); + PoolVector<float>::Read r = values.read(); tt->transforms.resize(vcount/11); @@ -121,7 +123,7 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) { #endif ERR_FAIL_COND_V(vcount%12,false); // shuld be multiple of 11 - DVector<float>::Read r = values.read(); + PoolVector<float>::Read r = values.read(); tt->transforms.resize(vcount/12); @@ -172,7 +174,7 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) { - DVector<float> times=d["times"]; + PoolVector<float> times=d["times"]; Array values=d["values"]; ERR_FAIL_COND_V(times.size()!=values.size(),false); @@ -181,7 +183,7 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) { int valcount=times.size(); - DVector<float>::Read rt = times.read(); + PoolVector<float>::Read rt = times.read(); vt->values.resize(valcount); @@ -193,10 +195,10 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) { if (d.has("transitions")) { - DVector<float> transitions = d["transitions"]; + PoolVector<float> transitions = d["transitions"]; ERR_FAIL_COND_V(transitions.size()!=valcount,false); - DVector<float>::Read rtr = transitions.read(); + PoolVector<float>::Read rtr = transitions.read(); for(int i=0;i<valcount;i++) { @@ -218,7 +220,7 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) { ERR_FAIL_COND_V(!d.has("times"),false); ERR_FAIL_COND_V(!d.has("values"),false); - DVector<float> times=d["times"]; + PoolVector<float> times=d["times"]; Array values=d["values"]; ERR_FAIL_COND_V(times.size()!=values.size(),false); @@ -227,7 +229,7 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) { int valcount=times.size(); - DVector<float>::Read rt = times.read(); + PoolVector<float>::Read rt = times.read(); for(int i=0;i<valcount;i++) { @@ -236,10 +238,10 @@ bool Animation::_set(const StringName& p_name, const Variant& p_value) { if (d.has("transitions")) { - DVector<float> transitions = d["transitions"]; + PoolVector<float> transitions = d["transitions"]; ERR_FAIL_COND_V(transitions.size()!=valcount,false); - DVector<float>::Read rtr = transitions.read(); + PoolVector<float>::Read rtr = transitions.read(); for(int i=0;i<valcount;i++) { @@ -291,17 +293,19 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const { r_ret=track_get_path(track); else if (what=="interp") r_ret = track_get_interpolation_type(track); + else if (what=="loop_wrap") + r_ret = track_get_interpolation_loop_wrap(track); else if (what=="imported") r_ret = track_is_imported(track); else if (what=="keys") { if (track_get_type(track)==TYPE_TRANSFORM) { - DVector<real_t> keys; + PoolVector<real_t> keys; int kk=track_get_key_count(track); keys.resize(kk*12); - DVector<real_t>::Write w = keys.write(); + PoolVector<real_t>::Write w = keys.write(); int idx=0; for(int i=0;i<track_get_key_count(track);i++) { @@ -327,7 +331,7 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const { w[idx++]=scale.z; } - w = DVector<real_t>::Write(); + w = PoolVector<real_t>::Write(); r_ret=keys; return true; @@ -338,8 +342,8 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const { Dictionary d; - DVector<float> key_times; - DVector<float> key_transitions; + PoolVector<float> key_times; + PoolVector<float> key_transitions; Array key_values; int kk=vt->values.size(); @@ -348,8 +352,8 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const { key_transitions.resize(kk); key_values.resize(kk); - DVector<float>::Write wti=key_times.write(); - DVector<float>::Write wtr=key_transitions.write(); + PoolVector<float>::Write wti=key_times.write(); + PoolVector<float>::Write wtr=key_transitions.write(); int idx=0; @@ -363,8 +367,8 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const { idx++; } - wti=DVector<float>::Write(); - wtr=DVector<float>::Write(); + wti=PoolVector<float>::Write(); + wtr=PoolVector<float>::Write(); d["times"]=key_times; d["transitions"]=key_transitions; @@ -382,8 +386,8 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const { Dictionary d; - DVector<float> key_times; - DVector<float> key_transitions; + PoolVector<float> key_times; + PoolVector<float> key_transitions; Array key_values; int kk=track_get_key_count(track); @@ -392,8 +396,8 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const { key_transitions.resize(kk); key_values.resize(kk); - DVector<float>::Write wti=key_times.write(); - DVector<float>::Write wtr=key_transitions.write(); + PoolVector<float>::Write wti=key_times.write(); + PoolVector<float>::Write wtr=key_transitions.write(); int idx=0; for(int i=0;i<track_get_key_count(track);i++) { @@ -404,8 +408,8 @@ bool Animation::_get(const StringName& p_name,Variant &r_ret) const { idx++; } - wti=DVector<float>::Write(); - wtr=DVector<float>::Write(); + wti=PoolVector<float>::Write(); + wtr=PoolVector<float>::Write(); d["times"]=key_times; d["transitions"]=key_transitions; @@ -440,6 +444,7 @@ void Animation::_get_property_list( List<PropertyInfo> *p_list) const { p_list->push_back( PropertyInfo( Variant::STRING, "tracks/"+itos(i)+"/type", PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR) ); p_list->push_back( PropertyInfo( Variant::NODE_PATH, "tracks/"+itos(i)+"/path", PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR) ); p_list->push_back( PropertyInfo( Variant::INT, "tracks/"+itos(i)+"/interp", PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR) ); + p_list->push_back( PropertyInfo( Variant::BOOL, "tracks/"+itos(i)+"/loop_wrap", PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR) ); p_list->push_back( PropertyInfo( Variant::BOOL, "tracks/"+itos(i)+"/imported", PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR) ); p_list->push_back( PropertyInfo( Variant::ARRAY, "tracks/"+itos(i)+"/keys", PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR) ); } @@ -559,6 +564,19 @@ Animation::InterpolationType Animation::track_get_interpolation_type(int p_track return tracks[p_track]->interpolation; } +void Animation::track_set_interpolation_loop_wrap(int p_track,bool p_enable) { + ERR_FAIL_INDEX(p_track, tracks.size()); + tracks[p_track]->loop_wrap=p_enable; + emit_changed(); + +} + +bool Animation::track_get_interpolation_loop_wrap(int p_track) const{ + + ERR_FAIL_INDEX_V(p_track, tracks.size(),INTERPOLATION_NEAREST); + return tracks[p_track]->loop_wrap; + +} // transform /* @@ -1185,14 +1203,14 @@ Variant Animation::_cubic_interpolate( const Variant& p_pre_a,const Variant& p_a return a.cubic_slerp(b,pa,pb,p_c); } break; - case Variant::_AABB: { + case Variant::RECT3: { - AABB a=p_a; - AABB b=p_b; - AABB pa=p_pre_a; - AABB pb=p_post_b; + Rect3 a=p_a; + Rect3 b=p_b; + Rect3 pa=p_pre_a; + Rect3 pb=p_post_b; - return AABB( + return Rect3( a.pos.cubic_interpolate(b.pos,pa.pos,pb.pos,p_c), a.size.cubic_interpolate(b.size,pa.size,pb.size,p_c) ); @@ -1211,7 +1229,7 @@ float Animation::_cubic_interpolate( const float& p_pre_a,const float& p_a, cons } template<class T> -T Animation::_interpolate( const Vector< TKey<T> >& p_keys, float p_time, InterpolationType p_interp, bool *p_ok) const { +T Animation::_interpolate( const Vector< TKey<T> >& p_keys, float p_time, InterpolationType p_interp, bool p_loop_wrap,bool *p_ok) const { int len=_find( p_keys, length )+1; // try to find last key (there may be more past the end) @@ -1239,7 +1257,7 @@ T Animation::_interpolate( const Vector< TKey<T> >& p_keys, float p_time, Inter float c=0; // prepare for all cases of interpolation - if (loop) { + if (loop && p_loop_wrap) { // loop if (idx>=0) { @@ -1363,7 +1381,7 @@ Error Animation::transform_track_interpolate(int p_track, float p_time, Vector3 bool ok; - TransformKey tk = _interpolate( tt->transforms, p_time, tt->interpolation, &ok ); + TransformKey tk = _interpolate( tt->transforms, p_time, tt->interpolation, tt->loop_wrap, &ok ); if (!ok) // ?? return ERR_UNAVAILABLE; @@ -1391,7 +1409,7 @@ Variant Animation::value_track_interpolate(int p_track, float p_time) const { bool ok; - Variant res = _interpolate( vt->values, p_time, vt->update_mode==UPDATE_CONTINUOUS?vt->interpolation:INTERPOLATION_NEAREST, &ok ); + Variant res = _interpolate( vt->values, p_time, vt->update_mode==UPDATE_CONTINUOUS?vt->interpolation:INTERPOLATION_NEAREST,vt->loop_wrap, &ok ); if (ok) { @@ -1680,59 +1698,61 @@ float Animation::get_step() const{ void Animation::_bind_methods() { - ObjectTypeDB::bind_method(_MD("add_track","type","at_pos"),&Animation::add_track,DEFVAL(-1)); - ObjectTypeDB::bind_method(_MD("remove_track","idx"),&Animation::remove_track); - ObjectTypeDB::bind_method(_MD("get_track_count"),&Animation::get_track_count); - ObjectTypeDB::bind_method(_MD("track_get_type","idx"),&Animation::track_get_type); - ObjectTypeDB::bind_method(_MD("track_get_path","idx"),&Animation::track_get_path); - ObjectTypeDB::bind_method(_MD("track_set_path","idx","path"),&Animation::track_set_path); - ObjectTypeDB::bind_method(_MD("find_track","path"),&Animation::find_track); + ClassDB::bind_method(_MD("add_track","type","at_pos"),&Animation::add_track,DEFVAL(-1)); + ClassDB::bind_method(_MD("remove_track","idx"),&Animation::remove_track); + ClassDB::bind_method(_MD("get_track_count"),&Animation::get_track_count); + ClassDB::bind_method(_MD("track_get_type","idx"),&Animation::track_get_type); + ClassDB::bind_method(_MD("track_get_path","idx"),&Animation::track_get_path); + ClassDB::bind_method(_MD("track_set_path","idx","path"),&Animation::track_set_path); + ClassDB::bind_method(_MD("find_track","path"),&Animation::find_track); - ObjectTypeDB::bind_method(_MD("track_move_up","idx"),&Animation::track_move_up); - ObjectTypeDB::bind_method(_MD("track_move_down","idx"),&Animation::track_move_down); + ClassDB::bind_method(_MD("track_move_up","idx"),&Animation::track_move_up); + ClassDB::bind_method(_MD("track_move_down","idx"),&Animation::track_move_down); - ObjectTypeDB::bind_method(_MD("track_set_imported","idx","imported"),&Animation::track_set_imported); - ObjectTypeDB::bind_method(_MD("track_is_imported","idx"),&Animation::track_is_imported); + ClassDB::bind_method(_MD("track_set_imported","idx","imported"),&Animation::track_set_imported); + ClassDB::bind_method(_MD("track_is_imported","idx"),&Animation::track_is_imported); - ObjectTypeDB::bind_method(_MD("transform_track_insert_key","idx","time","loc","rot","scale"),&Animation::transform_track_insert_key); - ObjectTypeDB::bind_method(_MD("track_insert_key","idx","time","key","transition"),&Animation::track_insert_key,DEFVAL(1)); - ObjectTypeDB::bind_method(_MD("track_remove_key","idx","key_idx"),&Animation::track_remove_key); - ObjectTypeDB::bind_method(_MD("track_remove_key_at_pos","idx","pos"),&Animation::track_remove_key_at_pos); - ObjectTypeDB::bind_method(_MD("track_set_key_value","idx","key","value"),&Animation::track_set_key_value); - ObjectTypeDB::bind_method(_MD("track_set_key_transition","idx","key_idx","transition"),&Animation::track_set_key_transition); - ObjectTypeDB::bind_method(_MD("track_get_key_transition","idx","key_idx"),&Animation::track_get_key_transition); + ClassDB::bind_method(_MD("transform_track_insert_key","idx","time","loc","rot","scale"),&Animation::transform_track_insert_key); + ClassDB::bind_method(_MD("track_insert_key","idx","time","key","transition"),&Animation::track_insert_key,DEFVAL(1)); + ClassDB::bind_method(_MD("track_remove_key","idx","key_idx"),&Animation::track_remove_key); + ClassDB::bind_method(_MD("track_remove_key_at_pos","idx","pos"),&Animation::track_remove_key_at_pos); + ClassDB::bind_method(_MD("track_set_key_value","idx","key","value"),&Animation::track_set_key_value); + ClassDB::bind_method(_MD("track_set_key_transition","idx","key_idx","transition"),&Animation::track_set_key_transition); + ClassDB::bind_method(_MD("track_get_key_transition","idx","key_idx"),&Animation::track_get_key_transition); - ObjectTypeDB::bind_method(_MD("track_get_key_count","idx"),&Animation::track_get_key_count); - ObjectTypeDB::bind_method(_MD("track_get_key_value","idx","key_idx"),&Animation::track_get_key_value); - ObjectTypeDB::bind_method(_MD("track_get_key_time","idx","key_idx"),&Animation::track_get_key_time); - ObjectTypeDB::bind_method(_MD("track_find_key","idx","time","exact"),&Animation::track_find_key,DEFVAL(false)); + ClassDB::bind_method(_MD("track_get_key_count","idx"),&Animation::track_get_key_count); + ClassDB::bind_method(_MD("track_get_key_value","idx","key_idx"),&Animation::track_get_key_value); + ClassDB::bind_method(_MD("track_get_key_time","idx","key_idx"),&Animation::track_get_key_time); + ClassDB::bind_method(_MD("track_find_key","idx","time","exact"),&Animation::track_find_key,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("track_set_interpolation_type","idx","interpolation"),&Animation::track_set_interpolation_type); - ObjectTypeDB::bind_method(_MD("track_get_interpolation_type","idx"),&Animation::track_get_interpolation_type); + ClassDB::bind_method(_MD("track_set_interpolation_type","idx","interpolation"),&Animation::track_set_interpolation_type); + ClassDB::bind_method(_MD("track_get_interpolation_type","idx"),&Animation::track_get_interpolation_type); + ClassDB::bind_method(_MD("track_set_interpolation_loop_wrap","idx","interpolation"),&Animation::track_set_interpolation_loop_wrap); + ClassDB::bind_method(_MD("track_get_interpolation_loop_wrap","idx"),&Animation::track_get_interpolation_loop_wrap); - ObjectTypeDB::bind_method(_MD("transform_track_interpolate","idx","time_sec"),&Animation::_transform_track_interpolate); - ObjectTypeDB::bind_method(_MD("value_track_set_update_mode","idx","mode"),&Animation::value_track_set_update_mode); - ObjectTypeDB::bind_method(_MD("value_track_get_update_mode","idx"),&Animation::value_track_get_update_mode); + ClassDB::bind_method(_MD("transform_track_interpolate","idx","time_sec"),&Animation::_transform_track_interpolate); + ClassDB::bind_method(_MD("value_track_set_update_mode","idx","mode"),&Animation::value_track_set_update_mode); + ClassDB::bind_method(_MD("value_track_get_update_mode","idx"),&Animation::value_track_get_update_mode); - ObjectTypeDB::bind_method(_MD("value_track_get_key_indices","idx","time_sec","delta"),&Animation::_value_track_get_key_indices); + ClassDB::bind_method(_MD("value_track_get_key_indices","idx","time_sec","delta"),&Animation::_value_track_get_key_indices); - ObjectTypeDB::bind_method(_MD("method_track_get_key_indices","idx","time_sec","delta"),&Animation::_method_track_get_key_indices); - ObjectTypeDB::bind_method(_MD("method_track_get_name","idx","key_idx"),&Animation::method_track_get_name); - ObjectTypeDB::bind_method(_MD("method_track_get_params","idx","key_idx"),&Animation::method_track_get_params); + ClassDB::bind_method(_MD("method_track_get_key_indices","idx","time_sec","delta"),&Animation::_method_track_get_key_indices); + ClassDB::bind_method(_MD("method_track_get_name","idx","key_idx"),&Animation::method_track_get_name); + ClassDB::bind_method(_MD("method_track_get_params","idx","key_idx"),&Animation::method_track_get_params); - ObjectTypeDB::bind_method(_MD("set_length","time_sec"),&Animation::set_length); - ObjectTypeDB::bind_method(_MD("get_length"),&Animation::get_length); + ClassDB::bind_method(_MD("set_length","time_sec"),&Animation::set_length); + ClassDB::bind_method(_MD("get_length"),&Animation::get_length); - ObjectTypeDB::bind_method(_MD("set_loop","enabled"),&Animation::set_loop); - ObjectTypeDB::bind_method(_MD("has_loop"),&Animation::has_loop); + ClassDB::bind_method(_MD("set_loop","enabled"),&Animation::set_loop); + ClassDB::bind_method(_MD("has_loop"),&Animation::has_loop); - ObjectTypeDB::bind_method(_MD("set_step","size_sec"),&Animation::set_step); - ObjectTypeDB::bind_method(_MD("get_step"),&Animation::get_step); + ClassDB::bind_method(_MD("set_step","size_sec"),&Animation::set_step); + ClassDB::bind_method(_MD("get_step"),&Animation::get_step); - ObjectTypeDB::bind_method(_MD("clear"),&Animation::clear); + ClassDB::bind_method(_MD("clear"),&Animation::clear); BIND_CONSTANT( TYPE_VALUE ); BIND_CONSTANT( TYPE_TRANSFORM ); diff --git a/scene/resources/animation.h b/scene/resources/animation.h index 6c8d7252aa..b81ac4f1bf 100644 --- a/scene/resources/animation.h +++ b/scene/resources/animation.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,16 +35,11 @@ */ class Animation : public Resource { - OBJ_TYPE( Animation, Resource ); + GDCLASS( Animation, Resource ); RES_BASE_EXTENSION("anm"); public: - enum LoopMode { - LOOP_NONE, - LOOP_ENABLED, - LOOP_WRAP - }; enum TrackType { TYPE_VALUE, ///< Set a value in a property, can be interpolated. @@ -71,9 +66,10 @@ private: TrackType type; InterpolationType interpolation; + bool loop_wrap; NodePath path; // path to something bool imported; - Track() { interpolation=INTERPOLATION_LINEAR; imported=false;} + Track() { interpolation=INTERPOLATION_LINEAR; imported=false; loop_wrap=true;} virtual ~Track() {} }; @@ -164,7 +160,7 @@ private: _FORCE_INLINE_ float _cubic_interpolate( const float& p_pre_a,const float& p_a, const float& p_b, const float& p_post_b, float p_c) const; template<class T> - _FORCE_INLINE_ T _interpolate( const Vector< TKey<T> >& p_keys, float p_time, InterpolationType p_interp,bool *p_ok) const; + _FORCE_INLINE_ T _interpolate( const Vector< TKey<T> >& p_keys, float p_time, InterpolationType p_interp,bool p_loop_wrap,bool *p_ok) const; _FORCE_INLINE_ void _value_track_get_key_indices_in_range(const ValueTrack * vt, float from_time, float to_time,List<int> *p_indices) const; _FORCE_INLINE_ void _method_track_get_key_indices_in_range(const MethodTrack * mt, float from_time, float to_time,List<int> *p_indices) const; @@ -188,11 +184,11 @@ private: return ret; } - DVector<int> _value_track_get_key_indices(int p_track, float p_time, float p_delta) const { + PoolVector<int> _value_track_get_key_indices(int p_track, float p_time, float p_delta) const { List<int> idxs; value_track_get_key_indices(p_track,p_time,p_delta,&idxs); - DVector<int> idxr; + PoolVector<int> idxr; for (List<int>::Element *E=idxs.front();E;E=E->next()) { @@ -200,11 +196,11 @@ private: } return idxr; } - DVector<int> _method_track_get_key_indices(int p_track, float p_time, float p_delta) const { + PoolVector<int> _method_track_get_key_indices(int p_track, float p_time, float p_delta) const { List<int> idxs; method_track_get_key_indices(p_track,p_time,p_delta,&idxs); - DVector<int> idxr; + PoolVector<int> idxr; for (List<int>::Element *E=idxs.front();E;E=E->next()) { @@ -260,6 +256,8 @@ public: void track_set_interpolation_type(int p_track,InterpolationType p_interp); InterpolationType track_get_interpolation_type(int p_track) const; + void track_set_interpolation_loop_wrap(int p_track,bool p_enable); + bool track_get_interpolation_loop_wrap(int p_track) const; Error transform_track_interpolate(int p_track, float p_time, Vector3 * r_loc, Quat *r_rot, Vector3 *r_scale) const; diff --git a/scene/resources/audio_stream.cpp b/scene/resources/audio_stream.cpp index 1dd702abd2..7c269de007 100644 --- a/scene/resources/audio_stream.cpp +++ b/scene/resources/audio_stream.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,22 +33,22 @@ void AudioStreamPlayback::_bind_methods() { - ObjectTypeDB::bind_method(_MD("play","from_pos_sec"),&AudioStreamPlayback::play,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("stop"),&AudioStreamPlayback::stop); - ObjectTypeDB::bind_method(_MD("is_playing"),&AudioStreamPlayback::is_playing); + ClassDB::bind_method(_MD("play","from_pos_sec"),&AudioStreamPlayback::play,DEFVAL(0)); + ClassDB::bind_method(_MD("stop"),&AudioStreamPlayback::stop); + ClassDB::bind_method(_MD("is_playing"),&AudioStreamPlayback::is_playing); - ObjectTypeDB::bind_method(_MD("set_loop","enabled"),&AudioStreamPlayback::set_loop); - ObjectTypeDB::bind_method(_MD("has_loop"),&AudioStreamPlayback::has_loop); + ClassDB::bind_method(_MD("set_loop","enabled"),&AudioStreamPlayback::set_loop); + ClassDB::bind_method(_MD("has_loop"),&AudioStreamPlayback::has_loop); - ObjectTypeDB::bind_method(_MD("get_loop_count"),&AudioStreamPlayback::get_loop_count); + ClassDB::bind_method(_MD("get_loop_count"),&AudioStreamPlayback::get_loop_count); - ObjectTypeDB::bind_method(_MD("seek_pos","pos"),&AudioStreamPlayback::seek_pos); - ObjectTypeDB::bind_method(_MD("get_pos"),&AudioStreamPlayback::get_pos); + ClassDB::bind_method(_MD("seek_pos","pos"),&AudioStreamPlayback::seek_pos); + ClassDB::bind_method(_MD("get_pos"),&AudioStreamPlayback::get_pos); - ObjectTypeDB::bind_method(_MD("get_length"),&AudioStreamPlayback::get_length); - ObjectTypeDB::bind_method(_MD("get_channels"),&AudioStreamPlayback::get_channels); - ObjectTypeDB::bind_method(_MD("get_mix_rate"),&AudioStreamPlayback::get_mix_rate); - ObjectTypeDB::bind_method(_MD("get_minimum_buffer_size"),&AudioStreamPlayback::get_minimum_buffer_size); + ClassDB::bind_method(_MD("get_length"),&AudioStreamPlayback::get_length); + ClassDB::bind_method(_MD("get_channels"),&AudioStreamPlayback::get_channels); + ClassDB::bind_method(_MD("get_mix_rate"),&AudioStreamPlayback::get_mix_rate); + ClassDB::bind_method(_MD("get_minimum_buffer_size"),&AudioStreamPlayback::get_minimum_buffer_size); } diff --git a/scene/resources/audio_stream.h b/scene/resources/audio_stream.h index a4a2ad7599..b79707cd32 100644 --- a/scene/resources/audio_stream.h +++ b/scene/resources/audio_stream.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class AudioStreamPlayback : public Reference { - OBJ_TYPE( AudioStreamPlayback, Reference ); + GDCLASS( AudioStreamPlayback, Reference ); protected: static void _bind_methods(); public: @@ -67,7 +67,7 @@ public: class AudioStream : public Resource { - OBJ_TYPE( AudioStream, Resource ); + GDCLASS( AudioStream, Resource ); OBJ_SAVE_TYPE( AudioStream ); //children are all saved as AudioStream, so they can be exchanged protected: diff --git a/scene/resources/audio_stream_resampled.cpp b/scene/resources/audio_stream_resampled.cpp index 3e10048f57..7b49ec0849 100644 --- a/scene/resources/audio_stream_resampled.cpp +++ b/scene/resources/audio_stream_resampled.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/audio_stream_resampled.h b/scene/resources/audio_stream_resampled.h index 64f9d17d88..761643b027 100644 --- a/scene/resources/audio_stream_resampled.h +++ b/scene/resources/audio_stream_resampled.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ #if 0 class AudioStreamResampled : public AudioStream { - OBJ_TYPE(AudioStreamResampled,AudioStream); + GDCLASS(AudioStreamResampled,AudioStream); uint32_t rb_bits; uint32_t rb_len; diff --git a/scene/resources/baked_light.cpp b/scene/resources/baked_light.cpp index e4510be874..616c12e8d7 100644 --- a/scene/resources/baked_light.cpp +++ b/scene/resources/baked_light.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -29,574 +29,3 @@ #include "baked_light.h" #include "servers/visual_server.h" -void BakedLight::set_mode(Mode p_mode) { - - mode=p_mode; - VS::get_singleton()->baked_light_set_mode(baked_light,(VS::BakedLightMode(p_mode))); - -} - -BakedLight::Mode BakedLight::get_mode() const{ - - return mode; -} - -void BakedLight::set_octree(const DVector<uint8_t>& p_octree) { - - VS::get_singleton()->baked_light_set_octree(baked_light,p_octree); -} - -DVector<uint8_t> BakedLight::get_octree() const { - - return VS::get_singleton()->baked_light_get_octree(baked_light); -} - -void BakedLight::set_light(const DVector<uint8_t>& p_light) { - - VS::get_singleton()->baked_light_set_light(baked_light,p_light); -} - -DVector<uint8_t> BakedLight::get_light() const { - - return VS::get_singleton()->baked_light_get_light(baked_light); -} - - -void BakedLight::set_sampler_octree(const DVector<int>& p_sampler_octree) { - - VS::get_singleton()->baked_light_set_sampler_octree(baked_light,p_sampler_octree); -} - -DVector<int> BakedLight::get_sampler_octree() const { - - return VS::get_singleton()->baked_light_get_sampler_octree(baked_light); -} - - - - - -void BakedLight::add_lightmap(const Ref<Texture> &p_texture,Size2 p_gen_size) { - - LightMap lm; - lm.texture=p_texture; - lm.gen_size=p_gen_size; - lightmaps.push_back(lm); - _update_lightmaps(); - _change_notify(); -} - -void BakedLight::set_lightmap_gen_size(int p_idx,const Size2& p_size){ - - ERR_FAIL_INDEX(p_idx,lightmaps.size()); - lightmaps[p_idx].gen_size=p_size; - _update_lightmaps(); -} -Size2 BakedLight::get_lightmap_gen_size(int p_idx) const{ - - ERR_FAIL_INDEX_V(p_idx,lightmaps.size(),Size2()); - return lightmaps[p_idx].gen_size; - -} -void BakedLight::set_lightmap_texture(int p_idx,const Ref<Texture> &p_texture){ - - ERR_FAIL_INDEX(p_idx,lightmaps.size()); - lightmaps[p_idx].texture=p_texture; - _update_lightmaps(); - -} -Ref<Texture> BakedLight::get_lightmap_texture(int p_idx) const{ - - ERR_FAIL_INDEX_V(p_idx,lightmaps.size(),Ref<Texture>()); - return lightmaps[p_idx].texture; - -} -void BakedLight::erase_lightmap(int p_idx){ - - ERR_FAIL_INDEX(p_idx,lightmaps.size()); - lightmaps.remove(p_idx); - _update_lightmaps(); - _change_notify(); - -} -int BakedLight::get_lightmaps_count() const{ - - return lightmaps.size(); -} -void BakedLight::clear_lightmaps(){ - - lightmaps.clear(); - _update_lightmaps(); - _change_notify(); -} - - - -void BakedLight::_update_lightmaps() { - - VS::get_singleton()->baked_light_clear_lightmaps(baked_light); - for(int i=0;i<lightmaps.size();i++) { - - RID tid; - if (lightmaps[i].texture.is_valid()) - tid=lightmaps[i].texture->get_rid(); - VS::get_singleton()->baked_light_add_lightmap(baked_light,tid,i); - } -} - - - -RID BakedLight::get_rid() const { - - return baked_light; -} - -Array BakedLight::_get_lightmap_data() const { - - Array ret; - ret.resize(lightmaps.size()*2); - - int idx=0; - for(int i=0;i<lightmaps.size();i++) { - - ret[idx++]=Size2(lightmaps[i].gen_size); - ret[idx++]=lightmaps[i].texture; - } - return ret; - -} - -void BakedLight::_set_lightmap_data(Array p_array){ - - lightmaps.clear(); - for(int i=0;i<p_array.size();i+=2) { - - Size2 size = p_array[i]; - Ref<Texture> tex = p_array[i+1]; -// ERR_CONTINUE(tex.is_null()); - LightMap lm; - lm.gen_size=size; - lm.texture=tex; - lightmaps.push_back(lm); - } - _update_lightmaps(); -} - - -void BakedLight::set_cell_subdivision(int p_subdiv) { - - cell_subdiv=p_subdiv; -} - -int BakedLight::get_cell_subdivision() const{ - - return cell_subdiv; -} - -void BakedLight::set_initial_lattice_subdiv(int p_size){ - - lattice_subdiv=p_size; -} -int BakedLight::get_initial_lattice_subdiv() const{ - - return lattice_subdiv; -} - -void BakedLight::set_plot_size(float p_size){ - - plot_size=p_size; -} -float BakedLight::get_plot_size() const{ - - return plot_size; -} - -void BakedLight::set_bounces(int p_size){ - - bounces=p_size; -} -int BakedLight::get_bounces() const{ - - return bounces; -} - -void BakedLight::set_cell_extra_margin(float p_margin) { - cell_extra_margin=p_margin; -} - -float BakedLight::get_cell_extra_margin() const { - - return cell_extra_margin; -} - -void BakedLight::set_edge_damp(float p_margin) { - edge_damp=p_margin; -} - -float BakedLight::get_edge_damp() const { - - return edge_damp; -} - - -void BakedLight::set_normal_damp(float p_margin) { - normal_damp=p_margin; -} - -float BakedLight::get_normal_damp() const { - - return normal_damp; -} - -void BakedLight::set_tint(float p_margin) { - tint=p_margin; -} - -float BakedLight::get_tint() const { - - return tint; -} - -void BakedLight::set_saturation(float p_margin) { - saturation=p_margin; -} - -float BakedLight::get_saturation() const { - - return saturation; -} - -void BakedLight::set_ao_radius(float p_ao_radius) { - ao_radius=p_ao_radius; -} - -float BakedLight::get_ao_radius() const { - return ao_radius; -} - -void BakedLight::set_ao_strength(float p_ao_strength) { - - ao_strength=p_ao_strength; -} - -float BakedLight::get_ao_strength() const { - - return ao_strength; -} - -void BakedLight::set_realtime_color_enabled(const bool p_realtime_color_enabled) { - - VS::get_singleton()->baked_light_set_realtime_color_enabled(baked_light, p_realtime_color_enabled); -} - -bool BakedLight::get_realtime_color_enabled() const { - - return VS::get_singleton()->baked_light_get_realtime_color_enabled(baked_light); -} - - -void BakedLight::set_realtime_color(const Color &p_realtime_color) { - - VS::get_singleton()->baked_light_set_realtime_color(baked_light, p_realtime_color); -} - -Color BakedLight::get_realtime_color() const { - - return VS::get_singleton()->baked_light_get_realtime_color(baked_light); -} - -void BakedLight::set_realtime_energy(const float p_realtime_energy) { - - VS::get_singleton()->baked_light_set_realtime_energy(baked_light, p_realtime_energy); -} - -float BakedLight::get_realtime_energy() const { - - return VS::get_singleton()->baked_light_get_realtime_energy(baked_light); -} - - - -void BakedLight::set_energy_multiplier(float p_multiplier){ - - energy_multiply=p_multiplier; -} -float BakedLight::get_energy_multiplier() const{ - - return energy_multiply; -} - -void BakedLight::set_gamma_adjust(float p_adjust){ - - gamma_adjust=p_adjust; -} -float BakedLight::get_gamma_adjust() const{ - - return gamma_adjust; -} - -void BakedLight::set_bake_flag(BakeFlags p_flags,bool p_enable){ - - flags[p_flags]=p_enable; -} -bool BakedLight::get_bake_flag(BakeFlags p_flags) const{ - - return flags[p_flags]; -} - -void BakedLight::set_format(Format p_format) { - - format=p_format; - VS::get_singleton()->baked_light_set_lightmap_multiplier(baked_light,format==FORMAT_HDR8?8.0:1.0); -} - -BakedLight::Format BakedLight::get_format() const{ - - return format; -} - -void BakedLight::set_transfer_lightmaps_only_to_uv2(bool p_enable) { - - transfer_only_uv2=p_enable; -} - -bool BakedLight::get_transfer_lightmaps_only_to_uv2() const{ - - return transfer_only_uv2; -} - - -bool BakedLight::_set(const StringName& p_name, const Variant& p_value) { - - String n = p_name; - if (!n.begins_with("lightmap")) - return false; - int idx = n.get_slicec('/',1).to_int(); - ERR_FAIL_COND_V(idx<0,false); - ERR_FAIL_COND_V(idx>lightmaps.size(),false); - - String what = n.get_slicec('/',2); - Ref<Texture> tex; - Size2 gens; - - if (what=="texture") - tex=p_value; - else if (what=="gen_size") - gens=p_value; - - if (idx==lightmaps.size()) { - if (tex.is_valid() || gens!=Size2()) - add_lightmap(tex,gens); - } else { - if (tex.is_valid()) - set_lightmap_texture(idx,tex); - else if (gens!=Size2()) - set_lightmap_gen_size(idx,gens); - } - - - return true; -} - -bool BakedLight::_get(const StringName& p_name,Variant &r_ret) const{ - - String n = p_name; - if (!n.begins_with("lightmap")) - return false; - int idx = n.get_slicec('/',1).to_int(); - ERR_FAIL_COND_V(idx<0,false); - ERR_FAIL_COND_V(idx>lightmaps.size(),false); - - String what = n.get_slicec('/',2); - - if (what=="texture") { - if (idx==lightmaps.size()) - r_ret=Ref<Texture>(); - else - r_ret=lightmaps[idx].texture; - - } else if (what=="gen_size") { - - if (idx==lightmaps.size()) - r_ret=Size2(); - else - r_ret=Size2(lightmaps[idx].gen_size); - } else - return false; - - return true; - - -} -void BakedLight::_get_property_list( List<PropertyInfo> *p_list) const{ - - for(int i=0;i<=lightmaps.size();i++) { - - p_list->push_back(PropertyInfo(Variant::VECTOR2,"lightmaps/"+itos(i)+"/gen_size",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_EDITOR)); - p_list->push_back(PropertyInfo(Variant::OBJECT,"lightmaps/"+itos(i)+"/texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture",PROPERTY_USAGE_EDITOR)); - } -} - - -void BakedLight::_bind_methods(){ - - - ObjectTypeDB::bind_method(_MD("set_mode","mode"),&BakedLight::set_mode); - ObjectTypeDB::bind_method(_MD("get_mode"),&BakedLight::get_mode); - - ObjectTypeDB::bind_method(_MD("set_octree","octree"),&BakedLight::set_octree); - ObjectTypeDB::bind_method(_MD("get_octree"),&BakedLight::get_octree); - - ObjectTypeDB::bind_method(_MD("set_light","light"),&BakedLight::set_light); - ObjectTypeDB::bind_method(_MD("get_light"),&BakedLight::get_light); - - ObjectTypeDB::bind_method(_MD("set_sampler_octree","sampler_octree"),&BakedLight::set_sampler_octree); - ObjectTypeDB::bind_method(_MD("get_sampler_octree"),&BakedLight::get_sampler_octree); - - - ObjectTypeDB::bind_method(_MD("add_lightmap","texture:Texture","gen_size"),&BakedLight::add_lightmap); - ObjectTypeDB::bind_method(_MD("erase_lightmap","id"),&BakedLight::erase_lightmap); - ObjectTypeDB::bind_method(_MD("clear_lightmaps"),&BakedLight::clear_lightmaps); - - ObjectTypeDB::bind_method(_MD("_set_lightmap_data","lightmap_data"),&BakedLight::_set_lightmap_data); - ObjectTypeDB::bind_method(_MD("_get_lightmap_data"),&BakedLight::_get_lightmap_data); - - ObjectTypeDB::bind_method(_MD("set_cell_subdivision","cell_subdivision"),&BakedLight::set_cell_subdivision); - ObjectTypeDB::bind_method(_MD("get_cell_subdivision"),&BakedLight::get_cell_subdivision); - - ObjectTypeDB::bind_method(_MD("set_initial_lattice_subdiv","cell_subdivision"),&BakedLight::set_initial_lattice_subdiv); - ObjectTypeDB::bind_method(_MD("get_initial_lattice_subdiv","cell_subdivision"),&BakedLight::get_initial_lattice_subdiv); - - ObjectTypeDB::bind_method(_MD("set_plot_size","plot_size"),&BakedLight::set_plot_size); - ObjectTypeDB::bind_method(_MD("get_plot_size"),&BakedLight::get_plot_size); - - ObjectTypeDB::bind_method(_MD("set_bounces","bounces"),&BakedLight::set_bounces); - ObjectTypeDB::bind_method(_MD("get_bounces"),&BakedLight::get_bounces); - - ObjectTypeDB::bind_method(_MD("set_cell_extra_margin","cell_extra_margin"),&BakedLight::set_cell_extra_margin); - ObjectTypeDB::bind_method(_MD("get_cell_extra_margin"),&BakedLight::get_cell_extra_margin); - - ObjectTypeDB::bind_method(_MD("set_edge_damp","edge_damp"),&BakedLight::set_edge_damp); - ObjectTypeDB::bind_method(_MD("get_edge_damp"),&BakedLight::get_edge_damp); - - ObjectTypeDB::bind_method(_MD("set_normal_damp","normal_damp"),&BakedLight::set_normal_damp); - ObjectTypeDB::bind_method(_MD("get_normal_damp"),&BakedLight::get_normal_damp); - - ObjectTypeDB::bind_method(_MD("set_tint","tint"),&BakedLight::set_tint); - ObjectTypeDB::bind_method(_MD("get_tint"),&BakedLight::get_tint); - - ObjectTypeDB::bind_method(_MD("set_saturation","saturation"),&BakedLight::set_saturation); - ObjectTypeDB::bind_method(_MD("get_saturation"),&BakedLight::get_saturation); - - ObjectTypeDB::bind_method(_MD("set_ao_radius","ao_radius"),&BakedLight::set_ao_radius); - ObjectTypeDB::bind_method(_MD("get_ao_radius"),&BakedLight::get_ao_radius); - - ObjectTypeDB::bind_method(_MD("set_ao_strength","ao_strength"),&BakedLight::set_ao_strength); - ObjectTypeDB::bind_method(_MD("get_ao_strength"),&BakedLight::get_ao_strength); - - ObjectTypeDB::bind_method(_MD("set_realtime_color_enabled", "enabled"), &BakedLight::set_realtime_color_enabled); - ObjectTypeDB::bind_method(_MD("get_realtime_color_enabled"), &BakedLight::get_realtime_color_enabled); - - ObjectTypeDB::bind_method(_MD("set_realtime_color", "tint"), &BakedLight::set_realtime_color); - ObjectTypeDB::bind_method(_MD("get_realtime_color"), &BakedLight::get_realtime_color); - - ObjectTypeDB::bind_method(_MD("set_realtime_energy", "energy"), &BakedLight::set_realtime_energy); - ObjectTypeDB::bind_method(_MD("get_realtime_energy"), &BakedLight::get_realtime_energy); - - ObjectTypeDB::bind_method(_MD("set_format","format"),&BakedLight::set_format); - ObjectTypeDB::bind_method(_MD("get_format"),&BakedLight::get_format); - - ObjectTypeDB::bind_method(_MD("set_transfer_lightmaps_only_to_uv2","enable"),&BakedLight::set_transfer_lightmaps_only_to_uv2); - ObjectTypeDB::bind_method(_MD("get_transfer_lightmaps_only_to_uv2"),&BakedLight::get_transfer_lightmaps_only_to_uv2); - - - - - ObjectTypeDB::bind_method(_MD("set_energy_multiplier","energy_multiplier"),&BakedLight::set_energy_multiplier); - ObjectTypeDB::bind_method(_MD("get_energy_multiplier"),&BakedLight::get_energy_multiplier); - - ObjectTypeDB::bind_method(_MD("set_gamma_adjust","gamma_adjust"),&BakedLight::set_gamma_adjust); - ObjectTypeDB::bind_method(_MD("get_gamma_adjust"),&BakedLight::get_gamma_adjust); - - ObjectTypeDB::bind_method(_MD("set_bake_flag","flag","enabled"),&BakedLight::set_bake_flag); - ObjectTypeDB::bind_method(_MD("get_bake_flag","flag"),&BakedLight::get_bake_flag); - - ADD_PROPERTY( PropertyInfo(Variant::INT,"mode/mode",PROPERTY_HINT_ENUM,"Octree,Lightmaps"),_SCS("set_mode"),_SCS("get_mode")); - - ADD_PROPERTY( PropertyInfo(Variant::INT,"baking/format",PROPERTY_HINT_ENUM,"RGB,HDR8,HDR16"),_SCS("set_format"),_SCS("get_format")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"baking/cell_subdiv",PROPERTY_HINT_RANGE,"4,14,1"),_SCS("set_cell_subdivision"),_SCS("get_cell_subdivision")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"baking/lattice_subdiv",PROPERTY_HINT_RANGE,"1,5,1"),_SCS("set_initial_lattice_subdiv"),_SCS("get_initial_lattice_subdiv")); - ADD_PROPERTY( PropertyInfo(Variant::INT,"baking/light_bounces",PROPERTY_HINT_RANGE,"0,3,1"),_SCS("set_bounces"),_SCS("get_bounces")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"baking/plot_size",PROPERTY_HINT_RANGE,"1.0,16.0,0.01"),_SCS("set_plot_size"),_SCS("get_plot_size")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"baking/energy_mult",PROPERTY_HINT_RANGE,"0.01,4096.0,0.01"),_SCS("set_energy_multiplier"),_SCS("get_energy_multiplier")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"baking/gamma_adjust",PROPERTY_HINT_EXP_EASING),_SCS("set_gamma_adjust"),_SCS("get_gamma_adjust")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"baking/saturation",PROPERTY_HINT_RANGE,"0,8,0.01"),_SCS("set_saturation"),_SCS("get_saturation")); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"baking_flags/diffuse"),_SCS("set_bake_flag"),_SCS("get_bake_flag"),BAKE_DIFFUSE); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"baking_flags/specular"),_SCS("set_bake_flag"),_SCS("get_bake_flag"),BAKE_SPECULAR); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"baking_flags/translucent"),_SCS("set_bake_flag"),_SCS("get_bake_flag"),BAKE_TRANSLUCENT); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"baking_flags/conserve_energy"),_SCS("set_bake_flag"),_SCS("get_bake_flag"),BAKE_CONSERVE_ENERGY); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"baking_flags/linear_color"),_SCS("set_bake_flag"),_SCS("get_bake_flag"),BAKE_LINEAR_COLOR); - ADD_PROPERTY( PropertyInfo(Variant::BOOL,"lightmap/use_only_uv2"),_SCS("set_transfer_lightmaps_only_to_uv2"),_SCS("get_transfer_lightmaps_only_to_uv2")); - - ADD_PROPERTY( PropertyInfo(Variant::RAW_ARRAY,"octree",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_octree"),_SCS("get_octree")); - ADD_PROPERTY( PropertyInfo(Variant::RAW_ARRAY,"light",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_light"),_SCS("get_light")); - ADD_PROPERTY( PropertyInfo(Variant::INT_ARRAY,"sampler_octree",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("set_sampler_octree"),_SCS("get_sampler_octree")); - ADD_PROPERTY( PropertyInfo(Variant::ARRAY,"lightmaps",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_lightmap_data"),_SCS("_get_lightmap_data")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"advanced/cell_margin",PROPERTY_HINT_RANGE,"0.01,0.8,0.01"),_SCS("set_cell_extra_margin"),_SCS("get_cell_extra_margin")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"advanced/edge_damp",PROPERTY_HINT_RANGE,"0.0,8.0,0.1"),_SCS("set_edge_damp"),_SCS("get_edge_damp")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"advanced/normal_damp",PROPERTY_HINT_RANGE,"0.0,1.0,0.01"),_SCS("set_normal_damp"),_SCS("get_normal_damp")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"advanced/light_tint",PROPERTY_HINT_RANGE,"0.0,1.0,0.01"),_SCS("set_tint"),_SCS("get_tint")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"advanced/ao_radius",PROPERTY_HINT_RANGE,"0.0,16.0,0.01"),_SCS("set_ao_radius"),_SCS("get_ao_radius")); - ADD_PROPERTY( PropertyInfo(Variant::REAL,"advanced/ao_strength",PROPERTY_HINT_RANGE,"0.0,1.0,0.01"),_SCS("set_ao_strength"),_SCS("get_ao_strength")); - - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "realtime/enabled"), _SCS("set_realtime_color_enabled"), _SCS("get_realtime_color_enabled")); - ADD_PROPERTY(PropertyInfo(Variant::COLOR, "realtime/color", PROPERTY_HINT_COLOR_NO_ALPHA), _SCS("set_realtime_color"), _SCS("get_realtime_color")); - ADD_PROPERTY(PropertyInfo(Variant::REAL, "realtime/energy", PROPERTY_HINT_RANGE, "0.01,4096.0,0.01"), _SCS("set_realtime_energy"), _SCS("get_realtime_energy")); - - - BIND_CONSTANT( MODE_OCTREE ); - BIND_CONSTANT( MODE_LIGHTMAPS ); - - BIND_CONSTANT( BAKE_DIFFUSE ); - BIND_CONSTANT( BAKE_SPECULAR ); - BIND_CONSTANT( BAKE_TRANSLUCENT ); - BIND_CONSTANT( BAKE_CONSERVE_ENERGY ); - BIND_CONSTANT( BAKE_MAX ); - - -} - - -BakedLight::BakedLight() { - - cell_subdiv=8; - lattice_subdiv=4; - plot_size=2.5; - bounces=1; - energy_multiply=2.0; - gamma_adjust=0.7; - cell_extra_margin=0.05; - edge_damp=0.0; - normal_damp=0.0; - saturation=1; - tint=0.0; - ao_radius=2.5; - ao_strength=0.7; - format=FORMAT_RGB; - transfer_only_uv2=false; - - - flags[BAKE_DIFFUSE]=true; - flags[BAKE_SPECULAR]=false; - flags[BAKE_TRANSLUCENT]=true; - flags[BAKE_CONSERVE_ENERGY]=false; - flags[BAKE_LINEAR_COLOR]=false; - - mode=MODE_OCTREE; - baked_light=VS::get_singleton()->baked_light_create(); -} - -BakedLight::~BakedLight() { - - VS::get_singleton()->free(baked_light); -} diff --git a/scene/resources/baked_light.h b/scene/resources/baked_light.h index 16806d29e3..0c69ce429e 100644 --- a/scene/resources/baked_light.h +++ b/scene/resources/baked_light.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,168 +32,6 @@ #include "resource.h" #include "scene/resources/texture.h" -class BakedLight : public Resource { - OBJ_TYPE( BakedLight, Resource); -public: - enum Mode { - - MODE_OCTREE, - MODE_LIGHTMAPS - }; - - enum Format { - - FORMAT_RGB, - FORMAT_HDR8, - FORMAT_HDR16 - }; - - enum BakeFlags { - BAKE_DIFFUSE, - BAKE_SPECULAR, - BAKE_TRANSLUCENT, - BAKE_CONSERVE_ENERGY, - BAKE_LINEAR_COLOR, - BAKE_MAX - }; - -private: - - RID baked_light; - Mode mode; - struct LightMap { - Size2i gen_size; - Ref<Texture> texture; - }; - - - Vector< LightMap> lightmaps; - - //bake vars - int cell_subdiv; - int lattice_subdiv; - float plot_size; - float energy_multiply; - float gamma_adjust; - float cell_extra_margin; - float edge_damp; - float normal_damp; - float tint; - float ao_radius; - float ao_strength; - float saturation; - int bounces; - bool transfer_only_uv2; - Format format; - bool flags[BAKE_MAX]; - - - - void _update_lightmaps(); - - Array _get_lightmap_data() const; - void _set_lightmap_data(Array p_array); - -protected: - - bool _set(const StringName& p_name, const Variant& p_value); - bool _get(const StringName& p_name,Variant &r_ret) const; - void _get_property_list( List<PropertyInfo> *p_list) const; - - static void _bind_methods(); - -public: - - void set_cell_subdivision(int p_subdiv); - int get_cell_subdivision() const; - - void set_initial_lattice_subdiv(int p_size); - int get_initial_lattice_subdiv() const; - - void set_plot_size(float p_size); - float get_plot_size() const; - - void set_bounces(int p_size); - int get_bounces() const; - - void set_energy_multiplier(float p_multiplier); - float get_energy_multiplier() const; - - void set_gamma_adjust(float p_adjust); - float get_gamma_adjust() const; - - void set_cell_extra_margin(float p_margin); - float get_cell_extra_margin() const; - - void set_edge_damp(float p_margin); - float get_edge_damp() const; - - void set_normal_damp(float p_margin); - float get_normal_damp() const; - - void set_tint(float p_margin); - float get_tint() const; - - void set_saturation(float p_saturation); - float get_saturation() const; - - void set_ao_radius(float p_ao_radius); - float get_ao_radius() const; - - void set_ao_strength(float p_ao_strength); - float get_ao_strength() const; - - void set_realtime_color_enabled(const bool p_enabled); - bool get_realtime_color_enabled() const; - - void set_realtime_color(const Color& p_realtime_color); - Color get_realtime_color() const; - - void set_realtime_energy(const float p_realtime_energy); - float get_realtime_energy() const; - - void set_bake_flag(BakeFlags p_flags,bool p_enable); - bool get_bake_flag(BakeFlags p_flags) const; - - void set_format(Format p_margin); - Format get_format() const; - - void set_transfer_lightmaps_only_to_uv2(bool p_enable); - bool get_transfer_lightmaps_only_to_uv2() const; - - void set_mode(Mode p_mode); - Mode get_mode() const; - - void set_octree(const DVector<uint8_t>& p_octree); - DVector<uint8_t> get_octree() const; - - void set_light(const DVector<uint8_t>& p_light); - DVector<uint8_t> get_light() const; - - void set_sampler_octree(const DVector<int>& p_sampler_octree); - DVector<int> get_sampler_octree() const; - - - - void add_lightmap(const Ref<Texture> &p_texture,Size2 p_gen_size=Size2(256,256)); - void set_lightmap_gen_size(int p_idx,const Size2& p_size); - Size2 get_lightmap_gen_size(int p_idx) const; - void set_lightmap_texture(int p_idx,const Ref<Texture> &p_texture); - Ref<Texture> get_lightmap_texture(int p_idx) const; - void erase_lightmap(int p_idx); - int get_lightmaps_count() const; - void clear_lightmaps(); - - virtual RID get_rid() const; - - BakedLight(); - ~BakedLight(); -}; - - -VARIANT_ENUM_CAST(BakedLight::Format); -VARIANT_ENUM_CAST(BakedLight::Mode); -VARIANT_ENUM_CAST(BakedLight::BakeFlags); #endif // BAKED_LIGHT_H diff --git a/scene/resources/bit_mask.cpp b/scene/resources/bit_mask.cpp index f5bfce3ef8..d669ab771c 100644 --- a/scene/resources/bit_mask.cpp +++ b/scene/resources/bit_mask.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -45,20 +45,20 @@ void BitMap::create_from_image_alpha(const Image& p_image){ ERR_FAIL_COND(p_image.empty()); Image img=p_image; - img.convert(Image::FORMAT_INTENSITY); - ERR_FAIL_COND(img.get_format()!=Image::FORMAT_INTENSITY); + img.convert(Image::FORMAT_LA8); + ERR_FAIL_COND(img.get_format()!=Image::FORMAT_LA8); create(Size2(img.get_width(),img.get_height())); - DVector<uint8_t>::Read r = img.get_data().read(); + PoolVector<uint8_t>::Read r = img.get_data().read(); uint8_t *w = bitmask.ptr(); for(int i=0;i<width*height;i++) { int bbyte = i/8; int bbit = i % 8; - if (r[i]) + if (r[i*2]) w[bbyte]|=(1<<bbit); } @@ -177,23 +177,22 @@ Dictionary BitMap::_get_data() const{ void BitMap::_bind_methods() { - ObjectTypeDB::bind_method(_MD("create","size"),&BitMap::create); - ObjectTypeDB::bind_method(_MD("create_from_image_alpha","image"),&BitMap::create_from_image_alpha); + ClassDB::bind_method(_MD("create","size"),&BitMap::create); + ClassDB::bind_method(_MD("create_from_image_alpha","image"),&BitMap::create_from_image_alpha); - ObjectTypeDB::bind_method(_MD("set_bit","pos","bit"),&BitMap::set_bit); - ObjectTypeDB::bind_method(_MD("get_bit","pos"),&BitMap::get_bit); + ClassDB::bind_method(_MD("set_bit","pos","bit"),&BitMap::set_bit); + ClassDB::bind_method(_MD("get_bit","pos"),&BitMap::get_bit); - ObjectTypeDB::bind_method(_MD("set_bit_rect","p_rect","bit"),&BitMap::set_bit_rect); - ObjectTypeDB::bind_method(_MD("get_true_bit_count"),&BitMap::get_true_bit_count); + ClassDB::bind_method(_MD("set_bit_rect","p_rect","bit"),&BitMap::set_bit_rect); + ClassDB::bind_method(_MD("get_true_bit_count"),&BitMap::get_true_bit_count); - ObjectTypeDB::bind_method(_MD("get_size"),&BitMap::get_size); + ClassDB::bind_method(_MD("get_size"),&BitMap::get_size); - ObjectTypeDB::bind_method(_MD("_set_data"),&BitMap::_set_data); - ObjectTypeDB::bind_method(_MD("_get_data"),&BitMap::_get_data); + ClassDB::bind_method(_MD("_set_data"),&BitMap::_set_data); + ClassDB::bind_method(_MD("_get_data"),&BitMap::_get_data); ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY,"data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_data"),_SCS("_get_data")); - } BitMap::BitMap() { diff --git a/scene/resources/bit_mask.h b/scene/resources/bit_mask.h index e75a2aa332..f749a53e34 100644 --- a/scene/resources/bit_mask.h +++ b/scene/resources/bit_mask.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class BitMap : public Resource { - OBJ_TYPE(BitMap,Resource); + GDCLASS(BitMap,Resource); OBJ_SAVE_TYPE(BitMap); RES_BASE_EXTENSION("pbm"); diff --git a/scene/resources/bounds.cpp b/scene/resources/bounds.cpp index 65ce5e49e8..03d819451d 100644 --- a/scene/resources/bounds.cpp +++ b/scene/resources/bounds.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,8 +31,8 @@ void Bounds::_bind_methods() { - ObjectTypeDB::bind_method( _MD("set_bsp_tree","bsp_tree"),&Bounds::set_bsp_tree); - ObjectTypeDB::bind_method( _MD("get_bsp_tree"),&Bounds::get_bsp_tree ); + ClassDB::bind_method( _MD("set_bsp_tree","bsp_tree"),&Bounds::set_bsp_tree); + ClassDB::bind_method( _MD("get_bsp_tree"),&Bounds::get_bsp_tree ); ADD_PROPERTY( PropertyInfo( Variant::ARRAY, "bsp_tree" ), _SCS("set_bsp_tree"), _SCS("get_bsp_tree")); diff --git a/scene/resources/bounds.h b/scene/resources/bounds.h index a1610e2b57..bd5d996a36 100644 --- a/scene/resources/bounds.h +++ b/scene/resources/bounds.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class Bounds : public Resource { - OBJ_TYPE(Bounds,Resource); + GDCLASS(Bounds,Resource); BSP_Tree bsp_tree; protected: diff --git a/scene/resources/box_shape.cpp b/scene/resources/box_shape.cpp index 9a6fedeb0b..87585af862 100644 --- a/scene/resources/box_shape.cpp +++ b/scene/resources/box_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ Vector<Vector3> BoxShape::_gen_debug_mesh_lines() { Vector<Vector3> lines; - AABB aabb; + Rect3 aabb; aabb.pos=-get_extents(); aabb.size=aabb.pos*-2; @@ -70,8 +70,8 @@ Vector3 BoxShape::get_extents() const { void BoxShape::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_extents","extents"),&BoxShape::set_extents); - ObjectTypeDB::bind_method(_MD("get_extents"),&BoxShape::get_extents); + ClassDB::bind_method(_MD("set_extents","extents"),&BoxShape::set_extents); + ClassDB::bind_method(_MD("get_extents"),&BoxShape::get_extents); ADD_PROPERTY( PropertyInfo(Variant::VECTOR3,"extents"), _SCS("set_extents"), _SCS("get_extents") ); diff --git a/scene/resources/box_shape.h b/scene/resources/box_shape.h index 88fca65eea..c17dd22015 100644 --- a/scene/resources/box_shape.h +++ b/scene/resources/box_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class BoxShape : public Shape { - OBJ_TYPE(BoxShape,Shape); + GDCLASS(BoxShape,Shape); Vector3 extents; protected: diff --git a/scene/resources/canvas.cpp b/scene/resources/canvas.cpp index 0c87d0473d..bda97141cc 100644 --- a/scene/resources/canvas.cpp +++ b/scene/resources/canvas.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/canvas.h b/scene/resources/canvas.h index 5120301a67..960136ac14 100644 --- a/scene/resources/canvas.h +++ b/scene/resources/canvas.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class Canvas : public Resource { - OBJ_TYPE(Canvas,Resource); + GDCLASS(Canvas,Resource); RID canvas; diff --git a/scene/resources/capsule_shape.cpp b/scene/resources/capsule_shape.cpp index 4c53645d2d..db83a20f38 100644 --- a/scene/resources/capsule_shape.cpp +++ b/scene/resources/capsule_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -107,10 +107,10 @@ float CapsuleShape::get_height() const { void CapsuleShape::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_radius","radius"),&CapsuleShape::set_radius); - ObjectTypeDB::bind_method(_MD("get_radius"),&CapsuleShape::get_radius); - ObjectTypeDB::bind_method(_MD("set_height","height"),&CapsuleShape::set_height); - ObjectTypeDB::bind_method(_MD("get_height"),&CapsuleShape::get_height); + ClassDB::bind_method(_MD("set_radius","radius"),&CapsuleShape::set_radius); + ClassDB::bind_method(_MD("get_radius"),&CapsuleShape::get_radius); + ClassDB::bind_method(_MD("set_height","height"),&CapsuleShape::set_height); + ClassDB::bind_method(_MD("get_height"),&CapsuleShape::get_height); ADD_PROPERTY( PropertyInfo(Variant::REAL,"radius",PROPERTY_HINT_RANGE,"0.01,4096,0.01"), _SCS("set_radius"),_SCS("get_radius") ); ADD_PROPERTY( PropertyInfo(Variant::REAL,"height",PROPERTY_HINT_RANGE,"0.01,4096,0.01"), _SCS("set_height"),_SCS("get_height") ); diff --git a/scene/resources/capsule_shape.h b/scene/resources/capsule_shape.h index 4263c3a554..e788d9cfc5 100644 --- a/scene/resources/capsule_shape.h +++ b/scene/resources/capsule_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class CapsuleShape : public Shape { - OBJ_TYPE(CapsuleShape,Shape); + GDCLASS(CapsuleShape,Shape); float radius; float height; diff --git a/scene/resources/capsule_shape_2d.cpp b/scene/resources/capsule_shape_2d.cpp index 1887ec11d7..27dcff0ce0 100644 --- a/scene/resources/capsule_shape_2d.cpp +++ b/scene/resources/capsule_shape_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -89,11 +89,11 @@ Rect2 CapsuleShape2D::get_rect() const { void CapsuleShape2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_radius","radius"),&CapsuleShape2D::set_radius); - ObjectTypeDB::bind_method(_MD("get_radius"),&CapsuleShape2D::get_radius); + ClassDB::bind_method(_MD("set_radius","radius"),&CapsuleShape2D::set_radius); + ClassDB::bind_method(_MD("get_radius"),&CapsuleShape2D::get_radius); - ObjectTypeDB::bind_method(_MD("set_height","height"),&CapsuleShape2D::set_height); - ObjectTypeDB::bind_method(_MD("get_height"),&CapsuleShape2D::get_height); + ClassDB::bind_method(_MD("set_height","height"),&CapsuleShape2D::set_height); + ClassDB::bind_method(_MD("get_height"),&CapsuleShape2D::get_height); ADD_PROPERTY( PropertyInfo(Variant::REAL,"radius"),_SCS("set_radius"),_SCS("get_radius") ); diff --git a/scene/resources/capsule_shape_2d.h b/scene/resources/capsule_shape_2d.h index 18b5c12a52..ef06072e14 100644 --- a/scene/resources/capsule_shape_2d.h +++ b/scene/resources/capsule_shape_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,7 +32,7 @@ #include "scene/resources/shape_2d.h" class CapsuleShape2D : public Shape2D { - OBJ_TYPE( CapsuleShape2D, Shape2D ); + GDCLASS( CapsuleShape2D, Shape2D ); real_t height; real_t radius; diff --git a/scene/resources/circle_shape_2d.cpp b/scene/resources/circle_shape_2d.cpp index 7171af9670..a82f3f5e2d 100644 --- a/scene/resources/circle_shape_2d.cpp +++ b/scene/resources/circle_shape_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -51,8 +51,8 @@ real_t CircleShape2D::get_radius() const { void CircleShape2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_radius","radius"),&CircleShape2D::set_radius); - ObjectTypeDB::bind_method(_MD("get_radius"),&CircleShape2D::get_radius); + ClassDB::bind_method(_MD("set_radius","radius"),&CircleShape2D::set_radius); + ClassDB::bind_method(_MD("get_radius"),&CircleShape2D::get_radius); ADD_PROPERTY( PropertyInfo(Variant::REAL,"radius",PROPERTY_HINT_RANGE,"0.01,16384,0.5"),_SCS("set_radius"),_SCS("get_radius") ); diff --git a/scene/resources/circle_shape_2d.h b/scene/resources/circle_shape_2d.h index c36e00d106..ec11b55169 100644 --- a/scene/resources/circle_shape_2d.h +++ b/scene/resources/circle_shape_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,7 +32,7 @@ #include "scene/resources/shape_2d.h" class CircleShape2D : public Shape2D { - OBJ_TYPE( CircleShape2D, Shape2D ); + GDCLASS( CircleShape2D, Shape2D ); real_t radius; void _update_shape(); diff --git a/scene/resources/color_ramp.cpp b/scene/resources/color_ramp.cpp index dfa9181d60..1144ea41f1 100644 --- a/scene/resources/color_ramp.cpp +++ b/scene/resources/color_ramp.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -54,24 +54,24 @@ void ColorRamp::_bind_methods() { - ObjectTypeDB::bind_method(_MD("add_point","offset","color"),&ColorRamp::add_point); - ObjectTypeDB::bind_method(_MD("remove_point","offset","color"),&ColorRamp::remove_point); + ClassDB::bind_method(_MD("add_point","offset","color"),&ColorRamp::add_point); + ClassDB::bind_method(_MD("remove_point","offset","color"),&ColorRamp::remove_point); - ObjectTypeDB::bind_method(_MD("set_offset","point","offset"),&ColorRamp::set_offset); - ObjectTypeDB::bind_method(_MD("get_offset","point"),&ColorRamp::get_offset); + ClassDB::bind_method(_MD("set_offset","point","offset"),&ColorRamp::set_offset); + ClassDB::bind_method(_MD("get_offset","point"),&ColorRamp::get_offset); - ObjectTypeDB::bind_method(_MD("set_color","point","color"),&ColorRamp::set_color); - ObjectTypeDB::bind_method(_MD("get_color","point"),&ColorRamp::get_color); + ClassDB::bind_method(_MD("set_color","point","color"),&ColorRamp::set_color); + ClassDB::bind_method(_MD("get_color","point"),&ColorRamp::get_color); - ObjectTypeDB::bind_method(_MD("interpolate","offset"),&ColorRamp::get_color_at_offset); + ClassDB::bind_method(_MD("interpolate","offset"),&ColorRamp::get_color_at_offset); - ObjectTypeDB::bind_method(_MD("get_point_count"),&ColorRamp::get_points_count); + ClassDB::bind_method(_MD("get_point_count"),&ColorRamp::get_points_count); - ObjectTypeDB::bind_method(_MD(COLOR_RAMP_SET_OFFSETS,"offsets"),&ColorRamp::set_offsets); - ObjectTypeDB::bind_method(_MD(COLOR_RAMP_GET_OFFSETS),&ColorRamp::get_offsets); + ClassDB::bind_method(_MD(COLOR_RAMP_SET_OFFSETS,"offsets"),&ColorRamp::set_offsets); + ClassDB::bind_method(_MD(COLOR_RAMP_GET_OFFSETS),&ColorRamp::get_offsets); - ObjectTypeDB::bind_method(_MD(COLOR_RAMP_SET_COLORS,"colors"),&ColorRamp::set_colors); - ObjectTypeDB::bind_method(_MD(COLOR_RAMP_GET_COLORS),&ColorRamp::get_colors); + ClassDB::bind_method(_MD(COLOR_RAMP_SET_COLORS,"colors"),&ColorRamp::set_colors); + ClassDB::bind_method(_MD(COLOR_RAMP_GET_COLORS),&ColorRamp::get_colors); ADD_PROPERTY( PropertyInfo(Variant::REAL,"offsets"),_SCS(COLOR_RAMP_SET_OFFSETS),_SCS(COLOR_RAMP_GET_OFFSETS) ); ADD_PROPERTY( PropertyInfo(Variant::REAL,"colors"),_SCS(COLOR_RAMP_SET_COLORS),_SCS(COLOR_RAMP_GET_COLORS) ); diff --git a/scene/resources/color_ramp.h b/scene/resources/color_ramp.h index daa21b480a..b6ca56dbf5 100644 --- a/scene/resources/color_ramp.h +++ b/scene/resources/color_ramp.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,7 +32,7 @@ #include "resource.h" class ColorRamp: public Resource { - OBJ_TYPE( ColorRamp, Resource ); + GDCLASS( ColorRamp, Resource ); OBJ_SAVE_TYPE( ColorRamp ); public: diff --git a/scene/resources/concave_polygon_shape.cpp b/scene/resources/concave_polygon_shape.cpp index 34bea038f4..5190bba6a5 100644 --- a/scene/resources/concave_polygon_shape.cpp +++ b/scene/resources/concave_polygon_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,11 +34,11 @@ Vector<Vector3> ConcavePolygonShape::_gen_debug_mesh_lines() { Set<DrawEdge> edges; - DVector<Vector3> data=get_faces(); + PoolVector<Vector3> data=get_faces(); int datalen=data.size(); ERR_FAIL_COND_V( (datalen%3)!=0,Vector<Vector3>() ); - DVector<Vector3>::Read r=data.read(); + PoolVector<Vector3>::Read r=data.read(); for(int i=0;i<datalen;i+=3) { @@ -94,13 +94,13 @@ void ConcavePolygonShape::_update_shape() { } -void ConcavePolygonShape::set_faces(const DVector<Vector3>& p_faces) { +void ConcavePolygonShape::set_faces(const PoolVector<Vector3>& p_faces) { PhysicsServer::get_singleton()->shape_set_data(get_shape(),p_faces); notify_change_to_owners(); } -DVector<Vector3> ConcavePolygonShape::get_faces() const { +PoolVector<Vector3> ConcavePolygonShape::get_faces() const { return PhysicsServer::get_singleton()->shape_get_data(get_shape()); @@ -110,8 +110,8 @@ DVector<Vector3> ConcavePolygonShape::get_faces() const { void ConcavePolygonShape::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_faces","faces"),&ConcavePolygonShape::set_faces); - ObjectTypeDB::bind_method(_MD("get_faces"),&ConcavePolygonShape::get_faces); + ClassDB::bind_method(_MD("set_faces","faces"),&ConcavePolygonShape::set_faces); + ClassDB::bind_method(_MD("get_faces"),&ConcavePolygonShape::get_faces); } ConcavePolygonShape::ConcavePolygonShape() : Shape( PhysicsServer::get_singleton()->shape_create(PhysicsServer::SHAPE_CONCAVE_POLYGON)) { diff --git a/scene/resources/concave_polygon_shape.h b/scene/resources/concave_polygon_shape.h index a4845e9220..36e806d37a 100644 --- a/scene/resources/concave_polygon_shape.h +++ b/scene/resources/concave_polygon_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class ConcavePolygonShape : public Shape { - OBJ_TYPE(ConcavePolygonShape,Shape); + GDCLASS(ConcavePolygonShape,Shape); struct DrawEdge { @@ -67,8 +67,8 @@ protected: virtual Vector<Vector3> _gen_debug_mesh_lines(); public: - void set_faces(const DVector<Vector3>& p_faces); - DVector<Vector3> get_faces() const; + void set_faces(const PoolVector<Vector3>& p_faces); + PoolVector<Vector3> get_faces() const; ConcavePolygonShape(); diff --git a/scene/resources/concave_polygon_shape_2d.cpp b/scene/resources/concave_polygon_shape_2d.cpp index 2c66155cb8..6866750006 100644 --- a/scene/resources/concave_polygon_shape_2d.cpp +++ b/scene/resources/concave_polygon_shape_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,13 +31,13 @@ #include "servers/physics_2d_server.h" #include "servers/visual_server.h" -void ConcavePolygonShape2D::set_segments(const DVector<Vector2>& p_segments) { +void ConcavePolygonShape2D::set_segments(const PoolVector<Vector2>& p_segments) { Physics2DServer::get_singleton()->shape_set_data(get_rid(),p_segments); emit_changed(); } -DVector<Vector2> ConcavePolygonShape2D::get_segments() const { +PoolVector<Vector2> ConcavePolygonShape2D::get_segments() const { return Physics2DServer::get_singleton()->shape_get_data(get_rid()); } @@ -45,12 +45,12 @@ DVector<Vector2> ConcavePolygonShape2D::get_segments() const { void ConcavePolygonShape2D::draw(const RID& p_to_rid,const Color& p_color) { - DVector<Vector2> s = get_segments(); + PoolVector<Vector2> s = get_segments(); int len=s.size(); if (len==0 || (len%2)==1) return; - DVector<Vector2>::Read r = s.read(); + PoolVector<Vector2>::Read r = s.read(); for(int i=0;i<len;i+=2) { VisualServer::get_singleton()->canvas_item_add_line(p_to_rid,r[i],r[i+1],p_color,2); } @@ -60,14 +60,14 @@ void ConcavePolygonShape2D::draw(const RID& p_to_rid,const Color& p_color) { Rect2 ConcavePolygonShape2D::get_rect() const { - DVector<Vector2> s = get_segments(); + PoolVector<Vector2> s = get_segments(); int len=s.size(); if (len==0) return Rect2(); Rect2 rect; - DVector<Vector2>::Read r = s.read(); + PoolVector<Vector2>::Read r = s.read(); for(int i=0;i<len;i++) { if (i==0) rect.pos=r[i]; @@ -82,10 +82,10 @@ Rect2 ConcavePolygonShape2D::get_rect() const { void ConcavePolygonShape2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_segments","segments"),&ConcavePolygonShape2D::set_segments); - ObjectTypeDB::bind_method(_MD("get_segments"),&ConcavePolygonShape2D::get_segments); + ClassDB::bind_method(_MD("set_segments","segments"),&ConcavePolygonShape2D::set_segments); + ClassDB::bind_method(_MD("get_segments"),&ConcavePolygonShape2D::get_segments); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2_ARRAY,"segments"),_SCS("set_segments"),_SCS("get_segments") ); + ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"segments"),_SCS("set_segments"),_SCS("get_segments") ); } diff --git a/scene/resources/concave_polygon_shape_2d.h b/scene/resources/concave_polygon_shape_2d.h index 89b8914741..309fb4a7b3 100644 --- a/scene/resources/concave_polygon_shape_2d.h +++ b/scene/resources/concave_polygon_shape_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,14 +32,14 @@ #include "scene/resources/shape_2d.h" class ConcavePolygonShape2D : public Shape2D { - OBJ_TYPE( ConcavePolygonShape2D, Shape2D ); + GDCLASS( ConcavePolygonShape2D, Shape2D ); protected: static void _bind_methods(); public: - void set_segments(const DVector<Vector2>& p_segments); - DVector<Vector2> get_segments() const; + void set_segments(const PoolVector<Vector2>& p_segments); + PoolVector<Vector2> get_segments() const; virtual void draw(const RID& p_to_rid,const Color& p_color); virtual Rect2 get_rect() const ; diff --git a/scene/resources/convex_polygon_shape.cpp b/scene/resources/convex_polygon_shape.cpp index 7fcc9e97c0..ca9897bf97 100644 --- a/scene/resources/convex_polygon_shape.cpp +++ b/scene/resources/convex_polygon_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,7 +32,7 @@ Vector<Vector3> ConvexPolygonShape::_gen_debug_mesh_lines() { - DVector<Vector3> points = get_points(); + PoolVector<Vector3> points = get_points(); if (points.size()>3) { @@ -64,14 +64,14 @@ void ConvexPolygonShape::_update_shape() { emit_changed(); } -void ConvexPolygonShape::set_points(const DVector<Vector3>& p_points) { +void ConvexPolygonShape::set_points(const PoolVector<Vector3>& p_points) { points=p_points; _update_shape(); notify_change_to_owners(); } -DVector<Vector3> ConvexPolygonShape::get_points() const { +PoolVector<Vector3> ConvexPolygonShape::get_points() const { return points; } @@ -79,8 +79,8 @@ DVector<Vector3> ConvexPolygonShape::get_points() const { void ConvexPolygonShape::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_points","points"),&ConvexPolygonShape::set_points); - ObjectTypeDB::bind_method(_MD("get_points"),&ConvexPolygonShape::get_points); + ClassDB::bind_method(_MD("set_points","points"),&ConvexPolygonShape::set_points); + ClassDB::bind_method(_MD("get_points"),&ConvexPolygonShape::get_points); ADD_PROPERTY( PropertyInfo(Variant::ARRAY,"points"), _SCS("set_points"), _SCS("get_points") ); diff --git a/scene/resources/convex_polygon_shape.h b/scene/resources/convex_polygon_shape.h index a4e504ee24..215de941c6 100644 --- a/scene/resources/convex_polygon_shape.h +++ b/scene/resources/convex_polygon_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,8 +33,8 @@ class ConvexPolygonShape : public Shape { - OBJ_TYPE(ConvexPolygonShape,Shape); - DVector<Vector3> points; + GDCLASS(ConvexPolygonShape,Shape); + PoolVector<Vector3> points; protected: @@ -45,8 +45,8 @@ protected: virtual Vector<Vector3> _gen_debug_mesh_lines(); public: - void set_points(const DVector<Vector3>& p_points); - DVector<Vector3> get_points() const; + void set_points(const PoolVector<Vector3>& p_points); + PoolVector<Vector3> get_points() const; ConvexPolygonShape(); }; diff --git a/scene/resources/convex_polygon_shape_2d.cpp b/scene/resources/convex_polygon_shape_2d.cpp index 5c0dadefc2..0d3ba238f6 100644 --- a/scene/resources/convex_polygon_shape_2d.cpp +++ b/scene/resources/convex_polygon_shape_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -61,13 +61,13 @@ Vector<Vector2> ConvexPolygonShape2D::get_points() const { void ConvexPolygonShape2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_point_cloud","point_cloud"),&ConvexPolygonShape2D::set_point_cloud); - ObjectTypeDB::bind_method(_MD("set_points","points"),&ConvexPolygonShape2D::set_points); - ObjectTypeDB::bind_method(_MD("get_points"),&ConvexPolygonShape2D::get_points); + ClassDB::bind_method(_MD("set_point_cloud","point_cloud"),&ConvexPolygonShape2D::set_point_cloud); + ClassDB::bind_method(_MD("set_points","points"),&ConvexPolygonShape2D::set_points); + ClassDB::bind_method(_MD("get_points"),&ConvexPolygonShape2D::get_points); - ADD_PROPERTY( PropertyInfo(Variant::VECTOR2_ARRAY,"points"),_SCS("set_points"),_SCS("get_points") ); + ADD_PROPERTY( PropertyInfo(Variant::POOL_VECTOR2_ARRAY,"points"),_SCS("set_points"),_SCS("get_points") ); } diff --git a/scene/resources/convex_polygon_shape_2d.h b/scene/resources/convex_polygon_shape_2d.h index e1792a1075..8a4ad0e6d8 100644 --- a/scene/resources/convex_polygon_shape_2d.h +++ b/scene/resources/convex_polygon_shape_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,7 +32,7 @@ #include "scene/resources/shape_2d.h" class ConvexPolygonShape2D : public Shape2D { - OBJ_TYPE( ConvexPolygonShape2D, Shape2D ); + GDCLASS( ConvexPolygonShape2D, Shape2D ); Vector<Vector2> points; void _update_shape(); diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp index 29460790ff..e201cb16ac 100644 --- a/scene/resources/curve.cpp +++ b/scene/resources/curve.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -143,17 +143,17 @@ Vector2 Curve2D::interpolatef(real_t p_findex) const { } -DVector<Point2> Curve2D::bake(int p_subdivs) const { +PoolVector<Point2> Curve2D::bake(int p_subdivs) const { int pc = points.size(); - DVector<Point2> ret; + PoolVector<Point2> ret; if (pc<2) return ret; ret.resize((pc-1)*p_subdivs+1); - DVector<Point2>::Write w = ret.write(); + PoolVector<Point2>::Write w = ret.write(); const Point *r = points.ptr(); for(int i=0;i<pc;i++) { @@ -175,7 +175,7 @@ DVector<Point2> Curve2D::bake(int p_subdivs) const { } } - w = DVector<Point2>::Write(); + w = PoolVector<Point2>::Write(); return ret; } @@ -349,26 +349,26 @@ Vector2Array Curve2D::get_points_pos() const { void Curve2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_point_count"),&Curve2D::get_point_count); - ObjectTypeDB::bind_method(_MD("add_point","pos","in","out"),&Curve2D::add_point,DEFVAL(Vector2()),DEFVAL(Vector2())); - ObjectTypeDB::bind_method(_MD("set_point_pos","idx","pos"),&Curve2D::set_point_pos); - ObjectTypeDB::bind_method(_MD("get_point_pos","idx"),&Curve2D::get_point_pos); - ObjectTypeDB::bind_method(_MD("set_point_in","idx","pos"),&Curve2D::set_point_in); - ObjectTypeDB::bind_method(_MD("get_point_in","idx"),&Curve2D::get_point_in); - ObjectTypeDB::bind_method(_MD("set_point_out","idx","pos"),&Curve2D::set_point_out); - ObjectTypeDB::bind_method(_MD("get_point_out","idx"),&Curve2D::get_point_out); - ObjectTypeDB::bind_method(_MD("remove_point","idx"),&Curve2D::remove_point); - ObjectTypeDB::bind_method(_MD("interpolate","idx","t"),&Curve2D::interpolate); - ObjectTypeDB::bind_method(_MD("bake","subdivs"),&Curve2D::bake,DEFVAL(10)); + ClassDB::bind_method(_MD("get_point_count"),&Curve2D::get_point_count); + ClassDB::bind_method(_MD("add_point","pos","in","out"),&Curve2D::add_point,DEFVAL(Vector2()),DEFVAL(Vector2())); + ClassDB::bind_method(_MD("set_point_pos","idx","pos"),&Curve2D::set_point_pos); + ClassDB::bind_method(_MD("get_point_pos","idx"),&Curve2D::get_point_pos); + ClassDB::bind_method(_MD("set_point_in","idx","pos"),&Curve2D::set_point_in); + ClassDB::bind_method(_MD("get_point_in","idx"),&Curve2D::get_point_in); + ClassDB::bind_method(_MD("set_point_out","idx","pos"),&Curve2D::set_point_out); + ClassDB::bind_method(_MD("get_point_out","idx"),&Curve2D::get_point_out); + ClassDB::bind_method(_MD("remove_point","idx"),&Curve2D::remove_point); + ClassDB::bind_method(_MD("interpolate","idx","t"),&Curve2D::interpolate); + ClassDB::bind_method(_MD("bake","subdivs"),&Curve2D::bake,DEFVAL(10)); - ObjectTypeDB::bind_method(_MD("set_points_in"),&Curve2D::set_points_in); - ObjectTypeDB::bind_method(_MD("set_points_out"),&Curve2D::set_points_out); - ObjectTypeDB::bind_method(_MD("set_points_pos"),&Curve2D::set_points_pos); + ClassDB::bind_method(_MD("set_points_in"),&Curve2D::set_points_in); + ClassDB::bind_method(_MD("set_points_out"),&Curve2D::set_points_out); + ClassDB::bind_method(_MD("set_points_pos"),&Curve2D::set_points_pos); - ObjectTypeDB::bind_method(_MD("get_points_in"),&Curve2D::get_points_in); - ObjectTypeDB::bind_method(_MD("get_points_out"),&Curve2D::get_points_out); - ObjectTypeDB::bind_method(_MD("get_points_pos"),&Curve2D::get_points_pos); + ClassDB::bind_method(_MD("get_points_in"),&Curve2D::get_points_in); + ClassDB::bind_method(_MD("get_points_out"),&Curve2D::get_points_out); + ClassDB::bind_method(_MD("get_points_pos"),&Curve2D::get_points_pos); ADD_PROPERTY( PropertyInfo( Variant::VECTOR2_ARRAY, "points_in"), _SCS("set_points_in"),_SCS("get_points_in")); ADD_PROPERTY( PropertyInfo( Variant::VECTOR2_ARRAY, "points_out"), _SCS("set_points_out"),_SCS("get_points_out")); @@ -464,6 +464,14 @@ void Curve2D::remove_point(int p_index) { emit_signal(CoreStringNames::get_singleton()->changed); } +void Curve2D::clear_points() { + if (!points.empty()) { + points.clear(); + baked_cache_dirty=true; + emit_signal(CoreStringNames::get_singleton()->changed); + } +} + Vector2 Curve2D::interpolate(int p_index, float p_offset) const { int pc = points.size(); @@ -602,7 +610,7 @@ void Curve2D::_bake() const { pointlist.push_back(lastpos); baked_point_cache.resize(pointlist.size()); - Vector2Array::Write w = baked_point_cache.write(); + PoolVector2Array::Write w = baked_point_cache.write(); int idx=0; @@ -637,7 +645,7 @@ Vector2 Curve2D::interpolate_baked(float p_offset,bool p_cubic) const{ return baked_point_cache.get(0); int bpc=baked_point_cache.size(); - Vector2Array::Read r = baked_point_cache.read(); + PoolVector2Array::Read r = baked_point_cache.read(); if (p_offset<0) return r[0]; @@ -666,7 +674,7 @@ Vector2 Curve2D::interpolate_baked(float p_offset,bool p_cubic) const{ } -Vector2Array Curve2D::get_baked_points() const { +PoolVector2Array Curve2D::get_baked_points() const { if (baked_cache_dirty) _bake(); @@ -692,9 +700,9 @@ Dictionary Curve2D::_get_data() const { Dictionary dc; - Vector2Array d; + PoolVector2Array d; d.resize(points.size()*3); - Vector2Array::Write w = d.write(); + PoolVector2Array::Write w = d.write(); for(int i=0;i<points.size();i++) { @@ -705,7 +713,7 @@ Dictionary Curve2D::_get_data() const { } - w=Vector2Array::Write(); + w=PoolVector2Array::Write(); dc["points"]=d; @@ -716,11 +724,11 @@ void Curve2D::_set_data(const Dictionary& p_data){ ERR_FAIL_COND(!p_data.has("points")); - Vector2Array rp=p_data["points"]; + PoolVector2Array rp=p_data["points"]; int pc = rp.size(); ERR_FAIL_COND(pc%3!=0); points.resize(pc/3); - Vector2Array::Read r = rp.read(); + PoolVector2Array::Read r = rp.read(); for(int i=0;i<points.size();i++) { @@ -734,9 +742,9 @@ void Curve2D::_set_data(const Dictionary& p_data){ } -Vector2Array Curve2D::tesselate(int p_max_stages,float p_tolerance) const { +PoolVector2Array Curve2D::tesselate(int p_max_stages,float p_tolerance) const { - Vector2Array tess; + PoolVector2Array tess; if (points.size()==0) { @@ -756,7 +764,7 @@ Vector2Array Curve2D::tesselate(int p_max_stages,float p_tolerance) const { } tess.resize(pc); - Vector2Array::Write bpw=tess.write(); + PoolVector2Array::Write bpw=tess.write(); bpw[0]=points[0].pos; int pidx=0; @@ -773,7 +781,7 @@ Vector2Array Curve2D::tesselate(int p_max_stages,float p_tolerance) const { } - bpw=Vector2Array::Write (); + bpw=PoolVector2Array::Write (); return tess; @@ -781,28 +789,29 @@ Vector2Array Curve2D::tesselate(int p_max_stages,float p_tolerance) const { void Curve2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_point_count"),&Curve2D::get_point_count); - ObjectTypeDB::bind_method(_MD("add_point","pos","in","out","atpos"),&Curve2D::add_point,DEFVAL(Vector2()),DEFVAL(Vector2()),DEFVAL(-1)); - ObjectTypeDB::bind_method(_MD("set_point_pos","idx","pos"),&Curve2D::set_point_pos); - ObjectTypeDB::bind_method(_MD("get_point_pos","idx"),&Curve2D::get_point_pos); - ObjectTypeDB::bind_method(_MD("set_point_in","idx","pos"),&Curve2D::set_point_in); - ObjectTypeDB::bind_method(_MD("get_point_in","idx"),&Curve2D::get_point_in); - ObjectTypeDB::bind_method(_MD("set_point_out","idx","pos"),&Curve2D::set_point_out); - ObjectTypeDB::bind_method(_MD("get_point_out","idx"),&Curve2D::get_point_out); - ObjectTypeDB::bind_method(_MD("remove_point","idx"),&Curve2D::remove_point); - ObjectTypeDB::bind_method(_MD("interpolate","idx","t"),&Curve2D::interpolate); - ObjectTypeDB::bind_method(_MD("interpolatef","fofs"),&Curve2D::interpolatef); - //ObjectTypeDB::bind_method(_MD("bake","subdivs"),&Curve2D::bake,DEFVAL(10)); - ObjectTypeDB::bind_method(_MD("set_bake_interval","distance"),&Curve2D::set_bake_interval); - ObjectTypeDB::bind_method(_MD("get_bake_interval"),&Curve2D::get_bake_interval); - - ObjectTypeDB::bind_method(_MD("get_baked_length"),&Curve2D::get_baked_length); - ObjectTypeDB::bind_method(_MD("interpolate_baked","offset","cubic"),&Curve2D::interpolate_baked,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("get_baked_points"),&Curve2D::get_baked_points); - ObjectTypeDB::bind_method(_MD("tesselate","max_stages","tolerance_degrees"),&Curve2D::tesselate,DEFVAL(5),DEFVAL(4)); - - ObjectTypeDB::bind_method(_MD("_get_data"),&Curve2D::_get_data); - ObjectTypeDB::bind_method(_MD("_set_data"),&Curve2D::_set_data); + ClassDB::bind_method(_MD("get_point_count"),&Curve2D::get_point_count); + ClassDB::bind_method(_MD("add_point","pos","in","out","atpos"),&Curve2D::add_point,DEFVAL(Vector2()),DEFVAL(Vector2()),DEFVAL(-1)); + ClassDB::bind_method(_MD("set_point_pos","idx","pos"),&Curve2D::set_point_pos); + ClassDB::bind_method(_MD("get_point_pos","idx"),&Curve2D::get_point_pos); + ClassDB::bind_method(_MD("set_point_in","idx","pos"),&Curve2D::set_point_in); + ClassDB::bind_method(_MD("get_point_in","idx"),&Curve2D::get_point_in); + ClassDB::bind_method(_MD("set_point_out","idx","pos"),&Curve2D::set_point_out); + ClassDB::bind_method(_MD("get_point_out","idx"),&Curve2D::get_point_out); + ClassDB::bind_method(_MD("remove_point","idx"),&Curve2D::remove_point); + ClassDB::bind_method(_MD("clear_points"),&Curve2D::clear_points); + ClassDB::bind_method(_MD("interpolate","idx","t"),&Curve2D::interpolate); + ClassDB::bind_method(_MD("interpolatef","fofs"),&Curve2D::interpolatef); + //ClassDB::bind_method(_MD("bake","subdivs"),&Curve2D::bake,DEFVAL(10)); + ClassDB::bind_method(_MD("set_bake_interval","distance"),&Curve2D::set_bake_interval); + ClassDB::bind_method(_MD("get_bake_interval"),&Curve2D::get_bake_interval); + + ClassDB::bind_method(_MD("get_baked_length"),&Curve2D::get_baked_length); + ClassDB::bind_method(_MD("interpolate_baked","offset","cubic"),&Curve2D::interpolate_baked,DEFVAL(false)); + ClassDB::bind_method(_MD("get_baked_points"),&Curve2D::get_baked_points); + ClassDB::bind_method(_MD("tesselate","max_stages","tolerance_degrees"),&Curve2D::tesselate,DEFVAL(5),DEFVAL(4)); + + ClassDB::bind_method(_MD("_get_data"),&Curve2D::_get_data); + ClassDB::bind_method(_MD("_set_data"),&Curve2D::_set_data); ADD_PROPERTY( PropertyInfo( Variant::REAL, "bake_interval",PROPERTY_HINT_RANGE,"0.01,512,0.01"), _SCS("set_bake_interval"),_SCS("get_bake_interval")); @@ -930,6 +939,15 @@ void Curve3D::remove_point(int p_index) { emit_signal(CoreStringNames::get_singleton()->changed); } +void Curve3D::clear_points() { + + if (!points.empty()) { + points.clear(); + baked_cache_dirty=true; + emit_signal(CoreStringNames::get_singleton()->changed); + } +} + Vector3 Curve3D::interpolate(int p_index, float p_offset) const { int pc = points.size(); @@ -1072,11 +1090,11 @@ void Curve3D::_bake() const { pointlist.push_back(Plane(lastpos,lastilt)); baked_point_cache.resize(pointlist.size()); - Vector3Array::Write w = baked_point_cache.write(); + PoolVector3Array::Write w = baked_point_cache.write(); int idx=0; baked_tilt_cache.resize(pointlist.size()); - RealArray::Write wt = baked_tilt_cache.write(); + PoolRealArray::Write wt = baked_tilt_cache.write(); for(List<Plane>::Element *E=pointlist.front();E;E=E->next()) { @@ -1110,7 +1128,7 @@ Vector3 Curve3D::interpolate_baked(float p_offset,bool p_cubic) const{ return baked_point_cache.get(0); int bpc=baked_point_cache.size(); - Vector3Array::Read r = baked_point_cache.read(); + PoolVector3Array::Read r = baked_point_cache.read(); if (p_offset<0) return r[0]; @@ -1154,7 +1172,7 @@ float Curve3D::interpolate_baked_tilt(float p_offset) const{ return baked_tilt_cache.get(0); int bpc=baked_tilt_cache.size(); - RealArray::Read r = baked_tilt_cache.read(); + PoolRealArray::Read r = baked_tilt_cache.read(); if (p_offset<0) return r[0]; @@ -1178,7 +1196,7 @@ float Curve3D::interpolate_baked_tilt(float p_offset) const{ } -Vector3Array Curve3D::get_baked_points() const { +PoolVector3Array Curve3D::get_baked_points() const { if (baked_cache_dirty) _bake(); @@ -1187,7 +1205,7 @@ Vector3Array Curve3D::get_baked_points() const { } -RealArray Curve3D::get_baked_tilts() const { +PoolRealArray Curve3D::get_baked_tilts() const { if (baked_cache_dirty) _bake(); @@ -1213,12 +1231,12 @@ Dictionary Curve3D::_get_data() const { Dictionary dc; - Vector3Array d; + PoolVector3Array d; d.resize(points.size()*3); - Vector3Array::Write w = d.write(); - RealArray t; + PoolVector3Array::Write w = d.write(); + PoolRealArray t; t.resize(points.size()); - RealArray::Write wt = t.write(); + PoolRealArray::Write wt = t.write(); for(int i=0;i<points.size();i++) { @@ -1229,8 +1247,8 @@ Dictionary Curve3D::_get_data() const { wt[i]=points[i].tilt; } - w=Vector3Array::Write(); - wt=RealArray::Write(); + w=PoolVector3Array::Write(); + wt=PoolRealArray::Write(); dc["points"]=d; dc["tilts"]=t; @@ -1243,13 +1261,13 @@ void Curve3D::_set_data(const Dictionary& p_data){ ERR_FAIL_COND(!p_data.has("points")); ERR_FAIL_COND(!p_data.has("tilts")); - Vector3Array rp=p_data["points"]; + PoolVector3Array rp=p_data["points"]; int pc = rp.size(); ERR_FAIL_COND(pc%3!=0); points.resize(pc/3); - Vector3Array::Read r = rp.read(); - RealArray rtl=p_data["tilts"]; - RealArray::Read rt=rtl.read(); + PoolVector3Array::Read r = rp.read(); + PoolRealArray rtl=p_data["tilts"]; + PoolRealArray::Read rt=rtl.read(); for(int i=0;i<points.size();i++) { @@ -1264,9 +1282,9 @@ void Curve3D::_set_data(const Dictionary& p_data){ } -Vector3Array Curve3D::tesselate(int p_max_stages,float p_tolerance) const { +PoolVector3Array Curve3D::tesselate(int p_max_stages,float p_tolerance) const { - Vector3Array tess; + PoolVector3Array tess; if (points.size()==0) { @@ -1286,7 +1304,7 @@ Vector3Array Curve3D::tesselate(int p_max_stages,float p_tolerance) const { } tess.resize(pc); - Vector3Array::Write bpw=tess.write(); + PoolVector3Array::Write bpw=tess.write(); bpw[0]=points[0].pos; int pidx=0; @@ -1303,7 +1321,7 @@ Vector3Array Curve3D::tesselate(int p_max_stages,float p_tolerance) const { } - bpw=Vector3Array::Write (); + bpw=PoolVector3Array::Write (); return tess; @@ -1311,31 +1329,32 @@ Vector3Array Curve3D::tesselate(int p_max_stages,float p_tolerance) const { void Curve3D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_point_count"),&Curve3D::get_point_count); - ObjectTypeDB::bind_method(_MD("add_point","pos","in","out","atpos"),&Curve3D::add_point,DEFVAL(Vector3()),DEFVAL(Vector3()),DEFVAL(-1)); - ObjectTypeDB::bind_method(_MD("set_point_pos","idx","pos"),&Curve3D::set_point_pos); - ObjectTypeDB::bind_method(_MD("get_point_pos","idx"),&Curve3D::get_point_pos); - ObjectTypeDB::bind_method(_MD("set_point_tilt","idx","tilt"),&Curve3D::set_point_tilt); - ObjectTypeDB::bind_method(_MD("get_point_tilt","idx"),&Curve3D::get_point_tilt); - ObjectTypeDB::bind_method(_MD("set_point_in","idx","pos"),&Curve3D::set_point_in); - ObjectTypeDB::bind_method(_MD("get_point_in","idx"),&Curve3D::get_point_in); - ObjectTypeDB::bind_method(_MD("set_point_out","idx","pos"),&Curve3D::set_point_out); - ObjectTypeDB::bind_method(_MD("get_point_out","idx"),&Curve3D::get_point_out); - ObjectTypeDB::bind_method(_MD("remove_point","idx"),&Curve3D::remove_point); - ObjectTypeDB::bind_method(_MD("interpolate","idx","t"),&Curve3D::interpolate); - ObjectTypeDB::bind_method(_MD("interpolatef","fofs"),&Curve3D::interpolatef); - //ObjectTypeDB::bind_method(_MD("bake","subdivs"),&Curve3D::bake,DEFVAL(10)); - ObjectTypeDB::bind_method(_MD("set_bake_interval","distance"),&Curve3D::set_bake_interval); - ObjectTypeDB::bind_method(_MD("get_bake_interval"),&Curve3D::get_bake_interval); - - ObjectTypeDB::bind_method(_MD("get_baked_length"),&Curve3D::get_baked_length); - ObjectTypeDB::bind_method(_MD("interpolate_baked","offset","cubic"),&Curve3D::interpolate_baked,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("get_baked_points"),&Curve3D::get_baked_points); - ObjectTypeDB::bind_method(_MD("get_baked_tilts"),&Curve3D::get_baked_tilts); - ObjectTypeDB::bind_method(_MD("tesselate","max_stages","tolerance_degrees"),&Curve3D::tesselate,DEFVAL(5),DEFVAL(4)); - - ObjectTypeDB::bind_method(_MD("_get_data"),&Curve3D::_get_data); - ObjectTypeDB::bind_method(_MD("_set_data"),&Curve3D::_set_data); + ClassDB::bind_method(_MD("get_point_count"),&Curve3D::get_point_count); + ClassDB::bind_method(_MD("add_point","pos","in","out","atpos"),&Curve3D::add_point,DEFVAL(Vector3()),DEFVAL(Vector3()),DEFVAL(-1)); + ClassDB::bind_method(_MD("set_point_pos","idx","pos"),&Curve3D::set_point_pos); + ClassDB::bind_method(_MD("get_point_pos","idx"),&Curve3D::get_point_pos); + ClassDB::bind_method(_MD("set_point_tilt","idx","tilt"),&Curve3D::set_point_tilt); + ClassDB::bind_method(_MD("get_point_tilt","idx"),&Curve3D::get_point_tilt); + ClassDB::bind_method(_MD("set_point_in","idx","pos"),&Curve3D::set_point_in); + ClassDB::bind_method(_MD("get_point_in","idx"),&Curve3D::get_point_in); + ClassDB::bind_method(_MD("set_point_out","idx","pos"),&Curve3D::set_point_out); + ClassDB::bind_method(_MD("get_point_out","idx"),&Curve3D::get_point_out); + ClassDB::bind_method(_MD("remove_point","idx"),&Curve3D::remove_point); + ClassDB::bind_method(_MD("clear_points"),&Curve3D::clear_points); + ClassDB::bind_method(_MD("interpolate","idx","t"),&Curve3D::interpolate); + ClassDB::bind_method(_MD("interpolatef","fofs"),&Curve3D::interpolatef); + //ClassDB::bind_method(_MD("bake","subdivs"),&Curve3D::bake,DEFVAL(10)); + ClassDB::bind_method(_MD("set_bake_interval","distance"),&Curve3D::set_bake_interval); + ClassDB::bind_method(_MD("get_bake_interval"),&Curve3D::get_bake_interval); + + ClassDB::bind_method(_MD("get_baked_length"),&Curve3D::get_baked_length); + ClassDB::bind_method(_MD("interpolate_baked","offset","cubic"),&Curve3D::interpolate_baked,DEFVAL(false)); + ClassDB::bind_method(_MD("get_baked_points"),&Curve3D::get_baked_points); + ClassDB::bind_method(_MD("get_baked_tilts"),&Curve3D::get_baked_tilts); + ClassDB::bind_method(_MD("tesselate","max_stages","tolerance_degrees"),&Curve3D::tesselate,DEFVAL(5),DEFVAL(4)); + + ClassDB::bind_method(_MD("_get_data"),&Curve3D::_get_data); + ClassDB::bind_method(_MD("_set_data"),&Curve3D::_set_data); ADD_PROPERTY( PropertyInfo( Variant::REAL, "bake_interval",PROPERTY_HINT_RANGE,"0.01,512,0.01"), _SCS("set_bake_interval"),_SCS("get_bake_interval")); diff --git a/scene/resources/curve.h b/scene/resources/curve.h index 262f22b7d1..3362109354 100644 --- a/scene/resources/curve.h +++ b/scene/resources/curve.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ #if 0 class Curve2D : public Resource { - OBJ_TYPE(Curve2D,Resource); + GDCLASS(Curve2D,Resource); struct Point { @@ -72,7 +72,7 @@ public: Vector2 interpolate(int p_index, float p_offset) const; Vector2 interpolatef(real_t p_findex) const; - DVector<Point2> bake(int p_subdivs=10) const; + PoolVector<Point2> bake(int p_subdivs=10) const; void advance(real_t p_distance,int &r_index, real_t &r_pos) const; void get_approx_position_from_offset(real_t p_offset,int &r_index, real_t &r_pos,int p_subdivs=16) const; @@ -84,7 +84,7 @@ public: class Curve2D : public Resource { - OBJ_TYPE(Curve2D,Resource); + GDCLASS(Curve2D,Resource); struct Point { @@ -103,7 +103,7 @@ class Curve2D : public Resource { }; mutable bool baked_cache_dirty; - mutable Vector2Array baked_point_cache; + mutable PoolVector2Array baked_point_cache; mutable float baked_max_ofs; @@ -133,6 +133,7 @@ public: void set_point_out(int p_index, const Vector2& p_out); Vector2 get_point_out(int p_index) const; void remove_point(int p_index); + void clear_points(); Vector2 interpolate(int p_index, float p_offset) const; Vector2 interpolatef(real_t p_findex) const; @@ -144,9 +145,9 @@ public: float get_baked_length() const; Vector2 interpolate_baked(float p_offset,bool p_cubic=false) const; - Vector2Array get_baked_points() const; //useful for going thru + PoolVector2Array get_baked_points() const; //useful for going thru - Vector2Array tesselate(int p_max_stages=5,float p_tolerance=4) const; //useful for display + PoolVector2Array tesselate(int p_max_stages=5,float p_tolerance=4) const; //useful for display Curve2D(); @@ -156,7 +157,7 @@ public: class Curve3D : public Resource { - OBJ_TYPE(Curve3D,Resource); + GDCLASS(Curve3D,Resource); struct Point { @@ -178,8 +179,8 @@ class Curve3D : public Resource { }; mutable bool baked_cache_dirty; - mutable Vector3Array baked_point_cache; - mutable RealArray baked_tilt_cache; + mutable PoolVector3Array baked_point_cache; + mutable PoolRealArray baked_tilt_cache; mutable float baked_max_ofs; @@ -211,6 +212,7 @@ public: void set_point_out(int p_index, const Vector3& p_out); Vector3 get_point_out(int p_index) const; void remove_point(int p_index); + void clear_points(); Vector3 interpolate(int p_index, float p_offset) const; Vector3 interpolatef(real_t p_findex) const; @@ -223,10 +225,10 @@ public: float get_baked_length() const; Vector3 interpolate_baked(float p_offset,bool p_cubic=false) const; float interpolate_baked_tilt(float p_offset) const; - Vector3Array get_baked_points() const; //useful for going thru - RealArray get_baked_tilts() const; //useful for going thru + PoolVector3Array get_baked_points() const; //useful for going thru + PoolRealArray get_baked_tilts() const; //useful for going thru - Vector3Array tesselate(int p_max_stages=5,float p_tolerance=4) const; //useful for display + PoolVector3Array tesselate(int p_max_stages=5,float p_tolerance=4) const; //useful for display Curve3D(); diff --git a/scene/resources/default_theme/color_picker_hue.png b/scene/resources/default_theme/color_picker_hue.png Binary files differnew file mode 100644 index 0000000000..de2cd0c2bf --- /dev/null +++ b/scene/resources/default_theme/color_picker_hue.png diff --git a/scene/resources/default_theme/color_picker_sample.png b/scene/resources/default_theme/color_picker_sample.png Binary files differnew file mode 100644 index 0000000000..b145a3e384 --- /dev/null +++ b/scene/resources/default_theme/color_picker_sample.png diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 4c759bddef..3c6e65bf41 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -58,14 +58,14 @@ static Ref<StyleBoxTexture> make_stylebox(T p_src,float p_left, float p_top, flo if (scale>1) { Size2 orig_size = Size2(img.get_width(),img.get_height()); - img.convert(Image::FORMAT_RGBA); + img.convert(Image::FORMAT_RGBA8); img.expand_x2_hq2x(); if (scale!=2.0) { img.resize(orig_size.x*scale,orig_size.y*scale); } } else if (scale<1) { Size2 orig_size = Size2(img.get_width(),img.get_height()); - img.convert(Image::FORMAT_RGBA); + img.convert(Image::FORMAT_RGBA8); img.resize(orig_size.x*scale,orig_size.y*scale); } @@ -108,14 +108,14 @@ static Ref<Texture> make_icon(T p_src) { if (scale>1) { Size2 orig_size = Size2(img.get_width(),img.get_height()); - img.convert(Image::FORMAT_RGBA); + img.convert(Image::FORMAT_RGBA8); img.expand_x2_hq2x(); if (scale!=2.0) { img.resize(orig_size.x*scale,orig_size.y*scale); } } else if (scale<1) { Size2 orig_size = Size2(img.get_width(),img.get_height()); - img.convert(Image::FORMAT_RGBA); + img.convert(Image::FORMAT_RGBA8); img.resize(orig_size.x*scale,orig_size.y*scale); } texture->create_from_image( img,ImageTexture::FLAG_FILTER ); @@ -125,7 +125,7 @@ static Ref<Texture> make_icon(T p_src) { static Ref<Shader> make_shader(const char*vertex_code,const char*fragment_code,const char*lighting_code) { Ref<Shader> shader = (memnew( Shader(Shader::MODE_CANVAS_ITEM) )); - shader->set_code(vertex_code, fragment_code, lighting_code); +// shader->set_code(vertex_code, fragment_code, lighting_code); return shader; } @@ -214,6 +214,8 @@ static Ref<StyleBox> make_empty_stylebox(float p_margin_left=-1, float p_margin_ return style; } + + void fill_default_theme(Ref<Theme>& t, const Ref<Font> & default_font, const Ref<Font> & large_font, Ref<Texture>& default_icon, Ref<StyleBox>& default_style, float p_scale) { scale=p_scale; @@ -833,9 +835,8 @@ void fill_default_theme(Ref<Theme>& t, const Ref<Font> & default_font, const Ref t->set_icon("screen_picker","ColorPicker", make_icon( icon_color_pick_png ) ); t->set_icon("add_preset","ColorPicker", make_icon( icon_add_png ) ); - - t->set_shader("uv_editor", "ColorPicker", make_shader("", uv_editor_shader_code, "")); - t->set_shader("w_editor", "ColorPicker", make_shader("", w_editor_shader_code, "")); + t->set_icon("color_hue", "ColorPicker", make_icon( color_picker_hue_png)); + t->set_icon("color_sample", "ColorPicker", make_icon( color_picker_sample_png)); // TooltipPanel @@ -899,10 +900,9 @@ void fill_default_theme(Ref<Theme>& t, const Ref<Font> & default_font, const Ref // HButtonArray - - t->set_stylebox("normal","HButtonArray", make_stylebox( button_normal_png,4,4,4,4,0,4,22,4) ); - t->set_stylebox("selected","HButtonArray", make_stylebox( button_pressed_png,4,4,4,4,0,4,22,4) ); - t->set_stylebox("hover","HButtonArray", make_stylebox( button_hover_png,4,4,4,4) ); + t->set_stylebox("normal","HButtonArray", sb_button_normal); + t->set_stylebox("selected","HButtonArray", sb_button_pressed); + t->set_stylebox("hover","HButtonArray", sb_button_hover); t->set_font("font","HButtonArray", default_font); t->set_font("font_selected","HButtonArray", default_font); @@ -910,17 +910,17 @@ void fill_default_theme(Ref<Theme>& t, const Ref<Font> & default_font, const Ref t->set_color("font_color","HButtonArray", control_font_color_low ); t->set_color("font_color_selected","HButtonArray", control_font_color_hover ); - t->set_constant("icon_separator","HButtonArray", 4 *scale ); - t->set_constant("button_separator","HButtonArray", 8 *scale ); + t->set_constant("icon_separator","HButtonArray", 2 *scale ); + t->set_constant("button_separator","HButtonArray", 4 *scale ); t->set_stylebox("focus","HButtonArray", focus ); // VButtonArray - t->set_stylebox("normal","VButtonArray", make_stylebox( button_normal_png,4,4,4,4,0,4,22,4) ); - t->set_stylebox("selected","VButtonArray", make_stylebox( button_pressed_png,4,4,4,4,0,4,22,4) ); - t->set_stylebox("hover","VButtonArray", make_stylebox( button_hover_png,4,4,4,4) ); + t->set_stylebox("normal","VButtonArray", sb_button_normal); + t->set_stylebox("selected","VButtonArray", sb_button_pressed); + t->set_stylebox("hover","VButtonArray", sb_button_hover); t->set_font("font","VButtonArray", default_font); t->set_font("font_selected","VButtonArray", default_font); @@ -928,8 +928,8 @@ void fill_default_theme(Ref<Theme>& t, const Ref<Font> & default_font, const Ref t->set_color("font_color","VButtonArray", control_font_color_low ); t->set_color("font_color_selected","VButtonArray", control_font_color_hover ); - t->set_constant("icon_separator","VButtonArray", 4 *scale); - t->set_constant("button_separator","VButtonArray", 8 *scale); + t->set_constant("icon_separator","VButtonArray", 2 *scale); + t->set_constant("button_separator","VButtonArray", 4 *scale); t->set_stylebox("focus","VButtonArray", focus ); @@ -963,7 +963,6 @@ void fill_default_theme(Ref<Theme>& t, const Ref<Font> & default_font, const Ref t->set_icon( "logo","Icons", make_icon(logo_png) ); - // Theme default_icon= make_icon(error_icon_png) ; diff --git a/scene/resources/default_theme/default_theme.h b/scene/resources/default_theme/default_theme.h index 3312b2d812..01141ed0a0 100644 --- a/scene/resources/default_theme/default_theme.h +++ b/scene/resources/default_theme/default_theme.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/default_theme/make_header.py b/scene/resources/default_theme/make_header.py index 68c9e92527..68c9e92527 100644..100755 --- a/scene/resources/default_theme/make_header.py +++ b/scene/resources/default_theme/make_header.py diff --git a/scene/resources/default_theme/theme_data.h b/scene/resources/default_theme/theme_data.h index 73c801483f..46fd770a27 100644 --- a/scene/resources/default_theme/theme_data.h +++ b/scene/resources/default_theme/theme_data.h @@ -69,6 +69,16 @@ static const unsigned char close_hl_png[]={ }; +static const unsigned char color_picker_hue_png[]={ +0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x1,0x0,0x0,0x1,0x0,0x8,0x2,0x0,0x0,0x0,0xfd,0x5c,0x8b,0xcf,0x0,0x0,0x0,0x59,0x49,0x44,0x41,0x54,0x28,0x91,0xcd,0xd0,0x31,0xa,0x3,0x31,0x10,0x43,0xd1,0x87,0xc0,0xf6,0xfd,0x8f,0x1b,0xdb,0x30,0x69,0x76,0x21,0x65,0xd8,0x14,0x71,0xf1,0xf9,0x8c,0x84,0x9a,0x51,0x44,0x13,0xfd,0x21,0xe3,0x87,0xed,0xf7,0xa8,0xcd,0x2a,0x99,0x8e,0x46,0x2b,0x94,0xd0,0x43,0xb,0xe3,0x64,0xb3,0x2a,0xa6,0x93,0xb9,0x9f,0x9a,0x4e,0x3a,0x69,0x97,0xc7,0xe5,0x3b,0x1b,0xff,0xef,0x6d,0xa5,0xec,0x30,0xc3,0xeb,0xf2,0xc,0xeb,0xe3,0x5e,0x27,0xf4,0x8a,0x37,0x75,0x7b,0x8a,0xe5,0x90,0x9a,0xab,0x81,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82 +}; + + +static const unsigned char color_picker_sample_png[]={ +0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x1,0x0,0x0,0x0,0x0,0x14,0x8,0x2,0x0,0x0,0x0,0xed,0x20,0x74,0x8,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x13,0x0,0x0,0xb,0x13,0x1,0x0,0x9a,0x9c,0x18,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xe0,0x9,0x18,0xc,0x27,0x37,0x29,0x4f,0x42,0x2d,0x0,0x0,0x0,0x61,0x49,0x44,0x41,0x54,0x68,0xde,0xed,0xd9,0xb1,0xd,0x0,0x21,0xc,0x3,0x40,0x40,0xbf,0x5f,0x66,0xcd,0x84,0xf9,0x96,0x19,0xf0,0x5d,0x87,0x5c,0x5b,0x9,0xca,0x9e,0x99,0x75,0xe9,0xee,0xfb,0x59,0x55,0x52,0xe9,0xc3,0xe9,0x59,0x10,0x4c,0x1,0x50,0x0,0x50,0x0,0x8,0xf4,0xf9,0x15,0x49,0x93,0x53,0x13,0x0,0x2b,0x10,0x28,0x0,0x28,0x0,0x64,0xd9,0x2e,0xc1,0xd2,0xe4,0xd4,0x4,0xc0,0xa,0x4,0xa,0x0,0xa,0x0,0x59,0x5c,0x82,0xa5,0xd1,0xa9,0x9,0x80,0x15,0x8,0x14,0x0,0x14,0x0,0xb2,0xfc,0x5b,0xb2,0x3c,0x5a,0x4,0xa1,0xf3,0x57,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82 +}; + + static const unsigned char dosfont_png[]={ 0x89,0x50,0x4e,0x47,0xd,0xa,0x1a,0xa,0x0,0x0,0x0,0xd,0x49,0x48,0x44,0x52,0x0,0x0,0x0,0x80,0x0,0x0,0x0,0x80,0x1,0x0,0x0,0x0,0x0,0xeb,0x45,0x5c,0x66,0x0,0x0,0x0,0x4,0x67,0x41,0x4d,0x41,0x0,0x0,0xb1,0x8f,0xb,0xfc,0x61,0x5,0x0,0x0,0x0,0x20,0x63,0x48,0x52,0x4d,0x0,0x0,0x7a,0x26,0x0,0x0,0x80,0x84,0x0,0x0,0xfa,0x0,0x0,0x0,0x80,0xe8,0x0,0x0,0x75,0x30,0x0,0x0,0xea,0x60,0x0,0x0,0x3a,0x98,0x0,0x0,0x17,0x70,0x9c,0xba,0x51,0x3c,0x0,0x0,0x0,0x2,0x74,0x52,0x4e,0x53,0x0,0x0,0x76,0x93,0xcd,0x38,0x0,0x0,0x0,0x2,0x62,0x4b,0x47,0x44,0x0,0x1,0xdd,0x8a,0x13,0xa4,0x0,0x0,0x0,0x9,0x70,0x48,0x59,0x73,0x0,0x0,0xb,0x89,0x0,0x0,0xb,0x89,0x1,0x37,0xc9,0xcb,0xad,0x0,0x0,0x0,0x7,0x74,0x49,0x4d,0x45,0x7,0xe0,0x6,0x16,0x12,0x2b,0x5,0x39,0x1a,0x32,0x39,0x0,0x0,0x2,0x83,0x49,0x44,0x41,0x54,0x48,0xc7,0xed,0xd4,0xb1,0x6e,0xdb,0x30,0x10,0x0,0x50,0x22,0x3,0x27,0x22,0xc8,0x78,0x83,0x91,0xa9,0x1f,0xc0,0xa9,0x10,0xa,0x7e,0xc,0x11,0x14,0x87,0xc,0x1c,0x32,0x9,0x1a,0xe,0x46,0xa6,0xfc,0x43,0xff,0x86,0xb5,0x80,0x9b,0x88,0x8e,0x5d,0x64,0x18,0x9e,0xdc,0xd5,0x53,0x91,0xc1,0xa0,0x7a,0xa4,0xe4,0xd4,0x31,0xd2,0x25,0x70,0x97,0xa2,0x37,0x48,0xe6,0x33,0x45,0xdd,0x51,0x24,0x95,0x7a,0x23,0xe0,0x75,0x13,0xb,0xd8,0x93,0xbf,0x51,0x51,0xa3,0xac,0x99,0xc9,0x29,0x87,0x81,0x83,0xb2,0x0,0xc7,0xfe,0xee,0x43,0x58,0x85,0x95,0xb7,0xa6,0xb6,0xaf,0x7a,0xe9,0x93,0x63,0xc3,0xf2,0xc,0x96,0x3e,0xba,0x97,0x11,0x3,0xb5,0x46,0xc0,0x15,0x30,0x43,0x1,0xbd,0x6,0x81,0x71,0xa9,0xb2,0x82,0x9,0x92,0x3d,0xf6,0xb0,0xbd,0x5c,0xf2,0x53,0xf2,0x75,0xc,0x11,0x5f,0xc7,0xe0,0xc4,0xaa,0xb4,0x40,0x41,0xc4,0x69,0xd0,0x27,0x55,0x12,0x13,0x78,0x74,0xa7,0xb5,0xd8,0x3f,0x14,0x77,0x81,0x0,0x22,0x93,0x9b,0x4c,0x54,0x5b,0x72,0x6d,0x98,0x17,0xd1,0x33,0xb3,0x94,0xaa,0x3c,0x93,0xea,0xb4,0x76,0x31,0x6a,0x66,0x0,0xa9,0x59,0x1c,0x8c,0xe,0x33,0xc0,0x12,0x4c,0x29,0xc2,0xa5,0xc3,0xc1,0xd0,0xb2,0x64,0x6a,0x60,0xa3,0xc0,0xea,0xac,0x19,0x58,0x4b,0xa9,0x4a,0x17,0xf0,0xda,0x68,0xb6,0x5,0xec,0xb2,0xf6,0x88,0x33,0xc8,0x18,0x52,0xd5,0x5a,0x1,0xb3,0x61,0x1,0x53,0xdf,0x2,0x51,0x2d,0x33,0xdd,0x12,0x59,0xea,0x94,0x95,0x3c,0x80,0x2e,0x5e,0xf9,0xdb,0x71,0x73,0x70,0xcf,0x39,0x3b,0x76,0xb7,0xbb,0x7d,0xcf,0x74,0x50,0xd,0x62,0x40,0x44,0x6,0x83,0xfe,0xc7,0x8e,0x51,0x5,0x5c,0xe1,0xdd,0xdd,0xaa,0xc2,0xf8,0x53,0x80,0x31,0xe2,0xfd,0x7d,0x14,0x8,0x7e,0xcc,0x5,0x28,0x62,0xd7,0xc5,0xc,0xa6,0xf3,0xc3,0x46,0xa6,0x30,0xd7,0x1e,0x1b,0x2e,0xd0,0x7f,0x63,0x5f,0x1f,0xf1,0x32,0xc9,0x90,0x82,0xef,0xb9,0x82,0xc,0x5a,0x1,0xef,0x66,0x90,0xd7,0x7a,0x2c,0x80,0x13,0x94,0xc4,0xf6,0x9f,0xd8,0x75,0xbb,0x2c,0x89,0xed,0xff,0x42,0xe9,0xa7,0xfb,0xa4,0x84,0xec,0x13,0x45,0x7,0x1a,0xb9,0x97,0x18,0x65,0xab,0x4,0xf9,0x54,0x8c,0x3c,0x54,0xe8,0xed,0xa3,0x7c,0x7b,0x55,0xe0,0x8b,0x0,0xf6,0x4f,0x36,0xd6,0x3d,0xc3,0xe8,0x41,0xc0,0xa1,0xb1,0xdb,0x9,0xa8,0x29,0x0,0xe,0xec,0xc3,0x4,0xc1,0x8,0xc,0x0,0xd6,0x36,0xf3,0x23,0xba,0x80,0x3,0x6f,0x17,0x15,0xbe,0x4b,0xe5,0x8c,0x23,0xc2,0x57,0x7b,0x5d,0x61,0x53,0xc0,0x61,0xf,0xbd,0xd5,0x15,0x68,0x47,0x8e,0x0,0x7b,0x37,0xba,0xab,0xba,0x59,0xcc,0x79,0x3d,0xd7,0xaf,0x5a,0xe3,0x85,0x66,0x69,0xab,0x16,0x32,0x31,0x5b,0xd0,0xdb,0x66,0x2,0x2f,0x6f,0xe,0xb2,0x42,0xb5,0x87,0xdf,0xf0,0x59,0xae,0x6a,0x86,0xae,0x93,0x4c,0x7d,0x1b,0x9a,0x6b,0x84,0xdd,0x9a,0xd6,0xca,0xc8,0x89,0xc3,0xfb,0xd4,0x82,0xe,0x30,0xa2,0x2c,0x18,0xc2,0x98,0xb2,0x4f,0x8,0xba,0x83,0xa1,0x40,0x12,0x88,0x6f,0x43,0x38,0x82,0x1c,0x1f,0x15,0x70,0x82,0x96,0xa8,0xa5,0x3d,0xed,0x9c,0xde,0xb9,0x1,0xe9,0xb8,0x5f,0x4c,0x39,0xd2,0xa6,0xac,0xa6,0x48,0xe7,0xd0,0x95,0x53,0xb0,0xc4,0x7b,0x97,0xd4,0xcd,0x3c,0xdd,0xf0,0xd0,0x4e,0xbf,0xe6,0x65,0x24,0x5b,0x7b,0x7d,0xe,0xe5,0xd6,0xae,0xe9,0x90,0x64,0xfd,0x70,0x9e,0x21,0xb5,0x6c,0x5,0xa4,0xa2,0x87,0xe9,0xa3,0x25,0xf4,0x5,0x5c,0x39,0x61,0xa6,0x1e,0xbe,0x11,0x18,0x80,0xed,0xb,0x18,0x9b,0x70,0x70,0xec,0x5f,0x80,0x3f,0x26,0x27,0xb3,0xc9,0x33,0xc8,0x5c,0x2c,0x5a,0x59,0x1f,0xcb,0x2c,0x89,0x9d,0xae,0xf,0x7d,0xcc,0xdb,0x9c,0xdd,0xd5,0xed,0x7c,0x7f,0xbe,0xd0,0x52,0xf9,0x1f,0xff,0x76,0xfc,0x2,0x24,0x3a,0x65,0x42,0xf6,0x41,0x91,0x95,0x0,0x0,0x0,0x19,0x74,0x45,0x58,0x74,0x43,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x0,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x77,0x69,0x74,0x68,0x20,0x47,0x49,0x4d,0x50,0x57,0x81,0xe,0x17,0x0,0x0,0x0,0x25,0x74,0x45,0x58,0x74,0x64,0x61,0x74,0x65,0x3a,0x63,0x72,0x65,0x61,0x74,0x65,0x0,0x32,0x30,0x31,0x36,0x2d,0x30,0x36,0x2d,0x32,0x32,0x54,0x32,0x30,0x3a,0x33,0x39,0x3a,0x32,0x36,0x2b,0x30,0x32,0x3a,0x30,0x30,0xc9,0xad,0xc8,0x52,0x0,0x0,0x0,0x25,0x74,0x45,0x58,0x74,0x64,0x61,0x74,0x65,0x3a,0x6d,0x6f,0x64,0x69,0x66,0x79,0x0,0x32,0x30,0x31,0x36,0x2d,0x30,0x36,0x2d,0x32,0x32,0x54,0x32,0x30,0x3a,0x33,0x39,0x3a,0x32,0x36,0x2b,0x30,0x32,0x3a,0x30,0x30,0xb8,0xf0,0x70,0xee,0x0,0x0,0x0,0x0,0x49,0x45,0x4e,0x44,0xae,0x42,0x60,0x82 }; @@ -562,39 +572,3 @@ static const unsigned char window_resizer_png[]={ -static const char *uv_editor_shader_code= - "vec3 nd1sl2=vec3(UV,0);" - "uniform float H=0;" - "float nd4sl0=H;" - "float nd7sl0=nd1sl2.x;" - "float nd7sl1=nd1sl2.y;" - "float nd7sl2=nd1sl2.z;" - "float nd2sl1def=-1;" - "float nd2sl0=nd7sl1*nd2sl1def;" - "float nd6sl1def=1;" - "float nd6sl0=nd2sl0+nd6sl1def;" - "vec3 nd3sl0=vec3(nd4sl0,nd7sl0,nd6sl0);" - "vec3 nd5sl0;" - "{" - " vec3 c = nd3sl0;" - " vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);" - " vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);" - " nd5sl0=c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);" - "}" - "COLOR.rgb=nd5sl0;"; - - -static const char *w_editor_shader_code= - "vec3 nd1sl2=vec3(UV,0);" - "float nd2sl1=1-nd1sl2.y;" - "vec3 nd3sl0=vec3(nd2sl1,1,1);" - "vec3 nd6sl0;" - "{" - " vec3 c = nd3sl0;" - " vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);" - " vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);" - " nd6sl0=c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);" - "}" - "COLOR.rgb=nd6sl0;"; - - diff --git a/scene/resources/default_theme/uv_editor.gsl b/scene/resources/default_theme/uv_editor.gsl deleted file mode 100644 index 8c24e76dd5..0000000000 --- a/scene/resources/default_theme/uv_editor.gsl +++ /dev/null @@ -1,19 +0,0 @@ -vec3 nd1sl2=vec3(UV,0);
-uniform float H=0;
-float nd4sl0=H;
-float nd7sl0=nd1sl2.x;
-float nd7sl1=nd1sl2.y;
-float nd7sl2=nd1sl2.z;
-float nd2sl1def=-1;
-float nd2sl0=nd7sl1*nd2sl1def;
-float nd6sl1def=1;
-float nd6sl0=nd2sl0+nd6sl1def;
-vec3 nd3sl0=vec3(nd4sl0,nd7sl0,nd6sl0);
-vec3 nd5sl0;
-{
- vec3 c = nd3sl0;
- vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
- vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
- nd5sl0=c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
-}
-COLOR.rgb=nd5sl0;
\ No newline at end of file diff --git a/scene/resources/default_theme/w_editor.gsl b/scene/resources/default_theme/w_editor.gsl deleted file mode 100644 index 6d2dd9a0bb..0000000000 --- a/scene/resources/default_theme/w_editor.gsl +++ /dev/null @@ -1,11 +0,0 @@ -vec3 nd1sl2=vec3(UV,0);
-float nd2sl1=1-nd1sl2.y;
-vec3 nd3sl0=vec3(nd2sl1,1,1);
-vec3 nd6sl0;
-{
- vec3 c = nd3sl0;
- vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
- vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
- nd6sl0=c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
-}
-COLOR.rgb=nd6sl0;
\ No newline at end of file diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp index 679c8a000c..3aadbdbe19 100644 --- a/scene/resources/dynamic_font.cpp +++ b/scene/resources/dynamic_font.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -84,8 +84,8 @@ void DynamicFontData::set_force_autohinter(bool p_force) { } void DynamicFontData::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_font_path","path"),&DynamicFontData::set_font_path); - ObjectTypeDB::bind_method(_MD("get_font_path"),&DynamicFontData::get_font_path); + ClassDB::bind_method(_MD("set_font_path","path"),&DynamicFontData::set_font_path); + ClassDB::bind_method(_MD("get_font_path"),&DynamicFontData::get_font_path); ADD_PROPERTY(PropertyInfo(Variant::STRING,"font_path",PROPERTY_HINT_FILE,"*.ttf,*.otf"),_SCS("set_font_path"),_SCS("get_font_path")); } @@ -535,7 +535,7 @@ void DynamicFontAtSize::_update_char(CharType p_char) { { //zero texture - DVector<uint8_t>::Write w = tex.imgdata.write(); + PoolVector<uint8_t>::Write w = tex.imgdata.write(); ERR_FAIL_COND(texsize*texsize*2 > tex.imgdata.size()); for(int i=0;i<texsize*texsize*2;i++) { w[i]=0; @@ -556,7 +556,7 @@ void DynamicFontAtSize::_update_char(CharType p_char) { CharTexture &tex=textures[tex_index]; { - DVector<uint8_t>::Write wr = tex.imgdata.write(); + PoolVector<uint8_t>::Write wr = tex.imgdata.write(); for(int i=0;i<h;i++) { @@ -573,7 +573,7 @@ void DynamicFontAtSize::_update_char(CharType p_char) { //blit to image and texture { - Image img(tex.texture_size,tex.texture_size,0,Image::FORMAT_GRAYSCALE_ALPHA,tex.imgdata); + Image img(tex.texture_size,tex.texture_size,0,Image::FORMAT_LA8,tex.imgdata); if (tex.texture.is_null()) { tex.texture.instance(); @@ -879,34 +879,37 @@ void DynamicFont::_get_property_list( List<PropertyInfo> *p_list) const{ void DynamicFont::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_font_data","data:DynamicFontData"),&DynamicFont::set_font_data); - ObjectTypeDB::bind_method(_MD("get_font_data:DynamicFontData"),&DynamicFont::get_font_data); - - ObjectTypeDB::bind_method(_MD("set_size","data"),&DynamicFont::set_size); - ObjectTypeDB::bind_method(_MD("get_size"),&DynamicFont::get_size); - - ObjectTypeDB::bind_method(_MD("set_use_mipmaps","enable"),&DynamicFont::set_use_mipmaps); - ObjectTypeDB::bind_method(_MD("get_use_mipmaps"),&DynamicFont::get_use_mipmaps); - ObjectTypeDB::bind_method(_MD("set_use_filter","enable"),&DynamicFont::set_use_filter); - ObjectTypeDB::bind_method(_MD("get_use_filter"),&DynamicFont::get_use_filter); - ObjectTypeDB::bind_method(_MD("set_spacing","type","value"),&DynamicFont::set_spacing); - ObjectTypeDB::bind_method(_MD("get_spacing","type"),&DynamicFont::get_spacing); - - ObjectTypeDB::bind_method(_MD("add_fallback","data:DynamicFontData"),&DynamicFont::add_fallback); - ObjectTypeDB::bind_method(_MD("set_fallback","idx","data:DynamicFontData"),&DynamicFont::set_fallback); - ObjectTypeDB::bind_method(_MD("get_fallback:DynamicFontData","idx"),&DynamicFont::get_fallback); - ObjectTypeDB::bind_method(_MD("remove_fallback","idx"),&DynamicFont::remove_fallback); - ObjectTypeDB::bind_method(_MD("get_fallback_count"),&DynamicFont::get_fallback_count); - - - ADD_PROPERTY(PropertyInfo(Variant::INT,"font/size"),_SCS("set_size"),_SCS("get_size")); - ADD_PROPERTYINZ(PropertyInfo(Variant::INT,"extra_spacing/top"),_SCS("set_spacing"),_SCS("get_spacing"),SPACING_TOP); - ADD_PROPERTYINZ(PropertyInfo(Variant::INT,"extra_spacing/bottom"),_SCS("set_spacing"),_SCS("get_spacing"),SPACING_BOTTOM); - ADD_PROPERTYINZ(PropertyInfo(Variant::INT,"extra_spacing/char"),_SCS("set_spacing"),_SCS("get_spacing"),SPACING_CHAR); - ADD_PROPERTYINZ(PropertyInfo(Variant::INT,"extra_spacing/space"),_SCS("set_spacing"),_SCS("get_spacing"),SPACING_SPACE); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"font/use_mipmaps"),_SCS("set_use_mipmaps"),_SCS("get_use_mipmaps")); - ADD_PROPERTY(PropertyInfo(Variant::BOOL,"font/use_filter"),_SCS("set_use_filter"),_SCS("get_use_filter")); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"font/font",PROPERTY_HINT_RESOURCE_TYPE,"DynamicFontData"),_SCS("set_font_data"),_SCS("get_font_data")); + ClassDB::bind_method(_MD("set_font_data","data:DynamicFontData"),&DynamicFont::set_font_data); + ClassDB::bind_method(_MD("get_font_data:DynamicFontData"),&DynamicFont::get_font_data); + + ClassDB::bind_method(_MD("set_size","data"),&DynamicFont::set_size); + ClassDB::bind_method(_MD("get_size"),&DynamicFont::get_size); + + ClassDB::bind_method(_MD("set_use_mipmaps","enable"),&DynamicFont::set_use_mipmaps); + ClassDB::bind_method(_MD("get_use_mipmaps"),&DynamicFont::get_use_mipmaps); + ClassDB::bind_method(_MD("set_use_filter","enable"),&DynamicFont::set_use_filter); + ClassDB::bind_method(_MD("get_use_filter"),&DynamicFont::get_use_filter); + ClassDB::bind_method(_MD("set_spacing","type","value"),&DynamicFont::set_spacing); + ClassDB::bind_method(_MD("get_spacing","type"),&DynamicFont::get_spacing); + + ClassDB::bind_method(_MD("add_fallback","data:DynamicFontData"),&DynamicFont::add_fallback); + ClassDB::bind_method(_MD("set_fallback","idx","data:DynamicFontData"),&DynamicFont::set_fallback); + ClassDB::bind_method(_MD("get_fallback:DynamicFontData","idx"),&DynamicFont::get_fallback); + ClassDB::bind_method(_MD("remove_fallback","idx"),&DynamicFont::remove_fallback); + ClassDB::bind_method(_MD("get_fallback_count"),&DynamicFont::get_fallback_count); + + + ADD_GROUP("Settings",""); + ADD_PROPERTY(PropertyInfo(Variant::INT,"size"),_SCS("set_size"),_SCS("get_size")); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"use_mipmaps"),_SCS("set_use_mipmaps"),_SCS("get_use_mipmaps")); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"use_filter"),_SCS("set_use_filter"),_SCS("get_use_filter")); + ADD_GROUP("Extra Spacing","extra_spacing"); + ADD_PROPERTYINZ(PropertyInfo(Variant::INT,"extra_spacing_top"),_SCS("set_spacing"),_SCS("get_spacing"),SPACING_TOP); + ADD_PROPERTYINZ(PropertyInfo(Variant::INT,"extra_spacing_bottom"),_SCS("set_spacing"),_SCS("get_spacing"),SPACING_BOTTOM); + ADD_PROPERTYINZ(PropertyInfo(Variant::INT,"extra_spacing_char"),_SCS("set_spacing"),_SCS("get_spacing"),SPACING_CHAR); + ADD_PROPERTYINZ(PropertyInfo(Variant::INT,"extra_spacing_space"),_SCS("set_spacing"),_SCS("get_spacing"),SPACING_SPACE); + ADD_GROUP("Font",""); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"font_data",PROPERTY_HINT_RESOURCE_TYPE,"DynamicFontData"),_SCS("set_font_data"),_SCS("get_font_data")); BIND_CONSTANT( SPACING_TOP ); BIND_CONSTANT( SPACING_BOTTOM ); diff --git a/scene/resources/dynamic_font.h b/scene/resources/dynamic_font.h index 4ae58ab0dd..321ec7e332 100644 --- a/scene/resources/dynamic_font.h +++ b/scene/resources/dynamic_font.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -43,7 +43,7 @@ class DynamicFont; class DynamicFontData : public Resource { - OBJ_TYPE(DynamicFontData,Resource); + GDCLASS(DynamicFontData,Resource); public: @@ -88,7 +88,7 @@ public: class DynamicFontAtSize : public Reference { - OBJ_TYPE(DynamicFontAtSize,Reference) + GDCLASS(DynamicFontAtSize,Reference) _THREAD_SAFE_CLASS_ @@ -107,7 +107,7 @@ class DynamicFontAtSize : public Reference { struct CharTexture { - DVector<uint8_t> imgdata; + PoolVector<uint8_t> imgdata; int texture_size; Vector<int> offsets; Ref<ImageTexture> texture; @@ -168,7 +168,7 @@ public: class DynamicFont : public Font { - OBJ_TYPE( DynamicFont, Font ); + GDCLASS( DynamicFont, Font ); public: diff --git a/scene/resources/dynamic_font_stb.cpp b/scene/resources/dynamic_font_stb.cpp index 456e6a5ee7..a25667d85a 100644 --- a/scene/resources/dynamic_font_stb.cpp +++ b/scene/resources/dynamic_font_stb.cpp @@ -26,10 +26,10 @@ void DynamicFontData::lock() { void DynamicFontData::unlock() { - fr = DVector<uint8_t>::Read(); + fr = PoolVector<uint8_t>::Read(); } -void DynamicFontData::set_font_data(const DVector<uint8_t>& p_font) { +void DynamicFontData::set_font_data(const PoolVector<uint8_t>& p_font) { //clear caches and stuff ERR_FAIL_COND(font_data.size()) ; font_data=p_font; @@ -284,7 +284,7 @@ void DynamicFontAtSize::_update_char(CharType p_char) { { //zero texture - DVector<uint8_t>::Write w = tex.imgdata.write(); + PoolVector<uint8_t>::Write w = tex.imgdata.write(); ERR_FAIL_COND(texsize*texsize*2 > tex.imgdata.size()); for(int i=0;i<texsize*texsize*2;i++) { w[i]=0; @@ -305,7 +305,7 @@ void DynamicFontAtSize::_update_char(CharType p_char) { CharTexture &tex=textures[tex_index]; { - DVector<uint8_t>::Write wr = tex.imgdata.write(); + PoolVector<uint8_t>::Write wr = tex.imgdata.write(); for(int i=0;i<h;i++) { for(int j=0;j<w;j++) { @@ -321,7 +321,7 @@ void DynamicFontAtSize::_update_char(CharType p_char) { //blit to image and texture { - Image img(tex.texture_size,tex.texture_size,0,Image::FORMAT_GRAYSCALE_ALPHA,tex.imgdata); + Image img(tex.texture_size,tex.texture_size,0,Image::FORMAT_LA8,tex.imgdata); if (tex.texture.is_null()) { tex.texture.instance(); @@ -378,11 +378,11 @@ DynamicFontAtSize::~DynamicFontAtSize(){ void DynamicFont::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_font_data","data:DynamicFontData"),&DynamicFont::set_font_data); - ObjectTypeDB::bind_method(_MD("get_font_data:DynamicFontData"),&DynamicFont::get_font_data); + ClassDB::bind_method(_MD("set_font_data","data:DynamicFontData"),&DynamicFont::set_font_data); + ClassDB::bind_method(_MD("get_font_data:DynamicFontData"),&DynamicFont::get_font_data); - ObjectTypeDB::bind_method(_MD("set_size","data"),&DynamicFont::set_size); - ObjectTypeDB::bind_method(_MD("get_size"),&DynamicFont::get_size); + ClassDB::bind_method(_MD("set_size","data"),&DynamicFont::set_size); + ClassDB::bind_method(_MD("get_size"),&DynamicFont::get_size); ADD_PROPERTY(PropertyInfo(Variant::INT,"font/size"),_SCS("set_size"),_SCS("get_size")); ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"font/font",PROPERTY_HINT_RESOURCE_TYPE,"DynamicFontData"),_SCS("set_font_data"),_SCS("get_font_data")); @@ -485,14 +485,14 @@ RES ResourceFormatLoaderDynamicFont::load(const String &p_path, const String& p_ FileAccess *f = FileAccess::open(p_path,FileAccess::READ); ERR_FAIL_COND_V(!f,RES()); - DVector<uint8_t> data; + PoolVector<uint8_t> data; data.resize(f->get_len()); ERR_FAIL_COND_V(data.size()==0,RES()); { - DVector<uint8_t>::Write w = data.write(); + PoolVector<uint8_t>::Write w = data.write(); f->get_buffer(w.ptr(),data.size()); } diff --git a/scene/resources/dynamic_font_stb.h b/scene/resources/dynamic_font_stb.h index 136edff2fc..07a3e5ee6c 100644 --- a/scene/resources/dynamic_font_stb.h +++ b/scene/resources/dynamic_font_stb.h @@ -14,12 +14,12 @@ class DynamicFont; class DynamicFontData : public Resource { - OBJ_TYPE(DynamicFontData,Resource); + GDCLASS(DynamicFontData,Resource); bool valid; - DVector<uint8_t> font_data; - DVector<uint8_t>::Read fr; + PoolVector<uint8_t> font_data; + PoolVector<uint8_t>::Read fr; const uint8_t* last_data_ptr; struct KerningPairKey { @@ -56,7 +56,7 @@ friend class DynamicFont; Ref<DynamicFontAtSize> _get_dynamic_font_at_size(int p_size); public: - void set_font_data(const DVector<uint8_t>& p_font); + void set_font_data(const PoolVector<uint8_t>& p_font); DynamicFontData(); ~DynamicFontData(); }; @@ -64,14 +64,14 @@ public: class DynamicFontAtSize : public Reference { - OBJ_TYPE(DynamicFontAtSize,Reference); + GDCLASS(DynamicFontAtSize,Reference); int rect_margin; struct CharTexture { - DVector<uint8_t> imgdata; + PoolVector<uint8_t> imgdata; int texture_size; Vector<int> offsets; Ref<ImageTexture> texture; @@ -124,7 +124,7 @@ public: class DynamicFont : public Font { - OBJ_TYPE( DynamicFont, Font ); + GDCLASS( DynamicFont, Font ); Ref<DynamicFontData> data; Ref<DynamicFontAtSize> data_at_size; diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp index 4551aff0ef..ffc0a38fc2 100644 --- a/scene/resources/environment.cpp +++ b/scene/resources/environment.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -28,267 +28,1026 @@ /*************************************************************************/ #include "environment.h" #include "texture.h" -void Environment::set_background(BG p_bg) { +#include "globals.h" +#include "servers/visual_server.h" + +RID Environment::get_rid() const { + + return environment; +} + + +void Environment::set_background(BGMode p_bg) { - ERR_FAIL_INDEX(p_bg,BG_MAX); bg_mode=p_bg; VS::get_singleton()->environment_set_background(environment,VS::EnvironmentBG(p_bg)); + _change_notify(); +} + +void Environment::set_skybox(const Ref<SkyBox> &p_skybox){ + + bg_skybox=p_skybox; + + RID sb_rid; + if (bg_skybox.is_valid()) + sb_rid=bg_skybox->get_rid(); + + VS::get_singleton()->environment_set_skybox(environment,sb_rid); +} + +void Environment::set_skybox_scale(float p_scale) { + + bg_skybox_scale=p_scale; + VS::get_singleton()->environment_set_skybox_scale(environment,p_scale); +} + +void Environment::set_bg_color(const Color& p_color){ + + bg_color=p_color; + VS::get_singleton()->environment_set_bg_color(environment,p_color); +} +void Environment::set_bg_energy(float p_energy){ + + bg_energy=p_energy; + VS::get_singleton()->environment_set_bg_energy(environment,p_energy); +} +void Environment::set_canvas_max_layer(int p_max_layer){ + + bg_canvas_max_layer=p_max_layer; + VS::get_singleton()->environment_set_canvas_max_layer(environment,p_max_layer); +} +void Environment::set_ambient_light_color(const Color& p_color){ + + ambient_color=p_color; + VS::get_singleton()->environment_set_ambient_light(environment,ambient_color,ambient_energy,ambient_skybox_contribution); +} +void Environment::set_ambient_light_energy(float p_energy){ + + ambient_energy=p_energy; + VS::get_singleton()->environment_set_ambient_light(environment,ambient_color,ambient_energy,ambient_skybox_contribution); } +void Environment::set_ambient_light_skybox_contribution(float p_energy){ -Environment::BG Environment::get_background() const{ + ambient_skybox_contribution=p_energy; + VS::get_singleton()->environment_set_ambient_light(environment,ambient_color,ambient_energy,ambient_skybox_contribution); +} + +Environment::BGMode Environment::get_background() const{ return bg_mode; } +Ref<SkyBox> Environment::get_skybox() const{ -void Environment::set_background_param(BGParam p_param, const Variant& p_value){ + return bg_skybox; +} - ERR_FAIL_INDEX(p_param,BG_PARAM_MAX); - bg_param[p_param]=p_value; - VS::get_singleton()->environment_set_background_param(environment,VS::EnvironmentBGParam(p_param),p_value); +float Environment::get_skybox_scale() const { + return bg_skybox_scale; } -Variant Environment::get_background_param(BGParam p_param) const{ - ERR_FAIL_INDEX_V(p_param,BG_PARAM_MAX,Variant()); - return bg_param[p_param]; +Color Environment::get_bg_color() const{ + return bg_color; } +float Environment::get_bg_energy() const{ -void Environment::set_enable_fx(Fx p_effect,bool p_enabled){ + return bg_energy; +} +int Environment::get_canvas_max_layer() const{ - ERR_FAIL_INDEX(p_effect,FX_MAX); - fx_enabled[p_effect]=p_enabled; - VS::get_singleton()->environment_set_enable_fx(environment,VS::EnvironmentFx(p_effect),p_enabled); + return bg_canvas_max_layer; +} +Color Environment::get_ambient_light_color() const{ + return ambient_color; } -bool Environment::is_fx_enabled(Fx p_effect) const{ +float Environment::get_ambient_light_energy() const{ - ERR_FAIL_INDEX_V(p_effect,FX_MAX,false); - return fx_enabled[p_effect]; + return ambient_energy; +} +float Environment::get_ambient_light_skybox_contribution() const{ + return ambient_skybox_contribution; } -void Environment::fx_set_param(FxParam p_param,const Variant& p_value){ - ERR_FAIL_INDEX(p_param,FX_PARAM_MAX); - fx_param[p_param]=p_value; - VS::get_singleton()->environment_fx_set_param(environment,VS::EnvironmentFxParam(p_param),p_value); +void Environment::set_tonemapper(ToneMapper p_tone_mapper) { + + tone_mapper=p_tone_mapper; + VS::get_singleton()->environment_set_tonemap(environment,VS::EnvironmentToneMapper(tone_mapper),tonemap_exposure,tonemap_white,tonemap_auto_exposure,tonemap_auto_exposure_min,tonemap_auto_exposure_max,tonemap_auto_exposure_speed,tonemap_auto_exposure_grey); } -Variant Environment::fx_get_param(FxParam p_param) const{ - ERR_FAIL_INDEX_V(p_param,FX_PARAM_MAX,Variant()); - return fx_param[p_param]; +Environment::ToneMapper Environment::get_tonemapper() const{ + return tone_mapper; } -RID Environment::get_rid() const { +void Environment::set_tonemap_exposure(float p_exposure){ - return environment; + tonemap_exposure=p_exposure; + VS::get_singleton()->environment_set_tonemap(environment,VS::EnvironmentToneMapper(tone_mapper),tonemap_exposure,tonemap_white,tonemap_auto_exposure,tonemap_auto_exposure_min,tonemap_auto_exposure_max,tonemap_auto_exposure_speed,tonemap_auto_exposure_grey); +} + +float Environment::get_tonemap_exposure() const{ + + return tonemap_exposure; +} + +void Environment::set_tonemap_white(float p_white){ + + tonemap_white=p_white; + VS::get_singleton()->environment_set_tonemap(environment,VS::EnvironmentToneMapper(tone_mapper),tonemap_exposure,tonemap_white,tonemap_auto_exposure,tonemap_auto_exposure_min,tonemap_auto_exposure_max,tonemap_auto_exposure_speed,tonemap_auto_exposure_grey); + +} +float Environment::get_tonemap_white() const { + + return tonemap_white; +} + +void Environment::set_tonemap_auto_exposure(bool p_enabled) { + + tonemap_auto_exposure=p_enabled; + VS::get_singleton()->environment_set_tonemap(environment,VS::EnvironmentToneMapper(tone_mapper),tonemap_exposure,tonemap_white,tonemap_auto_exposure,tonemap_auto_exposure_min,tonemap_auto_exposure_max,tonemap_auto_exposure_speed,tonemap_auto_exposure_grey); + +} +bool Environment::get_tonemap_auto_exposure() const { + + return tonemap_auto_exposure; +} + +void Environment::set_tonemap_auto_exposure_max(float p_auto_exposure_max) { + + tonemap_auto_exposure_max=p_auto_exposure_max; + VS::get_singleton()->environment_set_tonemap(environment,VS::EnvironmentToneMapper(tone_mapper),tonemap_exposure,tonemap_white,tonemap_auto_exposure,tonemap_auto_exposure_min,tonemap_auto_exposure_max,tonemap_auto_exposure_speed,tonemap_auto_exposure_grey); + +} +float Environment::get_tonemap_auto_exposure_max() const { + + return tonemap_auto_exposure_max; +} + +void Environment::set_tonemap_auto_exposure_min(float p_auto_exposure_min) { + + tonemap_auto_exposure_min=p_auto_exposure_min; + VS::get_singleton()->environment_set_tonemap(environment,VS::EnvironmentToneMapper(tone_mapper),tonemap_exposure,tonemap_white,tonemap_auto_exposure,tonemap_auto_exposure_min,tonemap_auto_exposure_max,tonemap_auto_exposure_speed,tonemap_auto_exposure_grey); + +} +float Environment::get_tonemap_auto_exposure_min() const { + + return tonemap_auto_exposure_min; +} + +void Environment::set_tonemap_auto_exposure_speed(float p_auto_exposure_speed) { + + tonemap_auto_exposure_speed=p_auto_exposure_speed; + VS::get_singleton()->environment_set_tonemap(environment,VS::EnvironmentToneMapper(tone_mapper),tonemap_exposure,tonemap_white,tonemap_auto_exposure,tonemap_auto_exposure_min,tonemap_auto_exposure_max,tonemap_auto_exposure_speed,tonemap_auto_exposure_grey); + +} +float Environment::get_tonemap_auto_exposure_speed() const { + + return tonemap_auto_exposure_speed; +} + +void Environment::set_tonemap_auto_exposure_grey(float p_auto_exposure_grey) { + + tonemap_auto_exposure_grey=p_auto_exposure_grey; + VS::get_singleton()->environment_set_tonemap(environment,VS::EnvironmentToneMapper(tone_mapper),tonemap_exposure,tonemap_white,tonemap_auto_exposure,tonemap_auto_exposure_min,tonemap_auto_exposure_max,tonemap_auto_exposure_speed,tonemap_auto_exposure_grey); + +} +float Environment::get_tonemap_auto_exposure_grey() const { + + return tonemap_auto_exposure_grey; +} + +void Environment::set_adjustment_enable(bool p_enable) { + + adjustment_enabled=p_enable; + VS::get_singleton()->environment_set_adjustment(environment,adjustment_enabled,adjustment_brightness,adjustment_contrast,adjustment_saturation,adjustment_color_correction.is_valid()?adjustment_color_correction->get_rid():RID()); +} + +bool Environment::is_adjustment_enabled() const { + + return adjustment_enabled; +} + + +void Environment::set_adjustment_brightness(float p_brightness) { + + adjustment_brightness=p_brightness; + VS::get_singleton()->environment_set_adjustment(environment,adjustment_enabled,adjustment_brightness,adjustment_contrast,adjustment_saturation,adjustment_color_correction.is_valid()?adjustment_color_correction->get_rid():RID()); + +} +float Environment::get_adjustment_brightness() const { + + return adjustment_brightness; +} + +void Environment::set_adjustment_contrast(float p_contrast) { + + adjustment_contrast=p_contrast; + VS::get_singleton()->environment_set_adjustment(environment,adjustment_enabled,adjustment_brightness,adjustment_contrast,adjustment_saturation,adjustment_color_correction.is_valid()?adjustment_color_correction->get_rid():RID()); + +} +float Environment::get_adjustment_contrast() const { + + return adjustment_contrast; +} + +void Environment::set_adjustment_saturation(float p_saturation) { + + adjustment_saturation=p_saturation; + VS::get_singleton()->environment_set_adjustment(environment,adjustment_enabled,adjustment_brightness,adjustment_contrast,adjustment_saturation,adjustment_color_correction.is_valid()?adjustment_color_correction->get_rid():RID()); + +} +float Environment::get_adjustment_saturation() const { + + return adjustment_saturation; +} + +void Environment::set_adjustment_color_correction(const Ref<Texture>& p_ramp) { + + adjustment_color_correction=p_ramp; + VS::get_singleton()->environment_set_adjustment(environment,adjustment_enabled,adjustment_brightness,adjustment_contrast,adjustment_saturation,adjustment_color_correction.is_valid()?adjustment_color_correction->get_rid():RID()); + +} +Ref<Texture> Environment::get_adjustment_color_correction() const { + + return adjustment_color_correction; +} + + +void Environment::_validate_property(PropertyInfo& property) const { + + if (property.name=="background/skybox" || property.name=="background/skybox_scale" || property.name=="ambient_light/skybox_contribution") { + if (bg_mode!=BG_SKYBOX) { + property.usage=PROPERTY_USAGE_NOEDITOR; + } + } + + if (property.name=="background/color") { + if (bg_mode!=BG_COLOR) { + property.usage=PROPERTY_USAGE_NOEDITOR; + } + } + + if (property.name=="background/canvas_max_layer") { + if (bg_mode!=BG_CANVAS) { + property.usage=PROPERTY_USAGE_NOEDITOR; + } + } + +} + +void Environment::set_ssr_enabled(bool p_enable) { + + ssr_enabled=p_enable; + VS::get_singleton()->environment_set_ssr(environment,ssr_enabled,ssr_max_steps,ssr_accel,ssr_fade,ssr_depth_tolerance,ssr_smooth,ssr_roughness); +} + +bool Environment::is_ssr_enabled() const{ + + return ssr_enabled; +} + +void Environment::set_ssr_max_steps(int p_steps){ + + ssr_max_steps=p_steps; + VS::get_singleton()->environment_set_ssr(environment,ssr_enabled,ssr_max_steps,ssr_accel,ssr_fade,ssr_depth_tolerance,ssr_smooth,ssr_roughness); + +} +int Environment::get_ssr_max_steps() const { + + return ssr_max_steps; +} + +void Environment::set_ssr_accel(float p_accel) { + + ssr_accel=p_accel; + VS::get_singleton()->environment_set_ssr(environment,ssr_enabled,ssr_max_steps,ssr_accel,ssr_fade,ssr_depth_tolerance,ssr_smooth,ssr_roughness); + +} +float Environment::get_ssr_accel() const { + + return ssr_accel; +} + +void Environment::set_ssr_fade(float p_fade) { + + ssr_fade=p_fade; + VS::get_singleton()->environment_set_ssr(environment,ssr_enabled,ssr_max_steps,ssr_accel,ssr_fade,ssr_depth_tolerance,ssr_smooth,ssr_roughness); + +} +float Environment::get_ssr_fade() const { + + return ssr_fade; +} + +void Environment::set_ssr_depth_tolerance(float p_depth_tolerance) { + + ssr_depth_tolerance=p_depth_tolerance; + VS::get_singleton()->environment_set_ssr(environment,ssr_enabled,ssr_max_steps,ssr_accel,ssr_fade,ssr_depth_tolerance,ssr_smooth,ssr_roughness); + +} +float Environment::get_ssr_depth_tolerance() const { + + return ssr_depth_tolerance; +} + +void Environment::set_ssr_smooth(bool p_enable) { + + ssr_smooth=p_enable; + VS::get_singleton()->environment_set_ssr(environment,ssr_enabled,ssr_max_steps,ssr_accel,ssr_fade,ssr_depth_tolerance,ssr_smooth,ssr_roughness); + +} +bool Environment::is_ssr_smooth() const { + + return ssr_smooth; +} + +void Environment::set_ssr_rough(bool p_enable) { + + ssr_roughness=p_enable; + VS::get_singleton()->environment_set_ssr(environment,ssr_enabled,ssr_max_steps,ssr_accel,ssr_fade,ssr_depth_tolerance,ssr_smooth,ssr_roughness); + +} +bool Environment::is_ssr_rough() const { + + return ssr_roughness; +} + +void Environment::set_ssao_enabled(bool p_enable) { + + ssao_enabled=p_enable; + VS::get_singleton()->environment_set_ssao(environment,ssao_enabled,ssao_radius,ssao_intensity,ssao_radius2,ssao_intensity2,ssao_bias,ssao_direct_light_affect,ssao_color,ssao_blur); + +} + +bool Environment::is_ssao_enabled() const{ + + return ssao_enabled; +} + +void Environment::set_ssao_radius(float p_radius){ + + ssao_radius=p_radius; + VS::get_singleton()->environment_set_ssao(environment,ssao_enabled,ssao_radius,ssao_intensity,ssao_radius2,ssao_intensity2,ssao_bias,ssao_direct_light_affect,ssao_color,ssao_blur); +} +float Environment::get_ssao_radius() const{ + + return ssao_radius; +} + + +void Environment::set_ssao_intensity(float p_intensity){ + + ssao_intensity=p_intensity; + VS::get_singleton()->environment_set_ssao(environment,ssao_enabled,ssao_radius,ssao_intensity,ssao_radius2,ssao_intensity2,ssao_bias,ssao_direct_light_affect,ssao_color,ssao_blur); +} + +float Environment::get_ssao_intensity() const{ + + return ssao_intensity; +} + +void Environment::set_ssao_radius2(float p_radius){ + + ssao_radius2=p_radius; + VS::get_singleton()->environment_set_ssao(environment,ssao_enabled,ssao_radius,ssao_intensity,ssao_radius2,ssao_intensity2,ssao_bias,ssao_direct_light_affect,ssao_color,ssao_blur); +} +float Environment::get_ssao_radius2() const{ + + return ssao_radius2; +} + + +void Environment::set_ssao_intensity2(float p_intensity){ + + ssao_intensity2=p_intensity; + VS::get_singleton()->environment_set_ssao(environment,ssao_enabled,ssao_radius,ssao_intensity,ssao_radius2,ssao_intensity2,ssao_bias,ssao_direct_light_affect,ssao_color,ssao_blur); +} +float Environment::get_ssao_intensity2() const{ + + return ssao_intensity2; +} + +void Environment::set_ssao_bias(float p_bias){ + + ssao_bias=p_bias; + VS::get_singleton()->environment_set_ssao(environment,ssao_enabled,ssao_radius,ssao_intensity,ssao_radius2,ssao_intensity2,ssao_bias,ssao_direct_light_affect,ssao_color,ssao_blur); +} +float Environment::get_ssao_bias() const{ + + return ssao_bias; +} + +void Environment::set_ssao_direct_light_affect(float p_direct_light_affect){ + + ssao_direct_light_affect=p_direct_light_affect; + VS::get_singleton()->environment_set_ssao(environment,ssao_enabled,ssao_radius,ssao_intensity,ssao_radius2,ssao_intensity2,ssao_bias,ssao_direct_light_affect,ssao_color,ssao_blur); +} +float Environment::get_ssao_direct_light_affect() const{ + + return ssao_direct_light_affect; +} + + +void Environment::set_ssao_color(const Color& p_color) { + + ssao_color=p_color; + VS::get_singleton()->environment_set_ssao(environment,ssao_enabled,ssao_radius,ssao_intensity,ssao_radius2,ssao_intensity2,ssao_bias,ssao_direct_light_affect,ssao_color,ssao_blur); +} + +Color Environment::get_ssao_color() const { + + return ssao_color; +} + +void Environment::set_ssao_blur(bool p_enable) { + + ssao_blur=p_enable; + VS::get_singleton()->environment_set_ssao(environment,ssao_enabled,ssao_radius,ssao_intensity,ssao_radius2,ssao_intensity2,ssao_bias,ssao_direct_light_affect,ssao_color,ssao_blur); +} +bool Environment::is_ssao_blur_enabled() const { + + return ssao_blur; +} + +void Environment::set_glow_enabled(bool p_enabled) { + + glow_enabled=p_enabled; + VS::get_singleton()->environment_set_glow(environment,glow_enabled,glow_levels,glow_intensity,glow_strength,glow_bloom,VS::EnvironmentGlowBlendMode(glow_blend_mode),glow_hdr_bleed_treshold,glow_hdr_bleed_treshold,glow_bicubic_upscale); +} + +bool Environment::is_glow_enabled() const{ + + return glow_enabled; +} + +void Environment::set_glow_level(int p_level,bool p_enabled){ + + ERR_FAIL_INDEX(p_level,VS::MAX_GLOW_LEVELS); + + if (p_enabled) + glow_levels|=(1<<p_level); + else + glow_levels&=~(1<<p_level); + + VS::get_singleton()->environment_set_glow(environment,glow_enabled,glow_levels,glow_intensity,glow_strength,glow_bloom,VS::EnvironmentGlowBlendMode(glow_blend_mode),glow_hdr_bleed_treshold,glow_hdr_bleed_treshold,glow_bicubic_upscale); + +} +bool Environment::is_glow_level_enabled(int p_level) const{ + + ERR_FAIL_INDEX_V(p_level,VS::MAX_GLOW_LEVELS,false); + + return glow_levels&(1<<p_level); +} + +void Environment::set_glow_intensity(float p_intensity){ + + glow_intensity=p_intensity; + + VS::get_singleton()->environment_set_glow(environment,glow_enabled,glow_levels,glow_intensity,glow_strength,glow_bloom,VS::EnvironmentGlowBlendMode(glow_blend_mode),glow_hdr_bleed_treshold,glow_hdr_bleed_treshold,glow_bicubic_upscale); + +} +float Environment::get_glow_intensity() const{ + + return glow_intensity; +} + +void Environment::set_glow_strength(float p_strength){ + + glow_strength=p_strength; + VS::get_singleton()->environment_set_glow(environment,glow_enabled,glow_levels,glow_intensity,glow_strength,glow_bloom,VS::EnvironmentGlowBlendMode(glow_blend_mode),glow_hdr_bleed_treshold,glow_hdr_bleed_treshold,glow_bicubic_upscale); + +} +float Environment::get_glow_strength() const{ + + return glow_strength; +} + +void Environment::set_glow_bloom(float p_treshold){ + + glow_bloom=p_treshold; + + VS::get_singleton()->environment_set_glow(environment,glow_enabled,glow_levels,glow_intensity,glow_strength,glow_bloom,VS::EnvironmentGlowBlendMode(glow_blend_mode),glow_hdr_bleed_treshold,glow_hdr_bleed_treshold,glow_bicubic_upscale); + +} +float Environment::get_glow_bloom() const{ + + return glow_bloom; +} + +void Environment::set_glow_blend_mode(GlowBlendMode p_mode){ + + glow_blend_mode=p_mode; + + VS::get_singleton()->environment_set_glow(environment,glow_enabled,glow_levels,glow_intensity,glow_strength,glow_bloom,VS::EnvironmentGlowBlendMode(glow_blend_mode),glow_hdr_bleed_treshold,glow_hdr_bleed_treshold,glow_bicubic_upscale); + +} +Environment::GlowBlendMode Environment::get_glow_blend_mode() const{ + + return glow_blend_mode; } +void Environment::set_glow_hdr_bleed_treshold(float p_treshold){ + + glow_hdr_bleed_treshold=p_treshold; + + VS::get_singleton()->environment_set_glow(environment,glow_enabled,glow_levels,glow_intensity,glow_strength,glow_bloom,VS::EnvironmentGlowBlendMode(glow_blend_mode),glow_hdr_bleed_treshold,glow_hdr_bleed_treshold,glow_bicubic_upscale); + +} +float Environment::get_glow_hdr_bleed_treshold() const{ + + return glow_hdr_bleed_treshold; +} + +void Environment::set_glow_hdr_bleed_scale(float p_scale){ + + glow_hdr_bleed_scale=p_scale; + + VS::get_singleton()->environment_set_glow(environment,glow_enabled,glow_levels,glow_intensity,glow_strength,glow_bloom,VS::EnvironmentGlowBlendMode(glow_blend_mode),glow_hdr_bleed_treshold,glow_hdr_bleed_treshold,glow_bicubic_upscale); + +} +float Environment::get_glow_hdr_bleed_scale() const{ + + return glow_hdr_bleed_scale; +} + +void Environment::set_glow_bicubic_upscale(bool p_enable) { + + glow_bicubic_upscale=p_enable; + VS::get_singleton()->environment_set_glow(environment,glow_enabled,glow_levels,glow_intensity,glow_strength,glow_bloom,VS::EnvironmentGlowBlendMode(glow_blend_mode),glow_hdr_bleed_treshold,glow_hdr_bleed_treshold,glow_bicubic_upscale); + +} + +bool Environment::is_glow_bicubic_upscale_enabled() const { + + return glow_bicubic_upscale; +} + + +void Environment::set_dof_blur_far_enabled(bool p_enable) { + + dof_blur_far_enabled=p_enable; + VS::get_singleton()->environment_set_dof_blur_far(environment,dof_blur_far_enabled,dof_blur_far_distance,dof_blur_far_transition,dof_blur_far_amount,VS::EnvironmentDOFBlurQuality(dof_blur_far_quality)); +} + +bool Environment::is_dof_blur_far_enabled() const{ + + return dof_blur_far_enabled; +} + +void Environment::set_dof_blur_far_distance(float p_distance){ + + dof_blur_far_distance=p_distance; + VS::get_singleton()->environment_set_dof_blur_far(environment,dof_blur_far_enabled,dof_blur_far_distance,dof_blur_far_transition,dof_blur_far_amount,VS::EnvironmentDOFBlurQuality(dof_blur_far_quality)); + +} +float Environment::get_dof_blur_far_distance() const{ + + return dof_blur_far_distance; +} + +void Environment::set_dof_blur_far_transition(float p_distance){ + + dof_blur_far_transition=p_distance; + VS::get_singleton()->environment_set_dof_blur_far(environment,dof_blur_far_enabled,dof_blur_far_distance,dof_blur_far_transition,dof_blur_far_amount,VS::EnvironmentDOFBlurQuality(dof_blur_far_quality)); +} +float Environment::get_dof_blur_far_transition() const{ + + return dof_blur_far_transition; +} + +void Environment::set_dof_blur_far_amount(float p_amount){ + + dof_blur_far_amount=p_amount; + VS::get_singleton()->environment_set_dof_blur_far(environment,dof_blur_far_enabled,dof_blur_far_distance,dof_blur_far_transition,dof_blur_far_amount,VS::EnvironmentDOFBlurQuality(dof_blur_far_quality)); + +} +float Environment::get_dof_blur_far_amount() const{ + + return dof_blur_far_amount; +} + +void Environment::set_dof_blur_far_quality(DOFBlurQuality p_quality) { + + dof_blur_far_quality=p_quality; + VS::get_singleton()->environment_set_dof_blur_far(environment,dof_blur_far_enabled,dof_blur_far_distance,dof_blur_far_transition,dof_blur_far_amount,VS::EnvironmentDOFBlurQuality(dof_blur_far_quality)); +} + +Environment::DOFBlurQuality Environment::get_dof_blur_far_quality() const { + + return dof_blur_far_quality; +} + + +void Environment::set_dof_blur_near_enabled(bool p_enable) { + + dof_blur_near_enabled=p_enable; + VS::get_singleton()->environment_set_dof_blur_near(environment,dof_blur_near_enabled,dof_blur_near_distance,dof_blur_near_transition,dof_blur_near_amount,VS::EnvironmentDOFBlurQuality(dof_blur_near_quality)); +} + +bool Environment::is_dof_blur_near_enabled() const{ + + return dof_blur_near_enabled; +} + +void Environment::set_dof_blur_near_distance(float p_distance){ + + dof_blur_near_distance=p_distance; + VS::get_singleton()->environment_set_dof_blur_near(environment,dof_blur_near_enabled,dof_blur_near_distance,dof_blur_near_transition,dof_blur_near_amount,VS::EnvironmentDOFBlurQuality(dof_blur_near_quality)); +} + +float Environment::get_dof_blur_near_distance() const{ + + return dof_blur_near_distance; +} + +void Environment::set_dof_blur_near_transition(float p_distance){ + + dof_blur_near_transition=p_distance; + VS::get_singleton()->environment_set_dof_blur_near(environment,dof_blur_near_enabled,dof_blur_near_distance,dof_blur_near_transition,dof_blur_near_amount,VS::EnvironmentDOFBlurQuality(dof_blur_near_quality)); +} + +float Environment::get_dof_blur_near_transition() const{ + + return dof_blur_near_transition; +} + +void Environment::set_dof_blur_near_amount(float p_amount){ + + dof_blur_near_amount=p_amount; + VS::get_singleton()->environment_set_dof_blur_near(environment,dof_blur_near_enabled,dof_blur_near_distance,dof_blur_near_transition,dof_blur_near_amount,VS::EnvironmentDOFBlurQuality(dof_blur_near_quality)); +} + +float Environment::get_dof_blur_near_amount() const{ + + return dof_blur_near_amount; +} + +void Environment::set_dof_blur_near_quality(DOFBlurQuality p_quality) { + + dof_blur_near_quality=p_quality; + VS::get_singleton()->environment_set_dof_blur_near(environment,dof_blur_near_enabled,dof_blur_near_distance,dof_blur_near_transition,dof_blur_near_amount,VS::EnvironmentDOFBlurQuality(dof_blur_near_quality)); +} + +Environment::DOFBlurQuality Environment::get_dof_blur_near_quality() const { + + return dof_blur_near_quality; +} + + void Environment::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_background","bgmode"),&Environment::set_background); - ObjectTypeDB::bind_method(_MD("get_background"),&Environment::get_background); - - ObjectTypeDB::bind_method(_MD("set_background_param","param","value"),&Environment::set_background_param); - ObjectTypeDB::bind_method(_MD("get_background_param","param"),&Environment::get_background_param); - - ObjectTypeDB::bind_method(_MD("set_enable_fx","effect","enabled"),&Environment::set_enable_fx); - ObjectTypeDB::bind_method(_MD("is_fx_enabled","effect"),&Environment::is_fx_enabled); - - ObjectTypeDB::bind_method(_MD("fx_set_param","param","value"),&Environment::fx_set_param); - ObjectTypeDB::bind_method(_MD("fx_get_param","param"),&Environment::fx_get_param); - - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"ambient_light/enabled"),_SCS("set_enable_fx"),_SCS("is_fx_enabled"), FX_AMBIENT_LIGHT); - ADD_PROPERTYI( PropertyInfo(Variant::COLOR,"ambient_light/color",PROPERTY_HINT_COLOR_NO_ALPHA),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_AMBIENT_LIGHT_COLOR); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"ambient_light/energy",PROPERTY_HINT_RANGE,"0,64,0.01"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_AMBIENT_LIGHT_ENERGY); - - - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"fxaa/enabled"),_SCS("set_enable_fx"),_SCS("is_fx_enabled"), FX_FXAA); - - ADD_PROPERTY( PropertyInfo(Variant::INT,"background/mode",PROPERTY_HINT_ENUM,"Keep,Default Color,Color,Texture,Cubemap,Canvas"),_SCS("set_background"),_SCS("get_background")); - ADD_PROPERTYI( PropertyInfo(Variant::COLOR,"background/color"),_SCS("set_background_param"),_SCS("get_background_param"), BG_PARAM_COLOR); - ADD_PROPERTYI( PropertyInfo(Variant::OBJECT,"background/texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_background_param"),_SCS("get_background_param"), BG_PARAM_TEXTURE); - ADD_PROPERTYI( PropertyInfo(Variant::OBJECT,"background/cubemap",PROPERTY_HINT_RESOURCE_TYPE,"CubeMap"),_SCS("set_background_param"),_SCS("get_background_param"), BG_PARAM_CUBEMAP); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"background/energy",PROPERTY_HINT_RANGE,"0,128,0.01"),_SCS("set_background_param"),_SCS("get_background_param"), BG_PARAM_ENERGY); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"background/scale",PROPERTY_HINT_RANGE,"0.001,16,0.001"),_SCS("set_background_param"),_SCS("get_background_param"), BG_PARAM_SCALE); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"background/glow",PROPERTY_HINT_RANGE,"0.00,8,0.01"),_SCS("set_background_param"),_SCS("get_background_param"), BG_PARAM_GLOW); - ADD_PROPERTYI( PropertyInfo(Variant::INT,"background/canvas_max_layer"),_SCS("set_background_param"),_SCS("get_background_param"), BG_PARAM_CANVAS_MAX_LAYER); - - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"glow/enabled"),_SCS("set_enable_fx"),_SCS("is_fx_enabled"), FX_GLOW); - ADD_PROPERTYI( PropertyInfo(Variant::INT,"glow/blur_passes",PROPERTY_HINT_RANGE,"1,4,1"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_GLOW_BLUR_PASSES); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"glow/blur_scale",PROPERTY_HINT_RANGE,"0.01,4,0.01"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_GLOW_BLUR_SCALE); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"glow/blur_strength",PROPERTY_HINT_RANGE,"0.01,4,0.01"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_GLOW_BLUR_STRENGTH); - ADD_PROPERTYI( PropertyInfo(Variant::INT,"glow/blur_blend_mode",PROPERTY_HINT_ENUM,"Additive,Screen,SoftLight"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_GLOW_BLUR_BLEND_MODE); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"glow/bloom",PROPERTY_HINT_RANGE,"0,8,0.01"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_GLOW_BLOOM); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"glow/bloom_treshold",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_GLOW_BLOOM_TRESHOLD); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"dof_blur/enabled"),_SCS("set_enable_fx"),_SCS("is_fx_enabled"), FX_DOF_BLUR); - ADD_PROPERTYI( PropertyInfo(Variant::INT,"dof_blur/blur_passes",PROPERTY_HINT_RANGE,"1,4,1"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_DOF_BLUR_PASSES); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"dof_blur/begin",PROPERTY_HINT_RANGE,"0,4096,0.1"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_DOF_BLUR_BEGIN); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"dof_blur/range",PROPERTY_HINT_RANGE,"0,4096,0.1"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_DOF_BLUR_RANGE); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"hdr/enabled"),_SCS("set_enable_fx"),_SCS("is_fx_enabled"), FX_HDR); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"hdr/tonemapper",PROPERTY_HINT_ENUM,"Linear,Log,Reinhardt,ReinhardtAutoWhite"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_HDR_TONEMAPPER); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"hdr/exposure",PROPERTY_HINT_RANGE,"0.01,16,0.01"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_HDR_EXPOSURE); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"hdr/white",PROPERTY_HINT_RANGE,"0.01,16,0.01"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_HDR_WHITE); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"hdr/glow_treshold",PROPERTY_HINT_RANGE,"0.00,8,0.01"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_HDR_GLOW_TRESHOLD); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"hdr/glow_scale",PROPERTY_HINT_RANGE,"0.00,16,0.01"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_HDR_GLOW_SCALE); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"hdr/min_luminance",PROPERTY_HINT_RANGE,"0.01,64,0.01"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_HDR_MIN_LUMINANCE); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"hdr/max_luminance",PROPERTY_HINT_RANGE,"0.01,64,0.01"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_HDR_MAX_LUMINANCE); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"hdr/exposure_adj_speed",PROPERTY_HINT_RANGE,"0.001,64,0.001"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_HDR_EXPOSURE_ADJUST_SPEED); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"fog/enabled"),_SCS("set_enable_fx"),_SCS("is_fx_enabled"), FX_FOG); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"fog/begin",PROPERTY_HINT_RANGE,"0.01,4096,0.01"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_FOG_BEGIN); - ADD_PROPERTYI( PropertyInfo(Variant::COLOR,"fog/begin_color",PROPERTY_HINT_COLOR_NO_ALPHA),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_FOG_BEGIN_COLOR); - ADD_PROPERTYI( PropertyInfo(Variant::COLOR,"fog/end_color",PROPERTY_HINT_COLOR_NO_ALPHA),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_FOG_END_COLOR); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"fog/attenuation",PROPERTY_HINT_EXP_EASING),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_FOG_ATTENUATION); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"fog/bg"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_FOG_BG); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"bcs/enabled"),_SCS("set_enable_fx"),_SCS("is_fx_enabled"), FX_BCS); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"bcs/brightness",PROPERTY_HINT_RANGE,"0.01,8,0.01"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_BCS_BRIGHTNESS); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"bcs/contrast",PROPERTY_HINT_RANGE,"0.01,8,0.01"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_BCS_CONTRAST); - ADD_PROPERTYI( PropertyInfo(Variant::REAL,"bcs/saturation",PROPERTY_HINT_RANGE,"0.01,8,0.01"),_SCS("fx_set_param"),_SCS("fx_get_param"), FX_PARAM_BCS_SATURATION); - ADD_PROPERTYI( PropertyInfo(Variant::BOOL,"srgb/enabled"),_SCS("set_enable_fx"),_SCS("is_fx_enabled"), FX_SRGB); - - - - - -/* - FX_PARAM_BLOOM_GLOW_BLUR_PASSES=VS::ENV_FX_PARAM_BLOOM_GLOW_BLUR_PASSES, - FX_PARAM_BLOOM_AMOUNT=VS::ENV_FX_PARAM_BLOOM_AMOUNT, - FX_PARAM_DOF_BLUR_PASSES=VS::ENV_FX_PARAM_DOF_BLUR_PASSES, - FX_PARAM_DOF_BLUR_BEGIN=VS::ENV_FX_PARAM_DOF_BLUR_BEGIN, - FX_PARAM_DOF_BLUR_END=VS::ENV_FX_PARAM_DOF_BLUR_END, - FX_PARAM_HDR_EXPOSURE=VS::ENV_FX_PARAM_HDR_EXPOSURE, - FX_PARAM_HDR_WHITE=VS::ENV_FX_PARAM_HDR_WHITE, - FX_PARAM_HDR_GLOW_TRESHOLD=VS::ENV_FX_PARAM_HDR_GLOW_TRESHOLD, - FX_PARAM_HDR_GLOW_SCALE=VS::ENV_FX_PARAM_HDR_GLOW_SCALE, - FX_PARAM_HDR_MIN_LUMINANCE=VS::ENV_FX_PARAM_HDR_MIN_LUMINANCE, - FX_PARAM_HDR_MAX_LUMINANCE=VS::ENV_FX_PARAM_HDR_MAX_LUMINANCE, - FX_PARAM_HDR_EXPOSURE_ADJUST_SPEED=VS::ENV_FX_PARAM_HDR_EXPOSURE_ADJUST_SPEED, - FX_PARAM_FOG_BEGIN=VS::ENV_FX_PARAM_FOG_BEGIN, - FX_PARAM_FOG_ATTENUATION=VS::ENV_FX_PARAM_FOG_ATTENUATION, - FX_PARAM_FOG_BEGIN_COLOR=VS::ENV_FX_PARAM_FOG_BEGIN_COLOR, - FX_PARAM_FOG_END_COLOR=VS::ENV_FX_PARAM_FOG_END_COLOR, - FX_PARAM_FOG_BG=VS::ENV_FX_PARAM_FOG_BG, - FX_PARAM_GAMMA_VALUE=VS::ENV_FX_PARAM_GAMMA_VALUE, - FX_PARAM_BRIGHTNESS_VALUE=VS::ENV_FX_PARAM_BRIGHTNESS_VALUE, - FX_PARAM_CONTRAST_VALUE=VS::ENV_FX_PARAM_CONTRAST_VALUE, - FX_PARAM_SATURATION_VALUE=VS::ENV_FX_PARAM_SATURATION_VALUE, - FX_PARAM_MAX=VS::ENV_FX_PARAM_MAX -*/ - - BIND_CONSTANT( BG_KEEP ); - BIND_CONSTANT( BG_DEFAULT_COLOR ); - BIND_CONSTANT( BG_COLOR ); - BIND_CONSTANT( BG_TEXTURE ); - BIND_CONSTANT( BG_CUBEMAP ); - BIND_CONSTANT( BG_CANVAS ); - BIND_CONSTANT( BG_MAX ); - - BIND_CONSTANT( BG_PARAM_CANVAS_MAX_LAYER ); - BIND_CONSTANT( BG_PARAM_COLOR ); - BIND_CONSTANT( BG_PARAM_TEXTURE ); - BIND_CONSTANT( BG_PARAM_CUBEMAP ); - BIND_CONSTANT( BG_PARAM_ENERGY ); - BIND_CONSTANT( BG_PARAM_GLOW ); - BIND_CONSTANT( BG_PARAM_MAX ); - - - BIND_CONSTANT( FX_AMBIENT_LIGHT ); - BIND_CONSTANT( FX_FXAA ); - BIND_CONSTANT( FX_GLOW ); - BIND_CONSTANT( FX_DOF_BLUR ); - BIND_CONSTANT( FX_HDR ); - BIND_CONSTANT( FX_FOG ); - BIND_CONSTANT( FX_BCS); - BIND_CONSTANT( FX_SRGB ); - BIND_CONSTANT( FX_MAX ); - - - BIND_CONSTANT( FX_BLUR_BLEND_MODE_ADDITIVE ); - BIND_CONSTANT( FX_BLUR_BLEND_MODE_SCREEN ); - BIND_CONSTANT( FX_BLUR_BLEND_MODE_SOFTLIGHT ); - - BIND_CONSTANT( FX_HDR_TONE_MAPPER_LINEAR ); - BIND_CONSTANT( FX_HDR_TONE_MAPPER_LOG ); - BIND_CONSTANT( FX_HDR_TONE_MAPPER_REINHARDT ); - BIND_CONSTANT( FX_HDR_TONE_MAPPER_REINHARDT_AUTOWHITE ); - - BIND_CONSTANT( FX_PARAM_AMBIENT_LIGHT_COLOR ); - BIND_CONSTANT( FX_PARAM_AMBIENT_LIGHT_ENERGY ); - BIND_CONSTANT( FX_PARAM_GLOW_BLUR_PASSES ); - BIND_CONSTANT( FX_PARAM_GLOW_BLUR_SCALE ); - BIND_CONSTANT( FX_PARAM_GLOW_BLUR_STRENGTH ); - BIND_CONSTANT( FX_PARAM_GLOW_BLUR_BLEND_MODE ); - BIND_CONSTANT( FX_PARAM_GLOW_BLOOM); - BIND_CONSTANT( FX_PARAM_GLOW_BLOOM_TRESHOLD); - BIND_CONSTANT( FX_PARAM_DOF_BLUR_PASSES ); - BIND_CONSTANT( FX_PARAM_DOF_BLUR_BEGIN ); - BIND_CONSTANT( FX_PARAM_DOF_BLUR_RANGE ); - BIND_CONSTANT( FX_PARAM_HDR_TONEMAPPER); - BIND_CONSTANT( FX_PARAM_HDR_EXPOSURE ); - BIND_CONSTANT( FX_PARAM_HDR_WHITE ); - BIND_CONSTANT( FX_PARAM_HDR_GLOW_TRESHOLD ); - BIND_CONSTANT( FX_PARAM_HDR_GLOW_SCALE ); - BIND_CONSTANT( FX_PARAM_HDR_MIN_LUMINANCE ); - BIND_CONSTANT( FX_PARAM_HDR_MAX_LUMINANCE ); - BIND_CONSTANT( FX_PARAM_HDR_EXPOSURE_ADJUST_SPEED ); - BIND_CONSTANT( FX_PARAM_FOG_BEGIN ); - BIND_CONSTANT( FX_PARAM_FOG_ATTENUATION ); - BIND_CONSTANT( FX_PARAM_FOG_BEGIN_COLOR ); - BIND_CONSTANT( FX_PARAM_FOG_END_COLOR ); - BIND_CONSTANT( FX_PARAM_FOG_BG ); - BIND_CONSTANT( FX_PARAM_BCS_BRIGHTNESS ); - BIND_CONSTANT( FX_PARAM_BCS_CONTRAST ); - BIND_CONSTANT( FX_PARAM_BCS_SATURATION ); - BIND_CONSTANT( FX_PARAM_MAX ); + ClassDB::bind_method(_MD("set_background","mode"),&Environment::set_background); + ClassDB::bind_method(_MD("set_skybox","skybox:CubeMap"),&Environment::set_skybox); + ClassDB::bind_method(_MD("set_skybox_scale","scale"),&Environment::set_skybox_scale); + ClassDB::bind_method(_MD("set_bg_color","color"),&Environment::set_bg_color); + ClassDB::bind_method(_MD("set_bg_energy","energy"),&Environment::set_bg_energy); + ClassDB::bind_method(_MD("set_canvas_max_layer","layer"),&Environment::set_canvas_max_layer); + ClassDB::bind_method(_MD("set_ambient_light_color","color"),&Environment::set_ambient_light_color); + ClassDB::bind_method(_MD("set_ambient_light_energy","energy"),&Environment::set_ambient_light_energy); + ClassDB::bind_method(_MD("set_ambient_light_skybox_contribution","energy"),&Environment::set_ambient_light_skybox_contribution); + + + ClassDB::bind_method(_MD("get_background"),&Environment::get_background); + ClassDB::bind_method(_MD("get_skybox:CubeMap"),&Environment::get_skybox); + ClassDB::bind_method(_MD("get_skybox_scale"),&Environment::get_skybox_scale); + ClassDB::bind_method(_MD("get_bg_color"),&Environment::get_bg_color); + ClassDB::bind_method(_MD("get_bg_energy"),&Environment::get_bg_energy); + ClassDB::bind_method(_MD("get_canvas_max_layer"),&Environment::get_canvas_max_layer); + ClassDB::bind_method(_MD("get_ambient_light_color"),&Environment::get_ambient_light_color); + ClassDB::bind_method(_MD("get_ambient_light_energy"),&Environment::get_ambient_light_energy); + ClassDB::bind_method(_MD("get_ambient_light_skybox_contribution"),&Environment::get_ambient_light_skybox_contribution); + + + ADD_GROUP("Background","background_"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"background_mode",PROPERTY_HINT_ENUM,"Clear Color,Custom Color,Skybox,Canvas,Keep"),_SCS("set_background"),_SCS("get_background") ); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"background_skybox",PROPERTY_HINT_RESOURCE_TYPE,"SkyBox"),_SCS("set_skybox"),_SCS("get_skybox") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"background_skybox_scale",PROPERTY_HINT_RANGE,"0,32,0.01"),_SCS("set_skybox_scale"),_SCS("get_skybox_scale") ); + ADD_PROPERTY(PropertyInfo(Variant::COLOR,"background_color"),_SCS("set_bg_color"),_SCS("get_bg_color") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"background_energy",PROPERTY_HINT_RANGE,"0,16,0.01"),_SCS("set_bg_energy"),_SCS("get_bg_energy") ); + ADD_PROPERTY(PropertyInfo(Variant::INT,"background_canvas_max_layer",PROPERTY_HINT_RANGE,"-1000,1000,1"),_SCS("set_canvas_max_layer"),_SCS("get_canvas_max_layer") ); + ADD_GROUP("Ambient Light","ambient_light_"); + ADD_PROPERTY(PropertyInfo(Variant::COLOR,"ambient_light_color"),_SCS("set_ambient_light_color"),_SCS("get_ambient_light_color") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"ambient_light_energy",PROPERTY_HINT_RANGE,"0,16,0.01"),_SCS("set_ambient_light_energy"),_SCS("get_ambient_light_energy") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"ambient_light_skybox_contribution",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_ambient_light_skybox_contribution"),_SCS("get_ambient_light_skybox_contribution") ); + + + ClassDB::bind_method(_MD("set_ssr_enabled","enabled"),&Environment::set_ssr_enabled); + ClassDB::bind_method(_MD("is_ssr_enabled"),&Environment::is_ssr_enabled); + + ClassDB::bind_method(_MD("set_ssr_max_steps","max_steps"),&Environment::set_ssr_max_steps); + ClassDB::bind_method(_MD("get_ssr_max_steps"),&Environment::get_ssr_max_steps); + + ClassDB::bind_method(_MD("set_ssr_accel","accel"),&Environment::set_ssr_accel); + ClassDB::bind_method(_MD("get_ssr_accel"),&Environment::get_ssr_accel); + + ClassDB::bind_method(_MD("set_ssr_fade","fade"),&Environment::set_ssr_fade); + ClassDB::bind_method(_MD("get_ssr_fade"),&Environment::get_ssr_fade); + + ClassDB::bind_method(_MD("set_ssr_depth_tolerance","depth_tolerance"),&Environment::set_ssr_depth_tolerance); + ClassDB::bind_method(_MD("get_ssr_depth_tolerance"),&Environment::get_ssr_depth_tolerance); + + ClassDB::bind_method(_MD("set_ssr_smooth","smooth"),&Environment::set_ssr_smooth); + ClassDB::bind_method(_MD("is_ssr_smooth"),&Environment::is_ssr_smooth); + + ClassDB::bind_method(_MD("set_ssr_rough","rough"),&Environment::set_ssr_rough); + ClassDB::bind_method(_MD("is_ssr_rough"),&Environment::is_ssr_rough); + + ADD_GROUP("SS Reflections","ss_reflections_"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"ss_reflections_enabled"),_SCS("set_ssr_enabled"),_SCS("is_ssr_enabled") ); + ADD_PROPERTY(PropertyInfo(Variant::INT,"ss_reflections_max_steps",PROPERTY_HINT_RANGE,"1,512,1"),_SCS("set_ssr_max_steps"),_SCS("get_ssr_max_steps") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"ss_reflections_accel",PROPERTY_HINT_RANGE,"0,4,0.01"),_SCS("set_ssr_accel"),_SCS("get_ssr_accel") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"ss_reflections_fade",PROPERTY_HINT_EXP_EASING),_SCS("set_ssr_fade"),_SCS("get_ssr_fade") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"ss_reflections_depth_tolerance",PROPERTY_HINT_RANGE,"0.1,128,0.1"),_SCS("set_ssr_depth_tolerance"),_SCS("get_ssr_depth_tolerance") ); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"ss_reflections_accel_smooth"),_SCS("set_ssr_smooth"),_SCS("is_ssr_smooth") ); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"ss_reflections_roughness"),_SCS("set_ssr_rough"),_SCS("is_ssr_rough") ); + + ClassDB::bind_method(_MD("set_ssao_enabled","enabled"),&Environment::set_ssao_enabled); + ClassDB::bind_method(_MD("is_ssao_enabled"),&Environment::is_ssao_enabled); + + ClassDB::bind_method(_MD("set_ssao_radius","radius"),&Environment::set_ssao_radius); + ClassDB::bind_method(_MD("get_ssao_radius"),&Environment::get_ssao_radius); + + ClassDB::bind_method(_MD("set_ssao_intensity","intensity"),&Environment::set_ssao_intensity); + ClassDB::bind_method(_MD("get_ssao_intensity"),&Environment::get_ssao_intensity); + + ClassDB::bind_method(_MD("set_ssao_radius2","radius"),&Environment::set_ssao_radius2); + ClassDB::bind_method(_MD("get_ssao_radius2"),&Environment::get_ssao_radius2); + + ClassDB::bind_method(_MD("set_ssao_intensity2","intensity"),&Environment::set_ssao_intensity2); + ClassDB::bind_method(_MD("get_ssao_intensity2"),&Environment::get_ssao_intensity2); + + ClassDB::bind_method(_MD("set_ssao_bias","bias"),&Environment::set_ssao_bias); + ClassDB::bind_method(_MD("get_ssao_bias"),&Environment::get_ssao_bias); + + ClassDB::bind_method(_MD("set_ssao_direct_light_affect","amount"),&Environment::set_ssao_direct_light_affect); + ClassDB::bind_method(_MD("get_ssao_direct_light_affect"),&Environment::get_ssao_direct_light_affect); + + ClassDB::bind_method(_MD("set_ssao_color","color"),&Environment::set_ssao_color); + ClassDB::bind_method(_MD("get_ssao_color"),&Environment::get_ssao_color); + + ClassDB::bind_method(_MD("set_ssao_blur","enabled"),&Environment::set_ssao_blur); + ClassDB::bind_method(_MD("is_ssao_blur_enabled"),&Environment::is_ssao_blur_enabled); + + ADD_GROUP("SSAO","ssao_"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"ssao_enabled"),_SCS("set_ssao_enabled"),_SCS("is_ssao_enabled") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"ssao_radius",PROPERTY_HINT_RANGE,"0.1,16,0.1"),_SCS("set_ssao_radius"),_SCS("get_ssao_radius") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"ssao_intensity",PROPERTY_HINT_RANGE,"0.0,9,0.1"),_SCS("set_ssao_intensity"),_SCS("get_ssao_intensity") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"ssao_radius2",PROPERTY_HINT_RANGE,"0.0,16,0.1"),_SCS("set_ssao_radius2"),_SCS("get_ssao_radius2") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"ssao_intensity2",PROPERTY_HINT_RANGE,"0.0,9,0.1"),_SCS("set_ssao_intensity2"),_SCS("get_ssao_intensity2") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"ssao_bias",PROPERTY_HINT_RANGE,"0.001,8,0.001"),_SCS("set_ssao_bias"),_SCS("get_ssao_bias") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"ssao_light_affect",PROPERTY_HINT_RANGE,"0.00,1,0.01"),_SCS("set_ssao_direct_light_affect"),_SCS("get_ssao_direct_light_affect") ); + ADD_PROPERTY(PropertyInfo(Variant::COLOR,"ssao_color",PROPERTY_HINT_COLOR_NO_ALPHA),_SCS("set_ssao_color"),_SCS("get_ssao_color") ); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"ssao_blur"),_SCS("set_ssao_blur"),_SCS("is_ssao_blur_enabled") ); + + ClassDB::bind_method(_MD("set_dof_blur_far_enabled","enabled"),&Environment::set_dof_blur_far_enabled); + ClassDB::bind_method(_MD("is_dof_blur_far_enabled"),&Environment::is_dof_blur_far_enabled); + + ClassDB::bind_method(_MD("set_dof_blur_far_distance","intensity"),&Environment::set_dof_blur_far_distance); + ClassDB::bind_method(_MD("get_dof_blur_far_distance"),&Environment::get_dof_blur_far_distance); + + ClassDB::bind_method(_MD("set_dof_blur_far_transition","intensity"),&Environment::set_dof_blur_far_transition); + ClassDB::bind_method(_MD("get_dof_blur_far_transition"),&Environment::get_dof_blur_far_transition); + + ClassDB::bind_method(_MD("set_dof_blur_far_amount","intensity"),&Environment::set_dof_blur_far_amount); + ClassDB::bind_method(_MD("get_dof_blur_far_amount"),&Environment::get_dof_blur_far_amount); + + ClassDB::bind_method(_MD("set_dof_blur_far_quality","intensity"),&Environment::set_dof_blur_far_quality); + ClassDB::bind_method(_MD("get_dof_blur_far_quality"),&Environment::get_dof_blur_far_quality); + + ClassDB::bind_method(_MD("set_dof_blur_near_enabled","enabled"),&Environment::set_dof_blur_near_enabled); + ClassDB::bind_method(_MD("is_dof_blur_near_enabled"),&Environment::is_dof_blur_near_enabled); + + ClassDB::bind_method(_MD("set_dof_blur_near_distance","intensity"),&Environment::set_dof_blur_near_distance); + ClassDB::bind_method(_MD("get_dof_blur_near_distance"),&Environment::get_dof_blur_near_distance); + + ClassDB::bind_method(_MD("set_dof_blur_near_transition","intensity"),&Environment::set_dof_blur_near_transition); + ClassDB::bind_method(_MD("get_dof_blur_near_transition"),&Environment::get_dof_blur_near_transition); + + ClassDB::bind_method(_MD("set_dof_blur_near_amount","intensity"),&Environment::set_dof_blur_near_amount); + ClassDB::bind_method(_MD("get_dof_blur_near_amount"),&Environment::get_dof_blur_near_amount); + + ClassDB::bind_method(_MD("set_dof_blur_near_quality","level"),&Environment::set_dof_blur_near_quality); + ClassDB::bind_method(_MD("get_dof_blur_near_quality"),&Environment::get_dof_blur_near_quality); + + ADD_GROUP("DOF Far Blur","dof_blur_far_"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"dof_blur_far_enabled"),_SCS("set_dof_blur_far_enabled"),_SCS("is_dof_blur_far_enabled") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"dof_blur_far_distance",PROPERTY_HINT_EXP_RANGE,"0.01,8192,0.01"),_SCS("set_dof_blur_far_distance"),_SCS("get_dof_blur_far_distance") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"dof_blur_far_transition",PROPERTY_HINT_EXP_RANGE,"0.01,8192,0.01"),_SCS("set_dof_blur_far_transition"),_SCS("get_dof_blur_far_transition") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"dof_blur_far_amount",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_dof_blur_far_amount"),_SCS("get_dof_blur_far_amount") ); + ADD_PROPERTY(PropertyInfo(Variant::INT,"dof_blur_far_quality",PROPERTY_HINT_ENUM,"Low,Medium,High"),_SCS("set_dof_blur_far_quality"),_SCS("get_dof_blur_far_quality") ); + + ADD_GROUP("DOF Far Near","dof_blur_near_"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"dof_blur_near_enabled"),_SCS("set_dof_blur_near_enabled"),_SCS("is_dof_blur_near_enabled") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"dof_blur_near_distance",PROPERTY_HINT_EXP_RANGE,"0.01,8192,0.01"),_SCS("set_dof_blur_near_distance"),_SCS("get_dof_blur_near_distance") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"dof_blur_near_transition",PROPERTY_HINT_EXP_RANGE,"0.01,8192,0.01"),_SCS("set_dof_blur_near_transition"),_SCS("get_dof_blur_near_transition") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"dof_blur_near_amount",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_dof_blur_near_amount"),_SCS("get_dof_blur_near_amount") ); + ADD_PROPERTY(PropertyInfo(Variant::INT,"dof_blur_near_quality",PROPERTY_HINT_ENUM,"Low,Medium,High"),_SCS("set_dof_blur_near_quality"),_SCS("get_dof_blur_near_quality") ); + + + ClassDB::bind_method(_MD("set_glow_enabled","enabled"),&Environment::set_glow_enabled); + ClassDB::bind_method(_MD("is_glow_enabled"),&Environment::is_glow_enabled); + + ClassDB::bind_method(_MD("set_glow_level","idx","enabled"),&Environment::set_glow_level); + ClassDB::bind_method(_MD("is_glow_level_enabled","idx"),&Environment::is_glow_level_enabled); + + ClassDB::bind_method(_MD("set_glow_intensity","intensity"),&Environment::set_glow_intensity); + ClassDB::bind_method(_MD("get_glow_intensity"),&Environment::get_glow_intensity); + + ClassDB::bind_method(_MD("set_glow_strength","strength"),&Environment::set_glow_strength); + ClassDB::bind_method(_MD("get_glow_strength"),&Environment::get_glow_strength); + + ClassDB::bind_method(_MD("set_glow_bloom","amount"),&Environment::set_glow_bloom); + ClassDB::bind_method(_MD("get_glow_bloom"),&Environment::get_glow_bloom); + + ClassDB::bind_method(_MD("set_glow_blend_mode","mode"),&Environment::set_glow_blend_mode); + ClassDB::bind_method(_MD("get_glow_blend_mode"),&Environment::get_glow_blend_mode); + + ClassDB::bind_method(_MD("set_glow_hdr_bleed_treshold","treshold"),&Environment::set_glow_hdr_bleed_treshold); + ClassDB::bind_method(_MD("get_glow_hdr_bleed_treshold"),&Environment::get_glow_hdr_bleed_treshold); + + ClassDB::bind_method(_MD("set_glow_hdr_bleed_scale","scale"),&Environment::set_glow_hdr_bleed_scale); + ClassDB::bind_method(_MD("get_glow_hdr_bleed_scale"),&Environment::get_glow_hdr_bleed_scale); + + ClassDB::bind_method(_MD("set_glow_bicubic_upscale","enabled"),&Environment::set_glow_bicubic_upscale); + ClassDB::bind_method(_MD("is_glow_bicubic_upscale_enabled"),&Environment::is_glow_bicubic_upscale_enabled); + + ADD_GROUP("Glow","glow_"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"glow_enabled"),_SCS("set_glow_enabled"),_SCS("is_glow_enabled") ); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"glow_levels/1"),_SCS("set_glow_level"),_SCS("is_glow_level_enabled"),0 ); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"glow_levels/2"),_SCS("set_glow_level"),_SCS("is_glow_level_enabled"),1 ); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"glow_levels/3"),_SCS("set_glow_level"),_SCS("is_glow_level_enabled"),2 ); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"glow_levels/4"),_SCS("set_glow_level"),_SCS("is_glow_level_enabled"),3 ); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"glow_levels/5"),_SCS("set_glow_level"),_SCS("is_glow_level_enabled"),4 ); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"glow_levels/6"),_SCS("set_glow_level"),_SCS("is_glow_level_enabled"),5 ); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"glow_levels/7"),_SCS("set_glow_level"),_SCS("is_glow_level_enabled"),6 ); + + ADD_PROPERTY(PropertyInfo(Variant::REAL,"glow_intensity",PROPERTY_HINT_RANGE,"0.0,8.0,0.01"),_SCS("set_glow_intensity"),_SCS("get_glow_intensity") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"glow_strength",PROPERTY_HINT_RANGE,"0.0,2.0,0.01"),_SCS("set_glow_strength"),_SCS("get_glow_strength") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"glow_bloom",PROPERTY_HINT_RANGE,"0.0,1.0,0.01"),_SCS("set_glow_bloom"),_SCS("get_glow_bloom") ); + ADD_PROPERTY(PropertyInfo(Variant::INT,"glow_blend_mode",PROPERTY_HINT_ENUM,"Additive,Screen,Softlight,Replace"),_SCS("set_glow_blend_mode"),_SCS("get_glow_blend_mode") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"glow_hdr_treshold",PROPERTY_HINT_RANGE,"0.0,4.0,0.01"),_SCS("set_glow_hdr_bleed_treshold"),_SCS("get_glow_hdr_bleed_treshold") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"glow_hdr_scale",PROPERTY_HINT_RANGE,"0.0,4.0,0.01"),_SCS("set_glow_hdr_bleed_scale"),_SCS("get_glow_hdr_bleed_scale") ); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"glow_bicubic_upscale"),_SCS("set_glow_bicubic_upscale"),_SCS("is_glow_bicubic_upscale_enabled") ); + + + ClassDB::bind_method(_MD("set_tonemapper","mode"),&Environment::set_tonemapper); + ClassDB::bind_method(_MD("get_tonemapper"),&Environment::get_tonemapper); + + ClassDB::bind_method(_MD("set_tonemap_exposure","exposure"),&Environment::set_tonemap_exposure); + ClassDB::bind_method(_MD("get_tonemap_exposure"),&Environment::get_tonemap_exposure); + + ClassDB::bind_method(_MD("set_tonemap_white","white"),&Environment::set_tonemap_white); + ClassDB::bind_method(_MD("get_tonemap_white"),&Environment::get_tonemap_white); + + ClassDB::bind_method(_MD("set_tonemap_auto_exposure","auto_exposure"),&Environment::set_tonemap_auto_exposure); + ClassDB::bind_method(_MD("get_tonemap_auto_exposure"),&Environment::get_tonemap_auto_exposure); + + ClassDB::bind_method(_MD("set_tonemap_auto_exposure_max","exposure_max"),&Environment::set_tonemap_auto_exposure_max); + ClassDB::bind_method(_MD("get_tonemap_auto_exposure_max"),&Environment::get_tonemap_auto_exposure_max); + + ClassDB::bind_method(_MD("set_tonemap_auto_exposure_min","exposure_min"),&Environment::set_tonemap_auto_exposure_min); + ClassDB::bind_method(_MD("get_tonemap_auto_exposure_min"),&Environment::get_tonemap_auto_exposure_min); + + ClassDB::bind_method(_MD("set_tonemap_auto_exposure_speed","exposure_speed"),&Environment::set_tonemap_auto_exposure_speed); + ClassDB::bind_method(_MD("get_tonemap_auto_exposure_speed"),&Environment::get_tonemap_auto_exposure_speed); + + ClassDB::bind_method(_MD("set_tonemap_auto_exposure_grey","exposure_grey"),&Environment::set_tonemap_auto_exposure_grey); + ClassDB::bind_method(_MD("get_tonemap_auto_exposure_grey"),&Environment::get_tonemap_auto_exposure_grey); + + + ADD_GROUP("Tonemap","tonemap_"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"tonemap_mode",PROPERTY_HINT_ENUM,"Linear,Reindhart,Filmic,Aces"),_SCS("set_tonemapper"),_SCS("get_tonemapper") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"tonemap_exposure",PROPERTY_HINT_RANGE,"0,16,0.01"),_SCS("set_tonemap_exposure"),_SCS("get_tonemap_exposure") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"tonemap_white",PROPERTY_HINT_RANGE,"0,16,0.01"),_SCS("set_tonemap_white"),_SCS("get_tonemap_white") ); + ADD_GROUP("Auto Exposure","auto_exposure_"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"auto_expoure_enabled"),_SCS("set_tonemap_auto_exposure"),_SCS("get_tonemap_auto_exposure") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"auto_expoure_scale",PROPERTY_HINT_RANGE,"0.01,64,0.01"),_SCS("set_tonemap_auto_exposure_grey"),_SCS("get_tonemap_auto_exposure_grey") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"auto_expoure_min_luma",PROPERTY_HINT_RANGE,"0,16,0.01"),_SCS("set_tonemap_auto_exposure_min"),_SCS("get_tonemap_auto_exposure_min") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"auto_expoure_max_luma",PROPERTY_HINT_RANGE,"0,16,0.01"),_SCS("set_tonemap_auto_exposure_max"),_SCS("get_tonemap_auto_exposure_max") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"auto_expoure_speed",PROPERTY_HINT_RANGE,"0.01,64,0.01"),_SCS("set_tonemap_auto_exposure_speed"),_SCS("get_tonemap_auto_exposure_speed") ); + + ClassDB::bind_method(_MD("set_adjustment_enable","enabled"),&Environment::set_adjustment_enable); + ClassDB::bind_method(_MD("is_adjustment_enabled"),&Environment::is_adjustment_enabled); + + ClassDB::bind_method(_MD("set_adjustment_brightness","brightness"),&Environment::set_adjustment_brightness); + ClassDB::bind_method(_MD("get_adjustment_brightness"),&Environment::get_adjustment_brightness); + + ClassDB::bind_method(_MD("set_adjustment_contrast","contrast"),&Environment::set_adjustment_contrast); + ClassDB::bind_method(_MD("get_adjustment_contrast"),&Environment::get_adjustment_contrast); + + ClassDB::bind_method(_MD("set_adjustment_saturation","saturation"),&Environment::set_adjustment_saturation); + ClassDB::bind_method(_MD("get_adjustment_saturation"),&Environment::get_adjustment_saturation); + + ClassDB::bind_method(_MD("set_adjustment_color_correction","color_correction"),&Environment::set_adjustment_color_correction); + ClassDB::bind_method(_MD("get_adjustment_color_correction"),&Environment::get_adjustment_color_correction); + + ADD_GROUP("Adjustments","adjustment_"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL,"adjustment_enabled"),_SCS("set_adjustment_enable"),_SCS("is_adjustment_enabled") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"adjustment_brightness",PROPERTY_HINT_RANGE,"0.01,8,0.01"),_SCS("set_adjustment_brightness"),_SCS("get_adjustment_brightness") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"adjustment_contrast",PROPERTY_HINT_RANGE,"0.01,8,0.01"),_SCS("set_adjustment_contrast"),_SCS("get_adjustment_contrast") ); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"adjustment_saturation",PROPERTY_HINT_RANGE,"0.01,8,0.01"),_SCS("set_adjustment_saturation"),_SCS("get_adjustment_saturation") ); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"adjustment_color_correction",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_adjustment_color_correction"),_SCS("get_adjustment_color_correction") ); + + + GLOBAL_DEF("rendering/skybox/irradiance_cube_resolution",256); + + BIND_CONSTANT(BG_KEEP); + BIND_CONSTANT(BG_CLEAR_COLOR); + BIND_CONSTANT(BG_COLOR); + BIND_CONSTANT(BG_SKYBOX); + BIND_CONSTANT(BG_CANVAS); + BIND_CONSTANT(BG_MAX); + BIND_CONSTANT(GLOW_BLEND_MODE_ADDITIVE); + BIND_CONSTANT(GLOW_BLEND_MODE_SCREEN); + BIND_CONSTANT(GLOW_BLEND_MODE_SOFTLIGHT); + BIND_CONSTANT(GLOW_BLEND_MODE_REPLACE); + BIND_CONSTANT(TONE_MAPPER_LINEAR); + BIND_CONSTANT(TONE_MAPPER_REINHARDT); + BIND_CONSTANT(TONE_MAPPER_FILMIC); + BIND_CONSTANT(TONE_MAPPER_ACES); + BIND_CONSTANT(DOF_BLUR_QUALITY_LOW); + BIND_CONSTANT(DOF_BLUR_QUALITY_MEDIUM); + BIND_CONSTANT(DOF_BLUR_QUALITY_HIGH); + } Environment::Environment() { + bg_mode=BG_CLEAR_COLOR; + bg_skybox_scale=1.0; + bg_energy=1.0; + bg_canvas_max_layer=0; + ambient_energy=1.0; + ambient_skybox_contribution=0; + + + tone_mapper=TONE_MAPPER_LINEAR; + tonemap_exposure=1.0; + tonemap_white=1.0; + tonemap_auto_exposure=false; + tonemap_auto_exposure_max=8; + tonemap_auto_exposure_min=0.05; + tonemap_auto_exposure_speed=0.5; + tonemap_auto_exposure_grey=0.4; + + set_tonemapper(tone_mapper); //update + + adjustment_enabled=false; + adjustment_contrast=1.0; + adjustment_saturation=1.0; + adjustment_brightness=1.0; + + set_adjustment_enable(adjustment_enabled); //update + environment = VS::get_singleton()->environment_create(); - set_background(BG_DEFAULT_COLOR); - set_background_param(BG_PARAM_COLOR,Color(0,0,0)); - set_background_param(BG_PARAM_TEXTURE,Ref<ImageTexture>()); - set_background_param(BG_PARAM_CUBEMAP,Ref<CubeMap>()); - set_background_param(BG_PARAM_ENERGY,1.0); - set_background_param(BG_PARAM_SCALE,1.0); - set_background_param(BG_PARAM_GLOW,0.0); - - for(int i=0;i<FX_MAX;i++) - set_enable_fx(Fx(i),false); - - fx_set_param(FX_PARAM_AMBIENT_LIGHT_COLOR,Color(0,0,0)); - fx_set_param(FX_PARAM_AMBIENT_LIGHT_ENERGY,1.0); - fx_set_param(FX_PARAM_GLOW_BLUR_PASSES,1); - fx_set_param(FX_PARAM_GLOW_BLUR_SCALE,1); - fx_set_param(FX_PARAM_GLOW_BLUR_STRENGTH,1); - fx_set_param(FX_PARAM_GLOW_BLOOM,0.0); - fx_set_param(FX_PARAM_GLOW_BLOOM_TRESHOLD,0.5); - fx_set_param(FX_PARAM_DOF_BLUR_PASSES,1); - fx_set_param(FX_PARAM_DOF_BLUR_BEGIN,100.0); - fx_set_param(FX_PARAM_DOF_BLUR_RANGE,10.0); - fx_set_param(FX_PARAM_HDR_TONEMAPPER,FX_HDR_TONE_MAPPER_LINEAR); - fx_set_param(FX_PARAM_HDR_EXPOSURE,0.4); - fx_set_param(FX_PARAM_HDR_WHITE,1.0); - fx_set_param(FX_PARAM_HDR_GLOW_TRESHOLD,0.95); - fx_set_param(FX_PARAM_HDR_GLOW_SCALE,0.2); - fx_set_param(FX_PARAM_HDR_MIN_LUMINANCE,0.4); - fx_set_param(FX_PARAM_HDR_MAX_LUMINANCE,8.0); - fx_set_param(FX_PARAM_HDR_EXPOSURE_ADJUST_SPEED,0.5); - fx_set_param(FX_PARAM_FOG_BEGIN,100.0); - fx_set_param(FX_PARAM_FOG_ATTENUATION,1.0); - fx_set_param(FX_PARAM_FOG_BEGIN_COLOR,Color(0,0,0)); - fx_set_param(FX_PARAM_FOG_END_COLOR,Color(0,0,0)); - fx_set_param(FX_PARAM_FOG_BG,true); - fx_set_param(FX_PARAM_BCS_BRIGHTNESS,1.0); - fx_set_param(FX_PARAM_BCS_CONTRAST,1.0); - fx_set_param(FX_PARAM_BCS_SATURATION,1.0); + ssr_enabled=false; + ssr_max_steps=64; + ssr_accel=0.04; + ssr_fade=2.0; + ssr_depth_tolerance=0.2; + ssr_smooth=true; + ssr_roughness=true; + + ssao_enabled=false; + ssao_radius=1; + ssao_intensity=1; + ssao_radius2=0; + ssao_intensity2=1; + ssao_bias=0.01; + ssao_direct_light_affect=false; + ssao_blur=true; + + glow_enabled=false; + glow_levels=(1<<2)|(1<<4); + glow_intensity=0.8; + glow_strength=1.0; + glow_bloom=0.0; + glow_blend_mode=GLOW_BLEND_MODE_SOFTLIGHT; + glow_hdr_bleed_treshold=1.0; + glow_hdr_bleed_scale=2.0; + glow_bicubic_upscale=false; + + dof_blur_far_enabled=false; + dof_blur_far_distance=10; + dof_blur_far_transition=5; + dof_blur_far_amount=0.1; + dof_blur_far_quality=DOF_BLUR_QUALITY_MEDIUM; + + dof_blur_near_enabled=false; + dof_blur_near_distance=2; + dof_blur_near_transition=1; + dof_blur_near_amount=0.1; + dof_blur_near_quality=DOF_BLUR_QUALITY_MEDIUM; } + Environment::~Environment() { VS::get_singleton()->free(environment); diff --git a/scene/resources/environment.h b/scene/resources/environment.h index a72cc6a47f..b8c243b588 100644 --- a/scene/resources/environment.h +++ b/scene/resources/environment.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,113 +31,288 @@ #include "resource.h" #include "servers/visual_server.h" +#include "scene/resources/texture.h" +#include "scene/resources/sky_box.h" class Environment : public Resource { - OBJ_TYPE(Environment,Resource); + GDCLASS(Environment,Resource); public: - enum BG { + enum BGMode { - BG_KEEP=VS::ENV_BG_KEEP, - BG_DEFAULT_COLOR=VS::ENV_BG_DEFAULT_COLOR, - BG_COLOR=VS::ENV_BG_COLOR, - BG_TEXTURE=VS::ENV_BG_TEXTURE, - BG_CUBEMAP=VS::ENV_BG_CUBEMAP, - BG_CANVAS=VS::ENV_BG_CANVAS, - BG_MAX=VS::ENV_BG_MAX + BG_CLEAR_COLOR, + BG_COLOR, + BG_SKYBOX, + BG_CANVAS, + BG_KEEP, + BG_MAX }; - enum BGParam { - BG_PARAM_CANVAS_MAX_LAYER=VS::ENV_BG_PARAM_CANVAS_MAX_LAYER, - BG_PARAM_COLOR=VS::ENV_BG_PARAM_COLOR, - BG_PARAM_TEXTURE=VS::ENV_BG_PARAM_TEXTURE, - BG_PARAM_CUBEMAP=VS::ENV_BG_PARAM_CUBEMAP, - BG_PARAM_ENERGY=VS::ENV_BG_PARAM_ENERGY, - BG_PARAM_SCALE=VS::ENV_BG_PARAM_SCALE, - BG_PARAM_GLOW=VS::ENV_BG_PARAM_GLOW, - BG_PARAM_MAX=VS::ENV_BG_PARAM_MAX - }; - enum Fx { - FX_AMBIENT_LIGHT=VS::ENV_FX_AMBIENT_LIGHT, - FX_FXAA=VS::ENV_FX_FXAA, - FX_GLOW=VS::ENV_FX_GLOW, - FX_DOF_BLUR=VS::ENV_FX_DOF_BLUR, - FX_HDR=VS::ENV_FX_HDR, - FX_FOG=VS::ENV_FX_FOG, - FX_BCS=VS::ENV_FX_BCS, - FX_SRGB=VS::ENV_FX_SRGB, - FX_MAX=VS::ENV_FX_MAX, + enum ToneMapper { + TONE_MAPPER_LINEAR, + TONE_MAPPER_REINHARDT, + TONE_MAPPER_FILMIC, + TONE_MAPPER_ACES }; - enum FxBlurBlendMode { - FX_BLUR_BLEND_MODE_ADDITIVE, - FX_BLUR_BLEND_MODE_SCREEN, - FX_BLUR_BLEND_MODE_SOFTLIGHT, + enum GlowBlendMode { + GLOW_BLEND_MODE_ADDITIVE, + GLOW_BLEND_MODE_SCREEN, + GLOW_BLEND_MODE_SOFTLIGHT, + GLOW_BLEND_MODE_REPLACE, }; - enum FxHDRToneMapper { - FX_HDR_TONE_MAPPER_LINEAR, - FX_HDR_TONE_MAPPER_LOG, - FX_HDR_TONE_MAPPER_REINHARDT, - FX_HDR_TONE_MAPPER_REINHARDT_AUTOWHITE, + enum DOFBlurQuality { + DOF_BLUR_QUALITY_LOW, + DOF_BLUR_QUALITY_MEDIUM, + DOF_BLUR_QUALITY_HIGH, }; - enum FxParam { - FX_PARAM_AMBIENT_LIGHT_COLOR=VS::ENV_FX_PARAM_AMBIENT_LIGHT_COLOR, - FX_PARAM_AMBIENT_LIGHT_ENERGY=VS::ENV_FX_PARAM_AMBIENT_LIGHT_ENERGY, - FX_PARAM_GLOW_BLUR_PASSES=VS::ENV_FX_PARAM_GLOW_BLUR_PASSES, - FX_PARAM_GLOW_BLUR_SCALE=VS::ENV_FX_PARAM_GLOW_BLUR_SCALE, - FX_PARAM_GLOW_BLUR_STRENGTH=VS::ENV_FX_PARAM_GLOW_BLUR_STRENGTH, - FX_PARAM_GLOW_BLUR_BLEND_MODE=VS::ENV_FX_PARAM_GLOW_BLUR_BLEND_MODE, - FX_PARAM_GLOW_BLOOM=VS::ENV_FX_PARAM_GLOW_BLOOM, - FX_PARAM_GLOW_BLOOM_TRESHOLD=VS::ENV_FX_PARAM_GLOW_BLOOM_TRESHOLD, - FX_PARAM_DOF_BLUR_PASSES=VS::ENV_FX_PARAM_DOF_BLUR_PASSES, - FX_PARAM_DOF_BLUR_BEGIN=VS::ENV_FX_PARAM_DOF_BLUR_BEGIN, - FX_PARAM_DOF_BLUR_RANGE=VS::ENV_FX_PARAM_DOF_BLUR_RANGE, - FX_PARAM_HDR_EXPOSURE=VS::ENV_FX_PARAM_HDR_EXPOSURE, - FX_PARAM_HDR_TONEMAPPER=VS::ENV_FX_PARAM_HDR_TONEMAPPER, - FX_PARAM_HDR_WHITE=VS::ENV_FX_PARAM_HDR_WHITE, - FX_PARAM_HDR_GLOW_TRESHOLD=VS::ENV_FX_PARAM_HDR_GLOW_TRESHOLD, - FX_PARAM_HDR_GLOW_SCALE=VS::ENV_FX_PARAM_HDR_GLOW_SCALE, - FX_PARAM_HDR_MIN_LUMINANCE=VS::ENV_FX_PARAM_HDR_MIN_LUMINANCE, - FX_PARAM_HDR_MAX_LUMINANCE=VS::ENV_FX_PARAM_HDR_MAX_LUMINANCE, - FX_PARAM_HDR_EXPOSURE_ADJUST_SPEED=VS::ENV_FX_PARAM_HDR_EXPOSURE_ADJUST_SPEED, - FX_PARAM_FOG_BEGIN=VS::ENV_FX_PARAM_FOG_BEGIN, - FX_PARAM_FOG_BEGIN_COLOR=VS::ENV_FX_PARAM_FOG_BEGIN_COLOR, - FX_PARAM_FOG_END_COLOR=VS::ENV_FX_PARAM_FOG_END_COLOR, - FX_PARAM_FOG_ATTENUATION=VS::ENV_FX_PARAM_FOG_ATTENUATION, - FX_PARAM_FOG_BG=VS::ENV_FX_PARAM_FOG_BG, - FX_PARAM_BCS_BRIGHTNESS=VS::ENV_FX_PARAM_BCS_BRIGHTNESS, - FX_PARAM_BCS_CONTRAST=VS::ENV_FX_PARAM_BCS_CONTRAST, - FX_PARAM_BCS_SATURATION=VS::ENV_FX_PARAM_BCS_SATURATION, - FX_PARAM_MAX=VS::ENV_FX_PARAM_MAX - }; private: - - BG bg_mode; - Variant bg_param[BG_PARAM_MAX]; - bool fx_enabled[FX_MAX]; - Variant fx_param[FX_PARAM_MAX]; RID environment; + BGMode bg_mode; + Ref<SkyBox> bg_skybox; + float bg_skybox_scale; + Color bg_color; + float bg_energy; + int bg_canvas_max_layer; + Color ambient_color; + float ambient_energy; + float ambient_skybox_contribution; + + ToneMapper tone_mapper; + float tonemap_exposure; + float tonemap_white; + bool tonemap_auto_exposure; + float tonemap_auto_exposure_max; + float tonemap_auto_exposure_min; + float tonemap_auto_exposure_speed; + float tonemap_auto_exposure_grey; + + bool adjustment_enabled; + float adjustment_contrast; + float adjustment_saturation; + float adjustment_brightness; + Ref<Texture> adjustment_color_correction; + + bool ssr_enabled; + int ssr_max_steps; + float ssr_accel; + float ssr_fade; + float ssr_depth_tolerance; + bool ssr_smooth; + bool ssr_roughness; + + bool ssao_enabled; + float ssao_radius; + float ssao_intensity; + float ssao_radius2; + float ssao_intensity2; + float ssao_bias; + float ssao_direct_light_affect; + Color ssao_color; + bool ssao_blur; + + bool glow_enabled; + int glow_levels; + float glow_intensity; + float glow_strength; + float glow_bloom; + GlowBlendMode glow_blend_mode; + float glow_hdr_bleed_treshold; + float glow_hdr_bleed_scale; + bool glow_bicubic_upscale; + + bool dof_blur_far_enabled; + float dof_blur_far_distance; + float dof_blur_far_transition; + float dof_blur_far_amount; + DOFBlurQuality dof_blur_far_quality; + + bool dof_blur_near_enabled; + float dof_blur_near_distance; + float dof_blur_near_transition; + float dof_blur_near_amount; + DOFBlurQuality dof_blur_near_quality; + protected: static void _bind_methods(); + virtual void _validate_property(PropertyInfo& property) const; + public: - void set_background(BG p_bg); - BG get_background() const; - void set_background_param(BGParam p_param, const Variant& p_value); - Variant get_background_param(BGParam p_param) const; - void set_enable_fx(Fx p_effect,bool p_enabled); - bool is_fx_enabled(Fx p_effect) const; + void set_background(BGMode p_bg); + void set_skybox(const Ref<SkyBox>& p_skybox); + void set_skybox_scale(float p_scale); + void set_bg_color(const Color& p_color); + void set_bg_energy(float p_energy); + void set_canvas_max_layer(int p_max_layer); + void set_ambient_light_color(const Color& p_color); + void set_ambient_light_energy(float p_energy); + void set_ambient_light_skybox_contribution(float p_energy); + + BGMode get_background() const; + Ref<SkyBox> get_skybox() const; + float get_skybox_scale() const; + Color get_bg_color() const; + float get_bg_energy() const; + int get_canvas_max_layer() const; + Color get_ambient_light_color() const; + float get_ambient_light_energy() const; + float get_ambient_light_skybox_contribution() const; + + + void set_tonemapper(ToneMapper p_tone_mapper); + ToneMapper get_tonemapper() const; + + void set_tonemap_exposure(float p_exposure); + float get_tonemap_exposure() const; + + void set_tonemap_white(float p_white); + float get_tonemap_white() const; + + void set_tonemap_auto_exposure(bool p_enabled); + bool get_tonemap_auto_exposure() const; + + void set_tonemap_auto_exposure_max(float p_auto_exposure_max); + float get_tonemap_auto_exposure_max() const; + + void set_tonemap_auto_exposure_min(float p_auto_exposure_min); + float get_tonemap_auto_exposure_min() const; + + void set_tonemap_auto_exposure_speed(float p_auto_exposure_speed); + float get_tonemap_auto_exposure_speed() const; + + void set_tonemap_auto_exposure_grey(float p_auto_exposure_grey); + float get_tonemap_auto_exposure_grey() const; + + void set_adjustment_enable(bool p_enable); + bool is_adjustment_enabled() const; + + void set_adjustment_brightness(float p_brightness); + float get_adjustment_brightness() const; + + void set_adjustment_contrast(float p_contrast); + float get_adjustment_contrast() const; + + void set_adjustment_saturation(float p_saturation); + float get_adjustment_saturation() const; + + void set_adjustment_color_correction(const Ref<Texture>& p_ramp); + Ref<Texture> get_adjustment_color_correction() const; + + void set_ssr_enabled(bool p_enable); + bool is_ssr_enabled() const; + + void set_ssr_max_steps(int p_steps); + int get_ssr_max_steps() const; + + void set_ssr_accel(float p_accel); + float get_ssr_accel() const; + + void set_ssr_fade(float p_transition); + float get_ssr_fade() const; + + void set_ssr_depth_tolerance(float p_depth_tolerance); + float get_ssr_depth_tolerance() const; + + void set_ssr_smooth(bool p_enable); + bool is_ssr_smooth() const; + + void set_ssr_rough(bool p_enable); + bool is_ssr_rough() const; + + void set_ssao_enabled(bool p_enable); + bool is_ssao_enabled() const; + + void set_ssao_radius(float p_radius); + float get_ssao_radius() const; + + void set_ssao_intensity(float p_intensity); + float get_ssao_intensity() const; + + void set_ssao_radius2(float p_radius); + float get_ssao_radius2() const; + + void set_ssao_intensity2(float p_intensity); + float get_ssao_intensity2() const; + + void set_ssao_bias(float p_bias); + float get_ssao_bias() const; + + void set_ssao_direct_light_affect(float p_direct_light_affect); + float get_ssao_direct_light_affect() const; + + void set_ssao_color(const Color& p_color); + Color get_ssao_color() const; + + void set_ssao_blur(bool p_enable); + bool is_ssao_blur_enabled() const; + + + void set_glow_enabled(bool p_enabled); + bool is_glow_enabled() const; + + void set_glow_level(int p_level,bool p_enabled); + bool is_glow_level_enabled(int p_level) const; + + void set_glow_intensity(float p_intensity); + float get_glow_intensity() const; + + void set_glow_strength(float p_strength); + float get_glow_strength() const; + + void set_glow_bloom(float p_treshold); + float get_glow_bloom() const; + + void set_glow_blend_mode(GlowBlendMode p_mode); + GlowBlendMode get_glow_blend_mode() const; + + void set_glow_hdr_bleed_treshold(float p_treshold); + float get_glow_hdr_bleed_treshold() const; + + void set_glow_hdr_bleed_scale(float p_scale); + float get_glow_hdr_bleed_scale() const; + + void set_glow_bicubic_upscale(bool p_enable); + bool is_glow_bicubic_upscale_enabled() const; + + void set_dof_blur_far_enabled(bool p_enable); + bool is_dof_blur_far_enabled() const; + + void set_dof_blur_far_distance(float p_distance); + float get_dof_blur_far_distance() const; + + void set_dof_blur_far_transition(float p_distance); + float get_dof_blur_far_transition() const; + + void set_dof_blur_far_amount(float p_amount); + float get_dof_blur_far_amount() const; + + void set_dof_blur_far_quality(DOFBlurQuality p_quality); + DOFBlurQuality get_dof_blur_far_quality() const; + + void set_dof_blur_near_enabled(bool p_enable); + bool is_dof_blur_near_enabled() const; + + void set_dof_blur_near_distance(float p_distance); + float get_dof_blur_near_distance() const; + + void set_dof_blur_near_transition(float p_distance); + float get_dof_blur_near_transition() const; + + void set_dof_blur_near_amount(float p_amount); + float get_dof_blur_near_amount() const; + + void set_dof_blur_near_quality(DOFBlurQuality p_quality); + DOFBlurQuality get_dof_blur_near_quality() const; - void fx_set_param(FxParam p_param,const Variant& p_value); - Variant fx_get_param(FxParam p_param) const; virtual RID get_rid() const; @@ -145,9 +320,12 @@ public: ~Environment(); }; -VARIANT_ENUM_CAST( Environment::BG ); -VARIANT_ENUM_CAST( Environment::BGParam ); -VARIANT_ENUM_CAST( Environment::Fx ); -VARIANT_ENUM_CAST( Environment::FxParam ); + + + +VARIANT_ENUM_CAST(Environment::BGMode) +VARIANT_ENUM_CAST(Environment::ToneMapper) +VARIANT_ENUM_CAST(Environment::GlowBlendMode) +VARIANT_ENUM_CAST(Environment::DOFBlurQuality) #endif // ENVIRONMENT_H diff --git a/scene/resources/event_stream.cpp b/scene/resources/event_stream.cpp index 8667bcc5db..521f305327 100644 --- a/scene/resources/event_stream.cpp +++ b/scene/resources/event_stream.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/event_stream.h b/scene/resources/event_stream.h index 6ee9b76717..40af78fcce 100644 --- a/scene/resources/event_stream.h +++ b/scene/resources/event_stream.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class EventStreamPlayback : public Reference { - OBJ_TYPE(EventStreamPlayback,Reference); + GDCLASS(EventStreamPlayback,Reference); class InternalEventStream : public AudioServer::EventStream { public: @@ -99,7 +99,7 @@ public: class EventStream : public Resource { - OBJ_TYPE(EventStream,Resource); + GDCLASS(EventStream,Resource); OBJ_SAVE_TYPE( EventStream ); //children are all saved as EventStream, so they can be exchanged public: diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index 1afa3fec19..3373478336 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -78,14 +78,14 @@ void Font::update_changes() { void Font::_bind_methods() { - ObjectTypeDB::bind_method(_MD("draw","canvas_item","pos","string","modulate","clip_w"),&Font::draw,DEFVAL(Color(1,1,1)),DEFVAL(-1)); - ObjectTypeDB::bind_method(_MD("get_ascent"),&Font::get_ascent); - ObjectTypeDB::bind_method(_MD("get_descent"),&Font::get_descent); - ObjectTypeDB::bind_method(_MD("get_height"),&Font::get_height); - ObjectTypeDB::bind_method(_MD("is_distance_field_hint"),&Font::is_distance_field_hint); - ObjectTypeDB::bind_method(_MD("get_string_size","string"),&Font::get_string_size); - ObjectTypeDB::bind_method(_MD("draw_char","canvas_item","pos","char","next","modulate"),&Font::draw_char,DEFVAL(-1),DEFVAL(Color(1,1,1))); - ObjectTypeDB::bind_method(_MD("update_changes"),&Font::update_changes); + ClassDB::bind_method(_MD("draw","canvas_item","pos","string","modulate","clip_w"),&Font::draw,DEFVAL(Color(1,1,1)),DEFVAL(-1)); + ClassDB::bind_method(_MD("get_ascent"),&Font::get_ascent); + ClassDB::bind_method(_MD("get_descent"),&Font::get_descent); + ClassDB::bind_method(_MD("get_height"),&Font::get_height); + ClassDB::bind_method(_MD("is_distance_field_hint"),&Font::is_distance_field_hint); + ClassDB::bind_method(_MD("get_string_size","string"),&Font::get_string_size); + ClassDB::bind_method(_MD("draw_char","canvas_item","pos","char","next","modulate"),&Font::draw_char,DEFVAL(-1),DEFVAL(Color(1,1,1))); + ClassDB::bind_method(_MD("update_changes"),&Font::update_changes); } @@ -97,7 +97,7 @@ Font::Font() { ///////////////////////////////////////////////////////////////// -void BitmapFont::_set_chars(const DVector<int>& p_chars) { +void BitmapFont::_set_chars(const PoolVector<int>& p_chars) { int len = p_chars.size(); //char 1 charsize 1 texture, 4 rect, 2 align, advance 1 @@ -107,7 +107,7 @@ void BitmapFont::_set_chars(const DVector<int>& p_chars) { int chars = len/9; - DVector<int>::Read r=p_chars.read(); + PoolVector<int>::Read r=p_chars.read(); for(int i=0;i<chars;i++) { const int* data = &r[i*9]; @@ -116,9 +116,9 @@ void BitmapFont::_set_chars(const DVector<int>& p_chars) { } -DVector<int> BitmapFont::_get_chars() const { +PoolVector<int> BitmapFont::_get_chars() const { - DVector<int> chars; + PoolVector<int> chars; const CharType* key=NULL; @@ -140,13 +140,13 @@ DVector<int> BitmapFont::_get_chars() const { return chars; } -void BitmapFont::_set_kernings(const DVector<int>& p_kernings) { +void BitmapFont::_set_kernings(const PoolVector<int>& p_kernings) { int len=p_kernings.size(); ERR_FAIL_COND(len%3); if (!len) return; - DVector<int>::Read r=p_kernings.read(); + PoolVector<int>::Read r=p_kernings.read(); for(int i=0;i<len/3;i++) { @@ -155,9 +155,9 @@ void BitmapFont::_set_kernings(const DVector<int>& p_kernings) { } } -DVector<int> BitmapFont::_get_kernings() const { +PoolVector<int> BitmapFont::_get_kernings() const { - DVector<int> kernings; + PoolVector<int> kernings; for(Map<KerningPairKey,int>::Element *E=kerning_map.front();E;E=E->next()) { @@ -564,43 +564,43 @@ Size2 BitmapFont::get_char_size(CharType p_char,CharType p_next) const { void BitmapFont::_bind_methods() { - ObjectTypeDB::bind_method(_MD("create_from_fnt","path"),&BitmapFont::create_from_fnt); - ObjectTypeDB::bind_method(_MD("set_height","px"),&BitmapFont::set_height); + ClassDB::bind_method(_MD("create_from_fnt","path"),&BitmapFont::create_from_fnt); + ClassDB::bind_method(_MD("set_height","px"),&BitmapFont::set_height); - ObjectTypeDB::bind_method(_MD("set_ascent","px"),&BitmapFont::set_ascent); + ClassDB::bind_method(_MD("set_ascent","px"),&BitmapFont::set_ascent); - ObjectTypeDB::bind_method(_MD("add_kerning_pair","char_a","char_b","kerning"),&BitmapFont::add_kerning_pair); - ObjectTypeDB::bind_method(_MD("get_kerning_pair","char_a","char_b"),&BitmapFont::get_kerning_pair); + ClassDB::bind_method(_MD("add_kerning_pair","char_a","char_b","kerning"),&BitmapFont::add_kerning_pair); + ClassDB::bind_method(_MD("get_kerning_pair","char_a","char_b"),&BitmapFont::get_kerning_pair); - ObjectTypeDB::bind_method(_MD("add_texture","texture:Texture"),&BitmapFont::add_texture); - ObjectTypeDB::bind_method(_MD("add_char","character","texture","rect","align","advance"),&BitmapFont::add_char,DEFVAL(Point2()),DEFVAL(-1)); + ClassDB::bind_method(_MD("add_texture","texture:Texture"),&BitmapFont::add_texture); + ClassDB::bind_method(_MD("add_char","character","texture","rect","align","advance"),&BitmapFont::add_char,DEFVAL(Point2()),DEFVAL(-1)); - ObjectTypeDB::bind_method(_MD("get_texture_count"),&BitmapFont::get_texture_count); - ObjectTypeDB::bind_method(_MD("get_texture:Texture","idx"),&BitmapFont::get_texture); + ClassDB::bind_method(_MD("get_texture_count"),&BitmapFont::get_texture_count); + ClassDB::bind_method(_MD("get_texture:Texture","idx"),&BitmapFont::get_texture); - ObjectTypeDB::bind_method(_MD("get_char_size","char","next"),&BitmapFont::get_char_size,DEFVAL(0)); + ClassDB::bind_method(_MD("get_char_size","char","next"),&BitmapFont::get_char_size,DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("set_distance_field_hint","enable"),&BitmapFont::set_distance_field_hint); + ClassDB::bind_method(_MD("set_distance_field_hint","enable"),&BitmapFont::set_distance_field_hint); - ObjectTypeDB::bind_method(_MD("clear"),&BitmapFont::clear); + ClassDB::bind_method(_MD("clear"),&BitmapFont::clear); - ObjectTypeDB::bind_method(_MD("_set_chars"),&BitmapFont::_set_chars); - ObjectTypeDB::bind_method(_MD("_get_chars"),&BitmapFont::_get_chars); + ClassDB::bind_method(_MD("_set_chars"),&BitmapFont::_set_chars); + ClassDB::bind_method(_MD("_get_chars"),&BitmapFont::_get_chars); - ObjectTypeDB::bind_method(_MD("_set_kernings"),&BitmapFont::_set_kernings); - ObjectTypeDB::bind_method(_MD("_get_kernings"),&BitmapFont::_get_kernings); + ClassDB::bind_method(_MD("_set_kernings"),&BitmapFont::_set_kernings); + ClassDB::bind_method(_MD("_get_kernings"),&BitmapFont::_get_kernings); - ObjectTypeDB::bind_method(_MD("_set_textures"),&BitmapFont::_set_textures); - ObjectTypeDB::bind_method(_MD("_get_textures"),&BitmapFont::_get_textures); + ClassDB::bind_method(_MD("_set_textures"),&BitmapFont::_set_textures); + ClassDB::bind_method(_MD("_get_textures"),&BitmapFont::_get_textures); - ObjectTypeDB::bind_method(_MD("set_fallback","fallback"),&BitmapFont::set_fallback); - ObjectTypeDB::bind_method(_MD("get_fallback"),&BitmapFont::get_fallback); + ClassDB::bind_method(_MD("set_fallback","fallback"),&BitmapFont::set_fallback); + ClassDB::bind_method(_MD("get_fallback"),&BitmapFont::get_fallback); ADD_PROPERTY( PropertyInfo( Variant::ARRAY, "textures", PROPERTY_HINT_NONE,"", PROPERTY_USAGE_NOEDITOR ), _SCS("_set_textures"), _SCS("_get_textures") ); - ADD_PROPERTY( PropertyInfo( Variant::INT_ARRAY, "chars", PROPERTY_HINT_NONE,"", PROPERTY_USAGE_NOEDITOR ), _SCS("_set_chars"), _SCS("_get_chars") ); - ADD_PROPERTY( PropertyInfo( Variant::INT_ARRAY, "kernings", PROPERTY_HINT_NONE,"", PROPERTY_USAGE_NOEDITOR ), _SCS("_set_kernings"), _SCS("_get_kernings") ); + ADD_PROPERTY( PropertyInfo( Variant::POOL_INT_ARRAY, "chars", PROPERTY_HINT_NONE,"", PROPERTY_USAGE_NOEDITOR ), _SCS("_set_chars"), _SCS("_get_chars") ); + ADD_PROPERTY( PropertyInfo( Variant::POOL_INT_ARRAY, "kernings", PROPERTY_HINT_NONE,"", PROPERTY_USAGE_NOEDITOR ), _SCS("_set_kernings"), _SCS("_get_kernings") ); ADD_PROPERTY( PropertyInfo( Variant::REAL, "height", PROPERTY_HINT_RANGE,"-1024,1024,1" ), _SCS("set_height"), _SCS("get_height") ); ADD_PROPERTY( PropertyInfo( Variant::REAL, "ascent", PROPERTY_HINT_RANGE,"-1024,1024,1" ), _SCS("set_ascent"), _SCS("get_ascent") ); diff --git a/scene/resources/font.h b/scene/resources/font.h index fe4558f9e3..ad0f0176db 100644 --- a/scene/resources/font.h +++ b/scene/resources/font.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,7 +39,7 @@ class Font : public Resource { - OBJ_TYPE( Font, Resource ); + GDCLASS( Font, Resource ); protected: @@ -69,7 +69,7 @@ public: class BitmapFont : public Font { - OBJ_TYPE( BitmapFont, Font ); + GDCLASS( BitmapFont, Font ); RES_BASE_EXTENSION("fnt"); Vector< Ref<Texture> > textures; @@ -109,10 +109,10 @@ private: float ascent; bool distance_field_hint; - void _set_chars(const DVector<int>& p_chars); - DVector<int> _get_chars() const; - void _set_kernings(const DVector<int>& p_kernings); - DVector<int> _get_kernings() const; + void _set_chars(const PoolVector<int>& p_chars); + PoolVector<int> _get_chars() const; + void _set_kernings(const PoolVector<int>& p_kernings); + PoolVector<int> _get_kernings() const; void _set_textures(const Vector<Variant> & p_textures); Vector<Variant> _get_textures() const; diff --git a/scene/resources/gibberish_stream.cpp b/scene/resources/gibberish_stream.cpp index 73c135a913..3a6a6df7ea 100644 --- a/scene/resources/gibberish_stream.cpp +++ b/scene/resources/gibberish_stream.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -305,17 +305,17 @@ float AudioStreamGibberish::get_pitch_random_scale() const { void AudioStreamGibberish::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_phonemes","phonemes"),&AudioStreamGibberish::set_phonemes); - ObjectTypeDB::bind_method(_MD("get_phonemes"),&AudioStreamGibberish::get_phonemes); + ClassDB::bind_method(_MD("set_phonemes","phonemes"),&AudioStreamGibberish::set_phonemes); + ClassDB::bind_method(_MD("get_phonemes"),&AudioStreamGibberish::get_phonemes); - ObjectTypeDB::bind_method(_MD("set_pitch_scale","pitch_scale"),&AudioStreamGibberish::set_pitch_scale); - ObjectTypeDB::bind_method(_MD("get_pitch_scale"),&AudioStreamGibberish::get_pitch_scale); + ClassDB::bind_method(_MD("set_pitch_scale","pitch_scale"),&AudioStreamGibberish::set_pitch_scale); + ClassDB::bind_method(_MD("get_pitch_scale"),&AudioStreamGibberish::get_pitch_scale); - ObjectTypeDB::bind_method(_MD("set_pitch_random_scale","pitch_random_scale"),&AudioStreamGibberish::set_pitch_random_scale); - ObjectTypeDB::bind_method(_MD("get_pitch_random_scale"),&AudioStreamGibberish::get_pitch_random_scale); + ClassDB::bind_method(_MD("set_pitch_random_scale","pitch_random_scale"),&AudioStreamGibberish::set_pitch_random_scale); + ClassDB::bind_method(_MD("get_pitch_random_scale"),&AudioStreamGibberish::get_pitch_random_scale); - ObjectTypeDB::bind_method(_MD("set_xfade_time","sec"),&AudioStreamGibberish::set_xfade_time); - ObjectTypeDB::bind_method(_MD("get_xfade_time"),&AudioStreamGibberish::get_xfade_time); + ClassDB::bind_method(_MD("set_xfade_time","sec"),&AudioStreamGibberish::set_xfade_time); + ClassDB::bind_method(_MD("get_xfade_time"),&AudioStreamGibberish::get_xfade_time); ADD_PROPERTY( PropertyInfo(Variant::OBJECT,"phonemes",PROPERTY_HINT_RESOURCE_TYPE,"SampleLibrary"),_SCS("set_phonemes"),_SCS("get_phonemes")); ADD_PROPERTY( PropertyInfo(Variant::REAL,"pitch_scale",PROPERTY_HINT_RANGE,"0.01,64,0.01"),_SCS("set_pitch_scale"),_SCS("get_pitch_scale")); diff --git a/scene/resources/gibberish_stream.h b/scene/resources/gibberish_stream.h index 7affb4bd4d..257a1faebf 100644 --- a/scene/resources/gibberish_stream.h +++ b/scene/resources/gibberish_stream.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ #include "scene/resources/sample_library.h" class AudioStreamGibberish : public AudioStream { - OBJ_TYPE( AudioStreamGibberish, AudioStream ); + GDCLASS( AudioStreamGibberish, AudioStream ); enum { diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 9dc54ef0e4..112ecaae2f 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -29,576 +29,1128 @@ #include "material.h" #include "scene/scene_string_names.h" +RID Material::get_rid() const { -static const char*_flag_names[Material::FLAG_MAX]={ - "visible", - "double_sided", - "invert_faces", - "unshaded", - "on_top", - "lightmap_on_uv2", - "colarray_is_srgb" -}; - + return material; +} -static const Material::Flag _flag_indices[Material::FLAG_MAX]={ - Material::FLAG_VISIBLE, - Material::FLAG_DOUBLE_SIDED, - Material::FLAG_INVERT_FACES, - Material::FLAG_UNSHADED, - Material::FLAG_ONTOP, - Material::FLAG_LIGHTMAP_ON_UV2, - Material::FLAG_COLOR_ARRAY_SRGB, -}; +Material::Material() { + material=VisualServer::get_singleton()->material_create(); +} -RID Material::get_rid() const { +Material::~Material() { - return material; + VisualServer::get_singleton()->free(material); } -void Material::set_flag(Flag p_flag,bool p_enabled) { - ERR_FAIL_INDEX(p_flag,FLAG_MAX); - flags[p_flag]=p_enabled; - VisualServer::get_singleton()->material_set_flag(material,(VS::MaterialFlag)p_flag,p_enabled); - _change_notify(); +///////////////////////////////// + +Mutex *FixedSpatialMaterial::material_mutex=NULL; +SelfList<FixedSpatialMaterial>::List FixedSpatialMaterial::dirty_materials; +Map<FixedSpatialMaterial::MaterialKey,FixedSpatialMaterial::ShaderData> FixedSpatialMaterial::shader_map; +FixedSpatialMaterial::ShaderNames* FixedSpatialMaterial::shader_names=NULL; + +void FixedSpatialMaterial::init_shaders() { + +#ifndef NO_THREADS + material_mutex = Mutex::create(); +#endif + + shader_names = memnew( ShaderNames ); + + shader_names->albedo="albedo"; + shader_names->specular="specular"; + shader_names->roughness="roughness"; + shader_names->metalness="metalness"; + shader_names->emission="emission"; + shader_names->emission_energy="emission_energy"; + shader_names->normal_scale="normal_scale"; + shader_names->rim="rim"; + shader_names->rim_tint="rim_tint"; + shader_names->clearcoat="clearcoat"; + shader_names->clearcoat_gloss="clearcoat_gloss"; + shader_names->anisotropy="anisotropy_ratio"; + shader_names->height_scale="height_scale"; + shader_names->subsurface_scattering_strength="subsurface_scattering_strength"; + shader_names->refraction="refraction"; + shader_names->refraction_roughness="refraction_roughness"; + shader_names->point_size="point_size"; + shader_names->uv1_scale="uv1_scale"; + shader_names->uv1_offset="uv1_offset"; + shader_names->uv2_scale="uv2_scale"; + shader_names->uv2_offset="uv2_offset"; + + shader_names->texture_names[TEXTURE_ALBEDO]="texture_albedo"; + shader_names->texture_names[TEXTURE_SPECULAR]="texture_specular"; + shader_names->texture_names[TEXTURE_EMISSION]="texture_emission"; + shader_names->texture_names[TEXTURE_NORMAL]="texture_normal"; + shader_names->texture_names[TEXTURE_RIM]="texture_rim"; + shader_names->texture_names[TEXTURE_CLEARCOAT]="texture_clearcoat"; + shader_names->texture_names[TEXTURE_FLOWMAP]="texture_flowmap"; + shader_names->texture_names[TEXTURE_AMBIENT_OCCLUSION]="texture_ambient_occlusion"; + shader_names->texture_names[TEXTURE_HEIGHT]="texture_height"; + shader_names->texture_names[TEXTURE_SUBSURFACE_SCATTERING]="texture_subsurface_scattering"; + shader_names->texture_names[TEXTURE_REFRACTION]="texture_refraction"; + shader_names->texture_names[TEXTURE_REFRACTION_ROUGHNESS]="texture_refraction_roughness"; + shader_names->texture_names[TEXTURE_DETAIL_MASK]="texture_detail_mask"; + shader_names->texture_names[TEXTURE_DETAIL_ALBEDO]="texture_detail_albedo"; + shader_names->texture_names[TEXTURE_DETAIL_NORMAL]="texture_detail_normal"; + } +void FixedSpatialMaterial::finish_shaders(){ -void Material::set_blend_mode(BlendMode p_blend_mode) { +#ifndef NO_THREADS + memdelete( material_mutex ); +#endif + + memdelete( shader_names ); - ERR_FAIL_INDEX(p_blend_mode,4); - blend_mode=p_blend_mode; - VisualServer::get_singleton()->material_set_blend_mode(material,(VS::MaterialBlendMode)p_blend_mode); - _change_notify(); } -Material::BlendMode Material::get_blend_mode() const { - return blend_mode; + +void FixedSpatialMaterial::_update_shader() { + + dirty_materials.remove( &element ); + + MaterialKey mk = _compute_key(); + if (mk.key==current_key.key) + return; //no update required in the end + + if (shader_map.has(current_key)) { + shader_map[current_key].users--; + if (shader_map[current_key].users==0) { + //deallocate shader, as it's no longer in use + VS::get_singleton()->free(shader_map[current_key].shader); + shader_map.erase(current_key); + } + } + + current_key=mk; + + if (shader_map.has(mk)) { + + VS::get_singleton()->material_set_shader(_get_material(),shader_map[mk].shader); + shader_map[mk].users++; + return; + } + + //must create a shader! + + String code="render_mode "; + switch(blend_mode) { + case BLEND_MODE_MIX: code+="blend_mix"; break; + case BLEND_MODE_ADD: code+="blend_add"; break; + case BLEND_MODE_SUB: code+="blend_sub"; break; + case BLEND_MODE_MUL: code+="blend_mul"; break; + } + + switch(depth_draw_mode) { + case DEPTH_DRAW_OPAQUE_ONLY: code+=",depth_draw_opaque"; break; + case DEPTH_DRAW_ALWAYS: code+=",depth_draw_always"; break; + case DEPTH_DRAW_DISABLED: code+=",depth_draw_never"; break; + case DEPTH_DRAW_ALPHA_OPAQUE_PREPASS: code+=",depth_draw_alpha_prepass"; break; + } + + switch(cull_mode) { + case CULL_BACK: code+=",cull_back"; break; + case CULL_FRONT: code+=",cull_front"; break; + case CULL_DISABLED: code+=",cull_disabled"; break; + + } + + if (flags[FLAG_UNSHADED]) { + code+=",unshaded"; + } + if (flags[FLAG_ONTOP]) { + code+=",ontop"; + } + + code+=";\n"; + + + code+="uniform vec4 albedo : hint_color;\n"; + code+="uniform sampler2D texture_albedo : hint_albedo;\n"; + if (specular_mode==SPECULAR_MODE_SPECULAR) { + code+="uniform vec4 specular : hint_color;\n"; + } else { + code+="uniform float metalness;\n"; + } + + code+="uniform float roughness : hint_range(0,1);\n"; + code+="uniform float point_size : hint_range(0,128);\n"; + code+="uniform sampler2D texture_specular : hint_white;\n"; + code+="uniform vec2 uv1_scale;\n"; + code+="uniform vec2 uv1_offset;\n"; + code+="uniform vec2 uv2_scale;\n"; + code+="uniform vec2 uv2_offset;\n"; + + if (features[FEATURE_EMISSION]) { + + code+="uniform sampler2D texture_emission : hint_black_albedo;\n"; + code+="uniform vec4 emission : hint_color;\n"; + code+="uniform float emission_energy;\n"; + } + + if (features[FEATURE_NORMAL_MAPPING]) { + code+="uniform sampler2D texture_normal : hint_normal;\n"; + code+="uniform float normal_scale : hint_range(-16,16);\n"; + } + if (features[FEATURE_RIM]) { + code+="uniform float rim : hint_range(0,1);\n"; + code+="uniform float rim_tint : hint_range(0,1);\n"; + code+="uniform sampler2D texture_rim : hint_white;\n"; + } + if (features[FEATURE_CLEARCOAT]) { + code+="uniform float clearcoat : hint_range(0,1);\n"; + code+="uniform float clearcoat_gloss : hint_range(0,1);\n"; + code+="uniform sampler2D texture_clearcoat : hint_white;\n"; + } + if (features[FEATURE_ANISOTROPY]) { + code+="uniform float anisotropy_ratio : hint_range(0,256);\n"; + code+="uniform sampler2D texture_flowmap : hint_aniso;\n"; + } + if (features[FEATURE_AMBIENT_OCCLUSION]) { + code+="uniform sampler2D texture_ambient_occlusion : hint_white;\n"; + } + + if (features[FEATURE_DETAIL]) { + code+="uniform sampler2D texture_detail_albedo : hint_albedo;\n"; + code+="uniform sampler2D texture_detail_normal : hint_normal;\n"; + code+="uniform sampler2D texture_detail_mask : hint_white;\n"; + } + + if (features[FEATURE_SUBSURACE_SCATTERING]) { + + code+="uniform float subsurface_scattering_strength : hint_range(0,1);\n"; + code+="uniform sampler2D texture_subsurface_scattering : hint_white;\n"; + + } + + + code+="\n\n"; + + code+="void vertex() {\n"; + + if (flags[FLAG_SRGB_VERTEX_COLOR]) { + + code+="\tCOLOR.rgb = mix( pow((COLOR.rgb + vec3(0.055)) * (1.0 / (1.0 + 0.055)), vec3(2.4)), COLOR.rgb* (1.0 / 12.92), lessThan(COLOR.rgb,vec3(0.04045)) );\n"; + } + if (flags[FLAG_USE_POINT_SIZE]) { + + code+="\tPOINT_SIZE=point_size;\n"; + } + code+="\tUV=UV*uv1_scale+uv1_offset;\n"; + if (detail_uv==DETAIL_UV_2) { + code+="\tUV2=UV2*uv2_scale+uv2_offset;\n"; + } + + code+="}\n"; + code+="\n\n"; + code+="void fragment() {\n"; + + if (flags[FLAG_USE_POINT_SIZE]) { + code+="\tvec4 albedo_tex = texture(texture_albedo,POINT_COORD);\n"; + } else { + code+="\tvec4 albedo_tex = texture(texture_albedo,UV);\n"; + } + + if (flags[FLAG_ALBEDO_FROM_VERTEX_COLOR]) { + code+="\talbedo_tex *= COLOR;\n"; + } + + code+="\tALBEDO = albedo.rgb * albedo_tex.rgb;\n"; + if (features[FEATURE_TRANSPARENT]) { + code+="\tALPHA = albedo.a * albedo_tex.a;\n"; + } + + if (features[FEATURE_EMISSION]) { + code+="\tEMISSION = (emission.rgb+texture(texture_emission,UV).rgb)*emission_energy;\n"; + } + + if (features[FEATURE_NORMAL_MAPPING]) { + code+="\tNORMALMAP = texture(texture_normal,UV).rgb;\n"; + code+="\tNORMALMAP_DEPTH = normal_scale;\n"; + } + + if (features[FEATURE_RIM]) { + code+="\tvec2 rim_tex = texture(texture_rim,UV).xw;\n"; + code+="\tRIM = rim*rim_tex.x;"; + code+="\tRIM_TINT = rim_tint*rim_tex.y;\n"; + } + + if (features[FEATURE_CLEARCOAT]) { + code+="\tvec2 clearcoat_tex = texture(texture_clearcoat,UV).xw;\n"; + code+="\tCLEARCOAT = clearcoat*clearcoat_tex.x;"; + code+="\tCLEARCOAT_GLOSS = clearcoat_gloss*clearcoat_tex.y;\n"; + } + + if (features[FEATURE_ANISOTROPY]) { + code+="\tvec4 anisotropy_tex = texture(texture_flowmap,UV);\n"; + code+="\tANISOTROPY = anisotropy_ratio*anisotropy_tex.a;\n"; + code+="\tANISOTROPY_FLOW = anisotropy_tex.rg*2.0-1.0;\n"; + } + + if (features[FEATURE_AMBIENT_OCCLUSION]) { + code+="\tAO = texture(texture_ambient_occlusion,UV).r;\n"; + } + + if (features[FEATURE_SUBSURACE_SCATTERING]) { + + code+="\tfloat sss_tex = texture(texture_subsurface_scattering,UV).r;\n"; + code+="\tSSS_STRENGTH=subsurface_scattering_strength*sss_tex;\n"; + } + + if (features[FEATURE_DETAIL]) { + String det_uv=detail_uv==DETAIL_UV_1?"UV":"UV2"; + code+="\tvec4 detail_tex = texture(texture_detail_albedo,"+det_uv+");\n"; + code+="\tvec4 detail_norm_tex = texture(texture_detail_normal,"+det_uv+");\n"; + code+="\tvec4 detail_mask_tex = texture(texture_detail_mask,UV);\n"; + + switch(detail_blend_mode) { + case BLEND_MODE_MIX: { + code+="\tvec3 detail = mix(ALBEDO.rgb,detail_tex.rgb,detail_tex.a);\n"; + } break; + case BLEND_MODE_ADD: { + code+="\tvec3 detail = mix(ALBEDO.rgb,ALBEDO.rgb+detail_tex.rgb,detail_tex.a);\n"; + } break; + case BLEND_MODE_SUB: { + code+="\tvec3 detail = mix(ALBEDO.rgb,ALBEDO.rgb-detail_tex.rgb,detail_tex.a);\n"; + } break; + case BLEND_MODE_MUL: { + code+="\tvec3 detail = mix(ALBEDO.rgb,ALBEDO.rgb*detail_tex.rgb,detail_tex.a);\n"; + } break; + + } + + code+="\tvec3 detail_norm = mix(NORMALMAP,detail_norm_tex.rgb,detail_tex.a);\n"; + + code+="\tNORMALMAP = mix(NORMALMAP,detail_norm,detail_mask_tex.r);\n"; + code+="\tALBEDO.rgb = mix(ALBEDO.rgb,detail,detail_mask_tex.r);\n"; + } + + if (specular_mode==SPECULAR_MODE_SPECULAR) { + + code+="\tvec4 specular_tex = texture(texture_specular,UV);\n"; + code+="\tSPECULAR = specular.rgb * specular_tex.rgb;\n"; + code+="\tROUGHNESS = specular_tex.a * roughness;\n"; + } else { + code+="\tvec4 specular_tex = texture(texture_specular,UV);\n"; + code+="\tSPECULAR = vec3(metalness * specular_tex.r);\n"; + code+="\tROUGHNESS = specular_tex.a * roughness;\n"; + } + + code+="}\n"; + + ShaderData shader_data; + shader_data.shader = VS::get_singleton()->shader_create(VS::SHADER_SPATIAL); + shader_data.users=1; + + VS::get_singleton()->shader_set_code( shader_data.shader, code ); + + shader_map[mk]=shader_data; + + VS::get_singleton()->material_set_shader(_get_material(),shader_data.shader); + } +void FixedSpatialMaterial::flush_changes() { -void Material::set_depth_draw_mode(DepthDrawMode p_depth_draw_mode) { + if (material_mutex) + material_mutex->lock(); - depth_draw_mode=p_depth_draw_mode; - VisualServer::get_singleton()->material_set_depth_draw_mode(material,(VS::MaterialDepthDrawMode)p_depth_draw_mode); + while (dirty_materials.first()) { + + dirty_materials.first()->self()->_update_shader(); + } + + if (material_mutex) + material_mutex->unlock(); } -Material::DepthDrawMode Material::get_depth_draw_mode() const { +void FixedSpatialMaterial::_queue_shader_change() { + + if (material_mutex) + material_mutex->lock(); + + if (!element.in_list()) { + dirty_materials.add(&element); + } + + if (material_mutex) + material_mutex->unlock(); + - return depth_draw_mode; } -bool Material::get_flag(Flag p_flag) const { +bool FixedSpatialMaterial::_is_shader_dirty() const { - ERR_FAIL_INDEX_V(p_flag,FLAG_MAX,false); - return flags[p_flag]; + bool dirty=false; + + if (material_mutex) + material_mutex->lock(); + + dirty=element.in_list(); + + if (material_mutex) + material_mutex->unlock(); + + return dirty; } +void FixedSpatialMaterial::set_albedo(const Color& p_albedo) { -void Material::set_line_width(float p_width) { + albedo=p_albedo; - line_width=p_width; - VisualServer::get_singleton()->material_set_line_width(material,p_width); - _change_notify("line_width"); + VS::get_singleton()->material_set_param(_get_material(),shader_names->albedo,p_albedo); } -float Material::get_line_width() const { +Color FixedSpatialMaterial::get_albedo() const{ - return line_width; + return albedo; } +void FixedSpatialMaterial::set_specular_mode(SpecularMode p_mode) { + specular_mode=p_mode; + _change_notify(); + _queue_shader_change(); +} -void Material::_bind_methods() { +FixedSpatialMaterial::SpecularMode FixedSpatialMaterial::get_specular_mode() const { - ObjectTypeDB::bind_method(_MD("set_flag","flag","enable"),&Material::set_flag); - ObjectTypeDB::bind_method(_MD("get_flag","flag"),&Material::get_flag); - ObjectTypeDB::bind_method(_MD("set_blend_mode","mode"),&Material::set_blend_mode); - ObjectTypeDB::bind_method(_MD("get_blend_mode"),&Material::get_blend_mode); - ObjectTypeDB::bind_method(_MD("set_line_width","width"),&Material::set_line_width); - ObjectTypeDB::bind_method(_MD("get_line_width"),&Material::get_line_width); - ObjectTypeDB::bind_method(_MD("set_depth_draw_mode","mode"),&Material::set_depth_draw_mode); - ObjectTypeDB::bind_method(_MD("get_depth_draw_mode"),&Material::get_depth_draw_mode); + return specular_mode; +} +void FixedSpatialMaterial::set_specular(const Color& p_specular){ - for(int i=0;i<FLAG_MAX;i++) - ADD_PROPERTYI( PropertyInfo( Variant::BOOL, String()+"flags/"+_flag_names[i] ),_SCS("set_flag"),_SCS("get_flag"),_flag_indices[i]); + specular=p_specular; + VS::get_singleton()->material_set_param(_get_material(),shader_names->specular,p_specular); - ADD_PROPERTY( PropertyInfo( Variant::INT, "params/blend_mode",PROPERTY_HINT_ENUM,"Mix,Add,Sub,PMAlpha" ), _SCS("set_blend_mode"),_SCS("get_blend_mode")); - ADD_PROPERTY( PropertyInfo( Variant::INT, "params/depth_draw",PROPERTY_HINT_ENUM,"Always,Opaque Only,Pre-Pass Alpha,Never" ), _SCS("set_depth_draw_mode"),_SCS("get_depth_draw_mode")); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "params/line_width",PROPERTY_HINT_RANGE,"0.1,32.0,0.1" ), _SCS("set_line_width"),_SCS("get_line_width")); +} +Color FixedSpatialMaterial::get_specular() const{ - BIND_CONSTANT( FLAG_VISIBLE ); - BIND_CONSTANT( FLAG_DOUBLE_SIDED ); - BIND_CONSTANT( FLAG_INVERT_FACES ); - BIND_CONSTANT( FLAG_UNSHADED ); - BIND_CONSTANT( FLAG_ONTOP ); - BIND_CONSTANT( FLAG_LIGHTMAP_ON_UV2 ); - BIND_CONSTANT( FLAG_COLOR_ARRAY_SRGB ); - BIND_CONSTANT( FLAG_MAX ); + return specular; +} - BIND_CONSTANT( DEPTH_DRAW_ALWAYS ); - BIND_CONSTANT( DEPTH_DRAW_OPAQUE_ONLY ); - BIND_CONSTANT( DEPTH_DRAW_OPAQUE_PRE_PASS_ALPHA ); - BIND_CONSTANT( DEPTH_DRAW_NEVER ); +void FixedSpatialMaterial::set_roughness(float p_roughness){ - BIND_CONSTANT( BLEND_MODE_MIX ); - BIND_CONSTANT( BLEND_MODE_ADD ); - BIND_CONSTANT( BLEND_MODE_SUB ); - BIND_CONSTANT( BLEND_MODE_MUL ); - BIND_CONSTANT( BLEND_MODE_PREMULT_ALPHA ); + roughness=p_roughness; + VS::get_singleton()->material_set_param(_get_material(),shader_names->roughness,p_roughness); } -Material::Material(const RID& p_material) { - material=p_material; +float FixedSpatialMaterial::get_roughness() const{ - flags[FLAG_VISIBLE]=true; - flags[FLAG_DOUBLE_SIDED]=false; - flags[FLAG_INVERT_FACES]=false; - flags[FLAG_UNSHADED]=false; - flags[FLAG_ONTOP]=false; - flags[FLAG_LIGHTMAP_ON_UV2]=true; - flags[FLAG_COLOR_ARRAY_SRGB]=false; + return roughness; +} - depth_draw_mode=DEPTH_DRAW_OPAQUE_ONLY; +void FixedSpatialMaterial::set_metalness(float p_metalness){ - blend_mode=BLEND_MODE_MIX; + metalness=p_metalness; + VS::get_singleton()->material_set_param(_get_material(),shader_names->metalness,p_metalness); +} + +float FixedSpatialMaterial::get_metalness() const{ + + return metalness; } -Material::~Material() { +void FixedSpatialMaterial::set_emission(const Color& p_emission){ + + emission=p_emission; + VS::get_singleton()->material_set_param(_get_material(),shader_names->emission,p_emission); - VisualServer::get_singleton()->free(material); } +Color FixedSpatialMaterial::get_emission() const{ -static const char*_param_names[FixedMaterial::PARAM_MAX]={ - "diffuse", - "detail", - "specular", - "emission", - "specular_exp", - "glow", - "normal", - "shade_param" -}; - -static const char*_full_param_names[FixedMaterial::PARAM_MAX]={ - "params/diffuse", - "params/detail", - "params/specular", - "params/emission", - "params/specular_exp", - "params/glow", - "params/normal", - "params/shade_param" -}; - -/* -static const char*_texture_param_names[FixedMaterial::PARAM_MAX]={ - "tex_diffuse", - "tex_detail", - "tex_specular", - "tex_emission", - "tex_specular_exp", - "tex_glow", - "tex_detail_mix", - "tex_normal", - "tex_shade_param" -}; -*/ -static const FixedMaterial::Parameter _param_indices[FixedMaterial::PARAM_MAX]={ - FixedMaterial::PARAM_DIFFUSE, - FixedMaterial::PARAM_DETAIL, - FixedMaterial::PARAM_SPECULAR, - FixedMaterial::PARAM_EMISSION, - FixedMaterial::PARAM_SPECULAR_EXP, - FixedMaterial::PARAM_GLOW, - FixedMaterial::PARAM_NORMAL, - FixedMaterial::PARAM_SHADE_PARAM, -}; - - - - -void FixedMaterial::set_parameter(Parameter p_parameter, const Variant& p_value) { - - ERR_FAIL_INDEX(p_parameter,PARAM_MAX); - if ((p_parameter==PARAM_DIFFUSE || p_parameter==PARAM_SPECULAR || p_parameter==PARAM_EMISSION)) { - - if (p_value.get_type()!=Variant::COLOR) { - ERR_EXPLAIN(String(_param_names[p_parameter])+" expects Color"); - ERR_FAIL(); - } - } else { + return emission; +} - if (!p_value.is_num()) { - ERR_EXPLAIN(String(_param_names[p_parameter])+" expects scalar"); - ERR_FAIL(); - } - } - ERR_FAIL_COND( (p_parameter==PARAM_DIFFUSE || p_parameter==PARAM_SPECULAR || p_parameter==PARAM_EMISSION) && p_value.get_type()!=Variant::COLOR ); - ERR_FAIL_COND( p_parameter!=PARAM_SHADE_PARAM && p_parameter!=PARAM_DIFFUSE && p_parameter!=PARAM_DETAIL && p_parameter!=PARAM_SPECULAR && p_parameter!=PARAM_EMISSION && p_value.get_type()!=Variant::REAL && p_value.get_type()!=Variant::INT ); +void FixedSpatialMaterial::set_emission_energy(float p_emission_energy){ - param[p_parameter]=p_value; + emission_energy=p_emission_energy; + VS::get_singleton()->material_set_param(_get_material(),shader_names->emission_energy,p_emission_energy); - VisualServer::get_singleton()->fixed_material_set_param(material,(VS::FixedMaterialParam)p_parameter,p_value); +} +float FixedSpatialMaterial::get_emission_energy() const{ - _change_notify(_full_param_names[p_parameter]); + return emission_energy; } -Variant FixedMaterial::get_parameter(Parameter p_parameter) const { - ERR_FAIL_INDEX_V(p_parameter,PARAM_MAX,Variant()); - return param[p_parameter]; +void FixedSpatialMaterial::set_normal_scale(float p_normal_scale){ + + normal_scale=p_normal_scale; + VS::get_singleton()->material_set_param(_get_material(),shader_names->normal_scale,p_normal_scale); + } +float FixedSpatialMaterial::get_normal_scale() const{ + return normal_scale; +} +void FixedSpatialMaterial::set_rim(float p_rim){ -void FixedMaterial::set_texture(Parameter p_parameter, Ref<Texture> p_texture) { + rim=p_rim; + VS::get_singleton()->material_set_param(_get_material(),shader_names->rim,p_rim); - ERR_FAIL_INDEX(p_parameter,PARAM_MAX); - texture_param[p_parameter]=p_texture; - VisualServer::get_singleton()->fixed_material_set_texture(material,(VS::FixedMaterialParam)p_parameter,p_texture.is_null()?RID():p_texture->get_rid()); +} +float FixedSpatialMaterial::get_rim() const{ - _change_notify(); + return rim; } -Ref<Texture> FixedMaterial::get_texture(Parameter p_parameter) const { - ERR_FAIL_INDEX_V(p_parameter,PARAM_MAX,Ref<Texture>()); - return texture_param[p_parameter]; +void FixedSpatialMaterial::set_rim_tint(float p_rim_tint){ + + rim_tint=p_rim_tint; + VS::get_singleton()->material_set_param(_get_material(),shader_names->rim_tint,p_rim_tint); + } +float FixedSpatialMaterial::get_rim_tint() const{ -void FixedMaterial::set_texcoord_mode(Parameter p_parameter, TexCoordMode p_mode) { + return rim_tint; +} - ERR_FAIL_INDEX(p_parameter,PARAM_MAX); - ERR_FAIL_INDEX(p_mode,4); +void FixedSpatialMaterial::set_clearcoat(float p_clearcoat){ - if (p_mode==texture_texcoord[p_parameter]) - return; + clearcoat=p_clearcoat; + VS::get_singleton()->material_set_param(_get_material(),shader_names->clearcoat,p_clearcoat); - texture_texcoord[p_parameter]=p_mode; +} - VisualServer::get_singleton()->fixed_material_set_texcoord_mode(material,(VS::FixedMaterialParam)p_parameter,(VS::FixedMaterialTexCoordMode)p_mode); +float FixedSpatialMaterial::get_clearcoat() const{ - _change_notify(); + return clearcoat; } -FixedMaterial::TexCoordMode FixedMaterial::get_texcoord_mode(Parameter p_parameter) const { +void FixedSpatialMaterial::set_clearcoat_gloss(float p_clearcoat_gloss){ + + clearcoat_gloss=p_clearcoat_gloss; + VS::get_singleton()->material_set_param(_get_material(),shader_names->clearcoat_gloss,p_clearcoat_gloss); + - ERR_FAIL_INDEX_V(p_parameter,PARAM_MAX,TEXCOORD_UV); - return texture_texcoord[p_parameter]; } -void FixedMaterial::set_light_shader(LightShader p_shader) { +float FixedSpatialMaterial::get_clearcoat_gloss() const{ - light_shader=p_shader; - VS::get_singleton()->fixed_material_set_light_shader(material,VS::FixedMaterialLightShader(p_shader)); + return clearcoat_gloss; } -FixedMaterial::LightShader FixedMaterial::get_light_shader() const { +void FixedSpatialMaterial::set_anisotropy(float p_anisotropy){ + + anisotropy=p_anisotropy; + VS::get_singleton()->material_set_param(_get_material(),shader_names->anisotropy,p_anisotropy); - return light_shader; } +float FixedSpatialMaterial::get_anisotropy() const{ + return anisotropy; +} + +void FixedSpatialMaterial::set_height_scale(float p_height_scale){ + + height_scale=p_height_scale; + VS::get_singleton()->material_set_param(_get_material(),shader_names->height_scale,p_height_scale); -void FixedMaterial::set_uv_transform(const Transform& p_transform) { - uv_transform=p_transform; - VisualServer::get_singleton()->fixed_material_set_uv_transform(material, p_transform ); - _change_notify(); } -Transform FixedMaterial::get_uv_transform() const { +float FixedSpatialMaterial::get_height_scale() const{ - return uv_transform; + return height_scale; } +void FixedSpatialMaterial::set_subsurface_scattering_strength(float p_subsurface_scattering_strength){ + + subsurface_scattering_strength=p_subsurface_scattering_strength; + VS::get_singleton()->material_set_param(_get_material(),shader_names->subsurface_scattering_strength,subsurface_scattering_strength); +} -void FixedMaterial::set_fixed_flag(FixedFlag p_flag, bool p_value) { - ERR_FAIL_INDEX(p_flag,5); - fixed_flags[p_flag]=p_value; - VisualServer::get_singleton()->fixed_material_set_flag(material,(VS::FixedMaterialFlags)p_flag,p_value); +float FixedSpatialMaterial::get_subsurface_scattering_strength() const{ + return subsurface_scattering_strength; } -bool FixedMaterial::get_fixed_flag(FixedFlag p_flag) const { - ERR_FAIL_INDEX_V(p_flag,5,false); - return fixed_flags[p_flag]; +void FixedSpatialMaterial::set_refraction(float p_refraction){ + + refraction=p_refraction; + VS::get_singleton()->material_set_param(_get_material(),shader_names->refraction,refraction); + } -void FixedMaterial::set_point_size(float p_size) { +float FixedSpatialMaterial::get_refraction() const { - ERR_FAIL_COND(p_size<0); - point_size=p_size; - VisualServer::get_singleton()->fixed_material_set_point_size(material,p_size); + return refraction; } -float FixedMaterial::get_point_size() const{ +void FixedSpatialMaterial::set_refraction_roughness(float p_refraction_roughness) { + refraction_roughness=p_refraction_roughness; + VS::get_singleton()->material_set_param(_get_material(),shader_names->refraction_roughness,refraction_roughness); - return point_size; + +} +float FixedSpatialMaterial::get_refraction_roughness() const { + + return refraction_roughness; } +void FixedSpatialMaterial::set_detail_uv(DetailUV p_detail_uv) { + + if (detail_uv==p_detail_uv) + return; + + detail_uv=p_detail_uv; + _queue_shader_change(); +} +FixedSpatialMaterial::DetailUV FixedSpatialMaterial::get_detail_uv() const { -void FixedMaterial::_bind_methods() { + return detail_uv; +} +void FixedSpatialMaterial::set_blend_mode(BlendMode p_mode) { - ObjectTypeDB::bind_method(_MD("set_parameter","param","value"),&FixedMaterial::set_parameter); - ObjectTypeDB::bind_method(_MD("get_parameter","param"),&FixedMaterial::get_parameter); + if (blend_mode==p_mode) + return; - ObjectTypeDB::bind_method(_MD("set_texture","param","texture:Texture"),&FixedMaterial::set_texture); - ObjectTypeDB::bind_method(_MD("get_texture:Texture","param"),&FixedMaterial::get_texture); + blend_mode=p_mode; + _queue_shader_change(); +} +FixedSpatialMaterial::BlendMode FixedSpatialMaterial::get_blend_mode() const { + return blend_mode; +} - ObjectTypeDB::bind_method(_MD("set_texcoord_mode","param","mode"),&FixedMaterial::set_texcoord_mode); - ObjectTypeDB::bind_method(_MD("get_texcoord_mode","param"),&FixedMaterial::get_texcoord_mode); +void FixedSpatialMaterial::set_detail_blend_mode(BlendMode p_mode) { - ObjectTypeDB::bind_method(_MD("set_fixed_flag","flag","value"),&FixedMaterial::set_fixed_flag); - ObjectTypeDB::bind_method(_MD("get_fixed_flag","flag"),&FixedMaterial::get_fixed_flag); + detail_blend_mode=p_mode; + _queue_shader_change(); +} +FixedSpatialMaterial::BlendMode FixedSpatialMaterial::get_detail_blend_mode() const { - ObjectTypeDB::bind_method(_MD("set_uv_transform","transform"),&FixedMaterial::set_uv_transform); - ObjectTypeDB::bind_method(_MD("get_uv_transform"),&FixedMaterial::get_uv_transform); + return detail_blend_mode; +} - ObjectTypeDB::bind_method(_MD("set_light_shader","shader"),&FixedMaterial::set_light_shader); - ObjectTypeDB::bind_method(_MD("get_light_shader"),&FixedMaterial::get_light_shader); +void FixedSpatialMaterial::set_depth_draw_mode(DepthDrawMode p_mode) { - ObjectTypeDB::bind_method(_MD("set_point_size","size"),&FixedMaterial::set_point_size); - ObjectTypeDB::bind_method(_MD("get_point_size"),&FixedMaterial::get_point_size); + if (depth_draw_mode==p_mode) + return; + depth_draw_mode=p_mode; + _queue_shader_change(); +} +FixedSpatialMaterial::DepthDrawMode FixedSpatialMaterial::get_depth_draw_mode() const { - ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "fixed_flags/use_alpha" ), _SCS("set_fixed_flag"), _SCS("get_fixed_flag"), FLAG_USE_ALPHA); - ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "fixed_flags/use_color_array" ), _SCS("set_fixed_flag"), _SCS("get_fixed_flag"), FLAG_USE_COLOR_ARRAY); - ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "fixed_flags/use_point_size" ), _SCS("set_fixed_flag"), _SCS("get_fixed_flag"), FLAG_USE_POINT_SIZE); - ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "fixed_flags/discard_alpha" ), _SCS("set_fixed_flag"), _SCS("get_fixed_flag"), FLAG_DISCARD_ALPHA); - ADD_PROPERTYI( PropertyInfo( Variant::BOOL, "fixed_flags/use_xy_normalmap" ), _SCS("set_fixed_flag"), _SCS("get_fixed_flag"), FLAG_USE_XY_NORMALMAP); - ADD_PROPERTYI( PropertyInfo( Variant::COLOR, "params/diffuse" ), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_DIFFUSE); - ADD_PROPERTYI( PropertyInfo( Variant::COLOR, "params/specular", PROPERTY_HINT_COLOR_NO_ALPHA ), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_SPECULAR ); - ADD_PROPERTYI( PropertyInfo( Variant::COLOR, "params/emission", PROPERTY_HINT_COLOR_NO_ALPHA ), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_EMISSION ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/specular_exp", PROPERTY_HINT_RANGE,"1,64,0.01" ), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_SPECULAR_EXP ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/detail_mix", PROPERTY_HINT_RANGE,"0,1,0.01" ), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_DETAIL ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/normal_depth", PROPERTY_HINT_RANGE,"-4,4,0.01" ), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_NORMAL ); - ADD_PROPERTY( PropertyInfo( Variant::INT, "params/shader", PROPERTY_HINT_ENUM,"Lambert,Wrap,Velvet,Toon" ), _SCS("set_light_shader"), _SCS("get_light_shader") ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/shader_param", PROPERTY_HINT_RANGE,"0,1,0.01" ), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_SHADE_PARAM ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "params/glow", PROPERTY_HINT_RANGE,"0,8,0.01" ), _SCS("set_parameter"), _SCS("get_parameter"), PARAM_GLOW ); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "params/point_size", PROPERTY_HINT_RANGE,"0,1024,1" ), _SCS("set_point_size"), _SCS("get_point_size")); - ADD_PROPERTY( PropertyInfo( Variant::TRANSFORM, "uv_xform"), _SCS("set_uv_transform"), _SCS("get_uv_transform") ); + return depth_draw_mode; +} - for(int i=0;i<PARAM_MAX;i++) { - ADD_PROPERTYI( PropertyInfo( Variant::OBJECT, String()+"textures/"+_param_names[i],PROPERTY_HINT_RESOURCE_TYPE,"Texture" ), _SCS("set_texture"), _SCS("get_texture"), _param_indices[i]); - ADD_PROPERTYI( PropertyInfo( Variant::INT, String()+"textures/"+_param_names[i]+"_tc",PROPERTY_HINT_ENUM,"UV,UV Xform,UV2,Sphere" ), _SCS("set_texcoord_mode"), _SCS("get_texcoord_mode"), _param_indices[i] ); - } +void FixedSpatialMaterial::set_cull_mode(CullMode p_mode) { + if (cull_mode==p_mode) + return; - BIND_CONSTANT( PARAM_DIFFUSE ); - BIND_CONSTANT( PARAM_DETAIL ); - BIND_CONSTANT( PARAM_SPECULAR ); - BIND_CONSTANT( PARAM_EMISSION ); - BIND_CONSTANT( PARAM_SPECULAR_EXP ); - BIND_CONSTANT( PARAM_GLOW ); - BIND_CONSTANT( PARAM_NORMAL ); - BIND_CONSTANT( PARAM_SHADE_PARAM ); - BIND_CONSTANT( PARAM_MAX ); + cull_mode=p_mode; + _queue_shader_change(); +} +FixedSpatialMaterial::CullMode FixedSpatialMaterial::get_cull_mode() const { - BIND_CONSTANT( TEXCOORD_UV ); - BIND_CONSTANT( TEXCOORD_UV_TRANSFORM ); - BIND_CONSTANT( TEXCOORD_UV2 ); - BIND_CONSTANT( TEXCOORD_SPHERE ); + return cull_mode; +} - BIND_CONSTANT( FLAG_USE_ALPHA ); - BIND_CONSTANT( FLAG_USE_COLOR_ARRAY ); - BIND_CONSTANT( FLAG_USE_POINT_SIZE ); - BIND_CONSTANT( FLAG_DISCARD_ALPHA ); +void FixedSpatialMaterial::set_diffuse_mode(DiffuseMode p_mode) { - BIND_CONSTANT( LIGHT_SHADER_LAMBERT ); - BIND_CONSTANT( LIGHT_SHADER_WRAP ); - BIND_CONSTANT( LIGHT_SHADER_VELVET ); - BIND_CONSTANT( LIGHT_SHADER_TOON ); + if (diffuse_mode==p_mode) + return; + diffuse_mode=p_mode; + _queue_shader_change(); } +FixedSpatialMaterial::DiffuseMode FixedSpatialMaterial::get_diffuse_mode() const { + return diffuse_mode; +} -FixedMaterial::FixedMaterial() : Material(VS::get_singleton()->fixed_material_create()) { +void FixedSpatialMaterial::set_flag(Flags p_flag,bool p_enabled) { + ERR_FAIL_INDEX(p_flag,FLAG_MAX); + if (flags[p_flag]==p_enabled) + return; - param[PARAM_DIFFUSE]=Color(1,1,1); - param[PARAM_SPECULAR]=Color(0.0,0.0,0.0); - param[PARAM_EMISSION]=Color(0.0,0.0,0.0); - param[PARAM_SPECULAR_EXP]=40; - param[PARAM_GLOW]=0; - param[PARAM_NORMAL]=1; - param[PARAM_SHADE_PARAM]=0.5; - param[PARAM_DETAIL]=1.0; + flags[p_flag]=p_enabled; + _queue_shader_change(); +} - set_flag(FLAG_COLOR_ARRAY_SRGB,true); +bool FixedSpatialMaterial::get_flag(Flags p_flag) const { - fixed_flags[FLAG_USE_ALPHA]=false; - fixed_flags[FLAG_USE_COLOR_ARRAY]=false; - fixed_flags[FLAG_USE_POINT_SIZE]=false; - fixed_flags[FLAG_USE_XY_NORMALMAP]=false; - fixed_flags[FLAG_DISCARD_ALPHA]=false; + ERR_FAIL_INDEX_V(p_flag,FLAG_MAX,false); + return flags[p_flag]; +} +void FixedSpatialMaterial::set_feature(Feature p_feature,bool p_enabled) { - for(int i=0;i<PARAM_MAX;i++) { + ERR_FAIL_INDEX(p_feature,FEATURE_MAX); + if (features[p_feature]==p_enabled) + return; - texture_texcoord[i]=TEXCOORD_UV; - } + features[p_feature]=p_enabled; + _change_notify(); + _queue_shader_change(); - light_shader=LIGHT_SHADER_LAMBERT; - point_size=1.0; } +bool FixedSpatialMaterial::get_feature(Feature p_feature) const { -FixedMaterial::~FixedMaterial() { - + ERR_FAIL_INDEX_V(p_feature,FEATURE_MAX,false); + return features[p_feature]; } +void FixedSpatialMaterial::set_texture(TextureParam p_param, const Ref<Texture> &p_texture) { -bool ShaderMaterial::_set(const StringName& p_name, const Variant& p_value) { + ERR_FAIL_INDEX(p_param,TEXTURE_MAX); + textures[p_param]=p_texture; + RID rid = p_texture.is_valid() ? p_texture->get_rid() : RID(); + VS::get_singleton()->material_set_param(_get_material(),shader_names->texture_names[p_param],rid); +} - if (p_name==SceneStringNames::get_singleton()->shader_shader) { - set_shader(p_value); - return true; - } else { +Ref<Texture> FixedSpatialMaterial::get_texture(TextureParam p_param) const { - if (shader.is_valid()) { + ERR_FAIL_INDEX_V(p_param,TEXTURE_MAX,Ref<Texture>()); + return textures[p_param]; +} - StringName pr = shader->remap_param(p_name); - if (!pr) { - String n = p_name; - if (n.find("param/")==0) { //backwards compatibility - pr = n.substr(6,n.length()); - } - } - if (pr) { - VisualServer::get_singleton()->material_set_param(material,pr,p_value); - return true; - } - } +void FixedSpatialMaterial::_validate_feature(const String& text, Feature feature,PropertyInfo& property) const { + if (property.name.begins_with(text) && property.name!=text+"/enabled" && !features[feature]) { + property.usage=0; } - return false; } -bool ShaderMaterial::_get(const StringName& p_name,Variant &r_ret) const { - +void FixedSpatialMaterial::_validate_property(PropertyInfo& property) const { + _validate_feature("normal",FEATURE_NORMAL_MAPPING,property); + _validate_feature("emission",FEATURE_EMISSION,property); + _validate_feature("rim",FEATURE_RIM,property); + _validate_feature("clearcoat",FEATURE_CLEARCOAT,property); + _validate_feature("anisotropy",FEATURE_ANISOTROPY,property); + _validate_feature("ao",FEATURE_AMBIENT_OCCLUSION,property); + _validate_feature("height",FEATURE_HEIGHT_MAPPING,property); + _validate_feature("subsurf_scatter",FEATURE_SUBSURACE_SCATTERING,property); + _validate_feature("refraction",FEATURE_REFRACTION,property); + _validate_feature("detail",FEATURE_DETAIL,property); + + if (property.name=="specular/color" && specular_mode==SPECULAR_MODE_METALLIC) { + property.usage=0; + } + if (property.name=="specular/metalness" && specular_mode==SPECULAR_MODE_SPECULAR) { + property.usage=0; + } - if (p_name==SceneStringNames::get_singleton()->shader_shader) { +} - r_ret=get_shader(); - return true; - } else { +void FixedSpatialMaterial::set_line_width(float p_line_width) { - if (shader.is_valid()) { + line_width=p_line_width; + VS::get_singleton()->material_set_line_width(_get_material(),line_width); +} - StringName pr = shader->remap_param(p_name); - if (pr) { - r_ret=VisualServer::get_singleton()->material_get_param(material,pr); - return true; - } - } +float FixedSpatialMaterial::get_line_width() const { - } + return line_width; +} +void FixedSpatialMaterial::set_point_size(float p_point_size) { - return false; + point_size=p_point_size; + VS::get_singleton()->material_set_param(_get_material(),shader_names->point_size,p_point_size); } +float FixedSpatialMaterial::get_point_size() const { -void ShaderMaterial::_get_property_list( List<PropertyInfo> *p_list) const { + return point_size; +} - p_list->push_back( PropertyInfo( Variant::OBJECT, "shader/shader", PROPERTY_HINT_RESOURCE_TYPE,"MaterialShader,MaterialShaderGraph" ) ); - if (!shader.is_null()) { +void FixedSpatialMaterial::set_uv1_scale(const Vector2& p_scale) { - shader->get_param_list(p_list); - } + uv1_scale=p_scale; + VS::get_singleton()->material_set_param(_get_material(),shader_names->uv1_scale,p_scale); +} + +Vector2 FixedSpatialMaterial::get_uv1_scale() const{ + return uv1_scale; } +void FixedSpatialMaterial::set_uv1_offset(const Vector2& p_offset){ -void ShaderMaterial::_shader_changed() { + uv1_offset=p_offset; + VS::get_singleton()->material_set_param(_get_material(),shader_names->uv1_offset,p_offset); - _change_notify(); //also all may have changed then } +Vector2 FixedSpatialMaterial::get_uv1_offset() const{ -void ShaderMaterial::set_shader(const Ref<Shader>& p_shader) { + return uv1_offset; +} - ERR_FAIL_COND(p_shader.is_valid() && p_shader->get_mode()!=Shader::MODE_MATERIAL); - if (shader.is_valid()) - shader->disconnect(SceneStringNames::get_singleton()->changed,this,SceneStringNames::get_singleton()->_shader_changed); - shader=p_shader; - VS::get_singleton()->material_set_shader(material,shader.is_valid()?shader->get_rid():RID()); - if (shader.is_valid()) { - shader->connect(SceneStringNames::get_singleton()->changed,this,SceneStringNames::get_singleton()->_shader_changed); - } - _change_notify(); +void FixedSpatialMaterial::set_uv2_scale(const Vector2& p_scale) { + uv2_scale=p_scale; + VS::get_singleton()->material_set_param(_get_material(),shader_names->uv2_scale,p_scale); } -Ref<Shader> ShaderMaterial::get_shader() const { +Vector2 FixedSpatialMaterial::get_uv2_scale() const{ - return shader; + return uv2_scale; } +void FixedSpatialMaterial::set_uv2_offset(const Vector2& p_offset){ -void ShaderMaterial::set_shader_param(const StringName& p_param,const Variant& p_value) { - - VisualServer::get_singleton()->material_set_param(material,p_param,p_value); + uv2_offset=p_offset; + VS::get_singleton()->material_set_param(_get_material(),shader_names->uv2_offset,p_offset); } -Variant ShaderMaterial::get_shader_param(const StringName& p_param) const{ +Vector2 FixedSpatialMaterial::get_uv2_offset() const{ - return VisualServer::get_singleton()->material_get_param(material,p_param); + return uv2_offset; } +void FixedSpatialMaterial::_bind_methods() { -void ShaderMaterial::_bind_methods() { + ClassDB::bind_method(_MD("set_albedo","albedo"),&FixedSpatialMaterial::set_albedo); + ClassDB::bind_method(_MD("get_albedo"),&FixedSpatialMaterial::get_albedo); - ObjectTypeDB::bind_method(_MD("set_shader","shader:Shader"), &ShaderMaterial::set_shader ); - ObjectTypeDB::bind_method(_MD("get_shader:Shader"), &ShaderMaterial::get_shader ); + ClassDB::bind_method(_MD("set_specular_mode","specular_mode"),&FixedSpatialMaterial::set_specular_mode); + ClassDB::bind_method(_MD("get_specular_mode"),&FixedSpatialMaterial::get_specular_mode); - ObjectTypeDB::bind_method(_MD("set_shader_param","param","value:Variant"), &ShaderMaterial::set_shader_param); - ObjectTypeDB::bind_method(_MD("get_shader_param:Variant","param"), &ShaderMaterial::get_shader_param); + ClassDB::bind_method(_MD("set_specular","specular"),&FixedSpatialMaterial::set_specular); + ClassDB::bind_method(_MD("get_specular"),&FixedSpatialMaterial::get_specular); - ObjectTypeDB::bind_method(_MD("_shader_changed"), &ShaderMaterial::_shader_changed ); -} + ClassDB::bind_method(_MD("set_metalness","metalness"),&FixedSpatialMaterial::set_metalness); + ClassDB::bind_method(_MD("get_metalness"),&FixedSpatialMaterial::get_metalness); + ClassDB::bind_method(_MD("set_roughness","roughness"),&FixedSpatialMaterial::set_roughness); + ClassDB::bind_method(_MD("get_roughness"),&FixedSpatialMaterial::get_roughness); -void ShaderMaterial::get_argument_options(const StringName& p_function,int p_idx,List<String>*r_options) const { + ClassDB::bind_method(_MD("set_emission","emission"),&FixedSpatialMaterial::set_emission); + ClassDB::bind_method(_MD("get_emission"),&FixedSpatialMaterial::get_emission); - String f = p_function.operator String(); - if ((f=="get_shader_param" || f=="set_shader_param") && p_idx==0) { + ClassDB::bind_method(_MD("set_emission_energy","emission_energy"),&FixedSpatialMaterial::set_emission_energy); + ClassDB::bind_method(_MD("get_emission_energy"),&FixedSpatialMaterial::get_emission_energy); + + ClassDB::bind_method(_MD("set_normal_scale","normal_scale"),&FixedSpatialMaterial::set_normal_scale); + ClassDB::bind_method(_MD("get_normal_scale"),&FixedSpatialMaterial::get_normal_scale); + + ClassDB::bind_method(_MD("set_rim","rim"),&FixedSpatialMaterial::set_rim); + ClassDB::bind_method(_MD("get_rim"),&FixedSpatialMaterial::get_rim); + + ClassDB::bind_method(_MD("set_rim_tint","rim_tint"),&FixedSpatialMaterial::set_rim_tint); + ClassDB::bind_method(_MD("get_rim_tint"),&FixedSpatialMaterial::get_rim_tint); + + ClassDB::bind_method(_MD("set_clearcoat","clearcoat"),&FixedSpatialMaterial::set_clearcoat); + ClassDB::bind_method(_MD("get_clearcoat"),&FixedSpatialMaterial::get_clearcoat); + + ClassDB::bind_method(_MD("set_clearcoat_gloss","clearcoat_gloss"),&FixedSpatialMaterial::set_clearcoat_gloss); + ClassDB::bind_method(_MD("get_clearcoat_gloss"),&FixedSpatialMaterial::get_clearcoat_gloss); + + ClassDB::bind_method(_MD("set_anisotropy","anisotropy"),&FixedSpatialMaterial::set_anisotropy); + ClassDB::bind_method(_MD("get_anisotropy"),&FixedSpatialMaterial::get_anisotropy); + + ClassDB::bind_method(_MD("set_height_scale","height_scale"),&FixedSpatialMaterial::set_height_scale); + ClassDB::bind_method(_MD("get_height_scale"),&FixedSpatialMaterial::get_height_scale); + + ClassDB::bind_method(_MD("set_subsurface_scattering_strength","strength"),&FixedSpatialMaterial::set_subsurface_scattering_strength); + ClassDB::bind_method(_MD("get_subsurface_scattering_strength"),&FixedSpatialMaterial::get_subsurface_scattering_strength); + + ClassDB::bind_method(_MD("set_refraction","refraction"),&FixedSpatialMaterial::set_refraction); + ClassDB::bind_method(_MD("get_refraction"),&FixedSpatialMaterial::get_refraction); + + ClassDB::bind_method(_MD("set_refraction_roughness","refraction_roughness"),&FixedSpatialMaterial::set_refraction_roughness); + ClassDB::bind_method(_MD("get_refraction_roughness"),&FixedSpatialMaterial::get_refraction_roughness); + + ClassDB::bind_method(_MD("set_line_width","line_width"),&FixedSpatialMaterial::set_line_width); + ClassDB::bind_method(_MD("get_line_width"),&FixedSpatialMaterial::get_line_width); + + ClassDB::bind_method(_MD("set_point_size","point_size"),&FixedSpatialMaterial::set_point_size); + ClassDB::bind_method(_MD("get_point_size"),&FixedSpatialMaterial::get_point_size); + + ClassDB::bind_method(_MD("set_detail_uv","detail_uv"),&FixedSpatialMaterial::set_detail_uv); + ClassDB::bind_method(_MD("get_detail_uv"),&FixedSpatialMaterial::get_detail_uv); + + ClassDB::bind_method(_MD("set_blend_mode","blend_mode"),&FixedSpatialMaterial::set_blend_mode); + ClassDB::bind_method(_MD("get_blend_mode"),&FixedSpatialMaterial::get_blend_mode); + + ClassDB::bind_method(_MD("set_depth_draw_mode","depth_draw_mode"),&FixedSpatialMaterial::set_depth_draw_mode); + ClassDB::bind_method(_MD("get_depth_draw_mode"),&FixedSpatialMaterial::get_depth_draw_mode); + + ClassDB::bind_method(_MD("set_cull_mode","cull_mode"),&FixedSpatialMaterial::set_cull_mode); + ClassDB::bind_method(_MD("get_cull_mode"),&FixedSpatialMaterial::get_cull_mode); + + ClassDB::bind_method(_MD("set_diffuse_mode","diffuse_mode"),&FixedSpatialMaterial::set_diffuse_mode); + ClassDB::bind_method(_MD("get_diffuse_mode"),&FixedSpatialMaterial::get_diffuse_mode); + + ClassDB::bind_method(_MD("set_flag","flag","enable"),&FixedSpatialMaterial::set_flag); + ClassDB::bind_method(_MD("get_flag"),&FixedSpatialMaterial::get_flag); + + ClassDB::bind_method(_MD("set_feature","feature","enable"),&FixedSpatialMaterial::set_feature); + ClassDB::bind_method(_MD("get_feature","feature"),&FixedSpatialMaterial::get_feature); + + ClassDB::bind_method(_MD("set_texture","param:Texture","texture"),&FixedSpatialMaterial::set_texture); + ClassDB::bind_method(_MD("get_texture:Texture","param:Texture"),&FixedSpatialMaterial::get_texture); + + ClassDB::bind_method(_MD("set_detail_blend_mode","detail_blend_mode"),&FixedSpatialMaterial::set_detail_blend_mode); + ClassDB::bind_method(_MD("get_detail_blend_mode"),&FixedSpatialMaterial::get_detail_blend_mode); + + ClassDB::bind_method(_MD("set_uv1_scale","scale"),&FixedSpatialMaterial::set_uv1_scale); + ClassDB::bind_method(_MD("get_uv1_scale"),&FixedSpatialMaterial::get_uv1_scale); + + ClassDB::bind_method(_MD("set_uv1_offset","offset"),&FixedSpatialMaterial::set_uv1_offset); + ClassDB::bind_method(_MD("get_uv1_offset"),&FixedSpatialMaterial::get_uv1_offset); + + ClassDB::bind_method(_MD("set_uv2_scale","scale"),&FixedSpatialMaterial::set_uv2_scale); + ClassDB::bind_method(_MD("get_uv2_scale"),&FixedSpatialMaterial::get_uv2_scale); + + ClassDB::bind_method(_MD("set_uv2_offset","offset"),&FixedSpatialMaterial::set_uv2_offset); + ClassDB::bind_method(_MD("get_uv2_offset"),&FixedSpatialMaterial::get_uv2_offset); + + ADD_GROUP("Flags","flags_"); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"flags_transparent"),_SCS("set_feature"),_SCS("get_feature"),FEATURE_TRANSPARENT); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"flags_unshaded"),_SCS("set_flag"),_SCS("get_flag"),FLAG_UNSHADED); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"flags_on_top"),_SCS("set_flag"),_SCS("get_flag"),FLAG_ONTOP); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"flags_use_point_size"),_SCS("set_flag"),_SCS("get_flag"),FLAG_USE_POINT_SIZE); + ADD_GROUP("Vertex Color","vertex_color"); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"vertex_color_use_as_albedo"),_SCS("set_flag"),_SCS("get_flag"),FLAG_ALBEDO_FROM_VERTEX_COLOR); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"vertex_color_is_srgb"),_SCS("set_flag"),_SCS("get_flag"),FLAG_SRGB_VERTEX_COLOR); + + ADD_GROUP("Parameters","params_"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"params_diffuse_mode",PROPERTY_HINT_ENUM,"Labert,Lambert Wrap,Oren Nayar,Burley"),_SCS("set_diffuse_mode"),_SCS("get_diffuse_mode")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"params_blend_mode",PROPERTY_HINT_ENUM,"Mix,Add,Sub,Mul"),_SCS("set_blend_mode"),_SCS("get_blend_mode")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"params_cull_mode",PROPERTY_HINT_ENUM,"Back,Front,Disabled"),_SCS("set_cull_mode"),_SCS("get_cull_mode")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"params_depth_draw_mode",PROPERTY_HINT_ENUM,"Opaque Only,Always,Never,Opaque Pre-Pass"),_SCS("set_depth_draw_mode"),_SCS("get_depth_draw_mode")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"params_line_width",PROPERTY_HINT_RANGE,"0.1,128,0.1"),_SCS("set_line_width"),_SCS("get_line_width")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"params_point_size",PROPERTY_HINT_RANGE,"0.1,128,0.1"),_SCS("set_point_size"),_SCS("get_point_size")); + + ADD_GROUP("Albedo","albedo_"); + ADD_PROPERTY(PropertyInfo(Variant::COLOR,"albedo_color"),_SCS("set_albedo"),_SCS("get_albedo")); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"albedo_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_ALBEDO); + + ADD_GROUP("Specular","specular_"); + ADD_PROPERTY(PropertyInfo(Variant::INT,"specular_mode",PROPERTY_HINT_ENUM,"Metallic,Specular"),_SCS("set_specular_mode"),_SCS("get_specular_mode")); + ADD_PROPERTY(PropertyInfo(Variant::COLOR,"specular_color",PROPERTY_HINT_COLOR_NO_ALPHA),_SCS("set_specular"),_SCS("get_specular")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"specular_metalness",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_metalness"),_SCS("get_metalness")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"specular_roughness",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_roughness"),_SCS("get_roughness")); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"specular_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_SPECULAR); + + ADD_GROUP("Emission","emission_"); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"emission_enabled"),_SCS("set_feature"),_SCS("get_feature"),FEATURE_EMISSION); + ADD_PROPERTY(PropertyInfo(Variant::COLOR,"emission_color",PROPERTY_HINT_COLOR_NO_ALPHA),_SCS("set_emission"),_SCS("get_emission")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"emission_energy",PROPERTY_HINT_RANGE,"0,16,0.01"),_SCS("set_emission_energy"),_SCS("get_emission_energy")); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"emission_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_EMISSION); + + ADD_GROUP("NormapMap","normal_"); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"normal_enabled"),_SCS("set_feature"),_SCS("get_feature"),FEATURE_NORMAL_MAPPING); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"normal_scale",PROPERTY_HINT_RANGE,"-16,16,0.01"),_SCS("set_normal_scale"),_SCS("get_normal_scale")); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"normal_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_NORMAL); + + ADD_GROUP("Rim","rim_"); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"rim_enabled"),_SCS("set_feature"),_SCS("get_feature"),FEATURE_RIM); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"rim_amount",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_rim"),_SCS("get_rim")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"rim_tint",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_rim_tint"),_SCS("get_rim_tint")); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"rim_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_RIM); + + ADD_GROUP("Clearcoat","clearcoat_"); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"clearcoat_enabled"),_SCS("set_feature"),_SCS("get_feature"),FEATURE_CLEARCOAT); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"clearcoat_amount",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_clearcoat"),_SCS("get_clearcoat")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"clearcoat_gloss",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_clearcoat_gloss"),_SCS("get_clearcoat_gloss")); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"clearcoat_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_CLEARCOAT); + + ADD_GROUP("Anisotropy","anisotropy_"); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"anisotropy_enabled"),_SCS("set_feature"),_SCS("get_feature"),FEATURE_ANISOTROPY); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"anisotropy_anisotropy",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_anisotropy"),_SCS("get_anisotropy")); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"anisotropy_flowmap",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_FLOWMAP); + + ADD_GROUP("Ambient Occlusion","ao_"); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"ao_enabled"),_SCS("set_feature"),_SCS("get_feature"),FEATURE_AMBIENT_OCCLUSION); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"ao_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_AMBIENT_OCCLUSION); + + ADD_GROUP("Height","height_"); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"height_enabled"),_SCS("set_feature"),_SCS("get_feature"),FEATURE_HEIGHT_MAPPING); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"height_scale",PROPERTY_HINT_RANGE,"-16,16,0.01"),_SCS("set_height_scale"),_SCS("get_height_scale")); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"height_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_HEIGHT); + + ADD_GROUP("Subsurf Scatter","subsurf_scatter_"); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"subsurf_scatter_enabled"),_SCS("set_feature"),_SCS("get_feature"),FEATURE_SUBSURACE_SCATTERING); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"subsurf_scatter_strength",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_subsurface_scattering_strength"),_SCS("get_subsurface_scattering_strength")); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"subsurf_scatter_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_SUBSURFACE_SCATTERING); + + ADD_GROUP("Refraction","refraction_"); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"refraction_enabled"),_SCS("set_feature"),_SCS("get_feature"),FEATURE_REFRACTION); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"refraction_displacement",PROPERTY_HINT_RANGE,"-1,1,0.01"),_SCS("set_refraction"),_SCS("get_refraction")); + ADD_PROPERTY(PropertyInfo(Variant::REAL,"refraction_roughness",PROPERTY_HINT_RANGE,"0,1,0.01"),_SCS("set_refraction_roughness"),_SCS("get_refraction_roughness")); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"refraction_texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_REFRACTION); + + ADD_GROUP("Detail","detail_"); + ADD_PROPERTYI(PropertyInfo(Variant::BOOL,"detail_enabled"),_SCS("set_feature"),_SCS("get_feature"),FEATURE_DETAIL); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"detail_mask",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_DETAIL_MASK); + ADD_PROPERTY(PropertyInfo(Variant::INT,"detail_blend_mode",PROPERTY_HINT_ENUM,"Mix,Add,Sub,Mul"),_SCS("set_detail_blend_mode"),_SCS("get_detail_blend_mode")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"detail_uv_layer",PROPERTY_HINT_ENUM,"UV1,UV2"),_SCS("set_detail_uv"),_SCS("get_detail_uv")); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"detail_albedo",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_DETAIL_ALBEDO); + ADD_PROPERTYI(PropertyInfo(Variant::OBJECT,"detail_normal",PROPERTY_HINT_RESOURCE_TYPE,"Texture"),_SCS("set_texture"),_SCS("get_texture"),TEXTURE_DETAIL_NORMAL); + + ADD_GROUP("UV1","uv1_"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR2,"uv1_scale"),_SCS("set_uv1_scale"),_SCS("get_uv1_scale")); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR2,"uv1_offset"),_SCS("set_uv1_offset"),_SCS("get_uv1_offset")); + + ADD_GROUP("UV2","uv2_"); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR2,"uv2_scale"),_SCS("set_uv2_scale"),_SCS("get_uv2_scale")); + ADD_PROPERTY(PropertyInfo(Variant::VECTOR2,"uv2_offset"),_SCS("set_uv2_offset"),_SCS("get_uv2_offset")); + + + BIND_CONSTANT( TEXTURE_ALBEDO ); + BIND_CONSTANT( TEXTURE_SPECULAR ); + BIND_CONSTANT( TEXTURE_EMISSION ); + BIND_CONSTANT( TEXTURE_NORMAL ); + BIND_CONSTANT( TEXTURE_RIM ); + BIND_CONSTANT( TEXTURE_CLEARCOAT ); + BIND_CONSTANT( TEXTURE_FLOWMAP ); + BIND_CONSTANT( TEXTURE_AMBIENT_OCCLUSION ); + BIND_CONSTANT( TEXTURE_HEIGHT ); + BIND_CONSTANT( TEXTURE_SUBSURFACE_SCATTERING ); + BIND_CONSTANT( TEXTURE_REFRACTION ); + BIND_CONSTANT( TEXTURE_REFRACTION_ROUGHNESS ); + BIND_CONSTANT( TEXTURE_DETAIL_MASK ); + BIND_CONSTANT( TEXTURE_DETAIL_ALBEDO ); + BIND_CONSTANT( TEXTURE_DETAIL_NORMAL ); + BIND_CONSTANT( TEXTURE_MAX ); + + + BIND_CONSTANT( DETAIL_UV_1 ); + BIND_CONSTANT( DETAIL_UV_2 ); + + BIND_CONSTANT( FEATURE_TRANSPARENT ); + BIND_CONSTANT( FEATURE_EMISSION ); + BIND_CONSTANT( FEATURE_NORMAL_MAPPING ); + BIND_CONSTANT( FEATURE_RIM ); + BIND_CONSTANT( FEATURE_CLEARCOAT ); + BIND_CONSTANT( FEATURE_ANISOTROPY ); + BIND_CONSTANT( FEATURE_AMBIENT_OCCLUSION ); + BIND_CONSTANT( FEATURE_HEIGHT_MAPPING ); + BIND_CONSTANT( FEATURE_SUBSURACE_SCATTERING ); + BIND_CONSTANT( FEATURE_REFRACTION ); + BIND_CONSTANT( FEATURE_DETAIL ); + BIND_CONSTANT( FEATURE_MAX ); + + BIND_CONSTANT( BLEND_MODE_MIX ); + BIND_CONSTANT( BLEND_MODE_ADD ); + BIND_CONSTANT( BLEND_MODE_SUB ); + BIND_CONSTANT( BLEND_MODE_MUL ); + + BIND_CONSTANT( DEPTH_DRAW_OPAQUE_ONLY ); + BIND_CONSTANT( DEPTH_DRAW_ALWAYS ); + BIND_CONSTANT( DEPTH_DRAW_DISABLED ); + BIND_CONSTANT( DEPTH_DRAW_ALPHA_OPAQUE_PREPASS ); + + + BIND_CONSTANT( CULL_BACK ); + BIND_CONSTANT( CULL_FRONT ); + BIND_CONSTANT( CULL_DISABLED ); + + BIND_CONSTANT( FLAG_UNSHADED ); + BIND_CONSTANT( FLAG_ONTOP ); + BIND_CONSTANT( FLAG_ALBEDO_FROM_VERTEX_COLOR ); + BIND_CONSTANT( FLAG_SRGB_VERTEX_COLOR ) + BIND_CONSTANT( FLAG_USE_POINT_SIZE ) + BIND_CONSTANT( FLAG_MAX ); + + BIND_CONSTANT( DIFFUSE_LAMBERT ); + BIND_CONSTANT( DIFFUSE_LAMBERT_WRAP ); + BIND_CONSTANT( DIFFUSE_OREN_NAYAR ); + BIND_CONSTANT( DIFFUSE_BURLEY ); + + BIND_CONSTANT( SPECULAR_MODE_METALLIC ); + BIND_CONSTANT( SPECULAR_MODE_SPECULAR ); - if (shader.is_valid()) { - List<PropertyInfo> pl; - shader->get_param_list(&pl); - for (List<PropertyInfo>::Element *E=pl.front();E;E=E->next()) { - r_options->push_back("\""+E->get().name.replace_first("shader_param/","")+"\""); - } - } - } - Material::get_argument_options(p_function,p_idx,r_options); } -ShaderMaterial::ShaderMaterial() :Material(VisualServer::get_singleton()->material_create()){ +FixedSpatialMaterial::FixedSpatialMaterial() : element(this) { + + //initialize to right values + specular_mode=SPECULAR_MODE_METALLIC; + set_albedo(Color(0.7,0.7,0.7,1.0)); + set_specular(Color(0.1,0.1,0.1)); + set_roughness(0.0); + set_metalness(0.1); + set_emission(Color(0,0,0)); + set_emission_energy(1.0); + set_normal_scale(1); + set_rim(1.0); + set_rim_tint(0.5); + set_clearcoat(1); + set_clearcoat_gloss(0.5); + set_anisotropy(0); + set_height_scale(1); + set_subsurface_scattering_strength(0); + set_refraction(0); + set_refraction_roughness(0); + set_line_width(1); + set_point_size(1); + set_uv1_offset(Vector2(0,0)); + set_uv1_scale(Vector2(1,1)); + set_uv2_offset(Vector2(0,0)); + set_uv2_scale(Vector2(1,1)); + + detail_uv=DETAIL_UV_1; + blend_mode=BLEND_MODE_MIX; + detail_blend_mode=BLEND_MODE_MIX; + depth_draw_mode=DEPTH_DRAW_OPAQUE_ONLY; + cull_mode=CULL_BACK; + for(int i=0;i<FLAG_MAX;i++) { + flags[i]=0; + } + diffuse_mode=DIFFUSE_LAMBERT; + + for(int i=0;i<FEATURE_MAX;i++) { + features[i]=false; + } + current_key.key=0; + current_key.invalid_key=1; + _queue_shader_change(); } +FixedSpatialMaterial::~FixedSpatialMaterial() { -///////////////////////////////// + if (material_mutex) + material_mutex->lock(); + + if (shader_map.has(current_key)) { + shader_map[current_key].users--; + if (shader_map[current_key].users==0) { + //deallocate shader, as it's no longer in use + VS::get_singleton()->free(shader_map[current_key].shader); + shader_map.erase(current_key); + } + + VS::get_singleton()->material_set_shader(_get_material(),RID()); + } + + + if (material_mutex) + material_mutex->unlock(); + +} diff --git a/scene/resources/material.h b/scene/resources/material.h index dbd05c466f..6b957d0203 100644 --- a/scene/resources/material.h +++ b/scene/resources/material.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,220 +34,378 @@ #include "scene/resources/shader.h" #include "resource.h" #include "servers/visual/shader_language.h" - +#include "self_list.h" /** @author Juan Linietsky <reduzio@gmail.com> */ class Material : public Resource { - OBJ_TYPE(Material,Resource); + GDCLASS(Material,Resource); RES_BASE_EXTENSION("mtl"); OBJ_SAVE_TYPE( Material ); -public: + RID material; +protected: - enum Flag { - FLAG_VISIBLE = VS::MATERIAL_FLAG_VISIBLE, - FLAG_DOUBLE_SIDED = VS::MATERIAL_FLAG_DOUBLE_SIDED, - FLAG_INVERT_FACES = VS::MATERIAL_FLAG_INVERT_FACES, - FLAG_UNSHADED = VS::MATERIAL_FLAG_UNSHADED, - FLAG_ONTOP = VS::MATERIAL_FLAG_ONTOP, - FLAG_LIGHTMAP_ON_UV2 = VS::MATERIAL_FLAG_LIGHTMAP_ON_UV2, - FLAG_COLOR_ARRAY_SRGB = VS::MATERIAL_FLAG_COLOR_ARRAY_SRGB, - FLAG_MAX = VS::MATERIAL_FLAG_MAX - }; + _FORCE_INLINE_ RID _get_material() const { return material; } +public: - enum BlendMode { - BLEND_MODE_MIX = VS::MATERIAL_BLEND_MODE_MIX, - BLEND_MODE_MUL = VS::MATERIAL_BLEND_MODE_MUL, - BLEND_MODE_ADD = VS::MATERIAL_BLEND_MODE_ADD, - BLEND_MODE_SUB = VS::MATERIAL_BLEND_MODE_SUB, - BLEND_MODE_PREMULT_ALPHA = VS::MATERIAL_BLEND_MODE_PREMULT_ALPHA, + virtual RID get_rid() const; + Material(); + virtual ~Material(); +}; - }; - enum DepthDrawMode { - DEPTH_DRAW_ALWAYS = VS::MATERIAL_DEPTH_DRAW_ALWAYS, - DEPTH_DRAW_OPAQUE_ONLY = VS::MATERIAL_DEPTH_DRAW_OPAQUE_ONLY, - DEPTH_DRAW_OPAQUE_PRE_PASS_ALPHA = VS::MATERIAL_DEPTH_DRAW_OPAQUE_PRE_PASS_ALPHA, - DEPTH_DRAW_NEVER = VS::MATERIAL_DEPTH_DRAW_NEVER - }; +class FixedSpatialMaterial : public Material { + GDCLASS(FixedSpatialMaterial,Material) -private: - BlendMode blend_mode; - bool flags[VS::MATERIAL_FLAG_MAX]; - float line_width; - DepthDrawMode depth_draw_mode; -protected: - RID material; +public: - static void _bind_methods(); + enum TextureParam { + TEXTURE_ALBEDO, + TEXTURE_SPECULAR, + TEXTURE_EMISSION, + TEXTURE_NORMAL, + TEXTURE_RIM, + TEXTURE_CLEARCOAT, + TEXTURE_FLOWMAP, + TEXTURE_AMBIENT_OCCLUSION, + TEXTURE_HEIGHT, + TEXTURE_SUBSURFACE_SCATTERING, + TEXTURE_REFRACTION, + TEXTURE_REFRACTION_ROUGHNESS, + TEXTURE_DETAIL_MASK, + TEXTURE_DETAIL_ALBEDO, + TEXTURE_DETAIL_NORMAL, + TEXTURE_MAX -public: - void set_flag(Flag p_flag,bool p_enabled); - bool get_flag(Flag p_flag) const; - void set_blend_mode(BlendMode p_blend_mode); - BlendMode get_blend_mode() const; + }; - void set_depth_draw_mode(DepthDrawMode p_depth_draw_mode); - DepthDrawMode get_depth_draw_mode() const; - void set_line_width(float p_width); - float get_line_width() const; + enum DetailUV { + DETAIL_UV_1, + DETAIL_UV_2 + }; - virtual RID get_rid() const; + enum Feature { + FEATURE_TRANSPARENT, + FEATURE_EMISSION, + FEATURE_NORMAL_MAPPING, + FEATURE_RIM, + FEATURE_CLEARCOAT, + FEATURE_ANISOTROPY, + FEATURE_AMBIENT_OCCLUSION, + FEATURE_HEIGHT_MAPPING, + FEATURE_SUBSURACE_SCATTERING, + FEATURE_REFRACTION, + FEATURE_DETAIL, + FEATURE_MAX + }; - Material(const RID& p_rid=RID()); - virtual ~Material(); -}; -VARIANT_ENUM_CAST( Material::Flag ); -VARIANT_ENUM_CAST( Material::DepthDrawMode ); + enum BlendMode { + BLEND_MODE_MIX, + BLEND_MODE_ADD, + BLEND_MODE_SUB, + BLEND_MODE_MUL, + }; -VARIANT_ENUM_CAST( Material::BlendMode ); + enum DepthDrawMode { + DEPTH_DRAW_OPAQUE_ONLY, + DEPTH_DRAW_ALWAYS, + DEPTH_DRAW_DISABLED, + DEPTH_DRAW_ALPHA_OPAQUE_PREPASS + }; -class FixedMaterial : public Material { + enum CullMode { + CULL_BACK, + CULL_FRONT, + CULL_DISABLED + }; - OBJ_TYPE( FixedMaterial, Material ); - REVERSE_GET_PROPERTY_LIST -public: + enum Flags { + FLAG_UNSHADED, + FLAG_ONTOP, + FLAG_ALBEDO_FROM_VERTEX_COLOR, + FLAG_SRGB_VERTEX_COLOR, + FLAG_USE_POINT_SIZE, + FLAG_MAX + }; - enum Parameter { - PARAM_DIFFUSE=VS::FIXED_MATERIAL_PARAM_DIFFUSE, - PARAM_DETAIL=VS::FIXED_MATERIAL_PARAM_DETAIL, - PARAM_SPECULAR=VS::FIXED_MATERIAL_PARAM_SPECULAR, - PARAM_EMISSION=VS::FIXED_MATERIAL_PARAM_EMISSION, - PARAM_SPECULAR_EXP=VS::FIXED_MATERIAL_PARAM_SPECULAR_EXP, - PARAM_GLOW=VS::FIXED_MATERIAL_PARAM_GLOW, - PARAM_NORMAL=VS::FIXED_MATERIAL_PARAM_NORMAL, - PARAM_SHADE_PARAM=VS::FIXED_MATERIAL_PARAM_SHADE_PARAM, - PARAM_MAX=VS::FIXED_MATERIAL_PARAM_MAX + enum DiffuseMode { + DIFFUSE_LAMBERT, + DIFFUSE_LAMBERT_WRAP, + DIFFUSE_OREN_NAYAR, + DIFFUSE_BURLEY, }; + enum SpecularMode { + SPECULAR_MODE_METALLIC, + SPECULAR_MODE_SPECULAR, + }; - enum TexCoordMode { +private: + union MaterialKey { + + struct { + uint32_t feature_mask : 14; + uint32_t detail_uv : 1; + uint32_t blend_mode : 2; + uint32_t depth_draw_mode : 2; + uint32_t cull_mode : 2; + uint32_t flags : 5; + uint32_t detail_blend_mode : 2; + uint32_t diffuse_mode : 2; + uint32_t invalid_key : 1; + uint32_t specular_mode : 1; + }; + + uint32_t key; + + bool operator<(const MaterialKey& p_key) const { + return key < p_key.key; + } - TEXCOORD_UV=VS::FIXED_MATERIAL_TEXCOORD_UV, - TEXCOORD_UV_TRANSFORM=VS::FIXED_MATERIAL_TEXCOORD_UV_TRANSFORM, - TEXCOORD_UV2=VS::FIXED_MATERIAL_TEXCOORD_UV2, - TEXCOORD_SPHERE=VS::FIXED_MATERIAL_TEXCOORD_SPHERE }; - enum FixedFlag { - FLAG_USE_ALPHA=VS::FIXED_MATERIAL_FLAG_USE_ALPHA, - FLAG_USE_COLOR_ARRAY=VS::FIXED_MATERIAL_FLAG_USE_COLOR_ARRAY, - FLAG_USE_POINT_SIZE=VS::FIXED_MATERIAL_FLAG_USE_POINT_SIZE, - FLAG_DISCARD_ALPHA=VS::FIXED_MATERIAL_FLAG_DISCARD_ALPHA, - FLAG_USE_XY_NORMALMAP=VS::FIXED_MATERIAL_FLAG_USE_XY_NORMALMAP, - FLAG_MAX=VS::FIXED_MATERIAL_FLAG_MAX + struct ShaderData { + RID shader; + int users; }; - enum LightShader { + static Map<MaterialKey,ShaderData> shader_map; + + MaterialKey current_key; + + _FORCE_INLINE_ MaterialKey _compute_key() const { + + MaterialKey mk; + mk.key=0; + for(int i=0;i<FEATURE_MAX;i++) { + if (features[i]) { + mk.feature_mask|=(1<<i); + } + } + mk.detail_uv=detail_uv; + mk.blend_mode=blend_mode; + mk.depth_draw_mode=depth_draw_mode; + mk.cull_mode=cull_mode; + for(int i=0;i<FLAG_MAX;i++) { + if (flags[i]) { + mk.flags|=(1<<i); + } + } + mk.detail_blend_mode=detail_blend_mode; + mk.diffuse_mode=diffuse_mode; + mk.specular_mode=specular_mode; + + return mk; + } + + struct ShaderNames { + StringName albedo; + StringName specular; + StringName metalness; + StringName roughness; + StringName emission; + StringName emission_energy; + StringName normal_scale; + StringName rim; + StringName rim_tint; + StringName clearcoat; + StringName clearcoat_gloss; + StringName anisotropy; + StringName height_scale; + StringName subsurface_scattering_strength; + StringName refraction; + StringName refraction_roughness; + StringName point_size; + StringName uv1_scale; + StringName uv1_offset; + StringName uv2_scale; + StringName uv2_offset; + StringName texture_names[TEXTURE_MAX]; - LIGHT_SHADER_LAMBERT=VS::FIXED_MATERIAL_LIGHT_SHADER_LAMBERT, - LIGHT_SHADER_WRAP=VS::FIXED_MATERIAL_LIGHT_SHADER_WRAP, - LIGHT_SHADER_VELVET=VS::FIXED_MATERIAL_LIGHT_SHADER_VELVET, - LIGHT_SHADER_TOON=VS::FIXED_MATERIAL_LIGHT_SHADER_TOON }; -private: + static Mutex *material_mutex; + static SelfList<FixedSpatialMaterial>::List dirty_materials; + static ShaderNames* shader_names; + + SelfList<FixedSpatialMaterial> element; + + void _update_shader(); + _FORCE_INLINE_ void _queue_shader_change(); + _FORCE_INLINE_ bool _is_shader_dirty() const; + + Color albedo; + Color specular; + float metalness; + float roughness; + Color emission; + float emission_energy; + float normal_scale; + float rim; + float rim_tint; + float clearcoat; + float clearcoat_gloss; + float anisotropy; + float height_scale; + float subsurface_scattering_strength; + float refraction; + float refraction_roughness; + float line_width; + float point_size; + Vector2 uv1_scale; + Vector2 uv1_offset; - struct Node { + Vector2 uv2_scale; + Vector2 uv2_offset; - int param; - int mult; - int tex; - }; + DetailUV detail_uv; - Variant param[PARAM_MAX]; - Ref<Texture> texture_param[PARAM_MAX]; - TexCoordMode texture_texcoord[PARAM_MAX]; - LightShader light_shader; - bool fixed_flags[FLAG_MAX]; - float point_size; + BlendMode blend_mode; + BlendMode detail_blend_mode; + DepthDrawMode depth_draw_mode; + CullMode cull_mode; + bool flags[FLAG_MAX]; + DiffuseMode diffuse_mode; + SpecularMode specular_mode; + bool features[FEATURE_MAX]; - Transform uv_transform; + Ref<Texture> textures[TEXTURE_MAX]; -protected: + _FORCE_INLINE_ void _validate_feature(const String& text, Feature feature,PropertyInfo& property) const; +protected: static void _bind_methods(); - + void _validate_property(PropertyInfo& property) const; public: - void set_fixed_flag(FixedFlag p_flag, bool p_value); - bool get_fixed_flag(FixedFlag p_flag) const; - void set_parameter(Parameter p_parameter, const Variant& p_value); - Variant get_parameter(Parameter p_parameter) const; + void set_albedo(const Color& p_albedo); + Color get_albedo() const; - void set_texture(Parameter p_parameter, Ref<Texture> p_texture); - Ref<Texture> get_texture(Parameter p_parameter) const; + void set_specular_mode(SpecularMode p_mode); + SpecularMode get_specular_mode() const; - void set_texcoord_mode(Parameter p_parameter, TexCoordMode p_mode); - TexCoordMode get_texcoord_mode(Parameter p_parameter) const; + void set_specular(const Color& p_specular); + Color get_specular() const; - void set_light_shader(LightShader p_shader); - LightShader get_light_shader() const; + void set_metalness(float p_metalness); + float get_metalness() const; - void set_uv_transform(const Transform& p_transform); - Transform get_uv_transform() const; + void set_roughness(float p_roughness); + float get_roughness() const; - void set_point_size(float p_transform); - float get_point_size() const; + void set_emission(const Color& p_emission); + Color get_emission() const; - FixedMaterial(); - ~FixedMaterial(); + void set_emission_energy(float p_emission_energy); + float get_emission_energy() const; -}; + void set_normal_scale(float p_normal_scale); + float get_normal_scale() const; + void set_rim(float p_rim); + float get_rim() const; + void set_rim_tint(float p_rim_tint); + float get_rim_tint() const; -VARIANT_ENUM_CAST( FixedMaterial::Parameter ); -VARIANT_ENUM_CAST( FixedMaterial::TexCoordMode ); -VARIANT_ENUM_CAST( FixedMaterial::FixedFlag ); -VARIANT_ENUM_CAST( FixedMaterial::LightShader ); + void set_clearcoat(float p_clearcoat); + float get_clearcoat() const; -class ShaderMaterial : public Material { + void set_clearcoat_gloss(float p_clearcoat_gloss); + float get_clearcoat_gloss() const; - OBJ_TYPE( ShaderMaterial, Material ); + void set_anisotropy(float p_anisotropy); + float get_anisotropy() const; - Ref<Shader> shader; + void set_height_scale(float p_height_scale); + float get_height_scale() const; + void set_subsurface_scattering_strength(float p_strength); + float get_subsurface_scattering_strength() const; + void set_refraction(float p_refraction); + float get_refraction() const; - void _shader_changed(); - static void _shader_parse(void*p_self,ShaderLanguage::ProgramNode*p_node); + void set_refraction_roughness(float p_refraction_roughness); + float get_refraction_roughness() const; -protected: + void set_line_width(float p_line_width); + float get_line_width() const; - bool _set(const StringName& p_name, const Variant& p_value); - bool _get(const StringName& p_name,Variant &r_ret) const; - void _get_property_list( List<PropertyInfo> *p_list) const; + void set_point_size(float p_point_size); + float get_point_size() const; - static void _bind_methods(); + void set_detail_uv(DetailUV p_detail_uv); + DetailUV get_detail_uv() const; -public: + void set_blend_mode(BlendMode p_mode); + BlendMode get_blend_mode() const; + + void set_detail_blend_mode(BlendMode p_mode); + BlendMode get_detail_blend_mode() const; + + void set_depth_draw_mode(DepthDrawMode p_mode); + DepthDrawMode get_depth_draw_mode() const; - void set_shader(const Ref<Shader>& p_shader); - Ref<Shader> get_shader() const; + void set_cull_mode(CullMode p_mode); + CullMode get_cull_mode() const; - void set_shader_param(const StringName& p_param,const Variant& p_value); - Variant get_shader_param(const StringName& p_param) const; + void set_diffuse_mode(DiffuseMode p_mode); + DiffuseMode get_diffuse_mode() const; - void get_argument_options(const StringName& p_function,int p_idx,List<String>*r_options) const; + void set_flag(Flags p_flag,bool p_enabled); + bool get_flag(Flags p_flag) const; - ShaderMaterial(); + void set_texture(TextureParam p_param,const Ref<Texture>& p_texture); + Ref<Texture> get_texture(TextureParam p_param) const; + + void set_feature(Feature p_feature,bool p_enabled); + bool get_feature(Feature p_feature) const; + + void set_uv1_scale(const Vector2& p_scale); + Vector2 get_uv1_scale() const; + + void set_uv1_offset(const Vector2& p_offset); + Vector2 get_uv1_offset() const; + + void set_uv2_scale(const Vector2& p_scale); + Vector2 get_uv2_scale() const; + + void set_uv2_offset(const Vector2& p_offset); + Vector2 get_uv2_offset() const; + + static void init_shaders(); + static void finish_shaders(); + static void flush_changes(); + + FixedSpatialMaterial(); + virtual ~FixedSpatialMaterial(); }; +VARIANT_ENUM_CAST( FixedSpatialMaterial::TextureParam ) +VARIANT_ENUM_CAST( FixedSpatialMaterial::DetailUV ) +VARIANT_ENUM_CAST( FixedSpatialMaterial::Feature ) +VARIANT_ENUM_CAST( FixedSpatialMaterial::BlendMode ) +VARIANT_ENUM_CAST( FixedSpatialMaterial::DepthDrawMode ) +VARIANT_ENUM_CAST( FixedSpatialMaterial::CullMode ) +VARIANT_ENUM_CAST( FixedSpatialMaterial::Flags ) +VARIANT_ENUM_CAST( FixedSpatialMaterial::DiffuseMode ) +VARIANT_ENUM_CAST( FixedSpatialMaterial::SpecularMode ) + ////////////////////// diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index 921466585d..74f4e8f5f7 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -79,9 +79,9 @@ bool Mesh::_set(const StringName& p_name, const Variant& p_value) { if (p_name=="morph_target/names") { - DVector<String> sk=p_value; + PoolVector<String> sk=p_value; int sz = sk.size(); - DVector<String>::Read r = sk.read(); + PoolVector<String>::Read r = sk.read(); for(int i=0;i<sz;i++) add_morph_target(r[i]); return true; @@ -122,22 +122,64 @@ bool Mesh::_set(const StringName& p_name, const Variant& p_value) { if (idx==surfaces.size()) { - if (what=="custom") { - add_custom_surface(p_value); - return true; - - } - //create Dictionary d=p_value; ERR_FAIL_COND_V(!d.has("primitive"),false); - ERR_FAIL_COND_V(!d.has("arrays"),false); - ERR_FAIL_COND_V(!d.has("morph_arrays"),false); - bool alphasort = d.has("alphasort") && bool(d["alphasort"]); + if (d.has("arrays")) { + //old format + ERR_FAIL_COND_V(!d.has("morph_arrays"),false); + add_surface_from_arrays(PrimitiveType(int(d["primitive"])),d["arrays"],d["morph_arrays"]); + + } else if (d.has("array_data")) { + + PoolVector<uint8_t> array_data = d["array_data"]; + PoolVector<uint8_t> array_index_data; + if (d.has("array_index_data")) + array_index_data=d["array_index_data"]; + + ERR_FAIL_COND_V(!d.has("format"),false); + uint32_t format = d["format"]; + + ERR_FAIL_COND_V(!d.has("primitive"),false); + uint32_t primitive = d["primitive"]; + + ERR_FAIL_COND_V(!d.has("vertex_count"),false); + int vertex_count = d["vertex_count"]; + + int index_count=0; + if (d.has("index_count")) + index_count=d["index_count"]; + + Vector< PoolVector<uint8_t> > morphs; + + if (d.has("morph_data")) { + Array morph_data=d["morph_data"]; + for(int i=0;i<morph_data.size();i++) { + PoolVector<uint8_t> morph = morph_data[i]; + morphs.push_back(morph_data[i]); + } + } + + ERR_FAIL_COND_V(!d.has("aabb"),false); + Rect3 aabb = d["aabb"]; + + Vector<Rect3> bone_aabb; + if (d.has("bone_aabb")) { + Array baabb = d["bone_aabb"]; + bone_aabb.resize(baabb.size()); + + for(int i=0;i<baabb.size();i++) { + bone_aabb[i]=baabb[i]; + } + } + + add_surface(format,PrimitiveType(primitive),array_data,vertex_count,array_index_data,index_count,aabb,morphs,bone_aabb); + } else { + ERR_FAIL_V(false); + } - add_surface(PrimitiveType(int(d["primitive"])),d["arrays"],d["morph_arrays"],alphasort); if (d.has("material")) { surface_set_material(idx,d["material"]); @@ -159,7 +201,7 @@ bool Mesh::_get(const StringName& p_name,Variant &r_ret) const { if (p_name=="morph_target/names") { - DVector<String> sk; + PoolVector<String> sk; for(int i=0;i<morph_targets.size();i++) sk.push_back(morph_targets[i]); r_ret=sk; @@ -193,10 +235,31 @@ bool Mesh::_get(const StringName& p_name,Variant &r_ret) const { ERR_FAIL_INDEX_V(idx,surfaces.size(),false); Dictionary d; - d["primitive"]=surface_get_primitive_type(idx); - d["arrays"]=surface_get_arrays(idx); - d["morph_arrays"]=surface_get_morph_arrays(idx); - d["alphasort"]=surface_is_alpha_sorting_enabled(idx); + + d["array_data"]=VS::get_singleton()->mesh_surface_get_array(mesh,idx); + d["vertex_count"]=VS::get_singleton()->mesh_surface_get_array_len(mesh,idx); + d["array_index_data"]=VS::get_singleton()->mesh_surface_get_index_array(mesh,idx); + d["index_count"]=VS::get_singleton()->mesh_surface_get_array_index_len(mesh,idx); + d["primitive"]=VS::get_singleton()->mesh_surface_get_primitive_type(mesh,idx); + d["format"]=VS::get_singleton()->mesh_surface_get_format(mesh,idx); + d["aabb"]=VS::get_singleton()->mesh_surface_get_aabb(mesh,idx); + + Vector<Rect3> skel_aabb = VS::get_singleton()->mesh_surface_get_skeleton_aabb(mesh,idx); + Array arr; + for(int i=0;i<skel_aabb.size();i++) { + arr[i]=skel_aabb[i]; + } + d["skeleton_aabb"]=arr; + + Vector< PoolVector<uint8_t> > morph_data = VS::get_singleton()->mesh_surface_get_blend_shapes(mesh,idx); + + Array md; + for(int i=0;i<morph_data.size();i++) { + md.push_back(morph_data[i]); + } + + d["morph_data"]=md; + Ref<Material> m = surface_get_material(idx); if (m.is_valid()) d["material"]=m; @@ -212,7 +275,7 @@ bool Mesh::_get(const StringName& p_name,Variant &r_ret) const { void Mesh::_get_property_list( List<PropertyInfo> *p_list) const { if (morph_targets.size()) { - p_list->push_back(PropertyInfo(Variant::STRING_ARRAY,"morph_target/names",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR)); + p_list->push_back(PropertyInfo(Variant::POOL_STRING_ARRAY,"morph_target/names",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR)); p_list->push_back(PropertyInfo(Variant::INT,"morph_target/mode",PROPERTY_HINT_ENUM,"Normalized,Relative")); } @@ -223,7 +286,7 @@ void Mesh::_get_property_list( List<PropertyInfo> *p_list) const { p_list->push_back( PropertyInfo( Variant::OBJECT,"surface_"+itos(i+1)+"/material", PROPERTY_HINT_RESOURCE_TYPE,"Material",PROPERTY_USAGE_EDITOR ) ); } - p_list->push_back( PropertyInfo( Variant::_AABB,"custom_aabb/custom_aabb" ) ); + p_list->push_back( PropertyInfo( Variant::RECT3,"custom_aabb/custom_aabb" ) ); } @@ -231,7 +294,7 @@ void Mesh::_get_property_list( List<PropertyInfo> *p_list) const { void Mesh::_recompute_aabb() { // regenerate AABB - aabb=AABB(); + aabb=Rect3(); for (int i=0;i<surfaces.size();i++) { @@ -243,28 +306,38 @@ void Mesh::_recompute_aabb() { } -void Mesh::add_surface(PrimitiveType p_primitive,const Array& p_arrays,const Array& p_blend_shapes,bool p_alphasort) { +void Mesh::add_surface(uint32_t p_format,PrimitiveType p_primitive,const PoolVector<uint8_t>& p_array,int p_vertex_count,const PoolVector<uint8_t>& p_index_array,int p_index_count,const Rect3& p_aabb,const Vector<PoolVector<uint8_t> >& p_blend_shapes,const Vector<Rect3>& p_bone_aabbs) { + + Surface s; + s.aabb=p_aabb; + surfaces.push_back(s); + + VisualServer::get_singleton()->mesh_add_surface(mesh,p_format,(VS::PrimitiveType)p_primitive,p_array,p_vertex_count,p_index_array,p_index_count,p_aabb,p_blend_shapes,p_bone_aabbs); + +} + +void Mesh::add_surface_from_arrays(PrimitiveType p_primitive,const Array& p_arrays,const Array& p_blend_shapes,uint32_t p_flags) { ERR_FAIL_COND(p_arrays.size()!=ARRAY_MAX); Surface s; - VisualServer::get_singleton()->mesh_add_surface(mesh,(VisualServer::PrimitiveType)p_primitive, p_arrays,p_blend_shapes,p_alphasort); + VisualServer::get_singleton()->mesh_add_surface_from_arrays(mesh,(VisualServer::PrimitiveType)p_primitive, p_arrays,p_blend_shapes,p_flags); surfaces.push_back(s); /* make aABB? */ { - DVector<Vector3> vertices=p_arrays[ARRAY_VERTEX]; + PoolVector<Vector3> vertices=p_arrays[ARRAY_VERTEX]; int len=vertices.size(); ERR_FAIL_COND(len==0); - DVector<Vector3>::Read r=vertices.read(); + PoolVector<Vector3>::Read r=vertices.read(); const Vector3 *vtx=r.ptr(); // check AABB - AABB aabb; + Rect3 aabb; for (int i=0;i<len;i++) { if (i==0) @@ -274,7 +347,6 @@ void Mesh::add_surface(PrimitiveType p_primitive,const Array& p_arrays,const Arr } surfaces[surfaces.size()-1].aabb=aabb; - surfaces[surfaces.size()-1].alphasort=p_alphasort; _recompute_aabb(); @@ -289,29 +361,18 @@ void Mesh::add_surface(PrimitiveType p_primitive,const Array& p_arrays,const Arr Array Mesh::surface_get_arrays(int p_surface) const { ERR_FAIL_INDEX_V(p_surface,surfaces.size(),Array()); - return VisualServer::get_singleton()->mesh_get_surface_arrays(mesh,p_surface); + return VisualServer::get_singleton()->mesh_surface_get_arrays(mesh,p_surface); } Array Mesh::surface_get_morph_arrays(int p_surface) const { ERR_FAIL_INDEX_V(p_surface,surfaces.size(),Array()); - return VisualServer::get_singleton()->mesh_get_surface_morph_arrays(mesh,p_surface); + return Array(); } -void Mesh::add_custom_surface(const Variant& p_data) { - - Surface s; - s.aabb=AABB(); - VisualServer::get_singleton()->mesh_add_custom_surface(mesh,p_data); - surfaces.push_back(s); - - triangle_mesh=Ref<TriangleMesh>(); - _change_notify(); -} - int Mesh::get_surface_count() const { @@ -418,11 +479,6 @@ Mesh::PrimitiveType Mesh::surface_get_primitive_type(int p_idx) const { return (PrimitiveType)VisualServer::get_singleton()->mesh_surface_get_primitive_type( mesh, p_idx ); } -bool Mesh::surface_is_alpha_sorting_enabled(int p_idx) const { - - ERR_FAIL_INDEX_V( p_idx, surfaces.size(), 0 ); - return surfaces[p_idx].alphasort; -} void Mesh::surface_set_material(int p_idx, const Ref<Material>& p_material) { @@ -449,7 +505,7 @@ String Mesh::surface_get_name(int p_idx) const{ } -void Mesh::surface_set_custom_aabb(int p_idx,const AABB& p_aabb) { +void Mesh::surface_set_custom_aabb(int p_idx,const Rect3& p_aabb) { ERR_FAIL_INDEX( p_idx, surfaces.size() ); surfaces[p_idx].aabb=p_aabb; @@ -466,7 +522,7 @@ Ref<Material> Mesh::surface_get_material(int p_idx) const { void Mesh::add_surface_from_mesh_data(const Geometry::MeshData& p_mesh_data) { VisualServer::get_singleton()->mesh_add_surface_from_mesh_data( mesh, p_mesh_data ); - AABB aabb; + Rect3 aabb; for (int i=0;i<p_mesh_data.vertices.size();i++) { if (i==0) @@ -495,39 +551,39 @@ RID Mesh::get_rid() const { return mesh; } -AABB Mesh::get_aabb() const { +Rect3 Mesh::get_aabb() const { return aabb; } -void Mesh::set_custom_aabb(const AABB& p_custom) { +void Mesh::set_custom_aabb(const Rect3& p_custom) { custom_aabb=p_custom; VS::get_singleton()->mesh_set_custom_aabb(mesh,custom_aabb); } -AABB Mesh::get_custom_aabb() const { +Rect3 Mesh::get_custom_aabb() const { return custom_aabb; } -DVector<Face3> Mesh::get_faces() const { +PoolVector<Face3> Mesh::get_faces() const { Ref<TriangleMesh> tm = generate_triangle_mesh(); if (tm.is_valid()) return tm->get_faces(); - return DVector<Face3>(); + return PoolVector<Face3>(); /* for (int i=0;i<surfaces.size();i++) { if (VisualServer::get_singleton()->mesh_surface_get_primitive_type( mesh, i ) != VisualServer::PRIMITIVE_TRIANGLES ) continue; - DVector<int> indices; - DVector<Vector3> vertices; + PoolVector<int> indices; + PoolVector<Vector3> vertices; vertices=VisualServer::get_singleton()->mesh_surface_get_array(mesh, i,VisualServer::ARRAY_VERTEX); @@ -548,10 +604,10 @@ DVector<Face3> Mesh::get_faces() const { if (len<=0) continue; - DVector<int>::Read indicesr = indices.read(); + PoolVector<int>::Read indicesr = indices.read(); const int *indicesptr = indicesr.ptr(); - DVector<Vector3>::Read verticesr = vertices.read(); + PoolVector<Vector3>::Read verticesr = vertices.read(); const Vector3 *verticesptr = verticesr.ptr(); int old_faces=faces.size(); @@ -559,7 +615,7 @@ DVector<Face3> Mesh::get_faces() const { faces.resize(new_faces); - DVector<Face3>::Write facesw = faces.write(); + PoolVector<Face3>::Write facesw = faces.write(); Face3 *facesptr=facesw.ptr(); @@ -583,12 +639,12 @@ DVector<Face3> Mesh::get_faces() const { Ref<Shape> Mesh::create_convex_shape() const { - DVector<Vector3> vertices; + PoolVector<Vector3> vertices; for(int i=0;i<get_surface_count();i++) { Array a = surface_get_arrays(i); - DVector<Vector3> v=a[ARRAY_VERTEX]; + PoolVector<Vector3> v=a[ARRAY_VERTEX]; vertices.append_array(v); } @@ -600,11 +656,11 @@ Ref<Shape> Mesh::create_convex_shape() const { Ref<Shape> Mesh::create_trimesh_shape() const { - DVector<Face3> faces = get_faces(); + PoolVector<Face3> faces = get_faces(); if (faces.size()==0) return Ref<Shape>(); - DVector<Vector3> face_points; + PoolVector<Vector3> face_points; face_points.resize( faces.size()*3 ); for (int i=0;i<face_points.size();i++) { @@ -625,9 +681,9 @@ void Mesh::center_geometry() { for(int i=0;i<get_surface_count();i++) { - DVector<Vector3> geom = surface_get_array(i,ARRAY_VERTEX); + PoolVector<Vector3> geom = surface_get_array(i,ARRAY_VERTEX); int gc =geom.size(); - DVector<Vector3>::Write w = geom.write(); + PoolVector<Vector3>::Write w = geom.write(); surfaces[i].aabb.pos-=ofs; for(int i=0;i<gc;i++) { @@ -635,7 +691,7 @@ void Mesh::center_geometry() { w[i]-=ofs; } - w = DVector<Vector3>::Write(); + w = PoolVector<Vector3>::Write(); surface_set_array(i,ARRAY_VERTEX,geom); @@ -696,9 +752,9 @@ Ref<TriangleMesh> Mesh::generate_triangle_mesh() const { if (facecount==0 || (facecount%3)!=0) return triangle_mesh; - DVector<Vector3> faces; + PoolVector<Vector3> faces; faces.resize(facecount); - DVector<Vector3>::Write facesw=faces.write(); + PoolVector<Vector3>::Write facesw=faces.write(); int widx=0; @@ -710,17 +766,19 @@ Ref<TriangleMesh> Mesh::generate_triangle_mesh() const { Array a = surface_get_arrays(i); int vc = surface_get_array_len(i); - DVector<Vector3> vertices = a[ARRAY_VERTEX]; - DVector<Vector3>::Read vr=vertices.read(); + PoolVector<Vector3> vertices = a[ARRAY_VERTEX]; + PoolVector<Vector3>::Read vr=vertices.read(); if (surface_get_format(i)&ARRAY_FORMAT_INDEX) { int ic=surface_get_array_index_len(i); - DVector<int> indices = a[ARRAY_INDEX]; - DVector<int>::Read ir = indices.read(); + PoolVector<int> indices = a[ARRAY_INDEX]; + PoolVector<int>::Read ir = indices.read(); - for(int i=0;i<ic;i++) - facesw[widx++]=vr[ ir[i] ]; + for(int i=0;i<ic;i++) { + int index = ir[i]; + facesw[widx++]=vr[ index ]; + } } else { @@ -730,7 +788,7 @@ Ref<TriangleMesh> Mesh::generate_triangle_mesh() const { } - facesw=DVector<Vector3>::Write(); + facesw=PoolVector<Vector3>::Write(); triangle_mesh = Ref<TriangleMesh>( memnew( TriangleMesh )); @@ -756,7 +814,7 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const { if (i==0) { arrays=a; - DVector<Vector3> v=a[ARRAY_VERTEX]; + PoolVector<Vector3> v=a[ARRAY_VERTEX]; index_accum+=v.size(); } else { @@ -773,8 +831,8 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const { case ARRAY_VERTEX: case ARRAY_NORMAL: { - DVector<Vector3> dst = arrays[j]; - DVector<Vector3> src = a[j]; + PoolVector<Vector3> dst = arrays[j]; + PoolVector<Vector3> src = a[j]; if (j==ARRAY_VERTEX) vcount=src.size(); if (dst.size()==0 || src.size()==0) { @@ -788,8 +846,8 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const { case ARRAY_BONES: case ARRAY_WEIGHTS: { - DVector<real_t> dst = arrays[j]; - DVector<real_t> src = a[j]; + PoolVector<real_t> dst = arrays[j]; + PoolVector<real_t> src = a[j]; if (dst.size()==0 || src.size()==0) { arrays[j]=Variant(); continue; @@ -799,8 +857,8 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const { } break; case ARRAY_COLOR: { - DVector<Color> dst = arrays[j]; - DVector<Color> src = a[j]; + PoolVector<Color> dst = arrays[j]; + PoolVector<Color> src = a[j]; if (dst.size()==0 || src.size()==0) { arrays[j]=Variant(); continue; @@ -811,8 +869,8 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const { } break; case ARRAY_TEX_UV: case ARRAY_TEX_UV2: { - DVector<Vector2> dst = arrays[j]; - DVector<Vector2> src = a[j]; + PoolVector<Vector2> dst = arrays[j]; + PoolVector<Vector2> src = a[j]; if (dst.size()==0 || src.size()==0) { arrays[j]=Variant(); continue; @@ -822,15 +880,15 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const { } break; case ARRAY_INDEX: { - DVector<int> dst = arrays[j]; - DVector<int> src = a[j]; + PoolVector<int> dst = arrays[j]; + PoolVector<int> src = a[j]; if (dst.size()==0 || src.size()==0) { arrays[j]=Variant(); continue; } { int ss = src.size(); - DVector<int>::Write w = src.write(); + PoolVector<int>::Write w = src.write(); for(int k=0;k<ss;k++) { w[k]+=index_accum; } @@ -848,13 +906,13 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const { } { - DVector<int>::Write ir; - DVector<int> indices =arrays[ARRAY_INDEX]; + PoolVector<int>::Write ir; + PoolVector<int> indices =arrays[ARRAY_INDEX]; bool has_indices=false; - DVector<Vector3> vertices =arrays[ARRAY_VERTEX]; + PoolVector<Vector3> vertices =arrays[ARRAY_VERTEX]; int vc = vertices.size(); ERR_FAIL_COND_V(!vc,Ref<Mesh>()); - DVector<Vector3>::Write r=vertices.write(); + PoolVector<Vector3>::Write r=vertices.write(); if (indices.size()) { @@ -919,14 +977,14 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const { r[i]=t; } - r = DVector<Vector3>::Write(); + r = PoolVector<Vector3>::Write(); arrays[ARRAY_VERTEX]=vertices; if (!has_indices) { - DVector<int> new_indices; + PoolVector<int> new_indices; new_indices.resize(vertices.size()); - DVector<int>::Write iw = new_indices.write(); + PoolVector<int>::Write iw = new_indices.write(); for(int j=0;j<vc2;j+=3) { @@ -935,7 +993,7 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const { iw[j+2]=j+1; } - iw=DVector<int>::Write(); + iw=PoolVector<int>::Write(); arrays[ARRAY_INDEX]=new_indices; } else { @@ -944,7 +1002,7 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const { SWAP(ir[j+1],ir[j+2]); } - ir=DVector<int>::Write(); + ir=PoolVector<int>::Write(); arrays[ARRAY_INDEX]=indices; } @@ -954,38 +1012,38 @@ Ref<Mesh> Mesh::create_outline(float p_margin) const { Ref<Mesh> newmesh = memnew( Mesh ); - newmesh->add_surface(PRIMITIVE_TRIANGLES,arrays); + newmesh->add_surface_from_arrays(PRIMITIVE_TRIANGLES,arrays); return newmesh; } void Mesh::_bind_methods() { - ObjectTypeDB::bind_method(_MD("add_morph_target","name"),&Mesh::add_morph_target); - ObjectTypeDB::bind_method(_MD("get_morph_target_count"),&Mesh::get_morph_target_count); - ObjectTypeDB::bind_method(_MD("get_morph_target_name","index"),&Mesh::get_morph_target_name); - ObjectTypeDB::bind_method(_MD("clear_morph_targets"),&Mesh::clear_morph_targets); - ObjectTypeDB::bind_method(_MD("set_morph_target_mode","mode"),&Mesh::set_morph_target_mode); - ObjectTypeDB::bind_method(_MD("get_morph_target_mode"),&Mesh::get_morph_target_mode); - - ObjectTypeDB::bind_method(_MD("add_surface","primitive","arrays","morph_arrays","alphasort"),&Mesh::add_surface,DEFVAL(Array()),DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("get_surface_count"),&Mesh::get_surface_count); - ObjectTypeDB::bind_method(_MD("surface_remove","surf_idx"),&Mesh::surface_remove); - ObjectTypeDB::bind_method(_MD("surface_get_array_len","surf_idx"),&Mesh::surface_get_array_len); - ObjectTypeDB::bind_method(_MD("surface_get_array_index_len","surf_idx"),&Mesh::surface_get_array_index_len); - ObjectTypeDB::bind_method(_MD("surface_get_format","surf_idx"),&Mesh::surface_get_format); - ObjectTypeDB::bind_method(_MD("surface_get_primitive_type","surf_idx"),&Mesh::surface_get_primitive_type); - ObjectTypeDB::bind_method(_MD("surface_set_material","surf_idx","material:Material"),&Mesh::surface_set_material); - ObjectTypeDB::bind_method(_MD("surface_get_material:Material","surf_idx"),&Mesh::surface_get_material); - ObjectTypeDB::bind_method(_MD("surface_set_name","surf_idx","name"),&Mesh::surface_set_name); - ObjectTypeDB::bind_method(_MD("surface_get_name","surf_idx"),&Mesh::surface_get_name); - ObjectTypeDB::bind_method(_MD("center_geometry"),&Mesh::center_geometry); - ObjectTypeDB::set_method_flags(get_type_static(),_SCS("center_geometry"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); - ObjectTypeDB::bind_method(_MD("regen_normalmaps"),&Mesh::regen_normalmaps); - ObjectTypeDB::set_method_flags(get_type_static(),_SCS("regen_normalmaps"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); - - ObjectTypeDB::bind_method(_MD("set_custom_aabb","aabb"),&Mesh::set_custom_aabb); - ObjectTypeDB::bind_method(_MD("get_custom_aabb"),&Mesh::get_custom_aabb); + ClassDB::bind_method(_MD("add_morph_target","name"),&Mesh::add_morph_target); + ClassDB::bind_method(_MD("get_morph_target_count"),&Mesh::get_morph_target_count); + ClassDB::bind_method(_MD("get_morph_target_name","index"),&Mesh::get_morph_target_name); + ClassDB::bind_method(_MD("clear_morph_targets"),&Mesh::clear_morph_targets); + ClassDB::bind_method(_MD("set_morph_target_mode","mode"),&Mesh::set_morph_target_mode); + ClassDB::bind_method(_MD("get_morph_target_mode"),&Mesh::get_morph_target_mode); + + ClassDB::bind_method(_MD("add_surface_from_arrays","primitive","arrays","blend_shapes","compress_flags"),&Mesh::add_surface_from_arrays,DEFVAL(Array()),DEFVAL(ARRAY_COMPRESS_DEFAULT)); + ClassDB::bind_method(_MD("get_surface_count"),&Mesh::get_surface_count); + ClassDB::bind_method(_MD("surface_remove","surf_idx"),&Mesh::surface_remove); + ClassDB::bind_method(_MD("surface_get_array_len","surf_idx"),&Mesh::surface_get_array_len); + ClassDB::bind_method(_MD("surface_get_array_index_len","surf_idx"),&Mesh::surface_get_array_index_len); + ClassDB::bind_method(_MD("surface_get_format","surf_idx"),&Mesh::surface_get_format); + ClassDB::bind_method(_MD("surface_get_primitive_type","surf_idx"),&Mesh::surface_get_primitive_type); + ClassDB::bind_method(_MD("surface_set_material","surf_idx","material:Material"),&Mesh::surface_set_material); + ClassDB::bind_method(_MD("surface_get_material:Material","surf_idx"),&Mesh::surface_get_material); + ClassDB::bind_method(_MD("surface_set_name","surf_idx","name"),&Mesh::surface_set_name); + ClassDB::bind_method(_MD("surface_get_name","surf_idx"),&Mesh::surface_get_name); + ClassDB::bind_method(_MD("center_geometry"),&Mesh::center_geometry); + ClassDB::set_method_flags(get_class_static(),_SCS("center_geometry"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + ClassDB::bind_method(_MD("regen_normalmaps"),&Mesh::regen_normalmaps); + ClassDB::set_method_flags(get_class_static(),_SCS("regen_normalmaps"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + + ClassDB::bind_method(_MD("set_custom_aabb","aabb"),&Mesh::set_custom_aabb); + ClassDB::bind_method(_MD("get_custom_aabb"),&Mesh::get_custom_aabb); BIND_CONSTANT( NO_INDEX_ARRAY ); diff --git a/scene/resources/mesh.h b/scene/resources/mesh.h index dc1d97a49e..8e0b4d4e25 100644 --- a/scene/resources/mesh.h +++ b/scene/resources/mesh.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,7 +39,7 @@ */ class Mesh : public Resource { - OBJ_TYPE( Mesh, Resource ); + GDCLASS( Mesh, Resource ); RES_BASE_EXTENSION("msh"); public: @@ -77,6 +77,22 @@ public: ARRAY_FORMAT_WEIGHTS=1<<ARRAY_WEIGHTS, ARRAY_FORMAT_INDEX=1<<ARRAY_INDEX, + ARRAY_COMPRESS_BASE=(ARRAY_INDEX+1), + ARRAY_COMPRESS_VERTEX=1<<(ARRAY_VERTEX+ARRAY_COMPRESS_BASE), // mandatory + ARRAY_COMPRESS_NORMAL=1<<(ARRAY_NORMAL+ARRAY_COMPRESS_BASE), + ARRAY_COMPRESS_TANGENT=1<<(ARRAY_TANGENT+ARRAY_COMPRESS_BASE), + ARRAY_COMPRESS_COLOR=1<<(ARRAY_COLOR+ARRAY_COMPRESS_BASE), + ARRAY_COMPRESS_TEX_UV=1<<(ARRAY_TEX_UV+ARRAY_COMPRESS_BASE), + ARRAY_COMPRESS_TEX_UV2=1<<(ARRAY_TEX_UV2+ARRAY_COMPRESS_BASE), + ARRAY_COMPRESS_BONES=1<<(ARRAY_BONES+ARRAY_COMPRESS_BASE), + ARRAY_COMPRESS_WEIGHTS=1<<(ARRAY_WEIGHTS+ARRAY_COMPRESS_BASE), + ARRAY_COMPRESS_INDEX=1<<(ARRAY_INDEX+ARRAY_COMPRESS_BASE), + + ARRAY_FLAG_USE_2D_VERTICES=ARRAY_COMPRESS_INDEX<<1, + ARRAY_FLAG_USE_16_BIT_BONES=ARRAY_COMPRESS_INDEX<<2, + + ARRAY_COMPRESS_DEFAULT=ARRAY_COMPRESS_VERTEX|ARRAY_COMPRESS_NORMAL|ARRAY_COMPRESS_TANGENT|ARRAY_COMPRESS_COLOR|ARRAY_COMPRESS_TEX_UV|ARRAY_COMPRESS_TEX_UV2|ARRAY_COMPRESS_WEIGHTS + }; enum PrimitiveType { @@ -98,16 +114,15 @@ public: private: struct Surface { String name; - AABB aabb; - bool alphasort; + Rect3 aabb; Ref<Material> material; }; Vector<Surface> surfaces; RID mesh; - AABB aabb; + Rect3 aabb; MorphTargetMode morph_target_mode; Vector<StringName> morph_targets; - AABB custom_aabb; + Rect3 custom_aabb; mutable Ref<TriangleMesh> triangle_mesh; @@ -123,12 +138,12 @@ protected: public: - void add_surface(PrimitiveType p_primitive,const Array& p_arrays,const Array& p_blend_shapes=Array(),bool p_alphasort=false); + void add_surface_from_arrays(PrimitiveType p_primitive, const Array& p_arrays, const Array& p_blend_shapes=Array(), uint32_t p_flags=ARRAY_COMPRESS_DEFAULT); + void add_surface(uint32_t p_format,PrimitiveType p_primitive,const PoolVector<uint8_t>& p_array,int p_vertex_count,const PoolVector<uint8_t>& p_index_array,int p_index_count,const Rect3& p_aabb,const Vector<PoolVector<uint8_t> >& p_blend_shapes=Vector<PoolVector<uint8_t> >(),const Vector<Rect3>& p_bone_aabbs=Vector<Rect3>()); + Array surface_get_arrays(int p_surface) const; virtual Array surface_get_morph_arrays(int p_surface) const; - void add_custom_surface(const Variant& p_data); //only recognized by driver - void add_morph_target(const StringName& p_name); int get_morph_target_count() const; StringName get_morph_target_name(int p_index) const; @@ -140,7 +155,7 @@ public: int get_surface_count() const; void surface_remove(int p_idx); - void surface_set_custom_aabb(int p_surface,const AABB& p_aabb); //only recognized by driver + void surface_set_custom_aabb(int p_surface,const Rect3& p_aabb); //only recognized by driver int surface_get_array_len(int p_idx) const; @@ -157,10 +172,10 @@ public: void add_surface_from_mesh_data(const Geometry::MeshData& p_mesh_data); - void set_custom_aabb(const AABB& p_custom); - AABB get_custom_aabb() const; + void set_custom_aabb(const Rect3& p_custom); + Rect3 get_custom_aabb() const; - AABB get_aabb() const; + Rect3 get_aabb() const; virtual RID get_rid() const; Ref<Shape> create_trimesh_shape() const; @@ -171,7 +186,7 @@ public: void center_geometry(); void regen_normalmaps(); - DVector<Face3> get_faces() const; + PoolVector<Face3> get_faces() const; Ref<TriangleMesh> generate_triangle_mesh() const; Mesh(); diff --git a/scene/resources/mesh_data_tool.cpp b/scene/resources/mesh_data_tool.cpp index fb0fc2a247..ec699ee8e3 100644 --- a/scene/resources/mesh_data_tool.cpp +++ b/scene/resources/mesh_data_tool.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -51,7 +51,7 @@ Error MeshDataTool::create_from_surface(const Ref<Mesh>& p_mesh,int p_surface) { Array arrays = p_mesh->surface_get_arrays(p_surface); ERR_FAIL_COND_V( arrays.empty(), ERR_INVALID_PARAMETER ); - DVector<Vector3> varray = arrays[Mesh::ARRAY_VERTEX]; + PoolVector<Vector3> varray = arrays[Mesh::ARRAY_VERTEX]; int vcount = varray.size(); ERR_FAIL_COND_V( vcount == 0, ERR_INVALID_PARAMETER); @@ -60,34 +60,34 @@ Error MeshDataTool::create_from_surface(const Ref<Mesh>& p_mesh,int p_surface) { format = p_mesh->surface_get_format(p_surface); material=p_mesh->surface_get_material(p_surface); - DVector<Vector3>::Read vr = varray.read(); + PoolVector<Vector3>::Read vr = varray.read(); - DVector<Vector3>::Read nr; + PoolVector<Vector3>::Read nr; if (arrays[Mesh::ARRAY_NORMAL].get_type()!=Variant::NIL) - nr = arrays[Mesh::ARRAY_NORMAL].operator DVector<Vector3>().read(); + nr = arrays[Mesh::ARRAY_NORMAL].operator PoolVector<Vector3>().read(); - DVector<real_t>::Read ta; + PoolVector<real_t>::Read ta; if (arrays[Mesh::ARRAY_TANGENT].get_type()!=Variant::NIL) - ta = arrays[Mesh::ARRAY_TANGENT].operator DVector<real_t>().read(); + ta = arrays[Mesh::ARRAY_TANGENT].operator PoolVector<real_t>().read(); - DVector<Vector2>::Read uv; + PoolVector<Vector2>::Read uv; if (arrays[Mesh::ARRAY_TEX_UV].get_type()!=Variant::NIL) - uv = arrays[Mesh::ARRAY_TEX_UV].operator DVector<Vector2>().read(); - DVector<Vector2>::Read uv2; + uv = arrays[Mesh::ARRAY_TEX_UV].operator PoolVector<Vector2>().read(); + PoolVector<Vector2>::Read uv2; if (arrays[Mesh::ARRAY_TEX_UV2].get_type()!=Variant::NIL) - uv2 = arrays[Mesh::ARRAY_TEX_UV2].operator DVector<Vector2>().read(); + uv2 = arrays[Mesh::ARRAY_TEX_UV2].operator PoolVector<Vector2>().read(); - DVector<Color>::Read col; + PoolVector<Color>::Read col; if (arrays[Mesh::ARRAY_COLOR].get_type()!=Variant::NIL) - col = arrays[Mesh::ARRAY_COLOR].operator DVector<Color>().read(); + col = arrays[Mesh::ARRAY_COLOR].operator PoolVector<Color>().read(); - DVector<real_t>::Read bo; + PoolVector<real_t>::Read bo; if (arrays[Mesh::ARRAY_BONES].get_type()!=Variant::NIL) - bo = arrays[Mesh::ARRAY_BONES].operator DVector<real_t>().read(); + bo = arrays[Mesh::ARRAY_BONES].operator PoolVector<real_t>().read(); - DVector<real_t>::Read we; + PoolVector<real_t>::Read we; if (arrays[Mesh::ARRAY_WEIGHTS].get_type()!=Variant::NIL) - we = arrays[Mesh::ARRAY_WEIGHTS].operator DVector<real_t>().read(); + we = arrays[Mesh::ARRAY_WEIGHTS].operator PoolVector<real_t>().read(); vertices.resize(vcount); @@ -129,7 +129,7 @@ Error MeshDataTool::create_from_surface(const Ref<Mesh>& p_mesh,int p_surface) { } - DVector<int> indices; + PoolVector<int> indices; if (arrays[Mesh::ARRAY_INDEX].get_type()!=Variant::NIL) { @@ -137,14 +137,14 @@ Error MeshDataTool::create_from_surface(const Ref<Mesh>& p_mesh,int p_surface) { } else { //make code simpler indices.resize(vcount); - DVector<int>::Write iw=indices.write(); + PoolVector<int>::Write iw=indices.write(); for(int i=0;i<vcount;i++) iw[i]=i; } int icount=indices.size(); - DVector<int>::Read r = indices.read(); + PoolVector<int>::Read r = indices.read(); Map<Point2i,int> edge_indices; @@ -199,59 +199,59 @@ Error MeshDataTool::commit_to_surface(const Ref<Mesh>& p_mesh) { int vcount=vertices.size(); - DVector<Vector3> v; - DVector<Vector3> n; - DVector<real_t> t; - DVector<Vector2> u; - DVector<Vector2> u2; - DVector<Color> c; - DVector<real_t> b; - DVector<real_t> w; - DVector<int> in; + PoolVector<Vector3> v; + PoolVector<Vector3> n; + PoolVector<real_t> t; + PoolVector<Vector2> u; + PoolVector<Vector2> u2; + PoolVector<Color> c; + PoolVector<real_t> b; + PoolVector<real_t> w; + PoolVector<int> in; { v.resize(vcount); - DVector<Vector3>::Write vr=v.write(); + PoolVector<Vector3>::Write vr=v.write(); - DVector<Vector3>::Write nr; + PoolVector<Vector3>::Write nr; if (format&Mesh::ARRAY_FORMAT_NORMAL) { n.resize(vcount); nr = n.write(); } - DVector<real_t>::Write ta; + PoolVector<real_t>::Write ta; if (format&Mesh::ARRAY_FORMAT_TANGENT) { t.resize(vcount*4); ta = t.write(); } - DVector<Vector2>::Write uv; + PoolVector<Vector2>::Write uv; if (format&Mesh::ARRAY_FORMAT_TEX_UV) { u.resize(vcount); uv = u.write(); } - DVector<Vector2>::Write uv2; + PoolVector<Vector2>::Write uv2; if (format&Mesh::ARRAY_FORMAT_TEX_UV2) { u2.resize(vcount); uv2 = u2.write(); } - DVector<Color>::Write col; + PoolVector<Color>::Write col; if (format&Mesh::ARRAY_FORMAT_COLOR) { c.resize(vcount); col = c.write(); } - DVector<real_t>::Write bo; + PoolVector<real_t>::Write bo; if (format&Mesh::ARRAY_FORMAT_BONES) { b.resize(vcount*4); bo = b.write(); } - DVector<real_t>::Write we; + PoolVector<real_t>::Write we; if (format&Mesh::ARRAY_FORMAT_WEIGHTS) { w.resize(vcount*4); we = w.write(); @@ -299,7 +299,7 @@ Error MeshDataTool::commit_to_surface(const Ref<Mesh>& p_mesh) { int fc = faces.size(); in.resize(fc*3); - DVector<int>::Write iw=in.write(); + PoolVector<int>::Write iw=in.write(); for(int i=0;i<fc;i++) { iw[i*3+0]=faces[i].v[0]; @@ -328,7 +328,7 @@ Error MeshDataTool::commit_to_surface(const Ref<Mesh>& p_mesh) { Ref<Mesh> ncmesh=p_mesh; int sc = ncmesh->get_surface_count(); - ncmesh->add_surface(Mesh::PRIMITIVE_TRIANGLES,arr); + ncmesh->add_surface_from_arrays(Mesh::PRIMITIVE_TRIANGLES,arr); ncmesh->surface_set_material(sc,material); return OK; @@ -565,62 +565,62 @@ void MeshDataTool::set_material(const Ref<Material> &p_material) { void MeshDataTool::_bind_methods() { - ObjectTypeDB::bind_method(_MD("clear"),&MeshDataTool::clear); - ObjectTypeDB::bind_method(_MD("create_from_surface","mesh","surface"),&MeshDataTool::create_from_surface); - ObjectTypeDB::bind_method(_MD("commit_to_surface","mesh"),&MeshDataTool::commit_to_surface); + ClassDB::bind_method(_MD("clear"),&MeshDataTool::clear); + ClassDB::bind_method(_MD("create_from_surface","mesh","surface"),&MeshDataTool::create_from_surface); + ClassDB::bind_method(_MD("commit_to_surface","mesh"),&MeshDataTool::commit_to_surface); - ObjectTypeDB::bind_method(_MD("get_format"),&MeshDataTool::get_format); + ClassDB::bind_method(_MD("get_format"),&MeshDataTool::get_format); - ObjectTypeDB::bind_method(_MD("get_vertex_count"),&MeshDataTool::get_vertex_count); - ObjectTypeDB::bind_method(_MD("get_edge_count"),&MeshDataTool::get_edge_count); - ObjectTypeDB::bind_method(_MD("get_face_count"),&MeshDataTool::get_face_count); + ClassDB::bind_method(_MD("get_vertex_count"),&MeshDataTool::get_vertex_count); + ClassDB::bind_method(_MD("get_edge_count"),&MeshDataTool::get_edge_count); + ClassDB::bind_method(_MD("get_face_count"),&MeshDataTool::get_face_count); - ObjectTypeDB::bind_method(_MD("set_vertex","idx","vertex"),&MeshDataTool::set_vertex); - ObjectTypeDB::bind_method(_MD("get_vertex","idx"),&MeshDataTool::get_vertex); + ClassDB::bind_method(_MD("set_vertex","idx","vertex"),&MeshDataTool::set_vertex); + ClassDB::bind_method(_MD("get_vertex","idx"),&MeshDataTool::get_vertex); - ObjectTypeDB::bind_method(_MD("set_vertex_normal","idx","normal"),&MeshDataTool::set_vertex_normal); - ObjectTypeDB::bind_method(_MD("get_vertex_normal","idx"),&MeshDataTool::get_vertex_normal); + ClassDB::bind_method(_MD("set_vertex_normal","idx","normal"),&MeshDataTool::set_vertex_normal); + ClassDB::bind_method(_MD("get_vertex_normal","idx"),&MeshDataTool::get_vertex_normal); - ObjectTypeDB::bind_method(_MD("set_vertex_tangent","idx","tangent"),&MeshDataTool::set_vertex_tangent); - ObjectTypeDB::bind_method(_MD("get_vertex_tangent","idx"),&MeshDataTool::get_vertex_tangent); + ClassDB::bind_method(_MD("set_vertex_tangent","idx","tangent"),&MeshDataTool::set_vertex_tangent); + ClassDB::bind_method(_MD("get_vertex_tangent","idx"),&MeshDataTool::get_vertex_tangent); - ObjectTypeDB::bind_method(_MD("set_vertex_uv","idx","uv"),&MeshDataTool::set_vertex_uv); - ObjectTypeDB::bind_method(_MD("get_vertex_uv","idx"),&MeshDataTool::get_vertex_uv); + ClassDB::bind_method(_MD("set_vertex_uv","idx","uv"),&MeshDataTool::set_vertex_uv); + ClassDB::bind_method(_MD("get_vertex_uv","idx"),&MeshDataTool::get_vertex_uv); - ObjectTypeDB::bind_method(_MD("set_vertex_uv2","idx","uv2"),&MeshDataTool::set_vertex_uv2); - ObjectTypeDB::bind_method(_MD("get_vertex_uv2","idx"),&MeshDataTool::get_vertex_uv2); + ClassDB::bind_method(_MD("set_vertex_uv2","idx","uv2"),&MeshDataTool::set_vertex_uv2); + ClassDB::bind_method(_MD("get_vertex_uv2","idx"),&MeshDataTool::get_vertex_uv2); - ObjectTypeDB::bind_method(_MD("set_vertex_color","idx","color"),&MeshDataTool::set_vertex_color); - ObjectTypeDB::bind_method(_MD("get_vertex_color","idx"),&MeshDataTool::get_vertex_color); + ClassDB::bind_method(_MD("set_vertex_color","idx","color"),&MeshDataTool::set_vertex_color); + ClassDB::bind_method(_MD("get_vertex_color","idx"),&MeshDataTool::get_vertex_color); - ObjectTypeDB::bind_method(_MD("set_vertex_bones","idx","bones"),&MeshDataTool::set_vertex_bones); - ObjectTypeDB::bind_method(_MD("get_vertex_bones","idx"),&MeshDataTool::get_vertex_bones); + ClassDB::bind_method(_MD("set_vertex_bones","idx","bones"),&MeshDataTool::set_vertex_bones); + ClassDB::bind_method(_MD("get_vertex_bones","idx"),&MeshDataTool::get_vertex_bones); - ObjectTypeDB::bind_method(_MD("set_vertex_weights","idx","weights"),&MeshDataTool::set_vertex_weights); - ObjectTypeDB::bind_method(_MD("get_vertex_weights","idx"),&MeshDataTool::get_vertex_weights); + ClassDB::bind_method(_MD("set_vertex_weights","idx","weights"),&MeshDataTool::set_vertex_weights); + ClassDB::bind_method(_MD("get_vertex_weights","idx"),&MeshDataTool::get_vertex_weights); - ObjectTypeDB::bind_method(_MD("set_vertex_meta","idx","meta"),&MeshDataTool::set_vertex_meta); - ObjectTypeDB::bind_method(_MD("get_vertex_meta","idx"),&MeshDataTool::get_vertex_meta); + ClassDB::bind_method(_MD("set_vertex_meta","idx","meta"),&MeshDataTool::set_vertex_meta); + ClassDB::bind_method(_MD("get_vertex_meta","idx"),&MeshDataTool::get_vertex_meta); - ObjectTypeDB::bind_method(_MD("get_vertex_edges","idx"),&MeshDataTool::get_vertex_edges); - ObjectTypeDB::bind_method(_MD("get_vertex_faces","idx"),&MeshDataTool::get_vertex_faces); + ClassDB::bind_method(_MD("get_vertex_edges","idx"),&MeshDataTool::get_vertex_edges); + ClassDB::bind_method(_MD("get_vertex_faces","idx"),&MeshDataTool::get_vertex_faces); - ObjectTypeDB::bind_method(_MD("get_edge_vertex","idx","vertex"),&MeshDataTool::get_edge_vertex); - ObjectTypeDB::bind_method(_MD("get_edge_faces","idx","faces"),&MeshDataTool::get_edge_faces); + ClassDB::bind_method(_MD("get_edge_vertex","idx","vertex"),&MeshDataTool::get_edge_vertex); + ClassDB::bind_method(_MD("get_edge_faces","idx","faces"),&MeshDataTool::get_edge_faces); - ObjectTypeDB::bind_method(_MD("set_edge_meta","idx","meta"),&MeshDataTool::set_edge_meta); - ObjectTypeDB::bind_method(_MD("get_edge_meta","idx"),&MeshDataTool::get_edge_meta); + ClassDB::bind_method(_MD("set_edge_meta","idx","meta"),&MeshDataTool::set_edge_meta); + ClassDB::bind_method(_MD("get_edge_meta","idx"),&MeshDataTool::get_edge_meta); - ObjectTypeDB::bind_method(_MD("get_face_vertex","idx","vertex"),&MeshDataTool::get_face_vertex); - ObjectTypeDB::bind_method(_MD("get_face_edge","idx","edge"),&MeshDataTool::get_face_edge); + ClassDB::bind_method(_MD("get_face_vertex","idx","vertex"),&MeshDataTool::get_face_vertex); + ClassDB::bind_method(_MD("get_face_edge","idx","edge"),&MeshDataTool::get_face_edge); - ObjectTypeDB::bind_method(_MD("set_face_meta","idx","meta"),&MeshDataTool::set_face_meta); - ObjectTypeDB::bind_method(_MD("get_face_meta","idx"),&MeshDataTool::get_face_meta); + ClassDB::bind_method(_MD("set_face_meta","idx","meta"),&MeshDataTool::set_face_meta); + ClassDB::bind_method(_MD("get_face_meta","idx"),&MeshDataTool::get_face_meta); - ObjectTypeDB::bind_method(_MD("get_face_normal","idx"),&MeshDataTool::get_face_normal); + ClassDB::bind_method(_MD("get_face_normal","idx"),&MeshDataTool::get_face_normal); - ObjectTypeDB::bind_method(_MD("set_material","material:Material"),&MeshDataTool::set_material); - ObjectTypeDB::bind_method(_MD("get_material","material"),&MeshDataTool::get_material); + ClassDB::bind_method(_MD("set_material","material:Material"),&MeshDataTool::set_material); + ClassDB::bind_method(_MD("get_material","material"),&MeshDataTool::get_material); } MeshDataTool::MeshDataTool(){ diff --git a/scene/resources/mesh_data_tool.h b/scene/resources/mesh_data_tool.h index 4a26fc2628..fa9c50d2ec 100644 --- a/scene/resources/mesh_data_tool.h +++ b/scene/resources/mesh_data_tool.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class MeshDataTool : public Reference { - OBJ_TYPE(MeshDataTool,Reference); + GDCLASS(MeshDataTool,Reference); int format; diff --git a/scene/resources/mesh_library.cpp b/scene/resources/mesh_library.cpp index 2b1d022299..cc357c4d9b 100644 --- a/scene/resources/mesh_library.cpp +++ b/scene/resources/mesh_library.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -244,19 +244,19 @@ int MeshLibrary::get_last_unused_item_id() const { void MeshLibrary::_bind_methods() { - ObjectTypeDB::bind_method(_MD("create_item","id"),&MeshLibrary::create_item); - ObjectTypeDB::bind_method(_MD("set_item_name","id","name"),&MeshLibrary::set_item_name); - ObjectTypeDB::bind_method(_MD("set_item_mesh","id","mesh:Mesh"),&MeshLibrary::set_item_mesh); - ObjectTypeDB::bind_method(_MD("set_item_navmesh","id","navmesh:NavigationMesh"),&MeshLibrary::set_item_navmesh); - ObjectTypeDB::bind_method(_MD("set_item_shape","id","shape:Shape"),&MeshLibrary::set_item_shape); - ObjectTypeDB::bind_method(_MD("get_item_name","id"),&MeshLibrary::get_item_name); - ObjectTypeDB::bind_method(_MD("get_item_mesh:Mesh","id"),&MeshLibrary::get_item_mesh); - ObjectTypeDB::bind_method(_MD("get_item_navmesh:NavigationMesh","id"),&MeshLibrary::get_item_navmesh); - ObjectTypeDB::bind_method(_MD("get_item_shape:Shape","id"),&MeshLibrary::get_item_shape); - ObjectTypeDB::bind_method(_MD("remove_item","id"),&MeshLibrary::remove_item); - ObjectTypeDB::bind_method(_MD("clear"),&MeshLibrary::clear); - ObjectTypeDB::bind_method(_MD("get_item_list"),&MeshLibrary::get_item_list); - ObjectTypeDB::bind_method(_MD("get_last_unused_item_id"),&MeshLibrary::get_last_unused_item_id); + ClassDB::bind_method(_MD("create_item","id"),&MeshLibrary::create_item); + ClassDB::bind_method(_MD("set_item_name","id","name"),&MeshLibrary::set_item_name); + ClassDB::bind_method(_MD("set_item_mesh","id","mesh:Mesh"),&MeshLibrary::set_item_mesh); + ClassDB::bind_method(_MD("set_item_navmesh","id","navmesh:NavigationMesh"),&MeshLibrary::set_item_navmesh); + ClassDB::bind_method(_MD("set_item_shape","id","shape:Shape"),&MeshLibrary::set_item_shape); + ClassDB::bind_method(_MD("get_item_name","id"),&MeshLibrary::get_item_name); + ClassDB::bind_method(_MD("get_item_mesh:Mesh","id"),&MeshLibrary::get_item_mesh); + ClassDB::bind_method(_MD("get_item_navmesh:NavigationMesh","id"),&MeshLibrary::get_item_navmesh); + ClassDB::bind_method(_MD("get_item_shape:Shape","id"),&MeshLibrary::get_item_shape); + ClassDB::bind_method(_MD("remove_item","id"),&MeshLibrary::remove_item); + ClassDB::bind_method(_MD("clear"),&MeshLibrary::clear); + ClassDB::bind_method(_MD("get_item_list"),&MeshLibrary::get_item_list); + ClassDB::bind_method(_MD("get_last_unused_item_id"),&MeshLibrary::get_last_unused_item_id); } MeshLibrary::MeshLibrary() { diff --git a/scene/resources/mesh_library.h b/scene/resources/mesh_library.h index e4dba193fc..bb8012d3ff 100644 --- a/scene/resources/mesh_library.h +++ b/scene/resources/mesh_library.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ class MeshLibrary : public Resource { - OBJ_TYPE(MeshLibrary,Resource); + GDCLASS(MeshLibrary,Resource); RES_BASE_EXTENSION("gt"); struct Item { diff --git a/scene/resources/multimesh.cpp b/scene/resources/multimesh.cpp index c5ade63124..75df4a4e60 100644 --- a/scene/resources/multimesh.cpp +++ b/scene/resources/multimesh.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,17 +31,17 @@ -void MultiMesh::_set_transform_array(const DVector<Vector3>& p_array) { +void MultiMesh::_set_transform_array(const PoolVector<Vector3>& p_array) { int instance_count = get_instance_count(); - DVector<Vector3> xforms = p_array; + PoolVector<Vector3> xforms = p_array; int len=xforms.size(); ERR_FAIL_COND((len/4) != instance_count); if (len==0) return; - DVector<Vector3>::Read r = xforms.read(); + PoolVector<Vector3>::Read r = xforms.read(); for(int i=0;i<len/4;i++) { @@ -56,17 +56,17 @@ void MultiMesh::_set_transform_array(const DVector<Vector3>& p_array) { } -DVector<Vector3> MultiMesh::_get_transform_array() const { +PoolVector<Vector3> MultiMesh::_get_transform_array() const { int instance_count = get_instance_count(); if (instance_count==0) - return DVector<Vector3>(); + return PoolVector<Vector3>(); - DVector<Vector3> xforms; + PoolVector<Vector3> xforms; xforms.resize(instance_count*4); - DVector<Vector3>::Write w = xforms.write(); + PoolVector<Vector3>::Write w = xforms.write(); for(int i=0;i<instance_count;i++) { @@ -82,17 +82,17 @@ DVector<Vector3> MultiMesh::_get_transform_array() const { } -void MultiMesh::_set_color_array(const DVector<Color>& p_array) { +void MultiMesh::_set_color_array(const PoolVector<Color>& p_array) { int instance_count = get_instance_count(); - DVector<Color> colors = p_array; + PoolVector<Color> colors = p_array; int len=colors.size(); ERR_FAIL_COND(len != instance_count); if (len==0) return; - DVector<Color>::Read r = colors.read(); + PoolVector<Color>::Read r = colors.read(); for(int i=0;i<len;i++) { @@ -101,14 +101,14 @@ void MultiMesh::_set_color_array(const DVector<Color>& p_array) { } -DVector<Color> MultiMesh::_get_color_array() const { +PoolVector<Color> MultiMesh::_get_color_array() const { int instance_count = get_instance_count(); if (instance_count==0) - return DVector<Color>(); + return PoolVector<Color>(); - DVector<Color> colors; + PoolVector<Color> colors; colors.resize(instance_count); for(int i=0;i<instance_count;i++) { @@ -141,7 +141,7 @@ Ref<Mesh> MultiMesh::get_mesh() const { void MultiMesh::set_instance_count(int p_count) { - VisualServer::get_singleton()->multimesh_set_instance_count(multimesh,p_count); + VisualServer::get_singleton()->multimesh_allocate(multimesh,p_count,VS::MultimeshTransformFormat(transform_format),VS::MultimeshColorFormat(color_format)); } int MultiMesh::get_instance_count() const { @@ -174,84 +174,87 @@ Color MultiMesh::get_instance_color(int p_instance) const { } -void MultiMesh::set_aabb(const AABB& p_aabb) { - aabb=p_aabb; - VisualServer::get_singleton()->multimesh_set_aabb(multimesh,p_aabb); +Rect3 MultiMesh::get_aabb() const { + return VisualServer::get_singleton()->multimesh_get_aabb(multimesh); } -AABB MultiMesh::get_aabb() const { - return aabb; -} - -void MultiMesh::generate_aabb() { - - - - ERR_EXPLAIN("Cannot generate AABB if mesh is null."); - ERR_FAIL_COND(mesh.is_null()); - - AABB base_aabb=mesh->get_aabb(); +RID MultiMesh::get_rid() const { - aabb=AABB(); + return multimesh; - int instance_count = get_instance_count(); - for(int i=0;i<instance_count;i++) { +} - Transform xform = get_instance_transform(i); - if(i==0) - aabb=xform.xform(base_aabb); - else - aabb.merge_with(xform.xform(base_aabb)); +void MultiMesh::set_color_format(ColorFormat p_color_format) { - } + color_format=p_color_format; +} - set_aabb(aabb); +MultiMesh::ColorFormat MultiMesh::get_color_format() const{ + return color_format; } -RID MultiMesh::get_rid() const { +void MultiMesh::set_transform_format(TransformFormat p_transform_format){ - return multimesh; + transform_format=p_transform_format; +} +MultiMesh::TransformFormat MultiMesh::get_transform_format() const{ + return transform_format; } + void MultiMesh::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_mesh","mesh:Mesh"),&MultiMesh::set_mesh); - ObjectTypeDB::bind_method(_MD("get_mesh:Mesh"),&MultiMesh::get_mesh); - ObjectTypeDB::bind_method(_MD("set_instance_count","count"),&MultiMesh::set_instance_count); - ObjectTypeDB::bind_method(_MD("get_instance_count"),&MultiMesh::get_instance_count); - ObjectTypeDB::bind_method(_MD("set_instance_transform","instance","transform"),&MultiMesh::set_instance_transform); - ObjectTypeDB::bind_method(_MD("get_instance_transform","instance"),&MultiMesh::get_instance_transform); - ObjectTypeDB::bind_method(_MD("set_instance_color","instance","color"),&MultiMesh::set_instance_color); - ObjectTypeDB::bind_method(_MD("get_instance_color","instance"),&MultiMesh::get_instance_color); - ObjectTypeDB::bind_method(_MD("set_aabb","visibility_aabb"),&MultiMesh::set_aabb); - ObjectTypeDB::bind_method(_MD("get_aabb"),&MultiMesh::get_aabb); + ClassDB::bind_method(_MD("set_mesh","mesh:Mesh"),&MultiMesh::set_mesh); + ClassDB::bind_method(_MD("get_mesh:Mesh"),&MultiMesh::get_mesh); + ClassDB::bind_method(_MD("set_color_format","format"),&MultiMesh::set_color_format); + ClassDB::bind_method(_MD("get_color_format"),&MultiMesh::get_color_format); + ClassDB::bind_method(_MD("set_transform_format","format"),&MultiMesh::set_transform_format); + ClassDB::bind_method(_MD("get_transform_format"),&MultiMesh::get_transform_format); + + ClassDB::bind_method(_MD("set_instance_count","count"),&MultiMesh::set_instance_count); + ClassDB::bind_method(_MD("get_instance_count"),&MultiMesh::get_instance_count); + ClassDB::bind_method(_MD("set_instance_transform","instance","transform"),&MultiMesh::set_instance_transform); + ClassDB::bind_method(_MD("get_instance_transform","instance"),&MultiMesh::get_instance_transform); + ClassDB::bind_method(_MD("set_instance_color","instance","color"),&MultiMesh::set_instance_color); + ClassDB::bind_method(_MD("get_instance_color","instance"),&MultiMesh::get_instance_color); + ClassDB::bind_method(_MD("get_aabb"),&MultiMesh::get_aabb); - ObjectTypeDB::bind_method(_MD("generate_aabb"),&MultiMesh::generate_aabb); - ObjectTypeDB::bind_method(_MD("_set_transform_array"),&MultiMesh::_set_transform_array); - ObjectTypeDB::bind_method(_MD("_get_transform_array"),&MultiMesh::_get_transform_array); - ObjectTypeDB::bind_method(_MD("_set_color_array"),&MultiMesh::_set_color_array); - ObjectTypeDB::bind_method(_MD("_get_color_array"),&MultiMesh::_get_color_array); + ClassDB::bind_method(_MD("_set_transform_array"),&MultiMesh::_set_transform_array); + ClassDB::bind_method(_MD("_get_transform_array"),&MultiMesh::_get_transform_array); + ClassDB::bind_method(_MD("_set_color_array"),&MultiMesh::_set_color_array); + ClassDB::bind_method(_MD("_get_color_array"),&MultiMesh::_get_color_array); + ADD_PROPERTY(PropertyInfo(Variant::INT,"color_format",PROPERTY_HINT_ENUM,"None,Byte,Float"), _SCS("set_color_format"), _SCS("get_color_format")); + ADD_PROPERTY(PropertyInfo(Variant::INT,"transform_format",PROPERTY_HINT_ENUM,"2D,3D"), _SCS("set_transform_format"), _SCS("get_transform_format")); ADD_PROPERTY(PropertyInfo(Variant::INT,"instance_count",PROPERTY_HINT_RANGE,"0,16384,1"), _SCS("set_instance_count"), _SCS("get_instance_count")); ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"mesh",PROPERTY_HINT_RESOURCE_TYPE,"Mesh"), _SCS("set_mesh"), _SCS("get_mesh")); - ADD_PROPERTY(PropertyInfo(Variant::_AABB,"aabb"), _SCS("set_aabb"), _SCS("get_aabb") ); - ADD_PROPERTY(PropertyInfo(Variant::VECTOR3_ARRAY,"transform_array",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_transform_array"), _SCS("_get_transform_array")); - ADD_PROPERTY(PropertyInfo(Variant::COLOR_ARRAY,"color_array",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_color_array"), _SCS("_get_color_array")); + ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR3_ARRAY,"transform_array",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_transform_array"), _SCS("_get_transform_array")); + ADD_PROPERTY(PropertyInfo(Variant::POOL_COLOR_ARRAY,"color_array",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_color_array"), _SCS("_get_color_array")); + + + + BIND_CONSTANT( TRANSFORM_2D ); + BIND_CONSTANT( TRANSFORM_3D ); + BIND_CONSTANT( COLOR_NONE ); + BIND_CONSTANT( COLOR_8BIT ); + BIND_CONSTANT( COLOR_FLOAT ); } MultiMesh::MultiMesh() { multimesh = VisualServer::get_singleton()->multimesh_create(); + color_format=COLOR_NONE; + transform_format=TRANSFORM_2D; } MultiMesh::~MultiMesh() { diff --git a/scene/resources/multimesh.h b/scene/resources/multimesh.h index 0cf9e92def..c86b33adcf 100644 --- a/scene/resources/multimesh.h +++ b/scene/resources/multimesh.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -30,31 +30,52 @@ #define MULTIMESH_H #include "scene/resources/mesh.h" - +#include "servers/visual_server.h" class MultiMesh : public Resource { - OBJ_TYPE( MultiMesh, Resource ); + GDCLASS( MultiMesh, Resource ); RES_BASE_EXTENSION("mmsh"); +public: - AABB aabb; + enum TransformFormat { + TRANSFORM_2D = VS::MULTIMESH_TRANSFORM_2D, + TRANSFORM_3D = VS::MULTIMESH_TRANSFORM_3D + }; + + enum ColorFormat { + COLOR_NONE = VS::MULTIMESH_COLOR_NONE, + COLOR_8BIT = VS::MULTIMESH_COLOR_8BIT, + COLOR_FLOAT = VS::MULTIMESH_COLOR_FLOAT, + }; +private: Ref<Mesh> mesh; RID multimesh; + TransformFormat transform_format; + ColorFormat color_format; + + protected: static void _bind_methods(); - void _set_transform_array(const DVector<Vector3>& p_array); - DVector<Vector3> _get_transform_array() const; + void _set_transform_array(const PoolVector<Vector3>& p_array); + PoolVector<Vector3> _get_transform_array() const; - void _set_color_array(const DVector<Color>& p_array); - DVector<Color> _get_color_array() const; + void _set_color_array(const PoolVector<Color>& p_array); + PoolVector<Color> _get_color_array() const; public: void set_mesh(const Ref<Mesh>& p_mesh); Ref<Mesh> get_mesh() const; + void set_color_format(ColorFormat p_color_format); + ColorFormat get_color_format() const; + + void set_transform_format(TransformFormat p_transform_format); + TransformFormat get_transform_format() const; + void set_instance_count(int p_count); int get_instance_count() const; @@ -64,10 +85,7 @@ public: void set_instance_color(int p_instance, const Color& p_color); Color get_instance_color(int p_instance) const; - void set_aabb(const AABB& p_aabb); - virtual AABB get_aabb() const; - - void generate_aabb(); + virtual Rect3 get_aabb() const; virtual RID get_rid() const; @@ -76,4 +94,8 @@ public: }; + +VARIANT_ENUM_CAST( MultiMesh::TransformFormat ); +VARIANT_ENUM_CAST( MultiMesh::ColorFormat); + #endif // MULTI_MESH_H diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index f16d68a521..625cc6a596 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -42,7 +42,7 @@ bool SceneState::can_instance() const { } -Node *SceneState::instance(bool p_gen_edit_state) const { +Node *SceneState::instance(GenEditState p_edit_state) const { // nodes where instancing failed (because something is missing) List<Node*> stray_instances; @@ -76,7 +76,9 @@ Node *SceneState::instance(bool p_gen_edit_state) const { Node **ret_nodes=(Node**)alloca( sizeof(Node*)*nc ); - bool gen_node_path_cache=p_gen_edit_state && node_path_cache.empty(); + bool gen_node_path_cache=p_edit_state!=GEN_EDIT_STATE_DISABLED && node_path_cache.empty(); + + Map<Ref<Resource>,Ref<Resource> > resources_local_to_scene; for(int i=0;i<nc;i++) { @@ -105,9 +107,9 @@ Node *SceneState::instance(bool p_gen_edit_state) const { //print_line("scene inherit"); Ref<PackedScene> sdata = props[ base_scene_idx ]; ERR_FAIL_COND_V( !sdata.is_valid(), NULL); - node = sdata->instance(p_gen_edit_state); + node = sdata->instance(p_edit_state==GEN_EDIT_STATE_DISABLED ? PackedScene::GEN_EDIT_STATE_DISABLED : PackedScene::GEN_EDIT_STATE_INSTANCE); //only main gets main edit state ERR_FAIL_COND_V(!node,NULL); - if (p_gen_edit_state) { + if (p_edit_state!=GEN_EDIT_STATE_DISABLED) { node->set_scene_inherited_state(sdata->get_state()); } @@ -121,7 +123,7 @@ Node *SceneState::instance(bool p_gen_edit_state) const { Ref<PackedScene> sdata = ResourceLoader::load(path,"PackedScene"); ERR_FAIL_COND_V( !sdata.is_valid(), NULL); - node = sdata->instance(p_gen_edit_state); + node = sdata->instance(p_edit_state==GEN_EDIT_STATE_DISABLED ? PackedScene::GEN_EDIT_STATE_DISABLED : PackedScene::GEN_EDIT_STATE_INSTANCE); ERR_FAIL_COND_V(!node,NULL); } else { InstancePlaceholder *ip = memnew( InstancePlaceholder ); @@ -132,7 +134,7 @@ Node *SceneState::instance(bool p_gen_edit_state) const { } else { Ref<PackedScene> sdata = props[ n.instance&FLAG_MASK ]; ERR_FAIL_COND_V( !sdata.is_valid(), NULL); - node = sdata->instance(p_gen_edit_state); + node = sdata->instance(p_edit_state==GEN_EDIT_STATE_DISABLED ? PackedScene::GEN_EDIT_STATE_DISABLED : PackedScene::GEN_EDIT_STATE_INSTANCE); ERR_FAIL_COND_V(!node,NULL); } @@ -148,10 +150,10 @@ Node *SceneState::instance(bool p_gen_edit_state) const { } #endif } - } else if (ObjectTypeDB::is_type_enabled(snames[n.type])) { + } else if (ClassDB::is_class_enabled(snames[n.type])) { //print_line("created"); //node belongs to this scene and must be created - Object * obj = ObjectTypeDB::instance(snames[ n.type ]); + Object * obj = ClassDB::instance(snames[ n.type ]); if (!obj || !obj->cast_to<Node>()) { if (obj) { memdelete(obj); @@ -166,8 +168,8 @@ Node *SceneState::instance(bool p_gen_edit_state) const { } else if (ret_nodes[n.parent]->cast_to<Node2D>()) { obj = memnew( Node2D ); } - } + if (!obj) { obj = memnew( Node ); } @@ -212,7 +214,43 @@ Node *SceneState::instance(bool p_gen_edit_state) const { } } else { - node->set(snames[ nprops[j].name ],props[ nprops[j].value ],&valid); + Variant value = props[ nprops[j].value ]; + + if (value.get_type()==Variant::OBJECT) { + //handle resources that are local to scene by duplicating them if needed + Ref<Resource> res = value; + if (res.is_valid()) { + if (res->is_local_to_scene()) { + + Map<Ref<Resource>,Ref<Resource> >::Element *E=resources_local_to_scene.find(res); + + if (E) { + value=E->get(); + } else { + + Node *base = i==0?node:ret_nodes[0]; + + if (p_edit_state==GEN_EDIT_STATE_MAIN) { + + res->local_scene=base; + resources_local_to_scene[res]=res; + + } else { + Node *base = i==0?node:ret_nodes[0]; + Ref<Resource> local_dupe = res->duplicate_for_local_scene(base,resources_local_to_scene); + resources_local_to_scene[res]=local_dupe; + res=local_dupe; + value=local_dupe; + } + + res->setup_local_to_scene(); + + } + //must make a copy, because this res is local to scene + } + } + } + node->set(snames[ nprops[j].name ],value,&valid); } } } @@ -639,7 +677,7 @@ Error SceneState::_parse_node(Node *p_owner,Node *p_node,int p_parent_idx, Map<S // then flag that the node should not be created but reused if (pack_state_stack.empty()) { //this node is not part of an instancing process, so save the type - nd.type=_nm_get_string(p_node->get_type(),name_map); + nd.type=_nm_get_string(p_node->get_class(),name_map); } else { // this node is part of an instanced process, so do not save the type. // instead, save that it was instanced @@ -1139,12 +1177,12 @@ void SceneState::set_bundled_scene(const Dictionary& d) { ERR_FAIL(); } - DVector<String> snames = d["names"]; + PoolVector<String> snames = d["names"]; if (snames.size()) { int namecount = snames.size(); names.resize(namecount); - DVector<String>::Read r =snames.read(); + PoolVector<String>::Read r =snames.read(); for(int i=0;i<names.size();i++) names[i]=r[i]; } @@ -1166,8 +1204,8 @@ void SceneState::set_bundled_scene(const Dictionary& d) { nodes.resize(d["node_count"]); int nc=nodes.size(); if (nc) { - DVector<int> snodes = d["nodes"]; - DVector<int>::Read r = snodes.read(); + PoolVector<int> snodes = d["nodes"]; + PoolVector<int>::Read r = snodes.read(); int idx=0; for(int i=0;i<nc;i++) { NodeData &nd = nodes[i]; @@ -1196,8 +1234,8 @@ void SceneState::set_bundled_scene(const Dictionary& d) { if (cc) { - DVector<int> sconns = d["conns"]; - DVector<int>::Read r = sconns.read(); + PoolVector<int> sconns = d["conns"]; + PoolVector<int>::Read r = sconns.read(); int idx=0; for(int i=0;i<cc;i++) { ConnectionData &cd = connections[i]; @@ -1245,12 +1283,12 @@ void SceneState::set_bundled_scene(const Dictionary& d) { Dictionary SceneState::get_bundled_scene() const { - DVector<String> rnames; + PoolVector<String> rnames; rnames.resize(names.size()); if (names.size()) { - DVector<String>::Write r=rnames.write(); + PoolVector<String>::Write r=rnames.write(); for(int i=0;i<names.size();i++) r[i]=names[i]; @@ -1659,10 +1697,10 @@ void SceneState::add_editable_instance(const NodePath& p_path){ editable_instances.push_back(p_path); } -DVector<String> SceneState::_get_node_groups(int p_idx) const { +PoolVector<String> SceneState::_get_node_groups(int p_idx) const { Vector<StringName> groups = get_node_groups(p_idx); - DVector<String> ret; + PoolVector<String> ret; for(int i=0;i<groups.size();i++) ret.push_back(groups[i]); @@ -1674,25 +1712,29 @@ void SceneState::_bind_methods() { //unbuild API - ObjectTypeDB::bind_method(_MD("get_node_count"),&SceneState::get_node_count); - ObjectTypeDB::bind_method(_MD("get_node_type","idx"),&SceneState::get_node_type); - ObjectTypeDB::bind_method(_MD("get_node_name","idx"),&SceneState::get_node_name); - ObjectTypeDB::bind_method(_MD("get_node_path","idx","for_parent"),&SceneState::get_node_path,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("get_node_owner_path","idx"),&SceneState::get_node_owner_path); - ObjectTypeDB::bind_method(_MD("is_node_instance_placeholder","idx"),&SceneState::is_node_instance_placeholder); - ObjectTypeDB::bind_method(_MD("get_node_instance_placeholder","idx"),&SceneState::get_node_instance_placeholder); - ObjectTypeDB::bind_method(_MD("get_node_instance:PackedScene","idx"),&SceneState::get_node_instance); - ObjectTypeDB::bind_method(_MD("get_node_groups","idx"),&SceneState::_get_node_groups); - ObjectTypeDB::bind_method(_MD("get_node_property_count","idx"),&SceneState::get_node_property_count); - ObjectTypeDB::bind_method(_MD("get_node_property_name","idx","prop_idx"),&SceneState::get_node_property_name); - ObjectTypeDB::bind_method(_MD("get_node_property_value","idx","prop_idx"),&SceneState::get_node_property_value); - ObjectTypeDB::bind_method(_MD("get_connection_count"),&SceneState::get_connection_count); - ObjectTypeDB::bind_method(_MD("get_connection_source","idx"),&SceneState::get_connection_source); - ObjectTypeDB::bind_method(_MD("get_connection_signal","idx"),&SceneState::get_connection_signal); - ObjectTypeDB::bind_method(_MD("get_connection_target","idx"),&SceneState::get_connection_target); - ObjectTypeDB::bind_method(_MD("get_connection_method","idx"),&SceneState::get_connection_method); - ObjectTypeDB::bind_method(_MD("get_connection_flags","idx"),&SceneState::get_connection_flags); - ObjectTypeDB::bind_method(_MD("get_connection_binds","idx"),&SceneState::get_connection_binds); + ClassDB::bind_method(_MD("get_node_count"),&SceneState::get_node_count); + ClassDB::bind_method(_MD("get_node_type","idx"),&SceneState::get_node_type); + ClassDB::bind_method(_MD("get_node_name","idx"),&SceneState::get_node_name); + ClassDB::bind_method(_MD("get_node_path","idx","for_parent"),&SceneState::get_node_path,DEFVAL(false)); + ClassDB::bind_method(_MD("get_node_owner_path","idx"),&SceneState::get_node_owner_path); + ClassDB::bind_method(_MD("is_node_instance_placeholder","idx"),&SceneState::is_node_instance_placeholder); + ClassDB::bind_method(_MD("get_node_instance_placeholder","idx"),&SceneState::get_node_instance_placeholder); + ClassDB::bind_method(_MD("get_node_instance:PackedScene","idx"),&SceneState::get_node_instance); + ClassDB::bind_method(_MD("get_node_groups","idx"),&SceneState::_get_node_groups); + ClassDB::bind_method(_MD("get_node_property_count","idx"),&SceneState::get_node_property_count); + ClassDB::bind_method(_MD("get_node_property_name","idx","prop_idx"),&SceneState::get_node_property_name); + ClassDB::bind_method(_MD("get_node_property_value","idx","prop_idx"),&SceneState::get_node_property_value); + ClassDB::bind_method(_MD("get_connection_count"),&SceneState::get_connection_count); + ClassDB::bind_method(_MD("get_connection_source","idx"),&SceneState::get_connection_source); + ClassDB::bind_method(_MD("get_connection_signal","idx"),&SceneState::get_connection_signal); + ClassDB::bind_method(_MD("get_connection_target","idx"),&SceneState::get_connection_target); + ClassDB::bind_method(_MD("get_connection_method","idx"),&SceneState::get_connection_method); + ClassDB::bind_method(_MD("get_connection_flags","idx"),&SceneState::get_connection_flags); + ClassDB::bind_method(_MD("get_connection_binds","idx"),&SceneState::get_connection_binds); + + BIND_CONSTANT( GEN_EDIT_STATE_DISABLED ); + BIND_CONSTANT( GEN_EDIT_STATE_INSTANCE ); + BIND_CONSTANT( GEN_EDIT_STATE_MAIN ); } SceneState::SceneState() { @@ -1732,20 +1774,20 @@ bool PackedScene::can_instance() const { return state->can_instance(); } -Node *PackedScene::instance(bool p_gen_edit_state) const { +Node *PackedScene::instance(GenEditState p_edit_state) const { #ifndef TOOLS_ENABLED - if (p_gen_edit_state) { + if (p_edit_state!=GEN_EDIT_STATE_DISABLED) { ERR_EXPLAIN("Edit state is only for editors, does not work without tools compiled"); - ERR_FAIL_COND_V(p_gen_edit_state,NULL); + ERR_FAIL_COND_V(p_edit_state!=GEN_EDIT_STATE_DISABLED,NULL); } #endif - Node *s = state->instance(p_gen_edit_state); + Node *s = state->instance((SceneState::GenEditState)p_edit_state); if (!s) return NULL; - if (p_gen_edit_state) { + if (p_edit_state!=GEN_EDIT_STATE_DISABLED) { s->set_scene_instance_state(state); } @@ -1791,15 +1833,19 @@ void PackedScene::set_path(const String& p_path,bool p_take_over) { void PackedScene::_bind_methods() { - ObjectTypeDB::bind_method(_MD("pack","path:Node"),&PackedScene::pack); - ObjectTypeDB::bind_method(_MD("instance:Node","gen_edit_state"),&PackedScene::instance,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("can_instance"),&PackedScene::can_instance); - ObjectTypeDB::bind_method(_MD("_set_bundled_scene"),&PackedScene::_set_bundled_scene); - ObjectTypeDB::bind_method(_MD("_get_bundled_scene"),&PackedScene::_get_bundled_scene); - ObjectTypeDB::bind_method(_MD("get_state:SceneState"),&PackedScene::get_state); + ClassDB::bind_method(_MD("pack","path:Node"),&PackedScene::pack); + ClassDB::bind_method(_MD("instance:Node","edit_state"),&PackedScene::instance,DEFVAL(false)); + ClassDB::bind_method(_MD("can_instance"),&PackedScene::can_instance); + ClassDB::bind_method(_MD("_set_bundled_scene"),&PackedScene::_set_bundled_scene); + ClassDB::bind_method(_MD("_get_bundled_scene"),&PackedScene::_get_bundled_scene); + ClassDB::bind_method(_MD("get_state:SceneState"),&PackedScene::get_state); ADD_PROPERTY( PropertyInfo(Variant::DICTIONARY,"_bundled"),_SCS("_set_bundled_scene"),_SCS("_get_bundled_scene")); + BIND_CONSTANT( GEN_EDIT_STATE_DISABLED ); + BIND_CONSTANT( GEN_EDIT_STATE_INSTANCE ); + BIND_CONSTANT( GEN_EDIT_STATE_MAIN ); + } PackedScene::PackedScene() { diff --git a/scene/resources/packed_scene.h b/scene/resources/packed_scene.h index f0e530f88a..381b356b1e 100644 --- a/scene/resources/packed_scene.h +++ b/scene/resources/packed_scene.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class SceneState : public Reference { - OBJ_TYPE( SceneState, Reference ); + GDCLASS( SceneState, Reference ); Vector<StringName> names; @@ -102,7 +102,7 @@ class SceneState : public Reference { static bool disable_placeholders; - DVector<String> _get_node_groups(int p_idx) const; + PoolVector<String> _get_node_groups(int p_idx) const; protected: @@ -117,6 +117,12 @@ public: FLAG_MASK=(1<<24)-1, }; + enum GenEditState { + GEN_EDIT_STATE_DISABLED, + GEN_EDIT_STATE_INSTANCE, + GEN_EDIT_STATE_MAIN, + }; + static void set_disable_placeholders(bool p_disable); int find_node_by_path(const NodePath& p_node) const; @@ -136,7 +142,7 @@ public: void clear(); bool can_instance() const; - Node *instance(bool p_gen_edit_state=false) const; + Node *instance(GenEditState p_edit_state) const; //unbuild API @@ -187,9 +193,11 @@ public: SceneState(); }; +VARIANT_ENUM_CAST(SceneState::GenEditState) + class PackedScene : public Resource { - OBJ_TYPE(PackedScene, Resource ); + GDCLASS(PackedScene, Resource ); RES_BASE_EXTENSION("scn"); Ref<SceneState> state; @@ -203,13 +211,18 @@ protected: static void _bind_methods(); public: + enum GenEditState { + GEN_EDIT_STATE_DISABLED, + GEN_EDIT_STATE_INSTANCE, + GEN_EDIT_STATE_MAIN, + }; Error pack(Node *p_scene); void clear(); bool can_instance() const; - Node *instance(bool p_gen_edit_state=false) const; + Node *instance(GenEditState p_edit_state=GEN_EDIT_STATE_DISABLED) const; void recreate_state(); void replace_state(Ref<SceneState> p_by); @@ -225,4 +238,6 @@ public: }; +VARIANT_ENUM_CAST(PackedScene::GenEditState) + #endif // SCENE_PRELOADER_H diff --git a/scene/resources/plane_shape.cpp b/scene/resources/plane_shape.cpp index f551414f61..1814eea66c 100644 --- a/scene/resources/plane_shape.cpp +++ b/scene/resources/plane_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -80,8 +80,8 @@ Plane PlaneShape::get_plane() const { void PlaneShape::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_plane","plane"),&PlaneShape::set_plane); - ObjectTypeDB::bind_method(_MD("get_plane"),&PlaneShape::get_plane); + ClassDB::bind_method(_MD("set_plane","plane"),&PlaneShape::set_plane); + ClassDB::bind_method(_MD("get_plane"),&PlaneShape::get_plane); ADD_PROPERTY( PropertyInfo(Variant::PLANE,"plane"), _SCS("set_plane"), _SCS("get_plane") ); diff --git a/scene/resources/plane_shape.h b/scene/resources/plane_shape.h index 543c433965..88f3a04f05 100644 --- a/scene/resources/plane_shape.h +++ b/scene/resources/plane_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class PlaneShape : public Shape { - OBJ_TYPE(PlaneShape,Shape); + GDCLASS(PlaneShape,Shape); Plane plane; protected: diff --git a/scene/resources/polygon_path_finder.cpp b/scene/resources/polygon_path_finder.cpp index d6d9cbc091..2156487407 100644 --- a/scene/resources/polygon_path_finder.cpp +++ b/scene/resources/polygon_path_finder.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -448,7 +448,7 @@ void PolygonPathFinder::_set_data(const Dictionary& p_data) { ERR_FAIL_COND(!p_data.has("segments")); ERR_FAIL_COND(!p_data.has("bounds")); - DVector<Vector2> p=p_data["points"]; + PoolVector<Vector2> p=p_data["points"]; Array c=p_data["connections"]; ERR_FAIL_COND(c.size()!=p.size()); @@ -458,11 +458,11 @@ void PolygonPathFinder::_set_data(const Dictionary& p_data) { int pc = p.size(); points.resize(pc+2); - DVector<Vector2>::Read pr=p.read(); + PoolVector<Vector2>::Read pr=p.read(); for(int i=0;i<pc;i++) { points[i].pos=pr[i]; - DVector<int> con=c[i]; - DVector<int>::Read cr=con.read(); + PoolVector<int> con=c[i]; + PoolVector<int>::Read cr=con.read(); int cc=con.size(); for(int j=0;j<cc;j++) { @@ -473,19 +473,19 @@ void PolygonPathFinder::_set_data(const Dictionary& p_data) { if (p_data.has("penalties")) { - DVector<float> penalties=p_data["penalties"]; + PoolVector<float> penalties=p_data["penalties"]; if (penalties.size()==pc) { - DVector<float>::Read pr = penalties.read(); + PoolVector<float>::Read pr = penalties.read(); for(int i=0;i<pc;i++) { points[i].penalty=pr[i]; } } } - DVector<int> segs=p_data["segments"]; + PoolVector<int> segs=p_data["segments"]; int sc=segs.size(); ERR_FAIL_COND(sc&1); - DVector<int>::Read sr = segs.read(); + PoolVector<int>::Read sr = segs.read(); for(int i=0;i<sc;i+=2) { Edge e(sr[i],sr[i+1]); @@ -498,25 +498,25 @@ void PolygonPathFinder::_set_data(const Dictionary& p_data) { Dictionary PolygonPathFinder::_get_data() const{ Dictionary d; - DVector<Vector2> p; - DVector<int> ind; + PoolVector<Vector2> p; + PoolVector<int> ind; Array connections; p.resize(points.size()-2); connections.resize(points.size()-2); ind.resize(edges.size()*2); - DVector<float> penalties; + PoolVector<float> penalties; penalties.resize(points.size()-2); { - DVector<Vector2>::Write wp=p.write(); - DVector<float>::Write pw=penalties.write(); + PoolVector<Vector2>::Write wp=p.write(); + PoolVector<float>::Write pw=penalties.write(); for(int i=0;i<points.size()-2;i++) { wp[i]=points[i].pos; pw[i]=points[i].penalty; - DVector<int> c; + PoolVector<int> c; c.resize(points[i].connections.size()); { - DVector<int>::Write cw=c.write(); + PoolVector<int>::Write cw=c.write(); int idx=0; for (Set<int>::Element *E=points[i].connections.front();E;E=E->next()) { cw[idx++]=E->get(); @@ -527,7 +527,7 @@ Dictionary PolygonPathFinder::_get_data() const{ } { - DVector<int>::Write iw=ind.write(); + PoolVector<int>::Write iw=ind.write(); int idx=0; for (Set<Edge>::Element *E=edges.front();E;E=E->next()) { iw[idx++]=E->get().points[0]; @@ -618,17 +618,17 @@ float PolygonPathFinder::get_point_penalty(int p_point) const { void PolygonPathFinder::_bind_methods() { - ObjectTypeDB::bind_method(_MD("setup","points","connections"),&PolygonPathFinder::setup); - ObjectTypeDB::bind_method(_MD("find_path","from","to"),&PolygonPathFinder::find_path); - ObjectTypeDB::bind_method(_MD("get_intersections","from","to"),&PolygonPathFinder::get_intersections); - ObjectTypeDB::bind_method(_MD("get_closest_point","point"),&PolygonPathFinder::get_closest_point); - ObjectTypeDB::bind_method(_MD("is_point_inside","point"),&PolygonPathFinder::is_point_inside); - ObjectTypeDB::bind_method(_MD("set_point_penalty","idx","penalty"),&PolygonPathFinder::set_point_penalty); - ObjectTypeDB::bind_method(_MD("get_point_penalty","idx"),&PolygonPathFinder::get_point_penalty); - - ObjectTypeDB::bind_method(_MD("get_bounds"),&PolygonPathFinder::get_bounds); - ObjectTypeDB::bind_method(_MD("_set_data"),&PolygonPathFinder::_set_data); - ObjectTypeDB::bind_method(_MD("_get_data"),&PolygonPathFinder::_get_data); + ClassDB::bind_method(_MD("setup","points","connections"),&PolygonPathFinder::setup); + ClassDB::bind_method(_MD("find_path","from","to"),&PolygonPathFinder::find_path); + ClassDB::bind_method(_MD("get_intersections","from","to"),&PolygonPathFinder::get_intersections); + ClassDB::bind_method(_MD("get_closest_point","point"),&PolygonPathFinder::get_closest_point); + ClassDB::bind_method(_MD("is_point_inside","point"),&PolygonPathFinder::is_point_inside); + ClassDB::bind_method(_MD("set_point_penalty","idx","penalty"),&PolygonPathFinder::set_point_penalty); + ClassDB::bind_method(_MD("get_point_penalty","idx"),&PolygonPathFinder::get_point_penalty); + + ClassDB::bind_method(_MD("get_bounds"),&PolygonPathFinder::get_bounds); + ClassDB::bind_method(_MD("_set_data"),&PolygonPathFinder::_set_data); + ClassDB::bind_method(_MD("_get_data"),&PolygonPathFinder::_get_data); ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY,"data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR),_SCS("_set_data"),_SCS("_get_data")); diff --git a/scene/resources/polygon_path_finder.h b/scene/resources/polygon_path_finder.h index dcc38bfb9d..58b8023843 100644 --- a/scene/resources/polygon_path_finder.h +++ b/scene/resources/polygon_path_finder.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class PolygonPathFinder : public Resource { - OBJ_TYPE(PolygonPathFinder,Resource); + GDCLASS(PolygonPathFinder,Resource); struct Point { Vector2 pos; diff --git a/scene/resources/ray_shape.cpp b/scene/resources/ray_shape.cpp index 73ce4de976..226062bed3 100644 --- a/scene/resources/ray_shape.cpp +++ b/scene/resources/ray_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -60,8 +60,8 @@ float RayShape::get_length() const { void RayShape::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_length","length"),&RayShape::set_length); - ObjectTypeDB::bind_method(_MD("get_length"),&RayShape::get_length); + ClassDB::bind_method(_MD("set_length","length"),&RayShape::set_length); + ClassDB::bind_method(_MD("get_length"),&RayShape::get_length); ADD_PROPERTY( PropertyInfo(Variant::REAL,"length",PROPERTY_HINT_RANGE,"0,4096,0.01"), _SCS("set_length"), _SCS("get_length") ); diff --git a/scene/resources/ray_shape.h b/scene/resources/ray_shape.h index 0218045247..9ee59d5f91 100644 --- a/scene/resources/ray_shape.h +++ b/scene/resources/ray_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,7 +32,7 @@ class RayShape : public Shape { - OBJ_TYPE(RayShape,Shape); + GDCLASS(RayShape,Shape); float length; protected: diff --git a/scene/resources/rectangle_shape_2d.cpp b/scene/resources/rectangle_shape_2d.cpp index bc0f86f0a7..3272125b33 100644 --- a/scene/resources/rectangle_shape_2d.cpp +++ b/scene/resources/rectangle_shape_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -64,8 +64,8 @@ Rect2 RectangleShape2D::get_rect() const { void RectangleShape2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_extents","extents"),&RectangleShape2D::set_extents); - ObjectTypeDB::bind_method(_MD("get_extents"),&RectangleShape2D::get_extents); + ClassDB::bind_method(_MD("set_extents","extents"),&RectangleShape2D::set_extents); + ClassDB::bind_method(_MD("get_extents"),&RectangleShape2D::get_extents); diff --git a/scene/resources/rectangle_shape_2d.h b/scene/resources/rectangle_shape_2d.h index 1ffbe1e356..6682b67de0 100644 --- a/scene/resources/rectangle_shape_2d.h +++ b/scene/resources/rectangle_shape_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,7 +32,7 @@ #include "scene/resources/shape_2d.h" class RectangleShape2D : public Shape2D { - OBJ_TYPE( RectangleShape2D, Shape2D ); + GDCLASS( RectangleShape2D, Shape2D ); Vector2 extents; void _update_shape(); diff --git a/scene/resources/room.cpp b/scene/resources/room.cpp index f28220531b..069127f291 100644 --- a/scene/resources/room.cpp +++ b/scene/resources/room.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,63 +36,27 @@ RID RoomBounds::get_rid() const { return area; } -void RoomBounds::set_bounds( const BSP_Tree& p_bounds ) { - VisualServer::get_singleton()->room_set_bounds(area,p_bounds); - emit_signal("changed"); -} - -BSP_Tree RoomBounds::get_bounds() const { - - return VisualServer::get_singleton()->room_get_bounds(area); -} - -void RoomBounds::set_geometry_hint(const DVector<Face3>& p_geometry_hint) { +void RoomBounds::set_geometry_hint(const PoolVector<Face3>& p_geometry_hint) { geometry_hint=p_geometry_hint; } -DVector<Face3> RoomBounds::get_geometry_hint() const { +PoolVector<Face3> RoomBounds::get_geometry_hint() const { return geometry_hint; } -void RoomBounds::_regenerate_bsp_cubic() { - - if (geometry_hint.size()) { - - float err=0; - geometry_hint= Geometry::wrap_geometry( geometry_hint, &err ); ///< create a "wrap" that encloses the given geometry - BSP_Tree new_bounds(geometry_hint,err); - set_bounds(new_bounds); - } - -} - -void RoomBounds::_regenerate_bsp() { - - if (geometry_hint.size()) { - - BSP_Tree new_bounds(geometry_hint,0); - set_bounds(new_bounds); - } -} void RoomBounds::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_bounds","bsp_tree"),&RoomBounds::set_bounds); - ObjectTypeDB::bind_method(_MD("get_bounds"),&RoomBounds::get_bounds); - ObjectTypeDB::bind_method(_MD("set_geometry_hint","triangles"),&RoomBounds::set_geometry_hint); - ObjectTypeDB::bind_method(_MD("get_geometry_hint"),&RoomBounds::get_geometry_hint); - ObjectTypeDB::bind_method(_MD("regenerate_bsp"),&RoomBounds::_regenerate_bsp); - ObjectTypeDB::set_method_flags(get_type_static(),_SCS("regenerate_bsp"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); - ObjectTypeDB::bind_method(_MD("regenerate_bsp_cubic"),&RoomBounds::_regenerate_bsp_cubic); - ObjectTypeDB::set_method_flags(get_type_static(),_SCS("regenerate_bsp_cubic"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + ClassDB::bind_method(_MD("set_geometry_hint","triangles"),&RoomBounds::set_geometry_hint); + ClassDB::bind_method(_MD("get_geometry_hint"),&RoomBounds::get_geometry_hint); - ADD_PROPERTY( PropertyInfo( Variant::DICTIONARY, "bounds"), _SCS("set_bounds"),_SCS("get_bounds") ); - ADD_PROPERTY( PropertyInfo( Variant::VECTOR3_ARRAY, "geometry_hint"),_SCS("set_geometry_hint"),_SCS("get_geometry_hint") ); + //ADD_PROPERTY( PropertyInfo( Variant::DICTIONARY, "bounds"), _SCS("set_bounds"),_SCS("get_bounds") ); + ADD_PROPERTY( PropertyInfo( Variant::POOL_VECTOR3_ARRAY, "geometry_hint"),_SCS("set_geometry_hint"),_SCS("get_geometry_hint") ); } diff --git a/scene/resources/room.h b/scene/resources/room.h index dc5e284838..84d68e5718 100644 --- a/scene/resources/room.h +++ b/scene/resources/room.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,16 +34,16 @@ /** @author Juan Linietsky <reduzio@gmail.com> */ + class RoomBounds : public Resource { - OBJ_TYPE( RoomBounds, Resource ); + GDCLASS( RoomBounds, Resource ); RES_BASE_EXTENSION("room"); RID area; - DVector<Face3> geometry_hint; + PoolVector<Face3> geometry_hint; + - void _regenerate_bsp(); - void _regenerate_bsp_cubic(); protected: static void _bind_methods(); @@ -52,15 +52,15 @@ public: virtual RID get_rid() const; - void set_bounds( const BSP_Tree& p_bounds ); - BSP_Tree get_bounds() const; - void set_geometry_hint(const DVector<Face3>& geometry_hint); - DVector<Face3> get_geometry_hint() const; + void set_geometry_hint(const PoolVector<Face3>& geometry_hint); + PoolVector<Face3> get_geometry_hint() const; RoomBounds(); ~RoomBounds(); }; + + #endif // ROOM_H diff --git a/scene/resources/sample.cpp b/scene/resources/sample.cpp index aae4e85a27..e07e4d3767 100644 --- a/scene/resources/sample.cpp +++ b/scene/resources/sample.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -119,18 +119,18 @@ int Sample::get_length() const { return length; } -void Sample::set_data(const DVector<uint8_t>& p_buffer) { +void Sample::set_data(const PoolVector<uint8_t>& p_buffer) { if (sample.is_valid()) AudioServer::get_singleton()->sample_set_data(sample,p_buffer); } -DVector<uint8_t> Sample::get_data() const { +PoolVector<uint8_t> Sample::get_data() const { if (sample.is_valid()) return AudioServer::get_singleton()->sample_get_data(sample); - return DVector<uint8_t>(); + return PoolVector<uint8_t>(); } @@ -192,23 +192,23 @@ RID Sample::get_rid() const { void Sample::_bind_methods(){ - ObjectTypeDB::bind_method(_MD("create","format","stereo","length"),&Sample::create); - ObjectTypeDB::bind_method(_MD("get_format"),&Sample::get_format); - ObjectTypeDB::bind_method(_MD("is_stereo"),&Sample::is_stereo); - ObjectTypeDB::bind_method(_MD("get_length"),&Sample::get_length); - ObjectTypeDB::bind_method(_MD("set_data","data"),&Sample::set_data); - ObjectTypeDB::bind_method(_MD("get_data"),&Sample::get_data); - ObjectTypeDB::bind_method(_MD("set_mix_rate","hz"),&Sample::set_mix_rate); - ObjectTypeDB::bind_method(_MD("get_mix_rate"),&Sample::get_mix_rate); - ObjectTypeDB::bind_method(_MD("set_loop_format","format"),&Sample::set_loop_format); - ObjectTypeDB::bind_method(_MD("get_loop_format"),&Sample::get_loop_format); - ObjectTypeDB::bind_method(_MD("set_loop_begin","pos"),&Sample::set_loop_begin); - ObjectTypeDB::bind_method(_MD("get_loop_begin"),&Sample::get_loop_begin); - ObjectTypeDB::bind_method(_MD("set_loop_end","pos"),&Sample::set_loop_end); - ObjectTypeDB::bind_method(_MD("get_loop_end"),&Sample::get_loop_end); - - ObjectTypeDB::bind_method(_MD("_set_data"),&Sample::_set_data); - ObjectTypeDB::bind_method(_MD("_get_data"),&Sample::_get_data); + ClassDB::bind_method(_MD("create","format","stereo","length"),&Sample::create); + ClassDB::bind_method(_MD("get_format"),&Sample::get_format); + ClassDB::bind_method(_MD("is_stereo"),&Sample::is_stereo); + ClassDB::bind_method(_MD("get_length"),&Sample::get_length); + ClassDB::bind_method(_MD("set_data","data"),&Sample::set_data); + ClassDB::bind_method(_MD("get_data"),&Sample::get_data); + ClassDB::bind_method(_MD("set_mix_rate","hz"),&Sample::set_mix_rate); + ClassDB::bind_method(_MD("get_mix_rate"),&Sample::get_mix_rate); + ClassDB::bind_method(_MD("set_loop_format","format"),&Sample::set_loop_format); + ClassDB::bind_method(_MD("get_loop_format"),&Sample::get_loop_format); + ClassDB::bind_method(_MD("set_loop_begin","pos"),&Sample::set_loop_begin); + ClassDB::bind_method(_MD("get_loop_begin"),&Sample::get_loop_begin); + ClassDB::bind_method(_MD("set_loop_end","pos"),&Sample::set_loop_end); + ClassDB::bind_method(_MD("get_loop_end"),&Sample::get_loop_end); + + ClassDB::bind_method(_MD("_set_data"),&Sample::_set_data); + ClassDB::bind_method(_MD("_get_data"),&Sample::_get_data); ADD_PROPERTY( PropertyInfo( Variant::DICTIONARY, "data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), _SCS("_set_data"), _SCS("_get_data") ); ADD_PROPERTY( PropertyInfo( Variant::BOOL, "stereo"), _SCS(""), _SCS("is_stereo") ); diff --git a/scene/resources/sample.h b/scene/resources/sample.h index 18672e41c0..be2cf67954 100644 --- a/scene/resources/sample.h +++ b/scene/resources/sample.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class Sample : public Resource { - OBJ_TYPE(Sample, Resource ); + GDCLASS(Sample, Resource ); RES_BASE_EXTENSION("smp"); public: @@ -82,8 +82,8 @@ public: bool is_stereo() const; int get_length() const; - void set_data(const DVector<uint8_t>& p_buffer); - DVector<uint8_t> get_data() const; + void set_data(const PoolVector<uint8_t>& p_buffer); + PoolVector<uint8_t> get_data() const; void set_mix_rate(int p_rate); int get_mix_rate() const; diff --git a/scene/resources/sample_library.cpp b/scene/resources/sample_library.cpp index 67481f267d..44895df8fa 100644 --- a/scene/resources/sample_library.cpp +++ b/scene/resources/sample_library.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -194,18 +194,18 @@ Array SampleLibrary::_get_sample_list() const { void SampleLibrary::_bind_methods() { - ObjectTypeDB::bind_method(_MD("add_sample","name","sample:Sample"),&SampleLibrary::add_sample ); - ObjectTypeDB::bind_method(_MD("get_sample:Sample","name"),&SampleLibrary::get_sample ); - ObjectTypeDB::bind_method(_MD("has_sample","name"),&SampleLibrary::has_sample ); - ObjectTypeDB::bind_method(_MD("remove_sample","name"),&SampleLibrary::remove_sample ); + ClassDB::bind_method(_MD("add_sample","name","sample:Sample"),&SampleLibrary::add_sample ); + ClassDB::bind_method(_MD("get_sample:Sample","name"),&SampleLibrary::get_sample ); + ClassDB::bind_method(_MD("has_sample","name"),&SampleLibrary::has_sample ); + ClassDB::bind_method(_MD("remove_sample","name"),&SampleLibrary::remove_sample ); - ObjectTypeDB::bind_method(_MD("get_sample_list"),&SampleLibrary::_get_sample_list ); + ClassDB::bind_method(_MD("get_sample_list"),&SampleLibrary::_get_sample_list ); - ObjectTypeDB::bind_method(_MD("sample_set_volume_db","name","db"),&SampleLibrary::sample_set_volume_db ); - ObjectTypeDB::bind_method(_MD("sample_get_volume_db","name"),&SampleLibrary::sample_get_volume_db ); + ClassDB::bind_method(_MD("sample_set_volume_db","name","db"),&SampleLibrary::sample_set_volume_db ); + ClassDB::bind_method(_MD("sample_get_volume_db","name"),&SampleLibrary::sample_get_volume_db ); - ObjectTypeDB::bind_method(_MD("sample_set_pitch_scale","name","pitch"),&SampleLibrary::sample_set_pitch_scale ); - ObjectTypeDB::bind_method(_MD("sample_get_pitch_scale","name"),&SampleLibrary::sample_get_pitch_scale ); + ClassDB::bind_method(_MD("sample_set_pitch_scale","name","pitch"),&SampleLibrary::sample_set_pitch_scale ); + ClassDB::bind_method(_MD("sample_get_pitch_scale","name"),&SampleLibrary::sample_get_pitch_scale ); } diff --git a/scene/resources/sample_library.h b/scene/resources/sample_library.h index e572aa215a..d09eea64c5 100644 --- a/scene/resources/sample_library.h +++ b/scene/resources/sample_library.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class SampleLibrary : public Resource { - OBJ_TYPE(SampleLibrary,Resource); + GDCLASS(SampleLibrary,Resource); struct SampleData { diff --git a/scene/resources/scene_format_text.cpp b/scene/resources/scene_format_text.cpp index 615c092dad..fa56f63465 100644 --- a/scene/resources/scene_format_text.cpp +++ b/scene/resources/scene_format_text.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -112,7 +112,7 @@ Error ResourceInteractiveLoaderText::_parse_ext_resource(VariantParser::Stream* if (path.find("://")==-1 && path.is_rel_path()) { // path is relative to file being loaded, so convert to a resource path - path=Globals::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path)); + path=GlobalConfig::get_singleton()->localize_path(res_path.get_base_dir().plus_file(path)); } @@ -172,7 +172,7 @@ Error ResourceInteractiveLoaderText::poll() { if (path.find("://")==-1 && path.is_rel_path()) { // path is relative to file being loaded, so convert to a resource path - path=Globals::get_singleton()->localize_path(local_path.get_base_dir().plus_file(path)); + path=GlobalConfig::get_singleton()->localize_path(local_path.get_base_dir().plus_file(path)); } if (remaps.has(path)) { @@ -240,7 +240,7 @@ Error ResourceInteractiveLoaderText::poll() { if ( !ResourceCache::has(path)) { //only if it doesn't exist - Object *obj = ObjectTypeDB::instance(type); + Object *obj = ClassDB::instance(type); if (!obj) { error_text+="Can't create sub resource of type: "+type; @@ -310,7 +310,7 @@ Error ResourceInteractiveLoaderText::poll() { return error; } - Object *obj = ObjectTypeDB::instance(res_type); + Object *obj = ClassDB::instance(res_type); if (!obj) { error_text+="Can't create sub resource of type: "+res_type; @@ -661,7 +661,7 @@ void ResourceInteractiveLoaderText::get_dependencies(FileAccess *f,List<String> if (path.find("://")==-1 && path.is_rel_path()) { // path is relative to file being loaded, so convert to a resource path - path=Globals::get_singleton()->localize_path(local_path.get_base_dir().plus_file(path)); + path=GlobalConfig::get_singleton()->localize_path(local_path.get_base_dir().plus_file(path)); } @@ -948,9 +948,9 @@ Ref<ResourceInteractiveLoader> ResourceFormatLoaderText::load_interactive(const } Ref<ResourceInteractiveLoaderText> ria = memnew( ResourceInteractiveLoaderText ); - ria->local_path=Globals::get_singleton()->localize_path(p_path); + ria->local_path=GlobalConfig::get_singleton()->localize_path(p_path); ria->res_path=ria->local_path; -// ria->set_local_path( Globals::get_singleton()->localize_path(p_path) ); +// ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) ); ria->open(f); return ria; @@ -999,9 +999,9 @@ String ResourceFormatLoaderText::get_resource_type(const String &p_path) const{ } Ref<ResourceInteractiveLoaderText> ria = memnew( ResourceInteractiveLoaderText ); - ria->local_path=Globals::get_singleton()->localize_path(p_path); + ria->local_path=GlobalConfig::get_singleton()->localize_path(p_path); ria->res_path=ria->local_path; -// ria->set_local_path( Globals::get_singleton()->localize_path(p_path) ); +// ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) ); String r = ria->recognize(f); return r; } @@ -1016,9 +1016,9 @@ void ResourceFormatLoaderText::get_dependencies(const String& p_path,List<String } Ref<ResourceInteractiveLoaderText> ria = memnew( ResourceInteractiveLoaderText ); - ria->local_path=Globals::get_singleton()->localize_path(p_path); + ria->local_path=GlobalConfig::get_singleton()->localize_path(p_path); ria->res_path=ria->local_path; -// ria->set_local_path( Globals::get_singleton()->localize_path(p_path) ); +// ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) ); ria->get_dependencies(f,p_dependencies,p_add_types); @@ -1033,9 +1033,9 @@ Error ResourceFormatLoaderText::rename_dependencies(const String &p_path,const M } Ref<ResourceInteractiveLoaderText> ria = memnew( ResourceInteractiveLoaderText ); - ria->local_path=Globals::get_singleton()->localize_path(p_path); + ria->local_path=GlobalConfig::get_singleton()->localize_path(p_path); ria->res_path=ria->local_path; -// ria->set_local_path( Globals::get_singleton()->localize_path(p_path) ); +// ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) ); return ria->rename_dependencies(f,p_path,p_map); } @@ -1115,7 +1115,7 @@ void ResourceFormatSaverTextInstance::_find_resources(const Variant& p_variant,b PropertyInfo pi=I->get(); - if (pi.usage&PROPERTY_USAGE_STORAGE || (bundle_resources && pi.usage&PROPERTY_USAGE_BUNDLE)) { + if (pi.usage&PROPERTY_USAGE_STORAGE) { Variant v=res->get(I->get().name); _find_resources(v); @@ -1173,7 +1173,7 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path,const RES& p_re ERR_FAIL_COND_V( err, ERR_CANT_OPEN ); FileAccessRef _fref(f); - local_path = Globals::get_singleton()->localize_path(p_path); + local_path = GlobalConfig::get_singleton()->localize_path(p_path); relative_paths=p_flags&ResourceSaver::FLAG_RELATIVE_PATHS; skip_editor=p_flags&ResourceSaver::FLAG_OMIT_EDITOR_PROPERTIES; @@ -1206,7 +1206,7 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path,const RES& p_re { String title=packed_scene.is_valid()?"[gd_scene ":"[gd_resource "; if (packed_scene.is_null()) - title+="type=\""+p_resource->get_type()+"\" "; + title+="type=\""+p_resource->get_class()+"\" "; int load_steps=saved_resources.size()+external_resources.size(); //if (packed_scene.is_valid()) { // load_steps+=packed_scene->get_node_count(); @@ -1235,7 +1235,7 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path,const RES& p_re for(int i=0;i<sorted_er.size();i++) { String p = sorted_er[i]->get_path(); - f->store_string("[ext_resource path=\""+p+"\" type=\""+sorted_er[i]->get_save_type()+"\" id="+itos(i+1)+"]\n"); //bundled + f->store_string("[ext_resource path=\""+p+"\" type=\""+sorted_er[i]->get_save_class()+"\" id="+itos(i+1)+"]\n"); //bundled } if (external_resources.size()) @@ -1282,7 +1282,7 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path,const RES& p_re } int idx = res->get_subindex(); - line+="type=\""+res->get_type()+"\" id="+itos(idx); + line+="type=\""+res->get_class()+"\" id="+itos(idx); f->store_line(line+"]\n"); if (takeover_paths) { res->set_path(p_path+"::"+itos(idx),true); @@ -1306,7 +1306,7 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path,const RES& p_re if (skip_editor && PE->get().name.begins_with("__editor")) continue; - if (PE->get().usage&PROPERTY_USAGE_STORAGE || (bundle_resources && PE->get().usage&PROPERTY_USAGE_BUNDLE)) { + if (PE->get().usage&PROPERTY_USAGE_STORAGE) { String name = PE->get().name; Variant value = res->get(name); @@ -1451,7 +1451,7 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path,const RES& p_re Error ResourceFormatSaverText::save(const String &p_path,const RES& p_resource,uint32_t p_flags) { - if (p_path.ends_with(".sct") && p_resource->get_type()!="PackedScene") { + if (p_path.ends_with(".sct") && p_resource->get_class()!="PackedScene") { return ERR_FILE_UNRECOGNIZED; } @@ -1467,7 +1467,7 @@ bool ResourceFormatSaverText::recognize(const RES& p_resource) const { } void ResourceFormatSaverText::get_recognized_extensions(const RES& p_resource,List<String> *p_extensions) const { - if (p_resource->get_type()=="PackedScene") + if (p_resource->get_class()=="PackedScene") p_extensions->push_back("tscn"); //text scene else p_extensions->push_back("tres"); //text resource diff --git a/scene/resources/scene_format_text.h b/scene/resources/scene_format_text.h index 6122a1f9d8..58660fa639 100644 --- a/scene/resources/scene_format_text.h +++ b/scene/resources/scene_format_text.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/scene_preloader.cpp b/scene/resources/scene_preloader.cpp deleted file mode 100644 index c031f3c721..0000000000 --- a/scene/resources/scene_preloader.cpp +++ /dev/null @@ -1,454 +0,0 @@ -/*************************************************************************/ -/* scene_preloader.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "scene_preloader.h" -#include "globals.h" - -bool ScenePreloader::can_instance() const { - - return nodes.size()>0; -} - -Node *ScenePreloader::instance() const { - - int nc = nodes.size(); - ERR_FAIL_COND_V(nc==0,NULL); - - const StringName*snames=NULL; - int sname_count=names.size(); - if (sname_count) - snames=&names[0]; - - const Variant*props=NULL; - int prop_count=variants.size(); - if (prop_count) - props=&variants[0]; - - Vector<Variant> properties; - - const NodeData *nd = &nodes[0]; - - Node **ret_nodes=(Node**)alloca( sizeof(Node*)*nc ); - - for(int i=0;i<nc;i++) { - - const NodeData &n=nd[i]; - - - if (!ObjectTypeDB::is_type_enabled(snames[n.type])) { - ret_nodes[i]=NULL; - continue; - } - - Object * obj = ObjectTypeDB::instance(snames[ n.type ]); - ERR_FAIL_COND_V(!obj,NULL); - Node *node = obj->cast_to<Node>(); - ERR_FAIL_COND_V(!node,NULL); - - int nprop_count=n.properties.size(); - if (nprop_count) { - - const NodeData::Property* nprops=&n.properties[0]; - - for(int j=0;j<nprop_count;j++) { - - bool valid; - node->set(snames[ nprops[j].name ],props[ nprops[j].value ],&valid); - } - - - } - - node->set_name( snames[ n.name ] ); - ret_nodes[i]=node; - if (i>0) { - ERR_FAIL_INDEX_V(n.parent,i,NULL); - ERR_FAIL_COND_V(!ret_nodes[n.parent],NULL); - ret_nodes[n.parent]->add_child(node); - } - } - - - //do connections - - int cc = connections.size(); - const ConnectionData *cdata = connections.ptr(); - - for(int i=0;i<cc;i++) { - - const ConnectionData &c=cdata[i]; - ERR_FAIL_INDEX_V( c.from, nc, NULL ); - ERR_FAIL_INDEX_V( c.to, nc, NULL ); - - Vector<Variant> binds; - if (c.binds.size()) { - binds.resize(c.binds.size()); - for(int j=0;j<c.binds.size();j++) - binds[j]=props[ c.binds[j] ]; - } - - if (!ret_nodes[c.from] || !ret_nodes[c.to]) - continue; - ret_nodes[c.from]->connect( snames[ c.signal], ret_nodes[ c.to ], snames[ c.method], binds,CONNECT_PERSIST ); - } - - return ret_nodes[0]; - -} - - -static int _nm_get_string(const String& p_string, Map<StringName,int> &name_map) { - - if (name_map.has(p_string)) - return name_map[p_string]; - - int idx = name_map.size(); - name_map[p_string]=idx; - return idx; -} - -static int _vm_get_variant(const Variant& p_variant, HashMap<Variant,int,VariantHasher> &variant_map) { - - if (variant_map.has(p_variant)) - return variant_map[p_variant]; - - int idx = variant_map.size(); - variant_map[p_variant]=idx; - return idx; -} - -void ScenePreloader::_parse_node(Node *p_owner,Node *p_node,int p_parent_idx, Map<StringName,int> &name_map,HashMap<Variant,int,VariantHasher> &variant_map,Map<Node*,int> &node_map) { - - if (p_node!=p_owner && !p_node->get_owner()) - return; - - NodeData nd; - nd.name=_nm_get_string(p_node->get_name(),name_map); - nd.type=_nm_get_string(p_node->get_type(),name_map); - nd.parent=p_parent_idx; - - List<PropertyInfo> plist; - p_node->get_property_list(&plist); - for (List<PropertyInfo>::Element *E=plist.front();E;E=E->next()) { - - if (!(E->get().usage & PROPERTY_USAGE_STORAGE)) - continue; - - NodeData::Property prop; - prop.name=_nm_get_string(E->get().name,name_map); - prop.value=_vm_get_variant( p_node->get( E->get().name ), variant_map); - nd.properties.push_back(prop); - } - - int idx = nodes.size(); - node_map[p_node]=idx; - nodes.push_back(nd); - - for(int i=0;i<p_node->get_child_count();i++) { - - Node *c=p_node->get_child(i); - _parse_node(p_owner,c,idx,name_map,variant_map,node_map); - } - - - -} - -void ScenePreloader::_parse_connections(Node *p_node, Map<StringName,int> &name_map,HashMap<Variant,int,VariantHasher> &variant_map,Map<Node*,int> &node_map,bool p_instance) { - - - List<MethodInfo> signals; - p_node->get_signal_list(&signals); - - for(List<MethodInfo>::Element *E=signals.front();E;E=E->next()) { - - List<Node::Connection> conns; - p_node->get_signal_connection_list(E->get().name,&conns); - for(List<Node::Connection>::Element *F=conns.front();F;F=F->next()) { - - const Node::Connection &c = F->get(); - if (!(c.flags&CONNECT_PERSIST)) - continue; - Node *n=c.target->cast_to<Node>(); - if (!n) - continue; - - if (!node_map.has(n)) - continue; - - ConnectionData cd; - cd.from=node_map[p_node]; - cd.to=node_map[n]; - cd.method=_nm_get_string(c.method,name_map); - cd.signal=_nm_get_string(c.signal,name_map); - for(int i=0;i<c.binds.size();i++) { - - cd.binds.push_back( _vm_get_variant(c.binds[i],variant_map)); - } - connections.push_back(cd); - } - } - -} - - -Error ScenePreloader::load_scene(const String& p_path) { - - return ERR_CANT_OPEN; -#if 0 - if (path==p_path) - return OK; - - String p=Globals::get_singleton()->localize_path(p_path); - clear(); - - Node *scene = SceneLoader::load(p); - - ERR_FAIL_COND_V(!scene,ERR_CANT_OPEN); - - path=p; - - Map<StringName,int> name_map; - HashMap<Variant,int,VariantHasher> variant_map; - Map<Node*,int> node_map; - - _parse_node(scene,scene,-1,name_map,variant_map,node_map); - - - names.resize(name_map.size()); - - for(Map<StringName,int>::Element *E=name_map.front();E;E=E->next()) { - - names[E->get()]=E->key(); - } - - variants.resize(variant_map.size()); - const Variant *K=NULL; - while((K=variant_map.next(K))) { - - int idx = variant_map[*K]; - variants[idx]=*K; - } - - - memdelete(scene); // <- me falto esto :( - return OK; -#endif -} - -String ScenePreloader::get_scene_path() const { - - return path; -} - -void ScenePreloader::clear() { - - names.clear(); - variants.clear(); - nodes.clear(); - connections.clear(); - -} - -void ScenePreloader::_set_bundled_scene(const Dictionary& d) { - - - ERR_FAIL_COND( !d.has("names")); - ERR_FAIL_COND( !d.has("variants")); - ERR_FAIL_COND( !d.has("node_count")); - ERR_FAIL_COND( !d.has("nodes")); - ERR_FAIL_COND( !d.has("conn_count")); - ERR_FAIL_COND( !d.has("conns")); - ERR_FAIL_COND( !d.has("path")); - - DVector<String> snames = d["names"]; - if (snames.size()) { - - int namecount = snames.size(); - names.resize(namecount); - DVector<String>::Read r =snames.read(); - for(int i=0;i<names.size();i++) - names[i]=r[i]; - } - - Array svariants = d["variants"]; - - if (svariants.size()) { - int varcount=svariants.size(); - variants.resize(varcount); - for(int i=0;i<varcount;i++) { - - variants[i]=svariants[i]; - } - - } else { - variants.clear(); - } - - nodes.resize(d["node_count"]); - int nc=nodes.size(); - if (nc) { - DVector<int> snodes = d["nodes"]; - DVector<int>::Read r = snodes.read(); - int idx=0; - for(int i=0;i<nc;i++) { - NodeData &nd = nodes[i]; - nd.parent=r[idx++]; - nd.type=r[idx++]; - nd.name=r[idx++]; - nd.properties.resize(r[idx++]); - for(int j=0;j<nd.properties.size();j++) { - - nd.properties[j].name=r[idx++]; - nd.properties[j].value=r[idx++]; - } - } - - } - - connections.resize(d["conn_count"]); - int cc=connections.size(); - - if (cc) { - - DVector<int> sconns = d["conns"]; - DVector<int>::Read r = sconns.read(); - int idx=0; - for(int i=0;i<nc;i++) { - ConnectionData &cd = connections[nc]; - cd.from=r[idx++]; - cd.to=r[idx++]; - cd.signal=r[idx++]; - cd.method=r[idx++]; - cd.binds.resize(r[idx++]); - for(int j=0;j<cd.binds.size();j++) { - - cd.binds[j]=r[idx++]; - } - } - - } - - - - path=d["path"]; - -} - -Dictionary ScenePreloader::_get_bundled_scene() const { - - DVector<String> rnames; - rnames.resize(names.size()); - - if (names.size()) { - - DVector<String>::Write r=rnames.write(); - - for(int i=0;i<names.size();i++) - r[i]=names[i]; - } - - Dictionary d; - d["names"]=rnames; - d["variants"]=variants; - - Vector<int> rnodes; - d["node_count"]=nodes.size(); - - for(int i=0;i<nodes.size();i++) { - - const NodeData &nd=nodes[i]; - rnodes.push_back(nd.parent); - rnodes.push_back(nd.type); - rnodes.push_back(nd.name); - rnodes.push_back(nd.properties.size()); - for(int j=0;j<nd.properties.size();j++) { - - rnodes.push_back(nd.properties[j].name); - rnodes.push_back(nd.properties[j].value); - } - } - - d["nodes"]=rnodes; - - Vector<int> rconns; - d["conn_count"]=connections.size(); - - for(int i=0;i<connections.size();i++) { - - const ConnectionData &cd=connections[i]; - rconns.push_back(cd.from); - rconns.push_back(cd.to); - rconns.push_back(cd.signal); - rconns.push_back(cd.method); - rconns.push_back(cd.binds.size()); - for(int j=0;j<cd.binds.size();j++) - rconns.push_back(cd.binds[j]); - - } - - d["conns"]=rconns; - - d["path"]=path; - - return d; - - -} - -void ScenePreloader::_bind_methods() { - - ObjectTypeDB::bind_method(_MD("load_scene","path"),&ScenePreloader::load_scene); - ObjectTypeDB::bind_method(_MD("get_scene_path"),&ScenePreloader::get_scene_path); - ObjectTypeDB::bind_method(_MD("instance:Node"),&ScenePreloader::instance); - ObjectTypeDB::bind_method(_MD("can_instance"),&ScenePreloader::can_instance); - ObjectTypeDB::bind_method(_MD("_set_bundled_scene"),&ScenePreloader::_set_bundled_scene); - ObjectTypeDB::bind_method(_MD("_get_bundled_scene"),&ScenePreloader::_get_bundled_scene); - - ADD_PROPERTY( PropertyInfo(Variant::DICTIONARY,"_bundled",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_BUNDLE),_SCS("_set_bundled_scene"),_SCS("_get_bundled_scene")); -#if 0 - List<String> extensions; - SceneLoader::get_recognized_extensions(&extensions); - String exthint; - for (List<String>::Element*E=extensions.front();E;E=E->next()) { - - if (exthint!="") - exthint+=","; - exthint+="*."+E->get(); - } - - exthint+="; Scenes"; - - ADD_PROPERTY( PropertyInfo(Variant::STRING,"scene",PROPERTY_HINT_FILE,exthint),_SCS("load_scene"),_SCS("get_scene_path")); -#endif -} - -ScenePreloader::ScenePreloader() { - - -} diff --git a/scene/resources/scene_preloader.h b/scene/resources/scene_preloader.h deleted file mode 100644 index 2317c9e0bd..0000000000 --- a/scene/resources/scene_preloader.h +++ /dev/null @@ -1,101 +0,0 @@ -/*************************************************************************/ -/* scene_preloader.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef SCENE_PRELOADER_H -#define SCENE_PRELOADER_H - -#include "resource.h" -#include "scene/main/node.h" - -class ScenePreloader : public Resource { - - OBJ_TYPE( ScenePreloader, Resource ); - - Vector<StringName> names; - Vector<Variant> variants; - - //missing - instances - //missing groups - //missing - owner - //missing - override names and values - - struct NodeData { - - int parent; - int type; - int name; - - struct Property { - - int name; - int value; - }; - - Vector<Property> properties; - }; - - - Vector<NodeData> nodes; - - struct ConnectionData { - - int from; - int to; - int signal; - int method; - Vector<int> binds; - }; - - Vector<ConnectionData> connections; - - void _parse_node(Node *p_owner,Node *p_node,int p_parent_idx, Map<StringName,int> &name_map,HashMap<Variant,int,VariantHasher> &variant_map,Map<Node*,int> &node_map); - void _parse_connections(Node *p_node, Map<StringName,int> &name_map,HashMap<Variant,int,VariantHasher> &variant_map,Map<Node*,int> &node_map,bool p_instance); - - String path; - - void _set_bundled_scene(const Dictionary& p_scene); - Dictionary _get_bundled_scene() const; - -protected: - - - static void _bind_methods(); -public: - - - Error load_scene(const String& p_path); - String get_scene_path() const; - void clear(); - - bool can_instance() const; - Node *instance() const; - - ScenePreloader(); -}; - -#endif // SCENE_PRELOADER_H diff --git a/scene/resources/segment_shape_2d.cpp b/scene/resources/segment_shape_2d.cpp index b8b14fd6fc..71d5a8efa8 100644 --- a/scene/resources/segment_shape_2d.cpp +++ b/scene/resources/segment_shape_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -82,11 +82,11 @@ Rect2 SegmentShape2D::get_rect() const{ void SegmentShape2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_a","a"),&SegmentShape2D::set_a); - ObjectTypeDB::bind_method(_MD("get_a"),&SegmentShape2D::get_a); + ClassDB::bind_method(_MD("set_a","a"),&SegmentShape2D::set_a); + ClassDB::bind_method(_MD("get_a"),&SegmentShape2D::get_a); - ObjectTypeDB::bind_method(_MD("set_b","b"),&SegmentShape2D::set_b); - ObjectTypeDB::bind_method(_MD("get_b"),&SegmentShape2D::get_b); + ClassDB::bind_method(_MD("set_b","b"),&SegmentShape2D::set_b); + ClassDB::bind_method(_MD("get_b"),&SegmentShape2D::get_b); ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"a"),_SCS("set_a"),_SCS("get_a") ); @@ -145,8 +145,8 @@ Rect2 RayShape2D::get_rect() const { void RayShape2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_length","length"),&RayShape2D::set_length); - ObjectTypeDB::bind_method(_MD("get_length"),&RayShape2D::get_length); + ClassDB::bind_method(_MD("set_length","length"),&RayShape2D::set_length); + ClassDB::bind_method(_MD("get_length"),&RayShape2D::get_length); ADD_PROPERTY( PropertyInfo(Variant::REAL,"length"),_SCS("set_length"),_SCS("get_length") ); diff --git a/scene/resources/segment_shape_2d.h b/scene/resources/segment_shape_2d.h index 6f7b2f2d38..775bdabe9d 100644 --- a/scene/resources/segment_shape_2d.h +++ b/scene/resources/segment_shape_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,7 +32,7 @@ #include "scene/resources/shape_2d.h" class SegmentShape2D : public Shape2D { - OBJ_TYPE( SegmentShape2D, Shape2D ); + GDCLASS( SegmentShape2D, Shape2D ); Vector2 a; Vector2 b; @@ -57,7 +57,7 @@ public: class RayShape2D : public Shape2D { - OBJ_TYPE( RayShape2D, Shape2D ); + GDCLASS( RayShape2D, Shape2D ); real_t length; diff --git a/scene/resources/shader.cpp b/scene/resources/shader.cpp index ee9f23dd2a..6afbf32c35 100644 --- a/scene/resources/shader.cpp +++ b/scene/resources/shader.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,37 +39,17 @@ Shader::Mode Shader::get_mode() const { return mode; } -void Shader::set_code( const String& p_vertex, const String& p_fragment, const String& p_light,int p_fragment_ofs,int p_light_ofs) { +void Shader::set_code(const String& p_code) { - VisualServer::get_singleton()->shader_set_code(shader,p_vertex,p_fragment,p_light,0,p_fragment_ofs,p_light_ofs); + VisualServer::get_singleton()->shader_set_code(shader,p_code); params_cache_dirty=true; emit_signal(SceneStringNames::get_singleton()->changed); } -String Shader::get_vertex_code() const { +String Shader::get_code() const { - return VisualServer::get_singleton()->shader_get_vertex_code(shader); -} - -String Shader::get_fragment_code() const { - - return VisualServer::get_singleton()->shader_get_fragment_code(shader); - -} - -String Shader::get_light_code() const { - - return VisualServer::get_singleton()->shader_get_light_code(shader); - -} - -bool Shader::has_param(const StringName& p_param) const { - - if (params_cache_dirty) - get_param_list(NULL); - - return (params_cache.has(p_param)); + return VisualServer::get_singleton()->shader_get_code(shader); } @@ -101,48 +81,6 @@ RID Shader::get_rid() const { return shader; } -Dictionary Shader::_get_code() { - - String fs = VisualServer::get_singleton()->shader_get_fragment_code(shader); - String vs = VisualServer::get_singleton()->shader_get_vertex_code(shader); - String ls = VisualServer::get_singleton()->shader_get_light_code(shader); - - Dictionary c; - c["fragment"]=fs; - c["fragment_ofs"]=0; - c["vertex"]=vs; - c["vertex_ofs"]=0; - c["light"]=ls; - c["light_ofs"]=0; - Array arr; - for(const Map<StringName,Ref<Texture> >::Element *E=default_textures.front();E;E=E->next()) { - arr.push_back(E->key()); - arr.push_back(E->get()); - } - if (arr.size()) - c["default_tex"]=arr; - return c; -} - -void Shader::_set_code(const Dictionary& p_string) { - - ERR_FAIL_COND(!p_string.has("fragment")); - ERR_FAIL_COND(!p_string.has("vertex")); - String light; - if (p_string.has("light")) - light=p_string["light"]; - - set_code(p_string["vertex"],p_string["fragment"],light); - if (p_string.has("default_tex")) { - Array arr=p_string["default_tex"]; - if ((arr.size()&1)==0) { - for(int i=0;i<arr.size();i+=2) { - - set_default_texture_param(arr[i],arr[i+1]); - } - } - } -} void Shader::set_default_texture_param(const StringName& p_param,const Ref<Texture>& p_texture) { @@ -171,33 +109,31 @@ void Shader::get_default_texture_param_list(List<StringName>* r_textures) const{ } } +bool Shader::has_param(const StringName& p_param) const { + return params_cache.has(p_param); +} void Shader::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_mode"),&Shader::get_mode); - - ObjectTypeDB::bind_method(_MD("set_code","vcode","fcode","lcode","fofs","lofs"),&Shader::set_code,DEFVAL(0),DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("get_vertex_code"),&Shader::get_vertex_code); - ObjectTypeDB::bind_method(_MD("get_fragment_code"),&Shader::get_fragment_code); - ObjectTypeDB::bind_method(_MD("get_light_code"),&Shader::get_light_code); + ClassDB::bind_method(_MD("get_mode"),&Shader::get_mode); - ObjectTypeDB::bind_method(_MD("set_default_texture_param","param","texture:Texture"),&Shader::set_default_texture_param); - ObjectTypeDB::bind_method(_MD("get_default_texture_param:Texture","param"),&Shader::get_default_texture_param); + ClassDB::bind_method(_MD("set_code","code"),&Shader::set_code); + ClassDB::bind_method(_MD("get_code"),&Shader::get_code); - ObjectTypeDB::bind_method(_MD("has_param","name"),&Shader::has_param); + ClassDB::bind_method(_MD("set_default_texture_param","param","texture:Texture"),&Shader::set_default_texture_param); + ClassDB::bind_method(_MD("get_default_texture_param:Texture","param"),&Shader::get_default_texture_param); - ObjectTypeDB::bind_method(_MD("_set_code","code"),&Shader::_set_code); - ObjectTypeDB::bind_method(_MD("_get_code"),&Shader::_get_code); + ClassDB::bind_method(_MD("has_param","name"),&Shader::has_param); - //ObjectTypeDB::bind_method(_MD("get_param_list"),&Shader::get_fragment_code); + //ClassDB::bind_method(_MD("get_param_list"),&Shader::get_fragment_code); - ADD_PROPERTY( PropertyInfo(Variant::STRING, "_code",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_code"), _SCS("_get_code") ); + ADD_PROPERTY( PropertyInfo(Variant::STRING, "code",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("set_code"), _SCS("get_code") ); - BIND_CONSTANT( MODE_MATERIAL ); + BIND_CONSTANT( MODE_SPATIAL); BIND_CONSTANT( MODE_CANVAS_ITEM ); - BIND_CONSTANT( MODE_POST_PROCESS ); + BIND_CONSTANT( MODE_PARTICLES ); } @@ -214,253 +150,3 @@ Shader::~Shader() { } - -/************ Loader from text ***************/ - - - -RES ResourceFormatLoaderShader::load(const String &p_path, const String& p_original_path, Error *r_error) { - - if (r_error) - *r_error=ERR_FILE_CANT_OPEN; - - String fragment_code; - String vertex_code; - String light_code; - - int mode=-1; - - Error err; - FileAccess *f = FileAccess::open(p_path,FileAccess::READ,&err); - - - ERR_EXPLAIN("Unable to open shader file: "+p_path); - ERR_FAIL_COND_V(err,RES()); - String base_path = p_path.get_base_dir(); - - if (r_error) - *r_error=ERR_FILE_CORRUPT; - - Ref<Shader> shader;//( memnew( Shader ) ); - - int line=0; - - while(!f->eof_reached()) { - - String l = f->get_line(); - line++; - - if (mode<=0) { - l = l.strip_edges(); - int comment = l.find(";"); - if (comment!=-1) - l=l.substr(0,comment); - } - - if (mode<1) - vertex_code+="\n"; - if (mode<2) - fragment_code+="\n"; - - if (mode < 1 && l=="") - continue; - - if (l.begins_with("[")) { - l=l.strip_edges(); - if (l=="[params]") { - if (mode>=0) { - memdelete(f); - ERR_EXPLAIN(p_path+":"+itos(line)+": Misplaced [params] section."); - ERR_FAIL_V(RES()); - } - mode=0; - } else if (l=="[vertex]") { - if (mode>=1) { - memdelete(f); - ERR_EXPLAIN(p_path+":"+itos(line)+": Misplaced [vertex] section."); - ERR_FAIL_V(RES()); - } - mode=1; - } else if (l=="[fragment]") { - if (mode>=2) { - memdelete(f); - ERR_EXPLAIN(p_path+":"+itos(line)+": Misplaced [fragment] section."); - ERR_FAIL_V(RES()); - } - mode=1; - } else { - memdelete(f); - ERR_EXPLAIN(p_path+":"+itos(line)+": Unknown section type: '"+l+"'."); - ERR_FAIL_V(RES()); - } - continue; - } - - if (mode==0) { - - int eqpos = l.find("="); - if (eqpos==-1) { - memdelete(f); - ERR_EXPLAIN(p_path+":"+itos(line)+": Expected '='."); - ERR_FAIL_V(RES()); - } - - - String right=l.substr(eqpos+1,l.length()).strip_edges(); - if (right=="") { - memdelete(f); - ERR_EXPLAIN(p_path+":"+itos(line)+": Expected value after '='."); - ERR_FAIL_V(RES()); - } - - Variant value; - - if (right=="true") { - value = true; - } else if (right=="false") { - value = false; - } else if (right.is_valid_float()) { - //is number - value = right.to_double(); - } else if (right.is_valid_html_color()) { - //is html color - value = Color::html(right); - } else { - //attempt to parse a constructor - int popenpos = right.find("("); - - if (popenpos==-1) { - memdelete(f); - ERR_EXPLAIN(p_path+":"+itos(line)+": Invalid constructor syntax: "+right); - ERR_FAIL_V(RES()); - } - - int pclosepos = right.find_last(")"); - - if (pclosepos==-1) { - ERR_EXPLAIN(p_path+":"+itos(line)+": Invalid constructor parameter syntax: "+right); - ERR_FAIL_V(RES()); - - } - - String type = right.substr(0,popenpos); - String param = right.substr(popenpos+1,pclosepos-popenpos-1).strip_edges(); - - - if (type=="tex") { - - if (param=="") { - - value=RID(); - } else { - - String path; - - if (param.is_abs_path()) - path=param; - else - path=base_path+"/"+param; - - Ref<Texture> texture = ResourceLoader::load(path); - if (!texture.is_valid()) { - memdelete(f); - ERR_EXPLAIN(p_path+":"+itos(line)+": Couldn't find icon at path: "+path); - ERR_FAIL_V(RES()); - } - - value=texture; - } - - } else if (type=="vec3") { - - if (param=="") { - value=Vector3(); - } else { - Vector<String> params = param.split(","); - if (params.size()!=3) { - memdelete(f); - ERR_EXPLAIN(p_path+":"+itos(line)+": Invalid param count for vec3(): '"+right+"'."); - ERR_FAIL_V(RES()); - - } - - Vector3 v; - for(int i=0;i<3;i++) - v[i]=params[i].to_double(); - value=v; - } - - - } else if (type=="xform") { - - if (param=="") { - value=Transform(); - } else { - - Vector<String> params = param.split(","); - if (params.size()!=12) { - memdelete(f); - ERR_EXPLAIN(p_path+":"+itos(line)+": Invalid param count for xform(): '"+right+"'."); - ERR_FAIL_V(RES()); - - } - - Transform t; - for(int i=0;i<9;i++) - t.basis[i%3][i/3]=params[i].to_double(); - for(int i=0;i<3;i++) - t.origin[i]=params[i-9].to_double(); - - value=t; - } - - } else { - memdelete(f); - ERR_EXPLAIN(p_path+":"+itos(line)+": Invalid constructor type: '"+type+"'."); - ERR_FAIL_V(RES()); - - } - - } - - String left= l.substr(0,eqpos); - -// shader->set_param(left,value); - } else if (mode==1) { - - vertex_code+=l; - - } else if (mode==2) { - - fragment_code+=l; - } - } - - shader->set_code(vertex_code,fragment_code,light_code); - - f->close(); - memdelete(f); - if (r_error) - *r_error=OK; - - return shader; -} - -void ResourceFormatLoaderShader::get_recognized_extensions(List<String> *p_extensions) const { - - ObjectTypeDB::get_extensions_for_type("Shader", p_extensions); -} - -bool ResourceFormatLoaderShader::handles_type(const String& p_type) const { - - return ObjectTypeDB::is_type(p_type, "Shader"); -} - - -String ResourceFormatLoaderShader::get_resource_type(const String &p_path) const { - - if (p_path.extension().to_lower()=="shd") - return "Shader"; - return ""; -} - diff --git a/scene/resources/shader.h b/scene/resources/shader.h index 6ee8d4e793..59d7601d98 100644 --- a/scene/resources/shader.h +++ b/scene/resources/shader.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,26 +32,24 @@ #include "resource.h" #include "io/resource_loader.h" #include "scene/resources/texture.h" + class Shader : public Resource { - OBJ_TYPE(Shader,Resource); + GDCLASS(Shader,Resource); OBJ_SAVE_TYPE( Shader ); RES_BASE_EXTENSION("shd"); public: enum Mode { - MODE_MATERIAL, + MODE_SPATIAL, MODE_CANVAS_ITEM, - MODE_POST_PROCESS, + MODE_PARTICLES, MODE_MAX }; private: RID shader; Mode mode; - Dictionary _get_code(); - void _set_code(const Dictionary& p_string); - // hack the name of performance // shaders keep a list of ShaderMaterial -> VisualServer name translations, to make @@ -73,10 +71,8 @@ public: //void set_mode(Mode p_mode); Mode get_mode() const; - void set_code( const String& p_vertex, const String& p_fragment, const String& p_light,int p_fragment_ofs=0,int p_light_ofs=0); - String get_vertex_code() const; - String get_fragment_code() const; - String get_light_code() const; + void set_code( const String& p_code); + String get_code() const; void get_param_list(List<PropertyInfo> *p_params) const; bool has_param(const StringName& p_param) const; @@ -104,18 +100,18 @@ public: VARIANT_ENUM_CAST( Shader::Mode ); -class MaterialShader : public Shader { +class SpatialShader : public Shader { - OBJ_TYPE(MaterialShader,Shader); + GDCLASS(SpatialShader,Shader); public: - MaterialShader() : Shader(MODE_MATERIAL) {}; + SpatialShader() : Shader(MODE_SPATIAL) {}; }; class CanvasItemShader : public Shader { - OBJ_TYPE(CanvasItemShader,Shader); + GDCLASS(CanvasItemShader,Shader); public: @@ -123,15 +119,14 @@ public: }; +class ParticlesShader : public Shader { + + GDCLASS(ParticlesShader,Shader); -class ResourceFormatLoaderShader : public ResourceFormatLoader { public: - virtual RES load(const String &p_path,const String& p_original_path="",Error *r_error=NULL); - virtual void get_recognized_extensions(List<String> *p_extensions) const; - virtual bool handles_type(const String& p_type) const; - virtual String get_resource_type(const String &p_path) const; -}; + ParticlesShader() : Shader(MODE_PARTICLES) {}; +}; #endif // SHADER_H diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp index 02faa9425d..37b019e369 100644 --- a/scene/resources/shader_graph.cpp +++ b/scene/resources/shader_graph.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -29,6 +29,7 @@ #include "shader_graph.h" #include "scene/scene_string_names.h" +#if 0 Array ShaderGraph::_get_node_list(ShaderType p_type) const { List<int> nodes; @@ -164,106 +165,106 @@ int ShaderGraph::node_count(ShaderType p_which, int p_type) void ShaderGraph::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_update_shader"),&ShaderGraph::_update_shader); + ClassDB::bind_method(_MD("_update_shader"),&ShaderGraph::_update_shader); - ObjectTypeDB::bind_method(_MD("node_add","shader_type","node_type","id"),&ShaderGraph::node_add); - ObjectTypeDB::bind_method(_MD("node_remove","shader_type","id"),&ShaderGraph::node_remove); - ObjectTypeDB::bind_method(_MD("node_set_pos","shader_type","id","pos"),&ShaderGraph::node_set_pos); - ObjectTypeDB::bind_method(_MD("node_get_pos","shader_type","id"),&ShaderGraph::node_get_pos); + ClassDB::bind_method(_MD("node_add","shader_type","node_type","id"),&ShaderGraph::node_add); + ClassDB::bind_method(_MD("node_remove","shader_type","id"),&ShaderGraph::node_remove); + ClassDB::bind_method(_MD("node_set_pos","shader_type","id","pos"),&ShaderGraph::node_set_pos); + ClassDB::bind_method(_MD("node_get_pos","shader_type","id"),&ShaderGraph::node_get_pos); - ObjectTypeDB::bind_method(_MD("node_get_type","shader_type","id"),&ShaderGraph::node_get_type); + ClassDB::bind_method(_MD("node_get_type","shader_type","id"),&ShaderGraph::node_get_type); - ObjectTypeDB::bind_method(_MD("get_node_list","shader_type"),&ShaderGraph::_get_node_list); + ClassDB::bind_method(_MD("get_node_list","shader_type"),&ShaderGraph::_get_node_list); - ObjectTypeDB::bind_method(_MD("default_set_value","shader_type","id","param_id","value"), &ShaderGraph::default_set_value); - ObjectTypeDB::bind_method(_MD("default_get_value","shader_type","id","param_id"), &ShaderGraph::default_get_value); + ClassDB::bind_method(_MD("default_set_value","shader_type","id","param_id","value"), &ShaderGraph::default_set_value); + ClassDB::bind_method(_MD("default_get_value","shader_type","id","param_id"), &ShaderGraph::default_get_value); - ObjectTypeDB::bind_method(_MD("scalar_const_node_set_value","shader_type","id","value"),&ShaderGraph::scalar_const_node_set_value); - ObjectTypeDB::bind_method(_MD("scalar_const_node_get_value","shader_type","id"),&ShaderGraph::scalar_const_node_get_value); + ClassDB::bind_method(_MD("scalar_const_node_set_value","shader_type","id","value"),&ShaderGraph::scalar_const_node_set_value); + ClassDB::bind_method(_MD("scalar_const_node_get_value","shader_type","id"),&ShaderGraph::scalar_const_node_get_value); - ObjectTypeDB::bind_method(_MD("vec_const_node_set_value","shader_type","id","value"),&ShaderGraph::vec_const_node_set_value); - ObjectTypeDB::bind_method(_MD("vec_const_node_get_value","shader_type","id"),&ShaderGraph::vec_const_node_get_value); + ClassDB::bind_method(_MD("vec_const_node_set_value","shader_type","id","value"),&ShaderGraph::vec_const_node_set_value); + ClassDB::bind_method(_MD("vec_const_node_get_value","shader_type","id"),&ShaderGraph::vec_const_node_get_value); - ObjectTypeDB::bind_method(_MD("rgb_const_node_set_value","shader_type","id","value"),&ShaderGraph::rgb_const_node_set_value); - ObjectTypeDB::bind_method(_MD("rgb_const_node_get_value","shader_type","id"),&ShaderGraph::rgb_const_node_get_value); + ClassDB::bind_method(_MD("rgb_const_node_set_value","shader_type","id","value"),&ShaderGraph::rgb_const_node_set_value); + ClassDB::bind_method(_MD("rgb_const_node_get_value","shader_type","id"),&ShaderGraph::rgb_const_node_get_value); - ObjectTypeDB::bind_method(_MD("xform_const_node_set_value","shader_type","id","value"),&ShaderGraph::xform_const_node_set_value); - ObjectTypeDB::bind_method(_MD("xform_const_node_get_value","shader_type","id"),&ShaderGraph::xform_const_node_get_value); + ClassDB::bind_method(_MD("xform_const_node_set_value","shader_type","id","value"),&ShaderGraph::xform_const_node_set_value); + ClassDB::bind_method(_MD("xform_const_node_get_value","shader_type","id"),&ShaderGraph::xform_const_node_get_value); // void get_node_list(ShaderType p_which,List<int> *p_node_list) const; - ObjectTypeDB::bind_method(_MD("texture_node_set_filter_size","shader_type","id","filter_size"),&ShaderGraph::texture_node_set_filter_size); - ObjectTypeDB::bind_method(_MD("texture_node_get_filter_size","shader_type","id"),&ShaderGraph::texture_node_get_filter_size); + ClassDB::bind_method(_MD("texture_node_set_filter_size","shader_type","id","filter_size"),&ShaderGraph::texture_node_set_filter_size); + ClassDB::bind_method(_MD("texture_node_get_filter_size","shader_type","id"),&ShaderGraph::texture_node_get_filter_size); - ObjectTypeDB::bind_method(_MD("texture_node_set_filter_strength","shader_type","id","filter_strength"),&ShaderGraph::texture_node_set_filter_strength); - ObjectTypeDB::bind_method(_MD("texture_node_get_filter_strength","shader_type","id"),&ShaderGraph::texture_node_get_filter_strength); + ClassDB::bind_method(_MD("texture_node_set_filter_strength","shader_type","id","filter_strength"),&ShaderGraph::texture_node_set_filter_strength); + ClassDB::bind_method(_MD("texture_node_get_filter_strength","shader_type","id"),&ShaderGraph::texture_node_get_filter_strength); - ObjectTypeDB::bind_method(_MD("scalar_op_node_set_op","shader_type","id","op"),&ShaderGraph::scalar_op_node_set_op); - ObjectTypeDB::bind_method(_MD("scalar_op_node_get_op","shader_type","id"),&ShaderGraph::scalar_op_node_get_op); + ClassDB::bind_method(_MD("scalar_op_node_set_op","shader_type","id","op"),&ShaderGraph::scalar_op_node_set_op); + ClassDB::bind_method(_MD("scalar_op_node_get_op","shader_type","id"),&ShaderGraph::scalar_op_node_get_op); - ObjectTypeDB::bind_method(_MD("vec_op_node_set_op","shader_type","id","op"),&ShaderGraph::vec_op_node_set_op); - ObjectTypeDB::bind_method(_MD("vec_op_node_get_op","shader_type","id"),&ShaderGraph::vec_op_node_get_op); + ClassDB::bind_method(_MD("vec_op_node_set_op","shader_type","id","op"),&ShaderGraph::vec_op_node_set_op); + ClassDB::bind_method(_MD("vec_op_node_get_op","shader_type","id"),&ShaderGraph::vec_op_node_get_op); - ObjectTypeDB::bind_method(_MD("vec_scalar_op_node_set_op","shader_type","id","op"),&ShaderGraph::vec_scalar_op_node_set_op); - ObjectTypeDB::bind_method(_MD("vec_scalar_op_node_get_op","shader_type","id"),&ShaderGraph::vec_scalar_op_node_get_op); + ClassDB::bind_method(_MD("vec_scalar_op_node_set_op","shader_type","id","op"),&ShaderGraph::vec_scalar_op_node_set_op); + ClassDB::bind_method(_MD("vec_scalar_op_node_get_op","shader_type","id"),&ShaderGraph::vec_scalar_op_node_get_op); - ObjectTypeDB::bind_method(_MD("rgb_op_node_set_op","shader_type","id","op"),&ShaderGraph::rgb_op_node_set_op); - ObjectTypeDB::bind_method(_MD("rgb_op_node_get_op","shader_type","id"),&ShaderGraph::rgb_op_node_get_op); + ClassDB::bind_method(_MD("rgb_op_node_set_op","shader_type","id","op"),&ShaderGraph::rgb_op_node_set_op); + ClassDB::bind_method(_MD("rgb_op_node_get_op","shader_type","id"),&ShaderGraph::rgb_op_node_get_op); - ObjectTypeDB::bind_method(_MD("xform_vec_mult_node_set_no_translation","shader_type","id","disable"),&ShaderGraph::xform_vec_mult_node_set_no_translation); - ObjectTypeDB::bind_method(_MD("xform_vec_mult_node_get_no_translation","shader_type","id"),&ShaderGraph::xform_vec_mult_node_get_no_translation); + ClassDB::bind_method(_MD("xform_vec_mult_node_set_no_translation","shader_type","id","disable"),&ShaderGraph::xform_vec_mult_node_set_no_translation); + ClassDB::bind_method(_MD("xform_vec_mult_node_get_no_translation","shader_type","id"),&ShaderGraph::xform_vec_mult_node_get_no_translation); - ObjectTypeDB::bind_method(_MD("scalar_func_node_set_function","shader_type","id","func"),&ShaderGraph::scalar_func_node_set_function); - ObjectTypeDB::bind_method(_MD("scalar_func_node_get_function","shader_type","id"),&ShaderGraph::scalar_func_node_get_function); + ClassDB::bind_method(_MD("scalar_func_node_set_function","shader_type","id","func"),&ShaderGraph::scalar_func_node_set_function); + ClassDB::bind_method(_MD("scalar_func_node_get_function","shader_type","id"),&ShaderGraph::scalar_func_node_get_function); - ObjectTypeDB::bind_method(_MD("vec_func_node_set_function","shader_type","id","func"),&ShaderGraph::vec_func_node_set_function); - ObjectTypeDB::bind_method(_MD("vec_func_node_get_function","shader_type","id"),&ShaderGraph::vec_func_node_get_function); + ClassDB::bind_method(_MD("vec_func_node_set_function","shader_type","id","func"),&ShaderGraph::vec_func_node_set_function); + ClassDB::bind_method(_MD("vec_func_node_get_function","shader_type","id"),&ShaderGraph::vec_func_node_get_function); - ObjectTypeDB::bind_method(_MD("input_node_set_name","shader_type","id","name"),&ShaderGraph::input_node_set_name); - ObjectTypeDB::bind_method(_MD("input_node_get_name","shader_type","id"),&ShaderGraph::input_node_get_name); + ClassDB::bind_method(_MD("input_node_set_name","shader_type","id","name"),&ShaderGraph::input_node_set_name); + ClassDB::bind_method(_MD("input_node_get_name","shader_type","id"),&ShaderGraph::input_node_get_name); - ObjectTypeDB::bind_method(_MD("scalar_input_node_set_value","shader_type","id","value"),&ShaderGraph::scalar_input_node_set_value); - ObjectTypeDB::bind_method(_MD("scalar_input_node_get_value","shader_type","id"),&ShaderGraph::scalar_input_node_get_value); + ClassDB::bind_method(_MD("scalar_input_node_set_value","shader_type","id","value"),&ShaderGraph::scalar_input_node_set_value); + ClassDB::bind_method(_MD("scalar_input_node_get_value","shader_type","id"),&ShaderGraph::scalar_input_node_get_value); - ObjectTypeDB::bind_method(_MD("vec_input_node_set_value","shader_type","id","value"),&ShaderGraph::vec_input_node_set_value); - ObjectTypeDB::bind_method(_MD("vec_input_node_get_value","shader_type","id"),&ShaderGraph::vec_input_node_get_value); + ClassDB::bind_method(_MD("vec_input_node_set_value","shader_type","id","value"),&ShaderGraph::vec_input_node_set_value); + ClassDB::bind_method(_MD("vec_input_node_get_value","shader_type","id"),&ShaderGraph::vec_input_node_get_value); - ObjectTypeDB::bind_method(_MD("rgb_input_node_set_value","shader_type","id","value"),&ShaderGraph::rgb_input_node_set_value); - ObjectTypeDB::bind_method(_MD("rgb_input_node_get_value","shader_type","id"),&ShaderGraph::rgb_input_node_get_value); + ClassDB::bind_method(_MD("rgb_input_node_set_value","shader_type","id","value"),&ShaderGraph::rgb_input_node_set_value); + ClassDB::bind_method(_MD("rgb_input_node_get_value","shader_type","id"),&ShaderGraph::rgb_input_node_get_value); - ObjectTypeDB::bind_method(_MD("xform_input_node_set_value","shader_type","id","value"),&ShaderGraph::xform_input_node_set_value); - ObjectTypeDB::bind_method(_MD("xform_input_node_get_value","shader_type","id"),&ShaderGraph::xform_input_node_get_value); + ClassDB::bind_method(_MD("xform_input_node_set_value","shader_type","id","value"),&ShaderGraph::xform_input_node_set_value); + ClassDB::bind_method(_MD("xform_input_node_get_value","shader_type","id"),&ShaderGraph::xform_input_node_get_value); - ObjectTypeDB::bind_method(_MD("texture_input_node_set_value","shader_type","id","value:Texture"),&ShaderGraph::texture_input_node_set_value); - ObjectTypeDB::bind_method(_MD("texture_input_node_get_value:Texture","shader_type","id"),&ShaderGraph::texture_input_node_get_value); + ClassDB::bind_method(_MD("texture_input_node_set_value","shader_type","id","value:Texture"),&ShaderGraph::texture_input_node_set_value); + ClassDB::bind_method(_MD("texture_input_node_get_value:Texture","shader_type","id"),&ShaderGraph::texture_input_node_get_value); - ObjectTypeDB::bind_method(_MD("cubemap_input_node_set_value","shader_type","id","value:CubeMap"),&ShaderGraph::cubemap_input_node_set_value); - ObjectTypeDB::bind_method(_MD("cubemap_input_node_get_value:CubeMap","shader_type","id"),&ShaderGraph::cubemap_input_node_get_value); + ClassDB::bind_method(_MD("cubemap_input_node_set_value","shader_type","id","value:CubeMap"),&ShaderGraph::cubemap_input_node_set_value); + ClassDB::bind_method(_MD("cubemap_input_node_get_value:CubeMap","shader_type","id"),&ShaderGraph::cubemap_input_node_get_value); - ObjectTypeDB::bind_method(_MD("comment_node_set_text","shader_type","id","text"),&ShaderGraph::comment_node_set_text); - ObjectTypeDB::bind_method(_MD("comment_node_get_text","shader_type","id"),&ShaderGraph::comment_node_get_text); + ClassDB::bind_method(_MD("comment_node_set_text","shader_type","id","text"),&ShaderGraph::comment_node_set_text); + ClassDB::bind_method(_MD("comment_node_get_text","shader_type","id"),&ShaderGraph::comment_node_get_text); - ObjectTypeDB::bind_method(_MD("color_ramp_node_set_ramp","shader_type","id","colors","offsets"),&ShaderGraph::color_ramp_node_set_ramp); - ObjectTypeDB::bind_method(_MD("color_ramp_node_get_colors","shader_type","id"),&ShaderGraph::color_ramp_node_get_colors); - ObjectTypeDB::bind_method(_MD("color_ramp_node_get_offsets","shader_type","id"),&ShaderGraph::color_ramp_node_get_offsets); + ClassDB::bind_method(_MD("color_ramp_node_set_ramp","shader_type","id","colors","offsets"),&ShaderGraph::color_ramp_node_set_ramp); + ClassDB::bind_method(_MD("color_ramp_node_get_colors","shader_type","id"),&ShaderGraph::color_ramp_node_get_colors); + ClassDB::bind_method(_MD("color_ramp_node_get_offsets","shader_type","id"),&ShaderGraph::color_ramp_node_get_offsets); - ObjectTypeDB::bind_method(_MD("curve_map_node_set_points","shader_type","id","points"),&ShaderGraph::curve_map_node_set_points); - ObjectTypeDB::bind_method(_MD("curve_map_node_get_points","shader_type","id"),&ShaderGraph::curve_map_node_get_points); + ClassDB::bind_method(_MD("curve_map_node_set_points","shader_type","id","points"),&ShaderGraph::curve_map_node_set_points); + ClassDB::bind_method(_MD("curve_map_node_get_points","shader_type","id"),&ShaderGraph::curve_map_node_get_points); - ObjectTypeDB::bind_method(_MD("connect_node:Error","shader_type","src_id","src_slot","dst_id","dst_slot"),&ShaderGraph::connect_node); - ObjectTypeDB::bind_method(_MD("is_node_connected","shader_type","src_id","src_slot","dst_id","dst_slot"),&ShaderGraph::is_node_connected); - ObjectTypeDB::bind_method(_MD("disconnect_node","shader_type","src_id","src_slot","dst_id","dst_slot"),&ShaderGraph::disconnect_node); - ObjectTypeDB::bind_method(_MD("get_node_connections","shader_type"),&ShaderGraph::_get_connections); + ClassDB::bind_method(_MD("connect_node:Error","shader_type","src_id","src_slot","dst_id","dst_slot"),&ShaderGraph::connect_node); + ClassDB::bind_method(_MD("is_node_connected","shader_type","src_id","src_slot","dst_id","dst_slot"),&ShaderGraph::is_node_connected); + ClassDB::bind_method(_MD("disconnect_node","shader_type","src_id","src_slot","dst_id","dst_slot"),&ShaderGraph::disconnect_node); + ClassDB::bind_method(_MD("get_node_connections","shader_type"),&ShaderGraph::_get_connections); - ObjectTypeDB::bind_method(_MD("clear","shader_type"),&ShaderGraph::clear); + ClassDB::bind_method(_MD("clear","shader_type"),&ShaderGraph::clear); - ObjectTypeDB::bind_method(_MD("node_set_state","shader_type","id","state"),&ShaderGraph::node_set_state); - ObjectTypeDB::bind_method(_MD("node_get_state:Variant","shader_type","id"),&ShaderGraph::node_get_state); + ClassDB::bind_method(_MD("node_set_state","shader_type","id","state"),&ShaderGraph::node_set_state); + ClassDB::bind_method(_MD("node_get_state:Variant","shader_type","id"),&ShaderGraph::node_get_state); - ObjectTypeDB::bind_method(_MD("_set_data"),&ShaderGraph::_set_data); - ObjectTypeDB::bind_method(_MD("_get_data"),&ShaderGraph::_get_data); + ClassDB::bind_method(_MD("_set_data"),&ShaderGraph::_set_data); + ClassDB::bind_method(_MD("_get_data"),&ShaderGraph::_get_data); ADD_PROPERTY( PropertyInfo(Variant::DICTIONARY,"_data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_data"),_SCS("_get_data")); @@ -398,21 +399,21 @@ void ShaderGraph::_bind_methods() { #if 0 - ObjectTypeDB::bind_method(_MD("node_add"),&ShaderGraph::node_add ); - ObjectTypeDB::bind_method(_MD("node_remove"),&ShaderGraph::node_remove ); - ObjectTypeDB::bind_method(_MD("node_set_param"),&ShaderGraph::node_set_param ); - ObjectTypeDB::bind_method(_MD("node_set_pos"),&ShaderGraph::node_set_pos ); + ClassDB::bind_method(_MD("node_add"),&ShaderGraph::node_add ); + ClassDB::bind_method(_MD("node_remove"),&ShaderGraph::node_remove ); + ClassDB::bind_method(_MD("node_set_param"),&ShaderGraph::node_set_param ); + ClassDB::bind_method(_MD("node_set_pos"),&ShaderGraph::node_set_pos ); - ObjectTypeDB::bind_method(_MD("node_get_pos"),&ShaderGraph::node_get_pos ); - ObjectTypeDB::bind_method(_MD("node_get_param"),&ShaderGraph::node_get_param); - ObjectTypeDB::bind_method(_MD("node_get_type"),&ShaderGraph::node_get_type); + ClassDB::bind_method(_MD("node_get_pos"),&ShaderGraph::node_get_pos ); + ClassDB::bind_method(_MD("node_get_param"),&ShaderGraph::node_get_param); + ClassDB::bind_method(_MD("node_get_type"),&ShaderGraph::node_get_type); - ObjectTypeDB::bind_method(_MD("connect"),&ShaderGraph::connect ); - ObjectTypeDB::bind_method(_MD("disconnect"),&ShaderGraph::disconnect ); + ClassDB::bind_method(_MD("connect"),&ShaderGraph::connect ); + ClassDB::bind_method(_MD("disconnect"),&ShaderGraph::disconnect ); - ObjectTypeDB::bind_method(_MD("get_connections"),&ShaderGraph::_get_connections_helper ); + ClassDB::bind_method(_MD("get_connections"),&ShaderGraph::_get_connections_helper ); - ObjectTypeDB::bind_method(_MD("clear"),&ShaderGraph::clear ); + ClassDB::bind_method(_MD("clear"),&ShaderGraph::clear ); BIND_CONSTANT( NODE_IN ); ///< param 0: name BIND_CONSTANT( NODE_OUT ); ///< param 0: name @@ -553,8 +554,8 @@ void ShaderGraph::node_add(ShaderType p_type, NodeType p_node_type,int p_id) { case NODE_XFORM_TO_VEC: {} break; // 3 scalar input: {} break; 1 vec3 output case NODE_SCALAR_INTERP: {} break; // scalar interpolation (with optional curve) case NODE_VEC_INTERP: {} break; // vec3 interpolation (with optional curve) - case NODE_COLOR_RAMP: { node.param1=DVector<Color>(); node.param2=DVector<real_t>();} break; // vec3 interpolation (with optional curve) - case NODE_CURVE_MAP: { node.param1=DVector<Vector2>();} break; // vec3 interpolation (with optional curve) + case NODE_COLOR_RAMP: { node.param1=PoolVector<Color>(); node.param2=PoolVector<real_t>();} break; // vec3 interpolation (with optional curve) + case NODE_CURVE_MAP: { node.param1=PoolVector<Vector2>();} break; // vec3 interpolation (with optional curve) case NODE_SCALAR_INPUT: {node.param1=_find_unique_name("Scalar"); node.param2=0;} break; // scalar uniform (assignable in material) case NODE_VEC_INPUT: {node.param1=_find_unique_name("Vec3");node.param2=Vector3();} break; // vec3 uniform (assignable in material) case NODE_RGB_INPUT: {node.param1=_find_unique_name("Color");node.param2=Color();} break; // color uniform (assignable in material) @@ -1081,7 +1082,7 @@ ShaderGraph::VecFunc ShaderGraph::vec_func_node_get_function(ShaderType p_type, return VecFunc(func); } -void ShaderGraph::color_ramp_node_set_ramp(ShaderType p_type,int p_id,const DVector<Color>& p_colors, const DVector<real_t>& p_offsets){ +void ShaderGraph::color_ramp_node_set_ramp(ShaderType p_type,int p_id,const PoolVector<Color>& p_colors, const PoolVector<real_t>& p_offsets){ ERR_FAIL_INDEX(p_type,3); ERR_FAIL_COND(!shader[p_type].node_map.has(p_id)); @@ -1093,27 +1094,27 @@ void ShaderGraph::color_ramp_node_set_ramp(ShaderType p_type,int p_id,const DVec } -DVector<Color> ShaderGraph::color_ramp_node_get_colors(ShaderType p_type,int p_id) const{ +PoolVector<Color> ShaderGraph::color_ramp_node_get_colors(ShaderType p_type,int p_id) const{ - ERR_FAIL_INDEX_V(p_type,3,DVector<Color>()); - ERR_FAIL_COND_V(!shader[p_type].node_map.has(p_id),DVector<Color>()); + ERR_FAIL_INDEX_V(p_type,3,PoolVector<Color>()); + ERR_FAIL_COND_V(!shader[p_type].node_map.has(p_id),PoolVector<Color>()); const Node& n = shader[p_type].node_map[p_id]; return n.param1; } -DVector<real_t> ShaderGraph::color_ramp_node_get_offsets(ShaderType p_type,int p_id) const{ +PoolVector<real_t> ShaderGraph::color_ramp_node_get_offsets(ShaderType p_type,int p_id) const{ - ERR_FAIL_INDEX_V(p_type,3,DVector<real_t>()); - ERR_FAIL_COND_V(!shader[p_type].node_map.has(p_id),DVector<real_t>()); + ERR_FAIL_INDEX_V(p_type,3,PoolVector<real_t>()); + ERR_FAIL_COND_V(!shader[p_type].node_map.has(p_id),PoolVector<real_t>()); const Node& n = shader[p_type].node_map[p_id]; return n.param2; } -void ShaderGraph::curve_map_node_set_points(ShaderType p_type,int p_id,const DVector<Vector2>& p_points) { +void ShaderGraph::curve_map_node_set_points(ShaderType p_type,int p_id,const PoolVector<Vector2>& p_points) { ERR_FAIL_INDEX(p_type,3); ERR_FAIL_COND(!shader[p_type].node_map.has(p_id)); @@ -1123,10 +1124,10 @@ void ShaderGraph::curve_map_node_set_points(ShaderType p_type,int p_id,const DVe } -DVector<Vector2> ShaderGraph::curve_map_node_get_points(ShaderType p_type,int p_id) const{ +PoolVector<Vector2> ShaderGraph::curve_map_node_get_points(ShaderType p_type,int p_id) const{ - ERR_FAIL_INDEX_V(p_type,3,DVector<Vector2>()); - ERR_FAIL_COND_V(!shader[p_type].node_map.has(p_id),DVector<Vector2>()); + ERR_FAIL_INDEX_V(p_type,3,PoolVector<Vector2>()); + ERR_FAIL_COND_V(!shader[p_type].node_map.has(p_id),PoolVector<Vector2>()); const Node& n = shader[p_type].node_map[p_id]; return n.param1; @@ -2449,16 +2450,16 @@ void ShaderGraph::_add_node_code(ShaderType p_type,Node *p_node,const Vector<Str DEF_SCALAR(0); static const int color_ramp_len=512; - DVector<uint8_t> cramp; + PoolVector<uint8_t> cramp; cramp.resize(color_ramp_len*4); { - DVector<Color> colors=p_node->param1; - DVector<real_t> offsets=p_node->param2; + PoolVector<Color> colors=p_node->param1; + PoolVector<real_t> offsets=p_node->param2; int cc =colors.size(); - DVector<uint8_t>::Write crw = cramp.write(); - DVector<Color>::Read cr = colors.read(); - DVector<real_t>::Read ofr = offsets.read(); + PoolVector<uint8_t>::Write crw = cramp.write(); + PoolVector<Color>::Read cr = colors.read(); + PoolVector<real_t>::Read ofr = offsets.read(); int at=0; Color color_at(0,0,0,1); @@ -2489,7 +2490,7 @@ void ShaderGraph::_add_node_code(ShaderType p_type,Node *p_node,const Vector<Str } } - Image gradient(color_ramp_len,1,0,Image::FORMAT_RGBA,cramp); + Image gradient(color_ramp_len,1,0,Image::FORMAT_RGBA8,cramp); Ref<ImageTexture> it = memnew( ImageTexture ); it->create_from_image(gradient,Texture::FLAG_FILTER|Texture::FLAG_MIPMAPS); @@ -2507,14 +2508,14 @@ void ShaderGraph::_add_node_code(ShaderType p_type,Node *p_node,const Vector<Str static const int curve_map_len=256; bool mapped[256]; zeromem(mapped,sizeof(mapped)); - DVector<uint8_t> cmap; + PoolVector<uint8_t> cmap; cmap.resize(curve_map_len); { - DVector<Point2> points=p_node->param1; + PoolVector<Point2> points=p_node->param1; int pc =points.size(); - DVector<uint8_t>::Write cmw = cmap.write(); - DVector<Point2>::Read pr = points.read(); + PoolVector<uint8_t>::Write cmw = cmap.write(); + PoolVector<Point2>::Read pr = points.read(); Vector2 prev=Vector2(0,0); Vector2 prev2=Vector2(0,0); @@ -2559,7 +2560,7 @@ void ShaderGraph::_add_node_code(ShaderType p_type,Node *p_node,const Vector<Str - Image gradient(curve_map_len,1,0,Image::FORMAT_GRAYSCALE,cmap); + Image gradient(curve_map_len,1,0,Image::FORMAT_L8,cmap); Ref<ImageTexture> it = memnew( ImageTexture ); it->create_from_image(gradient,Texture::FLAG_FILTER|Texture::FLAG_MIPMAPS); @@ -2660,3 +2661,5 @@ void ShaderGraph::_add_node_code(ShaderType p_type,Node *p_node,const Vector<Str #undef DEF_MATRIX #undef DEF_VEC } + +#endif diff --git a/scene/resources/shader_graph.h b/scene/resources/shader_graph.h index 1e6fc3507c..f4e24dbe78 100644 --- a/scene/resources/shader_graph.h +++ b/scene/resources/shader_graph.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -30,13 +30,13 @@ #define SHADER_GRAPH_H - +#if 0 #include "map.h" #include "scene/resources/shader.h" class ShaderGraph : public Shader { - OBJ_TYPE( ShaderGraph, Shader ); + GDCLASS( ShaderGraph, Shader ); RES_BASE_EXTENSION("sgp"); public: @@ -326,12 +326,12 @@ public: void vec_func_node_set_function(ShaderType p_which,int p_id,VecFunc p_func); VecFunc vec_func_node_get_function(ShaderType p_which,int p_id) const; - void color_ramp_node_set_ramp(ShaderType p_which,int p_id,const DVector<Color>& p_colors, const DVector<real_t>& p_offsets); - DVector<Color> color_ramp_node_get_colors(ShaderType p_which,int p_id) const; - DVector<real_t> color_ramp_node_get_offsets(ShaderType p_which,int p_id) const; + void color_ramp_node_set_ramp(ShaderType p_which,int p_id,const PoolVector<Color>& p_colors, const PoolVector<real_t>& p_offsets); + PoolVector<Color> color_ramp_node_get_colors(ShaderType p_which,int p_id) const; + PoolVector<real_t> color_ramp_node_get_offsets(ShaderType p_which,int p_id) const; - void curve_map_node_set_points(ShaderType p_which, int p_id, const DVector<Vector2>& p_points); - DVector<Vector2> curve_map_node_get_points(ShaderType p_which,int p_id) const; + void curve_map_node_set_points(ShaderType p_which, int p_id, const PoolVector<Vector2>& p_points); + PoolVector<Vector2> curve_map_node_get_points(ShaderType p_which,int p_id) const; void input_node_set_name(ShaderType p_which,int p_id,const String& p_name); String input_node_get_name(ShaderType p_which,int p_id); @@ -418,7 +418,7 @@ VARIANT_ENUM_CAST( ShaderGraph::GraphError ); class MaterialShaderGraph : public ShaderGraph { - OBJ_TYPE( MaterialShaderGraph, ShaderGraph ); + GDCLASS( MaterialShaderGraph, ShaderGraph ); public: @@ -430,7 +430,7 @@ public: class CanvasItemShaderGraph : public ShaderGraph { - OBJ_TYPE( CanvasItemShaderGraph, ShaderGraph ); + GDCLASS( CanvasItemShaderGraph, ShaderGraph ); public: @@ -440,5 +440,5 @@ public: } }; - +#endif #endif // SHADER_GRAPH_H diff --git a/scene/resources/shape.cpp b/scene/resources/shape.cpp index a71e414f61..a90c3b47a9 100644 --- a/scene/resources/shape.cpp +++ b/scene/resources/shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ #include "scene/main/scene_main_loop.h" -void Shape::add_vertices_to_array(DVector<Vector3> &array, const Transform& p_xform) { +void Shape::add_vertices_to_array(PoolVector<Vector3> &array, const Transform& p_xform) { Vector<Vector3> toadd = _gen_debug_mesh_lines(); @@ -42,7 +42,7 @@ void Shape::add_vertices_to_array(DVector<Vector3> &array, const Transform& p_xf int base=array.size(); array.resize(base+toadd.size()); - DVector<Vector3>::Write w = array.write(); + PoolVector<Vector3>::Write w = array.write(); for(int i=0;i<toadd.size();i++) { w[i+base]=p_xform.xform(toadd[i]); } @@ -61,11 +61,11 @@ Ref<Mesh> Shape::get_debug_mesh() { if (!lines.empty()) { //make mesh - DVector<Vector3> array; + PoolVector<Vector3> array; array.resize(lines.size()); { - DVector<Vector3>::Write w=array.write(); + PoolVector<Vector3>::Write w=array.write(); for(int i=0;i<lines.size();i++) { w[i]=lines[i]; } @@ -77,7 +77,7 @@ Ref<Mesh> Shape::get_debug_mesh() { SceneTree *st=OS::get_singleton()->get_main_loop()->cast_to<SceneTree>(); - debug_mesh_cache->add_surface(Mesh::PRIMITIVE_LINES,arr); + debug_mesh_cache->add_surface_from_arrays(Mesh::PRIMITIVE_LINES,arr); if (st) { debug_mesh_cache->surface_set_material(0,st->get_debug_collision_material()); diff --git a/scene/resources/shape.h b/scene/resources/shape.h index bfd423a300..29a93b642c 100644 --- a/scene/resources/shape.h +++ b/scene/resources/shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class Mesh; class Shape : public Resource { - OBJ_TYPE( Shape, Resource ); + GDCLASS( Shape, Resource ); OBJ_SAVE_TYPE( Shape ); RES_BASE_EXTENSION("shp"); RID shape; @@ -53,7 +53,7 @@ public: Ref<Mesh> get_debug_mesh(); - void add_vertices_to_array(DVector<Vector3> &array, const Transform& p_xform); + void add_vertices_to_array(PoolVector<Vector3> &array, const Transform& p_xform); Shape(); ~Shape(); diff --git a/scene/resources/shape_2d.cpp b/scene/resources/shape_2d.cpp index 6a9773bf14..b5a886b4b9 100644 --- a/scene/resources/shape_2d.cpp +++ b/scene/resources/shape_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -47,14 +47,14 @@ real_t Shape2D::get_custom_solver_bias() const{ } -bool Shape2D::collide_with_motion(const Matrix32& p_local_xform, const Vector2& p_local_motion, const Ref<Shape2D>& p_shape, const Matrix32& p_shape_xform, const Vector2 &p_shape_motion) { +bool Shape2D::collide_with_motion(const Transform2D& p_local_xform, const Vector2& p_local_motion, const Ref<Shape2D>& p_shape, const Transform2D& p_shape_xform, const Vector2 &p_shape_motion) { ERR_FAIL_COND_V(p_shape.is_null(),false); int r; return Physics2DServer::get_singleton()->shape_collide(get_rid(),p_local_xform,p_local_motion,p_shape->get_rid(),p_shape_xform,p_shape_motion,NULL,0,r); } -bool Shape2D::collide(const Matrix32& p_local_xform, const Ref<Shape2D>& p_shape, const Matrix32& p_shape_xform){ +bool Shape2D::collide(const Transform2D& p_local_xform, const Ref<Shape2D>& p_shape, const Transform2D& p_shape_xform){ ERR_FAIL_COND_V(p_shape.is_null(),false); int r; return Physics2DServer::get_singleton()->shape_collide(get_rid(),p_local_xform,Vector2(),p_shape->get_rid(),p_shape_xform,Vector2(),NULL,0,r); @@ -62,7 +62,7 @@ bool Shape2D::collide(const Matrix32& p_local_xform, const Ref<Shape2D>& p_shap } -Variant Shape2D::collide_with_motion_and_get_contacts(const Matrix32& p_local_xform, const Vector2& p_local_motion, const Ref<Shape2D>& p_shape, const Matrix32& p_shape_xform, const Vector2 &p_shape_motion){ +Variant Shape2D::collide_with_motion_and_get_contacts(const Transform2D& p_local_xform, const Vector2& p_local_motion, const Ref<Shape2D>& p_shape, const Transform2D& p_shape_xform, const Vector2 &p_shape_motion){ ERR_FAIL_COND_V(p_shape.is_null(),Variant()); const int max_contacts = 16; @@ -81,7 +81,7 @@ Variant Shape2D::collide_with_motion_and_get_contacts(const Matrix32& p_local_xf return results; } -Variant Shape2D::collide_and_get_contacts(const Matrix32& p_local_xform, const Ref<Shape2D>& p_shape, const Matrix32& p_shape_xform){ +Variant Shape2D::collide_and_get_contacts(const Transform2D& p_local_xform, const Ref<Shape2D>& p_shape, const Transform2D& p_shape_xform){ ERR_FAIL_COND_V(p_shape.is_null(),Variant()); const int max_contacts = 16; @@ -104,12 +104,12 @@ Variant Shape2D::collide_and_get_contacts(const Matrix32& p_local_xform, const void Shape2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_custom_solver_bias","bias"),&Shape2D::set_custom_solver_bias); - ObjectTypeDB::bind_method(_MD("get_custom_solver_bias"),&Shape2D::get_custom_solver_bias); - ObjectTypeDB::bind_method(_MD("collide","local_xform","with_shape:Shape2D","shape_xform"),&Shape2D::collide); - ObjectTypeDB::bind_method(_MD("collide_with_motion","local_xform","local_motion","with_shape:Shape2D","shape_xform","shape_motion"),&Shape2D::collide_with_motion); - ObjectTypeDB::bind_method(_MD("collide_and_get_contacts:Variant","local_xform","with_shape:Shape2D","shape_xform"),&Shape2D::collide_and_get_contacts); - ObjectTypeDB::bind_method(_MD("collide_with_motion_and_get_contacts:Variant","local_xform","local_motion","with_shape:Shape2D","shape_xform","shape_motion"),&Shape2D::collide_with_motion_and_get_contacts); + ClassDB::bind_method(_MD("set_custom_solver_bias","bias"),&Shape2D::set_custom_solver_bias); + ClassDB::bind_method(_MD("get_custom_solver_bias"),&Shape2D::get_custom_solver_bias); + ClassDB::bind_method(_MD("collide","local_xform","with_shape:Shape2D","shape_xform"),&Shape2D::collide); + ClassDB::bind_method(_MD("collide_with_motion","local_xform","local_motion","with_shape:Shape2D","shape_xform","shape_motion"),&Shape2D::collide_with_motion); + ClassDB::bind_method(_MD("collide_and_get_contacts:Variant","local_xform","with_shape:Shape2D","shape_xform"),&Shape2D::collide_and_get_contacts); + ClassDB::bind_method(_MD("collide_with_motion_and_get_contacts:Variant","local_xform","local_motion","with_shape:Shape2D","shape_xform","shape_motion"),&Shape2D::collide_with_motion_and_get_contacts); ADD_PROPERTY( PropertyInfo(Variant::REAL,"custom_solver_bias",PROPERTY_HINT_RANGE,"0,1,0.001"),_SCS("set_custom_solver_bias"),_SCS("get_custom_solver_bias")); } diff --git a/scene/resources/shape_2d.h b/scene/resources/shape_2d.h index 4059af62c6..6a7ec03a9a 100644 --- a/scene/resources/shape_2d.h +++ b/scene/resources/shape_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,7 +32,7 @@ #include "resource.h" class Shape2D : public Resource { - OBJ_TYPE( Shape2D, Resource ); + GDCLASS( Shape2D, Resource ); OBJ_SAVE_TYPE( Shape2D ); RID shape; @@ -47,11 +47,11 @@ public: void set_custom_solver_bias(real_t p_bias); real_t get_custom_solver_bias() const; - bool collide_with_motion(const Matrix32& p_local_xform, const Vector2& p_local_motion, const Ref<Shape2D>& p_shape, const Matrix32& p_shape_xform, const Vector2 &p_p_shape_motion); - bool collide(const Matrix32& p_local_xform, const Ref<Shape2D>& p_shape, const Matrix32& p_shape_xform); + bool collide_with_motion(const Transform2D& p_local_xform, const Vector2& p_local_motion, const Ref<Shape2D>& p_shape, const Transform2D& p_shape_xform, const Vector2 &p_p_shape_motion); + bool collide(const Transform2D& p_local_xform, const Ref<Shape2D>& p_shape, const Transform2D& p_shape_xform); - Variant collide_with_motion_and_get_contacts(const Matrix32& p_local_xform, const Vector2& p_local_motion, const Ref<Shape2D>& p_shape, const Matrix32& p_shape_xform, const Vector2 &p_p_shape_motion); - Variant collide_and_get_contacts(const Matrix32& p_local_xform, const Ref<Shape2D>& p_shape, const Matrix32& p_shape_xform); + Variant collide_with_motion_and_get_contacts(const Transform2D& p_local_xform, const Vector2& p_local_motion, const Ref<Shape2D>& p_shape, const Transform2D& p_shape_xform, const Vector2 &p_p_shape_motion); + Variant collide_and_get_contacts(const Transform2D& p_local_xform, const Ref<Shape2D>& p_shape, const Transform2D& p_shape_xform); virtual void draw(const RID& p_to_rid,const Color& p_color) {} virtual Rect2 get_rect() const { return Rect2(); } diff --git a/scene/resources/shape_line_2d.cpp b/scene/resources/shape_line_2d.cpp index 4133d2218f..b2270d00c0 100644 --- a/scene/resources/shape_line_2d.cpp +++ b/scene/resources/shape_line_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -90,11 +90,11 @@ Rect2 LineShape2D::get_rect() const{ void LineShape2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_normal","normal"),&LineShape2D::set_normal); - ObjectTypeDB::bind_method(_MD("get_normal"),&LineShape2D::get_normal); + ClassDB::bind_method(_MD("set_normal","normal"),&LineShape2D::set_normal); + ClassDB::bind_method(_MD("get_normal"),&LineShape2D::get_normal); - ObjectTypeDB::bind_method(_MD("set_d","d"),&LineShape2D::set_d); - ObjectTypeDB::bind_method(_MD("get_d"),&LineShape2D::get_d); + ClassDB::bind_method(_MD("set_d","d"),&LineShape2D::set_d); + ClassDB::bind_method(_MD("get_d"),&LineShape2D::get_d); ADD_PROPERTY( PropertyInfo(Variant::VECTOR2,"normal"),_SCS("set_normal"),_SCS("get_normal") ); ADD_PROPERTY( PropertyInfo(Variant::REAL,"d"),_SCS("set_d"),_SCS("get_d") ); diff --git a/scene/resources/shape_line_2d.h b/scene/resources/shape_line_2d.h index f6f75e7a95..abad5f6a24 100644 --- a/scene/resources/shape_line_2d.h +++ b/scene/resources/shape_line_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,7 +32,7 @@ #include "scene/resources/shape_2d.h" class LineShape2D : public Shape2D { - OBJ_TYPE( LineShape2D, Shape2D ); + GDCLASS( LineShape2D, Shape2D ); Vector2 normal; real_t d; diff --git a/scene/resources/sky_box.cpp b/scene/resources/sky_box.cpp new file mode 100644 index 0000000000..2a4fbfa8d4 --- /dev/null +++ b/scene/resources/sky_box.cpp @@ -0,0 +1,159 @@ +#include "sky_box.h" +#include "io/image_loader.h" + + +void SkyBox::set_radiance_size(RadianceSize p_size) { + ERR_FAIL_INDEX(p_size,RADIANCE_SIZE_MAX); + + radiance_size=p_size; + _radiance_changed(); +} + +SkyBox::RadianceSize SkyBox::get_radiance_size() const { + + return radiance_size; +} + +void SkyBox::_bind_methods() { + + ClassDB::bind_method(_MD("set_radiance_size","size"),&SkyBox::set_radiance_size); + ClassDB::bind_method(_MD("get_radiance_size"),&SkyBox::get_radiance_size); + + ADD_PROPERTY(PropertyInfo(Variant::INT,"radiance_size",PROPERTY_HINT_ENUM,"256,512,1024,2048"),_SCS("set_radiance_size"),_SCS("get_radiance_size")); + + + BIND_CONSTANT( RADIANCE_SIZE_256 ); + BIND_CONSTANT( RADIANCE_SIZE_512 ); + BIND_CONSTANT( RADIANCE_SIZE_1024 ); + BIND_CONSTANT( RADIANCE_SIZE_2048 ); + BIND_CONSTANT( RADIANCE_SIZE_MAX ); +} + +SkyBox::SkyBox() +{ + radiance_size=RADIANCE_SIZE_512; +} + +///////////////////////////////////////// + + + +void ImageSkyBox::_radiance_changed() { + + if (cube_map_valid) { + static const int size[RADIANCE_SIZE_MAX]={ + 256,512,1024,2048 + }; + VS::get_singleton()->skybox_set_texture(sky_box,cube_map,size[get_radiance_size()]); + } +} + +void ImageSkyBox::set_image_path(ImagePath p_image,const String &p_path) { + + ERR_FAIL_INDEX(p_image,IMAGE_PATH_MAX); + image_path[p_image]=p_path; + + bool all_ok=true; + for(int i=0;i<IMAGE_PATH_MAX;i++) { + if (image_path[i]==String()) { + all_ok=false; + } + } + + cube_map_valid=false; + + if (all_ok) { + + Image images[IMAGE_PATH_MAX]; + int w=0,h=0; + Image::Format format; + + for(int i=0;i<IMAGE_PATH_MAX;i++) { + Error err = ImageLoader::load_image(image_path[i],&images[i]); + if (err) { + ERR_PRINTS("Error loading image for skybox: "+image_path[i]); + return; + } + + if (i==0) { + w=images[0].get_width(); + h=images[0].get_height(); + format=images[0].get_format(); + } else { + if (images[i].get_width()!=w || images[i].get_height()!=h || images[i].get_format()!=format) { + ERR_PRINTS("Image size mismatch ("+itos(images[i].get_width())+","+itos(images[i].get_height())+":"+Image::get_format_name(images[i].get_format())+" when it should be "+itos(w)+","+itos(h)+":"+Image::get_format_name(format)+"): "+image_path[i]); + return; + } + } + } + + VS::get_singleton()->texture_allocate(cube_map,w,h,format,VS::TEXTURE_FLAG_FILTER|VS::TEXTURE_FLAG_CUBEMAP|VS::TEXTURE_FLAG_MIPMAPS); + for(int i=0;i<IMAGE_PATH_MAX;i++) { + VS::get_singleton()->texture_set_data(cube_map,images[i],VS::CubeMapSide(i)); + } + + cube_map_valid=true; + _radiance_changed(); + } + + +} + +String ImageSkyBox::get_image_path(ImagePath p_image) const { + + ERR_FAIL_INDEX_V(p_image,IMAGE_PATH_MAX,String()); + return image_path[p_image]; + +} + +RID ImageSkyBox::get_rid() const { + + return sky_box; +} + +void ImageSkyBox::_bind_methods() { + + ClassDB::bind_method(_MD("set_image_path","image","path"),&ImageSkyBox::set_image_path); + ClassDB::bind_method(_MD("get_image_path","image"),&ImageSkyBox::get_image_path); + + List<String> extensions; + ImageLoader::get_recognized_extensions(&extensions); + String hints; + for(List<String>::Element *E=extensions.front();E;E=E->next()) { + if (hints!=String()) { + hints+=","; + } + hints+="*."+E->get(); + } + + ADD_GROUP("Image Path","image_path_"); + ADD_PROPERTYI(PropertyInfo(Variant::STRING,"image_path_negative_x",PROPERTY_HINT_FILE,hints),_SCS("set_image_path"),_SCS("get_image_path"),IMAGE_PATH_NEGATIVE_X); + ADD_PROPERTYI(PropertyInfo(Variant::STRING,"image_path_positive_x",PROPERTY_HINT_FILE,hints),_SCS("set_image_path"),_SCS("get_image_path"),IMAGE_PATH_POSITIVE_X); + ADD_PROPERTYI(PropertyInfo(Variant::STRING,"image_path_negative_y",PROPERTY_HINT_FILE,hints),_SCS("set_image_path"),_SCS("get_image_path"),IMAGE_PATH_NEGATIVE_Y); + ADD_PROPERTYI(PropertyInfo(Variant::STRING,"image_path_positive_y",PROPERTY_HINT_FILE,hints),_SCS("set_image_path"),_SCS("get_image_path"),IMAGE_PATH_POSITIVE_Y); + ADD_PROPERTYI(PropertyInfo(Variant::STRING,"image_path_negative_z",PROPERTY_HINT_FILE,hints),_SCS("set_image_path"),_SCS("get_image_path"),IMAGE_PATH_NEGATIVE_Z); + ADD_PROPERTYI(PropertyInfo(Variant::STRING,"image_path_positive_z",PROPERTY_HINT_FILE,hints),_SCS("set_image_path"),_SCS("get_image_path"),IMAGE_PATH_POSITIVE_Z); + + BIND_CONSTANT( IMAGE_PATH_NEGATIVE_X ); + BIND_CONSTANT( IMAGE_PATH_POSITIVE_X ); + BIND_CONSTANT( IMAGE_PATH_NEGATIVE_Y ); + BIND_CONSTANT( IMAGE_PATH_POSITIVE_Y ); + BIND_CONSTANT( IMAGE_PATH_NEGATIVE_Z ); + BIND_CONSTANT( IMAGE_PATH_POSITIVE_Z ); + BIND_CONSTANT( IMAGE_PATH_MAX ); + +} + +ImageSkyBox::ImageSkyBox() { + + cube_map=VS::get_singleton()->texture_create(); + sky_box=VS::get_singleton()->skybox_create(); + cube_map_valid=false; +} + +ImageSkyBox::~ImageSkyBox() { + + VS::get_singleton()->free(cube_map); + VS::get_singleton()->free(sky_box); +} + diff --git a/scene/resources/sky_box.h b/scene/resources/sky_box.h new file mode 100644 index 0000000000..a3caf15aa7 --- /dev/null +++ b/scene/resources/sky_box.h @@ -0,0 +1,71 @@ +#ifndef SKYBOX_H +#define SKYBOX_H + +#include "scene/resources/texture.h" + +class SkyBox : public Resource { + GDCLASS(SkyBox,Resource); + +public: + + enum RadianceSize { + RADIANCE_SIZE_256, + RADIANCE_SIZE_512, + RADIANCE_SIZE_1024, + RADIANCE_SIZE_2048, + RADIANCE_SIZE_MAX + }; +private: + + RadianceSize radiance_size; +protected: + static void _bind_methods(); + virtual void _radiance_changed()=0; +public: + + void set_radiance_size(RadianceSize p_size); + RadianceSize get_radiance_size() const; + SkyBox(); +}; + +VARIANT_ENUM_CAST(SkyBox::RadianceSize) + + +class ImageSkyBox : public SkyBox { + GDCLASS(ImageSkyBox,SkyBox); + +public: + + enum ImagePath { + IMAGE_PATH_NEGATIVE_X, + IMAGE_PATH_POSITIVE_X, + IMAGE_PATH_NEGATIVE_Y, + IMAGE_PATH_POSITIVE_Y, + IMAGE_PATH_NEGATIVE_Z, + IMAGE_PATH_POSITIVE_Z, + IMAGE_PATH_MAX + }; +private: + RID cube_map; + RID sky_box; + bool cube_map_valid; + + String image_path[IMAGE_PATH_MAX]; +protected: + static void _bind_methods(); + virtual void _radiance_changed(); +public: + + void set_image_path(ImagePath p_image, const String &p_path); + String get_image_path(ImagePath p_image) const; + + virtual RID get_rid() const; + + ImageSkyBox(); + ~ImageSkyBox(); +}; + +VARIANT_ENUM_CAST(ImageSkyBox::ImagePath) + + +#endif // SKYBOX_H diff --git a/scene/resources/space_2d.cpp b/scene/resources/space_2d.cpp index d328ee3de4..3f0d2824ce 100644 --- a/scene/resources/space_2d.cpp +++ b/scene/resources/space_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -48,8 +48,8 @@ bool Space2D::is_active() const { void Space2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_active","active"),&Space2D::set_active); - ObjectTypeDB::bind_method(_MD("is_active"),&Space2D::is_active); + ClassDB::bind_method(_MD("set_active","active"),&Space2D::set_active); + ClassDB::bind_method(_MD("is_active"),&Space2D::is_active); ADD_PROPERTY( PropertyInfo(Variant::BOOL,"active"),_SCS("set_active"),_SCS("is_active") ); diff --git a/scene/resources/space_2d.h b/scene/resources/space_2d.h index 270f8de3ea..82aef89c07 100644 --- a/scene/resources/space_2d.h +++ b/scene/resources/space_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class Space2D : public Resource { - OBJ_TYPE(Space2D,Resource); + GDCLASS(Space2D,Resource); bool active; RID space; protected: diff --git a/scene/resources/sphere_shape.cpp b/scene/resources/sphere_shape.cpp index 4764937371..bcfb164b4c 100644 --- a/scene/resources/sphere_shape.cpp +++ b/scene/resources/sphere_shape.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -75,8 +75,8 @@ float SphereShape::get_radius() const { void SphereShape::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_radius","radius"),&SphereShape::set_radius); - ObjectTypeDB::bind_method(_MD("get_radius"),&SphereShape::get_radius); + ClassDB::bind_method(_MD("set_radius","radius"),&SphereShape::set_radius); + ClassDB::bind_method(_MD("get_radius"),&SphereShape::get_radius); ADD_PROPERTY( PropertyInfo(Variant::REAL,"radius",PROPERTY_HINT_RANGE,"0,4096,0.01"), _SCS("set_radius"), _SCS("get_radius")); diff --git a/scene/resources/sphere_shape.h b/scene/resources/sphere_shape.h index 50682f38bb..990564be80 100644 --- a/scene/resources/sphere_shape.h +++ b/scene/resources/sphere_shape.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class SphereShape : public Shape { - OBJ_TYPE(SphereShape,Shape); + GDCLASS(SphereShape,Shape); float radius; protected: diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp index 59246dfabe..066062f302 100644 --- a/scene/resources/style_box.cpp +++ b/scene/resources/style_box.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -70,25 +70,26 @@ Size2 StyleBox::get_center_size() const { void StyleBox::_bind_methods() { - ObjectTypeDB::bind_method(_MD("test_mask","point","rect"),&StyleBox::test_mask); + ClassDB::bind_method(_MD("test_mask","point","rect"),&StyleBox::test_mask); - ObjectTypeDB::bind_method(_MD("set_default_margin","margin","offset"),&StyleBox::set_default_margin); - ObjectTypeDB::bind_method(_MD("get_default_margin","margin"),&StyleBox::get_default_margin); + ClassDB::bind_method(_MD("set_default_margin","margin","offset"),&StyleBox::set_default_margin); + ClassDB::bind_method(_MD("get_default_margin","margin"),&StyleBox::get_default_margin); -// ObjectTypeDB::bind_method(_MD("set_default_margin"),&StyleBox::set_default_margin); -// ObjectTypeDB::bind_method(_MD("get_default_margin"),&StyleBox::get_default_margin); +// ClassDB::bind_method(_MD("set_default_margin"),&StyleBox::set_default_margin); +// ClassDB::bind_method(_MD("get_default_margin"),&StyleBox::get_default_margin); - ObjectTypeDB::bind_method(_MD("get_margin","margin"),&StyleBox::get_margin); - ObjectTypeDB::bind_method(_MD("get_minimum_size"),&StyleBox::get_minimum_size); - ObjectTypeDB::bind_method(_MD("get_center_size"),&StyleBox::get_center_size); - ObjectTypeDB::bind_method(_MD("get_offset"),&StyleBox::get_offset); + ClassDB::bind_method(_MD("get_margin","margin"),&StyleBox::get_margin); + ClassDB::bind_method(_MD("get_minimum_size"),&StyleBox::get_minimum_size); + ClassDB::bind_method(_MD("get_center_size"),&StyleBox::get_center_size); + ClassDB::bind_method(_MD("get_offset"),&StyleBox::get_offset); - ObjectTypeDB::bind_method(_MD("draw","canvas_item","rect"),&StyleBox::draw); + ClassDB::bind_method(_MD("draw","canvas_item","rect"),&StyleBox::draw); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "content_margin/left", PROPERTY_HINT_RANGE,"-1,2048,1" ), _SCS("set_default_margin"),_SCS("get_default_margin"), MARGIN_LEFT ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "content_margin/right", PROPERTY_HINT_RANGE,"-1,2048,1" ), _SCS("set_default_margin"),_SCS("get_default_margin"), MARGIN_RIGHT ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "content_margin/top", PROPERTY_HINT_RANGE,"-1,2048,1" ), _SCS("set_default_margin"),_SCS("get_default_margin"), MARGIN_TOP); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "content_margin/bottom", PROPERTY_HINT_RANGE,"-1,2048,1" ), _SCS("set_default_margin"),_SCS("get_default_margin"), MARGIN_BOTTOM ); + ADD_GROUP("Content Margin","content_margin_"); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "content_margin_left", PROPERTY_HINT_RANGE,"-1,2048,1" ), _SCS("set_default_margin"),_SCS("get_default_margin"), MARGIN_LEFT ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "content_margin_right", PROPERTY_HINT_RANGE,"-1,2048,1" ), _SCS("set_default_margin"),_SCS("get_default_margin"), MARGIN_RIGHT ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "content_margin_top", PROPERTY_HINT_RANGE,"-1,2048,1" ), _SCS("set_default_margin"),_SCS("get_default_margin"), MARGIN_TOP); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "content_margin_bottom", PROPERTY_HINT_RANGE,"-1,2048,1" ), _SCS("set_default_margin"),_SCS("get_default_margin"), MARGIN_BOTTOM ); } @@ -141,7 +142,7 @@ void StyleBoxTexture::draw(RID p_canvas_item,const Rect2& p_rect) const { r.pos.y-=expand_margin[MARGIN_TOP]; r.size.x+=expand_margin[MARGIN_LEFT]+expand_margin[MARGIN_RIGHT]; r.size.y+=expand_margin[MARGIN_TOP]+expand_margin[MARGIN_BOTTOM]; - VisualServer::get_singleton()->canvas_item_add_style_box( p_canvas_item,r,region_rect,texture->get_rid(),Vector2(margin[MARGIN_LEFT],margin[MARGIN_TOP]),Vector2(margin[MARGIN_RIGHT],margin[MARGIN_BOTTOM]),draw_center,modulate); + VisualServer::get_singleton()->canvas_item_add_nine_patch( p_canvas_item,r,region_rect,texture->get_rid(),Vector2(margin[MARGIN_LEFT],margin[MARGIN_TOP]),Vector2(margin[MARGIN_RIGHT],margin[MARGIN_BOTTOM]),VS::NINE_PATCH_STRETCH,VS::NINE_PATCH_STRETCH,draw_center,modulate); } void StyleBoxTexture::set_draw_center(bool p_draw) { @@ -208,38 +209,41 @@ Color StyleBoxTexture::get_modulate() const { void StyleBoxTexture::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_texture","texture:Texture"),&StyleBoxTexture::set_texture); - ObjectTypeDB::bind_method(_MD("get_texture:Texture"),&StyleBoxTexture::get_texture); + ClassDB::bind_method(_MD("set_texture","texture:Texture"),&StyleBoxTexture::set_texture); + ClassDB::bind_method(_MD("get_texture:Texture"),&StyleBoxTexture::get_texture); - ObjectTypeDB::bind_method(_MD("set_margin_size","margin","size"),&StyleBoxTexture::set_margin_size); - ObjectTypeDB::bind_method(_MD("get_margin_size","margin"),&StyleBoxTexture::get_margin_size); + ClassDB::bind_method(_MD("set_margin_size","margin","size"),&StyleBoxTexture::set_margin_size); + ClassDB::bind_method(_MD("get_margin_size","margin"),&StyleBoxTexture::get_margin_size); - ObjectTypeDB::bind_method(_MD("set_expand_margin_size","margin","size"),&StyleBoxTexture::set_expand_margin_size); - ObjectTypeDB::bind_method(_MD("get_expand_margin_size","margin"),&StyleBoxTexture::get_expand_margin_size); + ClassDB::bind_method(_MD("set_expand_margin_size","margin","size"),&StyleBoxTexture::set_expand_margin_size); + ClassDB::bind_method(_MD("get_expand_margin_size","margin"),&StyleBoxTexture::get_expand_margin_size); - ObjectTypeDB::bind_method(_MD("set_region_rect","region"),&StyleBoxTexture::set_region_rect); - ObjectTypeDB::bind_method(_MD("get_region_rect"),&StyleBoxTexture::get_region_rect); + ClassDB::bind_method(_MD("set_region_rect","region"),&StyleBoxTexture::set_region_rect); + ClassDB::bind_method(_MD("get_region_rect"),&StyleBoxTexture::get_region_rect); - ObjectTypeDB::bind_method(_MD("set_draw_center","enable"),&StyleBoxTexture::set_draw_center); - ObjectTypeDB::bind_method(_MD("get_draw_center"),&StyleBoxTexture::get_draw_center); + ClassDB::bind_method(_MD("set_draw_center","enable"),&StyleBoxTexture::set_draw_center); + ClassDB::bind_method(_MD("get_draw_center"),&StyleBoxTexture::get_draw_center); - ObjectTypeDB::bind_method(_MD("set_modulate","color"),&StyleBoxTexture::set_modulate); - ObjectTypeDB::bind_method(_MD("get_modulate"),&StyleBoxTexture::get_modulate); + ClassDB::bind_method(_MD("set_modulate","color"),&StyleBoxTexture::set_modulate); + ClassDB::bind_method(_MD("get_modulate"),&StyleBoxTexture::get_modulate); ADD_SIGNAL(MethodInfo("texture_changed")); ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture" ), _SCS("set_texture"),_SCS("get_texture") ); ADD_PROPERTYNZ( PropertyInfo( Variant::RECT2, "region_rect"), _SCS("set_region_rect"),_SCS("get_region_rect")); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "margin/left", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_margin_size"),_SCS("get_margin_size"), MARGIN_LEFT ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "margin/right", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_margin_size"),_SCS("get_margin_size"), MARGIN_RIGHT ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "margin/top", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_margin_size"),_SCS("get_margin_size"), MARGIN_TOP); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "margin/bottom", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_margin_size"),_SCS("get_margin_size"), MARGIN_BOTTOM ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "expand_margin/left", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_expand_margin_size"),_SCS("get_expand_margin_size"), MARGIN_LEFT ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "expand_margin/right", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_expand_margin_size"),_SCS("get_expand_margin_size"), MARGIN_RIGHT ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "expand_margin/top", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_expand_margin_size"),_SCS("get_expand_margin_size"), MARGIN_TOP ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "expand_margin/bottom", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_expand_margin_size"),_SCS("get_expand_margin_size"), MARGIN_BOTTOM ); - ADD_PROPERTY( PropertyInfo( Variant::COLOR, "modulate/color" ), _SCS("set_modulate"),_SCS("get_modulate")); + ADD_GROUP("Margin","margin_"); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "margin_left", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_margin_size"),_SCS("get_margin_size"), MARGIN_LEFT ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "margin_right", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_margin_size"),_SCS("get_margin_size"), MARGIN_RIGHT ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "margin_top", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_margin_size"),_SCS("get_margin_size"), MARGIN_TOP); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "margin_bottom", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_margin_size"),_SCS("get_margin_size"), MARGIN_BOTTOM ); + ADD_GROUP("Expand Margin","expand_margin_"); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "expand_margin_left", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_expand_margin_size"),_SCS("get_expand_margin_size"), MARGIN_LEFT ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "expand_margin_right", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_expand_margin_size"),_SCS("get_expand_margin_size"), MARGIN_RIGHT ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "expand_margin_top", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_expand_margin_size"),_SCS("get_expand_margin_size"), MARGIN_TOP ); + ADD_PROPERTYI( PropertyInfo( Variant::REAL, "expand_margin_bottom", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_expand_margin_size"),_SCS("get_expand_margin_size"), MARGIN_BOTTOM ); + ADD_GROUP("Modulate","modulate_"); + ADD_PROPERTY( PropertyInfo( Variant::COLOR, "modulate_color" ), _SCS("set_modulate"),_SCS("get_modulate")); ADD_PROPERTY( PropertyInfo( Variant::BOOL, "draw_center" ) , _SCS("set_draw_center"),_SCS("get_draw_center")); } @@ -386,18 +390,18 @@ float StyleBoxFlat::get_style_margin(Margin p_margin) const { } void StyleBoxFlat::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_bg_color","color"),&StyleBoxFlat::set_bg_color); - ObjectTypeDB::bind_method(_MD("get_bg_color"),&StyleBoxFlat::get_bg_color); - ObjectTypeDB::bind_method(_MD("set_light_color","color"),&StyleBoxFlat::set_light_color); - ObjectTypeDB::bind_method(_MD("get_light_color"),&StyleBoxFlat::get_light_color); - ObjectTypeDB::bind_method(_MD("set_dark_color","color"),&StyleBoxFlat::set_dark_color); - ObjectTypeDB::bind_method(_MD("get_dark_color"),&StyleBoxFlat::get_dark_color); - ObjectTypeDB::bind_method(_MD("set_border_size","size"),&StyleBoxFlat::set_border_size); - ObjectTypeDB::bind_method(_MD("get_border_size"),&StyleBoxFlat::get_border_size); - ObjectTypeDB::bind_method(_MD("set_border_blend","blend"),&StyleBoxFlat::set_border_blend); - ObjectTypeDB::bind_method(_MD("get_border_blend"),&StyleBoxFlat::get_border_blend); - ObjectTypeDB::bind_method(_MD("set_draw_center","size"),&StyleBoxFlat::set_draw_center); - ObjectTypeDB::bind_method(_MD("get_draw_center"),&StyleBoxFlat::get_draw_center); + ClassDB::bind_method(_MD("set_bg_color","color"),&StyleBoxFlat::set_bg_color); + ClassDB::bind_method(_MD("get_bg_color"),&StyleBoxFlat::get_bg_color); + ClassDB::bind_method(_MD("set_light_color","color"),&StyleBoxFlat::set_light_color); + ClassDB::bind_method(_MD("get_light_color"),&StyleBoxFlat::get_light_color); + ClassDB::bind_method(_MD("set_dark_color","color"),&StyleBoxFlat::set_dark_color); + ClassDB::bind_method(_MD("get_dark_color"),&StyleBoxFlat::get_dark_color); + ClassDB::bind_method(_MD("set_border_size","size"),&StyleBoxFlat::set_border_size); + ClassDB::bind_method(_MD("get_border_size"),&StyleBoxFlat::get_border_size); + ClassDB::bind_method(_MD("set_border_blend","blend"),&StyleBoxFlat::set_border_blend); + ClassDB::bind_method(_MD("get_border_blend"),&StyleBoxFlat::get_border_blend); + ClassDB::bind_method(_MD("set_draw_center","size"),&StyleBoxFlat::set_draw_center); + ClassDB::bind_method(_MD("get_draw_center"),&StyleBoxFlat::get_draw_center); ADD_PROPERTY( PropertyInfo( Variant::COLOR, "bg_color"), _SCS("set_bg_color"),_SCS("get_bg_color") ); ADD_PROPERTY( PropertyInfo( Variant::COLOR, "light_color"),_SCS("set_light_color"),_SCS("get_light_color")); @@ -423,127 +427,3 @@ StyleBoxFlat::~StyleBoxFlat() { } -//////////////// - - - -void StyleBoxImageMask::_bind_methods() { - - ObjectTypeDB::bind_method(_MD("set_image","image"),&StyleBoxImageMask::set_image); - ObjectTypeDB::bind_method(_MD("get_image"),&StyleBoxImageMask::get_image); - ObjectTypeDB::bind_method(_MD("set_expand","expand"),&StyleBoxImageMask::set_expand); - ObjectTypeDB::bind_method(_MD("get_expand"),&StyleBoxImageMask::get_expand); - ObjectTypeDB::bind_method(_MD("set_expand_margin_size","margin","size"),&StyleBoxImageMask::set_expand_margin_size); - ObjectTypeDB::bind_method(_MD("get_expand_margin_size","margin"),&StyleBoxImageMask::get_expand_margin_size); - - ADD_PROPERTY( PropertyInfo(Variant::IMAGE, "image"), _SCS("set_image"), _SCS("get_image")); - ADD_PROPERTY( PropertyInfo(Variant::BOOL, "expand"), _SCS("set_expand"), _SCS("get_expand")); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "expand_margin/left", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_expand_margin_size"),_SCS("get_expand_margin_size"), MARGIN_LEFT ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "expand_margin/right", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_expand_margin_size"),_SCS("get_expand_margin_size"), MARGIN_RIGHT ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "expand_margin/top", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_expand_margin_size"),_SCS("get_expand_margin_size"), MARGIN_TOP ); - ADD_PROPERTYI( PropertyInfo( Variant::REAL, "expand_margin/bottom", PROPERTY_HINT_RANGE,"0,2048,1" ), _SCS("set_expand_margin_size"),_SCS("get_expand_margin_size"), MARGIN_BOTTOM ); - -} - - -bool StyleBoxImageMask::test_mask(const Point2& p_point, const Rect2& p_rect) const { - - if (image.empty()) - return false; - if (p_rect.size.x<1) - return false; - if (p_rect.size.y<1) - return false; - - Size2i imgsize(image.get_width(),image.get_height()); - if (imgsize.x<=0 || imgsize.y<=0) - return false; - - Point2i img_expand_size( imgsize.x - expand_margin[MARGIN_LEFT] - expand_margin[MARGIN_RIGHT], imgsize.y - expand_margin[MARGIN_TOP] - expand_margin[MARGIN_BOTTOM]); - Point2i rect_expand_size( p_rect.size.x - expand_margin[MARGIN_LEFT] - expand_margin[MARGIN_RIGHT], p_rect.size.y - expand_margin[MARGIN_TOP] - expand_margin[MARGIN_BOTTOM]); - if (rect_expand_size.x<1) - rect_expand_size.x=1; - if (rect_expand_size.y<1) - rect_expand_size.y=1; - - - Point2i click_pos; - - - //treat x - - if (p_point.x<p_rect.pos.x) - click_pos.x=0; - else if (expand) { - - if (p_point.x>=p_rect.pos.x+p_rect.size.x) - click_pos.x=imgsize.x-1; - else if ((p_point.x-p_rect.pos.x)<expand_margin[MARGIN_LEFT]) - click_pos.x=p_point.x; - else if ((p_point.x-(p_rect.pos.x+p_rect.size.x))<expand_margin[MARGIN_RIGHT]) - click_pos.x=imgsize.x-(p_point.x-(p_rect.pos.x+p_rect.size.x)); - else //expand - click_pos.x=(p_point.x-p_rect.pos.x-expand_margin[MARGIN_LEFT])*img_expand_size.x/rect_expand_size.x; - } else if ((p_point.x-p_rect.pos.x) > imgsize.x) - click_pos.x=imgsize.x; - - //treat y - - if (p_point.y<p_rect.pos.y) - click_pos.y=0; - else if (expand) { - - if (p_point.y>=p_rect.pos.y+p_rect.size.y) - click_pos.y=imgsize.y-1; - else if ((p_point.y-p_rect.pos.y)<expand_margin[MARGIN_TOP]) - click_pos.y=p_point.y; - else if ((p_point.y-(p_rect.pos.y+p_rect.size.y))<expand_margin[MARGIN_BOTTOM]) - click_pos.y=imgsize.y-(p_point.y-(p_rect.pos.y+p_rect.size.y)); - else //expand - click_pos.y=(p_point.y-p_rect.pos.y-expand_margin[MARGIN_TOP])*img_expand_size.y/rect_expand_size.y; - } else if ((p_point.y-p_rect.pos.y) > imgsize.y) - click_pos.y=imgsize.y; - - return image.get_pixel(click_pos.x,click_pos.y).gray()>0.5; - -} - - -void StyleBoxImageMask::set_image(const Image& p_image) { - - image=p_image; -} -Image StyleBoxImageMask::get_image() const { - - return image; -} - - -void StyleBoxImageMask::set_expand(bool p_expand) { - - expand=p_expand; -} -bool StyleBoxImageMask::get_expand() const { - - return expand; -} -void StyleBoxImageMask::set_expand_margin_size(Margin p_expand_margin,float p_size) { - - ERR_FAIL_INDEX(p_expand_margin,4); - expand_margin[p_expand_margin]=p_size; -} - - -float StyleBoxImageMask::get_expand_margin_size(Margin p_expand_margin) const { - - ERR_FAIL_INDEX_V(p_expand_margin,4,0); - return expand_margin[p_expand_margin]; -} - -StyleBoxImageMask::StyleBoxImageMask() { - - for (int i=0;i<4;i++) { - expand_margin[i]=0; - } - expand=true; -} diff --git a/scene/resources/style_box.h b/scene/resources/style_box.h index f667318e24..f8b02724ee 100644 --- a/scene/resources/style_box.h +++ b/scene/resources/style_box.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ */ class StyleBox : public Resource { - OBJ_TYPE( StyleBox, Resource ); + GDCLASS( StyleBox, Resource ); RES_BASE_EXTENSION("sbx"); OBJ_SAVE_TYPE( StyleBox ); float margin[4]; @@ -65,7 +65,7 @@ public: class StyleBoxEmpty : public StyleBox { - OBJ_TYPE( StyleBoxEmpty, StyleBox ); + GDCLASS( StyleBoxEmpty, StyleBox ); virtual float get_style_margin(Margin p_margin) const { return 0; } public: @@ -76,7 +76,7 @@ public: class StyleBoxTexture : public StyleBox { - OBJ_TYPE( StyleBoxTexture, StyleBox ); + GDCLASS( StyleBoxTexture, StyleBox ); float expand_margin[4]; @@ -123,7 +123,7 @@ public: class StyleBoxFlat : public StyleBox { - OBJ_TYPE( StyleBoxFlat, StyleBox ); + GDCLASS( StyleBoxFlat, StyleBox ); Color bg_color; Color light_color; @@ -167,35 +167,5 @@ public: }; -class StyleBoxImageMask : public StyleBox { - - OBJ_TYPE( StyleBoxImageMask, StyleBox ); - virtual float get_style_margin(Margin p_margin) const { return 0; } - - Image image; - float expand_margin[4]; - bool expand; - -protected: - - static void _bind_methods(); - -public: - - virtual void draw(RID p_canvas_item,const Rect2& p_rect) const {} - virtual bool test_mask(const Point2& p_point, const Rect2& p_rect) const; - - void set_image(const Image& p_image); - Image get_image() const; - - void set_expand(bool p_expand); - bool get_expand() const; - void set_expand_margin_size(Margin p_expand_margin,float p_size); - float get_expand_margin_size(Margin p_expand_margin) const; - - StyleBoxImageMask(); - -}; - #endif diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp index e1769d099b..cc13c0ff11 100644 --- a/scene/resources/surface_tool.cpp +++ b/scene/resources/surface_tool.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -262,9 +262,9 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh>& p_existing) { case Mesh::ARRAY_FORMAT_VERTEX: case Mesh::ARRAY_FORMAT_NORMAL: { - DVector<Vector3> array; + PoolVector<Vector3> array; array.resize(varr_len); - DVector<Vector3>::Write w = array.write(); + PoolVector<Vector3>::Write w = array.write(); int idx=0; for(List< Vertex >::Element *E=vertex_array.front();E;E=E->next(),idx++) { @@ -282,7 +282,7 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh>& p_existing) { } - w=DVector<Vector3>::Write(); + w=PoolVector<Vector3>::Write(); a[i]=array; } break; @@ -290,9 +290,9 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh>& p_existing) { case Mesh::ARRAY_FORMAT_TEX_UV: case Mesh::ARRAY_FORMAT_TEX_UV2: { - DVector<Vector2> array; + PoolVector<Vector2> array; array.resize(varr_len); - DVector<Vector2>::Write w = array.write(); + PoolVector<Vector2>::Write w = array.write(); int idx=0; for(List< Vertex >::Element *E=vertex_array.front();E;E=E->next(),idx++) { @@ -311,15 +311,15 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh>& p_existing) { } - w=DVector<Vector2>::Write(); + w=PoolVector<Vector2>::Write(); a[i]=array; } break; case Mesh::ARRAY_FORMAT_TANGENT: { - DVector<float> array; + PoolVector<float> array; array.resize(varr_len*4); - DVector<float>::Write w = array.write(); + PoolVector<float>::Write w = array.write(); int idx=0; for(List< Vertex >::Element *E=vertex_array.front();E;E=E->next(),idx+=4) { @@ -335,15 +335,15 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh>& p_existing) { w[idx+3]=d<0 ? -1 : 1; } - w=DVector<float>::Write(); + w=PoolVector<float>::Write(); a[i]=array; } break; case Mesh::ARRAY_FORMAT_COLOR: { - DVector<Color> array; + PoolVector<Color> array; array.resize(varr_len); - DVector<Color>::Write w = array.write(); + PoolVector<Color>::Write w = array.write(); int idx=0; for(List< Vertex >::Element *E=vertex_array.front();E;E=E->next(),idx++) { @@ -352,38 +352,54 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh>& p_existing) { w[idx]=v.color; } - w=DVector<Color>::Write(); + w=PoolVector<Color>::Write(); a[i]=array; } break; - case Mesh::ARRAY_FORMAT_BONES: + case Mesh::ARRAY_FORMAT_BONES: { + + + PoolVector<int> array; + array.resize(varr_len*4); + PoolVector<int>::Write w = array.write(); + + int idx=0; + for(List< Vertex >::Element *E=vertex_array.front();E;E=E->next(),idx+=4) { + + const Vertex &v=E->get(); + + ERR_CONTINUE( v.bones.size()!=4 ); + + for(int j=0;j<4;j++) { + w[idx+j]=v.bones[j]; + } + + } + + w=PoolVector<int>::Write(); + a[i]=array; + + } break; case Mesh::ARRAY_FORMAT_WEIGHTS: { - DVector<float> array; + PoolVector<float> array; array.resize(varr_len*4); - DVector<float>::Write w = array.write(); + PoolVector<float>::Write w = array.write(); int idx=0; for(List< Vertex >::Element *E=vertex_array.front();E;E=E->next(),idx+=4) { const Vertex &v=E->get(); + ERR_CONTINUE( v.weights.size()!=4 ); for(int j=0;j<4;j++) { - switch(i) { - case Mesh::ARRAY_WEIGHTS: { - ERR_CONTINUE( v.weights.size()!=4 ); - w[idx+j]=v.weights[j]; - } break; - case Mesh::ARRAY_BONES: { - ERR_CONTINUE( v.bones.size()!=4 ); - w[idx+j]=v.bones[j]; - } break; - } + + w[idx+j]=v.weights[j]; } } - w=DVector<float>::Write(); + w=PoolVector<float>::Write(); a[i]=array; } break; @@ -391,9 +407,9 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh>& p_existing) { ERR_CONTINUE( index_array.size() ==0 ); - DVector<int> array; + PoolVector<int> array; array.resize(index_array.size()); - DVector<int>::Write w = array.write(); + PoolVector<int>::Write w = array.write(); int idx=0; for(List< int>::Element *E=index_array.front();E;E=E->next(),idx++) { @@ -401,7 +417,7 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh>& p_existing) { w[idx]=E->get(); } - w=DVector<int>::Write(); + w=PoolVector<int>::Write(); a[i]=array; } break; @@ -410,7 +426,7 @@ Ref<Mesh> SurfaceTool::commit(const Ref<Mesh>& p_existing) { } - mesh->add_surface(primitive,a); + mesh->add_surface_from_arrays(primitive,a); if (material.is_valid()) mesh->surface_set_material(surface,material); @@ -474,14 +490,14 @@ void SurfaceTool::_create_list(const Ref<Mesh>& p_existing, int p_surface, List< Array arr = p_existing->surface_get_arrays(p_surface); ERR_FAIL_COND( arr.size() !=VS::ARRAY_MAX ); - DVector<Vector3> varr = arr[VS::ARRAY_VERTEX]; - DVector<Vector3> narr = arr[VS::ARRAY_NORMAL]; - DVector<float> tarr = arr[VS::ARRAY_TANGENT]; - DVector<Color> carr = arr[VS::ARRAY_COLOR]; - DVector<Vector2> uvarr = arr[VS::ARRAY_TEX_UV]; - DVector<Vector2> uv2arr = arr[VS::ARRAY_TEX_UV2]; - DVector<int> barr = arr[VS::ARRAY_BONES]; - DVector<float> warr = arr[VS::ARRAY_WEIGHTS]; + PoolVector<Vector3> varr = arr[VS::ARRAY_VERTEX]; + PoolVector<Vector3> narr = arr[VS::ARRAY_NORMAL]; + PoolVector<float> tarr = arr[VS::ARRAY_TANGENT]; + PoolVector<Color> carr = arr[VS::ARRAY_COLOR]; + PoolVector<Vector2> uvarr = arr[VS::ARRAY_TEX_UV]; + PoolVector<Vector2> uv2arr = arr[VS::ARRAY_TEX_UV2]; + PoolVector<int> barr = arr[VS::ARRAY_BONES]; + PoolVector<float> warr = arr[VS::ARRAY_WEIGHTS]; int vc = varr.size(); @@ -489,46 +505,46 @@ void SurfaceTool::_create_list(const Ref<Mesh>& p_existing, int p_surface, List< return; lformat=0; - DVector<Vector3>::Read rv; + PoolVector<Vector3>::Read rv; if (varr.size()) { lformat|=VS::ARRAY_FORMAT_VERTEX; rv=varr.read(); } - DVector<Vector3>::Read rn; + PoolVector<Vector3>::Read rn; if (narr.size()) { lformat|=VS::ARRAY_FORMAT_NORMAL; rn=narr.read(); } - DVector<float>::Read rt; + PoolVector<float>::Read rt; if (tarr.size()) { lformat|=VS::ARRAY_FORMAT_TANGENT; rt=tarr.read(); } - DVector<Color>::Read rc; + PoolVector<Color>::Read rc; if (carr.size()) { lformat|=VS::ARRAY_FORMAT_COLOR; rc=carr.read(); } - DVector<Vector2>::Read ruv; + PoolVector<Vector2>::Read ruv; if (uvarr.size()) { lformat|=VS::ARRAY_FORMAT_TEX_UV; ruv=uvarr.read(); } - DVector<Vector2>::Read ruv2; + PoolVector<Vector2>::Read ruv2; if (uv2arr.size()) { lformat|=VS::ARRAY_FORMAT_TEX_UV2; ruv2=uv2arr.read(); } - DVector<int>::Read rb; + PoolVector<int>::Read rb; if (barr.size()) { lformat|=VS::ARRAY_FORMAT_BONES; rb=barr.read(); } - DVector<float>::Read rw; + PoolVector<float>::Read rw; if (warr.size()) { lformat|=VS::ARRAY_FORMAT_WEIGHTS; rw=warr.read(); @@ -576,12 +592,12 @@ void SurfaceTool::_create_list(const Ref<Mesh>& p_existing, int p_surface, List< //indices - DVector<int> idx= arr[VS::ARRAY_INDEX]; + PoolVector<int> idx= arr[VS::ARRAY_INDEX]; int is = idx.size(); if (is) { lformat|=VS::ARRAY_FORMAT_INDEX; - DVector<int>::Read iarr=idx.read(); + PoolVector<int>::Read iarr=idx.read(); for(int i=0;i<is;i++) { r_index->push_back(iarr[i]); } @@ -844,25 +860,25 @@ void SurfaceTool::clear() { void SurfaceTool::_bind_methods() { - ObjectTypeDB::bind_method(_MD("begin","primitive"),&SurfaceTool::begin); - ObjectTypeDB::bind_method(_MD("add_vertex","vertex"),&SurfaceTool::add_vertex); - ObjectTypeDB::bind_method(_MD("add_color","color"),&SurfaceTool::add_color); - ObjectTypeDB::bind_method(_MD("add_normal","normal"),&SurfaceTool::add_normal); - ObjectTypeDB::bind_method(_MD("add_tangent","tangent"),&SurfaceTool::add_tangent); - ObjectTypeDB::bind_method(_MD("add_uv","uv"),&SurfaceTool::add_uv); - ObjectTypeDB::bind_method(_MD("add_uv2","uv2"),&SurfaceTool::add_uv2); - ObjectTypeDB::bind_method(_MD("add_bones","bones"),&SurfaceTool::add_bones); - ObjectTypeDB::bind_method(_MD("add_weights","weights"),&SurfaceTool::add_weights); - ObjectTypeDB::bind_method(_MD("add_smooth_group","smooth"),&SurfaceTool::add_smooth_group); - ObjectTypeDB::bind_method(_MD("add_triangle_fan", "vertexes", "uvs", "colors", "uv2s", "normals", "tangents"),&SurfaceTool::add_triangle_fan, DEFVAL(Vector<Vector2>()), DEFVAL(Vector<Color>()), DEFVAL(Vector<Vector2>()),DEFVAL(Vector<Vector3>()), DEFVAL(Vector<Plane>())); - ObjectTypeDB::bind_method(_MD("set_material","material:Material"),&SurfaceTool::set_material); - ObjectTypeDB::bind_method(_MD("index"),&SurfaceTool::index); - ObjectTypeDB::bind_method(_MD("deindex"),&SurfaceTool::deindex); - ///ObjectTypeDB::bind_method(_MD("generate_flat_normals"),&SurfaceTool::generate_flat_normals); - ObjectTypeDB::bind_method(_MD("generate_normals"),&SurfaceTool::generate_normals); - ObjectTypeDB::bind_method(_MD("add_index", "index"), &SurfaceTool::add_index); - ObjectTypeDB::bind_method(_MD("commit:Mesh","existing:Mesh"),&SurfaceTool::commit,DEFVAL(Variant())); - ObjectTypeDB::bind_method(_MD("clear"),&SurfaceTool::clear); + ClassDB::bind_method(_MD("begin","primitive"),&SurfaceTool::begin); + ClassDB::bind_method(_MD("add_vertex","vertex"),&SurfaceTool::add_vertex); + ClassDB::bind_method(_MD("add_color","color"),&SurfaceTool::add_color); + ClassDB::bind_method(_MD("add_normal","normal"),&SurfaceTool::add_normal); + ClassDB::bind_method(_MD("add_tangent","tangent"),&SurfaceTool::add_tangent); + ClassDB::bind_method(_MD("add_uv","uv"),&SurfaceTool::add_uv); + ClassDB::bind_method(_MD("add_uv2","uv2"),&SurfaceTool::add_uv2); + ClassDB::bind_method(_MD("add_bones","bones"),&SurfaceTool::add_bones); + ClassDB::bind_method(_MD("add_weights","weights"),&SurfaceTool::add_weights); + ClassDB::bind_method(_MD("add_smooth_group","smooth"),&SurfaceTool::add_smooth_group); + ClassDB::bind_method(_MD("add_triangle_fan", "vertexes", "uvs", "colors", "uv2s", "normals", "tangents"),&SurfaceTool::add_triangle_fan, DEFVAL(Vector<Vector2>()), DEFVAL(Vector<Color>()), DEFVAL(Vector<Vector2>()),DEFVAL(Vector<Vector3>()), DEFVAL(Vector<Plane>())); + ClassDB::bind_method(_MD("set_material","material:Material"),&SurfaceTool::set_material); + ClassDB::bind_method(_MD("index"),&SurfaceTool::index); + ClassDB::bind_method(_MD("deindex"),&SurfaceTool::deindex); + ///ClassDB::bind_method(_MD("generate_flat_normals"),&SurfaceTool::generate_flat_normals); + ClassDB::bind_method(_MD("generate_normals"),&SurfaceTool::generate_normals); + ClassDB::bind_method(_MD("add_index", "index"), &SurfaceTool::add_index); + ClassDB::bind_method(_MD("commit:Mesh","existing:Mesh"),&SurfaceTool::commit,DEFVAL(Variant())); + ClassDB::bind_method(_MD("clear"),&SurfaceTool::clear); } diff --git a/scene/resources/surface_tool.h b/scene/resources/surface_tool.h index fa9724b142..f859efbfe5 100644 --- a/scene/resources/surface_tool.h +++ b/scene/resources/surface_tool.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class SurfaceTool : public Reference { - OBJ_TYPE(SurfaceTool, Reference ); + GDCLASS(SurfaceTool, Reference ); public: struct Vertex { diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 726b1938c4..462341a751 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -63,16 +63,16 @@ bool Texture::get_rect_region(const Rect2& p_rect, const Rect2& p_src_rect,Rect2 void Texture::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_width"),&Texture::get_width); - ObjectTypeDB::bind_method(_MD("get_height"),&Texture::get_height); - ObjectTypeDB::bind_method(_MD("get_size"),&Texture::get_size); - ObjectTypeDB::bind_method(_MD("get_rid"),&Texture::get_rid); - ObjectTypeDB::bind_method(_MD("has_alpha"),&Texture::has_alpha); - ObjectTypeDB::bind_method(_MD("set_flags","flags"),&Texture::set_flags); - ObjectTypeDB::bind_method(_MD("get_flags"),&Texture::get_flags); - ObjectTypeDB::bind_method(_MD("draw","canvas_item","pos","modulate","transpose"),&Texture::draw,DEFVAL(Color(1,1,1)),DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("draw_rect","canvas_item","rect","tile","modulate","transpose"),&Texture::draw_rect,DEFVAL(Color(1,1,1)),DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("draw_rect_region","canvas_item","rect","src_rect","modulate","transpose"),&Texture::draw_rect_region,DEFVAL(Color(1,1,1)),DEFVAL(false)); + ClassDB::bind_method(_MD("get_width"),&Texture::get_width); + ClassDB::bind_method(_MD("get_height"),&Texture::get_height); + ClassDB::bind_method(_MD("get_size"),&Texture::get_size); + ClassDB::bind_method(_MD("get_rid"),&Texture::get_rid); + ClassDB::bind_method(_MD("has_alpha"),&Texture::has_alpha); + ClassDB::bind_method(_MD("set_flags","flags"),&Texture::set_flags); + ClassDB::bind_method(_MD("get_flags"),&Texture::get_flags); + ClassDB::bind_method(_MD("draw","canvas_item","pos","modulate","transpose"),&Texture::draw,DEFVAL(Color(1,1,1)),DEFVAL(false)); + ClassDB::bind_method(_MD("draw_rect","canvas_item","rect","tile","modulate","transpose"),&Texture::draw_rect,DEFVAL(Color(1,1,1)),DEFVAL(false)); + ClassDB::bind_method(_MD("draw_rect_region","canvas_item","rect","src_rect","modulate","transpose"),&Texture::draw_rect_region,DEFVAL(Color(1,1,1)),DEFVAL(false)); BIND_CONSTANT( FLAG_MIPMAPS ); BIND_CONSTANT( FLAG_REPEAT ); @@ -258,23 +258,13 @@ void ImageTexture::load(const String& p_path) { void ImageTexture::set_data(const Image& p_image) { VisualServer::get_singleton()->texture_set_data(texture,p_image); - VisualServer::get_singleton()->texture_set_reload_hook(texture,0,StringName()); //hook is erased if data is changed + _change_notify(); } void ImageTexture::_resource_path_changed() { String path=get_path(); - if (VS::get_singleton()->has_feature(VS::FEATURE_NEEDS_RELOAD_HOOK)) { - //this needs to be done much better, but probably will end up being deprecated as technology advances - if (path.is_resource_file() && ImageLoader::recognize(path.extension())) { - - //hook is set only if path is hookable - VisualServer::get_singleton()->texture_set_reload_hook(texture,get_instance_ID(),"_reload_hook"); - } else { - VisualServer::get_singleton()->texture_set_reload_hook(texture,0,StringName()); - } - } } Image ImageTexture::get_data() const { @@ -300,7 +290,7 @@ RID ImageTexture::get_rid() const { void ImageTexture::fix_alpha_edges() { - if (format==Image::FORMAT_RGBA /*&& !(flags&FLAG_CUBEMAP)*/) { + if (format==Image::FORMAT_RGBA8 /*&& !(flags&FLAG_CUBEMAP)*/) { Image img = get_data(); img.fix_alpha_edges(); @@ -310,7 +300,7 @@ void ImageTexture::fix_alpha_edges() { void ImageTexture::premultiply_alpha() { - if (format==Image::FORMAT_RGBA /*&& !(flags&FLAG_CUBEMAP)*/) { + if (format==Image::FORMAT_RGBA8 /*&& !(flags&FLAG_CUBEMAP)*/) { Image img = get_data(); img.premultiply_alpha(); @@ -337,7 +327,7 @@ void ImageTexture::shrink_x2_and_keep_size() { bool ImageTexture::has_alpha() const { - return ( format==Image::FORMAT_GRAYSCALE_ALPHA || format==Image::FORMAT_INDEXED_ALPHA || format==Image::FORMAT_RGBA ); + return ( format==Image::FORMAT_LA8 || format==Image::FORMAT_RGBA8 ); } @@ -417,27 +407,27 @@ void ImageTexture::_set_data(Dictionary p_data) { void ImageTexture::_bind_methods() { - ObjectTypeDB::bind_method(_MD("create","width","height","format","flags"),&ImageTexture::create,DEFVAL(FLAGS_DEFAULT)); - ObjectTypeDB::bind_method(_MD("create_from_image","image","flags"),&ImageTexture::create_from_image,DEFVAL(FLAGS_DEFAULT)); - ObjectTypeDB::bind_method(_MD("get_format"),&ImageTexture::get_format); - ObjectTypeDB::bind_method(_MD("load","path"),&ImageTexture::load); - ObjectTypeDB::bind_method(_MD("set_data","image"),&ImageTexture::set_data); - ObjectTypeDB::bind_method(_MD("get_data","cube_side"),&ImageTexture::get_data); - ObjectTypeDB::bind_method(_MD("set_storage","mode"),&ImageTexture::set_storage); - ObjectTypeDB::bind_method(_MD("get_storage"),&ImageTexture::get_storage); - ObjectTypeDB::bind_method(_MD("set_lossy_storage_quality","quality"),&ImageTexture::set_lossy_storage_quality); - ObjectTypeDB::bind_method(_MD("get_lossy_storage_quality"),&ImageTexture::get_lossy_storage_quality); - ObjectTypeDB::bind_method(_MD("fix_alpha_edges"),&ImageTexture::fix_alpha_edges); - ObjectTypeDB::bind_method(_MD("premultiply_alpha"),&ImageTexture::premultiply_alpha); - ObjectTypeDB::bind_method(_MD("normal_to_xy"),&ImageTexture::normal_to_xy); - ObjectTypeDB::bind_method(_MD("shrink_x2_and_keep_size"),&ImageTexture::shrink_x2_and_keep_size); - - ObjectTypeDB::bind_method(_MD("set_size_override","size"),&ImageTexture::set_size_override); - ObjectTypeDB::set_method_flags(get_type_static(),_SCS("fix_alpha_edges"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); - ObjectTypeDB::set_method_flags(get_type_static(),_SCS("premultiply_alpha"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); - ObjectTypeDB::set_method_flags(get_type_static(),_SCS("normal_to_xy"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); - ObjectTypeDB::set_method_flags(get_type_static(),_SCS("shrink_x2_and_keep_size"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); - ObjectTypeDB::bind_method(_MD("_reload_hook","rid"),&ImageTexture::_reload_hook); + ClassDB::bind_method(_MD("create","width","height","format","flags"),&ImageTexture::create,DEFVAL(FLAGS_DEFAULT)); + ClassDB::bind_method(_MD("create_from_image","image","flags"),&ImageTexture::create_from_image,DEFVAL(FLAGS_DEFAULT)); + ClassDB::bind_method(_MD("get_format"),&ImageTexture::get_format); + ClassDB::bind_method(_MD("load","path"),&ImageTexture::load); + ClassDB::bind_method(_MD("set_data","image"),&ImageTexture::set_data); + ClassDB::bind_method(_MD("get_data","cube_side"),&ImageTexture::get_data); + ClassDB::bind_method(_MD("set_storage","mode"),&ImageTexture::set_storage); + ClassDB::bind_method(_MD("get_storage"),&ImageTexture::get_storage); + ClassDB::bind_method(_MD("set_lossy_storage_quality","quality"),&ImageTexture::set_lossy_storage_quality); + ClassDB::bind_method(_MD("get_lossy_storage_quality"),&ImageTexture::get_lossy_storage_quality); + ClassDB::bind_method(_MD("fix_alpha_edges"),&ImageTexture::fix_alpha_edges); + ClassDB::bind_method(_MD("premultiply_alpha"),&ImageTexture::premultiply_alpha); + ClassDB::bind_method(_MD("normal_to_xy"),&ImageTexture::normal_to_xy); + ClassDB::bind_method(_MD("shrink_x2_and_keep_size"),&ImageTexture::shrink_x2_and_keep_size); + + ClassDB::bind_method(_MD("set_size_override","size"),&ImageTexture::set_size_override); + ClassDB::set_method_flags(get_class_static(),_SCS("fix_alpha_edges"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + ClassDB::set_method_flags(get_class_static(),_SCS("premultiply_alpha"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + ClassDB::set_method_flags(get_class_static(),_SCS("normal_to_xy"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + ClassDB::set_method_flags(get_class_static(),_SCS("shrink_x2_and_keep_size"),METHOD_FLAGS_DEFAULT|METHOD_FLAG_EDITOR); + ClassDB::bind_method(_MD("_reload_hook","rid"),&ImageTexture::_reload_hook); BIND_CONSTANT( STORAGE_RAW ); @@ -559,14 +549,14 @@ Rect2 AtlasTexture::get_margin() const { void AtlasTexture::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_atlas","atlas:Texture"),&AtlasTexture::set_atlas); - ObjectTypeDB::bind_method(_MD("get_atlas:Texture"),&AtlasTexture::get_atlas); + ClassDB::bind_method(_MD("set_atlas","atlas:Texture"),&AtlasTexture::set_atlas); + ClassDB::bind_method(_MD("get_atlas:Texture"),&AtlasTexture::get_atlas); - ObjectTypeDB::bind_method(_MD("set_region","region"),&AtlasTexture::set_region); - ObjectTypeDB::bind_method(_MD("get_region"),&AtlasTexture::get_region); + ClassDB::bind_method(_MD("set_region","region"),&AtlasTexture::set_region); + ClassDB::bind_method(_MD("get_region"),&AtlasTexture::get_region); - ObjectTypeDB::bind_method(_MD("set_margin","margin"),&AtlasTexture::set_margin); - ObjectTypeDB::bind_method(_MD("get_margin"),&AtlasTexture::get_margin); + ClassDB::bind_method(_MD("set_margin","margin"),&AtlasTexture::set_margin); + ClassDB::bind_method(_MD("get_margin"),&AtlasTexture::get_margin); ADD_SIGNAL(MethodInfo("atlas_changed")); @@ -814,18 +804,18 @@ Ref<Texture> LargeTexture::get_piece_texture(int p_idx) const{ void LargeTexture::_bind_methods() { - ObjectTypeDB::bind_method(_MD("add_piece","ofs","texture:Texture"),&LargeTexture::add_piece); - ObjectTypeDB::bind_method(_MD("set_piece_offset", "idx", "ofs"),&LargeTexture::set_piece_offset); - ObjectTypeDB::bind_method(_MD("set_piece_texture","idx", "texture:Texture"),&LargeTexture::set_piece_texture); - ObjectTypeDB::bind_method(_MD("set_size","size"),&LargeTexture::set_size); - ObjectTypeDB::bind_method(_MD("clear"),&LargeTexture::clear); + ClassDB::bind_method(_MD("add_piece","ofs","texture:Texture"),&LargeTexture::add_piece); + ClassDB::bind_method(_MD("set_piece_offset", "idx", "ofs"),&LargeTexture::set_piece_offset); + ClassDB::bind_method(_MD("set_piece_texture","idx", "texture:Texture"),&LargeTexture::set_piece_texture); + ClassDB::bind_method(_MD("set_size","size"),&LargeTexture::set_size); + ClassDB::bind_method(_MD("clear"),&LargeTexture::clear); - ObjectTypeDB::bind_method(_MD("get_piece_count"),&LargeTexture::get_piece_count); - ObjectTypeDB::bind_method(_MD("get_piece_offset","idx"),&LargeTexture::get_piece_offset); - ObjectTypeDB::bind_method(_MD("get_piece_texture:Texture","idx"),&LargeTexture::get_piece_texture); + ClassDB::bind_method(_MD("get_piece_count"),&LargeTexture::get_piece_count); + ClassDB::bind_method(_MD("get_piece_offset","idx"),&LargeTexture::get_piece_offset); + ClassDB::bind_method(_MD("get_piece_texture:Texture","idx"),&LargeTexture::get_piece_texture); - ObjectTypeDB::bind_method(_MD("_set_data","data"),&LargeTexture::_set_data); - ObjectTypeDB::bind_method(_MD("_get_data"),&LargeTexture::_get_data); + ClassDB::bind_method(_MD("_set_data","data"),&LargeTexture::_set_data); + ClassDB::bind_method(_MD("_get_data"),&LargeTexture::_get_data); ADD_PROPERTY( PropertyInfo( Variant::ARRAY, "_data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_NOEDITOR), _SCS("_set_data"),_SCS("_get_data") ); @@ -1058,18 +1048,18 @@ void CubeMap::_get_property_list( List<PropertyInfo> *p_list) const { void CubeMap::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_width"),&CubeMap::get_width); - ObjectTypeDB::bind_method(_MD("get_height"),&CubeMap::get_height); - ObjectTypeDB::bind_method(_MD("get_rid"),&CubeMap::get_rid); - ObjectTypeDB::bind_method(_MD("set_flags","flags"),&CubeMap::set_flags); - ObjectTypeDB::bind_method(_MD("get_flags"),&CubeMap::get_flags); - - ObjectTypeDB::bind_method(_MD("set_side","side","image"),&CubeMap::set_side); - ObjectTypeDB::bind_method(_MD("get_side","side"),&CubeMap::get_side); - ObjectTypeDB::bind_method(_MD("set_storage","mode"),&CubeMap::set_storage); - ObjectTypeDB::bind_method(_MD("get_storage"),&CubeMap::get_storage); - ObjectTypeDB::bind_method(_MD("set_lossy_storage_quality","quality"),&CubeMap::set_lossy_storage_quality); - ObjectTypeDB::bind_method(_MD("get_lossy_storage_quality"),&CubeMap::get_lossy_storage_quality); + ClassDB::bind_method(_MD("get_width"),&CubeMap::get_width); + ClassDB::bind_method(_MD("get_height"),&CubeMap::get_height); + ClassDB::bind_method(_MD("get_rid"),&CubeMap::get_rid); + ClassDB::bind_method(_MD("set_flags","flags"),&CubeMap::set_flags); + ClassDB::bind_method(_MD("get_flags"),&CubeMap::get_flags); + + ClassDB::bind_method(_MD("set_side","side","image"),&CubeMap::set_side); + ClassDB::bind_method(_MD("get_side","side"),&CubeMap::get_side); + ClassDB::bind_method(_MD("set_storage","mode"),&CubeMap::set_storage); + ClassDB::bind_method(_MD("get_storage"),&CubeMap::get_storage); + ClassDB::bind_method(_MD("set_lossy_storage_quality","quality"),&CubeMap::set_lossy_storage_quality); + ClassDB::bind_method(_MD("get_lossy_storage_quality"),&CubeMap::get_lossy_storage_quality); BIND_CONSTANT( STORAGE_RAW ); diff --git a/scene/resources/texture.h b/scene/resources/texture.h index 05ea833978..aac3514af3 100644 --- a/scene/resources/texture.h +++ b/scene/resources/texture.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -41,7 +41,7 @@ class Texture : public Resource { - OBJ_TYPE( Texture, Resource ); + GDCLASS( Texture, Resource ); OBJ_SAVE_TYPE( Texture ); //children are all saved as Texture, so they can be exchanged protected: @@ -54,7 +54,7 @@ public: FLAG_FILTER=VisualServer::TEXTURE_FLAG_FILTER, FLAG_ANISOTROPIC_FILTER=VisualServer::TEXTURE_FLAG_ANISOTROPIC_FILTER, FLAG_CONVERT_TO_LINEAR=VisualServer::TEXTURE_FLAG_CONVERT_TO_LINEAR, - FLAG_VIDEO_SURFACE=VisualServer::TEXTURE_FLAG_VIDEO_SURFACE, + FLAG_VIDEO_SURFACE=VisualServer::TEXTURE_FLAG_USED_FOR_STREAMING, FLAGS_DEFAULT=FLAG_MIPMAPS|FLAG_REPEAT|FLAG_FILTER, FLAG_MIRRORED_REPEAT=VisualServer::TEXTURE_FLAG_MIRRORED_REPEAT }; @@ -85,7 +85,7 @@ VARIANT_ENUM_CAST( Texture::Flags ); class ImageTexture : public Texture { - OBJ_TYPE( ImageTexture, Texture ); + GDCLASS( ImageTexture, Texture ); RES_BASE_EXTENSION("tex"); public: enum Storage { @@ -164,7 +164,7 @@ VARIANT_ENUM_CAST( ImageTexture::Storage ); class AtlasTexture : public Texture { - OBJ_TYPE( AtlasTexture, Texture ); + GDCLASS( AtlasTexture, Texture ); RES_BASE_EXTENSION("atex"); protected: @@ -205,7 +205,7 @@ public: class LargeTexture : public Texture { - OBJ_TYPE( LargeTexture, Texture ); + GDCLASS( LargeTexture, Texture ); RES_BASE_EXTENSION("ltex"); protected: @@ -256,7 +256,7 @@ public: class CubeMap : public Resource { - OBJ_TYPE( CubeMap, Resource ); + GDCLASS( CubeMap, Resource ); RES_BASE_EXTENSION("cbm"); public: enum Storage { diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp index b351167e10..2e3afbf057 100644 --- a/scene/resources/theme.cpp +++ b/scene/resources/theme.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -664,48 +664,48 @@ void Theme::get_type_list(List<StringName> *p_list) const { void Theme::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_icon","name","type","texture:Texture"),&Theme::set_icon); - ObjectTypeDB::bind_method(_MD("get_icon:Texture","name","type"),&Theme::get_icon); - ObjectTypeDB::bind_method(_MD("has_icon","name","type"),&Theme::has_icon); - ObjectTypeDB::bind_method(_MD("clear_icon","name","type"),&Theme::clear_icon); - ObjectTypeDB::bind_method(_MD("get_icon_list","type"),&Theme::_get_icon_list); + ClassDB::bind_method(_MD("set_icon","name","type","texture:Texture"),&Theme::set_icon); + ClassDB::bind_method(_MD("get_icon:Texture","name","type"),&Theme::get_icon); + ClassDB::bind_method(_MD("has_icon","name","type"),&Theme::has_icon); + ClassDB::bind_method(_MD("clear_icon","name","type"),&Theme::clear_icon); + ClassDB::bind_method(_MD("get_icon_list","type"),&Theme::_get_icon_list); - ObjectTypeDB::bind_method(_MD("set_stylebox","name","type","texture:StyleBox"),&Theme::set_stylebox); - ObjectTypeDB::bind_method(_MD("get_stylebox:StyleBox","name","type"),&Theme::get_stylebox); - ObjectTypeDB::bind_method(_MD("has_stylebox","name","type"),&Theme::has_stylebox); - ObjectTypeDB::bind_method(_MD("clear_stylebox","name","type"),&Theme::clear_stylebox); - ObjectTypeDB::bind_method(_MD("get_stylebox_list","type"),&Theme::_get_stylebox_list); - ObjectTypeDB::bind_method(_MD("get_stylebox_types"),&Theme::_get_stylebox_types); + ClassDB::bind_method(_MD("set_stylebox","name","type","texture:StyleBox"),&Theme::set_stylebox); + ClassDB::bind_method(_MD("get_stylebox:StyleBox","name","type"),&Theme::get_stylebox); + ClassDB::bind_method(_MD("has_stylebox","name","type"),&Theme::has_stylebox); + ClassDB::bind_method(_MD("clear_stylebox","name","type"),&Theme::clear_stylebox); + ClassDB::bind_method(_MD("get_stylebox_list","type"),&Theme::_get_stylebox_list); + ClassDB::bind_method(_MD("get_stylebox_types"),&Theme::_get_stylebox_types); - ObjectTypeDB::bind_method(_MD("set_font","name","type","font:Font"),&Theme::set_font); - ObjectTypeDB::bind_method(_MD("get_font:Font","name","type"),&Theme::get_font); - ObjectTypeDB::bind_method(_MD("has_font","name","type"),&Theme::has_font); - ObjectTypeDB::bind_method(_MD("clear_font","name","type"),&Theme::clear_font); - ObjectTypeDB::bind_method(_MD("get_font_list","type"),&Theme::_get_font_list); + ClassDB::bind_method(_MD("set_font","name","type","font:Font"),&Theme::set_font); + ClassDB::bind_method(_MD("get_font:Font","name","type"),&Theme::get_font); + ClassDB::bind_method(_MD("has_font","name","type"),&Theme::has_font); + ClassDB::bind_method(_MD("clear_font","name","type"),&Theme::clear_font); + ClassDB::bind_method(_MD("get_font_list","type"),&Theme::_get_font_list); - ObjectTypeDB::bind_method(_MD("set_color","name","type","color"),&Theme::set_color); - ObjectTypeDB::bind_method(_MD("get_color","name","type"),&Theme::get_color); - ObjectTypeDB::bind_method(_MD("has_color","name","type"),&Theme::has_color); - ObjectTypeDB::bind_method(_MD("clear_color","name","type"),&Theme::clear_color); - ObjectTypeDB::bind_method(_MD("get_color_list","type"),&Theme::_get_color_list); + ClassDB::bind_method(_MD("set_color","name","type","color"),&Theme::set_color); + ClassDB::bind_method(_MD("get_color","name","type"),&Theme::get_color); + ClassDB::bind_method(_MD("has_color","name","type"),&Theme::has_color); + ClassDB::bind_method(_MD("clear_color","name","type"),&Theme::clear_color); + ClassDB::bind_method(_MD("get_color_list","type"),&Theme::_get_color_list); - ObjectTypeDB::bind_method(_MD("set_constant","name","type","constant"),&Theme::set_constant); - ObjectTypeDB::bind_method(_MD("get_constant","name","type"),&Theme::get_constant); - ObjectTypeDB::bind_method(_MD("has_constant","name","type"),&Theme::has_constant); - ObjectTypeDB::bind_method(_MD("clear_constant","name","type"),&Theme::clear_constant); - ObjectTypeDB::bind_method(_MD("get_constant_list","type"),&Theme::_get_constant_list); + ClassDB::bind_method(_MD("set_constant","name","type","constant"),&Theme::set_constant); + ClassDB::bind_method(_MD("get_constant","name","type"),&Theme::get_constant); + ClassDB::bind_method(_MD("has_constant","name","type"),&Theme::has_constant); + ClassDB::bind_method(_MD("clear_constant","name","type"),&Theme::clear_constant); + ClassDB::bind_method(_MD("get_constant_list","type"),&Theme::_get_constant_list); - ObjectTypeDB::bind_method(_MD("set_default_font","font"),&Theme::set_default_theme_font); - ObjectTypeDB::bind_method(_MD("get_default_font"),&Theme::get_default_theme_font); + ClassDB::bind_method(_MD("set_default_font","font"),&Theme::set_default_theme_font); + ClassDB::bind_method(_MD("get_default_font"),&Theme::get_default_theme_font); - ObjectTypeDB::bind_method(_MD("get_type_list","type"),&Theme::_get_type_list); + ClassDB::bind_method(_MD("get_type_list","type"),&Theme::_get_type_list); - ObjectTypeDB::bind_method(_MD("_emit_theme_changed"),&Theme::_emit_theme_changed); + ClassDB::bind_method(_MD("_emit_theme_changed"),&Theme::_emit_theme_changed); - ObjectTypeDB::bind_method("copy_default_theme",&Theme::copy_default_theme); + ClassDB::bind_method("copy_default_theme",&Theme::copy_default_theme); ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"default_font",PROPERTY_HINT_RESOURCE_TYPE,"Font"),_SCS("set_default_font"),_SCS("get_default_font")); diff --git a/scene/resources/theme.h b/scene/resources/theme.h index 1856bd4979..e9d890cf97 100644 --- a/scene/resources/theme.h +++ b/scene/resources/theme.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -41,7 +41,7 @@ */ class Theme : public Resource { - OBJ_TYPE( Theme, Resource ); + GDCLASS( Theme, Resource ); RES_BASE_EXTENSION("thm"); static Ref<Theme> default_theme; @@ -72,13 +72,13 @@ protected: Ref<Font> default_theme_font; - DVector<String> _get_icon_list(const String& p_type) const { DVector<String> ilret; List<StringName> il; get_icon_list(p_type,&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } - DVector<String> _get_stylebox_list(const String& p_type) const { DVector<String> ilret; List<StringName> il; get_stylebox_list(p_type,&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } - DVector<String> _get_stylebox_types(void) const { DVector<String> ilret; List<StringName> il; get_stylebox_types(&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } - DVector<String> _get_font_list(const String& p_type) const { DVector<String> ilret; List<StringName> il; get_font_list(p_type,&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } - DVector<String> _get_color_list(const String& p_type) const { DVector<String> ilret; List<StringName> il; get_color_list(p_type,&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } - DVector<String> _get_constant_list(const String& p_type) const { DVector<String> ilret; List<StringName> il; get_constant_list(p_type,&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } - DVector<String> _get_type_list(const String& p_type) const { DVector<String> ilret; List<StringName> il; get_type_list(&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } + PoolVector<String> _get_icon_list(const String& p_type) const { PoolVector<String> ilret; List<StringName> il; get_icon_list(p_type,&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } + PoolVector<String> _get_stylebox_list(const String& p_type) const { PoolVector<String> ilret; List<StringName> il; get_stylebox_list(p_type,&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } + PoolVector<String> _get_stylebox_types(void) const { PoolVector<String> ilret; List<StringName> il; get_stylebox_types(&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } + PoolVector<String> _get_font_list(const String& p_type) const { PoolVector<String> ilret; List<StringName> il; get_font_list(p_type,&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } + PoolVector<String> _get_color_list(const String& p_type) const { PoolVector<String> ilret; List<StringName> il; get_color_list(p_type,&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } + PoolVector<String> _get_constant_list(const String& p_type) const { PoolVector<String> ilret; List<StringName> il; get_constant_list(p_type,&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } + PoolVector<String> _get_type_list(const String& p_type) const { PoolVector<String> ilret; List<StringName> il; get_type_list(&il); for(List<StringName>::Element *E=il.front();E;E=E->next()) { ilret.push_back(E->get()); } return ilret; } static void _bind_methods(); public: diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index bf01929191..1811dee384 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -407,37 +407,37 @@ void TileSet::clear() { void TileSet::_bind_methods() { - ObjectTypeDB::bind_method(_MD("create_tile","id"),&TileSet::create_tile); - ObjectTypeDB::bind_method(_MD("tile_set_name","id","name"),&TileSet::tile_set_name); - ObjectTypeDB::bind_method(_MD("tile_get_name","id"),&TileSet::tile_get_name); - ObjectTypeDB::bind_method(_MD("tile_set_texture","id","texture:Texture"),&TileSet::tile_set_texture); - ObjectTypeDB::bind_method(_MD("tile_get_texture:Texture","id"),&TileSet::tile_get_texture); - ObjectTypeDB::bind_method(_MD("tile_set_material","id","material:CanvasItemMaterial"),&TileSet::tile_set_material); - ObjectTypeDB::bind_method(_MD("tile_get_material:CanvasItemMaterial","id"),&TileSet::tile_get_material); - ObjectTypeDB::bind_method(_MD("tile_set_texture_offset","id","texture_offset"),&TileSet::tile_set_texture_offset); - ObjectTypeDB::bind_method(_MD("tile_get_texture_offset","id"),&TileSet::tile_get_texture_offset); - ObjectTypeDB::bind_method(_MD("tile_set_shape_offset","id","shape_offset"),&TileSet::tile_set_shape_offset); - ObjectTypeDB::bind_method(_MD("tile_get_shape_offset","id"),&TileSet::tile_get_shape_offset); - ObjectTypeDB::bind_method(_MD("tile_set_region","id","region"),&TileSet::tile_set_region); - ObjectTypeDB::bind_method(_MD("tile_get_region","id"),&TileSet::tile_get_region); - ObjectTypeDB::bind_method(_MD("tile_set_shape","id","shape:Shape2D"),&TileSet::tile_set_shape); - ObjectTypeDB::bind_method(_MD("tile_get_shape:Shape2D","id"),&TileSet::tile_get_shape); - ObjectTypeDB::bind_method(_MD("tile_set_shapes","id","shapes"),&TileSet::_tile_set_shapes); - ObjectTypeDB::bind_method(_MD("tile_get_shapes","id"),&TileSet::_tile_get_shapes); - ObjectTypeDB::bind_method(_MD("tile_set_navigation_polygon","id","navigation_polygon:NavigationPolygon"),&TileSet::tile_set_navigation_polygon); - ObjectTypeDB::bind_method(_MD("tile_get_navigation_polygon:NavigationPolygon","id"),&TileSet::tile_get_navigation_polygon); - ObjectTypeDB::bind_method(_MD("tile_set_navigation_polygon_offset","id","navigation_polygon_offset"),&TileSet::tile_set_navigation_polygon_offset); - ObjectTypeDB::bind_method(_MD("tile_get_navigation_polygon_offset","id"),&TileSet::tile_get_navigation_polygon_offset); - ObjectTypeDB::bind_method(_MD("tile_set_light_occluder","id","light_occluder:OccluderPolygon2D"),&TileSet::tile_set_light_occluder); - ObjectTypeDB::bind_method(_MD("tile_get_light_occluder:OccluderPolygon2D","id"),&TileSet::tile_get_light_occluder); - ObjectTypeDB::bind_method(_MD("tile_set_occluder_offset","id","occluder_offset"),&TileSet::tile_set_occluder_offset); - ObjectTypeDB::bind_method(_MD("tile_get_occluder_offset","id"),&TileSet::tile_get_occluder_offset); - - ObjectTypeDB::bind_method(_MD("remove_tile","id"),&TileSet::remove_tile); - ObjectTypeDB::bind_method(_MD("clear"),&TileSet::clear); - ObjectTypeDB::bind_method(_MD("get_last_unused_tile_id"),&TileSet::get_last_unused_tile_id); - ObjectTypeDB::bind_method(_MD("find_tile_by_name","name"),&TileSet::find_tile_by_name); - ObjectTypeDB::bind_method(_MD("get_tiles_ids", "name"), &TileSet::_get_tiles_ids); + ClassDB::bind_method(_MD("create_tile","id"),&TileSet::create_tile); + ClassDB::bind_method(_MD("tile_set_name","id","name"),&TileSet::tile_set_name); + ClassDB::bind_method(_MD("tile_get_name","id"),&TileSet::tile_get_name); + ClassDB::bind_method(_MD("tile_set_texture","id","texture:Texture"),&TileSet::tile_set_texture); + ClassDB::bind_method(_MD("tile_get_texture:Texture","id"),&TileSet::tile_get_texture); + ClassDB::bind_method(_MD("tile_set_material","id","material:CanvasItemMaterial"),&TileSet::tile_set_material); + ClassDB::bind_method(_MD("tile_get_material:CanvasItemMaterial","id"),&TileSet::tile_get_material); + ClassDB::bind_method(_MD("tile_set_texture_offset","id","texture_offset"),&TileSet::tile_set_texture_offset); + ClassDB::bind_method(_MD("tile_get_texture_offset","id"),&TileSet::tile_get_texture_offset); + ClassDB::bind_method(_MD("tile_set_shape_offset","id","shape_offset"),&TileSet::tile_set_shape_offset); + ClassDB::bind_method(_MD("tile_get_shape_offset","id"),&TileSet::tile_get_shape_offset); + ClassDB::bind_method(_MD("tile_set_region","id","region"),&TileSet::tile_set_region); + ClassDB::bind_method(_MD("tile_get_region","id"),&TileSet::tile_get_region); + ClassDB::bind_method(_MD("tile_set_shape","id","shape:Shape2D"),&TileSet::tile_set_shape); + ClassDB::bind_method(_MD("tile_get_shape:Shape2D","id"),&TileSet::tile_get_shape); + ClassDB::bind_method(_MD("tile_set_shapes","id","shapes"),&TileSet::_tile_set_shapes); + ClassDB::bind_method(_MD("tile_get_shapes","id"),&TileSet::_tile_get_shapes); + ClassDB::bind_method(_MD("tile_set_navigation_polygon","id","navigation_polygon:NavigationPolygon"),&TileSet::tile_set_navigation_polygon); + ClassDB::bind_method(_MD("tile_get_navigation_polygon:NavigationPolygon","id"),&TileSet::tile_get_navigation_polygon); + ClassDB::bind_method(_MD("tile_set_navigation_polygon_offset","id","navigation_polygon_offset"),&TileSet::tile_set_navigation_polygon_offset); + ClassDB::bind_method(_MD("tile_get_navigation_polygon_offset","id"),&TileSet::tile_get_navigation_polygon_offset); + ClassDB::bind_method(_MD("tile_set_light_occluder","id","light_occluder:OccluderPolygon2D"),&TileSet::tile_set_light_occluder); + ClassDB::bind_method(_MD("tile_get_light_occluder:OccluderPolygon2D","id"),&TileSet::tile_get_light_occluder); + ClassDB::bind_method(_MD("tile_set_occluder_offset","id","occluder_offset"),&TileSet::tile_set_occluder_offset); + ClassDB::bind_method(_MD("tile_get_occluder_offset","id"),&TileSet::tile_get_occluder_offset); + + ClassDB::bind_method(_MD("remove_tile","id"),&TileSet::remove_tile); + ClassDB::bind_method(_MD("clear"),&TileSet::clear); + ClassDB::bind_method(_MD("get_last_unused_tile_id"),&TileSet::get_last_unused_tile_id); + ClassDB::bind_method(_MD("find_tile_by_name","name"),&TileSet::find_tile_by_name); + ClassDB::bind_method(_MD("get_tiles_ids", "name"), &TileSet::_get_tiles_ids); } diff --git a/scene/resources/tile_set.h b/scene/resources/tile_set.h index fb0e832c1e..ce40e5ebe3 100644 --- a/scene/resources/tile_set.h +++ b/scene/resources/tile_set.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ class TileSet : public Resource { - OBJ_TYPE( TileSet, Resource ); + GDCLASS( TileSet, Resource ); struct Data { diff --git a/scene/resources/video_stream.cpp b/scene/resources/video_stream.cpp index 8e16f2e024..84186616d7 100644 --- a/scene/resources/video_stream.cpp +++ b/scene/resources/video_stream.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/scene/resources/video_stream.h b/scene/resources/video_stream.h index b05a7cf773..bcd25c0336 100644 --- a/scene/resources/video_stream.h +++ b/scene/resources/video_stream.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class VideoStreamPlayback : public Resource { - OBJ_TYPE(VideoStreamPlayback,Resource); + GDCLASS(VideoStreamPlayback,Resource); protected: static void _bind_methods(); @@ -77,7 +77,7 @@ public: class VideoStream : public Resource { - OBJ_TYPE( VideoStream, Resource ); + GDCLASS( VideoStream, Resource ); OBJ_SAVE_TYPE( VideoStream ); //children are all saved as AudioStream, so they can be exchanged public: diff --git a/scene/resources/world.cpp b/scene/resources/world.cpp index 1aeea5fa43..3f7261c312 100644 --- a/scene/resources/world.cpp +++ b/scene/resources/world.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -41,7 +41,7 @@ struct SpatialIndexer { struct NotifierData { - AABB aabb; + Rect3 aabb; OctreeElementID id; }; @@ -64,7 +64,7 @@ struct SpatialIndexer { uint64_t pass; uint64_t last_frame; - void _notifier_add(VisibilityNotifier* p_notifier,const AABB& p_rect) { + void _notifier_add(VisibilityNotifier* p_notifier,const Rect3& p_rect) { ERR_FAIL_COND(notifiers.has(p_notifier)); notifiers[p_notifier].aabb=p_rect; @@ -73,7 +73,7 @@ struct SpatialIndexer { } - void _notifier_update(VisibilityNotifier* p_notifier,const AABB& p_rect) { + void _notifier_update(VisibilityNotifier* p_notifier,const Rect3& p_rect) { Map<VisibilityNotifier*,NotifierData>::Element *E=notifiers.find(p_notifier); ERR_FAIL_COND(!E); @@ -246,14 +246,14 @@ void World::_remove_camera(Camera* p_camera){ -void World::_register_notifier(VisibilityNotifier* p_notifier,const AABB& p_rect){ +void World::_register_notifier(VisibilityNotifier* p_notifier,const Rect3& p_rect){ #ifndef _3D_DISABLED indexer->_notifier_add(p_notifier,p_rect); #endif } -void World::_update_notifier(VisibilityNotifier* p_notifier,const AABB& p_rect){ +void World::_update_notifier(VisibilityNotifier* p_notifier,const Rect3& p_rect){ #ifndef _3D_DISABLED indexer->_notifier_update(p_notifier,p_rect); @@ -314,12 +314,12 @@ PhysicsDirectSpaceState *World::get_direct_space_state() { void World::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_space"),&World::get_space); - ObjectTypeDB::bind_method(_MD("get_scenario"),&World::get_scenario); - ObjectTypeDB::bind_method(_MD("get_sound_space"),&World::get_sound_space); - ObjectTypeDB::bind_method(_MD("set_environment","env:Environment"),&World::set_environment); - ObjectTypeDB::bind_method(_MD("get_environment:Environment"),&World::get_environment); - ObjectTypeDB::bind_method(_MD("get_direct_space_state:PhysicsDirectSpaceState"),&World::get_direct_space_state); + ClassDB::bind_method(_MD("get_space"),&World::get_space); + ClassDB::bind_method(_MD("get_scenario"),&World::get_scenario); + ClassDB::bind_method(_MD("get_sound_space"),&World::get_sound_space); + ClassDB::bind_method(_MD("set_environment","env:Environment"),&World::set_environment); + ClassDB::bind_method(_MD("get_environment:Environment"),&World::get_environment); + ClassDB::bind_method(_MD("get_direct_space_state:PhysicsDirectSpaceState"),&World::get_direct_space_state); ADD_PROPERTY(PropertyInfo(Variant::OBJECT,"environment",PROPERTY_HINT_RESOURCE_TYPE,"Environment"),_SCS("set_environment"),_SCS("get_environment")); } @@ -332,10 +332,10 @@ World::World() { sound_space = SpatialSoundServer::get_singleton()->space_create(); PhysicsServer::get_singleton()->space_set_active(space,true); - PhysicsServer::get_singleton()->area_set_param(space,PhysicsServer::AREA_PARAM_GRAVITY,GLOBAL_DEF("physics/default_gravity",9.8)); - PhysicsServer::get_singleton()->area_set_param(space,PhysicsServer::AREA_PARAM_GRAVITY_VECTOR,GLOBAL_DEF("physics/default_gravity_vector",Vector3(0,-1,0))); - PhysicsServer::get_singleton()->area_set_param(space,PhysicsServer::AREA_PARAM_LINEAR_DAMP,GLOBAL_DEF("physics/default_linear_damp",0.1)); - PhysicsServer::get_singleton()->area_set_param(space,PhysicsServer::AREA_PARAM_ANGULAR_DAMP,GLOBAL_DEF("physics/default_angular_damp",0.1)); + PhysicsServer::get_singleton()->area_set_param(space,PhysicsServer::AREA_PARAM_GRAVITY,GLOBAL_DEF("physics/3d/default_gravity",9.8)); + PhysicsServer::get_singleton()->area_set_param(space,PhysicsServer::AREA_PARAM_GRAVITY_VECTOR,GLOBAL_DEF("physics/3d/default_gravity_vector",Vector3(0,-1,0))); + PhysicsServer::get_singleton()->area_set_param(space,PhysicsServer::AREA_PARAM_LINEAR_DAMP,GLOBAL_DEF("physics/3d/default_linear_damp",0.1)); + PhysicsServer::get_singleton()->area_set_param(space,PhysicsServer::AREA_PARAM_ANGULAR_DAMP,GLOBAL_DEF("physics/3d/default_angular_damp",0.1)); #ifdef _3D_DISABLED indexer = NULL; diff --git a/scene/resources/world.h b/scene/resources/world.h index 5a74f27235..bea07882d7 100644 --- a/scene/resources/world.h +++ b/scene/resources/world.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -40,7 +40,7 @@ class Camera; class VisibilityNotifier; class World : public Resource { - OBJ_TYPE(World, Resource); + GDCLASS(World, Resource); RES_BASE_EXTENSION("wrd"); private: RID space; @@ -60,8 +60,8 @@ friend class VisibilityNotifier; void _update_camera(Camera* p_camera); void _remove_camera(Camera* p_camera); - void _register_notifier(VisibilityNotifier* p_notifier,const AABB& p_rect); - void _update_notifier(VisibilityNotifier *p_notifier,const AABB& p_rect); + void _register_notifier(VisibilityNotifier* p_notifier,const Rect3& p_rect); + void _update_notifier(VisibilityNotifier *p_notifier,const Rect3& p_rect); void _remove_notifier(VisibilityNotifier* p_notifier); friend class Viewport; void _update(uint64_t p_frame); diff --git a/scene/resources/world_2d.cpp b/scene/resources/world_2d.cpp index df3a374fc9..98c5ae3bb9 100644 --- a/scene/resources/world_2d.cpp +++ b/scene/resources/world_2d.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -382,11 +382,11 @@ RID World2D::get_sound_space() { void World2D::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_canvas"),&World2D::get_canvas); - ObjectTypeDB::bind_method(_MD("get_space"),&World2D::get_space); - ObjectTypeDB::bind_method(_MD("get_sound_space"),&World2D::get_sound_space); + ClassDB::bind_method(_MD("get_canvas"),&World2D::get_canvas); + ClassDB::bind_method(_MD("get_space"),&World2D::get_space); + ClassDB::bind_method(_MD("get_sound_space"),&World2D::get_sound_space); - ObjectTypeDB::bind_method(_MD("get_direct_space_state:Physics2DDirectSpaceState"),&World2D::get_direct_space_state); + ClassDB::bind_method(_MD("get_direct_space_state:Physics2DDirectSpaceState"),&World2D::get_direct_space_state); } @@ -404,18 +404,16 @@ World2D::World2D() { //set space2D to be more friendly with pixels than meters, by adjusting some constants Physics2DServer::get_singleton()->space_set_active(space,true); - Physics2DServer::get_singleton()->area_set_param(space,Physics2DServer::AREA_PARAM_GRAVITY,GLOBAL_DEF("physics_2d/default_gravity",98)); - Physics2DServer::get_singleton()->area_set_param(space,Physics2DServer::AREA_PARAM_GRAVITY_VECTOR,GLOBAL_DEF("physics_2d/default_gravity_vector",Vector2(0,1))); + Physics2DServer::get_singleton()->area_set_param(space,Physics2DServer::AREA_PARAM_GRAVITY,GLOBAL_DEF("physics/2d/default_gravity",98)); + Physics2DServer::get_singleton()->area_set_param(space,Physics2DServer::AREA_PARAM_GRAVITY_VECTOR,GLOBAL_DEF("physics/2d/default_gravity_vector",Vector2(0,1))); // TODO: Remove this deprecation warning and compatibility code for 2.2 or 3.0 - if (Globals::get_singleton()->get("physics_2d/default_density") && !Globals::get_singleton()->get("physics_2d/default_linear_damp")) { - WARN_PRINT("Deprecated parameter 'physics_2d/default_density'. It was renamed to 'physics_2d/default_linear_damp', adjusting your project settings accordingly (make sure to adjust scripts that potentially rely on 'physics_2d/default_density'."); - Globals::get_singleton()->set("physics_2d/default_linear_damp", Globals::get_singleton()->get("physics_2d/default_density")); - Globals::get_singleton()->set_persisting("physics_2d/default_linear_damp", true); - Globals::get_singleton()->set_persisting("physics_2d/default_density", false); - Globals::get_singleton()->save(); + if (GlobalConfig::get_singleton()->get("physics/2d/default_density") && !GlobalConfig::get_singleton()->get("physics/2d/default_linear_damp")) { + WARN_PRINT("Deprecated parameter 'physics/2d/default_density'. It was renamed to 'physics/2d/default_linear_damp', adjusting your project settings accordingly (make sure to adjust scripts that potentially rely on 'physics/2d/default_density'."); + GlobalConfig::get_singleton()->set("physics/2d/default_linear_damp", GlobalConfig::get_singleton()->get("physics/2d/default_density")); + GlobalConfig::get_singleton()->save(); } - Physics2DServer::get_singleton()->area_set_param(space,Physics2DServer::AREA_PARAM_LINEAR_DAMP,GLOBAL_DEF("physics_2d/default_linear_damp",0.1)); - Physics2DServer::get_singleton()->area_set_param(space,Physics2DServer::AREA_PARAM_ANGULAR_DAMP,GLOBAL_DEF("physics_2d/default_angular_damp",1)); + Physics2DServer::get_singleton()->area_set_param(space,Physics2DServer::AREA_PARAM_LINEAR_DAMP,GLOBAL_DEF("physics/2d/default_linear_damp",0.1)); + Physics2DServer::get_singleton()->area_set_param(space,Physics2DServer::AREA_PARAM_ANGULAR_DAMP,GLOBAL_DEF("physics/2d/default_angular_damp",1)); indexer = memnew( SpatialIndexer2D ); } diff --git a/scene/resources/world_2d.h b/scene/resources/world_2d.h index d52189bcd4..a9110b3bd9 100644 --- a/scene/resources/world_2d.h +++ b/scene/resources/world_2d.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,7 +39,7 @@ class Viewport; class World2D : public Resource { - OBJ_TYPE( World2D, Resource ); + GDCLASS( World2D, Resource ); RID canvas; RID space; diff --git a/scene/scene_string_names.cpp b/scene/scene_string_names.cpp index 164ae55c9f..bbca64f304 100644 --- a/scene/scene_string_names.cpp +++ b/scene/scene_string_names.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -51,6 +51,7 @@ SceneStringNames::SceneStringNames() { sleeping_state_changed=StaticCString::create("sleeping_state_changed"); finished=StaticCString::create("finished"); + animation_finished=StaticCString::create("animation_finished"); animation_changed=StaticCString::create("animation_changed"); animation_started=StaticCString::create("animation_started"); @@ -116,6 +117,12 @@ SceneStringNames::SceneStringNames() { _input_event=StaticCString::create("_input_event"); + gui_input=StaticCString::create("gui_input"); + _gui_input=StaticCString::create("_gui_input"); + + _unhandled_input=StaticCString::create("_unhandled_input"); + _unhandled_key_input=StaticCString::create("_unhandled_key_input"); + changed=StaticCString::create("changed"); _shader_changed=StaticCString::create("_shader_changed"); diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h index 32e51ce8f4..c12ce83c62 100644 --- a/scene/scene_string_names.h +++ b/scene/scene_string_names.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -54,6 +54,8 @@ public: StringName visibility_changed; StringName input_event; StringName _input_event; + StringName gui_input; + StringName _gui_input; StringName item_rect_changed; StringName shader_shader; StringName shader_unshaded; @@ -78,6 +80,7 @@ public: StringName sort_children; StringName finished; + StringName animation_finished; StringName animation_changed; StringName animation_started; @@ -105,6 +108,8 @@ public: StringName _draw; StringName _input; StringName _ready; + StringName _unhandled_input; + StringName _unhandled_key_input; StringName _pressed; StringName _toggled; diff --git a/servers/audio/audio_driver_dummy.cpp b/servers/audio/audio_driver_dummy.cpp index d0695451b9..6fe14b0fcb 100644 --- a/servers/audio/audio_driver_dummy.cpp +++ b/servers/audio/audio_driver_dummy.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio/audio_driver_dummy.h b/servers/audio/audio_driver_dummy.h index 9421574f93..c91a0db43a 100644 --- a/servers/audio/audio_driver_dummy.h +++ b/servers/audio/audio_driver_dummy.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio/audio_filter_sw.cpp b/servers/audio/audio_filter_sw.cpp index 3fb8e8f734..cdfe1a29f0 100644 --- a/servers/audio/audio_filter_sw.cpp +++ b/servers/audio/audio_filter_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio/audio_filter_sw.h b/servers/audio/audio_filter_sw.h index d4d225ce29..0f3e2410fd 100644 --- a/servers/audio/audio_filter_sw.h +++ b/servers/audio/audio_filter_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio/audio_mixer_sw.cpp b/servers/audio/audio_mixer_sw.cpp index 17f8c36c9a..faed6905ea 100644 --- a/servers/audio/audio_mixer_sw.cpp +++ b/servers/audio/audio_mixer_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio/audio_mixer_sw.h b/servers/audio/audio_mixer_sw.h index e924b518cc..952cad4cfa 100644 --- a/servers/audio/audio_mixer_sw.h +++ b/servers/audio/audio_mixer_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio/audio_rb_resampler.cpp b/servers/audio/audio_rb_resampler.cpp index aa4fca3a62..28f0007b5b 100644 --- a/servers/audio/audio_rb_resampler.cpp +++ b/servers/audio/audio_rb_resampler.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio/audio_rb_resampler.h b/servers/audio/audio_rb_resampler.h index 22643e4e82..e97e275b68 100644 --- a/servers/audio/audio_rb_resampler.h +++ b/servers/audio/audio_rb_resampler.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio/audio_server_sw.cpp b/servers/audio/audio_server_sw.cpp index 853714be2a..f508a130b4 100644 --- a/servers/audio/audio_server_sw.cpp +++ b/servers/audio/audio_server_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -384,11 +384,11 @@ const void* AudioServerSW::sample_get_data_ptr(RID p_sample) const { return sample_manager->sample_get_data_ptr(p_sample); } -void AudioServerSW::sample_set_data(RID p_sample, const DVector<uint8_t>& p_buffer) { +void AudioServerSW::sample_set_data(RID p_sample, const PoolVector<uint8_t>& p_buffer) { AUDIO_LOCK sample_manager->sample_set_data(p_sample,p_buffer); } -DVector<uint8_t> AudioServerSW::sample_get_data(RID p_sample) const { +PoolVector<uint8_t> AudioServerSW::sample_get_data(RID p_sample) const { AUDIO_LOCK return sample_manager->sample_get_data(p_sample); } @@ -943,7 +943,7 @@ AudioServerSW::AudioServerSW(SampleManagerSW *p_sample_manager) { sample_manager=p_sample_manager; String interp = GLOBAL_DEF("audio/mixer_interp","linear"); - Globals::get_singleton()->set_custom_property_info("audio/mixer_interp",PropertyInfo(Variant::STRING,"audio/mixer_interp",PROPERTY_HINT_ENUM,"raw,linear,cubic")); + GlobalConfig::get_singleton()->set_custom_property_info("audio/mixer_interp",PropertyInfo(Variant::STRING,"audio/mixer_interp",PROPERTY_HINT_ENUM,"raw,linear,cubic")); if (interp=="raw") mixer_interp=AudioMixerSW::INTERPOLATION_RAW; else if (interp=="cubic") diff --git a/servers/audio/audio_server_sw.h b/servers/audio/audio_server_sw.h index fda952fa94..52b45351c3 100644 --- a/servers/audio/audio_server_sw.h +++ b/servers/audio/audio_server_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ #include "os/thread.h" class AudioServerSW : public AudioServer { - OBJ_TYPE( AudioServerSW, AudioServer ); + GDCLASS( AudioServerSW, AudioServer ); _THREAD_SAFE_CLASS_ @@ -53,7 +53,7 @@ class AudioServerSW : public AudioServer { virtual AudioMixer *get_mixer(); virtual void audio_mixer_chunk_callback(int p_frames); - struct Voice { + struct Voice : public RID_Data { float volume; volatile bool active; @@ -67,7 +67,7 @@ class AudioServerSW : public AudioServer { mutable RID_Owner<Voice> voice_owner; SelfList<Voice>::List active_list; - struct Stream { + struct Stream : public RID_Data { bool active; List<Stream*>::Element *E; AudioStream *audio_stream; @@ -125,8 +125,8 @@ public: virtual int sample_get_length(RID p_sample) const; const void* sample_get_data_ptr(RID p_sample) const; - virtual void sample_set_data(RID p_sample, const DVector<uint8_t>& p_buffer); - virtual DVector<uint8_t> sample_get_data(RID p_sample) const; + virtual void sample_set_data(RID p_sample, const PoolVector<uint8_t>& p_buffer); + virtual PoolVector<uint8_t> sample_get_data(RID p_sample) const; virtual void sample_set_mix_rate(RID p_sample,int p_rate); virtual int sample_get_mix_rate(RID p_sample) const; diff --git a/servers/audio/reverb_sw.cpp b/servers/audio/reverb_sw.cpp index 5721403ba3..0050dbedeb 100644 --- a/servers/audio/reverb_sw.cpp +++ b/servers/audio/reverb_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio/reverb_sw.h b/servers/audio/reverb_sw.h index b028a245c8..d9f16a5fbb 100644 --- a/servers/audio/reverb_sw.h +++ b/servers/audio/reverb_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio/sample_manager_sw.cpp b/servers/audio/sample_manager_sw.cpp index 60f4d16659..fe4cc36776 100644 --- a/servers/audio/sample_manager_sw.cpp +++ b/servers/audio/sample_manager_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -125,7 +125,7 @@ int SampleManagerMallocSW::sample_get_length(RID p_sample) const { return s->length; } -void SampleManagerMallocSW::sample_set_data(RID p_sample, const DVector<uint8_t>& p_buffer) { +void SampleManagerMallocSW::sample_set_data(RID p_sample, const PoolVector<uint8_t>& p_buffer) { Sample *s = sample_owner.get(p_sample); ERR_FAIL_COND(!s); @@ -137,7 +137,7 @@ void SampleManagerMallocSW::sample_set_data(RID p_sample, const DVector<uint8_t> ERR_EXPLAIN("Sample buffer size does not match sample size."); //print_line("len bytes: "+itos(s->length_bytes)+" bufsize: "+itos(buff_size)); ERR_FAIL_COND(s->length_bytes!=buff_size); - DVector<uint8_t>::Read buffer_r=p_buffer.read(); + PoolVector<uint8_t>::Read buffer_r=p_buffer.read(); const uint8_t *src = buffer_r.ptr(); uint8_t *dst = (uint8_t*)s->data; //print_line("set data: "+itos(s->length_bytes)); @@ -181,14 +181,14 @@ void SampleManagerMallocSW::sample_set_data(RID p_sample, const DVector<uint8_t> } -const DVector<uint8_t> SampleManagerMallocSW::sample_get_data(RID p_sample) const { +const PoolVector<uint8_t> SampleManagerMallocSW::sample_get_data(RID p_sample) const { Sample *s = sample_owner.get(p_sample); - ERR_FAIL_COND_V(!s,DVector<uint8_t>()); + ERR_FAIL_COND_V(!s,PoolVector<uint8_t>()); - DVector<uint8_t> ret_buffer; + PoolVector<uint8_t> ret_buffer; ret_buffer.resize(s->length_bytes); - DVector<uint8_t>::Write buffer_w=ret_buffer.write(); + PoolVector<uint8_t>::Write buffer_w=ret_buffer.write(); uint8_t *dst = buffer_w.ptr(); const uint8_t *src = (const uint8_t*)s->data; @@ -197,7 +197,7 @@ const DVector<uint8_t> SampleManagerMallocSW::sample_get_data(RID p_sample) cons dst[i]=src[i]; } - buffer_w = DVector<uint8_t>::Write(); //unlock + buffer_w = PoolVector<uint8_t>::Write(); //unlock return ret_buffer; } diff --git a/servers/audio/sample_manager_sw.h b/servers/audio/sample_manager_sw.h index bd7a11a3d2..93cad96f1a 100644 --- a/servers/audio/sample_manager_sw.h +++ b/servers/audio/sample_manager_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -45,8 +45,8 @@ public: virtual bool sample_is_stereo(RID p_sample) const=0; virtual int sample_get_length(RID p_sample) const=0; - virtual void sample_set_data(RID p_sample, const DVector<uint8_t>& p_buffer)=0; - virtual const DVector<uint8_t> sample_get_data(RID p_sample) const=0; + virtual void sample_set_data(RID p_sample, const PoolVector<uint8_t>& p_buffer)=0; + virtual const PoolVector<uint8_t> sample_get_data(RID p_sample) const=0; virtual void *sample_get_data_ptr(RID p_sample) const=0; @@ -74,7 +74,7 @@ public: class SampleManagerMallocSW : public SampleManagerSW { - struct Sample { + struct Sample : public RID_Data { void *data; int length; @@ -102,8 +102,8 @@ public: virtual bool sample_is_stereo(RID p_sample) const; virtual int sample_get_length(RID p_sample) const; - virtual void sample_set_data(RID p_sample, const DVector<uint8_t>& p_buffer); - virtual const DVector<uint8_t> sample_get_data(RID p_sample) const; + virtual void sample_set_data(RID p_sample, const PoolVector<uint8_t>& p_buffer); + virtual const PoolVector<uint8_t> sample_get_data(RID p_sample) const; virtual void *sample_get_data_ptr(RID p_sample) const; diff --git a/servers/audio/voice_rb_sw.h b/servers/audio/voice_rb_sw.h index f785646577..cbf1392482 100644 --- a/servers/audio/voice_rb_sw.h +++ b/servers/audio/voice_rb_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp index 1f0a2e403a..5037b19924 100644 --- a/servers/audio_server.cpp +++ b/servers/audio_server.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -46,7 +46,7 @@ AudioServer *AudioServer::get_singleton() { return singleton; } -void AudioServer::sample_set_signed_data(RID p_sample, const DVector<float>& p_buffer) { +void AudioServer::sample_set_signed_data(RID p_sample, const PoolVector<float>& p_buffer) { SampleFormat format = sample_get_format(p_sample); @@ -56,9 +56,9 @@ void AudioServer::sample_set_signed_data(RID p_sample, const DVector<float>& p_b int len = p_buffer.size(); ERR_FAIL_COND( len == 0 ); - DVector<uint8_t> data; - DVector<uint8_t>::Write w; - DVector<float>::Read r = p_buffer.read(); + PoolVector<uint8_t> data; + PoolVector<uint8_t>::Write w; + PoolVector<float>::Read r = p_buffer.read(); switch(format) { case SAMPLE_FORMAT_PCM8: { @@ -95,7 +95,7 @@ void AudioServer::sample_set_signed_data(RID p_sample, const DVector<float>& p_b } break; } - w = DVector<uint8_t>::Write(); + w = PoolVector<uint8_t>::Write(); sample_set_data(p_sample,data); @@ -104,69 +104,69 @@ void AudioServer::sample_set_signed_data(RID p_sample, const DVector<float>& p_b void AudioServer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("sample_create","format","stereo","length"), &AudioServer::sample_create ); - ObjectTypeDB::bind_method(_MD("sample_set_description","sample","description"), &AudioServer::sample_set_description ); - ObjectTypeDB::bind_method(_MD("sample_get_description","sample"), &AudioServer::sample_get_description ); + ClassDB::bind_method(_MD("sample_create","format","stereo","length"), &AudioServer::sample_create ); + ClassDB::bind_method(_MD("sample_set_description","sample","description"), &AudioServer::sample_set_description ); + ClassDB::bind_method(_MD("sample_get_description","sample"), &AudioServer::sample_get_description ); - ObjectTypeDB::bind_method(_MD("sample_get_format","sample"), &AudioServer::sample_get_format ); - ObjectTypeDB::bind_method(_MD("sample_is_stereo","sample"), &AudioServer::sample_is_stereo ); - ObjectTypeDB::bind_method(_MD("sample_get_length","sample"), &AudioServer::sample_get_length ); + ClassDB::bind_method(_MD("sample_get_format","sample"), &AudioServer::sample_get_format ); + ClassDB::bind_method(_MD("sample_is_stereo","sample"), &AudioServer::sample_is_stereo ); + ClassDB::bind_method(_MD("sample_get_length","sample"), &AudioServer::sample_get_length ); - ObjectTypeDB::bind_method(_MD("sample_set_signed_data","sample","data"), &AudioServer::sample_set_signed_data ); - ObjectTypeDB::bind_method(_MD("sample_set_data","sample","data"), &AudioServer::sample_set_data ); - ObjectTypeDB::bind_method(_MD("sample_get_data","sample"), &AudioServer::sample_get_data ); + ClassDB::bind_method(_MD("sample_set_signed_data","sample","data"), &AudioServer::sample_set_signed_data ); + ClassDB::bind_method(_MD("sample_set_data","sample","data"), &AudioServer::sample_set_data ); + ClassDB::bind_method(_MD("sample_get_data","sample"), &AudioServer::sample_get_data ); - ObjectTypeDB::bind_method(_MD("sample_set_mix_rate","sample","mix_rate"), &AudioServer::sample_set_mix_rate ); - ObjectTypeDB::bind_method(_MD("sample_get_mix_rate","sample"), &AudioServer::sample_get_mix_rate ); + ClassDB::bind_method(_MD("sample_set_mix_rate","sample","mix_rate"), &AudioServer::sample_set_mix_rate ); + ClassDB::bind_method(_MD("sample_get_mix_rate","sample"), &AudioServer::sample_get_mix_rate ); - ObjectTypeDB::bind_method(_MD("sample_set_loop_format","sample","loop_format"), &AudioServer::sample_set_loop_format ); - ObjectTypeDB::bind_method(_MD("sample_get_loop_format","sample"), &AudioServer::sample_get_loop_format ); + ClassDB::bind_method(_MD("sample_set_loop_format","sample","loop_format"), &AudioServer::sample_set_loop_format ); + ClassDB::bind_method(_MD("sample_get_loop_format","sample"), &AudioServer::sample_get_loop_format ); - ObjectTypeDB::bind_method(_MD("sample_set_loop_begin","sample","pos"), &AudioServer::sample_set_loop_begin ); - ObjectTypeDB::bind_method(_MD("sample_get_loop_begin","sample"), &AudioServer::sample_get_loop_begin ); + ClassDB::bind_method(_MD("sample_set_loop_begin","sample","pos"), &AudioServer::sample_set_loop_begin ); + ClassDB::bind_method(_MD("sample_get_loop_begin","sample"), &AudioServer::sample_get_loop_begin ); - ObjectTypeDB::bind_method(_MD("sample_set_loop_end","sample","pos"), &AudioServer::sample_set_loop_end ); - ObjectTypeDB::bind_method(_MD("sample_get_loop_end","sample"), &AudioServer::sample_get_loop_end ); + ClassDB::bind_method(_MD("sample_set_loop_end","sample","pos"), &AudioServer::sample_set_loop_end ); + ClassDB::bind_method(_MD("sample_get_loop_end","sample"), &AudioServer::sample_get_loop_end ); - ObjectTypeDB::bind_method(_MD("voice_create"), &AudioServer::voice_create ); - ObjectTypeDB::bind_method(_MD("voice_play","voice","sample"), &AudioServer::voice_play ); - ObjectTypeDB::bind_method(_MD("voice_set_volume","voice","volume"), &AudioServer::voice_set_volume ); - ObjectTypeDB::bind_method(_MD("voice_set_pan","voice","pan","depth","height"), &AudioServer::voice_set_pan,DEFVAL(0),DEFVAL(0) ); - ObjectTypeDB::bind_method(_MD("voice_set_filter","voice","type","cutoff","resonance","gain"), &AudioServer::voice_set_filter,DEFVAL(0) ); - ObjectTypeDB::bind_method(_MD("voice_set_chorus","voice","chorus"), &AudioServer::voice_set_chorus ); - ObjectTypeDB::bind_method(_MD("voice_set_reverb","voice","room","reverb"), &AudioServer::voice_set_reverb ); - ObjectTypeDB::bind_method(_MD("voice_set_mix_rate","voice","rate"), &AudioServer::voice_set_mix_rate ); - ObjectTypeDB::bind_method(_MD("voice_set_positional","voice","enabled"), &AudioServer::voice_set_positional ); + ClassDB::bind_method(_MD("voice_create"), &AudioServer::voice_create ); + ClassDB::bind_method(_MD("voice_play","voice","sample"), &AudioServer::voice_play ); + ClassDB::bind_method(_MD("voice_set_volume","voice","volume"), &AudioServer::voice_set_volume ); + ClassDB::bind_method(_MD("voice_set_pan","voice","pan","depth","height"), &AudioServer::voice_set_pan,DEFVAL(0),DEFVAL(0) ); + ClassDB::bind_method(_MD("voice_set_filter","voice","type","cutoff","resonance","gain"), &AudioServer::voice_set_filter,DEFVAL(0) ); + ClassDB::bind_method(_MD("voice_set_chorus","voice","chorus"), &AudioServer::voice_set_chorus ); + ClassDB::bind_method(_MD("voice_set_reverb","voice","room","reverb"), &AudioServer::voice_set_reverb ); + ClassDB::bind_method(_MD("voice_set_mix_rate","voice","rate"), &AudioServer::voice_set_mix_rate ); + ClassDB::bind_method(_MD("voice_set_positional","voice","enabled"), &AudioServer::voice_set_positional ); - ObjectTypeDB::bind_method(_MD("voice_get_volume","voice"), &AudioServer::voice_get_volume ); - ObjectTypeDB::bind_method(_MD("voice_get_pan","voice"), &AudioServer::voice_get_pan ); - ObjectTypeDB::bind_method(_MD("voice_get_pan_height","voice"), &AudioServer::voice_get_pan_height ); - ObjectTypeDB::bind_method(_MD("voice_get_pan_depth","voice"), &AudioServer::voice_get_pan_depth ); - ObjectTypeDB::bind_method(_MD("voice_get_filter_type","voice"), &AudioServer::voice_get_filter_type ); - ObjectTypeDB::bind_method(_MD("voice_get_filter_cutoff","voice"), &AudioServer::voice_get_filter_cutoff ); - ObjectTypeDB::bind_method(_MD("voice_get_filter_resonance","voice"), &AudioServer::voice_get_filter_resonance ); - ObjectTypeDB::bind_method(_MD("voice_get_chorus","voice"), &AudioServer::voice_get_chorus ); - ObjectTypeDB::bind_method(_MD("voice_get_reverb_type","voice"), &AudioServer::voice_get_reverb_type ); - ObjectTypeDB::bind_method(_MD("voice_get_reverb","voice"), &AudioServer::voice_get_reverb ); - ObjectTypeDB::bind_method(_MD("voice_get_mix_rate","voice"), &AudioServer::voice_get_mix_rate ); - ObjectTypeDB::bind_method(_MD("voice_is_positional","voice"), &AudioServer::voice_is_positional ); + ClassDB::bind_method(_MD("voice_get_volume","voice"), &AudioServer::voice_get_volume ); + ClassDB::bind_method(_MD("voice_get_pan","voice"), &AudioServer::voice_get_pan ); + ClassDB::bind_method(_MD("voice_get_pan_height","voice"), &AudioServer::voice_get_pan_height ); + ClassDB::bind_method(_MD("voice_get_pan_depth","voice"), &AudioServer::voice_get_pan_depth ); + ClassDB::bind_method(_MD("voice_get_filter_type","voice"), &AudioServer::voice_get_filter_type ); + ClassDB::bind_method(_MD("voice_get_filter_cutoff","voice"), &AudioServer::voice_get_filter_cutoff ); + ClassDB::bind_method(_MD("voice_get_filter_resonance","voice"), &AudioServer::voice_get_filter_resonance ); + ClassDB::bind_method(_MD("voice_get_chorus","voice"), &AudioServer::voice_get_chorus ); + ClassDB::bind_method(_MD("voice_get_reverb_type","voice"), &AudioServer::voice_get_reverb_type ); + ClassDB::bind_method(_MD("voice_get_reverb","voice"), &AudioServer::voice_get_reverb ); + ClassDB::bind_method(_MD("voice_get_mix_rate","voice"), &AudioServer::voice_get_mix_rate ); + ClassDB::bind_method(_MD("voice_is_positional","voice"), &AudioServer::voice_is_positional ); - ObjectTypeDB::bind_method(_MD("voice_stop","voice"), &AudioServer::voice_stop ); + ClassDB::bind_method(_MD("voice_stop","voice"), &AudioServer::voice_stop ); - ObjectTypeDB::bind_method(_MD("free_rid","rid"), &AudioServer::free ); + ClassDB::bind_method(_MD("free_rid","rid"), &AudioServer::free ); - ObjectTypeDB::bind_method(_MD("set_stream_global_volume_scale","scale"), &AudioServer::set_stream_global_volume_scale ); - ObjectTypeDB::bind_method(_MD("get_stream_global_volume_scale"), &AudioServer::get_stream_global_volume_scale ); + ClassDB::bind_method(_MD("set_stream_global_volume_scale","scale"), &AudioServer::set_stream_global_volume_scale ); + ClassDB::bind_method(_MD("get_stream_global_volume_scale"), &AudioServer::get_stream_global_volume_scale ); - ObjectTypeDB::bind_method(_MD("set_fx_global_volume_scale","scale"), &AudioServer::set_fx_global_volume_scale ); - ObjectTypeDB::bind_method(_MD("get_fx_global_volume_scale"), &AudioServer::get_fx_global_volume_scale ); + ClassDB::bind_method(_MD("set_fx_global_volume_scale","scale"), &AudioServer::set_fx_global_volume_scale ); + ClassDB::bind_method(_MD("get_fx_global_volume_scale"), &AudioServer::get_fx_global_volume_scale ); - ObjectTypeDB::bind_method(_MD("set_event_voice_global_volume_scale","scale"), &AudioServer::set_event_voice_global_volume_scale ); - ObjectTypeDB::bind_method(_MD("get_event_voice_global_volume_scale"), &AudioServer::get_event_voice_global_volume_scale ); + ClassDB::bind_method(_MD("set_event_voice_global_volume_scale","scale"), &AudioServer::set_event_voice_global_volume_scale ); + ClassDB::bind_method(_MD("get_event_voice_global_volume_scale"), &AudioServer::get_event_voice_global_volume_scale ); BIND_CONSTANT( SAMPLE_FORMAT_PCM8 ); BIND_CONSTANT( SAMPLE_FORMAT_PCM16 ); diff --git a/servers/audio_server.h b/servers/audio_server.h index 9e21e6b183..1482b40d4c 100644 --- a/servers/audio_server.h +++ b/servers/audio_server.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -107,7 +107,7 @@ public: class AudioServer : public Object { - OBJ_TYPE( AudioServer, Object ); + GDCLASS( AudioServer, Object ); static AudioServer *singleton; protected: @@ -168,9 +168,9 @@ public: virtual int sample_get_length(RID p_sample) const=0; virtual const void* sample_get_data_ptr(RID p_sample) const=0; - virtual void sample_set_signed_data(RID p_sample, const DVector<float>& p_buffer); - virtual void sample_set_data(RID p_sample, const DVector<uint8_t>& p_buffer)=0; - virtual DVector<uint8_t> sample_get_data(RID p_sample) const=0; + virtual void sample_set_signed_data(RID p_sample, const PoolVector<float>& p_buffer); + virtual void sample_set_data(RID p_sample, const PoolVector<uint8_t>& p_buffer)=0; + virtual PoolVector<uint8_t> sample_get_data(RID p_sample) const=0; virtual void sample_set_mix_rate(RID p_sample,int p_rate)=0; virtual int sample_get_mix_rate(RID p_sample) const=0; diff --git a/servers/physics/area_pair_sw.cpp b/servers/physics/area_pair_sw.cpp index 24f3b75ca5..1131aa90d3 100644 --- a/servers/physics/area_pair_sw.cpp +++ b/servers/physics/area_pair_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/area_pair_sw.h b/servers/physics/area_pair_sw.h index 09a2934467..17477dcbd2 100644 --- a/servers/physics/area_pair_sw.h +++ b/servers/physics/area_pair_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/area_sw.cpp b/servers/physics/area_sw.cpp index dbc82da316..84389c9b78 100644 --- a/servers/physics/area_sw.cpp +++ b/servers/physics/area_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/area_sw.h b/servers/physics/area_sw.h index 622eeb5e23..5ac6985409 100644 --- a/servers/physics/area_sw.h +++ b/servers/physics/area_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/body_pair_sw.cpp b/servers/physics/body_pair_sw.cpp index 43e52f26e8..7defa87bb1 100644 --- a/servers/physics/body_pair_sw.cpp +++ b/servers/physics/body_pair_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -307,8 +307,8 @@ bool BodyPairSW::setup(float p_step) { } #endif - c.rA = global_A; - c.rB = global_B-offset_B; + c.rA = global_A-A->get_center_of_mass(); + c.rB = global_B-B->get_center_of_mass()-offset_B; // contact query reporting... #if 0 @@ -364,12 +364,12 @@ bool BodyPairSW::setup(float p_step) { c.depth=depth; Vector3 j_vec = c.normal * c.acc_normal_impulse + c.acc_tangent_impulse; - A->apply_impulse( c.rA, -j_vec ); - B->apply_impulse( c.rB, j_vec ); + A->apply_impulse( c.rA+A->get_center_of_mass(), -j_vec ); + B->apply_impulse( c.rB+B->get_center_of_mass(), j_vec ); c.acc_bias_impulse=0; Vector3 jb_vec = c.normal * c.acc_bias_impulse; - A->apply_bias_impulse( c.rA, -jb_vec ); - B->apply_bias_impulse( c.rB, jb_vec ); + A->apply_bias_impulse( c.rA+A->get_center_of_mass(), -jb_vec ); + B->apply_bias_impulse( c.rB+B->get_center_of_mass(), jb_vec ); c.bounce = MAX(A->get_bounce(),B->get_bounce()); if (c.bounce) { @@ -418,8 +418,8 @@ void BodyPairSW::solve(float p_step) { Vector3 jb = c.normal * (c.acc_bias_impulse - jbnOld); - A->apply_bias_impulse(c.rA,-jb); - B->apply_bias_impulse(c.rB, jb); + A->apply_bias_impulse(c.rA+A->get_center_of_mass(),-jb); + B->apply_bias_impulse(c.rB+B->get_center_of_mass(), jb); c.active=true; } @@ -442,8 +442,8 @@ void BodyPairSW::solve(float p_step) { Vector3 j =c.normal * (c.acc_normal_impulse - jnOld); - A->apply_impulse(c.rA,-j); - B->apply_impulse(c.rB, j); + A->apply_impulse(c.rA+A->get_center_of_mass(),-j); + B->apply_impulse(c.rB+B->get_center_of_mass(), j); c.active=true; } @@ -489,8 +489,8 @@ void BodyPairSW::solve(float p_step) { jt = c.acc_tangent_impulse - jtOld; - A->apply_impulse( c.rA, -jt ); - B->apply_impulse( c.rB, jt ); + A->apply_impulse( c.rA+A->get_center_of_mass(), -jt ); + B->apply_impulse( c.rB+B->get_center_of_mass(), jt ); c.active=true; diff --git a/servers/physics/body_pair_sw.h b/servers/physics/body_pair_sw.h index da637ade05..a37f75d13c 100644 --- a/servers/physics/body_pair_sw.h +++ b/servers/physics/body_pair_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -65,7 +65,7 @@ class BodyPairSW : public ConstraintSW { real_t depth; bool active; - Vector3 rA,rB; + Vector3 rA,rB; // Offset in world orientation with respect to center of mass }; Vector3 offset_B; //use local A coordinates to avoid numerical issues on collision detection diff --git a/servers/physics/body_sw.cpp b/servers/physics/body_sw.cpp index b0ed99cb48..ceeeafe04a 100644 --- a/servers/physics/body_sw.cpp +++ b/servers/physics/body_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,12 +37,16 @@ void BodySW::_update_inertia() { } +void BodySW::_update_transform_dependant() { + + center_of_mass = get_transform().basis.xform(center_of_mass_local); + principal_inertia_axes = get_transform().basis * principal_inertia_axes_local; -void BodySW::_update_inertia_tensor() { - - Matrix3 tb = get_transform().basis; + // update inertia tensor + Basis tb = principal_inertia_axes; + Basis tbt = tb.transposed(); tb.scale(_inv_inertia); - _inv_inertia_tensor = tb * get_transform().basis.transposed(); + _inv_inertia_tensor = tb * tbt; } @@ -54,33 +58,56 @@ void BodySW::update_inertias() { case PhysicsServer::BODY_MODE_RIGID: { - //update tensor for allshapes, not the best way but should be somehow OK. (inspired from bullet) + //update tensor for all shapes, not the best way but should be somehow OK. (inspired from bullet) float total_area=0; for (int i=0;i<get_shape_count();i++) { - total_area+=get_shape_aabb(i).get_area(); + total_area+=get_shape_area(i); + } + + // We have to recompute the center of mass + center_of_mass_local.zero(); + + for (int i=0; i<get_shape_count(); i++) { + float area=get_shape_area(i); + + float mass = area * this->mass / total_area; + + // NOTE: we assume that the shape origin is also its center of mass + center_of_mass_local += mass * get_shape_transform(i).origin; } - Vector3 _inertia; + center_of_mass_local /= mass; + // Recompute the inertia tensor + Basis inertia_tensor; + inertia_tensor.set_zero(); for (int i=0;i<get_shape_count();i++) { const ShapeSW* shape=get_shape(i); - float area=get_shape_aabb(i).get_area(); + float area=get_shape_area(i); float mass = area * this->mass / total_area; - _inertia += shape->get_moment_of_inertia(mass) + mass * get_shape_transform(i).get_origin(); + Basis shape_inertia_tensor=shape->get_moment_of_inertia(mass).to_diagonal_matrix(); + Transform shape_transform=get_shape_transform(i); + Basis shape_basis = shape_transform.basis.orthonormalized(); + + // NOTE: we don't take the scale of collision shapes into account when computing the inertia tensor! + shape_inertia_tensor = shape_basis * shape_inertia_tensor * shape_basis.transposed(); + + Vector3 shape_origin = shape_transform.origin - center_of_mass_local; + inertia_tensor += shape_inertia_tensor + (Basis()*shape_origin.dot(shape_origin)-shape_origin.outer(shape_origin))*mass; + } - if (_inertia!=Vector3()) - _inv_inertia=_inertia.inverse(); - else - _inv_inertia=Vector3(); + // Compute the principal axes of inertia + principal_inertia_axes_local = inertia_tensor.diagonalize().transposed(); + _inv_inertia = inertia_tensor.get_main_diagonal().inverse(); if (mass) _inv_mass=1.0/mass; @@ -92,20 +119,21 @@ void BodySW::update_inertias() { case PhysicsServer::BODY_MODE_KINEMATIC: case PhysicsServer::BODY_MODE_STATIC: { - _inv_inertia=Vector3(); + _inv_inertia_tensor.set_zero(); _inv_mass=0; } break; case PhysicsServer::BODY_MODE_CHARACTER: { - _inv_inertia=Vector3(); + _inv_inertia_tensor.set_zero(); _inv_mass=1.0/mass; } break; } - _update_inertia_tensor(); + //_update_shapes(); + _update_transform_dependant(); } @@ -469,7 +497,7 @@ void BodySW::integrate_forces(real_t p_step) { linear_velocity = (new_transform.origin - get_transform().origin)/p_step; //compute a FAKE angular velocity, not so easy - Matrix3 rot=new_transform.basis.orthonormalized().transposed() * get_transform().basis.orthonormalized(); + Basis rot=new_transform.basis.orthonormalized().transposed() * get_transform().basis.orthonormalized(); Vector3 axis; float angle; @@ -581,7 +609,9 @@ void BodySW::integrate_velocities(real_t p_step) { if (ang_vel!=0.0) { Vector3 ang_vel_axis = total_angular_velocity / ang_vel; - Matrix3 rot( ang_vel_axis, -ang_vel*p_step ); + Basis rot( ang_vel_axis, -ang_vel*p_step ); + Basis identity3(1, 0, 0, 0, 1, 0, 0, 0, 1); + transform.origin += ((identity3 - rot) * transform.basis).xform(center_of_mass_local); transform.basis = rot * transform.basis; transform.orthonormalize(); } @@ -598,7 +628,7 @@ void BodySW::integrate_velocities(real_t p_step) { _set_transform(transform); _set_inv_transform(get_transform().inverse()); - _update_inertia_tensor(); + _update_transform_dependant(); //if (fi_callback) { diff --git a/servers/physics/body_sw.h b/servers/physics/body_sw.h index 870e8357f1..e6ed3e75e5 100644 --- a/servers/physics/body_sw.h +++ b/servers/physics/body_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -57,8 +57,16 @@ class BodySW : public CollisionObjectSW { PhysicsServer::BodyAxisLock axis_lock; real_t _inv_mass; - Vector3 _inv_inertia; - Matrix3 _inv_inertia_tensor; + Vector3 _inv_inertia; // Relative to the principal axes of inertia + + // Relative to the local frame of reference + Basis principal_inertia_axes_local; + Vector3 center_of_mass_local; + + // In world orientation with local origin + Basis _inv_inertia_tensor; + Basis principal_inertia_axes; + Vector3 center_of_mass; Vector3 gravity; @@ -135,7 +143,7 @@ class BodySW : public CollisionObjectSW { _FORCE_INLINE_ void _compute_area_gravity_and_dampenings(const AreaSW *p_area); - _FORCE_INLINE_ void _update_inertia_tensor(); + _FORCE_INLINE_ void _update_transform_dependant(); friend class PhysicsDirectBodyStateSW; // i give up, too many functions to expose @@ -190,6 +198,10 @@ public: _FORCE_INLINE_ void set_omit_force_integration(bool p_omit_force_integration) { omit_force_integration=p_omit_force_integration; } _FORCE_INLINE_ bool get_omit_force_integration() const { return omit_force_integration; } + _FORCE_INLINE_ Basis get_principal_inertia_axes() const { return principal_inertia_axes; } + _FORCE_INLINE_ Vector3 get_center_of_mass() const { return center_of_mass; } + _FORCE_INLINE_ Vector3 xform_local_to_principal(const Vector3& p_pos) const { return principal_inertia_axes_local.xform(p_pos - center_of_mass_local); } + _FORCE_INLINE_ void set_linear_velocity(const Vector3& p_velocity) {linear_velocity=p_velocity; } _FORCE_INLINE_ Vector3 get_linear_velocity() const { return linear_velocity; } @@ -202,18 +214,23 @@ public: _FORCE_INLINE_ void apply_impulse(const Vector3& p_pos, const Vector3& p_j) { linear_velocity += p_j * _inv_mass; - angular_velocity += _inv_inertia_tensor.xform( p_pos.cross(p_j) ); + angular_velocity += _inv_inertia_tensor.xform( (p_pos-center_of_mass).cross(p_j) ); + } + + _FORCE_INLINE_ void apply_torque_impulse(const Vector3& p_j) { + + angular_velocity += _inv_inertia_tensor.xform(p_j); } _FORCE_INLINE_ void apply_bias_impulse(const Vector3& p_pos, const Vector3& p_j) { biased_linear_velocity += p_j * _inv_mass; - biased_angular_velocity += _inv_inertia_tensor.xform( p_pos.cross(p_j) ); + biased_angular_velocity += _inv_inertia_tensor.xform( (p_pos-center_of_mass).cross(p_j) ); } - _FORCE_INLINE_ void apply_torque_impulse(const Vector3& p_j) { + _FORCE_INLINE_ void apply_bias_torque_impulse(const Vector3& p_j) { - angular_velocity += _inv_inertia_tensor.xform(p_j); + biased_angular_velocity += _inv_inertia_tensor.xform(p_j); } _FORCE_INLINE_ void add_force(const Vector3& p_force, const Vector3& p_pos) { @@ -255,7 +272,7 @@ public: _FORCE_INLINE_ real_t get_inv_mass() const { return _inv_mass; } _FORCE_INLINE_ Vector3 get_inv_inertia() const { return _inv_inertia; } - _FORCE_INLINE_ Matrix3 get_inv_inertia_tensor() const { return _inv_inertia_tensor; } + _FORCE_INLINE_ Basis get_inv_inertia_tensor() const { return _inv_inertia_tensor; } _FORCE_INLINE_ real_t get_friction() const { return friction; } _FORCE_INLINE_ Vector3 get_gravity() const { return gravity; } _FORCE_INLINE_ real_t get_bounce() const { return bounce; } @@ -268,12 +285,12 @@ public: _FORCE_INLINE_ Vector3 get_velocity_in_local_point(const Vector3& rel_pos) const { - return linear_velocity + angular_velocity.cross(rel_pos); + return linear_velocity + angular_velocity.cross(rel_pos-center_of_mass); } _FORCE_INLINE_ real_t compute_impulse_denominator(const Vector3& p_pos, const Vector3& p_normal) const { - Vector3 r0 = p_pos - get_transform().origin; + Vector3 r0 = p_pos - get_transform().origin - center_of_mass; Vector3 c0 = (r0).cross(p_normal); @@ -351,7 +368,7 @@ void BodySW::add_contact(const Vector3& p_local_pos,const Vector3& p_local_norma class PhysicsDirectBodyStateSW : public PhysicsDirectBodyState { - OBJ_TYPE( PhysicsDirectBodyStateSW, PhysicsDirectBodyState ); + GDCLASS( PhysicsDirectBodyStateSW, PhysicsDirectBodyState ); public: @@ -363,9 +380,12 @@ public: virtual float get_total_angular_damp() const { return body->area_angular_damp; } // get density of this body space/area virtual float get_total_linear_damp() const { return body->area_linear_damp; } // get density of this body space/area + virtual Vector3 get_center_of_mass() const { return body->get_center_of_mass(); } + virtual Basis get_principal_inertia_axes() const { return body->get_principal_inertia_axes(); } + virtual float get_inverse_mass() const { return body->get_inv_mass(); } // get the mass virtual Vector3 get_inverse_inertia() const { return body->get_inv_inertia(); } // get density of this body space - virtual Matrix3 get_inverse_inertia_tensor() const { return body->get_inv_inertia_tensor(); } // get density of this body space + virtual Basis get_inverse_inertia_tensor() const { return body->get_inv_inertia_tensor(); } // get density of this body space virtual void set_linear_velocity(const Vector3& p_velocity) { body->set_linear_velocity(p_velocity); } virtual Vector3 get_linear_velocity() const { return body->get_linear_velocity(); } @@ -378,6 +398,7 @@ public: virtual void add_force(const Vector3& p_force, const Vector3& p_pos) { body->add_force(p_force,p_pos); } virtual void apply_impulse(const Vector3& p_pos, const Vector3& p_j) { body->apply_impulse(p_pos,p_j); } + virtual void apply_torque_impulse(const Vector3& p_j) { body->apply_torque_impulse(p_j); } virtual void set_sleep_state(bool p_enable) { body->set_active(!p_enable); } virtual bool is_sleeping() const { return !body->is_active(); } diff --git a/servers/physics/broad_phase_basic.cpp b/servers/physics/broad_phase_basic.cpp index 0bed56d398..f1c22caae3 100644 --- a/servers/physics/broad_phase_basic.cpp +++ b/servers/physics/broad_phase_basic.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -47,7 +47,7 @@ BroadPhaseSW::ID BroadPhaseBasic::create(CollisionObjectSW *p_object_, int p_sub return current; } -void BroadPhaseBasic::move(ID p_id, const AABB& p_aabb) { +void BroadPhaseBasic::move(ID p_id, const Rect3& p_aabb) { Map<ID,Element>::Element *E=element_map.find(p_id); ERR_FAIL_COND(!E); @@ -115,7 +115,7 @@ int BroadPhaseBasic::cull_segment(const Vector3& p_from, const Vector3& p_to,Col for (Map<ID,Element>::Element *E=element_map.front();E;E=E->next()) { - const AABB aabb=E->get().aabb; + const Rect3 aabb=E->get().aabb; if (aabb.intersects_segment(p_from,p_to)) { p_results[rc]=E->get().owner; @@ -129,13 +129,13 @@ int BroadPhaseBasic::cull_segment(const Vector3& p_from, const Vector3& p_to,Col return rc; } -int BroadPhaseBasic::cull_aabb(const AABB& p_aabb,CollisionObjectSW** p_results,int p_max_results,int *p_result_indices) { +int BroadPhaseBasic::cull_aabb(const Rect3& p_aabb,CollisionObjectSW** p_results,int p_max_results,int *p_result_indices) { int rc=0; for (Map<ID,Element>::Element *E=element_map.front();E;E=E->next()) { - const AABB aabb=E->get().aabb; + const Rect3 aabb=E->get().aabb; if (aabb.intersects(p_aabb)) { p_results[rc]=E->get().owner; diff --git a/servers/physics/broad_phase_basic.h b/servers/physics/broad_phase_basic.h index 6bf024044e..9f07e896c4 100644 --- a/servers/physics/broad_phase_basic.h +++ b/servers/physics/broad_phase_basic.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -38,7 +38,7 @@ class BroadPhaseBasic : public BroadPhaseSW { CollisionObjectSW *owner; bool _static; - AABB aabb; + Rect3 aabb; int subindex; }; @@ -78,7 +78,7 @@ public: // 0 is an invalid ID virtual ID create(CollisionObjectSW *p_object_, int p_subindex=0); - virtual void move(ID p_id, const AABB& p_aabb); + virtual void move(ID p_id, const Rect3& p_aabb); virtual void set_static(ID p_id, bool p_static); virtual void remove(ID p_id); @@ -87,7 +87,7 @@ public: virtual int get_subindex(ID p_id) const; virtual int cull_segment(const Vector3& p_from, const Vector3& p_to,CollisionObjectSW** p_results,int p_max_results,int *p_result_indices=NULL); - virtual int cull_aabb(const AABB& p_aabb,CollisionObjectSW** p_results,int p_max_results,int *p_result_indices=NULL); + virtual int cull_aabb(const Rect3& p_aabb,CollisionObjectSW** p_results,int p_max_results,int *p_result_indices=NULL); virtual void set_pair_callback(PairCallback p_pair_callback,void *p_userdata); virtual void set_unpair_callback(UnpairCallback p_unpair_callback,void *p_userdata); diff --git a/servers/physics/broad_phase_octree.cpp b/servers/physics/broad_phase_octree.cpp index bfe41f8423..89581997a2 100644 --- a/servers/physics/broad_phase_octree.cpp +++ b/servers/physics/broad_phase_octree.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -29,13 +29,13 @@ #include "broad_phase_octree.h" #include "collision_object_sw.h" -ID BroadPhaseOctree::create(CollisionObjectSW *p_object, int p_subindex) { +BroadPhaseSW::ID BroadPhaseOctree::create(CollisionObjectSW *p_object, int p_subindex) { - ID oid = octree.create(p_object,AABB(),p_subindex,false,1<<p_object->get_type(),0); + ID oid = octree.create(p_object,Rect3(),p_subindex,false,1<<p_object->get_type(),0); return oid; } -void BroadPhaseOctree::move(ID p_id, const AABB& p_aabb){ +void BroadPhaseOctree::move(ID p_id, const Rect3& p_aabb){ octree.move(p_id,p_aabb); } @@ -71,7 +71,7 @@ int BroadPhaseOctree::cull_segment(const Vector3& p_from, const Vector3& p_to,Co return octree.cull_segment(p_from,p_to,p_results,p_max_results,p_result_indices); } -int BroadPhaseOctree::cull_aabb(const AABB& p_aabb,CollisionObjectSW** p_results,int p_max_results,int *p_result_indices) { +int BroadPhaseOctree::cull_aabb(const Rect3& p_aabb,CollisionObjectSW** p_results,int p_max_results,int *p_result_indices) { return octree.cull_AABB(p_aabb,p_results,p_max_results,p_result_indices); diff --git a/servers/physics/broad_phase_octree.h b/servers/physics/broad_phase_octree.h index b87996a58c..29f1123edf 100644 --- a/servers/physics/broad_phase_octree.h +++ b/servers/physics/broad_phase_octree.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -50,7 +50,7 @@ public: // 0 is an invalid ID virtual ID create(CollisionObjectSW *p_object_, int p_subindex=0); - virtual void move(ID p_id, const AABB& p_aabb); + virtual void move(ID p_id, const Rect3& p_aabb); virtual void set_static(ID p_id, bool p_static); virtual void remove(ID p_id); @@ -59,7 +59,7 @@ public: virtual int get_subindex(ID p_id) const; virtual int cull_segment(const Vector3& p_from, const Vector3& p_to,CollisionObjectSW** p_results,int p_max_results,int *p_result_indices=NULL); - virtual int cull_aabb(const AABB& p_aabb,CollisionObjectSW** p_results,int p_max_results,int *p_result_indices=NULL); + virtual int cull_aabb(const Rect3& p_aabb,CollisionObjectSW** p_results,int p_max_results,int *p_result_indices=NULL); virtual void set_pair_callback(PairCallback p_pair_callback,void *p_userdata); virtual void set_unpair_callback(UnpairCallback p_unpair_callback,void *p_userdata); diff --git a/servers/physics/broad_phase_sw.cpp b/servers/physics/broad_phase_sw.cpp index a382df6a46..2a897dea2b 100644 --- a/servers/physics/broad_phase_sw.cpp +++ b/servers/physics/broad_phase_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/broad_phase_sw.h b/servers/physics/broad_phase_sw.h index 409c249865..2cc2d7d45e 100644 --- a/servers/physics/broad_phase_sw.h +++ b/servers/physics/broad_phase_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -50,7 +50,7 @@ public: // 0 is an invalid ID virtual ID create(CollisionObjectSW *p_object_, int p_subindex=0)=0; - virtual void move(ID p_id, const AABB& p_aabb)=0; + virtual void move(ID p_id, const Rect3& p_aabb)=0; virtual void set_static(ID p_id, bool p_static)=0; virtual void remove(ID p_id)=0; @@ -59,7 +59,7 @@ public: virtual int get_subindex(ID p_id) const=0; virtual int cull_segment(const Vector3& p_from, const Vector3& p_to,CollisionObjectSW** p_results,int p_max_results,int *p_result_indices=NULL)=0; - virtual int cull_aabb(const AABB& p_aabb,CollisionObjectSW** p_results,int p_max_results,int *p_result_indices=NULL)=0; + virtual int cull_aabb(const Rect3& p_aabb,CollisionObjectSW** p_results,int p_max_results,int *p_result_indices=NULL)=0; virtual void set_pair_callback(PairCallback p_pair_callback,void *p_userdata)=0; virtual void set_unpair_callback(UnpairCallback p_unpair_callback,void *p_userdata)=0; diff --git a/servers/physics/collision_object_sw.cpp b/servers/physics/collision_object_sw.cpp index f2864ee95e..88aa737579 100644 --- a/servers/physics/collision_object_sw.cpp +++ b/servers/physics/collision_object_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -138,12 +138,14 @@ void CollisionObjectSW::_update_shapes() { } //not quite correct, should compute the next matrix.. - AABB shape_aabb=s.shape->get_aabb(); + Rect3 shape_aabb=s.shape->get_aabb(); Transform xform = transform * s.xform; shape_aabb=xform.xform(shape_aabb); s.aabb_cache=shape_aabb; s.aabb_cache=s.aabb_cache.grow( (s.aabb_cache.size.x + s.aabb_cache.size.y)*0.5*0.05 ); + Vector3 scale = xform.get_basis().get_scale(); + s.area_cache=s.shape->get_area()*scale.x*scale.y*scale.z; space->get_broadphase()->move(s.bpid,s.aabb_cache); } @@ -165,10 +167,10 @@ void CollisionObjectSW::_update_shapes_with_motion(const Vector3& p_motion) { } //not quite correct, should compute the next matrix.. - AABB shape_aabb=s.shape->get_aabb(); + Rect3 shape_aabb=s.shape->get_aabb(); Transform xform = transform * s.xform; shape_aabb=xform.xform(shape_aabb); - shape_aabb=shape_aabb.merge(AABB( shape_aabb.pos+p_motion,shape_aabb.size)); //use motion + shape_aabb=shape_aabb.merge(Rect3( shape_aabb.pos+p_motion,shape_aabb.size)); //use motion s.aabb_cache=shape_aabb; space->get_broadphase()->move(s.bpid,shape_aabb); diff --git a/servers/physics/collision_object_sw.h b/servers/physics/collision_object_sw.h index bc71c2709b..c46a7f4a5f 100644 --- a/servers/physics/collision_object_sw.h +++ b/servers/physics/collision_object_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -60,7 +60,8 @@ private: Transform xform; Transform xform_inv; BroadPhaseSW::ID bpid; - AABB aabb_cache; //for rayqueries + Rect3 aabb_cache; //for rayqueries + real_t area_cache; ShapeSW *shape; bool trigger; @@ -122,7 +123,8 @@ public: _FORCE_INLINE_ ShapeSW *get_shape(int p_index) const { return shapes[p_index].shape; } _FORCE_INLINE_ const Transform& get_shape_transform(int p_index) const { return shapes[p_index].xform; } _FORCE_INLINE_ const Transform& get_shape_inv_transform(int p_index) const { return shapes[p_index].xform_inv; } - _FORCE_INLINE_ const AABB& get_shape_aabb(int p_index) const { return shapes[p_index].aabb_cache; } + _FORCE_INLINE_ const Rect3& get_shape_aabb(int p_index) const { return shapes[p_index].aabb_cache; } + _FORCE_INLINE_ const real_t get_shape_area(int p_index) const { return shapes[p_index].area_cache; } _FORCE_INLINE_ Transform get_transform() const { return transform; } _FORCE_INLINE_ Transform get_inv_transform() const { return inv_transform; } diff --git a/servers/physics/collision_solver_sat.cpp b/servers/physics/collision_solver_sat.cpp index 3e7719e5eb..7f8153611f 100644 --- a/servers/physics/collision_solver_sat.cpp +++ b/servers/physics/collision_solver_sat.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/collision_solver_sat.h b/servers/physics/collision_solver_sat.h index 57f5bdbbc0..60387a978d 100644 --- a/servers/physics/collision_solver_sat.h +++ b/servers/physics/collision_solver_sat.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/collision_solver_sw.cpp b/servers/physics/collision_solver_sw.cpp index 716e724637..91ef7913cf 100644 --- a/servers/physics/collision_solver_sw.cpp +++ b/servers/physics/collision_solver_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -160,7 +160,7 @@ bool CollisionSolverSW::solve_concave(const ShapeSW *p_shape_A,const Transform& //quickly compute a local AABB - AABB local_aabb; + Rect3 local_aabb; for(int i=0;i<3;i++) { Vector3 axis( p_transform_B.basis.get_axis(i) ); @@ -313,7 +313,7 @@ bool CollisionSolverSW::solve_distance_plane(const ShapeSW *p_shape_A,const Tran return collided; } -bool CollisionSolverSW::solve_distance(const ShapeSW *p_shape_A,const Transform& p_transform_A,const ShapeSW *p_shape_B,const Transform& p_transform_B,Vector3& r_point_A,Vector3& r_point_B,const AABB& p_concave_hint,Vector3 *r_sep_axis) { +bool CollisionSolverSW::solve_distance(const ShapeSW *p_shape_A,const Transform& p_transform_A,const ShapeSW *p_shape_B,const Transform& p_transform_B,Vector3& r_point_A,Vector3& r_point_B,const Rect3& p_concave_hint,Vector3 *r_sep_axis) { if (p_shape_A->is_concave()) return false; @@ -351,14 +351,14 @@ bool CollisionSolverSW::solve_distance(const ShapeSW *p_shape_A,const Transform& //quickly compute a local AABB - bool use_cc_hint=p_concave_hint!=AABB(); - AABB cc_hint_aabb; + bool use_cc_hint=p_concave_hint!=Rect3(); + Rect3 cc_hint_aabb; if (use_cc_hint) { cc_hint_aabb=p_concave_hint; cc_hint_aabb.pos-=p_transform_B.origin; } - AABB local_aabb; + Rect3 local_aabb; for(int i=0;i<3;i++) { Vector3 axis( p_transform_B.basis.get_axis(i) ); diff --git a/servers/physics/collision_solver_sw.h b/servers/physics/collision_solver_sw.h index abc50cae2c..16d2b92d70 100644 --- a/servers/physics/collision_solver_sw.h +++ b/servers/physics/collision_solver_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -48,7 +48,7 @@ public: static bool solve_static(const ShapeSW *p_shape_A,const Transform& p_transform_A,const ShapeSW *p_shape_B,const Transform& p_transform_B,CallbackResult p_result_callback,void *p_userdata,Vector3 *r_sep_axis=NULL,float p_margin_A=0,float p_margin_B=0); - static bool solve_distance(const ShapeSW *p_shape_A,const Transform& p_transform_A,const ShapeSW *p_shape_B,const Transform& p_transform_B,Vector3& r_point_A,Vector3& r_point_B,const AABB& p_concave_hint,Vector3 *r_sep_axis=NULL); + static bool solve_distance(const ShapeSW *p_shape_A,const Transform& p_transform_A,const ShapeSW *p_shape_B,const Transform& p_transform_B,Vector3& r_point_A,Vector3& r_point_B,const Rect3& p_concave_hint,Vector3 *r_sep_axis=NULL); }; diff --git a/servers/physics/constraint_sw.h b/servers/physics/constraint_sw.h index d61701ac07..adc17cb753 100644 --- a/servers/physics/constraint_sw.h +++ b/servers/physics/constraint_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,7 +31,7 @@ #include "body_sw.h" -class ConstraintSW { +class ConstraintSW : public RID_Data { BodySW **_body_ptr; int _body_count; diff --git a/servers/physics/gjk_epa.cpp b/servers/physics/gjk_epa.cpp index 71d6fee2ab..92ca5ea8dd 100644 --- a/servers/physics/gjk_epa.cpp +++ b/servers/physics/gjk_epa.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/gjk_epa.h b/servers/physics/gjk_epa.h index 78afd3149f..58cf8f50ce 100644 --- a/servers/physics/gjk_epa.h +++ b/servers/physics/gjk_epa.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/joints/cone_twist_joint_sw.cpp b/servers/physics/joints/cone_twist_joint_sw.cpp index 5f1dde4e20..5036a1d8a3 100644 --- a/servers/physics/joints/cone_twist_joint_sw.cpp +++ b/servers/physics/joints/cone_twist_joint_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -128,10 +128,10 @@ bool ConeTwistJointSW::setup(float p_step) { for (int i=0;i<3;i++) { memnew_placement(&m_jac[i], JacobianEntrySW( - A->get_transform().basis.transposed(), - B->get_transform().basis.transposed(), - pivotAInW - A->get_transform().origin, - pivotBInW - B->get_transform().origin, + A->get_principal_inertia_axes().transposed(), + B->get_principal_inertia_axes().transposed(), + pivotAInW - A->get_transform().origin - A->get_center_of_mass(), + pivotBInW - B->get_transform().origin - B->get_center_of_mass(), normal[i], A->get_inv_inertia(), A->get_inv_mass(), diff --git a/servers/physics/joints/cone_twist_joint_sw.h b/servers/physics/joints/cone_twist_joint_sw.h index 653259071d..0d64d67443 100644 --- a/servers/physics/joints/cone_twist_joint_sw.h +++ b/servers/physics/joints/cone_twist_joint_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/joints/generic_6dof_joint_sw.cpp b/servers/physics/joints/generic_6dof_joint_sw.cpp index 06015a5228..5824de0127 100644 --- a/servers/physics/joints/generic_6dof_joint_sw.cpp +++ b/servers/physics/joints/generic_6dof_joint_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -38,8 +38,8 @@ See corresponding header file for licensing info. #define GENERIC_D6_DISABLE_WARMSTARTING 1 -real_t btGetMatrixElem(const Matrix3& mat, int index); -real_t btGetMatrixElem(const Matrix3& mat, int index) +real_t btGetMatrixElem(const Basis& mat, int index); +real_t btGetMatrixElem(const Basis& mat, int index) { int i = index%3; int j = index/3; @@ -47,8 +47,8 @@ real_t btGetMatrixElem(const Matrix3& mat, int index) } ///MatrixToEulerXYZ from http://www.geometrictools.com/LibFoundation/Mathematics/Wm4Matrix3.inl.html -bool matrixToEulerXYZ(const Matrix3& mat,Vector3& xyz); -bool matrixToEulerXYZ(const Matrix3& mat,Vector3& xyz) +bool matrixToEulerXYZ(const Basis& mat,Vector3& xyz); +bool matrixToEulerXYZ(const Basis& mat,Vector3& xyz) { // // rot = cy*cz -cy*sz sy // // cz*sx*sy+cx*sz cx*cz-sx*sy*sz -cy*sx @@ -296,7 +296,7 @@ Generic6DOFJointSW::Generic6DOFJointSW(BodySW* rbA, BodySW* rbB, const Transform void Generic6DOFJointSW::calculateAngleInfo() { - Matrix3 relative_frame = m_calculatedTransformA.basis.inverse()*m_calculatedTransformB.basis; + Basis relative_frame = m_calculatedTransformA.basis.inverse()*m_calculatedTransformB.basis; matrixToEulerXYZ(relative_frame,m_calculatedAxisAngleDiff); @@ -352,10 +352,10 @@ void Generic6DOFJointSW::buildLinearJacobian( const Vector3 & pivotAInW,const Vector3 & pivotBInW) { memnew_placement(&jacLinear, JacobianEntrySW( - A->get_transform().basis.transposed(), - B->get_transform().basis.transposed(), - pivotAInW - A->get_transform().origin, - pivotBInW - B->get_transform().origin, + A->get_principal_inertia_axes().transposed(), + B->get_principal_inertia_axes().transposed(), + pivotAInW - A->get_transform().origin - A->get_center_of_mass(), + pivotBInW - B->get_transform().origin - B->get_center_of_mass(), normalWorld, A->get_inv_inertia(), A->get_inv_mass(), @@ -368,8 +368,8 @@ void Generic6DOFJointSW::buildAngularJacobian( JacobianEntrySW & jacAngular,const Vector3 & jointAxisW) { memnew_placement(&jacAngular, JacobianEntrySW(jointAxisW, - A->get_transform().basis.transposed(), - B->get_transform().basis.transposed(), + A->get_principal_inertia_axes().transposed(), + B->get_principal_inertia_axes().transposed(), A->get_inv_inertia(), B->get_inv_inertia())); @@ -440,7 +440,7 @@ bool Generic6DOFJointSW::setup(float p_step) { } -void Generic6DOFJointSW::solve(real_t timeStep) +void Generic6DOFJointSW::solve(real_t timeStep) { m_timeStep = timeStep; diff --git a/servers/physics/joints/generic_6dof_joint_sw.h b/servers/physics/joints/generic_6dof_joint_sw.h index 47ef43156d..4ac727c124 100644 --- a/servers/physics/joints/generic_6dof_joint_sw.h +++ b/servers/physics/joints/generic_6dof_joint_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/joints/hinge_joint_sw.cpp b/servers/physics/joints/hinge_joint_sw.cpp index 035407065c..2f07779131 100644 --- a/servers/physics/joints/hinge_joint_sw.cpp +++ b/servers/physics/joints/hinge_joint_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -112,7 +112,7 @@ HingeJointSW::HingeJointSW(BodySW* rbA,BodySW* rbB, const Vector3& pivotInA,cons rbAxisA1 = rbAxisA2.cross(axisInA); } - m_rbAFrame.basis=Matrix3( rbAxisA1.x,rbAxisA2.x,axisInA.x, + m_rbAFrame.basis=Basis( rbAxisA1.x,rbAxisA2.x,axisInA.x, rbAxisA1.y,rbAxisA2.y,axisInA.y, rbAxisA1.z,rbAxisA2.z,axisInA.z ); @@ -121,7 +121,7 @@ HingeJointSW::HingeJointSW(BodySW* rbA,BodySW* rbB, const Vector3& pivotInA,cons Vector3 rbAxisB2 = axisInB.cross(rbAxisB1); m_rbBFrame.origin = pivotInB; - m_rbBFrame.basis=Matrix3( rbAxisB1.x,rbAxisB2.x,-axisInB.x, + m_rbBFrame.basis=Basis( rbAxisB1.x,rbAxisB2.x,-axisInB.x, rbAxisB1.y,rbAxisB2.y,-axisInB.y, rbAxisB1.z,rbAxisB2.z,-axisInB.z ); @@ -173,10 +173,10 @@ bool HingeJointSW::setup(float p_step) { for (int i=0;i<3;i++) { memnew_placement(&m_jac[i], JacobianEntrySW( - A->get_transform().basis.transposed(), - B->get_transform().basis.transposed(), - pivotAInW - A->get_transform().origin, - pivotBInW - B->get_transform().origin, + A->get_principal_inertia_axes().transposed(), + B->get_principal_inertia_axes().transposed(), + pivotAInW - A->get_transform().origin - A->get_center_of_mass(), + pivotBInW - B->get_transform().origin - B->get_center_of_mass(), normal[i], A->get_inv_inertia(), A->get_inv_mass(), @@ -200,20 +200,20 @@ bool HingeJointSW::setup(float p_step) { Vector3 hingeAxisWorld = A->get_transform().basis.xform( m_rbAFrame.basis.get_axis(2) ); memnew_placement(&m_jacAng[0], JacobianEntrySW(jointAxis0, - A->get_transform().basis.transposed(), - B->get_transform().basis.transposed(), + A->get_principal_inertia_axes().transposed(), + B->get_principal_inertia_axes().transposed(), A->get_inv_inertia(), B->get_inv_inertia())); memnew_placement(&m_jacAng[1], JacobianEntrySW(jointAxis1, - A->get_transform().basis.transposed(), - B->get_transform().basis.transposed(), + A->get_principal_inertia_axes().transposed(), + B->get_principal_inertia_axes().transposed(), A->get_inv_inertia(), B->get_inv_inertia())); memnew_placement(&m_jacAng[2], JacobianEntrySW(hingeAxisWorld, - A->get_transform().basis.transposed(), - B->get_transform().basis.transposed(), + A->get_principal_inertia_axes().transposed(), + B->get_principal_inertia_axes().transposed(), A->get_inv_inertia(), B->get_inv_inertia())); diff --git a/servers/physics/joints/hinge_joint_sw.h b/servers/physics/joints/hinge_joint_sw.h index f87c2ac4c5..60203e3cc4 100644 --- a/servers/physics/joints/hinge_joint_sw.h +++ b/servers/physics/joints/hinge_joint_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/joints/jacobian_entry_sw.h b/servers/physics/joints/jacobian_entry_sw.h index b7ab58f16b..cd85162ba5 100644 --- a/servers/physics/joints/jacobian_entry_sw.h +++ b/servers/physics/joints/jacobian_entry_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -56,8 +56,8 @@ public: JacobianEntrySW() {}; //constraint between two different rigidbodies JacobianEntrySW( - const Matrix3& world2A, - const Matrix3& world2B, + const Basis& world2A, + const Basis& world2B, const Vector3& rel_pos1,const Vector3& rel_pos2, const Vector3& jointAxis, const Vector3& inertiaInvA, @@ -77,8 +77,8 @@ public: //angular constraint between two different rigidbodies JacobianEntrySW(const Vector3& jointAxis, - const Matrix3& world2A, - const Matrix3& world2B, + const Basis& world2A, + const Basis& world2B, const Vector3& inertiaInvA, const Vector3& inertiaInvB) :m_linearJointAxis(Vector3(real_t(0.),real_t(0.),real_t(0.))) @@ -110,7 +110,7 @@ public: //constraint on one rigidbody JacobianEntrySW( - const Matrix3& world2A, + const Basis& world2A, const Vector3& rel_pos1,const Vector3& rel_pos2, const Vector3& jointAxis, const Vector3& inertiaInvA, diff --git a/servers/physics/joints/pin_joint_sw.cpp b/servers/physics/joints/pin_joint_sw.cpp index 013d750b4f..292d30443c 100644 --- a/servers/physics/joints/pin_joint_sw.cpp +++ b/servers/physics/joints/pin_joint_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -44,10 +44,10 @@ bool PinJointSW::setup(float p_step) { { normal[i] = 1; memnew_placement(&m_jac[i],JacobianEntrySW( - A->get_transform().basis.transposed(), - B->get_transform().basis.transposed(), - A->get_transform().xform(m_pivotInA) - A->get_transform().origin, - B->get_transform().xform(m_pivotInB) - B->get_transform().origin, + A->get_principal_inertia_axes().transposed(), + B->get_principal_inertia_axes().transposed(), + A->get_transform().xform(m_pivotInA) - A->get_transform().origin - A->get_center_of_mass(), + B->get_transform().xform(m_pivotInB) - B->get_transform().origin - B->get_center_of_mass(), normal, A->get_inv_inertia(), A->get_inv_mass(), diff --git a/servers/physics/joints/pin_joint_sw.h b/servers/physics/joints/pin_joint_sw.h index 4ef134fe73..6797972496 100644 --- a/servers/physics/joints/pin_joint_sw.h +++ b/servers/physics/joints/pin_joint_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/joints/slider_joint_sw.cpp b/servers/physics/joints/slider_joint_sw.cpp index a9072e5de3..bdcae08ca4 100644 --- a/servers/physics/joints/slider_joint_sw.cpp +++ b/servers/physics/joints/slider_joint_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -132,10 +132,10 @@ bool SliderJointSW::setup(float p_step) { normalWorld = m_calculatedTransformA.basis.get_axis(i); memnew_placement(&m_jacLin[i], JacobianEntrySW( - A->get_transform().basis.transposed(), - B->get_transform().basis.transposed(), - m_relPosA, - m_relPosB, + A->get_principal_inertia_axes().transposed(), + B->get_principal_inertia_axes().transposed(), + m_relPosA - A->get_center_of_mass(), + m_relPosB - B->get_center_of_mass(), normalWorld, A->get_inv_inertia(), A->get_inv_mass(), @@ -152,8 +152,8 @@ bool SliderJointSW::setup(float p_step) normalWorld = m_calculatedTransformA.basis.get_axis(i); memnew_placement(&m_jacAng[i], JacobianEntrySW( normalWorld, - A->get_transform().basis.transposed(), - B->get_transform().basis.transposed(), + A->get_principal_inertia_axes().transposed(), + B->get_principal_inertia_axes().transposed(), A->get_inv_inertia(), B->get_inv_inertia() )); diff --git a/servers/physics/joints/slider_joint_sw.h b/servers/physics/joints/slider_joint_sw.h index 9ee6c83800..4e697e6f64 100644 --- a/servers/physics/joints/slider_joint_sw.h +++ b/servers/physics/joints/slider_joint_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/joints_sw.h b/servers/physics/joints_sw.h index b54c655ea1..c87c86b599 100644 --- a/servers/physics/joints_sw.h +++ b/servers/physics/joints_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/physics_server_sw.cpp b/servers/physics/physics_server_sw.cpp index 6c098a6df2..4069ccdccb 100644 --- a/servers/physics/physics_server_sw.cpp +++ b/servers/physics/physics_server_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -805,6 +805,15 @@ void PhysicsServerSW::body_apply_impulse(RID p_body, const Vector3& p_pos, const body->wakeup(); }; +void PhysicsServerSW::body_apply_torque_impulse(RID p_body, const Vector3& p_impulse) { + + BodySW *body = body_owner.get(p_body); + ERR_FAIL_COND(!body); + + body->apply_torque_impulse(p_impulse); + body->wakeup(); +}; + void PhysicsServerSW::body_set_axis_velocity(RID p_body, const Vector3& p_axis_velocity) { BodySW *body = body_owner.get(p_body); diff --git a/servers/physics/physics_server_sw.h b/servers/physics/physics_server_sw.h index 59eeeb42a7..a3f98392fc 100644 --- a/servers/physics/physics_server_sw.h +++ b/servers/physics/physics_server_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,7 +39,7 @@ class PhysicsServerSW : public PhysicsServer { - OBJ_TYPE( PhysicsServerSW, PhysicsServer ); + GDCLASS( PhysicsServerSW, PhysicsServer ); friend class PhysicsDirectSpaceStateSW; bool active; @@ -193,6 +193,7 @@ public: virtual Vector3 body_get_applied_torque(RID p_body) const; virtual void body_apply_impulse(RID p_body, const Vector3& p_pos, const Vector3& p_impulse); + virtual void body_apply_torque_impulse(RID p_body, const Vector3& p_impulse); virtual void body_set_axis_velocity(RID p_body, const Vector3& p_axis_velocity); virtual void body_set_axis_lock(RID p_body,BodyAxisLock p_lock); diff --git a/servers/physics/shape_sw.cpp b/servers/physics/shape_sw.cpp index 1d4914c945..59ade71475 100644 --- a/servers/physics/shape_sw.cpp +++ b/servers/physics/shape_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ #define _FACE_IS_VALID_SUPPORT_TRESHOLD 0.9998 -void ShapeSW::configure(const AABB& p_aabb) { +void ShapeSW::configure(const Rect3& p_aabb) { aabb=p_aabb; configured=true; for (Map<ShapeOwnerSW*,int>::Element *E=owners.front();E;E=E->next()) { @@ -133,7 +133,7 @@ Vector3 PlaneShapeSW::get_moment_of_inertia(float p_mass) const { void PlaneShapeSW::_setup(const Plane& p_plane) { plane=p_plane; - configure(AABB(Vector3(-1e4,-1e4,-1e4),Vector3(1e4*2,1e4*2,1e4*2))); + configure(Rect3(Vector3(-1e4,-1e4,-1e4),Vector3(1e4*2,1e4*2,1e4*2))); } void PlaneShapeSW::set_data(const Variant& p_data) { @@ -204,7 +204,7 @@ Vector3 RayShapeSW::get_moment_of_inertia(float p_mass) const { void RayShapeSW::_setup(float p_length) { length=p_length; - configure(AABB(Vector3(0,0,0),Vector3(0.1,0.1,length))); + configure(Rect3(Vector3(0,0,0),Vector3(0.1,0.1,length))); } void RayShapeSW::set_data(const Variant& p_data) { @@ -271,7 +271,7 @@ void SphereShapeSW::_setup(real_t p_radius) { radius=p_radius; - configure(AABB( Vector3(-radius,-radius,-radius), Vector3(radius*2.0,radius*2.0,radius*2.0))); + configure(Rect3( Vector3(-radius,-radius,-radius), Vector3(radius*2.0,radius*2.0,radius*2.0))); } @@ -412,7 +412,7 @@ void BoxShapeSW::get_supports(const Vector3& p_normal,int p_max,Vector3 *r_suppo bool BoxShapeSW::intersect_segment(const Vector3& p_begin,const Vector3& p_end,Vector3 &r_result, Vector3 &r_normal) const { - AABB aabb(-half_extents,half_extents*2.0); + Rect3 aabb(-half_extents,half_extents*2.0); return aabb.intersects_segment(p_begin,p_end,&r_result,&r_normal); @@ -432,7 +432,7 @@ void BoxShapeSW::_setup(const Vector3& p_half_extents) { half_extents=p_half_extents.abs(); - configure(AABB(-half_extents,half_extents*2)); + configure(Rect3(-half_extents,half_extents*2)); } @@ -604,7 +604,7 @@ void CapsuleShapeSW::_setup(real_t p_height,real_t p_radius) { height=p_height; radius=p_radius; - configure(AABB(Vector3(-radius,-radius,-height*0.5-radius),Vector3(radius*2,radius*2,height+radius*2.0))); + configure(Rect3(Vector3(-radius,-radius,-height*0.5-radius),Vector3(radius*2,radius*2,height+radius*2.0))); } @@ -818,7 +818,7 @@ Vector3 ConvexPolygonShapeSW::get_moment_of_inertia(float p_mass) const { void ConvexPolygonShapeSW::_setup(const Vector<Vector3>& p_vertices) { Error err = QuickHull::build(p_vertices,mesh); - AABB _aabb; + Rect3 _aabb; for(int i=0;i<mesh.vertices.size();i++) { @@ -965,16 +965,16 @@ Vector3 FaceShapeSW::get_moment_of_inertia(float p_mass) const { FaceShapeSW::FaceShapeSW() { - configure(AABB()); + configure(Rect3()); } -DVector<Vector3> ConcavePolygonShapeSW::get_faces() const { +PoolVector<Vector3> ConcavePolygonShapeSW::get_faces() const { - DVector<Vector3> rfaces; + PoolVector<Vector3> rfaces; rfaces.resize(faces.size()*3); for(int i=0;i<faces.size();i++) { @@ -998,7 +998,7 @@ void ConcavePolygonShapeSW::project_range(const Vector3& p_normal, const Transfo r_max=0; return; } - DVector<Vector3>::Read r=vertices.read(); + PoolVector<Vector3>::Read r=vertices.read(); const Vector3 *vptr=r.ptr(); for (int i=0;i<count;i++) { @@ -1020,7 +1020,7 @@ Vector3 ConcavePolygonShapeSW::get_support(const Vector3& p_normal) const { if (count==0) return Vector3(); - DVector<Vector3>::Read r=vertices.read(); + PoolVector<Vector3>::Read r=vertices.read(); const Vector3 *vptr=r.ptr(); Vector3 n=p_normal; @@ -1111,9 +1111,9 @@ bool ConcavePolygonShapeSW::intersect_segment(const Vector3& p_begin,const Vecto return false; // unlock data - DVector<Face>::Read fr=faces.read(); - DVector<Vector3>::Read vr=vertices.read(); - DVector<BVH>::Read br=bvh.read(); + PoolVector<Face>::Read fr=faces.read(); + PoolVector<Vector3>::Read vr=vertices.read(); + PoolVector<BVH>::Read br=bvh.read(); _SegmentCullParams params; @@ -1175,18 +1175,18 @@ void ConcavePolygonShapeSW::_cull(int p_idx,_CullParams *p_params) const { } } -void ConcavePolygonShapeSW::cull(const AABB& p_local_aabb,Callback p_callback,void* p_userdata) const { +void ConcavePolygonShapeSW::cull(const Rect3& p_local_aabb,Callback p_callback,void* p_userdata) const { // make matrix local to concave if (faces.size()==0) return; - AABB local_aabb=p_local_aabb; + Rect3 local_aabb=p_local_aabb; // unlock data - DVector<Face>::Read fr=faces.read(); - DVector<Vector3>::Read vr=vertices.read(); - DVector<BVH>::Read br=bvh.read(); + PoolVector<Face>::Read fr=faces.read(); + PoolVector<Vector3>::Read vr=vertices.read(); + PoolVector<BVH>::Read br=bvh.read(); FaceShapeSW face; // use this to send in the callback @@ -1219,7 +1219,7 @@ Vector3 ConcavePolygonShapeSW::get_moment_of_inertia(float p_mass) const { struct _VolumeSW_BVH_Element { - AABB aabb; + Rect3 aabb; Vector3 center; int face_index; }; @@ -1251,7 +1251,7 @@ struct _VolumeSW_BVH_CompareZ { struct _VolumeSW_BVH { - AABB aabb; + Rect3 aabb; _VolumeSW_BVH *left; _VolumeSW_BVH *right; @@ -1276,7 +1276,7 @@ _VolumeSW_BVH* _volume_sw_build_bvh(_VolumeSW_BVH_Element *p_elements,int p_size bvh->face_index=-1; } - AABB aabb; + Rect3 aabb; for(int i=0;i<p_size;i++) { if (i==0) @@ -1347,17 +1347,17 @@ void ConcavePolygonShapeSW::_fill_bvh(_VolumeSW_BVH* p_bvh_tree,BVH* p_bvh_array } -void ConcavePolygonShapeSW::_setup(DVector<Vector3> p_faces) { +void ConcavePolygonShapeSW::_setup(PoolVector<Vector3> p_faces) { int src_face_count=p_faces.size(); if (src_face_count==0) { - configure(AABB()); + configure(Rect3()); return; } ERR_FAIL_COND(src_face_count%3); src_face_count/=3; - DVector<Vector3>::Read r = p_faces.read(); + PoolVector<Vector3>::Read r = p_faces.read(); const Vector3 * facesr= r.ptr(); #if 0 @@ -1399,7 +1399,7 @@ void ConcavePolygonShapeSW::_setup(DVector<Vector3> p_faces) { vertices.resize( point_map.size() ); - DVector<Vector3>::Write vw = vertices.write(); + PoolVector<Vector3>::Write vw = vertices.write(); Vector3 *verticesw=vw.ptr(); AABB _aabb; @@ -1418,7 +1418,7 @@ void ConcavePolygonShapeSW::_setup(DVector<Vector3> p_faces) { point_map.clear(); // not needed anymore faces.resize(face_list.size()); - DVector<Face>::Write w = faces.write(); + PoolVector<Face>::Write w = faces.write(); Face *facesw=w.ptr(); int fc=0; @@ -1431,10 +1431,10 @@ void ConcavePolygonShapeSW::_setup(DVector<Vector3> p_faces) { face_list.clear(); - DVector<_VolumeSW_BVH_Element> bvh_array; + PoolVector<_VolumeSW_BVH_Element> bvh_array; bvh_array.resize( fc ); - DVector<_VolumeSW_BVH_Element>::Write bvhw = bvh_array.write(); + PoolVector<_VolumeSW_BVH_Element>::Write bvhw = bvh_array.write(); _VolumeSW_BVH_Element *bvh_arrayw=bvhw.ptr(); @@ -1451,8 +1451,8 @@ void ConcavePolygonShapeSW::_setup(DVector<Vector3> p_faces) { } - w=DVector<Face>::Write(); - vw=DVector<Vector3>::Write(); + w=PoolVector<Face>::Write(); + vw=PoolVector<Vector3>::Write(); int count=0; @@ -1460,11 +1460,11 @@ void ConcavePolygonShapeSW::_setup(DVector<Vector3> p_faces) { ERR_FAIL_COND(count==0); - bvhw=DVector<_VolumeSW_BVH_Element>::Write(); + bvhw=PoolVector<_VolumeSW_BVH_Element>::Write(); bvh.resize( count+1 ); - DVector<BVH>::Write bvhw2 = bvh.write(); + PoolVector<BVH>::Write bvhw2 = bvh.write(); BVH*bvh_arrayw2=bvhw2.ptr(); int idx=0; @@ -1473,22 +1473,22 @@ void ConcavePolygonShapeSW::_setup(DVector<Vector3> p_faces) { set_aabb(_aabb); #else - DVector<_VolumeSW_BVH_Element> bvh_array; + PoolVector<_VolumeSW_BVH_Element> bvh_array; bvh_array.resize( src_face_count ); - DVector<_VolumeSW_BVH_Element>::Write bvhw = bvh_array.write(); + PoolVector<_VolumeSW_BVH_Element>::Write bvhw = bvh_array.write(); _VolumeSW_BVH_Element *bvh_arrayw=bvhw.ptr(); faces.resize(src_face_count); - DVector<Face>::Write w = faces.write(); + PoolVector<Face>::Write w = faces.write(); Face *facesw=w.ptr(); vertices.resize( src_face_count*3 ); - DVector<Vector3>::Write vw = vertices.write(); + PoolVector<Vector3>::Write vw = vertices.write(); Vector3 *verticesw=vw.ptr(); - AABB _aabb; + Rect3 _aabb; for(int i=0;i<src_face_count;i++) { @@ -1512,15 +1512,15 @@ void ConcavePolygonShapeSW::_setup(DVector<Vector3> p_faces) { } - w=DVector<Face>::Write(); - vw=DVector<Vector3>::Write(); + w=PoolVector<Face>::Write(); + vw=PoolVector<Vector3>::Write(); int count=0; _VolumeSW_BVH *bvh_tree=_volume_sw_build_bvh(bvh_arrayw,src_face_count,count); bvh.resize( count+1 ); - DVector<BVH>::Write bvhw2 = bvh.write(); + PoolVector<BVH>::Write bvhw2 = bvh.write(); BVH*bvh_arrayw2=bvhw2.ptr(); int idx=0; @@ -1553,7 +1553,7 @@ ConcavePolygonShapeSW::ConcavePolygonShapeSW() { /* HEIGHT MAP SHAPE */ -DVector<float> HeightMapShapeSW::get_heights() const { +PoolVector<float> HeightMapShapeSW::get_heights() const { return heights; } @@ -1593,7 +1593,7 @@ bool HeightMapShapeSW::intersect_segment(const Vector3& p_begin,const Vector3& p } -void HeightMapShapeSW::cull(const AABB& p_local_aabb,Callback p_callback,void* p_userdata) const { +void HeightMapShapeSW::cull(const Rect3& p_local_aabb,Callback p_callback,void* p_userdata) const { @@ -1614,16 +1614,16 @@ Vector3 HeightMapShapeSW::get_moment_of_inertia(float p_mass) const { } -void HeightMapShapeSW::_setup(DVector<real_t> p_heights,int p_width,int p_depth,real_t p_cell_size) { +void HeightMapShapeSW::_setup(PoolVector<real_t> p_heights,int p_width,int p_depth,real_t p_cell_size) { heights=p_heights; width=p_width; depth=p_depth;; cell_size=p_cell_size; - DVector<real_t>::Read r = heights. read(); + PoolVector<real_t>::Read r = heights. read(); - AABB aabb; + Rect3 aabb; for(int i=0;i<depth;i++) { @@ -1656,7 +1656,7 @@ void HeightMapShapeSW::set_data(const Variant& p_data) { int width=d["width"]; int depth=d["depth"]; float cell_size=d["cell_size"]; - DVector<float> heights=d["heights"]; + PoolVector<float> heights=d["heights"]; ERR_FAIL_COND( width<= 0); ERR_FAIL_COND( depth<= 0); diff --git a/servers/physics/shape_sw.h b/servers/physics/shape_sw.h index 39779bcda3..3cbd1c9609 100644 --- a/servers/physics/shape_sw.h +++ b/servers/physics/shape_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -46,7 +46,7 @@ SHAPE_CUSTOM, ///< Server-Implementation based custom shape, calling shape_creat class ShapeSW; -class ShapeOwnerSW { +class ShapeOwnerSW : public RID_Data { public: virtual void _shape_changed()=0; @@ -56,29 +56,31 @@ public: }; -class ShapeSW { +class ShapeSW : public RID_Data { RID self; - AABB aabb; + Rect3 aabb; bool configured; real_t custom_bias; Map<ShapeOwnerSW*,int> owners; protected: - void configure(const AABB& p_aabb); + void configure(const Rect3& p_aabb); public: enum { MAX_SUPPORTS=8 }; + virtual real_t get_area() const { return aabb.get_area();} + _FORCE_INLINE_ void set_self(const RID& p_self) { self=p_self; } _FORCE_INLINE_ RID get_self() const {return self; } virtual PhysicsServer::ShapeType get_type() const=0; - _FORCE_INLINE_ AABB get_aabb() const { return aabb; } + _FORCE_INLINE_ Rect3 get_aabb() const { return aabb; } _FORCE_INLINE_ bool is_configured() const { return configured; } virtual bool is_concave() const { return false; } @@ -114,7 +116,7 @@ public: typedef void (*Callback)(void* p_userdata,ShapeSW *p_convex); virtual void get_supports(const Vector3& p_normal,int p_max,Vector3 *r_supports,int & r_amount) const { r_amount=0; } - virtual void cull(const AABB& p_local_aabb,Callback p_callback,void* p_userdata) const=0; + virtual void cull(const Rect3& p_local_aabb,Callback p_callback,void* p_userdata) const=0; ConcaveShapeSW() {} }; @@ -128,6 +130,7 @@ public: Plane get_plane() const; + virtual real_t get_area() const { return INFINITY; } virtual PhysicsServer::ShapeType get_type() const { return PhysicsServer::SHAPE_PLANE; } virtual void project_range(const Vector3& p_normal, const Transform& p_transform, real_t &r_min, real_t &r_max) const; virtual Vector3 get_support(const Vector3& p_normal) const; @@ -152,6 +155,7 @@ public: float get_length() const; + virtual real_t get_area() const { return 0.0; } virtual PhysicsServer::ShapeType get_type() const { return PhysicsServer::SHAPE_RAY; } virtual void project_range(const Vector3& p_normal, const Transform& p_transform, real_t &r_min, real_t &r_max) const; virtual Vector3 get_support(const Vector3& p_normal) const; @@ -176,6 +180,8 @@ public: real_t get_radius() const; + virtual real_t get_area() const { return 4.0/3.0 * Math_PI * radius * radius * radius; } + virtual PhysicsServer::ShapeType get_type() const { return PhysicsServer::SHAPE_SPHERE; } virtual void project_range(const Vector3& p_normal, const Transform& p_transform, real_t &r_min, real_t &r_max) const; @@ -198,6 +204,7 @@ class BoxShapeSW : public ShapeSW { public: _FORCE_INLINE_ Vector3 get_half_extents() const { return half_extents; } + virtual real_t get_area() const { return 8 * half_extents.x * half_extents.y * half_extents.z; } virtual PhysicsServer::ShapeType get_type() const { return PhysicsServer::SHAPE_BOX; } @@ -226,6 +233,8 @@ public: _FORCE_INLINE_ real_t get_height() const { return height; } _FORCE_INLINE_ real_t get_radius() const { return radius; } + virtual real_t get_area() { return 4.0/3.0 * Math_PI * radius * radius * radius + height * Math_PI * radius * radius; } + virtual PhysicsServer::ShapeType get_type() const { return PhysicsServer::SHAPE_CAPSULE; } virtual void project_range(const Vector3& p_normal, const Transform& p_transform, real_t &r_min, real_t &r_max) const; @@ -279,23 +288,23 @@ struct ConcavePolygonShapeSW : public ConcaveShapeSW { int indices[3]; }; - DVector<Face> faces; - DVector<Vector3> vertices; + PoolVector<Face> faces; + PoolVector<Vector3> vertices; struct BVH { - AABB aabb; + Rect3 aabb; int left; int right; int face_index; }; - DVector<BVH> bvh; + PoolVector<BVH> bvh; struct _CullParams { - AABB aabb; + Rect3 aabb; Callback callback; void *userdata; const Face *faces; @@ -326,10 +335,10 @@ struct ConcavePolygonShapeSW : public ConcaveShapeSW { void _fill_bvh(_VolumeSW_BVH* p_bvh_tree,BVH* p_bvh_array,int& p_idx); - void _setup(DVector<Vector3> p_faces); + void _setup(PoolVector<Vector3> p_faces); public: - DVector<Vector3> get_faces() const; + PoolVector<Vector3> get_faces() const; virtual PhysicsServer::ShapeType get_type() const { return PhysicsServer::SHAPE_CONCAVE_POLYGON; } @@ -338,7 +347,7 @@ public: virtual bool intersect_segment(const Vector3& p_begin,const Vector3& p_end,Vector3 &r_result, Vector3 &r_normal) const; - virtual void cull(const AABB& p_local_aabb,Callback p_callback,void* p_userdata) const; + virtual void cull(const Rect3& p_local_aabb,Callback p_callback,void* p_userdata) const; virtual Vector3 get_moment_of_inertia(float p_mass) const; @@ -352,7 +361,7 @@ public: struct HeightMapShapeSW : public ConcaveShapeSW { - DVector<real_t> heights; + PoolVector<real_t> heights; int width; int depth; float cell_size; @@ -360,10 +369,10 @@ struct HeightMapShapeSW : public ConcaveShapeSW { // void _cull_segment(int p_idx,_SegmentCullParams *p_params) const; // void _cull(int p_idx,_CullParams *p_params) const; - void _setup(DVector<float> p_heights,int p_width,int p_depth,float p_cell_size); + void _setup(PoolVector<float> p_heights,int p_width,int p_depth,float p_cell_size); public: - DVector<real_t> get_heights() const; + PoolVector<real_t> get_heights() const; int get_width() const; int get_depth() const; float get_cell_size() const; @@ -374,7 +383,7 @@ public: virtual Vector3 get_support(const Vector3& p_normal) const; virtual bool intersect_segment(const Vector3& p_begin,const Vector3& p_end,Vector3 &r_result, Vector3 &r_normal) const; - virtual void cull(const AABB& p_local_aabb,Callback p_callback,void* p_userdata) const; + virtual void cull(const Rect3& p_local_aabb,Callback p_callback,void* p_userdata) const; virtual Vector3 get_moment_of_inertia(float p_mass) const; @@ -446,7 +455,7 @@ struct MotionShapeSW : public ShapeSW { virtual void set_data(const Variant& p_data) {} virtual Variant get_data() const { return Variant(); } - MotionShapeSW() { configure(AABB()); } + MotionShapeSW() { configure(Rect3()); } }; diff --git a/servers/physics/space_sw.cpp b/servers/physics/space_sw.cpp index 9755c49e2d..d73d5f140e 100644 --- a/servers/physics/space_sw.cpp +++ b/servers/physics/space_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -146,7 +146,7 @@ int PhysicsDirectSpaceStateSW::intersect_shape(const RID& p_shape, const Transfo ShapeSW *shape = static_cast<PhysicsServerSW*>(PhysicsServer::get_singleton())->shape_owner.get(p_shape); ERR_FAIL_COND_V(!shape,0); - AABB aabb = p_xform.xform(shape->get_aabb()); + Rect3 aabb = p_xform.xform(shape->get_aabb()); int amount = space->broadphase->cull_aabb(aabb,space->intersection_query_results,SpaceSW::INTERSECTION_QUERY_MAX,space->intersection_query_subindex_results); @@ -200,8 +200,8 @@ bool PhysicsDirectSpaceStateSW::cast_motion(const RID& p_shape, const Transform& ShapeSW *shape = static_cast<PhysicsServerSW*>(PhysicsServer::get_singleton())->shape_owner.get(p_shape); ERR_FAIL_COND_V(!shape,false); - AABB aabb = p_xform.xform(shape->get_aabb()); - aabb=aabb.merge(AABB(aabb.pos+p_motion,aabb.size)); //motion + Rect3 aabb = p_xform.xform(shape->get_aabb()); + aabb=aabb.merge(Rect3(aabb.pos+p_motion,aabb.size)); //motion aabb=aabb.grow(p_margin); //if (p_motion!=Vector3()) @@ -329,7 +329,7 @@ bool PhysicsDirectSpaceStateSW::collide_shape(RID p_shape, const Transform& p_sh ShapeSW *shape = static_cast<PhysicsServerSW*>(PhysicsServer::get_singleton())->shape_owner.get(p_shape); ERR_FAIL_COND_V(!shape,0); - AABB aabb = p_shape_xform.xform(shape->get_aabb()); + Rect3 aabb = p_shape_xform.xform(shape->get_aabb()); aabb=aabb.grow(p_margin); int amount = space->broadphase->cull_aabb(aabb,space->intersection_query_results,SpaceSW::INTERSECTION_QUERY_MAX,space->intersection_query_subindex_results); @@ -412,7 +412,7 @@ bool PhysicsDirectSpaceStateSW::rest_info(RID p_shape, const Transform& p_shape_ ShapeSW *shape = static_cast<PhysicsServerSW*>(PhysicsServer::get_singleton())->shape_owner.get(p_shape); ERR_FAIL_COND_V(!shape,0); - AABB aabb = p_shape_xform.xform(shape->get_aabb()); + Rect3 aabb = p_shape_xform.xform(shape->get_aabb()); aabb=aabb.grow(p_margin); int amount = space->broadphase->cull_aabb(aabb,space->intersection_query_results,SpaceSW::INTERSECTION_QUERY_MAX,space->intersection_query_subindex_results); @@ -719,9 +719,9 @@ SpaceSW::SpaceSW() { contact_max_allowed_penetration= 0.01; constraint_bias = 0.01; - body_linear_velocity_sleep_threshold=GLOBAL_DEF("physics/sleep_threshold_linear",0.1); - body_angular_velocity_sleep_threshold=GLOBAL_DEF("physics/sleep_threshold_angular", (8.0 / 180.0 * Math_PI) ); - body_time_to_sleep=GLOBAL_DEF("physics/time_before_sleep",0.5); + body_linear_velocity_sleep_threshold=GLOBAL_DEF("physics/3d/sleep_threshold_linear",0.1); + body_angular_velocity_sleep_threshold=GLOBAL_DEF("physics/3d/sleep_threshold_angular", (8.0 / 180.0 * Math_PI) ); + body_time_to_sleep=GLOBAL_DEF("physics/3d/time_before_sleep",0.5); body_angular_velocity_damp_ratio=10; diff --git a/servers/physics/space_sw.h b/servers/physics/space_sw.h index 29eca2690a..0abc4726ea 100644 --- a/servers/physics/space_sw.h +++ b/servers/physics/space_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -42,7 +42,7 @@ class PhysicsDirectSpaceStateSW : public PhysicsDirectSpaceState { - OBJ_TYPE( PhysicsDirectSpaceStateSW, PhysicsDirectSpaceState ); + GDCLASS( PhysicsDirectSpaceStateSW, PhysicsDirectSpaceState ); public: SpaceSW *space; @@ -58,7 +58,7 @@ public: -class SpaceSW { +class SpaceSW : public RID_Data { public: diff --git a/servers/physics/step_sw.cpp b/servers/physics/step_sw.cpp index 5b7ebce817..e24081761b 100644 --- a/servers/physics/step_sw.cpp +++ b/servers/physics/step_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics/step_sw.h b/servers/physics/step_sw.h index f6362f3777..2f67b3c8df 100644 --- a/servers/physics/step_sw.h +++ b/servers/physics/step_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/area_2d_sw.cpp b/servers/physics_2d/area_2d_sw.cpp index 759a37e84f..8ccdd51067 100644 --- a/servers/physics_2d/area_2d_sw.cpp +++ b/servers/physics_2d/area_2d_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -38,7 +38,7 @@ void Area2DSW::_shapes_changed() { } -void Area2DSW::set_transform(const Matrix32& p_transform) { +void Area2DSW::set_transform(const Transform2D& p_transform) { if (!moved_list.in_list() && get_space()) get_space()->area_add_to_moved_list(&moved_list); diff --git a/servers/physics_2d/area_2d_sw.h b/servers/physics_2d/area_2d_sw.h index 71192db1df..6e79b28afc 100644 --- a/servers/physics_2d/area_2d_sw.h +++ b/servers/physics_2d/area_2d_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -162,7 +162,7 @@ public: void set_monitorable(bool p_monitorable); _FORCE_INLINE_ bool is_monitorable() const { return monitorable; } - void set_transform(const Matrix32& p_transform); + void set_transform(const Transform2D& p_transform); void set_space(Space2DSW *p_space); diff --git a/servers/physics_2d/area_pair_2d_sw.cpp b/servers/physics_2d/area_pair_2d_sw.cpp index 0682d8abdd..c26f6c45fd 100644 --- a/servers/physics_2d/area_pair_2d_sw.cpp +++ b/servers/physics_2d/area_pair_2d_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/area_pair_2d_sw.h b/servers/physics_2d/area_pair_2d_sw.h index a03bdb572a..db77bff5d4 100644 --- a/servers/physics_2d/area_pair_2d_sw.h +++ b/servers/physics_2d/area_pair_2d_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/body_2d_sw.cpp b/servers/physics_2d/body_2d_sw.cpp index 12ac0bd1ca..a32e024fe9 100644 --- a/servers/physics_2d/body_2d_sw.cpp +++ b/servers/physics_2d/body_2d_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -68,7 +68,7 @@ void Body2DSW::update_inertias() { float mass = area * this->mass / total_area; - Matrix32 mtx = get_shape_transform(i); + Transform2D mtx = get_shape_transform(i); Vector2 scale = mtx.get_scale(); _inertia += shape->get_moment_of_inertia(mass,scale) + mass * mtx.get_origin().length_squared(); //Rect2 ab = get_shape_aabb(i); @@ -287,7 +287,7 @@ void Body2DSW::set_state(Physics2DServer::BodyState p_state, const Variant& p_va _set_inv_transform(get_transform().affine_inverse()); wakeup_neighbours(); } else { - Matrix32 t = p_variant; + Transform2D t = p_variant; t.orthonormalize(); new_transform=get_transform(); //used as old to compute motion if (t==new_transform) @@ -473,12 +473,13 @@ void Body2DSW::integrate_forces(real_t p_step) { if (mode==Physics2DServer::BODY_MODE_KINEMATIC) { //compute motion, angular and etc. velocities from prev transform - linear_velocity = (new_transform.elements[2] - get_transform().elements[2])/p_step; + motion = new_transform.get_origin() - get_transform().get_origin(); + linear_velocity = motion/p_step; - real_t rot = new_transform.affine_inverse().basis_xform(get_transform().elements[1]).angle(); + real_t rot = new_transform.get_rotation() - get_transform().get_rotation(); angular_velocity = rot / p_step; - motion = new_transform.elements[2] - get_transform().elements[2]; + do_motion=true; //for(int i=0;i<get_shape_count();i++) { @@ -556,10 +557,10 @@ void Body2DSW::integrate_velocities(real_t p_step) { real_t total_angular_velocity = angular_velocity+biased_angular_velocity; Vector2 total_linear_velocity=linear_velocity+biased_linear_velocity; - real_t angle = get_transform().get_rotation() - total_angular_velocity * p_step; + real_t angle = get_transform().get_rotation() + total_angular_velocity * p_step; Vector2 pos = get_transform().get_origin() + total_linear_velocity * p_step; - _set_transform(Matrix32(angle,pos),continuous_cd_mode==Physics2DServer::CCD_MODE_DISABLED); + _set_transform(Transform2D(angle,pos),continuous_cd_mode==Physics2DServer::CCD_MODE_DISABLED); _set_inv_transform(get_transform().inverse()); if (continuous_cd_mode!=Physics2DServer::CCD_MODE_DISABLED) diff --git a/servers/physics_2d/body_2d_sw.h b/servers/physics_2d/body_2d_sw.h index ed98017629..bf9dcaa9b0 100644 --- a/servers/physics_2d/body_2d_sw.h +++ b/servers/physics_2d/body_2d_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -86,7 +86,7 @@ class Body2DSW : public CollisionObject2DSW { bool using_one_way_cache; void _update_inertia(); virtual void _shapes_changed(); - Matrix32 new_transform; + Transform2D new_transform; Map<Constraint2DSW*,int> constraint_map; @@ -352,7 +352,7 @@ void Body2DSW::add_contact(const Vector2& p_local_pos,const Vector2& p_local_nor class Physics2DDirectBodyStateSW : public Physics2DDirectBodyState { - OBJ_TYPE( Physics2DDirectBodyStateSW, Physics2DDirectBodyState ); + GDCLASS( Physics2DDirectBodyStateSW, Physics2DDirectBodyState ); public: @@ -373,8 +373,8 @@ public: virtual void set_angular_velocity(real_t p_velocity) { body->set_angular_velocity(p_velocity); } virtual real_t get_angular_velocity() const { return body->get_angular_velocity(); } - virtual void set_transform(const Matrix32& p_transform) { body->set_state(Physics2DServer::BODY_STATE_TRANSFORM,p_transform); } - virtual Matrix32 get_transform() const { return body->get_transform(); } + virtual void set_transform(const Transform2D& p_transform) { body->set_state(Physics2DServer::BODY_STATE_TRANSFORM,p_transform); } + virtual Transform2D get_transform() const { return body->get_transform(); } virtual void set_sleep_state(bool p_enable) { body->set_active(!p_enable); } virtual bool is_sleeping() const { return !body->is_active(); } diff --git a/servers/physics_2d/body_pair_2d_sw.cpp b/servers/physics_2d/body_pair_2d_sw.cpp index ba0358a1f2..72ae221c39 100644 --- a/servers/physics_2d/body_pair_2d_sw.cpp +++ b/servers/physics_2d/body_pair_2d_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -175,7 +175,7 @@ void BodyPair2DSW::_validate_contacts() { } -bool BodyPair2DSW::_test_ccd(float p_step,Body2DSW *p_A, int p_shape_A,const Matrix32& p_xform_A,Body2DSW *p_B, int p_shape_B,const Matrix32& p_xform_B,bool p_swap_result) { +bool BodyPair2DSW::_test_ccd(float p_step,Body2DSW *p_A, int p_shape_A,const Transform2D& p_xform_A,Body2DSW *p_B, int p_shape_B,const Transform2D& p_xform_B,bool p_swap_result) { @@ -202,7 +202,7 @@ bool BodyPair2DSW::_test_ccd(float p_step,Body2DSW *p_A, int p_shape_A,const Mat Vector2 from = p_xform_A.xform(s[0]); Vector2 to = from + motion; - Matrix32 from_inv = p_xform_B.affine_inverse(); + Transform2D from_inv = p_xform_B.affine_inverse(); Vector2 local_from = from_inv.xform(from-mnormal*mlen*0.1); //start from a little inside the bounding box Vector2 local_to = from_inv.xform(to); @@ -245,12 +245,12 @@ bool BodyPair2DSW::setup(float p_step) { _validate_contacts(); Vector2 offset_A = A->get_transform().get_origin(); - Matrix32 xform_Au = A->get_transform().untranslated(); - Matrix32 xform_A = xform_Au * A->get_shape_transform(shape_A); + Transform2D xform_Au = A->get_transform().untranslated(); + Transform2D xform_A = xform_Au * A->get_shape_transform(shape_A); - Matrix32 xform_Bu = B->get_transform(); - xform_Bu.elements[2]-=A->get_transform().get_origin(); - Matrix32 xform_B = xform_Bu * B->get_shape_transform(shape_B); + Transform2D xform_Bu = B->get_transform(); + xform_Bu.translate(-A->get_transform().get_origin()); + Transform2D xform_B = xform_Bu * B->get_shape_transform(shape_B); Shape2DSW *shape_A_ptr=A->get_shape(shape_A); Shape2DSW *shape_B_ptr=B->get_shape(shape_B); diff --git a/servers/physics_2d/body_pair_2d_sw.h b/servers/physics_2d/body_pair_2d_sw.h index a16320585e..b9ff1bd758 100644 --- a/servers/physics_2d/body_pair_2d_sw.h +++ b/servers/physics_2d/body_pair_2d_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -80,7 +80,7 @@ class BodyPair2DSW : public Constraint2DSW { int cc; - bool _test_ccd(float p_step,Body2DSW *p_A, int p_shape_A,const Matrix32& p_xform_A,Body2DSW *p_B, int p_shape_B,const Matrix32& p_xform_B,bool p_swap_result=false); + bool _test_ccd(float p_step,Body2DSW *p_A, int p_shape_A,const Transform2D& p_xform_A,Body2DSW *p_B, int p_shape_B,const Transform2D& p_xform_B,bool p_swap_result=false); void _validate_contacts(); static void _add_contact(const Vector2& p_point_A,const Vector2& p_point_B,void *p_self); _FORCE_INLINE_ void _contact_added_callback(const Vector2& p_point_A,const Vector2& p_point_B); diff --git a/servers/physics_2d/broad_phase_2d_basic.cpp b/servers/physics_2d/broad_phase_2d_basic.cpp index 3a95bb2411..e1f6f4f92b 100644 --- a/servers/physics_2d/broad_phase_2d_basic.cpp +++ b/servers/physics_2d/broad_phase_2d_basic.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -28,7 +28,7 @@ /*************************************************************************/ #include "broad_phase_2d_basic.h" -ID BroadPhase2DBasic::create(CollisionObject2DSW *p_object_, int p_subindex) { +BroadPhase2DBasic::ID BroadPhase2DBasic::create(CollisionObject2DSW *p_object_, int p_subindex) { current++; diff --git a/servers/physics_2d/broad_phase_2d_basic.h b/servers/physics_2d/broad_phase_2d_basic.h index 80aa423819..82e91118ce 100644 --- a/servers/physics_2d/broad_phase_2d_basic.h +++ b/servers/physics_2d/broad_phase_2d_basic.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/broad_phase_2d_hash_grid.cpp b/servers/physics_2d/broad_phase_2d_hash_grid.cpp index 953c87021f..efa12c37cb 100644 --- a/servers/physics_2d/broad_phase_2d_hash_grid.cpp +++ b/servers/physics_2d/broad_phase_2d_hash_grid.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -683,12 +683,12 @@ BroadPhase2DSW *BroadPhase2DHashGrid::_create() { BroadPhase2DHashGrid::BroadPhase2DHashGrid() { - hash_table_size = GLOBAL_DEF("physics_2d/bp_hash_table_size",4096); + hash_table_size = GLOBAL_DEF("physics/2d/bp_hash_table_size",4096); hash_table_size = Math::larger_prime(hash_table_size); hash_table = memnew_arr( PosBin*, hash_table_size); - cell_size = GLOBAL_DEF("physics_2d/cell_size",128); - large_object_min_surface = GLOBAL_DEF("physics_2d/large_object_surface_treshold_in_cells",512); + cell_size = GLOBAL_DEF("physics/2d/cell_size",128); + large_object_min_surface = GLOBAL_DEF("physics/2d/large_object_surface_treshold_in_cells",512); for(int i=0;i<hash_table_size;i++) hash_table[i]=NULL; diff --git a/servers/physics_2d/broad_phase_2d_hash_grid.h b/servers/physics_2d/broad_phase_2d_hash_grid.h index 561d488484..857053ccf0 100644 --- a/servers/physics_2d/broad_phase_2d_hash_grid.h +++ b/servers/physics_2d/broad_phase_2d_hash_grid.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/broad_phase_2d_sw.cpp b/servers/physics_2d/broad_phase_2d_sw.cpp index 0dead94ca1..4347155c2c 100644 --- a/servers/physics_2d/broad_phase_2d_sw.cpp +++ b/servers/physics_2d/broad_phase_2d_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/broad_phase_2d_sw.h b/servers/physics_2d/broad_phase_2d_sw.h index 056ef664fd..b9ec434ae9 100644 --- a/servers/physics_2d/broad_phase_2d_sw.h +++ b/servers/physics_2d/broad_phase_2d_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/collision_object_2d_sw.cpp b/servers/physics_2d/collision_object_2d_sw.cpp index 7f9d3312b9..9ae0e40417 100644 --- a/servers/physics_2d/collision_object_2d_sw.cpp +++ b/servers/physics_2d/collision_object_2d_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -29,7 +29,7 @@ #include "collision_object_2d_sw.h" #include "space_2d_sw.h" -void CollisionObject2DSW::add_shape(Shape2DSW *p_shape,const Matrix32& p_transform) { +void CollisionObject2DSW::add_shape(Shape2DSW *p_shape,const Transform2D& p_transform) { Shape s; s.shape=p_shape; @@ -63,7 +63,7 @@ void CollisionObject2DSW::set_shape_metadata(int p_index,const Variant& p_metada } -void CollisionObject2DSW::set_shape_transform(int p_index,const Matrix32& p_transform){ +void CollisionObject2DSW::set_shape_transform(int p_index,const Transform2D& p_transform){ ERR_FAIL_INDEX(p_index,shapes.size()); @@ -149,7 +149,7 @@ void CollisionObject2DSW::_update_shapes() { //not quite correct, should compute the next matrix.. Rect2 shape_aabb=s.shape->get_aabb(); - Matrix32 xform = transform * s.xform; + Transform2D xform = transform * s.xform; shape_aabb=xform.xform(shape_aabb); s.aabb_cache=shape_aabb; s.aabb_cache=s.aabb_cache.grow( (s.aabb_cache.size.x + s.aabb_cache.size.y)*0.5*0.05 ); @@ -176,7 +176,7 @@ void CollisionObject2DSW::_update_shapes_with_motion(const Vector2& p_motion) { //not quite correct, should compute the next matrix.. Rect2 shape_aabb=s.shape->get_aabb(); - Matrix32 xform = transform * s.xform; + Transform2D xform = transform * s.xform; shape_aabb=xform.xform(shape_aabb); shape_aabb=shape_aabb.merge(Rect2( shape_aabb.pos+p_motion,shape_aabb.size)); //use motion s.aabb_cache=shape_aabb; diff --git a/servers/physics_2d/collision_object_2d_sw.h b/servers/physics_2d/collision_object_2d_sw.h index 1f213d8444..0f77e9b426 100644 --- a/servers/physics_2d/collision_object_2d_sw.h +++ b/servers/physics_2d/collision_object_2d_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -51,8 +51,8 @@ private: struct Shape { - Matrix32 xform; - Matrix32 xform_inv; + Transform2D xform; + Transform2D xform_inv; BroadPhase2DSW::ID bpid; Rect2 aabb_cache; //for rayqueries Shape2DSW *shape; @@ -63,8 +63,8 @@ private: Vector<Shape> shapes; Space2DSW *space; - Matrix32 transform; - Matrix32 inv_transform; + Transform2D transform; + Transform2D inv_transform; uint32_t collision_mask; uint32_t layer_mask; bool _static; @@ -77,8 +77,8 @@ protected: void _update_shapes_with_motion(const Vector2& p_motion); void _unregister_shapes(); - _FORCE_INLINE_ void _set_transform(const Matrix32& p_transform, bool p_update_shapes=true) { transform=p_transform; if (p_update_shapes) {_update_shapes();} } - _FORCE_INLINE_ void _set_inv_transform(const Matrix32& p_transform) { inv_transform=p_transform; } + _FORCE_INLINE_ void _set_transform(const Transform2D& p_transform, bool p_update_shapes=true) { transform=p_transform; if (p_update_shapes) {_update_shapes();} } + _FORCE_INLINE_ void _set_inv_transform(const Transform2D& p_transform) { inv_transform=p_transform; } void _set_static(bool p_static); virtual void _shapes_changed()=0; @@ -96,21 +96,21 @@ public: void _shape_changed(); _FORCE_INLINE_ Type get_type() const { return type; } - void add_shape(Shape2DSW *p_shape,const Matrix32& p_transform=Matrix32()); + void add_shape(Shape2DSW *p_shape,const Transform2D& p_transform=Transform2D()); void set_shape(int p_index,Shape2DSW *p_shape); - void set_shape_transform(int p_index,const Matrix32& p_transform); + void set_shape_transform(int p_index,const Transform2D& p_transform); void set_shape_metadata(int p_index,const Variant& p_metadata); _FORCE_INLINE_ int get_shape_count() const { return shapes.size(); } _FORCE_INLINE_ Shape2DSW *get_shape(int p_index) const { return shapes[p_index].shape; } - _FORCE_INLINE_ const Matrix32& get_shape_transform(int p_index) const { return shapes[p_index].xform; } - _FORCE_INLINE_ const Matrix32& get_shape_inv_transform(int p_index) const { return shapes[p_index].xform_inv; } + _FORCE_INLINE_ const Transform2D& get_shape_transform(int p_index) const { return shapes[p_index].xform; } + _FORCE_INLINE_ const Transform2D& get_shape_inv_transform(int p_index) const { return shapes[p_index].xform_inv; } _FORCE_INLINE_ const Rect2& get_shape_aabb(int p_index) const { return shapes[p_index].aabb_cache; } _FORCE_INLINE_ const Variant& get_shape_metadata(int p_index) const { return shapes[p_index].metadata; } - _FORCE_INLINE_ Matrix32 get_transform() const { return transform; } - _FORCE_INLINE_ Matrix32 get_inv_transform() const { return inv_transform; } + _FORCE_INLINE_ Transform2D get_transform() const { return transform; } + _FORCE_INLINE_ Transform2D get_inv_transform() const { return inv_transform; } _FORCE_INLINE_ Space2DSW* get_space() const { return space; } _FORCE_INLINE_ void set_shape_as_trigger(int p_idx,bool p_enable) { shapes[p_idx].trigger=p_enable; } diff --git a/servers/physics_2d/collision_solver_2d_sat.cpp b/servers/physics_2d/collision_solver_2d_sat.cpp index a6d12bdada..2e7b0d8835 100644 --- a/servers/physics_2d/collision_solver_2d_sat.cpp +++ b/servers/physics_2d/collision_solver_2d_sat.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -343,8 +343,8 @@ class SeparatorAxisTest2D { const ShapeA *shape_A; const ShapeB *shape_B; - const Matrix32 *transform_A; - const Matrix32 *transform_B; + const Transform2D *transform_A; + const Transform2D *transform_B; real_t best_depth; Vector2 best_axis; int best_axis_count; @@ -560,7 +560,7 @@ public: } - _FORCE_INLINE_ SeparatorAxisTest2D(const ShapeA *p_shape_A,const Matrix32& p_transform_a, const ShapeB *p_shape_B,const Matrix32& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_A=Vector2(), const Vector2& p_motion_B=Vector2(),real_t p_margin_A=0,real_t p_margin_B=0) { + _FORCE_INLINE_ SeparatorAxisTest2D(const ShapeA *p_shape_A,const Transform2D& p_transform_a, const ShapeB *p_shape_B,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_A=Vector2(), const Vector2& p_motion_B=Vector2(),real_t p_margin_A=0,real_t p_margin_B=0) { margin_A=p_margin_A; margin_B=p_margin_B; @@ -594,11 +594,11 @@ public: (castA && castB && !separator.test_axis(((m_a)+p_motion_a-((m_b)+p_motion_b)).normalized())) ) -typedef void (*CollisionFunc)(const Shape2DSW*,const Matrix32&,const Shape2DSW*,const Matrix32&,_CollectorCallback2D *p_collector,const Vector2&,const Vector2&,float,float); +typedef void (*CollisionFunc)(const Shape2DSW*,const Transform2D&,const Shape2DSW*,const Transform2D&,_CollectorCallback2D *p_collector,const Vector2&,const Vector2&,float,float); template<bool castA, bool castB,bool withMargin> -static void _collision_segment_segment(const Shape2DSW* p_a,const Matrix32& p_transform_a,const Shape2DSW* p_b,const Matrix32& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_segment_segment(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { const SegmentShape2DSW *segment_A = static_cast<const SegmentShape2DSW*>(p_a); const SegmentShape2DSW *segment_B = static_cast<const SegmentShape2DSW*>(p_b); @@ -641,7 +641,7 @@ static void _collision_segment_segment(const Shape2DSW* p_a,const Matrix32& p_tr } template<bool castA, bool castB,bool withMargin> -static void _collision_segment_circle(const Shape2DSW* p_a,const Matrix32& p_transform_a,const Shape2DSW* p_b,const Matrix32& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_segment_circle(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { const SegmentShape2DSW *segment_A = static_cast<const SegmentShape2DSW*>(p_a); @@ -674,7 +674,7 @@ static void _collision_segment_circle(const Shape2DSW* p_a,const Matrix32& p_tra } template<bool castA, bool castB,bool withMargin> -static void _collision_segment_rectangle(const Shape2DSW* p_a,const Matrix32& p_transform_a,const Shape2DSW* p_b,const Matrix32& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_segment_rectangle(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { const SegmentShape2DSW *segment_A = static_cast<const SegmentShape2DSW*>(p_a); const RectangleShape2DSW *rectangle_B = static_cast<const RectangleShape2DSW*>(p_b); @@ -698,7 +698,7 @@ static void _collision_segment_rectangle(const Shape2DSW* p_a,const Matrix32& p_ if (withMargin) { - Matrix32 inv = p_transform_b.affine_inverse(); + Transform2D inv = p_transform_b.affine_inverse(); Vector2 a = p_transform_a.xform(segment_A->get_a()); Vector2 b = p_transform_a.xform(segment_A->get_b()); @@ -739,7 +739,7 @@ static void _collision_segment_rectangle(const Shape2DSW* p_a,const Matrix32& p_ } template<bool castA, bool castB,bool withMargin> -static void _collision_segment_capsule(const Shape2DSW* p_a,const Matrix32& p_transform_a,const Shape2DSW* p_b,const Matrix32& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_segment_capsule(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { const SegmentShape2DSW *segment_A = static_cast<const SegmentShape2DSW*>(p_a); const CapsuleShape2DSW *capsule_B = static_cast<const CapsuleShape2DSW*>(p_b); @@ -771,7 +771,7 @@ static void _collision_segment_capsule(const Shape2DSW* p_a,const Matrix32& p_tr } template<bool castA, bool castB,bool withMargin> -static void _collision_segment_convex_polygon(const Shape2DSW* p_a,const Matrix32& p_transform_a,const Shape2DSW* p_b,const Matrix32& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_segment_convex_polygon(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { const SegmentShape2DSW *segment_A = static_cast<const SegmentShape2DSW*>(p_a); const ConvexPolygonShape2DSW *convex_B = static_cast<const ConvexPolygonShape2DSW*>(p_b); @@ -811,7 +811,7 @@ static void _collision_segment_convex_polygon(const Shape2DSW* p_a,const Matrix3 ///////// template<bool castA, bool castB,bool withMargin> -static void _collision_circle_circle(const Shape2DSW* p_a,const Matrix32& p_transform_a,const Shape2DSW* p_b,const Matrix32& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_circle_circle(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { const CircleShape2DSW *circle_A = static_cast<const CircleShape2DSW*>(p_a); const CircleShape2DSW *circle_B = static_cast<const CircleShape2DSW*>(p_b); @@ -834,7 +834,7 @@ static void _collision_circle_circle(const Shape2DSW* p_a,const Matrix32& p_tran } template<bool castA, bool castB,bool withMargin> -static void _collision_circle_rectangle(const Shape2DSW* p_a,const Matrix32& p_transform_a,const Shape2DSW* p_b,const Matrix32& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_circle_rectangle(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { const CircleShape2DSW *circle_A = static_cast<const CircleShape2DSW*>(p_a); const RectangleShape2DSW *rectangle_B = static_cast<const RectangleShape2DSW*>(p_b); @@ -858,7 +858,7 @@ static void _collision_circle_rectangle(const Shape2DSW* p_a,const Matrix32& p_t if (!separator.test_axis(axis[1].normalized())) return; - Matrix32 binv = p_transform_b.affine_inverse(); + Transform2D binv = p_transform_b.affine_inverse(); { if (!separator.test_axis( rectangle_B->get_circle_axis(p_transform_b,binv,sphere ) ) ) @@ -890,7 +890,7 @@ static void _collision_circle_rectangle(const Shape2DSW* p_a,const Matrix32& p_t } template<bool castA, bool castB,bool withMargin> -static void _collision_circle_capsule(const Shape2DSW* p_a,const Matrix32& p_transform_a,const Shape2DSW* p_b,const Matrix32& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_circle_capsule(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { const CircleShape2DSW *circle_A = static_cast<const CircleShape2DSW*>(p_a); const CapsuleShape2DSW *capsule_B = static_cast<const CapsuleShape2DSW*>(p_b); @@ -920,7 +920,7 @@ static void _collision_circle_capsule(const Shape2DSW* p_a,const Matrix32& p_tra } template<bool castA, bool castB,bool withMargin> -static void _collision_circle_convex_polygon(const Shape2DSW* p_a,const Matrix32& p_transform_a,const Shape2DSW* p_b,const Matrix32& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_circle_convex_polygon(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { const CircleShape2DSW *circle_A = static_cast<const CircleShape2DSW*>(p_a); const ConvexPolygonShape2DSW *convex_B = static_cast<const ConvexPolygonShape2DSW*>(p_b); @@ -952,7 +952,7 @@ static void _collision_circle_convex_polygon(const Shape2DSW* p_a,const Matrix32 ///////// template<bool castA, bool castB,bool withMargin> -static void _collision_rectangle_rectangle(const Shape2DSW* p_a,const Matrix32& p_transform_a,const Shape2DSW* p_b,const Matrix32& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_rectangle_rectangle(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { const RectangleShape2DSW *rectangle_A = static_cast<const RectangleShape2DSW*>(p_a); const RectangleShape2DSW *rectangle_B = static_cast<const RectangleShape2DSW*>(p_b); @@ -982,22 +982,22 @@ static void _collision_rectangle_rectangle(const Shape2DSW* p_a,const Matrix32& if (withMargin) { - Matrix32 invA=p_transform_a.affine_inverse(); - Matrix32 invB=p_transform_b.affine_inverse(); + Transform2D invA=p_transform_a.affine_inverse(); + Transform2D invB=p_transform_b.affine_inverse(); if (!separator.test_axis( rectangle_A->get_box_axis(p_transform_a,invA,rectangle_B,p_transform_b,invB) ) ) return; if (castA || castB) { - Matrix32 aofs = p_transform_a; + Transform2D aofs = p_transform_a; aofs.elements[2]+=p_motion_a; - Matrix32 bofs = p_transform_b; + Transform2D bofs = p_transform_b; bofs.elements[2]+=p_motion_b; - Matrix32 aofsinv = aofs.affine_inverse(); - Matrix32 bofsinv = bofs.affine_inverse(); + Transform2D aofsinv = aofs.affine_inverse(); + Transform2D bofsinv = bofs.affine_inverse(); if (castA) { @@ -1023,7 +1023,7 @@ static void _collision_rectangle_rectangle(const Shape2DSW* p_a,const Matrix32& } template<bool castA, bool castB,bool withMargin> -static void _collision_rectangle_capsule(const Shape2DSW* p_a,const Matrix32& p_transform_a,const Shape2DSW* p_b,const Matrix32& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_rectangle_capsule(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { const RectangleShape2DSW *rectangle_A = static_cast<const RectangleShape2DSW*>(p_a); const CapsuleShape2DSW *capsule_B = static_cast<const CapsuleShape2DSW*>(p_b); @@ -1051,7 +1051,7 @@ static void _collision_rectangle_capsule(const Shape2DSW* p_a,const Matrix32& p_ //box endpoints to capsule circles - Matrix32 boxinv = p_transform_a.affine_inverse(); + Transform2D boxinv = p_transform_a.affine_inverse(); for(int i=0;i<2;i++) { @@ -1096,7 +1096,7 @@ static void _collision_rectangle_capsule(const Shape2DSW* p_a,const Matrix32& p_ } template<bool castA, bool castB,bool withMargin> -static void _collision_rectangle_convex_polygon(const Shape2DSW* p_a,const Matrix32& p_transform_a,const Shape2DSW* p_b,const Matrix32& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_rectangle_convex_polygon(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { const RectangleShape2DSW *rectangle_A = static_cast<const RectangleShape2DSW*>(p_a); const ConvexPolygonShape2DSW *convex_B = static_cast<const ConvexPolygonShape2DSW*>(p_b); @@ -1118,7 +1118,7 @@ static void _collision_rectangle_convex_polygon(const Shape2DSW* p_a,const Matri return; //convex faces - Matrix32 boxinv; + Transform2D boxinv; if (withMargin) { boxinv=p_transform_a.affine_inverse(); } @@ -1158,7 +1158,7 @@ static void _collision_rectangle_convex_polygon(const Shape2DSW* p_a,const Matri ///////// template<bool castA, bool castB,bool withMargin> -static void _collision_capsule_capsule(const Shape2DSW* p_a,const Matrix32& p_transform_a,const Shape2DSW* p_b,const Matrix32& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_capsule_capsule(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { const CapsuleShape2DSW *capsule_A = static_cast<const CapsuleShape2DSW*>(p_a); const CapsuleShape2DSW *capsule_B = static_cast<const CapsuleShape2DSW*>(p_b); @@ -1201,7 +1201,7 @@ static void _collision_capsule_capsule(const Shape2DSW* p_a,const Matrix32& p_tr } template<bool castA, bool castB,bool withMargin> -static void _collision_capsule_convex_polygon(const Shape2DSW* p_a,const Matrix32& p_transform_a,const Shape2DSW* p_b,const Matrix32& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_capsule_convex_polygon(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { const CapsuleShape2DSW *capsule_A = static_cast<const CapsuleShape2DSW*>(p_a); const ConvexPolygonShape2DSW *convex_B = static_cast<const ConvexPolygonShape2DSW*>(p_b); @@ -1247,7 +1247,7 @@ static void _collision_capsule_convex_polygon(const Shape2DSW* p_a,const Matrix3 template<bool castA, bool castB,bool withMargin> -static void _collision_convex_polygon_convex_polygon(const Shape2DSW* p_a,const Matrix32& p_transform_a,const Shape2DSW* p_b,const Matrix32& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { +static void _collision_convex_polygon_convex_polygon(const Shape2DSW* p_a,const Transform2D& p_transform_a,const Shape2DSW* p_b,const Transform2D& p_transform_b,_CollectorCallback2D *p_collector,const Vector2& p_motion_a,const Vector2& p_motion_b,float p_margin_A,float p_margin_B) { const ConvexPolygonShape2DSW *convex_A = static_cast<const ConvexPolygonShape2DSW*>(p_a); @@ -1294,7 +1294,7 @@ static void _collision_convex_polygon_convex_polygon(const Shape2DSW* p_a,const //////// -bool sat_2d_calculate_penetration(const Shape2DSW *p_shape_A, const Matrix32& p_transform_A, const Vector2& p_motion_A, const Shape2DSW *p_shape_B, const Matrix32& p_transform_B,const Vector2& p_motion_B, CollisionSolver2DSW::CallbackResult p_result_callback,void *p_userdata, bool p_swap,Vector2 *sep_axis,float p_margin_A,float p_margin_B) { +bool sat_2d_calculate_penetration(const Shape2DSW *p_shape_A, const Transform2D& p_transform_A, const Vector2& p_motion_A, const Shape2DSW *p_shape_B, const Transform2D& p_transform_B,const Vector2& p_motion_B, CollisionSolver2DSW::CallbackResult p_result_callback,void *p_userdata, bool p_swap,Vector2 *sep_axis,float p_margin_A,float p_margin_B) { Physics2DServer::ShapeType type_A=p_shape_A->get_type(); @@ -1551,8 +1551,8 @@ bool sat_2d_calculate_penetration(const Shape2DSW *p_shape_A, const Matrix32& p_ const Shape2DSW *A=p_shape_A; const Shape2DSW *B=p_shape_B; - const Matrix32 *transform_A=&p_transform_A; - const Matrix32 *transform_B=&p_transform_B; + const Transform2D *transform_A=&p_transform_A; + const Transform2D *transform_B=&p_transform_B; const Vector2 *motion_A=&p_motion_A; const Vector2 *motion_B=&p_motion_B; real_t margin_A=p_margin_A,margin_B=p_margin_B; diff --git a/servers/physics_2d/collision_solver_2d_sat.h b/servers/physics_2d/collision_solver_2d_sat.h index 91aeb53030..01acf319c7 100644 --- a/servers/physics_2d/collision_solver_2d_sat.h +++ b/servers/physics_2d/collision_solver_2d_sat.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,6 +32,6 @@ #include "collision_solver_2d_sw.h" -bool sat_2d_calculate_penetration(const Shape2DSW *p_shape_A, const Matrix32& p_transform_A, const Vector2& p_motion_A,const Shape2DSW *p_shape_B, const Matrix32& p_transform_B,const Vector2& p_motion_B, CollisionSolver2DSW::CallbackResult p_result_callback,void *p_userdata, bool p_swap=false,Vector2 *sep_axis=NULL,float p_margin_A=0,float p_margin_B=0); +bool sat_2d_calculate_penetration(const Shape2DSW *p_shape_A, const Transform2D& p_transform_A, const Vector2& p_motion_A,const Shape2DSW *p_shape_B, const Transform2D& p_transform_B,const Vector2& p_motion_B, CollisionSolver2DSW::CallbackResult p_result_callback,void *p_userdata, bool p_swap=false,Vector2 *sep_axis=NULL,float p_margin_A=0,float p_margin_B=0); #endif // COLLISION_SOLVER_2D_SAT_H diff --git a/servers/physics_2d/collision_solver_2d_sw.cpp b/servers/physics_2d/collision_solver_2d_sw.cpp index fcc3f8067a..e509bb76cd 100644 --- a/servers/physics_2d/collision_solver_2d_sw.cpp +++ b/servers/physics_2d/collision_solver_2d_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ //#define collision_solver gjk_epa_calculate_penetration -bool CollisionSolver2DSW::solve_static_line(const Shape2DSW *p_shape_A,const Matrix32& p_transform_A,const Shape2DSW *p_shape_B,const Matrix32& p_transform_B,CallbackResult p_result_callback,void *p_userdata,bool p_swap_result) { +bool CollisionSolver2DSW::solve_static_line(const Shape2DSW *p_shape_A,const Transform2D& p_transform_A,const Shape2DSW *p_shape_B,const Transform2D& p_transform_B,CallbackResult p_result_callback,void *p_userdata,bool p_swap_result) { const LineShape2DSW *line = static_cast<const LineShape2DSW*>(p_shape_A); @@ -77,7 +77,7 @@ bool CollisionSolver2DSW::solve_static_line(const Shape2DSW *p_shape_A,const Mat return found; } -bool CollisionSolver2DSW::solve_raycast(const Shape2DSW *p_shape_A,const Matrix32& p_transform_A,const Shape2DSW *p_shape_B,const Matrix32& p_transform_B,CallbackResult p_result_callback,void *p_userdata,bool p_swap_result,Vector2 *sep_axis) { +bool CollisionSolver2DSW::solve_raycast(const Shape2DSW *p_shape_A,const Transform2D& p_transform_A,const Shape2DSW *p_shape_B,const Transform2D& p_transform_B,CallbackResult p_result_callback,void *p_userdata,bool p_swap_result,Vector2 *sep_axis) { @@ -89,7 +89,7 @@ bool CollisionSolver2DSW::solve_raycast(const Shape2DSW *p_shape_A,const Matrix3 Vector2 to = from+p_transform_A[1]*ray->get_length(); Vector2 support_A=to; - Matrix32 invb = p_transform_B.affine_inverse(); + Transform2D invb = p_transform_B.affine_inverse(); from = invb.xform(from); to = invb.xform(to); @@ -145,9 +145,9 @@ bool CollisionSolver2DSW::solve_ray(const Shape2DSW *p_shape_A,const Matrix32& p struct _ConcaveCollisionInfo2D { - const Matrix32 *transform_A; + const Transform2D *transform_A; const Shape2DSW *shape_A; - const Matrix32 *transform_B; + const Transform2D *transform_B; Vector2 motion_A; Vector2 motion_B; real_t margin_A; @@ -181,7 +181,7 @@ void CollisionSolver2DSW::concave_callback(void *p_userdata, Shape2DSW *p_convex } -bool CollisionSolver2DSW::solve_concave(const Shape2DSW *p_shape_A,const Matrix32& p_transform_A,const Vector2& p_motion_A,const Shape2DSW *p_shape_B,const Matrix32& p_transform_B,const Vector2& p_motion_B,CallbackResult p_result_callback,void *p_userdata,bool p_swap_result,Vector2 *sep_axis,float p_margin_A,float p_margin_B) { +bool CollisionSolver2DSW::solve_concave(const Shape2DSW *p_shape_A,const Transform2D& p_transform_A,const Vector2& p_motion_A,const Shape2DSW *p_shape_B,const Transform2D& p_transform_B,const Vector2& p_motion_B,CallbackResult p_result_callback,void *p_userdata,bool p_swap_result,Vector2 *sep_axis,float p_margin_A,float p_margin_B) { const ConcaveShape2DSW *concave_B=static_cast<const ConcaveShape2DSW*>(p_shape_B); @@ -202,15 +202,15 @@ bool CollisionSolver2DSW::solve_concave(const Shape2DSW *p_shape_A,const Matrix3 cinfo.aabb_tests=0; - Matrix32 rel_transform = p_transform_A; - rel_transform.elements[2]-=p_transform_B.elements[2]; + Transform2D rel_transform = p_transform_A; + rel_transform.translate(-p_transform_B.get_origin()); //quickly compute a local Rect2 Rect2 local_aabb; for(int i=0;i<2;i++) { - Vector2 axis( p_transform_B.elements[i] ); + Vector2 axis( p_transform_B.get_axis(i) ); float axis_scale = 1.0/axis.length(); axis*=axis_scale; @@ -231,7 +231,7 @@ bool CollisionSolver2DSW::solve_concave(const Shape2DSW *p_shape_A,const Matrix3 } -bool CollisionSolver2DSW::solve(const Shape2DSW *p_shape_A,const Matrix32& p_transform_A,const Vector2& p_motion_A,const Shape2DSW *p_shape_B,const Matrix32& p_transform_B,const Vector2& p_motion_B,CallbackResult p_result_callback,void *p_userdata,Vector2 *sep_axis,float p_margin_A,float p_margin_B) { +bool CollisionSolver2DSW::solve(const Shape2DSW *p_shape_A,const Transform2D& p_transform_A,const Vector2& p_motion_A,const Shape2DSW *p_shape_B,const Transform2D& p_transform_B,const Vector2& p_motion_B,CallbackResult p_result_callback,void *p_userdata,Vector2 *sep_axis,float p_margin_A,float p_margin_B) { diff --git a/servers/physics_2d/collision_solver_2d_sw.h b/servers/physics_2d/collision_solver_2d_sw.h index 7e3542805c..085d3a49fb 100644 --- a/servers/physics_2d/collision_solver_2d_sw.h +++ b/servers/physics_2d/collision_solver_2d_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,16 +35,16 @@ class CollisionSolver2DSW { public: typedef void (*CallbackResult)(const Vector2& p_point_A,const Vector2& p_point_B,void *p_userdata); private: - static bool solve_static_line(const Shape2DSW *p_shape_A,const Matrix32& p_transform_A,const Shape2DSW *p_shape_B,const Matrix32& p_transform_B,CallbackResult p_result_callback,void *p_userdata,bool p_swap_result); + static bool solve_static_line(const Shape2DSW *p_shape_A,const Transform2D& p_transform_A,const Shape2DSW *p_shape_B,const Transform2D& p_transform_B,CallbackResult p_result_callback,void *p_userdata,bool p_swap_result); static void concave_callback(void *p_userdata, Shape2DSW *p_convex); - static bool solve_concave(const Shape2DSW *p_shape_A,const Matrix32& p_transform_A,const Vector2& p_motion_A,const Shape2DSW *p_shape_B,const Matrix32& p_transform_B,const Vector2& p_motion_B,CallbackResult p_result_callback,void *p_userdata,bool p_swap_result,Vector2 *sep_axis=NULL,float p_margin_A=0,float p_margin_B=0); - static bool solve_raycast(const Shape2DSW *p_shape_A,const Matrix32& p_transform_A,const Shape2DSW *p_shape_B,const Matrix32& p_transform_B,CallbackResult p_result_callback,void *p_userdata,bool p_swap_result,Vector2 *sep_axis=NULL); + static bool solve_concave(const Shape2DSW *p_shape_A,const Transform2D& p_transform_A,const Vector2& p_motion_A,const Shape2DSW *p_shape_B,const Transform2D& p_transform_B,const Vector2& p_motion_B,CallbackResult p_result_callback,void *p_userdata,bool p_swap_result,Vector2 *sep_axis=NULL,float p_margin_A=0,float p_margin_B=0); + static bool solve_raycast(const Shape2DSW *p_shape_A,const Transform2D& p_transform_A,const Shape2DSW *p_shape_B,const Transform2D& p_transform_B,CallbackResult p_result_callback,void *p_userdata,bool p_swap_result,Vector2 *sep_axis=NULL); public: - static bool solve(const Shape2DSW *p_shape_A,const Matrix32& p_transform_A,const Vector2& p_motion_A,const Shape2DSW *p_shape_B,const Matrix32& p_transform_B,const Vector2& p_motion_B,CallbackResult p_result_callback,void *p_userdata,Vector2 *sep_axis=NULL,float p_margin_A=0,float p_margin_B=0); + static bool solve(const Shape2DSW *p_shape_A,const Transform2D& p_transform_A,const Vector2& p_motion_A,const Shape2DSW *p_shape_B,const Transform2D& p_transform_B,const Vector2& p_motion_B,CallbackResult p_result_callback,void *p_userdata,Vector2 *sep_axis=NULL,float p_margin_A=0,float p_margin_B=0); }; diff --git a/servers/physics_2d/constraint_2d_sw.h b/servers/physics_2d/constraint_2d_sw.h index f776dbfe2c..4436f1f689 100644 --- a/servers/physics_2d/constraint_2d_sw.h +++ b/servers/physics_2d/constraint_2d_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,7 +31,7 @@ #include "body_2d_sw.h" -class Constraint2DSW { +class Constraint2DSW : public RID_Data { Body2DSW **_body_ptr; int _body_count; diff --git a/servers/physics_2d/joints_2d_sw.cpp b/servers/physics_2d/joints_2d_sw.cpp index 958780c2e6..7205e90d27 100644 --- a/servers/physics_2d/joints_2d_sw.cpp +++ b/servers/physics_2d/joints_2d_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -215,21 +215,21 @@ bool PinJoint2DSW::setup(float p_step) { real_t B_inv_mass = B?B->get_inv_mass():0.0; - Matrix32 K1; + Transform2D K1; K1[0].x = A->get_inv_mass() + B_inv_mass; K1[1].x = 0.0f; K1[0].y = 0.0f; K1[1].y = A->get_inv_mass() + B_inv_mass; - Matrix32 K2; + Transform2D K2; K2[0].x = A->get_inv_inertia() * rA.y * rA.y; K2[1].x = -A->get_inv_inertia() * rA.x * rA.y; K2[0].y = -A->get_inv_inertia() * rA.x * rA.y; K2[1].y = A->get_inv_inertia() * rA.x * rA.x; - Matrix32 K; + Transform2D K; K[0]= K1[0] + K2[0]; K[1]= K1[1] + K2[1]; if (B) { - Matrix32 K3; + Transform2D K3; K3[0].x = B->get_inv_inertia() * rB.y * rB.y; K3[1].x = -B->get_inv_inertia() * rB.x * rB.y; K3[0].y = -B->get_inv_inertia() * rB.x * rB.y; K3[1].y = B->get_inv_inertia() * rB.x * rB.x; diff --git a/servers/physics_2d/joints_2d_sw.h b/servers/physics_2d/joints_2d_sw.h index 86a1397c53..91113fa26d 100644 --- a/servers/physics_2d/joints_2d_sw.h +++ b/servers/physics_2d/joints_2d_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -106,7 +106,7 @@ class PinJoint2DSW : public Joint2DSW { Body2DSW *_arr[2]; }; - Matrix32 M; + Transform2D M; Vector2 rA,rB; Vector2 anchor_A; Vector2 anchor_B; diff --git a/servers/physics_2d/physics_2d_server_sw.cpp b/servers/physics_2d/physics_2d_server_sw.cpp index 8e92a475ab..3cc69f470e 100644 --- a/servers/physics_2d/physics_2d_server_sw.cpp +++ b/servers/physics_2d/physics_2d_server_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -185,7 +185,7 @@ void Physics2DServerSW::_shape_col_cbk(const Vector2& p_point_A,const Vector2& p } } -bool Physics2DServerSW::shape_collide(RID p_shape_A, const Matrix32& p_xform_A,const Vector2& p_motion_A,RID p_shape_B, const Matrix32& p_xform_B, const Vector2& p_motion_B,Vector2 *r_results,int p_result_max,int &r_result_count) { +bool Physics2DServerSW::shape_collide(RID p_shape_A, const Transform2D& p_xform_A,const Vector2& p_motion_A,RID p_shape_B, const Transform2D& p_xform_B, const Vector2& p_motion_B,Vector2 *r_results,int p_result_max,int &r_result_count) { Shape2DSW *shape_A = shape_owner.get(p_shape_A); @@ -348,7 +348,7 @@ Physics2DServer::AreaSpaceOverrideMode Physics2DServerSW::area_get_space_overrid } -void Physics2DServerSW::area_add_shape(RID p_area, RID p_shape, const Matrix32& p_transform) { +void Physics2DServerSW::area_add_shape(RID p_area, RID p_shape, const Transform2D& p_transform) { Area2DSW *area = area_owner.get(p_area); ERR_FAIL_COND(!area); @@ -372,7 +372,7 @@ void Physics2DServerSW::area_set_shape(RID p_area, int p_shape_idx,RID p_shape) area->set_shape(p_shape_idx,shape); } -void Physics2DServerSW::area_set_shape_transform(RID p_area, int p_shape_idx, const Matrix32& p_transform) { +void Physics2DServerSW::area_set_shape_transform(RID p_area, int p_shape_idx, const Transform2D& p_transform) { Area2DSW *area = area_owner.get(p_area); ERR_FAIL_COND(!area); @@ -398,10 +398,10 @@ RID Physics2DServerSW::area_get_shape(RID p_area, int p_shape_idx) const { return shape->get_self(); } -Matrix32 Physics2DServerSW::area_get_shape_transform(RID p_area, int p_shape_idx) const { +Transform2D Physics2DServerSW::area_get_shape_transform(RID p_area, int p_shape_idx) const { Area2DSW *area = area_owner.get(p_area); - ERR_FAIL_COND_V(!area,Matrix32()); + ERR_FAIL_COND_V(!area,Transform2D()); return area->get_shape_transform(p_shape_idx); } @@ -462,7 +462,7 @@ void Physics2DServerSW::area_set_param(RID p_area,AreaParameter p_param,const Va }; -void Physics2DServerSW::area_set_transform(RID p_area, const Matrix32& p_transform) { +void Physics2DServerSW::area_set_transform(RID p_area, const Transform2D& p_transform) { Area2DSW *area = area_owner.get(p_area); ERR_FAIL_COND(!area); @@ -482,10 +482,10 @@ Variant Physics2DServerSW::area_get_param(RID p_area,AreaParameter p_param) cons return area->get_param(p_param); }; -Matrix32 Physics2DServerSW::area_get_transform(RID p_area) const { +Transform2D Physics2DServerSW::area_get_transform(RID p_area) const { Area2DSW *area = area_owner.get(p_area); - ERR_FAIL_COND_V(!area,Matrix32()); + ERR_FAIL_COND_V(!area,Transform2D()); return area->get_transform(); }; @@ -600,7 +600,7 @@ Physics2DServer::BodyMode Physics2DServerSW::body_get_mode(RID p_body) const { return body->get_mode(); }; -void Physics2DServerSW::body_add_shape(RID p_body, RID p_shape, const Matrix32& p_transform) { +void Physics2DServerSW::body_add_shape(RID p_body, RID p_shape, const Transform2D& p_transform) { Body2DSW *body = body_owner.get(p_body); ERR_FAIL_COND(!body); @@ -624,7 +624,7 @@ void Physics2DServerSW::body_set_shape(RID p_body, int p_shape_idx,RID p_shape) body->set_shape(p_shape_idx,shape); } -void Physics2DServerSW::body_set_shape_transform(RID p_body, int p_shape_idx, const Matrix32& p_transform) { +void Physics2DServerSW::body_set_shape_transform(RID p_body, int p_shape_idx, const Transform2D& p_transform) { Body2DSW *body = body_owner.get(p_body); ERR_FAIL_COND(!body); @@ -666,10 +666,10 @@ RID Physics2DServerSW::body_get_shape(RID p_body, int p_shape_idx) const { return shape->get_self(); } -Matrix32 Physics2DServerSW::body_get_shape_transform(RID p_body, int p_shape_idx) const { +Transform2D Physics2DServerSW::body_get_shape_transform(RID p_body, int p_shape_idx) const { Body2DSW *body = body_owner.get(p_body); - ERR_FAIL_COND_V(!body,Matrix32()); + ERR_FAIL_COND_V(!body,Transform2D()); return body->get_shape_transform(p_shape_idx); } @@ -998,7 +998,7 @@ void Physics2DServerSW::body_set_force_integration_callback(RID p_body,Object *p } -bool Physics2DServerSW::body_collide_shape(RID p_body, int p_body_shape, RID p_shape, const Matrix32& p_shape_xform,const Vector2& p_motion,Vector2 *r_results,int p_result_max,int &r_result_count) { +bool Physics2DServerSW::body_collide_shape(RID p_body, int p_body_shape, RID p_shape, const Transform2D& p_shape_xform,const Vector2& p_motion,Vector2 *r_results,int p_result_max,int &r_result_count) { Body2DSW *body = body_owner.get(p_body); ERR_FAIL_COND_V(!body,false); @@ -1016,7 +1016,7 @@ void Physics2DServerSW::body_set_pickable(RID p_body,bool p_pickable) { } -bool Physics2DServerSW::body_test_motion(RID p_body, const Matrix32 &p_from, const Vector2& p_motion, float p_margin, MotionResult *r_result) { +bool Physics2DServerSW::body_test_motion(RID p_body, const Transform2D &p_from, const Vector2& p_motion, float p_margin, MotionResult *r_result) { Body2DSW *body = body_owner.get(p_body); ERR_FAIL_COND_V(!body,false); @@ -1386,7 +1386,7 @@ Physics2DServerSW::Physics2DServerSW() { island_count=0; active_objects=0; collision_pairs=0; - using_threads=int(Globals::get_singleton()->get("physics_2d/thread_model"))==2; + using_threads=int(GlobalConfig::get_singleton()->get("physics/2d/thread_model"))==2; }; diff --git a/servers/physics_2d/physics_2d_server_sw.h b/servers/physics_2d/physics_2d_server_sw.h index 1dc735289a..ba45dd9272 100644 --- a/servers/physics_2d/physics_2d_server_sw.h +++ b/servers/physics_2d/physics_2d_server_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,7 +39,7 @@ class Physics2DServerSW : public Physics2DServer { - OBJ_TYPE( Physics2DServerSW, Physics2DServer ); + GDCLASS( Physics2DServerSW, Physics2DServer ); friend class Physics2DDirectSpaceStateSW; friend class Physics2DDirectBodyStateSW; @@ -93,7 +93,7 @@ public: virtual Variant shape_get_data(RID p_shape) const; virtual real_t shape_get_custom_solver_bias(RID p_shape) const; - virtual bool shape_collide(RID p_shape_A, const Matrix32& p_xform_A,const Vector2& p_motion_A,RID p_shape_B, const Matrix32& p_xform_B, const Vector2& p_motion_B,Vector2 *r_results,int p_result_max,int &r_result_count); + virtual bool shape_collide(RID p_shape_A, const Transform2D& p_xform_A,const Vector2& p_motion_A,RID p_shape_B, const Transform2D& p_xform_B, const Vector2& p_motion_B,Vector2 *r_results,int p_result_max,int &r_result_count); /* SPACE API */ @@ -123,13 +123,13 @@ public: virtual void area_set_space(RID p_area, RID p_space); virtual RID area_get_space(RID p_area) const; - virtual void area_add_shape(RID p_area, RID p_shape, const Matrix32& p_transform=Matrix32()); + virtual void area_add_shape(RID p_area, RID p_shape, const Transform2D& p_transform=Transform2D()); virtual void area_set_shape(RID p_area, int p_shape_idx,RID p_shape); - virtual void area_set_shape_transform(RID p_area, int p_shape_idx, const Matrix32& p_transform); + virtual void area_set_shape_transform(RID p_area, int p_shape_idx, const Transform2D& p_transform); virtual int area_get_shape_count(RID p_area) const; virtual RID area_get_shape(RID p_area, int p_shape_idx) const; - virtual Matrix32 area_get_shape_transform(RID p_area, int p_shape_idx) const; + virtual Transform2D area_get_shape_transform(RID p_area, int p_shape_idx) const; virtual void area_remove_shape(RID p_area, int p_shape_idx); virtual void area_clear_shapes(RID p_area); @@ -138,10 +138,10 @@ public: virtual ObjectID area_get_object_instance_ID(RID p_area) const; virtual void area_set_param(RID p_area,AreaParameter p_param,const Variant& p_value); - virtual void area_set_transform(RID p_area, const Matrix32& p_transform); + virtual void area_set_transform(RID p_area, const Transform2D& p_transform); virtual Variant area_get_param(RID p_parea,AreaParameter p_param) const; - virtual Matrix32 area_get_transform(RID p_area) const; + virtual Transform2D area_get_transform(RID p_area) const; virtual void area_set_monitorable(RID p_area,bool p_monitorable); virtual void area_set_collision_mask(RID p_area,uint32_t p_mask); virtual void area_set_layer_mask(RID p_area,uint32_t p_mask); @@ -163,15 +163,15 @@ public: virtual void body_set_mode(RID p_body, BodyMode p_mode); virtual BodyMode body_get_mode(RID p_body) const; - virtual void body_add_shape(RID p_body, RID p_shape, const Matrix32& p_transform=Matrix32()); + virtual void body_add_shape(RID p_body, RID p_shape, const Transform2D& p_transform=Transform2D()); virtual void body_set_shape(RID p_body, int p_shape_idx,RID p_shape); - virtual void body_set_shape_transform(RID p_body, int p_shape_idx, const Matrix32& p_transform); + virtual void body_set_shape_transform(RID p_body, int p_shape_idx, const Transform2D& p_transform); virtual void body_set_shape_metadata(RID p_body, int p_shape_idx, const Variant& p_metadata); virtual int body_get_shape_count(RID p_body) const; virtual RID body_get_shape(RID p_body, int p_shape_idx) const; - virtual Matrix32 body_get_shape_transform(RID p_body, int p_shape_idx) const; + virtual Transform2D body_get_shape_transform(RID p_body, int p_shape_idx) const; virtual Variant body_get_shape_metadata(RID p_body, int p_shape_idx) const; @@ -232,11 +232,11 @@ public: virtual void body_set_force_integration_callback(RID p_body,Object *p_receiver,const StringName& p_method,const Variant& p_udata=Variant()); - virtual bool body_collide_shape(RID p_body, int p_body_shape,RID p_shape, const Matrix32& p_shape_xform,const Vector2& p_motion,Vector2 *r_results,int p_result_max,int &r_result_count); + virtual bool body_collide_shape(RID p_body, int p_body_shape,RID p_shape, const Transform2D& p_shape_xform,const Vector2& p_motion,Vector2 *r_results,int p_result_max,int &r_result_count); virtual void body_set_pickable(RID p_body,bool p_pickable); - virtual bool body_test_motion(RID p_body,const Matrix32& p_from,const Vector2& p_motion,float p_margin=0.001,MotionResult *r_result=NULL); + virtual bool body_test_motion(RID p_body,const Transform2D& p_from,const Vector2& p_motion,float p_margin=0.001,MotionResult *r_result=NULL); /* JOINT API */ diff --git a/servers/physics_2d/physics_2d_server_wrap_mt.cpp b/servers/physics_2d/physics_2d_server_wrap_mt.cpp index 3e8b284b9b..8730bb9ee8 100644 --- a/servers/physics_2d/physics_2d_server_wrap_mt.cpp +++ b/servers/physics_2d/physics_2d_server_wrap_mt.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -168,12 +168,12 @@ Physics2DServerWrapMT::Physics2DServerWrapMT(Physics2DServer* p_contained,bool p step_thread_up=false; alloc_mutex=Mutex::create(); - shape_pool_max_size=GLOBAL_DEF("core/thread_rid_pool_prealloc",20); - area_pool_max_size=GLOBAL_DEF("core/thread_rid_pool_prealloc",20); - body_pool_max_size=GLOBAL_DEF("core/thread_rid_pool_prealloc",20); - pin_joint_pool_max_size=GLOBAL_DEF("core/thread_rid_pool_prealloc",20); - groove_joint_pool_max_size=GLOBAL_DEF("core/thread_rid_pool_prealloc",20); - damped_spring_joint_pool_max_size=GLOBAL_DEF("core/thread_rid_pool_prealloc",20); + shape_pool_max_size=GLOBAL_GET("memory/multithread/thread_rid_pool_prealloc"); + area_pool_max_size=GLOBAL_GET("memory/multithread/thread_rid_pool_prealloc"); + body_pool_max_size=GLOBAL_GET("memory/multithread/thread_rid_pool_prealloc"); + pin_joint_pool_max_size=GLOBAL_GET("memory/multithread/thread_rid_pool_prealloc"); + groove_joint_pool_max_size=GLOBAL_GET("memory/multithread/thread_rid_pool_prealloc"); + damped_spring_joint_pool_max_size=GLOBAL_GET("memory/multithread/thread_rid_pool_prealloc"); if (!p_create_thread) { server_thread=Thread::get_caller_ID(); diff --git a/servers/physics_2d/physics_2d_server_wrap_mt.h b/servers/physics_2d/physics_2d_server_wrap_mt.h index 57da958f9a..851ba901ec 100644 --- a/servers/physics_2d/physics_2d_server_wrap_mt.h +++ b/servers/physics_2d/physics_2d_server_wrap_mt.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -100,7 +100,7 @@ public: //these work well, but should be used from the main thread only - bool shape_collide(RID p_shape_A, const Matrix32& p_xform_A,const Vector2& p_motion_A,RID p_shape_B, const Matrix32& p_xform_B, const Vector2& p_motion_B,Vector2 *r_results,int p_result_max,int &r_result_count) { + bool shape_collide(RID p_shape_A, const Transform2D& p_xform_A,const Vector2& p_motion_A,RID p_shape_B, const Transform2D& p_xform_B, const Vector2& p_motion_B,Vector2 *r_results,int p_result_max,int &r_result_count) { ERR_FAIL_COND_V(main_thread!=Thread::get_caller_ID(),false); return physics_2d_server->shape_collide(p_shape_A,p_xform_A,p_motion_A,p_shape_B,p_xform_B,p_motion_B,r_results,p_result_max,r_result_count); @@ -150,13 +150,13 @@ public: FUNC2(area_set_space_override_mode,RID,AreaSpaceOverrideMode); FUNC1RC(AreaSpaceOverrideMode,area_get_space_override_mode,RID); - FUNC3(area_add_shape,RID,RID,const Matrix32&); + FUNC3(area_add_shape,RID,RID,const Transform2D&); FUNC3(area_set_shape,RID,int,RID); - FUNC3(area_set_shape_transform,RID,int,const Matrix32&); + FUNC3(area_set_shape_transform,RID,int,const Transform2D&); FUNC1RC(int,area_get_shape_count,RID); FUNC2RC(RID,area_get_shape,RID,int); - FUNC2RC(Matrix32,area_get_shape_transform,RID,int); + FUNC2RC(Transform2D,area_get_shape_transform,RID,int); FUNC2(area_remove_shape,RID,int); FUNC1(area_clear_shapes,RID); @@ -164,10 +164,10 @@ public: FUNC1RC(ObjectID,area_get_object_instance_ID,RID); FUNC3(area_set_param,RID,AreaParameter,const Variant&); - FUNC2(area_set_transform,RID,const Matrix32&); + FUNC2(area_set_transform,RID,const Transform2D&); FUNC2RC(Variant,area_get_param,RID,AreaParameter); - FUNC1RC(Matrix32,area_get_transform,RID); + FUNC1RC(Transform2D,area_get_transform,RID); FUNC2(area_set_collision_mask,RID,uint32_t); FUNC2(area_set_layer_mask,RID,uint32_t); @@ -191,13 +191,13 @@ public: FUNC1RC(BodyMode,body_get_mode,RID); - FUNC3(body_add_shape,RID,RID,const Matrix32&); + FUNC3(body_add_shape,RID,RID,const Transform2D&); FUNC3(body_set_shape,RID,int,RID); - FUNC3(body_set_shape_transform,RID,int,const Matrix32&); + FUNC3(body_set_shape_transform,RID,int,const Transform2D&); FUNC3(body_set_shape_metadata,RID,int,const Variant&); FUNC1RC(int,body_get_shape_count,RID); - FUNC2RC(Matrix32,body_get_shape_transform,RID,int); + FUNC2RC(Transform2D,body_get_shape_transform,RID,int); FUNC2RC(Variant,body_get_shape_metadata,RID,int); FUNC2RC(RID,body_get_shape,RID,int); @@ -260,13 +260,13 @@ public: FUNC4(body_set_force_integration_callback,RID ,Object *,const StringName& ,const Variant& ); - bool body_collide_shape(RID p_body, int p_body_shape,RID p_shape, const Matrix32& p_shape_xform,const Vector2& p_motion,Vector2 *r_results,int p_result_max,int &r_result_count) { + bool body_collide_shape(RID p_body, int p_body_shape,RID p_shape, const Transform2D& p_shape_xform,const Vector2& p_motion,Vector2 *r_results,int p_result_max,int &r_result_count) { return physics_2d_server->body_collide_shape(p_body,p_body_shape,p_shape,p_shape_xform,p_motion,r_results,p_result_max,r_result_count); } FUNC2(body_set_pickable,RID,bool); - bool body_test_motion(RID p_body,const Matrix32& p_from,const Vector2& p_motion,float p_margin=0.001,MotionResult *r_result=NULL) { + bool body_test_motion(RID p_body,const Transform2D& p_from,const Vector2& p_motion,float p_margin=0.001,MotionResult *r_result=NULL) { ERR_FAIL_COND_V(main_thread!=Thread::get_caller_ID(),false); return physics_2d_server->body_test_motion(p_body,p_from,p_motion,p_margin,r_result); @@ -320,7 +320,7 @@ public: template<class T> static Physics2DServer* init_server() { - int tm = GLOBAL_DEF("physics_2d/thread_model",1); + int tm = GLOBAL_DEF("physics/2d/thread_model",1); if (tm==0) //single unsafe return memnew( T ); else if (tm==1) //single saef diff --git a/servers/physics_2d/shape_2d_sw.cpp b/servers/physics_2d/shape_2d_sw.cpp index 77245c687d..8b19122f17 100644 --- a/servers/physics_2d/shape_2d_sw.cpp +++ b/servers/physics_2d/shape_2d_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -684,7 +684,7 @@ real_t ConvexPolygonShape2DSW::get_moment_of_inertia(float p_mass,const Size2& p void ConvexPolygonShape2DSW::set_data(const Variant& p_data) { - ERR_FAIL_COND(p_data.get_type()!=Variant::VECTOR2_ARRAY && p_data.get_type()!=Variant::REAL_ARRAY); + ERR_FAIL_COND(p_data.get_type()!=Variant::POOL_VECTOR2_ARRAY && p_data.get_type()!=Variant::POOL_REAL_ARRAY); if (points) @@ -692,12 +692,12 @@ void ConvexPolygonShape2DSW::set_data(const Variant& p_data) { points=NULL; point_count=0; - if (p_data.get_type()==Variant::VECTOR2_ARRAY) { - DVector<Vector2> arr=p_data; + if (p_data.get_type()==Variant::POOL_VECTOR2_ARRAY) { + PoolVector<Vector2> arr=p_data; ERR_FAIL_COND(arr.size()==0); point_count=arr.size(); points = memnew_arr(Point,point_count); - DVector<Vector2>::Read r = arr.read(); + PoolVector<Vector2>::Read r = arr.read(); for(int i=0;i<point_count;i++) { points[i].pos=r[i]; @@ -711,12 +711,12 @@ void ConvexPolygonShape2DSW::set_data(const Variant& p_data) { } } else { - DVector<real_t> dvr = p_data; + PoolVector<real_t> dvr = p_data; point_count=dvr.size()/4; ERR_FAIL_COND(point_count==0); points = memnew_arr(Point,point_count); - DVector<real_t>::Read r = dvr.read(); + PoolVector<real_t>::Read r = dvr.read(); for(int i=0;i<point_count;i++) { @@ -741,7 +741,7 @@ void ConvexPolygonShape2DSW::set_data(const Variant& p_data) { Variant ConvexPolygonShape2DSW::get_data() const { - DVector<Vector2> dvr; + PoolVector<Vector2> dvr; dvr.resize(point_count); @@ -964,13 +964,13 @@ int ConcavePolygonShape2DSW::_generate_bvh(BVH *p_bvh,int p_len,int p_depth) { void ConcavePolygonShape2DSW::set_data(const Variant& p_data) { - ERR_FAIL_COND(p_data.get_type()!=Variant::VECTOR2_ARRAY && p_data.get_type()!=Variant::REAL_ARRAY); + ERR_FAIL_COND(p_data.get_type()!=Variant::POOL_VECTOR2_ARRAY && p_data.get_type()!=Variant::POOL_REAL_ARRAY); Rect2 aabb; - if (p_data.get_type()==Variant::VECTOR2_ARRAY) { + if (p_data.get_type()==Variant::POOL_VECTOR2_ARRAY) { - DVector<Vector2> p2arr = p_data; + PoolVector<Vector2> p2arr = p_data; int len = p2arr.size(); ERR_FAIL_COND(len%2); @@ -984,7 +984,7 @@ void ConcavePolygonShape2DSW::set_data(const Variant& p_data) { return; } - DVector<Vector2>::Read arr = p2arr.read(); + PoolVector<Vector2>::Read arr = p2arr.read(); Map<Point2,int> pointmap; for(int i=0;i<len;i+=2) { @@ -1046,17 +1046,17 @@ void ConcavePolygonShape2DSW::set_data(const Variant& p_data) { Variant ConcavePolygonShape2DSW::get_data() const { - DVector<Vector2> rsegments; + PoolVector<Vector2> rsegments; int len = segments.size(); rsegments.resize(len*2); - DVector<Vector2>::Write w = rsegments.write(); + PoolVector<Vector2>::Write w = rsegments.write(); for(int i=0;i<len;i++) { w[(i<<1)+0]=points[segments[i].points[0]]; w[(i<<1)+1]=points[segments[i].points[1]]; } - w=DVector<Vector2>::Write(); + w=PoolVector<Vector2>::Write(); return rsegments; } diff --git a/servers/physics_2d/shape_2d_sw.h b/servers/physics_2d/shape_2d_sw.h index b90c36bc04..9160d064ef 100644 --- a/servers/physics_2d/shape_2d_sw.h +++ b/servers/physics_2d/shape_2d_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -46,7 +46,7 @@ SHAPE_CUSTOM, ///< Server-Implementation based custom shape, calling shape_creat class Shape2DSW; -class ShapeOwner2DSW { +class ShapeOwner2DSW : public RID_Data{ public: virtual void _shape_changed()=0; @@ -55,7 +55,7 @@ public: virtual ~ShapeOwner2DSW() {} }; -class Shape2DSW { +class Shape2DSW : public RID_Data { RID self; Rect2 aabb; @@ -80,8 +80,8 @@ public: virtual bool contains_point(const Vector2& p_point) const=0; - virtual void project_rangev(const Vector2& p_normal, const Matrix32& p_transform, real_t &r_min, real_t &r_max) const=0; - virtual void project_range_castv(const Vector2& p_cast, const Vector2& p_normal, const Matrix32& p_transform, real_t &r_min, real_t &r_max) const=0; + virtual void project_rangev(const Vector2& p_normal, const Transform2D& p_transform, real_t &r_min, real_t &r_max) const=0; + virtual void project_range_castv(const Vector2& p_cast, const Vector2& p_normal, const Transform2D& p_transform, real_t &r_min, real_t &r_max) const=0; virtual Vector2 get_support(const Vector2& p_normal) const; virtual void get_supports(const Vector2& p_normal,Vector2 *r_supports,int & r_amount) const=0; @@ -99,7 +99,7 @@ public: const Map<ShapeOwner2DSW*,int>& get_owners() const; - _FORCE_INLINE_ void get_supports_transformed_cast(const Vector2& p_cast,const Vector2& p_normal,const Matrix32& p_xform,Vector2 *r_supports,int & r_amount) const { + _FORCE_INLINE_ void get_supports_transformed_cast(const Vector2& p_cast,const Vector2& p_normal,const Transform2D& p_xform,Vector2 *r_supports,int & r_amount) const { get_supports(p_xform.basis_xform_inv(p_normal).normalized(),r_supports,r_amount); for(int i=0;i<r_amount;i++) @@ -142,15 +142,15 @@ public: //let the optimizer do the magic #define DEFAULT_PROJECT_RANGE_CAST \ -virtual void project_range_castv(const Vector2& p_cast, const Vector2& p_normal, const Matrix32& p_transform, real_t &r_min, real_t &r_max) const {\ +virtual void project_range_castv(const Vector2& p_cast, const Vector2& p_normal, const Transform2D& p_transform, real_t &r_min, real_t &r_max) const {\ project_range_cast(p_cast,p_normal,p_transform,r_min,r_max);\ }\ -_FORCE_INLINE_ void project_range_cast(const Vector2& p_cast, const Vector2& p_normal, const Matrix32& p_transform, real_t &r_min, real_t &r_max) const {\ +_FORCE_INLINE_ void project_range_cast(const Vector2& p_cast, const Vector2& p_normal, const Transform2D& p_transform, real_t &r_min, real_t &r_max) const {\ \ real_t mina,maxa;\ real_t minb,maxb;\ - Matrix32 ofsb=p_transform;\ - ofsb.elements[2]+=p_cast;\ + Transform2D ofsb=p_transform;\ + ofsb.translate(p_cast);\ project_range(p_normal,p_transform,mina,maxa);\ project_range(p_normal,ofsb,minb,maxb); \ r_min=MIN(mina,minb);\ @@ -170,7 +170,7 @@ public: virtual Physics2DServer::ShapeType get_type() const { return Physics2DServer::SHAPE_LINE; } - virtual void project_rangev(const Vector2& p_normal, const Matrix32& p_transform, real_t &r_min, real_t &r_max) const { project_range(p_normal,p_transform,r_min,r_max); } + virtual void project_rangev(const Vector2& p_normal, const Transform2D& p_transform, real_t &r_min, real_t &r_max) const { project_range(p_normal,p_transform,r_min,r_max); } virtual void get_supports(const Vector2& p_normal,Vector2 *r_supports,int & r_amount) const; virtual bool contains_point(const Vector2& p_point) const; @@ -180,17 +180,17 @@ public: virtual void set_data(const Variant& p_data); virtual Variant get_data() const; - _FORCE_INLINE_ void project_range(const Vector2& p_normal, const Matrix32& p_transform, real_t &r_min, real_t &r_max) const { + _FORCE_INLINE_ void project_range(const Vector2& p_normal, const Transform2D& p_transform, real_t &r_min, real_t &r_max) const { //real large r_min=-1e10; r_max=1e10; } - virtual void project_range_castv(const Vector2& p_cast, const Vector2& p_normal, const Matrix32& p_transform, real_t &r_min, real_t &r_max) const { + virtual void project_range_castv(const Vector2& p_cast, const Vector2& p_normal, const Transform2D& p_transform, real_t &r_min, real_t &r_max) const { project_range_cast(p_cast,p_normal,p_transform,r_min,r_max); } - _FORCE_INLINE_ void project_range_cast(const Vector2& p_cast, const Vector2& p_normal, const Matrix32& p_transform, real_t &r_min, real_t &r_max) const { + _FORCE_INLINE_ void project_range_cast(const Vector2& p_cast, const Vector2& p_normal, const Transform2D& p_transform, real_t &r_min, real_t &r_max) const { //real large r_min=-1e10; r_max=1e10; @@ -213,7 +213,7 @@ public: virtual Physics2DServer::ShapeType get_type() const { return Physics2DServer::SHAPE_RAY; } - virtual void project_rangev(const Vector2& p_normal, const Matrix32& p_transform, real_t &r_min, real_t &r_max) const { project_range(p_normal,p_transform,r_min,r_max); } + virtual void project_rangev(const Vector2& p_normal, const Transform2D& p_transform, real_t &r_min, real_t &r_max) const { project_range(p_normal,p_transform,r_min,r_max); } virtual void get_supports(const Vector2& p_normal,Vector2 *r_supports,int & r_amount) const; virtual bool contains_point(const Vector2& p_point) const; @@ -223,7 +223,7 @@ public: virtual void set_data(const Variant& p_data); virtual Variant get_data() const; - _FORCE_INLINE_ void project_range(const Vector2& p_normal, const Matrix32& p_transform, real_t &r_min, real_t &r_max) const { + _FORCE_INLINE_ void project_range(const Vector2& p_normal, const Transform2D& p_transform, real_t &r_min, real_t &r_max) const { //real large r_max = p_normal.dot(p_transform.get_origin()); r_min = p_normal.dot(p_transform.xform(Vector2(0,length))); @@ -257,11 +257,11 @@ public: virtual Physics2DServer::ShapeType get_type() const { return Physics2DServer::SHAPE_SEGMENT; } - _FORCE_INLINE_ Vector2 get_xformed_normal(const Matrix32& p_xform) const { + _FORCE_INLINE_ Vector2 get_xformed_normal(const Transform2D& p_xform) const { return (p_xform.xform(b) - p_xform.xform(a)).normalized().tangent(); } - virtual void project_rangev(const Vector2& p_normal, const Matrix32& p_transform, real_t &r_min, real_t &r_max) const { project_range(p_normal,p_transform,r_min,r_max); } + virtual void project_rangev(const Vector2& p_normal, const Transform2D& p_transform, real_t &r_min, real_t &r_max) const { project_range(p_normal,p_transform,r_min,r_max); } virtual void get_supports(const Vector2& p_normal,Vector2 *r_supports,int & r_amount) const; virtual bool contains_point(const Vector2& p_point) const; @@ -271,7 +271,7 @@ public: virtual void set_data(const Variant& p_data); virtual Variant get_data() const; - _FORCE_INLINE_ void project_range(const Vector2& p_normal, const Matrix32& p_transform, real_t &r_min, real_t &r_max) const { + _FORCE_INLINE_ void project_range(const Vector2& p_normal, const Transform2D& p_transform, real_t &r_min, real_t &r_max) const { //real large r_max = p_normal.dot(p_transform.xform(a)); r_min = p_normal.dot(p_transform.xform(b)); @@ -299,7 +299,7 @@ public: virtual Physics2DServer::ShapeType get_type() const { return Physics2DServer::SHAPE_CIRCLE; } - virtual void project_rangev(const Vector2& p_normal, const Matrix32& p_transform, real_t &r_min, real_t &r_max) const { project_range(p_normal,p_transform,r_min,r_max); } + virtual void project_rangev(const Vector2& p_normal, const Transform2D& p_transform, real_t &r_min, real_t &r_max) const { project_range(p_normal,p_transform,r_min,r_max); } virtual void get_supports(const Vector2& p_normal,Vector2 *r_supports,int & r_amount) const; virtual bool contains_point(const Vector2& p_point) const; @@ -309,7 +309,7 @@ public: virtual void set_data(const Variant& p_data); virtual Variant get_data() const; - _FORCE_INLINE_ void project_range(const Vector2& p_normal, const Matrix32& p_transform, real_t &r_min, real_t &r_max) const { + _FORCE_INLINE_ void project_range(const Vector2& p_normal, const Transform2D& p_transform, real_t &r_min, real_t &r_max) const { //real large real_t d = p_normal.dot( p_transform.get_origin() ); @@ -339,7 +339,7 @@ public: virtual Physics2DServer::ShapeType get_type() const { return Physics2DServer::SHAPE_RECTANGLE; } - virtual void project_rangev(const Vector2& p_normal, const Matrix32& p_transform, real_t &r_min, real_t &r_max) const { project_range(p_normal,p_transform,r_min,r_max); } + virtual void project_rangev(const Vector2& p_normal, const Transform2D& p_transform, real_t &r_min, real_t &r_max) const { project_range(p_normal,p_transform,r_min,r_max); } virtual void get_supports(const Vector2& p_normal,Vector2 *r_supports,int & r_amount) const; virtual bool contains_point(const Vector2& p_point) const; @@ -349,7 +349,7 @@ public: virtual void set_data(const Variant& p_data); virtual Variant get_data() const; - _FORCE_INLINE_ void project_range(const Vector2& p_normal, const Matrix32& p_transform, real_t &r_min, real_t &r_max) const { + _FORCE_INLINE_ void project_range(const Vector2& p_normal, const Transform2D& p_transform, real_t &r_min, real_t &r_max) const { // no matter the angle, the box is mirrored anyway r_max=-1e20; r_min=1e20; @@ -367,7 +367,7 @@ public: - _FORCE_INLINE_ Vector2 get_circle_axis(const Matrix32& p_xform, const Matrix32& p_xform_inv,const Vector2& p_circle) const { + _FORCE_INLINE_ Vector2 get_circle_axis(const Transform2D& p_xform, const Transform2D& p_xform_inv,const Vector2& p_circle) const { Vector2 local_v = p_xform_inv.xform(p_circle); @@ -379,7 +379,7 @@ public: return (p_xform.xform(he)-p_circle).normalized(); } - _FORCE_INLINE_ Vector2 get_box_axis(const Matrix32& p_xform, const Matrix32& p_xform_inv,const RectangleShape2DSW *p_B,const Matrix32& p_B_xform, const Matrix32& p_B_xform_inv) const { + _FORCE_INLINE_ Vector2 get_box_axis(const Transform2D& p_xform, const Transform2D& p_xform_inv,const RectangleShape2DSW *p_B,const Transform2D& p_B_xform, const Transform2D& p_B_xform_inv) const { Vector2 a,b; @@ -427,7 +427,7 @@ public: virtual Physics2DServer::ShapeType get_type() const { return Physics2DServer::SHAPE_CAPSULE; } - virtual void project_rangev(const Vector2& p_normal, const Matrix32& p_transform, real_t &r_min, real_t &r_max) const { project_range(p_normal,p_transform,r_min,r_max); } + virtual void project_rangev(const Vector2& p_normal, const Transform2D& p_transform, real_t &r_min, real_t &r_max) const { project_range(p_normal,p_transform,r_min,r_max); } virtual void get_supports(const Vector2& p_normal,Vector2 *r_supports,int & r_amount) const; virtual bool contains_point(const Vector2& p_point) const; @@ -437,7 +437,7 @@ public: virtual void set_data(const Variant& p_data); virtual Variant get_data() const; - _FORCE_INLINE_ void project_range(const Vector2& p_normal, const Matrix32& p_transform, real_t &r_min, real_t &r_max) const { + _FORCE_INLINE_ void project_range(const Vector2& p_normal, const Transform2D& p_transform, real_t &r_min, real_t &r_max) const { // no matter the angle, the box is mirrored anyway Vector2 n=p_transform.basis_xform_inv(p_normal).normalized(); float h = (n.y > 0) ? height : -height; @@ -480,7 +480,7 @@ public: _FORCE_INLINE_ int get_point_count() const { return point_count; } _FORCE_INLINE_ const Vector2& get_point(int p_idx) const { return points[p_idx].pos; } _FORCE_INLINE_ const Vector2& get_segment_normal(int p_idx) const { return points[p_idx].normal; } - _FORCE_INLINE_ Vector2 get_xformed_segment_normal(const Matrix32& p_xform, int p_idx) const { + _FORCE_INLINE_ Vector2 get_xformed_segment_normal(const Transform2D& p_xform, int p_idx) const { Vector2 a = points[p_idx].pos; p_idx++; @@ -490,7 +490,7 @@ public: virtual Physics2DServer::ShapeType get_type() const { return Physics2DServer::SHAPE_CONVEX_POLYGON; } - virtual void project_rangev(const Vector2& p_normal, const Matrix32& p_transform, real_t &r_min, real_t &r_max) const { project_range(p_normal,p_transform,r_min,r_max); } + virtual void project_rangev(const Vector2& p_normal, const Transform2D& p_transform, real_t &r_min, real_t &r_max) const { project_range(p_normal,p_transform,r_min,r_max); } virtual void get_supports(const Vector2& p_normal,Vector2 *r_supports,int & r_amount) const; virtual bool contains_point(const Vector2& p_point) const; @@ -500,7 +500,7 @@ public: virtual void set_data(const Variant& p_data); virtual Variant get_data() const; - _FORCE_INLINE_ void project_range(const Vector2& p_normal, const Matrix32& p_transform, real_t &r_min, real_t &r_max) const { + _FORCE_INLINE_ void project_range(const Vector2& p_normal, const Transform2D& p_transform, real_t &r_min, real_t &r_max) const { // no matter the angle, the box is mirrored anyway r_min = r_max = p_normal.dot(p_transform.xform(points[0].pos)); @@ -577,8 +577,8 @@ public: virtual Physics2DServer::ShapeType get_type() const { return Physics2DServer::SHAPE_CONCAVE_POLYGON; } - virtual void project_rangev(const Vector2& p_normal, const Matrix32& p_transform, real_t &r_min, real_t &r_max) const { /*project_range(p_normal,p_transform,r_min,r_max);*/ } - virtual void project_range(const Vector2& p_normal, const Matrix32& p_transform, real_t &r_min, real_t &r_max) const { /*project_range(p_normal,p_transform,r_min,r_max);*/ } + virtual void project_rangev(const Vector2& p_normal, const Transform2D& p_transform, real_t &r_min, real_t &r_max) const { /*project_range(p_normal,p_transform,r_min,r_max);*/ } + virtual void project_range(const Vector2& p_normal, const Transform2D& p_transform, real_t &r_min, real_t &r_max) const { /*project_range(p_normal,p_transform,r_min,r_max);*/ } virtual void get_supports(const Vector2& p_normal,Vector2 *r_supports,int & r_amount) const; virtual bool contains_point(const Vector2& p_point) const; diff --git a/servers/physics_2d/space_2d_sw.cpp b/servers/physics_2d/space_2d_sw.cpp index 56bee8b0c5..2c7b099b36 100644 --- a/servers/physics_2d/space_2d_sw.cpp +++ b/servers/physics_2d/space_2d_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -133,7 +133,7 @@ bool Physics2DDirectSpaceStateSW::intersect_ray(const Vector2& p_from, const Vec const CollisionObject2DSW *col_obj=space->intersection_query_results[i]; int shape_idx=space->intersection_query_subindex_results[i]; - Matrix32 inv_xform = col_obj->get_shape_inv_transform(shape_idx) * col_obj->get_inv_transform(); + Transform2D inv_xform = col_obj->get_shape_inv_transform(shape_idx) * col_obj->get_inv_transform(); Vector2 local_from = inv_xform.xform(begin); Vector2 local_to = inv_xform.xform(end); @@ -153,7 +153,7 @@ bool Physics2DDirectSpaceStateSW::intersect_ray(const Vector2& p_from, const Vec - Matrix32 xform = col_obj->get_transform() * col_obj->get_shape_transform(shape_idx); + Transform2D xform = col_obj->get_transform() * col_obj->get_shape_transform(shape_idx); shape_point=xform.xform(shape_point); real_t ld = normal.dot(shape_point); @@ -190,7 +190,7 @@ bool Physics2DDirectSpaceStateSW::intersect_ray(const Vector2& p_from, const Vec } -int Physics2DDirectSpaceStateSW::intersect_shape(const RID& p_shape, const Matrix32& p_xform,const Vector2& p_motion,float p_margin,ShapeResult *r_results,int p_result_max,const Set<RID>& p_exclude,uint32_t p_layer_mask,uint32_t p_object_type_mask) { +int Physics2DDirectSpaceStateSW::intersect_shape(const RID& p_shape, const Transform2D& p_xform,const Vector2& p_motion,float p_margin,ShapeResult *r_results,int p_result_max,const Set<RID>& p_exclude,uint32_t p_layer_mask,uint32_t p_object_type_mask) { if (p_result_max<=0) return 0; @@ -237,7 +237,7 @@ int Physics2DDirectSpaceStateSW::intersect_shape(const RID& p_shape, const Matri -bool Physics2DDirectSpaceStateSW::cast_motion(const RID& p_shape, const Matrix32& p_xform,const Vector2& p_motion,float p_margin,float &p_closest_safe,float &p_closest_unsafe, const Set<RID>& p_exclude,uint32_t p_layer_mask,uint32_t p_object_type_mask) { +bool Physics2DDirectSpaceStateSW::cast_motion(const RID& p_shape, const Transform2D& p_xform,const Vector2& p_motion,float p_margin,float &p_closest_safe,float &p_closest_unsafe, const Set<RID>& p_exclude,uint32_t p_layer_mask,uint32_t p_object_type_mask) { @@ -280,7 +280,7 @@ bool Physics2DDirectSpaceStateSW::cast_motion(const RID& p_shape, const Matrix32 }*/ - Matrix32 col_obj_xform = col_obj->get_transform() * col_obj->get_shape_transform(shape_idx); + Transform2D col_obj_xform = col_obj->get_transform() * col_obj->get_shape_transform(shape_idx); //test initial overlap, does it collide if going all the way? if (!CollisionSolver2DSW::solve(shape,p_xform,p_motion,col_obj->get_shape(shape_idx),col_obj_xform,Vector2() ,NULL,NULL,NULL,p_margin)) { continue; @@ -362,7 +362,7 @@ bool Physics2DDirectSpaceStateSW::cast_motion(const RID& p_shape, const Matrix32 } -bool Physics2DDirectSpaceStateSW::collide_shape(RID p_shape, const Matrix32& p_shape_xform,const Vector2& p_motion,float p_margin,Vector2 *r_results,int p_result_max,int &r_result_count, const Set<RID>& p_exclude,uint32_t p_layer_mask,uint32_t p_object_type_mask) { +bool Physics2DDirectSpaceStateSW::collide_shape(RID p_shape, const Transform2D& p_shape_xform,const Vector2& p_motion,float p_margin,Vector2 *r_results,int p_result_max,int &r_result_count, const Set<RID>& p_exclude,uint32_t p_layer_mask,uint32_t p_object_type_mask) { if (p_result_max<=0) @@ -471,7 +471,7 @@ static void _rest_cbk_result(const Vector2& p_point_A,const Vector2& p_point_B,v } -bool Physics2DDirectSpaceStateSW::rest_info(RID p_shape, const Matrix32& p_shape_xform,const Vector2& p_motion,float p_margin,ShapeRestInfo *r_info, const Set<RID>& p_exclude,uint32_t p_layer_mask,uint32_t p_object_type_mask) { +bool Physics2DDirectSpaceStateSW::rest_info(RID p_shape, const Transform2D& p_shape_xform,const Vector2& p_motion,float p_margin,ShapeRestInfo *r_info, const Set<RID>& p_exclude,uint32_t p_layer_mask,uint32_t p_object_type_mask) { Shape2DSW *shape = Physics2DServerSW::singletonsw->shape_owner.get(p_shape); @@ -592,7 +592,7 @@ int Space2DSW::_cull_aabb_for_body(Body2DSW *p_body,const Rect2& p_aabb) { return amount; } -bool Space2DSW::test_body_motion(Body2DSW *p_body, const Matrix32 &p_from, const Vector2&p_motion, float p_margin, Physics2DServer::MotionResult *r_result) { +bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, const Vector2&p_motion, float p_margin, Physics2DServer::MotionResult *r_result) { //give me back regular physics engine logic //this is madness @@ -618,7 +618,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Matrix32 &p_from, const body_aabb=body_aabb.grow(p_margin); - Matrix32 body_transform = p_from; + Transform2D body_transform = p_from; { //STEP 1, FREE BODY IF STUCK @@ -649,7 +649,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Matrix32 &p_from, const if (p_body->is_shape_set_as_trigger(j)) continue; - Matrix32 body_shape_xform = body_transform * p_body->get_shape_transform(j); + Transform2D body_shape_xform = body_transform * p_body->get_shape_transform(j); Shape2DSW *body_shape = p_body->get_shape(j); for(int i=0;i<amount;i++) { @@ -711,7 +711,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Matrix32 &p_from, const break; } - body_transform.elements[2]+=recover_motion; + body_transform.translate(recover_motion); body_aabb.pos+=recover_motion; recover_attempts--; @@ -739,7 +739,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Matrix32 &p_from, const if (p_body->is_shape_set_as_trigger(j)) continue; - Matrix32 body_shape_xform = body_transform * p_body->get_shape_transform(j); + Transform2D body_shape_xform = body_transform * p_body->get_shape_transform(j); Shape2DSW *body_shape = p_body->get_shape(j); bool stuck=false; @@ -753,7 +753,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Matrix32 &p_from, const int shape_idx=intersection_query_subindex_results[i]; - Matrix32 col_obj_xform = col_obj->get_transform() * col_obj->get_shape_transform(shape_idx); + Transform2D col_obj_xform = col_obj->get_transform() * col_obj->get_shape_transform(shape_idx); //test initial overlap, does it collide if going all the way? if (!CollisionSolver2DSW::solve(body_shape,body_shape_xform,p_motion,col_obj->get_shape(shape_idx),col_obj_xform,Vector2() ,NULL,NULL,NULL,0)) { continue; @@ -852,22 +852,22 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Matrix32 &p_from, const if (r_result) { r_result->motion=p_motion; - r_result->remainder=Vector2(); - r_result->motion+=(body_transform.elements[2]-p_from.elements[2]); + r_result->remainder=Vector2(); + r_result->motion+=(body_transform.get_origin()-p_from.get_origin()); } } else { //it collided, let's get the rest info in unsafe advance - Matrix32 ugt = body_transform; - ugt.elements[2]+=p_motion*unsafe; + Transform2D ugt = body_transform; + ugt.translate(p_motion*unsafe); _RestCallbackData2D rcd; rcd.best_len=0; rcd.best_object=NULL; rcd.best_shape=0; - Matrix32 body_shape_xform = ugt * p_body->get_shape_transform(best_shape); + Transform2D body_shape_xform = ugt * p_body->get_shape_transform(best_shape); Shape2DSW *body_shape = p_body->get_shape(best_shape); body_aabb.pos+=p_motion*unsafe; @@ -916,7 +916,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Matrix32 &p_from, const r_result->motion=safe*p_motion; r_result->remainder=p_motion - safe * p_motion; - r_result->motion+=(body_transform.elements[2]-p_from.elements[2]); + r_result->motion+=(body_transform.get_origin()-p_from.get_origin()); } @@ -926,7 +926,7 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Matrix32 &p_from, const r_result->motion=p_motion; r_result->remainder=Vector2(); - r_result->motion+=(body_transform.elements[2]-p_from.elements[2]); + r_result->motion+=(body_transform.get_origin()-p_from.get_origin()); } collided=false; @@ -1329,9 +1329,9 @@ Space2DSW::Space2DSW() { contact_max_allowed_penetration= 0.3; constraint_bias = 0.2; - body_linear_velocity_sleep_treshold=GLOBAL_DEF("physics_2d/sleep_threashold_linear",2.0); - body_angular_velocity_sleep_treshold=GLOBAL_DEF("physics_2d/sleep_threshold_angular",(8.0 / 180.0 * Math_PI)); - body_time_to_sleep=GLOBAL_DEF("physics_2d/time_before_sleep",0.5); + body_linear_velocity_sleep_treshold=GLOBAL_DEF("physics/2d/sleep_threashold_linear",2.0); + body_angular_velocity_sleep_treshold=GLOBAL_DEF("physics/2d/sleep_threshold_angular",(8.0 / 180.0 * Math_PI)); + body_time_to_sleep=GLOBAL_DEF("physics/2d/time_before_sleep",0.5); broadphase = BroadPhase2DSW::create_func(); diff --git a/servers/physics_2d/space_2d_sw.h b/servers/physics_2d/space_2d_sw.h index 45a3e4ca8f..5dee3dea5a 100644 --- a/servers/physics_2d/space_2d_sw.h +++ b/servers/physics_2d/space_2d_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -42,24 +42,24 @@ class Physics2DDirectSpaceStateSW : public Physics2DDirectSpaceState { - OBJ_TYPE( Physics2DDirectSpaceStateSW, Physics2DDirectSpaceState ); + GDCLASS( Physics2DDirectSpaceStateSW, Physics2DDirectSpaceState ); public: Space2DSW *space; virtual int intersect_point(const Vector2& p_point,ShapeResult *r_results,int p_result_max,const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION, bool p_pick_point=false); virtual bool intersect_ray(const Vector2& p_from, const Vector2& p_to,RayResult &r_result,const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION); - virtual int intersect_shape(const RID& p_shape, const Matrix32& p_xform,const Vector2& p_motion,float p_margin,ShapeResult *r_results,int p_result_max,const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION); - virtual bool cast_motion(const RID& p_shape, const Matrix32& p_xform,const Vector2& p_motion,float p_margin,float &p_closest_safe,float &p_closest_unsafe, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION); - virtual bool collide_shape(RID p_shape, const Matrix32& p_shape_xform,const Vector2& p_motion,float p_margin,Vector2 *r_results,int p_result_max,int &r_result_count, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION); - virtual bool rest_info(RID p_shape, const Matrix32& p_shape_xform,const Vector2& p_motion,float p_margin,ShapeRestInfo *r_info, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION); + virtual int intersect_shape(const RID& p_shape, const Transform2D& p_xform,const Vector2& p_motion,float p_margin,ShapeResult *r_results,int p_result_max,const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION); + virtual bool cast_motion(const RID& p_shape, const Transform2D& p_xform,const Vector2& p_motion,float p_margin,float &p_closest_safe,float &p_closest_unsafe, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION); + virtual bool collide_shape(RID p_shape, const Transform2D& p_shape_xform,const Vector2& p_motion,float p_margin,Vector2 *r_results,int p_result_max,int &r_result_count, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION); + virtual bool rest_info(RID p_shape, const Transform2D& p_shape_xform,const Vector2& p_motion,float p_margin,ShapeRestInfo *r_info, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION); Physics2DDirectSpaceStateSW(); }; -class Space2DSW { +class Space2DSW : public RID_Data { public: @@ -185,7 +185,7 @@ public: int get_collision_pairs() const { return collision_pairs; } - bool test_body_motion(Body2DSW *p_body, const Matrix32 &p_from, const Vector2&p_motion, float p_margin, Physics2DServer::MotionResult *r_result); + bool test_body_motion(Body2DSW *p_body, const Transform2D &p_from, const Vector2&p_motion, float p_margin, Physics2DServer::MotionResult *r_result); void set_debug_contacts(int p_amount) { contact_debug.resize(p_amount); } diff --git a/servers/physics_2d/step_2d_sw.cpp b/servers/physics_2d/step_2d_sw.cpp index 4f86168c1e..05c0bf0516 100644 --- a/servers/physics_2d/step_2d_sw.cpp +++ b/servers/physics_2d/step_2d_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d/step_2d_sw.h b/servers/physics_2d/step_2d_sw.h index 0c374d7e12..917d69e7f1 100644 --- a/servers/physics_2d/step_2d_sw.h +++ b/servers/physics_2d/step_2d_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/physics_2d_server.cpp b/servers/physics_2d_server.cpp index a77b13eb21..666982ebee 100644 --- a/servers/physics_2d_server.cpp +++ b/servers/physics_2d_server.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -73,40 +73,40 @@ Physics2DServer * Physics2DServer::get_singleton() { void Physics2DDirectBodyState::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_total_gravity"),&Physics2DDirectBodyState::get_total_gravity); - ObjectTypeDB::bind_method(_MD("get_total_linear_damp"),&Physics2DDirectBodyState::get_total_linear_damp); - ObjectTypeDB::bind_method(_MD("get_total_angular_damp"),&Physics2DDirectBodyState::get_total_angular_damp); + ClassDB::bind_method(_MD("get_total_gravity"),&Physics2DDirectBodyState::get_total_gravity); + ClassDB::bind_method(_MD("get_total_linear_damp"),&Physics2DDirectBodyState::get_total_linear_damp); + ClassDB::bind_method(_MD("get_total_angular_damp"),&Physics2DDirectBodyState::get_total_angular_damp); - ObjectTypeDB::bind_method(_MD("get_inverse_mass"),&Physics2DDirectBodyState::get_inverse_mass); - ObjectTypeDB::bind_method(_MD("get_inverse_inertia"),&Physics2DDirectBodyState::get_inverse_inertia); + ClassDB::bind_method(_MD("get_inverse_mass"),&Physics2DDirectBodyState::get_inverse_mass); + ClassDB::bind_method(_MD("get_inverse_inertia"),&Physics2DDirectBodyState::get_inverse_inertia); - ObjectTypeDB::bind_method(_MD("set_linear_velocity","velocity"),&Physics2DDirectBodyState::set_linear_velocity); - ObjectTypeDB::bind_method(_MD("get_linear_velocity"),&Physics2DDirectBodyState::get_linear_velocity); + ClassDB::bind_method(_MD("set_linear_velocity","velocity"),&Physics2DDirectBodyState::set_linear_velocity); + ClassDB::bind_method(_MD("get_linear_velocity"),&Physics2DDirectBodyState::get_linear_velocity); - ObjectTypeDB::bind_method(_MD("set_angular_velocity","velocity"),&Physics2DDirectBodyState::set_angular_velocity); - ObjectTypeDB::bind_method(_MD("get_angular_velocity"),&Physics2DDirectBodyState::get_angular_velocity); + ClassDB::bind_method(_MD("set_angular_velocity","velocity"),&Physics2DDirectBodyState::set_angular_velocity); + ClassDB::bind_method(_MD("get_angular_velocity"),&Physics2DDirectBodyState::get_angular_velocity); - ObjectTypeDB::bind_method(_MD("set_transform","transform"),&Physics2DDirectBodyState::set_transform); - ObjectTypeDB::bind_method(_MD("get_transform"),&Physics2DDirectBodyState::get_transform); + ClassDB::bind_method(_MD("set_transform","transform"),&Physics2DDirectBodyState::set_transform); + ClassDB::bind_method(_MD("get_transform"),&Physics2DDirectBodyState::get_transform); - ObjectTypeDB::bind_method(_MD("set_sleep_state","enabled"),&Physics2DDirectBodyState::set_sleep_state); - ObjectTypeDB::bind_method(_MD("is_sleeping"),&Physics2DDirectBodyState::is_sleeping); + ClassDB::bind_method(_MD("set_sleep_state","enabled"),&Physics2DDirectBodyState::set_sleep_state); + ClassDB::bind_method(_MD("is_sleeping"),&Physics2DDirectBodyState::is_sleeping); - ObjectTypeDB::bind_method(_MD("get_contact_count"),&Physics2DDirectBodyState::get_contact_count); + ClassDB::bind_method(_MD("get_contact_count"),&Physics2DDirectBodyState::get_contact_count); - ObjectTypeDB::bind_method(_MD("get_contact_local_pos","contact_idx"),&Physics2DDirectBodyState::get_contact_local_pos); - ObjectTypeDB::bind_method(_MD("get_contact_local_normal","contact_idx"),&Physics2DDirectBodyState::get_contact_local_normal); - ObjectTypeDB::bind_method(_MD("get_contact_local_shape","contact_idx"),&Physics2DDirectBodyState::get_contact_local_shape); - ObjectTypeDB::bind_method(_MD("get_contact_collider","contact_idx"),&Physics2DDirectBodyState::get_contact_collider); - ObjectTypeDB::bind_method(_MD("get_contact_collider_pos","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_pos); - ObjectTypeDB::bind_method(_MD("get_contact_collider_id","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_id); - ObjectTypeDB::bind_method(_MD("get_contact_collider_object","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_object); - ObjectTypeDB::bind_method(_MD("get_contact_collider_shape","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_shape); - ObjectTypeDB::bind_method(_MD("get_contact_collider_shape_metadata:Variant","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_shape_metadata); - ObjectTypeDB::bind_method(_MD("get_contact_collider_velocity_at_pos","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_velocity_at_pos); - ObjectTypeDB::bind_method(_MD("get_step"),&Physics2DDirectBodyState::get_step); - ObjectTypeDB::bind_method(_MD("integrate_forces"),&Physics2DDirectBodyState::integrate_forces); - ObjectTypeDB::bind_method(_MD("get_space_state:Physics2DDirectSpaceState"),&Physics2DDirectBodyState::get_space_state); + ClassDB::bind_method(_MD("get_contact_local_pos","contact_idx"),&Physics2DDirectBodyState::get_contact_local_pos); + ClassDB::bind_method(_MD("get_contact_local_normal","contact_idx"),&Physics2DDirectBodyState::get_contact_local_normal); + ClassDB::bind_method(_MD("get_contact_local_shape","contact_idx"),&Physics2DDirectBodyState::get_contact_local_shape); + ClassDB::bind_method(_MD("get_contact_collider","contact_idx"),&Physics2DDirectBodyState::get_contact_collider); + ClassDB::bind_method(_MD("get_contact_collider_pos","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_pos); + ClassDB::bind_method(_MD("get_contact_collider_id","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_id); + ClassDB::bind_method(_MD("get_contact_collider_object","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_object); + ClassDB::bind_method(_MD("get_contact_collider_shape","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_shape); + ClassDB::bind_method(_MD("get_contact_collider_shape_metadata:Variant","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_shape_metadata); + ClassDB::bind_method(_MD("get_contact_collider_velocity_at_pos","contact_idx"),&Physics2DDirectBodyState::get_contact_collider_velocity_at_pos); + ClassDB::bind_method(_MD("get_step"),&Physics2DDirectBodyState::get_step); + ClassDB::bind_method(_MD("integrate_forces"),&Physics2DDirectBodyState::integrate_forces); + ClassDB::bind_method(_MD("get_space_state:Physics2DDirectSpaceState"),&Physics2DDirectBodyState::get_space_state); } @@ -132,11 +132,11 @@ RID Physics2DShapeQueryParameters::get_shape_rid() const { return shape; } -void Physics2DShapeQueryParameters::set_transform(const Matrix32& p_transform){ +void Physics2DShapeQueryParameters::set_transform(const Transform2D& p_transform){ transform=p_transform; } -Matrix32 Physics2DShapeQueryParameters::get_transform() const{ +Transform2D Physics2DShapeQueryParameters::get_transform() const{ return transform; } @@ -198,27 +198,27 @@ Vector<RID> Physics2DShapeQueryParameters::get_exclude() const{ void Physics2DShapeQueryParameters::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_shape","shape:Shape2D"),&Physics2DShapeQueryParameters::set_shape); - ObjectTypeDB::bind_method(_MD("set_shape_rid","shape"),&Physics2DShapeQueryParameters::set_shape_rid); - ObjectTypeDB::bind_method(_MD("get_shape_rid"),&Physics2DShapeQueryParameters::get_shape_rid); + ClassDB::bind_method(_MD("set_shape","shape:Shape2D"),&Physics2DShapeQueryParameters::set_shape); + ClassDB::bind_method(_MD("set_shape_rid","shape"),&Physics2DShapeQueryParameters::set_shape_rid); + ClassDB::bind_method(_MD("get_shape_rid"),&Physics2DShapeQueryParameters::get_shape_rid); - ObjectTypeDB::bind_method(_MD("set_transform","transform"),&Physics2DShapeQueryParameters::set_transform); - ObjectTypeDB::bind_method(_MD("get_transform"),&Physics2DShapeQueryParameters::get_transform); + ClassDB::bind_method(_MD("set_transform","transform"),&Physics2DShapeQueryParameters::set_transform); + ClassDB::bind_method(_MD("get_transform"),&Physics2DShapeQueryParameters::get_transform); - ObjectTypeDB::bind_method(_MD("set_motion","motion"),&Physics2DShapeQueryParameters::set_motion); - ObjectTypeDB::bind_method(_MD("get_motion"),&Physics2DShapeQueryParameters::get_motion); + ClassDB::bind_method(_MD("set_motion","motion"),&Physics2DShapeQueryParameters::set_motion); + ClassDB::bind_method(_MD("get_motion"),&Physics2DShapeQueryParameters::get_motion); - ObjectTypeDB::bind_method(_MD("set_margin","margin"),&Physics2DShapeQueryParameters::set_margin); - ObjectTypeDB::bind_method(_MD("get_margin"),&Physics2DShapeQueryParameters::get_margin); + ClassDB::bind_method(_MD("set_margin","margin"),&Physics2DShapeQueryParameters::set_margin); + ClassDB::bind_method(_MD("get_margin"),&Physics2DShapeQueryParameters::get_margin); - ObjectTypeDB::bind_method(_MD("set_layer_mask","layer_mask"),&Physics2DShapeQueryParameters::set_layer_mask); - ObjectTypeDB::bind_method(_MD("get_layer_mask"),&Physics2DShapeQueryParameters::get_layer_mask); + ClassDB::bind_method(_MD("set_layer_mask","layer_mask"),&Physics2DShapeQueryParameters::set_layer_mask); + ClassDB::bind_method(_MD("get_layer_mask"),&Physics2DShapeQueryParameters::get_layer_mask); - ObjectTypeDB::bind_method(_MD("set_object_type_mask","object_type_mask"),&Physics2DShapeQueryParameters::set_object_type_mask); - ObjectTypeDB::bind_method(_MD("get_object_type_mask"),&Physics2DShapeQueryParameters::get_object_type_mask); + ClassDB::bind_method(_MD("set_object_type_mask","object_type_mask"),&Physics2DShapeQueryParameters::set_object_type_mask); + ClassDB::bind_method(_MD("get_object_type_mask"),&Physics2DShapeQueryParameters::get_object_type_mask); - ObjectTypeDB::bind_method(_MD("set_exclude","exclude"),&Physics2DShapeQueryParameters::set_exclude); - ObjectTypeDB::bind_method(_MD("get_exclude"),&Physics2DShapeQueryParameters::get_exclude); + ClassDB::bind_method(_MD("set_exclude","exclude"),&Physics2DShapeQueryParameters::set_exclude); + ClassDB::bind_method(_MD("get_exclude"),&Physics2DShapeQueryParameters::get_exclude); } @@ -366,13 +366,13 @@ Physics2DDirectSpaceState::Physics2DDirectSpaceState() { void Physics2DDirectSpaceState::_bind_methods() { - ObjectTypeDB::bind_method(_MD("intersect_point","point","max_results","exclude","layer_mask","type_mask"),&Physics2DDirectSpaceState::_intersect_point,DEFVAL(32),DEFVAL(Array()),DEFVAL(0x7FFFFFFF),DEFVAL(TYPE_MASK_COLLISION)); - ObjectTypeDB::bind_method(_MD("intersect_ray:Dictionary","from","to","exclude","layer_mask","type_mask"),&Physics2DDirectSpaceState::_intersect_ray,DEFVAL(Array()),DEFVAL(0x7FFFFFFF),DEFVAL(TYPE_MASK_COLLISION)); - ObjectTypeDB::bind_method(_MD("intersect_shape","shape:Physics2DShapeQueryParameters","max_results"),&Physics2DDirectSpaceState::_intersect_shape,DEFVAL(32)); - ObjectTypeDB::bind_method(_MD("cast_motion","shape:Physics2DShapeQueryParameters"),&Physics2DDirectSpaceState::_cast_motion); - ObjectTypeDB::bind_method(_MD("collide_shape","shape:Physics2DShapeQueryParameters","max_results"),&Physics2DDirectSpaceState::_collide_shape,DEFVAL(32)); - ObjectTypeDB::bind_method(_MD("get_rest_info","shape:Physics2DShapeQueryParameters"),&Physics2DDirectSpaceState::_get_rest_info); - //ObjectTypeDB::bind_method(_MD("cast_motion","shape","xform","motion","exclude","umask"),&Physics2DDirectSpaceState::_intersect_shape,DEFVAL(Array()),DEFVAL(0)); + ClassDB::bind_method(_MD("intersect_point","point","max_results","exclude","layer_mask","type_mask"),&Physics2DDirectSpaceState::_intersect_point,DEFVAL(32),DEFVAL(Array()),DEFVAL(0x7FFFFFFF),DEFVAL(TYPE_MASK_COLLISION)); + ClassDB::bind_method(_MD("intersect_ray:Dictionary","from","to","exclude","layer_mask","type_mask"),&Physics2DDirectSpaceState::_intersect_ray,DEFVAL(Array()),DEFVAL(0x7FFFFFFF),DEFVAL(TYPE_MASK_COLLISION)); + ClassDB::bind_method(_MD("intersect_shape","shape:Physics2DShapeQueryParameters","max_results"),&Physics2DDirectSpaceState::_intersect_shape,DEFVAL(32)); + ClassDB::bind_method(_MD("cast_motion","shape:Physics2DShapeQueryParameters"),&Physics2DDirectSpaceState::_cast_motion); + ClassDB::bind_method(_MD("collide_shape","shape:Physics2DShapeQueryParameters","max_results"),&Physics2DDirectSpaceState::_collide_shape,DEFVAL(32)); + ClassDB::bind_method(_MD("get_rest_info","shape:Physics2DShapeQueryParameters"),&Physics2DDirectSpaceState::_get_rest_info); + //ClassDB::bind_method(_MD("cast_motion","shape","xform","motion","exclude","umask"),&Physics2DDirectSpaceState::_intersect_shape,DEFVAL(Array()),DEFVAL(0)); BIND_CONSTANT( TYPE_MASK_STATIC_BODY ); BIND_CONSTANT( TYPE_MASK_KINEMATIC_BODY ); @@ -412,11 +412,11 @@ Physics2DShapeQueryResult::Physics2DShapeQueryResult() { void Physics2DShapeQueryResult::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_result_count"),&Physics2DShapeQueryResult::get_result_count); - ObjectTypeDB::bind_method(_MD("get_result_rid","idx"),&Physics2DShapeQueryResult::get_result_rid); - ObjectTypeDB::bind_method(_MD("get_result_object_id","idx"),&Physics2DShapeQueryResult::get_result_object_id); - ObjectTypeDB::bind_method(_MD("get_result_object","idx"),&Physics2DShapeQueryResult::get_result_object); - ObjectTypeDB::bind_method(_MD("get_result_object_shape","idx"),&Physics2DShapeQueryResult::get_result_object_shape); + ClassDB::bind_method(_MD("get_result_count"),&Physics2DShapeQueryResult::get_result_count); + ClassDB::bind_method(_MD("get_result_rid","idx"),&Physics2DShapeQueryResult::get_result_rid); + ClassDB::bind_method(_MD("get_result_object_id","idx"),&Physics2DShapeQueryResult::get_result_object_id); + ClassDB::bind_method(_MD("get_result_object","idx"),&Physics2DShapeQueryResult::get_result_object); + ClassDB::bind_method(_MD("get_result_object_shape","idx"),&Physics2DShapeQueryResult::get_result_object_shape); } @@ -468,16 +468,16 @@ int Physics2DTestMotionResult::get_collider_shape() const{ void Physics2DTestMotionResult::_bind_methods() { - //ObjectTypeDB::bind_method(_MD("is_colliding"),&Physics2DTestMotionResult::is_colliding); - ObjectTypeDB::bind_method(_MD("get_motion"),&Physics2DTestMotionResult::get_motion); - ObjectTypeDB::bind_method(_MD("get_motion_remainder"),&Physics2DTestMotionResult::get_motion_remainder); - ObjectTypeDB::bind_method(_MD("get_collision_point"),&Physics2DTestMotionResult::get_collision_point); - ObjectTypeDB::bind_method(_MD("get_collision_normal"),&Physics2DTestMotionResult::get_collision_normal); - ObjectTypeDB::bind_method(_MD("get_collider_velocity"),&Physics2DTestMotionResult::get_collider_velocity); - ObjectTypeDB::bind_method(_MD("get_collider_id"),&Physics2DTestMotionResult::get_collider_id); - ObjectTypeDB::bind_method(_MD("get_collider_rid"),&Physics2DTestMotionResult::get_collider_rid); - ObjectTypeDB::bind_method(_MD("get_collider"),&Physics2DTestMotionResult::get_collider); - ObjectTypeDB::bind_method(_MD("get_collider_shape"),&Physics2DTestMotionResult::get_collider_shape); + //ClassDB::bind_method(_MD("is_colliding"),&Physics2DTestMotionResult::is_colliding); + ClassDB::bind_method(_MD("get_motion"),&Physics2DTestMotionResult::get_motion); + ClassDB::bind_method(_MD("get_motion_remainder"),&Physics2DTestMotionResult::get_motion_remainder); + ClassDB::bind_method(_MD("get_collision_point"),&Physics2DTestMotionResult::get_collision_point); + ClassDB::bind_method(_MD("get_collision_normal"),&Physics2DTestMotionResult::get_collision_normal); + ClassDB::bind_method(_MD("get_collider_velocity"),&Physics2DTestMotionResult::get_collider_velocity); + ClassDB::bind_method(_MD("get_collider_id"),&Physics2DTestMotionResult::get_collider_id); + ClassDB::bind_method(_MD("get_collider_rid"),&Physics2DTestMotionResult::get_collider_rid); + ClassDB::bind_method(_MD("get_collider"),&Physics2DTestMotionResult::get_collider); + ClassDB::bind_method(_MD("get_collider_shape"),&Physics2DTestMotionResult::get_collider_shape); } @@ -493,7 +493,7 @@ Physics2DTestMotionResult::Physics2DTestMotionResult(){ -bool Physics2DServer::_body_test_motion(RID p_body,const Matrix32& p_from,const Vector2& p_motion,float p_margin,const Ref<Physics2DTestMotionResult>& p_result) { +bool Physics2DServer::_body_test_motion(RID p_body,const Transform2D& p_from,const Vector2& p_motion,float p_margin,const Ref<Physics2DTestMotionResult>& p_result) { MotionResult *r=NULL; if (p_result.is_valid()) @@ -504,147 +504,147 @@ bool Physics2DServer::_body_test_motion(RID p_body,const Matrix32& p_from,const void Physics2DServer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("shape_create","type"),&Physics2DServer::shape_create); - ObjectTypeDB::bind_method(_MD("shape_set_data","shape","data"),&Physics2DServer::shape_set_data); + ClassDB::bind_method(_MD("shape_create","type"),&Physics2DServer::shape_create); + ClassDB::bind_method(_MD("shape_set_data","shape","data"),&Physics2DServer::shape_set_data); - ObjectTypeDB::bind_method(_MD("shape_get_type","shape"),&Physics2DServer::shape_get_type); - ObjectTypeDB::bind_method(_MD("shape_get_data","shape"),&Physics2DServer::shape_get_data); + ClassDB::bind_method(_MD("shape_get_type","shape"),&Physics2DServer::shape_get_type); + ClassDB::bind_method(_MD("shape_get_data","shape"),&Physics2DServer::shape_get_data); - ObjectTypeDB::bind_method(_MD("space_create"),&Physics2DServer::space_create); - ObjectTypeDB::bind_method(_MD("space_set_active","space","active"),&Physics2DServer::space_set_active); - ObjectTypeDB::bind_method(_MD("space_is_active","space"),&Physics2DServer::space_is_active); - ObjectTypeDB::bind_method(_MD("space_set_param","space","param","value"),&Physics2DServer::space_set_param); - ObjectTypeDB::bind_method(_MD("space_get_param","space","param"),&Physics2DServer::space_get_param); - ObjectTypeDB::bind_method(_MD("space_get_direct_state:Physics2DDirectSpaceState","space"),&Physics2DServer::space_get_direct_state); + ClassDB::bind_method(_MD("space_create"),&Physics2DServer::space_create); + ClassDB::bind_method(_MD("space_set_active","space","active"),&Physics2DServer::space_set_active); + ClassDB::bind_method(_MD("space_is_active","space"),&Physics2DServer::space_is_active); + ClassDB::bind_method(_MD("space_set_param","space","param","value"),&Physics2DServer::space_set_param); + ClassDB::bind_method(_MD("space_get_param","space","param"),&Physics2DServer::space_get_param); + ClassDB::bind_method(_MD("space_get_direct_state:Physics2DDirectSpaceState","space"),&Physics2DServer::space_get_direct_state); - ObjectTypeDB::bind_method(_MD("area_create"),&Physics2DServer::area_create); - ObjectTypeDB::bind_method(_MD("area_set_space","area","space"),&Physics2DServer::area_set_space); - ObjectTypeDB::bind_method(_MD("area_get_space","area"),&Physics2DServer::area_get_space); + ClassDB::bind_method(_MD("area_create"),&Physics2DServer::area_create); + ClassDB::bind_method(_MD("area_set_space","area","space"),&Physics2DServer::area_set_space); + ClassDB::bind_method(_MD("area_get_space","area"),&Physics2DServer::area_get_space); - ObjectTypeDB::bind_method(_MD("area_set_space_override_mode","area","mode"),&Physics2DServer::area_set_space_override_mode); - ObjectTypeDB::bind_method(_MD("area_get_space_override_mode","area"),&Physics2DServer::area_get_space_override_mode); + ClassDB::bind_method(_MD("area_set_space_override_mode","area","mode"),&Physics2DServer::area_set_space_override_mode); + ClassDB::bind_method(_MD("area_get_space_override_mode","area"),&Physics2DServer::area_get_space_override_mode); - ObjectTypeDB::bind_method(_MD("area_add_shape","area","shape","transform"),&Physics2DServer::area_add_shape,DEFVAL(Matrix32())); - ObjectTypeDB::bind_method(_MD("area_set_shape","area","shape_idx","shape"),&Physics2DServer::area_set_shape); - ObjectTypeDB::bind_method(_MD("area_set_shape_transform","area","shape_idx","transform"),&Physics2DServer::area_set_shape_transform); + ClassDB::bind_method(_MD("area_add_shape","area","shape","transform"),&Physics2DServer::area_add_shape,DEFVAL(Transform2D())); + ClassDB::bind_method(_MD("area_set_shape","area","shape_idx","shape"),&Physics2DServer::area_set_shape); + ClassDB::bind_method(_MD("area_set_shape_transform","area","shape_idx","transform"),&Physics2DServer::area_set_shape_transform); - ObjectTypeDB::bind_method(_MD("area_get_shape_count","area"),&Physics2DServer::area_get_shape_count); - ObjectTypeDB::bind_method(_MD("area_get_shape","area","shape_idx"),&Physics2DServer::area_get_shape); - ObjectTypeDB::bind_method(_MD("area_get_shape_transform","area","shape_idx"),&Physics2DServer::area_get_shape_transform); + ClassDB::bind_method(_MD("area_get_shape_count","area"),&Physics2DServer::area_get_shape_count); + ClassDB::bind_method(_MD("area_get_shape","area","shape_idx"),&Physics2DServer::area_get_shape); + ClassDB::bind_method(_MD("area_get_shape_transform","area","shape_idx"),&Physics2DServer::area_get_shape_transform); - ObjectTypeDB::bind_method(_MD("area_remove_shape","area","shape_idx"),&Physics2DServer::area_remove_shape); - ObjectTypeDB::bind_method(_MD("area_clear_shapes","area"),&Physics2DServer::area_clear_shapes); + ClassDB::bind_method(_MD("area_remove_shape","area","shape_idx"),&Physics2DServer::area_remove_shape); + ClassDB::bind_method(_MD("area_clear_shapes","area"),&Physics2DServer::area_clear_shapes); - ObjectTypeDB::bind_method(_MD("area_set_layer_mask","area","mask"),&Physics2DServer::area_set_layer_mask); - ObjectTypeDB::bind_method(_MD("area_set_collision_mask","area","mask"),&Physics2DServer::area_set_collision_mask); + ClassDB::bind_method(_MD("area_set_layer_mask","area","mask"),&Physics2DServer::area_set_layer_mask); + ClassDB::bind_method(_MD("area_set_collision_mask","area","mask"),&Physics2DServer::area_set_collision_mask); - ObjectTypeDB::bind_method(_MD("area_set_param","area","param","value"),&Physics2DServer::area_set_param); - ObjectTypeDB::bind_method(_MD("area_set_transform","area","transform"),&Physics2DServer::area_set_transform); + ClassDB::bind_method(_MD("area_set_param","area","param","value"),&Physics2DServer::area_set_param); + ClassDB::bind_method(_MD("area_set_transform","area","transform"),&Physics2DServer::area_set_transform); - ObjectTypeDB::bind_method(_MD("area_get_param","area","param"),&Physics2DServer::area_get_param); - ObjectTypeDB::bind_method(_MD("area_get_transform","area"),&Physics2DServer::area_get_transform); + ClassDB::bind_method(_MD("area_get_param","area","param"),&Physics2DServer::area_get_param); + ClassDB::bind_method(_MD("area_get_transform","area"),&Physics2DServer::area_get_transform); - ObjectTypeDB::bind_method(_MD("area_attach_object_instance_ID","area","id"),&Physics2DServer::area_attach_object_instance_ID); - ObjectTypeDB::bind_method(_MD("area_get_object_instance_ID","area"),&Physics2DServer::area_get_object_instance_ID); + ClassDB::bind_method(_MD("area_attach_object_instance_ID","area","id"),&Physics2DServer::area_attach_object_instance_ID); + ClassDB::bind_method(_MD("area_get_object_instance_ID","area"),&Physics2DServer::area_get_object_instance_ID); - ObjectTypeDB::bind_method(_MD("area_set_monitor_callback","area","receiver","method"),&Physics2DServer::area_set_monitor_callback); + ClassDB::bind_method(_MD("area_set_monitor_callback","area","receiver","method"),&Physics2DServer::area_set_monitor_callback); - ObjectTypeDB::bind_method(_MD("body_create","mode","init_sleeping"),&Physics2DServer::body_create,DEFVAL(BODY_MODE_RIGID),DEFVAL(false)); + ClassDB::bind_method(_MD("body_create","mode","init_sleeping"),&Physics2DServer::body_create,DEFVAL(BODY_MODE_RIGID),DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("body_set_space","body","space"),&Physics2DServer::body_set_space); - ObjectTypeDB::bind_method(_MD("body_get_space","body"),&Physics2DServer::body_get_space); + ClassDB::bind_method(_MD("body_set_space","body","space"),&Physics2DServer::body_set_space); + ClassDB::bind_method(_MD("body_get_space","body"),&Physics2DServer::body_get_space); - ObjectTypeDB::bind_method(_MD("body_set_mode","body","mode"),&Physics2DServer::body_set_mode); - ObjectTypeDB::bind_method(_MD("body_get_mode","body"),&Physics2DServer::body_get_mode); + ClassDB::bind_method(_MD("body_set_mode","body","mode"),&Physics2DServer::body_set_mode); + ClassDB::bind_method(_MD("body_get_mode","body"),&Physics2DServer::body_get_mode); - ObjectTypeDB::bind_method(_MD("body_add_shape","body","shape","transform"),&Physics2DServer::body_add_shape,DEFVAL(Matrix32())); - ObjectTypeDB::bind_method(_MD("body_set_shape","body","shape_idx","shape"),&Physics2DServer::body_set_shape); - ObjectTypeDB::bind_method(_MD("body_set_shape_transform","body","shape_idx","transform"),&Physics2DServer::body_set_shape_transform); - ObjectTypeDB::bind_method(_MD("body_set_shape_metadata","body","shape_idx","metadata"),&Physics2DServer::body_set_shape_metadata); + ClassDB::bind_method(_MD("body_add_shape","body","shape","transform"),&Physics2DServer::body_add_shape,DEFVAL(Transform2D())); + ClassDB::bind_method(_MD("body_set_shape","body","shape_idx","shape"),&Physics2DServer::body_set_shape); + ClassDB::bind_method(_MD("body_set_shape_transform","body","shape_idx","transform"),&Physics2DServer::body_set_shape_transform); + ClassDB::bind_method(_MD("body_set_shape_metadata","body","shape_idx","metadata"),&Physics2DServer::body_set_shape_metadata); - ObjectTypeDB::bind_method(_MD("body_get_shape_count","body"),&Physics2DServer::body_get_shape_count); - ObjectTypeDB::bind_method(_MD("body_get_shape","body","shape_idx"),&Physics2DServer::body_get_shape); - ObjectTypeDB::bind_method(_MD("body_get_shape_transform","body","shape_idx"),&Physics2DServer::body_get_shape_transform); - ObjectTypeDB::bind_method(_MD("body_get_shape_metadata","body","shape_idx"),&Physics2DServer::body_get_shape_metadata); + ClassDB::bind_method(_MD("body_get_shape_count","body"),&Physics2DServer::body_get_shape_count); + ClassDB::bind_method(_MD("body_get_shape","body","shape_idx"),&Physics2DServer::body_get_shape); + ClassDB::bind_method(_MD("body_get_shape_transform","body","shape_idx"),&Physics2DServer::body_get_shape_transform); + ClassDB::bind_method(_MD("body_get_shape_metadata","body","shape_idx"),&Physics2DServer::body_get_shape_metadata); - ObjectTypeDB::bind_method(_MD("body_remove_shape","body","shape_idx"),&Physics2DServer::body_remove_shape); - ObjectTypeDB::bind_method(_MD("body_clear_shapes","body"),&Physics2DServer::body_clear_shapes); + ClassDB::bind_method(_MD("body_remove_shape","body","shape_idx"),&Physics2DServer::body_remove_shape); + ClassDB::bind_method(_MD("body_clear_shapes","body"),&Physics2DServer::body_clear_shapes); - ObjectTypeDB::bind_method(_MD("body_set_shape_as_trigger","body","shape_idx","enable"),&Physics2DServer::body_set_shape_as_trigger); - ObjectTypeDB::bind_method(_MD("body_is_shape_set_as_trigger","body","shape_idx"),&Physics2DServer::body_is_shape_set_as_trigger); + ClassDB::bind_method(_MD("body_set_shape_as_trigger","body","shape_idx","enable"),&Physics2DServer::body_set_shape_as_trigger); + ClassDB::bind_method(_MD("body_is_shape_set_as_trigger","body","shape_idx"),&Physics2DServer::body_is_shape_set_as_trigger); - ObjectTypeDB::bind_method(_MD("body_attach_object_instance_ID","body","id"),&Physics2DServer::body_attach_object_instance_ID); - ObjectTypeDB::bind_method(_MD("body_get_object_instance_ID","body"),&Physics2DServer::body_get_object_instance_ID); + ClassDB::bind_method(_MD("body_attach_object_instance_ID","body","id"),&Physics2DServer::body_attach_object_instance_ID); + ClassDB::bind_method(_MD("body_get_object_instance_ID","body"),&Physics2DServer::body_get_object_instance_ID); - ObjectTypeDB::bind_method(_MD("body_set_continuous_collision_detection_mode","body","mode"),&Physics2DServer::body_set_continuous_collision_detection_mode); - ObjectTypeDB::bind_method(_MD("body_get_continuous_collision_detection_mode","body"),&Physics2DServer::body_get_continuous_collision_detection_mode); + ClassDB::bind_method(_MD("body_set_continuous_collision_detection_mode","body","mode"),&Physics2DServer::body_set_continuous_collision_detection_mode); + ClassDB::bind_method(_MD("body_get_continuous_collision_detection_mode","body"),&Physics2DServer::body_get_continuous_collision_detection_mode); - ObjectTypeDB::bind_method(_MD("body_set_layer_mask","body","mask"),&Physics2DServer::body_set_layer_mask); - ObjectTypeDB::bind_method(_MD("body_get_layer_mask","body"),&Physics2DServer::body_get_layer_mask); + ClassDB::bind_method(_MD("body_set_layer_mask","body","mask"),&Physics2DServer::body_set_layer_mask); + ClassDB::bind_method(_MD("body_get_layer_mask","body"),&Physics2DServer::body_get_layer_mask); - ObjectTypeDB::bind_method(_MD("body_set_collision_mask","body","mask"),&Physics2DServer::body_set_collision_mask); - ObjectTypeDB::bind_method(_MD("body_get_collision_mask","body"),&Physics2DServer::body_get_collision_mask); + ClassDB::bind_method(_MD("body_set_collision_mask","body","mask"),&Physics2DServer::body_set_collision_mask); + ClassDB::bind_method(_MD("body_get_collision_mask","body"),&Physics2DServer::body_get_collision_mask); - ObjectTypeDB::bind_method(_MD("body_set_param","body","param","value"),&Physics2DServer::body_set_param); - ObjectTypeDB::bind_method(_MD("body_get_param","body","param"),&Physics2DServer::body_get_param); + ClassDB::bind_method(_MD("body_set_param","body","param","value"),&Physics2DServer::body_set_param); + ClassDB::bind_method(_MD("body_get_param","body","param"),&Physics2DServer::body_get_param); - ObjectTypeDB::bind_method(_MD("body_set_state","body","state","value"),&Physics2DServer::body_set_state); - ObjectTypeDB::bind_method(_MD("body_get_state","body","state"),&Physics2DServer::body_get_state); + ClassDB::bind_method(_MD("body_set_state","body","state","value"),&Physics2DServer::body_set_state); + ClassDB::bind_method(_MD("body_get_state","body","state"),&Physics2DServer::body_get_state); - ObjectTypeDB::bind_method(_MD("body_apply_impulse","body","pos","impulse"),&Physics2DServer::body_apply_impulse); - ObjectTypeDB::bind_method(_MD("body_add_force","body","offset","force"),&Physics2DServer::body_add_force); - ObjectTypeDB::bind_method(_MD("body_set_axis_velocity","body","axis_velocity"),&Physics2DServer::body_set_axis_velocity); + ClassDB::bind_method(_MD("body_apply_impulse","body","pos","impulse"),&Physics2DServer::body_apply_impulse); + ClassDB::bind_method(_MD("body_add_force","body","offset","force"),&Physics2DServer::body_add_force); + ClassDB::bind_method(_MD("body_set_axis_velocity","body","axis_velocity"),&Physics2DServer::body_set_axis_velocity); - ObjectTypeDB::bind_method(_MD("body_add_collision_exception","body","excepted_body"),&Physics2DServer::body_add_collision_exception); - ObjectTypeDB::bind_method(_MD("body_remove_collision_exception","body","excepted_body"),&Physics2DServer::body_remove_collision_exception); + ClassDB::bind_method(_MD("body_add_collision_exception","body","excepted_body"),&Physics2DServer::body_add_collision_exception); + ClassDB::bind_method(_MD("body_remove_collision_exception","body","excepted_body"),&Physics2DServer::body_remove_collision_exception); // virtual void body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions)=0; - ObjectTypeDB::bind_method(_MD("body_set_max_contacts_reported","body","amount"),&Physics2DServer::body_set_max_contacts_reported); - ObjectTypeDB::bind_method(_MD("body_get_max_contacts_reported","body"),&Physics2DServer::body_get_max_contacts_reported); + ClassDB::bind_method(_MD("body_set_max_contacts_reported","body","amount"),&Physics2DServer::body_set_max_contacts_reported); + ClassDB::bind_method(_MD("body_get_max_contacts_reported","body"),&Physics2DServer::body_get_max_contacts_reported); - ObjectTypeDB::bind_method(_MD("body_set_one_way_collision_direction","body","normal"),&Physics2DServer::body_set_one_way_collision_direction); - ObjectTypeDB::bind_method(_MD("body_get_one_way_collision_direction","body"),&Physics2DServer::body_get_one_way_collision_direction); + ClassDB::bind_method(_MD("body_set_one_way_collision_direction","body","normal"),&Physics2DServer::body_set_one_way_collision_direction); + ClassDB::bind_method(_MD("body_get_one_way_collision_direction","body"),&Physics2DServer::body_get_one_way_collision_direction); - ObjectTypeDB::bind_method(_MD("body_set_one_way_collision_max_depth","body","depth"),&Physics2DServer::body_set_one_way_collision_max_depth); - ObjectTypeDB::bind_method(_MD("body_get_one_way_collision_max_depth","body"),&Physics2DServer::body_get_one_way_collision_max_depth); + ClassDB::bind_method(_MD("body_set_one_way_collision_max_depth","body","depth"),&Physics2DServer::body_set_one_way_collision_max_depth); + ClassDB::bind_method(_MD("body_get_one_way_collision_max_depth","body"),&Physics2DServer::body_get_one_way_collision_max_depth); - ObjectTypeDB::bind_method(_MD("body_set_omit_force_integration","body","enable"),&Physics2DServer::body_set_omit_force_integration); - ObjectTypeDB::bind_method(_MD("body_is_omitting_force_integration","body"),&Physics2DServer::body_is_omitting_force_integration); + ClassDB::bind_method(_MD("body_set_omit_force_integration","body","enable"),&Physics2DServer::body_set_omit_force_integration); + ClassDB::bind_method(_MD("body_is_omitting_force_integration","body"),&Physics2DServer::body_is_omitting_force_integration); - ObjectTypeDB::bind_method(_MD("body_set_force_integration_callback","body","receiver","method","userdata"),&Physics2DServer::body_set_force_integration_callback,DEFVAL(Variant())); + ClassDB::bind_method(_MD("body_set_force_integration_callback","body","receiver","method","userdata"),&Physics2DServer::body_set_force_integration_callback,DEFVAL(Variant())); - ObjectTypeDB::bind_method(_MD("body_test_motion","body","from","motion","margin","result:Physics2DTestMotionResult"),&Physics2DServer::_body_test_motion,DEFVAL(0.08),DEFVAL(Variant())); + ClassDB::bind_method(_MD("body_test_motion","body","from","motion","margin","result:Physics2DTestMotionResult"),&Physics2DServer::_body_test_motion,DEFVAL(0.08),DEFVAL(Variant())); /* JOINT API */ - ObjectTypeDB::bind_method(_MD("joint_set_param","joint","param","value"),&Physics2DServer::joint_set_param); - ObjectTypeDB::bind_method(_MD("joint_get_param","joint","param"),&Physics2DServer::joint_get_param); + ClassDB::bind_method(_MD("joint_set_param","joint","param","value"),&Physics2DServer::joint_set_param); + ClassDB::bind_method(_MD("joint_get_param","joint","param"),&Physics2DServer::joint_get_param); - ObjectTypeDB::bind_method(_MD("pin_joint_create","anchor","body_a","body_b"),&Physics2DServer::pin_joint_create,DEFVAL(RID())); - ObjectTypeDB::bind_method(_MD("groove_joint_create","groove1_a","groove2_a","anchor_b","body_a","body_b"),&Physics2DServer::groove_joint_create,DEFVAL(RID()),DEFVAL(RID())); - ObjectTypeDB::bind_method(_MD("damped_spring_joint_create","anchor_a","anchor_b","body_a","body_b"),&Physics2DServer::damped_spring_joint_create,DEFVAL(RID())); + ClassDB::bind_method(_MD("pin_joint_create","anchor","body_a","body_b"),&Physics2DServer::pin_joint_create,DEFVAL(RID())); + ClassDB::bind_method(_MD("groove_joint_create","groove1_a","groove2_a","anchor_b","body_a","body_b"),&Physics2DServer::groove_joint_create,DEFVAL(RID()),DEFVAL(RID())); + ClassDB::bind_method(_MD("damped_spring_joint_create","anchor_a","anchor_b","body_a","body_b"),&Physics2DServer::damped_spring_joint_create,DEFVAL(RID())); - ObjectTypeDB::bind_method(_MD("damped_string_joint_set_param","joint","param","value"),&Physics2DServer::damped_string_joint_set_param); - ObjectTypeDB::bind_method(_MD("damped_string_joint_get_param","joint","param"),&Physics2DServer::damped_string_joint_get_param); + ClassDB::bind_method(_MD("damped_string_joint_set_param","joint","param","value"),&Physics2DServer::damped_string_joint_set_param); + ClassDB::bind_method(_MD("damped_string_joint_get_param","joint","param"),&Physics2DServer::damped_string_joint_get_param); - ObjectTypeDB::bind_method(_MD("joint_get_type","joint"),&Physics2DServer::joint_get_type); + ClassDB::bind_method(_MD("joint_get_type","joint"),&Physics2DServer::joint_get_type); - ObjectTypeDB::bind_method(_MD("free_rid","rid"),&Physics2DServer::free); + ClassDB::bind_method(_MD("free_rid","rid"),&Physics2DServer::free); - ObjectTypeDB::bind_method(_MD("set_active","active"),&Physics2DServer::set_active); + ClassDB::bind_method(_MD("set_active","active"),&Physics2DServer::set_active); - ObjectTypeDB::bind_method(_MD("get_process_info","process_info"),&Physics2DServer::get_process_info); + ClassDB::bind_method(_MD("get_process_info","process_info"),&Physics2DServer::get_process_info); -// ObjectTypeDB::bind_method(_MD("init"),&Physics2DServer::init); -// ObjectTypeDB::bind_method(_MD("step"),&Physics2DServer::step); -// ObjectTypeDB::bind_method(_MD("sync"),&Physics2DServer::sync); - //ObjectTypeDB::bind_method(_MD("flush_queries"),&Physics2DServer::flush_queries); +// ClassDB::bind_method(_MD("init"),&Physics2DServer::init); +// ClassDB::bind_method(_MD("step"),&Physics2DServer::step); +// ClassDB::bind_method(_MD("sync"),&Physics2DServer::sync); + //ClassDB::bind_method(_MD("flush_queries"),&Physics2DServer::flush_queries); BIND_CONSTANT( SPACE_PARAM_CONTACT_RECYCLE_RADIUS ); BIND_CONSTANT( SPACE_PARAM_CONTACT_MAX_SEPARATION ); diff --git a/servers/physics_2d_server.h b/servers/physics_2d_server.h index 10707e9314..424d2fa7ce 100644 --- a/servers/physics_2d_server.h +++ b/servers/physics_2d_server.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ class Physics2DDirectSpaceState; class Physics2DDirectBodyState : public Object { - OBJ_TYPE( Physics2DDirectBodyState, Object ); + GDCLASS( Physics2DDirectBodyState, Object ); protected: static void _bind_methods(); public: @@ -55,8 +55,8 @@ public: virtual void set_angular_velocity(real_t p_velocity)=0; virtual real_t get_angular_velocity() const=0; - virtual void set_transform(const Matrix32& p_transform)=0; - virtual Matrix32 get_transform() const=0; + virtual void set_transform(const Transform2D& p_transform)=0; + virtual Transform2D get_transform() const=0; virtual void set_sleep_state(bool p_enable)=0; virtual bool is_sleeping() const=0; @@ -90,10 +90,10 @@ class Physics2DShapeQueryResult; //used for script class Physics2DShapeQueryParameters : public Reference { - OBJ_TYPE(Physics2DShapeQueryParameters, Reference); + GDCLASS(Physics2DShapeQueryParameters, Reference); friend class Physics2DDirectSpaceState; RID shape; - Matrix32 transform; + Transform2D transform; Vector2 motion; float margin; Set<RID> exclude; @@ -108,8 +108,8 @@ public: void set_shape_rid(const RID& p_shape); RID get_shape_rid() const; - void set_transform(const Matrix32& p_transform); - Matrix32 get_transform() const; + void set_transform(const Transform2D& p_transform); + Transform2D get_transform() const; void set_motion(const Vector2& p_motion); Vector2 get_motion() const; @@ -133,7 +133,7 @@ public: class Physics2DDirectSpaceState : public Object { - OBJ_TYPE( Physics2DDirectSpaceState, Object ); + GDCLASS( Physics2DDirectSpaceState, Object ); Dictionary _intersect_ray(const Vector2& p_from, const Vector2& p_to,const Vector<RID>& p_exclude=Vector<RID>(),uint32_t p_layers=0,uint32_t p_object_type_mask=TYPE_MASK_COLLISION); @@ -184,11 +184,11 @@ public: virtual int intersect_point(const Vector2& p_point,ShapeResult *r_results,int p_result_max,const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION,bool p_pick_point=false)=0; - virtual int intersect_shape(const RID& p_shape, const Matrix32& p_xform,const Vector2& p_motion,float p_margin,ShapeResult *r_results,int p_result_max,const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION)=0; + virtual int intersect_shape(const RID& p_shape, const Transform2D& p_xform,const Vector2& p_motion,float p_margin,ShapeResult *r_results,int p_result_max,const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION)=0; - virtual bool cast_motion(const RID& p_shape, const Matrix32& p_xform,const Vector2& p_motion,float p_margin,float &p_closest_safe,float &p_closest_unsafe, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION)=0; + virtual bool cast_motion(const RID& p_shape, const Transform2D& p_xform,const Vector2& p_motion,float p_margin,float &p_closest_safe,float &p_closest_unsafe, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION)=0; - virtual bool collide_shape(RID p_shape, const Matrix32& p_shape_xform,const Vector2& p_motion,float p_margin,Vector2 *r_results,int p_result_max,int &r_result_count, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION)=0; + virtual bool collide_shape(RID p_shape, const Transform2D& p_shape_xform,const Vector2& p_motion,float p_margin,Vector2 *r_results,int p_result_max,int &r_result_count, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION)=0; struct ShapeRestInfo { @@ -202,7 +202,7 @@ public: }; - virtual bool rest_info(RID p_shape, const Matrix32& p_shape_xform,const Vector2& p_motion,float p_margin,ShapeRestInfo *r_info, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION)=0; + virtual bool rest_info(RID p_shape, const Transform2D& p_shape_xform,const Vector2& p_motion,float p_margin,ShapeRestInfo *r_info, const Set<RID>& p_exclude=Set<RID>(),uint32_t p_layer_mask=0xFFFFFFFF,uint32_t p_object_type_mask=TYPE_MASK_COLLISION)=0; Physics2DDirectSpaceState(); @@ -211,7 +211,7 @@ public: class Physics2DShapeQueryResult : public Reference { - OBJ_TYPE( Physics2DShapeQueryResult, Reference ); + GDCLASS( Physics2DShapeQueryResult, Reference ); Vector<Physics2DDirectSpaceState::ShapeResult> result; @@ -234,11 +234,11 @@ class Physics2DTestMotionResult; class Physics2DServer : public Object { - OBJ_TYPE( Physics2DServer, Object ); + GDCLASS( Physics2DServer, Object ); static Physics2DServer * singleton; - virtual bool _body_test_motion(RID p_body, const Matrix32 &p_from, const Vector2& p_motion, float p_margin=0.08, const Ref<Physics2DTestMotionResult>& p_result=Ref<Physics2DTestMotionResult>()); + virtual bool _body_test_motion(RID p_body, const Transform2D &p_from, const Vector2& p_motion, float p_margin=0.08, const Ref<Physics2DTestMotionResult>& p_result=Ref<Physics2DTestMotionResult>()); protected: static void _bind_methods(); @@ -268,7 +268,7 @@ public: virtual real_t shape_get_custom_solver_bias(RID p_shape) const=0; //these work well, but should be used from the main thread only - virtual bool shape_collide(RID p_shape_A, const Matrix32& p_xform_A,const Vector2& p_motion_A,RID p_shape_B, const Matrix32& p_xform_B, const Vector2& p_motion_B,Vector2 *r_results,int p_result_max,int &r_result_count)=0; + virtual bool shape_collide(RID p_shape_A, const Transform2D& p_xform_A,const Vector2& p_motion_A,RID p_shape_B, const Transform2D& p_xform_B, const Vector2& p_motion_B,Vector2 *r_results,int p_result_max,int &r_result_count)=0; /* SPACE API */ @@ -333,13 +333,13 @@ public: virtual void area_set_space_override_mode(RID p_area, AreaSpaceOverrideMode p_mode)=0; virtual AreaSpaceOverrideMode area_get_space_override_mode(RID p_area) const=0; - virtual void area_add_shape(RID p_area, RID p_shape, const Matrix32& p_transform=Matrix32())=0; + virtual void area_add_shape(RID p_area, RID p_shape, const Transform2D& p_transform=Transform2D())=0; virtual void area_set_shape(RID p_area, int p_shape_idx,RID p_shape)=0; - virtual void area_set_shape_transform(RID p_area, int p_shape_idx, const Matrix32& p_transform)=0; + virtual void area_set_shape_transform(RID p_area, int p_shape_idx, const Transform2D& p_transform)=0; virtual int area_get_shape_count(RID p_area) const=0; virtual RID area_get_shape(RID p_area, int p_shape_idx) const=0; - virtual Matrix32 area_get_shape_transform(RID p_area, int p_shape_idx) const=0; + virtual Transform2D area_get_shape_transform(RID p_area, int p_shape_idx) const=0; virtual void area_remove_shape(RID p_area, int p_shape_idx)=0; virtual void area_clear_shapes(RID p_area)=0; @@ -348,10 +348,10 @@ public: virtual ObjectID area_get_object_instance_ID(RID p_area) const=0; virtual void area_set_param(RID p_area,AreaParameter p_param,const Variant& p_value)=0; - virtual void area_set_transform(RID p_area, const Matrix32& p_transform)=0; + virtual void area_set_transform(RID p_area, const Transform2D& p_transform)=0; virtual Variant area_get_param(RID p_parea,AreaParameter p_param) const=0; - virtual Matrix32 area_get_transform(RID p_area) const=0; + virtual Transform2D area_get_transform(RID p_area) const=0; virtual void area_set_collision_mask(RID p_area,uint32_t p_mask)=0; virtual void area_set_layer_mask(RID p_area,uint32_t p_mask)=0; @@ -382,14 +382,14 @@ public: virtual void body_set_mode(RID p_body, BodyMode p_mode)=0; virtual BodyMode body_get_mode(RID p_body) const=0; - virtual void body_add_shape(RID p_body, RID p_shape, const Matrix32& p_transform=Matrix32())=0; + virtual void body_add_shape(RID p_body, RID p_shape, const Transform2D& p_transform=Transform2D())=0; virtual void body_set_shape(RID p_body, int p_shape_idx,RID p_shape)=0; - virtual void body_set_shape_transform(RID p_body, int p_shape_idx, const Matrix32& p_transform)=0; + virtual void body_set_shape_transform(RID p_body, int p_shape_idx, const Transform2D& p_transform)=0; virtual void body_set_shape_metadata(RID p_body, int p_shape_idx, const Variant& p_metadata)=0; virtual int body_get_shape_count(RID p_body) const=0; virtual RID body_get_shape(RID p_body, int p_shape_idx) const=0; - virtual Matrix32 body_get_shape_transform(RID p_body, int p_shape_idx) const=0; + virtual Transform2D body_get_shape_transform(RID p_body, int p_shape_idx) const=0; virtual Variant body_get_shape_metadata(RID p_body, int p_shape_idx) const=0; virtual void body_set_shape_as_trigger(RID p_body, int p_shape_idx,bool p_enable)=0; @@ -479,7 +479,7 @@ public: virtual void body_set_force_integration_callback(RID p_body,Object *p_receiver,const StringName& p_method,const Variant& p_udata=Variant())=0; - virtual bool body_collide_shape(RID p_body, int p_body_shape,RID p_shape, const Matrix32& p_shape_xform,const Vector2& p_motion,Vector2 *r_results,int p_result_max,int &r_result_count)=0; + virtual bool body_collide_shape(RID p_body, int p_body_shape,RID p_shape, const Transform2D& p_shape_xform,const Vector2& p_motion,Vector2 *r_results,int p_result_max,int &r_result_count)=0; virtual void body_set_pickable(RID p_body,bool p_pickable)=0; @@ -497,7 +497,7 @@ public: Variant collider_metadata; }; - virtual bool body_test_motion(RID p_body,const Matrix32& p_from,const Vector2& p_motion,float p_margin=0.001,MotionResult *r_result=NULL)=0; + virtual bool body_test_motion(RID p_body,const Transform2D& p_from,const Vector2& p_motion,float p_margin=0.001,MotionResult *r_result=NULL)=0; /* JOINT API */ @@ -576,7 +576,7 @@ public: class Physics2DTestMotionResult : public Reference { - OBJ_TYPE( Physics2DTestMotionResult, Reference ); + GDCLASS( Physics2DTestMotionResult, Reference ); Physics2DServer::MotionResult result; bool colliding; diff --git a/servers/physics_server.cpp b/servers/physics_server.cpp index 685477ed79..bbbbfdf3ab 100644 --- a/servers/physics_server.cpp +++ b/servers/physics_server.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -74,42 +74,46 @@ PhysicsServer * PhysicsServer::get_singleton() { void PhysicsDirectBodyState::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_total_gravity"),&PhysicsDirectBodyState::get_total_gravity); - ObjectTypeDB::bind_method(_MD("get_total_linear_damp"),&PhysicsDirectBodyState::get_total_linear_damp); - ObjectTypeDB::bind_method(_MD("get_total_angular_damp"),&PhysicsDirectBodyState::get_total_angular_damp); + ClassDB::bind_method(_MD("get_total_gravity"),&PhysicsDirectBodyState::get_total_gravity); + ClassDB::bind_method(_MD("get_total_linear_damp"),&PhysicsDirectBodyState::get_total_linear_damp); + ClassDB::bind_method(_MD("get_total_angular_damp"),&PhysicsDirectBodyState::get_total_angular_damp); - ObjectTypeDB::bind_method(_MD("get_inverse_mass"),&PhysicsDirectBodyState::get_inverse_mass); - ObjectTypeDB::bind_method(_MD("get_inverse_inertia"),&PhysicsDirectBodyState::get_inverse_inertia); + ClassDB::bind_method(_MD("get_center_of_mass"),&PhysicsDirectBodyState::get_center_of_mass); + ClassDB::bind_method(_MD("get_principal_inetria_axes"),&PhysicsDirectBodyState::get_principal_inertia_axes); - ObjectTypeDB::bind_method(_MD("set_linear_velocity","velocity"),&PhysicsDirectBodyState::set_linear_velocity); - ObjectTypeDB::bind_method(_MD("get_linear_velocity"),&PhysicsDirectBodyState::get_linear_velocity); + ClassDB::bind_method(_MD("get_inverse_mass"),&PhysicsDirectBodyState::get_inverse_mass); + ClassDB::bind_method(_MD("get_inverse_inertia"),&PhysicsDirectBodyState::get_inverse_inertia); - ObjectTypeDB::bind_method(_MD("set_angular_velocity","velocity"),&PhysicsDirectBodyState::set_angular_velocity); - ObjectTypeDB::bind_method(_MD("get_angular_velocity"),&PhysicsDirectBodyState::get_angular_velocity); + ClassDB::bind_method(_MD("set_linear_velocity","velocity"),&PhysicsDirectBodyState::set_linear_velocity); + ClassDB::bind_method(_MD("get_linear_velocity"),&PhysicsDirectBodyState::get_linear_velocity); - ObjectTypeDB::bind_method(_MD("set_transform","transform"),&PhysicsDirectBodyState::set_transform); - ObjectTypeDB::bind_method(_MD("get_transform"),&PhysicsDirectBodyState::get_transform); + ClassDB::bind_method(_MD("set_angular_velocity","velocity"),&PhysicsDirectBodyState::set_angular_velocity); + ClassDB::bind_method(_MD("get_angular_velocity"),&PhysicsDirectBodyState::get_angular_velocity); - ObjectTypeDB::bind_method(_MD("add_force","force","pos"),&PhysicsDirectBodyState::add_force); - ObjectTypeDB::bind_method(_MD("apply_impulse","pos","j"),&PhysicsDirectBodyState::apply_impulse); + ClassDB::bind_method(_MD("set_transform","transform"),&PhysicsDirectBodyState::set_transform); + ClassDB::bind_method(_MD("get_transform"),&PhysicsDirectBodyState::get_transform); - ObjectTypeDB::bind_method(_MD("set_sleep_state","enabled"),&PhysicsDirectBodyState::set_sleep_state); - ObjectTypeDB::bind_method(_MD("is_sleeping"),&PhysicsDirectBodyState::is_sleeping); + ClassDB::bind_method(_MD("add_force","force","pos"),&PhysicsDirectBodyState::add_force); + ClassDB::bind_method(_MD("apply_impulse","pos","j"),&PhysicsDirectBodyState::apply_impulse); + ClassDB::bind_method(_MD("apply_torqe_impulse","j"),&PhysicsDirectBodyState::apply_torque_impulse); - ObjectTypeDB::bind_method(_MD("get_contact_count"),&PhysicsDirectBodyState::get_contact_count); + ClassDB::bind_method(_MD("set_sleep_state","enabled"),&PhysicsDirectBodyState::set_sleep_state); + ClassDB::bind_method(_MD("is_sleeping"),&PhysicsDirectBodyState::is_sleeping); - ObjectTypeDB::bind_method(_MD("get_contact_local_pos","contact_idx"),&PhysicsDirectBodyState::get_contact_local_pos); - ObjectTypeDB::bind_method(_MD("get_contact_local_normal","contact_idx"),&PhysicsDirectBodyState::get_contact_local_normal); - ObjectTypeDB::bind_method(_MD("get_contact_local_shape","contact_idx"),&PhysicsDirectBodyState::get_contact_local_shape); - ObjectTypeDB::bind_method(_MD("get_contact_collider","contact_idx"),&PhysicsDirectBodyState::get_contact_collider); - ObjectTypeDB::bind_method(_MD("get_contact_collider_pos","contact_idx"),&PhysicsDirectBodyState::get_contact_collider_pos); - ObjectTypeDB::bind_method(_MD("get_contact_collider_id","contact_idx"),&PhysicsDirectBodyState::get_contact_collider_id); - ObjectTypeDB::bind_method(_MD("get_contact_collider_object","contact_idx"),&PhysicsDirectBodyState::get_contact_collider_object); - ObjectTypeDB::bind_method(_MD("get_contact_collider_shape","contact_idx"),&PhysicsDirectBodyState::get_contact_collider_shape); - ObjectTypeDB::bind_method(_MD("get_contact_collider_velocity_at_pos","contact_idx"),&PhysicsDirectBodyState::get_contact_collider_velocity_at_pos); - ObjectTypeDB::bind_method(_MD("get_step"),&PhysicsDirectBodyState::get_step); - ObjectTypeDB::bind_method(_MD("integrate_forces"),&PhysicsDirectBodyState::integrate_forces); - ObjectTypeDB::bind_method(_MD("get_space_state:PhysicsDirectSpaceState"),&PhysicsDirectBodyState::get_space_state); + ClassDB::bind_method(_MD("get_contact_count"),&PhysicsDirectBodyState::get_contact_count); + + ClassDB::bind_method(_MD("get_contact_local_pos","contact_idx"),&PhysicsDirectBodyState::get_contact_local_pos); + ClassDB::bind_method(_MD("get_contact_local_normal","contact_idx"),&PhysicsDirectBodyState::get_contact_local_normal); + ClassDB::bind_method(_MD("get_contact_local_shape","contact_idx"),&PhysicsDirectBodyState::get_contact_local_shape); + ClassDB::bind_method(_MD("get_contact_collider","contact_idx"),&PhysicsDirectBodyState::get_contact_collider); + ClassDB::bind_method(_MD("get_contact_collider_pos","contact_idx"),&PhysicsDirectBodyState::get_contact_collider_pos); + ClassDB::bind_method(_MD("get_contact_collider_id","contact_idx"),&PhysicsDirectBodyState::get_contact_collider_id); + ClassDB::bind_method(_MD("get_contact_collider_object","contact_idx"),&PhysicsDirectBodyState::get_contact_collider_object); + ClassDB::bind_method(_MD("get_contact_collider_shape","contact_idx"),&PhysicsDirectBodyState::get_contact_collider_shape); + ClassDB::bind_method(_MD("get_contact_collider_velocity_at_pos","contact_idx"),&PhysicsDirectBodyState::get_contact_collider_velocity_at_pos); + ClassDB::bind_method(_MD("get_step"),&PhysicsDirectBodyState::get_step); + ClassDB::bind_method(_MD("integrate_forces"),&PhysicsDirectBodyState::integrate_forces); + ClassDB::bind_method(_MD("get_space_state:PhysicsDirectSpaceState"),&PhysicsDirectBodyState::get_space_state); } @@ -193,24 +197,24 @@ Vector<RID> PhysicsShapeQueryParameters::get_exclude() const{ void PhysicsShapeQueryParameters::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_shape","shape:Shape"),&PhysicsShapeQueryParameters::set_shape); - ObjectTypeDB::bind_method(_MD("set_shape_rid","shape"),&PhysicsShapeQueryParameters::set_shape_rid); - ObjectTypeDB::bind_method(_MD("get_shape_rid"),&PhysicsShapeQueryParameters::get_shape_rid); + ClassDB::bind_method(_MD("set_shape","shape:Shape"),&PhysicsShapeQueryParameters::set_shape); + ClassDB::bind_method(_MD("set_shape_rid","shape"),&PhysicsShapeQueryParameters::set_shape_rid); + ClassDB::bind_method(_MD("get_shape_rid"),&PhysicsShapeQueryParameters::get_shape_rid); - ObjectTypeDB::bind_method(_MD("set_transform","transform"),&PhysicsShapeQueryParameters::set_transform); - ObjectTypeDB::bind_method(_MD("get_transform"),&PhysicsShapeQueryParameters::get_transform); + ClassDB::bind_method(_MD("set_transform","transform"),&PhysicsShapeQueryParameters::set_transform); + ClassDB::bind_method(_MD("get_transform"),&PhysicsShapeQueryParameters::get_transform); - ObjectTypeDB::bind_method(_MD("set_margin","margin"),&PhysicsShapeQueryParameters::set_margin); - ObjectTypeDB::bind_method(_MD("get_margin"),&PhysicsShapeQueryParameters::get_margin); + ClassDB::bind_method(_MD("set_margin","margin"),&PhysicsShapeQueryParameters::set_margin); + ClassDB::bind_method(_MD("get_margin"),&PhysicsShapeQueryParameters::get_margin); - ObjectTypeDB::bind_method(_MD("set_layer_mask","layer_mask"),&PhysicsShapeQueryParameters::set_layer_mask); - ObjectTypeDB::bind_method(_MD("get_layer_mask"),&PhysicsShapeQueryParameters::get_layer_mask); + ClassDB::bind_method(_MD("set_layer_mask","layer_mask"),&PhysicsShapeQueryParameters::set_layer_mask); + ClassDB::bind_method(_MD("get_layer_mask"),&PhysicsShapeQueryParameters::get_layer_mask); - ObjectTypeDB::bind_method(_MD("set_object_type_mask","object_type_mask"),&PhysicsShapeQueryParameters::set_object_type_mask); - ObjectTypeDB::bind_method(_MD("get_object_type_mask"),&PhysicsShapeQueryParameters::get_object_type_mask); + ClassDB::bind_method(_MD("set_object_type_mask","object_type_mask"),&PhysicsShapeQueryParameters::set_object_type_mask); + ClassDB::bind_method(_MD("get_object_type_mask"),&PhysicsShapeQueryParameters::get_object_type_mask); - ObjectTypeDB::bind_method(_MD("set_exclude","exclude"),&PhysicsShapeQueryParameters::set_exclude); - ObjectTypeDB::bind_method(_MD("get_exclude"),&PhysicsShapeQueryParameters::get_exclude); + ClassDB::bind_method(_MD("set_exclude","exclude"),&PhysicsShapeQueryParameters::set_exclude); + ClassDB::bind_method(_MD("get_exclude"),&PhysicsShapeQueryParameters::get_exclude); } @@ -359,14 +363,14 @@ PhysicsDirectSpaceState::PhysicsDirectSpaceState() { void PhysicsDirectSpaceState::_bind_methods() { -// ObjectTypeDB::bind_method(_MD("intersect_ray","from","to","exclude","umask"),&PhysicsDirectSpaceState::_intersect_ray,DEFVAL(Array()),DEFVAL(0)); -// ObjectTypeDB::bind_method(_MD("intersect_shape:PhysicsShapeQueryResult","shape","xform","result_max","exclude","umask"),&PhysicsDirectSpaceState::_intersect_shape,DEFVAL(Array()),DEFVAL(0)); +// ClassDB::bind_method(_MD("intersect_ray","from","to","exclude","umask"),&PhysicsDirectSpaceState::_intersect_ray,DEFVAL(Array()),DEFVAL(0)); +// ClassDB::bind_method(_MD("intersect_shape:PhysicsShapeQueryResult","shape","xform","result_max","exclude","umask"),&PhysicsDirectSpaceState::_intersect_shape,DEFVAL(Array()),DEFVAL(0)); - ObjectTypeDB::bind_method(_MD("intersect_ray:Dictionary","from","to","exclude","layer_mask","type_mask"),&PhysicsDirectSpaceState::_intersect_ray,DEFVAL(Array()),DEFVAL(0x7FFFFFFF),DEFVAL(TYPE_MASK_COLLISION)); - ObjectTypeDB::bind_method(_MD("intersect_shape","shape:PhysicsShapeQueryParameters","max_results"),&PhysicsDirectSpaceState::_intersect_shape,DEFVAL(32)); - ObjectTypeDB::bind_method(_MD("cast_motion","shape:PhysicsShapeQueryParameters","motion"),&PhysicsDirectSpaceState::_cast_motion); - ObjectTypeDB::bind_method(_MD("collide_shape","shape:PhysicsShapeQueryParameters","max_results"),&PhysicsDirectSpaceState::_collide_shape,DEFVAL(32)); - ObjectTypeDB::bind_method(_MD("get_rest_info","shape:PhysicsShapeQueryParameters"),&PhysicsDirectSpaceState::_get_rest_info); + ClassDB::bind_method(_MD("intersect_ray:Dictionary","from","to","exclude","layer_mask","type_mask"),&PhysicsDirectSpaceState::_intersect_ray,DEFVAL(Array()),DEFVAL(0x7FFFFFFF),DEFVAL(TYPE_MASK_COLLISION)); + ClassDB::bind_method(_MD("intersect_shape","shape:PhysicsShapeQueryParameters","max_results"),&PhysicsDirectSpaceState::_intersect_shape,DEFVAL(32)); + ClassDB::bind_method(_MD("cast_motion","shape:PhysicsShapeQueryParameters","motion"),&PhysicsDirectSpaceState::_cast_motion); + ClassDB::bind_method(_MD("collide_shape","shape:PhysicsShapeQueryParameters","max_results"),&PhysicsDirectSpaceState::_collide_shape,DEFVAL(32)); + ClassDB::bind_method(_MD("get_rest_info","shape:PhysicsShapeQueryParameters"),&PhysicsDirectSpaceState::_get_rest_info); BIND_CONSTANT( TYPE_MASK_STATIC_BODY ); @@ -407,11 +411,11 @@ PhysicsShapeQueryResult::PhysicsShapeQueryResult() { void PhysicsShapeQueryResult::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_result_count"),&PhysicsShapeQueryResult::get_result_count); - ObjectTypeDB::bind_method(_MD("get_result_rid","idx"),&PhysicsShapeQueryResult::get_result_rid); - ObjectTypeDB::bind_method(_MD("get_result_object_id","idx"),&PhysicsShapeQueryResult::get_result_object_id); - ObjectTypeDB::bind_method(_MD("get_result_object","idx"),&PhysicsShapeQueryResult::get_result_object); - ObjectTypeDB::bind_method(_MD("get_result_object_shape","idx"),&PhysicsShapeQueryResult::get_result_object_shape); + ClassDB::bind_method(_MD("get_result_count"),&PhysicsShapeQueryResult::get_result_count); + ClassDB::bind_method(_MD("get_result_rid","idx"),&PhysicsShapeQueryResult::get_result_rid); + ClassDB::bind_method(_MD("get_result_object_id","idx"),&PhysicsShapeQueryResult::get_result_object_id); + ClassDB::bind_method(_MD("get_result_object","idx"),&PhysicsShapeQueryResult::get_result_object); + ClassDB::bind_method(_MD("get_result_object_shape","idx"),&PhysicsShapeQueryResult::get_result_object_shape); } @@ -425,117 +429,118 @@ void PhysicsShapeQueryResult::_bind_methods() { void PhysicsServer::_bind_methods() { - ObjectTypeDB::bind_method(_MD("shape_create","type"),&PhysicsServer::shape_create); - ObjectTypeDB::bind_method(_MD("shape_set_data","shape","data"),&PhysicsServer::shape_set_data); + ClassDB::bind_method(_MD("shape_create","type"),&PhysicsServer::shape_create); + ClassDB::bind_method(_MD("shape_set_data","shape","data"),&PhysicsServer::shape_set_data); - ObjectTypeDB::bind_method(_MD("shape_get_type","shape"),&PhysicsServer::shape_get_type); - ObjectTypeDB::bind_method(_MD("shape_get_data","shape"),&PhysicsServer::shape_get_data); + ClassDB::bind_method(_MD("shape_get_type","shape"),&PhysicsServer::shape_get_type); + ClassDB::bind_method(_MD("shape_get_data","shape"),&PhysicsServer::shape_get_data); - ObjectTypeDB::bind_method(_MD("space_create"),&PhysicsServer::space_create); - ObjectTypeDB::bind_method(_MD("space_set_active","space","active"),&PhysicsServer::space_set_active); - ObjectTypeDB::bind_method(_MD("space_is_active","space"),&PhysicsServer::space_is_active); - ObjectTypeDB::bind_method(_MD("space_set_param","space","param","value"),&PhysicsServer::space_set_param); - ObjectTypeDB::bind_method(_MD("space_get_param","space","param"),&PhysicsServer::space_get_param); - ObjectTypeDB::bind_method(_MD("space_get_direct_state:PhysicsDirectSpaceState","space"),&PhysicsServer::space_get_direct_state); + ClassDB::bind_method(_MD("space_create"),&PhysicsServer::space_create); + ClassDB::bind_method(_MD("space_set_active","space","active"),&PhysicsServer::space_set_active); + ClassDB::bind_method(_MD("space_is_active","space"),&PhysicsServer::space_is_active); + ClassDB::bind_method(_MD("space_set_param","space","param","value"),&PhysicsServer::space_set_param); + ClassDB::bind_method(_MD("space_get_param","space","param"),&PhysicsServer::space_get_param); + ClassDB::bind_method(_MD("space_get_direct_state:PhysicsDirectSpaceState","space"),&PhysicsServer::space_get_direct_state); - ObjectTypeDB::bind_method(_MD("area_create"),&PhysicsServer::area_create); - ObjectTypeDB::bind_method(_MD("area_set_space","area","space"),&PhysicsServer::area_set_space); - ObjectTypeDB::bind_method(_MD("area_get_space","area"),&PhysicsServer::area_get_space); + ClassDB::bind_method(_MD("area_create"),&PhysicsServer::area_create); + ClassDB::bind_method(_MD("area_set_space","area","space"),&PhysicsServer::area_set_space); + ClassDB::bind_method(_MD("area_get_space","area"),&PhysicsServer::area_get_space); - ObjectTypeDB::bind_method(_MD("area_set_space_override_mode","area","mode"),&PhysicsServer::area_set_space_override_mode); - ObjectTypeDB::bind_method(_MD("area_get_space_override_mode","area"),&PhysicsServer::area_get_space_override_mode); + ClassDB::bind_method(_MD("area_set_space_override_mode","area","mode"),&PhysicsServer::area_set_space_override_mode); + ClassDB::bind_method(_MD("area_get_space_override_mode","area"),&PhysicsServer::area_get_space_override_mode); - ObjectTypeDB::bind_method(_MD("area_add_shape","area","shape","transform"),&PhysicsServer::area_add_shape,DEFVAL(Transform())); - ObjectTypeDB::bind_method(_MD("area_set_shape","area","shape_idx","shape"),&PhysicsServer::area_set_shape); - ObjectTypeDB::bind_method(_MD("area_set_shape_transform","area","shape_idx","transform"),&PhysicsServer::area_set_shape_transform); + ClassDB::bind_method(_MD("area_add_shape","area","shape","transform"),&PhysicsServer::area_add_shape,DEFVAL(Transform())); + ClassDB::bind_method(_MD("area_set_shape","area","shape_idx","shape"),&PhysicsServer::area_set_shape); + ClassDB::bind_method(_MD("area_set_shape_transform","area","shape_idx","transform"),&PhysicsServer::area_set_shape_transform); - ObjectTypeDB::bind_method(_MD("area_get_shape_count","area"),&PhysicsServer::area_get_shape_count); - ObjectTypeDB::bind_method(_MD("area_get_shape","area","shape_idx"),&PhysicsServer::area_get_shape); - ObjectTypeDB::bind_method(_MD("area_get_shape_transform","area","shape_idx"),&PhysicsServer::area_get_shape_transform); + ClassDB::bind_method(_MD("area_get_shape_count","area"),&PhysicsServer::area_get_shape_count); + ClassDB::bind_method(_MD("area_get_shape","area","shape_idx"),&PhysicsServer::area_get_shape); + ClassDB::bind_method(_MD("area_get_shape_transform","area","shape_idx"),&PhysicsServer::area_get_shape_transform); - ObjectTypeDB::bind_method(_MD("area_remove_shape","area","shape_idx"),&PhysicsServer::area_remove_shape); - ObjectTypeDB::bind_method(_MD("area_clear_shapes","area"),&PhysicsServer::area_clear_shapes); + ClassDB::bind_method(_MD("area_remove_shape","area","shape_idx"),&PhysicsServer::area_remove_shape); + ClassDB::bind_method(_MD("area_clear_shapes","area"),&PhysicsServer::area_clear_shapes); - ObjectTypeDB::bind_method(_MD("area_set_layer_mask","area","mask"),&PhysicsServer::area_set_layer_mask); - ObjectTypeDB::bind_method(_MD("area_set_collision_mask","area","mask"),&PhysicsServer::area_set_collision_mask); + ClassDB::bind_method(_MD("area_set_layer_mask","area","mask"),&PhysicsServer::area_set_layer_mask); + ClassDB::bind_method(_MD("area_set_collision_mask","area","mask"),&PhysicsServer::area_set_collision_mask); - ObjectTypeDB::bind_method(_MD("area_set_param","area","param","value"),&PhysicsServer::area_set_param); - ObjectTypeDB::bind_method(_MD("area_set_transform","area","transform"),&PhysicsServer::area_set_transform); + ClassDB::bind_method(_MD("area_set_param","area","param","value"),&PhysicsServer::area_set_param); + ClassDB::bind_method(_MD("area_set_transform","area","transform"),&PhysicsServer::area_set_transform); - ObjectTypeDB::bind_method(_MD("area_get_param","area","param"),&PhysicsServer::area_get_param); - ObjectTypeDB::bind_method(_MD("area_get_transform","area"),&PhysicsServer::area_get_transform); + ClassDB::bind_method(_MD("area_get_param","area","param"),&PhysicsServer::area_get_param); + ClassDB::bind_method(_MD("area_get_transform","area"),&PhysicsServer::area_get_transform); - ObjectTypeDB::bind_method(_MD("area_attach_object_instance_ID","area","id"),&PhysicsServer::area_attach_object_instance_ID); - ObjectTypeDB::bind_method(_MD("area_get_object_instance_ID","area"),&PhysicsServer::area_get_object_instance_ID); + ClassDB::bind_method(_MD("area_attach_object_instance_ID","area","id"),&PhysicsServer::area_attach_object_instance_ID); + ClassDB::bind_method(_MD("area_get_object_instance_ID","area"),&PhysicsServer::area_get_object_instance_ID); - ObjectTypeDB::bind_method(_MD("area_set_monitor_callback","area","receiver","method"),&PhysicsServer::area_set_monitor_callback); + ClassDB::bind_method(_MD("area_set_monitor_callback","area","receiver","method"),&PhysicsServer::area_set_monitor_callback); - ObjectTypeDB::bind_method(_MD("area_set_ray_pickable","area","enable"),&PhysicsServer::area_set_ray_pickable); - ObjectTypeDB::bind_method(_MD("area_is_ray_pickable","area"),&PhysicsServer::area_is_ray_pickable); + ClassDB::bind_method(_MD("area_set_ray_pickable","area","enable"),&PhysicsServer::area_set_ray_pickable); + ClassDB::bind_method(_MD("area_is_ray_pickable","area"),&PhysicsServer::area_is_ray_pickable); - ObjectTypeDB::bind_method(_MD("body_create","mode","init_sleeping"),&PhysicsServer::body_create,DEFVAL(BODY_MODE_RIGID),DEFVAL(false)); + ClassDB::bind_method(_MD("body_create","mode","init_sleeping"),&PhysicsServer::body_create,DEFVAL(BODY_MODE_RIGID),DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("body_set_space","body","space"),&PhysicsServer::body_set_space); - ObjectTypeDB::bind_method(_MD("body_get_space","body"),&PhysicsServer::body_get_space); + ClassDB::bind_method(_MD("body_set_space","body","space"),&PhysicsServer::body_set_space); + ClassDB::bind_method(_MD("body_get_space","body"),&PhysicsServer::body_get_space); - ObjectTypeDB::bind_method(_MD("body_set_mode","body","mode"),&PhysicsServer::body_set_mode); - ObjectTypeDB::bind_method(_MD("body_get_mode","body"),&PhysicsServer::body_get_mode); + ClassDB::bind_method(_MD("body_set_mode","body","mode"),&PhysicsServer::body_set_mode); + ClassDB::bind_method(_MD("body_get_mode","body"),&PhysicsServer::body_get_mode); - ObjectTypeDB::bind_method(_MD("body_set_layer_mask","body","mask"),&PhysicsServer::body_set_layer_mask); - ObjectTypeDB::bind_method(_MD("body_get_layer_mask","body"),&PhysicsServer::body_get_layer_mask); + ClassDB::bind_method(_MD("body_set_layer_mask","body","mask"),&PhysicsServer::body_set_layer_mask); + ClassDB::bind_method(_MD("body_get_layer_mask","body"),&PhysicsServer::body_get_layer_mask); - ObjectTypeDB::bind_method(_MD("body_set_collision_mask","body","mask"),&PhysicsServer::body_set_collision_mask); - ObjectTypeDB::bind_method(_MD("body_get_collision_mask","body"),&PhysicsServer::body_get_collision_mask); + ClassDB::bind_method(_MD("body_set_collision_mask","body","mask"),&PhysicsServer::body_set_collision_mask); + ClassDB::bind_method(_MD("body_get_collision_mask","body"),&PhysicsServer::body_get_collision_mask); - ObjectTypeDB::bind_method(_MD("body_add_shape","body","shape","transform"),&PhysicsServer::body_add_shape,DEFVAL(Transform())); - ObjectTypeDB::bind_method(_MD("body_set_shape","body","shape_idx","shape"),&PhysicsServer::body_set_shape); - ObjectTypeDB::bind_method(_MD("body_set_shape_transform","body","shape_idx","transform"),&PhysicsServer::body_set_shape_transform); + ClassDB::bind_method(_MD("body_add_shape","body","shape","transform"),&PhysicsServer::body_add_shape,DEFVAL(Transform())); + ClassDB::bind_method(_MD("body_set_shape","body","shape_idx","shape"),&PhysicsServer::body_set_shape); + ClassDB::bind_method(_MD("body_set_shape_transform","body","shape_idx","transform"),&PhysicsServer::body_set_shape_transform); - ObjectTypeDB::bind_method(_MD("body_get_shape_count","body"),&PhysicsServer::body_get_shape_count); - ObjectTypeDB::bind_method(_MD("body_get_shape","body","shape_idx"),&PhysicsServer::body_get_shape); - ObjectTypeDB::bind_method(_MD("body_get_shape_transform","body","shape_idx"),&PhysicsServer::body_get_shape_transform); + ClassDB::bind_method(_MD("body_get_shape_count","body"),&PhysicsServer::body_get_shape_count); + ClassDB::bind_method(_MD("body_get_shape","body","shape_idx"),&PhysicsServer::body_get_shape); + ClassDB::bind_method(_MD("body_get_shape_transform","body","shape_idx"),&PhysicsServer::body_get_shape_transform); - ObjectTypeDB::bind_method(_MD("body_remove_shape","body","shape_idx"),&PhysicsServer::body_remove_shape); - ObjectTypeDB::bind_method(_MD("body_clear_shapes","body"),&PhysicsServer::body_clear_shapes); + ClassDB::bind_method(_MD("body_remove_shape","body","shape_idx"),&PhysicsServer::body_remove_shape); + ClassDB::bind_method(_MD("body_clear_shapes","body"),&PhysicsServer::body_clear_shapes); - ObjectTypeDB::bind_method(_MD("body_attach_object_instance_ID","body","id"),&PhysicsServer::body_attach_object_instance_ID); - ObjectTypeDB::bind_method(_MD("body_get_object_instance_ID","body"),&PhysicsServer::body_get_object_instance_ID); + ClassDB::bind_method(_MD("body_attach_object_instance_ID","body","id"),&PhysicsServer::body_attach_object_instance_ID); + ClassDB::bind_method(_MD("body_get_object_instance_ID","body"),&PhysicsServer::body_get_object_instance_ID); - ObjectTypeDB::bind_method(_MD("body_set_enable_continuous_collision_detection","body","enable"),&PhysicsServer::body_set_enable_continuous_collision_detection); - ObjectTypeDB::bind_method(_MD("body_is_continuous_collision_detection_enabled","body"),&PhysicsServer::body_is_continuous_collision_detection_enabled); + ClassDB::bind_method(_MD("body_set_enable_continuous_collision_detection","body","enable"),&PhysicsServer::body_set_enable_continuous_collision_detection); + ClassDB::bind_method(_MD("body_is_continuous_collision_detection_enabled","body"),&PhysicsServer::body_is_continuous_collision_detection_enabled); - //ObjectTypeDB::bind_method(_MD("body_set_user_flags","flags""),&PhysicsServer::body_set_shape,DEFVAL(Transform)); - //ObjectTypeDB::bind_method(_MD("body_get_user_flags","body","shape_idx","shape"),&PhysicsServer::body_get_shape); + //ClassDB::bind_method(_MD("body_set_user_flags","flags""),&PhysicsServer::body_set_shape,DEFVAL(Transform)); + //ClassDB::bind_method(_MD("body_get_user_flags","body","shape_idx","shape"),&PhysicsServer::body_get_shape); - ObjectTypeDB::bind_method(_MD("body_set_param","body","param","value"),&PhysicsServer::body_set_param); - ObjectTypeDB::bind_method(_MD("body_get_param","body","param"),&PhysicsServer::body_get_param); + ClassDB::bind_method(_MD("body_set_param","body","param","value"),&PhysicsServer::body_set_param); + ClassDB::bind_method(_MD("body_get_param","body","param"),&PhysicsServer::body_get_param); - ObjectTypeDB::bind_method(_MD("body_set_state","body","state","value"),&PhysicsServer::body_set_state); - ObjectTypeDB::bind_method(_MD("body_get_state","body","state"),&PhysicsServer::body_get_state); + ClassDB::bind_method(_MD("body_set_state","body","state","value"),&PhysicsServer::body_set_state); + ClassDB::bind_method(_MD("body_get_state","body","state"),&PhysicsServer::body_get_state); - ObjectTypeDB::bind_method(_MD("body_apply_impulse","body","pos","impulse"),&PhysicsServer::body_apply_impulse); - ObjectTypeDB::bind_method(_MD("body_set_axis_velocity","body","axis_velocity"),&PhysicsServer::body_set_axis_velocity); + ClassDB::bind_method(_MD("body_apply_impulse","body","pos","impulse"),&PhysicsServer::body_apply_impulse); + ClassDB::bind_method(_MD("body_apply_torque_impulse","body","impulse"),&PhysicsServer::body_apply_torque_impulse); + ClassDB::bind_method(_MD("body_set_axis_velocity","body","axis_velocity"),&PhysicsServer::body_set_axis_velocity); - ObjectTypeDB::bind_method(_MD("body_set_axis_lock","body","axis"),&PhysicsServer::body_set_axis_lock); - ObjectTypeDB::bind_method(_MD("body_get_axis_lock","body"),&PhysicsServer::body_get_axis_lock); + ClassDB::bind_method(_MD("body_set_axis_lock","body","axis"),&PhysicsServer::body_set_axis_lock); + ClassDB::bind_method(_MD("body_get_axis_lock","body"),&PhysicsServer::body_get_axis_lock); - ObjectTypeDB::bind_method(_MD("body_add_collision_exception","body","excepted_body"),&PhysicsServer::body_add_collision_exception); - ObjectTypeDB::bind_method(_MD("body_remove_collision_exception","body","excepted_body"),&PhysicsServer::body_remove_collision_exception); + ClassDB::bind_method(_MD("body_add_collision_exception","body","excepted_body"),&PhysicsServer::body_add_collision_exception); + ClassDB::bind_method(_MD("body_remove_collision_exception","body","excepted_body"),&PhysicsServer::body_remove_collision_exception); // virtual void body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions)=0; - ObjectTypeDB::bind_method(_MD("body_set_max_contacts_reported","body","amount"),&PhysicsServer::body_set_max_contacts_reported); - ObjectTypeDB::bind_method(_MD("body_get_max_contacts_reported","body"),&PhysicsServer::body_get_max_contacts_reported); + ClassDB::bind_method(_MD("body_set_max_contacts_reported","body","amount"),&PhysicsServer::body_set_max_contacts_reported); + ClassDB::bind_method(_MD("body_get_max_contacts_reported","body"),&PhysicsServer::body_get_max_contacts_reported); - ObjectTypeDB::bind_method(_MD("body_set_omit_force_integration","body","enable"),&PhysicsServer::body_set_omit_force_integration); - ObjectTypeDB::bind_method(_MD("body_is_omitting_force_integration","body"),&PhysicsServer::body_is_omitting_force_integration); + ClassDB::bind_method(_MD("body_set_omit_force_integration","body","enable"),&PhysicsServer::body_set_omit_force_integration); + ClassDB::bind_method(_MD("body_is_omitting_force_integration","body"),&PhysicsServer::body_is_omitting_force_integration); - ObjectTypeDB::bind_method(_MD("body_set_force_integration_callback","body","receiver","method","userdata"),&PhysicsServer::body_set_force_integration_callback,DEFVAL(Variant())); + ClassDB::bind_method(_MD("body_set_force_integration_callback","body","receiver","method","userdata"),&PhysicsServer::body_set_force_integration_callback,DEFVAL(Variant())); - ObjectTypeDB::bind_method(_MD("body_set_ray_pickable","body","enable"),&PhysicsServer::body_set_ray_pickable); - ObjectTypeDB::bind_method(_MD("body_is_ray_pickable","body"),&PhysicsServer::body_is_ray_pickable); + ClassDB::bind_method(_MD("body_set_ray_pickable","body","enable"),&PhysicsServer::body_set_ray_pickable); + ClassDB::bind_method(_MD("body_is_ray_pickable","body"),&PhysicsServer::body_is_ray_pickable); /* JOINT API */ @@ -545,15 +550,15 @@ void PhysicsServer::_bind_methods() { BIND_CONSTANT( JOINT_CONE_TWIST ); BIND_CONSTANT( JOINT_6DOF ); - ObjectTypeDB::bind_method(_MD("joint_create_pin","body_A","local_A","body_B","local_B"),&PhysicsServer::joint_create_pin); - ObjectTypeDB::bind_method(_MD("pin_joint_set_param","joint","param","value"),&PhysicsServer::pin_joint_set_param); - ObjectTypeDB::bind_method(_MD("pin_joint_get_param","joint","param"),&PhysicsServer::pin_joint_get_param); + ClassDB::bind_method(_MD("joint_create_pin","body_A","local_A","body_B","local_B"),&PhysicsServer::joint_create_pin); + ClassDB::bind_method(_MD("pin_joint_set_param","joint","param","value"),&PhysicsServer::pin_joint_set_param); + ClassDB::bind_method(_MD("pin_joint_get_param","joint","param"),&PhysicsServer::pin_joint_get_param); - ObjectTypeDB::bind_method(_MD("pin_joint_set_local_A","joint","local_A"),&PhysicsServer::pin_joint_set_local_A); - ObjectTypeDB::bind_method(_MD("pin_joint_get_local_A","joint"),&PhysicsServer::pin_joint_get_local_A); + ClassDB::bind_method(_MD("pin_joint_set_local_A","joint","local_A"),&PhysicsServer::pin_joint_set_local_A); + ClassDB::bind_method(_MD("pin_joint_get_local_A","joint"),&PhysicsServer::pin_joint_get_local_A); - ObjectTypeDB::bind_method(_MD("pin_joint_set_local_B","joint","local_B"),&PhysicsServer::pin_joint_set_local_B); - ObjectTypeDB::bind_method(_MD("pin_joint_get_local_B","joint"),&PhysicsServer::pin_joint_get_local_B); + ClassDB::bind_method(_MD("pin_joint_set_local_B","joint","local_B"),&PhysicsServer::pin_joint_set_local_B); + ClassDB::bind_method(_MD("pin_joint_get_local_B","joint"),&PhysicsServer::pin_joint_get_local_B); BIND_CONSTANT(PIN_JOINT_BIAS ); BIND_CONSTANT(PIN_JOINT_DAMPING ); @@ -571,18 +576,18 @@ void PhysicsServer::_bind_methods() { BIND_CONSTANT(HINGE_JOINT_FLAG_USE_LIMIT); BIND_CONSTANT(HINGE_JOINT_FLAG_ENABLE_MOTOR); - ObjectTypeDB::bind_method(_MD("joint_create_hinge","body_A","hinge_A","body_B","hinge_B"),&PhysicsServer::joint_create_hinge); + ClassDB::bind_method(_MD("joint_create_hinge","body_A","hinge_A","body_B","hinge_B"),&PhysicsServer::joint_create_hinge); - ObjectTypeDB::bind_method(_MD("hinge_joint_set_param","joint","param","value"),&PhysicsServer::hinge_joint_set_param); - ObjectTypeDB::bind_method(_MD("hinge_joint_get_param","joint","param"),&PhysicsServer::hinge_joint_get_param); + ClassDB::bind_method(_MD("hinge_joint_set_param","joint","param","value"),&PhysicsServer::hinge_joint_set_param); + ClassDB::bind_method(_MD("hinge_joint_get_param","joint","param"),&PhysicsServer::hinge_joint_get_param); - ObjectTypeDB::bind_method(_MD("hinge_joint_set_flag","joint","flag","enabled"),&PhysicsServer::hinge_joint_set_flag); - ObjectTypeDB::bind_method(_MD("hinge_joint_get_flag","joint","flag"),&PhysicsServer::hinge_joint_get_flag); + ClassDB::bind_method(_MD("hinge_joint_set_flag","joint","flag","enabled"),&PhysicsServer::hinge_joint_set_flag); + ClassDB::bind_method(_MD("hinge_joint_get_flag","joint","flag"),&PhysicsServer::hinge_joint_get_flag); - ObjectTypeDB::bind_method(_MD("joint_create_slider","body_A","local_ref_A","body_B","local_ref_B"),&PhysicsServer::joint_create_slider); + ClassDB::bind_method(_MD("joint_create_slider","body_A","local_ref_A","body_B","local_ref_B"),&PhysicsServer::joint_create_slider); - ObjectTypeDB::bind_method(_MD("slider_joint_set_param","joint","param","value"),&PhysicsServer::slider_joint_set_param); - ObjectTypeDB::bind_method(_MD("slider_joint_get_param","joint","param"),&PhysicsServer::slider_joint_get_param); + ClassDB::bind_method(_MD("slider_joint_set_param","joint","param","value"),&PhysicsServer::slider_joint_set_param); + ClassDB::bind_method(_MD("slider_joint_get_param","joint","param"),&PhysicsServer::slider_joint_get_param); BIND_CONSTANT( SLIDER_JOINT_LINEAR_LIMIT_UPPER ); BIND_CONSTANT( SLIDER_JOINT_LINEAR_LIMIT_LOWER ); @@ -610,10 +615,10 @@ void PhysicsServer::_bind_methods() { BIND_CONSTANT( SLIDER_JOINT_MAX ); - ObjectTypeDB::bind_method(_MD("joint_create_cone_twist","body_A","local_ref_A","body_B","local_ref_B"),&PhysicsServer::joint_create_cone_twist); + ClassDB::bind_method(_MD("joint_create_cone_twist","body_A","local_ref_A","body_B","local_ref_B"),&PhysicsServer::joint_create_cone_twist); - ObjectTypeDB::bind_method(_MD("cone_twist_joint_set_param","joint","param","value"),&PhysicsServer::cone_twist_joint_set_param); - ObjectTypeDB::bind_method(_MD("cone_twist_joint_get_param","joint","param"),&PhysicsServer::cone_twist_joint_get_param); + ClassDB::bind_method(_MD("cone_twist_joint_set_param","joint","param","value"),&PhysicsServer::cone_twist_joint_set_param); + ClassDB::bind_method(_MD("cone_twist_joint_get_param","joint","param"),&PhysicsServer::cone_twist_joint_get_param); BIND_CONSTANT( CONE_TWIST_JOINT_SWING_SPAN ); BIND_CONSTANT( CONE_TWIST_JOINT_TWIST_SPAN ); @@ -642,44 +647,44 @@ void PhysicsServer::_bind_methods() { BIND_CONSTANT( G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT ); BIND_CONSTANT( G6DOF_JOINT_FLAG_ENABLE_MOTOR ); - ObjectTypeDB::bind_method(_MD("joint_get_type","joint"),&PhysicsServer::joint_get_type); + ClassDB::bind_method(_MD("joint_get_type","joint"),&PhysicsServer::joint_get_type); - ObjectTypeDB::bind_method(_MD("joint_set_solver_priority","joint","priority"),&PhysicsServer::joint_set_solver_priority); - ObjectTypeDB::bind_method(_MD("joint_get_solver_priority","joint"),&PhysicsServer::joint_get_solver_priority); + ClassDB::bind_method(_MD("joint_set_solver_priority","joint","priority"),&PhysicsServer::joint_set_solver_priority); + ClassDB::bind_method(_MD("joint_get_solver_priority","joint"),&PhysicsServer::joint_get_solver_priority); - ObjectTypeDB::bind_method(_MD("joint_create_generic_6dof","body_A","local_ref_A","body_B","local_ref_B"),&PhysicsServer::joint_create_generic_6dof); + ClassDB::bind_method(_MD("joint_create_generic_6dof","body_A","local_ref_A","body_B","local_ref_B"),&PhysicsServer::joint_create_generic_6dof); - ObjectTypeDB::bind_method(_MD("generic_6dof_joint_set_param","joint","axis","param","value"),&PhysicsServer::generic_6dof_joint_set_param); - ObjectTypeDB::bind_method(_MD("generic_6dof_joint_get_param","joint","axis","param"),&PhysicsServer::generic_6dof_joint_get_param); + ClassDB::bind_method(_MD("generic_6dof_joint_set_param","joint","axis","param","value"),&PhysicsServer::generic_6dof_joint_set_param); + ClassDB::bind_method(_MD("generic_6dof_joint_get_param","joint","axis","param"),&PhysicsServer::generic_6dof_joint_get_param); - ObjectTypeDB::bind_method(_MD("generic_6dof_joint_set_flag","joint","axis","flag","enable"),&PhysicsServer::generic_6dof_joint_set_flag); - ObjectTypeDB::bind_method(_MD("generic_6dof_joint_get_flag","joint","axis","flag"),&PhysicsServer::generic_6dof_joint_get_flag); + ClassDB::bind_method(_MD("generic_6dof_joint_set_flag","joint","axis","flag","enable"),&PhysicsServer::generic_6dof_joint_set_flag); + ClassDB::bind_method(_MD("generic_6dof_joint_get_flag","joint","axis","flag"),&PhysicsServer::generic_6dof_joint_get_flag); /* - ObjectTypeDB::bind_method(_MD("joint_set_param","joint","param","value"),&PhysicsServer::joint_set_param); - ObjectTypeDB::bind_method(_MD("joint_get_param","joint","param"),&PhysicsServer::joint_get_param); + ClassDB::bind_method(_MD("joint_set_param","joint","param","value"),&PhysicsServer::joint_set_param); + ClassDB::bind_method(_MD("joint_get_param","joint","param"),&PhysicsServer::joint_get_param); - ObjectTypeDB::bind_method(_MD("pin_joint_create","anchor","body_a","body_b"),&PhysicsServer::pin_joint_create,DEFVAL(RID())); - ObjectTypeDB::bind_method(_MD("groove_joint_create","groove1_a","groove2_a","anchor_b","body_a","body_b"),&PhysicsServer::groove_joint_create,DEFVAL(RID()),DEFVAL(RID())); - ObjectTypeDB::bind_method(_MD("damped_spring_joint_create","anchor_a","anchor_b","body_a","body_b"),&PhysicsServer::damped_spring_joint_create,DEFVAL(RID())); + ClassDB::bind_method(_MD("pin_joint_create","anchor","body_a","body_b"),&PhysicsServer::pin_joint_create,DEFVAL(RID())); + ClassDB::bind_method(_MD("groove_joint_create","groove1_a","groove2_a","anchor_b","body_a","body_b"),&PhysicsServer::groove_joint_create,DEFVAL(RID()),DEFVAL(RID())); + ClassDB::bind_method(_MD("damped_spring_joint_create","anchor_a","anchor_b","body_a","body_b"),&PhysicsServer::damped_spring_joint_create,DEFVAL(RID())); - ObjectTypeDB::bind_method(_MD("damped_string_joint_set_param","joint","param","value"),&PhysicsServer::damped_string_joint_set_param,DEFVAL(RID())); - ObjectTypeDB::bind_method(_MD("damped_string_joint_get_param","joint","param"),&PhysicsServer::damped_string_joint_get_param); + ClassDB::bind_method(_MD("damped_string_joint_set_param","joint","param","value"),&PhysicsServer::damped_string_joint_set_param,DEFVAL(RID())); + ClassDB::bind_method(_MD("damped_string_joint_get_param","joint","param"),&PhysicsServer::damped_string_joint_get_param); - ObjectTypeDB::bind_method(_MD("joint_get_type","joint"),&PhysicsServer::joint_get_type); + ClassDB::bind_method(_MD("joint_get_type","joint"),&PhysicsServer::joint_get_type); */ - ObjectTypeDB::bind_method(_MD("free_rid","rid"),&PhysicsServer::free); + ClassDB::bind_method(_MD("free_rid","rid"),&PhysicsServer::free); - ObjectTypeDB::bind_method(_MD("set_active","active"),&PhysicsServer::set_active); + ClassDB::bind_method(_MD("set_active","active"),&PhysicsServer::set_active); -// ObjectTypeDB::bind_method(_MD("init"),&PhysicsServer::init); -// ObjectTypeDB::bind_method(_MD("step"),&PhysicsServer::step); -// ObjectTypeDB::bind_method(_MD("sync"),&PhysicsServer::sync); - //ObjectTypeDB::bind_method(_MD("flush_queries"),&PhysicsServer::flush_queries); +// ClassDB::bind_method(_MD("init"),&PhysicsServer::init); +// ClassDB::bind_method(_MD("step"),&PhysicsServer::step); +// ClassDB::bind_method(_MD("sync"),&PhysicsServer::sync); + //ClassDB::bind_method(_MD("flush_queries"),&PhysicsServer::flush_queries); - ObjectTypeDB::bind_method(_MD("get_process_info","process_info"),&PhysicsServer::get_process_info); + ClassDB::bind_method(_MD("get_process_info","process_info"),&PhysicsServer::get_process_info); BIND_CONSTANT( SHAPE_PLANE ); BIND_CONSTANT( SHAPE_RAY ); diff --git a/servers/physics_server.h b/servers/physics_server.h index 5221b38ccb..d57ca93d92 100644 --- a/servers/physics_server.h +++ b/servers/physics_server.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ class PhysicsDirectSpaceState; class PhysicsDirectBodyState : public Object { - OBJ_TYPE( PhysicsDirectBodyState, Object ); + GDCLASS( PhysicsDirectBodyState, Object ); protected: static void _bind_methods(); public: @@ -45,9 +45,11 @@ public: virtual float get_total_angular_damp() const=0; virtual float get_total_linear_damp() const=0; + virtual Vector3 get_center_of_mass() const=0; + virtual Basis get_principal_inertia_axes() const=0; virtual float get_inverse_mass() const=0; // get the mass virtual Vector3 get_inverse_inertia() const=0; // get density of this body space - virtual Matrix3 get_inverse_inertia_tensor() const=0; // get density of this body space + virtual Basis get_inverse_inertia_tensor() const=0; // get density of this body space virtual void set_linear_velocity(const Vector3& p_velocity)=0; virtual Vector3 get_linear_velocity() const=0; @@ -60,6 +62,7 @@ public: virtual void add_force(const Vector3& p_force, const Vector3& p_pos)=0; virtual void apply_impulse(const Vector3& p_pos, const Vector3& p_j)=0; + virtual void apply_torque_impulse(const Vector3& p_j)=0; virtual void set_sleep_state(bool p_enable)=0; virtual bool is_sleeping() const=0; @@ -90,7 +93,7 @@ class PhysicsShapeQueryResult; class PhysicsShapeQueryParameters : public Reference { - OBJ_TYPE(PhysicsShapeQueryParameters, Reference); + GDCLASS(PhysicsShapeQueryParameters, Reference); friend class PhysicsDirectSpaceState; RID shape; Transform transform; @@ -130,7 +133,7 @@ public: class PhysicsDirectSpaceState : public Object { - OBJ_TYPE( PhysicsDirectSpaceState, Object ); + GDCLASS( PhysicsDirectSpaceState, Object ); // Variant _intersect_ray(const Vector3& p_from, const Vector3& p_to,const Vector<RID>& p_exclude=Vector<RID>(),uint32_t p_collision_mask=0); // Variant _intersect_shape(const RID& p_shape, const Transform& p_xform,int p_result_max=64,const Vector<RID>& p_exclude=Vector<RID>(),uint32_t p_collision_mask=0); @@ -207,7 +210,7 @@ public: class PhysicsShapeQueryResult : public Reference { - OBJ_TYPE( PhysicsShapeQueryResult, Reference ); + GDCLASS( PhysicsShapeQueryResult, Reference ); Vector<PhysicsDirectSpaceState::ShapeResult> result; @@ -229,7 +232,7 @@ public: class PhysicsServer : public Object { - OBJ_TYPE( PhysicsServer, Object ); + GDCLASS( PhysicsServer, Object ); static PhysicsServer * singleton; @@ -441,6 +444,7 @@ public: virtual Vector3 body_get_applied_torque(RID p_body) const=0; virtual void body_apply_impulse(RID p_body, const Vector3& p_pos, const Vector3& p_impulse)=0; + virtual void body_apply_torque_impulse(RID p_body, const Vector3& p_impulse)=0; virtual void body_set_axis_velocity(RID p_body, const Vector3& p_axis_velocity)=0; enum BodyAxisLock { diff --git a/servers/register_server_types.cpp b/servers/register_server_types.cpp index 06eaa4d122..87ccc5c6c3 100644 --- a/servers/register_server_types.cpp +++ b/servers/register_server_types.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ #include "spatial_sound_server.h" #include "spatial_sound_2d_server.h" #include "script_debugger_remote.h" - +#include "visual/shader_types.h" static void _debugger_get_resource_usage(List<ScriptDebuggerRemote::ResourceUsage>* r_usage) { List<VS::TextureInfo> tinfo; @@ -55,37 +55,43 @@ static void _debugger_get_resource_usage(List<ScriptDebuggerRemote::ResourceUsag } +ShaderTypes *shader_types=NULL; + void register_server_types() { - Globals::get_singleton()->add_singleton( Globals::Singleton("VisualServer",VisualServer::get_singleton()) ); - Globals::get_singleton()->add_singleton( Globals::Singleton("VS",VisualServer::get_singleton()) ); - Globals::get_singleton()->add_singleton( Globals::Singleton("AudioServer",AudioServer::get_singleton()) ); - Globals::get_singleton()->add_singleton( Globals::Singleton("AS",AudioServer::get_singleton()) ); - Globals::get_singleton()->add_singleton( Globals::Singleton("PhysicsServer",PhysicsServer::get_singleton()) ); - Globals::get_singleton()->add_singleton( Globals::Singleton("PS",PhysicsServer::get_singleton()) ); - Globals::get_singleton()->add_singleton( Globals::Singleton("Physics2DServer",Physics2DServer::get_singleton()) ); - Globals::get_singleton()->add_singleton( Globals::Singleton("PS2D",Physics2DServer::get_singleton()) ); - Globals::get_singleton()->add_singleton( Globals::Singleton("SpatialSoundServer",SpatialSoundServer::get_singleton()) ); - Globals::get_singleton()->add_singleton( Globals::Singleton("SS",SpatialSoundServer::get_singleton()) ); - Globals::get_singleton()->add_singleton( Globals::Singleton("SpatialSound2DServer",SpatialSound2DServer::get_singleton()) ); - Globals::get_singleton()->add_singleton( Globals::Singleton("SS2D",SpatialSound2DServer::get_singleton()) ); - - - ObjectTypeDB::register_virtual_type<Physics2DDirectBodyState>(); - ObjectTypeDB::register_virtual_type<Physics2DDirectSpaceState>(); - ObjectTypeDB::register_virtual_type<Physics2DShapeQueryResult>(); - ObjectTypeDB::register_type<Physics2DTestMotionResult>(); - ObjectTypeDB::register_type<Physics2DShapeQueryParameters>(); - - ObjectTypeDB::register_type<PhysicsShapeQueryParameters>(); - ObjectTypeDB::register_virtual_type<PhysicsDirectBodyState>(); - ObjectTypeDB::register_virtual_type<PhysicsDirectSpaceState>(); - ObjectTypeDB::register_virtual_type<PhysicsShapeQueryResult>(); + GLOBAL_DEF("memory/multithread/thread_rid_pool_prealloc",20); + + GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("VisualServer",VisualServer::get_singleton()) ); + GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("VS",VisualServer::get_singleton()) ); + GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("AudioServer",AudioServer::get_singleton()) ); + GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("AS",AudioServer::get_singleton()) ); + GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("PhysicsServer",PhysicsServer::get_singleton()) ); + GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("PS",PhysicsServer::get_singleton()) ); + GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("Physics2DServer",Physics2DServer::get_singleton()) ); + GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("PS2D",Physics2DServer::get_singleton()) ); + GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("SpatialSoundServer",SpatialSoundServer::get_singleton()) ); + GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("SS",SpatialSoundServer::get_singleton()) ); + GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("SpatialSound2DServer",SpatialSound2DServer::get_singleton()) ); + GlobalConfig::get_singleton()->add_singleton( GlobalConfig::Singleton("SS2D",SpatialSound2DServer::get_singleton()) ); + + shader_types = memnew( ShaderTypes ); + + + ClassDB::register_virtual_class<Physics2DDirectBodyState>(); + ClassDB::register_virtual_class<Physics2DDirectSpaceState>(); + ClassDB::register_virtual_class<Physics2DShapeQueryResult>(); + ClassDB::register_class<Physics2DTestMotionResult>(); + ClassDB::register_class<Physics2DShapeQueryParameters>(); + + ClassDB::register_class<PhysicsShapeQueryParameters>(); + ClassDB::register_virtual_class<PhysicsDirectBodyState>(); + ClassDB::register_virtual_class<PhysicsDirectSpaceState>(); + ClassDB::register_virtual_class<PhysicsShapeQueryResult>(); ScriptDebuggerRemote::resource_usage_func=_debugger_get_resource_usage; } void unregister_server_types(){ - + memdelete( shader_types ); } diff --git a/servers/register_server_types.h b/servers/register_server_types.h index a62af905b3..a3e7d3ee32 100644 --- a/servers/register_server_types.h +++ b/servers/register_server_types.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/server_wrap_mt_common.h b/servers/server_wrap_mt_common.h index dd9d603852..fbc68fc879 100644 --- a/servers/server_wrap_mt_common.h +++ b/servers/server_wrap_mt_common.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/spatial_sound/spatial_sound_server_sw.cpp b/servers/spatial_sound/spatial_sound_server_sw.cpp index dc15d61afa..ccde73561f 100644 --- a/servers/spatial_sound/spatial_sound_server_sw.cpp +++ b/servers/spatial_sound/spatial_sound_server_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -164,9 +164,9 @@ void SpatialSoundServerSW::room_set_space(RID p_room,RID p_space) { Space *space = space_owner.get(p_space); ERR_FAIL_COND(!space); space->rooms.insert(p_room); - room->octree_id=space->octree.create(room,AABB()); + room->octree_id=space->octree.create(room,Rect3()); //set bounds - AABB aabb = room->bounds.is_empty()?AABB():room->bounds.get_aabb(); + Rect3 aabb = room->bounds.is_empty()?Rect3():room->bounds.get_aabb(); space->octree.move(room->octree_id,room->transform.xform(aabb)); room->space=p_space; } @@ -195,7 +195,7 @@ void SpatialSoundServerSW::room_set_bounds(RID p_room, const BSP_Tree& p_bounds) if (!room->space.is_valid()) return; - AABB aabb = room->bounds.is_empty()?AABB():room->bounds.get_aabb(); + Rect3 aabb = room->bounds.is_empty()?Rect3():room->bounds.get_aabb(); Space* space = space_owner.get(room->space); ERR_FAIL_COND(!space); diff --git a/servers/spatial_sound/spatial_sound_server_sw.h b/servers/spatial_sound/spatial_sound_server_sw.h index b4295bf145..901b781ac2 100644 --- a/servers/spatial_sound/spatial_sound_server_sw.h +++ b/servers/spatial_sound/spatial_sound_server_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ class SpatialSoundServerSW : public SpatialSoundServer { - OBJ_TYPE(SpatialSoundServerSW,SpatialSoundServer); + GDCLASS(SpatialSoundServerSW,SpatialSoundServer); _THREAD_SAFE_CLASS_ @@ -67,7 +67,7 @@ class SpatialSoundServerSW : public SpatialSoundServer { struct Room; - struct Space { + struct Space : public RID_Data { RID default_room; Set<RID> rooms; @@ -79,7 +79,7 @@ class SpatialSoundServerSW : public SpatialSoundServer { mutable RID_Owner<Space> space_owner; - struct Room { + struct Room : public RID_Data{ RID space; Transform transform; Transform inverse_transform; @@ -97,7 +97,7 @@ class SpatialSoundServerSW : public SpatialSoundServer { - struct Source { + struct Source : public RID_Data { struct Voice { @@ -161,7 +161,7 @@ class SpatialSoundServerSW : public SpatialSoundServer { mutable RID_Owner<Source> source_owner; - struct Listener { + struct Listener : public RID_Data { RID space; Transform transform; diff --git a/servers/spatial_sound_2d/spatial_sound_2d_server_sw.cpp b/servers/spatial_sound_2d/spatial_sound_2d_server_sw.cpp index 6c42c2f527..33e51eb262 100644 --- a/servers/spatial_sound_2d/spatial_sound_2d_server_sw.cpp +++ b/servers/spatial_sound_2d/spatial_sound_2d_server_sw.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -181,7 +181,7 @@ RID SpatialSound2DServerSW::room_get_space(RID p_room) const { -void SpatialSound2DServerSW::room_set_bounds(RID p_room, const DVector<Point2>& p_bounds) { +void SpatialSound2DServerSW::room_set_bounds(RID p_room, const PoolVector<Point2>& p_bounds) { Room *room = room_owner.get(p_room); ERR_FAIL_COND(!room); @@ -198,14 +198,14 @@ void SpatialSound2DServerSW::room_set_bounds(RID p_room, const DVector<Point2>& // space->octree.move(room->octree_id,room->transform.xform(aabb)); } -DVector<Point2> SpatialSound2DServerSW::room_get_bounds(RID p_room) const { +PoolVector<Point2> SpatialSound2DServerSW::room_get_bounds(RID p_room) const { Room *room = room_owner.get(p_room); - ERR_FAIL_COND_V(!room,DVector<Point2>()); + ERR_FAIL_COND_V(!room,PoolVector<Point2>()); return room->bounds; } -void SpatialSound2DServerSW::room_set_transform(RID p_room, const Matrix32& p_transform) { +void SpatialSound2DServerSW::room_set_transform(RID p_room, const Transform2D& p_transform) { if (space_owner.owns(p_room)) p_room=space_owner.get(p_room)->default_room; @@ -228,13 +228,13 @@ void SpatialSound2DServerSW::room_set_transform(RID p_room, const Matrix32& p_tr }*/ } -Matrix32 SpatialSound2DServerSW::room_get_transform(RID p_room) const { +Transform2D SpatialSound2DServerSW::room_get_transform(RID p_room) const { if (space_owner.owns(p_room)) p_room=space_owner.get(p_room)->default_room; Room *room = room_owner.get(p_room); - ERR_FAIL_COND_V(!room,Matrix32()); + ERR_FAIL_COND_V(!room,Transform2D()); return room->transform; } @@ -365,17 +365,17 @@ int SpatialSound2DServerSW::source_get_polyphony(RID p_source) const { } -void SpatialSound2DServerSW::source_set_transform(RID p_source, const Matrix32& p_transform) { +void SpatialSound2DServerSW::source_set_transform(RID p_source, const Transform2D& p_transform) { Source *source = source_owner.get(p_source); ERR_FAIL_COND(!source); source->transform=p_transform; source->transform.orthonormalize(); } -Matrix32 SpatialSound2DServerSW::source_get_transform(RID p_source) const { +Transform2D SpatialSound2DServerSW::source_get_transform(RID p_source) const { Source *source = source_owner.get(p_source); - ERR_FAIL_COND_V(!source,Matrix32()); + ERR_FAIL_COND_V(!source,Transform2D()); return source->transform; } @@ -518,17 +518,17 @@ void SpatialSound2DServerSW::listener_set_space(RID p_listener,RID p_space) { } -void SpatialSound2DServerSW::listener_set_transform(RID p_listener, const Matrix32& p_transform) { +void SpatialSound2DServerSW::listener_set_transform(RID p_listener, const Transform2D& p_transform) { Listener *listener = listener_owner.get(p_listener); ERR_FAIL_COND(!listener); listener->transform=p_transform; listener->transform.orthonormalize(); //must be done.. } -Matrix32 SpatialSound2DServerSW::listener_get_transform(RID p_listener) const { +Transform2D SpatialSound2DServerSW::listener_get_transform(RID p_listener) const { Listener *listener = listener_owner.get(p_listener); - ERR_FAIL_COND_V(!listener,Matrix32()); + ERR_FAIL_COND_V(!listener,Transform2D()); return listener->transform; } diff --git a/servers/spatial_sound_2d/spatial_sound_2d_server_sw.h b/servers/spatial_sound_2d/spatial_sound_2d_server_sw.h index 619b11f376..16d2c93e7d 100644 --- a/servers/spatial_sound_2d/spatial_sound_2d_server_sw.h +++ b/servers/spatial_sound_2d/spatial_sound_2d_server_sw.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ class SpatialSound2DServerSW : public SpatialSound2DServer { - OBJ_TYPE(SpatialSound2DServerSW,SpatialSound2DServer); + GDCLASS(SpatialSound2DServerSW,SpatialSound2DServer); _THREAD_SAFE_CLASS_ @@ -66,7 +66,7 @@ class SpatialSound2DServerSW : public SpatialSound2DServer { struct Room; - struct Space { + struct Space : public RID_Data { RID default_room; Set<RID> rooms; @@ -78,11 +78,11 @@ class SpatialSound2DServerSW : public SpatialSound2DServer { mutable RID_Owner<Space> space_owner; - struct Room { + struct Room : public RID_Data { RID space; - Matrix32 transform; - Matrix32 inverse_transform; - DVector<Point2> bounds; + Transform2D transform; + Transform2D inverse_transform; + PoolVector<Point2> bounds; RoomReverb reverb; float params[ROOM_PARAM_MAX]; bool override_other_sources; @@ -96,7 +96,7 @@ class SpatialSound2DServerSW : public SpatialSound2DServer { - struct Source { + struct Source : public RID_Data { struct Voice { @@ -149,7 +149,7 @@ class SpatialSound2DServerSW : public SpatialSound2DServer { } stream_data; RID space; - Matrix32 transform; + Transform2D transform; float params[SOURCE_PARAM_MAX]; AudioServer::AudioStream *stream; Vector<Voice> voices; @@ -160,10 +160,10 @@ class SpatialSound2DServerSW : public SpatialSound2DServer { mutable RID_Owner<Source> source_owner; - struct Listener { + struct Listener : public RID_Data { RID space; - Matrix32 transform; + Transform2D transform; float params[LISTENER_PARAM_MAX]; Listener(); @@ -198,10 +198,10 @@ public: virtual void room_set_space(RID p_room,RID p_space); virtual RID room_get_space(RID p_room) const; - virtual void room_set_bounds(RID p_room, const DVector<Point2>& p_bounds); - virtual DVector<Point2> room_get_bounds(RID p_room) const; - virtual void room_set_transform(RID p_room, const Matrix32& p_transform); - virtual Matrix32 room_get_transform(RID p_room) const; + virtual void room_set_bounds(RID p_room, const PoolVector<Point2>& p_bounds); + virtual PoolVector<Point2> room_get_bounds(RID p_room) const; + virtual void room_set_transform(RID p_room, const Transform2D& p_transform); + virtual Transform2D room_get_transform(RID p_room) const; virtual void room_set_param(RID p_room, RoomParam p_param, float p_value); @@ -224,8 +224,8 @@ public: virtual void source_set_polyphony(RID p_source,int p_voice_count); virtual int source_get_polyphony(RID p_source) const; - virtual void source_set_transform(RID p_source, const Matrix32& p_transform); - virtual Matrix32 source_get_transform(RID p_source) const; + virtual void source_set_transform(RID p_source, const Transform2D& p_transform); + virtual Transform2D source_get_transform(RID p_source) const; virtual void source_set_param(RID p_source, SourceParam p_param, float p_value); virtual float source_get_param(RID p_source, SourceParam p_param) const; @@ -244,8 +244,8 @@ public: virtual RID listener_create(); virtual void listener_set_space(RID p_listener, RID p_space); - virtual void listener_set_transform(RID p_listener, const Matrix32& p_transform); - virtual Matrix32 listener_get_transform(RID p_listener) const; + virtual void listener_set_transform(RID p_listener, const Transform2D& p_transform); + virtual Transform2D listener_get_transform(RID p_listener) const; virtual void listener_set_param(RID p_listener, ListenerParam p_param, float p_value); virtual float listener_get_param(RID p_listener, ListenerParam p_param) const; diff --git a/servers/spatial_sound_2d_server.cpp b/servers/spatial_sound_2d_server.cpp index cfe40a0937..90f384ea2e 100644 --- a/servers/spatial_sound_2d_server.cpp +++ b/servers/spatial_sound_2d_server.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/spatial_sound_2d_server.h b/servers/spatial_sound_2d_server.h index 2d388feb49..331caf8198 100644 --- a/servers/spatial_sound_2d_server.h +++ b/servers/spatial_sound_2d_server.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class SpatialSound2DServer : public Object { - OBJ_TYPE(SpatialSound2DServer,Object); + GDCLASS(SpatialSound2DServer,Object); static SpatialSound2DServer *singleton; public: @@ -57,10 +57,10 @@ public: virtual RID room_get_space(RID p_room) const=0; - virtual void room_set_bounds(RID p_room, const DVector<Point2>& p_bounds)=0; - virtual DVector<Point2> room_get_bounds(RID p_room) const=0; - virtual void room_set_transform(RID p_room, const Matrix32& p_transform)=0; - virtual Matrix32 room_get_transform(RID p_room) const=0; + virtual void room_set_bounds(RID p_room, const PoolVector<Point2>& p_bounds)=0; + virtual PoolVector<Point2> room_get_bounds(RID p_room) const=0; + virtual void room_set_transform(RID p_room, const Transform2D& p_transform)=0; + virtual Transform2D room_get_transform(RID p_room) const=0; enum RoomParam { ROOM_PARAM_PITCH_SCALE, @@ -99,8 +99,8 @@ public: virtual RID source_create(RID p_space)=0; - virtual void source_set_transform(RID p_source, const Matrix32& p_transform)=0; - virtual Matrix32 source_get_transform(RID p_source) const=0; + virtual void source_set_transform(RID p_source, const Transform2D& p_transform)=0; + virtual Transform2D source_get_transform(RID p_source) const=0; virtual void source_set_polyphony(RID p_source,int p_voice_count)=0; virtual int source_get_polyphony(RID p_source) const=0; @@ -141,8 +141,8 @@ public: virtual RID listener_create()=0; virtual void listener_set_space(RID p_listener, RID p_space)=0; - virtual void listener_set_transform(RID p_listener, const Matrix32& p_transform)=0; - virtual Matrix32 listener_get_transform(RID p_listener) const=0; + virtual void listener_set_transform(RID p_listener, const Transform2D& p_transform)=0; + virtual Transform2D listener_get_transform(RID p_listener) const=0; virtual void listener_set_param(RID p_listener, ListenerParam p_param, float p_value)=0; virtual float listener_get_param(RID p_listener, ListenerParam p_param) const=0; diff --git a/servers/spatial_sound_server.cpp b/servers/spatial_sound_server.cpp index 5f93c55a91..f49367d4c0 100644 --- a/servers/spatial_sound_server.cpp +++ b/servers/spatial_sound_server.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/servers/spatial_sound_server.h b/servers/spatial_sound_server.h index 5037ee6e2f..69ef71c84f 100644 --- a/servers/spatial_sound_server.h +++ b/servers/spatial_sound_server.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ #include "servers/audio_server.h" class SpatialSoundServer : public Object { - OBJ_TYPE(SpatialSoundServer,Object); + GDCLASS(SpatialSoundServer,Object); static SpatialSoundServer *singleton; public: diff --git a/servers/visual/particle_system_sw.cpp b/servers/visual/particle_system_sw.cpp deleted file mode 100644 index 07cc6d8a2a..0000000000 --- a/servers/visual/particle_system_sw.cpp +++ /dev/null @@ -1,412 +0,0 @@ -/*************************************************************************/ -/* particle_system_sw.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "particle_system_sw.h" -#include "sort.h" - - -ParticleSystemSW::ParticleSystemSW() { - - amount=8; - emitting=true; - - for (int i=0;i<VS::PARTICLE_VAR_MAX;i++) { - particle_randomness[i]=0.0; - } - - particle_vars[VS::PARTICLE_LIFETIME]=2.0;// - particle_vars[VS::PARTICLE_SPREAD]=0.2;// - particle_vars[VS::PARTICLE_GRAVITY]=9.8;// - particle_vars[VS::PARTICLE_LINEAR_VELOCITY]=0.2;// - particle_vars[VS::PARTICLE_ANGULAR_VELOCITY]=0.0;// - particle_vars[VS::PARTICLE_LINEAR_ACCELERATION]=0.0;// - particle_vars[VS::PARTICLE_RADIAL_ACCELERATION]=0.0;// - particle_vars[VS::PARTICLE_TANGENTIAL_ACCELERATION]=1.0;// - particle_vars[VS::PARTICLE_DAMPING]=0.0;// - particle_vars[VS::PARTICLE_INITIAL_SIZE]=1.0; - particle_vars[VS::PARTICLE_FINAL_SIZE]=0.8; - particle_vars[VS::PARTICLE_HEIGHT]=1; - particle_vars[VS::PARTICLE_HEIGHT_SPEED_SCALE]=1; - - height_from_velocity=false; - local_coordinates=false; - - particle_vars[VS::PARTICLE_INITIAL_ANGLE]=0.0;// - - gravity_normal=Vector3(0,-1.0,0); - //emission_half_extents=Vector3(0.1,0.1,0.1); - emission_half_extents=Vector3(1,1,1); - color_phase_count=0; - color_phases[0].pos=0.0; - color_phases[0].color=Color(1.0,0.0,0.0); - visibility_aabb=AABB(Vector3(-64,-64,-64),Vector3(128,128,128)); - - attractor_count=0; - -} - - -ParticleSystemSW::~ParticleSystemSW() -{ -} - - -#define DEFAULT_SEED 1234567 - -_FORCE_INLINE_ static float _rand_from_seed(uint32_t *seed) { - - uint32_t k; - uint32_t s = (*seed); - if (s == 0) - s = 0x12345987; - k = s / 127773; - s = 16807 * (s - k * 127773) - 2836 * k; - if (s < 0) - s += 2147483647; - (*seed) = s; - - float v=((float)((*seed) & 0xFFFFF))/(float)0xFFFFF; - v=v*2.0-1.0; - return v; -} - -_FORCE_INLINE_ static uint32_t _irand_from_seed(uint32_t *seed) { - - uint32_t k; - uint32_t s = (*seed); - if (s == 0) - s = 0x12345987; - k = s / 127773; - s = 16807 * (s - k * 127773) - 2836 * k; - if (s < 0) - s += 2147483647; - (*seed) = s; - - return s; -} - -void ParticleSystemProcessSW::process(const ParticleSystemSW *p_system,const Transform& p_transform,float p_time) { - - valid=false; - if (p_system->amount<=0) { - ERR_EXPLAIN("Invalid amount of particles: "+itos(p_system->amount)); - ERR_FAIL_COND(p_system->amount<=0); - } - if (p_system->attractor_count<0 || p_system->attractor_count>VS::MAX_PARTICLE_ATTRACTORS) { - ERR_EXPLAIN("Invalid amount of particle attractors."); - ERR_FAIL_COND(p_system->attractor_count<0 || p_system->attractor_count>VS::MAX_PARTICLE_ATTRACTORS); - } - float lifetime = p_system->particle_vars[VS::PARTICLE_LIFETIME]; - if (lifetime<CMP_EPSILON) { - ERR_EXPLAIN("Particle system lifetime too small."); - ERR_FAIL_COND(lifetime<CMP_EPSILON); - } - valid=true; - int particle_count=MIN(p_system->amount,ParticleSystemSW::MAX_PARTICLES);; - - - int emission_point_count = p_system->emission_points.size(); - DVector<Vector3>::Read r; - if (emission_point_count) - r=p_system->emission_points.read(); - - if (particle_count!=particle_data.size()) { - - //clear the whole system if particle amount changed - particle_data.clear(); - particle_data.resize(p_system->amount); - particle_system_time=0; - } - - float next_time = particle_system_time+p_time; - - if (next_time > lifetime) - next_time=Math::fmod(next_time,lifetime); - - - ParticleData *pdata=&particle_data[0]; - Vector3 attractor_positions[VS::MAX_PARTICLE_ATTRACTORS]; - - for(int i=0;i<p_system->attractor_count;i++) { - - attractor_positions[i]=p_transform.xform(p_system->attractors[i].pos); - } - - - for(int i=0;i<particle_count;i++) { - - ParticleData &p=pdata[i]; - - float restart_time = (i * lifetime / p_system->amount); - - bool restart=false; - - if ( next_time < particle_system_time ) { - - if (restart_time > particle_system_time || restart_time < next_time ) - restart=true; - - } else if (restart_time > particle_system_time && restart_time < next_time ) { - restart=true; - } - - if (restart) { - - - if (p_system->emitting) { - if (emission_point_count==0) { //use AABB - if (p_system->local_coordinates) - p.pos = p_system->emission_half_extents * Vector3( _rand_from_seed(&rand_seed), _rand_from_seed(&rand_seed), _rand_from_seed(&rand_seed) ); - else - p.pos = p_transform.xform( p_system->emission_half_extents * Vector3( _rand_from_seed(&rand_seed), _rand_from_seed(&rand_seed), _rand_from_seed(&rand_seed) ) ); - } else { - //use preset positions - if (p_system->local_coordinates) - p.pos = r[_irand_from_seed(&rand_seed)%emission_point_count]; - else - p.pos = p_transform.xform( r[_irand_from_seed(&rand_seed)%emission_point_count] ); - } - - - float angle1 = _rand_from_seed(&rand_seed)*p_system->particle_vars[VS::PARTICLE_SPREAD]*Math_PI; - float angle2 = _rand_from_seed(&rand_seed)*20.0*Math_PI; // make it more random like - - Vector3 rot_xz=Vector3( Math::sin(angle1), 0.0, Math::cos(angle1) ); - Vector3 rot = Vector3( Math::cos(angle2)*rot_xz.x,Math::sin(angle2)*rot_xz.x, rot_xz.z); - - p.vel=(rot*p_system->particle_vars[VS::PARTICLE_LINEAR_VELOCITY]+rot*p_system->particle_randomness[VS::PARTICLE_LINEAR_VELOCITY]*_rand_from_seed(&rand_seed)); - if (!p_system->local_coordinates) - p.vel=p_transform.basis.xform( p.vel ); - - p.vel+=p_system->emission_base_velocity; - - p.rot=p_system->particle_vars[VS::PARTICLE_INITIAL_ANGLE]+p_system->particle_randomness[VS::PARTICLE_INITIAL_ANGLE]*_rand_from_seed(&rand_seed); - p.active=true; - for(int r=0;r<PARTICLE_RANDOM_NUMBERS;r++) - p.random[r]=_rand_from_seed(&rand_seed); - - } else { - - p.pos=Vector3(); - p.rot=0; - p.vel=Vector3(); - p.active=false; - } - - } else { - - if (!p.active) - continue; - - Vector3 force; - //apply gravity - force=p_system->gravity_normal * (p_system->particle_vars[VS::PARTICLE_GRAVITY]+(p_system->particle_randomness[VS::PARTICLE_GRAVITY]*p.random[0])); - //apply linear acceleration - force+=p.vel.normalized() * (p_system->particle_vars[VS::PARTICLE_LINEAR_ACCELERATION]+p_system->particle_randomness[VS::PARTICLE_LINEAR_ACCELERATION]*p.random[1]); - //apply radial acceleration - Vector3 org; - if (!p_system->local_coordinates) - org=p_transform.origin; - force+=(p.pos-org).normalized() * (p_system->particle_vars[VS::PARTICLE_RADIAL_ACCELERATION]+p_system->particle_randomness[VS::PARTICLE_RADIAL_ACCELERATION]*p.random[2]); - //apply tangential acceleration - force+=(p.pos-org).cross(p_system->gravity_normal).normalized() * (p_system->particle_vars[VS::PARTICLE_TANGENTIAL_ACCELERATION]+p_system->particle_randomness[VS::PARTICLE_TANGENTIAL_ACCELERATION]*p.random[3]); - //apply attractor forces - for(int a=0;a<p_system->attractor_count;a++) { - - force+=(p.pos-attractor_positions[a]).normalized() * p_system->attractors[a].force; - } - - - p.vel+=force * p_time; - if (p_system->particle_vars[VS::PARTICLE_DAMPING]) { - - float v = p.vel.length(); - float damp = p_system->particle_vars[VS::PARTICLE_DAMPING] + p_system->particle_vars[VS::PARTICLE_DAMPING] * p_system->particle_randomness[VS::PARTICLE_DAMPING]; - v -= damp * p_time; - if (v<0) { - p.vel=Vector3(); - } else { - p.vel=p.vel.normalized() * v; - } - - } - p.rot+=(p_system->particle_vars[VS::PARTICLE_ANGULAR_VELOCITY]+p_system->particle_randomness[VS::PARTICLE_ANGULAR_VELOCITY]*p.random[4]) *p_time; - p.pos+=p.vel * p_time; - } - } - - particle_system_time=Math::fmod( particle_system_time+p_time, lifetime ); - - -} - -ParticleSystemProcessSW::ParticleSystemProcessSW() { - - particle_system_time=0; - rand_seed=1234567; - valid=false; -} - - -struct _ParticleSorterSW { - - - _FORCE_INLINE_ bool operator()(const ParticleSystemDrawInfoSW::ParticleDrawInfo *p_a,const ParticleSystemDrawInfoSW::ParticleDrawInfo *p_b) const { - - return p_a->d > p_b->d; // draw from further away to closest - } -}; - -void ParticleSystemDrawInfoSW::prepare(const ParticleSystemSW *p_system,const ParticleSystemProcessSW *p_process,const Transform& p_system_transform,const Transform& p_camera_transform) { - - ERR_FAIL_COND(p_process->particle_data.size() != p_system->amount); - ERR_FAIL_COND(p_system->amount<=0 || p_system->amount>=ParticleSystemSW::MAX_PARTICLES); - - const ParticleSystemProcessSW::ParticleData *pdata=&p_process->particle_data[0]; - float time_pos=p_process->particle_system_time/p_system->particle_vars[VS::PARTICLE_LIFETIME]; - - ParticleSystemSW::ColorPhase cphase[VS::MAX_PARTICLE_COLOR_PHASES]; - - float last=-1; - int col_count=0; - - for(int i=0;i<p_system->color_phase_count;i++) { - - if (p_system->color_phases[i].pos<=last) - break; - cphase[i]=p_system->color_phases[i]; - col_count++; - } - - - - - - Vector3 camera_z_axis = p_camera_transform.basis.get_axis(2); - - for(int i=0;i<p_system->amount;i++) { - - ParticleDrawInfo &pdi=draw_info[i]; - pdi.data=&pdata[i]; - pdi.transform.origin=pdi.data->pos; - if (p_system->local_coordinates) - pdi.transform.origin=p_system_transform.xform(pdi.transform.origin); - - pdi.d=-camera_z_axis.dot(pdi.transform.origin); - - // adjust particle size, color and rotation - - float time = ((float)i / p_system->amount); - if (time<time_pos) - time=time_pos-time; - else - time=(1.0-time)+time_pos; - - Vector3 up=p_camera_transform.basis.get_axis(1); // up determines the rotation - float up_scale=1.0; - - if (p_system->height_from_velocity) { - - Vector3 veld = pdi.data->vel; - Vector3 cam_z = camera_z_axis.normalized(); - float vc = Math::abs(veld.normalized().dot(cam_z)); - - if (vc<(1.0-CMP_EPSILON)) { - up = Plane(cam_z,0).project(veld).normalized(); - float h = p_system->particle_vars[VS::PARTICLE_HEIGHT]+p_system->particle_randomness[VS::PARTICLE_HEIGHT]*pdi.data->random[7]; - float velh = veld.length(); - h+=velh*(p_system->particle_vars[VS::PARTICLE_HEIGHT_SPEED_SCALE]+p_system->particle_randomness[VS::PARTICLE_HEIGHT_SPEED_SCALE]*pdi.data->random[7]); - - - up_scale=Math::lerp(1.0,h,(1.0-vc)); - } - - } else if (pdi.data->rot) { - - up.rotate(camera_z_axis,pdi.data->rot); - } - - { - // matrix - Vector3 v_z = (p_camera_transform.origin-pdi.transform.origin).normalized(); -// Vector3 v_z = (p_camera_transform.origin-pdi.data->pos).normalized(); - Vector3 v_y = up; - Vector3 v_x = v_y.cross(v_z); - v_y = v_z.cross(v_x); - v_x.normalize(); - v_y.normalize(); - - - float initial_scale, final_scale; - initial_scale = p_system->particle_vars[VS::PARTICLE_INITIAL_SIZE]+p_system->particle_randomness[VS::PARTICLE_INITIAL_SIZE]*pdi.data->random[5]; - final_scale = p_system->particle_vars[VS::PARTICLE_FINAL_SIZE]+p_system->particle_randomness[VS::PARTICLE_FINAL_SIZE]*pdi.data->random[6]; - float scale = initial_scale + time * (final_scale - initial_scale); - - pdi.transform.basis.set_axis(0,v_x * scale); - pdi.transform.basis.set_axis(1,v_y * scale * up_scale); - pdi.transform.basis.set_axis(2,v_z * scale); - } - - - - int cpos=0; - - while(cpos<col_count) { - - if (cphase[cpos].pos > time) - break; - cpos++; - } - - cpos--; - - - if (cpos==-1) - pdi.color=Color(1,1,1,1); - else { - if (cpos==col_count-1) - pdi.color=cphase[cpos].color; - else { - float diff = (cphase[cpos+1].pos-cphase[cpos].pos); - if (diff>0) - pdi.color=cphase[cpos].color.linear_interpolate(cphase[cpos+1].color, (time - cphase[cpos].pos) / diff ); - else - pdi.color=cphase[cpos+1].color; - } - } - - - draw_info_order[i]=&pdi; - - } - - - SortArray<ParticleDrawInfo*,_ParticleSorterSW> particle_sort; - particle_sort.sort(&draw_info_order[0],p_system->amount); - -} diff --git a/servers/visual/particle_system_sw.h b/servers/visual/particle_system_sw.h deleted file mode 100644 index 4edcecaaa9..0000000000 --- a/servers/visual/particle_system_sw.h +++ /dev/null @@ -1,131 +0,0 @@ -/*************************************************************************/ -/* particle_system_sw.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef PARTICLE_SYSTEM_SW_H -#define PARTICLE_SYSTEM_SW_H - -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ - -#include "servers/visual_server.h" - -struct ParticleSystemSW { - enum { - - MAX_PARTICLES=1024 - }; - - float particle_vars[VS::PARTICLE_VAR_MAX]; - float particle_randomness[VS::PARTICLE_VAR_MAX]; - - Vector3 emission_half_extents; - DVector<Vector3> emission_points; - Vector3 gravity_normal; - Vector3 emission_base_velocity; - int amount; - bool emitting; - bool height_from_velocity; - AABB visibility_aabb; - bool sort; - bool local_coordinates; - - struct ColorPhase { - - float pos; - Color color; - ColorPhase() { pos=1.0; color=Color(0.0,0.0,1.0,1.0); } - }; - - int color_phase_count; - ColorPhase color_phases[VS::MAX_PARTICLE_COLOR_PHASES]; - - - struct Attractor { - - Vector3 pos; - float force; - }; - - int attractor_count; - Attractor attractors[VS::MAX_PARTICLE_ATTRACTORS]; - - - ParticleSystemSW(); - ~ParticleSystemSW(); - -}; - - -struct ParticleSystemProcessSW { - - enum { - PARTICLE_RANDOM_NUMBERS = 8, - }; - - struct ParticleData { - - Vector3 pos; - Vector3 vel; - float rot; - bool active; - float random[PARTICLE_RANDOM_NUMBERS]; - - ParticleData() { active=0; rot=0; } - }; - - - bool valid; - float particle_system_time; - uint32_t rand_seed; - Vector<ParticleData> particle_data; - - void process(const ParticleSystemSW *p_system,const Transform& p_transform,float p_time); - - ParticleSystemProcessSW(); -}; - -struct ParticleSystemDrawInfoSW { - - struct ParticleDrawInfo { - - const ParticleSystemProcessSW::ParticleData *data; - float d; - Transform transform; - Color color; - - }; - - ParticleDrawInfo draw_info[ParticleSystemSW::MAX_PARTICLES]; - ParticleDrawInfo *draw_info_order[ParticleSystemSW::MAX_PARTICLES]; - - void prepare(const ParticleSystemSW *p_system,const ParticleSystemProcessSW *p_process,const Transform& p_system_transform,const Transform& p_camera_transform); - -}; - -#endif diff --git a/servers/visual/rasterizer.cpp b/servers/visual/rasterizer.cpp index a4b91e17fe..1adf2ee021 100644 --- a/servers/visual/rasterizer.cpp +++ b/servers/visual/rasterizer.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -30,6 +30,23 @@ #include "print_string.h" #include "os/os.h" + +Rasterizer* (*Rasterizer::_create_func)()=NULL; + +Rasterizer *Rasterizer::create() { + + return _create_func(); +} + +RasterizerStorage*RasterizerStorage::base_signleton=NULL; + +RasterizerStorage::RasterizerStorage() { + + base_signleton=this; +} + +#if 0 + RID Rasterizer::create_default_material() { return material_create(); @@ -38,10 +55,10 @@ RID Rasterizer::create_default_material() { /* Fixed MAterial SHADER API */ -RID Rasterizer::_create_shader(const FixedMaterialShaderKey& p_key) { +RID Rasterizer::_create_shader(const FixedSpatialMaterialShaderKey& p_key) { ERR_FAIL_COND_V(!p_key.valid,RID()); - Map<FixedMaterialShaderKey,FixedMaterialShader>::Element *E=fixed_material_shaders.find(p_key); + Map<FixedSpatialMaterialShaderKey,FixedSpatialMaterialShader>::Element *E=fixed_material_shaders.find(p_key); if (E) { E->get().refcount++; @@ -50,7 +67,7 @@ RID Rasterizer::_create_shader(const FixedMaterialShaderKey& p_key) { uint64_t t = OS::get_singleton()->get_ticks_usec(); - FixedMaterialShader fms; + FixedSpatialMaterialShader fms; fms.refcount=1; fms.shader=shader_create(); @@ -296,12 +313,12 @@ RID Rasterizer::_create_shader(const FixedMaterialShaderKey& p_key) { return fms.shader; } -void Rasterizer::_free_shader(const FixedMaterialShaderKey& p_key) { +void Rasterizer::_free_shader(const FixedSpatialMaterialShaderKey& p_key) { if (p_key.valid==0) return; //not a valid key - Map<FixedMaterialShaderKey,FixedMaterialShader>::Element *E=fixed_material_shaders.find(p_key); + Map<FixedSpatialMaterialShaderKey,FixedSpatialMaterialShader>::Element *E=fixed_material_shaders.find(p_key); ERR_FAIL_COND(!E); E->get().refcount--; @@ -313,12 +330,12 @@ void Rasterizer::_free_shader(const FixedMaterialShaderKey& p_key) { } -void Rasterizer::fixed_material_set_flag(RID p_material, VS::FixedMaterialFlags p_flag, bool p_enabled) { +void Rasterizer::fixed_material_set_flag(RID p_material, VS::FixedSpatialMaterialFlags p_flag, bool p_enabled) { - Map<RID,FixedMaterial*>::Element *E = fixed_materials.find(p_material); + Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material); ERR_FAIL_COND(!E); - FixedMaterial &fm=*E->get(); + FixedSpatialMaterial &fm=*E->get(); switch(p_flag) { @@ -334,11 +351,11 @@ void Rasterizer::fixed_material_set_flag(RID p_material, VS::FixedMaterialFlags } -bool Rasterizer::fixed_material_get_flag(RID p_material, VS::FixedMaterialFlags p_flag) const{ +bool Rasterizer::fixed_material_get_flag(RID p_material, VS::FixedSpatialMaterialFlags p_flag) const{ - const Map<RID,FixedMaterial*>::Element *E = fixed_materials.find(p_material); + const Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material); ERR_FAIL_COND_V(!E,false); - const FixedMaterial &fm=*E->get(); + const FixedSpatialMaterial &fm=*E->get(); switch(p_flag) { case VS::FIXED_MATERIAL_FLAG_USE_ALPHA: return fm.use_alpha;; break; @@ -357,8 +374,8 @@ bool Rasterizer::fixed_material_get_flag(RID p_material, VS::FixedMaterialFlags RID Rasterizer::fixed_material_create() { RID mat = material_create(); - fixed_materials[mat]=memnew( FixedMaterial() ); - FixedMaterial &fm=*fixed_materials[mat]; + fixed_materials[mat]=memnew( FixedSpatialMaterial() ); + FixedSpatialMaterial &fm=*fixed_materials[mat]; fm.self=mat; fm.get_key(); material_set_flag(mat,VS::MATERIAL_FLAG_COLOR_ARRAY_SRGB,true); @@ -374,11 +391,11 @@ RID Rasterizer::fixed_material_create() { -void Rasterizer::fixed_material_set_parameter(RID p_material, VS::FixedMaterialParam p_parameter, const Variant& p_value){ +void Rasterizer::fixed_material_set_parameter(RID p_material, VS::FixedSpatialMaterialParam p_parameter, const Variant& p_value){ - Map<RID,FixedMaterial*>::Element *E = fixed_materials.find(p_material); + Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material); ERR_FAIL_COND(!E); - FixedMaterial &fm=*E->get(); + FixedSpatialMaterial &fm=*E->get(); RID material=E->key(); ERR_FAIL_INDEX(p_parameter,VS::FIXED_MATERIAL_PARAM_MAX); @@ -401,24 +418,24 @@ void Rasterizer::fixed_material_set_parameter(RID p_material, VS::FixedMaterialP } -Variant Rasterizer::fixed_material_get_parameter(RID p_material,VS::FixedMaterialParam p_parameter) const{ +Variant Rasterizer::fixed_material_get_parameter(RID p_material,VS::FixedSpatialMaterialParam p_parameter) const{ - const Map<RID,FixedMaterial*>::Element *E = fixed_materials.find(p_material); + const Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material); ERR_FAIL_COND_V(!E,Variant()); - const FixedMaterial &fm=*E->get(); + const FixedSpatialMaterial &fm=*E->get(); ERR_FAIL_INDEX_V(p_parameter,VS::FIXED_MATERIAL_PARAM_MAX,Variant()); return fm.param[p_parameter]; } -void Rasterizer::fixed_material_set_texture(RID p_material,VS::FixedMaterialParam p_parameter, RID p_texture){ +void Rasterizer::fixed_material_set_texture(RID p_material,VS::FixedSpatialMaterialParam p_parameter, RID p_texture){ - Map<RID,FixedMaterial*>::Element *E = fixed_materials.find(p_material); + Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material); if (!E) { print_line("Not found: "+itos(p_material.get_id())); } ERR_FAIL_COND(!E); - FixedMaterial &fm=*E->get(); + FixedSpatialMaterial &fm=*E->get(); ERR_FAIL_INDEX(p_parameter,VS::FIXED_MATERIAL_PARAM_MAX); @@ -433,22 +450,22 @@ void Rasterizer::fixed_material_set_texture(RID p_material,VS::FixedMaterialPara } -RID Rasterizer::fixed_material_get_texture(RID p_material,VS::FixedMaterialParam p_parameter) const{ +RID Rasterizer::fixed_material_get_texture(RID p_material,VS::FixedSpatialMaterialParam p_parameter) const{ - const Map<RID,FixedMaterial*>::Element *E = fixed_materials.find(p_material); + const Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material); ERR_FAIL_COND_V(!E,RID()); - const FixedMaterial &fm=*E->get(); + const FixedSpatialMaterial &fm=*E->get(); ERR_FAIL_INDEX_V(p_parameter,VS::FIXED_MATERIAL_PARAM_MAX,RID()); return fm.texture[p_parameter]; } -void Rasterizer::fixed_material_set_texcoord_mode(RID p_material,VS::FixedMaterialParam p_parameter, VS::FixedMaterialTexCoordMode p_mode) { +void Rasterizer::fixed_material_set_texcoord_mode(RID p_material,VS::FixedSpatialMaterialParam p_parameter, VS::FixedSpatialMaterialTexCoordMode p_mode) { - Map<RID,FixedMaterial*>::Element *E = fixed_materials.find(p_material); + Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material); ERR_FAIL_COND(!E); - FixedMaterial &fm=*E->get(); + FixedSpatialMaterial &fm=*E->get(); ERR_FAIL_INDEX(p_parameter,VS::FIXED_MATERIAL_PARAM_MAX); fm.get_key(); @@ -460,11 +477,11 @@ void Rasterizer::fixed_material_set_texcoord_mode(RID p_material,VS::FixedMateri } -VS::FixedMaterialTexCoordMode Rasterizer::fixed_material_get_texcoord_mode(RID p_material,VS::FixedMaterialParam p_parameter) const { +VS::FixedSpatialMaterialTexCoordMode Rasterizer::fixed_material_get_texcoord_mode(RID p_material,VS::FixedSpatialMaterialParam p_parameter) const { - const Map<RID,FixedMaterial*>::Element *E = fixed_materials.find(p_material); + const Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material); ERR_FAIL_COND_V(!E,VS::FIXED_MATERIAL_TEXCOORD_UV); - const FixedMaterial &fm=*E->get(); + const FixedSpatialMaterial &fm=*E->get(); ERR_FAIL_INDEX_V(p_parameter,VS::FIXED_MATERIAL_PARAM_MAX,VS::FIXED_MATERIAL_TEXCOORD_UV); return fm.texture_tc[p_parameter]; @@ -472,9 +489,9 @@ VS::FixedMaterialTexCoordMode Rasterizer::fixed_material_get_texcoord_mode(RID p void Rasterizer::fixed_material_set_uv_transform(RID p_material,const Transform& p_transform) { - Map<RID,FixedMaterial*>::Element *E = fixed_materials.find(p_material); + Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material); ERR_FAIL_COND(!E); - FixedMaterial &fm=*E->get(); + FixedSpatialMaterial &fm=*E->get(); RID material=E->key(); VS::get_singleton()->material_set_param(material,_fixed_material_uv_xform_name,p_transform); @@ -487,18 +504,18 @@ void Rasterizer::fixed_material_set_uv_transform(RID p_material,const Transform& Transform Rasterizer::fixed_material_get_uv_transform(RID p_material) const { - const Map<RID,FixedMaterial*>::Element *E = fixed_materials.find(p_material); + const Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material); ERR_FAIL_COND_V(!E,Transform()); - const FixedMaterial &fm=*E->get(); + const FixedSpatialMaterial &fm=*E->get(); return fm.uv_xform; } -void Rasterizer::fixed_material_set_light_shader(RID p_material,VS::FixedMaterialLightShader p_shader) { +void Rasterizer::fixed_material_set_light_shader(RID p_material,VS::FixedSpatialMaterialLightShader p_shader) { - Map<RID,FixedMaterial*>::Element *E = fixed_materials.find(p_material); + Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material); ERR_FAIL_COND(!E); - FixedMaterial &fm=*E->get(); + FixedSpatialMaterial &fm=*E->get(); fm.light_shader=p_shader; @@ -507,20 +524,20 @@ void Rasterizer::fixed_material_set_light_shader(RID p_material,VS::FixedMateria } -VS::FixedMaterialLightShader Rasterizer::fixed_material_get_light_shader(RID p_material) const { +VS::FixedSpatialMaterialLightShader Rasterizer::fixed_material_get_light_shader(RID p_material) const { - const Map<RID,FixedMaterial*>::Element *E = fixed_materials.find(p_material); + const Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material); ERR_FAIL_COND_V(!E,VS::FIXED_MATERIAL_LIGHT_SHADER_LAMBERT); - const FixedMaterial &fm=*E->get(); + const FixedSpatialMaterial &fm=*E->get(); return fm.light_shader; } void Rasterizer::fixed_material_set_point_size(RID p_material,float p_size) { - Map<RID,FixedMaterial*>::Element *E = fixed_materials.find(p_material); + Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material); ERR_FAIL_COND(!E); - FixedMaterial &fm=*E->get(); + FixedSpatialMaterial &fm=*E->get(); RID material=E->key(); VS::get_singleton()->material_set_param(material,_fixed_material_point_size_name,p_size); @@ -532,9 +549,9 @@ void Rasterizer::fixed_material_set_point_size(RID p_material,float p_size) { float Rasterizer::fixed_material_get_point_size(RID p_material) const{ - const Map<RID,FixedMaterial*>::Element *E = fixed_materials.find(p_material); + const Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material); ERR_FAIL_COND_V(!E,1.0); - const FixedMaterial &fm=*E->get(); + const FixedSpatialMaterial &fm=*E->get(); return fm.point_size; @@ -545,9 +562,9 @@ void Rasterizer::_update_fixed_materials() { while(fixed_material_dirty_list.first()) { - FixedMaterial &fm=*fixed_material_dirty_list.first()->self(); + FixedSpatialMaterial &fm=*fixed_material_dirty_list.first()->self(); - FixedMaterialShaderKey new_key = fm.get_key(); + FixedSpatialMaterialShaderKey new_key = fm.get_key(); if (new_key.key!=fm.current_key.key) { _free_shader(fm.current_key); @@ -577,7 +594,7 @@ void Rasterizer::_update_fixed_materials() { void Rasterizer::_free_fixed_material(const RID& p_material) { - Map<RID,FixedMaterial*>::Element *E = fixed_materials.find(p_material); + Map<RID,FixedSpatialMaterial*>::Element *E = fixed_materials.find(p_material); if (E) { @@ -620,7 +637,7 @@ Rasterizer::Rasterizer() { draw_viewport_func=NULL; - ERR_FAIL_COND( sizeof(FixedMaterialShaderKey)!=4); + ERR_FAIL_COND( sizeof(FixedSpatialMaterialShaderKey)!=4); } @@ -636,3 +653,5 @@ RID Rasterizer::create_overdraw_debug_material() { return mat; } + +#endif diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 8cc567072f..887fc5ac5f 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -29,6 +29,921 @@ #ifndef RASTERIZER_H #define RASTERIZER_H + +#include "servers/visual_server.h" +#include "camera_matrix.h" + +#include "self_list.h" + + +class RasterizerScene { +public: + + /* SHADOW ATLAS API */ + + virtual RID shadow_atlas_create()=0; + virtual void shadow_atlas_set_size(RID p_atlas,int p_size)=0; + virtual void shadow_atlas_set_quadrant_subdivision(RID p_atlas,int p_quadrant,int p_subdivision)=0; + virtual bool shadow_atlas_update_light(RID p_atlas,RID p_light_intance,float p_coverage,uint64_t p_light_version)=0; + + virtual int get_directional_light_shadow_size(RID p_light_intance)=0; + virtual void set_directional_shadow_count(int p_count)=0; + + /* ENVIRONMENT API */ + + virtual RID environment_create()=0; + + virtual void environment_set_background(RID p_env,VS::EnvironmentBG p_bg)=0; + virtual void environment_set_skybox(RID p_env,RID p_skybox)=0; + virtual void environment_set_skybox_scale(RID p_env,float p_scale)=0; + virtual void environment_set_bg_color(RID p_env,const Color& p_color)=0; + virtual void environment_set_bg_energy(RID p_env,float p_energy)=0; + virtual void environment_set_canvas_max_layer(RID p_env,int p_max_layer)=0; + virtual void environment_set_ambient_light(RID p_env,const Color& p_color,float p_energy=1.0,float p_skybox_contribution=0.0)=0; + + virtual void environment_set_dof_blur_near(RID p_env,bool p_enable,float p_distance,float p_transition,float p_far_amount,VS::EnvironmentDOFBlurQuality p_quality)=0; + virtual void environment_set_dof_blur_far(RID p_env,bool p_enable,float p_distance,float p_transition,float p_far_amount,VS::EnvironmentDOFBlurQuality p_quality)=0; + virtual void environment_set_glow(RID p_env,bool p_enable,int p_level_flags,float p_intensity,float p_strength,float p_bloom_treshold,VS::EnvironmentGlowBlendMode p_blend_mode,float p_hdr_bleed_treshold,float p_hdr_bleed_scale,bool p_bicubic_upscale)=0; + virtual void environment_set_fog(RID p_env,bool p_enable,float p_begin,float p_end,RID p_gradient_texture)=0; + + virtual void environment_set_ssr(RID p_env,bool p_enable, int p_max_steps,float p_accel,float p_fade,float p_depth_tolerance,bool p_smooth,bool p_roughness)=0; + virtual void environment_set_ssao(RID p_env,bool p_enable, float p_radius, float p_intensity, float p_radius2, float p_intensity2, float p_bias, float p_light_affect,const Color &p_color,bool p_blur)=0; + + virtual void environment_set_tonemap(RID p_env,VS::EnvironmentToneMapper p_tone_mapper,float p_exposure,float p_white,bool p_auto_exposure,float p_min_luminance,float p_max_luminance,float p_auto_exp_speed,float p_auto_exp_scale)=0; + + virtual void environment_set_adjustment(RID p_env,bool p_enable,float p_brightness,float p_contrast,float p_saturation,RID p_ramp)=0; + + struct InstanceBase : RID_Data { + + VS::InstanceType base_type; + RID base; + + RID skeleton; + RID material_override; + + Transform transform; + + int depth_layer; + uint32_t layer_mask; + + //RID sampled_light; + + Vector<RID> materials; + Vector<RID> light_instances; + Vector<RID> reflection_probe_instances; + Vector<RID> gi_probe_instances; + + Vector<float> morph_values; + + //BakedLightData *baked_light; + VS::ShadowCastingSetting cast_shadows; + //Transform *baked_light_octree_xform; + //int baked_lightmap_id; + + bool mirror :8; + bool depth_scale :8; + bool billboard :8; + bool billboard_y :8; + bool receive_shadows : 8; + bool visible : 8; + + float depth; //used for sorting + + SelfList<InstanceBase> dependency_item; + InstanceBase *baked_light; //baked light to use + SelfList<InstanceBase> baked_light_item; + + virtual void base_removed()=0; + virtual void base_changed()=0; + virtual void base_material_changed()=0; + + InstanceBase() : dependency_item(this), baked_light_item(this) { + + base_type=VS::INSTANCE_NONE; + cast_shadows=VS::SHADOW_CASTING_SETTING_ON; + receive_shadows=true; + depth_scale=false; + billboard=false; + billboard_y=false; + visible=true; + depth_layer=0; + layer_mask=1; + baked_light=NULL; + + + } + }; + + virtual RID light_instance_create(RID p_light)=0; + virtual void light_instance_set_transform(RID p_light_instance,const Transform& p_transform)=0; + virtual void light_instance_set_shadow_transform(RID p_light_instance,const CameraMatrix& p_projection,const Transform& p_transform,float p_far,float p_split,int p_pass)=0; + virtual void light_instance_mark_visible(RID p_light_instance)=0; + + virtual RID reflection_atlas_create()=0; + virtual void reflection_atlas_set_size(RID p_ref_atlas,int p_size)=0; + virtual void reflection_atlas_set_subdivision(RID p_ref_atlas,int p_subdiv)=0; + + virtual RID reflection_probe_instance_create(RID p_probe)=0; + virtual void reflection_probe_instance_set_transform(RID p_instance,const Transform& p_transform)=0; + virtual void reflection_probe_release_atlas_index(RID p_instance)=0; + virtual bool reflection_probe_instance_needs_redraw(RID p_instance)=0; + virtual bool reflection_probe_instance_has_reflection(RID p_instance)=0; + virtual bool reflection_probe_instance_begin_render(RID p_instance, RID p_reflection_atlas)=0; + virtual bool reflection_probe_instance_postprocess_step(RID p_instance)=0; + + virtual RID gi_probe_instance_create()=0; + virtual void gi_probe_instance_set_light_data(RID p_probe,RID p_base,RID p_data)=0; + virtual void gi_probe_instance_set_transform_to_data(RID p_probe,const Transform& p_xform)=0; + virtual void gi_probe_instance_set_bounds(RID p_probe,const Vector3& p_bounds)=0; + + virtual void render_scene(const Transform& p_cam_transform,const CameraMatrix& p_cam_projection,bool p_cam_ortogonal,InstanceBase** p_cull_result,int p_cull_count,RID* p_light_cull_result,int p_light_cull_count,RID* p_reflection_probe_cull_result,int p_reflection_probe_cull_count,RID p_environment,RID p_shadow_atlas,RID p_reflection_atlas,RID p_reflection_probe,int p_reflection_probe_pass)=0; + virtual void render_shadow(RID p_light,RID p_shadow_atlas,int p_pass,InstanceBase** p_cull_result,int p_cull_count)=0; + + virtual void set_scene_pass(uint64_t p_pass)=0; + + virtual bool free(RID p_rid)=0; + + virtual ~RasterizerScene() {} +}; + + + + + + + +class RasterizerStorage { +public: + /* TEXTURE API */ + + virtual RID texture_create()=0; + virtual void texture_allocate(RID p_texture,int p_width, int p_height,Image::Format p_format,uint32_t p_flags=VS::TEXTURE_FLAGS_DEFAULT)=0; + virtual void texture_set_data(RID p_texture,const Image& p_image,VS::CubeMapSide p_cube_side=VS::CUBEMAP_LEFT)=0; + virtual Image texture_get_data(RID p_texture,VS::CubeMapSide p_cube_side=VS::CUBEMAP_LEFT) const=0; + virtual void texture_set_flags(RID p_texture,uint32_t p_flags)=0; + virtual uint32_t texture_get_flags(RID p_texture) const=0; + virtual Image::Format texture_get_format(RID p_texture) const=0; + virtual uint32_t texture_get_width(RID p_texture) const=0; + virtual uint32_t texture_get_height(RID p_texture) const=0; + virtual void texture_set_size_override(RID p_texture,int p_width, int p_height)=0; + + virtual void texture_set_path(RID p_texture,const String& p_path)=0; + virtual String texture_get_path(RID p_texture) const=0; + + virtual void texture_set_shrink_all_x2_on_set_data(bool p_enable)=0; + + virtual void texture_debug_usage(List<VS::TextureInfo> *r_info)=0; + + virtual RID texture_create_radiance_cubemap(RID p_source,int p_resolution=-1) const=0; + + + virtual void textures_keep_original(bool p_enable)=0; + + /* SKYBOX API */ + + virtual RID skybox_create()=0; + virtual void skybox_set_texture(RID p_skybox,RID p_cube_map,int p_radiance_size)=0; + + /* SHADER API */ + + + virtual RID shader_create(VS::ShaderMode p_mode=VS::SHADER_SPATIAL)=0; + + virtual void shader_set_mode(RID p_shader,VS::ShaderMode p_mode)=0; + virtual VS::ShaderMode shader_get_mode(RID p_shader) const=0; + + virtual void shader_set_code(RID p_shader, const String& p_code)=0; + virtual String shader_get_code(RID p_shader) const=0; + virtual void shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list) const=0; + + virtual void shader_set_default_texture_param(RID p_shader, const StringName& p_name, RID p_texture)=0; + virtual RID shader_get_default_texture_param(RID p_shader, const StringName& p_name) const=0; + + + /* COMMON MATERIAL API */ + + virtual RID material_create()=0; + + virtual void material_set_shader(RID p_shader_material, RID p_shader)=0; + virtual RID material_get_shader(RID p_shader_material) const=0; + + virtual void material_set_param(RID p_material, const StringName& p_param, const Variant& p_value)=0; + virtual Variant material_get_param(RID p_material, const StringName& p_param) const=0; + + virtual void material_set_line_width(RID p_material, float p_width)=0; + + virtual bool material_is_animated(RID p_material)=0; + virtual bool material_casts_shadows(RID p_material)=0; + + virtual void material_add_instance_owner(RID p_material, RasterizerScene::InstanceBase *p_instance)=0; + virtual void material_remove_instance_owner(RID p_material, RasterizerScene::InstanceBase *p_instance)=0; + + /* MESH API */ + + virtual RID mesh_create()=0; + + virtual void mesh_add_surface(RID p_mesh,uint32_t p_format,VS::PrimitiveType p_primitive,const PoolVector<uint8_t>& p_array,int p_vertex_count,const PoolVector<uint8_t>& p_index_array,int p_index_count,const Rect3& p_aabb,const Vector<PoolVector<uint8_t> >& p_blend_shapes=Vector<PoolVector<uint8_t> >(),const Vector<Rect3>& p_bone_aabbs=Vector<Rect3>())=0; + + virtual void mesh_set_morph_target_count(RID p_mesh,int p_amount)=0; + virtual int mesh_get_morph_target_count(RID p_mesh) const=0; + + + virtual void mesh_set_morph_target_mode(RID p_mesh,VS::MorphTargetMode p_mode)=0; + virtual VS::MorphTargetMode mesh_get_morph_target_mode(RID p_mesh) const=0; + + virtual void mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material)=0; + virtual RID mesh_surface_get_material(RID p_mesh, int p_surface) const=0; + + virtual int mesh_surface_get_array_len(RID p_mesh, int p_surface) const=0; + virtual int mesh_surface_get_array_index_len(RID p_mesh, int p_surface) const=0; + + virtual PoolVector<uint8_t> mesh_surface_get_array(RID p_mesh, int p_surface) const=0; + virtual PoolVector<uint8_t> mesh_surface_get_index_array(RID p_mesh, int p_surface) const=0; + + + virtual uint32_t mesh_surface_get_format(RID p_mesh, int p_surface) const=0; + virtual VS::PrimitiveType mesh_surface_get_primitive_type(RID p_mesh, int p_surface) const=0; + + virtual Rect3 mesh_surface_get_aabb(RID p_mesh, int p_surface) const=0; + virtual Vector<PoolVector<uint8_t> > mesh_surface_get_blend_shapes(RID p_mesh, int p_surface) const=0; + virtual Vector<Rect3> mesh_surface_get_skeleton_aabb(RID p_mesh, int p_surface) const=0; + + virtual void mesh_remove_surface(RID p_mesh,int p_index)=0; + virtual int mesh_get_surface_count(RID p_mesh) const=0; + + virtual void mesh_set_custom_aabb(RID p_mesh,const Rect3& p_aabb)=0; + virtual Rect3 mesh_get_custom_aabb(RID p_mesh) const=0; + + virtual Rect3 mesh_get_aabb(RID p_mesh, RID p_skeleton) const=0; + virtual void mesh_clear(RID p_mesh)=0; + + /* MULTIMESH API */ + + + virtual RID multimesh_create()=0; + + virtual void multimesh_allocate(RID p_multimesh,int p_instances,VS::MultimeshTransformFormat p_transform_format,VS::MultimeshColorFormat p_color_format)=0; + virtual int multimesh_get_instance_count(RID p_multimesh) const=0; + + virtual void multimesh_set_mesh(RID p_multimesh,RID p_mesh)=0; + virtual void multimesh_instance_set_transform(RID p_multimesh,int p_index,const Transform& p_transform)=0; + virtual void multimesh_instance_set_transform_2d(RID p_multimesh,int p_index,const Transform2D& p_transform)=0; + virtual void multimesh_instance_set_color(RID p_multimesh,int p_index,const Color& p_color)=0; + + virtual RID multimesh_get_mesh(RID p_multimesh) const=0; + + virtual Transform multimesh_instance_get_transform(RID p_multimesh,int p_index) const=0; + virtual Transform2D multimesh_instance_get_transform_2d(RID p_multimesh,int p_index) const=0; + virtual Color multimesh_instance_get_color(RID p_multimesh,int p_index) const=0; + + virtual void multimesh_set_visible_instances(RID p_multimesh,int p_visible)=0; + virtual int multimesh_get_visible_instances(RID p_multimesh) const=0; + + virtual Rect3 multimesh_get_aabb(RID p_multimesh) const=0; + + /* IMMEDIATE API */ + + virtual RID immediate_create()=0; + virtual void immediate_begin(RID p_immediate,VS::PrimitiveType p_rimitive,RID p_texture=RID())=0; + virtual void immediate_vertex(RID p_immediate,const Vector3& p_vertex)=0; + virtual void immediate_normal(RID p_immediate,const Vector3& p_normal)=0; + virtual void immediate_tangent(RID p_immediate,const Plane& p_tangent)=0; + virtual void immediate_color(RID p_immediate,const Color& p_color)=0; + virtual void immediate_uv(RID p_immediate,const Vector2& tex_uv)=0; + virtual void immediate_uv2(RID p_immediate,const Vector2& tex_uv)=0; + virtual void immediate_end(RID p_immediate)=0; + virtual void immediate_clear(RID p_immediate)=0; + virtual void immediate_set_material(RID p_immediate,RID p_material)=0; + virtual RID immediate_get_material(RID p_immediate) const=0; + virtual Rect3 immediate_get_aabb(RID p_immediate) const=0; + + + /* SKELETON API */ + + virtual RID skeleton_create()=0; + virtual void skeleton_allocate(RID p_skeleton,int p_bones,bool p_2d_skeleton=false)=0; + virtual int skeleton_get_bone_count(RID p_skeleton) const=0; + virtual void skeleton_bone_set_transform(RID p_skeleton,int p_bone, const Transform& p_transform)=0; + virtual Transform skeleton_bone_get_transform(RID p_skeleton,int p_bone) const =0; + virtual void skeleton_bone_set_transform_2d(RID p_skeleton,int p_bone, const Transform2D& p_transform)=0; + virtual Transform2D skeleton_bone_get_transform_2d(RID p_skeleton,int p_bone) const=0; + + /* Light API */ + + virtual RID light_create(VS::LightType p_type)=0; + + virtual void light_set_color(RID p_light,const Color& p_color)=0; + virtual void light_set_param(RID p_light,VS::LightParam p_param,float p_value)=0; + virtual void light_set_shadow(RID p_light,bool p_enabled)=0; + virtual void light_set_shadow_color(RID p_light,const Color& p_color)=0; + virtual void light_set_projector(RID p_light,RID p_texture)=0; + virtual void light_set_negative(RID p_light,bool p_enable)=0; + virtual void light_set_cull_mask(RID p_light,uint32_t p_mask)=0; + + virtual void light_omni_set_shadow_mode(RID p_light,VS::LightOmniShadowMode p_mode)=0; + virtual void light_omni_set_shadow_detail(RID p_light,VS::LightOmniShadowDetail p_detail)=0; + + virtual void light_directional_set_shadow_mode(RID p_light,VS::LightDirectionalShadowMode p_mode)=0; + virtual void light_directional_set_blend_splits(RID p_light,bool p_enable)=0; + virtual bool light_directional_get_blend_splits(RID p_light) const=0; + + virtual VS::LightDirectionalShadowMode light_directional_get_shadow_mode(RID p_light)=0; + virtual VS::LightOmniShadowMode light_omni_get_shadow_mode(RID p_light)=0; + + virtual bool light_has_shadow(RID p_light) const=0; + + virtual VS::LightType light_get_type(RID p_light) const=0; + virtual Rect3 light_get_aabb(RID p_light) const=0; + virtual float light_get_param(RID p_light,VS::LightParam p_param)=0; + virtual Color light_get_color(RID p_light)=0; + virtual uint64_t light_get_version(RID p_light) const=0; + + + /* PROBE API */ + + virtual RID reflection_probe_create()=0; + + virtual void reflection_probe_set_update_mode(RID p_probe, VS::ReflectionProbeUpdateMode p_mode)=0; + virtual void reflection_probe_set_intensity(RID p_probe, float p_intensity)=0; + virtual void reflection_probe_set_interior_ambient(RID p_probe, const Color& p_ambient)=0; + virtual void reflection_probe_set_interior_ambient_energy(RID p_probe, float p_energy)=0; + virtual void reflection_probe_set_interior_ambient_probe_contribution(RID p_probe, float p_contrib)=0; + virtual void reflection_probe_set_max_distance(RID p_probe, float p_distance)=0; + virtual void reflection_probe_set_extents(RID p_probe, const Vector3& p_extents)=0; + virtual void reflection_probe_set_origin_offset(RID p_probe, const Vector3& p_offset)=0; + virtual void reflection_probe_set_as_interior(RID p_probe, bool p_enable)=0; + virtual void reflection_probe_set_enable_box_projection(RID p_probe, bool p_enable)=0; + virtual void reflection_probe_set_enable_shadows(RID p_probe, bool p_enable)=0; + virtual void reflection_probe_set_cull_mask(RID p_probe, uint32_t p_layers)=0; + + virtual Rect3 reflection_probe_get_aabb(RID p_probe) const=0; + virtual VS::ReflectionProbeUpdateMode reflection_probe_get_update_mode(RID p_probe) const=0; + virtual uint32_t reflection_probe_get_cull_mask(RID p_probe) const=0; + virtual Vector3 reflection_probe_get_extents(RID p_probe) const=0; + virtual Vector3 reflection_probe_get_origin_offset(RID p_probe) const=0; + virtual float reflection_probe_get_origin_max_distance(RID p_probe) const=0; + virtual bool reflection_probe_renders_shadows(RID p_probe) const=0; + + + /* ROOM API */ + + virtual RID room_create()=0; + virtual void room_add_bounds(RID p_room, const PoolVector<Vector2>& p_convex_polygon,float p_height,const Transform& p_transform)=0; + virtual void room_clear_bounds(RID p_room)=0; + + /* PORTAL API */ + + // portals are only (x/y) points, forming a convex shape, which its clockwise + // order points outside. (z is 0)=0; + + virtual RID portal_create()=0; + virtual void portal_set_shape(RID p_portal, const Vector<Point2>& p_shape)=0; + virtual void portal_set_enabled(RID p_portal, bool p_enabled)=0; + virtual void portal_set_disable_distance(RID p_portal, float p_distance)=0; + virtual void portal_set_disabled_color(RID p_portal, const Color& p_color)=0; + + virtual void instance_add_skeleton(RID p_skeleton,RasterizerScene::InstanceBase *p_instance)=0; + virtual void instance_remove_skeleton(RID p_skeleton,RasterizerScene::InstanceBase *p_instance)=0; + + virtual void instance_add_dependency(RID p_base,RasterizerScene::InstanceBase *p_instance)=0; + virtual void instance_remove_dependency(RID p_base,RasterizerScene::InstanceBase *p_instance)=0; + + /* GI PROBE API */ + + virtual RID gi_probe_create()=0; + + virtual void gi_probe_set_bounds(RID p_probe,const Rect3& p_bounds)=0; + virtual Rect3 gi_probe_get_bounds(RID p_probe) const=0; + + virtual void gi_probe_set_cell_size(RID p_probe,float p_range)=0; + virtual float gi_probe_get_cell_size(RID p_probe) const=0; + + virtual void gi_probe_set_to_cell_xform(RID p_probe,const Transform& p_xform)=0; + virtual Transform gi_probe_get_to_cell_xform(RID p_probe) const=0; + + virtual void gi_probe_set_dynamic_data(RID p_probe,const PoolVector<int>& p_data)=0; + virtual PoolVector<int> gi_probe_get_dynamic_data(RID p_probe) const=0; + + virtual void gi_probe_set_dynamic_range(RID p_probe,int p_range)=0; + virtual int gi_probe_get_dynamic_range(RID p_probe) const=0; + + virtual void gi_probe_set_energy(RID p_probe,float p_range)=0; + virtual float gi_probe_get_energy(RID p_probe) const=0; + + virtual void gi_probe_set_interior(RID p_probe,bool p_enable)=0; + virtual bool gi_probe_is_interior(RID p_probe) const=0; + + virtual void gi_probe_set_compress(RID p_probe,bool p_enable)=0; + virtual bool gi_probe_is_compressed(RID p_probe) const=0; + + virtual uint32_t gi_probe_get_version(RID p_probe)=0; + + enum GIProbeCompression { + GI_PROBE_UNCOMPRESSED, + GI_PROBE_S3TC, + GI_PROBE_ETC2 + }; + + virtual GIProbeCompression gi_probe_get_dynamic_data_get_preferred_compression() const=0; + virtual RID gi_probe_dynamic_data_create(int p_width,int p_height,int p_depth,GIProbeCompression p_compression)=0; + virtual void gi_probe_dynamic_data_update(RID p_gi_probe_data,int p_depth_slice,int p_slice_count,int p_mipmap,const void* p_data)=0; + + + /* PARTICLES */ + + virtual RID particles_create()=0; + + virtual void particles_set_emitting(RID p_particles,bool p_emitting)=0; + virtual void particles_set_amount(RID p_particles,int p_amount)=0; + virtual void particles_set_lifetime(RID p_particles,float p_lifetime)=0; + virtual void particles_set_pre_process_time(RID p_particles,float p_time)=0; + virtual void particles_set_explosiveness_ratio(RID p_particles,float p_ratio)=0; + virtual void particles_set_randomness_ratio(RID p_particles,float p_ratio)=0; + virtual void particles_set_custom_aabb(RID p_particles,const Rect3& p_aabb)=0; + virtual void particles_set_gravity(RID p_particles,const Vector3& p_gravity)=0; + virtual void particles_set_use_local_coordinates(RID p_particles,bool p_enable)=0; + virtual void particles_set_process_material(RID p_particles,RID p_material)=0; + + virtual void particles_set_emission_shape(RID p_particles,VS::ParticlesEmissionShape p_shape)=0; + virtual void particles_set_emission_sphere_radius(RID p_particles,float p_radius)=0; + virtual void particles_set_emission_box_extents(RID p_particles,const Vector3& p_extents)=0; + virtual void particles_set_emission_points(RID p_particles,const PoolVector<Vector3>& p_points)=0; + + + virtual void particles_set_draw_order(RID p_particles,VS::ParticlesDrawOrder p_order)=0; + + virtual void particles_set_draw_passes(RID p_particles,int p_count)=0; + virtual void particles_set_draw_pass_material(RID p_particles,int p_pass, RID p_material)=0; + virtual void particles_set_draw_pass_mesh(RID p_particles,int p_pass, RID p_mesh)=0; + + virtual Rect3 particles_get_current_aabb(RID p_particles)=0; + + + + /* RENDER TARGET */ + + enum RenderTargetFlags { + RENDER_TARGET_VFLIP, + RENDER_TARGET_TRANSPARENT, + RENDER_TARGET_NO_3D, + RENDER_TARGET_NO_SAMPLING, + RENDER_TARGET_HDR, + RENDER_TARGET_FLAG_MAX + }; + + virtual RID render_target_create()=0; + virtual void render_target_set_size(RID p_render_target,int p_width, int p_height)=0; + virtual RID render_target_get_texture(RID p_render_target) const=0; + virtual void render_target_set_flag(RID p_render_target,RenderTargetFlags p_flag,bool p_value)=0; + virtual bool render_target_renedered_in_frame(RID p_render_target)=0; + virtual void render_target_set_msaa(RID p_render_target,VS::ViewportMSAA p_msaa)=0; + + + /* CANVAS SHADOW */ + + virtual RID canvas_light_shadow_buffer_create(int p_width)=0; + + /* LIGHT SHADOW MAPPING */ + + virtual RID canvas_light_occluder_create()=0; + virtual void canvas_light_occluder_set_polylines(RID p_occluder, const PoolVector<Vector2>& p_lines)=0; + + + virtual VS::InstanceType get_base_type(RID p_rid) const=0; + virtual bool free(RID p_rid)=0; + + + static RasterizerStorage*base_signleton; + RasterizerStorage(); + virtual ~RasterizerStorage() {} +}; + + + + + +class RasterizerCanvas { +public: + + enum CanvasRectFlags { + + CANVAS_RECT_REGION=1, + CANVAS_RECT_TILE=2, + CANVAS_RECT_FLIP_H=4, + CANVAS_RECT_FLIP_V=8, + CANVAS_RECT_TRANSPOSE=16 + }; + + + struct Light : public RID_Data { + + + + bool enabled; + Color color; + Transform2D xform; + float height; + float energy; + float scale; + int z_min; + int z_max; + int layer_min; + int layer_max; + int item_mask; + int item_shadow_mask; + VS::CanvasLightMode mode; + RID texture; + Vector2 texture_offset; + RID canvas; + RID shadow_buffer; + int shadow_buffer_size; + float shadow_gradient_length; + VS::CanvasLightShadowFilter shadow_filter; + Color shadow_color; + + + void *texture_cache; // implementation dependent + Rect2 rect_cache; + Transform2D xform_cache; + float radius_cache; //used for shadow far plane + CameraMatrix shadow_matrix_cache; + + Transform2D light_shader_xform; + Vector2 light_shader_pos; + + Light *shadows_next_ptr; + Light *filter_next_ptr; + Light *next_ptr; + Light *mask_next_ptr; + + RID light_internal; + + Light() { + enabled=true; + color=Color(1,1,1); + shadow_color=Color(0,0,0,0); + height=0; + z_min=-1024; + z_max=1024; + layer_min=0; + layer_max=0; + item_mask=1; + scale=1.0; + energy=1.0; + item_shadow_mask=-1; + mode=VS::CANVAS_LIGHT_MODE_ADD; + texture_cache=NULL; + next_ptr=NULL; + mask_next_ptr=NULL; + filter_next_ptr=NULL; + shadow_buffer_size=256; + shadow_gradient_length=0; + shadow_filter=VS::CANVAS_LIGHT_FILTER_NONE; + + } + }; + + virtual RID light_internal_create()=0; + virtual void light_internal_update(RID p_rid, Light* p_light)=0; + virtual void light_internal_free(RID p_rid)=0; + + struct Item : public RID_Data { + + struct Command { + + enum Type { + + TYPE_LINE, + TYPE_RECT, + TYPE_NINEPATCH, + TYPE_PRIMITIVE, + TYPE_POLYGON, + TYPE_MESH, + TYPE_MULTIMESH, + TYPE_CIRCLE, + TYPE_TRANSFORM, + TYPE_CLIP_IGNORE, + }; + + Type type; + virtual ~Command(){} + }; + + struct CommandLine : public Command { + + Point2 from,to; + Color color; + float width; + bool antialiased; + CommandLine() { type = TYPE_LINE; } + }; + + struct CommandRect : public Command { + + Rect2 rect; + RID texture; + Color modulate; + Rect2 source; + uint8_t flags; + + CommandRect() { flags=0; type = TYPE_RECT; } + }; + + struct CommandNinePatch : public Command { + + Rect2 rect; + Rect2 source; + RID texture; + float margin[4]; + bool draw_center; + Color color; + VS::NinePatchAxisMode axis_x; + VS::NinePatchAxisMode axis_y; + CommandNinePatch() { draw_center=true; type = TYPE_NINEPATCH; } + }; + + struct CommandPrimitive : public Command { + + Vector<Point2> points; + Vector<Point2> uvs; + Vector<Color> colors; + RID texture; + float width; + + CommandPrimitive() { type = TYPE_PRIMITIVE; width=1;} + }; + + struct CommandPolygon : public Command { + + Vector<int> indices; + Vector<Point2> points; + Vector<Point2> uvs; + Vector<Color> colors; + RID texture; + int count; + + CommandPolygon() { type = TYPE_POLYGON; count = 0; } + }; + + + struct CommandMesh : public Command { + + RID mesh; + RID skeleton; + CommandMesh() { type = TYPE_MESH; } + }; + + struct CommandMultiMesh : public Command { + + RID multimesh; + RID skeleton; + CommandMultiMesh() { type = TYPE_MULTIMESH; } + }; + + struct CommandCircle : public Command { + + Point2 pos; + float radius; + Color color; + CommandCircle() { type = TYPE_CIRCLE; } + }; + + struct CommandTransform : public Command { + + Transform2D xform; + CommandTransform() { type = TYPE_TRANSFORM; } + }; + + + struct CommandClipIgnore : public Command { + + bool ignore; + CommandClipIgnore() { type = TYPE_CLIP_IGNORE; ignore=false; } + }; + + + struct ViewportRender { + VisualServer*owner; + void* udata; + Rect2 rect; + }; + + Transform2D xform; + bool clip; + bool visible; + bool behind; + //VS::MaterialBlendMode blend_mode; + int light_mask; + Vector<Command*> commands; + mutable bool custom_rect; + mutable bool rect_dirty; + mutable Rect2 rect; + RID material; + Item*next; + + struct CopyBackBuffer { + Rect2 rect; + Rect2 screen_rect; + bool full; + }; + CopyBackBuffer *copy_back_buffer; + + + Color final_modulate; + Transform2D final_transform; + Rect2 final_clip_rect; + Item* final_clip_owner; + Item* material_owner; + ViewportRender *vp_render; + bool distance_field; + bool light_masked; + + Rect2 global_rect_cache; + + const Rect2& get_rect() const { + if (custom_rect || !rect_dirty) + return rect; + + //must update rect + int s=commands.size(); + if (s==0) { + + rect=Rect2(); + rect_dirty=false; + return rect; + } + + Transform2D xf; + bool found_xform=false; + bool first=true; + + const Item::Command * const *cmd = &commands[0]; + + + for (int i=0;i<s;i++) { + + const Item::Command *c=cmd[i]; + Rect2 r; + + switch(c->type) { + case Item::Command::TYPE_LINE: { + + const Item::CommandLine* line = static_cast< const Item::CommandLine*>(c); + r.pos=line->from; + r.expand_to(line->to); + } break; + case Item::Command::TYPE_RECT: { + + const Item::CommandRect* crect = static_cast< const Item::CommandRect*>(c); + r=crect->rect; + + } break; + case Item::Command::TYPE_NINEPATCH: { + + const Item::CommandNinePatch* style = static_cast< const Item::CommandNinePatch*>(c); + r=style->rect; + } break; + case Item::Command::TYPE_PRIMITIVE: { + + const Item::CommandPrimitive* primitive = static_cast< const Item::CommandPrimitive*>(c); + r.pos=primitive->points[0]; + for(int i=1;i<primitive->points.size();i++) { + + r.expand_to(primitive->points[i]); + + } + } break; + case Item::Command::TYPE_POLYGON: { + + const Item::CommandPolygon* polygon = static_cast< const Item::CommandPolygon*>(c); + int l = polygon->points.size(); + const Point2*pp=&polygon->points[0]; + r.pos=pp[0]; + for(int i=1;i<l;i++) { + + r.expand_to(pp[i]); + + } + } break; + case Item::Command::TYPE_MESH: { + + const Item::CommandMesh* mesh = static_cast< const Item::CommandMesh*>(c); + Rect3 aabb = RasterizerStorage::base_signleton->mesh_get_aabb(mesh->mesh,mesh->skeleton); + + r=Rect2(aabb.pos.x,aabb.pos.y,aabb.size.x,aabb.size.y); + + } break; + case Item::Command::TYPE_MULTIMESH: { + + const Item::CommandMultiMesh* multimesh = static_cast< const Item::CommandMultiMesh*>(c); + Rect3 aabb = RasterizerStorage::base_signleton->multimesh_get_aabb(multimesh->multimesh); + + r=Rect2(aabb.pos.x,aabb.pos.y,aabb.size.x,aabb.size.y); + + } break; + case Item::Command::TYPE_CIRCLE: { + + const Item::CommandCircle* circle = static_cast< const Item::CommandCircle*>(c); + r.pos=Point2(-circle->radius,-circle->radius)+circle->pos; + r.size=Point2(circle->radius*2.0,circle->radius*2.0); + } break; + case Item::Command::TYPE_TRANSFORM: { + + const Item::CommandTransform* transform = static_cast<const Item::CommandTransform*>(c); + xf=transform->xform; + found_xform=true; + continue; + } break; + + case Item::Command::TYPE_CLIP_IGNORE: { + + } break; + } + + if (found_xform) { + r = xf.xform(r); + found_xform=false; + } + + + if (first) { + rect=r; + first=false; + } else + rect=rect.merge(r); + } + + rect_dirty=false; + return rect; + } + + void clear() { for (int i=0;i<commands.size();i++) memdelete( commands[i] ); commands.clear(); clip=false; rect_dirty=true; final_clip_owner=NULL; material_owner=NULL; light_masked=false; } + Item() { light_mask=1; vp_render=NULL; next=NULL; final_clip_owner=NULL; clip=false; final_modulate=Color(1,1,1,1); visible=true; rect_dirty=true; custom_rect=false; behind=false; material_owner=NULL; copy_back_buffer=NULL; distance_field=false; light_masked=false; } + virtual ~Item() { clear(); if (copy_back_buffer) memdelete(copy_back_buffer); } + }; + + + virtual void canvas_begin()=0; + + virtual void canvas_render_items(Item *p_item_list,int p_z,const Color& p_modulate,Light *p_light)=0; + virtual void canvas_debug_viewport_shadows(Light* p_lights_with_shadow)=0; + + + + struct LightOccluderInstance : public RID_Data { + + + bool enabled; + RID canvas; + RID polygon; + RID polygon_buffer; + Rect2 aabb_cache; + Transform2D xform; + Transform2D xform_cache; + int light_mask; + VS::CanvasOccluderPolygonCullMode cull_cache; + + LightOccluderInstance *next; + + LightOccluderInstance() { enabled=true; next=NULL; light_mask=1; cull_cache=VS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED; } + }; + + + + virtual void canvas_light_shadow_buffer_update(RID p_buffer, const Transform2D& p_light_xform, int p_light_mask,float p_near, float p_far, LightOccluderInstance* p_occluders, CameraMatrix *p_xform_cache)=0; + + + virtual void reset_canvas()=0; + + virtual ~RasterizerCanvas() {} +}; + + +class Rasterizer { +protected: + static Rasterizer* (*_create_func)(); +public: + static Rasterizer *create(); + + virtual RasterizerStorage *get_storage()=0; + virtual RasterizerCanvas *get_canvas()=0; + virtual RasterizerScene *get_scene()=0; + + virtual void initialize()=0; + virtual void begin_frame()=0; + virtual void set_current_render_target(RID p_render_target)=0; + virtual void restore_render_target()=0; + virtual void clear_render_target(const Color& p_color)=0; + virtual void blit_render_target_to_screen(RID p_render_target,const Rect2& p_screen_rect,int p_screen=0)=0; + virtual void end_frame()=0; + virtual void finalize()=0; + + + virtual ~Rasterizer() {} +}; + + +#if 0 /** @author Juan Linietsky <reduzio@gmail.com> */ @@ -41,7 +956,7 @@ class Rasterizer { protected: - typedef void (*CanvasItemDrawViewportFunc)(VisualServer*owner,void*ud,const Rect2& p_rect); + typedef void (*ItemDrawViewportFunc)(VisualServer*owner,void*ud,const Rect2& p_rect); RID create_default_material(); RID create_overdraw_debug_material(); @@ -49,7 +964,7 @@ protected: /* Fixed Material Shader API */ - union FixedMaterialShaderKey { + union FixedSpatialMaterialShaderKey { struct { uint16_t texcoord_mask; @@ -65,21 +980,21 @@ protected: uint32_t key; - _FORCE_INLINE_ bool operator<(const FixedMaterialShaderKey& p_key) const { return key<p_key.key; } + _FORCE_INLINE_ bool operator<(const FixedSpatialMaterialShaderKey& p_key) const { return key<p_key.key; } }; - struct FixedMaterialShader { + struct FixedSpatialMaterialShader { int refcount; RID shader; }; - Map<FixedMaterialShaderKey,FixedMaterialShader> fixed_material_shaders; + Map<FixedSpatialMaterialShaderKey,FixedSpatialMaterialShader> fixed_material_shaders; - RID _create_shader(const FixedMaterialShaderKey& p_key); - void _free_shader(const FixedMaterialShaderKey& p_key); + RID _create_shader(const FixedSpatialMaterialShaderKey& p_key); + void _free_shader(const FixedSpatialMaterialShaderKey& p_key); - struct FixedMaterial { + struct FixedSpatialMaterial { RID self; @@ -90,19 +1005,19 @@ protected: bool use_xy_normalmap; float point_size; Transform uv_xform; - VS::FixedMaterialLightShader light_shader; + VS::FixedSpatialMaterialLightShader light_shader; RID texture[VS::FIXED_MATERIAL_PARAM_MAX]; Variant param[VS::FIXED_MATERIAL_PARAM_MAX]; - VS::FixedMaterialTexCoordMode texture_tc[VS::FIXED_MATERIAL_PARAM_MAX]; + VS::FixedSpatialMaterialTexCoordMode texture_tc[VS::FIXED_MATERIAL_PARAM_MAX]; - SelfList<FixedMaterial> dirty_list; + SelfList<FixedSpatialMaterial> dirty_list; - FixedMaterialShaderKey current_key; + FixedSpatialMaterialShaderKey current_key; - _FORCE_INLINE_ FixedMaterialShaderKey get_key() const { + _FORCE_INLINE_ FixedSpatialMaterialShaderKey get_key() const { - FixedMaterialShaderKey k; + FixedSpatialMaterialShaderKey k; k.key=0; k.use_alpha=use_alpha; k.use_color_array=use_color_array; @@ -123,7 +1038,7 @@ protected: } - FixedMaterial() : dirty_list(this) { + FixedSpatialMaterial() : dirty_list(this) { use_alpha=false; use_color_array=false; @@ -155,9 +1070,9 @@ protected: StringName _fixed_material_uv_xform_name; StringName _fixed_material_point_size_name; - Map<RID,FixedMaterial*> fixed_materials; + Map<RID,FixedSpatialMaterial*> fixed_materials; - SelfList<FixedMaterial>::List fixed_material_dirty_list; + SelfList<FixedSpatialMaterial>::List fixed_material_dirty_list; protected: void _update_fixed_materials(); @@ -244,23 +1159,23 @@ public: virtual RID fixed_material_create(); - virtual void fixed_material_set_flag(RID p_material, VS::FixedMaterialFlags p_flag, bool p_enabled); - virtual bool fixed_material_get_flag(RID p_material, VS::FixedMaterialFlags p_flag) const; + virtual void fixed_material_set_flag(RID p_material, VS::FixedSpatialMaterialFlags p_flag, bool p_enabled); + virtual bool fixed_material_get_flag(RID p_material, VS::FixedSpatialMaterialFlags p_flag) const; - virtual void fixed_material_set_parameter(RID p_material, VS::FixedMaterialParam p_parameter, const Variant& p_value); - virtual Variant fixed_material_get_parameter(RID p_material,VS::FixedMaterialParam p_parameter) const; + virtual void fixed_material_set_parameter(RID p_material, VS::FixedSpatialMaterialParam p_parameter, const Variant& p_value); + virtual Variant fixed_material_get_parameter(RID p_material,VS::FixedSpatialMaterialParam p_parameter) const; - virtual void fixed_material_set_texture(RID p_material,VS::FixedMaterialParam p_parameter, RID p_texture); - virtual RID fixed_material_get_texture(RID p_material,VS::FixedMaterialParam p_parameter) const; + virtual void fixed_material_set_texture(RID p_material,VS::FixedSpatialMaterialParam p_parameter, RID p_texture); + virtual RID fixed_material_get_texture(RID p_material,VS::FixedSpatialMaterialParam p_parameter) const; - virtual void fixed_material_set_texcoord_mode(RID p_material,VS::FixedMaterialParam p_parameter, VS::FixedMaterialTexCoordMode p_mode); - virtual VS::FixedMaterialTexCoordMode fixed_material_get_texcoord_mode(RID p_material,VS::FixedMaterialParam p_parameter) const; + virtual void fixed_material_set_texcoord_mode(RID p_material,VS::FixedSpatialMaterialParam p_parameter, VS::FixedSpatialMaterialTexCoordMode p_mode); + virtual VS::FixedSpatialMaterialTexCoordMode fixed_material_get_texcoord_mode(RID p_material,VS::FixedSpatialMaterialParam p_parameter) const; virtual void fixed_material_set_uv_transform(RID p_material,const Transform& p_transform); virtual Transform fixed_material_get_uv_transform(RID p_material) const; - virtual void fixed_material_set_light_shader(RID p_material,VS::FixedMaterialLightShader p_shader); - virtual VS::FixedMaterialLightShader fixed_material_get_light_shader(RID p_material) const; + virtual void fixed_material_set_light_shader(RID p_material,VS::FixedSpatialMaterialLightShader p_shader); + virtual VS::FixedSpatialMaterialLightShader fixed_material_get_light_shader(RID p_material) const; virtual void fixed_material_set_point_size(RID p_material,float p_size); virtual float fixed_material_get_point_size(RID p_material) const; @@ -360,8 +1275,8 @@ public: virtual void particles_set_emission_base_velocity(RID p_particles, const Vector3& p_base_velocity)=0; virtual Vector3 particles_get_emission_base_velocity(RID p_particles) const=0; - virtual void particles_set_emission_points(RID p_particles, const DVector<Vector3>& p_points)=0; - virtual DVector<Vector3> particles_get_emission_points(RID p_particles) const=0; + virtual void particles_set_emission_points(RID p_particles, const PoolVector<Vector3>& p_points)=0; + virtual PoolVector<Vector3> particles_get_emission_points(RID p_particles) const=0; virtual void particles_set_gravity_normal(RID p_particles, const Vector3& p_normal)=0; virtual Vector3 particles_get_gravity_normal(RID p_particles) const=0; @@ -581,7 +1496,7 @@ public: }; - struct CanvasLight { + struct Light { @@ -597,7 +1512,7 @@ public: int layer_max; int item_mask; int item_shadow_mask; - VS::CanvasLightMode mode; + VS::LightMode mode; RID texture; Vector2 texture_offset; RID canvas; @@ -616,12 +1531,12 @@ public: Matrix32 light_shader_xform; Vector2 light_shader_pos; - CanvasLight *shadows_next_ptr; - CanvasLight *filter_next_ptr; - CanvasLight *next_ptr; - CanvasLight *mask_next_ptr; + Light *shadows_next_ptr; + Light *filter_next_ptr; + Light *next_ptr; + Light *mask_next_ptr; - CanvasLight() { + Light() { enabled=true; color=Color(1,1,1); shadow_color=Color(0,0,0,0); @@ -645,20 +1560,20 @@ public: } }; - struct CanvasItem; + struct Item; - struct CanvasItemMaterial { + struct ItemMaterial { RID shader; Map<StringName,Variant> shader_param; uint32_t shader_version; - Set<CanvasItem*> owners; - VS::CanvasItemShadingMode shading_mode; + Set<Item*> owners; + VS::ItemShadingMode shading_mode; - CanvasItemMaterial() {shading_mode=VS::CANVAS_ITEM_SHADING_NORMAL; shader_version=0; } + ItemMaterial() {shading_mode=VS::CANVAS_ITEM_SHADING_NORMAL; shader_version=0; } }; - struct CanvasItem { + struct Item { struct Command { @@ -788,8 +1703,8 @@ public: mutable bool custom_rect; mutable bool rect_dirty; mutable Rect2 rect; - CanvasItem*next; - CanvasItemMaterial* material; + Item*next; + ItemMaterial* material; struct CopyBackBuffer { Rect2 rect; Rect2 screen_rect; @@ -801,8 +1716,8 @@ public: float final_opacity; Matrix32 final_transform; Rect2 final_clip_rect; - CanvasItem* final_clip_owner; - CanvasItem* material_owner; + Item* final_clip_owner; + Item* material_owner; ViewportRender *vp_render; bool distance_field; bool light_masked; @@ -826,35 +1741,35 @@ public: bool found_xform=false; bool first=true; - const CanvasItem::Command * const *cmd = &commands[0]; + const Item::Command * const *cmd = &commands[0]; for (int i=0;i<s;i++) { - const CanvasItem::Command *c=cmd[i]; + const Item::Command *c=cmd[i]; Rect2 r; switch(c->type) { - case CanvasItem::Command::TYPE_LINE: { + case Item::Command::TYPE_LINE: { - const CanvasItem::CommandLine* line = static_cast< const CanvasItem::CommandLine*>(c); + const Item::CommandLine* line = static_cast< const Item::CommandLine*>(c); r.pos=line->from; r.expand_to(line->to); } break; - case CanvasItem::Command::TYPE_RECT: { + case Item::Command::TYPE_RECT: { - const CanvasItem::CommandRect* crect = static_cast< const CanvasItem::CommandRect*>(c); + const Item::CommandRect* crect = static_cast< const Item::CommandRect*>(c); r=crect->rect; } break; - case CanvasItem::Command::TYPE_STYLE: { + case Item::Command::TYPE_STYLE: { - const CanvasItem::CommandStyle* style = static_cast< const CanvasItem::CommandStyle*>(c); + const Item::CommandStyle* style = static_cast< const Item::CommandStyle*>(c); r=style->rect; } break; - case CanvasItem::Command::TYPE_PRIMITIVE: { + case Item::Command::TYPE_PRIMITIVE: { - const CanvasItem::CommandPrimitive* primitive = static_cast< const CanvasItem::CommandPrimitive*>(c); + const Item::CommandPrimitive* primitive = static_cast< const Item::CommandPrimitive*>(c); r.pos=primitive->points[0]; for(int i=1;i<primitive->points.size();i++) { @@ -862,9 +1777,9 @@ public: } } break; - case CanvasItem::Command::TYPE_POLYGON: { + case Item::Command::TYPE_POLYGON: { - const CanvasItem::CommandPolygon* polygon = static_cast< const CanvasItem::CommandPolygon*>(c); + const Item::CommandPolygon* polygon = static_cast< const Item::CommandPolygon*>(c); int l = polygon->points.size(); const Point2*pp=&polygon->points[0]; r.pos=pp[0]; @@ -875,9 +1790,9 @@ public: } } break; - case CanvasItem::Command::TYPE_POLYGON_PTR: { + case Item::Command::TYPE_POLYGON_PTR: { - const CanvasItem::CommandPolygonPtr* polygon = static_cast< const CanvasItem::CommandPolygonPtr*>(c); + const Item::CommandPolygonPtr* polygon = static_cast< const Item::CommandPolygonPtr*>(c); int l = polygon->count; if (polygon->indices != NULL) { @@ -894,23 +1809,23 @@ public: } } } break; - case CanvasItem::Command::TYPE_CIRCLE: { + case Item::Command::TYPE_CIRCLE: { - const CanvasItem::CommandCircle* circle = static_cast< const CanvasItem::CommandCircle*>(c); + const Item::CommandCircle* circle = static_cast< const Item::CommandCircle*>(c); r.pos=Point2(-circle->radius,-circle->radius)+circle->pos; r.size=Point2(circle->radius*2.0,circle->radius*2.0); } break; - case CanvasItem::Command::TYPE_TRANSFORM: { + case Item::Command::TYPE_TRANSFORM: { - const CanvasItem::CommandTransform* transform = static_cast<const CanvasItem::CommandTransform*>(c); + const Item::CommandTransform* transform = static_cast<const Item::CommandTransform*>(c); xf=transform->xform; found_xform=true; continue; } break; - case CanvasItem::Command::TYPE_BLEND_MODE: { + case Item::Command::TYPE_BLEND_MODE: { } break; - case CanvasItem::Command::TYPE_CLIP_IGNORE: { + case Item::Command::TYPE_CLIP_IGNORE: { } break; } @@ -933,12 +1848,12 @@ public: } void clear() { for (int i=0;i<commands.size();i++) memdelete( commands[i] ); commands.clear(); clip=false; rect_dirty=true; final_clip_owner=NULL; material_owner=NULL; light_masked=false; } - CanvasItem() { light_mask=1; vp_render=NULL; next=NULL; final_clip_owner=NULL; clip=false; final_opacity=1; blend_mode=VS::MATERIAL_BLEND_MODE_MIX; visible=true; rect_dirty=true; custom_rect=false; ontop=true; material_owner=NULL; material=NULL; copy_back_buffer=NULL; distance_field=false; light_masked=false; } - virtual ~CanvasItem() { clear(); if (copy_back_buffer) memdelete(copy_back_buffer); } + Item() { light_mask=1; vp_render=NULL; next=NULL; final_clip_owner=NULL; clip=false; final_opacity=1; blend_mode=VS::MATERIAL_BLEND_MODE_MIX; visible=true; rect_dirty=true; custom_rect=false; ontop=true; material_owner=NULL; material=NULL; copy_back_buffer=NULL; distance_field=false; light_masked=false; } + virtual ~Item() { clear(); if (copy_back_buffer) memdelete(copy_back_buffer); } }; - CanvasItemDrawViewportFunc draw_viewport_func; + ItemDrawViewportFunc draw_viewport_func; virtual void begin_canvas_bg()=0; @@ -956,17 +1871,17 @@ public: virtual void canvas_draw_polygon(int p_vertex_count, const int* p_indices, const Vector2* p_vertices, const Vector2* p_uvs, const Color* p_colors,const RID& p_texture,bool p_singlecolor)=0; virtual void canvas_set_transform(const Matrix32& p_transform)=0; - virtual void canvas_render_items(CanvasItem *p_item_list,int p_z,const Color& p_modulate,CanvasLight *p_light)=0; - virtual void canvas_debug_viewport_shadows(CanvasLight* p_lights_with_shadow)=0; + virtual void canvas_render_items(Item *p_item_list,int p_z,const Color& p_modulate,Light *p_light)=0; + virtual void canvas_debug_viewport_shadows(Light* p_lights_with_shadow)=0; /* LIGHT SHADOW MAPPING */ virtual RID canvas_light_occluder_create()=0; - virtual void canvas_light_occluder_set_polylines(RID p_occluder, const DVector<Vector2>& p_lines)=0; + virtual void canvas_light_occluder_set_polylines(RID p_occluder, const PoolVector<Vector2>& p_lines)=0; virtual RID canvas_light_shadow_buffer_create(int p_width)=0; - struct CanvasLightOccluderInstance { + struct LightOccluderInstance { bool enabled; @@ -979,14 +1894,14 @@ public: int light_mask; VS::CanvasOccluderPolygonCullMode cull_cache; - CanvasLightOccluderInstance *next; + LightOccluderInstance *next; - CanvasLightOccluderInstance() { enabled=true; next=NULL; light_mask=1; cull_cache=VS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED; } + LightOccluderInstance() { enabled=true; next=NULL; light_mask=1; cull_cache=VS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED; } }; - virtual void canvas_light_shadow_buffer_update(RID p_buffer, const Matrix32& p_light_xform, int p_light_mask,float p_near, float p_far, CanvasLightOccluderInstance* p_occluders, CameraMatrix *p_xform_cache)=0; + virtual void canvas_light_shadow_buffer_update(RID p_buffer, const Matrix32& p_light_xform, int p_light_mask,float p_near, float p_far, LightOccluderInstance* p_occluders, CameraMatrix *p_xform_cache)=0; /* ENVIRONMENT */ @@ -1050,5 +1965,5 @@ public: }; - +#endif #endif diff --git a/servers/visual/rasterizer_dummy.cpp b/servers/visual/rasterizer_dummy.cpp deleted file mode 100644 index edbdc2fe23..0000000000 --- a/servers/visual/rasterizer_dummy.cpp +++ /dev/null @@ -1,1961 +0,0 @@ -/*************************************************************************/ -/* rasterizer_dummy.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "rasterizer_dummy.h" - -/* TEXTURE API */ - - -RID RasterizerDummy::texture_create() { - - Texture *texture = memnew(Texture); - ERR_FAIL_COND_V(!texture,RID()); - return texture_owner.make_rid( texture ); - -} - -void RasterizerDummy::texture_allocate(RID p_texture,int p_width, int p_height,Image::Format p_format,uint32_t p_flags) { - - - Texture *texture = texture_owner.get( p_texture ); - ERR_FAIL_COND(!texture); - texture->width=p_width; - texture->height=p_height; - texture->format=p_format; - texture->flags=p_flags; -} - -void RasterizerDummy::texture_set_data(RID p_texture,const Image& p_image,VS::CubeMapSide p_cube_side) { - - Texture * texture = texture_owner.get(p_texture); - - ERR_FAIL_COND(!texture); - ERR_FAIL_COND(texture->format != p_image.get_format() ); - - texture->image[p_cube_side]=p_image; - -} - -Image RasterizerDummy::texture_get_data(RID p_texture,VS::CubeMapSide p_cube_side) const { - - Texture * texture = texture_owner.get(p_texture); - - ERR_FAIL_COND_V(!texture,Image()); - - return texture->image[p_cube_side]; -} - -void RasterizerDummy::texture_set_flags(RID p_texture,uint32_t p_flags) { - - Texture *texture = texture_owner.get( p_texture ); - ERR_FAIL_COND(!texture); - uint32_t cube = texture->flags & VS::TEXTURE_FLAG_CUBEMAP; - texture->flags=p_flags|cube; // can't remove a cube from being a cube - -} -uint32_t RasterizerDummy::texture_get_flags(RID p_texture) const { - - Texture * texture = texture_owner.get(p_texture); - - ERR_FAIL_COND_V(!texture,0); - - return texture->flags; - -} -Image::Format RasterizerDummy::texture_get_format(RID p_texture) const { - - Texture * texture = texture_owner.get(p_texture); - - ERR_FAIL_COND_V(!texture,Image::FORMAT_GRAYSCALE); - - return texture->format; -} -uint32_t RasterizerDummy::texture_get_width(RID p_texture) const { - - Texture * texture = texture_owner.get(p_texture); - - ERR_FAIL_COND_V(!texture,0); - - return texture->width; -} -uint32_t RasterizerDummy::texture_get_height(RID p_texture) const { - - Texture * texture = texture_owner.get(p_texture); - - ERR_FAIL_COND_V(!texture,0); - - return texture->height; -} - -bool RasterizerDummy::texture_has_alpha(RID p_texture) const { - - Texture * texture = texture_owner.get(p_texture); - - ERR_FAIL_COND_V(!texture,0); - - return false; - -} - -void RasterizerDummy::texture_set_size_override(RID p_texture,int p_width, int p_height) { - - Texture * texture = texture_owner.get(p_texture); - - ERR_FAIL_COND(!texture); - - ERR_FAIL_COND(p_width<=0 || p_width>4096); - ERR_FAIL_COND(p_height<=0 || p_height>4096); - //real texture size is in alloc width and height -// texture->width=p_width; -// texture->height=p_height; - -} - -void RasterizerDummy::texture_set_reload_hook(RID p_texture,ObjectID p_owner,const StringName& p_function) const { - - -} - -/* SHADER API */ - -/* SHADER API */ - -RID RasterizerDummy::shader_create(VS::ShaderMode p_mode) { - - Shader *shader = memnew( Shader ); - shader->mode=p_mode; - shader->fragment_line=0; - shader->vertex_line=0; - shader->light_line=0; - RID rid = shader_owner.make_rid(shader); - - return rid; - -} - - - -void RasterizerDummy::shader_set_mode(RID p_shader,VS::ShaderMode p_mode) { - - ERR_FAIL_INDEX(p_mode,3); - Shader *shader=shader_owner.get(p_shader); - ERR_FAIL_COND(!shader); - shader->mode=p_mode; - -} -VS::ShaderMode RasterizerDummy::shader_get_mode(RID p_shader) const { - - Shader *shader=shader_owner.get(p_shader); - ERR_FAIL_COND_V(!shader,VS::SHADER_MATERIAL); - return shader->mode; -} - -void RasterizerDummy::shader_set_code(RID p_shader, const String& p_vertex, const String& p_fragment,const String& p_light,int p_vertex_ofs,int p_fragment_ofs,int p_light_ofs) { - - - Shader *shader=shader_owner.get(p_shader); - ERR_FAIL_COND(!shader); - shader->fragment_code=p_fragment; - shader->vertex_code=p_vertex; - shader->light_code=p_light; - shader->fragment_line=p_fragment_ofs; - shader->vertex_line=p_vertex_ofs; - shader->light_line=p_vertex_ofs; - -} - - -String RasterizerDummy::shader_get_vertex_code(RID p_shader) const { - - Shader *shader=shader_owner.get(p_shader); - ERR_FAIL_COND_V(!shader,String()); - return shader->vertex_code; - -} - -String RasterizerDummy::shader_get_fragment_code(RID p_shader) const { - - Shader *shader=shader_owner.get(p_shader); - ERR_FAIL_COND_V(!shader,String()); - return shader->fragment_code; - -} - -String RasterizerDummy::shader_get_light_code(RID p_shader) const { - - Shader *shader=shader_owner.get(p_shader); - ERR_FAIL_COND_V(!shader,String()); - return shader->light_code; - -} - -void RasterizerDummy::shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list) const { - - Shader *shader=shader_owner.get(p_shader); - ERR_FAIL_COND(!shader); - -} - - -void RasterizerDummy::shader_set_default_texture_param(RID p_shader, const StringName& p_name, RID p_texture) { - -} - -RID RasterizerDummy::shader_get_default_texture_param(RID p_shader, const StringName& p_name) const { - - return RID(); -} - -Variant RasterizerDummy::shader_get_default_param(RID p_shader, const StringName& p_name) { - - return Variant(); -} - -/* COMMON MATERIAL API */ - - -RID RasterizerDummy::material_create() { - - return material_owner.make_rid( memnew( Material ) ); -} - -void RasterizerDummy::material_set_shader(RID p_material, RID p_shader) { - - Material *material = material_owner.get(p_material); - ERR_FAIL_COND(!material); - material->shader=p_shader; - -} - -RID RasterizerDummy::material_get_shader(RID p_material) const { - - Material *material = material_owner.get(p_material); - ERR_FAIL_COND_V(!material,RID()); - return material->shader; -} - -void RasterizerDummy::material_set_param(RID p_material, const StringName& p_param, const Variant& p_value) { - - Material *material = material_owner.get(p_material); - ERR_FAIL_COND(!material); - - if (p_value.get_type()==Variant::NIL) - material->shader_params.erase(p_param); - else - material->shader_params[p_param]=p_value; -} -Variant RasterizerDummy::material_get_param(RID p_material, const StringName& p_param) const { - - Material *material = material_owner.get(p_material); - ERR_FAIL_COND_V(!material,Variant()); - - if (material->shader_params.has(p_param)) - return material->shader_params[p_param]; - else - return Variant(); -} - - -void RasterizerDummy::material_set_flag(RID p_material, VS::MaterialFlag p_flag,bool p_enabled) { - - Material *material = material_owner.get(p_material); - ERR_FAIL_COND(!material); - ERR_FAIL_INDEX(p_flag,VS::MATERIAL_FLAG_MAX); - material->flags[p_flag]=p_enabled; - -} -bool RasterizerDummy::material_get_flag(RID p_material,VS::MaterialFlag p_flag) const { - - Material *material = material_owner.get(p_material); - ERR_FAIL_COND_V(!material,false); - ERR_FAIL_INDEX_V(p_flag,VS::MATERIAL_FLAG_MAX,false); - return material->flags[p_flag]; - - -} - -void RasterizerDummy::material_set_depth_draw_mode(RID p_material, VS::MaterialDepthDrawMode p_mode) { - - Material *material = material_owner.get(p_material); - ERR_FAIL_COND(!material); - material->depth_draw_mode=p_mode; -} - -VS::MaterialDepthDrawMode RasterizerDummy::material_get_depth_draw_mode(RID p_material) const{ - - Material *material = material_owner.get(p_material); - ERR_FAIL_COND_V(!material,VS::MATERIAL_DEPTH_DRAW_ALWAYS); - return material->depth_draw_mode; - -} - - -void RasterizerDummy::material_set_blend_mode(RID p_material,VS::MaterialBlendMode p_mode) { - - Material *material = material_owner.get(p_material); - ERR_FAIL_COND(!material); - material->blend_mode=p_mode; - -} -VS::MaterialBlendMode RasterizerDummy::material_get_blend_mode(RID p_material) const { - - Material *material = material_owner.get(p_material); - ERR_FAIL_COND_V(!material,VS::MATERIAL_BLEND_MODE_ADD); - return material->blend_mode; -} - -void RasterizerDummy::material_set_line_width(RID p_material,float p_line_width) { - - Material *material = material_owner.get(p_material); - ERR_FAIL_COND(!material); - material->line_width=p_line_width; - -} -float RasterizerDummy::material_get_line_width(RID p_material) const { - - Material *material = material_owner.get(p_material); - ERR_FAIL_COND_V(!material,0); - - return material->line_width; -} - -/* MESH API */ - - -RID RasterizerDummy::mesh_create() { - - - return mesh_owner.make_rid( memnew( Mesh ) ); -} - - -void RasterizerDummy::mesh_add_surface(RID p_mesh,VS::PrimitiveType p_primitive,const Array& p_arrays,const Array& p_blend_shapes,bool p_alpha_sort) { - - Mesh *mesh = mesh_owner.get( p_mesh ); - ERR_FAIL_COND(!mesh); - - ERR_FAIL_INDEX( p_primitive, VS::PRIMITIVE_MAX ); - ERR_FAIL_COND(p_arrays.size()!=VS::ARRAY_MAX); - - Surface s; - - - s.format=0; - - for(int i=0;i<p_arrays.size();i++) { - - if (p_arrays[i].get_type()==Variant::NIL) - continue; - - s.format|=(1<<i); - - if (i==VS::ARRAY_VERTEX) { - - Vector3Array v = p_arrays[i]; - int len = v.size(); - ERR_FAIL_COND(len==0); - Vector3Array::Read r = v.read(); - - - for(int i=0;i<len;i++) { - - if (i==0) - s.aabb.pos=r[0]; - else - s.aabb.expand_to(r[i]); - } - - } - } - - ERR_FAIL_COND((s.format&VS::ARRAY_FORMAT_VERTEX)==0); // mandatory - - s.data=p_arrays; - s.morph_data=p_blend_shapes; - s.primitive=p_primitive; - s.alpha_sort=p_alpha_sort; - s.morph_target_count=mesh->morph_target_count; - s.morph_format=s.format; - - - Surface *surface = memnew( Surface ); - *surface=s; - - mesh->surfaces.push_back(surface); - - -} - - - -void RasterizerDummy::mesh_add_custom_surface(RID p_mesh,const Variant& p_dat) { - - ERR_EXPLAIN("Dummy Rasterizer does not support custom surfaces. Running on wrong platform?"); - ERR_FAIL_V(); -} - -Array RasterizerDummy::mesh_get_surface_arrays(RID p_mesh,int p_surface) const { - - Mesh *mesh = mesh_owner.get( p_mesh ); - ERR_FAIL_COND_V(!mesh,Array()); - ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), Array() ); - Surface *surface = mesh->surfaces[p_surface]; - ERR_FAIL_COND_V( !surface, Array() ); - - return surface->data; - - -} -Array RasterizerDummy::mesh_get_surface_morph_arrays(RID p_mesh,int p_surface) const{ - - Mesh *mesh = mesh_owner.get( p_mesh ); - ERR_FAIL_COND_V(!mesh,Array()); - ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), Array() ); - Surface *surface = mesh->surfaces[p_surface]; - ERR_FAIL_COND_V( !surface, Array() ); - - return surface->morph_data; - -} - - -void RasterizerDummy::mesh_set_morph_target_count(RID p_mesh,int p_amount) { - - Mesh *mesh = mesh_owner.get( p_mesh ); - ERR_FAIL_COND(!mesh); - ERR_FAIL_COND( mesh->surfaces.size()!=0 ); - - mesh->morph_target_count=p_amount; - -} - -int RasterizerDummy::mesh_get_morph_target_count(RID p_mesh) const{ - - Mesh *mesh = mesh_owner.get( p_mesh ); - ERR_FAIL_COND_V(!mesh,-1); - - return mesh->morph_target_count; - -} - -void RasterizerDummy::mesh_set_morph_target_mode(RID p_mesh,VS::MorphTargetMode p_mode) { - - ERR_FAIL_INDEX(p_mode,2); - Mesh *mesh = mesh_owner.get( p_mesh ); - ERR_FAIL_COND(!mesh); - - mesh->morph_target_mode=p_mode; - -} - -VS::MorphTargetMode RasterizerDummy::mesh_get_morph_target_mode(RID p_mesh) const { - - Mesh *mesh = mesh_owner.get( p_mesh ); - ERR_FAIL_COND_V(!mesh,VS::MORPH_MODE_NORMALIZED); - - return mesh->morph_target_mode; - -} - - - -void RasterizerDummy::mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material,bool p_owned) { - - Mesh *mesh = mesh_owner.get( p_mesh ); - ERR_FAIL_COND(!mesh); - ERR_FAIL_INDEX(p_surface, mesh->surfaces.size() ); - Surface *surface = mesh->surfaces[p_surface]; - ERR_FAIL_COND( !surface); - - if (surface->material_owned && surface->material.is_valid()) - free(surface->material); - - surface->material_owned=p_owned; - surface->material=p_material; -} - -RID RasterizerDummy::mesh_surface_get_material(RID p_mesh, int p_surface) const { - - Mesh *mesh = mesh_owner.get( p_mesh ); - ERR_FAIL_COND_V(!mesh,RID()); - ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), RID() ); - Surface *surface = mesh->surfaces[p_surface]; - ERR_FAIL_COND_V( !surface, RID() ); - - return surface->material; -} - -int RasterizerDummy::mesh_surface_get_array_len(RID p_mesh, int p_surface) const { - - Mesh *mesh = mesh_owner.get( p_mesh ); - ERR_FAIL_COND_V(!mesh,-1); - ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), -1 ); - Surface *surface = mesh->surfaces[p_surface]; - ERR_FAIL_COND_V( !surface, -1 ); - - Vector3Array arr = surface->data[VS::ARRAY_VERTEX]; - return arr.size(); - -} - -int RasterizerDummy::mesh_surface_get_array_index_len(RID p_mesh, int p_surface) const { - - Mesh *mesh = mesh_owner.get( p_mesh ); - ERR_FAIL_COND_V(!mesh,-1); - ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), -1 ); - Surface *surface = mesh->surfaces[p_surface]; - ERR_FAIL_COND_V( !surface, -1 ); - - IntArray arr = surface->data[VS::ARRAY_INDEX]; - return arr.size(); - -} -uint32_t RasterizerDummy::mesh_surface_get_format(RID p_mesh, int p_surface) const { - - Mesh *mesh = mesh_owner.get( p_mesh ); - ERR_FAIL_COND_V(!mesh,0); - ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), 0 ); - Surface *surface = mesh->surfaces[p_surface]; - ERR_FAIL_COND_V( !surface, 0 ); - - return surface->format; -} -VS::PrimitiveType RasterizerDummy::mesh_surface_get_primitive_type(RID p_mesh, int p_surface) const { - - Mesh *mesh = mesh_owner.get( p_mesh ); - ERR_FAIL_COND_V(!mesh,VS::PRIMITIVE_POINTS); - ERR_FAIL_INDEX_V(p_surface, mesh->surfaces.size(), VS::PRIMITIVE_POINTS ); - Surface *surface = mesh->surfaces[p_surface]; - ERR_FAIL_COND_V( !surface, VS::PRIMITIVE_POINTS ); - - return surface->primitive; -} - -void RasterizerDummy::mesh_remove_surface(RID p_mesh,int p_index) { - - Mesh *mesh = mesh_owner.get( p_mesh ); - ERR_FAIL_COND(!mesh); - ERR_FAIL_INDEX(p_index, mesh->surfaces.size() ); - Surface *surface = mesh->surfaces[p_index]; - ERR_FAIL_COND( !surface); - - memdelete( mesh->surfaces[p_index] ); - mesh->surfaces.remove(p_index); - -} -int RasterizerDummy::mesh_get_surface_count(RID p_mesh) const { - - Mesh *mesh = mesh_owner.get( p_mesh ); - ERR_FAIL_COND_V(!mesh,-1); - - return mesh->surfaces.size(); -} - -AABB RasterizerDummy::mesh_get_aabb(RID p_mesh,RID p_skeleton) const { - - Mesh *mesh = mesh_owner.get( p_mesh ); - ERR_FAIL_COND_V(!mesh,AABB()); - - AABB aabb; - - for (int i=0;i<mesh->surfaces.size();i++) { - - if (i==0) - aabb=mesh->surfaces[i]->aabb; - else - aabb.merge_with(mesh->surfaces[i]->aabb); - } - - return aabb; -} - -void RasterizerDummy::mesh_set_custom_aabb(RID p_mesh,const AABB& p_aabb) { - - Mesh *mesh = mesh_owner.get( p_mesh ); - ERR_FAIL_COND(!mesh); - - mesh->custom_aabb=p_aabb; -} - -AABB RasterizerDummy::mesh_get_custom_aabb(RID p_mesh) const { - - const Mesh *mesh = mesh_owner.get( p_mesh ); - ERR_FAIL_COND_V(!mesh,AABB()); - - return mesh->custom_aabb; - -} - -/* MULTIMESH API */ - -RID RasterizerDummy::multimesh_create() { - - return multimesh_owner.make_rid( memnew( MultiMesh )); -} - -void RasterizerDummy::multimesh_set_instance_count(RID p_multimesh,int p_count) { - - MultiMesh *multimesh = multimesh_owner.get(p_multimesh); - ERR_FAIL_COND(!multimesh); - - multimesh->elements.clear(); // make sure to delete everything, so it "fails" in all implementations - multimesh->elements.resize(p_count); - -} -int RasterizerDummy::multimesh_get_instance_count(RID p_multimesh) const { - - MultiMesh *multimesh = multimesh_owner.get(p_multimesh); - ERR_FAIL_COND_V(!multimesh,-1); - - return multimesh->elements.size(); -} - -void RasterizerDummy::multimesh_set_mesh(RID p_multimesh,RID p_mesh) { - - MultiMesh *multimesh = multimesh_owner.get(p_multimesh); - ERR_FAIL_COND(!multimesh); - - multimesh->mesh=p_mesh; - -} -void RasterizerDummy::multimesh_set_aabb(RID p_multimesh,const AABB& p_aabb) { - - MultiMesh *multimesh = multimesh_owner.get(p_multimesh); - ERR_FAIL_COND(!multimesh); - multimesh->aabb=p_aabb; -} -void RasterizerDummy::multimesh_instance_set_transform(RID p_multimesh,int p_index,const Transform& p_transform) { - - MultiMesh *multimesh = multimesh_owner.get(p_multimesh); - ERR_FAIL_COND(!multimesh); - ERR_FAIL_INDEX(p_index,multimesh->elements.size()); - multimesh->elements[p_index].xform=p_transform; - -} -void RasterizerDummy::multimesh_instance_set_color(RID p_multimesh,int p_index,const Color& p_color) { - - MultiMesh *multimesh = multimesh_owner.get(p_multimesh); - ERR_FAIL_COND(!multimesh) - ERR_FAIL_INDEX(p_index,multimesh->elements.size()); - multimesh->elements[p_index].color=p_color; - -} - -RID RasterizerDummy::multimesh_get_mesh(RID p_multimesh) const { - - MultiMesh *multimesh = multimesh_owner.get(p_multimesh); - ERR_FAIL_COND_V(!multimesh,RID()); - - return multimesh->mesh; -} -AABB RasterizerDummy::multimesh_get_aabb(RID p_multimesh) const { - - MultiMesh *multimesh = multimesh_owner.get(p_multimesh); - ERR_FAIL_COND_V(!multimesh,AABB()); - - return multimesh->aabb; -} - -Transform RasterizerDummy::multimesh_instance_get_transform(RID p_multimesh,int p_index) const { - - MultiMesh *multimesh = multimesh_owner.get(p_multimesh); - ERR_FAIL_COND_V(!multimesh,Transform()); - - ERR_FAIL_INDEX_V(p_index,multimesh->elements.size(),Transform()); - - return multimesh->elements[p_index].xform; - -} -Color RasterizerDummy::multimesh_instance_get_color(RID p_multimesh,int p_index) const { - - MultiMesh *multimesh = multimesh_owner.get(p_multimesh); - ERR_FAIL_COND_V(!multimesh,Color()); - ERR_FAIL_INDEX_V(p_index,multimesh->elements.size(),Color()); - - return multimesh->elements[p_index].color; -} - -void RasterizerDummy::multimesh_set_visible_instances(RID p_multimesh,int p_visible) { - - MultiMesh *multimesh = multimesh_owner.get(p_multimesh); - ERR_FAIL_COND(!multimesh); - multimesh->visible=p_visible; - -} - -int RasterizerDummy::multimesh_get_visible_instances(RID p_multimesh) const { - - MultiMesh *multimesh = multimesh_owner.get(p_multimesh); - ERR_FAIL_COND_V(!multimesh,-1); - return multimesh->visible; - -} - -/* IMMEDIATE API */ - - -RID RasterizerDummy::immediate_create() { - - Immediate *im = memnew( Immediate ); - return immediate_owner.make_rid(im); - -} - -void RasterizerDummy::immediate_begin(RID p_immediate,VS::PrimitiveType p_rimitive,RID p_texture){ - - -} -void RasterizerDummy::immediate_vertex(RID p_immediate,const Vector3& p_vertex){ - - -} -void RasterizerDummy::immediate_normal(RID p_immediate,const Vector3& p_normal){ - - -} -void RasterizerDummy::immediate_tangent(RID p_immediate,const Plane& p_tangent){ - - -} -void RasterizerDummy::immediate_color(RID p_immediate,const Color& p_color){ - - -} -void RasterizerDummy::immediate_uv(RID p_immediate,const Vector2& tex_uv){ - - -} -void RasterizerDummy::immediate_uv2(RID p_immediate,const Vector2& tex_uv){ - - -} - -void RasterizerDummy::immediate_end(RID p_immediate){ - - -} -void RasterizerDummy::immediate_clear(RID p_immediate) { - - -} - -AABB RasterizerDummy::immediate_get_aabb(RID p_immediate) const { - - return AABB(Vector3(-1,-1,-1),Vector3(2,2,2)); -} - -void RasterizerDummy::immediate_set_material(RID p_immediate,RID p_material) { - - Immediate *im = immediate_owner.get(p_immediate); - ERR_FAIL_COND(!im); - im->material=p_material; - -} - -RID RasterizerDummy::immediate_get_material(RID p_immediate) const { - - const Immediate *im = immediate_owner.get(p_immediate); - ERR_FAIL_COND_V(!im,RID()); - return im->material; - -} - -/* PARTICLES API */ - -RID RasterizerDummy::particles_create() { - - Particles *particles = memnew( Particles ); - ERR_FAIL_COND_V(!particles,RID()); - return particles_owner.make_rid(particles); -} - -void RasterizerDummy::particles_set_amount(RID p_particles, int p_amount) { - - ERR_FAIL_COND(p_amount<1); - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND(!particles); - particles->data.amount=p_amount; - -} - -int RasterizerDummy::particles_get_amount(RID p_particles) const { - - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND_V(!particles,-1); - return particles->data.amount; - -} - -void RasterizerDummy::particles_set_emitting(RID p_particles, bool p_emitting) { - - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND(!particles); - particles->data.emitting=p_emitting;; - -} -bool RasterizerDummy::particles_is_emitting(RID p_particles) const { - - const Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND_V(!particles,false); - return particles->data.emitting; - -} - -void RasterizerDummy::particles_set_visibility_aabb(RID p_particles, const AABB& p_visibility) { - - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND(!particles); - particles->data.visibility_aabb=p_visibility; - -} - -void RasterizerDummy::particles_set_emission_half_extents(RID p_particles, const Vector3& p_half_extents) { - - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND(!particles); - - particles->data.emission_half_extents=p_half_extents; -} -Vector3 RasterizerDummy::particles_get_emission_half_extents(RID p_particles) const { - - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND_V(!particles,Vector3()); - - return particles->data.emission_half_extents; -} - -void RasterizerDummy::particles_set_emission_base_velocity(RID p_particles, const Vector3& p_base_velocity) { - - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND(!particles); - - particles->data.emission_base_velocity=p_base_velocity; -} - -Vector3 RasterizerDummy::particles_get_emission_base_velocity(RID p_particles) const { - - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND_V(!particles,Vector3()); - - return particles->data.emission_base_velocity; -} - - -void RasterizerDummy::particles_set_emission_points(RID p_particles, const DVector<Vector3>& p_points) { - - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND(!particles); - - particles->data.emission_points=p_points; -} - -DVector<Vector3> RasterizerDummy::particles_get_emission_points(RID p_particles) const { - - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND_V(!particles,DVector<Vector3>()); - - return particles->data.emission_points; - -} - -void RasterizerDummy::particles_set_gravity_normal(RID p_particles, const Vector3& p_normal) { - - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND(!particles); - - particles->data.gravity_normal=p_normal; - -} -Vector3 RasterizerDummy::particles_get_gravity_normal(RID p_particles) const { - - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND_V(!particles,Vector3()); - - return particles->data.gravity_normal; -} - - -AABB RasterizerDummy::particles_get_visibility_aabb(RID p_particles) const { - - const Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND_V(!particles,AABB()); - return particles->data.visibility_aabb; - -} - -void RasterizerDummy::particles_set_variable(RID p_particles, VS::ParticleVariable p_variable,float p_value) { - - ERR_FAIL_INDEX(p_variable,VS::PARTICLE_VAR_MAX); - - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND(!particles); - particles->data.particle_vars[p_variable]=p_value; - -} -float RasterizerDummy::particles_get_variable(RID p_particles, VS::ParticleVariable p_variable) const { - - const Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND_V(!particles,-1); - return particles->data.particle_vars[p_variable]; -} - -void RasterizerDummy::particles_set_randomness(RID p_particles, VS::ParticleVariable p_variable,float p_randomness) { - - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND(!particles); - particles->data.particle_randomness[p_variable]=p_randomness; - -} -float RasterizerDummy::particles_get_randomness(RID p_particles, VS::ParticleVariable p_variable) const { - - const Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND_V(!particles,-1); - return particles->data.particle_randomness[p_variable]; - -} - -void RasterizerDummy::particles_set_color_phases(RID p_particles, int p_phases) { - - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND(!particles); - ERR_FAIL_COND( p_phases<0 || p_phases>VS::MAX_PARTICLE_COLOR_PHASES ); - particles->data.color_phase_count=p_phases; - -} -int RasterizerDummy::particles_get_color_phases(RID p_particles) const { - - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND_V(!particles,-1); - return particles->data.color_phase_count; -} - - -void RasterizerDummy::particles_set_color_phase_pos(RID p_particles, int p_phase, float p_pos) { - - ERR_FAIL_INDEX(p_phase, VS::MAX_PARTICLE_COLOR_PHASES); - if (p_pos<0.0) - p_pos=0.0; - if (p_pos>1.0) - p_pos=1.0; - - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND(!particles); - particles->data.color_phases[p_phase].pos=p_pos; - -} -float RasterizerDummy::particles_get_color_phase_pos(RID p_particles, int p_phase) const { - - ERR_FAIL_INDEX_V(p_phase, VS::MAX_PARTICLE_COLOR_PHASES, -1.0); - - const Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND_V(!particles,-1); - return particles->data.color_phases[p_phase].pos; - -} - -void RasterizerDummy::particles_set_color_phase_color(RID p_particles, int p_phase, const Color& p_color) { - - ERR_FAIL_INDEX(p_phase, VS::MAX_PARTICLE_COLOR_PHASES); - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND(!particles); - particles->data.color_phases[p_phase].color=p_color; - - //update alpha - particles->has_alpha=false; - for(int i=0;i<VS::MAX_PARTICLE_COLOR_PHASES;i++) { - if (particles->data.color_phases[i].color.a<0.99) - particles->has_alpha=true; - } - -} - -Color RasterizerDummy::particles_get_color_phase_color(RID p_particles, int p_phase) const { - - ERR_FAIL_INDEX_V(p_phase, VS::MAX_PARTICLE_COLOR_PHASES, Color()); - - const Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND_V(!particles,Color()); - return particles->data.color_phases[p_phase].color; - -} - -void RasterizerDummy::particles_set_attractors(RID p_particles, int p_attractors) { - - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND(!particles); - ERR_FAIL_COND( p_attractors<0 || p_attractors>VisualServer::MAX_PARTICLE_ATTRACTORS ); - particles->data.attractor_count=p_attractors; - -} -int RasterizerDummy::particles_get_attractors(RID p_particles) const { - - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND_V(!particles,-1); - return particles->data.attractor_count; -} - -void RasterizerDummy::particles_set_attractor_pos(RID p_particles, int p_attractor, const Vector3& p_pos) { - - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND(!particles); - ERR_FAIL_INDEX(p_attractor,particles->data.attractor_count); - particles->data.attractors[p_attractor].pos=p_pos;; -} -Vector3 RasterizerDummy::particles_get_attractor_pos(RID p_particles,int p_attractor) const { - - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND_V(!particles,Vector3()); - ERR_FAIL_INDEX_V(p_attractor,particles->data.attractor_count,Vector3()); - return particles->data.attractors[p_attractor].pos; -} - -void RasterizerDummy::particles_set_attractor_strength(RID p_particles, int p_attractor, float p_force) { - - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND(!particles); - ERR_FAIL_INDEX(p_attractor,particles->data.attractor_count); - particles->data.attractors[p_attractor].force=p_force; -} - -float RasterizerDummy::particles_get_attractor_strength(RID p_particles,int p_attractor) const { - - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND_V(!particles,0); - ERR_FAIL_INDEX_V(p_attractor,particles->data.attractor_count,0); - return particles->data.attractors[p_attractor].force; -} - -void RasterizerDummy::particles_set_material(RID p_particles, RID p_material,bool p_owned) { - - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND(!particles); - if (particles->material_owned && particles->material.is_valid()) - free(particles->material); - - particles->material_owned=p_owned; - - particles->material=p_material; - -} -RID RasterizerDummy::particles_get_material(RID p_particles) const { - - const Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND_V(!particles,RID()); - return particles->material; - -} - -void RasterizerDummy::particles_set_use_local_coordinates(RID p_particles, bool p_enable) { - - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND(!particles); - particles->data.local_coordinates=p_enable; - -} - -bool RasterizerDummy::particles_is_using_local_coordinates(RID p_particles) const { - - const Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND_V(!particles,false); - return particles->data.local_coordinates; -} -bool RasterizerDummy::particles_has_height_from_velocity(RID p_particles) const { - - const Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND_V(!particles,false); - return particles->data.height_from_velocity; -} - -void RasterizerDummy::particles_set_height_from_velocity(RID p_particles, bool p_enable) { - - Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND(!particles); - particles->data.height_from_velocity=p_enable; - -} - -AABB RasterizerDummy::particles_get_aabb(RID p_particles) const { - - const Particles* particles = particles_owner.get( p_particles ); - ERR_FAIL_COND_V(!particles,AABB()); - return particles->data.visibility_aabb; -} - -/* SKELETON API */ - -RID RasterizerDummy::skeleton_create() { - - Skeleton *skeleton = memnew( Skeleton ); - ERR_FAIL_COND_V(!skeleton,RID()); - return skeleton_owner.make_rid( skeleton ); -} -void RasterizerDummy::skeleton_resize(RID p_skeleton,int p_bones) { - - Skeleton *skeleton = skeleton_owner.get( p_skeleton ); - ERR_FAIL_COND(!skeleton); - if (p_bones == skeleton->bones.size()) { - return; - }; - - skeleton->bones.resize(p_bones); - -} -int RasterizerDummy::skeleton_get_bone_count(RID p_skeleton) const { - - Skeleton *skeleton = skeleton_owner.get( p_skeleton ); - ERR_FAIL_COND_V(!skeleton, -1); - return skeleton->bones.size(); -} -void RasterizerDummy::skeleton_bone_set_transform(RID p_skeleton,int p_bone, const Transform& p_transform) { - - Skeleton *skeleton = skeleton_owner.get( p_skeleton ); - ERR_FAIL_COND(!skeleton); - ERR_FAIL_INDEX( p_bone, skeleton->bones.size() ); - - skeleton->bones[p_bone] = p_transform; -} - -Transform RasterizerDummy::skeleton_bone_get_transform(RID p_skeleton,int p_bone) { - - Skeleton *skeleton = skeleton_owner.get( p_skeleton ); - ERR_FAIL_COND_V(!skeleton, Transform()); - ERR_FAIL_INDEX_V( p_bone, skeleton->bones.size(), Transform() ); - - // something - return skeleton->bones[p_bone]; -} - - -/* LIGHT API */ - -RID RasterizerDummy::light_create(VS::LightType p_type) { - - Light *light = memnew( Light ); - light->type=p_type; - return light_owner.make_rid(light); -} - -VS::LightType RasterizerDummy::light_get_type(RID p_light) const { - - Light *light = light_owner.get(p_light); - ERR_FAIL_COND_V(!light,VS::LIGHT_OMNI); - return light->type; -} - -void RasterizerDummy::light_set_color(RID p_light,VS::LightColor p_type, const Color& p_color) { - - Light *light = light_owner.get(p_light); - ERR_FAIL_COND(!light); - ERR_FAIL_INDEX( p_type, 3 ); - light->colors[p_type]=p_color; -} -Color RasterizerDummy::light_get_color(RID p_light,VS::LightColor p_type) const { - - Light *light = light_owner.get(p_light); - ERR_FAIL_COND_V(!light, Color()); - ERR_FAIL_INDEX_V( p_type, 3, Color() ); - return light->colors[p_type]; -} - -void RasterizerDummy::light_set_shadow(RID p_light,bool p_enabled) { - - Light *light = light_owner.get(p_light); - ERR_FAIL_COND(!light); - light->shadow_enabled=p_enabled; -} - -bool RasterizerDummy::light_has_shadow(RID p_light) const { - - Light *light = light_owner.get(p_light); - ERR_FAIL_COND_V(!light,false); - return light->shadow_enabled; -} - -void RasterizerDummy::light_set_volumetric(RID p_light,bool p_enabled) { - - Light *light = light_owner.get(p_light); - ERR_FAIL_COND(!light); - light->volumetric_enabled=p_enabled; - -} -bool RasterizerDummy::light_is_volumetric(RID p_light) const { - - Light *light = light_owner.get(p_light); - ERR_FAIL_COND_V(!light,false); - return light->volumetric_enabled; -} - -void RasterizerDummy::light_set_projector(RID p_light,RID p_texture) { - - Light *light = light_owner.get(p_light); - ERR_FAIL_COND(!light); - light->projector=p_texture; -} -RID RasterizerDummy::light_get_projector(RID p_light) const { - - Light *light = light_owner.get(p_light); - ERR_FAIL_COND_V(!light,RID()); - return light->projector; -} - -void RasterizerDummy::light_set_var(RID p_light, VS::LightParam p_var, float p_value) { - - Light * light = light_owner.get( p_light ); - ERR_FAIL_COND(!light); - ERR_FAIL_INDEX( p_var, VS::LIGHT_PARAM_MAX ); - - light->vars[p_var]=p_value; -} -float RasterizerDummy::light_get_var(RID p_light, VS::LightParam p_var) const { - - Light * light = light_owner.get( p_light ); - ERR_FAIL_COND_V(!light,0); - - ERR_FAIL_INDEX_V( p_var, VS::LIGHT_PARAM_MAX,0 ); - - return light->vars[p_var]; -} - -void RasterizerDummy::light_set_operator(RID p_light,VS::LightOp p_op) { - - Light * light = light_owner.get( p_light ); - ERR_FAIL_COND(!light); - - -}; - -VS::LightOp RasterizerDummy::light_get_operator(RID p_light) const { - - return VS::LightOp(0); -}; - -void RasterizerDummy::light_omni_set_shadow_mode(RID p_light,VS::LightOmniShadowMode p_mode) { - - -} - -VS::LightOmniShadowMode RasterizerDummy::light_omni_get_shadow_mode(RID p_light) const{ - - return VS::LightOmniShadowMode(0); -} - -void RasterizerDummy::light_directional_set_shadow_mode(RID p_light,VS::LightDirectionalShadowMode p_mode) { - - -} - -VS::LightDirectionalShadowMode RasterizerDummy::light_directional_get_shadow_mode(RID p_light) const { - - return VS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL; -} - -void RasterizerDummy::light_directional_set_shadow_param(RID p_light,VS::LightDirectionalShadowParam p_param, float p_value) { - - -} - -float RasterizerDummy::light_directional_get_shadow_param(RID p_light,VS::LightDirectionalShadowParam p_param) const { - - return 0; -} - - -AABB RasterizerDummy::light_get_aabb(RID p_light) const { - - Light *light = light_owner.get( p_light ); - ERR_FAIL_COND_V(!light,AABB()); - - switch( light->type ) { - - case VS::LIGHT_SPOT: { - - float len=light->vars[VS::LIGHT_PARAM_RADIUS]; - float size=Math::tan(Math::deg2rad(light->vars[VS::LIGHT_PARAM_SPOT_ANGLE]))*len; - return AABB( Vector3( -size,-size,-len ), Vector3( size*2, size*2, len ) ); - } break; - case VS::LIGHT_OMNI: { - - float r = light->vars[VS::LIGHT_PARAM_RADIUS]; - return AABB( -Vector3(r,r,r), Vector3(r,r,r)*2 ); - } break; - case VS::LIGHT_DIRECTIONAL: { - - return AABB(); - } break; - default: {} - } - - ERR_FAIL_V( AABB() ); -} - - -RID RasterizerDummy::light_instance_create(RID p_light) { - - Light *light = light_owner.get( p_light ); - ERR_FAIL_COND_V(!light, RID()); - - LightInstance *light_instance = memnew( LightInstance ); - - light_instance->light=p_light; - light_instance->base=light; - - - return light_instance_owner.make_rid( light_instance ); -} -void RasterizerDummy::light_instance_set_transform(RID p_light_instance,const Transform& p_transform) { - - LightInstance *lighti = light_instance_owner.get( p_light_instance ); - ERR_FAIL_COND(!lighti); - lighti->transform=p_transform; - -} - -bool RasterizerDummy::light_instance_has_shadow(RID p_light_instance) const { - - return false; - -} - - -bool RasterizerDummy::light_instance_assign_shadow(RID p_light_instance) { - - return false; - -} - - -Rasterizer::ShadowType RasterizerDummy::light_instance_get_shadow_type(RID p_light_instance) const { - - LightInstance *lighti = light_instance_owner.get( p_light_instance ); - ERR_FAIL_COND_V(!lighti,Rasterizer::SHADOW_NONE); - - switch(lighti->base->type) { - - case VS::LIGHT_DIRECTIONAL: return SHADOW_PSM; break; - case VS::LIGHT_OMNI: return SHADOW_DUAL_PARABOLOID; break; - case VS::LIGHT_SPOT: return SHADOW_SIMPLE; break; - } - - return Rasterizer::SHADOW_NONE; -} - -Rasterizer::ShadowType RasterizerDummy::light_instance_get_shadow_type(RID p_light_instance,bool p_far) const { - - return SHADOW_NONE; -} -void RasterizerDummy::light_instance_set_shadow_transform(RID p_light_instance, int p_index, const CameraMatrix& p_camera, const Transform& p_transform, float p_split_near,float p_split_far) { - - -} - -int RasterizerDummy::light_instance_get_shadow_passes(RID p_light_instance) const { - - return 0; -} - -bool RasterizerDummy::light_instance_get_pssm_shadow_overlap(RID p_light_instance) const { - - return false; -} - - -void RasterizerDummy::light_instance_set_custom_transform(RID p_light_instance, int p_index, const CameraMatrix& p_camera, const Transform& p_transform, float p_split_near,float p_split_far) { - - LightInstance *lighti = light_instance_owner.get( p_light_instance ); - ERR_FAIL_COND(!lighti); - - ERR_FAIL_COND(lighti->base->type!=VS::LIGHT_DIRECTIONAL); - ERR_FAIL_INDEX(p_index,1); - - lighti->custom_projection=p_camera; - lighti->custom_transform=p_transform; - -} -void RasterizerDummy::shadow_clear_near() { - - -} - -bool RasterizerDummy::shadow_allocate_near(RID p_light) { - - return false; -} - -bool RasterizerDummy::shadow_allocate_far(RID p_light) { - - return false; -} - -/* PARTICLES INSTANCE */ - -RID RasterizerDummy::particles_instance_create(RID p_particles) { - - ERR_FAIL_COND_V(!particles_owner.owns(p_particles),RID()); - ParticlesInstance *particles_instance = memnew( ParticlesInstance ); - ERR_FAIL_COND_V(!particles_instance, RID() ); - particles_instance->particles=p_particles; - return particles_instance_owner.make_rid(particles_instance); -} - -void RasterizerDummy::particles_instance_set_transform(RID p_particles_instance,const Transform& p_transform) { - - ParticlesInstance *particles_instance=particles_instance_owner.get(p_particles_instance); - ERR_FAIL_COND(!particles_instance); - particles_instance->transform=p_transform; -} - - -/* RENDER API */ -/* all calls (inside begin/end shadow) are always warranted to be in the following order: */ - - -RID RasterizerDummy::viewport_data_create() { - - return RID(); -} - -RID RasterizerDummy::render_target_create(){ - - return RID(); - -} -void RasterizerDummy::render_target_set_size(RID p_render_target, int p_width, int p_height){ - - -} -RID RasterizerDummy::render_target_get_texture(RID p_render_target) const{ - - return RID(); - -} -bool RasterizerDummy::render_target_renedered_in_frame(RID p_render_target){ - - return false; -} - - -void RasterizerDummy::begin_frame() { - - - -} - -void RasterizerDummy::capture_viewport(Image* r_capture) { - - -} - - -void RasterizerDummy::clear_viewport(const Color& p_color) { - - -}; - -void RasterizerDummy::set_viewport(const VS::ViewportRect& p_viewport) { - - - -} - -void RasterizerDummy::set_render_target(RID p_render_target, bool p_transparent_bg, bool p_vflip) { - - -} - - -void RasterizerDummy::begin_scene(RID p_viewport_data,RID p_env,VS::ScenarioDebugMode p_debug) { - - -}; - -void RasterizerDummy::begin_shadow_map( RID p_light_instance, int p_shadow_pass ) { - -} - -void RasterizerDummy::set_camera(const Transform& p_world, const CameraMatrix& p_projection, bool p_ortho_hint) { - - -} - -void RasterizerDummy::add_light( RID p_light_instance ) { - - - -} - - - - -void RasterizerDummy::add_mesh( const RID& p_mesh, const InstanceData *p_data) { - - -} - -void RasterizerDummy::add_multimesh( const RID& p_multimesh, const InstanceData *p_data){ - - - - -} - -void RasterizerDummy::add_particles( const RID& p_particle_instance, const InstanceData *p_data){ - - - -} - - - -void RasterizerDummy::end_scene() { - - -} -void RasterizerDummy::end_shadow_map() { - -} - - -void RasterizerDummy::end_frame() { - - -} - -RID RasterizerDummy::canvas_light_occluder_create() { - return RID(); -} - -void RasterizerDummy::canvas_light_occluder_set_polylines(RID p_occluder, const DVector<Vector2>& p_lines) { - - -} - -RID RasterizerDummy::canvas_light_shadow_buffer_create(int p_width) { - - return RID(); -} - -void RasterizerDummy::canvas_light_shadow_buffer_update(RID p_buffer, const Matrix32& p_light_xform, int p_light_mask,float p_near, float p_far, CanvasLightOccluderInstance* p_occluders, CameraMatrix *p_xform_cache) { - - -} - -void RasterizerDummy::canvas_debug_viewport_shadows(CanvasLight* p_lights_with_shadow) { - - -} - -/* CANVAS API */ - - -void RasterizerDummy::begin_canvas_bg() { - -} -void RasterizerDummy::canvas_begin() { - - - -} -void RasterizerDummy::canvas_disable_blending() { - - - -} - -void RasterizerDummy::canvas_set_opacity(float p_opacity) { - - -} - -void RasterizerDummy::canvas_set_blend_mode(VS::MaterialBlendMode p_mode) { - - -} - - -void RasterizerDummy::canvas_begin_rect(const Matrix32& p_transform) { - - - -} - -void RasterizerDummy::canvas_set_clip(bool p_clip, const Rect2& p_rect) { - - - - -} - -void RasterizerDummy::canvas_end_rect() { - - -} - -void RasterizerDummy::canvas_draw_line(const Point2& p_from, const Point2& p_to, const Color& p_color, float p_width, bool p_antialiased) { - - - -} - -void RasterizerDummy::canvas_draw_rect(const Rect2& p_rect, int p_flags, const Rect2& p_source,RID p_texture,const Color& p_modulate) { - - - - -} -void RasterizerDummy::canvas_draw_style_box(const Rect2& p_rect, const Rect2& p_src_region, RID p_texture,const float *p_margin, bool p_draw_center,const Color& p_modulate) { - - -} -void RasterizerDummy::canvas_draw_primitive(const Vector<Point2>& p_points, const Vector<Color>& p_colors,const Vector<Point2>& p_uvs, RID p_texture,float p_width) { - - - -} - - -void RasterizerDummy::canvas_draw_polygon(int p_vertex_count, const int* p_indices, const Vector2* p_vertices, const Vector2* p_uvs, const Color* p_colors,const RID& p_texture,bool p_singlecolor) { - - - -} - -void RasterizerDummy::canvas_set_transform(const Matrix32& p_transform) { - - -} - -void RasterizerDummy::canvas_render_items(CanvasItem *p_item_list,int p_z,const Color& p_modulate,CanvasLight *p_light) { - - -} - -/* ENVIRONMENT */ - -RID RasterizerDummy::environment_create() { - - Environment * env = memnew( Environment ); - return environment_owner.make_rid(env); -} - -void RasterizerDummy::environment_set_background(RID p_env,VS::EnvironmentBG p_bg) { - - ERR_FAIL_INDEX(p_bg,VS::ENV_BG_MAX); - Environment * env = environment_owner.get(p_env); - ERR_FAIL_COND(!env); - env->bg_mode=p_bg; -} - -VS::EnvironmentBG RasterizerDummy::environment_get_background(RID p_env) const{ - - const Environment * env = environment_owner.get(p_env); - ERR_FAIL_COND_V(!env,VS::ENV_BG_MAX); - return env->bg_mode; -} - -void RasterizerDummy::environment_set_background_param(RID p_env,VS::EnvironmentBGParam p_param, const Variant& p_value){ - - ERR_FAIL_INDEX(p_param,VS::ENV_BG_PARAM_MAX); - Environment * env = environment_owner.get(p_env); - ERR_FAIL_COND(!env); - env->bg_param[p_param]=p_value; - -} -Variant RasterizerDummy::environment_get_background_param(RID p_env,VS::EnvironmentBGParam p_param) const{ - - ERR_FAIL_INDEX_V(p_param,VS::ENV_BG_PARAM_MAX,Variant()); - const Environment * env = environment_owner.get(p_env); - ERR_FAIL_COND_V(!env,Variant()); - return env->bg_param[p_param]; - -} - -void RasterizerDummy::environment_set_enable_fx(RID p_env,VS::EnvironmentFx p_effect,bool p_enabled){ - - ERR_FAIL_INDEX(p_effect,VS::ENV_FX_MAX); - Environment * env = environment_owner.get(p_env); - ERR_FAIL_COND(!env); - env->fx_enabled[p_effect]=p_enabled; -} -bool RasterizerDummy::environment_is_fx_enabled(RID p_env,VS::EnvironmentFx p_effect) const{ - - ERR_FAIL_INDEX_V(p_effect,VS::ENV_FX_MAX,false); - const Environment * env = environment_owner.get(p_env); - ERR_FAIL_COND_V(!env,false); - return env->fx_enabled[p_effect]; - -} - -void RasterizerDummy::environment_fx_set_param(RID p_env,VS::EnvironmentFxParam p_param,const Variant& p_value){ - - ERR_FAIL_INDEX(p_param,VS::ENV_FX_PARAM_MAX); - Environment * env = environment_owner.get(p_env); - ERR_FAIL_COND(!env); - env->fx_param[p_param]=p_value; -} -Variant RasterizerDummy::environment_fx_get_param(RID p_env,VS::EnvironmentFxParam p_param) const{ - - ERR_FAIL_INDEX_V(p_param,VS::ENV_FX_PARAM_MAX,Variant()); - const Environment * env = environment_owner.get(p_env); - ERR_FAIL_COND_V(!env,Variant()); - return env->fx_param[p_param]; - -} - - -RID RasterizerDummy::sampled_light_dp_create(int p_width,int p_height) { - - return sampled_light_owner.make_rid(memnew(SampledLight)); -} - -void RasterizerDummy::sampled_light_dp_update(RID p_sampled_light, const Color *p_data, float p_multiplier) { - - -} - - -/*MISC*/ - -bool RasterizerDummy::is_texture(const RID& p_rid) const { - - return texture_owner.owns(p_rid); -} -bool RasterizerDummy::is_material(const RID& p_rid) const { - - return material_owner.owns(p_rid); -} -bool RasterizerDummy::is_mesh(const RID& p_rid) const { - - return mesh_owner.owns(p_rid); -} - -bool RasterizerDummy::is_immediate(const RID& p_rid) const { - - return immediate_owner.owns(p_rid); -} - -bool RasterizerDummy::is_multimesh(const RID& p_rid) const { - - return multimesh_owner.owns(p_rid); -} -bool RasterizerDummy::is_particles(const RID &p_beam) const { - - return particles_owner.owns(p_beam); -} - -bool RasterizerDummy::is_light(const RID& p_rid) const { - - return light_owner.owns(p_rid); -} -bool RasterizerDummy::is_light_instance(const RID& p_rid) const { - - return light_instance_owner.owns(p_rid); -} -bool RasterizerDummy::is_particles_instance(const RID& p_rid) const { - - return particles_instance_owner.owns(p_rid); -} -bool RasterizerDummy::is_skeleton(const RID& p_rid) const { - - return skeleton_owner.owns(p_rid); -} -bool RasterizerDummy::is_environment(const RID& p_rid) const { - - return environment_owner.owns(p_rid); -} - -bool RasterizerDummy::is_canvas_light_occluder(const RID& p_rid) const { - - return false; -} - -bool RasterizerDummy::is_shader(const RID& p_rid) const { - - return false; -} - -void RasterizerDummy::free(const RID& p_rid) { - - if (texture_owner.owns(p_rid)) { - - // delete the texture - Texture *texture = texture_owner.get(p_rid); - texture_owner.free(p_rid); - memdelete(texture); - - } else if (shader_owner.owns(p_rid)) { - - // delete the texture - Shader *shader = shader_owner.get(p_rid); - shader_owner.free(p_rid); - memdelete(shader); - - } else if (material_owner.owns(p_rid)) { - - Material *material = material_owner.get( p_rid ); - material_owner.free(p_rid); - memdelete(material); - - } else if (mesh_owner.owns(p_rid)) { - - Mesh *mesh = mesh_owner.get(p_rid); - - for (int i=0;i<mesh->surfaces.size();i++) { - - memdelete( mesh->surfaces[i] ); - }; - - mesh->surfaces.clear(); - mesh_owner.free(p_rid); - memdelete(mesh); - - } else if (multimesh_owner.owns(p_rid)) { - - MultiMesh *multimesh = multimesh_owner.get(p_rid); - multimesh_owner.free(p_rid); - memdelete(multimesh); - - } else if (immediate_owner.owns(p_rid)) { - - Immediate *immediate = immediate_owner.get(p_rid); - immediate_owner.free(p_rid); - memdelete(immediate); - - } else if (particles_owner.owns(p_rid)) { - - Particles *particles = particles_owner.get(p_rid); - particles_owner.free(p_rid); - memdelete(particles); - } else if (particles_instance_owner.owns(p_rid)) { - - ParticlesInstance *particles_isntance = particles_instance_owner.get(p_rid); - particles_instance_owner.free(p_rid); - memdelete(particles_isntance); - - } else if (skeleton_owner.owns(p_rid)) { - - Skeleton *skeleton = skeleton_owner.get( p_rid ); - skeleton_owner.free(p_rid); - memdelete(skeleton); - - } else if (light_owner.owns(p_rid)) { - - Light *light = light_owner.get( p_rid ); - light_owner.free(p_rid); - memdelete(light); - - } else if (light_instance_owner.owns(p_rid)) { - - LightInstance *light_instance = light_instance_owner.get( p_rid ); - light_instance_owner.free(p_rid); - memdelete( light_instance ); - - - } else if (environment_owner.owns(p_rid)) { - - Environment *env = environment_owner.get( p_rid ); - environment_owner.free(p_rid); - memdelete( env ); - } else if (sampled_light_owner.owns(p_rid)) { - - SampledLight *sampled_light = sampled_light_owner.get( p_rid ); - ERR_FAIL_COND(!sampled_light); - - sampled_light_owner.free(p_rid); - memdelete( sampled_light ); - - }; -} - - -void RasterizerDummy::custom_shade_model_set_shader(int p_model, RID p_shader) { - - -}; - -RID RasterizerDummy::custom_shade_model_get_shader(int p_model) const { - - return RID(); -}; - -void RasterizerDummy::custom_shade_model_set_name(int p_model, const String& p_name) { - -}; - -String RasterizerDummy::custom_shade_model_get_name(int p_model) const { - - return String(); -}; - -void RasterizerDummy::custom_shade_model_set_param_info(int p_model, const List<PropertyInfo>& p_info) { - -}; - -void RasterizerDummy::custom_shade_model_get_param_info(int p_model, List<PropertyInfo>* p_info) const { - -}; - - - -void RasterizerDummy::init() { - - -} - -void RasterizerDummy::finish() { - - -} - -int RasterizerDummy::get_render_info(VS::RenderInfo p_info) { - - return 0; -} - -bool RasterizerDummy::needs_to_draw_next_frame() const { - - return false; -} - - -bool RasterizerDummy::has_feature(VS::Features p_feature) const { - - return false; - -} - -void RasterizerDummy::restore_framebuffer() { - -} - -RasterizerDummy::RasterizerDummy() { - -}; - -RasterizerDummy::~RasterizerDummy() { - -}; diff --git a/servers/visual/rasterizer_dummy.h b/servers/visual/rasterizer_dummy.h deleted file mode 100644 index cac36eb6fc..0000000000 --- a/servers/visual/rasterizer_dummy.h +++ /dev/null @@ -1,791 +0,0 @@ -/*************************************************************************/ -/* rasterizer_dummy.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef RASTERIZER_DUMMY_H -#define RASTERIZER_DUMMY_H - -#include "servers/visual/rasterizer.h" - - -#include "image.h" -#include "rid.h" -#include "servers/visual_server.h" -#include "list.h" -#include "map.h" -#include "camera_matrix.h" -#include "sort.h" - - -#include "servers/visual/particle_system_sw.h" - -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ -class RasterizerDummy : public Rasterizer { - - struct Texture { - - uint32_t flags; - int width,height; - Image::Format format; - Image image[6]; - Texture() { - - flags=width=height=0; - format=Image::FORMAT_GRAYSCALE; - } - - ~Texture() { - - } - }; - - mutable RID_Owner<Texture> texture_owner; - - struct Shader { - - String vertex_code; - String fragment_code; - String light_code; - VS::ShaderMode mode; - Map<StringName,Variant> params; - int fragment_line; - int vertex_line; - int light_line; - bool valid; - bool has_alpha; - bool use_world_transform; - - }; - - mutable RID_Owner<Shader> shader_owner; - - - struct Material { - - bool flags[VS::MATERIAL_FLAG_MAX]; - - VS::MaterialDepthDrawMode depth_draw_mode; - - VS::MaterialBlendMode blend_mode; - - float line_width; - float point_size; - - RID shader; // shader material - - Map<StringName,Variant> shader_params; - - - Material() { - - - for(int i=0;i<VS::MATERIAL_FLAG_MAX;i++) - flags[i]=false; - flags[VS::MATERIAL_FLAG_VISIBLE]=true; - - depth_draw_mode=VS::MATERIAL_DEPTH_DRAW_OPAQUE_ONLY; - line_width=1; - blend_mode=VS::MATERIAL_BLEND_MODE_MIX; - point_size = 1.0; - - } - }; - mutable RID_Owner<Material> material_owner; - - void _material_check_alpha(Material *p_material); - - - struct Geometry { - - enum Type { - GEOMETRY_INVALID, - GEOMETRY_SURFACE, - GEOMETRY_POLY, - GEOMETRY_PARTICLES, - GEOMETRY_MULTISURFACE, - }; - - Type type; - RID material; - bool has_alpha; - bool material_owned; - - Geometry() { has_alpha=false; material_owned = false; } - virtual ~Geometry() {}; - }; - - struct GeometryOwner { - - virtual ~GeometryOwner() {} - }; - - class Mesh; - - struct Surface : public Geometry { - - Array data; - Array morph_data; - - bool packed; - bool alpha_sort; - int morph_target_count; - AABB aabb; - - VS::PrimitiveType primitive; - - uint32_t format; - uint32_t morph_format; - - Surface() { - - packed=false; - morph_target_count=0; - material_owned=false; - format=0; - morph_format=0; - - primitive=VS::PRIMITIVE_POINTS; - } - - ~Surface() { - - } - }; - - - struct Mesh { - - bool active; - Vector<Surface*> surfaces; - int morph_target_count; - VS::MorphTargetMode morph_target_mode; - AABB custom_aabb; - - mutable uint64_t last_pass; - Mesh() { - morph_target_mode=VS::MORPH_MODE_NORMALIZED; - morph_target_count=0; - last_pass=0; - active=false; - } - }; - mutable RID_Owner<Mesh> mesh_owner; - - struct MultiMesh; - - struct MultiMeshSurface : public Geometry { - - Surface *surface; - MultiMeshSurface() { type=GEOMETRY_MULTISURFACE; } - }; - - struct MultiMesh : public GeometryOwner { - - struct Element { - - Transform xform; - Color color; - }; - - AABB aabb; - RID mesh; - int visible; - - //IDirect3DVertexBuffer9* instance_buffer; - Vector<Element> elements; - - MultiMesh() { - visible=-1; - } - - - }; - - - mutable RID_Owner<MultiMesh> multimesh_owner; - - struct Immediate { - - - RID material; - int empty; - }; - - mutable RID_Owner<Immediate> immediate_owner; - - struct Particles : public Geometry { - - ParticleSystemSW data; // software particle system - - Particles() { - type=GEOMETRY_PARTICLES; - - } - }; - - mutable RID_Owner<Particles> particles_owner; - - struct ParticlesInstance : public GeometryOwner { - - RID particles; - - ParticleSystemProcessSW particles_process; - Transform transform; - - ParticlesInstance() { } - }; - - mutable RID_Owner<ParticlesInstance> particles_instance_owner; - ParticleSystemDrawInfoSW particle_draw_info; - - struct Skeleton { - - Vector<Transform> bones; - - }; - - mutable RID_Owner<Skeleton> skeleton_owner; - - - struct Light { - - VS::LightType type; - float vars[VS::LIGHT_PARAM_MAX]; - Color colors[3]; - bool shadow_enabled; - RID projector; - bool volumetric_enabled; - Color volumetric_color; - - - Light() { - - vars[VS::LIGHT_PARAM_SPOT_ATTENUATION]=1; - vars[VS::LIGHT_PARAM_SPOT_ANGLE]=45; - vars[VS::LIGHT_PARAM_ATTENUATION]=1.0; - vars[VS::LIGHT_PARAM_ENERGY]=1.0; - vars[VS::LIGHT_PARAM_RADIUS]=1.0; - vars[VS::LIGHT_PARAM_SHADOW_Z_OFFSET]=0.05; - - colors[VS::LIGHT_COLOR_DIFFUSE]=Color(1,1,1); - colors[VS::LIGHT_COLOR_SPECULAR]=Color(1,1,1); - shadow_enabled=false; - volumetric_enabled=false; - } - }; - - - struct Environment { - - - VS::EnvironmentBG bg_mode; - Variant bg_param[VS::ENV_BG_PARAM_MAX]; - bool fx_enabled[VS::ENV_FX_MAX]; - Variant fx_param[VS::ENV_FX_PARAM_MAX]; - - Environment() { - - bg_mode=VS::ENV_BG_DEFAULT_COLOR; - bg_param[VS::ENV_BG_PARAM_COLOR]=Color(0,0,0); - bg_param[VS::ENV_BG_PARAM_TEXTURE]=RID(); - bg_param[VS::ENV_BG_PARAM_CUBEMAP]=RID(); - bg_param[VS::ENV_BG_PARAM_ENERGY]=1.0; - - for(int i=0;i<VS::ENV_FX_MAX;i++) - fx_enabled[i]=false; - - fx_param[VS::ENV_FX_PARAM_GLOW_BLUR_PASSES]=1; - fx_param[VS::ENV_FX_PARAM_GLOW_BLOOM]=0.0; - fx_param[VS::ENV_FX_PARAM_GLOW_BLOOM_TRESHOLD]=0.5; - fx_param[VS::ENV_FX_PARAM_DOF_BLUR_PASSES]=1; - fx_param[VS::ENV_FX_PARAM_DOF_BLUR_BEGIN]=100.0; - fx_param[VS::ENV_FX_PARAM_DOF_BLUR_RANGE]=10.0; - fx_param[VS::ENV_FX_PARAM_HDR_EXPOSURE]=0.4; - fx_param[VS::ENV_FX_PARAM_HDR_WHITE]=1.0; - fx_param[VS::ENV_FX_PARAM_HDR_GLOW_TRESHOLD]=0.95; - fx_param[VS::ENV_FX_PARAM_HDR_GLOW_SCALE]=0.2; - fx_param[VS::ENV_FX_PARAM_HDR_MIN_LUMINANCE]=0.4; - fx_param[VS::ENV_FX_PARAM_HDR_MAX_LUMINANCE]=8.0; - fx_param[VS::ENV_FX_PARAM_HDR_EXPOSURE_ADJUST_SPEED]=0.5; - fx_param[VS::ENV_FX_PARAM_FOG_BEGIN]=100.0; - fx_param[VS::ENV_FX_PARAM_FOG_ATTENUATION]=1.0; - fx_param[VS::ENV_FX_PARAM_FOG_BEGIN_COLOR]=Color(0,0,0); - fx_param[VS::ENV_FX_PARAM_FOG_END_COLOR]=Color(0,0,0); - fx_param[VS::ENV_FX_PARAM_FOG_BG]=true; - fx_param[VS::ENV_FX_PARAM_BCS_BRIGHTNESS]=1.0; - fx_param[VS::ENV_FX_PARAM_BCS_CONTRAST]=1.0; - fx_param[VS::ENV_FX_PARAM_BCS_SATURATION]=1.0; - - - } - - }; - - mutable RID_Owner<Environment> environment_owner; - - struct SampledLight { - - int w,h; - }; - - mutable RID_Owner<SampledLight> sampled_light_owner; - - struct ShadowBuffer; - - struct LightInstance { - - struct SplitInfo { - - CameraMatrix camera; - Transform transform; - float near; - float far; - }; - - RID light; - Light *base; - Transform transform; - CameraMatrix projection; - - Transform custom_transform; - CameraMatrix custom_projection; - - Vector3 light_vector; - Vector3 spot_vector; - float linear_att; - - - LightInstance() { linear_att=1.0; } - - }; - - mutable RID_Owner<Light> light_owner; - mutable RID_Owner<LightInstance> light_instance_owner; - - - RID default_material; - - - - -public: - - /* TEXTURE API */ - - virtual RID texture_create(); - virtual void texture_allocate(RID p_texture,int p_width, int p_height,Image::Format p_format,uint32_t p_flags=VS::TEXTURE_FLAGS_DEFAULT); - virtual void texture_set_data(RID p_texture,const Image& p_image,VS::CubeMapSide p_cube_side=VS::CUBEMAP_LEFT); - virtual Image texture_get_data(RID p_texture,VS::CubeMapSide p_cube_side=VS::CUBEMAP_LEFT) const; - virtual void texture_set_flags(RID p_texture,uint32_t p_flags); - virtual uint32_t texture_get_flags(RID p_texture) const; - virtual Image::Format texture_get_format(RID p_texture) const; - virtual uint32_t texture_get_width(RID p_texture) const; - virtual uint32_t texture_get_height(RID p_texture) const; - virtual bool texture_has_alpha(RID p_texture) const; - virtual void texture_set_size_override(RID p_texture,int p_width, int p_height); - virtual void texture_set_reload_hook(RID p_texture,ObjectID p_owner,const StringName& p_function) const; - - virtual void texture_set_path(RID p_texture,const String& p_path) {} - virtual String texture_get_path(RID p_texture) const { return String(); } - virtual void texture_debug_usage(List<VS::TextureInfo> *r_info) {} - - virtual void texture_set_shrink_all_x2_on_set_data(bool p_enable) {} - - /* SHADER API */ - - virtual RID shader_create(VS::ShaderMode p_mode=VS::SHADER_MATERIAL); - - virtual void shader_set_mode(RID p_shader,VS::ShaderMode p_mode); - virtual VS::ShaderMode shader_get_mode(RID p_shader) const; - - virtual void shader_set_code(RID p_shader, const String& p_vertex, const String& p_fragment,const String& p_light,int p_vertex_ofs=0,int p_fragment_ofs=0,int p_light_ofs=0); - virtual String shader_get_fragment_code(RID p_shader) const; - virtual String shader_get_vertex_code(RID p_shader) const; - virtual String shader_get_light_code(RID p_shader) const; - - virtual void shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list) const; - - - virtual void shader_set_default_texture_param(RID p_shader, const StringName& p_name, RID p_texture); - virtual RID shader_get_default_texture_param(RID p_shader, const StringName& p_name) const; - - virtual Variant shader_get_default_param(RID p_shader, const StringName& p_name); - - /* COMMON MATERIAL API */ - - virtual RID material_create(); - - virtual void material_set_shader(RID p_shader_material, RID p_shader); - virtual RID material_get_shader(RID p_shader_material) const; - - virtual void material_set_param(RID p_material, const StringName& p_param, const Variant& p_value); - virtual Variant material_get_param(RID p_material, const StringName& p_param) const; - - virtual void material_set_flag(RID p_material, VS::MaterialFlag p_flag,bool p_enabled); - virtual bool material_get_flag(RID p_material,VS::MaterialFlag p_flag) const; - - virtual void material_set_depth_draw_mode(RID p_material, VS::MaterialDepthDrawMode p_mode); - virtual VS::MaterialDepthDrawMode material_get_depth_draw_mode(RID p_material) const; - - virtual void material_set_blend_mode(RID p_material,VS::MaterialBlendMode p_mode); - virtual VS::MaterialBlendMode material_get_blend_mode(RID p_material) const; - - virtual void material_set_line_width(RID p_material,float p_line_width); - virtual float material_get_line_width(RID p_material) const; - - /* MESH API */ - - - virtual RID mesh_create(); - - virtual void mesh_add_surface(RID p_mesh,VS::PrimitiveType p_primitive,const Array& p_arrays,const Array& p_blend_shapes=Array(),bool p_alpha_sort=false); - virtual Array mesh_get_surface_arrays(RID p_mesh,int p_surface) const; - virtual Array mesh_get_surface_morph_arrays(RID p_mesh,int p_surface) const; - virtual void mesh_add_custom_surface(RID p_mesh,const Variant& p_dat); - - virtual void mesh_set_morph_target_count(RID p_mesh,int p_amount); - virtual int mesh_get_morph_target_count(RID p_mesh) const; - - virtual void mesh_set_morph_target_mode(RID p_mesh,VS::MorphTargetMode p_mode); - virtual VS::MorphTargetMode mesh_get_morph_target_mode(RID p_mesh) const; - - virtual void mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material,bool p_owned=false); - virtual RID mesh_surface_get_material(RID p_mesh, int p_surface) const; - - virtual int mesh_surface_get_array_len(RID p_mesh, int p_surface) const; - virtual int mesh_surface_get_array_index_len(RID p_mesh, int p_surface) const; - virtual uint32_t mesh_surface_get_format(RID p_mesh, int p_surface) const; - virtual VS::PrimitiveType mesh_surface_get_primitive_type(RID p_mesh, int p_surface) const; - - virtual void mesh_remove_surface(RID p_mesh,int p_index); - virtual int mesh_get_surface_count(RID p_mesh) const; - - virtual AABB mesh_get_aabb(RID p_mesh,RID p_skeleton=RID()) const; - - virtual void mesh_set_custom_aabb(RID p_mesh,const AABB& p_aabb); - virtual AABB mesh_get_custom_aabb(RID p_mesh) const; - - - /* MULTIMESH API */ - - virtual RID multimesh_create(); - - virtual void multimesh_set_instance_count(RID p_multimesh,int p_count); - virtual int multimesh_get_instance_count(RID p_multimesh) const; - - virtual void multimesh_set_mesh(RID p_multimesh,RID p_mesh); - virtual void multimesh_set_aabb(RID p_multimesh,const AABB& p_aabb); - virtual void multimesh_instance_set_transform(RID p_multimesh,int p_index,const Transform& p_transform); - virtual void multimesh_instance_set_color(RID p_multimesh,int p_index,const Color& p_color); - - virtual RID multimesh_get_mesh(RID p_multimesh) const; - virtual AABB multimesh_get_aabb(RID p_multimesh) const;; - - virtual Transform multimesh_instance_get_transform(RID p_multimesh,int p_index) const; - virtual Color multimesh_instance_get_color(RID p_multimesh,int p_index) const; - - virtual void multimesh_set_visible_instances(RID p_multimesh,int p_visible); - virtual int multimesh_get_visible_instances(RID p_multimesh) const; - - /* IMMEDIATE API */ - - virtual RID immediate_create(); - virtual void immediate_begin(RID p_immediate,VS::PrimitiveType p_rimitive,RID p_texture=RID()); - virtual void immediate_vertex(RID p_immediate,const Vector3& p_vertex); - virtual void immediate_normal(RID p_immediate,const Vector3& p_normal); - virtual void immediate_tangent(RID p_immediate,const Plane& p_tangent); - virtual void immediate_color(RID p_immediate,const Color& p_color); - virtual void immediate_uv(RID p_immediate,const Vector2& tex_uv); - virtual void immediate_uv2(RID p_immediate,const Vector2& tex_uv); - virtual void immediate_end(RID p_immediate); - virtual void immediate_clear(RID p_immediate); - virtual void immediate_set_material(RID p_immediate,RID p_material); - virtual RID immediate_get_material(RID p_immediate) const; - - virtual AABB immediate_get_aabb(RID p_mesh) const; - - /* PARTICLES API */ - - virtual RID particles_create(); - - virtual void particles_set_amount(RID p_particles, int p_amount); - virtual int particles_get_amount(RID p_particles) const; - - virtual void particles_set_emitting(RID p_particles, bool p_emitting); - virtual bool particles_is_emitting(RID p_particles) const; - - virtual void particles_set_visibility_aabb(RID p_particles, const AABB& p_visibility); - virtual AABB particles_get_visibility_aabb(RID p_particles) const; - - virtual void particles_set_emission_half_extents(RID p_particles, const Vector3& p_half_extents); - virtual Vector3 particles_get_emission_half_extents(RID p_particles) const; - - virtual void particles_set_emission_base_velocity(RID p_particles, const Vector3& p_base_velocity); - virtual Vector3 particles_get_emission_base_velocity(RID p_particles) const; - - virtual void particles_set_emission_points(RID p_particles, const DVector<Vector3>& p_points); - virtual DVector<Vector3> particles_get_emission_points(RID p_particles) const; - - virtual void particles_set_gravity_normal(RID p_particles, const Vector3& p_normal); - virtual Vector3 particles_get_gravity_normal(RID p_particles) const; - - virtual void particles_set_variable(RID p_particles, VS::ParticleVariable p_variable,float p_value); - virtual float particles_get_variable(RID p_particles, VS::ParticleVariable p_variable) const; - - virtual void particles_set_randomness(RID p_particles, VS::ParticleVariable p_variable,float p_randomness); - virtual float particles_get_randomness(RID p_particles, VS::ParticleVariable p_variable) const; - - virtual void particles_set_color_phase_pos(RID p_particles, int p_phase, float p_pos); - virtual float particles_get_color_phase_pos(RID p_particles, int p_phase) const; - - virtual void particles_set_color_phases(RID p_particles, int p_phases); - virtual int particles_get_color_phases(RID p_particles) const; - - virtual void particles_set_color_phase_color(RID p_particles, int p_phase, const Color& p_color); - virtual Color particles_get_color_phase_color(RID p_particles, int p_phase) const; - - virtual void particles_set_attractors(RID p_particles, int p_attractors); - virtual int particles_get_attractors(RID p_particles) const; - - virtual void particles_set_attractor_pos(RID p_particles, int p_attractor, const Vector3& p_pos); - virtual Vector3 particles_get_attractor_pos(RID p_particles,int p_attractor) const; - - virtual void particles_set_attractor_strength(RID p_particles, int p_attractor, float p_force); - virtual float particles_get_attractor_strength(RID p_particles,int p_attractor) const; - - virtual void particles_set_material(RID p_particles, RID p_material,bool p_owned=false); - virtual RID particles_get_material(RID p_particles) const; - - virtual AABB particles_get_aabb(RID p_particles) const; - - virtual void particles_set_height_from_velocity(RID p_particles, bool p_enable); - virtual bool particles_has_height_from_velocity(RID p_particles) const; - - virtual void particles_set_use_local_coordinates(RID p_particles, bool p_enable); - virtual bool particles_is_using_local_coordinates(RID p_particles) const; - - /* SKELETON API */ - - virtual RID skeleton_create(); - virtual void skeleton_resize(RID p_skeleton,int p_bones); - virtual int skeleton_get_bone_count(RID p_skeleton) const; - virtual void skeleton_bone_set_transform(RID p_skeleton,int p_bone, const Transform& p_transform); - virtual Transform skeleton_bone_get_transform(RID p_skeleton,int p_bone); - - - /* LIGHT API */ - - virtual RID light_create(VS::LightType p_type); - virtual VS::LightType light_get_type(RID p_light) const; - - virtual void light_set_color(RID p_light,VS::LightColor p_type, const Color& p_color); - virtual Color light_get_color(RID p_light,VS::LightColor p_type) const; - - virtual void light_set_shadow(RID p_light,bool p_enabled); - virtual bool light_has_shadow(RID p_light) const; - - virtual void light_set_volumetric(RID p_light,bool p_enabled); - virtual bool light_is_volumetric(RID p_light) const; - - virtual void light_set_projector(RID p_light,RID p_texture); - virtual RID light_get_projector(RID p_light) const; - - virtual void light_set_var(RID p_light, VS::LightParam p_var, float p_value); - virtual float light_get_var(RID p_light, VS::LightParam p_var) const; - - virtual void light_set_operator(RID p_light,VS::LightOp p_op); - virtual VS::LightOp light_get_operator(RID p_light) const; - - virtual void light_omni_set_shadow_mode(RID p_light,VS::LightOmniShadowMode p_mode); - virtual VS::LightOmniShadowMode light_omni_get_shadow_mode(RID p_light) const; - - - virtual void light_directional_set_shadow_mode(RID p_light,VS::LightDirectionalShadowMode p_mode); - virtual VS::LightDirectionalShadowMode light_directional_get_shadow_mode(RID p_light) const; - virtual void light_directional_set_shadow_param(RID p_light,VS::LightDirectionalShadowParam p_param, float p_value); - virtual float light_directional_get_shadow_param(RID p_light,VS::LightDirectionalShadowParam p_param) const; - - virtual AABB light_get_aabb(RID p_poly) const; - - - virtual RID light_instance_create(RID p_light); - virtual void light_instance_set_transform(RID p_light_instance,const Transform& p_transform); - - virtual bool light_instance_has_shadow(RID p_light_instance) const; - virtual bool light_instance_assign_shadow(RID p_light_instance); - virtual ShadowType light_instance_get_shadow_type(RID p_light_instance) const; - virtual int light_instance_get_shadow_passes(RID p_light_instance) const; - virtual bool light_instance_get_pssm_shadow_overlap(RID p_light_instance) const; - virtual void light_instance_set_custom_transform(RID p_light_instance, int p_index, const CameraMatrix& p_camera, const Transform& p_transform, float p_split_near=0,float p_split_far=0); - virtual int light_instance_get_shadow_size(RID p_light_instance, int p_index=0) const { return 1; } - - virtual ShadowType light_instance_get_shadow_type(RID p_light_instance,bool p_far=false) const; - virtual void light_instance_set_shadow_transform(RID p_light_instance, int p_index, const CameraMatrix& p_camera, const Transform& p_transform, float p_split_near=0,float p_split_far=0); - - virtual void shadow_clear_near(); - virtual bool shadow_allocate_near(RID p_light); - virtual bool shadow_allocate_far(RID p_light); - - - /* PARTICLES INSTANCE */ - - virtual RID particles_instance_create(RID p_particles); - virtual void particles_instance_set_transform(RID p_particles_instance,const Transform& p_transform); - - /* VIEWPORT */ - - virtual RID viewport_data_create(); - - virtual RID render_target_create(); - virtual void render_target_set_size(RID p_render_target, int p_width, int p_height); - virtual RID render_target_get_texture(RID p_render_target) const; - virtual bool render_target_renedered_in_frame(RID p_render_target); - - /* RENDER API */ - /* all calls (inside begin/end shadow) are always warranted to be in the following order: */ - - virtual void begin_frame(); - - virtual void set_viewport(const VS::ViewportRect& p_viewport); - virtual void set_render_target(RID p_render_target,bool p_transparent_bg=false,bool p_vflip=false); - virtual void clear_viewport(const Color& p_color); - virtual void capture_viewport(Image* r_capture); - - - virtual void begin_scene(RID p_viewport_data,RID p_env,VS::ScenarioDebugMode p_debug); - virtual void begin_shadow_map( RID p_light_instance, int p_shadow_pass ); - - virtual void set_camera(const Transform& p_world,const CameraMatrix& p_projection,bool p_ortho_hint); - - virtual void add_light( RID p_light_instance ); ///< all "add_light" calls happen before add_geometry calls - - - virtual void add_mesh( const RID& p_mesh, const InstanceData *p_data); - virtual void add_multimesh( const RID& p_multimesh, const InstanceData *p_data); - virtual void add_immediate( const RID& p_immediate, const InstanceData *p_data) {} - virtual void add_particles( const RID& p_particle_instance, const InstanceData *p_data); - - virtual void end_scene(); - virtual void end_shadow_map(); - - virtual void end_frame(); - - /* CANVAS API */ - - virtual void begin_canvas_bg(); - virtual void canvas_begin(); - virtual void canvas_disable_blending(); - virtual void canvas_set_opacity(float p_opacity); - virtual void canvas_set_blend_mode(VS::MaterialBlendMode p_mode); - virtual void canvas_begin_rect(const Matrix32& p_transform); - virtual void canvas_set_clip(bool p_clip, const Rect2& p_rect); - virtual void canvas_end_rect(); - virtual void canvas_draw_line(const Point2& p_from, const Point2& p_to,const Color& p_color,float p_width,bool p_antialiased); - virtual void canvas_draw_rect(const Rect2& p_rect, int p_flags, const Rect2& p_source,RID p_texture,const Color& p_modulate); - virtual void canvas_draw_style_box(const Rect2& p_rect, const Rect2& p_src_region, RID p_texture,const float *p_margins, bool p_draw_center=true,const Color& p_modulate=Color(1,1,1)); - virtual void canvas_draw_primitive(const Vector<Point2>& p_points, const Vector<Color>& p_colors,const Vector<Point2>& p_uvs, RID p_texture,float p_width); - virtual void canvas_draw_polygon(int p_vertex_count, const int* p_indices, const Vector2* p_vertices, const Vector2* p_uvs, const Color* p_colors,const RID& p_texture,bool p_singlecolor); - virtual void canvas_set_transform(const Matrix32& p_transform); - - virtual void canvas_render_items(CanvasItem *p_item_list,int p_z,const Color& p_modulate,CanvasLight *p_light); - - virtual RID canvas_light_occluder_create(); - virtual void canvas_light_occluder_set_polylines(RID p_occluder, const DVector<Vector2>& p_lines); - - virtual RID canvas_light_shadow_buffer_create(int p_width); - virtual void canvas_light_shadow_buffer_update(RID p_buffer, const Matrix32& p_light_xform, int p_light_mask,float p_near, float p_far, CanvasLightOccluderInstance* p_occluders, CameraMatrix *p_xform_cache); - - virtual void canvas_debug_viewport_shadows(CanvasLight* p_lights_with_shadow); - - /* ENVIRONMENT */ - - virtual RID environment_create(); - - virtual void environment_set_background(RID p_env,VS::EnvironmentBG p_bg); - virtual VS::EnvironmentBG environment_get_background(RID p_env) const; - - virtual void environment_set_background_param(RID p_env,VS::EnvironmentBGParam p_param, const Variant& p_value); - virtual Variant environment_get_background_param(RID p_env,VS::EnvironmentBGParam p_param) const; - - virtual void environment_set_enable_fx(RID p_env,VS::EnvironmentFx p_effect,bool p_enabled); - virtual bool environment_is_fx_enabled(RID p_env,VS::EnvironmentFx p_effect) const; - - virtual void environment_fx_set_param(RID p_env,VS::EnvironmentFxParam p_param,const Variant& p_value); - virtual Variant environment_fx_get_param(RID p_env,VS::EnvironmentFxParam p_param) const; - - /* SAMPLED LIGHT */ - virtual RID sampled_light_dp_create(int p_width,int p_height); - virtual void sampled_light_dp_update(RID p_sampled_light,const Color *p_data,float p_multiplier); - - - /*MISC*/ - - virtual bool is_texture(const RID& p_rid) const; - virtual bool is_material(const RID& p_rid) const; - virtual bool is_mesh(const RID& p_rid) const; - virtual bool is_immediate(const RID& p_rid) const; - virtual bool is_multimesh(const RID& p_rid) const; - virtual bool is_particles(const RID &p_beam) const; - - virtual bool is_light(const RID& p_rid) const; - virtual bool is_light_instance(const RID& p_rid) const; - virtual bool is_particles_instance(const RID& p_rid) const; - virtual bool is_skeleton(const RID& p_rid) const; - virtual bool is_environment(const RID& p_rid) const; - virtual bool is_canvas_light_occluder(const RID& p_rid) const; - - virtual bool is_shader(const RID& p_rid) const; - - virtual void free(const RID& p_rid); - - virtual void custom_shade_model_set_shader(int p_model, RID p_shader); - virtual RID custom_shade_model_get_shader(int p_model) const; - virtual void custom_shade_model_set_name(int p_model, const String& p_name); - virtual String custom_shade_model_get_name(int p_model) const; - virtual void custom_shade_model_set_param_info(int p_model, const List<PropertyInfo>& p_info); - virtual void custom_shade_model_get_param_info(int p_model, List<PropertyInfo>* p_info) const; - - - virtual void init(); - virtual void finish(); - - virtual int get_render_info(VS::RenderInfo p_info); - - virtual bool needs_to_draw_next_frame() const; - - virtual bool has_feature(VS::Features p_feature) const; - - virtual void restore_framebuffer(); - - RasterizerDummy(); - virtual ~RasterizerDummy(); -}; - - -#endif // RASTERIZER_DUMMY_H diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index fdf3cb622d..ea634e8f06 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -44,14 +44,71 @@ static bool _is_hex(CharType c) { return (c>='0' && c<='9') || (c>='a' && c<='f') || (c>='A' && c<='F'); } + +String ShaderLanguage::get_operator_text(Operator p_op) { + + static const char* op_names[OP_MAX]={"==", + "!=", + "<", + "<=", + ">", + ">=", + "&&", + "||", + "!", + "-", + "+", + "-", + "*", + "/", + "%", + "<<", + ">>", + "=", + "+=", + "-=", + "*=", + "/=", + "%=", + "<<=", + ">>=", + "&=", + "|=", + "^=", + "&", + "|", + "^", + "~", + "++" + "--", + "()", + "construct"}; + + return op_names[p_op]; + +} + + const char * ShaderLanguage::token_names[TK_MAX]={ "EMPTY", - "INDENTIFIER", + "IDENTIFIER", "TRUE", "FALSE", "REAL_CONSTANT", + "INT_CONSTANT", "TYPE_VOID", "TYPE_BOOL", + "TYPE_BVEC2", + "TYPE_BVEC3", + "TYPE_BVEC4", + "TYPE_INT", + "TYPE_IVEC2", + "TYPE_IVEC3", + "TYPE_IVEC4", + "TYPE_UINT", + "TYPE_UVEC2", + "TYPE_UVEC3", + "TYPE_UVEC4", "TYPE_FLOAT", "TYPE_VEC2", "TYPE_VEC3", @@ -59,9 +116,13 @@ const char * ShaderLanguage::token_names[TK_MAX]={ "TYPE_MAT2", "TYPE_MAT3", "TYPE_MAT4", - "TYPE_TEXTURE", - "TYPE_CUBEMAP", - "TYPE_COLOR", + "TYPE_SAMPLER2D", + "TYPE_ISAMPLER2D", + "TYPE_USAMPLER2D", + "TYPE_SAMPLERCUBE", + "PRECISION_LOW", + "PRECISION_MID", + "PRECISION_HIGH", "OP_EQUAL", "OP_NOT_EQUAL", "OP_LESS", @@ -75,14 +136,35 @@ const char * ShaderLanguage::token_names[TK_MAX]={ "OP_SUB", "OP_MUL", "OP_DIV", - "OP_NEG", + "OP_MOD", + "OP_SHIFT_LEFT", + "OP_SHIFT_RIGHT", "OP_ASSIGN", "OP_ASSIGN_ADD", "OP_ASSIGN_SUB", "OP_ASSIGN_MUL", "OP_ASSIGN_DIV", + "OP_ASSIGN_MOD", + "OP_ASSIGN_SHIFT_LEFT", + "OP_ASSIGN_SHIFT_RIGHT", + "OP_ASSIGN_BIT_AND", + "OP_ASSIGN_BIT_OR", + "OP_ASSIGN_BIT_XOR", + "OP_BIT_AND", + "OP_BIT_OR", + "OP_BIT_XOR", + "OP_BIT_INVERT", + "OP_INCREMENT", + "OP_DECREMENT", "CF_IF", "CF_ELSE", + "CF_FOR", + "CF_WHILE", + "CF_DO", + "CF_SWITCH", + "CF_CASE", + "CF_BREAK", + "CF_CONTINUE", "CF_RETURN", "BRACKET_OPEN", "BRACKET_CLOSE", @@ -90,460 +172,504 @@ const char * ShaderLanguage::token_names[TK_MAX]={ "CURLY_BRACKET_CLOSE", "PARENTHESIS_OPEN", "PARENTHESIS_CLOSE", + "QUESTION", "COMMA", + "COLON", "SEMICOLON", "PERIOD", "UNIFORM", + "VARYING", + "RENDER_MODE", + "HINT_WHITE_TEXTURE", + "HINT_BLACK_TEXTURE", + "HINT_NORMAL_TEXTURE", + "HINT_ANISO_TEXTURE", + "HINT_ALBEDO_TEXTURE", + "HINT_BLACK_ALBEDO_TEXTURE", + "HINT_COLOR", + "HINT_RANGE", + "CURSOR", "ERROR", + "EOF", }; -ShaderLanguage::Token ShaderLanguage::read_token(const CharType* p_text,int p_len,int &r_line,int &r_chars) { +String ShaderLanguage::get_token_text(Token p_token) { -#define GETCHAR(m_idx) ((m_idx<p_len)?p_text[m_idx]:CharType(0)) + String name=token_names[p_token.type]; + if (p_token.type==TK_INT_CONSTANT || p_token.type==TK_REAL_CONSTANT) { + name+="("+rtos(p_token.constant)+")"; + } else if (p_token.type==TK_IDENTIFIER) { + name+="("+String(p_token.text)+")"; + } else if (p_token.type==TK_ERROR) { + name+="("+String(p_token.text)+")"; + } - r_chars=1; //by default everything eats one char - switch(GETCHAR(0)) { + return name; +} - case '\t': - case '\r': - case ' ': - return Token(); - case '\n': - r_line++; - return Token(); - case '/': { +ShaderLanguage::Token ShaderLanguage::_make_token(TokenType p_type,const StringName& p_text) { - switch(GETCHAR(1)) { - case '*': { // block comment + Token tk; + tk.type=p_type; + tk.text=p_text; + tk.line=tk_line; + if (tk.type==TK_ERROR) { + _set_error(p_text); + } + return tk; +} +const ShaderLanguage::KeyWord ShaderLanguage::keyword_list[]={ + {TK_TRUE,"true"}, + {TK_FALSE,"false"}, + {TK_TYPE_VOID,"void"}, + {TK_TYPE_BOOL,"bool"}, + {TK_TYPE_BVEC2,"bvec2"}, + {TK_TYPE_BVEC3,"bvec3"}, + {TK_TYPE_BVEC4,"bvec4"}, + {TK_TYPE_INT,"int"}, + {TK_TYPE_IVEC2,"ivec2"}, + {TK_TYPE_IVEC3,"ivec3"}, + {TK_TYPE_IVEC4,"ivec4"}, + {TK_TYPE_UINT,"uint"}, + {TK_TYPE_UVEC2,"uvec2"}, + {TK_TYPE_UVEC3,"uvec3"}, + {TK_TYPE_UVEC4,"uvec4"}, + {TK_TYPE_FLOAT,"float"}, + {TK_TYPE_VEC2,"vec2"}, + {TK_TYPE_VEC3,"vec3"}, + {TK_TYPE_VEC4,"vec4"}, + {TK_TYPE_MAT2,"mat2"}, + {TK_TYPE_MAT3,"mat3"}, + {TK_TYPE_MAT4,"mat4"}, + {TK_TYPE_SAMPLER2D,"sampler2D"}, + {TK_TYPE_ISAMPLER2D,"isampler2D"}, + {TK_TYPE_USAMPLER2D,"usampler2D"}, + {TK_TYPE_SAMPLERCUBE,"samplerCube"}, + {TK_PRECISION_LOW,"lowp"}, + {TK_PRECISION_MID,"mediump"}, + {TK_PRECISION_HIGH,"highp"}, + {TK_CF_IF,"if"}, + {TK_CF_ELSE,"else"}, + {TK_CF_FOR,"for"}, + {TK_CF_WHILE,"while"}, + {TK_CF_DO,"do"}, + {TK_CF_SWITCH,"switch"}, + {TK_CF_CASE,"case"}, + {TK_CF_BREAK,"break"}, + {TK_CF_CONTINUE,"continue"}, + {TK_CF_RETURN,"return"}, + {TK_UNIFORM,"uniform"}, + {TK_VARYING,"varying"}, + {TK_RENDER_MODE,"render_mode"}, + {TK_HINT_WHITE_TEXTURE,"hint_white"}, + {TK_HINT_BLACK_TEXTURE,"hint_black"}, + {TK_HINT_NORMAL_TEXTURE,"hint_normal"}, + {TK_HINT_ANISO_TEXTURE,"hint_aniso"}, + {TK_HINT_ALBEDO_TEXTURE,"hint_albedo"}, + {TK_HINT_BLACK_ALBEDO_TEXTURE,"hint_black_albedo"}, + {TK_HINT_COLOR,"hint_color"}, + {TK_HINT_RANGE,"hint_range"}, + + {TK_ERROR,NULL} +}; - while(true) { - if (GETCHAR(r_chars+1)==0) { - r_chars+=1; - break; - } if (GETCHAR(r_chars+1)=='*' && GETCHAR(r_chars+2)=='/') { - r_chars+=3; - break; - } if (GETCHAR(r_chars+1)=='\n') { - r_line++; - } - r_chars++; - } - return Token(); +ShaderLanguage::Token ShaderLanguage::_get_token() { - } break; - case '/': { // line comment skip +#define GETCHAR(m_idx) (((char_idx+m_idx)<code.length())?code[char_idx+m_idx]:CharType(0)) - while(GETCHAR(r_chars+1)!='\n' && GETCHAR(r_chars+1)!=0) { - r_chars++; - } - r_chars++; - //r_line++; - - return Token(); + while(true) { + char_idx++; + switch(GETCHAR(-1)) { + + case 0: + return _make_token(TK_EOF); + case 0xFFFF: + return _make_token(TK_CURSOR); //for completion + case '\t': + case '\r': + case ' ': + continue; + case '\n': + tk_line++; + continue; + case '/': { - } break; - case '=': { // diveq + switch(GETCHAR(0)) { + case '*': { // block comment - r_chars=2; - return Token(TK_OP_ASSIGN_DIV); + char_idx++; + while(true) { + if (GETCHAR(0)==0) { + return _make_token(TK_EOF); + } if (GETCHAR(0)=='*' && GETCHAR(1)=='/') { + char_idx+=2; + break; + } if (GETCHAR(0)=='\n') { + tk_line++; + } - } break; - default: - return Token(TK_OP_DIV); + char_idx++; + } - } - } break; - case '=': { - if (GETCHAR(1)=='=') { - r_chars++; - return Token(TK_OP_EQUAL); - } + } break; + case '/': { // line comment skip - return Token(TK_OP_ASSIGN); - } break; - case '<': { - if (GETCHAR(1)=='=') { - r_chars++; - return Token(TK_OP_LESS_EQUAL); - } /*else if (GETCHAR(1)=='<') { - r_chars++; - if (GETCHAR(2)=='=') { - r_chars++; - return Token(TK_OP_ASSIGN_SHIFT_LEFT); - } + while(true) { + if (GETCHAR(0)=='\n') { + char_idx++; + break; + } + if (GETCHAR(0)==0) { + return _make_token(TK_EOF); + } + char_idx++; + } - return Token(TK_OP_SHIFT_LEFT); - }*/ + } break; + case '=': { // diveq - return Token(TK_OP_LESS); + char_idx++; + return _make_token(TK_OP_ASSIGN_DIV); - } break; - case '>': { - if (GETCHAR(1)=='=') { - r_chars++; - return Token(TK_OP_GREATER_EQUAL); - }/* else if (GETCHAR(1)=='<') { - r_chars++; - if (GETCHAR(2)=='=') { - r_chars++; - return Token(TK_OP_ASSIGN_SHIFT_RIGHT); + } break; + default: + return _make_token(TK_OP_DIV); } - return Token(TK_OP_SHIFT_RIGHT); - }*/ - - return Token(TK_OP_GREATER); - - } break; - case '!': { - if (GETCHAR(1)=='=') { - r_chars++; - return Token(TK_OP_NOT_EQUAL); - } + continue; //a comment, continue to next token + } break; + case '=': { - return Token(TK_OP_NOT); - - } break; - //case '"' //string - no strings in shader - //case '\'' //string - no strings in shader - case '{': - return Token(TK_CURLY_BRACKET_OPEN); - case '}': - return Token(TK_CURLY_BRACKET_CLOSE); - //case '[': - // return Token(TK_BRACKET_OPEN); - //case ']': - // return Token(TK_BRACKET_CLOSE); - case '(': - return Token(TK_PARENTHESIS_OPEN); - case ')': - return Token(TK_PARENTHESIS_CLOSE); - case ',': - return Token(TK_COMMA); - case ';': - return Token(TK_SEMICOLON); - //case '?': - // return Token(TK_QUESTION_MARK); - //case ':': - // return Token(TK_COLON); //for methods maybe but now useless. - //case '^': - // return Token(TK_OP_BIT_XOR); - //case '~': - // return Token(TK_OP_BIT_INVERT); - case '&': { - - if (GETCHAR(1)=='&') { - - r_chars++; - return Token(TK_OP_AND); - } - - return Token(TK_ERROR,"Unknown character"); - -/* - if (GETCHAR(1)=='=') { - r_chars++; - return Token(TK_OP_ASSIGN_BIT_AND); - } else if (GETCHAR(1)=='&') { - r_chars++; - return Token(TK_OP_AND); - } - return TK_OP_BIT_AND;*/ - } break; - case '|': { + if (GETCHAR(0)=='=') { + char_idx++; + return _make_token(TK_OP_EQUAL); + } - if (GETCHAR(1)=='|') { + return _make_token(TK_OP_ASSIGN); + + } break; + case '<': { + if (GETCHAR(0)=='=') { + char_idx++; + return _make_token(TK_OP_LESS_EQUAL); + } else if (GETCHAR(0)=='<') { + char_idx++; + if (GETCHAR(0)=='=') { + char_idx++; + return _make_token(TK_OP_ASSIGN_SHIFT_LEFT); + } - r_chars++; - return Token(TK_OP_OR); - } + return _make_token(TK_OP_SHIFT_LEFT); + } - return Token(TK_ERROR,"Unknown character"); + return _make_token(TK_OP_LESS); + + } break; + case '>': { + if (GETCHAR(0)=='=') { + char_idx++; + return _make_token(TK_OP_GREATER_EQUAL); + } else if (GETCHAR(0)=='<') { + char_idx++;; + if (GETCHAR(0)=='=') { + char_idx++; + return _make_token(TK_OP_ASSIGN_SHIFT_RIGHT); + } - /* - if (GETCHAR(1)=='=') { - r_chars++; - return Token(TK_OP_ASSIGN_BIT_OR); - } else if (GETCHAR(1)=='|') { - r_chars++; - return Token(TK_OP_OR); - } - return TK_OP_BIT_OR; - */ - } break; - case '*': { + return _make_token(TK_OP_SHIFT_RIGHT); + } - if (GETCHAR(1)=='=') { - r_chars++; - return Token(TK_OP_ASSIGN_MUL); - } - return TK_OP_MUL; - } break; - case '+': { + return _make_token(TK_OP_GREATER); - if (GETCHAR(1)=='=') { - r_chars++; - return Token(TK_OP_ASSIGN_ADD); - } /*else if (GETCHAR(1)=='+') { + } break; + case '!': { + if (GETCHAR(0)=='=') { + char_idx++; + return _make_token(TK_OP_NOT_EQUAL); + } - r_chars++; - return Token(TK_OP_PLUS_PLUS); - }*/ + return _make_token(TK_OP_NOT); + + } break; + //case '"' //string - no strings in shader + //case '\'' //string - no strings in shader + case '{': + return _make_token(TK_CURLY_BRACKET_OPEN); + case '}': + return _make_token(TK_CURLY_BRACKET_CLOSE); + case '[': + return _make_token(TK_BRACKET_OPEN); + case ']': + return _make_token(TK_BRACKET_CLOSE); + case '(': + return _make_token(TK_PARENTHESIS_OPEN); + case ')': + return _make_token(TK_PARENTHESIS_CLOSE); + case ',': + return _make_token(TK_COMMA); + case ';': + return _make_token(TK_SEMICOLON); + case '?': + return _make_token(TK_QUESTION); + case ':': + return _make_token(TK_COLON); + case '^': + return _make_token(TK_OP_BIT_XOR); + case '~': + return _make_token(TK_OP_BIT_INVERT); + case '&': { + if (GETCHAR(0)=='=') { + char_idx++; + return _make_token(TK_OP_ASSIGN_BIT_AND); + } else if (GETCHAR(0)=='&') { + char_idx++; + return _make_token(TK_OP_AND); + } + return _make_token(TK_OP_BIT_AND); + } break; + case '|': { + + if (GETCHAR(0)=='=') { + char_idx++; + return _make_token(TK_OP_ASSIGN_BIT_OR); + } else if (GETCHAR(0)=='|') { + char_idx++; + return _make_token(TK_OP_OR); + } + return _make_token(TK_OP_BIT_OR); - return TK_OP_ADD; - } break; - case '-': { + } break; + case '*': { - if (GETCHAR(1)=='=') { - r_chars++; - return Token(TK_OP_ASSIGN_SUB); - }/* else if (GETCHAR(1)=='-') { + if (GETCHAR(0)=='=') { + char_idx++; + return _make_token(TK_OP_ASSIGN_MUL); + } + return _make_token(TK_OP_MUL); + } break; + case '+': { - r_chars++; - return Token(TK_OP_MINUS_MINUS); - }*/ + if (GETCHAR(0)=='=') { + char_idx++; + return _make_token(TK_OP_ASSIGN_ADD); + } else if (GETCHAR(0)=='+') { - return TK_OP_SUB; - } break; - /*case '%': { + char_idx++; + return _make_token(TK_OP_INCREMENT); + } - if (GETCHAR(1)=='=') { - r_chars++; - return Token(TK_OP_ASSIGN_MOD); - } + return _make_token(TK_OP_ADD); + } break; + case '-': { - return TK_OP_MOD; - } break;*/ - default: { + if (GETCHAR(0)=='=') { + char_idx++; + return _make_token(TK_OP_ASSIGN_SUB); + }else if (GETCHAR(0)=='-') { - if (_is_number(GETCHAR(0)) || (GETCHAR(0)=='.' && _is_number(GETCHAR(1)))) { - // parse number - bool period_found=false; - bool exponent_found=false; - bool hexa_found=false; - bool sign_found=false; + char_idx++; + return _make_token(TK_OP_DECREMENT); + } - String str; - int i=0; + return _make_token(TK_OP_SUB); + } break; + case '%': { - while(true) { - if (GETCHAR(i)=='.') { - if (period_found || exponent_found) - return Token(TK_ERROR,"Invalid numeric constant"); - period_found=true; - } else if (GETCHAR(i)=='x') { - if (hexa_found || str.length()!=1 || str[0]!='0') - return Token(TK_ERROR,"Invalid numeric constant"); - hexa_found=true; - } else if (GETCHAR(i)=='e') { - if (hexa_found || exponent_found) - return Token(TK_ERROR,"Invalid numeric constant"); - exponent_found=true; - } else if (_is_number(GETCHAR(i))) { - //all ok - } else if (hexa_found && _is_hex(GETCHAR(i))) { - - } else if ((GETCHAR(i)=='-' || GETCHAR(i)=='+') && exponent_found) { - if (sign_found) - return Token(TK_ERROR,"Invalid numeric constant"); - sign_found=true; - } else - break; - - str+=CharType(GETCHAR(i)); - i++; + if (GETCHAR(0)=='=') { + char_idx++; + return _make_token(TK_OP_ASSIGN_MOD); } - if (!_is_number(str[str.length()-1])) - return Token(TK_ERROR,"Invalid numeric constant"); + return _make_token(TK_OP_MOD); + } break; + default: { - r_chars+=str.length()-1; - return Token(TK_REAL_CONSTANT,str); - /* - if (period_found) - return Token(TK_NUMBER_REAL,str); - else - return Token(TK_NUMBER_INTEGER,str);*/ + char_idx--; //go back one, since we have no idea what this is - } + if (_is_number(GETCHAR(0)) || (GETCHAR(0)=='.' && _is_number(GETCHAR(1)))) { + // parse number + bool period_found=false; + bool exponent_found=false; + bool hexa_found=false; + bool sign_found=false; + bool minus_exponent_found=false; - if (GETCHAR(0)=='.') { - //parse period - return Token(TK_PERIOD); - } + String str; + int i=0; - if (_is_text_char(GETCHAR(0))) { - // parse identifier - String str; - str+=CharType(GETCHAR(0)); + while(true) { + if (GETCHAR(i)=='.') { + if (period_found || exponent_found) + return _make_token(TK_ERROR,"Invalid numeric constant"); + period_found=true; + } else if (GETCHAR(i)=='x') { + if (hexa_found || str.length()!=1 || str[0]!='0') + return _make_token(TK_ERROR,"Invalid numeric constant"); + hexa_found=true; + } else if (GETCHAR(i)=='e') { + if (hexa_found || exponent_found) + return _make_token(TK_ERROR,"Invalid numeric constant"); + exponent_found=true; + } else if (_is_number(GETCHAR(i))) { + //all ok + } else if (hexa_found && _is_hex(GETCHAR(i))) { + + } else if ((GETCHAR(i)=='-' || GETCHAR(i)=='+') && exponent_found) { + if (sign_found) + return _make_token(TK_ERROR,"Invalid numeric constant"); + sign_found=true; + if (GETCHAR(i)=='-') + minus_exponent_found=true; + } else + break; - while(_is_text_char(GETCHAR(r_chars))) { + str+=CharType(GETCHAR(i)); + i++; + } - str+=CharType(GETCHAR(r_chars)); - r_chars++; - } + if (!_is_number(str[str.length()-1])) + return _make_token(TK_ERROR,"Invalid numeric constant"); - //see if keyword - struct _kws { TokenType token; const char *text;}; - static const _kws keyword_list[]={ - {TK_TRUE,"true"}, - {TK_FALSE,"false"}, - {TK_TYPE_VOID,"void"}, - {TK_TYPE_BOOL,"bool"}, - /*{TK_TYPE_INT,"int"}, - {TK_TYPE_INT2,"int2"}, - {TK_TYPE_INT3,"int3"}, - {TK_TYPE_INT4,"int4"},*/ - {TK_TYPE_FLOAT,"float"}, - /*{TK_TYPE_FLOAT2,"float2"}, - {TK_TYPE_FLOAT3,"float3"}, - {TK_TYPE_FLOAT4,"float4"},*/ - {TK_TYPE_VEC2,"vec2"}, - {TK_TYPE_VEC3,"vec3"}, - {TK_TYPE_VEC4,"vec4"}, - {TK_TYPE_TEXTURE,"texture"}, - {TK_TYPE_CUBEMAP,"cubemap"}, - {TK_TYPE_COLOR,"color"}, + char_idx+=str.length(); + Token tk; + if (period_found || minus_exponent_found) + tk.type=TK_REAL_CONSTANT; + else + tk.type=TK_INT_CONSTANT; - {TK_TYPE_MAT2,"mat2"}, - /*{TK_TYPE_MAT3,"mat3"}, - {TK_TYPE_MAT4,"mat3"},*/ - {TK_TYPE_MAT3,"mat3"}, - {TK_TYPE_MAT4,"mat4"}, - {TK_CF_IF,"if"}, - {TK_CF_ELSE,"else"}, - /* - {TK_CF_FOR,"for"}, - {TK_CF_WHILE,"while"}, - {TK_CF_DO,"do"}, - {TK_CF_SWITCH,"switch"}, - {TK_CF_BREAK,"break"}, - {TK_CF_CONTINUE,"continue"},*/ - {TK_CF_RETURN,"return"}, - {TK_UNIFORM,"uniform"}, - {TK_ERROR,NULL} - }; + if (!str.is_valid_float()) { + return _make_token(TK_ERROR,"Invalid numeric constant"); + } - int idx=0; + tk.constant=str.to_double(); + tk.line=tk_line; - while(keyword_list[idx].text) { + return tk; - if (str==keyword_list[idx].text) - return Token(keyword_list[idx].token); - idx++; } + if (GETCHAR(0)=='.') { + //parse period + char_idx++; + return _make_token(TK_PERIOD); + } - return Token(TK_INDENTIFIER,str); - } - - if (GETCHAR(0)>32) - return Token(TK_ERROR,"Tokenizer: Unknown character #"+itos(GETCHAR(0))+": '"+String::chr(GETCHAR(0))+"'"); - else - return Token(TK_ERROR,"Tokenizer: Unknown character #"+itos(GETCHAR(0))); + if (_is_text_char(GETCHAR(0))) { + // parse identifier + String str; - } break; - } + while(_is_text_char(GETCHAR(0))) { - ERR_PRINT("BUG"); - return Token(); -} + str+=CharType(GETCHAR(0)); + char_idx++; + } -Error ShaderLanguage::tokenize(const String& p_text,Vector<Token> *p_tokens,String *r_error,int *r_err_line,int *r_err_column) { + //see if keyword + //should be converted to a static map + int idx=0; + while(keyword_list[idx].text) { - int len =p_text.length(); - int pos=0; + if (str==keyword_list[idx].text) { - int line=0; + return _make_token(keyword_list[idx].token); + } + idx++; + } - while(pos<len) { - int advance=0; - int prev_line=line; - Token t = read_token(&p_text[pos],len-pos,line,advance); - t.line=prev_line; + return _make_token(TK_IDENTIFIER,str); + } - if (t.type==TK_ERROR) { + if (GETCHAR(0)>32) + return _make_token(TK_ERROR,"Tokenizer: Unknown character #"+itos(GETCHAR(0))+": '"+String::chr(GETCHAR(0))+"'"); + else + return _make_token(TK_ERROR,"Tokenizer: Unknown character #"+itos(GETCHAR(0))); - if (r_error) { - *r_error=t.text; - *r_err_line=line; - return ERR_COMPILATION_FAILED; - } + } break; } + } + ERR_PRINT("BUG"); + return Token(); +} - if (t.type!=TK_EMPTY) - p_tokens->push_back(t); - //if (prev_line!=line) - // p_tokens->push_back(Token(TK_LINE,itos(line))); - pos+=advance; +String ShaderLanguage::token_debug(const String& p_code) { - } + clear(); - return OK; + code=p_code; -} + String output; -String ShaderLanguage::lex_debug(const String& p_code) { + Token tk = _get_token(); + while(tk.type!=TK_EOF && tk.type!=TK_ERROR) { - Vector<Token> tokens; - String error; - int errline,errcol; - if (tokenize(p_code,&tokens,&error,&errline,&errcol)!=OK) - return error; - String ret; - for(int i=0;i<tokens.size();i++) { - ret+=String(token_names[tokens[i].type])+":"+itos(tokens[i].line)+":"+itos(tokens[i].col)+":"+tokens[i].text+"\n"; + output+=itos(tk_line)+": "+get_token_text(tk)+"\n"; + tk = _get_token(); } - return ret; + return output; } bool ShaderLanguage::is_token_datatype(TokenType p_type) { - return - (p_type==TK_TYPE_VOID) || - (p_type==TK_TYPE_BOOL) || - (p_type==TK_TYPE_FLOAT) || - (p_type==TK_TYPE_VEC2) || - (p_type==TK_TYPE_VEC3) || - (p_type==TK_TYPE_VEC4) || - (p_type==TK_TYPE_COLOR) || - (p_type==TK_TYPE_MAT2) || - (p_type==TK_TYPE_MAT3) || - (p_type==TK_TYPE_MAT4) || - (p_type==TK_TYPE_CUBEMAP) || - (p_type==TK_TYPE_TEXTURE); + return ( + p_type==TK_TYPE_VOID || + p_type==TK_TYPE_BOOL || + p_type==TK_TYPE_BVEC2 || + p_type==TK_TYPE_BVEC3 || + p_type==TK_TYPE_BVEC4 || + p_type==TK_TYPE_INT || + p_type==TK_TYPE_IVEC2 || + p_type==TK_TYPE_IVEC3 || + p_type==TK_TYPE_IVEC4 || + p_type==TK_TYPE_UINT || + p_type==TK_TYPE_UVEC2 || + p_type==TK_TYPE_UVEC3 || + p_type==TK_TYPE_UVEC4 || + p_type==TK_TYPE_FLOAT || + p_type==TK_TYPE_VEC2 || + p_type==TK_TYPE_VEC3 || + p_type==TK_TYPE_VEC4 || + p_type==TK_TYPE_MAT2 || + p_type==TK_TYPE_MAT3 || + p_type==TK_TYPE_MAT4 || + p_type==TK_TYPE_SAMPLER2D || + p_type==TK_TYPE_ISAMPLER2D || + p_type==TK_TYPE_USAMPLER2D || + p_type==TK_TYPE_SAMPLERCUBE ); } ShaderLanguage::DataType ShaderLanguage::get_token_datatype(TokenType p_type) { - switch(p_type) { + return DataType(p_type-TK_TYPE_VOID); +} - case TK_TYPE_VOID: return TYPE_VOID; - case TK_TYPE_BOOL: return TYPE_BOOL; - case TK_TYPE_FLOAT: return TYPE_FLOAT; - case TK_TYPE_VEC2: return TYPE_VEC2; - case TK_TYPE_VEC3: return TYPE_VEC3; - case TK_TYPE_VEC4: return TYPE_VEC4; - case TK_TYPE_COLOR: return TYPE_VEC4; - case TK_TYPE_MAT2: return TYPE_MAT2; - case TK_TYPE_MAT3: return TYPE_MAT3; - case TK_TYPE_MAT4: return TYPE_MAT4; - case TK_TYPE_TEXTURE: return TYPE_TEXTURE; - case TK_TYPE_CUBEMAP: return TYPE_CUBEMAP; - default: return TYPE_VOID; - } - return TYPE_VOID; +bool ShaderLanguage::is_token_precision(TokenType p_type) { + + return ( + p_type==TK_PRECISION_LOW || + p_type==TK_PRECISION_MID || + p_type==TK_PRECISION_HIGH ); + +} + +ShaderLanguage::DataPrecision ShaderLanguage::get_token_precision(TokenType p_type) { + + if (p_type==TK_PRECISION_LOW) + return PRECISION_LOWP; + else if (p_type==TK_PRECISION_HIGH) + return PRECISION_HIGHP; + else + return PRECISION_MEDIUMP; } @@ -553,6 +679,17 @@ String ShaderLanguage::get_datatype_name(DataType p_type) { case TYPE_VOID: return "void"; case TYPE_BOOL: return "bool"; + case TYPE_BVEC2: return "bvec2"; + case TYPE_BVEC3: return "bvec3"; + case TYPE_BVEC4: return "bvec4"; + case TYPE_INT: return "int"; + case TYPE_IVEC2: return "ivec2"; + case TYPE_IVEC3: return "ivec3"; + case TYPE_IVEC4: return "ivec4"; + case TYPE_UINT: return "uint"; + case TYPE_UVEC2: return "uvec2"; + case TYPE_UVEC3: return "uvec3"; + case TYPE_UVEC4: return "uvec4"; case TYPE_FLOAT: return "float"; case TYPE_VEC2: return "vec2"; case TYPE_VEC3: return "vec3"; @@ -560,9 +697,10 @@ String ShaderLanguage::get_datatype_name(DataType p_type) { case TYPE_MAT2: return "mat2"; case TYPE_MAT3: return "mat3"; case TYPE_MAT4: return "mat4"; - case TYPE_TEXTURE: return "texture"; - case TYPE_CUBEMAP: return "cubemap"; - default: return ""; + case TYPE_SAMPLER2D: return "sampler2D"; + case TYPE_ISAMPLER2D: return "isampler2D"; + case TYPE_USAMPLER2D: return "usampler2D"; + case TYPE_SAMPLERCUBE: return "samplerCube"; } return ""; @@ -571,211 +709,495 @@ String ShaderLanguage::get_datatype_name(DataType p_type) { bool ShaderLanguage::is_token_nonvoid_datatype(TokenType p_type) { - return - (p_type==TK_TYPE_BOOL) || - (p_type==TK_TYPE_FLOAT) || - (p_type==TK_TYPE_VEC2) || - (p_type==TK_TYPE_VEC3) || - (p_type==TK_TYPE_VEC4) || - (p_type==TK_TYPE_COLOR) || - (p_type==TK_TYPE_MAT2) || - (p_type==TK_TYPE_MAT3) || - (p_type==TK_TYPE_MAT4) || - (p_type==TK_TYPE_TEXTURE) || - (p_type==TK_TYPE_CUBEMAP); + return is_token_datatype(p_type) && p_type!=TK_TYPE_VOID; } -bool ShaderLanguage::parser_is_at_function(Parser& parser) { - - return (is_token_datatype(parser.get_token_type(0)) && parser.get_token_type(1)==TK_INDENTIFIER && parser.get_token_type(2)==TK_PARENTHESIS_OPEN); -} - - - -bool ShaderLanguage::test_existing_identifier(Node *p_node,const StringName p_identifier,bool p_func,bool p_var,bool p_builtin) { +void ShaderLanguage::clear() { - Node *node = p_node; + current_function=StringName(); - while(node) { + completion_type=COMPLETION_NONE; + completion_block=NULL; + completion_function=StringName(); - if (node->type==Node::TYPE_BLOCK) { + error_line=0; + tk_line=1; + char_idx=0; + error_set=false; + error_str=""; + while(nodes) { + Node *n = nodes; + nodes=nodes->next; + memdelete(n); + } - BlockNode *block = (BlockNode*)node; - if (block->variables.has(p_identifier)) - return true; - } else if (node->type==Node::TYPE_PROGRAM) { +} - ProgramNode *program = (ProgramNode*)node; - for(int i=0;i<program->functions.size();i++) { - if (program->functions[i].name==p_identifier) { - return true; - } - } +bool ShaderLanguage::_find_identifier(const BlockNode* p_block,const Map<StringName, DataType> &p_builtin_types,const StringName& p_identifier, DataType *r_data_type, IdentifierType *r_type) { - if(program->builtin_variables.has(p_identifier)) { - return true; - } - if(program->uniforms.has(p_identifier)) { - return true; - } - } else if (node->type==Node::TYPE_FUNCTION) { + if (p_builtin_types.has(p_identifier)) { - FunctionNode *func=(FunctionNode*)node; - for(int i=0;i<func->arguments.size();i++) - if (func->arguments[i].name==p_identifier) - return true; + if (r_data_type) { + *r_data_type=p_builtin_types[p_identifier]; + } + if (r_type) { + *r_type=IDENTIFIER_BUILTIN_VAR; } - node=node->parent; + return true; } - // try keywords + FunctionNode *function=NULL; - int idx=0; + while(p_block) { - //todo optimize - while(intrinsic_func_defs[idx].name) { + if (p_block->variables.has(p_identifier)) { + if (r_data_type) { + *r_data_type=p_block->variables[p_identifier].type; + } + if (r_type) { + *r_type=IDENTIFIER_LOCAL_VAR; + } - if (p_identifier.operator String()==intrinsic_func_defs[idx].name) return true; - idx++; - } - + } - return false; + if (p_block->parent_function) { + function=p_block->parent_function; + break; + } else { + ERR_FAIL_COND_V(!p_block->parent_block,false); + p_block=p_block->parent_block; + } + } -} + if (function) { + for(int i=0;i<function->arguments.size();i++) { + if (function->arguments[i].name==p_identifier) { + if (r_data_type) { + *r_data_type=function->arguments[i].type; + } + if (r_type) { + *r_type=IDENTIFIER_FUNCTION_ARGUMENT; + } + return true; + } + } + } -Error ShaderLanguage::parse_function(Parser& parser,BlockNode *p_block) { - if (!p_block->parent || p_block->parent->type!=Node::TYPE_PROGRAM) { - parser.set_error("Misplaced function"); - return ERR_PARSE_ERROR; + if (shader->varyings.has(p_identifier)) { + if (r_data_type) { + *r_data_type=shader->varyings[p_identifier].type; + } + if (r_type) { + *r_type=IDENTIFIER_VARYING; + } + return true; + } + if (shader->uniforms.has(p_identifier)) { + if (r_data_type) { + *r_data_type=shader->uniforms[p_identifier].type; + } + if (r_type) { + *r_type=IDENTIFIER_UNIFORM; + } + return true; } + for(int i=0;i<shader->functions.size();i++) { - ProgramNode *program = (ProgramNode*)p_block->parent; + if (!shader->functions[i].callable) + continue; - StringName name = parser.get_token(1).text; + if (shader->functions[i].name==p_identifier) { + if (r_data_type) { + *r_data_type=shader->functions[i].function->return_type; + } + if (r_type) { + *r_type=IDENTIFIER_FUNCTION; + } + } + } - if (test_existing_identifier(p_block,name)) { + return false; - parser.set_error("Duplicate Identifier (existing variable/builtin/function): "+name); - return ERR_PARSE_ERROR; +} - } +bool ShaderLanguage::_validate_operator(OperatorNode *p_op,DataType *r_ret_type) { - FunctionNode *function = parser.create_node<FunctionNode>(program); - function->body = parser.create_node<BlockNode>(function); + bool valid=false; + DataType ret_type; + + switch(p_op->op) { + case OP_EQUAL: + case OP_NOT_EQUAL: { + DataType na = p_op->arguments[0]->get_datatype(); + DataType nb = p_op->arguments[1]->get_datatype(); + valid=na==nb; + ret_type=TYPE_BOOL; + } break; + case OP_LESS: + case OP_LESS_EQUAL: + case OP_GREATER: + case OP_GREATER_EQUAL: { + DataType na = p_op->arguments[0]->get_datatype(); + DataType nb = p_op->arguments[1]->get_datatype(); - function->name=name; + valid = na==nb && (na==TYPE_UINT || na==TYPE_INT || na==TYPE_FLOAT); + ret_type=TYPE_BOOL; - function->return_type=get_token_datatype(parser.get_token_type(0)); + } break; + case OP_AND: + case OP_OR: { + DataType na = p_op->arguments[0]->get_datatype(); + DataType nb = p_op->arguments[1]->get_datatype(); - { //add to programnode - ProgramNode::Function f; - f.name=name; - f.function=function; - program->functions.push_back(f); - } + valid = na==nb && na==TYPE_BOOL; + ret_type=TYPE_BOOL; - int ofs=3; + } break; + case OP_NOT: { - while(true) { + DataType na = p_op->arguments[0]->get_datatype(); + valid = na==TYPE_BOOL; + ret_type=TYPE_BOOL; - //end of arguments - if (parser.get_token_type(ofs)==TK_PARENTHESIS_CLOSE) { - ofs++; - break; - } - //next argument awaits - if (parser.get_token_type(ofs)==TK_COMMA) { - if (!is_token_nonvoid_datatype(parser.get_token_type(ofs+1))) { - parser.set_error("Expected Identifier or ')' following ','"); - return ERR_PARSE_ERROR; + } break; + case OP_INCREMENT: + case OP_DECREMENT: + case OP_POST_INCREMENT: + case OP_POST_DECREMENT: + case OP_NEGATE: { + DataType na = p_op->arguments[0]->get_datatype(); + valid = na>TYPE_BOOL && na<TYPE_MAT2; + ret_type=na; + } break; + case OP_ADD: + case OP_SUB: + case OP_MUL: + case OP_DIV: { + DataType na = p_op->arguments[0]->get_datatype(); + DataType nb = p_op->arguments[1]->get_datatype(); + + if (na>nb) { + //make things easier; + SWAP(na,nb); + } + + if (na==nb) { + valid = (na>TYPE_BOOL && na<TYPE_MAT2) || (p_op->op==OP_MUL && na>=TYPE_MAT2 && na<=TYPE_MAT4); + ret_type=na; + } else if (na==TYPE_INT && nb==TYPE_IVEC2) { + valid=true; + ret_type=TYPE_IVEC2; + } else if (na==TYPE_INT && nb==TYPE_IVEC3) { + valid=true; + ret_type=TYPE_IVEC3; + } else if (na==TYPE_INT && nb==TYPE_IVEC4) { + valid=true; + ret_type=TYPE_IVEC4; + } else if (na==TYPE_UINT && nb==TYPE_UVEC2) { + valid=true; + ret_type=TYPE_UVEC2; + } else if (na==TYPE_UINT && nb==TYPE_UVEC3) { + valid=true; + ret_type=TYPE_UVEC3; + } else if (na==TYPE_UINT && nb==TYPE_UVEC4) { + valid=true; + ret_type=TYPE_UVEC4; + } else if (na==TYPE_FLOAT && nb==TYPE_VEC2) { + valid=true; + ret_type=TYPE_VEC2; + } else if (na==TYPE_FLOAT && nb==TYPE_VEC3) { + valid=true; + ret_type=TYPE_VEC3; + } else if (na==TYPE_FLOAT && nb==TYPE_VEC4) { + valid=true; + ret_type=TYPE_VEC4; + } else if (p_op->op==OP_MUL && na==TYPE_VEC2 && nb==TYPE_MAT2) { + valid=true; + ret_type=TYPE_MAT2; + } else if (p_op->op==OP_MUL && na==TYPE_VEC3 && nb==TYPE_MAT3) { + valid=true; + ret_type=TYPE_MAT3; + } else if (p_op->op==OP_MUL && na==TYPE_VEC4 && nb==TYPE_MAT4) { + valid=true; + ret_type=TYPE_MAT4; } - ofs++; - continue; - } + } break; + case OP_ASSIGN_MOD: + case OP_MOD: { + /* + * The operator modulus (%) operates on signed or unsigned integers or integer vectors. The operand + * types must both be signed or both be unsigned. The operands cannot be vectors of differing size. If + * one operand is a scalar and the other vector, then the scalar is applied component-wise to the vector, + * resulting in the same type as the vector. If both are vectors of the same size, the result is computed + * component-wise. + */ + DataType na = p_op->arguments[0]->get_datatype(); + DataType nb = p_op->arguments[1]->get_datatype(); - if (!is_token_nonvoid_datatype(parser.get_token_type(ofs+0))) { - parser.set_error("Invalid Argument Type"); - return ERR_PARSE_ERROR; - } + if (na==TYPE_INT && nb==TYPE_INT) { + valid=true; + ret_type=TYPE_INT; + } else if (na==TYPE_IVEC2 && nb==TYPE_INT) { + valid=true; + ret_type=TYPE_IVEC2; + } else if (na==TYPE_IVEC3 && nb==TYPE_INT) { + valid=true; + ret_type=TYPE_IVEC3; + } else if (na==TYPE_IVEC4 && nb==TYPE_INT) { + valid=true; + ret_type=TYPE_IVEC4; + } else if (na==TYPE_IVEC2 && nb==TYPE_IVEC2) { + valid=true; + ret_type=TYPE_IVEC2; + } else if (na==TYPE_IVEC3 && nb==TYPE_IVEC3) { + valid=true; + ret_type=TYPE_IVEC3; + } else if (na==TYPE_IVEC4 && nb==TYPE_IVEC4) { + valid=true; + ret_type=TYPE_IVEC4; + ///// + } else if (na==TYPE_UINT && nb==TYPE_UINT) { + valid=true; + ret_type=TYPE_UINT; + } else if (na==TYPE_UVEC2 && nb==TYPE_UINT) { + valid=true; + ret_type=TYPE_UVEC2; + } else if (na==TYPE_UVEC3 && nb==TYPE_UINT) { + valid=true; + ret_type=TYPE_UVEC3; + } else if (na==TYPE_UVEC4 && nb==TYPE_UINT) { + valid=true; + ret_type=TYPE_UVEC4; + } else if (na==TYPE_UVEC2 && nb==TYPE_UVEC2) { + valid=true; + ret_type=TYPE_UVEC2; + } else if (na==TYPE_UVEC3 && nb==TYPE_UVEC3) { + valid=true; + ret_type=TYPE_UVEC3; + } else if (na==TYPE_UVEC4 && nb==TYPE_UVEC4) { + valid=true; + ret_type=TYPE_UVEC4; + } + } break; + case OP_ASSIGN_SHIFT_LEFT: + case OP_ASSIGN_SHIFT_RIGHT: + case OP_SHIFT_LEFT: + case OP_SHIFT_RIGHT: { - DataType identtype=get_token_datatype(parser.get_token_type(ofs+0)); + DataType na = p_op->arguments[0]->get_datatype(); + DataType nb = p_op->arguments[1]->get_datatype(); - if (parser.get_token_type(ofs+1)!=TK_INDENTIFIER) { - parser.set_error("Expected Argument Identifier"); - return ERR_PARSE_ERROR; - } + if (na>=TYPE_UINT && na<=TYPE_UVEC4) { + na=DataType(na-4); + } - StringName identname=parser.get_token(ofs+1).text; + if (nb>=TYPE_UINT && nb<=TYPE_UVEC4) { + nb=DataType(nb-4); + } - if (test_existing_identifier(function,identname)) { - parser.set_error("Duplicate Argument Identifier: "+identname); - return ERR_DUPLICATE_SYMBOL; - } + if (na==TYPE_INT && nb==TYPE_INT) { + valid=true; + ret_type=TYPE_INT; + } else if (na==TYPE_IVEC2 && nb==TYPE_INT) { + valid=true; + ret_type=TYPE_IVEC2; + } else if (na==TYPE_IVEC3 && nb==TYPE_INT) { + valid=true; + ret_type=TYPE_IVEC3; + } else if (na==TYPE_IVEC4 && nb==TYPE_INT) { + valid=true; + ret_type=TYPE_IVEC4; + } else if (na==TYPE_IVEC2 && nb==TYPE_IVEC2) { + valid=true; + ret_type=TYPE_IVEC2; + } else if (na==TYPE_IVEC3 && nb==TYPE_IVEC3) { + valid=true; + ret_type=TYPE_IVEC3; + } else if (na==TYPE_IVEC4 && nb==TYPE_IVEC4) { + valid=true; + ret_type=TYPE_IVEC4; + } + } break; + case OP_ASSIGN: { + DataType na = p_op->arguments[0]->get_datatype(); + DataType nb = p_op->arguments[1]->get_datatype(); + valid=na==nb; + ret_type=na; + } break; + case OP_ASSIGN_ADD: + case OP_ASSIGN_SUB: + case OP_ASSIGN_MUL: + case OP_ASSIGN_DIV: { - FunctionNode::Argument arg; - arg.name=identname; - arg.type=identtype; - //function->body->variables[arg.name]=arg.type; - function->arguments.push_back(arg); + DataType na = p_op->arguments[0]->get_datatype(); + DataType nb = p_op->arguments[1]->get_datatype(); - ofs+=2; - } - parser.advance(ofs); - // match { - if (parser.get_token_type()!=TK_CURLY_BRACKET_OPEN) { - parser.set_error("Expected '{'"); - return ERR_PARSE_ERROR; - } + if (na==nb) { + valid = (na>TYPE_BOOL && na<TYPE_MAT2) || (p_op->op==OP_ASSIGN_MUL && na>=TYPE_MAT2 && na<=TYPE_MAT4); + ret_type=na; + } else if (na==TYPE_IVEC2 && nb==TYPE_INT) { + valid=true; + ret_type=TYPE_IVEC2; + } else if (na==TYPE_IVEC3 && nb==TYPE_INT) { + valid=true; + ret_type=TYPE_IVEC3; + } else if (na==TYPE_IVEC4 && nb==TYPE_INT ) { + valid=true; + ret_type=TYPE_IVEC4; + } else if (na==TYPE_UVEC2 && nb==TYPE_UINT) { + valid=true; + ret_type=TYPE_UVEC2; + } else if (na==TYPE_UVEC3 && nb==TYPE_UINT) { + valid=true; + ret_type=TYPE_UVEC3; + } else if (na==TYPE_UVEC4 && nb==TYPE_UINT) { + valid=true; + ret_type=TYPE_UVEC4; + } else if (na==TYPE_VEC2 && nb==TYPE_FLOAT ) { + valid=true; + ret_type=TYPE_VEC2; + } else if (na==TYPE_VEC3 && nb==TYPE_FLOAT) { + valid=true; + ret_type=TYPE_VEC3; + } else if (na==TYPE_VEC4 && nb==TYPE_FLOAT) { + valid=true; + ret_type=TYPE_VEC4; + } else if (p_op->op==OP_ASSIGN_MUL && na==TYPE_MAT2 && nb==TYPE_VEC2) { + valid=true; + ret_type=TYPE_MAT2; + } else if (p_op->op==OP_ASSIGN_MUL && na==TYPE_MAT3 && nb==TYPE_VEC3) { + valid=true; + ret_type=TYPE_MAT3; + } else if (p_op->op==OP_ASSIGN_MUL && na==TYPE_MAT4 && nb==TYPE_VEC4) { + valid=true; + ret_type=TYPE_MAT4; + } + } break; + case OP_ASSIGN_BIT_AND: + case OP_ASSIGN_BIT_OR: + case OP_ASSIGN_BIT_XOR: + case OP_BIT_AND: + case OP_BIT_OR: + case OP_BIT_XOR: { - parser.advance(); - Error err = parse_block(parser,function->body); + /* + * The bitwise operators and (&), exclusive-or (^), and inclusive-or (|). The operands must be of type + * signed or unsigned integers or integer vectors. The operands cannot be vectors of differing size. If + * one operand is a scalar and the other a vector, the scalar is applied component-wise to the vector, + * resulting in the same type as the vector. The fundamental types of the operands (signed or unsigned) + * must match. + */ - if (err) - return err; + DataType na = p_op->arguments[0]->get_datatype(); + DataType nb = p_op->arguments[1]->get_datatype(); - // make sure that if the function has a return type, it does return something.. - if (function->return_type!=TYPE_VOID) { - bool found=false; - for(int i=0;i<function->body->statements.size();i++) { - if (function->body->statements[i]->type==Node::TYPE_CONTROL_FLOW) { + if (na>nb && p_op->op>=OP_BIT_AND) { + //can swap for non assign + SWAP(na,nb); + } - ControlFlowNode *cf = (ControlFlowNode*)function->body->statements[i]; - if (cf->flow_op==FLOW_OP_RETURN) { - // type of return was already checked when inserted - // no need to check here - found=true; - } + if (na==TYPE_INT && nb==TYPE_INT) { + valid=true; + ret_type=TYPE_INT; + } else if (na==TYPE_IVEC2 && nb==TYPE_INT) { + valid=true; + ret_type=TYPE_IVEC2; + } else if (na==TYPE_IVEC3 && nb==TYPE_INT) { + valid=true; + ret_type=TYPE_IVEC3; + } else if (na==TYPE_IVEC4 && nb==TYPE_INT) { + valid=true; + ret_type=TYPE_IVEC4; + } else if (na==TYPE_IVEC2 && nb==TYPE_IVEC2) { + valid=true; + ret_type=TYPE_IVEC2; + } else if (na==TYPE_IVEC3 && nb==TYPE_IVEC3) { + valid=true; + ret_type=TYPE_IVEC3; + } else if (na==TYPE_IVEC4 && nb==TYPE_IVEC4) { + valid=true; + ret_type=TYPE_IVEC4; + ///// + } else if (na==TYPE_UINT && nb==TYPE_UINT) { + valid=true; + ret_type=TYPE_UINT; + } else if (na==TYPE_UVEC2 && nb==TYPE_UINT) { + valid=true; + ret_type=TYPE_UVEC2; + } else if (na==TYPE_UVEC3 && nb==TYPE_UINT) { + valid=true; + ret_type=TYPE_UVEC3; + } else if (na==TYPE_UVEC4 && nb==TYPE_UINT) { + valid=true; + ret_type=TYPE_UVEC4; + } else if (na==TYPE_UVEC2 && nb==TYPE_UVEC2) { + valid=true; + ret_type=TYPE_UVEC2; + } else if (na==TYPE_UVEC3 && nb==TYPE_UVEC3) { + valid=true; + ret_type=TYPE_UVEC3; + } else if (na==TYPE_UVEC4 && nb==TYPE_UVEC4) { + valid=true; + ret_type=TYPE_UVEC4; } - } + } break; + case OP_BIT_INVERT: { //unaries + DataType na = p_op->arguments[0]->get_datatype(); + valid = na>=TYPE_INT && na<TYPE_FLOAT; + ret_type=na; + } break; + case OP_SELECT_IF: { + DataType na = p_op->arguments[0]->get_datatype(); + DataType nb = p_op->arguments[1]->get_datatype(); + DataType nc = p_op->arguments[2]->get_datatype(); - if (!found) { - parser.set_error("Function must return a value (use the main block)"); - return ERR_PARSE_ERROR; + valid = na==TYPE_BOOL && (nb==nc); + ret_type=nb; + } break; + default: { + ERR_FAIL_V(false); } } - return OK; -} + if (r_ret_type) + *r_ret_type=ret_type; + return valid; +} -const ShaderLanguage::IntrinsicFuncDef ShaderLanguage::intrinsic_func_defs[]={ +const ShaderLanguage::BuiltinFuncDef ShaderLanguage::builtin_func_defs[]={ //constructors {"bool",TYPE_BOOL,{TYPE_BOOL,TYPE_VOID}}, + {"bvec2",TYPE_BVEC2,{TYPE_BOOL,TYPE_VOID}}, + {"bvec2",TYPE_BVEC2,{TYPE_BOOL,TYPE_BOOL,TYPE_VOID}}, + {"bvec3",TYPE_BVEC3,{TYPE_BOOL,TYPE_VOID}}, + {"bvec3",TYPE_BVEC3,{TYPE_BOOL,TYPE_BOOL,TYPE_BOOL,TYPE_VOID}}, + {"bvec3",TYPE_BVEC3,{TYPE_BVEC2,TYPE_BOOL,TYPE_VOID}}, + {"bvec3",TYPE_BVEC3,{TYPE_BOOL,TYPE_BVEC2,TYPE_VOID}}, + {"bvec4",TYPE_BVEC4,{TYPE_BOOL,TYPE_VOID}}, + {"bvec4",TYPE_BVEC4,{TYPE_BOOL,TYPE_BOOL,TYPE_BOOL,TYPE_BOOL,TYPE_VOID}}, + {"bvec4",TYPE_BVEC4,{TYPE_BOOL,TYPE_BVEC2,TYPE_BOOL,TYPE_VOID}}, + {"bvec4",TYPE_BVEC4,{TYPE_BVEC2,TYPE_BOOL,TYPE_BOOL,TYPE_VOID}}, + {"bvec4",TYPE_BVEC4,{TYPE_BOOL,TYPE_BOOL,TYPE_BVEC2,TYPE_VOID}}, + {"bvec4",TYPE_BVEC4,{TYPE_BOOL,TYPE_BVEC3,TYPE_VOID}}, + {"bvec4",TYPE_BVEC4,{TYPE_BVEC3,TYPE_BOOL,TYPE_VOID}}, + {"bvec4",TYPE_BVEC4,{TYPE_BVEC2,TYPE_BVEC2,TYPE_VOID}}, + + {"float",TYPE_FLOAT,{TYPE_FLOAT,TYPE_VOID}}, {"vec2",TYPE_VEC2,{TYPE_FLOAT,TYPE_VOID}}, {"vec2",TYPE_VEC2,{TYPE_FLOAT,TYPE_FLOAT,TYPE_VOID}}, @@ -791,10 +1213,132 @@ const ShaderLanguage::IntrinsicFuncDef ShaderLanguage::intrinsic_func_defs[]={ {"vec4",TYPE_VEC4,{TYPE_FLOAT,TYPE_VEC3,TYPE_VOID}}, {"vec4",TYPE_VEC4,{TYPE_VEC3,TYPE_FLOAT,TYPE_VOID}}, {"vec4",TYPE_VEC4,{TYPE_VEC2,TYPE_VEC2,TYPE_VOID}}, + + {"int",TYPE_INT,{TYPE_INT,TYPE_VOID}}, + {"ivec2",TYPE_IVEC2,{TYPE_INT,TYPE_VOID}}, + {"ivec2",TYPE_IVEC2,{TYPE_INT,TYPE_INT,TYPE_VOID}}, + {"ivec3",TYPE_IVEC3,{TYPE_INT,TYPE_VOID}}, + {"ivec3",TYPE_IVEC3,{TYPE_INT,TYPE_INT,TYPE_INT,TYPE_VOID}}, + {"ivec3",TYPE_IVEC3,{TYPE_IVEC2,TYPE_INT,TYPE_VOID}}, + {"ivec3",TYPE_IVEC3,{TYPE_INT,TYPE_IVEC2,TYPE_VOID}}, + {"ivec4",TYPE_IVEC4,{TYPE_INT,TYPE_VOID}}, + {"ivec4",TYPE_IVEC4,{TYPE_INT,TYPE_INT,TYPE_INT,TYPE_INT,TYPE_VOID}}, + {"ivec4",TYPE_IVEC4,{TYPE_INT,TYPE_IVEC2,TYPE_INT,TYPE_VOID}}, + {"ivec4",TYPE_IVEC4,{TYPE_IVEC2,TYPE_INT,TYPE_INT,TYPE_VOID}}, + {"ivec4",TYPE_IVEC4,{TYPE_INT,TYPE_INT,TYPE_IVEC2,TYPE_VOID}}, + {"ivec4",TYPE_IVEC4,{TYPE_INT,TYPE_IVEC3,TYPE_VOID}}, + {"ivec4",TYPE_IVEC4,{TYPE_IVEC3,TYPE_INT,TYPE_VOID}}, + {"ivec4",TYPE_IVEC4,{TYPE_IVEC2,TYPE_IVEC2,TYPE_VOID}}, + + {"uint",TYPE_UINT,{TYPE_UINT,TYPE_VOID}}, + {"uvec2",TYPE_UVEC2,{TYPE_UINT,TYPE_VOID}}, + {"uvec2",TYPE_UVEC2,{TYPE_UINT,TYPE_UINT,TYPE_VOID}}, + {"uvec3",TYPE_UVEC3,{TYPE_UINT,TYPE_VOID}}, + {"uvec3",TYPE_UVEC3,{TYPE_UINT,TYPE_UINT,TYPE_UINT,TYPE_VOID}}, + {"uvec3",TYPE_UVEC3,{TYPE_UVEC2,TYPE_UINT,TYPE_VOID}}, + {"uvec3",TYPE_UVEC3,{TYPE_UINT,TYPE_UVEC2,TYPE_VOID}}, + {"uvec4",TYPE_UVEC4,{TYPE_UINT,TYPE_VOID}}, + {"uvec4",TYPE_UVEC4,{TYPE_UINT,TYPE_UINT,TYPE_UINT,TYPE_UINT,TYPE_VOID}}, + {"uvec4",TYPE_UVEC4,{TYPE_UINT,TYPE_UVEC2,TYPE_UINT,TYPE_VOID}}, + {"uvec4",TYPE_UVEC4,{TYPE_UVEC2,TYPE_UINT,TYPE_UINT,TYPE_VOID}}, + {"uvec4",TYPE_UVEC4,{TYPE_UINT,TYPE_UINT,TYPE_UVEC2,TYPE_VOID}}, + {"uvec4",TYPE_UVEC4,{TYPE_UINT,TYPE_UVEC3,TYPE_VOID}}, + {"uvec4",TYPE_UVEC4,{TYPE_UVEC3,TYPE_UINT,TYPE_VOID}}, + {"uvec4",TYPE_UVEC4,{TYPE_UVEC2,TYPE_UVEC2,TYPE_VOID}}, + {"mat2",TYPE_MAT2,{TYPE_VEC2,TYPE_VEC2,TYPE_VOID}}, {"mat3",TYPE_MAT3,{TYPE_VEC3,TYPE_VEC3,TYPE_VEC3,TYPE_VOID}}, {"mat4",TYPE_MAT4,{TYPE_VEC4,TYPE_VEC4,TYPE_VEC4,TYPE_VEC4,TYPE_VOID}}, - //intrinsics - trigonometry + + {"mat2",TYPE_MAT2,{TYPE_FLOAT,TYPE_VOID}}, + {"mat3",TYPE_MAT3,{TYPE_FLOAT,TYPE_VOID}}, + {"mat4",TYPE_MAT4,{TYPE_FLOAT,TYPE_VOID}}, + + //conversion scalars + + {"int",TYPE_INT,{TYPE_BOOL,TYPE_VOID}}, + {"int",TYPE_INT,{TYPE_INT,TYPE_VOID}}, + {"int",TYPE_INT,{TYPE_UINT,TYPE_VOID}}, + {"int",TYPE_INT,{TYPE_FLOAT,TYPE_VOID}}, + + {"float",TYPE_FLOAT,{TYPE_BOOL,TYPE_VOID}}, + {"float",TYPE_FLOAT,{TYPE_INT,TYPE_VOID}}, + {"float",TYPE_FLOAT,{TYPE_UINT,TYPE_VOID}}, + {"float",TYPE_FLOAT,{TYPE_FLOAT,TYPE_VOID}}, + + {"uint",TYPE_UINT,{TYPE_BOOL,TYPE_VOID}}, + {"uint",TYPE_UINT,{TYPE_INT,TYPE_VOID}}, + {"uint",TYPE_UINT,{TYPE_UINT,TYPE_VOID}}, + {"uint",TYPE_UINT,{TYPE_FLOAT,TYPE_VOID}}, + + {"bool",TYPE_BOOL,{TYPE_BOOL,TYPE_VOID}}, + {"bool",TYPE_BOOL,{TYPE_INT,TYPE_VOID}}, + {"bool",TYPE_BOOL,{TYPE_UINT,TYPE_VOID}}, + {"bool",TYPE_BOOL,{TYPE_FLOAT,TYPE_VOID}}, + + //conversion vectors + + {"ivec2",TYPE_IVEC2,{TYPE_BVEC2,TYPE_VOID}}, + {"ivec2",TYPE_IVEC2,{TYPE_IVEC2,TYPE_VOID}}, + {"ivec2",TYPE_IVEC2,{TYPE_UVEC2,TYPE_VOID}}, + {"ivec2",TYPE_IVEC2,{TYPE_VEC2,TYPE_VOID}}, + + {"vec2",TYPE_VEC2,{TYPE_BVEC2,TYPE_VOID}}, + {"vec2",TYPE_VEC2,{TYPE_IVEC2,TYPE_VOID}}, + {"vec2",TYPE_VEC2,{TYPE_UVEC2,TYPE_VOID}}, + {"vec2",TYPE_VEC2,{TYPE_VEC2,TYPE_VOID}}, + + {"uvec2",TYPE_UVEC2,{TYPE_BVEC2,TYPE_VOID}}, + {"uvec2",TYPE_UVEC2,{TYPE_IVEC2,TYPE_VOID}}, + {"uvec2",TYPE_UVEC2,{TYPE_UVEC2,TYPE_VOID}}, + {"uvec2",TYPE_UVEC2,{TYPE_VEC2,TYPE_VOID}}, + + {"bvec2",TYPE_BVEC2,{TYPE_BVEC2,TYPE_VOID}}, + {"bvec2",TYPE_BVEC2,{TYPE_IVEC2,TYPE_VOID}}, + {"bvec2",TYPE_BVEC2,{TYPE_UVEC2,TYPE_VOID}}, + {"bvec2",TYPE_BVEC2,{TYPE_VEC2,TYPE_VOID}}, + + {"ivec3",TYPE_IVEC3,{TYPE_BVEC3,TYPE_VOID}}, + {"ivec3",TYPE_IVEC3,{TYPE_IVEC3,TYPE_VOID}}, + {"ivec3",TYPE_IVEC3,{TYPE_UVEC3,TYPE_VOID}}, + {"ivec3",TYPE_IVEC3,{TYPE_VEC3,TYPE_VOID}}, + + {"vec3",TYPE_VEC3,{TYPE_BVEC3,TYPE_VOID}}, + {"vec3",TYPE_VEC3,{TYPE_IVEC3,TYPE_VOID}}, + {"vec3",TYPE_VEC3,{TYPE_UVEC3,TYPE_VOID}}, + {"vec3",TYPE_VEC3,{TYPE_VEC3,TYPE_VOID}}, + + {"uvec3",TYPE_UVEC3,{TYPE_BVEC3,TYPE_VOID}}, + {"uvec3",TYPE_UVEC3,{TYPE_IVEC3,TYPE_VOID}}, + {"uvec3",TYPE_UVEC3,{TYPE_UVEC3,TYPE_VOID}}, + {"uvec3",TYPE_UVEC3,{TYPE_VEC3,TYPE_VOID}}, + + {"bvec3",TYPE_BVEC3,{TYPE_BVEC3,TYPE_VOID}}, + {"bvec3",TYPE_BVEC3,{TYPE_IVEC3,TYPE_VOID}}, + {"bvec3",TYPE_BVEC3,{TYPE_UVEC3,TYPE_VOID}}, + {"bvec3",TYPE_BVEC3,{TYPE_VEC3,TYPE_VOID}}, + + {"ivec4",TYPE_IVEC4,{TYPE_BVEC4,TYPE_VOID}}, + {"ivec4",TYPE_IVEC4,{TYPE_IVEC4,TYPE_VOID}}, + {"ivec4",TYPE_IVEC4,{TYPE_UVEC4,TYPE_VOID}}, + {"ivec4",TYPE_IVEC4,{TYPE_VEC4,TYPE_VOID}}, + + {"vec4",TYPE_VEC4,{TYPE_BVEC4,TYPE_VOID}}, + {"vec4",TYPE_VEC4,{TYPE_IVEC4,TYPE_VOID}}, + {"vec4",TYPE_VEC4,{TYPE_UVEC4,TYPE_VOID}}, + {"vec4",TYPE_VEC4,{TYPE_VEC4,TYPE_VOID}}, + + {"uvec4",TYPE_UVEC4,{TYPE_BVEC4,TYPE_VOID}}, + {"uvec4",TYPE_UVEC4,{TYPE_IVEC4,TYPE_VOID}}, + {"uvec4",TYPE_UVEC4,{TYPE_UVEC4,TYPE_VOID}}, + {"uvec4",TYPE_UVEC4,{TYPE_VEC4,TYPE_VOID}}, + + {"bvec4",TYPE_BVEC4,{TYPE_BVEC4,TYPE_VOID}}, + {"bvec4",TYPE_BVEC4,{TYPE_IVEC4,TYPE_VOID}}, + {"bvec4",TYPE_BVEC4,{TYPE_UVEC4,TYPE_VOID}}, + {"bvec4",TYPE_BVEC4,{TYPE_VEC4,TYPE_VOID}}, + + //builtins - trigonometry {"sin",TYPE_FLOAT,{TYPE_FLOAT,TYPE_VOID}}, {"cos",TYPE_FLOAT,{TYPE_FLOAT,TYPE_VOID}}, {"tan",TYPE_FLOAT,{TYPE_FLOAT,TYPE_VOID}}, @@ -805,7 +1349,7 @@ const ShaderLanguage::IntrinsicFuncDef ShaderLanguage::intrinsic_func_defs[]={ {"sinh",TYPE_FLOAT,{TYPE_FLOAT,TYPE_VOID}}, {"cosh",TYPE_FLOAT,{TYPE_FLOAT,TYPE_VOID}}, {"tanh",TYPE_FLOAT,{TYPE_FLOAT,TYPE_VOID}}, - //intrinsics - exponential + //builtins - exponential {"pow",TYPE_FLOAT,{TYPE_FLOAT,TYPE_FLOAT,TYPE_VOID}}, {"pow",TYPE_VEC2,{TYPE_VEC2,TYPE_FLOAT,TYPE_VOID}}, {"pow",TYPE_VEC2,{TYPE_VEC2,TYPE_VEC2,TYPE_VOID}}, @@ -825,15 +1369,34 @@ const ShaderLanguage::IntrinsicFuncDef ShaderLanguage::intrinsic_func_defs[]={ {"sqrt",TYPE_VEC2,{TYPE_VEC2,TYPE_VOID}}, {"sqrt",TYPE_VEC3,{TYPE_VEC3,TYPE_VOID}}, {"sqrt",TYPE_VEC4,{TYPE_VEC4,TYPE_VOID}}, - //intrinsics - common + //builtins - common {"abs",TYPE_FLOAT,{TYPE_FLOAT,TYPE_VOID}}, {"abs",TYPE_VEC2,{TYPE_VEC2,TYPE_VOID}}, {"abs",TYPE_VEC3,{TYPE_VEC3,TYPE_VOID}}, {"abs",TYPE_VEC4,{TYPE_VEC4,TYPE_VOID}}, + + {"abs",TYPE_INT,{TYPE_INT,TYPE_VOID}}, + {"abs",TYPE_IVEC2,{TYPE_IVEC2,TYPE_VOID}}, + {"abs",TYPE_IVEC3,{TYPE_IVEC3,TYPE_VOID}}, + {"abs",TYPE_IVEC4,{TYPE_IVEC4,TYPE_VOID}}, + + {"abs",TYPE_UINT,{TYPE_UINT,TYPE_VOID}}, + {"abs",TYPE_UVEC2,{TYPE_UVEC2,TYPE_VOID}}, + {"abs",TYPE_UVEC3,{TYPE_UVEC3,TYPE_VOID}}, + {"abs",TYPE_UVEC4,{TYPE_UVEC4,TYPE_VOID}}, + + {"sign",TYPE_FLOAT,{TYPE_FLOAT,TYPE_VOID}}, {"sign",TYPE_VEC2,{TYPE_VEC2,TYPE_VOID}}, {"sign",TYPE_VEC3,{TYPE_VEC3,TYPE_VOID}}, {"sign",TYPE_VEC4,{TYPE_VEC4,TYPE_VOID}}, + + {"sign",TYPE_INT,{TYPE_INT,TYPE_VOID}}, + {"sign",TYPE_IVEC2,{TYPE_IVEC2,TYPE_VOID}}, + {"sign",TYPE_IVEC3,{TYPE_IVEC3,TYPE_VOID}}, + {"sign",TYPE_IVEC4,{TYPE_IVEC4,TYPE_VOID}}, + + {"floor",TYPE_FLOAT,{TYPE_FLOAT,TYPE_VOID}}, {"floor",TYPE_VEC2,{TYPE_VEC2,TYPE_VOID}}, {"floor",TYPE_VEC3,{TYPE_VEC3,TYPE_VOID}}, @@ -854,18 +1417,51 @@ const ShaderLanguage::IntrinsicFuncDef ShaderLanguage::intrinsic_func_defs[]={ {"fract",TYPE_VEC2,{TYPE_VEC2,TYPE_VOID}}, {"fract",TYPE_VEC3,{TYPE_VEC3,TYPE_VOID}}, {"fract",TYPE_VEC4,{TYPE_VEC4,TYPE_VOID}}, + {"mod",TYPE_FLOAT,{TYPE_FLOAT,TYPE_FLOAT,TYPE_VOID}}, {"mod",TYPE_VEC2,{TYPE_VEC2,TYPE_VEC2,TYPE_VOID}}, + {"mod",TYPE_VEC2,{TYPE_VEC2,TYPE_FLOAT,TYPE_VOID}}, {"mod",TYPE_VEC3,{TYPE_VEC3,TYPE_VEC3,TYPE_VOID}}, + {"mod",TYPE_VEC3,{TYPE_VEC3,TYPE_FLOAT,TYPE_VOID}}, {"mod",TYPE_VEC4,{TYPE_VEC4,TYPE_VEC4,TYPE_VOID}}, + {"mod",TYPE_VEC4,{TYPE_VEC4,TYPE_FLOAT,TYPE_VOID}}, + + {"modf",TYPE_FLOAT,{TYPE_FLOAT,TYPE_FLOAT,TYPE_VOID}}, + {"modf",TYPE_VEC2,{TYPE_VEC2,TYPE_VEC2,TYPE_VOID}}, + {"modf",TYPE_VEC3,{TYPE_VEC3,TYPE_VEC3,TYPE_VOID}}, + {"modf",TYPE_VEC4,{TYPE_VEC4,TYPE_VEC4,TYPE_VOID}}, + {"min",TYPE_FLOAT,{TYPE_FLOAT,TYPE_FLOAT,TYPE_VOID}}, {"min",TYPE_VEC2,{TYPE_VEC2,TYPE_VEC2,TYPE_VOID}}, {"min",TYPE_VEC3,{TYPE_VEC3,TYPE_VEC3,TYPE_VOID}}, {"min",TYPE_VEC4,{TYPE_VEC4,TYPE_VEC4,TYPE_VOID}}, + + {"min",TYPE_INT,{TYPE_INT,TYPE_INT,TYPE_VOID}}, + {"min",TYPE_IVEC2,{TYPE_IVEC2,TYPE_IVEC2,TYPE_VOID}}, + {"min",TYPE_IVEC3,{TYPE_IVEC3,TYPE_IVEC3,TYPE_VOID}}, + {"min",TYPE_IVEC4,{TYPE_IVEC4,TYPE_IVEC4,TYPE_VOID}}, + + {"min",TYPE_UINT,{TYPE_UINT,TYPE_UINT,TYPE_VOID}}, + {"min",TYPE_UVEC2,{TYPE_UVEC2,TYPE_UVEC2,TYPE_VOID}}, + {"min",TYPE_UVEC3,{TYPE_UVEC3,TYPE_UVEC3,TYPE_VOID}}, + {"min",TYPE_UVEC4,{TYPE_UVEC4,TYPE_UVEC4,TYPE_VOID}}, + {"max",TYPE_FLOAT,{TYPE_FLOAT,TYPE_FLOAT,TYPE_VOID}}, {"max",TYPE_VEC2,{TYPE_VEC2,TYPE_VEC2,TYPE_VOID}}, {"max",TYPE_VEC3,{TYPE_VEC3,TYPE_VEC3,TYPE_VOID}}, {"max",TYPE_VEC4,{TYPE_VEC4,TYPE_VEC4,TYPE_VOID}}, + + {"max",TYPE_INT,{TYPE_INT,TYPE_INT,TYPE_VOID}}, + {"max",TYPE_IVEC2,{TYPE_IVEC2,TYPE_IVEC2,TYPE_VOID}}, + {"max",TYPE_IVEC3,{TYPE_IVEC3,TYPE_IVEC3,TYPE_VOID}}, + {"max",TYPE_IVEC4,{TYPE_IVEC4,TYPE_IVEC4,TYPE_VOID}}, + + {"max",TYPE_UINT,{TYPE_UINT,TYPE_UINT,TYPE_VOID}}, + {"max",TYPE_UVEC2,{TYPE_UVEC2,TYPE_UVEC2,TYPE_VOID}}, + {"max",TYPE_UVEC3,{TYPE_UVEC3,TYPE_UVEC3,TYPE_VOID}}, + {"max",TYPE_UVEC4,{TYPE_UVEC4,TYPE_UVEC4,TYPE_VOID}}, + + {"clamp",TYPE_FLOAT,{TYPE_FLOAT,TYPE_FLOAT,TYPE_FLOAT,TYPE_VOID}}, {"clamp",TYPE_VEC2,{TYPE_VEC2,TYPE_VEC2,TYPE_VEC2,TYPE_VOID}}, {"clamp",TYPE_VEC3,{TYPE_VEC3,TYPE_VEC3,TYPE_VEC3,TYPE_VOID}}, @@ -873,13 +1469,39 @@ const ShaderLanguage::IntrinsicFuncDef ShaderLanguage::intrinsic_func_defs[]={ {"clamp",TYPE_VEC2,{TYPE_VEC2,TYPE_FLOAT,TYPE_FLOAT,TYPE_VOID}}, {"clamp",TYPE_VEC3,{TYPE_VEC3,TYPE_FLOAT,TYPE_FLOAT,TYPE_VOID}}, {"clamp",TYPE_VEC4,{TYPE_VEC4,TYPE_FLOAT,TYPE_FLOAT,TYPE_VOID}}, + + + {"clamp",TYPE_INT,{TYPE_INT,TYPE_INT,TYPE_INT,TYPE_VOID}}, + {"clamp",TYPE_IVEC2,{TYPE_IVEC2,TYPE_IVEC2,TYPE_IVEC2,TYPE_VOID}}, + {"clamp",TYPE_IVEC3,{TYPE_IVEC3,TYPE_IVEC3,TYPE_IVEC3,TYPE_VOID}}, + {"clamp",TYPE_IVEC4,{TYPE_IVEC4,TYPE_IVEC4,TYPE_IVEC4,TYPE_VOID}}, + {"clamp",TYPE_IVEC2,{TYPE_IVEC2,TYPE_INT,TYPE_INT,TYPE_VOID}}, + {"clamp",TYPE_IVEC3,{TYPE_IVEC3,TYPE_INT,TYPE_INT,TYPE_VOID}}, + {"clamp",TYPE_IVEC4,{TYPE_IVEC4,TYPE_INT,TYPE_INT,TYPE_VOID}}, + + {"clamp",TYPE_UINT,{TYPE_UINT,TYPE_UINT,TYPE_UINT,TYPE_VOID}}, + {"clamp",TYPE_UVEC2,{TYPE_UVEC2,TYPE_UVEC2,TYPE_UVEC2,TYPE_VOID}}, + {"clamp",TYPE_UVEC3,{TYPE_UVEC3,TYPE_UVEC3,TYPE_UVEC3,TYPE_VOID}}, + {"clamp",TYPE_UVEC4,{TYPE_UVEC4,TYPE_UVEC4,TYPE_UVEC4,TYPE_VOID}}, + {"clamp",TYPE_UVEC2,{TYPE_UVEC2,TYPE_UINT,TYPE_UINT,TYPE_VOID}}, + {"clamp",TYPE_UVEC3,{TYPE_UVEC3,TYPE_UINT,TYPE_UINT,TYPE_VOID}}, + {"clamp",TYPE_UVEC4,{TYPE_UVEC4,TYPE_UINT,TYPE_UINT,TYPE_VOID}}, + {"mix",TYPE_FLOAT,{TYPE_FLOAT,TYPE_FLOAT,TYPE_FLOAT,TYPE_VOID}}, + {"mix",TYPE_FLOAT,{TYPE_FLOAT,TYPE_FLOAT,TYPE_BOOL,TYPE_VOID}}, {"mix",TYPE_VEC2,{TYPE_VEC2,TYPE_VEC2,TYPE_FLOAT,TYPE_VOID}}, + {"mix",TYPE_VEC2,{TYPE_VEC2,TYPE_VEC2,TYPE_BOOL,TYPE_VOID}}, + {"mix",TYPE_VEC2,{TYPE_VEC2,TYPE_VEC2,TYPE_BVEC2,TYPE_VOID}}, {"mix",TYPE_VEC2,{TYPE_VEC2,TYPE_VEC2,TYPE_VEC2,TYPE_VOID}}, {"mix",TYPE_VEC3,{TYPE_VEC3,TYPE_VEC3,TYPE_FLOAT,TYPE_VOID}}, + {"mix",TYPE_VEC3,{TYPE_VEC3,TYPE_VEC3,TYPE_BOOL,TYPE_VOID}}, + {"mix",TYPE_VEC3,{TYPE_VEC3,TYPE_VEC3,TYPE_BVEC3,TYPE_VOID}}, {"mix",TYPE_VEC3,{TYPE_VEC3,TYPE_VEC3,TYPE_VEC3,TYPE_VOID}}, {"mix",TYPE_VEC4,{TYPE_VEC4,TYPE_VEC4,TYPE_FLOAT,TYPE_VOID}}, + {"mix",TYPE_VEC4,{TYPE_VEC4,TYPE_VEC4,TYPE_BOOL,TYPE_VOID}}, + {"mix",TYPE_VEC4,{TYPE_VEC4,TYPE_VEC4,TYPE_BVEC3,TYPE_VOID}}, {"mix",TYPE_VEC4,{TYPE_VEC4,TYPE_VEC4,TYPE_VEC4,TYPE_VOID}}, + {"step",TYPE_FLOAT,{TYPE_FLOAT,TYPE_FLOAT,TYPE_VOID}}, {"step",TYPE_VEC2,{TYPE_VEC2,TYPE_VEC2,TYPE_VOID}}, {"step",TYPE_VEC3,{TYPE_VEC3,TYPE_VEC3,TYPE_VOID}}, @@ -895,7 +1517,37 @@ const ShaderLanguage::IntrinsicFuncDef ShaderLanguage::intrinsic_func_defs[]={ {"smoothstep",TYPE_VEC3,{TYPE_FLOAT,TYPE_FLOAT,TYPE_VEC3,TYPE_VOID}}, {"smoothstep",TYPE_VEC4,{TYPE_FLOAT,TYPE_FLOAT,TYPE_VEC4,TYPE_VOID}}, - //intrinsics - geometric + {"isnan",TYPE_BOOL,{TYPE_FLOAT,TYPE_VOID}}, + {"isnan",TYPE_BOOL,{TYPE_VEC2,TYPE_VOID}}, + {"isnan",TYPE_BOOL,{TYPE_VEC3,TYPE_VOID}}, + {"isnan",TYPE_BOOL,{TYPE_VEC4,TYPE_VOID}}, + + {"isinf",TYPE_BOOL,{TYPE_FLOAT,TYPE_VOID}}, + {"isinf",TYPE_BOOL,{TYPE_VEC2,TYPE_VOID}}, + {"isinf",TYPE_BOOL,{TYPE_VEC3,TYPE_VOID}}, + {"isinf",TYPE_BOOL,{TYPE_VEC4,TYPE_VOID}}, + + {"floatBitsToInt",TYPE_INT,{TYPE_FLOAT,TYPE_VOID}}, + {"floatBitsToInt",TYPE_IVEC2,{TYPE_VEC2,TYPE_VOID}}, + {"floatBitsToInt",TYPE_IVEC3,{TYPE_VEC3,TYPE_VOID}}, + {"floatBitsToInt",TYPE_IVEC4,{TYPE_VEC4,TYPE_VOID}}, + + {"floatBitsToUInt",TYPE_UINT,{TYPE_FLOAT,TYPE_VOID}}, + {"floatBitsToUInt",TYPE_UVEC2,{TYPE_VEC2,TYPE_VOID}}, + {"floatBitsToUInt",TYPE_UVEC3,{TYPE_VEC3,TYPE_VOID}}, + {"floatBitsToUInt",TYPE_UVEC4,{TYPE_VEC4,TYPE_VOID}}, + + {"intBitsToFloat",TYPE_FLOAT,{TYPE_INT,TYPE_VOID}}, + {"intBitsToFloat",TYPE_VEC2,{TYPE_IVEC2,TYPE_VOID}}, + {"intBitsToFloat",TYPE_VEC3,{TYPE_IVEC3,TYPE_VOID}}, + {"intBitsToFloat",TYPE_VEC4,{TYPE_IVEC4,TYPE_VOID}}, + + {"uintBitsToFloat",TYPE_FLOAT,{TYPE_UINT,TYPE_VOID}}, + {"uintBitsToFloat",TYPE_VEC2,{TYPE_UVEC2,TYPE_VOID}}, + {"uintBitsToFloat",TYPE_VEC3,{TYPE_UVEC3,TYPE_VOID}}, + {"uintBitsToFloat",TYPE_VEC4,{TYPE_UVEC4,TYPE_VOID}}, + + //builtins - geometric {"length",TYPE_FLOAT,{TYPE_VEC2,TYPE_VOID}}, {"length",TYPE_FLOAT,{TYPE_VEC3,TYPE_VOID}}, {"length",TYPE_FLOAT,{TYPE_VEC4,TYPE_VOID}}, @@ -911,318 +1563,211 @@ const ShaderLanguage::IntrinsicFuncDef ShaderLanguage::intrinsic_func_defs[]={ {"normalize",TYPE_VEC4,{TYPE_VEC4,TYPE_VOID}}, {"reflect",TYPE_VEC3,{TYPE_VEC3,TYPE_VEC3,TYPE_VOID}}, {"refract",TYPE_VEC3,{TYPE_VEC3,TYPE_VEC3,TYPE_FLOAT,TYPE_VOID}}, - //intrinsics - texture - {"tex",TYPE_VEC4,{TYPE_TEXTURE,TYPE_VEC2,TYPE_VOID}}, - {"texcube",TYPE_VEC4,{TYPE_CUBEMAP,TYPE_VEC3,TYPE_VOID}}, - {"texscreen",TYPE_VEC3,{TYPE_VEC2,TYPE_VOID}}, - {"texpos",TYPE_VEC3,{TYPE_VEC3,TYPE_VOID}}, - {NULL,TYPE_VOID,{TYPE_VOID}} + {"facefordward",TYPE_VEC2,{TYPE_VEC2,TYPE_VEC2,TYPE_VEC2,TYPE_VOID}}, + {"facefordward",TYPE_VEC3,{TYPE_VEC3,TYPE_VEC3,TYPE_VEC3,TYPE_VOID}}, + {"facefordward",TYPE_VEC4,{TYPE_VEC4,TYPE_VEC4,TYPE_VEC4,TYPE_VOID}}, -}; + {"matrixCompMult",TYPE_MAT2,{TYPE_MAT2,TYPE_MAT2,TYPE_VOID}}, + {"matrixCompMult",TYPE_MAT3,{TYPE_MAT3,TYPE_MAT3,TYPE_VOID}}, + {"matrixCompMult",TYPE_MAT4,{TYPE_MAT4,TYPE_MAT4,TYPE_VOID}}, -const ShaderLanguage::OperatorDef ShaderLanguage::operator_defs[]={ - - {OP_ASSIGN,TYPE_VOID,{TYPE_BOOL,TYPE_BOOL}}, - {OP_ASSIGN,TYPE_VOID,{TYPE_FLOAT,TYPE_FLOAT}}, - {OP_ASSIGN,TYPE_VOID,{TYPE_VEC2,TYPE_VEC2}}, - {OP_ASSIGN,TYPE_VOID,{TYPE_VEC3,TYPE_VEC3}}, - {OP_ASSIGN,TYPE_VOID,{TYPE_VEC4,TYPE_VEC4}}, - {OP_ASSIGN,TYPE_VOID,{TYPE_MAT2,TYPE_MAT2}}, - {OP_ASSIGN,TYPE_VOID,{TYPE_MAT3,TYPE_MAT3}}, - {OP_ASSIGN,TYPE_VOID,{TYPE_MAT4,TYPE_MAT4}}, - {OP_ADD,TYPE_FLOAT,{TYPE_FLOAT,TYPE_FLOAT}}, - {OP_ADD,TYPE_VEC2,{TYPE_VEC2,TYPE_VEC2}}, - {OP_ADD,TYPE_VEC3,{TYPE_VEC3,TYPE_VEC3}}, - {OP_ADD,TYPE_VEC4,{TYPE_VEC4,TYPE_VEC4}}, - {OP_SUB,TYPE_FLOAT,{TYPE_FLOAT,TYPE_FLOAT}}, - {OP_SUB,TYPE_VEC2,{TYPE_VEC2,TYPE_VEC2}}, - {OP_SUB,TYPE_VEC3,{TYPE_VEC3,TYPE_VEC3}}, - {OP_SUB,TYPE_VEC4,{TYPE_VEC4,TYPE_VEC4}}, - {OP_MUL,TYPE_FLOAT,{TYPE_FLOAT,TYPE_FLOAT}}, - {OP_MUL,TYPE_VEC2,{TYPE_VEC2,TYPE_VEC2}}, - {OP_MUL,TYPE_VEC2,{TYPE_VEC2,TYPE_FLOAT}}, - {OP_MUL,TYPE_VEC2,{TYPE_FLOAT,TYPE_VEC2}}, - {OP_MUL,TYPE_VEC2,{TYPE_VEC2,TYPE_MAT3}}, - {OP_MUL,TYPE_VEC2,{TYPE_MAT2,TYPE_VEC2}}, - {OP_MUL,TYPE_VEC2,{TYPE_VEC2,TYPE_MAT2}}, - {OP_MUL,TYPE_VEC2,{TYPE_MAT3,TYPE_VEC2}}, - {OP_MUL,TYPE_VEC2,{TYPE_VEC2,TYPE_MAT4}}, - {OP_MUL,TYPE_VEC2,{TYPE_MAT4,TYPE_VEC2}}, - {OP_MUL,TYPE_VEC3,{TYPE_VEC3,TYPE_VEC3}}, - {OP_MUL,TYPE_VEC3,{TYPE_VEC3,TYPE_FLOAT}}, - {OP_MUL,TYPE_VEC3,{TYPE_FLOAT,TYPE_VEC3}}, - {OP_MUL,TYPE_VEC3,{TYPE_MAT3,TYPE_VEC3}}, - {OP_MUL,TYPE_VEC3,{TYPE_MAT4,TYPE_VEC3}}, - {OP_MUL,TYPE_VEC3,{TYPE_VEC3,TYPE_MAT3}}, - {OP_MUL,TYPE_VEC4,{TYPE_VEC4,TYPE_VEC4}}, - {OP_MUL,TYPE_VEC4,{TYPE_VEC4,TYPE_FLOAT}}, - {OP_MUL,TYPE_VEC4,{TYPE_FLOAT,TYPE_VEC4}}, - {OP_MUL,TYPE_VEC4,{TYPE_MAT4,TYPE_VEC4}}, - {OP_MUL,TYPE_VEC4,{TYPE_VEC4,TYPE_MAT4}}, - {OP_MUL,TYPE_MAT2,{TYPE_MAT2,TYPE_MAT2}}, - {OP_MUL,TYPE_MAT3,{TYPE_MAT3,TYPE_MAT3}}, - {OP_MUL,TYPE_MAT4,{TYPE_MAT4,TYPE_MAT4}}, - {OP_DIV,TYPE_FLOAT,{TYPE_FLOAT,TYPE_FLOAT}}, - {OP_DIV,TYPE_VEC2,{TYPE_VEC2,TYPE_VEC2}}, - {OP_DIV,TYPE_VEC2,{TYPE_VEC2,TYPE_FLOAT}}, - {OP_DIV,TYPE_VEC2,{TYPE_FLOAT,TYPE_VEC2}}, - {OP_DIV,TYPE_VEC3,{TYPE_VEC3,TYPE_VEC3}}, - {OP_DIV,TYPE_VEC3,{TYPE_VEC3,TYPE_FLOAT}}, - {OP_DIV,TYPE_VEC3,{TYPE_FLOAT,TYPE_VEC3}}, - {OP_DIV,TYPE_VEC4,{TYPE_VEC4,TYPE_VEC4}}, - {OP_DIV,TYPE_VEC4,{TYPE_VEC4,TYPE_FLOAT}}, - {OP_DIV,TYPE_VEC4,{TYPE_FLOAT,TYPE_VEC4}}, - {OP_ASSIGN_ADD,TYPE_VOID,{TYPE_FLOAT,TYPE_FLOAT}}, - {OP_ASSIGN_ADD,TYPE_VOID,{TYPE_VEC2,TYPE_VEC2}}, - {OP_ASSIGN_ADD,TYPE_VOID,{TYPE_VEC3,TYPE_VEC3}}, - {OP_ASSIGN_ADD,TYPE_VOID,{TYPE_VEC4,TYPE_VEC4}}, - {OP_ASSIGN_ADD,TYPE_VOID,{TYPE_VEC2,TYPE_FLOAT}}, - {OP_ASSIGN_ADD,TYPE_VOID,{TYPE_VEC3,TYPE_FLOAT}}, - {OP_ASSIGN_ADD,TYPE_VOID,{TYPE_VEC4,TYPE_FLOAT}}, - {OP_ASSIGN_SUB,TYPE_VOID,{TYPE_FLOAT,TYPE_FLOAT}}, - {OP_ASSIGN_SUB,TYPE_VOID,{TYPE_VEC2,TYPE_VEC2}}, - {OP_ASSIGN_SUB,TYPE_VOID,{TYPE_VEC3,TYPE_VEC3}}, - {OP_ASSIGN_SUB,TYPE_VOID,{TYPE_VEC4,TYPE_VEC4}}, - {OP_ASSIGN_SUB,TYPE_VOID,{TYPE_VEC2,TYPE_FLOAT}}, - {OP_ASSIGN_SUB,TYPE_VOID,{TYPE_VEC3,TYPE_FLOAT}}, - {OP_ASSIGN_SUB,TYPE_VOID,{TYPE_VEC4,TYPE_FLOAT}}, - {OP_ASSIGN_MUL,TYPE_VOID,{TYPE_FLOAT,TYPE_FLOAT}}, - {OP_ASSIGN_MUL,TYPE_VOID,{TYPE_VEC2,TYPE_VEC2}}, - {OP_ASSIGN_MUL,TYPE_VOID,{TYPE_VEC2,TYPE_FLOAT}}, - {OP_ASSIGN_MUL,TYPE_VOID,{TYPE_VEC2,TYPE_MAT2}}, - {OP_ASSIGN_MUL,TYPE_VOID,{TYPE_MAT2,TYPE_MAT2}}, - {OP_ASSIGN_MUL,TYPE_VOID,{TYPE_VEC3,TYPE_MAT3}}, - {OP_ASSIGN_MUL,TYPE_VOID,{TYPE_VEC3,TYPE_VEC3}}, - {OP_ASSIGN_MUL,TYPE_VOID,{TYPE_VEC3,TYPE_FLOAT}}, - {OP_ASSIGN_MUL,TYPE_VOID,{TYPE_VEC3,TYPE_MAT4}}, - {OP_ASSIGN_MUL,TYPE_VOID,{TYPE_VEC4,TYPE_VEC4}}, - {OP_ASSIGN_MUL,TYPE_VOID,{TYPE_VEC4,TYPE_FLOAT}}, - {OP_ASSIGN_MUL,TYPE_VOID,{TYPE_VEC4,TYPE_MAT4}}, - {OP_ASSIGN_MUL,TYPE_VOID,{TYPE_MAT3,TYPE_MAT3}}, - {OP_ASSIGN_MUL,TYPE_VOID,{TYPE_MAT4,TYPE_MAT4}}, - {OP_ASSIGN_DIV,TYPE_VOID,{TYPE_FLOAT,TYPE_FLOAT}}, - {OP_ASSIGN_DIV,TYPE_VOID,{TYPE_VEC2,TYPE_VEC2}}, - {OP_ASSIGN_DIV,TYPE_VOID,{TYPE_VEC2,TYPE_FLOAT}}, - {OP_ASSIGN_DIV,TYPE_VOID,{TYPE_VEC3,TYPE_VEC3}}, - {OP_ASSIGN_DIV,TYPE_VOID,{TYPE_VEC3,TYPE_FLOAT}}, - {OP_ASSIGN_DIV,TYPE_VOID,{TYPE_VEC4,TYPE_VEC4}}, - {OP_ASSIGN_DIV,TYPE_VOID,{TYPE_VEC4,TYPE_FLOAT}}, - {OP_NEG,TYPE_FLOAT,{TYPE_FLOAT,TYPE_VOID}}, - {OP_NEG,TYPE_VEC2,{TYPE_VEC2,TYPE_VOID}}, - {OP_NEG,TYPE_VEC3,{TYPE_VEC3,TYPE_VOID}}, - {OP_NEG,TYPE_VEC4,{TYPE_VEC4,TYPE_VOID}}, - {OP_NOT,TYPE_BOOL,{TYPE_BOOL,TYPE_VOID}}, - {OP_CMP_EQ,TYPE_BOOL,{TYPE_BOOL,TYPE_BOOL}}, - {OP_CMP_EQ,TYPE_BOOL,{TYPE_FLOAT,TYPE_FLOAT}}, - {OP_CMP_EQ,TYPE_BOOL,{TYPE_VEC3,TYPE_VEC2}}, - {OP_CMP_EQ,TYPE_BOOL,{TYPE_VEC3,TYPE_VEC3}}, - {OP_CMP_EQ,TYPE_BOOL,{TYPE_VEC3,TYPE_VEC4}}, - //{OP_CMP_EQ,TYPE_MAT3,{TYPE_MAT4,TYPE_MAT3}}, ?? - //{OP_CMP_EQ,TYPE_MAT4,{TYPE_MAT4,TYPE_MAT4}}, ?? - {OP_CMP_NEQ,TYPE_BOOL,{TYPE_BOOL,TYPE_BOOL}}, - {OP_CMP_NEQ,TYPE_BOOL,{TYPE_FLOAT,TYPE_FLOAT}}, - {OP_CMP_NEQ,TYPE_BOOL,{TYPE_VEC2,TYPE_VEC2}}, - {OP_CMP_NEQ,TYPE_BOOL,{TYPE_VEC3,TYPE_VEC3}}, - {OP_CMP_NEQ,TYPE_BOOL,{TYPE_VEC4,TYPE_VEC4}}, - //{OP_CMP_NEQ,TYPE_MAT4,{TYPE_MAT4,TYPE_MAT4}}, //? - {OP_CMP_LEQ,TYPE_BOOL,{TYPE_FLOAT,TYPE_FLOAT}}, - {OP_CMP_GEQ,TYPE_BOOL,{TYPE_FLOAT,TYPE_FLOAT}}, - {OP_CMP_LESS,TYPE_BOOL,{TYPE_FLOAT,TYPE_FLOAT}}, - {OP_CMP_GREATER,TYPE_BOOL,{TYPE_FLOAT,TYPE_FLOAT}}, - {OP_CMP_OR,TYPE_BOOL,{TYPE_BOOL,TYPE_BOOL}}, - {OP_CMP_AND,TYPE_BOOL,{TYPE_BOOL,TYPE_BOOL}}, - {OP_MAX,TYPE_VOID,{TYPE_VOID,TYPE_VOID}} -}; + {"outerProduct",TYPE_MAT2,{TYPE_VEC2,TYPE_VEC2,TYPE_VOID}}, + {"outerProduct",TYPE_MAT3,{TYPE_VEC3,TYPE_VEC3,TYPE_VOID}}, + {"outerProduct",TYPE_MAT4,{TYPE_VEC4,TYPE_VEC4,TYPE_VOID}}, + {"transpose",TYPE_MAT2,{TYPE_MAT2,TYPE_VOID}}, + {"transpose",TYPE_MAT3,{TYPE_MAT3,TYPE_VOID}}, + {"transpose",TYPE_MAT4,{TYPE_MAT4,TYPE_VOID}}, -const ShaderLanguage::BuiltinsDef ShaderLanguage::vertex_builtins_defs[]={ - - { "SRC_VERTEX", TYPE_VEC3}, - { "SRC_NORMAL", TYPE_VEC3}, - { "SRC_TANGENT", TYPE_VEC3}, - { "SRC_BINORMALF", TYPE_FLOAT}, - - { "POSITION", TYPE_VEC4 }, - { "VERTEX", TYPE_VEC3}, - { "NORMAL", TYPE_VEC3}, - { "TANGENT", TYPE_VEC3}, - { "BINORMAL", TYPE_VEC3}, - { "UV", TYPE_VEC2}, - { "UV2", TYPE_VEC2}, - { "COLOR", TYPE_VEC4}, - { "BONES", TYPE_VEC4}, - { "WEIGHTS", TYPE_VEC4}, - { "VAR1", TYPE_VEC4}, - { "VAR2", TYPE_VEC4}, - { "SPEC_EXP", TYPE_FLOAT}, - { "POINT_SIZE", TYPE_FLOAT}, - - //builtins - { "WORLD_MATRIX", TYPE_MAT4}, - { "INV_CAMERA_MATRIX", TYPE_MAT4}, - { "PROJECTION_MATRIX", TYPE_MAT4}, - { "MODELVIEW_MATRIX", TYPE_MAT4}, - { "INSTANCE_ID", TYPE_FLOAT}, - { "TIME", TYPE_FLOAT}, - { NULL, TYPE_VOID}, -}; -const ShaderLanguage::BuiltinsDef ShaderLanguage::fragment_builtins_defs[]={ - - { "VERTEX", TYPE_VEC3}, - { "POSITION", TYPE_VEC4}, - { "NORMAL", TYPE_VEC3}, - { "TANGENT", TYPE_VEC3}, - { "BINORMAL", TYPE_VEC3}, - { "NORMALMAP", TYPE_VEC3}, - { "NORMALMAP_DEPTH", TYPE_FLOAT}, - { "UV", TYPE_VEC2}, - { "UV2", TYPE_VEC2}, - { "COLOR", TYPE_VEC4}, - { "NORMAL", TYPE_VEC3}, - { "VAR1", TYPE_VEC4}, - { "VAR2", TYPE_VEC4}, - { "DIFFUSE", TYPE_VEC3}, - { "DIFFUSE_ALPHA", TYPE_VEC4}, - { "SPECULAR", TYPE_VEC3}, - { "EMISSION", TYPE_VEC3}, - { "SPEC_EXP", TYPE_FLOAT}, - { "GLOW", TYPE_FLOAT}, - { "SHADE_PARAM", TYPE_FLOAT}, - { "DISCARD", TYPE_BOOL}, - { "SCREEN_UV", TYPE_VEC2}, - { "POINT_COORD", TYPE_VEC2}, - { "INV_CAMERA_MATRIX", TYPE_MAT4}, - -// { "SCREEN_POS", TYPE_VEC2}, -// { "SCREEN_TEXEL_SIZE", TYPE_VEC2}, - { "TIME", TYPE_FLOAT}, - { NULL, TYPE_VOID} + {"determinant",TYPE_FLOAT,{TYPE_MAT2,TYPE_VOID}}, + {"determinant",TYPE_FLOAT,{TYPE_MAT3,TYPE_VOID}}, + {"determinant",TYPE_FLOAT,{TYPE_MAT4,TYPE_VOID}}, -}; + {"inverse",TYPE_MAT2,{TYPE_MAT2,TYPE_VOID}}, + {"inverse",TYPE_MAT3,{TYPE_MAT3,TYPE_VOID}}, + {"inverse",TYPE_MAT4,{TYPE_MAT4,TYPE_VOID}}, -const ShaderLanguage::BuiltinsDef ShaderLanguage::light_builtins_defs[]={ - - { "NORMAL", TYPE_VEC3}, - { "LIGHT_DIR", TYPE_VEC3}, - { "LIGHT_DIFFUSE", TYPE_VEC3}, - { "LIGHT_SPECULAR", TYPE_VEC3}, - { "EYE_VEC", TYPE_VEC3}, - { "DIFFUSE", TYPE_VEC3}, - { "SPECULAR", TYPE_VEC3}, - { "SPECULAR_EXP", TYPE_FLOAT}, - { "SHADE_PARAM", TYPE_FLOAT}, - { "LIGHT", TYPE_VEC3}, - { "SHADOW", TYPE_VEC3 }, - { "POINT_COORD", TYPE_VEC2 }, -// { "SCREEN_POS", TYPE_VEC2}, -// { "SCREEN_TEXEL_SIZE", TYPE_VEC2}, - { "TIME", TYPE_FLOAT}, - { NULL, TYPE_VOID} -}; + {"lessThan",TYPE_BVEC2,{TYPE_VEC2,TYPE_VEC2,TYPE_VOID}}, + {"lessThan",TYPE_BVEC3,{TYPE_VEC3,TYPE_VEC3,TYPE_VOID}}, + {"lessThan",TYPE_BVEC4,{TYPE_VEC4,TYPE_VEC4,TYPE_VOID}}, + {"lessThan",TYPE_BVEC2,{TYPE_IVEC2,TYPE_IVEC2,TYPE_VOID}}, + {"lessThan",TYPE_BVEC3,{TYPE_IVEC3,TYPE_IVEC3,TYPE_VOID}}, + {"lessThan",TYPE_BVEC4,{TYPE_IVEC4,TYPE_IVEC4,TYPE_VOID}}, + {"lessThan",TYPE_BVEC2,{TYPE_UVEC2,TYPE_UVEC2,TYPE_VOID}}, + {"lessThan",TYPE_BVEC3,{TYPE_UVEC3,TYPE_UVEC3,TYPE_VOID}}, + {"lessThan",TYPE_BVEC4,{TYPE_UVEC4,TYPE_UVEC4,TYPE_VOID}}, -const ShaderLanguage::BuiltinsDef ShaderLanguage::ci_vertex_builtins_defs[]={ + {"greaterThan",TYPE_BVEC2,{TYPE_VEC2,TYPE_VEC2,TYPE_VOID}}, + {"greaterThan",TYPE_BVEC3,{TYPE_VEC3,TYPE_VEC3,TYPE_VOID}}, + {"greaterThan",TYPE_BVEC4,{TYPE_VEC4,TYPE_VEC4,TYPE_VOID}}, - { "SRC_VERTEX", TYPE_VEC2}, - { "VERTEX", TYPE_VEC2}, - { "WORLD_VERTEX", TYPE_VEC2}, - { "UV", TYPE_VEC2}, - { "COLOR", TYPE_VEC4}, - { "VAR1", TYPE_VEC4}, - { "VAR2", TYPE_VEC4}, - { "POINT_SIZE", TYPE_FLOAT}, + {"greaterThan",TYPE_BVEC2,{TYPE_IVEC2,TYPE_IVEC2,TYPE_VOID}}, + {"greaterThan",TYPE_BVEC3,{TYPE_IVEC3,TYPE_IVEC3,TYPE_VOID}}, + {"greaterThan",TYPE_BVEC4,{TYPE_IVEC4,TYPE_IVEC4,TYPE_VOID}}, - //builtins - { "WORLD_MATRIX", TYPE_MAT4}, - { "PROJECTION_MATRIX", TYPE_MAT4}, - { "EXTRA_MATRIX", TYPE_MAT4}, - { "TIME", TYPE_FLOAT}, - { NULL, TYPE_VOID}, -}; -const ShaderLanguage::BuiltinsDef ShaderLanguage::ci_fragment_builtins_defs[]={ - - { "SRC_COLOR", TYPE_VEC4}, - { "POSITION", TYPE_VEC4}, - { "NORMAL", TYPE_VEC3}, - { "NORMALMAP", TYPE_VEC3}, - { "NORMALMAP_DEPTH", TYPE_FLOAT}, - { "UV", TYPE_VEC2}, - { "COLOR", TYPE_VEC4}, - { "TEXTURE", TYPE_TEXTURE}, - { "TEXTURE_PIXEL_SIZE", TYPE_VEC2}, - { "VAR1", TYPE_VEC4}, - { "VAR2", TYPE_VEC4}, - { "SCREEN_UV", TYPE_VEC2}, - { "POINT_COORD", TYPE_VEC2}, - -// { "SCREEN_POS", TYPE_VEC2}, -// { "SCREEN_TEXEL_SIZE", TYPE_VEC2}, - { "TIME", TYPE_FLOAT}, - { NULL, TYPE_VOID} + {"greaterThan",TYPE_BVEC2,{TYPE_UVEC2,TYPE_UVEC2,TYPE_VOID}}, + {"greaterThan",TYPE_BVEC3,{TYPE_UVEC3,TYPE_UVEC3,TYPE_VOID}}, + {"greaterThan",TYPE_BVEC4,{TYPE_UVEC4,TYPE_UVEC4,TYPE_VOID}}, -}; + {"lessThanEqual",TYPE_BVEC2,{TYPE_VEC2,TYPE_VEC2,TYPE_VOID}}, + {"lessThanEqual",TYPE_BVEC3,{TYPE_VEC3,TYPE_VEC3,TYPE_VOID}}, + {"lessThanEqual",TYPE_BVEC4,{TYPE_VEC4,TYPE_VEC4,TYPE_VOID}}, -const ShaderLanguage::BuiltinsDef ShaderLanguage::ci_light_builtins_defs[]={ - - { "POSITION", TYPE_VEC4}, - { "NORMAL", TYPE_VEC3}, - { "UV", TYPE_VEC2}, - { "COLOR", TYPE_VEC4}, - { "TEXTURE", TYPE_TEXTURE}, - { "TEXTURE_PIXEL_SIZE", TYPE_VEC2}, - { "VAR1", TYPE_VEC4}, - { "VAR2", TYPE_VEC4}, - { "SCREEN_UV", TYPE_VEC2}, - { "LIGHT_VEC", TYPE_VEC2}, - { "LIGHT_HEIGHT", TYPE_FLOAT}, - { "LIGHT_COLOR", TYPE_VEC4}, - { "LIGHT_UV", TYPE_VEC2}, - { "LIGHT_SHADOW", TYPE_VEC4}, - { "LIGHT", TYPE_VEC4}, - { "SHADOW", TYPE_VEC4}, - { "POINT_COORD", TYPE_VEC2}, -// { "SCREEN_POS", TYPE_VEC2}, -// { "SCREEN_TEXEL_SIZE", TYPE_VEC2}, - { "TIME", TYPE_FLOAT}, - { NULL, TYPE_VOID} + {"lessThanEqual",TYPE_BVEC2,{TYPE_IVEC2,TYPE_IVEC2,TYPE_VOID}}, + {"lessThanEqual",TYPE_BVEC3,{TYPE_IVEC3,TYPE_IVEC3,TYPE_VOID}}, + {"lessThanEqual",TYPE_BVEC4,{TYPE_IVEC4,TYPE_IVEC4,TYPE_VOID}}, -}; + {"lessThanEqual",TYPE_BVEC2,{TYPE_UVEC2,TYPE_UVEC2,TYPE_VOID}}, + {"lessThanEqual",TYPE_BVEC3,{TYPE_UVEC3,TYPE_UVEC3,TYPE_VOID}}, + {"lessThanEqual",TYPE_BVEC4,{TYPE_UVEC4,TYPE_UVEC4,TYPE_VOID}}, -const ShaderLanguage::BuiltinsDef ShaderLanguage::postprocess_fragment_builtins_defs[]={ + {"greaterThanEqual",TYPE_BVEC2,{TYPE_VEC2,TYPE_VEC2,TYPE_VOID}}, + {"greaterThanEqual",TYPE_BVEC3,{TYPE_VEC3,TYPE_VEC3,TYPE_VOID}}, + {"greaterThanEqual",TYPE_BVEC4,{TYPE_VEC4,TYPE_VEC4,TYPE_VOID}}, - { "IN_COLOR", TYPE_VEC3}, - { "IN_POSITION", TYPE_VEC3}, - { "OUT_COLOR", TYPE_VEC3}, - { "SCREEN_POS", TYPE_VEC2}, - { "SCREEN_TEXEL_SIZE", TYPE_VEC2}, - { "TIME", TYPE_FLOAT}, - { NULL, TYPE_VOID} -}; + {"greaterThanEqual",TYPE_BVEC2,{TYPE_IVEC2,TYPE_IVEC2,TYPE_VOID}}, + {"greaterThanEqual",TYPE_BVEC3,{TYPE_IVEC3,TYPE_IVEC3,TYPE_VOID}}, + {"greaterThanEqual",TYPE_BVEC4,{TYPE_IVEC4,TYPE_IVEC4,TYPE_VOID}}, + {"greaterThanEqual",TYPE_BVEC2,{TYPE_UVEC2,TYPE_UVEC2,TYPE_VOID}}, + {"greaterThanEqual",TYPE_BVEC3,{TYPE_UVEC3,TYPE_UVEC3,TYPE_VOID}}, + {"greaterThanEqual",TYPE_BVEC4,{TYPE_UVEC4,TYPE_UVEC4,TYPE_VOID}}, + {"equal",TYPE_BVEC2,{TYPE_VEC2,TYPE_VEC2,TYPE_VOID}}, + {"equal",TYPE_BVEC3,{TYPE_VEC3,TYPE_VEC3,TYPE_VOID}}, + {"equal",TYPE_BVEC4,{TYPE_VEC4,TYPE_VEC4,TYPE_VOID}}, -ShaderLanguage::DataType ShaderLanguage::compute_node_type(Node *p_node) { + {"equal",TYPE_BVEC2,{TYPE_IVEC2,TYPE_IVEC2,TYPE_VOID}}, + {"equal",TYPE_BVEC3,{TYPE_IVEC3,TYPE_IVEC3,TYPE_VOID}}, + {"equal",TYPE_BVEC4,{TYPE_IVEC4,TYPE_IVEC4,TYPE_VOID}}, - switch(p_node->type) { + {"equal",TYPE_BVEC2,{TYPE_UVEC2,TYPE_UVEC2,TYPE_VOID}}, + {"equal",TYPE_BVEC3,{TYPE_UVEC3,TYPE_UVEC3,TYPE_VOID}}, + {"equal",TYPE_BVEC4,{TYPE_UVEC4,TYPE_UVEC4,TYPE_VOID}}, - case Node::TYPE_PROGRAM: ERR_FAIL_V(TYPE_VOID); - case Node::TYPE_FUNCTION: return static_cast<FunctionNode*>(p_node)->return_type; - case Node::TYPE_BLOCK: ERR_FAIL_V(TYPE_VOID); - case Node::TYPE_VARIABLE: return static_cast<VariableNode*>(p_node)->datatype_cache; - case Node::TYPE_CONSTANT: return static_cast<ConstantNode*>(p_node)->datatype; - case Node::TYPE_OPERATOR: return static_cast<OperatorNode*>(p_node)->return_cache; - case Node::TYPE_CONTROL_FLOW: ERR_FAIL_V(TYPE_VOID); - case Node::TYPE_MEMBER: return static_cast<MemberNode*>(p_node)->datatype; - } + {"equal",TYPE_BVEC2,{TYPE_BVEC2,TYPE_BVEC2,TYPE_VOID}}, + {"equal",TYPE_BVEC3,{TYPE_BVEC3,TYPE_BVEC3,TYPE_VOID}}, + {"equal",TYPE_BVEC4,{TYPE_BVEC4,TYPE_BVEC4,TYPE_VOID}}, - return TYPE_VOID; -} + {"notEqual",TYPE_BVEC2,{TYPE_VEC2,TYPE_VEC2,TYPE_VOID}}, + {"notEqual",TYPE_BVEC3,{TYPE_VEC3,TYPE_VEC3,TYPE_VOID}}, + {"notEqual",TYPE_BVEC4,{TYPE_VEC4,TYPE_VEC4,TYPE_VOID}}, + + {"notEqual",TYPE_BVEC2,{TYPE_IVEC2,TYPE_IVEC2,TYPE_VOID}}, + {"notEqual",TYPE_BVEC3,{TYPE_IVEC3,TYPE_IVEC3,TYPE_VOID}}, + {"notEqual",TYPE_BVEC4,{TYPE_IVEC4,TYPE_IVEC4,TYPE_VOID}}, + {"notEqual",TYPE_BVEC2,{TYPE_UVEC2,TYPE_UVEC2,TYPE_VOID}}, + {"notEqual",TYPE_BVEC3,{TYPE_UVEC3,TYPE_UVEC3,TYPE_VOID}}, + {"notEqual",TYPE_BVEC4,{TYPE_UVEC4,TYPE_UVEC4,TYPE_VOID}}, -ShaderLanguage::Node* ShaderLanguage::validate_function_call(Parser&parser, OperatorNode *p_func) { + {"notEqual",TYPE_BVEC2,{TYPE_BVEC2,TYPE_BVEC2,TYPE_VOID}}, + {"notEqual",TYPE_BVEC3,{TYPE_BVEC3,TYPE_BVEC3,TYPE_VOID}}, + {"notEqual",TYPE_BVEC4,{TYPE_BVEC4,TYPE_BVEC4,TYPE_VOID}}, + + {"any",TYPE_BOOL,{TYPE_BVEC2,TYPE_VOID}}, + {"any",TYPE_BOOL,{TYPE_BVEC3,TYPE_VOID}}, + {"any",TYPE_BOOL,{TYPE_BVEC4,TYPE_VOID}}, + + {"all",TYPE_BOOL,{TYPE_BVEC2,TYPE_VOID}}, + {"all",TYPE_BOOL,{TYPE_BVEC3,TYPE_VOID}}, + {"all",TYPE_BOOL,{TYPE_BVEC4,TYPE_VOID}}, + + {"not",TYPE_BOOL,{TYPE_BVEC2,TYPE_VOID}}, + {"not",TYPE_BOOL,{TYPE_BVEC3,TYPE_VOID}}, + {"not",TYPE_BOOL,{TYPE_BVEC4,TYPE_VOID}}, + + //builtins - texture + {"textureSize",TYPE_VEC2,{TYPE_SAMPLER2D,TYPE_INT,TYPE_VOID}}, + {"textureSize",TYPE_VEC2,{TYPE_ISAMPLER2D,TYPE_INT,TYPE_VOID}}, + {"textureSize",TYPE_VEC2,{TYPE_USAMPLER2D,TYPE_INT,TYPE_VOID}}, + {"textureSize",TYPE_VEC2,{TYPE_SAMPLERCUBE,TYPE_INT,TYPE_VOID}}, + + {"texture",TYPE_VEC4,{TYPE_SAMPLER2D,TYPE_VEC2,TYPE_VOID}}, + {"texture",TYPE_VEC4,{TYPE_SAMPLER2D,TYPE_VEC3,TYPE_VOID}}, + {"texture",TYPE_VEC4,{TYPE_SAMPLER2D,TYPE_VEC2,TYPE_FLOAT,TYPE_VOID}}, + {"texture",TYPE_VEC4,{TYPE_SAMPLER2D,TYPE_VEC3,TYPE_FLOAT,TYPE_VOID}}, + + {"texture",TYPE_UVEC4,{TYPE_USAMPLER2D,TYPE_VEC2,TYPE_VOID}}, + {"texture",TYPE_UVEC4,{TYPE_USAMPLER2D,TYPE_VEC3,TYPE_VOID}}, + {"texture",TYPE_UVEC4,{TYPE_USAMPLER2D,TYPE_VEC2,TYPE_FLOAT,TYPE_VOID}}, + {"texture",TYPE_UVEC4,{TYPE_USAMPLER2D,TYPE_VEC3,TYPE_FLOAT,TYPE_VOID}}, + + {"texture",TYPE_IVEC4,{TYPE_ISAMPLER2D,TYPE_VEC2,TYPE_VOID}}, + {"texture",TYPE_IVEC4,{TYPE_ISAMPLER2D,TYPE_VEC3,TYPE_VOID}}, + {"texture",TYPE_IVEC4,{TYPE_ISAMPLER2D,TYPE_VEC2,TYPE_FLOAT,TYPE_VOID}}, + {"texture",TYPE_IVEC4,{TYPE_ISAMPLER2D,TYPE_VEC3,TYPE_FLOAT,TYPE_VOID}}, + + {"texture",TYPE_VEC4,{TYPE_SAMPLERCUBE,TYPE_VEC3,TYPE_VOID}}, + {"texture",TYPE_VEC4,{TYPE_SAMPLERCUBE,TYPE_VEC3,TYPE_FLOAT,TYPE_VOID}}, + + {"textureProj",TYPE_VEC4,{TYPE_SAMPLER2D,TYPE_VEC3,TYPE_VOID}}, + {"textureProj",TYPE_VEC4,{TYPE_SAMPLER2D,TYPE_VEC4,TYPE_VOID}}, + {"textureProj",TYPE_VEC4,{TYPE_SAMPLER2D,TYPE_VEC3,TYPE_FLOAT,TYPE_VOID}}, + {"textureProj",TYPE_VEC4,{TYPE_SAMPLER2D,TYPE_VEC4,TYPE_FLOAT,TYPE_VOID}}, + + {"textureProj",TYPE_IVEC4,{TYPE_ISAMPLER2D,TYPE_VEC3,TYPE_VOID}}, + {"textureProj",TYPE_IVEC4,{TYPE_ISAMPLER2D,TYPE_VEC4,TYPE_VOID}}, + {"textureProj",TYPE_IVEC4,{TYPE_ISAMPLER2D,TYPE_VEC3,TYPE_FLOAT,TYPE_VOID}}, + {"textureProj",TYPE_IVEC4,{TYPE_ISAMPLER2D,TYPE_VEC4,TYPE_FLOAT,TYPE_VOID}}, + + {"textureProj",TYPE_UVEC4,{TYPE_USAMPLER2D,TYPE_VEC3,TYPE_VOID}}, + {"textureProj",TYPE_UVEC4,{TYPE_USAMPLER2D,TYPE_VEC4,TYPE_VOID}}, + {"textureProj",TYPE_UVEC4,{TYPE_USAMPLER2D,TYPE_VEC3,TYPE_FLOAT,TYPE_VOID}}, + {"textureProj",TYPE_UVEC4,{TYPE_USAMPLER2D,TYPE_VEC4,TYPE_FLOAT,TYPE_VOID}}, + + {"textureLod",TYPE_VEC4,{TYPE_SAMPLER2D,TYPE_VEC3,TYPE_FLOAT,TYPE_VOID}}, + {"textureLod",TYPE_IVEC4,{TYPE_ISAMPLER2D,TYPE_VEC3,TYPE_FLOAT,TYPE_VOID}}, + {"textureLod",TYPE_UVEC4,{TYPE_USAMPLER2D,TYPE_VEC3,TYPE_FLOAT,TYPE_VOID}}, + {"textureLod",TYPE_VEC4,{TYPE_SAMPLERCUBE,TYPE_VEC3,TYPE_FLOAT,TYPE_VOID}}, + + {"texelFetch",TYPE_VEC4,{TYPE_SAMPLER2D,TYPE_IVEC2,TYPE_INT,TYPE_VOID}}, + {"texelFetch",TYPE_IVEC4,{TYPE_ISAMPLER2D,TYPE_IVEC2,TYPE_INT,TYPE_VOID}}, + {"texelFetch",TYPE_UVEC4,{TYPE_USAMPLER2D,TYPE_IVEC2,TYPE_INT,TYPE_VOID}}, + + {"textureProjLod",TYPE_VEC4,{TYPE_SAMPLER2D,TYPE_VEC3,TYPE_FLOAT,TYPE_VOID}}, + {"textureProjLod",TYPE_VEC4,{TYPE_SAMPLER2D,TYPE_VEC4,TYPE_FLOAT,TYPE_VOID}}, + + {"textureProjLod",TYPE_IVEC4,{TYPE_ISAMPLER2D,TYPE_VEC3,TYPE_FLOAT,TYPE_VOID}}, + {"textureProjLod",TYPE_IVEC4,{TYPE_ISAMPLER2D,TYPE_VEC4,TYPE_FLOAT,TYPE_VOID}}, + + {"textureProjLod",TYPE_UVEC4,{TYPE_USAMPLER2D,TYPE_VEC3,TYPE_FLOAT,TYPE_VOID}}, + {"textureProjLod",TYPE_UVEC4,{TYPE_USAMPLER2D,TYPE_VEC4,TYPE_FLOAT,TYPE_VOID}}, + + {"textureGrad",TYPE_VEC4,{TYPE_SAMPLER2D,TYPE_VEC2,TYPE_VEC2,TYPE_VEC2,TYPE_VOID}}, + {"textureGrad",TYPE_IVEC4,{TYPE_ISAMPLER2D,TYPE_VEC2,TYPE_VEC2,TYPE_VEC2,TYPE_VOID}}, + {"textureGrad",TYPE_UVEC4,{TYPE_USAMPLER2D,TYPE_VEC2,TYPE_VEC2,TYPE_VEC2,TYPE_VOID}}, + {"textureGrad",TYPE_VEC4,{TYPE_SAMPLERCUBE,TYPE_VEC3,TYPE_VEC3,TYPE_VEC3,TYPE_VOID}}, + + {"textureScreen",TYPE_VEC4,{TYPE_VEC2,TYPE_VOID}}, + + {"dFdx",TYPE_FLOAT,{TYPE_FLOAT,TYPE_VOID}}, + {"dFdx",TYPE_VEC2,{TYPE_VEC2,TYPE_VOID}}, + {"dFdx",TYPE_VEC3,{TYPE_VEC3,TYPE_VOID}}, + {"dFdx",TYPE_VEC4,{TYPE_VEC4,TYPE_VOID}}, + + {"dFdy",TYPE_FLOAT,{TYPE_FLOAT,TYPE_VOID}}, + {"dFdy",TYPE_VEC2,{TYPE_VEC2,TYPE_VOID}}, + {"dFdy",TYPE_VEC3,{TYPE_VEC3,TYPE_VOID}}, + {"dFdy",TYPE_VEC4,{TYPE_VEC4,TYPE_VOID}}, + + {"fwidth",TYPE_FLOAT,{TYPE_FLOAT,TYPE_VOID}}, + {"fwidth",TYPE_VEC2,{TYPE_VEC2,TYPE_VOID}}, + {"fwidth",TYPE_VEC3,{TYPE_VEC3,TYPE_VOID}}, + {"fwidth",TYPE_VEC4,{TYPE_VEC4,TYPE_VOID}}, + + + {NULL,TYPE_VOID,{TYPE_VOID}} + +}; + + + +bool ShaderLanguage::_validate_function_call(BlockNode* p_block, OperatorNode *p_func,DataType *r_ret_type) { ERR_FAIL_COND_V(p_func->op!=OP_CALL && p_func->op!=OP_CONSTRUCT,NULL); @@ -1231,44 +1776,49 @@ ShaderLanguage::Node* ShaderLanguage::validate_function_call(Parser&parser, Oper ERR_FAIL_COND_V( p_func->arguments[0]->type!=Node::TYPE_VARIABLE, NULL ); - String name = static_cast<VariableNode*>(p_func->arguments[0])->name.operator String(); + StringName name = static_cast<VariableNode*>(p_func->arguments[0])->name.operator String(); bool all_const=true; for(int i=1;i<p_func->arguments.size();i++) { if (p_func->arguments[i]->type!=Node::TYPE_CONSTANT) all_const=false; - args.push_back(compute_node_type(p_func->arguments[i])); + args.push_back(p_func->arguments[i]->get_datatype()); } int argcount=args.size(); - bool found_intrinsic=false; + bool failed_builtin=false; + if (argcount<=4) { - // test intrinsics + // test builtins int idx=0; - while (intrinsic_func_defs[idx].name) { + while (builtin_func_defs[idx].name) { - if (name==intrinsic_func_defs[idx].name) { + if (name==builtin_func_defs[idx].name) { + failed_builtin=true; bool fail=false; for(int i=0;i<argcount;i++) { - if (args[i]!=intrinsic_func_defs[idx].args[i]) { + if (get_scalar_type(args[i])==args[i] && p_func->arguments[i+1]->type==Node::TYPE_CONSTANT && convert_constant(static_cast<ConstantNode*>(p_func->arguments[i+1]),builtin_func_defs[idx].args[i])) { + //all good + } else if (args[i]!=builtin_func_defs[idx].args[i]) { fail=true; break; } } - if (!fail && argcount<4 && intrinsic_func_defs[idx].args[argcount]!=TYPE_VOID) + if (!fail && argcount<4 && builtin_func_defs[idx].args[argcount]!=TYPE_VOID) fail=true; //make sure the number of arguments matches if (!fail) { - p_func->return_cache=intrinsic_func_defs[idx].rettype; - found_intrinsic=true; - break; + if (r_ret_type) + *r_ret_type=builtin_func_defs[idx].rettype; + + return true; } } @@ -1277,8 +1827,24 @@ ShaderLanguage::Node* ShaderLanguage::validate_function_call(Parser&parser, Oper } } + if (failed_builtin) { + String err ="Invalid arguments for built-in function: "+String(name)+"("; + for(int i=0;i<argcount;i++) { + if (i>0) + err+=","; + + if (p_func->arguments[i+1]->type==Node::TYPE_CONSTANT && p_func->arguments[i+1]->get_datatype()==TYPE_INT && static_cast<ConstantNode*>(p_func->arguments[i+1])->values[0].sint<0) { + err+="-"; + } + err+=get_datatype_name(args[i]); + } + err+=")"; + _set_error(err); + return false; + } - if (found_intrinsic) { +#if 0 + if (found_builtin) { if (p_func->op==OP_CONSTRUCT && all_const) { @@ -1290,6 +1856,7 @@ ShaderLanguage::Node* ShaderLanguage::validate_function_call(Parser&parser, Oper switch(v.get_type()) { case Variant::REAL: cdata.push_back(v); break; + case Variant::INT: cdata.push_back(v); break; case Variant::VECTOR2: { Vector2 v2=v; cdata.push_back(v2.x); cdata.push_back(v2.y); } break; case Variant::VECTOR3: { Vector3 v3=v; cdata.push_back(v3.x); cdata.push_back(v3.y); cdata.push_back(v3.z);} break; case Variant::PLANE: { Plane v4=v; cdata.push_back(v4.normal.x); cdata.push_back(v4.normal.y); cdata.push_back(v4.normal.z); cdata.push_back(v4.d); } break; @@ -1331,193 +1898,335 @@ ShaderLanguage::Node* ShaderLanguage::validate_function_call(Parser&parser, Oper } return p_func; } - +#endif // try existing functions.. - FunctionNode *exclude_function=NULL; //exclude current function (in case inside one) - - - Node *node = p_func; + StringName exclude_function; + BlockNode *block = p_block; - while(node->parent) { + while(block) { - if (node->type==Node::TYPE_FUNCTION) { - - exclude_function = (FunctionNode*)node; + if (block->parent_function) { + exclude_function=block->parent_function->name; } + block=block->parent_block; + } - node=node->parent; + if (name==exclude_function) { + _set_error("Recursion is not allowed"); + return false; } - ERR_FAIL_COND_V(node->type!=Node::TYPE_PROGRAM,NULL); - ProgramNode *program = (ProgramNode*)node; + for(int i=0;i<shader->functions.size();i++) { - for(int i=0;i<program->functions.size();i++) { - if (program->functions[i].function==exclude_function) + if (name != shader->functions[i].name) continue; - FunctionNode *pfunc = program->functions[i].function; + if (!shader->functions[i].callable) { + _set_error("Function '"+String(name)+" can't be called from source code."); + return false; + } + + FunctionNode *pfunc = shader->functions[i].function; + if (pfunc->arguments.size()!=args.size()) continue; bool fail=false; + for(int i=0;i<args.size();i++) { - if (args[i]!=pfunc->arguments[i].type) { + + if (get_scalar_type(args[i])==args[i] && p_func->arguments[i+1]->type==Node::TYPE_CONSTANT && convert_constant(static_cast<ConstantNode*>(p_func->arguments[i+1]),pfunc->arguments[i].type)) { + //all good + } else if (args[i]!=pfunc->arguments[i].type) { fail=true; break; } } - if (!fail && name == program->functions[i].name) { + if (!fail) { p_func->return_cache=pfunc->return_type; - return p_func; + return true; } } - return NULL; + return false; } -ShaderLanguage::Node * ShaderLanguage::validate_operator(Parser& parser,OperatorNode *p_func) { +bool ShaderLanguage::_parse_function_arguments(BlockNode* p_block,const Map<StringName,DataType> &p_builtin_types,OperatorNode* p_func,int *r_complete_arg) { - int argcount = p_func->arguments.size(); - ERR_FAIL_COND_V(argcount>2,NULL); + TkPos pos = _get_tkpos(); + Token tk = _get_token(); - DataType argtype[2]={TYPE_VOID,TYPE_VOID}; - bool all_const=true; + if (tk.type==TK_PARENTHESIS_CLOSE) { + return true; + } - for(int i=0;i<argcount;i++) { + _set_tkpos(pos);; + + + while(true) { + + + if (r_complete_arg) { + pos = _get_tkpos(); + tk = _get_token(); + + if (tk.type==TK_CURSOR) { + + *r_complete_arg=p_func->arguments.size()-1; + } else { + + _set_tkpos(pos); + } + } + + Node *arg= _parse_and_reduce_expression(p_block,p_builtin_types); + + if (!arg) { + + return false; + } + + + p_func->arguments.push_back(arg); + + tk = _get_token(); + + + if (tk.type==TK_PARENTHESIS_CLOSE) { + + return true; + } else if (tk.type!=TK_COMMA) { + // something is broken + _set_error("Expected ',' or ')' after argument"); + return false; + } - argtype[i]=compute_node_type(p_func->arguments[i]); - if (p_func->arguments[i]->type!=Node::TYPE_CONSTANT) - all_const=false; } - int idx=0; - bool valid=false; - while(operator_defs[idx].op!=OP_MAX) { + return true; +} + +bool ShaderLanguage::is_token_operator(TokenType p_type) { - if (p_func->op==operator_defs[idx].op) { + return (p_type==TK_OP_EQUAL || + p_type==TK_OP_NOT_EQUAL || + p_type==TK_OP_LESS || + p_type==TK_OP_LESS_EQUAL || + p_type==TK_OP_GREATER || + p_type==TK_OP_GREATER_EQUAL || + p_type==TK_OP_AND || + p_type==TK_OP_OR || + p_type==TK_OP_NOT || + p_type==TK_OP_ADD || + p_type==TK_OP_SUB || + p_type==TK_OP_MUL || + p_type==TK_OP_DIV || + p_type==TK_OP_MOD || + p_type==TK_OP_SHIFT_LEFT || + p_type==TK_OP_SHIFT_RIGHT || + p_type==TK_OP_ASSIGN || + p_type==TK_OP_ASSIGN_ADD || + p_type==TK_OP_ASSIGN_SUB || + p_type==TK_OP_ASSIGN_MUL || + p_type==TK_OP_ASSIGN_DIV || + p_type==TK_OP_ASSIGN_MOD || + p_type==TK_OP_ASSIGN_SHIFT_LEFT || + p_type==TK_OP_ASSIGN_SHIFT_RIGHT || + p_type==TK_OP_ASSIGN_BIT_AND || + p_type==TK_OP_ASSIGN_BIT_OR || + p_type==TK_OP_ASSIGN_BIT_XOR || + p_type==TK_OP_BIT_AND || + p_type==TK_OP_BIT_OR || + p_type==TK_OP_BIT_XOR || + p_type==TK_OP_BIT_INVERT || + p_type==TK_OP_INCREMENT || + p_type==TK_OP_DECREMENT || + p_type==TK_QUESTION || + p_type==TK_COLON ); +} - if (operator_defs[idx].args[0]==argtype[0] && operator_defs[idx].args[1]==argtype[1]) { +bool ShaderLanguage::convert_constant(ConstantNode* p_constant, DataType p_to_type,ConstantNode::Value *p_value) { - p_func->return_cache=operator_defs[idx].rettype; - valid=true; - break; + if (p_constant->datatype==p_to_type) { + if (p_value) { + for(int i=0;i<p_constant->values.size();i++) { + p_value[i]=p_constant->values[i]; } } + return true; + } else if (p_constant->datatype==TYPE_INT && p_to_type==TYPE_FLOAT) { + + if (p_value) { + p_value->real=p_constant->values[0].sint; + } + return true; + } else if (p_constant->datatype==TYPE_UINT && p_to_type==TYPE_FLOAT) { + + if (p_value) { + p_value->real=p_constant->values[0].uint; + } + return true; + } else if (p_constant->datatype==TYPE_INT && p_to_type==TYPE_UINT) { + if (p_constant->values[0].sint<0) { + return false; + } + if (p_value) { + p_value->uint=p_constant->values[0].sint; + } + return true; + } else if (p_constant->datatype==TYPE_UINT && p_to_type==TYPE_INT) { + + if (p_constant->values[0].uint>0x7FFFFFFF) { + return false; + } + if (p_value) { + p_value->sint=p_constant->values[0].uint; + } + return true; + } else + return false; + +} + +bool ShaderLanguage::is_scalar_type(DataType p_type) { + + return p_type==TYPE_BOOL || p_type==TYPE_INT || p_type==TYPE_UINT || p_type==TYPE_FLOAT; +} + +bool ShaderLanguage::is_sampler_type(DataType p_type) { + + return p_type==TYPE_SAMPLER2D || p_type==TYPE_ISAMPLER2D || p_type==TYPE_USAMPLER2D || p_type==TYPE_SAMPLERCUBE; + +} + +void ShaderLanguage::get_keyword_list(List<String> *r_keywords) { + + Set<String> kws; + + int idx=0; + + while(keyword_list[idx].text) { + kws.insert(keyword_list[idx].text); idx++; } - if (!valid) - return NULL; + idx=0; -#define _RCO2(m_op,m_vop)\ -case m_op: {\ - ConstantNode *cn = parser.create_node<ConstantNode>(p_func->parent);\ - cn->datatype=p_func->return_cache; \ - Variant::evaluate(m_vop,static_cast<ConstantNode*>(p_func->arguments[0])->value,static_cast<ConstantNode*>(p_func->arguments[1])->value,cn->value,valid);\ - if (!valid)\ - return NULL;\ - return cn;\ -} break; - -#define _RCO1(m_op,m_vop)\ -case m_op: {\ - ConstantNode *cn = parser.create_node<ConstantNode>(p_func->parent);\ - cn->datatype=p_func->return_cache; \ - Variant::evaluate(m_vop,static_cast<ConstantNode*>(p_func->arguments[0])->value,Variant(),cn->value,valid);\ - if (!valid)\ - return NULL;\ - return cn;\ -} break; - - if (all_const) { - //reduce constant operator - switch(p_func->op) { - _RCO2(OP_ADD,Variant::OP_ADD); - _RCO2(OP_SUB,Variant::OP_SUBSTRACT); - _RCO2(OP_MUL,Variant::OP_MULTIPLY); - _RCO2(OP_DIV,Variant::OP_DIVIDE); - _RCO1(OP_NEG,Variant::OP_NEGATE); - _RCO1(OP_NOT,Variant::OP_NOT); - _RCO2(OP_CMP_EQ,Variant::OP_EQUAL); - _RCO2(OP_CMP_NEQ,Variant::OP_NOT_EQUAL); - _RCO2(OP_CMP_LEQ,Variant::OP_LESS_EQUAL); - _RCO2(OP_CMP_GEQ,Variant::OP_GREATER_EQUAL); - _RCO2(OP_CMP_LESS,Variant::OP_LESS); - _RCO2(OP_CMP_GREATER,Variant::OP_GREATER); - _RCO2(OP_CMP_OR,Variant::OP_OR); - _RCO2(OP_CMP_AND,Variant::OP_AND); - default: {} - } + while (builtin_func_defs[idx].name) { + + kws.insert(builtin_func_defs[idx].name); + + idx++; + } + + for(Set<String>::Element *E=kws.front();E;E=E->next()) { + r_keywords->push_back(E->get()); } +} +void ShaderLanguage::get_builtin_funcs(List<String> *r_keywords) { - return p_func; + Set<String> kws; + + int idx=0; + + while (builtin_func_defs[idx].name) { + + kws.insert(builtin_func_defs[idx].name); + + idx++; + } + + for(Set<String>::Element *E=kws.front();E;E=E->next()) { + r_keywords->push_back(E->get()); + } } -bool ShaderLanguage::is_token_operator(TokenType p_type) { - return (p_type==TK_OP_EQUAL) || - (p_type==TK_OP_NOT_EQUAL) || - (p_type==TK_OP_LESS) || - (p_type==TK_OP_LESS_EQUAL) || - (p_type==TK_OP_GREATER) || - (p_type==TK_OP_GREATER_EQUAL) || - (p_type==TK_OP_AND) || - (p_type==TK_OP_OR) || - (p_type==TK_OP_NOT) || - (p_type==TK_OP_ADD) || - (p_type==TK_OP_SUB) || - (p_type==TK_OP_MUL) || - (p_type==TK_OP_DIV) || - (p_type==TK_OP_NEG) || - (p_type==TK_OP_ASSIGN) || - (p_type==TK_OP_ASSIGN_ADD) || - (p_type==TK_OP_ASSIGN_SUB) || - (p_type==TK_OP_ASSIGN_MUL) || - (p_type==TK_OP_ASSIGN_DIV); +ShaderLanguage::DataType ShaderLanguage::get_scalar_type(DataType p_type) { + + static const DataType scalar_types[]={ + TYPE_VOID, + TYPE_BOOL, + TYPE_BOOL, + TYPE_BOOL, + TYPE_BOOL, + TYPE_INT, + TYPE_INT, + TYPE_INT, + TYPE_INT, + TYPE_UINT, + TYPE_UINT, + TYPE_UINT, + TYPE_UINT, + TYPE_FLOAT, + TYPE_FLOAT, + TYPE_FLOAT, + TYPE_FLOAT, + TYPE_FLOAT, + TYPE_FLOAT, + TYPE_FLOAT, + TYPE_FLOAT, + TYPE_INT, + TYPE_UINT, + TYPE_FLOAT, + }; + + return scalar_types[p_type]; } -ShaderLanguage::Operator ShaderLanguage::get_token_operator(TokenType p_type) { - switch(p_type) { - case TK_OP_EQUAL: return OP_CMP_EQ ; - case TK_OP_NOT_EQUAL: return OP_CMP_NEQ; - case TK_OP_LESS: return OP_CMP_LESS ; - case TK_OP_LESS_EQUAL: return OP_CMP_LEQ ; - case TK_OP_GREATER: return OP_CMP_GREATER ; - case TK_OP_GREATER_EQUAL: return OP_CMP_GEQ ; - case TK_OP_AND: return OP_CMP_AND ; - case TK_OP_OR: return OP_CMP_OR ; - case TK_OP_NOT: return OP_NOT ; - case TK_OP_ADD: return OP_ADD ; - case TK_OP_SUB: return OP_SUB ; - case TK_OP_MUL: return OP_MUL ; - case TK_OP_DIV: return OP_DIV ; - case TK_OP_NEG: return OP_NEG ; - case TK_OP_ASSIGN: return OP_ASSIGN ; - case TK_OP_ASSIGN_ADD: return OP_ASSIGN_ADD ; - case TK_OP_ASSIGN_SUB: return OP_ASSIGN_SUB ; - case TK_OP_ASSIGN_MUL: return OP_ASSIGN_MUL ; - case TK_OP_ASSIGN_DIV: return OP_ASSIGN_DIV ; - default: ERR_FAIL_V(OP_MAX); + +bool ShaderLanguage::_get_completable_identifier(BlockNode *p_block,CompletionType p_type,StringName& identifier) { + + identifier=StringName(); + + TkPos pos; + + Token tk = _get_token(); + + if (tk.type==TK_IDENTIFIER) { + identifier=tk.text; + pos = _get_tkpos(); + tk = _get_token(); + } + + if (tk.type==TK_CURSOR) { + + completion_type=p_type; + completion_line=tk_line; + completion_block=p_block; + + pos = _get_tkpos(); + tk = _get_token(); + + if (tk.type==TK_IDENTIFIER) { + identifier=identifier.operator String() + tk.text.operator String(); + } else { + _set_tkpos(pos); + } + return true; + } else if (identifier!=StringName()){ + _set_tkpos(pos); } - return OP_MAX; + return false; } -Error ShaderLanguage::parse_expression(Parser& parser,Node *p_parent,Node **r_expr) { + +ShaderLanguage::Node* ShaderLanguage::_parse_expression(BlockNode* p_block,const Map<StringName,DataType> &p_builtin_types) { Vector<Expression> expression; //Vector<TokenType> operators; @@ -1525,416 +2234,462 @@ Error ShaderLanguage::parse_expression(Parser& parser,Node *p_parent,Node **r_ex while(true) { Node *expr=NULL; + TkPos prepos = _get_tkpos(); + Token tk = _get_token(); + TkPos pos = _get_tkpos(); - if (parser.get_token_type()==TK_PARENTHESIS_OPEN) { + if (tk.type==TK_PARENTHESIS_OPEN) { //handle subexpression - parser.advance(); - Error err = parse_expression(parser,p_parent,&expr); - if (err) - return err; - if (parser.get_token_type()!=TK_PARENTHESIS_CLOSE) { + expr = _parse_and_reduce_expression(p_block,p_builtin_types); + if (!expr) + return NULL; - parser.set_error("Expected ')' in expression"); - return ERR_PARSE_ERROR; - } + tk = _get_token(); + + if (tk.type!=TK_PARENTHESIS_CLOSE) { - parser.advance(); + _set_error("Expected ')' in expression"); + return NULL; + } - } else if (parser.get_token_type()==TK_REAL_CONSTANT) { + } else if (tk.type==TK_REAL_CONSTANT) { - ConstantNode *constant = parser.create_node<ConstantNode>(p_parent); - constant->value=parser.get_token().text.operator String().to_double(); + ConstantNode *constant = alloc_node<ConstantNode>(); + ConstantNode::Value v; + v.real=tk.constant; + constant->values.push_back(v); constant->datatype=TYPE_FLOAT; expr=constant; - parser.advance(); - } else if (parser.get_token_type()==TK_TRUE) { + + } else if (tk.type==TK_INT_CONSTANT) { + + + ConstantNode *constant = alloc_node<ConstantNode>(); + ConstantNode::Value v; + v.sint=tk.constant; + constant->values.push_back(v); + constant->datatype=TYPE_INT; + expr=constant; + + } else if (tk.type==TK_TRUE) { //print_line("found true"); //handle true constant - ConstantNode *constant = parser.create_node<ConstantNode>(p_parent); - constant->value=true; + ConstantNode *constant = alloc_node<ConstantNode>(); + ConstantNode::Value v; + v.boolean=true; + constant->values.push_back(v); constant->datatype=TYPE_BOOL; expr=constant; - parser.advance(); - } else if (parser.get_token_type()==TK_FALSE) { + + } else if (tk.type==TK_FALSE) { //handle false constant - ConstantNode *constant = parser.create_node<ConstantNode>(p_parent); - constant->value=false; + ConstantNode *constant = alloc_node<ConstantNode>(); + ConstantNode::Value v; + v.boolean=false; + constant->values.push_back(v); constant->datatype=TYPE_BOOL; expr=constant; - parser.advance(); - } else if (parser.get_token_type()==TK_TYPE_VOID) { - - //make sure void is not used in expression - parser.set_error("Void value not allowed in Expression"); - return ERR_PARSE_ERROR; - } else if (parser.get_token_type(1)==TK_PARENTHESIS_OPEN && (is_token_nonvoid_datatype(parser.get_token_type()) || parser.get_token_type()==TK_INDENTIFIER)) { - - - //function or constructor - StringName name; - DataType constructor=TYPE_VOID; - if (is_token_nonvoid_datatype(parser.get_token_type())) { - - constructor=get_token_datatype(parser.get_token_type()); - switch(get_token_datatype(parser.get_token_type())) { - case TYPE_BOOL: name="bool"; break; - case TYPE_FLOAT: name="float"; break; - case TYPE_VEC2: name="vec2"; break; - case TYPE_VEC3: name="vec3"; break; - case TYPE_VEC4: name="vec4"; break; - case TYPE_MAT2: name="mat2"; break; - case TYPE_MAT3: name="mat3"; break; - case TYPE_MAT4: name="mat4"; break; - default: ERR_FAIL_V(ERR_BUG); - } - } else { - name=parser.get_token().text; - } + } else if (tk.type==TK_TYPE_VOID) { - if (!test_existing_identifier(p_parent,name)) { + //make sure void is not used in expression + _set_error("Void value not allowed in Expression"); + return NULL; + } else if (is_token_nonvoid_datatype(tk.type)) { + //basic type constructor - parser.set_error("Unknown identifier in expression: "+name); - return ERR_PARSE_ERROR; - } + OperatorNode *func = alloc_node<OperatorNode>(); + func->op=OP_CONSTRUCT; - parser.advance(2); - OperatorNode *func = parser.create_node<OperatorNode>(p_parent); + if (is_token_precision(tk.type)) { - func->op=constructor!=TYPE_VOID?OP_CONSTRUCT:OP_CALL; + func->return_precision_cache=get_token_precision(tk.type); + tk=_get_token(); + } - VariableNode *funcname = parser.create_node<VariableNode>(func); - funcname->name=name; + VariableNode *funcname = alloc_node<VariableNode>(); + funcname->name=get_datatype_name(get_token_datatype(tk.type)); func->arguments.push_back(funcname); - //parse parameters + tk=_get_token(); + if (tk.type!=TK_PARENTHESIS_OPEN) { + _set_error("Expected '(' after type name"); + return NULL; + } - if (parser.get_token_type()==TK_PARENTHESIS_CLOSE) { - parser.advance(); - } else { + int carg=-1; - while(true) { + bool ok = _parse_function_arguments(p_block,p_builtin_types,func,&carg); + if (carg>=0) { + completion_type=COMPLETION_CALL_ARGUMENTS; + completion_line=tk_line; + completion_block=p_block; + completion_function=funcname->name; + completion_argument=carg; + } - Node *arg=NULL; - Error err = parse_expression(parser,func,&arg); - if (err) - return err; - func->arguments.push_back(arg); + if (!ok) + return NULL; - if (parser.get_token_type()==TK_PARENTHESIS_CLOSE) { - parser.advance(); - break; + if (!_validate_function_call(p_block,func,&func->return_cache)) { + _set_error("No matching constructor found for: '"+String(funcname->name)+"'"); + return NULL; + } + //validate_Function_call() - } else if (parser.get_token_type()==TK_COMMA) { + expr=_reduce_expression(p_block,func); - if (parser.get_token_type(1)==TK_PARENTHESIS_CLOSE) { - parser.set_error("Expression expected"); - return ERR_PARSE_ERROR; - } + } else if (tk.type==TK_IDENTIFIER) { - parser.advance(); - } else { - // something is broken - parser.set_error("Expected ',' or ')'"); - return ERR_PARSE_ERROR; - } + _set_tkpos(prepos); - } - } + StringName identifier; - expr=validate_function_call(parser,func); - if (!expr) { + _get_completable_identifier(p_block,COMPLETION_IDENTIFIER,identifier); - parser.set_error("Invalid arguments to function/constructor: "+StringName(name)); - return ERR_PARSE_ERROR; - } + tk=_get_token(); + if (tk.type==TK_PARENTHESIS_OPEN) { + //a function + StringName name = identifier; - } else if (parser.get_token_type()==TK_INDENTIFIER) { - //probably variable + OperatorNode *func = alloc_node<OperatorNode>(); + func->op=OP_CALL; + VariableNode *funcname = alloc_node<VariableNode>(); + funcname->name=name; + func->arguments.push_back(funcname); + int carg=-1; - Node *node =p_parent; - bool existing=false; - DataType datatype; - StringName identifier=parser.get_token().text; + bool ok =_parse_function_arguments(p_block,p_builtin_types,func,&carg); - while(node) { + for(int i=0;i<shader->functions.size();i++) { + if (shader->functions[i].name==name) { + shader->functions[i].uses_function.insert(name); + } + } - if (node->type==Node::TYPE_BLOCK) { - BlockNode *block = (BlockNode*)node; - if (block->variables.has(identifier)) { - existing=true; - datatype=block->variables[identifier]; - break; - } + if (carg>=0) { + completion_type=COMPLETION_CALL_ARGUMENTS; + completion_line=tk_line; + completion_block=p_block; + completion_function=funcname->name; + completion_argument=carg; } - if (node->type==Node::TYPE_FUNCTION) { + if (!ok) + return NULL; - FunctionNode *function=(FunctionNode*)node; - for(int i=0;i<function->arguments.size();i++) { - if (function->arguments[i].name==identifier) { - existing=true; - datatype=function->arguments[i].type; - break; - } - } + if (!_validate_function_call(p_block,func,&func->return_cache)) { + _set_error("No matching function found for: '"+String(funcname->name)+"'"); + return NULL; + } - if (existing) - break; + expr=func; - } + } else { + //an identifier - if (node->type==Node::TYPE_PROGRAM) { + _set_tkpos(pos); - ProgramNode *program = (ProgramNode*)node; - if (program->builtin_variables.has(identifier)) { - datatype = program->builtin_variables[identifier]; - existing=true; - break; - } - if (program->uniforms.has(identifier)) { - datatype = program->uniforms[identifier].type; - existing=true; - break; - } + DataType data_type; + IdentifierType ident_type; + if (!_find_identifier(p_block,p_builtin_types,identifier,&data_type,&ident_type)) { + _set_error("Unknown identifier in expression: "+String(identifier)); + return NULL; } - node=node->parent; - } + if (ident_type==IDENTIFIER_FUNCTION) { + _set_error("Can't use function as identifier: "+String(identifier)); + return NULL; + } - if (!existing) { - parser.set_error("Nonexistent identifier in expression: "+identifier); - return ERR_PARSE_ERROR; + VariableNode *varname = alloc_node<VariableNode>(); + varname->name=identifier; + varname->datatype_cache=data_type; + expr=varname; } - VariableNode *varname = parser.create_node<VariableNode>(p_parent); - varname->name=identifier; - varname->datatype_cache=datatype; - parser.advance(); - expr=varname; - - } else if (parser.get_token_type()==TK_OP_SUB || parser.get_token_type()==TK_OP_NOT) { - //single prefix operators - TokenType token_type=parser.get_token_type(); - parser.advance(); - //Node *subexpr=NULL; - //Error err = parse_expression(parser,p_parent,&subexpr); - //if (err) - // return err; + } else if (tk.type==TK_OP_ADD) { + continue; //this one does nothing + } else if (tk.type==TK_OP_SUB || tk.type==TK_OP_NOT || tk.type==TK_OP_BIT_INVERT || tk.type==TK_OP_INCREMENT || tk.type==TK_OP_DECREMENT) { - //OperatorNode *op = parser.create_node<OperatorNode>(p_parent); Expression e; e.is_op=true; - switch(token_type) { - case TK_OP_SUB: e.op=TK_OP_NEG; break; - case TK_OP_NOT: e.op=TK_OP_NOT; break; - //case TK_OP_PLUS_PLUS: op->op=OP_PLUS_PLUS; break; - //case TK_OP_MINUS_MINUS: op->op=OP_MINUS_MINUS; break; - default: ERR_FAIL_V(ERR_BUG); + switch(tk.type) { + case TK_OP_SUB: e.op=OP_NEGATE; break; + case TK_OP_NOT: e.op=OP_NOT; break; + case TK_OP_BIT_INVERT: e.op=OP_BIT_INVERT; break; + case TK_OP_INCREMENT: e.op=OP_INCREMENT; break; + case TK_OP_DECREMENT: e.op=OP_DECREMENT; break; + default: ERR_FAIL_V(NULL); } expression.push_back(e); - continue; } else { - print_line("found bug?"); - print_line("misplaced token: "+String(token_names[parser.get_token_type()])); - - parser.set_error("Error parsing expression, misplaced: "+String(token_names[parser.get_token_type()])); - return ERR_PARSE_ERROR; + _set_error("Expected expression, found: "+get_token_text(tk)); + return NULL; //nothing } - ERR_FAIL_COND_V(!expr,ERR_BUG); + ERR_FAIL_COND_V(!expr,NULL); /* OK now see what's NEXT to the operator.. */ /* OK now see what's NEXT to the operator.. */ /* OK now see what's NEXT to the operator.. */ + while(true) { + TkPos pos = _get_tkpos(); + tk=_get_token(); - if (parser.get_token_type()==TK_PERIOD) { + if (tk.type==TK_PERIOD) { - if (parser.get_token_type(1)!=TK_INDENTIFIER) { - parser.set_error("Expected identifier as member"); - return ERR_PARSE_ERROR; - } - - DataType dt = compute_node_type(expr); - String ident = parser.get_token(1).text; - - bool ok=true; - DataType member_type; - switch(dt) { - case TYPE_VEC2: { - - int l = ident.length(); - if (l==1) { - member_type=TYPE_FLOAT; - } else if (l==2) { - member_type=TYPE_VEC2; - } else { - ok=false; - break; - } + StringName identifier; + if (_get_completable_identifier(p_block,COMPLETION_INDEX,identifier)) { + completion_base=expr->get_datatype(); + } - const CharType *c=ident.ptr(); - for(int i=0;i<l;i++) { + if (identifier==StringName()) { + _set_error("Expected identifier as member"); + return NULL; + } - switch(c[i]) { - case 'r': - case 'g': - case 'x': - case 'y': - break; - default: - ok=false; - break; + DataType dt = expr->get_datatype(); + String ident = identifier; + + bool ok=true; + DataType member_type; + switch(dt) { + case TYPE_BVEC2: + case TYPE_IVEC2: + case TYPE_UVEC2: + case TYPE_VEC2: { + + int l = ident.length(); + if (l==1) { + member_type=DataType(dt-1); + } else if (l==2) { + member_type=dt; + } else { + ok=false; + break; } - } - } break; - case TYPE_VEC3: { + const CharType *c=ident.ptr(); + for(int i=0;i<l;i++) { + + switch(c[i]) { + case 'r': + case 'g': + case 'x': + case 'y': + break; + default: + ok=false; + break; + } + } - int l = ident.length(); - if (l==1) { - member_type=TYPE_FLOAT; - } else if (l==2) { - member_type=TYPE_VEC2; - } else if (l==3) { - member_type=TYPE_VEC3; - } else { - ok=false; - break; - } + } break; + case TYPE_BVEC3: + case TYPE_IVEC3: + case TYPE_UVEC3: + case TYPE_VEC3: { + + int l = ident.length(); + if (l==1) { + member_type=DataType(dt-2); + } else if (l==2) { + member_type=DataType(dt-1); + } else if (l==3) { + member_type=dt; + } else { + ok=false; + break; + } - const CharType *c=ident.ptr(); - for(int i=0;i<l;i++) { + const CharType *c=ident.ptr(); + for(int i=0;i<l;i++) { + + switch(c[i]) { + case 'r': + case 'g': + case 'b': + case 'x': + case 'y': + case 'z': + break; + default: + ok=false; + break; + } + } - switch(c[i]) { - case 'r': - case 'g': - case 'b': - case 'x': - case 'y': - case 'z': - break; - default: - ok=false; - break; + } break; + case TYPE_BVEC4: + case TYPE_IVEC4: + case TYPE_UVEC4: + case TYPE_VEC4: { + + int l = ident.length(); + if (l==1) { + member_type=DataType(dt-3); + } else if (l==2) { + member_type=DataType(dt-2); + } else if (l==3) { + member_type=DataType(dt-1);; + } else if (l==4) { + member_type=dt; + } else { + ok=false; + break; } - } - } break; - case TYPE_VEC4: { + const CharType *c=ident.ptr(); + for(int i=0;i<l;i++) { + + switch(c[i]) { + case 'r': + case 'g': + case 'b': + case 'a': + case 'x': + case 'y': + case 'z': + case 'w': + break; + default: + ok=false; + break; + } + } - int l = ident.length(); - if (l==1) { - member_type=TYPE_FLOAT; - } else if (l==2) { - member_type=TYPE_VEC2; - } else if (l==3) { - member_type=TYPE_VEC3; - } else if (l==4) { - member_type=TYPE_VEC4; - } else { - ok=false; - break; - } + } break; + case TYPE_MAT2: ok=(ident=="x" || ident=="y"); member_type=TYPE_VEC2; break; + case TYPE_MAT3: ok=(ident=="x" || ident=="y" || ident=="z" ); member_type=TYPE_VEC3; break; + case TYPE_MAT4: ok=(ident=="x" || ident=="y" || ident=="z" || ident=="w"); member_type=TYPE_VEC4; break; + default: {} + } - const CharType *c=ident.ptr(); - for(int i=0;i<l;i++) { - - switch(c[i]) { - case 'r': - case 'g': - case 'b': - case 'a': - case 'x': - case 'y': - case 'z': - case 'w': - break; - default: - ok=false; - break; - } - } + if (!ok) { - } break; - case TYPE_MAT2: ok=(ident=="x" || ident=="y"); member_type=TYPE_VEC2; break; - case TYPE_MAT3: ok=(ident=="x" || ident=="y" || ident=="z" ); member_type=TYPE_VEC3; break; - case TYPE_MAT4: ok=(ident=="x" || ident=="y" || ident=="z" || ident=="w"); member_type=TYPE_VEC4; break; - default: {} - } + _set_error("Invalid member for expression: ."+ident); + return NULL; + } - if (!ok) { + MemberNode *mn = alloc_node<MemberNode>(); + mn->basetype=dt; + mn->datatype=member_type; + mn->name=ident; + mn->owner=expr; + expr=mn; - parser.set_error("Invalid member for expression: ."+ident); - return ERR_PARSE_ERROR; - } - MemberNode *mn = parser.create_node<MemberNode>(p_parent); - mn->basetype=dt; - mn->datatype=member_type; - mn->name=ident; - mn->owner=expr; - expr=mn; + //todo + //member (period) has priority over any operator + //creates a subindexing expression in place - parser.advance(2); - //todo - //member (period) has priority over any operator - //creates a subindexing expression in place + /*} else if (tk.type==TK_BRACKET_OPEN) { + //todo + //subindexing has priority over any operator + //creates a subindexing expression in place - } else if (parser.get_token_type()==TK_BRACKET_OPEN) { - //todo - //subindexing has priority over any operator - //creates a subindexing expression in place + */ + } else if (tk.type==TK_OP_INCREMENT || tk.type==TK_OP_DECREMENT) { + OperatorNode *op = alloc_node<OperatorNode>(); + op->op=tk.type==TK_OP_DECREMENT ? OP_POST_DECREMENT : OP_POST_INCREMENT; + op->arguments.push_back(expr); - } /*else if (parser.get_token_type()==TK_OP_PLUS_PLUS || parser.get_token_type()==TK_OP_MINUS_MINUS) { - //todo - //inc/dec operators have priority over any operator - //creates a subindexing expression in place - //return OK; //wtfs + if (!_validate_operator(op,&op->return_cache)) { + _set_error("Invalid base type for increment/decrement operator"); + return NULL; + } + expr=op; + } else { - } */ + _set_tkpos(pos); + break; + } + } Expression e; e.is_op=false; e.node=expr; expression.push_back(e); + pos = _get_tkpos(); + tk = _get_token(); - if (is_token_operator(parser.get_token_type())) { + if (is_token_operator(tk.type)) { Expression o; o.is_op=true; - o.op=parser.get_token_type(); + + switch(tk.type) { + + case TK_OP_EQUAL: o.op = OP_EQUAL; break; + case TK_OP_NOT_EQUAL: o.op = OP_NOT_EQUAL; break; + case TK_OP_LESS: o.op = OP_LESS; break; + case TK_OP_LESS_EQUAL: o.op = OP_LESS_EQUAL; break; + case TK_OP_GREATER: o.op = OP_GREATER; break; + case TK_OP_GREATER_EQUAL: o.op = OP_GREATER_EQUAL; break; + case TK_OP_AND: o.op = OP_AND; break; + case TK_OP_OR: o.op = OP_OR; break; + case TK_OP_ADD: o.op = OP_ADD; break; + case TK_OP_SUB: o.op = OP_SUB; break; + case TK_OP_MUL: o.op = OP_MUL; break; + case TK_OP_DIV: o.op = OP_DIV; break; + case TK_OP_MOD: o.op = OP_MOD; break; + case TK_OP_SHIFT_LEFT: o.op = OP_SHIFT_LEFT; break; + case TK_OP_SHIFT_RIGHT: o.op = OP_SHIFT_RIGHT; break; + case TK_OP_ASSIGN: o.op = OP_ASSIGN; break; + case TK_OP_ASSIGN_ADD: o.op = OP_ASSIGN_ADD; break; + case TK_OP_ASSIGN_SUB: o.op = OP_ASSIGN_SUB; break; + case TK_OP_ASSIGN_MUL: o.op = OP_ASSIGN_MUL; break; + case TK_OP_ASSIGN_DIV: o.op = OP_ASSIGN_DIV; break; + case TK_OP_ASSIGN_MOD: o.op = OP_ASSIGN_MOD; break; + case TK_OP_ASSIGN_SHIFT_LEFT: o.op = OP_ASSIGN_SHIFT_LEFT; break; + case TK_OP_ASSIGN_SHIFT_RIGHT: o.op = OP_ASSIGN_SHIFT_RIGHT; break; + case TK_OP_ASSIGN_BIT_AND: o.op = OP_ASSIGN_BIT_AND; break; + case TK_OP_ASSIGN_BIT_OR: o.op = OP_ASSIGN_BIT_OR; break; + case TK_OP_ASSIGN_BIT_XOR: o.op = OP_ASSIGN_BIT_XOR; break; + case TK_OP_BIT_AND: o.op = OP_BIT_AND; break; + case TK_OP_BIT_OR: o.op = OP_BIT_OR ; break; + case TK_OP_BIT_XOR: o.op = OP_BIT_XOR; break; + case TK_QUESTION: o.op = OP_SELECT_IF; break; + case TK_COLON: o.op = OP_SELECT_ELSE; break; + default: { + _set_error("Invalid token for operator: "+get_token_text(tk)); + return NULL; + } + } + expression.push_back(o); - parser.advance(); + } else { + _set_tkpos(pos); //something else, so rollback and end break; } } @@ -1948,6 +2703,7 @@ Error ShaderLanguage::parse_expression(Parser& parser,Node *p_parent,Node **r_ex int next_op=-1; int min_priority=0xFFFFF; bool is_unary=false; + bool is_ternary=false; for(int i=0;i<expression.size();i++) { @@ -1957,45 +2713,48 @@ Error ShaderLanguage::parse_expression(Parser& parser,Node *p_parent,Node **r_ex } bool unary=false; + bool ternary=false; int priority; switch(expression[i].op) { - - case TK_OP_NOT: priority=0; unary=true; break; - case TK_OP_NEG: priority=0; unary=true; break; - - case TK_OP_MUL: priority=1; break; - case TK_OP_DIV: priority=1; break; - - case TK_OP_ADD: priority=2; break; - case TK_OP_SUB: priority=2; break; - - // shift left/right =2 - - case TK_OP_LESS: priority=4; break; - case TK_OP_LESS_EQUAL: priority=4; break; - case TK_OP_GREATER: priority=4; break; - case TK_OP_GREATER_EQUAL: priority=4; break; - - case TK_OP_EQUAL: priority=5; break; - case TK_OP_NOT_EQUAL: priority=5; break; - - //bit and =5 - //bit xor =6 - //bit or=7 - - case TK_OP_AND: priority=8; break; - case TK_OP_OR: priority=9; break; - - // ?: = 10 - - case TK_OP_ASSIGN_ADD: priority=11; break; - case TK_OP_ASSIGN_SUB: priority=11; break; - case TK_OP_ASSIGN_MUL: priority=11; break; - case TK_OP_ASSIGN_DIV: priority=11; break; - case TK_OP_ASSIGN: priority=11; break; - - default: ERR_FAIL_V(ERR_BUG); //unexpected operator + case OP_EQUAL: priority=8; break; + case OP_NOT_EQUAL: priority=8; break; + case OP_LESS: priority=7; break; + case OP_LESS_EQUAL: priority=7; break; + case OP_GREATER: priority=7; break; + case OP_GREATER_EQUAL: priority=7; break; + case OP_AND: priority=12; break; + case OP_OR: priority=14; break; + case OP_NOT: priority=3; unary=true; break; + case OP_NEGATE: priority=3; unary=true; break; + case OP_ADD: priority=5; break; + case OP_SUB: priority=5; break; + case OP_MUL: priority=4; break; + case OP_DIV: priority=4; break; + case OP_MOD: priority=4; break; + case OP_SHIFT_LEFT: priority=6; break; + case OP_SHIFT_RIGHT: priority=6; break; + case OP_ASSIGN: priority=16; break; + case OP_ASSIGN_ADD: priority=16; break; + case OP_ASSIGN_SUB: priority=16; break; + case OP_ASSIGN_MUL: priority=16; break; + case OP_ASSIGN_DIV: priority=16; break; + case OP_ASSIGN_MOD: priority=16; break; + case OP_ASSIGN_SHIFT_LEFT: priority=16; break; + case OP_ASSIGN_SHIFT_RIGHT: priority=16; break; + case OP_ASSIGN_BIT_AND: priority=16; break; + case OP_ASSIGN_BIT_OR: priority=16; break; + case OP_ASSIGN_BIT_XOR: priority=16; break; + case OP_BIT_AND: priority=9; break; + case OP_BIT_OR: priority=11; break; + case OP_BIT_XOR: priority=10; break; + case OP_BIT_INVERT: priority=3; unary=true; break; + case OP_INCREMENT: priority=3; unary=true; break; + case OP_DECREMENT: priority=3; unary=true; break; + case OP_SELECT_IF: priority=15; ternary=true; break; + case OP_SELECT_ELSE: priority=15; ternary=true; break; + + default: ERR_FAIL_V(NULL); //unexpected operator } @@ -2005,11 +2764,12 @@ Error ShaderLanguage::parse_expression(Parser& parser,Node *p_parent,Node **r_ex next_op=i; min_priority=priority; is_unary=unary; + is_ternary=ternary; } } - ERR_FAIL_COND_V(next_op==-1,ERR_BUG); + ERR_FAIL_COND_V(next_op==-1,NULL); // OK! create operator.. // OK! create operator.. @@ -2021,48 +2781,90 @@ Error ShaderLanguage::parse_expression(Parser& parser,Node *p_parent,Node **r_ex expr_pos++; if (expr_pos==expression.size()) { //can happen.. - parser.set_error("Unexpected end of expression.."); - return ERR_BUG; + _set_error("Unexpected end of expression.."); + return NULL; } } //consecutively do unary opeators for(int i=expr_pos-1;i>=next_op;i--) { - OperatorNode *op = parser.create_node<OperatorNode>(p_parent); - op->op=get_token_operator(expression[i].op); + OperatorNode *op = alloc_node<OperatorNode>(); + op->op=expression[i].op; op->arguments.push_back(expression[i+1].node); expression[i].is_op=false; - expression[i].node=validate_operator(parser,op); - if (!expression[i].node) { + expression[i].node=op; + + + if (!_validate_operator(op,&op->return_cache)) { String at; for(int i=0;i<op->arguments.size();i++) { if (i>0) at+=" and "; - at+=get_datatype_name(compute_node_type(op->arguments[i])); + at+=get_datatype_name(op->arguments[i]->get_datatype()); } - parser.set_error("Invalid argument to unary operator "+String(token_names[op->op])+": "+at); - return ERR_PARSE_ERROR; + _set_error("Invalid arguments to unary operator '"+get_operator_text(op->op)+"' :" +at); + return NULL; } expression.remove(i+1); } + + } else if (is_ternary) { + + if (next_op <1 || next_op>=(expression.size()-1)) { + _set_error("Parser bug.."); + ERR_FAIL_V(NULL); + } + + if (next_op+2 >= expression.size() || !expression[next_op+2].is_op || expression[next_op+2].op!=OP_SELECT_ELSE) { + _set_error("Mising matching ':' for select operator"); + return NULL; + } + + + + OperatorNode *op = alloc_node<OperatorNode>(); + op->op=expression[next_op].op; + op->arguments.push_back(expression[next_op-1].node); + op->arguments.push_back(expression[next_op+1].node); + op->arguments.push_back(expression[next_op+3].node); + + expression[next_op-1].is_op=false; + expression[next_op-1].node=op; + if (!_validate_operator(op,&op->return_cache)) { + + String at; + for(int i=0;i<op->arguments.size();i++) { + if (i>0) + at+=" and "; + at+=get_datatype_name(op->arguments[i]->get_datatype()); + + } + _set_error("Invalid argument to ternary ?: operator: "+at); + return NULL; + } + + for(int i=0;i<4;i++) { + expression.remove(next_op); + } + } else { if (next_op <1 || next_op>=(expression.size()-1)) { - parser.set_error("Parser bug.."); - ERR_FAIL_V(ERR_BUG); + _set_error("Parser bug.."); + ERR_FAIL_V(NULL); } - OperatorNode *op = parser.create_node<OperatorNode>(p_parent); - op->op=get_token_operator(expression[next_op].op); + OperatorNode *op = alloc_node<OperatorNode>(); + op->op=expression[next_op].op; if (expression[next_op-1].is_op) { - parser.set_error("Parser bug.."); - ERR_FAIL_V(ERR_BUG); + _set_error("Parser bug.."); + ERR_FAIL_V(NULL); } if (expression[next_op+1].is_op) { @@ -2071,645 +2873,1032 @@ Error ShaderLanguage::parse_expression(Parser& parser,Node *p_parent,Node **r_ex // can be followed by an unary op in a valid combination, // due to how precedence works, unaries will always dissapear first - parser.set_error("Parser bug.."); + _set_error("Parser bug.."); } op->arguments.push_back(expression[next_op-1].node); //expression goes as left op->arguments.push_back(expression[next_op+1].node); //next expression goes as right + expression[next_op-1].node=op; //replace all 3 nodes by this operator and make it an expression - expression[next_op-1].node=validate_operator(parser,op); - if (!expression[next_op-1].node) { + + if (!_validate_operator(op,&op->return_cache)) { String at; for(int i=0;i<op->arguments.size();i++) { if (i>0) at+=" and "; - at+=get_datatype_name(compute_node_type(op->arguments[i])); + at+=get_datatype_name(op->arguments[i]->get_datatype()); } - static const char *op_names[OP_MAX]={"=","+","-","*","/","+=","-=","*=","/=","-","!","==","!=","<=",">=","<",">","||","&&","call","()"}; - - parser.set_error("Invalid arguments to operator "+String(op_names[op->op])+": "+at); - return ERR_PARSE_ERROR; + _set_error("Invalid arguments to operator '"+get_operator_text(op->op)+"' :" +at); + return NULL; } + expression.remove(next_op); expression.remove(next_op); } -#if 0 - OperatorNode *op = parser.create_node<OperatorNode>(p_parent); - op->op=get_token_operator(operators[next_op]); + } + + return expression[0].node; +} + + +ShaderLanguage::Node* ShaderLanguage::_reduce_expression(BlockNode *p_block, ShaderLanguage::Node *p_node) { + + if (p_node->type!=Node::TYPE_OPERATOR) + return p_node; + + //for now only reduce simple constructors + OperatorNode *op=static_cast<OperatorNode*>(p_node); + + if (op->op==OP_CONSTRUCT) { + + + ERR_FAIL_COND_V(op->arguments[0]->type!=Node::TYPE_VARIABLE,p_node); + VariableNode *vn = static_cast<VariableNode*>(op->arguments[0]); + // StringName name=vn->name; + + DataType base=get_scalar_type(op->get_datatype()); - op->arguments.push_back(expressions[next_op]); //expression goes as left - op->arguments.push_back(expressions[next_op+1]); //next expression goes as right + Vector<ConstantNode::Value> values; - expressions[next_op]=validate_operator(parser,op); - if (!expressions[next_op]) { - String at; - for(int i=0;i<op->arguments.size();i++) { - if (i>0) - at+=" and "; - at+=get_datatype_name(compute_node_type(op->arguments[i])); + for(int i=1;i<op->arguments.size();i++) { + + op->arguments[i]=_reduce_expression(p_block,op->arguments[i]); + if (op->arguments[i]->type==Node::TYPE_CONSTANT) { + ConstantNode *cn = static_cast<ConstantNode*>(op->arguments[i]); + + if (get_scalar_type(cn->datatype)==base) { + + for(int j=0;j<cn->values.size();j++) { + values.push_back(cn->values[j]); + } + } else if (get_scalar_type(cn->datatype)==cn->datatype) { + + ConstantNode::Value v; + if (!convert_constant(cn,base,&v)) { + return p_node; + } + values.push_back(v); + } else { + return p_node; + } + + } else { + return p_node; } - parser.set_error("Invalid arguments to operator "+String(token_names[operators[next_op]])+": "+at); - return ERR_PARSE_ERROR; } - expressions.remove(next_op+1); - operators.remove(next_op); -#endif + ConstantNode *cn=alloc_node<ConstantNode>(); + cn->datatype=op->get_datatype(); + cn->values=values; + return cn; + } else if (op->op==OP_NEGATE) { - } + op->arguments[0]=_reduce_expression(p_block,op->arguments[0]); + if (op->arguments[0]->type==Node::TYPE_CONSTANT) { - *r_expr=expression[0].node; + ConstantNode *cn = static_cast<ConstantNode*>(op->arguments[0]); - return OK; + DataType base=get_scalar_type(cn->datatype); -/* - TokenType token_type=parser.get_token_type(); - OperatorNode *op = parser.create_node<OperatorNode>(p_parent); - op->op=get_token_operator(parser.get_token_type()); + Vector<ConstantNode::Value> values; - op->arguments.push_back(*r_expr); //expression goes as left - parser.advance(); - Node *right_expr=NULL; - Error err = parse_expression(parser,p_parent,&right_expr); - if (err) - return err; - op->arguments.push_back(right_expr); + for(int i=0;i<cn->values.size();i++) { - if (!validate_operator(op)) { + ConstantNode::Value nv; + switch(base) { + case TYPE_BOOL: { + nv.boolean=!cn->values[i].boolean; + } break; + case TYPE_INT: { + nv.sint=-cn->values[i].sint; + } break; + case TYPE_UINT: { + nv.uint=-cn->values[i].uint; + } break; + case TYPE_FLOAT: { + nv.real=-cn->values[i].real; + } break; + default: {} + } - parser.set_error("Invalid arguments to operator "+String(token_names[token_type])); - return ERR_PARSE_ERROR; + values.push_back(nv); } -*/ + + cn->values=values; + return cn; + } + } + + return p_node; + } -Error ShaderLanguage::parse_variable_declaration(Parser& parser,BlockNode *p_block) { - bool uniform = parser.get_token(-1).type==TK_UNIFORM; +ShaderLanguage::Node* ShaderLanguage::_parse_and_reduce_expression(BlockNode *p_block, const Map<StringName,DataType> &p_builtin_types) { - DataType type=get_token_datatype(parser.get_token_type(0)); - bool iscolor = parser.get_token_type(0)==TK_TYPE_COLOR; - if (type==TYPE_VOID) { + ShaderLanguage::Node* expr = _parse_expression(p_block,p_builtin_types); + if (!expr) //errored + return NULL; - parser.set_error("Cannot Declare a 'void' Variable"); - return ERR_PARSE_ERROR; - } + expr = _reduce_expression(p_block,expr); - if (type==TYPE_TEXTURE && !uniform) { + return expr; +} - parser.set_error("Cannot Declare a Non-Uniform Texture"); - return ERR_PARSE_ERROR; - } - if (type==TYPE_CUBEMAP && !uniform) { - parser.set_error("Cannot Declare a Non-Uniform Cubemap"); - return ERR_PARSE_ERROR; - } - parser.advance(); - int found=0; +Error ShaderLanguage::_parse_block(BlockNode* p_block,const Map<StringName,DataType> &p_builtin_types,bool p_just_one,bool p_can_break,bool p_can_continue) { while(true) { + TkPos pos = _get_tkpos(); - if (found && parser.get_token_type()!=TK_COMMA) { - break; - } + Token tk = _get_token(); + if (tk.type==TK_CURLY_BRACKET_CLOSE) { //end of block + if (p_just_one) { + _set_error("Unexpected '}'"); + return ERR_PARSE_ERROR; + } - if (parser.get_token_type()!=TK_INDENTIFIER) { + return OK; - parser.set_error("Identifier Expected"); - return ERR_PARSE_ERROR; + } else if (is_token_precision(tk.type) || is_token_nonvoid_datatype(tk.type)) { + DataPrecision precision=PRECISION_DEFAULT; + if (is_token_precision(tk.type)) { + precision=get_token_precision(tk.type); + tk = _get_token(); + if (!is_token_nonvoid_datatype(tk.type)) { + _set_error("Expected datatype after precission"); + return ERR_PARSE_ERROR; + } + } - } + DataType type = get_token_datatype(tk.type); - StringName name = parser.get_token().text; + tk = _get_token(); - if (test_existing_identifier(p_block,name)) { - parser.set_error("Duplicate Identifier (existing variable/function): "+name); - return ERR_PARSE_ERROR; - } + while(true) { - found=true; + if (tk.type!=TK_IDENTIFIER) { + _set_error("Expected identifier after type"); + return ERR_PARSE_ERROR; + } - parser.advance(); - //see if declaration has an initializer - if (parser.get_token_type()==TK_OP_ASSIGN) { - parser.advance(); - OperatorNode * op = parser.create_node<OperatorNode>(p_block); - VariableNode * var = parser.create_node<VariableNode>(op); - var->name=name; - var->datatype_cache=type; - var->uniform=uniform; - Node *expr; - Error err = parse_expression(parser,p_block,&expr); + StringName name = tk.text; + if (_find_identifier(p_block,p_builtin_types,name)) { + _set_error("Redefinition of '"+String(name)+"'"); + return ERR_PARSE_ERROR; + } - if (err) - return err; + BlockNode::Variable var; + var.type=type; + var.precision=precision; + var.line=tk_line; + p_block->variables[name]=var; - if (var->uniform) { + tk = _get_token(); - if (expr->type!=Node::TYPE_CONSTANT) { + if (tk.type==TK_OP_ASSIGN) { + //variable creted with assignment! must parse an expression + Node* n = _parse_and_reduce_expression(p_block,p_builtin_types); + if (!n) + return ERR_PARSE_ERROR; - parser.set_error("Uniform can only be initialized to a constant."); - return ERR_PARSE_ERROR; + OperatorNode *assign = alloc_node<OperatorNode>(); + VariableNode *vnode = alloc_node<VariableNode>(); + vnode->name=name; + vnode->datatype_cache=type; + assign->arguments.push_back(vnode); + assign->arguments.push_back(n); + assign->op=OP_ASSIGN; + p_block->statements.push_back(assign); + tk = _get_token(); } - Uniform u; - u.order=parser.program->uniforms.size(); - u.type=type; - u.default_value=static_cast<ConstantNode*>(expr)->value; - if (iscolor && u.default_value.get_type()==Variant::PLANE) { - Color c; - Plane p = u.default_value; - c=Color(p.normal.x,p.normal.y,p.normal.z,p.d); - u.default_value=c; - } - parser.program->uniforms[var->name]=u; - } else { - op->op=OP_ASSIGN; - op->arguments.push_back(var); - op->arguments.push_back(expr); - Node *n=validate_operator(parser,op); - if (!n) { - parser.set_error("Invalid initializer for variable: "+name); + if (tk.type==TK_COMMA) { + tk = _get_token(); + //another variable + } else if (tk.type==TK_SEMICOLON) { + break; + } else { + _set_error("Expected ',' or ';' after variable"); return ERR_PARSE_ERROR; } - p_block->statements.push_back(n); + } + } else if (tk.type==TK_CURLY_BRACKET_OPEN) { + //a sub block, just because.. + BlockNode* block = alloc_node<BlockNode>(); + block->parent_block=p_block; + _parse_block(block,p_builtin_types,false,p_can_break,p_can_continue); + p_block->statements.push_back(block); + } else if (tk.type==TK_CF_IF) { + //if () {} + tk = _get_token(); + if (tk.type!=TK_PARENTHESIS_OPEN) { + _set_error("Expected '(' after if"); + return ERR_PARSE_ERROR; } - } else { - //initialize it EMPTY - - OperatorNode * op = parser.create_node<OperatorNode>(p_block); - VariableNode * var = parser.create_node<VariableNode>(op); - ConstantNode * con = parser.create_node<ConstantNode>(op); - - var->name=name; - var->datatype_cache=type; - var->uniform=uniform; - con->datatype=type; - - switch(type) { - case TYPE_BOOL: con->value=false; break; - case TYPE_FLOAT: con->value=0.0; break; - case TYPE_VEC2: con->value=Vector2(); break; - case TYPE_VEC3: con->value=Vector3(); break; - case TYPE_VEC4: con->value=iscolor?Variant(Color()):Variant(Plane()); break; - case TYPE_MAT2: con->value=Matrix32(); break; - case TYPE_MAT3: con->value=Matrix3(); break; - case TYPE_MAT4: con->value=Transform(); break; - case TYPE_TEXTURE: - case TYPE_CUBEMAP: con->value=RID(); break; - default: {} + ControlFlowNode *cf = alloc_node<ControlFlowNode>(); + cf->flow_op=FLOW_OP_IF; + Node* n = _parse_and_reduce_expression(p_block,p_builtin_types); + if (!n) + return ERR_PARSE_ERROR; + + tk = _get_token(); + if (tk.type!=TK_PARENTHESIS_CLOSE) { + _set_error("Expected '(' after expression"); + return ERR_PARSE_ERROR; } - if (uniform) { - Uniform u; - u.type=type; - u.default_value=con->value; - u.order=parser.program->uniforms.size(); - parser.program->uniforms[var->name]=u; + BlockNode* block = alloc_node<BlockNode>(); + block->parent_block=p_block; + cf->expressions.push_back(n); + cf->blocks.push_back(block); + p_block->statements.push_back(cf); + + + Error err=_parse_block(block,p_builtin_types,true,p_can_break,p_can_continue); + + pos=_get_tkpos(); + tk = _get_token(); + if (tk.type==TK_CF_ELSE) { + + block = alloc_node<BlockNode>(); + block->parent_block=p_block; + cf->blocks.push_back(block); + err=_parse_block(block,p_builtin_types,true,p_can_break,p_can_continue); } else { - op->op=OP_ASSIGN; - op->arguments.push_back(var); - op->arguments.push_back(con); - p_block->statements.push_back(op); + _set_tkpos(pos); //rollback } - } + } else { - if (!uniform) - p_block->variables[name]=type; + //nothng else, so expression + _set_tkpos(pos); //rollback + Node*expr = _parse_and_reduce_expression(p_block,p_builtin_types); + if (!expr) + return ERR_PARSE_ERROR; + p_block->statements.push_back(expr); + tk = _get_token(); - } + if (tk.type!=TK_SEMICOLON) { + _set_error("Expected ';' after statement"); + return ERR_PARSE_ERROR; + } + } - if (parser.get_token_type()!=TK_SEMICOLON) { - parser.set_error("Expected ';'"); - return ERR_PARSE_ERROR; + if (p_just_one) + break; } - return OK; - } -Error ShaderLanguage::parse_flow_if(Parser& parser,Node *p_parent,Node **r_statement) { - ControlFlowNode *cf = parser.create_node<ControlFlowNode>(p_parent); +Error ShaderLanguage::_parse_shader(const Map< StringName, Map<StringName,DataType> > &p_functions, const Set<String> &p_render_modes) { - cf->flow_op=FLOW_OP_IF; - parser.advance(); + Token tk = _get_token(); - if (parser.get_token_type()!=TK_PARENTHESIS_OPEN) { - parser.set_error("Expected '(' after 'if'"); - return ERR_PARSE_ERROR; - } - parser.advance(); + int texture_uniforms = 0; + int uniforms =0; - Node *expression=NULL; - Error err = parse_expression(parser,cf,&expression); - if (err) - return err; + while(tk.type!=TK_EOF) { - if (compute_node_type(expression)!=TYPE_BOOL) { + switch(tk.type) { + case TK_RENDER_MODE: { - parser.set_error("Expression for 'if' is not boolean"); - return ERR_PARSE_ERROR; - } + while(true) { - cf->statements.push_back(expression); + StringName mode; + _get_completable_identifier(NULL,COMPLETION_RENDER_MODE,mode); - if (parser.get_token_type()!=TK_PARENTHESIS_CLOSE) { - parser.set_error("Expected ')' after expression"); - return ERR_PARSE_ERROR; - } + if (mode==StringName()) { + _set_error("Expected identifier for render mode"); + return ERR_PARSE_ERROR; + } - parser.advance(); + if (!p_render_modes.has(mode)) { + _set_error("Invalid render mode: '"+String(mode)+"'"); + return ERR_PARSE_ERROR; + } - if (parser.get_token_type()!=TK_CURLY_BRACKET_OPEN) { - parser.set_error("Expected statement block after 'if()'"); - return ERR_PARSE_ERROR; - } + if (shader->render_modes.find(mode)!=-1) { + _set_error("Duplicate render mode: '"+String(mode)+"'"); + return ERR_PARSE_ERROR; + } - Node *substatement=NULL; - err = parse_statement(parser,cf,&substatement); - if (err) - return err; + shader->render_modes.push_back(mode); - cf->statements.push_back(substatement); + tk = _get_token(); + if (tk.type==TK_COMMA) { + //all good, do nothing + } else if (tk.type==TK_SEMICOLON) { + break; //done + } else { + _set_error("Unexpected token: "+get_token_text(tk)); + return ERR_PARSE_ERROR; + } + } + } break; + case TK_UNIFORM: + case TK_VARYING: { + + bool uniform = tk.type==TK_UNIFORM; + DataPrecision precision = PRECISION_DEFAULT; + DataType type; + StringName name; + + tk = _get_token(); + if (is_token_precision(tk.type)) { + precision=get_token_precision(tk.type); + tk = _get_token(); + } - if (parser.get_token_type()==TK_CF_ELSE) { + if (!is_token_datatype(tk.type)) { + _set_error("Expected datatype. "); + return ERR_PARSE_ERROR; + } - parser.advance(); + type = get_token_datatype(tk.type); - if (parser.get_token_type()!=TK_CURLY_BRACKET_OPEN) { - parser.set_error("Expected statement block after 'else'"); - return ERR_PARSE_ERROR; - } + if (type==TYPE_VOID) { + _set_error("void datatype not allowed here"); + return ERR_PARSE_ERROR; + } + if (!uniform && type<TYPE_FLOAT && type>TYPE_VEC4) { + _set_error("Invalid type for varying, only float,vec2,vec3,vec4 allowed."); + return ERR_PARSE_ERROR; + } - substatement=NULL; - err = parse_statement(parser,cf,&substatement); - if (err) - return err; + tk = _get_token(); + if (tk.type!=TK_IDENTIFIER) { + _set_error("Expected identifier!"); + return ERR_PARSE_ERROR; + } - cf->statements.push_back(substatement); - } + name=tk.text; + if (_find_identifier(NULL,Map<StringName,DataType>(),name)) { + _set_error("Redefinition of '"+String(name)+"'"); + return ERR_PARSE_ERROR; + } + if (uniform) { - *r_statement=cf; + ShaderNode::Uniform uniform; - return OK; -} + if (is_sampler_type(type)) { + uniform.texture_order=texture_uniforms++; + uniform.order=-1; + } else { + uniform.texture_order=-1; + uniform.order=uniforms++; + } + uniform.type=type; + uniform.precission=precision; -Error ShaderLanguage::parse_flow_return(Parser& parser,Node *p_parent,Node **r_statement) { + //todo parse default value + tk = _get_token(); + if (tk.type==TK_OP_ASSIGN) { - FunctionNode *function=NULL; + Node* expr = _parse_and_reduce_expression(NULL,Map<StringName,DataType>()); + if (!expr) + return ERR_PARSE_ERROR; + if (expr->type!=Node::TYPE_CONSTANT) { + _set_error("Expected constant expression after '='"); + return ERR_PARSE_ERROR; + } - Node *parent=p_parent; + ConstantNode* cn = static_cast<ConstantNode*>(expr); - while(parent) { + uniform.default_value.resize(cn->values.size()); - if (parent->type==Node::TYPE_FUNCTION) { + if (!convert_constant(cn,uniform.type,uniform.default_value.ptr())) { + _set_error("Can't convert constant to "+get_datatype_name(uniform.type)); + return ERR_PARSE_ERROR; + } + tk = _get_token(); + } - function=(FunctionNode*)parent; - break; - } + if (tk.type==TK_COLON) { + //hint + + tk = _get_token(); + if (tk.type==TK_HINT_WHITE_TEXTURE) { + uniform.hint=ShaderNode::Uniform::HINT_WHITE; + } else if (tk.type==TK_HINT_BLACK_TEXTURE) { + uniform.hint=ShaderNode::Uniform::HINT_BLACK; + } else if (tk.type==TK_HINT_NORMAL_TEXTURE) { + uniform.hint=ShaderNode::Uniform::HINT_NORMAL; + } else if (tk.type==TK_HINT_ANISO_TEXTURE) { + uniform.hint=ShaderNode::Uniform::HINT_ANISO; + } else if (tk.type==TK_HINT_ALBEDO_TEXTURE) { + uniform.hint=ShaderNode::Uniform::HINT_ALBEDO; + } else if (tk.type==TK_HINT_BLACK_ALBEDO_TEXTURE) { + uniform.hint=ShaderNode::Uniform::HINT_BLACK_ALBEDO; + } else if (tk.type==TK_HINT_COLOR) { + if (type!=TYPE_VEC4) { + _set_error("Color hint is for vec4 only"); + return ERR_PARSE_ERROR; + } + uniform.hint=ShaderNode::Uniform::HINT_COLOR; + } else if (tk.type==TK_HINT_RANGE) { + + uniform.hint=ShaderNode::Uniform::HINT_RANGE; + if (type!=TYPE_FLOAT && type!=TYPE_INT) { + _set_error("Range hint is for float and int only"); + return ERR_PARSE_ERROR; + } + + tk = _get_token(); + if (tk.type!=TK_PARENTHESIS_OPEN) { + _set_error("Expected '(' after hint_range"); + return ERR_PARSE_ERROR; + } + + tk = _get_token(); + + float sign=1.0; + + if (tk.type==TK_OP_SUB) { + sign=-1.0; + tk = _get_token(); + } + + if (tk.type!=TK_REAL_CONSTANT && tk.type!=TK_INT_CONSTANT) { + _set_error("Expected integer constant"); + return ERR_PARSE_ERROR; + } + + uniform.hint_range[0]=tk.constant; + uniform.hint_range[0]*=sign; + + tk = _get_token(); + + if (tk.type!=TK_COMMA) { + _set_error("Expected ',' after integer constant"); + return ERR_PARSE_ERROR; + } + + tk = _get_token(); + + sign=1.0; + + if (tk.type==TK_OP_SUB) { + sign=-1.0; + tk = _get_token(); + } + + + if (tk.type!=TK_REAL_CONSTANT && tk.type!=TK_INT_CONSTANT) { + _set_error("Expected integer constant after ','"); + return ERR_PARSE_ERROR; + } + + uniform.hint_range[1]=tk.constant; + uniform.hint_range[1]*=sign; + + tk = _get_token(); + + if (tk.type==TK_COMMA) { + tk = _get_token(); + + if (tk.type!=TK_REAL_CONSTANT && tk.type!=TK_INT_CONSTANT) { + _set_error("Expected integer constant after ','"); + return ERR_PARSE_ERROR; + } + + uniform.hint_range[2]=tk.constant; + tk = _get_token(); + } else { + if (type==TYPE_INT) { + uniform.hint_range[2]=1; + } else { + uniform.hint_range[2]=0.001; + } + } + + if (tk.type!=TK_PARENTHESIS_CLOSE) { + _set_error("Expected ','"); + return ERR_PARSE_ERROR; + } + + + } else { + _set_error("Expected valid type hint after ':'."); + } - parent=parent->parent; - } + if (uniform.hint!=ShaderNode::Uniform::HINT_RANGE && uniform.hint!=ShaderNode::Uniform::HINT_NONE && uniform.hint!=ShaderNode::Uniform::HINT_COLOR && type <=TYPE_MAT4) { + _set_error("This hint is only for sampler types"); + return ERR_PARSE_ERROR; - if (!function) { + } - parser.set_error("'return' must be inside a function"); - return ERR_PARSE_ERROR; - } + tk = _get_token(); + } - ControlFlowNode *cf = parser.create_node<ControlFlowNode>(p_parent); + shader->uniforms[name]=uniform; - cf->flow_op=FLOW_OP_RETURN; + if (tk.type!=TK_SEMICOLON) { + _set_error("Expected ';'"); + return ERR_PARSE_ERROR; + } + } else { - parser.advance(); + ShaderNode::Varying varying; + varying.type=type; + varying.precission=precision; + shader->varyings[name]=varying; - if (function->return_type!=TYPE_VOID) { - // should expect a return expression. + tk = _get_token(); + if (tk.type!=TK_SEMICOLON) { + _set_error("Expected ';'"); + return ERR_PARSE_ERROR; + } - Node *expr=NULL; - Error err = parse_expression(parser,cf,&expr); - if (err) - return err; + } - if (compute_node_type(expr)!=function->return_type) { - parser.set_error("Invalid type for 'return' expression"); - return ERR_PARSE_ERROR; - } - cf->statements.push_back(expr); - } - *r_statement=cf; + } break; + default: { + //function - if (parser.get_token_type()!=TK_SEMICOLON) { - parser.set_error("Expected ';'"); - return ERR_PARSE_ERROR; - } + DataPrecision precision = PRECISION_DEFAULT; + DataType type; + StringName name; - return OK; -} + if (is_token_precision(tk.type)) { + precision=get_token_precision(tk.type); + tk = _get_token(); + } -Error ShaderLanguage::parse_statement(Parser& parser,Node *p_parent,Node **r_statement) { + if (!is_token_datatype(tk.type)) { + _set_error("Expected funtion, uniform or varying "); + return ERR_PARSE_ERROR; + } - *r_statement=NULL; + type = get_token_datatype(tk.type); - TokenType token_type = parser.get_token_type(); + _get_completable_identifier(NULL,COMPLETION_MAIN_FUNCTION,name); - if (token_type==TK_CURLY_BRACKET_OPEN) { - //sub-block - parser.advance(); - BlockNode *block = parser.create_node<BlockNode>(p_parent); + if (name==StringName()) { + _set_error("Expected function name after datatype"); + return ERR_PARSE_ERROR; - *r_statement=block; - return parse_block(parser,block); - } else if (token_type==TK_SEMICOLON) { - // empty ; - parser.advance(); - return OK; - } else if (token_type==TK_CF_IF) { - return parse_flow_if(parser,p_parent,r_statement); + } - } else if (token_type==TK_CF_RETURN) { - return parse_flow_return(parser,p_parent,r_statement); - } else { - Error err=parse_expression(parser,p_parent,r_statement); - if (err) - return err; + if (_find_identifier(NULL,Map<StringName,DataType>(),name)) { + _set_error("Redefinition of '"+String(name)+"'"); + return ERR_PARSE_ERROR; + } - if (parser.get_token_type()!=TK_SEMICOLON) { - parser.set_error("Expected ';'"); - return ERR_PARSE_ERROR; - } + tk = _get_token(); + if (tk.type!=TK_PARENTHESIS_OPEN) { + _set_error("Expected '(' after identifier"); + return ERR_PARSE_ERROR; - } + } - return OK; -} -Error ShaderLanguage::parse_block(Parser& parser,BlockNode *p_block) { + Map<StringName,DataType> builtin_types; + if (p_functions.has(name)) { + builtin_types=p_functions[name]; + } - while(true) { + ShaderNode::Function function; - if (parser.is_at_end()) { - if (p_block->parent->type!=Node::TYPE_PROGRAM) { - parser.set_error("Unexpected End of File"); - return ERR_PARSE_ERROR; - } - return OK; //bye - } + function.callable=!p_functions.has(name); + function.name=name; - TokenType token_type = parser.get_token_type(); + FunctionNode* func_node=alloc_node<FunctionNode>(); - if (token_type==TK_CURLY_BRACKET_CLOSE) { - if (p_block->parent->type==Node::TYPE_PROGRAM) { - parser.set_error("Unexpected '}'"); - return ERR_PARSE_ERROR; - } - parser.advance(); - return OK; // exit block + function.function=func_node; - } else if (token_type==TK_UNIFORM) { + shader->functions.push_back(function); - if (p_block!=parser.program->body) { + func_node->name=name; + func_node->return_type=type; + func_node->return_precision=precision; - parser.set_error("Uniform only allowed in main program body."); - return ERR_PARSE_ERROR; - } - parser.advance(); - Error err=parse_variable_declaration(parser,p_block); - if (err) - return err; + func_node->body = alloc_node<BlockNode>(); + func_node->body->parent_function=func_node; - } else if (is_token_datatype(token_type)) { - Error err=OK; - if (parser_is_at_function(parser)) - err = parse_function(parser,p_block); - else { - err = parse_variable_declaration(parser,p_block); - } + tk = _get_token(); - if (err) - return err; + while(true) { + if (tk.type==TK_PARENTHESIS_CLOSE) { + break; + } - } else { - // must be a statement - Node *statement=NULL; + DataType ptype; + StringName pname; + DataPrecision pprecision = PRECISION_DEFAULT; - Error err = parse_statement(parser,p_block,&statement); - if (err) - return err; - if (statement) { - p_block->statements.push_back(statement); - } + if (is_token_precision(tk.type)) { + pprecision=get_token_precision(tk.type); + tk = _get_token(); + } + + if (!is_token_datatype(tk.type)) { + _set_error("Expected a valid datatype for argument"); + return ERR_PARSE_ERROR; + } + + ptype=get_token_datatype(tk.type); + + if (ptype==TYPE_VOID) { + _set_error("void not allowed in argument"); + return ERR_PARSE_ERROR; + } + + tk = _get_token(); + + if (tk.type!=TK_IDENTIFIER) { + _set_error("Expected identifier for argument name"); + return ERR_PARSE_ERROR; + } + + pname = tk.text; + + if (_find_identifier(func_node->body,builtin_types,pname)) { + _set_error("Redefinition of '"+String(pname)+"'"); + return ERR_PARSE_ERROR; + } + FunctionNode::Argument arg; + arg.type=ptype; + arg.name=pname; + arg.precision=pprecision; + + func_node->arguments.push_back(arg); + + tk = _get_token(); + + + if (tk.type==TK_COMMA) { + tk = _get_token(); + //do none and go on + } else if (tk.type!=TK_PARENTHESIS_CLOSE) { + _set_error("Expected ',' or ')' after identifier"); + return ERR_PARSE_ERROR; + } + + } + + if (p_functions.has(name)) { + //if one of the core functions, make sure they are of the correct form + if (func_node->arguments.size() > 0) { + _set_error("Function '"+String(name)+"' expects no arguments."); + return ERR_PARSE_ERROR; + } + if (func_node->return_type!=TYPE_VOID) { + _set_error("Function '"+String(name)+"' must be of void return type."); + return ERR_PARSE_ERROR; + } + } + + + //all good let's parse inside the fucntion! + tk = _get_token(); + if (tk.type!=TK_CURLY_BRACKET_OPEN) { + _set_error("Expected '{' to begin function"); + return ERR_PARSE_ERROR; + } + + current_function = name; + + Error err = _parse_block(func_node->body,builtin_types); + if (err) + return err; + current_function=StringName(); + } } + + tk = _get_token(); } return OK; } +Error ShaderLanguage::compile(const String& p_code, const Map< StringName, Map<StringName,DataType> > &p_functions, const Set<String> &p_render_modes) { + clear(); -Error ShaderLanguage::parse(const Vector<Token>& p_tokens,ShaderType p_type,CompileFunc p_compile_func,void *p_userdata,String *r_error,int *r_err_line,int *r_err_column) { + code=p_code; + nodes=NULL; - Parser parser(p_tokens); - parser.program = parser.create_node<ProgramNode>(NULL); - parser.program->body = parser.create_node<BlockNode>(parser.program); + shader = alloc_node<ShaderNode>(); + Error err = _parse_shader(p_functions,p_render_modes); + if (err!=OK) { + return err; + } + return OK; +} - //add builtins - switch(p_type) { - case SHADER_MATERIAL_VERTEX: { - int idx=0; - while (vertex_builtins_defs[idx].name) { - parser.program->builtin_variables[vertex_builtins_defs[idx].name]=vertex_builtins_defs[idx].type; - idx++; - } +Error ShaderLanguage::complete(const String& p_code,const Map< StringName, Map<StringName,DataType> > &p_functions,const Set<String>& p_render_modes,List<String>* r_options,String& r_call_hint) { + + clear(); + + code=p_code; + + nodes=NULL; + + shader = alloc_node<ShaderNode>(); + Error err = _parse_shader(p_functions,p_render_modes); + + switch(completion_type) { + + case COMPLETION_NONE: { + //do none + return ERR_PARSE_ERROR; } break; - case SHADER_MATERIAL_FRAGMENT: { - int idx=0; - while (fragment_builtins_defs[idx].name) { - parser.program->builtin_variables[fragment_builtins_defs[idx].name]=fragment_builtins_defs[idx].type; - idx++; + case COMPLETION_RENDER_MODE: { + for(const Set<String>::Element *E=p_render_modes.front();E;E=E->next()) { + + r_options->push_back(E->get()); } + + return OK; } break; - case SHADER_MATERIAL_LIGHT: { - int idx=0; - while (light_builtins_defs[idx].name) { - parser.program->builtin_variables[light_builtins_defs[idx].name]=light_builtins_defs[idx].type; - idx++; + case COMPLETION_MAIN_FUNCTION: { + + for(const Map< StringName, Map<StringName,DataType> >::Element *E=p_functions.front();E;E=E->next()) { + + r_options->push_back(E->key()); } + + return OK; } break; - case SHADER_CANVAS_ITEM_VERTEX: { - int idx=0; - while (ci_vertex_builtins_defs[idx].name) { - parser.program->builtin_variables[ci_vertex_builtins_defs[idx].name]=ci_vertex_builtins_defs[idx].type; - idx++; + case COMPLETION_IDENTIFIER: + case COMPLETION_FUNCTION_CALL: { + + bool comp_ident=completion_type==COMPLETION_IDENTIFIER; + Set<String> matches; + + StringName skip_function; + + BlockNode *block=completion_block; + + + while(block) { + + if (comp_ident) { + for (const Map<StringName,BlockNode::Variable>::Element *E=block->variables.front();E;E=E->next()) { + + if (E->get().line<completion_line) { + matches.insert(E->key()); + } + } + } + + + if (block->parent_function) { + if (comp_ident) { + for(int i=0;i<block->parent_function->arguments.size();i++) { + matches.insert(block->parent_function->arguments[i].name); + } + } + skip_function=block->parent_function->name; + } + block=block->parent_block; } - } break; - case SHADER_CANVAS_ITEM_FRAGMENT: { - int idx=0; - while (ci_fragment_builtins_defs[idx].name) { - parser.program->builtin_variables[ci_fragment_builtins_defs[idx].name]=ci_fragment_builtins_defs[idx].type; - idx++; + + if (comp_ident && skip_function!=StringName() && p_functions.has(skip_function)) { + + for (Map<StringName,DataType>::Element *E=p_functions[skip_function].front();E;E=E->next()) { + matches.insert(E->key()); + } } - } break; - case SHADER_CANVAS_ITEM_LIGHT: { - int idx=0; - while (ci_light_builtins_defs[idx].name) { - parser.program->builtin_variables[ci_light_builtins_defs[idx].name]=ci_light_builtins_defs[idx].type; - idx++; + + if (comp_ident) { + for (const Map<StringName,ShaderNode::Varying>::Element *E=shader->varyings.front();E;E=E->next()) { + matches.insert(E->key()); + + } + for (const Map<StringName,ShaderNode::Uniform>::Element *E=shader->uniforms.front();E;E=E->next()) { + matches.insert(E->key()); + } + + } - } break; - case SHADER_POST_PROCESS: { + + for(int i=0;i<shader->functions.size();i++) { + if (!shader->functions[i].callable || shader->functions[i].name==skip_function) + continue; + matches.insert(String(shader->functions[i].name)+"("); + } + int idx=0; - while (postprocess_fragment_builtins_defs[idx].name) { - parser.program->builtin_variables[postprocess_fragment_builtins_defs[idx].name]=postprocess_fragment_builtins_defs[idx].type; + + while (builtin_func_defs[idx].name) { + + matches.insert(String(builtin_func_defs[idx].name)+"("); idx++; } + + for(Set<String>::Element *E=matches.front();E;E=E->next()) { + r_options->push_back(E->get()); + } + + return OK; + } break; - } + case COMPLETION_CALL_ARGUMENTS: { - Error err = parse_block(parser,parser.program->body); - if (err) { - parser.get_error(r_error,r_err_line,r_err_column); - return err; - } + for(int i=0;i<shader->functions.size();i++) { + if (!shader->functions[i].callable) + continue; + if (shader->functions[i].name==completion_function) { - if (p_compile_func) { - err = p_compile_func(p_userdata,parser.program); - } + String calltip; - //clean up nodes created - while(parser.nodegc.size()) { + calltip+=get_datatype_name( shader->functions[i].function->return_type ); + calltip+=" "; + calltip+=shader->functions[i].name; + calltip+="("; - memdelete( parser.nodegc.front()->get() ); - parser.nodegc.pop_front(); - } - return err; -} + for(int j=0;j<shader->functions[i].function->arguments.size();j++) { -Error ShaderLanguage::compile(const String& p_code,ShaderType p_type,CompileFunc p_compile_func,void *p_userdata,String *r_error,int *r_err_line,int *r_err_column) { + if (j>0) + calltip+=", "; + else + calltip+=" "; - *r_error=""; - *r_err_line=0; - *r_err_column=0; - Vector<Token> tokens; + if (j==completion_argument) { + calltip+=CharType(0xFFFF); + } - Error err = tokenize(p_code,&tokens,r_error,r_err_line,r_err_column); - if (err!=OK) { - print_line("tokenizer error!"); - } + calltip+=get_datatype_name(shader->functions[i].function->arguments[j].type); + calltip+=" "; + calltip+=shader->functions[i].function->arguments[j].name; - if (err!=OK) { - return err; - } - err = parse(tokens,p_type,p_compile_func,p_userdata,r_error,r_err_line,r_err_column); - if (err!=OK) { - return err; - } - return OK; -} + if (j==completion_argument) { + calltip+=CharType(0xFFFF); + } + } -void ShaderLanguage::get_keyword_list(ShaderType p_type, List<String> *p_keywords) { + if (shader->functions[i].function->arguments.size()) + calltip+=" "; + calltip+=")"; - int idx=0; + r_call_hint=calltip; + return OK; + } - p_keywords->push_back("uniform"); - p_keywords->push_back("texture"); - p_keywords->push_back("cubemap"); - p_keywords->push_back("color"); - p_keywords->push_back("if"); - p_keywords->push_back("else"); + } - while(intrinsic_func_defs[idx].name) { + int idx=0; - p_keywords->push_back(intrinsic_func_defs[idx].name); - idx++; - } + String calltip; + while (builtin_func_defs[idx].name) { - switch(p_type) { - case SHADER_MATERIAL_VERTEX: { - idx=0; - while (vertex_builtins_defs[idx].name) { - p_keywords->push_back(vertex_builtins_defs[idx].name); - idx++; - } - } break; - case SHADER_MATERIAL_FRAGMENT: { - idx=0; - while (fragment_builtins_defs[idx].name) { - p_keywords->push_back(fragment_builtins_defs[idx].name); - idx++; - } - } break; - case SHADER_MATERIAL_LIGHT: { - idx=0; - while (light_builtins_defs[idx].name) { - p_keywords->push_back(light_builtins_defs[idx].name); - idx++; - } - } break; - case SHADER_CANVAS_ITEM_VERTEX: { - idx=0; - while (ci_vertex_builtins_defs[idx].name) { - p_keywords->push_back(ci_vertex_builtins_defs[idx].name); - idx++; - } - } break; - case SHADER_CANVAS_ITEM_FRAGMENT: { - idx=0; - while (ci_fragment_builtins_defs[idx].name) { - p_keywords->push_back(ci_fragment_builtins_defs[idx].name); + if (completion_function==builtin_func_defs[idx].name) { + + if (calltip.length()) + calltip+="\n"; + + calltip+=get_datatype_name( builtin_func_defs[idx].rettype ); + calltip+=" "; + calltip+=builtin_func_defs[idx].name; + calltip+="("; + + bool found_arg=false; + for(int i=0;i<4;i++) { + + if (builtin_func_defs[idx].args[i]==TYPE_VOID) + break; + + if (i>0) + calltip+=", "; + else + calltip+=" "; + + if (i==completion_argument) { + calltip+=CharType(0xFFFF); + } + + calltip+=get_datatype_name(builtin_func_defs[idx].args[i]); + + if (i==completion_argument) { + calltip+=CharType(0xFFFF); + } + + found_arg=true; + + } + + if (found_arg) + calltip+=" "; + calltip+=")"; + + + } idx++; } + + r_call_hint=calltip; + + return OK; + } break; - case SHADER_CANVAS_ITEM_LIGHT: { - idx=0; - while (ci_light_builtins_defs[idx].name) { - p_keywords->push_back(ci_light_builtins_defs[idx].name); - idx++; + case COMPLETION_INDEX: { + + const char colv[4]={'r','g','b','a'}; + const char coordv[4]={'x','y','z','w'}; + + + int limit=0; + + switch(completion_base) { + case TYPE_BVEC2: + case TYPE_IVEC2: + case TYPE_UVEC2: + case TYPE_VEC2: { + limit=2; + + } break; + case TYPE_BVEC3: + case TYPE_IVEC3: + case TYPE_UVEC3: + case TYPE_VEC3: { + + limit=3; + + } break; + case TYPE_BVEC4: + case TYPE_IVEC4: + case TYPE_UVEC4: + case TYPE_VEC4: { + + limit=4; + + } break; + case TYPE_MAT2: limit=2; break; + case TYPE_MAT3: limit=3; break; + case TYPE_MAT4: limit=4; break; + default: {} } - } break; - case SHADER_POST_PROCESS: { - idx=0; - while (postprocess_fragment_builtins_defs[idx].name) { - p_keywords->push_back(postprocess_fragment_builtins_defs[idx].name); - idx++; + for(int i=0;i<limit;i++) { + r_options->push_back(String::chr(colv[i])); + r_options->push_back(String::chr(coordv[i])); } + } break; + } + return ERR_PARSE_ERROR; +} + +String ShaderLanguage::get_error_text() { + + return error_str; +} + +int ShaderLanguage::get_error_line() { + + return error_line; } + +ShaderLanguage::ShaderNode *ShaderLanguage::get_shader() { + + return shader; +} + +ShaderLanguage::ShaderLanguage() { + + nodes=NULL; +} + +ShaderLanguage::~ShaderLanguage() { + + clear(); +} + + diff --git a/servers/visual/shader_language.h b/servers/visual/shader_language.h index 31e9fcda5b..b5f843c114 100644 --- a/servers/visual/shader_language.h +++ b/servers/visual/shader_language.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -46,12 +46,24 @@ public: enum TokenType { TK_EMPTY, - TK_INDENTIFIER, + TK_IDENTIFIER, TK_TRUE, TK_FALSE, TK_REAL_CONSTANT, + TK_INT_CONSTANT, TK_TYPE_VOID, TK_TYPE_BOOL, + TK_TYPE_BVEC2, + TK_TYPE_BVEC3, + TK_TYPE_BVEC4, + TK_TYPE_INT, + TK_TYPE_IVEC2, + TK_TYPE_IVEC3, + TK_TYPE_IVEC4, + TK_TYPE_UINT, + TK_TYPE_UVEC2, + TK_TYPE_UVEC3, + TK_TYPE_UVEC4, TK_TYPE_FLOAT, TK_TYPE_VEC2, TK_TYPE_VEC3, @@ -59,9 +71,13 @@ public: TK_TYPE_MAT2, TK_TYPE_MAT3, TK_TYPE_MAT4, - TK_TYPE_TEXTURE, - TK_TYPE_CUBEMAP, - TK_TYPE_COLOR, + TK_TYPE_SAMPLER2D, + TK_TYPE_ISAMPLER2D, + TK_TYPE_USAMPLER2D, + TK_TYPE_SAMPLERCUBE, + TK_PRECISION_LOW, + TK_PRECISION_MID, + TK_PRECISION_HIGH, TK_OP_EQUAL, TK_OP_NOT_EQUAL, TK_OP_LESS, @@ -75,14 +91,35 @@ public: TK_OP_SUB, TK_OP_MUL, TK_OP_DIV, - TK_OP_NEG, + TK_OP_MOD, + TK_OP_SHIFT_LEFT, + TK_OP_SHIFT_RIGHT, TK_OP_ASSIGN, TK_OP_ASSIGN_ADD, TK_OP_ASSIGN_SUB, TK_OP_ASSIGN_MUL, TK_OP_ASSIGN_DIV, + TK_OP_ASSIGN_MOD, + TK_OP_ASSIGN_SHIFT_LEFT, + TK_OP_ASSIGN_SHIFT_RIGHT, + TK_OP_ASSIGN_BIT_AND, + TK_OP_ASSIGN_BIT_OR, + TK_OP_ASSIGN_BIT_XOR, + TK_OP_BIT_AND, + TK_OP_BIT_OR, + TK_OP_BIT_XOR, + TK_OP_BIT_INVERT, + TK_OP_INCREMENT, + TK_OP_DECREMENT, TK_CF_IF, TK_CF_ELSE, + TK_CF_FOR, + TK_CF_WHILE, + TK_CF_DO, + TK_CF_SWITCH, + TK_CF_CASE, + TK_CF_BREAK, + TK_CF_CONTINUE, TK_CF_RETURN, TK_BRACKET_OPEN, TK_BRACKET_CLOSE, @@ -90,31 +127,49 @@ public: TK_CURLY_BRACKET_CLOSE, TK_PARENTHESIS_OPEN, TK_PARENTHESIS_CLOSE, + TK_QUESTION, TK_COMMA, + TK_COLON, TK_SEMICOLON, TK_PERIOD, TK_UNIFORM, + TK_VARYING, + TK_RENDER_MODE, + TK_HINT_WHITE_TEXTURE, + TK_HINT_BLACK_TEXTURE, + TK_HINT_NORMAL_TEXTURE, + TK_HINT_ANISO_TEXTURE, + TK_HINT_ALBEDO_TEXTURE, + TK_HINT_BLACK_ALBEDO_TEXTURE, + TK_HINT_COLOR, + TK_HINT_RANGE, + TK_CURSOR, TK_ERROR, + TK_EOF, TK_MAX }; - - /* COMPILER */ - enum ShaderType { - SHADER_MATERIAL_VERTEX, - SHADER_MATERIAL_FRAGMENT, - SHADER_MATERIAL_LIGHT, - SHADER_CANVAS_ITEM_VERTEX, - SHADER_CANVAS_ITEM_FRAGMENT, - SHADER_CANVAS_ITEM_LIGHT, - SHADER_POST_PROCESS, - }; + // lame work around to Apple defining this as a macro in 10.12 SDK + #ifdef TYPE_BOOL + #undef TYPE_BOOL + #endif enum DataType { TYPE_VOID, TYPE_BOOL, + TYPE_BVEC2, + TYPE_BVEC3, + TYPE_BVEC4, + TYPE_INT, + TYPE_IVEC2, + TYPE_IVEC3, + TYPE_IVEC4, + TYPE_UINT, + TYPE_UVEC2, + TYPE_UVEC3, + TYPE_UVEC4, TYPE_FLOAT, TYPE_VEC2, TYPE_VEC3, @@ -122,30 +177,58 @@ public: TYPE_MAT2, TYPE_MAT3, TYPE_MAT4, - TYPE_TEXTURE, - TYPE_CUBEMAP, + TYPE_SAMPLER2D, + TYPE_ISAMPLER2D, + TYPE_USAMPLER2D, + TYPE_SAMPLERCUBE, + }; + + enum DataPrecision { + PRECISION_LOWP, + PRECISION_MEDIUMP, + PRECISION_HIGHP, + PRECISION_DEFAULT, }; enum Operator { - OP_ASSIGN, + OP_EQUAL, + OP_NOT_EQUAL, + OP_LESS, + OP_LESS_EQUAL, + OP_GREATER, + OP_GREATER_EQUAL, + OP_AND, + OP_OR, + OP_NOT, + OP_NEGATE, OP_ADD, OP_SUB, OP_MUL, OP_DIV, + OP_MOD, + OP_SHIFT_LEFT, + OP_SHIFT_RIGHT, + OP_ASSIGN, OP_ASSIGN_ADD, OP_ASSIGN_SUB, OP_ASSIGN_MUL, OP_ASSIGN_DIV, - OP_NEG, - OP_NOT, - OP_CMP_EQ, - OP_CMP_NEQ, - OP_CMP_LEQ, - OP_CMP_GEQ, - OP_CMP_LESS, - OP_CMP_GREATER, - OP_CMP_OR, - OP_CMP_AND, + OP_ASSIGN_MOD, + OP_ASSIGN_SHIFT_LEFT, + OP_ASSIGN_SHIFT_RIGHT, + OP_ASSIGN_BIT_AND, + OP_ASSIGN_BIT_OR, + OP_ASSIGN_BIT_XOR, + OP_BIT_AND, + OP_BIT_OR, + OP_BIT_XOR, + OP_BIT_INVERT, + OP_INCREMENT, + OP_DECREMENT, + OP_SELECT_IF, + OP_SELECT_ELSE, //used only internally, then only IF appears with 3 arguments + OP_POST_INCREMENT, + OP_POST_DECREMENT, OP_CALL, OP_CONSTRUCT, OP_MAX @@ -154,18 +237,21 @@ public: enum FlowOperation { FLOW_OP_IF, FLOW_OP_RETURN, - //FLOW_OP_FOR, - //FLOW_OP_WHILE, - //FLOW_OP_DO, - //FLOW_OP_BREAK, - //FLOW_OP_CONTINUE, + FLOW_OP_FOR, + FLOW_OP_WHILE, + FLOW_OP_DO, + FLOW_OP_BREAK, + FLOW_OP_SWITCH, + FLOW_OP_CONTINUE }; struct Node { + Node *next; + enum Type { - TYPE_PROGRAM, + TYPE_SHADER, TYPE_FUNCTION, TYPE_BLOCK, TYPE_VARIABLE, @@ -175,7 +261,6 @@ public: TYPE_MEMBER }; - Node * parent; Type type; virtual DataType get_datatype() const { return TYPE_VOID; } @@ -183,46 +268,75 @@ public: virtual ~Node() {} }; + template<class T> + T* alloc_node() { + T* node = memnew(T); + node->next=nodes; + nodes=node; + return node; + } + + Node *nodes; + struct OperatorNode : public Node { DataType return_cache; + DataPrecision return_precision_cache; Operator op; Vector<Node*> arguments; virtual DataType get_datatype() const { return return_cache; } - OperatorNode() { type=TYPE_OPERATOR; return_cache=TYPE_VOID; } + OperatorNode() { type=TYPE_OPERATOR; return_cache=TYPE_VOID; return_precision_cache=PRECISION_DEFAULT; } }; struct VariableNode : public Node { - bool uniform; DataType datatype_cache; StringName name; virtual DataType get_datatype() const { return datatype_cache; } - VariableNode() { type=TYPE_VARIABLE; datatype_cache=TYPE_VOID; uniform=false; } + VariableNode() { type=TYPE_VARIABLE; datatype_cache=TYPE_VOID; } }; struct ConstantNode : public Node { DataType datatype; - Variant value; + + union Value { + bool boolean; + float real; + int32_t sint; + uint32_t uint; + }; + + Vector<Value> values; virtual DataType get_datatype() const { return datatype; } ConstantNode() { type=TYPE_CONSTANT; } }; + struct FunctionNode; + struct BlockNode : public Node { + FunctionNode *parent_function; + BlockNode *parent_block; + + struct Variable { + DataType type; + DataPrecision precision; + int line; //for completion + }; - Map<StringName,DataType> variables; + Map<StringName,Variable> variables; List<Node*> statements; - BlockNode() { type=TYPE_BLOCK; } + BlockNode() { type=TYPE_BLOCK; parent_block=NULL; parent_function=NULL; } }; struct ControlFlowNode : public Node { FlowOperation flow_op; - Vector<Node*> statements; + Vector<Node*> expressions; + Vector<BlockNode*> blocks; ControlFlowNode() { type=TYPE_CONTROL_FLOW; flow_op=FLOW_OP_IF;} }; @@ -244,39 +358,67 @@ public: StringName name; DataType type; + DataPrecision precision; }; StringName name; DataType return_type; + DataPrecision return_precision; Vector<Argument> arguments; BlockNode *body; - FunctionNode() { type=TYPE_FUNCTION; } + FunctionNode() { type=TYPE_FUNCTION; return_precision=PRECISION_DEFAULT; } }; - struct Uniform { - int order; - DataType type; - Variant default_value; - }; - - struct ProgramNode : public Node { + struct ShaderNode : public Node { struct Function { StringName name; FunctionNode*function; + Set<StringName> uses_function; + bool callable; + }; + + struct Varying { + DataType type; + DataPrecision precission; + }; + + struct Uniform { + enum Hint { + HINT_NONE, + HINT_COLOR, + HINT_RANGE, + HINT_ALBEDO, + HINT_BLACK_ALBEDO, + HINT_NORMAL, + HINT_BLACK, + HINT_WHITE, + HINT_ANISO, + HINT_MAX + }; + + int order; + int texture_order; + DataType type; + DataPrecision precission; + Vector<ConstantNode::Value> default_value; + Hint hint; + float hint_range[3]; + + Uniform() { hint=HINT_NONE; hint_range[0]=0; hint_range[1]=1; hint_range[2]=0.001;} }; - Map<StringName,DataType> builtin_variables; + Map<StringName,Varying> varyings; Map<StringName,Uniform> uniforms; + Vector<StringName> render_modes; Vector<Function> functions; - BlockNode *body; - ProgramNode() { type=TYPE_PROGRAM; } + ShaderNode() { type=TYPE_SHADER; } }; @@ -284,12 +426,12 @@ public: bool is_op; union { - TokenType op; + Operator op; Node *node; }; }; - typedef Error (*CompileFunc)(void*,ProgramNode*); + struct VarInfo { @@ -297,133 +439,163 @@ public: DataType type; }; -private: - - - - static const char * token_names[TK_MAX]; + enum CompletionType { + COMPLETION_NONE, + COMPLETION_RENDER_MODE, + COMPLETION_MAIN_FUNCTION, + COMPLETION_IDENTIFIER, + COMPLETION_FUNCTION_CALL, + COMPLETION_CALL_ARGUMENTS, + COMPLETION_INDEX, + }; struct Token { TokenType type; StringName text; - uint16_t line,col; - - Token(TokenType p_type=TK_EMPTY,const String& p_text=String()) { type=p_type; text=p_text; line=0; col=0; } + double constant; + uint16_t line; }; + static String get_operator_text(Operator p_op); + static String get_token_text(Token p_token); + + static bool is_token_datatype(TokenType p_type); + static DataType get_token_datatype(TokenType p_type); + static bool is_token_precision(TokenType p_type); + static DataPrecision get_token_precision(TokenType p_type); + static String get_datatype_name(DataType p_type); + static bool is_token_nonvoid_datatype(TokenType p_type); + static bool is_token_operator(TokenType p_type); + + static bool convert_constant(ConstantNode* p_constant, DataType p_to_type,ConstantNode::Value *p_value=NULL); + static DataType get_scalar_type(DataType p_type); + static bool is_scalar_type(DataType p_type); + static bool is_sampler_type(DataType p_type); + + static void get_keyword_list(List<String> *r_keywords); + static void get_builtin_funcs(List<String> *r_keywords); +private: - static Token read_token(const CharType* p_text,int p_len,int &r_line,int &r_chars); - static Error tokenize(const String& p_text,Vector<Token> *p_tokens,String *r_error,int *r_err_line,int *r_err_column); + struct KeyWord { TokenType token; const char *text;}; + static const KeyWord keyword_list[]; + bool error_set; + String error_str; + int error_line; + String code; + int char_idx; + int tk_line; + StringName current_function; - class Parser { + struct TkPos { + int char_idx; + int tk_line; + }; - Vector<Token> tokens; - int pos; - String error; - public: + TkPos _get_tkpos() { + TkPos tkp; + tkp.char_idx=char_idx; + tkp.tk_line=tk_line; + return tkp; + } - void set_error(const String& p_error) { error=p_error; } - void get_error(String *r_error, int *r_line, int *r_column) { + void _set_tkpos(TkPos p_pos) { + char_idx=p_pos.char_idx; + tk_line=p_pos.tk_line; + } - *r_error=error; - *r_line=get_token(pos).line; - *r_column=get_token(pos).col; - } + void _set_error(const String& p_str) { + if (error_set) + return; + error_line=tk_line; + error_set=true; + error_str=p_str; + } - Token get_token(int ofs=0) const { int idx=pos+ofs; if (idx<0 || idx>=tokens.size()) return Token(TK_ERROR); return tokens[idx]; } - TokenType get_token_type(int ofs=0) const { int idx=pos+ofs; if (idx<0 || idx>=tokens.size()) return TK_ERROR; return tokens[idx].type; } - void advance(int p_amount=1) { pos+=p_amount; } - bool is_at_end() const { return pos>=tokens.size(); } + static const char * token_names[TK_MAX]; - ProgramNode *program; - template<class T> - T* create_node(Node *p_parent) { T*n=memnew( T ); nodegc.push_back(n); n->parent=p_parent; return n; } - List<Node*> nodegc; - Parser(const Vector<Token>& p_tokens) { tokens=p_tokens; pos=0;} - }; - struct IntrinsicFuncDef { - enum { MAX_ARGS=5 }; - const char* name; - DataType rettype; - const DataType args[MAX_ARGS]; + Token _make_token(TokenType p_type, const StringName& p_text=StringName()); + Token _get_token(); + ShaderNode *shader; + + enum IdentifierType { + IDENTIFIER_FUNCTION, + IDENTIFIER_UNIFORM, + IDENTIFIER_VARYING, + IDENTIFIER_FUNCTION_ARGUMENT, + IDENTIFIER_LOCAL_VAR, + IDENTIFIER_BUILTIN_VAR, }; - static const IntrinsicFuncDef intrinsic_func_defs[]; + bool _find_identifier(const BlockNode* p_block,const Map<StringName, DataType> &p_builtin_types,const StringName& p_identifier, DataType *r_data_type=NULL, IdentifierType *r_type=NULL); - struct OperatorDef { + bool _validate_operator(OperatorNode *p_op,DataType *r_ret_type=NULL); - enum { MAX_ARGS=2 }; - Operator op; + + struct BuiltinFuncDef { + + enum { MAX_ARGS=5 }; + const char* name; DataType rettype; const DataType args[MAX_ARGS]; + }; - static const OperatorDef operator_defs[]; + CompletionType completion_type; + int completion_line; + BlockNode *completion_block; + DataType completion_base; + StringName completion_function; + int completion_argument; - struct BuiltinsDef { - const char* name; - DataType type; - }; + bool _get_completable_identifier(BlockNode *p_block, CompletionType p_type, StringName& identifier); - static const BuiltinsDef vertex_builtins_defs[]; - static const BuiltinsDef fragment_builtins_defs[]; - static const BuiltinsDef light_builtins_defs[]; + static const BuiltinFuncDef builtin_func_defs[]; + bool _validate_function_call(BlockNode* p_block, OperatorNode *p_func,DataType *r_ret_type); - static const BuiltinsDef ci_vertex_builtins_defs[]; - static const BuiltinsDef ci_fragment_builtins_defs[]; - static const BuiltinsDef ci_light_builtins_defs[]; + bool _parse_function_arguments(BlockNode *p_block, const Map<StringName,DataType> &p_builtin_types, OperatorNode* p_func, int *r_complete_arg=NULL); + Node* _parse_expression(BlockNode *p_block, const Map<StringName,DataType> &p_builtin_types); - static const BuiltinsDef postprocess_fragment_builtins_defs[]; + ShaderLanguage::Node* _reduce_expression(BlockNode *p_block, ShaderLanguage::Node *p_node); + Node* _parse_and_reduce_expression(BlockNode *p_block,const Map<StringName,DataType> &p_builtin_types); - static DataType get_token_datatype(TokenType p_type); - static String get_datatype_name(DataType p_type); - static bool is_token_datatype(TokenType p_type); - static bool is_token_nonvoid_datatype(TokenType p_type); + Error _parse_block(BlockNode *p_block, const Map<StringName, DataType> &p_builtin_types, bool p_just_one=false, bool p_can_break=false, bool p_can_continue=false); - static bool test_existing_identifier(Node *p_node,const StringName p_identifier,bool p_func=true,bool p_var=true,bool p_builtin=true); + Error _parse_shader(const Map< StringName, Map<StringName,DataType> > &p_functions, const Set<String> &p_render_modes); - static bool parser_is_at_function(Parser& parser); - static DataType compute_node_type(Node *p_node); - static Node* validate_function_call(Parser&parser, OperatorNode *p_func); - static Node* validate_operator(Parser& parser,OperatorNode *p_func); - static bool is_token_operator(TokenType p_type); - static Operator get_token_operator(TokenType p_type); +public: - static Error parse_expression(Parser& parser,Node *p_parent,Node **r_expr); +// static void get_keyword_list(ShaderType p_type,List<String> *p_keywords); - static Error parse_variable_declaration(Parser& parser,BlockNode *p_block); - static Error parse_function(Parser& parser,BlockNode *p_block); - static Error parse_flow_if(Parser& parser,Node *p_parent,Node **r_statement); - static Error parse_flow_return(Parser& parser,Node *p_parent,Node **r_statement); - static Error parse_statement(Parser& parser,Node *p_parent,Node **r_statement); - static Error parse_block(Parser& parser,BlockNode *p_block); + void clear(); + Error compile(const String& p_code,const Map< StringName, Map<StringName,DataType> > &p_functions,const Set<String>& p_render_modes); + Error complete(const String& p_code,const Map< StringName, Map<StringName,DataType> > &p_functions,const Set<String>& p_render_modes,List<String>* r_options,String& r_call_hint); - static Error parse(const Vector<Token> &p_tokens,ShaderType p_type,CompileFunc p_compile_func,void *p_userdata,String *r_error,int *r_err_line,int *r_err_column); -; -public: + String get_error_text(); + int get_error_line(); - static void get_keyword_list(ShaderType p_type,List<String> *p_keywords); + ShaderNode *get_shader(); - static Error compile(const String& p_code,ShaderType p_type, CompileFunc p_compile_func,void *p_userdata,String *r_error,int *r_err_line,int *r_err_column); - static String lex_debug(const String& p_code); + String token_debug(const String& p_code); + ShaderLanguage(); + ~ShaderLanguage(); }; diff --git a/servers/visual/shader_types.cpp b/servers/visual/shader_types.cpp new file mode 100644 index 0000000000..0eb3e0fc5a --- /dev/null +++ b/servers/visual/shader_types.cpp @@ -0,0 +1,182 @@ +#include "shader_types.h" + + +const Map< StringName, Map<StringName,ShaderLanguage::DataType> >& ShaderTypes::get_functions(VS::ShaderMode p_mode) { + + return shader_modes[p_mode].functions; +} + +const Set<String>& ShaderTypes::get_modes(VS::ShaderMode p_mode) { + + return shader_modes[p_mode].modes; +} + + +ShaderTypes *ShaderTypes::singleton=NULL; + +ShaderTypes::ShaderTypes() +{ + singleton=this; + + /*************** SPATIAL ***********************/ + + shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["SRC_VERTEX"]=ShaderLanguage::TYPE_VEC3; + shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["SRC_NORMAL"]=ShaderLanguage::TYPE_VEC3; + shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["SRC_TANGENT"]=ShaderLanguage::TYPE_VEC4; + shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["SRC_BONES"]=ShaderLanguage::TYPE_IVEC4; + shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["SRC_WEIGHTS"]=ShaderLanguage::TYPE_VEC4; + + shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["POSITION"]=ShaderLanguage::TYPE_VEC4 ; + shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["VERTEX"]=ShaderLanguage::TYPE_VEC3; + shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["NORMAL"]=ShaderLanguage::TYPE_VEC3; + shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["TANGENT"]=ShaderLanguage::TYPE_VEC3; + shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["BINORMAL"]=ShaderLanguage::TYPE_VEC3; + shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["UV"]=ShaderLanguage::TYPE_VEC2; + shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["UV2"]=ShaderLanguage::TYPE_VEC2; + shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["COLOR"]=ShaderLanguage::TYPE_VEC4; + shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["POINT_SIZE"]=ShaderLanguage::TYPE_FLOAT; + shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["INSTANCE_ID"]=ShaderLanguage::TYPE_INT; + + //builtins + shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["WORLD_MATRIX"]=ShaderLanguage::TYPE_MAT4; + shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["INV_CAMERA_MATRIX"]=ShaderLanguage::TYPE_MAT4; + shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["PROJECTION_MATRIX"]=ShaderLanguage::TYPE_MAT4; + shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["TIME"]=ShaderLanguage::TYPE_FLOAT; + shader_modes[VS::SHADER_SPATIAL].functions["vertex"]["VIEWPORT_SIZE"]=ShaderLanguage::TYPE_VEC2; + + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["VERTEX"]=ShaderLanguage::TYPE_VEC3; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["FRAGCOORD"]=ShaderLanguage::TYPE_VEC4; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["FRONT_FACING"]=ShaderLanguage::TYPE_BOOL; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["NORMAL"]=ShaderLanguage::TYPE_VEC3; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["TANGENT"]=ShaderLanguage::TYPE_VEC3; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["BINORMAL"]=ShaderLanguage::TYPE_VEC3; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["NORMALMAP"]=ShaderLanguage::TYPE_VEC3; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["NORMALMAP_DEPTH"]=ShaderLanguage::TYPE_FLOAT; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["UV"]=ShaderLanguage::TYPE_VEC2; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["UV2"]=ShaderLanguage::TYPE_VEC2; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["COLOR"]=ShaderLanguage::TYPE_VEC4; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["NORMAL"]=ShaderLanguage::TYPE_VEC3; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["ALBEDO"]=ShaderLanguage::TYPE_VEC3; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["ALPHA"]=ShaderLanguage::TYPE_FLOAT; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["SPECULAR"]=ShaderLanguage::TYPE_VEC3; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["ROUGHNESS"]=ShaderLanguage::TYPE_FLOAT; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["RIM"]=ShaderLanguage::TYPE_FLOAT; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["RIM_TINT"]=ShaderLanguage::TYPE_FLOAT; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["CLEARCOAT"]=ShaderLanguage::TYPE_FLOAT; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["CLEARCOAT_GLOSS"]=ShaderLanguage::TYPE_FLOAT; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["ANISOTROPY"]=ShaderLanguage::TYPE_FLOAT; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["ANISOTROPY_FLOW"]=ShaderLanguage::TYPE_VEC2; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["SSS_STRENGTH"]=ShaderLanguage::TYPE_FLOAT; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["AO"]=ShaderLanguage::TYPE_FLOAT; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["EMISSION"]=ShaderLanguage::TYPE_VEC3; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["SPECIAL"]=ShaderLanguage::TYPE_FLOAT; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["DISCARD"]=ShaderLanguage::TYPE_BOOL; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["SCREEN_UV"]=ShaderLanguage::TYPE_VEC2; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["POINT_COORD"]=ShaderLanguage::TYPE_VEC2; + + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["WORLD_MATRIX"]=ShaderLanguage::TYPE_MAT4; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["INV_CAMERA_MATRIX"]=ShaderLanguage::TYPE_MAT4; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["PROJECTION_MATRIX"]=ShaderLanguage::TYPE_MAT4; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["TIME"]=ShaderLanguage::TYPE_FLOAT; + shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["VIEWPORT_SIZE"]=ShaderLanguage::TYPE_VEC2; + + shader_modes[VS::SHADER_SPATIAL].modes.insert("blend_mix"); + shader_modes[VS::SHADER_SPATIAL].modes.insert("blend_add"); + shader_modes[VS::SHADER_SPATIAL].modes.insert("blend_sub"); + shader_modes[VS::SHADER_SPATIAL].modes.insert("blend_mul"); + + shader_modes[VS::SHADER_SPATIAL].modes.insert("depth_draw_opaque"); + shader_modes[VS::SHADER_SPATIAL].modes.insert("depth_draw_always"); + shader_modes[VS::SHADER_SPATIAL].modes.insert("depth_draw_never"); + shader_modes[VS::SHADER_SPATIAL].modes.insert("depth_draw_alpha_prepass"); + + shader_modes[VS::SHADER_SPATIAL].modes.insert("cull_front"); + shader_modes[VS::SHADER_SPATIAL].modes.insert("cull_back"); + shader_modes[VS::SHADER_SPATIAL].modes.insert("cull_disabled"); + + shader_modes[VS::SHADER_SPATIAL].modes.insert("unshaded"); + shader_modes[VS::SHADER_SPATIAL].modes.insert("ontop"); + + shader_modes[VS::SHADER_SPATIAL].modes.insert("skip_transform"); + + /************ CANVAS ITEM **************************/ + + shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"]["SRC_VERTEX"]=ShaderLanguage::TYPE_VEC2; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"]["VERTEX"]=ShaderLanguage::TYPE_VEC2; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"]["UV"]=ShaderLanguage::TYPE_VEC2; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"]["VERTEX_COLOR"]=ShaderLanguage::TYPE_VEC4; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"]["POINT_SIZE"]=ShaderLanguage::TYPE_FLOAT; + + shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"]["WORLD_MATRIX"]=ShaderLanguage::TYPE_MAT4; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"]["PROJECTION_MATRIX"]=ShaderLanguage::TYPE_MAT4; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"]["EXTRA_MATRIX"]=ShaderLanguage::TYPE_MAT4; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["vertex"]["TIME"]=ShaderLanguage::TYPE_FLOAT; + + shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["SRC_COLOR"]=ShaderLanguage::TYPE_VEC4; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["POSITION"]=ShaderLanguage::TYPE_VEC4; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["NORMAL"]=ShaderLanguage::TYPE_VEC3; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["NORMALMAP"]=ShaderLanguage::TYPE_VEC3; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["NORMALMAP_DEPTH"]=ShaderLanguage::TYPE_FLOAT; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["UV"]=ShaderLanguage::TYPE_VEC2; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["COLOR"]=ShaderLanguage::TYPE_VEC4; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["TEXTURE"]=ShaderLanguage::TYPE_SAMPLER2D; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["TEXTURE_PIXEL_SIZE"]=ShaderLanguage::TYPE_VEC2; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["SCREEN_UV"]=ShaderLanguage::TYPE_VEC2; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["POINT_COORD"]=ShaderLanguage::TYPE_VEC2; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["fragment"]["TIME"]=ShaderLanguage::TYPE_FLOAT; + + shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["POSITION"]=ShaderLanguage::TYPE_VEC4; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["NORMAL"]=ShaderLanguage::TYPE_VEC3; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["UV"]=ShaderLanguage::TYPE_VEC2; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["COLOR"]=ShaderLanguage::TYPE_VEC4; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["TEXTURE"]=ShaderLanguage::TYPE_SAMPLER2D; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["TEXTURE_PIXEL_SIZE"]=ShaderLanguage::TYPE_VEC2; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["VAR1"]=ShaderLanguage::TYPE_VEC4; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["VAR2"]=ShaderLanguage::TYPE_VEC4; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["SCREEN_UV"]=ShaderLanguage::TYPE_VEC2; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["LIGHT_VEC"]=ShaderLanguage::TYPE_VEC2; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["LIGHT_HEIGHT"]=ShaderLanguage::TYPE_FLOAT; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["LIGHT_COLOR"]=ShaderLanguage::TYPE_VEC4; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["LIGHT_UV"]=ShaderLanguage::TYPE_VEC2; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["LIGHT_SHADOW"]=ShaderLanguage::TYPE_VEC4; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["LIGHT"]=ShaderLanguage::TYPE_VEC4; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["SHADOW"]=ShaderLanguage::TYPE_VEC4; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["POINT_COORD"]=ShaderLanguage::TYPE_VEC2; + shader_modes[VS::SHADER_CANVAS_ITEM].functions["light"]["TIME"]=ShaderLanguage::TYPE_FLOAT; + + shader_modes[VS::SHADER_CANVAS_ITEM].modes.insert("skip_transform"); + + shader_modes[VS::SHADER_CANVAS_ITEM].modes.insert("blend_mix"); + shader_modes[VS::SHADER_CANVAS_ITEM].modes.insert("blend_add"); + shader_modes[VS::SHADER_CANVAS_ITEM].modes.insert("blend_sub"); + shader_modes[VS::SHADER_CANVAS_ITEM].modes.insert("blend_mul"); + shader_modes[VS::SHADER_CANVAS_ITEM].modes.insert("blend_premul_alpha"); + + shader_modes[VS::SHADER_CANVAS_ITEM].modes.insert("unshaded"); + shader_modes[VS::SHADER_CANVAS_ITEM].modes.insert("light_only"); + + + /************ PARTICLES **************************/ + + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["COLOR"]=ShaderLanguage::TYPE_VEC4; + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["VELOCITY"]=ShaderLanguage::TYPE_VEC3; + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["MASS"]=ShaderLanguage::TYPE_FLOAT; + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["ACTIVE"]=ShaderLanguage::TYPE_BOOL; + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["RESTART"]=ShaderLanguage::TYPE_BOOL; + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["CUSTOM"]=ShaderLanguage::TYPE_VEC4; + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["TRANSFORM"]=ShaderLanguage::TYPE_MAT4; + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["TIME"]=ShaderLanguage::TYPE_FLOAT; + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["LIFETIME"]=ShaderLanguage::TYPE_FLOAT; + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["DELTA"]=ShaderLanguage::TYPE_FLOAT; + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["SEED"]=ShaderLanguage::TYPE_BOOL; + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["ORIGIN"]=ShaderLanguage::TYPE_MAT4; + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["INDEX"]=ShaderLanguage::TYPE_INT; + + shader_modes[VS::SHADER_PARTICLES].modes.insert("billboard"); + shader_modes[VS::SHADER_PARTICLES].modes.insert("disable_force"); + shader_modes[VS::SHADER_PARTICLES].modes.insert("disable_velocity"); + + + + +} diff --git a/servers/visual/shader_types.h b/servers/visual/shader_types.h new file mode 100644 index 0000000000..411d5790a9 --- /dev/null +++ b/servers/visual/shader_types.h @@ -0,0 +1,27 @@ +#ifndef SHADERTYPES_H +#define SHADERTYPES_H + +#include "shader_language.h" +#include "servers/visual_server.h" +class ShaderTypes { + + + struct Type { + + Map< StringName, Map<StringName,ShaderLanguage::DataType> > functions; + Set<String> modes; + }; + + Map<VS::ShaderMode,Type> shader_modes; + + static ShaderTypes *singleton; +public: + static ShaderTypes *get_singleton() { return singleton; } + + const Map< StringName, Map<StringName,ShaderLanguage::DataType> >& get_functions(VS::ShaderMode p_mode); + const Set<String>& get_modes(VS::ShaderMode p_mode); + + ShaderTypes(); +}; + +#endif // SHADERTYPES_H diff --git a/servers/visual/visual_server_canvas.cpp b/servers/visual/visual_server_canvas.cpp new file mode 100644 index 0000000000..d68c580442 --- /dev/null +++ b/servers/visual/visual_server_canvas.cpp @@ -0,0 +1,1268 @@ +#include "visual_server_canvas.h" +#include "visual_server_global.h" +#include "visual_server_viewport.h" + +void VisualServerCanvas::_render_canvas_item_tree(Item *p_canvas_item, const Transform2D& p_transform, const Rect2& p_clip_rect, const Color& p_modulate, RasterizerCanvas::Light *p_lights) { + + + static const int z_range = VS::CANVAS_ITEM_Z_MAX-VS::CANVAS_ITEM_Z_MIN+1; + RasterizerCanvas::Item *z_list[z_range]; + RasterizerCanvas::Item *z_last_list[z_range]; + + for(int i=0;i<z_range;i++) { + z_list[i]=NULL; + z_last_list[i]=NULL; + } + + + _render_canvas_item(p_canvas_item,p_transform,p_clip_rect,Color(1,1,1,1),0,z_list,z_last_list,NULL,NULL); + + for(int i=0;i<z_range;i++) { + if (!z_list[i]) + continue; + VSG::canvas_render->canvas_render_items(z_list[i],VS::CANVAS_ITEM_Z_MIN+i,p_modulate,p_lights); + } + +} + +void VisualServerCanvas::_render_canvas_item(Item *p_canvas_item,const Transform2D& p_transform,const Rect2& p_clip_rect, const Color &p_modulate,int p_z,RasterizerCanvas::Item **z_list,RasterizerCanvas::Item **z_last_list,Item *p_canvas_clip,Item *p_material_owner) { + + Item *ci = p_canvas_item; + + if (!ci->visible) + return; + + Rect2 rect = ci->get_rect(); + Transform2D xform = p_transform * ci->xform; + Rect2 global_rect = xform.xform(rect); + global_rect.pos+=p_clip_rect.pos; + + + if (ci->use_parent_material && p_material_owner) + ci->material_owner=p_material_owner; + else { + p_material_owner=ci; + ci->material_owner=NULL; + } + + + Color modulate( ci->modulate.r * p_modulate.r, ci->modulate.g * p_modulate.g,ci->modulate.b * p_modulate.b,ci->modulate.a * p_modulate.a); + + if (modulate.a<0.007) + return; + + + int child_item_count=ci->child_items.size(); + Item **child_items=(Item**)alloca(child_item_count*sizeof(Item*)); + copymem(child_items,ci->child_items.ptr(),child_item_count*sizeof(Item*)); + + if (ci->clip) { + if (p_canvas_clip != NULL) { + ci->final_clip_rect=p_canvas_clip->final_clip_rect.clip(global_rect); + } else { + ci->final_clip_rect=global_rect; + } + ci->final_clip_owner=ci; + + } else { + ci->final_clip_owner=p_canvas_clip; + } + + if (ci->sort_y) { + + SortArray<Item*,ItemPtrSort> sorter; + sorter.sort(child_items,child_item_count); + } + + if (ci->z_relative) + p_z=CLAMP(p_z+ci->z,VS::CANVAS_ITEM_Z_MIN,VS::CANVAS_ITEM_Z_MAX); + else + p_z=ci->z; + + for(int i=0;i<child_item_count;i++) { + + if (!child_items[i]->behind) + continue; + _render_canvas_item(child_items[i],xform,p_clip_rect,modulate,p_z,z_list,z_last_list,(Item*)ci->final_clip_owner,p_material_owner); + } + + if (ci->copy_back_buffer) { + + ci->copy_back_buffer->screen_rect = xform.xform(ci->copy_back_buffer->rect).clip(p_clip_rect); + } + + if ((!ci->commands.empty() && p_clip_rect.intersects(global_rect)) || ci->vp_render || ci->copy_back_buffer) { + //something to draw? + ci->final_transform=xform; + ci->final_modulate=Color(modulate.r*ci->self_modulate.r, modulate.g*ci->self_modulate.g, modulate.b*ci->self_modulate.b, modulate.a*ci->self_modulate.a ); + ci->global_rect_cache=global_rect; + ci->global_rect_cache.pos-=p_clip_rect.pos; + ci->light_masked=false; + + int zidx = p_z-VS::CANVAS_ITEM_Z_MIN; + + if (z_last_list[zidx]) { + z_last_list[zidx]->next=ci; + z_last_list[zidx]=ci; + + } else { + z_list[zidx]=ci; + z_last_list[zidx]=ci; + } + + ci->next=NULL; + + } + + for(int i=0;i<child_item_count;i++) { + + if (child_items[i]->behind) + continue; + _render_canvas_item(child_items[i],xform,p_clip_rect,modulate,p_z,z_list,z_last_list,(Item*)ci->final_clip_owner,p_material_owner); + } + +} + +void VisualServerCanvas::_light_mask_canvas_items(int p_z,RasterizerCanvas::Item *p_canvas_item,RasterizerCanvas::Light *p_masked_lights) { + + if (!p_masked_lights) + return; + + RasterizerCanvas::Item *ci=p_canvas_item; + + while(ci) { + + RasterizerCanvas::Light *light=p_masked_lights; + while(light) { + + if (ci->light_mask&light->item_mask && p_z>=light->z_min && p_z<=light->z_max && ci->global_rect_cache.intersects_transformed(light->xform_cache,light->rect_cache)) { + ci->light_masked=true; + } + + light=light->mask_next_ptr; + } + + ci=ci->next; + } + + + + +} + +void VisualServerCanvas::render_canvas(Canvas *p_canvas, const Transform2D &p_transform, RasterizerCanvas::Light *p_lights, RasterizerCanvas::Light *p_masked_lights, const Rect2 &p_clip_rect) { + + VSG::canvas_render->canvas_begin(); + + int l = p_canvas->child_items.size(); + Canvas::ChildItem *ci=p_canvas->child_items.ptr(); + + bool has_mirror=false; + for(int i=0;i<l;i++) { + if (ci[i].mirror.x || ci[i].mirror.y) { + has_mirror=true; + break; + } + } + + + if (!has_mirror) { + + static const int z_range = VS::CANVAS_ITEM_Z_MAX-VS::CANVAS_ITEM_Z_MIN+1; + RasterizerCanvas::Item *z_list[z_range]; + RasterizerCanvas::Item *z_last_list[z_range]; + + for(int i=0;i<z_range;i++) { + z_list[i]=NULL; + z_last_list[i]=NULL; + } + for(int i=0;i<l;i++) { + _render_canvas_item(ci[i].item,p_transform,p_clip_rect,Color(1,1,1,1),0,z_list,z_last_list,NULL,NULL); + } + + for(int i=0;i<z_range;i++) { + if (!z_list[i]) + continue; + + if (p_masked_lights) { + _light_mask_canvas_items(VS::CANVAS_ITEM_Z_MIN+i,z_list[i],p_masked_lights); + } + + VSG::canvas_render->canvas_render_items(z_list[i],VS::CANVAS_ITEM_Z_MIN+i,p_canvas->modulate,p_lights); + } + } else { + + for(int i=0;i<l;i++) { + + Canvas::ChildItem& ci=p_canvas->child_items[i]; + _render_canvas_item_tree(ci.item,p_transform,p_clip_rect,p_canvas->modulate,p_lights); + + //mirroring (useful for scrolling backgrounds) + if (ci.mirror.x!=0) { + + Transform2D xform2 = p_transform * Transform2D(0,Vector2(ci.mirror.x,0)); + _render_canvas_item_tree(ci.item,xform2,p_clip_rect,p_canvas->modulate,p_lights); + } + if (ci.mirror.y!=0) { + + Transform2D xform2 = p_transform * Transform2D(0,Vector2(0,ci.mirror.y)); + _render_canvas_item_tree(ci.item,xform2,p_clip_rect,p_canvas->modulate,p_lights); + } + if (ci.mirror.y!=0 && ci.mirror.x!=0) { + + Transform2D xform2 = p_transform * Transform2D(0,ci.mirror); + _render_canvas_item_tree(ci.item,xform2,p_clip_rect,p_canvas->modulate,p_lights); + } + + } + } + +} + + +RID VisualServerCanvas::canvas_create() { + + Canvas * canvas = memnew( Canvas ); + ERR_FAIL_COND_V(!canvas,RID()); + RID rid = canvas_owner.make_rid( canvas ); + + return rid; +} + +void VisualServerCanvas::canvas_set_item_mirroring(RID p_canvas,RID p_item,const Point2& p_mirroring) { + + Canvas * canvas = canvas_owner.getornull(p_canvas); + ERR_FAIL_COND(!canvas); + Item *canvas_item = canvas_item_owner.getornull(p_item); + ERR_FAIL_COND(!canvas_item); + + int idx = canvas->find_item(canvas_item); + ERR_FAIL_COND(idx==-1); + canvas->child_items[idx].mirror=p_mirroring; + +} +void VisualServerCanvas::canvas_set_modulate(RID p_canvas,const Color& p_color) { + + Canvas * canvas = canvas_owner.get(p_canvas); + ERR_FAIL_COND(!canvas); + canvas->modulate=p_color; +} + + +RID VisualServerCanvas::canvas_item_create() { + + Item *canvas_item = memnew( Item ); + ERR_FAIL_COND_V(!canvas_item,RID()); + + return canvas_item_owner.make_rid( canvas_item ); +} + +void VisualServerCanvas::canvas_item_set_parent(RID p_item,RID p_parent) { + + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + if (canvas_item->parent.is_valid()) { + + if (canvas_owner.owns(canvas_item->parent)) { + + Canvas *canvas = canvas_owner.get(canvas_item->parent); + canvas->erase_item(canvas_item); + } else if (canvas_item_owner.owns(canvas_item->parent)) { + + Item *item_owner = canvas_item_owner.get(canvas_item->parent); + item_owner->child_items.erase(canvas_item); + } + + canvas_item->parent=RID(); + } + + + if (p_parent.is_valid()) { + if (canvas_owner.owns(p_parent)) { + + Canvas *canvas = canvas_owner.get(p_parent); + Canvas::ChildItem ci; + ci.item=canvas_item; + canvas->child_items.push_back(ci); + canvas->children_order_dirty=true; + } else if (canvas_item_owner.owns(p_parent)) { + + Item *item_owner = canvas_item_owner.get(p_parent); + item_owner->child_items.push_back(canvas_item); + item_owner->children_order_dirty=true; + + } else { + + ERR_EXPLAIN("Invalid parent"); + ERR_FAIL(); + } + + + } + + canvas_item->parent=p_parent; + + +} +void VisualServerCanvas::canvas_item_set_visible(RID p_item,bool p_visible){ + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + canvas_item->visible=p_visible; + +} +void VisualServerCanvas::canvas_item_set_light_mask(RID p_item,int p_mask){ + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + canvas_item->light_mask=p_mask; + +} + +void VisualServerCanvas::canvas_item_set_transform(RID p_item, const Transform2D& p_transform){ + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + canvas_item->xform=p_transform; + +} +void VisualServerCanvas::canvas_item_set_clip(RID p_item, bool p_clip){ + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + canvas_item->clip=p_clip; + +} +void VisualServerCanvas::canvas_item_set_distance_field_mode(RID p_item, bool p_enable){ + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + canvas_item->distance_field=p_enable; + + +} +void VisualServerCanvas::canvas_item_set_custom_rect(RID p_item, bool p_custom_rect,const Rect2& p_rect){ + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + canvas_item->custom_rect=p_custom_rect; + canvas_item->rect=p_rect; + +} +void VisualServerCanvas::canvas_item_set_modulate(RID p_item, const Color& p_color) { + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + canvas_item->modulate=p_color; + +} +void VisualServerCanvas::canvas_item_set_self_modulate(RID p_item, const Color& p_color){ + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + canvas_item->self_modulate=p_color; + +} + +void VisualServerCanvas::canvas_item_set_draw_behind_parent(RID p_item, bool p_enable){ + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + canvas_item->behind=p_enable; + +} + + +void VisualServerCanvas::canvas_item_add_line(RID p_item, const Point2& p_from, const Point2& p_to,const Color& p_color,float p_width,bool p_antialiased) { + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + Item::CommandLine * line = memnew( Item::CommandLine ); + ERR_FAIL_COND(!line); + line->color=p_color; + line->from=p_from; + line->to=p_to; + line->width=p_width; + line->antialiased=p_antialiased; + canvas_item->rect_dirty=true; + + + canvas_item->commands.push_back(line); +} + +void VisualServerCanvas::canvas_item_add_rect(RID p_item, const Rect2& p_rect, const Color& p_color) { + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + Item::CommandRect * rect = memnew( Item::CommandRect ); + ERR_FAIL_COND(!rect); + rect->modulate=p_color; + rect->rect=p_rect; + canvas_item->rect_dirty=true; + + canvas_item->commands.push_back(rect); +} + +void VisualServerCanvas::canvas_item_add_circle(RID p_item, const Point2& p_pos, float p_radius,const Color& p_color) { + + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + Item::CommandCircle * circle = memnew( Item::CommandCircle ); + ERR_FAIL_COND(!circle); + circle->color=p_color; + circle->pos=p_pos; + circle->radius=p_radius; + + canvas_item->commands.push_back(circle); + +} + +void VisualServerCanvas::canvas_item_add_texture_rect(RID p_item, const Rect2& p_rect, RID p_texture,bool p_tile,const Color& p_modulate,bool p_transpose) { + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + Item::CommandRect * rect = memnew( Item::CommandRect ); + ERR_FAIL_COND(!rect); + rect->modulate=p_modulate; + rect->rect=p_rect; + rect->flags=0; + if (p_tile) { + rect->flags|=RasterizerCanvas::CANVAS_RECT_TILE; + rect->flags|=RasterizerCanvas::CANVAS_RECT_REGION; + rect->source=Rect2(0,0,p_rect.size.width,p_rect.size.height); + } + + if (p_rect.size.x<0) { + + rect->flags|=RasterizerCanvas::CANVAS_RECT_FLIP_H; + rect->rect.size.x = -rect->rect.size.x; + } + if (p_rect.size.y<0) { + + rect->flags|=RasterizerCanvas::CANVAS_RECT_FLIP_V; + rect->rect.size.y = -rect->rect.size.y; + } + if (p_transpose) { + rect->flags|=RasterizerCanvas::CANVAS_RECT_TRANSPOSE; + SWAP(rect->rect.size.x, rect->rect.size.y); + } + rect->texture=p_texture; + canvas_item->rect_dirty=true; + canvas_item->commands.push_back(rect); +} + +void VisualServerCanvas::canvas_item_add_texture_rect_region(RID p_item, const Rect2& p_rect, RID p_texture,const Rect2& p_src_rect,const Color& p_modulate,bool p_transpose) { + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + Item::CommandRect * rect = memnew( Item::CommandRect ); + ERR_FAIL_COND(!rect); + rect->modulate=p_modulate; + rect->rect=p_rect; + rect->texture=p_texture; + rect->source=p_src_rect; + rect->flags=RasterizerCanvas::CANVAS_RECT_REGION; + + if (p_rect.size.x<0) { + + rect->flags|=RasterizerCanvas::CANVAS_RECT_FLIP_H; + rect->rect.size.x = -rect->rect.size.x; + } + if (p_rect.size.y<0) { + + rect->flags|=RasterizerCanvas::CANVAS_RECT_FLIP_V; + rect->rect.size.y = -rect->rect.size.y; + } + if (p_transpose) { + rect->flags|=RasterizerCanvas::CANVAS_RECT_TRANSPOSE; + SWAP(rect->rect.size.x, rect->rect.size.y); + } + + canvas_item->rect_dirty=true; + + canvas_item->commands.push_back(rect); + +} + +void VisualServerCanvas::canvas_item_add_nine_patch(RID p_item, const Rect2& p_rect, const Rect2& p_source, RID p_texture,const Vector2& p_topleft, const Vector2& p_bottomright,VS::NinePatchAxisMode p_x_axis_mode, VS::NinePatchAxisMode p_y_axis_mode,bool p_draw_center,const Color& p_modulate) { + + + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + Item::CommandNinePatch * style = memnew( Item::CommandNinePatch ); + ERR_FAIL_COND(!style); + style->texture=p_texture; + style->rect=p_rect; + style->source=p_source; + style->draw_center=p_draw_center; + style->color=p_modulate; + style->margin[MARGIN_LEFT]=p_topleft.x; + style->margin[MARGIN_TOP]=p_topleft.y; + style->margin[MARGIN_RIGHT]=p_bottomright.x; + style->margin[MARGIN_BOTTOM]=p_bottomright.y; + style->axis_x=p_x_axis_mode; + style->axis_y=p_y_axis_mode; + canvas_item->rect_dirty=true; + + canvas_item->commands.push_back(style); +} +void VisualServerCanvas::canvas_item_add_primitive(RID p_item,const Vector<Point2>& p_points, const Vector<Color>& p_colors,const Vector<Point2>& p_uvs, RID p_texture,float p_width) { + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + Item::CommandPrimitive * prim = memnew( Item::CommandPrimitive ); + ERR_FAIL_COND(!prim); + prim->texture=p_texture; + prim->points=p_points; + prim->uvs=p_uvs; + prim->colors=p_colors; + prim->width=p_width; + canvas_item->rect_dirty=true; + + canvas_item->commands.push_back(prim); +} + +void VisualServerCanvas::canvas_item_add_polygon(RID p_item, const Vector<Point2>& p_points, const Vector<Color>& p_colors,const Vector<Point2>& p_uvs, RID p_texture) { + + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); +#ifdef DEBUG_ENABLED + int pointcount = p_points.size(); + ERR_FAIL_COND(pointcount<3); + int color_size=p_colors.size(); + int uv_size=p_uvs.size(); + ERR_FAIL_COND(color_size!=0 && color_size!=1 && color_size!=pointcount); + ERR_FAIL_COND(uv_size!=0 && (uv_size!=pointcount || !p_texture.is_valid())); +#endif + Vector<int> indices = Geometry::triangulate_polygon(p_points); + + if (indices.empty()) { + + ERR_EXPLAIN("Bad Polygon!"); + ERR_FAIL_V(); + } + + Item::CommandPolygon * polygon = memnew( Item::CommandPolygon ); + ERR_FAIL_COND(!polygon); + polygon->texture=p_texture; + polygon->points=p_points; + polygon->uvs=p_uvs; + polygon->colors=p_colors; + polygon->indices=indices; + polygon->count=indices.size(); + canvas_item->rect_dirty=true; + + canvas_item->commands.push_back(polygon); + +} + + +void VisualServerCanvas::canvas_item_add_triangle_array(RID p_item, const Vector<int>& p_indices, const Vector<Point2>& p_points, const Vector<Color>& p_colors,const Vector<Point2>& p_uvs, RID p_texture, int p_count) { + + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + int ps = p_points.size(); + ERR_FAIL_COND(!p_colors.empty() && p_colors.size()!=ps && p_colors.size()!=1); + ERR_FAIL_COND(!p_uvs.empty() && p_uvs.size()!=ps); + + Vector<int> indices = p_indices; + + int count = p_count * 3; + + if (indices.empty()) { + + ERR_FAIL_COND( ps % 3 != 0 ); + if (p_count == -1) + count = ps; + } else { + + ERR_FAIL_COND( indices.size() % 3 != 0 ); + if (p_count == -1) + count = indices.size(); + } + + Item::CommandPolygon * polygon = memnew( Item::CommandPolygon ); + ERR_FAIL_COND(!polygon); + polygon->texture=p_texture; + polygon->points=p_points; + polygon->uvs=p_uvs; + polygon->colors=p_colors; + polygon->indices=indices; + polygon->count = count; + canvas_item->rect_dirty=true; + + canvas_item->commands.push_back(polygon); +} + + +void VisualServerCanvas::canvas_item_add_set_transform(RID p_item,const Transform2D& p_transform) { + + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + Item::CommandTransform * tr = memnew( Item::CommandTransform ); + ERR_FAIL_COND(!tr); + tr->xform=p_transform; + + canvas_item->commands.push_back(tr); + +} + +void VisualServerCanvas::canvas_item_add_mesh(RID p_item, const RID& p_mesh,RID p_skeleton){ + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + Item::CommandMesh * m = memnew( Item::CommandMesh ); + ERR_FAIL_COND(!m); + m->mesh=p_mesh; + m->skeleton=p_skeleton; + + canvas_item->commands.push_back(m); +} +void VisualServerCanvas::canvas_item_add_multimesh(RID p_item, RID p_mesh,RID p_skeleton){ + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + Item::CommandMultiMesh * mm = memnew( Item::CommandMultiMesh ); + ERR_FAIL_COND(!mm); + mm->multimesh=p_mesh; + mm->skeleton=p_skeleton; + + canvas_item->commands.push_back(mm); + +} + +void VisualServerCanvas::canvas_item_add_clip_ignore(RID p_item, bool p_ignore){ + + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + Item::CommandClipIgnore * ci = memnew( Item::CommandClipIgnore); + ERR_FAIL_COND(!ci); + ci->ignore=p_ignore; + + canvas_item->commands.push_back(ci); +} +void VisualServerCanvas::canvas_item_set_sort_children_by_y(RID p_item, bool p_enable){ + + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + canvas_item->sort_y=p_enable; +} +void VisualServerCanvas::canvas_item_set_z(RID p_item, int p_z){ + + ERR_FAIL_COND(p_z<VS::CANVAS_ITEM_Z_MIN || p_z>VS::CANVAS_ITEM_Z_MAX); + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + canvas_item->z=p_z; +} +void VisualServerCanvas::canvas_item_set_z_as_relative_to_parent(RID p_item, bool p_enable){ + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + canvas_item->z_relative=p_enable; + +} +void VisualServerCanvas::canvas_item_set_copy_to_backbuffer(RID p_item, bool p_enable,const Rect2& p_rect){ + + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + if (bool(canvas_item->copy_back_buffer!=NULL) !=p_enable) { + if (p_enable) { + canvas_item->copy_back_buffer = memnew( RasterizerCanvas::Item::CopyBackBuffer ); + } else { + memdelete(canvas_item->copy_back_buffer); + canvas_item->copy_back_buffer=NULL; + } + } + + if (p_enable) { + canvas_item->copy_back_buffer->rect=p_rect; + canvas_item->copy_back_buffer->full=p_rect==Rect2(); + } + +} + +void VisualServerCanvas::canvas_item_clear(RID p_item){ + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + canvas_item->clear(); +} +void VisualServerCanvas::canvas_item_set_draw_index(RID p_item,int p_index){ + + Item *canvas_item = canvas_item_owner.getornull( p_item ); + ERR_FAIL_COND(!canvas_item); + + canvas_item->index=p_index; + + if (canvas_item_owner.owns( canvas_item->parent)) { + Item *canvas_item_parent = canvas_item_owner.getornull( canvas_item->parent ); + canvas_item_parent->children_order_dirty=true; + return; + } + + Canvas* canvas = canvas_owner.getornull( canvas_item->parent ); + if (canvas) { + canvas->children_order_dirty=true; + return; + } + +} + +void VisualServerCanvas::canvas_item_set_material(RID p_item, RID p_material){ + + Item *canvas_item = canvas_item_owner.get( p_item ); + ERR_FAIL_COND(!canvas_item); + + canvas_item->material=p_material; +} + +void VisualServerCanvas::canvas_item_set_use_parent_material(RID p_item, bool p_enable){ + + Item *canvas_item = canvas_item_owner.get( p_item ); + ERR_FAIL_COND(!canvas_item); + + canvas_item->use_parent_material=p_enable; + +} + +RID VisualServerCanvas::canvas_light_create(){ + + RasterizerCanvas::Light *clight = memnew( RasterizerCanvas::Light ); + clight->light_internal = VSG::canvas_render->light_internal_create(); + return canvas_light_owner.make_rid(clight); + +} +void VisualServerCanvas::canvas_light_attach_to_canvas(RID p_light,RID p_canvas){ + + RasterizerCanvas::Light *clight = canvas_light_owner.get(p_light); + ERR_FAIL_COND(!clight); + + if (clight->canvas.is_valid()) { + + Canvas *canvas = canvas_owner.getornull(clight->canvas); + canvas->lights.erase(clight); + } + + if (!canvas_owner.owns(p_canvas)) + p_canvas=RID(); + + clight->canvas=p_canvas; + + if (clight->canvas.is_valid()) { + + Canvas *canvas = canvas_owner.get(clight->canvas); + canvas->lights.insert(clight); + } +} + + +void VisualServerCanvas::canvas_light_set_enabled(RID p_light, bool p_enabled){ + + RasterizerCanvas::Light *clight = canvas_light_owner.get(p_light); + ERR_FAIL_COND(!clight); + + clight->enabled=p_enabled; + +} +void VisualServerCanvas::canvas_light_set_scale(RID p_light, float p_scale){ + + + RasterizerCanvas::Light *clight = canvas_light_owner.get(p_light); + ERR_FAIL_COND(!clight); + + clight->scale=p_scale; + +} +void VisualServerCanvas::canvas_light_set_transform(RID p_light, const Transform2D& p_transform){ + + + RasterizerCanvas::Light *clight = canvas_light_owner.get(p_light); + ERR_FAIL_COND(!clight); + + clight->xform=p_transform; + +} +void VisualServerCanvas::canvas_light_set_texture(RID p_light, RID p_texture){ + + + RasterizerCanvas::Light *clight = canvas_light_owner.get(p_light); + ERR_FAIL_COND(!clight); + + clight->texture=p_texture; + +} +void VisualServerCanvas::canvas_light_set_texture_offset(RID p_light, const Vector2& p_offset){ + + + RasterizerCanvas::Light *clight = canvas_light_owner.get(p_light); + ERR_FAIL_COND(!clight); + + clight->texture_offset=p_offset; + +} +void VisualServerCanvas::canvas_light_set_color(RID p_light, const Color& p_color){ + + + + RasterizerCanvas::Light *clight = canvas_light_owner.get(p_light); + ERR_FAIL_COND(!clight); + + clight->color=p_color; +} +void VisualServerCanvas::canvas_light_set_height(RID p_light, float p_height){ + + + RasterizerCanvas::Light *clight = canvas_light_owner.get(p_light); + ERR_FAIL_COND(!clight); + + clight->height=p_height; + +} +void VisualServerCanvas::canvas_light_set_energy(RID p_light, float p_energy){ + + + RasterizerCanvas::Light *clight = canvas_light_owner.get(p_light); + ERR_FAIL_COND(!clight); + + clight->energy=p_energy; + +} +void VisualServerCanvas::canvas_light_set_z_range(RID p_light, int p_min_z,int p_max_z){ + + + RasterizerCanvas::Light *clight = canvas_light_owner.get(p_light); + ERR_FAIL_COND(!clight); + + clight->z_min=p_min_z; + clight->z_max=p_max_z; + +} +void VisualServerCanvas::canvas_light_set_layer_range(RID p_light, int p_min_layer,int p_max_layer){ + + + RasterizerCanvas::Light *clight = canvas_light_owner.get(p_light); + ERR_FAIL_COND(!clight); + + + clight->layer_max=p_max_layer; + clight->layer_min=p_min_layer; + + +} +void VisualServerCanvas::canvas_light_set_item_cull_mask(RID p_light, int p_mask){ + + + RasterizerCanvas::Light *clight = canvas_light_owner.get(p_light); + ERR_FAIL_COND(!clight); + + clight->item_mask=p_mask; + +} +void VisualServerCanvas::canvas_light_set_item_shadow_cull_mask(RID p_light, int p_mask){ + + RasterizerCanvas::Light *clight = canvas_light_owner.get(p_light); + ERR_FAIL_COND(!clight); + + clight->item_shadow_mask=p_mask; + +} +void VisualServerCanvas::canvas_light_set_mode(RID p_light, VS::CanvasLightMode p_mode){ + + RasterizerCanvas::Light *clight = canvas_light_owner.get(p_light); + ERR_FAIL_COND(!clight); + + clight->mode=p_mode; + +} + + +void VisualServerCanvas::canvas_light_set_shadow_enabled(RID p_light, bool p_enabled){ + + RasterizerCanvas::Light *clight = canvas_light_owner.get(p_light); + ERR_FAIL_COND(!clight); + + if (clight->shadow_buffer.is_valid()==p_enabled) + return; + if (p_enabled) { + clight->shadow_buffer=VSG::storage->canvas_light_shadow_buffer_create(clight->shadow_buffer_size); + } else { + VSG::storage->free(clight->shadow_buffer); + clight->shadow_buffer=RID(); + } + +} +void VisualServerCanvas::canvas_light_set_shadow_buffer_size(RID p_light, int p_size){ + + ERR_FAIL_COND(p_size<32 || p_size>16384); + + RasterizerCanvas::Light *clight = canvas_light_owner.get(p_light); + ERR_FAIL_COND(!clight); + + int new_size = nearest_power_of_2(p_size);; + if (new_size==clight->shadow_buffer_size) + return; + + clight->shadow_buffer_size=nearest_power_of_2(p_size); + + if (clight->shadow_buffer.is_valid()) { + VSG::storage->free(clight->shadow_buffer); + clight->shadow_buffer=VSG::storage->canvas_light_shadow_buffer_create(clight->shadow_buffer_size); + } +} + +void VisualServerCanvas::canvas_light_set_shadow_gradient_length(RID p_light, float p_length) { + + ERR_FAIL_COND(p_length<0); + + RasterizerCanvas::Light *clight = canvas_light_owner.get(p_light); + ERR_FAIL_COND(!clight); + + clight->shadow_gradient_length=p_length; + +} +void VisualServerCanvas::canvas_light_set_shadow_filter(RID p_light, VS::CanvasLightShadowFilter p_filter) { + + RasterizerCanvas::Light *clight = canvas_light_owner.get(p_light); + ERR_FAIL_COND(!clight); + + clight->shadow_filter=p_filter; + +} +void VisualServerCanvas::canvas_light_set_shadow_color(RID p_light, const Color& p_color) { + + RasterizerCanvas::Light *clight = canvas_light_owner.get(p_light); + ERR_FAIL_COND(!clight); + + clight->shadow_color=p_color; +} + + + +RID VisualServerCanvas::canvas_light_occluder_create() { + + RasterizerCanvas::LightOccluderInstance *occluder = memnew( RasterizerCanvas::LightOccluderInstance ); + + return canvas_light_occluder_owner.make_rid(occluder); +} +void VisualServerCanvas::canvas_light_occluder_attach_to_canvas(RID p_occluder,RID p_canvas){ + + RasterizerCanvas::LightOccluderInstance *occluder = canvas_light_occluder_owner.get(p_occluder); + ERR_FAIL_COND(!occluder); + + if (occluder->canvas.is_valid()) { + + Canvas *canvas = canvas_owner.get(occluder->canvas); + canvas->occluders.erase(occluder); + } + + if (!canvas_owner.owns(p_canvas)) + p_canvas=RID(); + + occluder->canvas=p_canvas; + + if (occluder->canvas.is_valid()) { + + Canvas *canvas = canvas_owner.get(occluder->canvas); + canvas->occluders.insert(occluder); + } +} +void VisualServerCanvas::canvas_light_occluder_set_enabled(RID p_occluder,bool p_enabled) { + + RasterizerCanvas::LightOccluderInstance *occluder = canvas_light_occluder_owner.get(p_occluder); + ERR_FAIL_COND(!occluder); + + occluder->enabled=p_enabled; +} +void VisualServerCanvas::canvas_light_occluder_set_polygon(RID p_occluder,RID p_polygon) { + + RasterizerCanvas::LightOccluderInstance *occluder = canvas_light_occluder_owner.get(p_occluder); + ERR_FAIL_COND(!occluder); + + if (occluder->polygon.is_valid()) { + LightOccluderPolygon *occluder_poly = canvas_light_occluder_polygon_owner.get(p_polygon); + if (occluder_poly) { + occluder_poly->owners.erase(occluder); + } + } + + occluder->polygon=p_polygon; + occluder->polygon_buffer=RID(); + + if (occluder->polygon.is_valid()) { + LightOccluderPolygon *occluder_poly = canvas_light_occluder_polygon_owner.get(p_polygon); + if (!occluder_poly) + occluder->polygon=RID(); + ERR_FAIL_COND(!occluder_poly); + occluder_poly->owners.insert(occluder); + occluder->polygon_buffer=occluder_poly->occluder; + occluder->aabb_cache=occluder_poly->aabb; + occluder->cull_cache=occluder_poly->cull_mode; + } + +} +void VisualServerCanvas::canvas_light_occluder_set_transform(RID p_occluder,const Transform2D& p_xform) { + + RasterizerCanvas::LightOccluderInstance *occluder = canvas_light_occluder_owner.get(p_occluder); + ERR_FAIL_COND(!occluder); + + occluder->xform=p_xform; +} +void VisualServerCanvas::canvas_light_occluder_set_light_mask(RID p_occluder,int p_mask) { + + RasterizerCanvas::LightOccluderInstance *occluder = canvas_light_occluder_owner.get(p_occluder); + ERR_FAIL_COND(!occluder); + + occluder->light_mask=p_mask; +} + +RID VisualServerCanvas::canvas_occluder_polygon_create() { + + LightOccluderPolygon * occluder_poly = memnew( LightOccluderPolygon ); + occluder_poly->occluder=VSG::storage->canvas_light_occluder_create(); + return canvas_light_occluder_polygon_owner.make_rid(occluder_poly); + +} +void VisualServerCanvas::canvas_occluder_polygon_set_shape(RID p_occluder_polygon,const PoolVector<Vector2>& p_shape,bool p_closed) { + + if (p_shape.size()<3) { + canvas_occluder_polygon_set_shape_as_lines(p_occluder_polygon,p_shape); + return; + } + + PoolVector<Vector2> lines; + int lc = p_shape.size()*2; + + lines.resize(lc-(p_closed?0:2)); + { + PoolVector<Vector2>::Write w = lines.write(); + PoolVector<Vector2>::Read r = p_shape.read(); + + int max=lc/2; + if (!p_closed) { + max--; + } + for(int i=0;i<max;i++) { + + Vector2 a = r[i]; + Vector2 b = r[(i+1)%(lc/2)]; + w[i*2+0]=a; + w[i*2+1]=b; + } + + } + + canvas_occluder_polygon_set_shape_as_lines(p_occluder_polygon,lines); +} +void VisualServerCanvas::canvas_occluder_polygon_set_shape_as_lines(RID p_occluder_polygon,const PoolVector<Vector2>& p_shape) { + + LightOccluderPolygon * occluder_poly = canvas_light_occluder_polygon_owner.get(p_occluder_polygon); + ERR_FAIL_COND(!occluder_poly); + ERR_FAIL_COND(p_shape.size()&1); + + int lc = p_shape.size(); + occluder_poly->aabb=Rect2(); + { + PoolVector<Vector2>::Read r = p_shape.read(); + for(int i=0;i<lc;i++) { + if (i==0) + occluder_poly->aabb.pos=r[i]; + else + occluder_poly->aabb.expand_to(r[i]); + } + } + + VSG::storage->canvas_light_occluder_set_polylines(occluder_poly->occluder,p_shape); + for( Set<RasterizerCanvas::LightOccluderInstance*>::Element *E=occluder_poly->owners.front();E;E=E->next()) { + E->get()->aabb_cache=occluder_poly->aabb; + } +} + + +void VisualServerCanvas::canvas_occluder_polygon_set_cull_mode(RID p_occluder_polygon,VS::CanvasOccluderPolygonCullMode p_mode) { + + LightOccluderPolygon * occluder_poly = canvas_light_occluder_polygon_owner.get(p_occluder_polygon); + ERR_FAIL_COND(!occluder_poly); + occluder_poly->cull_mode=p_mode; + for( Set<RasterizerCanvas::LightOccluderInstance*>::Element *E=occluder_poly->owners.front();E;E=E->next()) { + E->get()->cull_cache=p_mode; + } +} + + + +bool VisualServerCanvas::free(RID p_rid) { + + if (canvas_owner.owns(p_rid)) { + + Canvas *canvas = canvas_owner.get(p_rid); + ERR_FAIL_COND_V(!canvas,false); + + while(canvas->viewports.size()) { + + VisualServerViewport::Viewport *vp = VSG::viewport->viewport_owner.get(canvas->viewports.front()->get()); + ERR_FAIL_COND_V(!vp,true); + + Map<RID,VisualServerViewport::Viewport::CanvasData>::Element *E=vp->canvas_map.find(p_rid); + ERR_FAIL_COND_V(!E,true); + vp->canvas_map.erase(p_rid); + + canvas->viewports.erase( canvas->viewports.front() ); + } + + for (int i=0;i<canvas->child_items.size();i++) { + + canvas->child_items[i].item->parent=RID(); + } + + for (Set<RasterizerCanvas::Light*>::Element *E=canvas->lights.front();E;E=E->next()) { + + E->get()->canvas=RID(); + } + + for (Set<RasterizerCanvas::LightOccluderInstance*>::Element *E=canvas->occluders.front();E;E=E->next()) { + + E->get()->canvas=RID(); + } + + canvas_owner.free( p_rid ); + + memdelete( canvas ); + + } else if (canvas_item_owner.owns(p_rid)) { + + Item *canvas_item = canvas_item_owner.get(p_rid); + ERR_FAIL_COND_V(!canvas_item,true); + + if (canvas_item->parent.is_valid()) { + + if (canvas_owner.owns(canvas_item->parent)) { + + Canvas *canvas = canvas_owner.get(canvas_item->parent); + canvas->erase_item(canvas_item); + } else if (canvas_item_owner.owns(canvas_item->parent)) { + + Item *item_owner = canvas_item_owner.get(canvas_item->parent); + item_owner->child_items.erase(canvas_item); + + } + } + + for (int i=0;i<canvas_item->child_items.size();i++) { + + canvas_item->child_items[i]->parent=RID(); + } + +// if (canvas_item->material) { +// canvas_item->material->owners.erase(canvas_item); +// } + + canvas_item_owner.free( p_rid ); + + memdelete( canvas_item ); + + } else if (canvas_light_owner.owns(p_rid)) { + + RasterizerCanvas::Light *canvas_light = canvas_light_owner.get(p_rid); + ERR_FAIL_COND_V(!canvas_light,true); + + if (canvas_light->canvas.is_valid()) { + Canvas* canvas = canvas_owner.get(canvas_light->canvas); + if (canvas) + canvas->lights.erase(canvas_light); + } + + if (canvas_light->shadow_buffer.is_valid()) + VSG::storage->free(canvas_light->shadow_buffer); + + VSG::canvas_render->light_internal_free(canvas_light->light_internal); + + canvas_light_owner.free( p_rid ); + memdelete( canvas_light ); + + } else if (canvas_light_occluder_owner.owns(p_rid)) { + + RasterizerCanvas::LightOccluderInstance *occluder = canvas_light_occluder_owner.get(p_rid); + ERR_FAIL_COND_V(!occluder,true); + + if (occluder->polygon.is_valid()) { + + LightOccluderPolygon *occluder_poly = canvas_light_occluder_polygon_owner.get(occluder->polygon); + if (occluder_poly) { + occluder_poly->owners.erase(occluder); + } + + } + + if (occluder->canvas.is_valid() && canvas_owner.owns(occluder->canvas)) { + + Canvas *canvas = canvas_owner.get(occluder->canvas); + canvas->occluders.erase(occluder); + + } + + canvas_light_occluder_owner.free( p_rid ); + memdelete(occluder); + + } else if (canvas_light_occluder_polygon_owner.owns(p_rid)) { + + LightOccluderPolygon *occluder_poly = canvas_light_occluder_polygon_owner.get(p_rid); + ERR_FAIL_COND_V(!occluder_poly,true); + VSG::storage->free(occluder_poly->occluder); + + while(occluder_poly->owners.size()) { + + occluder_poly->owners.front()->get()->polygon=RID(); + occluder_poly->owners.erase( occluder_poly->owners.front() ); + } + + canvas_light_occluder_polygon_owner.free( p_rid ); + memdelete(occluder_poly); + } else { + return false; + } + + return true; +} + + + +VisualServerCanvas::VisualServerCanvas() +{ + +} diff --git a/servers/visual/visual_server_canvas.h b/servers/visual/visual_server_canvas.h new file mode 100644 index 0000000000..035c48d9ef --- /dev/null +++ b/servers/visual/visual_server_canvas.h @@ -0,0 +1,217 @@ +#ifndef VISUALSERVERCANVAS_H +#define VISUALSERVERCANVAS_H + +#include "rasterizer.h" +#include "visual_server_viewport.h" + +class VisualServerCanvas { +public: + + + struct Item : public RasterizerCanvas::Item { + + + RID parent; // canvas it belongs to + List<Item*>::Element *E; + int z; + bool z_relative; + bool sort_y; + Color modulate; + Color self_modulate; + bool use_parent_material; + int index; + bool children_order_dirty; + + + Vector<Item*> child_items; + + + Item() { + children_order_dirty=true; + E=NULL; + z=0; + modulate=Color(1,1,1,1); + self_modulate=Color(1,1,1,1); + sort_y=false; + use_parent_material=false; + z_relative=true; + index=0; + } + }; + + + struct ItemPtrSort { + + _FORCE_INLINE_ bool operator()(const Item* p_left,const Item* p_right) const { + + if(Math::abs(p_left->xform.elements[2].y - p_right->xform.elements[2].y) < CMP_EPSILON ) + return p_left->xform.elements[2].x < p_right->xform.elements[2].x; + else + return p_left->xform.elements[2].y < p_right->xform.elements[2].y; + } + }; + + struct LightOccluderPolygon : RID_Data { + + bool active; + Rect2 aabb; + VS::CanvasOccluderPolygonCullMode cull_mode; + RID occluder; + Set<RasterizerCanvas::LightOccluderInstance*> owners; + + LightOccluderPolygon() { active=false; cull_mode=VS::CANVAS_OCCLUDER_POLYGON_CULL_DISABLED; } + }; + + + RID_Owner<LightOccluderPolygon> canvas_light_occluder_polygon_owner; + + RID_Owner<RasterizerCanvas::LightOccluderInstance> canvas_light_occluder_owner; + + struct Canvas : public VisualServerViewport::CanvasBase { + + Set<RID> viewports; + struct ChildItem { + + Point2 mirror; + Item *item; + bool operator<(const ChildItem& p_item) const { + return item->index < p_item.item->index; + } + }; + + + + Set<RasterizerCanvas::Light*> lights; + + Set<RasterizerCanvas::LightOccluderInstance*> occluders; + + bool children_order_dirty; + Vector<ChildItem> child_items; + Color modulate; + + int find_item(Item *p_item) { + for(int i=0;i<child_items.size();i++) { + if (child_items[i].item==p_item) + return i; + } + return -1; + } + void erase_item(Item *p_item) { + int idx=find_item(p_item); + if (idx>=0) + child_items.remove(idx); + } + + + Canvas() { modulate=Color(1,1,1,1); children_order_dirty=true; } + + }; + + + RID_Owner<Canvas> canvas_owner; + RID_Owner<Item> canvas_item_owner; + RID_Owner<RasterizerCanvas::Light> canvas_light_owner; + +private: + + void _render_canvas_item_tree(Item *p_canvas_item, const Transform2D& p_transform, const Rect2& p_clip_rect, const Color &p_modulate, RasterizerCanvas::Light *p_lights); + void _render_canvas_item(Item *p_canvas_item, const Transform2D& p_transform, const Rect2& p_clip_rect, const Color &p_modulate, int p_z, RasterizerCanvas::Item **z_list, RasterizerCanvas::Item **z_last_list, Item *p_canvas_clip, Item *p_material_owner); + void _light_mask_canvas_items(int p_z,RasterizerCanvas::Item *p_canvas_item,RasterizerCanvas::Light *p_masked_lights); +public: + + void render_canvas(Canvas *p_canvas, const Transform2D &p_transform, RasterizerCanvas::Light *p_lights, RasterizerCanvas::Light *p_masked_lights,const Rect2& p_clip_rect); + + RID canvas_create(); + void canvas_set_item_mirroring(RID p_canvas,RID p_item,const Point2& p_mirroring); + void canvas_set_modulate(RID p_canvas,const Color& p_color); + + + RID canvas_item_create(); + void canvas_item_set_parent(RID p_item,RID p_parent); + + void canvas_item_set_visible(RID p_item,bool p_visible); + void canvas_item_set_light_mask(RID p_item,int p_mask); + + void canvas_item_set_transform(RID p_item, const Transform2D& p_transform); + void canvas_item_set_clip(RID p_item, bool p_clip); + void canvas_item_set_distance_field_mode(RID p_item, bool p_enable); + void canvas_item_set_custom_rect(RID p_item, bool p_custom_rect,const Rect2& p_rect=Rect2()); + void canvas_item_set_modulate(RID p_item, const Color& p_color); + void canvas_item_set_self_modulate(RID p_item, const Color& p_color); + + void canvas_item_set_draw_behind_parent(RID p_item, bool p_enable); + + + void canvas_item_add_line(RID p_item, const Point2& p_from, const Point2& p_to,const Color& p_color,float p_width=1.0,bool p_antialiased=false); + void canvas_item_add_rect(RID p_item, const Rect2& p_rect, const Color& p_color); + void canvas_item_add_circle(RID p_item, const Point2& p_pos, float p_radius,const Color& p_color); + void canvas_item_add_texture_rect(RID p_item, const Rect2& p_rect, RID p_texture,bool p_tile=false,const Color& p_modulate=Color(1,1,1),bool p_transpose=false); + void canvas_item_add_texture_rect_region(RID p_item, const Rect2& p_rect, RID p_texture,const Rect2& p_src_rect,const Color& p_modulate=Color(1,1,1),bool p_transpose=false); + void canvas_item_add_nine_patch(RID p_item, const Rect2& p_rect, const Rect2& p_source, RID p_texture,const Vector2& p_topleft, const Vector2& p_bottomright,VS::NinePatchAxisMode p_x_axis_mode=VS::NINE_PATCH_STRETCH, VS::NinePatchAxisMode p_y_axis_mode=VS::NINE_PATCH_STRETCH,bool p_draw_center=true,const Color& p_modulate=Color(1,1,1)); + void canvas_item_add_primitive(RID p_item, const Vector<Point2>& p_points, const Vector<Color>& p_colors,const Vector<Point2>& p_uvs, RID p_texture,float p_width=1.0); + void canvas_item_add_polygon(RID p_item, const Vector<Point2>& p_points, const Vector<Color>& p_colors,const Vector<Point2>& p_uvs=Vector<Point2>(), RID p_texture=RID()); + void canvas_item_add_triangle_array(RID p_item, const Vector<int>& p_indices, const Vector<Point2>& p_points, const Vector<Color>& p_colors,const Vector<Point2>& p_uvs=Vector<Point2>(), RID p_texture=RID(), int p_count=-1); + void canvas_item_add_mesh(RID p_item, const RID& p_mesh,RID p_skeleton=RID()); + void canvas_item_add_multimesh(RID p_item, RID p_mesh,RID p_skeleton=RID()); + void canvas_item_add_set_transform(RID p_item,const Transform2D& p_transform); + void canvas_item_add_clip_ignore(RID p_item, bool p_ignore); + void canvas_item_set_sort_children_by_y(RID p_item, bool p_enable); + void canvas_item_set_z(RID p_item, int p_z); + void canvas_item_set_z_as_relative_to_parent(RID p_item, bool p_enable); + void canvas_item_set_copy_to_backbuffer(RID p_item, bool p_enable,const Rect2& p_rect); + + void canvas_item_clear(RID p_item); + void canvas_item_set_draw_index(RID p_item, int p_index); + + void canvas_item_set_material(RID p_item, RID p_material); + + void canvas_item_set_use_parent_material(RID p_item, bool p_enable); + + RID canvas_light_create(); + void canvas_light_attach_to_canvas(RID p_light,RID p_canvas); + void canvas_light_set_enabled(RID p_light, bool p_enabled); + void canvas_light_set_scale(RID p_light, float p_scale); + void canvas_light_set_transform(RID p_light, const Transform2D& p_transform); + void canvas_light_set_texture(RID p_light, RID p_texture); + void canvas_light_set_texture_offset(RID p_light, const Vector2& p_offset); + void canvas_light_set_color(RID p_light, const Color& p_color); + void canvas_light_set_height(RID p_light, float p_height); + void canvas_light_set_energy(RID p_light, float p_energy); + void canvas_light_set_z_range(RID p_light, int p_min_z,int p_max_z); + void canvas_light_set_layer_range(RID p_light, int p_min_layer,int p_max_layer); + void canvas_light_set_item_cull_mask(RID p_light, int p_mask); + void canvas_light_set_item_shadow_cull_mask(RID p_light, int p_mask); + + void canvas_light_set_mode(RID p_light, VS::CanvasLightMode p_mode); + + + void canvas_light_set_shadow_enabled(RID p_light, bool p_enabled); + void canvas_light_set_shadow_buffer_size(RID p_light, int p_size); + void canvas_light_set_shadow_gradient_length(RID p_light, float p_length); + void canvas_light_set_shadow_filter(RID p_light, VS::CanvasLightShadowFilter p_filter); + void canvas_light_set_shadow_color(RID p_light, const Color& p_color); + + + + RID canvas_light_occluder_create(); + void canvas_light_occluder_attach_to_canvas(RID p_occluder,RID p_canvas); + void canvas_light_occluder_set_enabled(RID p_occluder,bool p_enabled); + void canvas_light_occluder_set_polygon(RID p_occluder,RID p_polygon); + void canvas_light_occluder_set_transform(RID p_occluder,const Transform2D& p_xform); + void canvas_light_occluder_set_light_mask(RID p_occluder,int p_mask); + + RID canvas_occluder_polygon_create(); + void canvas_occluder_polygon_set_shape(RID p_occluder_polygon,const PoolVector<Vector2>& p_shape,bool p_closed); + void canvas_occluder_polygon_set_shape_as_lines(RID p_occluder_polygon,const PoolVector<Vector2>& p_shape); + + + void canvas_occluder_polygon_set_cull_mode(RID p_occluder_polygon,VS::CanvasOccluderPolygonCullMode p_mode); + + + bool free(RID p_rid); + VisualServerCanvas(); + + +}; + +#endif // VISUALSERVERCANVAS_H diff --git a/servers/visual/visual_server_global.cpp b/servers/visual/visual_server_global.cpp new file mode 100644 index 0000000000..32b9710f42 --- /dev/null +++ b/servers/visual/visual_server_global.cpp @@ -0,0 +1,10 @@ +#include "visual_server_global.h" + +RasterizerStorage *VisualServerGlobals::storage=NULL; +RasterizerCanvas *VisualServerGlobals::canvas_render=NULL; +RasterizerScene *VisualServerGlobals::scene_render=NULL; +Rasterizer *VisualServerGlobals::rasterizer=NULL; + +VisualServerCanvas *VisualServerGlobals::canvas=NULL; +VisualServerViewport *VisualServerGlobals::viewport=NULL; +VisualServerScene *VisualServerGlobals::scene=NULL; diff --git a/servers/visual/visual_server_global.h b/servers/visual/visual_server_global.h new file mode 100644 index 0000000000..d413334ac4 --- /dev/null +++ b/servers/visual/visual_server_global.h @@ -0,0 +1,26 @@ +#ifndef VISUALSERVERGLOBAL_H +#define VISUALSERVERGLOBAL_H + +#include "rasterizer.h" + +class VisualServerCanvas; +class VisualServerViewport; +class VisualServerScene; + +class VisualServerGlobals +{ +public: + + static RasterizerStorage *storage; + static RasterizerCanvas *canvas_render; + static RasterizerScene *scene_render; + static Rasterizer *rasterizer; + + static VisualServerCanvas *canvas; + static VisualServerViewport *viewport; + static VisualServerScene *scene; +}; + +#define VSG VisualServerGlobals + +#endif // VISUALSERVERGLOBAL_H diff --git a/servers/visual/visual_server_light_baker.cpp b/servers/visual/visual_server_light_baker.cpp new file mode 100644 index 0000000000..4956d78ab0 --- /dev/null +++ b/servers/visual/visual_server_light_baker.cpp @@ -0,0 +1,6 @@ +#include "visual_server_light_baker.h" + +VisualServerLightBaker::VisualServerLightBaker() +{ + +} diff --git a/servers/visual/visual_server_light_baker.h b/servers/visual/visual_server_light_baker.h new file mode 100644 index 0000000000..42f016f614 --- /dev/null +++ b/servers/visual/visual_server_light_baker.h @@ -0,0 +1,29 @@ +#ifndef VISUALSERVERLIGHTBAKER_H +#define VISUALSERVERLIGHTBAKER_H + +#include "servers/visual_server.h" + +class VisualServerLightBaker { +public: + + struct BakeCell { + + uint32_t cells[8]; + uint32_t neighbours[7]; //one unused + uint32_t albedo; //albedo in RGBE + uint32_t emission; //emissive light in RGBE + uint32_t light[4]; //accumulated light in 16:16 fixed point (needs to be integer for moving lights fast) + float alpha; //used for upsampling + uint32_t directional_pass; //used for baking directional + + }; + + + + + + + VisualServerLightBaker(); +}; + +#endif // VISUALSERVERLIGHTBAKER_H diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 1df0aafb23..3262479c43 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,8 +32,150 @@ #include "default_mouse_cursor.xpm" #include "sort.h" #include "io/marshalls.h" +#include "visual_server_canvas.h" +#include "visual_server_global.h" +#include "visual_server_scene.h" + // careful, these may run in different threads than the visual server + + + +/* CURSOR */ +void VisualServerRaster::cursor_set_rotation(float p_rotation, int p_cursor ){ + +} +void VisualServerRaster::cursor_set_texture(RID p_texture, const Point2 &p_center_offset, int p_cursor, const Rect2 &p_region){ + +} +void VisualServerRaster::cursor_set_visible(bool p_visible, int p_cursor ){ + +} +void VisualServerRaster::cursor_set_pos(const Point2& p_pos, int p_cursor ){ + +} + +/* BLACK BARS */ + + +void VisualServerRaster::black_bars_set_margins(int p_left, int p_top, int p_right, int p_bottom){ + +} +void VisualServerRaster::black_bars_set_images(RID p_left, RID p_top, RID p_right, RID p_bottom){ + +} + + +/* FREE */ + +void VisualServerRaster::free( RID p_rid ){ + + if (VSG::storage->free(p_rid)) + return; + if (VSG::canvas->free(p_rid)) + return; + if (VSG::viewport->free(p_rid)) + return; + if (VSG::scene->free(p_rid)) + return; + +} + +/* EVENT QUEUING */ + +void VisualServerRaster::draw(){ + + //if (changes) + // print_line("changes: "+itos(changes)); + + changes=0; + + VSG::rasterizer->begin_frame(); + + VSG::scene->update_dirty_instances(); //update scene stuff + + VSG::viewport->draw_viewports(); + VSG::scene->render_probes(); + //_draw_cursors_and_margins(); + VSG::rasterizer->end_frame(); + //draw_extra_frame=VS:rasterizer->needs_to_draw_next_frame(); +} +void VisualServerRaster::sync(){ + +} +bool VisualServerRaster::has_changed() const{ + + return changes>0; +} +void VisualServerRaster::init(){ + + VSG::rasterizer->initialize(); + +} +void VisualServerRaster::finish(){ + + if (test_cube.is_valid()) { + free(test_cube); + } + + VSG::rasterizer->finalize(); +} + +/* STATUS INFORMATION */ + + +int VisualServerRaster::get_render_info(RenderInfo p_info){ + + return 0; +} + + + +/* TESTING */ + + + +void VisualServerRaster::set_boot_image(const Image& p_image, const Color& p_color,bool p_scale){ + +} +void VisualServerRaster::set_default_clear_color(const Color& p_color){ + +} + +bool VisualServerRaster::has_feature(Features p_feature) const { + + return false; +} + +RID VisualServerRaster::get_test_cube() { + if (!test_cube.is_valid()) { + test_cube=_make_test_cube(); + } + return test_cube; +} + +VisualServerRaster::VisualServerRaster() { + + VSG::canvas = memnew( VisualServerCanvas); + VSG::viewport = memnew( VisualServerViewport); + VSG::scene = memnew( VisualServerScene ); + VSG::rasterizer = Rasterizer::create(); + VSG::storage=VSG::rasterizer->get_storage(); + VSG::canvas_render=VSG::rasterizer->get_canvas(); + VSG::scene_render=VSG::rasterizer->get_scene(); + +} + +VisualServerRaster::~VisualServerRaster() { + + memdelete(VSG::canvas); + memdelete(VSG::viewport); + memdelete(VSG::rasterizer); +} + + +#if 0 + BalloonAllocator<> *VisualServerRaster::OctreeAllocator::allocator=NULL; #define VS_CHANGED\ @@ -265,33 +407,33 @@ RID VisualServerRaster::fixed_material_create() { return rasterizer->fixed_material_create(); } -void VisualServerRaster::fixed_material_set_flag(RID p_material, FixedMaterialFlags p_flag, bool p_enabled) { +void VisualServerRaster::fixed_material_set_flag(RID p_material, FixedSpatialMaterialFlags p_flag, bool p_enabled) { rasterizer->fixed_material_set_flag(p_material,p_flag,p_enabled); } -bool VisualServerRaster::fixed_material_get_flag(RID p_material, FixedMaterialFlags p_flag) const { +bool VisualServerRaster::fixed_material_get_flag(RID p_material, FixedSpatialMaterialFlags p_flag) const { return rasterizer->fixed_material_get_flag(p_material,p_flag); } -void VisualServerRaster::fixed_material_set_param(RID p_material, FixedMaterialParam p_parameter, const Variant& p_value) { +void VisualServerRaster::fixed_material_set_param(RID p_material, FixedSpatialMaterialParam p_parameter, const Variant& p_value) { VS_CHANGED; rasterizer->fixed_material_set_parameter(p_material,p_parameter,p_value); } -Variant VisualServerRaster::fixed_material_get_param(RID p_material,FixedMaterialParam p_parameter) const { +Variant VisualServerRaster::fixed_material_get_param(RID p_material,FixedSpatialMaterialParam p_parameter) const { return rasterizer->fixed_material_get_parameter(p_material,p_parameter); } -void VisualServerRaster::fixed_material_set_texture(RID p_material,FixedMaterialParam p_parameter, RID p_texture) { +void VisualServerRaster::fixed_material_set_texture(RID p_material,FixedSpatialMaterialParam p_parameter, RID p_texture) { VS_CHANGED; rasterizer->fixed_material_set_texture(p_material,p_parameter,p_texture); } -RID VisualServerRaster::fixed_material_get_texture(RID p_material,FixedMaterialParam p_parameter) const { +RID VisualServerRaster::fixed_material_get_texture(RID p_material,FixedSpatialMaterialParam p_parameter) const { return rasterizer->fixed_material_get_texture(p_material,p_parameter); } @@ -299,12 +441,12 @@ RID VisualServerRaster::fixed_material_get_texture(RID p_material,FixedMaterialP -void VisualServerRaster::fixed_material_set_texcoord_mode(RID p_material,FixedMaterialParam p_parameter, FixedMaterialTexCoordMode p_mode) { +void VisualServerRaster::fixed_material_set_texcoord_mode(RID p_material,FixedSpatialMaterialParam p_parameter, FixedSpatialMaterialTexCoordMode p_mode) { VS_CHANGED; rasterizer->fixed_material_set_texcoord_mode(p_material,p_parameter,p_mode); } -VS::FixedMaterialTexCoordMode VisualServerRaster::fixed_material_get_texcoord_mode(RID p_material,FixedMaterialParam p_parameter) const { +VS::FixedSpatialMaterialTexCoordMode VisualServerRaster::fixed_material_get_texcoord_mode(RID p_material,FixedSpatialMaterialParam p_parameter) const { return rasterizer->fixed_material_get_texcoord_mode(p_material,p_parameter); } @@ -331,14 +473,14 @@ Transform VisualServerRaster::fixed_material_get_uv_transform(RID p_material) co return rasterizer->fixed_material_get_uv_transform(p_material); } -void VisualServerRaster::fixed_material_set_light_shader(RID p_material,FixedMaterialLightShader p_shader) { +void VisualServerRaster::fixed_material_set_light_shader(RID p_material,FixedSpatialMaterialLightShader p_shader) { VS_CHANGED; rasterizer->fixed_material_set_light_shader(p_material,p_shader); } -VisualServerRaster::FixedMaterialLightShader VisualServerRaster::fixed_material_get_light_shader(RID p_material) const{ +VisualServerRaster::FixedSpatialMaterialLightShader VisualServerRaster::fixed_material_get_light_shader(RID p_material) const{ return rasterizer->fixed_material_get_light_shader(p_material); } @@ -677,13 +819,13 @@ Vector3 VisualServerRaster::particles_get_emission_base_velocity(RID p_particles return rasterizer->particles_get_emission_base_velocity(p_particles); } -void VisualServerRaster::particles_set_emission_points(RID p_particles, const DVector<Vector3>& p_points) { +void VisualServerRaster::particles_set_emission_points(RID p_particles, const PoolVector<Vector3>& p_points) { VS_CHANGED; rasterizer->particles_set_emission_points(p_particles,p_points); } -DVector<Vector3> VisualServerRaster::particles_get_emission_points(RID p_particles) const { +PoolVector<Vector3> VisualServerRaster::particles_get_emission_points(RID p_particles) const { return rasterizer->particles_get_emission_points(p_particles); } @@ -1137,7 +1279,7 @@ float VisualServerRaster::baked_light_get_lightmap_multiplier(RID p_baked_light) } -void VisualServerRaster::baked_light_set_octree(RID p_baked_light,const DVector<uint8_t> p_octree){ +void VisualServerRaster::baked_light_set_octree(RID p_baked_light,const PoolVector<uint8_t> p_octree){ VS_CHANGED; BakedLight *baked_light = baked_light_owner.get(p_baked_light); @@ -1146,7 +1288,7 @@ void VisualServerRaster::baked_light_set_octree(RID p_baked_light,const DVector< if (p_octree.size()==0) { if (baked_light->data.octree_texture.is_valid()) rasterizer->free(baked_light->data.octree_texture); - baked_light->data.octree_texture=RID(); + baked_light->data.octree_texture; baked_light->octree_aabb=AABB(); baked_light->octree_tex_size=Size2(); } else { @@ -1159,7 +1301,7 @@ void VisualServerRaster::baked_light_set_octree(RID p_baked_light,const DVector< bool has_light_tex=false; { - DVector<uint8_t>::Read r=p_octree.read(); + PoolVector<uint8_t>::Read r=p_octree.read(); tex_w = decode_uint32(&r[0]); tex_h = decode_uint32(&r[4]); print_line("TEX W: "+itos(tex_w)+" TEX H:"+itos(tex_h)+" LEN: "+itos(p_octree.size())); @@ -1203,7 +1345,7 @@ void VisualServerRaster::baked_light_set_octree(RID p_baked_light,const DVector< if (tex_w!=baked_light->octree_tex_size.x || tex_h!=baked_light->octree_tex_size.y) { rasterizer->free(baked_light->data.octree_texture); - baked_light->data.octree_texture=RID(); + baked_light->data.octree_texture; baked_light->octree_tex_size.x=0; baked_light->octree_tex_size.y=0; } @@ -1212,7 +1354,7 @@ void VisualServerRaster::baked_light_set_octree(RID p_baked_light,const DVector< if (baked_light->data.light_texture.is_valid()) { if (!has_light_tex || light_tex_w!=baked_light->light_tex_size.x || light_tex_h!=baked_light->light_tex_size.y) { rasterizer->free(baked_light->data.light_texture); - baked_light->data.light_texture=RID(); + baked_light->data.light_texture; baked_light->light_tex_size.x=0; baked_light->light_tex_size.y=0; } @@ -1220,20 +1362,20 @@ void VisualServerRaster::baked_light_set_octree(RID p_baked_light,const DVector< if (!baked_light->data.octree_texture.is_valid()) { baked_light->data.octree_texture=rasterizer->texture_create(); - rasterizer->texture_allocate(baked_light->data.octree_texture,tex_w,tex_h,Image::FORMAT_RGBA,TEXTURE_FLAG_FILTER); + rasterizer->texture_allocate(baked_light->data.octree_texture,tex_w,tex_h,Image::FORMAT_RGBA8,TEXTURE_FLAG_FILTER); baked_light->octree_tex_size.x=tex_w; baked_light->octree_tex_size.y=tex_h; } if (!baked_light->data.light_texture.is_valid() && has_light_tex) { baked_light->data.light_texture=rasterizer->texture_create(); - rasterizer->texture_allocate(baked_light->data.light_texture,light_tex_w,light_tex_h,Image::FORMAT_RGBA,TEXTURE_FLAG_FILTER); + rasterizer->texture_allocate(baked_light->data.light_texture,light_tex_w,light_tex_h,Image::FORMAT_RGBA8,TEXTURE_FLAG_FILTER); baked_light->light_tex_size.x=light_tex_w; baked_light->light_tex_size.y=light_tex_h; } - Image img(tex_w,tex_h,0,Image::FORMAT_RGBA,p_octree); + Image img(tex_w,tex_h,0,Image::FORMAT_RGBA8,p_octree); rasterizer->texture_set_data(baked_light->data.octree_texture,img); } @@ -1244,22 +1386,22 @@ void VisualServerRaster::baked_light_set_octree(RID p_baked_light,const DVector< } -DVector<uint8_t> VisualServerRaster::baked_light_get_octree(RID p_baked_light) const{ +PoolVector<uint8_t> VisualServerRaster::baked_light_get_octree(RID p_baked_light) const{ BakedLight *baked_light = baked_light_owner.get(p_baked_light); - ERR_FAIL_COND_V(!baked_light,DVector<uint8_t>()); + ERR_FAIL_COND_V(!baked_light,PoolVector<uint8_t>()); if (rasterizer->is_texture(baked_light->data.octree_texture)) { Image img = rasterizer->texture_get_data(baked_light->data.octree_texture); return img.get_data(); } else { - return DVector<uint8_t>(); + return PoolVector<uint8_t>(); } } -void VisualServerRaster::baked_light_set_light(RID p_baked_light,const DVector<uint8_t> p_light) { +void VisualServerRaster::baked_light_set_light(RID p_baked_light,const PoolVector<uint8_t> p_light) { VS_CHANGED; BakedLight *baked_light = baked_light_owner.get(p_baked_light); @@ -1276,30 +1418,30 @@ void VisualServerRaster::baked_light_set_light(RID p_baked_light,const DVector<u print_line("w: "+itos(tex_w)+" h: "+itos(tex_h)+" lightsize: "+itos(p_light.size())); - Image img(tex_w,tex_h,0,Image::FORMAT_RGBA,p_light); + Image img(tex_w,tex_h,0,Image::FORMAT_RGBA8,p_light); rasterizer->texture_set_data(baked_light->data.light_texture,img); } -DVector<uint8_t> VisualServerRaster::baked_light_get_light(RID p_baked_light) const{ +PoolVector<uint8_t> VisualServerRaster::baked_light_get_light(RID p_baked_light) const{ BakedLight *baked_light = baked_light_owner.get(p_baked_light); - ERR_FAIL_COND_V(!baked_light,DVector<uint8_t>()); + ERR_FAIL_COND_V(!baked_light,PoolVector<uint8_t>()); if (rasterizer->is_texture(baked_light->data.light_texture)) { Image img = rasterizer->texture_get_data(baked_light->data.light_texture); return img.get_data(); } else { - return DVector<uint8_t>(); + return PoolVector<uint8_t>(); } } -void VisualServerRaster::baked_light_set_sampler_octree(RID p_baked_light, const DVector<int> &p_sampler) { +void VisualServerRaster::baked_light_set_sampler_octree(RID p_baked_light, const PoolVector<int> &p_sampler) { BakedLight *baked_light = baked_light_owner.get(p_baked_light); ERR_FAIL_COND(!baked_light); @@ -1310,10 +1452,10 @@ void VisualServerRaster::baked_light_set_sampler_octree(RID p_baked_light, const } -DVector<int> VisualServerRaster::baked_light_get_sampler_octree(RID p_baked_light) const { +PoolVector<int> VisualServerRaster::baked_light_get_sampler_octree(RID p_baked_light) const { BakedLight *baked_light = baked_light_owner.get(p_baked_light); - ERR_FAIL_COND_V(!baked_light,DVector<int>()); + ERR_FAIL_COND_V(!baked_light,PoolVector<int>()); return baked_light->sampler; @@ -1611,8 +1753,8 @@ void VisualServerRaster::viewport_set_as_render_target(RID p_viewport,bool p_ena if (!p_enable) { rasterizer->free(viewport->render_target); - viewport->render_target=RID(); - viewport->render_target_texture=RID(); + viewport->render_target; + viewport->render_target_texture; if (viewport->update_list.in_list()) viewport_update_list.remove(&viewport->update_list); @@ -1811,7 +1953,7 @@ void VisualServerRaster::viewport_attach_camera(RID p_viewport,RID p_camera) { // a camera viewport->camera=p_camera; } else { - viewport->camera=RID(); + viewport->camera; } } @@ -1830,7 +1972,7 @@ void VisualServerRaster::viewport_set_scenario(RID p_viewport,RID p_scenario) { // a camera viewport->scenario=p_scenario; } else { - viewport->scenario=RID(); + viewport->scenario; } } @@ -2284,7 +2426,7 @@ void VisualServerRaster::instance_set_base(RID p_instance, RID p_base) { instance->base_type=INSTANCE_NONE; - instance->base_rid=RID(); + instance->base_rid; if (p_base.is_valid()) { @@ -3003,7 +3145,7 @@ void VisualServerRaster::instance_geometry_set_baked_light_sampler(RID p_instanc if (instance->sampled_light) { instance->sampled_light->baked_light_sampler_info->owned_instances.erase(instance); - instance->data.sampled_light=RID(); + instance->data.sampled_light; } if(p_baked_light_sampler.is_valid()) { @@ -3016,7 +3158,7 @@ void VisualServerRaster::instance_geometry_set_baked_light_sampler(RID p_instanc instance->sampled_light=NULL; } - instance->data.sampled_light=RID(); + instance->data.sampled_light; } @@ -3432,7 +3574,7 @@ void VisualServerRaster::canvas_item_set_parent(RID p_item,RID p_parent) { item_owner->child_items.erase(canvas_item); } - canvas_item->parent=RID(); + canvas_item->parent; } @@ -4057,7 +4199,7 @@ void VisualServerRaster::canvas_light_attach_to_canvas(RID p_light,RID p_canvas) } if (!canvas_owner.owns(p_canvas)) - p_canvas=RID(); + p_canvas; clight->canvas=p_canvas; if (clight->canvas.is_valid()) { @@ -4184,7 +4326,7 @@ void VisualServerRaster::canvas_light_set_shadow_enabled(RID p_light, bool p_ena clight->shadow_buffer=rasterizer->canvas_light_shadow_buffer_create(clight->shadow_buffer_size); } else { rasterizer->free(clight->shadow_buffer); - clight->shadow_buffer=RID(); + clight->shadow_buffer; } @@ -4246,7 +4388,7 @@ void VisualServerRaster::canvas_light_occluder_attach_to_canvas(RID p_occluder,R } if (!canvas_owner.owns(p_canvas)) - p_canvas=RID(); + p_canvas; occluder->canvas=p_canvas; @@ -4279,12 +4421,12 @@ void VisualServerRaster::canvas_light_occluder_set_polygon(RID p_occluder,RID p_ } occluder->polygon=p_polygon; - occluder->polygon_buffer=RID(); + occluder->polygon_buffer; if (occluder->polygon.is_valid()) { CanvasLightOccluderPolygon *occluder_poly = canvas_light_occluder_polygon_owner.get(p_polygon); if (!occluder_poly) - occluder->polygon=RID(); + occluder->polygon; ERR_FAIL_COND(!occluder_poly); occluder_poly->owners.insert(occluder); occluder->polygon_buffer=occluder_poly->occluder; @@ -4324,20 +4466,20 @@ RID VisualServerRaster::canvas_occluder_polygon_create() { } -void VisualServerRaster::canvas_occluder_polygon_set_shape(RID p_occluder_polygon, const DVector<Vector2>& p_shape, bool p_close){ +void VisualServerRaster::canvas_occluder_polygon_set_shape(RID p_occluder_polygon, const PoolVector<Vector2>& p_shape, bool p_close){ if (p_shape.size()<3) { canvas_occluder_polygon_set_shape_as_lines(p_occluder_polygon,p_shape); return; } - DVector<Vector2> lines; + PoolVector<Vector2> lines; int lc = p_shape.size()*2; lines.resize(lc-(p_close?0:2)); { - DVector<Vector2>::Write w = lines.write(); - DVector<Vector2>::Read r = p_shape.read(); + PoolVector<Vector2>::Write w = lines.write(); + PoolVector<Vector2>::Read r = p_shape.read(); int max=lc/2; if (!p_close) { @@ -4356,7 +4498,7 @@ void VisualServerRaster::canvas_occluder_polygon_set_shape(RID p_occluder_polygo canvas_occluder_polygon_set_shape_as_lines(p_occluder_polygon,lines); } -void VisualServerRaster::canvas_occluder_polygon_set_shape_as_lines(RID p_occluder_polygon,const DVector<Vector2>& p_shape) { +void VisualServerRaster::canvas_occluder_polygon_set_shape_as_lines(RID p_occluder_polygon,const PoolVector<Vector2>& p_shape) { CanvasLightOccluderPolygon * occluder_poly = canvas_light_occluder_polygon_owner.get(p_occluder_polygon); ERR_FAIL_COND(!occluder_poly); @@ -4365,7 +4507,7 @@ void VisualServerRaster::canvas_occluder_polygon_set_shape_as_lines(RID p_occlud int lc = p_shape.size(); occluder_poly->aabb=Rect2(); { - DVector<Vector2>::Read r = p_shape.read(); + PoolVector<Vector2>::Read r = p_shape.read(); for(int i=0;i<lc;i++) { if (i==0) occluder_poly->aabb.pos=r[i]; @@ -4558,7 +4700,7 @@ void VisualServerRaster::free( RID p_rid ) { //detach skeletons for (Set<Instance*>::Element *F=E->get().front();F;F=F->next()) { - F->get()->data.skeleton=RID(); + F->get()->data.skeleton; } skeleton_dependency_map.erase(E); } @@ -4688,17 +4830,17 @@ void VisualServerRaster::free( RID p_rid ) { for (int i=0;i<canvas->child_items.size();i++) { - canvas->child_items[i].item->parent=RID(); + canvas->child_items[i].item->parent; } for (Set<Rasterizer::CanvasLight*>::Element *E=canvas->lights.front();E;E=E->next()) { - E->get()->canvas=RID(); + E->get()->canvas; } for (Set<Rasterizer::CanvasLightOccluderInstance*>::Element *E=canvas->occluders.front();E;E=E->next()) { - E->get()->canvas=RID(); + E->get()->canvas; } canvas_owner.free( p_rid ); @@ -4726,7 +4868,7 @@ void VisualServerRaster::free( RID p_rid ) { for (int i=0;i<canvas_item->child_items.size();i++) { - canvas_item->child_items[i]->parent=RID(); + canvas_item->child_items[i]->parent; } if (canvas_item->material) { @@ -4798,7 +4940,7 @@ void VisualServerRaster::free( RID p_rid ) { while(occluder_poly->owners.size()) { - occluder_poly->owners.front()->get()->polygon=RID(); + occluder_poly->owners.front()->get()->polygon; occluder_poly->owners.erase( occluder_poly->owners.front() ); } @@ -6196,7 +6338,7 @@ void VisualServerRaster::_process_sampled_light(const Transform& p_camera,Instan AABB sample_aabb= bl->data.transform.affine_inverse().xform(AABB(Vector3(-r,-r,-r)+p_sampled_light->data.transform.origin,Vector3(r*2,r*2,r*2))); //ok got octree local AABB - DVector<int>::Read rp = bl->baked_light_info->baked_light->sampler.read(); + PoolVector<int>::Read rp = bl->baked_light_info->baked_light->sampler.read(); const int *rptr = rp.ptr(); int first = rptr[1]; @@ -6417,7 +6559,7 @@ void VisualServerRaster::_process_sampled_light(const Transform& p_camera,Instan for(Set<Instance*>::Element *F=p_sampled_light->baked_light_sampler_info->owned_instances.front();F;F=F->next()) { - F->get()->data.sampled_light=RID(); //do not use because nothing close + F->get()->data.sampled_light; //do not use because nothing close } } @@ -7612,11 +7754,6 @@ void VisualServerRaster::set_default_clear_color(const Color& p_color) { clear_color=p_color; } -Color VisualServerRaster::get_default_clear_color() const { - - return clear_color; -} - void VisualServerRaster::set_boot_image(const Image& p_image, const Color& p_color,bool p_scale) { if (p_image.empty()) @@ -7684,7 +7821,7 @@ void VisualServerRaster::init() { Image img; img.create(default_mouse_cursor_xpm); - //img.convert(Image::FORMAT_RGB); + //img.convert(Image::FORMAT_RGB8); default_cursor_texture = texture_create_from_image(img, 0); aabb_random_points.resize( GLOBAL_DEF("render/aabb_random_points",16) ); @@ -7771,3 +7908,4 @@ VisualServerRaster::VisualServerRaster(Rasterizer *p_rasterizer) { VisualServerRaster::~VisualServerRaster() { } +#endif diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index 1f22e31ab0..d9b650d569 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,12 +34,17 @@ #include "servers/visual/rasterizer.h" #include "allocators.h" #include "octree.h" - +#include "visual_server_global.h" +#include "visual_server_viewport.h" +#include "visual_server_canvas.h" +#include "visual_server_scene.h" /** @author Juan Linietsky <reduzio@gmail.com> */ + + class VisualServerRaster : public VisualServer { @@ -57,6 +62,12 @@ class VisualServerRaster : public VisualServer { }; + int changes; + bool draw_extra_frame; + RID test_cube; + + + #if 0 struct Room { bool occlude_exterior; @@ -92,8 +103,8 @@ class VisualServerRaster : public VisualServer { struct BakedLight { Rasterizer::BakedLightData data; - DVector<int> sampler; - AABB octree_aabb; + PoolVector<int> sampler; + Rect3 octree_aabb; Size2i octree_tex_size; Size2i light_tex_size; @@ -131,7 +142,7 @@ class VisualServerRaster : public VisualServer { Transform transform; - Camera() { + Camera() { visible_layers=0xFFFFFFFF; fov=60; @@ -140,8 +151,8 @@ class VisualServerRaster : public VisualServer { size=1.0; vaspect=false; - } - }; + } + }; struct Instance; @@ -166,8 +177,8 @@ class VisualServerRaster : public VisualServer { RID base_rid; - AABB aabb; - AABB transformed_aabb; + Rect3 aabb; + Rect3 transformed_aabb; uint32_t object_ID; bool visible; bool visible_in_all_rooms; @@ -374,97 +385,6 @@ class VisualServerRaster : public VisualServer { mutable RID_Owner<Rasterizer::CanvasItemMaterial> canvas_item_material_owner; - struct CanvasItem : public Rasterizer::CanvasItem { - - - RID parent; // canvas it belongs to - List<CanvasItem*>::Element *E; - RID viewport; - int z; - bool z_relative; - bool sort_y; - float opacity; - float self_opacity; - bool use_parent_material; - - - Vector<CanvasItem*> child_items; - - - CanvasItem() { - E=NULL; - z=0; - opacity=1; - self_opacity=1; - sort_y=false; - use_parent_material=false; - z_relative=true; - } - }; - - - struct CanvasItemPtrSort { - - _FORCE_INLINE_ bool operator()(const CanvasItem* p_left,const CanvasItem* p_right) const { - - return p_left->xform.elements[2].y < p_right->xform.elements[2].y; - } - }; - - struct CanvasLightOccluder; - - struct CanvasLightOccluderPolygon { - - bool active; - Rect2 aabb; - CanvasOccluderPolygonCullMode cull_mode; - RID occluder; - Set<Rasterizer::CanvasLightOccluderInstance*> owners; - - CanvasLightOccluderPolygon() { active=false; cull_mode=CANVAS_OCCLUDER_POLYGON_CULL_DISABLED; } - }; - - - RID_Owner<CanvasLightOccluderPolygon> canvas_light_occluder_polygon_owner; - - RID_Owner<Rasterizer::CanvasLightOccluderInstance> canvas_light_occluder_owner; - - struct CanvasLight; - - struct Canvas { - - Set<RID> viewports; - struct ChildItem { - - Point2 mirror; - CanvasItem *item; - }; - - Set<Rasterizer::CanvasLight*> lights; - Set<Rasterizer::CanvasLightOccluderInstance*> occluders; - - Vector<ChildItem> child_items; - Color modulate; - - int find_item(CanvasItem *p_item) { - for(int i=0;i<child_items.size();i++) { - if (child_items[i].item==p_item) - return i; - } - return -1; - } - void erase_item(CanvasItem *p_item) { - int idx=find_item(p_item); - if (idx>=0) - child_items.remove(idx); - } - - Canvas() { modulate=Color(1,1,1,1); } - - }; - - - RID_Owner<Rasterizer::CanvasLight> canvas_light_owner; struct Viewport { @@ -508,11 +428,11 @@ class VisualServerRaster : public VisualServer { struct CanvasData { Canvas *canvas; - Matrix32 transform; + Transform2D transform; int layer; }; - Matrix32 global_transform; + Transform2D global_transform; Map<RID,CanvasData> canvas_map; @@ -531,7 +451,7 @@ class VisualServerRaster : public VisualServer { float min,max; float z_near,z_far; - void add_aabb(const AABB& p_aabb) { + void add_aabb(const Rect3& p_aabb) { } @@ -634,9 +554,9 @@ class VisualServerRaster : public VisualServer { void _render_no_camera(Viewport *p_viewport,Camera *p_camera, Scenario *p_scenario); void _render_camera(Viewport *p_viewport,Camera *p_camera, Scenario *p_scenario); static void _render_canvas_item_viewport(VisualServer* p_self,void *p_vp,const Rect2& p_rect); - void _render_canvas_item_tree(CanvasItem *p_canvas_item, const Matrix32& p_transform, const Rect2& p_clip_rect, const Color &p_modulate, Rasterizer::CanvasLight *p_lights); - void _render_canvas_item(CanvasItem *p_canvas_item, const Matrix32& p_transform, const Rect2& p_clip_rect, float p_opacity, int p_z, Rasterizer::CanvasItem **z_list, Rasterizer::CanvasItem **z_last_list, CanvasItem *p_canvas_clip, CanvasItem *p_material_owner); - void _render_canvas(Canvas *p_canvas, const Matrix32 &p_transform, Rasterizer::CanvasLight *p_lights, Rasterizer::CanvasLight *p_masked_lights); + void _render_canvas_item_tree(CanvasItem *p_canvas_item, const Transform2D& p_transform, const Rect2& p_clip_rect, const Color &p_modulate, Rasterizer::CanvasLight *p_lights); + void _render_canvas_item(CanvasItem *p_canvas_item, const Transform2D& p_transform, const Rect2& p_clip_rect, float p_opacity, int p_z, Rasterizer::CanvasItem **z_list, Rasterizer::CanvasItem **z_last_list, CanvasItem *p_canvas_clip, CanvasItem *p_material_owner); + void _render_canvas(Canvas *p_canvas, const Transform2D &p_transform, Rasterizer::CanvasLight *p_lights, Rasterizer::CanvasLight *p_masked_lights); void _light_mask_canvas_items(int p_z,Rasterizer::CanvasItem *p_canvas_item,Rasterizer::CanvasLight *p_masked_lights); Vector<Vector3> _camera_generate_endpoints(Instance *p_light,Camera *p_camera,float p_range_min, float p_range_max); @@ -658,636 +578,586 @@ class VisualServerRaster : public VisualServer { Rasterizer *rasterizer; -public: - - virtual RID texture_create(); - virtual void texture_allocate(RID p_texture,int p_width, int p_height,Image::Format p_format,uint32_t p_flags=TEXTURE_FLAGS_DEFAULT); - virtual void texture_set_data(RID p_texture,const Image& p_image,CubeMapSide p_cube_side=CUBEMAP_LEFT); - virtual Image texture_get_data(RID p_texture,CubeMapSide p_cube_side=CUBEMAP_LEFT) const; - virtual void texture_set_flags(RID p_texture,uint32_t p_flags) ; - virtual uint32_t texture_get_flags(RID p_texture) const; - virtual Image::Format texture_get_format(RID p_texture) const; - virtual uint32_t texture_get_width(RID p_texture) const; - virtual uint32_t texture_get_height(RID p_texture) const; - virtual void texture_set_size_override(RID p_texture,int p_width, int p_height); - virtual bool texture_can_stream(RID p_texture) const; - virtual void texture_set_reload_hook(RID p_texture,ObjectID p_owner,const StringName& p_function) const; - - virtual void texture_set_path(RID p_texture,const String& p_path); - virtual String texture_get_path(RID p_texture) const; - - virtual void texture_debug_usage(List<TextureInfo> *r_info); - - virtual void texture_set_shrink_all_x2_on_set_data(bool p_enable); - - - /* SHADER API */ - - virtual RID shader_create(ShaderMode p_mode=SHADER_MATERIAL); - - virtual void shader_set_mode(RID p_shader,ShaderMode p_mode); - virtual ShaderMode shader_get_mode(RID p_shader) const; - - virtual void shader_set_code(RID p_shader, const String& p_vertex, const String& p_fragment,const String& p_light,int p_vertex_ofs=0,int p_fragment_ofs=0,int p_light_ofs=0); - virtual String shader_get_vertex_code(RID p_shader) const; - virtual String shader_get_fragment_code(RID p_shader) const; - virtual String shader_get_light_code(RID p_shader) const; - - virtual void shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list) const; - - virtual void shader_set_default_texture_param(RID p_shader, const StringName& p_name, RID p_texture); - virtual RID shader_get_default_texture_param(RID p_shader, const StringName& p_name) const; +#endif - /* COMMON MATERIAL API */ +public: - virtual RID material_create(); +#define DISPLAY_CHANGED changes++; - virtual void material_set_shader(RID p_shader_material, RID p_shader); - virtual RID material_get_shader(RID p_shader_material) const; +#define BIND0R(m_r,m_name) m_r m_name() { return BINDBASE->m_name(); } +#define BIND1R(m_r,m_name,m_type1) m_r m_name(m_type1 arg1) { return BINDBASE->m_name(arg1); } +#define BIND1RC(m_r,m_name,m_type1) m_r m_name(m_type1 arg1) const { return BINDBASE->m_name(arg1); } +#define BIND2RC(m_r,m_name,m_type1,m_type2) m_r m_name(m_type1 arg1,m_type2 arg2) const { return BINDBASE->m_name(arg1,arg2); } +#define BIND3RC(m_r,m_name,m_type1,m_type2,m_type3) m_r m_name(m_type1 arg1,m_type2 arg2,m_type3 arg3) const { return BINDBASE->m_name(arg1,arg2,arg3); } +#define BIND4RC(m_r,m_name,m_type1,m_type2,m_type3,m_type4) m_r m_name(m_type1 arg1,m_type2 arg2,m_type3 arg3,m_type4 arg4) const { return BINDBASE->m_name(arg1,arg2,arg3,arg4); } - virtual void material_set_param(RID p_material, const StringName& p_param, const Variant& p_value); - virtual Variant material_get_param(RID p_material, const StringName& p_param) const; +#define BIND1(m_name,m_type1) void m_name(m_type1 arg1) { DISPLAY_CHANGED BINDBASE->m_name(arg1); } +#define BIND2(m_name,m_type1,m_type2) void m_name(m_type1 arg1,m_type2 arg2) { DISPLAY_CHANGED BINDBASE->m_name(arg1,arg2); } +#define BIND2C(m_name,m_type1,m_type2) void m_name(m_type1 arg1,m_type2 arg2) const { BINDBASE->m_name(arg1,arg2); } +#define BIND3(m_name,m_type1,m_type2,m_type3) void m_name(m_type1 arg1,m_type2 arg2,m_type3 arg3) { DISPLAY_CHANGED BINDBASE->m_name(arg1,arg2,arg3); } +#define BIND4(m_name,m_type1,m_type2,m_type3,m_type4) void m_name(m_type1 arg1,m_type2 arg2,m_type3 arg3,m_type4 arg4) { DISPLAY_CHANGED BINDBASE->m_name(arg1,arg2,arg3,arg4); } +#define BIND5(m_name,m_type1,m_type2,m_type3,m_type4,m_type5) void m_name(m_type1 arg1,m_type2 arg2,m_type3 arg3,m_type4 arg4,m_type5 arg5) { DISPLAY_CHANGED BINDBASE->m_name(arg1,arg2,arg3,arg4,arg5); } +#define BIND6(m_name,m_type1,m_type2,m_type3,m_type4,m_type5,m_type6) void m_name(m_type1 arg1,m_type2 arg2,m_type3 arg3,m_type4 arg4,m_type5 arg5,m_type6 arg6) { DISPLAY_CHANGED BINDBASE->m_name(arg1,arg2,arg3,arg4,arg5,arg6); } +#define BIND7(m_name,m_type1,m_type2,m_type3,m_type4,m_type5,m_type6,m_type7) void m_name(m_type1 arg1,m_type2 arg2,m_type3 arg3,m_type4 arg4,m_type5 arg5,m_type6 arg6,m_type7 arg7) { DISPLAY_CHANGED BINDBASE->m_name(arg1,arg2,arg3,arg4,arg5,arg6,arg7); } +#define BIND8(m_name,m_type1,m_type2,m_type3,m_type4,m_type5,m_type6,m_type7,m_type8) void m_name(m_type1 arg1,m_type2 arg2,m_type3 arg3,m_type4 arg4,m_type5 arg5,m_type6 arg6,m_type7 arg7,m_type8 arg8) { DISPLAY_CHANGED BINDBASE->m_name(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); } +#define BIND9(m_name,m_type1,m_type2,m_type3,m_type4,m_type5,m_type6,m_type7,m_type8,m_type9) void m_name(m_type1 arg1,m_type2 arg2,m_type3 arg3,m_type4 arg4,m_type5 arg5,m_type6 arg6,m_type7 arg7,m_type8 arg8,m_type9 arg9) { DISPLAY_CHANGED BINDBASE->m_name(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); } +#define BIND10(m_name,m_type1,m_type2,m_type3,m_type4,m_type5,m_type6,m_type7,m_type8,m_type9,m_type10) void m_name(m_type1 arg1,m_type2 arg2,m_type3 arg3,m_type4 arg4,m_type5 arg5,m_type6 arg6,m_type7 arg7,m_type8 arg8,m_type9 arg9,m_type10 arg10) { DISPLAY_CHANGED BINDBASE->m_name(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10); } - virtual void material_set_flag(RID p_material, MaterialFlag p_flag,bool p_enabled); - virtual bool material_get_flag(RID p_material,MaterialFlag p_flag) const; +//from now on, calls forwarded to this singleton +#define BINDBASE VSG::storage - virtual void material_set_depth_draw_mode(RID p_material, MaterialDepthDrawMode p_mode); - virtual MaterialDepthDrawMode material_get_depth_draw_mode(RID p_material) const; + /* TEXTURE API */ - virtual void material_set_blend_mode(RID p_material,MaterialBlendMode p_mode); - virtual MaterialBlendMode material_get_blend_mode(RID p_material) const; - virtual void material_set_line_width(RID p_material,float p_line_width); - virtual float material_get_line_width(RID p_material) const; + BIND0R(RID,texture_create) + BIND5(texture_allocate,RID,int,int,Image::Format,uint32_t) + BIND3(texture_set_data,RID,const Image&,CubeMapSide) + BIND2RC(Image,texture_get_data,RID,CubeMapSide) + BIND2(texture_set_flags,RID,uint32_t) + BIND1RC(uint32_t,texture_get_flags,RID) + BIND1RC(Image::Format,texture_get_format,RID) + BIND1RC(uint32_t,texture_get_width,RID) + BIND1RC(uint32_t,texture_get_height,RID) + BIND3(texture_set_size_override,RID,int,int) + BIND2RC(RID,texture_create_radiance_cubemap,RID,int) - /* FIXED MATERIAL */ - virtual RID fixed_material_create(); + BIND2(texture_set_path,RID,const String&) + BIND1RC(String,texture_get_path,RID) + BIND1(texture_set_shrink_all_x2_on_set_data,bool) + BIND1(texture_debug_usage,List<TextureInfo>*) - virtual void fixed_material_set_flag(RID p_material, FixedMaterialFlags p_flag, bool p_enabled); - virtual bool fixed_material_get_flag(RID p_material, FixedMaterialFlags p_flag) const; + BIND1(textures_keep_original,bool) - virtual void fixed_material_set_param(RID p_material, FixedMaterialParam p_parameter, const Variant& p_value); - virtual Variant fixed_material_get_param(RID p_material,FixedMaterialParam p_parameter) const; + /* SKYBOX API */ - virtual void fixed_material_set_texture(RID p_material,FixedMaterialParam p_parameter, RID p_texture); - virtual RID fixed_material_get_texture(RID p_material,FixedMaterialParam p_parameter) const; + BIND0R(RID,skybox_create) + BIND3(skybox_set_texture,RID,RID,int) - virtual void fixed_material_set_texcoord_mode(RID p_material,FixedMaterialParam p_parameter, FixedMaterialTexCoordMode p_mode); - virtual FixedMaterialTexCoordMode fixed_material_get_texcoord_mode(RID p_material,FixedMaterialParam p_parameter) const; + /* SHADER API */ + BIND1R(RID,shader_create,ShaderMode) - virtual void fixed_material_set_uv_transform(RID p_material,const Transform& p_transform); - virtual Transform fixed_material_get_uv_transform(RID p_material) const; - virtual void fixed_material_set_light_shader(RID p_material,FixedMaterialLightShader p_shader); - virtual FixedMaterialLightShader fixed_material_get_light_shader(RID p_material) const; + BIND2(shader_set_mode,RID,ShaderMode) + BIND1RC(ShaderMode,shader_get_mode,RID) - virtual void fixed_material_set_point_size(RID p_material,float p_size); - virtual float fixed_material_get_point_size(RID p_material) const; + BIND2(shader_set_code,RID,const String&) + BIND1RC(String,shader_get_code,RID) - /* SURFACE API */ - virtual RID mesh_create(); + BIND2C(shader_get_param_list,RID, List<PropertyInfo> *) - virtual void mesh_set_morph_target_count(RID p_mesh,int p_amount); - virtual int mesh_get_morph_target_count(RID p_mesh) const; + BIND3(shader_set_default_texture_param,RID,const StringName&,RID) + BIND2RC(RID,shader_get_default_texture_param,RID,const StringName&) - virtual void mesh_set_morph_target_mode(RID p_mesh,MorphTargetMode p_mode); - virtual MorphTargetMode mesh_get_morph_target_mode(RID p_mesh) const; - virtual void mesh_add_custom_surface(RID p_mesh,const Variant& p_dat); //this is used by each platform in a different way + /* COMMON MATERIAL API */ - virtual void mesh_add_surface(RID p_mesh,PrimitiveType p_primitive,const Array& p_arrays,const Array& p_blend_shapes=Array(),bool p_alpha_sort=false); - virtual Array mesh_get_surface_arrays(RID p_mesh,int p_surface) const; - virtual Array mesh_get_surface_morph_arrays(RID p_mesh,int p_surface) const; + BIND0R(RID,material_create) - virtual void mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material,bool p_owned=false); - virtual RID mesh_surface_get_material(RID p_mesh, int p_surface) const; + BIND2(material_set_shader,RID,RID) + BIND1RC(RID,material_get_shader,RID) - virtual int mesh_surface_get_array_len(RID p_mesh, int p_surface) const; - virtual int mesh_surface_get_array_index_len(RID p_mesh, int p_surface) const; - virtual uint32_t mesh_surface_get_format(RID p_mesh, int p_surface) const; - virtual PrimitiveType mesh_surface_get_primitive_type(RID p_mesh, int p_surface) const; + BIND3(material_set_param,RID, const StringName&, const Variant& ) + BIND2RC(Variant,material_get_param,RID, const StringName& ) - virtual void mesh_remove_surface(RID p_mesh,int p_index); - virtual int mesh_get_surface_count(RID p_mesh) const; + BIND2(material_set_line_width,RID, float ) - virtual void mesh_set_custom_aabb(RID p_mesh,const AABB& p_aabb); - virtual AABB mesh_get_custom_aabb(RID p_mesh) const; - virtual void mesh_clear(RID p_mesh); - /* MULTIMESH API */ + /* MESH API */ - virtual RID multimesh_create(); - virtual void multimesh_set_instance_count(RID p_multimesh,int p_count); - virtual int multimesh_get_instance_count(RID p_multimesh) const; + BIND0R(RID,mesh_create) - virtual void multimesh_set_mesh(RID p_multimesh,RID p_mesh); - virtual void multimesh_set_aabb(RID p_multimesh,const AABB& p_aabb); - virtual void multimesh_instance_set_transform(RID p_multimesh,int p_index,const Transform& p_transform); - virtual void multimesh_instance_set_color(RID p_multimesh,int p_index,const Color& p_color); + BIND10(mesh_add_surface,RID,uint32_t,PrimitiveType,const PoolVector<uint8_t>&,int ,const PoolVector<uint8_t>& ,int ,const Rect3&,const Vector<PoolVector<uint8_t> >&,const Vector<Rect3>& ) - virtual RID multimesh_get_mesh(RID p_multimesh) const; - virtual AABB multimesh_get_aabb(RID p_multimesh,const AABB& p_aabb) const; - virtual Transform multimesh_instance_get_transform(RID p_multimesh,int p_index) const; - virtual Color multimesh_instance_get_color(RID p_multimesh,int p_index) const; + BIND2(mesh_set_morph_target_count,RID,int) + BIND1RC(int,mesh_get_morph_target_count,RID) - virtual void multimesh_set_visible_instances(RID p_multimesh,int p_visible); - virtual int multimesh_get_visible_instances(RID p_multimesh) const; - /* IMMEDIATE API */ + BIND2(mesh_set_morph_target_mode,RID,MorphTargetMode) + BIND1RC(MorphTargetMode, mesh_get_morph_target_mode,RID ) - virtual RID immediate_create(); - virtual void immediate_begin(RID p_immediate,PrimitiveType p_rimitive,RID p_texture=RID()); - virtual void immediate_vertex(RID p_immediate,const Vector3& p_vertex); - virtual void immediate_normal(RID p_immediate,const Vector3& p_normal); - virtual void immediate_tangent(RID p_immediate,const Plane& p_tangent); - virtual void immediate_color(RID p_immediate,const Color& p_color); - virtual void immediate_uv(RID p_immediate, const Vector2& p_uv); - virtual void immediate_uv2(RID p_immediate,const Vector2& tex_uv); - virtual void immediate_end(RID p_immediate); - virtual void immediate_clear(RID p_immediate); - virtual void immediate_set_material(RID p_immediate,RID p_material); - virtual RID immediate_get_material(RID p_immediate) const; + BIND3(mesh_surface_set_material,RID, int , RID ) + BIND2RC(RID,mesh_surface_get_material,RID, int ) + BIND2RC(int,mesh_surface_get_array_len,RID,int) + BIND2RC(int,mesh_surface_get_array_index_len,RID,int) - /* PARTICLES API */ + BIND2RC(PoolVector<uint8_t>,mesh_surface_get_array,RID,int) + BIND2RC(PoolVector<uint8_t>,mesh_surface_get_index_array,RID, int) - virtual RID particles_create(); + BIND2RC(uint32_t,mesh_surface_get_format,RID,int) + BIND2RC(PrimitiveType,mesh_surface_get_primitive_type,RID,int) - virtual void particles_set_amount(RID p_particles, int p_amount); - virtual int particles_get_amount(RID p_particles) const; + BIND2RC(Rect3,mesh_surface_get_aabb,RID,int) + BIND2RC(Vector<PoolVector<uint8_t> >,mesh_surface_get_blend_shapes,RID,int) + BIND2RC(Vector<Rect3>,mesh_surface_get_skeleton_aabb,RID,int) - virtual void particles_set_emitting(RID p_particles, bool p_emitting); - virtual bool particles_is_emitting(RID p_particles) const; + BIND2(mesh_remove_surface,RID,int) + BIND1RC(int,mesh_get_surface_count,RID) - virtual void particles_set_visibility_aabb(RID p_particles, const AABB& p_visibility); - virtual AABB particles_get_visibility_aabb(RID p_particles) const; + BIND2(mesh_set_custom_aabb,RID,const Rect3&) + BIND1RC(Rect3,mesh_get_custom_aabb,RID) - virtual void particles_set_emission_half_extents(RID p_particles, const Vector3& p_half_extents); - virtual Vector3 particles_get_emission_half_extents(RID p_particles) const; + BIND1(mesh_clear,RID) - virtual void particles_set_emission_base_velocity(RID p_particles, const Vector3& p_base_velocity); - virtual Vector3 particles_get_emission_base_velocity(RID p_particles) const; - - virtual void particles_set_emission_points(RID p_particles, const DVector<Vector3>& p_points); - virtual DVector<Vector3> particles_get_emission_points(RID p_particles) const; - - virtual void particles_set_gravity_normal(RID p_particles, const Vector3& p_normal); - virtual Vector3 particles_get_gravity_normal(RID p_particles) const; + /* MULTIMESH API */ - virtual void particles_set_variable(RID p_particles, ParticleVariable p_variable,float p_value); - virtual float particles_get_variable(RID p_particles, ParticleVariable p_variable) const; - virtual void particles_set_randomness(RID p_particles, ParticleVariable p_variable,float p_randomness); - virtual float particles_get_randomness(RID p_particles, ParticleVariable p_variable) const; + BIND0R(RID,multimesh_create) - virtual void particles_set_color_phase_pos(RID p_particles, int p_phase, float p_pos); - virtual float particles_get_color_phase_pos(RID p_particles, int p_phase) const; + BIND4(multimesh_allocate,RID,int,MultimeshTransformFormat,MultimeshColorFormat) + BIND1RC(int,multimesh_get_instance_count,RID) - virtual void particles_set_color_phases(RID p_particles, int p_phases); - virtual int particles_get_color_phases(RID p_particles) const; + BIND2(multimesh_set_mesh,RID,RID) + BIND3(multimesh_instance_set_transform,RID,int,const Transform&) + BIND3(multimesh_instance_set_transform_2d,RID,int,const Transform2D& ) + BIND3(multimesh_instance_set_color,RID,int,const Color&) - virtual void particles_set_color_phase_color(RID p_particles, int p_phase, const Color& p_color); - virtual Color particles_get_color_phase_color(RID p_particles, int p_phase) const; + BIND1RC(RID,multimesh_get_mesh,RID) + BIND1RC(Rect3,multimesh_get_aabb,RID) - virtual void particles_set_attractors(RID p_particles, int p_attractors); - virtual int particles_get_attractors(RID p_particles) const; + BIND2RC(Transform,multimesh_instance_get_transform,RID,int ) + BIND2RC(Transform2D,multimesh_instance_get_transform_2d,RID,int) + BIND2RC(Color,multimesh_instance_get_color,RID,int) - virtual void particles_set_attractor_pos(RID p_particles, int p_attractor, const Vector3& p_pos); - virtual Vector3 particles_get_attractor_pos(RID p_particles,int p_attractor) const; + BIND2(multimesh_set_visible_instances,RID,int) + BIND1RC(int,multimesh_get_visible_instances,RID) - virtual void particles_set_attractor_strength(RID p_particles, int p_attractor, float p_force); - virtual float particles_get_attractor_strength(RID p_particles,int p_attractor) const; - virtual void particles_set_material(RID p_particles, RID p_material,bool p_owned=false); - virtual RID particles_get_material(RID p_particles) const; + /* IMMEDIATE API */ - virtual void particles_set_height_from_velocity(RID p_particles, bool p_enable); - virtual bool particles_has_height_from_velocity(RID p_particles) const; + BIND0R(RID,immediate_create) + BIND3(immediate_begin,RID,PrimitiveType,RID) + BIND2(immediate_vertex,RID,const Vector3&) + BIND2(immediate_normal,RID,const Vector3&) + BIND2(immediate_tangent,RID,const Plane&) + BIND2(immediate_color,RID,const Color&) + BIND2(immediate_uv,RID,const Vector2& ) + BIND2(immediate_uv2,RID,const Vector2&) + BIND1(immediate_end,RID) + BIND1(immediate_clear,RID) + BIND2(immediate_set_material,RID ,RID ) + BIND1RC(RID,immediate_get_material,RID) - virtual void particles_set_use_local_coordinates(RID p_particles, bool p_enable); - virtual bool particles_is_using_local_coordinates(RID p_particles) const; + /* SKELETON API */ + BIND0R(RID,skeleton_create) + BIND3(skeleton_allocate,RID,int,bool) + BIND1RC(int,skeleton_get_bone_count,RID) + BIND3(skeleton_bone_set_transform,RID,int,const Transform&) + BIND2RC(Transform,skeleton_bone_get_transform,RID,int) + BIND3(skeleton_bone_set_transform_2d,RID,int, const Transform2D& ) + BIND2RC(Transform2D,skeleton_bone_get_transform_2d,RID,int) /* Light API */ - virtual RID light_create(LightType p_type); - virtual LightType light_get_type(RID p_light) const; - - virtual void light_set_color(RID p_light,LightColor p_type, const Color& p_color); - virtual Color light_get_color(RID p_light,LightColor p_type) const; - + BIND1R(RID,light_create,LightType) - virtual void light_set_shadow(RID p_light,bool p_enabled); - virtual bool light_has_shadow(RID p_light) const; + BIND2(light_set_color,RID,const Color&) + BIND3(light_set_param,RID ,LightParam ,float ) + BIND2(light_set_shadow,RID ,bool ) + BIND2(light_set_shadow_color,RID ,const Color& ) + BIND2(light_set_projector,RID,RID ) + BIND2(light_set_negative,RID,bool ) + BIND2(light_set_cull_mask,RID ,uint32_t ) - virtual void light_set_volumetric(RID p_light,bool p_enabled); - virtual bool light_is_volumetric(RID p_light) const; + BIND2(light_omni_set_shadow_mode,RID,LightOmniShadowMode) + BIND2(light_omni_set_shadow_detail,RID,LightOmniShadowDetail) - virtual void light_set_projector(RID p_light,RID p_texture); - virtual RID light_get_projector(RID p_light) const; + BIND2(light_directional_set_shadow_mode,RID,LightDirectionalShadowMode) + BIND2(light_directional_set_blend_splits,RID,bool) - virtual void light_set_param(RID p_light, LightParam p_var, float p_value); - virtual float light_get_param(RID p_light, LightParam p_var) const; + /* PROBE API */ - virtual void light_set_operator(RID p_light,LightOp p_op); - virtual LightOp light_get_operator(RID p_light) const; + BIND0R(RID,reflection_probe_create) - virtual void light_omni_set_shadow_mode(RID p_light,LightOmniShadowMode p_mode); - virtual LightOmniShadowMode light_omni_get_shadow_mode(RID p_light) const; - - virtual void light_directional_set_shadow_mode(RID p_light,LightDirectionalShadowMode p_mode); - virtual LightDirectionalShadowMode light_directional_get_shadow_mode(RID p_light) const; - virtual void light_directional_set_shadow_param(RID p_light,LightDirectionalShadowParam p_param, float p_value); - virtual float light_directional_get_shadow_param(RID p_light,LightDirectionalShadowParam p_param) const; - - - /* SKELETON API */ - - virtual RID skeleton_create(); - virtual void skeleton_resize(RID p_skeleton,int p_bones); - virtual int skeleton_get_bone_count(RID p_skeleton) const; - virtual void skeleton_bone_set_transform(RID p_skeleton,int p_bone, const Transform& p_transform); - virtual Transform skeleton_bone_get_transform(RID p_skeleton,int p_bone); + BIND2(reflection_probe_set_update_mode,RID, ReflectionProbeUpdateMode ) + BIND2(reflection_probe_set_intensity,RID, float ) + BIND2(reflection_probe_set_interior_ambient,RID, const Color& ) + BIND2(reflection_probe_set_interior_ambient_energy,RID, float ) + BIND2(reflection_probe_set_interior_ambient_probe_contribution,RID, float ) + BIND2(reflection_probe_set_max_distance,RID, float ) + BIND2(reflection_probe_set_extents,RID, const Vector3& ) + BIND2(reflection_probe_set_origin_offset,RID, const Vector3& ) + BIND2(reflection_probe_set_as_interior,RID, bool ) + BIND2(reflection_probe_set_enable_box_projection,RID, bool ) + BIND2(reflection_probe_set_enable_shadows,RID, bool ) + BIND2(reflection_probe_set_cull_mask,RID, uint32_t ) /* ROOM API */ - virtual RID room_create(); - virtual void room_set_bounds(RID p_room, const BSP_Tree& p_bounds); - virtual BSP_Tree room_get_bounds(RID p_room) const; + BIND0R(RID,room_create) + BIND4(room_add_bounds,RID, const PoolVector<Vector2>& ,float ,const Transform& ) + BIND1(room_clear_bounds,RID) /* PORTAL API */ - virtual RID portal_create(); - virtual void portal_set_shape(RID p_portal, const Vector<Point2>& p_shape); - virtual Vector<Point2> portal_get_shape(RID p_portal) const; - virtual void portal_set_enabled(RID p_portal, bool p_enabled); - virtual bool portal_is_enabled(RID p_portal) const; - virtual void portal_set_disable_distance(RID p_portal, float p_distance); - virtual float portal_get_disable_distance(RID p_portal) const; - virtual void portal_set_disabled_color(RID p_portal, const Color& p_color); - virtual Color portal_get_disabled_color(RID p_portal) const; - virtual void portal_set_connect_range(RID p_portal, float p_range); - virtual float portal_get_connect_range(RID p_portal) const; + // portals are only (x/y) points, forming a convex shape, which its clockwise + // order points outside. (z is 0); - /* BAKED LIGHT */ + BIND0R(RID,portal_create) + BIND2(portal_set_shape,RID , const Vector<Point2>& ) + BIND2(portal_set_enabled,RID , bool ) + BIND2(portal_set_disable_distance,RID , float ) + BIND2(portal_set_disabled_color,RID , const Color& ) - virtual RID baked_light_create(); + /* BAKED LIGHT API */ - virtual void baked_light_set_mode(RID p_baked_light,BakedLightMode p_mode); - virtual BakedLightMode baked_light_get_mode(RID p_baked_light) const; + BIND0R(RID, gi_probe_create) - virtual void baked_light_set_octree(RID p_baked_light,const DVector<uint8_t> p_octree); - virtual DVector<uint8_t> baked_light_get_octree(RID p_baked_light) const; + BIND2(gi_probe_set_bounds,RID,const Rect3&) + BIND1RC(Rect3,gi_probe_get_bounds,RID) - virtual void baked_light_set_light(RID p_baked_light,const DVector<uint8_t> p_light); - virtual DVector<uint8_t> baked_light_get_light(RID p_baked_light) const; + BIND2(gi_probe_set_cell_size,RID,float) + BIND1RC(float,gi_probe_get_cell_size,RID) - virtual void baked_light_set_sampler_octree(RID p_baked_light,const DVector<int> &p_sampler); - virtual DVector<int> baked_light_get_sampler_octree(RID p_baked_light) const; + BIND2(gi_probe_set_to_cell_xform,RID,const Transform&) + BIND1RC(Transform,gi_probe_get_to_cell_xform,RID) - virtual void baked_light_set_lightmap_multiplier(RID p_baked_light,float p_multiplier); - virtual float baked_light_get_lightmap_multiplier(RID p_baked_light) const; + BIND2(gi_probe_set_dynamic_range,RID,int) + BIND1RC(int,gi_probe_get_dynamic_range,RID) - virtual void baked_light_add_lightmap(RID p_baked_light,const RID p_texture,int p_id); - virtual void baked_light_clear_lightmaps(RID p_baked_light); + BIND2(gi_probe_set_energy,RID,float) + BIND1RC(float,gi_probe_get_energy,RID) - virtual void baked_light_set_realtime_color_enabled(RID p_baked_light, const bool p_enabled); - virtual bool baked_light_get_realtime_color_enabled(RID p_baked_light) const; + BIND2(gi_probe_set_interior,RID,bool) + BIND1RC(bool,gi_probe_is_interior,RID) - virtual void baked_light_set_realtime_color(RID p_baked_light, const Color& p_color); - virtual Color baked_light_get_realtime_color(RID p_baked_light) const; + BIND2(gi_probe_set_compress,RID,bool) + BIND1RC(bool,gi_probe_is_compressed,RID) - virtual void baked_light_set_realtime_energy(RID p_baked_light, const float p_energy); - virtual float baked_light_get_realtime_energy(RID p_baked_light) const; + BIND2(gi_probe_set_dynamic_data,RID,const PoolVector<int>& ) + BIND1RC( PoolVector<int>,gi_probe_get_dynamic_data,RID) - /* BAKED LIGHT SAMPLER */ + /* PARTICLES */ - virtual RID baked_light_sampler_create(); + BIND0R(RID, particles_create) - virtual void baked_light_sampler_set_param(RID p_baked_light_sampler,BakedLightSamplerParam p_param,float p_value); - virtual float baked_light_sampler_get_param(RID p_baked_light_sampler,BakedLightSamplerParam p_param) const; + BIND2(particles_set_emitting,RID,bool) + BIND2(particles_set_amount,RID,int ) + BIND2(particles_set_lifetime,RID,float ) + BIND2(particles_set_pre_process_time,RID,float ) + BIND2(particles_set_explosiveness_ratio,RID,float ) + BIND2(particles_set_randomness_ratio,RID,float ) + BIND2(particles_set_custom_aabb,RID,const Rect3& ) + BIND2(particles_set_gravity,RID,const Vector3& ) + BIND2(particles_set_use_local_coordinates,RID,bool ) + BIND2(particles_set_process_material,RID,RID ) - virtual void baked_light_sampler_set_resolution(RID p_baked_light_sampler,int p_resolution); - virtual int baked_light_sampler_get_resolution(RID p_baked_light_sampler) const; + BIND2(particles_set_emission_shape,RID,VS::ParticlesEmissionShape ) + BIND2(particles_set_emission_sphere_radius,RID,float ) + BIND2(particles_set_emission_box_extents,RID,const Vector3& ) + BIND2(particles_set_emission_points,RID,const PoolVector<Vector3>& ) - /* CAMERA API */ - virtual RID camera_create(); - virtual void camera_set_perspective(RID p_camera,float p_fovy_degrees, float p_z_near, float p_z_far); - virtual void camera_set_orthogonal(RID p_camera,float p_size, float p_z_near, float p_z_far); - virtual void camera_set_transform(RID p_camera,const Transform& p_transform); + BIND2(particles_set_draw_order,RID,VS::ParticlesDrawOrder ) - virtual void camera_set_visible_layers(RID p_camera,uint32_t p_layers); - virtual uint32_t camera_get_visible_layers(RID p_camera) const; + BIND2(particles_set_draw_passes,RID,int ) + BIND3(particles_set_draw_pass_material,RID,int , RID ) + BIND3(particles_set_draw_pass_mesh,RID,int , RID ) - virtual void camera_set_environment(RID p_camera,RID p_env); - virtual RID camera_get_environment(RID p_camera) const; + BIND1R(Rect3,particles_get_current_aabb,RID); - virtual void camera_set_use_vertical_aspect(RID p_camera,bool p_enable); - virtual bool camera_is_using_vertical_aspect(RID p_camera,bool p_enable) const; - /* VIEWPORT API */ +#undef BINDBASE +//from now on, calls forwarded to this singleton +#define BINDBASE VSG::scene - virtual RID viewport_create(); - - virtual void viewport_attach_to_screen(RID p_viewport,int p_screen=0); - virtual void viewport_detach(RID p_viewport); + /* CAMERA API */ - virtual void viewport_set_as_render_target(RID p_viewport,bool p_enable); - virtual void viewport_set_render_target_update_mode(RID p_viewport,RenderTargetUpdateMode p_mode); - virtual RenderTargetUpdateMode viewport_get_render_target_update_mode(RID p_viewport) const; - virtual RID viewport_get_render_target_texture(RID p_viewport) const; - virtual void viewport_set_render_target_vflip(RID p_viewport,bool p_enable); - virtual bool viewport_get_render_target_vflip(RID p_viewport) const; - virtual void viewport_set_render_target_clear_on_new_frame(RID p_viewport,bool p_enable); - virtual bool viewport_get_render_target_clear_on_new_frame(RID p_viewport) const; - virtual void viewport_render_target_clear(RID p_viewport); - virtual void viewport_set_render_target_to_screen_rect(RID p_viewport,const Rect2& p_rect); + BIND0R(RID, camera_create) + BIND4(camera_set_perspective,RID,float, float , float ) + BIND4(camera_set_orthogonal,RID,float , float , float ) + BIND2(camera_set_transform,RID,const Transform&) + BIND2(camera_set_cull_mask,RID,uint32_t ) + BIND2(camera_set_environment,RID ,RID ) + BIND2(camera_set_use_vertical_aspect,RID,bool) - virtual void viewport_queue_screen_capture(RID p_viewport); - virtual Image viewport_get_screen_capture(RID p_viewport) const; +#undef BINDBASE +//from now on, calls forwarded to this singleton +#define BINDBASE VSG::viewport - virtual void viewport_set_rect(RID p_viewport,const ViewportRect& p_rect); - virtual ViewportRect viewport_get_rect(RID p_viewport) const; + /* VIEWPORT TARGET API */ - virtual void viewport_set_hide_scenario(RID p_viewport,bool p_hide); - virtual void viewport_set_hide_canvas(RID p_viewport,bool p_hide); - virtual void viewport_set_disable_environment(RID p_viewport,bool p_disable); - virtual void viewport_attach_camera(RID p_viewport,RID p_camera); - virtual void viewport_set_scenario(RID p_viewport,RID p_scenario); + BIND0R(RID,viewport_create) - virtual RID viewport_get_attached_camera(RID p_viewport) const; - virtual RID viewport_get_scenario(RID p_viewport) const; - virtual void viewport_attach_canvas(RID p_viewport,RID p_canvas); - virtual void viewport_remove_canvas(RID p_viewport,RID p_canvas); - virtual void viewport_set_canvas_transform(RID p_viewport,RID p_canvas,const Matrix32& p_offset); - virtual Matrix32 viewport_get_canvas_transform(RID p_viewport,RID p_canvas) const; - virtual void viewport_set_global_canvas_transform(RID p_viewport,const Matrix32& p_transform); - virtual Matrix32 viewport_get_global_canvas_transform(RID p_viewport) const; - virtual void viewport_set_canvas_layer(RID p_viewport,RID p_canvas,int p_layer); - virtual void viewport_set_transparent_background(RID p_viewport,bool p_enabled); - virtual bool viewport_has_transparent_background(RID p_viewport) const; + BIND3(viewport_set_size,RID,int ,int ) + BIND2(viewport_set_active,RID ,bool ) + BIND2(viewport_set_parent_viewport,RID,RID) - /* ENVIRONMENT API */ + BIND2(viewport_set_clear_mode,RID,ViewportClearMode ) - virtual RID environment_create(); + BIND3(viewport_attach_to_screen,RID ,const Rect2& ,int ) + BIND1(viewport_detach,RID) - virtual void environment_set_background(RID p_env,EnvironmentBG p_bg); - virtual EnvironmentBG environment_get_background(RID p_env) const; + BIND2(viewport_set_update_mode,RID,ViewportUpdateMode ) + BIND2(viewport_set_vflip,RID,bool) - virtual void environment_set_background_param(RID p_env,EnvironmentBGParam p_param, const Variant& p_value); - virtual Variant environment_get_background_param(RID p_env,EnvironmentBGParam p_param) const; - virtual void environment_set_enable_fx(RID p_env,EnvironmentFx p_effect,bool p_enabled); - virtual bool environment_is_fx_enabled(RID p_env,EnvironmentFx p_effect) const; + BIND1RC(RID,viewport_get_texture,RID ) + BIND2(viewport_set_hide_scenario,RID,bool ) + BIND2(viewport_set_hide_canvas,RID,bool ) + BIND2(viewport_set_disable_environment,RID,bool ) + BIND2(viewport_set_disable_3d,RID,bool ) - virtual void environment_fx_set_param(RID p_env,EnvironmentFxParam p_effect,const Variant& p_param); - virtual Variant environment_fx_get_param(RID p_env,EnvironmentFxParam p_effect) const; + BIND2(viewport_attach_camera,RID,RID ) + BIND2(viewport_set_scenario,RID,RID ) + BIND2(viewport_attach_canvas,RID,RID ) + BIND2(viewport_remove_canvas,RID,RID ) + BIND3(viewport_set_canvas_transform,RID ,RID ,const Transform2D& ) + BIND2(viewport_set_transparent_background,RID ,bool ) - /* SCENARIO API */ + BIND2(viewport_set_global_canvas_transform,RID,const Transform2D& ) + BIND3(viewport_set_canvas_layer,RID ,RID ,int ) + BIND2(viewport_set_shadow_atlas_size,RID ,int ) + BIND3(viewport_set_shadow_atlas_quadrant_subdivision,RID ,int, int ) + BIND2(viewport_set_msaa,RID ,ViewportMSAA ) + BIND2(viewport_set_hdr,RID ,bool ) - virtual RID scenario_create(); - virtual void scenario_set_debug(RID p_scenario,ScenarioDebugMode p_debug_mode); - virtual void scenario_set_environment(RID p_scenario, RID p_environment); - virtual RID scenario_get_environment(RID p_scenario, RID p_environment) const; - virtual void scenario_set_fallback_environment(RID p_scenario, RID p_environment); + /* ENVIRONMENT API */ +#undef BINDBASE +//from now on, calls forwarded to this singleton +#define BINDBASE VSG::scene_render + BIND0R(RID,environment_create) - /* INSTANCING API */ + BIND2(environment_set_background,RID ,EnvironmentBG ) + BIND2(environment_set_skybox,RID,RID ) + BIND2(environment_set_skybox_scale,RID,float) + BIND2(environment_set_bg_color,RID,const Color& ) + BIND2(environment_set_bg_energy,RID,float ) + BIND2(environment_set_canvas_max_layer,RID,int ) + BIND4(environment_set_ambient_light,RID,const Color& ,float,float ) + BIND8(environment_set_ssr,RID,bool,int,float,float,float,bool,bool ) + BIND10(environment_set_ssao,RID ,bool , float , float , float,float,float , float ,const Color &,bool ) - virtual RID instance_create(); - virtual void instance_set_base(RID p_instance, RID p_base); - virtual RID instance_get_base(RID p_instance) const; - virtual void instance_set_scenario(RID p_instance, RID p_scenario); - virtual RID instance_get_scenario(RID p_instance) const; + BIND6(environment_set_dof_blur_near,RID,bool ,float,float,float,EnvironmentDOFBlurQuality) + BIND6(environment_set_dof_blur_far,RID,bool ,float,float,float,EnvironmentDOFBlurQuality) + BIND10(environment_set_glow,RID,bool ,int ,float ,float ,float ,EnvironmentGlowBlendMode,float,float,bool ) + BIND5(environment_set_fog,RID,bool ,float ,float ,RID ) - virtual void instance_set_layer_mask(RID p_instance, uint32_t p_mask); - virtual uint32_t instance_get_layer_mask(RID p_instance) const; + BIND9(environment_set_tonemap,RID,EnvironmentToneMapper, float ,float ,bool, float ,float ,float,float ) - virtual AABB instance_get_base_aabb(RID p_instance) const; + BIND6(environment_set_adjustment,RID,bool ,float ,float ,float ,RID ) - virtual void instance_attach_object_instance_ID(RID p_instance,uint32_t p_ID); - virtual uint32_t instance_get_object_instance_ID(RID p_instance) const; - virtual void instance_attach_skeleton(RID p_instance,RID p_skeleton); - virtual RID instance_get_skeleton(RID p_instance) const; + /* SCENARIO API */ - virtual void instance_set_morph_target_weight(RID p_instance,int p_shape, float p_weight); - virtual float instance_get_morph_target_weight(RID p_instance,int p_shape) const; - virtual void instance_set_surface_material(RID p_instance,int p_surface, RID p_material); +#undef BINDBASE +#define BINDBASE VSG::scene + BIND0R(RID,scenario_create) - virtual void instance_set_transform(RID p_instance, const Transform& p_transform); - virtual Transform instance_get_transform(RID p_instance) const; + BIND2(scenario_set_debug,RID,ScenarioDebugMode ) + BIND2(scenario_set_environment,RID, RID ) + BIND3(scenario_set_reflection_atlas_size,RID, int,int ) + BIND2(scenario_set_fallback_environment,RID, RID ) - virtual void instance_set_exterior( RID p_instance, bool p_enabled ); - virtual bool instance_is_exterior( RID p_instance) const; - virtual void instance_set_room( RID p_instance, RID p_room ); - virtual RID instance_get_room( RID p_instance ) const ; + /* INSTANCING API */ + // from can be mesh, light, area and portal so far. + BIND0R(RID,instance_create) - virtual void instance_set_extra_visibility_margin( RID p_instance, real_t p_margin ); - virtual real_t instance_get_extra_visibility_margin( RID p_instance ) const; + BIND2(instance_set_base,RID, RID ) // from can be mesh, light, poly, area and portal so far. + BIND2(instance_set_scenario,RID, RID ) // from can be mesh, light, poly, area and portal so far. + BIND2(instance_set_layer_mask,RID, uint32_t ) + BIND2(instance_set_transform,RID, const Transform& ) + BIND2(instance_attach_object_instance_ID,RID,ObjectID ) + BIND3(instance_set_morph_target_weight,RID,int , float ) + BIND3(instance_set_surface_material,RID,int , RID ) + BIND2(instance_set_visible,RID ,bool) - virtual Vector<RID> instances_cull_aabb(const AABB& p_aabb, RID p_scenario=RID()) const; - virtual Vector<RID> instances_cull_ray(const Vector3& p_from, const Vector3& p_to, RID p_scenario=RID()) const; - virtual Vector<RID> instances_cull_convex(const Vector<Plane>& p_convex, RID p_scenario=RID()) const; - virtual void instance_geometry_set_flag(RID p_instance,InstanceFlags p_flags,bool p_enabled); - virtual bool instance_geometry_get_flag(RID p_instance,InstanceFlags p_flags) const; + BIND2(instance_attach_skeleton,RID,RID ) + BIND2(instance_set_exterior, RID, bool ) + BIND2(instance_set_room, RID, RID ) - virtual void instance_geometry_set_cast_shadows_setting(RID p_instance, VS::ShadowCastingSetting p_shadow_casting_setting); - virtual VS::ShadowCastingSetting instance_geometry_get_cast_shadows_setting(RID p_instance) const; + BIND2(instance_set_extra_visibility_margin, RID, real_t ) - virtual void instance_geometry_set_material_override(RID p_instance, RID p_material); - virtual RID instance_geometry_get_material_override(RID p_instance) const; + // don't use these in a game! + BIND2RC(Vector<ObjectID>,instances_cull_aabb,const Rect3& , RID) + BIND3RC(Vector<ObjectID>,instances_cull_ray,const Vector3& , const Vector3& , RID ) + BIND2RC(Vector<ObjectID>,instances_cull_convex,const Vector<Plane>& , RID) - virtual void instance_geometry_set_draw_range(RID p_instance,float p_min,float p_max); - virtual float instance_geometry_get_draw_range_max(RID p_instance) const; - virtual float instance_geometry_get_draw_range_min(RID p_instance) const; - virtual void instance_geometry_set_baked_light(RID p_instance,RID p_baked_light); - virtual RID instance_geometry_get_baked_light(RID p_instance) const; + BIND3(instance_geometry_set_flag,RID,InstanceFlags ,bool ) + BIND2(instance_geometry_set_cast_shadows_setting,RID, ShadowCastingSetting ) + BIND2(instance_geometry_set_material_override,RID, RID ) - virtual void instance_geometry_set_baked_light_sampler(RID p_instance,RID p_baked_light_sampler); - virtual RID instance_geometry_get_baked_light_sampler(RID p_instance) const; - virtual void instance_geometry_set_baked_light_texture_index(RID p_instance,int p_tex_id); - virtual int instance_geometry_get_baked_light_texture_index(RID p_instance) const; + BIND5(instance_geometry_set_draw_range,RID,float ,float ,float ,float ) + BIND2(instance_geometry_set_as_instance_lod,RID,RID ) - virtual void instance_light_set_enabled(RID p_instance,bool p_enabled); - virtual bool instance_light_is_enabled(RID p_instance) const; +#undef BINDBASE +//from now on, calls forwarded to this singleton +#define BINDBASE VSG::canvas /* CANVAS (2D) */ - virtual RID canvas_create(); - virtual void canvas_set_item_mirroring(RID p_canvas,RID p_item,const Point2& p_mirroring); - virtual Point2 canvas_get_item_mirroring(RID p_canvas,RID p_item) const; - virtual void canvas_set_modulate(RID p_canvas,const Color& p_color); - - - virtual RID canvas_item_create(); + BIND0R(RID,canvas_create) + BIND3(canvas_set_item_mirroring,RID ,RID ,const Point2& ) + BIND2(canvas_set_modulate,RID,const Color&) - virtual void canvas_item_set_parent(RID p_item,RID p_parent_item); - virtual RID canvas_item_get_parent(RID p_canvas_item) const; - virtual void canvas_item_set_visible(RID p_item,bool p_visible); - virtual bool canvas_item_is_visible(RID p_item) const; + BIND0R(RID,canvas_item_create) + BIND2(canvas_item_set_parent,RID ,RID) - virtual void canvas_item_set_blend_mode(RID p_canvas_item,MaterialBlendMode p_blend); - virtual void canvas_item_set_light_mask(RID p_canvas_item,int p_mask); + BIND2(canvas_item_set_visible,RID,bool ) + BIND2(canvas_item_set_light_mask,RID,int ) + BIND2(canvas_item_set_transform,RID, const Transform2D& ) + BIND2(canvas_item_set_clip,RID, bool ) + BIND2(canvas_item_set_distance_field_mode,RID, bool ) + BIND3(canvas_item_set_custom_rect,RID, bool ,const Rect2& ) + BIND2(canvas_item_set_modulate,RID, const Color& ) + BIND2(canvas_item_set_self_modulate,RID, const Color& ) + BIND2(canvas_item_set_draw_behind_parent,RID, bool ) - //virtual void canvas_item_set_rect(RID p_item, const Rect2& p_rect); - virtual void canvas_item_set_transform(RID p_item, const Matrix32& p_transform); - virtual void canvas_item_set_clip(RID p_item, bool p_clip); - virtual void canvas_item_set_distance_field_mode(RID p_item, bool p_enable); - virtual void canvas_item_set_custom_rect(RID p_item, bool p_custom_rect,const Rect2& p_rect=Rect2()); - virtual void canvas_item_set_opacity(RID p_item, float p_opacity); - virtual float canvas_item_get_opacity(RID p_item, float p_opacity) const; - virtual void canvas_item_set_on_top(RID p_item, bool p_on_top); - virtual bool canvas_item_is_on_top(RID p_item) const; - virtual void canvas_item_set_self_opacity(RID p_item, float p_self_opacity); - virtual float canvas_item_get_self_opacity(RID p_item, float p_self_opacity) const; + BIND6(canvas_item_add_line,RID, const Point2& , const Point2& ,const Color& ,float ,bool ) + BIND3(canvas_item_add_rect,RID, const Rect2& , const Color& ) + BIND4(canvas_item_add_circle,RID, const Point2& , float ,const Color& ) + BIND6(canvas_item_add_texture_rect,RID, const Rect2& , RID ,bool ,const Color& ,bool ) + BIND6(canvas_item_add_texture_rect_region,RID, const Rect2& , RID ,const Rect2& ,const Color& ,bool ) + BIND10(canvas_item_add_nine_patch,RID, const Rect2& , const Rect2& , RID ,const Vector2& , const Vector2& ,NinePatchAxisMode , NinePatchAxisMode,bool ,const Color& ) + BIND6(canvas_item_add_primitive,RID, const Vector<Point2>& , const Vector<Color>& ,const Vector<Point2>& , RID ,float ) + BIND5(canvas_item_add_polygon,RID, const Vector<Point2>& , const Vector<Color>& ,const Vector<Point2>& , RID ) + BIND7(canvas_item_add_triangle_array,RID, const Vector<int>& , const Vector<Point2>& , const Vector<Color>& ,const Vector<Point2>& , RID , int) + BIND3(canvas_item_add_mesh,RID, const RID& ,RID ) + BIND3(canvas_item_add_multimesh,RID, RID ,RID ) + BIND2(canvas_item_add_set_transform,RID,const Transform2D& ) + BIND2(canvas_item_add_clip_ignore,RID, bool ) + BIND2(canvas_item_set_sort_children_by_y,RID, bool ) + BIND2(canvas_item_set_z,RID, int ) + BIND2(canvas_item_set_z_as_relative_to_parent,RID, bool ) + BIND3(canvas_item_set_copy_to_backbuffer,RID, bool ,const Rect2& ) - virtual void canvas_item_attach_viewport(RID p_item, RID p_viewport); + BIND1(canvas_item_clear,RID ) + BIND2(canvas_item_set_draw_index,RID,int) - virtual void canvas_item_add_line(RID p_item, const Point2& p_from, const Point2& p_to, const Color& p_color, float p_width=1.0, bool p_antialiased=false); - virtual void canvas_item_add_rect(RID p_item, const Rect2& p_rect, const Color& p_color); - virtual void canvas_item_add_circle(RID p_item, const Point2& p_pos, float p_radius,const Color& p_color); - virtual void canvas_item_add_texture_rect(RID p_item, const Rect2& p_rect, RID p_texture,bool p_tile=false,const Color& p_modulate=Color(1,1,1),bool p_transpose=false); - virtual void canvas_item_add_texture_rect_region(RID p_item, const Rect2& p_rect, RID p_texture,const Rect2& p_src_rect,const Color& p_modulate=Color(1,1,1),bool p_transpose=false); - virtual void canvas_item_add_style_box(RID p_item, const Rect2& p_rect, const Rect2& p_source, RID p_texture,const Vector2& p_topleft, const Vector2& p_bottomright, bool p_draw_center=true,const Color& p_modulate=Color(1,1,1)); - virtual void canvas_item_add_primitive(RID p_item, const Vector<Point2>& p_points, const Vector<Color>& p_colors,const Vector<Point2>& p_uvs, RID p_texture,float p_width=1.0); - virtual void canvas_item_add_polygon(RID p_item, const Vector<Point2>& p_points, const Vector<Color>& p_colors,const Vector<Point2>& p_uvs=Vector<Point2>(), RID p_texture=RID()); - virtual void canvas_item_add_triangle_array(RID p_item, const Vector<int>& p_indices, const Vector<Point2>& p_points, const Vector<Color>& p_colors,const Vector<Point2>& p_uvs=Vector<Point2>(), RID p_texture=RID(), int p_count=-1); - virtual void canvas_item_add_triangle_array_ptr(RID p_item, int p_count, const int* p_indices, const Point2* p_points, const Color* p_colors,const Point2* p_uvs=NULL, RID p_texture=RID()); - virtual void canvas_item_add_set_transform(RID p_item,const Matrix32& p_transform); - virtual void canvas_item_add_set_blend_mode(RID p_item, MaterialBlendMode p_blend); - virtual void canvas_item_add_clip_ignore(RID p_item, bool p_ignore); - virtual void canvas_item_set_sort_children_by_y(RID p_item, bool p_enable); - virtual void canvas_item_set_z(RID p_item, int p_z); - virtual void canvas_item_set_z_as_relative_to_parent(RID p_item, bool p_enable); - virtual void canvas_item_set_copy_to_backbuffer(RID p_item, bool p_enable,const Rect2& p_rect); + BIND2(canvas_item_set_material,RID, RID ) - virtual void canvas_item_set_material(RID p_item, RID p_material); - virtual void canvas_item_set_use_parent_material(RID p_item, bool p_enable); + BIND2(canvas_item_set_use_parent_material,RID, bool ) - virtual RID canvas_light_create(); - virtual void canvas_light_attach_to_canvas(RID p_light,RID p_canvas); - virtual void canvas_light_set_enabled(RID p_light, bool p_enabled); - virtual void canvas_light_set_transform(RID p_light, const Matrix32& p_transform); - virtual void canvas_light_set_scale(RID p_light, float p_scale); - virtual void canvas_light_set_texture(RID p_light, RID p_texture); - virtual void canvas_light_set_texture_offset(RID p_light, const Vector2& p_offset); - virtual void canvas_light_set_color(RID p_light, const Color& p_color); - virtual void canvas_light_set_height(RID p_light, float p_height); - virtual void canvas_light_set_energy(RID p_light, float p_energy); - virtual void canvas_light_set_z_range(RID p_light, int p_min_z,int p_max_z); - virtual void canvas_light_set_layer_range(RID p_light, int p_min_layer,int p_max_layer); - virtual void canvas_light_set_item_mask(RID p_light, int p_mask); - virtual void canvas_light_set_item_shadow_mask(RID p_light, int p_mask); - virtual void canvas_light_set_mode(RID p_light, CanvasLightMode p_mode); - virtual void canvas_light_set_shadow_enabled(RID p_light, bool p_enabled); - virtual void canvas_light_set_shadow_buffer_size(RID p_light, int p_size); - virtual void canvas_light_set_shadow_esm_multiplier(RID p_light, float p_multiplier); - virtual void canvas_light_set_shadow_color(RID p_light, const Color& p_color); + BIND0R(RID,canvas_light_create) + BIND2(canvas_light_attach_to_canvas,RID,RID ) + BIND2(canvas_light_set_enabled,RID, bool ) + BIND2(canvas_light_set_scale,RID, float ) + BIND2(canvas_light_set_transform,RID, const Transform2D& ) + BIND2(canvas_light_set_texture,RID, RID ) + BIND2(canvas_light_set_texture_offset,RID, const Vector2& ) + BIND2(canvas_light_set_color,RID, const Color& ) + BIND2(canvas_light_set_height,RID, float ) + BIND2(canvas_light_set_energy,RID, float ) + BIND3(canvas_light_set_z_range,RID, int ,int ) + BIND3(canvas_light_set_layer_range,RID, int ,int ) + BIND2(canvas_light_set_item_cull_mask,RID, int ) + BIND2(canvas_light_set_item_shadow_cull_mask,RID, int ) + BIND2(canvas_light_set_mode,RID, CanvasLightMode ) + BIND2(canvas_light_set_shadow_enabled,RID, bool ) + BIND2(canvas_light_set_shadow_buffer_size,RID, int ) + BIND2(canvas_light_set_shadow_gradient_length,RID, float ) + BIND2(canvas_light_set_shadow_filter,RID, CanvasLightShadowFilter ) + BIND2(canvas_light_set_shadow_color,RID, const Color& ) - virtual RID canvas_light_occluder_create(); - virtual void canvas_light_occluder_attach_to_canvas(RID p_occluder,RID p_canvas); - virtual void canvas_light_occluder_set_enabled(RID p_occluder,bool p_enabled); - virtual void canvas_light_occluder_set_polygon(RID p_occluder,RID p_polygon); - virtual void canvas_light_occluder_set_transform(RID p_occluder,const Matrix32& p_xform); - virtual void canvas_light_occluder_set_light_mask(RID p_occluder,int p_mask); - virtual RID canvas_occluder_polygon_create(); - virtual void canvas_occluder_polygon_set_shape(RID p_occluder_polygon,const DVector<Vector2>& p_shape,bool p_close); - virtual void canvas_occluder_polygon_set_shape_as_lines(RID p_occluder_polygon,const DVector<Vector2>& p_shape); - virtual void canvas_occluder_polygon_set_cull_mode(RID p_occluder_polygon,CanvasOccluderPolygonCullMode p_mode); + BIND0R(RID,canvas_light_occluder_create) + BIND2(canvas_light_occluder_attach_to_canvas,RID,RID ) + BIND2(canvas_light_occluder_set_enabled,RID,bool ) + BIND2(canvas_light_occluder_set_polygon,RID,RID ) + BIND2(canvas_light_occluder_set_transform,RID,const Transform2D& ) + BIND2(canvas_light_occluder_set_light_mask,RID,int ) + BIND0R(RID,canvas_occluder_polygon_create) + BIND3(canvas_occluder_polygon_set_shape,RID,const PoolVector<Vector2>& ,bool) + BIND2(canvas_occluder_polygon_set_shape_as_lines,RID ,const PoolVector<Vector2>&) - virtual void canvas_item_clear(RID p_item); - virtual void canvas_item_raise(RID p_item); - - /* CANVAS ITEM MATERIAL */ - - virtual RID canvas_item_material_create(); - virtual void canvas_item_material_set_shader(RID p_material, RID p_shader); - virtual void canvas_item_material_set_shader_param(RID p_material, const StringName& p_param, const Variant& p_value); - virtual Variant canvas_item_material_get_shader_param(RID p_material, const StringName& p_param) const; - virtual void canvas_item_material_set_shading_mode(RID p_material, CanvasItemShadingMode p_mode); + BIND2(canvas_occluder_polygon_set_cull_mode,RID,CanvasOccluderPolygonCullMode) /* CURSOR */ virtual void cursor_set_rotation(float p_rotation, int p_cursor = 0); // radians - virtual void cursor_set_texture(RID p_texture, const Point2 &p_center_offset, int p_cursor=0, const Rect2 &p_region=Rect2()); + virtual void cursor_set_texture(RID p_texture, const Point2 &p_center_offset = Point2(0, 0), int p_cursor=0, const Rect2 &p_region=Rect2()); virtual void cursor_set_visible(bool p_visible, int p_cursor = 0); virtual void cursor_set_pos(const Point2& p_pos, int p_cursor = 0); /* BLACK BARS */ + virtual void black_bars_set_margins(int p_left, int p_top, int p_right, int p_bottom); virtual void black_bars_set_images(RID p_left, RID p_top, RID p_right, RID p_bottom); - /* FREE */ - - virtual void free( RID p_rid ); - /* CUSTOM SHADE MODEL */ + /* FREE */ - virtual void custom_shade_model_set_shader(int p_model, RID p_shader); - virtual RID custom_shade_model_get_shader(int p_model) const; - virtual void custom_shade_model_set_name(int p_model, const String& p_name); - virtual String custom_shade_model_get_name(int p_model) const; - virtual void custom_shade_model_set_param_info(int p_model, const List<PropertyInfo>& p_info); - virtual void custom_shade_model_get_param_info(int p_model, List<PropertyInfo>* p_info) const; + virtual void free( RID p_rid ); ///< free RIDs associated with the visual server /* EVENT QUEUING */ virtual void draw(); virtual void sync(); - + virtual bool has_changed() const; virtual void init(); virtual void finish(); - virtual bool has_changed() const; + /* STATUS INFORMATION */ - /* RENDER INFO */ virtual int get_render_info(RenderInfo p_info); - virtual bool has_feature(Features p_feature) const; - RID get_test_cube(); + virtual RID get_test_cube(); - virtual void set_boot_image(const Image& p_image, const Color& p_color, bool p_scale); + + /* TESTING */ + + virtual void set_boot_image(const Image& p_image, const Color& p_color,bool p_scale); virtual void set_default_clear_color(const Color& p_color); - virtual Color get_default_clear_color() const; - VisualServerRaster(Rasterizer *p_rasterizer); + virtual bool has_feature(Features p_feature) const; + + + VisualServerRaster(); ~VisualServerRaster(); +#undef DISPLAY_CHANGED + +#undef BIND0R +#undef BIND1RC +#undef BIND2RC +#undef BIND3RC +#undef BIND4RC + +#undef BIND1 +#undef BIND2 +#undef BIND3 +#undef BIND4 +#undef BIND5 +#undef BIND6 +#undef BIND7 +#undef BIND8 +#undef BIND9 +#undef BIND10 + }; #endif diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp new file mode 100644 index 0000000000..4635b0fcfe --- /dev/null +++ b/servers/visual/visual_server_scene.cpp @@ -0,0 +1,3610 @@ +#include "visual_server_scene.h" +#include "visual_server_global.h" +#include "os/os.h" +/* CAMERA API */ + + + + + +RID VisualServerScene::camera_create() { + + Camera * camera = memnew( Camera ); + return camera_owner.make_rid( camera ); + +} + +void VisualServerScene::camera_set_perspective(RID p_camera,float p_fovy_degrees, float p_z_near, float p_z_far) { + + Camera *camera = camera_owner.get( p_camera ); + ERR_FAIL_COND(!camera); + camera->type=Camera::PERSPECTIVE; + camera->fov=p_fovy_degrees; + camera->znear=p_z_near; + camera->zfar=p_z_far; + +} + +void VisualServerScene::camera_set_orthogonal(RID p_camera,float p_size, float p_z_near, float p_z_far) { + + Camera *camera = camera_owner.get( p_camera ); + ERR_FAIL_COND(!camera); + camera->type=Camera::ORTHOGONAL; + camera->size=p_size; + camera->znear=p_z_near; + camera->zfar=p_z_far; +} + +void VisualServerScene::camera_set_transform(RID p_camera,const Transform& p_transform) { + + Camera *camera = camera_owner.get( p_camera ); + ERR_FAIL_COND(!camera); + camera->transform=p_transform.orthonormalized(); + + +} + +void VisualServerScene::camera_set_cull_mask(RID p_camera,uint32_t p_layers) { + + + Camera *camera = camera_owner.get( p_camera ); + ERR_FAIL_COND(!camera); + + camera->visible_layers=p_layers; + +} + +void VisualServerScene::camera_set_environment(RID p_camera,RID p_env) { + + Camera *camera = camera_owner.get( p_camera ); + ERR_FAIL_COND(!camera); + camera->env=p_env; + +} + + +void VisualServerScene::camera_set_use_vertical_aspect(RID p_camera,bool p_enable) { + + Camera *camera = camera_owner.get( p_camera ); + ERR_FAIL_COND(!camera); + camera->vaspect=p_enable; + +} + + +/* SCENARIO API */ + + + +void* VisualServerScene::_instance_pair(void *p_self, OctreeElementID, Instance *p_A,int, OctreeElementID, Instance *p_B,int) { + +// VisualServerScene *self = (VisualServerScene*)p_self; + Instance *A = p_A; + Instance *B = p_B; + + //instance indices are designed so greater always contains lesser + if (A->base_type > B->base_type) { + SWAP(A,B); //lesser always first + } + + if (B->base_type==VS::INSTANCE_LIGHT && (1<<A->base_type)&VS::INSTANCE_GEOMETRY_MASK) { + + InstanceLightData * light = static_cast<InstanceLightData*>(B->base_data); + InstanceGeometryData * geom = static_cast<InstanceGeometryData*>(A->base_data); + + + InstanceLightData::PairInfo pinfo; + pinfo.geometry=A; + pinfo.L = geom->lighting.push_back(B); + + List<InstanceLightData::PairInfo>::Element *E = light->geometries.push_back(pinfo); + + if (geom->can_cast_shadows) { + + light->shadow_dirty=true; + } + geom->lighting_dirty=true; + + return E; //this element should make freeing faster + } else if (B->base_type==VS::INSTANCE_REFLECTION_PROBE && (1<<A->base_type)&VS::INSTANCE_GEOMETRY_MASK) { + + InstanceReflectionProbeData * reflection_probe = static_cast<InstanceReflectionProbeData*>(B->base_data); + InstanceGeometryData * geom = static_cast<InstanceGeometryData*>(A->base_data); + + + InstanceReflectionProbeData::PairInfo pinfo; + pinfo.geometry=A; + pinfo.L = geom->reflection_probes.push_back(B); + + List<InstanceReflectionProbeData::PairInfo>::Element *E = reflection_probe->geometries.push_back(pinfo); + + geom->reflection_dirty=true; + + return E; //this element should make freeing faster + } else if (B->base_type==VS::INSTANCE_GI_PROBE && (1<<A->base_type)&VS::INSTANCE_GEOMETRY_MASK) { + + InstanceGIProbeData * gi_probe = static_cast<InstanceGIProbeData*>(B->base_data); + InstanceGeometryData * geom = static_cast<InstanceGeometryData*>(A->base_data); + + + InstanceGIProbeData::PairInfo pinfo; + pinfo.geometry=A; + pinfo.L = geom->gi_probes.push_back(B); + + List<InstanceGIProbeData::PairInfo>::Element *E = gi_probe->geometries.push_back(pinfo); + + geom->gi_probes_dirty=true; + + return E; //this element should make freeing faster + + } else if (B->base_type==VS::INSTANCE_GI_PROBE && A->base_type==VS::INSTANCE_LIGHT) { + + InstanceGIProbeData * gi_probe = static_cast<InstanceGIProbeData*>(B->base_data); + InstanceLightData * light = static_cast<InstanceLightData*>(A->base_data); + + return gi_probe->lights.insert(A); + } + + + +#if 0 + if (A->base_type==INSTANCE_PORTAL) { + + ERR_FAIL_COND_V( B->base_type!=INSTANCE_PORTAL,NULL ); + + A->portal_info->candidate_set.insert(B); + B->portal_info->candidate_set.insert(A); + + self->_portal_attempt_connect(A); + //attempt to conncet portal A (will go through B anyway) + //this is a little hackish, but works fine in practice + + } else if (A->base_type==INSTANCE_GI_PROBE || B->base_type==INSTANCE_GI_PROBE) { + + if (B->base_type==INSTANCE_GI_PROBE) { + SWAP(A,B); + } + + ERR_FAIL_COND_V(B->base_type!=INSTANCE_GI_PROBE_SAMPLER,NULL); + B->gi_probe_sampler_info->gi_probes.insert(A); + + } else if (A->base_type==INSTANCE_ROOM || B->base_type==INSTANCE_ROOM) { + + if (B->base_type==INSTANCE_ROOM) + SWAP(A,B); + + ERR_FAIL_COND_V(! ((1<<B->base_type)&INSTANCE_GEOMETRY_MASK ),NULL); + + B->auto_rooms.insert(A); + A->room_info->owned_autoroom_geometry.insert(B); + + self->_instance_validate_autorooms(B); + + + } else { + + if (B->base_type==INSTANCE_LIGHT) { + + SWAP(A,B); + } else if (A->base_type!=INSTANCE_LIGHT) { + return NULL; + } + + + A->light_info->affected.insert(B); + B->lights.insert(A); + B->light_cache_dirty=true; + + + } +#endif + + return NULL; + +} +void VisualServerScene::_instance_unpair(void *p_self, OctreeElementID, Instance *p_A,int, OctreeElementID, Instance *p_B,int,void* udata) { + +// VisualServerScene *self = (VisualServerScene*)p_self; + Instance *A = p_A; + Instance *B = p_B; + + //instance indices are designed so greater always contains lesser + if (A->base_type > B->base_type) { + SWAP(A,B); //lesser always first + } + + + + if (B->base_type==VS::INSTANCE_LIGHT && (1<<A->base_type)&VS::INSTANCE_GEOMETRY_MASK) { + + InstanceLightData * light = static_cast<InstanceLightData*>(B->base_data); + InstanceGeometryData * geom = static_cast<InstanceGeometryData*>(A->base_data); + + List<InstanceLightData::PairInfo>::Element *E = reinterpret_cast<List<InstanceLightData::PairInfo>::Element*>(udata); + + geom->lighting.erase(E->get().L); + light->geometries.erase(E); + + if (geom->can_cast_shadows) { + light->shadow_dirty=true; + } + geom->lighting_dirty=true; + + + } else if (B->base_type==VS::INSTANCE_REFLECTION_PROBE && (1<<A->base_type)&VS::INSTANCE_GEOMETRY_MASK) { + + InstanceReflectionProbeData * reflection_probe = static_cast<InstanceReflectionProbeData*>(B->base_data); + InstanceGeometryData * geom = static_cast<InstanceGeometryData*>(A->base_data); + + List<InstanceReflectionProbeData::PairInfo>::Element *E = reinterpret_cast<List<InstanceReflectionProbeData::PairInfo>::Element*>(udata); + + geom->reflection_probes.erase(E->get().L); + reflection_probe->geometries.erase(E); + + geom->reflection_dirty=true; + + } else if (B->base_type==VS::INSTANCE_GI_PROBE && (1<<A->base_type)&VS::INSTANCE_GEOMETRY_MASK) { + + InstanceGIProbeData * gi_probe = static_cast<InstanceGIProbeData*>(B->base_data); + InstanceGeometryData * geom = static_cast<InstanceGeometryData*>(A->base_data); + + List<InstanceGIProbeData::PairInfo>::Element *E = reinterpret_cast<List<InstanceGIProbeData::PairInfo>::Element*>(udata); + + geom->gi_probes.erase(E->get().L); + gi_probe->geometries.erase(E); + + geom->gi_probes_dirty=true; + + + } else if (B->base_type==VS::INSTANCE_GI_PROBE && A->base_type==VS::INSTANCE_LIGHT) { + + InstanceGIProbeData * gi_probe = static_cast<InstanceGIProbeData*>(B->base_data); + InstanceLightData * light = static_cast<InstanceLightData*>(A->base_data); + + + Set<Instance*>::Element *E = reinterpret_cast<Set<Instance*>::Element*>(udata); + + gi_probe->lights.erase(E); + } +#if 0 + if (A->base_type==INSTANCE_PORTAL) { + + ERR_FAIL_COND( B->base_type!=INSTANCE_PORTAL ); + + + A->portal_info->candidate_set.erase(B); + B->portal_info->candidate_set.erase(A); + + //after disconnecting them, see if they can connect again + self->_portal_attempt_connect(A); + self->_portal_attempt_connect(B); + + } else if (A->base_type==INSTANCE_GI_PROBE || B->base_type==INSTANCE_GI_PROBE) { + + if (B->base_type==INSTANCE_GI_PROBE) { + SWAP(A,B); + } + + ERR_FAIL_COND(B->base_type!=INSTANCE_GI_PROBE_SAMPLER); + B->gi_probe_sampler_info->gi_probes.erase(A); + + } else if (A->base_type==INSTANCE_ROOM || B->base_type==INSTANCE_ROOM) { + + if (B->base_type==INSTANCE_ROOM) + SWAP(A,B); + + ERR_FAIL_COND(! ((1<<B->base_type)&INSTANCE_GEOMETRY_MASK )); + + B->auto_rooms.erase(A); + B->valid_auto_rooms.erase(A); + A->room_info->owned_autoroom_geometry.erase(B); + + }else { + + + + if (B->base_type==INSTANCE_LIGHT) { + + SWAP(A,B); + } else if (A->base_type!=INSTANCE_LIGHT) { + return; + } + + + A->light_info->affected.erase(B); + B->lights.erase(A); + B->light_cache_dirty=true; + + } +#endif +} + +RID VisualServerScene::scenario_create() { + + Scenario *scenario = memnew( Scenario ); + ERR_FAIL_COND_V(!scenario,RID()); + RID scenario_rid = scenario_owner.make_rid( scenario ); + scenario->self=scenario_rid; + + scenario->octree.set_pair_callback(_instance_pair,this); + scenario->octree.set_unpair_callback(_instance_unpair,this); + scenario->reflection_probe_shadow_atlas=VSG::scene_render->shadow_atlas_create(); + VSG::scene_render->shadow_atlas_set_size(scenario->reflection_probe_shadow_atlas,1024); //make enough shadows for close distance, don't bother with rest + VSG::scene_render->shadow_atlas_set_quadrant_subdivision(scenario->reflection_probe_shadow_atlas,0,4); + VSG::scene_render->shadow_atlas_set_quadrant_subdivision(scenario->reflection_probe_shadow_atlas,1,4); + VSG::scene_render->shadow_atlas_set_quadrant_subdivision(scenario->reflection_probe_shadow_atlas,2,4); + VSG::scene_render->shadow_atlas_set_quadrant_subdivision(scenario->reflection_probe_shadow_atlas,3,8); + scenario->reflection_atlas=VSG::scene_render->reflection_atlas_create(); + + return scenario_rid; +} + +void VisualServerScene::scenario_set_debug(RID p_scenario,VS::ScenarioDebugMode p_debug_mode) { + + Scenario *scenario = scenario_owner.get(p_scenario); + ERR_FAIL_COND(!scenario); + scenario->debug=p_debug_mode; +} + +void VisualServerScene::scenario_set_environment(RID p_scenario, RID p_environment) { + + Scenario *scenario = scenario_owner.get(p_scenario); + ERR_FAIL_COND(!scenario); + scenario->environment=p_environment; + +} + +void VisualServerScene::scenario_set_fallback_environment(RID p_scenario, RID p_environment) { + + + Scenario *scenario = scenario_owner.get(p_scenario); + ERR_FAIL_COND(!scenario); + scenario->fallback_environment=p_environment; + + +} + +void VisualServerScene::scenario_set_reflection_atlas_size(RID p_scenario, int p_size,int p_subdiv) { + + Scenario *scenario = scenario_owner.get(p_scenario); + ERR_FAIL_COND(!scenario); + VSG::scene_render->reflection_atlas_set_size(scenario->reflection_atlas,p_size); + VSG::scene_render->reflection_atlas_set_subdivision(scenario->reflection_atlas,p_subdiv); + + +} + + + +/* INSTANCING API */ + +void VisualServerScene::_instance_queue_update(Instance *p_instance,bool p_update_aabb,bool p_update_materials) { + + if (p_update_aabb) + p_instance->update_aabb=true; + if (p_update_materials) + p_instance->update_materials=true; + + if (p_instance->update_item.in_list()) + return; + + _instance_update_list.add(&p_instance->update_item); + + +} + +// from can be mesh, light, area and portal so far. +RID VisualServerScene::instance_create(){ + + Instance *instance = memnew( Instance ); + ERR_FAIL_COND_V(!instance,RID()); + + RID instance_rid = instance_owner.make_rid(instance); + instance->self=instance_rid; + + + return instance_rid; + + +} + +void VisualServerScene::instance_set_base(RID p_instance, RID p_base){ + + Instance *instance = instance_owner.get( p_instance ); + ERR_FAIL_COND( !instance ); + + Scenario *scenario = instance->scenario; + + if (instance->base_type!=VS::INSTANCE_NONE) { + //free anything related to that base + + VSG::storage->instance_remove_dependency(instance->base,instance); + + if (scenario && instance->octree_id) { + scenario->octree.erase(instance->octree_id); //make dependencies generated by the octree go away + instance->octree_id=0; + } + + switch(instance->base_type) { + case VS::INSTANCE_LIGHT: { + + InstanceLightData *light = static_cast<InstanceLightData*>(instance->base_data); + + if (instance->scenario && light->D) { + instance->scenario->directional_lights.erase( light->D ); + light->D=NULL; + } + VSG::scene_render->free(light->instance); + } break; + case VS::INSTANCE_REFLECTION_PROBE: { + + InstanceReflectionProbeData *reflection_probe = static_cast<InstanceReflectionProbeData*>(instance->base_data); + VSG::scene_render->free(reflection_probe->instance); + if (reflection_probe->update_list.in_list()) { + reflection_probe_render_list.remove(&reflection_probe->update_list); + } + } break; + case VS::INSTANCE_GI_PROBE: { + + InstanceGIProbeData *gi_probe = static_cast<InstanceGIProbeData*>(instance->base_data); + + while(gi_probe->dynamic.updating_stage==GI_UPDATE_STAGE_LIGHTING) { + //wait until bake is done if it's baking + OS::get_singleton()->delay_usec(1); + } + if (gi_probe->update_element.in_list()) { + gi_probe_update_list.remove(&gi_probe->update_element); + } + if (gi_probe->dynamic.probe_data.is_valid()) { + VSG::storage->free(gi_probe->dynamic.probe_data); + } + + VSG::scene_render->free(gi_probe->probe_instance); + + } break; + + } + + if (instance->base_data) { + memdelete( instance->base_data ); + instance->base_data=NULL; + } + + instance->morph_values.clear(); + + for(int i=0;i<instance->materials.size();i++) { + if (instance->materials[i].is_valid()) { + VSG::storage->material_remove_instance_owner(instance->materials[i],instance); + } + } + instance->materials.clear(); + +#if 0 + if (instance->light_info) { + + if (instance->scenario && instance->light_info->D) + instance->scenario->directional_lights.erase( instance->light_info->D ); + rasterizer->free(instance->light_info->instance); + memdelete(instance->light_info); + instance->light_info=NULL; + } + + + + if ( instance->room ) { + + instance_set_room(p_instance,RID()); + /* + if((1<<instance->base_type)&INSTANCE_GEOMETRY_MASK) + instance->room->room_info->owned_geometry_instances.erase(instance->RE); + else if (instance->base_type==INSTANCE_PORTAL) { + print_line("freeing portal, is it there? "+itos(instance->room->room_info->owned_portal_instances.(instance->RE))); + instance->room->room_info->owned_portal_instances.erase(instance->RE); + } else if (instance->base_type==INSTANCE_ROOM) + instance->room->room_info->owned_room_instances.erase(instance->RE); + else if (instance->base_type==INSTANCE_LIGHT) + instance->room->room_info->owned_light_instances.erase(instance->RE); + + instance->RE=NULL;*/ + } + + + + + + + if (instance->portal_info) { + + _portal_disconnect(instance,true); + memdelete(instance->portal_info); + instance->portal_info=NULL; + + } + + if (instance->gi_probe_info) { + + while(instance->gi_probe_info->owned_instances.size()) { + + Instance *owned=instance->gi_probe_info->owned_instances.front()->get(); + owned->gi_probe=NULL; + owned->data.gi_probe=NULL; + owned->data.gi_probe_octree_xform=NULL; + owned->BLE=NULL; + instance->gi_probe_info->owned_instances.pop_front(); + } + + memdelete(instance->gi_probe_info); + instance->gi_probe_info=NULL; + + } + + if (instance->scenario && instance->octree_id) { + instance->scenario->octree.erase( instance->octree_id ); + instance->octree_id=0; + } + + + if (instance->room_info) { + + for(List<Instance*>::Element *E=instance->room_info->owned_geometry_instances.front();E;E=E->next()) { + + Instance *owned = E->get(); + owned->room=NULL; + owned->RE=NULL; + } + for(List<Instance*>::Element *E=instance->room_info->owned_portal_instances.front();E;E=E->next()) { + + _portal_disconnect(E->get(),true); + Instance *owned = E->get(); + owned->room=NULL; + owned->RE=NULL; + } + + for(List<Instance*>::Element *E=instance->room_info->owned_room_instances.front();E;E=E->next()) { + + Instance *owned = E->get(); + owned->room=NULL; + owned->RE=NULL; + } + + if (instance->room_info->disconnected_child_portals.size()) { + ERR_PRINT("BUG: Disconnected portals remain!"); + } + memdelete(instance->room_info); + instance->room_info=NULL; + + } + + if (instance->particles_info) { + + rasterizer->free( instance->particles_info->instance ); + memdelete(instance->particles_info); + instance->particles_info=NULL; + + } + + if (instance->gi_probe_sampler_info) { + + while (instance->gi_probe_sampler_info->owned_instances.size()) { + + instance_geometry_set_gi_probe_sampler(instance->gi_probe_sampler_info->owned_instances.front()->get()->self,RID()); + } + + if (instance->gi_probe_sampler_info->sampled_light.is_valid()) { + rasterizer->free(instance->gi_probe_sampler_info->sampled_light); + } + memdelete( instance->gi_probe_sampler_info ); + instance->gi_probe_sampler_info=NULL; + } +#endif + + } + + + instance->base_type=VS::INSTANCE_NONE; + instance->base=RID(); + + + if (p_base.is_valid()) { + + instance->base_type=VSG::storage->get_base_type(p_base); + ERR_FAIL_COND(instance->base_type==VS::INSTANCE_NONE); + + switch(instance->base_type) { + case VS::INSTANCE_LIGHT: { + + InstanceLightData *light = memnew( InstanceLightData ); + + if (scenario && VSG::storage->light_get_type(p_base)==VS::LIGHT_DIRECTIONAL) { + light->D = scenario->directional_lights.push_back(instance); + } + + light->instance = VSG::scene_render->light_instance_create(p_base); + + instance->base_data=light; + } break; + case VS::INSTANCE_MESH: + case VS::INSTANCE_MULTIMESH: + case VS::INSTANCE_IMMEDIATE: { + + InstanceGeometryData *geom = memnew( InstanceGeometryData ); + instance->base_data=geom; + } break; + case VS::INSTANCE_REFLECTION_PROBE: { + + InstanceReflectionProbeData *reflection_probe = memnew( InstanceReflectionProbeData ); + reflection_probe->owner=instance; + instance->base_data=reflection_probe; + + reflection_probe->instance=VSG::scene_render->reflection_probe_instance_create(p_base); + } break; + case VS::INSTANCE_GI_PROBE: { + + InstanceGIProbeData *gi_probe = memnew( InstanceGIProbeData ); + instance->base_data=gi_probe; + gi_probe->owner=instance; + + if (scenario && !gi_probe->update_element.in_list()) { + gi_probe_update_list.add(&gi_probe->update_element); + } + + gi_probe->probe_instance=VSG::scene_render->gi_probe_instance_create(); + + } break; + + } + + VSG::storage->instance_add_dependency(p_base,instance); + + instance->base=p_base; + + if (scenario) + _instance_queue_update(instance,true,true); + + +#if 0 + if (rasterizer->is_mesh(p_base)) { + instance->base_type=INSTANCE_MESH; + instance->data.morph_values.resize( rasterizer->mesh_get_morph_target_count(p_base)); + instance->data.materials.resize( rasterizer->mesh_get_surface_count(p_base)); + } else if (rasterizer->is_multimesh(p_base)) { + instance->base_type=INSTANCE_MULTIMESH; + } else if (rasterizer->is_immediate(p_base)) { + instance->base_type=INSTANCE_IMMEDIATE; + } else if (rasterizer->is_particles(p_base)) { + instance->base_type=INSTANCE_PARTICLES; + instance->particles_info=memnew( Instance::ParticlesInfo ); + instance->particles_info->instance = rasterizer->particles_instance_create( p_base ); + } else if (rasterizer->is_light(p_base)) { + + instance->base_type=INSTANCE_LIGHT; + instance->light_info = memnew( Instance::LightInfo ); + instance->light_info->instance = rasterizer->light_instance_create(p_base); + if (instance->scenario && rasterizer->light_get_type(p_base)==LIGHT_DIRECTIONAL) { + + instance->light_info->D = instance->scenario->directional_lights.push_back(instance->self); + } + + } else if (room_owner.owns(p_base)) { + instance->base_type=INSTANCE_ROOM; + instance->room_info = memnew( Instance::RoomInfo ); + instance->room_info->room=room_owner.get(p_base); + } else if (portal_owner.owns(p_base)) { + + instance->base_type=INSTANCE_PORTAL; + instance->portal_info = memnew(Instance::PortalInfo); + instance->portal_info->portal=portal_owner.get(p_base); + } else if (gi_probe_owner.owns(p_base)) { + + instance->base_type=INSTANCE_GI_PROBE; + instance->gi_probe_info=memnew(Instance::BakedLightInfo); + instance->gi_probe_info->gi_probe=gi_probe_owner.get(p_base); + + //instance->portal_info = memnew(Instance::PortalInfo); + //instance->portal_info->portal=portal_owner.get(p_base); + } else if (gi_probe_sampler_owner.owns(p_base)) { + + + instance->base_type=INSTANCE_GI_PROBE_SAMPLER; + instance->gi_probe_sampler_info=memnew( Instance::BakedLightSamplerInfo); + instance->gi_probe_sampler_info->sampler=gi_probe_sampler_owner.get(p_base); + + //instance->portal_info = memnew(Instance::PortalInfo); + //instance->portal_info->portal=portal_owner.get(p_base); + + } else { + ERR_EXPLAIN("Invalid base RID for instance!") + ERR_FAIL(); + } + + instance_dependency_map[ p_base ].insert( instance->self ); +#endif + + + } +} +void VisualServerScene::instance_set_scenario(RID p_instance, RID p_scenario){ + + Instance *instance = instance_owner.get( p_instance ); + ERR_FAIL_COND( !instance ); + + if (instance->scenario) { + + instance->scenario->instances.remove( &instance->scenario_item ); + + if (instance->octree_id) { + instance->scenario->octree.erase(instance->octree_id); //make dependencies generated by the octree go away + instance->octree_id=0; + } + + + switch(instance->base_type) { + + case VS::INSTANCE_LIGHT: { + + + InstanceLightData *light = static_cast<InstanceLightData*>(instance->base_data); + + if (light->D) { + instance->scenario->directional_lights.erase( light->D ); + light->D=NULL; + } + } break; + case VS::INSTANCE_REFLECTION_PROBE: { + + InstanceReflectionProbeData *reflection_probe = static_cast<InstanceReflectionProbeData*>(instance->base_data); + VSG::scene_render->reflection_probe_release_atlas_index(reflection_probe->instance); + } break; + case VS::INSTANCE_GI_PROBE: { + + InstanceGIProbeData *gi_probe = static_cast<InstanceGIProbeData*>(instance->base_data); + if (gi_probe->update_element.in_list()) { + gi_probe_update_list.remove(&gi_probe->update_element); + } + } break; + + } + + instance->scenario=NULL; + } + + + if (p_scenario.is_valid()) { + + Scenario *scenario = scenario_owner.get( p_scenario ); + ERR_FAIL_COND(!scenario); + + instance->scenario=scenario; + + scenario->instances.add( &instance->scenario_item ); + + + switch(instance->base_type) { + + case VS::INSTANCE_LIGHT: { + + + InstanceLightData *light = static_cast<InstanceLightData*>(instance->base_data); + + if (VSG::storage->light_get_type(instance->base)==VS::LIGHT_DIRECTIONAL) { + light->D = scenario->directional_lights.push_back(instance); + } + } break; + case VS::INSTANCE_GI_PROBE: { + + InstanceGIProbeData *gi_probe = static_cast<InstanceGIProbeData*>(instance->base_data); + if (!gi_probe->update_element.in_list()) { + gi_probe_update_list.add(&gi_probe->update_element); + } + } break; + } + + _instance_queue_update(instance,true,true); + } +} +void VisualServerScene::instance_set_layer_mask(RID p_instance, uint32_t p_mask){ + + + Instance *instance = instance_owner.get( p_instance ); + ERR_FAIL_COND( !instance ); + + instance->layer_mask=p_mask; +} +void VisualServerScene::instance_set_transform(RID p_instance, const Transform& p_transform){ + + Instance *instance = instance_owner.get( p_instance ); + ERR_FAIL_COND( !instance ); + + if (instance->transform==p_transform) + return; //must be checked to avoid worst evil + + instance->transform=p_transform; + _instance_queue_update(instance,true); +} +void VisualServerScene::instance_attach_object_instance_ID(RID p_instance,ObjectID p_ID){ + + Instance *instance = instance_owner.get( p_instance ); + ERR_FAIL_COND( !instance ); + + instance->object_ID=p_ID; + +} +void VisualServerScene::instance_set_morph_target_weight(RID p_instance,int p_shape, float p_weight){ + + Instance *instance = instance_owner.get( p_instance ); + ERR_FAIL_COND( !instance ); + + if (instance->update_item.in_list()) { + _update_dirty_instance(instance); + } + + ERR_FAIL_INDEX(p_shape,instance->morph_values.size()); + instance->morph_values[p_shape]=p_weight; +} + +void VisualServerScene::instance_set_surface_material(RID p_instance,int p_surface, RID p_material){ + + Instance *instance = instance_owner.get( p_instance ); + ERR_FAIL_COND( !instance ); + + if (instance->update_item.in_list()) { + _update_dirty_instance(instance); + } + + ERR_FAIL_INDEX(p_surface,instance->materials.size()); + + if (instance->materials[p_surface].is_valid()) { + VSG::storage->material_remove_instance_owner(instance->materials[p_surface],instance); + } + instance->materials[p_surface]=p_material; + instance->base_material_changed(); + + if (instance->materials[p_surface].is_valid()) { + VSG::storage->material_add_instance_owner(instance->materials[p_surface],instance); + } + + +} + +void VisualServerScene::instance_set_visible(RID p_instance,bool p_visible) { + + Instance *instance = instance_owner.get( p_instance ); + ERR_FAIL_COND( !instance ); + + if (instance->visible==p_visible) + return; + + instance->visible=p_visible; + + + switch(instance->base_type) { + case VS::INSTANCE_LIGHT: { + if (VSG::storage->light_get_type(instance->base)!=VS::LIGHT_DIRECTIONAL && instance->octree_id && instance->scenario) { + instance->scenario->octree.set_pairable(instance->octree_id,p_visible,1<<VS::INSTANCE_LIGHT,p_visible?VS::INSTANCE_GEOMETRY_MASK:0); + } + + } break; + case VS::INSTANCE_REFLECTION_PROBE: { + if (instance->octree_id && instance->scenario) { + instance->scenario->octree.set_pairable(instance->octree_id,p_visible,1<<VS::INSTANCE_REFLECTION_PROBE,p_visible?VS::INSTANCE_GEOMETRY_MASK:0); + } + + } break; + case VS::INSTANCE_GI_PROBE: { + if (instance->octree_id && instance->scenario) { + instance->scenario->octree.set_pairable(instance->octree_id,p_visible,1<<VS::INSTANCE_GI_PROBE,p_visible?(VS::INSTANCE_GEOMETRY_MASK|(1<<VS::INSTANCE_LIGHT)):0); + } + + } break; + + } + +} + +void VisualServerScene::instance_attach_skeleton(RID p_instance,RID p_skeleton){ + + Instance *instance = instance_owner.get( p_instance ); + ERR_FAIL_COND( !instance ); + + if (instance->skeleton==p_skeleton) + return; + + if (instance->skeleton.is_valid()) { + VSG::storage->instance_remove_skeleton(p_skeleton,instance); + } + + instance->skeleton=p_skeleton; + + if (instance->skeleton.is_valid()) { + VSG::storage->instance_add_skeleton(p_skeleton,instance); + } + + _instance_queue_update(instance,true); +} + +void VisualServerScene::instance_set_exterior( RID p_instance, bool p_enabled ){ + +} +void VisualServerScene::instance_set_room( RID p_instance, RID p_room ){ + +} + +void VisualServerScene::instance_set_extra_visibility_margin( RID p_instance, real_t p_margin ){ + +} + +Vector<ObjectID> VisualServerScene::instances_cull_aabb(const Rect3& p_aabb, RID p_scenario) const { + + + Vector<ObjectID> instances; + Scenario *scenario=scenario_owner.get(p_scenario); + ERR_FAIL_COND_V(!scenario,instances); + + const_cast<VisualServerScene*>(this)->update_dirty_instances(); // check dirty instances before culling + + int culled=0; + Instance *cull[1024]; + culled=scenario->octree.cull_AABB(p_aabb,cull,1024); + + for (int i=0;i<culled;i++) { + + Instance *instance=cull[i]; + ERR_CONTINUE(!instance); + if (instance->object_ID==0) + continue; + + instances.push_back(instance->object_ID); + } + + return instances; +} +Vector<ObjectID> VisualServerScene::instances_cull_ray(const Vector3& p_from, const Vector3& p_to, RID p_scenario) const{ + + Vector<ObjectID> instances; + Scenario *scenario=scenario_owner.get(p_scenario); + ERR_FAIL_COND_V(!scenario,instances); + const_cast<VisualServerScene*>(this)->update_dirty_instances(); // check dirty instances before culling + + int culled=0; + Instance *cull[1024]; + culled=scenario->octree.cull_segment(p_from,p_to*10000,cull,1024); + + + for (int i=0;i<culled;i++) { + Instance *instance=cull[i]; + ERR_CONTINUE(!instance); + if (instance->object_ID==0) + continue; + + instances.push_back(instance->object_ID); + } + + return instances; + +} +Vector<ObjectID> VisualServerScene::instances_cull_convex(const Vector<Plane>& p_convex, RID p_scenario) const{ + + Vector<ObjectID> instances; + Scenario *scenario=scenario_owner.get(p_scenario); + ERR_FAIL_COND_V(!scenario,instances); + const_cast<VisualServerScene*>(this)->update_dirty_instances(); // check dirty instances before culling + + int culled=0; + Instance *cull[1024]; + + + culled=scenario->octree.cull_convex(p_convex,cull,1024); + + for (int i=0;i<culled;i++) { + + Instance *instance=cull[i]; + ERR_CONTINUE(!instance); + if (instance->object_ID==0) + continue; + + instances.push_back(instance->object_ID); + } + + return instances; + +} + +void VisualServerScene::instance_geometry_set_flag(RID p_instance,VS::InstanceFlags p_flags,bool p_enabled){ + + Instance *instance = instance_owner.get( p_instance ); + ERR_FAIL_COND( !instance ); + + switch(p_flags) { + + case VS::INSTANCE_FLAG_BILLBOARD: { + + instance->billboard=p_enabled; + + } break; + case VS::INSTANCE_FLAG_BILLBOARD_FIX_Y: { + + instance->billboard_y=p_enabled; + + } break; + case VS::INSTANCE_FLAG_CAST_SHADOW: { + if (p_enabled == true) { + instance->cast_shadows = VS::SHADOW_CASTING_SETTING_ON; + } + else { + instance->cast_shadows = VS::SHADOW_CASTING_SETTING_OFF; + } + + instance->base_material_changed(); // to actually compute if shadows are visible or not + + } break; + case VS::INSTANCE_FLAG_DEPH_SCALE: { + + instance->depth_scale=p_enabled; + + } break; + case VS::INSTANCE_FLAG_VISIBLE_IN_ALL_ROOMS: { + + instance->visible_in_all_rooms=p_enabled; + + } break; + + } +} +void VisualServerScene::instance_geometry_set_cast_shadows_setting(RID p_instance, VS::ShadowCastingSetting p_shadow_casting_setting) { + +} +void VisualServerScene::instance_geometry_set_material_override(RID p_instance, RID p_material){ + + Instance *instance = instance_owner.get( p_instance ); + ERR_FAIL_COND( !instance ); + + if (instance->material_override.is_valid()) { + VSG::storage->material_remove_instance_owner(instance->material_override,instance); + } + instance->material_override=p_material; + instance->base_material_changed(); + + if (instance->material_override.is_valid()) { + VSG::storage->material_add_instance_owner(instance->material_override,instance); + } + +} + + +void VisualServerScene::instance_geometry_set_draw_range(RID p_instance,float p_min,float p_max,float p_min_margin,float p_max_margin){ + +} +void VisualServerScene::instance_geometry_set_as_instance_lod(RID p_instance,RID p_as_lod_of_instance){ + +} + + +void VisualServerScene::_update_instance(Instance *p_instance) { + + p_instance->version++; + + if (p_instance->base_type == VS::INSTANCE_LIGHT) { + + InstanceLightData *light = static_cast<InstanceLightData*>(p_instance->base_data); + + VSG::scene_render->light_instance_set_transform( light->instance, p_instance->transform ); + light->shadow_dirty=true; + + } + + if (p_instance->base_type == VS::INSTANCE_REFLECTION_PROBE) { + + InstanceReflectionProbeData *reflection_probe = static_cast<InstanceReflectionProbeData*>(p_instance->base_data); + + VSG::scene_render->reflection_probe_instance_set_transform( reflection_probe->instance, p_instance->transform ); + reflection_probe->reflection_dirty=true; + + } + + + if (p_instance->aabb.has_no_surface()) + return; + +#if 0 + if (p_instance->base_type == VS::INSTANCE_PARTICLES) { + + rasterizer->particles_instance_set_transform( p_instance->particles_info->instance, p_instance->data.transform ); + } + +#endif + if ((1<<p_instance->base_type)&VS::INSTANCE_GEOMETRY_MASK) { + + InstanceGeometryData *geom = static_cast<InstanceGeometryData*>(p_instance->base_data); + //make sure lights are updated if it casts shadow + + if (geom->can_cast_shadows) { + for (List<Instance*>::Element *E=geom->lighting.front();E;E=E->next()) { + InstanceLightData *light = static_cast<InstanceLightData*>(E->get()->base_data); + light->shadow_dirty=true; + } + } + + } +#if 0 + else if (p_instance->base_type == INSTANCE_ROOM) { + + p_instance->room_info->affine_inverse=p_instance->data.transform.affine_inverse(); + } else if (p_instance->base_type == INSTANCE_GI_PROBE) { + + Transform scale; + scale.basis.scale(p_instance->gi_probe_info->gi_probe->octree_aabb.size); + scale.origin=p_instance->gi_probe_info->gi_probe->octree_aabb.pos; + //print_line("scale: "+scale); + p_instance->gi_probe_info->affine_inverse=(p_instance->data.transform*scale).affine_inverse(); + } + + +#endif + + p_instance->mirror = p_instance->transform.basis.determinant() < 0.0; + + Rect3 new_aabb; +#if 0 + if (p_instance->base_type==INSTANCE_PORTAL) { + + //portals need to be transformed in a special way, so they don't become too wide if they have scale.. + Transform portal_xform = p_instance->data.transform; + portal_xform.basis.set_axis(2,portal_xform.basis.get_axis(2).normalized()); + + p_instance->portal_info->plane_cache=Plane( p_instance->data.transform.origin, portal_xform.basis.get_axis(2)); + int point_count=p_instance->portal_info->portal->shape.size(); + p_instance->portal_info->transformed_point_cache.resize(point_count); + + AABB portal_aabb; + + for(int i=0;i<point_count;i++) { + + Point2 src = p_instance->portal_info->portal->shape[i]; + Vector3 point = portal_xform.xform(Vector3(src.x,src.y,0)); + p_instance->portal_info->transformed_point_cache[i]=point; + if (i==0) + portal_aabb.pos=point; + else + portal_aabb.expand_to(point); + } + + portal_aabb.grow_by(p_instance->portal_info->portal->connect_range); + + new_aabb = portal_aabb; + + } else { +#endif + new_aabb = p_instance->transform.xform(p_instance->aabb); +#if 0 + } +#endif + + + p_instance->transformed_aabb=new_aabb; + + if (!p_instance->scenario) { + + return; + } + + + + if (p_instance->octree_id==0) { + + uint32_t base_type = 1<<p_instance->base_type; + uint32_t pairable_mask=0; + bool pairable=false; + + if (p_instance->base_type == VS::INSTANCE_LIGHT || p_instance->base_type==VS::INSTANCE_REFLECTION_PROBE) { + + pairable_mask=p_instance->visible?VS::INSTANCE_GEOMETRY_MASK:0; + pairable=true; + } + + if (p_instance->base_type == VS::INSTANCE_GI_PROBE) { + //lights and geometries + pairable_mask=p_instance->visible?VS::INSTANCE_GEOMETRY_MASK|(1<<VS::INSTANCE_LIGHT):0; + pairable=true; + } + +#if 0 + + if (p_instance->base_type == VS::INSTANCE_PORTAL) { + + pairable_mask=(1<<INSTANCE_PORTAL); + pairable=true; + } + + if (p_instance->base_type == VS::INSTANCE_GI_PROBE_SAMPLER) { + + pairable_mask=(1<<INSTANCE_GI_PROBE); + pairable=true; + } + + + if (!p_instance->room && (1<<p_instance->base_type)&VS::INSTANCE_GEOMETRY_MASK) { + + base_type|=VS::INSTANCE_ROOMLESS_MASK; + } + + if (p_instance->base_type == VS::INSTANCE_ROOM) { + + pairable_mask=INSTANCE_ROOMLESS_MASK; + pairable=true; + } +#endif + + // not inside octree + p_instance->octree_id = p_instance->scenario->octree.create(p_instance,new_aabb,0,pairable,base_type,pairable_mask); + + } else { + + // if (new_aabb==p_instance->data.transformed_aabb) + // return; + + p_instance->scenario->octree.move(p_instance->octree_id,new_aabb); + } +#if 0 + if (p_instance->base_type==INSTANCE_PORTAL) { + + _portal_attempt_connect(p_instance); + } + + if (!p_instance->room && (1<<p_instance->base_type)&INSTANCE_GEOMETRY_MASK) { + + _instance_validate_autorooms(p_instance); + } + + if (p_instance->base_type == INSTANCE_ROOM) { + + for(Set<Instance*>::Element *E=p_instance->room_info->owned_autoroom_geometry.front();E;E=E->next()) + _instance_validate_autorooms(E->get()); + } +#endif + +} + +void VisualServerScene::_update_instance_aabb(Instance *p_instance) { + + Rect3 new_aabb; + + ERR_FAIL_COND(p_instance->base_type!=VS::INSTANCE_NONE && !p_instance->base.is_valid()); + + switch(p_instance->base_type) { + case VisualServer::INSTANCE_NONE: { + + // do nothing + } break; + case VisualServer::INSTANCE_MESH: { + + new_aabb = VSG::storage->mesh_get_aabb(p_instance->base,p_instance->skeleton); + + } break; + + case VisualServer::INSTANCE_MULTIMESH: { + + new_aabb = VSG::storage->multimesh_get_aabb(p_instance->base); + + } break; + case VisualServer::INSTANCE_IMMEDIATE: { + + new_aabb = VSG::storage->immediate_get_aabb(p_instance->base); + + + } break; +#if 0 + + case VisualServer::INSTANCE_PARTICLES: { + + new_aabb = rasterizer->particles_get_aabb(p_instance->base); + + + } break; +#endif + case VisualServer::INSTANCE_LIGHT: { + + new_aabb = VSG::storage->light_get_aabb(p_instance->base); + + } break; + case VisualServer::INSTANCE_REFLECTION_PROBE: { + + new_aabb = VSG::storage->reflection_probe_get_aabb(p_instance->base); + + } break; + case VisualServer::INSTANCE_GI_PROBE: { + + new_aabb = VSG::storage->gi_probe_get_bounds(p_instance->base); + + } break; + +#if 0 + case VisualServer::INSTANCE_ROOM: { + + Room *room = room_owner.get( p_instance->base ); + ERR_FAIL_COND(!room); + new_aabb=room->bounds.get_aabb(); + + } break; + case VisualServer::INSTANCE_PORTAL: { + + Portal *portal = portal_owner.get( p_instance->base ); + ERR_FAIL_COND(!portal); + for (int i=0;i<portal->shape.size();i++) { + + Vector3 point( portal->shape[i].x, portal->shape[i].y, 0 ); + if (i==0) { + + new_aabb.pos=point; + new_aabb.size.z=0.01; // make it not flat for octree + } else { + + new_aabb.expand_to(point); + } + } + + } break; + case VisualServer::INSTANCE_GI_PROBE: { + + BakedLight *gi_probe = gi_probe_owner.get( p_instance->base ); + ERR_FAIL_COND(!gi_probe); + new_aabb=gi_probe->octree_aabb; + + } break; + case VisualServer::INSTANCE_GI_PROBE_SAMPLER: { + + BakedLightSampler *gi_probe_sampler = gi_probe_sampler_owner.get( p_instance->base ); + ERR_FAIL_COND(!gi_probe_sampler); + float radius = gi_probe_sampler->params[VS::BAKED_LIGHT_SAMPLER_RADIUS]; + + new_aabb=AABB(Vector3(-radius,-radius,-radius),Vector3(radius*2,radius*2,radius*2)); + + } break; +#endif + default: {} + } + + if (p_instance->extra_margin) + new_aabb.grow_by(p_instance->extra_margin); + + p_instance->aabb=new_aabb; + +} + + + + + +void VisualServerScene::_light_instance_update_shadow(Instance *p_instance,const Transform p_cam_transform,const CameraMatrix& p_cam_projection,bool p_cam_orthogonal,RID p_shadow_atlas,Scenario* p_scenario) { + + + InstanceLightData * light = static_cast<InstanceLightData*>(p_instance->base_data); + + switch(VSG::storage->light_get_type(p_instance->base)) { + + case VS::LIGHT_DIRECTIONAL: { + + float max_distance =p_cam_projection.get_z_far(); + float shadow_max = VSG::storage->light_get_param(p_instance->base,VS::LIGHT_PARAM_SHADOW_MAX_DISTANCE); + if (shadow_max>0) { + max_distance=MIN(shadow_max,max_distance); + } + max_distance=MAX(max_distance,p_cam_projection.get_z_near()+0.001); + + float range = max_distance-p_cam_projection.get_z_near(); + + int splits=0; + switch(VSG::storage->light_directional_get_shadow_mode(p_instance->base)) { + case VS::LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL: splits=1; break; + case VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS: splits=2; break; + case VS::LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS: splits=4; break; + } + + float distances[5]; + + distances[0]=p_cam_projection.get_z_near(); + for(int i=0;i<splits;i++) { + distances[i+1]=p_cam_projection.get_z_near()+VSG::storage->light_get_param(p_instance->base,VS::LightParam(VS::LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET+i))*range; + }; + + distances[splits]=max_distance; + + float texture_size=VSG::scene_render->get_directional_light_shadow_size(light->instance); + + bool overlap = VSG::storage->light_directional_get_blend_splits(p_instance->base); + + for (int i=0;i<splits;i++) { + + // setup a camera matrix for that range! + CameraMatrix camera_matrix; + + float aspect = p_cam_projection.get_aspect(); + + + if (p_cam_orthogonal) { + + float w,h; + p_cam_projection.get_viewport_size(w,h); + camera_matrix.set_orthogonal(w,aspect,distances[(i==0 || !overlap )?i:i-1],distances[i+1],false); + } else { + + float fov = p_cam_projection.get_fov(); + camera_matrix.set_perspective(fov,aspect,distances[(i==0 || !overlap )?i:i-1],distances[i+1],false); + } + + //obtain the frustum endpoints + + Vector3 endpoints[8]; // frustum plane endpoints + bool res = camera_matrix.get_endpoints(p_cam_transform,endpoints); + ERR_CONTINUE(!res); + + // obtain the light frustm ranges (given endpoints) + + Vector3 x_vec=p_instance->transform.basis.get_axis( Vector3::AXIS_X ).normalized(); + Vector3 y_vec=p_instance->transform.basis.get_axis( Vector3::AXIS_Y ).normalized(); + Vector3 z_vec=p_instance->transform.basis.get_axis( Vector3::AXIS_Z ).normalized(); + //z_vec points agsint the camera, like in default opengl + + float x_min,x_max; + float y_min,y_max; + float z_min,z_max; + + float x_min_cam,x_max_cam; + float y_min_cam,y_max_cam; + float z_min_cam,z_max_cam; + + + //used for culling + for(int j=0;j<8;j++) { + + float d_x=x_vec.dot(endpoints[j]); + float d_y=y_vec.dot(endpoints[j]); + float d_z=z_vec.dot(endpoints[j]); + + if (j==0 || d_x<x_min) + x_min=d_x; + if (j==0 || d_x>x_max) + x_max=d_x; + + if (j==0 || d_y<y_min) + y_min=d_y; + if (j==0 || d_y>y_max) + y_max=d_y; + + if (j==0 || d_z<z_min) + z_min=d_z; + if (j==0 || d_z>z_max) + z_max=d_z; + + + } + + + + + + { + //camera viewport stuff + //this trick here is what stabilizes the shadow (make potential jaggies to not move) + //at the cost of some wasted resolution. Still the quality increase is very well worth it + + + Vector3 center; + + for(int j=0;j<8;j++) { + + center+=endpoints[j]; + } + center/=8.0; + + //center=x_vec*(x_max-x_min)*0.5 + y_vec*(y_max-y_min)*0.5 + z_vec*(z_max-z_min)*0.5; + + float radius=0; + + for(int j=0;j<8;j++) { + + float d = center.distance_to(endpoints[j]); + if (d>radius) + radius=d; + } + + + radius *= texture_size/(texture_size-2.0); //add a texel by each side, so stepified texture will always fit + + x_max_cam=x_vec.dot(center)+radius; + x_min_cam=x_vec.dot(center)-radius; + y_max_cam=y_vec.dot(center)+radius; + y_min_cam=y_vec.dot(center)-radius; + z_max_cam=z_vec.dot(center)+radius; + z_min_cam=z_vec.dot(center)-radius; + + float unit = radius*2.0/texture_size; + + x_max_cam=Math::stepify(x_max_cam,unit); + x_min_cam=Math::stepify(x_min_cam,unit); + y_max_cam=Math::stepify(y_max_cam,unit); + y_min_cam=Math::stepify(y_min_cam,unit); + + } + + //now that we now all ranges, we can proceed to make the light frustum planes, for culling octree + + Vector<Plane> light_frustum_planes; + light_frustum_planes.resize(6); + + //right/left + light_frustum_planes[0]=Plane( x_vec, x_max ); + light_frustum_planes[1]=Plane( -x_vec, -x_min ); + //top/bottom + light_frustum_planes[2]=Plane( y_vec, y_max ); + light_frustum_planes[3]=Plane( -y_vec, -y_min ); + //near/far + light_frustum_planes[4]=Plane( z_vec, z_max+1e6 ); + light_frustum_planes[5]=Plane( -z_vec, -z_min ); // z_min is ok, since casters further than far-light plane are not needed + + int cull_count = p_scenario->octree.cull_convex(light_frustum_planes,instance_shadow_cull_result,MAX_INSTANCE_CULL,VS::INSTANCE_GEOMETRY_MASK); + + // a pre pass will need to be needed to determine the actual z-near to be used + + + for (int j=0;j<cull_count;j++) { + + float min,max; + Instance *instance = instance_shadow_cull_result[j]; + if (!instance->visible || !((1<<instance->base_type)&VS::INSTANCE_GEOMETRY_MASK) || !static_cast<InstanceGeometryData*>(instance->base_data)->can_cast_shadows) { + cull_count--; + SWAP(instance_shadow_cull_result[j],instance_shadow_cull_result[cull_count]); + j--; + + } + + instance->transformed_aabb.project_range_in_plane(Plane(z_vec,0),min,max); + if (max>z_max) + z_max=max; + } + + { + CameraMatrix ortho_camera; + real_t half_x = (x_max_cam-x_min_cam) * 0.5; + real_t half_y = (y_max_cam-y_min_cam) * 0.5; + + + ortho_camera.set_orthogonal( -half_x, half_x,-half_y,half_y, 0, (z_max-z_min_cam) ); + + Transform ortho_transform; + ortho_transform.basis=p_instance->transform.basis; + ortho_transform.origin=x_vec*(x_min_cam+half_x)+y_vec*(y_min_cam+half_y)+z_vec*z_max; + + VSG::scene_render->light_instance_set_shadow_transform(light->instance,ortho_camera,ortho_transform,0,distances[i+1],i); + } + + + + VSG::scene_render->render_shadow(light->instance,p_shadow_atlas,i,(RasterizerScene::InstanceBase**)instance_shadow_cull_result,cull_count); + + } + + } break; + case VS::LIGHT_OMNI: { + + VS::LightOmniShadowMode shadow_mode = VSG::storage->light_omni_get_shadow_mode(p_instance->base); + + switch(shadow_mode) { + case VS::LIGHT_OMNI_SHADOW_DUAL_PARABOLOID: { + + for(int i=0;i<2;i++) { + + //using this one ensures that raster deferred will have it + + float radius = VSG::storage->light_get_param( p_instance->base, VS::LIGHT_PARAM_RANGE); + + float z =i==0?-1:1; + Vector<Plane> planes; + planes.resize(5); + planes[0]=p_instance->transform.xform(Plane(Vector3(0,0,z),radius)); + planes[1]=p_instance->transform.xform(Plane(Vector3(1,0,z).normalized(),radius)); + planes[2]=p_instance->transform.xform(Plane(Vector3(-1,0,z).normalized(),radius)); + planes[3]=p_instance->transform.xform(Plane(Vector3(0,1,z).normalized(),radius)); + planes[4]=p_instance->transform.xform(Plane(Vector3(0,-1,z).normalized(),radius)); + + + int cull_count = p_scenario->octree.cull_convex(planes,instance_shadow_cull_result,MAX_INSTANCE_CULL,VS::INSTANCE_GEOMETRY_MASK); + + for (int j=0;j<cull_count;j++) { + + Instance *instance = instance_shadow_cull_result[j]; + if (!instance->visible || !((1<<instance->base_type)&VS::INSTANCE_GEOMETRY_MASK) || !static_cast<InstanceGeometryData*>(instance->base_data)->can_cast_shadows) { + cull_count--; + SWAP(instance_shadow_cull_result[j],instance_shadow_cull_result[cull_count]); + j--; + + } + } + + VSG::scene_render->light_instance_set_shadow_transform(light->instance,CameraMatrix(),p_instance->transform,radius,0,i); + VSG::scene_render->render_shadow(light->instance,p_shadow_atlas,i,(RasterizerScene::InstanceBase**)instance_shadow_cull_result,cull_count); + } + } break; + case VS::LIGHT_OMNI_SHADOW_CUBE: { + + float radius = VSG::storage->light_get_param( p_instance->base, VS::LIGHT_PARAM_RANGE); + CameraMatrix cm; + cm.set_perspective(90,1,0.01,radius); + + for(int i=0;i<6;i++) { + + //using this one ensures that raster deferred will have it + + + + static const Vector3 view_normals[6]={ + Vector3(-1, 0, 0), + Vector3(+1, 0, 0), + Vector3( 0,-1, 0), + Vector3( 0,+1, 0), + Vector3( 0, 0,-1), + Vector3( 0, 0,+1) + }; + static const Vector3 view_up[6]={ + Vector3( 0,-1, 0), + Vector3( 0,-1, 0), + Vector3( 0, 0,-1), + Vector3( 0, 0,+1), + Vector3( 0,-1, 0), + Vector3( 0,-1, 0) + }; + + Transform xform = p_instance->transform * Transform().looking_at(view_normals[i],view_up[i]); + + + Vector<Plane> planes = cm.get_projection_planes(xform); + + int cull_count = p_scenario->octree.cull_convex(planes,instance_shadow_cull_result,MAX_INSTANCE_CULL,VS::INSTANCE_GEOMETRY_MASK); + + for (int j=0;j<cull_count;j++) { + + Instance *instance = instance_shadow_cull_result[j]; + if (!instance->visible || !((1<<instance->base_type)&VS::INSTANCE_GEOMETRY_MASK) || !static_cast<InstanceGeometryData*>(instance->base_data)->can_cast_shadows) { + cull_count--; + SWAP(instance_shadow_cull_result[j],instance_shadow_cull_result[cull_count]); + j--; + + } + } + + + VSG::scene_render->light_instance_set_shadow_transform(light->instance,cm,xform,radius,0,i); + VSG::scene_render->render_shadow(light->instance,p_shadow_atlas,i,(RasterizerScene::InstanceBase**)instance_shadow_cull_result,cull_count); + } + + //restore the regular DP matrix + VSG::scene_render->light_instance_set_shadow_transform(light->instance,CameraMatrix(),p_instance->transform,radius,0,0); + + } break; + } + + + } break; + case VS::LIGHT_SPOT: { + + + float radius = VSG::storage->light_get_param( p_instance->base, VS::LIGHT_PARAM_RANGE); + float angle = VSG::storage->light_get_param( p_instance->base, VS::LIGHT_PARAM_SPOT_ANGLE); + + CameraMatrix cm; + cm.set_perspective( angle*2.0, 1.0, 0.01, radius ); + + + Vector<Plane> planes = cm.get_projection_planes(p_instance->transform); + int cull_count = p_scenario->octree.cull_convex(planes,instance_shadow_cull_result,MAX_INSTANCE_CULL,VS::INSTANCE_GEOMETRY_MASK); + + for (int j=0;j<cull_count;j++) { + + Instance *instance = instance_shadow_cull_result[j]; + if (!instance->visible || !((1<<instance->base_type)&VS::INSTANCE_GEOMETRY_MASK) || !static_cast<InstanceGeometryData*>(instance->base_data)->can_cast_shadows) { + cull_count--; + SWAP(instance_shadow_cull_result[j],instance_shadow_cull_result[cull_count]); + j--; + + } + } + + + VSG::scene_render->light_instance_set_shadow_transform(light->instance,cm,p_instance->transform,radius,0,0); + VSG::scene_render->render_shadow(light->instance,p_shadow_atlas,0,(RasterizerScene::InstanceBase**)instance_shadow_cull_result,cull_count); + + } break; + } + +} + + +void VisualServerScene::render_camera(RID p_camera, RID p_scenario,Size2 p_viewport_size,RID p_shadow_atlas) { + + Camera *camera = camera_owner.getornull(p_camera); + ERR_FAIL_COND(!camera); + + /* STEP 1 - SETUP CAMERA */ + CameraMatrix camera_matrix; + bool ortho=false; + + + switch(camera->type) { + case Camera::ORTHOGONAL: { + + camera_matrix.set_orthogonal( + camera->size, + p_viewport_size.width / (float)p_viewport_size.height, + camera->znear, + camera->zfar, + camera->vaspect + + ); + ortho=true; + } break; + case Camera::PERSPECTIVE: { + + camera_matrix.set_perspective( + camera->fov, + p_viewport_size.width / (float)p_viewport_size.height, + camera->znear, + camera->zfar, + camera->vaspect + + ); + ortho=false; + + } break; + } + + _render_scene(camera->transform,camera_matrix,ortho,camera->env,camera->visible_layers,p_scenario,p_shadow_atlas,RID(),-1); + +} + + +void VisualServerScene::_render_scene(const Transform p_cam_transform,const CameraMatrix& p_cam_projection,bool p_cam_orthogonal,RID p_force_environment,uint32_t p_visible_layers, RID p_scenario,RID p_shadow_atlas,RID p_reflection_probe,int p_reflection_probe_pass) { + + + + Scenario *scenario = scenario_owner.getornull(p_scenario); + + render_pass++; + uint32_t camera_layer_mask=p_visible_layers; + + VSG::scene_render->set_scene_pass(render_pass); + + +// rasterizer->set_camera(camera->transform, camera_matrix,ortho); + + Vector<Plane> planes = p_cam_projection.get_projection_planes(p_cam_transform); + + Plane near_plane(p_cam_transform.origin,-p_cam_transform.basis.get_axis(2).normalized()); + float z_far = p_cam_projection.get_z_far(); + + /* STEP 2 - CULL */ + int cull_count = scenario->octree.cull_convex(planes,instance_cull_result,MAX_INSTANCE_CULL); + light_cull_count=0; + + reflection_probe_cull_count=0; + +// light_samplers_culled=0; + +/* print_line("OT: "+rtos( (OS::get_singleton()->get_ticks_usec()-t)/1000.0)); + print_line("OTO: "+itos(p_scenario->octree.get_octant_count())); +// print_line("OTE: "+itos(p_scenario->octree.get_elem_count())); + print_line("OTP: "+itos(p_scenario->octree.get_pair_count())); +*/ + + /* STEP 3 - PROCESS PORTALS, VALIDATE ROOMS */ + + + // compute portals +#if 0 + exterior_visited=false; + exterior_portal_cull_count=0; + + if (room_cull_enabled) { + for(int i=0;i<cull_count;i++) { + + Instance *ins = instance_cull_result[i]; + ins->last_render_pass=render_pass; + + if (ins->base_type!=INSTANCE_PORTAL) + continue; + + if (ins->room) + continue; + + ERR_CONTINUE(exterior_portal_cull_count>=MAX_EXTERIOR_PORTALS); + exterior_portal_cull_result[exterior_portal_cull_count++]=ins; + + } + + room_cull_count = p_scenario->octree.cull_point(camera->transform.origin,room_cull_result,MAX_ROOM_CULL,NULL,(1<<INSTANCE_ROOM)|(1<<INSTANCE_PORTAL)); + + + Set<Instance*> current_rooms; + Set<Instance*> portal_rooms; + //add to set + for(int i=0;i<room_cull_count;i++) { + + if (room_cull_result[i]->base_type==INSTANCE_ROOM) { + current_rooms.insert(room_cull_result[i]); + } + if (room_cull_result[i]->base_type==INSTANCE_PORTAL) { + //assume inside that room if also inside the portal.. + if (room_cull_result[i]->room) { + portal_rooms.insert(room_cull_result[i]->room); + } + + SWAP(room_cull_result[i],room_cull_result[room_cull_count-1]); + room_cull_count--; + i--; + } + } + + //remove from set if it has a parent room or BSP doesn't contain + for(int i=0;i<room_cull_count;i++) { + Instance *r = room_cull_result[i]; + + //check inside BSP + Vector3 room_local_point = r->room_info->affine_inverse.xform( camera->transform.origin ); + + if (!portal_rooms.has(r) && !r->room_info->room->bounds.point_is_inside(room_local_point)) { + + current_rooms.erase(r); + continue; + } + + //check parent + while (r->room) {// has parent room + + current_rooms.erase(r); + r=r->room; + } + + } + + if (current_rooms.size()) { + //camera is inside a room + // go through rooms + for(Set<Instance*>::Element *E=current_rooms.front();E;E=E->next()) { + _cull_room(camera,E->get()); + } + + } else { + //start from exterior + _cull_room(camera,NULL); + + } + } + +#endif + /* STEP 4 - REMOVE FURTHER CULLED OBJECTS, ADD LIGHTS */ + + for(int i=0;i<cull_count;i++) { + + Instance *ins = instance_cull_result[i]; + + bool keep=false; + + if ((camera_layer_mask&ins->layer_mask)==0) { + + //failure + } else if (ins->base_type==VS::INSTANCE_LIGHT && ins->visible) { + + + if (ins->visible && light_cull_count<MAX_LIGHTS_CULLED) { + + InstanceLightData * light = static_cast<InstanceLightData*>(ins->base_data); + + if (!light->geometries.empty()) { + //do not add this light if no geometry is affected by it.. + light_cull_result[light_cull_count]=ins; + light_instance_cull_result[light_cull_count]=light->instance; + if (p_shadow_atlas.is_valid() && VSG::storage->light_has_shadow(ins->base)) { + VSG::scene_render->light_instance_mark_visible(light->instance); //mark it visible for shadow allocation later + } + + light_cull_count++; + } + + + } + } else if (ins->base_type==VS::INSTANCE_REFLECTION_PROBE && ins->visible) { + + + if (ins->visible && reflection_probe_cull_count<MAX_REFLECTION_PROBES_CULLED) { + + InstanceReflectionProbeData * reflection_probe = static_cast<InstanceReflectionProbeData*>(ins->base_data); + + if (p_reflection_probe!=reflection_probe->instance) { + //avoid entering The Matrix + + if (!reflection_probe->geometries.empty()) { + //do not add this light if no geometry is affected by it.. + + if (reflection_probe->reflection_dirty || VSG::scene_render->reflection_probe_instance_needs_redraw(reflection_probe->instance)) { + if (!reflection_probe->update_list.in_list()) { + reflection_probe->render_step=0; + reflection_probe_render_list.add(&reflection_probe->update_list); + } + + reflection_probe->reflection_dirty=false; + } + + if (VSG::scene_render->reflection_probe_instance_has_reflection(reflection_probe->instance)) { + reflection_probe_instance_cull_result[reflection_probe_cull_count]=reflection_probe->instance; + reflection_probe_cull_count++; + } + + } + } + } + + } else if (ins->base_type==VS::INSTANCE_GI_PROBE && ins->visible) { + + InstanceGIProbeData * gi_probe = static_cast<InstanceGIProbeData*>(ins->base_data); + if (!gi_probe->update_element.in_list()) { + gi_probe_update_list.add(&gi_probe->update_element); + } + + } else if ((1<<ins->base_type)&VS::INSTANCE_GEOMETRY_MASK && ins->visible && ins->cast_shadows!=VS::SHADOW_CASTING_SETTING_SHADOWS_ONLY) { + + keep=true; +#if 0 + bool discarded=false; + + if (ins->draw_range_end>0) { + + float d = cull_range.nearp.distance_to(ins->data.transform.origin); + if (d<0) + d=0; + discarded=(d<ins->draw_range_begin || d>=ins->draw_range_end); + + + } + + if (!discarded) { + + // test if this geometry should be visible + + if (room_cull_enabled) { + + + if (ins->visible_in_all_rooms) { + keep=true; + } else if (ins->room) { + + if (ins->room->room_info->last_visited_pass==render_pass) + keep=true; + } else if (ins->auto_rooms.size()) { + + + for(Set<Instance*>::Element *E=ins->auto_rooms.front();E;E=E->next()) { + + if (E->get()->room_info->last_visited_pass==render_pass) { + keep=true; + break; + } + } + } else if(exterior_visited) + keep=true; + } else { + + keep=true; + } + + + } + + + if (keep) { + // update cull range + float min,max; + ins->transformed_aabb.project_range_in_plane(cull_range.nearp,min,max); + + if (min<cull_range.min) + cull_range.min=min; + if (max>cull_range.max) + cull_range.max=max; + + if (ins->sampled_light && ins->sampled_light->gi_probe_sampler_info->last_pass!=render_pass) { + if (light_samplers_culled<MAX_LIGHT_SAMPLERS) { + light_sampler_cull_result[light_samplers_culled++]=ins->sampled_light; + ins->sampled_light->gi_probe_sampler_info->last_pass=render_pass; + } + } + } +#endif + + + InstanceGeometryData * geom = static_cast<InstanceGeometryData*>(ins->base_data); + + + if (geom->lighting_dirty) { + int l=0; + //only called when lights AABB enter/exit this geometry + ins->light_instances.resize(geom->lighting.size()); + + for (List<Instance*>::Element *E=geom->lighting.front();E;E=E->next()) { + + InstanceLightData * light = static_cast<InstanceLightData*>(E->get()->base_data); + + ins->light_instances[l++]=light->instance; + } + + geom->lighting_dirty=false; + } + + if (geom->reflection_dirty) { + int l=0; + //only called when reflection probe AABB enter/exit this geometry + ins->reflection_probe_instances.resize(geom->reflection_probes.size()); + + for (List<Instance*>::Element *E=geom->reflection_probes.front();E;E=E->next()) { + + InstanceReflectionProbeData * reflection_probe = static_cast<InstanceReflectionProbeData*>(E->get()->base_data); + + ins->reflection_probe_instances[l++]=reflection_probe->instance; + } + + geom->reflection_dirty=false; + } + + if (geom->gi_probes_dirty) { + int l=0; + //only called when reflection probe AABB enter/exit this geometry + ins->gi_probe_instances.resize(geom->gi_probes.size()); + + for (List<Instance*>::Element *E=geom->gi_probes.front();E;E=E->next()) { + + InstanceGIProbeData * gi_probe = static_cast<InstanceGIProbeData*>(E->get()->base_data); + + ins->gi_probe_instances[l++]=gi_probe->probe_instance; + } + + geom->gi_probes_dirty=false; + } + + ins->depth = near_plane.distance_to(ins->transform.origin); + ins->depth_layer=CLAMP(int(ins->depth*8/z_far),0,7); + + } + + if (!keep) { + // remove, no reason to keep + cull_count--; + SWAP( instance_cull_result[i], instance_cull_result[ cull_count ] ); + i--; + ins->last_render_pass=0; // make invalid + } else { + + ins->last_render_pass=render_pass; + } + } + + /* STEP 5 - PROCESS LIGHTS */ + + RID *directional_light_ptr=&light_instance_cull_result[light_cull_count]; + int directional_light_count=0; + + // directional lights + { + + Instance** lights_with_shadow = (Instance**)alloca(sizeof(Instance*)*scenario->directional_lights.size()); + int directional_shadow_count=0; + + for (List<Instance*>::Element *E=scenario->directional_lights.front();E;E=E->next()) { + + if (light_cull_count+directional_light_count>=MAX_LIGHTS_CULLED) { + break; + } + + if (!E->get()->visible) + continue; + + InstanceLightData * light = static_cast<InstanceLightData*>(E->get()->base_data); + + + //check shadow.. + + + if (light && p_shadow_atlas.is_valid() && VSG::storage->light_has_shadow(E->get()->base)) { + lights_with_shadow[directional_shadow_count++]=E->get(); + + } + + //add to list + + directional_light_ptr[directional_light_count++]=light->instance; + } + + VSG::scene_render->set_directional_shadow_count(directional_shadow_count); + + for(int i=0;i<directional_shadow_count;i++) { + + _light_instance_update_shadow(lights_with_shadow[i],p_cam_transform,p_cam_projection,p_cam_orthogonal,p_shadow_atlas,scenario); + + } + } + + + { //setup shadow maps + + //SortArray<Instance*,_InstanceLightsort> sorter; + //sorter.sort(light_cull_result,light_cull_count); + for (int i=0;i<light_cull_count;i++) { + + Instance *ins = light_cull_result[i]; + + if (!p_shadow_atlas.is_valid() || !VSG::storage->light_has_shadow(ins->base)) + continue; + + InstanceLightData * light = static_cast<InstanceLightData*>(ins->base_data); + + float coverage; + + { //compute coverage + + + Transform cam_xf = p_cam_transform; + float zn = p_cam_projection.get_z_near(); + Plane p (cam_xf.origin + cam_xf.basis.get_axis(2) * -zn, -cam_xf.basis.get_axis(2) ); //camera near plane + + float vp_w,vp_h; //near plane size in screen coordinates + p_cam_projection.get_viewport_size(vp_w,vp_h); + + + switch(VSG::storage->light_get_type(ins->base)) { + + case VS::LIGHT_OMNI: { + + float radius = VSG::storage->light_get_param(ins->base,VS::LIGHT_PARAM_RANGE); + + //get two points parallel to near plane + Vector3 points[2]={ + ins->transform.origin, + ins->transform.origin+cam_xf.basis.get_axis(0)*radius + }; + + if (!p_cam_orthogonal) { + //if using perspetive, map them to near plane + for(int j=0;j<2;j++) { + if (p.distance_to(points[j]) < 0 ) { + points[j].z=-zn; //small hack to keep size constant when hitting the screen + + } + + p.intersects_segment(cam_xf.origin,points[j],&points[j]); //map to plane + } + + + } + + float screen_diameter = points[0].distance_to(points[1])*2; + coverage = screen_diameter / (vp_w+vp_h); + } break; + case VS::LIGHT_SPOT: { + + float radius = VSG::storage->light_get_param(ins->base,VS::LIGHT_PARAM_RANGE); + float angle = VSG::storage->light_get_param(ins->base,VS::LIGHT_PARAM_SPOT_ANGLE); + + + float w = radius*Math::sin(Math::deg2rad(angle)); + float d = radius*Math::cos(Math::deg2rad(angle)); + + + Vector3 base = ins->transform.origin-ins->transform.basis.get_axis(2).normalized()*d; + + Vector3 points[2]={ + base, + base+cam_xf.basis.get_axis(0)*w + }; + + if (!p_cam_orthogonal) { + //if using perspetive, map them to near plane + for(int j=0;j<2;j++) { + if (p.distance_to(points[j]) < 0 ) { + points[j].z=-zn; //small hack to keep size constant when hitting the screen + + } + + p.intersects_segment(cam_xf.origin,points[j],&points[j]); //map to plane + } + + + } + + float screen_diameter = points[0].distance_to(points[1])*2; + coverage = screen_diameter / (vp_w+vp_h); + + + } break; + default: { + ERR_PRINT("Invalid Light Type"); + } + } + + } + + + if (light->shadow_dirty) { + light->last_version++; + light->shadow_dirty=false; + } + + + bool redraw = VSG::scene_render->shadow_atlas_update_light(p_shadow_atlas,light->instance,coverage,light->last_version); + + if (redraw) { + print_line("redraw shadow"); + //must redraw! + _light_instance_update_shadow(ins,p_cam_transform,p_cam_projection,p_cam_orthogonal,p_shadow_atlas,scenario); + } + + } + } + + /* ENVIRONMENT */ + + RID environment; + if (p_force_environment.is_valid()) //camera has more environment priority + environment=p_force_environment; + else if (scenario->environment.is_valid()) + environment=scenario->environment; + else + environment=scenario->fallback_environment; + +#if 0 + /* STEP 6 - SAMPLE BAKED LIGHT */ + + bool islinear =false; + if (environment.is_valid()) { + islinear = rasterizer->environment_is_fx_enabled(environment,VS::ENV_FX_SRGB); + } + + for(int i=0;i<light_samplers_culled;i++) { + + _process_sampled_light(camera->transform,light_sampler_cull_result[i],islinear); + } +#endif + /* STEP 7 - PROCESS GEOMETRY AND DRAW SCENE*/ + + VSG::scene_render->render_scene(p_cam_transform, p_cam_projection,p_cam_orthogonal,(RasterizerScene::InstanceBase**)instance_cull_result,cull_count,light_instance_cull_result,light_cull_count+directional_light_count,reflection_probe_instance_cull_result,reflection_probe_cull_count,environment,p_shadow_atlas,scenario->reflection_atlas,p_reflection_probe,p_reflection_probe_pass); + + +} + +bool VisualServerScene::_render_reflection_probe_step(Instance* p_instance,int p_step) { + + InstanceReflectionProbeData *reflection_probe = static_cast<InstanceReflectionProbeData*>(p_instance->base_data); + Scenario *scenario = p_instance->scenario; + ERR_FAIL_COND_V(!scenario,true); + + if (p_step==0) { + + if (!VSG::scene_render->reflection_probe_instance_begin_render(reflection_probe->instance,scenario->reflection_atlas)) { + return true; //sorry, all full :( + } + } + + if (p_step>=0 && p_step<6) { + + static const Vector3 view_normals[6]={ + Vector3(-1, 0, 0), + Vector3(+1, 0, 0), + Vector3( 0,-1, 0), + Vector3( 0,+1, 0), + Vector3( 0, 0,-1), + Vector3( 0, 0,+1) + }; + + Vector3 extents = VSG::storage->reflection_probe_get_extents(p_instance->base); + Vector3 origin_offset = VSG::storage->reflection_probe_get_origin_offset(p_instance->base); + float max_distance = VSG::storage->reflection_probe_get_origin_max_distance(p_instance->base); + + + Vector3 edge = view_normals[p_step]*extents; + float distance = ABS(view_normals[p_step].dot(edge)-view_normals[p_step].dot(origin_offset)); //distance from origin offset to actual view distance limit + + max_distance = MAX(max_distance,distance); + + + //render cubemap side + CameraMatrix cm; + cm.set_perspective(90,1,0.01,max_distance); + + + static const Vector3 view_up[6]={ + Vector3( 0,-1, 0), + Vector3( 0,-1, 0), + Vector3( 0, 0,-1), + Vector3( 0, 0,+1), + Vector3( 0,-1, 0), + Vector3( 0,-1, 0) + }; + + Transform local_view; + local_view.set_look_at(origin_offset,origin_offset+view_normals[p_step],view_up[p_step]); + + Transform xform = p_instance->transform * local_view; + + RID shadow_atlas; + + if (VSG::storage->reflection_probe_renders_shadows(p_instance->base)) { + + shadow_atlas=scenario->reflection_probe_shadow_atlas; + } + + _render_scene(xform,cm,false,RID(),VSG::storage->reflection_probe_get_cull_mask(p_instance->base),p_instance->scenario->self,shadow_atlas,reflection_probe->instance,p_step); + + } else { + //do roughness postprocess step until it belives it's done + return VSG::scene_render->reflection_probe_instance_postprocess_step(reflection_probe->instance); + } + + return false; +} + +void VisualServerScene::_gi_probe_fill_local_data(int p_idx, int p_level, int p_x, int p_y, int p_z, const GIProbeDataCell* p_cell, const GIProbeDataHeader *p_header, InstanceGIProbeData::LocalData *p_local_data, Vector<uint32_t> *prev_cell) { + + if (p_level==p_header->cell_subdiv-1) { + + Vector3 emission; + emission.x=(p_cell[p_idx].emission>>24)/255.0; + emission.y=((p_cell[p_idx].emission>>16)&0xFF)/255.0; + emission.z=((p_cell[p_idx].emission>>8)&0xFF)/255.0; + float l = (p_cell[p_idx].emission&0xFF)/255.0; + l*=8.0; + + emission*=l; + + p_local_data[p_idx].energy[0]=uint16_t(emission.x*1024); //go from 0 to 1024 for light + p_local_data[p_idx].energy[1]=uint16_t(emission.y*1024); //go from 0 to 1024 for light + p_local_data[p_idx].energy[2]=uint16_t(emission.z*1024); //go from 0 to 1024 for light + } else { + + p_local_data[p_idx].energy[0]=0; + p_local_data[p_idx].energy[1]=0; + p_local_data[p_idx].energy[2]=0; + + int half=(1<<(p_header->cell_subdiv-1))>>(p_level+1); + + for(int i=0;i<8;i++) { + + uint32_t child = p_cell[p_idx].children[i]; + + if (child==0xFFFFFFFF) + continue; + + int x = p_x; + int y = p_y; + int z = p_z; + + if (i&1) + x+=half; + if (i&2) + y+=half; + if (i&4) + z+=half; + + _gi_probe_fill_local_data(child,p_level+1,x,y,z,p_cell,p_header,p_local_data,prev_cell); + } + } + + //position for each part of the mipmaped texture + p_local_data[p_idx].pos[0]=p_x>>(p_header->cell_subdiv-p_level-1); + p_local_data[p_idx].pos[1]=p_y>>(p_header->cell_subdiv-p_level-1); + p_local_data[p_idx].pos[2]=p_z>>(p_header->cell_subdiv-p_level-1); + + prev_cell[p_level].push_back(p_idx); + +} + + +void VisualServerScene::_gi_probe_bake_threads(void* self) { + + VisualServerScene* vss = (VisualServerScene*)self; + vss->_gi_probe_bake_thread(); +} + +void VisualServerScene::_setup_gi_probe(Instance *p_instance) { + + + InstanceGIProbeData *probe = static_cast<InstanceGIProbeData*>(p_instance->base_data); + + if (probe->dynamic.probe_data.is_valid()) { + VSG::storage->free(probe->dynamic.probe_data); + probe->dynamic.probe_data=RID(); + } + + probe->dynamic.light_data=VSG::storage->gi_probe_get_dynamic_data(p_instance->base); + + if (probe->dynamic.light_data.size()==0) + return; + //using dynamic data + PoolVector<int>::Read r=probe->dynamic.light_data.read(); + + const GIProbeDataHeader *header = (GIProbeDataHeader *)r.ptr(); + + probe->dynamic.local_data.resize(header->cell_count); + + int cell_count = probe->dynamic.local_data.size(); + PoolVector<InstanceGIProbeData::LocalData>::Write ldw = probe->dynamic.local_data.write(); + const GIProbeDataCell *cells = (GIProbeDataCell*)&r[16]; + + probe->dynamic.level_cell_lists.resize(header->cell_subdiv); + + _gi_probe_fill_local_data(0,0,0,0,0,cells,header,ldw.ptr(),probe->dynamic.level_cell_lists.ptr()); + + bool compress = VSG::storage->gi_probe_is_compressed(p_instance->base); + + probe->dynamic.compression = compress ? VSG::storage->gi_probe_get_dynamic_data_get_preferred_compression() : RasterizerStorage::GI_PROBE_UNCOMPRESSED; + + probe->dynamic.probe_data=VSG::storage->gi_probe_dynamic_data_create(header->width,header->height,header->depth,probe->dynamic.compression); + + probe->dynamic.bake_dynamic_range=VSG::storage->gi_probe_get_dynamic_range(p_instance->base); + + probe->dynamic.mipmaps_3d.clear(); + + probe->dynamic.grid_size[0]=header->width; + probe->dynamic.grid_size[1]=header->height; + probe->dynamic.grid_size[2]=header->depth; + + int size_limit = 1; + int size_divisor = 1; + + if (probe->dynamic.compression==RasterizerStorage::GI_PROBE_S3TC) { + print_line("S3TC"); + size_limit=4; + size_divisor=4; + } + for(int i=0;i<(int)header->cell_subdiv;i++) { + + uint32_t x = header->width >> i; + uint32_t y = header->height >> i; + uint32_t z = header->depth >> i; + + //create and clear mipmap + PoolVector<uint8_t> mipmap; + int size = x*y*z*4; + size/=size_divisor; + mipmap.resize(size); + PoolVector<uint8_t>::Write w = mipmap.write(); + zeromem(w.ptr(),size); + w = PoolVector<uint8_t>::Write(); + + probe->dynamic.mipmaps_3d.push_back(mipmap); + + if (x<=size_limit || y<=size_limit || z<=size_limit) + break; + } + + probe->dynamic.updating_stage=GI_UPDATE_STAGE_CHECK; + probe->invalid=false; + probe->dynamic.enabled=true; + + Transform cell_to_xform = VSG::storage->gi_probe_get_to_cell_xform(p_instance->base); + Rect3 bounds = VSG::storage->gi_probe_get_bounds(p_instance->base); + float cell_size = VSG::storage->gi_probe_get_cell_size(p_instance->base); + + probe->dynamic.light_to_cell_xform=cell_to_xform * p_instance->transform.affine_inverse(); + + VSG::scene_render->gi_probe_instance_set_light_data(probe->probe_instance,p_instance->base,probe->dynamic.probe_data); + VSG::scene_render->gi_probe_instance_set_transform_to_data(probe->probe_instance,probe->dynamic.light_to_cell_xform); + + VSG::scene_render->gi_probe_instance_set_bounds(probe->probe_instance,bounds.size/cell_size); + + probe->base_version=VSG::storage->gi_probe_get_version(p_instance->base); + + //if compression is S3TC, fill it up + if (probe->dynamic.compression==RasterizerStorage::GI_PROBE_S3TC) { + + //create all blocks + Vector<Map<uint32_t,InstanceGIProbeData::CompBlockS3TC> > comp_blocks; + int mipmap_count = probe->dynamic.mipmaps_3d.size(); + comp_blocks.resize(mipmap_count); + + for(int i=0;i<cell_count;i++) { + + const GIProbeDataCell &c = cells[i]; + const InstanceGIProbeData::LocalData &ld = ldw[i]; + int level = c.level_alpha>>16; + int mipmap = header->cell_subdiv - level -1; + if (mipmap >= mipmap_count) + continue;//uninteresting + + + int blockx = (ld.pos[0]>>2); + int blocky = (ld.pos[1]>>2); + int blockz = (ld.pos[2]); //compression is x/y only + + int blockw = (header->width >> mipmap) >> 2; + int blockh = (header->height >> mipmap) >> 2; + + //print_line("cell "+itos(i)+" level "+itos(level)+"mipmap: "+itos(mipmap)+" pos: "+Vector3(blockx,blocky,blockz)+" size "+Vector2(blockw,blockh)); + + uint32_t key = blockz * blockw*blockh + blocky * blockw + blockx; + + Map<uint32_t,InstanceGIProbeData::CompBlockS3TC> & cmap = comp_blocks[mipmap]; + + if (!cmap.has(key)) { + + InstanceGIProbeData::CompBlockS3TC k; + k.offset=key; //use offset as counter first + k.source_count=0; + cmap[key]=k; + } + + InstanceGIProbeData::CompBlockS3TC &k=cmap[key]; + ERR_CONTINUE(k.source_count==16); + k.sources[k.source_count++]=i; + } + + //fix the blocks, precomputing what is needed + probe->dynamic.mipmaps_s3tc.resize(mipmap_count); + + for(int i=0;i<mipmap_count;i++) { + print_line("S3TC level: "+itos(i)+" blocks: "+itos(comp_blocks[i].size())); + probe->dynamic.mipmaps_s3tc[i].resize(comp_blocks[i].size()); + PoolVector<InstanceGIProbeData::CompBlockS3TC>::Write w = probe->dynamic.mipmaps_s3tc[i].write(); + int block_idx=0; + + for (Map<uint32_t,InstanceGIProbeData::CompBlockS3TC>::Element *E=comp_blocks[i].front();E;E=E->next()) { + + InstanceGIProbeData::CompBlockS3TC k = E->get(); + + //PRECOMPUTE ALPHA + int max_alpha=-100000; + int min_alpha=k.source_count==16 ?100000 :0; //if the block is not completely full, minimum is always 0, (and those blocks will map to 1, which will be zero) + + uint8_t alpha_block[4][4]={ {0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0} }; + + for(int j=0;j<k.source_count;j++) { + + int alpha = (cells[k.sources[j]].level_alpha>>8)&0xFF; + if (alpha<min_alpha) + min_alpha=alpha; + if (alpha>max_alpha) + max_alpha=alpha; + //fill up alpha block + alpha_block[ldw[k.sources[j]].pos[0]%4][ldw[k.sources[j]].pos[1]%4]=alpha; + + } + + //use the first mode (8 adjustable levels) + k.alpha[0]=max_alpha; + k.alpha[1]=min_alpha; + + uint64_t alpha_bits=0; + + if (max_alpha!=min_alpha) { + + int idx=0; + + for(int y=0;y<4;y++) { + for(int x=0;x<4;x++) { + + //substract minimum + uint32_t a = uint32_t(alpha_block[x][y])-min_alpha; + //convert range to 3 bits + a =int((a * 7.0 / (max_alpha-min_alpha))+0.5); + a = CLAMP(a,0,7); //just to be sure + a = 7-a; //because range is inverted in this mode + if (a==0) { + //do none, remain + } else if (a==7) { + a=1; + } else { + a=a+1; + } + + alpha_bits|=uint64_t(a)<<(idx*3); + idx++; + } + } + } + + k.alpha[2]=(alpha_bits >> 0)&0xFF; + k.alpha[3]=(alpha_bits >> 8)&0xFF; + k.alpha[4]=(alpha_bits >> 16)&0xFF; + k.alpha[5]=(alpha_bits >> 24)&0xFF; + k.alpha[6]=(alpha_bits >> 32)&0xFF; + k.alpha[7]=(alpha_bits >> 40)&0xFF; + + w[block_idx++]=k; + + } + + } + } + +} + +void VisualServerScene::_gi_probe_bake_thread() { + + while(true) { + + probe_bake_sem->wait(); + if (probe_bake_thread_exit) { + break; + } + + Instance* to_bake=NULL; + + probe_bake_mutex->lock(); + + if (!probe_bake_list.empty()) { + to_bake=probe_bake_list.front()->get(); + probe_bake_list.pop_front(); + + } + probe_bake_mutex->unlock(); + + if (!to_bake) + continue; + + _bake_gi_probe(to_bake); + } +} + + + +uint32_t VisualServerScene::_gi_bake_find_cell(const GIProbeDataCell *cells,int x,int y, int z,int p_cell_subdiv) { + + + uint32_t cell=0; + + int ofs_x=0; + int ofs_y=0; + int ofs_z=0; + int size = 1<<(p_cell_subdiv-1); + int half=size/2; + + if (x<0 || x>=size) + return -1; + if (y<0 || y>=size) + return -1; + if (z<0 || z>=size) + return -1; + + for(int i=0;i<p_cell_subdiv-1;i++) { + + const GIProbeDataCell *bc = &cells[cell]; + + int child = 0; + if (x >= ofs_x + half) { + child|=1; + ofs_x+=half; + } + if (y >= ofs_y + half) { + child|=2; + ofs_y+=half; + } + if (z >= ofs_z + half) { + child|=4; + ofs_z+=half; + } + + cell = bc->children[child]; + if (cell==0xFFFFFFFF) + return 0xFFFFFFFF; + + half>>=1; + } + + return cell; + +} + +static float _get_normal_advance(const Vector3& p_normal ) { + + Vector3 normal = p_normal; + Vector3 unorm = normal.abs(); + + if ( (unorm.x >= unorm.y) && (unorm.x >= unorm.z) ) { + // x code + unorm = normal.x > 0.0 ? Vector3( 1.0, 0.0, 0.0 ) : Vector3( -1.0, 0.0, 0.0 ) ; + } else if ( (unorm.y > unorm.x) && (unorm.y >= unorm.z) ) { + // y code + unorm = normal.y > 0.0 ? Vector3( 0.0, 1.0, 0.0 ) : Vector3( 0.0, -1.0, 0.0 ) ; + } else if ( (unorm.z > unorm.x) && (unorm.z > unorm.y) ) { + // z code + unorm = normal.z > 0.0 ? Vector3( 0.0, 0.0, 1.0 ) : Vector3( 0.0, 0.0, -1.0 ) ; + } else { + // oh-no we messed up code + // has to be + unorm = Vector3( 1.0, 0.0, 0.0 ); + } + + return 1.0/normal.dot(unorm); + +} + +void VisualServerScene::_bake_gi_probe_light(const GIProbeDataHeader *header,const GIProbeDataCell *cells,InstanceGIProbeData::LocalData *local_data,const uint32_t *leaves,int leaf_count, const InstanceGIProbeData::LightCache& light_cache,int sign) { + + + int light_r = int(light_cache.color.r * light_cache.energy * 1024.0)*sign; + int light_g = int(light_cache.color.g * light_cache.energy * 1024.0)*sign; + int light_b = int(light_cache.color.b * light_cache.energy * 1024.0)*sign; + + float limits[3]={float(header->width),float(header->height),float(header->depth)}; + Plane clip[3]; + int clip_planes=0; + + + + switch(light_cache.type) { + + case VS::LIGHT_DIRECTIONAL: { + + float max_len = Vector3(limits[0],limits[1],limits[2]).length()*1.1; + + Vector3 light_axis = -light_cache.transform.basis.get_axis(2).normalized(); + + for(int i=0;i<3;i++) { + + if (ABS(light_axis[i])<CMP_EPSILON) + continue; + clip[clip_planes].normal[i]=1.0; + + if (light_axis[i]<0) { + + clip[clip_planes].d=limits[i]+1; + } else { + clip[clip_planes].d-=1.0; + } + + clip_planes++; + } + + float distance_adv = _get_normal_advance(light_axis); + + int success_count=0; + + uint64_t us = OS::get_singleton()->get_ticks_usec(); + + for(int i=0;i<leaf_count;i++) { + + uint32_t idx = leaves[i]; + + const GIProbeDataCell *cell = &cells[idx]; + InstanceGIProbeData::LocalData *light = &local_data[idx]; + + Vector3 to(light->pos[0]+0.5,light->pos[1]+0.5,light->pos[2]+0.5); + Vector3 norm ( + (((cells[idx].normal>>16)&0xFF)/255.0)*2.0-1.0, + (((cells[idx].normal>>8)&0xFF)/255.0)*2.0-1.0, + (((cells[idx].normal>>0)&0xFF)/255.0)*2.0-1.0 + ); + + + float att = norm.dot(-light_axis); + if (att<0.001) { + //not lighting towards this + continue; + } + + Vector3 from = to - max_len * light_axis; + + for(int j=0;j<clip_planes;j++) { + + clip[j].intersects_segment(from,to,&from); + } + + float distance = (to - from).length(); + distance+=distance_adv-Math::fmod(distance,distance_adv); //make it reach the center of the box always + from = to - light_axis * distance; + + uint32_t result=0xFFFFFFFF; + + while(distance>-distance_adv) { //use this to avoid precision errors + + result = _gi_bake_find_cell(cells,int(floor(from.x)),int(floor(from.y)),int(floor(from.z)),header->cell_subdiv); + if (result!=0xFFFFFFFF) { + break; + } + + from+=light_axis*distance_adv; + distance-=distance_adv; + } + + if (result==idx) { + //cell hit itself! hooray! + light->energy[0]+=int32_t(light_r*att*((cell->albedo>>16)&0xFF)/255.0); + light->energy[1]+=int32_t(light_g*att*((cell->albedo>>8)&0xFF)/255.0); + light->energy[2]+=int32_t(light_b*att*((cell->albedo)&0xFF)/255.0); + success_count++; + } + } + print_line("BAKE TIME: "+rtos((OS::get_singleton()->get_ticks_usec()-us)/1000000.0)); + print_line("valid cells: "+itos(success_count)); + + + } break; + case VS::LIGHT_OMNI: + case VS::LIGHT_SPOT: { + + + uint64_t us = OS::get_singleton()->get_ticks_usec(); + + Vector3 light_pos = light_cache.transform.origin; + Vector3 spot_axis = -light_cache.transform.basis.get_axis(2).normalized(); + + + float local_radius = light_cache.radius * light_cache.transform.basis.get_axis(2).length(); + + for(int i=0;i<leaf_count;i++) { + + uint32_t idx = leaves[i]; + + const GIProbeDataCell *cell = &cells[idx]; + InstanceGIProbeData::LocalData *light = &local_data[idx]; + + Vector3 to(light->pos[0]+0.5,light->pos[1]+0.5,light->pos[2]+0.5); + Vector3 norm ( + (((cells[idx].normal>>16)&0xFF)/255.0)*2.0-1.0, + (((cells[idx].normal>>8)&0xFF)/255.0)*2.0-1.0, + (((cells[idx].normal>>0)&0xFF)/255.0)*2.0-1.0 + ); + + Vector3 light_axis = (to - light_pos).normalized(); + float distance_adv = _get_normal_advance(light_axis); + + float att = norm.dot(-light_axis); + if (att<0.001) { + //not lighting towards this + continue; + } + + { + float d = light_pos.distance_to(to); + if (d+distance_adv > local_radius) + continue; // too far away + + float dt = CLAMP((d+distance_adv)/local_radius,0,1); + att*= powf(1.0-dt,light_cache.attenuation); + } + + + if (light_cache.type==VS::LIGHT_SPOT) { + + float angle = Math::rad2deg(acos(light_axis.dot(spot_axis))); + if (angle > light_cache.spot_angle) + continue; + + float d = CLAMP(angle/light_cache.spot_angle,1,0); + att*= powf(1.0-d,light_cache.spot_attenuation); + + } + + clip_planes=0; + + for(int c=0;c<3;c++) { + + if (ABS(light_axis[c])<CMP_EPSILON) + continue; + clip[clip_planes].normal[c]=1.0; + + if (light_axis[c]<0) { + + clip[clip_planes].d=limits[c]+1; + } else { + clip[clip_planes].d-=1.0; + } + + clip_planes++; + } + + Vector3 from = light_pos; + + for(int j=0;j<clip_planes;j++) { + + clip[j].intersects_segment(from,to,&from); + } + + float distance = (to - from).length(); + + + + distance-=Math::fmod(distance,distance_adv); //make it reach the center of the box always, but this tame make it closer + from = to - light_axis * distance; + + uint32_t result=0xFFFFFFFF; + + while(distance>-distance_adv) { //use this to avoid precision errors + + result = _gi_bake_find_cell(cells,int(floor(from.x)),int(floor(from.y)),int(floor(from.z)),header->cell_subdiv); + if (result!=0xFFFFFFFF) { + break; + } + + from+=light_axis*distance_adv; + distance-=distance_adv; + } + + if (result==idx) { + //cell hit itself! hooray! + + light->energy[0]+=int32_t(light_r*att*((cell->albedo>>16)&0xFF)/255.0); + light->energy[1]+=int32_t(light_g*att*((cell->albedo>>8)&0xFF)/255.0); + light->energy[2]+=int32_t(light_b*att*((cell->albedo)&0xFF)/255.0); + + } + } + print_line("BAKE TIME: "+rtos((OS::get_singleton()->get_ticks_usec()-us)/1000000.0)); + + + } break; + } +} + + +void VisualServerScene::_bake_gi_downscale_light(int p_idx, int p_level, const GIProbeDataCell* p_cells, const GIProbeDataHeader *p_header, InstanceGIProbeData::LocalData *p_local_data) { + + //average light to upper level + p_local_data[p_idx].energy[0]=0; + p_local_data[p_idx].energy[1]=0; + p_local_data[p_idx].energy[2]=0; + + int divisor=0; + + for(int i=0;i<8;i++) { + + uint32_t child = p_cells[p_idx].children[i]; + + if (child==0xFFFFFFFF) + continue; + + if (p_level+1 < (int)p_header->cell_subdiv-1) { + _bake_gi_downscale_light(child,p_level+1,p_cells,p_header,p_local_data); + } + + p_local_data[p_idx].energy[0]+=p_local_data[child].energy[0]; + p_local_data[p_idx].energy[1]+=p_local_data[child].energy[1]; + p_local_data[p_idx].energy[2]+=p_local_data[child].energy[2]; + divisor++; + + } + + //divide by eight for average + p_local_data[p_idx].energy[0]/=divisor; + p_local_data[p_idx].energy[1]/=divisor; + p_local_data[p_idx].energy[2]/=divisor; + +} + + +void VisualServerScene::_bake_gi_probe(Instance *p_gi_probe) { + + InstanceGIProbeData * probe_data = static_cast<InstanceGIProbeData*>(p_gi_probe->base_data); + + PoolVector<int>::Read r=probe_data->dynamic.light_data.read(); + + const GIProbeDataHeader *header = (const GIProbeDataHeader *)r.ptr(); + const GIProbeDataCell *cells = (const GIProbeDataCell*)&r[16]; + + int leaf_count = probe_data->dynamic.level_cell_lists[ header->cell_subdiv -1 ].size(); + const uint32_t *leaves = probe_data->dynamic.level_cell_lists[ header->cell_subdiv -1 ].ptr(); + + PoolVector<InstanceGIProbeData::LocalData>::Write ldw = probe_data->dynamic.local_data.write(); + + InstanceGIProbeData::LocalData *local_data = ldw.ptr(); + + + //remove what must be removed + for (Map<RID,InstanceGIProbeData::LightCache>::Element *E=probe_data->dynamic.light_cache.front();E;E=E->next()) { + + RID rid = E->key(); + const InstanceGIProbeData::LightCache& lc = E->get(); + + if (!probe_data->dynamic.light_cache_changes.has(rid) || !(probe_data->dynamic.light_cache_changes[rid]==lc)) { + //erase light data + + _bake_gi_probe_light(header,cells,local_data,leaves,leaf_count,lc,-1); + } + + } + + //add what must be added + for (Map<RID,InstanceGIProbeData::LightCache>::Element *E=probe_data->dynamic.light_cache_changes.front();E;E=E->next()) { + + RID rid = E->key(); + const InstanceGIProbeData::LightCache& lc = E->get(); + + if (!probe_data->dynamic.light_cache.has(rid) || !(probe_data->dynamic.light_cache[rid]==lc)) { + //add light data + + _bake_gi_probe_light(header,cells,local_data,leaves,leaf_count,lc,1); + } + } + + SWAP(probe_data->dynamic.light_cache_changes,probe_data->dynamic.light_cache); + + //downscale to lower res levels + _bake_gi_downscale_light(0,0,cells,header,local_data); + + //plot result to 3D texture! + + if (probe_data->dynamic.compression==RasterizerStorage::GI_PROBE_UNCOMPRESSED) { + + for(int i=0;i<(int)header->cell_subdiv;i++) { + + int stage = header->cell_subdiv - i -1; + + if (stage >= probe_data->dynamic.mipmaps_3d.size()) + continue; //no mipmap for this one + + print_line("generating mipmap stage: "+itos(stage)); + int level_cell_count = probe_data->dynamic.level_cell_lists[ i ].size(); + const uint32_t *level_cells = probe_data->dynamic.level_cell_lists[ i ].ptr(); + + PoolVector<uint8_t>::Write lw = probe_data->dynamic.mipmaps_3d[stage].write(); + uint8_t *mipmapw = lw.ptr(); + + uint32_t sizes[3]={header->width>>stage,header->height>>stage,header->depth>>stage}; + + for(int j=0;j<level_cell_count;j++) { + + uint32_t idx = level_cells[j]; + + uint32_t r = (uint32_t(local_data[idx].energy[0])/probe_data->dynamic.bake_dynamic_range)>>2; + uint32_t g = (uint32_t(local_data[idx].energy[1])/probe_data->dynamic.bake_dynamic_range)>>2; + uint32_t b = (uint32_t(local_data[idx].energy[2])/probe_data->dynamic.bake_dynamic_range)>>2; + uint32_t a = (cells[idx].level_alpha>>8)&0xFF; + + uint32_t mm_ofs = sizes[0]*sizes[1]*(local_data[idx].pos[2]) + sizes[0]*(local_data[idx].pos[1]) + (local_data[idx].pos[0]); + mm_ofs*=4; //for RGBA (4 bytes) + + mipmapw[mm_ofs+0]=uint8_t(CLAMP(r,0,255)); + mipmapw[mm_ofs+1]=uint8_t(CLAMP(g,0,255)); + mipmapw[mm_ofs+2]=uint8_t(CLAMP(b,0,255)); + mipmapw[mm_ofs+3]=uint8_t(CLAMP(a,0,255)); + + + } + } + } else if (probe_data->dynamic.compression==RasterizerStorage::GI_PROBE_S3TC) { + + + int mipmap_count = probe_data->dynamic.mipmaps_3d.size(); + + for(int mmi=0;mmi<mipmap_count;mmi++) { + + PoolVector<uint8_t>::Write mmw = probe_data->dynamic.mipmaps_3d[mmi].write(); + int block_count = probe_data->dynamic.mipmaps_s3tc[mmi].size(); + PoolVector<InstanceGIProbeData::CompBlockS3TC>::Read mmr = probe_data->dynamic.mipmaps_s3tc[mmi].read(); + + for(int i=0;i<block_count;i++) { + + const InstanceGIProbeData::CompBlockS3TC& b = mmr[i]; + + uint8_t *blockptr = &mmw[b.offset*16]; + copymem(blockptr,b.alpha,8); //copy alpha part, which is precomputed + + Vector3 colors[16]; + + for(int j=0;j<b.source_count;j++) { + + colors[j].x=(local_data[b.sources[j]].energy[0]/float(probe_data->dynamic.bake_dynamic_range))/1024.0; + colors[j].y=(local_data[b.sources[j]].energy[1]/float(probe_data->dynamic.bake_dynamic_range))/1024.0; + colors[j].z=(local_data[b.sources[j]].energy[2]/float(probe_data->dynamic.bake_dynamic_range))/1024.0; + } + //super quick and dirty compression + //find 2 most futher apart + float distance=0; + Vector3 from,to; + + if (b.source_count==16) { + //all cells are used so, find minmax between them + int further_apart[2]={0,0}; + for(int j=0;j<b.source_count;j++) { + for(int k=j+1;k<b.source_count;k++) { + float d = colors[j].distance_squared_to(colors[k]); + if (d>distance) { + distance=d; + further_apart[0]=j; + further_apart[1]=k; + } + } + } + + from = colors[further_apart[0]]; + to = colors[further_apart[1]]; + + } else { + //if a block is missing, the priority is that this block remains black, + //otherwise the geometry will appear deformed + //correct shape wins over correct color in this case + //average all colors first + Vector3 average; + + for(int j=0;j<b.source_count;j++) { + average+=colors[j]; + } + average.normalize(); + //find max distance in normal from average + for(int j=0;j<b.source_count;j++) { + float d = average.dot(colors[j]); + distance=MAX(d,distance); + } + + from = Vector3(); //from black + to = average * distance; + //find max distance + + } + + + int indices[16]; + uint16_t color_0=0; + color_0 = CLAMP(int(from.x*31),0,31)<<11; + color_0 |= CLAMP(int(from.y*63),0,63)<<5; + color_0 |= CLAMP(int(from.z*31),0,31); + + uint16_t color_1=0; + color_1 = CLAMP(int(to.x*31),0,31)<<11; + color_1 |= CLAMP(int(to.y*63),0,63)<<5; + color_1 |= CLAMP(int(to.z*31),0,31); + + if (color_1 > color_0) { + SWAP(color_1,color_0); + SWAP(from,to); + } + + + if (distance>0) { + + Vector3 dir = (to-from).normalized(); + + + for(int j=0;j<b.source_count;j++) { + + float d = (colors[j]-from).dot(dir) / distance; + indices[j]=int(d*3+0.5); + + static const int index_swap[4]={0,3,1,2}; + + indices[j]=index_swap[CLAMP(indices[j],0,3)]; + + + } + } else { + for(int j=0;j<b.source_count;j++) { + indices[j]=0; + } + } + + //by default, 1 is black, otherwise it will be overriden by source + + uint32_t index_block[16]={1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1 }; + + for(int j=0;j<b.source_count;j++) { + + int x=local_data[b.sources[j]].pos[0]%4; + int y=local_data[b.sources[j]].pos[1]%4; + + index_block[y*4+x]=indices[j]; + } + + uint32_t encode=0; + + for(int j=0;j<16;j++) { + encode|=index_block[j]<<(j*2); + } + + blockptr[8]=color_0&0xFF; + blockptr[9]=(color_0>>8)&0xFF; + blockptr[10]=color_1&0xFF; + blockptr[11]=(color_1>>8)&0xFF; + blockptr[12]=encode&0xFF; + blockptr[13]=(encode>>8)&0xFF; + blockptr[14]=(encode>>16)&0xFF; + blockptr[15]=(encode>>24)&0xFF; + + } + + + } + + } + + + //send back to main thread to update un little chunks + probe_data->dynamic.updating_stage=GI_UPDATE_STAGE_UPLOADING; + +} + +bool VisualServerScene::_check_gi_probe(Instance *p_gi_probe) { + + InstanceGIProbeData * probe_data = static_cast<InstanceGIProbeData*>(p_gi_probe->base_data); + + probe_data->dynamic.light_cache_changes.clear(); + + bool all_equal=true; + + + for (List<Instance*>::Element *E=p_gi_probe->scenario->directional_lights.front();E;E=E->next()) { + + InstanceGIProbeData::LightCache lc; + lc.type=VSG::storage->light_get_type(E->get()->base); + lc.color=VSG::storage->light_get_color(E->get()->base); + lc.energy=VSG::storage->light_get_param(E->get()->base,VS::LIGHT_PARAM_ENERGY); + lc.radius=VSG::storage->light_get_param(E->get()->base,VS::LIGHT_PARAM_RANGE); + lc.attenuation=VSG::storage->light_get_param(E->get()->base,VS::LIGHT_PARAM_ATTENUATION); + lc.spot_angle=VSG::storage->light_get_param(E->get()->base,VS::LIGHT_PARAM_SPOT_ANGLE); + lc.spot_attenuation=VSG::storage->light_get_param(E->get()->base,VS::LIGHT_PARAM_SPOT_ATTENUATION); + lc.transform = probe_data->dynamic.light_to_cell_xform * E->get()->transform; + + if (!probe_data->dynamic.light_cache.has(E->get()->self) || !(probe_data->dynamic.light_cache[E->get()->self]==lc)) { + all_equal=false; + } + + probe_data->dynamic.light_cache_changes[E->get()->self]=lc; + + } + + + for (Set<Instance*>::Element *E=probe_data->lights.front();E;E=E->next()) { + + InstanceGIProbeData::LightCache lc; + lc.type=VSG::storage->light_get_type(E->get()->base); + lc.color=VSG::storage->light_get_color(E->get()->base); + lc.energy=VSG::storage->light_get_param(E->get()->base,VS::LIGHT_PARAM_ENERGY); + lc.radius=VSG::storage->light_get_param(E->get()->base,VS::LIGHT_PARAM_RANGE); + lc.attenuation=VSG::storage->light_get_param(E->get()->base,VS::LIGHT_PARAM_ATTENUATION); + lc.spot_angle=VSG::storage->light_get_param(E->get()->base,VS::LIGHT_PARAM_SPOT_ANGLE); + lc.spot_attenuation=VSG::storage->light_get_param(E->get()->base,VS::LIGHT_PARAM_SPOT_ATTENUATION); + lc.transform = probe_data->dynamic.light_to_cell_xform * E->get()->transform; + + if (!probe_data->dynamic.light_cache.has(E->get()->self) || !(probe_data->dynamic.light_cache[E->get()->self]==lc)) { + all_equal=false; + } + + probe_data->dynamic.light_cache_changes[E->get()->self]=lc; + } + + //lighting changed from after to before, must do some updating + return !all_equal || probe_data->dynamic.light_cache_changes.size()!=probe_data->dynamic.light_cache.size(); + +} + +void VisualServerScene::render_probes() { + + /* REFLECTION PROBES */ + + SelfList<InstanceReflectionProbeData> *ref_probe = reflection_probe_render_list.first(); + + bool busy=false; + + while(ref_probe) { + + SelfList<InstanceReflectionProbeData> *next=ref_probe->next(); + RID base = ref_probe->self()->owner->base; + + switch(VSG::storage->reflection_probe_get_update_mode(base)) { + + case VS::REFLECTION_PROBE_UPDATE_ONCE: { + if (busy) //already rendering something + break; + + bool done = _render_reflection_probe_step(ref_probe->self()->owner,ref_probe->self()->render_step); + if (done) { + reflection_probe_render_list.remove(ref_probe); + } else { + ref_probe->self()->render_step++; + } + + busy=true; //do not render another one of this kind + } break; + case VS::REFLECTION_PROBE_UPDATE_ALWAYS: { + + int step=0; + bool done=false; + while(!done) { + done = _render_reflection_probe_step(ref_probe->self()->owner,step); + step++; + } + + reflection_probe_render_list.remove(ref_probe); + } break; + + } + + ref_probe=next; + } + + /* GI PROBES */ + + SelfList<InstanceGIProbeData> *gi_probe = gi_probe_update_list.first(); + + while(gi_probe) { + + SelfList<InstanceGIProbeData> *next=gi_probe->next(); + + InstanceGIProbeData *probe = gi_probe->self(); + Instance *instance_probe = probe->owner; + + //check if probe must be setup, but don't do if on the lighting thread + + bool force_lighting=false; + + if (probe->invalid || (probe->dynamic.updating_stage==GI_UPDATE_STAGE_CHECK && probe->base_version!=VSG::storage->gi_probe_get_version(instance_probe->base))) { + + _setup_gi_probe(instance_probe); + force_lighting=true; + } + + if (probe->invalid==false && probe->dynamic.enabled) { + + switch(probe->dynamic.updating_stage) { + case GI_UPDATE_STAGE_CHECK: { + + if (_check_gi_probe(instance_probe) || force_lighting) { + //send to lighting thread + probe->dynamic.updating_stage=GI_UPDATE_STAGE_LIGHTING; + +#ifndef NO_THREADS + probe_bake_mutex->lock(); + probe_bake_list.push_back(instance_probe); + probe_bake_mutex->unlock(); + probe_bake_sem->post(); + +#else + + _bake_gi_probe(instance_probe); +#endif + + } + } break; + case GI_UPDATE_STAGE_LIGHTING: { + //do none, wait til done! + + } break; + case GI_UPDATE_STAGE_UPLOADING: { + + uint64_t us = OS::get_singleton()->get_ticks_usec(); + + for(int i=0;i<(int)probe->dynamic.mipmaps_3d.size();i++) { + + int mmsize = probe->dynamic.mipmaps_3d[i].size(); + PoolVector<uint8_t>::Read r = probe->dynamic.mipmaps_3d[i].read(); + VSG::storage->gi_probe_dynamic_data_update(probe->dynamic.probe_data,0,probe->dynamic.grid_size[2]>>i,i,r.ptr()); + } + + + probe->dynamic.updating_stage=GI_UPDATE_STAGE_CHECK; + +// print_line("UPLOAD TIME: "+rtos((OS::get_singleton()->get_ticks_usec()-us)/1000000.0)); + } break; + + } + } + //_update_gi_probe(gi_probe->self()->owner); + + + gi_probe=next; + } + + + +} + +void VisualServerScene::_update_dirty_instance(Instance *p_instance) { + + if (p_instance->update_aabb) + _update_instance_aabb(p_instance); + + + if (p_instance->update_materials) { + + if (p_instance->base_type==VS::INSTANCE_MESH) { + //remove materials no longer used and un-own them + + int new_mat_count = VSG::storage->mesh_get_surface_count(p_instance->base); + for(int i=p_instance->materials.size()-1;i>=new_mat_count;i--) { + if (p_instance->materials[i].is_valid()) { + VSG::storage->material_remove_instance_owner(p_instance->materials[i],p_instance); + } + } + p_instance->materials.resize(new_mat_count); + + int new_morph_count = VSG::storage->mesh_get_morph_target_count(p_instance->base); + if (new_morph_count!=p_instance->morph_values.size()) { + p_instance->morph_values.resize(new_morph_count); + for(int i=0;i<new_morph_count;i++) { + p_instance->morph_values[i]=0; + } + } + } + + if ((1<<p_instance->base_type)&VS::INSTANCE_GEOMETRY_MASK) { + + InstanceGeometryData *geom = static_cast<InstanceGeometryData*>(p_instance->base_data); + + bool can_cast_shadows=true; + + if (p_instance->cast_shadows==VS::SHADOW_CASTING_SETTING_OFF) { + can_cast_shadows=false; + } else if (p_instance->material_override.is_valid()) { + can_cast_shadows=VSG::storage->material_casts_shadows(p_instance->material_override); + } else { + + + + if (p_instance->base_type==VS::INSTANCE_MESH) { + RID mesh=p_instance->base; + + if (mesh.is_valid()) { + bool cast_shadows=false; + + for(int i=0;i<p_instance->materials.size();i++) { + + + RID mat = p_instance->materials[i].is_valid()?p_instance->materials[i]:VSG::storage->mesh_surface_get_material(mesh,i); + + if (!mat.is_valid()) { + cast_shadows=true; + break; + } + + if (VSG::storage->material_casts_shadows(mat)) { + cast_shadows=true; + break; + } + } + + if (!cast_shadows) { + can_cast_shadows=false; + } + } + + } else if (p_instance->base_type==VS::INSTANCE_MULTIMESH) { + RID mesh = VSG::storage->multimesh_get_mesh(p_instance->base); + if (mesh.is_valid()) { + bool cast_shadows=false; + + int sc = VSG::storage->mesh_get_surface_count(mesh); + for(int i=0;i<sc;i++) { + + RID mat =VSG::storage->mesh_surface_get_material(mesh,i); + + if (!mat.is_valid()) { + cast_shadows=true; + break; + } + + if (VSG::storage->material_casts_shadows(mat)) { + cast_shadows=true; + break; + } + } + + if (!cast_shadows) { + can_cast_shadows=false; + } + } + } else if (p_instance->base_type==VS::INSTANCE_IMMEDIATE) { + + RID mat = VSG::storage->immediate_get_material(p_instance->base); + + if (!mat.is_valid() || VSG::storage->material_casts_shadows(mat)) { + can_cast_shadows=true; + } else { + can_cast_shadows=false; + } + + + } + + + + } + + if (can_cast_shadows!=geom->can_cast_shadows) { + //ability to cast shadows change, let lights now + for (List<Instance*>::Element *E=geom->lighting.front();E;E=E->next()) { + InstanceLightData *light = static_cast<InstanceLightData*>(E->get()->base_data); + light->shadow_dirty=true; + } + + geom->can_cast_shadows=can_cast_shadows; + } + } + + } + + _update_instance(p_instance); + + p_instance->update_aabb=false; + p_instance->update_materials=false; + + _instance_update_list.remove( &p_instance->update_item ); +} + + +void VisualServerScene::update_dirty_instances() { + + while(_instance_update_list.first()) { + + _update_dirty_instance( _instance_update_list.first()->self() ); + } +} + +bool VisualServerScene::free(RID p_rid) { + + if (camera_owner.owns(p_rid)) { + + Camera *camera = camera_owner.get( p_rid ); + + camera_owner.free(p_rid); + memdelete(camera); + + } else if (scenario_owner.owns(p_rid)) { + + Scenario *scenario = scenario_owner.get( p_rid ); + + while(scenario->instances.first()) { + instance_set_scenario(scenario->instances.first()->self()->self,RID()); + } + VSG::scene_render->free(scenario->reflection_probe_shadow_atlas); + VSG::scene_render->free(scenario->reflection_atlas); + scenario_owner.free(p_rid); + memdelete(scenario); + + } else if (instance_owner.owns(p_rid)) { + // delete the instance + + update_dirty_instances(); + + Instance *instance = instance_owner.get(p_rid); + + instance_set_room(p_rid,RID()); + instance_set_scenario(p_rid,RID()); + instance_set_base(p_rid,RID()); + instance_geometry_set_material_override(p_rid,RID()); + instance_attach_skeleton(p_rid,RID()); + + update_dirty_instances(); //in case something changed this + + instance_owner.free(p_rid); + memdelete(instance); + } else { + return false; + } + + + return true; +} + +VisualServerScene *VisualServerScene::singleton=NULL; + + +VisualServerScene::VisualServerScene() { + +#ifndef NO_THREADS + probe_bake_sem = Semaphore::create(); + probe_bake_mutex = Mutex::create(); + probe_bake_thread = Thread::create(_gi_probe_bake_threads,this); + probe_bake_thread_exit=false; +#endif + + + render_pass=1; + singleton=this; + +} + +VisualServerScene::~VisualServerScene() { + +#ifndef NO_THREADS + probe_bake_thread_exit=true; + Thread::wait_to_finish(probe_bake_thread); + memdelete(probe_bake_thread); + memdelete(probe_bake_sem); + memdelete(probe_bake_mutex); + +#endif + + +} diff --git a/servers/visual/visual_server_scene.h b/servers/visual/visual_server_scene.h new file mode 100644 index 0000000000..fc3ea29b00 --- /dev/null +++ b/servers/visual/visual_server_scene.h @@ -0,0 +1,588 @@ +#ifndef VISUALSERVERSCENE_H +#define VISUALSERVERSCENE_H + +#include "servers/visual/rasterizer.h" + +#include "geometry.h" +#include "allocators.h" +#include "octree.h" +#include "self_list.h" +#include "os/thread.h" +#include "os/semaphore.h" +#include "os/semaphore.h" + +class VisualServerScene { +public: + + + enum { + + MAX_INSTANCE_CULL=65536, + MAX_LIGHTS_CULLED=4096, + MAX_REFLECTION_PROBES_CULLED=4096, + MAX_ROOM_CULL=32, + MAX_EXTERIOR_PORTALS=128, + }; + + uint64_t render_pass; + + + static VisualServerScene *singleton; +#if 0 + struct Portal { + + bool enabled; + float disable_distance; + Color disable_color; + float connect_range; + Vector<Point2> shape; + Rect2 bounds; + + + Portal() { enabled=true; disable_distance=50; disable_color=Color(); connect_range=0.8; } + }; + + struct BakedLight { + + Rasterizer::BakedLightData data; + PoolVector<int> sampler; + AABB octree_aabb; + Size2i octree_tex_size; + Size2i light_tex_size; + + }; + + struct BakedLightSampler { + + float params[BAKED_LIGHT_SAMPLER_MAX]; + int resolution; + Vector<Vector3> dp_cache; + + BakedLightSampler() { + params[BAKED_LIGHT_SAMPLER_STRENGTH]=1.0; + params[BAKED_LIGHT_SAMPLER_ATTENUATION]=1.0; + params[BAKED_LIGHT_SAMPLER_RADIUS]=1.0; + params[BAKED_LIGHT_SAMPLER_DETAIL_RATIO]=0.1; + resolution=16; + } + }; + + void _update_baked_light_sampler_dp_cache(BakedLightSampler * blsamp); + +#endif + + + /* CAMERA API */ + + struct Camera : public RID_Data { + + enum Type { + PERSPECTIVE, + ORTHOGONAL + }; + Type type; + float fov; + float znear,zfar; + float size; + uint32_t visible_layers; + bool vaspect; + RID env; + + Transform transform; + + Camera() { + + visible_layers=0xFFFFFFFF; + fov=60; + type=PERSPECTIVE; + znear=0.1; zfar=100; + size=1.0; + vaspect=false; + + } + }; + + mutable RID_Owner<Camera> camera_owner; + + virtual RID camera_create(); + virtual void camera_set_perspective(RID p_camera,float p_fovy_degrees, float p_z_near, float p_z_far); + virtual void camera_set_orthogonal(RID p_camera,float p_size, float p_z_near, float p_z_far); + virtual void camera_set_transform(RID p_camera,const Transform& p_transform); + virtual void camera_set_cull_mask(RID p_camera,uint32_t p_layers); + virtual void camera_set_environment(RID p_camera,RID p_env); + virtual void camera_set_use_vertical_aspect(RID p_camera,bool p_enable); + + + /* + + struct RoomInfo { + + Transform affine_inverse; + Room *room; + List<Instance*> owned_geometry_instances; + List<Instance*> owned_portal_instances; + List<Instance*> owned_room_instances; + List<Instance*> owned_light_instances; //not used, but just for the sake of it + Set<Instance*> disconnected_child_portals; + Set<Instance*> owned_autoroom_geometry; + uint64_t last_visited_pass; + RoomInfo() { last_visited_pass=0; } + + }; + + struct InstancePortal { + + Portal *portal; + Set<Instance*> candidate_set; + Instance *connected; + uint64_t last_visited_pass; + + Plane plane_cache; + Vector<Vector3> transformed_point_cache; + + + PortalInfo() { connected=NULL; last_visited_pass=0;} + }; +*/ + + + + /* SCENARIO API */ + + struct Instance; + + struct Scenario : RID_Data { + + + VS::ScenarioDebugMode debug; + RID self; + // well wtf, balloon allocator is slower? + + Octree<Instance,true> octree; + + List<Instance*> directional_lights; + RID environment; + RID fallback_environment; + RID reflection_probe_shadow_atlas; + RID reflection_atlas; + + + SelfList<Instance>::List instances; + + Scenario() { debug=VS::SCENARIO_DEBUG_DISABLED; } + }; + + mutable RID_Owner<Scenario> scenario_owner; + + static void* _instance_pair(void *p_self, OctreeElementID, Instance *p_A,int, OctreeElementID, Instance *p_B,int); + static void _instance_unpair(void *p_self, OctreeElementID, Instance *p_A,int, OctreeElementID, Instance *p_B,int,void*); + + virtual RID scenario_create(); + + virtual void scenario_set_debug(RID p_scenario,VS::ScenarioDebugMode p_debug_mode); + virtual void scenario_set_environment(RID p_scenario, RID p_environment); + virtual void scenario_set_fallback_environment(RID p_scenario, RID p_environment); + virtual void scenario_set_reflection_atlas_size(RID p_scenario, int p_size,int p_subdiv); + + + /* INSTANCING API */ + + struct InstanceBaseData { + + + virtual ~InstanceBaseData() {} + }; + + + + struct Instance : RasterizerScene::InstanceBase { + + RID self; + //scenario stuff + OctreeElementID octree_id; + Scenario *scenario; + SelfList<Instance> scenario_item; + + //aabb stuff + bool update_aabb; + bool update_materials; + + SelfList<Instance> update_item; + + + Rect3 aabb; + Rect3 transformed_aabb; + float extra_margin; + uint32_t object_ID; + + float lod_begin; + float lod_end; + float lod_begin_hysteresis; + float lod_end_hysteresis; + RID lod_instance; + + Instance *room; + SelfList<Instance> room_item; + bool visible_in_all_rooms; + + uint64_t last_render_pass; + uint64_t last_frame_pass; + + uint64_t version; // changes to this, and changes to base increase version + + InstanceBaseData *base_data; + + virtual void base_removed() { + + singleton->instance_set_base(self,RID()); + } + + virtual void base_changed() { + + singleton->_instance_queue_update(this,true,true); + } + + virtual void base_material_changed() { + + singleton->_instance_queue_update(this,false,true); + } + + + Instance() : scenario_item(this), update_item(this), room_item(this) { + + octree_id=0; + scenario=NULL; + + + update_aabb=false; + update_materials=false; + + extra_margin=0; + + + object_ID=0; + visible=true; + + lod_begin=0; + lod_end=0; + lod_begin_hysteresis=0; + lod_end_hysteresis=0; + + room=NULL; + visible_in_all_rooms=false; + + + + last_render_pass=0; + last_frame_pass=0; + version=1; + base_data=NULL; + + } + + ~Instance() { + + if (base_data) + memdelete(base_data); + + } + }; + + SelfList<Instance>::List _instance_update_list; + void _instance_queue_update(Instance *p_instance,bool p_update_aabb,bool p_update_materials=false); + + + struct InstanceGeometryData : public InstanceBaseData { + + List<Instance*> lighting; + bool lighting_dirty; + bool can_cast_shadows; + + List<Instance*> reflection_probes; + bool reflection_dirty; + + List<Instance*> gi_probes; + bool gi_probes_dirty; + + InstanceGeometryData() { + + lighting_dirty=false; + reflection_dirty=true; + can_cast_shadows=true; + gi_probes_dirty=true; + } + }; + + struct InstanceReflectionProbeData : public InstanceBaseData { + + + Instance *owner; + + struct PairInfo { + List<Instance*>::Element *L; //reflection iterator in geometry + Instance *geometry; + }; + List<PairInfo> geometries; + + + RID instance; + bool reflection_dirty; + SelfList<InstanceReflectionProbeData> update_list; + + int render_step; + + InstanceReflectionProbeData() : update_list(this) { + + reflection_dirty=true; + render_step=-1; + } + }; + + SelfList<InstanceReflectionProbeData>::List reflection_probe_render_list; + + struct InstanceLightData : public InstanceBaseData { + + struct PairInfo { + List<Instance*>::Element *L; //light iterator in geometry + Instance *geometry; + }; + + RID instance; + uint64_t last_version; + List<Instance*>::Element *D; // directional light in scenario + + bool shadow_dirty; + + List<PairInfo> geometries; + + Instance *baked_light; + + InstanceLightData() { + + shadow_dirty=true; + D=NULL; + last_version=0; + baked_light=NULL; + } + }; + + struct InstanceGIProbeData : public InstanceBaseData { + + + Instance *owner; + + struct PairInfo { + List<Instance*>::Element *L; //gi probe iterator in geometry + Instance *geometry; + }; + + List<PairInfo> geometries; + + Set<Instance*> lights; + + struct LightCache { + + VS::LightType type; + Transform transform; + Color color; + float energy; + float radius; + float attenuation; + float spot_angle; + float spot_attenuation; + + bool operator==(const LightCache& p_cache) { + + return (type==p_cache.type && + transform==p_cache.transform && + color==p_cache.color && + energy==p_cache.energy && + radius==p_cache.radius && + attenuation==p_cache.attenuation && + spot_angle==p_cache.spot_angle && + spot_attenuation==p_cache.spot_attenuation); + } + + LightCache() { + + type=VS::LIGHT_DIRECTIONAL; + energy=1.0; + radius=1.0; + attenuation=1.0; + spot_angle=1.0; + spot_attenuation=1.0; + + } + + }; + + struct LocalData { + uint16_t pos[3]; + uint16_t energy[3]; //using 0..1024 for float range 0..1. integer is needed for deterministic add/remove of lights + }; + + struct CompBlockS3TC { + uint32_t offset; //offset in mipmap + uint32_t source_count; //sources + uint32_t sources[16]; //id for each source + uint8_t alpha[8]; //alpha block is pre-computed + }; + + + struct Dynamic { + + Map<RID,LightCache> light_cache; + Map<RID,LightCache> light_cache_changes; + PoolVector<int> light_data; + PoolVector<LocalData> local_data; + Vector<Vector<uint32_t> > level_cell_lists; + RID probe_data; + bool enabled; + int bake_dynamic_range; + RasterizerStorage::GIProbeCompression compression; + + Vector< PoolVector<uint8_t> > mipmaps_3d; + Vector< PoolVector<CompBlockS3TC> > mipmaps_s3tc; //for s3tc + + int updating_stage; + + int grid_size[3]; + + Transform light_to_cell_xform; + + } dynamic; + + + RID probe_instance; + + + bool invalid; + uint32_t base_version; + + SelfList<InstanceGIProbeData> update_element; + + InstanceGIProbeData() : update_element(this) { + invalid=true; + base_version=0; + } + + }; + + + SelfList<InstanceGIProbeData>::List gi_probe_update_list; + + + Instance *instance_cull_result[MAX_INSTANCE_CULL]; + Instance *instance_shadow_cull_result[MAX_INSTANCE_CULL]; //used for generating shadowmaps + Instance *light_cull_result[MAX_LIGHTS_CULLED]; + RID light_instance_cull_result[MAX_LIGHTS_CULLED]; + int light_cull_count; + RID reflection_probe_instance_cull_result[MAX_REFLECTION_PROBES_CULLED]; + int reflection_probe_cull_count; + + + RID_Owner<Instance> instance_owner; + + // from can be mesh, light, area and portal so far. + virtual RID instance_create(); // from can be mesh, light, poly, area and portal so far. + + virtual void instance_set_base(RID p_instance, RID p_base); // from can be mesh, light, poly, area and portal so far. + virtual void instance_set_scenario(RID p_instance, RID p_scenario); // from can be mesh, light, poly, area and portal so far. + virtual void instance_set_layer_mask(RID p_instance, uint32_t p_mask); + virtual void instance_set_transform(RID p_instance, const Transform& p_transform); + virtual void instance_attach_object_instance_ID(RID p_instance,ObjectID p_ID); + virtual void instance_set_morph_target_weight(RID p_instance,int p_shape, float p_weight); + virtual void instance_set_surface_material(RID p_instance,int p_surface, RID p_material); + virtual void instance_set_visible(RID p_instance,bool p_visible); + + + virtual void instance_attach_skeleton(RID p_instance,RID p_skeleton); + virtual void instance_set_exterior( RID p_instance, bool p_enabled ); + virtual void instance_set_room( RID p_instance, RID p_room ); + + virtual void instance_set_extra_visibility_margin( RID p_instance, real_t p_margin ); + + + // don't use these in a game! + virtual Vector<ObjectID> instances_cull_aabb(const Rect3& p_aabb, RID p_scenario=RID()) const; + virtual Vector<ObjectID> instances_cull_ray(const Vector3& p_from, const Vector3& p_to, RID p_scenario=RID()) const; + virtual Vector<ObjectID> instances_cull_convex(const Vector<Plane>& p_convex, RID p_scenario=RID()) const; + + + virtual void instance_geometry_set_flag(RID p_instance,VS::InstanceFlags p_flags,bool p_enabled); + virtual void instance_geometry_set_cast_shadows_setting(RID p_instance, VS::ShadowCastingSetting p_shadow_casting_setting); + virtual void instance_geometry_set_material_override(RID p_instance, RID p_material); + + + virtual void instance_geometry_set_draw_range(RID p_instance,float p_min,float p_max,float p_min_margin,float p_max_margin); + virtual void instance_geometry_set_as_instance_lod(RID p_instance,RID p_as_lod_of_instance); + + + _FORCE_INLINE_ void _update_instance(Instance *p_instance); + _FORCE_INLINE_ void _update_instance_aabb(Instance *p_instance); + _FORCE_INLINE_ void _update_dirty_instance(Instance *p_instance); + + _FORCE_INLINE_ void _light_instance_update_shadow(Instance *p_instance,const Transform p_cam_transform,const CameraMatrix& p_cam_projection,bool p_cam_orthogonal,RID p_shadow_atlas,Scenario* p_scenario); + + void _render_scene(const Transform p_cam_transform, const CameraMatrix& p_cam_projection, bool p_cam_orthogonal, RID p_force_environment, uint32_t p_visible_layers, RID p_scenario, RID p_shadow_atlas, RID p_reflection_probe, int p_reflection_probe_pass); + + void render_camera(RID p_camera, RID p_scenario, Size2 p_viewport_size, RID p_shadow_atlas); + void update_dirty_instances(); + + //probes + struct GIProbeDataHeader { + + uint32_t version; + uint32_t cell_subdiv; + uint32_t width; + uint32_t height; + uint32_t depth; + uint32_t cell_count; + uint32_t leaf_cell_count; + }; + + + struct GIProbeDataCell { + + uint32_t children[8]; + uint32_t albedo; + uint32_t emission; + uint32_t normal; + uint32_t level_alpha; + }; + + enum { + GI_UPDATE_STAGE_CHECK, + GI_UPDATE_STAGE_LIGHTING, + GI_UPDATE_STAGE_UPLOADING, + }; + + void _gi_probe_bake_thread(); + static void _gi_probe_bake_threads(void*); + + volatile bool probe_bake_thread_exit; + Thread *probe_bake_thread; + Semaphore *probe_bake_sem; + Mutex *probe_bake_mutex; + List<Instance*> probe_bake_list; + + bool _render_reflection_probe_step(Instance* p_instance,int p_step); + void _gi_probe_fill_local_data(int p_idx,int p_level,int p_x,int p_y,int p_z,const GIProbeDataCell* p_cell,const GIProbeDataHeader *p_header,InstanceGIProbeData::LocalData *p_local_data,Vector<uint32_t> *prev_cell); + + _FORCE_INLINE_ uint32_t _gi_bake_find_cell(const GIProbeDataCell *cells,int x,int y, int z,int p_cell_subdiv); + void _bake_gi_downscale_light(int p_idx, int p_level, const GIProbeDataCell* p_cells, const GIProbeDataHeader *p_header, InstanceGIProbeData::LocalData *p_local_data); + void _bake_gi_probe_light(const GIProbeDataHeader *header,const GIProbeDataCell *cells,InstanceGIProbeData::LocalData *local_data,const uint32_t *leaves,int p_leaf_count, const InstanceGIProbeData::LightCache& light_cache,int p_sign); + void _bake_gi_probe(Instance *p_probe); + bool _check_gi_probe(Instance *p_gi_probe); + void _setup_gi_probe(Instance *p_instance); + + void render_probes(); + + + bool free(RID p_rid); + + VisualServerScene(); + ~VisualServerScene(); +}; + +#endif // VISUALSERVERSCENE_H diff --git a/servers/visual/visual_server_viewport.cpp b/servers/visual/visual_server_viewport.cpp new file mode 100644 index 0000000000..780335a7f4 --- /dev/null +++ b/servers/visual/visual_server_viewport.cpp @@ -0,0 +1,568 @@ +#include "visual_server_viewport.h" +#include "visual_server_global.h" +#include "visual_server_canvas.h" +#include "visual_server_scene.h" +#include "globals.h" + + + +void VisualServerViewport::_draw_viewport(Viewport *p_viewport) { + + /* Camera should always be BEFORE any other 3D */ +#if 0 + bool scenario_draw_canvas_bg=false; + int scenario_canvas_max_layer=0; + + if (!p_viewport->hide_canvas && !p_viewport->disable_environment && scenario_owner.owns(p_viewport->scenario)) { + + Scenario *scenario=scenario_owner.get(p_viewport->scenario); + if (scenario->environment.is_valid()) { + if (rasterizer->is_environment(scenario->environment)) { + scenario_draw_canvas_bg=rasterizer->environment_get_background(scenario->environment)==VS::ENV_BG_CANVAS; + scenario_canvas_max_layer=rasterizer->environment_get_background_param(scenario->environment,VS::ENV_BG_PARAM_CANVAS_MAX_LAYER); + } + } + } + + bool can_draw_3d=!p_viewport->hide_scenario && camera_owner.owns(p_viewport->camera) && scenario_owner.owns(p_viewport->scenario); + + + if (scenario_draw_canvas_bg) { + + rasterizer->begin_canvas_bg(); + } + + if (!scenario_draw_canvas_bg && can_draw_3d) { + + _draw_viewport_camera(p_viewport,false); + + } else if (true /*|| !p_viewport->canvas_list.empty()*/){ + + //clear the viewport black because of no camera? i seriously should.. + if (p_viewport->render_target_clear_on_new_frame || p_viewport->render_target_clear) { + if (p_viewport->transparent_bg) { + rasterizer->clear_viewport(Color(0,0,0,0)); + } + else { + Color cc=clear_color; + if (scenario_draw_canvas_bg) + cc.a=0; + rasterizer->clear_viewport(cc); + } + p_viewport->render_target_clear=false; + } + } +#endif + + if (p_viewport->clear_mode!=VS::VIEWPORT_CLEAR_NEVER) { + VSG::rasterizer->clear_render_target(clear_color); + if (p_viewport->clear_mode==VS::VIEWPORT_CLEAR_ONLY_NEXT_FRAME) { + p_viewport->clear_mode=VS::VIEWPORT_CLEAR_NEVER; + } + } + + + if (!p_viewport->disable_3d && p_viewport->camera.is_valid()) { + + VSG::scene->render_camera(p_viewport->camera,p_viewport->scenario,p_viewport->size,p_viewport->shadow_atlas); + } + + if (!p_viewport->hide_canvas) { + int i=0; + + Map<Viewport::CanvasKey,Viewport::CanvasData*> canvas_map; + + Rect2 clip_rect(0,0,p_viewport->size.x,p_viewport->size.y); + RasterizerCanvas::Light *lights=NULL; + RasterizerCanvas::Light *lights_with_shadow=NULL; + RasterizerCanvas::Light *lights_with_mask=NULL; + Rect2 shadow_rect; + + int light_count=0; + + for (Map<RID,Viewport::CanvasData>::Element *E=p_viewport->canvas_map.front();E;E=E->next()) { + + Transform2D xf = p_viewport->global_transform * E->get().transform; + + VisualServerCanvas::Canvas *canvas = static_cast<VisualServerCanvas::Canvas*>(E->get().canvas); + + //find lights in canvas + + + for(Set<RasterizerCanvas::Light*>::Element *F=canvas->lights.front();F;F=F->next()) { + + + RasterizerCanvas::Light* cl=F->get(); + if (cl->enabled && cl->texture.is_valid()) { + //not super efficient.. + Size2 tsize(VSG::storage->texture_get_width(cl->texture),VSG::storage->texture_get_height(cl->texture)); + tsize*=cl->scale; + + Vector2 offset=tsize/2.0; + cl->rect_cache=Rect2(-offset+cl->texture_offset,tsize); + cl->xform_cache=xf * cl->xform; + + + if (clip_rect.intersects_transformed(cl->xform_cache,cl->rect_cache)) { + + cl->filter_next_ptr=lights; + lights=cl; + cl->texture_cache=NULL; + Transform2D scale; + scale.scale(cl->rect_cache.size); + scale.elements[2]=cl->rect_cache.pos; + cl->light_shader_xform = (cl->xform_cache * scale).affine_inverse(); + cl->light_shader_pos=cl->xform_cache[2]; + if (cl->shadow_buffer.is_valid()) { + + cl->shadows_next_ptr=lights_with_shadow; + if (lights_with_shadow==NULL) { + shadow_rect = cl->xform_cache.xform(cl->rect_cache); + } else { + shadow_rect=shadow_rect.merge( cl->xform_cache.xform(cl->rect_cache) ); + } + lights_with_shadow=cl; + cl->radius_cache=cl->rect_cache.size.length(); + + } + if (cl->mode==VS::CANVAS_LIGHT_MODE_MASK) { + cl->mask_next_ptr=lights_with_mask; + lights_with_mask=cl; + } + + light_count++; + } + + VSG::canvas_render->light_internal_update(cl->light_internal,cl); + + } + } + + //print_line("lights: "+itos(light_count)); + canvas_map[ Viewport::CanvasKey( E->key(), E->get().layer) ]=&E->get(); + + } + + if (lights_with_shadow) { + //update shadows if any + + RasterizerCanvas::LightOccluderInstance * occluders=NULL; + + //make list of occluders + for (Map<RID,Viewport::CanvasData>::Element *E=p_viewport->canvas_map.front();E;E=E->next()) { + + VisualServerCanvas::Canvas *canvas = static_cast<VisualServerCanvas::Canvas*>(E->get().canvas); + Transform2D xf = p_viewport->global_transform * E->get().transform; + + + for(Set<RasterizerCanvas::LightOccluderInstance*>::Element *F=canvas->occluders.front();F;F=F->next()) { + + if (!F->get()->enabled) + continue; + F->get()->xform_cache = xf * F->get()->xform; + if (shadow_rect.intersects_transformed(F->get()->xform_cache,F->get()->aabb_cache)) { + + F->get()->next=occluders; + occluders=F->get(); + + } + } + } + //update the light shadowmaps with them + RasterizerCanvas::Light *light=lights_with_shadow; + while(light) { + + VSG::canvas_render->canvas_light_shadow_buffer_update(light->shadow_buffer,light->xform_cache.affine_inverse(),light->item_mask,light->radius_cache/1000.0,light->radius_cache*1.1,occluders,&light->shadow_matrix_cache); + light=light->shadows_next_ptr; + } + + // VSG::canvas_render->reset_canvas(); + } + + VSG::rasterizer->restore_render_target(); + + +#if 0 + if (scenario_draw_canvas_bg && canvas_map.front() && canvas_map.front()->key().layer>scenario_canvas_max_layer) { + + _draw_viewport_camera(p_viewport,!can_draw_3d); + scenario_draw_canvas_bg=false; + + } +#endif + + + for (Map<Viewport::CanvasKey,Viewport::CanvasData*>::Element *E=canvas_map.front();E;E=E->next()) { + + VisualServerCanvas::Canvas *canvas = static_cast<VisualServerCanvas::Canvas*>(E->get()->canvas); + + // print_line("canvas "+itos(i)+" size: "+itos(I->get()->canvas->child_items.size())); + //print_line("GT "+p_viewport->global_transform+". CT: "+E->get()->transform); + Transform2D xform = p_viewport->global_transform * E->get()->transform; + + RasterizerCanvas::Light *canvas_lights=NULL; + + RasterizerCanvas::Light *ptr=lights; + while(ptr) { + if (E->get()->layer>=ptr->layer_min && E->get()->layer<=ptr->layer_max) { + ptr->next_ptr=canvas_lights; + canvas_lights=ptr; + } + ptr=ptr->filter_next_ptr; + } + + VSG::canvas->render_canvas( canvas,xform,canvas_lights,lights_with_mask,clip_rect ); + i++; +#if 0 + if (scenario_draw_canvas_bg && E->key().layer>=scenario_canvas_max_layer) { + _draw_viewport_camera(p_viewport,!can_draw_3d); + scenario_draw_canvas_bg=false; + } +#endif + + + } +#if 0 + if (scenario_draw_canvas_bg) { + _draw_viewport_camera(p_viewport,!can_draw_3d); + scenario_draw_canvas_bg=false; + } +#endif + + //VSG::canvas_render->canvas_debug_viewport_shadows(lights_with_shadow); + } + + + +} + +void VisualServerViewport::draw_viewports() { + + //sort viewports + + + //draw viewports + + clear_color=GLOBAL_GET("rendering/viewport/default_clear_color"); + + + active_viewports.sort_custom<ViewportSort>(); + + for(int i=0;i<active_viewports.size();i++) { + + Viewport *vp = active_viewports[i]; + + if (vp->update_mode==VS::VIEWPORT_UPDATE_DISABLED) + continue; + + ERR_CONTINUE( !vp->render_target.is_valid() ); + + bool visible = vp->viewport_to_screen_rect!=Rect2() || vp->update_mode==VS::VIEWPORT_UPDATE_ALWAYS || vp->update_mode==VS::VIEWPORT_UPDATE_ONCE; + + if (!visible) + continue; + + VSG::rasterizer->set_current_render_target(vp->render_target); + _draw_viewport(vp); + + if (vp->viewport_to_screen_rect!=Rect2()) { + //copy to screen if set as such + VSG::rasterizer->set_current_render_target(RID()); + VSG::rasterizer->blit_render_target_to_screen(vp->render_target,vp->viewport_to_screen_rect,vp->viewport_to_screen); + } + + if (vp->update_mode==VS::VIEWPORT_UPDATE_ONCE) { + vp->update_mode=VS::VIEWPORT_UPDATE_DISABLED; + } + } +} + + +RID VisualServerViewport::viewport_create() { + + Viewport * viewport = memnew( Viewport ); + + RID rid = viewport_owner.make_rid(viewport); + + viewport->self=rid; + viewport->hide_scenario=false; + viewport->hide_canvas=false; + viewport->render_target=VSG::storage->render_target_create(); + viewport->shadow_atlas=VSG::scene_render->shadow_atlas_create(); + + return rid; + +} + +void VisualServerViewport::viewport_set_size(RID p_viewport,int p_width,int p_height){ + + ERR_FAIL_COND(p_width<0 && p_height<0); + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + + + viewport->size=Size2(p_width,p_height); + VSG::storage->render_target_set_size(viewport->render_target,p_width,p_height); + + +} + +void VisualServerViewport::viewport_set_active(RID p_viewport,bool p_active) { + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + if (p_active) { + ERR_FAIL_COND(active_viewports.find(viewport)!=-1);//already active + active_viewports.push_back(viewport); + } else { + active_viewports.erase(viewport); + } + + +} + +void VisualServerViewport::viewport_set_parent_viewport(RID p_viewport,RID p_parent_viewport) { + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + viewport->parent=p_parent_viewport; +} + +void VisualServerViewport::viewport_set_clear_mode(RID p_viewport,VS::ViewportClearMode p_clear_mode) { + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + viewport->clear_mode=p_clear_mode; + +} + + +void VisualServerViewport::viewport_attach_to_screen(RID p_viewport,const Rect2& p_rect,int p_screen){ + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + viewport->viewport_to_screen_rect=p_rect; + viewport->viewport_to_screen=p_screen; +} +void VisualServerViewport::viewport_detach(RID p_viewport){ + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + viewport->viewport_to_screen_rect=Rect2(); + viewport->viewport_to_screen=0; + +} + +void VisualServerViewport::viewport_set_update_mode(RID p_viewport,VS::ViewportUpdateMode p_mode){ + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + viewport->update_mode=p_mode; + +} +void VisualServerViewport::viewport_set_vflip(RID p_viewport,bool p_enable){ + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + VSG::storage->render_target_set_flag(viewport->render_target,RasterizerStorage::RENDER_TARGET_VFLIP,p_enable); + +} + +RID VisualServerViewport::viewport_get_texture(RID p_viewport) const{ + + const Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND_V(!viewport,RID()); + + return VSG::storage->render_target_get_texture(viewport->render_target); + +} + +void VisualServerViewport::viewport_set_hide_scenario(RID p_viewport,bool p_hide){ + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + viewport->hide_scenario=p_hide; +} +void VisualServerViewport::viewport_set_hide_canvas(RID p_viewport,bool p_hide){ + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + viewport->hide_canvas=p_hide; +} +void VisualServerViewport::viewport_set_disable_environment(RID p_viewport,bool p_disable){ + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + + viewport->disable_environment=p_disable; +} + +void VisualServerViewport::viewport_set_disable_3d(RID p_viewport,bool p_disable){ + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + + viewport->disable_3d=p_disable; + VSG::storage->render_target_set_flag(viewport->render_target,RasterizerStorage::RENDER_TARGET_NO_3D,p_disable); +} + +void VisualServerViewport::viewport_attach_camera(RID p_viewport,RID p_camera){ + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + viewport->camera=p_camera; +} +void VisualServerViewport::viewport_set_scenario(RID p_viewport,RID p_scenario){ + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + viewport->scenario=p_scenario; +} +void VisualServerViewport::viewport_attach_canvas(RID p_viewport,RID p_canvas){ + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + ERR_FAIL_COND(viewport->canvas_map.has(p_canvas)); + VisualServerCanvas::Canvas *canvas = VSG::canvas->canvas_owner.getornull(p_canvas); + ERR_FAIL_COND(!canvas); + + canvas->viewports.insert(p_viewport); + viewport->canvas_map[p_canvas]=Viewport::CanvasData(); + viewport->canvas_map[p_canvas].layer=0; + viewport->canvas_map[p_canvas].canvas=canvas; + +} + +void VisualServerViewport::viewport_remove_canvas(RID p_viewport,RID p_canvas){ + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + VisualServerCanvas::Canvas *canvas = VSG::canvas->canvas_owner.getornull(p_canvas); + ERR_FAIL_COND(!canvas); + + viewport->canvas_map.erase(p_canvas); + canvas->viewports.erase(p_viewport); + +} +void VisualServerViewport::viewport_set_canvas_transform(RID p_viewport,RID p_canvas,const Transform2D& p_offset){ + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + ERR_FAIL_COND(!viewport->canvas_map.has(p_canvas)); + viewport->canvas_map[p_canvas].transform=p_offset; + +} +void VisualServerViewport::viewport_set_transparent_background(RID p_viewport,bool p_enabled){ + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + VSG::storage->render_target_set_flag(viewport->render_target,RasterizerStorage::RENDER_TARGET_TRANSPARENT,p_enabled); + +} + +void VisualServerViewport::viewport_set_global_canvas_transform(RID p_viewport,const Transform2D& p_transform){ + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + viewport->global_transform=p_transform; + +} +void VisualServerViewport::viewport_set_canvas_layer(RID p_viewport,RID p_canvas,int p_layer){ + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + ERR_FAIL_COND(!viewport->canvas_map.has(p_canvas)); + viewport->canvas_map[p_canvas].layer=p_layer; + +} + +void VisualServerViewport::viewport_set_shadow_atlas_size(RID p_viewport,int p_size) { + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + viewport->shadow_atlas_size=p_size; + + VSG::scene_render->shadow_atlas_set_size( viewport->shadow_atlas, viewport->shadow_atlas_size); + +} + +void VisualServerViewport::viewport_set_shadow_atlas_quadrant_subdivision(RID p_viewport,int p_quadrant,int p_subdiv) { + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + VSG::scene_render->shadow_atlas_set_quadrant_subdivision( viewport->shadow_atlas, p_quadrant, p_subdiv); + +} + +void VisualServerViewport::viewport_set_msaa(RID p_viewport,VS::ViewportMSAA p_msaa) { + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + VSG::storage->render_target_set_msaa(viewport->render_target,p_msaa); +} + +void VisualServerViewport::viewport_set_hdr(RID p_viewport,bool p_enabled) { + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + VSG::storage->render_target_set_flag(viewport->render_target,RasterizerStorage::RENDER_TARGET_HDR,p_enabled); + +} + +bool VisualServerViewport::free(RID p_rid) { + + if (viewport_owner.owns(p_rid)) { + + Viewport * viewport = viewport_owner.getornull(p_rid); + + + VSG::storage->free( viewport->render_target ); + VSG::scene_render->free( viewport->shadow_atlas ); + + while(viewport->canvas_map.front()) { + viewport_remove_canvas(p_rid,viewport->canvas_map.front()->key()); + } + + viewport_set_scenario(p_rid,RID()); + active_viewports.erase(viewport); + + viewport_owner.free(p_rid); + memdelete(viewport); + + + return true; + } + + return false; + +} + +VisualServerViewport::VisualServerViewport() +{ + +} diff --git a/servers/visual/visual_server_viewport.h b/servers/visual/visual_server_viewport.h new file mode 100644 index 0000000000..ff4bc2601d --- /dev/null +++ b/servers/visual/visual_server_viewport.h @@ -0,0 +1,150 @@ +#ifndef VISUALSERVERVIEWPORT_H +#define VISUALSERVERVIEWPORT_H + +#include "servers/visual_server.h" +#include "rasterizer.h" +#include "self_list.h" + +class VisualServerViewport { +public: + + struct CanvasBase : public RID_Data { + + + }; + + + + struct Viewport : public RID_Data { + + RID self; + RID parent; + + Size2i size; + RID camera; + RID scenario; + + VS::ViewportUpdateMode update_mode; + RID render_target; + RID render_target_texture; + + int viewport_to_screen; + Rect2 viewport_to_screen_rect; + + bool hide_scenario; + bool hide_canvas; + bool disable_environment; + bool disable_3d; + + RID shadow_atlas; + int shadow_atlas_size; + + + VS::ViewportClearMode clear_mode; + + bool rendered_in_prev_frame; + + struct CanvasKey { + + int layer; + RID canvas; + bool operator<(const CanvasKey& p_canvas) const { if (layer==p_canvas.layer) return canvas < p_canvas.canvas; return layer<p_canvas.layer; } + CanvasKey() { layer=0; } + CanvasKey(const RID& p_canvas, int p_layer) { canvas=p_canvas; layer=p_layer; } + }; + + struct CanvasData { + + CanvasBase *canvas; + Transform2D transform; + int layer; + }; + + Transform2D global_transform; + + Map<RID,CanvasData> canvas_map; + + Viewport() { + update_mode=VS::VIEWPORT_UPDATE_WHEN_VISIBLE; + clear_mode=VS::VIEWPORT_CLEAR_ALWAYS; + rendered_in_prev_frame=false; + disable_environment=false; + viewport_to_screen=0; + shadow_atlas_size=0; + disable_3d=false; + + } + }; + + mutable RID_Owner<Viewport> viewport_owner; + + + struct ViewportSort { + _FORCE_INLINE_ bool operator()(const Viewport*p_left,const Viewport* p_right) const { + + bool left_to_screen = p_left->viewport_to_screen_rect.size!=Size2(); + bool right_to_screen = p_right->viewport_to_screen_rect.size!=Size2(); + + if (left_to_screen==right_to_screen) { + + return p_left->parent==p_right->self; + } else { + return right_to_screen; + } + } + }; + + + Vector<Viewport*> active_viewports; +private: + Color clear_color; + void _draw_viewport(Viewport *p_viewport); +public: + + + RID viewport_create(); + + void viewport_set_size(RID p_viewport,int p_width,int p_height); + + void viewport_attach_to_screen(RID p_viewport,const Rect2& p_rect=Rect2(),int p_screen=0); + void viewport_detach(RID p_viewport); + + void viewport_set_active(RID p_viewport,bool p_active); + void viewport_set_parent_viewport(RID p_viewport,RID p_parent_viewport); + void viewport_set_update_mode(RID p_viewport,VS::ViewportUpdateMode p_mode); + void viewport_set_vflip(RID p_viewport,bool p_enable); + + + void viewport_set_clear_mode(RID p_viewport,VS::ViewportClearMode p_clear_mode); + + RID viewport_get_texture(RID p_viewport) const; + + void viewport_set_hide_scenario(RID p_viewport,bool p_hide); + void viewport_set_hide_canvas(RID p_viewport,bool p_hide); + void viewport_set_disable_environment(RID p_viewport,bool p_disable); + void viewport_set_disable_3d(RID p_viewport,bool p_disable); + + void viewport_attach_camera(RID p_viewport,RID p_camera); + void viewport_set_scenario(RID p_viewport,RID p_scenario); + void viewport_attach_canvas(RID p_viewport,RID p_canvas); + void viewport_remove_canvas(RID p_viewport,RID p_canvas); + void viewport_set_canvas_transform(RID p_viewport,RID p_canvas,const Transform2D& p_offset); + void viewport_set_transparent_background(RID p_viewport,bool p_enabled); + + void viewport_set_global_canvas_transform(RID p_viewport,const Transform2D& p_transform); + void viewport_set_canvas_layer(RID p_viewport,RID p_canvas,int p_layer); + + void viewport_set_shadow_atlas_size(RID p_viewport,int p_size); + void viewport_set_shadow_atlas_quadrant_subdivision(RID p_viewport,int p_quadrant,int p_subdiv); + + void viewport_set_msaa(RID p_viewport,VS::ViewportMSAA p_msaa); + void viewport_set_hdr(RID p_viewport,bool p_enabled); + + void draw_viewports(); + + bool free(RID p_rid); + + VisualServerViewport(); +}; + +#endif // VISUALSERVERVIEWPORT_H diff --git a/servers/visual/visual_server_wrap_mt.cpp b/servers/visual/visual_server_wrap_mt.cpp deleted file mode 100644 index 5ea4145342..0000000000 --- a/servers/visual/visual_server_wrap_mt.cpp +++ /dev/null @@ -1,212 +0,0 @@ -/*************************************************************************/ -/* visual_server_wrap_mt.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "visual_server_wrap_mt.h" -#include "os/os.h" -#include "globals.h" -void VisualServerWrapMT::thread_exit() { - - exit=true; -} - -void VisualServerWrapMT::thread_draw() { - - - draw_mutex->lock(); - - draw_pending--; - bool draw=(draw_pending==0);// only draw when no more flushes are pending - - draw_mutex->unlock(); - - if (draw) { - - visual_server->draw(); - } - -} - -void VisualServerWrapMT::thread_flush() { - - - draw_mutex->lock(); - - draw_pending--; - - draw_mutex->unlock(); - -} - - - -void VisualServerWrapMT::_thread_callback(void *_instance) { - - VisualServerWrapMT *vsmt = reinterpret_cast<VisualServerWrapMT*>(_instance); - - - vsmt->thread_loop(); -} - -void VisualServerWrapMT::thread_loop() { - - server_thread=Thread::get_caller_ID(); - - OS::get_singleton()->make_rendering_thread(); - - visual_server->init(); - - exit=false; - draw_thread_up=true; - while(!exit) { - // flush commands one by one, until exit is requested - command_queue.wait_and_flush_one(); - } - - command_queue.flush_all(); // flush all - - visual_server->finish(); - -} - - -/* EVENT QUEUING */ - -void VisualServerWrapMT::sync() { - - if (create_thread) { - - /* TODO: sync with the thread */ - - /* - ERR_FAIL_COND(!draw_mutex); - draw_mutex->lock(); - draw_pending++; //cambiar por un saferefcount - draw_mutex->unlock(); - */ - //command_queue.push( this, &VisualServerWrapMT::thread_flush); - } else { - - command_queue.flush_all(); //flush all pending from other threads - } - -} - -void VisualServerWrapMT::draw() { - - - if (create_thread) { - - /* TODO: Make it draw - ERR_FAIL_COND(!draw_mutex); - draw_mutex->lock(); - draw_pending++; //cambiar por un saferefcount - draw_mutex->unlock(); - - command_queue.push( this, &VisualServerWrapMT::thread_draw); - */ - } else { - - visual_server->draw(); - } -} - - -void VisualServerWrapMT::init() { - - if (create_thread) { - - draw_mutex = Mutex::create(); - print_line("CREATING RENDER THREAD"); - OS::get_singleton()->release_rendering_thread(); - if (create_thread) { - thread = Thread::create( _thread_callback, this ); - print_line("STARTING RENDER THREAD"); - } - while(!draw_thread_up) { - OS::get_singleton()->delay_usec(1000); - } - print_line("DONE RENDER THREAD"); - } else { - - visual_server->init(); - } - -} - -void VisualServerWrapMT::finish() { - - - if (thread) { - - command_queue.push( this, &VisualServerWrapMT::thread_exit); - Thread::wait_to_finish( thread ); - memdelete(thread); - - - texture_free_cached_ids(); - mesh_free_cached_ids(); - - thread=NULL; - } else { - visual_server->finish(); - } - - if (draw_mutex) - memdelete(draw_mutex); - -} - - -VisualServerWrapMT::VisualServerWrapMT(VisualServer* p_contained,bool p_create_thread) : command_queue(p_create_thread) { - - visual_server=p_contained; - create_thread=p_create_thread; - thread=NULL; - draw_mutex=NULL; - draw_pending=0; - draw_thread_up=false; - alloc_mutex=Mutex::create(); - texture_pool_max_size=GLOBAL_DEF("render/thread_textures_prealloc",5); - mesh_pool_max_size=GLOBAL_DEF("core/rid_pool_prealloc",20); - if (!p_create_thread) { - server_thread=Thread::get_caller_ID(); - } else { - server_thread=0; - } -} - - -VisualServerWrapMT::~VisualServerWrapMT() { - - memdelete(visual_server); - memdelete(alloc_mutex); - //finish(); - -} - - diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h deleted file mode 100644 index f0fe80d100..0000000000 --- a/servers/visual/visual_server_wrap_mt.h +++ /dev/null @@ -1,740 +0,0 @@ -/*************************************************************************/ -/* visual_server_wrap_mt.h */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#ifndef VISUAL_SERVER_WRAP_MT_H -#define VISUAL_SERVER_WRAP_MT_H - - -#include "servers/visual_server.h" -#include "command_queue_mt.h" -#include "os/thread.h" - -/** - @author Juan Linietsky <reduzio@gmail.com> -*/ -class VisualServerWrapMT : public VisualServer { - - // the real visual server - mutable VisualServer *visual_server; - - mutable CommandQueueMT command_queue; - - static void _thread_callback(void *_instance); - void thread_loop(); - - Thread::ID server_thread; - volatile bool exit; - Thread *thread; - volatile bool draw_thread_up; - bool create_thread; - - Mutex *draw_mutex; - int draw_pending; - void thread_draw(); - void thread_flush(); - - void thread_exit(); - - Mutex*alloc_mutex; - - - int texture_pool_max_size; - List<RID> texture_id_pool; - - int mesh_pool_max_size; - List<RID> mesh_id_pool; - -//#define DEBUG_SYNC - -#ifdef DEBUG_SYNC -#define SYNC_DEBUG print_line("sync on: "+String(__FUNCTION__)); -#else -#define SYNC_DEBUG -#endif - -public: - -#define ServerName VisualServer -#define ServerNameWrapMT VisualServerWrapMT -#define server_name visual_server -#include "servers/server_wrap_mt_common.h" - - //FUNC0R(RID,texture_create); - FUNCRID(texture); - FUNC5(texture_allocate,RID,int,int,Image::Format,uint32_t); - FUNC3(texture_set_data,RID,const Image&,CubeMapSide); - FUNC2RC(Image,texture_get_data,RID,CubeMapSide); - FUNC2(texture_set_flags,RID,uint32_t); - FUNC1RC(Image::Format,texture_get_format,RID); - FUNC1RC(uint32_t,texture_get_flags,RID); - FUNC1RC(uint32_t,texture_get_width,RID); - FUNC1RC(uint32_t,texture_get_height,RID); - FUNC3(texture_set_size_override,RID,int,int); - FUNC1RC(bool,texture_can_stream,RID); - FUNC3C(texture_set_reload_hook,RID,ObjectID,const StringName&); - - FUNC2(texture_set_path,RID,const String&); - FUNC1RC(String,texture_get_path,RID); - - FUNC1(texture_set_shrink_all_x2_on_set_data,bool); - - virtual void texture_debug_usage(List<TextureInfo> *r_info) { - //pass directly, should lock the server anyway - visual_server->texture_debug_usage(r_info); - } - - - /* SHADER API */ - - FUNC1R(RID,shader_create,ShaderMode); - FUNC2(shader_set_mode,RID,ShaderMode); - FUNC1RC(ShaderMode,shader_get_mode,RID); - FUNC7(shader_set_code,RID,const String&,const String&,const String&,int,int,int); - FUNC1RC(String,shader_get_vertex_code,RID); - FUNC1RC(String,shader_get_fragment_code,RID); - FUNC1RC(String,shader_get_light_code,RID); - FUNC2SC(shader_get_param_list,RID,List<PropertyInfo>*); - - FUNC3(shader_set_default_texture_param,RID,const StringName&,RID); - FUNC2RC(RID,shader_get_default_texture_param,RID,const StringName&); - - - /*virtual void shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list) { - if (Thread::get_caller_ID()!=server_thread) { - command_queue.push_and_sync( visual_server, &VisualServer::shader_get_param_list,p_shader,p_param_list); - } else { - visual_server->m_type(p1, p2, p3, p4, p5); - } - }*/ - -// virtual void shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list); - - - /* COMMON MATERIAL API */ - - FUNC0R(RID,material_create); - FUNC2(material_set_shader,RID,RID); - FUNC1RC(RID,material_get_shader,RID); - - FUNC3(material_set_param,RID,const StringName&,const Variant&); - FUNC2RC(Variant,material_get_param,RID,const StringName&); - - FUNC3(material_set_flag,RID,MaterialFlag,bool); - FUNC2RC(bool,material_get_flag,RID,MaterialFlag); - - FUNC2(material_set_depth_draw_mode,RID,MaterialDepthDrawMode); - FUNC1RC(MaterialDepthDrawMode,material_get_depth_draw_mode,RID); - - FUNC2(material_set_blend_mode,RID,MaterialBlendMode); - FUNC1RC(MaterialBlendMode,material_get_blend_mode,RID); - - FUNC2(material_set_line_width,RID,float); - FUNC1RC(float,material_get_line_width,RID); - - /* FIXED MATERIAL */ - - - FUNC0R(RID,fixed_material_create); - - FUNC3(fixed_material_set_flag,RID, FixedMaterialFlags , bool ); - FUNC2RC(bool, fixed_material_get_flag,RID, FixedMaterialFlags); - - FUNC3(fixed_material_set_param,RID, FixedMaterialParam, const Variant& ); - FUNC2RC(Variant, fixed_material_get_param,RID ,FixedMaterialParam); - - FUNC3(fixed_material_set_texture,RID ,FixedMaterialParam, RID ); - FUNC2RC(RID, fixed_material_get_texture,RID,FixedMaterialParam); - - - - FUNC3(fixed_material_set_texcoord_mode,RID,FixedMaterialParam, FixedMaterialTexCoordMode ); - FUNC2RC(FixedMaterialTexCoordMode, fixed_material_get_texcoord_mode,RID,FixedMaterialParam); - - FUNC2(fixed_material_set_light_shader,RID,FixedMaterialLightShader); - FUNC1RC(FixedMaterialLightShader, fixed_material_get_light_shader,RID); - - FUNC2(fixed_material_set_uv_transform,RID,const Transform&); - FUNC1RC(Transform, fixed_material_get_uv_transform,RID); - - FUNC2(fixed_material_set_point_size,RID ,float); - FUNC1RC(float,fixed_material_get_point_size,RID); - - /* SURFACE API */ - FUNCRID(mesh); - - FUNC2(mesh_set_morph_target_count,RID,int); - FUNC1RC(int,mesh_get_morph_target_count,RID); - - - FUNC2(mesh_set_morph_target_mode,RID,MorphTargetMode); - FUNC1RC(MorphTargetMode,mesh_get_morph_target_mode,RID); - - FUNC2(mesh_add_custom_surface,RID,const Variant&); //this is used by each platform in a different way - - FUNC5(mesh_add_surface,RID,PrimitiveType,const Array&,const Array&,bool); - FUNC2RC(Array,mesh_get_surface_arrays,RID,int); - FUNC2RC(Array,mesh_get_surface_morph_arrays,RID,int); - - FUNC4(mesh_surface_set_material,RID, int, RID,bool); - FUNC2RC(RID,mesh_surface_get_material,RID, int); - - FUNC2RC(int,mesh_surface_get_array_len,RID, int); - FUNC2RC(int,mesh_surface_get_array_index_len,RID, int); - FUNC2RC(uint32_t,mesh_surface_get_format,RID, int); - FUNC2RC(PrimitiveType,mesh_surface_get_primitive_type,RID, int); - - FUNC2(mesh_remove_surface,RID,int); - FUNC1RC(int,mesh_get_surface_count,RID); - FUNC1(mesh_clear,RID); - - - FUNC2(mesh_set_custom_aabb,RID,const AABB&); - FUNC1RC(AABB,mesh_get_custom_aabb,RID); - - - /* MULTIMESH API */ - - FUNC0R(RID,multimesh_create); - FUNC2(multimesh_set_instance_count,RID,int); - FUNC1RC(int,multimesh_get_instance_count,RID); - - FUNC2(multimesh_set_mesh,RID,RID); - FUNC2(multimesh_set_aabb,RID,const AABB&); - FUNC3(multimesh_instance_set_transform,RID,int,const Transform&); - FUNC3(multimesh_instance_set_color,RID,int,const Color&); - - FUNC1RC(RID,multimesh_get_mesh,RID); - FUNC2RC(AABB,multimesh_get_aabb,RID,const AABB&); - FUNC2RC(Transform,multimesh_instance_get_transform,RID,int); - FUNC2RC(Color,multimesh_instance_get_color,RID,int); - - FUNC2(multimesh_set_visible_instances,RID,int); - FUNC1RC(int,multimesh_get_visible_instances,RID); - - /* IMMEDIATE API */ - - - FUNC0R(RID,immediate_create); - FUNC3(immediate_begin,RID,PrimitiveType,RID); - FUNC2(immediate_vertex,RID,const Vector3&); - FUNC2(immediate_normal,RID,const Vector3&); - FUNC2(immediate_tangent,RID,const Plane&); - FUNC2(immediate_color,RID,const Color&); - FUNC2(immediate_uv,RID,const Vector2&); - FUNC2(immediate_uv2,RID,const Vector2&); - FUNC1(immediate_end,RID); - FUNC1(immediate_clear,RID); - FUNC2(immediate_set_material,RID,RID); - FUNC1RC(RID,immediate_get_material,RID); - - - /* PARTICLES API */ - - FUNC0R(RID,particles_create); - - FUNC2(particles_set_amount,RID, int ); - FUNC1RC(int,particles_get_amount,RID); - - FUNC2(particles_set_emitting,RID, bool ); - FUNC1RC(bool,particles_is_emitting,RID); - - FUNC2(particles_set_visibility_aabb,RID, const AABB&); - FUNC1RC(AABB,particles_get_visibility_aabb,RID); - - FUNC2(particles_set_emission_half_extents,RID, const Vector3&); - FUNC1RC(Vector3,particles_get_emission_half_extents,RID); - - FUNC2(particles_set_emission_base_velocity,RID, const Vector3&); - FUNC1RC(Vector3,particles_get_emission_base_velocity,RID); - - FUNC2(particles_set_emission_points,RID, const DVector<Vector3>& ); - FUNC1RC(DVector<Vector3>,particles_get_emission_points,RID); - - FUNC2(particles_set_gravity_normal,RID, const Vector3& ); - FUNC1RC(Vector3,particles_get_gravity_normal,RID); - - FUNC3(particles_set_variable,RID, ParticleVariable ,float); - FUNC2RC(float,particles_get_variable,RID, ParticleVariable ); - - FUNC3(particles_set_randomness,RID, ParticleVariable ,float); - FUNC2RC(float,particles_get_randomness,RID, ParticleVariable ); - - FUNC3(particles_set_color_phase_pos,RID, int , float); - FUNC2RC(float,particles_get_color_phase_pos,RID, int ); - - FUNC2(particles_set_color_phases,RID, int ); - FUNC1RC(int,particles_get_color_phases,RID); - - FUNC3(particles_set_color_phase_color,RID, int , const Color& ); - FUNC2RC(Color,particles_get_color_phase_color,RID, int ); - - FUNC2(particles_set_attractors,RID, int); - FUNC1RC(int,particles_get_attractors,RID); - - FUNC3(particles_set_attractor_pos,RID, int, const Vector3&); - FUNC2RC(Vector3,particles_get_attractor_pos,RID,int); - - FUNC3(particles_set_attractor_strength,RID, int, float); - FUNC2RC(float,particles_get_attractor_strength,RID,int); - - FUNC3(particles_set_material,RID, RID,bool); - FUNC1RC(RID,particles_get_material,RID); - - FUNC2(particles_set_height_from_velocity,RID, bool); - FUNC1RC(bool,particles_has_height_from_velocity,RID); - - FUNC2(particles_set_use_local_coordinates,RID, bool); - FUNC1RC(bool,particles_is_using_local_coordinates,RID); - - - /* Light API */ - - FUNC1R(RID,light_create,LightType); - FUNC1RC(LightType,light_get_type,RID); - - FUNC3(light_set_color,RID,LightColor , const Color& ); - FUNC2RC(Color,light_get_color,RID,LightColor ); - - - FUNC2(light_set_shadow,RID,bool ); - FUNC1RC(bool,light_has_shadow,RID); - - FUNC2(light_set_volumetric,RID,bool ); - FUNC1RC(bool,light_is_volumetric,RID); - - FUNC2(light_set_projector,RID,RID ); - FUNC1RC(RID,light_get_projector,RID); - - FUNC3(light_set_param,RID, LightParam , float ); - FUNC2RC(float,light_get_param,RID, LightParam ); - - FUNC2(light_set_operator,RID,LightOp); - FUNC1RC(LightOp,light_get_operator,RID); - - FUNC2(light_omni_set_shadow_mode,RID,LightOmniShadowMode); - FUNC1RC(LightOmniShadowMode,light_omni_get_shadow_mode,RID); - - FUNC2(light_directional_set_shadow_mode,RID,LightDirectionalShadowMode); - FUNC1RC(LightDirectionalShadowMode,light_directional_get_shadow_mode,RID); - FUNC3(light_directional_set_shadow_param,RID,LightDirectionalShadowParam, float ); - FUNC2RC(float,light_directional_get_shadow_param,RID,LightDirectionalShadowParam ); - - - /* SKELETON API */ - - FUNC0R(RID,skeleton_create); - FUNC2(skeleton_resize,RID,int ); - FUNC1RC(int,skeleton_get_bone_count,RID) ; - FUNC3(skeleton_bone_set_transform,RID,int, const Transform&); - FUNC2R(Transform,skeleton_bone_get_transform,RID,int ); - - /* ROOM API */ - - FUNC0R(RID,room_create); - FUNC2(room_set_bounds,RID, const BSP_Tree&); - FUNC1RC(BSP_Tree,room_get_bounds,RID); - - /* PORTAL API */ - - FUNC0R(RID,portal_create); - FUNC2(portal_set_shape,RID,const Vector<Point2>&); - FUNC1RC(Vector<Point2>,portal_get_shape,RID); - FUNC2(portal_set_enabled,RID, bool); - FUNC1RC(bool,portal_is_enabled,RID); - FUNC2(portal_set_disable_distance,RID, float); - FUNC1RC(float,portal_get_disable_distance,RID); - FUNC2(portal_set_disabled_color,RID, const Color&); - FUNC1RC(Color,portal_get_disabled_color,RID); - FUNC2(portal_set_connect_range,RID, float); - FUNC1RC(float,portal_get_connect_range,RID); - - - FUNC0R(RID,baked_light_create); - FUNC2(baked_light_set_mode,RID,BakedLightMode); - FUNC1RC(BakedLightMode,baked_light_get_mode,RID); - - FUNC2(baked_light_set_octree,RID,DVector<uint8_t>); - FUNC1RC(DVector<uint8_t>,baked_light_get_octree,RID); - - FUNC2(baked_light_set_light,RID,DVector<uint8_t>); - FUNC1RC(DVector<uint8_t>,baked_light_get_light,RID); - - FUNC2(baked_light_set_sampler_octree,RID,const DVector<int>&); - FUNC1RC(DVector<int>,baked_light_get_sampler_octree,RID); - - FUNC2(baked_light_set_lightmap_multiplier,RID,float); - FUNC1RC(float,baked_light_get_lightmap_multiplier,RID); - - FUNC3(baked_light_add_lightmap,RID,RID,int); - FUNC1(baked_light_clear_lightmaps,RID); - - FUNC2(baked_light_set_realtime_color_enabled, RID, const bool); - FUNC1RC(bool, baked_light_get_realtime_color_enabled, RID); - - FUNC2(baked_light_set_realtime_color, RID, const Color&); - FUNC1RC(Color, baked_light_get_realtime_color, RID); - - FUNC2(baked_light_set_realtime_energy, RID, const float); - FUNC1RC(float, baked_light_get_realtime_energy, RID); - - FUNC0R(RID,baked_light_sampler_create); - - FUNC3(baked_light_sampler_set_param,RID, BakedLightSamplerParam , float ); - FUNC2RC(float,baked_light_sampler_get_param,RID, BakedLightSamplerParam ); - - FUNC2(baked_light_sampler_set_resolution,RID,int); - FUNC1RC(int,baked_light_sampler_get_resolution,RID); - - /* CAMERA API */ - - FUNC0R(RID,camera_create); - FUNC4(camera_set_perspective,RID,float , float , float ); - FUNC4(camera_set_orthogonal,RID,float, float , float ); - FUNC2(camera_set_transform,RID,const Transform& ); - - FUNC2(camera_set_visible_layers,RID,uint32_t); - FUNC1RC(uint32_t,camera_get_visible_layers,RID); - - FUNC2(camera_set_environment,RID,RID); - FUNC1RC(RID,camera_get_environment,RID); - - - FUNC2(camera_set_use_vertical_aspect,RID,bool); - FUNC2RC(bool,camera_is_using_vertical_aspect,RID,bool); - - - /* VIEWPORT API */ - - FUNC0R(RID,viewport_create); - - FUNC2(viewport_attach_to_screen,RID,int ); - FUNC1(viewport_detach,RID); - - FUNC2(viewport_set_as_render_target,RID,bool); - FUNC2(viewport_set_render_target_update_mode,RID,RenderTargetUpdateMode); - FUNC1RC(RenderTargetUpdateMode,viewport_get_render_target_update_mode,RID); - FUNC1RC(RID,viewport_get_render_target_texture,RID); - - FUNC2(viewport_set_render_target_vflip,RID,bool); - FUNC1RC(bool,viewport_get_render_target_vflip,RID); - FUNC2(viewport_set_render_target_to_screen_rect,RID,const Rect2&); - - FUNC2(viewport_set_render_target_clear_on_new_frame,RID,bool); - FUNC1RC(bool,viewport_get_render_target_clear_on_new_frame,RID); - FUNC1(viewport_render_target_clear,RID); - - FUNC1(viewport_queue_screen_capture,RID); - FUNC1RC(Image,viewport_get_screen_capture,RID); - - FUNC2(viewport_set_rect,RID,const ViewportRect&); - FUNC1RC(ViewportRect,viewport_get_rect,RID); - - FUNC2(viewport_set_hide_scenario,RID,bool ); - FUNC2(viewport_set_hide_canvas,RID,bool ); - FUNC2(viewport_attach_camera,RID,RID ); - FUNC2(viewport_set_scenario,RID,RID ); - FUNC2(viewport_set_disable_environment,RID,bool ); - - FUNC1RC(RID,viewport_get_attached_camera,RID); - FUNC1RC(RID,viewport_get_scenario,RID ); - FUNC2(viewport_attach_canvas,RID,RID); - FUNC2(viewport_remove_canvas,RID,RID); - FUNC3(viewport_set_canvas_transform,RID,RID,const Matrix32&); - FUNC2RC(Matrix32,viewport_get_canvas_transform,RID,RID); - FUNC2(viewport_set_global_canvas_transform,RID,const Matrix32&); - FUNC1RC(Matrix32,viewport_get_global_canvas_transform,RID); - FUNC3(viewport_set_canvas_layer,RID,RID ,int); - FUNC2(viewport_set_transparent_background,RID,bool); - FUNC1RC(bool,viewport_has_transparent_background,RID); - - - /* ENVIRONMENT API */ - - FUNC0R(RID,environment_create); - - FUNC2(environment_set_background,RID,EnvironmentBG); - FUNC1RC(EnvironmentBG,environment_get_background,RID); - - FUNC3(environment_set_background_param,RID,EnvironmentBGParam, const Variant&); - FUNC2RC(Variant,environment_get_background_param,RID,EnvironmentBGParam ); - - FUNC3(environment_set_enable_fx,RID,EnvironmentFx,bool); - FUNC2RC(bool,environment_is_fx_enabled,RID,EnvironmentFx); - - - FUNC3(environment_fx_set_param,RID,EnvironmentFxParam,const Variant&); - FUNC2RC(Variant,environment_fx_get_param,RID,EnvironmentFxParam); - - - /* SCENARIO API */ - - FUNC0R(RID,scenario_create); - - FUNC2(scenario_set_debug,RID,ScenarioDebugMode); - FUNC2(scenario_set_environment,RID, RID); - FUNC2RC(RID,scenario_get_environment,RID, RID); - FUNC2(scenario_set_fallback_environment,RID, RID); - - - /* INSTANCING API */ - - FUNC0R(RID,instance_create); - - FUNC2(instance_set_base,RID, RID); - FUNC1RC(RID,instance_get_base,RID); - - FUNC2(instance_set_scenario,RID, RID); - FUNC1RC(RID,instance_get_scenario,RID); - - FUNC2(instance_set_layer_mask,RID, uint32_t); - FUNC1RC(uint32_t,instance_get_layer_mask,RID); - - FUNC1RC(AABB,instance_get_base_aabb,RID); - - FUNC2(instance_attach_object_instance_ID,RID,uint32_t); - FUNC1RC(uint32_t,instance_get_object_instance_ID,RID); - - FUNC2(instance_attach_skeleton,RID,RID); - FUNC1RC(RID,instance_get_skeleton,RID); - - FUNC3(instance_set_morph_target_weight,RID,int, float); - FUNC2RC(float,instance_get_morph_target_weight,RID,int); - - FUNC3(instance_set_surface_material,RID,int, RID); - - FUNC2(instance_set_transform,RID, const Transform&); - FUNC1RC(Transform,instance_get_transform,RID); - - FUNC2(instance_set_exterior,RID, bool ); - FUNC1RC(bool,instance_is_exterior,RID); - - FUNC2(instance_set_room,RID, RID ); - FUNC1RC(RID,instance_get_room,RID ) ; - - FUNC2(instance_set_extra_visibility_margin,RID, real_t ); - FUNC1RC(real_t,instance_get_extra_visibility_margin,RID ); - - FUNC2RC(Vector<RID>,instances_cull_aabb,const AABB& , RID ); - FUNC3RC(Vector<RID>,instances_cull_ray,const Vector3& ,const Vector3&, RID ); - FUNC2RC(Vector<RID>,instances_cull_convex,const Vector<Plane>& , RID ); - - FUNC3(instance_geometry_set_flag,RID,InstanceFlags ,bool ); - FUNC2RC(bool,instance_geometry_get_flag,RID,InstanceFlags ); - - FUNC2(instance_geometry_set_cast_shadows_setting, RID, ShadowCastingSetting); - FUNC1RC(ShadowCastingSetting, instance_geometry_get_cast_shadows_setting, RID); - - FUNC2(instance_geometry_set_material_override,RID, RID ); - FUNC1RC(RID,instance_geometry_get_material_override,RID); - - FUNC3(instance_geometry_set_draw_range,RID,float ,float); - FUNC1RC(float,instance_geometry_get_draw_range_max,RID); - FUNC1RC(float,instance_geometry_get_draw_range_min,RID); - - FUNC2(instance_geometry_set_baked_light,RID, RID ); - FUNC1RC(RID,instance_geometry_get_baked_light,RID); - - FUNC2(instance_geometry_set_baked_light_sampler,RID, RID ); - FUNC1RC(RID,instance_geometry_get_baked_light_sampler,RID); - - FUNC2(instance_geometry_set_baked_light_texture_index,RID, int); - FUNC1RC(int,instance_geometry_get_baked_light_texture_index,RID); - - FUNC2(instance_light_set_enabled,RID,bool); - FUNC1RC(bool,instance_light_is_enabled,RID); - - /* CANVAS (2D) */ - - FUNC0R(RID,canvas_create); - FUNC3(canvas_set_item_mirroring,RID,RID,const Point2&); - FUNC2RC(Point2,canvas_get_item_mirroring,RID,RID); - FUNC2(canvas_set_modulate,RID,const Color&); - - - FUNC0R(RID,canvas_item_create); - - FUNC2(canvas_item_set_parent,RID,RID ); - FUNC1RC(RID,canvas_item_get_parent,RID); - - FUNC2(canvas_item_set_visible,RID,bool ); - FUNC1RC(bool,canvas_item_is_visible,RID); - - FUNC2(canvas_item_set_blend_mode,RID,MaterialBlendMode ); - FUNC2(canvas_item_set_light_mask,RID,int ); - - //FUNC(canvas_item_set_rect,RID, const Rect2& p_rect); - FUNC2(canvas_item_set_transform,RID, const Matrix32& ); - FUNC2(canvas_item_set_clip,RID, bool ); - FUNC2(canvas_item_set_distance_field_mode,RID, bool ); - FUNC3(canvas_item_set_custom_rect,RID, bool ,const Rect2&); - FUNC2(canvas_item_set_opacity,RID, float ); - FUNC2RC(float,canvas_item_get_opacity,RID, float ); - FUNC2(canvas_item_set_on_top,RID, bool ); - FUNC1RC(bool,canvas_item_is_on_top,RID); - - FUNC2(canvas_item_set_self_opacity,RID, float ); - FUNC2RC(float,canvas_item_get_self_opacity,RID, float ); - - FUNC2(canvas_item_attach_viewport,RID, RID ); - - FUNC6(canvas_item_add_line,RID, const Point2& , const Point2& ,const Color& ,float,bool); - FUNC3(canvas_item_add_rect,RID, const Rect2& , const Color& ); - FUNC4(canvas_item_add_circle,RID, const Point2& , float ,const Color& ); - FUNC6(canvas_item_add_texture_rect,RID, const Rect2& , RID ,bool ,const Color&,bool ); - FUNC6(canvas_item_add_texture_rect_region,RID, const Rect2& , RID ,const Rect2& ,const Color&,bool ); - FUNC8(canvas_item_add_style_box,RID, const Rect2& , const Rect2&, RID ,const Vector2& ,const Vector2&, bool ,const Color& ); - FUNC6(canvas_item_add_primitive,RID, const Vector<Point2>& , const Vector<Color>& ,const Vector<Point2>& , RID ,float ); - FUNC5(canvas_item_add_polygon,RID, const Vector<Point2>& , const Vector<Color>& ,const Vector<Point2>& , RID ); - FUNC7(canvas_item_add_triangle_array,RID, const Vector<int>& , const Vector<Point2>& , const Vector<Color>& ,const Vector<Point2>& , RID , int ); - FUNC7(canvas_item_add_triangle_array_ptr,RID, int , const int* , const Point2* , const Color* ,const Point2* , RID ); - - - FUNC2(canvas_item_add_set_transform,RID,const Matrix32& ); - FUNC2(canvas_item_add_set_blend_mode,RID, MaterialBlendMode ); - FUNC2(canvas_item_add_clip_ignore,RID, bool ); - - FUNC2(canvas_item_set_sort_children_by_y,RID,bool); - FUNC2(canvas_item_set_z,RID,int); - FUNC2(canvas_item_set_z_as_relative_to_parent,RID,bool); - FUNC3(canvas_item_set_copy_to_backbuffer,RID,bool,const Rect2&); - - - FUNC2(canvas_item_set_material,RID, RID ); - - FUNC2(canvas_item_set_use_parent_material,RID, bool ); - - FUNC1(canvas_item_clear,RID); - FUNC1(canvas_item_raise,RID); - - /* CANVAS LIGHT */ - FUNC0R(RID,canvas_light_create); - FUNC2(canvas_light_attach_to_canvas,RID,RID); - FUNC2(canvas_light_set_enabled,RID,bool); - FUNC2(canvas_light_set_transform,RID,const Matrix32&); - FUNC2(canvas_light_set_scale,RID,float); - FUNC2(canvas_light_set_texture,RID,RID); - FUNC2(canvas_light_set_texture_offset,RID,const Vector2&); - FUNC2(canvas_light_set_color,RID,const Color&); - FUNC2(canvas_light_set_height,RID,float); - FUNC2(canvas_light_set_energy,RID,float); - FUNC3(canvas_light_set_layer_range,RID,int,int); - FUNC3(canvas_light_set_z_range,RID,int,int); - FUNC2(canvas_light_set_item_mask,RID,int); - FUNC2(canvas_light_set_item_shadow_mask,RID,int); - - FUNC2(canvas_light_set_mode,RID,CanvasLightMode); - FUNC2(canvas_light_set_shadow_enabled,RID,bool); - FUNC2(canvas_light_set_shadow_buffer_size,RID,int); - FUNC2(canvas_light_set_shadow_esm_multiplier,RID,float); - FUNC2(canvas_light_set_shadow_color,RID,const Color&); - - - - /* CANVAS OCCLUDER */ - - FUNC0R(RID,canvas_light_occluder_create); - FUNC2(canvas_light_occluder_attach_to_canvas,RID,RID); - FUNC2(canvas_light_occluder_set_enabled,RID,bool); - FUNC2(canvas_light_occluder_set_polygon,RID,RID); - FUNC2(canvas_light_occluder_set_transform,RID,const Matrix32&); - FUNC2(canvas_light_occluder_set_light_mask,RID,int); - - - FUNC0R(RID,canvas_occluder_polygon_create); - FUNC3(canvas_occluder_polygon_set_shape,RID,const DVector<Vector2>&,bool); - FUNC2(canvas_occluder_polygon_set_shape_as_lines,RID,const DVector<Vector2>&); - FUNC2(canvas_occluder_polygon_set_cull_mode,RID,CanvasOccluderPolygonCullMode); - - /* CANVAS MATERIAL */ - - FUNC0R(RID,canvas_item_material_create); - FUNC2(canvas_item_material_set_shader,RID,RID); - FUNC3(canvas_item_material_set_shader_param,RID,const StringName&,const Variant&); - FUNC2RC(Variant,canvas_item_material_get_shader_param,RID,const StringName&); - FUNC2(canvas_item_material_set_shading_mode,RID,CanvasItemShadingMode); - - /* CURSOR */ - FUNC2(cursor_set_rotation,float , int ); // radians - FUNC4(cursor_set_texture,RID , const Point2 &, int, const Rect2 &); - FUNC2(cursor_set_visible,bool , int ); - FUNC2(cursor_set_pos,const Point2& , int ); - - /* BLACK BARS */ - - FUNC4(black_bars_set_margins,int , int , int , int ); - FUNC4(black_bars_set_images,RID , RID , RID , RID ); - - /* FREE */ - - FUNC1(free,RID); - - /* CUSTOM SHADE MODEL */ - - FUNC2(custom_shade_model_set_shader,int , RID ); - FUNC1RC(RID,custom_shade_model_get_shader,int ); - FUNC2(custom_shade_model_set_name,int , const String& ); - FUNC1RC(String,custom_shade_model_get_name,int ); - FUNC2(custom_shade_model_set_param_info,int , const List<PropertyInfo>& ); - FUNC2SC(custom_shade_model_get_param_info,int , List<PropertyInfo>* ); - - /* EVENT QUEUING */ - - - virtual void init(); - virtual void finish(); - virtual void draw(); - virtual void sync(); - FUNC0RC(bool,has_changed); - - /* RENDER INFO */ - - FUNC1R(int,get_render_info,RenderInfo ); - virtual bool has_feature(Features p_feature) const { return visual_server->has_feature(p_feature); } - - FUNC3(set_boot_image,const Image& , const Color&,bool ); - FUNC1(set_default_clear_color,const Color& ); - FUNC0RC(Color,get_default_clear_color ); - - FUNC0R(RID,get_test_cube ); - - - VisualServerWrapMT(VisualServer* p_contained,bool p_create_thread); - ~VisualServerWrapMT(); - -#undef ServerName -#undef ServerNameWrapMT -#undef server_name - -}; - -#ifdef DEBUG_SYNC -#undef DEBUG_SYNC -#endif -#undef SYNC_DEBUG - -#endif diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp index 6099a86b96..71f9c88f2a 100644 --- a/servers/visual_server.cpp +++ b/servers/visual_server.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,22 +39,12 @@ VisualServer *VisualServer::get_singleton() { } -void VisualServer::set_mipmap_policy(MipMapPolicy p_policy) { - mm_policy=p_policy; -} - -VisualServer::MipMapPolicy VisualServer::get_mipmap_policy() const { - - return (VisualServer::MipMapPolicy)mm_policy; -} - - -DVector<String> VisualServer::_shader_get_param_list(RID p_shader) const { +PoolVector<String> VisualServer::_shader_get_param_list(RID p_shader) const { //remove at some point - DVector<String> pl; + PoolVector<String> pl; #if 0 @@ -93,38 +83,48 @@ RID VisualServer::texture_create_from_image(const Image& p_image,uint32_t p_flag RID VisualServer::get_test_texture() { - if (test_texture) { + if (test_texture.is_valid()) { return test_texture; }; #define TEST_TEXTURE_SIZE 256 - Image data(TEST_TEXTURE_SIZE,TEST_TEXTURE_SIZE,0,Image::FORMAT_RGB); - for (int x=0;x<TEST_TEXTURE_SIZE;x++) { + PoolVector<uint8_t> test_data; + test_data.resize(TEST_TEXTURE_SIZE*TEST_TEXTURE_SIZE*3); - for (int y=0;y<TEST_TEXTURE_SIZE;y++) { + { + PoolVector<uint8_t>::Write w=test_data.write(); - Color c; - int r=255-(x+y)/2; + for (int x=0;x<TEST_TEXTURE_SIZE;x++) { - if ((x%(TEST_TEXTURE_SIZE/8))<2 ||(y%(TEST_TEXTURE_SIZE/8))<2) { + for (int y=0;y<TEST_TEXTURE_SIZE;y++) { - c.r=y; - c.g=r; - c.b=x; + Color c; + int r=255-(x+y)/2; - } else { + if ((x%(TEST_TEXTURE_SIZE/8))<2 ||(y%(TEST_TEXTURE_SIZE/8))<2) { - c.r=r; - c.g=x; - c.b=y; - } + c.r=y; + c.g=r; + c.b=x; - data.put_pixel(x, y, c); + } else { + + c.r=r; + c.g=x; + c.b=y; + } + + w[(y*TEST_TEXTURE_SIZE+x)*3+0]=uint8_t(CLAMP(c.r*255,0,255)); + w[(y*TEST_TEXTURE_SIZE+x)*3+1]=uint8_t(CLAMP(c.g*255,0,255)); + w[(y*TEST_TEXTURE_SIZE+x)*3+2]=uint8_t(CLAMP(c.b*255,0,255)); + } } } + Image data(TEST_TEXTURE_SIZE,TEST_TEXTURE_SIZE,false,Image::FORMAT_RGB8,test_data); + test_texture = texture_create_from_image(data); return test_texture; @@ -150,10 +150,10 @@ void VisualServer::_free_internal_rids() { RID VisualServer::_make_test_cube() { - DVector<Vector3> vertices; - DVector<Vector3> normals; - DVector<float> tangents; - DVector<Vector3> uvs; + PoolVector<Vector3> vertices; + PoolVector<Vector3> normals; + PoolVector<float> tangents; + PoolVector<Vector3> uvs; int vtx_idx=0; #define ADD_VTX(m_idx);\ @@ -211,16 +211,16 @@ RID VisualServer::_make_test_cube() { d[VisualServer::ARRAY_TEX_UV]= uvs ; d[VisualServer::ARRAY_VERTEX]= vertices ; - DVector<int> indices; + PoolVector<int> indices; indices.resize(vertices.size()); for(int i=0;i<vertices.size();i++) indices.set(i,i); d[VisualServer::ARRAY_INDEX]=indices; - mesh_add_surface( test_cube, PRIMITIVE_TRIANGLES,d ); - + mesh_add_surface_from_arrays( test_cube, PRIMITIVE_TRIANGLES,d ); +/* test_material = fixed_material_create(); //material_set_flag(material, MATERIAL_FLAG_BILLBOARD_TOGGLE,true); fixed_material_set_texture( test_material, FIXED_MATERIAL_PARAM_DIFFUSE, get_test_texture() ); @@ -229,7 +229,7 @@ RID VisualServer::_make_test_cube() { fixed_material_set_param( test_material, FIXED_MATERIAL_PARAM_DIFFUSE, Color(1, 1, 1) ); fixed_material_set_param( test_material, FIXED_MATERIAL_PARAM_SPECULAR, Color(1,1,1) ); - +*/ mesh_surface_set_material(test_cube, 0, test_material ); return test_cube; @@ -238,8 +238,8 @@ RID VisualServer::_make_test_cube() { RID VisualServer::make_sphere_mesh(int p_lats,int p_lons,float p_radius) { - DVector<Vector3> vertices; - DVector<Vector3> normals; + PoolVector<Vector3> vertices; + PoolVector<Vector3> normals; for(int i = 1; i <= p_lats; i++) { double lat0 = Math_PI * (-0.5 + (double) (i - 1) / p_lats); @@ -289,7 +289,7 @@ RID VisualServer::make_sphere_mesh(int p_lats,int p_lons,float p_radius) { d[ARRAY_VERTEX]=vertices; d[ARRAY_NORMAL]=normals; - mesh_add_surface(mesh,PRIMITIVE_TRIANGLES,d); + mesh_add_surface_from_arrays(mesh,PRIMITIVE_TRIANGLES,d); return mesh; } @@ -311,7 +311,7 @@ RID VisualServer::material_2d_get(bool p_shaded, bool p_transparent, bool p_cut_ //not valid, make - material_2d[version]=fixed_material_create(); +/* material_2d[version]=fixed_material_create(); fixed_material_set_flag(material_2d[version],FIXED_MATERIAL_FLAG_USE_ALPHA,p_transparent); fixed_material_set_flag(material_2d[version],FIXED_MATERIAL_FLAG_USE_COLOR_ARRAY,true); fixed_material_set_flag(material_2d[version],FIXED_MATERIAL_FLAG_DISCARD_ALPHA,p_cut_alpha); @@ -319,7 +319,8 @@ RID VisualServer::material_2d_get(bool p_shaded, bool p_transparent, bool p_cut_ material_set_flag(material_2d[version],MATERIAL_FLAG_DOUBLE_SIDED,true); material_set_depth_draw_mode(material_2d[version],p_opaque_prepass?MATERIAL_DEPTH_DRAW_OPAQUE_PRE_PASS_ALPHA:MATERIAL_DEPTH_DRAW_OPAQUE_ONLY); fixed_material_set_texture(material_2d[version],FIXED_MATERIAL_PARAM_DIFFUSE,get_white_texture()); - //material cut alpha? + //material cut alpha?*/ + return material_2d[version]; } @@ -328,409 +329,1269 @@ RID VisualServer::get_white_texture() { if (white_texture.is_valid()) return white_texture; - DVector<uint8_t> wt; + PoolVector<uint8_t> wt; wt.resize(16*3); { - DVector<uint8_t>::Write w =wt.write(); + PoolVector<uint8_t>::Write w =wt.write(); for(int i=0;i<16*3;i++) w[i]=255; } - Image white(4,4,0,Image::FORMAT_RGB,wt); + Image white(4,4,0,Image::FORMAT_RGB8,wt); white_texture=texture_create(); - texture_allocate(white_texture,4,4,Image::FORMAT_RGB); + texture_allocate(white_texture,4,4,Image::FORMAT_RGB8); texture_set_data(white_texture,white); return white_texture; } -void VisualServer::_bind_methods() { +Error VisualServer::_surface_set_data(Array p_arrays,uint32_t p_format,uint32_t *p_offsets,uint32_t p_stride,PoolVector<uint8_t> &r_vertex_array,int p_vertex_array_len,PoolVector<uint8_t> &r_index_array,int p_index_array_len,Rect3 &r_aabb,Vector<Rect3> r_bone_aabb) { - ObjectTypeDB::bind_method(_MD("texture_create"),&VisualServer::texture_create); - ObjectTypeDB::bind_method(_MD("texture_create_from_image"),&VisualServer::texture_create_from_image,DEFVAL( TEXTURE_FLAGS_DEFAULT ) ); - //ObjectTypeDB::bind_method(_MD("texture_allocate"),&VisualServer::texture_allocate,DEFVAL( TEXTURE_FLAGS_DEFAULT ) ); - //ObjectTypeDB::bind_method(_MD("texture_set_data"),&VisualServer::texture_blit_rect,DEFVAL( CUBEMAP_LEFT ) ); - //ObjectTypeDB::bind_method(_MD("texture_get_rect"),&VisualServer::texture_get_rect ); - ObjectTypeDB::bind_method(_MD("texture_set_flags"),&VisualServer::texture_set_flags ); - ObjectTypeDB::bind_method(_MD("texture_get_flags"),&VisualServer::texture_get_flags ); - ObjectTypeDB::bind_method(_MD("texture_get_width"),&VisualServer::texture_get_width ); - ObjectTypeDB::bind_method(_MD("texture_get_height"),&VisualServer::texture_get_height ); - - ObjectTypeDB::bind_method(_MD("texture_set_shrink_all_x2_on_set_data","shrink"),&VisualServer::texture_set_shrink_all_x2_on_set_data ); - -#ifndef _3D_DISABLED - - - ObjectTypeDB::bind_method(_MD("shader_create","mode"),&VisualServer::shader_create,DEFVAL(SHADER_MATERIAL)); - ObjectTypeDB::bind_method(_MD("shader_set_mode","shader","mode"),&VisualServer::shader_set_mode); - - - - ObjectTypeDB::bind_method(_MD("material_create"),&VisualServer::material_create); - - ObjectTypeDB::bind_method(_MD("material_set_shader","shader"),&VisualServer::material_set_shader); - ObjectTypeDB::bind_method(_MD("material_get_shader"),&VisualServer::material_get_shader); - - ObjectTypeDB::bind_method(_MD("material_set_param"),&VisualServer::material_set_param); - ObjectTypeDB::bind_method(_MD("material_get_param"),&VisualServer::material_get_param); - ObjectTypeDB::bind_method(_MD("material_set_flag"),&VisualServer::material_set_flag); - ObjectTypeDB::bind_method(_MD("material_get_flag"),&VisualServer::material_get_flag); - ObjectTypeDB::bind_method(_MD("material_set_blend_mode"),&VisualServer::material_set_blend_mode); - ObjectTypeDB::bind_method(_MD("material_get_blend_mode"),&VisualServer::material_get_blend_mode); - ObjectTypeDB::bind_method(_MD("material_set_line_width"),&VisualServer::material_set_line_width); - ObjectTypeDB::bind_method(_MD("material_get_line_width"),&VisualServer::material_get_line_width); - - - ObjectTypeDB::bind_method(_MD("mesh_create"),&VisualServer::mesh_create); - ObjectTypeDB::bind_method(_MD("mesh_add_surface"),&VisualServer::mesh_add_surface, DEFVAL(Array()), DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("mesh_surface_set_material"),&VisualServer::mesh_surface_set_material,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("mesh_surface_get_material"),&VisualServer::mesh_surface_get_material); - - ObjectTypeDB::bind_method(_MD("mesh_surface_get_array_len"),&VisualServer::mesh_surface_get_array_len); - ObjectTypeDB::bind_method(_MD("mesh_surface_get_array_index_len"),&VisualServer::mesh_surface_get_array_index_len); - ObjectTypeDB::bind_method(_MD("mesh_surface_get_format"),&VisualServer::mesh_surface_get_format); - ObjectTypeDB::bind_method(_MD("mesh_surface_get_primitive_type"),&VisualServer::mesh_surface_get_primitive_type); - - ObjectTypeDB::bind_method(_MD("mesh_remove_surface"),&VisualServer::mesh_remove_surface); - ObjectTypeDB::bind_method(_MD("mesh_get_surface_count"),&VisualServer::mesh_get_surface_count); - - - ObjectTypeDB::bind_method(_MD("multimesh_create"),&VisualServer::multimesh_create); - ObjectTypeDB::bind_method(_MD("multimesh_set_mesh"),&VisualServer::multimesh_set_mesh); - ObjectTypeDB::bind_method(_MD("multimesh_set_aabb"),&VisualServer::multimesh_set_aabb); - ObjectTypeDB::bind_method(_MD("multimesh_instance_set_transform"),&VisualServer::multimesh_instance_set_transform); - ObjectTypeDB::bind_method(_MD("multimesh_instance_set_color"),&VisualServer::multimesh_instance_set_color); - ObjectTypeDB::bind_method(_MD("multimesh_get_mesh"),&VisualServer::multimesh_get_mesh); - ObjectTypeDB::bind_method(_MD("multimesh_get_aabb"),&VisualServer::multimesh_get_aabb); - ObjectTypeDB::bind_method(_MD("multimesh_instance_get_transform"),&VisualServer::multimesh_instance_get_transform); - ObjectTypeDB::bind_method(_MD("multimesh_instance_get_color"),&VisualServer::multimesh_instance_get_color); - - - - ObjectTypeDB::bind_method(_MD("particles_create"),&VisualServer::particles_create); - ObjectTypeDB::bind_method(_MD("particles_set_amount"),&VisualServer::particles_set_amount); - ObjectTypeDB::bind_method(_MD("particles_get_amount"),&VisualServer::particles_get_amount); - ObjectTypeDB::bind_method(_MD("particles_set_emitting"),&VisualServer::particles_set_emitting); - ObjectTypeDB::bind_method(_MD("particles_is_emitting"),&VisualServer::particles_is_emitting); - ObjectTypeDB::bind_method(_MD("particles_set_visibility_aabb"),&VisualServer::particles_set_visibility_aabb); - ObjectTypeDB::bind_method(_MD("particles_get_visibility_aabb"),&VisualServer::particles_get_visibility_aabb); - ObjectTypeDB::bind_method(_MD("particles_set_variable"),&VisualServer::particles_set_variable); - ObjectTypeDB::bind_method(_MD("particles_get_variable"),&VisualServer::particles_get_variable); - ObjectTypeDB::bind_method(_MD("particles_set_randomness"),&VisualServer::particles_set_randomness); - ObjectTypeDB::bind_method(_MD("particles_get_randomness"),&VisualServer::particles_get_randomness); - ObjectTypeDB::bind_method(_MD("particles_set_color_phases"),&VisualServer::particles_set_color_phases); - ObjectTypeDB::bind_method(_MD("particles_get_color_phases"),&VisualServer::particles_get_color_phases); - ObjectTypeDB::bind_method(_MD("particles_set_color_phase_pos"),&VisualServer::particles_set_color_phase_pos); - ObjectTypeDB::bind_method(_MD("particles_get_color_phase_pos"),&VisualServer::particles_get_color_phase_pos); - ObjectTypeDB::bind_method(_MD("particles_set_color_phase_color"),&VisualServer::particles_set_color_phase_color); - ObjectTypeDB::bind_method(_MD("particles_get_color_phase_color"),&VisualServer::particles_get_color_phase_color); - ObjectTypeDB::bind_method(_MD("particles_set_attractors"),&VisualServer::particles_set_attractors); - ObjectTypeDB::bind_method(_MD("particles_get_attractors"),&VisualServer::particles_get_attractors); - ObjectTypeDB::bind_method(_MD("particles_set_attractor_pos"),&VisualServer::particles_set_attractor_pos); - ObjectTypeDB::bind_method(_MD("particles_get_attractor_pos"),&VisualServer::particles_get_attractor_pos); - ObjectTypeDB::bind_method(_MD("particles_set_attractor_strength"),&VisualServer::particles_set_attractor_strength); - ObjectTypeDB::bind_method(_MD("particles_get_attractor_strength"),&VisualServer::particles_get_attractor_strength); - ObjectTypeDB::bind_method(_MD("particles_set_material"),&VisualServer::particles_set_material,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("particles_set_height_from_velocity"),&VisualServer::particles_set_height_from_velocity); - ObjectTypeDB::bind_method(_MD("particles_has_height_from_velocity"),&VisualServer::particles_has_height_from_velocity); - - - - ObjectTypeDB::bind_method(_MD("light_create"),&VisualServer::light_create); - ObjectTypeDB::bind_method(_MD("light_get_type"),&VisualServer::light_get_type); - ObjectTypeDB::bind_method(_MD("light_set_color"),&VisualServer::light_set_color); - ObjectTypeDB::bind_method(_MD("light_get_color"),&VisualServer::light_get_color); - ObjectTypeDB::bind_method(_MD("light_set_shadow"),&VisualServer::light_set_shadow); - ObjectTypeDB::bind_method(_MD("light_has_shadow"),&VisualServer::light_has_shadow); - ObjectTypeDB::bind_method(_MD("light_set_volumetric"),&VisualServer::light_set_volumetric); - ObjectTypeDB::bind_method(_MD("light_is_volumetric"),&VisualServer::light_is_volumetric); - ObjectTypeDB::bind_method(_MD("light_set_projector"),&VisualServer::light_set_projector); - ObjectTypeDB::bind_method(_MD("light_get_projector"),&VisualServer::light_get_projector); - ObjectTypeDB::bind_method(_MD("light_set_var"),&VisualServer::light_set_param); - ObjectTypeDB::bind_method(_MD("light_get_var"),&VisualServer::light_get_param); - - ObjectTypeDB::bind_method(_MD("skeleton_create"),&VisualServer::skeleton_create); - ObjectTypeDB::bind_method(_MD("skeleton_resize"),&VisualServer::skeleton_resize); - ObjectTypeDB::bind_method(_MD("skeleton_get_bone_count"),&VisualServer::skeleton_get_bone_count); - ObjectTypeDB::bind_method(_MD("skeleton_bone_set_transform"),&VisualServer::skeleton_bone_set_transform); - ObjectTypeDB::bind_method(_MD("skeleton_bone_get_transform"),&VisualServer::skeleton_bone_get_transform); - + PoolVector<uint8_t>::Write vw = r_vertex_array.write(); + PoolVector<uint8_t>::Write iw; + if (r_index_array.size()) { + print_line("elements: "+itos(r_index_array.size())); - ObjectTypeDB::bind_method(_MD("room_create"),&VisualServer::room_create); - ObjectTypeDB::bind_method(_MD("room_set_bounds"),&VisualServer::room_set_bounds); - ObjectTypeDB::bind_method(_MD("room_get_bounds"),&VisualServer::room_get_bounds); - - ObjectTypeDB::bind_method(_MD("portal_create"),&VisualServer::portal_create); - ObjectTypeDB::bind_method(_MD("portal_set_shape"),&VisualServer::portal_set_shape); - ObjectTypeDB::bind_method(_MD("portal_get_shape"),&VisualServer::portal_get_shape); - ObjectTypeDB::bind_method(_MD("portal_set_enabled"),&VisualServer::portal_set_enabled); - ObjectTypeDB::bind_method(_MD("portal_is_enabled"),&VisualServer::portal_is_enabled); - ObjectTypeDB::bind_method(_MD("portal_set_disable_distance"),&VisualServer::portal_set_disable_distance); - ObjectTypeDB::bind_method(_MD("portal_get_disable_distance"),&VisualServer::portal_get_disable_distance); - ObjectTypeDB::bind_method(_MD("portal_set_disabled_color"),&VisualServer::portal_set_disabled_color); - ObjectTypeDB::bind_method(_MD("portal_get_disabled_color"),&VisualServer::portal_get_disabled_color); - - - ObjectTypeDB::bind_method(_MD("camera_create"),&VisualServer::camera_create); - ObjectTypeDB::bind_method(_MD("camera_set_perspective"),&VisualServer::camera_set_perspective); - ObjectTypeDB::bind_method(_MD("camera_set_orthogonal"),&VisualServer::_camera_set_orthogonal); - ObjectTypeDB::bind_method(_MD("camera_set_transform"),&VisualServer::camera_set_transform); - - - ObjectTypeDB::bind_method(_MD("viewport_create"),&VisualServer::viewport_create); - ObjectTypeDB::bind_method(_MD("viewport_set_rect"),&VisualServer::_viewport_set_rect); - ObjectTypeDB::bind_method(_MD("viewport_get_rect"),&VisualServer::_viewport_get_rect); - ObjectTypeDB::bind_method(_MD("viewport_attach_camera"),&VisualServer::viewport_attach_camera,DEFVAL(RID())); - ObjectTypeDB::bind_method(_MD("viewport_get_attached_camera"),&VisualServer::viewport_get_attached_camera); - ObjectTypeDB::bind_method(_MD("viewport_get_scenario"),&VisualServer::viewport_get_scenario); - ObjectTypeDB::bind_method(_MD("viewport_attach_canvas"),&VisualServer::viewport_attach_canvas); - ObjectTypeDB::bind_method(_MD("viewport_remove_canvas"),&VisualServer::viewport_remove_canvas); - ObjectTypeDB::bind_method(_MD("viewport_set_global_canvas_transform"),&VisualServer::viewport_set_global_canvas_transform); - - ObjectTypeDB::bind_method(_MD("scenario_create"),&VisualServer::scenario_create); - ObjectTypeDB::bind_method(_MD("scenario_set_debug"),&VisualServer::scenario_set_debug); - - - ObjectTypeDB::bind_method(_MD("instance_create"),&VisualServer::instance_create,DEFVAL(RID())); - ObjectTypeDB::bind_method(_MD("instance_get_base"),&VisualServer::instance_get_base); - ObjectTypeDB::bind_method(_MD("instance_get_base_aabb"),&VisualServer::instance_get_base); - ObjectTypeDB::bind_method(_MD("instance_set_transform"),&VisualServer::instance_set_transform); - ObjectTypeDB::bind_method(_MD("instance_get_transform"),&VisualServer::instance_get_transform); - ObjectTypeDB::bind_method(_MD("instance_attach_object_instance_ID"),&VisualServer::instance_attach_object_instance_ID); - ObjectTypeDB::bind_method(_MD("instance_get_object_instance_ID"),&VisualServer::instance_get_object_instance_ID); - ObjectTypeDB::bind_method(_MD("instance_attach_skeleton"),&VisualServer::instance_attach_skeleton); - ObjectTypeDB::bind_method(_MD("instance_get_skeleton"),&VisualServer::instance_get_skeleton); - ObjectTypeDB::bind_method(_MD("instance_set_room"),&VisualServer::instance_set_room); - ObjectTypeDB::bind_method(_MD("instance_get_room"),&VisualServer::instance_get_room); - - ObjectTypeDB::bind_method(_MD("instance_set_exterior"),&VisualServer::instance_set_exterior); - ObjectTypeDB::bind_method(_MD("instance_is_exterior"),&VisualServer::instance_is_exterior); - - ObjectTypeDB::bind_method(_MD("instances_cull_aabb"),&VisualServer::instances_cull_aabb); - ObjectTypeDB::bind_method(_MD("instances_cull_ray"),&VisualServer::instances_cull_ray); - ObjectTypeDB::bind_method(_MD("instances_cull_convex"),&VisualServer::instances_cull_convex); - - - - ObjectTypeDB::bind_method(_MD("instance_geometry_override_material_param"),&VisualServer::instance_get_room); - ObjectTypeDB::bind_method(_MD("instance_geometry_get_material_param"),&VisualServer::instance_get_room); - - ObjectTypeDB::bind_method(_MD("get_test_cube"),&VisualServer::get_test_cube); - -#endif - ObjectTypeDB::bind_method(_MD("canvas_create"),&VisualServer::canvas_create); - ObjectTypeDB::bind_method(_MD("canvas_item_create"),&VisualServer::canvas_item_create); - ObjectTypeDB::bind_method(_MD("canvas_item_set_parent"),&VisualServer::canvas_item_set_parent); - ObjectTypeDB::bind_method(_MD("canvas_item_get_parent"),&VisualServer::canvas_item_get_parent); - ObjectTypeDB::bind_method(_MD("canvas_item_set_transform"),&VisualServer::canvas_item_set_transform); - ObjectTypeDB::bind_method(_MD("canvas_item_set_custom_rect"),&VisualServer::canvas_item_set_custom_rect); - ObjectTypeDB::bind_method(_MD("canvas_item_set_clip"),&VisualServer::canvas_item_set_clip); - ObjectTypeDB::bind_method(_MD("canvas_item_set_opacity"),&VisualServer::canvas_item_set_opacity); - ObjectTypeDB::bind_method(_MD("canvas_item_get_opacity"),&VisualServer::canvas_item_get_opacity); - ObjectTypeDB::bind_method(_MD("canvas_item_set_self_opacity"),&VisualServer::canvas_item_set_self_opacity); - ObjectTypeDB::bind_method(_MD("canvas_item_get_self_opacity"),&VisualServer::canvas_item_get_self_opacity); - ObjectTypeDB::bind_method(_MD("canvas_item_set_z"),&VisualServer::canvas_item_set_z); - ObjectTypeDB::bind_method(_MD("canvas_item_set_sort_children_by_y"),&VisualServer::canvas_item_set_sort_children_by_y); - - ObjectTypeDB::bind_method(_MD("canvas_item_add_line"),&VisualServer::canvas_item_add_line, DEFVAL(1.0), DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("canvas_item_add_rect"),&VisualServer::canvas_item_add_rect); - ObjectTypeDB::bind_method(_MD("canvas_item_add_texture_rect"),&VisualServer::canvas_item_add_texture_rect, DEFVAL(Color(1,1,1)), DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("canvas_item_add_texture_rect_region"),&VisualServer::canvas_item_add_texture_rect_region, DEFVAL(Color(1,1,1)), DEFVAL(false)); - - ObjectTypeDB::bind_method(_MD("canvas_item_add_style_box"),&VisualServer::_canvas_item_add_style_box, DEFVAL(Color(1,1,1))); -// ObjectTypeDB::bind_method(_MD("canvas_item_add_primitive"),&VisualServer::canvas_item_add_primitive,DEFVAL(Vector<Vector2>()),DEFVAL(RID())); - ObjectTypeDB::bind_method(_MD("canvas_item_add_circle"),&VisualServer::canvas_item_add_circle); - - ObjectTypeDB::bind_method(_MD("viewport_set_canvas_transform"),&VisualServer::viewport_set_canvas_transform); - - ObjectTypeDB::bind_method(_MD("canvas_item_clear"),&VisualServer::canvas_item_clear); - ObjectTypeDB::bind_method(_MD("canvas_item_raise"),&VisualServer::canvas_item_raise); - - - ObjectTypeDB::bind_method(_MD("cursor_set_rotation"),&VisualServer::cursor_set_rotation); - ObjectTypeDB::bind_method(_MD("cursor_set_texture"),&VisualServer::cursor_set_texture); - ObjectTypeDB::bind_method(_MD("cursor_set_visible"),&VisualServer::cursor_set_visible); - ObjectTypeDB::bind_method(_MD("cursor_set_pos"),&VisualServer::cursor_set_pos); - - ObjectTypeDB::bind_method(_MD("black_bars_set_margins","left","top","right","bottom"),&VisualServer::black_bars_set_margins); - ObjectTypeDB::bind_method(_MD("black_bars_set_images","left","top","right","bottom"),&VisualServer::black_bars_set_images); - - ObjectTypeDB::bind_method(_MD("make_sphere_mesh"),&VisualServer::make_sphere_mesh); - ObjectTypeDB::bind_method(_MD("mesh_add_surface_from_planes"),&VisualServer::mesh_add_surface_from_planes); - - ObjectTypeDB::bind_method(_MD("draw"),&VisualServer::draw); - ObjectTypeDB::bind_method(_MD("sync"),&VisualServer::sync); - ObjectTypeDB::bind_method(_MD("free_rid"),&VisualServer::free); - - ObjectTypeDB::bind_method(_MD("set_default_clear_color"),&VisualServer::set_default_clear_color); - ObjectTypeDB::bind_method(_MD("get_default_clear_color"),&VisualServer::get_default_clear_color); - - ObjectTypeDB::bind_method(_MD("get_render_info"),&VisualServer::get_render_info); - - BIND_CONSTANT( NO_INDEX_ARRAY ); - BIND_CONSTANT( CUSTOM_ARRAY_SIZE ); - BIND_CONSTANT( ARRAY_WEIGHTS_SIZE ); - BIND_CONSTANT( MAX_PARTICLE_COLOR_PHASES ); - BIND_CONSTANT( MAX_PARTICLE_ATTRACTORS ); - BIND_CONSTANT( MAX_CURSORS ); - - BIND_CONSTANT( TEXTURE_FLAG_MIPMAPS ); - BIND_CONSTANT( TEXTURE_FLAG_REPEAT ); - BIND_CONSTANT( TEXTURE_FLAG_FILTER ); - BIND_CONSTANT( TEXTURE_FLAG_CUBEMAP ); - BIND_CONSTANT( TEXTURE_FLAGS_DEFAULT ); - - BIND_CONSTANT( CUBEMAP_LEFT ); - BIND_CONSTANT( CUBEMAP_RIGHT ); - BIND_CONSTANT( CUBEMAP_BOTTOM ); - BIND_CONSTANT( CUBEMAP_TOP ); - BIND_CONSTANT( CUBEMAP_FRONT ); - BIND_CONSTANT( CUBEMAP_BACK ); - - BIND_CONSTANT( SHADER_MATERIAL ); ///< param 0: name - BIND_CONSTANT( SHADER_POST_PROCESS ); ///< param 0: name - - BIND_CONSTANT( MATERIAL_FLAG_VISIBLE ); - BIND_CONSTANT( MATERIAL_FLAG_DOUBLE_SIDED ); - BIND_CONSTANT( MATERIAL_FLAG_INVERT_FACES ); - BIND_CONSTANT( MATERIAL_FLAG_UNSHADED ); - BIND_CONSTANT( MATERIAL_FLAG_ONTOP ); - BIND_CONSTANT( MATERIAL_FLAG_MAX ); - - BIND_CONSTANT( MATERIAL_BLEND_MODE_MIX ); - BIND_CONSTANT( MATERIAL_BLEND_MODE_ADD ); - BIND_CONSTANT( MATERIAL_BLEND_MODE_SUB ); - BIND_CONSTANT( MATERIAL_BLEND_MODE_MUL ); - - BIND_CONSTANT( FIXED_MATERIAL_PARAM_DIFFUSE ); - BIND_CONSTANT( FIXED_MATERIAL_PARAM_DETAIL ); - BIND_CONSTANT( FIXED_MATERIAL_PARAM_SPECULAR ); - BIND_CONSTANT( FIXED_MATERIAL_PARAM_EMISSION ); - BIND_CONSTANT( FIXED_MATERIAL_PARAM_SPECULAR_EXP ); - BIND_CONSTANT( FIXED_MATERIAL_PARAM_GLOW ); - BIND_CONSTANT( FIXED_MATERIAL_PARAM_NORMAL ); - BIND_CONSTANT( FIXED_MATERIAL_PARAM_SHADE_PARAM ); - BIND_CONSTANT( FIXED_MATERIAL_PARAM_MAX ); - - - - BIND_CONSTANT( FIXED_MATERIAL_TEXCOORD_SPHERE ); - BIND_CONSTANT( FIXED_MATERIAL_TEXCOORD_UV ); - BIND_CONSTANT( FIXED_MATERIAL_TEXCOORD_UV_TRANSFORM ); - BIND_CONSTANT( FIXED_MATERIAL_TEXCOORD_UV2 ); - - - BIND_CONSTANT( ARRAY_VERTEX ); - BIND_CONSTANT( ARRAY_NORMAL ); - BIND_CONSTANT( ARRAY_TANGENT ); - BIND_CONSTANT( ARRAY_COLOR ); - BIND_CONSTANT( ARRAY_TEX_UV ); - BIND_CONSTANT( ARRAY_BONES ); - BIND_CONSTANT( ARRAY_WEIGHTS ); - BIND_CONSTANT( ARRAY_INDEX ); - BIND_CONSTANT( ARRAY_MAX ); - - BIND_CONSTANT( ARRAY_FORMAT_VERTEX ); - BIND_CONSTANT( ARRAY_FORMAT_NORMAL ); - BIND_CONSTANT( ARRAY_FORMAT_TANGENT ); - BIND_CONSTANT( ARRAY_FORMAT_COLOR ); - BIND_CONSTANT( ARRAY_FORMAT_TEX_UV ); - BIND_CONSTANT( ARRAY_FORMAT_BONES ); - BIND_CONSTANT( ARRAY_FORMAT_WEIGHTS ); - BIND_CONSTANT( ARRAY_FORMAT_INDEX ); - - BIND_CONSTANT( PRIMITIVE_POINTS ); - BIND_CONSTANT( PRIMITIVE_LINES ); - BIND_CONSTANT( PRIMITIVE_LINE_STRIP ); - BIND_CONSTANT( PRIMITIVE_LINE_LOOP ); - BIND_CONSTANT( PRIMITIVE_TRIANGLES ); - BIND_CONSTANT( PRIMITIVE_TRIANGLE_STRIP ); - BIND_CONSTANT( PRIMITIVE_TRIANGLE_FAN ); - BIND_CONSTANT( PRIMITIVE_MAX ); - - BIND_CONSTANT( PARTICLE_LIFETIME ); - BIND_CONSTANT( PARTICLE_SPREAD ); - BIND_CONSTANT( PARTICLE_GRAVITY ); - BIND_CONSTANT( PARTICLE_LINEAR_VELOCITY ); - BIND_CONSTANT( PARTICLE_ANGULAR_VELOCITY ); - BIND_CONSTANT( PARTICLE_LINEAR_ACCELERATION ); - BIND_CONSTANT( PARTICLE_RADIAL_ACCELERATION ); - BIND_CONSTANT( PARTICLE_TANGENTIAL_ACCELERATION ); - BIND_CONSTANT( PARTICLE_INITIAL_SIZE ); - BIND_CONSTANT( PARTICLE_FINAL_SIZE ); - BIND_CONSTANT( PARTICLE_INITIAL_ANGLE ); - BIND_CONSTANT( PARTICLE_HEIGHT ); - BIND_CONSTANT( PARTICLE_HEIGHT_SPEED_SCALE ); - BIND_CONSTANT( PARTICLE_VAR_MAX ); - - BIND_CONSTANT( LIGHT_DIRECTIONAL ); - BIND_CONSTANT( LIGHT_OMNI ); - BIND_CONSTANT( LIGHT_SPOT ); - - - BIND_CONSTANT( LIGHT_COLOR_DIFFUSE ); - BIND_CONSTANT( LIGHT_COLOR_SPECULAR ); - - BIND_CONSTANT( LIGHT_PARAM_SPOT_ATTENUATION ); - BIND_CONSTANT( LIGHT_PARAM_SPOT_ANGLE ); - BIND_CONSTANT( LIGHT_PARAM_RADIUS ); - BIND_CONSTANT( LIGHT_PARAM_ENERGY ); - BIND_CONSTANT( LIGHT_PARAM_ATTENUATION ); - BIND_CONSTANT( LIGHT_PARAM_MAX ); - - BIND_CONSTANT( SCENARIO_DEBUG_DISABLED ); - BIND_CONSTANT( SCENARIO_DEBUG_WIREFRAME ); - BIND_CONSTANT( SCENARIO_DEBUG_OVERDRAW ); - - BIND_CONSTANT( INSTANCE_MESH ); - BIND_CONSTANT( INSTANCE_MULTIMESH ); - - BIND_CONSTANT( INSTANCE_PARTICLES ); - BIND_CONSTANT( INSTANCE_LIGHT ); - BIND_CONSTANT( INSTANCE_ROOM ); - BIND_CONSTANT( INSTANCE_PORTAL ); - BIND_CONSTANT( INSTANCE_GEOMETRY_MASK ); - - - BIND_CONSTANT( INFO_OBJECTS_IN_FRAME ); - BIND_CONSTANT( INFO_VERTICES_IN_FRAME ); - BIND_CONSTANT( INFO_MATERIAL_CHANGES_IN_FRAME ); - BIND_CONSTANT( INFO_SHADER_CHANGES_IN_FRAME ); - BIND_CONSTANT( INFO_SURFACE_CHANGES_IN_FRAME ); - BIND_CONSTANT( INFO_DRAW_CALLS_IN_FRAME ); - BIND_CONSTANT( INFO_USAGE_VIDEO_MEM_TOTAL ); - BIND_CONSTANT( INFO_VIDEO_MEM_USED ); - BIND_CONSTANT( INFO_TEXTURE_MEM_USED ); - BIND_CONSTANT( INFO_VERTEX_MEM_USED ); + iw=r_index_array.write(); + + } + + int max_bone=0; + + + for(int ai=0;ai<VS::ARRAY_MAX;ai++) { + + if (!(p_format&(1<<ai))) // no array + continue; + + + switch(ai) { + + case VS::ARRAY_VERTEX: { + + if (p_format& VS::ARRAY_FLAG_USE_2D_VERTICES) { + + PoolVector<Vector2> array = p_arrays[ai]; + ERR_FAIL_COND_V( array.size() != p_vertex_array_len, ERR_INVALID_PARAMETER ); + + + PoolVector<Vector2>::Read read = array.read(); + const Vector2* src=read.ptr(); + + // setting vertices means regenerating the AABB + Rect2 aabb; + + + if (p_format&ARRAY_COMPRESS_VERTEX) { + + for (int i=0;i<p_vertex_array_len;i++) { + + + uint16_t vector[2]={ Math::make_half_float(src[i].x), Math::make_half_float(src[i].y) }; + + copymem(&vw[p_offsets[ai]+i*p_stride], vector, sizeof(uint16_t)*2); + + if (i==0) { + + aabb=Rect2(src[i],Vector2()); + } else { + + aabb.expand_to( src[i] ); + } + } + + + } else { + for (int i=0;i<p_vertex_array_len;i++) { + + + float vector[2]={ src[i].x, src[i].y }; + + copymem(&vw[p_offsets[ai]+i*p_stride], vector, sizeof(float)*2); + + if (i==0) { + + aabb=Rect2(src[i],Vector2()); + } else { + + aabb.expand_to( src[i] ); + } + } + } + + r_aabb=Rect3(Vector3(aabb.pos.x,aabb.pos.y,0),Vector3(aabb.size.x,aabb.size.y,0)); + + + } else { + PoolVector<Vector3> array = p_arrays[ai]; + ERR_FAIL_COND_V( array.size() != p_vertex_array_len, ERR_INVALID_PARAMETER ); + + + PoolVector<Vector3>::Read read = array.read(); + const Vector3* src=read.ptr(); + + // setting vertices means regenerating the AABB + Rect3 aabb; + + + if (p_format&ARRAY_COMPRESS_VERTEX) { + + for (int i=0;i<p_vertex_array_len;i++) { + + + uint16_t vector[4]={ Math::make_half_float(src[i].x), Math::make_half_float(src[i].y), Math::make_half_float(src[i].z), Math::make_half_float(1.0) }; + + copymem(&vw[p_offsets[ai]+i*p_stride], vector, sizeof(uint16_t)*4); + + if (i==0) { + + aabb=Rect3(src[i],Vector3()); + } else { + + aabb.expand_to( src[i] ); + } + } + + + } else { + for (int i=0;i<p_vertex_array_len;i++) { + + + float vector[3]={ src[i].x, src[i].y, src[i].z }; + + copymem(&vw[p_offsets[ai]+i*p_stride], vector, sizeof(float)*3); + + if (i==0) { + + aabb=Rect3(src[i],Vector3()); + } else { + + aabb.expand_to( src[i] ); + } + } + } + + r_aabb=aabb; + + } + + + } break; + case VS::ARRAY_NORMAL: { + + ERR_FAIL_COND_V( p_arrays[ai].get_type() != Variant::POOL_VECTOR3_ARRAY, ERR_INVALID_PARAMETER ); + + PoolVector<Vector3> array = p_arrays[ai]; + ERR_FAIL_COND_V( array.size() != p_vertex_array_len, ERR_INVALID_PARAMETER ); + + + PoolVector<Vector3>::Read read = array.read(); + const Vector3* src=read.ptr(); + + // setting vertices means regenerating the AABB + + if (p_format&ARRAY_COMPRESS_NORMAL) { + + for (int i=0;i<p_vertex_array_len;i++) { + + uint8_t vector[4]={ + CLAMP(src[i].x*127,-128,127), + CLAMP(src[i].y*127,-128,127), + CLAMP(src[i].z*127,-128,127), + 0, + }; + + copymem(&vw[p_offsets[ai]+i*p_stride], vector, 4); + + } + + } else { + for (int i=0;i<p_vertex_array_len;i++) { + + + float vector[3]={ src[i].x, src[i].y, src[i].z }; + copymem(&vw[p_offsets[ai]+i*p_stride], vector, 3*4); + + } + } + + } break; + + case VS::ARRAY_TANGENT: { + + ERR_FAIL_COND_V( p_arrays[ai].get_type() != Variant::POOL_REAL_ARRAY, ERR_INVALID_PARAMETER ); + + PoolVector<real_t> array = p_arrays[ai]; + + ERR_FAIL_COND_V( array.size() != p_vertex_array_len*4, ERR_INVALID_PARAMETER ); + + + PoolVector<real_t>::Read read = array.read(); + const real_t* src = read.ptr(); + + if (p_format&ARRAY_COMPRESS_TANGENT) { + + for (int i=0;i<p_vertex_array_len;i++) { + + uint8_t xyzw[4]={ + CLAMP(src[i*4+0]*127,-128,127), + CLAMP(src[i*4+1]*127,-128,127), + CLAMP(src[i*4+2]*127,-128,127), + CLAMP(src[i*4+3]*127,-128,127) + }; + + copymem(&vw[p_offsets[ai]+i*p_stride], xyzw, 4); + + } + + + } else { + for (int i=0;i<p_vertex_array_len;i++) { + + float xyzw[4]={ + src[i*4+0], + src[i*4+1], + src[i*4+2], + src[i*4+3] + }; + + copymem(&vw[p_offsets[ai]+i*p_stride], xyzw, 4*4); + + } + } + + } break; + case VS::ARRAY_COLOR: { + + ERR_FAIL_COND_V( p_arrays[ai].get_type() != Variant::POOL_COLOR_ARRAY, ERR_INVALID_PARAMETER ); + + + PoolVector<Color> array = p_arrays[ai]; + + ERR_FAIL_COND_V( array.size() != p_vertex_array_len, ERR_INVALID_PARAMETER ); + + + PoolVector<Color>::Read read = array.read(); + const Color* src = read.ptr(); + if (p_format&ARRAY_COMPRESS_COLOR) { + for (int i=0;i<p_vertex_array_len;i++) { + + + uint8_t colors[4]; + + for(int j=0;j<4;j++) { + + colors[j]=CLAMP( int((src[i][j])*255.0), 0,255 ); + } + + copymem(&vw[p_offsets[ai]+i*p_stride], colors, 4); + + } + } else { + + for (int i=0;i<p_vertex_array_len;i++) { + + + copymem(&vw[p_offsets[ai]+i*p_stride], &src[i], 4*4); + } + + } + + + } break; + case VS::ARRAY_TEX_UV: { + + ERR_FAIL_COND_V( p_arrays[ai].get_type() != Variant::POOL_VECTOR3_ARRAY && p_arrays[ai].get_type() != Variant::POOL_VECTOR2_ARRAY, ERR_INVALID_PARAMETER ); + + PoolVector<Vector2> array = p_arrays[ai]; + + ERR_FAIL_COND_V( array.size() != p_vertex_array_len , ERR_INVALID_PARAMETER); + + PoolVector<Vector2>::Read read = array.read(); + + const Vector2 * src=read.ptr(); + + + + if (p_format&ARRAY_COMPRESS_TEX_UV) { + + for (int i=0;i<p_vertex_array_len;i++) { + + uint16_t uv[2]={ Math::make_half_float(src[i].x) , Math::make_half_float(src[i].y) }; + copymem(&vw[p_offsets[ai]+i*p_stride], uv, 2*2); + } + + } else { + for (int i=0;i<p_vertex_array_len;i++) { + + float uv[2]={ src[i].x , src[i].y }; + + copymem(&vw[p_offsets[ai]+i*p_stride], uv, 2*4); + + } + } + + + } break; + + case VS::ARRAY_TEX_UV2: { + + + ERR_FAIL_COND_V( p_arrays[ai].get_type() != Variant::POOL_VECTOR3_ARRAY && p_arrays[ai].get_type() != Variant::POOL_VECTOR2_ARRAY, ERR_INVALID_PARAMETER ); + + PoolVector<Vector2> array = p_arrays[ai]; + + ERR_FAIL_COND_V( array.size() != p_vertex_array_len , ERR_INVALID_PARAMETER); + + PoolVector<Vector2>::Read read = array.read(); + + const Vector2 * src=read.ptr(); + + + + if (p_format&ARRAY_COMPRESS_TEX_UV2) { + + for (int i=0;i<p_vertex_array_len;i++) { + + uint16_t uv[2]={ Math::make_half_float(src[i].x) , Math::make_half_float(src[i].y) }; + copymem(&vw[p_offsets[ai]+i*p_stride], uv, 2*2); + } + + } else { + for (int i=0;i<p_vertex_array_len;i++) { + + float uv[2]={ src[i].x , src[i].y }; + + copymem(&vw[p_offsets[ai]+i*p_stride], uv, 2*4); + + } + } + } break; + case VS::ARRAY_WEIGHTS: { + + ERR_FAIL_COND_V( p_arrays[ai].get_type() != Variant::POOL_REAL_ARRAY, ERR_INVALID_PARAMETER ); + + PoolVector<real_t> array = p_arrays[ai]; + + ERR_FAIL_COND_V( array.size() != p_vertex_array_len*VS::ARRAY_WEIGHTS_SIZE, ERR_INVALID_PARAMETER ); + + + PoolVector<real_t>::Read read = array.read(); + + const real_t * src = read.ptr(); + + if (p_format&ARRAY_COMPRESS_WEIGHTS) { + + for (int i=0;i<p_vertex_array_len;i++) { + + uint16_t data[VS::ARRAY_WEIGHTS_SIZE]; + for (int j=0;j<VS::ARRAY_WEIGHTS_SIZE;j++) { + data[j]=CLAMP(src[i*VS::ARRAY_WEIGHTS_SIZE+j]*65535,0,65535); + } + + copymem(&vw[p_offsets[ai]+i*p_stride], data, 2*4); + } + } else { + + for (int i=0;i<p_vertex_array_len;i++) { + + float data[VS::ARRAY_WEIGHTS_SIZE]; + for (int j=0;j<VS::ARRAY_WEIGHTS_SIZE;j++) { + data[j]=src[i*VS::ARRAY_WEIGHTS_SIZE+j]; + } + + copymem(&vw[p_offsets[ai]+i*p_stride], data, 4*4); + + + } + } + + } break; + case VS::ARRAY_BONES: { + + ERR_FAIL_COND_V( p_arrays[ai].get_type() != Variant::POOL_INT_ARRAY, ERR_INVALID_PARAMETER ); + + PoolVector<int> array = p_arrays[ai]; + + ERR_FAIL_COND_V( array.size() != p_vertex_array_len*VS::ARRAY_WEIGHTS_SIZE, ERR_INVALID_PARAMETER ); + + + PoolVector<int>::Read read = array.read(); + + const int * src = read.ptr(); + + + if (!(p_format&ARRAY_FLAG_USE_16_BIT_BONES)) { + + for (int i=0;i<p_vertex_array_len;i++) { + + uint8_t data[VS::ARRAY_WEIGHTS_SIZE]; + for (int j=0;j<VS::ARRAY_WEIGHTS_SIZE;j++) { + data[j]=CLAMP(src[i*VS::ARRAY_WEIGHTS_SIZE+j],0,255); + max_bone=MAX(data[j],max_bone); + + } + + copymem(&vw[p_offsets[ai]+i*p_stride], data, 4); + + + } + + } else { + for (int i=0;i<p_vertex_array_len;i++) { + + uint16_t data[VS::ARRAY_WEIGHTS_SIZE]; + for (int j=0;j<VS::ARRAY_WEIGHTS_SIZE;j++) { + data[j]=src[i*VS::ARRAY_WEIGHTS_SIZE+j]; + max_bone=MAX(data[j],max_bone); + + } + + copymem(&vw[p_offsets[ai]+i*p_stride], data, 2*4); + + + } + } + + + } break; + case VS::ARRAY_INDEX: { + + + ERR_FAIL_COND_V( p_index_array_len<=0, ERR_INVALID_DATA ); + ERR_FAIL_COND_V( p_arrays[ai].get_type() != Variant::POOL_INT_ARRAY, ERR_INVALID_PARAMETER ); + + PoolVector<int> indices = p_arrays[ai]; + ERR_FAIL_COND_V( indices.size() == 0, ERR_INVALID_PARAMETER ); + ERR_FAIL_COND_V( indices.size() != p_index_array_len, ERR_INVALID_PARAMETER ); + + /* determine wether using 16 or 32 bits indices */ + + PoolVector<int>::Read read = indices.read(); + const int *src=read.ptr(); + + for (int i=0;i<p_index_array_len;i++) { + + + if (p_vertex_array_len<(1<<16)) { + uint16_t v=src[i]; + + copymem(&iw[i*2], &v, 2); + } else { + uint32_t v=src[i]; + + copymem(&iw[i*4], &v, 4); + } + } + } break; + default: { + ERR_FAIL_V( ERR_INVALID_DATA ); + } + } + } + + + if (p_format&VS::ARRAY_FORMAT_BONES) { + //create AABBs for each detected bone + int total_bones = max_bone+1; + + bool first = r_bone_aabb.size()==0; + + r_bone_aabb.resize(total_bones); + + if (first) { + for(int i=0;i<total_bones;i++) { + r_bone_aabb[i].size==Vector3(-1,-1,-1); //negative means unused + } + } + + PoolVector<Vector3> vertices = p_arrays[VS::ARRAY_VERTEX]; + PoolVector<int> bones = p_arrays[VS::ARRAY_BONES]; + PoolVector<float> weights = p_arrays[VS::ARRAY_WEIGHTS]; + + bool any_valid=false; + + if (vertices.size() && bones.size()==vertices.size()*4 && weights.size()==bones.size()) { + + int vs = vertices.size(); + PoolVector<Vector3>::Read rv =vertices.read(); + PoolVector<int>::Read rb=bones.read(); + PoolVector<float>::Read rw=weights.read(); + + Rect3 *bptr = r_bone_aabb.ptr(); + + for(int i=0;i<vs;i++) { + + Vector3 v = rv[i]; + for(int j=0;j<4;j++) { + + int idx = rb[i*4+j]; + float w = rw[i*4+j]; + if (w==0) + continue;//break; + ERR_FAIL_INDEX_V(idx,total_bones,ERR_INVALID_DATA); + + if (bptr->size.x<0) { + //first + bptr[idx]=Rect3(); + bptr[idx].pos=v; + any_valid=true; + } else { + bptr[idx].expand_to(v); + } + } + } + } + + if (!any_valid && first) { + + r_bone_aabb.clear(); + } + } + return OK; } -void VisualServer::_canvas_item_add_style_box(RID p_item, const Rect2& p_rect, const Rect2& p_source, RID p_texture,const Vector<float>& p_margins, const Color& p_modulate) { - ERR_FAIL_COND(p_margins.size()!=4); - canvas_item_add_style_box(p_item,p_rect,p_source,p_texture,Vector2(p_margins[0],p_margins[1]),Vector2(p_margins[2],p_margins[3]),true,p_modulate); +void VisualServer::mesh_add_surface_from_arrays(RID p_mesh,PrimitiveType p_primitive,const Array& p_arrays,const Array& p_blend_shapes,uint32_t p_compress_format) { + + ERR_FAIL_INDEX( p_primitive, VS::PRIMITIVE_MAX ); + ERR_FAIL_COND(p_arrays.size()!=VS::ARRAY_MAX); + + uint32_t format=0; + + // validation + int index_array_len=0; + int array_len=0; + + for(int i=0;i<p_arrays.size();i++) { + + if (p_arrays[i].get_type()==Variant::NIL) + continue; + + format|=(1<<i); + + if (i==VS::ARRAY_VERTEX) { + + Variant var = p_arrays[i]; + switch(var.get_type()) { + case Variant::POOL_VECTOR2_ARRAY: { + PoolVector<Vector2> v2 = var; + array_len=v2.size(); + } break; + case Variant::POOL_VECTOR3_ARRAY: { + PoolVector<Vector3> v3 = var; + array_len=v3.size(); + } break; + default: { + Array v = var; + array_len=v.size(); + } break; + } + + array_len=PoolVector3Array(p_arrays[i]).size(); + ERR_FAIL_COND(array_len==0); + } else if (i==VS::ARRAY_INDEX) { + + index_array_len=PoolIntArray(p_arrays[i]).size(); + } + } + + ERR_FAIL_COND((format&VS::ARRAY_FORMAT_VERTEX)==0); // mandatory + + + if (p_blend_shapes.size()) { + //validate format for morphs + for(int i=0;i<p_blend_shapes.size();i++) { + + uint32_t bsformat=0; + Array arr = p_blend_shapes[i]; + for(int j=0;j<arr.size();j++) { + + + if (arr[j].get_type()!=Variant::NIL) + bsformat|=(1<<j); + } + + ERR_FAIL_COND( (bsformat)!=(format&(VS::ARRAY_FORMAT_INDEX-1))); + } + } + + uint32_t offsets[VS::ARRAY_MAX]; + + int total_elem_size=0; + + for (int i=0;i<VS::ARRAY_MAX;i++) { + + + offsets[i]=0; //reset + + if (!(format&(1<<i))) // no array + continue; + + + int elem_size=0; + + switch(i) { + + case VS::ARRAY_VERTEX: { + + Variant arr = p_arrays[0]; + if (arr.get_type()==Variant::POOL_VECTOR2_ARRAY) { + elem_size=2; + p_compress_format|=ARRAY_FLAG_USE_2D_VERTICES; + } else if (arr.get_type()==Variant::POOL_VECTOR3_ARRAY) { + p_compress_format&=~ARRAY_FLAG_USE_2D_VERTICES; + elem_size=3; + } else { + elem_size=(p_compress_format&ARRAY_FLAG_USE_2D_VERTICES)?2:3; + } + + if (p_compress_format&ARRAY_COMPRESS_VERTEX) { + elem_size*=sizeof(int16_t); + } else { + elem_size*=sizeof(float); + } + + if (elem_size==6) { + //had to pad + elem_size=8; + } + + } break; + case VS::ARRAY_NORMAL: { + + if (p_compress_format&ARRAY_COMPRESS_NORMAL) { + elem_size=sizeof(uint32_t); + } else { + elem_size=sizeof(float)*3; + } + + } break; + + case VS::ARRAY_TANGENT: { + if (p_compress_format&ARRAY_COMPRESS_TANGENT) { + elem_size=sizeof(uint32_t); + } else { + elem_size=sizeof(float)*4; + } + + } break; + case VS::ARRAY_COLOR: { + + if (p_compress_format&ARRAY_COMPRESS_COLOR) { + elem_size=sizeof(uint32_t); + } else { + elem_size=sizeof(float)*4; + } + } break; + case VS::ARRAY_TEX_UV: { + if (p_compress_format&ARRAY_COMPRESS_TEX_UV) { + elem_size=sizeof(uint32_t); + } else { + elem_size=sizeof(float)*2; + } + + } break; + + case VS::ARRAY_TEX_UV2: { + if (p_compress_format&ARRAY_COMPRESS_TEX_UV2) { + elem_size=sizeof(uint32_t); + } else { + elem_size=sizeof(float)*2; + } + + } break; + case VS::ARRAY_WEIGHTS: { + + if (p_compress_format&ARRAY_COMPRESS_WEIGHTS) { + elem_size=sizeof(uint16_t)*4; + } else { + elem_size=sizeof(float)*4; + } + + } break; + case VS::ARRAY_BONES: { + + PoolVector<int> bones = p_arrays[VS::ARRAY_BONES]; + int max_bone=0; + + { + int bc = bones.size(); + PoolVector<int>::Read r=bones.read(); + for(int j=0;j<bc;j++) { + max_bone=MAX(r[j],max_bone); + } + } + + if (max_bone > 255) { + p_compress_format|=ARRAY_FLAG_USE_16_BIT_BONES; + elem_size=sizeof(uint16_t)*4; + } else { + p_compress_format&=~ARRAY_FLAG_USE_16_BIT_BONES; + elem_size=sizeof(uint32_t); + } + + + } break; + case VS::ARRAY_INDEX: { + + if (index_array_len<=0) { + ERR_PRINT("index_array_len==NO_INDEX_ARRAY"); + break; + } + /* determine wether using 16 or 32 bits indices */ + if (array_len>=(1<<16)) { + + elem_size=4; + + } else { + elem_size=2; + } + offsets[i]=elem_size; + continue; + } break; + default: { + ERR_FAIL( ); + } + } + + offsets[i]=total_elem_size; + total_elem_size+=elem_size; + + + } + + uint32_t mask = (1<<ARRAY_MAX)-1; + format|=(~mask)&p_compress_format; //make the full format + + + int array_size = total_elem_size * array_len; + + PoolVector<uint8_t> vertex_array; + vertex_array.resize(array_size); + + int index_array_size = offsets[VS::ARRAY_INDEX]*index_array_len; + + PoolVector<uint8_t> index_array; + index_array.resize(index_array_size); + + Rect3 aabb; + Vector<Rect3> bone_aabb; + + Error err = _surface_set_data(p_arrays,format,offsets,total_elem_size,vertex_array,array_len,index_array,index_array_len,aabb,bone_aabb); + + if (err) { + ERR_EXPLAIN("Invalid array format for surface"); + ERR_FAIL_COND(err!=OK); + } + + Vector<PoolVector<uint8_t> > blend_shape_data; + + for(int i=0;i<p_blend_shapes.size();i++) { + + PoolVector<uint8_t> vertex_array_shape; + vertex_array_shape.resize(array_size); + PoolVector<uint8_t> noindex; + + Rect3 laabb; + Error err = _surface_set_data(p_blend_shapes[i],format&~ARRAY_FORMAT_INDEX,offsets,total_elem_size,vertex_array_shape,array_len,noindex,0,laabb,bone_aabb); + aabb.merge_with(laabb); + if (err) { + ERR_EXPLAIN("Invalid blend shape array format for surface"); + ERR_FAIL_COND(err!=OK); + } + + blend_shape_data.push_back(vertex_array_shape); + } + + mesh_add_surface(p_mesh,format,p_primitive,vertex_array,array_len,index_array,index_array_len,aabb,blend_shape_data,bone_aabb); + } -void VisualServer::_camera_set_orthogonal(RID p_camera,float p_size,float p_z_near,float p_z_far) { +Array VisualServer::_get_array_from_surface(uint32_t p_format,PoolVector<uint8_t> p_vertex_data,int p_vertex_len,PoolVector<uint8_t> p_index_data,int p_index_len) const { + + + uint32_t offsets[ARRAY_MAX]; + + int total_elem_size=0; + + for (int i=0;i<VS::ARRAY_MAX;i++) { + + + offsets[i]=0; //reset + + if (!(p_format&(1<<i))) // no array + continue; + + + int elem_size=0; + + switch(i) { + + case VS::ARRAY_VERTEX: { + + + if (p_format&ARRAY_FLAG_USE_2D_VERTICES) { + elem_size=2; + } else { + elem_size=3; + } + + if (p_format&ARRAY_COMPRESS_VERTEX) { + elem_size*=sizeof(int16_t); + } else { + elem_size*=sizeof(float); + } + + if (elem_size==6) { + elem_size=8; + } + + } break; + case VS::ARRAY_NORMAL: { + + if (p_format&ARRAY_COMPRESS_NORMAL) { + elem_size=sizeof(uint32_t); + } else { + elem_size=sizeof(float)*3; + } + + } break; + + case VS::ARRAY_TANGENT: { + if (p_format&ARRAY_COMPRESS_TANGENT) { + elem_size=sizeof(uint32_t); + } else { + elem_size=sizeof(float)*4; + } + + } break; + case VS::ARRAY_COLOR: { + + if (p_format&ARRAY_COMPRESS_COLOR) { + elem_size=sizeof(uint32_t); + } else { + elem_size=sizeof(float)*4; + } + } break; + case VS::ARRAY_TEX_UV: { + if (p_format&ARRAY_COMPRESS_TEX_UV) { + elem_size=sizeof(uint32_t); + } else { + elem_size=sizeof(float)*2; + } + + } break; + + case VS::ARRAY_TEX_UV2: { + if (p_format&ARRAY_COMPRESS_TEX_UV2) { + elem_size=sizeof(uint32_t); + } else { + elem_size=sizeof(float)*2; + } + + } break; + case VS::ARRAY_WEIGHTS: { + + if (p_format&ARRAY_COMPRESS_WEIGHTS) { + elem_size=sizeof(uint16_t)*4; + } else { + elem_size=sizeof(float)*4; + } + + } break; + case VS::ARRAY_BONES: { + + if (p_format&ARRAY_FLAG_USE_16_BIT_BONES) { + elem_size=sizeof(uint16_t)*4; + } else { + elem_size=sizeof(uint32_t); + } + + } break; + case VS::ARRAY_INDEX: { + + if (p_index_len<=0) { + ERR_PRINT("index_array_len==NO_INDEX_ARRAY"); + break; + } + /* determine wether using 16 or 32 bits indices */ + if (p_vertex_len>=(1<<16)) { + + elem_size=4; + + } else { + elem_size=2; + } + offsets[i]=elem_size; + continue; + } break; + default: { + ERR_FAIL_V( Array() ); + } + } + + offsets[i]=total_elem_size; + total_elem_size+=elem_size; + + + } + + Array ret; + ret.resize(VS::ARRAY_MAX); + + PoolVector<uint8_t>::Read r = p_vertex_data.read(); + + for(int i=0;i<VS::ARRAY_MAX;i++) { + + if (!(p_format&(1<<i))) + continue; + + + switch(i) { + + case VS::ARRAY_VERTEX: { + + + if (p_format&ARRAY_FLAG_USE_2D_VERTICES) { + + PoolVector<Vector2> arr_2d; + arr_2d.resize(p_vertex_len); + + if (p_format&ARRAY_COMPRESS_VERTEX) { + + PoolVector<Vector2>::Write w = arr_2d.write(); + + for(int j=0;j<p_vertex_len;j++) { + + const uint16_t *v = (const uint16_t*)&r[j*total_elem_size+offsets[i]]; + w[j]=Vector2(Math::halfptr_to_float(&v[0]),Math::halfptr_to_float(&v[1])); + } + } else { + + PoolVector<Vector2>::Write w = arr_2d.write(); + + for(int j=0;j<p_vertex_len;j++) { + + const float *v = (const float*)&r[j*total_elem_size+offsets[i]]; + w[j]=Vector2(v[0],v[1]); + } + } + + ret[i]=arr_2d; + } else { + + PoolVector<Vector3> arr_3d; + arr_3d.resize(p_vertex_len); + + if (p_format&ARRAY_COMPRESS_VERTEX) { + + PoolVector<Vector3>::Write w = arr_3d.write(); + + for(int j=0;j<p_vertex_len;j++) { + + const uint16_t *v = (const uint16_t*)&r[j*total_elem_size+offsets[i]]; + w[j]=Vector3(Math::halfptr_to_float(&v[0]),Math::halfptr_to_float(&v[1]),Math::halfptr_to_float(&v[2])); + } + } else { + + PoolVector<Vector3>::Write w = arr_3d.write(); + + for(int j=0;j<p_vertex_len;j++) { + + const float *v = (const float*)&r[j*total_elem_size+offsets[i]]; + w[j]=Vector3(v[0],v[1],v[2]); + } + } + + ret[i]=arr_3d; + } + + + } break; + case VS::ARRAY_NORMAL: { + PoolVector<Vector3> arr; + arr.resize(p_vertex_len); + + if (p_format&ARRAY_COMPRESS_NORMAL) { + + PoolVector<Vector3>::Write w = arr.write(); + + for(int j=0;j<p_vertex_len;j++) { + + const uint8_t *v = (const uint8_t*)&r[j*total_elem_size+offsets[i]]; + w[j]=Vector3( float(v[0]/255.0)*2.0-1.0, float(v[1]/255.0)*2.0-1.0, float(v[2]/255.0)*2.0-1.0 ); + } + } else { + PoolVector<Vector3>::Write w = arr.write(); + + for(int j=0;j<p_vertex_len;j++) { + + const float *v = (const float*)&r[j*total_elem_size+offsets[i]]; + w[j]=Vector3(v[0],v[1],v[2]); + } + } + + ret[i]=arr; + + } break; + + case VS::ARRAY_TANGENT: { + PoolVector<float> arr; + arr.resize(p_vertex_len*4); + if (p_format&ARRAY_COMPRESS_TANGENT) { + PoolVector<float>::Write w = arr.write(); + + for(int j=0;j<p_vertex_len;j++) { + + const uint8_t *v = (const uint8_t*)&r[j*total_elem_size+offsets[i]]; + for(int k=0;k<4;k++) { + w[j*4+k]=float(v[k]/255.0)*2.0-1.0; + } + } + } else { + + PoolVector<float>::Write w = arr.write(); + + for(int j=0;j<p_vertex_len;j++) { + const float *v = (const float*)&r[j*total_elem_size+offsets[i]]; + for(int k=0;k<4;k++) { + w[j*4+k]=v[k]; + } + } + + } + + ret[i]=arr; + + } break; + case VS::ARRAY_COLOR: { + + PoolVector<Color> arr; + arr.resize(p_vertex_len); + + if (p_format&ARRAY_COMPRESS_COLOR) { + + PoolVector<Color>::Write w = arr.write(); + + for(int j=0;j<p_vertex_len;j++) { + + const uint8_t *v = (const uint8_t*)&r[j*total_elem_size+offsets[i]]; + w[j]=Color( float(v[0]/255.0)*2.0-1.0, float(v[1]/255.0)*2.0-1.0, float(v[2]/255.0)*2.0-1.0, float(v[3]/255.0)*2.0-1.0 ); + } + } else { + PoolVector<Color>::Write w = arr.write(); + + for(int j=0;j<p_vertex_len;j++) { + + const float *v = (const float*)&r[j*total_elem_size+offsets[i]]; + w[j]=Color(v[0],v[1],v[2],v[3]); + } + } + + ret[i]=arr; + } break; + case VS::ARRAY_TEX_UV: { + + PoolVector<Vector2> arr; + arr.resize(p_vertex_len); + + if (p_format&ARRAY_COMPRESS_TEX_UV) { + + PoolVector<Vector2>::Write w = arr.write(); + + for(int j=0;j<p_vertex_len;j++) { + + const uint16_t *v = (const uint16_t*)&r[j*total_elem_size+offsets[i]]; + w[j]=Vector2(Math::halfptr_to_float(&v[0]),Math::halfptr_to_float(&v[1])); + } + } else { + + PoolVector<Vector2>::Write w = arr.write(); + + for(int j=0;j<p_vertex_len;j++) { + + const float *v = (const float*)&r[j*total_elem_size+offsets[i]]; + w[j]=Vector2(v[0],v[1]); + } + } + + ret[i]=arr; + } break; + + case VS::ARRAY_TEX_UV2: { + PoolVector<Vector2> arr; + arr.resize(p_vertex_len); + + if (p_format&ARRAY_COMPRESS_TEX_UV2) { + + PoolVector<Vector2>::Write w = arr.write(); + + for(int j=0;j<p_vertex_len;j++) { + + const uint16_t *v = (const uint16_t*)&r[j*total_elem_size+offsets[i]]; + w[j]=Vector2(Math::halfptr_to_float(&v[0]),Math::halfptr_to_float(&v[1])); + } + } else { + + PoolVector<Vector2>::Write w = arr.write(); + + for(int j=0;j<p_vertex_len;j++) { + + const float *v = (const float*)&r[j*total_elem_size+offsets[i]]; + w[j]=Vector2(v[0],v[1]); + } + } + + ret[i]=arr; + + } break; + case VS::ARRAY_WEIGHTS: { + + PoolVector<float> arr; + arr.resize(p_vertex_len*4); + if (p_format&ARRAY_COMPRESS_WEIGHTS) { + PoolVector<float>::Write w = arr.write(); + + for(int j=0;j<p_vertex_len;j++) { + + const uint16_t *v = (const uint16_t*)&r[j*total_elem_size+offsets[i]]; + for(int k=0;k<4;k++) { + w[j*4+k]=float(v[k]/65535.0)*2.0-1.0; + } + } + } else { + + PoolVector<float>::Write w = arr.write(); + + for(int j=0;j<p_vertex_len;j++) { + const float *v = (const float*)&r[j*total_elem_size+offsets[i]]; + for(int k=0;k<4;k++) { + w[j*4+k]=v[k]; + } + } + + } + + ret[i]=arr; + + } break; + case VS::ARRAY_BONES: { + + PoolVector<int> arr; + arr.resize(p_vertex_len*4); + if (p_format&ARRAY_FLAG_USE_16_BIT_BONES) { + + PoolVector<int>::Write w = arr.write(); + + for(int j=0;j<p_vertex_len;j++) { + + const uint16_t *v = (const uint16_t*)&r[j*total_elem_size+offsets[i]]; + for(int k=0;k<4;k++) { + w[j*4+k]=v[k]; + } + } + } else { + + PoolVector<int>::Write w = arr.write(); + + for(int j=0;j<p_vertex_len;j++) { + const uint8_t *v = (const uint8_t*)&r[j*total_elem_size+offsets[i]]; + for(int k=0;k<4;k++) { + w[j*4+k]=v[k]; + } + } + + } + + ret[i]=arr; + + } break; + case VS::ARRAY_INDEX: { + /* determine wether using 16 or 32 bits indices */ + + PoolVector<uint8_t>::Read ir = p_index_data.read(); + + PoolVector<int> arr; + arr.resize(p_index_len); + if (p_vertex_len<(1<<16)) { + + PoolVector<int>::Write w = arr.write(); + + for(int j=0;j<p_index_len;j++) { + + const uint16_t *v = (const uint16_t*)&ir[j*2]; + w[j]=*v; + } + } else { + + PoolVector<int>::Write w = arr.write(); + + for(int j=0;j<p_index_len;j++) { + const int *v = (const int*)&ir[j*4]; + w[j]=*v; + } + + } + ret[i]=arr; + } break; + default: { + ERR_FAIL_V( ret ); + } + } + } + + return ret; +} + +Array VisualServer::mesh_surface_get_arrays(RID p_mesh,int p_surface) const { + + PoolVector<uint8_t> vertex_data = mesh_surface_get_array(p_mesh,p_surface); + ERR_FAIL_COND_V(vertex_data.size()==0,Array()); + int vertex_len = mesh_surface_get_array_len(p_mesh,p_surface); + + PoolVector<uint8_t> index_data = mesh_surface_get_index_array(p_mesh,p_surface); + int index_len = mesh_surface_get_array_index_len(p_mesh,p_surface); + + uint32_t format = mesh_surface_get_format(p_mesh,p_surface); + + + return _get_array_from_surface(format,vertex_data,vertex_len,index_data,index_len); + +} + +void VisualServer::_bind_methods() { + + + ClassDB::bind_method(_MD("texture_create"),&VisualServer::texture_create); + ClassDB::bind_method(_MD("texture_create_from_image"),&VisualServer::texture_create_from_image,DEFVAL( TEXTURE_FLAGS_DEFAULT ) ); + //ClassDB::bind_method(_MD("texture_allocate"),&VisualServer::texture_allocate,DEFVAL( TEXTURE_FLAGS_DEFAULT ) ); + //ClassDB::bind_method(_MD("texture_set_data"),&VisualServer::texture_blit_rect,DEFVAL( CUBEMAP_LEFT ) ); + //ClassDB::bind_method(_MD("texture_get_rect"),&VisualServer::texture_get_rect ); + ClassDB::bind_method(_MD("texture_set_flags"),&VisualServer::texture_set_flags ); + ClassDB::bind_method(_MD("texture_get_flags"),&VisualServer::texture_get_flags ); + ClassDB::bind_method(_MD("texture_get_width"),&VisualServer::texture_get_width ); + ClassDB::bind_method(_MD("texture_get_height"),&VisualServer::texture_get_height ); + + ClassDB::bind_method(_MD("texture_set_shrink_all_x2_on_set_data","shrink"),&VisualServer::texture_set_shrink_all_x2_on_set_data ); + + + - camera_set_orthogonal(p_camera,p_size,p_z_near,p_z_far); } -void VisualServer::_viewport_set_rect(RID p_viewport,const Rect2& p_rect) { +void VisualServer::_canvas_item_add_style_box(RID p_item, const Rect2& p_rect, const Rect2& p_source, RID p_texture,const Vector<float>& p_margins, const Color& p_modulate) { - ViewportRect r; - r.x=p_rect.pos.x; - r.y=p_rect.pos.y; - r.width=p_rect.size.x; - r.height=p_rect.size.y; - viewport_set_rect(p_viewport,r); + ERR_FAIL_COND(p_margins.size()!=4); + //canvas_item_add_style_box(p_item,p_rect,p_source,p_texture,Vector2(p_margins[0],p_margins[1]),Vector2(p_margins[2],p_margins[3]),true,p_modulate); } -Rect2 VisualServer::_viewport_get_rect(RID p_viewport) const { - ViewportRect r=viewport_get_rect(p_viewport); - return Rect2(r.x,r.y,r.width,r.height); +void VisualServer::_camera_set_orthogonal(RID p_camera,float p_size,float p_z_near,float p_z_far) { + + camera_set_orthogonal(p_camera,p_size,p_z_near,p_z_far); } @@ -740,8 +1601,8 @@ Rect2 VisualServer::_viewport_get_rect(RID p_viewport) const { void VisualServer::mesh_add_surface_from_mesh_data( RID p_mesh, const Geometry::MeshData& p_mesh_data) { #if 1 - DVector<Vector3> vertices; - DVector<Vector3> normals; + PoolVector<Vector3> vertices; + PoolVector<Vector3> normals; for (int i=0;i<p_mesh_data.faces.size();i++) { @@ -763,12 +1624,12 @@ void VisualServer::mesh_add_surface_from_mesh_data( RID p_mesh, const Geometry:: d.resize(VS::ARRAY_MAX); d[ARRAY_VERTEX]=vertices; d[ARRAY_NORMAL]=normals; - mesh_add_surface(p_mesh,PRIMITIVE_TRIANGLES, d); + mesh_add_surface_from_arrays(p_mesh,PRIMITIVE_TRIANGLES, d); #else - DVector<Vector3> vertices; + PoolVector<Vector3> vertices; @@ -791,7 +1652,7 @@ void VisualServer::mesh_add_surface_from_mesh_data( RID p_mesh, const Geometry:: } -void VisualServer::mesh_add_surface_from_planes( RID p_mesh, const DVector<Plane>& p_planes) { +void VisualServer::mesh_add_surface_from_planes( RID p_mesh, const PoolVector<Plane>& p_planes) { Geometry::MeshData mdata = Geometry::build_convex_mesh(p_planes); @@ -799,6 +1660,10 @@ void VisualServer::mesh_add_surface_from_planes( RID p_mesh, const DVector<Plane } +void VisualServer::immediate_vertex_2d(RID p_immediate,const Vector2& p_vertex) { + immediate_vertex(p_immediate,Vector3(p_vertex.x,p_vertex.y,0)); +} + RID VisualServer::instance_create2(RID p_base, RID p_scenario) { RID instance = instance_create(); @@ -812,9 +1677,6 @@ VisualServer::VisualServer() { // ERR_FAIL_COND(singleton); singleton=this; - mm_policy=GLOBAL_DEF("render/mipmap_policy",0); - if (mm_policy<0 || mm_policy>2) - mm_policy=0; } diff --git a/servers/visual_server.h b/servers/visual_server.h index 844da2d245..3e7240af6f 100644 --- a/servers/visual_server.h +++ b/servers/visual_server.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -42,17 +42,17 @@ */ class VisualServer : public Object { - OBJ_TYPE( VisualServer, Object ); + GDCLASS( VisualServer, Object ); static VisualServer *singleton; int mm_policy; - DVector<String> _shader_get_param_list(RID p_shader) const; + PoolVector<String> _shader_get_param_list(RID p_shader) const; void _camera_set_orthogonal(RID p_camera,float p_size,float p_z_near,float p_z_far); - void _viewport_set_rect(RID p_viewport,const Rect2& p_rect); - Rect2 _viewport_get_rect(RID p_viewport) const; void _canvas_item_add_style_box(RID p_item, const Rect2& p_rect, const Rect2& p_source, RID p_texture,const Vector<float>& p_margins, const Color& p_modulate=Color(1,1,1)); + Array _get_array_from_surface(uint32_t p_format,PoolVector<uint8_t> p_vertex_data,int p_vertex_len,PoolVector<uint8_t> p_index_data,int p_index_len) const; + protected: RID _make_test_cube(); void _free_internal_rids(); @@ -61,6 +61,9 @@ protected: RID test_material; RID material_2d[16]; + + Error _surface_set_data(Array p_arrays,uint32_t p_format,uint32_t *p_offsets,uint32_t p_stride,PoolVector<uint8_t> &r_vertex_array,int p_vertex_array_len,PoolVector<uint8_t> &r_index_array,int p_index_array_len,Rect3 &r_aabb,Vector<Rect3> r_bone_aabb); + static VisualServer* (*create_func)(); static void _bind_methods(); public: @@ -68,28 +71,16 @@ public: static VisualServer *get_singleton(); static VisualServer *create(); - enum MipMapPolicy { - - MIPMAPS_ENABLED, - MIPMAPS_ENABLED_FOR_PO2, - MIPMAPS_DISABLED - }; - - - virtual void set_mipmap_policy(MipMapPolicy p_policy); - virtual MipMapPolicy get_mipmap_policy() const; - enum { NO_INDEX_ARRAY=-1, - CUSTOM_ARRAY_SIZE=8, ARRAY_WEIGHTS_SIZE=4, - MAX_PARTICLE_COLOR_PHASES=4, - MAX_PARTICLE_ATTRACTORS=4, CANVAS_ITEM_Z_MIN=-4096, CANVAS_ITEM_Z_MAX=4096, + MAX_GLOW_LEVELS=7, + @@ -106,7 +97,7 @@ public: TEXTURE_FLAG_CONVERT_TO_LINEAR=16, TEXTURE_FLAG_MIRRORED_REPEAT=32, /// Repeat texture, with alternate sections mirrored TEXTURE_FLAG_CUBEMAP=2048, - TEXTURE_FLAG_VIDEO_SURFACE=4096, + TEXTURE_FLAG_USED_FOR_STREAMING=4096, TEXTURE_FLAGS_DEFAULT=TEXTURE_FLAG_REPEAT|TEXTURE_FLAG_MIPMAPS|TEXTURE_FLAG_FILTER }; @@ -132,8 +123,6 @@ public: virtual uint32_t texture_get_width(RID p_texture) const=0; virtual uint32_t texture_get_height(RID p_texture) const=0; virtual void texture_set_size_override(RID p_texture,int p_width, int p_height)=0; - virtual bool texture_can_stream(RID p_texture) const=0; - virtual void texture_set_reload_hook(RID p_texture,ObjectID p_owner,const StringName& p_function) const=0; virtual void texture_set_path(RID p_texture,const String& p_path)=0; virtual String texture_get_path(RID p_texture) const=0; @@ -150,26 +139,31 @@ public: virtual void texture_debug_usage(List<TextureInfo> *r_info)=0; + virtual void textures_keep_original(bool p_enable)=0; + + /* SKYBOX API */ + + virtual RID skybox_create()=0; + virtual void skybox_set_texture(RID p_skybox,RID p_cube_map,int p_radiance_size)=0; /* SHADER API */ enum ShaderMode { - SHADER_MATERIAL, + SHADER_SPATIAL, SHADER_CANVAS_ITEM, - SHADER_POST_PROCESS, + SHADER_PARTICLES, + SHADER_MAX }; - virtual RID shader_create(ShaderMode p_mode=SHADER_MATERIAL)=0; + virtual RID shader_create(ShaderMode p_mode=SHADER_SPATIAL)=0; virtual void shader_set_mode(RID p_shader,ShaderMode p_mode)=0; virtual ShaderMode shader_get_mode(RID p_shader) const=0; - virtual void shader_set_code(RID p_shader, const String& p_vertex, const String& p_fragment,const String& p_light, int p_vertex_ofs=0,int p_fragment_ofs=0,int p_light_ofs=0)=0; - virtual String shader_get_fragment_code(RID p_shader) const=0; - virtual String shader_get_vertex_code(RID p_shader) const=0; - virtual String shader_get_light_code(RID p_shader) const=0; + virtual void shader_set_code(RID p_shader, const String& p_code)=0; + virtual String shader_get_code(RID p_shader) const=0; virtual void shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list) const=0; virtual void shader_set_default_texture_param(RID p_shader, const StringName& p_name, RID p_texture)=0; @@ -186,113 +180,7 @@ public: virtual void material_set_param(RID p_material, const StringName& p_param, const Variant& p_value)=0; virtual Variant material_get_param(RID p_material, const StringName& p_param) const=0; - enum MaterialFlag { - MATERIAL_FLAG_VISIBLE, - MATERIAL_FLAG_DOUBLE_SIDED, - MATERIAL_FLAG_INVERT_FACES, ///< Invert front/back of the object - MATERIAL_FLAG_UNSHADED, - MATERIAL_FLAG_ONTOP, - MATERIAL_FLAG_LIGHTMAP_ON_UV2, - MATERIAL_FLAG_COLOR_ARRAY_SRGB, - MATERIAL_FLAG_MAX, - }; - - virtual void material_set_flag(RID p_material, MaterialFlag p_flag,bool p_enabled)=0; - virtual bool material_get_flag(RID p_material,MaterialFlag p_flag) const=0; - - enum MaterialDepthDrawMode { - MATERIAL_DEPTH_DRAW_ALWAYS, - MATERIAL_DEPTH_DRAW_OPAQUE_ONLY, - MATERIAL_DEPTH_DRAW_OPAQUE_PRE_PASS_ALPHA, - MATERIAL_DEPTH_DRAW_NEVER - }; - - virtual void material_set_depth_draw_mode(RID p_material, MaterialDepthDrawMode p_mode)=0; - virtual MaterialDepthDrawMode material_get_depth_draw_mode(RID p_material) const=0; - - enum MaterialBlendMode { - MATERIAL_BLEND_MODE_MIX, //default - MATERIAL_BLEND_MODE_ADD, - MATERIAL_BLEND_MODE_SUB, - MATERIAL_BLEND_MODE_MUL, - MATERIAL_BLEND_MODE_PREMULT_ALPHA - }; - - - virtual void material_set_blend_mode(RID p_material,MaterialBlendMode p_mode)=0; - virtual MaterialBlendMode material_get_blend_mode(RID p_material) const=0; - - virtual void material_set_line_width(RID p_material,float p_line_width)=0; - virtual float material_get_line_width(RID p_material) const=0; - - - //fixed material api - - virtual RID fixed_material_create()=0; - - enum FixedMaterialParam { - - FIXED_MATERIAL_PARAM_DIFFUSE, - FIXED_MATERIAL_PARAM_DETAIL, - FIXED_MATERIAL_PARAM_SPECULAR, - FIXED_MATERIAL_PARAM_EMISSION, - FIXED_MATERIAL_PARAM_SPECULAR_EXP, - FIXED_MATERIAL_PARAM_GLOW, - FIXED_MATERIAL_PARAM_NORMAL, - FIXED_MATERIAL_PARAM_SHADE_PARAM, - FIXED_MATERIAL_PARAM_MAX - }; - - enum FixedMaterialTexCoordMode { - - FIXED_MATERIAL_TEXCOORD_UV, - FIXED_MATERIAL_TEXCOORD_UV_TRANSFORM, - FIXED_MATERIAL_TEXCOORD_UV2, - FIXED_MATERIAL_TEXCOORD_SPHERE - }; - - enum FixedMaterialFlags { - - FIXED_MATERIAL_FLAG_USE_ALPHA, - FIXED_MATERIAL_FLAG_USE_COLOR_ARRAY, - FIXED_MATERIAL_FLAG_USE_POINT_SIZE, - FIXED_MATERIAL_FLAG_DISCARD_ALPHA, - FIXED_MATERIAL_FLAG_USE_XY_NORMALMAP, - FIXED_MATERIAL_FLAG_MAX, - }; - - - virtual void fixed_material_set_flag(RID p_material, FixedMaterialFlags p_flag, bool p_enabled)=0; - virtual bool fixed_material_get_flag(RID p_material, FixedMaterialFlags p_flag) const=0; - - virtual void fixed_material_set_param(RID p_material, FixedMaterialParam p_parameter, const Variant& p_value)=0; - virtual Variant fixed_material_get_param(RID p_material,FixedMaterialParam p_parameter) const=0; - - virtual void fixed_material_set_texture(RID p_material,FixedMaterialParam p_parameter, RID p_texture)=0; - virtual RID fixed_material_get_texture(RID p_material,FixedMaterialParam p_parameter) const=0; - - - enum FixedMaterialLightShader { - - FIXED_MATERIAL_LIGHT_SHADER_LAMBERT, - FIXED_MATERIAL_LIGHT_SHADER_WRAP, - FIXED_MATERIAL_LIGHT_SHADER_VELVET, - FIXED_MATERIAL_LIGHT_SHADER_TOON, - - }; - - - virtual void fixed_material_set_light_shader(RID p_material,FixedMaterialLightShader p_shader)=0; - virtual FixedMaterialLightShader fixed_material_get_light_shader(RID p_material) const=0; - - virtual void fixed_material_set_texcoord_mode(RID p_material,FixedMaterialParam p_parameter, FixedMaterialTexCoordMode p_mode)=0; - virtual FixedMaterialTexCoordMode fixed_material_get_texcoord_mode(RID p_material,FixedMaterialParam p_parameter) const=0; - - virtual void fixed_material_set_uv_transform(RID p_material,const Transform& p_transform)=0; - virtual Transform fixed_material_get_uv_transform(RID p_material) const=0; - - virtual void fixed_material_set_point_size(RID p_material,float p_size)=0; - virtual float fixed_material_get_point_size(RID p_material) const=0; + virtual void material_set_line_width(RID p_material, float p_width)=0; /* MESH API */ @@ -321,8 +209,26 @@ public: ARRAY_FORMAT_BONES=1<<ARRAY_BONES, ARRAY_FORMAT_WEIGHTS=1<<ARRAY_WEIGHTS, ARRAY_FORMAT_INDEX=1<<ARRAY_INDEX, + + ARRAY_COMPRESS_BASE=(ARRAY_INDEX+1), + ARRAY_COMPRESS_VERTEX=1<<(ARRAY_VERTEX+ARRAY_COMPRESS_BASE), // mandatory + ARRAY_COMPRESS_NORMAL=1<<(ARRAY_NORMAL+ARRAY_COMPRESS_BASE), + ARRAY_COMPRESS_TANGENT=1<<(ARRAY_TANGENT+ARRAY_COMPRESS_BASE), + ARRAY_COMPRESS_COLOR=1<<(ARRAY_COLOR+ARRAY_COMPRESS_BASE), + ARRAY_COMPRESS_TEX_UV=1<<(ARRAY_TEX_UV+ARRAY_COMPRESS_BASE), + ARRAY_COMPRESS_TEX_UV2=1<<(ARRAY_TEX_UV2+ARRAY_COMPRESS_BASE), + ARRAY_COMPRESS_BONES=1<<(ARRAY_BONES+ARRAY_COMPRESS_BASE), + ARRAY_COMPRESS_WEIGHTS=1<<(ARRAY_WEIGHTS+ARRAY_COMPRESS_BASE), + ARRAY_COMPRESS_INDEX=1<<(ARRAY_INDEX+ARRAY_COMPRESS_BASE), + + ARRAY_FLAG_USE_2D_VERTICES=ARRAY_COMPRESS_INDEX<<1, + ARRAY_FLAG_USE_16_BIT_BONES=ARRAY_COMPRESS_INDEX<<2, + + ARRAY_COMPRESS_DEFAULT=ARRAY_COMPRESS_VERTEX|ARRAY_COMPRESS_NORMAL|ARRAY_COMPRESS_TANGENT|ARRAY_COMPRESS_COLOR|ARRAY_COMPRESS_TEX_UV|ARRAY_COMPRESS_TEX_UV2|ARRAY_COMPRESS_WEIGHTS + }; + enum PrimitiveType { PRIMITIVE_POINTS=0, PRIMITIVE_LINES=1, @@ -336,12 +242,10 @@ public: virtual RID mesh_create()=0; - virtual void mesh_add_surface(RID p_mesh,PrimitiveType p_primitive,const Array& p_arrays,const Array& p_blend_shapes=Array(),bool p_alpha_sort=false)=0; - virtual Array mesh_get_surface_arrays(RID p_mesh,int p_surface) const=0; - virtual Array mesh_get_surface_morph_arrays(RID p_mesh,int p_surface) const=0; + virtual void mesh_add_surface_from_arrays(RID p_mesh,PrimitiveType p_primitive,const Array& p_arrays,const Array& p_blend_shapes=Array(),uint32_t p_compress_format=ARRAY_COMPRESS_DEFAULT); + virtual void mesh_add_surface(RID p_mesh,uint32_t p_format,PrimitiveType p_primitive,const PoolVector<uint8_t>& p_array,int p_vertex_count,const PoolVector<uint8_t>& p_index_array,int p_index_count,const Rect3& p_aabb,const Vector<PoolVector<uint8_t> >& p_blend_shapes=Vector<PoolVector<uint8_t> >(),const Vector<Rect3>& p_bone_aabbs=Vector<Rect3>())=0; - virtual void mesh_add_custom_surface(RID p_mesh,const Variant& p_dat)=0; //this is used by each platform in a different way virtual void mesh_set_morph_target_count(RID p_mesh,int p_amount)=0; virtual int mesh_get_morph_target_count(RID p_mesh) const=0; @@ -353,48 +257,73 @@ public: virtual void mesh_set_morph_target_mode(RID p_mesh,MorphTargetMode p_mode)=0; virtual MorphTargetMode mesh_get_morph_target_mode(RID p_mesh) const=0; - virtual void mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material,bool p_owned=false)=0; + virtual void mesh_surface_set_material(RID p_mesh, int p_surface, RID p_material)=0; virtual RID mesh_surface_get_material(RID p_mesh, int p_surface) const=0; virtual int mesh_surface_get_array_len(RID p_mesh, int p_surface) const=0; virtual int mesh_surface_get_array_index_len(RID p_mesh, int p_surface) const=0; + + virtual PoolVector<uint8_t> mesh_surface_get_array(RID p_mesh, int p_surface) const=0; + virtual PoolVector<uint8_t> mesh_surface_get_index_array(RID p_mesh, int p_surface) const=0; + + virtual Array mesh_surface_get_arrays(RID p_mesh,int p_surface) const; + virtual uint32_t mesh_surface_get_format(RID p_mesh, int p_surface) const=0; virtual PrimitiveType mesh_surface_get_primitive_type(RID p_mesh, int p_surface) const=0; + virtual Rect3 mesh_surface_get_aabb(RID p_mesh, int p_surface) const=0; + virtual Vector<PoolVector<uint8_t> > mesh_surface_get_blend_shapes(RID p_mesh, int p_surface) const=0; + virtual Vector<Rect3> mesh_surface_get_skeleton_aabb(RID p_mesh, int p_surface) const=0; + virtual void mesh_remove_surface(RID p_mesh,int p_index)=0; virtual int mesh_get_surface_count(RID p_mesh) const=0; - virtual void mesh_set_custom_aabb(RID p_mesh,const AABB& p_aabb)=0; - virtual AABB mesh_get_custom_aabb(RID p_mesh) const=0; + virtual void mesh_set_custom_aabb(RID p_mesh,const Rect3& p_aabb)=0; + virtual Rect3 mesh_get_custom_aabb(RID p_mesh) const=0; virtual void mesh_clear(RID p_mesh)=0; /* MULTIMESH API */ + virtual RID multimesh_create()=0; - virtual void multimesh_set_instance_count(RID p_multimesh,int p_count)=0; + enum MultimeshTransformFormat { + MULTIMESH_TRANSFORM_2D, + MULTIMESH_TRANSFORM_3D, + }; + + enum MultimeshColorFormat { + MULTIMESH_COLOR_NONE, + MULTIMESH_COLOR_8BIT, + MULTIMESH_COLOR_FLOAT, + }; + + virtual void multimesh_allocate(RID p_multimesh,int p_instances,MultimeshTransformFormat p_transform_format,MultimeshColorFormat p_color_format)=0; virtual int multimesh_get_instance_count(RID p_multimesh) const=0; virtual void multimesh_set_mesh(RID p_multimesh,RID p_mesh)=0; - virtual void multimesh_set_aabb(RID p_multimesh,const AABB& p_aabb)=0; virtual void multimesh_instance_set_transform(RID p_multimesh,int p_index,const Transform& p_transform)=0; + virtual void multimesh_instance_set_transform_2d(RID p_multimesh,int p_index,const Transform2D& p_transform)=0; virtual void multimesh_instance_set_color(RID p_multimesh,int p_index,const Color& p_color)=0; virtual RID multimesh_get_mesh(RID p_multimesh) const=0; - virtual AABB multimesh_get_aabb(RID p_multimesh,const AABB& p_aabb) const=0;; + virtual Rect3 multimesh_get_aabb(RID p_multimesh) const=0; virtual Transform multimesh_instance_get_transform(RID p_multimesh,int p_index) const=0; + virtual Transform2D multimesh_instance_get_transform_2d(RID p_multimesh,int p_index) const=0; virtual Color multimesh_instance_get_color(RID p_multimesh,int p_index) const=0; virtual void multimesh_set_visible_instances(RID p_multimesh,int p_visible)=0; virtual int multimesh_get_visible_instances(RID p_multimesh) const=0; + /* IMMEDIATE API */ virtual RID immediate_create()=0; virtual void immediate_begin(RID p_immediate,PrimitiveType p_rimitive,RID p_texture=RID())=0; virtual void immediate_vertex(RID p_immediate,const Vector3& p_vertex)=0; + virtual void immediate_vertex_2d(RID p_immediate,const Vector2& p_vertex); virtual void immediate_normal(RID p_immediate,const Vector3& p_normal)=0; virtual void immediate_tangent(RID p_immediate,const Plane& p_tangent)=0; virtual void immediate_color(RID p_immediate,const Color& p_color)=0; @@ -405,82 +334,15 @@ public: virtual void immediate_set_material(RID p_immediate,RID p_material)=0; virtual RID immediate_get_material(RID p_immediate) const=0; + /* SKELETON API */ - /* PARTICLES API */ - - virtual RID particles_create()=0; - - enum ParticleVariable { - PARTICLE_LIFETIME, - PARTICLE_SPREAD, - PARTICLE_GRAVITY, - PARTICLE_LINEAR_VELOCITY, - PARTICLE_ANGULAR_VELOCITY, - PARTICLE_LINEAR_ACCELERATION, - PARTICLE_RADIAL_ACCELERATION, - PARTICLE_TANGENTIAL_ACCELERATION, - PARTICLE_DAMPING, - PARTICLE_INITIAL_SIZE, - PARTICLE_FINAL_SIZE, - PARTICLE_INITIAL_ANGLE, - PARTICLE_HEIGHT, - PARTICLE_HEIGHT_SPEED_SCALE, - PARTICLE_VAR_MAX - }; - - virtual void particles_set_amount(RID p_particles, int p_amount)=0; - virtual int particles_get_amount(RID p_particles) const=0; - - virtual void particles_set_emitting(RID p_particles, bool p_emitting)=0; - virtual bool particles_is_emitting(RID p_particles) const=0; - - virtual void particles_set_visibility_aabb(RID p_particles, const AABB& p_visibility)=0; - virtual AABB particles_get_visibility_aabb(RID p_particles) const=0; - - virtual void particles_set_emission_half_extents(RID p_particles, const Vector3& p_half_extents)=0; - virtual Vector3 particles_get_emission_half_extents(RID p_particles) const=0; - - virtual void particles_set_emission_base_velocity(RID p_particles, const Vector3& p_base_velocity)=0; - virtual Vector3 particles_get_emission_base_velocity(RID p_particles) const=0; - - virtual void particles_set_emission_points(RID p_particles, const DVector<Vector3>& p_points)=0; - virtual DVector<Vector3> particles_get_emission_points(RID p_particles) const=0; - - virtual void particles_set_gravity_normal(RID p_particles, const Vector3& p_normal)=0; - virtual Vector3 particles_get_gravity_normal(RID p_particles) const=0; - - virtual void particles_set_variable(RID p_particles, ParticleVariable p_variable,float p_value)=0; - virtual float particles_get_variable(RID p_particles, ParticleVariable p_variable) const=0; - - virtual void particles_set_randomness(RID p_particles, ParticleVariable p_variable,float p_randomness)=0; - virtual float particles_get_randomness(RID p_particles, ParticleVariable p_variable) const=0; - - virtual void particles_set_color_phases(RID p_particles, int p_phases)=0; - virtual int particles_get_color_phases(RID p_particles) const=0; - - virtual void particles_set_color_phase_pos(RID p_particles, int p_phase, float p_pos)=0; - virtual float particles_get_color_phase_pos(RID p_particles, int p_phase) const=0; - - virtual void particles_set_color_phase_color(RID p_particles, int p_phase, const Color& p_color)=0; - virtual Color particles_get_color_phase_color(RID p_particles, int p_phase) const=0; - - virtual void particles_set_attractors(RID p_particles, int p_attractors)=0; - virtual int particles_get_attractors(RID p_particles) const=0; - - virtual void particles_set_attractor_pos(RID p_particles, int p_attractor, const Vector3& p_pos)=0; - virtual Vector3 particles_get_attractor_pos(RID p_particles,int p_attractor) const=0; - - virtual void particles_set_attractor_strength(RID p_particles, int p_attractor, float p_force)=0; - virtual float particles_get_attractor_strength(RID p_particles,int p_attractor) const=0; - - virtual void particles_set_material(RID p_particles, RID p_material,bool p_owned=false)=0; - virtual RID particles_get_material(RID p_particles) const=0; - - virtual void particles_set_height_from_velocity(RID p_particles, bool p_enable)=0; - virtual bool particles_has_height_from_velocity(RID p_particles) const=0; - - virtual void particles_set_use_local_coordinates(RID p_particles, bool p_enable)=0; - virtual bool particles_is_using_local_coordinates(RID p_particles) const=0; + virtual RID skeleton_create()=0; + virtual void skeleton_allocate(RID p_skeleton,int p_bones,bool p_2d_skeleton=false)=0; + virtual int skeleton_get_bone_count(RID p_skeleton) const=0; + virtual void skeleton_bone_set_transform(RID p_skeleton,int p_bone, const Transform& p_transform)=0; + virtual Transform skeleton_bone_get_transform(RID p_skeleton,int p_bone) const=0; + virtual void skeleton_bone_set_transform_2d(RID p_skeleton,int p_bone, const Transform2D& p_transform)=0; + virtual Transform2D skeleton_bone_get_transform_2d(RID p_skeleton,int p_bone)const =0; /* Light API */ @@ -490,99 +352,89 @@ public: LIGHT_SPOT }; - enum LightColor { - LIGHT_COLOR_DIFFUSE, - LIGHT_COLOR_SPECULAR - }; - enum LightParam { - LIGHT_PARAM_SPOT_ATTENUATION, - LIGHT_PARAM_SPOT_ANGLE, - LIGHT_PARAM_RADIUS, LIGHT_PARAM_ENERGY, + LIGHT_PARAM_SPECULAR, + LIGHT_PARAM_RANGE, LIGHT_PARAM_ATTENUATION, - LIGHT_PARAM_SHADOW_DARKENING, - LIGHT_PARAM_SHADOW_Z_OFFSET, - LIGHT_PARAM_SHADOW_Z_SLOPE_SCALE, - LIGHT_PARAM_SHADOW_ESM_MULTIPLIER, - LIGHT_PARAM_SHADOW_BLUR_PASSES, + LIGHT_PARAM_SPOT_ANGLE, + LIGHT_PARAM_SPOT_ATTENUATION, + LIGHT_PARAM_SHADOW_MAX_DISTANCE, + LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET, + LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET, + LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET, + LIGHT_PARAM_SHADOW_NORMAL_BIAS, + LIGHT_PARAM_SHADOW_BIAS, + LIGHT_PARAM_SHADOW_BIAS_SPLIT_SCALE, LIGHT_PARAM_MAX }; virtual RID light_create(LightType p_type)=0; - virtual LightType light_get_type(RID p_light) const=0; - - virtual void light_set_color(RID p_light,LightColor p_type, const Color& p_color)=0; - virtual Color light_get_color(RID p_light,LightColor p_type) const=0; + virtual void light_set_color(RID p_light,const Color& p_color)=0; + virtual void light_set_param(RID p_light,LightParam p_param,float p_value)=0; virtual void light_set_shadow(RID p_light,bool p_enabled)=0; - virtual bool light_has_shadow(RID p_light) const=0; - - virtual void light_set_volumetric(RID p_light,bool p_enabled)=0; - virtual bool light_is_volumetric(RID p_light) const=0; - + virtual void light_set_shadow_color(RID p_light,const Color& p_color)=0; virtual void light_set_projector(RID p_light,RID p_texture)=0; - virtual RID light_get_projector(RID p_light) const=0; - - virtual void light_set_param(RID p_light, LightParam p_var, float p_value)=0; - virtual float light_get_param(RID p_light, LightParam p_var) const=0; - - enum LightOp { - - LIGHT_OPERATOR_ADD, - LIGHT_OPERATOR_SUB - }; - - virtual void light_set_operator(RID p_light,LightOp p_op)=0; - virtual LightOp light_get_operator(RID p_light) const=0; + virtual void light_set_negative(RID p_light,bool p_enable)=0; + virtual void light_set_cull_mask(RID p_light,uint32_t p_mask)=0; // omni light enum LightOmniShadowMode { - LIGHT_OMNI_SHADOW_DEFAULT, LIGHT_OMNI_SHADOW_DUAL_PARABOLOID, - LIGHT_OMNI_SHADOW_CUBEMAP + LIGHT_OMNI_SHADOW_CUBE, }; virtual void light_omni_set_shadow_mode(RID p_light,LightOmniShadowMode p_mode)=0; - virtual LightOmniShadowMode light_omni_get_shadow_mode(RID p_light) const=0; + + // omni light + enum LightOmniShadowDetail { + LIGHT_OMNI_SHADOW_DETAIL_VERTICAL, + LIGHT_OMNI_SHADOW_DETAIL_HORIZONTAL + }; + + virtual void light_omni_set_shadow_detail(RID p_light,LightOmniShadowDetail p_detail)=0; // directional light enum LightDirectionalShadowMode { LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL, - LIGHT_DIRECTIONAL_SHADOW_PERSPECTIVE, LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS, LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS }; virtual void light_directional_set_shadow_mode(RID p_light,LightDirectionalShadowMode p_mode)=0; - virtual LightDirectionalShadowMode light_directional_get_shadow_mode(RID p_light) const=0; + virtual void light_directional_set_blend_splits(RID p_light,bool p_enable)=0; + + /* PROBE API */ - enum LightDirectionalShadowParam { + virtual RID reflection_probe_create()=0; - LIGHT_DIRECTIONAL_SHADOW_PARAM_MAX_DISTANCE, - LIGHT_DIRECTIONAL_SHADOW_PARAM_PSSM_SPLIT_WEIGHT, - LIGHT_DIRECTIONAL_SHADOW_PARAM_PSSM_ZOFFSET_SCALE, + enum ReflectionProbeUpdateMode { + REFLECTION_PROBE_UPDATE_ONCE, + REFLECTION_PROBE_UPDATE_ALWAYS, }; - virtual void light_directional_set_shadow_param(RID p_light,LightDirectionalShadowParam p_param, float p_value)=0; - virtual float light_directional_get_shadow_param(RID p_light,LightDirectionalShadowParam p_param) const=0; - //@TODO fallof model and all that stuff + virtual void reflection_probe_set_update_mode(RID p_probe, ReflectionProbeUpdateMode p_mode)=0; + virtual void reflection_probe_set_intensity(RID p_probe, float p_intensity)=0; + virtual void reflection_probe_set_interior_ambient(RID p_probe, const Color& p_color)=0; + virtual void reflection_probe_set_interior_ambient_energy(RID p_probe, float p_energy)=0; + virtual void reflection_probe_set_interior_ambient_probe_contribution(RID p_probe, float p_contrib)=0; + virtual void reflection_probe_set_max_distance(RID p_probe, float p_distance)=0; + virtual void reflection_probe_set_extents(RID p_probe, const Vector3& p_extents)=0; + virtual void reflection_probe_set_origin_offset(RID p_probe, const Vector3& p_offset)=0; + virtual void reflection_probe_set_as_interior(RID p_probe, bool p_enable)=0; + virtual void reflection_probe_set_enable_box_projection(RID p_probe, bool p_enable)=0; + virtual void reflection_probe_set_enable_shadows(RID p_probe, bool p_enable)=0; + virtual void reflection_probe_set_cull_mask(RID p_probe, uint32_t p_layers)=0; - /* SKELETON API */ - - virtual RID skeleton_create()=0; - virtual void skeleton_resize(RID p_skeleton,int p_bones)=0; - virtual int skeleton_get_bone_count(RID p_skeleton) const=0; - virtual void skeleton_bone_set_transform(RID p_skeleton,int p_bone, const Transform& p_transform)=0; - virtual Transform skeleton_bone_get_transform(RID p_skeleton,int p_bone)=0; /* ROOM API */ virtual RID room_create()=0; - virtual void room_set_bounds(RID p_room, const BSP_Tree& p_bounds)=0; - virtual BSP_Tree room_get_bounds(RID p_room) const=0; + virtual void room_add_bounds(RID p_room, const PoolVector<Vector2>& p_convex_polygon,float p_height,const Transform& p_transform)=0; + virtual void room_clear_bounds(RID p_room)=0; /* PORTAL API */ @@ -591,69 +443,85 @@ public: virtual RID portal_create()=0; virtual void portal_set_shape(RID p_portal, const Vector<Point2>& p_shape)=0; - virtual Vector<Point2> portal_get_shape(RID p_portal) const=0; virtual void portal_set_enabled(RID p_portal, bool p_enabled)=0; - virtual bool portal_is_enabled(RID p_portal) const=0; virtual void portal_set_disable_distance(RID p_portal, float p_distance)=0; - virtual float portal_get_disable_distance(RID p_portal) const=0; virtual void portal_set_disabled_color(RID p_portal, const Color& p_color)=0; - virtual Color portal_get_disabled_color(RID p_portal) const=0; - virtual void portal_set_connect_range(RID p_portal, float p_range) =0; - virtual float portal_get_connect_range(RID p_portal) const =0; + /* GI PROBE API */ - /* BAKED LIGHT API */ + virtual RID gi_probe_create()=0; - virtual RID baked_light_create()=0; - enum BakedLightMode { - BAKED_LIGHT_OCTREE, - BAKED_LIGHT_LIGHTMAPS - }; + virtual void gi_probe_set_bounds(RID p_probe,const Rect3& p_bounds)=0; + virtual Rect3 gi_probe_get_bounds(RID p_probe) const=0; - virtual void baked_light_set_mode(RID p_baked_light,BakedLightMode p_mode)=0; - virtual BakedLightMode baked_light_get_mode(RID p_baked_light) const=0; + virtual void gi_probe_set_cell_size(RID p_probe,float p_range)=0; + virtual float gi_probe_get_cell_size(RID p_probe) const=0; - virtual void baked_light_set_octree(RID p_baked_light,const DVector<uint8_t> p_octree)=0; - virtual DVector<uint8_t> baked_light_get_octree(RID p_baked_light) const=0; + virtual void gi_probe_set_to_cell_xform(RID p_probe,const Transform& p_xform)=0; + virtual Transform gi_probe_get_to_cell_xform(RID p_probe) const=0; - virtual void baked_light_set_light(RID p_baked_light,const DVector<uint8_t> p_light)=0; - virtual DVector<uint8_t> baked_light_get_light(RID p_baked_light) const=0; + virtual void gi_probe_set_dynamic_data(RID p_probe,const PoolVector<int>& p_data)=0; + virtual PoolVector<int> gi_probe_get_dynamic_data(RID p_probe) const=0; - virtual void baked_light_set_sampler_octree(RID p_baked_light,const DVector<int> &p_sampler)=0; - virtual DVector<int> baked_light_get_sampler_octree(RID p_baked_light) const=0; + virtual void gi_probe_set_dynamic_range(RID p_probe,int p_range)=0; + virtual int gi_probe_get_dynamic_range(RID p_probe) const=0; - virtual void baked_light_set_lightmap_multiplier(RID p_baked_light,float p_multiplier)=0; - virtual float baked_light_get_lightmap_multiplier(RID p_baked_light) const=0; + virtual void gi_probe_set_energy(RID p_probe,float p_range)=0; + virtual float gi_probe_get_energy(RID p_probe) const=0; - virtual void baked_light_add_lightmap(RID p_baked_light,const RID p_texture,int p_id)=0; - virtual void baked_light_clear_lightmaps(RID p_baked_light)=0; + virtual void gi_probe_set_interior(RID p_probe,bool p_enable)=0; + virtual bool gi_probe_is_interior(RID p_probe) const=0; - virtual void baked_light_set_realtime_color_enabled(RID p_baked_light, const bool p_enabled)=0; - virtual bool baked_light_get_realtime_color_enabled(RID p_baked_light) const=0; + virtual void gi_probe_set_compress(RID p_probe,bool p_enable)=0; + virtual bool gi_probe_is_compressed(RID p_probe) const=0; - virtual void baked_light_set_realtime_color(RID p_baked_light, const Color& p_color)=0; - virtual Color baked_light_get_realtime_color(RID p_baked_light) const=0; + /* PARTICLES API */ + + virtual RID particles_create()=0; + + virtual void particles_set_emitting(RID p_particles,bool p_emitting)=0; + virtual void particles_set_amount(RID p_particles,int p_amount)=0; + virtual void particles_set_lifetime(RID p_particles,float p_lifetime)=0; + virtual void particles_set_pre_process_time(RID p_particles,float p_time)=0; + virtual void particles_set_explosiveness_ratio(RID p_particles,float p_ratio)=0; + virtual void particles_set_randomness_ratio(RID p_particles,float p_ratio)=0; + virtual void particles_set_custom_aabb(RID p_particles,const Rect3& p_aabb)=0; + virtual void particles_set_gravity(RID p_particles,const Vector3& p_gravity)=0; + virtual void particles_set_use_local_coordinates(RID p_particles,bool p_enable)=0; + virtual void particles_set_process_material(RID p_particles,RID p_material)=0; + + enum ParticlesEmissionShape { + PARTICLES_EMSSION_POINT, + PARTICLES_EMSSION_SPHERE, + PARTICLES_EMSSION_BOX, + PARTICLES_EMSSION_POINTS, + PARTICLES_EMSSION_SEGMENTS, + }; - virtual void baked_light_set_realtime_energy(RID p_baked_light, const float p_energy) = 0; - virtual float baked_light_get_realtime_energy(RID p_baked_light) const = 0; + virtual void particles_set_emission_shape(RID p_particles,ParticlesEmissionShape)=0; + virtual void particles_set_emission_sphere_radius(RID p_particles,float p_radius)=0; + virtual void particles_set_emission_box_extents(RID p_particles,const Vector3& p_extents)=0; + virtual void particles_set_emission_points(RID p_particles,const PoolVector<Vector3>& p_points)=0; - /* BAKED LIGHT SAMPLER */ + enum ParticlesDrawOrder { + PARTICLES_DRAW_ORDER_INDEX, + PARTICLES_DRAW_ORDER_LIFETIME, + PARTICLES_DRAW_ORDER_VIEW_DEPTH, + }; - virtual RID baked_light_sampler_create()=0; + virtual void particles_set_draw_order(RID p_particles,ParticlesDrawOrder p_order)=0; - enum BakedLightSamplerParam { - BAKED_LIGHT_SAMPLER_RADIUS, - BAKED_LIGHT_SAMPLER_STRENGTH, - BAKED_LIGHT_SAMPLER_ATTENUATION, - BAKED_LIGHT_SAMPLER_DETAIL_RATIO, - BAKED_LIGHT_SAMPLER_MAX + enum ParticlesDrawPassMode { + PARTICLES_DRAW_PASS_MODE_QUAD, + PARTICLES_DRAW_PASS_MODE_MESH }; - virtual void baked_light_sampler_set_param(RID p_baked_light_sampler,BakedLightSamplerParam p_param,float p_value)=0; - virtual float baked_light_sampler_get_param(RID p_baked_light_sampler,BakedLightSamplerParam p_param) const=0; - virtual void baked_light_sampler_set_resolution(RID p_baked_light_sampler,int p_resolution)=0; - virtual int baked_light_sampler_get_resolution(RID p_baked_light_sampler) const=0; + virtual void particles_set_draw_passes(RID p_particles,int p_count)=0; + virtual void particles_set_draw_pass_material(RID p_particles,int p_pass, RID p_material)=0; + virtual void particles_set_draw_pass_mesh(RID p_particles,int p_pass, RID p_mesh)=0; + + virtual Rect3 particles_get_current_aabb(RID p_particles)=0; /* CAMERA API */ @@ -661,96 +529,80 @@ public: virtual void camera_set_perspective(RID p_camera,float p_fovy_degrees, float p_z_near, float p_z_far)=0; virtual void camera_set_orthogonal(RID p_camera,float p_size, float p_z_near, float p_z_far)=0; virtual void camera_set_transform(RID p_camera,const Transform& p_transform)=0; - - virtual void camera_set_visible_layers(RID p_camera,uint32_t p_layers)=0; - virtual uint32_t camera_get_visible_layers(RID p_camera) const=0; - + virtual void camera_set_cull_mask(RID p_camera,uint32_t p_layers)=0; virtual void camera_set_environment(RID p_camera,RID p_env)=0; - virtual RID camera_get_environment(RID p_camera) const=0; - virtual void camera_set_use_vertical_aspect(RID p_camera,bool p_enable)=0; - virtual bool camera_is_using_vertical_aspect(RID p_camera,bool p_enable) const=0; /* - virtual void camera_add_layer(RID p_camera); - virtual void camera_layer_move_up(RID p_camera,int p_layer); - virtual void camera_layer_move_down(RID p_camera,int p_layer); - virtual void camera_layer_set_mask(RID p_camera,int p_layer,int p_mask); - virtual int camera_layer_get_mask(RID p_camera,int p_layer) const; - - enum CameraLayerFlag { - - FLAG_CLEAR_DEPTH, - FLAG_CLEAR_COLOR, - FLAG_IGNORE_FOG, + enum ParticlesCollisionMode { + PARTICLES_COLLISION_NONE, + PARTICLES_COLLISION_TEXTURE, + PARTICLES_COLLISION_CUBEMAP, }; - virtual void camera_layer_set_flag(RID p_camera,int p_layer,bool p_enable); - virtual bool camera_layer_get_flag(RID p_camera,int p_layer) const; + virtual void particles_set_collision(RID p_particles,ParticlesCollisionMode p_mode,const Transform&, p_xform,const RID p_depth_tex,const RID p_normal_tex)=0; */ - - - /* VIEWPORT API */ + /* VIEWPORT TARGET API */ virtual RID viewport_create()=0; - virtual void viewport_attach_to_screen(RID p_viewport,int p_screen=0)=0; + virtual void viewport_set_size(RID p_viewport,int p_width,int p_height)=0; + virtual void viewport_set_active(RID p_viewport,bool p_active)=0; + virtual void viewport_set_parent_viewport(RID p_viewport,RID p_parent_viewport)=0; + + virtual void viewport_attach_to_screen(RID p_viewport,const Rect2& p_rect=Rect2(),int p_screen=0)=0; virtual void viewport_detach(RID p_viewport)=0; - virtual void viewport_set_render_target_to_screen_rect(RID p_viewport,const Rect2& p_rect)=0; - enum RenderTargetUpdateMode { - RENDER_TARGET_UPDATE_DISABLED, - RENDER_TARGET_UPDATE_ONCE, //then goes to disabled - RENDER_TARGET_UPDATE_WHEN_VISIBLE, // default - RENDER_TARGET_UPDATE_ALWAYS + enum ViewportUpdateMode { + VIEWPORT_UPDATE_DISABLED, + VIEWPORT_UPDATE_ONCE, //then goes to disabled, must be manually updated + VIEWPORT_UPDATE_WHEN_VISIBLE, // default + VIEWPORT_UPDATE_ALWAYS }; - virtual void viewport_set_as_render_target(RID p_viewport,bool p_enable)=0; - virtual void viewport_set_render_target_update_mode(RID p_viewport,RenderTargetUpdateMode p_mode)=0; - virtual RenderTargetUpdateMode viewport_get_render_target_update_mode(RID p_viewport) const=0; - virtual RID viewport_get_render_target_texture(RID p_viewport) const=0; - virtual void viewport_set_render_target_vflip(RID p_viewport,bool p_enable)=0; - virtual bool viewport_get_render_target_vflip(RID p_viewport) const=0; - virtual void viewport_set_render_target_clear_on_new_frame(RID p_viewport,bool p_enable)=0; - virtual bool viewport_get_render_target_clear_on_new_frame(RID p_viewport) const=0; - virtual void viewport_render_target_clear(RID p_viewport)=0; - - virtual void viewport_queue_screen_capture(RID p_viewport)=0; - virtual Image viewport_get_screen_capture(RID p_viewport) const=0; - + virtual void viewport_set_update_mode(RID p_viewport,ViewportUpdateMode p_mode)=0; + virtual void viewport_set_vflip(RID p_viewport,bool p_enable)=0; + enum ViewportClearMode { - struct ViewportRect { - - int x,y,width,height; - ViewportRect() { x=y=width=height=0; } + VIEWPORT_CLEAR_ALWAYS, + VIEWPORT_CLEAR_NEVER, + VIEWPORT_CLEAR_ONLY_NEXT_FRAME }; - virtual void viewport_set_rect(RID p_viewport,const ViewportRect& p_rect)=0; - virtual ViewportRect viewport_get_rect(RID p_viewport) const=0; + virtual void viewport_set_clear_mode(RID p_viewport,ViewportClearMode p_clear_mode)=0; + + virtual RID viewport_get_texture(RID p_viewport) const=0; virtual void viewport_set_hide_scenario(RID p_viewport,bool p_hide)=0; virtual void viewport_set_hide_canvas(RID p_viewport,bool p_hide)=0; virtual void viewport_set_disable_environment(RID p_viewport,bool p_disable)=0; + virtual void viewport_set_disable_3d(RID p_viewport,bool p_disable)=0; virtual void viewport_attach_camera(RID p_viewport,RID p_camera)=0; virtual void viewport_set_scenario(RID p_viewport,RID p_scenario)=0; - virtual RID viewport_get_attached_camera(RID p_viewport) const=0; - virtual RID viewport_get_scenario(RID p_viewport) const=0; virtual void viewport_attach_canvas(RID p_viewport,RID p_canvas)=0; virtual void viewport_remove_canvas(RID p_viewport,RID p_canvas)=0; - virtual void viewport_set_canvas_transform(RID p_viewport,RID p_canvas,const Matrix32& p_offset)=0; - virtual Matrix32 viewport_get_canvas_transform(RID p_viewport,RID p_canvas) const=0; + virtual void viewport_set_canvas_transform(RID p_viewport,RID p_canvas,const Transform2D& p_offset)=0; virtual void viewport_set_transparent_background(RID p_viewport,bool p_enabled)=0; - virtual bool viewport_has_transparent_background(RID p_viewport) const=0; - - virtual void viewport_set_global_canvas_transform(RID p_viewport,const Matrix32& p_transform)=0; - virtual Matrix32 viewport_get_global_canvas_transform(RID p_viewport) const=0; + virtual void viewport_set_global_canvas_transform(RID p_viewport,const Transform2D& p_transform)=0; virtual void viewport_set_canvas_layer(RID p_viewport,RID p_canvas,int p_layer)=0; + virtual void viewport_set_shadow_atlas_size(RID p_viewport,int p_size)=0; + virtual void viewport_set_shadow_atlas_quadrant_subdivision(RID p_viewport,int p_quadrant,int p_subdiv)=0; + + enum ViewportMSAA { + VIEWPORT_MSAA_DISABLED, + VIEWPORT_MSAA_2X, + VIEWPORT_MSAA_4X, + VIEWPORT_MSAA_8X, + VIEWPORT_MSAA_16X, + }; + virtual void viewport_set_msaa(RID p_viewport,ViewportMSAA p_msaa)=0; + virtual void viewport_set_hdr(RID p_viewport,bool p_enabled)=0; /* ENVIRONMENT API */ @@ -758,104 +610,61 @@ public: enum EnvironmentBG { - ENV_BG_KEEP, - ENV_BG_DEFAULT_COLOR, + ENV_BG_CLEAR_COLOR, ENV_BG_COLOR, - ENV_BG_TEXTURE, - ENV_BG_CUBEMAP, + ENV_BG_SKYBOX, ENV_BG_CANVAS, + ENV_BG_KEEP, ENV_BG_MAX }; virtual void environment_set_background(RID p_env,EnvironmentBG p_bg)=0; - virtual EnvironmentBG environment_get_background(RID p_env) const=0; - - enum EnvironmentBGParam { - - ENV_BG_PARAM_CANVAS_MAX_LAYER, - ENV_BG_PARAM_COLOR, - ENV_BG_PARAM_TEXTURE, - ENV_BG_PARAM_CUBEMAP, - ENV_BG_PARAM_ENERGY, - ENV_BG_PARAM_SCALE, - ENV_BG_PARAM_GLOW, - ENV_BG_PARAM_MAX - }; + virtual void environment_set_skybox(RID p_env,RID p_skybox)=0; + virtual void environment_set_skybox_scale(RID p_env,float p_scale)=0; + virtual void environment_set_bg_color(RID p_env,const Color& p_color)=0; + virtual void environment_set_bg_energy(RID p_env,float p_energy)=0; + virtual void environment_set_canvas_max_layer(RID p_env,int p_max_layer)=0; + virtual void environment_set_ambient_light(RID p_env,const Color& p_color,float p_energy=1.0,float p_skybox_contribution=0.0)=0; + //set default SSAO options + //set default SSR options + //set default SSSSS options - virtual void environment_set_background_param(RID p_env,EnvironmentBGParam p_param, const Variant& p_value)=0; - virtual Variant environment_get_background_param(RID p_env,EnvironmentBGParam p_param) const=0; - - enum EnvironmentFx { - ENV_FX_AMBIENT_LIGHT, - ENV_FX_FXAA, - ENV_FX_GLOW, - ENV_FX_DOF_BLUR, - ENV_FX_HDR, - ENV_FX_FOG, - ENV_FX_BCS, - ENV_FX_SRGB, - ENV_FX_MAX + enum EnvironmentDOFBlurQuality { + ENV_DOF_BLUR_QUALITY_LOW, + ENV_DOF_BLUR_QUALITY_MEDIUM, + ENV_DOF_BLUR_QUALITY_HIGH, }; + virtual void environment_set_dof_blur_near(RID p_env,bool p_enable,float p_distance,float p_transition,float p_far_amount,EnvironmentDOFBlurQuality p_quality)=0; + virtual void environment_set_dof_blur_far(RID p_env,bool p_enable,float p_distance,float p_transition,float p_far_amount,EnvironmentDOFBlurQuality p_quality)=0; - - virtual void environment_set_enable_fx(RID p_env,EnvironmentFx p_effect,bool p_enabled)=0; - virtual bool environment_is_fx_enabled(RID p_env,EnvironmentFx p_mode) const=0; - - enum EnvironmentFxBlurBlendMode { - ENV_FX_BLUR_BLEND_MODE_ADDITIVE, - ENV_FX_BLUR_BLEND_MODE_SCREEN, - ENV_FX_BLUR_BLEND_MODE_SOFTLIGHT, + enum EnvironmentGlowBlendMode { + GLOW_BLEND_MODE_ADDITIVE, + GLOW_BLEND_MODE_SCREEN, + GLOW_BLEND_MODE_SOFTLIGHT, + GLOW_BLEND_MODE_REPLACE, }; + virtual void environment_set_glow(RID p_env,bool p_enable,int p_level_flags,float p_intensity,float p_strength,float p_bloom_treshold,EnvironmentGlowBlendMode p_blend_mode,float p_hdr_bleed_treshold,float p_hdr_bleed_scale,bool p_bicubic_upscale)=0; + virtual void environment_set_fog(RID p_env,bool p_enable,float p_begin,float p_end,RID p_gradient_texture)=0; - enum EnvironmentFxHDRToneMapper { - ENV_FX_HDR_TONE_MAPPER_LINEAR, - ENV_FX_HDR_TONE_MAPPER_LOG, - ENV_FX_HDR_TONE_MAPPER_REINHARDT, - ENV_FX_HDR_TONE_MAPPER_REINHARDT_AUTOWHITE, - }; - enum EnvironmentFxParam { - ENV_FX_PARAM_AMBIENT_LIGHT_COLOR, - ENV_FX_PARAM_AMBIENT_LIGHT_ENERGY, - ENV_FX_PARAM_GLOW_BLUR_PASSES, - ENV_FX_PARAM_GLOW_BLUR_SCALE, - ENV_FX_PARAM_GLOW_BLUR_STRENGTH, - ENV_FX_PARAM_GLOW_BLUR_BLEND_MODE, - ENV_FX_PARAM_GLOW_BLOOM, - ENV_FX_PARAM_GLOW_BLOOM_TRESHOLD, - ENV_FX_PARAM_DOF_BLUR_PASSES, - ENV_FX_PARAM_DOF_BLUR_BEGIN, - ENV_FX_PARAM_DOF_BLUR_RANGE, - ENV_FX_PARAM_HDR_TONEMAPPER, - ENV_FX_PARAM_HDR_EXPOSURE, - ENV_FX_PARAM_HDR_WHITE, - ENV_FX_PARAM_HDR_GLOW_TRESHOLD, - ENV_FX_PARAM_HDR_GLOW_SCALE, - ENV_FX_PARAM_HDR_MIN_LUMINANCE, - ENV_FX_PARAM_HDR_MAX_LUMINANCE, - ENV_FX_PARAM_HDR_EXPOSURE_ADJUST_SPEED, - ENV_FX_PARAM_FOG_BEGIN, - ENV_FX_PARAM_FOG_BEGIN_COLOR, - ENV_FX_PARAM_FOG_END_COLOR, - ENV_FX_PARAM_FOG_ATTENUATION, - ENV_FX_PARAM_FOG_BG, - ENV_FX_PARAM_BCS_BRIGHTNESS, - ENV_FX_PARAM_BCS_CONTRAST, - ENV_FX_PARAM_BCS_SATURATION, - ENV_FX_PARAM_MAX + enum EnvironmentToneMapper { + ENV_TONE_MAPPER_LINEAR, + ENV_TONE_MAPPER_REINHARDT, + ENV_TONE_MAPPER_FILMIC, + ENV_TONE_MAPPER_ACES }; - virtual void environment_fx_set_param(RID p_env,EnvironmentFxParam p_effect,const Variant& p_param)=0; - virtual Variant environment_fx_get_param(RID p_env,EnvironmentFxParam p_effect) const=0; + virtual void environment_set_tonemap(RID p_env,EnvironmentToneMapper p_tone_mapper,float p_exposure,float p_white,bool p_auto_exposure,float p_min_luminance,float p_max_luminance,float p_auto_exp_speed,float p_auto_exp_grey)=0; + virtual void environment_set_adjustment(RID p_env,bool p_enable,float p_brightness,float p_contrast,float p_saturation,RID p_ramp)=0; + virtual void environment_set_ssr(RID p_env,bool p_enable, int p_max_steps,float p_accel,float p_fade,float p_depth_tolerance,bool p_smooth,bool p_roughness)=0; + virtual void environment_set_ssao(RID p_env,bool p_enable, float p_radius, float p_intensity, float p_radius2, float p_intensity2, float p_bias, float p_light_affect,const Color &p_color,bool p_blur)=0; /* SCENARIO API */ - - virtual RID scenario_create()=0; enum ScenarioDebugMode { @@ -869,7 +678,7 @@ public: virtual void scenario_set_debug(RID p_scenario,ScenarioDebugMode p_debug_mode)=0; virtual void scenario_set_environment(RID p_scenario, RID p_environment)=0; - virtual RID scenario_get_environment(RID p_scenario, RID p_environment) const=0; + virtual void scenario_set_reflection_atlas_size(RID p_scenario, int p_size,int p_subdiv)=0; virtual void scenario_set_fallback_environment(RID p_scenario, RID p_environment)=0; @@ -883,12 +692,14 @@ public: INSTANCE_IMMEDIATE, INSTANCE_PARTICLES, INSTANCE_LIGHT, + INSTANCE_REFLECTION_PROBE, INSTANCE_ROOM, INSTANCE_PORTAL, - INSTANCE_BAKED_LIGHT, - INSTANCE_BAKED_LIGHT_SAMPLER, + INSTANCE_GI_PROBE, + INSTANCE_MAX, + /*INSTANCE_BAKED_LIGHT_SAMPLER,*/ - INSTANCE_GEOMETRY_MASK=(1<<INSTANCE_MESH)|(1<<INSTANCE_MULTIMESH)|(1<<INSTANCE_IMMEDIATE)|(1<<INSTANCE_PARTICLES) + INSTANCE_GEOMETRY_MASK=(1<<INSTANCE_MESH)|(1<<INSTANCE_MULTIMESH)|(1<<INSTANCE_IMMEDIATE) }; @@ -899,51 +710,29 @@ public: virtual RID instance_create()=0; // from can be mesh, light, poly, area and portal so far. virtual void instance_set_base(RID p_instance, RID p_base)=0; // from can be mesh, light, poly, area and portal so far. - virtual RID instance_get_base(RID p_instance) const=0; - virtual void instance_set_scenario(RID p_instance, RID p_scenario)=0; // from can be mesh, light, poly, area and portal so far. - virtual RID instance_get_scenario(RID p_instance) const=0; - virtual void instance_set_layer_mask(RID p_instance, uint32_t p_mask)=0; - virtual uint32_t instance_get_layer_mask(RID p_instance) const=0; - - virtual AABB instance_get_base_aabb(RID p_instance) const=0; - virtual void instance_set_transform(RID p_instance, const Transform& p_transform)=0; - virtual Transform instance_get_transform(RID p_instance) const=0; - - - virtual void instance_attach_object_instance_ID(RID p_instance,uint32_t p_ID)=0; - virtual uint32_t instance_get_object_instance_ID(RID p_instance) const=0; - + virtual void instance_attach_object_instance_ID(RID p_instance,ObjectID p_ID)=0; virtual void instance_set_morph_target_weight(RID p_instance,int p_shape, float p_weight)=0; - virtual float instance_get_morph_target_weight(RID p_instance,int p_shape) const=0; - virtual void instance_set_surface_material(RID p_instance,int p_surface, RID p_material)=0; + virtual void instance_set_visible(RID p_instance,bool p_visible)=0; virtual void instance_attach_skeleton(RID p_instance,RID p_skeleton)=0; - virtual RID instance_get_skeleton(RID p_instance) const=0; - virtual void instance_set_exterior( RID p_instance, bool p_enabled )=0; - virtual bool instance_is_exterior( RID p_instance) const=0; - virtual void instance_set_room( RID p_instance, RID p_room )=0; - virtual RID instance_get_room( RID p_instance ) const =0; virtual void instance_set_extra_visibility_margin( RID p_instance, real_t p_margin )=0; - virtual real_t instance_get_extra_visibility_margin( RID p_instance ) const =0; // don't use these in a game! - virtual Vector<RID> instances_cull_aabb(const AABB& p_aabb, RID p_scenario=RID()) const=0; - virtual Vector<RID> instances_cull_ray(const Vector3& p_from, const Vector3& p_to, RID p_scenario=RID()) const=0; - virtual Vector<RID> instances_cull_convex(const Vector<Plane>& p_convex, RID p_scenario=RID()) const=0; + virtual Vector<ObjectID> instances_cull_aabb(const Rect3& p_aabb, RID p_scenario=RID()) const=0; + virtual Vector<ObjectID> instances_cull_ray(const Vector3& p_from, const Vector3& p_to, RID p_scenario=RID()) const=0; + virtual Vector<ObjectID> instances_cull_convex(const Vector<Plane>& p_convex, RID p_scenario=RID()) const=0; enum InstanceFlags { - INSTANCE_FLAG_VISIBLE, INSTANCE_FLAG_BILLBOARD, INSTANCE_FLAG_BILLBOARD_FIX_Y, INSTANCE_FLAG_CAST_SHADOW, - INSTANCE_FLAG_RECEIVE_SHADOWS, INSTANCE_FLAG_DEPH_SCALE, INSTANCE_FLAG_VISIBLE_IN_ALL_ROOMS, INSTANCE_FLAG_USE_BAKED_LIGHT, @@ -958,80 +747,53 @@ public: }; virtual void instance_geometry_set_flag(RID p_instance,InstanceFlags p_flags,bool p_enabled)=0; - virtual bool instance_geometry_get_flag(RID p_instance,InstanceFlags p_flags) const=0; - virtual void instance_geometry_set_cast_shadows_setting(RID p_instance, ShadowCastingSetting p_shadow_casting_setting) = 0; - virtual ShadowCastingSetting instance_geometry_get_cast_shadows_setting(RID p_instance) const = 0; - virtual void instance_geometry_set_material_override(RID p_instance, RID p_material)=0; - virtual RID instance_geometry_get_material_override(RID p_instance) const=0; - - virtual void instance_geometry_set_draw_range(RID p_instance,float p_min,float p_max)=0; - virtual float instance_geometry_get_draw_range_max(RID p_instance) const=0; - virtual float instance_geometry_get_draw_range_min(RID p_instance) const=0; - - virtual void instance_geometry_set_baked_light(RID p_instance,RID p_baked_light)=0; - virtual RID instance_geometry_get_baked_light(RID p_instance) const=0; - virtual void instance_geometry_set_baked_light_sampler(RID p_instance,RID p_baked_light_sampler)=0; - virtual RID instance_geometry_get_baked_light_sampler(RID p_instance) const=0; - virtual void instance_geometry_set_baked_light_texture_index(RID p_instance,int p_tex_id)=0; - virtual int instance_geometry_get_baked_light_texture_index(RID p_instance) const=0; - - - virtual void instance_light_set_enabled(RID p_instance,bool p_enabled)=0; - virtual bool instance_light_is_enabled(RID p_instance) const=0; + virtual void instance_geometry_set_draw_range(RID p_instance,float p_min,float p_max,float p_min_margin,float p_max_margin)=0; + virtual void instance_geometry_set_as_instance_lod(RID p_instance,RID p_as_lod_of_instance)=0; /* CANVAS (2D) */ virtual RID canvas_create()=0; virtual void canvas_set_item_mirroring(RID p_canvas,RID p_item,const Point2& p_mirroring)=0; - virtual Point2 canvas_get_item_mirroring(RID p_canvas,RID p_item) const=0; virtual void canvas_set_modulate(RID p_canvas,const Color& p_color)=0; - virtual RID canvas_item_create()=0; virtual void canvas_item_set_parent(RID p_item,RID p_parent)=0; - virtual RID canvas_item_get_parent(RID p_canvas_item) const=0; virtual void canvas_item_set_visible(RID p_item,bool p_visible)=0; - virtual bool canvas_item_is_visible(RID p_item) const=0; - virtual void canvas_item_set_light_mask(RID p_item,int p_mask)=0; - virtual void canvas_item_set_blend_mode(RID p_canvas_item,MaterialBlendMode p_blend)=0; - - virtual void canvas_item_attach_viewport(RID p_item, RID p_viewport)=0; - - //virtual void canvas_item_set_rect(RID p_item, const Rect2& p_rect)=0; - - virtual void canvas_item_set_transform(RID p_item, const Matrix32& p_transform)=0; + virtual void canvas_item_set_transform(RID p_item, const Transform2D& p_transform)=0; virtual void canvas_item_set_clip(RID p_item, bool p_clip)=0; virtual void canvas_item_set_distance_field_mode(RID p_item, bool p_enable)=0; virtual void canvas_item_set_custom_rect(RID p_item, bool p_custom_rect,const Rect2& p_rect=Rect2())=0; - virtual void canvas_item_set_opacity(RID p_item, float p_opacity)=0; - virtual float canvas_item_get_opacity(RID p_item, float p_opacity) const=0; + virtual void canvas_item_set_modulate(RID p_item, const Color& p_color)=0; + virtual void canvas_item_set_self_modulate(RID p_item, const Color& p_color)=0; - virtual void canvas_item_set_self_opacity(RID p_item, float p_self_opacity)=0; - virtual float canvas_item_get_self_opacity(RID p_item, float p_self_opacity) const=0; + virtual void canvas_item_set_draw_behind_parent(RID p_item, bool p_enable)=0; - virtual void canvas_item_set_on_top(RID p_item, bool p_on_top)=0; - virtual bool canvas_item_is_on_top(RID p_item) const=0; + enum NinePatchAxisMode { + NINE_PATCH_STRETCH, + NINE_PATCH_TILE, + NINE_PATCH_TILE_FIT, + }; virtual void canvas_item_add_line(RID p_item, const Point2& p_from, const Point2& p_to,const Color& p_color,float p_width=1.0,bool p_antialiased=false)=0; virtual void canvas_item_add_rect(RID p_item, const Rect2& p_rect, const Color& p_color)=0; virtual void canvas_item_add_circle(RID p_item, const Point2& p_pos, float p_radius,const Color& p_color)=0; virtual void canvas_item_add_texture_rect(RID p_item, const Rect2& p_rect, RID p_texture,bool p_tile=false,const Color& p_modulate=Color(1,1,1),bool p_transpose=false)=0; virtual void canvas_item_add_texture_rect_region(RID p_item, const Rect2& p_rect, RID p_texture,const Rect2& p_src_rect,const Color& p_modulate=Color(1,1,1),bool p_transpose=false)=0; - virtual void canvas_item_add_style_box(RID p_item, const Rect2& p_rect, const Rect2& p_source, RID p_texture,const Vector2& p_topleft, const Vector2& p_bottomright, bool p_draw_center=true,const Color& p_modulate=Color(1,1,1))=0; + virtual void canvas_item_add_nine_patch(RID p_item, const Rect2& p_rect, const Rect2& p_source, RID p_texture,const Vector2& p_topleft, const Vector2& p_bottomright,NinePatchAxisMode p_x_axis_mode=NINE_PATCH_STRETCH, NinePatchAxisMode p_y_axis_mode=NINE_PATCH_STRETCH,bool p_draw_center=true,const Color& p_modulate=Color(1,1,1))=0; virtual void canvas_item_add_primitive(RID p_item, const Vector<Point2>& p_points, const Vector<Color>& p_colors,const Vector<Point2>& p_uvs, RID p_texture,float p_width=1.0)=0; virtual void canvas_item_add_polygon(RID p_item, const Vector<Point2>& p_points, const Vector<Color>& p_colors,const Vector<Point2>& p_uvs=Vector<Point2>(), RID p_texture=RID())=0; virtual void canvas_item_add_triangle_array(RID p_item, const Vector<int>& p_indices, const Vector<Point2>& p_points, const Vector<Color>& p_colors,const Vector<Point2>& p_uvs=Vector<Point2>(), RID p_texture=RID(), int p_count=-1)=0; - virtual void canvas_item_add_triangle_array_ptr(RID p_item, int p_count, const int* p_indices, const Point2* p_points, const Color* p_colors,const Point2* p_uvs=NULL, RID p_texture=RID())=0; - virtual void canvas_item_add_set_transform(RID p_item,const Matrix32& p_transform)=0; - virtual void canvas_item_add_set_blend_mode(RID p_item, MaterialBlendMode p_blend)=0; + virtual void canvas_item_add_mesh(RID p_item, const RID& p_mesh,RID p_skeleton=RID())=0; + virtual void canvas_item_add_multimesh(RID p_item, RID p_mesh,RID p_skeleton=RID())=0; + virtual void canvas_item_add_set_transform(RID p_item,const Transform2D& p_transform)=0; virtual void canvas_item_add_clip_ignore(RID p_item, bool p_ignore)=0; virtual void canvas_item_set_sort_children_by_y(RID p_item, bool p_enable)=0; virtual void canvas_item_set_z(RID p_item, int p_z)=0; @@ -1039,7 +801,7 @@ public: virtual void canvas_item_set_copy_to_backbuffer(RID p_item, bool p_enable,const Rect2& p_rect)=0; virtual void canvas_item_clear(RID p_item)=0; - virtual void canvas_item_raise(RID p_item)=0; + virtual void canvas_item_set_draw_index(RID p_item,int p_index)=0; virtual void canvas_item_set_material(RID p_item, RID p_material)=0; @@ -1049,7 +811,7 @@ public: virtual void canvas_light_attach_to_canvas(RID p_light,RID p_canvas)=0; virtual void canvas_light_set_enabled(RID p_light, bool p_enabled)=0; virtual void canvas_light_set_scale(RID p_light, float p_scale)=0; - virtual void canvas_light_set_transform(RID p_light, const Matrix32& p_transform)=0; + virtual void canvas_light_set_transform(RID p_light, const Transform2D& p_transform)=0; virtual void canvas_light_set_texture(RID p_light, RID p_texture)=0; virtual void canvas_light_set_texture_offset(RID p_light, const Vector2& p_offset)=0; virtual void canvas_light_set_color(RID p_light, const Color& p_color)=0; @@ -1057,8 +819,8 @@ public: virtual void canvas_light_set_energy(RID p_light, float p_energy)=0; virtual void canvas_light_set_z_range(RID p_light, int p_min_z,int p_max_z)=0; virtual void canvas_light_set_layer_range(RID p_light, int p_min_layer,int p_max_layer)=0; - virtual void canvas_light_set_item_mask(RID p_light, int p_mask)=0; - virtual void canvas_light_set_item_shadow_mask(RID p_light, int p_mask)=0; + virtual void canvas_light_set_item_cull_mask(RID p_light, int p_mask)=0; + virtual void canvas_light_set_item_shadow_cull_mask(RID p_light, int p_mask)=0; enum CanvasLightMode { CANVAS_LIGHT_MODE_ADD, @@ -1068,9 +830,20 @@ public: }; virtual void canvas_light_set_mode(RID p_light, CanvasLightMode p_mode)=0; + + + enum CanvasLightShadowFilter { + CANVAS_LIGHT_FILTER_NONE, + CANVAS_LIGHT_FILTER_PCF3, + CANVAS_LIGHT_FILTER_PCF5, + CANVAS_LIGHT_FILTER_PCF9, + CANVAS_LIGHT_FILTER_PCF13, + }; + virtual void canvas_light_set_shadow_enabled(RID p_light, bool p_enabled)=0; virtual void canvas_light_set_shadow_buffer_size(RID p_light, int p_size)=0; - virtual void canvas_light_set_shadow_esm_multiplier(RID p_light, float p_multiplier)=0; + virtual void canvas_light_set_shadow_gradient_length(RID p_light, float p_length)=0; + virtual void canvas_light_set_shadow_filter(RID p_light, CanvasLightShadowFilter p_filter)=0; virtual void canvas_light_set_shadow_color(RID p_light, const Color& p_color)=0; @@ -1079,12 +852,13 @@ public: virtual void canvas_light_occluder_attach_to_canvas(RID p_occluder,RID p_canvas)=0; virtual void canvas_light_occluder_set_enabled(RID p_occluder,bool p_enabled)=0; virtual void canvas_light_occluder_set_polygon(RID p_occluder,RID p_polygon)=0; - virtual void canvas_light_occluder_set_transform(RID p_occluder,const Matrix32& p_xform)=0; + virtual void canvas_light_occluder_set_transform(RID p_occluder,const Transform2D& p_xform)=0; virtual void canvas_light_occluder_set_light_mask(RID p_occluder,int p_mask)=0; virtual RID canvas_occluder_polygon_create()=0; - virtual void canvas_occluder_polygon_set_shape(RID p_occluder_polygon,const DVector<Vector2>& p_shape,bool p_closed)=0; - virtual void canvas_occluder_polygon_set_shape_as_lines(RID p_occluder_polygon,const DVector<Vector2>& p_shape)=0; + virtual void canvas_occluder_polygon_set_shape(RID p_occluder_polygon,const PoolVector<Vector2>& p_shape,bool p_closed)=0; + virtual void canvas_occluder_polygon_set_shape_as_lines(RID p_occluder_polygon,const PoolVector<Vector2>& p_shape)=0; + enum CanvasOccluderPolygonCullMode { CANVAS_OCCLUDER_POLYGON_CULL_DISABLED, CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE, @@ -1092,21 +866,6 @@ public: }; virtual void canvas_occluder_polygon_set_cull_mode(RID p_occluder_polygon,CanvasOccluderPolygonCullMode p_mode)=0; - /* CANVAS ITEM MATERIAL */ - - virtual RID canvas_item_material_create()=0; - virtual void canvas_item_material_set_shader(RID p_material, RID p_shader)=0; - virtual void canvas_item_material_set_shader_param(RID p_material, const StringName& p_param, const Variant& p_value)=0; - virtual Variant canvas_item_material_get_shader_param(RID p_material, const StringName& p_param) const=0; - - - enum CanvasItemShadingMode { - CANVAS_ITEM_SHADING_NORMAL, - CANVAS_ITEM_SHADING_UNSHADED, - CANVAS_ITEM_SHADING_ONLY_LIGHT, - }; - - virtual void canvas_item_material_set_shading_mode(RID p_material, CanvasItemShadingMode p_mode)=0; /* CURSOR */ virtual void cursor_set_rotation(float p_rotation, int p_cursor = 0)=0; // radians @@ -1125,15 +884,6 @@ public: virtual void free( RID p_rid )=0; ///< free RIDs associated with the visual server - /* CUSTOM SHADING */ - - virtual void custom_shade_model_set_shader(int p_model, RID p_shader)=0; - virtual RID custom_shade_model_get_shader(int p_model) const=0; - virtual void custom_shade_model_set_name(int p_model, const String& p_name)=0; - virtual String custom_shade_model_get_name(int p_model) const=0; - virtual void custom_shade_model_set_param_info(int p_model, const List<PropertyInfo>& p_info)=0; - virtual void custom_shade_model_get_param_info(int p_model, List<PropertyInfo>* p_info) const=0; - /* EVENT QUEUING */ virtual void draw()=0; @@ -1166,7 +916,6 @@ public: RID material_2d_get(bool p_shaded, bool p_transparent, bool p_cut_alpha,bool p_opaque_prepass); - /* TESTING */ virtual RID get_test_cube()=0; @@ -1177,16 +926,14 @@ public: virtual RID make_sphere_mesh(int p_lats,int p_lons,float p_radius); virtual void mesh_add_surface_from_mesh_data( RID p_mesh, const Geometry::MeshData& p_mesh_data); - virtual void mesh_add_surface_from_planes( RID p_mesh, const DVector<Plane>& p_planes); + virtual void mesh_add_surface_from_planes( RID p_mesh, const PoolVector<Plane>& p_planes); virtual void set_boot_image(const Image& p_image, const Color& p_color,bool p_scale)=0; virtual void set_default_clear_color(const Color& p_color)=0; - virtual Color get_default_clear_color() const=0; enum Features { FEATURE_SHADERS, FEATURE_MULTITHREADED, - FEATURE_NEEDS_RELOAD_HOOK, }; virtual bool has_feature(Features p_feature) const=0; @@ -1201,19 +948,15 @@ public: VARIANT_ENUM_CAST( VisualServer::CubeMapSide ); VARIANT_ENUM_CAST( VisualServer::TextureFlags ); VARIANT_ENUM_CAST( VisualServer::ShaderMode ); -VARIANT_ENUM_CAST( VisualServer::MaterialFlag ); -VARIANT_ENUM_CAST( VisualServer::MaterialBlendMode ); -VARIANT_ENUM_CAST( VisualServer::ParticleVariable ); VARIANT_ENUM_CAST( VisualServer::ArrayType ); VARIANT_ENUM_CAST( VisualServer::ArrayFormat ); VARIANT_ENUM_CAST( VisualServer::PrimitiveType ); VARIANT_ENUM_CAST( VisualServer::LightType ); -VARIANT_ENUM_CAST( VisualServer::LightColor ); VARIANT_ENUM_CAST( VisualServer::LightParam ); VARIANT_ENUM_CAST( VisualServer::ScenarioDebugMode ); VARIANT_ENUM_CAST( VisualServer::InstanceType ); VARIANT_ENUM_CAST( VisualServer::RenderInfo ); -VARIANT_ENUM_CAST( VisualServer::MipMapPolicy ); + //typedef VisualServer VS; // makes it easier to use #define VS VisualServer diff --git a/thirdparty/README.md b/thirdparty/README.md index 3adbbea59b..ff13ef2370 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -31,17 +31,15 @@ Files extracted from upstream source: - `docs/{FTL.TXT,LICENSE.TXT}` -## glew +## glad -- Upstream: http://glew.sourceforge.net -- Version: 1.13.0 -- License: BSD-3-Clause - -Files extracted from upstream source: +- Upstream: https://github.com/Dav1dde/glad +- Version: 0.1.13a0 +- License: MIT -- `src/glew.c` -- include/GL/ as GL/ -- LICENSE.txt +The files we package are automatically generated. +See the header of glad.c for instructions on how to generate them for +the GLES version Godot targets. ## jpeg-compressor @@ -84,7 +82,7 @@ Files extracted from upstream source: ## libpng - Upstream: http://libpng.org/pub/png/libpng.html -- Version: 1.6.26 +- Version: 1.6.28 - License: libpng/zlib Files extracted from upstream source: @@ -98,6 +96,7 @@ Files extracted from upstream source: ## libsimplewebm - Upstream: https://github.com/zaps166/libsimplewebm +- Version: 05cfdc2 (git) - License: MIT, BSD-3-Clause @@ -124,7 +123,7 @@ Files extracted from upstream source: ## libwebp - Upstream: https://chromium.googlesource.com/webm/libwebp/ -- Version: 0.5.1 +- Version: 0.5.2 - License: BSD-3-Clause Files extracted from upstream source: @@ -140,7 +139,7 @@ changes are marked with `// -- GODOT --` comments. ## openssl - Upstream: https://www.openssl.org -- Version: 1.2.0h +- Version: 1.0.2h - License: OpenSSL license / BSD-like Files extracted from the upstream source: @@ -151,7 +150,7 @@ TODO. ## opus - Upstream: https://opus-codec.org -- Version: 1.1.2 (opus) and 0.7 (opusfile) +- Version: 1.1.3 (opus) and 0.8 (opusfile) - License: BSD-3-Clause Files extracted from upstream source: @@ -223,9 +222,9 @@ Files extracted from upstream source: ## zlib - Upstream: http://www.zlib.net/ -- Version: 1.2.8 +- Version: 1.2.10 - License: zlib Files extracted from upstream source: -- all .c and .h files apart from `gz*` +- all .c and .h files diff --git a/thirdparty/glad/KHR/khrplatform.h b/thirdparty/glad/KHR/khrplatform.h new file mode 100644 index 0000000000..07b61b9bd6 --- /dev/null +++ b/thirdparty/glad/KHR/khrplatform.h @@ -0,0 +1,285 @@ +#ifndef __khrplatform_h_ +#define __khrplatform_h_ + +/* +** Copyright (c) 2008-2009 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +/* Khronos platform-specific types and definitions. + * + * $Revision: 32517 $ on $Date: 2016-03-11 02:41:19 -0800 (Fri, 11 Mar 2016) $ + * + * Adopters may modify this file to suit their platform. Adopters are + * encouraged to submit platform specific modifications to the Khronos + * group so that they can be included in future versions of this file. + * Please submit changes by sending them to the public Khronos Bugzilla + * (http://khronos.org/bugzilla) by filing a bug against product + * "Khronos (general)" component "Registry". + * + * A predefined template which fills in some of the bug fields can be + * reached using http://tinyurl.com/khrplatform-h-bugreport, but you + * must create a Bugzilla login first. + * + * + * See the Implementer's Guidelines for information about where this file + * should be located on your system and for more details of its use: + * http://www.khronos.org/registry/implementers_guide.pdf + * + * This file should be included as + * #include <KHR/khrplatform.h> + * by Khronos client API header files that use its types and defines. + * + * The types in khrplatform.h should only be used to define API-specific types. + * + * Types defined in khrplatform.h: + * khronos_int8_t signed 8 bit + * khronos_uint8_t unsigned 8 bit + * khronos_int16_t signed 16 bit + * khronos_uint16_t unsigned 16 bit + * khronos_int32_t signed 32 bit + * khronos_uint32_t unsigned 32 bit + * khronos_int64_t signed 64 bit + * khronos_uint64_t unsigned 64 bit + * khronos_intptr_t signed same number of bits as a pointer + * khronos_uintptr_t unsigned same number of bits as a pointer + * khronos_ssize_t signed size + * khronos_usize_t unsigned size + * khronos_float_t signed 32 bit floating point + * khronos_time_ns_t unsigned 64 bit time in nanoseconds + * khronos_utime_nanoseconds_t unsigned time interval or absolute time in + * nanoseconds + * khronos_stime_nanoseconds_t signed time interval in nanoseconds + * khronos_boolean_enum_t enumerated boolean type. This should + * only be used as a base type when a client API's boolean type is + * an enum. Client APIs which use an integer or other type for + * booleans cannot use this as the base type for their boolean. + * + * Tokens defined in khrplatform.h: + * + * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values. + * + * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. + * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. + * + * Calling convention macros defined in this file: + * KHRONOS_APICALL + * KHRONOS_APIENTRY + * KHRONOS_APIATTRIBUTES + * + * These may be used in function prototypes as: + * + * KHRONOS_APICALL void KHRONOS_APIENTRY funcname( + * int arg1, + * int arg2) KHRONOS_APIATTRIBUTES; + */ + +/*------------------------------------------------------------------------- + * Definition of KHRONOS_APICALL + *------------------------------------------------------------------------- + * This precedes the return type of the function in the function prototype. + */ +#if defined(_WIN32) && !defined(__SCITECH_SNAP__) +# define KHRONOS_APICALL __declspec(dllimport) +#elif defined (__SYMBIAN32__) +# define KHRONOS_APICALL IMPORT_C +#elif defined(__ANDROID__) +# include <sys/cdefs.h> +# define KHRONOS_APICALL __attribute__((visibility("default"))) __NDK_FPABI__ +#else +# define KHRONOS_APICALL +#endif + +/*------------------------------------------------------------------------- + * Definition of KHRONOS_APIENTRY + *------------------------------------------------------------------------- + * This follows the return type of the function and precedes the function + * name in the function prototype. + */ +#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) + /* Win32 but not WinCE */ +# define KHRONOS_APIENTRY __stdcall +#else +# define KHRONOS_APIENTRY +#endif + +/*------------------------------------------------------------------------- + * Definition of KHRONOS_APIATTRIBUTES + *------------------------------------------------------------------------- + * This follows the closing parenthesis of the function prototype arguments. + */ +#if defined (__ARMCC_2__) +#define KHRONOS_APIATTRIBUTES __softfp +#else +#define KHRONOS_APIATTRIBUTES +#endif + +/*------------------------------------------------------------------------- + * basic type definitions + *-----------------------------------------------------------------------*/ +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) + + +/* + * Using <stdint.h> + */ +#include <stdint.h> +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(__VMS ) || defined(__sgi) + +/* + * Using <inttypes.h> + */ +#include <inttypes.h> +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(_WIN32) && !defined(__SCITECH_SNAP__) + +/* + * Win32 + */ +typedef __int32 khronos_int32_t; +typedef unsigned __int32 khronos_uint32_t; +typedef __int64 khronos_int64_t; +typedef unsigned __int64 khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif defined(__sun__) || defined(__digital__) + +/* + * Sun or Digital + */ +typedef int khronos_int32_t; +typedef unsigned int khronos_uint32_t; +#if defined(__arch64__) || defined(_LP64) +typedef long int khronos_int64_t; +typedef unsigned long int khronos_uint64_t; +#else +typedef long long int khronos_int64_t; +typedef unsigned long long int khronos_uint64_t; +#endif /* __arch64__ */ +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#elif 0 + +/* + * Hypothetical platform with no float or int64 support + */ +typedef int khronos_int32_t; +typedef unsigned int khronos_uint32_t; +#define KHRONOS_SUPPORT_INT64 0 +#define KHRONOS_SUPPORT_FLOAT 0 + +#else + +/* + * Generic fallback + */ +#include <stdint.h> +typedef int32_t khronos_int32_t; +typedef uint32_t khronos_uint32_t; +typedef int64_t khronos_int64_t; +typedef uint64_t khronos_uint64_t; +#define KHRONOS_SUPPORT_INT64 1 +#define KHRONOS_SUPPORT_FLOAT 1 + +#endif + + +/* + * Types that are (so far) the same on all platforms + */ +typedef signed char khronos_int8_t; +typedef unsigned char khronos_uint8_t; +typedef signed short int khronos_int16_t; +typedef unsigned short int khronos_uint16_t; + +/* + * Types that differ between LLP64 and LP64 architectures - in LLP64, + * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears + * to be the only LLP64 architecture in current use. + */ +#ifdef _WIN64 +typedef signed long long int khronos_intptr_t; +typedef unsigned long long int khronos_uintptr_t; +typedef signed long long int khronos_ssize_t; +typedef unsigned long long int khronos_usize_t; +#else +typedef signed long int khronos_intptr_t; +typedef unsigned long int khronos_uintptr_t; +typedef signed long int khronos_ssize_t; +typedef unsigned long int khronos_usize_t; +#endif + +#if KHRONOS_SUPPORT_FLOAT +/* + * Float type + */ +typedef float khronos_float_t; +#endif + +#if KHRONOS_SUPPORT_INT64 +/* Time types + * + * These types can be used to represent a time interval in nanoseconds or + * an absolute Unadjusted System Time. Unadjusted System Time is the number + * of nanoseconds since some arbitrary system event (e.g. since the last + * time the system booted). The Unadjusted System Time is an unsigned + * 64 bit value that wraps back to 0 every 584 years. Time intervals + * may be either signed or unsigned. + */ +typedef khronos_uint64_t khronos_utime_nanoseconds_t; +typedef khronos_int64_t khronos_stime_nanoseconds_t; +#endif + +/* + * Dummy value used to pad enum types to 32 bits. + */ +#ifndef KHRONOS_MAX_ENUM +#define KHRONOS_MAX_ENUM 0x7FFFFFFF +#endif + +/* + * Enumerated boolean type + * + * Values other than zero should be considered to be true. Therefore + * comparisons should not be made against KHRONOS_TRUE. + */ +typedef enum { + KHRONOS_FALSE = 0, + KHRONOS_TRUE = 1, + KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM +} khronos_boolean_enum_t; + +#endif /* __khrplatform_h_ */ diff --git a/thirdparty/glad/glad.c b/thirdparty/glad/glad.c new file mode 100644 index 0000000000..70a93f8d25 --- /dev/null +++ b/thirdparty/glad/glad.c @@ -0,0 +1,1818 @@ +/* + + OpenGL loader generated by glad 0.1.13a0 on Fri Jan 6 19:27:07 2017. + + Language/Generator: C/C++ + Specification: gl + APIs: gl=3.3 + Profile: compatibility + Extensions: + GL_ARB_debug_output + Loader: True + Local files: False + Omit khrplatform: False + + Commandline: + --profile="compatibility" --api="gl=3.3" --generator="c" --spec="gl" --extensions="GL_ARB_debug_output" + Online: + http://glad.dav1d.de/#profile=compatibility&language=c&specification=gl&loader=on&api=gl%3D3.3&extensions=GL_ARB_debug_output +*/ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <glad/glad.h> + +static void* get_proc(const char *namez); + +#ifdef _WIN32 +#include <windows.h> +static HMODULE libGL; + +typedef void* (APIENTRYP PFNWGLGETPROCADDRESSPROC_PRIVATE)(const char*); +PFNWGLGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr; + +static +int open_gl(void) { + libGL = LoadLibraryW(L"opengl32.dll"); + if(libGL != NULL) { + gladGetProcAddressPtr = (PFNWGLGETPROCADDRESSPROC_PRIVATE)GetProcAddress( + libGL, "wglGetProcAddress"); + return gladGetProcAddressPtr != NULL; + } + + return 0; +} + +static +void close_gl(void) { + if(libGL != NULL) { + FreeLibrary(libGL); + libGL = NULL; + } +} +#else +#include <dlfcn.h> +static void* libGL; + +#ifndef __APPLE__ +typedef void* (APIENTRYP PFNGLXGETPROCADDRESSPROC_PRIVATE)(const char*); +PFNGLXGETPROCADDRESSPROC_PRIVATE gladGetProcAddressPtr; +#endif + +static +int open_gl(void) { +#ifdef __APPLE__ + static const char *NAMES[] = { + "../Frameworks/OpenGL.framework/OpenGL", + "/Library/Frameworks/OpenGL.framework/OpenGL", + "/System/Library/Frameworks/OpenGL.framework/OpenGL", + "/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL" + }; +#else + static const char *NAMES[] = {"libGL.so.1", "libGL.so"}; +#endif + + unsigned int index = 0; + for(index = 0; index < (sizeof(NAMES) / sizeof(NAMES[0])); index++) { + libGL = dlopen(NAMES[index], RTLD_NOW | RTLD_GLOBAL); + + if(libGL != NULL) { +#ifdef __APPLE__ + return 1; +#else + gladGetProcAddressPtr = (PFNGLXGETPROCADDRESSPROC_PRIVATE)dlsym(libGL, + "glXGetProcAddressARB"); + return gladGetProcAddressPtr != NULL; +#endif + } + } + + return 0; +} + +static +void close_gl() { + if(libGL != NULL) { + dlclose(libGL); + libGL = NULL; + } +} +#endif + +static +void* get_proc(const char *namez) { + void* result = NULL; + if(libGL == NULL) return NULL; + +#ifndef __APPLE__ + if(gladGetProcAddressPtr != NULL) { + result = gladGetProcAddressPtr(namez); + } +#endif + if(result == NULL) { +#ifdef _WIN32 + result = (void*)GetProcAddress(libGL, namez); +#else + result = dlsym(libGL, namez); +#endif + } + + return result; +} + +int gladLoadGL(void) { + int status = 0; + + if(open_gl()) { + status = gladLoadGLLoader(&get_proc); + close_gl(); + } + + return status; +} + +struct gladGLversionStruct GLVersion; + +#if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0) +#define _GLAD_IS_SOME_NEW_VERSION 1 +#endif + +static int max_loaded_major; +static int max_loaded_minor; + +static const char *exts = NULL; +static int num_exts_i = 0; +static const char **exts_i = NULL; + +static int get_exts(void) { +#ifdef _GLAD_IS_SOME_NEW_VERSION + if(max_loaded_major < 3) { +#endif + exts = (const char *)glGetString(GL_EXTENSIONS); +#ifdef _GLAD_IS_SOME_NEW_VERSION + } else { + int index; + + num_exts_i = 0; + glGetIntegerv(GL_NUM_EXTENSIONS, &num_exts_i); + if (num_exts_i > 0) { + exts_i = (const char **)realloc((void *)exts_i, num_exts_i * sizeof *exts_i); + } + + if (exts_i == NULL) { + return 0; + } + + for(index = 0; index < num_exts_i; index++) { + exts_i[index] = (const char*)glGetStringi(GL_EXTENSIONS, index); + } + } +#endif + return 1; +} + +static void free_exts(void) { + if (exts_i != NULL) { + free((char **)exts_i); + exts_i = NULL; + } +} + +static int has_ext(const char *ext) { +#ifdef _GLAD_IS_SOME_NEW_VERSION + if(max_loaded_major < 3) { +#endif + const char *extensions; + const char *loc; + const char *terminator; + extensions = exts; + if(extensions == NULL || ext == NULL) { + return 0; + } + + while(1) { + loc = strstr(extensions, ext); + if(loc == NULL) { + return 0; + } + + terminator = loc + strlen(ext); + if((loc == extensions || *(loc - 1) == ' ') && + (*terminator == ' ' || *terminator == '\0')) { + return 1; + } + extensions = terminator; + } +#ifdef _GLAD_IS_SOME_NEW_VERSION + } else { + int index; + + for(index = 0; index < num_exts_i; index++) { + const char *e = exts_i[index]; + + if(strcmp(e, ext) == 0) { + return 1; + } + } + } +#endif + + return 0; +} +int GLAD_GL_VERSION_1_0; +int GLAD_GL_VERSION_1_1; +int GLAD_GL_VERSION_1_2; +int GLAD_GL_VERSION_1_3; +int GLAD_GL_VERSION_1_4; +int GLAD_GL_VERSION_1_5; +int GLAD_GL_VERSION_2_0; +int GLAD_GL_VERSION_2_1; +int GLAD_GL_VERSION_3_0; +int GLAD_GL_VERSION_3_1; +int GLAD_GL_VERSION_3_2; +int GLAD_GL_VERSION_3_3; +PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D; +PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui; +PFNGLWINDOWPOS2SPROC glad_glWindowPos2s; +PFNGLWINDOWPOS2IPROC glad_glWindowPos2i; +PFNGLWINDOWPOS2FPROC glad_glWindowPos2f; +PFNGLWINDOWPOS2DPROC glad_glWindowPos2d; +PFNGLVERTEX2FVPROC glad_glVertex2fv; +PFNGLINDEXIPROC glad_glIndexi; +PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer; +PFNGLRECTDVPROC glad_glRectdv; +PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D; +PFNGLEVALCOORD2DPROC glad_glEvalCoord2d; +PFNGLEVALCOORD2FPROC glad_glEvalCoord2f; +PFNGLINDEXDPROC glad_glIndexd; +PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv; +PFNGLINDEXFPROC glad_glIndexf; +PFNGLBINDSAMPLERPROC glad_glBindSampler; +PFNGLLINEWIDTHPROC glad_glLineWidth; +PFNGLCOLORP3UIVPROC glad_glColorP3uiv; +PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v; +PFNGLGETMAPFVPROC glad_glGetMapfv; +PFNGLINDEXSPROC glad_glIndexs; +PFNGLCOMPILESHADERPROC glad_glCompileShader; +PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying; +PFNGLWINDOWPOS2IVPROC glad_glWindowPos2iv; +PFNGLINDEXFVPROC glad_glIndexfv; +PFNGLFOGIVPROC glad_glFogiv; +PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate; +PFNGLRASTERPOS2FVPROC glad_glRasterPos2fv; +PFNGLLIGHTMODELIVPROC glad_glLightModeliv; +PFNGLCOLOR4UIPROC glad_glColor4ui; +PFNGLSECONDARYCOLOR3FVPROC glad_glSecondaryColor3fv; +PFNGLMULTITEXCOORDP3UIPROC glad_glMultiTexCoordP3ui; +PFNGLFOGFVPROC glad_glFogfv; +PFNGLVERTEXP4UIPROC glad_glVertexP4ui; +PFNGLENABLEIPROC glad_glEnablei; +PFNGLVERTEX4IVPROC glad_glVertex4iv; +PFNGLEVALCOORD1FVPROC glad_glEvalCoord1fv; +PFNGLWINDOWPOS2SVPROC glad_glWindowPos2sv; +PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui; +PFNGLCREATESHADERPROC glad_glCreateShader; +PFNGLISBUFFERPROC glad_glIsBuffer; +PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv; +PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers; +PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D; +PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D; +PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f; +PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate; +PFNGLVERTEX4FVPROC glad_glVertex4fv; +PFNGLBINDTEXTUREPROC glad_glBindTexture; +PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s; +PFNGLTEXCOORD2FVPROC glad_glTexCoord2fv; +PFNGLSAMPLEMASKIPROC glad_glSampleMaski; +PFNGLVERTEXP2UIPROC glad_glVertexP2ui; +PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex; +PFNGLTEXCOORD4FVPROC glad_glTexCoord4fv; +PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv; +PFNGLPOINTSIZEPROC glad_glPointSize; +PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv; +PFNGLDELETEPROGRAMPROC glad_glDeleteProgram; +PFNGLCOLOR4BVPROC glad_glColor4bv; +PFNGLRASTERPOS2FPROC glad_glRasterPos2f; +PFNGLRASTERPOS2DPROC glad_glRasterPos2d; +PFNGLLOADIDENTITYPROC glad_glLoadIdentity; +PFNGLRASTERPOS2IPROC glad_glRasterPos2i; +PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage; +PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv; +PFNGLCOLOR3BPROC glad_glColor3b; +PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv; +PFNGLEDGEFLAGPROC glad_glEdgeFlag; +PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers; +PFNGLVERTEX3DPROC glad_glVertex3d; +PFNGLVERTEX3FPROC glad_glVertex3f; +PFNGLVERTEX3IPROC glad_glVertex3i; +PFNGLCOLOR3IPROC glad_glColor3i; +PFNGLUNIFORM3FPROC glad_glUniform3f; +PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv; +PFNGLCOLOR3SPROC glad_glColor3s; +PFNGLVERTEX3SPROC glad_glVertex3s; +PFNGLTEXCOORDP2UIPROC glad_glTexCoordP2ui; +PFNGLCOLORMASKIPROC glad_glColorMaski; +PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi; +PFNGLTEXCOORD1IVPROC glad_glTexCoord1iv; +PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer; +PFNGLMULTITEXCOORDP2UIPROC glad_glMultiTexCoordP2ui; +PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv; +PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex; +PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f; +PFNGLVERTEX2IVPROC glad_glVertex2iv; +PFNGLCOLOR3SVPROC glad_glColor3sv; +PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv; +PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv; +PFNGLNORMALPOINTERPROC glad_glNormalPointer; +PFNGLTEXCOORDP3UIVPROC glad_glTexCoordP3uiv; +PFNGLVERTEX4SVPROC glad_glVertex4sv; +PFNGLPASSTHROUGHPROC glad_glPassThrough; +PFNGLMULTITEXCOORDP4UIPROC glad_glMultiTexCoordP4ui; +PFNGLFOGIPROC glad_glFogi; +PFNGLBEGINPROC glad_glBegin; +PFNGLEVALCOORD2DVPROC glad_glEvalCoord2dv; +PFNGLCOLOR3UBVPROC glad_glColor3ubv; +PFNGLVERTEXPOINTERPROC glad_glVertexPointer; +PFNGLSECONDARYCOLOR3UIVPROC glad_glSecondaryColor3uiv; +PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers; +PFNGLDRAWARRAYSPROC glad_glDrawArrays; +PFNGLUNIFORM1UIPROC glad_glUniform1ui; +PFNGLMULTITEXCOORD1DPROC glad_glMultiTexCoord1d; +PFNGLMULTITEXCOORD1FPROC glad_glMultiTexCoord1f; +PFNGLLIGHTFVPROC glad_glLightfv; +PFNGLTEXCOORDP3UIPROC glad_glTexCoordP3ui; +PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d; +PFNGLCLEARPROC glad_glClear; +PFNGLMULTITEXCOORD1IPROC glad_glMultiTexCoord1i; +PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName; +PFNGLMULTITEXCOORD1SPROC glad_glMultiTexCoord1s; +PFNGLISENABLEDPROC glad_glIsEnabled; +PFNGLSTENCILOPPROC glad_glStencilOp; +PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv; +PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv; +PFNGLTRANSLATEFPROC glad_glTranslatef; +PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub; +PFNGLTRANSLATEDPROC glad_glTranslated; +PFNGLTEXCOORD3SVPROC glad_glTexCoord3sv; +PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation; +PFNGLTEXIMAGE1DPROC glad_glTexImage1D; +PFNGLVERTEXP3UIVPROC glad_glVertexP3uiv; +PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv; +PFNGLSECONDARYCOLOR3BVPROC glad_glSecondaryColor3bv; +PFNGLGETMATERIALFVPROC glad_glGetMaterialfv; +PFNGLGETTEXIMAGEPROC glad_glGetTexImage; +PFNGLFOGCOORDFVPROC glad_glFogCoordfv; +PFNGLPIXELMAPUIVPROC glad_glPixelMapuiv; +PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog; +PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v; +PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers; +PFNGLINDEXSVPROC glad_glIndexsv; +PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders; +PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer; +PFNGLVERTEX3IVPROC glad_glVertex3iv; +PFNGLBITMAPPROC glad_glBitmap; +PFNGLMATERIALIPROC glad_glMateriali; +PFNGLISVERTEXARRAYPROC glad_glIsVertexArray; +PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray; +PFNGLGETQUERYIVPROC glad_glGetQueryiv; +PFNGLTEXCOORD4FPROC glad_glTexCoord4f; +PFNGLTEXCOORD4DPROC glad_glTexCoord4d; +PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv; +PFNGLTEXCOORD4IPROC glad_glTexCoord4i; +PFNGLMATERIALFPROC glad_glMaterialf; +PFNGLTEXCOORD4SPROC glad_glTexCoord4s; +PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices; +PFNGLISSHADERPROC glad_glIsShader; +PFNGLMULTITEXCOORD2SPROC glad_glMultiTexCoord2s; +PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv; +PFNGLVERTEX3DVPROC glad_glVertex3dv; +PFNGLGETINTEGER64VPROC glad_glGetInteger64v; +PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv; +PFNGLENABLEPROC glad_glEnable; +PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv; +PFNGLCOLOR4FVPROC glad_glColor4fv; +PFNGLTEXCOORD1FVPROC glad_glTexCoord1fv; +PFNGLTEXCOORD2SVPROC glad_glTexCoord2sv; +PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv; +PFNGLMULTITEXCOORD1DVPROC glad_glMultiTexCoord1dv; +PFNGLMULTITEXCOORD2IPROC glad_glMultiTexCoord2i; +PFNGLTEXCOORD3FVPROC glad_glTexCoord3fv; +PFNGLSECONDARYCOLOR3USVPROC glad_glSecondaryColor3usv; +PFNGLTEXGENFPROC glad_glTexGenf; +PFNGLMULTITEXCOORDP3UIVPROC glad_glMultiTexCoordP3uiv; +PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui; +PFNGLMULTITEXCOORDP1UIPROC glad_glMultiTexCoordP1ui; +PFNGLGETPOINTERVPROC glad_glGetPointerv; +PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset; +PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv; +PFNGLNORMAL3FVPROC glad_glNormal3fv; +PFNGLSECONDARYCOLOR3SPROC glad_glSecondaryColor3s; +PFNGLDEPTHRANGEPROC glad_glDepthRange; +PFNGLFRUSTUMPROC glad_glFrustum; +PFNGLMULTITEXCOORD4SVPROC glad_glMultiTexCoord4sv; +PFNGLDRAWBUFFERPROC glad_glDrawBuffer; +PFNGLPUSHMATRIXPROC glad_glPushMatrix; +PFNGLRASTERPOS3FVPROC glad_glRasterPos3fv; +PFNGLORTHOPROC glad_glOrtho; +PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced; +PFNGLWINDOWPOS3SVPROC glad_glWindowPos3sv; +PFNGLCLEARINDEXPROC glad_glClearIndex; +PFNGLMAP1DPROC glad_glMap1d; +PFNGLMAP1FPROC glad_glMap1f; +PFNGLFLUSHPROC glad_glFlush; +PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv; +PFNGLINDEXIVPROC glad_glIndexiv; +PFNGLRASTERPOS3SVPROC glad_glRasterPos3sv; +PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv; +PFNGLPIXELZOOMPROC glad_glPixelZoom; +PFNGLFENCESYNCPROC glad_glFenceSync; +PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays; +PFNGLCOLORP3UIPROC glad_glColorP3ui; +PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv; +PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender; +PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex; +PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv; +PFNGLLIGHTIPROC glad_glLighti; +PFNGLMULTITEXCOORDP4UIVPROC glad_glMultiTexCoordP4uiv; +PFNGLLIGHTFPROC glad_glLightf; +PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation; +PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate; +PFNGLGENSAMPLERSPROC glad_glGenSamplers; +PFNGLCLAMPCOLORPROC glad_glClampColor; +PFNGLUNIFORM4IVPROC glad_glUniform4iv; +PFNGLCLEARSTENCILPROC glad_glClearStencil; +PFNGLTEXCOORDP1UIVPROC glad_glTexCoordP1uiv; +PFNGLMULTITEXCOORD3FVPROC glad_glMultiTexCoord3fv; +PFNGLGETPIXELMAPUIVPROC glad_glGetPixelMapuiv; +PFNGLGENTEXTURESPROC glad_glGenTextures; +PFNGLTEXCOORD4IVPROC glad_glTexCoord4iv; +PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv; +PFNGLINDEXPOINTERPROC glad_glIndexPointer; +PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv; +PFNGLISSYNCPROC glad_glIsSync; +PFNGLVERTEX2FPROC glad_glVertex2f; +PFNGLVERTEX2DPROC glad_glVertex2d; +PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers; +PFNGLUNIFORM2IPROC glad_glUniform2i; +PFNGLMAPGRID2DPROC glad_glMapGrid2d; +PFNGLMAPGRID2FPROC glad_glMapGrid2f; +PFNGLTEXCOORDP4UIPROC glad_glTexCoordP4ui; +PFNGLVERTEX2IPROC glad_glVertex2i; +PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer; +PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer; +PFNGLVERTEX2SPROC glad_glVertex2s; +PFNGLNORMAL3BVPROC glad_glNormal3bv; +PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv; +PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange; +PFNGLSECONDARYCOLOR3SVPROC glad_glSecondaryColor3sv; +PFNGLVERTEX3SVPROC glad_glVertex3sv; +PFNGLGENQUERIESPROC glad_glGenQueries; +PFNGLGETPIXELMAPFVPROC glad_glGetPixelMapfv; +PFNGLTEXENVFPROC glad_glTexEnvf; +PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui; +PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D; +PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v; +PFNGLFOGCOORDDPROC glad_glFogCoordd; +PFNGLFOGCOORDFPROC glad_glFogCoordf; +PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D; +PFNGLTEXENVIPROC glad_glTexEnvi; +PFNGLMULTITEXCOORD1IVPROC glad_glMultiTexCoord1iv; +PFNGLISENABLEDIPROC glad_glIsEnabledi; +PFNGLSECONDARYCOLORP3UIPROC glad_glSecondaryColorP3ui; +PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i; +PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed; +PFNGLMULTITEXCOORD2DVPROC glad_glMultiTexCoord2dv; +PFNGLUNIFORM2IVPROC glad_glUniform2iv; +PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv; +PFNGLUNIFORM4UIVPROC glad_glUniform4uiv; +PFNGLMATRIXMODEPROC glad_glMatrixMode; +PFNGLFEEDBACKBUFFERPROC glad_glFeedbackBuffer; +PFNGLGETMAPIVPROC glad_glGetMapiv; +PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D; +PFNGLGETSHADERIVPROC glad_glGetShaderiv; +PFNGLMULTITEXCOORD2DPROC glad_glMultiTexCoord2d; +PFNGLMULTITEXCOORD2FPROC glad_glMultiTexCoord2f; +PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation; +PFNGLPRIORITIZETEXTURESPROC glad_glPrioritizeTextures; +PFNGLCALLLISTPROC glad_glCallList; +PFNGLSECONDARYCOLOR3UBVPROC glad_glSecondaryColor3ubv; +PFNGLGETDOUBLEVPROC glad_glGetDoublev; +PFNGLMULTITEXCOORD3IVPROC glad_glMultiTexCoord3iv; +PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d; +PFNGLLIGHTMODELFPROC glad_glLightModelf; +PFNGLGETUNIFORMIVPROC glad_glGetUniformiv; +PFNGLVERTEX2SVPROC glad_glVertex2sv; +PFNGLLIGHTMODELIPROC glad_glLightModeli; +PFNGLWINDOWPOS3IVPROC glad_glWindowPos3iv; +PFNGLMULTITEXCOORDP1UIVPROC glad_glMultiTexCoordP1uiv; +PFNGLUNIFORM3FVPROC glad_glUniform3fv; +PFNGLPIXELSTOREIPROC glad_glPixelStorei; +PFNGLCALLLISTSPROC glad_glCallLists; +PFNGLMAPBUFFERPROC glad_glMapBuffer; +PFNGLSECONDARYCOLOR3DPROC glad_glSecondaryColor3d; +PFNGLTEXCOORD3IPROC glad_glTexCoord3i; +PFNGLMULTITEXCOORD4FVPROC glad_glMultiTexCoord4fv; +PFNGLRASTERPOS3IPROC glad_glRasterPos3i; +PFNGLSECONDARYCOLOR3BPROC glad_glSecondaryColor3b; +PFNGLRASTERPOS3DPROC glad_glRasterPos3d; +PFNGLRASTERPOS3FPROC glad_glRasterPos3f; +PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D; +PFNGLTEXCOORD3FPROC glad_glTexCoord3f; +PFNGLDELETESYNCPROC glad_glDeleteSync; +PFNGLTEXCOORD3DPROC glad_glTexCoord3d; +PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample; +PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv; +PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements; +PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv; +PFNGLTEXCOORD3SPROC glad_glTexCoord3s; +PFNGLUNIFORM3IVPROC glad_glUniform3iv; +PFNGLRASTERPOS3SPROC glad_glRasterPos3s; +PFNGLPOLYGONMODEPROC glad_glPolygonMode; +PFNGLDRAWBUFFERSPROC glad_glDrawBuffers; +PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv; +PFNGLARETEXTURESRESIDENTPROC glad_glAreTexturesResident; +PFNGLISLISTPROC glad_glIsList; +PFNGLRASTERPOS2SVPROC glad_glRasterPos2sv; +PFNGLRASTERPOS4SVPROC glad_glRasterPos4sv; +PFNGLCOLOR4SPROC glad_glColor4s; +PFNGLUSEPROGRAMPROC glad_glUseProgram; +PFNGLLINESTIPPLEPROC glad_glLineStipple; +PFNGLMULTITEXCOORD1SVPROC glad_glMultiTexCoord1sv; +PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog; +PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv; +PFNGLMULTITEXCOORD2IVPROC glad_glMultiTexCoord2iv; +PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv; +PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray; +PFNGLCOLOR4BPROC glad_glColor4b; +PFNGLSECONDARYCOLOR3FPROC glad_glSecondaryColor3f; +PFNGLCOLOR4FPROC glad_glColor4f; +PFNGLCOLOR4DPROC glad_glColor4d; +PFNGLCOLOR4IPROC glad_glColor4i; +PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv; +PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex; +PFNGLRASTERPOS3IVPROC glad_glRasterPos3iv; +PFNGLVERTEX2DVPROC glad_glVertex2dv; +PFNGLTEXCOORD4SVPROC glad_glTexCoord4sv; +PFNGLUNIFORM2UIVPROC glad_glUniform2uiv; +PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D; +PFNGLFINISHPROC glad_glFinish; +PFNGLGETBOOLEANVPROC glad_glGetBooleanv; +PFNGLDELETESHADERPROC glad_glDeleteShader; +PFNGLDRAWELEMENTSPROC glad_glDrawElements; +PFNGLRASTERPOS2SPROC glad_glRasterPos2s; +PFNGLGETMAPDVPROC glad_glGetMapdv; +PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv; +PFNGLMATERIALFVPROC glad_glMaterialfv; +PFNGLVIEWPORTPROC glad_glViewport; +PFNGLUNIFORM1UIVPROC glad_glUniform1uiv; +PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings; +PFNGLINDEXDVPROC glad_glIndexdv; +PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D; +PFNGLTEXCOORD3IVPROC glad_glTexCoord3iv; +PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i; +PFNGLCLEARDEPTHPROC glad_glClearDepth; +PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv; +PFNGLTEXPARAMETERFPROC glad_glTexParameterf; +PFNGLTEXPARAMETERIPROC glad_glTexParameteri; +PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource; +PFNGLTEXBUFFERPROC glad_glTexBuffer; +PFNGLPOPNAMEPROC glad_glPopName; +PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram; +PFNGLPIXELSTOREFPROC glad_glPixelStoref; +PFNGLUNIFORM3UIVPROC glad_glUniform3uiv; +PFNGLRASTERPOS4FVPROC glad_glRasterPos4fv; +PFNGLEVALCOORD1DVPROC glad_glEvalCoord1dv; +PFNGLMULTITEXCOORDP2UIVPROC glad_glMultiTexCoordP2uiv; +PFNGLRECTIPROC glad_glRecti; +PFNGLCOLOR4UBPROC glad_glColor4ub; +PFNGLMULTTRANSPOSEMATRIXFPROC glad_glMultTransposeMatrixf; +PFNGLRECTFPROC glad_glRectf; +PFNGLRECTDPROC glad_glRectd; +PFNGLNORMAL3SVPROC glad_glNormal3sv; +PFNGLNEWLISTPROC glad_glNewList; +PFNGLCOLOR4USPROC glad_glColor4us; +PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv; +PFNGLLINKPROGRAMPROC glad_glLinkProgram; +PFNGLHINTPROC glad_glHint; +PFNGLRECTSPROC glad_glRects; +PFNGLTEXCOORD2DVPROC glad_glTexCoord2dv; +PFNGLRASTERPOS4IVPROC glad_glRasterPos4iv; +PFNGLGETSTRINGPROC glad_glGetString; +PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv; +PFNGLEDGEFLAGVPROC glad_glEdgeFlagv; +PFNGLDETACHSHADERPROC glad_glDetachShader; +PFNGLSCALEFPROC glad_glScalef; +PFNGLENDQUERYPROC glad_glEndQuery; +PFNGLSCALEDPROC glad_glScaled; +PFNGLEDGEFLAGPOINTERPROC glad_glEdgeFlagPointer; +PFNGLCOPYPIXELSPROC glad_glCopyPixels; +PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui; +PFNGLPOPATTRIBPROC glad_glPopAttrib; +PFNGLDELETETEXTURESPROC glad_glDeleteTextures; +PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate; +PFNGLDELETEQUERIESPROC glad_glDeleteQueries; +PFNGLNORMALP3UIVPROC glad_glNormalP3uiv; +PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f; +PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d; +PFNGLINITNAMESPROC glad_glInitNames; +PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v; +PFNGLCOLOR3DVPROC glad_glColor3dv; +PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i; +PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv; +PFNGLWAITSYNCPROC glad_glWaitSync; +PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s; +PFNGLCOLORMATERIALPROC glad_glColorMaterial; +PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage; +PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri; +PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf; +PFNGLUNIFORM1FPROC glad_glUniform1f; +PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv; +PFNGLRENDERMODEPROC glad_glRenderMode; +PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage; +PFNGLWINDOWPOS2DVPROC glad_glWindowPos2dv; +PFNGLUNIFORM1IPROC glad_glUniform1i; +PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib; +PFNGLUNIFORM3IPROC glad_glUniform3i; +PFNGLPIXELTRANSFERIPROC glad_glPixelTransferi; +PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D; +PFNGLDISABLEPROC glad_glDisable; +PFNGLLOGICOPPROC glad_glLogicOp; +PFNGLEVALPOINT2PROC glad_glEvalPoint2; +PFNGLPIXELTRANSFERFPROC glad_glPixelTransferf; +PFNGLSECONDARYCOLOR3IPROC glad_glSecondaryColor3i; +PFNGLUNIFORM4UIPROC glad_glUniform4ui; +PFNGLCOLOR3FPROC glad_glColor3f; +PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer; +PFNGLGETTEXENVFVPROC glad_glGetTexEnvfv; +PFNGLRECTFVPROC glad_glRectfv; +PFNGLCULLFACEPROC glad_glCullFace; +PFNGLGETLIGHTFVPROC glad_glGetLightfv; +PFNGLCOLOR3DPROC glad_glColor3d; +PFNGLTEXGENDPROC glad_glTexGend; +PFNGLTEXGENIPROC glad_glTexGeni; +PFNGLMULTITEXCOORD3SPROC glad_glMultiTexCoord3s; +PFNGLGETSTRINGIPROC glad_glGetStringi; +PFNGLMULTITEXCOORD3IPROC glad_glMultiTexCoord3i; +PFNGLMULTITEXCOORD3FPROC glad_glMultiTexCoord3f; +PFNGLMULTITEXCOORD3DPROC glad_glMultiTexCoord3d; +PFNGLATTACHSHADERPROC glad_glAttachShader; +PFNGLFOGCOORDDVPROC glad_glFogCoorddv; +PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv; +PFNGLGETTEXGENFVPROC glad_glGetTexGenfv; +PFNGLQUERYCOUNTERPROC glad_glQueryCounter; +PFNGLFOGCOORDPOINTERPROC glad_glFogCoordPointer; +PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex; +PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D; +PFNGLTEXGENIVPROC glad_glTexGeniv; +PFNGLRASTERPOS2DVPROC glad_glRasterPos2dv; +PFNGLSECONDARYCOLOR3DVPROC glad_glSecondaryColor3dv; +PFNGLCLIENTACTIVETEXTUREPROC glad_glClientActiveTexture; +PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv; +PFNGLSECONDARYCOLOR3USPROC glad_glSecondaryColor3us; +PFNGLNORMALP3UIPROC glad_glNormalP3ui; +PFNGLTEXENVFVPROC glad_glTexEnvfv; +PFNGLREADBUFFERPROC glad_glReadBuffer; +PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv; +PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced; +PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap; +PFNGLWINDOWPOS3FVPROC glad_glWindowPos3fv; +PFNGLLIGHTMODELFVPROC glad_glLightModelfv; +PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv; +PFNGLDELETELISTSPROC glad_glDeleteLists; +PFNGLGETCLIPPLANEPROC glad_glGetClipPlane; +PFNGLVERTEX4DVPROC glad_glVertex4dv; +PFNGLTEXCOORD2DPROC glad_glTexCoord2d; +PFNGLPOPMATRIXPROC glad_glPopMatrix; +PFNGLTEXCOORD2FPROC glad_glTexCoord2f; +PFNGLCOLOR4IVPROC glad_glColor4iv; +PFNGLINDEXUBVPROC glad_glIndexubv; +PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer; +PFNGLTEXCOORD2IPROC glad_glTexCoord2i; +PFNGLRASTERPOS4DPROC glad_glRasterPos4d; +PFNGLRASTERPOS4FPROC glad_glRasterPos4f; +PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s; +PFNGLTEXCOORD2SPROC glad_glTexCoord2s; +PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer; +PFNGLVERTEX3FVPROC glad_glVertex3fv; +PFNGLTEXCOORD4DVPROC glad_glTexCoord4dv; +PFNGLMATERIALIVPROC glad_glMaterialiv; +PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv; +PFNGLISPROGRAMPROC glad_glIsProgram; +PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv; +PFNGLVERTEX4SPROC glad_glVertex4s; +PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv; +PFNGLNORMAL3DVPROC glad_glNormal3dv; +PFNGLUNIFORM4IPROC glad_glUniform4i; +PFNGLACTIVETEXTUREPROC glad_glActiveTexture; +PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray; +PFNGLROTATEDPROC glad_glRotated; +PFNGLROTATEFPROC glad_glRotatef; +PFNGLVERTEX4IPROC glad_glVertex4i; +PFNGLREADPIXELSPROC glad_glReadPixels; +PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv; +PFNGLLOADNAMEPROC glad_glLoadName; +PFNGLUNIFORM4FPROC glad_glUniform4f; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample; +PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays; +PFNGLSHADEMODELPROC glad_glShadeModel; +PFNGLMAPGRID1DPROC glad_glMapGrid1d; +PFNGLGETUNIFORMFVPROC glad_glGetUniformfv; +PFNGLMAPGRID1FPROC glad_glMapGrid1f; +PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv; +PFNGLDISABLECLIENTSTATEPROC glad_glDisableClientState; +PFNGLMULTITEXCOORD3SVPROC glad_glMultiTexCoord3sv; +PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex; +PFNGLSECONDARYCOLORPOINTERPROC glad_glSecondaryColorPointer; +PFNGLALPHAFUNCPROC glad_glAlphaFunc; +PFNGLUNIFORM1IVPROC glad_glUniform1iv; +PFNGLMULTITEXCOORD4IVPROC glad_glMultiTexCoord4iv; +PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv; +PFNGLSTENCILFUNCPROC glad_glStencilFunc; +PFNGLMULTITEXCOORD1FVPROC glad_glMultiTexCoord1fv; +PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding; +PFNGLCOLOR4UIVPROC glad_glColor4uiv; +PFNGLRECTIVPROC glad_glRectiv; +PFNGLCOLORP4UIPROC glad_glColorP4ui; +PFNGLRASTERPOS3DVPROC glad_glRasterPos3dv; +PFNGLEVALMESH2PROC glad_glEvalMesh2; +PFNGLEVALMESH1PROC glad_glEvalMesh1; +PFNGLTEXCOORDPOINTERPROC glad_glTexCoordPointer; +PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv; +PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv; +PFNGLEVALCOORD2FVPROC glad_glEvalCoord2fv; +PFNGLCOLOR4UBVPROC glad_glColor4ubv; +PFNGLLOADTRANSPOSEMATRIXDPROC glad_glLoadTransposeMatrixd; +PFNGLLOADTRANSPOSEMATRIXFPROC glad_glLoadTransposeMatrixf; +PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i; +PFNGLRASTERPOS2IVPROC glad_glRasterPos2iv; +PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData; +PFNGLTEXENVIVPROC glad_glTexEnviv; +PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate; +PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui; +PFNGLGENBUFFERSPROC glad_glGenBuffers; +PFNGLSELECTBUFFERPROC glad_glSelectBuffer; +PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv; +PFNGLPUSHATTRIBPROC glad_glPushAttrib; +PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer; +PFNGLBLENDFUNCPROC glad_glBlendFunc; +PFNGLCREATEPROGRAMPROC glad_glCreateProgram; +PFNGLTEXIMAGE3DPROC glad_glTexImage3D; +PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer; +PFNGLLIGHTIVPROC glad_glLightiv; +PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex; +PFNGLTEXGENFVPROC glad_glTexGenfv; +PFNGLENDPROC glad_glEnd; +PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers; +PFNGLSCISSORPROC glad_glScissor; +PFNGLTEXCOORDP4UIVPROC glad_glTexCoordP4uiv; +PFNGLCLIPPLANEPROC glad_glClipPlane; +PFNGLPUSHNAMEPROC glad_glPushName; +PFNGLTEXGENDVPROC glad_glTexGendv; +PFNGLINDEXUBPROC glad_glIndexub; +PFNGLVERTEXP2UIVPROC glad_glVertexP2uiv; +PFNGLSECONDARYCOLOR3IVPROC glad_glSecondaryColor3iv; +PFNGLRASTERPOS4IPROC glad_glRasterPos4i; +PFNGLMULTTRANSPOSEMATRIXDPROC glad_glMultTransposeMatrixd; +PFNGLCLEARCOLORPROC glad_glClearColor; +PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv; +PFNGLNORMAL3SPROC glad_glNormal3s; +PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv; +PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv; +PFNGLPOINTPARAMETERIPROC glad_glPointParameteri; +PFNGLCOLORP4UIVPROC glad_glColorP4uiv; +PFNGLBLENDCOLORPROC glad_glBlendColor; +PFNGLWINDOWPOS3DPROC glad_glWindowPos3d; +PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv; +PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv; +PFNGLUNIFORM3UIPROC glad_glUniform3ui; +PFNGLCOLOR4DVPROC glad_glColor4dv; +PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv; +PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv; +PFNGLUNIFORM2FVPROC glad_glUniform2fv; +PFNGLSECONDARYCOLOR3UBPROC glad_glSecondaryColor3ub; +PFNGLSECONDARYCOLOR3UIPROC glad_glSecondaryColor3ui; +PFNGLTEXCOORD3DVPROC glad_glTexCoord3dv; +PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv; +PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange; +PFNGLNORMAL3IVPROC glad_glNormal3iv; +PFNGLWINDOWPOS3SPROC glad_glWindowPos3s; +PFNGLPOINTPARAMETERFPROC glad_glPointParameterf; +PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv; +PFNGLWINDOWPOS3IPROC glad_glWindowPos3i; +PFNGLMULTITEXCOORD4SPROC glad_glMultiTexCoord4s; +PFNGLWINDOWPOS3FPROC glad_glWindowPos3f; +PFNGLCOLOR3USPROC glad_glColor3us; +PFNGLCOLOR3UIVPROC glad_glColor3uiv; +PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv; +PFNGLGETLIGHTIVPROC glad_glGetLightiv; +PFNGLDEPTHFUNCPROC glad_glDepthFunc; +PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D; +PFNGLLISTBASEPROC glad_glListBase; +PFNGLMULTITEXCOORD4FPROC glad_glMultiTexCoord4f; +PFNGLCOLOR3UBPROC glad_glColor3ub; +PFNGLMULTITEXCOORD4DPROC glad_glMultiTexCoord4d; +PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv; +PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv; +PFNGLCOLOR3UIPROC glad_glColor3ui; +PFNGLMULTITEXCOORD4IPROC glad_glMultiTexCoord4i; +PFNGLGETPOLYGONSTIPPLEPROC glad_glGetPolygonStipple; +PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync; +PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui; +PFNGLMULTITEXCOORD4DVPROC glad_glMultiTexCoord4dv; +PFNGLCOLORMASKPROC glad_glColorMask; +PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv; +PFNGLBLENDEQUATIONPROC glad_glBlendEquation; +PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation; +PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv; +PFNGLRASTERPOS4SPROC glad_glRasterPos4s; +PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback; +PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv; +PFNGLMULTITEXCOORD3DVPROC glad_glMultiTexCoord3dv; +PFNGLCOLOR4SVPROC glad_glColor4sv; +PFNGLPOPCLIENTATTRIBPROC glad_glPopClientAttrib; +PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback; +PFNGLFOGFPROC glad_glFogf; +PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv; +PFNGLISSAMPLERPROC glad_glIsSampler; +PFNGLVERTEXP3UIPROC glad_glVertexP3ui; +PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor; +PFNGLCOLOR3IVPROC glad_glColor3iv; +PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D; +PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D; +PFNGLTEXCOORD1IPROC glad_glTexCoord1i; +PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus; +PFNGLTEXCOORD1DPROC glad_glTexCoord1d; +PFNGLTEXCOORD1FPROC glad_glTexCoord1f; +PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender; +PFNGLENABLECLIENTSTATEPROC glad_glEnableClientState; +PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation; +PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv; +PFNGLMULTITEXCOORD2SVPROC glad_glMultiTexCoord2sv; +PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv; +PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements; +PFNGLTEXCOORD1SPROC glad_glTexCoord1s; +PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase; +PFNGLBUFFERSUBDATAPROC glad_glBufferSubData; +PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv; +PFNGLGENLISTSPROC glad_glGenLists; +PFNGLCOLOR3BVPROC glad_glColor3bv; +PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange; +PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture; +PFNGLGETTEXGENDVPROC glad_glGetTexGendv; +PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays; +PFNGLENDLISTPROC glad_glEndList; +PFNGLVERTEXP4UIVPROC glad_glVertexP4uiv; +PFNGLUNIFORM2UIPROC glad_glUniform2ui; +PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv; +PFNGLCOLOR3USVPROC glad_glColor3usv; +PFNGLWINDOWPOS2FVPROC glad_glWindowPos2fv; +PFNGLDISABLEIPROC glad_glDisablei; +PFNGLINDEXMASKPROC glad_glIndexMask; +PFNGLPUSHCLIENTATTRIBPROC glad_glPushClientAttrib; +PFNGLSHADERSOURCEPROC glad_glShaderSource; +PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName; +PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv; +PFNGLCLEARACCUMPROC glad_glClearAccum; +PFNGLGETSYNCIVPROC glad_glGetSynciv; +PFNGLTEXCOORDP2UIVPROC glad_glTexCoordP2uiv; +PFNGLUNIFORM2FPROC glad_glUniform2f; +PFNGLBEGINQUERYPROC glad_glBeginQuery; +PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex; +PFNGLBINDBUFFERPROC glad_glBindBuffer; +PFNGLMAP2DPROC glad_glMap2d; +PFNGLMAP2FPROC glad_glMap2f; +PFNGLVERTEX4DPROC glad_glVertex4d; +PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv; +PFNGLTEXCOORD1SVPROC glad_glTexCoord1sv; +PFNGLBUFFERDATAPROC glad_glBufferData; +PFNGLEVALPOINT1PROC glad_glEvalPoint1; +PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv; +PFNGLTEXCOORD1DVPROC glad_glTexCoord1dv; +PFNGLTEXCOORDP1UIPROC glad_glTexCoordP1ui; +PFNGLGETERRORPROC glad_glGetError; +PFNGLGETTEXENVIVPROC glad_glGetTexEnviv; +PFNGLGETPROGRAMIVPROC glad_glGetProgramiv; +PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui; +PFNGLGETFLOATVPROC glad_glGetFloatv; +PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D; +PFNGLMULTITEXCOORD2FVPROC glad_glMultiTexCoord2fv; +PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv; +PFNGLEVALCOORD1DPROC glad_glEvalCoord1d; +PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv; +PFNGLEVALCOORD1FPROC glad_glEvalCoord1f; +PFNGLPIXELMAPFVPROC glad_glPixelMapfv; +PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv; +PFNGLGETPIXELMAPUSVPROC glad_glGetPixelMapusv; +PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv; +PFNGLGETINTEGERVPROC glad_glGetIntegerv; +PFNGLACCUMPROC glad_glAccum; +PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv; +PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv; +PFNGLRASTERPOS4DVPROC glad_glRasterPos4dv; +PFNGLTEXCOORD2IVPROC glad_glTexCoord2iv; +PFNGLISQUERYPROC glad_glIsQuery; +PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv; +PFNGLWINDOWPOS3DVPROC glad_glWindowPos3dv; +PFNGLTEXIMAGE2DPROC glad_glTexImage2D; +PFNGLSTENCILMASKPROC glad_glStencilMask; +PFNGLDRAWPIXELSPROC glad_glDrawPixels; +PFNGLMULTMATRIXDPROC glad_glMultMatrixd; +PFNGLMULTMATRIXFPROC glad_glMultMatrixf; +PFNGLISTEXTUREPROC glad_glIsTexture; +PFNGLGETMATERIALIVPROC glad_glGetMaterialiv; +PFNGLUNIFORM1FVPROC glad_glUniform1fv; +PFNGLLOADMATRIXFPROC glad_glLoadMatrixf; +PFNGLLOADMATRIXDPROC glad_glLoadMatrixd; +PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv; +PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv; +PFNGLVERTEX4FPROC glad_glVertex4f; +PFNGLRECTSVPROC glad_glRectsv; +PFNGLCOLOR4USVPROC glad_glColor4usv; +PFNGLPOLYGONSTIPPLEPROC glad_glPolygonStipple; +PFNGLINTERLEAVEDARRAYSPROC glad_glInterleavedArrays; +PFNGLNORMAL3IPROC glad_glNormal3i; +PFNGLNORMAL3FPROC glad_glNormal3f; +PFNGLNORMAL3DPROC glad_glNormal3d; +PFNGLNORMAL3BPROC glad_glNormal3b; +PFNGLPIXELMAPUSVPROC glad_glPixelMapusv; +PFNGLGETTEXGENIVPROC glad_glGetTexGeniv; +PFNGLARRAYELEMENTPROC glad_glArrayElement; +PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData; +PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv; +PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d; +PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f; +PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv; +PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v; +PFNGLDEPTHMASKPROC glad_glDepthMask; +PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s; +PFNGLCOLOR3FVPROC glad_glColor3fv; +PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample; +PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv; +PFNGLUNIFORM4FVPROC glad_glUniform4fv; +PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform; +PFNGLCOLORPOINTERPROC glad_glColorPointer; +PFNGLFRONTFACEPROC glad_glFrontFace; +PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v; +PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv; +int GLAD_GL_ARB_debug_output; +PFNGLDEBUGMESSAGECONTROLARBPROC glad_glDebugMessageControlARB; +PFNGLDEBUGMESSAGEINSERTARBPROC glad_glDebugMessageInsertARB; +PFNGLDEBUGMESSAGECALLBACKARBPROC glad_glDebugMessageCallbackARB; +PFNGLGETDEBUGMESSAGELOGARBPROC glad_glGetDebugMessageLogARB; +static void load_GL_VERSION_1_0(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_0) return; + glad_glCullFace = (PFNGLCULLFACEPROC)load("glCullFace"); + glad_glFrontFace = (PFNGLFRONTFACEPROC)load("glFrontFace"); + glad_glHint = (PFNGLHINTPROC)load("glHint"); + glad_glLineWidth = (PFNGLLINEWIDTHPROC)load("glLineWidth"); + glad_glPointSize = (PFNGLPOINTSIZEPROC)load("glPointSize"); + glad_glPolygonMode = (PFNGLPOLYGONMODEPROC)load("glPolygonMode"); + glad_glScissor = (PFNGLSCISSORPROC)load("glScissor"); + glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC)load("glTexParameterf"); + glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC)load("glTexParameterfv"); + glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC)load("glTexParameteri"); + glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC)load("glTexParameteriv"); + glad_glTexImage1D = (PFNGLTEXIMAGE1DPROC)load("glTexImage1D"); + glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC)load("glTexImage2D"); + glad_glDrawBuffer = (PFNGLDRAWBUFFERPROC)load("glDrawBuffer"); + glad_glClear = (PFNGLCLEARPROC)load("glClear"); + glad_glClearColor = (PFNGLCLEARCOLORPROC)load("glClearColor"); + glad_glClearStencil = (PFNGLCLEARSTENCILPROC)load("glClearStencil"); + glad_glClearDepth = (PFNGLCLEARDEPTHPROC)load("glClearDepth"); + glad_glStencilMask = (PFNGLSTENCILMASKPROC)load("glStencilMask"); + glad_glColorMask = (PFNGLCOLORMASKPROC)load("glColorMask"); + glad_glDepthMask = (PFNGLDEPTHMASKPROC)load("glDepthMask"); + glad_glDisable = (PFNGLDISABLEPROC)load("glDisable"); + glad_glEnable = (PFNGLENABLEPROC)load("glEnable"); + glad_glFinish = (PFNGLFINISHPROC)load("glFinish"); + glad_glFlush = (PFNGLFLUSHPROC)load("glFlush"); + glad_glBlendFunc = (PFNGLBLENDFUNCPROC)load("glBlendFunc"); + glad_glLogicOp = (PFNGLLOGICOPPROC)load("glLogicOp"); + glad_glStencilFunc = (PFNGLSTENCILFUNCPROC)load("glStencilFunc"); + glad_glStencilOp = (PFNGLSTENCILOPPROC)load("glStencilOp"); + glad_glDepthFunc = (PFNGLDEPTHFUNCPROC)load("glDepthFunc"); + glad_glPixelStoref = (PFNGLPIXELSTOREFPROC)load("glPixelStoref"); + glad_glPixelStorei = (PFNGLPIXELSTOREIPROC)load("glPixelStorei"); + glad_glReadBuffer = (PFNGLREADBUFFERPROC)load("glReadBuffer"); + glad_glReadPixels = (PFNGLREADPIXELSPROC)load("glReadPixels"); + glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC)load("glGetBooleanv"); + glad_glGetDoublev = (PFNGLGETDOUBLEVPROC)load("glGetDoublev"); + glad_glGetError = (PFNGLGETERRORPROC)load("glGetError"); + glad_glGetFloatv = (PFNGLGETFLOATVPROC)load("glGetFloatv"); + glad_glGetIntegerv = (PFNGLGETINTEGERVPROC)load("glGetIntegerv"); + glad_glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); + glad_glGetTexImage = (PFNGLGETTEXIMAGEPROC)load("glGetTexImage"); + glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC)load("glGetTexParameterfv"); + glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC)load("glGetTexParameteriv"); + glad_glGetTexLevelParameterfv = (PFNGLGETTEXLEVELPARAMETERFVPROC)load("glGetTexLevelParameterfv"); + glad_glGetTexLevelParameteriv = (PFNGLGETTEXLEVELPARAMETERIVPROC)load("glGetTexLevelParameteriv"); + glad_glIsEnabled = (PFNGLISENABLEDPROC)load("glIsEnabled"); + glad_glDepthRange = (PFNGLDEPTHRANGEPROC)load("glDepthRange"); + glad_glViewport = (PFNGLVIEWPORTPROC)load("glViewport"); + glad_glNewList = (PFNGLNEWLISTPROC)load("glNewList"); + glad_glEndList = (PFNGLENDLISTPROC)load("glEndList"); + glad_glCallList = (PFNGLCALLLISTPROC)load("glCallList"); + glad_glCallLists = (PFNGLCALLLISTSPROC)load("glCallLists"); + glad_glDeleteLists = (PFNGLDELETELISTSPROC)load("glDeleteLists"); + glad_glGenLists = (PFNGLGENLISTSPROC)load("glGenLists"); + glad_glListBase = (PFNGLLISTBASEPROC)load("glListBase"); + glad_glBegin = (PFNGLBEGINPROC)load("glBegin"); + glad_glBitmap = (PFNGLBITMAPPROC)load("glBitmap"); + glad_glColor3b = (PFNGLCOLOR3BPROC)load("glColor3b"); + glad_glColor3bv = (PFNGLCOLOR3BVPROC)load("glColor3bv"); + glad_glColor3d = (PFNGLCOLOR3DPROC)load("glColor3d"); + glad_glColor3dv = (PFNGLCOLOR3DVPROC)load("glColor3dv"); + glad_glColor3f = (PFNGLCOLOR3FPROC)load("glColor3f"); + glad_glColor3fv = (PFNGLCOLOR3FVPROC)load("glColor3fv"); + glad_glColor3i = (PFNGLCOLOR3IPROC)load("glColor3i"); + glad_glColor3iv = (PFNGLCOLOR3IVPROC)load("glColor3iv"); + glad_glColor3s = (PFNGLCOLOR3SPROC)load("glColor3s"); + glad_glColor3sv = (PFNGLCOLOR3SVPROC)load("glColor3sv"); + glad_glColor3ub = (PFNGLCOLOR3UBPROC)load("glColor3ub"); + glad_glColor3ubv = (PFNGLCOLOR3UBVPROC)load("glColor3ubv"); + glad_glColor3ui = (PFNGLCOLOR3UIPROC)load("glColor3ui"); + glad_glColor3uiv = (PFNGLCOLOR3UIVPROC)load("glColor3uiv"); + glad_glColor3us = (PFNGLCOLOR3USPROC)load("glColor3us"); + glad_glColor3usv = (PFNGLCOLOR3USVPROC)load("glColor3usv"); + glad_glColor4b = (PFNGLCOLOR4BPROC)load("glColor4b"); + glad_glColor4bv = (PFNGLCOLOR4BVPROC)load("glColor4bv"); + glad_glColor4d = (PFNGLCOLOR4DPROC)load("glColor4d"); + glad_glColor4dv = (PFNGLCOLOR4DVPROC)load("glColor4dv"); + glad_glColor4f = (PFNGLCOLOR4FPROC)load("glColor4f"); + glad_glColor4fv = (PFNGLCOLOR4FVPROC)load("glColor4fv"); + glad_glColor4i = (PFNGLCOLOR4IPROC)load("glColor4i"); + glad_glColor4iv = (PFNGLCOLOR4IVPROC)load("glColor4iv"); + glad_glColor4s = (PFNGLCOLOR4SPROC)load("glColor4s"); + glad_glColor4sv = (PFNGLCOLOR4SVPROC)load("glColor4sv"); + glad_glColor4ub = (PFNGLCOLOR4UBPROC)load("glColor4ub"); + glad_glColor4ubv = (PFNGLCOLOR4UBVPROC)load("glColor4ubv"); + glad_glColor4ui = (PFNGLCOLOR4UIPROC)load("glColor4ui"); + glad_glColor4uiv = (PFNGLCOLOR4UIVPROC)load("glColor4uiv"); + glad_glColor4us = (PFNGLCOLOR4USPROC)load("glColor4us"); + glad_glColor4usv = (PFNGLCOLOR4USVPROC)load("glColor4usv"); + glad_glEdgeFlag = (PFNGLEDGEFLAGPROC)load("glEdgeFlag"); + glad_glEdgeFlagv = (PFNGLEDGEFLAGVPROC)load("glEdgeFlagv"); + glad_glEnd = (PFNGLENDPROC)load("glEnd"); + glad_glIndexd = (PFNGLINDEXDPROC)load("glIndexd"); + glad_glIndexdv = (PFNGLINDEXDVPROC)load("glIndexdv"); + glad_glIndexf = (PFNGLINDEXFPROC)load("glIndexf"); + glad_glIndexfv = (PFNGLINDEXFVPROC)load("glIndexfv"); + glad_glIndexi = (PFNGLINDEXIPROC)load("glIndexi"); + glad_glIndexiv = (PFNGLINDEXIVPROC)load("glIndexiv"); + glad_glIndexs = (PFNGLINDEXSPROC)load("glIndexs"); + glad_glIndexsv = (PFNGLINDEXSVPROC)load("glIndexsv"); + glad_glNormal3b = (PFNGLNORMAL3BPROC)load("glNormal3b"); + glad_glNormal3bv = (PFNGLNORMAL3BVPROC)load("glNormal3bv"); + glad_glNormal3d = (PFNGLNORMAL3DPROC)load("glNormal3d"); + glad_glNormal3dv = (PFNGLNORMAL3DVPROC)load("glNormal3dv"); + glad_glNormal3f = (PFNGLNORMAL3FPROC)load("glNormal3f"); + glad_glNormal3fv = (PFNGLNORMAL3FVPROC)load("glNormal3fv"); + glad_glNormal3i = (PFNGLNORMAL3IPROC)load("glNormal3i"); + glad_glNormal3iv = (PFNGLNORMAL3IVPROC)load("glNormal3iv"); + glad_glNormal3s = (PFNGLNORMAL3SPROC)load("glNormal3s"); + glad_glNormal3sv = (PFNGLNORMAL3SVPROC)load("glNormal3sv"); + glad_glRasterPos2d = (PFNGLRASTERPOS2DPROC)load("glRasterPos2d"); + glad_glRasterPos2dv = (PFNGLRASTERPOS2DVPROC)load("glRasterPos2dv"); + glad_glRasterPos2f = (PFNGLRASTERPOS2FPROC)load("glRasterPos2f"); + glad_glRasterPos2fv = (PFNGLRASTERPOS2FVPROC)load("glRasterPos2fv"); + glad_glRasterPos2i = (PFNGLRASTERPOS2IPROC)load("glRasterPos2i"); + glad_glRasterPos2iv = (PFNGLRASTERPOS2IVPROC)load("glRasterPos2iv"); + glad_glRasterPos2s = (PFNGLRASTERPOS2SPROC)load("glRasterPos2s"); + glad_glRasterPos2sv = (PFNGLRASTERPOS2SVPROC)load("glRasterPos2sv"); + glad_glRasterPos3d = (PFNGLRASTERPOS3DPROC)load("glRasterPos3d"); + glad_glRasterPos3dv = (PFNGLRASTERPOS3DVPROC)load("glRasterPos3dv"); + glad_glRasterPos3f = (PFNGLRASTERPOS3FPROC)load("glRasterPos3f"); + glad_glRasterPos3fv = (PFNGLRASTERPOS3FVPROC)load("glRasterPos3fv"); + glad_glRasterPos3i = (PFNGLRASTERPOS3IPROC)load("glRasterPos3i"); + glad_glRasterPos3iv = (PFNGLRASTERPOS3IVPROC)load("glRasterPos3iv"); + glad_glRasterPos3s = (PFNGLRASTERPOS3SPROC)load("glRasterPos3s"); + glad_glRasterPos3sv = (PFNGLRASTERPOS3SVPROC)load("glRasterPos3sv"); + glad_glRasterPos4d = (PFNGLRASTERPOS4DPROC)load("glRasterPos4d"); + glad_glRasterPos4dv = (PFNGLRASTERPOS4DVPROC)load("glRasterPos4dv"); + glad_glRasterPos4f = (PFNGLRASTERPOS4FPROC)load("glRasterPos4f"); + glad_glRasterPos4fv = (PFNGLRASTERPOS4FVPROC)load("glRasterPos4fv"); + glad_glRasterPos4i = (PFNGLRASTERPOS4IPROC)load("glRasterPos4i"); + glad_glRasterPos4iv = (PFNGLRASTERPOS4IVPROC)load("glRasterPos4iv"); + glad_glRasterPos4s = (PFNGLRASTERPOS4SPROC)load("glRasterPos4s"); + glad_glRasterPos4sv = (PFNGLRASTERPOS4SVPROC)load("glRasterPos4sv"); + glad_glRectd = (PFNGLRECTDPROC)load("glRectd"); + glad_glRectdv = (PFNGLRECTDVPROC)load("glRectdv"); + glad_glRectf = (PFNGLRECTFPROC)load("glRectf"); + glad_glRectfv = (PFNGLRECTFVPROC)load("glRectfv"); + glad_glRecti = (PFNGLRECTIPROC)load("glRecti"); + glad_glRectiv = (PFNGLRECTIVPROC)load("glRectiv"); + glad_glRects = (PFNGLRECTSPROC)load("glRects"); + glad_glRectsv = (PFNGLRECTSVPROC)load("glRectsv"); + glad_glTexCoord1d = (PFNGLTEXCOORD1DPROC)load("glTexCoord1d"); + glad_glTexCoord1dv = (PFNGLTEXCOORD1DVPROC)load("glTexCoord1dv"); + glad_glTexCoord1f = (PFNGLTEXCOORD1FPROC)load("glTexCoord1f"); + glad_glTexCoord1fv = (PFNGLTEXCOORD1FVPROC)load("glTexCoord1fv"); + glad_glTexCoord1i = (PFNGLTEXCOORD1IPROC)load("glTexCoord1i"); + glad_glTexCoord1iv = (PFNGLTEXCOORD1IVPROC)load("glTexCoord1iv"); + glad_glTexCoord1s = (PFNGLTEXCOORD1SPROC)load("glTexCoord1s"); + glad_glTexCoord1sv = (PFNGLTEXCOORD1SVPROC)load("glTexCoord1sv"); + glad_glTexCoord2d = (PFNGLTEXCOORD2DPROC)load("glTexCoord2d"); + glad_glTexCoord2dv = (PFNGLTEXCOORD2DVPROC)load("glTexCoord2dv"); + glad_glTexCoord2f = (PFNGLTEXCOORD2FPROC)load("glTexCoord2f"); + glad_glTexCoord2fv = (PFNGLTEXCOORD2FVPROC)load("glTexCoord2fv"); + glad_glTexCoord2i = (PFNGLTEXCOORD2IPROC)load("glTexCoord2i"); + glad_glTexCoord2iv = (PFNGLTEXCOORD2IVPROC)load("glTexCoord2iv"); + glad_glTexCoord2s = (PFNGLTEXCOORD2SPROC)load("glTexCoord2s"); + glad_glTexCoord2sv = (PFNGLTEXCOORD2SVPROC)load("glTexCoord2sv"); + glad_glTexCoord3d = (PFNGLTEXCOORD3DPROC)load("glTexCoord3d"); + glad_glTexCoord3dv = (PFNGLTEXCOORD3DVPROC)load("glTexCoord3dv"); + glad_glTexCoord3f = (PFNGLTEXCOORD3FPROC)load("glTexCoord3f"); + glad_glTexCoord3fv = (PFNGLTEXCOORD3FVPROC)load("glTexCoord3fv"); + glad_glTexCoord3i = (PFNGLTEXCOORD3IPROC)load("glTexCoord3i"); + glad_glTexCoord3iv = (PFNGLTEXCOORD3IVPROC)load("glTexCoord3iv"); + glad_glTexCoord3s = (PFNGLTEXCOORD3SPROC)load("glTexCoord3s"); + glad_glTexCoord3sv = (PFNGLTEXCOORD3SVPROC)load("glTexCoord3sv"); + glad_glTexCoord4d = (PFNGLTEXCOORD4DPROC)load("glTexCoord4d"); + glad_glTexCoord4dv = (PFNGLTEXCOORD4DVPROC)load("glTexCoord4dv"); + glad_glTexCoord4f = (PFNGLTEXCOORD4FPROC)load("glTexCoord4f"); + glad_glTexCoord4fv = (PFNGLTEXCOORD4FVPROC)load("glTexCoord4fv"); + glad_glTexCoord4i = (PFNGLTEXCOORD4IPROC)load("glTexCoord4i"); + glad_glTexCoord4iv = (PFNGLTEXCOORD4IVPROC)load("glTexCoord4iv"); + glad_glTexCoord4s = (PFNGLTEXCOORD4SPROC)load("glTexCoord4s"); + glad_glTexCoord4sv = (PFNGLTEXCOORD4SVPROC)load("glTexCoord4sv"); + glad_glVertex2d = (PFNGLVERTEX2DPROC)load("glVertex2d"); + glad_glVertex2dv = (PFNGLVERTEX2DVPROC)load("glVertex2dv"); + glad_glVertex2f = (PFNGLVERTEX2FPROC)load("glVertex2f"); + glad_glVertex2fv = (PFNGLVERTEX2FVPROC)load("glVertex2fv"); + glad_glVertex2i = (PFNGLVERTEX2IPROC)load("glVertex2i"); + glad_glVertex2iv = (PFNGLVERTEX2IVPROC)load("glVertex2iv"); + glad_glVertex2s = (PFNGLVERTEX2SPROC)load("glVertex2s"); + glad_glVertex2sv = (PFNGLVERTEX2SVPROC)load("glVertex2sv"); + glad_glVertex3d = (PFNGLVERTEX3DPROC)load("glVertex3d"); + glad_glVertex3dv = (PFNGLVERTEX3DVPROC)load("glVertex3dv"); + glad_glVertex3f = (PFNGLVERTEX3FPROC)load("glVertex3f"); + glad_glVertex3fv = (PFNGLVERTEX3FVPROC)load("glVertex3fv"); + glad_glVertex3i = (PFNGLVERTEX3IPROC)load("glVertex3i"); + glad_glVertex3iv = (PFNGLVERTEX3IVPROC)load("glVertex3iv"); + glad_glVertex3s = (PFNGLVERTEX3SPROC)load("glVertex3s"); + glad_glVertex3sv = (PFNGLVERTEX3SVPROC)load("glVertex3sv"); + glad_glVertex4d = (PFNGLVERTEX4DPROC)load("glVertex4d"); + glad_glVertex4dv = (PFNGLVERTEX4DVPROC)load("glVertex4dv"); + glad_glVertex4f = (PFNGLVERTEX4FPROC)load("glVertex4f"); + glad_glVertex4fv = (PFNGLVERTEX4FVPROC)load("glVertex4fv"); + glad_glVertex4i = (PFNGLVERTEX4IPROC)load("glVertex4i"); + glad_glVertex4iv = (PFNGLVERTEX4IVPROC)load("glVertex4iv"); + glad_glVertex4s = (PFNGLVERTEX4SPROC)load("glVertex4s"); + glad_glVertex4sv = (PFNGLVERTEX4SVPROC)load("glVertex4sv"); + glad_glClipPlane = (PFNGLCLIPPLANEPROC)load("glClipPlane"); + glad_glColorMaterial = (PFNGLCOLORMATERIALPROC)load("glColorMaterial"); + glad_glFogf = (PFNGLFOGFPROC)load("glFogf"); + glad_glFogfv = (PFNGLFOGFVPROC)load("glFogfv"); + glad_glFogi = (PFNGLFOGIPROC)load("glFogi"); + glad_glFogiv = (PFNGLFOGIVPROC)load("glFogiv"); + glad_glLightf = (PFNGLLIGHTFPROC)load("glLightf"); + glad_glLightfv = (PFNGLLIGHTFVPROC)load("glLightfv"); + glad_glLighti = (PFNGLLIGHTIPROC)load("glLighti"); + glad_glLightiv = (PFNGLLIGHTIVPROC)load("glLightiv"); + glad_glLightModelf = (PFNGLLIGHTMODELFPROC)load("glLightModelf"); + glad_glLightModelfv = (PFNGLLIGHTMODELFVPROC)load("glLightModelfv"); + glad_glLightModeli = (PFNGLLIGHTMODELIPROC)load("glLightModeli"); + glad_glLightModeliv = (PFNGLLIGHTMODELIVPROC)load("glLightModeliv"); + glad_glLineStipple = (PFNGLLINESTIPPLEPROC)load("glLineStipple"); + glad_glMaterialf = (PFNGLMATERIALFPROC)load("glMaterialf"); + glad_glMaterialfv = (PFNGLMATERIALFVPROC)load("glMaterialfv"); + glad_glMateriali = (PFNGLMATERIALIPROC)load("glMateriali"); + glad_glMaterialiv = (PFNGLMATERIALIVPROC)load("glMaterialiv"); + glad_glPolygonStipple = (PFNGLPOLYGONSTIPPLEPROC)load("glPolygonStipple"); + glad_glShadeModel = (PFNGLSHADEMODELPROC)load("glShadeModel"); + glad_glTexEnvf = (PFNGLTEXENVFPROC)load("glTexEnvf"); + glad_glTexEnvfv = (PFNGLTEXENVFVPROC)load("glTexEnvfv"); + glad_glTexEnvi = (PFNGLTEXENVIPROC)load("glTexEnvi"); + glad_glTexEnviv = (PFNGLTEXENVIVPROC)load("glTexEnviv"); + glad_glTexGend = (PFNGLTEXGENDPROC)load("glTexGend"); + glad_glTexGendv = (PFNGLTEXGENDVPROC)load("glTexGendv"); + glad_glTexGenf = (PFNGLTEXGENFPROC)load("glTexGenf"); + glad_glTexGenfv = (PFNGLTEXGENFVPROC)load("glTexGenfv"); + glad_glTexGeni = (PFNGLTEXGENIPROC)load("glTexGeni"); + glad_glTexGeniv = (PFNGLTEXGENIVPROC)load("glTexGeniv"); + glad_glFeedbackBuffer = (PFNGLFEEDBACKBUFFERPROC)load("glFeedbackBuffer"); + glad_glSelectBuffer = (PFNGLSELECTBUFFERPROC)load("glSelectBuffer"); + glad_glRenderMode = (PFNGLRENDERMODEPROC)load("glRenderMode"); + glad_glInitNames = (PFNGLINITNAMESPROC)load("glInitNames"); + glad_glLoadName = (PFNGLLOADNAMEPROC)load("glLoadName"); + glad_glPassThrough = (PFNGLPASSTHROUGHPROC)load("glPassThrough"); + glad_glPopName = (PFNGLPOPNAMEPROC)load("glPopName"); + glad_glPushName = (PFNGLPUSHNAMEPROC)load("glPushName"); + glad_glClearAccum = (PFNGLCLEARACCUMPROC)load("glClearAccum"); + glad_glClearIndex = (PFNGLCLEARINDEXPROC)load("glClearIndex"); + glad_glIndexMask = (PFNGLINDEXMASKPROC)load("glIndexMask"); + glad_glAccum = (PFNGLACCUMPROC)load("glAccum"); + glad_glPopAttrib = (PFNGLPOPATTRIBPROC)load("glPopAttrib"); + glad_glPushAttrib = (PFNGLPUSHATTRIBPROC)load("glPushAttrib"); + glad_glMap1d = (PFNGLMAP1DPROC)load("glMap1d"); + glad_glMap1f = (PFNGLMAP1FPROC)load("glMap1f"); + glad_glMap2d = (PFNGLMAP2DPROC)load("glMap2d"); + glad_glMap2f = (PFNGLMAP2FPROC)load("glMap2f"); + glad_glMapGrid1d = (PFNGLMAPGRID1DPROC)load("glMapGrid1d"); + glad_glMapGrid1f = (PFNGLMAPGRID1FPROC)load("glMapGrid1f"); + glad_glMapGrid2d = (PFNGLMAPGRID2DPROC)load("glMapGrid2d"); + glad_glMapGrid2f = (PFNGLMAPGRID2FPROC)load("glMapGrid2f"); + glad_glEvalCoord1d = (PFNGLEVALCOORD1DPROC)load("glEvalCoord1d"); + glad_glEvalCoord1dv = (PFNGLEVALCOORD1DVPROC)load("glEvalCoord1dv"); + glad_glEvalCoord1f = (PFNGLEVALCOORD1FPROC)load("glEvalCoord1f"); + glad_glEvalCoord1fv = (PFNGLEVALCOORD1FVPROC)load("glEvalCoord1fv"); + glad_glEvalCoord2d = (PFNGLEVALCOORD2DPROC)load("glEvalCoord2d"); + glad_glEvalCoord2dv = (PFNGLEVALCOORD2DVPROC)load("glEvalCoord2dv"); + glad_glEvalCoord2f = (PFNGLEVALCOORD2FPROC)load("glEvalCoord2f"); + glad_glEvalCoord2fv = (PFNGLEVALCOORD2FVPROC)load("glEvalCoord2fv"); + glad_glEvalMesh1 = (PFNGLEVALMESH1PROC)load("glEvalMesh1"); + glad_glEvalPoint1 = (PFNGLEVALPOINT1PROC)load("glEvalPoint1"); + glad_glEvalMesh2 = (PFNGLEVALMESH2PROC)load("glEvalMesh2"); + glad_glEvalPoint2 = (PFNGLEVALPOINT2PROC)load("glEvalPoint2"); + glad_glAlphaFunc = (PFNGLALPHAFUNCPROC)load("glAlphaFunc"); + glad_glPixelZoom = (PFNGLPIXELZOOMPROC)load("glPixelZoom"); + glad_glPixelTransferf = (PFNGLPIXELTRANSFERFPROC)load("glPixelTransferf"); + glad_glPixelTransferi = (PFNGLPIXELTRANSFERIPROC)load("glPixelTransferi"); + glad_glPixelMapfv = (PFNGLPIXELMAPFVPROC)load("glPixelMapfv"); + glad_glPixelMapuiv = (PFNGLPIXELMAPUIVPROC)load("glPixelMapuiv"); + glad_glPixelMapusv = (PFNGLPIXELMAPUSVPROC)load("glPixelMapusv"); + glad_glCopyPixels = (PFNGLCOPYPIXELSPROC)load("glCopyPixels"); + glad_glDrawPixels = (PFNGLDRAWPIXELSPROC)load("glDrawPixels"); + glad_glGetClipPlane = (PFNGLGETCLIPPLANEPROC)load("glGetClipPlane"); + glad_glGetLightfv = (PFNGLGETLIGHTFVPROC)load("glGetLightfv"); + glad_glGetLightiv = (PFNGLGETLIGHTIVPROC)load("glGetLightiv"); + glad_glGetMapdv = (PFNGLGETMAPDVPROC)load("glGetMapdv"); + glad_glGetMapfv = (PFNGLGETMAPFVPROC)load("glGetMapfv"); + glad_glGetMapiv = (PFNGLGETMAPIVPROC)load("glGetMapiv"); + glad_glGetMaterialfv = (PFNGLGETMATERIALFVPROC)load("glGetMaterialfv"); + glad_glGetMaterialiv = (PFNGLGETMATERIALIVPROC)load("glGetMaterialiv"); + glad_glGetPixelMapfv = (PFNGLGETPIXELMAPFVPROC)load("glGetPixelMapfv"); + glad_glGetPixelMapuiv = (PFNGLGETPIXELMAPUIVPROC)load("glGetPixelMapuiv"); + glad_glGetPixelMapusv = (PFNGLGETPIXELMAPUSVPROC)load("glGetPixelMapusv"); + glad_glGetPolygonStipple = (PFNGLGETPOLYGONSTIPPLEPROC)load("glGetPolygonStipple"); + glad_glGetTexEnvfv = (PFNGLGETTEXENVFVPROC)load("glGetTexEnvfv"); + glad_glGetTexEnviv = (PFNGLGETTEXENVIVPROC)load("glGetTexEnviv"); + glad_glGetTexGendv = (PFNGLGETTEXGENDVPROC)load("glGetTexGendv"); + glad_glGetTexGenfv = (PFNGLGETTEXGENFVPROC)load("glGetTexGenfv"); + glad_glGetTexGeniv = (PFNGLGETTEXGENIVPROC)load("glGetTexGeniv"); + glad_glIsList = (PFNGLISLISTPROC)load("glIsList"); + glad_glFrustum = (PFNGLFRUSTUMPROC)load("glFrustum"); + glad_glLoadIdentity = (PFNGLLOADIDENTITYPROC)load("glLoadIdentity"); + glad_glLoadMatrixf = (PFNGLLOADMATRIXFPROC)load("glLoadMatrixf"); + glad_glLoadMatrixd = (PFNGLLOADMATRIXDPROC)load("glLoadMatrixd"); + glad_glMatrixMode = (PFNGLMATRIXMODEPROC)load("glMatrixMode"); + glad_glMultMatrixf = (PFNGLMULTMATRIXFPROC)load("glMultMatrixf"); + glad_glMultMatrixd = (PFNGLMULTMATRIXDPROC)load("glMultMatrixd"); + glad_glOrtho = (PFNGLORTHOPROC)load("glOrtho"); + glad_glPopMatrix = (PFNGLPOPMATRIXPROC)load("glPopMatrix"); + glad_glPushMatrix = (PFNGLPUSHMATRIXPROC)load("glPushMatrix"); + glad_glRotated = (PFNGLROTATEDPROC)load("glRotated"); + glad_glRotatef = (PFNGLROTATEFPROC)load("glRotatef"); + glad_glScaled = (PFNGLSCALEDPROC)load("glScaled"); + glad_glScalef = (PFNGLSCALEFPROC)load("glScalef"); + glad_glTranslated = (PFNGLTRANSLATEDPROC)load("glTranslated"); + glad_glTranslatef = (PFNGLTRANSLATEFPROC)load("glTranslatef"); +} +static void load_GL_VERSION_1_1(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_1) return; + glad_glDrawArrays = (PFNGLDRAWARRAYSPROC)load("glDrawArrays"); + glad_glDrawElements = (PFNGLDRAWELEMENTSPROC)load("glDrawElements"); + glad_glGetPointerv = (PFNGLGETPOINTERVPROC)load("glGetPointerv"); + glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC)load("glPolygonOffset"); + glad_glCopyTexImage1D = (PFNGLCOPYTEXIMAGE1DPROC)load("glCopyTexImage1D"); + glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC)load("glCopyTexImage2D"); + glad_glCopyTexSubImage1D = (PFNGLCOPYTEXSUBIMAGE1DPROC)load("glCopyTexSubImage1D"); + glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC)load("glCopyTexSubImage2D"); + glad_glTexSubImage1D = (PFNGLTEXSUBIMAGE1DPROC)load("glTexSubImage1D"); + glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC)load("glTexSubImage2D"); + glad_glBindTexture = (PFNGLBINDTEXTUREPROC)load("glBindTexture"); + glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC)load("glDeleteTextures"); + glad_glGenTextures = (PFNGLGENTEXTURESPROC)load("glGenTextures"); + glad_glIsTexture = (PFNGLISTEXTUREPROC)load("glIsTexture"); + glad_glArrayElement = (PFNGLARRAYELEMENTPROC)load("glArrayElement"); + glad_glColorPointer = (PFNGLCOLORPOINTERPROC)load("glColorPointer"); + glad_glDisableClientState = (PFNGLDISABLECLIENTSTATEPROC)load("glDisableClientState"); + glad_glEdgeFlagPointer = (PFNGLEDGEFLAGPOINTERPROC)load("glEdgeFlagPointer"); + glad_glEnableClientState = (PFNGLENABLECLIENTSTATEPROC)load("glEnableClientState"); + glad_glIndexPointer = (PFNGLINDEXPOINTERPROC)load("glIndexPointer"); + glad_glInterleavedArrays = (PFNGLINTERLEAVEDARRAYSPROC)load("glInterleavedArrays"); + glad_glNormalPointer = (PFNGLNORMALPOINTERPROC)load("glNormalPointer"); + glad_glTexCoordPointer = (PFNGLTEXCOORDPOINTERPROC)load("glTexCoordPointer"); + glad_glVertexPointer = (PFNGLVERTEXPOINTERPROC)load("glVertexPointer"); + glad_glAreTexturesResident = (PFNGLARETEXTURESRESIDENTPROC)load("glAreTexturesResident"); + glad_glPrioritizeTextures = (PFNGLPRIORITIZETEXTURESPROC)load("glPrioritizeTextures"); + glad_glIndexub = (PFNGLINDEXUBPROC)load("glIndexub"); + glad_glIndexubv = (PFNGLINDEXUBVPROC)load("glIndexubv"); + glad_glPopClientAttrib = (PFNGLPOPCLIENTATTRIBPROC)load("glPopClientAttrib"); + glad_glPushClientAttrib = (PFNGLPUSHCLIENTATTRIBPROC)load("glPushClientAttrib"); +} +static void load_GL_VERSION_1_2(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_2) return; + glad_glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)load("glDrawRangeElements"); + glad_glTexImage3D = (PFNGLTEXIMAGE3DPROC)load("glTexImage3D"); + glad_glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)load("glTexSubImage3D"); + glad_glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)load("glCopyTexSubImage3D"); +} +static void load_GL_VERSION_1_3(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_3) return; + glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC)load("glActiveTexture"); + glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)load("glSampleCoverage"); + glad_glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)load("glCompressedTexImage3D"); + glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)load("glCompressedTexImage2D"); + glad_glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)load("glCompressedTexImage1D"); + glad_glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)load("glCompressedTexSubImage3D"); + glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)load("glCompressedTexSubImage2D"); + glad_glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)load("glCompressedTexSubImage1D"); + glad_glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)load("glGetCompressedTexImage"); + glad_glClientActiveTexture = (PFNGLCLIENTACTIVETEXTUREPROC)load("glClientActiveTexture"); + glad_glMultiTexCoord1d = (PFNGLMULTITEXCOORD1DPROC)load("glMultiTexCoord1d"); + glad_glMultiTexCoord1dv = (PFNGLMULTITEXCOORD1DVPROC)load("glMultiTexCoord1dv"); + glad_glMultiTexCoord1f = (PFNGLMULTITEXCOORD1FPROC)load("glMultiTexCoord1f"); + glad_glMultiTexCoord1fv = (PFNGLMULTITEXCOORD1FVPROC)load("glMultiTexCoord1fv"); + glad_glMultiTexCoord1i = (PFNGLMULTITEXCOORD1IPROC)load("glMultiTexCoord1i"); + glad_glMultiTexCoord1iv = (PFNGLMULTITEXCOORD1IVPROC)load("glMultiTexCoord1iv"); + glad_glMultiTexCoord1s = (PFNGLMULTITEXCOORD1SPROC)load("glMultiTexCoord1s"); + glad_glMultiTexCoord1sv = (PFNGLMULTITEXCOORD1SVPROC)load("glMultiTexCoord1sv"); + glad_glMultiTexCoord2d = (PFNGLMULTITEXCOORD2DPROC)load("glMultiTexCoord2d"); + glad_glMultiTexCoord2dv = (PFNGLMULTITEXCOORD2DVPROC)load("glMultiTexCoord2dv"); + glad_glMultiTexCoord2f = (PFNGLMULTITEXCOORD2FPROC)load("glMultiTexCoord2f"); + glad_glMultiTexCoord2fv = (PFNGLMULTITEXCOORD2FVPROC)load("glMultiTexCoord2fv"); + glad_glMultiTexCoord2i = (PFNGLMULTITEXCOORD2IPROC)load("glMultiTexCoord2i"); + glad_glMultiTexCoord2iv = (PFNGLMULTITEXCOORD2IVPROC)load("glMultiTexCoord2iv"); + glad_glMultiTexCoord2s = (PFNGLMULTITEXCOORD2SPROC)load("glMultiTexCoord2s"); + glad_glMultiTexCoord2sv = (PFNGLMULTITEXCOORD2SVPROC)load("glMultiTexCoord2sv"); + glad_glMultiTexCoord3d = (PFNGLMULTITEXCOORD3DPROC)load("glMultiTexCoord3d"); + glad_glMultiTexCoord3dv = (PFNGLMULTITEXCOORD3DVPROC)load("glMultiTexCoord3dv"); + glad_glMultiTexCoord3f = (PFNGLMULTITEXCOORD3FPROC)load("glMultiTexCoord3f"); + glad_glMultiTexCoord3fv = (PFNGLMULTITEXCOORD3FVPROC)load("glMultiTexCoord3fv"); + glad_glMultiTexCoord3i = (PFNGLMULTITEXCOORD3IPROC)load("glMultiTexCoord3i"); + glad_glMultiTexCoord3iv = (PFNGLMULTITEXCOORD3IVPROC)load("glMultiTexCoord3iv"); + glad_glMultiTexCoord3s = (PFNGLMULTITEXCOORD3SPROC)load("glMultiTexCoord3s"); + glad_glMultiTexCoord3sv = (PFNGLMULTITEXCOORD3SVPROC)load("glMultiTexCoord3sv"); + glad_glMultiTexCoord4d = (PFNGLMULTITEXCOORD4DPROC)load("glMultiTexCoord4d"); + glad_glMultiTexCoord4dv = (PFNGLMULTITEXCOORD4DVPROC)load("glMultiTexCoord4dv"); + glad_glMultiTexCoord4f = (PFNGLMULTITEXCOORD4FPROC)load("glMultiTexCoord4f"); + glad_glMultiTexCoord4fv = (PFNGLMULTITEXCOORD4FVPROC)load("glMultiTexCoord4fv"); + glad_glMultiTexCoord4i = (PFNGLMULTITEXCOORD4IPROC)load("glMultiTexCoord4i"); + glad_glMultiTexCoord4iv = (PFNGLMULTITEXCOORD4IVPROC)load("glMultiTexCoord4iv"); + glad_glMultiTexCoord4s = (PFNGLMULTITEXCOORD4SPROC)load("glMultiTexCoord4s"); + glad_glMultiTexCoord4sv = (PFNGLMULTITEXCOORD4SVPROC)load("glMultiTexCoord4sv"); + glad_glLoadTransposeMatrixf = (PFNGLLOADTRANSPOSEMATRIXFPROC)load("glLoadTransposeMatrixf"); + glad_glLoadTransposeMatrixd = (PFNGLLOADTRANSPOSEMATRIXDPROC)load("glLoadTransposeMatrixd"); + glad_glMultTransposeMatrixf = (PFNGLMULTTRANSPOSEMATRIXFPROC)load("glMultTransposeMatrixf"); + glad_glMultTransposeMatrixd = (PFNGLMULTTRANSPOSEMATRIXDPROC)load("glMultTransposeMatrixd"); +} +static void load_GL_VERSION_1_4(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_4) return; + glad_glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)load("glBlendFuncSeparate"); + glad_glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)load("glMultiDrawArrays"); + glad_glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)load("glMultiDrawElements"); + glad_glPointParameterf = (PFNGLPOINTPARAMETERFPROC)load("glPointParameterf"); + glad_glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)load("glPointParameterfv"); + glad_glPointParameteri = (PFNGLPOINTPARAMETERIPROC)load("glPointParameteri"); + glad_glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)load("glPointParameteriv"); + glad_glFogCoordf = (PFNGLFOGCOORDFPROC)load("glFogCoordf"); + glad_glFogCoordfv = (PFNGLFOGCOORDFVPROC)load("glFogCoordfv"); + glad_glFogCoordd = (PFNGLFOGCOORDDPROC)load("glFogCoordd"); + glad_glFogCoorddv = (PFNGLFOGCOORDDVPROC)load("glFogCoorddv"); + glad_glFogCoordPointer = (PFNGLFOGCOORDPOINTERPROC)load("glFogCoordPointer"); + glad_glSecondaryColor3b = (PFNGLSECONDARYCOLOR3BPROC)load("glSecondaryColor3b"); + glad_glSecondaryColor3bv = (PFNGLSECONDARYCOLOR3BVPROC)load("glSecondaryColor3bv"); + glad_glSecondaryColor3d = (PFNGLSECONDARYCOLOR3DPROC)load("glSecondaryColor3d"); + glad_glSecondaryColor3dv = (PFNGLSECONDARYCOLOR3DVPROC)load("glSecondaryColor3dv"); + glad_glSecondaryColor3f = (PFNGLSECONDARYCOLOR3FPROC)load("glSecondaryColor3f"); + glad_glSecondaryColor3fv = (PFNGLSECONDARYCOLOR3FVPROC)load("glSecondaryColor3fv"); + glad_glSecondaryColor3i = (PFNGLSECONDARYCOLOR3IPROC)load("glSecondaryColor3i"); + glad_glSecondaryColor3iv = (PFNGLSECONDARYCOLOR3IVPROC)load("glSecondaryColor3iv"); + glad_glSecondaryColor3s = (PFNGLSECONDARYCOLOR3SPROC)load("glSecondaryColor3s"); + glad_glSecondaryColor3sv = (PFNGLSECONDARYCOLOR3SVPROC)load("glSecondaryColor3sv"); + glad_glSecondaryColor3ub = (PFNGLSECONDARYCOLOR3UBPROC)load("glSecondaryColor3ub"); + glad_glSecondaryColor3ubv = (PFNGLSECONDARYCOLOR3UBVPROC)load("glSecondaryColor3ubv"); + glad_glSecondaryColor3ui = (PFNGLSECONDARYCOLOR3UIPROC)load("glSecondaryColor3ui"); + glad_glSecondaryColor3uiv = (PFNGLSECONDARYCOLOR3UIVPROC)load("glSecondaryColor3uiv"); + glad_glSecondaryColor3us = (PFNGLSECONDARYCOLOR3USPROC)load("glSecondaryColor3us"); + glad_glSecondaryColor3usv = (PFNGLSECONDARYCOLOR3USVPROC)load("glSecondaryColor3usv"); + glad_glSecondaryColorPointer = (PFNGLSECONDARYCOLORPOINTERPROC)load("glSecondaryColorPointer"); + glad_glWindowPos2d = (PFNGLWINDOWPOS2DPROC)load("glWindowPos2d"); + glad_glWindowPos2dv = (PFNGLWINDOWPOS2DVPROC)load("glWindowPos2dv"); + glad_glWindowPos2f = (PFNGLWINDOWPOS2FPROC)load("glWindowPos2f"); + glad_glWindowPos2fv = (PFNGLWINDOWPOS2FVPROC)load("glWindowPos2fv"); + glad_glWindowPos2i = (PFNGLWINDOWPOS2IPROC)load("glWindowPos2i"); + glad_glWindowPos2iv = (PFNGLWINDOWPOS2IVPROC)load("glWindowPos2iv"); + glad_glWindowPos2s = (PFNGLWINDOWPOS2SPROC)load("glWindowPos2s"); + glad_glWindowPos2sv = (PFNGLWINDOWPOS2SVPROC)load("glWindowPos2sv"); + glad_glWindowPos3d = (PFNGLWINDOWPOS3DPROC)load("glWindowPos3d"); + glad_glWindowPos3dv = (PFNGLWINDOWPOS3DVPROC)load("glWindowPos3dv"); + glad_glWindowPos3f = (PFNGLWINDOWPOS3FPROC)load("glWindowPos3f"); + glad_glWindowPos3fv = (PFNGLWINDOWPOS3FVPROC)load("glWindowPos3fv"); + glad_glWindowPos3i = (PFNGLWINDOWPOS3IPROC)load("glWindowPos3i"); + glad_glWindowPos3iv = (PFNGLWINDOWPOS3IVPROC)load("glWindowPos3iv"); + glad_glWindowPos3s = (PFNGLWINDOWPOS3SPROC)load("glWindowPos3s"); + glad_glWindowPos3sv = (PFNGLWINDOWPOS3SVPROC)load("glWindowPos3sv"); + glad_glBlendColor = (PFNGLBLENDCOLORPROC)load("glBlendColor"); + glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC)load("glBlendEquation"); +} +static void load_GL_VERSION_1_5(GLADloadproc load) { + if(!GLAD_GL_VERSION_1_5) return; + glad_glGenQueries = (PFNGLGENQUERIESPROC)load("glGenQueries"); + glad_glDeleteQueries = (PFNGLDELETEQUERIESPROC)load("glDeleteQueries"); + glad_glIsQuery = (PFNGLISQUERYPROC)load("glIsQuery"); + glad_glBeginQuery = (PFNGLBEGINQUERYPROC)load("glBeginQuery"); + glad_glEndQuery = (PFNGLENDQUERYPROC)load("glEndQuery"); + glad_glGetQueryiv = (PFNGLGETQUERYIVPROC)load("glGetQueryiv"); + glad_glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)load("glGetQueryObjectiv"); + glad_glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)load("glGetQueryObjectuiv"); + glad_glBindBuffer = (PFNGLBINDBUFFERPROC)load("glBindBuffer"); + glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)load("glDeleteBuffers"); + glad_glGenBuffers = (PFNGLGENBUFFERSPROC)load("glGenBuffers"); + glad_glIsBuffer = (PFNGLISBUFFERPROC)load("glIsBuffer"); + glad_glBufferData = (PFNGLBUFFERDATAPROC)load("glBufferData"); + glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC)load("glBufferSubData"); + glad_glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)load("glGetBufferSubData"); + glad_glMapBuffer = (PFNGLMAPBUFFERPROC)load("glMapBuffer"); + glad_glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)load("glUnmapBuffer"); + glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)load("glGetBufferParameteriv"); + glad_glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)load("glGetBufferPointerv"); +} +static void load_GL_VERSION_2_0(GLADloadproc load) { + if(!GLAD_GL_VERSION_2_0) return; + glad_glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)load("glBlendEquationSeparate"); + glad_glDrawBuffers = (PFNGLDRAWBUFFERSPROC)load("glDrawBuffers"); + glad_glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)load("glStencilOpSeparate"); + glad_glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)load("glStencilFuncSeparate"); + glad_glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)load("glStencilMaskSeparate"); + glad_glAttachShader = (PFNGLATTACHSHADERPROC)load("glAttachShader"); + glad_glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)load("glBindAttribLocation"); + glad_glCompileShader = (PFNGLCOMPILESHADERPROC)load("glCompileShader"); + glad_glCreateProgram = (PFNGLCREATEPROGRAMPROC)load("glCreateProgram"); + glad_glCreateShader = (PFNGLCREATESHADERPROC)load("glCreateShader"); + glad_glDeleteProgram = (PFNGLDELETEPROGRAMPROC)load("glDeleteProgram"); + glad_glDeleteShader = (PFNGLDELETESHADERPROC)load("glDeleteShader"); + glad_glDetachShader = (PFNGLDETACHSHADERPROC)load("glDetachShader"); + glad_glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)load("glDisableVertexAttribArray"); + glad_glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)load("glEnableVertexAttribArray"); + glad_glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)load("glGetActiveAttrib"); + glad_glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)load("glGetActiveUniform"); + glad_glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)load("glGetAttachedShaders"); + glad_glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)load("glGetAttribLocation"); + glad_glGetProgramiv = (PFNGLGETPROGRAMIVPROC)load("glGetProgramiv"); + glad_glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)load("glGetProgramInfoLog"); + glad_glGetShaderiv = (PFNGLGETSHADERIVPROC)load("glGetShaderiv"); + glad_glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)load("glGetShaderInfoLog"); + glad_glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)load("glGetShaderSource"); + glad_glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)load("glGetUniformLocation"); + glad_glGetUniformfv = (PFNGLGETUNIFORMFVPROC)load("glGetUniformfv"); + glad_glGetUniformiv = (PFNGLGETUNIFORMIVPROC)load("glGetUniformiv"); + glad_glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)load("glGetVertexAttribdv"); + glad_glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)load("glGetVertexAttribfv"); + glad_glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)load("glGetVertexAttribiv"); + glad_glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)load("glGetVertexAttribPointerv"); + glad_glIsProgram = (PFNGLISPROGRAMPROC)load("glIsProgram"); + glad_glIsShader = (PFNGLISSHADERPROC)load("glIsShader"); + glad_glLinkProgram = (PFNGLLINKPROGRAMPROC)load("glLinkProgram"); + glad_glShaderSource = (PFNGLSHADERSOURCEPROC)load("glShaderSource"); + glad_glUseProgram = (PFNGLUSEPROGRAMPROC)load("glUseProgram"); + glad_glUniform1f = (PFNGLUNIFORM1FPROC)load("glUniform1f"); + glad_glUniform2f = (PFNGLUNIFORM2FPROC)load("glUniform2f"); + glad_glUniform3f = (PFNGLUNIFORM3FPROC)load("glUniform3f"); + glad_glUniform4f = (PFNGLUNIFORM4FPROC)load("glUniform4f"); + glad_glUniform1i = (PFNGLUNIFORM1IPROC)load("glUniform1i"); + glad_glUniform2i = (PFNGLUNIFORM2IPROC)load("glUniform2i"); + glad_glUniform3i = (PFNGLUNIFORM3IPROC)load("glUniform3i"); + glad_glUniform4i = (PFNGLUNIFORM4IPROC)load("glUniform4i"); + glad_glUniform1fv = (PFNGLUNIFORM1FVPROC)load("glUniform1fv"); + glad_glUniform2fv = (PFNGLUNIFORM2FVPROC)load("glUniform2fv"); + glad_glUniform3fv = (PFNGLUNIFORM3FVPROC)load("glUniform3fv"); + glad_glUniform4fv = (PFNGLUNIFORM4FVPROC)load("glUniform4fv"); + glad_glUniform1iv = (PFNGLUNIFORM1IVPROC)load("glUniform1iv"); + glad_glUniform2iv = (PFNGLUNIFORM2IVPROC)load("glUniform2iv"); + glad_glUniform3iv = (PFNGLUNIFORM3IVPROC)load("glUniform3iv"); + glad_glUniform4iv = (PFNGLUNIFORM4IVPROC)load("glUniform4iv"); + glad_glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)load("glUniformMatrix2fv"); + glad_glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)load("glUniformMatrix3fv"); + glad_glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)load("glUniformMatrix4fv"); + glad_glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)load("glValidateProgram"); + glad_glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)load("glVertexAttrib1d"); + glad_glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)load("glVertexAttrib1dv"); + glad_glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)load("glVertexAttrib1f"); + glad_glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)load("glVertexAttrib1fv"); + glad_glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)load("glVertexAttrib1s"); + glad_glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)load("glVertexAttrib1sv"); + glad_glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)load("glVertexAttrib2d"); + glad_glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)load("glVertexAttrib2dv"); + glad_glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)load("glVertexAttrib2f"); + glad_glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)load("glVertexAttrib2fv"); + glad_glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)load("glVertexAttrib2s"); + glad_glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)load("glVertexAttrib2sv"); + glad_glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)load("glVertexAttrib3d"); + glad_glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)load("glVertexAttrib3dv"); + glad_glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)load("glVertexAttrib3f"); + glad_glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)load("glVertexAttrib3fv"); + glad_glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)load("glVertexAttrib3s"); + glad_glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)load("glVertexAttrib3sv"); + glad_glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)load("glVertexAttrib4Nbv"); + glad_glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)load("glVertexAttrib4Niv"); + glad_glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)load("glVertexAttrib4Nsv"); + glad_glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)load("glVertexAttrib4Nub"); + glad_glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)load("glVertexAttrib4Nubv"); + glad_glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)load("glVertexAttrib4Nuiv"); + glad_glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)load("glVertexAttrib4Nusv"); + glad_glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)load("glVertexAttrib4bv"); + glad_glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)load("glVertexAttrib4d"); + glad_glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)load("glVertexAttrib4dv"); + glad_glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)load("glVertexAttrib4f"); + glad_glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)load("glVertexAttrib4fv"); + glad_glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)load("glVertexAttrib4iv"); + glad_glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)load("glVertexAttrib4s"); + glad_glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)load("glVertexAttrib4sv"); + glad_glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)load("glVertexAttrib4ubv"); + glad_glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)load("glVertexAttrib4uiv"); + glad_glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)load("glVertexAttrib4usv"); + glad_glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)load("glVertexAttribPointer"); +} +static void load_GL_VERSION_2_1(GLADloadproc load) { + if(!GLAD_GL_VERSION_2_1) return; + glad_glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)load("glUniformMatrix2x3fv"); + glad_glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)load("glUniformMatrix3x2fv"); + glad_glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)load("glUniformMatrix2x4fv"); + glad_glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)load("glUniformMatrix4x2fv"); + glad_glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)load("glUniformMatrix3x4fv"); + glad_glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)load("glUniformMatrix4x3fv"); +} +static void load_GL_VERSION_3_0(GLADloadproc load) { + if(!GLAD_GL_VERSION_3_0) return; + glad_glColorMaski = (PFNGLCOLORMASKIPROC)load("glColorMaski"); + glad_glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)load("glGetBooleani_v"); + glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); + glad_glEnablei = (PFNGLENABLEIPROC)load("glEnablei"); + glad_glDisablei = (PFNGLDISABLEIPROC)load("glDisablei"); + glad_glIsEnabledi = (PFNGLISENABLEDIPROC)load("glIsEnabledi"); + glad_glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)load("glBeginTransformFeedback"); + glad_glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)load("glEndTransformFeedback"); + glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); + glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); + glad_glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)load("glTransformFeedbackVaryings"); + glad_glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)load("glGetTransformFeedbackVarying"); + glad_glClampColor = (PFNGLCLAMPCOLORPROC)load("glClampColor"); + glad_glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)load("glBeginConditionalRender"); + glad_glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)load("glEndConditionalRender"); + glad_glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)load("glVertexAttribIPointer"); + glad_glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)load("glGetVertexAttribIiv"); + glad_glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)load("glGetVertexAttribIuiv"); + glad_glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)load("glVertexAttribI1i"); + glad_glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)load("glVertexAttribI2i"); + glad_glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)load("glVertexAttribI3i"); + glad_glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)load("glVertexAttribI4i"); + glad_glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)load("glVertexAttribI1ui"); + glad_glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)load("glVertexAttribI2ui"); + glad_glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)load("glVertexAttribI3ui"); + glad_glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)load("glVertexAttribI4ui"); + glad_glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)load("glVertexAttribI1iv"); + glad_glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)load("glVertexAttribI2iv"); + glad_glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)load("glVertexAttribI3iv"); + glad_glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)load("glVertexAttribI4iv"); + glad_glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)load("glVertexAttribI1uiv"); + glad_glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)load("glVertexAttribI2uiv"); + glad_glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)load("glVertexAttribI3uiv"); + glad_glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)load("glVertexAttribI4uiv"); + glad_glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)load("glVertexAttribI4bv"); + glad_glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)load("glVertexAttribI4sv"); + glad_glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)load("glVertexAttribI4ubv"); + glad_glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)load("glVertexAttribI4usv"); + glad_glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)load("glGetUniformuiv"); + glad_glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)load("glBindFragDataLocation"); + glad_glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)load("glGetFragDataLocation"); + glad_glUniform1ui = (PFNGLUNIFORM1UIPROC)load("glUniform1ui"); + glad_glUniform2ui = (PFNGLUNIFORM2UIPROC)load("glUniform2ui"); + glad_glUniform3ui = (PFNGLUNIFORM3UIPROC)load("glUniform3ui"); + glad_glUniform4ui = (PFNGLUNIFORM4UIPROC)load("glUniform4ui"); + glad_glUniform1uiv = (PFNGLUNIFORM1UIVPROC)load("glUniform1uiv"); + glad_glUniform2uiv = (PFNGLUNIFORM2UIVPROC)load("glUniform2uiv"); + glad_glUniform3uiv = (PFNGLUNIFORM3UIVPROC)load("glUniform3uiv"); + glad_glUniform4uiv = (PFNGLUNIFORM4UIVPROC)load("glUniform4uiv"); + glad_glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)load("glTexParameterIiv"); + glad_glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)load("glTexParameterIuiv"); + glad_glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)load("glGetTexParameterIiv"); + glad_glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)load("glGetTexParameterIuiv"); + glad_glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)load("glClearBufferiv"); + glad_glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)load("glClearBufferuiv"); + glad_glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)load("glClearBufferfv"); + glad_glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)load("glClearBufferfi"); + glad_glGetStringi = (PFNGLGETSTRINGIPROC)load("glGetStringi"); + glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)load("glIsRenderbuffer"); + glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)load("glBindRenderbuffer"); + glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)load("glDeleteRenderbuffers"); + glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)load("glGenRenderbuffers"); + glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)load("glRenderbufferStorage"); + glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)load("glGetRenderbufferParameteriv"); + glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)load("glIsFramebuffer"); + glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)load("glBindFramebuffer"); + glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)load("glDeleteFramebuffers"); + glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)load("glGenFramebuffers"); + glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)load("glCheckFramebufferStatus"); + glad_glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)load("glFramebufferTexture1D"); + glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)load("glFramebufferTexture2D"); + glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)load("glFramebufferTexture3D"); + glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)load("glFramebufferRenderbuffer"); + glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)load("glGetFramebufferAttachmentParameteriv"); + glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)load("glGenerateMipmap"); + glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)load("glBlitFramebuffer"); + glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)load("glRenderbufferStorageMultisample"); + glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)load("glFramebufferTextureLayer"); + glad_glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)load("glMapBufferRange"); + glad_glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)load("glFlushMappedBufferRange"); + glad_glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)load("glBindVertexArray"); + glad_glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)load("glDeleteVertexArrays"); + glad_glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)load("glGenVertexArrays"); + glad_glIsVertexArray = (PFNGLISVERTEXARRAYPROC)load("glIsVertexArray"); +} +static void load_GL_VERSION_3_1(GLADloadproc load) { + if(!GLAD_GL_VERSION_3_1) return; + glad_glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)load("glDrawArraysInstanced"); + glad_glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)load("glDrawElementsInstanced"); + glad_glTexBuffer = (PFNGLTEXBUFFERPROC)load("glTexBuffer"); + glad_glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)load("glPrimitiveRestartIndex"); + glad_glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)load("glCopyBufferSubData"); + glad_glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)load("glGetUniformIndices"); + glad_glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)load("glGetActiveUniformsiv"); + glad_glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)load("glGetActiveUniformName"); + glad_glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)load("glGetUniformBlockIndex"); + glad_glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)load("glGetActiveUniformBlockiv"); + glad_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)load("glGetActiveUniformBlockName"); + glad_glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)load("glUniformBlockBinding"); + glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)load("glBindBufferRange"); + glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)load("glBindBufferBase"); + glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)load("glGetIntegeri_v"); +} +static void load_GL_VERSION_3_2(GLADloadproc load) { + if(!GLAD_GL_VERSION_3_2) return; + glad_glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)load("glDrawElementsBaseVertex"); + glad_glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)load("glDrawRangeElementsBaseVertex"); + glad_glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)load("glDrawElementsInstancedBaseVertex"); + glad_glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)load("glMultiDrawElementsBaseVertex"); + glad_glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)load("glProvokingVertex"); + glad_glFenceSync = (PFNGLFENCESYNCPROC)load("glFenceSync"); + glad_glIsSync = (PFNGLISSYNCPROC)load("glIsSync"); + glad_glDeleteSync = (PFNGLDELETESYNCPROC)load("glDeleteSync"); + glad_glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)load("glClientWaitSync"); + glad_glWaitSync = (PFNGLWAITSYNCPROC)load("glWaitSync"); + glad_glGetInteger64v = (PFNGLGETINTEGER64VPROC)load("glGetInteger64v"); + glad_glGetSynciv = (PFNGLGETSYNCIVPROC)load("glGetSynciv"); + glad_glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)load("glGetInteger64i_v"); + glad_glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)load("glGetBufferParameteri64v"); + glad_glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)load("glFramebufferTexture"); + glad_glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)load("glTexImage2DMultisample"); + glad_glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)load("glTexImage3DMultisample"); + glad_glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)load("glGetMultisamplefv"); + glad_glSampleMaski = (PFNGLSAMPLEMASKIPROC)load("glSampleMaski"); +} +static void load_GL_VERSION_3_3(GLADloadproc load) { + if(!GLAD_GL_VERSION_3_3) return; + glad_glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)load("glBindFragDataLocationIndexed"); + glad_glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)load("glGetFragDataIndex"); + glad_glGenSamplers = (PFNGLGENSAMPLERSPROC)load("glGenSamplers"); + glad_glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)load("glDeleteSamplers"); + glad_glIsSampler = (PFNGLISSAMPLERPROC)load("glIsSampler"); + glad_glBindSampler = (PFNGLBINDSAMPLERPROC)load("glBindSampler"); + glad_glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)load("glSamplerParameteri"); + glad_glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)load("glSamplerParameteriv"); + glad_glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)load("glSamplerParameterf"); + glad_glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)load("glSamplerParameterfv"); + glad_glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)load("glSamplerParameterIiv"); + glad_glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)load("glSamplerParameterIuiv"); + glad_glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)load("glGetSamplerParameteriv"); + glad_glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)load("glGetSamplerParameterIiv"); + glad_glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)load("glGetSamplerParameterfv"); + glad_glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)load("glGetSamplerParameterIuiv"); + glad_glQueryCounter = (PFNGLQUERYCOUNTERPROC)load("glQueryCounter"); + glad_glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)load("glGetQueryObjecti64v"); + glad_glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)load("glGetQueryObjectui64v"); + glad_glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)load("glVertexAttribDivisor"); + glad_glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)load("glVertexAttribP1ui"); + glad_glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)load("glVertexAttribP1uiv"); + glad_glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)load("glVertexAttribP2ui"); + glad_glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)load("glVertexAttribP2uiv"); + glad_glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)load("glVertexAttribP3ui"); + glad_glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)load("glVertexAttribP3uiv"); + glad_glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)load("glVertexAttribP4ui"); + glad_glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)load("glVertexAttribP4uiv"); + glad_glVertexP2ui = (PFNGLVERTEXP2UIPROC)load("glVertexP2ui"); + glad_glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)load("glVertexP2uiv"); + glad_glVertexP3ui = (PFNGLVERTEXP3UIPROC)load("glVertexP3ui"); + glad_glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)load("glVertexP3uiv"); + glad_glVertexP4ui = (PFNGLVERTEXP4UIPROC)load("glVertexP4ui"); + glad_glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)load("glVertexP4uiv"); + glad_glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)load("glTexCoordP1ui"); + glad_glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)load("glTexCoordP1uiv"); + glad_glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)load("glTexCoordP2ui"); + glad_glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)load("glTexCoordP2uiv"); + glad_glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)load("glTexCoordP3ui"); + glad_glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)load("glTexCoordP3uiv"); + glad_glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)load("glTexCoordP4ui"); + glad_glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)load("glTexCoordP4uiv"); + glad_glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)load("glMultiTexCoordP1ui"); + glad_glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)load("glMultiTexCoordP1uiv"); + glad_glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)load("glMultiTexCoordP2ui"); + glad_glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)load("glMultiTexCoordP2uiv"); + glad_glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)load("glMultiTexCoordP3ui"); + glad_glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)load("glMultiTexCoordP3uiv"); + glad_glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)load("glMultiTexCoordP4ui"); + glad_glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)load("glMultiTexCoordP4uiv"); + glad_glNormalP3ui = (PFNGLNORMALP3UIPROC)load("glNormalP3ui"); + glad_glNormalP3uiv = (PFNGLNORMALP3UIVPROC)load("glNormalP3uiv"); + glad_glColorP3ui = (PFNGLCOLORP3UIPROC)load("glColorP3ui"); + glad_glColorP3uiv = (PFNGLCOLORP3UIVPROC)load("glColorP3uiv"); + glad_glColorP4ui = (PFNGLCOLORP4UIPROC)load("glColorP4ui"); + glad_glColorP4uiv = (PFNGLCOLORP4UIVPROC)load("glColorP4uiv"); + glad_glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)load("glSecondaryColorP3ui"); + glad_glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)load("glSecondaryColorP3uiv"); +} +static void load_GL_ARB_debug_output(GLADloadproc load) { + if(!GLAD_GL_ARB_debug_output) return; + glad_glDebugMessageControlARB = (PFNGLDEBUGMESSAGECONTROLARBPROC)load("glDebugMessageControlARB"); + glad_glDebugMessageInsertARB = (PFNGLDEBUGMESSAGEINSERTARBPROC)load("glDebugMessageInsertARB"); + glad_glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC)load("glDebugMessageCallbackARB"); + glad_glGetDebugMessageLogARB = (PFNGLGETDEBUGMESSAGELOGARBPROC)load("glGetDebugMessageLogARB"); +} +static int find_extensionsGL(void) { + if (!get_exts()) return 0; + GLAD_GL_ARB_debug_output = has_ext("GL_ARB_debug_output"); + free_exts(); + return 1; +} + +static void find_coreGL(void) { + + /* Thank you @elmindreda + * https://github.com/elmindreda/greg/blob/master/templates/greg.c.in#L176 + * https://github.com/glfw/glfw/blob/master/src/context.c#L36 + */ + int i, major, minor; + + const char* version; + const char* prefixes[] = { + "OpenGL ES-CM ", + "OpenGL ES-CL ", + "OpenGL ES ", + NULL + }; + + version = (const char*) glGetString(GL_VERSION); + if (!version) return; + + for (i = 0; prefixes[i]; i++) { + const size_t length = strlen(prefixes[i]); + if (strncmp(version, prefixes[i], length) == 0) { + version += length; + break; + } + } + +/* PR #18 */ +#ifdef _MSC_VER + sscanf_s(version, "%d.%d", &major, &minor); +#else + sscanf(version, "%d.%d", &major, &minor); +#endif + + GLVersion.major = major; GLVersion.minor = minor; + max_loaded_major = major; max_loaded_minor = minor; + GLAD_GL_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1; + GLAD_GL_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1; + GLAD_GL_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1; + GLAD_GL_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1; + GLAD_GL_VERSION_1_4 = (major == 1 && minor >= 4) || major > 1; + GLAD_GL_VERSION_1_5 = (major == 1 && minor >= 5) || major > 1; + GLAD_GL_VERSION_2_0 = (major == 2 && minor >= 0) || major > 2; + GLAD_GL_VERSION_2_1 = (major == 2 && minor >= 1) || major > 2; + GLAD_GL_VERSION_3_0 = (major == 3 && minor >= 0) || major > 3; + GLAD_GL_VERSION_3_1 = (major == 3 && minor >= 1) || major > 3; + GLAD_GL_VERSION_3_2 = (major == 3 && minor >= 2) || major > 3; + GLAD_GL_VERSION_3_3 = (major == 3 && minor >= 3) || major > 3; + if (GLVersion.major > 3 || (GLVersion.major >= 3 && GLVersion.minor >= 3)) { + max_loaded_major = 3; + max_loaded_minor = 3; + } +} + +int gladLoadGLLoader(GLADloadproc load) { + GLVersion.major = 0; GLVersion.minor = 0; + glGetString = (PFNGLGETSTRINGPROC)load("glGetString"); + if(glGetString == NULL) return 0; + if(glGetString(GL_VERSION) == NULL) return 0; + find_coreGL(); + load_GL_VERSION_1_0(load); + load_GL_VERSION_1_1(load); + load_GL_VERSION_1_2(load); + load_GL_VERSION_1_3(load); + load_GL_VERSION_1_4(load); + load_GL_VERSION_1_5(load); + load_GL_VERSION_2_0(load); + load_GL_VERSION_2_1(load); + load_GL_VERSION_3_0(load); + load_GL_VERSION_3_1(load); + load_GL_VERSION_3_2(load); + load_GL_VERSION_3_3(load); + + if (!find_extensionsGL()) return 0; + load_GL_ARB_debug_output(load); + return GLVersion.major != 0 || GLVersion.minor != 0; +} + diff --git a/thirdparty/glad/glad/glad.h b/thirdparty/glad/glad/glad.h new file mode 100644 index 0000000000..e5eb22e297 --- /dev/null +++ b/thirdparty/glad/glad/glad.h @@ -0,0 +1,3697 @@ +/* + + OpenGL loader generated by glad 0.1.13a0 on Fri Jan 6 19:27:07 2017. + + Language/Generator: C/C++ + Specification: gl + APIs: gl=3.3 + Profile: compatibility + Extensions: + GL_ARB_debug_output + Loader: True + Local files: False + Omit khrplatform: False + + Commandline: + --profile="compatibility" --api="gl=3.3" --generator="c" --spec="gl" --extensions="GL_ARB_debug_output" + Online: + http://glad.dav1d.de/#profile=compatibility&language=c&specification=gl&loader=on&api=gl%3D3.3&extensions=GL_ARB_debug_output +*/ + + +#ifndef __glad_h_ +#define __glad_h_ + +#ifdef __gl_h_ +#error OpenGL header already included, remove this include, glad already provides it +#endif +#define __gl_h_ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN 1 +#endif +#include <windows.h> +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +struct gladGLversionStruct { + int major; + int minor; +}; + +typedef void* (* GLADloadproc)(const char *name); + +#ifndef GLAPI +# if defined(GLAD_GLAPI_EXPORT) +# if defined(WIN32) || defined(__CYGWIN__) +# if defined(GLAD_GLAPI_EXPORT_BUILD) +# if defined(__GNUC__) +# define GLAPI __attribute__ ((dllexport)) extern +# else +# define GLAPI __declspec(dllexport) extern +# endif +# else +# if defined(__GNUC__) +# define GLAPI __attribute__ ((dllimport)) extern +# else +# define GLAPI __declspec(dllimport) extern +# endif +# endif +# elif defined(__GNUC__) && defined(GLAD_GLAPI_EXPORT_BUILD) +# define GLAPI __attribute__ ((visibility ("default"))) extern +# else +# define GLAPI extern +# endif +# else +# define GLAPI extern +# endif +#endif + +GLAPI struct gladGLversionStruct GLVersion; + +GLAPI int gladLoadGL(void); + +GLAPI int gladLoadGLLoader(GLADloadproc); + +#include <stddef.h> +#include <KHR/khrplatform.h> +#ifndef GLEXT_64_TYPES_DEFINED +/* This code block is duplicated in glxext.h, so must be protected */ +#define GLEXT_64_TYPES_DEFINED +/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ +/* (as used in the GL_EXT_timer_query extension). */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#include <inttypes.h> +#elif defined(__sun__) || defined(__digital__) +#include <inttypes.h> +#if defined(__STDC__) +#if defined(__arch64__) || defined(_LP64) +typedef long int int64_t; +typedef unsigned long int uint64_t; +#else +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#endif /* __arch64__ */ +#endif /* __STDC__ */ +#elif defined( __VMS ) || defined(__sgi) +#include <inttypes.h> +#elif defined(__SCO__) || defined(__USLC__) +#include <stdint.h> +#elif defined(__UNIXOS2__) || defined(__SOL64__) +typedef long int int32_t; +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#elif defined(_WIN32) && defined(__GNUC__) +#include <stdint.h> +#elif defined(_WIN32) +typedef __int32 int32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else +/* Fallback if nothing above works */ +#include <inttypes.h> +#endif +#endif +typedef unsigned int GLenum; +typedef unsigned char GLboolean; +typedef unsigned int GLbitfield; +typedef void GLvoid; +typedef signed char GLbyte; +typedef short GLshort; +typedef int GLint; +typedef int GLclampx; +typedef unsigned char GLubyte; +typedef unsigned short GLushort; +typedef unsigned int GLuint; +typedef int GLsizei; +typedef float GLfloat; +typedef float GLclampf; +typedef double GLdouble; +typedef double GLclampd; +typedef void *GLeglImageOES; +typedef char GLchar; +typedef char GLcharARB; +#ifdef __APPLE__ +typedef void *GLhandleARB; +#else +typedef unsigned int GLhandleARB; +#endif +typedef unsigned short GLhalfARB; +typedef unsigned short GLhalf; +typedef GLint GLfixed; +#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) +typedef long GLintptr; +#else +typedef ptrdiff_t GLintptr; +#endif +#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) +typedef long GLsizeiptr; +#else +typedef ptrdiff_t GLsizeiptr; +#endif +typedef int64_t GLint64; +typedef uint64_t GLuint64; +#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) +typedef long GLintptrARB; +#else +typedef ptrdiff_t GLintptrARB; +#endif +#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060) +typedef long GLsizeiptrARB; +#else +typedef ptrdiff_t GLsizeiptrARB; +#endif +typedef int64_t GLint64EXT; +typedef uint64_t GLuint64EXT; +typedef struct __GLsync *GLsync; +struct _cl_context; +struct _cl_event; +typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam); +typedef unsigned short GLhalfNV; +typedef GLintptr GLvdpauSurfaceNV; +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_FALSE 0 +#define GL_TRUE 1 +#define GL_POINTS 0x0000 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_LINE_STRIP 0x0003 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_QUADS 0x0007 +#define GL_NEVER 0x0200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 +#define GL_ZERO 0 +#define GL_ONE 1 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +#define GL_NONE 0 +#define GL_FRONT_LEFT 0x0400 +#define GL_FRONT_RIGHT 0x0401 +#define GL_BACK_LEFT 0x0402 +#define GL_BACK_RIGHT 0x0403 +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_LEFT 0x0406 +#define GL_RIGHT 0x0407 +#define GL_FRONT_AND_BACK 0x0408 +#define GL_NO_ERROR 0 +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_OUT_OF_MEMORY 0x0505 +#define GL_CW 0x0900 +#define GL_CCW 0x0901 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_RANGE 0x0B12 +#define GL_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_LINE_SMOOTH 0x0B20 +#define GL_LINE_WIDTH 0x0B21 +#define GL_LINE_WIDTH_RANGE 0x0B22 +#define GL_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_POLYGON_MODE 0x0B40 +#define GL_POLYGON_SMOOTH 0x0B41 +#define GL_CULL_FACE 0x0B44 +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_TEST 0x0B71 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_STENCIL_TEST 0x0B90 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_VIEWPORT 0x0BA2 +#define GL_DITHER 0x0BD0 +#define GL_BLEND_DST 0x0BE0 +#define GL_BLEND_SRC 0x0BE1 +#define GL_BLEND 0x0BE2 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_DRAW_BUFFER 0x0C01 +#define GL_READ_BUFFER 0x0C02 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_DOUBLEBUFFER 0x0C32 +#define GL_STEREO 0x0C33 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_POLYGON_SMOOTH_HINT 0x0C53 +#define GL_UNPACK_SWAP_BYTES 0x0CF0 +#define GL_UNPACK_LSB_FIRST 0x0CF1 +#define GL_UNPACK_ROW_LENGTH 0x0CF2 +#define GL_UNPACK_SKIP_ROWS 0x0CF3 +#define GL_UNPACK_SKIP_PIXELS 0x0CF4 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_SWAP_BYTES 0x0D00 +#define GL_PACK_LSB_FIRST 0x0D01 +#define GL_PACK_ROW_LENGTH 0x0D02 +#define GL_PACK_SKIP_ROWS 0x0D03 +#define GL_PACK_SKIP_PIXELS 0x0D04 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_POINT 0x2A01 +#define GL_POLYGON_OFFSET_LINE 0x2A02 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_TEXTURE_BINDING_1D 0x8068 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_TEXTURE_WIDTH 0x1000 +#define GL_TEXTURE_HEIGHT 0x1001 +#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 +#define GL_TEXTURE_BORDER_COLOR 0x1004 +#define GL_TEXTURE_RED_SIZE 0x805C +#define GL_TEXTURE_GREEN_SIZE 0x805D +#define GL_TEXTURE_BLUE_SIZE 0x805E +#define GL_TEXTURE_ALPHA_SIZE 0x805F +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_DOUBLE 0x140A +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_CLEAR 0x1500 +#define GL_AND 0x1501 +#define GL_AND_REVERSE 0x1502 +#define GL_COPY 0x1503 +#define GL_AND_INVERTED 0x1504 +#define GL_NOOP 0x1505 +#define GL_XOR 0x1506 +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_EQUIV 0x1509 +#define GL_INVERT 0x150A +#define GL_OR_REVERSE 0x150B +#define GL_COPY_INVERTED 0x150C +#define GL_OR_INVERTED 0x150D +#define GL_NAND 0x150E +#define GL_SET 0x150F +#define GL_TEXTURE 0x1702 +#define GL_COLOR 0x1800 +#define GL_DEPTH 0x1801 +#define GL_STENCIL 0x1802 +#define GL_STENCIL_INDEX 0x1901 +#define GL_DEPTH_COMPONENT 0x1902 +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_POINT 0x1B00 +#define GL_LINE 0x1B01 +#define GL_FILL 0x1B02 +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_REPEAT 0x2901 +#define GL_R3_G3_B2 0x2A10 +#define GL_RGB4 0x804F +#define GL_RGB5 0x8050 +#define GL_RGB8 0x8051 +#define GL_RGB10 0x8052 +#define GL_RGB12 0x8053 +#define GL_RGB16 0x8054 +#define GL_RGBA2 0x8055 +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGBA8 0x8058 +#define GL_RGB10_A2 0x8059 +#define GL_RGBA12 0x805A +#define GL_RGBA16 0x805B +#define GL_CURRENT_BIT 0x00000001 +#define GL_POINT_BIT 0x00000002 +#define GL_LINE_BIT 0x00000004 +#define GL_POLYGON_BIT 0x00000008 +#define GL_POLYGON_STIPPLE_BIT 0x00000010 +#define GL_PIXEL_MODE_BIT 0x00000020 +#define GL_LIGHTING_BIT 0x00000040 +#define GL_FOG_BIT 0x00000080 +#define GL_ACCUM_BUFFER_BIT 0x00000200 +#define GL_VIEWPORT_BIT 0x00000800 +#define GL_TRANSFORM_BIT 0x00001000 +#define GL_ENABLE_BIT 0x00002000 +#define GL_HINT_BIT 0x00008000 +#define GL_EVAL_BIT 0x00010000 +#define GL_LIST_BIT 0x00020000 +#define GL_TEXTURE_BIT 0x00040000 +#define GL_SCISSOR_BIT 0x00080000 +#define GL_ALL_ATTRIB_BITS 0xFFFFFFFF +#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 +#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 +#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF +#define GL_QUAD_STRIP 0x0008 +#define GL_POLYGON 0x0009 +#define GL_ACCUM 0x0100 +#define GL_LOAD 0x0101 +#define GL_RETURN 0x0102 +#define GL_MULT 0x0103 +#define GL_ADD 0x0104 +#define GL_AUX0 0x0409 +#define GL_AUX1 0x040A +#define GL_AUX2 0x040B +#define GL_AUX3 0x040C +#define GL_2D 0x0600 +#define GL_3D 0x0601 +#define GL_3D_COLOR 0x0602 +#define GL_3D_COLOR_TEXTURE 0x0603 +#define GL_4D_COLOR_TEXTURE 0x0604 +#define GL_PASS_THROUGH_TOKEN 0x0700 +#define GL_POINT_TOKEN 0x0701 +#define GL_LINE_TOKEN 0x0702 +#define GL_POLYGON_TOKEN 0x0703 +#define GL_BITMAP_TOKEN 0x0704 +#define GL_DRAW_PIXEL_TOKEN 0x0705 +#define GL_COPY_PIXEL_TOKEN 0x0706 +#define GL_LINE_RESET_TOKEN 0x0707 +#define GL_EXP 0x0800 +#define GL_EXP2 0x0801 +#define GL_COEFF 0x0A00 +#define GL_ORDER 0x0A01 +#define GL_DOMAIN 0x0A02 +#define GL_PIXEL_MAP_I_TO_I 0x0C70 +#define GL_PIXEL_MAP_S_TO_S 0x0C71 +#define GL_PIXEL_MAP_I_TO_R 0x0C72 +#define GL_PIXEL_MAP_I_TO_G 0x0C73 +#define GL_PIXEL_MAP_I_TO_B 0x0C74 +#define GL_PIXEL_MAP_I_TO_A 0x0C75 +#define GL_PIXEL_MAP_R_TO_R 0x0C76 +#define GL_PIXEL_MAP_G_TO_G 0x0C77 +#define GL_PIXEL_MAP_B_TO_B 0x0C78 +#define GL_PIXEL_MAP_A_TO_A 0x0C79 +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_INDEX_ARRAY_POINTER 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 +#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 +#define GL_SELECTION_BUFFER_POINTER 0x0DF3 +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_INDEX 0x0B01 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_CURRENT_RASTER_COLOR 0x0B04 +#define GL_CURRENT_RASTER_INDEX 0x0B05 +#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 +#define GL_CURRENT_RASTER_POSITION 0x0B07 +#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 +#define GL_CURRENT_RASTER_DISTANCE 0x0B09 +#define GL_POINT_SMOOTH 0x0B10 +#define GL_LINE_STIPPLE 0x0B24 +#define GL_LINE_STIPPLE_PATTERN 0x0B25 +#define GL_LINE_STIPPLE_REPEAT 0x0B26 +#define GL_LIST_MODE 0x0B30 +#define GL_MAX_LIST_NESTING 0x0B31 +#define GL_LIST_BASE 0x0B32 +#define GL_LIST_INDEX 0x0B33 +#define GL_POLYGON_STIPPLE 0x0B42 +#define GL_EDGE_FLAG 0x0B43 +#define GL_LIGHTING 0x0B50 +#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_SHADE_MODEL 0x0B54 +#define GL_COLOR_MATERIAL_FACE 0x0B55 +#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_FOG 0x0B60 +#define GL_FOG_INDEX 0x0B61 +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_COLOR 0x0B66 +#define GL_ACCUM_CLEAR_VALUE 0x0B80 +#define GL_MATRIX_MODE 0x0BA0 +#define GL_NORMALIZE 0x0BA1 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_ATTRIB_STACK_DEPTH 0x0BB0 +#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 +#define GL_ALPHA_TEST 0x0BC0 +#define GL_ALPHA_TEST_FUNC 0x0BC1 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_INDEX_LOGIC_OP 0x0BF1 +#define GL_LOGIC_OP 0x0BF1 +#define GL_AUX_BUFFERS 0x0C00 +#define GL_INDEX_CLEAR_VALUE 0x0C20 +#define GL_INDEX_WRITEMASK 0x0C21 +#define GL_INDEX_MODE 0x0C30 +#define GL_RGBA_MODE 0x0C31 +#define GL_RENDER_MODE 0x0C40 +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_FOG_HINT 0x0C54 +#define GL_TEXTURE_GEN_S 0x0C60 +#define GL_TEXTURE_GEN_T 0x0C61 +#define GL_TEXTURE_GEN_R 0x0C62 +#define GL_TEXTURE_GEN_Q 0x0C63 +#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 +#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 +#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 +#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 +#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 +#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 +#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 +#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 +#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 +#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 +#define GL_MAP_COLOR 0x0D10 +#define GL_MAP_STENCIL 0x0D11 +#define GL_INDEX_SHIFT 0x0D12 +#define GL_INDEX_OFFSET 0x0D13 +#define GL_RED_SCALE 0x0D14 +#define GL_RED_BIAS 0x0D15 +#define GL_ZOOM_X 0x0D16 +#define GL_ZOOM_Y 0x0D17 +#define GL_GREEN_SCALE 0x0D18 +#define GL_GREEN_BIAS 0x0D19 +#define GL_BLUE_SCALE 0x0D1A +#define GL_BLUE_BIAS 0x0D1B +#define GL_ALPHA_SCALE 0x0D1C +#define GL_ALPHA_BIAS 0x0D1D +#define GL_DEPTH_SCALE 0x0D1E +#define GL_DEPTH_BIAS 0x0D1F +#define GL_MAX_EVAL_ORDER 0x0D30 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 +#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_NAME_STACK_DEPTH 0x0D37 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B +#define GL_INDEX_BITS 0x0D51 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_ALPHA_BITS 0x0D55 +#define GL_DEPTH_BITS 0x0D56 +#define GL_STENCIL_BITS 0x0D57 +#define GL_ACCUM_RED_BITS 0x0D58 +#define GL_ACCUM_GREEN_BITS 0x0D59 +#define GL_ACCUM_BLUE_BITS 0x0D5A +#define GL_ACCUM_ALPHA_BITS 0x0D5B +#define GL_NAME_STACK_DEPTH 0x0D70 +#define GL_AUTO_NORMAL 0x0D80 +#define GL_MAP1_COLOR_4 0x0D90 +#define GL_MAP1_INDEX 0x0D91 +#define GL_MAP1_NORMAL 0x0D92 +#define GL_MAP1_TEXTURE_COORD_1 0x0D93 +#define GL_MAP1_TEXTURE_COORD_2 0x0D94 +#define GL_MAP1_TEXTURE_COORD_3 0x0D95 +#define GL_MAP1_TEXTURE_COORD_4 0x0D96 +#define GL_MAP1_VERTEX_3 0x0D97 +#define GL_MAP1_VERTEX_4 0x0D98 +#define GL_MAP2_COLOR_4 0x0DB0 +#define GL_MAP2_INDEX 0x0DB1 +#define GL_MAP2_NORMAL 0x0DB2 +#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 +#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 +#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 +#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 +#define GL_MAP2_VERTEX_3 0x0DB7 +#define GL_MAP2_VERTEX_4 0x0DB8 +#define GL_MAP1_GRID_DOMAIN 0x0DD0 +#define GL_MAP1_GRID_SEGMENTS 0x0DD1 +#define GL_MAP2_GRID_DOMAIN 0x0DD2 +#define GL_MAP2_GRID_SEGMENTS 0x0DD3 +#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 +#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 +#define GL_SELECTION_BUFFER_SIZE 0x0DF4 +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_INDEX_ARRAY 0x8077 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_EDGE_FLAG_ARRAY 0x8079 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_INDEX_ARRAY_TYPE 0x8085 +#define GL_INDEX_ARRAY_STRIDE 0x8086 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C +#define GL_TEXTURE_COMPONENTS 0x1003 +#define GL_TEXTURE_BORDER 0x1005 +#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE 0x8061 +#define GL_TEXTURE_PRIORITY 0x8066 +#define GL_TEXTURE_RESIDENT 0x8067 +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 +#define GL_COMPILE 0x1300 +#define GL_COMPILE_AND_EXECUTE 0x1301 +#define GL_2_BYTES 0x1407 +#define GL_3_BYTES 0x1408 +#define GL_4_BYTES 0x1409 +#define GL_EMISSION 0x1600 +#define GL_SHININESS 0x1601 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +#define GL_COLOR_INDEXES 0x1603 +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_COLOR_INDEX 0x1900 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_BITMAP 0x1A00 +#define GL_RENDER 0x1C00 +#define GL_FEEDBACK 0x1C01 +#define GL_SELECT 0x1C02 +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 +#define GL_S 0x2000 +#define GL_T 0x2001 +#define GL_R 0x2002 +#define GL_Q 0x2003 +#define GL_MODULATE 0x2100 +#define GL_DECAL 0x2101 +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_ENV_COLOR 0x2201 +#define GL_TEXTURE_ENV 0x2300 +#define GL_EYE_LINEAR 0x2400 +#define GL_OBJECT_LINEAR 0x2401 +#define GL_SPHERE_MAP 0x2402 +#define GL_TEXTURE_GEN_MODE 0x2500 +#define GL_OBJECT_PLANE 0x2501 +#define GL_EYE_PLANE 0x2502 +#define GL_CLAMP 0x2900 +#define GL_ALPHA4 0x803B +#define GL_ALPHA8 0x803C +#define GL_ALPHA12 0x803D +#define GL_ALPHA16 0x803E +#define GL_LUMINANCE4 0x803F +#define GL_LUMINANCE8 0x8040 +#define GL_LUMINANCE12 0x8041 +#define GL_LUMINANCE16 0x8042 +#define GL_LUMINANCE4_ALPHA4 0x8043 +#define GL_LUMINANCE6_ALPHA2 0x8044 +#define GL_LUMINANCE8_ALPHA8 0x8045 +#define GL_LUMINANCE12_ALPHA4 0x8046 +#define GL_LUMINANCE12_ALPHA12 0x8047 +#define GL_LUMINANCE16_ALPHA16 0x8048 +#define GL_INTENSITY 0x8049 +#define GL_INTENSITY4 0x804A +#define GL_INTENSITY8 0x804B +#define GL_INTENSITY12 0x804C +#define GL_INTENSITY16 0x804D +#define GL_V2F 0x2A20 +#define GL_V3F 0x2A21 +#define GL_C4UB_V2F 0x2A22 +#define GL_C4UB_V3F 0x2A23 +#define GL_C3F_V3F 0x2A24 +#define GL_N3F_V3F 0x2A25 +#define GL_C4F_N3F_V3F 0x2A26 +#define GL_T2F_V3F 0x2A27 +#define GL_T4F_V4F 0x2A28 +#define GL_T2F_C4UB_V3F 0x2A29 +#define GL_T2F_C3F_V3F 0x2A2A +#define GL_T2F_N3F_V3F 0x2A2B +#define GL_T2F_C4F_N3F_V3F 0x2A2C +#define GL_T4F_C4F_N3F_V4F 0x2A2D +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 +#define GL_LIGHT0 0x4000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#define GL_RESCALE_NORMAL 0x803A +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_MULTISAMPLE_BIT 0x20000000 +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_SUBTRACT 0x84E7 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_COMPARE_R_TO_TEXTURE 0x884E +#define GL_FUNC_ADD 0x8006 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 +#define GL_SRC1_ALPHA 0x8589 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_FOG_COORD_SRC 0x8450 +#define GL_FOG_COORD 0x8451 +#define GL_CURRENT_FOG_COORD 0x8453 +#define GL_FOG_COORD_ARRAY_TYPE 0x8454 +#define GL_FOG_COORD_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORD_ARRAY_POINTER 0x8456 +#define GL_FOG_COORD_ARRAY 0x8457 +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING 0x889D +#define GL_SRC0_RGB 0x8580 +#define GL_SRC1_RGB 0x8581 +#define GL_SRC2_RGB 0x8582 +#define GL_SRC0_ALPHA 0x8588 +#define GL_SRC2_ALPHA 0x858A +#define GL_BLEND_EQUATION_RGB 0x8009 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_TEXTURE_COORDS 0x8871 +#define GL_PIXEL_PACK_BUFFER 0x88EB +#define GL_PIXEL_UNPACK_BUFFER 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF +#define GL_FLOAT_MAT2x3 0x8B65 +#define GL_FLOAT_MAT2x4 0x8B66 +#define GL_FLOAT_MAT3x2 0x8B67 +#define GL_FLOAT_MAT3x4 0x8B68 +#define GL_FLOAT_MAT4x2 0x8B69 +#define GL_FLOAT_MAT4x3 0x8B6A +#define GL_SRGB 0x8C40 +#define GL_SRGB8 0x8C41 +#define GL_SRGB_ALPHA 0x8C42 +#define GL_SRGB8_ALPHA8 0x8C43 +#define GL_COMPRESSED_SRGB 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 +#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F +#define GL_SLUMINANCE_ALPHA 0x8C44 +#define GL_SLUMINANCE8_ALPHA8 0x8C45 +#define GL_SLUMINANCE 0x8C46 +#define GL_SLUMINANCE8 0x8C47 +#define GL_COMPRESSED_SLUMINANCE 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B +#define GL_COMPARE_REF_TO_TEXTURE 0x884E +#define GL_CLIP_DISTANCE0 0x3000 +#define GL_CLIP_DISTANCE1 0x3001 +#define GL_CLIP_DISTANCE2 0x3002 +#define GL_CLIP_DISTANCE3 0x3003 +#define GL_CLIP_DISTANCE4 0x3004 +#define GL_CLIP_DISTANCE5 0x3005 +#define GL_CLIP_DISTANCE6 0x3006 +#define GL_CLIP_DISTANCE7 0x3007 +#define GL_MAX_CLIP_DISTANCES 0x0D32 +#define GL_MAJOR_VERSION 0x821B +#define GL_MINOR_VERSION 0x821C +#define GL_NUM_EXTENSIONS 0x821D +#define GL_CONTEXT_FLAGS 0x821E +#define GL_COMPRESSED_RED 0x8225 +#define GL_COMPRESSED_RG 0x8226 +#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001 +#define GL_RGBA32F 0x8814 +#define GL_RGB32F 0x8815 +#define GL_RGBA16F 0x881A +#define GL_RGB16F 0x881B +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD +#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF +#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 +#define GL_CLAMP_READ_COLOR 0x891C +#define GL_FIXED_ONLY 0x891D +#define GL_MAX_VARYING_COMPONENTS 0x8B4B +#define GL_TEXTURE_1D_ARRAY 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D +#define GL_R11F_G11F_B10F 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B +#define GL_RGB9_E5 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E +#define GL_TEXTURE_SHARED_SIZE 0x8C3F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 +#define GL_PRIMITIVES_GENERATED 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 +#define GL_RASTERIZER_DISCARD 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B +#define GL_INTERLEAVED_ATTRIBS 0x8C8C +#define GL_SEPARATE_ATTRIBS 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F +#define GL_RGBA32UI 0x8D70 +#define GL_RGB32UI 0x8D71 +#define GL_RGBA16UI 0x8D76 +#define GL_RGB16UI 0x8D77 +#define GL_RGBA8UI 0x8D7C +#define GL_RGB8UI 0x8D7D +#define GL_RGBA32I 0x8D82 +#define GL_RGB32I 0x8D83 +#define GL_RGBA16I 0x8D88 +#define GL_RGB16I 0x8D89 +#define GL_RGBA8I 0x8D8E +#define GL_RGB8I 0x8D8F +#define GL_RED_INTEGER 0x8D94 +#define GL_GREEN_INTEGER 0x8D95 +#define GL_BLUE_INTEGER 0x8D96 +#define GL_RGB_INTEGER 0x8D98 +#define GL_RGBA_INTEGER 0x8D99 +#define GL_BGR_INTEGER 0x8D9A +#define GL_BGRA_INTEGER 0x8D9B +#define GL_SAMPLER_1D_ARRAY 0x8DC0 +#define GL_SAMPLER_2D_ARRAY 0x8DC1 +#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 +#define GL_UNSIGNED_INT_VEC2 0x8DC6 +#define GL_UNSIGNED_INT_VEC3 0x8DC7 +#define GL_UNSIGNED_INT_VEC4 0x8DC8 +#define GL_INT_SAMPLER_1D 0x8DC9 +#define GL_INT_SAMPLER_2D 0x8DCA +#define GL_INT_SAMPLER_3D 0x8DCB +#define GL_INT_SAMPLER_CUBE 0x8DCC +#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF +#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 +#define GL_QUERY_WAIT 0x8E13 +#define GL_QUERY_NO_WAIT 0x8E14 +#define GL_QUERY_BY_REGION_WAIT 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 +#define GL_BUFFER_ACCESS_FLAGS 0x911F +#define GL_BUFFER_MAP_LENGTH 0x9120 +#define GL_BUFFER_MAP_OFFSET 0x9121 +#define GL_DEPTH_COMPONENT32F 0x8CAC +#define GL_DEPTH32F_STENCIL8 0x8CAD +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 +#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 +#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 +#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 +#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 +#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 +#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 +#define GL_FRAMEBUFFER_DEFAULT 0x8218 +#define GL_FRAMEBUFFER_UNDEFINED 0x8219 +#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 +#define GL_DEPTH_STENCIL 0x84F9 +#define GL_UNSIGNED_INT_24_8 0x84FA +#define GL_DEPTH24_STENCIL8 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE 0x88F1 +#define GL_TEXTURE_RED_TYPE 0x8C10 +#define GL_TEXTURE_GREEN_TYPE 0x8C11 +#define GL_TEXTURE_BLUE_TYPE 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE 0x8C13 +#define GL_TEXTURE_DEPTH_TYPE 0x8C16 +#define GL_UNSIGNED_NORMALIZED 0x8C17 +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_READ_FRAMEBUFFER 0x8CA8 +#define GL_DRAW_FRAMEBUFFER 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA +#define GL_RENDERBUFFER_SAMPLES 0x8CAB +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_COLOR_ATTACHMENT1 0x8CE1 +#define GL_COLOR_ATTACHMENT2 0x8CE2 +#define GL_COLOR_ATTACHMENT3 0x8CE3 +#define GL_COLOR_ATTACHMENT4 0x8CE4 +#define GL_COLOR_ATTACHMENT5 0x8CE5 +#define GL_COLOR_ATTACHMENT6 0x8CE6 +#define GL_COLOR_ATTACHMENT7 0x8CE7 +#define GL_COLOR_ATTACHMENT8 0x8CE8 +#define GL_COLOR_ATTACHMENT9 0x8CE9 +#define GL_COLOR_ATTACHMENT10 0x8CEA +#define GL_COLOR_ATTACHMENT11 0x8CEB +#define GL_COLOR_ATTACHMENT12 0x8CEC +#define GL_COLOR_ATTACHMENT13 0x8CED +#define GL_COLOR_ATTACHMENT14 0x8CEE +#define GL_COLOR_ATTACHMENT15 0x8CEF +#define GL_COLOR_ATTACHMENT16 0x8CF0 +#define GL_COLOR_ATTACHMENT17 0x8CF1 +#define GL_COLOR_ATTACHMENT18 0x8CF2 +#define GL_COLOR_ATTACHMENT19 0x8CF3 +#define GL_COLOR_ATTACHMENT20 0x8CF4 +#define GL_COLOR_ATTACHMENT21 0x8CF5 +#define GL_COLOR_ATTACHMENT22 0x8CF6 +#define GL_COLOR_ATTACHMENT23 0x8CF7 +#define GL_COLOR_ATTACHMENT24 0x8CF8 +#define GL_COLOR_ATTACHMENT25 0x8CF9 +#define GL_COLOR_ATTACHMENT26 0x8CFA +#define GL_COLOR_ATTACHMENT27 0x8CFB +#define GL_COLOR_ATTACHMENT28 0x8CFC +#define GL_COLOR_ATTACHMENT29 0x8CFD +#define GL_COLOR_ATTACHMENT30 0x8CFE +#define GL_COLOR_ATTACHMENT31 0x8CFF +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_STENCIL_INDEX1 0x8D46 +#define GL_STENCIL_INDEX4 0x8D47 +#define GL_STENCIL_INDEX8 0x8D48 +#define GL_STENCIL_INDEX16 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 +#define GL_MAX_SAMPLES 0x8D57 +#define GL_INDEX 0x8222 +#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 +#define GL_FRAMEBUFFER_SRGB 0x8DB9 +#define GL_HALF_FLOAT 0x140B +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 +#define GL_COMPRESSED_RED_RGTC1 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC +#define GL_COMPRESSED_RG_RGTC2 0x8DBD +#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE +#define GL_RG 0x8227 +#define GL_RG_INTEGER 0x8228 +#define GL_R8 0x8229 +#define GL_R16 0x822A +#define GL_RG8 0x822B +#define GL_RG16 0x822C +#define GL_R16F 0x822D +#define GL_R32F 0x822E +#define GL_RG16F 0x822F +#define GL_RG32F 0x8230 +#define GL_R8I 0x8231 +#define GL_R8UI 0x8232 +#define GL_R16I 0x8233 +#define GL_R16UI 0x8234 +#define GL_R32I 0x8235 +#define GL_R32UI 0x8236 +#define GL_RG8I 0x8237 +#define GL_RG8UI 0x8238 +#define GL_RG16I 0x8239 +#define GL_RG16UI 0x823A +#define GL_RG32I 0x823B +#define GL_RG32UI 0x823C +#define GL_VERTEX_ARRAY_BINDING 0x85B5 +#define GL_CLAMP_VERTEX_COLOR 0x891A +#define GL_CLAMP_FRAGMENT_COLOR 0x891B +#define GL_ALPHA_INTEGER 0x8D97 +#define GL_SAMPLER_2D_RECT 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 +#define GL_SAMPLER_BUFFER 0x8DC2 +#define GL_INT_SAMPLER_2D_RECT 0x8DCD +#define GL_INT_SAMPLER_BUFFER 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 +#define GL_TEXTURE_BUFFER 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D +#define GL_TEXTURE_RECTANGLE 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_PRIMITIVE_RESTART 0x8F9D +#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E +#define GL_COPY_READ_BUFFER 0x8F36 +#define GL_COPY_WRITE_BUFFER 0x8F37 +#define GL_UNIFORM_BUFFER 0x8A11 +#define GL_UNIFORM_BUFFER_BINDING 0x8A28 +#define GL_UNIFORM_BUFFER_START 0x8A29 +#define GL_UNIFORM_BUFFER_SIZE 0x8A2A +#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C +#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D +#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E +#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F +#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 +#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 +#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 +#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 +#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 +#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 +#define GL_UNIFORM_TYPE 0x8A37 +#define GL_UNIFORM_SIZE 0x8A38 +#define GL_UNIFORM_NAME_LENGTH 0x8A39 +#define GL_UNIFORM_BLOCK_INDEX 0x8A3A +#define GL_UNIFORM_OFFSET 0x8A3B +#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C +#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D +#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E +#define GL_UNIFORM_BLOCK_BINDING 0x8A3F +#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 +#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 +#define GL_INVALID_INDEX 0xFFFFFFFF +#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 +#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define GL_LINES_ADJACENCY 0x000A +#define GL_LINE_STRIP_ADJACENCY 0x000B +#define GL_TRIANGLES_ADJACENCY 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D +#define GL_PROGRAM_POINT_SIZE 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 +#define GL_GEOMETRY_SHADER 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT 0x8916 +#define GL_GEOMETRY_INPUT_TYPE 0x8917 +#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 +#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 +#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 +#define GL_CONTEXT_PROFILE_MASK 0x9126 +#define GL_DEPTH_CLAMP 0x864F +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F +#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 +#define GL_OBJECT_TYPE 0x9112 +#define GL_SYNC_CONDITION 0x9113 +#define GL_SYNC_STATUS 0x9114 +#define GL_SYNC_FLAGS 0x9115 +#define GL_SYNC_FENCE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 +#define GL_UNSIGNALED 0x9118 +#define GL_SIGNALED 0x9119 +#define GL_ALREADY_SIGNALED 0x911A +#define GL_TIMEOUT_EXPIRED 0x911B +#define GL_CONDITION_SATISFIED 0x911C +#define GL_WAIT_FAILED 0x911D +#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF +#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 +#define GL_SAMPLE_POSITION 0x8E50 +#define GL_SAMPLE_MASK 0x8E51 +#define GL_SAMPLE_MASK_VALUE 0x8E52 +#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 +#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 +#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 +#define GL_TEXTURE_SAMPLES 0x9106 +#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 +#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 +#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A +#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B +#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D +#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E +#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F +#define GL_MAX_INTEGER_SAMPLES 0x9110 +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE +#define GL_SRC1_COLOR 0x88F9 +#define GL_ONE_MINUS_SRC1_COLOR 0x88FA +#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB +#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC +#define GL_ANY_SAMPLES_PASSED 0x8C2F +#define GL_SAMPLER_BINDING 0x8919 +#define GL_RGB10_A2UI 0x906F +#define GL_TEXTURE_SWIZZLE_R 0x8E42 +#define GL_TEXTURE_SWIZZLE_G 0x8E43 +#define GL_TEXTURE_SWIZZLE_B 0x8E44 +#define GL_TEXTURE_SWIZZLE_A 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 +#define GL_TIME_ELAPSED 0x88BF +#define GL_TIMESTAMP 0x8E28 +#define GL_INT_2_10_10_10_REV 0x8D9F +#ifndef GL_VERSION_1_0 +#define GL_VERSION_1_0 1 +GLAPI int GLAD_GL_VERSION_1_0; +typedef void (APIENTRYP PFNGLCULLFACEPROC)(GLenum mode); +GLAPI PFNGLCULLFACEPROC glad_glCullFace; +#define glCullFace glad_glCullFace +typedef void (APIENTRYP PFNGLFRONTFACEPROC)(GLenum mode); +GLAPI PFNGLFRONTFACEPROC glad_glFrontFace; +#define glFrontFace glad_glFrontFace +typedef void (APIENTRYP PFNGLHINTPROC)(GLenum target, GLenum mode); +GLAPI PFNGLHINTPROC glad_glHint; +#define glHint glad_glHint +typedef void (APIENTRYP PFNGLLINEWIDTHPROC)(GLfloat width); +GLAPI PFNGLLINEWIDTHPROC glad_glLineWidth; +#define glLineWidth glad_glLineWidth +typedef void (APIENTRYP PFNGLPOINTSIZEPROC)(GLfloat size); +GLAPI PFNGLPOINTSIZEPROC glad_glPointSize; +#define glPointSize glad_glPointSize +typedef void (APIENTRYP PFNGLPOLYGONMODEPROC)(GLenum face, GLenum mode); +GLAPI PFNGLPOLYGONMODEPROC glad_glPolygonMode; +#define glPolygonMode glad_glPolygonMode +typedef void (APIENTRYP PFNGLSCISSORPROC)(GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLSCISSORPROC glad_glScissor; +#define glScissor glad_glScissor +typedef void (APIENTRYP PFNGLTEXPARAMETERFPROC)(GLenum target, GLenum pname, GLfloat param); +GLAPI PFNGLTEXPARAMETERFPROC glad_glTexParameterf; +#define glTexParameterf glad_glTexParameterf +typedef void (APIENTRYP PFNGLTEXPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat *params); +GLAPI PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv; +#define glTexParameterfv glad_glTexParameterfv +typedef void (APIENTRYP PFNGLTEXPARAMETERIPROC)(GLenum target, GLenum pname, GLint param); +GLAPI PFNGLTEXPARAMETERIPROC glad_glTexParameteri; +#define glTexParameteri glad_glTexParameteri +typedef void (APIENTRYP PFNGLTEXPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint *params); +GLAPI PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv; +#define glTexParameteriv glad_glTexParameteriv +typedef void (APIENTRYP PFNGLTEXIMAGE1DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI PFNGLTEXIMAGE1DPROC glad_glTexImage1D; +#define glTexImage1D glad_glTexImage1D +typedef void (APIENTRYP PFNGLTEXIMAGE2DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI PFNGLTEXIMAGE2DPROC glad_glTexImage2D; +#define glTexImage2D glad_glTexImage2D +typedef void (APIENTRYP PFNGLDRAWBUFFERPROC)(GLenum buf); +GLAPI PFNGLDRAWBUFFERPROC glad_glDrawBuffer; +#define glDrawBuffer glad_glDrawBuffer +typedef void (APIENTRYP PFNGLCLEARPROC)(GLbitfield mask); +GLAPI PFNGLCLEARPROC glad_glClear; +#define glClear glad_glClear +typedef void (APIENTRYP PFNGLCLEARCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI PFNGLCLEARCOLORPROC glad_glClearColor; +#define glClearColor glad_glClearColor +typedef void (APIENTRYP PFNGLCLEARSTENCILPROC)(GLint s); +GLAPI PFNGLCLEARSTENCILPROC glad_glClearStencil; +#define glClearStencil glad_glClearStencil +typedef void (APIENTRYP PFNGLCLEARDEPTHPROC)(GLdouble depth); +GLAPI PFNGLCLEARDEPTHPROC glad_glClearDepth; +#define glClearDepth glad_glClearDepth +typedef void (APIENTRYP PFNGLSTENCILMASKPROC)(GLuint mask); +GLAPI PFNGLSTENCILMASKPROC glad_glStencilMask; +#define glStencilMask glad_glStencilMask +typedef void (APIENTRYP PFNGLCOLORMASKPROC)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GLAPI PFNGLCOLORMASKPROC glad_glColorMask; +#define glColorMask glad_glColorMask +typedef void (APIENTRYP PFNGLDEPTHMASKPROC)(GLboolean flag); +GLAPI PFNGLDEPTHMASKPROC glad_glDepthMask; +#define glDepthMask glad_glDepthMask +typedef void (APIENTRYP PFNGLDISABLEPROC)(GLenum cap); +GLAPI PFNGLDISABLEPROC glad_glDisable; +#define glDisable glad_glDisable +typedef void (APIENTRYP PFNGLENABLEPROC)(GLenum cap); +GLAPI PFNGLENABLEPROC glad_glEnable; +#define glEnable glad_glEnable +typedef void (APIENTRYP PFNGLFINISHPROC)(); +GLAPI PFNGLFINISHPROC glad_glFinish; +#define glFinish glad_glFinish +typedef void (APIENTRYP PFNGLFLUSHPROC)(); +GLAPI PFNGLFLUSHPROC glad_glFlush; +#define glFlush glad_glFlush +typedef void (APIENTRYP PFNGLBLENDFUNCPROC)(GLenum sfactor, GLenum dfactor); +GLAPI PFNGLBLENDFUNCPROC glad_glBlendFunc; +#define glBlendFunc glad_glBlendFunc +typedef void (APIENTRYP PFNGLLOGICOPPROC)(GLenum opcode); +GLAPI PFNGLLOGICOPPROC glad_glLogicOp; +#define glLogicOp glad_glLogicOp +typedef void (APIENTRYP PFNGLSTENCILFUNCPROC)(GLenum func, GLint ref, GLuint mask); +GLAPI PFNGLSTENCILFUNCPROC glad_glStencilFunc; +#define glStencilFunc glad_glStencilFunc +typedef void (APIENTRYP PFNGLSTENCILOPPROC)(GLenum fail, GLenum zfail, GLenum zpass); +GLAPI PFNGLSTENCILOPPROC glad_glStencilOp; +#define glStencilOp glad_glStencilOp +typedef void (APIENTRYP PFNGLDEPTHFUNCPROC)(GLenum func); +GLAPI PFNGLDEPTHFUNCPROC glad_glDepthFunc; +#define glDepthFunc glad_glDepthFunc +typedef void (APIENTRYP PFNGLPIXELSTOREFPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLPIXELSTOREFPROC glad_glPixelStoref; +#define glPixelStoref glad_glPixelStoref +typedef void (APIENTRYP PFNGLPIXELSTOREIPROC)(GLenum pname, GLint param); +GLAPI PFNGLPIXELSTOREIPROC glad_glPixelStorei; +#define glPixelStorei glad_glPixelStorei +typedef void (APIENTRYP PFNGLREADBUFFERPROC)(GLenum src); +GLAPI PFNGLREADBUFFERPROC glad_glReadBuffer; +#define glReadBuffer glad_glReadBuffer +typedef void (APIENTRYP PFNGLREADPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels); +GLAPI PFNGLREADPIXELSPROC glad_glReadPixels; +#define glReadPixels glad_glReadPixels +typedef void (APIENTRYP PFNGLGETBOOLEANVPROC)(GLenum pname, GLboolean *data); +GLAPI PFNGLGETBOOLEANVPROC glad_glGetBooleanv; +#define glGetBooleanv glad_glGetBooleanv +typedef void (APIENTRYP PFNGLGETDOUBLEVPROC)(GLenum pname, GLdouble *data); +GLAPI PFNGLGETDOUBLEVPROC glad_glGetDoublev; +#define glGetDoublev glad_glGetDoublev +typedef GLenum (APIENTRYP PFNGLGETERRORPROC)(); +GLAPI PFNGLGETERRORPROC glad_glGetError; +#define glGetError glad_glGetError +typedef void (APIENTRYP PFNGLGETFLOATVPROC)(GLenum pname, GLfloat *data); +GLAPI PFNGLGETFLOATVPROC glad_glGetFloatv; +#define glGetFloatv glad_glGetFloatv +typedef void (APIENTRYP PFNGLGETINTEGERVPROC)(GLenum pname, GLint *data); +GLAPI PFNGLGETINTEGERVPROC glad_glGetIntegerv; +#define glGetIntegerv glad_glGetIntegerv +typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGPROC)(GLenum name); +GLAPI PFNGLGETSTRINGPROC glad_glGetString; +#define glGetString glad_glGetString +typedef void (APIENTRYP PFNGLGETTEXIMAGEPROC)(GLenum target, GLint level, GLenum format, GLenum type, void *pixels); +GLAPI PFNGLGETTEXIMAGEPROC glad_glGetTexImage; +#define glGetTexImage glad_glGetTexImage +typedef void (APIENTRYP PFNGLGETTEXPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat *params); +GLAPI PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv; +#define glGetTexParameterfv glad_glGetTexParameterfv +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIVPROC)(GLenum target, GLenum pname, GLint *params); +GLAPI PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv; +#define glGetTexParameteriv glad_glGetTexParameteriv +typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERFVPROC)(GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv; +#define glGetTexLevelParameterfv glad_glGetTexLevelParameterfv +typedef void (APIENTRYP PFNGLGETTEXLEVELPARAMETERIVPROC)(GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv; +#define glGetTexLevelParameteriv glad_glGetTexLevelParameteriv +typedef GLboolean (APIENTRYP PFNGLISENABLEDPROC)(GLenum cap); +GLAPI PFNGLISENABLEDPROC glad_glIsEnabled; +#define glIsEnabled glad_glIsEnabled +typedef void (APIENTRYP PFNGLDEPTHRANGEPROC)(GLdouble near, GLdouble far); +GLAPI PFNGLDEPTHRANGEPROC glad_glDepthRange; +#define glDepthRange glad_glDepthRange +typedef void (APIENTRYP PFNGLVIEWPORTPROC)(GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLVIEWPORTPROC glad_glViewport; +#define glViewport glad_glViewport +typedef void (APIENTRYP PFNGLNEWLISTPROC)(GLuint list, GLenum mode); +GLAPI PFNGLNEWLISTPROC glad_glNewList; +#define glNewList glad_glNewList +typedef void (APIENTRYP PFNGLENDLISTPROC)(); +GLAPI PFNGLENDLISTPROC glad_glEndList; +#define glEndList glad_glEndList +typedef void (APIENTRYP PFNGLCALLLISTPROC)(GLuint list); +GLAPI PFNGLCALLLISTPROC glad_glCallList; +#define glCallList glad_glCallList +typedef void (APIENTRYP PFNGLCALLLISTSPROC)(GLsizei n, GLenum type, const void *lists); +GLAPI PFNGLCALLLISTSPROC glad_glCallLists; +#define glCallLists glad_glCallLists +typedef void (APIENTRYP PFNGLDELETELISTSPROC)(GLuint list, GLsizei range); +GLAPI PFNGLDELETELISTSPROC glad_glDeleteLists; +#define glDeleteLists glad_glDeleteLists +typedef GLuint (APIENTRYP PFNGLGENLISTSPROC)(GLsizei range); +GLAPI PFNGLGENLISTSPROC glad_glGenLists; +#define glGenLists glad_glGenLists +typedef void (APIENTRYP PFNGLLISTBASEPROC)(GLuint base); +GLAPI PFNGLLISTBASEPROC glad_glListBase; +#define glListBase glad_glListBase +typedef void (APIENTRYP PFNGLBEGINPROC)(GLenum mode); +GLAPI PFNGLBEGINPROC glad_glBegin; +#define glBegin glad_glBegin +typedef void (APIENTRYP PFNGLBITMAPPROC)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); +GLAPI PFNGLBITMAPPROC glad_glBitmap; +#define glBitmap glad_glBitmap +typedef void (APIENTRYP PFNGLCOLOR3BPROC)(GLbyte red, GLbyte green, GLbyte blue); +GLAPI PFNGLCOLOR3BPROC glad_glColor3b; +#define glColor3b glad_glColor3b +typedef void (APIENTRYP PFNGLCOLOR3BVPROC)(const GLbyte *v); +GLAPI PFNGLCOLOR3BVPROC glad_glColor3bv; +#define glColor3bv glad_glColor3bv +typedef void (APIENTRYP PFNGLCOLOR3DPROC)(GLdouble red, GLdouble green, GLdouble blue); +GLAPI PFNGLCOLOR3DPROC glad_glColor3d; +#define glColor3d glad_glColor3d +typedef void (APIENTRYP PFNGLCOLOR3DVPROC)(const GLdouble *v); +GLAPI PFNGLCOLOR3DVPROC glad_glColor3dv; +#define glColor3dv glad_glColor3dv +typedef void (APIENTRYP PFNGLCOLOR3FPROC)(GLfloat red, GLfloat green, GLfloat blue); +GLAPI PFNGLCOLOR3FPROC glad_glColor3f; +#define glColor3f glad_glColor3f +typedef void (APIENTRYP PFNGLCOLOR3FVPROC)(const GLfloat *v); +GLAPI PFNGLCOLOR3FVPROC glad_glColor3fv; +#define glColor3fv glad_glColor3fv +typedef void (APIENTRYP PFNGLCOLOR3IPROC)(GLint red, GLint green, GLint blue); +GLAPI PFNGLCOLOR3IPROC glad_glColor3i; +#define glColor3i glad_glColor3i +typedef void (APIENTRYP PFNGLCOLOR3IVPROC)(const GLint *v); +GLAPI PFNGLCOLOR3IVPROC glad_glColor3iv; +#define glColor3iv glad_glColor3iv +typedef void (APIENTRYP PFNGLCOLOR3SPROC)(GLshort red, GLshort green, GLshort blue); +GLAPI PFNGLCOLOR3SPROC glad_glColor3s; +#define glColor3s glad_glColor3s +typedef void (APIENTRYP PFNGLCOLOR3SVPROC)(const GLshort *v); +GLAPI PFNGLCOLOR3SVPROC glad_glColor3sv; +#define glColor3sv glad_glColor3sv +typedef void (APIENTRYP PFNGLCOLOR3UBPROC)(GLubyte red, GLubyte green, GLubyte blue); +GLAPI PFNGLCOLOR3UBPROC glad_glColor3ub; +#define glColor3ub glad_glColor3ub +typedef void (APIENTRYP PFNGLCOLOR3UBVPROC)(const GLubyte *v); +GLAPI PFNGLCOLOR3UBVPROC glad_glColor3ubv; +#define glColor3ubv glad_glColor3ubv +typedef void (APIENTRYP PFNGLCOLOR3UIPROC)(GLuint red, GLuint green, GLuint blue); +GLAPI PFNGLCOLOR3UIPROC glad_glColor3ui; +#define glColor3ui glad_glColor3ui +typedef void (APIENTRYP PFNGLCOLOR3UIVPROC)(const GLuint *v); +GLAPI PFNGLCOLOR3UIVPROC glad_glColor3uiv; +#define glColor3uiv glad_glColor3uiv +typedef void (APIENTRYP PFNGLCOLOR3USPROC)(GLushort red, GLushort green, GLushort blue); +GLAPI PFNGLCOLOR3USPROC glad_glColor3us; +#define glColor3us glad_glColor3us +typedef void (APIENTRYP PFNGLCOLOR3USVPROC)(const GLushort *v); +GLAPI PFNGLCOLOR3USVPROC glad_glColor3usv; +#define glColor3usv glad_glColor3usv +typedef void (APIENTRYP PFNGLCOLOR4BPROC)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); +GLAPI PFNGLCOLOR4BPROC glad_glColor4b; +#define glColor4b glad_glColor4b +typedef void (APIENTRYP PFNGLCOLOR4BVPROC)(const GLbyte *v); +GLAPI PFNGLCOLOR4BVPROC glad_glColor4bv; +#define glColor4bv glad_glColor4bv +typedef void (APIENTRYP PFNGLCOLOR4DPROC)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); +GLAPI PFNGLCOLOR4DPROC glad_glColor4d; +#define glColor4d glad_glColor4d +typedef void (APIENTRYP PFNGLCOLOR4DVPROC)(const GLdouble *v); +GLAPI PFNGLCOLOR4DVPROC glad_glColor4dv; +#define glColor4dv glad_glColor4dv +typedef void (APIENTRYP PFNGLCOLOR4FPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI PFNGLCOLOR4FPROC glad_glColor4f; +#define glColor4f glad_glColor4f +typedef void (APIENTRYP PFNGLCOLOR4FVPROC)(const GLfloat *v); +GLAPI PFNGLCOLOR4FVPROC glad_glColor4fv; +#define glColor4fv glad_glColor4fv +typedef void (APIENTRYP PFNGLCOLOR4IPROC)(GLint red, GLint green, GLint blue, GLint alpha); +GLAPI PFNGLCOLOR4IPROC glad_glColor4i; +#define glColor4i glad_glColor4i +typedef void (APIENTRYP PFNGLCOLOR4IVPROC)(const GLint *v); +GLAPI PFNGLCOLOR4IVPROC glad_glColor4iv; +#define glColor4iv glad_glColor4iv +typedef void (APIENTRYP PFNGLCOLOR4SPROC)(GLshort red, GLshort green, GLshort blue, GLshort alpha); +GLAPI PFNGLCOLOR4SPROC glad_glColor4s; +#define glColor4s glad_glColor4s +typedef void (APIENTRYP PFNGLCOLOR4SVPROC)(const GLshort *v); +GLAPI PFNGLCOLOR4SVPROC glad_glColor4sv; +#define glColor4sv glad_glColor4sv +typedef void (APIENTRYP PFNGLCOLOR4UBPROC)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +GLAPI PFNGLCOLOR4UBPROC glad_glColor4ub; +#define glColor4ub glad_glColor4ub +typedef void (APIENTRYP PFNGLCOLOR4UBVPROC)(const GLubyte *v); +GLAPI PFNGLCOLOR4UBVPROC glad_glColor4ubv; +#define glColor4ubv glad_glColor4ubv +typedef void (APIENTRYP PFNGLCOLOR4UIPROC)(GLuint red, GLuint green, GLuint blue, GLuint alpha); +GLAPI PFNGLCOLOR4UIPROC glad_glColor4ui; +#define glColor4ui glad_glColor4ui +typedef void (APIENTRYP PFNGLCOLOR4UIVPROC)(const GLuint *v); +GLAPI PFNGLCOLOR4UIVPROC glad_glColor4uiv; +#define glColor4uiv glad_glColor4uiv +typedef void (APIENTRYP PFNGLCOLOR4USPROC)(GLushort red, GLushort green, GLushort blue, GLushort alpha); +GLAPI PFNGLCOLOR4USPROC glad_glColor4us; +#define glColor4us glad_glColor4us +typedef void (APIENTRYP PFNGLCOLOR4USVPROC)(const GLushort *v); +GLAPI PFNGLCOLOR4USVPROC glad_glColor4usv; +#define glColor4usv glad_glColor4usv +typedef void (APIENTRYP PFNGLEDGEFLAGPROC)(GLboolean flag); +GLAPI PFNGLEDGEFLAGPROC glad_glEdgeFlag; +#define glEdgeFlag glad_glEdgeFlag +typedef void (APIENTRYP PFNGLEDGEFLAGVPROC)(const GLboolean *flag); +GLAPI PFNGLEDGEFLAGVPROC glad_glEdgeFlagv; +#define glEdgeFlagv glad_glEdgeFlagv +typedef void (APIENTRYP PFNGLENDPROC)(); +GLAPI PFNGLENDPROC glad_glEnd; +#define glEnd glad_glEnd +typedef void (APIENTRYP PFNGLINDEXDPROC)(GLdouble c); +GLAPI PFNGLINDEXDPROC glad_glIndexd; +#define glIndexd glad_glIndexd +typedef void (APIENTRYP PFNGLINDEXDVPROC)(const GLdouble *c); +GLAPI PFNGLINDEXDVPROC glad_glIndexdv; +#define glIndexdv glad_glIndexdv +typedef void (APIENTRYP PFNGLINDEXFPROC)(GLfloat c); +GLAPI PFNGLINDEXFPROC glad_glIndexf; +#define glIndexf glad_glIndexf +typedef void (APIENTRYP PFNGLINDEXFVPROC)(const GLfloat *c); +GLAPI PFNGLINDEXFVPROC glad_glIndexfv; +#define glIndexfv glad_glIndexfv +typedef void (APIENTRYP PFNGLINDEXIPROC)(GLint c); +GLAPI PFNGLINDEXIPROC glad_glIndexi; +#define glIndexi glad_glIndexi +typedef void (APIENTRYP PFNGLINDEXIVPROC)(const GLint *c); +GLAPI PFNGLINDEXIVPROC glad_glIndexiv; +#define glIndexiv glad_glIndexiv +typedef void (APIENTRYP PFNGLINDEXSPROC)(GLshort c); +GLAPI PFNGLINDEXSPROC glad_glIndexs; +#define glIndexs glad_glIndexs +typedef void (APIENTRYP PFNGLINDEXSVPROC)(const GLshort *c); +GLAPI PFNGLINDEXSVPROC glad_glIndexsv; +#define glIndexsv glad_glIndexsv +typedef void (APIENTRYP PFNGLNORMAL3BPROC)(GLbyte nx, GLbyte ny, GLbyte nz); +GLAPI PFNGLNORMAL3BPROC glad_glNormal3b; +#define glNormal3b glad_glNormal3b +typedef void (APIENTRYP PFNGLNORMAL3BVPROC)(const GLbyte *v); +GLAPI PFNGLNORMAL3BVPROC glad_glNormal3bv; +#define glNormal3bv glad_glNormal3bv +typedef void (APIENTRYP PFNGLNORMAL3DPROC)(GLdouble nx, GLdouble ny, GLdouble nz); +GLAPI PFNGLNORMAL3DPROC glad_glNormal3d; +#define glNormal3d glad_glNormal3d +typedef void (APIENTRYP PFNGLNORMAL3DVPROC)(const GLdouble *v); +GLAPI PFNGLNORMAL3DVPROC glad_glNormal3dv; +#define glNormal3dv glad_glNormal3dv +typedef void (APIENTRYP PFNGLNORMAL3FPROC)(GLfloat nx, GLfloat ny, GLfloat nz); +GLAPI PFNGLNORMAL3FPROC glad_glNormal3f; +#define glNormal3f glad_glNormal3f +typedef void (APIENTRYP PFNGLNORMAL3FVPROC)(const GLfloat *v); +GLAPI PFNGLNORMAL3FVPROC glad_glNormal3fv; +#define glNormal3fv glad_glNormal3fv +typedef void (APIENTRYP PFNGLNORMAL3IPROC)(GLint nx, GLint ny, GLint nz); +GLAPI PFNGLNORMAL3IPROC glad_glNormal3i; +#define glNormal3i glad_glNormal3i +typedef void (APIENTRYP PFNGLNORMAL3IVPROC)(const GLint *v); +GLAPI PFNGLNORMAL3IVPROC glad_glNormal3iv; +#define glNormal3iv glad_glNormal3iv +typedef void (APIENTRYP PFNGLNORMAL3SPROC)(GLshort nx, GLshort ny, GLshort nz); +GLAPI PFNGLNORMAL3SPROC glad_glNormal3s; +#define glNormal3s glad_glNormal3s +typedef void (APIENTRYP PFNGLNORMAL3SVPROC)(const GLshort *v); +GLAPI PFNGLNORMAL3SVPROC glad_glNormal3sv; +#define glNormal3sv glad_glNormal3sv +typedef void (APIENTRYP PFNGLRASTERPOS2DPROC)(GLdouble x, GLdouble y); +GLAPI PFNGLRASTERPOS2DPROC glad_glRasterPos2d; +#define glRasterPos2d glad_glRasterPos2d +typedef void (APIENTRYP PFNGLRASTERPOS2DVPROC)(const GLdouble *v); +GLAPI PFNGLRASTERPOS2DVPROC glad_glRasterPos2dv; +#define glRasterPos2dv glad_glRasterPos2dv +typedef void (APIENTRYP PFNGLRASTERPOS2FPROC)(GLfloat x, GLfloat y); +GLAPI PFNGLRASTERPOS2FPROC glad_glRasterPos2f; +#define glRasterPos2f glad_glRasterPos2f +typedef void (APIENTRYP PFNGLRASTERPOS2FVPROC)(const GLfloat *v); +GLAPI PFNGLRASTERPOS2FVPROC glad_glRasterPos2fv; +#define glRasterPos2fv glad_glRasterPos2fv +typedef void (APIENTRYP PFNGLRASTERPOS2IPROC)(GLint x, GLint y); +GLAPI PFNGLRASTERPOS2IPROC glad_glRasterPos2i; +#define glRasterPos2i glad_glRasterPos2i +typedef void (APIENTRYP PFNGLRASTERPOS2IVPROC)(const GLint *v); +GLAPI PFNGLRASTERPOS2IVPROC glad_glRasterPos2iv; +#define glRasterPos2iv glad_glRasterPos2iv +typedef void (APIENTRYP PFNGLRASTERPOS2SPROC)(GLshort x, GLshort y); +GLAPI PFNGLRASTERPOS2SPROC glad_glRasterPos2s; +#define glRasterPos2s glad_glRasterPos2s +typedef void (APIENTRYP PFNGLRASTERPOS2SVPROC)(const GLshort *v); +GLAPI PFNGLRASTERPOS2SVPROC glad_glRasterPos2sv; +#define glRasterPos2sv glad_glRasterPos2sv +typedef void (APIENTRYP PFNGLRASTERPOS3DPROC)(GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLRASTERPOS3DPROC glad_glRasterPos3d; +#define glRasterPos3d glad_glRasterPos3d +typedef void (APIENTRYP PFNGLRASTERPOS3DVPROC)(const GLdouble *v); +GLAPI PFNGLRASTERPOS3DVPROC glad_glRasterPos3dv; +#define glRasterPos3dv glad_glRasterPos3dv +typedef void (APIENTRYP PFNGLRASTERPOS3FPROC)(GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLRASTERPOS3FPROC glad_glRasterPos3f; +#define glRasterPos3f glad_glRasterPos3f +typedef void (APIENTRYP PFNGLRASTERPOS3FVPROC)(const GLfloat *v); +GLAPI PFNGLRASTERPOS3FVPROC glad_glRasterPos3fv; +#define glRasterPos3fv glad_glRasterPos3fv +typedef void (APIENTRYP PFNGLRASTERPOS3IPROC)(GLint x, GLint y, GLint z); +GLAPI PFNGLRASTERPOS3IPROC glad_glRasterPos3i; +#define glRasterPos3i glad_glRasterPos3i +typedef void (APIENTRYP PFNGLRASTERPOS3IVPROC)(const GLint *v); +GLAPI PFNGLRASTERPOS3IVPROC glad_glRasterPos3iv; +#define glRasterPos3iv glad_glRasterPos3iv +typedef void (APIENTRYP PFNGLRASTERPOS3SPROC)(GLshort x, GLshort y, GLshort z); +GLAPI PFNGLRASTERPOS3SPROC glad_glRasterPos3s; +#define glRasterPos3s glad_glRasterPos3s +typedef void (APIENTRYP PFNGLRASTERPOS3SVPROC)(const GLshort *v); +GLAPI PFNGLRASTERPOS3SVPROC glad_glRasterPos3sv; +#define glRasterPos3sv glad_glRasterPos3sv +typedef void (APIENTRYP PFNGLRASTERPOS4DPROC)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLRASTERPOS4DPROC glad_glRasterPos4d; +#define glRasterPos4d glad_glRasterPos4d +typedef void (APIENTRYP PFNGLRASTERPOS4DVPROC)(const GLdouble *v); +GLAPI PFNGLRASTERPOS4DVPROC glad_glRasterPos4dv; +#define glRasterPos4dv glad_glRasterPos4dv +typedef void (APIENTRYP PFNGLRASTERPOS4FPROC)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI PFNGLRASTERPOS4FPROC glad_glRasterPos4f; +#define glRasterPos4f glad_glRasterPos4f +typedef void (APIENTRYP PFNGLRASTERPOS4FVPROC)(const GLfloat *v); +GLAPI PFNGLRASTERPOS4FVPROC glad_glRasterPos4fv; +#define glRasterPos4fv glad_glRasterPos4fv +typedef void (APIENTRYP PFNGLRASTERPOS4IPROC)(GLint x, GLint y, GLint z, GLint w); +GLAPI PFNGLRASTERPOS4IPROC glad_glRasterPos4i; +#define glRasterPos4i glad_glRasterPos4i +typedef void (APIENTRYP PFNGLRASTERPOS4IVPROC)(const GLint *v); +GLAPI PFNGLRASTERPOS4IVPROC glad_glRasterPos4iv; +#define glRasterPos4iv glad_glRasterPos4iv +typedef void (APIENTRYP PFNGLRASTERPOS4SPROC)(GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI PFNGLRASTERPOS4SPROC glad_glRasterPos4s; +#define glRasterPos4s glad_glRasterPos4s +typedef void (APIENTRYP PFNGLRASTERPOS4SVPROC)(const GLshort *v); +GLAPI PFNGLRASTERPOS4SVPROC glad_glRasterPos4sv; +#define glRasterPos4sv glad_glRasterPos4sv +typedef void (APIENTRYP PFNGLRECTDPROC)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); +GLAPI PFNGLRECTDPROC glad_glRectd; +#define glRectd glad_glRectd +typedef void (APIENTRYP PFNGLRECTDVPROC)(const GLdouble *v1, const GLdouble *v2); +GLAPI PFNGLRECTDVPROC glad_glRectdv; +#define glRectdv glad_glRectdv +typedef void (APIENTRYP PFNGLRECTFPROC)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); +GLAPI PFNGLRECTFPROC glad_glRectf; +#define glRectf glad_glRectf +typedef void (APIENTRYP PFNGLRECTFVPROC)(const GLfloat *v1, const GLfloat *v2); +GLAPI PFNGLRECTFVPROC glad_glRectfv; +#define glRectfv glad_glRectfv +typedef void (APIENTRYP PFNGLRECTIPROC)(GLint x1, GLint y1, GLint x2, GLint y2); +GLAPI PFNGLRECTIPROC glad_glRecti; +#define glRecti glad_glRecti +typedef void (APIENTRYP PFNGLRECTIVPROC)(const GLint *v1, const GLint *v2); +GLAPI PFNGLRECTIVPROC glad_glRectiv; +#define glRectiv glad_glRectiv +typedef void (APIENTRYP PFNGLRECTSPROC)(GLshort x1, GLshort y1, GLshort x2, GLshort y2); +GLAPI PFNGLRECTSPROC glad_glRects; +#define glRects glad_glRects +typedef void (APIENTRYP PFNGLRECTSVPROC)(const GLshort *v1, const GLshort *v2); +GLAPI PFNGLRECTSVPROC glad_glRectsv; +#define glRectsv glad_glRectsv +typedef void (APIENTRYP PFNGLTEXCOORD1DPROC)(GLdouble s); +GLAPI PFNGLTEXCOORD1DPROC glad_glTexCoord1d; +#define glTexCoord1d glad_glTexCoord1d +typedef void (APIENTRYP PFNGLTEXCOORD1DVPROC)(const GLdouble *v); +GLAPI PFNGLTEXCOORD1DVPROC glad_glTexCoord1dv; +#define glTexCoord1dv glad_glTexCoord1dv +typedef void (APIENTRYP PFNGLTEXCOORD1FPROC)(GLfloat s); +GLAPI PFNGLTEXCOORD1FPROC glad_glTexCoord1f; +#define glTexCoord1f glad_glTexCoord1f +typedef void (APIENTRYP PFNGLTEXCOORD1FVPROC)(const GLfloat *v); +GLAPI PFNGLTEXCOORD1FVPROC glad_glTexCoord1fv; +#define glTexCoord1fv glad_glTexCoord1fv +typedef void (APIENTRYP PFNGLTEXCOORD1IPROC)(GLint s); +GLAPI PFNGLTEXCOORD1IPROC glad_glTexCoord1i; +#define glTexCoord1i glad_glTexCoord1i +typedef void (APIENTRYP PFNGLTEXCOORD1IVPROC)(const GLint *v); +GLAPI PFNGLTEXCOORD1IVPROC glad_glTexCoord1iv; +#define glTexCoord1iv glad_glTexCoord1iv +typedef void (APIENTRYP PFNGLTEXCOORD1SPROC)(GLshort s); +GLAPI PFNGLTEXCOORD1SPROC glad_glTexCoord1s; +#define glTexCoord1s glad_glTexCoord1s +typedef void (APIENTRYP PFNGLTEXCOORD1SVPROC)(const GLshort *v); +GLAPI PFNGLTEXCOORD1SVPROC glad_glTexCoord1sv; +#define glTexCoord1sv glad_glTexCoord1sv +typedef void (APIENTRYP PFNGLTEXCOORD2DPROC)(GLdouble s, GLdouble t); +GLAPI PFNGLTEXCOORD2DPROC glad_glTexCoord2d; +#define glTexCoord2d glad_glTexCoord2d +typedef void (APIENTRYP PFNGLTEXCOORD2DVPROC)(const GLdouble *v); +GLAPI PFNGLTEXCOORD2DVPROC glad_glTexCoord2dv; +#define glTexCoord2dv glad_glTexCoord2dv +typedef void (APIENTRYP PFNGLTEXCOORD2FPROC)(GLfloat s, GLfloat t); +GLAPI PFNGLTEXCOORD2FPROC glad_glTexCoord2f; +#define glTexCoord2f glad_glTexCoord2f +typedef void (APIENTRYP PFNGLTEXCOORD2FVPROC)(const GLfloat *v); +GLAPI PFNGLTEXCOORD2FVPROC glad_glTexCoord2fv; +#define glTexCoord2fv glad_glTexCoord2fv +typedef void (APIENTRYP PFNGLTEXCOORD2IPROC)(GLint s, GLint t); +GLAPI PFNGLTEXCOORD2IPROC glad_glTexCoord2i; +#define glTexCoord2i glad_glTexCoord2i +typedef void (APIENTRYP PFNGLTEXCOORD2IVPROC)(const GLint *v); +GLAPI PFNGLTEXCOORD2IVPROC glad_glTexCoord2iv; +#define glTexCoord2iv glad_glTexCoord2iv +typedef void (APIENTRYP PFNGLTEXCOORD2SPROC)(GLshort s, GLshort t); +GLAPI PFNGLTEXCOORD2SPROC glad_glTexCoord2s; +#define glTexCoord2s glad_glTexCoord2s +typedef void (APIENTRYP PFNGLTEXCOORD2SVPROC)(const GLshort *v); +GLAPI PFNGLTEXCOORD2SVPROC glad_glTexCoord2sv; +#define glTexCoord2sv glad_glTexCoord2sv +typedef void (APIENTRYP PFNGLTEXCOORD3DPROC)(GLdouble s, GLdouble t, GLdouble r); +GLAPI PFNGLTEXCOORD3DPROC glad_glTexCoord3d; +#define glTexCoord3d glad_glTexCoord3d +typedef void (APIENTRYP PFNGLTEXCOORD3DVPROC)(const GLdouble *v); +GLAPI PFNGLTEXCOORD3DVPROC glad_glTexCoord3dv; +#define glTexCoord3dv glad_glTexCoord3dv +typedef void (APIENTRYP PFNGLTEXCOORD3FPROC)(GLfloat s, GLfloat t, GLfloat r); +GLAPI PFNGLTEXCOORD3FPROC glad_glTexCoord3f; +#define glTexCoord3f glad_glTexCoord3f +typedef void (APIENTRYP PFNGLTEXCOORD3FVPROC)(const GLfloat *v); +GLAPI PFNGLTEXCOORD3FVPROC glad_glTexCoord3fv; +#define glTexCoord3fv glad_glTexCoord3fv +typedef void (APIENTRYP PFNGLTEXCOORD3IPROC)(GLint s, GLint t, GLint r); +GLAPI PFNGLTEXCOORD3IPROC glad_glTexCoord3i; +#define glTexCoord3i glad_glTexCoord3i +typedef void (APIENTRYP PFNGLTEXCOORD3IVPROC)(const GLint *v); +GLAPI PFNGLTEXCOORD3IVPROC glad_glTexCoord3iv; +#define glTexCoord3iv glad_glTexCoord3iv +typedef void (APIENTRYP PFNGLTEXCOORD3SPROC)(GLshort s, GLshort t, GLshort r); +GLAPI PFNGLTEXCOORD3SPROC glad_glTexCoord3s; +#define glTexCoord3s glad_glTexCoord3s +typedef void (APIENTRYP PFNGLTEXCOORD3SVPROC)(const GLshort *v); +GLAPI PFNGLTEXCOORD3SVPROC glad_glTexCoord3sv; +#define glTexCoord3sv glad_glTexCoord3sv +typedef void (APIENTRYP PFNGLTEXCOORD4DPROC)(GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI PFNGLTEXCOORD4DPROC glad_glTexCoord4d; +#define glTexCoord4d glad_glTexCoord4d +typedef void (APIENTRYP PFNGLTEXCOORD4DVPROC)(const GLdouble *v); +GLAPI PFNGLTEXCOORD4DVPROC glad_glTexCoord4dv; +#define glTexCoord4dv glad_glTexCoord4dv +typedef void (APIENTRYP PFNGLTEXCOORD4FPROC)(GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI PFNGLTEXCOORD4FPROC glad_glTexCoord4f; +#define glTexCoord4f glad_glTexCoord4f +typedef void (APIENTRYP PFNGLTEXCOORD4FVPROC)(const GLfloat *v); +GLAPI PFNGLTEXCOORD4FVPROC glad_glTexCoord4fv; +#define glTexCoord4fv glad_glTexCoord4fv +typedef void (APIENTRYP PFNGLTEXCOORD4IPROC)(GLint s, GLint t, GLint r, GLint q); +GLAPI PFNGLTEXCOORD4IPROC glad_glTexCoord4i; +#define glTexCoord4i glad_glTexCoord4i +typedef void (APIENTRYP PFNGLTEXCOORD4IVPROC)(const GLint *v); +GLAPI PFNGLTEXCOORD4IVPROC glad_glTexCoord4iv; +#define glTexCoord4iv glad_glTexCoord4iv +typedef void (APIENTRYP PFNGLTEXCOORD4SPROC)(GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI PFNGLTEXCOORD4SPROC glad_glTexCoord4s; +#define glTexCoord4s glad_glTexCoord4s +typedef void (APIENTRYP PFNGLTEXCOORD4SVPROC)(const GLshort *v); +GLAPI PFNGLTEXCOORD4SVPROC glad_glTexCoord4sv; +#define glTexCoord4sv glad_glTexCoord4sv +typedef void (APIENTRYP PFNGLVERTEX2DPROC)(GLdouble x, GLdouble y); +GLAPI PFNGLVERTEX2DPROC glad_glVertex2d; +#define glVertex2d glad_glVertex2d +typedef void (APIENTRYP PFNGLVERTEX2DVPROC)(const GLdouble *v); +GLAPI PFNGLVERTEX2DVPROC glad_glVertex2dv; +#define glVertex2dv glad_glVertex2dv +typedef void (APIENTRYP PFNGLVERTEX2FPROC)(GLfloat x, GLfloat y); +GLAPI PFNGLVERTEX2FPROC glad_glVertex2f; +#define glVertex2f glad_glVertex2f +typedef void (APIENTRYP PFNGLVERTEX2FVPROC)(const GLfloat *v); +GLAPI PFNGLVERTEX2FVPROC glad_glVertex2fv; +#define glVertex2fv glad_glVertex2fv +typedef void (APIENTRYP PFNGLVERTEX2IPROC)(GLint x, GLint y); +GLAPI PFNGLVERTEX2IPROC glad_glVertex2i; +#define glVertex2i glad_glVertex2i +typedef void (APIENTRYP PFNGLVERTEX2IVPROC)(const GLint *v); +GLAPI PFNGLVERTEX2IVPROC glad_glVertex2iv; +#define glVertex2iv glad_glVertex2iv +typedef void (APIENTRYP PFNGLVERTEX2SPROC)(GLshort x, GLshort y); +GLAPI PFNGLVERTEX2SPROC glad_glVertex2s; +#define glVertex2s glad_glVertex2s +typedef void (APIENTRYP PFNGLVERTEX2SVPROC)(const GLshort *v); +GLAPI PFNGLVERTEX2SVPROC glad_glVertex2sv; +#define glVertex2sv glad_glVertex2sv +typedef void (APIENTRYP PFNGLVERTEX3DPROC)(GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLVERTEX3DPROC glad_glVertex3d; +#define glVertex3d glad_glVertex3d +typedef void (APIENTRYP PFNGLVERTEX3DVPROC)(const GLdouble *v); +GLAPI PFNGLVERTEX3DVPROC glad_glVertex3dv; +#define glVertex3dv glad_glVertex3dv +typedef void (APIENTRYP PFNGLVERTEX3FPROC)(GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLVERTEX3FPROC glad_glVertex3f; +#define glVertex3f glad_glVertex3f +typedef void (APIENTRYP PFNGLVERTEX3FVPROC)(const GLfloat *v); +GLAPI PFNGLVERTEX3FVPROC glad_glVertex3fv; +#define glVertex3fv glad_glVertex3fv +typedef void (APIENTRYP PFNGLVERTEX3IPROC)(GLint x, GLint y, GLint z); +GLAPI PFNGLVERTEX3IPROC glad_glVertex3i; +#define glVertex3i glad_glVertex3i +typedef void (APIENTRYP PFNGLVERTEX3IVPROC)(const GLint *v); +GLAPI PFNGLVERTEX3IVPROC glad_glVertex3iv; +#define glVertex3iv glad_glVertex3iv +typedef void (APIENTRYP PFNGLVERTEX3SPROC)(GLshort x, GLshort y, GLshort z); +GLAPI PFNGLVERTEX3SPROC glad_glVertex3s; +#define glVertex3s glad_glVertex3s +typedef void (APIENTRYP PFNGLVERTEX3SVPROC)(const GLshort *v); +GLAPI PFNGLVERTEX3SVPROC glad_glVertex3sv; +#define glVertex3sv glad_glVertex3sv +typedef void (APIENTRYP PFNGLVERTEX4DPROC)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLVERTEX4DPROC glad_glVertex4d; +#define glVertex4d glad_glVertex4d +typedef void (APIENTRYP PFNGLVERTEX4DVPROC)(const GLdouble *v); +GLAPI PFNGLVERTEX4DVPROC glad_glVertex4dv; +#define glVertex4dv glad_glVertex4dv +typedef void (APIENTRYP PFNGLVERTEX4FPROC)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI PFNGLVERTEX4FPROC glad_glVertex4f; +#define glVertex4f glad_glVertex4f +typedef void (APIENTRYP PFNGLVERTEX4FVPROC)(const GLfloat *v); +GLAPI PFNGLVERTEX4FVPROC glad_glVertex4fv; +#define glVertex4fv glad_glVertex4fv +typedef void (APIENTRYP PFNGLVERTEX4IPROC)(GLint x, GLint y, GLint z, GLint w); +GLAPI PFNGLVERTEX4IPROC glad_glVertex4i; +#define glVertex4i glad_glVertex4i +typedef void (APIENTRYP PFNGLVERTEX4IVPROC)(const GLint *v); +GLAPI PFNGLVERTEX4IVPROC glad_glVertex4iv; +#define glVertex4iv glad_glVertex4iv +typedef void (APIENTRYP PFNGLVERTEX4SPROC)(GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI PFNGLVERTEX4SPROC glad_glVertex4s; +#define glVertex4s glad_glVertex4s +typedef void (APIENTRYP PFNGLVERTEX4SVPROC)(const GLshort *v); +GLAPI PFNGLVERTEX4SVPROC glad_glVertex4sv; +#define glVertex4sv glad_glVertex4sv +typedef void (APIENTRYP PFNGLCLIPPLANEPROC)(GLenum plane, const GLdouble *equation); +GLAPI PFNGLCLIPPLANEPROC glad_glClipPlane; +#define glClipPlane glad_glClipPlane +typedef void (APIENTRYP PFNGLCOLORMATERIALPROC)(GLenum face, GLenum mode); +GLAPI PFNGLCOLORMATERIALPROC glad_glColorMaterial; +#define glColorMaterial glad_glColorMaterial +typedef void (APIENTRYP PFNGLFOGFPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLFOGFPROC glad_glFogf; +#define glFogf glad_glFogf +typedef void (APIENTRYP PFNGLFOGFVPROC)(GLenum pname, const GLfloat *params); +GLAPI PFNGLFOGFVPROC glad_glFogfv; +#define glFogfv glad_glFogfv +typedef void (APIENTRYP PFNGLFOGIPROC)(GLenum pname, GLint param); +GLAPI PFNGLFOGIPROC glad_glFogi; +#define glFogi glad_glFogi +typedef void (APIENTRYP PFNGLFOGIVPROC)(GLenum pname, const GLint *params); +GLAPI PFNGLFOGIVPROC glad_glFogiv; +#define glFogiv glad_glFogiv +typedef void (APIENTRYP PFNGLLIGHTFPROC)(GLenum light, GLenum pname, GLfloat param); +GLAPI PFNGLLIGHTFPROC glad_glLightf; +#define glLightf glad_glLightf +typedef void (APIENTRYP PFNGLLIGHTFVPROC)(GLenum light, GLenum pname, const GLfloat *params); +GLAPI PFNGLLIGHTFVPROC glad_glLightfv; +#define glLightfv glad_glLightfv +typedef void (APIENTRYP PFNGLLIGHTIPROC)(GLenum light, GLenum pname, GLint param); +GLAPI PFNGLLIGHTIPROC glad_glLighti; +#define glLighti glad_glLighti +typedef void (APIENTRYP PFNGLLIGHTIVPROC)(GLenum light, GLenum pname, const GLint *params); +GLAPI PFNGLLIGHTIVPROC glad_glLightiv; +#define glLightiv glad_glLightiv +typedef void (APIENTRYP PFNGLLIGHTMODELFPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLLIGHTMODELFPROC glad_glLightModelf; +#define glLightModelf glad_glLightModelf +typedef void (APIENTRYP PFNGLLIGHTMODELFVPROC)(GLenum pname, const GLfloat *params); +GLAPI PFNGLLIGHTMODELFVPROC glad_glLightModelfv; +#define glLightModelfv glad_glLightModelfv +typedef void (APIENTRYP PFNGLLIGHTMODELIPROC)(GLenum pname, GLint param); +GLAPI PFNGLLIGHTMODELIPROC glad_glLightModeli; +#define glLightModeli glad_glLightModeli +typedef void (APIENTRYP PFNGLLIGHTMODELIVPROC)(GLenum pname, const GLint *params); +GLAPI PFNGLLIGHTMODELIVPROC glad_glLightModeliv; +#define glLightModeliv glad_glLightModeliv +typedef void (APIENTRYP PFNGLLINESTIPPLEPROC)(GLint factor, GLushort pattern); +GLAPI PFNGLLINESTIPPLEPROC glad_glLineStipple; +#define glLineStipple glad_glLineStipple +typedef void (APIENTRYP PFNGLMATERIALFPROC)(GLenum face, GLenum pname, GLfloat param); +GLAPI PFNGLMATERIALFPROC glad_glMaterialf; +#define glMaterialf glad_glMaterialf +typedef void (APIENTRYP PFNGLMATERIALFVPROC)(GLenum face, GLenum pname, const GLfloat *params); +GLAPI PFNGLMATERIALFVPROC glad_glMaterialfv; +#define glMaterialfv glad_glMaterialfv +typedef void (APIENTRYP PFNGLMATERIALIPROC)(GLenum face, GLenum pname, GLint param); +GLAPI PFNGLMATERIALIPROC glad_glMateriali; +#define glMateriali glad_glMateriali +typedef void (APIENTRYP PFNGLMATERIALIVPROC)(GLenum face, GLenum pname, const GLint *params); +GLAPI PFNGLMATERIALIVPROC glad_glMaterialiv; +#define glMaterialiv glad_glMaterialiv +typedef void (APIENTRYP PFNGLPOLYGONSTIPPLEPROC)(const GLubyte *mask); +GLAPI PFNGLPOLYGONSTIPPLEPROC glad_glPolygonStipple; +#define glPolygonStipple glad_glPolygonStipple +typedef void (APIENTRYP PFNGLSHADEMODELPROC)(GLenum mode); +GLAPI PFNGLSHADEMODELPROC glad_glShadeModel; +#define glShadeModel glad_glShadeModel +typedef void (APIENTRYP PFNGLTEXENVFPROC)(GLenum target, GLenum pname, GLfloat param); +GLAPI PFNGLTEXENVFPROC glad_glTexEnvf; +#define glTexEnvf glad_glTexEnvf +typedef void (APIENTRYP PFNGLTEXENVFVPROC)(GLenum target, GLenum pname, const GLfloat *params); +GLAPI PFNGLTEXENVFVPROC glad_glTexEnvfv; +#define glTexEnvfv glad_glTexEnvfv +typedef void (APIENTRYP PFNGLTEXENVIPROC)(GLenum target, GLenum pname, GLint param); +GLAPI PFNGLTEXENVIPROC glad_glTexEnvi; +#define glTexEnvi glad_glTexEnvi +typedef void (APIENTRYP PFNGLTEXENVIVPROC)(GLenum target, GLenum pname, const GLint *params); +GLAPI PFNGLTEXENVIVPROC glad_glTexEnviv; +#define glTexEnviv glad_glTexEnviv +typedef void (APIENTRYP PFNGLTEXGENDPROC)(GLenum coord, GLenum pname, GLdouble param); +GLAPI PFNGLTEXGENDPROC glad_glTexGend; +#define glTexGend glad_glTexGend +typedef void (APIENTRYP PFNGLTEXGENDVPROC)(GLenum coord, GLenum pname, const GLdouble *params); +GLAPI PFNGLTEXGENDVPROC glad_glTexGendv; +#define glTexGendv glad_glTexGendv +typedef void (APIENTRYP PFNGLTEXGENFPROC)(GLenum coord, GLenum pname, GLfloat param); +GLAPI PFNGLTEXGENFPROC glad_glTexGenf; +#define glTexGenf glad_glTexGenf +typedef void (APIENTRYP PFNGLTEXGENFVPROC)(GLenum coord, GLenum pname, const GLfloat *params); +GLAPI PFNGLTEXGENFVPROC glad_glTexGenfv; +#define glTexGenfv glad_glTexGenfv +typedef void (APIENTRYP PFNGLTEXGENIPROC)(GLenum coord, GLenum pname, GLint param); +GLAPI PFNGLTEXGENIPROC glad_glTexGeni; +#define glTexGeni glad_glTexGeni +typedef void (APIENTRYP PFNGLTEXGENIVPROC)(GLenum coord, GLenum pname, const GLint *params); +GLAPI PFNGLTEXGENIVPROC glad_glTexGeniv; +#define glTexGeniv glad_glTexGeniv +typedef void (APIENTRYP PFNGLFEEDBACKBUFFERPROC)(GLsizei size, GLenum type, GLfloat *buffer); +GLAPI PFNGLFEEDBACKBUFFERPROC glad_glFeedbackBuffer; +#define glFeedbackBuffer glad_glFeedbackBuffer +typedef void (APIENTRYP PFNGLSELECTBUFFERPROC)(GLsizei size, GLuint *buffer); +GLAPI PFNGLSELECTBUFFERPROC glad_glSelectBuffer; +#define glSelectBuffer glad_glSelectBuffer +typedef GLint (APIENTRYP PFNGLRENDERMODEPROC)(GLenum mode); +GLAPI PFNGLRENDERMODEPROC glad_glRenderMode; +#define glRenderMode glad_glRenderMode +typedef void (APIENTRYP PFNGLINITNAMESPROC)(); +GLAPI PFNGLINITNAMESPROC glad_glInitNames; +#define glInitNames glad_glInitNames +typedef void (APIENTRYP PFNGLLOADNAMEPROC)(GLuint name); +GLAPI PFNGLLOADNAMEPROC glad_glLoadName; +#define glLoadName glad_glLoadName +typedef void (APIENTRYP PFNGLPASSTHROUGHPROC)(GLfloat token); +GLAPI PFNGLPASSTHROUGHPROC glad_glPassThrough; +#define glPassThrough glad_glPassThrough +typedef void (APIENTRYP PFNGLPOPNAMEPROC)(); +GLAPI PFNGLPOPNAMEPROC glad_glPopName; +#define glPopName glad_glPopName +typedef void (APIENTRYP PFNGLPUSHNAMEPROC)(GLuint name); +GLAPI PFNGLPUSHNAMEPROC glad_glPushName; +#define glPushName glad_glPushName +typedef void (APIENTRYP PFNGLCLEARACCUMPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI PFNGLCLEARACCUMPROC glad_glClearAccum; +#define glClearAccum glad_glClearAccum +typedef void (APIENTRYP PFNGLCLEARINDEXPROC)(GLfloat c); +GLAPI PFNGLCLEARINDEXPROC glad_glClearIndex; +#define glClearIndex glad_glClearIndex +typedef void (APIENTRYP PFNGLINDEXMASKPROC)(GLuint mask); +GLAPI PFNGLINDEXMASKPROC glad_glIndexMask; +#define glIndexMask glad_glIndexMask +typedef void (APIENTRYP PFNGLACCUMPROC)(GLenum op, GLfloat value); +GLAPI PFNGLACCUMPROC glad_glAccum; +#define glAccum glad_glAccum +typedef void (APIENTRYP PFNGLPOPATTRIBPROC)(); +GLAPI PFNGLPOPATTRIBPROC glad_glPopAttrib; +#define glPopAttrib glad_glPopAttrib +typedef void (APIENTRYP PFNGLPUSHATTRIBPROC)(GLbitfield mask); +GLAPI PFNGLPUSHATTRIBPROC glad_glPushAttrib; +#define glPushAttrib glad_glPushAttrib +typedef void (APIENTRYP PFNGLMAP1DPROC)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +GLAPI PFNGLMAP1DPROC glad_glMap1d; +#define glMap1d glad_glMap1d +typedef void (APIENTRYP PFNGLMAP1FPROC)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +GLAPI PFNGLMAP1FPROC glad_glMap1f; +#define glMap1f glad_glMap1f +typedef void (APIENTRYP PFNGLMAP2DPROC)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +GLAPI PFNGLMAP2DPROC glad_glMap2d; +#define glMap2d glad_glMap2d +typedef void (APIENTRYP PFNGLMAP2FPROC)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +GLAPI PFNGLMAP2FPROC glad_glMap2f; +#define glMap2f glad_glMap2f +typedef void (APIENTRYP PFNGLMAPGRID1DPROC)(GLint un, GLdouble u1, GLdouble u2); +GLAPI PFNGLMAPGRID1DPROC glad_glMapGrid1d; +#define glMapGrid1d glad_glMapGrid1d +typedef void (APIENTRYP PFNGLMAPGRID1FPROC)(GLint un, GLfloat u1, GLfloat u2); +GLAPI PFNGLMAPGRID1FPROC glad_glMapGrid1f; +#define glMapGrid1f glad_glMapGrid1f +typedef void (APIENTRYP PFNGLMAPGRID2DPROC)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); +GLAPI PFNGLMAPGRID2DPROC glad_glMapGrid2d; +#define glMapGrid2d glad_glMapGrid2d +typedef void (APIENTRYP PFNGLMAPGRID2FPROC)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); +GLAPI PFNGLMAPGRID2FPROC glad_glMapGrid2f; +#define glMapGrid2f glad_glMapGrid2f +typedef void (APIENTRYP PFNGLEVALCOORD1DPROC)(GLdouble u); +GLAPI PFNGLEVALCOORD1DPROC glad_glEvalCoord1d; +#define glEvalCoord1d glad_glEvalCoord1d +typedef void (APIENTRYP PFNGLEVALCOORD1DVPROC)(const GLdouble *u); +GLAPI PFNGLEVALCOORD1DVPROC glad_glEvalCoord1dv; +#define glEvalCoord1dv glad_glEvalCoord1dv +typedef void (APIENTRYP PFNGLEVALCOORD1FPROC)(GLfloat u); +GLAPI PFNGLEVALCOORD1FPROC glad_glEvalCoord1f; +#define glEvalCoord1f glad_glEvalCoord1f +typedef void (APIENTRYP PFNGLEVALCOORD1FVPROC)(const GLfloat *u); +GLAPI PFNGLEVALCOORD1FVPROC glad_glEvalCoord1fv; +#define glEvalCoord1fv glad_glEvalCoord1fv +typedef void (APIENTRYP PFNGLEVALCOORD2DPROC)(GLdouble u, GLdouble v); +GLAPI PFNGLEVALCOORD2DPROC glad_glEvalCoord2d; +#define glEvalCoord2d glad_glEvalCoord2d +typedef void (APIENTRYP PFNGLEVALCOORD2DVPROC)(const GLdouble *u); +GLAPI PFNGLEVALCOORD2DVPROC glad_glEvalCoord2dv; +#define glEvalCoord2dv glad_glEvalCoord2dv +typedef void (APIENTRYP PFNGLEVALCOORD2FPROC)(GLfloat u, GLfloat v); +GLAPI PFNGLEVALCOORD2FPROC glad_glEvalCoord2f; +#define glEvalCoord2f glad_glEvalCoord2f +typedef void (APIENTRYP PFNGLEVALCOORD2FVPROC)(const GLfloat *u); +GLAPI PFNGLEVALCOORD2FVPROC glad_glEvalCoord2fv; +#define glEvalCoord2fv glad_glEvalCoord2fv +typedef void (APIENTRYP PFNGLEVALMESH1PROC)(GLenum mode, GLint i1, GLint i2); +GLAPI PFNGLEVALMESH1PROC glad_glEvalMesh1; +#define glEvalMesh1 glad_glEvalMesh1 +typedef void (APIENTRYP PFNGLEVALPOINT1PROC)(GLint i); +GLAPI PFNGLEVALPOINT1PROC glad_glEvalPoint1; +#define glEvalPoint1 glad_glEvalPoint1 +typedef void (APIENTRYP PFNGLEVALMESH2PROC)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); +GLAPI PFNGLEVALMESH2PROC glad_glEvalMesh2; +#define glEvalMesh2 glad_glEvalMesh2 +typedef void (APIENTRYP PFNGLEVALPOINT2PROC)(GLint i, GLint j); +GLAPI PFNGLEVALPOINT2PROC glad_glEvalPoint2; +#define glEvalPoint2 glad_glEvalPoint2 +typedef void (APIENTRYP PFNGLALPHAFUNCPROC)(GLenum func, GLfloat ref); +GLAPI PFNGLALPHAFUNCPROC glad_glAlphaFunc; +#define glAlphaFunc glad_glAlphaFunc +typedef void (APIENTRYP PFNGLPIXELZOOMPROC)(GLfloat xfactor, GLfloat yfactor); +GLAPI PFNGLPIXELZOOMPROC glad_glPixelZoom; +#define glPixelZoom glad_glPixelZoom +typedef void (APIENTRYP PFNGLPIXELTRANSFERFPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLPIXELTRANSFERFPROC glad_glPixelTransferf; +#define glPixelTransferf glad_glPixelTransferf +typedef void (APIENTRYP PFNGLPIXELTRANSFERIPROC)(GLenum pname, GLint param); +GLAPI PFNGLPIXELTRANSFERIPROC glad_glPixelTransferi; +#define glPixelTransferi glad_glPixelTransferi +typedef void (APIENTRYP PFNGLPIXELMAPFVPROC)(GLenum map, GLsizei mapsize, const GLfloat *values); +GLAPI PFNGLPIXELMAPFVPROC glad_glPixelMapfv; +#define glPixelMapfv glad_glPixelMapfv +typedef void (APIENTRYP PFNGLPIXELMAPUIVPROC)(GLenum map, GLsizei mapsize, const GLuint *values); +GLAPI PFNGLPIXELMAPUIVPROC glad_glPixelMapuiv; +#define glPixelMapuiv glad_glPixelMapuiv +typedef void (APIENTRYP PFNGLPIXELMAPUSVPROC)(GLenum map, GLsizei mapsize, const GLushort *values); +GLAPI PFNGLPIXELMAPUSVPROC glad_glPixelMapusv; +#define glPixelMapusv glad_glPixelMapusv +typedef void (APIENTRYP PFNGLCOPYPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); +GLAPI PFNGLCOPYPIXELSPROC glad_glCopyPixels; +#define glCopyPixels glad_glCopyPixels +typedef void (APIENTRYP PFNGLDRAWPIXELSPROC)(GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLAPI PFNGLDRAWPIXELSPROC glad_glDrawPixels; +#define glDrawPixels glad_glDrawPixels +typedef void (APIENTRYP PFNGLGETCLIPPLANEPROC)(GLenum plane, GLdouble *equation); +GLAPI PFNGLGETCLIPPLANEPROC glad_glGetClipPlane; +#define glGetClipPlane glad_glGetClipPlane +typedef void (APIENTRYP PFNGLGETLIGHTFVPROC)(GLenum light, GLenum pname, GLfloat *params); +GLAPI PFNGLGETLIGHTFVPROC glad_glGetLightfv; +#define glGetLightfv glad_glGetLightfv +typedef void (APIENTRYP PFNGLGETLIGHTIVPROC)(GLenum light, GLenum pname, GLint *params); +GLAPI PFNGLGETLIGHTIVPROC glad_glGetLightiv; +#define glGetLightiv glad_glGetLightiv +typedef void (APIENTRYP PFNGLGETMAPDVPROC)(GLenum target, GLenum query, GLdouble *v); +GLAPI PFNGLGETMAPDVPROC glad_glGetMapdv; +#define glGetMapdv glad_glGetMapdv +typedef void (APIENTRYP PFNGLGETMAPFVPROC)(GLenum target, GLenum query, GLfloat *v); +GLAPI PFNGLGETMAPFVPROC glad_glGetMapfv; +#define glGetMapfv glad_glGetMapfv +typedef void (APIENTRYP PFNGLGETMAPIVPROC)(GLenum target, GLenum query, GLint *v); +GLAPI PFNGLGETMAPIVPROC glad_glGetMapiv; +#define glGetMapiv glad_glGetMapiv +typedef void (APIENTRYP PFNGLGETMATERIALFVPROC)(GLenum face, GLenum pname, GLfloat *params); +GLAPI PFNGLGETMATERIALFVPROC glad_glGetMaterialfv; +#define glGetMaterialfv glad_glGetMaterialfv +typedef void (APIENTRYP PFNGLGETMATERIALIVPROC)(GLenum face, GLenum pname, GLint *params); +GLAPI PFNGLGETMATERIALIVPROC glad_glGetMaterialiv; +#define glGetMaterialiv glad_glGetMaterialiv +typedef void (APIENTRYP PFNGLGETPIXELMAPFVPROC)(GLenum map, GLfloat *values); +GLAPI PFNGLGETPIXELMAPFVPROC glad_glGetPixelMapfv; +#define glGetPixelMapfv glad_glGetPixelMapfv +typedef void (APIENTRYP PFNGLGETPIXELMAPUIVPROC)(GLenum map, GLuint *values); +GLAPI PFNGLGETPIXELMAPUIVPROC glad_glGetPixelMapuiv; +#define glGetPixelMapuiv glad_glGetPixelMapuiv +typedef void (APIENTRYP PFNGLGETPIXELMAPUSVPROC)(GLenum map, GLushort *values); +GLAPI PFNGLGETPIXELMAPUSVPROC glad_glGetPixelMapusv; +#define glGetPixelMapusv glad_glGetPixelMapusv +typedef void (APIENTRYP PFNGLGETPOLYGONSTIPPLEPROC)(GLubyte *mask); +GLAPI PFNGLGETPOLYGONSTIPPLEPROC glad_glGetPolygonStipple; +#define glGetPolygonStipple glad_glGetPolygonStipple +typedef void (APIENTRYP PFNGLGETTEXENVFVPROC)(GLenum target, GLenum pname, GLfloat *params); +GLAPI PFNGLGETTEXENVFVPROC glad_glGetTexEnvfv; +#define glGetTexEnvfv glad_glGetTexEnvfv +typedef void (APIENTRYP PFNGLGETTEXENVIVPROC)(GLenum target, GLenum pname, GLint *params); +GLAPI PFNGLGETTEXENVIVPROC glad_glGetTexEnviv; +#define glGetTexEnviv glad_glGetTexEnviv +typedef void (APIENTRYP PFNGLGETTEXGENDVPROC)(GLenum coord, GLenum pname, GLdouble *params); +GLAPI PFNGLGETTEXGENDVPROC glad_glGetTexGendv; +#define glGetTexGendv glad_glGetTexGendv +typedef void (APIENTRYP PFNGLGETTEXGENFVPROC)(GLenum coord, GLenum pname, GLfloat *params); +GLAPI PFNGLGETTEXGENFVPROC glad_glGetTexGenfv; +#define glGetTexGenfv glad_glGetTexGenfv +typedef void (APIENTRYP PFNGLGETTEXGENIVPROC)(GLenum coord, GLenum pname, GLint *params); +GLAPI PFNGLGETTEXGENIVPROC glad_glGetTexGeniv; +#define glGetTexGeniv glad_glGetTexGeniv +typedef GLboolean (APIENTRYP PFNGLISLISTPROC)(GLuint list); +GLAPI PFNGLISLISTPROC glad_glIsList; +#define glIsList glad_glIsList +typedef void (APIENTRYP PFNGLFRUSTUMPROC)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI PFNGLFRUSTUMPROC glad_glFrustum; +#define glFrustum glad_glFrustum +typedef void (APIENTRYP PFNGLLOADIDENTITYPROC)(); +GLAPI PFNGLLOADIDENTITYPROC glad_glLoadIdentity; +#define glLoadIdentity glad_glLoadIdentity +typedef void (APIENTRYP PFNGLLOADMATRIXFPROC)(const GLfloat *m); +GLAPI PFNGLLOADMATRIXFPROC glad_glLoadMatrixf; +#define glLoadMatrixf glad_glLoadMatrixf +typedef void (APIENTRYP PFNGLLOADMATRIXDPROC)(const GLdouble *m); +GLAPI PFNGLLOADMATRIXDPROC glad_glLoadMatrixd; +#define glLoadMatrixd glad_glLoadMatrixd +typedef void (APIENTRYP PFNGLMATRIXMODEPROC)(GLenum mode); +GLAPI PFNGLMATRIXMODEPROC glad_glMatrixMode; +#define glMatrixMode glad_glMatrixMode +typedef void (APIENTRYP PFNGLMULTMATRIXFPROC)(const GLfloat *m); +GLAPI PFNGLMULTMATRIXFPROC glad_glMultMatrixf; +#define glMultMatrixf glad_glMultMatrixf +typedef void (APIENTRYP PFNGLMULTMATRIXDPROC)(const GLdouble *m); +GLAPI PFNGLMULTMATRIXDPROC glad_glMultMatrixd; +#define glMultMatrixd glad_glMultMatrixd +typedef void (APIENTRYP PFNGLORTHOPROC)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI PFNGLORTHOPROC glad_glOrtho; +#define glOrtho glad_glOrtho +typedef void (APIENTRYP PFNGLPOPMATRIXPROC)(); +GLAPI PFNGLPOPMATRIXPROC glad_glPopMatrix; +#define glPopMatrix glad_glPopMatrix +typedef void (APIENTRYP PFNGLPUSHMATRIXPROC)(); +GLAPI PFNGLPUSHMATRIXPROC glad_glPushMatrix; +#define glPushMatrix glad_glPushMatrix +typedef void (APIENTRYP PFNGLROTATEDPROC)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLROTATEDPROC glad_glRotated; +#define glRotated glad_glRotated +typedef void (APIENTRYP PFNGLROTATEFPROC)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLROTATEFPROC glad_glRotatef; +#define glRotatef glad_glRotatef +typedef void (APIENTRYP PFNGLSCALEDPROC)(GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLSCALEDPROC glad_glScaled; +#define glScaled glad_glScaled +typedef void (APIENTRYP PFNGLSCALEFPROC)(GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLSCALEFPROC glad_glScalef; +#define glScalef glad_glScalef +typedef void (APIENTRYP PFNGLTRANSLATEDPROC)(GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLTRANSLATEDPROC glad_glTranslated; +#define glTranslated glad_glTranslated +typedef void (APIENTRYP PFNGLTRANSLATEFPROC)(GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLTRANSLATEFPROC glad_glTranslatef; +#define glTranslatef glad_glTranslatef +#endif +#ifndef GL_VERSION_1_1 +#define GL_VERSION_1_1 1 +GLAPI int GLAD_GL_VERSION_1_1; +typedef void (APIENTRYP PFNGLDRAWARRAYSPROC)(GLenum mode, GLint first, GLsizei count); +GLAPI PFNGLDRAWARRAYSPROC glad_glDrawArrays; +#define glDrawArrays glad_glDrawArrays +typedef void (APIENTRYP PFNGLDRAWELEMENTSPROC)(GLenum mode, GLsizei count, GLenum type, const void *indices); +GLAPI PFNGLDRAWELEMENTSPROC glad_glDrawElements; +#define glDrawElements glad_glDrawElements +typedef void (APIENTRYP PFNGLGETPOINTERVPROC)(GLenum pname, void **params); +GLAPI PFNGLGETPOINTERVPROC glad_glGetPointerv; +#define glGetPointerv glad_glGetPointerv +typedef void (APIENTRYP PFNGLPOLYGONOFFSETPROC)(GLfloat factor, GLfloat units); +GLAPI PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset; +#define glPolygonOffset glad_glPolygonOffset +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D; +#define glCopyTexImage1D glad_glCopyTexImage1D +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D; +#define glCopyTexImage2D glad_glCopyTexImage2D +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D; +#define glCopyTexSubImage1D glad_glCopyTexSubImage1D +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D; +#define glCopyTexSubImage2D glad_glCopyTexSubImage2D +typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); +GLAPI PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D; +#define glTexSubImage1D glad_glTexSubImage1D +typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); +GLAPI PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D; +#define glTexSubImage2D glad_glTexSubImage2D +typedef void (APIENTRYP PFNGLBINDTEXTUREPROC)(GLenum target, GLuint texture); +GLAPI PFNGLBINDTEXTUREPROC glad_glBindTexture; +#define glBindTexture glad_glBindTexture +typedef void (APIENTRYP PFNGLDELETETEXTURESPROC)(GLsizei n, const GLuint *textures); +GLAPI PFNGLDELETETEXTURESPROC glad_glDeleteTextures; +#define glDeleteTextures glad_glDeleteTextures +typedef void (APIENTRYP PFNGLGENTEXTURESPROC)(GLsizei n, GLuint *textures); +GLAPI PFNGLGENTEXTURESPROC glad_glGenTextures; +#define glGenTextures glad_glGenTextures +typedef GLboolean (APIENTRYP PFNGLISTEXTUREPROC)(GLuint texture); +GLAPI PFNGLISTEXTUREPROC glad_glIsTexture; +#define glIsTexture glad_glIsTexture +typedef void (APIENTRYP PFNGLARRAYELEMENTPROC)(GLint i); +GLAPI PFNGLARRAYELEMENTPROC glad_glArrayElement; +#define glArrayElement glad_glArrayElement +typedef void (APIENTRYP PFNGLCOLORPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLCOLORPOINTERPROC glad_glColorPointer; +#define glColorPointer glad_glColorPointer +typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEPROC)(GLenum array); +GLAPI PFNGLDISABLECLIENTSTATEPROC glad_glDisableClientState; +#define glDisableClientState glad_glDisableClientState +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERPROC)(GLsizei stride, const void *pointer); +GLAPI PFNGLEDGEFLAGPOINTERPROC glad_glEdgeFlagPointer; +#define glEdgeFlagPointer glad_glEdgeFlagPointer +typedef void (APIENTRYP PFNGLENABLECLIENTSTATEPROC)(GLenum array); +GLAPI PFNGLENABLECLIENTSTATEPROC glad_glEnableClientState; +#define glEnableClientState glad_glEnableClientState +typedef void (APIENTRYP PFNGLINDEXPOINTERPROC)(GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLINDEXPOINTERPROC glad_glIndexPointer; +#define glIndexPointer glad_glIndexPointer +typedef void (APIENTRYP PFNGLINTERLEAVEDARRAYSPROC)(GLenum format, GLsizei stride, const void *pointer); +GLAPI PFNGLINTERLEAVEDARRAYSPROC glad_glInterleavedArrays; +#define glInterleavedArrays glad_glInterleavedArrays +typedef void (APIENTRYP PFNGLNORMALPOINTERPROC)(GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLNORMALPOINTERPROC glad_glNormalPointer; +#define glNormalPointer glad_glNormalPointer +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLTEXCOORDPOINTERPROC glad_glTexCoordPointer; +#define glTexCoordPointer glad_glTexCoordPointer +typedef void (APIENTRYP PFNGLVERTEXPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLVERTEXPOINTERPROC glad_glVertexPointer; +#define glVertexPointer glad_glVertexPointer +typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTPROC)(GLsizei n, const GLuint *textures, GLboolean *residences); +GLAPI PFNGLARETEXTURESRESIDENTPROC glad_glAreTexturesResident; +#define glAreTexturesResident glad_glAreTexturesResident +typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESPROC)(GLsizei n, const GLuint *textures, const GLfloat *priorities); +GLAPI PFNGLPRIORITIZETEXTURESPROC glad_glPrioritizeTextures; +#define glPrioritizeTextures glad_glPrioritizeTextures +typedef void (APIENTRYP PFNGLINDEXUBPROC)(GLubyte c); +GLAPI PFNGLINDEXUBPROC glad_glIndexub; +#define glIndexub glad_glIndexub +typedef void (APIENTRYP PFNGLINDEXUBVPROC)(const GLubyte *c); +GLAPI PFNGLINDEXUBVPROC glad_glIndexubv; +#define glIndexubv glad_glIndexubv +typedef void (APIENTRYP PFNGLPOPCLIENTATTRIBPROC)(); +GLAPI PFNGLPOPCLIENTATTRIBPROC glad_glPopClientAttrib; +#define glPopClientAttrib glad_glPopClientAttrib +typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBPROC)(GLbitfield mask); +GLAPI PFNGLPUSHCLIENTATTRIBPROC glad_glPushClientAttrib; +#define glPushClientAttrib glad_glPushClientAttrib +#endif +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 +GLAPI int GLAD_GL_VERSION_1_2; +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); +GLAPI PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements; +#define glDrawRangeElements glad_glDrawRangeElements +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); +GLAPI PFNGLTEXIMAGE3DPROC glad_glTexImage3D; +#define glTexImage3D glad_glTexImage3D +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); +GLAPI PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D; +#define glTexSubImage3D glad_glTexSubImage3D +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D; +#define glCopyTexSubImage3D glad_glCopyTexSubImage3D +#endif +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 +GLAPI int GLAD_GL_VERSION_1_3; +typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC)(GLenum texture); +GLAPI PFNGLACTIVETEXTUREPROC glad_glActiveTexture; +#define glActiveTexture glad_glActiveTexture +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC)(GLfloat value, GLboolean invert); +GLAPI PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage; +#define glSampleCoverage glad_glSampleCoverage +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); +GLAPI PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D; +#define glCompressedTexImage3D glad_glCompressedTexImage3D +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); +GLAPI PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D; +#define glCompressedTexImage2D glad_glCompressedTexImage2D +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); +GLAPI PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D; +#define glCompressedTexImage1D glad_glCompressedTexImage1D +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); +GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D; +#define glCompressedTexSubImage3D glad_glCompressedTexSubImage3D +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); +GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D; +#define glCompressedTexSubImage2D glad_glCompressedTexSubImage2D +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); +GLAPI PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D; +#define glCompressedTexSubImage1D glad_glCompressedTexSubImage1D +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC)(GLenum target, GLint level, void *img); +GLAPI PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage; +#define glGetCompressedTexImage glad_glGetCompressedTexImage +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC)(GLenum texture); +GLAPI PFNGLCLIENTACTIVETEXTUREPROC glad_glClientActiveTexture; +#define glClientActiveTexture glad_glClientActiveTexture +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC)(GLenum target, GLdouble s); +GLAPI PFNGLMULTITEXCOORD1DPROC glad_glMultiTexCoord1d; +#define glMultiTexCoord1d glad_glMultiTexCoord1d +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC)(GLenum target, const GLdouble *v); +GLAPI PFNGLMULTITEXCOORD1DVPROC glad_glMultiTexCoord1dv; +#define glMultiTexCoord1dv glad_glMultiTexCoord1dv +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC)(GLenum target, GLfloat s); +GLAPI PFNGLMULTITEXCOORD1FPROC glad_glMultiTexCoord1f; +#define glMultiTexCoord1f glad_glMultiTexCoord1f +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC)(GLenum target, const GLfloat *v); +GLAPI PFNGLMULTITEXCOORD1FVPROC glad_glMultiTexCoord1fv; +#define glMultiTexCoord1fv glad_glMultiTexCoord1fv +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC)(GLenum target, GLint s); +GLAPI PFNGLMULTITEXCOORD1IPROC glad_glMultiTexCoord1i; +#define glMultiTexCoord1i glad_glMultiTexCoord1i +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC)(GLenum target, const GLint *v); +GLAPI PFNGLMULTITEXCOORD1IVPROC glad_glMultiTexCoord1iv; +#define glMultiTexCoord1iv glad_glMultiTexCoord1iv +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC)(GLenum target, GLshort s); +GLAPI PFNGLMULTITEXCOORD1SPROC glad_glMultiTexCoord1s; +#define glMultiTexCoord1s glad_glMultiTexCoord1s +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC)(GLenum target, const GLshort *v); +GLAPI PFNGLMULTITEXCOORD1SVPROC glad_glMultiTexCoord1sv; +#define glMultiTexCoord1sv glad_glMultiTexCoord1sv +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC)(GLenum target, GLdouble s, GLdouble t); +GLAPI PFNGLMULTITEXCOORD2DPROC glad_glMultiTexCoord2d; +#define glMultiTexCoord2d glad_glMultiTexCoord2d +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC)(GLenum target, const GLdouble *v); +GLAPI PFNGLMULTITEXCOORD2DVPROC glad_glMultiTexCoord2dv; +#define glMultiTexCoord2dv glad_glMultiTexCoord2dv +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC)(GLenum target, GLfloat s, GLfloat t); +GLAPI PFNGLMULTITEXCOORD2FPROC glad_glMultiTexCoord2f; +#define glMultiTexCoord2f glad_glMultiTexCoord2f +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC)(GLenum target, const GLfloat *v); +GLAPI PFNGLMULTITEXCOORD2FVPROC glad_glMultiTexCoord2fv; +#define glMultiTexCoord2fv glad_glMultiTexCoord2fv +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC)(GLenum target, GLint s, GLint t); +GLAPI PFNGLMULTITEXCOORD2IPROC glad_glMultiTexCoord2i; +#define glMultiTexCoord2i glad_glMultiTexCoord2i +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC)(GLenum target, const GLint *v); +GLAPI PFNGLMULTITEXCOORD2IVPROC glad_glMultiTexCoord2iv; +#define glMultiTexCoord2iv glad_glMultiTexCoord2iv +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC)(GLenum target, GLshort s, GLshort t); +GLAPI PFNGLMULTITEXCOORD2SPROC glad_glMultiTexCoord2s; +#define glMultiTexCoord2s glad_glMultiTexCoord2s +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC)(GLenum target, const GLshort *v); +GLAPI PFNGLMULTITEXCOORD2SVPROC glad_glMultiTexCoord2sv; +#define glMultiTexCoord2sv glad_glMultiTexCoord2sv +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC)(GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI PFNGLMULTITEXCOORD3DPROC glad_glMultiTexCoord3d; +#define glMultiTexCoord3d glad_glMultiTexCoord3d +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC)(GLenum target, const GLdouble *v); +GLAPI PFNGLMULTITEXCOORD3DVPROC glad_glMultiTexCoord3dv; +#define glMultiTexCoord3dv glad_glMultiTexCoord3dv +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI PFNGLMULTITEXCOORD3FPROC glad_glMultiTexCoord3f; +#define glMultiTexCoord3f glad_glMultiTexCoord3f +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC)(GLenum target, const GLfloat *v); +GLAPI PFNGLMULTITEXCOORD3FVPROC glad_glMultiTexCoord3fv; +#define glMultiTexCoord3fv glad_glMultiTexCoord3fv +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC)(GLenum target, GLint s, GLint t, GLint r); +GLAPI PFNGLMULTITEXCOORD3IPROC glad_glMultiTexCoord3i; +#define glMultiTexCoord3i glad_glMultiTexCoord3i +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC)(GLenum target, const GLint *v); +GLAPI PFNGLMULTITEXCOORD3IVPROC glad_glMultiTexCoord3iv; +#define glMultiTexCoord3iv glad_glMultiTexCoord3iv +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC)(GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI PFNGLMULTITEXCOORD3SPROC glad_glMultiTexCoord3s; +#define glMultiTexCoord3s glad_glMultiTexCoord3s +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC)(GLenum target, const GLshort *v); +GLAPI PFNGLMULTITEXCOORD3SVPROC glad_glMultiTexCoord3sv; +#define glMultiTexCoord3sv glad_glMultiTexCoord3sv +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI PFNGLMULTITEXCOORD4DPROC glad_glMultiTexCoord4d; +#define glMultiTexCoord4d glad_glMultiTexCoord4d +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC)(GLenum target, const GLdouble *v); +GLAPI PFNGLMULTITEXCOORD4DVPROC glad_glMultiTexCoord4dv; +#define glMultiTexCoord4dv glad_glMultiTexCoord4dv +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI PFNGLMULTITEXCOORD4FPROC glad_glMultiTexCoord4f; +#define glMultiTexCoord4f glad_glMultiTexCoord4f +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC)(GLenum target, const GLfloat *v); +GLAPI PFNGLMULTITEXCOORD4FVPROC glad_glMultiTexCoord4fv; +#define glMultiTexCoord4fv glad_glMultiTexCoord4fv +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC)(GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI PFNGLMULTITEXCOORD4IPROC glad_glMultiTexCoord4i; +#define glMultiTexCoord4i glad_glMultiTexCoord4i +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC)(GLenum target, const GLint *v); +GLAPI PFNGLMULTITEXCOORD4IVPROC glad_glMultiTexCoord4iv; +#define glMultiTexCoord4iv glad_glMultiTexCoord4iv +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI PFNGLMULTITEXCOORD4SPROC glad_glMultiTexCoord4s; +#define glMultiTexCoord4s glad_glMultiTexCoord4s +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC)(GLenum target, const GLshort *v); +GLAPI PFNGLMULTITEXCOORD4SVPROC glad_glMultiTexCoord4sv; +#define glMultiTexCoord4sv glad_glMultiTexCoord4sv +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC)(const GLfloat *m); +GLAPI PFNGLLOADTRANSPOSEMATRIXFPROC glad_glLoadTransposeMatrixf; +#define glLoadTransposeMatrixf glad_glLoadTransposeMatrixf +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC)(const GLdouble *m); +GLAPI PFNGLLOADTRANSPOSEMATRIXDPROC glad_glLoadTransposeMatrixd; +#define glLoadTransposeMatrixd glad_glLoadTransposeMatrixd +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC)(const GLfloat *m); +GLAPI PFNGLMULTTRANSPOSEMATRIXFPROC glad_glMultTransposeMatrixf; +#define glMultTransposeMatrixf glad_glMultTransposeMatrixf +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC)(const GLdouble *m); +GLAPI PFNGLMULTTRANSPOSEMATRIXDPROC glad_glMultTransposeMatrixd; +#define glMultTransposeMatrixd glad_glMultTransposeMatrixd +#endif +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 +GLAPI int GLAD_GL_VERSION_1_4; +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +GLAPI PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate; +#define glBlendFuncSeparate glad_glBlendFuncSeparate +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC)(GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); +GLAPI PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays; +#define glMultiDrawArrays glad_glMultiDrawArrays +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC)(GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount); +GLAPI PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements; +#define glMultiDrawElements glad_glMultiDrawElements +typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC)(GLenum pname, GLfloat param); +GLAPI PFNGLPOINTPARAMETERFPROC glad_glPointParameterf; +#define glPointParameterf glad_glPointParameterf +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC)(GLenum pname, const GLfloat *params); +GLAPI PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv; +#define glPointParameterfv glad_glPointParameterfv +typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC)(GLenum pname, GLint param); +GLAPI PFNGLPOINTPARAMETERIPROC glad_glPointParameteri; +#define glPointParameteri glad_glPointParameteri +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC)(GLenum pname, const GLint *params); +GLAPI PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv; +#define glPointParameteriv glad_glPointParameteriv +typedef void (APIENTRYP PFNGLFOGCOORDFPROC)(GLfloat coord); +GLAPI PFNGLFOGCOORDFPROC glad_glFogCoordf; +#define glFogCoordf glad_glFogCoordf +typedef void (APIENTRYP PFNGLFOGCOORDFVPROC)(const GLfloat *coord); +GLAPI PFNGLFOGCOORDFVPROC glad_glFogCoordfv; +#define glFogCoordfv glad_glFogCoordfv +typedef void (APIENTRYP PFNGLFOGCOORDDPROC)(GLdouble coord); +GLAPI PFNGLFOGCOORDDPROC glad_glFogCoordd; +#define glFogCoordd glad_glFogCoordd +typedef void (APIENTRYP PFNGLFOGCOORDDVPROC)(const GLdouble *coord); +GLAPI PFNGLFOGCOORDDVPROC glad_glFogCoorddv; +#define glFogCoorddv glad_glFogCoorddv +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC)(GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLFOGCOORDPOINTERPROC glad_glFogCoordPointer; +#define glFogCoordPointer glad_glFogCoordPointer +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC)(GLbyte red, GLbyte green, GLbyte blue); +GLAPI PFNGLSECONDARYCOLOR3BPROC glad_glSecondaryColor3b; +#define glSecondaryColor3b glad_glSecondaryColor3b +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC)(const GLbyte *v); +GLAPI PFNGLSECONDARYCOLOR3BVPROC glad_glSecondaryColor3bv; +#define glSecondaryColor3bv glad_glSecondaryColor3bv +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC)(GLdouble red, GLdouble green, GLdouble blue); +GLAPI PFNGLSECONDARYCOLOR3DPROC glad_glSecondaryColor3d; +#define glSecondaryColor3d glad_glSecondaryColor3d +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC)(const GLdouble *v); +GLAPI PFNGLSECONDARYCOLOR3DVPROC glad_glSecondaryColor3dv; +#define glSecondaryColor3dv glad_glSecondaryColor3dv +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC)(GLfloat red, GLfloat green, GLfloat blue); +GLAPI PFNGLSECONDARYCOLOR3FPROC glad_glSecondaryColor3f; +#define glSecondaryColor3f glad_glSecondaryColor3f +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC)(const GLfloat *v); +GLAPI PFNGLSECONDARYCOLOR3FVPROC glad_glSecondaryColor3fv; +#define glSecondaryColor3fv glad_glSecondaryColor3fv +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC)(GLint red, GLint green, GLint blue); +GLAPI PFNGLSECONDARYCOLOR3IPROC glad_glSecondaryColor3i; +#define glSecondaryColor3i glad_glSecondaryColor3i +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC)(const GLint *v); +GLAPI PFNGLSECONDARYCOLOR3IVPROC glad_glSecondaryColor3iv; +#define glSecondaryColor3iv glad_glSecondaryColor3iv +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC)(GLshort red, GLshort green, GLshort blue); +GLAPI PFNGLSECONDARYCOLOR3SPROC glad_glSecondaryColor3s; +#define glSecondaryColor3s glad_glSecondaryColor3s +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC)(const GLshort *v); +GLAPI PFNGLSECONDARYCOLOR3SVPROC glad_glSecondaryColor3sv; +#define glSecondaryColor3sv glad_glSecondaryColor3sv +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC)(GLubyte red, GLubyte green, GLubyte blue); +GLAPI PFNGLSECONDARYCOLOR3UBPROC glad_glSecondaryColor3ub; +#define glSecondaryColor3ub glad_glSecondaryColor3ub +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC)(const GLubyte *v); +GLAPI PFNGLSECONDARYCOLOR3UBVPROC glad_glSecondaryColor3ubv; +#define glSecondaryColor3ubv glad_glSecondaryColor3ubv +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC)(GLuint red, GLuint green, GLuint blue); +GLAPI PFNGLSECONDARYCOLOR3UIPROC glad_glSecondaryColor3ui; +#define glSecondaryColor3ui glad_glSecondaryColor3ui +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC)(const GLuint *v); +GLAPI PFNGLSECONDARYCOLOR3UIVPROC glad_glSecondaryColor3uiv; +#define glSecondaryColor3uiv glad_glSecondaryColor3uiv +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC)(GLushort red, GLushort green, GLushort blue); +GLAPI PFNGLSECONDARYCOLOR3USPROC glad_glSecondaryColor3us; +#define glSecondaryColor3us glad_glSecondaryColor3us +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC)(const GLushort *v); +GLAPI PFNGLSECONDARYCOLOR3USVPROC glad_glSecondaryColor3usv; +#define glSecondaryColor3usv glad_glSecondaryColor3usv +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLSECONDARYCOLORPOINTERPROC glad_glSecondaryColorPointer; +#define glSecondaryColorPointer glad_glSecondaryColorPointer +typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC)(GLdouble x, GLdouble y); +GLAPI PFNGLWINDOWPOS2DPROC glad_glWindowPos2d; +#define glWindowPos2d glad_glWindowPos2d +typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC)(const GLdouble *v); +GLAPI PFNGLWINDOWPOS2DVPROC glad_glWindowPos2dv; +#define glWindowPos2dv glad_glWindowPos2dv +typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC)(GLfloat x, GLfloat y); +GLAPI PFNGLWINDOWPOS2FPROC glad_glWindowPos2f; +#define glWindowPos2f glad_glWindowPos2f +typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC)(const GLfloat *v); +GLAPI PFNGLWINDOWPOS2FVPROC glad_glWindowPos2fv; +#define glWindowPos2fv glad_glWindowPos2fv +typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC)(GLint x, GLint y); +GLAPI PFNGLWINDOWPOS2IPROC glad_glWindowPos2i; +#define glWindowPos2i glad_glWindowPos2i +typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC)(const GLint *v); +GLAPI PFNGLWINDOWPOS2IVPROC glad_glWindowPos2iv; +#define glWindowPos2iv glad_glWindowPos2iv +typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC)(GLshort x, GLshort y); +GLAPI PFNGLWINDOWPOS2SPROC glad_glWindowPos2s; +#define glWindowPos2s glad_glWindowPos2s +typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC)(const GLshort *v); +GLAPI PFNGLWINDOWPOS2SVPROC glad_glWindowPos2sv; +#define glWindowPos2sv glad_glWindowPos2sv +typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC)(GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLWINDOWPOS3DPROC glad_glWindowPos3d; +#define glWindowPos3d glad_glWindowPos3d +typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC)(const GLdouble *v); +GLAPI PFNGLWINDOWPOS3DVPROC glad_glWindowPos3dv; +#define glWindowPos3dv glad_glWindowPos3dv +typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC)(GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLWINDOWPOS3FPROC glad_glWindowPos3f; +#define glWindowPos3f glad_glWindowPos3f +typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC)(const GLfloat *v); +GLAPI PFNGLWINDOWPOS3FVPROC glad_glWindowPos3fv; +#define glWindowPos3fv glad_glWindowPos3fv +typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC)(GLint x, GLint y, GLint z); +GLAPI PFNGLWINDOWPOS3IPROC glad_glWindowPos3i; +#define glWindowPos3i glad_glWindowPos3i +typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC)(const GLint *v); +GLAPI PFNGLWINDOWPOS3IVPROC glad_glWindowPos3iv; +#define glWindowPos3iv glad_glWindowPos3iv +typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC)(GLshort x, GLshort y, GLshort z); +GLAPI PFNGLWINDOWPOS3SPROC glad_glWindowPos3s; +#define glWindowPos3s glad_glWindowPos3s +typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC)(const GLshort *v); +GLAPI PFNGLWINDOWPOS3SVPROC glad_glWindowPos3sv; +#define glWindowPos3sv glad_glWindowPos3sv +typedef void (APIENTRYP PFNGLBLENDCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI PFNGLBLENDCOLORPROC glad_glBlendColor; +#define glBlendColor glad_glBlendColor +typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC)(GLenum mode); +GLAPI PFNGLBLENDEQUATIONPROC glad_glBlendEquation; +#define glBlendEquation glad_glBlendEquation +#endif +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 +GLAPI int GLAD_GL_VERSION_1_5; +typedef void (APIENTRYP PFNGLGENQUERIESPROC)(GLsizei n, GLuint *ids); +GLAPI PFNGLGENQUERIESPROC glad_glGenQueries; +#define glGenQueries glad_glGenQueries +typedef void (APIENTRYP PFNGLDELETEQUERIESPROC)(GLsizei n, const GLuint *ids); +GLAPI PFNGLDELETEQUERIESPROC glad_glDeleteQueries; +#define glDeleteQueries glad_glDeleteQueries +typedef GLboolean (APIENTRYP PFNGLISQUERYPROC)(GLuint id); +GLAPI PFNGLISQUERYPROC glad_glIsQuery; +#define glIsQuery glad_glIsQuery +typedef void (APIENTRYP PFNGLBEGINQUERYPROC)(GLenum target, GLuint id); +GLAPI PFNGLBEGINQUERYPROC glad_glBeginQuery; +#define glBeginQuery glad_glBeginQuery +typedef void (APIENTRYP PFNGLENDQUERYPROC)(GLenum target); +GLAPI PFNGLENDQUERYPROC glad_glEndQuery; +#define glEndQuery glad_glEndQuery +typedef void (APIENTRYP PFNGLGETQUERYIVPROC)(GLenum target, GLenum pname, GLint *params); +GLAPI PFNGLGETQUERYIVPROC glad_glGetQueryiv; +#define glGetQueryiv glad_glGetQueryiv +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC)(GLuint id, GLenum pname, GLint *params); +GLAPI PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv; +#define glGetQueryObjectiv glad_glGetQueryObjectiv +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC)(GLuint id, GLenum pname, GLuint *params); +GLAPI PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv; +#define glGetQueryObjectuiv glad_glGetQueryObjectuiv +typedef void (APIENTRYP PFNGLBINDBUFFERPROC)(GLenum target, GLuint buffer); +GLAPI PFNGLBINDBUFFERPROC glad_glBindBuffer; +#define glBindBuffer glad_glBindBuffer +typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC)(GLsizei n, const GLuint *buffers); +GLAPI PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers; +#define glDeleteBuffers glad_glDeleteBuffers +typedef void (APIENTRYP PFNGLGENBUFFERSPROC)(GLsizei n, GLuint *buffers); +GLAPI PFNGLGENBUFFERSPROC glad_glGenBuffers; +#define glGenBuffers glad_glGenBuffers +typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC)(GLuint buffer); +GLAPI PFNGLISBUFFERPROC glad_glIsBuffer; +#define glIsBuffer glad_glIsBuffer +typedef void (APIENTRYP PFNGLBUFFERDATAPROC)(GLenum target, GLsizeiptr size, const void *data, GLenum usage); +GLAPI PFNGLBUFFERDATAPROC glad_glBufferData; +#define glBufferData glad_glBufferData +typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, const void *data); +GLAPI PFNGLBUFFERSUBDATAPROC glad_glBufferSubData; +#define glBufferSubData glad_glBufferSubData +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, void *data); +GLAPI PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData; +#define glGetBufferSubData glad_glGetBufferSubData +typedef void * (APIENTRYP PFNGLMAPBUFFERPROC)(GLenum target, GLenum access); +GLAPI PFNGLMAPBUFFERPROC glad_glMapBuffer; +#define glMapBuffer glad_glMapBuffer +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC)(GLenum target); +GLAPI PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer; +#define glUnmapBuffer glad_glUnmapBuffer +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint *params); +GLAPI PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv; +#define glGetBufferParameteriv glad_glGetBufferParameteriv +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC)(GLenum target, GLenum pname, void **params); +GLAPI PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv; +#define glGetBufferPointerv glad_glGetBufferPointerv +#endif +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 +GLAPI int GLAD_GL_VERSION_2_0; +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC)(GLenum modeRGB, GLenum modeAlpha); +GLAPI PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate; +#define glBlendEquationSeparate glad_glBlendEquationSeparate +typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC)(GLsizei n, const GLenum *bufs); +GLAPI PFNGLDRAWBUFFERSPROC glad_glDrawBuffers; +#define glDrawBuffers glad_glDrawBuffers +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +GLAPI PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate; +#define glStencilOpSeparate glad_glStencilOpSeparate +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC)(GLenum face, GLenum func, GLint ref, GLuint mask); +GLAPI PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate; +#define glStencilFuncSeparate glad_glStencilFuncSeparate +typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC)(GLenum face, GLuint mask); +GLAPI PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate; +#define glStencilMaskSeparate glad_glStencilMaskSeparate +typedef void (APIENTRYP PFNGLATTACHSHADERPROC)(GLuint program, GLuint shader); +GLAPI PFNGLATTACHSHADERPROC glad_glAttachShader; +#define glAttachShader glad_glAttachShader +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC)(GLuint program, GLuint index, const GLchar *name); +GLAPI PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation; +#define glBindAttribLocation glad_glBindAttribLocation +typedef void (APIENTRYP PFNGLCOMPILESHADERPROC)(GLuint shader); +GLAPI PFNGLCOMPILESHADERPROC glad_glCompileShader; +#define glCompileShader glad_glCompileShader +typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC)(); +GLAPI PFNGLCREATEPROGRAMPROC glad_glCreateProgram; +#define glCreateProgram glad_glCreateProgram +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC)(GLenum type); +GLAPI PFNGLCREATESHADERPROC glad_glCreateShader; +#define glCreateShader glad_glCreateShader +typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC)(GLuint program); +GLAPI PFNGLDELETEPROGRAMPROC glad_glDeleteProgram; +#define glDeleteProgram glad_glDeleteProgram +typedef void (APIENTRYP PFNGLDELETESHADERPROC)(GLuint shader); +GLAPI PFNGLDELETESHADERPROC glad_glDeleteShader; +#define glDeleteShader glad_glDeleteShader +typedef void (APIENTRYP PFNGLDETACHSHADERPROC)(GLuint program, GLuint shader); +GLAPI PFNGLDETACHSHADERPROC glad_glDetachShader; +#define glDetachShader glad_glDetachShader +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC)(GLuint index); +GLAPI PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray; +#define glDisableVertexAttribArray glad_glDisableVertexAttribArray +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC)(GLuint index); +GLAPI PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray; +#define glEnableVertexAttribArray glad_glEnableVertexAttribArray +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GLAPI PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib; +#define glGetActiveAttrib glad_glGetActiveAttrib +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GLAPI PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform; +#define glGetActiveUniform glad_glGetActiveUniform +typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC)(GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders); +GLAPI PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders; +#define glGetAttachedShaders glad_glGetAttachedShaders +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC)(GLuint program, const GLchar *name); +GLAPI PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation; +#define glGetAttribLocation glad_glGetAttribLocation +typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC)(GLuint program, GLenum pname, GLint *params); +GLAPI PFNGLGETPROGRAMIVPROC glad_glGetProgramiv; +#define glGetProgramiv glad_glGetProgramiv +typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC)(GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GLAPI PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog; +#define glGetProgramInfoLog glad_glGetProgramInfoLog +typedef void (APIENTRYP PFNGLGETSHADERIVPROC)(GLuint shader, GLenum pname, GLint *params); +GLAPI PFNGLGETSHADERIVPROC glad_glGetShaderiv; +#define glGetShaderiv glad_glGetShaderiv +typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GLAPI PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog; +#define glGetShaderInfoLog glad_glGetShaderInfoLog +typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC)(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +GLAPI PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource; +#define glGetShaderSource glad_glGetShaderSource +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC)(GLuint program, const GLchar *name); +GLAPI PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation; +#define glGetUniformLocation glad_glGetUniformLocation +typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC)(GLuint program, GLint location, GLfloat *params); +GLAPI PFNGLGETUNIFORMFVPROC glad_glGetUniformfv; +#define glGetUniformfv glad_glGetUniformfv +typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC)(GLuint program, GLint location, GLint *params); +GLAPI PFNGLGETUNIFORMIVPROC glad_glGetUniformiv; +#define glGetUniformiv glad_glGetUniformiv +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC)(GLuint index, GLenum pname, GLdouble *params); +GLAPI PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv; +#define glGetVertexAttribdv glad_glGetVertexAttribdv +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC)(GLuint index, GLenum pname, GLfloat *params); +GLAPI PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv; +#define glGetVertexAttribfv glad_glGetVertexAttribfv +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC)(GLuint index, GLenum pname, GLint *params); +GLAPI PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv; +#define glGetVertexAttribiv glad_glGetVertexAttribiv +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC)(GLuint index, GLenum pname, void **pointer); +GLAPI PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv; +#define glGetVertexAttribPointerv glad_glGetVertexAttribPointerv +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC)(GLuint program); +GLAPI PFNGLISPROGRAMPROC glad_glIsProgram; +#define glIsProgram glad_glIsProgram +typedef GLboolean (APIENTRYP PFNGLISSHADERPROC)(GLuint shader); +GLAPI PFNGLISSHADERPROC glad_glIsShader; +#define glIsShader glad_glIsShader +typedef void (APIENTRYP PFNGLLINKPROGRAMPROC)(GLuint program); +GLAPI PFNGLLINKPROGRAMPROC glad_glLinkProgram; +#define glLinkProgram glad_glLinkProgram +typedef void (APIENTRYP PFNGLSHADERSOURCEPROC)(GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length); +GLAPI PFNGLSHADERSOURCEPROC glad_glShaderSource; +#define glShaderSource glad_glShaderSource +typedef void (APIENTRYP PFNGLUSEPROGRAMPROC)(GLuint program); +GLAPI PFNGLUSEPROGRAMPROC glad_glUseProgram; +#define glUseProgram glad_glUseProgram +typedef void (APIENTRYP PFNGLUNIFORM1FPROC)(GLint location, GLfloat v0); +GLAPI PFNGLUNIFORM1FPROC glad_glUniform1f; +#define glUniform1f glad_glUniform1f +typedef void (APIENTRYP PFNGLUNIFORM2FPROC)(GLint location, GLfloat v0, GLfloat v1); +GLAPI PFNGLUNIFORM2FPROC glad_glUniform2f; +#define glUniform2f glad_glUniform2f +typedef void (APIENTRYP PFNGLUNIFORM3FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI PFNGLUNIFORM3FPROC glad_glUniform3f; +#define glUniform3f glad_glUniform3f +typedef void (APIENTRYP PFNGLUNIFORM4FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI PFNGLUNIFORM4FPROC glad_glUniform4f; +#define glUniform4f glad_glUniform4f +typedef void (APIENTRYP PFNGLUNIFORM1IPROC)(GLint location, GLint v0); +GLAPI PFNGLUNIFORM1IPROC glad_glUniform1i; +#define glUniform1i glad_glUniform1i +typedef void (APIENTRYP PFNGLUNIFORM2IPROC)(GLint location, GLint v0, GLint v1); +GLAPI PFNGLUNIFORM2IPROC glad_glUniform2i; +#define glUniform2i glad_glUniform2i +typedef void (APIENTRYP PFNGLUNIFORM3IPROC)(GLint location, GLint v0, GLint v1, GLint v2); +GLAPI PFNGLUNIFORM3IPROC glad_glUniform3i; +#define glUniform3i glad_glUniform3i +typedef void (APIENTRYP PFNGLUNIFORM4IPROC)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI PFNGLUNIFORM4IPROC glad_glUniform4i; +#define glUniform4i glad_glUniform4i +typedef void (APIENTRYP PFNGLUNIFORM1FVPROC)(GLint location, GLsizei count, const GLfloat *value); +GLAPI PFNGLUNIFORM1FVPROC glad_glUniform1fv; +#define glUniform1fv glad_glUniform1fv +typedef void (APIENTRYP PFNGLUNIFORM2FVPROC)(GLint location, GLsizei count, const GLfloat *value); +GLAPI PFNGLUNIFORM2FVPROC glad_glUniform2fv; +#define glUniform2fv glad_glUniform2fv +typedef void (APIENTRYP PFNGLUNIFORM3FVPROC)(GLint location, GLsizei count, const GLfloat *value); +GLAPI PFNGLUNIFORM3FVPROC glad_glUniform3fv; +#define glUniform3fv glad_glUniform3fv +typedef void (APIENTRYP PFNGLUNIFORM4FVPROC)(GLint location, GLsizei count, const GLfloat *value); +GLAPI PFNGLUNIFORM4FVPROC glad_glUniform4fv; +#define glUniform4fv glad_glUniform4fv +typedef void (APIENTRYP PFNGLUNIFORM1IVPROC)(GLint location, GLsizei count, const GLint *value); +GLAPI PFNGLUNIFORM1IVPROC glad_glUniform1iv; +#define glUniform1iv glad_glUniform1iv +typedef void (APIENTRYP PFNGLUNIFORM2IVPROC)(GLint location, GLsizei count, const GLint *value); +GLAPI PFNGLUNIFORM2IVPROC glad_glUniform2iv; +#define glUniform2iv glad_glUniform2iv +typedef void (APIENTRYP PFNGLUNIFORM3IVPROC)(GLint location, GLsizei count, const GLint *value); +GLAPI PFNGLUNIFORM3IVPROC glad_glUniform3iv; +#define glUniform3iv glad_glUniform3iv +typedef void (APIENTRYP PFNGLUNIFORM4IVPROC)(GLint location, GLsizei count, const GLint *value); +GLAPI PFNGLUNIFORM4IVPROC glad_glUniform4iv; +#define glUniform4iv glad_glUniform4iv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv; +#define glUniformMatrix2fv glad_glUniformMatrix2fv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv; +#define glUniformMatrix3fv glad_glUniformMatrix3fv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv; +#define glUniformMatrix4fv glad_glUniformMatrix4fv +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC)(GLuint program); +GLAPI PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram; +#define glValidateProgram glad_glValidateProgram +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC)(GLuint index, GLdouble x); +GLAPI PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d; +#define glVertexAttrib1d glad_glVertexAttrib1d +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC)(GLuint index, const GLdouble *v); +GLAPI PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv; +#define glVertexAttrib1dv glad_glVertexAttrib1dv +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC)(GLuint index, GLfloat x); +GLAPI PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f; +#define glVertexAttrib1f glad_glVertexAttrib1f +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC)(GLuint index, const GLfloat *v); +GLAPI PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv; +#define glVertexAttrib1fv glad_glVertexAttrib1fv +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC)(GLuint index, GLshort x); +GLAPI PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s; +#define glVertexAttrib1s glad_glVertexAttrib1s +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC)(GLuint index, const GLshort *v); +GLAPI PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv; +#define glVertexAttrib1sv glad_glVertexAttrib1sv +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC)(GLuint index, GLdouble x, GLdouble y); +GLAPI PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d; +#define glVertexAttrib2d glad_glVertexAttrib2d +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC)(GLuint index, const GLdouble *v); +GLAPI PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv; +#define glVertexAttrib2dv glad_glVertexAttrib2dv +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC)(GLuint index, GLfloat x, GLfloat y); +GLAPI PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f; +#define glVertexAttrib2f glad_glVertexAttrib2f +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC)(GLuint index, const GLfloat *v); +GLAPI PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv; +#define glVertexAttrib2fv glad_glVertexAttrib2fv +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC)(GLuint index, GLshort x, GLshort y); +GLAPI PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s; +#define glVertexAttrib2s glad_glVertexAttrib2s +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC)(GLuint index, const GLshort *v); +GLAPI PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv; +#define glVertexAttrib2sv glad_glVertexAttrib2sv +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d; +#define glVertexAttrib3d glad_glVertexAttrib3d +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC)(GLuint index, const GLdouble *v); +GLAPI PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv; +#define glVertexAttrib3dv glad_glVertexAttrib3dv +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f; +#define glVertexAttrib3f glad_glVertexAttrib3f +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC)(GLuint index, const GLfloat *v); +GLAPI PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv; +#define glVertexAttrib3fv glad_glVertexAttrib3fv +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC)(GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s; +#define glVertexAttrib3s glad_glVertexAttrib3s +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC)(GLuint index, const GLshort *v); +GLAPI PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv; +#define glVertexAttrib3sv glad_glVertexAttrib3sv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC)(GLuint index, const GLbyte *v); +GLAPI PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv; +#define glVertexAttrib4Nbv glad_glVertexAttrib4Nbv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC)(GLuint index, const GLint *v); +GLAPI PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv; +#define glVertexAttrib4Niv glad_glVertexAttrib4Niv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC)(GLuint index, const GLshort *v); +GLAPI PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv; +#define glVertexAttrib4Nsv glad_glVertexAttrib4Nsv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub; +#define glVertexAttrib4Nub glad_glVertexAttrib4Nub +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC)(GLuint index, const GLubyte *v); +GLAPI PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv; +#define glVertexAttrib4Nubv glad_glVertexAttrib4Nubv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC)(GLuint index, const GLuint *v); +GLAPI PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv; +#define glVertexAttrib4Nuiv glad_glVertexAttrib4Nuiv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC)(GLuint index, const GLushort *v); +GLAPI PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv; +#define glVertexAttrib4Nusv glad_glVertexAttrib4Nusv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC)(GLuint index, const GLbyte *v); +GLAPI PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv; +#define glVertexAttrib4bv glad_glVertexAttrib4bv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d; +#define glVertexAttrib4d glad_glVertexAttrib4d +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC)(GLuint index, const GLdouble *v); +GLAPI PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv; +#define glVertexAttrib4dv glad_glVertexAttrib4dv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f; +#define glVertexAttrib4f glad_glVertexAttrib4f +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC)(GLuint index, const GLfloat *v); +GLAPI PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv; +#define glVertexAttrib4fv glad_glVertexAttrib4fv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC)(GLuint index, const GLint *v); +GLAPI PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv; +#define glVertexAttrib4iv glad_glVertexAttrib4iv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s; +#define glVertexAttrib4s glad_glVertexAttrib4s +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC)(GLuint index, const GLshort *v); +GLAPI PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv; +#define glVertexAttrib4sv glad_glVertexAttrib4sv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC)(GLuint index, const GLubyte *v); +GLAPI PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv; +#define glVertexAttrib4ubv glad_glVertexAttrib4ubv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC)(GLuint index, const GLuint *v); +GLAPI PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv; +#define glVertexAttrib4uiv glad_glVertexAttrib4uiv +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC)(GLuint index, const GLushort *v); +GLAPI PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv; +#define glVertexAttrib4usv glad_glVertexAttrib4usv +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); +GLAPI PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer; +#define glVertexAttribPointer glad_glVertexAttribPointer +#endif +#ifndef GL_VERSION_2_1 +#define GL_VERSION_2_1 1 +GLAPI int GLAD_GL_VERSION_2_1; +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv; +#define glUniformMatrix2x3fv glad_glUniformMatrix2x3fv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv; +#define glUniformMatrix3x2fv glad_glUniformMatrix3x2fv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv; +#define glUniformMatrix2x4fv glad_glUniformMatrix2x4fv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv; +#define glUniformMatrix4x2fv glad_glUniformMatrix4x2fv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv; +#define glUniformMatrix3x4fv glad_glUniformMatrix3x4fv +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv; +#define glUniformMatrix4x3fv glad_glUniformMatrix4x3fv +#endif +#ifndef GL_VERSION_3_0 +#define GL_VERSION_3_0 1 +GLAPI int GLAD_GL_VERSION_3_0; +typedef void (APIENTRYP PFNGLCOLORMASKIPROC)(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +GLAPI PFNGLCOLORMASKIPROC glad_glColorMaski; +#define glColorMaski glad_glColorMaski +typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC)(GLenum target, GLuint index, GLboolean *data); +GLAPI PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v; +#define glGetBooleani_v glad_glGetBooleani_v +typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC)(GLenum target, GLuint index, GLint *data); +GLAPI PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v; +#define glGetIntegeri_v glad_glGetIntegeri_v +typedef void (APIENTRYP PFNGLENABLEIPROC)(GLenum target, GLuint index); +GLAPI PFNGLENABLEIPROC glad_glEnablei; +#define glEnablei glad_glEnablei +typedef void (APIENTRYP PFNGLDISABLEIPROC)(GLenum target, GLuint index); +GLAPI PFNGLDISABLEIPROC glad_glDisablei; +#define glDisablei glad_glDisablei +typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC)(GLenum target, GLuint index); +GLAPI PFNGLISENABLEDIPROC glad_glIsEnabledi; +#define glIsEnabledi glad_glIsEnabledi +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC)(GLenum primitiveMode); +GLAPI PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback; +#define glBeginTransformFeedback glad_glBeginTransformFeedback +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC)(); +GLAPI PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback; +#define glEndTransformFeedback glad_glEndTransformFeedback +typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange; +#define glBindBufferRange glad_glBindBufferRange +typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC)(GLenum target, GLuint index, GLuint buffer); +GLAPI PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase; +#define glBindBufferBase glad_glBindBufferBase +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC)(GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode); +GLAPI PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings; +#define glTransformFeedbackVaryings glad_glTransformFeedbackVaryings +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +GLAPI PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying; +#define glGetTransformFeedbackVarying glad_glGetTransformFeedbackVarying +typedef void (APIENTRYP PFNGLCLAMPCOLORPROC)(GLenum target, GLenum clamp); +GLAPI PFNGLCLAMPCOLORPROC glad_glClampColor; +#define glClampColor glad_glClampColor +typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC)(GLuint id, GLenum mode); +GLAPI PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender; +#define glBeginConditionalRender glad_glBeginConditionalRender +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC)(); +GLAPI PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender; +#define glEndConditionalRender glad_glEndConditionalRender +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC)(GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); +GLAPI PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer; +#define glVertexAttribIPointer glad_glVertexAttribIPointer +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC)(GLuint index, GLenum pname, GLint *params); +GLAPI PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv; +#define glGetVertexAttribIiv glad_glGetVertexAttribIiv +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC)(GLuint index, GLenum pname, GLuint *params); +GLAPI PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv; +#define glGetVertexAttribIuiv glad_glGetVertexAttribIuiv +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC)(GLuint index, GLint x); +GLAPI PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i; +#define glVertexAttribI1i glad_glVertexAttribI1i +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC)(GLuint index, GLint x, GLint y); +GLAPI PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i; +#define glVertexAttribI2i glad_glVertexAttribI2i +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC)(GLuint index, GLint x, GLint y, GLint z); +GLAPI PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i; +#define glVertexAttribI3i glad_glVertexAttribI3i +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC)(GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i; +#define glVertexAttribI4i glad_glVertexAttribI4i +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC)(GLuint index, GLuint x); +GLAPI PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui; +#define glVertexAttribI1ui glad_glVertexAttribI1ui +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC)(GLuint index, GLuint x, GLuint y); +GLAPI PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui; +#define glVertexAttribI2ui glad_glVertexAttribI2ui +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC)(GLuint index, GLuint x, GLuint y, GLuint z); +GLAPI PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui; +#define glVertexAttribI3ui glad_glVertexAttribI3ui +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui; +#define glVertexAttribI4ui glad_glVertexAttribI4ui +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC)(GLuint index, const GLint *v); +GLAPI PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv; +#define glVertexAttribI1iv glad_glVertexAttribI1iv +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC)(GLuint index, const GLint *v); +GLAPI PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv; +#define glVertexAttribI2iv glad_glVertexAttribI2iv +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC)(GLuint index, const GLint *v); +GLAPI PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv; +#define glVertexAttribI3iv glad_glVertexAttribI3iv +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC)(GLuint index, const GLint *v); +GLAPI PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv; +#define glVertexAttribI4iv glad_glVertexAttribI4iv +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC)(GLuint index, const GLuint *v); +GLAPI PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv; +#define glVertexAttribI1uiv glad_glVertexAttribI1uiv +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC)(GLuint index, const GLuint *v); +GLAPI PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv; +#define glVertexAttribI2uiv glad_glVertexAttribI2uiv +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC)(GLuint index, const GLuint *v); +GLAPI PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv; +#define glVertexAttribI3uiv glad_glVertexAttribI3uiv +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC)(GLuint index, const GLuint *v); +GLAPI PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv; +#define glVertexAttribI4uiv glad_glVertexAttribI4uiv +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC)(GLuint index, const GLbyte *v); +GLAPI PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv; +#define glVertexAttribI4bv glad_glVertexAttribI4bv +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC)(GLuint index, const GLshort *v); +GLAPI PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv; +#define glVertexAttribI4sv glad_glVertexAttribI4sv +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC)(GLuint index, const GLubyte *v); +GLAPI PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv; +#define glVertexAttribI4ubv glad_glVertexAttribI4ubv +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC)(GLuint index, const GLushort *v); +GLAPI PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv; +#define glVertexAttribI4usv glad_glVertexAttribI4usv +typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC)(GLuint program, GLint location, GLuint *params); +GLAPI PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv; +#define glGetUniformuiv glad_glGetUniformuiv +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC)(GLuint program, GLuint color, const GLchar *name); +GLAPI PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation; +#define glBindFragDataLocation glad_glBindFragDataLocation +typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC)(GLuint program, const GLchar *name); +GLAPI PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation; +#define glGetFragDataLocation glad_glGetFragDataLocation +typedef void (APIENTRYP PFNGLUNIFORM1UIPROC)(GLint location, GLuint v0); +GLAPI PFNGLUNIFORM1UIPROC glad_glUniform1ui; +#define glUniform1ui glad_glUniform1ui +typedef void (APIENTRYP PFNGLUNIFORM2UIPROC)(GLint location, GLuint v0, GLuint v1); +GLAPI PFNGLUNIFORM2UIPROC glad_glUniform2ui; +#define glUniform2ui glad_glUniform2ui +typedef void (APIENTRYP PFNGLUNIFORM3UIPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI PFNGLUNIFORM3UIPROC glad_glUniform3ui; +#define glUniform3ui glad_glUniform3ui +typedef void (APIENTRYP PFNGLUNIFORM4UIPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI PFNGLUNIFORM4UIPROC glad_glUniform4ui; +#define glUniform4ui glad_glUniform4ui +typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC)(GLint location, GLsizei count, const GLuint *value); +GLAPI PFNGLUNIFORM1UIVPROC glad_glUniform1uiv; +#define glUniform1uiv glad_glUniform1uiv +typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC)(GLint location, GLsizei count, const GLuint *value); +GLAPI PFNGLUNIFORM2UIVPROC glad_glUniform2uiv; +#define glUniform2uiv glad_glUniform2uiv +typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC)(GLint location, GLsizei count, const GLuint *value); +GLAPI PFNGLUNIFORM3UIVPROC glad_glUniform3uiv; +#define glUniform3uiv glad_glUniform3uiv +typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC)(GLint location, GLsizei count, const GLuint *value); +GLAPI PFNGLUNIFORM4UIVPROC glad_glUniform4uiv; +#define glUniform4uiv glad_glUniform4uiv +typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC)(GLenum target, GLenum pname, const GLint *params); +GLAPI PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv; +#define glTexParameterIiv glad_glTexParameterIiv +typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC)(GLenum target, GLenum pname, const GLuint *params); +GLAPI PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv; +#define glTexParameterIuiv glad_glTexParameterIuiv +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC)(GLenum target, GLenum pname, GLint *params); +GLAPI PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv; +#define glGetTexParameterIiv glad_glGetTexParameterIiv +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC)(GLenum target, GLenum pname, GLuint *params); +GLAPI PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv; +#define glGetTexParameterIuiv glad_glGetTexParameterIuiv +typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC)(GLenum buffer, GLint drawbuffer, const GLint *value); +GLAPI PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv; +#define glClearBufferiv glad_glClearBufferiv +typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC)(GLenum buffer, GLint drawbuffer, const GLuint *value); +GLAPI PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv; +#define glClearBufferuiv glad_glClearBufferuiv +typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC)(GLenum buffer, GLint drawbuffer, const GLfloat *value); +GLAPI PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv; +#define glClearBufferfv glad_glClearBufferfv +typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +GLAPI PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi; +#define glClearBufferfi glad_glClearBufferfi +typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC)(GLenum name, GLuint index); +GLAPI PFNGLGETSTRINGIPROC glad_glGetStringi; +#define glGetStringi glad_glGetStringi +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC)(GLuint renderbuffer); +GLAPI PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer; +#define glIsRenderbuffer glad_glIsRenderbuffer +typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC)(GLenum target, GLuint renderbuffer); +GLAPI PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer; +#define glBindRenderbuffer glad_glBindRenderbuffer +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC)(GLsizei n, const GLuint *renderbuffers); +GLAPI PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers; +#define glDeleteRenderbuffers glad_glDeleteRenderbuffers +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC)(GLsizei n, GLuint *renderbuffers); +GLAPI PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers; +#define glGenRenderbuffers glad_glGenRenderbuffers +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage; +#define glRenderbufferStorage glad_glRenderbufferStorage +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint *params); +GLAPI PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv; +#define glGetRenderbufferParameteriv glad_glGetRenderbufferParameteriv +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC)(GLuint framebuffer); +GLAPI PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer; +#define glIsFramebuffer glad_glIsFramebuffer +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC)(GLenum target, GLuint framebuffer); +GLAPI PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer; +#define glBindFramebuffer glad_glBindFramebuffer +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC)(GLsizei n, const GLuint *framebuffers); +GLAPI PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers; +#define glDeleteFramebuffers glad_glDeleteFramebuffers +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC)(GLsizei n, GLuint *framebuffers); +GLAPI PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers; +#define glGenFramebuffers glad_glGenFramebuffers +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC)(GLenum target); +GLAPI PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus; +#define glCheckFramebufferStatus glad_glCheckFramebufferStatus +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D; +#define glFramebufferTexture1D glad_glFramebufferTexture1D +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D; +#define glFramebufferTexture2D glad_glFramebufferTexture2D +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D; +#define glFramebufferTexture3D glad_glFramebufferTexture3D +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer; +#define glFramebufferRenderbuffer glad_glFramebufferRenderbuffer +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLenum target, GLenum attachment, GLenum pname, GLint *params); +GLAPI PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv; +#define glGetFramebufferAttachmentParameteriv glad_glGetFramebufferAttachmentParameteriv +typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC)(GLenum target); +GLAPI PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap; +#define glGenerateMipmap glad_glGenerateMipmap +typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +GLAPI PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer; +#define glBlitFramebuffer glad_glBlitFramebuffer +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample; +#define glRenderbufferStorageMultisample glad_glRenderbufferStorageMultisample +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer; +#define glFramebufferTextureLayer glad_glFramebufferTextureLayer +typedef void * (APIENTRYP PFNGLMAPBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +GLAPI PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange; +#define glMapBufferRange glad_glMapBufferRange +typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length); +GLAPI PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange; +#define glFlushMappedBufferRange glad_glFlushMappedBufferRange +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC)(GLuint array); +GLAPI PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray; +#define glBindVertexArray glad_glBindVertexArray +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC)(GLsizei n, const GLuint *arrays); +GLAPI PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays; +#define glDeleteVertexArrays glad_glDeleteVertexArrays +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC)(GLsizei n, GLuint *arrays); +GLAPI PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays; +#define glGenVertexArrays glad_glGenVertexArrays +typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC)(GLuint array); +GLAPI PFNGLISVERTEXARRAYPROC glad_glIsVertexArray; +#define glIsVertexArray glad_glIsVertexArray +#endif +#ifndef GL_VERSION_3_1 +#define GL_VERSION_3_1 1 +GLAPI int GLAD_GL_VERSION_3_1; +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount); +GLAPI PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced; +#define glDrawArraysInstanced glad_glDrawArraysInstanced +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC)(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount); +GLAPI PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced; +#define glDrawElementsInstanced glad_glDrawElementsInstanced +typedef void (APIENTRYP PFNGLTEXBUFFERPROC)(GLenum target, GLenum internalformat, GLuint buffer); +GLAPI PFNGLTEXBUFFERPROC glad_glTexBuffer; +#define glTexBuffer glad_glTexBuffer +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC)(GLuint index); +GLAPI PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex; +#define glPrimitiveRestartIndex glad_glPrimitiveRestartIndex +typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +GLAPI PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData; +#define glCopyBufferSubData glad_glCopyBufferSubData +typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC)(GLuint program, GLsizei uniformCount, const GLchar *const*uniformNames, GLuint *uniformIndices); +GLAPI PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices; +#define glGetUniformIndices glad_glGetUniformIndices +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC)(GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); +GLAPI PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv; +#define glGetActiveUniformsiv glad_glGetActiveUniformsiv +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC)(GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); +GLAPI PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName; +#define glGetActiveUniformName glad_glGetActiveUniformName +typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC)(GLuint program, const GLchar *uniformBlockName); +GLAPI PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex; +#define glGetUniformBlockIndex glad_glGetUniformBlockIndex +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC)(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); +GLAPI PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv; +#define glGetActiveUniformBlockiv glad_glGetActiveUniformBlockiv +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); +GLAPI PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName; +#define glGetActiveUniformBlockName glad_glGetActiveUniformBlockName +typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); +GLAPI PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding; +#define glUniformBlockBinding glad_glUniformBlockBinding +#endif +#ifndef GL_VERSION_3_2 +#define GL_VERSION_3_2 1 +GLAPI int GLAD_GL_VERSION_3_2; +typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC)(GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); +GLAPI PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex; +#define glDrawElementsBaseVertex glad_glDrawElementsBaseVertex +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); +GLAPI PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex; +#define glDrawRangeElementsBaseVertex glad_glDrawRangeElementsBaseVertex +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex); +GLAPI PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex; +#define glDrawElementsInstancedBaseVertex glad_glDrawElementsInstancedBaseVertex +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)(GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei drawcount, const GLint *basevertex); +GLAPI PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex; +#define glMultiDrawElementsBaseVertex glad_glMultiDrawElementsBaseVertex +typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC)(GLenum mode); +GLAPI PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex; +#define glProvokingVertex glad_glProvokingVertex +typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC)(GLenum condition, GLbitfield flags); +GLAPI PFNGLFENCESYNCPROC glad_glFenceSync; +#define glFenceSync glad_glFenceSync +typedef GLboolean (APIENTRYP PFNGLISSYNCPROC)(GLsync sync); +GLAPI PFNGLISSYNCPROC glad_glIsSync; +#define glIsSync glad_glIsSync +typedef void (APIENTRYP PFNGLDELETESYNCPROC)(GLsync sync); +GLAPI PFNGLDELETESYNCPROC glad_glDeleteSync; +#define glDeleteSync glad_glDeleteSync +typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout); +GLAPI PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync; +#define glClientWaitSync glad_glClientWaitSync +typedef void (APIENTRYP PFNGLWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout); +GLAPI PFNGLWAITSYNCPROC glad_glWaitSync; +#define glWaitSync glad_glWaitSync +typedef void (APIENTRYP PFNGLGETINTEGER64VPROC)(GLenum pname, GLint64 *data); +GLAPI PFNGLGETINTEGER64VPROC glad_glGetInteger64v; +#define glGetInteger64v glad_glGetInteger64v +typedef void (APIENTRYP PFNGLGETSYNCIVPROC)(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +GLAPI PFNGLGETSYNCIVPROC glad_glGetSynciv; +#define glGetSynciv glad_glGetSynciv +typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC)(GLenum target, GLuint index, GLint64 *data); +GLAPI PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v; +#define glGetInteger64i_v glad_glGetInteger64i_v +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC)(GLenum target, GLenum pname, GLint64 *params); +GLAPI PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v; +#define glGetBufferParameteri64v glad_glGetBufferParameteri64v +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level); +GLAPI PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture; +#define glFramebufferTexture glad_glFramebufferTexture +typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +GLAPI PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample; +#define glTexImage2DMultisample glad_glTexImage2DMultisample +typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +GLAPI PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample; +#define glTexImage3DMultisample glad_glTexImage3DMultisample +typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC)(GLenum pname, GLuint index, GLfloat *val); +GLAPI PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv; +#define glGetMultisamplefv glad_glGetMultisamplefv +typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC)(GLuint maskNumber, GLbitfield mask); +GLAPI PFNGLSAMPLEMASKIPROC glad_glSampleMaski; +#define glSampleMaski glad_glSampleMaski +#endif +#ifndef GL_VERSION_3_3 +#define GL_VERSION_3_3 1 +GLAPI int GLAD_GL_VERSION_3_3; +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)(GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); +GLAPI PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed; +#define glBindFragDataLocationIndexed glad_glBindFragDataLocationIndexed +typedef GLint (APIENTRYP PFNGLGETFRAGDATAINDEXPROC)(GLuint program, const GLchar *name); +GLAPI PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex; +#define glGetFragDataIndex glad_glGetFragDataIndex +typedef void (APIENTRYP PFNGLGENSAMPLERSPROC)(GLsizei count, GLuint *samplers); +GLAPI PFNGLGENSAMPLERSPROC glad_glGenSamplers; +#define glGenSamplers glad_glGenSamplers +typedef void (APIENTRYP PFNGLDELETESAMPLERSPROC)(GLsizei count, const GLuint *samplers); +GLAPI PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers; +#define glDeleteSamplers glad_glDeleteSamplers +typedef GLboolean (APIENTRYP PFNGLISSAMPLERPROC)(GLuint sampler); +GLAPI PFNGLISSAMPLERPROC glad_glIsSampler; +#define glIsSampler glad_glIsSampler +typedef void (APIENTRYP PFNGLBINDSAMPLERPROC)(GLuint unit, GLuint sampler); +GLAPI PFNGLBINDSAMPLERPROC glad_glBindSampler; +#define glBindSampler glad_glBindSampler +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC)(GLuint sampler, GLenum pname, GLint param); +GLAPI PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri; +#define glSamplerParameteri glad_glSamplerParameteri +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname, const GLint *param); +GLAPI PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv; +#define glSamplerParameteriv glad_glSamplerParameteriv +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC)(GLuint sampler, GLenum pname, GLfloat param); +GLAPI PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf; +#define glSamplerParameterf glad_glSamplerParameterf +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname, const GLfloat *param); +GLAPI PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv; +#define glSamplerParameterfv glad_glSamplerParameterfv +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC)(GLuint sampler, GLenum pname, const GLint *param); +GLAPI PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv; +#define glSamplerParameterIiv glad_glSamplerParameterIiv +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC)(GLuint sampler, GLenum pname, const GLuint *param); +GLAPI PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv; +#define glSamplerParameterIuiv glad_glSamplerParameterIuiv +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname, GLint *params); +GLAPI PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv; +#define glGetSamplerParameteriv glad_glGetSamplerParameteriv +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC)(GLuint sampler, GLenum pname, GLint *params); +GLAPI PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv; +#define glGetSamplerParameterIiv glad_glGetSamplerParameterIiv +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname, GLfloat *params); +GLAPI PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv; +#define glGetSamplerParameterfv glad_glGetSamplerParameterfv +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC)(GLuint sampler, GLenum pname, GLuint *params); +GLAPI PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv; +#define glGetSamplerParameterIuiv glad_glGetSamplerParameterIuiv +typedef void (APIENTRYP PFNGLQUERYCOUNTERPROC)(GLuint id, GLenum target); +GLAPI PFNGLQUERYCOUNTERPROC glad_glQueryCounter; +#define glQueryCounter glad_glQueryCounter +typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VPROC)(GLuint id, GLenum pname, GLint64 *params); +GLAPI PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v; +#define glGetQueryObjecti64v glad_glGetQueryObjecti64v +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC)(GLuint id, GLenum pname, GLuint64 *params); +GLAPI PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v; +#define glGetQueryObjectui64v glad_glGetQueryObjectui64v +typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC)(GLuint index, GLuint divisor); +GLAPI PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor; +#define glVertexAttribDivisor glad_glVertexAttribDivisor +typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui; +#define glVertexAttribP1ui glad_glVertexAttribP1ui +typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv; +#define glVertexAttribP1uiv glad_glVertexAttribP1uiv +typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui; +#define glVertexAttribP2ui glad_glVertexAttribP2ui +typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv; +#define glVertexAttribP2uiv glad_glVertexAttribP2uiv +typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui; +#define glVertexAttribP3ui glad_glVertexAttribP3ui +typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv; +#define glVertexAttribP3uiv glad_glVertexAttribP3uiv +typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui; +#define glVertexAttribP4ui glad_glVertexAttribP4ui +typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv; +#define glVertexAttribP4uiv glad_glVertexAttribP4uiv +typedef void (APIENTRYP PFNGLVERTEXP2UIPROC)(GLenum type, GLuint value); +GLAPI PFNGLVERTEXP2UIPROC glad_glVertexP2ui; +#define glVertexP2ui glad_glVertexP2ui +typedef void (APIENTRYP PFNGLVERTEXP2UIVPROC)(GLenum type, const GLuint *value); +GLAPI PFNGLVERTEXP2UIVPROC glad_glVertexP2uiv; +#define glVertexP2uiv glad_glVertexP2uiv +typedef void (APIENTRYP PFNGLVERTEXP3UIPROC)(GLenum type, GLuint value); +GLAPI PFNGLVERTEXP3UIPROC glad_glVertexP3ui; +#define glVertexP3ui glad_glVertexP3ui +typedef void (APIENTRYP PFNGLVERTEXP3UIVPROC)(GLenum type, const GLuint *value); +GLAPI PFNGLVERTEXP3UIVPROC glad_glVertexP3uiv; +#define glVertexP3uiv glad_glVertexP3uiv +typedef void (APIENTRYP PFNGLVERTEXP4UIPROC)(GLenum type, GLuint value); +GLAPI PFNGLVERTEXP4UIPROC glad_glVertexP4ui; +#define glVertexP4ui glad_glVertexP4ui +typedef void (APIENTRYP PFNGLVERTEXP4UIVPROC)(GLenum type, const GLuint *value); +GLAPI PFNGLVERTEXP4UIVPROC glad_glVertexP4uiv; +#define glVertexP4uiv glad_glVertexP4uiv +typedef void (APIENTRYP PFNGLTEXCOORDP1UIPROC)(GLenum type, GLuint coords); +GLAPI PFNGLTEXCOORDP1UIPROC glad_glTexCoordP1ui; +#define glTexCoordP1ui glad_glTexCoordP1ui +typedef void (APIENTRYP PFNGLTEXCOORDP1UIVPROC)(GLenum type, const GLuint *coords); +GLAPI PFNGLTEXCOORDP1UIVPROC glad_glTexCoordP1uiv; +#define glTexCoordP1uiv glad_glTexCoordP1uiv +typedef void (APIENTRYP PFNGLTEXCOORDP2UIPROC)(GLenum type, GLuint coords); +GLAPI PFNGLTEXCOORDP2UIPROC glad_glTexCoordP2ui; +#define glTexCoordP2ui glad_glTexCoordP2ui +typedef void (APIENTRYP PFNGLTEXCOORDP2UIVPROC)(GLenum type, const GLuint *coords); +GLAPI PFNGLTEXCOORDP2UIVPROC glad_glTexCoordP2uiv; +#define glTexCoordP2uiv glad_glTexCoordP2uiv +typedef void (APIENTRYP PFNGLTEXCOORDP3UIPROC)(GLenum type, GLuint coords); +GLAPI PFNGLTEXCOORDP3UIPROC glad_glTexCoordP3ui; +#define glTexCoordP3ui glad_glTexCoordP3ui +typedef void (APIENTRYP PFNGLTEXCOORDP3UIVPROC)(GLenum type, const GLuint *coords); +GLAPI PFNGLTEXCOORDP3UIVPROC glad_glTexCoordP3uiv; +#define glTexCoordP3uiv glad_glTexCoordP3uiv +typedef void (APIENTRYP PFNGLTEXCOORDP4UIPROC)(GLenum type, GLuint coords); +GLAPI PFNGLTEXCOORDP4UIPROC glad_glTexCoordP4ui; +#define glTexCoordP4ui glad_glTexCoordP4ui +typedef void (APIENTRYP PFNGLTEXCOORDP4UIVPROC)(GLenum type, const GLuint *coords); +GLAPI PFNGLTEXCOORDP4UIVPROC glad_glTexCoordP4uiv; +#define glTexCoordP4uiv glad_glTexCoordP4uiv +typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIPROC)(GLenum texture, GLenum type, GLuint coords); +GLAPI PFNGLMULTITEXCOORDP1UIPROC glad_glMultiTexCoordP1ui; +#define glMultiTexCoordP1ui glad_glMultiTexCoordP1ui +typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIVPROC)(GLenum texture, GLenum type, const GLuint *coords); +GLAPI PFNGLMULTITEXCOORDP1UIVPROC glad_glMultiTexCoordP1uiv; +#define glMultiTexCoordP1uiv glad_glMultiTexCoordP1uiv +typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIPROC)(GLenum texture, GLenum type, GLuint coords); +GLAPI PFNGLMULTITEXCOORDP2UIPROC glad_glMultiTexCoordP2ui; +#define glMultiTexCoordP2ui glad_glMultiTexCoordP2ui +typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIVPROC)(GLenum texture, GLenum type, const GLuint *coords); +GLAPI PFNGLMULTITEXCOORDP2UIVPROC glad_glMultiTexCoordP2uiv; +#define glMultiTexCoordP2uiv glad_glMultiTexCoordP2uiv +typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIPROC)(GLenum texture, GLenum type, GLuint coords); +GLAPI PFNGLMULTITEXCOORDP3UIPROC glad_glMultiTexCoordP3ui; +#define glMultiTexCoordP3ui glad_glMultiTexCoordP3ui +typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIVPROC)(GLenum texture, GLenum type, const GLuint *coords); +GLAPI PFNGLMULTITEXCOORDP3UIVPROC glad_glMultiTexCoordP3uiv; +#define glMultiTexCoordP3uiv glad_glMultiTexCoordP3uiv +typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIPROC)(GLenum texture, GLenum type, GLuint coords); +GLAPI PFNGLMULTITEXCOORDP4UIPROC glad_glMultiTexCoordP4ui; +#define glMultiTexCoordP4ui glad_glMultiTexCoordP4ui +typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIVPROC)(GLenum texture, GLenum type, const GLuint *coords); +GLAPI PFNGLMULTITEXCOORDP4UIVPROC glad_glMultiTexCoordP4uiv; +#define glMultiTexCoordP4uiv glad_glMultiTexCoordP4uiv +typedef void (APIENTRYP PFNGLNORMALP3UIPROC)(GLenum type, GLuint coords); +GLAPI PFNGLNORMALP3UIPROC glad_glNormalP3ui; +#define glNormalP3ui glad_glNormalP3ui +typedef void (APIENTRYP PFNGLNORMALP3UIVPROC)(GLenum type, const GLuint *coords); +GLAPI PFNGLNORMALP3UIVPROC glad_glNormalP3uiv; +#define glNormalP3uiv glad_glNormalP3uiv +typedef void (APIENTRYP PFNGLCOLORP3UIPROC)(GLenum type, GLuint color); +GLAPI PFNGLCOLORP3UIPROC glad_glColorP3ui; +#define glColorP3ui glad_glColorP3ui +typedef void (APIENTRYP PFNGLCOLORP3UIVPROC)(GLenum type, const GLuint *color); +GLAPI PFNGLCOLORP3UIVPROC glad_glColorP3uiv; +#define glColorP3uiv glad_glColorP3uiv +typedef void (APIENTRYP PFNGLCOLORP4UIPROC)(GLenum type, GLuint color); +GLAPI PFNGLCOLORP4UIPROC glad_glColorP4ui; +#define glColorP4ui glad_glColorP4ui +typedef void (APIENTRYP PFNGLCOLORP4UIVPROC)(GLenum type, const GLuint *color); +GLAPI PFNGLCOLORP4UIVPROC glad_glColorP4uiv; +#define glColorP4uiv glad_glColorP4uiv +typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIPROC)(GLenum type, GLuint color); +GLAPI PFNGLSECONDARYCOLORP3UIPROC glad_glSecondaryColorP3ui; +#define glSecondaryColorP3ui glad_glSecondaryColorP3ui +typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC)(GLenum type, const GLuint *color); +GLAPI PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv; +#define glSecondaryColorP3uiv glad_glSecondaryColorP3uiv +#endif +#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 +#define GL_DEBUG_SOURCE_API_ARB 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A +#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B +#define GL_DEBUG_TYPE_ERROR_ARB 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E +#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 +#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 +#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 +#ifndef GL_ARB_debug_output +#define GL_ARB_debug_output 1 +GLAPI int GLAD_GL_ARB_debug_output; +typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +GLAPI PFNGLDEBUGMESSAGECONTROLARBPROC glad_glDebugMessageControlARB; +#define glDebugMessageControlARB glad_glDebugMessageControlARB +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +GLAPI PFNGLDEBUGMESSAGEINSERTARBPROC glad_glDebugMessageInsertARB; +#define glDebugMessageInsertARB glad_glDebugMessageInsertARB +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC)(GLDEBUGPROCARB callback, const void *userParam); +GLAPI PFNGLDEBUGMESSAGECALLBACKARBPROC glad_glDebugMessageCallbackARB; +#define glDebugMessageCallbackARB glad_glDebugMessageCallbackARB +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC)(GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +GLAPI PFNGLGETDEBUGMESSAGELOGARBPROC glad_glGetDebugMessageLogARB; +#define glGetDebugMessageLogARB glad_glGetDebugMessageLogARB +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/thirdparty/glew/GL/glew.h b/thirdparty/glew/GL/glew.h deleted file mode 100644 index 702265c38b..0000000000 --- a/thirdparty/glew/GL/glew.h +++ /dev/null @@ -1,19753 +0,0 @@ -/* -** The OpenGL Extension Wrangler Library -** Copyright (C) 2008-2015, Nigel Stewart <nigels[]users sourceforge net> -** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org> -** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org> -** Copyright (C) 2002, Lev Povalahev -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are met: -** -** * Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** * The name of the author may be used to endorse or promote products -** derived from this software without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -** THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/* - * Mesa 3-D graphics library - * Version: 7.0 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* -** Copyright (c) 2007 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ - -#ifndef __glew_h__ -#define __glew_h__ -#define __GLEW_H__ - -#if defined(__gl_h_) || defined(__GL_H__) || defined(_GL_H) || defined(__X_GL_H) -#error gl.h included before glew.h -#endif -#if defined(__gl2_h_) -#error gl2.h included before glew.h -#endif -#if defined(__gltypes_h_) -#error gltypes.h included before glew.h -#endif -#if defined(__REGAL_H__) -#error Regal.h included before glew.h -#endif -#if defined(__glext_h_) || defined(__GLEXT_H_) -#error glext.h included before glew.h -#endif -#if defined(__gl_ATI_h_) -#error glATI.h included before glew.h -#endif - -#define __gl_h_ -#define __gl2_h_ -#define __GL_H__ -#define _GL_H -#define __gltypes_h_ -#define __REGAL_H__ -#define __X_GL_H -#define __glext_h_ -#define __GLEXT_H_ -#define __gl_ATI_h_ - -#if defined(_WIN32) - -/* - * GLEW does not include <windows.h> to avoid name space pollution. - * GL needs GLAPI and GLAPIENTRY, GLU needs APIENTRY, CALLBACK, and wchar_t - * defined properly. - */ -/* <windef.h> and <gl.h>*/ -#ifdef APIENTRY -# ifndef GLAPIENTRY -# define GLAPIENTRY APIENTRY -# endif -# ifndef GLEWAPIENTRY -# define GLEWAPIENTRY APIENTRY -# endif -#else -#define GLEW_APIENTRY_DEFINED -# if defined(__MINGW32__) || defined(__CYGWIN__) || (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) -# define APIENTRY __stdcall -# ifndef GLAPIENTRY -# define GLAPIENTRY __stdcall -# endif -# ifndef GLEWAPIENTRY -# define GLEWAPIENTRY __stdcall -# endif -# else -# define APIENTRY -# endif -#endif -#ifndef GLAPI -# if defined(__MINGW32__) || defined(__CYGWIN__) -# define GLAPI extern -# endif -#endif -/* <winnt.h> */ -#ifndef CALLBACK -#define GLEW_CALLBACK_DEFINED -# if defined(__MINGW32__) || defined(__CYGWIN__) -# define CALLBACK __attribute__ ((__stdcall__)) -# elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) -# define CALLBACK __stdcall -# else -# define CALLBACK -# endif -#endif -/* <wingdi.h> and <winnt.h> */ -#ifndef WINGDIAPI -#define GLEW_WINGDIAPI_DEFINED -#define WINGDIAPI __declspec(dllimport) -#endif -/* <ctype.h> */ -#if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(_WCHAR_T_DEFINED) -typedef unsigned short wchar_t; -# define _WCHAR_T_DEFINED -#endif -/* <stddef.h> */ -#if !defined(_W64) -# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && defined(_MSC_VER) && _MSC_VER >= 1300 -# define _W64 __w64 -# else -# define _W64 -# endif -#endif -#if !defined(_PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T_) && !defined(__MINGW64__) -# ifdef _WIN64 -typedef __int64 ptrdiff_t; -# else -typedef _W64 int ptrdiff_t; -# endif -# define _PTRDIFF_T_DEFINED -# define _PTRDIFF_T_ -#endif - -#ifndef GLAPI -# if defined(__MINGW32__) || defined(__CYGWIN__) -# define GLAPI extern -# else -# define GLAPI WINGDIAPI -# endif -#endif - -/* - * GLEW_STATIC is defined for static library. - * GLEW_BUILD is defined for building the DLL library. - */ - -#ifdef GLEW_STATIC -# define GLEWAPI extern -#else -# ifdef GLEW_BUILD -# define GLEWAPI extern __declspec(dllexport) -# else -# define GLEWAPI extern __declspec(dllimport) -# endif -#endif - -#else /* _UNIX */ - -/* - * Needed for ptrdiff_t in turn needed by VBO. This is defined by ISO - * C. On my system, this amounts to _3 lines_ of included code, all of - * them pretty much harmless. If you know of a way of detecting 32 vs - * 64 _targets_ at compile time you are free to replace this with - * something that's portable. For now, _this_ is the portable solution. - * (mem, 2004-01-04) - */ - -#include <stddef.h> - -/* SGI MIPSPro doesn't like stdint.h in C++ mode */ -/* ID: 3376260 Solaris 9 has inttypes.h, but not stdint.h */ - -#if (defined(__sgi) || defined(__sun)) && !defined(__GNUC__) -#include <inttypes.h> -#else -#include <stdint.h> -#endif - -#define GLEW_APIENTRY_DEFINED -#define APIENTRY - -/* - * GLEW_STATIC is defined for static library. - */ - -#ifdef GLEW_STATIC -# define GLEWAPI extern -#else -# if defined(__GNUC__) && __GNUC__>=4 -# define GLEWAPI extern __attribute__ ((visibility("default"))) -# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) -# define GLEWAPI extern __global -# else -# define GLEWAPI extern -# endif -#endif - -/* <glu.h> */ -#ifndef GLAPI -#define GLAPI extern -#endif - -#endif /* _WIN32 */ - -#ifndef GLAPIENTRY -#define GLAPIENTRY -#endif - -#ifndef GLEWAPIENTRY -#define GLEWAPIENTRY -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* ----------------------------- GL_VERSION_1_1 ---------------------------- */ - -#ifndef GL_VERSION_1_1 -#define GL_VERSION_1_1 1 - -typedef unsigned int GLenum; -typedef unsigned int GLbitfield; -typedef unsigned int GLuint; -typedef int GLint; -typedef int GLsizei; -typedef unsigned char GLboolean; -typedef signed char GLbyte; -typedef short GLshort; -typedef unsigned char GLubyte; -typedef unsigned short GLushort; -typedef unsigned long GLulong; -typedef float GLfloat; -typedef float GLclampf; -typedef double GLdouble; -typedef double GLclampd; -typedef void GLvoid; -#if defined(_MSC_VER) && _MSC_VER < 1400 -typedef __int64 GLint64EXT; -typedef unsigned __int64 GLuint64EXT; -#elif defined(_MSC_VER) || defined(__BORLANDC__) -typedef signed long long GLint64EXT; -typedef unsigned long long GLuint64EXT; -#else -# if defined(__MINGW32__) || defined(__CYGWIN__) -#include <inttypes.h> -# endif -typedef int64_t GLint64EXT; -typedef uint64_t GLuint64EXT; -#endif -typedef GLint64EXT GLint64; -typedef GLuint64EXT GLuint64; -typedef struct __GLsync *GLsync; - -typedef char GLchar; - -#define GL_ZERO 0 -#define GL_FALSE 0 -#define GL_LOGIC_OP 0x0BF1 -#define GL_NONE 0 -#define GL_TEXTURE_COMPONENTS 0x1003 -#define GL_NO_ERROR 0 -#define GL_POINTS 0x0000 -#define GL_CURRENT_BIT 0x00000001 -#define GL_TRUE 1 -#define GL_ONE 1 -#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 -#define GL_LINES 0x0001 -#define GL_LINE_LOOP 0x0002 -#define GL_POINT_BIT 0x00000002 -#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 -#define GL_LINE_STRIP 0x0003 -#define GL_LINE_BIT 0x00000004 -#define GL_TRIANGLES 0x0004 -#define GL_TRIANGLE_STRIP 0x0005 -#define GL_TRIANGLE_FAN 0x0006 -#define GL_QUADS 0x0007 -#define GL_QUAD_STRIP 0x0008 -#define GL_POLYGON_BIT 0x00000008 -#define GL_POLYGON 0x0009 -#define GL_POLYGON_STIPPLE_BIT 0x00000010 -#define GL_PIXEL_MODE_BIT 0x00000020 -#define GL_LIGHTING_BIT 0x00000040 -#define GL_FOG_BIT 0x00000080 -#define GL_DEPTH_BUFFER_BIT 0x00000100 -#define GL_ACCUM 0x0100 -#define GL_LOAD 0x0101 -#define GL_RETURN 0x0102 -#define GL_MULT 0x0103 -#define GL_ADD 0x0104 -#define GL_NEVER 0x0200 -#define GL_ACCUM_BUFFER_BIT 0x00000200 -#define GL_LESS 0x0201 -#define GL_EQUAL 0x0202 -#define GL_LEQUAL 0x0203 -#define GL_GREATER 0x0204 -#define GL_NOTEQUAL 0x0205 -#define GL_GEQUAL 0x0206 -#define GL_ALWAYS 0x0207 -#define GL_SRC_COLOR 0x0300 -#define GL_ONE_MINUS_SRC_COLOR 0x0301 -#define GL_SRC_ALPHA 0x0302 -#define GL_ONE_MINUS_SRC_ALPHA 0x0303 -#define GL_DST_ALPHA 0x0304 -#define GL_ONE_MINUS_DST_ALPHA 0x0305 -#define GL_DST_COLOR 0x0306 -#define GL_ONE_MINUS_DST_COLOR 0x0307 -#define GL_SRC_ALPHA_SATURATE 0x0308 -#define GL_STENCIL_BUFFER_BIT 0x00000400 -#define GL_FRONT_LEFT 0x0400 -#define GL_FRONT_RIGHT 0x0401 -#define GL_BACK_LEFT 0x0402 -#define GL_BACK_RIGHT 0x0403 -#define GL_FRONT 0x0404 -#define GL_BACK 0x0405 -#define GL_LEFT 0x0406 -#define GL_RIGHT 0x0407 -#define GL_FRONT_AND_BACK 0x0408 -#define GL_AUX0 0x0409 -#define GL_AUX1 0x040A -#define GL_AUX2 0x040B -#define GL_AUX3 0x040C -#define GL_INVALID_ENUM 0x0500 -#define GL_INVALID_VALUE 0x0501 -#define GL_INVALID_OPERATION 0x0502 -#define GL_STACK_OVERFLOW 0x0503 -#define GL_STACK_UNDERFLOW 0x0504 -#define GL_OUT_OF_MEMORY 0x0505 -#define GL_2D 0x0600 -#define GL_3D 0x0601 -#define GL_3D_COLOR 0x0602 -#define GL_3D_COLOR_TEXTURE 0x0603 -#define GL_4D_COLOR_TEXTURE 0x0604 -#define GL_PASS_THROUGH_TOKEN 0x0700 -#define GL_POINT_TOKEN 0x0701 -#define GL_LINE_TOKEN 0x0702 -#define GL_POLYGON_TOKEN 0x0703 -#define GL_BITMAP_TOKEN 0x0704 -#define GL_DRAW_PIXEL_TOKEN 0x0705 -#define GL_COPY_PIXEL_TOKEN 0x0706 -#define GL_LINE_RESET_TOKEN 0x0707 -#define GL_EXP 0x0800 -#define GL_VIEWPORT_BIT 0x00000800 -#define GL_EXP2 0x0801 -#define GL_CW 0x0900 -#define GL_CCW 0x0901 -#define GL_COEFF 0x0A00 -#define GL_ORDER 0x0A01 -#define GL_DOMAIN 0x0A02 -#define GL_CURRENT_COLOR 0x0B00 -#define GL_CURRENT_INDEX 0x0B01 -#define GL_CURRENT_NORMAL 0x0B02 -#define GL_CURRENT_TEXTURE_COORDS 0x0B03 -#define GL_CURRENT_RASTER_COLOR 0x0B04 -#define GL_CURRENT_RASTER_INDEX 0x0B05 -#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 -#define GL_CURRENT_RASTER_POSITION 0x0B07 -#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 -#define GL_CURRENT_RASTER_DISTANCE 0x0B09 -#define GL_POINT_SMOOTH 0x0B10 -#define GL_POINT_SIZE 0x0B11 -#define GL_POINT_SIZE_RANGE 0x0B12 -#define GL_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_LINE_SMOOTH 0x0B20 -#define GL_LINE_WIDTH 0x0B21 -#define GL_LINE_WIDTH_RANGE 0x0B22 -#define GL_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_LINE_STIPPLE 0x0B24 -#define GL_LINE_STIPPLE_PATTERN 0x0B25 -#define GL_LINE_STIPPLE_REPEAT 0x0B26 -#define GL_LIST_MODE 0x0B30 -#define GL_MAX_LIST_NESTING 0x0B31 -#define GL_LIST_BASE 0x0B32 -#define GL_LIST_INDEX 0x0B33 -#define GL_POLYGON_MODE 0x0B40 -#define GL_POLYGON_SMOOTH 0x0B41 -#define GL_POLYGON_STIPPLE 0x0B42 -#define GL_EDGE_FLAG 0x0B43 -#define GL_CULL_FACE 0x0B44 -#define GL_CULL_FACE_MODE 0x0B45 -#define GL_FRONT_FACE 0x0B46 -#define GL_LIGHTING 0x0B50 -#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 -#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 -#define GL_LIGHT_MODEL_AMBIENT 0x0B53 -#define GL_SHADE_MODEL 0x0B54 -#define GL_COLOR_MATERIAL_FACE 0x0B55 -#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 -#define GL_COLOR_MATERIAL 0x0B57 -#define GL_FOG 0x0B60 -#define GL_FOG_INDEX 0x0B61 -#define GL_FOG_DENSITY 0x0B62 -#define GL_FOG_START 0x0B63 -#define GL_FOG_END 0x0B64 -#define GL_FOG_MODE 0x0B65 -#define GL_FOG_COLOR 0x0B66 -#define GL_DEPTH_RANGE 0x0B70 -#define GL_DEPTH_TEST 0x0B71 -#define GL_DEPTH_WRITEMASK 0x0B72 -#define GL_DEPTH_CLEAR_VALUE 0x0B73 -#define GL_DEPTH_FUNC 0x0B74 -#define GL_ACCUM_CLEAR_VALUE 0x0B80 -#define GL_STENCIL_TEST 0x0B90 -#define GL_STENCIL_CLEAR_VALUE 0x0B91 -#define GL_STENCIL_FUNC 0x0B92 -#define GL_STENCIL_VALUE_MASK 0x0B93 -#define GL_STENCIL_FAIL 0x0B94 -#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 -#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 -#define GL_STENCIL_REF 0x0B97 -#define GL_STENCIL_WRITEMASK 0x0B98 -#define GL_MATRIX_MODE 0x0BA0 -#define GL_NORMALIZE 0x0BA1 -#define GL_VIEWPORT 0x0BA2 -#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 -#define GL_PROJECTION_STACK_DEPTH 0x0BA4 -#define GL_TEXTURE_STACK_DEPTH 0x0BA5 -#define GL_MODELVIEW_MATRIX 0x0BA6 -#define GL_PROJECTION_MATRIX 0x0BA7 -#define GL_TEXTURE_MATRIX 0x0BA8 -#define GL_ATTRIB_STACK_DEPTH 0x0BB0 -#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 -#define GL_ALPHA_TEST 0x0BC0 -#define GL_ALPHA_TEST_FUNC 0x0BC1 -#define GL_ALPHA_TEST_REF 0x0BC2 -#define GL_DITHER 0x0BD0 -#define GL_BLEND_DST 0x0BE0 -#define GL_BLEND_SRC 0x0BE1 -#define GL_BLEND 0x0BE2 -#define GL_LOGIC_OP_MODE 0x0BF0 -#define GL_INDEX_LOGIC_OP 0x0BF1 -#define GL_COLOR_LOGIC_OP 0x0BF2 -#define GL_AUX_BUFFERS 0x0C00 -#define GL_DRAW_BUFFER 0x0C01 -#define GL_READ_BUFFER 0x0C02 -#define GL_SCISSOR_BOX 0x0C10 -#define GL_SCISSOR_TEST 0x0C11 -#define GL_INDEX_CLEAR_VALUE 0x0C20 -#define GL_INDEX_WRITEMASK 0x0C21 -#define GL_COLOR_CLEAR_VALUE 0x0C22 -#define GL_COLOR_WRITEMASK 0x0C23 -#define GL_INDEX_MODE 0x0C30 -#define GL_RGBA_MODE 0x0C31 -#define GL_DOUBLEBUFFER 0x0C32 -#define GL_STEREO 0x0C33 -#define GL_RENDER_MODE 0x0C40 -#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 -#define GL_POINT_SMOOTH_HINT 0x0C51 -#define GL_LINE_SMOOTH_HINT 0x0C52 -#define GL_POLYGON_SMOOTH_HINT 0x0C53 -#define GL_FOG_HINT 0x0C54 -#define GL_TEXTURE_GEN_S 0x0C60 -#define GL_TEXTURE_GEN_T 0x0C61 -#define GL_TEXTURE_GEN_R 0x0C62 -#define GL_TEXTURE_GEN_Q 0x0C63 -#define GL_PIXEL_MAP_I_TO_I 0x0C70 -#define GL_PIXEL_MAP_S_TO_S 0x0C71 -#define GL_PIXEL_MAP_I_TO_R 0x0C72 -#define GL_PIXEL_MAP_I_TO_G 0x0C73 -#define GL_PIXEL_MAP_I_TO_B 0x0C74 -#define GL_PIXEL_MAP_I_TO_A 0x0C75 -#define GL_PIXEL_MAP_R_TO_R 0x0C76 -#define GL_PIXEL_MAP_G_TO_G 0x0C77 -#define GL_PIXEL_MAP_B_TO_B 0x0C78 -#define GL_PIXEL_MAP_A_TO_A 0x0C79 -#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 -#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 -#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 -#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 -#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 -#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 -#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 -#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 -#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 -#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 -#define GL_UNPACK_SWAP_BYTES 0x0CF0 -#define GL_UNPACK_LSB_FIRST 0x0CF1 -#define GL_UNPACK_ROW_LENGTH 0x0CF2 -#define GL_UNPACK_SKIP_ROWS 0x0CF3 -#define GL_UNPACK_SKIP_PIXELS 0x0CF4 -#define GL_UNPACK_ALIGNMENT 0x0CF5 -#define GL_PACK_SWAP_BYTES 0x0D00 -#define GL_PACK_LSB_FIRST 0x0D01 -#define GL_PACK_ROW_LENGTH 0x0D02 -#define GL_PACK_SKIP_ROWS 0x0D03 -#define GL_PACK_SKIP_PIXELS 0x0D04 -#define GL_PACK_ALIGNMENT 0x0D05 -#define GL_MAP_COLOR 0x0D10 -#define GL_MAP_STENCIL 0x0D11 -#define GL_INDEX_SHIFT 0x0D12 -#define GL_INDEX_OFFSET 0x0D13 -#define GL_RED_SCALE 0x0D14 -#define GL_RED_BIAS 0x0D15 -#define GL_ZOOM_X 0x0D16 -#define GL_ZOOM_Y 0x0D17 -#define GL_GREEN_SCALE 0x0D18 -#define GL_GREEN_BIAS 0x0D19 -#define GL_BLUE_SCALE 0x0D1A -#define GL_BLUE_BIAS 0x0D1B -#define GL_ALPHA_SCALE 0x0D1C -#define GL_ALPHA_BIAS 0x0D1D -#define GL_DEPTH_SCALE 0x0D1E -#define GL_DEPTH_BIAS 0x0D1F -#define GL_MAX_EVAL_ORDER 0x0D30 -#define GL_MAX_LIGHTS 0x0D31 -#define GL_MAX_CLIP_PLANES 0x0D32 -#define GL_MAX_TEXTURE_SIZE 0x0D33 -#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 -#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 -#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 -#define GL_MAX_NAME_STACK_DEPTH 0x0D37 -#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 -#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 -#define GL_MAX_VIEWPORT_DIMS 0x0D3A -#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B -#define GL_SUBPIXEL_BITS 0x0D50 -#define GL_INDEX_BITS 0x0D51 -#define GL_RED_BITS 0x0D52 -#define GL_GREEN_BITS 0x0D53 -#define GL_BLUE_BITS 0x0D54 -#define GL_ALPHA_BITS 0x0D55 -#define GL_DEPTH_BITS 0x0D56 -#define GL_STENCIL_BITS 0x0D57 -#define GL_ACCUM_RED_BITS 0x0D58 -#define GL_ACCUM_GREEN_BITS 0x0D59 -#define GL_ACCUM_BLUE_BITS 0x0D5A -#define GL_ACCUM_ALPHA_BITS 0x0D5B -#define GL_NAME_STACK_DEPTH 0x0D70 -#define GL_AUTO_NORMAL 0x0D80 -#define GL_MAP1_COLOR_4 0x0D90 -#define GL_MAP1_INDEX 0x0D91 -#define GL_MAP1_NORMAL 0x0D92 -#define GL_MAP1_TEXTURE_COORD_1 0x0D93 -#define GL_MAP1_TEXTURE_COORD_2 0x0D94 -#define GL_MAP1_TEXTURE_COORD_3 0x0D95 -#define GL_MAP1_TEXTURE_COORD_4 0x0D96 -#define GL_MAP1_VERTEX_3 0x0D97 -#define GL_MAP1_VERTEX_4 0x0D98 -#define GL_MAP2_COLOR_4 0x0DB0 -#define GL_MAP2_INDEX 0x0DB1 -#define GL_MAP2_NORMAL 0x0DB2 -#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 -#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 -#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 -#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 -#define GL_MAP2_VERTEX_3 0x0DB7 -#define GL_MAP2_VERTEX_4 0x0DB8 -#define GL_MAP1_GRID_DOMAIN 0x0DD0 -#define GL_MAP1_GRID_SEGMENTS 0x0DD1 -#define GL_MAP2_GRID_DOMAIN 0x0DD2 -#define GL_MAP2_GRID_SEGMENTS 0x0DD3 -#define GL_TEXTURE_1D 0x0DE0 -#define GL_TEXTURE_2D 0x0DE1 -#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 -#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 -#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 -#define GL_SELECTION_BUFFER_POINTER 0x0DF3 -#define GL_SELECTION_BUFFER_SIZE 0x0DF4 -#define GL_TEXTURE_WIDTH 0x1000 -#define GL_TRANSFORM_BIT 0x00001000 -#define GL_TEXTURE_HEIGHT 0x1001 -#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 -#define GL_TEXTURE_BORDER_COLOR 0x1004 -#define GL_TEXTURE_BORDER 0x1005 -#define GL_DONT_CARE 0x1100 -#define GL_FASTEST 0x1101 -#define GL_NICEST 0x1102 -#define GL_AMBIENT 0x1200 -#define GL_DIFFUSE 0x1201 -#define GL_SPECULAR 0x1202 -#define GL_POSITION 0x1203 -#define GL_SPOT_DIRECTION 0x1204 -#define GL_SPOT_EXPONENT 0x1205 -#define GL_SPOT_CUTOFF 0x1206 -#define GL_CONSTANT_ATTENUATION 0x1207 -#define GL_LINEAR_ATTENUATION 0x1208 -#define GL_QUADRATIC_ATTENUATION 0x1209 -#define GL_COMPILE 0x1300 -#define GL_COMPILE_AND_EXECUTE 0x1301 -#define GL_BYTE 0x1400 -#define GL_UNSIGNED_BYTE 0x1401 -#define GL_SHORT 0x1402 -#define GL_UNSIGNED_SHORT 0x1403 -#define GL_INT 0x1404 -#define GL_UNSIGNED_INT 0x1405 -#define GL_FLOAT 0x1406 -#define GL_2_BYTES 0x1407 -#define GL_3_BYTES 0x1408 -#define GL_4_BYTES 0x1409 -#define GL_DOUBLE 0x140A -#define GL_CLEAR 0x1500 -#define GL_AND 0x1501 -#define GL_AND_REVERSE 0x1502 -#define GL_COPY 0x1503 -#define GL_AND_INVERTED 0x1504 -#define GL_NOOP 0x1505 -#define GL_XOR 0x1506 -#define GL_OR 0x1507 -#define GL_NOR 0x1508 -#define GL_EQUIV 0x1509 -#define GL_INVERT 0x150A -#define GL_OR_REVERSE 0x150B -#define GL_COPY_INVERTED 0x150C -#define GL_OR_INVERTED 0x150D -#define GL_NAND 0x150E -#define GL_SET 0x150F -#define GL_EMISSION 0x1600 -#define GL_SHININESS 0x1601 -#define GL_AMBIENT_AND_DIFFUSE 0x1602 -#define GL_COLOR_INDEXES 0x1603 -#define GL_MODELVIEW 0x1700 -#define GL_PROJECTION 0x1701 -#define GL_TEXTURE 0x1702 -#define GL_COLOR 0x1800 -#define GL_DEPTH 0x1801 -#define GL_STENCIL 0x1802 -#define GL_COLOR_INDEX 0x1900 -#define GL_STENCIL_INDEX 0x1901 -#define GL_DEPTH_COMPONENT 0x1902 -#define GL_RED 0x1903 -#define GL_GREEN 0x1904 -#define GL_BLUE 0x1905 -#define GL_ALPHA 0x1906 -#define GL_RGB 0x1907 -#define GL_RGBA 0x1908 -#define GL_LUMINANCE 0x1909 -#define GL_LUMINANCE_ALPHA 0x190A -#define GL_BITMAP 0x1A00 -#define GL_POINT 0x1B00 -#define GL_LINE 0x1B01 -#define GL_FILL 0x1B02 -#define GL_RENDER 0x1C00 -#define GL_FEEDBACK 0x1C01 -#define GL_SELECT 0x1C02 -#define GL_FLAT 0x1D00 -#define GL_SMOOTH 0x1D01 -#define GL_KEEP 0x1E00 -#define GL_REPLACE 0x1E01 -#define GL_INCR 0x1E02 -#define GL_DECR 0x1E03 -#define GL_VENDOR 0x1F00 -#define GL_RENDERER 0x1F01 -#define GL_VERSION 0x1F02 -#define GL_EXTENSIONS 0x1F03 -#define GL_S 0x2000 -#define GL_ENABLE_BIT 0x00002000 -#define GL_T 0x2001 -#define GL_R 0x2002 -#define GL_Q 0x2003 -#define GL_MODULATE 0x2100 -#define GL_DECAL 0x2101 -#define GL_TEXTURE_ENV_MODE 0x2200 -#define GL_TEXTURE_ENV_COLOR 0x2201 -#define GL_TEXTURE_ENV 0x2300 -#define GL_EYE_LINEAR 0x2400 -#define GL_OBJECT_LINEAR 0x2401 -#define GL_SPHERE_MAP 0x2402 -#define GL_TEXTURE_GEN_MODE 0x2500 -#define GL_OBJECT_PLANE 0x2501 -#define GL_EYE_PLANE 0x2502 -#define GL_NEAREST 0x2600 -#define GL_LINEAR 0x2601 -#define GL_NEAREST_MIPMAP_NEAREST 0x2700 -#define GL_LINEAR_MIPMAP_NEAREST 0x2701 -#define GL_NEAREST_MIPMAP_LINEAR 0x2702 -#define GL_LINEAR_MIPMAP_LINEAR 0x2703 -#define GL_TEXTURE_MAG_FILTER 0x2800 -#define GL_TEXTURE_MIN_FILTER 0x2801 -#define GL_TEXTURE_WRAP_S 0x2802 -#define GL_TEXTURE_WRAP_T 0x2803 -#define GL_CLAMP 0x2900 -#define GL_REPEAT 0x2901 -#define GL_POLYGON_OFFSET_UNITS 0x2A00 -#define GL_POLYGON_OFFSET_POINT 0x2A01 -#define GL_POLYGON_OFFSET_LINE 0x2A02 -#define GL_R3_G3_B2 0x2A10 -#define GL_V2F 0x2A20 -#define GL_V3F 0x2A21 -#define GL_C4UB_V2F 0x2A22 -#define GL_C4UB_V3F 0x2A23 -#define GL_C3F_V3F 0x2A24 -#define GL_N3F_V3F 0x2A25 -#define GL_C4F_N3F_V3F 0x2A26 -#define GL_T2F_V3F 0x2A27 -#define GL_T4F_V4F 0x2A28 -#define GL_T2F_C4UB_V3F 0x2A29 -#define GL_T2F_C3F_V3F 0x2A2A -#define GL_T2F_N3F_V3F 0x2A2B -#define GL_T2F_C4F_N3F_V3F 0x2A2C -#define GL_T4F_C4F_N3F_V4F 0x2A2D -#define GL_CLIP_PLANE0 0x3000 -#define GL_CLIP_PLANE1 0x3001 -#define GL_CLIP_PLANE2 0x3002 -#define GL_CLIP_PLANE3 0x3003 -#define GL_CLIP_PLANE4 0x3004 -#define GL_CLIP_PLANE5 0x3005 -#define GL_LIGHT0 0x4000 -#define GL_COLOR_BUFFER_BIT 0x00004000 -#define GL_LIGHT1 0x4001 -#define GL_LIGHT2 0x4002 -#define GL_LIGHT3 0x4003 -#define GL_LIGHT4 0x4004 -#define GL_LIGHT5 0x4005 -#define GL_LIGHT6 0x4006 -#define GL_LIGHT7 0x4007 -#define GL_HINT_BIT 0x00008000 -#define GL_POLYGON_OFFSET_FILL 0x8037 -#define GL_POLYGON_OFFSET_FACTOR 0x8038 -#define GL_ALPHA4 0x803B -#define GL_ALPHA8 0x803C -#define GL_ALPHA12 0x803D -#define GL_ALPHA16 0x803E -#define GL_LUMINANCE4 0x803F -#define GL_LUMINANCE8 0x8040 -#define GL_LUMINANCE12 0x8041 -#define GL_LUMINANCE16 0x8042 -#define GL_LUMINANCE4_ALPHA4 0x8043 -#define GL_LUMINANCE6_ALPHA2 0x8044 -#define GL_LUMINANCE8_ALPHA8 0x8045 -#define GL_LUMINANCE12_ALPHA4 0x8046 -#define GL_LUMINANCE12_ALPHA12 0x8047 -#define GL_LUMINANCE16_ALPHA16 0x8048 -#define GL_INTENSITY 0x8049 -#define GL_INTENSITY4 0x804A -#define GL_INTENSITY8 0x804B -#define GL_INTENSITY12 0x804C -#define GL_INTENSITY16 0x804D -#define GL_RGB4 0x804F -#define GL_RGB5 0x8050 -#define GL_RGB8 0x8051 -#define GL_RGB10 0x8052 -#define GL_RGB12 0x8053 -#define GL_RGB16 0x8054 -#define GL_RGBA2 0x8055 -#define GL_RGBA4 0x8056 -#define GL_RGB5_A1 0x8057 -#define GL_RGBA8 0x8058 -#define GL_RGB10_A2 0x8059 -#define GL_RGBA12 0x805A -#define GL_RGBA16 0x805B -#define GL_TEXTURE_RED_SIZE 0x805C -#define GL_TEXTURE_GREEN_SIZE 0x805D -#define GL_TEXTURE_BLUE_SIZE 0x805E -#define GL_TEXTURE_ALPHA_SIZE 0x805F -#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 -#define GL_TEXTURE_INTENSITY_SIZE 0x8061 -#define GL_PROXY_TEXTURE_1D 0x8063 -#define GL_PROXY_TEXTURE_2D 0x8064 -#define GL_TEXTURE_PRIORITY 0x8066 -#define GL_TEXTURE_RESIDENT 0x8067 -#define GL_TEXTURE_BINDING_1D 0x8068 -#define GL_TEXTURE_BINDING_2D 0x8069 -#define GL_VERTEX_ARRAY 0x8074 -#define GL_NORMAL_ARRAY 0x8075 -#define GL_COLOR_ARRAY 0x8076 -#define GL_INDEX_ARRAY 0x8077 -#define GL_TEXTURE_COORD_ARRAY 0x8078 -#define GL_EDGE_FLAG_ARRAY 0x8079 -#define GL_VERTEX_ARRAY_SIZE 0x807A -#define GL_VERTEX_ARRAY_TYPE 0x807B -#define GL_VERTEX_ARRAY_STRIDE 0x807C -#define GL_NORMAL_ARRAY_TYPE 0x807E -#define GL_NORMAL_ARRAY_STRIDE 0x807F -#define GL_COLOR_ARRAY_SIZE 0x8081 -#define GL_COLOR_ARRAY_TYPE 0x8082 -#define GL_COLOR_ARRAY_STRIDE 0x8083 -#define GL_INDEX_ARRAY_TYPE 0x8085 -#define GL_INDEX_ARRAY_STRIDE 0x8086 -#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A -#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C -#define GL_VERTEX_ARRAY_POINTER 0x808E -#define GL_NORMAL_ARRAY_POINTER 0x808F -#define GL_COLOR_ARRAY_POINTER 0x8090 -#define GL_INDEX_ARRAY_POINTER 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 -#define GL_COLOR_INDEX1_EXT 0x80E2 -#define GL_COLOR_INDEX2_EXT 0x80E3 -#define GL_COLOR_INDEX4_EXT 0x80E4 -#define GL_COLOR_INDEX8_EXT 0x80E5 -#define GL_COLOR_INDEX12_EXT 0x80E6 -#define GL_COLOR_INDEX16_EXT 0x80E7 -#define GL_EVAL_BIT 0x00010000 -#define GL_LIST_BIT 0x00020000 -#define GL_TEXTURE_BIT 0x00040000 -#define GL_SCISSOR_BIT 0x00080000 -#define GL_ALL_ATTRIB_BITS 0x000fffff -#define GL_CLIENT_ALL_ATTRIB_BITS 0xffffffff - -GLAPI void GLAPIENTRY glAccum (GLenum op, GLfloat value); -GLAPI void GLAPIENTRY glAlphaFunc (GLenum func, GLclampf ref); -GLAPI GLboolean GLAPIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences); -GLAPI void GLAPIENTRY glArrayElement (GLint i); -GLAPI void GLAPIENTRY glBegin (GLenum mode); -GLAPI void GLAPIENTRY glBindTexture (GLenum target, GLuint texture); -GLAPI void GLAPIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); -GLAPI void GLAPIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); -GLAPI void GLAPIENTRY glCallList (GLuint list); -GLAPI void GLAPIENTRY glCallLists (GLsizei n, GLenum type, const void *lists); -GLAPI void GLAPIENTRY glClear (GLbitfield mask); -GLAPI void GLAPIENTRY glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GLAPI void GLAPIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -GLAPI void GLAPIENTRY glClearDepth (GLclampd depth); -GLAPI void GLAPIENTRY glClearIndex (GLfloat c); -GLAPI void GLAPIENTRY glClearStencil (GLint s); -GLAPI void GLAPIENTRY glClipPlane (GLenum plane, const GLdouble *equation); -GLAPI void GLAPIENTRY glColor3b (GLbyte red, GLbyte green, GLbyte blue); -GLAPI void GLAPIENTRY glColor3bv (const GLbyte *v); -GLAPI void GLAPIENTRY glColor3d (GLdouble red, GLdouble green, GLdouble blue); -GLAPI void GLAPIENTRY glColor3dv (const GLdouble *v); -GLAPI void GLAPIENTRY glColor3f (GLfloat red, GLfloat green, GLfloat blue); -GLAPI void GLAPIENTRY glColor3fv (const GLfloat *v); -GLAPI void GLAPIENTRY glColor3i (GLint red, GLint green, GLint blue); -GLAPI void GLAPIENTRY glColor3iv (const GLint *v); -GLAPI void GLAPIENTRY glColor3s (GLshort red, GLshort green, GLshort blue); -GLAPI void GLAPIENTRY glColor3sv (const GLshort *v); -GLAPI void GLAPIENTRY glColor3ub (GLubyte red, GLubyte green, GLubyte blue); -GLAPI void GLAPIENTRY glColor3ubv (const GLubyte *v); -GLAPI void GLAPIENTRY glColor3ui (GLuint red, GLuint green, GLuint blue); -GLAPI void GLAPIENTRY glColor3uiv (const GLuint *v); -GLAPI void GLAPIENTRY glColor3us (GLushort red, GLushort green, GLushort blue); -GLAPI void GLAPIENTRY glColor3usv (const GLushort *v); -GLAPI void GLAPIENTRY glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); -GLAPI void GLAPIENTRY glColor4bv (const GLbyte *v); -GLAPI void GLAPIENTRY glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); -GLAPI void GLAPIENTRY glColor4dv (const GLdouble *v); -GLAPI void GLAPIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); -GLAPI void GLAPIENTRY glColor4fv (const GLfloat *v); -GLAPI void GLAPIENTRY glColor4i (GLint red, GLint green, GLint blue, GLint alpha); -GLAPI void GLAPIENTRY glColor4iv (const GLint *v); -GLAPI void GLAPIENTRY glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha); -GLAPI void GLAPIENTRY glColor4sv (const GLshort *v); -GLAPI void GLAPIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); -GLAPI void GLAPIENTRY glColor4ubv (const GLubyte *v); -GLAPI void GLAPIENTRY glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha); -GLAPI void GLAPIENTRY glColor4uiv (const GLuint *v); -GLAPI void GLAPIENTRY glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha); -GLAPI void GLAPIENTRY glColor4usv (const GLushort *v); -GLAPI void GLAPIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -GLAPI void GLAPIENTRY glColorMaterial (GLenum face, GLenum mode); -GLAPI void GLAPIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); -GLAPI void GLAPIENTRY glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); -GLAPI void GLAPIENTRY glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); -GLAPI void GLAPIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -GLAPI void GLAPIENTRY glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -GLAPI void GLAPIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void GLAPIENTRY glCullFace (GLenum mode); -GLAPI void GLAPIENTRY glDeleteLists (GLuint list, GLsizei range); -GLAPI void GLAPIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); -GLAPI void GLAPIENTRY glDepthFunc (GLenum func); -GLAPI void GLAPIENTRY glDepthMask (GLboolean flag); -GLAPI void GLAPIENTRY glDepthRange (GLclampd zNear, GLclampd zFar); -GLAPI void GLAPIENTRY glDisable (GLenum cap); -GLAPI void GLAPIENTRY glDisableClientState (GLenum array); -GLAPI void GLAPIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); -GLAPI void GLAPIENTRY glDrawBuffer (GLenum mode); -GLAPI void GLAPIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices); -GLAPI void GLAPIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -GLAPI void GLAPIENTRY glEdgeFlag (GLboolean flag); -GLAPI void GLAPIENTRY glEdgeFlagPointer (GLsizei stride, const void *pointer); -GLAPI void GLAPIENTRY glEdgeFlagv (const GLboolean *flag); -GLAPI void GLAPIENTRY glEnable (GLenum cap); -GLAPI void GLAPIENTRY glEnableClientState (GLenum array); -GLAPI void GLAPIENTRY glEnd (void); -GLAPI void GLAPIENTRY glEndList (void); -GLAPI void GLAPIENTRY glEvalCoord1d (GLdouble u); -GLAPI void GLAPIENTRY glEvalCoord1dv (const GLdouble *u); -GLAPI void GLAPIENTRY glEvalCoord1f (GLfloat u); -GLAPI void GLAPIENTRY glEvalCoord1fv (const GLfloat *u); -GLAPI void GLAPIENTRY glEvalCoord2d (GLdouble u, GLdouble v); -GLAPI void GLAPIENTRY glEvalCoord2dv (const GLdouble *u); -GLAPI void GLAPIENTRY glEvalCoord2f (GLfloat u, GLfloat v); -GLAPI void GLAPIENTRY glEvalCoord2fv (const GLfloat *u); -GLAPI void GLAPIENTRY glEvalMesh1 (GLenum mode, GLint i1, GLint i2); -GLAPI void GLAPIENTRY glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); -GLAPI void GLAPIENTRY glEvalPoint1 (GLint i); -GLAPI void GLAPIENTRY glEvalPoint2 (GLint i, GLint j); -GLAPI void GLAPIENTRY glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer); -GLAPI void GLAPIENTRY glFinish (void); -GLAPI void GLAPIENTRY glFlush (void); -GLAPI void GLAPIENTRY glFogf (GLenum pname, GLfloat param); -GLAPI void GLAPIENTRY glFogfv (GLenum pname, const GLfloat *params); -GLAPI void GLAPIENTRY glFogi (GLenum pname, GLint param); -GLAPI void GLAPIENTRY glFogiv (GLenum pname, const GLint *params); -GLAPI void GLAPIENTRY glFrontFace (GLenum mode); -GLAPI void GLAPIENTRY glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -GLAPI GLuint GLAPIENTRY glGenLists (GLsizei range); -GLAPI void GLAPIENTRY glGenTextures (GLsizei n, GLuint *textures); -GLAPI void GLAPIENTRY glGetBooleanv (GLenum pname, GLboolean *params); -GLAPI void GLAPIENTRY glGetClipPlane (GLenum plane, GLdouble *equation); -GLAPI void GLAPIENTRY glGetDoublev (GLenum pname, GLdouble *params); -GLAPI GLenum GLAPIENTRY glGetError (void); -GLAPI void GLAPIENTRY glGetFloatv (GLenum pname, GLfloat *params); -GLAPI void GLAPIENTRY glGetIntegerv (GLenum pname, GLint *params); -GLAPI void GLAPIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params); -GLAPI void GLAPIENTRY glGetLightiv (GLenum light, GLenum pname, GLint *params); -GLAPI void GLAPIENTRY glGetMapdv (GLenum target, GLenum query, GLdouble *v); -GLAPI void GLAPIENTRY glGetMapfv (GLenum target, GLenum query, GLfloat *v); -GLAPI void GLAPIENTRY glGetMapiv (GLenum target, GLenum query, GLint *v); -GLAPI void GLAPIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params); -GLAPI void GLAPIENTRY glGetMaterialiv (GLenum face, GLenum pname, GLint *params); -GLAPI void GLAPIENTRY glGetPixelMapfv (GLenum map, GLfloat *values); -GLAPI void GLAPIENTRY glGetPixelMapuiv (GLenum map, GLuint *values); -GLAPI void GLAPIENTRY glGetPixelMapusv (GLenum map, GLushort *values); -GLAPI void GLAPIENTRY glGetPointerv (GLenum pname, void* *params); -GLAPI void GLAPIENTRY glGetPolygonStipple (GLubyte *mask); -GLAPI const GLubyte * GLAPIENTRY glGetString (GLenum name); -GLAPI void GLAPIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params); -GLAPI void GLAPIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params); -GLAPI void GLAPIENTRY glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params); -GLAPI void GLAPIENTRY glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params); -GLAPI void GLAPIENTRY glGetTexGeniv (GLenum coord, GLenum pname, GLint *params); -GLAPI void GLAPIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, void *pixels); -GLAPI void GLAPIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params); -GLAPI void GLAPIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params); -GLAPI void GLAPIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); -GLAPI void GLAPIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); -GLAPI void GLAPIENTRY glHint (GLenum target, GLenum mode); -GLAPI void GLAPIENTRY glIndexMask (GLuint mask); -GLAPI void GLAPIENTRY glIndexPointer (GLenum type, GLsizei stride, const void *pointer); -GLAPI void GLAPIENTRY glIndexd (GLdouble c); -GLAPI void GLAPIENTRY glIndexdv (const GLdouble *c); -GLAPI void GLAPIENTRY glIndexf (GLfloat c); -GLAPI void GLAPIENTRY glIndexfv (const GLfloat *c); -GLAPI void GLAPIENTRY glIndexi (GLint c); -GLAPI void GLAPIENTRY glIndexiv (const GLint *c); -GLAPI void GLAPIENTRY glIndexs (GLshort c); -GLAPI void GLAPIENTRY glIndexsv (const GLshort *c); -GLAPI void GLAPIENTRY glIndexub (GLubyte c); -GLAPI void GLAPIENTRY glIndexubv (const GLubyte *c); -GLAPI void GLAPIENTRY glInitNames (void); -GLAPI void GLAPIENTRY glInterleavedArrays (GLenum format, GLsizei stride, const void *pointer); -GLAPI GLboolean GLAPIENTRY glIsEnabled (GLenum cap); -GLAPI GLboolean GLAPIENTRY glIsList (GLuint list); -GLAPI GLboolean GLAPIENTRY glIsTexture (GLuint texture); -GLAPI void GLAPIENTRY glLightModelf (GLenum pname, GLfloat param); -GLAPI void GLAPIENTRY glLightModelfv (GLenum pname, const GLfloat *params); -GLAPI void GLAPIENTRY glLightModeli (GLenum pname, GLint param); -GLAPI void GLAPIENTRY glLightModeliv (GLenum pname, const GLint *params); -GLAPI void GLAPIENTRY glLightf (GLenum light, GLenum pname, GLfloat param); -GLAPI void GLAPIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params); -GLAPI void GLAPIENTRY glLighti (GLenum light, GLenum pname, GLint param); -GLAPI void GLAPIENTRY glLightiv (GLenum light, GLenum pname, const GLint *params); -GLAPI void GLAPIENTRY glLineStipple (GLint factor, GLushort pattern); -GLAPI void GLAPIENTRY glLineWidth (GLfloat width); -GLAPI void GLAPIENTRY glListBase (GLuint base); -GLAPI void GLAPIENTRY glLoadIdentity (void); -GLAPI void GLAPIENTRY glLoadMatrixd (const GLdouble *m); -GLAPI void GLAPIENTRY glLoadMatrixf (const GLfloat *m); -GLAPI void GLAPIENTRY glLoadName (GLuint name); -GLAPI void GLAPIENTRY glLogicOp (GLenum opcode); -GLAPI void GLAPIENTRY glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); -GLAPI void GLAPIENTRY glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); -GLAPI void GLAPIENTRY glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); -GLAPI void GLAPIENTRY glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); -GLAPI void GLAPIENTRY glMapGrid1d (GLint un, GLdouble u1, GLdouble u2); -GLAPI void GLAPIENTRY glMapGrid1f (GLint un, GLfloat u1, GLfloat u2); -GLAPI void GLAPIENTRY glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); -GLAPI void GLAPIENTRY glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); -GLAPI void GLAPIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param); -GLAPI void GLAPIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params); -GLAPI void GLAPIENTRY glMateriali (GLenum face, GLenum pname, GLint param); -GLAPI void GLAPIENTRY glMaterialiv (GLenum face, GLenum pname, const GLint *params); -GLAPI void GLAPIENTRY glMatrixMode (GLenum mode); -GLAPI void GLAPIENTRY glMultMatrixd (const GLdouble *m); -GLAPI void GLAPIENTRY glMultMatrixf (const GLfloat *m); -GLAPI void GLAPIENTRY glNewList (GLuint list, GLenum mode); -GLAPI void GLAPIENTRY glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz); -GLAPI void GLAPIENTRY glNormal3bv (const GLbyte *v); -GLAPI void GLAPIENTRY glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz); -GLAPI void GLAPIENTRY glNormal3dv (const GLdouble *v); -GLAPI void GLAPIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz); -GLAPI void GLAPIENTRY glNormal3fv (const GLfloat *v); -GLAPI void GLAPIENTRY glNormal3i (GLint nx, GLint ny, GLint nz); -GLAPI void GLAPIENTRY glNormal3iv (const GLint *v); -GLAPI void GLAPIENTRY glNormal3s (GLshort nx, GLshort ny, GLshort nz); -GLAPI void GLAPIENTRY glNormal3sv (const GLshort *v); -GLAPI void GLAPIENTRY glNormalPointer (GLenum type, GLsizei stride, const void *pointer); -GLAPI void GLAPIENTRY glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); -GLAPI void GLAPIENTRY glPassThrough (GLfloat token); -GLAPI void GLAPIENTRY glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat *values); -GLAPI void GLAPIENTRY glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint *values); -GLAPI void GLAPIENTRY glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort *values); -GLAPI void GLAPIENTRY glPixelStoref (GLenum pname, GLfloat param); -GLAPI void GLAPIENTRY glPixelStorei (GLenum pname, GLint param); -GLAPI void GLAPIENTRY glPixelTransferf (GLenum pname, GLfloat param); -GLAPI void GLAPIENTRY glPixelTransferi (GLenum pname, GLint param); -GLAPI void GLAPIENTRY glPixelZoom (GLfloat xfactor, GLfloat yfactor); -GLAPI void GLAPIENTRY glPointSize (GLfloat size); -GLAPI void GLAPIENTRY glPolygonMode (GLenum face, GLenum mode); -GLAPI void GLAPIENTRY glPolygonOffset (GLfloat factor, GLfloat units); -GLAPI void GLAPIENTRY glPolygonStipple (const GLubyte *mask); -GLAPI void GLAPIENTRY glPopAttrib (void); -GLAPI void GLAPIENTRY glPopClientAttrib (void); -GLAPI void GLAPIENTRY glPopMatrix (void); -GLAPI void GLAPIENTRY glPopName (void); -GLAPI void GLAPIENTRY glPrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities); -GLAPI void GLAPIENTRY glPushAttrib (GLbitfield mask); -GLAPI void GLAPIENTRY glPushClientAttrib (GLbitfield mask); -GLAPI void GLAPIENTRY glPushMatrix (void); -GLAPI void GLAPIENTRY glPushName (GLuint name); -GLAPI void GLAPIENTRY glRasterPos2d (GLdouble x, GLdouble y); -GLAPI void GLAPIENTRY glRasterPos2dv (const GLdouble *v); -GLAPI void GLAPIENTRY glRasterPos2f (GLfloat x, GLfloat y); -GLAPI void GLAPIENTRY glRasterPos2fv (const GLfloat *v); -GLAPI void GLAPIENTRY glRasterPos2i (GLint x, GLint y); -GLAPI void GLAPIENTRY glRasterPos2iv (const GLint *v); -GLAPI void GLAPIENTRY glRasterPos2s (GLshort x, GLshort y); -GLAPI void GLAPIENTRY glRasterPos2sv (const GLshort *v); -GLAPI void GLAPIENTRY glRasterPos3d (GLdouble x, GLdouble y, GLdouble z); -GLAPI void GLAPIENTRY glRasterPos3dv (const GLdouble *v); -GLAPI void GLAPIENTRY glRasterPos3f (GLfloat x, GLfloat y, GLfloat z); -GLAPI void GLAPIENTRY glRasterPos3fv (const GLfloat *v); -GLAPI void GLAPIENTRY glRasterPos3i (GLint x, GLint y, GLint z); -GLAPI void GLAPIENTRY glRasterPos3iv (const GLint *v); -GLAPI void GLAPIENTRY glRasterPos3s (GLshort x, GLshort y, GLshort z); -GLAPI void GLAPIENTRY glRasterPos3sv (const GLshort *v); -GLAPI void GLAPIENTRY glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void GLAPIENTRY glRasterPos4dv (const GLdouble *v); -GLAPI void GLAPIENTRY glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void GLAPIENTRY glRasterPos4fv (const GLfloat *v); -GLAPI void GLAPIENTRY glRasterPos4i (GLint x, GLint y, GLint z, GLint w); -GLAPI void GLAPIENTRY glRasterPos4iv (const GLint *v); -GLAPI void GLAPIENTRY glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void GLAPIENTRY glRasterPos4sv (const GLshort *v); -GLAPI void GLAPIENTRY glReadBuffer (GLenum mode); -GLAPI void GLAPIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels); -GLAPI void GLAPIENTRY glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); -GLAPI void GLAPIENTRY glRectdv (const GLdouble *v1, const GLdouble *v2); -GLAPI void GLAPIENTRY glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); -GLAPI void GLAPIENTRY glRectfv (const GLfloat *v1, const GLfloat *v2); -GLAPI void GLAPIENTRY glRecti (GLint x1, GLint y1, GLint x2, GLint y2); -GLAPI void GLAPIENTRY glRectiv (const GLint *v1, const GLint *v2); -GLAPI void GLAPIENTRY glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2); -GLAPI void GLAPIENTRY glRectsv (const GLshort *v1, const GLshort *v2); -GLAPI GLint GLAPIENTRY glRenderMode (GLenum mode); -GLAPI void GLAPIENTRY glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z); -GLAPI void GLAPIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -GLAPI void GLAPIENTRY glScaled (GLdouble x, GLdouble y, GLdouble z); -GLAPI void GLAPIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z); -GLAPI void GLAPIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); -GLAPI void GLAPIENTRY glSelectBuffer (GLsizei size, GLuint *buffer); -GLAPI void GLAPIENTRY glShadeModel (GLenum mode); -GLAPI void GLAPIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); -GLAPI void GLAPIENTRY glStencilMask (GLuint mask); -GLAPI void GLAPIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); -GLAPI void GLAPIENTRY glTexCoord1d (GLdouble s); -GLAPI void GLAPIENTRY glTexCoord1dv (const GLdouble *v); -GLAPI void GLAPIENTRY glTexCoord1f (GLfloat s); -GLAPI void GLAPIENTRY glTexCoord1fv (const GLfloat *v); -GLAPI void GLAPIENTRY glTexCoord1i (GLint s); -GLAPI void GLAPIENTRY glTexCoord1iv (const GLint *v); -GLAPI void GLAPIENTRY glTexCoord1s (GLshort s); -GLAPI void GLAPIENTRY glTexCoord1sv (const GLshort *v); -GLAPI void GLAPIENTRY glTexCoord2d (GLdouble s, GLdouble t); -GLAPI void GLAPIENTRY glTexCoord2dv (const GLdouble *v); -GLAPI void GLAPIENTRY glTexCoord2f (GLfloat s, GLfloat t); -GLAPI void GLAPIENTRY glTexCoord2fv (const GLfloat *v); -GLAPI void GLAPIENTRY glTexCoord2i (GLint s, GLint t); -GLAPI void GLAPIENTRY glTexCoord2iv (const GLint *v); -GLAPI void GLAPIENTRY glTexCoord2s (GLshort s, GLshort t); -GLAPI void GLAPIENTRY glTexCoord2sv (const GLshort *v); -GLAPI void GLAPIENTRY glTexCoord3d (GLdouble s, GLdouble t, GLdouble r); -GLAPI void GLAPIENTRY glTexCoord3dv (const GLdouble *v); -GLAPI void GLAPIENTRY glTexCoord3f (GLfloat s, GLfloat t, GLfloat r); -GLAPI void GLAPIENTRY glTexCoord3fv (const GLfloat *v); -GLAPI void GLAPIENTRY glTexCoord3i (GLint s, GLint t, GLint r); -GLAPI void GLAPIENTRY glTexCoord3iv (const GLint *v); -GLAPI void GLAPIENTRY glTexCoord3s (GLshort s, GLshort t, GLshort r); -GLAPI void GLAPIENTRY glTexCoord3sv (const GLshort *v); -GLAPI void GLAPIENTRY glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q); -GLAPI void GLAPIENTRY glTexCoord4dv (const GLdouble *v); -GLAPI void GLAPIENTRY glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q); -GLAPI void GLAPIENTRY glTexCoord4fv (const GLfloat *v); -GLAPI void GLAPIENTRY glTexCoord4i (GLint s, GLint t, GLint r, GLint q); -GLAPI void GLAPIENTRY glTexCoord4iv (const GLint *v); -GLAPI void GLAPIENTRY glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q); -GLAPI void GLAPIENTRY glTexCoord4sv (const GLshort *v); -GLAPI void GLAPIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); -GLAPI void GLAPIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param); -GLAPI void GLAPIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void GLAPIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param); -GLAPI void GLAPIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params); -GLAPI void GLAPIENTRY glTexGend (GLenum coord, GLenum pname, GLdouble param); -GLAPI void GLAPIENTRY glTexGendv (GLenum coord, GLenum pname, const GLdouble *params); -GLAPI void GLAPIENTRY glTexGenf (GLenum coord, GLenum pname, GLfloat param); -GLAPI void GLAPIENTRY glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params); -GLAPI void GLAPIENTRY glTexGeni (GLenum coord, GLenum pname, GLint param); -GLAPI void GLAPIENTRY glTexGeniv (GLenum coord, GLenum pname, const GLint *params); -GLAPI void GLAPIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void GLAPIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -GLAPI void GLAPIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); -GLAPI void GLAPIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); -GLAPI void GLAPIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); -GLAPI void GLAPIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); -GLAPI void GLAPIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -GLAPI void GLAPIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -GLAPI void GLAPIENTRY glTranslated (GLdouble x, GLdouble y, GLdouble z); -GLAPI void GLAPIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z); -GLAPI void GLAPIENTRY glVertex2d (GLdouble x, GLdouble y); -GLAPI void GLAPIENTRY glVertex2dv (const GLdouble *v); -GLAPI void GLAPIENTRY glVertex2f (GLfloat x, GLfloat y); -GLAPI void GLAPIENTRY glVertex2fv (const GLfloat *v); -GLAPI void GLAPIENTRY glVertex2i (GLint x, GLint y); -GLAPI void GLAPIENTRY glVertex2iv (const GLint *v); -GLAPI void GLAPIENTRY glVertex2s (GLshort x, GLshort y); -GLAPI void GLAPIENTRY glVertex2sv (const GLshort *v); -GLAPI void GLAPIENTRY glVertex3d (GLdouble x, GLdouble y, GLdouble z); -GLAPI void GLAPIENTRY glVertex3dv (const GLdouble *v); -GLAPI void GLAPIENTRY glVertex3f (GLfloat x, GLfloat y, GLfloat z); -GLAPI void GLAPIENTRY glVertex3fv (const GLfloat *v); -GLAPI void GLAPIENTRY glVertex3i (GLint x, GLint y, GLint z); -GLAPI void GLAPIENTRY glVertex3iv (const GLint *v); -GLAPI void GLAPIENTRY glVertex3s (GLshort x, GLshort y, GLshort z); -GLAPI void GLAPIENTRY glVertex3sv (const GLshort *v); -GLAPI void GLAPIENTRY glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); -GLAPI void GLAPIENTRY glVertex4dv (const GLdouble *v); -GLAPI void GLAPIENTRY glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -GLAPI void GLAPIENTRY glVertex4fv (const GLfloat *v); -GLAPI void GLAPIENTRY glVertex4i (GLint x, GLint y, GLint z, GLint w); -GLAPI void GLAPIENTRY glVertex4iv (const GLint *v); -GLAPI void GLAPIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w); -GLAPI void GLAPIENTRY glVertex4sv (const GLshort *v); -GLAPI void GLAPIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); -GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); - -#define GLEW_VERSION_1_1 GLEW_GET_VAR(__GLEW_VERSION_1_1) - -#endif /* GL_VERSION_1_1 */ - -/* ---------------------------------- GLU ---------------------------------- */ - -#ifndef GLEW_NO_GLU -# ifdef __APPLE__ -# include <Availability.h> -# if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) -# define GLEW_NO_GLU -# endif -# endif -#endif - -#ifndef GLEW_NO_GLU -/* this is where we can safely include GLU */ -# if defined(__APPLE__) && defined(__MACH__) -# include <OpenGL/glu.h> -# else -# include <GL/glu.h> -# endif -#endif - -/* ----------------------------- GL_VERSION_1_2 ---------------------------- */ - -#ifndef GL_VERSION_1_2 -#define GL_VERSION_1_2 1 - -#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 -#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 -#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_UNSIGNED_BYTE_3_3_2 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2 0x8036 -#define GL_RESCALE_NORMAL 0x803A -#define GL_TEXTURE_BINDING_3D 0x806A -#define GL_PACK_SKIP_IMAGES 0x806B -#define GL_PACK_IMAGE_HEIGHT 0x806C -#define GL_UNPACK_SKIP_IMAGES 0x806D -#define GL_UNPACK_IMAGE_HEIGHT 0x806E -#define GL_TEXTURE_3D 0x806F -#define GL_PROXY_TEXTURE_3D 0x8070 -#define GL_TEXTURE_DEPTH 0x8071 -#define GL_TEXTURE_WRAP_R 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE 0x8073 -#define GL_BGR 0x80E0 -#define GL_BGRA 0x80E1 -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_ELEMENTS_INDICES 0x80E9 -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_TEXTURE_MIN_LOD 0x813A -#define GL_TEXTURE_MAX_LOD 0x813B -#define GL_TEXTURE_BASE_LEVEL 0x813C -#define GL_TEXTURE_MAX_LEVEL 0x813D -#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 -#define GL_SINGLE_COLOR 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR 0x81FA -#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 -#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 -#define GL_ALIASED_POINT_SIZE_RANGE 0x846D -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E - -typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); -typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); - -#define glCopyTexSubImage3D GLEW_GET_FUN(__glewCopyTexSubImage3D) -#define glDrawRangeElements GLEW_GET_FUN(__glewDrawRangeElements) -#define glTexImage3D GLEW_GET_FUN(__glewTexImage3D) -#define glTexSubImage3D GLEW_GET_FUN(__glewTexSubImage3D) - -#define GLEW_VERSION_1_2 GLEW_GET_VAR(__GLEW_VERSION_1_2) - -#endif /* GL_VERSION_1_2 */ - -/* ---------------------------- GL_VERSION_1_2_1 --------------------------- */ - -#ifndef GL_VERSION_1_2_1 -#define GL_VERSION_1_2_1 1 - -#define GLEW_VERSION_1_2_1 GLEW_GET_VAR(__GLEW_VERSION_1_2_1) - -#endif /* GL_VERSION_1_2_1 */ - -/* ----------------------------- GL_VERSION_1_3 ---------------------------- */ - -#ifndef GL_VERSION_1_3 -#define GL_VERSION_1_3 1 - -#define GL_MULTISAMPLE 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE 0x809F -#define GL_SAMPLE_COVERAGE 0x80A0 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_CLAMP_TO_BORDER 0x812D -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 -#define GL_MAX_TEXTURE_UNITS 0x84E2 -#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 -#define GL_SUBTRACT 0x84E7 -#define GL_COMPRESSED_ALPHA 0x84E9 -#define GL_COMPRESSED_LUMINANCE 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB -#define GL_COMPRESSED_INTENSITY 0x84EC -#define GL_COMPRESSED_RGB 0x84ED -#define GL_COMPRESSED_RGBA 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT 0x84EF -#define GL_NORMAL_MAP 0x8511 -#define GL_REFLECTION_MAP 0x8512 -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -#define GL_COMBINE 0x8570 -#define GL_COMBINE_RGB 0x8571 -#define GL_COMBINE_ALPHA 0x8572 -#define GL_RGB_SCALE 0x8573 -#define GL_ADD_SIGNED 0x8574 -#define GL_INTERPOLATE 0x8575 -#define GL_CONSTANT 0x8576 -#define GL_PRIMARY_COLOR 0x8577 -#define GL_PREVIOUS 0x8578 -#define GL_SOURCE0_RGB 0x8580 -#define GL_SOURCE1_RGB 0x8581 -#define GL_SOURCE2_RGB 0x8582 -#define GL_SOURCE0_ALPHA 0x8588 -#define GL_SOURCE1_ALPHA 0x8589 -#define GL_SOURCE2_ALPHA 0x858A -#define GL_OPERAND0_RGB 0x8590 -#define GL_OPERAND1_RGB 0x8591 -#define GL_OPERAND2_RGB 0x8592 -#define GL_OPERAND0_ALPHA 0x8598 -#define GL_OPERAND1_ALPHA 0x8599 -#define GL_OPERAND2_ALPHA 0x859A -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 -#define GL_TEXTURE_COMPRESSED 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 -#define GL_DOT3_RGB 0x86AE -#define GL_DOT3_RGBA 0x86AF -#define GL_MULTISAMPLE_BIT 0x20000000 - -typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); -typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, void *img); -typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); -typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); -typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); -typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); -typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); - -#define glActiveTexture GLEW_GET_FUN(__glewActiveTexture) -#define glClientActiveTexture GLEW_GET_FUN(__glewClientActiveTexture) -#define glCompressedTexImage1D GLEW_GET_FUN(__glewCompressedTexImage1D) -#define glCompressedTexImage2D GLEW_GET_FUN(__glewCompressedTexImage2D) -#define glCompressedTexImage3D GLEW_GET_FUN(__glewCompressedTexImage3D) -#define glCompressedTexSubImage1D GLEW_GET_FUN(__glewCompressedTexSubImage1D) -#define glCompressedTexSubImage2D GLEW_GET_FUN(__glewCompressedTexSubImage2D) -#define glCompressedTexSubImage3D GLEW_GET_FUN(__glewCompressedTexSubImage3D) -#define glGetCompressedTexImage GLEW_GET_FUN(__glewGetCompressedTexImage) -#define glLoadTransposeMatrixd GLEW_GET_FUN(__glewLoadTransposeMatrixd) -#define glLoadTransposeMatrixf GLEW_GET_FUN(__glewLoadTransposeMatrixf) -#define glMultTransposeMatrixd GLEW_GET_FUN(__glewMultTransposeMatrixd) -#define glMultTransposeMatrixf GLEW_GET_FUN(__glewMultTransposeMatrixf) -#define glMultiTexCoord1d GLEW_GET_FUN(__glewMultiTexCoord1d) -#define glMultiTexCoord1dv GLEW_GET_FUN(__glewMultiTexCoord1dv) -#define glMultiTexCoord1f GLEW_GET_FUN(__glewMultiTexCoord1f) -#define glMultiTexCoord1fv GLEW_GET_FUN(__glewMultiTexCoord1fv) -#define glMultiTexCoord1i GLEW_GET_FUN(__glewMultiTexCoord1i) -#define glMultiTexCoord1iv GLEW_GET_FUN(__glewMultiTexCoord1iv) -#define glMultiTexCoord1s GLEW_GET_FUN(__glewMultiTexCoord1s) -#define glMultiTexCoord1sv GLEW_GET_FUN(__glewMultiTexCoord1sv) -#define glMultiTexCoord2d GLEW_GET_FUN(__glewMultiTexCoord2d) -#define glMultiTexCoord2dv GLEW_GET_FUN(__glewMultiTexCoord2dv) -#define glMultiTexCoord2f GLEW_GET_FUN(__glewMultiTexCoord2f) -#define glMultiTexCoord2fv GLEW_GET_FUN(__glewMultiTexCoord2fv) -#define glMultiTexCoord2i GLEW_GET_FUN(__glewMultiTexCoord2i) -#define glMultiTexCoord2iv GLEW_GET_FUN(__glewMultiTexCoord2iv) -#define glMultiTexCoord2s GLEW_GET_FUN(__glewMultiTexCoord2s) -#define glMultiTexCoord2sv GLEW_GET_FUN(__glewMultiTexCoord2sv) -#define glMultiTexCoord3d GLEW_GET_FUN(__glewMultiTexCoord3d) -#define glMultiTexCoord3dv GLEW_GET_FUN(__glewMultiTexCoord3dv) -#define glMultiTexCoord3f GLEW_GET_FUN(__glewMultiTexCoord3f) -#define glMultiTexCoord3fv GLEW_GET_FUN(__glewMultiTexCoord3fv) -#define glMultiTexCoord3i GLEW_GET_FUN(__glewMultiTexCoord3i) -#define glMultiTexCoord3iv GLEW_GET_FUN(__glewMultiTexCoord3iv) -#define glMultiTexCoord3s GLEW_GET_FUN(__glewMultiTexCoord3s) -#define glMultiTexCoord3sv GLEW_GET_FUN(__glewMultiTexCoord3sv) -#define glMultiTexCoord4d GLEW_GET_FUN(__glewMultiTexCoord4d) -#define glMultiTexCoord4dv GLEW_GET_FUN(__glewMultiTexCoord4dv) -#define glMultiTexCoord4f GLEW_GET_FUN(__glewMultiTexCoord4f) -#define glMultiTexCoord4fv GLEW_GET_FUN(__glewMultiTexCoord4fv) -#define glMultiTexCoord4i GLEW_GET_FUN(__glewMultiTexCoord4i) -#define glMultiTexCoord4iv GLEW_GET_FUN(__glewMultiTexCoord4iv) -#define glMultiTexCoord4s GLEW_GET_FUN(__glewMultiTexCoord4s) -#define glMultiTexCoord4sv GLEW_GET_FUN(__glewMultiTexCoord4sv) -#define glSampleCoverage GLEW_GET_FUN(__glewSampleCoverage) - -#define GLEW_VERSION_1_3 GLEW_GET_VAR(__GLEW_VERSION_1_3) - -#endif /* GL_VERSION_1_3 */ - -/* ----------------------------- GL_VERSION_1_4 ---------------------------- */ - -#ifndef GL_VERSION_1_4 -#define GL_VERSION_1_4 1 - -#define GL_BLEND_DST_RGB 0x80C8 -#define GL_BLEND_SRC_RGB 0x80C9 -#define GL_BLEND_DST_ALPHA 0x80CA -#define GL_BLEND_SRC_ALPHA 0x80CB -#define GL_POINT_SIZE_MIN 0x8126 -#define GL_POINT_SIZE_MAX 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 -#define GL_POINT_DISTANCE_ATTENUATION 0x8129 -#define GL_GENERATE_MIPMAP 0x8191 -#define GL_GENERATE_MIPMAP_HINT 0x8192 -#define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_DEPTH_COMPONENT24 0x81A6 -#define GL_DEPTH_COMPONENT32 0x81A7 -#define GL_MIRRORED_REPEAT 0x8370 -#define GL_FOG_COORDINATE_SOURCE 0x8450 -#define GL_FOG_COORDINATE 0x8451 -#define GL_FRAGMENT_DEPTH 0x8452 -#define GL_CURRENT_FOG_COORDINATE 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 -#define GL_FOG_COORDINATE_ARRAY 0x8457 -#define GL_COLOR_SUM 0x8458 -#define GL_CURRENT_SECONDARY_COLOR 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D -#define GL_SECONDARY_COLOR_ARRAY 0x845E -#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD -#define GL_TEXTURE_FILTER_CONTROL 0x8500 -#define GL_TEXTURE_LOD_BIAS 0x8501 -#define GL_INCR_WRAP 0x8507 -#define GL_DECR_WRAP 0x8508 -#define GL_TEXTURE_DEPTH_SIZE 0x884A -#define GL_DEPTH_TEXTURE_MODE 0x884B -#define GL_TEXTURE_COMPARE_MODE 0x884C -#define GL_TEXTURE_COMPARE_FUNC 0x884D -#define GL_COMPARE_R_TO_TEXTURE 0x884E - -typedef void (GLAPIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode); -typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const void *pointer); -typedef void (GLAPIENTRY * PFNGLFOGCOORDDPROC) (GLdouble coord); -typedef void (GLAPIENTRY * PFNGLFOGCOORDDVPROC) (const GLdouble *coord); -typedef void (GLAPIENTRY * PFNGLFOGCOORDFPROC) (GLfloat coord); -typedef void (GLAPIENTRY * PFNGLFOGCOORDFVPROC) (const GLfloat *coord); -typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); -typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const* indices, GLsizei drawcount); -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVPROC) (const GLdouble *p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVPROC) (const GLfloat *p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVPROC) (const GLint *p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVPROC) (const GLshort *p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVPROC) (const GLdouble *p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVPROC) (const GLfloat *p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVPROC) (const GLint *p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVPROC) (const GLshort *p); - -#define glBlendColor GLEW_GET_FUN(__glewBlendColor) -#define glBlendEquation GLEW_GET_FUN(__glewBlendEquation) -#define glBlendFuncSeparate GLEW_GET_FUN(__glewBlendFuncSeparate) -#define glFogCoordPointer GLEW_GET_FUN(__glewFogCoordPointer) -#define glFogCoordd GLEW_GET_FUN(__glewFogCoordd) -#define glFogCoorddv GLEW_GET_FUN(__glewFogCoorddv) -#define glFogCoordf GLEW_GET_FUN(__glewFogCoordf) -#define glFogCoordfv GLEW_GET_FUN(__glewFogCoordfv) -#define glMultiDrawArrays GLEW_GET_FUN(__glewMultiDrawArrays) -#define glMultiDrawElements GLEW_GET_FUN(__glewMultiDrawElements) -#define glPointParameterf GLEW_GET_FUN(__glewPointParameterf) -#define glPointParameterfv GLEW_GET_FUN(__glewPointParameterfv) -#define glPointParameteri GLEW_GET_FUN(__glewPointParameteri) -#define glPointParameteriv GLEW_GET_FUN(__glewPointParameteriv) -#define glSecondaryColor3b GLEW_GET_FUN(__glewSecondaryColor3b) -#define glSecondaryColor3bv GLEW_GET_FUN(__glewSecondaryColor3bv) -#define glSecondaryColor3d GLEW_GET_FUN(__glewSecondaryColor3d) -#define glSecondaryColor3dv GLEW_GET_FUN(__glewSecondaryColor3dv) -#define glSecondaryColor3f GLEW_GET_FUN(__glewSecondaryColor3f) -#define glSecondaryColor3fv GLEW_GET_FUN(__glewSecondaryColor3fv) -#define glSecondaryColor3i GLEW_GET_FUN(__glewSecondaryColor3i) -#define glSecondaryColor3iv GLEW_GET_FUN(__glewSecondaryColor3iv) -#define glSecondaryColor3s GLEW_GET_FUN(__glewSecondaryColor3s) -#define glSecondaryColor3sv GLEW_GET_FUN(__glewSecondaryColor3sv) -#define glSecondaryColor3ub GLEW_GET_FUN(__glewSecondaryColor3ub) -#define glSecondaryColor3ubv GLEW_GET_FUN(__glewSecondaryColor3ubv) -#define glSecondaryColor3ui GLEW_GET_FUN(__glewSecondaryColor3ui) -#define glSecondaryColor3uiv GLEW_GET_FUN(__glewSecondaryColor3uiv) -#define glSecondaryColor3us GLEW_GET_FUN(__glewSecondaryColor3us) -#define glSecondaryColor3usv GLEW_GET_FUN(__glewSecondaryColor3usv) -#define glSecondaryColorPointer GLEW_GET_FUN(__glewSecondaryColorPointer) -#define glWindowPos2d GLEW_GET_FUN(__glewWindowPos2d) -#define glWindowPos2dv GLEW_GET_FUN(__glewWindowPos2dv) -#define glWindowPos2f GLEW_GET_FUN(__glewWindowPos2f) -#define glWindowPos2fv GLEW_GET_FUN(__glewWindowPos2fv) -#define glWindowPos2i GLEW_GET_FUN(__glewWindowPos2i) -#define glWindowPos2iv GLEW_GET_FUN(__glewWindowPos2iv) -#define glWindowPos2s GLEW_GET_FUN(__glewWindowPos2s) -#define glWindowPos2sv GLEW_GET_FUN(__glewWindowPos2sv) -#define glWindowPos3d GLEW_GET_FUN(__glewWindowPos3d) -#define glWindowPos3dv GLEW_GET_FUN(__glewWindowPos3dv) -#define glWindowPos3f GLEW_GET_FUN(__glewWindowPos3f) -#define glWindowPos3fv GLEW_GET_FUN(__glewWindowPos3fv) -#define glWindowPos3i GLEW_GET_FUN(__glewWindowPos3i) -#define glWindowPos3iv GLEW_GET_FUN(__glewWindowPos3iv) -#define glWindowPos3s GLEW_GET_FUN(__glewWindowPos3s) -#define glWindowPos3sv GLEW_GET_FUN(__glewWindowPos3sv) - -#define GLEW_VERSION_1_4 GLEW_GET_VAR(__GLEW_VERSION_1_4) - -#endif /* GL_VERSION_1_4 */ - -/* ----------------------------- GL_VERSION_1_5 ---------------------------- */ - -#ifndef GL_VERSION_1_5 -#define GL_VERSION_1_5 1 - -#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE -#define GL_FOG_COORD GL_FOG_COORDINATE -#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY -#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING -#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER -#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE -#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE -#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE -#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA -#define GL_SRC0_RGB GL_SOURCE0_RGB -#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA -#define GL_SRC1_RGB GL_SOURCE1_RGB -#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA -#define GL_SRC2_RGB GL_SOURCE2_RGB -#define GL_BUFFER_SIZE 0x8764 -#define GL_BUFFER_USAGE 0x8765 -#define GL_QUERY_COUNTER_BITS 0x8864 -#define GL_CURRENT_QUERY 0x8865 -#define GL_QUERY_RESULT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE 0x8867 -#define GL_ARRAY_BUFFER 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER 0x8893 -#define GL_ARRAY_BUFFER_BINDING 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F -#define GL_READ_ONLY 0x88B8 -#define GL_WRITE_ONLY 0x88B9 -#define GL_READ_WRITE 0x88BA -#define GL_BUFFER_ACCESS 0x88BB -#define GL_BUFFER_MAPPED 0x88BC -#define GL_BUFFER_MAP_POINTER 0x88BD -#define GL_STREAM_DRAW 0x88E0 -#define GL_STREAM_READ 0x88E1 -#define GL_STREAM_COPY 0x88E2 -#define GL_STATIC_DRAW 0x88E4 -#define GL_STATIC_READ 0x88E5 -#define GL_STATIC_COPY 0x88E6 -#define GL_DYNAMIC_DRAW 0x88E8 -#define GL_DYNAMIC_READ 0x88E9 -#define GL_DYNAMIC_COPY 0x88EA -#define GL_SAMPLES_PASSED 0x8914 - -typedef ptrdiff_t GLintptr; -typedef ptrdiff_t GLsizeiptr; - -typedef void (GLAPIENTRY * PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); -typedef void (GLAPIENTRY * PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); -typedef void (GLAPIENTRY * PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void* data, GLenum usage); -typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void* data); -typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint* buffers); -typedef void (GLAPIENTRY * PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint* ids); -typedef void (GLAPIENTRY * PFNGLENDQUERYPROC) (GLenum target); -typedef void (GLAPIENTRY * PFNGLGENBUFFERSPROC) (GLsizei n, GLuint* buffers); -typedef void (GLAPIENTRY * PFNGLGENQUERIESPROC) (GLsizei n, GLuint* ids); -typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, void** params); -typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, void* data); -typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint* params); -typedef void (GLAPIENTRY * PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint* params); -typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERPROC) (GLuint buffer); -typedef GLboolean (GLAPIENTRY * PFNGLISQUERYPROC) (GLuint id); -typedef void* (GLAPIENTRY * PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); -typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERPROC) (GLenum target); - -#define glBeginQuery GLEW_GET_FUN(__glewBeginQuery) -#define glBindBuffer GLEW_GET_FUN(__glewBindBuffer) -#define glBufferData GLEW_GET_FUN(__glewBufferData) -#define glBufferSubData GLEW_GET_FUN(__glewBufferSubData) -#define glDeleteBuffers GLEW_GET_FUN(__glewDeleteBuffers) -#define glDeleteQueries GLEW_GET_FUN(__glewDeleteQueries) -#define glEndQuery GLEW_GET_FUN(__glewEndQuery) -#define glGenBuffers GLEW_GET_FUN(__glewGenBuffers) -#define glGenQueries GLEW_GET_FUN(__glewGenQueries) -#define glGetBufferParameteriv GLEW_GET_FUN(__glewGetBufferParameteriv) -#define glGetBufferPointerv GLEW_GET_FUN(__glewGetBufferPointerv) -#define glGetBufferSubData GLEW_GET_FUN(__glewGetBufferSubData) -#define glGetQueryObjectiv GLEW_GET_FUN(__glewGetQueryObjectiv) -#define glGetQueryObjectuiv GLEW_GET_FUN(__glewGetQueryObjectuiv) -#define glGetQueryiv GLEW_GET_FUN(__glewGetQueryiv) -#define glIsBuffer GLEW_GET_FUN(__glewIsBuffer) -#define glIsQuery GLEW_GET_FUN(__glewIsQuery) -#define glMapBuffer GLEW_GET_FUN(__glewMapBuffer) -#define glUnmapBuffer GLEW_GET_FUN(__glewUnmapBuffer) - -#define GLEW_VERSION_1_5 GLEW_GET_VAR(__GLEW_VERSION_1_5) - -#endif /* GL_VERSION_1_5 */ - -/* ----------------------------- GL_VERSION_2_0 ---------------------------- */ - -#ifndef GL_VERSION_2_0 -#define GL_VERSION_2_0 1 - -#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB 0x8626 -#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 -#define GL_STENCIL_BACK_FUNC 0x8800 -#define GL_STENCIL_BACK_FAIL 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 -#define GL_MAX_DRAW_BUFFERS 0x8824 -#define GL_DRAW_BUFFER0 0x8825 -#define GL_DRAW_BUFFER1 0x8826 -#define GL_DRAW_BUFFER2 0x8827 -#define GL_DRAW_BUFFER3 0x8828 -#define GL_DRAW_BUFFER4 0x8829 -#define GL_DRAW_BUFFER5 0x882A -#define GL_DRAW_BUFFER6 0x882B -#define GL_DRAW_BUFFER7 0x882C -#define GL_DRAW_BUFFER8 0x882D -#define GL_DRAW_BUFFER9 0x882E -#define GL_DRAW_BUFFER10 0x882F -#define GL_DRAW_BUFFER11 0x8830 -#define GL_DRAW_BUFFER12 0x8831 -#define GL_DRAW_BUFFER13 0x8832 -#define GL_DRAW_BUFFER14 0x8833 -#define GL_DRAW_BUFFER15 0x8834 -#define GL_BLEND_EQUATION_ALPHA 0x883D -#define GL_POINT_SPRITE 0x8861 -#define GL_COORD_REPLACE 0x8862 -#define GL_MAX_VERTEX_ATTRIBS 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A -#define GL_MAX_TEXTURE_COORDS 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A -#define GL_MAX_VARYING_FLOATS 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D -#define GL_SHADER_TYPE 0x8B4F -#define GL_FLOAT_VEC2 0x8B50 -#define GL_FLOAT_VEC3 0x8B51 -#define GL_FLOAT_VEC4 0x8B52 -#define GL_INT_VEC2 0x8B53 -#define GL_INT_VEC3 0x8B54 -#define GL_INT_VEC4 0x8B55 -#define GL_BOOL 0x8B56 -#define GL_BOOL_VEC2 0x8B57 -#define GL_BOOL_VEC3 0x8B58 -#define GL_BOOL_VEC4 0x8B59 -#define GL_FLOAT_MAT2 0x8B5A -#define GL_FLOAT_MAT3 0x8B5B -#define GL_FLOAT_MAT4 0x8B5C -#define GL_SAMPLER_1D 0x8B5D -#define GL_SAMPLER_2D 0x8B5E -#define GL_SAMPLER_3D 0x8B5F -#define GL_SAMPLER_CUBE 0x8B60 -#define GL_SAMPLER_1D_SHADOW 0x8B61 -#define GL_SAMPLER_2D_SHADOW 0x8B62 -#define GL_DELETE_STATUS 0x8B80 -#define GL_COMPILE_STATUS 0x8B81 -#define GL_LINK_STATUS 0x8B82 -#define GL_VALIDATE_STATUS 0x8B83 -#define GL_INFO_LOG_LENGTH 0x8B84 -#define GL_ATTACHED_SHADERS 0x8B85 -#define GL_ACTIVE_UNIFORMS 0x8B86 -#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 -#define GL_SHADER_SOURCE_LENGTH 0x8B88 -#define GL_ACTIVE_ATTRIBUTES 0x8B89 -#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B -#define GL_SHADING_LANGUAGE_VERSION 0x8B8C -#define GL_CURRENT_PROGRAM 0x8B8D -#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 -#define GL_LOWER_LEFT 0x8CA1 -#define GL_UPPER_LEFT 0x8CA2 -#define GL_STENCIL_BACK_REF 0x8CA3 -#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 -#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 - -typedef void (GLAPIENTRY * PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar* name); -typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); -typedef void (GLAPIENTRY * PFNGLCOMPILESHADERPROC) (GLuint shader); -typedef GLuint (GLAPIENTRY * PFNGLCREATEPROGRAMPROC) (void); -typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROC) (GLenum type); -typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPROC) (GLuint program); -typedef void (GLAPIENTRY * PFNGLDELETESHADERPROC) (GLuint shader); -typedef void (GLAPIENTRY * PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum* bufs); -typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); -typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); -typedef void (GLAPIENTRY * PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders); -typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar* name); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint* param); -typedef void (GLAPIENTRY * PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog); -typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEPROC) (GLuint obj, GLsizei maxLength, GLsizei* length, GLchar* source); -typedef void (GLAPIENTRY * PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint* param); -typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar* name); -typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void** pointer); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint* params); -typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPROC) (GLuint program); -typedef GLboolean (GLAPIENTRY * PFNGLISSHADERPROC) (GLuint shader); -typedef void (GLAPIENTRY * PFNGLLINKPROGRAMPROC) (GLuint program); -typedef void (GLAPIENTRY * PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const* string, const GLint* length); -typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -typedef void (GLAPIENTRY * PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); -typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (GLAPIENTRY * PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); -typedef void (GLAPIENTRY * PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM1IPROC) (GLint location, GLint v0); -typedef void (GLAPIENTRY * PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (GLAPIENTRY * PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); -typedef void (GLAPIENTRY * PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (GLAPIENTRY * PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (GLAPIENTRY * PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (GLAPIENTRY * PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (GLAPIENTRY * PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUSEPROGRAMPROC) (GLuint program); -typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPROC) (GLuint program); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer); - -#define glAttachShader GLEW_GET_FUN(__glewAttachShader) -#define glBindAttribLocation GLEW_GET_FUN(__glewBindAttribLocation) -#define glBlendEquationSeparate GLEW_GET_FUN(__glewBlendEquationSeparate) -#define glCompileShader GLEW_GET_FUN(__glewCompileShader) -#define glCreateProgram GLEW_GET_FUN(__glewCreateProgram) -#define glCreateShader GLEW_GET_FUN(__glewCreateShader) -#define glDeleteProgram GLEW_GET_FUN(__glewDeleteProgram) -#define glDeleteShader GLEW_GET_FUN(__glewDeleteShader) -#define glDetachShader GLEW_GET_FUN(__glewDetachShader) -#define glDisableVertexAttribArray GLEW_GET_FUN(__glewDisableVertexAttribArray) -#define glDrawBuffers GLEW_GET_FUN(__glewDrawBuffers) -#define glEnableVertexAttribArray GLEW_GET_FUN(__glewEnableVertexAttribArray) -#define glGetActiveAttrib GLEW_GET_FUN(__glewGetActiveAttrib) -#define glGetActiveUniform GLEW_GET_FUN(__glewGetActiveUniform) -#define glGetAttachedShaders GLEW_GET_FUN(__glewGetAttachedShaders) -#define glGetAttribLocation GLEW_GET_FUN(__glewGetAttribLocation) -#define glGetProgramInfoLog GLEW_GET_FUN(__glewGetProgramInfoLog) -#define glGetProgramiv GLEW_GET_FUN(__glewGetProgramiv) -#define glGetShaderInfoLog GLEW_GET_FUN(__glewGetShaderInfoLog) -#define glGetShaderSource GLEW_GET_FUN(__glewGetShaderSource) -#define glGetShaderiv GLEW_GET_FUN(__glewGetShaderiv) -#define glGetUniformLocation GLEW_GET_FUN(__glewGetUniformLocation) -#define glGetUniformfv GLEW_GET_FUN(__glewGetUniformfv) -#define glGetUniformiv GLEW_GET_FUN(__glewGetUniformiv) -#define glGetVertexAttribPointerv GLEW_GET_FUN(__glewGetVertexAttribPointerv) -#define glGetVertexAttribdv GLEW_GET_FUN(__glewGetVertexAttribdv) -#define glGetVertexAttribfv GLEW_GET_FUN(__glewGetVertexAttribfv) -#define glGetVertexAttribiv GLEW_GET_FUN(__glewGetVertexAttribiv) -#define glIsProgram GLEW_GET_FUN(__glewIsProgram) -#define glIsShader GLEW_GET_FUN(__glewIsShader) -#define glLinkProgram GLEW_GET_FUN(__glewLinkProgram) -#define glShaderSource GLEW_GET_FUN(__glewShaderSource) -#define glStencilFuncSeparate GLEW_GET_FUN(__glewStencilFuncSeparate) -#define glStencilMaskSeparate GLEW_GET_FUN(__glewStencilMaskSeparate) -#define glStencilOpSeparate GLEW_GET_FUN(__glewStencilOpSeparate) -#define glUniform1f GLEW_GET_FUN(__glewUniform1f) -#define glUniform1fv GLEW_GET_FUN(__glewUniform1fv) -#define glUniform1i GLEW_GET_FUN(__glewUniform1i) -#define glUniform1iv GLEW_GET_FUN(__glewUniform1iv) -#define glUniform2f GLEW_GET_FUN(__glewUniform2f) -#define glUniform2fv GLEW_GET_FUN(__glewUniform2fv) -#define glUniform2i GLEW_GET_FUN(__glewUniform2i) -#define glUniform2iv GLEW_GET_FUN(__glewUniform2iv) -#define glUniform3f GLEW_GET_FUN(__glewUniform3f) -#define glUniform3fv GLEW_GET_FUN(__glewUniform3fv) -#define glUniform3i GLEW_GET_FUN(__glewUniform3i) -#define glUniform3iv GLEW_GET_FUN(__glewUniform3iv) -#define glUniform4f GLEW_GET_FUN(__glewUniform4f) -#define glUniform4fv GLEW_GET_FUN(__glewUniform4fv) -#define glUniform4i GLEW_GET_FUN(__glewUniform4i) -#define glUniform4iv GLEW_GET_FUN(__glewUniform4iv) -#define glUniformMatrix2fv GLEW_GET_FUN(__glewUniformMatrix2fv) -#define glUniformMatrix3fv GLEW_GET_FUN(__glewUniformMatrix3fv) -#define glUniformMatrix4fv GLEW_GET_FUN(__glewUniformMatrix4fv) -#define glUseProgram GLEW_GET_FUN(__glewUseProgram) -#define glValidateProgram GLEW_GET_FUN(__glewValidateProgram) -#define glVertexAttrib1d GLEW_GET_FUN(__glewVertexAttrib1d) -#define glVertexAttrib1dv GLEW_GET_FUN(__glewVertexAttrib1dv) -#define glVertexAttrib1f GLEW_GET_FUN(__glewVertexAttrib1f) -#define glVertexAttrib1fv GLEW_GET_FUN(__glewVertexAttrib1fv) -#define glVertexAttrib1s GLEW_GET_FUN(__glewVertexAttrib1s) -#define glVertexAttrib1sv GLEW_GET_FUN(__glewVertexAttrib1sv) -#define glVertexAttrib2d GLEW_GET_FUN(__glewVertexAttrib2d) -#define glVertexAttrib2dv GLEW_GET_FUN(__glewVertexAttrib2dv) -#define glVertexAttrib2f GLEW_GET_FUN(__glewVertexAttrib2f) -#define glVertexAttrib2fv GLEW_GET_FUN(__glewVertexAttrib2fv) -#define glVertexAttrib2s GLEW_GET_FUN(__glewVertexAttrib2s) -#define glVertexAttrib2sv GLEW_GET_FUN(__glewVertexAttrib2sv) -#define glVertexAttrib3d GLEW_GET_FUN(__glewVertexAttrib3d) -#define glVertexAttrib3dv GLEW_GET_FUN(__glewVertexAttrib3dv) -#define glVertexAttrib3f GLEW_GET_FUN(__glewVertexAttrib3f) -#define glVertexAttrib3fv GLEW_GET_FUN(__glewVertexAttrib3fv) -#define glVertexAttrib3s GLEW_GET_FUN(__glewVertexAttrib3s) -#define glVertexAttrib3sv GLEW_GET_FUN(__glewVertexAttrib3sv) -#define glVertexAttrib4Nbv GLEW_GET_FUN(__glewVertexAttrib4Nbv) -#define glVertexAttrib4Niv GLEW_GET_FUN(__glewVertexAttrib4Niv) -#define glVertexAttrib4Nsv GLEW_GET_FUN(__glewVertexAttrib4Nsv) -#define glVertexAttrib4Nub GLEW_GET_FUN(__glewVertexAttrib4Nub) -#define glVertexAttrib4Nubv GLEW_GET_FUN(__glewVertexAttrib4Nubv) -#define glVertexAttrib4Nuiv GLEW_GET_FUN(__glewVertexAttrib4Nuiv) -#define glVertexAttrib4Nusv GLEW_GET_FUN(__glewVertexAttrib4Nusv) -#define glVertexAttrib4bv GLEW_GET_FUN(__glewVertexAttrib4bv) -#define glVertexAttrib4d GLEW_GET_FUN(__glewVertexAttrib4d) -#define glVertexAttrib4dv GLEW_GET_FUN(__glewVertexAttrib4dv) -#define glVertexAttrib4f GLEW_GET_FUN(__glewVertexAttrib4f) -#define glVertexAttrib4fv GLEW_GET_FUN(__glewVertexAttrib4fv) -#define glVertexAttrib4iv GLEW_GET_FUN(__glewVertexAttrib4iv) -#define glVertexAttrib4s GLEW_GET_FUN(__glewVertexAttrib4s) -#define glVertexAttrib4sv GLEW_GET_FUN(__glewVertexAttrib4sv) -#define glVertexAttrib4ubv GLEW_GET_FUN(__glewVertexAttrib4ubv) -#define glVertexAttrib4uiv GLEW_GET_FUN(__glewVertexAttrib4uiv) -#define glVertexAttrib4usv GLEW_GET_FUN(__glewVertexAttrib4usv) -#define glVertexAttribPointer GLEW_GET_FUN(__glewVertexAttribPointer) - -#define GLEW_VERSION_2_0 GLEW_GET_VAR(__GLEW_VERSION_2_0) - -#endif /* GL_VERSION_2_0 */ - -/* ----------------------------- GL_VERSION_2_1 ---------------------------- */ - -#ifndef GL_VERSION_2_1 -#define GL_VERSION_2_1 1 - -#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F -#define GL_PIXEL_PACK_BUFFER 0x88EB -#define GL_PIXEL_UNPACK_BUFFER 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF -#define GL_FLOAT_MAT2x3 0x8B65 -#define GL_FLOAT_MAT2x4 0x8B66 -#define GL_FLOAT_MAT3x2 0x8B67 -#define GL_FLOAT_MAT3x4 0x8B68 -#define GL_FLOAT_MAT4x2 0x8B69 -#define GL_FLOAT_MAT4x3 0x8B6A -#define GL_SRGB 0x8C40 -#define GL_SRGB8 0x8C41 -#define GL_SRGB_ALPHA 0x8C42 -#define GL_SRGB8_ALPHA8 0x8C43 -#define GL_SLUMINANCE_ALPHA 0x8C44 -#define GL_SLUMINANCE8_ALPHA8 0x8C45 -#define GL_SLUMINANCE 0x8C46 -#define GL_SLUMINANCE8 0x8C47 -#define GL_COMPRESSED_SRGB 0x8C48 -#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 -#define GL_COMPRESSED_SLUMINANCE 0x8C4A -#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B - -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); - -#define glUniformMatrix2x3fv GLEW_GET_FUN(__glewUniformMatrix2x3fv) -#define glUniformMatrix2x4fv GLEW_GET_FUN(__glewUniformMatrix2x4fv) -#define glUniformMatrix3x2fv GLEW_GET_FUN(__glewUniformMatrix3x2fv) -#define glUniformMatrix3x4fv GLEW_GET_FUN(__glewUniformMatrix3x4fv) -#define glUniformMatrix4x2fv GLEW_GET_FUN(__glewUniformMatrix4x2fv) -#define glUniformMatrix4x3fv GLEW_GET_FUN(__glewUniformMatrix4x3fv) - -#define GLEW_VERSION_2_1 GLEW_GET_VAR(__GLEW_VERSION_2_1) - -#endif /* GL_VERSION_2_1 */ - -/* ----------------------------- GL_VERSION_3_0 ---------------------------- */ - -#ifndef GL_VERSION_3_0 -#define GL_VERSION_3_0 1 - -#define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0 -#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1 -#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2 -#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3 -#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4 -#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5 -#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB -#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES -#define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS -#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 -#define GL_MAJOR_VERSION 0x821B -#define GL_MINOR_VERSION 0x821C -#define GL_NUM_EXTENSIONS 0x821D -#define GL_CONTEXT_FLAGS 0x821E -#define GL_DEPTH_BUFFER 0x8223 -#define GL_STENCIL_BUFFER 0x8224 -#define GL_RGBA32F 0x8814 -#define GL_RGB32F 0x8815 -#define GL_RGBA16F 0x881A -#define GL_RGB16F 0x881B -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD -#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF -#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 -#define GL_CLAMP_VERTEX_COLOR 0x891A -#define GL_CLAMP_FRAGMENT_COLOR 0x891B -#define GL_CLAMP_READ_COLOR 0x891C -#define GL_FIXED_ONLY 0x891D -#define GL_TEXTURE_RED_TYPE 0x8C10 -#define GL_TEXTURE_GREEN_TYPE 0x8C11 -#define GL_TEXTURE_BLUE_TYPE 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE 0x8C13 -#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 -#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 -#define GL_TEXTURE_DEPTH_TYPE 0x8C16 -#define GL_TEXTURE_1D_ARRAY 0x8C18 -#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 -#define GL_TEXTURE_2D_ARRAY 0x8C1A -#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B -#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C -#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D -#define GL_R11F_G11F_B10F 0x8C3A -#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B -#define GL_RGB9_E5 0x8C3D -#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E -#define GL_TEXTURE_SHARED_SIZE 0x8C3F -#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 -#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 -#define GL_PRIMITIVES_GENERATED 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 -#define GL_RASTERIZER_DISCARD 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B -#define GL_INTERLEAVED_ATTRIBS 0x8C8C -#define GL_SEPARATE_ATTRIBS 0x8C8D -#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F -#define GL_RGBA32UI 0x8D70 -#define GL_RGB32UI 0x8D71 -#define GL_RGBA16UI 0x8D76 -#define GL_RGB16UI 0x8D77 -#define GL_RGBA8UI 0x8D7C -#define GL_RGB8UI 0x8D7D -#define GL_RGBA32I 0x8D82 -#define GL_RGB32I 0x8D83 -#define GL_RGBA16I 0x8D88 -#define GL_RGB16I 0x8D89 -#define GL_RGBA8I 0x8D8E -#define GL_RGB8I 0x8D8F -#define GL_RED_INTEGER 0x8D94 -#define GL_GREEN_INTEGER 0x8D95 -#define GL_BLUE_INTEGER 0x8D96 -#define GL_ALPHA_INTEGER 0x8D97 -#define GL_RGB_INTEGER 0x8D98 -#define GL_RGBA_INTEGER 0x8D99 -#define GL_BGR_INTEGER 0x8D9A -#define GL_BGRA_INTEGER 0x8D9B -#define GL_SAMPLER_1D_ARRAY 0x8DC0 -#define GL_SAMPLER_2D_ARRAY 0x8DC1 -#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 -#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 -#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 -#define GL_UNSIGNED_INT_VEC2 0x8DC6 -#define GL_UNSIGNED_INT_VEC3 0x8DC7 -#define GL_UNSIGNED_INT_VEC4 0x8DC8 -#define GL_INT_SAMPLER_1D 0x8DC9 -#define GL_INT_SAMPLER_2D 0x8DCA -#define GL_INT_SAMPLER_3D 0x8DCB -#define GL_INT_SAMPLER_CUBE 0x8DCC -#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE -#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF -#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 -#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 -#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 -#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 -#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 -#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 -#define GL_QUERY_WAIT 0x8E13 -#define GL_QUERY_NO_WAIT 0x8E14 -#define GL_QUERY_BY_REGION_WAIT 0x8E15 -#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 - -typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode); -typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode); -typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint colorNumber, const GLchar* name); -typedef void (GLAPIENTRY * PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); -typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawBuffer, GLfloat depth, GLint stencil); -typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawBuffer, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawBuffer, const GLint* value); -typedef void (GLAPIENTRY * PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawBuffer, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLCOLORMASKIPROC) (GLuint buf, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -typedef void (GLAPIENTRY * PFNGLDISABLEIPROC) (GLenum cap, GLuint index); -typedef void (GLAPIENTRY * PFNGLENABLEIPROC) (GLenum cap, GLuint index); -typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERPROC) (void); -typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKPROC) (void); -typedef void (GLAPIENTRY * PFNGLGETBOOLEANI_VPROC) (GLenum pname, GLuint index, GLboolean* data); -typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar* name); -typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); -typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint* params); -typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name); -typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint* params); -typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDIPROC) (GLenum cap, GLuint index); -typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint* params); -typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode); -typedef void (GLAPIENTRY * PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0); -typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1); -typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint v0); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint* v0); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint v0); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint* v0); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint v0, GLint v1); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint* v0); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint v0, GLuint v1); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint* v0); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint v0, GLint v1, GLint v2); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint* v0); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint v0, GLuint v1, GLuint v2); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint* v0); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte* v0); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint* v0); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort* v0); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte* v0); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint* v0); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort* v0); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void*pointer); - -#define glBeginConditionalRender GLEW_GET_FUN(__glewBeginConditionalRender) -#define glBeginTransformFeedback GLEW_GET_FUN(__glewBeginTransformFeedback) -#define glBindFragDataLocation GLEW_GET_FUN(__glewBindFragDataLocation) -#define glClampColor GLEW_GET_FUN(__glewClampColor) -#define glClearBufferfi GLEW_GET_FUN(__glewClearBufferfi) -#define glClearBufferfv GLEW_GET_FUN(__glewClearBufferfv) -#define glClearBufferiv GLEW_GET_FUN(__glewClearBufferiv) -#define glClearBufferuiv GLEW_GET_FUN(__glewClearBufferuiv) -#define glColorMaski GLEW_GET_FUN(__glewColorMaski) -#define glDisablei GLEW_GET_FUN(__glewDisablei) -#define glEnablei GLEW_GET_FUN(__glewEnablei) -#define glEndConditionalRender GLEW_GET_FUN(__glewEndConditionalRender) -#define glEndTransformFeedback GLEW_GET_FUN(__glewEndTransformFeedback) -#define glGetBooleani_v GLEW_GET_FUN(__glewGetBooleani_v) -#define glGetFragDataLocation GLEW_GET_FUN(__glewGetFragDataLocation) -#define glGetStringi GLEW_GET_FUN(__glewGetStringi) -#define glGetTexParameterIiv GLEW_GET_FUN(__glewGetTexParameterIiv) -#define glGetTexParameterIuiv GLEW_GET_FUN(__glewGetTexParameterIuiv) -#define glGetTransformFeedbackVarying GLEW_GET_FUN(__glewGetTransformFeedbackVarying) -#define glGetUniformuiv GLEW_GET_FUN(__glewGetUniformuiv) -#define glGetVertexAttribIiv GLEW_GET_FUN(__glewGetVertexAttribIiv) -#define glGetVertexAttribIuiv GLEW_GET_FUN(__glewGetVertexAttribIuiv) -#define glIsEnabledi GLEW_GET_FUN(__glewIsEnabledi) -#define glTexParameterIiv GLEW_GET_FUN(__glewTexParameterIiv) -#define glTexParameterIuiv GLEW_GET_FUN(__glewTexParameterIuiv) -#define glTransformFeedbackVaryings GLEW_GET_FUN(__glewTransformFeedbackVaryings) -#define glUniform1ui GLEW_GET_FUN(__glewUniform1ui) -#define glUniform1uiv GLEW_GET_FUN(__glewUniform1uiv) -#define glUniform2ui GLEW_GET_FUN(__glewUniform2ui) -#define glUniform2uiv GLEW_GET_FUN(__glewUniform2uiv) -#define glUniform3ui GLEW_GET_FUN(__glewUniform3ui) -#define glUniform3uiv GLEW_GET_FUN(__glewUniform3uiv) -#define glUniform4ui GLEW_GET_FUN(__glewUniform4ui) -#define glUniform4uiv GLEW_GET_FUN(__glewUniform4uiv) -#define glVertexAttribI1i GLEW_GET_FUN(__glewVertexAttribI1i) -#define glVertexAttribI1iv GLEW_GET_FUN(__glewVertexAttribI1iv) -#define glVertexAttribI1ui GLEW_GET_FUN(__glewVertexAttribI1ui) -#define glVertexAttribI1uiv GLEW_GET_FUN(__glewVertexAttribI1uiv) -#define glVertexAttribI2i GLEW_GET_FUN(__glewVertexAttribI2i) -#define glVertexAttribI2iv GLEW_GET_FUN(__glewVertexAttribI2iv) -#define glVertexAttribI2ui GLEW_GET_FUN(__glewVertexAttribI2ui) -#define glVertexAttribI2uiv GLEW_GET_FUN(__glewVertexAttribI2uiv) -#define glVertexAttribI3i GLEW_GET_FUN(__glewVertexAttribI3i) -#define glVertexAttribI3iv GLEW_GET_FUN(__glewVertexAttribI3iv) -#define glVertexAttribI3ui GLEW_GET_FUN(__glewVertexAttribI3ui) -#define glVertexAttribI3uiv GLEW_GET_FUN(__glewVertexAttribI3uiv) -#define glVertexAttribI4bv GLEW_GET_FUN(__glewVertexAttribI4bv) -#define glVertexAttribI4i GLEW_GET_FUN(__glewVertexAttribI4i) -#define glVertexAttribI4iv GLEW_GET_FUN(__glewVertexAttribI4iv) -#define glVertexAttribI4sv GLEW_GET_FUN(__glewVertexAttribI4sv) -#define glVertexAttribI4ubv GLEW_GET_FUN(__glewVertexAttribI4ubv) -#define glVertexAttribI4ui GLEW_GET_FUN(__glewVertexAttribI4ui) -#define glVertexAttribI4uiv GLEW_GET_FUN(__glewVertexAttribI4uiv) -#define glVertexAttribI4usv GLEW_GET_FUN(__glewVertexAttribI4usv) -#define glVertexAttribIPointer GLEW_GET_FUN(__glewVertexAttribIPointer) - -#define GLEW_VERSION_3_0 GLEW_GET_VAR(__GLEW_VERSION_3_0) - -#endif /* GL_VERSION_3_0 */ - -/* ----------------------------- GL_VERSION_3_1 ---------------------------- */ - -#ifndef GL_VERSION_3_1 -#define GL_VERSION_3_1 1 - -#define GL_TEXTURE_RECTANGLE 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 -#define GL_SAMPLER_2D_RECT 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 -#define GL_TEXTURE_BUFFER 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT 0x8C2E -#define GL_SAMPLER_BUFFER 0x8DC2 -#define GL_INT_SAMPLER_2D_RECT 0x8DCD -#define GL_INT_SAMPLER_BUFFER 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 -#define GL_RED_SNORM 0x8F90 -#define GL_RG_SNORM 0x8F91 -#define GL_RGB_SNORM 0x8F92 -#define GL_RGBA_SNORM 0x8F93 -#define GL_R8_SNORM 0x8F94 -#define GL_RG8_SNORM 0x8F95 -#define GL_RGB8_SNORM 0x8F96 -#define GL_RGBA8_SNORM 0x8F97 -#define GL_R16_SNORM 0x8F98 -#define GL_RG16_SNORM 0x8F99 -#define GL_RGB16_SNORM 0x8F9A -#define GL_RGBA16_SNORM 0x8F9B -#define GL_SIGNED_NORMALIZED 0x8F9C -#define GL_PRIMITIVE_RESTART 0x8F9D -#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E -#define GL_BUFFER_ACCESS_FLAGS 0x911F -#define GL_BUFFER_MAP_LENGTH 0x9120 -#define GL_BUFFER_MAP_OFFSET 0x9121 - -typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); -typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint buffer); -typedef void (GLAPIENTRY * PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalFormat, GLuint buffer); - -#define glDrawArraysInstanced GLEW_GET_FUN(__glewDrawArraysInstanced) -#define glDrawElementsInstanced GLEW_GET_FUN(__glewDrawElementsInstanced) -#define glPrimitiveRestartIndex GLEW_GET_FUN(__glewPrimitiveRestartIndex) -#define glTexBuffer GLEW_GET_FUN(__glewTexBuffer) - -#define GLEW_VERSION_3_1 GLEW_GET_VAR(__GLEW_VERSION_3_1) - -#endif /* GL_VERSION_3_1 */ - -/* ----------------------------- GL_VERSION_3_2 ---------------------------- */ - -#ifndef GL_VERSION_3_2 -#define GL_VERSION_3_2 1 - -#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 -#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 -#define GL_LINES_ADJACENCY 0x000A -#define GL_LINE_STRIP_ADJACENCY 0x000B -#define GL_TRIANGLES_ADJACENCY 0x000C -#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D -#define GL_PROGRAM_POINT_SIZE 0x8642 -#define GL_GEOMETRY_VERTICES_OUT 0x8916 -#define GL_GEOMETRY_INPUT_TYPE 0x8917 -#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 -#define GL_GEOMETRY_SHADER 0x8DD9 -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 -#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 -#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 -#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 -#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 -#define GL_CONTEXT_PROFILE_MASK 0x9126 - -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum value, GLint64 * data); -typedef void (GLAPIENTRY * PFNGLGETINTEGER64I_VPROC) (GLenum pname, GLuint index, GLint64 * data); - -#define glFramebufferTexture GLEW_GET_FUN(__glewFramebufferTexture) -#define glGetBufferParameteri64v GLEW_GET_FUN(__glewGetBufferParameteri64v) -#define glGetInteger64i_v GLEW_GET_FUN(__glewGetInteger64i_v) - -#define GLEW_VERSION_3_2 GLEW_GET_VAR(__GLEW_VERSION_3_2) - -#endif /* GL_VERSION_3_2 */ - -/* ----------------------------- GL_VERSION_3_3 ---------------------------- */ - -#ifndef GL_VERSION_3_3 -#define GL_VERSION_3_3 1 - -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE -#define GL_RGB10_A2UI 0x906F - -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); - -#define glVertexAttribDivisor GLEW_GET_FUN(__glewVertexAttribDivisor) - -#define GLEW_VERSION_3_3 GLEW_GET_VAR(__GLEW_VERSION_3_3) - -#endif /* GL_VERSION_3_3 */ - -/* ----------------------------- GL_VERSION_4_0 ---------------------------- */ - -#ifndef GL_VERSION_4_0 -#define GL_VERSION_4_0 1 - -#define GL_SAMPLE_SHADING 0x8C36 -#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 -#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E -#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F -#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS 0x8F9F -#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B -#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C -#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D -#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E -#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F - -typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); -typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -typedef void (GLAPIENTRY * PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); -typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGPROC) (GLclampf value); - -#define glBlendEquationSeparatei GLEW_GET_FUN(__glewBlendEquationSeparatei) -#define glBlendEquationi GLEW_GET_FUN(__glewBlendEquationi) -#define glBlendFuncSeparatei GLEW_GET_FUN(__glewBlendFuncSeparatei) -#define glBlendFunci GLEW_GET_FUN(__glewBlendFunci) -#define glMinSampleShading GLEW_GET_FUN(__glewMinSampleShading) - -#define GLEW_VERSION_4_0 GLEW_GET_VAR(__GLEW_VERSION_4_0) - -#endif /* GL_VERSION_4_0 */ - -/* ----------------------------- GL_VERSION_4_1 ---------------------------- */ - -#ifndef GL_VERSION_4_1 -#define GL_VERSION_4_1 1 - -#define GLEW_VERSION_4_1 GLEW_GET_VAR(__GLEW_VERSION_4_1) - -#endif /* GL_VERSION_4_1 */ - -/* ----------------------------- GL_VERSION_4_2 ---------------------------- */ - -#ifndef GL_VERSION_4_2 -#define GL_VERSION_4_2 1 - -#define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23 -#define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24 -#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C -#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D -#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E -#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F -#define GL_COPY_READ_BUFFER_BINDING 0x8F36 -#define GL_COPY_WRITE_BUFFER_BINDING 0x8F37 - -#define GLEW_VERSION_4_2 GLEW_GET_VAR(__GLEW_VERSION_4_2) - -#endif /* GL_VERSION_4_2 */ - -/* ----------------------------- GL_VERSION_4_3 ---------------------------- */ - -#ifndef GL_VERSION_4_3 -#define GL_VERSION_4_3 1 - -#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9 -#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E - -#define GLEW_VERSION_4_3 GLEW_GET_VAR(__GLEW_VERSION_4_3) - -#endif /* GL_VERSION_4_3 */ - -/* ----------------------------- GL_VERSION_4_4 ---------------------------- */ - -#ifndef GL_VERSION_4_4 -#define GL_VERSION_4_4 1 - -#define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221 -#define GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5 -#define GL_TEXTURE_BUFFER_BINDING 0x8C2A - -#define GLEW_VERSION_4_4 GLEW_GET_VAR(__GLEW_VERSION_4_4) - -#endif /* GL_VERSION_4_4 */ - -/* ----------------------------- GL_VERSION_4_5 ---------------------------- */ - -#ifndef GL_VERSION_4_5 -#define GL_VERSION_4_5 1 - -#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT 0x00000004 - -typedef GLenum (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUSPROC) (void); -typedef void (GLAPIENTRY * PFNGLGETNCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLsizei bufSize, GLvoid *pixels); -typedef void (GLAPIENTRY * PFNGLGETNTEXIMAGEPROC) (GLenum tex, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *pixels); -typedef void (GLAPIENTRY * PFNGLGETNUNIFORMDVPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); - -#define glGetGraphicsResetStatus GLEW_GET_FUN(__glewGetGraphicsResetStatus) -#define glGetnCompressedTexImage GLEW_GET_FUN(__glewGetnCompressedTexImage) -#define glGetnTexImage GLEW_GET_FUN(__glewGetnTexImage) -#define glGetnUniformdv GLEW_GET_FUN(__glewGetnUniformdv) - -#define GLEW_VERSION_4_5 GLEW_GET_VAR(__GLEW_VERSION_4_5) - -#endif /* GL_VERSION_4_5 */ - -/* -------------------------- GL_3DFX_multisample -------------------------- */ - -#ifndef GL_3DFX_multisample -#define GL_3DFX_multisample 1 - -#define GL_MULTISAMPLE_3DFX 0x86B2 -#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 -#define GL_SAMPLES_3DFX 0x86B4 -#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 - -#define GLEW_3DFX_multisample GLEW_GET_VAR(__GLEW_3DFX_multisample) - -#endif /* GL_3DFX_multisample */ - -/* ---------------------------- GL_3DFX_tbuffer ---------------------------- */ - -#ifndef GL_3DFX_tbuffer -#define GL_3DFX_tbuffer 1 - -typedef void (GLAPIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); - -#define glTbufferMask3DFX GLEW_GET_FUN(__glewTbufferMask3DFX) - -#define GLEW_3DFX_tbuffer GLEW_GET_VAR(__GLEW_3DFX_tbuffer) - -#endif /* GL_3DFX_tbuffer */ - -/* -------------------- GL_3DFX_texture_compression_FXT1 ------------------- */ - -#ifndef GL_3DFX_texture_compression_FXT1 -#define GL_3DFX_texture_compression_FXT1 1 - -#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 -#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 - -#define GLEW_3DFX_texture_compression_FXT1 GLEW_GET_VAR(__GLEW_3DFX_texture_compression_FXT1) - -#endif /* GL_3DFX_texture_compression_FXT1 */ - -/* ----------------------- GL_AMD_blend_minmax_factor ---------------------- */ - -#ifndef GL_AMD_blend_minmax_factor -#define GL_AMD_blend_minmax_factor 1 - -#define GL_FACTOR_MIN_AMD 0x901C -#define GL_FACTOR_MAX_AMD 0x901D - -#define GLEW_AMD_blend_minmax_factor GLEW_GET_VAR(__GLEW_AMD_blend_minmax_factor) - -#endif /* GL_AMD_blend_minmax_factor */ - -/* ----------------------- GL_AMD_conservative_depth ----------------------- */ - -#ifndef GL_AMD_conservative_depth -#define GL_AMD_conservative_depth 1 - -#define GLEW_AMD_conservative_depth GLEW_GET_VAR(__GLEW_AMD_conservative_depth) - -#endif /* GL_AMD_conservative_depth */ - -/* -------------------------- GL_AMD_debug_output -------------------------- */ - -#ifndef GL_AMD_debug_output -#define GL_AMD_debug_output 1 - -#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 -#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 -#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 -#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 -#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A -#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B -#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C -#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D -#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E -#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F -#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 - -typedef void (GLAPIENTRY *GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, void* userParam); - -typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, void *userParam); -typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); -typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar* buf); -typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum* categories, GLuint* severities, GLuint* ids, GLsizei* lengths, GLchar* message); - -#define glDebugMessageCallbackAMD GLEW_GET_FUN(__glewDebugMessageCallbackAMD) -#define glDebugMessageEnableAMD GLEW_GET_FUN(__glewDebugMessageEnableAMD) -#define glDebugMessageInsertAMD GLEW_GET_FUN(__glewDebugMessageInsertAMD) -#define glGetDebugMessageLogAMD GLEW_GET_FUN(__glewGetDebugMessageLogAMD) - -#define GLEW_AMD_debug_output GLEW_GET_VAR(__GLEW_AMD_debug_output) - -#endif /* GL_AMD_debug_output */ - -/* ---------------------- GL_AMD_depth_clamp_separate ---------------------- */ - -#ifndef GL_AMD_depth_clamp_separate -#define GL_AMD_depth_clamp_separate 1 - -#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E -#define GL_DEPTH_CLAMP_FAR_AMD 0x901F - -#define GLEW_AMD_depth_clamp_separate GLEW_GET_VAR(__GLEW_AMD_depth_clamp_separate) - -#endif /* GL_AMD_depth_clamp_separate */ - -/* ----------------------- GL_AMD_draw_buffers_blend ----------------------- */ - -#ifndef GL_AMD_draw_buffers_blend -#define GL_AMD_draw_buffers_blend 1 - -typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode); -typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -typedef void (GLAPIENTRY * PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); -typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); - -#define glBlendEquationIndexedAMD GLEW_GET_FUN(__glewBlendEquationIndexedAMD) -#define glBlendEquationSeparateIndexedAMD GLEW_GET_FUN(__glewBlendEquationSeparateIndexedAMD) -#define glBlendFuncIndexedAMD GLEW_GET_FUN(__glewBlendFuncIndexedAMD) -#define glBlendFuncSeparateIndexedAMD GLEW_GET_FUN(__glewBlendFuncSeparateIndexedAMD) - -#define GLEW_AMD_draw_buffers_blend GLEW_GET_VAR(__GLEW_AMD_draw_buffers_blend) - -#endif /* GL_AMD_draw_buffers_blend */ - -/* --------------------------- GL_AMD_gcn_shader --------------------------- */ - -#ifndef GL_AMD_gcn_shader -#define GL_AMD_gcn_shader 1 - -#define GLEW_AMD_gcn_shader GLEW_GET_VAR(__GLEW_AMD_gcn_shader) - -#endif /* GL_AMD_gcn_shader */ - -/* ------------------------ GL_AMD_gpu_shader_int64 ------------------------ */ - -#ifndef GL_AMD_gpu_shader_int64 -#define GL_AMD_gpu_shader_int64 1 - -#define GLEW_AMD_gpu_shader_int64 GLEW_GET_VAR(__GLEW_AMD_gpu_shader_int64) - -#endif /* GL_AMD_gpu_shader_int64 */ - -/* ---------------------- GL_AMD_interleaved_elements ---------------------- */ - -#ifndef GL_AMD_interleaved_elements -#define GL_AMD_interleaved_elements 1 - -#define GL_RED 0x1903 -#define GL_GREEN 0x1904 -#define GL_BLUE 0x1905 -#define GL_ALPHA 0x1906 -#define GL_RG8UI 0x8238 -#define GL_RG16UI 0x823A -#define GL_RGBA8UI 0x8D7C -#define GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4 -#define GL_VERTEX_ID_SWIZZLE_AMD 0x91A5 - -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPARAMETERIAMDPROC) (GLuint index, GLenum pname, GLint param); - -#define glVertexAttribParameteriAMD GLEW_GET_FUN(__glewVertexAttribParameteriAMD) - -#define GLEW_AMD_interleaved_elements GLEW_GET_VAR(__GLEW_AMD_interleaved_elements) - -#endif /* GL_AMD_interleaved_elements */ - -/* ----------------------- GL_AMD_multi_draw_indirect ---------------------- */ - -#ifndef GL_AMD_multi_draw_indirect -#define GL_AMD_multi_draw_indirect 1 - -typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); -typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); - -#define glMultiDrawArraysIndirectAMD GLEW_GET_FUN(__glewMultiDrawArraysIndirectAMD) -#define glMultiDrawElementsIndirectAMD GLEW_GET_FUN(__glewMultiDrawElementsIndirectAMD) - -#define GLEW_AMD_multi_draw_indirect GLEW_GET_VAR(__GLEW_AMD_multi_draw_indirect) - -#endif /* GL_AMD_multi_draw_indirect */ - -/* ------------------------- GL_AMD_name_gen_delete ------------------------ */ - -#ifndef GL_AMD_name_gen_delete -#define GL_AMD_name_gen_delete 1 - -#define GL_DATA_BUFFER_AMD 0x9151 -#define GL_PERFORMANCE_MONITOR_AMD 0x9152 -#define GL_QUERY_OBJECT_AMD 0x9153 -#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 -#define GL_SAMPLER_OBJECT_AMD 0x9155 - -typedef void (GLAPIENTRY * PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint* names); -typedef void (GLAPIENTRY * PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint* names); -typedef GLboolean (GLAPIENTRY * PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name); - -#define glDeleteNamesAMD GLEW_GET_FUN(__glewDeleteNamesAMD) -#define glGenNamesAMD GLEW_GET_FUN(__glewGenNamesAMD) -#define glIsNameAMD GLEW_GET_FUN(__glewIsNameAMD) - -#define GLEW_AMD_name_gen_delete GLEW_GET_VAR(__GLEW_AMD_name_gen_delete) - -#endif /* GL_AMD_name_gen_delete */ - -/* ---------------------- GL_AMD_occlusion_query_event --------------------- */ - -#ifndef GL_AMD_occlusion_query_event -#define GL_AMD_occlusion_query_event 1 - -#define GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD 0x00000001 -#define GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD 0x00000002 -#define GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD 0x00000004 -#define GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD 0x00000008 -#define GL_OCCLUSION_QUERY_EVENT_MASK_AMD 0x874F -#define GL_QUERY_ALL_EVENT_BITS_AMD 0xFFFFFFFF - -typedef void (GLAPIENTRY * PFNGLQUERYOBJECTPARAMETERUIAMDPROC) (GLenum target, GLuint id, GLenum pname, GLuint param); - -#define glQueryObjectParameteruiAMD GLEW_GET_FUN(__glewQueryObjectParameteruiAMD) - -#define GLEW_AMD_occlusion_query_event GLEW_GET_VAR(__GLEW_AMD_occlusion_query_event) - -#endif /* GL_AMD_occlusion_query_event */ - -/* ----------------------- GL_AMD_performance_monitor ---------------------- */ - -#ifndef GL_AMD_performance_monitor -#define GL_AMD_performance_monitor 1 - -#define GL_COUNTER_TYPE_AMD 0x8BC0 -#define GL_COUNTER_RANGE_AMD 0x8BC1 -#define GL_UNSIGNED_INT64_AMD 0x8BC2 -#define GL_PERCENTAGE_AMD 0x8BC3 -#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 -#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 -#define GL_PERFMON_RESULT_AMD 0x8BC6 - -typedef void (GLAPIENTRY * PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); -typedef void (GLAPIENTRY * PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); -typedef void (GLAPIENTRY * PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); -typedef void (GLAPIENTRY * PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); -typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint *bytesWritten); -typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data); -typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar *counterString); -typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint* numCounters, GLint *maxActiveCounters, GLsizei countersSize, GLuint *counters); -typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei* length, GLchar *groupString); -typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint* numGroups, GLsizei groupsSize, GLuint *groups); -typedef void (GLAPIENTRY * PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* counterList); - -#define glBeginPerfMonitorAMD GLEW_GET_FUN(__glewBeginPerfMonitorAMD) -#define glDeletePerfMonitorsAMD GLEW_GET_FUN(__glewDeletePerfMonitorsAMD) -#define glEndPerfMonitorAMD GLEW_GET_FUN(__glewEndPerfMonitorAMD) -#define glGenPerfMonitorsAMD GLEW_GET_FUN(__glewGenPerfMonitorsAMD) -#define glGetPerfMonitorCounterDataAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterDataAMD) -#define glGetPerfMonitorCounterInfoAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterInfoAMD) -#define glGetPerfMonitorCounterStringAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterStringAMD) -#define glGetPerfMonitorCountersAMD GLEW_GET_FUN(__glewGetPerfMonitorCountersAMD) -#define glGetPerfMonitorGroupStringAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupStringAMD) -#define glGetPerfMonitorGroupsAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupsAMD) -#define glSelectPerfMonitorCountersAMD GLEW_GET_FUN(__glewSelectPerfMonitorCountersAMD) - -#define GLEW_AMD_performance_monitor GLEW_GET_VAR(__GLEW_AMD_performance_monitor) - -#endif /* GL_AMD_performance_monitor */ - -/* -------------------------- GL_AMD_pinned_memory ------------------------- */ - -#ifndef GL_AMD_pinned_memory -#define GL_AMD_pinned_memory 1 - -#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 - -#define GLEW_AMD_pinned_memory GLEW_GET_VAR(__GLEW_AMD_pinned_memory) - -#endif /* GL_AMD_pinned_memory */ - -/* ----------------------- GL_AMD_query_buffer_object ---------------------- */ - -#ifndef GL_AMD_query_buffer_object -#define GL_AMD_query_buffer_object 1 - -#define GL_QUERY_BUFFER_AMD 0x9192 -#define GL_QUERY_BUFFER_BINDING_AMD 0x9193 -#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 - -#define GLEW_AMD_query_buffer_object GLEW_GET_VAR(__GLEW_AMD_query_buffer_object) - -#endif /* GL_AMD_query_buffer_object */ - -/* ------------------------ GL_AMD_sample_positions ------------------------ */ - -#ifndef GL_AMD_sample_positions -#define GL_AMD_sample_positions 1 - -#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F - -typedef void (GLAPIENTRY * PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat* val); - -#define glSetMultisamplefvAMD GLEW_GET_FUN(__glewSetMultisamplefvAMD) - -#define GLEW_AMD_sample_positions GLEW_GET_VAR(__GLEW_AMD_sample_positions) - -#endif /* GL_AMD_sample_positions */ - -/* ------------------ GL_AMD_seamless_cubemap_per_texture ------------------ */ - -#ifndef GL_AMD_seamless_cubemap_per_texture -#define GL_AMD_seamless_cubemap_per_texture 1 - -#define GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB 0x884F - -#define GLEW_AMD_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_AMD_seamless_cubemap_per_texture) - -#endif /* GL_AMD_seamless_cubemap_per_texture */ - -/* -------------------- GL_AMD_shader_atomic_counter_ops ------------------- */ - -#ifndef GL_AMD_shader_atomic_counter_ops -#define GL_AMD_shader_atomic_counter_ops 1 - -#define GLEW_AMD_shader_atomic_counter_ops GLEW_GET_VAR(__GLEW_AMD_shader_atomic_counter_ops) - -#endif /* GL_AMD_shader_atomic_counter_ops */ - -/* ---------------------- GL_AMD_shader_stencil_export --------------------- */ - -#ifndef GL_AMD_shader_stencil_export -#define GL_AMD_shader_stencil_export 1 - -#define GLEW_AMD_shader_stencil_export GLEW_GET_VAR(__GLEW_AMD_shader_stencil_export) - -#endif /* GL_AMD_shader_stencil_export */ - -/* ------------------- GL_AMD_shader_stencil_value_export ------------------ */ - -#ifndef GL_AMD_shader_stencil_value_export -#define GL_AMD_shader_stencil_value_export 1 - -#define GLEW_AMD_shader_stencil_value_export GLEW_GET_VAR(__GLEW_AMD_shader_stencil_value_export) - -#endif /* GL_AMD_shader_stencil_value_export */ - -/* ---------------------- GL_AMD_shader_trinary_minmax --------------------- */ - -#ifndef GL_AMD_shader_trinary_minmax -#define GL_AMD_shader_trinary_minmax 1 - -#define GLEW_AMD_shader_trinary_minmax GLEW_GET_VAR(__GLEW_AMD_shader_trinary_minmax) - -#endif /* GL_AMD_shader_trinary_minmax */ - -/* ------------------------- GL_AMD_sparse_texture ------------------------- */ - -#ifndef GL_AMD_sparse_texture -#define GL_AMD_sparse_texture 1 - -#define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001 -#define GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195 -#define GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196 -#define GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197 -#define GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198 -#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199 -#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A -#define GL_MIN_SPARSE_LEVEL_AMD 0x919B -#define GL_MIN_LOD_WARNING_AMD 0x919C - -typedef void (GLAPIENTRY * PFNGLTEXSTORAGESPARSEAMDPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); -typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGESPARSEAMDPROC) (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); - -#define glTexStorageSparseAMD GLEW_GET_FUN(__glewTexStorageSparseAMD) -#define glTextureStorageSparseAMD GLEW_GET_FUN(__glewTextureStorageSparseAMD) - -#define GLEW_AMD_sparse_texture GLEW_GET_VAR(__GLEW_AMD_sparse_texture) - -#endif /* GL_AMD_sparse_texture */ - -/* ------------------- GL_AMD_stencil_operation_extended ------------------- */ - -#ifndef GL_AMD_stencil_operation_extended -#define GL_AMD_stencil_operation_extended 1 - -#define GL_SET_AMD 0x874A -#define GL_REPLACE_VALUE_AMD 0x874B -#define GL_STENCIL_OP_VALUE_AMD 0x874C -#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D - -typedef void (GLAPIENTRY * PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value); - -#define glStencilOpValueAMD GLEW_GET_FUN(__glewStencilOpValueAMD) - -#define GLEW_AMD_stencil_operation_extended GLEW_GET_VAR(__GLEW_AMD_stencil_operation_extended) - -#endif /* GL_AMD_stencil_operation_extended */ - -/* ------------------------ GL_AMD_texture_texture4 ------------------------ */ - -#ifndef GL_AMD_texture_texture4 -#define GL_AMD_texture_texture4 1 - -#define GLEW_AMD_texture_texture4 GLEW_GET_VAR(__GLEW_AMD_texture_texture4) - -#endif /* GL_AMD_texture_texture4 */ - -/* --------------- GL_AMD_transform_feedback3_lines_triangles -------------- */ - -#ifndef GL_AMD_transform_feedback3_lines_triangles -#define GL_AMD_transform_feedback3_lines_triangles 1 - -#define GLEW_AMD_transform_feedback3_lines_triangles GLEW_GET_VAR(__GLEW_AMD_transform_feedback3_lines_triangles) - -#endif /* GL_AMD_transform_feedback3_lines_triangles */ - -/* ----------------------- GL_AMD_transform_feedback4 ---------------------- */ - -#ifndef GL_AMD_transform_feedback4 -#define GL_AMD_transform_feedback4 1 - -#define GL_STREAM_RASTERIZATION_AMD 0x91A0 - -#define GLEW_AMD_transform_feedback4 GLEW_GET_VAR(__GLEW_AMD_transform_feedback4) - -#endif /* GL_AMD_transform_feedback4 */ - -/* ----------------------- GL_AMD_vertex_shader_layer ---------------------- */ - -#ifndef GL_AMD_vertex_shader_layer -#define GL_AMD_vertex_shader_layer 1 - -#define GLEW_AMD_vertex_shader_layer GLEW_GET_VAR(__GLEW_AMD_vertex_shader_layer) - -#endif /* GL_AMD_vertex_shader_layer */ - -/* -------------------- GL_AMD_vertex_shader_tessellator ------------------- */ - -#ifndef GL_AMD_vertex_shader_tessellator -#define GL_AMD_vertex_shader_tessellator 1 - -#define GL_SAMPLER_BUFFER_AMD 0x9001 -#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 -#define GL_TESSELLATION_MODE_AMD 0x9004 -#define GL_TESSELLATION_FACTOR_AMD 0x9005 -#define GL_DISCRETE_AMD 0x9006 -#define GL_CONTINUOUS_AMD 0x9007 - -typedef void (GLAPIENTRY * PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); -typedef void (GLAPIENTRY * PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); - -#define glTessellationFactorAMD GLEW_GET_FUN(__glewTessellationFactorAMD) -#define glTessellationModeAMD GLEW_GET_FUN(__glewTessellationModeAMD) - -#define GLEW_AMD_vertex_shader_tessellator GLEW_GET_VAR(__GLEW_AMD_vertex_shader_tessellator) - -#endif /* GL_AMD_vertex_shader_tessellator */ - -/* ------------------ GL_AMD_vertex_shader_viewport_index ------------------ */ - -#ifndef GL_AMD_vertex_shader_viewport_index -#define GL_AMD_vertex_shader_viewport_index 1 - -#define GLEW_AMD_vertex_shader_viewport_index GLEW_GET_VAR(__GLEW_AMD_vertex_shader_viewport_index) - -#endif /* GL_AMD_vertex_shader_viewport_index */ - -/* ------------------------- GL_ANGLE_depth_texture ------------------------ */ - -#ifndef GL_ANGLE_depth_texture -#define GL_ANGLE_depth_texture 1 - -#define GLEW_ANGLE_depth_texture GLEW_GET_VAR(__GLEW_ANGLE_depth_texture) - -#endif /* GL_ANGLE_depth_texture */ - -/* ----------------------- GL_ANGLE_framebuffer_blit ----------------------- */ - -#ifndef GL_ANGLE_framebuffer_blit -#define GL_ANGLE_framebuffer_blit 1 - -#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6 -#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9 -#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA - -typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); - -#define glBlitFramebufferANGLE GLEW_GET_FUN(__glewBlitFramebufferANGLE) - -#define GLEW_ANGLE_framebuffer_blit GLEW_GET_VAR(__GLEW_ANGLE_framebuffer_blit) - -#endif /* GL_ANGLE_framebuffer_blit */ - -/* -------------------- GL_ANGLE_framebuffer_multisample ------------------- */ - -#ifndef GL_ANGLE_framebuffer_multisample -#define GL_ANGLE_framebuffer_multisample 1 - -#define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56 -#define GL_MAX_SAMPLES_ANGLE 0x8D57 - -typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); - -#define glRenderbufferStorageMultisampleANGLE GLEW_GET_FUN(__glewRenderbufferStorageMultisampleANGLE) - -#define GLEW_ANGLE_framebuffer_multisample GLEW_GET_VAR(__GLEW_ANGLE_framebuffer_multisample) - -#endif /* GL_ANGLE_framebuffer_multisample */ - -/* ----------------------- GL_ANGLE_instanced_arrays ----------------------- */ - -#ifndef GL_ANGLE_instanced_arrays -#define GL_ANGLE_instanced_arrays 1 - -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE - -typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor); - -#define glDrawArraysInstancedANGLE GLEW_GET_FUN(__glewDrawArraysInstancedANGLE) -#define glDrawElementsInstancedANGLE GLEW_GET_FUN(__glewDrawElementsInstancedANGLE) -#define glVertexAttribDivisorANGLE GLEW_GET_FUN(__glewVertexAttribDivisorANGLE) - -#define GLEW_ANGLE_instanced_arrays GLEW_GET_VAR(__GLEW_ANGLE_instanced_arrays) - -#endif /* GL_ANGLE_instanced_arrays */ - -/* -------------------- GL_ANGLE_pack_reverse_row_order -------------------- */ - -#ifndef GL_ANGLE_pack_reverse_row_order -#define GL_ANGLE_pack_reverse_row_order 1 - -#define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4 - -#define GLEW_ANGLE_pack_reverse_row_order GLEW_GET_VAR(__GLEW_ANGLE_pack_reverse_row_order) - -#endif /* GL_ANGLE_pack_reverse_row_order */ - -/* ------------------------ GL_ANGLE_program_binary ------------------------ */ - -#ifndef GL_ANGLE_program_binary -#define GL_ANGLE_program_binary 1 - -#define GL_PROGRAM_BINARY_ANGLE 0x93A6 - -#define GLEW_ANGLE_program_binary GLEW_GET_VAR(__GLEW_ANGLE_program_binary) - -#endif /* GL_ANGLE_program_binary */ - -/* ------------------- GL_ANGLE_texture_compression_dxt1 ------------------- */ - -#ifndef GL_ANGLE_texture_compression_dxt1 -#define GL_ANGLE_texture_compression_dxt1 1 - -#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 - -#define GLEW_ANGLE_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt1) - -#endif /* GL_ANGLE_texture_compression_dxt1 */ - -/* ------------------- GL_ANGLE_texture_compression_dxt3 ------------------- */ - -#ifndef GL_ANGLE_texture_compression_dxt3 -#define GL_ANGLE_texture_compression_dxt3 1 - -#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 - -#define GLEW_ANGLE_texture_compression_dxt3 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt3) - -#endif /* GL_ANGLE_texture_compression_dxt3 */ - -/* ------------------- GL_ANGLE_texture_compression_dxt5 ------------------- */ - -#ifndef GL_ANGLE_texture_compression_dxt5 -#define GL_ANGLE_texture_compression_dxt5 1 - -#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 - -#define GLEW_ANGLE_texture_compression_dxt5 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt5) - -#endif /* GL_ANGLE_texture_compression_dxt5 */ - -/* ------------------------- GL_ANGLE_texture_usage ------------------------ */ - -#ifndef GL_ANGLE_texture_usage -#define GL_ANGLE_texture_usage 1 - -#define GL_TEXTURE_USAGE_ANGLE 0x93A2 -#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3 - -#define GLEW_ANGLE_texture_usage GLEW_GET_VAR(__GLEW_ANGLE_texture_usage) - -#endif /* GL_ANGLE_texture_usage */ - -/* -------------------------- GL_ANGLE_timer_query ------------------------- */ - -#ifndef GL_ANGLE_timer_query -#define GL_ANGLE_timer_query 1 - -#define GL_QUERY_COUNTER_BITS_ANGLE 0x8864 -#define GL_CURRENT_QUERY_ANGLE 0x8865 -#define GL_QUERY_RESULT_ANGLE 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_ANGLE 0x8867 -#define GL_TIME_ELAPSED_ANGLE 0x88BF -#define GL_TIMESTAMP_ANGLE 0x8E28 - -typedef void (GLAPIENTRY * PFNGLBEGINQUERYANGLEPROC) (GLenum target, GLuint id); -typedef void (GLAPIENTRY * PFNGLDELETEQUERIESANGLEPROC) (GLsizei n, const GLuint* ids); -typedef void (GLAPIENTRY * PFNGLENDQUERYANGLEPROC) (GLenum target); -typedef void (GLAPIENTRY * PFNGLGENQUERIESANGLEPROC) (GLsizei n, GLuint* ids); -typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VANGLEPROC) (GLuint id, GLenum pname, GLint64* params); -typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVANGLEPROC) (GLuint id, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VANGLEPROC) (GLuint id, GLenum pname, GLuint64* params); -typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVANGLEPROC) (GLuint id, GLenum pname, GLuint* params); -typedef void (GLAPIENTRY * PFNGLGETQUERYIVANGLEPROC) (GLenum target, GLenum pname, GLint* params); -typedef GLboolean (GLAPIENTRY * PFNGLISQUERYANGLEPROC) (GLuint id); -typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERANGLEPROC) (GLuint id, GLenum target); - -#define glBeginQueryANGLE GLEW_GET_FUN(__glewBeginQueryANGLE) -#define glDeleteQueriesANGLE GLEW_GET_FUN(__glewDeleteQueriesANGLE) -#define glEndQueryANGLE GLEW_GET_FUN(__glewEndQueryANGLE) -#define glGenQueriesANGLE GLEW_GET_FUN(__glewGenQueriesANGLE) -#define glGetQueryObjecti64vANGLE GLEW_GET_FUN(__glewGetQueryObjecti64vANGLE) -#define glGetQueryObjectivANGLE GLEW_GET_FUN(__glewGetQueryObjectivANGLE) -#define glGetQueryObjectui64vANGLE GLEW_GET_FUN(__glewGetQueryObjectui64vANGLE) -#define glGetQueryObjectuivANGLE GLEW_GET_FUN(__glewGetQueryObjectuivANGLE) -#define glGetQueryivANGLE GLEW_GET_FUN(__glewGetQueryivANGLE) -#define glIsQueryANGLE GLEW_GET_FUN(__glewIsQueryANGLE) -#define glQueryCounterANGLE GLEW_GET_FUN(__glewQueryCounterANGLE) - -#define GLEW_ANGLE_timer_query GLEW_GET_VAR(__GLEW_ANGLE_timer_query) - -#endif /* GL_ANGLE_timer_query */ - -/* ------------------- GL_ANGLE_translated_shader_source ------------------- */ - -#ifndef GL_ANGLE_translated_shader_source -#define GL_ANGLE_translated_shader_source 1 - -#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0 - -typedef void (GLAPIENTRY * PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source); - -#define glGetTranslatedShaderSourceANGLE GLEW_GET_FUN(__glewGetTranslatedShaderSourceANGLE) - -#define GLEW_ANGLE_translated_shader_source GLEW_GET_VAR(__GLEW_ANGLE_translated_shader_source) - -#endif /* GL_ANGLE_translated_shader_source */ - -/* ----------------------- GL_APPLE_aux_depth_stencil ---------------------- */ - -#ifndef GL_APPLE_aux_depth_stencil -#define GL_APPLE_aux_depth_stencil 1 - -#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 - -#define GLEW_APPLE_aux_depth_stencil GLEW_GET_VAR(__GLEW_APPLE_aux_depth_stencil) - -#endif /* GL_APPLE_aux_depth_stencil */ - -/* ------------------------ GL_APPLE_client_storage ------------------------ */ - -#ifndef GL_APPLE_client_storage -#define GL_APPLE_client_storage 1 - -#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 - -#define GLEW_APPLE_client_storage GLEW_GET_VAR(__GLEW_APPLE_client_storage) - -#endif /* GL_APPLE_client_storage */ - -/* ------------------------- GL_APPLE_element_array ------------------------ */ - -#ifndef GL_APPLE_element_array -#define GL_APPLE_element_array 1 - -#define GL_ELEMENT_ARRAY_APPLE 0x8A0C -#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D -#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E - -typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); -typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const void *pointer); -typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); -typedef void (GLAPIENTRY * PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint* first, const GLsizei *count, GLsizei primcount); - -#define glDrawElementArrayAPPLE GLEW_GET_FUN(__glewDrawElementArrayAPPLE) -#define glDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewDrawRangeElementArrayAPPLE) -#define glElementPointerAPPLE GLEW_GET_FUN(__glewElementPointerAPPLE) -#define glMultiDrawElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawElementArrayAPPLE) -#define glMultiDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawRangeElementArrayAPPLE) - -#define GLEW_APPLE_element_array GLEW_GET_VAR(__GLEW_APPLE_element_array) - -#endif /* GL_APPLE_element_array */ - -/* ----------------------------- GL_APPLE_fence ---------------------------- */ - -#ifndef GL_APPLE_fence -#define GL_APPLE_fence 1 - -#define GL_DRAW_PIXELS_APPLE 0x8A0A -#define GL_FENCE_APPLE 0x8A0B - -typedef void (GLAPIENTRY * PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint* fences); -typedef void (GLAPIENTRY * PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); -typedef void (GLAPIENTRY * PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); -typedef void (GLAPIENTRY * PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint* fences); -typedef GLboolean (GLAPIENTRY * PFNGLISFENCEAPPLEPROC) (GLuint fence); -typedef void (GLAPIENTRY * PFNGLSETFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (GLAPIENTRY * PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); - -#define glDeleteFencesAPPLE GLEW_GET_FUN(__glewDeleteFencesAPPLE) -#define glFinishFenceAPPLE GLEW_GET_FUN(__glewFinishFenceAPPLE) -#define glFinishObjectAPPLE GLEW_GET_FUN(__glewFinishObjectAPPLE) -#define glGenFencesAPPLE GLEW_GET_FUN(__glewGenFencesAPPLE) -#define glIsFenceAPPLE GLEW_GET_FUN(__glewIsFenceAPPLE) -#define glSetFenceAPPLE GLEW_GET_FUN(__glewSetFenceAPPLE) -#define glTestFenceAPPLE GLEW_GET_FUN(__glewTestFenceAPPLE) -#define glTestObjectAPPLE GLEW_GET_FUN(__glewTestObjectAPPLE) - -#define GLEW_APPLE_fence GLEW_GET_VAR(__GLEW_APPLE_fence) - -#endif /* GL_APPLE_fence */ - -/* ------------------------- GL_APPLE_float_pixels ------------------------- */ - -#ifndef GL_APPLE_float_pixels -#define GL_APPLE_float_pixels 1 - -#define GL_HALF_APPLE 0x140B -#define GL_RGBA_FLOAT32_APPLE 0x8814 -#define GL_RGB_FLOAT32_APPLE 0x8815 -#define GL_ALPHA_FLOAT32_APPLE 0x8816 -#define GL_INTENSITY_FLOAT32_APPLE 0x8817 -#define GL_LUMINANCE_FLOAT32_APPLE 0x8818 -#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 -#define GL_RGBA_FLOAT16_APPLE 0x881A -#define GL_RGB_FLOAT16_APPLE 0x881B -#define GL_ALPHA_FLOAT16_APPLE 0x881C -#define GL_INTENSITY_FLOAT16_APPLE 0x881D -#define GL_LUMINANCE_FLOAT16_APPLE 0x881E -#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F -#define GL_COLOR_FLOAT_APPLE 0x8A0F - -#define GLEW_APPLE_float_pixels GLEW_GET_VAR(__GLEW_APPLE_float_pixels) - -#endif /* GL_APPLE_float_pixels */ - -/* ---------------------- GL_APPLE_flush_buffer_range ---------------------- */ - -#ifndef GL_APPLE_flush_buffer_range -#define GL_APPLE_flush_buffer_range 1 - -#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 -#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 - -typedef void (GLAPIENTRY * PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); - -#define glBufferParameteriAPPLE GLEW_GET_FUN(__glewBufferParameteriAPPLE) -#define glFlushMappedBufferRangeAPPLE GLEW_GET_FUN(__glewFlushMappedBufferRangeAPPLE) - -#define GLEW_APPLE_flush_buffer_range GLEW_GET_VAR(__GLEW_APPLE_flush_buffer_range) - -#endif /* GL_APPLE_flush_buffer_range */ - -/* ----------------------- GL_APPLE_object_purgeable ----------------------- */ - -#ifndef GL_APPLE_object_purgeable -#define GL_APPLE_object_purgeable 1 - -#define GL_BUFFER_OBJECT_APPLE 0x85B3 -#define GL_RELEASED_APPLE 0x8A19 -#define GL_VOLATILE_APPLE 0x8A1A -#define GL_RETAINED_APPLE 0x8A1B -#define GL_UNDEFINED_APPLE 0x8A1C -#define GL_PURGEABLE_APPLE 0x8A1D - -typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint* params); -typedef GLenum (GLAPIENTRY * PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); -typedef GLenum (GLAPIENTRY * PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); - -#define glGetObjectParameterivAPPLE GLEW_GET_FUN(__glewGetObjectParameterivAPPLE) -#define glObjectPurgeableAPPLE GLEW_GET_FUN(__glewObjectPurgeableAPPLE) -#define glObjectUnpurgeableAPPLE GLEW_GET_FUN(__glewObjectUnpurgeableAPPLE) - -#define GLEW_APPLE_object_purgeable GLEW_GET_VAR(__GLEW_APPLE_object_purgeable) - -#endif /* GL_APPLE_object_purgeable */ - -/* ------------------------- GL_APPLE_pixel_buffer ------------------------- */ - -#ifndef GL_APPLE_pixel_buffer -#define GL_APPLE_pixel_buffer 1 - -#define GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE 0x8A10 - -#define GLEW_APPLE_pixel_buffer GLEW_GET_VAR(__GLEW_APPLE_pixel_buffer) - -#endif /* GL_APPLE_pixel_buffer */ - -/* ---------------------------- GL_APPLE_rgb_422 --------------------------- */ - -#ifndef GL_APPLE_rgb_422 -#define GL_APPLE_rgb_422 1 - -#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB -#define GL_RGB_422_APPLE 0x8A1F -#define GL_RGB_RAW_422_APPLE 0x8A51 - -#define GLEW_APPLE_rgb_422 GLEW_GET_VAR(__GLEW_APPLE_rgb_422) - -#endif /* GL_APPLE_rgb_422 */ - -/* --------------------------- GL_APPLE_row_bytes -------------------------- */ - -#ifndef GL_APPLE_row_bytes -#define GL_APPLE_row_bytes 1 - -#define GL_PACK_ROW_BYTES_APPLE 0x8A15 -#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 - -#define GLEW_APPLE_row_bytes GLEW_GET_VAR(__GLEW_APPLE_row_bytes) - -#endif /* GL_APPLE_row_bytes */ - -/* ------------------------ GL_APPLE_specular_vector ----------------------- */ - -#ifndef GL_APPLE_specular_vector -#define GL_APPLE_specular_vector 1 - -#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 - -#define GLEW_APPLE_specular_vector GLEW_GET_VAR(__GLEW_APPLE_specular_vector) - -#endif /* GL_APPLE_specular_vector */ - -/* ------------------------- GL_APPLE_texture_range ------------------------ */ - -#ifndef GL_APPLE_texture_range -#define GL_APPLE_texture_range 1 - -#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 -#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 -#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC -#define GL_STORAGE_PRIVATE_APPLE 0x85BD -#define GL_STORAGE_CACHED_APPLE 0x85BE -#define GL_STORAGE_SHARED_APPLE 0x85BF - -typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, void **params); -typedef void (GLAPIENTRY * PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, void *pointer); - -#define glGetTexParameterPointervAPPLE GLEW_GET_FUN(__glewGetTexParameterPointervAPPLE) -#define glTextureRangeAPPLE GLEW_GET_FUN(__glewTextureRangeAPPLE) - -#define GLEW_APPLE_texture_range GLEW_GET_VAR(__GLEW_APPLE_texture_range) - -#endif /* GL_APPLE_texture_range */ - -/* ------------------------ GL_APPLE_transform_hint ------------------------ */ - -#ifndef GL_APPLE_transform_hint -#define GL_APPLE_transform_hint 1 - -#define GL_TRANSFORM_HINT_APPLE 0x85B1 - -#define GLEW_APPLE_transform_hint GLEW_GET_VAR(__GLEW_APPLE_transform_hint) - -#endif /* GL_APPLE_transform_hint */ - -/* ---------------------- GL_APPLE_vertex_array_object --------------------- */ - -#ifndef GL_APPLE_vertex_array_object -#define GL_APPLE_vertex_array_object 1 - -#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 - -typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); -typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); -typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); -typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); - -#define glBindVertexArrayAPPLE GLEW_GET_FUN(__glewBindVertexArrayAPPLE) -#define glDeleteVertexArraysAPPLE GLEW_GET_FUN(__glewDeleteVertexArraysAPPLE) -#define glGenVertexArraysAPPLE GLEW_GET_FUN(__glewGenVertexArraysAPPLE) -#define glIsVertexArrayAPPLE GLEW_GET_FUN(__glewIsVertexArrayAPPLE) - -#define GLEW_APPLE_vertex_array_object GLEW_GET_VAR(__GLEW_APPLE_vertex_array_object) - -#endif /* GL_APPLE_vertex_array_object */ - -/* ---------------------- GL_APPLE_vertex_array_range ---------------------- */ - -#ifndef GL_APPLE_vertex_array_range -#define GL_APPLE_vertex_array_range 1 - -#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E -#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F -#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE 0x8520 -#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 -#define GL_STORAGE_CLIENT_APPLE 0x85B4 -#define GL_STORAGE_CACHED_APPLE 0x85BE -#define GL_STORAGE_SHARED_APPLE 0x85BF - -typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); - -#define glFlushVertexArrayRangeAPPLE GLEW_GET_FUN(__glewFlushVertexArrayRangeAPPLE) -#define glVertexArrayParameteriAPPLE GLEW_GET_FUN(__glewVertexArrayParameteriAPPLE) -#define glVertexArrayRangeAPPLE GLEW_GET_FUN(__glewVertexArrayRangeAPPLE) - -#define GLEW_APPLE_vertex_array_range GLEW_GET_VAR(__GLEW_APPLE_vertex_array_range) - -#endif /* GL_APPLE_vertex_array_range */ - -/* ------------------- GL_APPLE_vertex_program_evaluators ------------------ */ - -#ifndef GL_APPLE_vertex_program_evaluators -#define GL_APPLE_vertex_program_evaluators 1 - -#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 -#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 -#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 -#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 -#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 -#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 -#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 -#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 -#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 -#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 - -typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); -typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); -typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname); -typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble* points); -typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat* points); -typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble* points); -typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat* points); - -#define glDisableVertexAttribAPPLE GLEW_GET_FUN(__glewDisableVertexAttribAPPLE) -#define glEnableVertexAttribAPPLE GLEW_GET_FUN(__glewEnableVertexAttribAPPLE) -#define glIsVertexAttribEnabledAPPLE GLEW_GET_FUN(__glewIsVertexAttribEnabledAPPLE) -#define glMapVertexAttrib1dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1dAPPLE) -#define glMapVertexAttrib1fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1fAPPLE) -#define glMapVertexAttrib2dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2dAPPLE) -#define glMapVertexAttrib2fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2fAPPLE) - -#define GLEW_APPLE_vertex_program_evaluators GLEW_GET_VAR(__GLEW_APPLE_vertex_program_evaluators) - -#endif /* GL_APPLE_vertex_program_evaluators */ - -/* --------------------------- GL_APPLE_ycbcr_422 -------------------------- */ - -#ifndef GL_APPLE_ycbcr_422 -#define GL_APPLE_ycbcr_422 1 - -#define GL_YCBCR_422_APPLE 0x85B9 - -#define GLEW_APPLE_ycbcr_422 GLEW_GET_VAR(__GLEW_APPLE_ycbcr_422) - -#endif /* GL_APPLE_ycbcr_422 */ - -/* ------------------------ GL_ARB_ES2_compatibility ----------------------- */ - -#ifndef GL_ARB_ES2_compatibility -#define GL_ARB_ES2_compatibility 1 - -#define GL_FIXED 0x140C -#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B -#define GL_RGB565 0x8D62 -#define GL_LOW_FLOAT 0x8DF0 -#define GL_MEDIUM_FLOAT 0x8DF1 -#define GL_HIGH_FLOAT 0x8DF2 -#define GL_LOW_INT 0x8DF3 -#define GL_MEDIUM_INT 0x8DF4 -#define GL_HIGH_INT 0x8DF5 -#define GL_SHADER_BINARY_FORMATS 0x8DF8 -#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 -#define GL_SHADER_COMPILER 0x8DFA -#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB -#define GL_MAX_VARYING_VECTORS 0x8DFC -#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD - -typedef int GLfixed; - -typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFPROC) (GLclampf d); -typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFPROC) (GLclampf n, GLclampf f); -typedef void (GLAPIENTRY * PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint* range, GLint *precision); -typedef void (GLAPIENTRY * PFNGLRELEASESHADERCOMPILERPROC) (void); -typedef void (GLAPIENTRY * PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint* shaders, GLenum binaryformat, const void*binary, GLsizei length); - -#define glClearDepthf GLEW_GET_FUN(__glewClearDepthf) -#define glDepthRangef GLEW_GET_FUN(__glewDepthRangef) -#define glGetShaderPrecisionFormat GLEW_GET_FUN(__glewGetShaderPrecisionFormat) -#define glReleaseShaderCompiler GLEW_GET_FUN(__glewReleaseShaderCompiler) -#define glShaderBinary GLEW_GET_FUN(__glewShaderBinary) - -#define GLEW_ARB_ES2_compatibility GLEW_GET_VAR(__GLEW_ARB_ES2_compatibility) - -#endif /* GL_ARB_ES2_compatibility */ - -/* ----------------------- GL_ARB_ES3_1_compatibility ---------------------- */ - -#ifndef GL_ARB_ES3_1_compatibility -#define GL_ARB_ES3_1_compatibility 1 - -typedef void (GLAPIENTRY * PFNGLMEMORYBARRIERBYREGIONPROC) (GLbitfield barriers); - -#define glMemoryBarrierByRegion GLEW_GET_FUN(__glewMemoryBarrierByRegion) - -#define GLEW_ARB_ES3_1_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_1_compatibility) - -#endif /* GL_ARB_ES3_1_compatibility */ - -/* ----------------------- GL_ARB_ES3_2_compatibility ---------------------- */ - -#ifndef GL_ARB_ES3_2_compatibility -#define GL_ARB_ES3_2_compatibility 1 - -#define GL_PRIMITIVE_BOUNDING_BOX_ARB 0x92BE -#define GL_MULTISAMPLE_LINE_WIDTH_RANGE_ARB 0x9381 -#define GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB 0x9382 - -typedef void (GLAPIENTRY * PFNGLPRIMITIVEBOUNDINGBOXARBPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); - -#define glPrimitiveBoundingBoxARB GLEW_GET_FUN(__glewPrimitiveBoundingBoxARB) - -#define GLEW_ARB_ES3_2_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_2_compatibility) - -#endif /* GL_ARB_ES3_2_compatibility */ - -/* ------------------------ GL_ARB_ES3_compatibility ----------------------- */ - -#ifndef GL_ARB_ES3_compatibility -#define GL_ARB_ES3_compatibility 1 - -#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF -#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 -#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A -#define GL_MAX_ELEMENT_INDEX 0x8D6B -#define GL_COMPRESSED_R11_EAC 0x9270 -#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 -#define GL_COMPRESSED_RG11_EAC 0x9272 -#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 -#define GL_COMPRESSED_RGB8_ETC2 0x9274 -#define GL_COMPRESSED_SRGB8_ETC2 0x9275 -#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 -#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 -#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 -#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 - -#define GLEW_ARB_ES3_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_compatibility) - -#endif /* GL_ARB_ES3_compatibility */ - -/* ------------------------ GL_ARB_arrays_of_arrays ------------------------ */ - -#ifndef GL_ARB_arrays_of_arrays -#define GL_ARB_arrays_of_arrays 1 - -#define GLEW_ARB_arrays_of_arrays GLEW_GET_VAR(__GLEW_ARB_arrays_of_arrays) - -#endif /* GL_ARB_arrays_of_arrays */ - -/* -------------------------- GL_ARB_base_instance ------------------------- */ - -#ifndef GL_ARB_base_instance -#define GL_ARB_base_instance 1 - -typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance); -typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLuint baseinstance); -typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLint basevertex, GLuint baseinstance); - -#define glDrawArraysInstancedBaseInstance GLEW_GET_FUN(__glewDrawArraysInstancedBaseInstance) -#define glDrawElementsInstancedBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseInstance) -#define glDrawElementsInstancedBaseVertexBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexBaseInstance) - -#define GLEW_ARB_base_instance GLEW_GET_VAR(__GLEW_ARB_base_instance) - -#endif /* GL_ARB_base_instance */ - -/* ------------------------ GL_ARB_bindless_texture ------------------------ */ - -#ifndef GL_ARB_bindless_texture -#define GL_ARB_bindless_texture 1 - -#define GL_UNSIGNED_INT64_ARB 0x140F - -typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLEARBPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); -typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLEARBPROC) (GLuint texture); -typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLEARBPROC) (GLuint texture, GLuint sampler); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VARBPROC) (GLuint index, GLenum pname, GLuint64EXT* params); -typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle); -typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); -typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC) (GLuint64 handle); -typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle, GLenum access); -typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC) (GLuint64 handle); -typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC) (GLuint program, GLint location, GLuint64 value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values); -typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64ARBPROC) (GLint location, GLuint64 value); -typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64ARBPROC) (GLuint index, GLuint64EXT x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VARBPROC) (GLuint index, const GLuint64EXT* v); - -#define glGetImageHandleARB GLEW_GET_FUN(__glewGetImageHandleARB) -#define glGetTextureHandleARB GLEW_GET_FUN(__glewGetTextureHandleARB) -#define glGetTextureSamplerHandleARB GLEW_GET_FUN(__glewGetTextureSamplerHandleARB) -#define glGetVertexAttribLui64vARB GLEW_GET_FUN(__glewGetVertexAttribLui64vARB) -#define glIsImageHandleResidentARB GLEW_GET_FUN(__glewIsImageHandleResidentARB) -#define glIsTextureHandleResidentARB GLEW_GET_FUN(__glewIsTextureHandleResidentARB) -#define glMakeImageHandleNonResidentARB GLEW_GET_FUN(__glewMakeImageHandleNonResidentARB) -#define glMakeImageHandleResidentARB GLEW_GET_FUN(__glewMakeImageHandleResidentARB) -#define glMakeTextureHandleNonResidentARB GLEW_GET_FUN(__glewMakeTextureHandleNonResidentARB) -#define glMakeTextureHandleResidentARB GLEW_GET_FUN(__glewMakeTextureHandleResidentARB) -#define glProgramUniformHandleui64ARB GLEW_GET_FUN(__glewProgramUniformHandleui64ARB) -#define glProgramUniformHandleui64vARB GLEW_GET_FUN(__glewProgramUniformHandleui64vARB) -#define glUniformHandleui64ARB GLEW_GET_FUN(__glewUniformHandleui64ARB) -#define glUniformHandleui64vARB GLEW_GET_FUN(__glewUniformHandleui64vARB) -#define glVertexAttribL1ui64ARB GLEW_GET_FUN(__glewVertexAttribL1ui64ARB) -#define glVertexAttribL1ui64vARB GLEW_GET_FUN(__glewVertexAttribL1ui64vARB) - -#define GLEW_ARB_bindless_texture GLEW_GET_VAR(__GLEW_ARB_bindless_texture) - -#endif /* GL_ARB_bindless_texture */ - -/* ----------------------- GL_ARB_blend_func_extended ---------------------- */ - -#ifndef GL_ARB_blend_func_extended -#define GL_ARB_blend_func_extended 1 - -#define GL_SRC1_COLOR 0x88F9 -#define GL_ONE_MINUS_SRC1_COLOR 0x88FA -#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB -#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC - -typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar * name); -typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar * name); - -#define glBindFragDataLocationIndexed GLEW_GET_FUN(__glewBindFragDataLocationIndexed) -#define glGetFragDataIndex GLEW_GET_FUN(__glewGetFragDataIndex) - -#define GLEW_ARB_blend_func_extended GLEW_GET_VAR(__GLEW_ARB_blend_func_extended) - -#endif /* GL_ARB_blend_func_extended */ - -/* ------------------------- GL_ARB_buffer_storage ------------------------- */ - -#ifndef GL_ARB_buffer_storage -#define GL_ARB_buffer_storage 1 - -#define GL_MAP_READ_BIT 0x0001 -#define GL_MAP_WRITE_BIT 0x0002 -#define GL_MAP_PERSISTENT_BIT 0x00000040 -#define GL_MAP_COHERENT_BIT 0x00000080 -#define GL_DYNAMIC_STORAGE_BIT 0x0100 -#define GL_CLIENT_STORAGE_BIT 0x0200 -#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000 -#define GL_BUFFER_IMMUTABLE_STORAGE 0x821F -#define GL_BUFFER_STORAGE_FLAGS 0x8220 - -typedef void (GLAPIENTRY * PFNGLBUFFERSTORAGEPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); -typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); - -#define glBufferStorage GLEW_GET_FUN(__glewBufferStorage) -#define glNamedBufferStorageEXT GLEW_GET_FUN(__glewNamedBufferStorageEXT) - -#define GLEW_ARB_buffer_storage GLEW_GET_VAR(__GLEW_ARB_buffer_storage) - -#endif /* GL_ARB_buffer_storage */ - -/* ---------------------------- GL_ARB_cl_event ---------------------------- */ - -#ifndef GL_ARB_cl_event -#define GL_ARB_cl_event 1 - -#define GL_SYNC_CL_EVENT_ARB 0x8240 -#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 - -typedef struct _cl_context *cl_context; -typedef struct _cl_event *cl_event; - -typedef GLsync (GLAPIENTRY * PFNGLCREATESYNCFROMCLEVENTARBPROC) (cl_context context, cl_event event, GLbitfield flags); - -#define glCreateSyncFromCLeventARB GLEW_GET_FUN(__glewCreateSyncFromCLeventARB) - -#define GLEW_ARB_cl_event GLEW_GET_VAR(__GLEW_ARB_cl_event) - -#endif /* GL_ARB_cl_event */ - -/* ----------------------- GL_ARB_clear_buffer_object ---------------------- */ - -#ifndef GL_ARB_clear_buffer_object -#define GL_ARB_clear_buffer_object 1 - -typedef void (GLAPIENTRY * PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); -typedef void (GLAPIENTRY * PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); -typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); -typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); - -#define glClearBufferData GLEW_GET_FUN(__glewClearBufferData) -#define glClearBufferSubData GLEW_GET_FUN(__glewClearBufferSubData) -#define glClearNamedBufferDataEXT GLEW_GET_FUN(__glewClearNamedBufferDataEXT) -#define glClearNamedBufferSubDataEXT GLEW_GET_FUN(__glewClearNamedBufferSubDataEXT) - -#define GLEW_ARB_clear_buffer_object GLEW_GET_VAR(__GLEW_ARB_clear_buffer_object) - -#endif /* GL_ARB_clear_buffer_object */ - -/* -------------------------- GL_ARB_clear_texture ------------------------- */ - -#ifndef GL_ARB_clear_texture -#define GL_ARB_clear_texture 1 - -#define GL_CLEAR_TEXTURE 0x9365 - -typedef void (GLAPIENTRY * PFNGLCLEARTEXIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); -typedef void (GLAPIENTRY * PFNGLCLEARTEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); - -#define glClearTexImage GLEW_GET_FUN(__glewClearTexImage) -#define glClearTexSubImage GLEW_GET_FUN(__glewClearTexSubImage) - -#define GLEW_ARB_clear_texture GLEW_GET_VAR(__GLEW_ARB_clear_texture) - -#endif /* GL_ARB_clear_texture */ - -/* -------------------------- GL_ARB_clip_control -------------------------- */ - -#ifndef GL_ARB_clip_control -#define GL_ARB_clip_control 1 - -#define GL_LOWER_LEFT 0x8CA1 -#define GL_UPPER_LEFT 0x8CA2 -#define GL_CLIP_ORIGIN 0x935C -#define GL_CLIP_DEPTH_MODE 0x935D -#define GL_NEGATIVE_ONE_TO_ONE 0x935E -#define GL_ZERO_TO_ONE 0x935F - -typedef void (GLAPIENTRY * PFNGLCLIPCONTROLPROC) (GLenum origin, GLenum depth); - -#define glClipControl GLEW_GET_FUN(__glewClipControl) - -#define GLEW_ARB_clip_control GLEW_GET_VAR(__GLEW_ARB_clip_control) - -#endif /* GL_ARB_clip_control */ - -/* ----------------------- GL_ARB_color_buffer_float ----------------------- */ - -#ifndef GL_ARB_color_buffer_float -#define GL_ARB_color_buffer_float 1 - -#define GL_RGBA_FLOAT_MODE_ARB 0x8820 -#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A -#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B -#define GL_CLAMP_READ_COLOR_ARB 0x891C -#define GL_FIXED_ONLY_ARB 0x891D - -typedef void (GLAPIENTRY * PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); - -#define glClampColorARB GLEW_GET_FUN(__glewClampColorARB) - -#define GLEW_ARB_color_buffer_float GLEW_GET_VAR(__GLEW_ARB_color_buffer_float) - -#endif /* GL_ARB_color_buffer_float */ - -/* -------------------------- GL_ARB_compatibility ------------------------- */ - -#ifndef GL_ARB_compatibility -#define GL_ARB_compatibility 1 - -#define GLEW_ARB_compatibility GLEW_GET_VAR(__GLEW_ARB_compatibility) - -#endif /* GL_ARB_compatibility */ - -/* ---------------- GL_ARB_compressed_texture_pixel_storage ---------------- */ - -#ifndef GL_ARB_compressed_texture_pixel_storage -#define GL_ARB_compressed_texture_pixel_storage 1 - -#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 -#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 -#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 -#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A -#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B -#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C -#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D -#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E - -#define GLEW_ARB_compressed_texture_pixel_storage GLEW_GET_VAR(__GLEW_ARB_compressed_texture_pixel_storage) - -#endif /* GL_ARB_compressed_texture_pixel_storage */ - -/* ------------------------- GL_ARB_compute_shader ------------------------- */ - -#ifndef GL_ARB_compute_shader -#define GL_ARB_compute_shader 1 - -#define GL_COMPUTE_SHADER_BIT 0x00000020 -#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 -#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 -#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 -#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 -#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 -#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267 -#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB -#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED -#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE -#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF -#define GL_COMPUTE_SHADER 0x91B9 -#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB -#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC -#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD -#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE -#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF - -typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); -typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); - -#define glDispatchCompute GLEW_GET_FUN(__glewDispatchCompute) -#define glDispatchComputeIndirect GLEW_GET_FUN(__glewDispatchComputeIndirect) - -#define GLEW_ARB_compute_shader GLEW_GET_VAR(__GLEW_ARB_compute_shader) - -#endif /* GL_ARB_compute_shader */ - -/* ------------------- GL_ARB_compute_variable_group_size ------------------ */ - -#ifndef GL_ARB_compute_variable_group_size -#define GL_ARB_compute_variable_group_size 1 - -#define GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB 0x90EB -#define GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB 0x91BF -#define GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB 0x9344 -#define GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB 0x9345 - -typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); - -#define glDispatchComputeGroupSizeARB GLEW_GET_FUN(__glewDispatchComputeGroupSizeARB) - -#define GLEW_ARB_compute_variable_group_size GLEW_GET_VAR(__GLEW_ARB_compute_variable_group_size) - -#endif /* GL_ARB_compute_variable_group_size */ - -/* ------------------- GL_ARB_conditional_render_inverted ------------------ */ - -#ifndef GL_ARB_conditional_render_inverted -#define GL_ARB_conditional_render_inverted 1 - -#define GL_QUERY_WAIT_INVERTED 0x8E17 -#define GL_QUERY_NO_WAIT_INVERTED 0x8E18 -#define GL_QUERY_BY_REGION_WAIT_INVERTED 0x8E19 -#define GL_QUERY_BY_REGION_NO_WAIT_INVERTED 0x8E1A - -#define GLEW_ARB_conditional_render_inverted GLEW_GET_VAR(__GLEW_ARB_conditional_render_inverted) - -#endif /* GL_ARB_conditional_render_inverted */ - -/* ----------------------- GL_ARB_conservative_depth ----------------------- */ - -#ifndef GL_ARB_conservative_depth -#define GL_ARB_conservative_depth 1 - -#define GLEW_ARB_conservative_depth GLEW_GET_VAR(__GLEW_ARB_conservative_depth) - -#endif /* GL_ARB_conservative_depth */ - -/* --------------------------- GL_ARB_copy_buffer -------------------------- */ - -#ifndef GL_ARB_copy_buffer -#define GL_ARB_copy_buffer 1 - -#define GL_COPY_READ_BUFFER 0x8F36 -#define GL_COPY_WRITE_BUFFER 0x8F37 - -typedef void (GLAPIENTRY * PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size); - -#define glCopyBufferSubData GLEW_GET_FUN(__glewCopyBufferSubData) - -#define GLEW_ARB_copy_buffer GLEW_GET_VAR(__GLEW_ARB_copy_buffer) - -#endif /* GL_ARB_copy_buffer */ - -/* --------------------------- GL_ARB_copy_image --------------------------- */ - -#ifndef GL_ARB_copy_image -#define GL_ARB_copy_image 1 - -typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); - -#define glCopyImageSubData GLEW_GET_FUN(__glewCopyImageSubData) - -#define GLEW_ARB_copy_image GLEW_GET_VAR(__GLEW_ARB_copy_image) - -#endif /* GL_ARB_copy_image */ - -/* -------------------------- GL_ARB_cull_distance ------------------------- */ - -#ifndef GL_ARB_cull_distance -#define GL_ARB_cull_distance 1 - -#define GL_MAX_CULL_DISTANCES 0x82F9 -#define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES 0x82FA - -#define GLEW_ARB_cull_distance GLEW_GET_VAR(__GLEW_ARB_cull_distance) - -#endif /* GL_ARB_cull_distance */ - -/* -------------------------- GL_ARB_debug_output -------------------------- */ - -#ifndef GL_ARB_debug_output -#define GL_ARB_debug_output 1 - -#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 -#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 -#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 -#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 -#define GL_DEBUG_SOURCE_API_ARB 0x8246 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 -#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 -#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A -#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B -#define GL_DEBUG_TYPE_ERROR_ARB 0x824C -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E -#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F -#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 -#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 -#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 -#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 -#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 - -typedef void (GLAPIENTRY *GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam); - -typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const void *userParam); -typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); -typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); -typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); - -#define glDebugMessageCallbackARB GLEW_GET_FUN(__glewDebugMessageCallbackARB) -#define glDebugMessageControlARB GLEW_GET_FUN(__glewDebugMessageControlARB) -#define glDebugMessageInsertARB GLEW_GET_FUN(__glewDebugMessageInsertARB) -#define glGetDebugMessageLogARB GLEW_GET_FUN(__glewGetDebugMessageLogARB) - -#define GLEW_ARB_debug_output GLEW_GET_VAR(__GLEW_ARB_debug_output) - -#endif /* GL_ARB_debug_output */ - -/* ----------------------- GL_ARB_depth_buffer_float ----------------------- */ - -#ifndef GL_ARB_depth_buffer_float -#define GL_ARB_depth_buffer_float 1 - -#define GL_DEPTH_COMPONENT32F 0x8CAC -#define GL_DEPTH32F_STENCIL8 0x8CAD -#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD - -#define GLEW_ARB_depth_buffer_float GLEW_GET_VAR(__GLEW_ARB_depth_buffer_float) - -#endif /* GL_ARB_depth_buffer_float */ - -/* --------------------------- GL_ARB_depth_clamp -------------------------- */ - -#ifndef GL_ARB_depth_clamp -#define GL_ARB_depth_clamp 1 - -#define GL_DEPTH_CLAMP 0x864F - -#define GLEW_ARB_depth_clamp GLEW_GET_VAR(__GLEW_ARB_depth_clamp) - -#endif /* GL_ARB_depth_clamp */ - -/* -------------------------- GL_ARB_depth_texture ------------------------- */ - -#ifndef GL_ARB_depth_texture -#define GL_ARB_depth_texture 1 - -#define GL_DEPTH_COMPONENT16_ARB 0x81A5 -#define GL_DEPTH_COMPONENT24_ARB 0x81A6 -#define GL_DEPTH_COMPONENT32_ARB 0x81A7 -#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A -#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B - -#define GLEW_ARB_depth_texture GLEW_GET_VAR(__GLEW_ARB_depth_texture) - -#endif /* GL_ARB_depth_texture */ - -/* ----------------------- GL_ARB_derivative_control ----------------------- */ - -#ifndef GL_ARB_derivative_control -#define GL_ARB_derivative_control 1 - -#define GLEW_ARB_derivative_control GLEW_GET_VAR(__GLEW_ARB_derivative_control) - -#endif /* GL_ARB_derivative_control */ - -/* ----------------------- GL_ARB_direct_state_access ---------------------- */ - -#ifndef GL_ARB_direct_state_access -#define GL_ARB_direct_state_access 1 - -#define GL_TEXTURE_TARGET 0x1006 -#define GL_QUERY_TARGET 0x82EA - -typedef void (GLAPIENTRY * PFNGLBINDTEXTUREUNITPROC) (GLuint unit, GLuint texture); -typedef void (GLAPIENTRY * PFNGLBLITNAMEDFRAMEBUFFERPROC) (GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -typedef GLenum (GLAPIENTRY * PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC) (GLuint framebuffer, GLenum target); -typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERDATAPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); -typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); -typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERFIPROC) (GLuint framebuffer, GLenum buffer, GLfloat depth, GLint stencil); -typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERFVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint* value); -typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLCOPYNAMEDBUFFERSUBDATAPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLCREATEBUFFERSPROC) (GLsizei n, GLuint* buffers); -typedef void (GLAPIENTRY * PFNGLCREATEFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers); -typedef void (GLAPIENTRY * PFNGLCREATEPROGRAMPIPELINESPROC) (GLsizei n, GLuint* pipelines); -typedef void (GLAPIENTRY * PFNGLCREATEQUERIESPROC) (GLenum target, GLsizei n, GLuint* ids); -typedef void (GLAPIENTRY * PFNGLCREATERENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers); -typedef void (GLAPIENTRY * PFNGLCREATESAMPLERSPROC) (GLsizei n, GLuint* samplers); -typedef void (GLAPIENTRY * PFNGLCREATETEXTURESPROC) (GLenum target, GLsizei n, GLuint* textures); -typedef void (GLAPIENTRY * PFNGLCREATETRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint* ids); -typedef void (GLAPIENTRY * PFNGLCREATEVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays); -typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index); -typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index); -typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); -typedef void (GLAPIENTRY * PFNGLGENERATETEXTUREMIPMAPPROC) (GLuint texture); -typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLsizei bufSize, void *pixels); -typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERI64VPROC) (GLuint buffer, GLenum pname, GLint64* params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERIVPROC) (GLuint buffer, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPOINTERVPROC) (GLuint buffer, GLenum pname, void** params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); -typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC) (GLuint framebuffer, GLenum pname, GLint* param); -typedef void (GLAPIENTRY * PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC) (GLuint renderbuffer, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTI64VPROC) (GLuint id,GLuint buffer,GLenum pname,GLintptr offset); -typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTIVPROC) (GLuint id,GLuint buffer,GLenum pname,GLintptr offset); -typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTUI64VPROC) (GLuint id,GLuint buffer,GLenum pname,GLintptr offset); -typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTUIVPROC) (GLuint id,GLuint buffer,GLenum pname,GLintptr offset); -typedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels); -typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERFVPROC) (GLuint texture, GLint level, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERIVPROC) (GLuint texture, GLint level, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, GLuint* params); -typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKI64_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint64* param); -typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKI_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint* param); -typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKIVPROC) (GLuint xfb, GLenum pname, GLint* param); -typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINDEXED64IVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint64* param); -typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINDEXEDIVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint* param); -typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYIVPROC) (GLuint vaobj, GLenum pname, GLint* param); -typedef void (GLAPIENTRY * PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum* attachments); -typedef void (GLAPIENTRY * PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERPROC) (GLuint buffer, GLenum access); -typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); -typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERDATAPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); -typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); -typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC) (GLuint framebuffer, GLenum mode); -typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC) (GLuint framebuffer, GLsizei n, const GLenum* bufs); -typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC) (GLuint framebuffer, GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC) (GLuint framebuffer, GLenum mode); -typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); -typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERPROC) (GLuint texture, GLenum internalformat, GLuint buffer); -typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERRANGEPROC) (GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, const GLuint* params); -typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFPROC) (GLuint texture, GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, const GLfloat* param); -typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIPROC) (GLuint texture, GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, const GLint* param); -typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE1DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC) (GLuint xfb, GLuint index, GLuint buffer); -typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC) (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFERPROC) (GLuint buffer); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBBINDINGPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBIFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBLFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYBINDINGDIVISORPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYELEMENTBUFFERPROC) (GLuint vaobj, GLuint buffer); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXBUFFERPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXBUFFERSPROC) (GLuint vaobj, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizei *strides); - -#define glBindTextureUnit GLEW_GET_FUN(__glewBindTextureUnit) -#define glBlitNamedFramebuffer GLEW_GET_FUN(__glewBlitNamedFramebuffer) -#define glCheckNamedFramebufferStatus GLEW_GET_FUN(__glewCheckNamedFramebufferStatus) -#define glClearNamedBufferData GLEW_GET_FUN(__glewClearNamedBufferData) -#define glClearNamedBufferSubData GLEW_GET_FUN(__glewClearNamedBufferSubData) -#define glClearNamedFramebufferfi GLEW_GET_FUN(__glewClearNamedFramebufferfi) -#define glClearNamedFramebufferfv GLEW_GET_FUN(__glewClearNamedFramebufferfv) -#define glClearNamedFramebufferiv GLEW_GET_FUN(__glewClearNamedFramebufferiv) -#define glClearNamedFramebufferuiv GLEW_GET_FUN(__glewClearNamedFramebufferuiv) -#define glCompressedTextureSubImage1D GLEW_GET_FUN(__glewCompressedTextureSubImage1D) -#define glCompressedTextureSubImage2D GLEW_GET_FUN(__glewCompressedTextureSubImage2D) -#define glCompressedTextureSubImage3D GLEW_GET_FUN(__glewCompressedTextureSubImage3D) -#define glCopyNamedBufferSubData GLEW_GET_FUN(__glewCopyNamedBufferSubData) -#define glCopyTextureSubImage1D GLEW_GET_FUN(__glewCopyTextureSubImage1D) -#define glCopyTextureSubImage2D GLEW_GET_FUN(__glewCopyTextureSubImage2D) -#define glCopyTextureSubImage3D GLEW_GET_FUN(__glewCopyTextureSubImage3D) -#define glCreateBuffers GLEW_GET_FUN(__glewCreateBuffers) -#define glCreateFramebuffers GLEW_GET_FUN(__glewCreateFramebuffers) -#define glCreateProgramPipelines GLEW_GET_FUN(__glewCreateProgramPipelines) -#define glCreateQueries GLEW_GET_FUN(__glewCreateQueries) -#define glCreateRenderbuffers GLEW_GET_FUN(__glewCreateRenderbuffers) -#define glCreateSamplers GLEW_GET_FUN(__glewCreateSamplers) -#define glCreateTextures GLEW_GET_FUN(__glewCreateTextures) -#define glCreateTransformFeedbacks GLEW_GET_FUN(__glewCreateTransformFeedbacks) -#define glCreateVertexArrays GLEW_GET_FUN(__glewCreateVertexArrays) -#define glDisableVertexArrayAttrib GLEW_GET_FUN(__glewDisableVertexArrayAttrib) -#define glEnableVertexArrayAttrib GLEW_GET_FUN(__glewEnableVertexArrayAttrib) -#define glFlushMappedNamedBufferRange GLEW_GET_FUN(__glewFlushMappedNamedBufferRange) -#define glGenerateTextureMipmap GLEW_GET_FUN(__glewGenerateTextureMipmap) -#define glGetCompressedTextureImage GLEW_GET_FUN(__glewGetCompressedTextureImage) -#define glGetNamedBufferParameteri64v GLEW_GET_FUN(__glewGetNamedBufferParameteri64v) -#define glGetNamedBufferParameteriv GLEW_GET_FUN(__glewGetNamedBufferParameteriv) -#define glGetNamedBufferPointerv GLEW_GET_FUN(__glewGetNamedBufferPointerv) -#define glGetNamedBufferSubData GLEW_GET_FUN(__glewGetNamedBufferSubData) -#define glGetNamedFramebufferAttachmentParameteriv GLEW_GET_FUN(__glewGetNamedFramebufferAttachmentParameteriv) -#define glGetNamedFramebufferParameteriv GLEW_GET_FUN(__glewGetNamedFramebufferParameteriv) -#define glGetNamedRenderbufferParameteriv GLEW_GET_FUN(__glewGetNamedRenderbufferParameteriv) -#define glGetQueryBufferObjecti64v GLEW_GET_FUN(__glewGetQueryBufferObjecti64v) -#define glGetQueryBufferObjectiv GLEW_GET_FUN(__glewGetQueryBufferObjectiv) -#define glGetQueryBufferObjectui64v GLEW_GET_FUN(__glewGetQueryBufferObjectui64v) -#define glGetQueryBufferObjectuiv GLEW_GET_FUN(__glewGetQueryBufferObjectuiv) -#define glGetTextureImage GLEW_GET_FUN(__glewGetTextureImage) -#define glGetTextureLevelParameterfv GLEW_GET_FUN(__glewGetTextureLevelParameterfv) -#define glGetTextureLevelParameteriv GLEW_GET_FUN(__glewGetTextureLevelParameteriv) -#define glGetTextureParameterIiv GLEW_GET_FUN(__glewGetTextureParameterIiv) -#define glGetTextureParameterIuiv GLEW_GET_FUN(__glewGetTextureParameterIuiv) -#define glGetTextureParameterfv GLEW_GET_FUN(__glewGetTextureParameterfv) -#define glGetTextureParameteriv GLEW_GET_FUN(__glewGetTextureParameteriv) -#define glGetTransformFeedbacki64_v GLEW_GET_FUN(__glewGetTransformFeedbacki64_v) -#define glGetTransformFeedbacki_v GLEW_GET_FUN(__glewGetTransformFeedbacki_v) -#define glGetTransformFeedbackiv GLEW_GET_FUN(__glewGetTransformFeedbackiv) -#define glGetVertexArrayIndexed64iv GLEW_GET_FUN(__glewGetVertexArrayIndexed64iv) -#define glGetVertexArrayIndexediv GLEW_GET_FUN(__glewGetVertexArrayIndexediv) -#define glGetVertexArrayiv GLEW_GET_FUN(__glewGetVertexArrayiv) -#define glInvalidateNamedFramebufferData GLEW_GET_FUN(__glewInvalidateNamedFramebufferData) -#define glInvalidateNamedFramebufferSubData GLEW_GET_FUN(__glewInvalidateNamedFramebufferSubData) -#define glMapNamedBuffer GLEW_GET_FUN(__glewMapNamedBuffer) -#define glMapNamedBufferRange GLEW_GET_FUN(__glewMapNamedBufferRange) -#define glNamedBufferData GLEW_GET_FUN(__glewNamedBufferData) -#define glNamedBufferStorage GLEW_GET_FUN(__glewNamedBufferStorage) -#define glNamedBufferSubData GLEW_GET_FUN(__glewNamedBufferSubData) -#define glNamedFramebufferDrawBuffer GLEW_GET_FUN(__glewNamedFramebufferDrawBuffer) -#define glNamedFramebufferDrawBuffers GLEW_GET_FUN(__glewNamedFramebufferDrawBuffers) -#define glNamedFramebufferParameteri GLEW_GET_FUN(__glewNamedFramebufferParameteri) -#define glNamedFramebufferReadBuffer GLEW_GET_FUN(__glewNamedFramebufferReadBuffer) -#define glNamedFramebufferRenderbuffer GLEW_GET_FUN(__glewNamedFramebufferRenderbuffer) -#define glNamedFramebufferTexture GLEW_GET_FUN(__glewNamedFramebufferTexture) -#define glNamedFramebufferTextureLayer GLEW_GET_FUN(__glewNamedFramebufferTextureLayer) -#define glNamedRenderbufferStorage GLEW_GET_FUN(__glewNamedRenderbufferStorage) -#define glNamedRenderbufferStorageMultisample GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisample) -#define glTextureBuffer GLEW_GET_FUN(__glewTextureBuffer) -#define glTextureBufferRange GLEW_GET_FUN(__glewTextureBufferRange) -#define glTextureParameterIiv GLEW_GET_FUN(__glewTextureParameterIiv) -#define glTextureParameterIuiv GLEW_GET_FUN(__glewTextureParameterIuiv) -#define glTextureParameterf GLEW_GET_FUN(__glewTextureParameterf) -#define glTextureParameterfv GLEW_GET_FUN(__glewTextureParameterfv) -#define glTextureParameteri GLEW_GET_FUN(__glewTextureParameteri) -#define glTextureParameteriv GLEW_GET_FUN(__glewTextureParameteriv) -#define glTextureStorage1D GLEW_GET_FUN(__glewTextureStorage1D) -#define glTextureStorage2D GLEW_GET_FUN(__glewTextureStorage2D) -#define glTextureStorage2DMultisample GLEW_GET_FUN(__glewTextureStorage2DMultisample) -#define glTextureStorage3D GLEW_GET_FUN(__glewTextureStorage3D) -#define glTextureStorage3DMultisample GLEW_GET_FUN(__glewTextureStorage3DMultisample) -#define glTextureSubImage1D GLEW_GET_FUN(__glewTextureSubImage1D) -#define glTextureSubImage2D GLEW_GET_FUN(__glewTextureSubImage2D) -#define glTextureSubImage3D GLEW_GET_FUN(__glewTextureSubImage3D) -#define glTransformFeedbackBufferBase GLEW_GET_FUN(__glewTransformFeedbackBufferBase) -#define glTransformFeedbackBufferRange GLEW_GET_FUN(__glewTransformFeedbackBufferRange) -#define glUnmapNamedBuffer GLEW_GET_FUN(__glewUnmapNamedBuffer) -#define glVertexArrayAttribBinding GLEW_GET_FUN(__glewVertexArrayAttribBinding) -#define glVertexArrayAttribFormat GLEW_GET_FUN(__glewVertexArrayAttribFormat) -#define glVertexArrayAttribIFormat GLEW_GET_FUN(__glewVertexArrayAttribIFormat) -#define glVertexArrayAttribLFormat GLEW_GET_FUN(__glewVertexArrayAttribLFormat) -#define glVertexArrayBindingDivisor GLEW_GET_FUN(__glewVertexArrayBindingDivisor) -#define glVertexArrayElementBuffer GLEW_GET_FUN(__glewVertexArrayElementBuffer) -#define glVertexArrayVertexBuffer GLEW_GET_FUN(__glewVertexArrayVertexBuffer) -#define glVertexArrayVertexBuffers GLEW_GET_FUN(__glewVertexArrayVertexBuffers) - -#define GLEW_ARB_direct_state_access GLEW_GET_VAR(__GLEW_ARB_direct_state_access) - -#endif /* GL_ARB_direct_state_access */ - -/* -------------------------- GL_ARB_draw_buffers -------------------------- */ - -#ifndef GL_ARB_draw_buffers -#define GL_ARB_draw_buffers 1 - -#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 -#define GL_DRAW_BUFFER0_ARB 0x8825 -#define GL_DRAW_BUFFER1_ARB 0x8826 -#define GL_DRAW_BUFFER2_ARB 0x8827 -#define GL_DRAW_BUFFER3_ARB 0x8828 -#define GL_DRAW_BUFFER4_ARB 0x8829 -#define GL_DRAW_BUFFER5_ARB 0x882A -#define GL_DRAW_BUFFER6_ARB 0x882B -#define GL_DRAW_BUFFER7_ARB 0x882C -#define GL_DRAW_BUFFER8_ARB 0x882D -#define GL_DRAW_BUFFER9_ARB 0x882E -#define GL_DRAW_BUFFER10_ARB 0x882F -#define GL_DRAW_BUFFER11_ARB 0x8830 -#define GL_DRAW_BUFFER12_ARB 0x8831 -#define GL_DRAW_BUFFER13_ARB 0x8832 -#define GL_DRAW_BUFFER14_ARB 0x8833 -#define GL_DRAW_BUFFER15_ARB 0x8834 - -typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum* bufs); - -#define glDrawBuffersARB GLEW_GET_FUN(__glewDrawBuffersARB) - -#define GLEW_ARB_draw_buffers GLEW_GET_VAR(__GLEW_ARB_draw_buffers) - -#endif /* GL_ARB_draw_buffers */ - -/* ----------------------- GL_ARB_draw_buffers_blend ----------------------- */ - -#ifndef GL_ARB_draw_buffers_blend -#define GL_ARB_draw_buffers_blend 1 - -typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); -typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode); -typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); -typedef void (GLAPIENTRY * PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst); - -#define glBlendEquationSeparateiARB GLEW_GET_FUN(__glewBlendEquationSeparateiARB) -#define glBlendEquationiARB GLEW_GET_FUN(__glewBlendEquationiARB) -#define glBlendFuncSeparateiARB GLEW_GET_FUN(__glewBlendFuncSeparateiARB) -#define glBlendFunciARB GLEW_GET_FUN(__glewBlendFunciARB) - -#define GLEW_ARB_draw_buffers_blend GLEW_GET_VAR(__GLEW_ARB_draw_buffers_blend) - -#endif /* GL_ARB_draw_buffers_blend */ - -/* -------------------- GL_ARB_draw_elements_base_vertex ------------------- */ - -#ifndef GL_ARB_draw_elements_base_vertex -#define GL_ARB_draw_elements_base_vertex 1 - -typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); -typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLint basevertex); -typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); -typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei* count, GLenum type, const void *const *indices, GLsizei primcount, const GLint *basevertex); - -#define glDrawElementsBaseVertex GLEW_GET_FUN(__glewDrawElementsBaseVertex) -#define glDrawElementsInstancedBaseVertex GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertex) -#define glDrawRangeElementsBaseVertex GLEW_GET_FUN(__glewDrawRangeElementsBaseVertex) -#define glMultiDrawElementsBaseVertex GLEW_GET_FUN(__glewMultiDrawElementsBaseVertex) - -#define GLEW_ARB_draw_elements_base_vertex GLEW_GET_VAR(__GLEW_ARB_draw_elements_base_vertex) - -#endif /* GL_ARB_draw_elements_base_vertex */ - -/* -------------------------- GL_ARB_draw_indirect ------------------------- */ - -#ifndef GL_ARB_draw_indirect -#define GL_ARB_draw_indirect 1 - -#define GL_DRAW_INDIRECT_BUFFER 0x8F3F -#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 - -typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect); -typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect); - -#define glDrawArraysIndirect GLEW_GET_FUN(__glewDrawArraysIndirect) -#define glDrawElementsIndirect GLEW_GET_FUN(__glewDrawElementsIndirect) - -#define GLEW_ARB_draw_indirect GLEW_GET_VAR(__GLEW_ARB_draw_indirect) - -#endif /* GL_ARB_draw_indirect */ - -/* ------------------------- GL_ARB_draw_instanced ------------------------- */ - -#ifndef GL_ARB_draw_instanced -#define GL_ARB_draw_instanced 1 - -#define GLEW_ARB_draw_instanced GLEW_GET_VAR(__GLEW_ARB_draw_instanced) - -#endif /* GL_ARB_draw_instanced */ - -/* ------------------------ GL_ARB_enhanced_layouts ------------------------ */ - -#ifndef GL_ARB_enhanced_layouts -#define GL_ARB_enhanced_layouts 1 - -#define GL_LOCATION_COMPONENT 0x934A -#define GL_TRANSFORM_FEEDBACK_BUFFER_INDEX 0x934B -#define GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE 0x934C - -#define GLEW_ARB_enhanced_layouts GLEW_GET_VAR(__GLEW_ARB_enhanced_layouts) - -#endif /* GL_ARB_enhanced_layouts */ - -/* -------------------- GL_ARB_explicit_attrib_location -------------------- */ - -#ifndef GL_ARB_explicit_attrib_location -#define GL_ARB_explicit_attrib_location 1 - -#define GLEW_ARB_explicit_attrib_location GLEW_GET_VAR(__GLEW_ARB_explicit_attrib_location) - -#endif /* GL_ARB_explicit_attrib_location */ - -/* -------------------- GL_ARB_explicit_uniform_location ------------------- */ - -#ifndef GL_ARB_explicit_uniform_location -#define GL_ARB_explicit_uniform_location 1 - -#define GL_MAX_UNIFORM_LOCATIONS 0x826E - -#define GLEW_ARB_explicit_uniform_location GLEW_GET_VAR(__GLEW_ARB_explicit_uniform_location) - -#endif /* GL_ARB_explicit_uniform_location */ - -/* ------------------- GL_ARB_fragment_coord_conventions ------------------- */ - -#ifndef GL_ARB_fragment_coord_conventions -#define GL_ARB_fragment_coord_conventions 1 - -#define GLEW_ARB_fragment_coord_conventions GLEW_GET_VAR(__GLEW_ARB_fragment_coord_conventions) - -#endif /* GL_ARB_fragment_coord_conventions */ - -/* --------------------- GL_ARB_fragment_layer_viewport -------------------- */ - -#ifndef GL_ARB_fragment_layer_viewport -#define GL_ARB_fragment_layer_viewport 1 - -#define GLEW_ARB_fragment_layer_viewport GLEW_GET_VAR(__GLEW_ARB_fragment_layer_viewport) - -#endif /* GL_ARB_fragment_layer_viewport */ - -/* ------------------------ GL_ARB_fragment_program ------------------------ */ - -#ifndef GL_ARB_fragment_program -#define GL_ARB_fragment_program 1 - -#define GL_FRAGMENT_PROGRAM_ARB 0x8804 -#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 -#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 -#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 -#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 -#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 -#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A -#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B -#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C -#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D -#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E -#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F -#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 -#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 - -#define GLEW_ARB_fragment_program GLEW_GET_VAR(__GLEW_ARB_fragment_program) - -#endif /* GL_ARB_fragment_program */ - -/* --------------------- GL_ARB_fragment_program_shadow -------------------- */ - -#ifndef GL_ARB_fragment_program_shadow -#define GL_ARB_fragment_program_shadow 1 - -#define GLEW_ARB_fragment_program_shadow GLEW_GET_VAR(__GLEW_ARB_fragment_program_shadow) - -#endif /* GL_ARB_fragment_program_shadow */ - -/* ------------------------- GL_ARB_fragment_shader ------------------------ */ - -#ifndef GL_ARB_fragment_shader -#define GL_ARB_fragment_shader 1 - -#define GL_FRAGMENT_SHADER_ARB 0x8B30 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B - -#define GLEW_ARB_fragment_shader GLEW_GET_VAR(__GLEW_ARB_fragment_shader) - -#endif /* GL_ARB_fragment_shader */ - -/* -------------------- GL_ARB_fragment_shader_interlock ------------------- */ - -#ifndef GL_ARB_fragment_shader_interlock -#define GL_ARB_fragment_shader_interlock 1 - -#define GLEW_ARB_fragment_shader_interlock GLEW_GET_VAR(__GLEW_ARB_fragment_shader_interlock) - -#endif /* GL_ARB_fragment_shader_interlock */ - -/* ------------------- GL_ARB_framebuffer_no_attachments ------------------- */ - -#ifndef GL_ARB_framebuffer_no_attachments -#define GL_ARB_framebuffer_no_attachments 1 - -#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 -#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 -#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 -#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 -#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 -#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315 -#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 -#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317 -#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 - -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param); - -#define glFramebufferParameteri GLEW_GET_FUN(__glewFramebufferParameteri) -#define glGetFramebufferParameteriv GLEW_GET_FUN(__glewGetFramebufferParameteriv) -#define glGetNamedFramebufferParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferParameterivEXT) -#define glNamedFramebufferParameteriEXT GLEW_GET_FUN(__glewNamedFramebufferParameteriEXT) - -#define GLEW_ARB_framebuffer_no_attachments GLEW_GET_VAR(__GLEW_ARB_framebuffer_no_attachments) - -#endif /* GL_ARB_framebuffer_no_attachments */ - -/* ----------------------- GL_ARB_framebuffer_object ----------------------- */ - -#ifndef GL_ARB_framebuffer_object -#define GL_ARB_framebuffer_object 1 - -#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 -#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 -#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 -#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 -#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 -#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 -#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 -#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 -#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 -#define GL_FRAMEBUFFER_DEFAULT 0x8218 -#define GL_FRAMEBUFFER_UNDEFINED 0x8219 -#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A -#define GL_INDEX 0x8222 -#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 -#define GL_DEPTH_STENCIL 0x84F9 -#define GL_UNSIGNED_INT_24_8 0x84FA -#define GL_DEPTH24_STENCIL8 0x88F0 -#define GL_TEXTURE_STENCIL_SIZE 0x88F1 -#define GL_UNSIGNED_NORMALIZED 0x8C17 -#define GL_SRGB 0x8C40 -#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_FRAMEBUFFER_BINDING 0x8CA6 -#define GL_RENDERBUFFER_BINDING 0x8CA7 -#define GL_READ_FRAMEBUFFER 0x8CA8 -#define GL_DRAW_FRAMEBUFFER 0x8CA9 -#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA -#define GL_RENDERBUFFER_SAMPLES 0x8CAB -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF -#define GL_COLOR_ATTACHMENT0 0x8CE0 -#define GL_COLOR_ATTACHMENT1 0x8CE1 -#define GL_COLOR_ATTACHMENT2 0x8CE2 -#define GL_COLOR_ATTACHMENT3 0x8CE3 -#define GL_COLOR_ATTACHMENT4 0x8CE4 -#define GL_COLOR_ATTACHMENT5 0x8CE5 -#define GL_COLOR_ATTACHMENT6 0x8CE6 -#define GL_COLOR_ATTACHMENT7 0x8CE7 -#define GL_COLOR_ATTACHMENT8 0x8CE8 -#define GL_COLOR_ATTACHMENT9 0x8CE9 -#define GL_COLOR_ATTACHMENT10 0x8CEA -#define GL_COLOR_ATTACHMENT11 0x8CEB -#define GL_COLOR_ATTACHMENT12 0x8CEC -#define GL_COLOR_ATTACHMENT13 0x8CED -#define GL_COLOR_ATTACHMENT14 0x8CEE -#define GL_COLOR_ATTACHMENT15 0x8CEF -#define GL_DEPTH_ATTACHMENT 0x8D00 -#define GL_STENCIL_ATTACHMENT 0x8D20 -#define GL_FRAMEBUFFER 0x8D40 -#define GL_RENDERBUFFER 0x8D41 -#define GL_RENDERBUFFER_WIDTH 0x8D42 -#define GL_RENDERBUFFER_HEIGHT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 -#define GL_STENCIL_INDEX1 0x8D46 -#define GL_STENCIL_INDEX4 0x8D47 -#define GL_STENCIL_INDEX8 0x8D48 -#define GL_STENCIL_INDEX16 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 -#define GL_MAX_SAMPLES 0x8D57 - -typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); -typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); -typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); -typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint* framebuffers); -typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint* renderbuffers); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer); -typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers); -typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers); -typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPPROC) (GLenum target); -typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); -typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); -typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); -typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); - -#define glBindFramebuffer GLEW_GET_FUN(__glewBindFramebuffer) -#define glBindRenderbuffer GLEW_GET_FUN(__glewBindRenderbuffer) -#define glBlitFramebuffer GLEW_GET_FUN(__glewBlitFramebuffer) -#define glCheckFramebufferStatus GLEW_GET_FUN(__glewCheckFramebufferStatus) -#define glDeleteFramebuffers GLEW_GET_FUN(__glewDeleteFramebuffers) -#define glDeleteRenderbuffers GLEW_GET_FUN(__glewDeleteRenderbuffers) -#define glFramebufferRenderbuffer GLEW_GET_FUN(__glewFramebufferRenderbuffer) -#define glFramebufferTexture1D GLEW_GET_FUN(__glewFramebufferTexture1D) -#define glFramebufferTexture2D GLEW_GET_FUN(__glewFramebufferTexture2D) -#define glFramebufferTexture3D GLEW_GET_FUN(__glewFramebufferTexture3D) -#define glFramebufferTextureLayer GLEW_GET_FUN(__glewFramebufferTextureLayer) -#define glGenFramebuffers GLEW_GET_FUN(__glewGenFramebuffers) -#define glGenRenderbuffers GLEW_GET_FUN(__glewGenRenderbuffers) -#define glGenerateMipmap GLEW_GET_FUN(__glewGenerateMipmap) -#define glGetFramebufferAttachmentParameteriv GLEW_GET_FUN(__glewGetFramebufferAttachmentParameteriv) -#define glGetRenderbufferParameteriv GLEW_GET_FUN(__glewGetRenderbufferParameteriv) -#define glIsFramebuffer GLEW_GET_FUN(__glewIsFramebuffer) -#define glIsRenderbuffer GLEW_GET_FUN(__glewIsRenderbuffer) -#define glRenderbufferStorage GLEW_GET_FUN(__glewRenderbufferStorage) -#define glRenderbufferStorageMultisample GLEW_GET_FUN(__glewRenderbufferStorageMultisample) - -#define GLEW_ARB_framebuffer_object GLEW_GET_VAR(__GLEW_ARB_framebuffer_object) - -#endif /* GL_ARB_framebuffer_object */ - -/* ------------------------ GL_ARB_framebuffer_sRGB ------------------------ */ - -#ifndef GL_ARB_framebuffer_sRGB -#define GL_ARB_framebuffer_sRGB 1 - -#define GL_FRAMEBUFFER_SRGB 0x8DB9 - -#define GLEW_ARB_framebuffer_sRGB GLEW_GET_VAR(__GLEW_ARB_framebuffer_sRGB) - -#endif /* GL_ARB_framebuffer_sRGB */ - -/* ------------------------ GL_ARB_geometry_shader4 ------------------------ */ - -#ifndef GL_ARB_geometry_shader4 -#define GL_ARB_geometry_shader4 1 - -#define GL_LINES_ADJACENCY_ARB 0xA -#define GL_LINE_STRIP_ADJACENCY_ARB 0xB -#define GL_TRIANGLES_ADJACENCY_ARB 0xC -#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0xD -#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 -#define GL_GEOMETRY_SHADER_ARB 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA -#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB -#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC -#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD -#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 - -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); - -#define glFramebufferTextureARB GLEW_GET_FUN(__glewFramebufferTextureARB) -#define glFramebufferTextureFaceARB GLEW_GET_FUN(__glewFramebufferTextureFaceARB) -#define glFramebufferTextureLayerARB GLEW_GET_FUN(__glewFramebufferTextureLayerARB) -#define glProgramParameteriARB GLEW_GET_FUN(__glewProgramParameteriARB) - -#define GLEW_ARB_geometry_shader4 GLEW_GET_VAR(__GLEW_ARB_geometry_shader4) - -#endif /* GL_ARB_geometry_shader4 */ - -/* ----------------------- GL_ARB_get_program_binary ----------------------- */ - -#ifndef GL_ARB_get_program_binary -#define GL_ARB_get_program_binary 1 - -#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 -#define GL_PROGRAM_BINARY_LENGTH 0x8741 -#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE -#define GL_PROGRAM_BINARY_FORMATS 0x87FF - -typedef void (GLAPIENTRY * PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLenum *binaryFormat, void*binary); -typedef void (GLAPIENTRY * PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length); -typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); - -#define glGetProgramBinary GLEW_GET_FUN(__glewGetProgramBinary) -#define glProgramBinary GLEW_GET_FUN(__glewProgramBinary) -#define glProgramParameteri GLEW_GET_FUN(__glewProgramParameteri) - -#define GLEW_ARB_get_program_binary GLEW_GET_VAR(__GLEW_ARB_get_program_binary) - -#endif /* GL_ARB_get_program_binary */ - -/* ---------------------- GL_ARB_get_texture_sub_image --------------------- */ - -#ifndef GL_ARB_get_texture_sub_image -#define GL_ARB_get_texture_sub_image 1 - -typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void *pixels); -typedef void (GLAPIENTRY * PFNGLGETTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void *pixels); - -#define glGetCompressedTextureSubImage GLEW_GET_FUN(__glewGetCompressedTextureSubImage) -#define glGetTextureSubImage GLEW_GET_FUN(__glewGetTextureSubImage) - -#define GLEW_ARB_get_texture_sub_image GLEW_GET_VAR(__GLEW_ARB_get_texture_sub_image) - -#endif /* GL_ARB_get_texture_sub_image */ - -/* --------------------------- GL_ARB_gpu_shader5 -------------------------- */ - -#ifndef GL_ARB_gpu_shader5 -#define GL_ARB_gpu_shader5 1 - -#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F -#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A -#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B -#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C -#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D -#define GL_MAX_VERTEX_STREAMS 0x8E71 - -#define GLEW_ARB_gpu_shader5 GLEW_GET_VAR(__GLEW_ARB_gpu_shader5) - -#endif /* GL_ARB_gpu_shader5 */ - -/* ------------------------- GL_ARB_gpu_shader_fp64 ------------------------ */ - -#ifndef GL_ARB_gpu_shader_fp64 -#define GL_ARB_gpu_shader_fp64 1 - -#define GL_DOUBLE_MAT2 0x8F46 -#define GL_DOUBLE_MAT3 0x8F47 -#define GL_DOUBLE_MAT4 0x8F48 -#define GL_DOUBLE_MAT2x3 0x8F49 -#define GL_DOUBLE_MAT2x4 0x8F4A -#define GL_DOUBLE_MAT3x2 0x8F4B -#define GL_DOUBLE_MAT3x4 0x8F4C -#define GL_DOUBLE_MAT4x2 0x8F4D -#define GL_DOUBLE_MAT4x3 0x8F4E -#define GL_DOUBLE_VEC2 0x8FFC -#define GL_DOUBLE_VEC3 0x8FFD -#define GL_DOUBLE_VEC4 0x8FFE - -typedef void (GLAPIENTRY * PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); -typedef void (GLAPIENTRY * PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); -typedef void (GLAPIENTRY * PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); - -#define glGetUniformdv GLEW_GET_FUN(__glewGetUniformdv) -#define glUniform1d GLEW_GET_FUN(__glewUniform1d) -#define glUniform1dv GLEW_GET_FUN(__glewUniform1dv) -#define glUniform2d GLEW_GET_FUN(__glewUniform2d) -#define glUniform2dv GLEW_GET_FUN(__glewUniform2dv) -#define glUniform3d GLEW_GET_FUN(__glewUniform3d) -#define glUniform3dv GLEW_GET_FUN(__glewUniform3dv) -#define glUniform4d GLEW_GET_FUN(__glewUniform4d) -#define glUniform4dv GLEW_GET_FUN(__glewUniform4dv) -#define glUniformMatrix2dv GLEW_GET_FUN(__glewUniformMatrix2dv) -#define glUniformMatrix2x3dv GLEW_GET_FUN(__glewUniformMatrix2x3dv) -#define glUniformMatrix2x4dv GLEW_GET_FUN(__glewUniformMatrix2x4dv) -#define glUniformMatrix3dv GLEW_GET_FUN(__glewUniformMatrix3dv) -#define glUniformMatrix3x2dv GLEW_GET_FUN(__glewUniformMatrix3x2dv) -#define glUniformMatrix3x4dv GLEW_GET_FUN(__glewUniformMatrix3x4dv) -#define glUniformMatrix4dv GLEW_GET_FUN(__glewUniformMatrix4dv) -#define glUniformMatrix4x2dv GLEW_GET_FUN(__glewUniformMatrix4x2dv) -#define glUniformMatrix4x3dv GLEW_GET_FUN(__glewUniformMatrix4x3dv) - -#define GLEW_ARB_gpu_shader_fp64 GLEW_GET_VAR(__GLEW_ARB_gpu_shader_fp64) - -#endif /* GL_ARB_gpu_shader_fp64 */ - -/* ------------------------ GL_ARB_gpu_shader_int64 ------------------------ */ - -#ifndef GL_ARB_gpu_shader_int64 -#define GL_ARB_gpu_shader_int64 1 - -#define GL_INT64_ARB 0x140E -#define GL_UNSIGNED_INT64_ARB 0x140F -#define GL_INT64_VEC2_ARB 0x8FE9 -#define GL_INT64_VEC3_ARB 0x8FEA -#define GL_INT64_VEC4_ARB 0x8FEB -#define GL_UNSIGNED_INT64_VEC2_ARB 0x8FF5 -#define GL_UNSIGNED_INT64_VEC3_ARB 0x8FF6 -#define GL_UNSIGNED_INT64_VEC4_ARB 0x8FF7 - -typedef void (GLAPIENTRY * PFNGLGETUNIFORMI64VARBPROC) (GLuint program, GLint location, GLint64* params); -typedef void (GLAPIENTRY * PFNGLGETUNIFORMUI64VARBPROC) (GLuint program, GLint location, GLuint64* params); -typedef void (GLAPIENTRY * PFNGLGETNUNIFORMI64VARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint64* params); -typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUI64VARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint64* params); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64ARBPROC) (GLuint program, GLint location, GLint64 x); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64ARBPROC) (GLuint program, GLint location, GLuint64 x); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM1I64ARBPROC) (GLint location, GLint64 x); -typedef void (GLAPIENTRY * PFNGLUNIFORM1I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64ARBPROC) (GLint location, GLuint64 x); -typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM2I64ARBPROC) (GLint location, GLint64 x, GLint64 y); -typedef void (GLAPIENTRY * PFNGLUNIFORM2I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y); -typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM3I64ARBPROC) (GLint location, GLint64 x, GLint64 y, GLint64 z); -typedef void (GLAPIENTRY * PFNGLUNIFORM3I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y, GLuint64 z); -typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM4I64ARBPROC) (GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); -typedef void (GLAPIENTRY * PFNGLUNIFORM4I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); -typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); - -#define glGetUniformi64vARB GLEW_GET_FUN(__glewGetUniformi64vARB) -#define glGetUniformui64vARB GLEW_GET_FUN(__glewGetUniformui64vARB) -#define glGetnUniformi64vARB GLEW_GET_FUN(__glewGetnUniformi64vARB) -#define glGetnUniformui64vARB GLEW_GET_FUN(__glewGetnUniformui64vARB) -#define glProgramUniform1i64ARB GLEW_GET_FUN(__glewProgramUniform1i64ARB) -#define glProgramUniform1i64vARB GLEW_GET_FUN(__glewProgramUniform1i64vARB) -#define glProgramUniform1ui64ARB GLEW_GET_FUN(__glewProgramUniform1ui64ARB) -#define glProgramUniform1ui64vARB GLEW_GET_FUN(__glewProgramUniform1ui64vARB) -#define glProgramUniform2i64ARB GLEW_GET_FUN(__glewProgramUniform2i64ARB) -#define glProgramUniform2i64vARB GLEW_GET_FUN(__glewProgramUniform2i64vARB) -#define glProgramUniform2ui64ARB GLEW_GET_FUN(__glewProgramUniform2ui64ARB) -#define glProgramUniform2ui64vARB GLEW_GET_FUN(__glewProgramUniform2ui64vARB) -#define glProgramUniform3i64ARB GLEW_GET_FUN(__glewProgramUniform3i64ARB) -#define glProgramUniform3i64vARB GLEW_GET_FUN(__glewProgramUniform3i64vARB) -#define glProgramUniform3ui64ARB GLEW_GET_FUN(__glewProgramUniform3ui64ARB) -#define glProgramUniform3ui64vARB GLEW_GET_FUN(__glewProgramUniform3ui64vARB) -#define glProgramUniform4i64ARB GLEW_GET_FUN(__glewProgramUniform4i64ARB) -#define glProgramUniform4i64vARB GLEW_GET_FUN(__glewProgramUniform4i64vARB) -#define glProgramUniform4ui64ARB GLEW_GET_FUN(__glewProgramUniform4ui64ARB) -#define glProgramUniform4ui64vARB GLEW_GET_FUN(__glewProgramUniform4ui64vARB) -#define glUniform1i64ARB GLEW_GET_FUN(__glewUniform1i64ARB) -#define glUniform1i64vARB GLEW_GET_FUN(__glewUniform1i64vARB) -#define glUniform1ui64ARB GLEW_GET_FUN(__glewUniform1ui64ARB) -#define glUniform1ui64vARB GLEW_GET_FUN(__glewUniform1ui64vARB) -#define glUniform2i64ARB GLEW_GET_FUN(__glewUniform2i64ARB) -#define glUniform2i64vARB GLEW_GET_FUN(__glewUniform2i64vARB) -#define glUniform2ui64ARB GLEW_GET_FUN(__glewUniform2ui64ARB) -#define glUniform2ui64vARB GLEW_GET_FUN(__glewUniform2ui64vARB) -#define glUniform3i64ARB GLEW_GET_FUN(__glewUniform3i64ARB) -#define glUniform3i64vARB GLEW_GET_FUN(__glewUniform3i64vARB) -#define glUniform3ui64ARB GLEW_GET_FUN(__glewUniform3ui64ARB) -#define glUniform3ui64vARB GLEW_GET_FUN(__glewUniform3ui64vARB) -#define glUniform4i64ARB GLEW_GET_FUN(__glewUniform4i64ARB) -#define glUniform4i64vARB GLEW_GET_FUN(__glewUniform4i64vARB) -#define glUniform4ui64ARB GLEW_GET_FUN(__glewUniform4ui64ARB) -#define glUniform4ui64vARB GLEW_GET_FUN(__glewUniform4ui64vARB) - -#define GLEW_ARB_gpu_shader_int64 GLEW_GET_VAR(__GLEW_ARB_gpu_shader_int64) - -#endif /* GL_ARB_gpu_shader_int64 */ - -/* ------------------------ GL_ARB_half_float_pixel ------------------------ */ - -#ifndef GL_ARB_half_float_pixel -#define GL_ARB_half_float_pixel 1 - -#define GL_HALF_FLOAT_ARB 0x140B - -#define GLEW_ARB_half_float_pixel GLEW_GET_VAR(__GLEW_ARB_half_float_pixel) - -#endif /* GL_ARB_half_float_pixel */ - -/* ------------------------ GL_ARB_half_float_vertex ----------------------- */ - -#ifndef GL_ARB_half_float_vertex -#define GL_ARB_half_float_vertex 1 - -#define GL_HALF_FLOAT 0x140B - -#define GLEW_ARB_half_float_vertex GLEW_GET_VAR(__GLEW_ARB_half_float_vertex) - -#endif /* GL_ARB_half_float_vertex */ - -/* ----------------------------- GL_ARB_imaging ---------------------------- */ - -#ifndef GL_ARB_imaging -#define GL_ARB_imaging 1 - -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_BLEND_COLOR 0x8005 -#define GL_FUNC_ADD 0x8006 -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -#define GL_BLEND_EQUATION 0x8009 -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_CONVOLUTION_1D 0x8010 -#define GL_CONVOLUTION_2D 0x8011 -#define GL_SEPARABLE_2D 0x8012 -#define GL_CONVOLUTION_BORDER_MODE 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS 0x8015 -#define GL_REDUCE 0x8016 -#define GL_CONVOLUTION_FORMAT 0x8017 -#define GL_CONVOLUTION_WIDTH 0x8018 -#define GL_CONVOLUTION_HEIGHT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 -#define GL_HISTOGRAM 0x8024 -#define GL_PROXY_HISTOGRAM 0x8025 -#define GL_HISTOGRAM_WIDTH 0x8026 -#define GL_HISTOGRAM_FORMAT 0x8027 -#define GL_HISTOGRAM_RED_SIZE 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C -#define GL_HISTOGRAM_SINK 0x802D -#define GL_MINMAX 0x802E -#define GL_MINMAX_FORMAT 0x802F -#define GL_MINMAX_SINK 0x8030 -#define GL_TABLE_TOO_LARGE 0x8031 -#define GL_COLOR_MATRIX 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB -#define GL_COLOR_TABLE 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 -#define GL_PROXY_COLOR_TABLE 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 -#define GL_COLOR_TABLE_SCALE 0x80D6 -#define GL_COLOR_TABLE_BIAS 0x80D7 -#define GL_COLOR_TABLE_FORMAT 0x80D8 -#define GL_COLOR_TABLE_WIDTH 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF -#define GL_IGNORE_BORDER 0x8150 -#define GL_CONSTANT_BORDER 0x8151 -#define GL_WRAP_BORDER 0x8152 -#define GL_REPLICATE_BORDER 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR 0x8154 - -typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); -typedef void (GLAPIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); -typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, void *table); -typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, void *image); -typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GLAPIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum types, void *values); -typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); -typedef void (GLAPIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (GLAPIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target); -typedef void (GLAPIENTRY * PFNGLRESETMINMAXPROC) (GLenum target); -typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); - -#define glColorSubTable GLEW_GET_FUN(__glewColorSubTable) -#define glColorTable GLEW_GET_FUN(__glewColorTable) -#define glColorTableParameterfv GLEW_GET_FUN(__glewColorTableParameterfv) -#define glColorTableParameteriv GLEW_GET_FUN(__glewColorTableParameteriv) -#define glConvolutionFilter1D GLEW_GET_FUN(__glewConvolutionFilter1D) -#define glConvolutionFilter2D GLEW_GET_FUN(__glewConvolutionFilter2D) -#define glConvolutionParameterf GLEW_GET_FUN(__glewConvolutionParameterf) -#define glConvolutionParameterfv GLEW_GET_FUN(__glewConvolutionParameterfv) -#define glConvolutionParameteri GLEW_GET_FUN(__glewConvolutionParameteri) -#define glConvolutionParameteriv GLEW_GET_FUN(__glewConvolutionParameteriv) -#define glCopyColorSubTable GLEW_GET_FUN(__glewCopyColorSubTable) -#define glCopyColorTable GLEW_GET_FUN(__glewCopyColorTable) -#define glCopyConvolutionFilter1D GLEW_GET_FUN(__glewCopyConvolutionFilter1D) -#define glCopyConvolutionFilter2D GLEW_GET_FUN(__glewCopyConvolutionFilter2D) -#define glGetColorTable GLEW_GET_FUN(__glewGetColorTable) -#define glGetColorTableParameterfv GLEW_GET_FUN(__glewGetColorTableParameterfv) -#define glGetColorTableParameteriv GLEW_GET_FUN(__glewGetColorTableParameteriv) -#define glGetConvolutionFilter GLEW_GET_FUN(__glewGetConvolutionFilter) -#define glGetConvolutionParameterfv GLEW_GET_FUN(__glewGetConvolutionParameterfv) -#define glGetConvolutionParameteriv GLEW_GET_FUN(__glewGetConvolutionParameteriv) -#define glGetHistogram GLEW_GET_FUN(__glewGetHistogram) -#define glGetHistogramParameterfv GLEW_GET_FUN(__glewGetHistogramParameterfv) -#define glGetHistogramParameteriv GLEW_GET_FUN(__glewGetHistogramParameteriv) -#define glGetMinmax GLEW_GET_FUN(__glewGetMinmax) -#define glGetMinmaxParameterfv GLEW_GET_FUN(__glewGetMinmaxParameterfv) -#define glGetMinmaxParameteriv GLEW_GET_FUN(__glewGetMinmaxParameteriv) -#define glGetSeparableFilter GLEW_GET_FUN(__glewGetSeparableFilter) -#define glHistogram GLEW_GET_FUN(__glewHistogram) -#define glMinmax GLEW_GET_FUN(__glewMinmax) -#define glResetHistogram GLEW_GET_FUN(__glewResetHistogram) -#define glResetMinmax GLEW_GET_FUN(__glewResetMinmax) -#define glSeparableFilter2D GLEW_GET_FUN(__glewSeparableFilter2D) - -#define GLEW_ARB_imaging GLEW_GET_VAR(__GLEW_ARB_imaging) - -#endif /* GL_ARB_imaging */ - -/* ----------------------- GL_ARB_indirect_parameters ---------------------- */ - -#ifndef GL_ARB_indirect_parameters -#define GL_ARB_indirect_parameters 1 - -#define GL_PARAMETER_BUFFER_ARB 0x80EE -#define GL_PARAMETER_BUFFER_BINDING_ARB 0x80EF - -typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC) (GLenum mode, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); -typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC) (GLenum mode, GLenum type, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); - -#define glMultiDrawArraysIndirectCountARB GLEW_GET_FUN(__glewMultiDrawArraysIndirectCountARB) -#define glMultiDrawElementsIndirectCountARB GLEW_GET_FUN(__glewMultiDrawElementsIndirectCountARB) - -#define GLEW_ARB_indirect_parameters GLEW_GET_VAR(__GLEW_ARB_indirect_parameters) - -#endif /* GL_ARB_indirect_parameters */ - -/* ------------------------ GL_ARB_instanced_arrays ------------------------ */ - -#ifndef GL_ARB_instanced_arrays -#define GL_ARB_instanced_arrays 1 - -#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE - -typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); -typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); - -#define glDrawArraysInstancedARB GLEW_GET_FUN(__glewDrawArraysInstancedARB) -#define glDrawElementsInstancedARB GLEW_GET_FUN(__glewDrawElementsInstancedARB) -#define glVertexAttribDivisorARB GLEW_GET_FUN(__glewVertexAttribDivisorARB) - -#define GLEW_ARB_instanced_arrays GLEW_GET_VAR(__GLEW_ARB_instanced_arrays) - -#endif /* GL_ARB_instanced_arrays */ - -/* ---------------------- GL_ARB_internalformat_query ---------------------- */ - -#ifndef GL_ARB_internalformat_query -#define GL_ARB_internalformat_query 1 - -#define GL_NUM_SAMPLE_COUNTS 0x9380 - -typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params); - -#define glGetInternalformativ GLEW_GET_FUN(__glewGetInternalformativ) - -#define GLEW_ARB_internalformat_query GLEW_GET_VAR(__GLEW_ARB_internalformat_query) - -#endif /* GL_ARB_internalformat_query */ - -/* ---------------------- GL_ARB_internalformat_query2 --------------------- */ - -#ifndef GL_ARB_internalformat_query2 -#define GL_ARB_internalformat_query2 1 - -#define GL_INTERNALFORMAT_SUPPORTED 0x826F -#define GL_INTERNALFORMAT_PREFERRED 0x8270 -#define GL_INTERNALFORMAT_RED_SIZE 0x8271 -#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272 -#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273 -#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 -#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 -#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 -#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277 -#define GL_INTERNALFORMAT_RED_TYPE 0x8278 -#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279 -#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A -#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B -#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C -#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D -#define GL_MAX_WIDTH 0x827E -#define GL_MAX_HEIGHT 0x827F -#define GL_MAX_DEPTH 0x8280 -#define GL_MAX_LAYERS 0x8281 -#define GL_MAX_COMBINED_DIMENSIONS 0x8282 -#define GL_COLOR_COMPONENTS 0x8283 -#define GL_DEPTH_COMPONENTS 0x8284 -#define GL_STENCIL_COMPONENTS 0x8285 -#define GL_COLOR_RENDERABLE 0x8286 -#define GL_DEPTH_RENDERABLE 0x8287 -#define GL_STENCIL_RENDERABLE 0x8288 -#define GL_FRAMEBUFFER_RENDERABLE 0x8289 -#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A -#define GL_FRAMEBUFFER_BLEND 0x828B -#define GL_READ_PIXELS 0x828C -#define GL_READ_PIXELS_FORMAT 0x828D -#define GL_READ_PIXELS_TYPE 0x828E -#define GL_TEXTURE_IMAGE_FORMAT 0x828F -#define GL_TEXTURE_IMAGE_TYPE 0x8290 -#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 -#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292 -#define GL_MIPMAP 0x8293 -#define GL_MANUAL_GENERATE_MIPMAP 0x8294 -#define GL_AUTO_GENERATE_MIPMAP 0x8295 -#define GL_COLOR_ENCODING 0x8296 -#define GL_SRGB_READ 0x8297 -#define GL_SRGB_WRITE 0x8298 -#define GL_SRGB_DECODE_ARB 0x8299 -#define GL_FILTER 0x829A -#define GL_VERTEX_TEXTURE 0x829B -#define GL_TESS_CONTROL_TEXTURE 0x829C -#define GL_TESS_EVALUATION_TEXTURE 0x829D -#define GL_GEOMETRY_TEXTURE 0x829E -#define GL_FRAGMENT_TEXTURE 0x829F -#define GL_COMPUTE_TEXTURE 0x82A0 -#define GL_TEXTURE_SHADOW 0x82A1 -#define GL_TEXTURE_GATHER 0x82A2 -#define GL_TEXTURE_GATHER_SHADOW 0x82A3 -#define GL_SHADER_IMAGE_LOAD 0x82A4 -#define GL_SHADER_IMAGE_STORE 0x82A5 -#define GL_SHADER_IMAGE_ATOMIC 0x82A6 -#define GL_IMAGE_TEXEL_SIZE 0x82A7 -#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 -#define GL_IMAGE_PIXEL_FORMAT 0x82A9 -#define GL_IMAGE_PIXEL_TYPE 0x82AA -#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC -#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD -#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE -#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF -#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 -#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 -#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 -#define GL_CLEAR_BUFFER 0x82B4 -#define GL_TEXTURE_VIEW 0x82B5 -#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6 -#define GL_FULL_SUPPORT 0x82B7 -#define GL_CAVEAT_SUPPORT 0x82B8 -#define GL_IMAGE_CLASS_4_X_32 0x82B9 -#define GL_IMAGE_CLASS_2_X_32 0x82BA -#define GL_IMAGE_CLASS_1_X_32 0x82BB -#define GL_IMAGE_CLASS_4_X_16 0x82BC -#define GL_IMAGE_CLASS_2_X_16 0x82BD -#define GL_IMAGE_CLASS_1_X_16 0x82BE -#define GL_IMAGE_CLASS_4_X_8 0x82BF -#define GL_IMAGE_CLASS_2_X_8 0x82C0 -#define GL_IMAGE_CLASS_1_X_8 0x82C1 -#define GL_IMAGE_CLASS_11_11_10 0x82C2 -#define GL_IMAGE_CLASS_10_10_10_2 0x82C3 -#define GL_VIEW_CLASS_128_BITS 0x82C4 -#define GL_VIEW_CLASS_96_BITS 0x82C5 -#define GL_VIEW_CLASS_64_BITS 0x82C6 -#define GL_VIEW_CLASS_48_BITS 0x82C7 -#define GL_VIEW_CLASS_32_BITS 0x82C8 -#define GL_VIEW_CLASS_24_BITS 0x82C9 -#define GL_VIEW_CLASS_16_BITS 0x82CA -#define GL_VIEW_CLASS_8_BITS 0x82CB -#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC -#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD -#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE -#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF -#define GL_VIEW_CLASS_RGTC1_RED 0x82D0 -#define GL_VIEW_CLASS_RGTC2_RG 0x82D1 -#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2 -#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 - -typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64* params); - -#define glGetInternalformati64v GLEW_GET_FUN(__glewGetInternalformati64v) - -#define GLEW_ARB_internalformat_query2 GLEW_GET_VAR(__GLEW_ARB_internalformat_query2) - -#endif /* GL_ARB_internalformat_query2 */ - -/* ----------------------- GL_ARB_invalidate_subdata ----------------------- */ - -#ifndef GL_ARB_invalidate_subdata -#define GL_ARB_invalidate_subdata 1 - -typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer); -typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); -typedef void (GLAPIENTRY * PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments); -typedef void (GLAPIENTRY * PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level); -typedef void (GLAPIENTRY * PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); - -#define glInvalidateBufferData GLEW_GET_FUN(__glewInvalidateBufferData) -#define glInvalidateBufferSubData GLEW_GET_FUN(__glewInvalidateBufferSubData) -#define glInvalidateFramebuffer GLEW_GET_FUN(__glewInvalidateFramebuffer) -#define glInvalidateSubFramebuffer GLEW_GET_FUN(__glewInvalidateSubFramebuffer) -#define glInvalidateTexImage GLEW_GET_FUN(__glewInvalidateTexImage) -#define glInvalidateTexSubImage GLEW_GET_FUN(__glewInvalidateTexSubImage) - -#define GLEW_ARB_invalidate_subdata GLEW_GET_VAR(__GLEW_ARB_invalidate_subdata) - -#endif /* GL_ARB_invalidate_subdata */ - -/* ---------------------- GL_ARB_map_buffer_alignment ---------------------- */ - -#ifndef GL_ARB_map_buffer_alignment -#define GL_ARB_map_buffer_alignment 1 - -#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC - -#define GLEW_ARB_map_buffer_alignment GLEW_GET_VAR(__GLEW_ARB_map_buffer_alignment) - -#endif /* GL_ARB_map_buffer_alignment */ - -/* ------------------------ GL_ARB_map_buffer_range ------------------------ */ - -#ifndef GL_ARB_map_buffer_range -#define GL_ARB_map_buffer_range 1 - -#define GL_MAP_READ_BIT 0x0001 -#define GL_MAP_WRITE_BIT 0x0002 -#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 -#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 -#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 -#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 - -typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); -typedef void * (GLAPIENTRY * PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); - -#define glFlushMappedBufferRange GLEW_GET_FUN(__glewFlushMappedBufferRange) -#define glMapBufferRange GLEW_GET_FUN(__glewMapBufferRange) - -#define GLEW_ARB_map_buffer_range GLEW_GET_VAR(__GLEW_ARB_map_buffer_range) - -#endif /* GL_ARB_map_buffer_range */ - -/* ------------------------- GL_ARB_matrix_palette ------------------------- */ - -#ifndef GL_ARB_matrix_palette -#define GL_ARB_matrix_palette 1 - -#define GL_MATRIX_PALETTE_ARB 0x8840 -#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 -#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 -#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 -#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 -#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 -#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 -#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 -#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 -#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 - -typedef void (GLAPIENTRY * PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); -typedef void (GLAPIENTRY * PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, void *pointer); -typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUBVARBPROC) (GLint size, GLubyte *indices); -typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUIVARBPROC) (GLint size, GLuint *indices); -typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUSVARBPROC) (GLint size, GLushort *indices); - -#define glCurrentPaletteMatrixARB GLEW_GET_FUN(__glewCurrentPaletteMatrixARB) -#define glMatrixIndexPointerARB GLEW_GET_FUN(__glewMatrixIndexPointerARB) -#define glMatrixIndexubvARB GLEW_GET_FUN(__glewMatrixIndexubvARB) -#define glMatrixIndexuivARB GLEW_GET_FUN(__glewMatrixIndexuivARB) -#define glMatrixIndexusvARB GLEW_GET_FUN(__glewMatrixIndexusvARB) - -#define GLEW_ARB_matrix_palette GLEW_GET_VAR(__GLEW_ARB_matrix_palette) - -#endif /* GL_ARB_matrix_palette */ - -/* --------------------------- GL_ARB_multi_bind --------------------------- */ - -#ifndef GL_ARB_multi_bind -#define GL_ARB_multi_bind 1 - -typedef void (GLAPIENTRY * PFNGLBINDBUFFERSBASEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint* buffers); -typedef void (GLAPIENTRY * PFNGLBINDBUFFERSRANGEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizeiptr *sizes); -typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTURESPROC) (GLuint first, GLsizei count, const GLuint* textures); -typedef void (GLAPIENTRY * PFNGLBINDSAMPLERSPROC) (GLuint first, GLsizei count, const GLuint* samplers); -typedef void (GLAPIENTRY * PFNGLBINDTEXTURESPROC) (GLuint first, GLsizei count, const GLuint* textures); -typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERSPROC) (GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizei *strides); - -#define glBindBuffersBase GLEW_GET_FUN(__glewBindBuffersBase) -#define glBindBuffersRange GLEW_GET_FUN(__glewBindBuffersRange) -#define glBindImageTextures GLEW_GET_FUN(__glewBindImageTextures) -#define glBindSamplers GLEW_GET_FUN(__glewBindSamplers) -#define glBindTextures GLEW_GET_FUN(__glewBindTextures) -#define glBindVertexBuffers GLEW_GET_FUN(__glewBindVertexBuffers) - -#define GLEW_ARB_multi_bind GLEW_GET_VAR(__GLEW_ARB_multi_bind) - -#endif /* GL_ARB_multi_bind */ - -/* ----------------------- GL_ARB_multi_draw_indirect ---------------------- */ - -#ifndef GL_ARB_multi_draw_indirect -#define GL_ARB_multi_draw_indirect 1 - -typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); -typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); - -#define glMultiDrawArraysIndirect GLEW_GET_FUN(__glewMultiDrawArraysIndirect) -#define glMultiDrawElementsIndirect GLEW_GET_FUN(__glewMultiDrawElementsIndirect) - -#define GLEW_ARB_multi_draw_indirect GLEW_GET_VAR(__GLEW_ARB_multi_draw_indirect) - -#endif /* GL_ARB_multi_draw_indirect */ - -/* --------------------------- GL_ARB_multisample -------------------------- */ - -#ifndef GL_ARB_multisample -#define GL_ARB_multisample 1 - -#define GL_MULTISAMPLE_ARB 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F -#define GL_SAMPLE_COVERAGE_ARB 0x80A0 -#define GL_SAMPLE_BUFFERS_ARB 0x80A8 -#define GL_SAMPLES_ARB 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB -#define GL_MULTISAMPLE_BIT_ARB 0x20000000 - -typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); - -#define glSampleCoverageARB GLEW_GET_FUN(__glewSampleCoverageARB) - -#define GLEW_ARB_multisample GLEW_GET_VAR(__GLEW_ARB_multisample) - -#endif /* GL_ARB_multisample */ - -/* -------------------------- GL_ARB_multitexture -------------------------- */ - -#ifndef GL_ARB_multitexture -#define GL_ARB_multitexture 1 - -#define GL_TEXTURE0_ARB 0x84C0 -#define GL_TEXTURE1_ARB 0x84C1 -#define GL_TEXTURE2_ARB 0x84C2 -#define GL_TEXTURE3_ARB 0x84C3 -#define GL_TEXTURE4_ARB 0x84C4 -#define GL_TEXTURE5_ARB 0x84C5 -#define GL_TEXTURE6_ARB 0x84C6 -#define GL_TEXTURE7_ARB 0x84C7 -#define GL_TEXTURE8_ARB 0x84C8 -#define GL_TEXTURE9_ARB 0x84C9 -#define GL_TEXTURE10_ARB 0x84CA -#define GL_TEXTURE11_ARB 0x84CB -#define GL_TEXTURE12_ARB 0x84CC -#define GL_TEXTURE13_ARB 0x84CD -#define GL_TEXTURE14_ARB 0x84CE -#define GL_TEXTURE15_ARB 0x84CF -#define GL_TEXTURE16_ARB 0x84D0 -#define GL_TEXTURE17_ARB 0x84D1 -#define GL_TEXTURE18_ARB 0x84D2 -#define GL_TEXTURE19_ARB 0x84D3 -#define GL_TEXTURE20_ARB 0x84D4 -#define GL_TEXTURE21_ARB 0x84D5 -#define GL_TEXTURE22_ARB 0x84D6 -#define GL_TEXTURE23_ARB 0x84D7 -#define GL_TEXTURE24_ARB 0x84D8 -#define GL_TEXTURE25_ARB 0x84D9 -#define GL_TEXTURE26_ARB 0x84DA -#define GL_TEXTURE27_ARB 0x84DB -#define GL_TEXTURE28_ARB 0x84DC -#define GL_TEXTURE29_ARB 0x84DD -#define GL_TEXTURE30_ARB 0x84DE -#define GL_TEXTURE31_ARB 0x84DF -#define GL_ACTIVE_TEXTURE_ARB 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 -#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 - -typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); - -#define glActiveTextureARB GLEW_GET_FUN(__glewActiveTextureARB) -#define glClientActiveTextureARB GLEW_GET_FUN(__glewClientActiveTextureARB) -#define glMultiTexCoord1dARB GLEW_GET_FUN(__glewMultiTexCoord1dARB) -#define glMultiTexCoord1dvARB GLEW_GET_FUN(__glewMultiTexCoord1dvARB) -#define glMultiTexCoord1fARB GLEW_GET_FUN(__glewMultiTexCoord1fARB) -#define glMultiTexCoord1fvARB GLEW_GET_FUN(__glewMultiTexCoord1fvARB) -#define glMultiTexCoord1iARB GLEW_GET_FUN(__glewMultiTexCoord1iARB) -#define glMultiTexCoord1ivARB GLEW_GET_FUN(__glewMultiTexCoord1ivARB) -#define glMultiTexCoord1sARB GLEW_GET_FUN(__glewMultiTexCoord1sARB) -#define glMultiTexCoord1svARB GLEW_GET_FUN(__glewMultiTexCoord1svARB) -#define glMultiTexCoord2dARB GLEW_GET_FUN(__glewMultiTexCoord2dARB) -#define glMultiTexCoord2dvARB GLEW_GET_FUN(__glewMultiTexCoord2dvARB) -#define glMultiTexCoord2fARB GLEW_GET_FUN(__glewMultiTexCoord2fARB) -#define glMultiTexCoord2fvARB GLEW_GET_FUN(__glewMultiTexCoord2fvARB) -#define glMultiTexCoord2iARB GLEW_GET_FUN(__glewMultiTexCoord2iARB) -#define glMultiTexCoord2ivARB GLEW_GET_FUN(__glewMultiTexCoord2ivARB) -#define glMultiTexCoord2sARB GLEW_GET_FUN(__glewMultiTexCoord2sARB) -#define glMultiTexCoord2svARB GLEW_GET_FUN(__glewMultiTexCoord2svARB) -#define glMultiTexCoord3dARB GLEW_GET_FUN(__glewMultiTexCoord3dARB) -#define glMultiTexCoord3dvARB GLEW_GET_FUN(__glewMultiTexCoord3dvARB) -#define glMultiTexCoord3fARB GLEW_GET_FUN(__glewMultiTexCoord3fARB) -#define glMultiTexCoord3fvARB GLEW_GET_FUN(__glewMultiTexCoord3fvARB) -#define glMultiTexCoord3iARB GLEW_GET_FUN(__glewMultiTexCoord3iARB) -#define glMultiTexCoord3ivARB GLEW_GET_FUN(__glewMultiTexCoord3ivARB) -#define glMultiTexCoord3sARB GLEW_GET_FUN(__glewMultiTexCoord3sARB) -#define glMultiTexCoord3svARB GLEW_GET_FUN(__glewMultiTexCoord3svARB) -#define glMultiTexCoord4dARB GLEW_GET_FUN(__glewMultiTexCoord4dARB) -#define glMultiTexCoord4dvARB GLEW_GET_FUN(__glewMultiTexCoord4dvARB) -#define glMultiTexCoord4fARB GLEW_GET_FUN(__glewMultiTexCoord4fARB) -#define glMultiTexCoord4fvARB GLEW_GET_FUN(__glewMultiTexCoord4fvARB) -#define glMultiTexCoord4iARB GLEW_GET_FUN(__glewMultiTexCoord4iARB) -#define glMultiTexCoord4ivARB GLEW_GET_FUN(__glewMultiTexCoord4ivARB) -#define glMultiTexCoord4sARB GLEW_GET_FUN(__glewMultiTexCoord4sARB) -#define glMultiTexCoord4svARB GLEW_GET_FUN(__glewMultiTexCoord4svARB) - -#define GLEW_ARB_multitexture GLEW_GET_VAR(__GLEW_ARB_multitexture) - -#endif /* GL_ARB_multitexture */ - -/* ------------------------- GL_ARB_occlusion_query ------------------------ */ - -#ifndef GL_ARB_occlusion_query -#define GL_ARB_occlusion_query 1 - -#define GL_QUERY_COUNTER_BITS_ARB 0x8864 -#define GL_CURRENT_QUERY_ARB 0x8865 -#define GL_QUERY_RESULT_ARB 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 -#define GL_SAMPLES_PASSED_ARB 0x8914 - -typedef void (GLAPIENTRY * PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); -typedef void (GLAPIENTRY * PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint* ids); -typedef void (GLAPIENTRY * PFNGLENDQUERYARBPROC) (GLenum target); -typedef void (GLAPIENTRY * PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint* ids); -typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint* params); -typedef void (GLAPIENTRY * PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint* params); -typedef GLboolean (GLAPIENTRY * PFNGLISQUERYARBPROC) (GLuint id); - -#define glBeginQueryARB GLEW_GET_FUN(__glewBeginQueryARB) -#define glDeleteQueriesARB GLEW_GET_FUN(__glewDeleteQueriesARB) -#define glEndQueryARB GLEW_GET_FUN(__glewEndQueryARB) -#define glGenQueriesARB GLEW_GET_FUN(__glewGenQueriesARB) -#define glGetQueryObjectivARB GLEW_GET_FUN(__glewGetQueryObjectivARB) -#define glGetQueryObjectuivARB GLEW_GET_FUN(__glewGetQueryObjectuivARB) -#define glGetQueryivARB GLEW_GET_FUN(__glewGetQueryivARB) -#define glIsQueryARB GLEW_GET_FUN(__glewIsQueryARB) - -#define GLEW_ARB_occlusion_query GLEW_GET_VAR(__GLEW_ARB_occlusion_query) - -#endif /* GL_ARB_occlusion_query */ - -/* ------------------------ GL_ARB_occlusion_query2 ------------------------ */ - -#ifndef GL_ARB_occlusion_query2 -#define GL_ARB_occlusion_query2 1 - -#define GL_ANY_SAMPLES_PASSED 0x8C2F - -#define GLEW_ARB_occlusion_query2 GLEW_GET_VAR(__GLEW_ARB_occlusion_query2) - -#endif /* GL_ARB_occlusion_query2 */ - -/* --------------------- GL_ARB_parallel_shader_compile -------------------- */ - -#ifndef GL_ARB_parallel_shader_compile -#define GL_ARB_parallel_shader_compile 1 - -#define GL_MAX_SHADER_COMPILER_THREADS_ARB 0x91B0 -#define GL_COMPLETION_STATUS_ARB 0x91B1 - -typedef void (GLAPIENTRY * PFNGLMAXSHADERCOMPILERTHREADSARBPROC) (GLuint count); - -#define glMaxShaderCompilerThreadsARB GLEW_GET_FUN(__glewMaxShaderCompilerThreadsARB) - -#define GLEW_ARB_parallel_shader_compile GLEW_GET_VAR(__GLEW_ARB_parallel_shader_compile) - -#endif /* GL_ARB_parallel_shader_compile */ - -/* -------------------- GL_ARB_pipeline_statistics_query ------------------- */ - -#ifndef GL_ARB_pipeline_statistics_query -#define GL_ARB_pipeline_statistics_query 1 - -#define GL_VERTICES_SUBMITTED_ARB 0x82EE -#define GL_PRIMITIVES_SUBMITTED_ARB 0x82EF -#define GL_VERTEX_SHADER_INVOCATIONS_ARB 0x82F0 -#define GL_TESS_CONTROL_SHADER_PATCHES_ARB 0x82F1 -#define GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB 0x82F2 -#define GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB 0x82F3 -#define GL_FRAGMENT_SHADER_INVOCATIONS_ARB 0x82F4 -#define GL_COMPUTE_SHADER_INVOCATIONS_ARB 0x82F5 -#define GL_CLIPPING_INPUT_PRIMITIVES_ARB 0x82F6 -#define GL_CLIPPING_OUTPUT_PRIMITIVES_ARB 0x82F7 -#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F - -#define GLEW_ARB_pipeline_statistics_query GLEW_GET_VAR(__GLEW_ARB_pipeline_statistics_query) - -#endif /* GL_ARB_pipeline_statistics_query */ - -/* ----------------------- GL_ARB_pixel_buffer_object ---------------------- */ - -#ifndef GL_ARB_pixel_buffer_object -#define GL_ARB_pixel_buffer_object 1 - -#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF - -#define GLEW_ARB_pixel_buffer_object GLEW_GET_VAR(__GLEW_ARB_pixel_buffer_object) - -#endif /* GL_ARB_pixel_buffer_object */ - -/* ------------------------ GL_ARB_point_parameters ------------------------ */ - -#ifndef GL_ARB_point_parameters -#define GL_ARB_point_parameters 1 - -#define GL_POINT_SIZE_MIN_ARB 0x8126 -#define GL_POINT_SIZE_MAX_ARB 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 -#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 - -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat* params); - -#define glPointParameterfARB GLEW_GET_FUN(__glewPointParameterfARB) -#define glPointParameterfvARB GLEW_GET_FUN(__glewPointParameterfvARB) - -#define GLEW_ARB_point_parameters GLEW_GET_VAR(__GLEW_ARB_point_parameters) - -#endif /* GL_ARB_point_parameters */ - -/* -------------------------- GL_ARB_point_sprite -------------------------- */ - -#ifndef GL_ARB_point_sprite -#define GL_ARB_point_sprite 1 - -#define GL_POINT_SPRITE_ARB 0x8861 -#define GL_COORD_REPLACE_ARB 0x8862 - -#define GLEW_ARB_point_sprite GLEW_GET_VAR(__GLEW_ARB_point_sprite) - -#endif /* GL_ARB_point_sprite */ - -/* ----------------------- GL_ARB_post_depth_coverage ---------------------- */ - -#ifndef GL_ARB_post_depth_coverage -#define GL_ARB_post_depth_coverage 1 - -#define GLEW_ARB_post_depth_coverage GLEW_GET_VAR(__GLEW_ARB_post_depth_coverage) - -#endif /* GL_ARB_post_depth_coverage */ - -/* --------------------- GL_ARB_program_interface_query -------------------- */ - -#ifndef GL_ARB_program_interface_query -#define GL_ARB_program_interface_query 1 - -#define GL_UNIFORM 0x92E1 -#define GL_UNIFORM_BLOCK 0x92E2 -#define GL_PROGRAM_INPUT 0x92E3 -#define GL_PROGRAM_OUTPUT 0x92E4 -#define GL_BUFFER_VARIABLE 0x92E5 -#define GL_SHADER_STORAGE_BLOCK 0x92E6 -#define GL_IS_PER_PATCH 0x92E7 -#define GL_VERTEX_SUBROUTINE 0x92E8 -#define GL_TESS_CONTROL_SUBROUTINE 0x92E9 -#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA -#define GL_GEOMETRY_SUBROUTINE 0x92EB -#define GL_FRAGMENT_SUBROUTINE 0x92EC -#define GL_COMPUTE_SUBROUTINE 0x92ED -#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE -#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF -#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 -#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 -#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 -#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 -#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 -#define GL_ACTIVE_RESOURCES 0x92F5 -#define GL_MAX_NAME_LENGTH 0x92F6 -#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 -#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 -#define GL_NAME_LENGTH 0x92F9 -#define GL_TYPE 0x92FA -#define GL_ARRAY_SIZE 0x92FB -#define GL_OFFSET 0x92FC -#define GL_BLOCK_INDEX 0x92FD -#define GL_ARRAY_STRIDE 0x92FE -#define GL_MATRIX_STRIDE 0x92FF -#define GL_IS_ROW_MAJOR 0x9300 -#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 -#define GL_BUFFER_BINDING 0x9302 -#define GL_BUFFER_DATA_SIZE 0x9303 -#define GL_NUM_ACTIVE_VARIABLES 0x9304 -#define GL_ACTIVE_VARIABLES 0x9305 -#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306 -#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 -#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 -#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 -#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A -#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B -#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C -#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D -#define GL_LOCATION 0x930E -#define GL_LOCATION_INDEX 0x930F - -typedef void (GLAPIENTRY * PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint* params); -typedef GLuint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); -typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar* name); -typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, GLchar *name); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLint *params); - -#define glGetProgramInterfaceiv GLEW_GET_FUN(__glewGetProgramInterfaceiv) -#define glGetProgramResourceIndex GLEW_GET_FUN(__glewGetProgramResourceIndex) -#define glGetProgramResourceLocation GLEW_GET_FUN(__glewGetProgramResourceLocation) -#define glGetProgramResourceLocationIndex GLEW_GET_FUN(__glewGetProgramResourceLocationIndex) -#define glGetProgramResourceName GLEW_GET_FUN(__glewGetProgramResourceName) -#define glGetProgramResourceiv GLEW_GET_FUN(__glewGetProgramResourceiv) - -#define GLEW_ARB_program_interface_query GLEW_GET_VAR(__GLEW_ARB_program_interface_query) - -#endif /* GL_ARB_program_interface_query */ - -/* ------------------------ GL_ARB_provoking_vertex ------------------------ */ - -#ifndef GL_ARB_provoking_vertex -#define GL_ARB_provoking_vertex 1 - -#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C -#define GL_FIRST_VERTEX_CONVENTION 0x8E4D -#define GL_LAST_VERTEX_CONVENTION 0x8E4E -#define GL_PROVOKING_VERTEX 0x8E4F - -typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXPROC) (GLenum mode); - -#define glProvokingVertex GLEW_GET_FUN(__glewProvokingVertex) - -#define GLEW_ARB_provoking_vertex GLEW_GET_VAR(__GLEW_ARB_provoking_vertex) - -#endif /* GL_ARB_provoking_vertex */ - -/* ----------------------- GL_ARB_query_buffer_object ---------------------- */ - -#ifndef GL_ARB_query_buffer_object -#define GL_ARB_query_buffer_object 1 - -#define GL_QUERY_BUFFER_BARRIER_BIT 0x00008000 -#define GL_QUERY_BUFFER 0x9192 -#define GL_QUERY_BUFFER_BINDING 0x9193 -#define GL_QUERY_RESULT_NO_WAIT 0x9194 - -#define GLEW_ARB_query_buffer_object GLEW_GET_VAR(__GLEW_ARB_query_buffer_object) - -#endif /* GL_ARB_query_buffer_object */ - -/* ------------------ GL_ARB_robust_buffer_access_behavior ----------------- */ - -#ifndef GL_ARB_robust_buffer_access_behavior -#define GL_ARB_robust_buffer_access_behavior 1 - -#define GLEW_ARB_robust_buffer_access_behavior GLEW_GET_VAR(__GLEW_ARB_robust_buffer_access_behavior) - -#endif /* GL_ARB_robust_buffer_access_behavior */ - -/* --------------------------- GL_ARB_robustness --------------------------- */ - -#ifndef GL_ARB_robustness -#define GL_ARB_robustness 1 - -#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 -#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 -#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 -#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 -#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 -#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 -#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 - -typedef GLenum (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); -typedef void (GLAPIENTRY * PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* table); -typedef void (GLAPIENTRY * PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void* img); -typedef void (GLAPIENTRY * PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* image); -typedef void (GLAPIENTRY * PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); -typedef void (GLAPIENTRY * PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble* v); -typedef void (GLAPIENTRY * PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat* v); -typedef void (GLAPIENTRY * PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint* v); -typedef void (GLAPIENTRY * PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); -typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat* values); -typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint* values); -typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort* values); -typedef void (GLAPIENTRY * PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte* pattern); -typedef void (GLAPIENTRY * PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void* row, GLsizei columnBufSize, void*column, void*span); -typedef void (GLAPIENTRY * PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* img); -typedef void (GLAPIENTRY * PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint* params); -typedef void (GLAPIENTRY * PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data); - -#define glGetGraphicsResetStatusARB GLEW_GET_FUN(__glewGetGraphicsResetStatusARB) -#define glGetnColorTableARB GLEW_GET_FUN(__glewGetnColorTableARB) -#define glGetnCompressedTexImageARB GLEW_GET_FUN(__glewGetnCompressedTexImageARB) -#define glGetnConvolutionFilterARB GLEW_GET_FUN(__glewGetnConvolutionFilterARB) -#define glGetnHistogramARB GLEW_GET_FUN(__glewGetnHistogramARB) -#define glGetnMapdvARB GLEW_GET_FUN(__glewGetnMapdvARB) -#define glGetnMapfvARB GLEW_GET_FUN(__glewGetnMapfvARB) -#define glGetnMapivARB GLEW_GET_FUN(__glewGetnMapivARB) -#define glGetnMinmaxARB GLEW_GET_FUN(__glewGetnMinmaxARB) -#define glGetnPixelMapfvARB GLEW_GET_FUN(__glewGetnPixelMapfvARB) -#define glGetnPixelMapuivARB GLEW_GET_FUN(__glewGetnPixelMapuivARB) -#define glGetnPixelMapusvARB GLEW_GET_FUN(__glewGetnPixelMapusvARB) -#define glGetnPolygonStippleARB GLEW_GET_FUN(__glewGetnPolygonStippleARB) -#define glGetnSeparableFilterARB GLEW_GET_FUN(__glewGetnSeparableFilterARB) -#define glGetnTexImageARB GLEW_GET_FUN(__glewGetnTexImageARB) -#define glGetnUniformdvARB GLEW_GET_FUN(__glewGetnUniformdvARB) -#define glGetnUniformfvARB GLEW_GET_FUN(__glewGetnUniformfvARB) -#define glGetnUniformivARB GLEW_GET_FUN(__glewGetnUniformivARB) -#define glGetnUniformuivARB GLEW_GET_FUN(__glewGetnUniformuivARB) -#define glReadnPixelsARB GLEW_GET_FUN(__glewReadnPixelsARB) - -#define GLEW_ARB_robustness GLEW_GET_VAR(__GLEW_ARB_robustness) - -#endif /* GL_ARB_robustness */ - -/* ---------------- GL_ARB_robustness_application_isolation ---------------- */ - -#ifndef GL_ARB_robustness_application_isolation -#define GL_ARB_robustness_application_isolation 1 - -#define GLEW_ARB_robustness_application_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_application_isolation) - -#endif /* GL_ARB_robustness_application_isolation */ - -/* ---------------- GL_ARB_robustness_share_group_isolation ---------------- */ - -#ifndef GL_ARB_robustness_share_group_isolation -#define GL_ARB_robustness_share_group_isolation 1 - -#define GLEW_ARB_robustness_share_group_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_share_group_isolation) - -#endif /* GL_ARB_robustness_share_group_isolation */ - -/* ------------------------ GL_ARB_sample_locations ------------------------ */ - -#ifndef GL_ARB_sample_locations -#define GL_ARB_sample_locations 1 - -#define GL_SAMPLE_LOCATION_ARB 0x8E50 -#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB 0x933D -#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB 0x933E -#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB 0x933F -#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB 0x9340 -#define GL_PROGRAMMABLE_SAMPLE_LOCATION_ARB 0x9341 -#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB 0x9342 -#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB 0x9343 - -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); - -#define glFramebufferSampleLocationsfvARB GLEW_GET_FUN(__glewFramebufferSampleLocationsfvARB) -#define glNamedFramebufferSampleLocationsfvARB GLEW_GET_FUN(__glewNamedFramebufferSampleLocationsfvARB) - -#define GLEW_ARB_sample_locations GLEW_GET_VAR(__GLEW_ARB_sample_locations) - -#endif /* GL_ARB_sample_locations */ - -/* ------------------------- GL_ARB_sample_shading ------------------------- */ - -#ifndef GL_ARB_sample_shading -#define GL_ARB_sample_shading 1 - -#define GL_SAMPLE_SHADING_ARB 0x8C36 -#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 - -typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGARBPROC) (GLclampf value); - -#define glMinSampleShadingARB GLEW_GET_FUN(__glewMinSampleShadingARB) - -#define GLEW_ARB_sample_shading GLEW_GET_VAR(__GLEW_ARB_sample_shading) - -#endif /* GL_ARB_sample_shading */ - -/* ------------------------- GL_ARB_sampler_objects ------------------------ */ - -#ifndef GL_ARB_sampler_objects -#define GL_ARB_sampler_objects 1 - -#define GL_SAMPLER_BINDING 0x8919 - -typedef void (GLAPIENTRY * PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); -typedef void (GLAPIENTRY * PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint * samplers); -typedef void (GLAPIENTRY * PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint* samplers); -typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint* params); -typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint* params); -typedef GLboolean (GLAPIENTRY * PFNGLISSAMPLERPROC) (GLuint sampler); -typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint* params); -typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint* params); - -#define glBindSampler GLEW_GET_FUN(__glewBindSampler) -#define glDeleteSamplers GLEW_GET_FUN(__glewDeleteSamplers) -#define glGenSamplers GLEW_GET_FUN(__glewGenSamplers) -#define glGetSamplerParameterIiv GLEW_GET_FUN(__glewGetSamplerParameterIiv) -#define glGetSamplerParameterIuiv GLEW_GET_FUN(__glewGetSamplerParameterIuiv) -#define glGetSamplerParameterfv GLEW_GET_FUN(__glewGetSamplerParameterfv) -#define glGetSamplerParameteriv GLEW_GET_FUN(__glewGetSamplerParameteriv) -#define glIsSampler GLEW_GET_FUN(__glewIsSampler) -#define glSamplerParameterIiv GLEW_GET_FUN(__glewSamplerParameterIiv) -#define glSamplerParameterIuiv GLEW_GET_FUN(__glewSamplerParameterIuiv) -#define glSamplerParameterf GLEW_GET_FUN(__glewSamplerParameterf) -#define glSamplerParameterfv GLEW_GET_FUN(__glewSamplerParameterfv) -#define glSamplerParameteri GLEW_GET_FUN(__glewSamplerParameteri) -#define glSamplerParameteriv GLEW_GET_FUN(__glewSamplerParameteriv) - -#define GLEW_ARB_sampler_objects GLEW_GET_VAR(__GLEW_ARB_sampler_objects) - -#endif /* GL_ARB_sampler_objects */ - -/* ------------------------ GL_ARB_seamless_cube_map ----------------------- */ - -#ifndef GL_ARB_seamless_cube_map -#define GL_ARB_seamless_cube_map 1 - -#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F - -#define GLEW_ARB_seamless_cube_map GLEW_GET_VAR(__GLEW_ARB_seamless_cube_map) - -#endif /* GL_ARB_seamless_cube_map */ - -/* ------------------ GL_ARB_seamless_cubemap_per_texture ------------------ */ - -#ifndef GL_ARB_seamless_cubemap_per_texture -#define GL_ARB_seamless_cubemap_per_texture 1 - -#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F - -#define GLEW_ARB_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_ARB_seamless_cubemap_per_texture) - -#endif /* GL_ARB_seamless_cubemap_per_texture */ - -/* --------------------- GL_ARB_separate_shader_objects -------------------- */ - -#ifndef GL_ARB_separate_shader_objects -#define GL_ARB_separate_shader_objects 1 - -#define GL_VERTEX_SHADER_BIT 0x00000001 -#define GL_FRAGMENT_SHADER_BIT 0x00000002 -#define GL_GEOMETRY_SHADER_BIT 0x00000004 -#define GL_TESS_CONTROL_SHADER_BIT 0x00000008 -#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 -#define GL_PROGRAM_SEPARABLE 0x8258 -#define GL_ACTIVE_PROGRAM 0x8259 -#define GL_PROGRAM_PIPELINE_BINDING 0x825A -#define GL_ALL_SHADER_BITS 0xFFFFFFFF - -typedef void (GLAPIENTRY * PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); -typedef void (GLAPIENTRY * PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline); -typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar * const * strings); -typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint* pipelines); -typedef void (GLAPIENTRY * PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint* pipelines); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar *infoLog); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint* params); -typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble x); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat x); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint x); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint x); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint x, GLint y); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint x, GLuint y); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); -typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); - -#define glActiveShaderProgram GLEW_GET_FUN(__glewActiveShaderProgram) -#define glBindProgramPipeline GLEW_GET_FUN(__glewBindProgramPipeline) -#define glCreateShaderProgramv GLEW_GET_FUN(__glewCreateShaderProgramv) -#define glDeleteProgramPipelines GLEW_GET_FUN(__glewDeleteProgramPipelines) -#define glGenProgramPipelines GLEW_GET_FUN(__glewGenProgramPipelines) -#define glGetProgramPipelineInfoLog GLEW_GET_FUN(__glewGetProgramPipelineInfoLog) -#define glGetProgramPipelineiv GLEW_GET_FUN(__glewGetProgramPipelineiv) -#define glIsProgramPipeline GLEW_GET_FUN(__glewIsProgramPipeline) -#define glProgramUniform1d GLEW_GET_FUN(__glewProgramUniform1d) -#define glProgramUniform1dv GLEW_GET_FUN(__glewProgramUniform1dv) -#define glProgramUniform1f GLEW_GET_FUN(__glewProgramUniform1f) -#define glProgramUniform1fv GLEW_GET_FUN(__glewProgramUniform1fv) -#define glProgramUniform1i GLEW_GET_FUN(__glewProgramUniform1i) -#define glProgramUniform1iv GLEW_GET_FUN(__glewProgramUniform1iv) -#define glProgramUniform1ui GLEW_GET_FUN(__glewProgramUniform1ui) -#define glProgramUniform1uiv GLEW_GET_FUN(__glewProgramUniform1uiv) -#define glProgramUniform2d GLEW_GET_FUN(__glewProgramUniform2d) -#define glProgramUniform2dv GLEW_GET_FUN(__glewProgramUniform2dv) -#define glProgramUniform2f GLEW_GET_FUN(__glewProgramUniform2f) -#define glProgramUniform2fv GLEW_GET_FUN(__glewProgramUniform2fv) -#define glProgramUniform2i GLEW_GET_FUN(__glewProgramUniform2i) -#define glProgramUniform2iv GLEW_GET_FUN(__glewProgramUniform2iv) -#define glProgramUniform2ui GLEW_GET_FUN(__glewProgramUniform2ui) -#define glProgramUniform2uiv GLEW_GET_FUN(__glewProgramUniform2uiv) -#define glProgramUniform3d GLEW_GET_FUN(__glewProgramUniform3d) -#define glProgramUniform3dv GLEW_GET_FUN(__glewProgramUniform3dv) -#define glProgramUniform3f GLEW_GET_FUN(__glewProgramUniform3f) -#define glProgramUniform3fv GLEW_GET_FUN(__glewProgramUniform3fv) -#define glProgramUniform3i GLEW_GET_FUN(__glewProgramUniform3i) -#define glProgramUniform3iv GLEW_GET_FUN(__glewProgramUniform3iv) -#define glProgramUniform3ui GLEW_GET_FUN(__glewProgramUniform3ui) -#define glProgramUniform3uiv GLEW_GET_FUN(__glewProgramUniform3uiv) -#define glProgramUniform4d GLEW_GET_FUN(__glewProgramUniform4d) -#define glProgramUniform4dv GLEW_GET_FUN(__glewProgramUniform4dv) -#define glProgramUniform4f GLEW_GET_FUN(__glewProgramUniform4f) -#define glProgramUniform4fv GLEW_GET_FUN(__glewProgramUniform4fv) -#define glProgramUniform4i GLEW_GET_FUN(__glewProgramUniform4i) -#define glProgramUniform4iv GLEW_GET_FUN(__glewProgramUniform4iv) -#define glProgramUniform4ui GLEW_GET_FUN(__glewProgramUniform4ui) -#define glProgramUniform4uiv GLEW_GET_FUN(__glewProgramUniform4uiv) -#define glProgramUniformMatrix2dv GLEW_GET_FUN(__glewProgramUniformMatrix2dv) -#define glProgramUniformMatrix2fv GLEW_GET_FUN(__glewProgramUniformMatrix2fv) -#define glProgramUniformMatrix2x3dv GLEW_GET_FUN(__glewProgramUniformMatrix2x3dv) -#define glProgramUniformMatrix2x3fv GLEW_GET_FUN(__glewProgramUniformMatrix2x3fv) -#define glProgramUniformMatrix2x4dv GLEW_GET_FUN(__glewProgramUniformMatrix2x4dv) -#define glProgramUniformMatrix2x4fv GLEW_GET_FUN(__glewProgramUniformMatrix2x4fv) -#define glProgramUniformMatrix3dv GLEW_GET_FUN(__glewProgramUniformMatrix3dv) -#define glProgramUniformMatrix3fv GLEW_GET_FUN(__glewProgramUniformMatrix3fv) -#define glProgramUniformMatrix3x2dv GLEW_GET_FUN(__glewProgramUniformMatrix3x2dv) -#define glProgramUniformMatrix3x2fv GLEW_GET_FUN(__glewProgramUniformMatrix3x2fv) -#define glProgramUniformMatrix3x4dv GLEW_GET_FUN(__glewProgramUniformMatrix3x4dv) -#define glProgramUniformMatrix3x4fv GLEW_GET_FUN(__glewProgramUniformMatrix3x4fv) -#define glProgramUniformMatrix4dv GLEW_GET_FUN(__glewProgramUniformMatrix4dv) -#define glProgramUniformMatrix4fv GLEW_GET_FUN(__glewProgramUniformMatrix4fv) -#define glProgramUniformMatrix4x2dv GLEW_GET_FUN(__glewProgramUniformMatrix4x2dv) -#define glProgramUniformMatrix4x2fv GLEW_GET_FUN(__glewProgramUniformMatrix4x2fv) -#define glProgramUniformMatrix4x3dv GLEW_GET_FUN(__glewProgramUniformMatrix4x3dv) -#define glProgramUniformMatrix4x3fv GLEW_GET_FUN(__glewProgramUniformMatrix4x3fv) -#define glUseProgramStages GLEW_GET_FUN(__glewUseProgramStages) -#define glValidateProgramPipeline GLEW_GET_FUN(__glewValidateProgramPipeline) - -#define GLEW_ARB_separate_shader_objects GLEW_GET_VAR(__GLEW_ARB_separate_shader_objects) - -#endif /* GL_ARB_separate_shader_objects */ - -/* -------------------- GL_ARB_shader_atomic_counter_ops ------------------- */ - -#ifndef GL_ARB_shader_atomic_counter_ops -#define GL_ARB_shader_atomic_counter_ops 1 - -#define GLEW_ARB_shader_atomic_counter_ops GLEW_GET_VAR(__GLEW_ARB_shader_atomic_counter_ops) - -#endif /* GL_ARB_shader_atomic_counter_ops */ - -/* --------------------- GL_ARB_shader_atomic_counters --------------------- */ - -#ifndef GL_ARB_shader_atomic_counters -#define GL_ARB_shader_atomic_counters 1 - -#define GL_ATOMIC_COUNTER_BUFFER 0x92C0 -#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 -#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 -#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 -#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 -#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 -#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA -#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB -#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC -#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD -#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE -#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF -#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 -#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 -#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 -#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 -#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 -#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 -#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 -#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 -#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 -#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 -#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA -#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB -#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC - -typedef void (GLAPIENTRY * PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint* params); - -#define glGetActiveAtomicCounterBufferiv GLEW_GET_FUN(__glewGetActiveAtomicCounterBufferiv) - -#define GLEW_ARB_shader_atomic_counters GLEW_GET_VAR(__GLEW_ARB_shader_atomic_counters) - -#endif /* GL_ARB_shader_atomic_counters */ - -/* -------------------------- GL_ARB_shader_ballot ------------------------- */ - -#ifndef GL_ARB_shader_ballot -#define GL_ARB_shader_ballot 1 - -#define GLEW_ARB_shader_ballot GLEW_GET_VAR(__GLEW_ARB_shader_ballot) - -#endif /* GL_ARB_shader_ballot */ - -/* ----------------------- GL_ARB_shader_bit_encoding ---------------------- */ - -#ifndef GL_ARB_shader_bit_encoding -#define GL_ARB_shader_bit_encoding 1 - -#define GLEW_ARB_shader_bit_encoding GLEW_GET_VAR(__GLEW_ARB_shader_bit_encoding) - -#endif /* GL_ARB_shader_bit_encoding */ - -/* -------------------------- GL_ARB_shader_clock -------------------------- */ - -#ifndef GL_ARB_shader_clock -#define GL_ARB_shader_clock 1 - -#define GLEW_ARB_shader_clock GLEW_GET_VAR(__GLEW_ARB_shader_clock) - -#endif /* GL_ARB_shader_clock */ - -/* --------------------- GL_ARB_shader_draw_parameters --------------------- */ - -#ifndef GL_ARB_shader_draw_parameters -#define GL_ARB_shader_draw_parameters 1 - -#define GLEW_ARB_shader_draw_parameters GLEW_GET_VAR(__GLEW_ARB_shader_draw_parameters) - -#endif /* GL_ARB_shader_draw_parameters */ - -/* ------------------------ GL_ARB_shader_group_vote ----------------------- */ - -#ifndef GL_ARB_shader_group_vote -#define GL_ARB_shader_group_vote 1 - -#define GLEW_ARB_shader_group_vote GLEW_GET_VAR(__GLEW_ARB_shader_group_vote) - -#endif /* GL_ARB_shader_group_vote */ - -/* --------------------- GL_ARB_shader_image_load_store -------------------- */ - -#ifndef GL_ARB_shader_image_load_store -#define GL_ARB_shader_image_load_store 1 - -#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 -#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 -#define GL_UNIFORM_BARRIER_BIT 0x00000004 -#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 -#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 -#define GL_COMMAND_BARRIER_BIT 0x00000040 -#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 -#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 -#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 -#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 -#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 -#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 -#define GL_MAX_IMAGE_UNITS 0x8F38 -#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 -#define GL_IMAGE_BINDING_NAME 0x8F3A -#define GL_IMAGE_BINDING_LEVEL 0x8F3B -#define GL_IMAGE_BINDING_LAYERED 0x8F3C -#define GL_IMAGE_BINDING_LAYER 0x8F3D -#define GL_IMAGE_BINDING_ACCESS 0x8F3E -#define GL_IMAGE_1D 0x904C -#define GL_IMAGE_2D 0x904D -#define GL_IMAGE_3D 0x904E -#define GL_IMAGE_2D_RECT 0x904F -#define GL_IMAGE_CUBE 0x9050 -#define GL_IMAGE_BUFFER 0x9051 -#define GL_IMAGE_1D_ARRAY 0x9052 -#define GL_IMAGE_2D_ARRAY 0x9053 -#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 -#define GL_IMAGE_2D_MULTISAMPLE 0x9055 -#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 -#define GL_INT_IMAGE_1D 0x9057 -#define GL_INT_IMAGE_2D 0x9058 -#define GL_INT_IMAGE_3D 0x9059 -#define GL_INT_IMAGE_2D_RECT 0x905A -#define GL_INT_IMAGE_CUBE 0x905B -#define GL_INT_IMAGE_BUFFER 0x905C -#define GL_INT_IMAGE_1D_ARRAY 0x905D -#define GL_INT_IMAGE_2D_ARRAY 0x905E -#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F -#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 -#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 -#define GL_UNSIGNED_INT_IMAGE_1D 0x9062 -#define GL_UNSIGNED_INT_IMAGE_2D 0x9063 -#define GL_UNSIGNED_INT_IMAGE_3D 0x9064 -#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 -#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 -#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 -#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 -#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 -#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C -#define GL_MAX_IMAGE_SAMPLES 0x906D -#define GL_IMAGE_BINDING_FORMAT 0x906E -#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 -#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 -#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 -#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA -#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB -#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC -#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD -#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE -#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF -#define GL_ALL_BARRIER_BITS 0xFFFFFFFF - -typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); -typedef void (GLAPIENTRY * PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); - -#define glBindImageTexture GLEW_GET_FUN(__glewBindImageTexture) -#define glMemoryBarrier GLEW_GET_FUN(__glewMemoryBarrier) - -#define GLEW_ARB_shader_image_load_store GLEW_GET_VAR(__GLEW_ARB_shader_image_load_store) - -#endif /* GL_ARB_shader_image_load_store */ - -/* ------------------------ GL_ARB_shader_image_size ----------------------- */ - -#ifndef GL_ARB_shader_image_size -#define GL_ARB_shader_image_size 1 - -#define GLEW_ARB_shader_image_size GLEW_GET_VAR(__GLEW_ARB_shader_image_size) - -#endif /* GL_ARB_shader_image_size */ - -/* ------------------------- GL_ARB_shader_objects ------------------------- */ - -#ifndef GL_ARB_shader_objects -#define GL_ARB_shader_objects 1 - -#define GL_PROGRAM_OBJECT_ARB 0x8B40 -#define GL_SHADER_OBJECT_ARB 0x8B48 -#define GL_OBJECT_TYPE_ARB 0x8B4E -#define GL_OBJECT_SUBTYPE_ARB 0x8B4F -#define GL_FLOAT_VEC2_ARB 0x8B50 -#define GL_FLOAT_VEC3_ARB 0x8B51 -#define GL_FLOAT_VEC4_ARB 0x8B52 -#define GL_INT_VEC2_ARB 0x8B53 -#define GL_INT_VEC3_ARB 0x8B54 -#define GL_INT_VEC4_ARB 0x8B55 -#define GL_BOOL_ARB 0x8B56 -#define GL_BOOL_VEC2_ARB 0x8B57 -#define GL_BOOL_VEC3_ARB 0x8B58 -#define GL_BOOL_VEC4_ARB 0x8B59 -#define GL_FLOAT_MAT2_ARB 0x8B5A -#define GL_FLOAT_MAT3_ARB 0x8B5B -#define GL_FLOAT_MAT4_ARB 0x8B5C -#define GL_SAMPLER_1D_ARB 0x8B5D -#define GL_SAMPLER_2D_ARB 0x8B5E -#define GL_SAMPLER_3D_ARB 0x8B5F -#define GL_SAMPLER_CUBE_ARB 0x8B60 -#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 -#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 -#define GL_SAMPLER_2D_RECT_ARB 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 -#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 -#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 -#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 -#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 -#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 -#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 -#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 -#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 -#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 - -typedef char GLcharARB; -typedef unsigned int GLhandleARB; - -typedef void (GLAPIENTRY * PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); -typedef void (GLAPIENTRY * PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); -typedef GLhandleARB (GLAPIENTRY * PFNGLCREATEPROGRAMOBJECTARBPROC) (void); -typedef GLhandleARB (GLAPIENTRY * PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); -typedef void (GLAPIENTRY * PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); -typedef void (GLAPIENTRY * PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); -typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); -typedef void (GLAPIENTRY * PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei* count, GLhandleARB *obj); -typedef GLhandleARB (GLAPIENTRY * PFNGLGETHANDLEARBPROC) (GLenum pname); -typedef void (GLAPIENTRY * PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *infoLog); -typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *source); -typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); -typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint* params); -typedef void (GLAPIENTRY * PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); -typedef void (GLAPIENTRY * PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint *length); -typedef void (GLAPIENTRY * PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); -typedef void (GLAPIENTRY * PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); -typedef void (GLAPIENTRY * PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (GLAPIENTRY * PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); -typedef void (GLAPIENTRY * PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (GLAPIENTRY * PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (GLAPIENTRY * PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (GLAPIENTRY * PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (GLAPIENTRY * PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); -typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); - -#define glAttachObjectARB GLEW_GET_FUN(__glewAttachObjectARB) -#define glCompileShaderARB GLEW_GET_FUN(__glewCompileShaderARB) -#define glCreateProgramObjectARB GLEW_GET_FUN(__glewCreateProgramObjectARB) -#define glCreateShaderObjectARB GLEW_GET_FUN(__glewCreateShaderObjectARB) -#define glDeleteObjectARB GLEW_GET_FUN(__glewDeleteObjectARB) -#define glDetachObjectARB GLEW_GET_FUN(__glewDetachObjectARB) -#define glGetActiveUniformARB GLEW_GET_FUN(__glewGetActiveUniformARB) -#define glGetAttachedObjectsARB GLEW_GET_FUN(__glewGetAttachedObjectsARB) -#define glGetHandleARB GLEW_GET_FUN(__glewGetHandleARB) -#define glGetInfoLogARB GLEW_GET_FUN(__glewGetInfoLogARB) -#define glGetObjectParameterfvARB GLEW_GET_FUN(__glewGetObjectParameterfvARB) -#define glGetObjectParameterivARB GLEW_GET_FUN(__glewGetObjectParameterivARB) -#define glGetShaderSourceARB GLEW_GET_FUN(__glewGetShaderSourceARB) -#define glGetUniformLocationARB GLEW_GET_FUN(__glewGetUniformLocationARB) -#define glGetUniformfvARB GLEW_GET_FUN(__glewGetUniformfvARB) -#define glGetUniformivARB GLEW_GET_FUN(__glewGetUniformivARB) -#define glLinkProgramARB GLEW_GET_FUN(__glewLinkProgramARB) -#define glShaderSourceARB GLEW_GET_FUN(__glewShaderSourceARB) -#define glUniform1fARB GLEW_GET_FUN(__glewUniform1fARB) -#define glUniform1fvARB GLEW_GET_FUN(__glewUniform1fvARB) -#define glUniform1iARB GLEW_GET_FUN(__glewUniform1iARB) -#define glUniform1ivARB GLEW_GET_FUN(__glewUniform1ivARB) -#define glUniform2fARB GLEW_GET_FUN(__glewUniform2fARB) -#define glUniform2fvARB GLEW_GET_FUN(__glewUniform2fvARB) -#define glUniform2iARB GLEW_GET_FUN(__glewUniform2iARB) -#define glUniform2ivARB GLEW_GET_FUN(__glewUniform2ivARB) -#define glUniform3fARB GLEW_GET_FUN(__glewUniform3fARB) -#define glUniform3fvARB GLEW_GET_FUN(__glewUniform3fvARB) -#define glUniform3iARB GLEW_GET_FUN(__glewUniform3iARB) -#define glUniform3ivARB GLEW_GET_FUN(__glewUniform3ivARB) -#define glUniform4fARB GLEW_GET_FUN(__glewUniform4fARB) -#define glUniform4fvARB GLEW_GET_FUN(__glewUniform4fvARB) -#define glUniform4iARB GLEW_GET_FUN(__glewUniform4iARB) -#define glUniform4ivARB GLEW_GET_FUN(__glewUniform4ivARB) -#define glUniformMatrix2fvARB GLEW_GET_FUN(__glewUniformMatrix2fvARB) -#define glUniformMatrix3fvARB GLEW_GET_FUN(__glewUniformMatrix3fvARB) -#define glUniformMatrix4fvARB GLEW_GET_FUN(__glewUniformMatrix4fvARB) -#define glUseProgramObjectARB GLEW_GET_FUN(__glewUseProgramObjectARB) -#define glValidateProgramARB GLEW_GET_FUN(__glewValidateProgramARB) - -#define GLEW_ARB_shader_objects GLEW_GET_VAR(__GLEW_ARB_shader_objects) - -#endif /* GL_ARB_shader_objects */ - -/* ------------------------ GL_ARB_shader_precision ------------------------ */ - -#ifndef GL_ARB_shader_precision -#define GL_ARB_shader_precision 1 - -#define GLEW_ARB_shader_precision GLEW_GET_VAR(__GLEW_ARB_shader_precision) - -#endif /* GL_ARB_shader_precision */ - -/* ---------------------- GL_ARB_shader_stencil_export --------------------- */ - -#ifndef GL_ARB_shader_stencil_export -#define GL_ARB_shader_stencil_export 1 - -#define GLEW_ARB_shader_stencil_export GLEW_GET_VAR(__GLEW_ARB_shader_stencil_export) - -#endif /* GL_ARB_shader_stencil_export */ - -/* ------------------ GL_ARB_shader_storage_buffer_object ------------------ */ - -#ifndef GL_ARB_shader_storage_buffer_object -#define GL_ARB_shader_storage_buffer_object 1 - -#define GL_SHADER_STORAGE_BARRIER_BIT 0x2000 -#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 -#define GL_SHADER_STORAGE_BUFFER 0x90D2 -#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 -#define GL_SHADER_STORAGE_BUFFER_START 0x90D4 -#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 -#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 -#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 -#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 -#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 -#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA -#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB -#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC -#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD -#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE -#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF - -typedef void (GLAPIENTRY * PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); - -#define glShaderStorageBlockBinding GLEW_GET_FUN(__glewShaderStorageBlockBinding) - -#define GLEW_ARB_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_ARB_shader_storage_buffer_object) - -#endif /* GL_ARB_shader_storage_buffer_object */ - -/* ------------------------ GL_ARB_shader_subroutine ----------------------- */ - -#ifndef GL_ARB_shader_subroutine -#define GL_ARB_shader_subroutine 1 - -#define GL_ACTIVE_SUBROUTINES 0x8DE5 -#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 -#define GL_MAX_SUBROUTINES 0x8DE7 -#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 -#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 -#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 -#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 -#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A -#define GL_COMPATIBLE_SUBROUTINES 0x8E4B - -typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); -typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); -typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint* values); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint* values); -typedef GLuint (GLAPIENTRY * PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar* name); -typedef GLint (GLAPIENTRY * PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar* name); -typedef void (GLAPIENTRY * PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint* params); -typedef void (GLAPIENTRY * PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint* indices); - -#define glGetActiveSubroutineName GLEW_GET_FUN(__glewGetActiveSubroutineName) -#define glGetActiveSubroutineUniformName GLEW_GET_FUN(__glewGetActiveSubroutineUniformName) -#define glGetActiveSubroutineUniformiv GLEW_GET_FUN(__glewGetActiveSubroutineUniformiv) -#define glGetProgramStageiv GLEW_GET_FUN(__glewGetProgramStageiv) -#define glGetSubroutineIndex GLEW_GET_FUN(__glewGetSubroutineIndex) -#define glGetSubroutineUniformLocation GLEW_GET_FUN(__glewGetSubroutineUniformLocation) -#define glGetUniformSubroutineuiv GLEW_GET_FUN(__glewGetUniformSubroutineuiv) -#define glUniformSubroutinesuiv GLEW_GET_FUN(__glewUniformSubroutinesuiv) - -#define GLEW_ARB_shader_subroutine GLEW_GET_VAR(__GLEW_ARB_shader_subroutine) - -#endif /* GL_ARB_shader_subroutine */ - -/* ------------------ GL_ARB_shader_texture_image_samples ------------------ */ - -#ifndef GL_ARB_shader_texture_image_samples -#define GL_ARB_shader_texture_image_samples 1 - -#define GLEW_ARB_shader_texture_image_samples GLEW_GET_VAR(__GLEW_ARB_shader_texture_image_samples) - -#endif /* GL_ARB_shader_texture_image_samples */ - -/* ----------------------- GL_ARB_shader_texture_lod ----------------------- */ - -#ifndef GL_ARB_shader_texture_lod -#define GL_ARB_shader_texture_lod 1 - -#define GLEW_ARB_shader_texture_lod GLEW_GET_VAR(__GLEW_ARB_shader_texture_lod) - -#endif /* GL_ARB_shader_texture_lod */ - -/* ------------------- GL_ARB_shader_viewport_layer_array ------------------ */ - -#ifndef GL_ARB_shader_viewport_layer_array -#define GL_ARB_shader_viewport_layer_array 1 - -#define GLEW_ARB_shader_viewport_layer_array GLEW_GET_VAR(__GLEW_ARB_shader_viewport_layer_array) - -#endif /* GL_ARB_shader_viewport_layer_array */ - -/* ---------------------- GL_ARB_shading_language_100 ---------------------- */ - -#ifndef GL_ARB_shading_language_100 -#define GL_ARB_shading_language_100 1 - -#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C - -#define GLEW_ARB_shading_language_100 GLEW_GET_VAR(__GLEW_ARB_shading_language_100) - -#endif /* GL_ARB_shading_language_100 */ - -/* -------------------- GL_ARB_shading_language_420pack -------------------- */ - -#ifndef GL_ARB_shading_language_420pack -#define GL_ARB_shading_language_420pack 1 - -#define GLEW_ARB_shading_language_420pack GLEW_GET_VAR(__GLEW_ARB_shading_language_420pack) - -#endif /* GL_ARB_shading_language_420pack */ - -/* -------------------- GL_ARB_shading_language_include -------------------- */ - -#ifndef GL_ARB_shading_language_include -#define GL_ARB_shading_language_include 1 - -#define GL_SHADER_INCLUDE_ARB 0x8DAE -#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 -#define GL_NAMED_STRING_TYPE_ARB 0x8DEA - -typedef void (GLAPIENTRY * PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar* const *path, const GLint *length); -typedef void (GLAPIENTRY * PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); -typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name, GLsizei bufSize, GLint *stringlen, GLchar *string); -typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar* name, GLenum pname, GLint *params); -typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); -typedef void (GLAPIENTRY * PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar* name, GLint stringlen, const GLchar *string); - -#define glCompileShaderIncludeARB GLEW_GET_FUN(__glewCompileShaderIncludeARB) -#define glDeleteNamedStringARB GLEW_GET_FUN(__glewDeleteNamedStringARB) -#define glGetNamedStringARB GLEW_GET_FUN(__glewGetNamedStringARB) -#define glGetNamedStringivARB GLEW_GET_FUN(__glewGetNamedStringivARB) -#define glIsNamedStringARB GLEW_GET_FUN(__glewIsNamedStringARB) -#define glNamedStringARB GLEW_GET_FUN(__glewNamedStringARB) - -#define GLEW_ARB_shading_language_include GLEW_GET_VAR(__GLEW_ARB_shading_language_include) - -#endif /* GL_ARB_shading_language_include */ - -/* -------------------- GL_ARB_shading_language_packing -------------------- */ - -#ifndef GL_ARB_shading_language_packing -#define GL_ARB_shading_language_packing 1 - -#define GLEW_ARB_shading_language_packing GLEW_GET_VAR(__GLEW_ARB_shading_language_packing) - -#endif /* GL_ARB_shading_language_packing */ - -/* ----------------------------- GL_ARB_shadow ----------------------------- */ - -#ifndef GL_ARB_shadow -#define GL_ARB_shadow 1 - -#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C -#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D -#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E - -#define GLEW_ARB_shadow GLEW_GET_VAR(__GLEW_ARB_shadow) - -#endif /* GL_ARB_shadow */ - -/* ------------------------- GL_ARB_shadow_ambient ------------------------- */ - -#ifndef GL_ARB_shadow_ambient -#define GL_ARB_shadow_ambient 1 - -#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF - -#define GLEW_ARB_shadow_ambient GLEW_GET_VAR(__GLEW_ARB_shadow_ambient) - -#endif /* GL_ARB_shadow_ambient */ - -/* -------------------------- GL_ARB_sparse_buffer ------------------------- */ - -#ifndef GL_ARB_sparse_buffer -#define GL_ARB_sparse_buffer 1 - -#define GL_SPARSE_STORAGE_BIT_ARB 0x0400 -#define GL_SPARSE_BUFFER_PAGE_SIZE_ARB 0x82F8 - -typedef void (GLAPIENTRY * PFNGLBUFFERPAGECOMMITMENTARBPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLboolean commit); - -#define glBufferPageCommitmentARB GLEW_GET_FUN(__glewBufferPageCommitmentARB) - -#define GLEW_ARB_sparse_buffer GLEW_GET_VAR(__GLEW_ARB_sparse_buffer) - -#endif /* GL_ARB_sparse_buffer */ - -/* ------------------------- GL_ARB_sparse_texture ------------------------- */ - -#ifndef GL_ARB_sparse_texture -#define GL_ARB_sparse_texture 1 - -#define GL_VIRTUAL_PAGE_SIZE_X_ARB 0x9195 -#define GL_VIRTUAL_PAGE_SIZE_Y_ARB 0x9196 -#define GL_VIRTUAL_PAGE_SIZE_Z_ARB 0x9197 -#define GL_MAX_SPARSE_TEXTURE_SIZE_ARB 0x9198 -#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB 0x9199 -#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB 0x919A -#define GL_TEXTURE_SPARSE_ARB 0x91A6 -#define GL_VIRTUAL_PAGE_SIZE_INDEX_ARB 0x91A7 -#define GL_NUM_VIRTUAL_PAGE_SIZES_ARB 0x91A8 -#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB 0x91A9 -#define GL_NUM_SPARSE_LEVELS_ARB 0x91AA - -typedef void (GLAPIENTRY * PFNGLTEXPAGECOMMITMENTARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); -typedef void (GLAPIENTRY * PFNGLTEXTUREPAGECOMMITMENTEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); - -#define glTexPageCommitmentARB GLEW_GET_FUN(__glewTexPageCommitmentARB) -#define glTexturePageCommitmentEXT GLEW_GET_FUN(__glewTexturePageCommitmentEXT) - -#define GLEW_ARB_sparse_texture GLEW_GET_VAR(__GLEW_ARB_sparse_texture) - -#endif /* GL_ARB_sparse_texture */ - -/* ------------------------- GL_ARB_sparse_texture2 ------------------------ */ - -#ifndef GL_ARB_sparse_texture2 -#define GL_ARB_sparse_texture2 1 - -#define GLEW_ARB_sparse_texture2 GLEW_GET_VAR(__GLEW_ARB_sparse_texture2) - -#endif /* GL_ARB_sparse_texture2 */ - -/* ---------------------- GL_ARB_sparse_texture_clamp ---------------------- */ - -#ifndef GL_ARB_sparse_texture_clamp -#define GL_ARB_sparse_texture_clamp 1 - -#define GLEW_ARB_sparse_texture_clamp GLEW_GET_VAR(__GLEW_ARB_sparse_texture_clamp) - -#endif /* GL_ARB_sparse_texture_clamp */ - -/* ------------------------ GL_ARB_stencil_texturing ----------------------- */ - -#ifndef GL_ARB_stencil_texturing -#define GL_ARB_stencil_texturing 1 - -#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA - -#define GLEW_ARB_stencil_texturing GLEW_GET_VAR(__GLEW_ARB_stencil_texturing) - -#endif /* GL_ARB_stencil_texturing */ - -/* ------------------------------ GL_ARB_sync ------------------------------ */ - -#ifndef GL_ARB_sync -#define GL_ARB_sync 1 - -#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 -#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 -#define GL_OBJECT_TYPE 0x9112 -#define GL_SYNC_CONDITION 0x9113 -#define GL_SYNC_STATUS 0x9114 -#define GL_SYNC_FLAGS 0x9115 -#define GL_SYNC_FENCE 0x9116 -#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 -#define GL_UNSIGNALED 0x9118 -#define GL_SIGNALED 0x9119 -#define GL_ALREADY_SIGNALED 0x911A -#define GL_TIMEOUT_EXPIRED 0x911B -#define GL_CONDITION_SATISFIED 0x911C -#define GL_WAIT_FAILED 0x911D -#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF - -typedef GLenum (GLAPIENTRY * PFNGLCLIENTWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); -typedef void (GLAPIENTRY * PFNGLDELETESYNCPROC) (GLsync GLsync); -typedef GLsync (GLAPIENTRY * PFNGLFENCESYNCPROC) (GLenum condition,GLbitfield flags); -typedef void (GLAPIENTRY * PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64* params); -typedef void (GLAPIENTRY * PFNGLGETSYNCIVPROC) (GLsync GLsync,GLenum pname,GLsizei bufSize,GLsizei* length, GLint *values); -typedef GLboolean (GLAPIENTRY * PFNGLISSYNCPROC) (GLsync GLsync); -typedef void (GLAPIENTRY * PFNGLWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); - -#define glClientWaitSync GLEW_GET_FUN(__glewClientWaitSync) -#define glDeleteSync GLEW_GET_FUN(__glewDeleteSync) -#define glFenceSync GLEW_GET_FUN(__glewFenceSync) -#define glGetInteger64v GLEW_GET_FUN(__glewGetInteger64v) -#define glGetSynciv GLEW_GET_FUN(__glewGetSynciv) -#define glIsSync GLEW_GET_FUN(__glewIsSync) -#define glWaitSync GLEW_GET_FUN(__glewWaitSync) - -#define GLEW_ARB_sync GLEW_GET_VAR(__GLEW_ARB_sync) - -#endif /* GL_ARB_sync */ - -/* ----------------------- GL_ARB_tessellation_shader ---------------------- */ - -#ifndef GL_ARB_tessellation_shader -#define GL_ARB_tessellation_shader 1 - -#define GL_PATCHES 0xE -#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 -#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C -#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D -#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E -#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F -#define GL_PATCH_VERTICES 0x8E72 -#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 -#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 -#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 -#define GL_TESS_GEN_MODE 0x8E76 -#define GL_TESS_GEN_SPACING 0x8E77 -#define GL_TESS_GEN_VERTEX_ORDER 0x8E78 -#define GL_TESS_GEN_POINT_MODE 0x8E79 -#define GL_ISOLINES 0x8E7A -#define GL_FRACTIONAL_ODD 0x8E7B -#define GL_FRACTIONAL_EVEN 0x8E7C -#define GL_MAX_PATCH_VERTICES 0x8E7D -#define GL_MAX_TESS_GEN_LEVEL 0x8E7E -#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F -#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 -#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 -#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 -#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 -#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 -#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 -#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 -#define GL_TESS_EVALUATION_SHADER 0x8E87 -#define GL_TESS_CONTROL_SHADER 0x8E88 -#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 -#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A - -typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat* values); -typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value); - -#define glPatchParameterfv GLEW_GET_FUN(__glewPatchParameterfv) -#define glPatchParameteri GLEW_GET_FUN(__glewPatchParameteri) - -#define GLEW_ARB_tessellation_shader GLEW_GET_VAR(__GLEW_ARB_tessellation_shader) - -#endif /* GL_ARB_tessellation_shader */ - -/* ------------------------- GL_ARB_texture_barrier ------------------------ */ - -#ifndef GL_ARB_texture_barrier -#define GL_ARB_texture_barrier 1 - -typedef void (GLAPIENTRY * PFNGLTEXTUREBARRIERPROC) (void); - -#define glTextureBarrier GLEW_GET_FUN(__glewTextureBarrier) - -#define GLEW_ARB_texture_barrier GLEW_GET_VAR(__GLEW_ARB_texture_barrier) - -#endif /* GL_ARB_texture_barrier */ - -/* ---------------------- GL_ARB_texture_border_clamp ---------------------- */ - -#ifndef GL_ARB_texture_border_clamp -#define GL_ARB_texture_border_clamp 1 - -#define GL_CLAMP_TO_BORDER_ARB 0x812D - -#define GLEW_ARB_texture_border_clamp GLEW_GET_VAR(__GLEW_ARB_texture_border_clamp) - -#endif /* GL_ARB_texture_border_clamp */ - -/* ---------------------- GL_ARB_texture_buffer_object --------------------- */ - -#ifndef GL_ARB_texture_buffer_object -#define GL_ARB_texture_buffer_object 1 - -#define GL_TEXTURE_BUFFER_ARB 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E - -typedef void (GLAPIENTRY * PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); - -#define glTexBufferARB GLEW_GET_FUN(__glewTexBufferARB) - -#define GLEW_ARB_texture_buffer_object GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object) - -#endif /* GL_ARB_texture_buffer_object */ - -/* ------------------- GL_ARB_texture_buffer_object_rgb32 ------------------ */ - -#ifndef GL_ARB_texture_buffer_object_rgb32 -#define GL_ARB_texture_buffer_object_rgb32 1 - -#define GLEW_ARB_texture_buffer_object_rgb32 GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object_rgb32) - -#endif /* GL_ARB_texture_buffer_object_rgb32 */ - -/* ---------------------- GL_ARB_texture_buffer_range ---------------------- */ - -#ifndef GL_ARB_texture_buffer_range -#define GL_ARB_texture_buffer_range 1 - -#define GL_TEXTURE_BUFFER_OFFSET 0x919D -#define GL_TEXTURE_BUFFER_SIZE 0x919E -#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F - -typedef void (GLAPIENTRY * PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); - -#define glTexBufferRange GLEW_GET_FUN(__glewTexBufferRange) -#define glTextureBufferRangeEXT GLEW_GET_FUN(__glewTextureBufferRangeEXT) - -#define GLEW_ARB_texture_buffer_range GLEW_GET_VAR(__GLEW_ARB_texture_buffer_range) - -#endif /* GL_ARB_texture_buffer_range */ - -/* ----------------------- GL_ARB_texture_compression ---------------------- */ - -#ifndef GL_ARB_texture_compression -#define GL_ARB_texture_compression 1 - -#define GL_COMPRESSED_ALPHA_ARB 0x84E9 -#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB -#define GL_COMPRESSED_INTENSITY_ARB 0x84EC -#define GL_COMPRESSED_RGB_ARB 0x84ED -#define GL_COMPRESSED_RGBA_ARB 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 -#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 - -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, void *img); - -#define glCompressedTexImage1DARB GLEW_GET_FUN(__glewCompressedTexImage1DARB) -#define glCompressedTexImage2DARB GLEW_GET_FUN(__glewCompressedTexImage2DARB) -#define glCompressedTexImage3DARB GLEW_GET_FUN(__glewCompressedTexImage3DARB) -#define glCompressedTexSubImage1DARB GLEW_GET_FUN(__glewCompressedTexSubImage1DARB) -#define glCompressedTexSubImage2DARB GLEW_GET_FUN(__glewCompressedTexSubImage2DARB) -#define glCompressedTexSubImage3DARB GLEW_GET_FUN(__glewCompressedTexSubImage3DARB) -#define glGetCompressedTexImageARB GLEW_GET_FUN(__glewGetCompressedTexImageARB) - -#define GLEW_ARB_texture_compression GLEW_GET_VAR(__GLEW_ARB_texture_compression) - -#endif /* GL_ARB_texture_compression */ - -/* -------------------- GL_ARB_texture_compression_bptc -------------------- */ - -#ifndef GL_ARB_texture_compression_bptc -#define GL_ARB_texture_compression_bptc 1 - -#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C -#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D -#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E -#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F - -#define GLEW_ARB_texture_compression_bptc GLEW_GET_VAR(__GLEW_ARB_texture_compression_bptc) - -#endif /* GL_ARB_texture_compression_bptc */ - -/* -------------------- GL_ARB_texture_compression_rgtc -------------------- */ - -#ifndef GL_ARB_texture_compression_rgtc -#define GL_ARB_texture_compression_rgtc 1 - -#define GL_COMPRESSED_RED_RGTC1 0x8DBB -#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC -#define GL_COMPRESSED_RG_RGTC2 0x8DBD -#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE - -#define GLEW_ARB_texture_compression_rgtc GLEW_GET_VAR(__GLEW_ARB_texture_compression_rgtc) - -#endif /* GL_ARB_texture_compression_rgtc */ - -/* ------------------------ GL_ARB_texture_cube_map ------------------------ */ - -#ifndef GL_ARB_texture_cube_map -#define GL_ARB_texture_cube_map 1 - -#define GL_NORMAL_MAP_ARB 0x8511 -#define GL_REFLECTION_MAP_ARB 0x8512 -#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C - -#define GLEW_ARB_texture_cube_map GLEW_GET_VAR(__GLEW_ARB_texture_cube_map) - -#endif /* GL_ARB_texture_cube_map */ - -/* --------------------- GL_ARB_texture_cube_map_array --------------------- */ - -#ifndef GL_ARB_texture_cube_map_array -#define GL_ARB_texture_cube_map_array 1 - -#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B -#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C -#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D -#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E -#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F - -#define GLEW_ARB_texture_cube_map_array GLEW_GET_VAR(__GLEW_ARB_texture_cube_map_array) - -#endif /* GL_ARB_texture_cube_map_array */ - -/* ------------------------- GL_ARB_texture_env_add ------------------------ */ - -#ifndef GL_ARB_texture_env_add -#define GL_ARB_texture_env_add 1 - -#define GLEW_ARB_texture_env_add GLEW_GET_VAR(__GLEW_ARB_texture_env_add) - -#endif /* GL_ARB_texture_env_add */ - -/* ----------------------- GL_ARB_texture_env_combine ---------------------- */ - -#ifndef GL_ARB_texture_env_combine -#define GL_ARB_texture_env_combine 1 - -#define GL_SUBTRACT_ARB 0x84E7 -#define GL_COMBINE_ARB 0x8570 -#define GL_COMBINE_RGB_ARB 0x8571 -#define GL_COMBINE_ALPHA_ARB 0x8572 -#define GL_RGB_SCALE_ARB 0x8573 -#define GL_ADD_SIGNED_ARB 0x8574 -#define GL_INTERPOLATE_ARB 0x8575 -#define GL_CONSTANT_ARB 0x8576 -#define GL_PRIMARY_COLOR_ARB 0x8577 -#define GL_PREVIOUS_ARB 0x8578 -#define GL_SOURCE0_RGB_ARB 0x8580 -#define GL_SOURCE1_RGB_ARB 0x8581 -#define GL_SOURCE2_RGB_ARB 0x8582 -#define GL_SOURCE0_ALPHA_ARB 0x8588 -#define GL_SOURCE1_ALPHA_ARB 0x8589 -#define GL_SOURCE2_ALPHA_ARB 0x858A -#define GL_OPERAND0_RGB_ARB 0x8590 -#define GL_OPERAND1_RGB_ARB 0x8591 -#define GL_OPERAND2_RGB_ARB 0x8592 -#define GL_OPERAND0_ALPHA_ARB 0x8598 -#define GL_OPERAND1_ALPHA_ARB 0x8599 -#define GL_OPERAND2_ALPHA_ARB 0x859A - -#define GLEW_ARB_texture_env_combine GLEW_GET_VAR(__GLEW_ARB_texture_env_combine) - -#endif /* GL_ARB_texture_env_combine */ - -/* ---------------------- GL_ARB_texture_env_crossbar ---------------------- */ - -#ifndef GL_ARB_texture_env_crossbar -#define GL_ARB_texture_env_crossbar 1 - -#define GLEW_ARB_texture_env_crossbar GLEW_GET_VAR(__GLEW_ARB_texture_env_crossbar) - -#endif /* GL_ARB_texture_env_crossbar */ - -/* ------------------------ GL_ARB_texture_env_dot3 ------------------------ */ - -#ifndef GL_ARB_texture_env_dot3 -#define GL_ARB_texture_env_dot3 1 - -#define GL_DOT3_RGB_ARB 0x86AE -#define GL_DOT3_RGBA_ARB 0x86AF - -#define GLEW_ARB_texture_env_dot3 GLEW_GET_VAR(__GLEW_ARB_texture_env_dot3) - -#endif /* GL_ARB_texture_env_dot3 */ - -/* ---------------------- GL_ARB_texture_filter_minmax --------------------- */ - -#ifndef GL_ARB_texture_filter_minmax -#define GL_ARB_texture_filter_minmax 1 - -#define GL_TEXTURE_REDUCTION_MODE_ARB 0x9366 -#define GL_WEIGHTED_AVERAGE_ARB 0x9367 - -#define GLEW_ARB_texture_filter_minmax GLEW_GET_VAR(__GLEW_ARB_texture_filter_minmax) - -#endif /* GL_ARB_texture_filter_minmax */ - -/* -------------------------- GL_ARB_texture_float ------------------------- */ - -#ifndef GL_ARB_texture_float -#define GL_ARB_texture_float 1 - -#define GL_RGBA32F_ARB 0x8814 -#define GL_RGB32F_ARB 0x8815 -#define GL_ALPHA32F_ARB 0x8816 -#define GL_INTENSITY32F_ARB 0x8817 -#define GL_LUMINANCE32F_ARB 0x8818 -#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 -#define GL_RGBA16F_ARB 0x881A -#define GL_RGB16F_ARB 0x881B -#define GL_ALPHA16F_ARB 0x881C -#define GL_INTENSITY16F_ARB 0x881D -#define GL_LUMINANCE16F_ARB 0x881E -#define GL_LUMINANCE_ALPHA16F_ARB 0x881F -#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 -#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 -#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 -#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 -#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 -#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 -#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 - -#define GLEW_ARB_texture_float GLEW_GET_VAR(__GLEW_ARB_texture_float) - -#endif /* GL_ARB_texture_float */ - -/* ------------------------- GL_ARB_texture_gather ------------------------- */ - -#ifndef GL_ARB_texture_gather -#define GL_ARB_texture_gather 1 - -#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E -#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F -#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F - -#define GLEW_ARB_texture_gather GLEW_GET_VAR(__GLEW_ARB_texture_gather) - -#endif /* GL_ARB_texture_gather */ - -/* ------------------ GL_ARB_texture_mirror_clamp_to_edge ------------------ */ - -#ifndef GL_ARB_texture_mirror_clamp_to_edge -#define GL_ARB_texture_mirror_clamp_to_edge 1 - -#define GL_MIRROR_CLAMP_TO_EDGE 0x8743 - -#define GLEW_ARB_texture_mirror_clamp_to_edge GLEW_GET_VAR(__GLEW_ARB_texture_mirror_clamp_to_edge) - -#endif /* GL_ARB_texture_mirror_clamp_to_edge */ - -/* --------------------- GL_ARB_texture_mirrored_repeat -------------------- */ - -#ifndef GL_ARB_texture_mirrored_repeat -#define GL_ARB_texture_mirrored_repeat 1 - -#define GL_MIRRORED_REPEAT_ARB 0x8370 - -#define GLEW_ARB_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_ARB_texture_mirrored_repeat) - -#endif /* GL_ARB_texture_mirrored_repeat */ - -/* ----------------------- GL_ARB_texture_multisample ---------------------- */ - -#ifndef GL_ARB_texture_multisample -#define GL_ARB_texture_multisample 1 - -#define GL_SAMPLE_POSITION 0x8E50 -#define GL_SAMPLE_MASK 0x8E51 -#define GL_SAMPLE_MASK_VALUE 0x8E52 -#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 -#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 -#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 -#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 -#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 -#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 -#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 -#define GL_TEXTURE_SAMPLES 0x9106 -#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 -#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 -#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A -#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B -#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C -#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D -#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E -#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F -#define GL_MAX_INTEGER_SAMPLES 0x9110 - -typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat* val); -typedef void (GLAPIENTRY * PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask); -typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); - -#define glGetMultisamplefv GLEW_GET_FUN(__glewGetMultisamplefv) -#define glSampleMaski GLEW_GET_FUN(__glewSampleMaski) -#define glTexImage2DMultisample GLEW_GET_FUN(__glewTexImage2DMultisample) -#define glTexImage3DMultisample GLEW_GET_FUN(__glewTexImage3DMultisample) - -#define GLEW_ARB_texture_multisample GLEW_GET_VAR(__GLEW_ARB_texture_multisample) - -#endif /* GL_ARB_texture_multisample */ - -/* -------------------- GL_ARB_texture_non_power_of_two -------------------- */ - -#ifndef GL_ARB_texture_non_power_of_two -#define GL_ARB_texture_non_power_of_two 1 - -#define GLEW_ARB_texture_non_power_of_two GLEW_GET_VAR(__GLEW_ARB_texture_non_power_of_two) - -#endif /* GL_ARB_texture_non_power_of_two */ - -/* ---------------------- GL_ARB_texture_query_levels ---------------------- */ - -#ifndef GL_ARB_texture_query_levels -#define GL_ARB_texture_query_levels 1 - -#define GLEW_ARB_texture_query_levels GLEW_GET_VAR(__GLEW_ARB_texture_query_levels) - -#endif /* GL_ARB_texture_query_levels */ - -/* ------------------------ GL_ARB_texture_query_lod ----------------------- */ - -#ifndef GL_ARB_texture_query_lod -#define GL_ARB_texture_query_lod 1 - -#define GLEW_ARB_texture_query_lod GLEW_GET_VAR(__GLEW_ARB_texture_query_lod) - -#endif /* GL_ARB_texture_query_lod */ - -/* ------------------------ GL_ARB_texture_rectangle ----------------------- */ - -#ifndef GL_ARB_texture_rectangle -#define GL_ARB_texture_rectangle 1 - -#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 -#define GL_SAMPLER_2D_RECT_ARB 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 - -#define GLEW_ARB_texture_rectangle GLEW_GET_VAR(__GLEW_ARB_texture_rectangle) - -#endif /* GL_ARB_texture_rectangle */ - -/* --------------------------- GL_ARB_texture_rg --------------------------- */ - -#ifndef GL_ARB_texture_rg -#define GL_ARB_texture_rg 1 - -#define GL_COMPRESSED_RED 0x8225 -#define GL_COMPRESSED_RG 0x8226 -#define GL_RG 0x8227 -#define GL_RG_INTEGER 0x8228 -#define GL_R8 0x8229 -#define GL_R16 0x822A -#define GL_RG8 0x822B -#define GL_RG16 0x822C -#define GL_R16F 0x822D -#define GL_R32F 0x822E -#define GL_RG16F 0x822F -#define GL_RG32F 0x8230 -#define GL_R8I 0x8231 -#define GL_R8UI 0x8232 -#define GL_R16I 0x8233 -#define GL_R16UI 0x8234 -#define GL_R32I 0x8235 -#define GL_R32UI 0x8236 -#define GL_RG8I 0x8237 -#define GL_RG8UI 0x8238 -#define GL_RG16I 0x8239 -#define GL_RG16UI 0x823A -#define GL_RG32I 0x823B -#define GL_RG32UI 0x823C - -#define GLEW_ARB_texture_rg GLEW_GET_VAR(__GLEW_ARB_texture_rg) - -#endif /* GL_ARB_texture_rg */ - -/* ----------------------- GL_ARB_texture_rgb10_a2ui ----------------------- */ - -#ifndef GL_ARB_texture_rgb10_a2ui -#define GL_ARB_texture_rgb10_a2ui 1 - -#define GL_RGB10_A2UI 0x906F - -#define GLEW_ARB_texture_rgb10_a2ui GLEW_GET_VAR(__GLEW_ARB_texture_rgb10_a2ui) - -#endif /* GL_ARB_texture_rgb10_a2ui */ - -/* ------------------------ GL_ARB_texture_stencil8 ------------------------ */ - -#ifndef GL_ARB_texture_stencil8 -#define GL_ARB_texture_stencil8 1 - -#define GL_STENCIL_INDEX 0x1901 -#define GL_STENCIL_INDEX8 0x8D48 - -#define GLEW_ARB_texture_stencil8 GLEW_GET_VAR(__GLEW_ARB_texture_stencil8) - -#endif /* GL_ARB_texture_stencil8 */ - -/* ------------------------- GL_ARB_texture_storage ------------------------ */ - -#ifndef GL_ARB_texture_storage -#define GL_ARB_texture_storage 1 - -#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F - -typedef void (GLAPIENTRY * PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); -typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); -typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); - -#define glTexStorage1D GLEW_GET_FUN(__glewTexStorage1D) -#define glTexStorage2D GLEW_GET_FUN(__glewTexStorage2D) -#define glTexStorage3D GLEW_GET_FUN(__glewTexStorage3D) -#define glTextureStorage1DEXT GLEW_GET_FUN(__glewTextureStorage1DEXT) -#define glTextureStorage2DEXT GLEW_GET_FUN(__glewTextureStorage2DEXT) -#define glTextureStorage3DEXT GLEW_GET_FUN(__glewTextureStorage3DEXT) - -#define GLEW_ARB_texture_storage GLEW_GET_VAR(__GLEW_ARB_texture_storage) - -#endif /* GL_ARB_texture_storage */ - -/* ------------------- GL_ARB_texture_storage_multisample ------------------ */ - -#ifndef GL_ARB_texture_storage_multisample -#define GL_ARB_texture_storage_multisample 1 - -typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); -typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); -typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); - -#define glTexStorage2DMultisample GLEW_GET_FUN(__glewTexStorage2DMultisample) -#define glTexStorage3DMultisample GLEW_GET_FUN(__glewTexStorage3DMultisample) -#define glTextureStorage2DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage2DMultisampleEXT) -#define glTextureStorage3DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage3DMultisampleEXT) - -#define GLEW_ARB_texture_storage_multisample GLEW_GET_VAR(__GLEW_ARB_texture_storage_multisample) - -#endif /* GL_ARB_texture_storage_multisample */ - -/* ------------------------- GL_ARB_texture_swizzle ------------------------ */ - -#ifndef GL_ARB_texture_swizzle -#define GL_ARB_texture_swizzle 1 - -#define GL_TEXTURE_SWIZZLE_R 0x8E42 -#define GL_TEXTURE_SWIZZLE_G 0x8E43 -#define GL_TEXTURE_SWIZZLE_B 0x8E44 -#define GL_TEXTURE_SWIZZLE_A 0x8E45 -#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 - -#define GLEW_ARB_texture_swizzle GLEW_GET_VAR(__GLEW_ARB_texture_swizzle) - -#endif /* GL_ARB_texture_swizzle */ - -/* -------------------------- GL_ARB_texture_view -------------------------- */ - -#ifndef GL_ARB_texture_view -#define GL_ARB_texture_view 1 - -#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB -#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC -#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD -#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE -#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF - -typedef void (GLAPIENTRY * PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); - -#define glTextureView GLEW_GET_FUN(__glewTextureView) - -#define GLEW_ARB_texture_view GLEW_GET_VAR(__GLEW_ARB_texture_view) - -#endif /* GL_ARB_texture_view */ - -/* --------------------------- GL_ARB_timer_query -------------------------- */ - -#ifndef GL_ARB_timer_query -#define GL_ARB_timer_query 1 - -#define GL_TIME_ELAPSED 0x88BF -#define GL_TIMESTAMP 0x8E28 - -typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64* params); -typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64* params); -typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); - -#define glGetQueryObjecti64v GLEW_GET_FUN(__glewGetQueryObjecti64v) -#define glGetQueryObjectui64v GLEW_GET_FUN(__glewGetQueryObjectui64v) -#define glQueryCounter GLEW_GET_FUN(__glewQueryCounter) - -#define GLEW_ARB_timer_query GLEW_GET_VAR(__GLEW_ARB_timer_query) - -#endif /* GL_ARB_timer_query */ - -/* ----------------------- GL_ARB_transform_feedback2 ---------------------- */ - -#ifndef GL_ARB_transform_feedback2 -#define GL_ARB_transform_feedback2 1 - -#define GL_TRANSFORM_FEEDBACK 0x8E22 -#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 -#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 -#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 - -typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); -typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint* ids); -typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id); -typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint* ids); -typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); -typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); -typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); - -#define glBindTransformFeedback GLEW_GET_FUN(__glewBindTransformFeedback) -#define glDeleteTransformFeedbacks GLEW_GET_FUN(__glewDeleteTransformFeedbacks) -#define glDrawTransformFeedback GLEW_GET_FUN(__glewDrawTransformFeedback) -#define glGenTransformFeedbacks GLEW_GET_FUN(__glewGenTransformFeedbacks) -#define glIsTransformFeedback GLEW_GET_FUN(__glewIsTransformFeedback) -#define glPauseTransformFeedback GLEW_GET_FUN(__glewPauseTransformFeedback) -#define glResumeTransformFeedback GLEW_GET_FUN(__glewResumeTransformFeedback) - -#define GLEW_ARB_transform_feedback2 GLEW_GET_VAR(__GLEW_ARB_transform_feedback2) - -#endif /* GL_ARB_transform_feedback2 */ - -/* ----------------------- GL_ARB_transform_feedback3 ---------------------- */ - -#ifndef GL_ARB_transform_feedback3 -#define GL_ARB_transform_feedback3 1 - -#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 -#define GL_MAX_VERTEX_STREAMS 0x8E71 - -typedef void (GLAPIENTRY * PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id); -typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream); -typedef void (GLAPIENTRY * PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index); -typedef void (GLAPIENTRY * PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); - -#define glBeginQueryIndexed GLEW_GET_FUN(__glewBeginQueryIndexed) -#define glDrawTransformFeedbackStream GLEW_GET_FUN(__glewDrawTransformFeedbackStream) -#define glEndQueryIndexed GLEW_GET_FUN(__glewEndQueryIndexed) -#define glGetQueryIndexediv GLEW_GET_FUN(__glewGetQueryIndexediv) - -#define GLEW_ARB_transform_feedback3 GLEW_GET_VAR(__GLEW_ARB_transform_feedback3) - -#endif /* GL_ARB_transform_feedback3 */ - -/* ------------------ GL_ARB_transform_feedback_instanced ------------------ */ - -#ifndef GL_ARB_transform_feedback_instanced -#define GL_ARB_transform_feedback_instanced 1 - -typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei primcount); -typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei primcount); - -#define glDrawTransformFeedbackInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackInstanced) -#define glDrawTransformFeedbackStreamInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackStreamInstanced) - -#define GLEW_ARB_transform_feedback_instanced GLEW_GET_VAR(__GLEW_ARB_transform_feedback_instanced) - -#endif /* GL_ARB_transform_feedback_instanced */ - -/* ---------------- GL_ARB_transform_feedback_overflow_query --------------- */ - -#ifndef GL_ARB_transform_feedback_overflow_query -#define GL_ARB_transform_feedback_overflow_query 1 - -#define GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB 0x82EC -#define GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB 0x82ED - -#define GLEW_ARB_transform_feedback_overflow_query GLEW_GET_VAR(__GLEW_ARB_transform_feedback_overflow_query) - -#endif /* GL_ARB_transform_feedback_overflow_query */ - -/* ------------------------ GL_ARB_transpose_matrix ------------------------ */ - -#ifndef GL_ARB_transpose_matrix -#define GL_ARB_transpose_matrix 1 - -#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 - -typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); -typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); -typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); -typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); - -#define glLoadTransposeMatrixdARB GLEW_GET_FUN(__glewLoadTransposeMatrixdARB) -#define glLoadTransposeMatrixfARB GLEW_GET_FUN(__glewLoadTransposeMatrixfARB) -#define glMultTransposeMatrixdARB GLEW_GET_FUN(__glewMultTransposeMatrixdARB) -#define glMultTransposeMatrixfARB GLEW_GET_FUN(__glewMultTransposeMatrixfARB) - -#define GLEW_ARB_transpose_matrix GLEW_GET_VAR(__GLEW_ARB_transpose_matrix) - -#endif /* GL_ARB_transpose_matrix */ - -/* ---------------------- GL_ARB_uniform_buffer_object --------------------- */ - -#ifndef GL_ARB_uniform_buffer_object -#define GL_ARB_uniform_buffer_object 1 - -#define GL_UNIFORM_BUFFER 0x8A11 -#define GL_UNIFORM_BUFFER_BINDING 0x8A28 -#define GL_UNIFORM_BUFFER_START 0x8A29 -#define GL_UNIFORM_BUFFER_SIZE 0x8A2A -#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B -#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C -#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D -#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E -#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F -#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 -#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 -#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 -#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 -#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 -#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 -#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 -#define GL_UNIFORM_TYPE 0x8A37 -#define GL_UNIFORM_SIZE 0x8A38 -#define GL_UNIFORM_NAME_LENGTH 0x8A39 -#define GL_UNIFORM_BLOCK_INDEX 0x8A3A -#define GL_UNIFORM_OFFSET 0x8A3B -#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C -#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D -#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E -#define GL_UNIFORM_BLOCK_BINDING 0x8A3F -#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 -#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 -#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 -#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 -#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 -#define GL_INVALID_INDEX 0xFFFFFFFF - -typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName); -typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformName); -typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint* data); -typedef GLuint (GLAPIENTRY * PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar* uniformBlockName); -typedef void (GLAPIENTRY * PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar* const * uniformNames, GLuint* uniformIndices); -typedef void (GLAPIENTRY * PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); - -#define glBindBufferBase GLEW_GET_FUN(__glewBindBufferBase) -#define glBindBufferRange GLEW_GET_FUN(__glewBindBufferRange) -#define glGetActiveUniformBlockName GLEW_GET_FUN(__glewGetActiveUniformBlockName) -#define glGetActiveUniformBlockiv GLEW_GET_FUN(__glewGetActiveUniformBlockiv) -#define glGetActiveUniformName GLEW_GET_FUN(__glewGetActiveUniformName) -#define glGetActiveUniformsiv GLEW_GET_FUN(__glewGetActiveUniformsiv) -#define glGetIntegeri_v GLEW_GET_FUN(__glewGetIntegeri_v) -#define glGetUniformBlockIndex GLEW_GET_FUN(__glewGetUniformBlockIndex) -#define glGetUniformIndices GLEW_GET_FUN(__glewGetUniformIndices) -#define glUniformBlockBinding GLEW_GET_FUN(__glewUniformBlockBinding) - -#define GLEW_ARB_uniform_buffer_object GLEW_GET_VAR(__GLEW_ARB_uniform_buffer_object) - -#endif /* GL_ARB_uniform_buffer_object */ - -/* ------------------------ GL_ARB_vertex_array_bgra ----------------------- */ - -#ifndef GL_ARB_vertex_array_bgra -#define GL_ARB_vertex_array_bgra 1 - -#define GL_BGRA 0x80E1 - -#define GLEW_ARB_vertex_array_bgra GLEW_GET_VAR(__GLEW_ARB_vertex_array_bgra) - -#endif /* GL_ARB_vertex_array_bgra */ - -/* ----------------------- GL_ARB_vertex_array_object ---------------------- */ - -#ifndef GL_ARB_vertex_array_object -#define GL_ARB_vertex_array_object 1 - -#define GL_VERTEX_ARRAY_BINDING 0x85B5 - -typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYPROC) (GLuint array); -typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint* arrays); -typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays); -typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYPROC) (GLuint array); - -#define glBindVertexArray GLEW_GET_FUN(__glewBindVertexArray) -#define glDeleteVertexArrays GLEW_GET_FUN(__glewDeleteVertexArrays) -#define glGenVertexArrays GLEW_GET_FUN(__glewGenVertexArrays) -#define glIsVertexArray GLEW_GET_FUN(__glewIsVertexArray) - -#define GLEW_ARB_vertex_array_object GLEW_GET_VAR(__GLEW_ARB_vertex_array_object) - -#endif /* GL_ARB_vertex_array_object */ - -/* ----------------------- GL_ARB_vertex_attrib_64bit ---------------------- */ - -#ifndef GL_ARB_vertex_attrib_64bit -#define GL_ARB_vertex_attrib_64bit 1 - -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); - -#define glGetVertexAttribLdv GLEW_GET_FUN(__glewGetVertexAttribLdv) -#define glVertexAttribL1d GLEW_GET_FUN(__glewVertexAttribL1d) -#define glVertexAttribL1dv GLEW_GET_FUN(__glewVertexAttribL1dv) -#define glVertexAttribL2d GLEW_GET_FUN(__glewVertexAttribL2d) -#define glVertexAttribL2dv GLEW_GET_FUN(__glewVertexAttribL2dv) -#define glVertexAttribL3d GLEW_GET_FUN(__glewVertexAttribL3d) -#define glVertexAttribL3dv GLEW_GET_FUN(__glewVertexAttribL3dv) -#define glVertexAttribL4d GLEW_GET_FUN(__glewVertexAttribL4d) -#define glVertexAttribL4dv GLEW_GET_FUN(__glewVertexAttribL4dv) -#define glVertexAttribLPointer GLEW_GET_FUN(__glewVertexAttribLPointer) - -#define GLEW_ARB_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_64bit) - -#endif /* GL_ARB_vertex_attrib_64bit */ - -/* ---------------------- GL_ARB_vertex_attrib_binding --------------------- */ - -#ifndef GL_ARB_vertex_attrib_binding -#define GL_ARB_vertex_attrib_binding 1 - -#define GL_VERTEX_ATTRIB_BINDING 0x82D4 -#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 -#define GL_VERTEX_BINDING_DIVISOR 0x82D6 -#define GL_VERTEX_BINDING_OFFSET 0x82D7 -#define GL_VERTEX_BINDING_STRIDE 0x82D8 -#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 -#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA -#define GL_VERTEX_BINDING_BUFFER 0x8F4F - -typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); -typedef void (GLAPIENTRY * PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor); - -#define glBindVertexBuffer GLEW_GET_FUN(__glewBindVertexBuffer) -#define glVertexArrayBindVertexBufferEXT GLEW_GET_FUN(__glewVertexArrayBindVertexBufferEXT) -#define glVertexArrayVertexAttribBindingEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribBindingEXT) -#define glVertexArrayVertexAttribFormatEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribFormatEXT) -#define glVertexArrayVertexAttribIFormatEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribIFormatEXT) -#define glVertexArrayVertexAttribLFormatEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribLFormatEXT) -#define glVertexArrayVertexBindingDivisorEXT GLEW_GET_FUN(__glewVertexArrayVertexBindingDivisorEXT) -#define glVertexAttribBinding GLEW_GET_FUN(__glewVertexAttribBinding) -#define glVertexAttribFormat GLEW_GET_FUN(__glewVertexAttribFormat) -#define glVertexAttribIFormat GLEW_GET_FUN(__glewVertexAttribIFormat) -#define glVertexAttribLFormat GLEW_GET_FUN(__glewVertexAttribLFormat) -#define glVertexBindingDivisor GLEW_GET_FUN(__glewVertexBindingDivisor) - -#define GLEW_ARB_vertex_attrib_binding GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_binding) - -#endif /* GL_ARB_vertex_attrib_binding */ - -/* -------------------------- GL_ARB_vertex_blend -------------------------- */ - -#ifndef GL_ARB_vertex_blend -#define GL_ARB_vertex_blend 1 - -#define GL_MODELVIEW0_ARB 0x1700 -#define GL_MODELVIEW1_ARB 0x850A -#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 -#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 -#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 -#define GL_VERTEX_BLEND_ARB 0x86A7 -#define GL_CURRENT_WEIGHT_ARB 0x86A8 -#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 -#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA -#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB -#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC -#define GL_WEIGHT_ARRAY_ARB 0x86AD -#define GL_MODELVIEW2_ARB 0x8722 -#define GL_MODELVIEW3_ARB 0x8723 -#define GL_MODELVIEW4_ARB 0x8724 -#define GL_MODELVIEW5_ARB 0x8725 -#define GL_MODELVIEW6_ARB 0x8726 -#define GL_MODELVIEW7_ARB 0x8727 -#define GL_MODELVIEW8_ARB 0x8728 -#define GL_MODELVIEW9_ARB 0x8729 -#define GL_MODELVIEW10_ARB 0x872A -#define GL_MODELVIEW11_ARB 0x872B -#define GL_MODELVIEW12_ARB 0x872C -#define GL_MODELVIEW13_ARB 0x872D -#define GL_MODELVIEW14_ARB 0x872E -#define GL_MODELVIEW15_ARB 0x872F -#define GL_MODELVIEW16_ARB 0x8730 -#define GL_MODELVIEW17_ARB 0x8731 -#define GL_MODELVIEW18_ARB 0x8732 -#define GL_MODELVIEW19_ARB 0x8733 -#define GL_MODELVIEW20_ARB 0x8734 -#define GL_MODELVIEW21_ARB 0x8735 -#define GL_MODELVIEW22_ARB 0x8736 -#define GL_MODELVIEW23_ARB 0x8737 -#define GL_MODELVIEW24_ARB 0x8738 -#define GL_MODELVIEW25_ARB 0x8739 -#define GL_MODELVIEW26_ARB 0x873A -#define GL_MODELVIEW27_ARB 0x873B -#define GL_MODELVIEW28_ARB 0x873C -#define GL_MODELVIEW29_ARB 0x873D -#define GL_MODELVIEW30_ARB 0x873E -#define GL_MODELVIEW31_ARB 0x873F - -typedef void (GLAPIENTRY * PFNGLVERTEXBLENDARBPROC) (GLint count); -typedef void (GLAPIENTRY * PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, void *pointer); -typedef void (GLAPIENTRY * PFNGLWEIGHTBVARBPROC) (GLint size, GLbyte *weights); -typedef void (GLAPIENTRY * PFNGLWEIGHTDVARBPROC) (GLint size, GLdouble *weights); -typedef void (GLAPIENTRY * PFNGLWEIGHTFVARBPROC) (GLint size, GLfloat *weights); -typedef void (GLAPIENTRY * PFNGLWEIGHTIVARBPROC) (GLint size, GLint *weights); -typedef void (GLAPIENTRY * PFNGLWEIGHTSVARBPROC) (GLint size, GLshort *weights); -typedef void (GLAPIENTRY * PFNGLWEIGHTUBVARBPROC) (GLint size, GLubyte *weights); -typedef void (GLAPIENTRY * PFNGLWEIGHTUIVARBPROC) (GLint size, GLuint *weights); -typedef void (GLAPIENTRY * PFNGLWEIGHTUSVARBPROC) (GLint size, GLushort *weights); - -#define glVertexBlendARB GLEW_GET_FUN(__glewVertexBlendARB) -#define glWeightPointerARB GLEW_GET_FUN(__glewWeightPointerARB) -#define glWeightbvARB GLEW_GET_FUN(__glewWeightbvARB) -#define glWeightdvARB GLEW_GET_FUN(__glewWeightdvARB) -#define glWeightfvARB GLEW_GET_FUN(__glewWeightfvARB) -#define glWeightivARB GLEW_GET_FUN(__glewWeightivARB) -#define glWeightsvARB GLEW_GET_FUN(__glewWeightsvARB) -#define glWeightubvARB GLEW_GET_FUN(__glewWeightubvARB) -#define glWeightuivARB GLEW_GET_FUN(__glewWeightuivARB) -#define glWeightusvARB GLEW_GET_FUN(__glewWeightusvARB) - -#define GLEW_ARB_vertex_blend GLEW_GET_VAR(__GLEW_ARB_vertex_blend) - -#endif /* GL_ARB_vertex_blend */ - -/* ---------------------- GL_ARB_vertex_buffer_object ---------------------- */ - -#ifndef GL_ARB_vertex_buffer_object -#define GL_ARB_vertex_buffer_object 1 - -#define GL_BUFFER_SIZE_ARB 0x8764 -#define GL_BUFFER_USAGE_ARB 0x8765 -#define GL_ARRAY_BUFFER_ARB 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 -#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F -#define GL_READ_ONLY_ARB 0x88B8 -#define GL_WRITE_ONLY_ARB 0x88B9 -#define GL_READ_WRITE_ARB 0x88BA -#define GL_BUFFER_ACCESS_ARB 0x88BB -#define GL_BUFFER_MAPPED_ARB 0x88BC -#define GL_BUFFER_MAP_POINTER_ARB 0x88BD -#define GL_STREAM_DRAW_ARB 0x88E0 -#define GL_STREAM_READ_ARB 0x88E1 -#define GL_STREAM_COPY_ARB 0x88E2 -#define GL_STATIC_DRAW_ARB 0x88E4 -#define GL_STATIC_READ_ARB 0x88E5 -#define GL_STATIC_COPY_ARB 0x88E6 -#define GL_DYNAMIC_DRAW_ARB 0x88E8 -#define GL_DYNAMIC_READ_ARB 0x88E9 -#define GL_DYNAMIC_COPY_ARB 0x88EA - -typedef ptrdiff_t GLintptrARB; -typedef ptrdiff_t GLsizeiptrARB; - -typedef void (GLAPIENTRY * PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); -typedef void (GLAPIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage); -typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data); -typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint* buffers); -typedef void (GLAPIENTRY * PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint* buffers); -typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, void** params); -typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data); -typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERARBPROC) (GLuint buffer); -typedef void * (GLAPIENTRY * PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); -typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERARBPROC) (GLenum target); - -#define glBindBufferARB GLEW_GET_FUN(__glewBindBufferARB) -#define glBufferDataARB GLEW_GET_FUN(__glewBufferDataARB) -#define glBufferSubDataARB GLEW_GET_FUN(__glewBufferSubDataARB) -#define glDeleteBuffersARB GLEW_GET_FUN(__glewDeleteBuffersARB) -#define glGenBuffersARB GLEW_GET_FUN(__glewGenBuffersARB) -#define glGetBufferParameterivARB GLEW_GET_FUN(__glewGetBufferParameterivARB) -#define glGetBufferPointervARB GLEW_GET_FUN(__glewGetBufferPointervARB) -#define glGetBufferSubDataARB GLEW_GET_FUN(__glewGetBufferSubDataARB) -#define glIsBufferARB GLEW_GET_FUN(__glewIsBufferARB) -#define glMapBufferARB GLEW_GET_FUN(__glewMapBufferARB) -#define glUnmapBufferARB GLEW_GET_FUN(__glewUnmapBufferARB) - -#define GLEW_ARB_vertex_buffer_object GLEW_GET_VAR(__GLEW_ARB_vertex_buffer_object) - -#endif /* GL_ARB_vertex_buffer_object */ - -/* ------------------------- GL_ARB_vertex_program ------------------------- */ - -#ifndef GL_ARB_vertex_program -#define GL_ARB_vertex_program 1 - -#define GL_COLOR_SUM_ARB 0x8458 -#define GL_VERTEX_PROGRAM_ARB 0x8620 -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 -#define GL_PROGRAM_LENGTH_ARB 0x8627 -#define GL_PROGRAM_STRING_ARB 0x8628 -#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E -#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F -#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 -#define GL_CURRENT_MATRIX_ARB 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 -#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B -#define GL_PROGRAM_BINDING_ARB 0x8677 -#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A -#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 -#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 -#define GL_PROGRAM_FORMAT_ARB 0x8876 -#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 -#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 -#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 -#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 -#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 -#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 -#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 -#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 -#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 -#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 -#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA -#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB -#define GL_PROGRAM_ATTRIBS_ARB 0x88AC -#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD -#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE -#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF -#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 -#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 -#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 -#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 -#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 -#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 -#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 -#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 -#define GL_MATRIX0_ARB 0x88C0 -#define GL_MATRIX1_ARB 0x88C1 -#define GL_MATRIX2_ARB 0x88C2 -#define GL_MATRIX3_ARB 0x88C3 -#define GL_MATRIX4_ARB 0x88C4 -#define GL_MATRIX5_ARB 0x88C5 -#define GL_MATRIX6_ARB 0x88C6 -#define GL_MATRIX7_ARB 0x88C7 -#define GL_MATRIX8_ARB 0x88C8 -#define GL_MATRIX9_ARB 0x88C9 -#define GL_MATRIX10_ARB 0x88CA -#define GL_MATRIX11_ARB 0x88CB -#define GL_MATRIX12_ARB 0x88CC -#define GL_MATRIX13_ARB 0x88CD -#define GL_MATRIX14_ARB 0x88CE -#define GL_MATRIX15_ARB 0x88CF -#define GL_MATRIX16_ARB 0x88D0 -#define GL_MATRIX17_ARB 0x88D1 -#define GL_MATRIX18_ARB 0x88D2 -#define GL_MATRIX19_ARB 0x88D3 -#define GL_MATRIX20_ARB 0x88D4 -#define GL_MATRIX21_ARB 0x88D5 -#define GL_MATRIX22_ARB 0x88D6 -#define GL_MATRIX23_ARB 0x88D7 -#define GL_MATRIX24_ARB 0x88D8 -#define GL_MATRIX25_ARB 0x88D9 -#define GL_MATRIX26_ARB 0x88DA -#define GL_MATRIX27_ARB 0x88DB -#define GL_MATRIX28_ARB 0x88DC -#define GL_MATRIX29_ARB 0x88DD -#define GL_MATRIX30_ARB 0x88DE -#define GL_MATRIX31_ARB 0x88DF - -typedef void (GLAPIENTRY * PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); -typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint* programs); -typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (GLAPIENTRY * PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint* programs); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, void *string); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, void** pointer); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint* params); -typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMARBPROC) (GLuint program); -typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); -typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); -typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void *string); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); - -#define glBindProgramARB GLEW_GET_FUN(__glewBindProgramARB) -#define glDeleteProgramsARB GLEW_GET_FUN(__glewDeleteProgramsARB) -#define glDisableVertexAttribArrayARB GLEW_GET_FUN(__glewDisableVertexAttribArrayARB) -#define glEnableVertexAttribArrayARB GLEW_GET_FUN(__glewEnableVertexAttribArrayARB) -#define glGenProgramsARB GLEW_GET_FUN(__glewGenProgramsARB) -#define glGetProgramEnvParameterdvARB GLEW_GET_FUN(__glewGetProgramEnvParameterdvARB) -#define glGetProgramEnvParameterfvARB GLEW_GET_FUN(__glewGetProgramEnvParameterfvARB) -#define glGetProgramLocalParameterdvARB GLEW_GET_FUN(__glewGetProgramLocalParameterdvARB) -#define glGetProgramLocalParameterfvARB GLEW_GET_FUN(__glewGetProgramLocalParameterfvARB) -#define glGetProgramStringARB GLEW_GET_FUN(__glewGetProgramStringARB) -#define glGetProgramivARB GLEW_GET_FUN(__glewGetProgramivARB) -#define glGetVertexAttribPointervARB GLEW_GET_FUN(__glewGetVertexAttribPointervARB) -#define glGetVertexAttribdvARB GLEW_GET_FUN(__glewGetVertexAttribdvARB) -#define glGetVertexAttribfvARB GLEW_GET_FUN(__glewGetVertexAttribfvARB) -#define glGetVertexAttribivARB GLEW_GET_FUN(__glewGetVertexAttribivARB) -#define glIsProgramARB GLEW_GET_FUN(__glewIsProgramARB) -#define glProgramEnvParameter4dARB GLEW_GET_FUN(__glewProgramEnvParameter4dARB) -#define glProgramEnvParameter4dvARB GLEW_GET_FUN(__glewProgramEnvParameter4dvARB) -#define glProgramEnvParameter4fARB GLEW_GET_FUN(__glewProgramEnvParameter4fARB) -#define glProgramEnvParameter4fvARB GLEW_GET_FUN(__glewProgramEnvParameter4fvARB) -#define glProgramLocalParameter4dARB GLEW_GET_FUN(__glewProgramLocalParameter4dARB) -#define glProgramLocalParameter4dvARB GLEW_GET_FUN(__glewProgramLocalParameter4dvARB) -#define glProgramLocalParameter4fARB GLEW_GET_FUN(__glewProgramLocalParameter4fARB) -#define glProgramLocalParameter4fvARB GLEW_GET_FUN(__glewProgramLocalParameter4fvARB) -#define glProgramStringARB GLEW_GET_FUN(__glewProgramStringARB) -#define glVertexAttrib1dARB GLEW_GET_FUN(__glewVertexAttrib1dARB) -#define glVertexAttrib1dvARB GLEW_GET_FUN(__glewVertexAttrib1dvARB) -#define glVertexAttrib1fARB GLEW_GET_FUN(__glewVertexAttrib1fARB) -#define glVertexAttrib1fvARB GLEW_GET_FUN(__glewVertexAttrib1fvARB) -#define glVertexAttrib1sARB GLEW_GET_FUN(__glewVertexAttrib1sARB) -#define glVertexAttrib1svARB GLEW_GET_FUN(__glewVertexAttrib1svARB) -#define glVertexAttrib2dARB GLEW_GET_FUN(__glewVertexAttrib2dARB) -#define glVertexAttrib2dvARB GLEW_GET_FUN(__glewVertexAttrib2dvARB) -#define glVertexAttrib2fARB GLEW_GET_FUN(__glewVertexAttrib2fARB) -#define glVertexAttrib2fvARB GLEW_GET_FUN(__glewVertexAttrib2fvARB) -#define glVertexAttrib2sARB GLEW_GET_FUN(__glewVertexAttrib2sARB) -#define glVertexAttrib2svARB GLEW_GET_FUN(__glewVertexAttrib2svARB) -#define glVertexAttrib3dARB GLEW_GET_FUN(__glewVertexAttrib3dARB) -#define glVertexAttrib3dvARB GLEW_GET_FUN(__glewVertexAttrib3dvARB) -#define glVertexAttrib3fARB GLEW_GET_FUN(__glewVertexAttrib3fARB) -#define glVertexAttrib3fvARB GLEW_GET_FUN(__glewVertexAttrib3fvARB) -#define glVertexAttrib3sARB GLEW_GET_FUN(__glewVertexAttrib3sARB) -#define glVertexAttrib3svARB GLEW_GET_FUN(__glewVertexAttrib3svARB) -#define glVertexAttrib4NbvARB GLEW_GET_FUN(__glewVertexAttrib4NbvARB) -#define glVertexAttrib4NivARB GLEW_GET_FUN(__glewVertexAttrib4NivARB) -#define glVertexAttrib4NsvARB GLEW_GET_FUN(__glewVertexAttrib4NsvARB) -#define glVertexAttrib4NubARB GLEW_GET_FUN(__glewVertexAttrib4NubARB) -#define glVertexAttrib4NubvARB GLEW_GET_FUN(__glewVertexAttrib4NubvARB) -#define glVertexAttrib4NuivARB GLEW_GET_FUN(__glewVertexAttrib4NuivARB) -#define glVertexAttrib4NusvARB GLEW_GET_FUN(__glewVertexAttrib4NusvARB) -#define glVertexAttrib4bvARB GLEW_GET_FUN(__glewVertexAttrib4bvARB) -#define glVertexAttrib4dARB GLEW_GET_FUN(__glewVertexAttrib4dARB) -#define glVertexAttrib4dvARB GLEW_GET_FUN(__glewVertexAttrib4dvARB) -#define glVertexAttrib4fARB GLEW_GET_FUN(__glewVertexAttrib4fARB) -#define glVertexAttrib4fvARB GLEW_GET_FUN(__glewVertexAttrib4fvARB) -#define glVertexAttrib4ivARB GLEW_GET_FUN(__glewVertexAttrib4ivARB) -#define glVertexAttrib4sARB GLEW_GET_FUN(__glewVertexAttrib4sARB) -#define glVertexAttrib4svARB GLEW_GET_FUN(__glewVertexAttrib4svARB) -#define glVertexAttrib4ubvARB GLEW_GET_FUN(__glewVertexAttrib4ubvARB) -#define glVertexAttrib4uivARB GLEW_GET_FUN(__glewVertexAttrib4uivARB) -#define glVertexAttrib4usvARB GLEW_GET_FUN(__glewVertexAttrib4usvARB) -#define glVertexAttribPointerARB GLEW_GET_FUN(__glewVertexAttribPointerARB) - -#define GLEW_ARB_vertex_program GLEW_GET_VAR(__GLEW_ARB_vertex_program) - -#endif /* GL_ARB_vertex_program */ - -/* -------------------------- GL_ARB_vertex_shader ------------------------- */ - -#ifndef GL_ARB_vertex_shader -#define GL_ARB_vertex_shader 1 - -#define GL_VERTEX_SHADER_ARB 0x8B31 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A -#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D -#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 -#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A - -typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB* name); -typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); -typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); - -#define glBindAttribLocationARB GLEW_GET_FUN(__glewBindAttribLocationARB) -#define glGetActiveAttribARB GLEW_GET_FUN(__glewGetActiveAttribARB) -#define glGetAttribLocationARB GLEW_GET_FUN(__glewGetAttribLocationARB) - -#define GLEW_ARB_vertex_shader GLEW_GET_VAR(__GLEW_ARB_vertex_shader) - -#endif /* GL_ARB_vertex_shader */ - -/* ------------------- GL_ARB_vertex_type_10f_11f_11f_rev ------------------ */ - -#ifndef GL_ARB_vertex_type_10f_11f_11f_rev -#define GL_ARB_vertex_type_10f_11f_11f_rev 1 - -#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B - -#define GLEW_ARB_vertex_type_10f_11f_11f_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_10f_11f_11f_rev) - -#endif /* GL_ARB_vertex_type_10f_11f_11f_rev */ - -/* ------------------- GL_ARB_vertex_type_2_10_10_10_rev ------------------- */ - -#ifndef GL_ARB_vertex_type_2_10_10_10_rev -#define GL_ARB_vertex_type_2_10_10_10_rev 1 - -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#define GL_INT_2_10_10_10_REV 0x8D9F - -typedef void (GLAPIENTRY * PFNGLCOLORP3UIPROC) (GLenum type, GLuint color); -typedef void (GLAPIENTRY * PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint* color); -typedef void (GLAPIENTRY * PFNGLCOLORP4UIPROC) (GLenum type, GLuint color); -typedef void (GLAPIENTRY * PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint* color); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); -typedef void (GLAPIENTRY * PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords); -typedef void (GLAPIENTRY * PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint* coords); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint* color); -typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords); -typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint* coords); -typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords); -typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint* coords); -typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords); -typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint* coords); -typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords); -typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint* coords); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value); -typedef void (GLAPIENTRY * PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value); -typedef void (GLAPIENTRY * PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value); -typedef void (GLAPIENTRY * PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint* value); - -#define glColorP3ui GLEW_GET_FUN(__glewColorP3ui) -#define glColorP3uiv GLEW_GET_FUN(__glewColorP3uiv) -#define glColorP4ui GLEW_GET_FUN(__glewColorP4ui) -#define glColorP4uiv GLEW_GET_FUN(__glewColorP4uiv) -#define glMultiTexCoordP1ui GLEW_GET_FUN(__glewMultiTexCoordP1ui) -#define glMultiTexCoordP1uiv GLEW_GET_FUN(__glewMultiTexCoordP1uiv) -#define glMultiTexCoordP2ui GLEW_GET_FUN(__glewMultiTexCoordP2ui) -#define glMultiTexCoordP2uiv GLEW_GET_FUN(__glewMultiTexCoordP2uiv) -#define glMultiTexCoordP3ui GLEW_GET_FUN(__glewMultiTexCoordP3ui) -#define glMultiTexCoordP3uiv GLEW_GET_FUN(__glewMultiTexCoordP3uiv) -#define glMultiTexCoordP4ui GLEW_GET_FUN(__glewMultiTexCoordP4ui) -#define glMultiTexCoordP4uiv GLEW_GET_FUN(__glewMultiTexCoordP4uiv) -#define glNormalP3ui GLEW_GET_FUN(__glewNormalP3ui) -#define glNormalP3uiv GLEW_GET_FUN(__glewNormalP3uiv) -#define glSecondaryColorP3ui GLEW_GET_FUN(__glewSecondaryColorP3ui) -#define glSecondaryColorP3uiv GLEW_GET_FUN(__glewSecondaryColorP3uiv) -#define glTexCoordP1ui GLEW_GET_FUN(__glewTexCoordP1ui) -#define glTexCoordP1uiv GLEW_GET_FUN(__glewTexCoordP1uiv) -#define glTexCoordP2ui GLEW_GET_FUN(__glewTexCoordP2ui) -#define glTexCoordP2uiv GLEW_GET_FUN(__glewTexCoordP2uiv) -#define glTexCoordP3ui GLEW_GET_FUN(__glewTexCoordP3ui) -#define glTexCoordP3uiv GLEW_GET_FUN(__glewTexCoordP3uiv) -#define glTexCoordP4ui GLEW_GET_FUN(__glewTexCoordP4ui) -#define glTexCoordP4uiv GLEW_GET_FUN(__glewTexCoordP4uiv) -#define glVertexAttribP1ui GLEW_GET_FUN(__glewVertexAttribP1ui) -#define glVertexAttribP1uiv GLEW_GET_FUN(__glewVertexAttribP1uiv) -#define glVertexAttribP2ui GLEW_GET_FUN(__glewVertexAttribP2ui) -#define glVertexAttribP2uiv GLEW_GET_FUN(__glewVertexAttribP2uiv) -#define glVertexAttribP3ui GLEW_GET_FUN(__glewVertexAttribP3ui) -#define glVertexAttribP3uiv GLEW_GET_FUN(__glewVertexAttribP3uiv) -#define glVertexAttribP4ui GLEW_GET_FUN(__glewVertexAttribP4ui) -#define glVertexAttribP4uiv GLEW_GET_FUN(__glewVertexAttribP4uiv) -#define glVertexP2ui GLEW_GET_FUN(__glewVertexP2ui) -#define glVertexP2uiv GLEW_GET_FUN(__glewVertexP2uiv) -#define glVertexP3ui GLEW_GET_FUN(__glewVertexP3ui) -#define glVertexP3uiv GLEW_GET_FUN(__glewVertexP3uiv) -#define glVertexP4ui GLEW_GET_FUN(__glewVertexP4ui) -#define glVertexP4uiv GLEW_GET_FUN(__glewVertexP4uiv) - -#define GLEW_ARB_vertex_type_2_10_10_10_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_2_10_10_10_rev) - -#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ - -/* ------------------------- GL_ARB_viewport_array ------------------------- */ - -#ifndef GL_ARB_viewport_array -#define GL_ARB_viewport_array 1 - -#define GL_DEPTH_RANGE 0x0B70 -#define GL_VIEWPORT 0x0BA2 -#define GL_SCISSOR_BOX 0x0C10 -#define GL_SCISSOR_TEST 0x0C11 -#define GL_MAX_VIEWPORTS 0x825B -#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C -#define GL_VIEWPORT_BOUNDS_RANGE 0x825D -#define GL_LAYER_PROVOKING_VERTEX 0x825E -#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F -#define GL_UNDEFINED_VERTEX 0x8260 -#define GL_FIRST_VERTEX_CONVENTION 0x8E4D -#define GL_LAST_VERTEX_CONVENTION 0x8E4E -#define GL_PROVOKING_VERTEX 0x8E4F - -typedef void (GLAPIENTRY * PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLclampd * v); -typedef void (GLAPIENTRY * PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLclampd n, GLclampd f); -typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble* data); -typedef void (GLAPIENTRY * PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat* data); -typedef void (GLAPIENTRY * PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint * v); -typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint * v); -typedef void (GLAPIENTRY * PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat * v); -typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); -typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat * v); - -#define glDepthRangeArrayv GLEW_GET_FUN(__glewDepthRangeArrayv) -#define glDepthRangeIndexed GLEW_GET_FUN(__glewDepthRangeIndexed) -#define glGetDoublei_v GLEW_GET_FUN(__glewGetDoublei_v) -#define glGetFloati_v GLEW_GET_FUN(__glewGetFloati_v) -#define glScissorArrayv GLEW_GET_FUN(__glewScissorArrayv) -#define glScissorIndexed GLEW_GET_FUN(__glewScissorIndexed) -#define glScissorIndexedv GLEW_GET_FUN(__glewScissorIndexedv) -#define glViewportArrayv GLEW_GET_FUN(__glewViewportArrayv) -#define glViewportIndexedf GLEW_GET_FUN(__glewViewportIndexedf) -#define glViewportIndexedfv GLEW_GET_FUN(__glewViewportIndexedfv) - -#define GLEW_ARB_viewport_array GLEW_GET_VAR(__GLEW_ARB_viewport_array) - -#endif /* GL_ARB_viewport_array */ - -/* --------------------------- GL_ARB_window_pos --------------------------- */ - -#ifndef GL_ARB_window_pos -#define GL_ARB_window_pos 1 - -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVARBPROC) (const GLdouble* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVARBPROC) (const GLfloat* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVARBPROC) (const GLint* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVARBPROC) (const GLshort* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVARBPROC) (const GLdouble* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVARBPROC) (const GLfloat* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVARBPROC) (const GLint* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVARBPROC) (const GLshort* p); - -#define glWindowPos2dARB GLEW_GET_FUN(__glewWindowPos2dARB) -#define glWindowPos2dvARB GLEW_GET_FUN(__glewWindowPos2dvARB) -#define glWindowPos2fARB GLEW_GET_FUN(__glewWindowPos2fARB) -#define glWindowPos2fvARB GLEW_GET_FUN(__glewWindowPos2fvARB) -#define glWindowPos2iARB GLEW_GET_FUN(__glewWindowPos2iARB) -#define glWindowPos2ivARB GLEW_GET_FUN(__glewWindowPos2ivARB) -#define glWindowPos2sARB GLEW_GET_FUN(__glewWindowPos2sARB) -#define glWindowPos2svARB GLEW_GET_FUN(__glewWindowPos2svARB) -#define glWindowPos3dARB GLEW_GET_FUN(__glewWindowPos3dARB) -#define glWindowPos3dvARB GLEW_GET_FUN(__glewWindowPos3dvARB) -#define glWindowPos3fARB GLEW_GET_FUN(__glewWindowPos3fARB) -#define glWindowPos3fvARB GLEW_GET_FUN(__glewWindowPos3fvARB) -#define glWindowPos3iARB GLEW_GET_FUN(__glewWindowPos3iARB) -#define glWindowPos3ivARB GLEW_GET_FUN(__glewWindowPos3ivARB) -#define glWindowPos3sARB GLEW_GET_FUN(__glewWindowPos3sARB) -#define glWindowPos3svARB GLEW_GET_FUN(__glewWindowPos3svARB) - -#define GLEW_ARB_window_pos GLEW_GET_VAR(__GLEW_ARB_window_pos) - -#endif /* GL_ARB_window_pos */ - -/* ------------------------- GL_ATIX_point_sprites ------------------------- */ - -#ifndef GL_ATIX_point_sprites -#define GL_ATIX_point_sprites 1 - -#define GL_TEXTURE_POINT_MODE_ATIX 0x60B0 -#define GL_TEXTURE_POINT_ONE_COORD_ATIX 0x60B1 -#define GL_TEXTURE_POINT_SPRITE_ATIX 0x60B2 -#define GL_POINT_SPRITE_CULL_MODE_ATIX 0x60B3 -#define GL_POINT_SPRITE_CULL_CENTER_ATIX 0x60B4 -#define GL_POINT_SPRITE_CULL_CLIP_ATIX 0x60B5 - -#define GLEW_ATIX_point_sprites GLEW_GET_VAR(__GLEW_ATIX_point_sprites) - -#endif /* GL_ATIX_point_sprites */ - -/* ---------------------- GL_ATIX_texture_env_combine3 --------------------- */ - -#ifndef GL_ATIX_texture_env_combine3 -#define GL_ATIX_texture_env_combine3 1 - -#define GL_MODULATE_ADD_ATIX 0x8744 -#define GL_MODULATE_SIGNED_ADD_ATIX 0x8745 -#define GL_MODULATE_SUBTRACT_ATIX 0x8746 - -#define GLEW_ATIX_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATIX_texture_env_combine3) - -#endif /* GL_ATIX_texture_env_combine3 */ - -/* ----------------------- GL_ATIX_texture_env_route ----------------------- */ - -#ifndef GL_ATIX_texture_env_route -#define GL_ATIX_texture_env_route 1 - -#define GL_SECONDARY_COLOR_ATIX 0x8747 -#define GL_TEXTURE_OUTPUT_RGB_ATIX 0x8748 -#define GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749 - -#define GLEW_ATIX_texture_env_route GLEW_GET_VAR(__GLEW_ATIX_texture_env_route) - -#endif /* GL_ATIX_texture_env_route */ - -/* ---------------- GL_ATIX_vertex_shader_output_point_size ---------------- */ - -#ifndef GL_ATIX_vertex_shader_output_point_size -#define GL_ATIX_vertex_shader_output_point_size 1 - -#define GL_OUTPUT_POINT_SIZE_ATIX 0x610E - -#define GLEW_ATIX_vertex_shader_output_point_size GLEW_GET_VAR(__GLEW_ATIX_vertex_shader_output_point_size) - -#endif /* GL_ATIX_vertex_shader_output_point_size */ - -/* -------------------------- GL_ATI_draw_buffers -------------------------- */ - -#ifndef GL_ATI_draw_buffers -#define GL_ATI_draw_buffers 1 - -#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 -#define GL_DRAW_BUFFER0_ATI 0x8825 -#define GL_DRAW_BUFFER1_ATI 0x8826 -#define GL_DRAW_BUFFER2_ATI 0x8827 -#define GL_DRAW_BUFFER3_ATI 0x8828 -#define GL_DRAW_BUFFER4_ATI 0x8829 -#define GL_DRAW_BUFFER5_ATI 0x882A -#define GL_DRAW_BUFFER6_ATI 0x882B -#define GL_DRAW_BUFFER7_ATI 0x882C -#define GL_DRAW_BUFFER8_ATI 0x882D -#define GL_DRAW_BUFFER9_ATI 0x882E -#define GL_DRAW_BUFFER10_ATI 0x882F -#define GL_DRAW_BUFFER11_ATI 0x8830 -#define GL_DRAW_BUFFER12_ATI 0x8831 -#define GL_DRAW_BUFFER13_ATI 0x8832 -#define GL_DRAW_BUFFER14_ATI 0x8833 -#define GL_DRAW_BUFFER15_ATI 0x8834 - -typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum* bufs); - -#define glDrawBuffersATI GLEW_GET_FUN(__glewDrawBuffersATI) - -#define GLEW_ATI_draw_buffers GLEW_GET_VAR(__GLEW_ATI_draw_buffers) - -#endif /* GL_ATI_draw_buffers */ - -/* -------------------------- GL_ATI_element_array ------------------------- */ - -#ifndef GL_ATI_element_array -#define GL_ATI_element_array 1 - -#define GL_ELEMENT_ARRAY_ATI 0x8768 -#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 -#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A - -typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); -typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); -typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERATIPROC) (GLenum type, const void *pointer); - -#define glDrawElementArrayATI GLEW_GET_FUN(__glewDrawElementArrayATI) -#define glDrawRangeElementArrayATI GLEW_GET_FUN(__glewDrawRangeElementArrayATI) -#define glElementPointerATI GLEW_GET_FUN(__glewElementPointerATI) - -#define GLEW_ATI_element_array GLEW_GET_VAR(__GLEW_ATI_element_array) - -#endif /* GL_ATI_element_array */ - -/* ------------------------- GL_ATI_envmap_bumpmap ------------------------- */ - -#ifndef GL_ATI_envmap_bumpmap -#define GL_ATI_envmap_bumpmap 1 - -#define GL_BUMP_ROT_MATRIX_ATI 0x8775 -#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 -#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 -#define GL_BUMP_TEX_UNITS_ATI 0x8778 -#define GL_DUDV_ATI 0x8779 -#define GL_DU8DV8_ATI 0x877A -#define GL_BUMP_ENVMAP_ATI 0x877B -#define GL_BUMP_TARGET_ATI 0x877C - -typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); -typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); -typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); -typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); - -#define glGetTexBumpParameterfvATI GLEW_GET_FUN(__glewGetTexBumpParameterfvATI) -#define glGetTexBumpParameterivATI GLEW_GET_FUN(__glewGetTexBumpParameterivATI) -#define glTexBumpParameterfvATI GLEW_GET_FUN(__glewTexBumpParameterfvATI) -#define glTexBumpParameterivATI GLEW_GET_FUN(__glewTexBumpParameterivATI) - -#define GLEW_ATI_envmap_bumpmap GLEW_GET_VAR(__GLEW_ATI_envmap_bumpmap) - -#endif /* GL_ATI_envmap_bumpmap */ - -/* ------------------------- GL_ATI_fragment_shader ------------------------ */ - -#ifndef GL_ATI_fragment_shader -#define GL_ATI_fragment_shader 1 - -#define GL_2X_BIT_ATI 0x00000001 -#define GL_RED_BIT_ATI 0x00000001 -#define GL_4X_BIT_ATI 0x00000002 -#define GL_COMP_BIT_ATI 0x00000002 -#define GL_GREEN_BIT_ATI 0x00000002 -#define GL_8X_BIT_ATI 0x00000004 -#define GL_BLUE_BIT_ATI 0x00000004 -#define GL_NEGATE_BIT_ATI 0x00000004 -#define GL_BIAS_BIT_ATI 0x00000008 -#define GL_HALF_BIT_ATI 0x00000008 -#define GL_QUARTER_BIT_ATI 0x00000010 -#define GL_EIGHTH_BIT_ATI 0x00000020 -#define GL_SATURATE_BIT_ATI 0x00000040 -#define GL_FRAGMENT_SHADER_ATI 0x8920 -#define GL_REG_0_ATI 0x8921 -#define GL_REG_1_ATI 0x8922 -#define GL_REG_2_ATI 0x8923 -#define GL_REG_3_ATI 0x8924 -#define GL_REG_4_ATI 0x8925 -#define GL_REG_5_ATI 0x8926 -#define GL_CON_0_ATI 0x8941 -#define GL_CON_1_ATI 0x8942 -#define GL_CON_2_ATI 0x8943 -#define GL_CON_3_ATI 0x8944 -#define GL_CON_4_ATI 0x8945 -#define GL_CON_5_ATI 0x8946 -#define GL_CON_6_ATI 0x8947 -#define GL_CON_7_ATI 0x8948 -#define GL_MOV_ATI 0x8961 -#define GL_ADD_ATI 0x8963 -#define GL_MUL_ATI 0x8964 -#define GL_SUB_ATI 0x8965 -#define GL_DOT3_ATI 0x8966 -#define GL_DOT4_ATI 0x8967 -#define GL_MAD_ATI 0x8968 -#define GL_LERP_ATI 0x8969 -#define GL_CND_ATI 0x896A -#define GL_CND0_ATI 0x896B -#define GL_DOT2_ADD_ATI 0x896C -#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D -#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E -#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F -#define GL_NUM_PASSES_ATI 0x8970 -#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 -#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 -#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 -#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 -#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 -#define GL_SWIZZLE_STR_ATI 0x8976 -#define GL_SWIZZLE_STQ_ATI 0x8977 -#define GL_SWIZZLE_STR_DR_ATI 0x8978 -#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 -#define GL_SWIZZLE_STRQ_ATI 0x897A -#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B - -typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -typedef void (GLAPIENTRY * PFNGLBEGINFRAGMENTSHADERATIPROC) (void); -typedef void (GLAPIENTRY * PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -typedef void (GLAPIENTRY * PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (GLAPIENTRY * PFNGLENDFRAGMENTSHADERATIPROC) (void); -typedef GLuint (GLAPIENTRY * PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); -typedef void (GLAPIENTRY * PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); -typedef void (GLAPIENTRY * PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); -typedef void (GLAPIENTRY * PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat* value); - -#define glAlphaFragmentOp1ATI GLEW_GET_FUN(__glewAlphaFragmentOp1ATI) -#define glAlphaFragmentOp2ATI GLEW_GET_FUN(__glewAlphaFragmentOp2ATI) -#define glAlphaFragmentOp3ATI GLEW_GET_FUN(__glewAlphaFragmentOp3ATI) -#define glBeginFragmentShaderATI GLEW_GET_FUN(__glewBeginFragmentShaderATI) -#define glBindFragmentShaderATI GLEW_GET_FUN(__glewBindFragmentShaderATI) -#define glColorFragmentOp1ATI GLEW_GET_FUN(__glewColorFragmentOp1ATI) -#define glColorFragmentOp2ATI GLEW_GET_FUN(__glewColorFragmentOp2ATI) -#define glColorFragmentOp3ATI GLEW_GET_FUN(__glewColorFragmentOp3ATI) -#define glDeleteFragmentShaderATI GLEW_GET_FUN(__glewDeleteFragmentShaderATI) -#define glEndFragmentShaderATI GLEW_GET_FUN(__glewEndFragmentShaderATI) -#define glGenFragmentShadersATI GLEW_GET_FUN(__glewGenFragmentShadersATI) -#define glPassTexCoordATI GLEW_GET_FUN(__glewPassTexCoordATI) -#define glSampleMapATI GLEW_GET_FUN(__glewSampleMapATI) -#define glSetFragmentShaderConstantATI GLEW_GET_FUN(__glewSetFragmentShaderConstantATI) - -#define GLEW_ATI_fragment_shader GLEW_GET_VAR(__GLEW_ATI_fragment_shader) - -#endif /* GL_ATI_fragment_shader */ - -/* ------------------------ GL_ATI_map_object_buffer ----------------------- */ - -#ifndef GL_ATI_map_object_buffer -#define GL_ATI_map_object_buffer 1 - -typedef void * (GLAPIENTRY * PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (GLAPIENTRY * PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); - -#define glMapObjectBufferATI GLEW_GET_FUN(__glewMapObjectBufferATI) -#define glUnmapObjectBufferATI GLEW_GET_FUN(__glewUnmapObjectBufferATI) - -#define GLEW_ATI_map_object_buffer GLEW_GET_VAR(__GLEW_ATI_map_object_buffer) - -#endif /* GL_ATI_map_object_buffer */ - -/* ----------------------------- GL_ATI_meminfo ---------------------------- */ - -#ifndef GL_ATI_meminfo -#define GL_ATI_meminfo 1 - -#define GL_VBO_FREE_MEMORY_ATI 0x87FB -#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC -#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD - -#define GLEW_ATI_meminfo GLEW_GET_VAR(__GLEW_ATI_meminfo) - -#endif /* GL_ATI_meminfo */ - -/* -------------------------- GL_ATI_pn_triangles -------------------------- */ - -#ifndef GL_ATI_pn_triangles -#define GL_ATI_pn_triangles 1 - -#define GL_PN_TRIANGLES_ATI 0x87F0 -#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 -#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 -#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 -#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 -#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 -#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 -#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 -#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 - -typedef void (GLAPIENTRY * PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); - -#define glPNTrianglesfATI GLEW_GET_FUN(__glewPNTrianglesfATI) -#define glPNTrianglesiATI GLEW_GET_FUN(__glewPNTrianglesiATI) - -#define GLEW_ATI_pn_triangles GLEW_GET_VAR(__GLEW_ATI_pn_triangles) - -#endif /* GL_ATI_pn_triangles */ - -/* ------------------------ GL_ATI_separate_stencil ------------------------ */ - -#ifndef GL_ATI_separate_stencil -#define GL_ATI_separate_stencil 1 - -#define GL_STENCIL_BACK_FUNC_ATI 0x8800 -#define GL_STENCIL_BACK_FAIL_ATI 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 - -typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); - -#define glStencilFuncSeparateATI GLEW_GET_FUN(__glewStencilFuncSeparateATI) -#define glStencilOpSeparateATI GLEW_GET_FUN(__glewStencilOpSeparateATI) - -#define GLEW_ATI_separate_stencil GLEW_GET_VAR(__GLEW_ATI_separate_stencil) - -#endif /* GL_ATI_separate_stencil */ - -/* ----------------------- GL_ATI_shader_texture_lod ----------------------- */ - -#ifndef GL_ATI_shader_texture_lod -#define GL_ATI_shader_texture_lod 1 - -#define GLEW_ATI_shader_texture_lod GLEW_GET_VAR(__GLEW_ATI_shader_texture_lod) - -#endif /* GL_ATI_shader_texture_lod */ - -/* ---------------------- GL_ATI_text_fragment_shader ---------------------- */ - -#ifndef GL_ATI_text_fragment_shader -#define GL_ATI_text_fragment_shader 1 - -#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 - -#define GLEW_ATI_text_fragment_shader GLEW_GET_VAR(__GLEW_ATI_text_fragment_shader) - -#endif /* GL_ATI_text_fragment_shader */ - -/* --------------------- GL_ATI_texture_compression_3dc -------------------- */ - -#ifndef GL_ATI_texture_compression_3dc -#define GL_ATI_texture_compression_3dc 1 - -#define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837 - -#define GLEW_ATI_texture_compression_3dc GLEW_GET_VAR(__GLEW_ATI_texture_compression_3dc) - -#endif /* GL_ATI_texture_compression_3dc */ - -/* ---------------------- GL_ATI_texture_env_combine3 ---------------------- */ - -#ifndef GL_ATI_texture_env_combine3 -#define GL_ATI_texture_env_combine3 1 - -#define GL_MODULATE_ADD_ATI 0x8744 -#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 -#define GL_MODULATE_SUBTRACT_ATI 0x8746 - -#define GLEW_ATI_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATI_texture_env_combine3) - -#endif /* GL_ATI_texture_env_combine3 */ - -/* -------------------------- GL_ATI_texture_float ------------------------- */ - -#ifndef GL_ATI_texture_float -#define GL_ATI_texture_float 1 - -#define GL_RGBA_FLOAT32_ATI 0x8814 -#define GL_RGB_FLOAT32_ATI 0x8815 -#define GL_ALPHA_FLOAT32_ATI 0x8816 -#define GL_INTENSITY_FLOAT32_ATI 0x8817 -#define GL_LUMINANCE_FLOAT32_ATI 0x8818 -#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 -#define GL_RGBA_FLOAT16_ATI 0x881A -#define GL_RGB_FLOAT16_ATI 0x881B -#define GL_ALPHA_FLOAT16_ATI 0x881C -#define GL_INTENSITY_FLOAT16_ATI 0x881D -#define GL_LUMINANCE_FLOAT16_ATI 0x881E -#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F - -#define GLEW_ATI_texture_float GLEW_GET_VAR(__GLEW_ATI_texture_float) - -#endif /* GL_ATI_texture_float */ - -/* ----------------------- GL_ATI_texture_mirror_once ---------------------- */ - -#ifndef GL_ATI_texture_mirror_once -#define GL_ATI_texture_mirror_once 1 - -#define GL_MIRROR_CLAMP_ATI 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 - -#define GLEW_ATI_texture_mirror_once GLEW_GET_VAR(__GLEW_ATI_texture_mirror_once) - -#endif /* GL_ATI_texture_mirror_once */ - -/* ----------------------- GL_ATI_vertex_array_object ---------------------- */ - -#ifndef GL_ATI_vertex_array_object -#define GL_ATI_vertex_array_object 1 - -#define GL_STATIC_ATI 0x8760 -#define GL_DYNAMIC_ATI 0x8761 -#define GL_PRESERVE_ATI 0x8762 -#define GL_DISCARD_ATI 0x8763 -#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 -#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 -#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 -#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 - -typedef void (GLAPIENTRY * PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (GLAPIENTRY * PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint* params); -typedef GLboolean (GLAPIENTRY * PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); -typedef GLuint (GLAPIENTRY * PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const void *pointer, GLenum usage); -typedef void (GLAPIENTRY * PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const void *pointer, GLenum preserve); -typedef void (GLAPIENTRY * PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); - -#define glArrayObjectATI GLEW_GET_FUN(__glewArrayObjectATI) -#define glFreeObjectBufferATI GLEW_GET_FUN(__glewFreeObjectBufferATI) -#define glGetArrayObjectfvATI GLEW_GET_FUN(__glewGetArrayObjectfvATI) -#define glGetArrayObjectivATI GLEW_GET_FUN(__glewGetArrayObjectivATI) -#define glGetObjectBufferfvATI GLEW_GET_FUN(__glewGetObjectBufferfvATI) -#define glGetObjectBufferivATI GLEW_GET_FUN(__glewGetObjectBufferivATI) -#define glGetVariantArrayObjectfvATI GLEW_GET_FUN(__glewGetVariantArrayObjectfvATI) -#define glGetVariantArrayObjectivATI GLEW_GET_FUN(__glewGetVariantArrayObjectivATI) -#define glIsObjectBufferATI GLEW_GET_FUN(__glewIsObjectBufferATI) -#define glNewObjectBufferATI GLEW_GET_FUN(__glewNewObjectBufferATI) -#define glUpdateObjectBufferATI GLEW_GET_FUN(__glewUpdateObjectBufferATI) -#define glVariantArrayObjectATI GLEW_GET_FUN(__glewVariantArrayObjectATI) - -#define GLEW_ATI_vertex_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_array_object) - -#endif /* GL_ATI_vertex_array_object */ - -/* ------------------- GL_ATI_vertex_attrib_array_object ------------------- */ - -#ifndef GL_ATI_vertex_attrib_array_object -#define GL_ATI_vertex_attrib_array_object 1 - -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); - -#define glGetVertexAttribArrayObjectfvATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectfvATI) -#define glGetVertexAttribArrayObjectivATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectivATI) -#define glVertexAttribArrayObjectATI GLEW_GET_FUN(__glewVertexAttribArrayObjectATI) - -#define GLEW_ATI_vertex_attrib_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_attrib_array_object) - -#endif /* GL_ATI_vertex_attrib_array_object */ - -/* ------------------------- GL_ATI_vertex_streams ------------------------- */ - -#ifndef GL_ATI_vertex_streams -#define GL_ATI_vertex_streams 1 - -#define GL_MAX_VERTEX_STREAMS_ATI 0x876B -#define GL_VERTEX_SOURCE_ATI 0x876C -#define GL_VERTEX_STREAM0_ATI 0x876D -#define GL_VERTEX_STREAM1_ATI 0x876E -#define GL_VERTEX_STREAM2_ATI 0x876F -#define GL_VERTEX_STREAM3_ATI 0x8770 -#define GL_VERTEX_STREAM4_ATI 0x8771 -#define GL_VERTEX_STREAM5_ATI 0x8772 -#define GL_VERTEX_STREAM6_ATI 0x8773 -#define GL_VERTEX_STREAM7_ATI 0x8774 - -typedef void (GLAPIENTRY * PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); -typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte x, GLbyte y, GLbyte z); -typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); -typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); -typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); -typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); - -#define glClientActiveVertexStreamATI GLEW_GET_FUN(__glewClientActiveVertexStreamATI) -#define glNormalStream3bATI GLEW_GET_FUN(__glewNormalStream3bATI) -#define glNormalStream3bvATI GLEW_GET_FUN(__glewNormalStream3bvATI) -#define glNormalStream3dATI GLEW_GET_FUN(__glewNormalStream3dATI) -#define glNormalStream3dvATI GLEW_GET_FUN(__glewNormalStream3dvATI) -#define glNormalStream3fATI GLEW_GET_FUN(__glewNormalStream3fATI) -#define glNormalStream3fvATI GLEW_GET_FUN(__glewNormalStream3fvATI) -#define glNormalStream3iATI GLEW_GET_FUN(__glewNormalStream3iATI) -#define glNormalStream3ivATI GLEW_GET_FUN(__glewNormalStream3ivATI) -#define glNormalStream3sATI GLEW_GET_FUN(__glewNormalStream3sATI) -#define glNormalStream3svATI GLEW_GET_FUN(__glewNormalStream3svATI) -#define glVertexBlendEnvfATI GLEW_GET_FUN(__glewVertexBlendEnvfATI) -#define glVertexBlendEnviATI GLEW_GET_FUN(__glewVertexBlendEnviATI) -#define glVertexStream1dATI GLEW_GET_FUN(__glewVertexStream1dATI) -#define glVertexStream1dvATI GLEW_GET_FUN(__glewVertexStream1dvATI) -#define glVertexStream1fATI GLEW_GET_FUN(__glewVertexStream1fATI) -#define glVertexStream1fvATI GLEW_GET_FUN(__glewVertexStream1fvATI) -#define glVertexStream1iATI GLEW_GET_FUN(__glewVertexStream1iATI) -#define glVertexStream1ivATI GLEW_GET_FUN(__glewVertexStream1ivATI) -#define glVertexStream1sATI GLEW_GET_FUN(__glewVertexStream1sATI) -#define glVertexStream1svATI GLEW_GET_FUN(__glewVertexStream1svATI) -#define glVertexStream2dATI GLEW_GET_FUN(__glewVertexStream2dATI) -#define glVertexStream2dvATI GLEW_GET_FUN(__glewVertexStream2dvATI) -#define glVertexStream2fATI GLEW_GET_FUN(__glewVertexStream2fATI) -#define glVertexStream2fvATI GLEW_GET_FUN(__glewVertexStream2fvATI) -#define glVertexStream2iATI GLEW_GET_FUN(__glewVertexStream2iATI) -#define glVertexStream2ivATI GLEW_GET_FUN(__glewVertexStream2ivATI) -#define glVertexStream2sATI GLEW_GET_FUN(__glewVertexStream2sATI) -#define glVertexStream2svATI GLEW_GET_FUN(__glewVertexStream2svATI) -#define glVertexStream3dATI GLEW_GET_FUN(__glewVertexStream3dATI) -#define glVertexStream3dvATI GLEW_GET_FUN(__glewVertexStream3dvATI) -#define glVertexStream3fATI GLEW_GET_FUN(__glewVertexStream3fATI) -#define glVertexStream3fvATI GLEW_GET_FUN(__glewVertexStream3fvATI) -#define glVertexStream3iATI GLEW_GET_FUN(__glewVertexStream3iATI) -#define glVertexStream3ivATI GLEW_GET_FUN(__glewVertexStream3ivATI) -#define glVertexStream3sATI GLEW_GET_FUN(__glewVertexStream3sATI) -#define glVertexStream3svATI GLEW_GET_FUN(__glewVertexStream3svATI) -#define glVertexStream4dATI GLEW_GET_FUN(__glewVertexStream4dATI) -#define glVertexStream4dvATI GLEW_GET_FUN(__glewVertexStream4dvATI) -#define glVertexStream4fATI GLEW_GET_FUN(__glewVertexStream4fATI) -#define glVertexStream4fvATI GLEW_GET_FUN(__glewVertexStream4fvATI) -#define glVertexStream4iATI GLEW_GET_FUN(__glewVertexStream4iATI) -#define glVertexStream4ivATI GLEW_GET_FUN(__glewVertexStream4ivATI) -#define glVertexStream4sATI GLEW_GET_FUN(__glewVertexStream4sATI) -#define glVertexStream4svATI GLEW_GET_FUN(__glewVertexStream4svATI) - -#define GLEW_ATI_vertex_streams GLEW_GET_VAR(__GLEW_ATI_vertex_streams) - -#endif /* GL_ATI_vertex_streams */ - -/* --------------------------- GL_EXT_422_pixels --------------------------- */ - -#ifndef GL_EXT_422_pixels -#define GL_EXT_422_pixels 1 - -#define GL_422_EXT 0x80CC -#define GL_422_REV_EXT 0x80CD -#define GL_422_AVERAGE_EXT 0x80CE -#define GL_422_REV_AVERAGE_EXT 0x80CF - -#define GLEW_EXT_422_pixels GLEW_GET_VAR(__GLEW_EXT_422_pixels) - -#endif /* GL_EXT_422_pixels */ - -/* ---------------------------- GL_EXT_Cg_shader --------------------------- */ - -#ifndef GL_EXT_Cg_shader -#define GL_EXT_Cg_shader 1 - -#define GL_CG_VERTEX_SHADER_EXT 0x890E -#define GL_CG_FRAGMENT_SHADER_EXT 0x890F - -#define GLEW_EXT_Cg_shader GLEW_GET_VAR(__GLEW_EXT_Cg_shader) - -#endif /* GL_EXT_Cg_shader */ - -/* ------------------------------ GL_EXT_abgr ------------------------------ */ - -#ifndef GL_EXT_abgr -#define GL_EXT_abgr 1 - -#define GL_ABGR_EXT 0x8000 - -#define GLEW_EXT_abgr GLEW_GET_VAR(__GLEW_EXT_abgr) - -#endif /* GL_EXT_abgr */ - -/* ------------------------------ GL_EXT_bgra ------------------------------ */ - -#ifndef GL_EXT_bgra -#define GL_EXT_bgra 1 - -#define GL_BGR_EXT 0x80E0 -#define GL_BGRA_EXT 0x80E1 - -#define GLEW_EXT_bgra GLEW_GET_VAR(__GLEW_EXT_bgra) - -#endif /* GL_EXT_bgra */ - -/* ------------------------ GL_EXT_bindable_uniform ------------------------ */ - -#ifndef GL_EXT_bindable_uniform -#define GL_EXT_bindable_uniform 1 - -#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 -#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 -#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 -#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED -#define GL_UNIFORM_BUFFER_EXT 0x8DEE -#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF - -typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); -typedef GLintptr (GLAPIENTRY * PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); -typedef void (GLAPIENTRY * PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); - -#define glGetUniformBufferSizeEXT GLEW_GET_FUN(__glewGetUniformBufferSizeEXT) -#define glGetUniformOffsetEXT GLEW_GET_FUN(__glewGetUniformOffsetEXT) -#define glUniformBufferEXT GLEW_GET_FUN(__glewUniformBufferEXT) - -#define GLEW_EXT_bindable_uniform GLEW_GET_VAR(__GLEW_EXT_bindable_uniform) - -#endif /* GL_EXT_bindable_uniform */ - -/* --------------------------- GL_EXT_blend_color -------------------------- */ - -#ifndef GL_EXT_blend_color -#define GL_EXT_blend_color 1 - -#define GL_CONSTANT_COLOR_EXT 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 -#define GL_CONSTANT_ALPHA_EXT 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 -#define GL_BLEND_COLOR_EXT 0x8005 - -typedef void (GLAPIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); - -#define glBlendColorEXT GLEW_GET_FUN(__glewBlendColorEXT) - -#define GLEW_EXT_blend_color GLEW_GET_VAR(__GLEW_EXT_blend_color) - -#endif /* GL_EXT_blend_color */ - -/* --------------------- GL_EXT_blend_equation_separate -------------------- */ - -#ifndef GL_EXT_blend_equation_separate -#define GL_EXT_blend_equation_separate 1 - -#define GL_BLEND_EQUATION_RGB_EXT 0x8009 -#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D - -typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); - -#define glBlendEquationSeparateEXT GLEW_GET_FUN(__glewBlendEquationSeparateEXT) - -#define GLEW_EXT_blend_equation_separate GLEW_GET_VAR(__GLEW_EXT_blend_equation_separate) - -#endif /* GL_EXT_blend_equation_separate */ - -/* ----------------------- GL_EXT_blend_func_separate ---------------------- */ - -#ifndef GL_EXT_blend_func_separate -#define GL_EXT_blend_func_separate 1 - -#define GL_BLEND_DST_RGB_EXT 0x80C8 -#define GL_BLEND_SRC_RGB_EXT 0x80C9 -#define GL_BLEND_DST_ALPHA_EXT 0x80CA -#define GL_BLEND_SRC_ALPHA_EXT 0x80CB - -typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); - -#define glBlendFuncSeparateEXT GLEW_GET_FUN(__glewBlendFuncSeparateEXT) - -#define GLEW_EXT_blend_func_separate GLEW_GET_VAR(__GLEW_EXT_blend_func_separate) - -#endif /* GL_EXT_blend_func_separate */ - -/* ------------------------- GL_EXT_blend_logic_op ------------------------- */ - -#ifndef GL_EXT_blend_logic_op -#define GL_EXT_blend_logic_op 1 - -#define GLEW_EXT_blend_logic_op GLEW_GET_VAR(__GLEW_EXT_blend_logic_op) - -#endif /* GL_EXT_blend_logic_op */ - -/* -------------------------- GL_EXT_blend_minmax -------------------------- */ - -#ifndef GL_EXT_blend_minmax -#define GL_EXT_blend_minmax 1 - -#define GL_FUNC_ADD_EXT 0x8006 -#define GL_MIN_EXT 0x8007 -#define GL_MAX_EXT 0x8008 -#define GL_BLEND_EQUATION_EXT 0x8009 - -typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); - -#define glBlendEquationEXT GLEW_GET_FUN(__glewBlendEquationEXT) - -#define GLEW_EXT_blend_minmax GLEW_GET_VAR(__GLEW_EXT_blend_minmax) - -#endif /* GL_EXT_blend_minmax */ - -/* ------------------------- GL_EXT_blend_subtract ------------------------- */ - -#ifndef GL_EXT_blend_subtract -#define GL_EXT_blend_subtract 1 - -#define GL_FUNC_SUBTRACT_EXT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B - -#define GLEW_EXT_blend_subtract GLEW_GET_VAR(__GLEW_EXT_blend_subtract) - -#endif /* GL_EXT_blend_subtract */ - -/* ------------------------ GL_EXT_clip_volume_hint ------------------------ */ - -#ifndef GL_EXT_clip_volume_hint -#define GL_EXT_clip_volume_hint 1 - -#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 - -#define GLEW_EXT_clip_volume_hint GLEW_GET_VAR(__GLEW_EXT_clip_volume_hint) - -#endif /* GL_EXT_clip_volume_hint */ - -/* ------------------------------ GL_EXT_cmyka ----------------------------- */ - -#ifndef GL_EXT_cmyka -#define GL_EXT_cmyka 1 - -#define GL_CMYK_EXT 0x800C -#define GL_CMYKA_EXT 0x800D -#define GL_PACK_CMYK_HINT_EXT 0x800E -#define GL_UNPACK_CMYK_HINT_EXT 0x800F - -#define GLEW_EXT_cmyka GLEW_GET_VAR(__GLEW_EXT_cmyka) - -#endif /* GL_EXT_cmyka */ - -/* ------------------------- GL_EXT_color_subtable ------------------------- */ - -#ifndef GL_EXT_color_subtable -#define GL_EXT_color_subtable 1 - -typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); -typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); - -#define glColorSubTableEXT GLEW_GET_FUN(__glewColorSubTableEXT) -#define glCopyColorSubTableEXT GLEW_GET_FUN(__glewCopyColorSubTableEXT) - -#define GLEW_EXT_color_subtable GLEW_GET_VAR(__GLEW_EXT_color_subtable) - -#endif /* GL_EXT_color_subtable */ - -/* ---------------------- GL_EXT_compiled_vertex_array --------------------- */ - -#ifndef GL_EXT_compiled_vertex_array -#define GL_EXT_compiled_vertex_array 1 - -#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 -#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 - -typedef void (GLAPIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); -typedef void (GLAPIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); - -#define glLockArraysEXT GLEW_GET_FUN(__glewLockArraysEXT) -#define glUnlockArraysEXT GLEW_GET_FUN(__glewUnlockArraysEXT) - -#define GLEW_EXT_compiled_vertex_array GLEW_GET_VAR(__GLEW_EXT_compiled_vertex_array) - -#endif /* GL_EXT_compiled_vertex_array */ - -/* --------------------------- GL_EXT_convolution -------------------------- */ - -#ifndef GL_EXT_convolution -#define GL_EXT_convolution 1 - -#define GL_CONVOLUTION_1D_EXT 0x8010 -#define GL_CONVOLUTION_2D_EXT 0x8011 -#define GL_SEPARABLE_2D_EXT 0x8012 -#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 -#define GL_REDUCE_EXT 0x8016 -#define GL_CONVOLUTION_FORMAT_EXT 0x8017 -#define GL_CONVOLUTION_WIDTH_EXT 0x8018 -#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 - -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *image); -typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); -typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); - -#define glConvolutionFilter1DEXT GLEW_GET_FUN(__glewConvolutionFilter1DEXT) -#define glConvolutionFilter2DEXT GLEW_GET_FUN(__glewConvolutionFilter2DEXT) -#define glConvolutionParameterfEXT GLEW_GET_FUN(__glewConvolutionParameterfEXT) -#define glConvolutionParameterfvEXT GLEW_GET_FUN(__glewConvolutionParameterfvEXT) -#define glConvolutionParameteriEXT GLEW_GET_FUN(__glewConvolutionParameteriEXT) -#define glConvolutionParameterivEXT GLEW_GET_FUN(__glewConvolutionParameterivEXT) -#define glCopyConvolutionFilter1DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter1DEXT) -#define glCopyConvolutionFilter2DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter2DEXT) -#define glGetConvolutionFilterEXT GLEW_GET_FUN(__glewGetConvolutionFilterEXT) -#define glGetConvolutionParameterfvEXT GLEW_GET_FUN(__glewGetConvolutionParameterfvEXT) -#define glGetConvolutionParameterivEXT GLEW_GET_FUN(__glewGetConvolutionParameterivEXT) -#define glGetSeparableFilterEXT GLEW_GET_FUN(__glewGetSeparableFilterEXT) -#define glSeparableFilter2DEXT GLEW_GET_FUN(__glewSeparableFilter2DEXT) - -#define GLEW_EXT_convolution GLEW_GET_VAR(__GLEW_EXT_convolution) - -#endif /* GL_EXT_convolution */ - -/* ------------------------ GL_EXT_coordinate_frame ------------------------ */ - -#ifndef GL_EXT_coordinate_frame -#define GL_EXT_coordinate_frame 1 - -#define GL_TANGENT_ARRAY_EXT 0x8439 -#define GL_BINORMAL_ARRAY_EXT 0x843A -#define GL_CURRENT_TANGENT_EXT 0x843B -#define GL_CURRENT_BINORMAL_EXT 0x843C -#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E -#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F -#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 -#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 -#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 -#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 -#define GL_MAP1_TANGENT_EXT 0x8444 -#define GL_MAP2_TANGENT_EXT 0x8445 -#define GL_MAP1_BINORMAL_EXT 0x8446 -#define GL_MAP2_BINORMAL_EXT 0x8447 - -typedef void (GLAPIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, void *pointer); -typedef void (GLAPIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, void *pointer); - -#define glBinormalPointerEXT GLEW_GET_FUN(__glewBinormalPointerEXT) -#define glTangentPointerEXT GLEW_GET_FUN(__glewTangentPointerEXT) - -#define GLEW_EXT_coordinate_frame GLEW_GET_VAR(__GLEW_EXT_coordinate_frame) - -#endif /* GL_EXT_coordinate_frame */ - -/* -------------------------- GL_EXT_copy_texture -------------------------- */ - -#ifndef GL_EXT_copy_texture -#define GL_EXT_copy_texture 1 - -typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); - -#define glCopyTexImage1DEXT GLEW_GET_FUN(__glewCopyTexImage1DEXT) -#define glCopyTexImage2DEXT GLEW_GET_FUN(__glewCopyTexImage2DEXT) -#define glCopyTexSubImage1DEXT GLEW_GET_FUN(__glewCopyTexSubImage1DEXT) -#define glCopyTexSubImage2DEXT GLEW_GET_FUN(__glewCopyTexSubImage2DEXT) -#define glCopyTexSubImage3DEXT GLEW_GET_FUN(__glewCopyTexSubImage3DEXT) - -#define GLEW_EXT_copy_texture GLEW_GET_VAR(__GLEW_EXT_copy_texture) - -#endif /* GL_EXT_copy_texture */ - -/* --------------------------- GL_EXT_cull_vertex -------------------------- */ - -#ifndef GL_EXT_cull_vertex -#define GL_EXT_cull_vertex 1 - -#define GL_CULL_VERTEX_EXT 0x81AA -#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB -#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC - -typedef void (GLAPIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat* params); - -#define glCullParameterdvEXT GLEW_GET_FUN(__glewCullParameterdvEXT) -#define glCullParameterfvEXT GLEW_GET_FUN(__glewCullParameterfvEXT) - -#define GLEW_EXT_cull_vertex GLEW_GET_VAR(__GLEW_EXT_cull_vertex) - -#endif /* GL_EXT_cull_vertex */ - -/* --------------------------- GL_EXT_debug_label -------------------------- */ - -#ifndef GL_EXT_debug_label -#define GL_EXT_debug_label 1 - -#define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F -#define GL_PROGRAM_OBJECT_EXT 0x8B40 -#define GL_SHADER_OBJECT_EXT 0x8B48 -#define GL_BUFFER_OBJECT_EXT 0x9151 -#define GL_QUERY_OBJECT_EXT 0x9153 -#define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 - -typedef void (GLAPIENTRY * PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei* length, GLchar *label); -typedef void (GLAPIENTRY * PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar* label); - -#define glGetObjectLabelEXT GLEW_GET_FUN(__glewGetObjectLabelEXT) -#define glLabelObjectEXT GLEW_GET_FUN(__glewLabelObjectEXT) - -#define GLEW_EXT_debug_label GLEW_GET_VAR(__GLEW_EXT_debug_label) - -#endif /* GL_EXT_debug_label */ - -/* -------------------------- GL_EXT_debug_marker -------------------------- */ - -#ifndef GL_EXT_debug_marker -#define GL_EXT_debug_marker 1 - -typedef void (GLAPIENTRY * PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar* marker); -typedef void (GLAPIENTRY * PFNGLPOPGROUPMARKEREXTPROC) (void); -typedef void (GLAPIENTRY * PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar* marker); - -#define glInsertEventMarkerEXT GLEW_GET_FUN(__glewInsertEventMarkerEXT) -#define glPopGroupMarkerEXT GLEW_GET_FUN(__glewPopGroupMarkerEXT) -#define glPushGroupMarkerEXT GLEW_GET_FUN(__glewPushGroupMarkerEXT) - -#define GLEW_EXT_debug_marker GLEW_GET_VAR(__GLEW_EXT_debug_marker) - -#endif /* GL_EXT_debug_marker */ - -/* ------------------------ GL_EXT_depth_bounds_test ----------------------- */ - -#ifndef GL_EXT_depth_bounds_test -#define GL_EXT_depth_bounds_test 1 - -#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 -#define GL_DEPTH_BOUNDS_EXT 0x8891 - -typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); - -#define glDepthBoundsEXT GLEW_GET_FUN(__glewDepthBoundsEXT) - -#define GLEW_EXT_depth_bounds_test GLEW_GET_VAR(__GLEW_EXT_depth_bounds_test) - -#endif /* GL_EXT_depth_bounds_test */ - -/* ----------------------- GL_EXT_direct_state_access ---------------------- */ - -#ifndef GL_EXT_direct_state_access -#define GL_EXT_direct_state_access 1 - -#define GL_PROGRAM_MATRIX_EXT 0x8E2D -#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E -#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F - -typedef void (GLAPIENTRY * PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); -typedef GLenum (GLAPIENTRY * PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); -typedef void (GLAPIENTRY * PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); -typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); -typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); -typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); -typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); -typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); -typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); -typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); -typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); -typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum* bufs); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); -typedef void (GLAPIENTRY * PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); -typedef void (GLAPIENTRY * PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); -typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, void *img); -typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, void *img); -typedef void (GLAPIENTRY * PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* param); -typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); -typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint* params); -typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void** params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); -typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint* params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, void *string); -typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, void** params); -typedef void (GLAPIENTRY * PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, void** params); -typedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); -typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint* params); -typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint* param); -typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERVEXTPROC) (GLuint vaobj, GLenum pname, GLint* param); -typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, void** param); -typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, void** param); -typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); -typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); -typedef void (GLAPIENTRY * PFNGLMATRIXFRUSTUMEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); -typedef void (GLAPIENTRY * PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum matrixMode); -typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); -typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); -typedef void (GLAPIENTRY * PFNGLMATRIXLOADDEXTPROC) (GLenum matrixMode, const GLdouble* m); -typedef void (GLAPIENTRY * PFNGLMATRIXLOADFEXTPROC) (GLenum matrixMode, const GLfloat* m); -typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); -typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); -typedef void (GLAPIENTRY * PFNGLMATRIXMULTDEXTPROC) (GLenum matrixMode, const GLdouble* m); -typedef void (GLAPIENTRY * PFNGLMATRIXMULTFEXTPROC) (GLenum matrixMode, const GLfloat* m); -typedef void (GLAPIENTRY * PFNGLMATRIXORTHOEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); -typedef void (GLAPIENTRY * PFNGLMATRIXPOPEXTPROC) (GLenum matrixMode); -typedef void (GLAPIENTRY * PFNGLMATRIXPUSHEXTPROC) (GLenum matrixMode); -typedef void (GLAPIENTRY * PFNGLMATRIXROTATEDEXTPROC) (GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLMATRIXROTATEFEXTPROC) (GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLMATRIXSCALEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLMATRIXSCALEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (GLAPIENTRY * PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); -typedef void (GLAPIENTRY * PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble* params); -typedef void (GLAPIENTRY * PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint* params); -typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* param); -typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* param); -typedef void (GLAPIENTRY * PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); -typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); -typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); -typedef void (GLAPIENTRY * PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); -typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); -typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); -typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble* params); -typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint* params); -typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint* params); -typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint* params); -typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint* params); -typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const void *string); -typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); -typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); -typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint* params); -typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat* param); -typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* param); -typedef void (GLAPIENTRY * PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); -typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); -typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYINDEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYNORMALOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC) (GLuint vaobj, GLuint index, GLuint divisor); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); - -#define glBindMultiTextureEXT GLEW_GET_FUN(__glewBindMultiTextureEXT) -#define glCheckNamedFramebufferStatusEXT GLEW_GET_FUN(__glewCheckNamedFramebufferStatusEXT) -#define glClientAttribDefaultEXT GLEW_GET_FUN(__glewClientAttribDefaultEXT) -#define glCompressedMultiTexImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage1DEXT) -#define glCompressedMultiTexImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage2DEXT) -#define glCompressedMultiTexImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage3DEXT) -#define glCompressedMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage1DEXT) -#define glCompressedMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage2DEXT) -#define glCompressedMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage3DEXT) -#define glCompressedTextureImage1DEXT GLEW_GET_FUN(__glewCompressedTextureImage1DEXT) -#define glCompressedTextureImage2DEXT GLEW_GET_FUN(__glewCompressedTextureImage2DEXT) -#define glCompressedTextureImage3DEXT GLEW_GET_FUN(__glewCompressedTextureImage3DEXT) -#define glCompressedTextureSubImage1DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage1DEXT) -#define glCompressedTextureSubImage2DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage2DEXT) -#define glCompressedTextureSubImage3DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage3DEXT) -#define glCopyMultiTexImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexImage1DEXT) -#define glCopyMultiTexImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexImage2DEXT) -#define glCopyMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage1DEXT) -#define glCopyMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage2DEXT) -#define glCopyMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage3DEXT) -#define glCopyTextureImage1DEXT GLEW_GET_FUN(__glewCopyTextureImage1DEXT) -#define glCopyTextureImage2DEXT GLEW_GET_FUN(__glewCopyTextureImage2DEXT) -#define glCopyTextureSubImage1DEXT GLEW_GET_FUN(__glewCopyTextureSubImage1DEXT) -#define glCopyTextureSubImage2DEXT GLEW_GET_FUN(__glewCopyTextureSubImage2DEXT) -#define glCopyTextureSubImage3DEXT GLEW_GET_FUN(__glewCopyTextureSubImage3DEXT) -#define glDisableClientStateIndexedEXT GLEW_GET_FUN(__glewDisableClientStateIndexedEXT) -#define glDisableClientStateiEXT GLEW_GET_FUN(__glewDisableClientStateiEXT) -#define glDisableVertexArrayAttribEXT GLEW_GET_FUN(__glewDisableVertexArrayAttribEXT) -#define glDisableVertexArrayEXT GLEW_GET_FUN(__glewDisableVertexArrayEXT) -#define glEnableClientStateIndexedEXT GLEW_GET_FUN(__glewEnableClientStateIndexedEXT) -#define glEnableClientStateiEXT GLEW_GET_FUN(__glewEnableClientStateiEXT) -#define glEnableVertexArrayAttribEXT GLEW_GET_FUN(__glewEnableVertexArrayAttribEXT) -#define glEnableVertexArrayEXT GLEW_GET_FUN(__glewEnableVertexArrayEXT) -#define glFlushMappedNamedBufferRangeEXT GLEW_GET_FUN(__glewFlushMappedNamedBufferRangeEXT) -#define glFramebufferDrawBufferEXT GLEW_GET_FUN(__glewFramebufferDrawBufferEXT) -#define glFramebufferDrawBuffersEXT GLEW_GET_FUN(__glewFramebufferDrawBuffersEXT) -#define glFramebufferReadBufferEXT GLEW_GET_FUN(__glewFramebufferReadBufferEXT) -#define glGenerateMultiTexMipmapEXT GLEW_GET_FUN(__glewGenerateMultiTexMipmapEXT) -#define glGenerateTextureMipmapEXT GLEW_GET_FUN(__glewGenerateTextureMipmapEXT) -#define glGetCompressedMultiTexImageEXT GLEW_GET_FUN(__glewGetCompressedMultiTexImageEXT) -#define glGetCompressedTextureImageEXT GLEW_GET_FUN(__glewGetCompressedTextureImageEXT) -#define glGetDoubleIndexedvEXT GLEW_GET_FUN(__glewGetDoubleIndexedvEXT) -#define glGetDoublei_vEXT GLEW_GET_FUN(__glewGetDoublei_vEXT) -#define glGetFloatIndexedvEXT GLEW_GET_FUN(__glewGetFloatIndexedvEXT) -#define glGetFloati_vEXT GLEW_GET_FUN(__glewGetFloati_vEXT) -#define glGetFramebufferParameterivEXT GLEW_GET_FUN(__glewGetFramebufferParameterivEXT) -#define glGetMultiTexEnvfvEXT GLEW_GET_FUN(__glewGetMultiTexEnvfvEXT) -#define glGetMultiTexEnvivEXT GLEW_GET_FUN(__glewGetMultiTexEnvivEXT) -#define glGetMultiTexGendvEXT GLEW_GET_FUN(__glewGetMultiTexGendvEXT) -#define glGetMultiTexGenfvEXT GLEW_GET_FUN(__glewGetMultiTexGenfvEXT) -#define glGetMultiTexGenivEXT GLEW_GET_FUN(__glewGetMultiTexGenivEXT) -#define glGetMultiTexImageEXT GLEW_GET_FUN(__glewGetMultiTexImageEXT) -#define glGetMultiTexLevelParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterfvEXT) -#define glGetMultiTexLevelParameterivEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterivEXT) -#define glGetMultiTexParameterIivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIivEXT) -#define glGetMultiTexParameterIuivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIuivEXT) -#define glGetMultiTexParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexParameterfvEXT) -#define glGetMultiTexParameterivEXT GLEW_GET_FUN(__glewGetMultiTexParameterivEXT) -#define glGetNamedBufferParameterivEXT GLEW_GET_FUN(__glewGetNamedBufferParameterivEXT) -#define glGetNamedBufferPointervEXT GLEW_GET_FUN(__glewGetNamedBufferPointervEXT) -#define glGetNamedBufferSubDataEXT GLEW_GET_FUN(__glewGetNamedBufferSubDataEXT) -#define glGetNamedFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferAttachmentParameterivEXT) -#define glGetNamedProgramLocalParameterIivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIivEXT) -#define glGetNamedProgramLocalParameterIuivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIuivEXT) -#define glGetNamedProgramLocalParameterdvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterdvEXT) -#define glGetNamedProgramLocalParameterfvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterfvEXT) -#define glGetNamedProgramStringEXT GLEW_GET_FUN(__glewGetNamedProgramStringEXT) -#define glGetNamedProgramivEXT GLEW_GET_FUN(__glewGetNamedProgramivEXT) -#define glGetNamedRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetNamedRenderbufferParameterivEXT) -#define glGetPointerIndexedvEXT GLEW_GET_FUN(__glewGetPointerIndexedvEXT) -#define glGetPointeri_vEXT GLEW_GET_FUN(__glewGetPointeri_vEXT) -#define glGetTextureImageEXT GLEW_GET_FUN(__glewGetTextureImageEXT) -#define glGetTextureLevelParameterfvEXT GLEW_GET_FUN(__glewGetTextureLevelParameterfvEXT) -#define glGetTextureLevelParameterivEXT GLEW_GET_FUN(__glewGetTextureLevelParameterivEXT) -#define glGetTextureParameterIivEXT GLEW_GET_FUN(__glewGetTextureParameterIivEXT) -#define glGetTextureParameterIuivEXT GLEW_GET_FUN(__glewGetTextureParameterIuivEXT) -#define glGetTextureParameterfvEXT GLEW_GET_FUN(__glewGetTextureParameterfvEXT) -#define glGetTextureParameterivEXT GLEW_GET_FUN(__glewGetTextureParameterivEXT) -#define glGetVertexArrayIntegeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayIntegeri_vEXT) -#define glGetVertexArrayIntegervEXT GLEW_GET_FUN(__glewGetVertexArrayIntegervEXT) -#define glGetVertexArrayPointeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayPointeri_vEXT) -#define glGetVertexArrayPointervEXT GLEW_GET_FUN(__glewGetVertexArrayPointervEXT) -#define glMapNamedBufferEXT GLEW_GET_FUN(__glewMapNamedBufferEXT) -#define glMapNamedBufferRangeEXT GLEW_GET_FUN(__glewMapNamedBufferRangeEXT) -#define glMatrixFrustumEXT GLEW_GET_FUN(__glewMatrixFrustumEXT) -#define glMatrixLoadIdentityEXT GLEW_GET_FUN(__glewMatrixLoadIdentityEXT) -#define glMatrixLoadTransposedEXT GLEW_GET_FUN(__glewMatrixLoadTransposedEXT) -#define glMatrixLoadTransposefEXT GLEW_GET_FUN(__glewMatrixLoadTransposefEXT) -#define glMatrixLoaddEXT GLEW_GET_FUN(__glewMatrixLoaddEXT) -#define glMatrixLoadfEXT GLEW_GET_FUN(__glewMatrixLoadfEXT) -#define glMatrixMultTransposedEXT GLEW_GET_FUN(__glewMatrixMultTransposedEXT) -#define glMatrixMultTransposefEXT GLEW_GET_FUN(__glewMatrixMultTransposefEXT) -#define glMatrixMultdEXT GLEW_GET_FUN(__glewMatrixMultdEXT) -#define glMatrixMultfEXT GLEW_GET_FUN(__glewMatrixMultfEXT) -#define glMatrixOrthoEXT GLEW_GET_FUN(__glewMatrixOrthoEXT) -#define glMatrixPopEXT GLEW_GET_FUN(__glewMatrixPopEXT) -#define glMatrixPushEXT GLEW_GET_FUN(__glewMatrixPushEXT) -#define glMatrixRotatedEXT GLEW_GET_FUN(__glewMatrixRotatedEXT) -#define glMatrixRotatefEXT GLEW_GET_FUN(__glewMatrixRotatefEXT) -#define glMatrixScaledEXT GLEW_GET_FUN(__glewMatrixScaledEXT) -#define glMatrixScalefEXT GLEW_GET_FUN(__glewMatrixScalefEXT) -#define glMatrixTranslatedEXT GLEW_GET_FUN(__glewMatrixTranslatedEXT) -#define glMatrixTranslatefEXT GLEW_GET_FUN(__glewMatrixTranslatefEXT) -#define glMultiTexBufferEXT GLEW_GET_FUN(__glewMultiTexBufferEXT) -#define glMultiTexCoordPointerEXT GLEW_GET_FUN(__glewMultiTexCoordPointerEXT) -#define glMultiTexEnvfEXT GLEW_GET_FUN(__glewMultiTexEnvfEXT) -#define glMultiTexEnvfvEXT GLEW_GET_FUN(__glewMultiTexEnvfvEXT) -#define glMultiTexEnviEXT GLEW_GET_FUN(__glewMultiTexEnviEXT) -#define glMultiTexEnvivEXT GLEW_GET_FUN(__glewMultiTexEnvivEXT) -#define glMultiTexGendEXT GLEW_GET_FUN(__glewMultiTexGendEXT) -#define glMultiTexGendvEXT GLEW_GET_FUN(__glewMultiTexGendvEXT) -#define glMultiTexGenfEXT GLEW_GET_FUN(__glewMultiTexGenfEXT) -#define glMultiTexGenfvEXT GLEW_GET_FUN(__glewMultiTexGenfvEXT) -#define glMultiTexGeniEXT GLEW_GET_FUN(__glewMultiTexGeniEXT) -#define glMultiTexGenivEXT GLEW_GET_FUN(__glewMultiTexGenivEXT) -#define glMultiTexImage1DEXT GLEW_GET_FUN(__glewMultiTexImage1DEXT) -#define glMultiTexImage2DEXT GLEW_GET_FUN(__glewMultiTexImage2DEXT) -#define glMultiTexImage3DEXT GLEW_GET_FUN(__glewMultiTexImage3DEXT) -#define glMultiTexParameterIivEXT GLEW_GET_FUN(__glewMultiTexParameterIivEXT) -#define glMultiTexParameterIuivEXT GLEW_GET_FUN(__glewMultiTexParameterIuivEXT) -#define glMultiTexParameterfEXT GLEW_GET_FUN(__glewMultiTexParameterfEXT) -#define glMultiTexParameterfvEXT GLEW_GET_FUN(__glewMultiTexParameterfvEXT) -#define glMultiTexParameteriEXT GLEW_GET_FUN(__glewMultiTexParameteriEXT) -#define glMultiTexParameterivEXT GLEW_GET_FUN(__glewMultiTexParameterivEXT) -#define glMultiTexRenderbufferEXT GLEW_GET_FUN(__glewMultiTexRenderbufferEXT) -#define glMultiTexSubImage1DEXT GLEW_GET_FUN(__glewMultiTexSubImage1DEXT) -#define glMultiTexSubImage2DEXT GLEW_GET_FUN(__glewMultiTexSubImage2DEXT) -#define glMultiTexSubImage3DEXT GLEW_GET_FUN(__glewMultiTexSubImage3DEXT) -#define glNamedBufferDataEXT GLEW_GET_FUN(__glewNamedBufferDataEXT) -#define glNamedBufferSubDataEXT GLEW_GET_FUN(__glewNamedBufferSubDataEXT) -#define glNamedCopyBufferSubDataEXT GLEW_GET_FUN(__glewNamedCopyBufferSubDataEXT) -#define glNamedFramebufferRenderbufferEXT GLEW_GET_FUN(__glewNamedFramebufferRenderbufferEXT) -#define glNamedFramebufferTexture1DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture1DEXT) -#define glNamedFramebufferTexture2DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture2DEXT) -#define glNamedFramebufferTexture3DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture3DEXT) -#define glNamedFramebufferTextureEXT GLEW_GET_FUN(__glewNamedFramebufferTextureEXT) -#define glNamedFramebufferTextureFaceEXT GLEW_GET_FUN(__glewNamedFramebufferTextureFaceEXT) -#define glNamedFramebufferTextureLayerEXT GLEW_GET_FUN(__glewNamedFramebufferTextureLayerEXT) -#define glNamedProgramLocalParameter4dEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dEXT) -#define glNamedProgramLocalParameter4dvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dvEXT) -#define glNamedProgramLocalParameter4fEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fEXT) -#define glNamedProgramLocalParameter4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fvEXT) -#define glNamedProgramLocalParameterI4iEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4iEXT) -#define glNamedProgramLocalParameterI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4ivEXT) -#define glNamedProgramLocalParameterI4uiEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uiEXT) -#define glNamedProgramLocalParameterI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uivEXT) -#define glNamedProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameters4fvEXT) -#define glNamedProgramLocalParametersI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4ivEXT) -#define glNamedProgramLocalParametersI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4uivEXT) -#define glNamedProgramStringEXT GLEW_GET_FUN(__glewNamedProgramStringEXT) -#define glNamedRenderbufferStorageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageEXT) -#define glNamedRenderbufferStorageMultisampleCoverageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleCoverageEXT) -#define glNamedRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleEXT) -#define glProgramUniform1fEXT GLEW_GET_FUN(__glewProgramUniform1fEXT) -#define glProgramUniform1fvEXT GLEW_GET_FUN(__glewProgramUniform1fvEXT) -#define glProgramUniform1iEXT GLEW_GET_FUN(__glewProgramUniform1iEXT) -#define glProgramUniform1ivEXT GLEW_GET_FUN(__glewProgramUniform1ivEXT) -#define glProgramUniform1uiEXT GLEW_GET_FUN(__glewProgramUniform1uiEXT) -#define glProgramUniform1uivEXT GLEW_GET_FUN(__glewProgramUniform1uivEXT) -#define glProgramUniform2fEXT GLEW_GET_FUN(__glewProgramUniform2fEXT) -#define glProgramUniform2fvEXT GLEW_GET_FUN(__glewProgramUniform2fvEXT) -#define glProgramUniform2iEXT GLEW_GET_FUN(__glewProgramUniform2iEXT) -#define glProgramUniform2ivEXT GLEW_GET_FUN(__glewProgramUniform2ivEXT) -#define glProgramUniform2uiEXT GLEW_GET_FUN(__glewProgramUniform2uiEXT) -#define glProgramUniform2uivEXT GLEW_GET_FUN(__glewProgramUniform2uivEXT) -#define glProgramUniform3fEXT GLEW_GET_FUN(__glewProgramUniform3fEXT) -#define glProgramUniform3fvEXT GLEW_GET_FUN(__glewProgramUniform3fvEXT) -#define glProgramUniform3iEXT GLEW_GET_FUN(__glewProgramUniform3iEXT) -#define glProgramUniform3ivEXT GLEW_GET_FUN(__glewProgramUniform3ivEXT) -#define glProgramUniform3uiEXT GLEW_GET_FUN(__glewProgramUniform3uiEXT) -#define glProgramUniform3uivEXT GLEW_GET_FUN(__glewProgramUniform3uivEXT) -#define glProgramUniform4fEXT GLEW_GET_FUN(__glewProgramUniform4fEXT) -#define glProgramUniform4fvEXT GLEW_GET_FUN(__glewProgramUniform4fvEXT) -#define glProgramUniform4iEXT GLEW_GET_FUN(__glewProgramUniform4iEXT) -#define glProgramUniform4ivEXT GLEW_GET_FUN(__glewProgramUniform4ivEXT) -#define glProgramUniform4uiEXT GLEW_GET_FUN(__glewProgramUniform4uiEXT) -#define glProgramUniform4uivEXT GLEW_GET_FUN(__glewProgramUniform4uivEXT) -#define glProgramUniformMatrix2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2fvEXT) -#define glProgramUniformMatrix2x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x3fvEXT) -#define glProgramUniformMatrix2x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x4fvEXT) -#define glProgramUniformMatrix3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3fvEXT) -#define glProgramUniformMatrix3x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x2fvEXT) -#define glProgramUniformMatrix3x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x4fvEXT) -#define glProgramUniformMatrix4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4fvEXT) -#define glProgramUniformMatrix4x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x2fvEXT) -#define glProgramUniformMatrix4x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x3fvEXT) -#define glPushClientAttribDefaultEXT GLEW_GET_FUN(__glewPushClientAttribDefaultEXT) -#define glTextureBufferEXT GLEW_GET_FUN(__glewTextureBufferEXT) -#define glTextureImage1DEXT GLEW_GET_FUN(__glewTextureImage1DEXT) -#define glTextureImage2DEXT GLEW_GET_FUN(__glewTextureImage2DEXT) -#define glTextureImage3DEXT GLEW_GET_FUN(__glewTextureImage3DEXT) -#define glTextureParameterIivEXT GLEW_GET_FUN(__glewTextureParameterIivEXT) -#define glTextureParameterIuivEXT GLEW_GET_FUN(__glewTextureParameterIuivEXT) -#define glTextureParameterfEXT GLEW_GET_FUN(__glewTextureParameterfEXT) -#define glTextureParameterfvEXT GLEW_GET_FUN(__glewTextureParameterfvEXT) -#define glTextureParameteriEXT GLEW_GET_FUN(__glewTextureParameteriEXT) -#define glTextureParameterivEXT GLEW_GET_FUN(__glewTextureParameterivEXT) -#define glTextureRenderbufferEXT GLEW_GET_FUN(__glewTextureRenderbufferEXT) -#define glTextureSubImage1DEXT GLEW_GET_FUN(__glewTextureSubImage1DEXT) -#define glTextureSubImage2DEXT GLEW_GET_FUN(__glewTextureSubImage2DEXT) -#define glTextureSubImage3DEXT GLEW_GET_FUN(__glewTextureSubImage3DEXT) -#define glUnmapNamedBufferEXT GLEW_GET_FUN(__glewUnmapNamedBufferEXT) -#define glVertexArrayColorOffsetEXT GLEW_GET_FUN(__glewVertexArrayColorOffsetEXT) -#define glVertexArrayEdgeFlagOffsetEXT GLEW_GET_FUN(__glewVertexArrayEdgeFlagOffsetEXT) -#define glVertexArrayFogCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayFogCoordOffsetEXT) -#define glVertexArrayIndexOffsetEXT GLEW_GET_FUN(__glewVertexArrayIndexOffsetEXT) -#define glVertexArrayMultiTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayMultiTexCoordOffsetEXT) -#define glVertexArrayNormalOffsetEXT GLEW_GET_FUN(__glewVertexArrayNormalOffsetEXT) -#define glVertexArraySecondaryColorOffsetEXT GLEW_GET_FUN(__glewVertexArraySecondaryColorOffsetEXT) -#define glVertexArrayTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayTexCoordOffsetEXT) -#define glVertexArrayVertexAttribDivisorEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribDivisorEXT) -#define glVertexArrayVertexAttribIOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribIOffsetEXT) -#define glVertexArrayVertexAttribOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribOffsetEXT) -#define glVertexArrayVertexOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexOffsetEXT) - -#define GLEW_EXT_direct_state_access GLEW_GET_VAR(__GLEW_EXT_direct_state_access) - -#endif /* GL_EXT_direct_state_access */ - -/* -------------------------- GL_EXT_draw_buffers2 ------------------------- */ - -#ifndef GL_EXT_draw_buffers2 -#define GL_EXT_draw_buffers2 1 - -typedef void (GLAPIENTRY * PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a); -typedef void (GLAPIENTRY * PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); -typedef void (GLAPIENTRY * PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); -typedef void (GLAPIENTRY * PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum value, GLuint index, GLboolean* data); -typedef void (GLAPIENTRY * PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum value, GLuint index, GLint* data); -typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); - -#define glColorMaskIndexedEXT GLEW_GET_FUN(__glewColorMaskIndexedEXT) -#define glDisableIndexedEXT GLEW_GET_FUN(__glewDisableIndexedEXT) -#define glEnableIndexedEXT GLEW_GET_FUN(__glewEnableIndexedEXT) -#define glGetBooleanIndexedvEXT GLEW_GET_FUN(__glewGetBooleanIndexedvEXT) -#define glGetIntegerIndexedvEXT GLEW_GET_FUN(__glewGetIntegerIndexedvEXT) -#define glIsEnabledIndexedEXT GLEW_GET_FUN(__glewIsEnabledIndexedEXT) - -#define GLEW_EXT_draw_buffers2 GLEW_GET_VAR(__GLEW_EXT_draw_buffers2) - -#endif /* GL_EXT_draw_buffers2 */ - -/* ------------------------- GL_EXT_draw_instanced ------------------------- */ - -#ifndef GL_EXT_draw_instanced -#define GL_EXT_draw_instanced 1 - -typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); -typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); - -#define glDrawArraysInstancedEXT GLEW_GET_FUN(__glewDrawArraysInstancedEXT) -#define glDrawElementsInstancedEXT GLEW_GET_FUN(__glewDrawElementsInstancedEXT) - -#define GLEW_EXT_draw_instanced GLEW_GET_VAR(__GLEW_EXT_draw_instanced) - -#endif /* GL_EXT_draw_instanced */ - -/* ----------------------- GL_EXT_draw_range_elements ---------------------- */ - -#ifndef GL_EXT_draw_range_elements -#define GL_EXT_draw_range_elements 1 - -#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 -#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 - -typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); - -#define glDrawRangeElementsEXT GLEW_GET_FUN(__glewDrawRangeElementsEXT) - -#define GLEW_EXT_draw_range_elements GLEW_GET_VAR(__GLEW_EXT_draw_range_elements) - -#endif /* GL_EXT_draw_range_elements */ - -/* ---------------------------- GL_EXT_fog_coord --------------------------- */ - -#ifndef GL_EXT_fog_coord -#define GL_EXT_fog_coord 1 - -#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 -#define GL_FOG_COORDINATE_EXT 0x8451 -#define GL_FRAGMENT_DEPTH_EXT 0x8452 -#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 -#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 - -typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); -typedef void (GLAPIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord); -typedef void (GLAPIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); -typedef void (GLAPIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord); -typedef void (GLAPIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); - -#define glFogCoordPointerEXT GLEW_GET_FUN(__glewFogCoordPointerEXT) -#define glFogCoorddEXT GLEW_GET_FUN(__glewFogCoorddEXT) -#define glFogCoorddvEXT GLEW_GET_FUN(__glewFogCoorddvEXT) -#define glFogCoordfEXT GLEW_GET_FUN(__glewFogCoordfEXT) -#define glFogCoordfvEXT GLEW_GET_FUN(__glewFogCoordfvEXT) - -#define GLEW_EXT_fog_coord GLEW_GET_VAR(__GLEW_EXT_fog_coord) - -#endif /* GL_EXT_fog_coord */ - -/* ------------------------ GL_EXT_fragment_lighting ----------------------- */ - -#ifndef GL_EXT_fragment_lighting -#define GL_EXT_fragment_lighting 1 - -#define GL_FRAGMENT_LIGHTING_EXT 0x8400 -#define GL_FRAGMENT_COLOR_MATERIAL_EXT 0x8401 -#define GL_FRAGMENT_COLOR_MATERIAL_FACE_EXT 0x8402 -#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_EXT 0x8403 -#define GL_MAX_FRAGMENT_LIGHTS_EXT 0x8404 -#define GL_MAX_ACTIVE_LIGHTS_EXT 0x8405 -#define GL_CURRENT_RASTER_NORMAL_EXT 0x8406 -#define GL_LIGHT_ENV_MODE_EXT 0x8407 -#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT 0x8408 -#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT 0x8409 -#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_EXT 0x840A -#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT 0x840B -#define GL_FRAGMENT_LIGHT0_EXT 0x840C -#define GL_FRAGMENT_LIGHT7_EXT 0x8413 - -typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALEXTPROC) (GLenum face, GLenum mode); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFEXTPROC) (GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVEXTPROC) (GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIEXTPROC) (GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVEXTPROC) (GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFEXTPROC) (GLenum light, GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIEXTPROC) (GLenum light, GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFEXTPROC) (GLenum face, GLenum pname, const GLfloat param); -typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIEXTPROC) (GLenum face, GLenum pname, const GLint param); -typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLLIGHTENVIEXTPROC) (GLenum pname, GLint param); - -#define glFragmentColorMaterialEXT GLEW_GET_FUN(__glewFragmentColorMaterialEXT) -#define glFragmentLightModelfEXT GLEW_GET_FUN(__glewFragmentLightModelfEXT) -#define glFragmentLightModelfvEXT GLEW_GET_FUN(__glewFragmentLightModelfvEXT) -#define glFragmentLightModeliEXT GLEW_GET_FUN(__glewFragmentLightModeliEXT) -#define glFragmentLightModelivEXT GLEW_GET_FUN(__glewFragmentLightModelivEXT) -#define glFragmentLightfEXT GLEW_GET_FUN(__glewFragmentLightfEXT) -#define glFragmentLightfvEXT GLEW_GET_FUN(__glewFragmentLightfvEXT) -#define glFragmentLightiEXT GLEW_GET_FUN(__glewFragmentLightiEXT) -#define glFragmentLightivEXT GLEW_GET_FUN(__glewFragmentLightivEXT) -#define glFragmentMaterialfEXT GLEW_GET_FUN(__glewFragmentMaterialfEXT) -#define glFragmentMaterialfvEXT GLEW_GET_FUN(__glewFragmentMaterialfvEXT) -#define glFragmentMaterialiEXT GLEW_GET_FUN(__glewFragmentMaterialiEXT) -#define glFragmentMaterialivEXT GLEW_GET_FUN(__glewFragmentMaterialivEXT) -#define glGetFragmentLightfvEXT GLEW_GET_FUN(__glewGetFragmentLightfvEXT) -#define glGetFragmentLightivEXT GLEW_GET_FUN(__glewGetFragmentLightivEXT) -#define glGetFragmentMaterialfvEXT GLEW_GET_FUN(__glewGetFragmentMaterialfvEXT) -#define glGetFragmentMaterialivEXT GLEW_GET_FUN(__glewGetFragmentMaterialivEXT) -#define glLightEnviEXT GLEW_GET_FUN(__glewLightEnviEXT) - -#define GLEW_EXT_fragment_lighting GLEW_GET_VAR(__GLEW_EXT_fragment_lighting) - -#endif /* GL_EXT_fragment_lighting */ - -/* ------------------------ GL_EXT_framebuffer_blit ------------------------ */ - -#ifndef GL_EXT_framebuffer_blit -#define GL_EXT_framebuffer_blit 1 - -#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 -#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 -#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 -#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA - -typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); - -#define glBlitFramebufferEXT GLEW_GET_FUN(__glewBlitFramebufferEXT) - -#define GLEW_EXT_framebuffer_blit GLEW_GET_VAR(__GLEW_EXT_framebuffer_blit) - -#endif /* GL_EXT_framebuffer_blit */ - -/* --------------------- GL_EXT_framebuffer_multisample -------------------- */ - -#ifndef GL_EXT_framebuffer_multisample -#define GL_EXT_framebuffer_multisample 1 - -#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB -#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 -#define GL_MAX_SAMPLES_EXT 0x8D57 - -typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); - -#define glRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewRenderbufferStorageMultisampleEXT) - -#define GLEW_EXT_framebuffer_multisample GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample) - -#endif /* GL_EXT_framebuffer_multisample */ - -/* --------------- GL_EXT_framebuffer_multisample_blit_scaled -------------- */ - -#ifndef GL_EXT_framebuffer_multisample_blit_scaled -#define GL_EXT_framebuffer_multisample_blit_scaled 1 - -#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA -#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB - -#define GLEW_EXT_framebuffer_multisample_blit_scaled GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample_blit_scaled) - -#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ - -/* ----------------------- GL_EXT_framebuffer_object ----------------------- */ - -#ifndef GL_EXT_framebuffer_object -#define GL_EXT_framebuffer_object 1 - -#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 -#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 -#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 -#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 -#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF -#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 -#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 -#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 -#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 -#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 -#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 -#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 -#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 -#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 -#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 -#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA -#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB -#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC -#define GL_COLOR_ATTACHMENT13_EXT 0x8CED -#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE -#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF -#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 -#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 -#define GL_FRAMEBUFFER_EXT 0x8D40 -#define GL_RENDERBUFFER_EXT 0x8D41 -#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 -#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 -#define GL_STENCIL_INDEX1_EXT 0x8D46 -#define GL_STENCIL_INDEX4_EXT 0x8D47 -#define GL_STENCIL_INDEX8_EXT 0x8D48 -#define GL_STENCIL_INDEX16_EXT 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 - -typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); -typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); -typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); -typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint* framebuffers); -typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint* renderbuffers); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint* framebuffers); -typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint* renderbuffers); -typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); -typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); -typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); -typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); -typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); - -#define glBindFramebufferEXT GLEW_GET_FUN(__glewBindFramebufferEXT) -#define glBindRenderbufferEXT GLEW_GET_FUN(__glewBindRenderbufferEXT) -#define glCheckFramebufferStatusEXT GLEW_GET_FUN(__glewCheckFramebufferStatusEXT) -#define glDeleteFramebuffersEXT GLEW_GET_FUN(__glewDeleteFramebuffersEXT) -#define glDeleteRenderbuffersEXT GLEW_GET_FUN(__glewDeleteRenderbuffersEXT) -#define glFramebufferRenderbufferEXT GLEW_GET_FUN(__glewFramebufferRenderbufferEXT) -#define glFramebufferTexture1DEXT GLEW_GET_FUN(__glewFramebufferTexture1DEXT) -#define glFramebufferTexture2DEXT GLEW_GET_FUN(__glewFramebufferTexture2DEXT) -#define glFramebufferTexture3DEXT GLEW_GET_FUN(__glewFramebufferTexture3DEXT) -#define glGenFramebuffersEXT GLEW_GET_FUN(__glewGenFramebuffersEXT) -#define glGenRenderbuffersEXT GLEW_GET_FUN(__glewGenRenderbuffersEXT) -#define glGenerateMipmapEXT GLEW_GET_FUN(__glewGenerateMipmapEXT) -#define glGetFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetFramebufferAttachmentParameterivEXT) -#define glGetRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetRenderbufferParameterivEXT) -#define glIsFramebufferEXT GLEW_GET_FUN(__glewIsFramebufferEXT) -#define glIsRenderbufferEXT GLEW_GET_FUN(__glewIsRenderbufferEXT) -#define glRenderbufferStorageEXT GLEW_GET_FUN(__glewRenderbufferStorageEXT) - -#define GLEW_EXT_framebuffer_object GLEW_GET_VAR(__GLEW_EXT_framebuffer_object) - -#endif /* GL_EXT_framebuffer_object */ - -/* ------------------------ GL_EXT_framebuffer_sRGB ------------------------ */ - -#ifndef GL_EXT_framebuffer_sRGB -#define GL_EXT_framebuffer_sRGB 1 - -#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 -#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA - -#define GLEW_EXT_framebuffer_sRGB GLEW_GET_VAR(__GLEW_EXT_framebuffer_sRGB) - -#endif /* GL_EXT_framebuffer_sRGB */ - -/* ------------------------ GL_EXT_geometry_shader4 ------------------------ */ - -#ifndef GL_EXT_geometry_shader4 -#define GL_EXT_geometry_shader4 1 - -#define GL_LINES_ADJACENCY_EXT 0xA -#define GL_LINE_STRIP_ADJACENCY_EXT 0xB -#define GL_TRIANGLES_ADJACENCY_EXT 0xC -#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD -#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 -#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B -#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 -#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 -#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 -#define GL_GEOMETRY_SHADER_EXT 0x8DD9 -#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA -#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB -#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC -#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD -#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE -#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF -#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 -#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 - -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); -typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); - -#define glFramebufferTextureEXT GLEW_GET_FUN(__glewFramebufferTextureEXT) -#define glFramebufferTextureFaceEXT GLEW_GET_FUN(__glewFramebufferTextureFaceEXT) -#define glProgramParameteriEXT GLEW_GET_FUN(__glewProgramParameteriEXT) - -#define GLEW_EXT_geometry_shader4 GLEW_GET_VAR(__GLEW_EXT_geometry_shader4) - -#endif /* GL_EXT_geometry_shader4 */ - -/* --------------------- GL_EXT_gpu_program_parameters --------------------- */ - -#ifndef GL_EXT_gpu_program_parameters -#define GL_EXT_gpu_program_parameters 1 - -typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); - -#define glProgramEnvParameters4fvEXT GLEW_GET_FUN(__glewProgramEnvParameters4fvEXT) -#define glProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewProgramLocalParameters4fvEXT) - -#define GLEW_EXT_gpu_program_parameters GLEW_GET_VAR(__GLEW_EXT_gpu_program_parameters) - -#endif /* GL_EXT_gpu_program_parameters */ - -/* --------------------------- GL_EXT_gpu_shader4 -------------------------- */ - -#ifndef GL_EXT_gpu_shader4 -#define GL_EXT_gpu_shader4 1 - -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD -#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 -#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 -#define GL_SAMPLER_BUFFER_EXT 0x8DC2 -#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 -#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 -#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 -#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 -#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 -#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 -#define GL_INT_SAMPLER_1D_EXT 0x8DC9 -#define GL_INT_SAMPLER_2D_EXT 0x8DCA -#define GL_INT_SAMPLER_3D_EXT 0x8DCB -#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC -#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD -#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE -#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF -#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 -#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 -#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 -#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 -#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 -#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 -#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 -#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 -#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 - -typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); -typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); -typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); -typedef void (GLAPIENTRY * PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); -typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (GLAPIENTRY * PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); -typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (GLAPIENTRY * PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); -typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (GLAPIENTRY * PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); -typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); - -#define glBindFragDataLocationEXT GLEW_GET_FUN(__glewBindFragDataLocationEXT) -#define glGetFragDataLocationEXT GLEW_GET_FUN(__glewGetFragDataLocationEXT) -#define glGetUniformuivEXT GLEW_GET_FUN(__glewGetUniformuivEXT) -#define glGetVertexAttribIivEXT GLEW_GET_FUN(__glewGetVertexAttribIivEXT) -#define glGetVertexAttribIuivEXT GLEW_GET_FUN(__glewGetVertexAttribIuivEXT) -#define glUniform1uiEXT GLEW_GET_FUN(__glewUniform1uiEXT) -#define glUniform1uivEXT GLEW_GET_FUN(__glewUniform1uivEXT) -#define glUniform2uiEXT GLEW_GET_FUN(__glewUniform2uiEXT) -#define glUniform2uivEXT GLEW_GET_FUN(__glewUniform2uivEXT) -#define glUniform3uiEXT GLEW_GET_FUN(__glewUniform3uiEXT) -#define glUniform3uivEXT GLEW_GET_FUN(__glewUniform3uivEXT) -#define glUniform4uiEXT GLEW_GET_FUN(__glewUniform4uiEXT) -#define glUniform4uivEXT GLEW_GET_FUN(__glewUniform4uivEXT) -#define glVertexAttribI1iEXT GLEW_GET_FUN(__glewVertexAttribI1iEXT) -#define glVertexAttribI1ivEXT GLEW_GET_FUN(__glewVertexAttribI1ivEXT) -#define glVertexAttribI1uiEXT GLEW_GET_FUN(__glewVertexAttribI1uiEXT) -#define glVertexAttribI1uivEXT GLEW_GET_FUN(__glewVertexAttribI1uivEXT) -#define glVertexAttribI2iEXT GLEW_GET_FUN(__glewVertexAttribI2iEXT) -#define glVertexAttribI2ivEXT GLEW_GET_FUN(__glewVertexAttribI2ivEXT) -#define glVertexAttribI2uiEXT GLEW_GET_FUN(__glewVertexAttribI2uiEXT) -#define glVertexAttribI2uivEXT GLEW_GET_FUN(__glewVertexAttribI2uivEXT) -#define glVertexAttribI3iEXT GLEW_GET_FUN(__glewVertexAttribI3iEXT) -#define glVertexAttribI3ivEXT GLEW_GET_FUN(__glewVertexAttribI3ivEXT) -#define glVertexAttribI3uiEXT GLEW_GET_FUN(__glewVertexAttribI3uiEXT) -#define glVertexAttribI3uivEXT GLEW_GET_FUN(__glewVertexAttribI3uivEXT) -#define glVertexAttribI4bvEXT GLEW_GET_FUN(__glewVertexAttribI4bvEXT) -#define glVertexAttribI4iEXT GLEW_GET_FUN(__glewVertexAttribI4iEXT) -#define glVertexAttribI4ivEXT GLEW_GET_FUN(__glewVertexAttribI4ivEXT) -#define glVertexAttribI4svEXT GLEW_GET_FUN(__glewVertexAttribI4svEXT) -#define glVertexAttribI4ubvEXT GLEW_GET_FUN(__glewVertexAttribI4ubvEXT) -#define glVertexAttribI4uiEXT GLEW_GET_FUN(__glewVertexAttribI4uiEXT) -#define glVertexAttribI4uivEXT GLEW_GET_FUN(__glewVertexAttribI4uivEXT) -#define glVertexAttribI4usvEXT GLEW_GET_FUN(__glewVertexAttribI4usvEXT) -#define glVertexAttribIPointerEXT GLEW_GET_FUN(__glewVertexAttribIPointerEXT) - -#define GLEW_EXT_gpu_shader4 GLEW_GET_VAR(__GLEW_EXT_gpu_shader4) - -#endif /* GL_EXT_gpu_shader4 */ - -/* ---------------------------- GL_EXT_histogram --------------------------- */ - -#ifndef GL_EXT_histogram -#define GL_EXT_histogram 1 - -#define GL_HISTOGRAM_EXT 0x8024 -#define GL_PROXY_HISTOGRAM_EXT 0x8025 -#define GL_HISTOGRAM_WIDTH_EXT 0x8026 -#define GL_HISTOGRAM_FORMAT_EXT 0x8027 -#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C -#define GL_HISTOGRAM_SINK_EXT 0x802D -#define GL_MINMAX_EXT 0x802E -#define GL_MINMAX_FORMAT_EXT 0x802F -#define GL_MINMAX_SINK_EXT 0x8030 - -typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); -typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (GLAPIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); -typedef void (GLAPIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target); - -#define glGetHistogramEXT GLEW_GET_FUN(__glewGetHistogramEXT) -#define glGetHistogramParameterfvEXT GLEW_GET_FUN(__glewGetHistogramParameterfvEXT) -#define glGetHistogramParameterivEXT GLEW_GET_FUN(__glewGetHistogramParameterivEXT) -#define glGetMinmaxEXT GLEW_GET_FUN(__glewGetMinmaxEXT) -#define glGetMinmaxParameterfvEXT GLEW_GET_FUN(__glewGetMinmaxParameterfvEXT) -#define glGetMinmaxParameterivEXT GLEW_GET_FUN(__glewGetMinmaxParameterivEXT) -#define glHistogramEXT GLEW_GET_FUN(__glewHistogramEXT) -#define glMinmaxEXT GLEW_GET_FUN(__glewMinmaxEXT) -#define glResetHistogramEXT GLEW_GET_FUN(__glewResetHistogramEXT) -#define glResetMinmaxEXT GLEW_GET_FUN(__glewResetMinmaxEXT) - -#define GLEW_EXT_histogram GLEW_GET_VAR(__GLEW_EXT_histogram) - -#endif /* GL_EXT_histogram */ - -/* ----------------------- GL_EXT_index_array_formats ---------------------- */ - -#ifndef GL_EXT_index_array_formats -#define GL_EXT_index_array_formats 1 - -#define GLEW_EXT_index_array_formats GLEW_GET_VAR(__GLEW_EXT_index_array_formats) - -#endif /* GL_EXT_index_array_formats */ - -/* --------------------------- GL_EXT_index_func --------------------------- */ - -#ifndef GL_EXT_index_func -#define GL_EXT_index_func 1 - -typedef void (GLAPIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLfloat ref); - -#define glIndexFuncEXT GLEW_GET_FUN(__glewIndexFuncEXT) - -#define GLEW_EXT_index_func GLEW_GET_VAR(__GLEW_EXT_index_func) - -#endif /* GL_EXT_index_func */ - -/* ------------------------- GL_EXT_index_material ------------------------- */ - -#ifndef GL_EXT_index_material -#define GL_EXT_index_material 1 - -typedef void (GLAPIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); - -#define glIndexMaterialEXT GLEW_GET_FUN(__glewIndexMaterialEXT) - -#define GLEW_EXT_index_material GLEW_GET_VAR(__GLEW_EXT_index_material) - -#endif /* GL_EXT_index_material */ - -/* -------------------------- GL_EXT_index_texture ------------------------- */ - -#ifndef GL_EXT_index_texture -#define GL_EXT_index_texture 1 - -#define GLEW_EXT_index_texture GLEW_GET_VAR(__GLEW_EXT_index_texture) - -#endif /* GL_EXT_index_texture */ - -/* -------------------------- GL_EXT_light_texture ------------------------- */ - -#ifndef GL_EXT_light_texture -#define GL_EXT_light_texture 1 - -#define GL_FRAGMENT_MATERIAL_EXT 0x8349 -#define GL_FRAGMENT_NORMAL_EXT 0x834A -#define GL_FRAGMENT_COLOR_EXT 0x834C -#define GL_ATTENUATION_EXT 0x834D -#define GL_SHADOW_ATTENUATION_EXT 0x834E -#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F -#define GL_TEXTURE_LIGHT_EXT 0x8350 -#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 -#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 - -typedef void (GLAPIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); -typedef void (GLAPIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); -typedef void (GLAPIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); - -#define glApplyTextureEXT GLEW_GET_FUN(__glewApplyTextureEXT) -#define glTextureLightEXT GLEW_GET_FUN(__glewTextureLightEXT) -#define glTextureMaterialEXT GLEW_GET_FUN(__glewTextureMaterialEXT) - -#define GLEW_EXT_light_texture GLEW_GET_VAR(__GLEW_EXT_light_texture) - -#endif /* GL_EXT_light_texture */ - -/* ------------------------- GL_EXT_misc_attribute ------------------------- */ - -#ifndef GL_EXT_misc_attribute -#define GL_EXT_misc_attribute 1 - -#define GLEW_EXT_misc_attribute GLEW_GET_VAR(__GLEW_EXT_misc_attribute) - -#endif /* GL_EXT_misc_attribute */ - -/* ------------------------ GL_EXT_multi_draw_arrays ----------------------- */ - -#ifndef GL_EXT_multi_draw_arrays -#define GL_EXT_multi_draw_arrays 1 - -typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); -typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, GLsizei* count, GLenum type, const void *const *indices, GLsizei primcount); - -#define glMultiDrawArraysEXT GLEW_GET_FUN(__glewMultiDrawArraysEXT) -#define glMultiDrawElementsEXT GLEW_GET_FUN(__glewMultiDrawElementsEXT) - -#define GLEW_EXT_multi_draw_arrays GLEW_GET_VAR(__GLEW_EXT_multi_draw_arrays) - -#endif /* GL_EXT_multi_draw_arrays */ - -/* --------------------------- GL_EXT_multisample -------------------------- */ - -#ifndef GL_EXT_multisample -#define GL_EXT_multisample 1 - -#define GL_MULTISAMPLE_EXT 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F -#define GL_SAMPLE_MASK_EXT 0x80A0 -#define GL_1PASS_EXT 0x80A1 -#define GL_2PASS_0_EXT 0x80A2 -#define GL_2PASS_1_EXT 0x80A3 -#define GL_4PASS_0_EXT 0x80A4 -#define GL_4PASS_1_EXT 0x80A5 -#define GL_4PASS_2_EXT 0x80A6 -#define GL_4PASS_3_EXT 0x80A7 -#define GL_SAMPLE_BUFFERS_EXT 0x80A8 -#define GL_SAMPLES_EXT 0x80A9 -#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA -#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB -#define GL_SAMPLE_PATTERN_EXT 0x80AC -#define GL_MULTISAMPLE_BIT_EXT 0x20000000 - -typedef void (GLAPIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); -typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); - -#define glSampleMaskEXT GLEW_GET_FUN(__glewSampleMaskEXT) -#define glSamplePatternEXT GLEW_GET_FUN(__glewSamplePatternEXT) - -#define GLEW_EXT_multisample GLEW_GET_VAR(__GLEW_EXT_multisample) - -#endif /* GL_EXT_multisample */ - -/* ---------------------- GL_EXT_packed_depth_stencil ---------------------- */ - -#ifndef GL_EXT_packed_depth_stencil -#define GL_EXT_packed_depth_stencil 1 - -#define GL_DEPTH_STENCIL_EXT 0x84F9 -#define GL_UNSIGNED_INT_24_8_EXT 0x84FA -#define GL_DEPTH24_STENCIL8_EXT 0x88F0 -#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 - -#define GLEW_EXT_packed_depth_stencil GLEW_GET_VAR(__GLEW_EXT_packed_depth_stencil) - -#endif /* GL_EXT_packed_depth_stencil */ - -/* -------------------------- GL_EXT_packed_float -------------------------- */ - -#ifndef GL_EXT_packed_float -#define GL_EXT_packed_float 1 - -#define GL_R11F_G11F_B10F_EXT 0x8C3A -#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B -#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C - -#define GLEW_EXT_packed_float GLEW_GET_VAR(__GLEW_EXT_packed_float) - -#endif /* GL_EXT_packed_float */ - -/* -------------------------- GL_EXT_packed_pixels ------------------------- */ - -#ifndef GL_EXT_packed_pixels -#define GL_EXT_packed_pixels 1 - -#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 - -#define GLEW_EXT_packed_pixels GLEW_GET_VAR(__GLEW_EXT_packed_pixels) - -#endif /* GL_EXT_packed_pixels */ - -/* ------------------------ GL_EXT_paletted_texture ------------------------ */ - -#ifndef GL_EXT_paletted_texture -#define GL_EXT_paletted_texture 1 - -#define GL_TEXTURE_1D 0x0DE0 -#define GL_TEXTURE_2D 0x0DE1 -#define GL_PROXY_TEXTURE_1D 0x8063 -#define GL_PROXY_TEXTURE_2D 0x8064 -#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 -#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF -#define GL_COLOR_INDEX1_EXT 0x80E2 -#define GL_COLOR_INDEX2_EXT 0x80E3 -#define GL_COLOR_INDEX4_EXT 0x80E4 -#define GL_COLOR_INDEX8_EXT 0x80E5 -#define GL_COLOR_INDEX12_EXT 0x80E6 -#define GL_COLOR_INDEX16_EXT 0x80E7 -#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED -#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 -#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B - -typedef void (GLAPIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void *data); -typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, void *data); -typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); - -#define glColorTableEXT GLEW_GET_FUN(__glewColorTableEXT) -#define glGetColorTableEXT GLEW_GET_FUN(__glewGetColorTableEXT) -#define glGetColorTableParameterfvEXT GLEW_GET_FUN(__glewGetColorTableParameterfvEXT) -#define glGetColorTableParameterivEXT GLEW_GET_FUN(__glewGetColorTableParameterivEXT) - -#define GLEW_EXT_paletted_texture GLEW_GET_VAR(__GLEW_EXT_paletted_texture) - -#endif /* GL_EXT_paletted_texture */ - -/* ----------------------- GL_EXT_pixel_buffer_object ---------------------- */ - -#ifndef GL_EXT_pixel_buffer_object -#define GL_EXT_pixel_buffer_object 1 - -#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF - -#define GLEW_EXT_pixel_buffer_object GLEW_GET_VAR(__GLEW_EXT_pixel_buffer_object) - -#endif /* GL_EXT_pixel_buffer_object */ - -/* ------------------------- GL_EXT_pixel_transform ------------------------ */ - -#ifndef GL_EXT_pixel_transform -#define GL_EXT_pixel_transform 1 - -#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 -#define GL_PIXEL_MAG_FILTER_EXT 0x8331 -#define GL_PIXEL_MIN_FILTER_EXT 0x8332 -#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 -#define GL_CUBIC_EXT 0x8334 -#define GL_AVERAGE_EXT 0x8335 -#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 -#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 -#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 - -typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, const GLfloat param); -typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, const GLint param); -typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); - -#define glGetPixelTransformParameterfvEXT GLEW_GET_FUN(__glewGetPixelTransformParameterfvEXT) -#define glGetPixelTransformParameterivEXT GLEW_GET_FUN(__glewGetPixelTransformParameterivEXT) -#define glPixelTransformParameterfEXT GLEW_GET_FUN(__glewPixelTransformParameterfEXT) -#define glPixelTransformParameterfvEXT GLEW_GET_FUN(__glewPixelTransformParameterfvEXT) -#define glPixelTransformParameteriEXT GLEW_GET_FUN(__glewPixelTransformParameteriEXT) -#define glPixelTransformParameterivEXT GLEW_GET_FUN(__glewPixelTransformParameterivEXT) - -#define GLEW_EXT_pixel_transform GLEW_GET_VAR(__GLEW_EXT_pixel_transform) - -#endif /* GL_EXT_pixel_transform */ - -/* ------------------- GL_EXT_pixel_transform_color_table ------------------ */ - -#ifndef GL_EXT_pixel_transform_color_table -#define GL_EXT_pixel_transform_color_table 1 - -#define GLEW_EXT_pixel_transform_color_table GLEW_GET_VAR(__GLEW_EXT_pixel_transform_color_table) - -#endif /* GL_EXT_pixel_transform_color_table */ - -/* ------------------------ GL_EXT_point_parameters ------------------------ */ - -#ifndef GL_EXT_point_parameters -#define GL_EXT_point_parameters 1 - -#define GL_POINT_SIZE_MIN_EXT 0x8126 -#define GL_POINT_SIZE_MAX_EXT 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 -#define GL_DISTANCE_ATTENUATION_EXT 0x8129 - -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat* params); - -#define glPointParameterfEXT GLEW_GET_FUN(__glewPointParameterfEXT) -#define glPointParameterfvEXT GLEW_GET_FUN(__glewPointParameterfvEXT) - -#define GLEW_EXT_point_parameters GLEW_GET_VAR(__GLEW_EXT_point_parameters) - -#endif /* GL_EXT_point_parameters */ - -/* ------------------------- GL_EXT_polygon_offset ------------------------- */ - -#ifndef GL_EXT_polygon_offset -#define GL_EXT_polygon_offset 1 - -#define GL_POLYGON_OFFSET_EXT 0x8037 -#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 -#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 - -typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); - -#define glPolygonOffsetEXT GLEW_GET_FUN(__glewPolygonOffsetEXT) - -#define GLEW_EXT_polygon_offset GLEW_GET_VAR(__GLEW_EXT_polygon_offset) - -#endif /* GL_EXT_polygon_offset */ - -/* ---------------------- GL_EXT_polygon_offset_clamp ---------------------- */ - -#ifndef GL_EXT_polygon_offset_clamp -#define GL_EXT_polygon_offset_clamp 1 - -#define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B - -typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETCLAMPEXTPROC) (GLfloat factor, GLfloat units, GLfloat clamp); - -#define glPolygonOffsetClampEXT GLEW_GET_FUN(__glewPolygonOffsetClampEXT) - -#define GLEW_EXT_polygon_offset_clamp GLEW_GET_VAR(__GLEW_EXT_polygon_offset_clamp) - -#endif /* GL_EXT_polygon_offset_clamp */ - -/* ----------------------- GL_EXT_post_depth_coverage ---------------------- */ - -#ifndef GL_EXT_post_depth_coverage -#define GL_EXT_post_depth_coverage 1 - -#define GLEW_EXT_post_depth_coverage GLEW_GET_VAR(__GLEW_EXT_post_depth_coverage) - -#endif /* GL_EXT_post_depth_coverage */ - -/* ------------------------ GL_EXT_provoking_vertex ------------------------ */ - -#ifndef GL_EXT_provoking_vertex -#define GL_EXT_provoking_vertex 1 - -#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C -#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D -#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E -#define GL_PROVOKING_VERTEX_EXT 0x8E4F - -typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); - -#define glProvokingVertexEXT GLEW_GET_FUN(__glewProvokingVertexEXT) - -#define GLEW_EXT_provoking_vertex GLEW_GET_VAR(__GLEW_EXT_provoking_vertex) - -#endif /* GL_EXT_provoking_vertex */ - -/* ----------------------- GL_EXT_raster_multisample ----------------------- */ - -#ifndef GL_EXT_raster_multisample -#define GL_EXT_raster_multisample 1 - -#define GL_COLOR_SAMPLES_NV 0x8E20 -#define GL_RASTER_MULTISAMPLE_EXT 0x9327 -#define GL_RASTER_SAMPLES_EXT 0x9328 -#define GL_MAX_RASTER_SAMPLES_EXT 0x9329 -#define GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A -#define GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B -#define GL_EFFECTIVE_RASTER_SAMPLES_EXT 0x932C -#define GL_DEPTH_SAMPLES_NV 0x932D -#define GL_STENCIL_SAMPLES_NV 0x932E -#define GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F -#define GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330 -#define GL_COVERAGE_MODULATION_TABLE_NV 0x9331 -#define GL_COVERAGE_MODULATION_NV 0x9332 -#define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 - -typedef void (GLAPIENTRY * PFNGLCOVERAGEMODULATIONNVPROC) (GLenum components); -typedef void (GLAPIENTRY * PFNGLCOVERAGEMODULATIONTABLENVPROC) (GLsizei n, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufsize, GLfloat* v); -typedef void (GLAPIENTRY * PFNGLRASTERSAMPLESEXTPROC) (GLuint samples, GLboolean fixedsamplelocations); - -#define glCoverageModulationNV GLEW_GET_FUN(__glewCoverageModulationNV) -#define glCoverageModulationTableNV GLEW_GET_FUN(__glewCoverageModulationTableNV) -#define glGetCoverageModulationTableNV GLEW_GET_FUN(__glewGetCoverageModulationTableNV) -#define glRasterSamplesEXT GLEW_GET_FUN(__glewRasterSamplesEXT) - -#define GLEW_EXT_raster_multisample GLEW_GET_VAR(__GLEW_EXT_raster_multisample) - -#endif /* GL_EXT_raster_multisample */ - -/* ------------------------- GL_EXT_rescale_normal ------------------------- */ - -#ifndef GL_EXT_rescale_normal -#define GL_EXT_rescale_normal 1 - -#define GL_RESCALE_NORMAL_EXT 0x803A - -#define GLEW_EXT_rescale_normal GLEW_GET_VAR(__GLEW_EXT_rescale_normal) - -#endif /* GL_EXT_rescale_normal */ - -/* -------------------------- GL_EXT_scene_marker -------------------------- */ - -#ifndef GL_EXT_scene_marker -#define GL_EXT_scene_marker 1 - -typedef void (GLAPIENTRY * PFNGLBEGINSCENEEXTPROC) (void); -typedef void (GLAPIENTRY * PFNGLENDSCENEEXTPROC) (void); - -#define glBeginSceneEXT GLEW_GET_FUN(__glewBeginSceneEXT) -#define glEndSceneEXT GLEW_GET_FUN(__glewEndSceneEXT) - -#define GLEW_EXT_scene_marker GLEW_GET_VAR(__GLEW_EXT_scene_marker) - -#endif /* GL_EXT_scene_marker */ - -/* ------------------------- GL_EXT_secondary_color ------------------------ */ - -#ifndef GL_EXT_secondary_color -#define GL_EXT_secondary_color 1 - -#define GL_COLOR_SUM_EXT 0x8458 -#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D -#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E - -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); - -#define glSecondaryColor3bEXT GLEW_GET_FUN(__glewSecondaryColor3bEXT) -#define glSecondaryColor3bvEXT GLEW_GET_FUN(__glewSecondaryColor3bvEXT) -#define glSecondaryColor3dEXT GLEW_GET_FUN(__glewSecondaryColor3dEXT) -#define glSecondaryColor3dvEXT GLEW_GET_FUN(__glewSecondaryColor3dvEXT) -#define glSecondaryColor3fEXT GLEW_GET_FUN(__glewSecondaryColor3fEXT) -#define glSecondaryColor3fvEXT GLEW_GET_FUN(__glewSecondaryColor3fvEXT) -#define glSecondaryColor3iEXT GLEW_GET_FUN(__glewSecondaryColor3iEXT) -#define glSecondaryColor3ivEXT GLEW_GET_FUN(__glewSecondaryColor3ivEXT) -#define glSecondaryColor3sEXT GLEW_GET_FUN(__glewSecondaryColor3sEXT) -#define glSecondaryColor3svEXT GLEW_GET_FUN(__glewSecondaryColor3svEXT) -#define glSecondaryColor3ubEXT GLEW_GET_FUN(__glewSecondaryColor3ubEXT) -#define glSecondaryColor3ubvEXT GLEW_GET_FUN(__glewSecondaryColor3ubvEXT) -#define glSecondaryColor3uiEXT GLEW_GET_FUN(__glewSecondaryColor3uiEXT) -#define glSecondaryColor3uivEXT GLEW_GET_FUN(__glewSecondaryColor3uivEXT) -#define glSecondaryColor3usEXT GLEW_GET_FUN(__glewSecondaryColor3usEXT) -#define glSecondaryColor3usvEXT GLEW_GET_FUN(__glewSecondaryColor3usvEXT) -#define glSecondaryColorPointerEXT GLEW_GET_FUN(__glewSecondaryColorPointerEXT) - -#define GLEW_EXT_secondary_color GLEW_GET_VAR(__GLEW_EXT_secondary_color) - -#endif /* GL_EXT_secondary_color */ - -/* --------------------- GL_EXT_separate_shader_objects -------------------- */ - -#ifndef GL_EXT_separate_shader_objects -#define GL_EXT_separate_shader_objects 1 - -#define GL_ACTIVE_PROGRAM_EXT 0x8B8D - -typedef void (GLAPIENTRY * PFNGLACTIVEPROGRAMEXTPROC) (GLuint program); -typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar* string); -typedef void (GLAPIENTRY * PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program); - -#define glActiveProgramEXT GLEW_GET_FUN(__glewActiveProgramEXT) -#define glCreateShaderProgramEXT GLEW_GET_FUN(__glewCreateShaderProgramEXT) -#define glUseShaderProgramEXT GLEW_GET_FUN(__glewUseShaderProgramEXT) - -#define GLEW_EXT_separate_shader_objects GLEW_GET_VAR(__GLEW_EXT_separate_shader_objects) - -#endif /* GL_EXT_separate_shader_objects */ - -/* --------------------- GL_EXT_separate_specular_color -------------------- */ - -#ifndef GL_EXT_separate_specular_color -#define GL_EXT_separate_specular_color 1 - -#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 -#define GL_SINGLE_COLOR_EXT 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA - -#define GLEW_EXT_separate_specular_color GLEW_GET_VAR(__GLEW_EXT_separate_specular_color) - -#endif /* GL_EXT_separate_specular_color */ - -/* ------------------- GL_EXT_shader_image_load_formatted ------------------ */ - -#ifndef GL_EXT_shader_image_load_formatted -#define GL_EXT_shader_image_load_formatted 1 - -#define GLEW_EXT_shader_image_load_formatted GLEW_GET_VAR(__GLEW_EXT_shader_image_load_formatted) - -#endif /* GL_EXT_shader_image_load_formatted */ - -/* --------------------- GL_EXT_shader_image_load_store -------------------- */ - -#ifndef GL_EXT_shader_image_load_store -#define GL_EXT_shader_image_load_store 1 - -#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 -#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 -#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 -#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 -#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 -#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 -#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 -#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 -#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 -#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 -#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 -#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 -#define GL_MAX_IMAGE_UNITS_EXT 0x8F38 -#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 -#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A -#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B -#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C -#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D -#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E -#define GL_IMAGE_1D_EXT 0x904C -#define GL_IMAGE_2D_EXT 0x904D -#define GL_IMAGE_3D_EXT 0x904E -#define GL_IMAGE_2D_RECT_EXT 0x904F -#define GL_IMAGE_CUBE_EXT 0x9050 -#define GL_IMAGE_BUFFER_EXT 0x9051 -#define GL_IMAGE_1D_ARRAY_EXT 0x9052 -#define GL_IMAGE_2D_ARRAY_EXT 0x9053 -#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 -#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 -#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 -#define GL_INT_IMAGE_1D_EXT 0x9057 -#define GL_INT_IMAGE_2D_EXT 0x9058 -#define GL_INT_IMAGE_3D_EXT 0x9059 -#define GL_INT_IMAGE_2D_RECT_EXT 0x905A -#define GL_INT_IMAGE_CUBE_EXT 0x905B -#define GL_INT_IMAGE_BUFFER_EXT 0x905C -#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D -#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E -#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F -#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 -#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 -#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 -#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 -#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 -#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 -#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 -#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 -#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 -#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 -#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B -#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C -#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D -#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E -#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF - -typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); -typedef void (GLAPIENTRY * PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers); - -#define glBindImageTextureEXT GLEW_GET_FUN(__glewBindImageTextureEXT) -#define glMemoryBarrierEXT GLEW_GET_FUN(__glewMemoryBarrierEXT) - -#define GLEW_EXT_shader_image_load_store GLEW_GET_VAR(__GLEW_EXT_shader_image_load_store) - -#endif /* GL_EXT_shader_image_load_store */ - -/* ----------------------- GL_EXT_shader_integer_mix ----------------------- */ - -#ifndef GL_EXT_shader_integer_mix -#define GL_EXT_shader_integer_mix 1 - -#define GLEW_EXT_shader_integer_mix GLEW_GET_VAR(__GLEW_EXT_shader_integer_mix) - -#endif /* GL_EXT_shader_integer_mix */ - -/* -------------------------- GL_EXT_shadow_funcs -------------------------- */ - -#ifndef GL_EXT_shadow_funcs -#define GL_EXT_shadow_funcs 1 - -#define GLEW_EXT_shadow_funcs GLEW_GET_VAR(__GLEW_EXT_shadow_funcs) - -#endif /* GL_EXT_shadow_funcs */ - -/* --------------------- GL_EXT_shared_texture_palette --------------------- */ - -#ifndef GL_EXT_shared_texture_palette -#define GL_EXT_shared_texture_palette 1 - -#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB - -#define GLEW_EXT_shared_texture_palette GLEW_GET_VAR(__GLEW_EXT_shared_texture_palette) - -#endif /* GL_EXT_shared_texture_palette */ - -/* ------------------------- GL_EXT_sparse_texture2 ------------------------ */ - -#ifndef GL_EXT_sparse_texture2 -#define GL_EXT_sparse_texture2 1 - -#define GLEW_EXT_sparse_texture2 GLEW_GET_VAR(__GLEW_EXT_sparse_texture2) - -#endif /* GL_EXT_sparse_texture2 */ - -/* ------------------------ GL_EXT_stencil_clear_tag ----------------------- */ - -#ifndef GL_EXT_stencil_clear_tag -#define GL_EXT_stencil_clear_tag 1 - -#define GL_STENCIL_TAG_BITS_EXT 0x88F2 -#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 - -#define GLEW_EXT_stencil_clear_tag GLEW_GET_VAR(__GLEW_EXT_stencil_clear_tag) - -#endif /* GL_EXT_stencil_clear_tag */ - -/* ------------------------ GL_EXT_stencil_two_side ------------------------ */ - -#ifndef GL_EXT_stencil_two_side -#define GL_EXT_stencil_two_side 1 - -#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 -#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 - -typedef void (GLAPIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); - -#define glActiveStencilFaceEXT GLEW_GET_FUN(__glewActiveStencilFaceEXT) - -#define GLEW_EXT_stencil_two_side GLEW_GET_VAR(__GLEW_EXT_stencil_two_side) - -#endif /* GL_EXT_stencil_two_side */ - -/* -------------------------- GL_EXT_stencil_wrap -------------------------- */ - -#ifndef GL_EXT_stencil_wrap -#define GL_EXT_stencil_wrap 1 - -#define GL_INCR_WRAP_EXT 0x8507 -#define GL_DECR_WRAP_EXT 0x8508 - -#define GLEW_EXT_stencil_wrap GLEW_GET_VAR(__GLEW_EXT_stencil_wrap) - -#endif /* GL_EXT_stencil_wrap */ - -/* --------------------------- GL_EXT_subtexture --------------------------- */ - -#ifndef GL_EXT_subtexture -#define GL_EXT_subtexture 1 - -typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); -typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); -typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); - -#define glTexSubImage1DEXT GLEW_GET_FUN(__glewTexSubImage1DEXT) -#define glTexSubImage2DEXT GLEW_GET_FUN(__glewTexSubImage2DEXT) -#define glTexSubImage3DEXT GLEW_GET_FUN(__glewTexSubImage3DEXT) - -#define GLEW_EXT_subtexture GLEW_GET_VAR(__GLEW_EXT_subtexture) - -#endif /* GL_EXT_subtexture */ - -/* ----------------------------- GL_EXT_texture ---------------------------- */ - -#ifndef GL_EXT_texture -#define GL_EXT_texture 1 - -#define GL_ALPHA4_EXT 0x803B -#define GL_ALPHA8_EXT 0x803C -#define GL_ALPHA12_EXT 0x803D -#define GL_ALPHA16_EXT 0x803E -#define GL_LUMINANCE4_EXT 0x803F -#define GL_LUMINANCE8_EXT 0x8040 -#define GL_LUMINANCE12_EXT 0x8041 -#define GL_LUMINANCE16_EXT 0x8042 -#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 -#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 -#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 -#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 -#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 -#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 -#define GL_INTENSITY_EXT 0x8049 -#define GL_INTENSITY4_EXT 0x804A -#define GL_INTENSITY8_EXT 0x804B -#define GL_INTENSITY12_EXT 0x804C -#define GL_INTENSITY16_EXT 0x804D -#define GL_RGB2_EXT 0x804E -#define GL_RGB4_EXT 0x804F -#define GL_RGB5_EXT 0x8050 -#define GL_RGB8_EXT 0x8051 -#define GL_RGB10_EXT 0x8052 -#define GL_RGB12_EXT 0x8053 -#define GL_RGB16_EXT 0x8054 -#define GL_RGBA2_EXT 0x8055 -#define GL_RGBA4_EXT 0x8056 -#define GL_RGB5_A1_EXT 0x8057 -#define GL_RGBA8_EXT 0x8058 -#define GL_RGB10_A2_EXT 0x8059 -#define GL_RGBA12_EXT 0x805A -#define GL_RGBA16_EXT 0x805B -#define GL_TEXTURE_RED_SIZE_EXT 0x805C -#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D -#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E -#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F -#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 -#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 -#define GL_REPLACE_EXT 0x8062 -#define GL_PROXY_TEXTURE_1D_EXT 0x8063 -#define GL_PROXY_TEXTURE_2D_EXT 0x8064 - -#define GLEW_EXT_texture GLEW_GET_VAR(__GLEW_EXT_texture) - -#endif /* GL_EXT_texture */ - -/* ---------------------------- GL_EXT_texture3D --------------------------- */ - -#ifndef GL_EXT_texture3D -#define GL_EXT_texture3D 1 - -#define GL_PACK_SKIP_IMAGES_EXT 0x806B -#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C -#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D -#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E -#define GL_TEXTURE_3D_EXT 0x806F -#define GL_PROXY_TEXTURE_3D_EXT 0x8070 -#define GL_TEXTURE_DEPTH_EXT 0x8071 -#define GL_TEXTURE_WRAP_R_EXT 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 - -typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); - -#define glTexImage3DEXT GLEW_GET_FUN(__glewTexImage3DEXT) - -#define GLEW_EXT_texture3D GLEW_GET_VAR(__GLEW_EXT_texture3D) - -#endif /* GL_EXT_texture3D */ - -/* -------------------------- GL_EXT_texture_array ------------------------- */ - -#ifndef GL_EXT_texture_array -#define GL_EXT_texture_array 1 - -#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E -#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF -#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 -#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 -#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A -#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B -#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C -#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D - -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); - -#define glFramebufferTextureLayerEXT GLEW_GET_FUN(__glewFramebufferTextureLayerEXT) - -#define GLEW_EXT_texture_array GLEW_GET_VAR(__GLEW_EXT_texture_array) - -#endif /* GL_EXT_texture_array */ - -/* ---------------------- GL_EXT_texture_buffer_object --------------------- */ - -#ifndef GL_EXT_texture_buffer_object -#define GL_EXT_texture_buffer_object 1 - -#define GL_TEXTURE_BUFFER_EXT 0x8C2A -#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B -#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C -#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D -#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E - -typedef void (GLAPIENTRY * PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); - -#define glTexBufferEXT GLEW_GET_FUN(__glewTexBufferEXT) - -#define GLEW_EXT_texture_buffer_object GLEW_GET_VAR(__GLEW_EXT_texture_buffer_object) - -#endif /* GL_EXT_texture_buffer_object */ - -/* -------------------- GL_EXT_texture_compression_dxt1 -------------------- */ - -#ifndef GL_EXT_texture_compression_dxt1 -#define GL_EXT_texture_compression_dxt1 1 - -#define GLEW_EXT_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_EXT_texture_compression_dxt1) - -#endif /* GL_EXT_texture_compression_dxt1 */ - -/* -------------------- GL_EXT_texture_compression_latc -------------------- */ - -#ifndef GL_EXT_texture_compression_latc -#define GL_EXT_texture_compression_latc 1 - -#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 -#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 -#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 -#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 - -#define GLEW_EXT_texture_compression_latc GLEW_GET_VAR(__GLEW_EXT_texture_compression_latc) - -#endif /* GL_EXT_texture_compression_latc */ - -/* -------------------- GL_EXT_texture_compression_rgtc -------------------- */ - -#ifndef GL_EXT_texture_compression_rgtc -#define GL_EXT_texture_compression_rgtc 1 - -#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB -#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC -#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD -#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE - -#define GLEW_EXT_texture_compression_rgtc GLEW_GET_VAR(__GLEW_EXT_texture_compression_rgtc) - -#endif /* GL_EXT_texture_compression_rgtc */ - -/* -------------------- GL_EXT_texture_compression_s3tc -------------------- */ - -#ifndef GL_EXT_texture_compression_s3tc -#define GL_EXT_texture_compression_s3tc 1 - -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 - -#define GLEW_EXT_texture_compression_s3tc GLEW_GET_VAR(__GLEW_EXT_texture_compression_s3tc) - -#endif /* GL_EXT_texture_compression_s3tc */ - -/* ------------------------ GL_EXT_texture_cube_map ------------------------ */ - -#ifndef GL_EXT_texture_cube_map -#define GL_EXT_texture_cube_map 1 - -#define GL_NORMAL_MAP_EXT 0x8511 -#define GL_REFLECTION_MAP_EXT 0x8512 -#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C - -#define GLEW_EXT_texture_cube_map GLEW_GET_VAR(__GLEW_EXT_texture_cube_map) - -#endif /* GL_EXT_texture_cube_map */ - -/* ----------------------- GL_EXT_texture_edge_clamp ----------------------- */ - -#ifndef GL_EXT_texture_edge_clamp -#define GL_EXT_texture_edge_clamp 1 - -#define GL_CLAMP_TO_EDGE_EXT 0x812F - -#define GLEW_EXT_texture_edge_clamp GLEW_GET_VAR(__GLEW_EXT_texture_edge_clamp) - -#endif /* GL_EXT_texture_edge_clamp */ - -/* --------------------------- GL_EXT_texture_env -------------------------- */ - -#ifndef GL_EXT_texture_env -#define GL_EXT_texture_env 1 - -#define GLEW_EXT_texture_env GLEW_GET_VAR(__GLEW_EXT_texture_env) - -#endif /* GL_EXT_texture_env */ - -/* ------------------------- GL_EXT_texture_env_add ------------------------ */ - -#ifndef GL_EXT_texture_env_add -#define GL_EXT_texture_env_add 1 - -#define GLEW_EXT_texture_env_add GLEW_GET_VAR(__GLEW_EXT_texture_env_add) - -#endif /* GL_EXT_texture_env_add */ - -/* ----------------------- GL_EXT_texture_env_combine ---------------------- */ - -#ifndef GL_EXT_texture_env_combine -#define GL_EXT_texture_env_combine 1 - -#define GL_COMBINE_EXT 0x8570 -#define GL_COMBINE_RGB_EXT 0x8571 -#define GL_COMBINE_ALPHA_EXT 0x8572 -#define GL_RGB_SCALE_EXT 0x8573 -#define GL_ADD_SIGNED_EXT 0x8574 -#define GL_INTERPOLATE_EXT 0x8575 -#define GL_CONSTANT_EXT 0x8576 -#define GL_PRIMARY_COLOR_EXT 0x8577 -#define GL_PREVIOUS_EXT 0x8578 -#define GL_SOURCE0_RGB_EXT 0x8580 -#define GL_SOURCE1_RGB_EXT 0x8581 -#define GL_SOURCE2_RGB_EXT 0x8582 -#define GL_SOURCE0_ALPHA_EXT 0x8588 -#define GL_SOURCE1_ALPHA_EXT 0x8589 -#define GL_SOURCE2_ALPHA_EXT 0x858A -#define GL_OPERAND0_RGB_EXT 0x8590 -#define GL_OPERAND1_RGB_EXT 0x8591 -#define GL_OPERAND2_RGB_EXT 0x8592 -#define GL_OPERAND0_ALPHA_EXT 0x8598 -#define GL_OPERAND1_ALPHA_EXT 0x8599 -#define GL_OPERAND2_ALPHA_EXT 0x859A - -#define GLEW_EXT_texture_env_combine GLEW_GET_VAR(__GLEW_EXT_texture_env_combine) - -#endif /* GL_EXT_texture_env_combine */ - -/* ------------------------ GL_EXT_texture_env_dot3 ------------------------ */ - -#ifndef GL_EXT_texture_env_dot3 -#define GL_EXT_texture_env_dot3 1 - -#define GL_DOT3_RGB_EXT 0x8740 -#define GL_DOT3_RGBA_EXT 0x8741 - -#define GLEW_EXT_texture_env_dot3 GLEW_GET_VAR(__GLEW_EXT_texture_env_dot3) - -#endif /* GL_EXT_texture_env_dot3 */ - -/* ------------------- GL_EXT_texture_filter_anisotropic ------------------- */ - -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_EXT_texture_filter_anisotropic 1 - -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF - -#define GLEW_EXT_texture_filter_anisotropic GLEW_GET_VAR(__GLEW_EXT_texture_filter_anisotropic) - -#endif /* GL_EXT_texture_filter_anisotropic */ - -/* ---------------------- GL_EXT_texture_filter_minmax --------------------- */ - -#ifndef GL_EXT_texture_filter_minmax -#define GL_EXT_texture_filter_minmax 1 - -#define GL_TEXTURE_REDUCTION_MODE_EXT 0x9366 -#define GL_WEIGHTED_AVERAGE_EXT 0x9367 - -#define GLEW_EXT_texture_filter_minmax GLEW_GET_VAR(__GLEW_EXT_texture_filter_minmax) - -#endif /* GL_EXT_texture_filter_minmax */ - -/* ------------------------- GL_EXT_texture_integer ------------------------ */ - -#ifndef GL_EXT_texture_integer -#define GL_EXT_texture_integer 1 - -#define GL_RGBA32UI_EXT 0x8D70 -#define GL_RGB32UI_EXT 0x8D71 -#define GL_ALPHA32UI_EXT 0x8D72 -#define GL_INTENSITY32UI_EXT 0x8D73 -#define GL_LUMINANCE32UI_EXT 0x8D74 -#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 -#define GL_RGBA16UI_EXT 0x8D76 -#define GL_RGB16UI_EXT 0x8D77 -#define GL_ALPHA16UI_EXT 0x8D78 -#define GL_INTENSITY16UI_EXT 0x8D79 -#define GL_LUMINANCE16UI_EXT 0x8D7A -#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B -#define GL_RGBA8UI_EXT 0x8D7C -#define GL_RGB8UI_EXT 0x8D7D -#define GL_ALPHA8UI_EXT 0x8D7E -#define GL_INTENSITY8UI_EXT 0x8D7F -#define GL_LUMINANCE8UI_EXT 0x8D80 -#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 -#define GL_RGBA32I_EXT 0x8D82 -#define GL_RGB32I_EXT 0x8D83 -#define GL_ALPHA32I_EXT 0x8D84 -#define GL_INTENSITY32I_EXT 0x8D85 -#define GL_LUMINANCE32I_EXT 0x8D86 -#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 -#define GL_RGBA16I_EXT 0x8D88 -#define GL_RGB16I_EXT 0x8D89 -#define GL_ALPHA16I_EXT 0x8D8A -#define GL_INTENSITY16I_EXT 0x8D8B -#define GL_LUMINANCE16I_EXT 0x8D8C -#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D -#define GL_RGBA8I_EXT 0x8D8E -#define GL_RGB8I_EXT 0x8D8F -#define GL_ALPHA8I_EXT 0x8D90 -#define GL_INTENSITY8I_EXT 0x8D91 -#define GL_LUMINANCE8I_EXT 0x8D92 -#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 -#define GL_RED_INTEGER_EXT 0x8D94 -#define GL_GREEN_INTEGER_EXT 0x8D95 -#define GL_BLUE_INTEGER_EXT 0x8D96 -#define GL_ALPHA_INTEGER_EXT 0x8D97 -#define GL_RGB_INTEGER_EXT 0x8D98 -#define GL_RGBA_INTEGER_EXT 0x8D99 -#define GL_BGR_INTEGER_EXT 0x8D9A -#define GL_BGRA_INTEGER_EXT 0x8D9B -#define GL_LUMINANCE_INTEGER_EXT 0x8D9C -#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D -#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E - -typedef void (GLAPIENTRY * PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); -typedef void (GLAPIENTRY * PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); -typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); -typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); - -#define glClearColorIiEXT GLEW_GET_FUN(__glewClearColorIiEXT) -#define glClearColorIuiEXT GLEW_GET_FUN(__glewClearColorIuiEXT) -#define glGetTexParameterIivEXT GLEW_GET_FUN(__glewGetTexParameterIivEXT) -#define glGetTexParameterIuivEXT GLEW_GET_FUN(__glewGetTexParameterIuivEXT) -#define glTexParameterIivEXT GLEW_GET_FUN(__glewTexParameterIivEXT) -#define glTexParameterIuivEXT GLEW_GET_FUN(__glewTexParameterIuivEXT) - -#define GLEW_EXT_texture_integer GLEW_GET_VAR(__GLEW_EXT_texture_integer) - -#endif /* GL_EXT_texture_integer */ - -/* ------------------------ GL_EXT_texture_lod_bias ------------------------ */ - -#ifndef GL_EXT_texture_lod_bias -#define GL_EXT_texture_lod_bias 1 - -#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD -#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 -#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 - -#define GLEW_EXT_texture_lod_bias GLEW_GET_VAR(__GLEW_EXT_texture_lod_bias) - -#endif /* GL_EXT_texture_lod_bias */ - -/* ---------------------- GL_EXT_texture_mirror_clamp ---------------------- */ - -#ifndef GL_EXT_texture_mirror_clamp -#define GL_EXT_texture_mirror_clamp 1 - -#define GL_MIRROR_CLAMP_EXT 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 -#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 - -#define GLEW_EXT_texture_mirror_clamp GLEW_GET_VAR(__GLEW_EXT_texture_mirror_clamp) - -#endif /* GL_EXT_texture_mirror_clamp */ - -/* ------------------------- GL_EXT_texture_object ------------------------- */ - -#ifndef GL_EXT_texture_object -#define GL_EXT_texture_object 1 - -#define GL_TEXTURE_PRIORITY_EXT 0x8066 -#define GL_TEXTURE_RESIDENT_EXT 0x8067 -#define GL_TEXTURE_1D_BINDING_EXT 0x8068 -#define GL_TEXTURE_2D_BINDING_EXT 0x8069 -#define GL_TEXTURE_3D_BINDING_EXT 0x806A - -typedef GLboolean (GLAPIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint* textures, GLboolean* residences); -typedef void (GLAPIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); -typedef void (GLAPIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint* textures); -typedef void (GLAPIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint* textures); -typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture); -typedef void (GLAPIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint* textures, const GLclampf* priorities); - -#define glAreTexturesResidentEXT GLEW_GET_FUN(__glewAreTexturesResidentEXT) -#define glBindTextureEXT GLEW_GET_FUN(__glewBindTextureEXT) -#define glDeleteTexturesEXT GLEW_GET_FUN(__glewDeleteTexturesEXT) -#define glGenTexturesEXT GLEW_GET_FUN(__glewGenTexturesEXT) -#define glIsTextureEXT GLEW_GET_FUN(__glewIsTextureEXT) -#define glPrioritizeTexturesEXT GLEW_GET_FUN(__glewPrioritizeTexturesEXT) - -#define GLEW_EXT_texture_object GLEW_GET_VAR(__GLEW_EXT_texture_object) - -#endif /* GL_EXT_texture_object */ - -/* --------------------- GL_EXT_texture_perturb_normal --------------------- */ - -#ifndef GL_EXT_texture_perturb_normal -#define GL_EXT_texture_perturb_normal 1 - -#define GL_PERTURB_EXT 0x85AE -#define GL_TEXTURE_NORMAL_EXT 0x85AF - -typedef void (GLAPIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); - -#define glTextureNormalEXT GLEW_GET_FUN(__glewTextureNormalEXT) - -#define GLEW_EXT_texture_perturb_normal GLEW_GET_VAR(__GLEW_EXT_texture_perturb_normal) - -#endif /* GL_EXT_texture_perturb_normal */ - -/* ------------------------ GL_EXT_texture_rectangle ----------------------- */ - -#ifndef GL_EXT_texture_rectangle -#define GL_EXT_texture_rectangle 1 - -#define GL_TEXTURE_RECTANGLE_EXT 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_EXT 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_EXT 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT 0x84F8 - -#define GLEW_EXT_texture_rectangle GLEW_GET_VAR(__GLEW_EXT_texture_rectangle) - -#endif /* GL_EXT_texture_rectangle */ - -/* -------------------------- GL_EXT_texture_sRGB -------------------------- */ - -#ifndef GL_EXT_texture_sRGB -#define GL_EXT_texture_sRGB 1 - -#define GL_SRGB_EXT 0x8C40 -#define GL_SRGB8_EXT 0x8C41 -#define GL_SRGB_ALPHA_EXT 0x8C42 -#define GL_SRGB8_ALPHA8_EXT 0x8C43 -#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 -#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 -#define GL_SLUMINANCE_EXT 0x8C46 -#define GL_SLUMINANCE8_EXT 0x8C47 -#define GL_COMPRESSED_SRGB_EXT 0x8C48 -#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 -#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A -#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B -#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E -#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F - -#define GLEW_EXT_texture_sRGB GLEW_GET_VAR(__GLEW_EXT_texture_sRGB) - -#endif /* GL_EXT_texture_sRGB */ - -/* ----------------------- GL_EXT_texture_sRGB_decode ---------------------- */ - -#ifndef GL_EXT_texture_sRGB_decode -#define GL_EXT_texture_sRGB_decode 1 - -#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 -#define GL_DECODE_EXT 0x8A49 -#define GL_SKIP_DECODE_EXT 0x8A4A - -#define GLEW_EXT_texture_sRGB_decode GLEW_GET_VAR(__GLEW_EXT_texture_sRGB_decode) - -#endif /* GL_EXT_texture_sRGB_decode */ - -/* --------------------- GL_EXT_texture_shared_exponent -------------------- */ - -#ifndef GL_EXT_texture_shared_exponent -#define GL_EXT_texture_shared_exponent 1 - -#define GL_RGB9_E5_EXT 0x8C3D -#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E -#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F - -#define GLEW_EXT_texture_shared_exponent GLEW_GET_VAR(__GLEW_EXT_texture_shared_exponent) - -#endif /* GL_EXT_texture_shared_exponent */ - -/* -------------------------- GL_EXT_texture_snorm ------------------------- */ - -#ifndef GL_EXT_texture_snorm -#define GL_EXT_texture_snorm 1 - -#define GL_RED_SNORM 0x8F90 -#define GL_RG_SNORM 0x8F91 -#define GL_RGB_SNORM 0x8F92 -#define GL_RGBA_SNORM 0x8F93 -#define GL_R8_SNORM 0x8F94 -#define GL_RG8_SNORM 0x8F95 -#define GL_RGB8_SNORM 0x8F96 -#define GL_RGBA8_SNORM 0x8F97 -#define GL_R16_SNORM 0x8F98 -#define GL_RG16_SNORM 0x8F99 -#define GL_RGB16_SNORM 0x8F9A -#define GL_RGBA16_SNORM 0x8F9B -#define GL_SIGNED_NORMALIZED 0x8F9C -#define GL_ALPHA_SNORM 0x9010 -#define GL_LUMINANCE_SNORM 0x9011 -#define GL_LUMINANCE_ALPHA_SNORM 0x9012 -#define GL_INTENSITY_SNORM 0x9013 -#define GL_ALPHA8_SNORM 0x9014 -#define GL_LUMINANCE8_SNORM 0x9015 -#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 -#define GL_INTENSITY8_SNORM 0x9017 -#define GL_ALPHA16_SNORM 0x9018 -#define GL_LUMINANCE16_SNORM 0x9019 -#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A -#define GL_INTENSITY16_SNORM 0x901B - -#define GLEW_EXT_texture_snorm GLEW_GET_VAR(__GLEW_EXT_texture_snorm) - -#endif /* GL_EXT_texture_snorm */ - -/* ------------------------- GL_EXT_texture_swizzle ------------------------ */ - -#ifndef GL_EXT_texture_swizzle -#define GL_EXT_texture_swizzle 1 - -#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 -#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 -#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 -#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 -#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 - -#define GLEW_EXT_texture_swizzle GLEW_GET_VAR(__GLEW_EXT_texture_swizzle) - -#endif /* GL_EXT_texture_swizzle */ - -/* --------------------------- GL_EXT_timer_query -------------------------- */ - -#ifndef GL_EXT_timer_query -#define GL_EXT_timer_query 1 - -#define GL_TIME_ELAPSED_EXT 0x88BF - -typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); -typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); - -#define glGetQueryObjecti64vEXT GLEW_GET_FUN(__glewGetQueryObjecti64vEXT) -#define glGetQueryObjectui64vEXT GLEW_GET_FUN(__glewGetQueryObjectui64vEXT) - -#define GLEW_EXT_timer_query GLEW_GET_VAR(__GLEW_EXT_timer_query) - -#endif /* GL_EXT_timer_query */ - -/* ----------------------- GL_EXT_transform_feedback ----------------------- */ - -#ifndef GL_EXT_transform_feedback -#define GL_EXT_transform_feedback 1 - -#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 -#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 -#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 -#define GL_RASTERIZER_DISCARD_EXT 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B -#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C -#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D -#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F - -typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); -typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); -typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei *size, GLenum *type, GLchar *name); -typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar * const* varyings, GLenum bufferMode); - -#define glBeginTransformFeedbackEXT GLEW_GET_FUN(__glewBeginTransformFeedbackEXT) -#define glBindBufferBaseEXT GLEW_GET_FUN(__glewBindBufferBaseEXT) -#define glBindBufferOffsetEXT GLEW_GET_FUN(__glewBindBufferOffsetEXT) -#define glBindBufferRangeEXT GLEW_GET_FUN(__glewBindBufferRangeEXT) -#define glEndTransformFeedbackEXT GLEW_GET_FUN(__glewEndTransformFeedbackEXT) -#define glGetTransformFeedbackVaryingEXT GLEW_GET_FUN(__glewGetTransformFeedbackVaryingEXT) -#define glTransformFeedbackVaryingsEXT GLEW_GET_FUN(__glewTransformFeedbackVaryingsEXT) - -#define GLEW_EXT_transform_feedback GLEW_GET_VAR(__GLEW_EXT_transform_feedback) - -#endif /* GL_EXT_transform_feedback */ - -/* -------------------------- GL_EXT_vertex_array -------------------------- */ - -#ifndef GL_EXT_vertex_array -#define GL_EXT_vertex_array 1 - -#define GL_DOUBLE_EXT 0x140A -#define GL_VERTEX_ARRAY_EXT 0x8074 -#define GL_NORMAL_ARRAY_EXT 0x8075 -#define GL_COLOR_ARRAY_EXT 0x8076 -#define GL_INDEX_ARRAY_EXT 0x8077 -#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 -#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 -#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A -#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B -#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C -#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D -#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E -#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F -#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 -#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 -#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 -#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 -#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 -#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 -#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 -#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 -#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A -#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B -#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C -#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D -#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E -#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F -#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 -#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 - -typedef void (GLAPIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i); -typedef void (GLAPIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); -typedef void (GLAPIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean* pointer); -typedef void (GLAPIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); -typedef void (GLAPIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); -typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); -typedef void (GLAPIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); - -#define glArrayElementEXT GLEW_GET_FUN(__glewArrayElementEXT) -#define glColorPointerEXT GLEW_GET_FUN(__glewColorPointerEXT) -#define glDrawArraysEXT GLEW_GET_FUN(__glewDrawArraysEXT) -#define glEdgeFlagPointerEXT GLEW_GET_FUN(__glewEdgeFlagPointerEXT) -#define glIndexPointerEXT GLEW_GET_FUN(__glewIndexPointerEXT) -#define glNormalPointerEXT GLEW_GET_FUN(__glewNormalPointerEXT) -#define glTexCoordPointerEXT GLEW_GET_FUN(__glewTexCoordPointerEXT) -#define glVertexPointerEXT GLEW_GET_FUN(__glewVertexPointerEXT) - -#define GLEW_EXT_vertex_array GLEW_GET_VAR(__GLEW_EXT_vertex_array) - -#endif /* GL_EXT_vertex_array */ - -/* ------------------------ GL_EXT_vertex_array_bgra ----------------------- */ - -#ifndef GL_EXT_vertex_array_bgra -#define GL_EXT_vertex_array_bgra 1 - -#define GL_BGRA 0x80E1 - -#define GLEW_EXT_vertex_array_bgra GLEW_GET_VAR(__GLEW_EXT_vertex_array_bgra) - -#endif /* GL_EXT_vertex_array_bgra */ - -/* ----------------------- GL_EXT_vertex_attrib_64bit ---------------------- */ - -#ifndef GL_EXT_vertex_attrib_64bit -#define GL_EXT_vertex_attrib_64bit 1 - -#define GL_DOUBLE_MAT2_EXT 0x8F46 -#define GL_DOUBLE_MAT3_EXT 0x8F47 -#define GL_DOUBLE_MAT4_EXT 0x8F48 -#define GL_DOUBLE_MAT2x3_EXT 0x8F49 -#define GL_DOUBLE_MAT2x4_EXT 0x8F4A -#define GL_DOUBLE_MAT3x2_EXT 0x8F4B -#define GL_DOUBLE_MAT3x4_EXT 0x8F4C -#define GL_DOUBLE_MAT4x2_EXT 0x8F4D -#define GL_DOUBLE_MAT4x3_EXT 0x8F4E -#define GL_DOUBLE_VEC2_EXT 0x8FFC -#define GL_DOUBLE_VEC3_EXT 0x8FFD -#define GL_DOUBLE_VEC4_EXT 0x8FFE - -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); - -#define glGetVertexAttribLdvEXT GLEW_GET_FUN(__glewGetVertexAttribLdvEXT) -#define glVertexArrayVertexAttribLOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribLOffsetEXT) -#define glVertexAttribL1dEXT GLEW_GET_FUN(__glewVertexAttribL1dEXT) -#define glVertexAttribL1dvEXT GLEW_GET_FUN(__glewVertexAttribL1dvEXT) -#define glVertexAttribL2dEXT GLEW_GET_FUN(__glewVertexAttribL2dEXT) -#define glVertexAttribL2dvEXT GLEW_GET_FUN(__glewVertexAttribL2dvEXT) -#define glVertexAttribL3dEXT GLEW_GET_FUN(__glewVertexAttribL3dEXT) -#define glVertexAttribL3dvEXT GLEW_GET_FUN(__glewVertexAttribL3dvEXT) -#define glVertexAttribL4dEXT GLEW_GET_FUN(__glewVertexAttribL4dEXT) -#define glVertexAttribL4dvEXT GLEW_GET_FUN(__glewVertexAttribL4dvEXT) -#define glVertexAttribLPointerEXT GLEW_GET_FUN(__glewVertexAttribLPointerEXT) - -#define GLEW_EXT_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_EXT_vertex_attrib_64bit) - -#endif /* GL_EXT_vertex_attrib_64bit */ - -/* -------------------------- GL_EXT_vertex_shader ------------------------- */ - -#ifndef GL_EXT_vertex_shader -#define GL_EXT_vertex_shader 1 - -#define GL_VERTEX_SHADER_EXT 0x8780 -#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 -#define GL_OP_INDEX_EXT 0x8782 -#define GL_OP_NEGATE_EXT 0x8783 -#define GL_OP_DOT3_EXT 0x8784 -#define GL_OP_DOT4_EXT 0x8785 -#define GL_OP_MUL_EXT 0x8786 -#define GL_OP_ADD_EXT 0x8787 -#define GL_OP_MADD_EXT 0x8788 -#define GL_OP_FRAC_EXT 0x8789 -#define GL_OP_MAX_EXT 0x878A -#define GL_OP_MIN_EXT 0x878B -#define GL_OP_SET_GE_EXT 0x878C -#define GL_OP_SET_LT_EXT 0x878D -#define GL_OP_CLAMP_EXT 0x878E -#define GL_OP_FLOOR_EXT 0x878F -#define GL_OP_ROUND_EXT 0x8790 -#define GL_OP_EXP_BASE_2_EXT 0x8791 -#define GL_OP_LOG_BASE_2_EXT 0x8792 -#define GL_OP_POWER_EXT 0x8793 -#define GL_OP_RECIP_EXT 0x8794 -#define GL_OP_RECIP_SQRT_EXT 0x8795 -#define GL_OP_SUB_EXT 0x8796 -#define GL_OP_CROSS_PRODUCT_EXT 0x8797 -#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 -#define GL_OP_MOV_EXT 0x8799 -#define GL_OUTPUT_VERTEX_EXT 0x879A -#define GL_OUTPUT_COLOR0_EXT 0x879B -#define GL_OUTPUT_COLOR1_EXT 0x879C -#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D -#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E -#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F -#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 -#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 -#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 -#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 -#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 -#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 -#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 -#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 -#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 -#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 -#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA -#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB -#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC -#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD -#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE -#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF -#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 -#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 -#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 -#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 -#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 -#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 -#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 -#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 -#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 -#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 -#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA -#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB -#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC -#define GL_OUTPUT_FOG_EXT 0x87BD -#define GL_SCALAR_EXT 0x87BE -#define GL_VECTOR_EXT 0x87BF -#define GL_MATRIX_EXT 0x87C0 -#define GL_VARIANT_EXT 0x87C1 -#define GL_INVARIANT_EXT 0x87C2 -#define GL_LOCAL_CONSTANT_EXT 0x87C3 -#define GL_LOCAL_EXT 0x87C4 -#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 -#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 -#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 -#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 -#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CC -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CD -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE -#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF -#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 -#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 -#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 -#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 -#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 -#define GL_X_EXT 0x87D5 -#define GL_Y_EXT 0x87D6 -#define GL_Z_EXT 0x87D7 -#define GL_W_EXT 0x87D8 -#define GL_NEGATIVE_X_EXT 0x87D9 -#define GL_NEGATIVE_Y_EXT 0x87DA -#define GL_NEGATIVE_Z_EXT 0x87DB -#define GL_NEGATIVE_W_EXT 0x87DC -#define GL_ZERO_EXT 0x87DD -#define GL_ONE_EXT 0x87DE -#define GL_NEGATIVE_ONE_EXT 0x87DF -#define GL_NORMALIZED_RANGE_EXT 0x87E0 -#define GL_FULL_RANGE_EXT 0x87E1 -#define GL_CURRENT_VERTEX_EXT 0x87E2 -#define GL_MVP_MATRIX_EXT 0x87E3 -#define GL_VARIANT_VALUE_EXT 0x87E4 -#define GL_VARIANT_DATATYPE_EXT 0x87E5 -#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 -#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 -#define GL_VARIANT_ARRAY_EXT 0x87E8 -#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 -#define GL_INVARIANT_VALUE_EXT 0x87EA -#define GL_INVARIANT_DATATYPE_EXT 0x87EB -#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC -#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED - -typedef void (GLAPIENTRY * PFNGLBEGINVERTEXSHADEREXTPROC) (void); -typedef GLuint (GLAPIENTRY * PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); -typedef GLuint (GLAPIENTRY * PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); -typedef GLuint (GLAPIENTRY * PFNGLBINDPARAMETEREXTPROC) (GLenum value); -typedef GLuint (GLAPIENTRY * PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); -typedef GLuint (GLAPIENTRY * PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); -typedef void (GLAPIENTRY * PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); -typedef void (GLAPIENTRY * PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); -typedef void (GLAPIENTRY * PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef void (GLAPIENTRY * PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef void (GLAPIENTRY * PFNGLENDVERTEXSHADEREXTPROC) (void); -typedef void (GLAPIENTRY * PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef GLuint (GLAPIENTRY * PFNGLGENSYMBOLSEXTPROC) (GLenum dataType, GLenum storageType, GLenum range, GLuint components); -typedef GLuint (GLAPIENTRY * PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); -typedef void (GLAPIENTRY * PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (GLAPIENTRY * PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (GLAPIENTRY * PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (GLAPIENTRY * PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (GLAPIENTRY * PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (GLAPIENTRY * PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (GLAPIENTRY * PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, void **data); -typedef void (GLAPIENTRY * PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef GLboolean (GLAPIENTRY * PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); -typedef void (GLAPIENTRY * PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, void *addr); -typedef void (GLAPIENTRY * PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, void *addr); -typedef void (GLAPIENTRY * PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); -typedef void (GLAPIENTRY * PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); -typedef void (GLAPIENTRY * PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); -typedef void (GLAPIENTRY * PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -typedef void (GLAPIENTRY * PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, void *addr); -typedef void (GLAPIENTRY * PFNGLVARIANTBVEXTPROC) (GLuint id, GLbyte *addr); -typedef void (GLAPIENTRY * PFNGLVARIANTDVEXTPROC) (GLuint id, GLdouble *addr); -typedef void (GLAPIENTRY * PFNGLVARIANTFVEXTPROC) (GLuint id, GLfloat *addr); -typedef void (GLAPIENTRY * PFNGLVARIANTIVEXTPROC) (GLuint id, GLint *addr); -typedef void (GLAPIENTRY * PFNGLVARIANTSVEXTPROC) (GLuint id, GLshort *addr); -typedef void (GLAPIENTRY * PFNGLVARIANTUBVEXTPROC) (GLuint id, GLubyte *addr); -typedef void (GLAPIENTRY * PFNGLVARIANTUIVEXTPROC) (GLuint id, GLuint *addr); -typedef void (GLAPIENTRY * PFNGLVARIANTUSVEXTPROC) (GLuint id, GLushort *addr); -typedef void (GLAPIENTRY * PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); - -#define glBeginVertexShaderEXT GLEW_GET_FUN(__glewBeginVertexShaderEXT) -#define glBindLightParameterEXT GLEW_GET_FUN(__glewBindLightParameterEXT) -#define glBindMaterialParameterEXT GLEW_GET_FUN(__glewBindMaterialParameterEXT) -#define glBindParameterEXT GLEW_GET_FUN(__glewBindParameterEXT) -#define glBindTexGenParameterEXT GLEW_GET_FUN(__glewBindTexGenParameterEXT) -#define glBindTextureUnitParameterEXT GLEW_GET_FUN(__glewBindTextureUnitParameterEXT) -#define glBindVertexShaderEXT GLEW_GET_FUN(__glewBindVertexShaderEXT) -#define glDeleteVertexShaderEXT GLEW_GET_FUN(__glewDeleteVertexShaderEXT) -#define glDisableVariantClientStateEXT GLEW_GET_FUN(__glewDisableVariantClientStateEXT) -#define glEnableVariantClientStateEXT GLEW_GET_FUN(__glewEnableVariantClientStateEXT) -#define glEndVertexShaderEXT GLEW_GET_FUN(__glewEndVertexShaderEXT) -#define glExtractComponentEXT GLEW_GET_FUN(__glewExtractComponentEXT) -#define glGenSymbolsEXT GLEW_GET_FUN(__glewGenSymbolsEXT) -#define glGenVertexShadersEXT GLEW_GET_FUN(__glewGenVertexShadersEXT) -#define glGetInvariantBooleanvEXT GLEW_GET_FUN(__glewGetInvariantBooleanvEXT) -#define glGetInvariantFloatvEXT GLEW_GET_FUN(__glewGetInvariantFloatvEXT) -#define glGetInvariantIntegervEXT GLEW_GET_FUN(__glewGetInvariantIntegervEXT) -#define glGetLocalConstantBooleanvEXT GLEW_GET_FUN(__glewGetLocalConstantBooleanvEXT) -#define glGetLocalConstantFloatvEXT GLEW_GET_FUN(__glewGetLocalConstantFloatvEXT) -#define glGetLocalConstantIntegervEXT GLEW_GET_FUN(__glewGetLocalConstantIntegervEXT) -#define glGetVariantBooleanvEXT GLEW_GET_FUN(__glewGetVariantBooleanvEXT) -#define glGetVariantFloatvEXT GLEW_GET_FUN(__glewGetVariantFloatvEXT) -#define glGetVariantIntegervEXT GLEW_GET_FUN(__glewGetVariantIntegervEXT) -#define glGetVariantPointervEXT GLEW_GET_FUN(__glewGetVariantPointervEXT) -#define glInsertComponentEXT GLEW_GET_FUN(__glewInsertComponentEXT) -#define glIsVariantEnabledEXT GLEW_GET_FUN(__glewIsVariantEnabledEXT) -#define glSetInvariantEXT GLEW_GET_FUN(__glewSetInvariantEXT) -#define glSetLocalConstantEXT GLEW_GET_FUN(__glewSetLocalConstantEXT) -#define glShaderOp1EXT GLEW_GET_FUN(__glewShaderOp1EXT) -#define glShaderOp2EXT GLEW_GET_FUN(__glewShaderOp2EXT) -#define glShaderOp3EXT GLEW_GET_FUN(__glewShaderOp3EXT) -#define glSwizzleEXT GLEW_GET_FUN(__glewSwizzleEXT) -#define glVariantPointerEXT GLEW_GET_FUN(__glewVariantPointerEXT) -#define glVariantbvEXT GLEW_GET_FUN(__glewVariantbvEXT) -#define glVariantdvEXT GLEW_GET_FUN(__glewVariantdvEXT) -#define glVariantfvEXT GLEW_GET_FUN(__glewVariantfvEXT) -#define glVariantivEXT GLEW_GET_FUN(__glewVariantivEXT) -#define glVariantsvEXT GLEW_GET_FUN(__glewVariantsvEXT) -#define glVariantubvEXT GLEW_GET_FUN(__glewVariantubvEXT) -#define glVariantuivEXT GLEW_GET_FUN(__glewVariantuivEXT) -#define glVariantusvEXT GLEW_GET_FUN(__glewVariantusvEXT) -#define glWriteMaskEXT GLEW_GET_FUN(__glewWriteMaskEXT) - -#define GLEW_EXT_vertex_shader GLEW_GET_VAR(__GLEW_EXT_vertex_shader) - -#endif /* GL_EXT_vertex_shader */ - -/* ------------------------ GL_EXT_vertex_weighting ------------------------ */ - -#ifndef GL_EXT_vertex_weighting -#define GL_EXT_vertex_weighting 1 - -#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 -#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6 -#define GL_MODELVIEW0_EXT 0x1700 -#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 -#define GL_MODELVIEW1_MATRIX_EXT 0x8506 -#define GL_VERTEX_WEIGHTING_EXT 0x8509 -#define GL_MODELVIEW1_EXT 0x850A -#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B -#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C -#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D -#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E -#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F -#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 - -typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, void *pointer); -typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); -typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (GLfloat* weight); - -#define glVertexWeightPointerEXT GLEW_GET_FUN(__glewVertexWeightPointerEXT) -#define glVertexWeightfEXT GLEW_GET_FUN(__glewVertexWeightfEXT) -#define glVertexWeightfvEXT GLEW_GET_FUN(__glewVertexWeightfvEXT) - -#define GLEW_EXT_vertex_weighting GLEW_GET_VAR(__GLEW_EXT_vertex_weighting) - -#endif /* GL_EXT_vertex_weighting */ - -/* ------------------------- GL_EXT_x11_sync_object ------------------------ */ - -#ifndef GL_EXT_x11_sync_object -#define GL_EXT_x11_sync_object 1 - -#define GL_SYNC_X11_FENCE_EXT 0x90E1 - -typedef GLsync (GLAPIENTRY * PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); - -#define glImportSyncEXT GLEW_GET_FUN(__glewImportSyncEXT) - -#define GLEW_EXT_x11_sync_object GLEW_GET_VAR(__GLEW_EXT_x11_sync_object) - -#endif /* GL_EXT_x11_sync_object */ - -/* ---------------------- GL_GREMEDY_frame_terminator ---------------------- */ - -#ifndef GL_GREMEDY_frame_terminator -#define GL_GREMEDY_frame_terminator 1 - -typedef void (GLAPIENTRY * PFNGLFRAMETERMINATORGREMEDYPROC) (void); - -#define glFrameTerminatorGREMEDY GLEW_GET_FUN(__glewFrameTerminatorGREMEDY) - -#define GLEW_GREMEDY_frame_terminator GLEW_GET_VAR(__GLEW_GREMEDY_frame_terminator) - -#endif /* GL_GREMEDY_frame_terminator */ - -/* ------------------------ GL_GREMEDY_string_marker ----------------------- */ - -#ifndef GL_GREMEDY_string_marker -#define GL_GREMEDY_string_marker 1 - -typedef void (GLAPIENTRY * PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const void *string); - -#define glStringMarkerGREMEDY GLEW_GET_FUN(__glewStringMarkerGREMEDY) - -#define GLEW_GREMEDY_string_marker GLEW_GET_VAR(__GLEW_GREMEDY_string_marker) - -#endif /* GL_GREMEDY_string_marker */ - -/* --------------------- GL_HP_convolution_border_modes -------------------- */ - -#ifndef GL_HP_convolution_border_modes -#define GL_HP_convolution_border_modes 1 - -#define GLEW_HP_convolution_border_modes GLEW_GET_VAR(__GLEW_HP_convolution_border_modes) - -#endif /* GL_HP_convolution_border_modes */ - -/* ------------------------- GL_HP_image_transform ------------------------- */ - -#ifndef GL_HP_image_transform -#define GL_HP_image_transform 1 - -typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, const GLfloat param); -typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, const GLint param); -typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); - -#define glGetImageTransformParameterfvHP GLEW_GET_FUN(__glewGetImageTransformParameterfvHP) -#define glGetImageTransformParameterivHP GLEW_GET_FUN(__glewGetImageTransformParameterivHP) -#define glImageTransformParameterfHP GLEW_GET_FUN(__glewImageTransformParameterfHP) -#define glImageTransformParameterfvHP GLEW_GET_FUN(__glewImageTransformParameterfvHP) -#define glImageTransformParameteriHP GLEW_GET_FUN(__glewImageTransformParameteriHP) -#define glImageTransformParameterivHP GLEW_GET_FUN(__glewImageTransformParameterivHP) - -#define GLEW_HP_image_transform GLEW_GET_VAR(__GLEW_HP_image_transform) - -#endif /* GL_HP_image_transform */ - -/* -------------------------- GL_HP_occlusion_test ------------------------- */ - -#ifndef GL_HP_occlusion_test -#define GL_HP_occlusion_test 1 - -#define GLEW_HP_occlusion_test GLEW_GET_VAR(__GLEW_HP_occlusion_test) - -#endif /* GL_HP_occlusion_test */ - -/* ------------------------- GL_HP_texture_lighting ------------------------ */ - -#ifndef GL_HP_texture_lighting -#define GL_HP_texture_lighting 1 - -#define GLEW_HP_texture_lighting GLEW_GET_VAR(__GLEW_HP_texture_lighting) - -#endif /* GL_HP_texture_lighting */ - -/* --------------------------- GL_IBM_cull_vertex -------------------------- */ - -#ifndef GL_IBM_cull_vertex -#define GL_IBM_cull_vertex 1 - -#define GL_CULL_VERTEX_IBM 103050 - -#define GLEW_IBM_cull_vertex GLEW_GET_VAR(__GLEW_IBM_cull_vertex) - -#endif /* GL_IBM_cull_vertex */ - -/* ---------------------- GL_IBM_multimode_draw_arrays --------------------- */ - -#ifndef GL_IBM_multimode_draw_arrays -#define GL_IBM_multimode_draw_arrays 1 - -typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum* mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); -typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum* mode, const GLsizei *count, GLenum type, const void *const *indices, GLsizei primcount, GLint modestride); - -#define glMultiModeDrawArraysIBM GLEW_GET_FUN(__glewMultiModeDrawArraysIBM) -#define glMultiModeDrawElementsIBM GLEW_GET_FUN(__glewMultiModeDrawElementsIBM) - -#define GLEW_IBM_multimode_draw_arrays GLEW_GET_VAR(__GLEW_IBM_multimode_draw_arrays) - -#endif /* GL_IBM_multimode_draw_arrays */ - -/* ------------------------- GL_IBM_rasterpos_clip ------------------------- */ - -#ifndef GL_IBM_rasterpos_clip -#define GL_IBM_rasterpos_clip 1 - -#define GL_RASTER_POSITION_UNCLIPPED_IBM 103010 - -#define GLEW_IBM_rasterpos_clip GLEW_GET_VAR(__GLEW_IBM_rasterpos_clip) - -#endif /* GL_IBM_rasterpos_clip */ - -/* --------------------------- GL_IBM_static_data -------------------------- */ - -#ifndef GL_IBM_static_data -#define GL_IBM_static_data 1 - -#define GL_ALL_STATIC_DATA_IBM 103060 -#define GL_STATIC_VERTEX_ARRAY_IBM 103061 - -#define GLEW_IBM_static_data GLEW_GET_VAR(__GLEW_IBM_static_data) - -#endif /* GL_IBM_static_data */ - -/* --------------------- GL_IBM_texture_mirrored_repeat -------------------- */ - -#ifndef GL_IBM_texture_mirrored_repeat -#define GL_IBM_texture_mirrored_repeat 1 - -#define GL_MIRRORED_REPEAT_IBM 0x8370 - -#define GLEW_IBM_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_IBM_texture_mirrored_repeat) - -#endif /* GL_IBM_texture_mirrored_repeat */ - -/* ----------------------- GL_IBM_vertex_array_lists ----------------------- */ - -#ifndef GL_IBM_vertex_array_lists -#define GL_IBM_vertex_array_lists 1 - -#define GL_VERTEX_ARRAY_LIST_IBM 103070 -#define GL_NORMAL_ARRAY_LIST_IBM 103071 -#define GL_COLOR_ARRAY_LIST_IBM 103072 -#define GL_INDEX_ARRAY_LIST_IBM 103073 -#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 -#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 -#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 -#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 -#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 -#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 -#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 -#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 -#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 -#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 -#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 -#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 - -typedef void (GLAPIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); -typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean ** pointer, GLint ptrstride); -typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void** pointer, GLint ptrstride); -typedef void (GLAPIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void** pointer, GLint ptrstride); -typedef void (GLAPIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void** pointer, GLint ptrstride); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); -typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); -typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); - -#define glColorPointerListIBM GLEW_GET_FUN(__glewColorPointerListIBM) -#define glEdgeFlagPointerListIBM GLEW_GET_FUN(__glewEdgeFlagPointerListIBM) -#define glFogCoordPointerListIBM GLEW_GET_FUN(__glewFogCoordPointerListIBM) -#define glIndexPointerListIBM GLEW_GET_FUN(__glewIndexPointerListIBM) -#define glNormalPointerListIBM GLEW_GET_FUN(__glewNormalPointerListIBM) -#define glSecondaryColorPointerListIBM GLEW_GET_FUN(__glewSecondaryColorPointerListIBM) -#define glTexCoordPointerListIBM GLEW_GET_FUN(__glewTexCoordPointerListIBM) -#define glVertexPointerListIBM GLEW_GET_FUN(__glewVertexPointerListIBM) - -#define GLEW_IBM_vertex_array_lists GLEW_GET_VAR(__GLEW_IBM_vertex_array_lists) - -#endif /* GL_IBM_vertex_array_lists */ - -/* -------------------------- GL_INGR_color_clamp -------------------------- */ - -#ifndef GL_INGR_color_clamp -#define GL_INGR_color_clamp 1 - -#define GL_RED_MIN_CLAMP_INGR 0x8560 -#define GL_GREEN_MIN_CLAMP_INGR 0x8561 -#define GL_BLUE_MIN_CLAMP_INGR 0x8562 -#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 -#define GL_RED_MAX_CLAMP_INGR 0x8564 -#define GL_GREEN_MAX_CLAMP_INGR 0x8565 -#define GL_BLUE_MAX_CLAMP_INGR 0x8566 -#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 - -#define GLEW_INGR_color_clamp GLEW_GET_VAR(__GLEW_INGR_color_clamp) - -#endif /* GL_INGR_color_clamp */ - -/* ------------------------- GL_INGR_interlace_read ------------------------ */ - -#ifndef GL_INGR_interlace_read -#define GL_INGR_interlace_read 1 - -#define GL_INTERLACE_READ_INGR 0x8568 - -#define GLEW_INGR_interlace_read GLEW_GET_VAR(__GLEW_INGR_interlace_read) - -#endif /* GL_INGR_interlace_read */ - -/* ------------------- GL_INTEL_fragment_shader_ordering ------------------- */ - -#ifndef GL_INTEL_fragment_shader_ordering -#define GL_INTEL_fragment_shader_ordering 1 - -#define GLEW_INTEL_fragment_shader_ordering GLEW_GET_VAR(__GLEW_INTEL_fragment_shader_ordering) - -#endif /* GL_INTEL_fragment_shader_ordering */ - -/* ----------------------- GL_INTEL_framebuffer_CMAA ----------------------- */ - -#ifndef GL_INTEL_framebuffer_CMAA -#define GL_INTEL_framebuffer_CMAA 1 - -#define GLEW_INTEL_framebuffer_CMAA GLEW_GET_VAR(__GLEW_INTEL_framebuffer_CMAA) - -#endif /* GL_INTEL_framebuffer_CMAA */ - -/* -------------------------- GL_INTEL_map_texture ------------------------- */ - -#ifndef GL_INTEL_map_texture -#define GL_INTEL_map_texture 1 - -#define GL_LAYOUT_DEFAULT_INTEL 0 -#define GL_LAYOUT_LINEAR_INTEL 1 -#define GL_LAYOUT_LINEAR_CPU_CACHED_INTEL 2 -#define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF - -typedef void * (GLAPIENTRY * PFNGLMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level, GLbitfield access, GLint* stride, GLenum *layout); -typedef void (GLAPIENTRY * PFNGLSYNCTEXTUREINTELPROC) (GLuint texture); -typedef void (GLAPIENTRY * PFNGLUNMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level); - -#define glMapTexture2DINTEL GLEW_GET_FUN(__glewMapTexture2DINTEL) -#define glSyncTextureINTEL GLEW_GET_FUN(__glewSyncTextureINTEL) -#define glUnmapTexture2DINTEL GLEW_GET_FUN(__glewUnmapTexture2DINTEL) - -#define GLEW_INTEL_map_texture GLEW_GET_VAR(__GLEW_INTEL_map_texture) - -#endif /* GL_INTEL_map_texture */ - -/* ------------------------ GL_INTEL_parallel_arrays ----------------------- */ - -#ifndef GL_INTEL_parallel_arrays -#define GL_INTEL_parallel_arrays 1 - -#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 -#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 -#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 -#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 -#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 - -typedef void (GLAPIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); -typedef void (GLAPIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void** pointer); -typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); -typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); - -#define glColorPointervINTEL GLEW_GET_FUN(__glewColorPointervINTEL) -#define glNormalPointervINTEL GLEW_GET_FUN(__glewNormalPointervINTEL) -#define glTexCoordPointervINTEL GLEW_GET_FUN(__glewTexCoordPointervINTEL) -#define glVertexPointervINTEL GLEW_GET_FUN(__glewVertexPointervINTEL) - -#define GLEW_INTEL_parallel_arrays GLEW_GET_VAR(__GLEW_INTEL_parallel_arrays) - -#endif /* GL_INTEL_parallel_arrays */ - -/* ----------------------- GL_INTEL_performance_query ---------------------- */ - -#ifndef GL_INTEL_performance_query -#define GL_INTEL_performance_query 1 - -#define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x0000 -#define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x0001 -#define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9 -#define GL_PERFQUERY_FLUSH_INTEL 0x83FA -#define GL_PERFQUERY_WAIT_INTEL 0x83FB -#define GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0 -#define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1 -#define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2 -#define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3 -#define GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4 -#define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5 -#define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8 -#define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9 -#define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA -#define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB -#define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC -#define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD -#define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE -#define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF -#define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500 - -typedef void (GLAPIENTRY * PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle); -typedef void (GLAPIENTRY * PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint* queryHandle); -typedef void (GLAPIENTRY * PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle); -typedef void (GLAPIENTRY * PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle); -typedef void (GLAPIENTRY * PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint* queryId); -typedef void (GLAPIENTRY * PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint* nextQueryId); -typedef void (GLAPIENTRY * PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar* counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); -typedef void (GLAPIENTRY * PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten); -typedef void (GLAPIENTRY * PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar* queryName, GLuint *queryId); -typedef void (GLAPIENTRY * PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar* queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); - -#define glBeginPerfQueryINTEL GLEW_GET_FUN(__glewBeginPerfQueryINTEL) -#define glCreatePerfQueryINTEL GLEW_GET_FUN(__glewCreatePerfQueryINTEL) -#define glDeletePerfQueryINTEL GLEW_GET_FUN(__glewDeletePerfQueryINTEL) -#define glEndPerfQueryINTEL GLEW_GET_FUN(__glewEndPerfQueryINTEL) -#define glGetFirstPerfQueryIdINTEL GLEW_GET_FUN(__glewGetFirstPerfQueryIdINTEL) -#define glGetNextPerfQueryIdINTEL GLEW_GET_FUN(__glewGetNextPerfQueryIdINTEL) -#define glGetPerfCounterInfoINTEL GLEW_GET_FUN(__glewGetPerfCounterInfoINTEL) -#define glGetPerfQueryDataINTEL GLEW_GET_FUN(__glewGetPerfQueryDataINTEL) -#define glGetPerfQueryIdByNameINTEL GLEW_GET_FUN(__glewGetPerfQueryIdByNameINTEL) -#define glGetPerfQueryInfoINTEL GLEW_GET_FUN(__glewGetPerfQueryInfoINTEL) - -#define GLEW_INTEL_performance_query GLEW_GET_VAR(__GLEW_INTEL_performance_query) - -#endif /* GL_INTEL_performance_query */ - -/* ------------------------ GL_INTEL_texture_scissor ----------------------- */ - -#ifndef GL_INTEL_texture_scissor -#define GL_INTEL_texture_scissor 1 - -typedef void (GLAPIENTRY * PFNGLTEXSCISSORFUNCINTELPROC) (GLenum target, GLenum lfunc, GLenum hfunc); -typedef void (GLAPIENTRY * PFNGLTEXSCISSORINTELPROC) (GLenum target, GLclampf tlow, GLclampf thigh); - -#define glTexScissorFuncINTEL GLEW_GET_FUN(__glewTexScissorFuncINTEL) -#define glTexScissorINTEL GLEW_GET_FUN(__glewTexScissorINTEL) - -#define GLEW_INTEL_texture_scissor GLEW_GET_VAR(__GLEW_INTEL_texture_scissor) - -#endif /* GL_INTEL_texture_scissor */ - -/* --------------------- GL_KHR_blend_equation_advanced -------------------- */ - -#ifndef GL_KHR_blend_equation_advanced -#define GL_KHR_blend_equation_advanced 1 - -#define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285 -#define GL_MULTIPLY_KHR 0x9294 -#define GL_SCREEN_KHR 0x9295 -#define GL_OVERLAY_KHR 0x9296 -#define GL_DARKEN_KHR 0x9297 -#define GL_LIGHTEN_KHR 0x9298 -#define GL_COLORDODGE_KHR 0x9299 -#define GL_COLORBURN_KHR 0x929A -#define GL_HARDLIGHT_KHR 0x929B -#define GL_SOFTLIGHT_KHR 0x929C -#define GL_DIFFERENCE_KHR 0x929E -#define GL_EXCLUSION_KHR 0x92A0 -#define GL_HSL_HUE_KHR 0x92AD -#define GL_HSL_SATURATION_KHR 0x92AE -#define GL_HSL_COLOR_KHR 0x92AF -#define GL_HSL_LUMINOSITY_KHR 0x92B0 - -typedef void (GLAPIENTRY * PFNGLBLENDBARRIERKHRPROC) (void); - -#define glBlendBarrierKHR GLEW_GET_FUN(__glewBlendBarrierKHR) - -#define GLEW_KHR_blend_equation_advanced GLEW_GET_VAR(__GLEW_KHR_blend_equation_advanced) - -#endif /* GL_KHR_blend_equation_advanced */ - -/* ---------------- GL_KHR_blend_equation_advanced_coherent ---------------- */ - -#ifndef GL_KHR_blend_equation_advanced_coherent -#define GL_KHR_blend_equation_advanced_coherent 1 - -#define GLEW_KHR_blend_equation_advanced_coherent GLEW_GET_VAR(__GLEW_KHR_blend_equation_advanced_coherent) - -#endif /* GL_KHR_blend_equation_advanced_coherent */ - -/* ---------------------- GL_KHR_context_flush_control --------------------- */ - -#ifndef GL_KHR_context_flush_control -#define GL_KHR_context_flush_control 1 - -#define GL_CONTEXT_RELEASE_BEHAVIOR 0x82FB -#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82FC - -#define GLEW_KHR_context_flush_control GLEW_GET_VAR(__GLEW_KHR_context_flush_control) - -#endif /* GL_KHR_context_flush_control */ - -/* ------------------------------ GL_KHR_debug ----------------------------- */ - -#ifndef GL_KHR_debug -#define GL_KHR_debug 1 - -#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 -#define GL_STACK_OVERFLOW 0x0503 -#define GL_STACK_UNDERFLOW 0x0504 -#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 -#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 -#define GL_DEBUG_CALLBACK_FUNCTION 0x8244 -#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245 -#define GL_DEBUG_SOURCE_API 0x8246 -#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 -#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 -#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 -#define GL_DEBUG_SOURCE_APPLICATION 0x824A -#define GL_DEBUG_SOURCE_OTHER 0x824B -#define GL_DEBUG_TYPE_ERROR 0x824C -#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D -#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E -#define GL_DEBUG_TYPE_PORTABILITY 0x824F -#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 -#define GL_DEBUG_TYPE_OTHER 0x8251 -#define GL_DEBUG_TYPE_MARKER 0x8268 -#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 -#define GL_DEBUG_TYPE_POP_GROUP 0x826A -#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B -#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C -#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D -#define GL_BUFFER 0x82E0 -#define GL_SHADER 0x82E1 -#define GL_PROGRAM 0x82E2 -#define GL_QUERY 0x82E3 -#define GL_PROGRAM_PIPELINE 0x82E4 -#define GL_SAMPLER 0x82E6 -#define GL_DISPLAY_LIST 0x82E7 -#define GL_MAX_LABEL_LENGTH 0x82E8 -#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 -#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 -#define GL_DEBUG_LOGGED_MESSAGES 0x9145 -#define GL_DEBUG_SEVERITY_HIGH 0x9146 -#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 -#define GL_DEBUG_SEVERITY_LOW 0x9148 -#define GL_DEBUG_OUTPUT 0x92E0 - -typedef void (GLAPIENTRY *GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam); - -typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam); -typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); -typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); -typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); -typedef void (GLAPIENTRY * PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar *label); -typedef void (GLAPIENTRY * PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei* length, GLchar *label); -typedef void (GLAPIENTRY * PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar* label); -typedef void (GLAPIENTRY * PFNGLOBJECTPTRLABELPROC) (const void *ptr, GLsizei length, const GLchar* label); -typedef void (GLAPIENTRY * PFNGLPOPDEBUGGROUPPROC) (void); -typedef void (GLAPIENTRY * PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar * message); - -#define glDebugMessageCallback GLEW_GET_FUN(__glewDebugMessageCallback) -#define glDebugMessageControl GLEW_GET_FUN(__glewDebugMessageControl) -#define glDebugMessageInsert GLEW_GET_FUN(__glewDebugMessageInsert) -#define glGetDebugMessageLog GLEW_GET_FUN(__glewGetDebugMessageLog) -#define glGetObjectLabel GLEW_GET_FUN(__glewGetObjectLabel) -#define glGetObjectPtrLabel GLEW_GET_FUN(__glewGetObjectPtrLabel) -#define glObjectLabel GLEW_GET_FUN(__glewObjectLabel) -#define glObjectPtrLabel GLEW_GET_FUN(__glewObjectPtrLabel) -#define glPopDebugGroup GLEW_GET_FUN(__glewPopDebugGroup) -#define glPushDebugGroup GLEW_GET_FUN(__glewPushDebugGroup) - -#define GLEW_KHR_debug GLEW_GET_VAR(__GLEW_KHR_debug) - -#endif /* GL_KHR_debug */ - -/* ---------------------------- GL_KHR_no_error ---------------------------- */ - -#ifndef GL_KHR_no_error -#define GL_KHR_no_error 1 - -#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 - -#define GLEW_KHR_no_error GLEW_GET_VAR(__GLEW_KHR_no_error) - -#endif /* GL_KHR_no_error */ - -/* ------------------ GL_KHR_robust_buffer_access_behavior ----------------- */ - -#ifndef GL_KHR_robust_buffer_access_behavior -#define GL_KHR_robust_buffer_access_behavior 1 - -#define GLEW_KHR_robust_buffer_access_behavior GLEW_GET_VAR(__GLEW_KHR_robust_buffer_access_behavior) - -#endif /* GL_KHR_robust_buffer_access_behavior */ - -/* --------------------------- GL_KHR_robustness --------------------------- */ - -#ifndef GL_KHR_robustness -#define GL_KHR_robustness 1 - -#define GL_CONTEXT_LOST 0x0507 -#define GL_LOSE_CONTEXT_ON_RESET 0x8252 -#define GL_GUILTY_CONTEXT_RESET 0x8253 -#define GL_INNOCENT_CONTEXT_RESET 0x8254 -#define GL_UNKNOWN_CONTEXT_RESET 0x8255 -#define GL_RESET_NOTIFICATION_STRATEGY 0x8256 -#define GL_NO_RESET_NOTIFICATION 0x8261 -#define GL_CONTEXT_ROBUST_ACCESS 0x90F3 - -typedef void (GLAPIENTRY * PFNGLGETNUNIFORMFVPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETNUNIFORMIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint* params); -typedef void (GLAPIENTRY * PFNGLREADNPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); - -#define glGetnUniformfv GLEW_GET_FUN(__glewGetnUniformfv) -#define glGetnUniformiv GLEW_GET_FUN(__glewGetnUniformiv) -#define glGetnUniformuiv GLEW_GET_FUN(__glewGetnUniformuiv) -#define glReadnPixels GLEW_GET_FUN(__glewReadnPixels) - -#define GLEW_KHR_robustness GLEW_GET_VAR(__GLEW_KHR_robustness) - -#endif /* GL_KHR_robustness */ - -/* ------------------ GL_KHR_texture_compression_astc_hdr ------------------ */ - -#ifndef GL_KHR_texture_compression_astc_hdr -#define GL_KHR_texture_compression_astc_hdr 1 - -#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 -#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 -#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 -#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 -#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 -#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 -#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 -#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 -#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 -#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 -#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA -#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB -#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC -#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD - -#define GLEW_KHR_texture_compression_astc_hdr GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_hdr) - -#endif /* GL_KHR_texture_compression_astc_hdr */ - -/* ------------------ GL_KHR_texture_compression_astc_ldr ------------------ */ - -#ifndef GL_KHR_texture_compression_astc_ldr -#define GL_KHR_texture_compression_astc_ldr 1 - -#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 -#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 -#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 -#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 -#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 -#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 -#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 -#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 -#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 -#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 -#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA -#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB -#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC -#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC -#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD - -#define GLEW_KHR_texture_compression_astc_ldr GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_ldr) - -#endif /* GL_KHR_texture_compression_astc_ldr */ - -/* -------------------------- GL_KTX_buffer_region ------------------------- */ - -#ifndef GL_KTX_buffer_region -#define GL_KTX_buffer_region 1 - -#define GL_KTX_FRONT_REGION 0x0 -#define GL_KTX_BACK_REGION 0x1 -#define GL_KTX_Z_REGION 0x2 -#define GL_KTX_STENCIL_REGION 0x3 - -typedef GLuint (GLAPIENTRY * PFNGLBUFFERREGIONENABLEDPROC) (void); -typedef void (GLAPIENTRY * PFNGLDELETEBUFFERREGIONPROC) (GLenum region); -typedef void (GLAPIENTRY * PFNGLDRAWBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest); -typedef GLuint (GLAPIENTRY * PFNGLNEWBUFFERREGIONPROC) (GLenum region); -typedef void (GLAPIENTRY * PFNGLREADBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height); - -#define glBufferRegionEnabled GLEW_GET_FUN(__glewBufferRegionEnabled) -#define glDeleteBufferRegion GLEW_GET_FUN(__glewDeleteBufferRegion) -#define glDrawBufferRegion GLEW_GET_FUN(__glewDrawBufferRegion) -#define glNewBufferRegion GLEW_GET_FUN(__glewNewBufferRegion) -#define glReadBufferRegion GLEW_GET_FUN(__glewReadBufferRegion) - -#define GLEW_KTX_buffer_region GLEW_GET_VAR(__GLEW_KTX_buffer_region) - -#endif /* GL_KTX_buffer_region */ - -/* ------------------------- GL_MESAX_texture_stack ------------------------ */ - -#ifndef GL_MESAX_texture_stack -#define GL_MESAX_texture_stack 1 - -#define GL_TEXTURE_1D_STACK_MESAX 0x8759 -#define GL_TEXTURE_2D_STACK_MESAX 0x875A -#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B -#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C -#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D -#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E - -#define GLEW_MESAX_texture_stack GLEW_GET_VAR(__GLEW_MESAX_texture_stack) - -#endif /* GL_MESAX_texture_stack */ - -/* -------------------------- GL_MESA_pack_invert -------------------------- */ - -#ifndef GL_MESA_pack_invert -#define GL_MESA_pack_invert 1 - -#define GL_PACK_INVERT_MESA 0x8758 - -#define GLEW_MESA_pack_invert GLEW_GET_VAR(__GLEW_MESA_pack_invert) - -#endif /* GL_MESA_pack_invert */ - -/* ------------------------- GL_MESA_resize_buffers ------------------------ */ - -#ifndef GL_MESA_resize_buffers -#define GL_MESA_resize_buffers 1 - -typedef void (GLAPIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void); - -#define glResizeBuffersMESA GLEW_GET_FUN(__glewResizeBuffersMESA) - -#define GLEW_MESA_resize_buffers GLEW_GET_VAR(__GLEW_MESA_resize_buffers) - -#endif /* GL_MESA_resize_buffers */ - -/* --------------------------- GL_MESA_window_pos -------------------------- */ - -#ifndef GL_MESA_window_pos -#define GL_MESA_window_pos 1 - -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint* p); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort* p); - -#define glWindowPos2dMESA GLEW_GET_FUN(__glewWindowPos2dMESA) -#define glWindowPos2dvMESA GLEW_GET_FUN(__glewWindowPos2dvMESA) -#define glWindowPos2fMESA GLEW_GET_FUN(__glewWindowPos2fMESA) -#define glWindowPos2fvMESA GLEW_GET_FUN(__glewWindowPos2fvMESA) -#define glWindowPos2iMESA GLEW_GET_FUN(__glewWindowPos2iMESA) -#define glWindowPos2ivMESA GLEW_GET_FUN(__glewWindowPos2ivMESA) -#define glWindowPos2sMESA GLEW_GET_FUN(__glewWindowPos2sMESA) -#define glWindowPos2svMESA GLEW_GET_FUN(__glewWindowPos2svMESA) -#define glWindowPos3dMESA GLEW_GET_FUN(__glewWindowPos3dMESA) -#define glWindowPos3dvMESA GLEW_GET_FUN(__glewWindowPos3dvMESA) -#define glWindowPos3fMESA GLEW_GET_FUN(__glewWindowPos3fMESA) -#define glWindowPos3fvMESA GLEW_GET_FUN(__glewWindowPos3fvMESA) -#define glWindowPos3iMESA GLEW_GET_FUN(__glewWindowPos3iMESA) -#define glWindowPos3ivMESA GLEW_GET_FUN(__glewWindowPos3ivMESA) -#define glWindowPos3sMESA GLEW_GET_FUN(__glewWindowPos3sMESA) -#define glWindowPos3svMESA GLEW_GET_FUN(__glewWindowPos3svMESA) -#define glWindowPos4dMESA GLEW_GET_FUN(__glewWindowPos4dMESA) -#define glWindowPos4dvMESA GLEW_GET_FUN(__glewWindowPos4dvMESA) -#define glWindowPos4fMESA GLEW_GET_FUN(__glewWindowPos4fMESA) -#define glWindowPos4fvMESA GLEW_GET_FUN(__glewWindowPos4fvMESA) -#define glWindowPos4iMESA GLEW_GET_FUN(__glewWindowPos4iMESA) -#define glWindowPos4ivMESA GLEW_GET_FUN(__glewWindowPos4ivMESA) -#define glWindowPos4sMESA GLEW_GET_FUN(__glewWindowPos4sMESA) -#define glWindowPos4svMESA GLEW_GET_FUN(__glewWindowPos4svMESA) - -#define GLEW_MESA_window_pos GLEW_GET_VAR(__GLEW_MESA_window_pos) - -#endif /* GL_MESA_window_pos */ - -/* ------------------------- GL_MESA_ycbcr_texture ------------------------- */ - -#ifndef GL_MESA_ycbcr_texture -#define GL_MESA_ycbcr_texture 1 - -#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB -#define GL_YCBCR_MESA 0x8757 - -#define GLEW_MESA_ycbcr_texture GLEW_GET_VAR(__GLEW_MESA_ycbcr_texture) - -#endif /* GL_MESA_ycbcr_texture */ - -/* ----------------------- GL_NVX_conditional_render ----------------------- */ - -#ifndef GL_NVX_conditional_render -#define GL_NVX_conditional_render 1 - -typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVXPROC) (GLuint id); -typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVXPROC) (void); - -#define glBeginConditionalRenderNVX GLEW_GET_FUN(__glewBeginConditionalRenderNVX) -#define glEndConditionalRenderNVX GLEW_GET_FUN(__glewEndConditionalRenderNVX) - -#define GLEW_NVX_conditional_render GLEW_GET_VAR(__GLEW_NVX_conditional_render) - -#endif /* GL_NVX_conditional_render */ - -/* ------------------------- GL_NVX_gpu_memory_info ------------------------ */ - -#ifndef GL_NVX_gpu_memory_info -#define GL_NVX_gpu_memory_info 1 - -#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 -#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 -#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 -#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A -#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B - -#define GLEW_NVX_gpu_memory_info GLEW_GET_VAR(__GLEW_NVX_gpu_memory_info) - -#endif /* GL_NVX_gpu_memory_info */ - -/* ------------------- GL_NV_bindless_multi_draw_indirect ------------------ */ - -#ifndef GL_NV_bindless_multi_draw_indirect -#define GL_NV_bindless_multi_draw_indirect 1 - -typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); -typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); - -#define glMultiDrawArraysIndirectBindlessNV GLEW_GET_FUN(__glewMultiDrawArraysIndirectBindlessNV) -#define glMultiDrawElementsIndirectBindlessNV GLEW_GET_FUN(__glewMultiDrawElementsIndirectBindlessNV) - -#define GLEW_NV_bindless_multi_draw_indirect GLEW_GET_VAR(__GLEW_NV_bindless_multi_draw_indirect) - -#endif /* GL_NV_bindless_multi_draw_indirect */ - -/* ---------------- GL_NV_bindless_multi_draw_indirect_count --------------- */ - -#ifndef GL_NV_bindless_multi_draw_indirect_count -#define GL_NV_bindless_multi_draw_indirect_count 1 - -typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, const void *indirect, GLintptr drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); -typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, GLenum type, const void *indirect, GLintptr drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); - -#define glMultiDrawArraysIndirectBindlessCountNV GLEW_GET_FUN(__glewMultiDrawArraysIndirectBindlessCountNV) -#define glMultiDrawElementsIndirectBindlessCountNV GLEW_GET_FUN(__glewMultiDrawElementsIndirectBindlessCountNV) - -#define GLEW_NV_bindless_multi_draw_indirect_count GLEW_GET_VAR(__GLEW_NV_bindless_multi_draw_indirect_count) - -#endif /* GL_NV_bindless_multi_draw_indirect_count */ - -/* ------------------------- GL_NV_bindless_texture ------------------------ */ - -#ifndef GL_NV_bindless_texture -#define GL_NV_bindless_texture 1 - -typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); -typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); -typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); -typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); -typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); -typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); -typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); -typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); -typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values); -typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); -typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64* value); - -#define glGetImageHandleNV GLEW_GET_FUN(__glewGetImageHandleNV) -#define glGetTextureHandleNV GLEW_GET_FUN(__glewGetTextureHandleNV) -#define glGetTextureSamplerHandleNV GLEW_GET_FUN(__glewGetTextureSamplerHandleNV) -#define glIsImageHandleResidentNV GLEW_GET_FUN(__glewIsImageHandleResidentNV) -#define glIsTextureHandleResidentNV GLEW_GET_FUN(__glewIsTextureHandleResidentNV) -#define glMakeImageHandleNonResidentNV GLEW_GET_FUN(__glewMakeImageHandleNonResidentNV) -#define glMakeImageHandleResidentNV GLEW_GET_FUN(__glewMakeImageHandleResidentNV) -#define glMakeTextureHandleNonResidentNV GLEW_GET_FUN(__glewMakeTextureHandleNonResidentNV) -#define glMakeTextureHandleResidentNV GLEW_GET_FUN(__glewMakeTextureHandleResidentNV) -#define glProgramUniformHandleui64NV GLEW_GET_FUN(__glewProgramUniformHandleui64NV) -#define glProgramUniformHandleui64vNV GLEW_GET_FUN(__glewProgramUniformHandleui64vNV) -#define glUniformHandleui64NV GLEW_GET_FUN(__glewUniformHandleui64NV) -#define glUniformHandleui64vNV GLEW_GET_FUN(__glewUniformHandleui64vNV) - -#define GLEW_NV_bindless_texture GLEW_GET_VAR(__GLEW_NV_bindless_texture) - -#endif /* GL_NV_bindless_texture */ - -/* --------------------- GL_NV_blend_equation_advanced --------------------- */ - -#ifndef GL_NV_blend_equation_advanced -#define GL_NV_blend_equation_advanced 1 - -#define GL_XOR_NV 0x1506 -#define GL_RED_NV 0x1903 -#define GL_GREEN_NV 0x1904 -#define GL_BLUE_NV 0x1905 -#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 -#define GL_BLEND_OVERLAP_NV 0x9281 -#define GL_UNCORRELATED_NV 0x9282 -#define GL_DISJOINT_NV 0x9283 -#define GL_CONJOINT_NV 0x9284 -#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 -#define GL_SRC_NV 0x9286 -#define GL_DST_NV 0x9287 -#define GL_SRC_OVER_NV 0x9288 -#define GL_DST_OVER_NV 0x9289 -#define GL_SRC_IN_NV 0x928A -#define GL_DST_IN_NV 0x928B -#define GL_SRC_OUT_NV 0x928C -#define GL_DST_OUT_NV 0x928D -#define GL_SRC_ATOP_NV 0x928E -#define GL_DST_ATOP_NV 0x928F -#define GL_PLUS_NV 0x9291 -#define GL_PLUS_DARKER_NV 0x9292 -#define GL_MULTIPLY_NV 0x9294 -#define GL_SCREEN_NV 0x9295 -#define GL_OVERLAY_NV 0x9296 -#define GL_DARKEN_NV 0x9297 -#define GL_LIGHTEN_NV 0x9298 -#define GL_COLORDODGE_NV 0x9299 -#define GL_COLORBURN_NV 0x929A -#define GL_HARDLIGHT_NV 0x929B -#define GL_SOFTLIGHT_NV 0x929C -#define GL_DIFFERENCE_NV 0x929E -#define GL_MINUS_NV 0x929F -#define GL_EXCLUSION_NV 0x92A0 -#define GL_CONTRAST_NV 0x92A1 -#define GL_INVERT_RGB_NV 0x92A3 -#define GL_LINEARDODGE_NV 0x92A4 -#define GL_LINEARBURN_NV 0x92A5 -#define GL_VIVIDLIGHT_NV 0x92A6 -#define GL_LINEARLIGHT_NV 0x92A7 -#define GL_PINLIGHT_NV 0x92A8 -#define GL_HARDMIX_NV 0x92A9 -#define GL_HSL_HUE_NV 0x92AD -#define GL_HSL_SATURATION_NV 0x92AE -#define GL_HSL_COLOR_NV 0x92AF -#define GL_HSL_LUMINOSITY_NV 0x92B0 -#define GL_PLUS_CLAMPED_NV 0x92B1 -#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2 -#define GL_MINUS_CLAMPED_NV 0x92B3 -#define GL_INVERT_OVG_NV 0x92B4 - -typedef void (GLAPIENTRY * PFNGLBLENDBARRIERNVPROC) (void); -typedef void (GLAPIENTRY * PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value); - -#define glBlendBarrierNV GLEW_GET_FUN(__glewBlendBarrierNV) -#define glBlendParameteriNV GLEW_GET_FUN(__glewBlendParameteriNV) - -#define GLEW_NV_blend_equation_advanced GLEW_GET_VAR(__GLEW_NV_blend_equation_advanced) - -#endif /* GL_NV_blend_equation_advanced */ - -/* ----------------- GL_NV_blend_equation_advanced_coherent ---------------- */ - -#ifndef GL_NV_blend_equation_advanced_coherent -#define GL_NV_blend_equation_advanced_coherent 1 - -#define GLEW_NV_blend_equation_advanced_coherent GLEW_GET_VAR(__GLEW_NV_blend_equation_advanced_coherent) - -#endif /* GL_NV_blend_equation_advanced_coherent */ - -/* --------------------------- GL_NV_blend_square -------------------------- */ - -#ifndef GL_NV_blend_square -#define GL_NV_blend_square 1 - -#define GLEW_NV_blend_square GLEW_GET_VAR(__GLEW_NV_blend_square) - -#endif /* GL_NV_blend_square */ - -/* ------------------------- GL_NV_compute_program5 ------------------------ */ - -#ifndef GL_NV_compute_program5 -#define GL_NV_compute_program5 1 - -#define GL_COMPUTE_PROGRAM_NV 0x90FB -#define GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV 0x90FC - -#define GLEW_NV_compute_program5 GLEW_GET_VAR(__GLEW_NV_compute_program5) - -#endif /* GL_NV_compute_program5 */ - -/* ------------------------ GL_NV_conditional_render ----------------------- */ - -#ifndef GL_NV_conditional_render -#define GL_NV_conditional_render 1 - -#define GL_QUERY_WAIT_NV 0x8E13 -#define GL_QUERY_NO_WAIT_NV 0x8E14 -#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 -#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 - -typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); -typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVPROC) (void); - -#define glBeginConditionalRenderNV GLEW_GET_FUN(__glewBeginConditionalRenderNV) -#define glEndConditionalRenderNV GLEW_GET_FUN(__glewEndConditionalRenderNV) - -#define GLEW_NV_conditional_render GLEW_GET_VAR(__GLEW_NV_conditional_render) - -#endif /* GL_NV_conditional_render */ - -/* ----------------------- GL_NV_conservative_raster ----------------------- */ - -#ifndef GL_NV_conservative_raster -#define GL_NV_conservative_raster 1 - -#define GL_CONSERVATIVE_RASTERIZATION_NV 0x9346 -#define GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV 0x9347 -#define GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV 0x9348 -#define GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV 0x9349 - -typedef void (GLAPIENTRY * PFNGLSUBPIXELPRECISIONBIASNVPROC) (GLuint xbits, GLuint ybits); - -#define glSubpixelPrecisionBiasNV GLEW_GET_FUN(__glewSubpixelPrecisionBiasNV) - -#define GLEW_NV_conservative_raster GLEW_GET_VAR(__GLEW_NV_conservative_raster) - -#endif /* GL_NV_conservative_raster */ - -/* -------------------- GL_NV_conservative_raster_dilate ------------------- */ - -#ifndef GL_NV_conservative_raster_dilate -#define GL_NV_conservative_raster_dilate 1 - -#define GL_CONSERVATIVE_RASTER_DILATE_NV 0x9379 -#define GL_CONSERVATIVE_RASTER_DILATE_RANGE_NV 0x937A -#define GL_CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV 0x937B - -typedef void (GLAPIENTRY * PFNGLCONSERVATIVERASTERPARAMETERFNVPROC) (GLenum pname, GLfloat value); - -#define glConservativeRasterParameterfNV GLEW_GET_FUN(__glewConservativeRasterParameterfNV) - -#define GLEW_NV_conservative_raster_dilate GLEW_GET_VAR(__GLEW_NV_conservative_raster_dilate) - -#endif /* GL_NV_conservative_raster_dilate */ - -/* ----------------------- GL_NV_copy_depth_to_color ----------------------- */ - -#ifndef GL_NV_copy_depth_to_color -#define GL_NV_copy_depth_to_color 1 - -#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E -#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F - -#define GLEW_NV_copy_depth_to_color GLEW_GET_VAR(__GLEW_NV_copy_depth_to_color) - -#endif /* GL_NV_copy_depth_to_color */ - -/* ---------------------------- GL_NV_copy_image --------------------------- */ - -#ifndef GL_NV_copy_image -#define GL_NV_copy_image 1 - -typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); - -#define glCopyImageSubDataNV GLEW_GET_FUN(__glewCopyImageSubDataNV) - -#define GLEW_NV_copy_image GLEW_GET_VAR(__GLEW_NV_copy_image) - -#endif /* GL_NV_copy_image */ - -/* -------------------------- GL_NV_deep_texture3D ------------------------- */ - -#ifndef GL_NV_deep_texture3D -#define GL_NV_deep_texture3D 1 - -#define GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV 0x90D0 -#define GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV 0x90D1 - -#define GLEW_NV_deep_texture3D GLEW_GET_VAR(__GLEW_NV_deep_texture3D) - -#endif /* GL_NV_deep_texture3D */ - -/* ------------------------ GL_NV_depth_buffer_float ----------------------- */ - -#ifndef GL_NV_depth_buffer_float -#define GL_NV_depth_buffer_float 1 - -#define GL_DEPTH_COMPONENT32F_NV 0x8DAB -#define GL_DEPTH32F_STENCIL8_NV 0x8DAC -#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD -#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF - -typedef void (GLAPIENTRY * PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); -typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); -typedef void (GLAPIENTRY * PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); - -#define glClearDepthdNV GLEW_GET_FUN(__glewClearDepthdNV) -#define glDepthBoundsdNV GLEW_GET_FUN(__glewDepthBoundsdNV) -#define glDepthRangedNV GLEW_GET_FUN(__glewDepthRangedNV) - -#define GLEW_NV_depth_buffer_float GLEW_GET_VAR(__GLEW_NV_depth_buffer_float) - -#endif /* GL_NV_depth_buffer_float */ - -/* --------------------------- GL_NV_depth_clamp --------------------------- */ - -#ifndef GL_NV_depth_clamp -#define GL_NV_depth_clamp 1 - -#define GL_DEPTH_CLAMP_NV 0x864F - -#define GLEW_NV_depth_clamp GLEW_GET_VAR(__GLEW_NV_depth_clamp) - -#endif /* GL_NV_depth_clamp */ - -/* ---------------------- GL_NV_depth_range_unclamped ---------------------- */ - -#ifndef GL_NV_depth_range_unclamped -#define GL_NV_depth_range_unclamped 1 - -#define GL_SAMPLE_COUNT_BITS_NV 0x8864 -#define GL_CURRENT_SAMPLE_COUNT_QUERY_NV 0x8865 -#define GL_QUERY_RESULT_NV 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_NV 0x8867 -#define GL_SAMPLE_COUNT_NV 0x8914 - -#define GLEW_NV_depth_range_unclamped GLEW_GET_VAR(__GLEW_NV_depth_range_unclamped) - -#endif /* GL_NV_depth_range_unclamped */ - -/* --------------------------- GL_NV_draw_texture -------------------------- */ - -#ifndef GL_NV_draw_texture -#define GL_NV_draw_texture 1 - -typedef void (GLAPIENTRY * PFNGLDRAWTEXTURENVPROC) (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); - -#define glDrawTextureNV GLEW_GET_FUN(__glewDrawTextureNV) - -#define GLEW_NV_draw_texture GLEW_GET_VAR(__GLEW_NV_draw_texture) - -#endif /* GL_NV_draw_texture */ - -/* ---------------------------- GL_NV_evaluators --------------------------- */ - -#ifndef GL_NV_evaluators -#define GL_NV_evaluators 1 - -#define GL_EVAL_2D_NV 0x86C0 -#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 -#define GL_MAP_TESSELLATION_NV 0x86C2 -#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 -#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 -#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 -#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 -#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 -#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 -#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 -#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA -#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB -#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC -#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD -#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE -#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF -#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 -#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 -#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 -#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 -#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 -#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 -#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 -#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 - -typedef void (GLAPIENTRY * PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); -typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void *points); -typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points); -typedef void (GLAPIENTRY * PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint* params); - -#define glEvalMapsNV GLEW_GET_FUN(__glewEvalMapsNV) -#define glGetMapAttribParameterfvNV GLEW_GET_FUN(__glewGetMapAttribParameterfvNV) -#define glGetMapAttribParameterivNV GLEW_GET_FUN(__glewGetMapAttribParameterivNV) -#define glGetMapControlPointsNV GLEW_GET_FUN(__glewGetMapControlPointsNV) -#define glGetMapParameterfvNV GLEW_GET_FUN(__glewGetMapParameterfvNV) -#define glGetMapParameterivNV GLEW_GET_FUN(__glewGetMapParameterivNV) -#define glMapControlPointsNV GLEW_GET_FUN(__glewMapControlPointsNV) -#define glMapParameterfvNV GLEW_GET_FUN(__glewMapParameterfvNV) -#define glMapParameterivNV GLEW_GET_FUN(__glewMapParameterivNV) - -#define GLEW_NV_evaluators GLEW_GET_VAR(__GLEW_NV_evaluators) - -#endif /* GL_NV_evaluators */ - -/* ----------------------- GL_NV_explicit_multisample ---------------------- */ - -#ifndef GL_NV_explicit_multisample -#define GL_NV_explicit_multisample 1 - -#define GL_SAMPLE_POSITION_NV 0x8E50 -#define GL_SAMPLE_MASK_NV 0x8E51 -#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 -#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 -#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 -#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 -#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 -#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 -#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 -#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 - -typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat* val); -typedef void (GLAPIENTRY * PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); -typedef void (GLAPIENTRY * PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); - -#define glGetMultisamplefvNV GLEW_GET_FUN(__glewGetMultisamplefvNV) -#define glSampleMaskIndexedNV GLEW_GET_FUN(__glewSampleMaskIndexedNV) -#define glTexRenderbufferNV GLEW_GET_FUN(__glewTexRenderbufferNV) - -#define GLEW_NV_explicit_multisample GLEW_GET_VAR(__GLEW_NV_explicit_multisample) - -#endif /* GL_NV_explicit_multisample */ - -/* ------------------------------ GL_NV_fence ------------------------------ */ - -#ifndef GL_NV_fence -#define GL_NV_fence 1 - -#define GL_ALL_COMPLETED_NV 0x84F2 -#define GL_FENCE_STATUS_NV 0x84F3 -#define GL_FENCE_CONDITION_NV 0x84F4 - -typedef void (GLAPIENTRY * PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint* fences); -typedef void (GLAPIENTRY * PFNGLFINISHFENCENVPROC) (GLuint fence); -typedef void (GLAPIENTRY * PFNGLGENFENCESNVPROC) (GLsizei n, GLuint* fences); -typedef void (GLAPIENTRY * PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint* params); -typedef GLboolean (GLAPIENTRY * PFNGLISFENCENVPROC) (GLuint fence); -typedef void (GLAPIENTRY * PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); -typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence); - -#define glDeleteFencesNV GLEW_GET_FUN(__glewDeleteFencesNV) -#define glFinishFenceNV GLEW_GET_FUN(__glewFinishFenceNV) -#define glGenFencesNV GLEW_GET_FUN(__glewGenFencesNV) -#define glGetFenceivNV GLEW_GET_FUN(__glewGetFenceivNV) -#define glIsFenceNV GLEW_GET_FUN(__glewIsFenceNV) -#define glSetFenceNV GLEW_GET_FUN(__glewSetFenceNV) -#define glTestFenceNV GLEW_GET_FUN(__glewTestFenceNV) - -#define GLEW_NV_fence GLEW_GET_VAR(__GLEW_NV_fence) - -#endif /* GL_NV_fence */ - -/* -------------------------- GL_NV_fill_rectangle ------------------------- */ - -#ifndef GL_NV_fill_rectangle -#define GL_NV_fill_rectangle 1 - -#define GL_FILL_RECTANGLE_NV 0x933C - -#define GLEW_NV_fill_rectangle GLEW_GET_VAR(__GLEW_NV_fill_rectangle) - -#endif /* GL_NV_fill_rectangle */ - -/* --------------------------- GL_NV_float_buffer -------------------------- */ - -#ifndef GL_NV_float_buffer -#define GL_NV_float_buffer 1 - -#define GL_FLOAT_R_NV 0x8880 -#define GL_FLOAT_RG_NV 0x8881 -#define GL_FLOAT_RGB_NV 0x8882 -#define GL_FLOAT_RGBA_NV 0x8883 -#define GL_FLOAT_R16_NV 0x8884 -#define GL_FLOAT_R32_NV 0x8885 -#define GL_FLOAT_RG16_NV 0x8886 -#define GL_FLOAT_RG32_NV 0x8887 -#define GL_FLOAT_RGB16_NV 0x8888 -#define GL_FLOAT_RGB32_NV 0x8889 -#define GL_FLOAT_RGBA16_NV 0x888A -#define GL_FLOAT_RGBA32_NV 0x888B -#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C -#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D -#define GL_FLOAT_RGBA_MODE_NV 0x888E - -#define GLEW_NV_float_buffer GLEW_GET_VAR(__GLEW_NV_float_buffer) - -#endif /* GL_NV_float_buffer */ - -/* --------------------------- GL_NV_fog_distance -------------------------- */ - -#ifndef GL_NV_fog_distance -#define GL_NV_fog_distance 1 - -#define GL_FOG_DISTANCE_MODE_NV 0x855A -#define GL_EYE_RADIAL_NV 0x855B -#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C - -#define GLEW_NV_fog_distance GLEW_GET_VAR(__GLEW_NV_fog_distance) - -#endif /* GL_NV_fog_distance */ - -/* -------------------- GL_NV_fragment_coverage_to_color ------------------- */ - -#ifndef GL_NV_fragment_coverage_to_color -#define GL_NV_fragment_coverage_to_color 1 - -#define GL_FRAGMENT_COVERAGE_TO_COLOR_NV 0x92DD -#define GL_FRAGMENT_COVERAGE_COLOR_NV 0x92DE - -typedef void (GLAPIENTRY * PFNGLFRAGMENTCOVERAGECOLORNVPROC) (GLuint color); - -#define glFragmentCoverageColorNV GLEW_GET_FUN(__glewFragmentCoverageColorNV) - -#define GLEW_NV_fragment_coverage_to_color GLEW_GET_VAR(__GLEW_NV_fragment_coverage_to_color) - -#endif /* GL_NV_fragment_coverage_to_color */ - -/* ------------------------- GL_NV_fragment_program ------------------------ */ - -#ifndef GL_NV_fragment_program -#define GL_NV_fragment_program 1 - -#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 -#define GL_FRAGMENT_PROGRAM_NV 0x8870 -#define GL_MAX_TEXTURE_COORDS_NV 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 -#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 -#define GL_PROGRAM_ERROR_STRING_NV 0x8874 - -typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble *params); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat *params); -typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLdouble v[]); -typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLfloat v[]); - -#define glGetProgramNamedParameterdvNV GLEW_GET_FUN(__glewGetProgramNamedParameterdvNV) -#define glGetProgramNamedParameterfvNV GLEW_GET_FUN(__glewGetProgramNamedParameterfvNV) -#define glProgramNamedParameter4dNV GLEW_GET_FUN(__glewProgramNamedParameter4dNV) -#define glProgramNamedParameter4dvNV GLEW_GET_FUN(__glewProgramNamedParameter4dvNV) -#define glProgramNamedParameter4fNV GLEW_GET_FUN(__glewProgramNamedParameter4fNV) -#define glProgramNamedParameter4fvNV GLEW_GET_FUN(__glewProgramNamedParameter4fvNV) - -#define GLEW_NV_fragment_program GLEW_GET_VAR(__GLEW_NV_fragment_program) - -#endif /* GL_NV_fragment_program */ - -/* ------------------------ GL_NV_fragment_program2 ------------------------ */ - -#ifndef GL_NV_fragment_program2 -#define GL_NV_fragment_program2 1 - -#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 -#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 -#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 -#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 -#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 - -#define GLEW_NV_fragment_program2 GLEW_GET_VAR(__GLEW_NV_fragment_program2) - -#endif /* GL_NV_fragment_program2 */ - -/* ------------------------ GL_NV_fragment_program4 ------------------------ */ - -#ifndef GL_NV_fragment_program4 -#define GL_NV_fragment_program4 1 - -#define GLEW_NV_fragment_program4 GLEW_GET_VAR(__GLEW_NV_fragment_program4) - -#endif /* GL_NV_fragment_program4 */ - -/* --------------------- GL_NV_fragment_program_option --------------------- */ - -#ifndef GL_NV_fragment_program_option -#define GL_NV_fragment_program_option 1 - -#define GLEW_NV_fragment_program_option GLEW_GET_VAR(__GLEW_NV_fragment_program_option) - -#endif /* GL_NV_fragment_program_option */ - -/* -------------------- GL_NV_fragment_shader_interlock -------------------- */ - -#ifndef GL_NV_fragment_shader_interlock -#define GL_NV_fragment_shader_interlock 1 - -#define GLEW_NV_fragment_shader_interlock GLEW_GET_VAR(__GLEW_NV_fragment_shader_interlock) - -#endif /* GL_NV_fragment_shader_interlock */ - -/* -------------------- GL_NV_framebuffer_mixed_samples -------------------- */ - -#ifndef GL_NV_framebuffer_mixed_samples -#define GL_NV_framebuffer_mixed_samples 1 - -#define GL_COLOR_SAMPLES_NV 0x8E20 -#define GL_RASTER_MULTISAMPLE_EXT 0x9327 -#define GL_RASTER_SAMPLES_EXT 0x9328 -#define GL_MAX_RASTER_SAMPLES_EXT 0x9329 -#define GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A -#define GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B -#define GL_EFFECTIVE_RASTER_SAMPLES_EXT 0x932C -#define GL_DEPTH_SAMPLES_NV 0x932D -#define GL_STENCIL_SAMPLES_NV 0x932E -#define GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F -#define GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330 -#define GL_COVERAGE_MODULATION_TABLE_NV 0x9331 -#define GL_COVERAGE_MODULATION_NV 0x9332 -#define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 - -#define GLEW_NV_framebuffer_mixed_samples GLEW_GET_VAR(__GLEW_NV_framebuffer_mixed_samples) - -#endif /* GL_NV_framebuffer_mixed_samples */ - -/* ----------------- GL_NV_framebuffer_multisample_coverage ---------------- */ - -#ifndef GL_NV_framebuffer_multisample_coverage -#define GL_NV_framebuffer_multisample_coverage 1 - -#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB -#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 -#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 -#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 - -typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); - -#define glRenderbufferStorageMultisampleCoverageNV GLEW_GET_FUN(__glewRenderbufferStorageMultisampleCoverageNV) - -#define GLEW_NV_framebuffer_multisample_coverage GLEW_GET_VAR(__GLEW_NV_framebuffer_multisample_coverage) - -#endif /* GL_NV_framebuffer_multisample_coverage */ - -/* ------------------------ GL_NV_geometry_program4 ------------------------ */ - -#ifndef GL_NV_geometry_program4 -#define GL_NV_geometry_program4 1 - -#define GL_GEOMETRY_PROGRAM_NV 0x8C26 -#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 -#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 - -typedef void (GLAPIENTRY * PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); - -#define glProgramVertexLimitNV GLEW_GET_FUN(__glewProgramVertexLimitNV) - -#define GLEW_NV_geometry_program4 GLEW_GET_VAR(__GLEW_NV_geometry_program4) - -#endif /* GL_NV_geometry_program4 */ - -/* ------------------------- GL_NV_geometry_shader4 ------------------------ */ - -#ifndef GL_NV_geometry_shader4 -#define GL_NV_geometry_shader4 1 - -#define GLEW_NV_geometry_shader4 GLEW_GET_VAR(__GLEW_NV_geometry_shader4) - -#endif /* GL_NV_geometry_shader4 */ - -/* ------------------- GL_NV_geometry_shader_passthrough ------------------- */ - -#ifndef GL_NV_geometry_shader_passthrough -#define GL_NV_geometry_shader_passthrough 1 - -#define GLEW_NV_geometry_shader_passthrough GLEW_GET_VAR(__GLEW_NV_geometry_shader_passthrough) - -#endif /* GL_NV_geometry_shader_passthrough */ - -/* --------------------------- GL_NV_gpu_program4 -------------------------- */ - -#ifndef GL_NV_gpu_program4 -#define GL_NV_gpu_program4 1 - -#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 -#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 -#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 -#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 -#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 -#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 -#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 -#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 - -typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); -typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); -typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); -typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); -typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); -typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); -typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); -typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); -typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); -typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); - -#define glProgramEnvParameterI4iNV GLEW_GET_FUN(__glewProgramEnvParameterI4iNV) -#define glProgramEnvParameterI4ivNV GLEW_GET_FUN(__glewProgramEnvParameterI4ivNV) -#define glProgramEnvParameterI4uiNV GLEW_GET_FUN(__glewProgramEnvParameterI4uiNV) -#define glProgramEnvParameterI4uivNV GLEW_GET_FUN(__glewProgramEnvParameterI4uivNV) -#define glProgramEnvParametersI4ivNV GLEW_GET_FUN(__glewProgramEnvParametersI4ivNV) -#define glProgramEnvParametersI4uivNV GLEW_GET_FUN(__glewProgramEnvParametersI4uivNV) -#define glProgramLocalParameterI4iNV GLEW_GET_FUN(__glewProgramLocalParameterI4iNV) -#define glProgramLocalParameterI4ivNV GLEW_GET_FUN(__glewProgramLocalParameterI4ivNV) -#define glProgramLocalParameterI4uiNV GLEW_GET_FUN(__glewProgramLocalParameterI4uiNV) -#define glProgramLocalParameterI4uivNV GLEW_GET_FUN(__glewProgramLocalParameterI4uivNV) -#define glProgramLocalParametersI4ivNV GLEW_GET_FUN(__glewProgramLocalParametersI4ivNV) -#define glProgramLocalParametersI4uivNV GLEW_GET_FUN(__glewProgramLocalParametersI4uivNV) - -#define GLEW_NV_gpu_program4 GLEW_GET_VAR(__GLEW_NV_gpu_program4) - -#endif /* GL_NV_gpu_program4 */ - -/* --------------------------- GL_NV_gpu_program5 -------------------------- */ - -#ifndef GL_NV_gpu_program5 -#define GL_NV_gpu_program5 1 - -#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A -#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B -#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C -#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D -#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E -#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F - -#define GLEW_NV_gpu_program5 GLEW_GET_VAR(__GLEW_NV_gpu_program5) - -#endif /* GL_NV_gpu_program5 */ - -/* -------------------- GL_NV_gpu_program5_mem_extended -------------------- */ - -#ifndef GL_NV_gpu_program5_mem_extended -#define GL_NV_gpu_program5_mem_extended 1 - -#define GLEW_NV_gpu_program5_mem_extended GLEW_GET_VAR(__GLEW_NV_gpu_program5_mem_extended) - -#endif /* GL_NV_gpu_program5_mem_extended */ - -/* ------------------------- GL_NV_gpu_program_fp64 ------------------------ */ - -#ifndef GL_NV_gpu_program_fp64 -#define GL_NV_gpu_program_fp64 1 - -#define GLEW_NV_gpu_program_fp64 GLEW_GET_VAR(__GLEW_NV_gpu_program_fp64) - -#endif /* GL_NV_gpu_program_fp64 */ - -/* --------------------------- GL_NV_gpu_shader5 --------------------------- */ - -#ifndef GL_NV_gpu_shader5 -#define GL_NV_gpu_shader5 1 - -#define GL_INT64_NV 0x140E -#define GL_UNSIGNED_INT64_NV 0x140F -#define GL_INT8_NV 0x8FE0 -#define GL_INT8_VEC2_NV 0x8FE1 -#define GL_INT8_VEC3_NV 0x8FE2 -#define GL_INT8_VEC4_NV 0x8FE3 -#define GL_INT16_NV 0x8FE4 -#define GL_INT16_VEC2_NV 0x8FE5 -#define GL_INT16_VEC3_NV 0x8FE6 -#define GL_INT16_VEC4_NV 0x8FE7 -#define GL_INT64_VEC2_NV 0x8FE9 -#define GL_INT64_VEC3_NV 0x8FEA -#define GL_INT64_VEC4_NV 0x8FEB -#define GL_UNSIGNED_INT8_NV 0x8FEC -#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED -#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE -#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF -#define GL_UNSIGNED_INT16_NV 0x8FF0 -#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 -#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 -#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 -#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 -#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 -#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 -#define GL_FLOAT16_NV 0x8FF8 -#define GL_FLOAT16_VEC2_NV 0x8FF9 -#define GL_FLOAT16_VEC3_NV 0x8FFA -#define GL_FLOAT16_VEC4_NV 0x8FFB - -typedef void (GLAPIENTRY * PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT* params); -typedef void (GLAPIENTRY * PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT* params); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); -typedef void (GLAPIENTRY * PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); -typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); -typedef void (GLAPIENTRY * PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); -typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); -typedef void (GLAPIENTRY * PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -typedef void (GLAPIENTRY * PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); -typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); - -#define glGetUniformi64vNV GLEW_GET_FUN(__glewGetUniformi64vNV) -#define glGetUniformui64vNV GLEW_GET_FUN(__glewGetUniformui64vNV) -#define glProgramUniform1i64NV GLEW_GET_FUN(__glewProgramUniform1i64NV) -#define glProgramUniform1i64vNV GLEW_GET_FUN(__glewProgramUniform1i64vNV) -#define glProgramUniform1ui64NV GLEW_GET_FUN(__glewProgramUniform1ui64NV) -#define glProgramUniform1ui64vNV GLEW_GET_FUN(__glewProgramUniform1ui64vNV) -#define glProgramUniform2i64NV GLEW_GET_FUN(__glewProgramUniform2i64NV) -#define glProgramUniform2i64vNV GLEW_GET_FUN(__glewProgramUniform2i64vNV) -#define glProgramUniform2ui64NV GLEW_GET_FUN(__glewProgramUniform2ui64NV) -#define glProgramUniform2ui64vNV GLEW_GET_FUN(__glewProgramUniform2ui64vNV) -#define glProgramUniform3i64NV GLEW_GET_FUN(__glewProgramUniform3i64NV) -#define glProgramUniform3i64vNV GLEW_GET_FUN(__glewProgramUniform3i64vNV) -#define glProgramUniform3ui64NV GLEW_GET_FUN(__glewProgramUniform3ui64NV) -#define glProgramUniform3ui64vNV GLEW_GET_FUN(__glewProgramUniform3ui64vNV) -#define glProgramUniform4i64NV GLEW_GET_FUN(__glewProgramUniform4i64NV) -#define glProgramUniform4i64vNV GLEW_GET_FUN(__glewProgramUniform4i64vNV) -#define glProgramUniform4ui64NV GLEW_GET_FUN(__glewProgramUniform4ui64NV) -#define glProgramUniform4ui64vNV GLEW_GET_FUN(__glewProgramUniform4ui64vNV) -#define glUniform1i64NV GLEW_GET_FUN(__glewUniform1i64NV) -#define glUniform1i64vNV GLEW_GET_FUN(__glewUniform1i64vNV) -#define glUniform1ui64NV GLEW_GET_FUN(__glewUniform1ui64NV) -#define glUniform1ui64vNV GLEW_GET_FUN(__glewUniform1ui64vNV) -#define glUniform2i64NV GLEW_GET_FUN(__glewUniform2i64NV) -#define glUniform2i64vNV GLEW_GET_FUN(__glewUniform2i64vNV) -#define glUniform2ui64NV GLEW_GET_FUN(__glewUniform2ui64NV) -#define glUniform2ui64vNV GLEW_GET_FUN(__glewUniform2ui64vNV) -#define glUniform3i64NV GLEW_GET_FUN(__glewUniform3i64NV) -#define glUniform3i64vNV GLEW_GET_FUN(__glewUniform3i64vNV) -#define glUniform3ui64NV GLEW_GET_FUN(__glewUniform3ui64NV) -#define glUniform3ui64vNV GLEW_GET_FUN(__glewUniform3ui64vNV) -#define glUniform4i64NV GLEW_GET_FUN(__glewUniform4i64NV) -#define glUniform4i64vNV GLEW_GET_FUN(__glewUniform4i64vNV) -#define glUniform4ui64NV GLEW_GET_FUN(__glewUniform4ui64NV) -#define glUniform4ui64vNV GLEW_GET_FUN(__glewUniform4ui64vNV) - -#define GLEW_NV_gpu_shader5 GLEW_GET_VAR(__GLEW_NV_gpu_shader5) - -#endif /* GL_NV_gpu_shader5 */ - -/* ---------------------------- GL_NV_half_float --------------------------- */ - -#ifndef GL_NV_half_float -#define GL_NV_half_float 1 - -#define GL_HALF_FLOAT_NV 0x140B - -typedef unsigned short GLhalf; - -typedef void (GLAPIENTRY * PFNGLCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); -typedef void (GLAPIENTRY * PFNGLCOLOR3HVNVPROC) (const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLCOLOR4HNVPROC) (GLhalf red, GLhalf green, GLhalf blue, GLhalf alpha); -typedef void (GLAPIENTRY * PFNGLCOLOR4HVNVPROC) (const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLFOGCOORDHNVPROC) (GLhalf fog); -typedef void (GLAPIENTRY * PFNGLFOGCOORDHVNVPROC) (const GLhalf* fog); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalf s); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalf s, GLhalf t); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r, GLhalf q); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLNORMAL3HNVPROC) (GLhalf nx, GLhalf ny, GLhalf nz); -typedef void (GLAPIENTRY * PFNGLNORMAL3HVNVPROC) (const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLTEXCOORD1HNVPROC) (GLhalf s); -typedef void (GLAPIENTRY * PFNGLTEXCOORD1HVNVPROC) (const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLTEXCOORD2HNVPROC) (GLhalf s, GLhalf t); -typedef void (GLAPIENTRY * PFNGLTEXCOORD2HVNVPROC) (const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLTEXCOORD3HNVPROC) (GLhalf s, GLhalf t, GLhalf r); -typedef void (GLAPIENTRY * PFNGLTEXCOORD3HVNVPROC) (const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLTEXCOORD4HNVPROC) (GLhalf s, GLhalf t, GLhalf r, GLhalf q); -typedef void (GLAPIENTRY * PFNGLTEXCOORD4HVNVPROC) (const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLVERTEX2HNVPROC) (GLhalf x, GLhalf y); -typedef void (GLAPIENTRY * PFNGLVERTEX2HVNVPROC) (const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLVERTEX3HNVPROC) (GLhalf x, GLhalf y, GLhalf z); -typedef void (GLAPIENTRY * PFNGLVERTEX3HVNVPROC) (const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLVERTEX4HNVPROC) (GLhalf x, GLhalf y, GLhalf z, GLhalf w); -typedef void (GLAPIENTRY * PFNGLVERTEX4HVNVPROC) (const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalf x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalf x, GLhalf y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z, GLhalf w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); -typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHNVPROC) (GLhalf weight); -typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalf* weight); - -#define glColor3hNV GLEW_GET_FUN(__glewColor3hNV) -#define glColor3hvNV GLEW_GET_FUN(__glewColor3hvNV) -#define glColor4hNV GLEW_GET_FUN(__glewColor4hNV) -#define glColor4hvNV GLEW_GET_FUN(__glewColor4hvNV) -#define glFogCoordhNV GLEW_GET_FUN(__glewFogCoordhNV) -#define glFogCoordhvNV GLEW_GET_FUN(__glewFogCoordhvNV) -#define glMultiTexCoord1hNV GLEW_GET_FUN(__glewMultiTexCoord1hNV) -#define glMultiTexCoord1hvNV GLEW_GET_FUN(__glewMultiTexCoord1hvNV) -#define glMultiTexCoord2hNV GLEW_GET_FUN(__glewMultiTexCoord2hNV) -#define glMultiTexCoord2hvNV GLEW_GET_FUN(__glewMultiTexCoord2hvNV) -#define glMultiTexCoord3hNV GLEW_GET_FUN(__glewMultiTexCoord3hNV) -#define glMultiTexCoord3hvNV GLEW_GET_FUN(__glewMultiTexCoord3hvNV) -#define glMultiTexCoord4hNV GLEW_GET_FUN(__glewMultiTexCoord4hNV) -#define glMultiTexCoord4hvNV GLEW_GET_FUN(__glewMultiTexCoord4hvNV) -#define glNormal3hNV GLEW_GET_FUN(__glewNormal3hNV) -#define glNormal3hvNV GLEW_GET_FUN(__glewNormal3hvNV) -#define glSecondaryColor3hNV GLEW_GET_FUN(__glewSecondaryColor3hNV) -#define glSecondaryColor3hvNV GLEW_GET_FUN(__glewSecondaryColor3hvNV) -#define glTexCoord1hNV GLEW_GET_FUN(__glewTexCoord1hNV) -#define glTexCoord1hvNV GLEW_GET_FUN(__glewTexCoord1hvNV) -#define glTexCoord2hNV GLEW_GET_FUN(__glewTexCoord2hNV) -#define glTexCoord2hvNV GLEW_GET_FUN(__glewTexCoord2hvNV) -#define glTexCoord3hNV GLEW_GET_FUN(__glewTexCoord3hNV) -#define glTexCoord3hvNV GLEW_GET_FUN(__glewTexCoord3hvNV) -#define glTexCoord4hNV GLEW_GET_FUN(__glewTexCoord4hNV) -#define glTexCoord4hvNV GLEW_GET_FUN(__glewTexCoord4hvNV) -#define glVertex2hNV GLEW_GET_FUN(__glewVertex2hNV) -#define glVertex2hvNV GLEW_GET_FUN(__glewVertex2hvNV) -#define glVertex3hNV GLEW_GET_FUN(__glewVertex3hNV) -#define glVertex3hvNV GLEW_GET_FUN(__glewVertex3hvNV) -#define glVertex4hNV GLEW_GET_FUN(__glewVertex4hNV) -#define glVertex4hvNV GLEW_GET_FUN(__glewVertex4hvNV) -#define glVertexAttrib1hNV GLEW_GET_FUN(__glewVertexAttrib1hNV) -#define glVertexAttrib1hvNV GLEW_GET_FUN(__glewVertexAttrib1hvNV) -#define glVertexAttrib2hNV GLEW_GET_FUN(__glewVertexAttrib2hNV) -#define glVertexAttrib2hvNV GLEW_GET_FUN(__glewVertexAttrib2hvNV) -#define glVertexAttrib3hNV GLEW_GET_FUN(__glewVertexAttrib3hNV) -#define glVertexAttrib3hvNV GLEW_GET_FUN(__glewVertexAttrib3hvNV) -#define glVertexAttrib4hNV GLEW_GET_FUN(__glewVertexAttrib4hNV) -#define glVertexAttrib4hvNV GLEW_GET_FUN(__glewVertexAttrib4hvNV) -#define glVertexAttribs1hvNV GLEW_GET_FUN(__glewVertexAttribs1hvNV) -#define glVertexAttribs2hvNV GLEW_GET_FUN(__glewVertexAttribs2hvNV) -#define glVertexAttribs3hvNV GLEW_GET_FUN(__glewVertexAttribs3hvNV) -#define glVertexAttribs4hvNV GLEW_GET_FUN(__glewVertexAttribs4hvNV) -#define glVertexWeighthNV GLEW_GET_FUN(__glewVertexWeighthNV) -#define glVertexWeighthvNV GLEW_GET_FUN(__glewVertexWeighthvNV) - -#define GLEW_NV_half_float GLEW_GET_VAR(__GLEW_NV_half_float) - -#endif /* GL_NV_half_float */ - -/* ------------------- GL_NV_internalformat_sample_query ------------------- */ - -#ifndef GL_NV_internalformat_sample_query -#define GL_NV_internalformat_sample_query 1 - -#define GL_MULTISAMPLES_NV 0x9371 -#define GL_SUPERSAMPLE_SCALE_X_NV 0x9372 -#define GL_SUPERSAMPLE_SCALE_Y_NV 0x9373 -#define GL_CONFORMANT_NV 0x9374 - -typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint* params); - -#define glGetInternalformatSampleivNV GLEW_GET_FUN(__glewGetInternalformatSampleivNV) - -#define GLEW_NV_internalformat_sample_query GLEW_GET_VAR(__GLEW_NV_internalformat_sample_query) - -#endif /* GL_NV_internalformat_sample_query */ - -/* ------------------------ GL_NV_light_max_exponent ----------------------- */ - -#ifndef GL_NV_light_max_exponent -#define GL_NV_light_max_exponent 1 - -#define GL_MAX_SHININESS_NV 0x8504 -#define GL_MAX_SPOT_EXPONENT_NV 0x8505 - -#define GLEW_NV_light_max_exponent GLEW_GET_VAR(__GLEW_NV_light_max_exponent) - -#endif /* GL_NV_light_max_exponent */ - -/* ----------------------- GL_NV_multisample_coverage ---------------------- */ - -#ifndef GL_NV_multisample_coverage -#define GL_NV_multisample_coverage 1 - -#define GL_COLOR_SAMPLES_NV 0x8E20 - -#define GLEW_NV_multisample_coverage GLEW_GET_VAR(__GLEW_NV_multisample_coverage) - -#endif /* GL_NV_multisample_coverage */ - -/* --------------------- GL_NV_multisample_filter_hint --------------------- */ - -#ifndef GL_NV_multisample_filter_hint -#define GL_NV_multisample_filter_hint 1 - -#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 - -#define GLEW_NV_multisample_filter_hint GLEW_GET_VAR(__GLEW_NV_multisample_filter_hint) - -#endif /* GL_NV_multisample_filter_hint */ - -/* ------------------------- GL_NV_occlusion_query ------------------------- */ - -#ifndef GL_NV_occlusion_query -#define GL_NV_occlusion_query 1 - -#define GL_PIXEL_COUNTER_BITS_NV 0x8864 -#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 -#define GL_PIXEL_COUNT_NV 0x8866 -#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 - -typedef void (GLAPIENTRY * PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); -typedef void (GLAPIENTRY * PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint* ids); -typedef void (GLAPIENTRY * PFNGLENDOCCLUSIONQUERYNVPROC) (void); -typedef void (GLAPIENTRY * PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint* ids); -typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint* params); -typedef GLboolean (GLAPIENTRY * PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); - -#define glBeginOcclusionQueryNV GLEW_GET_FUN(__glewBeginOcclusionQueryNV) -#define glDeleteOcclusionQueriesNV GLEW_GET_FUN(__glewDeleteOcclusionQueriesNV) -#define glEndOcclusionQueryNV GLEW_GET_FUN(__glewEndOcclusionQueryNV) -#define glGenOcclusionQueriesNV GLEW_GET_FUN(__glewGenOcclusionQueriesNV) -#define glGetOcclusionQueryivNV GLEW_GET_FUN(__glewGetOcclusionQueryivNV) -#define glGetOcclusionQueryuivNV GLEW_GET_FUN(__glewGetOcclusionQueryuivNV) -#define glIsOcclusionQueryNV GLEW_GET_FUN(__glewIsOcclusionQueryNV) - -#define GLEW_NV_occlusion_query GLEW_GET_VAR(__GLEW_NV_occlusion_query) - -#endif /* GL_NV_occlusion_query */ - -/* ----------------------- GL_NV_packed_depth_stencil ---------------------- */ - -#ifndef GL_NV_packed_depth_stencil -#define GL_NV_packed_depth_stencil 1 - -#define GL_DEPTH_STENCIL_NV 0x84F9 -#define GL_UNSIGNED_INT_24_8_NV 0x84FA - -#define GLEW_NV_packed_depth_stencil GLEW_GET_VAR(__GLEW_NV_packed_depth_stencil) - -#endif /* GL_NV_packed_depth_stencil */ - -/* --------------------- GL_NV_parameter_buffer_object --------------------- */ - -#ifndef GL_NV_parameter_buffer_object -#define GL_NV_parameter_buffer_object 1 - -#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 -#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 -#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 -#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 -#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 - -typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); -typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); -typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); - -#define glProgramBufferParametersIivNV GLEW_GET_FUN(__glewProgramBufferParametersIivNV) -#define glProgramBufferParametersIuivNV GLEW_GET_FUN(__glewProgramBufferParametersIuivNV) -#define glProgramBufferParametersfvNV GLEW_GET_FUN(__glewProgramBufferParametersfvNV) - -#define GLEW_NV_parameter_buffer_object GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object) - -#endif /* GL_NV_parameter_buffer_object */ - -/* --------------------- GL_NV_parameter_buffer_object2 -------------------- */ - -#ifndef GL_NV_parameter_buffer_object2 -#define GL_NV_parameter_buffer_object2 1 - -#define GLEW_NV_parameter_buffer_object2 GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object2) - -#endif /* GL_NV_parameter_buffer_object2 */ - -/* -------------------------- GL_NV_path_rendering ------------------------- */ - -#ifndef GL_NV_path_rendering -#define GL_NV_path_rendering 1 - -#define GL_CLOSE_PATH_NV 0x00 -#define GL_BOLD_BIT_NV 0x01 -#define GL_GLYPH_WIDTH_BIT_NV 0x01 -#define GL_GLYPH_HEIGHT_BIT_NV 0x02 -#define GL_ITALIC_BIT_NV 0x02 -#define GL_MOVE_TO_NV 0x02 -#define GL_RELATIVE_MOVE_TO_NV 0x03 -#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 -#define GL_LINE_TO_NV 0x04 -#define GL_RELATIVE_LINE_TO_NV 0x05 -#define GL_HORIZONTAL_LINE_TO_NV 0x06 -#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 -#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 -#define GL_VERTICAL_LINE_TO_NV 0x08 -#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 -#define GL_QUADRATIC_CURVE_TO_NV 0x0A -#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B -#define GL_CUBIC_CURVE_TO_NV 0x0C -#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D -#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E -#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F -#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 -#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 -#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 -#define GL_SMALL_CCW_ARC_TO_NV 0x12 -#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 -#define GL_SMALL_CW_ARC_TO_NV 0x14 -#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 -#define GL_LARGE_CCW_ARC_TO_NV 0x16 -#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 -#define GL_LARGE_CW_ARC_TO_NV 0x18 -#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 -#define GL_CONIC_CURVE_TO_NV 0x1A -#define GL_RELATIVE_CONIC_CURVE_TO_NV 0x1B -#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 -#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 -#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 -#define GL_ROUNDED_RECT_NV 0xE8 -#define GL_RELATIVE_ROUNDED_RECT_NV 0xE9 -#define GL_ROUNDED_RECT2_NV 0xEA -#define GL_RELATIVE_ROUNDED_RECT2_NV 0xEB -#define GL_ROUNDED_RECT4_NV 0xEC -#define GL_RELATIVE_ROUNDED_RECT4_NV 0xED -#define GL_ROUNDED_RECT8_NV 0xEE -#define GL_RELATIVE_ROUNDED_RECT8_NV 0xEF -#define GL_RESTART_PATH_NV 0xF0 -#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 -#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 -#define GL_RECT_NV 0xF6 -#define GL_RELATIVE_RECT_NV 0xF7 -#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 -#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA -#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC -#define GL_ARC_TO_NV 0xFE -#define GL_RELATIVE_ARC_TO_NV 0xFF -#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 -#define GL_PRIMARY_COLOR_NV 0x852C -#define GL_SECONDARY_COLOR_NV 0x852D -#define GL_PRIMARY_COLOR 0x8577 -#define GL_PATH_FORMAT_SVG_NV 0x9070 -#define GL_PATH_FORMAT_PS_NV 0x9071 -#define GL_STANDARD_FONT_NAME_NV 0x9072 -#define GL_SYSTEM_FONT_NAME_NV 0x9073 -#define GL_FILE_NAME_NV 0x9074 -#define GL_PATH_STROKE_WIDTH_NV 0x9075 -#define GL_PATH_END_CAPS_NV 0x9076 -#define GL_PATH_INITIAL_END_CAP_NV 0x9077 -#define GL_PATH_TERMINAL_END_CAP_NV 0x9078 -#define GL_PATH_JOIN_STYLE_NV 0x9079 -#define GL_PATH_MITER_LIMIT_NV 0x907A -#define GL_PATH_DASH_CAPS_NV 0x907B -#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C -#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D -#define GL_PATH_DASH_OFFSET_NV 0x907E -#define GL_PATH_CLIENT_LENGTH_NV 0x907F -#define GL_PATH_FILL_MODE_NV 0x9080 -#define GL_PATH_FILL_MASK_NV 0x9081 -#define GL_PATH_FILL_COVER_MODE_NV 0x9082 -#define GL_PATH_STROKE_COVER_MODE_NV 0x9083 -#define GL_PATH_STROKE_MASK_NV 0x9084 -#define GL_PATH_STROKE_BOUND_NV 0x9086 -#define GL_COUNT_UP_NV 0x9088 -#define GL_COUNT_DOWN_NV 0x9089 -#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A -#define GL_CONVEX_HULL_NV 0x908B -#define GL_BOUNDING_BOX_NV 0x908D -#define GL_TRANSLATE_X_NV 0x908E -#define GL_TRANSLATE_Y_NV 0x908F -#define GL_TRANSLATE_2D_NV 0x9090 -#define GL_TRANSLATE_3D_NV 0x9091 -#define GL_AFFINE_2D_NV 0x9092 -#define GL_AFFINE_3D_NV 0x9094 -#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 -#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 -#define GL_UTF8_NV 0x909A -#define GL_UTF16_NV 0x909B -#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C -#define GL_PATH_COMMAND_COUNT_NV 0x909D -#define GL_PATH_COORD_COUNT_NV 0x909E -#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F -#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 -#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 -#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 -#define GL_SQUARE_NV 0x90A3 -#define GL_ROUND_NV 0x90A4 -#define GL_TRIANGULAR_NV 0x90A5 -#define GL_BEVEL_NV 0x90A6 -#define GL_MITER_REVERT_NV 0x90A7 -#define GL_MITER_TRUNCATE_NV 0x90A8 -#define GL_SKIP_MISSING_GLYPH_NV 0x90A9 -#define GL_USE_MISSING_GLYPH_NV 0x90AA -#define GL_PATH_ERROR_POSITION_NV 0x90AB -#define GL_PATH_FOG_GEN_MODE_NV 0x90AC -#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD -#define GL_ADJACENT_PAIRS_NV 0x90AE -#define GL_FIRST_TO_REST_NV 0x90AF -#define GL_PATH_GEN_MODE_NV 0x90B0 -#define GL_PATH_GEN_COEFF_NV 0x90B1 -#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 -#define GL_PATH_GEN_COMPONENTS_NV 0x90B3 -#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 -#define GL_MOVE_TO_RESETS_NV 0x90B5 -#define GL_MOVE_TO_CONTINUES_NV 0x90B6 -#define GL_PATH_STENCIL_FUNC_NV 0x90B7 -#define GL_PATH_STENCIL_REF_NV 0x90B8 -#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 -#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD -#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE -#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF -#define GL_FONT_GLYPHS_AVAILABLE_NV 0x9368 -#define GL_FONT_TARGET_UNAVAILABLE_NV 0x9369 -#define GL_FONT_UNAVAILABLE_NV 0x936A -#define GL_FONT_UNINTELLIGIBLE_NV 0x936B -#define GL_STANDARD_FONT_FORMAT_NV 0x936C -#define GL_FRAGMENT_INPUT_NV 0x936D -#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 -#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 -#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 -#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 -#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 -#define GL_FONT_ASCENDER_BIT_NV 0x00200000 -#define GL_FONT_DESCENDER_BIT_NV 0x00400000 -#define GL_FONT_HEIGHT_BIT_NV 0x00800000 -#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 -#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 -#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 -#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 -#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 -#define GL_FONT_NUM_GLYPH_INDICES_BIT_NV 0x20000000 - -typedef void (GLAPIENTRY * PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); -typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); -typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode); -typedef void (GLAPIENTRY * PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); -typedef GLuint (GLAPIENTRY * PFNGLGENPATHSNVPROC) (GLsizei range); -typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat* value); -typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint* value); -typedef void (GLAPIENTRY * PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte* commands); -typedef void (GLAPIENTRY * PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat* coords); -typedef void (GLAPIENTRY * PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat* dashArray); -typedef GLfloat (GLAPIENTRY * PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); -typedef void (GLAPIENTRY * PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat* metrics); -typedef void (GLAPIENTRY * PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); -typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat* value); -typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint* value); -typedef void (GLAPIENTRY * PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); -typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat* value); -typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint* value); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLfloat *params); -typedef void (GLAPIENTRY * PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); -typedef GLboolean (GLAPIENTRY * PFNGLISPATHNVPROC) (GLuint path); -typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); -typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); -typedef void (GLAPIENTRY * PFNGLMATRIXLOAD3X2FNVPROC) (GLenum matrixMode, const GLfloat* m); -typedef void (GLAPIENTRY * PFNGLMATRIXLOAD3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); -typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); -typedef void (GLAPIENTRY * PFNGLMATRIXMULT3X2FNVPROC) (GLenum matrixMode, const GLfloat* m); -typedef void (GLAPIENTRY * PFNGLMATRIXMULT3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); -typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); -typedef void (GLAPIENTRY * PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat* coeffs); -typedef void (GLAPIENTRY * PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const void*coords); -typedef void (GLAPIENTRY * PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (GLAPIENTRY * PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum zfunc); -typedef void (GLAPIENTRY * PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat* dashArray); -typedef void (GLAPIENTRY * PFNGLPATHFOGGENNVPROC) (GLenum genMode); -typedef GLenum (GLAPIENTRY * PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef GLenum (GLAPIENTRY * PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]); -typedef void (GLAPIENTRY * PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef void (GLAPIENTRY * PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void*charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef GLenum (GLAPIENTRY * PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); -typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); -typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat* value); -typedef void (GLAPIENTRY * PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); -typedef void (GLAPIENTRY * PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint* value); -typedef void (GLAPIENTRY * PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); -typedef void (GLAPIENTRY * PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); -typedef void (GLAPIENTRY * PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void *pathString); -typedef void (GLAPIENTRY * PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const void*coords); -typedef void (GLAPIENTRY * PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); -typedef void (GLAPIENTRY * PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat* coeffs); -typedef GLboolean (GLAPIENTRY * PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat* x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); -typedef void (GLAPIENTRY * PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat* coeffs); -typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); -typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); -typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); -typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); -typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); -typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); -typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask, GLenum coverMode); -typedef void (GLAPIENTRY * PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat* transformValues); -typedef void (GLAPIENTRY * PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint paths[], const GLfloat weights[]); - -#define glCopyPathNV GLEW_GET_FUN(__glewCopyPathNV) -#define glCoverFillPathInstancedNV GLEW_GET_FUN(__glewCoverFillPathInstancedNV) -#define glCoverFillPathNV GLEW_GET_FUN(__glewCoverFillPathNV) -#define glCoverStrokePathInstancedNV GLEW_GET_FUN(__glewCoverStrokePathInstancedNV) -#define glCoverStrokePathNV GLEW_GET_FUN(__glewCoverStrokePathNV) -#define glDeletePathsNV GLEW_GET_FUN(__glewDeletePathsNV) -#define glGenPathsNV GLEW_GET_FUN(__glewGenPathsNV) -#define glGetPathColorGenfvNV GLEW_GET_FUN(__glewGetPathColorGenfvNV) -#define glGetPathColorGenivNV GLEW_GET_FUN(__glewGetPathColorGenivNV) -#define glGetPathCommandsNV GLEW_GET_FUN(__glewGetPathCommandsNV) -#define glGetPathCoordsNV GLEW_GET_FUN(__glewGetPathCoordsNV) -#define glGetPathDashArrayNV GLEW_GET_FUN(__glewGetPathDashArrayNV) -#define glGetPathLengthNV GLEW_GET_FUN(__glewGetPathLengthNV) -#define glGetPathMetricRangeNV GLEW_GET_FUN(__glewGetPathMetricRangeNV) -#define glGetPathMetricsNV GLEW_GET_FUN(__glewGetPathMetricsNV) -#define glGetPathParameterfvNV GLEW_GET_FUN(__glewGetPathParameterfvNV) -#define glGetPathParameterivNV GLEW_GET_FUN(__glewGetPathParameterivNV) -#define glGetPathSpacingNV GLEW_GET_FUN(__glewGetPathSpacingNV) -#define glGetPathTexGenfvNV GLEW_GET_FUN(__glewGetPathTexGenfvNV) -#define glGetPathTexGenivNV GLEW_GET_FUN(__glewGetPathTexGenivNV) -#define glGetProgramResourcefvNV GLEW_GET_FUN(__glewGetProgramResourcefvNV) -#define glInterpolatePathsNV GLEW_GET_FUN(__glewInterpolatePathsNV) -#define glIsPathNV GLEW_GET_FUN(__glewIsPathNV) -#define glIsPointInFillPathNV GLEW_GET_FUN(__glewIsPointInFillPathNV) -#define glIsPointInStrokePathNV GLEW_GET_FUN(__glewIsPointInStrokePathNV) -#define glMatrixLoad3x2fNV GLEW_GET_FUN(__glewMatrixLoad3x2fNV) -#define glMatrixLoad3x3fNV GLEW_GET_FUN(__glewMatrixLoad3x3fNV) -#define glMatrixLoadTranspose3x3fNV GLEW_GET_FUN(__glewMatrixLoadTranspose3x3fNV) -#define glMatrixMult3x2fNV GLEW_GET_FUN(__glewMatrixMult3x2fNV) -#define glMatrixMult3x3fNV GLEW_GET_FUN(__glewMatrixMult3x3fNV) -#define glMatrixMultTranspose3x3fNV GLEW_GET_FUN(__glewMatrixMultTranspose3x3fNV) -#define glPathColorGenNV GLEW_GET_FUN(__glewPathColorGenNV) -#define glPathCommandsNV GLEW_GET_FUN(__glewPathCommandsNV) -#define glPathCoordsNV GLEW_GET_FUN(__glewPathCoordsNV) -#define glPathCoverDepthFuncNV GLEW_GET_FUN(__glewPathCoverDepthFuncNV) -#define glPathDashArrayNV GLEW_GET_FUN(__glewPathDashArrayNV) -#define glPathFogGenNV GLEW_GET_FUN(__glewPathFogGenNV) -#define glPathGlyphIndexArrayNV GLEW_GET_FUN(__glewPathGlyphIndexArrayNV) -#define glPathGlyphIndexRangeNV GLEW_GET_FUN(__glewPathGlyphIndexRangeNV) -#define glPathGlyphRangeNV GLEW_GET_FUN(__glewPathGlyphRangeNV) -#define glPathGlyphsNV GLEW_GET_FUN(__glewPathGlyphsNV) -#define glPathMemoryGlyphIndexArrayNV GLEW_GET_FUN(__glewPathMemoryGlyphIndexArrayNV) -#define glPathParameterfNV GLEW_GET_FUN(__glewPathParameterfNV) -#define glPathParameterfvNV GLEW_GET_FUN(__glewPathParameterfvNV) -#define glPathParameteriNV GLEW_GET_FUN(__glewPathParameteriNV) -#define glPathParameterivNV GLEW_GET_FUN(__glewPathParameterivNV) -#define glPathStencilDepthOffsetNV GLEW_GET_FUN(__glewPathStencilDepthOffsetNV) -#define glPathStencilFuncNV GLEW_GET_FUN(__glewPathStencilFuncNV) -#define glPathStringNV GLEW_GET_FUN(__glewPathStringNV) -#define glPathSubCommandsNV GLEW_GET_FUN(__glewPathSubCommandsNV) -#define glPathSubCoordsNV GLEW_GET_FUN(__glewPathSubCoordsNV) -#define glPathTexGenNV GLEW_GET_FUN(__glewPathTexGenNV) -#define glPointAlongPathNV GLEW_GET_FUN(__glewPointAlongPathNV) -#define glProgramPathFragmentInputGenNV GLEW_GET_FUN(__glewProgramPathFragmentInputGenNV) -#define glStencilFillPathInstancedNV GLEW_GET_FUN(__glewStencilFillPathInstancedNV) -#define glStencilFillPathNV GLEW_GET_FUN(__glewStencilFillPathNV) -#define glStencilStrokePathInstancedNV GLEW_GET_FUN(__glewStencilStrokePathInstancedNV) -#define glStencilStrokePathNV GLEW_GET_FUN(__glewStencilStrokePathNV) -#define glStencilThenCoverFillPathInstancedNV GLEW_GET_FUN(__glewStencilThenCoverFillPathInstancedNV) -#define glStencilThenCoverFillPathNV GLEW_GET_FUN(__glewStencilThenCoverFillPathNV) -#define glStencilThenCoverStrokePathInstancedNV GLEW_GET_FUN(__glewStencilThenCoverStrokePathInstancedNV) -#define glStencilThenCoverStrokePathNV GLEW_GET_FUN(__glewStencilThenCoverStrokePathNV) -#define glTransformPathNV GLEW_GET_FUN(__glewTransformPathNV) -#define glWeightPathsNV GLEW_GET_FUN(__glewWeightPathsNV) - -#define GLEW_NV_path_rendering GLEW_GET_VAR(__GLEW_NV_path_rendering) - -#endif /* GL_NV_path_rendering */ - -/* -------------------- GL_NV_path_rendering_shared_edge ------------------- */ - -#ifndef GL_NV_path_rendering_shared_edge -#define GL_NV_path_rendering_shared_edge 1 - -#define GL_SHARED_EDGE_NV 0xC0 - -#define GLEW_NV_path_rendering_shared_edge GLEW_GET_VAR(__GLEW_NV_path_rendering_shared_edge) - -#endif /* GL_NV_path_rendering_shared_edge */ - -/* ------------------------- GL_NV_pixel_data_range ------------------------ */ - -#ifndef GL_NV_pixel_data_range -#define GL_NV_pixel_data_range 1 - -#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 -#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 -#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A -#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B -#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C -#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D - -typedef void (GLAPIENTRY * PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); -typedef void (GLAPIENTRY * PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, void *pointer); - -#define glFlushPixelDataRangeNV GLEW_GET_FUN(__glewFlushPixelDataRangeNV) -#define glPixelDataRangeNV GLEW_GET_FUN(__glewPixelDataRangeNV) - -#define GLEW_NV_pixel_data_range GLEW_GET_VAR(__GLEW_NV_pixel_data_range) - -#endif /* GL_NV_pixel_data_range */ - -/* --------------------------- GL_NV_point_sprite -------------------------- */ - -#ifndef GL_NV_point_sprite -#define GL_NV_point_sprite 1 - -#define GL_POINT_SPRITE_NV 0x8861 -#define GL_COORD_REPLACE_NV 0x8862 -#define GL_POINT_SPRITE_R_MODE_NV 0x8863 - -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint* params); - -#define glPointParameteriNV GLEW_GET_FUN(__glewPointParameteriNV) -#define glPointParameterivNV GLEW_GET_FUN(__glewPointParameterivNV) - -#define GLEW_NV_point_sprite GLEW_GET_VAR(__GLEW_NV_point_sprite) - -#endif /* GL_NV_point_sprite */ - -/* -------------------------- GL_NV_present_video -------------------------- */ - -#ifndef GL_NV_present_video -#define GL_NV_present_video 1 - -#define GL_FRAME_NV 0x8E26 -#define GL_FIELDS_NV 0x8E27 -#define GL_CURRENT_TIME_NV 0x8E28 -#define GL_NUM_FILL_STREAMS_NV 0x8E29 -#define GL_PRESENT_TIME_NV 0x8E2A -#define GL_PRESENT_DURATION_NV 0x8E2B - -typedef void (GLAPIENTRY * PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT* params); -typedef void (GLAPIENTRY * PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT* params); -typedef void (GLAPIENTRY * PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint* params); -typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); -typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); - -#define glGetVideoi64vNV GLEW_GET_FUN(__glewGetVideoi64vNV) -#define glGetVideoivNV GLEW_GET_FUN(__glewGetVideoivNV) -#define glGetVideoui64vNV GLEW_GET_FUN(__glewGetVideoui64vNV) -#define glGetVideouivNV GLEW_GET_FUN(__glewGetVideouivNV) -#define glPresentFrameDualFillNV GLEW_GET_FUN(__glewPresentFrameDualFillNV) -#define glPresentFrameKeyedNV GLEW_GET_FUN(__glewPresentFrameKeyedNV) - -#define GLEW_NV_present_video GLEW_GET_VAR(__GLEW_NV_present_video) - -#endif /* GL_NV_present_video */ - -/* ------------------------ GL_NV_primitive_restart ------------------------ */ - -#ifndef GL_NV_primitive_restart -#define GL_NV_primitive_restart 1 - -#define GL_PRIMITIVE_RESTART_NV 0x8558 -#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 - -typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); -typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTNVPROC) (void); - -#define glPrimitiveRestartIndexNV GLEW_GET_FUN(__glewPrimitiveRestartIndexNV) -#define glPrimitiveRestartNV GLEW_GET_FUN(__glewPrimitiveRestartNV) - -#define GLEW_NV_primitive_restart GLEW_GET_VAR(__GLEW_NV_primitive_restart) - -#endif /* GL_NV_primitive_restart */ - -/* ------------------------ GL_NV_register_combiners ----------------------- */ - -#ifndef GL_NV_register_combiners -#define GL_NV_register_combiners 1 - -#define GL_REGISTER_COMBINERS_NV 0x8522 -#define GL_VARIABLE_A_NV 0x8523 -#define GL_VARIABLE_B_NV 0x8524 -#define GL_VARIABLE_C_NV 0x8525 -#define GL_VARIABLE_D_NV 0x8526 -#define GL_VARIABLE_E_NV 0x8527 -#define GL_VARIABLE_F_NV 0x8528 -#define GL_VARIABLE_G_NV 0x8529 -#define GL_CONSTANT_COLOR0_NV 0x852A -#define GL_CONSTANT_COLOR1_NV 0x852B -#define GL_PRIMARY_COLOR_NV 0x852C -#define GL_SECONDARY_COLOR_NV 0x852D -#define GL_SPARE0_NV 0x852E -#define GL_SPARE1_NV 0x852F -#define GL_DISCARD_NV 0x8530 -#define GL_E_TIMES_F_NV 0x8531 -#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 -#define GL_UNSIGNED_IDENTITY_NV 0x8536 -#define GL_UNSIGNED_INVERT_NV 0x8537 -#define GL_EXPAND_NORMAL_NV 0x8538 -#define GL_EXPAND_NEGATE_NV 0x8539 -#define GL_HALF_BIAS_NORMAL_NV 0x853A -#define GL_HALF_BIAS_NEGATE_NV 0x853B -#define GL_SIGNED_IDENTITY_NV 0x853C -#define GL_SIGNED_NEGATE_NV 0x853D -#define GL_SCALE_BY_TWO_NV 0x853E -#define GL_SCALE_BY_FOUR_NV 0x853F -#define GL_SCALE_BY_ONE_HALF_NV 0x8540 -#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 -#define GL_COMBINER_INPUT_NV 0x8542 -#define GL_COMBINER_MAPPING_NV 0x8543 -#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 -#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 -#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 -#define GL_COMBINER_MUX_SUM_NV 0x8547 -#define GL_COMBINER_SCALE_NV 0x8548 -#define GL_COMBINER_BIAS_NV 0x8549 -#define GL_COMBINER_AB_OUTPUT_NV 0x854A -#define GL_COMBINER_CD_OUTPUT_NV 0x854B -#define GL_COMBINER_SUM_OUTPUT_NV 0x854C -#define GL_MAX_GENERAL_COMBINERS_NV 0x854D -#define GL_NUM_GENERAL_COMBINERS_NV 0x854E -#define GL_COLOR_SUM_CLAMP_NV 0x854F -#define GL_COMBINER0_NV 0x8550 -#define GL_COMBINER1_NV 0x8551 -#define GL_COMBINER2_NV 0x8552 -#define GL_COMBINER3_NV 0x8553 -#define GL_COMBINER4_NV 0x8554 -#define GL_COMBINER5_NV 0x8555 -#define GL_COMBINER6_NV 0x8556 -#define GL_COMBINER7_NV 0x8557 - -typedef void (GLAPIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (GLAPIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); -typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint* params); - -#define glCombinerInputNV GLEW_GET_FUN(__glewCombinerInputNV) -#define glCombinerOutputNV GLEW_GET_FUN(__glewCombinerOutputNV) -#define glCombinerParameterfNV GLEW_GET_FUN(__glewCombinerParameterfNV) -#define glCombinerParameterfvNV GLEW_GET_FUN(__glewCombinerParameterfvNV) -#define glCombinerParameteriNV GLEW_GET_FUN(__glewCombinerParameteriNV) -#define glCombinerParameterivNV GLEW_GET_FUN(__glewCombinerParameterivNV) -#define glFinalCombinerInputNV GLEW_GET_FUN(__glewFinalCombinerInputNV) -#define glGetCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetCombinerInputParameterfvNV) -#define glGetCombinerInputParameterivNV GLEW_GET_FUN(__glewGetCombinerInputParameterivNV) -#define glGetCombinerOutputParameterfvNV GLEW_GET_FUN(__glewGetCombinerOutputParameterfvNV) -#define glGetCombinerOutputParameterivNV GLEW_GET_FUN(__glewGetCombinerOutputParameterivNV) -#define glGetFinalCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterfvNV) -#define glGetFinalCombinerInputParameterivNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterivNV) - -#define GLEW_NV_register_combiners GLEW_GET_VAR(__GLEW_NV_register_combiners) - -#endif /* GL_NV_register_combiners */ - -/* ----------------------- GL_NV_register_combiners2 ----------------------- */ - -#ifndef GL_NV_register_combiners2 -#define GL_NV_register_combiners2 1 - -#define GL_PER_STAGE_CONSTANTS_NV 0x8535 - -typedef void (GLAPIENTRY * PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat* params); - -#define glCombinerStageParameterfvNV GLEW_GET_FUN(__glewCombinerStageParameterfvNV) -#define glGetCombinerStageParameterfvNV GLEW_GET_FUN(__glewGetCombinerStageParameterfvNV) - -#define GLEW_NV_register_combiners2 GLEW_GET_VAR(__GLEW_NV_register_combiners2) - -#endif /* GL_NV_register_combiners2 */ - -/* ------------------------- GL_NV_sample_locations ------------------------ */ - -#ifndef GL_NV_sample_locations -#define GL_NV_sample_locations 1 - -#define GL_SAMPLE_LOCATION_NV 0x8E50 -#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D -#define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E -#define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F -#define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340 -#define GL_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341 -#define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342 -#define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343 - -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); - -#define glFramebufferSampleLocationsfvNV GLEW_GET_FUN(__glewFramebufferSampleLocationsfvNV) -#define glNamedFramebufferSampleLocationsfvNV GLEW_GET_FUN(__glewNamedFramebufferSampleLocationsfvNV) - -#define GLEW_NV_sample_locations GLEW_GET_VAR(__GLEW_NV_sample_locations) - -#endif /* GL_NV_sample_locations */ - -/* ------------------ GL_NV_sample_mask_override_coverage ------------------ */ - -#ifndef GL_NV_sample_mask_override_coverage -#define GL_NV_sample_mask_override_coverage 1 - -#define GLEW_NV_sample_mask_override_coverage GLEW_GET_VAR(__GLEW_NV_sample_mask_override_coverage) - -#endif /* GL_NV_sample_mask_override_coverage */ - -/* ---------------------- GL_NV_shader_atomic_counters --------------------- */ - -#ifndef GL_NV_shader_atomic_counters -#define GL_NV_shader_atomic_counters 1 - -#define GLEW_NV_shader_atomic_counters GLEW_GET_VAR(__GLEW_NV_shader_atomic_counters) - -#endif /* GL_NV_shader_atomic_counters */ - -/* ----------------------- GL_NV_shader_atomic_float ----------------------- */ - -#ifndef GL_NV_shader_atomic_float -#define GL_NV_shader_atomic_float 1 - -#define GLEW_NV_shader_atomic_float GLEW_GET_VAR(__GLEW_NV_shader_atomic_float) - -#endif /* GL_NV_shader_atomic_float */ - -/* -------------------- GL_NV_shader_atomic_fp16_vector -------------------- */ - -#ifndef GL_NV_shader_atomic_fp16_vector -#define GL_NV_shader_atomic_fp16_vector 1 - -#define GLEW_NV_shader_atomic_fp16_vector GLEW_GET_VAR(__GLEW_NV_shader_atomic_fp16_vector) - -#endif /* GL_NV_shader_atomic_fp16_vector */ - -/* ----------------------- GL_NV_shader_atomic_int64 ----------------------- */ - -#ifndef GL_NV_shader_atomic_int64 -#define GL_NV_shader_atomic_int64 1 - -#define GLEW_NV_shader_atomic_int64 GLEW_GET_VAR(__GLEW_NV_shader_atomic_int64) - -#endif /* GL_NV_shader_atomic_int64 */ - -/* ------------------------ GL_NV_shader_buffer_load ----------------------- */ - -#ifndef GL_NV_shader_buffer_load -#define GL_NV_shader_buffer_load 1 - -#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D -#define GL_GPU_ADDRESS_NV 0x8F34 -#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 - -typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT* params); -typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT* result); -typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT* params); -typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERRESIDENTNVPROC) (GLenum target); -typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer); -typedef void (GLAPIENTRY * PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target); -typedef void (GLAPIENTRY * PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access); -typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer); -typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); -typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); -typedef void (GLAPIENTRY * PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); -typedef void (GLAPIENTRY * PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); - -#define glGetBufferParameterui64vNV GLEW_GET_FUN(__glewGetBufferParameterui64vNV) -#define glGetIntegerui64vNV GLEW_GET_FUN(__glewGetIntegerui64vNV) -#define glGetNamedBufferParameterui64vNV GLEW_GET_FUN(__glewGetNamedBufferParameterui64vNV) -#define glIsBufferResidentNV GLEW_GET_FUN(__glewIsBufferResidentNV) -#define glIsNamedBufferResidentNV GLEW_GET_FUN(__glewIsNamedBufferResidentNV) -#define glMakeBufferNonResidentNV GLEW_GET_FUN(__glewMakeBufferNonResidentNV) -#define glMakeBufferResidentNV GLEW_GET_FUN(__glewMakeBufferResidentNV) -#define glMakeNamedBufferNonResidentNV GLEW_GET_FUN(__glewMakeNamedBufferNonResidentNV) -#define glMakeNamedBufferResidentNV GLEW_GET_FUN(__glewMakeNamedBufferResidentNV) -#define glProgramUniformui64NV GLEW_GET_FUN(__glewProgramUniformui64NV) -#define glProgramUniformui64vNV GLEW_GET_FUN(__glewProgramUniformui64vNV) -#define glUniformui64NV GLEW_GET_FUN(__glewUniformui64NV) -#define glUniformui64vNV GLEW_GET_FUN(__glewUniformui64vNV) - -#define GLEW_NV_shader_buffer_load GLEW_GET_VAR(__GLEW_NV_shader_buffer_load) - -#endif /* GL_NV_shader_buffer_load */ - -/* ------------------- GL_NV_shader_storage_buffer_object ------------------ */ - -#ifndef GL_NV_shader_storage_buffer_object -#define GL_NV_shader_storage_buffer_object 1 - -#define GLEW_NV_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_NV_shader_storage_buffer_object) - -#endif /* GL_NV_shader_storage_buffer_object */ - -/* ----------------------- GL_NV_shader_thread_group ----------------------- */ - -#ifndef GL_NV_shader_thread_group -#define GL_NV_shader_thread_group 1 - -#define GL_WARP_SIZE_NV 0x9339 -#define GL_WARPS_PER_SM_NV 0x933A -#define GL_SM_COUNT_NV 0x933B - -#define GLEW_NV_shader_thread_group GLEW_GET_VAR(__GLEW_NV_shader_thread_group) - -#endif /* GL_NV_shader_thread_group */ - -/* ---------------------- GL_NV_shader_thread_shuffle ---------------------- */ - -#ifndef GL_NV_shader_thread_shuffle -#define GL_NV_shader_thread_shuffle 1 - -#define GLEW_NV_shader_thread_shuffle GLEW_GET_VAR(__GLEW_NV_shader_thread_shuffle) - -#endif /* GL_NV_shader_thread_shuffle */ - -/* ---------------------- GL_NV_tessellation_program5 ---------------------- */ - -#ifndef GL_NV_tessellation_program5 -#define GL_NV_tessellation_program5 1 - -#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 -#define GL_TESS_CONTROL_PROGRAM_NV 0x891E -#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F -#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 -#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 - -#define GLEW_NV_tessellation_program5 GLEW_GET_VAR(__GLEW_NV_tessellation_program5) - -#endif /* GL_NV_tessellation_program5 */ - -/* -------------------------- GL_NV_texgen_emboss -------------------------- */ - -#ifndef GL_NV_texgen_emboss -#define GL_NV_texgen_emboss 1 - -#define GL_EMBOSS_LIGHT_NV 0x855D -#define GL_EMBOSS_CONSTANT_NV 0x855E -#define GL_EMBOSS_MAP_NV 0x855F - -#define GLEW_NV_texgen_emboss GLEW_GET_VAR(__GLEW_NV_texgen_emboss) - -#endif /* GL_NV_texgen_emboss */ - -/* ------------------------ GL_NV_texgen_reflection ------------------------ */ - -#ifndef GL_NV_texgen_reflection -#define GL_NV_texgen_reflection 1 - -#define GL_NORMAL_MAP_NV 0x8511 -#define GL_REFLECTION_MAP_NV 0x8512 - -#define GLEW_NV_texgen_reflection GLEW_GET_VAR(__GLEW_NV_texgen_reflection) - -#endif /* GL_NV_texgen_reflection */ - -/* ------------------------- GL_NV_texture_barrier ------------------------- */ - -#ifndef GL_NV_texture_barrier -#define GL_NV_texture_barrier 1 - -typedef void (GLAPIENTRY * PFNGLTEXTUREBARRIERNVPROC) (void); - -#define glTextureBarrierNV GLEW_GET_FUN(__glewTextureBarrierNV) - -#define GLEW_NV_texture_barrier GLEW_GET_VAR(__GLEW_NV_texture_barrier) - -#endif /* GL_NV_texture_barrier */ - -/* --------------------- GL_NV_texture_compression_vtc --------------------- */ - -#ifndef GL_NV_texture_compression_vtc -#define GL_NV_texture_compression_vtc 1 - -#define GLEW_NV_texture_compression_vtc GLEW_GET_VAR(__GLEW_NV_texture_compression_vtc) - -#endif /* GL_NV_texture_compression_vtc */ - -/* ----------------------- GL_NV_texture_env_combine4 ---------------------- */ - -#ifndef GL_NV_texture_env_combine4 -#define GL_NV_texture_env_combine4 1 - -#define GL_COMBINE4_NV 0x8503 -#define GL_SOURCE3_RGB_NV 0x8583 -#define GL_SOURCE3_ALPHA_NV 0x858B -#define GL_OPERAND3_RGB_NV 0x8593 -#define GL_OPERAND3_ALPHA_NV 0x859B - -#define GLEW_NV_texture_env_combine4 GLEW_GET_VAR(__GLEW_NV_texture_env_combine4) - -#endif /* GL_NV_texture_env_combine4 */ - -/* ---------------------- GL_NV_texture_expand_normal ---------------------- */ - -#ifndef GL_NV_texture_expand_normal -#define GL_NV_texture_expand_normal 1 - -#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F - -#define GLEW_NV_texture_expand_normal GLEW_GET_VAR(__GLEW_NV_texture_expand_normal) - -#endif /* GL_NV_texture_expand_normal */ - -/* ----------------------- GL_NV_texture_multisample ----------------------- */ - -#ifndef GL_NV_texture_multisample -#define GL_NV_texture_multisample 1 - -#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 -#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 - -typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); -typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); -typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); - -#define glTexImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage2DMultisampleCoverageNV) -#define glTexImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage3DMultisampleCoverageNV) -#define glTextureImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage2DMultisampleCoverageNV) -#define glTextureImage2DMultisampleNV GLEW_GET_FUN(__glewTextureImage2DMultisampleNV) -#define glTextureImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage3DMultisampleCoverageNV) -#define glTextureImage3DMultisampleNV GLEW_GET_FUN(__glewTextureImage3DMultisampleNV) - -#define GLEW_NV_texture_multisample GLEW_GET_VAR(__GLEW_NV_texture_multisample) - -#endif /* GL_NV_texture_multisample */ - -/* ------------------------ GL_NV_texture_rectangle ------------------------ */ - -#ifndef GL_NV_texture_rectangle -#define GL_NV_texture_rectangle 1 - -#define GL_TEXTURE_RECTANGLE_NV 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 - -#define GLEW_NV_texture_rectangle GLEW_GET_VAR(__GLEW_NV_texture_rectangle) - -#endif /* GL_NV_texture_rectangle */ - -/* -------------------------- GL_NV_texture_shader ------------------------- */ - -#ifndef GL_NV_texture_shader -#define GL_NV_texture_shader 1 - -#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C -#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D -#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E -#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 -#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA -#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB -#define GL_DSDT_MAG_INTENSITY_NV 0x86DC -#define GL_SHADER_CONSISTENT_NV 0x86DD -#define GL_TEXTURE_SHADER_NV 0x86DE -#define GL_SHADER_OPERATION_NV 0x86DF -#define GL_CULL_MODES_NV 0x86E0 -#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1 -#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 -#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 -#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 -#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 -#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 -#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 -#define GL_CONST_EYE_NV 0x86E5 -#define GL_PASS_THROUGH_NV 0x86E6 -#define GL_CULL_FRAGMENT_NV 0x86E7 -#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 -#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 -#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA -#define GL_DOT_PRODUCT_NV 0x86EC -#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED -#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE -#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 -#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 -#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 -#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 -#define GL_HILO_NV 0x86F4 -#define GL_DSDT_NV 0x86F5 -#define GL_DSDT_MAG_NV 0x86F6 -#define GL_DSDT_MAG_VIB_NV 0x86F7 -#define GL_HILO16_NV 0x86F8 -#define GL_SIGNED_HILO_NV 0x86F9 -#define GL_SIGNED_HILO16_NV 0x86FA -#define GL_SIGNED_RGBA_NV 0x86FB -#define GL_SIGNED_RGBA8_NV 0x86FC -#define GL_SIGNED_RGB_NV 0x86FE -#define GL_SIGNED_RGB8_NV 0x86FF -#define GL_SIGNED_LUMINANCE_NV 0x8701 -#define GL_SIGNED_LUMINANCE8_NV 0x8702 -#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 -#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 -#define GL_SIGNED_ALPHA_NV 0x8705 -#define GL_SIGNED_ALPHA8_NV 0x8706 -#define GL_SIGNED_INTENSITY_NV 0x8707 -#define GL_SIGNED_INTENSITY8_NV 0x8708 -#define GL_DSDT8_NV 0x8709 -#define GL_DSDT8_MAG8_NV 0x870A -#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B -#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C -#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D -#define GL_HI_SCALE_NV 0x870E -#define GL_LO_SCALE_NV 0x870F -#define GL_DS_SCALE_NV 0x8710 -#define GL_DT_SCALE_NV 0x8711 -#define GL_MAGNITUDE_SCALE_NV 0x8712 -#define GL_VIBRANCE_SCALE_NV 0x8713 -#define GL_HI_BIAS_NV 0x8714 -#define GL_LO_BIAS_NV 0x8715 -#define GL_DS_BIAS_NV 0x8716 -#define GL_DT_BIAS_NV 0x8717 -#define GL_MAGNITUDE_BIAS_NV 0x8718 -#define GL_VIBRANCE_BIAS_NV 0x8719 -#define GL_TEXTURE_BORDER_VALUES_NV 0x871A -#define GL_TEXTURE_HI_SIZE_NV 0x871B -#define GL_TEXTURE_LO_SIZE_NV 0x871C -#define GL_TEXTURE_DS_SIZE_NV 0x871D -#define GL_TEXTURE_DT_SIZE_NV 0x871E -#define GL_TEXTURE_MAG_SIZE_NV 0x871F - -#define GLEW_NV_texture_shader GLEW_GET_VAR(__GLEW_NV_texture_shader) - -#endif /* GL_NV_texture_shader */ - -/* ------------------------- GL_NV_texture_shader2 ------------------------- */ - -#ifndef GL_NV_texture_shader2 -#define GL_NV_texture_shader2 1 - -#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA -#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB -#define GL_DSDT_MAG_INTENSITY_NV 0x86DC -#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF -#define GL_HILO_NV 0x86F4 -#define GL_DSDT_NV 0x86F5 -#define GL_DSDT_MAG_NV 0x86F6 -#define GL_DSDT_MAG_VIB_NV 0x86F7 -#define GL_HILO16_NV 0x86F8 -#define GL_SIGNED_HILO_NV 0x86F9 -#define GL_SIGNED_HILO16_NV 0x86FA -#define GL_SIGNED_RGBA_NV 0x86FB -#define GL_SIGNED_RGBA8_NV 0x86FC -#define GL_SIGNED_RGB_NV 0x86FE -#define GL_SIGNED_RGB8_NV 0x86FF -#define GL_SIGNED_LUMINANCE_NV 0x8701 -#define GL_SIGNED_LUMINANCE8_NV 0x8702 -#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 -#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 -#define GL_SIGNED_ALPHA_NV 0x8705 -#define GL_SIGNED_ALPHA8_NV 0x8706 -#define GL_SIGNED_INTENSITY_NV 0x8707 -#define GL_SIGNED_INTENSITY8_NV 0x8708 -#define GL_DSDT8_NV 0x8709 -#define GL_DSDT8_MAG8_NV 0x870A -#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B -#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C -#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D - -#define GLEW_NV_texture_shader2 GLEW_GET_VAR(__GLEW_NV_texture_shader2) - -#endif /* GL_NV_texture_shader2 */ - -/* ------------------------- GL_NV_texture_shader3 ------------------------- */ - -#ifndef GL_NV_texture_shader3 -#define GL_NV_texture_shader3 1 - -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 -#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 -#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 -#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 -#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 -#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A -#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B -#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C -#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D -#define GL_HILO8_NV 0x885E -#define GL_SIGNED_HILO8_NV 0x885F -#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 - -#define GLEW_NV_texture_shader3 GLEW_GET_VAR(__GLEW_NV_texture_shader3) - -#endif /* GL_NV_texture_shader3 */ - -/* ------------------------ GL_NV_transform_feedback ----------------------- */ - -#ifndef GL_NV_transform_feedback -#define GL_NV_transform_feedback 1 - -#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 -#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 -#define GL_TEXTURE_COORD_NV 0x8C79 -#define GL_CLIP_DISTANCE_NV 0x8C7A -#define GL_VERTEX_ID_NV 0x8C7B -#define GL_PRIMITIVE_ID_NV 0x8C7C -#define GL_GENERIC_ATTRIB_NV 0x8C7D -#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E -#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 -#define GL_ACTIVE_VARYINGS_NV 0x8C81 -#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 -#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 -#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 -#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 -#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 -#define GL_PRIMITIVES_GENERATED_NV 0x8C87 -#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 -#define GL_RASTERIZER_DISCARD_NV 0x8C89 -#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A -#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B -#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C -#define GL_SEPARATE_ATTRIBS_NV 0x8C8D -#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E -#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F - -typedef void (GLAPIENTRY * PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); -typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); -typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); -typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); -typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); -typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); -typedef void (GLAPIENTRY * PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); -typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); -typedef GLint (GLAPIENTRY * PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); -typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); -typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); - -#define glActiveVaryingNV GLEW_GET_FUN(__glewActiveVaryingNV) -#define glBeginTransformFeedbackNV GLEW_GET_FUN(__glewBeginTransformFeedbackNV) -#define glBindBufferBaseNV GLEW_GET_FUN(__glewBindBufferBaseNV) -#define glBindBufferOffsetNV GLEW_GET_FUN(__glewBindBufferOffsetNV) -#define glBindBufferRangeNV GLEW_GET_FUN(__glewBindBufferRangeNV) -#define glEndTransformFeedbackNV GLEW_GET_FUN(__glewEndTransformFeedbackNV) -#define glGetActiveVaryingNV GLEW_GET_FUN(__glewGetActiveVaryingNV) -#define glGetTransformFeedbackVaryingNV GLEW_GET_FUN(__glewGetTransformFeedbackVaryingNV) -#define glGetVaryingLocationNV GLEW_GET_FUN(__glewGetVaryingLocationNV) -#define glTransformFeedbackAttribsNV GLEW_GET_FUN(__glewTransformFeedbackAttribsNV) -#define glTransformFeedbackVaryingsNV GLEW_GET_FUN(__glewTransformFeedbackVaryingsNV) - -#define GLEW_NV_transform_feedback GLEW_GET_VAR(__GLEW_NV_transform_feedback) - -#endif /* GL_NV_transform_feedback */ - -/* ----------------------- GL_NV_transform_feedback2 ----------------------- */ - -#ifndef GL_NV_transform_feedback2 -#define GL_NV_transform_feedback2 1 - -#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 -#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 -#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 -#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 - -typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); -typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint* ids); -typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); -typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint* ids); -typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); -typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); -typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); - -#define glBindTransformFeedbackNV GLEW_GET_FUN(__glewBindTransformFeedbackNV) -#define glDeleteTransformFeedbacksNV GLEW_GET_FUN(__glewDeleteTransformFeedbacksNV) -#define glDrawTransformFeedbackNV GLEW_GET_FUN(__glewDrawTransformFeedbackNV) -#define glGenTransformFeedbacksNV GLEW_GET_FUN(__glewGenTransformFeedbacksNV) -#define glIsTransformFeedbackNV GLEW_GET_FUN(__glewIsTransformFeedbackNV) -#define glPauseTransformFeedbackNV GLEW_GET_FUN(__glewPauseTransformFeedbackNV) -#define glResumeTransformFeedbackNV GLEW_GET_FUN(__glewResumeTransformFeedbackNV) - -#define GLEW_NV_transform_feedback2 GLEW_GET_VAR(__GLEW_NV_transform_feedback2) - -#endif /* GL_NV_transform_feedback2 */ - -/* ------------------ GL_NV_uniform_buffer_unified_memory ------------------ */ - -#ifndef GL_NV_uniform_buffer_unified_memory -#define GL_NV_uniform_buffer_unified_memory 1 - -#define GL_UNIFORM_BUFFER_UNIFIED_NV 0x936E -#define GL_UNIFORM_BUFFER_ADDRESS_NV 0x936F -#define GL_UNIFORM_BUFFER_LENGTH_NV 0x9370 - -#define GLEW_NV_uniform_buffer_unified_memory GLEW_GET_VAR(__GLEW_NV_uniform_buffer_unified_memory) - -#endif /* GL_NV_uniform_buffer_unified_memory */ - -/* -------------------------- GL_NV_vdpau_interop -------------------------- */ - -#ifndef GL_NV_vdpau_interop -#define GL_NV_vdpau_interop 1 - -#define GL_SURFACE_STATE_NV 0x86EB -#define GL_SURFACE_REGISTERED_NV 0x86FD -#define GL_SURFACE_MAPPED_NV 0x8700 -#define GL_WRITE_DISCARD_NV 0x88BE - -typedef GLintptr GLvdpauSurfaceNV; - -typedef void (GLAPIENTRY * PFNGLVDPAUFININVPROC) (void); -typedef void (GLAPIENTRY * PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values); -typedef void (GLAPIENTRY * PFNGLVDPAUINITNVPROC) (const void* vdpDevice, const void*getProcAddress); -typedef void (GLAPIENTRY * PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); -typedef void (GLAPIENTRY * PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV* surfaces); -typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); -typedef void (GLAPIENTRY * PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); -typedef void (GLAPIENTRY * PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV* surfaces); -typedef void (GLAPIENTRY * PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); - -#define glVDPAUFiniNV GLEW_GET_FUN(__glewVDPAUFiniNV) -#define glVDPAUGetSurfaceivNV GLEW_GET_FUN(__glewVDPAUGetSurfaceivNV) -#define glVDPAUInitNV GLEW_GET_FUN(__glewVDPAUInitNV) -#define glVDPAUIsSurfaceNV GLEW_GET_FUN(__glewVDPAUIsSurfaceNV) -#define glVDPAUMapSurfacesNV GLEW_GET_FUN(__glewVDPAUMapSurfacesNV) -#define glVDPAURegisterOutputSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterOutputSurfaceNV) -#define glVDPAURegisterVideoSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterVideoSurfaceNV) -#define glVDPAUSurfaceAccessNV GLEW_GET_FUN(__glewVDPAUSurfaceAccessNV) -#define glVDPAUUnmapSurfacesNV GLEW_GET_FUN(__glewVDPAUUnmapSurfacesNV) -#define glVDPAUUnregisterSurfaceNV GLEW_GET_FUN(__glewVDPAUUnregisterSurfaceNV) - -#define GLEW_NV_vdpau_interop GLEW_GET_VAR(__GLEW_NV_vdpau_interop) - -#endif /* GL_NV_vdpau_interop */ - -/* ------------------------ GL_NV_vertex_array_range ----------------------- */ - -#ifndef GL_NV_vertex_array_range -#define GL_NV_vertex_array_range 1 - -#define GL_VERTEX_ARRAY_RANGE_NV 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E -#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F -#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 -#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 - -typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); -typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, void *pointer); - -#define glFlushVertexArrayRangeNV GLEW_GET_FUN(__glewFlushVertexArrayRangeNV) -#define glVertexArrayRangeNV GLEW_GET_FUN(__glewVertexArrayRangeNV) - -#define GLEW_NV_vertex_array_range GLEW_GET_VAR(__GLEW_NV_vertex_array_range) - -#endif /* GL_NV_vertex_array_range */ - -/* ----------------------- GL_NV_vertex_array_range2 ----------------------- */ - -#ifndef GL_NV_vertex_array_range2 -#define GL_NV_vertex_array_range2 1 - -#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 - -#define GLEW_NV_vertex_array_range2 GLEW_GET_VAR(__GLEW_NV_vertex_array_range2) - -#endif /* GL_NV_vertex_array_range2 */ - -/* ------------------- GL_NV_vertex_attrib_integer_64bit ------------------- */ - -#ifndef GL_NV_vertex_attrib_integer_64bit -#define GL_NV_vertex_attrib_integer_64bit 1 - -#define GL_INT64_NV 0x140E -#define GL_UNSIGNED_INT64_NV 0x140F - -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT* params); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); - -#define glGetVertexAttribLi64vNV GLEW_GET_FUN(__glewGetVertexAttribLi64vNV) -#define glGetVertexAttribLui64vNV GLEW_GET_FUN(__glewGetVertexAttribLui64vNV) -#define glVertexAttribL1i64NV GLEW_GET_FUN(__glewVertexAttribL1i64NV) -#define glVertexAttribL1i64vNV GLEW_GET_FUN(__glewVertexAttribL1i64vNV) -#define glVertexAttribL1ui64NV GLEW_GET_FUN(__glewVertexAttribL1ui64NV) -#define glVertexAttribL1ui64vNV GLEW_GET_FUN(__glewVertexAttribL1ui64vNV) -#define glVertexAttribL2i64NV GLEW_GET_FUN(__glewVertexAttribL2i64NV) -#define glVertexAttribL2i64vNV GLEW_GET_FUN(__glewVertexAttribL2i64vNV) -#define glVertexAttribL2ui64NV GLEW_GET_FUN(__glewVertexAttribL2ui64NV) -#define glVertexAttribL2ui64vNV GLEW_GET_FUN(__glewVertexAttribL2ui64vNV) -#define glVertexAttribL3i64NV GLEW_GET_FUN(__glewVertexAttribL3i64NV) -#define glVertexAttribL3i64vNV GLEW_GET_FUN(__glewVertexAttribL3i64vNV) -#define glVertexAttribL3ui64NV GLEW_GET_FUN(__glewVertexAttribL3ui64NV) -#define glVertexAttribL3ui64vNV GLEW_GET_FUN(__glewVertexAttribL3ui64vNV) -#define glVertexAttribL4i64NV GLEW_GET_FUN(__glewVertexAttribL4i64NV) -#define glVertexAttribL4i64vNV GLEW_GET_FUN(__glewVertexAttribL4i64vNV) -#define glVertexAttribL4ui64NV GLEW_GET_FUN(__glewVertexAttribL4ui64NV) -#define glVertexAttribL4ui64vNV GLEW_GET_FUN(__glewVertexAttribL4ui64vNV) -#define glVertexAttribLFormatNV GLEW_GET_FUN(__glewVertexAttribLFormatNV) - -#define GLEW_NV_vertex_attrib_integer_64bit GLEW_GET_VAR(__GLEW_NV_vertex_attrib_integer_64bit) - -#endif /* GL_NV_vertex_attrib_integer_64bit */ - -/* ------------------- GL_NV_vertex_buffer_unified_memory ------------------ */ - -#ifndef GL_NV_vertex_buffer_unified_memory -#define GL_NV_vertex_buffer_unified_memory 1 - -#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E -#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F -#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 -#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 -#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 -#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 -#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 -#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 -#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 -#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 -#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 -#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 -#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A -#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B -#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C -#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D -#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E -#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F -#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 -#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 -#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 -#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 -#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 -#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 -#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 - -typedef void (GLAPIENTRY * PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); -typedef void (GLAPIENTRY * PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); -typedef void (GLAPIENTRY * PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride); -typedef void (GLAPIENTRY * PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride); -typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT result[]); -typedef void (GLAPIENTRY * PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride); -typedef void (GLAPIENTRY * PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride); -typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); -typedef void (GLAPIENTRY * PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); -typedef void (GLAPIENTRY * PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); - -#define glBufferAddressRangeNV GLEW_GET_FUN(__glewBufferAddressRangeNV) -#define glColorFormatNV GLEW_GET_FUN(__glewColorFormatNV) -#define glEdgeFlagFormatNV GLEW_GET_FUN(__glewEdgeFlagFormatNV) -#define glFogCoordFormatNV GLEW_GET_FUN(__glewFogCoordFormatNV) -#define glGetIntegerui64i_vNV GLEW_GET_FUN(__glewGetIntegerui64i_vNV) -#define glIndexFormatNV GLEW_GET_FUN(__glewIndexFormatNV) -#define glNormalFormatNV GLEW_GET_FUN(__glewNormalFormatNV) -#define glSecondaryColorFormatNV GLEW_GET_FUN(__glewSecondaryColorFormatNV) -#define glTexCoordFormatNV GLEW_GET_FUN(__glewTexCoordFormatNV) -#define glVertexAttribFormatNV GLEW_GET_FUN(__glewVertexAttribFormatNV) -#define glVertexAttribIFormatNV GLEW_GET_FUN(__glewVertexAttribIFormatNV) -#define glVertexFormatNV GLEW_GET_FUN(__glewVertexFormatNV) - -#define GLEW_NV_vertex_buffer_unified_memory GLEW_GET_VAR(__GLEW_NV_vertex_buffer_unified_memory) - -#endif /* GL_NV_vertex_buffer_unified_memory */ - -/* -------------------------- GL_NV_vertex_program ------------------------- */ - -#ifndef GL_NV_vertex_program -#define GL_NV_vertex_program 1 - -#define GL_VERTEX_PROGRAM_NV 0x8620 -#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 -#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 -#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 -#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 -#define GL_CURRENT_ATTRIB_NV 0x8626 -#define GL_PROGRAM_LENGTH_NV 0x8627 -#define GL_PROGRAM_STRING_NV 0x8628 -#define GL_MODELVIEW_PROJECTION_NV 0x8629 -#define GL_IDENTITY_NV 0x862A -#define GL_INVERSE_NV 0x862B -#define GL_TRANSPOSE_NV 0x862C -#define GL_INVERSE_TRANSPOSE_NV 0x862D -#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E -#define GL_MAX_TRACK_MATRICES_NV 0x862F -#define GL_MATRIX0_NV 0x8630 -#define GL_MATRIX1_NV 0x8631 -#define GL_MATRIX2_NV 0x8632 -#define GL_MATRIX3_NV 0x8633 -#define GL_MATRIX4_NV 0x8634 -#define GL_MATRIX5_NV 0x8635 -#define GL_MATRIX6_NV 0x8636 -#define GL_MATRIX7_NV 0x8637 -#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 -#define GL_CURRENT_MATRIX_NV 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 -#define GL_PROGRAM_PARAMETER_NV 0x8644 -#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 -#define GL_PROGRAM_TARGET_NV 0x8646 -#define GL_PROGRAM_RESIDENT_NV 0x8647 -#define GL_TRACK_MATRIX_NV 0x8648 -#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 -#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A -#define GL_PROGRAM_ERROR_POSITION_NV 0x864B -#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 -#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 -#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 -#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 -#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 -#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 -#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 -#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 -#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 -#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 -#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A -#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B -#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C -#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D -#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E -#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F -#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 -#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 -#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 -#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 -#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 -#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 -#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 -#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 -#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 -#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 -#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A -#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B -#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C -#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D -#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E -#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F -#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 -#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 -#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 -#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 -#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 -#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 -#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 -#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 -#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 -#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 -#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A -#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B -#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C -#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D -#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E -#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F - -typedef GLboolean (GLAPIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint* ids, GLboolean *residences); -typedef void (GLAPIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); -typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint* ids); -typedef void (GLAPIENTRY * PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint* ids); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte* program); -typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, void** pointer); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint* params); -typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMNVPROC) (GLuint id); -typedef void (GLAPIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte* program); -typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble* params); -typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLdouble* params); -typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, GLuint* ids); -typedef void (GLAPIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); -typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei n, const GLubyte* v); - -#define glAreProgramsResidentNV GLEW_GET_FUN(__glewAreProgramsResidentNV) -#define glBindProgramNV GLEW_GET_FUN(__glewBindProgramNV) -#define glDeleteProgramsNV GLEW_GET_FUN(__glewDeleteProgramsNV) -#define glExecuteProgramNV GLEW_GET_FUN(__glewExecuteProgramNV) -#define glGenProgramsNV GLEW_GET_FUN(__glewGenProgramsNV) -#define glGetProgramParameterdvNV GLEW_GET_FUN(__glewGetProgramParameterdvNV) -#define glGetProgramParameterfvNV GLEW_GET_FUN(__glewGetProgramParameterfvNV) -#define glGetProgramStringNV GLEW_GET_FUN(__glewGetProgramStringNV) -#define glGetProgramivNV GLEW_GET_FUN(__glewGetProgramivNV) -#define glGetTrackMatrixivNV GLEW_GET_FUN(__glewGetTrackMatrixivNV) -#define glGetVertexAttribPointervNV GLEW_GET_FUN(__glewGetVertexAttribPointervNV) -#define glGetVertexAttribdvNV GLEW_GET_FUN(__glewGetVertexAttribdvNV) -#define glGetVertexAttribfvNV GLEW_GET_FUN(__glewGetVertexAttribfvNV) -#define glGetVertexAttribivNV GLEW_GET_FUN(__glewGetVertexAttribivNV) -#define glIsProgramNV GLEW_GET_FUN(__glewIsProgramNV) -#define glLoadProgramNV GLEW_GET_FUN(__glewLoadProgramNV) -#define glProgramParameter4dNV GLEW_GET_FUN(__glewProgramParameter4dNV) -#define glProgramParameter4dvNV GLEW_GET_FUN(__glewProgramParameter4dvNV) -#define glProgramParameter4fNV GLEW_GET_FUN(__glewProgramParameter4fNV) -#define glProgramParameter4fvNV GLEW_GET_FUN(__glewProgramParameter4fvNV) -#define glProgramParameters4dvNV GLEW_GET_FUN(__glewProgramParameters4dvNV) -#define glProgramParameters4fvNV GLEW_GET_FUN(__glewProgramParameters4fvNV) -#define glRequestResidentProgramsNV GLEW_GET_FUN(__glewRequestResidentProgramsNV) -#define glTrackMatrixNV GLEW_GET_FUN(__glewTrackMatrixNV) -#define glVertexAttrib1dNV GLEW_GET_FUN(__glewVertexAttrib1dNV) -#define glVertexAttrib1dvNV GLEW_GET_FUN(__glewVertexAttrib1dvNV) -#define glVertexAttrib1fNV GLEW_GET_FUN(__glewVertexAttrib1fNV) -#define glVertexAttrib1fvNV GLEW_GET_FUN(__glewVertexAttrib1fvNV) -#define glVertexAttrib1sNV GLEW_GET_FUN(__glewVertexAttrib1sNV) -#define glVertexAttrib1svNV GLEW_GET_FUN(__glewVertexAttrib1svNV) -#define glVertexAttrib2dNV GLEW_GET_FUN(__glewVertexAttrib2dNV) -#define glVertexAttrib2dvNV GLEW_GET_FUN(__glewVertexAttrib2dvNV) -#define glVertexAttrib2fNV GLEW_GET_FUN(__glewVertexAttrib2fNV) -#define glVertexAttrib2fvNV GLEW_GET_FUN(__glewVertexAttrib2fvNV) -#define glVertexAttrib2sNV GLEW_GET_FUN(__glewVertexAttrib2sNV) -#define glVertexAttrib2svNV GLEW_GET_FUN(__glewVertexAttrib2svNV) -#define glVertexAttrib3dNV GLEW_GET_FUN(__glewVertexAttrib3dNV) -#define glVertexAttrib3dvNV GLEW_GET_FUN(__glewVertexAttrib3dvNV) -#define glVertexAttrib3fNV GLEW_GET_FUN(__glewVertexAttrib3fNV) -#define glVertexAttrib3fvNV GLEW_GET_FUN(__glewVertexAttrib3fvNV) -#define glVertexAttrib3sNV GLEW_GET_FUN(__glewVertexAttrib3sNV) -#define glVertexAttrib3svNV GLEW_GET_FUN(__glewVertexAttrib3svNV) -#define glVertexAttrib4dNV GLEW_GET_FUN(__glewVertexAttrib4dNV) -#define glVertexAttrib4dvNV GLEW_GET_FUN(__glewVertexAttrib4dvNV) -#define glVertexAttrib4fNV GLEW_GET_FUN(__glewVertexAttrib4fNV) -#define glVertexAttrib4fvNV GLEW_GET_FUN(__glewVertexAttrib4fvNV) -#define glVertexAttrib4sNV GLEW_GET_FUN(__glewVertexAttrib4sNV) -#define glVertexAttrib4svNV GLEW_GET_FUN(__glewVertexAttrib4svNV) -#define glVertexAttrib4ubNV GLEW_GET_FUN(__glewVertexAttrib4ubNV) -#define glVertexAttrib4ubvNV GLEW_GET_FUN(__glewVertexAttrib4ubvNV) -#define glVertexAttribPointerNV GLEW_GET_FUN(__glewVertexAttribPointerNV) -#define glVertexAttribs1dvNV GLEW_GET_FUN(__glewVertexAttribs1dvNV) -#define glVertexAttribs1fvNV GLEW_GET_FUN(__glewVertexAttribs1fvNV) -#define glVertexAttribs1svNV GLEW_GET_FUN(__glewVertexAttribs1svNV) -#define glVertexAttribs2dvNV GLEW_GET_FUN(__glewVertexAttribs2dvNV) -#define glVertexAttribs2fvNV GLEW_GET_FUN(__glewVertexAttribs2fvNV) -#define glVertexAttribs2svNV GLEW_GET_FUN(__glewVertexAttribs2svNV) -#define glVertexAttribs3dvNV GLEW_GET_FUN(__glewVertexAttribs3dvNV) -#define glVertexAttribs3fvNV GLEW_GET_FUN(__glewVertexAttribs3fvNV) -#define glVertexAttribs3svNV GLEW_GET_FUN(__glewVertexAttribs3svNV) -#define glVertexAttribs4dvNV GLEW_GET_FUN(__glewVertexAttribs4dvNV) -#define glVertexAttribs4fvNV GLEW_GET_FUN(__glewVertexAttribs4fvNV) -#define glVertexAttribs4svNV GLEW_GET_FUN(__glewVertexAttribs4svNV) -#define glVertexAttribs4ubvNV GLEW_GET_FUN(__glewVertexAttribs4ubvNV) - -#define GLEW_NV_vertex_program GLEW_GET_VAR(__GLEW_NV_vertex_program) - -#endif /* GL_NV_vertex_program */ - -/* ------------------------ GL_NV_vertex_program1_1 ------------------------ */ - -#ifndef GL_NV_vertex_program1_1 -#define GL_NV_vertex_program1_1 1 - -#define GLEW_NV_vertex_program1_1 GLEW_GET_VAR(__GLEW_NV_vertex_program1_1) - -#endif /* GL_NV_vertex_program1_1 */ - -/* ------------------------- GL_NV_vertex_program2 ------------------------- */ - -#ifndef GL_NV_vertex_program2 -#define GL_NV_vertex_program2 1 - -#define GLEW_NV_vertex_program2 GLEW_GET_VAR(__GLEW_NV_vertex_program2) - -#endif /* GL_NV_vertex_program2 */ - -/* ---------------------- GL_NV_vertex_program2_option --------------------- */ - -#ifndef GL_NV_vertex_program2_option -#define GL_NV_vertex_program2_option 1 - -#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 -#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 - -#define GLEW_NV_vertex_program2_option GLEW_GET_VAR(__GLEW_NV_vertex_program2_option) - -#endif /* GL_NV_vertex_program2_option */ - -/* ------------------------- GL_NV_vertex_program3 ------------------------- */ - -#ifndef GL_NV_vertex_program3 -#define GL_NV_vertex_program3 1 - -#define MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C - -#define GLEW_NV_vertex_program3 GLEW_GET_VAR(__GLEW_NV_vertex_program3) - -#endif /* GL_NV_vertex_program3 */ - -/* ------------------------- GL_NV_vertex_program4 ------------------------- */ - -#ifndef GL_NV_vertex_program4 -#define GL_NV_vertex_program4 1 - -#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD - -#define GLEW_NV_vertex_program4 GLEW_GET_VAR(__GLEW_NV_vertex_program4) - -#endif /* GL_NV_vertex_program4 */ - -/* -------------------------- GL_NV_video_capture -------------------------- */ - -#ifndef GL_NV_video_capture -#define GL_NV_video_capture 1 - -#define GL_VIDEO_BUFFER_NV 0x9020 -#define GL_VIDEO_BUFFER_BINDING_NV 0x9021 -#define GL_FIELD_UPPER_NV 0x9022 -#define GL_FIELD_LOWER_NV 0x9023 -#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 -#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 -#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 -#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 -#define GL_VIDEO_BUFFER_PITCH_NV 0x9028 -#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 -#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A -#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B -#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C -#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D -#define GL_PARTIAL_SUCCESS_NV 0x902E -#define GL_SUCCESS_NV 0x902F -#define GL_FAILURE_NV 0x9030 -#define GL_YCBYCR8_422_NV 0x9031 -#define GL_YCBAYCR8A_4224_NV 0x9032 -#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 -#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 -#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 -#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 -#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 -#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 -#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 -#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A -#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B -#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C - -typedef void (GLAPIENTRY * PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); -typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); -typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); -typedef void (GLAPIENTRY * PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); -typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble* params); -typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint* params); -typedef GLenum (GLAPIENTRY * PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint* sequence_num, GLuint64EXT *capture_time); -typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble* params); -typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint* params); - -#define glBeginVideoCaptureNV GLEW_GET_FUN(__glewBeginVideoCaptureNV) -#define glBindVideoCaptureStreamBufferNV GLEW_GET_FUN(__glewBindVideoCaptureStreamBufferNV) -#define glBindVideoCaptureStreamTextureNV GLEW_GET_FUN(__glewBindVideoCaptureStreamTextureNV) -#define glEndVideoCaptureNV GLEW_GET_FUN(__glewEndVideoCaptureNV) -#define glGetVideoCaptureStreamdvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamdvNV) -#define glGetVideoCaptureStreamfvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamfvNV) -#define glGetVideoCaptureStreamivNV GLEW_GET_FUN(__glewGetVideoCaptureStreamivNV) -#define glGetVideoCaptureivNV GLEW_GET_FUN(__glewGetVideoCaptureivNV) -#define glVideoCaptureNV GLEW_GET_FUN(__glewVideoCaptureNV) -#define glVideoCaptureStreamParameterdvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterdvNV) -#define glVideoCaptureStreamParameterfvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterfvNV) -#define glVideoCaptureStreamParameterivNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterivNV) - -#define GLEW_NV_video_capture GLEW_GET_VAR(__GLEW_NV_video_capture) - -#endif /* GL_NV_video_capture */ - -/* ------------------------- GL_NV_viewport_array2 ------------------------- */ - -#ifndef GL_NV_viewport_array2 -#define GL_NV_viewport_array2 1 - -#define GLEW_NV_viewport_array2 GLEW_GET_VAR(__GLEW_NV_viewport_array2) - -#endif /* GL_NV_viewport_array2 */ - -/* ------------------------ GL_OES_byte_coordinates ------------------------ */ - -#ifndef GL_OES_byte_coordinates -#define GL_OES_byte_coordinates 1 - -#define GLEW_OES_byte_coordinates GLEW_GET_VAR(__GLEW_OES_byte_coordinates) - -#endif /* GL_OES_byte_coordinates */ - -/* ------------------- GL_OES_compressed_paletted_texture ------------------ */ - -#ifndef GL_OES_compressed_paletted_texture -#define GL_OES_compressed_paletted_texture 1 - -#define GL_PALETTE4_RGB8_OES 0x8B90 -#define GL_PALETTE4_RGBA8_OES 0x8B91 -#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 -#define GL_PALETTE4_RGBA4_OES 0x8B93 -#define GL_PALETTE4_RGB5_A1_OES 0x8B94 -#define GL_PALETTE8_RGB8_OES 0x8B95 -#define GL_PALETTE8_RGBA8_OES 0x8B96 -#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 -#define GL_PALETTE8_RGBA4_OES 0x8B98 -#define GL_PALETTE8_RGB5_A1_OES 0x8B99 - -#define GLEW_OES_compressed_paletted_texture GLEW_GET_VAR(__GLEW_OES_compressed_paletted_texture) - -#endif /* GL_OES_compressed_paletted_texture */ - -/* --------------------------- GL_OES_read_format -------------------------- */ - -#ifndef GL_OES_read_format -#define GL_OES_read_format 1 - -#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B - -#define GLEW_OES_read_format GLEW_GET_VAR(__GLEW_OES_read_format) - -#endif /* GL_OES_read_format */ - -/* ------------------------ GL_OES_single_precision ------------------------ */ - -#ifndef GL_OES_single_precision -#define GL_OES_single_precision 1 - -typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFOESPROC) (GLclampf depth); -typedef void (GLAPIENTRY * PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat* equation); -typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f); -typedef void (GLAPIENTRY * PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); -typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat* equation); -typedef void (GLAPIENTRY * PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); - -#define glClearDepthfOES GLEW_GET_FUN(__glewClearDepthfOES) -#define glClipPlanefOES GLEW_GET_FUN(__glewClipPlanefOES) -#define glDepthRangefOES GLEW_GET_FUN(__glewDepthRangefOES) -#define glFrustumfOES GLEW_GET_FUN(__glewFrustumfOES) -#define glGetClipPlanefOES GLEW_GET_FUN(__glewGetClipPlanefOES) -#define glOrthofOES GLEW_GET_FUN(__glewOrthofOES) - -#define GLEW_OES_single_precision GLEW_GET_VAR(__GLEW_OES_single_precision) - -#endif /* GL_OES_single_precision */ - -/* ---------------------------- GL_OML_interlace --------------------------- */ - -#ifndef GL_OML_interlace -#define GL_OML_interlace 1 - -#define GL_INTERLACE_OML 0x8980 -#define GL_INTERLACE_READ_OML 0x8981 - -#define GLEW_OML_interlace GLEW_GET_VAR(__GLEW_OML_interlace) - -#endif /* GL_OML_interlace */ - -/* ---------------------------- GL_OML_resample ---------------------------- */ - -#ifndef GL_OML_resample -#define GL_OML_resample 1 - -#define GL_PACK_RESAMPLE_OML 0x8984 -#define GL_UNPACK_RESAMPLE_OML 0x8985 -#define GL_RESAMPLE_REPLICATE_OML 0x8986 -#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 -#define GL_RESAMPLE_AVERAGE_OML 0x8988 -#define GL_RESAMPLE_DECIMATE_OML 0x8989 - -#define GLEW_OML_resample GLEW_GET_VAR(__GLEW_OML_resample) - -#endif /* GL_OML_resample */ - -/* ---------------------------- GL_OML_subsample --------------------------- */ - -#ifndef GL_OML_subsample -#define GL_OML_subsample 1 - -#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 -#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 - -#define GLEW_OML_subsample GLEW_GET_VAR(__GLEW_OML_subsample) - -#endif /* GL_OML_subsample */ - -/* ---------------------------- GL_OVR_multiview --------------------------- */ - -#ifndef GL_OVR_multiview -#define GL_OVR_multiview 1 - -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630 -#define GL_MAX_VIEWS_OVR 0x9631 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR 0x9632 -#define GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR 0x9633 - -typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); - -#define glFramebufferTextureMultiviewOVR GLEW_GET_FUN(__glewFramebufferTextureMultiviewOVR) - -#define GLEW_OVR_multiview GLEW_GET_VAR(__GLEW_OVR_multiview) - -#endif /* GL_OVR_multiview */ - -/* --------------------------- GL_OVR_multiview2 --------------------------- */ - -#ifndef GL_OVR_multiview2 -#define GL_OVR_multiview2 1 - -#define GLEW_OVR_multiview2 GLEW_GET_VAR(__GLEW_OVR_multiview2) - -#endif /* GL_OVR_multiview2 */ - -/* --------------------------- GL_PGI_misc_hints --------------------------- */ - -#ifndef GL_PGI_misc_hints -#define GL_PGI_misc_hints 1 - -#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000 -#define GL_CONSERVE_MEMORY_HINT_PGI 107005 -#define GL_RECLAIM_MEMORY_HINT_PGI 107006 -#define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 -#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011 -#define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012 -#define GL_ALWAYS_FAST_HINT_PGI 107020 -#define GL_ALWAYS_SOFT_HINT_PGI 107021 -#define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022 -#define GL_ALLOW_DRAW_WIN_HINT_PGI 107023 -#define GL_ALLOW_DRAW_FRG_HINT_PGI 107024 -#define GL_ALLOW_DRAW_MEM_HINT_PGI 107025 -#define GL_STRICT_DEPTHFUNC_HINT_PGI 107030 -#define GL_STRICT_LIGHTING_HINT_PGI 107031 -#define GL_STRICT_SCISSOR_HINT_PGI 107032 -#define GL_FULL_STIPPLE_HINT_PGI 107033 -#define GL_CLIP_NEAR_HINT_PGI 107040 -#define GL_CLIP_FAR_HINT_PGI 107041 -#define GL_WIDE_LINE_HINT_PGI 107042 -#define GL_BACK_NORMALS_HINT_PGI 107043 - -#define GLEW_PGI_misc_hints GLEW_GET_VAR(__GLEW_PGI_misc_hints) - -#endif /* GL_PGI_misc_hints */ - -/* -------------------------- GL_PGI_vertex_hints -------------------------- */ - -#ifndef GL_PGI_vertex_hints -#define GL_PGI_vertex_hints 1 - -#define GL_VERTEX23_BIT_PGI 0x00000004 -#define GL_VERTEX4_BIT_PGI 0x00000008 -#define GL_COLOR3_BIT_PGI 0x00010000 -#define GL_COLOR4_BIT_PGI 0x00020000 -#define GL_EDGEFLAG_BIT_PGI 0x00040000 -#define GL_INDEX_BIT_PGI 0x00080000 -#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 -#define GL_VERTEX_DATA_HINT_PGI 107050 -#define GL_VERTEX_CONSISTENT_HINT_PGI 107051 -#define GL_MATERIAL_SIDE_HINT_PGI 107052 -#define GL_MAX_VERTEX_HINT_PGI 107053 -#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 -#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 -#define GL_MAT_EMISSION_BIT_PGI 0x00800000 -#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 -#define GL_MAT_SHININESS_BIT_PGI 0x02000000 -#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 -#define GL_NORMAL_BIT_PGI 0x08000000 -#define GL_TEXCOORD1_BIT_PGI 0x10000000 -#define GL_TEXCOORD2_BIT_PGI 0x20000000 -#define GL_TEXCOORD3_BIT_PGI 0x40000000 -#define GL_TEXCOORD4_BIT_PGI 0x80000000 - -#define GLEW_PGI_vertex_hints GLEW_GET_VAR(__GLEW_PGI_vertex_hints) - -#endif /* GL_PGI_vertex_hints */ - -/* ---------------------- GL_REGAL_ES1_0_compatibility --------------------- */ - -#ifndef GL_REGAL_ES1_0_compatibility -#define GL_REGAL_ES1_0_compatibility 1 - -typedef int GLclampx; - -typedef void (GLAPIENTRY * PFNGLALPHAFUNCXPROC) (GLenum func, GLclampx ref); -typedef void (GLAPIENTRY * PFNGLCLEARCOLORXPROC) (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha); -typedef void (GLAPIENTRY * PFNGLCLEARDEPTHXPROC) (GLclampx depth); -typedef void (GLAPIENTRY * PFNGLCOLOR4XPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); -typedef void (GLAPIENTRY * PFNGLDEPTHRANGEXPROC) (GLclampx zNear, GLclampx zFar); -typedef void (GLAPIENTRY * PFNGLFOGXPROC) (GLenum pname, GLfixed param); -typedef void (GLAPIENTRY * PFNGLFOGXVPROC) (GLenum pname, const GLfixed* params); -typedef void (GLAPIENTRY * PFNGLFRUSTUMFPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); -typedef void (GLAPIENTRY * PFNGLFRUSTUMXPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); -typedef void (GLAPIENTRY * PFNGLLIGHTMODELXPROC) (GLenum pname, GLfixed param); -typedef void (GLAPIENTRY * PFNGLLIGHTMODELXVPROC) (GLenum pname, const GLfixed* params); -typedef void (GLAPIENTRY * PFNGLLIGHTXPROC) (GLenum light, GLenum pname, GLfixed param); -typedef void (GLAPIENTRY * PFNGLLIGHTXVPROC) (GLenum light, GLenum pname, const GLfixed* params); -typedef void (GLAPIENTRY * PFNGLLINEWIDTHXPROC) (GLfixed width); -typedef void (GLAPIENTRY * PFNGLLOADMATRIXXPROC) (const GLfixed* m); -typedef void (GLAPIENTRY * PFNGLMATERIALXPROC) (GLenum face, GLenum pname, GLfixed param); -typedef void (GLAPIENTRY * PFNGLMATERIALXVPROC) (GLenum face, GLenum pname, const GLfixed* params); -typedef void (GLAPIENTRY * PFNGLMULTMATRIXXPROC) (const GLfixed* m); -typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4XPROC) (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q); -typedef void (GLAPIENTRY * PFNGLNORMAL3XPROC) (GLfixed nx, GLfixed ny, GLfixed nz); -typedef void (GLAPIENTRY * PFNGLORTHOFPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); -typedef void (GLAPIENTRY * PFNGLORTHOXPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); -typedef void (GLAPIENTRY * PFNGLPOINTSIZEXPROC) (GLfixed size); -typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETXPROC) (GLfixed factor, GLfixed units); -typedef void (GLAPIENTRY * PFNGLROTATEXPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); -typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEXPROC) (GLclampx value, GLboolean invert); -typedef void (GLAPIENTRY * PFNGLSCALEXPROC) (GLfixed x, GLfixed y, GLfixed z); -typedef void (GLAPIENTRY * PFNGLTEXENVXPROC) (GLenum target, GLenum pname, GLfixed param); -typedef void (GLAPIENTRY * PFNGLTEXENVXVPROC) (GLenum target, GLenum pname, const GLfixed* params); -typedef void (GLAPIENTRY * PFNGLTEXPARAMETERXPROC) (GLenum target, GLenum pname, GLfixed param); -typedef void (GLAPIENTRY * PFNGLTRANSLATEXPROC) (GLfixed x, GLfixed y, GLfixed z); - -#define glAlphaFuncx GLEW_GET_FUN(__glewAlphaFuncx) -#define glClearColorx GLEW_GET_FUN(__glewClearColorx) -#define glClearDepthx GLEW_GET_FUN(__glewClearDepthx) -#define glColor4x GLEW_GET_FUN(__glewColor4x) -#define glDepthRangex GLEW_GET_FUN(__glewDepthRangex) -#define glFogx GLEW_GET_FUN(__glewFogx) -#define glFogxv GLEW_GET_FUN(__glewFogxv) -#define glFrustumf GLEW_GET_FUN(__glewFrustumf) -#define glFrustumx GLEW_GET_FUN(__glewFrustumx) -#define glLightModelx GLEW_GET_FUN(__glewLightModelx) -#define glLightModelxv GLEW_GET_FUN(__glewLightModelxv) -#define glLightx GLEW_GET_FUN(__glewLightx) -#define glLightxv GLEW_GET_FUN(__glewLightxv) -#define glLineWidthx GLEW_GET_FUN(__glewLineWidthx) -#define glLoadMatrixx GLEW_GET_FUN(__glewLoadMatrixx) -#define glMaterialx GLEW_GET_FUN(__glewMaterialx) -#define glMaterialxv GLEW_GET_FUN(__glewMaterialxv) -#define glMultMatrixx GLEW_GET_FUN(__glewMultMatrixx) -#define glMultiTexCoord4x GLEW_GET_FUN(__glewMultiTexCoord4x) -#define glNormal3x GLEW_GET_FUN(__glewNormal3x) -#define glOrthof GLEW_GET_FUN(__glewOrthof) -#define glOrthox GLEW_GET_FUN(__glewOrthox) -#define glPointSizex GLEW_GET_FUN(__glewPointSizex) -#define glPolygonOffsetx GLEW_GET_FUN(__glewPolygonOffsetx) -#define glRotatex GLEW_GET_FUN(__glewRotatex) -#define glSampleCoveragex GLEW_GET_FUN(__glewSampleCoveragex) -#define glScalex GLEW_GET_FUN(__glewScalex) -#define glTexEnvx GLEW_GET_FUN(__glewTexEnvx) -#define glTexEnvxv GLEW_GET_FUN(__glewTexEnvxv) -#define glTexParameterx GLEW_GET_FUN(__glewTexParameterx) -#define glTranslatex GLEW_GET_FUN(__glewTranslatex) - -#define GLEW_REGAL_ES1_0_compatibility GLEW_GET_VAR(__GLEW_REGAL_ES1_0_compatibility) - -#endif /* GL_REGAL_ES1_0_compatibility */ - -/* ---------------------- GL_REGAL_ES1_1_compatibility --------------------- */ - -#ifndef GL_REGAL_ES1_1_compatibility -#define GL_REGAL_ES1_1_compatibility 1 - -typedef void (GLAPIENTRY * PFNGLCLIPPLANEFPROC) (GLenum plane, const GLfloat* equation); -typedef void (GLAPIENTRY * PFNGLCLIPPLANEXPROC) (GLenum plane, const GLfixed* equation); -typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFPROC) (GLenum pname, GLfloat eqn[4]); -typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEXPROC) (GLenum pname, GLfixed eqn[4]); -typedef void (GLAPIENTRY * PFNGLGETFIXEDVPROC) (GLenum pname, GLfixed* params); -typedef void (GLAPIENTRY * PFNGLGETLIGHTXVPROC) (GLenum light, GLenum pname, GLfixed* params); -typedef void (GLAPIENTRY * PFNGLGETMATERIALXVPROC) (GLenum face, GLenum pname, GLfixed* params); -typedef void (GLAPIENTRY * PFNGLGETTEXENVXVPROC) (GLenum env, GLenum pname, GLfixed* params); -typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERXVPROC) (GLenum target, GLenum pname, GLfixed* params); -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERXPROC) (GLenum pname, GLfixed param); -typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERXVPROC) (GLenum pname, const GLfixed* params); -typedef void (GLAPIENTRY * PFNGLPOINTSIZEPOINTEROESPROC) (GLenum type, GLsizei stride, const void *pointer); -typedef void (GLAPIENTRY * PFNGLTEXPARAMETERXVPROC) (GLenum target, GLenum pname, const GLfixed* params); - -#define glClipPlanef GLEW_GET_FUN(__glewClipPlanef) -#define glClipPlanex GLEW_GET_FUN(__glewClipPlanex) -#define glGetClipPlanef GLEW_GET_FUN(__glewGetClipPlanef) -#define glGetClipPlanex GLEW_GET_FUN(__glewGetClipPlanex) -#define glGetFixedv GLEW_GET_FUN(__glewGetFixedv) -#define glGetLightxv GLEW_GET_FUN(__glewGetLightxv) -#define glGetMaterialxv GLEW_GET_FUN(__glewGetMaterialxv) -#define glGetTexEnvxv GLEW_GET_FUN(__glewGetTexEnvxv) -#define glGetTexParameterxv GLEW_GET_FUN(__glewGetTexParameterxv) -#define glPointParameterx GLEW_GET_FUN(__glewPointParameterx) -#define glPointParameterxv GLEW_GET_FUN(__glewPointParameterxv) -#define glPointSizePointerOES GLEW_GET_FUN(__glewPointSizePointerOES) -#define glTexParameterxv GLEW_GET_FUN(__glewTexParameterxv) - -#define GLEW_REGAL_ES1_1_compatibility GLEW_GET_VAR(__GLEW_REGAL_ES1_1_compatibility) - -#endif /* GL_REGAL_ES1_1_compatibility */ - -/* ---------------------------- GL_REGAL_enable ---------------------------- */ - -#ifndef GL_REGAL_enable -#define GL_REGAL_enable 1 - -#define GL_ERROR_REGAL 0x9322 -#define GL_DEBUG_REGAL 0x9323 -#define GL_LOG_REGAL 0x9324 -#define GL_EMULATION_REGAL 0x9325 -#define GL_DRIVER_REGAL 0x9326 -#define GL_MISSING_REGAL 0x9360 -#define GL_TRACE_REGAL 0x9361 -#define GL_CACHE_REGAL 0x9362 -#define GL_CODE_REGAL 0x9363 -#define GL_STATISTICS_REGAL 0x9364 - -#define GLEW_REGAL_enable GLEW_GET_VAR(__GLEW_REGAL_enable) - -#endif /* GL_REGAL_enable */ - -/* ------------------------- GL_REGAL_error_string ------------------------- */ - -#ifndef GL_REGAL_error_string -#define GL_REGAL_error_string 1 - -typedef const GLchar* (GLAPIENTRY * PFNGLERRORSTRINGREGALPROC) (GLenum error); - -#define glErrorStringREGAL GLEW_GET_FUN(__glewErrorStringREGAL) - -#define GLEW_REGAL_error_string GLEW_GET_VAR(__GLEW_REGAL_error_string) - -#endif /* GL_REGAL_error_string */ - -/* ------------------------ GL_REGAL_extension_query ----------------------- */ - -#ifndef GL_REGAL_extension_query -#define GL_REGAL_extension_query 1 - -typedef GLboolean (GLAPIENTRY * PFNGLGETEXTENSIONREGALPROC) (const GLchar* ext); -typedef GLboolean (GLAPIENTRY * PFNGLISSUPPORTEDREGALPROC) (const GLchar* ext); - -#define glGetExtensionREGAL GLEW_GET_FUN(__glewGetExtensionREGAL) -#define glIsSupportedREGAL GLEW_GET_FUN(__glewIsSupportedREGAL) - -#define GLEW_REGAL_extension_query GLEW_GET_VAR(__GLEW_REGAL_extension_query) - -#endif /* GL_REGAL_extension_query */ - -/* ------------------------------ GL_REGAL_log ----------------------------- */ - -#ifndef GL_REGAL_log -#define GL_REGAL_log 1 - -#define GL_LOG_ERROR_REGAL 0x9319 -#define GL_LOG_WARNING_REGAL 0x931A -#define GL_LOG_INFO_REGAL 0x931B -#define GL_LOG_APP_REGAL 0x931C -#define GL_LOG_DRIVER_REGAL 0x931D -#define GL_LOG_INTERNAL_REGAL 0x931E -#define GL_LOG_DEBUG_REGAL 0x931F -#define GL_LOG_STATUS_REGAL 0x9320 -#define GL_LOG_HTTP_REGAL 0x9321 - -typedef void (APIENTRY *GLLOGPROCREGAL)(GLenum stream, GLsizei length, const GLchar *message, void *context); - -typedef void (GLAPIENTRY * PFNGLLOGMESSAGECALLBACKREGALPROC) (GLLOGPROCREGAL callback); - -#define glLogMessageCallbackREGAL GLEW_GET_FUN(__glewLogMessageCallbackREGAL) - -#define GLEW_REGAL_log GLEW_GET_VAR(__GLEW_REGAL_log) - -#endif /* GL_REGAL_log */ - -/* ------------------------- GL_REGAL_proc_address ------------------------- */ - -#ifndef GL_REGAL_proc_address -#define GL_REGAL_proc_address 1 - -typedef void * (GLAPIENTRY * PFNGLGETPROCADDRESSREGALPROC) (const GLchar *name); - -#define glGetProcAddressREGAL GLEW_GET_FUN(__glewGetProcAddressREGAL) - -#define GLEW_REGAL_proc_address GLEW_GET_VAR(__GLEW_REGAL_proc_address) - -#endif /* GL_REGAL_proc_address */ - -/* ----------------------- GL_REND_screen_coordinates ---------------------- */ - -#ifndef GL_REND_screen_coordinates -#define GL_REND_screen_coordinates 1 - -#define GL_SCREEN_COORDINATES_REND 0x8490 -#define GL_INVERTED_SCREEN_W_REND 0x8491 - -#define GLEW_REND_screen_coordinates GLEW_GET_VAR(__GLEW_REND_screen_coordinates) - -#endif /* GL_REND_screen_coordinates */ - -/* ------------------------------- GL_S3_s3tc ------------------------------ */ - -#ifndef GL_S3_s3tc -#define GL_S3_s3tc 1 - -#define GL_RGB_S3TC 0x83A0 -#define GL_RGB4_S3TC 0x83A1 -#define GL_RGBA_S3TC 0x83A2 -#define GL_RGBA4_S3TC 0x83A3 -#define GL_RGBA_DXT5_S3TC 0x83A4 -#define GL_RGBA4_DXT5_S3TC 0x83A5 - -#define GLEW_S3_s3tc GLEW_GET_VAR(__GLEW_S3_s3tc) - -#endif /* GL_S3_s3tc */ - -/* -------------------------- GL_SGIS_color_range -------------------------- */ - -#ifndef GL_SGIS_color_range -#define GL_SGIS_color_range 1 - -#define GL_EXTENDED_RANGE_SGIS 0x85A5 -#define GL_MIN_RED_SGIS 0x85A6 -#define GL_MAX_RED_SGIS 0x85A7 -#define GL_MIN_GREEN_SGIS 0x85A8 -#define GL_MAX_GREEN_SGIS 0x85A9 -#define GL_MIN_BLUE_SGIS 0x85AA -#define GL_MAX_BLUE_SGIS 0x85AB -#define GL_MIN_ALPHA_SGIS 0x85AC -#define GL_MAX_ALPHA_SGIS 0x85AD - -#define GLEW_SGIS_color_range GLEW_GET_VAR(__GLEW_SGIS_color_range) - -#endif /* GL_SGIS_color_range */ - -/* ------------------------- GL_SGIS_detail_texture ------------------------ */ - -#ifndef GL_SGIS_detail_texture -#define GL_SGIS_detail_texture 1 - -typedef void (GLAPIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); -typedef void (GLAPIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat* points); - -#define glDetailTexFuncSGIS GLEW_GET_FUN(__glewDetailTexFuncSGIS) -#define glGetDetailTexFuncSGIS GLEW_GET_FUN(__glewGetDetailTexFuncSGIS) - -#define GLEW_SGIS_detail_texture GLEW_GET_VAR(__GLEW_SGIS_detail_texture) - -#endif /* GL_SGIS_detail_texture */ - -/* -------------------------- GL_SGIS_fog_function ------------------------- */ - -#ifndef GL_SGIS_fog_function -#define GL_SGIS_fog_function 1 - -typedef void (GLAPIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat* points); -typedef void (GLAPIENTRY * PFNGLGETFOGFUNCSGISPROC) (GLfloat* points); - -#define glFogFuncSGIS GLEW_GET_FUN(__glewFogFuncSGIS) -#define glGetFogFuncSGIS GLEW_GET_FUN(__glewGetFogFuncSGIS) - -#define GLEW_SGIS_fog_function GLEW_GET_VAR(__GLEW_SGIS_fog_function) - -#endif /* GL_SGIS_fog_function */ - -/* ------------------------ GL_SGIS_generate_mipmap ------------------------ */ - -#ifndef GL_SGIS_generate_mipmap -#define GL_SGIS_generate_mipmap 1 - -#define GL_GENERATE_MIPMAP_SGIS 0x8191 -#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 - -#define GLEW_SGIS_generate_mipmap GLEW_GET_VAR(__GLEW_SGIS_generate_mipmap) - -#endif /* GL_SGIS_generate_mipmap */ - -/* -------------------------- GL_SGIS_multisample -------------------------- */ - -#ifndef GL_SGIS_multisample -#define GL_SGIS_multisample 1 - -#define GL_MULTISAMPLE_SGIS 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F -#define GL_SAMPLE_MASK_SGIS 0x80A0 -#define GL_1PASS_SGIS 0x80A1 -#define GL_2PASS_0_SGIS 0x80A2 -#define GL_2PASS_1_SGIS 0x80A3 -#define GL_4PASS_0_SGIS 0x80A4 -#define GL_4PASS_1_SGIS 0x80A5 -#define GL_4PASS_2_SGIS 0x80A6 -#define GL_4PASS_3_SGIS 0x80A7 -#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 -#define GL_SAMPLES_SGIS 0x80A9 -#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA -#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB -#define GL_SAMPLE_PATTERN_SGIS 0x80AC - -typedef void (GLAPIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); -typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); - -#define glSampleMaskSGIS GLEW_GET_FUN(__glewSampleMaskSGIS) -#define glSamplePatternSGIS GLEW_GET_FUN(__glewSamplePatternSGIS) - -#define GLEW_SGIS_multisample GLEW_GET_VAR(__GLEW_SGIS_multisample) - -#endif /* GL_SGIS_multisample */ - -/* ------------------------- GL_SGIS_pixel_texture ------------------------- */ - -#ifndef GL_SGIS_pixel_texture -#define GL_SGIS_pixel_texture 1 - -#define GLEW_SGIS_pixel_texture GLEW_GET_VAR(__GLEW_SGIS_pixel_texture) - -#endif /* GL_SGIS_pixel_texture */ - -/* ----------------------- GL_SGIS_point_line_texgen ----------------------- */ - -#ifndef GL_SGIS_point_line_texgen -#define GL_SGIS_point_line_texgen 1 - -#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 -#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 -#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 -#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 -#define GL_EYE_POINT_SGIS 0x81F4 -#define GL_OBJECT_POINT_SGIS 0x81F5 -#define GL_EYE_LINE_SGIS 0x81F6 -#define GL_OBJECT_LINE_SGIS 0x81F7 - -#define GLEW_SGIS_point_line_texgen GLEW_GET_VAR(__GLEW_SGIS_point_line_texgen) - -#endif /* GL_SGIS_point_line_texgen */ - -/* ------------------------ GL_SGIS_sharpen_texture ------------------------ */ - -#ifndef GL_SGIS_sharpen_texture -#define GL_SGIS_sharpen_texture 1 - -typedef void (GLAPIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat* points); -typedef void (GLAPIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); - -#define glGetSharpenTexFuncSGIS GLEW_GET_FUN(__glewGetSharpenTexFuncSGIS) -#define glSharpenTexFuncSGIS GLEW_GET_FUN(__glewSharpenTexFuncSGIS) - -#define GLEW_SGIS_sharpen_texture GLEW_GET_VAR(__GLEW_SGIS_sharpen_texture) - -#endif /* GL_SGIS_sharpen_texture */ - -/* --------------------------- GL_SGIS_texture4D --------------------------- */ - -#ifndef GL_SGIS_texture4D -#define GL_SGIS_texture4D 1 - -typedef void (GLAPIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void *pixels); -typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void *pixels); - -#define glTexImage4DSGIS GLEW_GET_FUN(__glewTexImage4DSGIS) -#define glTexSubImage4DSGIS GLEW_GET_FUN(__glewTexSubImage4DSGIS) - -#define GLEW_SGIS_texture4D GLEW_GET_VAR(__GLEW_SGIS_texture4D) - -#endif /* GL_SGIS_texture4D */ - -/* ---------------------- GL_SGIS_texture_border_clamp --------------------- */ - -#ifndef GL_SGIS_texture_border_clamp -#define GL_SGIS_texture_border_clamp 1 - -#define GL_CLAMP_TO_BORDER_SGIS 0x812D - -#define GLEW_SGIS_texture_border_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_border_clamp) - -#endif /* GL_SGIS_texture_border_clamp */ - -/* ----------------------- GL_SGIS_texture_edge_clamp ---------------------- */ - -#ifndef GL_SGIS_texture_edge_clamp -#define GL_SGIS_texture_edge_clamp 1 - -#define GL_CLAMP_TO_EDGE_SGIS 0x812F - -#define GLEW_SGIS_texture_edge_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_edge_clamp) - -#endif /* GL_SGIS_texture_edge_clamp */ - -/* ------------------------ GL_SGIS_texture_filter4 ------------------------ */ - -#ifndef GL_SGIS_texture_filter4 -#define GL_SGIS_texture_filter4 1 - -typedef void (GLAPIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat* weights); -typedef void (GLAPIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat* weights); - -#define glGetTexFilterFuncSGIS GLEW_GET_FUN(__glewGetTexFilterFuncSGIS) -#define glTexFilterFuncSGIS GLEW_GET_FUN(__glewTexFilterFuncSGIS) - -#define GLEW_SGIS_texture_filter4 GLEW_GET_VAR(__GLEW_SGIS_texture_filter4) - -#endif /* GL_SGIS_texture_filter4 */ - -/* -------------------------- GL_SGIS_texture_lod -------------------------- */ - -#ifndef GL_SGIS_texture_lod -#define GL_SGIS_texture_lod 1 - -#define GL_TEXTURE_MIN_LOD_SGIS 0x813A -#define GL_TEXTURE_MAX_LOD_SGIS 0x813B -#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C -#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D - -#define GLEW_SGIS_texture_lod GLEW_GET_VAR(__GLEW_SGIS_texture_lod) - -#endif /* GL_SGIS_texture_lod */ - -/* ------------------------- GL_SGIS_texture_select ------------------------ */ - -#ifndef GL_SGIS_texture_select -#define GL_SGIS_texture_select 1 - -#define GLEW_SGIS_texture_select GLEW_GET_VAR(__GLEW_SGIS_texture_select) - -#endif /* GL_SGIS_texture_select */ - -/* ----------------------------- GL_SGIX_async ----------------------------- */ - -#ifndef GL_SGIX_async -#define GL_SGIX_async 1 - -#define GL_ASYNC_MARKER_SGIX 0x8329 - -typedef void (GLAPIENTRY * PFNGLASYNCMARKERSGIXPROC) (GLuint marker); -typedef void (GLAPIENTRY * PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); -typedef GLint (GLAPIENTRY * PFNGLFINISHASYNCSGIXPROC) (GLuint* markerp); -typedef GLuint (GLAPIENTRY * PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); -typedef GLboolean (GLAPIENTRY * PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); -typedef GLint (GLAPIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint* markerp); - -#define glAsyncMarkerSGIX GLEW_GET_FUN(__glewAsyncMarkerSGIX) -#define glDeleteAsyncMarkersSGIX GLEW_GET_FUN(__glewDeleteAsyncMarkersSGIX) -#define glFinishAsyncSGIX GLEW_GET_FUN(__glewFinishAsyncSGIX) -#define glGenAsyncMarkersSGIX GLEW_GET_FUN(__glewGenAsyncMarkersSGIX) -#define glIsAsyncMarkerSGIX GLEW_GET_FUN(__glewIsAsyncMarkerSGIX) -#define glPollAsyncSGIX GLEW_GET_FUN(__glewPollAsyncSGIX) - -#define GLEW_SGIX_async GLEW_GET_VAR(__GLEW_SGIX_async) - -#endif /* GL_SGIX_async */ - -/* ------------------------ GL_SGIX_async_histogram ------------------------ */ - -#ifndef GL_SGIX_async_histogram -#define GL_SGIX_async_histogram 1 - -#define GL_ASYNC_HISTOGRAM_SGIX 0x832C -#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D - -#define GLEW_SGIX_async_histogram GLEW_GET_VAR(__GLEW_SGIX_async_histogram) - -#endif /* GL_SGIX_async_histogram */ - -/* -------------------------- GL_SGIX_async_pixel -------------------------- */ - -#ifndef GL_SGIX_async_pixel -#define GL_SGIX_async_pixel 1 - -#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C -#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D -#define GL_ASYNC_READ_PIXELS_SGIX 0x835E -#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F -#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 -#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 - -#define GLEW_SGIX_async_pixel GLEW_GET_VAR(__GLEW_SGIX_async_pixel) - -#endif /* GL_SGIX_async_pixel */ - -/* ----------------------- GL_SGIX_blend_alpha_minmax ---------------------- */ - -#ifndef GL_SGIX_blend_alpha_minmax -#define GL_SGIX_blend_alpha_minmax 1 - -#define GL_ALPHA_MIN_SGIX 0x8320 -#define GL_ALPHA_MAX_SGIX 0x8321 - -#define GLEW_SGIX_blend_alpha_minmax GLEW_GET_VAR(__GLEW_SGIX_blend_alpha_minmax) - -#endif /* GL_SGIX_blend_alpha_minmax */ - -/* ---------------------------- GL_SGIX_clipmap ---------------------------- */ - -#ifndef GL_SGIX_clipmap -#define GL_SGIX_clipmap 1 - -#define GLEW_SGIX_clipmap GLEW_GET_VAR(__GLEW_SGIX_clipmap) - -#endif /* GL_SGIX_clipmap */ - -/* ---------------------- GL_SGIX_convolution_accuracy --------------------- */ - -#ifndef GL_SGIX_convolution_accuracy -#define GL_SGIX_convolution_accuracy 1 - -#define GL_CONVOLUTION_HINT_SGIX 0x8316 - -#define GLEW_SGIX_convolution_accuracy GLEW_GET_VAR(__GLEW_SGIX_convolution_accuracy) - -#endif /* GL_SGIX_convolution_accuracy */ - -/* ------------------------- GL_SGIX_depth_texture ------------------------- */ - -#ifndef GL_SGIX_depth_texture -#define GL_SGIX_depth_texture 1 - -#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 -#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 -#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 - -#define GLEW_SGIX_depth_texture GLEW_GET_VAR(__GLEW_SGIX_depth_texture) - -#endif /* GL_SGIX_depth_texture */ - -/* -------------------------- GL_SGIX_flush_raster ------------------------- */ - -#ifndef GL_SGIX_flush_raster -#define GL_SGIX_flush_raster 1 - -typedef void (GLAPIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); - -#define glFlushRasterSGIX GLEW_GET_FUN(__glewFlushRasterSGIX) - -#define GLEW_SGIX_flush_raster GLEW_GET_VAR(__GLEW_SGIX_flush_raster) - -#endif /* GL_SGIX_flush_raster */ - -/* --------------------------- GL_SGIX_fog_offset -------------------------- */ - -#ifndef GL_SGIX_fog_offset -#define GL_SGIX_fog_offset 1 - -#define GL_FOG_OFFSET_SGIX 0x8198 -#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 - -#define GLEW_SGIX_fog_offset GLEW_GET_VAR(__GLEW_SGIX_fog_offset) - -#endif /* GL_SGIX_fog_offset */ - -/* -------------------------- GL_SGIX_fog_texture -------------------------- */ - -#ifndef GL_SGIX_fog_texture -#define GL_SGIX_fog_texture 1 - -#define GL_FOG_PATCHY_FACTOR_SGIX 0 -#define GL_FRAGMENT_FOG_SGIX 0 -#define GL_TEXTURE_FOG_SGIX 0 - -typedef void (GLAPIENTRY * PFNGLTEXTUREFOGSGIXPROC) (GLenum pname); - -#define glTextureFogSGIX GLEW_GET_FUN(__glewTextureFogSGIX) - -#define GLEW_SGIX_fog_texture GLEW_GET_VAR(__GLEW_SGIX_fog_texture) - -#endif /* GL_SGIX_fog_texture */ - -/* ------------------- GL_SGIX_fragment_specular_lighting ------------------ */ - -#ifndef GL_SGIX_fragment_specular_lighting -#define GL_SGIX_fragment_specular_lighting 1 - -typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, const GLfloat param); -typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, const GLint param); -typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum value, GLfloat* data); -typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum value, GLint* data); -typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* data); -typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* data); - -#define glFragmentColorMaterialSGIX GLEW_GET_FUN(__glewFragmentColorMaterialSGIX) -#define glFragmentLightModelfSGIX GLEW_GET_FUN(__glewFragmentLightModelfSGIX) -#define glFragmentLightModelfvSGIX GLEW_GET_FUN(__glewFragmentLightModelfvSGIX) -#define glFragmentLightModeliSGIX GLEW_GET_FUN(__glewFragmentLightModeliSGIX) -#define glFragmentLightModelivSGIX GLEW_GET_FUN(__glewFragmentLightModelivSGIX) -#define glFragmentLightfSGIX GLEW_GET_FUN(__glewFragmentLightfSGIX) -#define glFragmentLightfvSGIX GLEW_GET_FUN(__glewFragmentLightfvSGIX) -#define glFragmentLightiSGIX GLEW_GET_FUN(__glewFragmentLightiSGIX) -#define glFragmentLightivSGIX GLEW_GET_FUN(__glewFragmentLightivSGIX) -#define glFragmentMaterialfSGIX GLEW_GET_FUN(__glewFragmentMaterialfSGIX) -#define glFragmentMaterialfvSGIX GLEW_GET_FUN(__glewFragmentMaterialfvSGIX) -#define glFragmentMaterialiSGIX GLEW_GET_FUN(__glewFragmentMaterialiSGIX) -#define glFragmentMaterialivSGIX GLEW_GET_FUN(__glewFragmentMaterialivSGIX) -#define glGetFragmentLightfvSGIX GLEW_GET_FUN(__glewGetFragmentLightfvSGIX) -#define glGetFragmentLightivSGIX GLEW_GET_FUN(__glewGetFragmentLightivSGIX) -#define glGetFragmentMaterialfvSGIX GLEW_GET_FUN(__glewGetFragmentMaterialfvSGIX) -#define glGetFragmentMaterialivSGIX GLEW_GET_FUN(__glewGetFragmentMaterialivSGIX) - -#define GLEW_SGIX_fragment_specular_lighting GLEW_GET_VAR(__GLEW_SGIX_fragment_specular_lighting) - -#endif /* GL_SGIX_fragment_specular_lighting */ - -/* --------------------------- GL_SGIX_framezoom --------------------------- */ - -#ifndef GL_SGIX_framezoom -#define GL_SGIX_framezoom 1 - -typedef void (GLAPIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); - -#define glFrameZoomSGIX GLEW_GET_FUN(__glewFrameZoomSGIX) - -#define GLEW_SGIX_framezoom GLEW_GET_VAR(__GLEW_SGIX_framezoom) - -#endif /* GL_SGIX_framezoom */ - -/* --------------------------- GL_SGIX_interlace --------------------------- */ - -#ifndef GL_SGIX_interlace -#define GL_SGIX_interlace 1 - -#define GL_INTERLACE_SGIX 0x8094 - -#define GLEW_SGIX_interlace GLEW_GET_VAR(__GLEW_SGIX_interlace) - -#endif /* GL_SGIX_interlace */ - -/* ------------------------- GL_SGIX_ir_instrument1 ------------------------ */ - -#ifndef GL_SGIX_ir_instrument1 -#define GL_SGIX_ir_instrument1 1 - -#define GLEW_SGIX_ir_instrument1 GLEW_GET_VAR(__GLEW_SGIX_ir_instrument1) - -#endif /* GL_SGIX_ir_instrument1 */ - -/* ------------------------- GL_SGIX_list_priority ------------------------- */ - -#ifndef GL_SGIX_list_priority -#define GL_SGIX_list_priority 1 - -#define GLEW_SGIX_list_priority GLEW_GET_VAR(__GLEW_SGIX_list_priority) - -#endif /* GL_SGIX_list_priority */ - -/* ------------------------- GL_SGIX_pixel_texture ------------------------- */ - -#ifndef GL_SGIX_pixel_texture -#define GL_SGIX_pixel_texture 1 - -typedef void (GLAPIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); - -#define glPixelTexGenSGIX GLEW_GET_FUN(__glewPixelTexGenSGIX) - -#define GLEW_SGIX_pixel_texture GLEW_GET_VAR(__GLEW_SGIX_pixel_texture) - -#endif /* GL_SGIX_pixel_texture */ - -/* ----------------------- GL_SGIX_pixel_texture_bits ---------------------- */ - -#ifndef GL_SGIX_pixel_texture_bits -#define GL_SGIX_pixel_texture_bits 1 - -#define GLEW_SGIX_pixel_texture_bits GLEW_GET_VAR(__GLEW_SGIX_pixel_texture_bits) - -#endif /* GL_SGIX_pixel_texture_bits */ - -/* ------------------------ GL_SGIX_reference_plane ------------------------ */ - -#ifndef GL_SGIX_reference_plane -#define GL_SGIX_reference_plane 1 - -typedef void (GLAPIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble* equation); - -#define glReferencePlaneSGIX GLEW_GET_FUN(__glewReferencePlaneSGIX) - -#define GLEW_SGIX_reference_plane GLEW_GET_VAR(__GLEW_SGIX_reference_plane) - -#endif /* GL_SGIX_reference_plane */ - -/* ---------------------------- GL_SGIX_resample --------------------------- */ - -#ifndef GL_SGIX_resample -#define GL_SGIX_resample 1 - -#define GL_PACK_RESAMPLE_SGIX 0x842E -#define GL_UNPACK_RESAMPLE_SGIX 0x842F -#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 -#define GL_RESAMPLE_REPLICATE_SGIX 0x8433 -#define GL_RESAMPLE_ZERO_FILL_SGIX 0x8434 - -#define GLEW_SGIX_resample GLEW_GET_VAR(__GLEW_SGIX_resample) - -#endif /* GL_SGIX_resample */ - -/* ----------------------------- GL_SGIX_shadow ---------------------------- */ - -#ifndef GL_SGIX_shadow -#define GL_SGIX_shadow 1 - -#define GL_TEXTURE_COMPARE_SGIX 0x819A -#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B -#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C -#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D - -#define GLEW_SGIX_shadow GLEW_GET_VAR(__GLEW_SGIX_shadow) - -#endif /* GL_SGIX_shadow */ - -/* ------------------------- GL_SGIX_shadow_ambient ------------------------ */ - -#ifndef GL_SGIX_shadow_ambient -#define GL_SGIX_shadow_ambient 1 - -#define GL_SHADOW_AMBIENT_SGIX 0x80BF - -#define GLEW_SGIX_shadow_ambient GLEW_GET_VAR(__GLEW_SGIX_shadow_ambient) - -#endif /* GL_SGIX_shadow_ambient */ - -/* ----------------------------- GL_SGIX_sprite ---------------------------- */ - -#ifndef GL_SGIX_sprite -#define GL_SGIX_sprite 1 - -typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); -typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, GLint* params); - -#define glSpriteParameterfSGIX GLEW_GET_FUN(__glewSpriteParameterfSGIX) -#define glSpriteParameterfvSGIX GLEW_GET_FUN(__glewSpriteParameterfvSGIX) -#define glSpriteParameteriSGIX GLEW_GET_FUN(__glewSpriteParameteriSGIX) -#define glSpriteParameterivSGIX GLEW_GET_FUN(__glewSpriteParameterivSGIX) - -#define GLEW_SGIX_sprite GLEW_GET_VAR(__GLEW_SGIX_sprite) - -#endif /* GL_SGIX_sprite */ - -/* ----------------------- GL_SGIX_tag_sample_buffer ----------------------- */ - -#ifndef GL_SGIX_tag_sample_buffer -#define GL_SGIX_tag_sample_buffer 1 - -typedef void (GLAPIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); - -#define glTagSampleBufferSGIX GLEW_GET_FUN(__glewTagSampleBufferSGIX) - -#define GLEW_SGIX_tag_sample_buffer GLEW_GET_VAR(__GLEW_SGIX_tag_sample_buffer) - -#endif /* GL_SGIX_tag_sample_buffer */ - -/* ------------------------ GL_SGIX_texture_add_env ------------------------ */ - -#ifndef GL_SGIX_texture_add_env -#define GL_SGIX_texture_add_env 1 - -#define GLEW_SGIX_texture_add_env GLEW_GET_VAR(__GLEW_SGIX_texture_add_env) - -#endif /* GL_SGIX_texture_add_env */ - -/* -------------------- GL_SGIX_texture_coordinate_clamp ------------------- */ - -#ifndef GL_SGIX_texture_coordinate_clamp -#define GL_SGIX_texture_coordinate_clamp 1 - -#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 -#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A -#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B - -#define GLEW_SGIX_texture_coordinate_clamp GLEW_GET_VAR(__GLEW_SGIX_texture_coordinate_clamp) - -#endif /* GL_SGIX_texture_coordinate_clamp */ - -/* ------------------------ GL_SGIX_texture_lod_bias ----------------------- */ - -#ifndef GL_SGIX_texture_lod_bias -#define GL_SGIX_texture_lod_bias 1 - -#define GLEW_SGIX_texture_lod_bias GLEW_GET_VAR(__GLEW_SGIX_texture_lod_bias) - -#endif /* GL_SGIX_texture_lod_bias */ - -/* ---------------------- GL_SGIX_texture_multi_buffer --------------------- */ - -#ifndef GL_SGIX_texture_multi_buffer -#define GL_SGIX_texture_multi_buffer 1 - -#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E - -#define GLEW_SGIX_texture_multi_buffer GLEW_GET_VAR(__GLEW_SGIX_texture_multi_buffer) - -#endif /* GL_SGIX_texture_multi_buffer */ - -/* ------------------------- GL_SGIX_texture_range ------------------------- */ - -#ifndef GL_SGIX_texture_range -#define GL_SGIX_texture_range 1 - -#define GL_RGB_SIGNED_SGIX 0x85E0 -#define GL_RGBA_SIGNED_SGIX 0x85E1 -#define GL_ALPHA_SIGNED_SGIX 0x85E2 -#define GL_LUMINANCE_SIGNED_SGIX 0x85E3 -#define GL_INTENSITY_SIGNED_SGIX 0x85E4 -#define GL_LUMINANCE_ALPHA_SIGNED_SGIX 0x85E5 -#define GL_RGB16_SIGNED_SGIX 0x85E6 -#define GL_RGBA16_SIGNED_SGIX 0x85E7 -#define GL_ALPHA16_SIGNED_SGIX 0x85E8 -#define GL_LUMINANCE16_SIGNED_SGIX 0x85E9 -#define GL_INTENSITY16_SIGNED_SGIX 0x85EA -#define GL_LUMINANCE16_ALPHA16_SIGNED_SGIX 0x85EB -#define GL_RGB_EXTENDED_RANGE_SGIX 0x85EC -#define GL_RGBA_EXTENDED_RANGE_SGIX 0x85ED -#define GL_ALPHA_EXTENDED_RANGE_SGIX 0x85EE -#define GL_LUMINANCE_EXTENDED_RANGE_SGIX 0x85EF -#define GL_INTENSITY_EXTENDED_RANGE_SGIX 0x85F0 -#define GL_LUMINANCE_ALPHA_EXTENDED_RANGE_SGIX 0x85F1 -#define GL_RGB16_EXTENDED_RANGE_SGIX 0x85F2 -#define GL_RGBA16_EXTENDED_RANGE_SGIX 0x85F3 -#define GL_ALPHA16_EXTENDED_RANGE_SGIX 0x85F4 -#define GL_LUMINANCE16_EXTENDED_RANGE_SGIX 0x85F5 -#define GL_INTENSITY16_EXTENDED_RANGE_SGIX 0x85F6 -#define GL_LUMINANCE16_ALPHA16_EXTENDED_RANGE_SGIX 0x85F7 -#define GL_MIN_LUMINANCE_SGIS 0x85F8 -#define GL_MAX_LUMINANCE_SGIS 0x85F9 -#define GL_MIN_INTENSITY_SGIS 0x85FA -#define GL_MAX_INTENSITY_SGIS 0x85FB - -#define GLEW_SGIX_texture_range GLEW_GET_VAR(__GLEW_SGIX_texture_range) - -#endif /* GL_SGIX_texture_range */ - -/* ----------------------- GL_SGIX_texture_scale_bias ---------------------- */ - -#ifndef GL_SGIX_texture_scale_bias -#define GL_SGIX_texture_scale_bias 1 - -#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 -#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A -#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B -#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C - -#define GLEW_SGIX_texture_scale_bias GLEW_GET_VAR(__GLEW_SGIX_texture_scale_bias) - -#endif /* GL_SGIX_texture_scale_bias */ - -/* ------------------------- GL_SGIX_vertex_preclip ------------------------ */ - -#ifndef GL_SGIX_vertex_preclip -#define GL_SGIX_vertex_preclip 1 - -#define GL_VERTEX_PRECLIP_SGIX 0x83EE -#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF - -#define GLEW_SGIX_vertex_preclip GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip) - -#endif /* GL_SGIX_vertex_preclip */ - -/* ---------------------- GL_SGIX_vertex_preclip_hint ---------------------- */ - -#ifndef GL_SGIX_vertex_preclip_hint -#define GL_SGIX_vertex_preclip_hint 1 - -#define GL_VERTEX_PRECLIP_SGIX 0x83EE -#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF - -#define GLEW_SGIX_vertex_preclip_hint GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip_hint) - -#endif /* GL_SGIX_vertex_preclip_hint */ - -/* ----------------------------- GL_SGIX_ycrcb ----------------------------- */ - -#ifndef GL_SGIX_ycrcb -#define GL_SGIX_ycrcb 1 - -#define GLEW_SGIX_ycrcb GLEW_GET_VAR(__GLEW_SGIX_ycrcb) - -#endif /* GL_SGIX_ycrcb */ - -/* -------------------------- GL_SGI_color_matrix -------------------------- */ - -#ifndef GL_SGI_color_matrix -#define GL_SGI_color_matrix 1 - -#define GL_COLOR_MATRIX_SGI 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB - -#define GLEW_SGI_color_matrix GLEW_GET_VAR(__GLEW_SGI_color_matrix) - -#endif /* GL_SGI_color_matrix */ - -/* --------------------------- GL_SGI_color_table -------------------------- */ - -#ifndef GL_SGI_color_table -#define GL_SGI_color_table 1 - -#define GL_COLOR_TABLE_SGI 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 -#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 -#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 -#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 -#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 -#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF - -typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat* params); -typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint* params); -typedef void (GLAPIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); -typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat* params); -typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint* params); -typedef void (GLAPIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, void *table); - -#define glColorTableParameterfvSGI GLEW_GET_FUN(__glewColorTableParameterfvSGI) -#define glColorTableParameterivSGI GLEW_GET_FUN(__glewColorTableParameterivSGI) -#define glColorTableSGI GLEW_GET_FUN(__glewColorTableSGI) -#define glCopyColorTableSGI GLEW_GET_FUN(__glewCopyColorTableSGI) -#define glGetColorTableParameterfvSGI GLEW_GET_FUN(__glewGetColorTableParameterfvSGI) -#define glGetColorTableParameterivSGI GLEW_GET_FUN(__glewGetColorTableParameterivSGI) -#define glGetColorTableSGI GLEW_GET_FUN(__glewGetColorTableSGI) - -#define GLEW_SGI_color_table GLEW_GET_VAR(__GLEW_SGI_color_table) - -#endif /* GL_SGI_color_table */ - -/* ----------------------- GL_SGI_texture_color_table ---------------------- */ - -#ifndef GL_SGI_texture_color_table -#define GL_SGI_texture_color_table 1 - -#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC -#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD - -#define GLEW_SGI_texture_color_table GLEW_GET_VAR(__GLEW_SGI_texture_color_table) - -#endif /* GL_SGI_texture_color_table */ - -/* ------------------------- GL_SUNX_constant_data ------------------------- */ - -#ifndef GL_SUNX_constant_data -#define GL_SUNX_constant_data 1 - -#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 -#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 - -typedef void (GLAPIENTRY * PFNGLFINISHTEXTURESUNXPROC) (void); - -#define glFinishTextureSUNX GLEW_GET_FUN(__glewFinishTextureSUNX) - -#define GLEW_SUNX_constant_data GLEW_GET_VAR(__GLEW_SUNX_constant_data) - -#endif /* GL_SUNX_constant_data */ - -/* -------------------- GL_SUN_convolution_border_modes -------------------- */ - -#ifndef GL_SUN_convolution_border_modes -#define GL_SUN_convolution_border_modes 1 - -#define GL_WRAP_BORDER_SUN 0x81D4 - -#define GLEW_SUN_convolution_border_modes GLEW_GET_VAR(__GLEW_SUN_convolution_border_modes) - -#endif /* GL_SUN_convolution_border_modes */ - -/* -------------------------- GL_SUN_global_alpha -------------------------- */ - -#ifndef GL_SUN_global_alpha -#define GL_SUN_global_alpha 1 - -#define GL_GLOBAL_ALPHA_SUN 0x81D9 -#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA - -typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); -typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); -typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); -typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); -typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); -typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); -typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); -typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); - -#define glGlobalAlphaFactorbSUN GLEW_GET_FUN(__glewGlobalAlphaFactorbSUN) -#define glGlobalAlphaFactordSUN GLEW_GET_FUN(__glewGlobalAlphaFactordSUN) -#define glGlobalAlphaFactorfSUN GLEW_GET_FUN(__glewGlobalAlphaFactorfSUN) -#define glGlobalAlphaFactoriSUN GLEW_GET_FUN(__glewGlobalAlphaFactoriSUN) -#define glGlobalAlphaFactorsSUN GLEW_GET_FUN(__glewGlobalAlphaFactorsSUN) -#define glGlobalAlphaFactorubSUN GLEW_GET_FUN(__glewGlobalAlphaFactorubSUN) -#define glGlobalAlphaFactoruiSUN GLEW_GET_FUN(__glewGlobalAlphaFactoruiSUN) -#define glGlobalAlphaFactorusSUN GLEW_GET_FUN(__glewGlobalAlphaFactorusSUN) - -#define GLEW_SUN_global_alpha GLEW_GET_VAR(__GLEW_SUN_global_alpha) - -#endif /* GL_SUN_global_alpha */ - -/* --------------------------- GL_SUN_mesh_array --------------------------- */ - -#ifndef GL_SUN_mesh_array -#define GL_SUN_mesh_array 1 - -#define GL_QUAD_MESH_SUN 0x8614 -#define GL_TRIANGLE_MESH_SUN 0x8615 - -#define GLEW_SUN_mesh_array GLEW_GET_VAR(__GLEW_SUN_mesh_array) - -#endif /* GL_SUN_mesh_array */ - -/* ------------------------ GL_SUN_read_video_pixels ----------------------- */ - -#ifndef GL_SUN_read_video_pixels -#define GL_SUN_read_video_pixels 1 - -typedef void (GLAPIENTRY * PFNGLREADVIDEOPIXELSSUNPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels); - -#define glReadVideoPixelsSUN GLEW_GET_FUN(__glewReadVideoPixelsSUN) - -#define GLEW_SUN_read_video_pixels GLEW_GET_VAR(__GLEW_SUN_read_video_pixels) - -#endif /* GL_SUN_read_video_pixels */ - -/* --------------------------- GL_SUN_slice_accum -------------------------- */ - -#ifndef GL_SUN_slice_accum -#define GL_SUN_slice_accum 1 - -#define GL_SLICE_ACCUM_SUN 0x85CC - -#define GLEW_SUN_slice_accum GLEW_GET_VAR(__GLEW_SUN_slice_accum) - -#endif /* GL_SUN_slice_accum */ - -/* -------------------------- GL_SUN_triangle_list ------------------------- */ - -#ifndef GL_SUN_triangle_list -#define GL_SUN_triangle_list 1 - -#define GL_RESTART_SUN 0x01 -#define GL_REPLACE_MIDDLE_SUN 0x02 -#define GL_REPLACE_OLDEST_SUN 0x03 -#define GL_TRIANGLE_LIST_SUN 0x81D7 -#define GL_REPLACEMENT_CODE_SUN 0x81D8 -#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 -#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 -#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 -#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 -#define GL_R1UI_V3F_SUN 0x85C4 -#define GL_R1UI_C4UB_V3F_SUN 0x85C5 -#define GL_R1UI_C3F_V3F_SUN 0x85C6 -#define GL_R1UI_N3F_V3F_SUN 0x85C7 -#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 -#define GL_R1UI_T2F_V3F_SUN 0x85C9 -#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA -#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB - -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const void *pointer); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte* code); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint* code); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort* code); - -#define glReplacementCodePointerSUN GLEW_GET_FUN(__glewReplacementCodePointerSUN) -#define glReplacementCodeubSUN GLEW_GET_FUN(__glewReplacementCodeubSUN) -#define glReplacementCodeubvSUN GLEW_GET_FUN(__glewReplacementCodeubvSUN) -#define glReplacementCodeuiSUN GLEW_GET_FUN(__glewReplacementCodeuiSUN) -#define glReplacementCodeuivSUN GLEW_GET_FUN(__glewReplacementCodeuivSUN) -#define glReplacementCodeusSUN GLEW_GET_FUN(__glewReplacementCodeusSUN) -#define glReplacementCodeusvSUN GLEW_GET_FUN(__glewReplacementCodeusvSUN) - -#define GLEW_SUN_triangle_list GLEW_GET_VAR(__GLEW_SUN_triangle_list) - -#endif /* GL_SUN_triangle_list */ - -/* ----------------------------- GL_SUN_vertex ----------------------------- */ - -#ifndef GL_SUN_vertex -#define GL_SUN_vertex 1 - -typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *n, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); -typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte* c, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte* c, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* n, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint* rc, const GLubyte *c, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *n, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat* tc, const GLubyte *c, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *n, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *v); - -#define glColor3fVertex3fSUN GLEW_GET_FUN(__glewColor3fVertex3fSUN) -#define glColor3fVertex3fvSUN GLEW_GET_FUN(__glewColor3fVertex3fvSUN) -#define glColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fSUN) -#define glColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fvSUN) -#define glColor4ubVertex2fSUN GLEW_GET_FUN(__glewColor4ubVertex2fSUN) -#define glColor4ubVertex2fvSUN GLEW_GET_FUN(__glewColor4ubVertex2fvSUN) -#define glColor4ubVertex3fSUN GLEW_GET_FUN(__glewColor4ubVertex3fSUN) -#define glColor4ubVertex3fvSUN GLEW_GET_FUN(__glewColor4ubVertex3fvSUN) -#define glNormal3fVertex3fSUN GLEW_GET_FUN(__glewNormal3fVertex3fSUN) -#define glNormal3fVertex3fvSUN GLEW_GET_FUN(__glewNormal3fVertex3fvSUN) -#define glReplacementCodeuiColor3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fSUN) -#define glReplacementCodeuiColor3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fvSUN) -#define glReplacementCodeuiColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fSUN) -#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fvSUN) -#define glReplacementCodeuiColor4ubVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fSUN) -#define glReplacementCodeuiColor4ubVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fvSUN) -#define glReplacementCodeuiNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fSUN) -#define glReplacementCodeuiNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fvSUN) -#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN) -#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN) -#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN) -#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN) -#define glReplacementCodeuiTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fSUN) -#define glReplacementCodeuiTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fvSUN) -#define glReplacementCodeuiVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fSUN) -#define glReplacementCodeuiVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fvSUN) -#define glTexCoord2fColor3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fSUN) -#define glTexCoord2fColor3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fvSUN) -#define glTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fSUN) -#define glTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fvSUN) -#define glTexCoord2fColor4ubVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fSUN) -#define glTexCoord2fColor4ubVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fvSUN) -#define glTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fSUN) -#define glTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fvSUN) -#define glTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fSUN) -#define glTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fvSUN) -#define glTexCoord4fColor4fNormal3fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fSUN) -#define glTexCoord4fColor4fNormal3fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fvSUN) -#define glTexCoord4fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fSUN) -#define glTexCoord4fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fvSUN) - -#define GLEW_SUN_vertex GLEW_GET_VAR(__GLEW_SUN_vertex) - -#endif /* GL_SUN_vertex */ - -/* -------------------------- GL_WIN_phong_shading ------------------------- */ - -#ifndef GL_WIN_phong_shading -#define GL_WIN_phong_shading 1 - -#define GL_PHONG_WIN 0x80EA -#define GL_PHONG_HINT_WIN 0x80EB - -#define GLEW_WIN_phong_shading GLEW_GET_VAR(__GLEW_WIN_phong_shading) - -#endif /* GL_WIN_phong_shading */ - -/* -------------------------- GL_WIN_specular_fog -------------------------- */ - -#ifndef GL_WIN_specular_fog -#define GL_WIN_specular_fog 1 - -#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC - -#define GLEW_WIN_specular_fog GLEW_GET_VAR(__GLEW_WIN_specular_fog) - -#endif /* GL_WIN_specular_fog */ - -/* ---------------------------- GL_WIN_swap_hint --------------------------- */ - -#ifndef GL_WIN_swap_hint -#define GL_WIN_swap_hint 1 - -typedef void (GLAPIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei width, GLsizei height); - -#define glAddSwapHintRectWIN GLEW_GET_FUN(__glewAddSwapHintRectWIN) - -#define GLEW_WIN_swap_hint GLEW_GET_VAR(__GLEW_WIN_swap_hint) - -#endif /* GL_WIN_swap_hint */ - -/* ------------------------------------------------------------------------- */ - -#if defined(GLEW_MX) && defined(_WIN32) -#define GLEW_FUN_EXPORT -#else -#define GLEW_FUN_EXPORT GLEWAPI -#endif /* GLEW_MX */ - -#if defined(GLEW_MX) -#define GLEW_VAR_EXPORT -#else -#define GLEW_VAR_EXPORT GLEWAPI -#endif /* GLEW_MX */ - -#if defined(GLEW_MX) && defined(_WIN32) -struct GLEWContextStruct -{ -#endif /* GLEW_MX */ - -GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D; -GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements; -GLEW_FUN_EXPORT PFNGLTEXIMAGE3DPROC __glewTexImage3D; -GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D; - -GLEW_FUN_EXPORT PFNGLACTIVETEXTUREPROC __glewActiveTexture; -GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D; -GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage; -GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd; -GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf; -GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd; -GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv; -GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage; - -GLEW_FUN_EXPORT PFNGLBLENDCOLORPROC __glewBlendColor; -GLEW_FUN_EXPORT PFNGLBLENDEQUATIONPROC __glewBlendEquation; -GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate; -GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer; -GLEW_FUN_EXPORT PFNGLFOGCOORDDPROC __glewFogCoordd; -GLEW_FUN_EXPORT PFNGLFOGCOORDDVPROC __glewFogCoorddv; -GLEW_FUN_EXPORT PFNGLFOGCOORDFPROC __glewFogCoordf; -GLEW_FUN_EXPORT PFNGLFOGCOORDFVPROC __glewFogCoordfv; -GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays; -GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements; -GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFPROC __glewPointParameterf; -GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv; -GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIPROC __glewPointParameteri; -GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2DPROC __glewWindowPos2d; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2FPROC __glewWindowPos2f; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2IPROC __glewWindowPos2i; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2SPROC __glewWindowPos2s; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3DPROC __glewWindowPos3d; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3FPROC __glewWindowPos3f; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3IPROC __glewWindowPos3i; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3SPROC __glewWindowPos3s; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv; - -GLEW_FUN_EXPORT PFNGLBEGINQUERYPROC __glewBeginQuery; -GLEW_FUN_EXPORT PFNGLBINDBUFFERPROC __glewBindBuffer; -GLEW_FUN_EXPORT PFNGLBUFFERDATAPROC __glewBufferData; -GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAPROC __glewBufferSubData; -GLEW_FUN_EXPORT PFNGLDELETEBUFFERSPROC __glewDeleteBuffers; -GLEW_FUN_EXPORT PFNGLDELETEQUERIESPROC __glewDeleteQueries; -GLEW_FUN_EXPORT PFNGLENDQUERYPROC __glewEndQuery; -GLEW_FUN_EXPORT PFNGLGENBUFFERSPROC __glewGenBuffers; -GLEW_FUN_EXPORT PFNGLGENQUERIESPROC __glewGenQueries; -GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv; -GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv; -GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData; -GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv; -GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv; -GLEW_FUN_EXPORT PFNGLGETQUERYIVPROC __glewGetQueryiv; -GLEW_FUN_EXPORT PFNGLISBUFFERPROC __glewIsBuffer; -GLEW_FUN_EXPORT PFNGLISQUERYPROC __glewIsQuery; -GLEW_FUN_EXPORT PFNGLMAPBUFFERPROC __glewMapBuffer; -GLEW_FUN_EXPORT PFNGLUNMAPBUFFERPROC __glewUnmapBuffer; - -GLEW_FUN_EXPORT PFNGLATTACHSHADERPROC __glewAttachShader; -GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation; -GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate; -GLEW_FUN_EXPORT PFNGLCOMPILESHADERPROC __glewCompileShader; -GLEW_FUN_EXPORT PFNGLCREATEPROGRAMPROC __glewCreateProgram; -GLEW_FUN_EXPORT PFNGLCREATESHADERPROC __glewCreateShader; -GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPROC __glewDeleteProgram; -GLEW_FUN_EXPORT PFNGLDELETESHADERPROC __glewDeleteShader; -GLEW_FUN_EXPORT PFNGLDETACHSHADERPROC __glewDetachShader; -GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray; -GLEW_FUN_EXPORT PFNGLDRAWBUFFERSPROC __glewDrawBuffers; -GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray; -GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib; -GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform; -GLEW_FUN_EXPORT PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders; -GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation; -GLEW_FUN_EXPORT PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog; -GLEW_FUN_EXPORT PFNGLGETPROGRAMIVPROC __glewGetProgramiv; -GLEW_FUN_EXPORT PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog; -GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEPROC __glewGetShaderSource; -GLEW_FUN_EXPORT PFNGLGETSHADERIVPROC __glewGetShaderiv; -GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation; -GLEW_FUN_EXPORT PFNGLGETUNIFORMFVPROC __glewGetUniformfv; -GLEW_FUN_EXPORT PFNGLGETUNIFORMIVPROC __glewGetUniformiv; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv; -GLEW_FUN_EXPORT PFNGLISPROGRAMPROC __glewIsProgram; -GLEW_FUN_EXPORT PFNGLISSHADERPROC __glewIsShader; -GLEW_FUN_EXPORT PFNGLLINKPROGRAMPROC __glewLinkProgram; -GLEW_FUN_EXPORT PFNGLSHADERSOURCEPROC __glewShaderSource; -GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate; -GLEW_FUN_EXPORT PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate; -GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate; -GLEW_FUN_EXPORT PFNGLUNIFORM1FPROC __glewUniform1f; -GLEW_FUN_EXPORT PFNGLUNIFORM1FVPROC __glewUniform1fv; -GLEW_FUN_EXPORT PFNGLUNIFORM1IPROC __glewUniform1i; -GLEW_FUN_EXPORT PFNGLUNIFORM1IVPROC __glewUniform1iv; -GLEW_FUN_EXPORT PFNGLUNIFORM2FPROC __glewUniform2f; -GLEW_FUN_EXPORT PFNGLUNIFORM2FVPROC __glewUniform2fv; -GLEW_FUN_EXPORT PFNGLUNIFORM2IPROC __glewUniform2i; -GLEW_FUN_EXPORT PFNGLUNIFORM2IVPROC __glewUniform2iv; -GLEW_FUN_EXPORT PFNGLUNIFORM3FPROC __glewUniform3f; -GLEW_FUN_EXPORT PFNGLUNIFORM3FVPROC __glewUniform3fv; -GLEW_FUN_EXPORT PFNGLUNIFORM3IPROC __glewUniform3i; -GLEW_FUN_EXPORT PFNGLUNIFORM3IVPROC __glewUniform3iv; -GLEW_FUN_EXPORT PFNGLUNIFORM4FPROC __glewUniform4f; -GLEW_FUN_EXPORT PFNGLUNIFORM4FVPROC __glewUniform4fv; -GLEW_FUN_EXPORT PFNGLUNIFORM4IPROC __glewUniform4i; -GLEW_FUN_EXPORT PFNGLUNIFORM4IVPROC __glewUniform4iv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv; -GLEW_FUN_EXPORT PFNGLUSEPROGRAMPROC __glewUseProgram; -GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPROC __glewValidateProgram; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer; - -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv; - -GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender; -GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback; -GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation; -GLEW_FUN_EXPORT PFNGLCLAMPCOLORPROC __glewClampColor; -GLEW_FUN_EXPORT PFNGLCLEARBUFFERFIPROC __glewClearBufferfi; -GLEW_FUN_EXPORT PFNGLCLEARBUFFERFVPROC __glewClearBufferfv; -GLEW_FUN_EXPORT PFNGLCLEARBUFFERIVPROC __glewClearBufferiv; -GLEW_FUN_EXPORT PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv; -GLEW_FUN_EXPORT PFNGLCOLORMASKIPROC __glewColorMaski; -GLEW_FUN_EXPORT PFNGLDISABLEIPROC __glewDisablei; -GLEW_FUN_EXPORT PFNGLENABLEIPROC __glewEnablei; -GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender; -GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback; -GLEW_FUN_EXPORT PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v; -GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation; -GLEW_FUN_EXPORT PFNGLGETSTRINGIPROC __glewGetStringi; -GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv; -GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv; -GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying; -GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv; -GLEW_FUN_EXPORT PFNGLISENABLEDIPROC __glewIsEnabledi; -GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv; -GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv; -GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings; -GLEW_FUN_EXPORT PFNGLUNIFORM1UIPROC __glewUniform1ui; -GLEW_FUN_EXPORT PFNGLUNIFORM1UIVPROC __glewUniform1uiv; -GLEW_FUN_EXPORT PFNGLUNIFORM2UIPROC __glewUniform2ui; -GLEW_FUN_EXPORT PFNGLUNIFORM2UIVPROC __glewUniform2uiv; -GLEW_FUN_EXPORT PFNGLUNIFORM3UIPROC __glewUniform3ui; -GLEW_FUN_EXPORT PFNGLUNIFORM3UIVPROC __glewUniform3uiv; -GLEW_FUN_EXPORT PFNGLUNIFORM4UIPROC __glewUniform4ui; -GLEW_FUN_EXPORT PFNGLUNIFORM4UIVPROC __glewUniform4uiv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer; - -GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced; -GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced; -GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex; -GLEW_FUN_EXPORT PFNGLTEXBUFFERPROC __glewTexBuffer; - -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture; -GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v; -GLEW_FUN_EXPORT PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v; - -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor; - -GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei; -GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIPROC __glewBlendEquationi; -GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei; -GLEW_FUN_EXPORT PFNGLBLENDFUNCIPROC __glewBlendFunci; -GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading; - -GLEW_FUN_EXPORT PFNGLGETGRAPHICSRESETSTATUSPROC __glewGetGraphicsResetStatus; -GLEW_FUN_EXPORT PFNGLGETNCOMPRESSEDTEXIMAGEPROC __glewGetnCompressedTexImage; -GLEW_FUN_EXPORT PFNGLGETNTEXIMAGEPROC __glewGetnTexImage; -GLEW_FUN_EXPORT PFNGLGETNUNIFORMDVPROC __glewGetnUniformdv; - -GLEW_FUN_EXPORT PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX; - -GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD; -GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD; -GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD; -GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD; - -GLEW_FUN_EXPORT PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD; -GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD; -GLEW_FUN_EXPORT PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD; -GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD; - -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPARAMETERIAMDPROC __glewVertexAttribParameteriAMD; - -GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD; -GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD; - -GLEW_FUN_EXPORT PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD; -GLEW_FUN_EXPORT PFNGLGENNAMESAMDPROC __glewGenNamesAMD; -GLEW_FUN_EXPORT PFNGLISNAMEAMDPROC __glewIsNameAMD; - -GLEW_FUN_EXPORT PFNGLQUERYOBJECTPARAMETERUIAMDPROC __glewQueryObjectParameteruiAMD; - -GLEW_FUN_EXPORT PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD; -GLEW_FUN_EXPORT PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD; -GLEW_FUN_EXPORT PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD; -GLEW_FUN_EXPORT PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD; -GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD; -GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD; -GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD; -GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD; -GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD; -GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD; -GLEW_FUN_EXPORT PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD; - -GLEW_FUN_EXPORT PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD; - -GLEW_FUN_EXPORT PFNGLTEXSTORAGESPARSEAMDPROC __glewTexStorageSparseAMD; -GLEW_FUN_EXPORT PFNGLTEXTURESTORAGESPARSEAMDPROC __glewTextureStorageSparseAMD; - -GLEW_FUN_EXPORT PFNGLSTENCILOPVALUEAMDPROC __glewStencilOpValueAMD; - -GLEW_FUN_EXPORT PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD; -GLEW_FUN_EXPORT PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD; - -GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERANGLEPROC __glewBlitFramebufferANGLE; - -GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC __glewRenderbufferStorageMultisampleANGLE; - -GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDANGLEPROC __glewDrawArraysInstancedANGLE; -GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDANGLEPROC __glewDrawElementsInstancedANGLE; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORANGLEPROC __glewVertexAttribDivisorANGLE; - -GLEW_FUN_EXPORT PFNGLBEGINQUERYANGLEPROC __glewBeginQueryANGLE; -GLEW_FUN_EXPORT PFNGLDELETEQUERIESANGLEPROC __glewDeleteQueriesANGLE; -GLEW_FUN_EXPORT PFNGLENDQUERYANGLEPROC __glewEndQueryANGLE; -GLEW_FUN_EXPORT PFNGLGENQUERIESANGLEPROC __glewGenQueriesANGLE; -GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VANGLEPROC __glewGetQueryObjecti64vANGLE; -GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVANGLEPROC __glewGetQueryObjectivANGLE; -GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VANGLEPROC __glewGetQueryObjectui64vANGLE; -GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVANGLEPROC __glewGetQueryObjectuivANGLE; -GLEW_FUN_EXPORT PFNGLGETQUERYIVANGLEPROC __glewGetQueryivANGLE; -GLEW_FUN_EXPORT PFNGLISQUERYANGLEPROC __glewIsQueryANGLE; -GLEW_FUN_EXPORT PFNGLQUERYCOUNTERANGLEPROC __glewQueryCounterANGLE; - -GLEW_FUN_EXPORT PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC __glewGetTranslatedShaderSourceANGLE; - -GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE; -GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE; -GLEW_FUN_EXPORT PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE; -GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE; -GLEW_FUN_EXPORT PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE; - -GLEW_FUN_EXPORT PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE; -GLEW_FUN_EXPORT PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE; -GLEW_FUN_EXPORT PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE; -GLEW_FUN_EXPORT PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE; -GLEW_FUN_EXPORT PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE; -GLEW_FUN_EXPORT PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE; -GLEW_FUN_EXPORT PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE; -GLEW_FUN_EXPORT PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE; - -GLEW_FUN_EXPORT PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE; -GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE; - -GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE; -GLEW_FUN_EXPORT PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE; -GLEW_FUN_EXPORT PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE; - -GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE; -GLEW_FUN_EXPORT PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE; - -GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE; -GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE; -GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE; -GLEW_FUN_EXPORT PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE; - -GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE; - -GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE; -GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE; -GLEW_FUN_EXPORT PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE; -GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE; -GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE; -GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE; -GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE; - -GLEW_FUN_EXPORT PFNGLCLEARDEPTHFPROC __glewClearDepthf; -GLEW_FUN_EXPORT PFNGLDEPTHRANGEFPROC __glewDepthRangef; -GLEW_FUN_EXPORT PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat; -GLEW_FUN_EXPORT PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler; -GLEW_FUN_EXPORT PFNGLSHADERBINARYPROC __glewShaderBinary; - -GLEW_FUN_EXPORT PFNGLMEMORYBARRIERBYREGIONPROC __glewMemoryBarrierByRegion; - -GLEW_FUN_EXPORT PFNGLPRIMITIVEBOUNDINGBOXARBPROC __glewPrimitiveBoundingBoxARB; - -GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance; -GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance; -GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance; - -GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLEARBPROC __glewGetImageHandleARB; -GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLEARBPROC __glewGetTextureHandleARB; -GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLEARBPROC __glewGetTextureSamplerHandleARB; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VARBPROC __glewGetVertexAttribLui64vARB; -GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTARBPROC __glewIsImageHandleResidentARB; -GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTARBPROC __glewIsTextureHandleResidentARB; -GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC __glewMakeImageHandleNonResidentARB; -GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTARBPROC __glewMakeImageHandleResidentARB; -GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC __glewMakeTextureHandleNonResidentARB; -GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTARBPROC __glewMakeTextureHandleResidentARB; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC __glewProgramUniformHandleui64ARB; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC __glewProgramUniformHandleui64vARB; -GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64ARBPROC __glewUniformHandleui64ARB; -GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VARBPROC __glewUniformHandleui64vARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64ARBPROC __glewVertexAttribL1ui64ARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VARBPROC __glewVertexAttribL1ui64vARB; - -GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed; -GLEW_FUN_EXPORT PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex; - -GLEW_FUN_EXPORT PFNGLBUFFERSTORAGEPROC __glewBufferStorage; -GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEEXTPROC __glewNamedBufferStorageEXT; - -GLEW_FUN_EXPORT PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB; - -GLEW_FUN_EXPORT PFNGLCLEARBUFFERDATAPROC __glewClearBufferData; -GLEW_FUN_EXPORT PFNGLCLEARBUFFERSUBDATAPROC __glewClearBufferSubData; -GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERDATAEXTPROC __glewClearNamedBufferDataEXT; -GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC __glewClearNamedBufferSubDataEXT; - -GLEW_FUN_EXPORT PFNGLCLEARTEXIMAGEPROC __glewClearTexImage; -GLEW_FUN_EXPORT PFNGLCLEARTEXSUBIMAGEPROC __glewClearTexSubImage; - -GLEW_FUN_EXPORT PFNGLCLIPCONTROLPROC __glewClipControl; - -GLEW_FUN_EXPORT PFNGLCLAMPCOLORARBPROC __glewClampColorARB; - -GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEPROC __glewDispatchCompute; -GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEINDIRECTPROC __glewDispatchComputeIndirect; - -GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC __glewDispatchComputeGroupSizeARB; - -GLEW_FUN_EXPORT PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData; - -GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATAPROC __glewCopyImageSubData; - -GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB; -GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB; -GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB; -GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB; - -GLEW_FUN_EXPORT PFNGLBINDTEXTUREUNITPROC __glewBindTextureUnit; -GLEW_FUN_EXPORT PFNGLBLITNAMEDFRAMEBUFFERPROC __glewBlitNamedFramebuffer; -GLEW_FUN_EXPORT PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC __glewCheckNamedFramebufferStatus; -GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERDATAPROC __glewClearNamedBufferData; -GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERSUBDATAPROC __glewClearNamedBufferSubData; -GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERFIPROC __glewClearNamedFramebufferfi; -GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERFVPROC __glewClearNamedFramebufferfv; -GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERIVPROC __glewClearNamedFramebufferiv; -GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC __glewClearNamedFramebufferuiv; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC __glewCompressedTextureSubImage1D; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC __glewCompressedTextureSubImage2D; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC __glewCompressedTextureSubImage3D; -GLEW_FUN_EXPORT PFNGLCOPYNAMEDBUFFERSUBDATAPROC __glewCopyNamedBufferSubData; -GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE1DPROC __glewCopyTextureSubImage1D; -GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE2DPROC __glewCopyTextureSubImage2D; -GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE3DPROC __glewCopyTextureSubImage3D; -GLEW_FUN_EXPORT PFNGLCREATEBUFFERSPROC __glewCreateBuffers; -GLEW_FUN_EXPORT PFNGLCREATEFRAMEBUFFERSPROC __glewCreateFramebuffers; -GLEW_FUN_EXPORT PFNGLCREATEPROGRAMPIPELINESPROC __glewCreateProgramPipelines; -GLEW_FUN_EXPORT PFNGLCREATEQUERIESPROC __glewCreateQueries; -GLEW_FUN_EXPORT PFNGLCREATERENDERBUFFERSPROC __glewCreateRenderbuffers; -GLEW_FUN_EXPORT PFNGLCREATESAMPLERSPROC __glewCreateSamplers; -GLEW_FUN_EXPORT PFNGLCREATETEXTURESPROC __glewCreateTextures; -GLEW_FUN_EXPORT PFNGLCREATETRANSFORMFEEDBACKSPROC __glewCreateTransformFeedbacks; -GLEW_FUN_EXPORT PFNGLCREATEVERTEXARRAYSPROC __glewCreateVertexArrays; -GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYATTRIBPROC __glewDisableVertexArrayAttrib; -GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYATTRIBPROC __glewEnableVertexArrayAttrib; -GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC __glewFlushMappedNamedBufferRange; -GLEW_FUN_EXPORT PFNGLGENERATETEXTUREMIPMAPPROC __glewGenerateTextureMipmap; -GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC __glewGetCompressedTextureImage; -GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERI64VPROC __glewGetNamedBufferParameteri64v; -GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERIVPROC __glewGetNamedBufferParameteriv; -GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPOINTERVPROC __glewGetNamedBufferPointerv; -GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERSUBDATAPROC __glewGetNamedBufferSubData; -GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetNamedFramebufferAttachmentParameteriv; -GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC __glewGetNamedFramebufferParameteriv; -GLEW_FUN_EXPORT PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC __glewGetNamedRenderbufferParameteriv; -GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTI64VPROC __glewGetQueryBufferObjecti64v; -GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTIVPROC __glewGetQueryBufferObjectiv; -GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTUI64VPROC __glewGetQueryBufferObjectui64v; -GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTUIVPROC __glewGetQueryBufferObjectuiv; -GLEW_FUN_EXPORT PFNGLGETTEXTUREIMAGEPROC __glewGetTextureImage; -GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERFVPROC __glewGetTextureLevelParameterfv; -GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERIVPROC __glewGetTextureLevelParameteriv; -GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIIVPROC __glewGetTextureParameterIiv; -GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIUIVPROC __glewGetTextureParameterIuiv; -GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERFVPROC __glewGetTextureParameterfv; -GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIVPROC __glewGetTextureParameteriv; -GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKI64_VPROC __glewGetTransformFeedbacki64_v; -GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKI_VPROC __glewGetTransformFeedbacki_v; -GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKIVPROC __glewGetTransformFeedbackiv; -GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINDEXED64IVPROC __glewGetVertexArrayIndexed64iv; -GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINDEXEDIVPROC __glewGetVertexArrayIndexediv; -GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYIVPROC __glewGetVertexArrayiv; -GLEW_FUN_EXPORT PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC __glewInvalidateNamedFramebufferData; -GLEW_FUN_EXPORT PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC __glewInvalidateNamedFramebufferSubData; -GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERPROC __glewMapNamedBuffer; -GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERRANGEPROC __glewMapNamedBufferRange; -GLEW_FUN_EXPORT PFNGLNAMEDBUFFERDATAPROC __glewNamedBufferData; -GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEPROC __glewNamedBufferStorage; -GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSUBDATAPROC __glewNamedBufferSubData; -GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC __glewNamedFramebufferDrawBuffer; -GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC __glewNamedFramebufferDrawBuffers; -GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC __glewNamedFramebufferParameteri; -GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC __glewNamedFramebufferReadBuffer; -GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC __glewNamedFramebufferRenderbuffer; -GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREPROC __glewNamedFramebufferTexture; -GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC __glewNamedFramebufferTextureLayer; -GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEPROC __glewNamedRenderbufferStorage; -GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewNamedRenderbufferStorageMultisample; -GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERPROC __glewTextureBuffer; -GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERRANGEPROC __glewTextureBufferRange; -GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIIVPROC __glewTextureParameterIiv; -GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIUIVPROC __glewTextureParameterIuiv; -GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFPROC __glewTextureParameterf; -GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFVPROC __glewTextureParameterfv; -GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIPROC __glewTextureParameteri; -GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIVPROC __glewTextureParameteriv; -GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE1DPROC __glewTextureStorage1D; -GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DPROC __glewTextureStorage2D; -GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC __glewTextureStorage2DMultisample; -GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DPROC __glewTextureStorage3D; -GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC __glewTextureStorage3DMultisample; -GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE1DPROC __glewTextureSubImage1D; -GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE2DPROC __glewTextureSubImage2D; -GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE3DPROC __glewTextureSubImage3D; -GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC __glewTransformFeedbackBufferBase; -GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC __glewTransformFeedbackBufferRange; -GLEW_FUN_EXPORT PFNGLUNMAPNAMEDBUFFERPROC __glewUnmapNamedBuffer; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBBINDINGPROC __glewVertexArrayAttribBinding; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBFORMATPROC __glewVertexArrayAttribFormat; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBIFORMATPROC __glewVertexArrayAttribIFormat; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBLFORMATPROC __glewVertexArrayAttribLFormat; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYBINDINGDIVISORPROC __glewVertexArrayBindingDivisor; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYELEMENTBUFFERPROC __glewVertexArrayElementBuffer; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXBUFFERPROC __glewVertexArrayVertexBuffer; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXBUFFERSPROC __glewVertexArrayVertexBuffers; - -GLEW_FUN_EXPORT PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB; - -GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB; -GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB; -GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB; -GLEW_FUN_EXPORT PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB; - -GLEW_FUN_EXPORT PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex; -GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex; -GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex; -GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex; - -GLEW_FUN_EXPORT PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect; -GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect; - -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERPARAMETERIPROC __glewFramebufferParameteri; -GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVPROC __glewGetFramebufferParameteriv; -GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC __glewGetNamedFramebufferParameterivEXT; -GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC __glewNamedFramebufferParameteriEXT; - -GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer; -GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer; -GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer; -GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus; -GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers; -GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer; -GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers; -GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers; -GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap; -GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv; -GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv; -GLEW_FUN_EXPORT PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer; -GLEW_FUN_EXPORT PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer; -GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage; -GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample; - -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB; -GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB; - -GLEW_FUN_EXPORT PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary; -GLEW_FUN_EXPORT PFNGLPROGRAMBINARYPROC __glewProgramBinary; -GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri; - -GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC __glewGetCompressedTextureSubImage; -GLEW_FUN_EXPORT PFNGLGETTEXTURESUBIMAGEPROC __glewGetTextureSubImage; - -GLEW_FUN_EXPORT PFNGLGETUNIFORMDVPROC __glewGetUniformdv; -GLEW_FUN_EXPORT PFNGLUNIFORM1DPROC __glewUniform1d; -GLEW_FUN_EXPORT PFNGLUNIFORM1DVPROC __glewUniform1dv; -GLEW_FUN_EXPORT PFNGLUNIFORM2DPROC __glewUniform2d; -GLEW_FUN_EXPORT PFNGLUNIFORM2DVPROC __glewUniform2dv; -GLEW_FUN_EXPORT PFNGLUNIFORM3DPROC __glewUniform3d; -GLEW_FUN_EXPORT PFNGLUNIFORM3DVPROC __glewUniform3dv; -GLEW_FUN_EXPORT PFNGLUNIFORM4DPROC __glewUniform4d; -GLEW_FUN_EXPORT PFNGLUNIFORM4DVPROC __glewUniform4dv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv; - -GLEW_FUN_EXPORT PFNGLGETUNIFORMI64VARBPROC __glewGetUniformi64vARB; -GLEW_FUN_EXPORT PFNGLGETUNIFORMUI64VARBPROC __glewGetUniformui64vARB; -GLEW_FUN_EXPORT PFNGLGETNUNIFORMI64VARBPROC __glewGetnUniformi64vARB; -GLEW_FUN_EXPORT PFNGLGETNUNIFORMUI64VARBPROC __glewGetnUniformui64vARB; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64ARBPROC __glewProgramUniform1i64ARB; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64VARBPROC __glewProgramUniform1i64vARB; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64ARBPROC __glewProgramUniform1ui64ARB; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64VARBPROC __glewProgramUniform1ui64vARB; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64ARBPROC __glewProgramUniform2i64ARB; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64VARBPROC __glewProgramUniform2i64vARB; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64ARBPROC __glewProgramUniform2ui64ARB; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64VARBPROC __glewProgramUniform2ui64vARB; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64ARBPROC __glewProgramUniform3i64ARB; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64VARBPROC __glewProgramUniform3i64vARB; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64ARBPROC __glewProgramUniform3ui64ARB; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64VARBPROC __glewProgramUniform3ui64vARB; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64ARBPROC __glewProgramUniform4i64ARB; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64VARBPROC __glewProgramUniform4i64vARB; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64ARBPROC __glewProgramUniform4ui64ARB; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64VARBPROC __glewProgramUniform4ui64vARB; -GLEW_FUN_EXPORT PFNGLUNIFORM1I64ARBPROC __glewUniform1i64ARB; -GLEW_FUN_EXPORT PFNGLUNIFORM1I64VARBPROC __glewUniform1i64vARB; -GLEW_FUN_EXPORT PFNGLUNIFORM1UI64ARBPROC __glewUniform1ui64ARB; -GLEW_FUN_EXPORT PFNGLUNIFORM1UI64VARBPROC __glewUniform1ui64vARB; -GLEW_FUN_EXPORT PFNGLUNIFORM2I64ARBPROC __glewUniform2i64ARB; -GLEW_FUN_EXPORT PFNGLUNIFORM2I64VARBPROC __glewUniform2i64vARB; -GLEW_FUN_EXPORT PFNGLUNIFORM2UI64ARBPROC __glewUniform2ui64ARB; -GLEW_FUN_EXPORT PFNGLUNIFORM2UI64VARBPROC __glewUniform2ui64vARB; -GLEW_FUN_EXPORT PFNGLUNIFORM3I64ARBPROC __glewUniform3i64ARB; -GLEW_FUN_EXPORT PFNGLUNIFORM3I64VARBPROC __glewUniform3i64vARB; -GLEW_FUN_EXPORT PFNGLUNIFORM3UI64ARBPROC __glewUniform3ui64ARB; -GLEW_FUN_EXPORT PFNGLUNIFORM3UI64VARBPROC __glewUniform3ui64vARB; -GLEW_FUN_EXPORT PFNGLUNIFORM4I64ARBPROC __glewUniform4i64ARB; -GLEW_FUN_EXPORT PFNGLUNIFORM4I64VARBPROC __glewUniform4i64vARB; -GLEW_FUN_EXPORT PFNGLUNIFORM4UI64ARBPROC __glewUniform4ui64ARB; -GLEW_FUN_EXPORT PFNGLUNIFORM4UI64VARBPROC __glewUniform4ui64vARB; - -GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEPROC __glewColorSubTable; -GLEW_FUN_EXPORT PFNGLCOLORTABLEPROC __glewColorTable; -GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv; -GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv; -GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D; -GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D; -GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf; -GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv; -GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri; -GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv; -GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable; -GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable; -GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D; -GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D; -GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPROC __glewGetColorTable; -GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv; -GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv; -GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter; -GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv; -GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv; -GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPROC __glewGetHistogram; -GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv; -GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv; -GLEW_FUN_EXPORT PFNGLGETMINMAXPROC __glewGetMinmax; -GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv; -GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv; -GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter; -GLEW_FUN_EXPORT PFNGLHISTOGRAMPROC __glewHistogram; -GLEW_FUN_EXPORT PFNGLMINMAXPROC __glewMinmax; -GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMPROC __glewResetHistogram; -GLEW_FUN_EXPORT PFNGLRESETMINMAXPROC __glewResetMinmax; -GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D; - -GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC __glewMultiDrawArraysIndirectCountARB; -GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC __glewMultiDrawElementsIndirectCountARB; - -GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB; -GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB; - -GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ; - -GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATI64VPROC __glewGetInternalformati64v; - -GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERDATAPROC __glewInvalidateBufferData; -GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERSUBDATAPROC __glewInvalidateBufferSubData; -GLEW_FUN_EXPORT PFNGLINVALIDATEFRAMEBUFFERPROC __glewInvalidateFramebuffer; -GLEW_FUN_EXPORT PFNGLINVALIDATESUBFRAMEBUFFERPROC __glewInvalidateSubFramebuffer; -GLEW_FUN_EXPORT PFNGLINVALIDATETEXIMAGEPROC __glewInvalidateTexImage; -GLEW_FUN_EXPORT PFNGLINVALIDATETEXSUBIMAGEPROC __glewInvalidateTexSubImage; - -GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange; -GLEW_FUN_EXPORT PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange; - -GLEW_FUN_EXPORT PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB; -GLEW_FUN_EXPORT PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB; -GLEW_FUN_EXPORT PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB; -GLEW_FUN_EXPORT PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB; -GLEW_FUN_EXPORT PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB; - -GLEW_FUN_EXPORT PFNGLBINDBUFFERSBASEPROC __glewBindBuffersBase; -GLEW_FUN_EXPORT PFNGLBINDBUFFERSRANGEPROC __glewBindBuffersRange; -GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTURESPROC __glewBindImageTextures; -GLEW_FUN_EXPORT PFNGLBINDSAMPLERSPROC __glewBindSamplers; -GLEW_FUN_EXPORT PFNGLBINDTEXTURESPROC __glewBindTextures; -GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERSPROC __glewBindVertexBuffers; - -GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTPROC __glewMultiDrawArraysIndirect; -GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTPROC __glewMultiDrawElementsIndirect; - -GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB; - -GLEW_FUN_EXPORT PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB; -GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB; - -GLEW_FUN_EXPORT PFNGLBEGINQUERYARBPROC __glewBeginQueryARB; -GLEW_FUN_EXPORT PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB; -GLEW_FUN_EXPORT PFNGLENDQUERYARBPROC __glewEndQueryARB; -GLEW_FUN_EXPORT PFNGLGENQUERIESARBPROC __glewGenQueriesARB; -GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB; -GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB; -GLEW_FUN_EXPORT PFNGLGETQUERYIVARBPROC __glewGetQueryivARB; -GLEW_FUN_EXPORT PFNGLISQUERYARBPROC __glewIsQueryARB; - -GLEW_FUN_EXPORT PFNGLMAXSHADERCOMPILERTHREADSARBPROC __glewMaxShaderCompilerThreadsARB; - -GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB; -GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB; - -GLEW_FUN_EXPORT PFNGLGETPROGRAMINTERFACEIVPROC __glewGetProgramInterfaceiv; -GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEINDEXPROC __glewGetProgramResourceIndex; -GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONPROC __glewGetProgramResourceLocation; -GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC __glewGetProgramResourceLocationIndex; -GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCENAMEPROC __glewGetProgramResourceName; -GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEIVPROC __glewGetProgramResourceiv; - -GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex; - -GLEW_FUN_EXPORT PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB; -GLEW_FUN_EXPORT PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB; -GLEW_FUN_EXPORT PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB; -GLEW_FUN_EXPORT PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB; -GLEW_FUN_EXPORT PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB; -GLEW_FUN_EXPORT PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB; -GLEW_FUN_EXPORT PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB; -GLEW_FUN_EXPORT PFNGLGETNMAPIVARBPROC __glewGetnMapivARB; -GLEW_FUN_EXPORT PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB; -GLEW_FUN_EXPORT PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB; -GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB; -GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB; -GLEW_FUN_EXPORT PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB; -GLEW_FUN_EXPORT PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB; -GLEW_FUN_EXPORT PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB; -GLEW_FUN_EXPORT PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB; -GLEW_FUN_EXPORT PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB; -GLEW_FUN_EXPORT PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB; -GLEW_FUN_EXPORT PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB; -GLEW_FUN_EXPORT PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB; - -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC __glewFramebufferSampleLocationsfvARB; -GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC __glewNamedFramebufferSampleLocationsfvARB; - -GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB; - -GLEW_FUN_EXPORT PFNGLBINDSAMPLERPROC __glewBindSampler; -GLEW_FUN_EXPORT PFNGLDELETESAMPLERSPROC __glewDeleteSamplers; -GLEW_FUN_EXPORT PFNGLGENSAMPLERSPROC __glewGenSamplers; -GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv; -GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv; -GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv; -GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv; -GLEW_FUN_EXPORT PFNGLISSAMPLERPROC __glewIsSampler; -GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv; -GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv; -GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf; -GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv; -GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri; -GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv; - -GLEW_FUN_EXPORT PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram; -GLEW_FUN_EXPORT PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline; -GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv; -GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines; -GLEW_FUN_EXPORT PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines; -GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog; -GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv; -GLEW_FUN_EXPORT PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv; -GLEW_FUN_EXPORT PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages; -GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline; - -GLEW_FUN_EXPORT PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv; - -GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture; -GLEW_FUN_EXPORT PFNGLMEMORYBARRIERPROC __glewMemoryBarrier; - -GLEW_FUN_EXPORT PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB; -GLEW_FUN_EXPORT PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB; -GLEW_FUN_EXPORT PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB; -GLEW_FUN_EXPORT PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB; -GLEW_FUN_EXPORT PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB; -GLEW_FUN_EXPORT PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB; -GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB; -GLEW_FUN_EXPORT PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB; -GLEW_FUN_EXPORT PFNGLGETHANDLEARBPROC __glewGetHandleARB; -GLEW_FUN_EXPORT PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB; -GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB; -GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB; -GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB; -GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB; -GLEW_FUN_EXPORT PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB; -GLEW_FUN_EXPORT PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB; -GLEW_FUN_EXPORT PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB; -GLEW_FUN_EXPORT PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB; -GLEW_FUN_EXPORT PFNGLUNIFORM1FARBPROC __glewUniform1fARB; -GLEW_FUN_EXPORT PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB; -GLEW_FUN_EXPORT PFNGLUNIFORM1IARBPROC __glewUniform1iARB; -GLEW_FUN_EXPORT PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB; -GLEW_FUN_EXPORT PFNGLUNIFORM2FARBPROC __glewUniform2fARB; -GLEW_FUN_EXPORT PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB; -GLEW_FUN_EXPORT PFNGLUNIFORM2IARBPROC __glewUniform2iARB; -GLEW_FUN_EXPORT PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB; -GLEW_FUN_EXPORT PFNGLUNIFORM3FARBPROC __glewUniform3fARB; -GLEW_FUN_EXPORT PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB; -GLEW_FUN_EXPORT PFNGLUNIFORM3IARBPROC __glewUniform3iARB; -GLEW_FUN_EXPORT PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB; -GLEW_FUN_EXPORT PFNGLUNIFORM4FARBPROC __glewUniform4fARB; -GLEW_FUN_EXPORT PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB; -GLEW_FUN_EXPORT PFNGLUNIFORM4IARBPROC __glewUniform4iARB; -GLEW_FUN_EXPORT PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB; -GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB; -GLEW_FUN_EXPORT PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB; -GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB; - -GLEW_FUN_EXPORT PFNGLSHADERSTORAGEBLOCKBINDINGPROC __glewShaderStorageBlockBinding; - -GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName; -GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName; -GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv; -GLEW_FUN_EXPORT PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv; -GLEW_FUN_EXPORT PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex; -GLEW_FUN_EXPORT PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation; -GLEW_FUN_EXPORT PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv; -GLEW_FUN_EXPORT PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv; - -GLEW_FUN_EXPORT PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB; -GLEW_FUN_EXPORT PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB; -GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB; -GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB; -GLEW_FUN_EXPORT PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB; -GLEW_FUN_EXPORT PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB; - -GLEW_FUN_EXPORT PFNGLBUFFERPAGECOMMITMENTARBPROC __glewBufferPageCommitmentARB; - -GLEW_FUN_EXPORT PFNGLTEXPAGECOMMITMENTARBPROC __glewTexPageCommitmentARB; -GLEW_FUN_EXPORT PFNGLTEXTUREPAGECOMMITMENTEXTPROC __glewTexturePageCommitmentEXT; - -GLEW_FUN_EXPORT PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync; -GLEW_FUN_EXPORT PFNGLDELETESYNCPROC __glewDeleteSync; -GLEW_FUN_EXPORT PFNGLFENCESYNCPROC __glewFenceSync; -GLEW_FUN_EXPORT PFNGLGETINTEGER64VPROC __glewGetInteger64v; -GLEW_FUN_EXPORT PFNGLGETSYNCIVPROC __glewGetSynciv; -GLEW_FUN_EXPORT PFNGLISSYNCPROC __glewIsSync; -GLEW_FUN_EXPORT PFNGLWAITSYNCPROC __glewWaitSync; - -GLEW_FUN_EXPORT PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv; -GLEW_FUN_EXPORT PFNGLPATCHPARAMETERIPROC __glewPatchParameteri; - -GLEW_FUN_EXPORT PFNGLTEXTUREBARRIERPROC __glewTextureBarrier; - -GLEW_FUN_EXPORT PFNGLTEXBUFFERARBPROC __glewTexBufferARB; - -GLEW_FUN_EXPORT PFNGLTEXBUFFERRANGEPROC __glewTexBufferRange; -GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERRANGEEXTPROC __glewTextureBufferRangeEXT; - -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB; -GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB; - -GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv; -GLEW_FUN_EXPORT PFNGLSAMPLEMASKIPROC __glewSampleMaski; -GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample; -GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample; - -GLEW_FUN_EXPORT PFNGLTEXSTORAGE1DPROC __glewTexStorage1D; -GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DPROC __glewTexStorage2D; -GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DPROC __glewTexStorage3D; -GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT; -GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT; -GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT; - -GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DMULTISAMPLEPROC __glewTexStorage2DMultisample; -GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DMULTISAMPLEPROC __glewTexStorage3DMultisample; -GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC __glewTextureStorage2DMultisampleEXT; -GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC __glewTextureStorage3DMultisampleEXT; - -GLEW_FUN_EXPORT PFNGLTEXTUREVIEWPROC __glewTextureView; - -GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v; -GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v; -GLEW_FUN_EXPORT PFNGLQUERYCOUNTERPROC __glewQueryCounter; - -GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback; -GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks; -GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback; -GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks; -GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback; -GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback; -GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback; - -GLEW_FUN_EXPORT PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed; -GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream; -GLEW_FUN_EXPORT PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed; -GLEW_FUN_EXPORT PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv; - -GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced; -GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced; - -GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB; -GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB; -GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB; -GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB; - -GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEPROC __glewBindBufferBase; -GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange; -GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName; -GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv; -GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName; -GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv; -GLEW_FUN_EXPORT PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v; -GLEW_FUN_EXPORT PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex; -GLEW_FUN_EXPORT PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices; -GLEW_FUN_EXPORT PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding; - -GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray; -GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays; -GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays; -GLEW_FUN_EXPORT PFNGLISVERTEXARRAYPROC __glewIsVertexArray; - -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer; - -GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERPROC __glewBindVertexBuffer; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC __glewVertexArrayBindVertexBufferEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC __glewVertexArrayVertexAttribBindingEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC __glewVertexArrayVertexAttribFormatEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC __glewVertexArrayVertexAttribIFormatEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC __glewVertexArrayVertexAttribLFormatEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC __glewVertexArrayVertexBindingDivisorEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBBINDINGPROC __glewVertexAttribBinding; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATPROC __glewVertexAttribFormat; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATPROC __glewVertexAttribIFormat; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATPROC __glewVertexAttribLFormat; -GLEW_FUN_EXPORT PFNGLVERTEXBINDINGDIVISORPROC __glewVertexBindingDivisor; - -GLEW_FUN_EXPORT PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB; -GLEW_FUN_EXPORT PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB; -GLEW_FUN_EXPORT PFNGLWEIGHTBVARBPROC __glewWeightbvARB; -GLEW_FUN_EXPORT PFNGLWEIGHTDVARBPROC __glewWeightdvARB; -GLEW_FUN_EXPORT PFNGLWEIGHTFVARBPROC __glewWeightfvARB; -GLEW_FUN_EXPORT PFNGLWEIGHTIVARBPROC __glewWeightivARB; -GLEW_FUN_EXPORT PFNGLWEIGHTSVARBPROC __glewWeightsvARB; -GLEW_FUN_EXPORT PFNGLWEIGHTUBVARBPROC __glewWeightubvARB; -GLEW_FUN_EXPORT PFNGLWEIGHTUIVARBPROC __glewWeightuivARB; -GLEW_FUN_EXPORT PFNGLWEIGHTUSVARBPROC __glewWeightusvARB; - -GLEW_FUN_EXPORT PFNGLBINDBUFFERARBPROC __glewBindBufferARB; -GLEW_FUN_EXPORT PFNGLBUFFERDATAARBPROC __glewBufferDataARB; -GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB; -GLEW_FUN_EXPORT PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB; -GLEW_FUN_EXPORT PFNGLGENBUFFERSARBPROC __glewGenBuffersARB; -GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB; -GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB; -GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB; -GLEW_FUN_EXPORT PFNGLISBUFFERARBPROC __glewIsBufferARB; -GLEW_FUN_EXPORT PFNGLMAPBUFFERARBPROC __glewMapBufferARB; -GLEW_FUN_EXPORT PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB; - -GLEW_FUN_EXPORT PFNGLBINDPROGRAMARBPROC __glewBindProgramARB; -GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB; -GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB; -GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB; -GLEW_FUN_EXPORT PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB; -GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB; -GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB; -GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB; -GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB; -GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB; -GLEW_FUN_EXPORT PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB; -GLEW_FUN_EXPORT PFNGLISPROGRAMARBPROC __glewIsProgramARB; -GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB; -GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB; -GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB; -GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB; -GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB; -GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB; -GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB; -GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB; -GLEW_FUN_EXPORT PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB; - -GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB; -GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB; -GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB; - -GLEW_FUN_EXPORT PFNGLCOLORP3UIPROC __glewColorP3ui; -GLEW_FUN_EXPORT PFNGLCOLORP3UIVPROC __glewColorP3uiv; -GLEW_FUN_EXPORT PFNGLCOLORP4UIPROC __glewColorP4ui; -GLEW_FUN_EXPORT PFNGLCOLORP4UIVPROC __glewColorP4uiv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv; -GLEW_FUN_EXPORT PFNGLNORMALP3UIPROC __glewNormalP3ui; -GLEW_FUN_EXPORT PFNGLNORMALP3UIVPROC __glewNormalP3uiv; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv; -GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui; -GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv; -GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui; -GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv; -GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui; -GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv; -GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui; -GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv; -GLEW_FUN_EXPORT PFNGLVERTEXP2UIPROC __glewVertexP2ui; -GLEW_FUN_EXPORT PFNGLVERTEXP2UIVPROC __glewVertexP2uiv; -GLEW_FUN_EXPORT PFNGLVERTEXP3UIPROC __glewVertexP3ui; -GLEW_FUN_EXPORT PFNGLVERTEXP3UIVPROC __glewVertexP3uiv; -GLEW_FUN_EXPORT PFNGLVERTEXP4UIPROC __glewVertexP4ui; -GLEW_FUN_EXPORT PFNGLVERTEXP4UIVPROC __glewVertexP4uiv; - -GLEW_FUN_EXPORT PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv; -GLEW_FUN_EXPORT PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed; -GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v; -GLEW_FUN_EXPORT PFNGLGETFLOATI_VPROC __glewGetFloati_v; -GLEW_FUN_EXPORT PFNGLSCISSORARRAYVPROC __glewScissorArrayv; -GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDPROC __glewScissorIndexed; -GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv; -GLEW_FUN_EXPORT PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv; -GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf; -GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv; - -GLEW_FUN_EXPORT PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB; - -GLEW_FUN_EXPORT PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI; - -GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI; -GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI; -GLEW_FUN_EXPORT PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI; - -GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI; -GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI; -GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI; -GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI; - -GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI; -GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI; -GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI; -GLEW_FUN_EXPORT PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI; -GLEW_FUN_EXPORT PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI; -GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI; -GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI; -GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI; -GLEW_FUN_EXPORT PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI; -GLEW_FUN_EXPORT PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI; -GLEW_FUN_EXPORT PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI; -GLEW_FUN_EXPORT PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI; -GLEW_FUN_EXPORT PFNGLSAMPLEMAPATIPROC __glewSampleMapATI; -GLEW_FUN_EXPORT PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI; - -GLEW_FUN_EXPORT PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI; -GLEW_FUN_EXPORT PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI; - -GLEW_FUN_EXPORT PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI; -GLEW_FUN_EXPORT PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI; - -GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI; -GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI; - -GLEW_FUN_EXPORT PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI; -GLEW_FUN_EXPORT PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI; -GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI; -GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI; -GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI; -GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI; -GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI; -GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI; -GLEW_FUN_EXPORT PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI; -GLEW_FUN_EXPORT PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI; -GLEW_FUN_EXPORT PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI; -GLEW_FUN_EXPORT PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI; - -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI; - -GLEW_FUN_EXPORT PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI; -GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI; -GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI; -GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI; -GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI; -GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI; -GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI; -GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI; -GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI; -GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI; -GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI; -GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI; -GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DATIPROC __glewVertexStream1dATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DVATIPROC __glewVertexStream1dvATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FATIPROC __glewVertexStream1fATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FVATIPROC __glewVertexStream1fvATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IATIPROC __glewVertexStream1iATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IVATIPROC __glewVertexStream1ivATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SATIPROC __glewVertexStream1sATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SVATIPROC __glewVertexStream1svATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI; -GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI; - -GLEW_FUN_EXPORT PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT; -GLEW_FUN_EXPORT PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT; -GLEW_FUN_EXPORT PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT; - -GLEW_FUN_EXPORT PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT; - -GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT; - -GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT; - -GLEW_FUN_EXPORT PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT; - -GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT; -GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT; - -GLEW_FUN_EXPORT PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT; -GLEW_FUN_EXPORT PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT; - -GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT; -GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT; -GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT; -GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT; -GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT; -GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT; -GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT; -GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT; -GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT; -GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT; -GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT; -GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT; -GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT; - -GLEW_FUN_EXPORT PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT; -GLEW_FUN_EXPORT PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT; - -GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT; -GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT; -GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT; -GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT; -GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT; - -GLEW_FUN_EXPORT PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT; -GLEW_FUN_EXPORT PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT; - -GLEW_FUN_EXPORT PFNGLGETOBJECTLABELEXTPROC __glewGetObjectLabelEXT; -GLEW_FUN_EXPORT PFNGLLABELOBJECTEXTPROC __glewLabelObjectEXT; - -GLEW_FUN_EXPORT PFNGLINSERTEVENTMARKEREXTPROC __glewInsertEventMarkerEXT; -GLEW_FUN_EXPORT PFNGLPOPGROUPMARKEREXTPROC __glewPopGroupMarkerEXT; -GLEW_FUN_EXPORT PFNGLPUSHGROUPMARKEREXTPROC __glewPushGroupMarkerEXT; - -GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT; - -GLEW_FUN_EXPORT PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT; -GLEW_FUN_EXPORT PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT; -GLEW_FUN_EXPORT PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT; -GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT; -GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT; -GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT; -GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT; -GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT; -GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT; -GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT; -GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT; -GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT; -GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT; -GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT; -GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT; -GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT; -GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT; -GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT; -GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT; -GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT; -GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT; -GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT; -GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT; -GLEW_FUN_EXPORT PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT; -GLEW_FUN_EXPORT PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT; -GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT; -GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT; -GLEW_FUN_EXPORT PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT; -GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT; -GLEW_FUN_EXPORT PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT; -GLEW_FUN_EXPORT PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT; -GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT; -GLEW_FUN_EXPORT PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT; -GLEW_FUN_EXPORT PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT; -GLEW_FUN_EXPORT PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT; -GLEW_FUN_EXPORT PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT; -GLEW_FUN_EXPORT PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT; -GLEW_FUN_EXPORT PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT; -GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT; -GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT; -GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT; -GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT; -GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT; -GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT; -GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT; -GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT; -GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT; -GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT; -GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT; -GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT; -GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT; -GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT; -GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT; -GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT; -GLEW_FUN_EXPORT PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT; -GLEW_FUN_EXPORT PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT; -GLEW_FUN_EXPORT PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT; -GLEW_FUN_EXPORT PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT; -GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT; -GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT; -GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT; -GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT; -GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT; -GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT; -GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT; -GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT; -GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT; -GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT; -GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT; -GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT; -GLEW_FUN_EXPORT PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT; -GLEW_FUN_EXPORT PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT; -GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT; -GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT; -GLEW_FUN_EXPORT PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT; -GLEW_FUN_EXPORT PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT; -GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT; -GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT; -GLEW_FUN_EXPORT PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT; -GLEW_FUN_EXPORT PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT; -GLEW_FUN_EXPORT PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT; -GLEW_FUN_EXPORT PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT; -GLEW_FUN_EXPORT PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT; -GLEW_FUN_EXPORT PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT; -GLEW_FUN_EXPORT PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT; -GLEW_FUN_EXPORT PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT; -GLEW_FUN_EXPORT PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT; -GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT; -GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT; -GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT; -GLEW_FUN_EXPORT PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT; -GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT; -GLEW_FUN_EXPORT PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT; -GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT; -GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT; -GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT; -GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT; -GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT; -GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT; -GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT; -GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT; -GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT; -GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT; -GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT; -GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT; -GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT; -GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT; -GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT; -GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT; -GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT; -GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT; -GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT; -GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT; -GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT; -GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT; -GLEW_FUN_EXPORT PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT; -GLEW_FUN_EXPORT PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT; -GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT; -GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT; -GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT; -GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT; -GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT; -GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT; -GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT; -GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT; -GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT; -GLEW_FUN_EXPORT PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT; -GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT; -GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT; -GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT; -GLEW_FUN_EXPORT PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC __glewVertexArrayVertexAttribDivisorEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT; - -GLEW_FUN_EXPORT PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT; -GLEW_FUN_EXPORT PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT; -GLEW_FUN_EXPORT PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT; -GLEW_FUN_EXPORT PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT; -GLEW_FUN_EXPORT PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT; -GLEW_FUN_EXPORT PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT; - -GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT; -GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT; - -GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT; - -GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT; -GLEW_FUN_EXPORT PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT; -GLEW_FUN_EXPORT PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT; -GLEW_FUN_EXPORT PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT; -GLEW_FUN_EXPORT PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT; - -GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT; -GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT; -GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT; -GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT; -GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT; -GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT; -GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT; -GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT; -GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT; -GLEW_FUN_EXPORT PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT; - -GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT; - -GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT; - -GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT; -GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT; -GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT; -GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT; -GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT; -GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT; -GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT; -GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT; -GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT; -GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT; -GLEW_FUN_EXPORT PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT; -GLEW_FUN_EXPORT PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT; -GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT; - -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT; -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT; - -GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT; -GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT; - -GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT; -GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT; -GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT; -GLEW_FUN_EXPORT PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT; -GLEW_FUN_EXPORT PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT; -GLEW_FUN_EXPORT PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT; -GLEW_FUN_EXPORT PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT; -GLEW_FUN_EXPORT PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT; -GLEW_FUN_EXPORT PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT; -GLEW_FUN_EXPORT PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT; -GLEW_FUN_EXPORT PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT; - -GLEW_FUN_EXPORT PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT; -GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT; -GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT; -GLEW_FUN_EXPORT PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT; -GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT; -GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT; -GLEW_FUN_EXPORT PFNGLHISTOGRAMEXTPROC __glewHistogramEXT; -GLEW_FUN_EXPORT PFNGLMINMAXEXTPROC __glewMinmaxEXT; -GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT; -GLEW_FUN_EXPORT PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT; - -GLEW_FUN_EXPORT PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT; - -GLEW_FUN_EXPORT PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT; - -GLEW_FUN_EXPORT PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT; -GLEW_FUN_EXPORT PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT; -GLEW_FUN_EXPORT PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT; - -GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT; -GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT; - -GLEW_FUN_EXPORT PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT; -GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT; - -GLEW_FUN_EXPORT PFNGLCOLORTABLEEXTPROC __glewColorTableEXT; -GLEW_FUN_EXPORT PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT; -GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT; -GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT; - -GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT; -GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT; -GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT; -GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT; -GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT; -GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT; - -GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT; -GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT; - -GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT; - -GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETCLAMPEXTPROC __glewPolygonOffsetClampEXT; - -GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT; - -GLEW_FUN_EXPORT PFNGLCOVERAGEMODULATIONNVPROC __glewCoverageModulationNV; -GLEW_FUN_EXPORT PFNGLCOVERAGEMODULATIONTABLENVPROC __glewCoverageModulationTableNV; -GLEW_FUN_EXPORT PFNGLGETCOVERAGEMODULATIONTABLENVPROC __glewGetCoverageModulationTableNV; -GLEW_FUN_EXPORT PFNGLRASTERSAMPLESEXTPROC __glewRasterSamplesEXT; - -GLEW_FUN_EXPORT PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT; -GLEW_FUN_EXPORT PFNGLENDSCENEEXTPROC __glewEndSceneEXT; - -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT; - -GLEW_FUN_EXPORT PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT; -GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT; -GLEW_FUN_EXPORT PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT; - -GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT; -GLEW_FUN_EXPORT PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT; - -GLEW_FUN_EXPORT PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT; - -GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT; -GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT; -GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT; - -GLEW_FUN_EXPORT PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT; - -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT; - -GLEW_FUN_EXPORT PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT; - -GLEW_FUN_EXPORT PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT; -GLEW_FUN_EXPORT PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT; -GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT; -GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT; -GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT; -GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT; - -GLEW_FUN_EXPORT PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT; -GLEW_FUN_EXPORT PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT; -GLEW_FUN_EXPORT PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT; -GLEW_FUN_EXPORT PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT; -GLEW_FUN_EXPORT PFNGLISTEXTUREEXTPROC __glewIsTextureEXT; -GLEW_FUN_EXPORT PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT; - -GLEW_FUN_EXPORT PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT; - -GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT; -GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT; - -GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT; -GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT; -GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT; -GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT; -GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT; -GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT; -GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT; - -GLEW_FUN_EXPORT PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT; -GLEW_FUN_EXPORT PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT; -GLEW_FUN_EXPORT PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT; -GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT; -GLEW_FUN_EXPORT PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT; -GLEW_FUN_EXPORT PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT; -GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT; -GLEW_FUN_EXPORT PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT; - -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT; - -GLEW_FUN_EXPORT PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT; -GLEW_FUN_EXPORT PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT; -GLEW_FUN_EXPORT PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT; -GLEW_FUN_EXPORT PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT; -GLEW_FUN_EXPORT PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT; -GLEW_FUN_EXPORT PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT; -GLEW_FUN_EXPORT PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT; -GLEW_FUN_EXPORT PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT; -GLEW_FUN_EXPORT PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT; -GLEW_FUN_EXPORT PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT; -GLEW_FUN_EXPORT PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT; -GLEW_FUN_EXPORT PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT; -GLEW_FUN_EXPORT PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT; -GLEW_FUN_EXPORT PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT; -GLEW_FUN_EXPORT PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT; -GLEW_FUN_EXPORT PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT; -GLEW_FUN_EXPORT PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT; -GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT; -GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT; -GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT; -GLEW_FUN_EXPORT PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT; -GLEW_FUN_EXPORT PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT; -GLEW_FUN_EXPORT PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT; -GLEW_FUN_EXPORT PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT; -GLEW_FUN_EXPORT PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT; -GLEW_FUN_EXPORT PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT; -GLEW_FUN_EXPORT PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT; -GLEW_FUN_EXPORT PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT; -GLEW_FUN_EXPORT PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT; -GLEW_FUN_EXPORT PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT; -GLEW_FUN_EXPORT PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT; -GLEW_FUN_EXPORT PFNGLSWIZZLEEXTPROC __glewSwizzleEXT; -GLEW_FUN_EXPORT PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT; -GLEW_FUN_EXPORT PFNGLVARIANTBVEXTPROC __glewVariantbvEXT; -GLEW_FUN_EXPORT PFNGLVARIANTDVEXTPROC __glewVariantdvEXT; -GLEW_FUN_EXPORT PFNGLVARIANTFVEXTPROC __glewVariantfvEXT; -GLEW_FUN_EXPORT PFNGLVARIANTIVEXTPROC __glewVariantivEXT; -GLEW_FUN_EXPORT PFNGLVARIANTSVEXTPROC __glewVariantsvEXT; -GLEW_FUN_EXPORT PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT; -GLEW_FUN_EXPORT PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT; -GLEW_FUN_EXPORT PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT; -GLEW_FUN_EXPORT PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT; - -GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT; -GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT; -GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT; - -GLEW_FUN_EXPORT PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT; - -GLEW_FUN_EXPORT PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY; - -GLEW_FUN_EXPORT PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY; - -GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP; -GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP; -GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP; -GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP; -GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP; -GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP; - -GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM; -GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM; - -GLEW_FUN_EXPORT PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM; -GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM; -GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM; -GLEW_FUN_EXPORT PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM; -GLEW_FUN_EXPORT PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM; -GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM; -GLEW_FUN_EXPORT PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM; - -GLEW_FUN_EXPORT PFNGLMAPTEXTURE2DINTELPROC __glewMapTexture2DINTEL; -GLEW_FUN_EXPORT PFNGLSYNCTEXTUREINTELPROC __glewSyncTextureINTEL; -GLEW_FUN_EXPORT PFNGLUNMAPTEXTURE2DINTELPROC __glewUnmapTexture2DINTEL; - -GLEW_FUN_EXPORT PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL; -GLEW_FUN_EXPORT PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL; -GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL; -GLEW_FUN_EXPORT PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL; - -GLEW_FUN_EXPORT PFNGLBEGINPERFQUERYINTELPROC __glewBeginPerfQueryINTEL; -GLEW_FUN_EXPORT PFNGLCREATEPERFQUERYINTELPROC __glewCreatePerfQueryINTEL; -GLEW_FUN_EXPORT PFNGLDELETEPERFQUERYINTELPROC __glewDeletePerfQueryINTEL; -GLEW_FUN_EXPORT PFNGLENDPERFQUERYINTELPROC __glewEndPerfQueryINTEL; -GLEW_FUN_EXPORT PFNGLGETFIRSTPERFQUERYIDINTELPROC __glewGetFirstPerfQueryIdINTEL; -GLEW_FUN_EXPORT PFNGLGETNEXTPERFQUERYIDINTELPROC __glewGetNextPerfQueryIdINTEL; -GLEW_FUN_EXPORT PFNGLGETPERFCOUNTERINFOINTELPROC __glewGetPerfCounterInfoINTEL; -GLEW_FUN_EXPORT PFNGLGETPERFQUERYDATAINTELPROC __glewGetPerfQueryDataINTEL; -GLEW_FUN_EXPORT PFNGLGETPERFQUERYIDBYNAMEINTELPROC __glewGetPerfQueryIdByNameINTEL; -GLEW_FUN_EXPORT PFNGLGETPERFQUERYINFOINTELPROC __glewGetPerfQueryInfoINTEL; - -GLEW_FUN_EXPORT PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL; -GLEW_FUN_EXPORT PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL; - -GLEW_FUN_EXPORT PFNGLBLENDBARRIERKHRPROC __glewBlendBarrierKHR; - -GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKPROC __glewDebugMessageCallback; -GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLPROC __glewDebugMessageControl; -GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert; -GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog; -GLEW_FUN_EXPORT PFNGLGETOBJECTLABELPROC __glewGetObjectLabel; -GLEW_FUN_EXPORT PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel; -GLEW_FUN_EXPORT PFNGLOBJECTLABELPROC __glewObjectLabel; -GLEW_FUN_EXPORT PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel; -GLEW_FUN_EXPORT PFNGLPOPDEBUGGROUPPROC __glewPopDebugGroup; -GLEW_FUN_EXPORT PFNGLPUSHDEBUGGROUPPROC __glewPushDebugGroup; - -GLEW_FUN_EXPORT PFNGLGETNUNIFORMFVPROC __glewGetnUniformfv; -GLEW_FUN_EXPORT PFNGLGETNUNIFORMIVPROC __glewGetnUniformiv; -GLEW_FUN_EXPORT PFNGLGETNUNIFORMUIVPROC __glewGetnUniformuiv; -GLEW_FUN_EXPORT PFNGLREADNPIXELSPROC __glewReadnPixels; - -GLEW_FUN_EXPORT PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled; -GLEW_FUN_EXPORT PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion; -GLEW_FUN_EXPORT PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion; -GLEW_FUN_EXPORT PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion; -GLEW_FUN_EXPORT PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion; - -GLEW_FUN_EXPORT PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA; - -GLEW_FUN_EXPORT PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA; -GLEW_FUN_EXPORT PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA; - -GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVXPROC __glewBeginConditionalRenderNVX; -GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVXPROC __glewEndConditionalRenderNVX; - -GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC __glewMultiDrawArraysIndirectBindlessNV; -GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC __glewMultiDrawElementsIndirectBindlessNV; - -GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC __glewMultiDrawArraysIndirectBindlessCountNV; -GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC __glewMultiDrawElementsIndirectBindlessCountNV; - -GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLENVPROC __glewGetImageHandleNV; -GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLENVPROC __glewGetTextureHandleNV; -GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLENVPROC __glewGetTextureSamplerHandleNV; -GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTNVPROC __glewIsImageHandleResidentNV; -GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTNVPROC __glewIsTextureHandleResidentNV; -GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC __glewMakeImageHandleNonResidentNV; -GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTNVPROC __glewMakeImageHandleResidentNV; -GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC __glewMakeTextureHandleNonResidentNV; -GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTNVPROC __glewMakeTextureHandleResidentNV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC __glewProgramUniformHandleui64NV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC __glewProgramUniformHandleui64vNV; -GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64NVPROC __glewUniformHandleui64NV; -GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VNVPROC __glewUniformHandleui64vNV; - -GLEW_FUN_EXPORT PFNGLBLENDBARRIERNVPROC __glewBlendBarrierNV; -GLEW_FUN_EXPORT PFNGLBLENDPARAMETERINVPROC __glewBlendParameteriNV; - -GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV; -GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV; - -GLEW_FUN_EXPORT PFNGLSUBPIXELPRECISIONBIASNVPROC __glewSubpixelPrecisionBiasNV; - -GLEW_FUN_EXPORT PFNGLCONSERVATIVERASTERPARAMETERFNVPROC __glewConservativeRasterParameterfNV; - -GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV; - -GLEW_FUN_EXPORT PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV; -GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV; -GLEW_FUN_EXPORT PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV; - -GLEW_FUN_EXPORT PFNGLDRAWTEXTURENVPROC __glewDrawTextureNV; - -GLEW_FUN_EXPORT PFNGLEVALMAPSNVPROC __glewEvalMapsNV; -GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV; -GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV; -GLEW_FUN_EXPORT PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV; -GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV; -GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV; -GLEW_FUN_EXPORT PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV; -GLEW_FUN_EXPORT PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV; -GLEW_FUN_EXPORT PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV; - -GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV; -GLEW_FUN_EXPORT PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV; -GLEW_FUN_EXPORT PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV; - -GLEW_FUN_EXPORT PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV; -GLEW_FUN_EXPORT PFNGLFINISHFENCENVPROC __glewFinishFenceNV; -GLEW_FUN_EXPORT PFNGLGENFENCESNVPROC __glewGenFencesNV; -GLEW_FUN_EXPORT PFNGLGETFENCEIVNVPROC __glewGetFenceivNV; -GLEW_FUN_EXPORT PFNGLISFENCENVPROC __glewIsFenceNV; -GLEW_FUN_EXPORT PFNGLSETFENCENVPROC __glewSetFenceNV; -GLEW_FUN_EXPORT PFNGLTESTFENCENVPROC __glewTestFenceNV; - -GLEW_FUN_EXPORT PFNGLFRAGMENTCOVERAGECOLORNVPROC __glewFragmentCoverageColorNV; - -GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV; -GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV; -GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV; -GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV; -GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV; -GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV; - -GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV; - -GLEW_FUN_EXPORT PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV; - -GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV; -GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV; -GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV; -GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV; -GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV; -GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV; -GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV; -GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV; -GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV; -GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV; -GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV; -GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV; - -GLEW_FUN_EXPORT PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV; -GLEW_FUN_EXPORT PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV; -GLEW_FUN_EXPORT PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV; -GLEW_FUN_EXPORT PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV; -GLEW_FUN_EXPORT PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV; -GLEW_FUN_EXPORT PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV; -GLEW_FUN_EXPORT PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV; -GLEW_FUN_EXPORT PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV; -GLEW_FUN_EXPORT PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV; -GLEW_FUN_EXPORT PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV; -GLEW_FUN_EXPORT PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV; -GLEW_FUN_EXPORT PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV; -GLEW_FUN_EXPORT PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV; -GLEW_FUN_EXPORT PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV; -GLEW_FUN_EXPORT PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV; -GLEW_FUN_EXPORT PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV; -GLEW_FUN_EXPORT PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV; -GLEW_FUN_EXPORT PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV; - -GLEW_FUN_EXPORT PFNGLCOLOR3HNVPROC __glewColor3hNV; -GLEW_FUN_EXPORT PFNGLCOLOR3HVNVPROC __glewColor3hvNV; -GLEW_FUN_EXPORT PFNGLCOLOR4HNVPROC __glewColor4hNV; -GLEW_FUN_EXPORT PFNGLCOLOR4HVNVPROC __glewColor4hvNV; -GLEW_FUN_EXPORT PFNGLFOGCOORDHNVPROC __glewFogCoordhNV; -GLEW_FUN_EXPORT PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV; -GLEW_FUN_EXPORT PFNGLNORMAL3HNVPROC __glewNormal3hNV; -GLEW_FUN_EXPORT PFNGLNORMAL3HVNVPROC __glewNormal3hvNV; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV; -GLEW_FUN_EXPORT PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV; -GLEW_FUN_EXPORT PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV; -GLEW_FUN_EXPORT PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV; -GLEW_FUN_EXPORT PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV; -GLEW_FUN_EXPORT PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV; -GLEW_FUN_EXPORT PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV; -GLEW_FUN_EXPORT PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV; -GLEW_FUN_EXPORT PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV; -GLEW_FUN_EXPORT PFNGLVERTEX2HNVPROC __glewVertex2hNV; -GLEW_FUN_EXPORT PFNGLVERTEX2HVNVPROC __glewVertex2hvNV; -GLEW_FUN_EXPORT PFNGLVERTEX3HNVPROC __glewVertex3hNV; -GLEW_FUN_EXPORT PFNGLVERTEX3HVNVPROC __glewVertex3hvNV; -GLEW_FUN_EXPORT PFNGLVERTEX4HNVPROC __glewVertex4hNV; -GLEW_FUN_EXPORT PFNGLVERTEX4HVNVPROC __glewVertex4hvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV; -GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV; -GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV; - -GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATSAMPLEIVNVPROC __glewGetInternalformatSampleivNV; - -GLEW_FUN_EXPORT PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV; -GLEW_FUN_EXPORT PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV; -GLEW_FUN_EXPORT PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV; -GLEW_FUN_EXPORT PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV; -GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV; -GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV; -GLEW_FUN_EXPORT PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV; - -GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV; -GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV; -GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV; - -GLEW_FUN_EXPORT PFNGLCOPYPATHNVPROC __glewCopyPathNV; -GLEW_FUN_EXPORT PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV; -GLEW_FUN_EXPORT PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV; -GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV; -GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV; -GLEW_FUN_EXPORT PFNGLDELETEPATHSNVPROC __glewDeletePathsNV; -GLEW_FUN_EXPORT PFNGLGENPATHSNVPROC __glewGenPathsNV; -GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV; -GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV; -GLEW_FUN_EXPORT PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV; -GLEW_FUN_EXPORT PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV; -GLEW_FUN_EXPORT PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV; -GLEW_FUN_EXPORT PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV; -GLEW_FUN_EXPORT PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV; -GLEW_FUN_EXPORT PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV; -GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV; -GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV; -GLEW_FUN_EXPORT PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV; -GLEW_FUN_EXPORT PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV; -GLEW_FUN_EXPORT PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV; -GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEFVNVPROC __glewGetProgramResourcefvNV; -GLEW_FUN_EXPORT PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV; -GLEW_FUN_EXPORT PFNGLISPATHNVPROC __glewIsPathNV; -GLEW_FUN_EXPORT PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV; -GLEW_FUN_EXPORT PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV; -GLEW_FUN_EXPORT PFNGLMATRIXLOAD3X2FNVPROC __glewMatrixLoad3x2fNV; -GLEW_FUN_EXPORT PFNGLMATRIXLOAD3X3FNVPROC __glewMatrixLoad3x3fNV; -GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC __glewMatrixLoadTranspose3x3fNV; -GLEW_FUN_EXPORT PFNGLMATRIXMULT3X2FNVPROC __glewMatrixMult3x2fNV; -GLEW_FUN_EXPORT PFNGLMATRIXMULT3X3FNVPROC __glewMatrixMult3x3fNV; -GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC __glewMatrixMultTranspose3x3fNV; -GLEW_FUN_EXPORT PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV; -GLEW_FUN_EXPORT PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV; -GLEW_FUN_EXPORT PFNGLPATHCOORDSNVPROC __glewPathCoordsNV; -GLEW_FUN_EXPORT PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV; -GLEW_FUN_EXPORT PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV; -GLEW_FUN_EXPORT PFNGLPATHFOGGENNVPROC __glewPathFogGenNV; -GLEW_FUN_EXPORT PFNGLPATHGLYPHINDEXARRAYNVPROC __glewPathGlyphIndexArrayNV; -GLEW_FUN_EXPORT PFNGLPATHGLYPHINDEXRANGENVPROC __glewPathGlyphIndexRangeNV; -GLEW_FUN_EXPORT PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV; -GLEW_FUN_EXPORT PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV; -GLEW_FUN_EXPORT PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC __glewPathMemoryGlyphIndexArrayNV; -GLEW_FUN_EXPORT PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV; -GLEW_FUN_EXPORT PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV; -GLEW_FUN_EXPORT PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV; -GLEW_FUN_EXPORT PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV; -GLEW_FUN_EXPORT PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV; -GLEW_FUN_EXPORT PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV; -GLEW_FUN_EXPORT PFNGLPATHSTRINGNVPROC __glewPathStringNV; -GLEW_FUN_EXPORT PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV; -GLEW_FUN_EXPORT PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV; -GLEW_FUN_EXPORT PFNGLPATHTEXGENNVPROC __glewPathTexGenNV; -GLEW_FUN_EXPORT PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV; -GLEW_FUN_EXPORT PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC __glewProgramPathFragmentInputGenNV; -GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV; -GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV; -GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV; -GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV; -GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC __glewStencilThenCoverFillPathInstancedNV; -GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERFILLPATHNVPROC __glewStencilThenCoverFillPathNV; -GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC __glewStencilThenCoverStrokePathInstancedNV; -GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC __glewStencilThenCoverStrokePathNV; -GLEW_FUN_EXPORT PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV; -GLEW_FUN_EXPORT PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV; - -GLEW_FUN_EXPORT PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV; -GLEW_FUN_EXPORT PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV; - -GLEW_FUN_EXPORT PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV; -GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV; - -GLEW_FUN_EXPORT PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV; -GLEW_FUN_EXPORT PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV; -GLEW_FUN_EXPORT PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV; -GLEW_FUN_EXPORT PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV; -GLEW_FUN_EXPORT PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV; -GLEW_FUN_EXPORT PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV; - -GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV; -GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV; - -GLEW_FUN_EXPORT PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV; -GLEW_FUN_EXPORT PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV; -GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV; -GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV; -GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV; -GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV; -GLEW_FUN_EXPORT PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV; -GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV; -GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV; -GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV; -GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV; -GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV; -GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV; - -GLEW_FUN_EXPORT PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV; -GLEW_FUN_EXPORT PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV; - -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewFramebufferSampleLocationsfvNV; -GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewNamedFramebufferSampleLocationsfvNV; - -GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV; -GLEW_FUN_EXPORT PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV; -GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV; -GLEW_FUN_EXPORT PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV; -GLEW_FUN_EXPORT PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV; -GLEW_FUN_EXPORT PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV; -GLEW_FUN_EXPORT PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV; -GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV; -GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV; -GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV; -GLEW_FUN_EXPORT PFNGLUNIFORMUI64NVPROC __glewUniformui64NV; -GLEW_FUN_EXPORT PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV; - -GLEW_FUN_EXPORT PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV; - -GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV; -GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV; -GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV; -GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV; -GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV; -GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV; - -GLEW_FUN_EXPORT PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV; -GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV; -GLEW_FUN_EXPORT PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV; -GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV; -GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV; -GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV; -GLEW_FUN_EXPORT PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV; -GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV; -GLEW_FUN_EXPORT PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV; -GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV; -GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV; - -GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV; -GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV; -GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV; -GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV; -GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV; -GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV; -GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV; - -GLEW_FUN_EXPORT PFNGLVDPAUFININVPROC __glewVDPAUFiniNV; -GLEW_FUN_EXPORT PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV; -GLEW_FUN_EXPORT PFNGLVDPAUINITNVPROC __glewVDPAUInitNV; -GLEW_FUN_EXPORT PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV; -GLEW_FUN_EXPORT PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV; -GLEW_FUN_EXPORT PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV; -GLEW_FUN_EXPORT PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV; -GLEW_FUN_EXPORT PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV; -GLEW_FUN_EXPORT PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV; -GLEW_FUN_EXPORT PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV; - -GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV; -GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV; - -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV; - -GLEW_FUN_EXPORT PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV; -GLEW_FUN_EXPORT PFNGLCOLORFORMATNVPROC __glewColorFormatNV; -GLEW_FUN_EXPORT PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV; -GLEW_FUN_EXPORT PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV; -GLEW_FUN_EXPORT PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV; -GLEW_FUN_EXPORT PFNGLINDEXFORMATNVPROC __glewIndexFormatNV; -GLEW_FUN_EXPORT PFNGLNORMALFORMATNVPROC __glewNormalFormatNV; -GLEW_FUN_EXPORT PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV; -GLEW_FUN_EXPORT PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV; -GLEW_FUN_EXPORT PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV; - -GLEW_FUN_EXPORT PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV; -GLEW_FUN_EXPORT PFNGLBINDPROGRAMNVPROC __glewBindProgramNV; -GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV; -GLEW_FUN_EXPORT PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV; -GLEW_FUN_EXPORT PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV; -GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV; -GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV; -GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV; -GLEW_FUN_EXPORT PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV; -GLEW_FUN_EXPORT PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV; -GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV; -GLEW_FUN_EXPORT PFNGLISPROGRAMNVPROC __glewIsProgramNV; -GLEW_FUN_EXPORT PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV; -GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV; -GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV; -GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV; -GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV; -GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV; -GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV; -GLEW_FUN_EXPORT PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV; -GLEW_FUN_EXPORT PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV; -GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV; - -GLEW_FUN_EXPORT PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV; -GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV; -GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV; -GLEW_FUN_EXPORT PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV; -GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV; -GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV; -GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV; -GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV; -GLEW_FUN_EXPORT PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV; -GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV; -GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV; -GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV; - -GLEW_FUN_EXPORT PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES; -GLEW_FUN_EXPORT PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES; -GLEW_FUN_EXPORT PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES; -GLEW_FUN_EXPORT PFNGLFRUSTUMFOESPROC __glewFrustumfOES; -GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES; -GLEW_FUN_EXPORT PFNGLORTHOFOESPROC __glewOrthofOES; - -GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC __glewFramebufferTextureMultiviewOVR; - -GLEW_FUN_EXPORT PFNGLALPHAFUNCXPROC __glewAlphaFuncx; -GLEW_FUN_EXPORT PFNGLCLEARCOLORXPROC __glewClearColorx; -GLEW_FUN_EXPORT PFNGLCLEARDEPTHXPROC __glewClearDepthx; -GLEW_FUN_EXPORT PFNGLCOLOR4XPROC __glewColor4x; -GLEW_FUN_EXPORT PFNGLDEPTHRANGEXPROC __glewDepthRangex; -GLEW_FUN_EXPORT PFNGLFOGXPROC __glewFogx; -GLEW_FUN_EXPORT PFNGLFOGXVPROC __glewFogxv; -GLEW_FUN_EXPORT PFNGLFRUSTUMFPROC __glewFrustumf; -GLEW_FUN_EXPORT PFNGLFRUSTUMXPROC __glewFrustumx; -GLEW_FUN_EXPORT PFNGLLIGHTMODELXPROC __glewLightModelx; -GLEW_FUN_EXPORT PFNGLLIGHTMODELXVPROC __glewLightModelxv; -GLEW_FUN_EXPORT PFNGLLIGHTXPROC __glewLightx; -GLEW_FUN_EXPORT PFNGLLIGHTXVPROC __glewLightxv; -GLEW_FUN_EXPORT PFNGLLINEWIDTHXPROC __glewLineWidthx; -GLEW_FUN_EXPORT PFNGLLOADMATRIXXPROC __glewLoadMatrixx; -GLEW_FUN_EXPORT PFNGLMATERIALXPROC __glewMaterialx; -GLEW_FUN_EXPORT PFNGLMATERIALXVPROC __glewMaterialxv; -GLEW_FUN_EXPORT PFNGLMULTMATRIXXPROC __glewMultMatrixx; -GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4XPROC __glewMultiTexCoord4x; -GLEW_FUN_EXPORT PFNGLNORMAL3XPROC __glewNormal3x; -GLEW_FUN_EXPORT PFNGLORTHOFPROC __glewOrthof; -GLEW_FUN_EXPORT PFNGLORTHOXPROC __glewOrthox; -GLEW_FUN_EXPORT PFNGLPOINTSIZEXPROC __glewPointSizex; -GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETXPROC __glewPolygonOffsetx; -GLEW_FUN_EXPORT PFNGLROTATEXPROC __glewRotatex; -GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEXPROC __glewSampleCoveragex; -GLEW_FUN_EXPORT PFNGLSCALEXPROC __glewScalex; -GLEW_FUN_EXPORT PFNGLTEXENVXPROC __glewTexEnvx; -GLEW_FUN_EXPORT PFNGLTEXENVXVPROC __glewTexEnvxv; -GLEW_FUN_EXPORT PFNGLTEXPARAMETERXPROC __glewTexParameterx; -GLEW_FUN_EXPORT PFNGLTRANSLATEXPROC __glewTranslatex; - -GLEW_FUN_EXPORT PFNGLCLIPPLANEFPROC __glewClipPlanef; -GLEW_FUN_EXPORT PFNGLCLIPPLANEXPROC __glewClipPlanex; -GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFPROC __glewGetClipPlanef; -GLEW_FUN_EXPORT PFNGLGETCLIPPLANEXPROC __glewGetClipPlanex; -GLEW_FUN_EXPORT PFNGLGETFIXEDVPROC __glewGetFixedv; -GLEW_FUN_EXPORT PFNGLGETLIGHTXVPROC __glewGetLightxv; -GLEW_FUN_EXPORT PFNGLGETMATERIALXVPROC __glewGetMaterialxv; -GLEW_FUN_EXPORT PFNGLGETTEXENVXVPROC __glewGetTexEnvxv; -GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERXVPROC __glewGetTexParameterxv; -GLEW_FUN_EXPORT PFNGLPOINTPARAMETERXPROC __glewPointParameterx; -GLEW_FUN_EXPORT PFNGLPOINTPARAMETERXVPROC __glewPointParameterxv; -GLEW_FUN_EXPORT PFNGLPOINTSIZEPOINTEROESPROC __glewPointSizePointerOES; -GLEW_FUN_EXPORT PFNGLTEXPARAMETERXVPROC __glewTexParameterxv; - -GLEW_FUN_EXPORT PFNGLERRORSTRINGREGALPROC __glewErrorStringREGAL; - -GLEW_FUN_EXPORT PFNGLGETEXTENSIONREGALPROC __glewGetExtensionREGAL; -GLEW_FUN_EXPORT PFNGLISSUPPORTEDREGALPROC __glewIsSupportedREGAL; - -GLEW_FUN_EXPORT PFNGLLOGMESSAGECALLBACKREGALPROC __glewLogMessageCallbackREGAL; - -GLEW_FUN_EXPORT PFNGLGETPROCADDRESSREGALPROC __glewGetProcAddressREGAL; - -GLEW_FUN_EXPORT PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS; -GLEW_FUN_EXPORT PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS; - -GLEW_FUN_EXPORT PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS; -GLEW_FUN_EXPORT PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS; - -GLEW_FUN_EXPORT PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS; -GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS; - -GLEW_FUN_EXPORT PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS; -GLEW_FUN_EXPORT PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS; - -GLEW_FUN_EXPORT PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS; -GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS; - -GLEW_FUN_EXPORT PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS; -GLEW_FUN_EXPORT PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS; - -GLEW_FUN_EXPORT PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX; -GLEW_FUN_EXPORT PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX; -GLEW_FUN_EXPORT PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX; -GLEW_FUN_EXPORT PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX; -GLEW_FUN_EXPORT PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX; -GLEW_FUN_EXPORT PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX; - -GLEW_FUN_EXPORT PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX; - -GLEW_FUN_EXPORT PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX; - -GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX; -GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX; -GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX; -GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX; -GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX; -GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX; -GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX; -GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX; -GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX; -GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX; - -GLEW_FUN_EXPORT PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX; - -GLEW_FUN_EXPORT PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX; - -GLEW_FUN_EXPORT PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX; - -GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX; -GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX; -GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX; -GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX; - -GLEW_FUN_EXPORT PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX; - -GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI; -GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI; -GLEW_FUN_EXPORT PFNGLCOLORTABLESGIPROC __glewColorTableSGI; -GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI; -GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI; -GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI; -GLEW_FUN_EXPORT PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI; - -GLEW_FUN_EXPORT PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX; - -GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN; -GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN; -GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN; -GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN; -GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN; -GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN; -GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN; -GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN; - -GLEW_FUN_EXPORT PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN; - -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN; - -GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN; -GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN; -GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN; -GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN; -GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN; -GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN; - -GLEW_FUN_EXPORT PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN; - -#if defined(GLEW_MX) && !defined(_WIN32) -struct GLEWContextStruct -{ -#endif /* GLEW_MX */ - -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_1; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2_1; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_3; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_4; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_5; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_0; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_1; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_0; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_1; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_2; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_3; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_0; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_1; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_2; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_3; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_4; -GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_5; -GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_multisample; -GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_tbuffer; -GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_texture_compression_FXT1; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_blend_minmax_factor; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_conservative_depth; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_debug_output; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_depth_clamp_separate; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_draw_buffers_blend; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_gcn_shader; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_gpu_shader_int64; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_interleaved_elements; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_multi_draw_indirect; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_name_gen_delete; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_occlusion_query_event; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_performance_monitor; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_pinned_memory; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_query_buffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sample_positions; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_seamless_cubemap_per_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_atomic_counter_ops; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_export; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_value_export; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_trinary_minmax; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sparse_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_stencil_operation_extended; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_texture_texture4; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_transform_feedback3_lines_triangles; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_transform_feedback4; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_layer; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_tessellator; -GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_viewport_index; -GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_depth_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_framebuffer_blit; -GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_framebuffer_multisample; -GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_instanced_arrays; -GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_pack_reverse_row_order; -GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_program_binary; -GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt1; -GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt3; -GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt5; -GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_usage; -GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_timer_query; -GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_translated_shader_source; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_aux_depth_stencil; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_client_storage; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_element_array; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_fence; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_float_pixels; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_flush_buffer_range; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_object_purgeable; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_pixel_buffer; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_rgb_422; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_row_bytes; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_specular_vector; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_range; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_transform_hint; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_object; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_range; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_program_evaluators; -GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_ycbcr_422; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES2_compatibility; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_1_compatibility; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_2_compatibility; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_compatibility; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_arrays_of_arrays; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_base_instance; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_bindless_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_blend_func_extended; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_buffer_storage; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_cl_event; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_buffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clip_control; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_color_buffer_float; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compatibility; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compressed_texture_pixel_storage; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_shader; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_variable_group_size; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_conditional_render_inverted; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_conservative_depth; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_buffer; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_image; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_cull_distance; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_debug_output; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_buffer_float; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_clamp; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_derivative_control; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_direct_state_access; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers_blend; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_elements_base_vertex; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_indirect; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_instanced; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_enhanced_layouts; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_attrib_location; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_uniform_location; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_coord_conventions; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_layer_viewport; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program_shadow; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader_interlock; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_no_attachments; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_sRGB; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_geometry_shader4; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_get_program_binary; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_get_texture_sub_image; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader5; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader_fp64; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader_int64; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_pixel; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_vertex; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_imaging; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_indirect_parameters; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_instanced_arrays; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query2; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_invalidate_subdata; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_alignment; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_range; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_matrix_palette; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_bind; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_draw_indirect; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multisample; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multitexture; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query2; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_parallel_shader_compile; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pipeline_statistics_query; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pixel_buffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_parameters; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_sprite; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_post_depth_coverage; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_program_interface_query; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_provoking_vertex; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_query_buffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robust_buffer_access_behavior; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_application_isolation; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_share_group_isolation; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_locations; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_shading; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sampler_objects; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cube_map; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cubemap_per_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_separate_shader_objects; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counter_ops; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counters; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_ballot; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_bit_encoding; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_clock; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_draw_parameters; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_group_vote; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_load_store; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_size; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_objects; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_precision; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_stencil_export; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_storage_buffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_subroutine; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_image_samples; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_lod; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_viewport_layer_array; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_100; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_420pack; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_include; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_packing; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow_ambient; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_buffer; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture2; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture_clamp; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_stencil_texturing; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sync; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_tessellation_shader; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_barrier; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_border_clamp; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object_rgb32; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_range; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_bptc; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_rgtc; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map_array; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_add; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_combine; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_crossbar; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_dot3; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_filter_minmax; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_float; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_gather; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirror_clamp_to_edge; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirrored_repeat; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_multisample; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_non_power_of_two; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_levels; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_lod; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rectangle; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rg; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rgb10_a2ui; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_stencil8; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage_multisample; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_swizzle; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_view; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_timer_query; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback2; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback3; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback_instanced; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback_overflow_query; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transpose_matrix; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_uniform_buffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_bgra; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_object; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_64bit; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_binding; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_blend; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_buffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_program; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_shader; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_10f_11f_11f_rev; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_viewport_array; -GLEW_VAR_EXPORT GLboolean __GLEW_ARB_window_pos; -GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_point_sprites; -GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_combine3; -GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_route; -GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_vertex_shader_output_point_size; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_draw_buffers; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_element_array; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_envmap_bumpmap; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_fragment_shader; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_map_object_buffer; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_meminfo; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_pn_triangles; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_separate_stencil; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_shader_texture_lod; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_text_fragment_shader; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_compression_3dc; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_env_combine3; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_float; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_mirror_once; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_array_object; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_attrib_array_object; -GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_streams; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_422_pixels; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_Cg_shader; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_abgr; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bgra; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bindable_uniform; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_color; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_equation_separate; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_func_separate; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_logic_op; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_minmax; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_subtract; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clip_volume_hint; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cmyka; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_subtable; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_compiled_vertex_array; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_convolution; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_coordinate_frame; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_copy_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cull_vertex; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_debug_label; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_debug_marker; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_depth_bounds_test; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_direct_state_access; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers2; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_instanced; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_range_elements; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fog_coord; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fragment_lighting; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_blit; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_sRGB; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_shader4; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_program_parameters; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_shader4; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_histogram; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_array_formats; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_func; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_material; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_light_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_misc_attribute; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multi_draw_arrays; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisample; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_depth_stencil; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_float; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_pixels; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_paletted_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_buffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform_color_table; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_point_parameters; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_polygon_offset; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_polygon_offset_clamp; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_post_depth_coverage; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_provoking_vertex; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_raster_multisample; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_rescale_normal; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_scene_marker; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_secondary_color; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_shader_objects; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_specular_color; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_image_load_formatted; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_image_load_store; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_integer_mix; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shadow_funcs; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shared_texture_palette; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_sparse_texture2; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_clear_tag; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_two_side; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_wrap; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_subtexture; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture3D; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_array; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_buffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_dxt1; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_latc; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_rgtc; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_s3tc; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_cube_map; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_edge_clamp; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_add; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_combine; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_dot3; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_anisotropic; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_minmax; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_integer; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_lod_bias; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_mirror_clamp; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_object; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_perturb_normal; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_rectangle; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB_decode; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_shared_exponent; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_snorm; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_swizzle; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_timer_query; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_transform_feedback; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array_bgra; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_attrib_64bit; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_shader; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_weighting; -GLEW_VAR_EXPORT GLboolean __GLEW_EXT_x11_sync_object; -GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_frame_terminator; -GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_string_marker; -GLEW_VAR_EXPORT GLboolean __GLEW_HP_convolution_border_modes; -GLEW_VAR_EXPORT GLboolean __GLEW_HP_image_transform; -GLEW_VAR_EXPORT GLboolean __GLEW_HP_occlusion_test; -GLEW_VAR_EXPORT GLboolean __GLEW_HP_texture_lighting; -GLEW_VAR_EXPORT GLboolean __GLEW_IBM_cull_vertex; -GLEW_VAR_EXPORT GLboolean __GLEW_IBM_multimode_draw_arrays; -GLEW_VAR_EXPORT GLboolean __GLEW_IBM_rasterpos_clip; -GLEW_VAR_EXPORT GLboolean __GLEW_IBM_static_data; -GLEW_VAR_EXPORT GLboolean __GLEW_IBM_texture_mirrored_repeat; -GLEW_VAR_EXPORT GLboolean __GLEW_IBM_vertex_array_lists; -GLEW_VAR_EXPORT GLboolean __GLEW_INGR_color_clamp; -GLEW_VAR_EXPORT GLboolean __GLEW_INGR_interlace_read; -GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_fragment_shader_ordering; -GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_framebuffer_CMAA; -GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_map_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_parallel_arrays; -GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_performance_query; -GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_texture_scissor; -GLEW_VAR_EXPORT GLboolean __GLEW_KHR_blend_equation_advanced; -GLEW_VAR_EXPORT GLboolean __GLEW_KHR_blend_equation_advanced_coherent; -GLEW_VAR_EXPORT GLboolean __GLEW_KHR_context_flush_control; -GLEW_VAR_EXPORT GLboolean __GLEW_KHR_debug; -GLEW_VAR_EXPORT GLboolean __GLEW_KHR_no_error; -GLEW_VAR_EXPORT GLboolean __GLEW_KHR_robust_buffer_access_behavior; -GLEW_VAR_EXPORT GLboolean __GLEW_KHR_robustness; -GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_hdr; -GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_ldr; -GLEW_VAR_EXPORT GLboolean __GLEW_KTX_buffer_region; -GLEW_VAR_EXPORT GLboolean __GLEW_MESAX_texture_stack; -GLEW_VAR_EXPORT GLboolean __GLEW_MESA_pack_invert; -GLEW_VAR_EXPORT GLboolean __GLEW_MESA_resize_buffers; -GLEW_VAR_EXPORT GLboolean __GLEW_MESA_window_pos; -GLEW_VAR_EXPORT GLboolean __GLEW_MESA_ycbcr_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_NVX_conditional_render; -GLEW_VAR_EXPORT GLboolean __GLEW_NVX_gpu_memory_info; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_multi_draw_indirect; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_multi_draw_indirect_count; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_equation_advanced; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_equation_advanced_coherent; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_square; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_compute_program5; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_conditional_render; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_conservative_raster; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_conservative_raster_dilate; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_depth_to_color; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_image; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_deep_texture3D; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_buffer_float; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_clamp; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_range_unclamped; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_draw_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_evaluators; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_explicit_multisample; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_fence; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_fill_rectangle; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_float_buffer; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_fog_distance; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_coverage_to_color; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program2; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program4; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program_option; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_shader_interlock; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_mixed_samples; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_multisample_coverage; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_program4; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader4; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader_passthrough; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program4; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5_mem_extended; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program_fp64; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_shader5; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_half_float; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_internalformat_sample_query; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_light_max_exponent; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_coverage; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_filter_hint; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_occlusion_query; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_depth_stencil; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object2; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_path_rendering; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_path_rendering_shared_edge; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_pixel_data_range; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_point_sprite; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_present_video; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_primitive_restart; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners2; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_sample_locations; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_sample_mask_override_coverage; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_counters; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_float; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_fp16_vector; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_int64; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_buffer_load; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_storage_buffer_object; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_thread_group; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_thread_shuffle; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_tessellation_program5; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_emboss; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_reflection; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_barrier; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_vtc; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_env_combine4; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_expand_normal; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_multisample; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_rectangle; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader2; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader3; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback2; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_uniform_buffer_unified_memory; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_vdpau_interop; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range2; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_attrib_integer_64bit; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_buffer_unified_memory; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program1_1; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2_option; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program3; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program4; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_video_capture; -GLEW_VAR_EXPORT GLboolean __GLEW_NV_viewport_array2; -GLEW_VAR_EXPORT GLboolean __GLEW_OES_byte_coordinates; -GLEW_VAR_EXPORT GLboolean __GLEW_OES_compressed_paletted_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_OES_read_format; -GLEW_VAR_EXPORT GLboolean __GLEW_OES_single_precision; -GLEW_VAR_EXPORT GLboolean __GLEW_OML_interlace; -GLEW_VAR_EXPORT GLboolean __GLEW_OML_resample; -GLEW_VAR_EXPORT GLboolean __GLEW_OML_subsample; -GLEW_VAR_EXPORT GLboolean __GLEW_OVR_multiview; -GLEW_VAR_EXPORT GLboolean __GLEW_OVR_multiview2; -GLEW_VAR_EXPORT GLboolean __GLEW_PGI_misc_hints; -GLEW_VAR_EXPORT GLboolean __GLEW_PGI_vertex_hints; -GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_ES1_0_compatibility; -GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_ES1_1_compatibility; -GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_enable; -GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_error_string; -GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_extension_query; -GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_log; -GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_proc_address; -GLEW_VAR_EXPORT GLboolean __GLEW_REND_screen_coordinates; -GLEW_VAR_EXPORT GLboolean __GLEW_S3_s3tc; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_color_range; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_detail_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_fog_function; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_generate_mipmap; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_multisample; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_pixel_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_point_line_texgen; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_sharpen_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture4D; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_border_clamp; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_edge_clamp; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_filter4; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_lod; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_select; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_histogram; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_pixel; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_alpha_minmax; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_clipmap; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_convolution_accuracy; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_depth_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_flush_raster; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_offset; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragment_specular_lighting; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_framezoom; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_interlace; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ir_instrument1; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_list_priority; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture_bits; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_reference_plane; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_resample; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow_ambient; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_sprite; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_tag_sample_buffer; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_add_env; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_coordinate_clamp; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_lod_bias; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_multi_buffer; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_range; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_scale_bias; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip_hint; -GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ycrcb; -GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_matrix; -GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_table; -GLEW_VAR_EXPORT GLboolean __GLEW_SGI_texture_color_table; -GLEW_VAR_EXPORT GLboolean __GLEW_SUNX_constant_data; -GLEW_VAR_EXPORT GLboolean __GLEW_SUN_convolution_border_modes; -GLEW_VAR_EXPORT GLboolean __GLEW_SUN_global_alpha; -GLEW_VAR_EXPORT GLboolean __GLEW_SUN_mesh_array; -GLEW_VAR_EXPORT GLboolean __GLEW_SUN_read_video_pixels; -GLEW_VAR_EXPORT GLboolean __GLEW_SUN_slice_accum; -GLEW_VAR_EXPORT GLboolean __GLEW_SUN_triangle_list; -GLEW_VAR_EXPORT GLboolean __GLEW_SUN_vertex; -GLEW_VAR_EXPORT GLboolean __GLEW_WIN_phong_shading; -GLEW_VAR_EXPORT GLboolean __GLEW_WIN_specular_fog; -GLEW_VAR_EXPORT GLboolean __GLEW_WIN_swap_hint; - -#ifdef GLEW_MX -}; /* GLEWContextStruct */ -#endif /* GLEW_MX */ - -/* ------------------------------------------------------------------------- */ - -/* error codes */ -#define GLEW_OK 0 -#define GLEW_NO_ERROR 0 -#define GLEW_ERROR_NO_GL_VERSION 1 /* missing GL version */ -#define GLEW_ERROR_GL_VERSION_10_ONLY 2 /* Need at least OpenGL 1.1 */ -#define GLEW_ERROR_GLX_VERSION_11_ONLY 3 /* Need at least GLX 1.2 */ - -/* string codes */ -#define GLEW_VERSION 1 -#define GLEW_VERSION_MAJOR 2 -#define GLEW_VERSION_MINOR 3 -#define GLEW_VERSION_MICRO 4 - -/* ------------------------------------------------------------------------- */ - -/* GLEW version info */ - -/* -VERSION 1.13.0 -VERSION_MAJOR 1 -VERSION_MINOR 13 -VERSION_MICRO 0 -*/ - -/* API */ -#ifdef GLEW_MX - -typedef struct GLEWContextStruct GLEWContext; -GLEWAPI GLenum GLEWAPIENTRY glewContextInit (GLEWContext *ctx); -GLEWAPI GLboolean GLEWAPIENTRY glewContextIsSupported (const GLEWContext *ctx, const char *name); - -#define glewInit() glewContextInit(glewGetContext()) -#define glewIsSupported(x) glewContextIsSupported(glewGetContext(), x) -#define glewIsExtensionSupported(x) glewIsSupported(x) - -#define GLEW_GET_VAR(x) (*(const GLboolean*)&(glewGetContext()->x)) -#ifdef _WIN32 -# define GLEW_GET_FUN(x) glewGetContext()->x -#else -# define GLEW_GET_FUN(x) x -#endif - -#else /* GLEW_MX */ - -GLEWAPI GLenum GLEWAPIENTRY glewInit (void); -GLEWAPI GLboolean GLEWAPIENTRY glewIsSupported (const char *name); -#define glewIsExtensionSupported(x) glewIsSupported(x) - -#define GLEW_GET_VAR(x) (*(const GLboolean*)&x) -#define GLEW_GET_FUN(x) x - -#endif /* GLEW_MX */ - -GLEWAPI GLboolean glewExperimental; -GLEWAPI GLboolean GLEWAPIENTRY glewGetExtension (const char *name); -GLEWAPI const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error); -GLEWAPI const GLubyte * GLEWAPIENTRY glewGetString (GLenum name); - -#ifdef __cplusplus -} -#endif - -#ifdef GLEW_APIENTRY_DEFINED -#undef GLEW_APIENTRY_DEFINED -#undef APIENTRY -#endif - -#ifdef GLEW_CALLBACK_DEFINED -#undef GLEW_CALLBACK_DEFINED -#undef CALLBACK -#endif - -#ifdef GLEW_WINGDIAPI_DEFINED -#undef GLEW_WINGDIAPI_DEFINED -#undef WINGDIAPI -#endif - -#undef GLAPI -/* #undef GLEWAPI */ - -#endif /* __glew_h__ */ diff --git a/thirdparty/glew/GL/glxew.h b/thirdparty/glew/GL/glxew.h deleted file mode 100644 index d803d260b3..0000000000 --- a/thirdparty/glew/GL/glxew.h +++ /dev/null @@ -1,1772 +0,0 @@ -/* -** The OpenGL Extension Wrangler Library -** Copyright (C) 2008-2015, Nigel Stewart <nigels[]users sourceforge net> -** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org> -** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org> -** Copyright (C) 2002, Lev Povalahev -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are met: -** -** * Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** * The name of the author may be used to endorse or promote products -** derived from this software without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -** THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/* - * Mesa 3-D graphics library - * Version: 7.0 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* -** Copyright (c) 2007 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ - -#ifndef __glxew_h__ -#define __glxew_h__ -#define __GLXEW_H__ - -#ifdef __glxext_h_ -#error glxext.h included before glxew.h -#endif - -#if defined(GLX_H) || defined(__GLX_glx_h__) || defined(__glx_h__) -#error glx.h included before glxew.h -#endif - -#define __glxext_h_ - -#define GLX_H -#define __GLX_glx_h__ -#define __glx_h__ - -#include <X11/Xlib.h> -#include <X11/Xutil.h> -#include <X11/Xmd.h> -#include <GL/glew.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/* ---------------------------- GLX_VERSION_1_0 --------------------------- */ - -#ifndef GLX_VERSION_1_0 -#define GLX_VERSION_1_0 1 - -#define GLX_USE_GL 1 -#define GLX_BUFFER_SIZE 2 -#define GLX_LEVEL 3 -#define GLX_RGBA 4 -#define GLX_DOUBLEBUFFER 5 -#define GLX_STEREO 6 -#define GLX_AUX_BUFFERS 7 -#define GLX_RED_SIZE 8 -#define GLX_GREEN_SIZE 9 -#define GLX_BLUE_SIZE 10 -#define GLX_ALPHA_SIZE 11 -#define GLX_DEPTH_SIZE 12 -#define GLX_STENCIL_SIZE 13 -#define GLX_ACCUM_RED_SIZE 14 -#define GLX_ACCUM_GREEN_SIZE 15 -#define GLX_ACCUM_BLUE_SIZE 16 -#define GLX_ACCUM_ALPHA_SIZE 17 -#define GLX_BAD_SCREEN 1 -#define GLX_BAD_ATTRIBUTE 2 -#define GLX_NO_EXTENSION 3 -#define GLX_BAD_VISUAL 4 -#define GLX_BAD_CONTEXT 5 -#define GLX_BAD_VALUE 6 -#define GLX_BAD_ENUM 7 - -typedef XID GLXDrawable; -typedef XID GLXPixmap; -#ifdef __sun -typedef struct __glXContextRec *GLXContext; -#else -typedef struct __GLXcontextRec *GLXContext; -#endif - -typedef unsigned int GLXVideoDeviceNV; - -extern Bool glXQueryExtension (Display *dpy, int *errorBase, int *eventBase); -extern Bool glXQueryVersion (Display *dpy, int *major, int *minor); -extern int glXGetConfig (Display *dpy, XVisualInfo *vis, int attrib, int *value); -extern XVisualInfo* glXChooseVisual (Display *dpy, int screen, int *attribList); -extern GLXPixmap glXCreateGLXPixmap (Display *dpy, XVisualInfo *vis, Pixmap pixmap); -extern void glXDestroyGLXPixmap (Display *dpy, GLXPixmap pix); -extern GLXContext glXCreateContext (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct); -extern void glXDestroyContext (Display *dpy, GLXContext ctx); -extern Bool glXIsDirect (Display *dpy, GLXContext ctx); -extern void glXCopyContext (Display *dpy, GLXContext src, GLXContext dst, GLulong mask); -extern Bool glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXContext ctx); -extern GLXContext glXGetCurrentContext (void); -extern GLXDrawable glXGetCurrentDrawable (void); -extern void glXWaitGL (void); -extern void glXWaitX (void); -extern void glXSwapBuffers (Display *dpy, GLXDrawable drawable); -extern void glXUseXFont (Font font, int first, int count, int listBase); - -#define GLXEW_VERSION_1_0 GLXEW_GET_VAR(__GLXEW_VERSION_1_0) - -#endif /* GLX_VERSION_1_0 */ - -/* ---------------------------- GLX_VERSION_1_1 --------------------------- */ - -#ifndef GLX_VERSION_1_1 -#define GLX_VERSION_1_1 - -#define GLX_VENDOR 0x1 -#define GLX_VERSION 0x2 -#define GLX_EXTENSIONS 0x3 - -extern const char* glXQueryExtensionsString (Display *dpy, int screen); -extern const char* glXGetClientString (Display *dpy, int name); -extern const char* glXQueryServerString (Display *dpy, int screen, int name); - -#define GLXEW_VERSION_1_1 GLXEW_GET_VAR(__GLXEW_VERSION_1_1) - -#endif /* GLX_VERSION_1_1 */ - -/* ---------------------------- GLX_VERSION_1_2 ---------------------------- */ - -#ifndef GLX_VERSION_1_2 -#define GLX_VERSION_1_2 1 - -typedef Display* ( * PFNGLXGETCURRENTDISPLAYPROC) (void); - -#define glXGetCurrentDisplay GLXEW_GET_FUN(__glewXGetCurrentDisplay) - -#define GLXEW_VERSION_1_2 GLXEW_GET_VAR(__GLXEW_VERSION_1_2) - -#endif /* GLX_VERSION_1_2 */ - -/* ---------------------------- GLX_VERSION_1_3 ---------------------------- */ - -#ifndef GLX_VERSION_1_3 -#define GLX_VERSION_1_3 1 - -#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 -#define GLX_RGBA_BIT 0x00000001 -#define GLX_WINDOW_BIT 0x00000001 -#define GLX_COLOR_INDEX_BIT 0x00000002 -#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 -#define GLX_PIXMAP_BIT 0x00000002 -#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 -#define GLX_PBUFFER_BIT 0x00000004 -#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 -#define GLX_AUX_BUFFERS_BIT 0x00000010 -#define GLX_CONFIG_CAVEAT 0x20 -#define GLX_DEPTH_BUFFER_BIT 0x00000020 -#define GLX_X_VISUAL_TYPE 0x22 -#define GLX_TRANSPARENT_TYPE 0x23 -#define GLX_TRANSPARENT_INDEX_VALUE 0x24 -#define GLX_TRANSPARENT_RED_VALUE 0x25 -#define GLX_TRANSPARENT_GREEN_VALUE 0x26 -#define GLX_TRANSPARENT_BLUE_VALUE 0x27 -#define GLX_TRANSPARENT_ALPHA_VALUE 0x28 -#define GLX_STENCIL_BUFFER_BIT 0x00000040 -#define GLX_ACCUM_BUFFER_BIT 0x00000080 -#define GLX_NONE 0x8000 -#define GLX_SLOW_CONFIG 0x8001 -#define GLX_TRUE_COLOR 0x8002 -#define GLX_DIRECT_COLOR 0x8003 -#define GLX_PSEUDO_COLOR 0x8004 -#define GLX_STATIC_COLOR 0x8005 -#define GLX_GRAY_SCALE 0x8006 -#define GLX_STATIC_GRAY 0x8007 -#define GLX_TRANSPARENT_RGB 0x8008 -#define GLX_TRANSPARENT_INDEX 0x8009 -#define GLX_VISUAL_ID 0x800B -#define GLX_SCREEN 0x800C -#define GLX_NON_CONFORMANT_CONFIG 0x800D -#define GLX_DRAWABLE_TYPE 0x8010 -#define GLX_RENDER_TYPE 0x8011 -#define GLX_X_RENDERABLE 0x8012 -#define GLX_FBCONFIG_ID 0x8013 -#define GLX_RGBA_TYPE 0x8014 -#define GLX_COLOR_INDEX_TYPE 0x8015 -#define GLX_MAX_PBUFFER_WIDTH 0x8016 -#define GLX_MAX_PBUFFER_HEIGHT 0x8017 -#define GLX_MAX_PBUFFER_PIXELS 0x8018 -#define GLX_PRESERVED_CONTENTS 0x801B -#define GLX_LARGEST_PBUFFER 0x801C -#define GLX_WIDTH 0x801D -#define GLX_HEIGHT 0x801E -#define GLX_EVENT_MASK 0x801F -#define GLX_DAMAGED 0x8020 -#define GLX_SAVED 0x8021 -#define GLX_WINDOW 0x8022 -#define GLX_PBUFFER 0x8023 -#define GLX_PBUFFER_HEIGHT 0x8040 -#define GLX_PBUFFER_WIDTH 0x8041 -#define GLX_PBUFFER_CLOBBER_MASK 0x08000000 -#define GLX_DONT_CARE 0xFFFFFFFF - -typedef XID GLXFBConfigID; -typedef XID GLXPbuffer; -typedef XID GLXWindow; -typedef struct __GLXFBConfigRec *GLXFBConfig; - -typedef struct { - int event_type; - int draw_type; - unsigned long serial; - Bool send_event; - Display *display; - GLXDrawable drawable; - unsigned int buffer_mask; - unsigned int aux_buffer; - int x, y; - int width, height; - int count; -} GLXPbufferClobberEvent; -typedef union __GLXEvent { - GLXPbufferClobberEvent glxpbufferclobber; - long pad[24]; -} GLXEvent; - -typedef GLXFBConfig* ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); -typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); -typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list); -typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list); -typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list); -typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf); -typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap); -typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win); -typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void); -typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value); -typedef GLXFBConfig* ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements); -typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask); -typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config); -typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx); -typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value); -typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value); -typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask); - -#define glXChooseFBConfig GLXEW_GET_FUN(__glewXChooseFBConfig) -#define glXCreateNewContext GLXEW_GET_FUN(__glewXCreateNewContext) -#define glXCreatePbuffer GLXEW_GET_FUN(__glewXCreatePbuffer) -#define glXCreatePixmap GLXEW_GET_FUN(__glewXCreatePixmap) -#define glXCreateWindow GLXEW_GET_FUN(__glewXCreateWindow) -#define glXDestroyPbuffer GLXEW_GET_FUN(__glewXDestroyPbuffer) -#define glXDestroyPixmap GLXEW_GET_FUN(__glewXDestroyPixmap) -#define glXDestroyWindow GLXEW_GET_FUN(__glewXDestroyWindow) -#define glXGetCurrentReadDrawable GLXEW_GET_FUN(__glewXGetCurrentReadDrawable) -#define glXGetFBConfigAttrib GLXEW_GET_FUN(__glewXGetFBConfigAttrib) -#define glXGetFBConfigs GLXEW_GET_FUN(__glewXGetFBConfigs) -#define glXGetSelectedEvent GLXEW_GET_FUN(__glewXGetSelectedEvent) -#define glXGetVisualFromFBConfig GLXEW_GET_FUN(__glewXGetVisualFromFBConfig) -#define glXMakeContextCurrent GLXEW_GET_FUN(__glewXMakeContextCurrent) -#define glXQueryContext GLXEW_GET_FUN(__glewXQueryContext) -#define glXQueryDrawable GLXEW_GET_FUN(__glewXQueryDrawable) -#define glXSelectEvent GLXEW_GET_FUN(__glewXSelectEvent) - -#define GLXEW_VERSION_1_3 GLXEW_GET_VAR(__GLXEW_VERSION_1_3) - -#endif /* GLX_VERSION_1_3 */ - -/* ---------------------------- GLX_VERSION_1_4 ---------------------------- */ - -#ifndef GLX_VERSION_1_4 -#define GLX_VERSION_1_4 1 - -#define GLX_SAMPLE_BUFFERS 100000 -#define GLX_SAMPLES 100001 - -extern void ( * glXGetProcAddress (const GLubyte *procName)) (void); - -#define GLXEW_VERSION_1_4 GLXEW_GET_VAR(__GLXEW_VERSION_1_4) - -#endif /* GLX_VERSION_1_4 */ - -/* -------------------------- GLX_3DFX_multisample ------------------------- */ - -#ifndef GLX_3DFX_multisample -#define GLX_3DFX_multisample 1 - -#define GLX_SAMPLE_BUFFERS_3DFX 0x8050 -#define GLX_SAMPLES_3DFX 0x8051 - -#define GLXEW_3DFX_multisample GLXEW_GET_VAR(__GLXEW_3DFX_multisample) - -#endif /* GLX_3DFX_multisample */ - -/* ------------------------ GLX_AMD_gpu_association ------------------------ */ - -#ifndef GLX_AMD_gpu_association -#define GLX_AMD_gpu_association 1 - -#define GLX_GPU_VENDOR_AMD 0x1F00 -#define GLX_GPU_RENDERER_STRING_AMD 0x1F01 -#define GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 -#define GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 -#define GLX_GPU_RAM_AMD 0x21A3 -#define GLX_GPU_CLOCK_AMD 0x21A4 -#define GLX_GPU_NUM_PIPES_AMD 0x21A5 -#define GLX_GPU_NUM_SIMD_AMD 0x21A6 -#define GLX_GPU_NUM_RB_AMD 0x21A7 -#define GLX_GPU_NUM_SPI_AMD 0x21A8 - -typedef void ( * PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC) (GLXContext dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -typedef GLXContext ( * PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC) (unsigned int id, GLXContext share_list); -typedef GLXContext ( * PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (unsigned int id, GLXContext share_context, const int* attribList); -typedef Bool ( * PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC) (GLXContext ctx); -typedef unsigned int ( * PFNGLXGETCONTEXTGPUIDAMDPROC) (GLXContext ctx); -typedef GLXContext ( * PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); -typedef unsigned int ( * PFNGLXGETGPUIDSAMDPROC) (unsigned int maxCount, unsigned int* ids); -typedef int ( * PFNGLXGETGPUINFOAMDPROC) (unsigned int id, int property, GLenum dataType, unsigned int size, void* data); -typedef Bool ( * PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (GLXContext ctx); - -#define glXBlitContextFramebufferAMD GLXEW_GET_FUN(__glewXBlitContextFramebufferAMD) -#define glXCreateAssociatedContextAMD GLXEW_GET_FUN(__glewXCreateAssociatedContextAMD) -#define glXCreateAssociatedContextAttribsAMD GLXEW_GET_FUN(__glewXCreateAssociatedContextAttribsAMD) -#define glXDeleteAssociatedContextAMD GLXEW_GET_FUN(__glewXDeleteAssociatedContextAMD) -#define glXGetContextGPUIDAMD GLXEW_GET_FUN(__glewXGetContextGPUIDAMD) -#define glXGetCurrentAssociatedContextAMD GLXEW_GET_FUN(__glewXGetCurrentAssociatedContextAMD) -#define glXGetGPUIDsAMD GLXEW_GET_FUN(__glewXGetGPUIDsAMD) -#define glXGetGPUInfoAMD GLXEW_GET_FUN(__glewXGetGPUInfoAMD) -#define glXMakeAssociatedContextCurrentAMD GLXEW_GET_FUN(__glewXMakeAssociatedContextCurrentAMD) - -#define GLXEW_AMD_gpu_association GLXEW_GET_VAR(__GLXEW_AMD_gpu_association) - -#endif /* GLX_AMD_gpu_association */ - -/* --------------------- GLX_ARB_context_flush_control --------------------- */ - -#ifndef GLX_ARB_context_flush_control -#define GLX_ARB_context_flush_control 1 - -#define GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0x0000 -#define GLX_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097 -#define GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098 - -#define GLXEW_ARB_context_flush_control GLXEW_GET_VAR(__GLXEW_ARB_context_flush_control) - -#endif /* GLX_ARB_context_flush_control */ - -/* ------------------------- GLX_ARB_create_context ------------------------ */ - -#ifndef GLX_ARB_create_context -#define GLX_ARB_create_context 1 - -#define GLX_CONTEXT_DEBUG_BIT_ARB 0x0001 -#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 -#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 -#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 -#define GLX_CONTEXT_FLAGS_ARB 0x2094 - -typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display* dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list); - -#define glXCreateContextAttribsARB GLXEW_GET_FUN(__glewXCreateContextAttribsARB) - -#define GLXEW_ARB_create_context GLXEW_GET_VAR(__GLXEW_ARB_create_context) - -#endif /* GLX_ARB_create_context */ - -/* --------------------- GLX_ARB_create_context_profile -------------------- */ - -#ifndef GLX_ARB_create_context_profile -#define GLX_ARB_create_context_profile 1 - -#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 -#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 -#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126 - -#define GLXEW_ARB_create_context_profile GLXEW_GET_VAR(__GLXEW_ARB_create_context_profile) - -#endif /* GLX_ARB_create_context_profile */ - -/* ------------------- GLX_ARB_create_context_robustness ------------------- */ - -#ifndef GLX_ARB_create_context_robustness -#define GLX_ARB_create_context_robustness 1 - -#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 -#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252 -#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 -#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261 - -#define GLXEW_ARB_create_context_robustness GLXEW_GET_VAR(__GLXEW_ARB_create_context_robustness) - -#endif /* GLX_ARB_create_context_robustness */ - -/* ------------------------- GLX_ARB_fbconfig_float ------------------------ */ - -#ifndef GLX_ARB_fbconfig_float -#define GLX_ARB_fbconfig_float 1 - -#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004 -#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9 - -#define GLXEW_ARB_fbconfig_float GLXEW_GET_VAR(__GLXEW_ARB_fbconfig_float) - -#endif /* GLX_ARB_fbconfig_float */ - -/* ------------------------ GLX_ARB_framebuffer_sRGB ----------------------- */ - -#ifndef GLX_ARB_framebuffer_sRGB -#define GLX_ARB_framebuffer_sRGB 1 - -#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2 - -#define GLXEW_ARB_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_ARB_framebuffer_sRGB) - -#endif /* GLX_ARB_framebuffer_sRGB */ - -/* ------------------------ GLX_ARB_get_proc_address ----------------------- */ - -#ifndef GLX_ARB_get_proc_address -#define GLX_ARB_get_proc_address 1 - -extern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void); - -#define GLXEW_ARB_get_proc_address GLXEW_GET_VAR(__GLXEW_ARB_get_proc_address) - -#endif /* GLX_ARB_get_proc_address */ - -/* -------------------------- GLX_ARB_multisample -------------------------- */ - -#ifndef GLX_ARB_multisample -#define GLX_ARB_multisample 1 - -#define GLX_SAMPLE_BUFFERS_ARB 100000 -#define GLX_SAMPLES_ARB 100001 - -#define GLXEW_ARB_multisample GLXEW_GET_VAR(__GLXEW_ARB_multisample) - -#endif /* GLX_ARB_multisample */ - -/* ---------------- GLX_ARB_robustness_application_isolation --------------- */ - -#ifndef GLX_ARB_robustness_application_isolation -#define GLX_ARB_robustness_application_isolation 1 - -#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 - -#define GLXEW_ARB_robustness_application_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_application_isolation) - -#endif /* GLX_ARB_robustness_application_isolation */ - -/* ---------------- GLX_ARB_robustness_share_group_isolation --------------- */ - -#ifndef GLX_ARB_robustness_share_group_isolation -#define GLX_ARB_robustness_share_group_isolation 1 - -#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 - -#define GLXEW_ARB_robustness_share_group_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_share_group_isolation) - -#endif /* GLX_ARB_robustness_share_group_isolation */ - -/* ---------------------- GLX_ARB_vertex_buffer_object --------------------- */ - -#ifndef GLX_ARB_vertex_buffer_object -#define GLX_ARB_vertex_buffer_object 1 - -#define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095 - -#define GLXEW_ARB_vertex_buffer_object GLXEW_GET_VAR(__GLXEW_ARB_vertex_buffer_object) - -#endif /* GLX_ARB_vertex_buffer_object */ - -/* ----------------------- GLX_ATI_pixel_format_float ---------------------- */ - -#ifndef GLX_ATI_pixel_format_float -#define GLX_ATI_pixel_format_float 1 - -#define GLX_RGBA_FLOAT_ATI_BIT 0x00000100 - -#define GLXEW_ATI_pixel_format_float GLXEW_GET_VAR(__GLXEW_ATI_pixel_format_float) - -#endif /* GLX_ATI_pixel_format_float */ - -/* ------------------------- GLX_ATI_render_texture ------------------------ */ - -#ifndef GLX_ATI_render_texture -#define GLX_ATI_render_texture 1 - -#define GLX_BIND_TO_TEXTURE_RGB_ATI 0x9800 -#define GLX_BIND_TO_TEXTURE_RGBA_ATI 0x9801 -#define GLX_TEXTURE_FORMAT_ATI 0x9802 -#define GLX_TEXTURE_TARGET_ATI 0x9803 -#define GLX_MIPMAP_TEXTURE_ATI 0x9804 -#define GLX_TEXTURE_RGB_ATI 0x9805 -#define GLX_TEXTURE_RGBA_ATI 0x9806 -#define GLX_NO_TEXTURE_ATI 0x9807 -#define GLX_TEXTURE_CUBE_MAP_ATI 0x9808 -#define GLX_TEXTURE_1D_ATI 0x9809 -#define GLX_TEXTURE_2D_ATI 0x980A -#define GLX_MIPMAP_LEVEL_ATI 0x980B -#define GLX_CUBE_MAP_FACE_ATI 0x980C -#define GLX_TEXTURE_CUBE_MAP_POSITIVE_X_ATI 0x980D -#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_X_ATI 0x980E -#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Y_ATI 0x980F -#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Y_ATI 0x9810 -#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Z_ATI 0x9811 -#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Z_ATI 0x9812 -#define GLX_FRONT_LEFT_ATI 0x9813 -#define GLX_FRONT_RIGHT_ATI 0x9814 -#define GLX_BACK_LEFT_ATI 0x9815 -#define GLX_BACK_RIGHT_ATI 0x9816 -#define GLX_AUX0_ATI 0x9817 -#define GLX_AUX1_ATI 0x9818 -#define GLX_AUX2_ATI 0x9819 -#define GLX_AUX3_ATI 0x981A -#define GLX_AUX4_ATI 0x981B -#define GLX_AUX5_ATI 0x981C -#define GLX_AUX6_ATI 0x981D -#define GLX_AUX7_ATI 0x981E -#define GLX_AUX8_ATI 0x981F -#define GLX_AUX9_ATI 0x9820 -#define GLX_BIND_TO_TEXTURE_LUMINANCE_ATI 0x9821 -#define GLX_BIND_TO_TEXTURE_INTENSITY_ATI 0x9822 - -typedef void ( * PFNGLXBINDTEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer); -typedef void ( * PFNGLXDRAWABLEATTRIBATIPROC) (Display *dpy, GLXDrawable draw, const int *attrib_list); -typedef void ( * PFNGLXRELEASETEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer); - -#define glXBindTexImageATI GLXEW_GET_FUN(__glewXBindTexImageATI) -#define glXDrawableAttribATI GLXEW_GET_FUN(__glewXDrawableAttribATI) -#define glXReleaseTexImageATI GLXEW_GET_FUN(__glewXReleaseTexImageATI) - -#define GLXEW_ATI_render_texture GLXEW_GET_VAR(__GLXEW_ATI_render_texture) - -#endif /* GLX_ATI_render_texture */ - -/* --------------------------- GLX_EXT_buffer_age -------------------------- */ - -#ifndef GLX_EXT_buffer_age -#define GLX_EXT_buffer_age 1 - -#define GLX_BACK_BUFFER_AGE_EXT 0x20F4 - -#define GLXEW_EXT_buffer_age GLXEW_GET_VAR(__GLXEW_EXT_buffer_age) - -#endif /* GLX_EXT_buffer_age */ - -/* ------------------- GLX_EXT_create_context_es2_profile ------------------ */ - -#ifndef GLX_EXT_create_context_es2_profile -#define GLX_EXT_create_context_es2_profile 1 - -#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 - -#define GLXEW_EXT_create_context_es2_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es2_profile) - -#endif /* GLX_EXT_create_context_es2_profile */ - -/* ------------------- GLX_EXT_create_context_es_profile ------------------- */ - -#ifndef GLX_EXT_create_context_es_profile -#define GLX_EXT_create_context_es_profile 1 - -#define GLX_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 - -#define GLXEW_EXT_create_context_es_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es_profile) - -#endif /* GLX_EXT_create_context_es_profile */ - -/* --------------------- GLX_EXT_fbconfig_packed_float --------------------- */ - -#ifndef GLX_EXT_fbconfig_packed_float -#define GLX_EXT_fbconfig_packed_float 1 - -#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 -#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 - -#define GLXEW_EXT_fbconfig_packed_float GLXEW_GET_VAR(__GLXEW_EXT_fbconfig_packed_float) - -#endif /* GLX_EXT_fbconfig_packed_float */ - -/* ------------------------ GLX_EXT_framebuffer_sRGB ----------------------- */ - -#ifndef GLX_EXT_framebuffer_sRGB -#define GLX_EXT_framebuffer_sRGB 1 - -#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2 - -#define GLXEW_EXT_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_EXT_framebuffer_sRGB) - -#endif /* GLX_EXT_framebuffer_sRGB */ - -/* ------------------------- GLX_EXT_import_context ------------------------ */ - -#ifndef GLX_EXT_import_context -#define GLX_EXT_import_context 1 - -#define GLX_SHARE_CONTEXT_EXT 0x800A -#define GLX_VISUAL_ID_EXT 0x800B -#define GLX_SCREEN_EXT 0x800C - -typedef XID GLXContextID; - -typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display* dpy, GLXContext context); -typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context); -typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display* dpy, GLXContextID contextID); -typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display* dpy, GLXContext context, int attribute,int *value); - -#define glXFreeContextEXT GLXEW_GET_FUN(__glewXFreeContextEXT) -#define glXGetContextIDEXT GLXEW_GET_FUN(__glewXGetContextIDEXT) -#define glXImportContextEXT GLXEW_GET_FUN(__glewXImportContextEXT) -#define glXQueryContextInfoEXT GLXEW_GET_FUN(__glewXQueryContextInfoEXT) - -#define GLXEW_EXT_import_context GLXEW_GET_VAR(__GLXEW_EXT_import_context) - -#endif /* GLX_EXT_import_context */ - -/* -------------------------- GLX_EXT_scene_marker ------------------------- */ - -#ifndef GLX_EXT_scene_marker -#define GLX_EXT_scene_marker 1 - -#define GLXEW_EXT_scene_marker GLXEW_GET_VAR(__GLXEW_EXT_scene_marker) - -#endif /* GLX_EXT_scene_marker */ - -/* -------------------------- GLX_EXT_stereo_tree -------------------------- */ - -#ifndef GLX_EXT_stereo_tree -#define GLX_EXT_stereo_tree 1 - -#define GLX_STEREO_NOTIFY_EXT 0x00000000 -#define GLX_STEREO_NOTIFY_MASK_EXT 0x00000001 -#define GLX_STEREO_TREE_EXT 0x20F5 - -#define GLXEW_EXT_stereo_tree GLXEW_GET_VAR(__GLXEW_EXT_stereo_tree) - -#endif /* GLX_EXT_stereo_tree */ - -/* -------------------------- GLX_EXT_swap_control ------------------------- */ - -#ifndef GLX_EXT_swap_control -#define GLX_EXT_swap_control 1 - -#define GLX_SWAP_INTERVAL_EXT 0x20F1 -#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2 - -typedef void ( * PFNGLXSWAPINTERVALEXTPROC) (Display* dpy, GLXDrawable drawable, int interval); - -#define glXSwapIntervalEXT GLXEW_GET_FUN(__glewXSwapIntervalEXT) - -#define GLXEW_EXT_swap_control GLXEW_GET_VAR(__GLXEW_EXT_swap_control) - -#endif /* GLX_EXT_swap_control */ - -/* ----------------------- GLX_EXT_swap_control_tear ----------------------- */ - -#ifndef GLX_EXT_swap_control_tear -#define GLX_EXT_swap_control_tear 1 - -#define GLX_LATE_SWAPS_TEAR_EXT 0x20F3 - -#define GLXEW_EXT_swap_control_tear GLXEW_GET_VAR(__GLXEW_EXT_swap_control_tear) - -#endif /* GLX_EXT_swap_control_tear */ - -/* ---------------------- GLX_EXT_texture_from_pixmap ---------------------- */ - -#ifndef GLX_EXT_texture_from_pixmap -#define GLX_EXT_texture_from_pixmap 1 - -#define GLX_TEXTURE_1D_BIT_EXT 0x00000001 -#define GLX_TEXTURE_2D_BIT_EXT 0x00000002 -#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 -#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 -#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 -#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 -#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 -#define GLX_Y_INVERTED_EXT 0x20D4 -#define GLX_TEXTURE_FORMAT_EXT 0x20D5 -#define GLX_TEXTURE_TARGET_EXT 0x20D6 -#define GLX_MIPMAP_TEXTURE_EXT 0x20D7 -#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 -#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 -#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA -#define GLX_TEXTURE_1D_EXT 0x20DB -#define GLX_TEXTURE_2D_EXT 0x20DC -#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD -#define GLX_FRONT_LEFT_EXT 0x20DE -#define GLX_FRONT_RIGHT_EXT 0x20DF -#define GLX_BACK_LEFT_EXT 0x20E0 -#define GLX_BACK_RIGHT_EXT 0x20E1 -#define GLX_AUX0_EXT 0x20E2 -#define GLX_AUX1_EXT 0x20E3 -#define GLX_AUX2_EXT 0x20E4 -#define GLX_AUX3_EXT 0x20E5 -#define GLX_AUX4_EXT 0x20E6 -#define GLX_AUX5_EXT 0x20E7 -#define GLX_AUX6_EXT 0x20E8 -#define GLX_AUX7_EXT 0x20E9 -#define GLX_AUX8_EXT 0x20EA -#define GLX_AUX9_EXT 0x20EB - -typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer, const int *attrib_list); -typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer); - -#define glXBindTexImageEXT GLXEW_GET_FUN(__glewXBindTexImageEXT) -#define glXReleaseTexImageEXT GLXEW_GET_FUN(__glewXReleaseTexImageEXT) - -#define GLXEW_EXT_texture_from_pixmap GLXEW_GET_VAR(__GLXEW_EXT_texture_from_pixmap) - -#endif /* GLX_EXT_texture_from_pixmap */ - -/* -------------------------- GLX_EXT_visual_info -------------------------- */ - -#ifndef GLX_EXT_visual_info -#define GLX_EXT_visual_info 1 - -#define GLX_X_VISUAL_TYPE_EXT 0x22 -#define GLX_TRANSPARENT_TYPE_EXT 0x23 -#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 -#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 -#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 -#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 -#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 -#define GLX_NONE_EXT 0x8000 -#define GLX_TRUE_COLOR_EXT 0x8002 -#define GLX_DIRECT_COLOR_EXT 0x8003 -#define GLX_PSEUDO_COLOR_EXT 0x8004 -#define GLX_STATIC_COLOR_EXT 0x8005 -#define GLX_GRAY_SCALE_EXT 0x8006 -#define GLX_STATIC_GRAY_EXT 0x8007 -#define GLX_TRANSPARENT_RGB_EXT 0x8008 -#define GLX_TRANSPARENT_INDEX_EXT 0x8009 - -#define GLXEW_EXT_visual_info GLXEW_GET_VAR(__GLXEW_EXT_visual_info) - -#endif /* GLX_EXT_visual_info */ - -/* ------------------------- GLX_EXT_visual_rating ------------------------- */ - -#ifndef GLX_EXT_visual_rating -#define GLX_EXT_visual_rating 1 - -#define GLX_VISUAL_CAVEAT_EXT 0x20 -#define GLX_SLOW_VISUAL_EXT 0x8001 -#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D - -#define GLXEW_EXT_visual_rating GLXEW_GET_VAR(__GLXEW_EXT_visual_rating) - -#endif /* GLX_EXT_visual_rating */ - -/* -------------------------- GLX_INTEL_swap_event ------------------------- */ - -#ifndef GLX_INTEL_swap_event -#define GLX_INTEL_swap_event 1 - -#define GLX_EXCHANGE_COMPLETE_INTEL 0x8180 -#define GLX_COPY_COMPLETE_INTEL 0x8181 -#define GLX_FLIP_COMPLETE_INTEL 0x8182 -#define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000 - -#define GLXEW_INTEL_swap_event GLXEW_GET_VAR(__GLXEW_INTEL_swap_event) - -#endif /* GLX_INTEL_swap_event */ - -/* -------------------------- GLX_MESA_agp_offset -------------------------- */ - -#ifndef GLX_MESA_agp_offset -#define GLX_MESA_agp_offset 1 - -typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void* pointer); - -#define glXGetAGPOffsetMESA GLXEW_GET_FUN(__glewXGetAGPOffsetMESA) - -#define GLXEW_MESA_agp_offset GLXEW_GET_VAR(__GLXEW_MESA_agp_offset) - -#endif /* GLX_MESA_agp_offset */ - -/* ------------------------ GLX_MESA_copy_sub_buffer ----------------------- */ - -#ifndef GLX_MESA_copy_sub_buffer -#define GLX_MESA_copy_sub_buffer 1 - -typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display* dpy, GLXDrawable drawable, int x, int y, int width, int height); - -#define glXCopySubBufferMESA GLXEW_GET_FUN(__glewXCopySubBufferMESA) - -#define GLXEW_MESA_copy_sub_buffer GLXEW_GET_VAR(__GLXEW_MESA_copy_sub_buffer) - -#endif /* GLX_MESA_copy_sub_buffer */ - -/* ------------------------ GLX_MESA_pixmap_colormap ----------------------- */ - -#ifndef GLX_MESA_pixmap_colormap -#define GLX_MESA_pixmap_colormap 1 - -typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display* dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap); - -#define glXCreateGLXPixmapMESA GLXEW_GET_FUN(__glewXCreateGLXPixmapMESA) - -#define GLXEW_MESA_pixmap_colormap GLXEW_GET_VAR(__GLXEW_MESA_pixmap_colormap) - -#endif /* GLX_MESA_pixmap_colormap */ - -/* ------------------------ GLX_MESA_query_renderer ------------------------ */ - -#ifndef GLX_MESA_query_renderer -#define GLX_MESA_query_renderer 1 - -#define GLX_RENDERER_VENDOR_ID_MESA 0x8183 -#define GLX_RENDERER_DEVICE_ID_MESA 0x8184 -#define GLX_RENDERER_VERSION_MESA 0x8185 -#define GLX_RENDERER_ACCELERATED_MESA 0x8186 -#define GLX_RENDERER_VIDEO_MEMORY_MESA 0x8187 -#define GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA 0x8188 -#define GLX_RENDERER_PREFERRED_PROFILE_MESA 0x8189 -#define GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA 0x818A -#define GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA 0x818B -#define GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA 0x818C -#define GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA 0x818D -#define GLX_RENDERER_ID_MESA 0x818E - -typedef Bool ( * PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC) (int attribute, unsigned int* value); -typedef const char* ( * PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC) (int attribute); -typedef Bool ( * PFNGLXQUERYRENDERERINTEGERMESAPROC) (Display* dpy, int screen, int renderer, int attribute, unsigned int *value); -typedef const char* ( * PFNGLXQUERYRENDERERSTRINGMESAPROC) (Display *dpy, int screen, int renderer, int attribute); - -#define glXQueryCurrentRendererIntegerMESA GLXEW_GET_FUN(__glewXQueryCurrentRendererIntegerMESA) -#define glXQueryCurrentRendererStringMESA GLXEW_GET_FUN(__glewXQueryCurrentRendererStringMESA) -#define glXQueryRendererIntegerMESA GLXEW_GET_FUN(__glewXQueryRendererIntegerMESA) -#define glXQueryRendererStringMESA GLXEW_GET_FUN(__glewXQueryRendererStringMESA) - -#define GLXEW_MESA_query_renderer GLXEW_GET_VAR(__GLXEW_MESA_query_renderer) - -#endif /* GLX_MESA_query_renderer */ - -/* ------------------------ GLX_MESA_release_buffers ----------------------- */ - -#ifndef GLX_MESA_release_buffers -#define GLX_MESA_release_buffers 1 - -typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display* dpy, GLXDrawable d); - -#define glXReleaseBuffersMESA GLXEW_GET_FUN(__glewXReleaseBuffersMESA) - -#define GLXEW_MESA_release_buffers GLXEW_GET_VAR(__GLXEW_MESA_release_buffers) - -#endif /* GLX_MESA_release_buffers */ - -/* ------------------------- GLX_MESA_set_3dfx_mode ------------------------ */ - -#ifndef GLX_MESA_set_3dfx_mode -#define GLX_MESA_set_3dfx_mode 1 - -#define GLX_3DFX_WINDOW_MODE_MESA 0x1 -#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 - -typedef GLboolean ( * PFNGLXSET3DFXMODEMESAPROC) (GLint mode); - -#define glXSet3DfxModeMESA GLXEW_GET_FUN(__glewXSet3DfxModeMESA) - -#define GLXEW_MESA_set_3dfx_mode GLXEW_GET_VAR(__GLXEW_MESA_set_3dfx_mode) - -#endif /* GLX_MESA_set_3dfx_mode */ - -/* ------------------------- GLX_MESA_swap_control ------------------------- */ - -#ifndef GLX_MESA_swap_control -#define GLX_MESA_swap_control 1 - -typedef int ( * PFNGLXGETSWAPINTERVALMESAPROC) (void); -typedef int ( * PFNGLXSWAPINTERVALMESAPROC) (unsigned int interval); - -#define glXGetSwapIntervalMESA GLXEW_GET_FUN(__glewXGetSwapIntervalMESA) -#define glXSwapIntervalMESA GLXEW_GET_FUN(__glewXSwapIntervalMESA) - -#define GLXEW_MESA_swap_control GLXEW_GET_VAR(__GLXEW_MESA_swap_control) - -#endif /* GLX_MESA_swap_control */ - -/* --------------------------- GLX_NV_copy_buffer -------------------------- */ - -#ifndef GLX_NV_copy_buffer -#define GLX_NV_copy_buffer 1 - -typedef void ( * PFNGLXCOPYBUFFERSUBDATANVPROC) (Display* dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); -typedef void ( * PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC) (Display* dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); - -#define glXCopyBufferSubDataNV GLXEW_GET_FUN(__glewXCopyBufferSubDataNV) -#define glXNamedCopyBufferSubDataNV GLXEW_GET_FUN(__glewXNamedCopyBufferSubDataNV) - -#define GLXEW_NV_copy_buffer GLXEW_GET_VAR(__GLXEW_NV_copy_buffer) - -#endif /* GLX_NV_copy_buffer */ - -/* --------------------------- GLX_NV_copy_image --------------------------- */ - -#ifndef GLX_NV_copy_image -#define GLX_NV_copy_image 1 - -typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); - -#define glXCopyImageSubDataNV GLXEW_GET_FUN(__glewXCopyImageSubDataNV) - -#define GLXEW_NV_copy_image GLXEW_GET_VAR(__GLXEW_NV_copy_image) - -#endif /* GLX_NV_copy_image */ - -/* ------------------------ GLX_NV_delay_before_swap ----------------------- */ - -#ifndef GLX_NV_delay_before_swap -#define GLX_NV_delay_before_swap 1 - -typedef Bool ( * PFNGLXDELAYBEFORESWAPNVPROC) (Display* dpy, GLXDrawable drawable, GLfloat seconds); - -#define glXDelayBeforeSwapNV GLXEW_GET_FUN(__glewXDelayBeforeSwapNV) - -#define GLXEW_NV_delay_before_swap GLXEW_GET_VAR(__GLXEW_NV_delay_before_swap) - -#endif /* GLX_NV_delay_before_swap */ - -/* -------------------------- GLX_NV_float_buffer -------------------------- */ - -#ifndef GLX_NV_float_buffer -#define GLX_NV_float_buffer 1 - -#define GLX_FLOAT_COMPONENTS_NV 0x20B0 - -#define GLXEW_NV_float_buffer GLXEW_GET_VAR(__GLXEW_NV_float_buffer) - -#endif /* GLX_NV_float_buffer */ - -/* ---------------------- GLX_NV_multisample_coverage ---------------------- */ - -#ifndef GLX_NV_multisample_coverage -#define GLX_NV_multisample_coverage 1 - -#define GLX_COLOR_SAMPLES_NV 0x20B3 -#define GLX_COVERAGE_SAMPLES_NV 100001 - -#define GLXEW_NV_multisample_coverage GLXEW_GET_VAR(__GLXEW_NV_multisample_coverage) - -#endif /* GLX_NV_multisample_coverage */ - -/* -------------------------- GLX_NV_present_video ------------------------- */ - -#ifndef GLX_NV_present_video -#define GLX_NV_present_video 1 - -#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0 - -typedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display* dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list); -typedef unsigned int* ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements); - -#define glXBindVideoDeviceNV GLXEW_GET_FUN(__glewXBindVideoDeviceNV) -#define glXEnumerateVideoDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoDevicesNV) - -#define GLXEW_NV_present_video GLXEW_GET_VAR(__GLXEW_NV_present_video) - -#endif /* GLX_NV_present_video */ - -/* --------------------------- GLX_NV_swap_group --------------------------- */ - -#ifndef GLX_NV_swap_group -#define GLX_NV_swap_group 1 - -typedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display* dpy, GLuint group, GLuint barrier); -typedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint group); -typedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display* dpy, int screen, GLuint *count); -typedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display* dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers); -typedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier); -typedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display* dpy, int screen); - -#define glXBindSwapBarrierNV GLXEW_GET_FUN(__glewXBindSwapBarrierNV) -#define glXJoinSwapGroupNV GLXEW_GET_FUN(__glewXJoinSwapGroupNV) -#define glXQueryFrameCountNV GLXEW_GET_FUN(__glewXQueryFrameCountNV) -#define glXQueryMaxSwapGroupsNV GLXEW_GET_FUN(__glewXQueryMaxSwapGroupsNV) -#define glXQuerySwapGroupNV GLXEW_GET_FUN(__glewXQuerySwapGroupNV) -#define glXResetFrameCountNV GLXEW_GET_FUN(__glewXResetFrameCountNV) - -#define GLXEW_NV_swap_group GLXEW_GET_VAR(__GLXEW_NV_swap_group) - -#endif /* GLX_NV_swap_group */ - -/* ----------------------- GLX_NV_vertex_array_range ----------------------- */ - -#ifndef GLX_NV_vertex_array_range -#define GLX_NV_vertex_array_range 1 - -typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); -typedef void ( * PFNGLXFREEMEMORYNVPROC) (void *pointer); - -#define glXAllocateMemoryNV GLXEW_GET_FUN(__glewXAllocateMemoryNV) -#define glXFreeMemoryNV GLXEW_GET_FUN(__glewXFreeMemoryNV) - -#define GLXEW_NV_vertex_array_range GLXEW_GET_VAR(__GLXEW_NV_vertex_array_range) - -#endif /* GLX_NV_vertex_array_range */ - -/* -------------------------- GLX_NV_video_capture ------------------------- */ - -#ifndef GLX_NV_video_capture -#define GLX_NV_video_capture 1 - -#define GLX_DEVICE_ID_NV 0x20CD -#define GLX_UNIQUE_ID_NV 0x20CE -#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF - -typedef XID GLXVideoCaptureDeviceNV; - -typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display* dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device); -typedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display* dpy, int screen, int *nelements); -typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device); -typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value); -typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device); - -#define glXBindVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXBindVideoCaptureDeviceNV) -#define glXEnumerateVideoCaptureDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoCaptureDevicesNV) -#define glXLockVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXLockVideoCaptureDeviceNV) -#define glXQueryVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXQueryVideoCaptureDeviceNV) -#define glXReleaseVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoCaptureDeviceNV) - -#define GLXEW_NV_video_capture GLXEW_GET_VAR(__GLXEW_NV_video_capture) - -#endif /* GLX_NV_video_capture */ - -/* ---------------------------- GLX_NV_video_out --------------------------- */ - -#ifndef GLX_NV_video_out -#define GLX_NV_video_out 1 - -#define GLX_VIDEO_OUT_COLOR_NV 0x20C3 -#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4 -#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5 -#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 -#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 -#define GLX_VIDEO_OUT_FRAME_NV 0x20C8 -#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9 -#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA -#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB -#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC - -typedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display* dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer); -typedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display* dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice); -typedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); -typedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice); -typedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display* dpy, GLXPbuffer pbuf); -typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display* dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock); - -#define glXBindVideoImageNV GLXEW_GET_FUN(__glewXBindVideoImageNV) -#define glXGetVideoDeviceNV GLXEW_GET_FUN(__glewXGetVideoDeviceNV) -#define glXGetVideoInfoNV GLXEW_GET_FUN(__glewXGetVideoInfoNV) -#define glXReleaseVideoDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoDeviceNV) -#define glXReleaseVideoImageNV GLXEW_GET_FUN(__glewXReleaseVideoImageNV) -#define glXSendPbufferToVideoNV GLXEW_GET_FUN(__glewXSendPbufferToVideoNV) - -#define GLXEW_NV_video_out GLXEW_GET_VAR(__GLXEW_NV_video_out) - -#endif /* GLX_NV_video_out */ - -/* -------------------------- GLX_OML_swap_method -------------------------- */ - -#ifndef GLX_OML_swap_method -#define GLX_OML_swap_method 1 - -#define GLX_SWAP_METHOD_OML 0x8060 -#define GLX_SWAP_EXCHANGE_OML 0x8061 -#define GLX_SWAP_COPY_OML 0x8062 -#define GLX_SWAP_UNDEFINED_OML 0x8063 - -#define GLXEW_OML_swap_method GLXEW_GET_VAR(__GLXEW_OML_swap_method) - -#endif /* GLX_OML_swap_method */ - -/* -------------------------- GLX_OML_sync_control ------------------------- */ - -#ifndef GLX_OML_sync_control -#define GLX_OML_sync_control 1 - -typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display* dpy, GLXDrawable drawable, int32_t* numerator, int32_t* denominator); -typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t* ust, int64_t* msc, int64_t* sbc); -typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder); -typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t* ust, int64_t* msc, int64_t* sbc); -typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_sbc, int64_t* ust, int64_t* msc, int64_t* sbc); - -#define glXGetMscRateOML GLXEW_GET_FUN(__glewXGetMscRateOML) -#define glXGetSyncValuesOML GLXEW_GET_FUN(__glewXGetSyncValuesOML) -#define glXSwapBuffersMscOML GLXEW_GET_FUN(__glewXSwapBuffersMscOML) -#define glXWaitForMscOML GLXEW_GET_FUN(__glewXWaitForMscOML) -#define glXWaitForSbcOML GLXEW_GET_FUN(__glewXWaitForSbcOML) - -#define GLXEW_OML_sync_control GLXEW_GET_VAR(__GLXEW_OML_sync_control) - -#endif /* GLX_OML_sync_control */ - -/* ------------------------ GLX_SGIS_blended_overlay ----------------------- */ - -#ifndef GLX_SGIS_blended_overlay -#define GLX_SGIS_blended_overlay 1 - -#define GLX_BLENDED_RGBA_SGIS 0x8025 - -#define GLXEW_SGIS_blended_overlay GLXEW_GET_VAR(__GLXEW_SGIS_blended_overlay) - -#endif /* GLX_SGIS_blended_overlay */ - -/* -------------------------- GLX_SGIS_color_range ------------------------- */ - -#ifndef GLX_SGIS_color_range -#define GLX_SGIS_color_range 1 - -#define GLXEW_SGIS_color_range GLXEW_GET_VAR(__GLXEW_SGIS_color_range) - -#endif /* GLX_SGIS_color_range */ - -/* -------------------------- GLX_SGIS_multisample ------------------------- */ - -#ifndef GLX_SGIS_multisample -#define GLX_SGIS_multisample 1 - -#define GLX_SAMPLE_BUFFERS_SGIS 100000 -#define GLX_SAMPLES_SGIS 100001 - -#define GLXEW_SGIS_multisample GLXEW_GET_VAR(__GLXEW_SGIS_multisample) - -#endif /* GLX_SGIS_multisample */ - -/* ---------------------- GLX_SGIS_shared_multisample ---------------------- */ - -#ifndef GLX_SGIS_shared_multisample -#define GLX_SGIS_shared_multisample 1 - -#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026 -#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027 - -#define GLXEW_SGIS_shared_multisample GLXEW_GET_VAR(__GLXEW_SGIS_shared_multisample) - -#endif /* GLX_SGIS_shared_multisample */ - -/* --------------------------- GLX_SGIX_fbconfig --------------------------- */ - -#ifndef GLX_SGIX_fbconfig -#define GLX_SGIX_fbconfig 1 - -#define GLX_RGBA_BIT_SGIX 0x00000001 -#define GLX_WINDOW_BIT_SGIX 0x00000001 -#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002 -#define GLX_PIXMAP_BIT_SGIX 0x00000002 -#define GLX_SCREEN_EXT 0x800C -#define GLX_DRAWABLE_TYPE_SGIX 0x8010 -#define GLX_RENDER_TYPE_SGIX 0x8011 -#define GLX_X_RENDERABLE_SGIX 0x8012 -#define GLX_FBCONFIG_ID_SGIX 0x8013 -#define GLX_RGBA_TYPE_SGIX 0x8014 -#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015 - -typedef XID GLXFBConfigIDSGIX; -typedef struct __GLXFBConfigRec *GLXFBConfigSGIX; - -typedef GLXFBConfigSGIX* ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); -typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); -typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, Pixmap pixmap); -typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display* dpy, GLXFBConfigSGIX config, int attribute, int *value); -typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display* dpy, XVisualInfo *vis); -typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfig config); - -#define glXChooseFBConfigSGIX GLXEW_GET_FUN(__glewXChooseFBConfigSGIX) -#define glXCreateContextWithConfigSGIX GLXEW_GET_FUN(__glewXCreateContextWithConfigSGIX) -#define glXCreateGLXPixmapWithConfigSGIX GLXEW_GET_FUN(__glewXCreateGLXPixmapWithConfigSGIX) -#define glXGetFBConfigAttribSGIX GLXEW_GET_FUN(__glewXGetFBConfigAttribSGIX) -#define glXGetFBConfigFromVisualSGIX GLXEW_GET_FUN(__glewXGetFBConfigFromVisualSGIX) -#define glXGetVisualFromFBConfigSGIX GLXEW_GET_FUN(__glewXGetVisualFromFBConfigSGIX) - -#define GLXEW_SGIX_fbconfig GLXEW_GET_VAR(__GLXEW_SGIX_fbconfig) - -#endif /* GLX_SGIX_fbconfig */ - -/* --------------------------- GLX_SGIX_hyperpipe -------------------------- */ - -#ifndef GLX_SGIX_hyperpipe -#define GLX_SGIX_hyperpipe 1 - -#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001 -#define GLX_PIPE_RECT_SGIX 0x00000001 -#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002 -#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002 -#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003 -#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004 -#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 -#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91 -#define GLX_BAD_HYPERPIPE_SGIX 92 -#define GLX_HYPERPIPE_ID_SGIX 0x8030 - -typedef struct { - char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; - int networkId; -} GLXHyperpipeNetworkSGIX; -typedef struct { - char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; - int XOrigin; - int YOrigin; - int maxHeight; - int maxWidth; -} GLXPipeRectLimits; -typedef struct { - char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; - int channel; - unsigned int participationType; - int timeSlice; -} GLXHyperpipeConfigSGIX; -typedef struct { - char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; - int srcXOrigin; - int srcYOrigin; - int srcWidth; - int srcHeight; - int destXOrigin; - int destYOrigin; - int destWidth; - int destHeight; -} GLXPipeRect; - -typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId); -typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId); -typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList); -typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId); -typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList); -typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList); -typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes); -typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes); - -#define glXBindHyperpipeSGIX GLXEW_GET_FUN(__glewXBindHyperpipeSGIX) -#define glXDestroyHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXDestroyHyperpipeConfigSGIX) -#define glXHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXHyperpipeAttribSGIX) -#define glXHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXHyperpipeConfigSGIX) -#define glXQueryHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeAttribSGIX) -#define glXQueryHyperpipeBestAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeBestAttribSGIX) -#define glXQueryHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeConfigSGIX) -#define glXQueryHyperpipeNetworkSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeNetworkSGIX) - -#define GLXEW_SGIX_hyperpipe GLXEW_GET_VAR(__GLXEW_SGIX_hyperpipe) - -#endif /* GLX_SGIX_hyperpipe */ - -/* ---------------------------- GLX_SGIX_pbuffer --------------------------- */ - -#ifndef GLX_SGIX_pbuffer -#define GLX_SGIX_pbuffer 1 - -#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001 -#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002 -#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004 -#define GLX_PBUFFER_BIT_SGIX 0x00000004 -#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008 -#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010 -#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020 -#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040 -#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080 -#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100 -#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016 -#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017 -#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018 -#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019 -#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A -#define GLX_PRESERVED_CONTENTS_SGIX 0x801B -#define GLX_LARGEST_PBUFFER_SGIX 0x801C -#define GLX_WIDTH_SGIX 0x801D -#define GLX_HEIGHT_SGIX 0x801E -#define GLX_EVENT_MASK_SGIX 0x801F -#define GLX_DAMAGED_SGIX 0x8020 -#define GLX_SAVED_SGIX 0x8021 -#define GLX_WINDOW_SGIX 0x8022 -#define GLX_PBUFFER_SGIX 0x8023 -#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000 - -typedef XID GLXPbufferSGIX; -typedef struct { int type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; int event_type; int draw_type; unsigned int mask; int x, y; int width, height; int count; } GLXBufferClobberEventSGIX; - -typedef GLXPbuffer ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display* dpy, GLXFBConfig config, unsigned int width, unsigned int height, int *attrib_list); -typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf); -typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long *mask); -typedef void ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf, int attribute, unsigned int *value); -typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long mask); - -#define glXCreateGLXPbufferSGIX GLXEW_GET_FUN(__glewXCreateGLXPbufferSGIX) -#define glXDestroyGLXPbufferSGIX GLXEW_GET_FUN(__glewXDestroyGLXPbufferSGIX) -#define glXGetSelectedEventSGIX GLXEW_GET_FUN(__glewXGetSelectedEventSGIX) -#define glXQueryGLXPbufferSGIX GLXEW_GET_FUN(__glewXQueryGLXPbufferSGIX) -#define glXSelectEventSGIX GLXEW_GET_FUN(__glewXSelectEventSGIX) - -#define GLXEW_SGIX_pbuffer GLXEW_GET_VAR(__GLXEW_SGIX_pbuffer) - -#endif /* GLX_SGIX_pbuffer */ - -/* ------------------------- GLX_SGIX_swap_barrier ------------------------- */ - -#ifndef GLX_SGIX_swap_barrier -#define GLX_SGIX_swap_barrier 1 - -typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier); -typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max); - -#define glXBindSwapBarrierSGIX GLXEW_GET_FUN(__glewXBindSwapBarrierSGIX) -#define glXQueryMaxSwapBarriersSGIX GLXEW_GET_FUN(__glewXQueryMaxSwapBarriersSGIX) - -#define GLXEW_SGIX_swap_barrier GLXEW_GET_VAR(__GLXEW_SGIX_swap_barrier) - -#endif /* GLX_SGIX_swap_barrier */ - -/* -------------------------- GLX_SGIX_swap_group -------------------------- */ - -#ifndef GLX_SGIX_swap_group -#define GLX_SGIX_swap_group 1 - -typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member); - -#define glXJoinSwapGroupSGIX GLXEW_GET_FUN(__glewXJoinSwapGroupSGIX) - -#define GLXEW_SGIX_swap_group GLXEW_GET_VAR(__GLXEW_SGIX_swap_group) - -#endif /* GLX_SGIX_swap_group */ - -/* ------------------------- GLX_SGIX_video_resize ------------------------- */ - -#ifndef GLX_SGIX_video_resize -#define GLX_SGIX_video_resize 1 - -#define GLX_SYNC_FRAME_SGIX 0x00000000 -#define GLX_SYNC_SWAP_SGIX 0x00000001 - -typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display* display, int screen, int channel, Window window); -typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int x, int y, int w, int h); -typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display* display, int screen, int channel, GLenum synctype); -typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display* display, int screen, int channel, int *x, int *y, int *w, int *h); -typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int *dx, int *dy, int *dw, int *dh); - -#define glXBindChannelToWindowSGIX GLXEW_GET_FUN(__glewXBindChannelToWindowSGIX) -#define glXChannelRectSGIX GLXEW_GET_FUN(__glewXChannelRectSGIX) -#define glXChannelRectSyncSGIX GLXEW_GET_FUN(__glewXChannelRectSyncSGIX) -#define glXQueryChannelDeltasSGIX GLXEW_GET_FUN(__glewXQueryChannelDeltasSGIX) -#define glXQueryChannelRectSGIX GLXEW_GET_FUN(__glewXQueryChannelRectSGIX) - -#define GLXEW_SGIX_video_resize GLXEW_GET_VAR(__GLXEW_SGIX_video_resize) - -#endif /* GLX_SGIX_video_resize */ - -/* ---------------------- GLX_SGIX_visual_select_group --------------------- */ - -#ifndef GLX_SGIX_visual_select_group -#define GLX_SGIX_visual_select_group 1 - -#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028 - -#define GLXEW_SGIX_visual_select_group GLXEW_GET_VAR(__GLXEW_SGIX_visual_select_group) - -#endif /* GLX_SGIX_visual_select_group */ - -/* ---------------------------- GLX_SGI_cushion ---------------------------- */ - -#ifndef GLX_SGI_cushion -#define GLX_SGI_cushion 1 - -typedef void ( * PFNGLXCUSHIONSGIPROC) (Display* dpy, Window window, float cushion); - -#define glXCushionSGI GLXEW_GET_FUN(__glewXCushionSGI) - -#define GLXEW_SGI_cushion GLXEW_GET_VAR(__GLXEW_SGI_cushion) - -#endif /* GLX_SGI_cushion */ - -/* ----------------------- GLX_SGI_make_current_read ----------------------- */ - -#ifndef GLX_SGI_make_current_read -#define GLX_SGI_make_current_read 1 - -typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void); -typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); - -#define glXGetCurrentReadDrawableSGI GLXEW_GET_FUN(__glewXGetCurrentReadDrawableSGI) -#define glXMakeCurrentReadSGI GLXEW_GET_FUN(__glewXMakeCurrentReadSGI) - -#define GLXEW_SGI_make_current_read GLXEW_GET_VAR(__GLXEW_SGI_make_current_read) - -#endif /* GLX_SGI_make_current_read */ - -/* -------------------------- GLX_SGI_swap_control ------------------------- */ - -#ifndef GLX_SGI_swap_control -#define GLX_SGI_swap_control 1 - -typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval); - -#define glXSwapIntervalSGI GLXEW_GET_FUN(__glewXSwapIntervalSGI) - -#define GLXEW_SGI_swap_control GLXEW_GET_VAR(__GLXEW_SGI_swap_control) - -#endif /* GLX_SGI_swap_control */ - -/* --------------------------- GLX_SGI_video_sync -------------------------- */ - -#ifndef GLX_SGI_video_sync -#define GLX_SGI_video_sync 1 - -typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int* count); -typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int* count); - -#define glXGetVideoSyncSGI GLXEW_GET_FUN(__glewXGetVideoSyncSGI) -#define glXWaitVideoSyncSGI GLXEW_GET_FUN(__glewXWaitVideoSyncSGI) - -#define GLXEW_SGI_video_sync GLXEW_GET_VAR(__GLXEW_SGI_video_sync) - -#endif /* GLX_SGI_video_sync */ - -/* --------------------- GLX_SUN_get_transparent_index --------------------- */ - -#ifndef GLX_SUN_get_transparent_index -#define GLX_SUN_get_transparent_index 1 - -typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display* dpy, Window overlay, Window underlay, unsigned long *pTransparentIndex); - -#define glXGetTransparentIndexSUN GLXEW_GET_FUN(__glewXGetTransparentIndexSUN) - -#define GLXEW_SUN_get_transparent_index GLXEW_GET_VAR(__GLXEW_SUN_get_transparent_index) - -#endif /* GLX_SUN_get_transparent_index */ - -/* -------------------------- GLX_SUN_video_resize ------------------------- */ - -#ifndef GLX_SUN_video_resize -#define GLX_SUN_video_resize 1 - -#define GLX_VIDEO_RESIZE_SUN 0x8171 -#define GL_VIDEO_RESIZE_COMPENSATION_SUN 0x85CD - -typedef int ( * PFNGLXGETVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float* factor); -typedef int ( * PFNGLXVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float factor); - -#define glXGetVideoResizeSUN GLXEW_GET_FUN(__glewXGetVideoResizeSUN) -#define glXVideoResizeSUN GLXEW_GET_FUN(__glewXVideoResizeSUN) - -#define GLXEW_SUN_video_resize GLXEW_GET_VAR(__GLXEW_SUN_video_resize) - -#endif /* GLX_SUN_video_resize */ - -/* ------------------------------------------------------------------------- */ - -#ifdef GLEW_MX -#define GLXEW_FUN_EXPORT GLEW_FUN_EXPORT -#define GLXEW_VAR_EXPORT -#else -#define GLXEW_FUN_EXPORT GLEW_FUN_EXPORT -#define GLXEW_VAR_EXPORT GLEW_VAR_EXPORT -#endif /* GLEW_MX */ - -GLXEW_FUN_EXPORT PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay; - -GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig; -GLXEW_FUN_EXPORT PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext; -GLXEW_FUN_EXPORT PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer; -GLXEW_FUN_EXPORT PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap; -GLXEW_FUN_EXPORT PFNGLXCREATEWINDOWPROC __glewXCreateWindow; -GLXEW_FUN_EXPORT PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer; -GLXEW_FUN_EXPORT PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap; -GLXEW_FUN_EXPORT PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow; -GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable; -GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib; -GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs; -GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent; -GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig; -GLXEW_FUN_EXPORT PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent; -GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTPROC __glewXQueryContext; -GLXEW_FUN_EXPORT PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable; -GLXEW_FUN_EXPORT PFNGLXSELECTEVENTPROC __glewXSelectEvent; - -GLXEW_FUN_EXPORT PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC __glewXBlitContextFramebufferAMD; -GLXEW_FUN_EXPORT PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC __glewXCreateAssociatedContextAMD; -GLXEW_FUN_EXPORT PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __glewXCreateAssociatedContextAttribsAMD; -GLXEW_FUN_EXPORT PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC __glewXDeleteAssociatedContextAMD; -GLXEW_FUN_EXPORT PFNGLXGETCONTEXTGPUIDAMDPROC __glewXGetContextGPUIDAMD; -GLXEW_FUN_EXPORT PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC __glewXGetCurrentAssociatedContextAMD; -GLXEW_FUN_EXPORT PFNGLXGETGPUIDSAMDPROC __glewXGetGPUIDsAMD; -GLXEW_FUN_EXPORT PFNGLXGETGPUINFOAMDPROC __glewXGetGPUInfoAMD; -GLXEW_FUN_EXPORT PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __glewXMakeAssociatedContextCurrentAMD; - -GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB; - -GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI; -GLXEW_FUN_EXPORT PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI; -GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI; - -GLXEW_FUN_EXPORT PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT; -GLXEW_FUN_EXPORT PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT; -GLXEW_FUN_EXPORT PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT; -GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT; - -GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT; - -GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT; -GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT; - -GLXEW_FUN_EXPORT PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA; - -GLXEW_FUN_EXPORT PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA; - -GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA; - -GLXEW_FUN_EXPORT PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC __glewXQueryCurrentRendererIntegerMESA; -GLXEW_FUN_EXPORT PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC __glewXQueryCurrentRendererStringMESA; -GLXEW_FUN_EXPORT PFNGLXQUERYRENDERERINTEGERMESAPROC __glewXQueryRendererIntegerMESA; -GLXEW_FUN_EXPORT PFNGLXQUERYRENDERERSTRINGMESAPROC __glewXQueryRendererStringMESA; - -GLXEW_FUN_EXPORT PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA; - -GLXEW_FUN_EXPORT PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA; - -GLXEW_FUN_EXPORT PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA; -GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA; - -GLXEW_FUN_EXPORT PFNGLXCOPYBUFFERSUBDATANVPROC __glewXCopyBufferSubDataNV; -GLXEW_FUN_EXPORT PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC __glewXNamedCopyBufferSubDataNV; - -GLXEW_FUN_EXPORT PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV; - -GLXEW_FUN_EXPORT PFNGLXDELAYBEFORESWAPNVPROC __glewXDelayBeforeSwapNV; - -GLXEW_FUN_EXPORT PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV; -GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV; - -GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV; -GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV; -GLXEW_FUN_EXPORT PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV; -GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV; -GLXEW_FUN_EXPORT PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV; -GLXEW_FUN_EXPORT PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV; - -GLXEW_FUN_EXPORT PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV; -GLXEW_FUN_EXPORT PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV; - -GLXEW_FUN_EXPORT PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV; -GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV; -GLXEW_FUN_EXPORT PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV; -GLXEW_FUN_EXPORT PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV; -GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV; - -GLXEW_FUN_EXPORT PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV; -GLXEW_FUN_EXPORT PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV; -GLXEW_FUN_EXPORT PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV; -GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV; -GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV; -GLXEW_FUN_EXPORT PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV; - -GLXEW_FUN_EXPORT PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML; -GLXEW_FUN_EXPORT PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML; -GLXEW_FUN_EXPORT PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML; -GLXEW_FUN_EXPORT PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML; -GLXEW_FUN_EXPORT PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML; - -GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX; -GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX; -GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX; -GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX; -GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX; -GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX; - -GLXEW_FUN_EXPORT PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX; -GLXEW_FUN_EXPORT PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX; -GLXEW_FUN_EXPORT PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX; -GLXEW_FUN_EXPORT PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX; -GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX; -GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX; -GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX; -GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX; - -GLXEW_FUN_EXPORT PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX; -GLXEW_FUN_EXPORT PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX; -GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX; -GLXEW_FUN_EXPORT PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX; -GLXEW_FUN_EXPORT PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX; - -GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX; -GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX; - -GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX; - -GLXEW_FUN_EXPORT PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX; -GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX; -GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX; -GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX; -GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX; - -GLXEW_FUN_EXPORT PFNGLXCUSHIONSGIPROC __glewXCushionSGI; - -GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI; -GLXEW_FUN_EXPORT PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI; - -GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI; - -GLXEW_FUN_EXPORT PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI; -GLXEW_FUN_EXPORT PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI; - -GLXEW_FUN_EXPORT PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN; - -GLXEW_FUN_EXPORT PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN; -GLXEW_FUN_EXPORT PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN; - -#if defined(GLEW_MX) -struct GLXEWContextStruct -{ -#endif /* GLEW_MX */ - -GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_0; -GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_1; -GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_2; -GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_3; -GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_4; -GLXEW_VAR_EXPORT GLboolean __GLXEW_3DFX_multisample; -GLXEW_VAR_EXPORT GLboolean __GLXEW_AMD_gpu_association; -GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_context_flush_control; -GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context; -GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_profile; -GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_robustness; -GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_fbconfig_float; -GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_framebuffer_sRGB; -GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_get_proc_address; -GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_multisample; -GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_application_isolation; -GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_share_group_isolation; -GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_vertex_buffer_object; -GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_pixel_format_float; -GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_render_texture; -GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_buffer_age; -GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es2_profile; -GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es_profile; -GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_fbconfig_packed_float; -GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_framebuffer_sRGB; -GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_import_context; -GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_scene_marker; -GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_stereo_tree; -GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control; -GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control_tear; -GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_texture_from_pixmap; -GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_info; -GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_rating; -GLXEW_VAR_EXPORT GLboolean __GLXEW_INTEL_swap_event; -GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_agp_offset; -GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_copy_sub_buffer; -GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap; -GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_query_renderer; -GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_release_buffers; -GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode; -GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_swap_control; -GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_copy_buffer; -GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_copy_image; -GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_delay_before_swap; -GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_float_buffer; -GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_multisample_coverage; -GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_present_video; -GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_swap_group; -GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_vertex_array_range; -GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_capture; -GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_out; -GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_swap_method; -GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_sync_control; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_blended_overlay; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_color_range; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_multisample; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_shared_multisample; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_fbconfig; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_hyperpipe; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_pbuffer; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_barrier; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_group; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_video_resize; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_visual_select_group; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_cushion; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_make_current_read; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_swap_control; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_video_sync; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_get_transparent_index; -GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_video_resize; - -#ifdef GLEW_MX -}; /* GLXEWContextStruct */ -#endif /* GLEW_MX */ - -/* ------------------------------------------------------------------------ */ - -#ifdef GLEW_MX - -typedef struct GLXEWContextStruct GLXEWContext; -GLEWAPI GLenum GLEWAPIENTRY glxewContextInit (GLXEWContext *ctx); -GLEWAPI GLboolean GLEWAPIENTRY glxewContextIsSupported (const GLXEWContext *ctx, const char *name); - -#define glxewInit() glxewContextInit(glxewGetContext()) -#define glxewIsSupported(x) glxewContextIsSupported(glxewGetContext(), x) - -#define GLXEW_GET_VAR(x) (*(const GLboolean*)&(glxewGetContext()->x)) -#define GLXEW_GET_FUN(x) x - -#else /* GLEW_MX */ - -GLEWAPI GLenum GLEWAPIENTRY glxewInit (); -GLEWAPI GLboolean GLEWAPIENTRY glxewIsSupported (const char *name); - -#define GLXEW_GET_VAR(x) (*(const GLboolean*)&x) -#define GLXEW_GET_FUN(x) x - -#endif /* GLEW_MX */ - -GLEWAPI GLboolean GLEWAPIENTRY glxewGetExtension (const char *name); - -#ifdef __cplusplus -} -#endif - -#endif /* __glxew_h__ */ diff --git a/thirdparty/glew/GL/wglew.h b/thirdparty/glew/GL/wglew.h deleted file mode 100644 index 23e4d3fbab..0000000000 --- a/thirdparty/glew/GL/wglew.h +++ /dev/null @@ -1,1453 +0,0 @@ -/* -** The OpenGL Extension Wrangler Library -** Copyright (C) 2008-2015, Nigel Stewart <nigels[]users sourceforge net> -** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org> -** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org> -** Copyright (C) 2002, Lev Povalahev -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are met: -** -** * Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** * The name of the author may be used to endorse or promote products -** derived from this software without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -** THE POSSIBILITY OF SUCH DAMAGE. -*/ - -/* -** Copyright (c) 2007 The Khronos Group Inc. -** -** Permission is hereby granted, free of charge, to any person obtaining a -** copy of this software and/or associated documentation files (the -** "Materials"), to deal in the Materials without restriction, including -** without limitation the rights to use, copy, modify, merge, publish, -** distribute, sublicense, and/or sell copies of the Materials, and to -** permit persons to whom the Materials are furnished to do so, subject to -** the following conditions: -** -** The above copyright notice and this permission notice shall be included -** in all copies or substantial portions of the Materials. -** -** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. -*/ - -#ifndef __wglew_h__ -#define __wglew_h__ -#define __WGLEW_H__ - -#ifdef __wglext_h_ -#error wglext.h included before wglew.h -#endif - -#define __wglext_h_ - -#if !defined(WINAPI) -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN 1 -# endif -#include <windows.h> -# undef WIN32_LEAN_AND_MEAN -#endif - -/* - * GLEW_STATIC needs to be set when using the static version. - * GLEW_BUILD is set when building the DLL version. - */ -#ifdef GLEW_STATIC -# define GLEWAPI extern -#else -# ifdef GLEW_BUILD -# define GLEWAPI extern __declspec(dllexport) -# else -# define GLEWAPI extern __declspec(dllimport) -# endif -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* -------------------------- WGL_3DFX_multisample ------------------------- */ - -#ifndef WGL_3DFX_multisample -#define WGL_3DFX_multisample 1 - -#define WGL_SAMPLE_BUFFERS_3DFX 0x2060 -#define WGL_SAMPLES_3DFX 0x2061 - -#define WGLEW_3DFX_multisample WGLEW_GET_VAR(__WGLEW_3DFX_multisample) - -#endif /* WGL_3DFX_multisample */ - -/* ------------------------- WGL_3DL_stereo_control ------------------------ */ - -#ifndef WGL_3DL_stereo_control -#define WGL_3DL_stereo_control 1 - -#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055 -#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056 -#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057 -#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058 - -typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState); - -#define wglSetStereoEmitterState3DL WGLEW_GET_FUN(__wglewSetStereoEmitterState3DL) - -#define WGLEW_3DL_stereo_control WGLEW_GET_VAR(__WGLEW_3DL_stereo_control) - -#endif /* WGL_3DL_stereo_control */ - -/* ------------------------ WGL_AMD_gpu_association ------------------------ */ - -#ifndef WGL_AMD_gpu_association -#define WGL_AMD_gpu_association 1 - -#define WGL_GPU_VENDOR_AMD 0x1F00 -#define WGL_GPU_RENDERER_STRING_AMD 0x1F01 -#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 -#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 -#define WGL_GPU_RAM_AMD 0x21A3 -#define WGL_GPU_CLOCK_AMD 0x21A4 -#define WGL_GPU_NUM_PIPES_AMD 0x21A5 -#define WGL_GPU_NUM_SIMD_AMD 0x21A6 -#define WGL_GPU_NUM_RB_AMD 0x21A7 -#define WGL_GPU_NUM_SPI_AMD 0x21A8 - -typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); -typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id); -typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int* attribList); -typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc); -typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc); -typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); -typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT* ids); -typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, INT property, GLenum dataType, UINT size, void* data); -typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc); - -#define wglBlitContextFramebufferAMD WGLEW_GET_FUN(__wglewBlitContextFramebufferAMD) -#define wglCreateAssociatedContextAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAMD) -#define wglCreateAssociatedContextAttribsAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAttribsAMD) -#define wglDeleteAssociatedContextAMD WGLEW_GET_FUN(__wglewDeleteAssociatedContextAMD) -#define wglGetContextGPUIDAMD WGLEW_GET_FUN(__wglewGetContextGPUIDAMD) -#define wglGetCurrentAssociatedContextAMD WGLEW_GET_FUN(__wglewGetCurrentAssociatedContextAMD) -#define wglGetGPUIDsAMD WGLEW_GET_FUN(__wglewGetGPUIDsAMD) -#define wglGetGPUInfoAMD WGLEW_GET_FUN(__wglewGetGPUInfoAMD) -#define wglMakeAssociatedContextCurrentAMD WGLEW_GET_FUN(__wglewMakeAssociatedContextCurrentAMD) - -#define WGLEW_AMD_gpu_association WGLEW_GET_VAR(__WGLEW_AMD_gpu_association) - -#endif /* WGL_AMD_gpu_association */ - -/* ------------------------- WGL_ARB_buffer_region ------------------------- */ - -#ifndef WGL_ARB_buffer_region -#define WGL_ARB_buffer_region 1 - -#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001 -#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002 -#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004 -#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008 - -typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType); -typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion); -typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc); -typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height); - -#define wglCreateBufferRegionARB WGLEW_GET_FUN(__wglewCreateBufferRegionARB) -#define wglDeleteBufferRegionARB WGLEW_GET_FUN(__wglewDeleteBufferRegionARB) -#define wglRestoreBufferRegionARB WGLEW_GET_FUN(__wglewRestoreBufferRegionARB) -#define wglSaveBufferRegionARB WGLEW_GET_FUN(__wglewSaveBufferRegionARB) - -#define WGLEW_ARB_buffer_region WGLEW_GET_VAR(__WGLEW_ARB_buffer_region) - -#endif /* WGL_ARB_buffer_region */ - -/* --------------------- WGL_ARB_context_flush_control --------------------- */ - -#ifndef WGL_ARB_context_flush_control -#define WGL_ARB_context_flush_control 1 - -#define WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0x0000 -#define WGL_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097 -#define WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098 - -#define WGLEW_ARB_context_flush_control WGLEW_GET_VAR(__WGLEW_ARB_context_flush_control) - -#endif /* WGL_ARB_context_flush_control */ - -/* ------------------------- WGL_ARB_create_context ------------------------ */ - -#ifndef WGL_ARB_create_context -#define WGL_ARB_create_context 1 - -#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 -#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 -#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 -#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 -#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 -#define WGL_CONTEXT_FLAGS_ARB 0x2094 -#define ERROR_INVALID_VERSION_ARB 0x2095 -#define ERROR_INVALID_PROFILE_ARB 0x2096 - -typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int* attribList); - -#define wglCreateContextAttribsARB WGLEW_GET_FUN(__wglewCreateContextAttribsARB) - -#define WGLEW_ARB_create_context WGLEW_GET_VAR(__WGLEW_ARB_create_context) - -#endif /* WGL_ARB_create_context */ - -/* --------------------- WGL_ARB_create_context_profile -------------------- */ - -#ifndef WGL_ARB_create_context_profile -#define WGL_ARB_create_context_profile 1 - -#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 -#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 -#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 - -#define WGLEW_ARB_create_context_profile WGLEW_GET_VAR(__WGLEW_ARB_create_context_profile) - -#endif /* WGL_ARB_create_context_profile */ - -/* ------------------- WGL_ARB_create_context_robustness ------------------- */ - -#ifndef WGL_ARB_create_context_robustness -#define WGL_ARB_create_context_robustness 1 - -#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 -#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 -#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 -#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261 - -#define WGLEW_ARB_create_context_robustness WGLEW_GET_VAR(__WGLEW_ARB_create_context_robustness) - -#endif /* WGL_ARB_create_context_robustness */ - -/* ----------------------- WGL_ARB_extensions_string ----------------------- */ - -#ifndef WGL_ARB_extensions_string -#define WGL_ARB_extensions_string 1 - -typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc); - -#define wglGetExtensionsStringARB WGLEW_GET_FUN(__wglewGetExtensionsStringARB) - -#define WGLEW_ARB_extensions_string WGLEW_GET_VAR(__WGLEW_ARB_extensions_string) - -#endif /* WGL_ARB_extensions_string */ - -/* ------------------------ WGL_ARB_framebuffer_sRGB ----------------------- */ - -#ifndef WGL_ARB_framebuffer_sRGB -#define WGL_ARB_framebuffer_sRGB 1 - -#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9 - -#define WGLEW_ARB_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_ARB_framebuffer_sRGB) - -#endif /* WGL_ARB_framebuffer_sRGB */ - -/* ----------------------- WGL_ARB_make_current_read ----------------------- */ - -#ifndef WGL_ARB_make_current_read -#define WGL_ARB_make_current_read 1 - -#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043 -#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 - -typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (VOID); -typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); - -#define wglGetCurrentReadDCARB WGLEW_GET_FUN(__wglewGetCurrentReadDCARB) -#define wglMakeContextCurrentARB WGLEW_GET_FUN(__wglewMakeContextCurrentARB) - -#define WGLEW_ARB_make_current_read WGLEW_GET_VAR(__WGLEW_ARB_make_current_read) - -#endif /* WGL_ARB_make_current_read */ - -/* -------------------------- WGL_ARB_multisample -------------------------- */ - -#ifndef WGL_ARB_multisample -#define WGL_ARB_multisample 1 - -#define WGL_SAMPLE_BUFFERS_ARB 0x2041 -#define WGL_SAMPLES_ARB 0x2042 - -#define WGLEW_ARB_multisample WGLEW_GET_VAR(__WGLEW_ARB_multisample) - -#endif /* WGL_ARB_multisample */ - -/* ---------------------------- WGL_ARB_pbuffer ---------------------------- */ - -#ifndef WGL_ARB_pbuffer -#define WGL_ARB_pbuffer 1 - -#define WGL_DRAW_TO_PBUFFER_ARB 0x202D -#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E -#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F -#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030 -#define WGL_PBUFFER_LARGEST_ARB 0x2033 -#define WGL_PBUFFER_WIDTH_ARB 0x2034 -#define WGL_PBUFFER_HEIGHT_ARB 0x2035 -#define WGL_PBUFFER_LOST_ARB 0x2036 - -DECLARE_HANDLE(HPBUFFERARB); - -typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); -typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer); -typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer); -typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int* piValue); -typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC); - -#define wglCreatePbufferARB WGLEW_GET_FUN(__wglewCreatePbufferARB) -#define wglDestroyPbufferARB WGLEW_GET_FUN(__wglewDestroyPbufferARB) -#define wglGetPbufferDCARB WGLEW_GET_FUN(__wglewGetPbufferDCARB) -#define wglQueryPbufferARB WGLEW_GET_FUN(__wglewQueryPbufferARB) -#define wglReleasePbufferDCARB WGLEW_GET_FUN(__wglewReleasePbufferDCARB) - -#define WGLEW_ARB_pbuffer WGLEW_GET_VAR(__WGLEW_ARB_pbuffer) - -#endif /* WGL_ARB_pbuffer */ - -/* -------------------------- WGL_ARB_pixel_format ------------------------- */ - -#ifndef WGL_ARB_pixel_format -#define WGL_ARB_pixel_format 1 - -#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 -#define WGL_DRAW_TO_WINDOW_ARB 0x2001 -#define WGL_DRAW_TO_BITMAP_ARB 0x2002 -#define WGL_ACCELERATION_ARB 0x2003 -#define WGL_NEED_PALETTE_ARB 0x2004 -#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 -#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 -#define WGL_SWAP_METHOD_ARB 0x2007 -#define WGL_NUMBER_OVERLAYS_ARB 0x2008 -#define WGL_NUMBER_UNDERLAYS_ARB 0x2009 -#define WGL_TRANSPARENT_ARB 0x200A -#define WGL_SHARE_DEPTH_ARB 0x200C -#define WGL_SHARE_STENCIL_ARB 0x200D -#define WGL_SHARE_ACCUM_ARB 0x200E -#define WGL_SUPPORT_GDI_ARB 0x200F -#define WGL_SUPPORT_OPENGL_ARB 0x2010 -#define WGL_DOUBLE_BUFFER_ARB 0x2011 -#define WGL_STEREO_ARB 0x2012 -#define WGL_PIXEL_TYPE_ARB 0x2013 -#define WGL_COLOR_BITS_ARB 0x2014 -#define WGL_RED_BITS_ARB 0x2015 -#define WGL_RED_SHIFT_ARB 0x2016 -#define WGL_GREEN_BITS_ARB 0x2017 -#define WGL_GREEN_SHIFT_ARB 0x2018 -#define WGL_BLUE_BITS_ARB 0x2019 -#define WGL_BLUE_SHIFT_ARB 0x201A -#define WGL_ALPHA_BITS_ARB 0x201B -#define WGL_ALPHA_SHIFT_ARB 0x201C -#define WGL_ACCUM_BITS_ARB 0x201D -#define WGL_ACCUM_RED_BITS_ARB 0x201E -#define WGL_ACCUM_GREEN_BITS_ARB 0x201F -#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 -#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 -#define WGL_DEPTH_BITS_ARB 0x2022 -#define WGL_STENCIL_BITS_ARB 0x2023 -#define WGL_AUX_BUFFERS_ARB 0x2024 -#define WGL_NO_ACCELERATION_ARB 0x2025 -#define WGL_GENERIC_ACCELERATION_ARB 0x2026 -#define WGL_FULL_ACCELERATION_ARB 0x2027 -#define WGL_SWAP_EXCHANGE_ARB 0x2028 -#define WGL_SWAP_COPY_ARB 0x2029 -#define WGL_SWAP_UNDEFINED_ARB 0x202A -#define WGL_TYPE_RGBA_ARB 0x202B -#define WGL_TYPE_COLORINDEX_ARB 0x202C -#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 -#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 -#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 -#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A -#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B - -typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); -typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, FLOAT *pfValues); -typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int *piValues); - -#define wglChoosePixelFormatARB WGLEW_GET_FUN(__wglewChoosePixelFormatARB) -#define wglGetPixelFormatAttribfvARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvARB) -#define wglGetPixelFormatAttribivARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribivARB) - -#define WGLEW_ARB_pixel_format WGLEW_GET_VAR(__WGLEW_ARB_pixel_format) - -#endif /* WGL_ARB_pixel_format */ - -/* ----------------------- WGL_ARB_pixel_format_float ---------------------- */ - -#ifndef WGL_ARB_pixel_format_float -#define WGL_ARB_pixel_format_float 1 - -#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0 - -#define WGLEW_ARB_pixel_format_float WGLEW_GET_VAR(__WGLEW_ARB_pixel_format_float) - -#endif /* WGL_ARB_pixel_format_float */ - -/* ------------------------- WGL_ARB_render_texture ------------------------ */ - -#ifndef WGL_ARB_render_texture -#define WGL_ARB_render_texture 1 - -#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070 -#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071 -#define WGL_TEXTURE_FORMAT_ARB 0x2072 -#define WGL_TEXTURE_TARGET_ARB 0x2073 -#define WGL_MIPMAP_TEXTURE_ARB 0x2074 -#define WGL_TEXTURE_RGB_ARB 0x2075 -#define WGL_TEXTURE_RGBA_ARB 0x2076 -#define WGL_NO_TEXTURE_ARB 0x2077 -#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078 -#define WGL_TEXTURE_1D_ARB 0x2079 -#define WGL_TEXTURE_2D_ARB 0x207A -#define WGL_MIPMAP_LEVEL_ARB 0x207B -#define WGL_CUBE_MAP_FACE_ARB 0x207C -#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D -#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E -#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F -#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080 -#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081 -#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082 -#define WGL_FRONT_LEFT_ARB 0x2083 -#define WGL_FRONT_RIGHT_ARB 0x2084 -#define WGL_BACK_LEFT_ARB 0x2085 -#define WGL_BACK_RIGHT_ARB 0x2086 -#define WGL_AUX0_ARB 0x2087 -#define WGL_AUX1_ARB 0x2088 -#define WGL_AUX2_ARB 0x2089 -#define WGL_AUX3_ARB 0x208A -#define WGL_AUX4_ARB 0x208B -#define WGL_AUX5_ARB 0x208C -#define WGL_AUX6_ARB 0x208D -#define WGL_AUX7_ARB 0x208E -#define WGL_AUX8_ARB 0x208F -#define WGL_AUX9_ARB 0x2090 - -typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); -typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); -typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int* piAttribList); - -#define wglBindTexImageARB WGLEW_GET_FUN(__wglewBindTexImageARB) -#define wglReleaseTexImageARB WGLEW_GET_FUN(__wglewReleaseTexImageARB) -#define wglSetPbufferAttribARB WGLEW_GET_FUN(__wglewSetPbufferAttribARB) - -#define WGLEW_ARB_render_texture WGLEW_GET_VAR(__WGLEW_ARB_render_texture) - -#endif /* WGL_ARB_render_texture */ - -/* ---------------- WGL_ARB_robustness_application_isolation --------------- */ - -#ifndef WGL_ARB_robustness_application_isolation -#define WGL_ARB_robustness_application_isolation 1 - -#define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 - -#define WGLEW_ARB_robustness_application_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_application_isolation) - -#endif /* WGL_ARB_robustness_application_isolation */ - -/* ---------------- WGL_ARB_robustness_share_group_isolation --------------- */ - -#ifndef WGL_ARB_robustness_share_group_isolation -#define WGL_ARB_robustness_share_group_isolation 1 - -#define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 - -#define WGLEW_ARB_robustness_share_group_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_share_group_isolation) - -#endif /* WGL_ARB_robustness_share_group_isolation */ - -/* ----------------------- WGL_ATI_pixel_format_float ---------------------- */ - -#ifndef WGL_ATI_pixel_format_float -#define WGL_ATI_pixel_format_float 1 - -#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 -#define GL_RGBA_FLOAT_MODE_ATI 0x8820 -#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 - -#define WGLEW_ATI_pixel_format_float WGLEW_GET_VAR(__WGLEW_ATI_pixel_format_float) - -#endif /* WGL_ATI_pixel_format_float */ - -/* -------------------- WGL_ATI_render_texture_rectangle ------------------- */ - -#ifndef WGL_ATI_render_texture_rectangle -#define WGL_ATI_render_texture_rectangle 1 - -#define WGL_TEXTURE_RECTANGLE_ATI 0x21A5 - -#define WGLEW_ATI_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_ATI_render_texture_rectangle) - -#endif /* WGL_ATI_render_texture_rectangle */ - -/* ------------------- WGL_EXT_create_context_es2_profile ------------------ */ - -#ifndef WGL_EXT_create_context_es2_profile -#define WGL_EXT_create_context_es2_profile 1 - -#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 - -#define WGLEW_EXT_create_context_es2_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es2_profile) - -#endif /* WGL_EXT_create_context_es2_profile */ - -/* ------------------- WGL_EXT_create_context_es_profile ------------------- */ - -#ifndef WGL_EXT_create_context_es_profile -#define WGL_EXT_create_context_es_profile 1 - -#define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 - -#define WGLEW_EXT_create_context_es_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es_profile) - -#endif /* WGL_EXT_create_context_es_profile */ - -/* -------------------------- WGL_EXT_depth_float -------------------------- */ - -#ifndef WGL_EXT_depth_float -#define WGL_EXT_depth_float 1 - -#define WGL_DEPTH_FLOAT_EXT 0x2040 - -#define WGLEW_EXT_depth_float WGLEW_GET_VAR(__WGLEW_EXT_depth_float) - -#endif /* WGL_EXT_depth_float */ - -/* ---------------------- WGL_EXT_display_color_table ---------------------- */ - -#ifndef WGL_EXT_display_color_table -#define WGL_EXT_display_color_table 1 - -typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id); -typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id); -typedef void (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id); -typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (GLushort* table, GLuint length); - -#define wglBindDisplayColorTableEXT WGLEW_GET_FUN(__wglewBindDisplayColorTableEXT) -#define wglCreateDisplayColorTableEXT WGLEW_GET_FUN(__wglewCreateDisplayColorTableEXT) -#define wglDestroyDisplayColorTableEXT WGLEW_GET_FUN(__wglewDestroyDisplayColorTableEXT) -#define wglLoadDisplayColorTableEXT WGLEW_GET_FUN(__wglewLoadDisplayColorTableEXT) - -#define WGLEW_EXT_display_color_table WGLEW_GET_VAR(__WGLEW_EXT_display_color_table) - -#endif /* WGL_EXT_display_color_table */ - -/* ----------------------- WGL_EXT_extensions_string ----------------------- */ - -#ifndef WGL_EXT_extensions_string -#define WGL_EXT_extensions_string 1 - -typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void); - -#define wglGetExtensionsStringEXT WGLEW_GET_FUN(__wglewGetExtensionsStringEXT) - -#define WGLEW_EXT_extensions_string WGLEW_GET_VAR(__WGLEW_EXT_extensions_string) - -#endif /* WGL_EXT_extensions_string */ - -/* ------------------------ WGL_EXT_framebuffer_sRGB ----------------------- */ - -#ifndef WGL_EXT_framebuffer_sRGB -#define WGL_EXT_framebuffer_sRGB 1 - -#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9 - -#define WGLEW_EXT_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_EXT_framebuffer_sRGB) - -#endif /* WGL_EXT_framebuffer_sRGB */ - -/* ----------------------- WGL_EXT_make_current_read ----------------------- */ - -#ifndef WGL_EXT_make_current_read -#define WGL_EXT_make_current_read 1 - -#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043 - -typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (VOID); -typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); - -#define wglGetCurrentReadDCEXT WGLEW_GET_FUN(__wglewGetCurrentReadDCEXT) -#define wglMakeContextCurrentEXT WGLEW_GET_FUN(__wglewMakeContextCurrentEXT) - -#define WGLEW_EXT_make_current_read WGLEW_GET_VAR(__WGLEW_EXT_make_current_read) - -#endif /* WGL_EXT_make_current_read */ - -/* -------------------------- WGL_EXT_multisample -------------------------- */ - -#ifndef WGL_EXT_multisample -#define WGL_EXT_multisample 1 - -#define WGL_SAMPLE_BUFFERS_EXT 0x2041 -#define WGL_SAMPLES_EXT 0x2042 - -#define WGLEW_EXT_multisample WGLEW_GET_VAR(__WGLEW_EXT_multisample) - -#endif /* WGL_EXT_multisample */ - -/* ---------------------------- WGL_EXT_pbuffer ---------------------------- */ - -#ifndef WGL_EXT_pbuffer -#define WGL_EXT_pbuffer 1 - -#define WGL_DRAW_TO_PBUFFER_EXT 0x202D -#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E -#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F -#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030 -#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031 -#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032 -#define WGL_PBUFFER_LARGEST_EXT 0x2033 -#define WGL_PBUFFER_WIDTH_EXT 0x2034 -#define WGL_PBUFFER_HEIGHT_EXT 0x2035 - -DECLARE_HANDLE(HPBUFFEREXT); - -typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); -typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer); -typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer); -typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int* piValue); -typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC); - -#define wglCreatePbufferEXT WGLEW_GET_FUN(__wglewCreatePbufferEXT) -#define wglDestroyPbufferEXT WGLEW_GET_FUN(__wglewDestroyPbufferEXT) -#define wglGetPbufferDCEXT WGLEW_GET_FUN(__wglewGetPbufferDCEXT) -#define wglQueryPbufferEXT WGLEW_GET_FUN(__wglewQueryPbufferEXT) -#define wglReleasePbufferDCEXT WGLEW_GET_FUN(__wglewReleasePbufferDCEXT) - -#define WGLEW_EXT_pbuffer WGLEW_GET_VAR(__WGLEW_EXT_pbuffer) - -#endif /* WGL_EXT_pbuffer */ - -/* -------------------------- WGL_EXT_pixel_format ------------------------- */ - -#ifndef WGL_EXT_pixel_format -#define WGL_EXT_pixel_format 1 - -#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000 -#define WGL_DRAW_TO_WINDOW_EXT 0x2001 -#define WGL_DRAW_TO_BITMAP_EXT 0x2002 -#define WGL_ACCELERATION_EXT 0x2003 -#define WGL_NEED_PALETTE_EXT 0x2004 -#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005 -#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006 -#define WGL_SWAP_METHOD_EXT 0x2007 -#define WGL_NUMBER_OVERLAYS_EXT 0x2008 -#define WGL_NUMBER_UNDERLAYS_EXT 0x2009 -#define WGL_TRANSPARENT_EXT 0x200A -#define WGL_TRANSPARENT_VALUE_EXT 0x200B -#define WGL_SHARE_DEPTH_EXT 0x200C -#define WGL_SHARE_STENCIL_EXT 0x200D -#define WGL_SHARE_ACCUM_EXT 0x200E -#define WGL_SUPPORT_GDI_EXT 0x200F -#define WGL_SUPPORT_OPENGL_EXT 0x2010 -#define WGL_DOUBLE_BUFFER_EXT 0x2011 -#define WGL_STEREO_EXT 0x2012 -#define WGL_PIXEL_TYPE_EXT 0x2013 -#define WGL_COLOR_BITS_EXT 0x2014 -#define WGL_RED_BITS_EXT 0x2015 -#define WGL_RED_SHIFT_EXT 0x2016 -#define WGL_GREEN_BITS_EXT 0x2017 -#define WGL_GREEN_SHIFT_EXT 0x2018 -#define WGL_BLUE_BITS_EXT 0x2019 -#define WGL_BLUE_SHIFT_EXT 0x201A -#define WGL_ALPHA_BITS_EXT 0x201B -#define WGL_ALPHA_SHIFT_EXT 0x201C -#define WGL_ACCUM_BITS_EXT 0x201D -#define WGL_ACCUM_RED_BITS_EXT 0x201E -#define WGL_ACCUM_GREEN_BITS_EXT 0x201F -#define WGL_ACCUM_BLUE_BITS_EXT 0x2020 -#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021 -#define WGL_DEPTH_BITS_EXT 0x2022 -#define WGL_STENCIL_BITS_EXT 0x2023 -#define WGL_AUX_BUFFERS_EXT 0x2024 -#define WGL_NO_ACCELERATION_EXT 0x2025 -#define WGL_GENERIC_ACCELERATION_EXT 0x2026 -#define WGL_FULL_ACCELERATION_EXT 0x2027 -#define WGL_SWAP_EXCHANGE_EXT 0x2028 -#define WGL_SWAP_COPY_EXT 0x2029 -#define WGL_SWAP_UNDEFINED_EXT 0x202A -#define WGL_TYPE_RGBA_EXT 0x202B -#define WGL_TYPE_COLORINDEX_EXT 0x202C - -typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); -typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, FLOAT *pfValues); -typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, int *piValues); - -#define wglChoosePixelFormatEXT WGLEW_GET_FUN(__wglewChoosePixelFormatEXT) -#define wglGetPixelFormatAttribfvEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvEXT) -#define wglGetPixelFormatAttribivEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribivEXT) - -#define WGLEW_EXT_pixel_format WGLEW_GET_VAR(__WGLEW_EXT_pixel_format) - -#endif /* WGL_EXT_pixel_format */ - -/* ------------------- WGL_EXT_pixel_format_packed_float ------------------- */ - -#ifndef WGL_EXT_pixel_format_packed_float -#define WGL_EXT_pixel_format_packed_float 1 - -#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8 - -#define WGLEW_EXT_pixel_format_packed_float WGLEW_GET_VAR(__WGLEW_EXT_pixel_format_packed_float) - -#endif /* WGL_EXT_pixel_format_packed_float */ - -/* -------------------------- WGL_EXT_swap_control ------------------------- */ - -#ifndef WGL_EXT_swap_control -#define WGL_EXT_swap_control 1 - -typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void); -typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval); - -#define wglGetSwapIntervalEXT WGLEW_GET_FUN(__wglewGetSwapIntervalEXT) -#define wglSwapIntervalEXT WGLEW_GET_FUN(__wglewSwapIntervalEXT) - -#define WGLEW_EXT_swap_control WGLEW_GET_VAR(__WGLEW_EXT_swap_control) - -#endif /* WGL_EXT_swap_control */ - -/* ----------------------- WGL_EXT_swap_control_tear ----------------------- */ - -#ifndef WGL_EXT_swap_control_tear -#define WGL_EXT_swap_control_tear 1 - -#define WGLEW_EXT_swap_control_tear WGLEW_GET_VAR(__WGLEW_EXT_swap_control_tear) - -#endif /* WGL_EXT_swap_control_tear */ - -/* --------------------- WGL_I3D_digital_video_control --------------------- */ - -#ifndef WGL_I3D_digital_video_control -#define WGL_I3D_digital_video_control 1 - -#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050 -#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051 -#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052 -#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053 - -typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); -typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); - -#define wglGetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewGetDigitalVideoParametersI3D) -#define wglSetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewSetDigitalVideoParametersI3D) - -#define WGLEW_I3D_digital_video_control WGLEW_GET_VAR(__WGLEW_I3D_digital_video_control) - -#endif /* WGL_I3D_digital_video_control */ - -/* ----------------------------- WGL_I3D_gamma ----------------------------- */ - -#ifndef WGL_I3D_gamma -#define WGL_I3D_gamma 1 - -#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E -#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F - -typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT* puRed, USHORT *puGreen, USHORT *puBlue); -typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); -typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT* puRed, const USHORT *puGreen, const USHORT *puBlue); -typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); - -#define wglGetGammaTableI3D WGLEW_GET_FUN(__wglewGetGammaTableI3D) -#define wglGetGammaTableParametersI3D WGLEW_GET_FUN(__wglewGetGammaTableParametersI3D) -#define wglSetGammaTableI3D WGLEW_GET_FUN(__wglewSetGammaTableI3D) -#define wglSetGammaTableParametersI3D WGLEW_GET_FUN(__wglewSetGammaTableParametersI3D) - -#define WGLEW_I3D_gamma WGLEW_GET_VAR(__WGLEW_I3D_gamma) - -#endif /* WGL_I3D_gamma */ - -/* ---------------------------- WGL_I3D_genlock ---------------------------- */ - -#ifndef WGL_I3D_genlock -#define WGL_I3D_genlock 1 - -#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044 -#define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045 -#define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046 -#define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047 -#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048 -#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049 -#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A -#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B -#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C - -typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC); -typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC); -typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate); -typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay); -typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge); -typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource); -typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT* uRate); -typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT* uDelay); -typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT* uEdge); -typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT* uSource); -typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL* pFlag); -typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT* uMaxLineDelay, UINT *uMaxPixelDelay); - -#define wglDisableGenlockI3D WGLEW_GET_FUN(__wglewDisableGenlockI3D) -#define wglEnableGenlockI3D WGLEW_GET_FUN(__wglewEnableGenlockI3D) -#define wglGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGenlockSampleRateI3D) -#define wglGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGenlockSourceDelayI3D) -#define wglGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGenlockSourceEdgeI3D) -#define wglGenlockSourceI3D WGLEW_GET_FUN(__wglewGenlockSourceI3D) -#define wglGetGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGetGenlockSampleRateI3D) -#define wglGetGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGetGenlockSourceDelayI3D) -#define wglGetGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGetGenlockSourceEdgeI3D) -#define wglGetGenlockSourceI3D WGLEW_GET_FUN(__wglewGetGenlockSourceI3D) -#define wglIsEnabledGenlockI3D WGLEW_GET_FUN(__wglewIsEnabledGenlockI3D) -#define wglQueryGenlockMaxSourceDelayI3D WGLEW_GET_FUN(__wglewQueryGenlockMaxSourceDelayI3D) - -#define WGLEW_I3D_genlock WGLEW_GET_VAR(__WGLEW_I3D_genlock) - -#endif /* WGL_I3D_genlock */ - -/* -------------------------- WGL_I3D_image_buffer ------------------------- */ - -#ifndef WGL_I3D_image_buffer -#define WGL_I3D_image_buffer 1 - -#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001 -#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002 - -typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, HANDLE* pEvent, LPVOID *pAddress, DWORD *pSize, UINT count); -typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags); -typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress); -typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, LPVOID* pAddress, UINT count); - -#define wglAssociateImageBufferEventsI3D WGLEW_GET_FUN(__wglewAssociateImageBufferEventsI3D) -#define wglCreateImageBufferI3D WGLEW_GET_FUN(__wglewCreateImageBufferI3D) -#define wglDestroyImageBufferI3D WGLEW_GET_FUN(__wglewDestroyImageBufferI3D) -#define wglReleaseImageBufferEventsI3D WGLEW_GET_FUN(__wglewReleaseImageBufferEventsI3D) - -#define WGLEW_I3D_image_buffer WGLEW_GET_VAR(__WGLEW_I3D_image_buffer) - -#endif /* WGL_I3D_image_buffer */ - -/* ------------------------ WGL_I3D_swap_frame_lock ------------------------ */ - -#ifndef WGL_I3D_swap_frame_lock -#define WGL_I3D_swap_frame_lock 1 - -typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (VOID); -typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (VOID); -typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL* pFlag); -typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL* pFlag); - -#define wglDisableFrameLockI3D WGLEW_GET_FUN(__wglewDisableFrameLockI3D) -#define wglEnableFrameLockI3D WGLEW_GET_FUN(__wglewEnableFrameLockI3D) -#define wglIsEnabledFrameLockI3D WGLEW_GET_FUN(__wglewIsEnabledFrameLockI3D) -#define wglQueryFrameLockMasterI3D WGLEW_GET_FUN(__wglewQueryFrameLockMasterI3D) - -#define WGLEW_I3D_swap_frame_lock WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_lock) - -#endif /* WGL_I3D_swap_frame_lock */ - -/* ------------------------ WGL_I3D_swap_frame_usage ----------------------- */ - -#ifndef WGL_I3D_swap_frame_usage -#define WGL_I3D_swap_frame_usage 1 - -typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void); -typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void); -typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float* pUsage); -typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage); - -#define wglBeginFrameTrackingI3D WGLEW_GET_FUN(__wglewBeginFrameTrackingI3D) -#define wglEndFrameTrackingI3D WGLEW_GET_FUN(__wglewEndFrameTrackingI3D) -#define wglGetFrameUsageI3D WGLEW_GET_FUN(__wglewGetFrameUsageI3D) -#define wglQueryFrameTrackingI3D WGLEW_GET_FUN(__wglewQueryFrameTrackingI3D) - -#define WGLEW_I3D_swap_frame_usage WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_usage) - -#endif /* WGL_I3D_swap_frame_usage */ - -/* --------------------------- WGL_NV_DX_interop --------------------------- */ - -#ifndef WGL_NV_DX_interop -#define WGL_NV_DX_interop 1 - -#define WGL_ACCESS_READ_ONLY_NV 0x0000 -#define WGL_ACCESS_READ_WRITE_NV 0x0001 -#define WGL_ACCESS_WRITE_DISCARD_NV 0x0002 - -typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice); -typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); -typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access); -typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void* dxDevice); -typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void* dxObject, GLuint name, GLenum type, GLenum access); -typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void* dxObject, HANDLE shareHandle); -typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); -typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject); - -#define wglDXCloseDeviceNV WGLEW_GET_FUN(__wglewDXCloseDeviceNV) -#define wglDXLockObjectsNV WGLEW_GET_FUN(__wglewDXLockObjectsNV) -#define wglDXObjectAccessNV WGLEW_GET_FUN(__wglewDXObjectAccessNV) -#define wglDXOpenDeviceNV WGLEW_GET_FUN(__wglewDXOpenDeviceNV) -#define wglDXRegisterObjectNV WGLEW_GET_FUN(__wglewDXRegisterObjectNV) -#define wglDXSetResourceShareHandleNV WGLEW_GET_FUN(__wglewDXSetResourceShareHandleNV) -#define wglDXUnlockObjectsNV WGLEW_GET_FUN(__wglewDXUnlockObjectsNV) -#define wglDXUnregisterObjectNV WGLEW_GET_FUN(__wglewDXUnregisterObjectNV) - -#define WGLEW_NV_DX_interop WGLEW_GET_VAR(__WGLEW_NV_DX_interop) - -#endif /* WGL_NV_DX_interop */ - -/* --------------------------- WGL_NV_DX_interop2 -------------------------- */ - -#ifndef WGL_NV_DX_interop2 -#define WGL_NV_DX_interop2 1 - -#define WGLEW_NV_DX_interop2 WGLEW_GET_VAR(__WGLEW_NV_DX_interop2) - -#endif /* WGL_NV_DX_interop2 */ - -/* --------------------------- WGL_NV_copy_image --------------------------- */ - -#ifndef WGL_NV_copy_image -#define WGL_NV_copy_image 1 - -typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); - -#define wglCopyImageSubDataNV WGLEW_GET_FUN(__wglewCopyImageSubDataNV) - -#define WGLEW_NV_copy_image WGLEW_GET_VAR(__WGLEW_NV_copy_image) - -#endif /* WGL_NV_copy_image */ - -/* ------------------------ WGL_NV_delay_before_swap ----------------------- */ - -#ifndef WGL_NV_delay_before_swap -#define WGL_NV_delay_before_swap 1 - -typedef BOOL (WINAPI * PFNWGLDELAYBEFORESWAPNVPROC) (HDC hDC, GLfloat seconds); - -#define wglDelayBeforeSwapNV WGLEW_GET_FUN(__wglewDelayBeforeSwapNV) - -#define WGLEW_NV_delay_before_swap WGLEW_GET_VAR(__WGLEW_NV_delay_before_swap) - -#endif /* WGL_NV_delay_before_swap */ - -/* -------------------------- WGL_NV_float_buffer -------------------------- */ - -#ifndef WGL_NV_float_buffer -#define WGL_NV_float_buffer 1 - -#define WGL_FLOAT_COMPONENTS_NV 0x20B0 -#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1 -#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2 -#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3 -#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4 -#define WGL_TEXTURE_FLOAT_R_NV 0x20B5 -#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6 -#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7 -#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8 - -#define WGLEW_NV_float_buffer WGLEW_GET_VAR(__WGLEW_NV_float_buffer) - -#endif /* WGL_NV_float_buffer */ - -/* -------------------------- WGL_NV_gpu_affinity -------------------------- */ - -#ifndef WGL_NV_gpu_affinity -#define WGL_NV_gpu_affinity 1 - -#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0 -#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1 - -DECLARE_HANDLE(HGPUNV); -typedef struct _GPU_DEVICE { - DWORD cb; - CHAR DeviceName[32]; - CHAR DeviceString[128]; - DWORD Flags; - RECT rcVirtualScreen; -} GPU_DEVICE, *PGPU_DEVICE; - -typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList); -typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc); -typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice); -typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu); -typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu); - -#define wglCreateAffinityDCNV WGLEW_GET_FUN(__wglewCreateAffinityDCNV) -#define wglDeleteDCNV WGLEW_GET_FUN(__wglewDeleteDCNV) -#define wglEnumGpuDevicesNV WGLEW_GET_FUN(__wglewEnumGpuDevicesNV) -#define wglEnumGpusFromAffinityDCNV WGLEW_GET_FUN(__wglewEnumGpusFromAffinityDCNV) -#define wglEnumGpusNV WGLEW_GET_FUN(__wglewEnumGpusNV) - -#define WGLEW_NV_gpu_affinity WGLEW_GET_VAR(__WGLEW_NV_gpu_affinity) - -#endif /* WGL_NV_gpu_affinity */ - -/* ---------------------- WGL_NV_multisample_coverage ---------------------- */ - -#ifndef WGL_NV_multisample_coverage -#define WGL_NV_multisample_coverage 1 - -#define WGL_COVERAGE_SAMPLES_NV 0x2042 -#define WGL_COLOR_SAMPLES_NV 0x20B9 - -#define WGLEW_NV_multisample_coverage WGLEW_GET_VAR(__WGLEW_NV_multisample_coverage) - -#endif /* WGL_NV_multisample_coverage */ - -/* -------------------------- WGL_NV_present_video ------------------------- */ - -#ifndef WGL_NV_present_video -#define WGL_NV_present_video 1 - -#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0 - -DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV); - -typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int* piAttribList); -typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDc, HVIDEOOUTPUTDEVICENV* phDeviceList); -typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int* piValue); - -#define wglBindVideoDeviceNV WGLEW_GET_FUN(__wglewBindVideoDeviceNV) -#define wglEnumerateVideoDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoDevicesNV) -#define wglQueryCurrentContextNV WGLEW_GET_FUN(__wglewQueryCurrentContextNV) - -#define WGLEW_NV_present_video WGLEW_GET_VAR(__WGLEW_NV_present_video) - -#endif /* WGL_NV_present_video */ - -/* ---------------------- WGL_NV_render_depth_texture ---------------------- */ - -#ifndef WGL_NV_render_depth_texture -#define WGL_NV_render_depth_texture 1 - -#define WGL_NO_TEXTURE_ARB 0x2077 -#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3 -#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4 -#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5 -#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6 -#define WGL_DEPTH_COMPONENT_NV 0x20A7 - -#define WGLEW_NV_render_depth_texture WGLEW_GET_VAR(__WGLEW_NV_render_depth_texture) - -#endif /* WGL_NV_render_depth_texture */ - -/* -------------------- WGL_NV_render_texture_rectangle -------------------- */ - -#ifndef WGL_NV_render_texture_rectangle -#define WGL_NV_render_texture_rectangle 1 - -#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0 -#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1 -#define WGL_TEXTURE_RECTANGLE_NV 0x20A2 - -#define WGLEW_NV_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_NV_render_texture_rectangle) - -#endif /* WGL_NV_render_texture_rectangle */ - -/* --------------------------- WGL_NV_swap_group --------------------------- */ - -#ifndef WGL_NV_swap_group -#define WGL_NV_swap_group 1 - -typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier); -typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group); -typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint* count); -typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint* maxGroups, GLuint *maxBarriers); -typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint* group, GLuint *barrier); -typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC); - -#define wglBindSwapBarrierNV WGLEW_GET_FUN(__wglewBindSwapBarrierNV) -#define wglJoinSwapGroupNV WGLEW_GET_FUN(__wglewJoinSwapGroupNV) -#define wglQueryFrameCountNV WGLEW_GET_FUN(__wglewQueryFrameCountNV) -#define wglQueryMaxSwapGroupsNV WGLEW_GET_FUN(__wglewQueryMaxSwapGroupsNV) -#define wglQuerySwapGroupNV WGLEW_GET_FUN(__wglewQuerySwapGroupNV) -#define wglResetFrameCountNV WGLEW_GET_FUN(__wglewResetFrameCountNV) - -#define WGLEW_NV_swap_group WGLEW_GET_VAR(__WGLEW_NV_swap_group) - -#endif /* WGL_NV_swap_group */ - -/* ----------------------- WGL_NV_vertex_array_range ----------------------- */ - -#ifndef WGL_NV_vertex_array_range -#define WGL_NV_vertex_array_range 1 - -typedef void * (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); -typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer); - -#define wglAllocateMemoryNV WGLEW_GET_FUN(__wglewAllocateMemoryNV) -#define wglFreeMemoryNV WGLEW_GET_FUN(__wglewFreeMemoryNV) - -#define WGLEW_NV_vertex_array_range WGLEW_GET_VAR(__WGLEW_NV_vertex_array_range) - -#endif /* WGL_NV_vertex_array_range */ - -/* -------------------------- WGL_NV_video_capture ------------------------- */ - -#ifndef WGL_NV_video_capture -#define WGL_NV_video_capture 1 - -#define WGL_UNIQUE_ID_NV 0x20CE -#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF - -DECLARE_HANDLE(HVIDEOINPUTDEVICENV); - -typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice); -typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV* phDeviceList); -typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); -typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int* piValue); -typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); - -#define wglBindVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewBindVideoCaptureDeviceNV) -#define wglEnumerateVideoCaptureDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoCaptureDevicesNV) -#define wglLockVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewLockVideoCaptureDeviceNV) -#define wglQueryVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewQueryVideoCaptureDeviceNV) -#define wglReleaseVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoCaptureDeviceNV) - -#define WGLEW_NV_video_capture WGLEW_GET_VAR(__WGLEW_NV_video_capture) - -#endif /* WGL_NV_video_capture */ - -/* -------------------------- WGL_NV_video_output -------------------------- */ - -#ifndef WGL_NV_video_output -#define WGL_NV_video_output 1 - -#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0 -#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1 -#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2 -#define WGL_VIDEO_OUT_COLOR_NV 0x20C3 -#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4 -#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5 -#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 -#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 -#define WGL_VIDEO_OUT_FRAME 0x20C8 -#define WGL_VIDEO_OUT_FIELD_1 0x20C9 -#define WGL_VIDEO_OUT_FIELD_2 0x20CA -#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB -#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC - -DECLARE_HANDLE(HPVIDEODEV); - -typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer); -typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV* hVideoDevice); -typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long* pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); -typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice); -typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer); -typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long* pulCounterPbuffer, BOOL bBlock); - -#define wglBindVideoImageNV WGLEW_GET_FUN(__wglewBindVideoImageNV) -#define wglGetVideoDeviceNV WGLEW_GET_FUN(__wglewGetVideoDeviceNV) -#define wglGetVideoInfoNV WGLEW_GET_FUN(__wglewGetVideoInfoNV) -#define wglReleaseVideoDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoDeviceNV) -#define wglReleaseVideoImageNV WGLEW_GET_FUN(__wglewReleaseVideoImageNV) -#define wglSendPbufferToVideoNV WGLEW_GET_FUN(__wglewSendPbufferToVideoNV) - -#define WGLEW_NV_video_output WGLEW_GET_VAR(__WGLEW_NV_video_output) - -#endif /* WGL_NV_video_output */ - -/* -------------------------- WGL_OML_sync_control ------------------------- */ - -#ifndef WGL_OML_sync_control -#define WGL_OML_sync_control 1 - -typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32* numerator, INT32 *denominator); -typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64* ust, INT64 *msc, INT64 *sbc); -typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); -typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); -typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64* ust, INT64 *msc, INT64 *sbc); -typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64* ust, INT64 *msc, INT64 *sbc); - -#define wglGetMscRateOML WGLEW_GET_FUN(__wglewGetMscRateOML) -#define wglGetSyncValuesOML WGLEW_GET_FUN(__wglewGetSyncValuesOML) -#define wglSwapBuffersMscOML WGLEW_GET_FUN(__wglewSwapBuffersMscOML) -#define wglSwapLayerBuffersMscOML WGLEW_GET_FUN(__wglewSwapLayerBuffersMscOML) -#define wglWaitForMscOML WGLEW_GET_FUN(__wglewWaitForMscOML) -#define wglWaitForSbcOML WGLEW_GET_FUN(__wglewWaitForSbcOML) - -#define WGLEW_OML_sync_control WGLEW_GET_VAR(__WGLEW_OML_sync_control) - -#endif /* WGL_OML_sync_control */ - -/* ------------------------------------------------------------------------- */ - -#ifdef GLEW_MX -#define WGLEW_FUN_EXPORT -#define WGLEW_VAR_EXPORT -#else -#define WGLEW_FUN_EXPORT GLEW_FUN_EXPORT -#define WGLEW_VAR_EXPORT GLEW_VAR_EXPORT -#endif /* GLEW_MX */ - -#ifdef GLEW_MX -struct WGLEWContextStruct -{ -#endif /* GLEW_MX */ - -WGLEW_FUN_EXPORT PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL; - -WGLEW_FUN_EXPORT PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD; -WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD; -WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD; -WGLEW_FUN_EXPORT PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD; -WGLEW_FUN_EXPORT PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD; -WGLEW_FUN_EXPORT PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD; -WGLEW_FUN_EXPORT PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD; -WGLEW_FUN_EXPORT PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD; -WGLEW_FUN_EXPORT PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD; - -WGLEW_FUN_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB; -WGLEW_FUN_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB; -WGLEW_FUN_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB; -WGLEW_FUN_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB; - -WGLEW_FUN_EXPORT PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB; - -WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB; - -WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB; -WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB; - -WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB; -WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB; -WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB; -WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB; -WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB; - -WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB; -WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB; -WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB; - -WGLEW_FUN_EXPORT PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB; -WGLEW_FUN_EXPORT PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB; -WGLEW_FUN_EXPORT PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB; - -WGLEW_FUN_EXPORT PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT; -WGLEW_FUN_EXPORT PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT; -WGLEW_FUN_EXPORT PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT; -WGLEW_FUN_EXPORT PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT; - -WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT; - -WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT; -WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT; - -WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT; -WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT; -WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT; -WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT; -WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT; - -WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT; -WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT; -WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT; - -WGLEW_FUN_EXPORT PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT; -WGLEW_FUN_EXPORT PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT; - -WGLEW_FUN_EXPORT PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D; -WGLEW_FUN_EXPORT PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D; - -WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D; -WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D; -WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D; -WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D; - -WGLEW_FUN_EXPORT PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D; -WGLEW_FUN_EXPORT PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D; -WGLEW_FUN_EXPORT PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D; -WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D; -WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D; -WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D; -WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D; -WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D; -WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D; -WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D; -WGLEW_FUN_EXPORT PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D; -WGLEW_FUN_EXPORT PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D; - -WGLEW_FUN_EXPORT PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D; -WGLEW_FUN_EXPORT PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D; -WGLEW_FUN_EXPORT PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D; -WGLEW_FUN_EXPORT PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D; - -WGLEW_FUN_EXPORT PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D; -WGLEW_FUN_EXPORT PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D; -WGLEW_FUN_EXPORT PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D; -WGLEW_FUN_EXPORT PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D; - -WGLEW_FUN_EXPORT PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D; -WGLEW_FUN_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D; -WGLEW_FUN_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D; -WGLEW_FUN_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D; - -WGLEW_FUN_EXPORT PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV; -WGLEW_FUN_EXPORT PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV; -WGLEW_FUN_EXPORT PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV; -WGLEW_FUN_EXPORT PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV; -WGLEW_FUN_EXPORT PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV; -WGLEW_FUN_EXPORT PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV; -WGLEW_FUN_EXPORT PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV; -WGLEW_FUN_EXPORT PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV; - -WGLEW_FUN_EXPORT PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV; - -WGLEW_FUN_EXPORT PFNWGLDELAYBEFORESWAPNVPROC __wglewDelayBeforeSwapNV; - -WGLEW_FUN_EXPORT PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV; -WGLEW_FUN_EXPORT PFNWGLDELETEDCNVPROC __wglewDeleteDCNV; -WGLEW_FUN_EXPORT PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV; -WGLEW_FUN_EXPORT PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV; -WGLEW_FUN_EXPORT PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV; - -WGLEW_FUN_EXPORT PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV; -WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV; -WGLEW_FUN_EXPORT PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV; - -WGLEW_FUN_EXPORT PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV; -WGLEW_FUN_EXPORT PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV; -WGLEW_FUN_EXPORT PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV; -WGLEW_FUN_EXPORT PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV; -WGLEW_FUN_EXPORT PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV; -WGLEW_FUN_EXPORT PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV; - -WGLEW_FUN_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV; -WGLEW_FUN_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV; - -WGLEW_FUN_EXPORT PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV; -WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV; -WGLEW_FUN_EXPORT PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV; -WGLEW_FUN_EXPORT PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV; -WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV; - -WGLEW_FUN_EXPORT PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV; -WGLEW_FUN_EXPORT PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV; -WGLEW_FUN_EXPORT PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV; -WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV; -WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV; -WGLEW_FUN_EXPORT PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV; - -WGLEW_FUN_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML; -WGLEW_FUN_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML; -WGLEW_FUN_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML; -WGLEW_FUN_EXPORT PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML; -WGLEW_FUN_EXPORT PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML; -WGLEW_FUN_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML; -WGLEW_VAR_EXPORT GLboolean __WGLEW_3DFX_multisample; -WGLEW_VAR_EXPORT GLboolean __WGLEW_3DL_stereo_control; -WGLEW_VAR_EXPORT GLboolean __WGLEW_AMD_gpu_association; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_buffer_region; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_context_flush_control; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_profile; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_robustness; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_extensions_string; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_framebuffer_sRGB; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_make_current_read; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_multisample; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pbuffer; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format_float; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_render_texture; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_application_isolation; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_share_group_isolation; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_pixel_format_float; -WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es2_profile; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es_profile; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_depth_float; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_display_color_table; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_extensions_string; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_framebuffer_sRGB; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_make_current_read; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_multisample; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pbuffer; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format_packed_float; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control; -WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control_tear; -WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_digital_video_control; -WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_gamma; -WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_genlock; -WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_image_buffer; -WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock; -WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop2; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_copy_image; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_delay_before_swap; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_float_buffer; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_gpu_affinity; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_multisample_coverage; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_present_video; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_depth_texture; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_swap_group; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_vertex_array_range; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_capture; -WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_output; -WGLEW_VAR_EXPORT GLboolean __WGLEW_OML_sync_control; - -#ifdef GLEW_MX -}; /* WGLEWContextStruct */ -#endif /* GLEW_MX */ - -/* ------------------------------------------------------------------------- */ - -#ifdef GLEW_MX - -typedef struct WGLEWContextStruct WGLEWContext; -GLEWAPI GLenum GLEWAPIENTRY wglewContextInit (WGLEWContext *ctx); -GLEWAPI GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext *ctx, const char *name); - -#define wglewInit() wglewContextInit(wglewGetContext()) -#define wglewIsSupported(x) wglewContextIsSupported(wglewGetContext(), x) - -#define WGLEW_GET_VAR(x) (*(const GLboolean*)&(wglewGetContext()->x)) -#define WGLEW_GET_FUN(x) wglewGetContext()->x - -#else /* GLEW_MX */ - -GLEWAPI GLenum GLEWAPIENTRY wglewInit (); -GLEWAPI GLboolean GLEWAPIENTRY wglewIsSupported (const char *name); - -#define WGLEW_GET_VAR(x) (*(const GLboolean*)&x) -#define WGLEW_GET_FUN(x) x - -#endif /* GLEW_MX */ - -GLEWAPI GLboolean GLEWAPIENTRY wglewGetExtension (const char *name); - -#ifdef __cplusplus -} -#endif - -#undef GLEWAPI - -#endif /* __wglew_h__ */ diff --git a/thirdparty/glew/LICENSE.txt b/thirdparty/glew/LICENSE.txt deleted file mode 100644 index f7078042e9..0000000000 --- a/thirdparty/glew/LICENSE.txt +++ /dev/null @@ -1,73 +0,0 @@ -The OpenGL Extension Wrangler Library -Copyright (C) 2002-2007, Milan Ikits <milan ikits[]ieee org> -Copyright (C) 2002-2007, Marcelo E. Magallon <mmagallo[]debian org> -Copyright (C) 2002, Lev Povalahev -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -* The name of the author may be used to endorse or promote products - derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. - - -Mesa 3-D graphics library -Version: 7.0 - -Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -Copyright (c) 2007 The Khronos Group Inc. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and/or associated documentation files (the -"Materials"), to deal in the Materials without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Materials, and to -permit persons to whom the Materials are furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Materials. - -THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. diff --git a/thirdparty/glew/glew.c b/thirdparty/glew/glew.c deleted file mode 100644 index 0ed5520dae..0000000000 --- a/thirdparty/glew/glew.c +++ /dev/null @@ -1,18607 +0,0 @@ -/* -** The OpenGL Extension Wrangler Library -** Copyright (C) 2008-2015, Nigel Stewart <nigels[]users sourceforge net> -** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org> -** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org> -** Copyright (C) 2002, Lev Povalahev -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are met: -** -** * Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** * The name of the author may be used to endorse or promote products -** derived from this software without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -** THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include <GL/glew.h> - -#if defined(_WIN32) -# include <GL/wglew.h> -#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) -# include <GL/glxew.h> -#endif - -#include <stddef.h> /* For size_t */ - -/* - * Define glewGetContext and related helper macros. - */ -#ifdef GLEW_MX -# define glewGetContext() ctx -# ifdef _WIN32 -# define GLEW_CONTEXT_ARG_DEF_INIT GLEWContext* ctx -# define GLEW_CONTEXT_ARG_VAR_INIT ctx -# define wglewGetContext() ctx -# define WGLEW_CONTEXT_ARG_DEF_INIT WGLEWContext* ctx -# define WGLEW_CONTEXT_ARG_DEF_LIST WGLEWContext* ctx -# else /* _WIN32 */ -# define GLEW_CONTEXT_ARG_DEF_INIT void -# define GLEW_CONTEXT_ARG_VAR_INIT -# define glxewGetContext() ctx -# define GLXEW_CONTEXT_ARG_DEF_INIT void -# define GLXEW_CONTEXT_ARG_DEF_LIST GLXEWContext* ctx -# endif /* _WIN32 */ -# define GLEW_CONTEXT_ARG_DEF_LIST GLEWContext* ctx -#else /* GLEW_MX */ -# define GLEW_CONTEXT_ARG_DEF_INIT void -# define GLEW_CONTEXT_ARG_VAR_INIT -# define GLEW_CONTEXT_ARG_DEF_LIST void -# define WGLEW_CONTEXT_ARG_DEF_INIT void -# define WGLEW_CONTEXT_ARG_DEF_LIST void -# define GLXEW_CONTEXT_ARG_DEF_INIT void -# define GLXEW_CONTEXT_ARG_DEF_LIST void -#endif /* GLEW_MX */ - -#if defined(GLEW_REGAL) - -/* In GLEW_REGAL mode we call direcly into the linked - libRegal.so glGetProcAddressREGAL for looking up - the GL function pointers. */ - -# undef glGetProcAddressREGAL -# ifdef WIN32 -extern void * __stdcall glGetProcAddressREGAL(const GLchar *name); -static void * (__stdcall * regalGetProcAddress) (const GLchar *) = glGetProcAddressREGAL; -# else -extern void * glGetProcAddressREGAL(const GLchar *name); -static void * (*regalGetProcAddress) (const GLchar *) = glGetProcAddressREGAL; -# endif -# define glGetProcAddressREGAL GLEW_GET_FUN(__glewGetProcAddressREGAL) - -#elif defined(__sgi) || defined (__sun) || defined(__HAIKU__) || defined(GLEW_APPLE_GLX) -#include <dlfcn.h> -#include <stdio.h> -#include <stdlib.h> - -void* dlGetProcAddress (const GLubyte* name) -{ - static void* h = NULL; - static void* gpa; - - if (h == NULL) - { - if ((h = dlopen(NULL, RTLD_LAZY | RTLD_LOCAL)) == NULL) return NULL; - gpa = dlsym(h, "glXGetProcAddress"); - } - - if (gpa != NULL) - return ((void*(*)(const GLubyte*))gpa)(name); - else - return dlsym(h, (const char*)name); -} -#endif /* __sgi || __sun || GLEW_APPLE_GLX */ - -#if defined(__APPLE__) -#include <stdlib.h> -#include <string.h> -#include <AvailabilityMacros.h> - -#ifdef MAC_OS_X_VERSION_10_3 - -#include <dlfcn.h> - -void* NSGLGetProcAddress (const GLubyte *name) -{ - static void* image = NULL; - void* addr; - if (NULL == image) - { - image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY); - } - if( !image ) return NULL; - addr = dlsym(image, (const char*)name); - if( addr ) return addr; -#ifdef GLEW_APPLE_GLX - return dlGetProcAddress( name ); // try next for glx symbols -#else - return NULL; -#endif -} -#else - -#include <mach-o/dyld.h> - -void* NSGLGetProcAddress (const GLubyte *name) -{ - static const struct mach_header* image = NULL; - NSSymbol symbol; - char* symbolName; - if (NULL == image) - { - image = NSAddImage("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", NSADDIMAGE_OPTION_RETURN_ON_ERROR); - } - /* prepend a '_' for the Unix C symbol mangling convention */ - symbolName = malloc(strlen((const char*)name) + 2); - strcpy(symbolName+1, (const char*)name); - symbolName[0] = '_'; - symbol = NULL; - /* if (NSIsSymbolNameDefined(symbolName)) - symbol = NSLookupAndBindSymbol(symbolName); */ - symbol = image ? NSLookupSymbolInImage(image, symbolName, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) : NULL; - free(symbolName); - if( symbol ) return NSAddressOfSymbol(symbol); -#ifdef GLEW_APPLE_GLX - return dlGetProcAddress( name ); // try next for glx symbols -#else - return NULL; -#endif -} -#endif /* MAC_OS_X_VERSION_10_3 */ -#endif /* __APPLE__ */ - -/* - * Define glewGetProcAddress. - */ -#if defined(GLEW_REGAL) -# define glewGetProcAddress(name) regalGetProcAddress((const GLchar *) name) -#elif defined(_WIN32) -# define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name) -#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX) -# define glewGetProcAddress(name) NSGLGetProcAddress(name) -#elif defined(__sgi) || defined(__sun) || defined(__HAIKU__) -# define glewGetProcAddress(name) dlGetProcAddress(name) -#elif defined(__ANDROID__) -# define glewGetProcAddress(name) NULL /* TODO */ -#elif defined(__native_client__) -# define glewGetProcAddress(name) NULL /* TODO */ -#else /* __linux */ -# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name) -#endif - -/* - * Redefine GLEW_GET_VAR etc without const cast - */ - -#undef GLEW_GET_VAR -#ifdef GLEW_MX -# define GLEW_GET_VAR(x) (glewGetContext()->x) -#else /* GLEW_MX */ -# define GLEW_GET_VAR(x) (x) -#endif /* GLEW_MX */ - -#ifdef WGLEW_GET_VAR -# undef WGLEW_GET_VAR -# ifdef GLEW_MX -# define WGLEW_GET_VAR(x) (wglewGetContext()->x) -# else /* GLEW_MX */ -# define WGLEW_GET_VAR(x) (x) -# endif /* GLEW_MX */ -#endif /* WGLEW_GET_VAR */ - -#ifdef GLXEW_GET_VAR -# undef GLXEW_GET_VAR -# ifdef GLEW_MX -# define GLXEW_GET_VAR(x) (glxewGetContext()->x) -# else /* GLEW_MX */ -# define GLXEW_GET_VAR(x) (x) -# endif /* GLEW_MX */ -#endif /* GLXEW_GET_VAR */ - -/* - * GLEW, just like OpenGL or GLU, does not rely on the standard C library. - * These functions implement the functionality required in this file. - */ -static GLuint _glewStrLen (const GLubyte* s) -{ - GLuint i=0; - if (s == NULL) return 0; - while (s[i] != '\0') i++; - return i; -} - -static GLuint _glewStrCLen (const GLubyte* s, GLubyte c) -{ - GLuint i=0; - if (s == NULL) return 0; - while (s[i] != '\0' && s[i] != c) i++; - return (s[i] == '\0' || s[i] == c) ? i : 0; -} - -static GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n) -{ - GLuint i=0; - if(a == NULL || b == NULL) - return (a == NULL && b == NULL && n == 0) ? GL_TRUE : GL_FALSE; - while (i < n && a[i] != '\0' && b[i] != '\0' && a[i] == b[i]) i++; - return i == n ? GL_TRUE : GL_FALSE; -} - -static GLboolean _glewStrSame1 (const GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) -{ - while (*na > 0 && (**a == ' ' || **a == '\n' || **a == '\r' || **a == '\t')) - { - (*a)++; - (*na)--; - } - if(*na >= nb) - { - GLuint i=0; - while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; - if(i == nb) - { - *a = *a + nb; - *na = *na - nb; - return GL_TRUE; - } - } - return GL_FALSE; -} - -static GLboolean _glewStrSame2 (const GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) -{ - if(*na >= nb) - { - GLuint i=0; - while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; - if(i == nb) - { - *a = *a + nb; - *na = *na - nb; - return GL_TRUE; - } - } - return GL_FALSE; -} - -static GLboolean _glewStrSame3 (const GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) -{ - if(*na >= nb) - { - GLuint i=0; - while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; - if (i == nb && (*na == nb || (*a)[i] == ' ' || (*a)[i] == '\n' || (*a)[i] == '\r' || (*a)[i] == '\t')) - { - *a = *a + nb; - *na = *na - nb; - return GL_TRUE; - } - } - return GL_FALSE; -} - -/* - * Search for name in the extensions string. Use of strstr() - * is not sufficient because extension names can be prefixes of - * other extension names. Could use strtok() but the constant - * string returned by glGetString might be in read-only memory. - */ -static GLboolean _glewSearchExtension (const char* name, const GLubyte *start, const GLubyte *end) -{ - const GLubyte* p; - GLuint len = _glewStrLen((const GLubyte*)name); - p = start; - while (p < end) - { - GLuint n = _glewStrCLen(p, ' '); - if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE; - p += n+1; - } - return GL_FALSE; -} - -#if !defined(_WIN32) || !defined(GLEW_MX) - -PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D = NULL; -PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements = NULL; -PFNGLTEXIMAGE3DPROC __glewTexImage3D = NULL; -PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D = NULL; - -PFNGLACTIVETEXTUREPROC __glewActiveTexture = NULL; -PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture = NULL; -PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D = NULL; -PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D = NULL; -PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D = NULL; -PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D = NULL; -PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D = NULL; -PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D = NULL; -PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage = NULL; -PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd = NULL; -PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf = NULL; -PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd = NULL; -PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf = NULL; -PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d = NULL; -PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv = NULL; -PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f = NULL; -PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv = NULL; -PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i = NULL; -PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv = NULL; -PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s = NULL; -PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv = NULL; -PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d = NULL; -PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv = NULL; -PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f = NULL; -PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv = NULL; -PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i = NULL; -PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv = NULL; -PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s = NULL; -PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv = NULL; -PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d = NULL; -PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv = NULL; -PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f = NULL; -PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv = NULL; -PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i = NULL; -PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv = NULL; -PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s = NULL; -PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv = NULL; -PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d = NULL; -PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv = NULL; -PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f = NULL; -PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv = NULL; -PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i = NULL; -PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv = NULL; -PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s = NULL; -PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv = NULL; -PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage = NULL; - -PFNGLBLENDCOLORPROC __glewBlendColor = NULL; -PFNGLBLENDEQUATIONPROC __glewBlendEquation = NULL; -PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate = NULL; -PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer = NULL; -PFNGLFOGCOORDDPROC __glewFogCoordd = NULL; -PFNGLFOGCOORDDVPROC __glewFogCoorddv = NULL; -PFNGLFOGCOORDFPROC __glewFogCoordf = NULL; -PFNGLFOGCOORDFVPROC __glewFogCoordfv = NULL; -PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays = NULL; -PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements = NULL; -PFNGLPOINTPARAMETERFPROC __glewPointParameterf = NULL; -PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv = NULL; -PFNGLPOINTPARAMETERIPROC __glewPointParameteri = NULL; -PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv = NULL; -PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b = NULL; -PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv = NULL; -PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d = NULL; -PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv = NULL; -PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f = NULL; -PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv = NULL; -PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i = NULL; -PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv = NULL; -PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s = NULL; -PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv = NULL; -PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub = NULL; -PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv = NULL; -PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui = NULL; -PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv = NULL; -PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us = NULL; -PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv = NULL; -PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer = NULL; -PFNGLWINDOWPOS2DPROC __glewWindowPos2d = NULL; -PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv = NULL; -PFNGLWINDOWPOS2FPROC __glewWindowPos2f = NULL; -PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv = NULL; -PFNGLWINDOWPOS2IPROC __glewWindowPos2i = NULL; -PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv = NULL; -PFNGLWINDOWPOS2SPROC __glewWindowPos2s = NULL; -PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv = NULL; -PFNGLWINDOWPOS3DPROC __glewWindowPos3d = NULL; -PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv = NULL; -PFNGLWINDOWPOS3FPROC __glewWindowPos3f = NULL; -PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv = NULL; -PFNGLWINDOWPOS3IPROC __glewWindowPos3i = NULL; -PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv = NULL; -PFNGLWINDOWPOS3SPROC __glewWindowPos3s = NULL; -PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv = NULL; - -PFNGLBEGINQUERYPROC __glewBeginQuery = NULL; -PFNGLBINDBUFFERPROC __glewBindBuffer = NULL; -PFNGLBUFFERDATAPROC __glewBufferData = NULL; -PFNGLBUFFERSUBDATAPROC __glewBufferSubData = NULL; -PFNGLDELETEBUFFERSPROC __glewDeleteBuffers = NULL; -PFNGLDELETEQUERIESPROC __glewDeleteQueries = NULL; -PFNGLENDQUERYPROC __glewEndQuery = NULL; -PFNGLGENBUFFERSPROC __glewGenBuffers = NULL; -PFNGLGENQUERIESPROC __glewGenQueries = NULL; -PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv = NULL; -PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv = NULL; -PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData = NULL; -PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv = NULL; -PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv = NULL; -PFNGLGETQUERYIVPROC __glewGetQueryiv = NULL; -PFNGLISBUFFERPROC __glewIsBuffer = NULL; -PFNGLISQUERYPROC __glewIsQuery = NULL; -PFNGLMAPBUFFERPROC __glewMapBuffer = NULL; -PFNGLUNMAPBUFFERPROC __glewUnmapBuffer = NULL; - -PFNGLATTACHSHADERPROC __glewAttachShader = NULL; -PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation = NULL; -PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate = NULL; -PFNGLCOMPILESHADERPROC __glewCompileShader = NULL; -PFNGLCREATEPROGRAMPROC __glewCreateProgram = NULL; -PFNGLCREATESHADERPROC __glewCreateShader = NULL; -PFNGLDELETEPROGRAMPROC __glewDeleteProgram = NULL; -PFNGLDELETESHADERPROC __glewDeleteShader = NULL; -PFNGLDETACHSHADERPROC __glewDetachShader = NULL; -PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray = NULL; -PFNGLDRAWBUFFERSPROC __glewDrawBuffers = NULL; -PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray = NULL; -PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib = NULL; -PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform = NULL; -PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders = NULL; -PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation = NULL; -PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog = NULL; -PFNGLGETPROGRAMIVPROC __glewGetProgramiv = NULL; -PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog = NULL; -PFNGLGETSHADERSOURCEPROC __glewGetShaderSource = NULL; -PFNGLGETSHADERIVPROC __glewGetShaderiv = NULL; -PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation = NULL; -PFNGLGETUNIFORMFVPROC __glewGetUniformfv = NULL; -PFNGLGETUNIFORMIVPROC __glewGetUniformiv = NULL; -PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv = NULL; -PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv = NULL; -PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv = NULL; -PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv = NULL; -PFNGLISPROGRAMPROC __glewIsProgram = NULL; -PFNGLISSHADERPROC __glewIsShader = NULL; -PFNGLLINKPROGRAMPROC __glewLinkProgram = NULL; -PFNGLSHADERSOURCEPROC __glewShaderSource = NULL; -PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate = NULL; -PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate = NULL; -PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate = NULL; -PFNGLUNIFORM1FPROC __glewUniform1f = NULL; -PFNGLUNIFORM1FVPROC __glewUniform1fv = NULL; -PFNGLUNIFORM1IPROC __glewUniform1i = NULL; -PFNGLUNIFORM1IVPROC __glewUniform1iv = NULL; -PFNGLUNIFORM2FPROC __glewUniform2f = NULL; -PFNGLUNIFORM2FVPROC __glewUniform2fv = NULL; -PFNGLUNIFORM2IPROC __glewUniform2i = NULL; -PFNGLUNIFORM2IVPROC __glewUniform2iv = NULL; -PFNGLUNIFORM3FPROC __glewUniform3f = NULL; -PFNGLUNIFORM3FVPROC __glewUniform3fv = NULL; -PFNGLUNIFORM3IPROC __glewUniform3i = NULL; -PFNGLUNIFORM3IVPROC __glewUniform3iv = NULL; -PFNGLUNIFORM4FPROC __glewUniform4f = NULL; -PFNGLUNIFORM4FVPROC __glewUniform4fv = NULL; -PFNGLUNIFORM4IPROC __glewUniform4i = NULL; -PFNGLUNIFORM4IVPROC __glewUniform4iv = NULL; -PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv = NULL; -PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv = NULL; -PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv = NULL; -PFNGLUSEPROGRAMPROC __glewUseProgram = NULL; -PFNGLVALIDATEPROGRAMPROC __glewValidateProgram = NULL; -PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d = NULL; -PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv = NULL; -PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f = NULL; -PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv = NULL; -PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s = NULL; -PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv = NULL; -PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d = NULL; -PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv = NULL; -PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f = NULL; -PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv = NULL; -PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s = NULL; -PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv = NULL; -PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d = NULL; -PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv = NULL; -PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f = NULL; -PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv = NULL; -PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s = NULL; -PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv = NULL; -PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv = NULL; -PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv = NULL; -PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv = NULL; -PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub = NULL; -PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv = NULL; -PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv = NULL; -PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv = NULL; -PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv = NULL; -PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d = NULL; -PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv = NULL; -PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f = NULL; -PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv = NULL; -PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv = NULL; -PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s = NULL; -PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv = NULL; -PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv = NULL; -PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv = NULL; -PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv = NULL; -PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer = NULL; - -PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv = NULL; -PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv = NULL; -PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv = NULL; -PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv = NULL; -PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv = NULL; -PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv = NULL; - -PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender = NULL; -PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback = NULL; -PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation = NULL; -PFNGLCLAMPCOLORPROC __glewClampColor = NULL; -PFNGLCLEARBUFFERFIPROC __glewClearBufferfi = NULL; -PFNGLCLEARBUFFERFVPROC __glewClearBufferfv = NULL; -PFNGLCLEARBUFFERIVPROC __glewClearBufferiv = NULL; -PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv = NULL; -PFNGLCOLORMASKIPROC __glewColorMaski = NULL; -PFNGLDISABLEIPROC __glewDisablei = NULL; -PFNGLENABLEIPROC __glewEnablei = NULL; -PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender = NULL; -PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback = NULL; -PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v = NULL; -PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation = NULL; -PFNGLGETSTRINGIPROC __glewGetStringi = NULL; -PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv = NULL; -PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv = NULL; -PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying = NULL; -PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv = NULL; -PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv = NULL; -PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv = NULL; -PFNGLISENABLEDIPROC __glewIsEnabledi = NULL; -PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv = NULL; -PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv = NULL; -PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings = NULL; -PFNGLUNIFORM1UIPROC __glewUniform1ui = NULL; -PFNGLUNIFORM1UIVPROC __glewUniform1uiv = NULL; -PFNGLUNIFORM2UIPROC __glewUniform2ui = NULL; -PFNGLUNIFORM2UIVPROC __glewUniform2uiv = NULL; -PFNGLUNIFORM3UIPROC __glewUniform3ui = NULL; -PFNGLUNIFORM3UIVPROC __glewUniform3uiv = NULL; -PFNGLUNIFORM4UIPROC __glewUniform4ui = NULL; -PFNGLUNIFORM4UIVPROC __glewUniform4uiv = NULL; -PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i = NULL; -PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv = NULL; -PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui = NULL; -PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv = NULL; -PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i = NULL; -PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv = NULL; -PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui = NULL; -PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv = NULL; -PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i = NULL; -PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv = NULL; -PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui = NULL; -PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv = NULL; -PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv = NULL; -PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i = NULL; -PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv = NULL; -PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv = NULL; -PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv = NULL; -PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui = NULL; -PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv = NULL; -PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv = NULL; -PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer = NULL; - -PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced = NULL; -PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced = NULL; -PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex = NULL; -PFNGLTEXBUFFERPROC __glewTexBuffer = NULL; - -PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture = NULL; -PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v = NULL; -PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v = NULL; - -PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor = NULL; - -PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei = NULL; -PFNGLBLENDEQUATIONIPROC __glewBlendEquationi = NULL; -PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei = NULL; -PFNGLBLENDFUNCIPROC __glewBlendFunci = NULL; -PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading = NULL; - -PFNGLGETGRAPHICSRESETSTATUSPROC __glewGetGraphicsResetStatus = NULL; -PFNGLGETNCOMPRESSEDTEXIMAGEPROC __glewGetnCompressedTexImage = NULL; -PFNGLGETNTEXIMAGEPROC __glewGetnTexImage = NULL; -PFNGLGETNUNIFORMDVPROC __glewGetnUniformdv = NULL; - -PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX = NULL; - -PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD = NULL; -PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD = NULL; -PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD = NULL; -PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD = NULL; - -PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD = NULL; -PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD = NULL; -PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD = NULL; -PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD = NULL; - -PFNGLVERTEXATTRIBPARAMETERIAMDPROC __glewVertexAttribParameteriAMD = NULL; - -PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD = NULL; -PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD = NULL; - -PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD = NULL; -PFNGLGENNAMESAMDPROC __glewGenNamesAMD = NULL; -PFNGLISNAMEAMDPROC __glewIsNameAMD = NULL; - -PFNGLQUERYOBJECTPARAMETERUIAMDPROC __glewQueryObjectParameteruiAMD = NULL; - -PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD = NULL; -PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD = NULL; -PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD = NULL; -PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD = NULL; -PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD = NULL; -PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD = NULL; -PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD = NULL; -PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD = NULL; -PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD = NULL; -PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD = NULL; -PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD = NULL; - -PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD = NULL; - -PFNGLTEXSTORAGESPARSEAMDPROC __glewTexStorageSparseAMD = NULL; -PFNGLTEXTURESTORAGESPARSEAMDPROC __glewTextureStorageSparseAMD = NULL; - -PFNGLSTENCILOPVALUEAMDPROC __glewStencilOpValueAMD = NULL; - -PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD = NULL; -PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD = NULL; - -PFNGLBLITFRAMEBUFFERANGLEPROC __glewBlitFramebufferANGLE = NULL; - -PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC __glewRenderbufferStorageMultisampleANGLE = NULL; - -PFNGLDRAWARRAYSINSTANCEDANGLEPROC __glewDrawArraysInstancedANGLE = NULL; -PFNGLDRAWELEMENTSINSTANCEDANGLEPROC __glewDrawElementsInstancedANGLE = NULL; -PFNGLVERTEXATTRIBDIVISORANGLEPROC __glewVertexAttribDivisorANGLE = NULL; - -PFNGLBEGINQUERYANGLEPROC __glewBeginQueryANGLE = NULL; -PFNGLDELETEQUERIESANGLEPROC __glewDeleteQueriesANGLE = NULL; -PFNGLENDQUERYANGLEPROC __glewEndQueryANGLE = NULL; -PFNGLGENQUERIESANGLEPROC __glewGenQueriesANGLE = NULL; -PFNGLGETQUERYOBJECTI64VANGLEPROC __glewGetQueryObjecti64vANGLE = NULL; -PFNGLGETQUERYOBJECTIVANGLEPROC __glewGetQueryObjectivANGLE = NULL; -PFNGLGETQUERYOBJECTUI64VANGLEPROC __glewGetQueryObjectui64vANGLE = NULL; -PFNGLGETQUERYOBJECTUIVANGLEPROC __glewGetQueryObjectuivANGLE = NULL; -PFNGLGETQUERYIVANGLEPROC __glewGetQueryivANGLE = NULL; -PFNGLISQUERYANGLEPROC __glewIsQueryANGLE = NULL; -PFNGLQUERYCOUNTERANGLEPROC __glewQueryCounterANGLE = NULL; - -PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC __glewGetTranslatedShaderSourceANGLE = NULL; - -PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE = NULL; -PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE = NULL; -PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE = NULL; -PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE = NULL; -PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE = NULL; - -PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE = NULL; -PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE = NULL; -PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE = NULL; -PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE = NULL; -PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE = NULL; -PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE = NULL; -PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE = NULL; -PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE = NULL; - -PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE = NULL; -PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE = NULL; - -PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE = NULL; -PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE = NULL; -PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE = NULL; - -PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE = NULL; -PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE = NULL; - -PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE = NULL; -PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE = NULL; -PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE = NULL; -PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE = NULL; - -PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE = NULL; -PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE = NULL; -PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE = NULL; - -PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE = NULL; -PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE = NULL; -PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE = NULL; -PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE = NULL; -PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE = NULL; -PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE = NULL; -PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE = NULL; - -PFNGLCLEARDEPTHFPROC __glewClearDepthf = NULL; -PFNGLDEPTHRANGEFPROC __glewDepthRangef = NULL; -PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat = NULL; -PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler = NULL; -PFNGLSHADERBINARYPROC __glewShaderBinary = NULL; - -PFNGLMEMORYBARRIERBYREGIONPROC __glewMemoryBarrierByRegion = NULL; - -PFNGLPRIMITIVEBOUNDINGBOXARBPROC __glewPrimitiveBoundingBoxARB = NULL; - -PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance = NULL; -PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance = NULL; -PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance = NULL; - -PFNGLGETIMAGEHANDLEARBPROC __glewGetImageHandleARB = NULL; -PFNGLGETTEXTUREHANDLEARBPROC __glewGetTextureHandleARB = NULL; -PFNGLGETTEXTURESAMPLERHANDLEARBPROC __glewGetTextureSamplerHandleARB = NULL; -PFNGLGETVERTEXATTRIBLUI64VARBPROC __glewGetVertexAttribLui64vARB = NULL; -PFNGLISIMAGEHANDLERESIDENTARBPROC __glewIsImageHandleResidentARB = NULL; -PFNGLISTEXTUREHANDLERESIDENTARBPROC __glewIsTextureHandleResidentARB = NULL; -PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC __glewMakeImageHandleNonResidentARB = NULL; -PFNGLMAKEIMAGEHANDLERESIDENTARBPROC __glewMakeImageHandleResidentARB = NULL; -PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC __glewMakeTextureHandleNonResidentARB = NULL; -PFNGLMAKETEXTUREHANDLERESIDENTARBPROC __glewMakeTextureHandleResidentARB = NULL; -PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC __glewProgramUniformHandleui64ARB = NULL; -PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC __glewProgramUniformHandleui64vARB = NULL; -PFNGLUNIFORMHANDLEUI64ARBPROC __glewUniformHandleui64ARB = NULL; -PFNGLUNIFORMHANDLEUI64VARBPROC __glewUniformHandleui64vARB = NULL; -PFNGLVERTEXATTRIBL1UI64ARBPROC __glewVertexAttribL1ui64ARB = NULL; -PFNGLVERTEXATTRIBL1UI64VARBPROC __glewVertexAttribL1ui64vARB = NULL; - -PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed = NULL; -PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex = NULL; - -PFNGLBUFFERSTORAGEPROC __glewBufferStorage = NULL; -PFNGLNAMEDBUFFERSTORAGEEXTPROC __glewNamedBufferStorageEXT = NULL; - -PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB = NULL; - -PFNGLCLEARBUFFERDATAPROC __glewClearBufferData = NULL; -PFNGLCLEARBUFFERSUBDATAPROC __glewClearBufferSubData = NULL; -PFNGLCLEARNAMEDBUFFERDATAEXTPROC __glewClearNamedBufferDataEXT = NULL; -PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC __glewClearNamedBufferSubDataEXT = NULL; - -PFNGLCLEARTEXIMAGEPROC __glewClearTexImage = NULL; -PFNGLCLEARTEXSUBIMAGEPROC __glewClearTexSubImage = NULL; - -PFNGLCLIPCONTROLPROC __glewClipControl = NULL; - -PFNGLCLAMPCOLORARBPROC __glewClampColorARB = NULL; - -PFNGLDISPATCHCOMPUTEPROC __glewDispatchCompute = NULL; -PFNGLDISPATCHCOMPUTEINDIRECTPROC __glewDispatchComputeIndirect = NULL; - -PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC __glewDispatchComputeGroupSizeARB = NULL; - -PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData = NULL; - -PFNGLCOPYIMAGESUBDATAPROC __glewCopyImageSubData = NULL; - -PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB = NULL; -PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB = NULL; -PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB = NULL; -PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB = NULL; - -PFNGLBINDTEXTUREUNITPROC __glewBindTextureUnit = NULL; -PFNGLBLITNAMEDFRAMEBUFFERPROC __glewBlitNamedFramebuffer = NULL; -PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC __glewCheckNamedFramebufferStatus = NULL; -PFNGLCLEARNAMEDBUFFERDATAPROC __glewClearNamedBufferData = NULL; -PFNGLCLEARNAMEDBUFFERSUBDATAPROC __glewClearNamedBufferSubData = NULL; -PFNGLCLEARNAMEDFRAMEBUFFERFIPROC __glewClearNamedFramebufferfi = NULL; -PFNGLCLEARNAMEDFRAMEBUFFERFVPROC __glewClearNamedFramebufferfv = NULL; -PFNGLCLEARNAMEDFRAMEBUFFERIVPROC __glewClearNamedFramebufferiv = NULL; -PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC __glewClearNamedFramebufferuiv = NULL; -PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC __glewCompressedTextureSubImage1D = NULL; -PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC __glewCompressedTextureSubImage2D = NULL; -PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC __glewCompressedTextureSubImage3D = NULL; -PFNGLCOPYNAMEDBUFFERSUBDATAPROC __glewCopyNamedBufferSubData = NULL; -PFNGLCOPYTEXTURESUBIMAGE1DPROC __glewCopyTextureSubImage1D = NULL; -PFNGLCOPYTEXTURESUBIMAGE2DPROC __glewCopyTextureSubImage2D = NULL; -PFNGLCOPYTEXTURESUBIMAGE3DPROC __glewCopyTextureSubImage3D = NULL; -PFNGLCREATEBUFFERSPROC __glewCreateBuffers = NULL; -PFNGLCREATEFRAMEBUFFERSPROC __glewCreateFramebuffers = NULL; -PFNGLCREATEPROGRAMPIPELINESPROC __glewCreateProgramPipelines = NULL; -PFNGLCREATEQUERIESPROC __glewCreateQueries = NULL; -PFNGLCREATERENDERBUFFERSPROC __glewCreateRenderbuffers = NULL; -PFNGLCREATESAMPLERSPROC __glewCreateSamplers = NULL; -PFNGLCREATETEXTURESPROC __glewCreateTextures = NULL; -PFNGLCREATETRANSFORMFEEDBACKSPROC __glewCreateTransformFeedbacks = NULL; -PFNGLCREATEVERTEXARRAYSPROC __glewCreateVertexArrays = NULL; -PFNGLDISABLEVERTEXARRAYATTRIBPROC __glewDisableVertexArrayAttrib = NULL; -PFNGLENABLEVERTEXARRAYATTRIBPROC __glewEnableVertexArrayAttrib = NULL; -PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC __glewFlushMappedNamedBufferRange = NULL; -PFNGLGENERATETEXTUREMIPMAPPROC __glewGenerateTextureMipmap = NULL; -PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC __glewGetCompressedTextureImage = NULL; -PFNGLGETNAMEDBUFFERPARAMETERI64VPROC __glewGetNamedBufferParameteri64v = NULL; -PFNGLGETNAMEDBUFFERPARAMETERIVPROC __glewGetNamedBufferParameteriv = NULL; -PFNGLGETNAMEDBUFFERPOINTERVPROC __glewGetNamedBufferPointerv = NULL; -PFNGLGETNAMEDBUFFERSUBDATAPROC __glewGetNamedBufferSubData = NULL; -PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetNamedFramebufferAttachmentParameteriv = NULL; -PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC __glewGetNamedFramebufferParameteriv = NULL; -PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC __glewGetNamedRenderbufferParameteriv = NULL; -PFNGLGETQUERYBUFFEROBJECTI64VPROC __glewGetQueryBufferObjecti64v = NULL; -PFNGLGETQUERYBUFFEROBJECTIVPROC __glewGetQueryBufferObjectiv = NULL; -PFNGLGETQUERYBUFFEROBJECTUI64VPROC __glewGetQueryBufferObjectui64v = NULL; -PFNGLGETQUERYBUFFEROBJECTUIVPROC __glewGetQueryBufferObjectuiv = NULL; -PFNGLGETTEXTUREIMAGEPROC __glewGetTextureImage = NULL; -PFNGLGETTEXTURELEVELPARAMETERFVPROC __glewGetTextureLevelParameterfv = NULL; -PFNGLGETTEXTURELEVELPARAMETERIVPROC __glewGetTextureLevelParameteriv = NULL; -PFNGLGETTEXTUREPARAMETERIIVPROC __glewGetTextureParameterIiv = NULL; -PFNGLGETTEXTUREPARAMETERIUIVPROC __glewGetTextureParameterIuiv = NULL; -PFNGLGETTEXTUREPARAMETERFVPROC __glewGetTextureParameterfv = NULL; -PFNGLGETTEXTUREPARAMETERIVPROC __glewGetTextureParameteriv = NULL; -PFNGLGETTRANSFORMFEEDBACKI64_VPROC __glewGetTransformFeedbacki64_v = NULL; -PFNGLGETTRANSFORMFEEDBACKI_VPROC __glewGetTransformFeedbacki_v = NULL; -PFNGLGETTRANSFORMFEEDBACKIVPROC __glewGetTransformFeedbackiv = NULL; -PFNGLGETVERTEXARRAYINDEXED64IVPROC __glewGetVertexArrayIndexed64iv = NULL; -PFNGLGETVERTEXARRAYINDEXEDIVPROC __glewGetVertexArrayIndexediv = NULL; -PFNGLGETVERTEXARRAYIVPROC __glewGetVertexArrayiv = NULL; -PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC __glewInvalidateNamedFramebufferData = NULL; -PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC __glewInvalidateNamedFramebufferSubData = NULL; -PFNGLMAPNAMEDBUFFERPROC __glewMapNamedBuffer = NULL; -PFNGLMAPNAMEDBUFFERRANGEPROC __glewMapNamedBufferRange = NULL; -PFNGLNAMEDBUFFERDATAPROC __glewNamedBufferData = NULL; -PFNGLNAMEDBUFFERSTORAGEPROC __glewNamedBufferStorage = NULL; -PFNGLNAMEDBUFFERSUBDATAPROC __glewNamedBufferSubData = NULL; -PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC __glewNamedFramebufferDrawBuffer = NULL; -PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC __glewNamedFramebufferDrawBuffers = NULL; -PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC __glewNamedFramebufferParameteri = NULL; -PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC __glewNamedFramebufferReadBuffer = NULL; -PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC __glewNamedFramebufferRenderbuffer = NULL; -PFNGLNAMEDFRAMEBUFFERTEXTUREPROC __glewNamedFramebufferTexture = NULL; -PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC __glewNamedFramebufferTextureLayer = NULL; -PFNGLNAMEDRENDERBUFFERSTORAGEPROC __glewNamedRenderbufferStorage = NULL; -PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewNamedRenderbufferStorageMultisample = NULL; -PFNGLTEXTUREBUFFERPROC __glewTextureBuffer = NULL; -PFNGLTEXTUREBUFFERRANGEPROC __glewTextureBufferRange = NULL; -PFNGLTEXTUREPARAMETERIIVPROC __glewTextureParameterIiv = NULL; -PFNGLTEXTUREPARAMETERIUIVPROC __glewTextureParameterIuiv = NULL; -PFNGLTEXTUREPARAMETERFPROC __glewTextureParameterf = NULL; -PFNGLTEXTUREPARAMETERFVPROC __glewTextureParameterfv = NULL; -PFNGLTEXTUREPARAMETERIPROC __glewTextureParameteri = NULL; -PFNGLTEXTUREPARAMETERIVPROC __glewTextureParameteriv = NULL; -PFNGLTEXTURESTORAGE1DPROC __glewTextureStorage1D = NULL; -PFNGLTEXTURESTORAGE2DPROC __glewTextureStorage2D = NULL; -PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC __glewTextureStorage2DMultisample = NULL; -PFNGLTEXTURESTORAGE3DPROC __glewTextureStorage3D = NULL; -PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC __glewTextureStorage3DMultisample = NULL; -PFNGLTEXTURESUBIMAGE1DPROC __glewTextureSubImage1D = NULL; -PFNGLTEXTURESUBIMAGE2DPROC __glewTextureSubImage2D = NULL; -PFNGLTEXTURESUBIMAGE3DPROC __glewTextureSubImage3D = NULL; -PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC __glewTransformFeedbackBufferBase = NULL; -PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC __glewTransformFeedbackBufferRange = NULL; -PFNGLUNMAPNAMEDBUFFERPROC __glewUnmapNamedBuffer = NULL; -PFNGLVERTEXARRAYATTRIBBINDINGPROC __glewVertexArrayAttribBinding = NULL; -PFNGLVERTEXARRAYATTRIBFORMATPROC __glewVertexArrayAttribFormat = NULL; -PFNGLVERTEXARRAYATTRIBIFORMATPROC __glewVertexArrayAttribIFormat = NULL; -PFNGLVERTEXARRAYATTRIBLFORMATPROC __glewVertexArrayAttribLFormat = NULL; -PFNGLVERTEXARRAYBINDINGDIVISORPROC __glewVertexArrayBindingDivisor = NULL; -PFNGLVERTEXARRAYELEMENTBUFFERPROC __glewVertexArrayElementBuffer = NULL; -PFNGLVERTEXARRAYVERTEXBUFFERPROC __glewVertexArrayVertexBuffer = NULL; -PFNGLVERTEXARRAYVERTEXBUFFERSPROC __glewVertexArrayVertexBuffers = NULL; - -PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB = NULL; - -PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB = NULL; -PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB = NULL; -PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB = NULL; -PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB = NULL; - -PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex = NULL; -PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex = NULL; -PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex = NULL; -PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex = NULL; - -PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect = NULL; -PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect = NULL; - -PFNGLFRAMEBUFFERPARAMETERIPROC __glewFramebufferParameteri = NULL; -PFNGLGETFRAMEBUFFERPARAMETERIVPROC __glewGetFramebufferParameteriv = NULL; -PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC __glewGetNamedFramebufferParameterivEXT = NULL; -PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC __glewNamedFramebufferParameteriEXT = NULL; - -PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer = NULL; -PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer = NULL; -PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer = NULL; -PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus = NULL; -PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers = NULL; -PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers = NULL; -PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer = NULL; -PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D = NULL; -PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D = NULL; -PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D = NULL; -PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer = NULL; -PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers = NULL; -PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers = NULL; -PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap = NULL; -PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv = NULL; -PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv = NULL; -PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer = NULL; -PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer = NULL; -PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage = NULL; -PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample = NULL; - -PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB = NULL; -PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB = NULL; -PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB = NULL; -PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB = NULL; - -PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary = NULL; -PFNGLPROGRAMBINARYPROC __glewProgramBinary = NULL; -PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri = NULL; - -PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC __glewGetCompressedTextureSubImage = NULL; -PFNGLGETTEXTURESUBIMAGEPROC __glewGetTextureSubImage = NULL; - -PFNGLGETUNIFORMDVPROC __glewGetUniformdv = NULL; -PFNGLUNIFORM1DPROC __glewUniform1d = NULL; -PFNGLUNIFORM1DVPROC __glewUniform1dv = NULL; -PFNGLUNIFORM2DPROC __glewUniform2d = NULL; -PFNGLUNIFORM2DVPROC __glewUniform2dv = NULL; -PFNGLUNIFORM3DPROC __glewUniform3d = NULL; -PFNGLUNIFORM3DVPROC __glewUniform3dv = NULL; -PFNGLUNIFORM4DPROC __glewUniform4d = NULL; -PFNGLUNIFORM4DVPROC __glewUniform4dv = NULL; -PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv = NULL; -PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv = NULL; -PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv = NULL; -PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv = NULL; -PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv = NULL; -PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv = NULL; -PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv = NULL; -PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv = NULL; -PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv = NULL; - -PFNGLGETUNIFORMI64VARBPROC __glewGetUniformi64vARB = NULL; -PFNGLGETUNIFORMUI64VARBPROC __glewGetUniformui64vARB = NULL; -PFNGLGETNUNIFORMI64VARBPROC __glewGetnUniformi64vARB = NULL; -PFNGLGETNUNIFORMUI64VARBPROC __glewGetnUniformui64vARB = NULL; -PFNGLPROGRAMUNIFORM1I64ARBPROC __glewProgramUniform1i64ARB = NULL; -PFNGLPROGRAMUNIFORM1I64VARBPROC __glewProgramUniform1i64vARB = NULL; -PFNGLPROGRAMUNIFORM1UI64ARBPROC __glewProgramUniform1ui64ARB = NULL; -PFNGLPROGRAMUNIFORM1UI64VARBPROC __glewProgramUniform1ui64vARB = NULL; -PFNGLPROGRAMUNIFORM2I64ARBPROC __glewProgramUniform2i64ARB = NULL; -PFNGLPROGRAMUNIFORM2I64VARBPROC __glewProgramUniform2i64vARB = NULL; -PFNGLPROGRAMUNIFORM2UI64ARBPROC __glewProgramUniform2ui64ARB = NULL; -PFNGLPROGRAMUNIFORM2UI64VARBPROC __glewProgramUniform2ui64vARB = NULL; -PFNGLPROGRAMUNIFORM3I64ARBPROC __glewProgramUniform3i64ARB = NULL; -PFNGLPROGRAMUNIFORM3I64VARBPROC __glewProgramUniform3i64vARB = NULL; -PFNGLPROGRAMUNIFORM3UI64ARBPROC __glewProgramUniform3ui64ARB = NULL; -PFNGLPROGRAMUNIFORM3UI64VARBPROC __glewProgramUniform3ui64vARB = NULL; -PFNGLPROGRAMUNIFORM4I64ARBPROC __glewProgramUniform4i64ARB = NULL; -PFNGLPROGRAMUNIFORM4I64VARBPROC __glewProgramUniform4i64vARB = NULL; -PFNGLPROGRAMUNIFORM4UI64ARBPROC __glewProgramUniform4ui64ARB = NULL; -PFNGLPROGRAMUNIFORM4UI64VARBPROC __glewProgramUniform4ui64vARB = NULL; -PFNGLUNIFORM1I64ARBPROC __glewUniform1i64ARB = NULL; -PFNGLUNIFORM1I64VARBPROC __glewUniform1i64vARB = NULL; -PFNGLUNIFORM1UI64ARBPROC __glewUniform1ui64ARB = NULL; -PFNGLUNIFORM1UI64VARBPROC __glewUniform1ui64vARB = NULL; -PFNGLUNIFORM2I64ARBPROC __glewUniform2i64ARB = NULL; -PFNGLUNIFORM2I64VARBPROC __glewUniform2i64vARB = NULL; -PFNGLUNIFORM2UI64ARBPROC __glewUniform2ui64ARB = NULL; -PFNGLUNIFORM2UI64VARBPROC __glewUniform2ui64vARB = NULL; -PFNGLUNIFORM3I64ARBPROC __glewUniform3i64ARB = NULL; -PFNGLUNIFORM3I64VARBPROC __glewUniform3i64vARB = NULL; -PFNGLUNIFORM3UI64ARBPROC __glewUniform3ui64ARB = NULL; -PFNGLUNIFORM3UI64VARBPROC __glewUniform3ui64vARB = NULL; -PFNGLUNIFORM4I64ARBPROC __glewUniform4i64ARB = NULL; -PFNGLUNIFORM4I64VARBPROC __glewUniform4i64vARB = NULL; -PFNGLUNIFORM4UI64ARBPROC __glewUniform4ui64ARB = NULL; -PFNGLUNIFORM4UI64VARBPROC __glewUniform4ui64vARB = NULL; - -PFNGLCOLORSUBTABLEPROC __glewColorSubTable = NULL; -PFNGLCOLORTABLEPROC __glewColorTable = NULL; -PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv = NULL; -PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv = NULL; -PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D = NULL; -PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D = NULL; -PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf = NULL; -PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv = NULL; -PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri = NULL; -PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv = NULL; -PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable = NULL; -PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable = NULL; -PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D = NULL; -PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D = NULL; -PFNGLGETCOLORTABLEPROC __glewGetColorTable = NULL; -PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv = NULL; -PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv = NULL; -PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter = NULL; -PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv = NULL; -PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv = NULL; -PFNGLGETHISTOGRAMPROC __glewGetHistogram = NULL; -PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv = NULL; -PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv = NULL; -PFNGLGETMINMAXPROC __glewGetMinmax = NULL; -PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv = NULL; -PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv = NULL; -PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter = NULL; -PFNGLHISTOGRAMPROC __glewHistogram = NULL; -PFNGLMINMAXPROC __glewMinmax = NULL; -PFNGLRESETHISTOGRAMPROC __glewResetHistogram = NULL; -PFNGLRESETMINMAXPROC __glewResetMinmax = NULL; -PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D = NULL; - -PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC __glewMultiDrawArraysIndirectCountARB = NULL; -PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC __glewMultiDrawElementsIndirectCountARB = NULL; - -PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB = NULL; -PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB = NULL; -PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB = NULL; - -PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ = NULL; - -PFNGLGETINTERNALFORMATI64VPROC __glewGetInternalformati64v = NULL; - -PFNGLINVALIDATEBUFFERDATAPROC __glewInvalidateBufferData = NULL; -PFNGLINVALIDATEBUFFERSUBDATAPROC __glewInvalidateBufferSubData = NULL; -PFNGLINVALIDATEFRAMEBUFFERPROC __glewInvalidateFramebuffer = NULL; -PFNGLINVALIDATESUBFRAMEBUFFERPROC __glewInvalidateSubFramebuffer = NULL; -PFNGLINVALIDATETEXIMAGEPROC __glewInvalidateTexImage = NULL; -PFNGLINVALIDATETEXSUBIMAGEPROC __glewInvalidateTexSubImage = NULL; - -PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange = NULL; -PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange = NULL; - -PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB = NULL; -PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB = NULL; -PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB = NULL; -PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB = NULL; -PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB = NULL; - -PFNGLBINDBUFFERSBASEPROC __glewBindBuffersBase = NULL; -PFNGLBINDBUFFERSRANGEPROC __glewBindBuffersRange = NULL; -PFNGLBINDIMAGETEXTURESPROC __glewBindImageTextures = NULL; -PFNGLBINDSAMPLERSPROC __glewBindSamplers = NULL; -PFNGLBINDTEXTURESPROC __glewBindTextures = NULL; -PFNGLBINDVERTEXBUFFERSPROC __glewBindVertexBuffers = NULL; - -PFNGLMULTIDRAWARRAYSINDIRECTPROC __glewMultiDrawArraysIndirect = NULL; -PFNGLMULTIDRAWELEMENTSINDIRECTPROC __glewMultiDrawElementsIndirect = NULL; - -PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB = NULL; - -PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB = NULL; -PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB = NULL; -PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB = NULL; -PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB = NULL; -PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB = NULL; -PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB = NULL; -PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB = NULL; -PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB = NULL; -PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB = NULL; -PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB = NULL; -PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB = NULL; -PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB = NULL; -PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB = NULL; -PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB = NULL; -PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB = NULL; -PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB = NULL; -PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB = NULL; -PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB = NULL; -PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB = NULL; -PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB = NULL; -PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB = NULL; -PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB = NULL; -PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB = NULL; -PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB = NULL; -PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB = NULL; -PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB = NULL; -PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB = NULL; -PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB = NULL; -PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB = NULL; -PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB = NULL; -PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB = NULL; -PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB = NULL; -PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB = NULL; -PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB = NULL; - -PFNGLBEGINQUERYARBPROC __glewBeginQueryARB = NULL; -PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB = NULL; -PFNGLENDQUERYARBPROC __glewEndQueryARB = NULL; -PFNGLGENQUERIESARBPROC __glewGenQueriesARB = NULL; -PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB = NULL; -PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB = NULL; -PFNGLGETQUERYIVARBPROC __glewGetQueryivARB = NULL; -PFNGLISQUERYARBPROC __glewIsQueryARB = NULL; - -PFNGLMAXSHADERCOMPILERTHREADSARBPROC __glewMaxShaderCompilerThreadsARB = NULL; - -PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB = NULL; -PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB = NULL; - -PFNGLGETPROGRAMINTERFACEIVPROC __glewGetProgramInterfaceiv = NULL; -PFNGLGETPROGRAMRESOURCEINDEXPROC __glewGetProgramResourceIndex = NULL; -PFNGLGETPROGRAMRESOURCELOCATIONPROC __glewGetProgramResourceLocation = NULL; -PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC __glewGetProgramResourceLocationIndex = NULL; -PFNGLGETPROGRAMRESOURCENAMEPROC __glewGetProgramResourceName = NULL; -PFNGLGETPROGRAMRESOURCEIVPROC __glewGetProgramResourceiv = NULL; - -PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex = NULL; - -PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB = NULL; -PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB = NULL; -PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB = NULL; -PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB = NULL; -PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB = NULL; -PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB = NULL; -PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB = NULL; -PFNGLGETNMAPIVARBPROC __glewGetnMapivARB = NULL; -PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB = NULL; -PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB = NULL; -PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB = NULL; -PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB = NULL; -PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB = NULL; -PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB = NULL; -PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB = NULL; -PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB = NULL; -PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB = NULL; -PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB = NULL; -PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB = NULL; -PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB = NULL; - -PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC __glewFramebufferSampleLocationsfvARB = NULL; -PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC __glewNamedFramebufferSampleLocationsfvARB = NULL; - -PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB = NULL; - -PFNGLBINDSAMPLERPROC __glewBindSampler = NULL; -PFNGLDELETESAMPLERSPROC __glewDeleteSamplers = NULL; -PFNGLGENSAMPLERSPROC __glewGenSamplers = NULL; -PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv = NULL; -PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv = NULL; -PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv = NULL; -PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv = NULL; -PFNGLISSAMPLERPROC __glewIsSampler = NULL; -PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv = NULL; -PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv = NULL; -PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf = NULL; -PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv = NULL; -PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri = NULL; -PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv = NULL; - -PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram = NULL; -PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline = NULL; -PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv = NULL; -PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines = NULL; -PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines = NULL; -PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog = NULL; -PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv = NULL; -PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline = NULL; -PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d = NULL; -PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv = NULL; -PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f = NULL; -PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv = NULL; -PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i = NULL; -PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv = NULL; -PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui = NULL; -PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv = NULL; -PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d = NULL; -PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv = NULL; -PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f = NULL; -PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv = NULL; -PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i = NULL; -PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv = NULL; -PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui = NULL; -PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv = NULL; -PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d = NULL; -PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv = NULL; -PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f = NULL; -PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv = NULL; -PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i = NULL; -PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv = NULL; -PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui = NULL; -PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv = NULL; -PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d = NULL; -PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv = NULL; -PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f = NULL; -PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv = NULL; -PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i = NULL; -PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv = NULL; -PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui = NULL; -PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv = NULL; -PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv = NULL; -PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv = NULL; -PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv = NULL; -PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv = NULL; -PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv = NULL; -PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv = NULL; -PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv = NULL; -PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv = NULL; -PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv = NULL; -PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv = NULL; -PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv = NULL; -PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv = NULL; -PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv = NULL; -PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv = NULL; -PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv = NULL; -PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv = NULL; -PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv = NULL; -PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv = NULL; -PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages = NULL; -PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline = NULL; - -PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv = NULL; - -PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture = NULL; -PFNGLMEMORYBARRIERPROC __glewMemoryBarrier = NULL; - -PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB = NULL; -PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB = NULL; -PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB = NULL; -PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB = NULL; -PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB = NULL; -PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB = NULL; -PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB = NULL; -PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB = NULL; -PFNGLGETHANDLEARBPROC __glewGetHandleARB = NULL; -PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB = NULL; -PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB = NULL; -PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB = NULL; -PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB = NULL; -PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB = NULL; -PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB = NULL; -PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB = NULL; -PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB = NULL; -PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB = NULL; -PFNGLUNIFORM1FARBPROC __glewUniform1fARB = NULL; -PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB = NULL; -PFNGLUNIFORM1IARBPROC __glewUniform1iARB = NULL; -PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB = NULL; -PFNGLUNIFORM2FARBPROC __glewUniform2fARB = NULL; -PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB = NULL; -PFNGLUNIFORM2IARBPROC __glewUniform2iARB = NULL; -PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB = NULL; -PFNGLUNIFORM3FARBPROC __glewUniform3fARB = NULL; -PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB = NULL; -PFNGLUNIFORM3IARBPROC __glewUniform3iARB = NULL; -PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB = NULL; -PFNGLUNIFORM4FARBPROC __glewUniform4fARB = NULL; -PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB = NULL; -PFNGLUNIFORM4IARBPROC __glewUniform4iARB = NULL; -PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB = NULL; -PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB = NULL; -PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB = NULL; -PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB = NULL; -PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB = NULL; -PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB = NULL; - -PFNGLSHADERSTORAGEBLOCKBINDINGPROC __glewShaderStorageBlockBinding = NULL; - -PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName = NULL; -PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName = NULL; -PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv = NULL; -PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv = NULL; -PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex = NULL; -PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation = NULL; -PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv = NULL; -PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv = NULL; - -PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB = NULL; -PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB = NULL; -PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB = NULL; -PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB = NULL; -PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB = NULL; -PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB = NULL; - -PFNGLBUFFERPAGECOMMITMENTARBPROC __glewBufferPageCommitmentARB = NULL; - -PFNGLTEXPAGECOMMITMENTARBPROC __glewTexPageCommitmentARB = NULL; -PFNGLTEXTUREPAGECOMMITMENTEXTPROC __glewTexturePageCommitmentEXT = NULL; - -PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync = NULL; -PFNGLDELETESYNCPROC __glewDeleteSync = NULL; -PFNGLFENCESYNCPROC __glewFenceSync = NULL; -PFNGLGETINTEGER64VPROC __glewGetInteger64v = NULL; -PFNGLGETSYNCIVPROC __glewGetSynciv = NULL; -PFNGLISSYNCPROC __glewIsSync = NULL; -PFNGLWAITSYNCPROC __glewWaitSync = NULL; - -PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv = NULL; -PFNGLPATCHPARAMETERIPROC __glewPatchParameteri = NULL; - -PFNGLTEXTUREBARRIERPROC __glewTextureBarrier = NULL; - -PFNGLTEXBUFFERARBPROC __glewTexBufferARB = NULL; - -PFNGLTEXBUFFERRANGEPROC __glewTexBufferRange = NULL; -PFNGLTEXTUREBUFFERRANGEEXTPROC __glewTextureBufferRangeEXT = NULL; - -PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB = NULL; -PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB = NULL; -PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB = NULL; -PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB = NULL; -PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB = NULL; -PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB = NULL; -PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB = NULL; - -PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv = NULL; -PFNGLSAMPLEMASKIPROC __glewSampleMaski = NULL; -PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample = NULL; -PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample = NULL; - -PFNGLTEXSTORAGE1DPROC __glewTexStorage1D = NULL; -PFNGLTEXSTORAGE2DPROC __glewTexStorage2D = NULL; -PFNGLTEXSTORAGE3DPROC __glewTexStorage3D = NULL; -PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT = NULL; -PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT = NULL; -PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT = NULL; - -PFNGLTEXSTORAGE2DMULTISAMPLEPROC __glewTexStorage2DMultisample = NULL; -PFNGLTEXSTORAGE3DMULTISAMPLEPROC __glewTexStorage3DMultisample = NULL; -PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC __glewTextureStorage2DMultisampleEXT = NULL; -PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC __glewTextureStorage3DMultisampleEXT = NULL; - -PFNGLTEXTUREVIEWPROC __glewTextureView = NULL; - -PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v = NULL; -PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v = NULL; -PFNGLQUERYCOUNTERPROC __glewQueryCounter = NULL; - -PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback = NULL; -PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks = NULL; -PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback = NULL; -PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks = NULL; -PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback = NULL; -PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback = NULL; -PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback = NULL; - -PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed = NULL; -PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream = NULL; -PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed = NULL; -PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv = NULL; - -PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced = NULL; -PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced = NULL; - -PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB = NULL; -PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB = NULL; -PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB = NULL; -PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB = NULL; - -PFNGLBINDBUFFERBASEPROC __glewBindBufferBase = NULL; -PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange = NULL; -PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName = NULL; -PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv = NULL; -PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName = NULL; -PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv = NULL; -PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v = NULL; -PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex = NULL; -PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices = NULL; -PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding = NULL; - -PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray = NULL; -PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays = NULL; -PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays = NULL; -PFNGLISVERTEXARRAYPROC __glewIsVertexArray = NULL; - -PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv = NULL; -PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d = NULL; -PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv = NULL; -PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d = NULL; -PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv = NULL; -PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d = NULL; -PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv = NULL; -PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d = NULL; -PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv = NULL; -PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer = NULL; - -PFNGLBINDVERTEXBUFFERPROC __glewBindVertexBuffer = NULL; -PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC __glewVertexArrayBindVertexBufferEXT = NULL; -PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC __glewVertexArrayVertexAttribBindingEXT = NULL; -PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC __glewVertexArrayVertexAttribFormatEXT = NULL; -PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC __glewVertexArrayVertexAttribIFormatEXT = NULL; -PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC __glewVertexArrayVertexAttribLFormatEXT = NULL; -PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC __glewVertexArrayVertexBindingDivisorEXT = NULL; -PFNGLVERTEXATTRIBBINDINGPROC __glewVertexAttribBinding = NULL; -PFNGLVERTEXATTRIBFORMATPROC __glewVertexAttribFormat = NULL; -PFNGLVERTEXATTRIBIFORMATPROC __glewVertexAttribIFormat = NULL; -PFNGLVERTEXATTRIBLFORMATPROC __glewVertexAttribLFormat = NULL; -PFNGLVERTEXBINDINGDIVISORPROC __glewVertexBindingDivisor = NULL; - -PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB = NULL; -PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB = NULL; -PFNGLWEIGHTBVARBPROC __glewWeightbvARB = NULL; -PFNGLWEIGHTDVARBPROC __glewWeightdvARB = NULL; -PFNGLWEIGHTFVARBPROC __glewWeightfvARB = NULL; -PFNGLWEIGHTIVARBPROC __glewWeightivARB = NULL; -PFNGLWEIGHTSVARBPROC __glewWeightsvARB = NULL; -PFNGLWEIGHTUBVARBPROC __glewWeightubvARB = NULL; -PFNGLWEIGHTUIVARBPROC __glewWeightuivARB = NULL; -PFNGLWEIGHTUSVARBPROC __glewWeightusvARB = NULL; - -PFNGLBINDBUFFERARBPROC __glewBindBufferARB = NULL; -PFNGLBUFFERDATAARBPROC __glewBufferDataARB = NULL; -PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB = NULL; -PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB = NULL; -PFNGLGENBUFFERSARBPROC __glewGenBuffersARB = NULL; -PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB = NULL; -PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB = NULL; -PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB = NULL; -PFNGLISBUFFERARBPROC __glewIsBufferARB = NULL; -PFNGLMAPBUFFERARBPROC __glewMapBufferARB = NULL; -PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB = NULL; - -PFNGLBINDPROGRAMARBPROC __glewBindProgramARB = NULL; -PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB = NULL; -PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB = NULL; -PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB = NULL; -PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB = NULL; -PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB = NULL; -PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB = NULL; -PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB = NULL; -PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB = NULL; -PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB = NULL; -PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB = NULL; -PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB = NULL; -PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB = NULL; -PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB = NULL; -PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB = NULL; -PFNGLISPROGRAMARBPROC __glewIsProgramARB = NULL; -PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB = NULL; -PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB = NULL; -PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB = NULL; -PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB = NULL; -PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB = NULL; -PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB = NULL; -PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB = NULL; -PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB = NULL; -PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB = NULL; -PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB = NULL; -PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB = NULL; -PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB = NULL; -PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB = NULL; -PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB = NULL; -PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB = NULL; -PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB = NULL; -PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB = NULL; -PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB = NULL; -PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB = NULL; -PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB = NULL; -PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB = NULL; -PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB = NULL; -PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB = NULL; -PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB = NULL; -PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB = NULL; -PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB = NULL; -PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB = NULL; -PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB = NULL; -PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB = NULL; -PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB = NULL; -PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB = NULL; -PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB = NULL; -PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB = NULL; -PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB = NULL; -PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB = NULL; -PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB = NULL; -PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB = NULL; -PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB = NULL; -PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB = NULL; -PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB = NULL; -PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB = NULL; -PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB = NULL; -PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB = NULL; -PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB = NULL; -PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB = NULL; -PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB = NULL; - -PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB = NULL; -PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB = NULL; -PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB = NULL; - -PFNGLCOLORP3UIPROC __glewColorP3ui = NULL; -PFNGLCOLORP3UIVPROC __glewColorP3uiv = NULL; -PFNGLCOLORP4UIPROC __glewColorP4ui = NULL; -PFNGLCOLORP4UIVPROC __glewColorP4uiv = NULL; -PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui = NULL; -PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv = NULL; -PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui = NULL; -PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv = NULL; -PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui = NULL; -PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv = NULL; -PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui = NULL; -PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv = NULL; -PFNGLNORMALP3UIPROC __glewNormalP3ui = NULL; -PFNGLNORMALP3UIVPROC __glewNormalP3uiv = NULL; -PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui = NULL; -PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv = NULL; -PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui = NULL; -PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv = NULL; -PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui = NULL; -PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv = NULL; -PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui = NULL; -PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv = NULL; -PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui = NULL; -PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv = NULL; -PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui = NULL; -PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv = NULL; -PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui = NULL; -PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv = NULL; -PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui = NULL; -PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv = NULL; -PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui = NULL; -PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv = NULL; -PFNGLVERTEXP2UIPROC __glewVertexP2ui = NULL; -PFNGLVERTEXP2UIVPROC __glewVertexP2uiv = NULL; -PFNGLVERTEXP3UIPROC __glewVertexP3ui = NULL; -PFNGLVERTEXP3UIVPROC __glewVertexP3uiv = NULL; -PFNGLVERTEXP4UIPROC __glewVertexP4ui = NULL; -PFNGLVERTEXP4UIVPROC __glewVertexP4uiv = NULL; - -PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv = NULL; -PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed = NULL; -PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v = NULL; -PFNGLGETFLOATI_VPROC __glewGetFloati_v = NULL; -PFNGLSCISSORARRAYVPROC __glewScissorArrayv = NULL; -PFNGLSCISSORINDEXEDPROC __glewScissorIndexed = NULL; -PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv = NULL; -PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv = NULL; -PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf = NULL; -PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv = NULL; - -PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB = NULL; -PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB = NULL; -PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB = NULL; -PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB = NULL; -PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB = NULL; -PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB = NULL; -PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB = NULL; -PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB = NULL; -PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB = NULL; -PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB = NULL; -PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB = NULL; -PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB = NULL; -PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB = NULL; -PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB = NULL; -PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB = NULL; -PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB = NULL; - -PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI = NULL; - -PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI = NULL; -PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI = NULL; -PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI = NULL; - -PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI = NULL; -PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI = NULL; -PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI = NULL; -PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI = NULL; - -PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI = NULL; -PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI = NULL; -PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI = NULL; -PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI = NULL; -PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI = NULL; -PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI = NULL; -PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI = NULL; -PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI = NULL; -PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI = NULL; -PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI = NULL; -PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI = NULL; -PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI = NULL; -PFNGLSAMPLEMAPATIPROC __glewSampleMapATI = NULL; -PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI = NULL; - -PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI = NULL; -PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI = NULL; - -PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI = NULL; -PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI = NULL; - -PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI = NULL; -PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI = NULL; - -PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI = NULL; -PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI = NULL; -PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI = NULL; -PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI = NULL; -PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI = NULL; -PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI = NULL; -PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI = NULL; -PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI = NULL; -PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI = NULL; -PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI = NULL; -PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI = NULL; -PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI = NULL; - -PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI = NULL; -PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI = NULL; -PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI = NULL; - -PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI = NULL; -PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI = NULL; -PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI = NULL; -PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI = NULL; -PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI = NULL; -PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI = NULL; -PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI = NULL; -PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI = NULL; -PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI = NULL; -PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI = NULL; -PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI = NULL; -PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI = NULL; -PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI = NULL; -PFNGLVERTEXSTREAM1DATIPROC __glewVertexStream1dATI = NULL; -PFNGLVERTEXSTREAM1DVATIPROC __glewVertexStream1dvATI = NULL; -PFNGLVERTEXSTREAM1FATIPROC __glewVertexStream1fATI = NULL; -PFNGLVERTEXSTREAM1FVATIPROC __glewVertexStream1fvATI = NULL; -PFNGLVERTEXSTREAM1IATIPROC __glewVertexStream1iATI = NULL; -PFNGLVERTEXSTREAM1IVATIPROC __glewVertexStream1ivATI = NULL; -PFNGLVERTEXSTREAM1SATIPROC __glewVertexStream1sATI = NULL; -PFNGLVERTEXSTREAM1SVATIPROC __glewVertexStream1svATI = NULL; -PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI = NULL; -PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI = NULL; -PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI = NULL; -PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI = NULL; -PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI = NULL; -PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI = NULL; -PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI = NULL; -PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI = NULL; -PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI = NULL; -PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI = NULL; -PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI = NULL; -PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI = NULL; -PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI = NULL; -PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI = NULL; -PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI = NULL; -PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI = NULL; -PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI = NULL; -PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI = NULL; -PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI = NULL; -PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI = NULL; -PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI = NULL; -PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI = NULL; -PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI = NULL; -PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI = NULL; - -PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT = NULL; -PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT = NULL; -PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT = NULL; - -PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT = NULL; - -PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT = NULL; - -PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT = NULL; - -PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT = NULL; - -PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT = NULL; -PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT = NULL; - -PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT = NULL; -PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT = NULL; - -PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT = NULL; -PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT = NULL; -PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT = NULL; -PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT = NULL; -PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT = NULL; -PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT = NULL; -PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT = NULL; -PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT = NULL; -PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT = NULL; -PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT = NULL; -PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT = NULL; -PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT = NULL; -PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT = NULL; - -PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT = NULL; -PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT = NULL; - -PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT = NULL; -PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT = NULL; -PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT = NULL; -PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT = NULL; -PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT = NULL; - -PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT = NULL; -PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT = NULL; - -PFNGLGETOBJECTLABELEXTPROC __glewGetObjectLabelEXT = NULL; -PFNGLLABELOBJECTEXTPROC __glewLabelObjectEXT = NULL; - -PFNGLINSERTEVENTMARKEREXTPROC __glewInsertEventMarkerEXT = NULL; -PFNGLPOPGROUPMARKEREXTPROC __glewPopGroupMarkerEXT = NULL; -PFNGLPUSHGROUPMARKEREXTPROC __glewPushGroupMarkerEXT = NULL; - -PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT = NULL; - -PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT = NULL; -PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT = NULL; -PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT = NULL; -PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT = NULL; -PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT = NULL; -PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT = NULL; -PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT = NULL; -PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT = NULL; -PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT = NULL; -PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT = NULL; -PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT = NULL; -PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT = NULL; -PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT = NULL; -PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT = NULL; -PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT = NULL; -PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT = NULL; -PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT = NULL; -PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT = NULL; -PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT = NULL; -PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT = NULL; -PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT = NULL; -PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT = NULL; -PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT = NULL; -PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT = NULL; -PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT = NULL; -PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT = NULL; -PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT = NULL; -PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT = NULL; -PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT = NULL; -PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT = NULL; -PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT = NULL; -PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT = NULL; -PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT = NULL; -PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT = NULL; -PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT = NULL; -PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT = NULL; -PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT = NULL; -PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT = NULL; -PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT = NULL; -PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT = NULL; -PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT = NULL; -PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT = NULL; -PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT = NULL; -PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT = NULL; -PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT = NULL; -PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT = NULL; -PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT = NULL; -PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT = NULL; -PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT = NULL; -PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT = NULL; -PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT = NULL; -PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT = NULL; -PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT = NULL; -PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT = NULL; -PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT = NULL; -PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT = NULL; -PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT = NULL; -PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT = NULL; -PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT = NULL; -PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT = NULL; -PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT = NULL; -PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT = NULL; -PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT = NULL; -PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT = NULL; -PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT = NULL; -PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT = NULL; -PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT = NULL; -PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT = NULL; -PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT = NULL; -PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT = NULL; -PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT = NULL; -PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT = NULL; -PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT = NULL; -PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT = NULL; -PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT = NULL; -PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT = NULL; -PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT = NULL; -PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT = NULL; -PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT = NULL; -PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT = NULL; -PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT = NULL; -PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT = NULL; -PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT = NULL; -PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT = NULL; -PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT = NULL; -PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT = NULL; -PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT = NULL; -PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT = NULL; -PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT = NULL; -PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT = NULL; -PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT = NULL; -PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT = NULL; -PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT = NULL; -PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT = NULL; -PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT = NULL; -PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT = NULL; -PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT = NULL; -PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT = NULL; -PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT = NULL; -PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT = NULL; -PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT = NULL; -PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT = NULL; -PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT = NULL; -PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT = NULL; -PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT = NULL; -PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT = NULL; -PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT = NULL; -PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT = NULL; -PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT = NULL; -PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT = NULL; -PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT = NULL; -PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT = NULL; -PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT = NULL; -PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT = NULL; -PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT = NULL; -PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT = NULL; -PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT = NULL; -PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT = NULL; -PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT = NULL; -PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT = NULL; -PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT = NULL; -PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT = NULL; -PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT = NULL; -PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT = NULL; -PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT = NULL; -PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT = NULL; -PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT = NULL; -PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT = NULL; -PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT = NULL; -PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT = NULL; -PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT = NULL; -PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT = NULL; -PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT = NULL; -PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT = NULL; -PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT = NULL; -PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT = NULL; -PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT = NULL; -PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT = NULL; -PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT = NULL; -PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT = NULL; -PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT = NULL; -PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT = NULL; -PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT = NULL; -PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT = NULL; -PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT = NULL; -PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT = NULL; -PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT = NULL; -PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT = NULL; -PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT = NULL; -PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT = NULL; -PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT = NULL; -PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT = NULL; -PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT = NULL; -PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT = NULL; -PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT = NULL; -PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT = NULL; -PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT = NULL; -PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT = NULL; -PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT = NULL; -PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT = NULL; -PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT = NULL; -PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT = NULL; -PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT = NULL; -PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT = NULL; -PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT = NULL; -PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT = NULL; -PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT = NULL; -PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT = NULL; -PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT = NULL; -PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT = NULL; -PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT = NULL; -PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT = NULL; -PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT = NULL; -PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT = NULL; -PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT = NULL; -PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT = NULL; -PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT = NULL; -PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT = NULL; -PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT = NULL; -PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT = NULL; -PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT = NULL; -PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT = NULL; -PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT = NULL; -PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT = NULL; -PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT = NULL; -PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT = NULL; -PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT = NULL; -PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT = NULL; -PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT = NULL; -PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT = NULL; -PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT = NULL; -PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT = NULL; -PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT = NULL; -PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT = NULL; -PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT = NULL; -PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT = NULL; -PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT = NULL; -PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT = NULL; -PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT = NULL; -PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT = NULL; -PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT = NULL; -PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT = NULL; -PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC __glewVertexArrayVertexAttribDivisorEXT = NULL; -PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT = NULL; -PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT = NULL; -PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT = NULL; - -PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT = NULL; -PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT = NULL; -PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT = NULL; -PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT = NULL; -PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT = NULL; -PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT = NULL; - -PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT = NULL; -PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT = NULL; - -PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT = NULL; - -PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT = NULL; -PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT = NULL; -PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT = NULL; -PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT = NULL; -PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT = NULL; - -PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT = NULL; -PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT = NULL; -PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT = NULL; -PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT = NULL; -PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT = NULL; -PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT = NULL; -PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT = NULL; -PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT = NULL; -PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT = NULL; -PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT = NULL; -PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT = NULL; -PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT = NULL; -PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT = NULL; -PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT = NULL; -PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT = NULL; -PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT = NULL; -PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT = NULL; -PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT = NULL; - -PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT = NULL; - -PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT = NULL; - -PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT = NULL; -PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT = NULL; -PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT = NULL; -PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT = NULL; -PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT = NULL; -PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT = NULL; -PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT = NULL; -PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT = NULL; -PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT = NULL; -PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT = NULL; -PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT = NULL; -PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT = NULL; -PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT = NULL; -PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT = NULL; -PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT = NULL; -PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT = NULL; -PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT = NULL; - -PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT = NULL; -PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT = NULL; -PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT = NULL; - -PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT = NULL; -PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT = NULL; - -PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT = NULL; -PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT = NULL; -PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT = NULL; -PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT = NULL; -PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT = NULL; -PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT = NULL; -PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT = NULL; -PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT = NULL; -PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT = NULL; -PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT = NULL; -PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT = NULL; -PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT = NULL; -PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT = NULL; -PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT = NULL; -PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT = NULL; -PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT = NULL; -PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT = NULL; -PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT = NULL; -PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT = NULL; -PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT = NULL; -PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT = NULL; -PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT = NULL; -PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT = NULL; -PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT = NULL; -PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT = NULL; -PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT = NULL; -PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT = NULL; -PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT = NULL; -PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT = NULL; -PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT = NULL; -PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT = NULL; -PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT = NULL; -PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT = NULL; -PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT = NULL; - -PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT = NULL; -PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT = NULL; -PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT = NULL; -PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT = NULL; -PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT = NULL; -PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT = NULL; -PFNGLHISTOGRAMEXTPROC __glewHistogramEXT = NULL; -PFNGLMINMAXEXTPROC __glewMinmaxEXT = NULL; -PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT = NULL; -PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT = NULL; - -PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT = NULL; - -PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT = NULL; - -PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT = NULL; -PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT = NULL; -PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT = NULL; - -PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT = NULL; -PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT = NULL; - -PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT = NULL; -PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT = NULL; - -PFNGLCOLORTABLEEXTPROC __glewColorTableEXT = NULL; -PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT = NULL; -PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT = NULL; -PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT = NULL; - -PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT = NULL; -PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT = NULL; -PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT = NULL; -PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT = NULL; -PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT = NULL; -PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT = NULL; - -PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT = NULL; -PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT = NULL; - -PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT = NULL; - -PFNGLPOLYGONOFFSETCLAMPEXTPROC __glewPolygonOffsetClampEXT = NULL; - -PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT = NULL; - -PFNGLCOVERAGEMODULATIONNVPROC __glewCoverageModulationNV = NULL; -PFNGLCOVERAGEMODULATIONTABLENVPROC __glewCoverageModulationTableNV = NULL; -PFNGLGETCOVERAGEMODULATIONTABLENVPROC __glewGetCoverageModulationTableNV = NULL; -PFNGLRASTERSAMPLESEXTPROC __glewRasterSamplesEXT = NULL; - -PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT = NULL; -PFNGLENDSCENEEXTPROC __glewEndSceneEXT = NULL; - -PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT = NULL; -PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT = NULL; -PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT = NULL; -PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT = NULL; -PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT = NULL; -PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT = NULL; -PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT = NULL; -PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT = NULL; -PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT = NULL; -PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT = NULL; -PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT = NULL; -PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT = NULL; -PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT = NULL; -PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT = NULL; -PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT = NULL; -PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT = NULL; -PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT = NULL; - -PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT = NULL; -PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT = NULL; -PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT = NULL; - -PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT = NULL; -PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT = NULL; - -PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT = NULL; - -PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT = NULL; -PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT = NULL; -PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT = NULL; - -PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT = NULL; - -PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT = NULL; - -PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT = NULL; - -PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT = NULL; -PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT = NULL; -PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT = NULL; -PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT = NULL; -PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT = NULL; -PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT = NULL; - -PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT = NULL; -PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT = NULL; -PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT = NULL; -PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT = NULL; -PFNGLISTEXTUREEXTPROC __glewIsTextureEXT = NULL; -PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT = NULL; - -PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT = NULL; - -PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT = NULL; -PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT = NULL; - -PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT = NULL; -PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT = NULL; -PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT = NULL; -PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT = NULL; -PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT = NULL; -PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT = NULL; -PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT = NULL; - -PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT = NULL; -PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT = NULL; -PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT = NULL; -PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT = NULL; -PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT = NULL; -PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT = NULL; -PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT = NULL; -PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT = NULL; - -PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT = NULL; -PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT = NULL; -PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT = NULL; -PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT = NULL; -PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT = NULL; -PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT = NULL; -PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT = NULL; -PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT = NULL; -PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT = NULL; -PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT = NULL; -PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT = NULL; - -PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT = NULL; -PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT = NULL; -PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT = NULL; -PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT = NULL; -PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT = NULL; -PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT = NULL; -PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT = NULL; -PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT = NULL; -PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT = NULL; -PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT = NULL; -PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT = NULL; -PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT = NULL; -PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT = NULL; -PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT = NULL; -PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT = NULL; -PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT = NULL; -PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT = NULL; -PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT = NULL; -PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT = NULL; -PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT = NULL; -PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT = NULL; -PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT = NULL; -PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT = NULL; -PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT = NULL; -PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT = NULL; -PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT = NULL; -PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT = NULL; -PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT = NULL; -PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT = NULL; -PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT = NULL; -PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT = NULL; -PFNGLSWIZZLEEXTPROC __glewSwizzleEXT = NULL; -PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT = NULL; -PFNGLVARIANTBVEXTPROC __glewVariantbvEXT = NULL; -PFNGLVARIANTDVEXTPROC __glewVariantdvEXT = NULL; -PFNGLVARIANTFVEXTPROC __glewVariantfvEXT = NULL; -PFNGLVARIANTIVEXTPROC __glewVariantivEXT = NULL; -PFNGLVARIANTSVEXTPROC __glewVariantsvEXT = NULL; -PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT = NULL; -PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT = NULL; -PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT = NULL; -PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT = NULL; - -PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT = NULL; -PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT = NULL; -PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT = NULL; - -PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT = NULL; - -PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY = NULL; - -PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY = NULL; - -PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP = NULL; -PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP = NULL; -PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP = NULL; -PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP = NULL; -PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP = NULL; -PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP = NULL; - -PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM = NULL; -PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM = NULL; - -PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM = NULL; -PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM = NULL; -PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM = NULL; -PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM = NULL; -PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM = NULL; -PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM = NULL; -PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM = NULL; -PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM = NULL; - -PFNGLMAPTEXTURE2DINTELPROC __glewMapTexture2DINTEL = NULL; -PFNGLSYNCTEXTUREINTELPROC __glewSyncTextureINTEL = NULL; -PFNGLUNMAPTEXTURE2DINTELPROC __glewUnmapTexture2DINTEL = NULL; - -PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL = NULL; -PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL = NULL; -PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL = NULL; -PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL = NULL; - -PFNGLBEGINPERFQUERYINTELPROC __glewBeginPerfQueryINTEL = NULL; -PFNGLCREATEPERFQUERYINTELPROC __glewCreatePerfQueryINTEL = NULL; -PFNGLDELETEPERFQUERYINTELPROC __glewDeletePerfQueryINTEL = NULL; -PFNGLENDPERFQUERYINTELPROC __glewEndPerfQueryINTEL = NULL; -PFNGLGETFIRSTPERFQUERYIDINTELPROC __glewGetFirstPerfQueryIdINTEL = NULL; -PFNGLGETNEXTPERFQUERYIDINTELPROC __glewGetNextPerfQueryIdINTEL = NULL; -PFNGLGETPERFCOUNTERINFOINTELPROC __glewGetPerfCounterInfoINTEL = NULL; -PFNGLGETPERFQUERYDATAINTELPROC __glewGetPerfQueryDataINTEL = NULL; -PFNGLGETPERFQUERYIDBYNAMEINTELPROC __glewGetPerfQueryIdByNameINTEL = NULL; -PFNGLGETPERFQUERYINFOINTELPROC __glewGetPerfQueryInfoINTEL = NULL; - -PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL = NULL; -PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL = NULL; - -PFNGLBLENDBARRIERKHRPROC __glewBlendBarrierKHR = NULL; - -PFNGLDEBUGMESSAGECALLBACKPROC __glewDebugMessageCallback = NULL; -PFNGLDEBUGMESSAGECONTROLPROC __glewDebugMessageControl = NULL; -PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert = NULL; -PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog = NULL; -PFNGLGETOBJECTLABELPROC __glewGetObjectLabel = NULL; -PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel = NULL; -PFNGLOBJECTLABELPROC __glewObjectLabel = NULL; -PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel = NULL; -PFNGLPOPDEBUGGROUPPROC __glewPopDebugGroup = NULL; -PFNGLPUSHDEBUGGROUPPROC __glewPushDebugGroup = NULL; - -PFNGLGETNUNIFORMFVPROC __glewGetnUniformfv = NULL; -PFNGLGETNUNIFORMIVPROC __glewGetnUniformiv = NULL; -PFNGLGETNUNIFORMUIVPROC __glewGetnUniformuiv = NULL; -PFNGLREADNPIXELSPROC __glewReadnPixels = NULL; - -PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled = NULL; -PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion = NULL; -PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion = NULL; -PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion = NULL; -PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion = NULL; - -PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA = NULL; - -PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA = NULL; -PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA = NULL; -PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA = NULL; -PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA = NULL; -PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA = NULL; -PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA = NULL; -PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA = NULL; -PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA = NULL; -PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA = NULL; -PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA = NULL; -PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA = NULL; -PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA = NULL; -PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA = NULL; -PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA = NULL; -PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA = NULL; -PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA = NULL; -PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA = NULL; -PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA = NULL; -PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA = NULL; -PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA = NULL; -PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA = NULL; -PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA = NULL; -PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA = NULL; -PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA = NULL; - -PFNGLBEGINCONDITIONALRENDERNVXPROC __glewBeginConditionalRenderNVX = NULL; -PFNGLENDCONDITIONALRENDERNVXPROC __glewEndConditionalRenderNVX = NULL; - -PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC __glewMultiDrawArraysIndirectBindlessNV = NULL; -PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC __glewMultiDrawElementsIndirectBindlessNV = NULL; - -PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC __glewMultiDrawArraysIndirectBindlessCountNV = NULL; -PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC __glewMultiDrawElementsIndirectBindlessCountNV = NULL; - -PFNGLGETIMAGEHANDLENVPROC __glewGetImageHandleNV = NULL; -PFNGLGETTEXTUREHANDLENVPROC __glewGetTextureHandleNV = NULL; -PFNGLGETTEXTURESAMPLERHANDLENVPROC __glewGetTextureSamplerHandleNV = NULL; -PFNGLISIMAGEHANDLERESIDENTNVPROC __glewIsImageHandleResidentNV = NULL; -PFNGLISTEXTUREHANDLERESIDENTNVPROC __glewIsTextureHandleResidentNV = NULL; -PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC __glewMakeImageHandleNonResidentNV = NULL; -PFNGLMAKEIMAGEHANDLERESIDENTNVPROC __glewMakeImageHandleResidentNV = NULL; -PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC __glewMakeTextureHandleNonResidentNV = NULL; -PFNGLMAKETEXTUREHANDLERESIDENTNVPROC __glewMakeTextureHandleResidentNV = NULL; -PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC __glewProgramUniformHandleui64NV = NULL; -PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC __glewProgramUniformHandleui64vNV = NULL; -PFNGLUNIFORMHANDLEUI64NVPROC __glewUniformHandleui64NV = NULL; -PFNGLUNIFORMHANDLEUI64VNVPROC __glewUniformHandleui64vNV = NULL; - -PFNGLBLENDBARRIERNVPROC __glewBlendBarrierNV = NULL; -PFNGLBLENDPARAMETERINVPROC __glewBlendParameteriNV = NULL; - -PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV = NULL; -PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV = NULL; - -PFNGLSUBPIXELPRECISIONBIASNVPROC __glewSubpixelPrecisionBiasNV = NULL; - -PFNGLCONSERVATIVERASTERPARAMETERFNVPROC __glewConservativeRasterParameterfNV = NULL; - -PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV = NULL; - -PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV = NULL; -PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV = NULL; -PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV = NULL; - -PFNGLDRAWTEXTURENVPROC __glewDrawTextureNV = NULL; - -PFNGLEVALMAPSNVPROC __glewEvalMapsNV = NULL; -PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV = NULL; -PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV = NULL; -PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV = NULL; -PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV = NULL; -PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV = NULL; -PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV = NULL; -PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV = NULL; -PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV = NULL; - -PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV = NULL; -PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV = NULL; -PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV = NULL; - -PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV = NULL; -PFNGLFINISHFENCENVPROC __glewFinishFenceNV = NULL; -PFNGLGENFENCESNVPROC __glewGenFencesNV = NULL; -PFNGLGETFENCEIVNVPROC __glewGetFenceivNV = NULL; -PFNGLISFENCENVPROC __glewIsFenceNV = NULL; -PFNGLSETFENCENVPROC __glewSetFenceNV = NULL; -PFNGLTESTFENCENVPROC __glewTestFenceNV = NULL; - -PFNGLFRAGMENTCOVERAGECOLORNVPROC __glewFragmentCoverageColorNV = NULL; - -PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV = NULL; -PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV = NULL; -PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV = NULL; -PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV = NULL; -PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV = NULL; -PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV = NULL; - -PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV = NULL; - -PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV = NULL; - -PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV = NULL; -PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV = NULL; -PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV = NULL; -PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV = NULL; -PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV = NULL; -PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV = NULL; -PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV = NULL; -PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV = NULL; -PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV = NULL; -PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV = NULL; -PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV = NULL; -PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV = NULL; - -PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV = NULL; -PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV = NULL; -PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV = NULL; -PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV = NULL; -PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV = NULL; -PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV = NULL; -PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV = NULL; -PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV = NULL; -PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV = NULL; -PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV = NULL; -PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV = NULL; -PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV = NULL; -PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV = NULL; -PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV = NULL; -PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV = NULL; -PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV = NULL; -PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV = NULL; -PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV = NULL; -PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV = NULL; -PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV = NULL; -PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV = NULL; -PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV = NULL; -PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV = NULL; -PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV = NULL; -PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV = NULL; -PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV = NULL; -PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV = NULL; -PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV = NULL; -PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV = NULL; -PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV = NULL; -PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV = NULL; -PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV = NULL; -PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV = NULL; -PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV = NULL; - -PFNGLCOLOR3HNVPROC __glewColor3hNV = NULL; -PFNGLCOLOR3HVNVPROC __glewColor3hvNV = NULL; -PFNGLCOLOR4HNVPROC __glewColor4hNV = NULL; -PFNGLCOLOR4HVNVPROC __glewColor4hvNV = NULL; -PFNGLFOGCOORDHNVPROC __glewFogCoordhNV = NULL; -PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV = NULL; -PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV = NULL; -PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV = NULL; -PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV = NULL; -PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV = NULL; -PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV = NULL; -PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV = NULL; -PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV = NULL; -PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV = NULL; -PFNGLNORMAL3HNVPROC __glewNormal3hNV = NULL; -PFNGLNORMAL3HVNVPROC __glewNormal3hvNV = NULL; -PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV = NULL; -PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV = NULL; -PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV = NULL; -PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV = NULL; -PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV = NULL; -PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV = NULL; -PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV = NULL; -PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV = NULL; -PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV = NULL; -PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV = NULL; -PFNGLVERTEX2HNVPROC __glewVertex2hNV = NULL; -PFNGLVERTEX2HVNVPROC __glewVertex2hvNV = NULL; -PFNGLVERTEX3HNVPROC __glewVertex3hNV = NULL; -PFNGLVERTEX3HVNVPROC __glewVertex3hvNV = NULL; -PFNGLVERTEX4HNVPROC __glewVertex4hNV = NULL; -PFNGLVERTEX4HVNVPROC __glewVertex4hvNV = NULL; -PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV = NULL; -PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV = NULL; -PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV = NULL; -PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV = NULL; -PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV = NULL; -PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV = NULL; -PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV = NULL; -PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV = NULL; -PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV = NULL; -PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV = NULL; -PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV = NULL; -PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV = NULL; -PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV = NULL; -PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV = NULL; - -PFNGLGETINTERNALFORMATSAMPLEIVNVPROC __glewGetInternalformatSampleivNV = NULL; - -PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV = NULL; -PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV = NULL; -PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV = NULL; -PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV = NULL; -PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV = NULL; -PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV = NULL; -PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV = NULL; - -PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV = NULL; -PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV = NULL; -PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV = NULL; - -PFNGLCOPYPATHNVPROC __glewCopyPathNV = NULL; -PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV = NULL; -PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV = NULL; -PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV = NULL; -PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV = NULL; -PFNGLDELETEPATHSNVPROC __glewDeletePathsNV = NULL; -PFNGLGENPATHSNVPROC __glewGenPathsNV = NULL; -PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV = NULL; -PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV = NULL; -PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV = NULL; -PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV = NULL; -PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV = NULL; -PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV = NULL; -PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV = NULL; -PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV = NULL; -PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV = NULL; -PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV = NULL; -PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV = NULL; -PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV = NULL; -PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV = NULL; -PFNGLGETPROGRAMRESOURCEFVNVPROC __glewGetProgramResourcefvNV = NULL; -PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV = NULL; -PFNGLISPATHNVPROC __glewIsPathNV = NULL; -PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV = NULL; -PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV = NULL; -PFNGLMATRIXLOAD3X2FNVPROC __glewMatrixLoad3x2fNV = NULL; -PFNGLMATRIXLOAD3X3FNVPROC __glewMatrixLoad3x3fNV = NULL; -PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC __glewMatrixLoadTranspose3x3fNV = NULL; -PFNGLMATRIXMULT3X2FNVPROC __glewMatrixMult3x2fNV = NULL; -PFNGLMATRIXMULT3X3FNVPROC __glewMatrixMult3x3fNV = NULL; -PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC __glewMatrixMultTranspose3x3fNV = NULL; -PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV = NULL; -PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV = NULL; -PFNGLPATHCOORDSNVPROC __glewPathCoordsNV = NULL; -PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV = NULL; -PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV = NULL; -PFNGLPATHFOGGENNVPROC __glewPathFogGenNV = NULL; -PFNGLPATHGLYPHINDEXARRAYNVPROC __glewPathGlyphIndexArrayNV = NULL; -PFNGLPATHGLYPHINDEXRANGENVPROC __glewPathGlyphIndexRangeNV = NULL; -PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV = NULL; -PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV = NULL; -PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC __glewPathMemoryGlyphIndexArrayNV = NULL; -PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV = NULL; -PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV = NULL; -PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV = NULL; -PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV = NULL; -PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV = NULL; -PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV = NULL; -PFNGLPATHSTRINGNVPROC __glewPathStringNV = NULL; -PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV = NULL; -PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV = NULL; -PFNGLPATHTEXGENNVPROC __glewPathTexGenNV = NULL; -PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV = NULL; -PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC __glewProgramPathFragmentInputGenNV = NULL; -PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV = NULL; -PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV = NULL; -PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV = NULL; -PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV = NULL; -PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC __glewStencilThenCoverFillPathInstancedNV = NULL; -PFNGLSTENCILTHENCOVERFILLPATHNVPROC __glewStencilThenCoverFillPathNV = NULL; -PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC __glewStencilThenCoverStrokePathInstancedNV = NULL; -PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC __glewStencilThenCoverStrokePathNV = NULL; -PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV = NULL; -PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV = NULL; - -PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV = NULL; -PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV = NULL; - -PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV = NULL; -PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV = NULL; - -PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV = NULL; -PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV = NULL; -PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV = NULL; -PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV = NULL; -PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV = NULL; -PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV = NULL; - -PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV = NULL; -PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV = NULL; - -PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV = NULL; -PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV = NULL; -PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV = NULL; -PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV = NULL; -PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV = NULL; -PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV = NULL; -PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV = NULL; -PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV = NULL; -PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV = NULL; -PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV = NULL; -PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV = NULL; -PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV = NULL; -PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV = NULL; - -PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV = NULL; -PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV = NULL; - -PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewFramebufferSampleLocationsfvNV = NULL; -PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewNamedFramebufferSampleLocationsfvNV = NULL; - -PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV = NULL; -PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV = NULL; -PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV = NULL; -PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV = NULL; -PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV = NULL; -PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV = NULL; -PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV = NULL; -PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV = NULL; -PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV = NULL; -PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV = NULL; -PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV = NULL; -PFNGLUNIFORMUI64NVPROC __glewUniformui64NV = NULL; -PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV = NULL; - -PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV = NULL; - -PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV = NULL; -PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV = NULL; -PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV = NULL; -PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV = NULL; -PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV = NULL; -PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV = NULL; - -PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV = NULL; -PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV = NULL; -PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV = NULL; -PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV = NULL; -PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV = NULL; -PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV = NULL; -PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV = NULL; -PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV = NULL; -PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV = NULL; -PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV = NULL; -PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV = NULL; - -PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV = NULL; -PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV = NULL; -PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV = NULL; -PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV = NULL; -PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV = NULL; -PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV = NULL; -PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV = NULL; - -PFNGLVDPAUFININVPROC __glewVDPAUFiniNV = NULL; -PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV = NULL; -PFNGLVDPAUINITNVPROC __glewVDPAUInitNV = NULL; -PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV = NULL; -PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV = NULL; -PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV = NULL; -PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV = NULL; -PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV = NULL; -PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV = NULL; -PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV = NULL; - -PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV = NULL; -PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV = NULL; - -PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV = NULL; -PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV = NULL; -PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV = NULL; -PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV = NULL; -PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV = NULL; -PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV = NULL; -PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV = NULL; -PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV = NULL; -PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV = NULL; -PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV = NULL; -PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV = NULL; -PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV = NULL; -PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV = NULL; -PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV = NULL; -PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV = NULL; -PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV = NULL; -PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV = NULL; -PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV = NULL; -PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV = NULL; - -PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV = NULL; -PFNGLCOLORFORMATNVPROC __glewColorFormatNV = NULL; -PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV = NULL; -PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV = NULL; -PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV = NULL; -PFNGLINDEXFORMATNVPROC __glewIndexFormatNV = NULL; -PFNGLNORMALFORMATNVPROC __glewNormalFormatNV = NULL; -PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV = NULL; -PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV = NULL; -PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV = NULL; -PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV = NULL; -PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV = NULL; - -PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV = NULL; -PFNGLBINDPROGRAMNVPROC __glewBindProgramNV = NULL; -PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV = NULL; -PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV = NULL; -PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV = NULL; -PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV = NULL; -PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV = NULL; -PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV = NULL; -PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV = NULL; -PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV = NULL; -PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV = NULL; -PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV = NULL; -PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV = NULL; -PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV = NULL; -PFNGLISPROGRAMNVPROC __glewIsProgramNV = NULL; -PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV = NULL; -PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV = NULL; -PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV = NULL; -PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV = NULL; -PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV = NULL; -PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV = NULL; -PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV = NULL; -PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV = NULL; -PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV = NULL; -PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV = NULL; -PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV = NULL; -PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV = NULL; -PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV = NULL; -PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV = NULL; -PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV = NULL; -PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV = NULL; -PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV = NULL; -PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV = NULL; -PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV = NULL; -PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV = NULL; -PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV = NULL; -PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV = NULL; -PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV = NULL; -PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV = NULL; -PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV = NULL; -PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV = NULL; -PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV = NULL; -PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV = NULL; -PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV = NULL; -PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV = NULL; -PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV = NULL; -PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV = NULL; -PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV = NULL; -PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV = NULL; -PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV = NULL; -PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV = NULL; -PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV = NULL; -PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV = NULL; -PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV = NULL; -PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV = NULL; -PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV = NULL; -PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV = NULL; -PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV = NULL; -PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV = NULL; -PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV = NULL; -PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV = NULL; -PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV = NULL; -PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV = NULL; -PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV = NULL; - -PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV = NULL; -PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV = NULL; -PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV = NULL; -PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV = NULL; -PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV = NULL; -PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV = NULL; -PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV = NULL; -PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV = NULL; -PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV = NULL; -PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV = NULL; -PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV = NULL; -PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV = NULL; - -PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES = NULL; -PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES = NULL; -PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES = NULL; -PFNGLFRUSTUMFOESPROC __glewFrustumfOES = NULL; -PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES = NULL; -PFNGLORTHOFOESPROC __glewOrthofOES = NULL; - -PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC __glewFramebufferTextureMultiviewOVR = NULL; - -PFNGLALPHAFUNCXPROC __glewAlphaFuncx = NULL; -PFNGLCLEARCOLORXPROC __glewClearColorx = NULL; -PFNGLCLEARDEPTHXPROC __glewClearDepthx = NULL; -PFNGLCOLOR4XPROC __glewColor4x = NULL; -PFNGLDEPTHRANGEXPROC __glewDepthRangex = NULL; -PFNGLFOGXPROC __glewFogx = NULL; -PFNGLFOGXVPROC __glewFogxv = NULL; -PFNGLFRUSTUMFPROC __glewFrustumf = NULL; -PFNGLFRUSTUMXPROC __glewFrustumx = NULL; -PFNGLLIGHTMODELXPROC __glewLightModelx = NULL; -PFNGLLIGHTMODELXVPROC __glewLightModelxv = NULL; -PFNGLLIGHTXPROC __glewLightx = NULL; -PFNGLLIGHTXVPROC __glewLightxv = NULL; -PFNGLLINEWIDTHXPROC __glewLineWidthx = NULL; -PFNGLLOADMATRIXXPROC __glewLoadMatrixx = NULL; -PFNGLMATERIALXPROC __glewMaterialx = NULL; -PFNGLMATERIALXVPROC __glewMaterialxv = NULL; -PFNGLMULTMATRIXXPROC __glewMultMatrixx = NULL; -PFNGLMULTITEXCOORD4XPROC __glewMultiTexCoord4x = NULL; -PFNGLNORMAL3XPROC __glewNormal3x = NULL; -PFNGLORTHOFPROC __glewOrthof = NULL; -PFNGLORTHOXPROC __glewOrthox = NULL; -PFNGLPOINTSIZEXPROC __glewPointSizex = NULL; -PFNGLPOLYGONOFFSETXPROC __glewPolygonOffsetx = NULL; -PFNGLROTATEXPROC __glewRotatex = NULL; -PFNGLSAMPLECOVERAGEXPROC __glewSampleCoveragex = NULL; -PFNGLSCALEXPROC __glewScalex = NULL; -PFNGLTEXENVXPROC __glewTexEnvx = NULL; -PFNGLTEXENVXVPROC __glewTexEnvxv = NULL; -PFNGLTEXPARAMETERXPROC __glewTexParameterx = NULL; -PFNGLTRANSLATEXPROC __glewTranslatex = NULL; - -PFNGLCLIPPLANEFPROC __glewClipPlanef = NULL; -PFNGLCLIPPLANEXPROC __glewClipPlanex = NULL; -PFNGLGETCLIPPLANEFPROC __glewGetClipPlanef = NULL; -PFNGLGETCLIPPLANEXPROC __glewGetClipPlanex = NULL; -PFNGLGETFIXEDVPROC __glewGetFixedv = NULL; -PFNGLGETLIGHTXVPROC __glewGetLightxv = NULL; -PFNGLGETMATERIALXVPROC __glewGetMaterialxv = NULL; -PFNGLGETTEXENVXVPROC __glewGetTexEnvxv = NULL; -PFNGLGETTEXPARAMETERXVPROC __glewGetTexParameterxv = NULL; -PFNGLPOINTPARAMETERXPROC __glewPointParameterx = NULL; -PFNGLPOINTPARAMETERXVPROC __glewPointParameterxv = NULL; -PFNGLPOINTSIZEPOINTEROESPROC __glewPointSizePointerOES = NULL; -PFNGLTEXPARAMETERXVPROC __glewTexParameterxv = NULL; - -PFNGLERRORSTRINGREGALPROC __glewErrorStringREGAL = NULL; - -PFNGLGETEXTENSIONREGALPROC __glewGetExtensionREGAL = NULL; -PFNGLISSUPPORTEDREGALPROC __glewIsSupportedREGAL = NULL; - -PFNGLLOGMESSAGECALLBACKREGALPROC __glewLogMessageCallbackREGAL = NULL; - -PFNGLGETPROCADDRESSREGALPROC __glewGetProcAddressREGAL = NULL; - -PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS = NULL; -PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS = NULL; - -PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS = NULL; -PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS = NULL; - -PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS = NULL; -PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS = NULL; - -PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS = NULL; -PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS = NULL; - -PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS = NULL; -PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS = NULL; - -PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS = NULL; -PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS = NULL; - -PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX = NULL; -PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX = NULL; -PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX = NULL; -PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX = NULL; -PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX = NULL; -PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX = NULL; - -PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX = NULL; - -PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX = NULL; - -PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX = NULL; -PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX = NULL; -PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX = NULL; -PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX = NULL; -PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX = NULL; -PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX = NULL; -PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX = NULL; -PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX = NULL; -PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX = NULL; -PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX = NULL; -PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX = NULL; -PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX = NULL; -PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX = NULL; -PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX = NULL; -PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX = NULL; -PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX = NULL; -PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX = NULL; - -PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX = NULL; - -PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX = NULL; - -PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX = NULL; - -PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX = NULL; -PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX = NULL; -PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX = NULL; -PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX = NULL; - -PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX = NULL; - -PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI = NULL; -PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI = NULL; -PFNGLCOLORTABLESGIPROC __glewColorTableSGI = NULL; -PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI = NULL; -PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI = NULL; -PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI = NULL; -PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI = NULL; - -PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX = NULL; - -PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN = NULL; -PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN = NULL; -PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN = NULL; -PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN = NULL; -PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN = NULL; -PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN = NULL; -PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN = NULL; -PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN = NULL; - -PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN = NULL; - -PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN = NULL; -PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN = NULL; -PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN = NULL; -PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN = NULL; -PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN = NULL; -PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN = NULL; -PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN = NULL; - -PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN = NULL; -PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN = NULL; -PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN = NULL; -PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN = NULL; -PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN = NULL; -PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN = NULL; -PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN = NULL; -PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN = NULL; -PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN = NULL; -PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN = NULL; -PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN = NULL; -PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN = NULL; -PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN = NULL; -PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN = NULL; -PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN = NULL; -PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN = NULL; -PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN = NULL; -PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN = NULL; -PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = NULL; -PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = NULL; -PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = NULL; -PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = NULL; -PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN = NULL; -PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN = NULL; -PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN = NULL; -PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN = NULL; -PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN = NULL; -PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN = NULL; -PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN = NULL; -PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN = NULL; -PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN = NULL; -PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN = NULL; -PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN = NULL; -PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN = NULL; -PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN = NULL; -PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN = NULL; -PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN = NULL; -PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN = NULL; -PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN = NULL; -PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN = NULL; - -PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN = NULL; - -#endif /* !WIN32 || !GLEW_MX */ - -#if !defined(GLEW_MX) - -GLboolean __GLEW_VERSION_1_1 = GL_FALSE; -GLboolean __GLEW_VERSION_1_2 = GL_FALSE; -GLboolean __GLEW_VERSION_1_2_1 = GL_FALSE; -GLboolean __GLEW_VERSION_1_3 = GL_FALSE; -GLboolean __GLEW_VERSION_1_4 = GL_FALSE; -GLboolean __GLEW_VERSION_1_5 = GL_FALSE; -GLboolean __GLEW_VERSION_2_0 = GL_FALSE; -GLboolean __GLEW_VERSION_2_1 = GL_FALSE; -GLboolean __GLEW_VERSION_3_0 = GL_FALSE; -GLboolean __GLEW_VERSION_3_1 = GL_FALSE; -GLboolean __GLEW_VERSION_3_2 = GL_FALSE; -GLboolean __GLEW_VERSION_3_3 = GL_FALSE; -GLboolean __GLEW_VERSION_4_0 = GL_FALSE; -GLboolean __GLEW_VERSION_4_1 = GL_FALSE; -GLboolean __GLEW_VERSION_4_2 = GL_FALSE; -GLboolean __GLEW_VERSION_4_3 = GL_FALSE; -GLboolean __GLEW_VERSION_4_4 = GL_FALSE; -GLboolean __GLEW_VERSION_4_5 = GL_FALSE; -GLboolean __GLEW_3DFX_multisample = GL_FALSE; -GLboolean __GLEW_3DFX_tbuffer = GL_FALSE; -GLboolean __GLEW_3DFX_texture_compression_FXT1 = GL_FALSE; -GLboolean __GLEW_AMD_blend_minmax_factor = GL_FALSE; -GLboolean __GLEW_AMD_conservative_depth = GL_FALSE; -GLboolean __GLEW_AMD_debug_output = GL_FALSE; -GLboolean __GLEW_AMD_depth_clamp_separate = GL_FALSE; -GLboolean __GLEW_AMD_draw_buffers_blend = GL_FALSE; -GLboolean __GLEW_AMD_gcn_shader = GL_FALSE; -GLboolean __GLEW_AMD_gpu_shader_int64 = GL_FALSE; -GLboolean __GLEW_AMD_interleaved_elements = GL_FALSE; -GLboolean __GLEW_AMD_multi_draw_indirect = GL_FALSE; -GLboolean __GLEW_AMD_name_gen_delete = GL_FALSE; -GLboolean __GLEW_AMD_occlusion_query_event = GL_FALSE; -GLboolean __GLEW_AMD_performance_monitor = GL_FALSE; -GLboolean __GLEW_AMD_pinned_memory = GL_FALSE; -GLboolean __GLEW_AMD_query_buffer_object = GL_FALSE; -GLboolean __GLEW_AMD_sample_positions = GL_FALSE; -GLboolean __GLEW_AMD_seamless_cubemap_per_texture = GL_FALSE; -GLboolean __GLEW_AMD_shader_atomic_counter_ops = GL_FALSE; -GLboolean __GLEW_AMD_shader_stencil_export = GL_FALSE; -GLboolean __GLEW_AMD_shader_stencil_value_export = GL_FALSE; -GLboolean __GLEW_AMD_shader_trinary_minmax = GL_FALSE; -GLboolean __GLEW_AMD_sparse_texture = GL_FALSE; -GLboolean __GLEW_AMD_stencil_operation_extended = GL_FALSE; -GLboolean __GLEW_AMD_texture_texture4 = GL_FALSE; -GLboolean __GLEW_AMD_transform_feedback3_lines_triangles = GL_FALSE; -GLboolean __GLEW_AMD_transform_feedback4 = GL_FALSE; -GLboolean __GLEW_AMD_vertex_shader_layer = GL_FALSE; -GLboolean __GLEW_AMD_vertex_shader_tessellator = GL_FALSE; -GLboolean __GLEW_AMD_vertex_shader_viewport_index = GL_FALSE; -GLboolean __GLEW_ANGLE_depth_texture = GL_FALSE; -GLboolean __GLEW_ANGLE_framebuffer_blit = GL_FALSE; -GLboolean __GLEW_ANGLE_framebuffer_multisample = GL_FALSE; -GLboolean __GLEW_ANGLE_instanced_arrays = GL_FALSE; -GLboolean __GLEW_ANGLE_pack_reverse_row_order = GL_FALSE; -GLboolean __GLEW_ANGLE_program_binary = GL_FALSE; -GLboolean __GLEW_ANGLE_texture_compression_dxt1 = GL_FALSE; -GLboolean __GLEW_ANGLE_texture_compression_dxt3 = GL_FALSE; -GLboolean __GLEW_ANGLE_texture_compression_dxt5 = GL_FALSE; -GLboolean __GLEW_ANGLE_texture_usage = GL_FALSE; -GLboolean __GLEW_ANGLE_timer_query = GL_FALSE; -GLboolean __GLEW_ANGLE_translated_shader_source = GL_FALSE; -GLboolean __GLEW_APPLE_aux_depth_stencil = GL_FALSE; -GLboolean __GLEW_APPLE_client_storage = GL_FALSE; -GLboolean __GLEW_APPLE_element_array = GL_FALSE; -GLboolean __GLEW_APPLE_fence = GL_FALSE; -GLboolean __GLEW_APPLE_float_pixels = GL_FALSE; -GLboolean __GLEW_APPLE_flush_buffer_range = GL_FALSE; -GLboolean __GLEW_APPLE_object_purgeable = GL_FALSE; -GLboolean __GLEW_APPLE_pixel_buffer = GL_FALSE; -GLboolean __GLEW_APPLE_rgb_422 = GL_FALSE; -GLboolean __GLEW_APPLE_row_bytes = GL_FALSE; -GLboolean __GLEW_APPLE_specular_vector = GL_FALSE; -GLboolean __GLEW_APPLE_texture_range = GL_FALSE; -GLboolean __GLEW_APPLE_transform_hint = GL_FALSE; -GLboolean __GLEW_APPLE_vertex_array_object = GL_FALSE; -GLboolean __GLEW_APPLE_vertex_array_range = GL_FALSE; -GLboolean __GLEW_APPLE_vertex_program_evaluators = GL_FALSE; -GLboolean __GLEW_APPLE_ycbcr_422 = GL_FALSE; -GLboolean __GLEW_ARB_ES2_compatibility = GL_FALSE; -GLboolean __GLEW_ARB_ES3_1_compatibility = GL_FALSE; -GLboolean __GLEW_ARB_ES3_2_compatibility = GL_FALSE; -GLboolean __GLEW_ARB_ES3_compatibility = GL_FALSE; -GLboolean __GLEW_ARB_arrays_of_arrays = GL_FALSE; -GLboolean __GLEW_ARB_base_instance = GL_FALSE; -GLboolean __GLEW_ARB_bindless_texture = GL_FALSE; -GLboolean __GLEW_ARB_blend_func_extended = GL_FALSE; -GLboolean __GLEW_ARB_buffer_storage = GL_FALSE; -GLboolean __GLEW_ARB_cl_event = GL_FALSE; -GLboolean __GLEW_ARB_clear_buffer_object = GL_FALSE; -GLboolean __GLEW_ARB_clear_texture = GL_FALSE; -GLboolean __GLEW_ARB_clip_control = GL_FALSE; -GLboolean __GLEW_ARB_color_buffer_float = GL_FALSE; -GLboolean __GLEW_ARB_compatibility = GL_FALSE; -GLboolean __GLEW_ARB_compressed_texture_pixel_storage = GL_FALSE; -GLboolean __GLEW_ARB_compute_shader = GL_FALSE; -GLboolean __GLEW_ARB_compute_variable_group_size = GL_FALSE; -GLboolean __GLEW_ARB_conditional_render_inverted = GL_FALSE; -GLboolean __GLEW_ARB_conservative_depth = GL_FALSE; -GLboolean __GLEW_ARB_copy_buffer = GL_FALSE; -GLboolean __GLEW_ARB_copy_image = GL_FALSE; -GLboolean __GLEW_ARB_cull_distance = GL_FALSE; -GLboolean __GLEW_ARB_debug_output = GL_FALSE; -GLboolean __GLEW_ARB_depth_buffer_float = GL_FALSE; -GLboolean __GLEW_ARB_depth_clamp = GL_FALSE; -GLboolean __GLEW_ARB_depth_texture = GL_FALSE; -GLboolean __GLEW_ARB_derivative_control = GL_FALSE; -GLboolean __GLEW_ARB_direct_state_access = GL_FALSE; -GLboolean __GLEW_ARB_draw_buffers = GL_FALSE; -GLboolean __GLEW_ARB_draw_buffers_blend = GL_FALSE; -GLboolean __GLEW_ARB_draw_elements_base_vertex = GL_FALSE; -GLboolean __GLEW_ARB_draw_indirect = GL_FALSE; -GLboolean __GLEW_ARB_draw_instanced = GL_FALSE; -GLboolean __GLEW_ARB_enhanced_layouts = GL_FALSE; -GLboolean __GLEW_ARB_explicit_attrib_location = GL_FALSE; -GLboolean __GLEW_ARB_explicit_uniform_location = GL_FALSE; -GLboolean __GLEW_ARB_fragment_coord_conventions = GL_FALSE; -GLboolean __GLEW_ARB_fragment_layer_viewport = GL_FALSE; -GLboolean __GLEW_ARB_fragment_program = GL_FALSE; -GLboolean __GLEW_ARB_fragment_program_shadow = GL_FALSE; -GLboolean __GLEW_ARB_fragment_shader = GL_FALSE; -GLboolean __GLEW_ARB_fragment_shader_interlock = GL_FALSE; -GLboolean __GLEW_ARB_framebuffer_no_attachments = GL_FALSE; -GLboolean __GLEW_ARB_framebuffer_object = GL_FALSE; -GLboolean __GLEW_ARB_framebuffer_sRGB = GL_FALSE; -GLboolean __GLEW_ARB_geometry_shader4 = GL_FALSE; -GLboolean __GLEW_ARB_get_program_binary = GL_FALSE; -GLboolean __GLEW_ARB_get_texture_sub_image = GL_FALSE; -GLboolean __GLEW_ARB_gpu_shader5 = GL_FALSE; -GLboolean __GLEW_ARB_gpu_shader_fp64 = GL_FALSE; -GLboolean __GLEW_ARB_gpu_shader_int64 = GL_FALSE; -GLboolean __GLEW_ARB_half_float_pixel = GL_FALSE; -GLboolean __GLEW_ARB_half_float_vertex = GL_FALSE; -GLboolean __GLEW_ARB_imaging = GL_FALSE; -GLboolean __GLEW_ARB_indirect_parameters = GL_FALSE; -GLboolean __GLEW_ARB_instanced_arrays = GL_FALSE; -GLboolean __GLEW_ARB_internalformat_query = GL_FALSE; -GLboolean __GLEW_ARB_internalformat_query2 = GL_FALSE; -GLboolean __GLEW_ARB_invalidate_subdata = GL_FALSE; -GLboolean __GLEW_ARB_map_buffer_alignment = GL_FALSE; -GLboolean __GLEW_ARB_map_buffer_range = GL_FALSE; -GLboolean __GLEW_ARB_matrix_palette = GL_FALSE; -GLboolean __GLEW_ARB_multi_bind = GL_FALSE; -GLboolean __GLEW_ARB_multi_draw_indirect = GL_FALSE; -GLboolean __GLEW_ARB_multisample = GL_FALSE; -GLboolean __GLEW_ARB_multitexture = GL_FALSE; -GLboolean __GLEW_ARB_occlusion_query = GL_FALSE; -GLboolean __GLEW_ARB_occlusion_query2 = GL_FALSE; -GLboolean __GLEW_ARB_parallel_shader_compile = GL_FALSE; -GLboolean __GLEW_ARB_pipeline_statistics_query = GL_FALSE; -GLboolean __GLEW_ARB_pixel_buffer_object = GL_FALSE; -GLboolean __GLEW_ARB_point_parameters = GL_FALSE; -GLboolean __GLEW_ARB_point_sprite = GL_FALSE; -GLboolean __GLEW_ARB_post_depth_coverage = GL_FALSE; -GLboolean __GLEW_ARB_program_interface_query = GL_FALSE; -GLboolean __GLEW_ARB_provoking_vertex = GL_FALSE; -GLboolean __GLEW_ARB_query_buffer_object = GL_FALSE; -GLboolean __GLEW_ARB_robust_buffer_access_behavior = GL_FALSE; -GLboolean __GLEW_ARB_robustness = GL_FALSE; -GLboolean __GLEW_ARB_robustness_application_isolation = GL_FALSE; -GLboolean __GLEW_ARB_robustness_share_group_isolation = GL_FALSE; -GLboolean __GLEW_ARB_sample_locations = GL_FALSE; -GLboolean __GLEW_ARB_sample_shading = GL_FALSE; -GLboolean __GLEW_ARB_sampler_objects = GL_FALSE; -GLboolean __GLEW_ARB_seamless_cube_map = GL_FALSE; -GLboolean __GLEW_ARB_seamless_cubemap_per_texture = GL_FALSE; -GLboolean __GLEW_ARB_separate_shader_objects = GL_FALSE; -GLboolean __GLEW_ARB_shader_atomic_counter_ops = GL_FALSE; -GLboolean __GLEW_ARB_shader_atomic_counters = GL_FALSE; -GLboolean __GLEW_ARB_shader_ballot = GL_FALSE; -GLboolean __GLEW_ARB_shader_bit_encoding = GL_FALSE; -GLboolean __GLEW_ARB_shader_clock = GL_FALSE; -GLboolean __GLEW_ARB_shader_draw_parameters = GL_FALSE; -GLboolean __GLEW_ARB_shader_group_vote = GL_FALSE; -GLboolean __GLEW_ARB_shader_image_load_store = GL_FALSE; -GLboolean __GLEW_ARB_shader_image_size = GL_FALSE; -GLboolean __GLEW_ARB_shader_objects = GL_FALSE; -GLboolean __GLEW_ARB_shader_precision = GL_FALSE; -GLboolean __GLEW_ARB_shader_stencil_export = GL_FALSE; -GLboolean __GLEW_ARB_shader_storage_buffer_object = GL_FALSE; -GLboolean __GLEW_ARB_shader_subroutine = GL_FALSE; -GLboolean __GLEW_ARB_shader_texture_image_samples = GL_FALSE; -GLboolean __GLEW_ARB_shader_texture_lod = GL_FALSE; -GLboolean __GLEW_ARB_shader_viewport_layer_array = GL_FALSE; -GLboolean __GLEW_ARB_shading_language_100 = GL_FALSE; -GLboolean __GLEW_ARB_shading_language_420pack = GL_FALSE; -GLboolean __GLEW_ARB_shading_language_include = GL_FALSE; -GLboolean __GLEW_ARB_shading_language_packing = GL_FALSE; -GLboolean __GLEW_ARB_shadow = GL_FALSE; -GLboolean __GLEW_ARB_shadow_ambient = GL_FALSE; -GLboolean __GLEW_ARB_sparse_buffer = GL_FALSE; -GLboolean __GLEW_ARB_sparse_texture = GL_FALSE; -GLboolean __GLEW_ARB_sparse_texture2 = GL_FALSE; -GLboolean __GLEW_ARB_sparse_texture_clamp = GL_FALSE; -GLboolean __GLEW_ARB_stencil_texturing = GL_FALSE; -GLboolean __GLEW_ARB_sync = GL_FALSE; -GLboolean __GLEW_ARB_tessellation_shader = GL_FALSE; -GLboolean __GLEW_ARB_texture_barrier = GL_FALSE; -GLboolean __GLEW_ARB_texture_border_clamp = GL_FALSE; -GLboolean __GLEW_ARB_texture_buffer_object = GL_FALSE; -GLboolean __GLEW_ARB_texture_buffer_object_rgb32 = GL_FALSE; -GLboolean __GLEW_ARB_texture_buffer_range = GL_FALSE; -GLboolean __GLEW_ARB_texture_compression = GL_FALSE; -GLboolean __GLEW_ARB_texture_compression_bptc = GL_FALSE; -GLboolean __GLEW_ARB_texture_compression_rgtc = GL_FALSE; -GLboolean __GLEW_ARB_texture_cube_map = GL_FALSE; -GLboolean __GLEW_ARB_texture_cube_map_array = GL_FALSE; -GLboolean __GLEW_ARB_texture_env_add = GL_FALSE; -GLboolean __GLEW_ARB_texture_env_combine = GL_FALSE; -GLboolean __GLEW_ARB_texture_env_crossbar = GL_FALSE; -GLboolean __GLEW_ARB_texture_env_dot3 = GL_FALSE; -GLboolean __GLEW_ARB_texture_filter_minmax = GL_FALSE; -GLboolean __GLEW_ARB_texture_float = GL_FALSE; -GLboolean __GLEW_ARB_texture_gather = GL_FALSE; -GLboolean __GLEW_ARB_texture_mirror_clamp_to_edge = GL_FALSE; -GLboolean __GLEW_ARB_texture_mirrored_repeat = GL_FALSE; -GLboolean __GLEW_ARB_texture_multisample = GL_FALSE; -GLboolean __GLEW_ARB_texture_non_power_of_two = GL_FALSE; -GLboolean __GLEW_ARB_texture_query_levels = GL_FALSE; -GLboolean __GLEW_ARB_texture_query_lod = GL_FALSE; -GLboolean __GLEW_ARB_texture_rectangle = GL_FALSE; -GLboolean __GLEW_ARB_texture_rg = GL_FALSE; -GLboolean __GLEW_ARB_texture_rgb10_a2ui = GL_FALSE; -GLboolean __GLEW_ARB_texture_stencil8 = GL_FALSE; -GLboolean __GLEW_ARB_texture_storage = GL_FALSE; -GLboolean __GLEW_ARB_texture_storage_multisample = GL_FALSE; -GLboolean __GLEW_ARB_texture_swizzle = GL_FALSE; -GLboolean __GLEW_ARB_texture_view = GL_FALSE; -GLboolean __GLEW_ARB_timer_query = GL_FALSE; -GLboolean __GLEW_ARB_transform_feedback2 = GL_FALSE; -GLboolean __GLEW_ARB_transform_feedback3 = GL_FALSE; -GLboolean __GLEW_ARB_transform_feedback_instanced = GL_FALSE; -GLboolean __GLEW_ARB_transform_feedback_overflow_query = GL_FALSE; -GLboolean __GLEW_ARB_transpose_matrix = GL_FALSE; -GLboolean __GLEW_ARB_uniform_buffer_object = GL_FALSE; -GLboolean __GLEW_ARB_vertex_array_bgra = GL_FALSE; -GLboolean __GLEW_ARB_vertex_array_object = GL_FALSE; -GLboolean __GLEW_ARB_vertex_attrib_64bit = GL_FALSE; -GLboolean __GLEW_ARB_vertex_attrib_binding = GL_FALSE; -GLboolean __GLEW_ARB_vertex_blend = GL_FALSE; -GLboolean __GLEW_ARB_vertex_buffer_object = GL_FALSE; -GLboolean __GLEW_ARB_vertex_program = GL_FALSE; -GLboolean __GLEW_ARB_vertex_shader = GL_FALSE; -GLboolean __GLEW_ARB_vertex_type_10f_11f_11f_rev = GL_FALSE; -GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev = GL_FALSE; -GLboolean __GLEW_ARB_viewport_array = GL_FALSE; -GLboolean __GLEW_ARB_window_pos = GL_FALSE; -GLboolean __GLEW_ATIX_point_sprites = GL_FALSE; -GLboolean __GLEW_ATIX_texture_env_combine3 = GL_FALSE; -GLboolean __GLEW_ATIX_texture_env_route = GL_FALSE; -GLboolean __GLEW_ATIX_vertex_shader_output_point_size = GL_FALSE; -GLboolean __GLEW_ATI_draw_buffers = GL_FALSE; -GLboolean __GLEW_ATI_element_array = GL_FALSE; -GLboolean __GLEW_ATI_envmap_bumpmap = GL_FALSE; -GLboolean __GLEW_ATI_fragment_shader = GL_FALSE; -GLboolean __GLEW_ATI_map_object_buffer = GL_FALSE; -GLboolean __GLEW_ATI_meminfo = GL_FALSE; -GLboolean __GLEW_ATI_pn_triangles = GL_FALSE; -GLboolean __GLEW_ATI_separate_stencil = GL_FALSE; -GLboolean __GLEW_ATI_shader_texture_lod = GL_FALSE; -GLboolean __GLEW_ATI_text_fragment_shader = GL_FALSE; -GLboolean __GLEW_ATI_texture_compression_3dc = GL_FALSE; -GLboolean __GLEW_ATI_texture_env_combine3 = GL_FALSE; -GLboolean __GLEW_ATI_texture_float = GL_FALSE; -GLboolean __GLEW_ATI_texture_mirror_once = GL_FALSE; -GLboolean __GLEW_ATI_vertex_array_object = GL_FALSE; -GLboolean __GLEW_ATI_vertex_attrib_array_object = GL_FALSE; -GLboolean __GLEW_ATI_vertex_streams = GL_FALSE; -GLboolean __GLEW_EXT_422_pixels = GL_FALSE; -GLboolean __GLEW_EXT_Cg_shader = GL_FALSE; -GLboolean __GLEW_EXT_abgr = GL_FALSE; -GLboolean __GLEW_EXT_bgra = GL_FALSE; -GLboolean __GLEW_EXT_bindable_uniform = GL_FALSE; -GLboolean __GLEW_EXT_blend_color = GL_FALSE; -GLboolean __GLEW_EXT_blend_equation_separate = GL_FALSE; -GLboolean __GLEW_EXT_blend_func_separate = GL_FALSE; -GLboolean __GLEW_EXT_blend_logic_op = GL_FALSE; -GLboolean __GLEW_EXT_blend_minmax = GL_FALSE; -GLboolean __GLEW_EXT_blend_subtract = GL_FALSE; -GLboolean __GLEW_EXT_clip_volume_hint = GL_FALSE; -GLboolean __GLEW_EXT_cmyka = GL_FALSE; -GLboolean __GLEW_EXT_color_subtable = GL_FALSE; -GLboolean __GLEW_EXT_compiled_vertex_array = GL_FALSE; -GLboolean __GLEW_EXT_convolution = GL_FALSE; -GLboolean __GLEW_EXT_coordinate_frame = GL_FALSE; -GLboolean __GLEW_EXT_copy_texture = GL_FALSE; -GLboolean __GLEW_EXT_cull_vertex = GL_FALSE; -GLboolean __GLEW_EXT_debug_label = GL_FALSE; -GLboolean __GLEW_EXT_debug_marker = GL_FALSE; -GLboolean __GLEW_EXT_depth_bounds_test = GL_FALSE; -GLboolean __GLEW_EXT_direct_state_access = GL_FALSE; -GLboolean __GLEW_EXT_draw_buffers2 = GL_FALSE; -GLboolean __GLEW_EXT_draw_instanced = GL_FALSE; -GLboolean __GLEW_EXT_draw_range_elements = GL_FALSE; -GLboolean __GLEW_EXT_fog_coord = GL_FALSE; -GLboolean __GLEW_EXT_fragment_lighting = GL_FALSE; -GLboolean __GLEW_EXT_framebuffer_blit = GL_FALSE; -GLboolean __GLEW_EXT_framebuffer_multisample = GL_FALSE; -GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled = GL_FALSE; -GLboolean __GLEW_EXT_framebuffer_object = GL_FALSE; -GLboolean __GLEW_EXT_framebuffer_sRGB = GL_FALSE; -GLboolean __GLEW_EXT_geometry_shader4 = GL_FALSE; -GLboolean __GLEW_EXT_gpu_program_parameters = GL_FALSE; -GLboolean __GLEW_EXT_gpu_shader4 = GL_FALSE; -GLboolean __GLEW_EXT_histogram = GL_FALSE; -GLboolean __GLEW_EXT_index_array_formats = GL_FALSE; -GLboolean __GLEW_EXT_index_func = GL_FALSE; -GLboolean __GLEW_EXT_index_material = GL_FALSE; -GLboolean __GLEW_EXT_index_texture = GL_FALSE; -GLboolean __GLEW_EXT_light_texture = GL_FALSE; -GLboolean __GLEW_EXT_misc_attribute = GL_FALSE; -GLboolean __GLEW_EXT_multi_draw_arrays = GL_FALSE; -GLboolean __GLEW_EXT_multisample = GL_FALSE; -GLboolean __GLEW_EXT_packed_depth_stencil = GL_FALSE; -GLboolean __GLEW_EXT_packed_float = GL_FALSE; -GLboolean __GLEW_EXT_packed_pixels = GL_FALSE; -GLboolean __GLEW_EXT_paletted_texture = GL_FALSE; -GLboolean __GLEW_EXT_pixel_buffer_object = GL_FALSE; -GLboolean __GLEW_EXT_pixel_transform = GL_FALSE; -GLboolean __GLEW_EXT_pixel_transform_color_table = GL_FALSE; -GLboolean __GLEW_EXT_point_parameters = GL_FALSE; -GLboolean __GLEW_EXT_polygon_offset = GL_FALSE; -GLboolean __GLEW_EXT_polygon_offset_clamp = GL_FALSE; -GLboolean __GLEW_EXT_post_depth_coverage = GL_FALSE; -GLboolean __GLEW_EXT_provoking_vertex = GL_FALSE; -GLboolean __GLEW_EXT_raster_multisample = GL_FALSE; -GLboolean __GLEW_EXT_rescale_normal = GL_FALSE; -GLboolean __GLEW_EXT_scene_marker = GL_FALSE; -GLboolean __GLEW_EXT_secondary_color = GL_FALSE; -GLboolean __GLEW_EXT_separate_shader_objects = GL_FALSE; -GLboolean __GLEW_EXT_separate_specular_color = GL_FALSE; -GLboolean __GLEW_EXT_shader_image_load_formatted = GL_FALSE; -GLboolean __GLEW_EXT_shader_image_load_store = GL_FALSE; -GLboolean __GLEW_EXT_shader_integer_mix = GL_FALSE; -GLboolean __GLEW_EXT_shadow_funcs = GL_FALSE; -GLboolean __GLEW_EXT_shared_texture_palette = GL_FALSE; -GLboolean __GLEW_EXT_sparse_texture2 = GL_FALSE; -GLboolean __GLEW_EXT_stencil_clear_tag = GL_FALSE; -GLboolean __GLEW_EXT_stencil_two_side = GL_FALSE; -GLboolean __GLEW_EXT_stencil_wrap = GL_FALSE; -GLboolean __GLEW_EXT_subtexture = GL_FALSE; -GLboolean __GLEW_EXT_texture = GL_FALSE; -GLboolean __GLEW_EXT_texture3D = GL_FALSE; -GLboolean __GLEW_EXT_texture_array = GL_FALSE; -GLboolean __GLEW_EXT_texture_buffer_object = GL_FALSE; -GLboolean __GLEW_EXT_texture_compression_dxt1 = GL_FALSE; -GLboolean __GLEW_EXT_texture_compression_latc = GL_FALSE; -GLboolean __GLEW_EXT_texture_compression_rgtc = GL_FALSE; -GLboolean __GLEW_EXT_texture_compression_s3tc = GL_FALSE; -GLboolean __GLEW_EXT_texture_cube_map = GL_FALSE; -GLboolean __GLEW_EXT_texture_edge_clamp = GL_FALSE; -GLboolean __GLEW_EXT_texture_env = GL_FALSE; -GLboolean __GLEW_EXT_texture_env_add = GL_FALSE; -GLboolean __GLEW_EXT_texture_env_combine = GL_FALSE; -GLboolean __GLEW_EXT_texture_env_dot3 = GL_FALSE; -GLboolean __GLEW_EXT_texture_filter_anisotropic = GL_FALSE; -GLboolean __GLEW_EXT_texture_filter_minmax = GL_FALSE; -GLboolean __GLEW_EXT_texture_integer = GL_FALSE; -GLboolean __GLEW_EXT_texture_lod_bias = GL_FALSE; -GLboolean __GLEW_EXT_texture_mirror_clamp = GL_FALSE; -GLboolean __GLEW_EXT_texture_object = GL_FALSE; -GLboolean __GLEW_EXT_texture_perturb_normal = GL_FALSE; -GLboolean __GLEW_EXT_texture_rectangle = GL_FALSE; -GLboolean __GLEW_EXT_texture_sRGB = GL_FALSE; -GLboolean __GLEW_EXT_texture_sRGB_decode = GL_FALSE; -GLboolean __GLEW_EXT_texture_shared_exponent = GL_FALSE; -GLboolean __GLEW_EXT_texture_snorm = GL_FALSE; -GLboolean __GLEW_EXT_texture_swizzle = GL_FALSE; -GLboolean __GLEW_EXT_timer_query = GL_FALSE; -GLboolean __GLEW_EXT_transform_feedback = GL_FALSE; -GLboolean __GLEW_EXT_vertex_array = GL_FALSE; -GLboolean __GLEW_EXT_vertex_array_bgra = GL_FALSE; -GLboolean __GLEW_EXT_vertex_attrib_64bit = GL_FALSE; -GLboolean __GLEW_EXT_vertex_shader = GL_FALSE; -GLboolean __GLEW_EXT_vertex_weighting = GL_FALSE; -GLboolean __GLEW_EXT_x11_sync_object = GL_FALSE; -GLboolean __GLEW_GREMEDY_frame_terminator = GL_FALSE; -GLboolean __GLEW_GREMEDY_string_marker = GL_FALSE; -GLboolean __GLEW_HP_convolution_border_modes = GL_FALSE; -GLboolean __GLEW_HP_image_transform = GL_FALSE; -GLboolean __GLEW_HP_occlusion_test = GL_FALSE; -GLboolean __GLEW_HP_texture_lighting = GL_FALSE; -GLboolean __GLEW_IBM_cull_vertex = GL_FALSE; -GLboolean __GLEW_IBM_multimode_draw_arrays = GL_FALSE; -GLboolean __GLEW_IBM_rasterpos_clip = GL_FALSE; -GLboolean __GLEW_IBM_static_data = GL_FALSE; -GLboolean __GLEW_IBM_texture_mirrored_repeat = GL_FALSE; -GLboolean __GLEW_IBM_vertex_array_lists = GL_FALSE; -GLboolean __GLEW_INGR_color_clamp = GL_FALSE; -GLboolean __GLEW_INGR_interlace_read = GL_FALSE; -GLboolean __GLEW_INTEL_fragment_shader_ordering = GL_FALSE; -GLboolean __GLEW_INTEL_framebuffer_CMAA = GL_FALSE; -GLboolean __GLEW_INTEL_map_texture = GL_FALSE; -GLboolean __GLEW_INTEL_parallel_arrays = GL_FALSE; -GLboolean __GLEW_INTEL_performance_query = GL_FALSE; -GLboolean __GLEW_INTEL_texture_scissor = GL_FALSE; -GLboolean __GLEW_KHR_blend_equation_advanced = GL_FALSE; -GLboolean __GLEW_KHR_blend_equation_advanced_coherent = GL_FALSE; -GLboolean __GLEW_KHR_context_flush_control = GL_FALSE; -GLboolean __GLEW_KHR_debug = GL_FALSE; -GLboolean __GLEW_KHR_no_error = GL_FALSE; -GLboolean __GLEW_KHR_robust_buffer_access_behavior = GL_FALSE; -GLboolean __GLEW_KHR_robustness = GL_FALSE; -GLboolean __GLEW_KHR_texture_compression_astc_hdr = GL_FALSE; -GLboolean __GLEW_KHR_texture_compression_astc_ldr = GL_FALSE; -GLboolean __GLEW_KTX_buffer_region = GL_FALSE; -GLboolean __GLEW_MESAX_texture_stack = GL_FALSE; -GLboolean __GLEW_MESA_pack_invert = GL_FALSE; -GLboolean __GLEW_MESA_resize_buffers = GL_FALSE; -GLboolean __GLEW_MESA_window_pos = GL_FALSE; -GLboolean __GLEW_MESA_ycbcr_texture = GL_FALSE; -GLboolean __GLEW_NVX_conditional_render = GL_FALSE; -GLboolean __GLEW_NVX_gpu_memory_info = GL_FALSE; -GLboolean __GLEW_NV_bindless_multi_draw_indirect = GL_FALSE; -GLboolean __GLEW_NV_bindless_multi_draw_indirect_count = GL_FALSE; -GLboolean __GLEW_NV_bindless_texture = GL_FALSE; -GLboolean __GLEW_NV_blend_equation_advanced = GL_FALSE; -GLboolean __GLEW_NV_blend_equation_advanced_coherent = GL_FALSE; -GLboolean __GLEW_NV_blend_square = GL_FALSE; -GLboolean __GLEW_NV_compute_program5 = GL_FALSE; -GLboolean __GLEW_NV_conditional_render = GL_FALSE; -GLboolean __GLEW_NV_conservative_raster = GL_FALSE; -GLboolean __GLEW_NV_conservative_raster_dilate = GL_FALSE; -GLboolean __GLEW_NV_copy_depth_to_color = GL_FALSE; -GLboolean __GLEW_NV_copy_image = GL_FALSE; -GLboolean __GLEW_NV_deep_texture3D = GL_FALSE; -GLboolean __GLEW_NV_depth_buffer_float = GL_FALSE; -GLboolean __GLEW_NV_depth_clamp = GL_FALSE; -GLboolean __GLEW_NV_depth_range_unclamped = GL_FALSE; -GLboolean __GLEW_NV_draw_texture = GL_FALSE; -GLboolean __GLEW_NV_evaluators = GL_FALSE; -GLboolean __GLEW_NV_explicit_multisample = GL_FALSE; -GLboolean __GLEW_NV_fence = GL_FALSE; -GLboolean __GLEW_NV_fill_rectangle = GL_FALSE; -GLboolean __GLEW_NV_float_buffer = GL_FALSE; -GLboolean __GLEW_NV_fog_distance = GL_FALSE; -GLboolean __GLEW_NV_fragment_coverage_to_color = GL_FALSE; -GLboolean __GLEW_NV_fragment_program = GL_FALSE; -GLboolean __GLEW_NV_fragment_program2 = GL_FALSE; -GLboolean __GLEW_NV_fragment_program4 = GL_FALSE; -GLboolean __GLEW_NV_fragment_program_option = GL_FALSE; -GLboolean __GLEW_NV_fragment_shader_interlock = GL_FALSE; -GLboolean __GLEW_NV_framebuffer_mixed_samples = GL_FALSE; -GLboolean __GLEW_NV_framebuffer_multisample_coverage = GL_FALSE; -GLboolean __GLEW_NV_geometry_program4 = GL_FALSE; -GLboolean __GLEW_NV_geometry_shader4 = GL_FALSE; -GLboolean __GLEW_NV_geometry_shader_passthrough = GL_FALSE; -GLboolean __GLEW_NV_gpu_program4 = GL_FALSE; -GLboolean __GLEW_NV_gpu_program5 = GL_FALSE; -GLboolean __GLEW_NV_gpu_program5_mem_extended = GL_FALSE; -GLboolean __GLEW_NV_gpu_program_fp64 = GL_FALSE; -GLboolean __GLEW_NV_gpu_shader5 = GL_FALSE; -GLboolean __GLEW_NV_half_float = GL_FALSE; -GLboolean __GLEW_NV_internalformat_sample_query = GL_FALSE; -GLboolean __GLEW_NV_light_max_exponent = GL_FALSE; -GLboolean __GLEW_NV_multisample_coverage = GL_FALSE; -GLboolean __GLEW_NV_multisample_filter_hint = GL_FALSE; -GLboolean __GLEW_NV_occlusion_query = GL_FALSE; -GLboolean __GLEW_NV_packed_depth_stencil = GL_FALSE; -GLboolean __GLEW_NV_parameter_buffer_object = GL_FALSE; -GLboolean __GLEW_NV_parameter_buffer_object2 = GL_FALSE; -GLboolean __GLEW_NV_path_rendering = GL_FALSE; -GLboolean __GLEW_NV_path_rendering_shared_edge = GL_FALSE; -GLboolean __GLEW_NV_pixel_data_range = GL_FALSE; -GLboolean __GLEW_NV_point_sprite = GL_FALSE; -GLboolean __GLEW_NV_present_video = GL_FALSE; -GLboolean __GLEW_NV_primitive_restart = GL_FALSE; -GLboolean __GLEW_NV_register_combiners = GL_FALSE; -GLboolean __GLEW_NV_register_combiners2 = GL_FALSE; -GLboolean __GLEW_NV_sample_locations = GL_FALSE; -GLboolean __GLEW_NV_sample_mask_override_coverage = GL_FALSE; -GLboolean __GLEW_NV_shader_atomic_counters = GL_FALSE; -GLboolean __GLEW_NV_shader_atomic_float = GL_FALSE; -GLboolean __GLEW_NV_shader_atomic_fp16_vector = GL_FALSE; -GLboolean __GLEW_NV_shader_atomic_int64 = GL_FALSE; -GLboolean __GLEW_NV_shader_buffer_load = GL_FALSE; -GLboolean __GLEW_NV_shader_storage_buffer_object = GL_FALSE; -GLboolean __GLEW_NV_shader_thread_group = GL_FALSE; -GLboolean __GLEW_NV_shader_thread_shuffle = GL_FALSE; -GLboolean __GLEW_NV_tessellation_program5 = GL_FALSE; -GLboolean __GLEW_NV_texgen_emboss = GL_FALSE; -GLboolean __GLEW_NV_texgen_reflection = GL_FALSE; -GLboolean __GLEW_NV_texture_barrier = GL_FALSE; -GLboolean __GLEW_NV_texture_compression_vtc = GL_FALSE; -GLboolean __GLEW_NV_texture_env_combine4 = GL_FALSE; -GLboolean __GLEW_NV_texture_expand_normal = GL_FALSE; -GLboolean __GLEW_NV_texture_multisample = GL_FALSE; -GLboolean __GLEW_NV_texture_rectangle = GL_FALSE; -GLboolean __GLEW_NV_texture_shader = GL_FALSE; -GLboolean __GLEW_NV_texture_shader2 = GL_FALSE; -GLboolean __GLEW_NV_texture_shader3 = GL_FALSE; -GLboolean __GLEW_NV_transform_feedback = GL_FALSE; -GLboolean __GLEW_NV_transform_feedback2 = GL_FALSE; -GLboolean __GLEW_NV_uniform_buffer_unified_memory = GL_FALSE; -GLboolean __GLEW_NV_vdpau_interop = GL_FALSE; -GLboolean __GLEW_NV_vertex_array_range = GL_FALSE; -GLboolean __GLEW_NV_vertex_array_range2 = GL_FALSE; -GLboolean __GLEW_NV_vertex_attrib_integer_64bit = GL_FALSE; -GLboolean __GLEW_NV_vertex_buffer_unified_memory = GL_FALSE; -GLboolean __GLEW_NV_vertex_program = GL_FALSE; -GLboolean __GLEW_NV_vertex_program1_1 = GL_FALSE; -GLboolean __GLEW_NV_vertex_program2 = GL_FALSE; -GLboolean __GLEW_NV_vertex_program2_option = GL_FALSE; -GLboolean __GLEW_NV_vertex_program3 = GL_FALSE; -GLboolean __GLEW_NV_vertex_program4 = GL_FALSE; -GLboolean __GLEW_NV_video_capture = GL_FALSE; -GLboolean __GLEW_NV_viewport_array2 = GL_FALSE; -GLboolean __GLEW_OES_byte_coordinates = GL_FALSE; -GLboolean __GLEW_OES_compressed_paletted_texture = GL_FALSE; -GLboolean __GLEW_OES_read_format = GL_FALSE; -GLboolean __GLEW_OES_single_precision = GL_FALSE; -GLboolean __GLEW_OML_interlace = GL_FALSE; -GLboolean __GLEW_OML_resample = GL_FALSE; -GLboolean __GLEW_OML_subsample = GL_FALSE; -GLboolean __GLEW_OVR_multiview = GL_FALSE; -GLboolean __GLEW_OVR_multiview2 = GL_FALSE; -GLboolean __GLEW_PGI_misc_hints = GL_FALSE; -GLboolean __GLEW_PGI_vertex_hints = GL_FALSE; -GLboolean __GLEW_REGAL_ES1_0_compatibility = GL_FALSE; -GLboolean __GLEW_REGAL_ES1_1_compatibility = GL_FALSE; -GLboolean __GLEW_REGAL_enable = GL_FALSE; -GLboolean __GLEW_REGAL_error_string = GL_FALSE; -GLboolean __GLEW_REGAL_extension_query = GL_FALSE; -GLboolean __GLEW_REGAL_log = GL_FALSE; -GLboolean __GLEW_REGAL_proc_address = GL_FALSE; -GLboolean __GLEW_REND_screen_coordinates = GL_FALSE; -GLboolean __GLEW_S3_s3tc = GL_FALSE; -GLboolean __GLEW_SGIS_color_range = GL_FALSE; -GLboolean __GLEW_SGIS_detail_texture = GL_FALSE; -GLboolean __GLEW_SGIS_fog_function = GL_FALSE; -GLboolean __GLEW_SGIS_generate_mipmap = GL_FALSE; -GLboolean __GLEW_SGIS_multisample = GL_FALSE; -GLboolean __GLEW_SGIS_pixel_texture = GL_FALSE; -GLboolean __GLEW_SGIS_point_line_texgen = GL_FALSE; -GLboolean __GLEW_SGIS_sharpen_texture = GL_FALSE; -GLboolean __GLEW_SGIS_texture4D = GL_FALSE; -GLboolean __GLEW_SGIS_texture_border_clamp = GL_FALSE; -GLboolean __GLEW_SGIS_texture_edge_clamp = GL_FALSE; -GLboolean __GLEW_SGIS_texture_filter4 = GL_FALSE; -GLboolean __GLEW_SGIS_texture_lod = GL_FALSE; -GLboolean __GLEW_SGIS_texture_select = GL_FALSE; -GLboolean __GLEW_SGIX_async = GL_FALSE; -GLboolean __GLEW_SGIX_async_histogram = GL_FALSE; -GLboolean __GLEW_SGIX_async_pixel = GL_FALSE; -GLboolean __GLEW_SGIX_blend_alpha_minmax = GL_FALSE; -GLboolean __GLEW_SGIX_clipmap = GL_FALSE; -GLboolean __GLEW_SGIX_convolution_accuracy = GL_FALSE; -GLboolean __GLEW_SGIX_depth_texture = GL_FALSE; -GLboolean __GLEW_SGIX_flush_raster = GL_FALSE; -GLboolean __GLEW_SGIX_fog_offset = GL_FALSE; -GLboolean __GLEW_SGIX_fog_texture = GL_FALSE; -GLboolean __GLEW_SGIX_fragment_specular_lighting = GL_FALSE; -GLboolean __GLEW_SGIX_framezoom = GL_FALSE; -GLboolean __GLEW_SGIX_interlace = GL_FALSE; -GLboolean __GLEW_SGIX_ir_instrument1 = GL_FALSE; -GLboolean __GLEW_SGIX_list_priority = GL_FALSE; -GLboolean __GLEW_SGIX_pixel_texture = GL_FALSE; -GLboolean __GLEW_SGIX_pixel_texture_bits = GL_FALSE; -GLboolean __GLEW_SGIX_reference_plane = GL_FALSE; -GLboolean __GLEW_SGIX_resample = GL_FALSE; -GLboolean __GLEW_SGIX_shadow = GL_FALSE; -GLboolean __GLEW_SGIX_shadow_ambient = GL_FALSE; -GLboolean __GLEW_SGIX_sprite = GL_FALSE; -GLboolean __GLEW_SGIX_tag_sample_buffer = GL_FALSE; -GLboolean __GLEW_SGIX_texture_add_env = GL_FALSE; -GLboolean __GLEW_SGIX_texture_coordinate_clamp = GL_FALSE; -GLboolean __GLEW_SGIX_texture_lod_bias = GL_FALSE; -GLboolean __GLEW_SGIX_texture_multi_buffer = GL_FALSE; -GLboolean __GLEW_SGIX_texture_range = GL_FALSE; -GLboolean __GLEW_SGIX_texture_scale_bias = GL_FALSE; -GLboolean __GLEW_SGIX_vertex_preclip = GL_FALSE; -GLboolean __GLEW_SGIX_vertex_preclip_hint = GL_FALSE; -GLboolean __GLEW_SGIX_ycrcb = GL_FALSE; -GLboolean __GLEW_SGI_color_matrix = GL_FALSE; -GLboolean __GLEW_SGI_color_table = GL_FALSE; -GLboolean __GLEW_SGI_texture_color_table = GL_FALSE; -GLboolean __GLEW_SUNX_constant_data = GL_FALSE; -GLboolean __GLEW_SUN_convolution_border_modes = GL_FALSE; -GLboolean __GLEW_SUN_global_alpha = GL_FALSE; -GLboolean __GLEW_SUN_mesh_array = GL_FALSE; -GLboolean __GLEW_SUN_read_video_pixels = GL_FALSE; -GLboolean __GLEW_SUN_slice_accum = GL_FALSE; -GLboolean __GLEW_SUN_triangle_list = GL_FALSE; -GLboolean __GLEW_SUN_vertex = GL_FALSE; -GLboolean __GLEW_WIN_phong_shading = GL_FALSE; -GLboolean __GLEW_WIN_specular_fog = GL_FALSE; -GLboolean __GLEW_WIN_swap_hint = GL_FALSE; - -#endif /* !GLEW_MX */ - -#ifdef GL_VERSION_1_2 - -static GLboolean _glewInit_GL_VERSION_1_2 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage3D")) == NULL) || r; - r = ((glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElements")) == NULL) || r; - r = ((glTexImage3D = (PFNGLTEXIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexImage3D")) == NULL) || r; - r = ((glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage3D")) == NULL) || r; - - return r; -} - -#endif /* GL_VERSION_1_2 */ - -#ifdef GL_VERSION_1_3 - -static GLboolean _glewInit_GL_VERSION_1_3 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glActiveTexture = (PFNGLACTIVETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glActiveTexture")) == NULL) || r; - r = ((glClientActiveTexture = (PFNGLCLIENTACTIVETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glClientActiveTexture")) == NULL) || r; - r = ((glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage1D")) == NULL) || r; - r = ((glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage2D")) == NULL) || r; - r = ((glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage3D")) == NULL) || r; - r = ((glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage1D")) == NULL) || r; - r = ((glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage2D")) == NULL) || r; - r = ((glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage3D")) == NULL) || r; - r = ((glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTexImage")) == NULL) || r; - r = ((glLoadTransposeMatrixd = (PFNGLLOADTRANSPOSEMATRIXDPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixd")) == NULL) || r; - r = ((glLoadTransposeMatrixf = (PFNGLLOADTRANSPOSEMATRIXFPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixf")) == NULL) || r; - r = ((glMultTransposeMatrixd = (PFNGLMULTTRANSPOSEMATRIXDPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixd")) == NULL) || r; - r = ((glMultTransposeMatrixf = (PFNGLMULTTRANSPOSEMATRIXFPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixf")) == NULL) || r; - r = ((glMultiTexCoord1d = (PFNGLMULTITEXCOORD1DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1d")) == NULL) || r; - r = ((glMultiTexCoord1dv = (PFNGLMULTITEXCOORD1DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dv")) == NULL) || r; - r = ((glMultiTexCoord1f = (PFNGLMULTITEXCOORD1FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1f")) == NULL) || r; - r = ((glMultiTexCoord1fv = (PFNGLMULTITEXCOORD1FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fv")) == NULL) || r; - r = ((glMultiTexCoord1i = (PFNGLMULTITEXCOORD1IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1i")) == NULL) || r; - r = ((glMultiTexCoord1iv = (PFNGLMULTITEXCOORD1IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1iv")) == NULL) || r; - r = ((glMultiTexCoord1s = (PFNGLMULTITEXCOORD1SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1s")) == NULL) || r; - r = ((glMultiTexCoord1sv = (PFNGLMULTITEXCOORD1SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1sv")) == NULL) || r; - r = ((glMultiTexCoord2d = (PFNGLMULTITEXCOORD2DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2d")) == NULL) || r; - r = ((glMultiTexCoord2dv = (PFNGLMULTITEXCOORD2DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dv")) == NULL) || r; - r = ((glMultiTexCoord2f = (PFNGLMULTITEXCOORD2FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2f")) == NULL) || r; - r = ((glMultiTexCoord2fv = (PFNGLMULTITEXCOORD2FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fv")) == NULL) || r; - r = ((glMultiTexCoord2i = (PFNGLMULTITEXCOORD2IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2i")) == NULL) || r; - r = ((glMultiTexCoord2iv = (PFNGLMULTITEXCOORD2IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2iv")) == NULL) || r; - r = ((glMultiTexCoord2s = (PFNGLMULTITEXCOORD2SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2s")) == NULL) || r; - r = ((glMultiTexCoord2sv = (PFNGLMULTITEXCOORD2SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2sv")) == NULL) || r; - r = ((glMultiTexCoord3d = (PFNGLMULTITEXCOORD3DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3d")) == NULL) || r; - r = ((glMultiTexCoord3dv = (PFNGLMULTITEXCOORD3DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dv")) == NULL) || r; - r = ((glMultiTexCoord3f = (PFNGLMULTITEXCOORD3FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3f")) == NULL) || r; - r = ((glMultiTexCoord3fv = (PFNGLMULTITEXCOORD3FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fv")) == NULL) || r; - r = ((glMultiTexCoord3i = (PFNGLMULTITEXCOORD3IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3i")) == NULL) || r; - r = ((glMultiTexCoord3iv = (PFNGLMULTITEXCOORD3IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3iv")) == NULL) || r; - r = ((glMultiTexCoord3s = (PFNGLMULTITEXCOORD3SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3s")) == NULL) || r; - r = ((glMultiTexCoord3sv = (PFNGLMULTITEXCOORD3SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3sv")) == NULL) || r; - r = ((glMultiTexCoord4d = (PFNGLMULTITEXCOORD4DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4d")) == NULL) || r; - r = ((glMultiTexCoord4dv = (PFNGLMULTITEXCOORD4DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dv")) == NULL) || r; - r = ((glMultiTexCoord4f = (PFNGLMULTITEXCOORD4FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4f")) == NULL) || r; - r = ((glMultiTexCoord4fv = (PFNGLMULTITEXCOORD4FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fv")) == NULL) || r; - r = ((glMultiTexCoord4i = (PFNGLMULTITEXCOORD4IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4i")) == NULL) || r; - r = ((glMultiTexCoord4iv = (PFNGLMULTITEXCOORD4IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4iv")) == NULL) || r; - r = ((glMultiTexCoord4s = (PFNGLMULTITEXCOORD4SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4s")) == NULL) || r; - r = ((glMultiTexCoord4sv = (PFNGLMULTITEXCOORD4SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4sv")) == NULL) || r; - r = ((glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)glewGetProcAddress((const GLubyte*)"glSampleCoverage")) == NULL) || r; - - return r; -} - -#endif /* GL_VERSION_1_3 */ - -#ifdef GL_VERSION_1_4 - -static GLboolean _glewInit_GL_VERSION_1_4 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBlendColor = (PFNGLBLENDCOLORPROC)glewGetProcAddress((const GLubyte*)"glBlendColor")) == NULL) || r; - r = ((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)"glBlendEquation")) == NULL) || r; - r = ((glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparate")) == NULL) || r; - r = ((glFogCoordPointer = (PFNGLFOGCOORDPOINTERPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointer")) == NULL) || r; - r = ((glFogCoordd = (PFNGLFOGCOORDDPROC)glewGetProcAddress((const GLubyte*)"glFogCoordd")) == NULL) || r; - r = ((glFogCoorddv = (PFNGLFOGCOORDDVPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddv")) == NULL) || r; - r = ((glFogCoordf = (PFNGLFOGCOORDFPROC)glewGetProcAddress((const GLubyte*)"glFogCoordf")) == NULL) || r; - r = ((glFogCoordfv = (PFNGLFOGCOORDFVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfv")) == NULL) || r; - r = ((glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArrays")) == NULL) || r; - r = ((glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElements")) == NULL) || r; - r = ((glPointParameterf = (PFNGLPOINTPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glPointParameterf")) == NULL) || r; - r = ((glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfv")) == NULL) || r; - r = ((glPointParameteri = (PFNGLPOINTPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glPointParameteri")) == NULL) || r; - r = ((glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glPointParameteriv")) == NULL) || r; - r = ((glSecondaryColor3b = (PFNGLSECONDARYCOLOR3BPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3b")) == NULL) || r; - r = ((glSecondaryColor3bv = (PFNGLSECONDARYCOLOR3BVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bv")) == NULL) || r; - r = ((glSecondaryColor3d = (PFNGLSECONDARYCOLOR3DPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3d")) == NULL) || r; - r = ((glSecondaryColor3dv = (PFNGLSECONDARYCOLOR3DVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dv")) == NULL) || r; - r = ((glSecondaryColor3f = (PFNGLSECONDARYCOLOR3FPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3f")) == NULL) || r; - r = ((glSecondaryColor3fv = (PFNGLSECONDARYCOLOR3FVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fv")) == NULL) || r; - r = ((glSecondaryColor3i = (PFNGLSECONDARYCOLOR3IPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3i")) == NULL) || r; - r = ((glSecondaryColor3iv = (PFNGLSECONDARYCOLOR3IVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3iv")) == NULL) || r; - r = ((glSecondaryColor3s = (PFNGLSECONDARYCOLOR3SPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3s")) == NULL) || r; - r = ((glSecondaryColor3sv = (PFNGLSECONDARYCOLOR3SVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3sv")) == NULL) || r; - r = ((glSecondaryColor3ub = (PFNGLSECONDARYCOLOR3UBPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ub")) == NULL) || r; - r = ((glSecondaryColor3ubv = (PFNGLSECONDARYCOLOR3UBVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubv")) == NULL) || r; - r = ((glSecondaryColor3ui = (PFNGLSECONDARYCOLOR3UIPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ui")) == NULL) || r; - r = ((glSecondaryColor3uiv = (PFNGLSECONDARYCOLOR3UIVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uiv")) == NULL) || r; - r = ((glSecondaryColor3us = (PFNGLSECONDARYCOLOR3USPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3us")) == NULL) || r; - r = ((glSecondaryColor3usv = (PFNGLSECONDARYCOLOR3USVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usv")) == NULL) || r; - r = ((glSecondaryColorPointer = (PFNGLSECONDARYCOLORPOINTERPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointer")) == NULL) || r; - r = ((glWindowPos2d = (PFNGLWINDOWPOS2DPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2d")) == NULL) || r; - r = ((glWindowPos2dv = (PFNGLWINDOWPOS2DVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dv")) == NULL) || r; - r = ((glWindowPos2f = (PFNGLWINDOWPOS2FPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2f")) == NULL) || r; - r = ((glWindowPos2fv = (PFNGLWINDOWPOS2FVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fv")) == NULL) || r; - r = ((glWindowPos2i = (PFNGLWINDOWPOS2IPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2i")) == NULL) || r; - r = ((glWindowPos2iv = (PFNGLWINDOWPOS2IVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iv")) == NULL) || r; - r = ((glWindowPos2s = (PFNGLWINDOWPOS2SPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2s")) == NULL) || r; - r = ((glWindowPos2sv = (PFNGLWINDOWPOS2SVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sv")) == NULL) || r; - r = ((glWindowPos3d = (PFNGLWINDOWPOS3DPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3d")) == NULL) || r; - r = ((glWindowPos3dv = (PFNGLWINDOWPOS3DVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dv")) == NULL) || r; - r = ((glWindowPos3f = (PFNGLWINDOWPOS3FPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3f")) == NULL) || r; - r = ((glWindowPos3fv = (PFNGLWINDOWPOS3FVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fv")) == NULL) || r; - r = ((glWindowPos3i = (PFNGLWINDOWPOS3IPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3i")) == NULL) || r; - r = ((glWindowPos3iv = (PFNGLWINDOWPOS3IVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iv")) == NULL) || r; - r = ((glWindowPos3s = (PFNGLWINDOWPOS3SPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3s")) == NULL) || r; - r = ((glWindowPos3sv = (PFNGLWINDOWPOS3SVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sv")) == NULL) || r; - - return r; -} - -#endif /* GL_VERSION_1_4 */ - -#ifdef GL_VERSION_1_5 - -static GLboolean _glewInit_GL_VERSION_1_5 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBeginQuery = (PFNGLBEGINQUERYPROC)glewGetProcAddress((const GLubyte*)"glBeginQuery")) == NULL) || r; - r = ((glBindBuffer = (PFNGLBINDBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindBuffer")) == NULL) || r; - r = ((glBufferData = (PFNGLBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferData")) == NULL) || r; - r = ((glBufferSubData = (PFNGLBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferSubData")) == NULL) || r; - r = ((glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteBuffers")) == NULL) || r; - r = ((glDeleteQueries = (PFNGLDELETEQUERIESPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueries")) == NULL) || r; - r = ((glEndQuery = (PFNGLENDQUERYPROC)glewGetProcAddress((const GLubyte*)"glEndQuery")) == NULL) || r; - r = ((glGenBuffers = (PFNGLGENBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenBuffers")) == NULL) || r; - r = ((glGenQueries = (PFNGLGENQUERIESPROC)glewGetProcAddress((const GLubyte*)"glGenQueries")) == NULL) || r; - r = ((glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameteriv")) == NULL) || r; - r = ((glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferPointerv")) == NULL) || r; - r = ((glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glGetBufferSubData")) == NULL) || r; - r = ((glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectiv")) == NULL) || r; - r = ((glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuiv")) == NULL) || r; - r = ((glGetQueryiv = (PFNGLGETQUERYIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryiv")) == NULL) || r; - r = ((glIsBuffer = (PFNGLISBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsBuffer")) == NULL) || r; - r = ((glIsQuery = (PFNGLISQUERYPROC)glewGetProcAddress((const GLubyte*)"glIsQuery")) == NULL) || r; - r = ((glMapBuffer = (PFNGLMAPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glMapBuffer")) == NULL) || r; - r = ((glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glUnmapBuffer")) == NULL) || r; - - return r; -} - -#endif /* GL_VERSION_1_5 */ - -#ifdef GL_VERSION_2_0 - -static GLboolean _glewInit_GL_VERSION_2_0 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glAttachShader = (PFNGLATTACHSHADERPROC)glewGetProcAddress((const GLubyte*)"glAttachShader")) == NULL) || r; - r = ((glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glBindAttribLocation")) == NULL) || r; - r = ((glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparate")) == NULL) || r; - r = ((glCompileShader = (PFNGLCOMPILESHADERPROC)glewGetProcAddress((const GLubyte*)"glCompileShader")) == NULL) || r; - r = ((glCreateProgram = (PFNGLCREATEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glCreateProgram")) == NULL) || r; - r = ((glCreateShader = (PFNGLCREATESHADERPROC)glewGetProcAddress((const GLubyte*)"glCreateShader")) == NULL) || r; - r = ((glDeleteProgram = (PFNGLDELETEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgram")) == NULL) || r; - r = ((glDeleteShader = (PFNGLDELETESHADERPROC)glewGetProcAddress((const GLubyte*)"glDeleteShader")) == NULL) || r; - r = ((glDetachShader = (PFNGLDETACHSHADERPROC)glewGetProcAddress((const GLubyte*)"glDetachShader")) == NULL) || r; - r = ((glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribArray")) == NULL) || r; - r = ((glDrawBuffers = (PFNGLDRAWBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffers")) == NULL) || r; - r = ((glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribArray")) == NULL) || r; - r = ((glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAttrib")) == NULL) || r; - r = ((glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniform")) == NULL) || r; - r = ((glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)glewGetProcAddress((const GLubyte*)"glGetAttachedShaders")) == NULL) || r; - r = ((glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetAttribLocation")) == NULL) || r; - r = ((glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetProgramInfoLog")) == NULL) || r; - r = ((glGetProgramiv = (PFNGLGETPROGRAMIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramiv")) == NULL) || r; - r = ((glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetShaderInfoLog")) == NULL) || r; - r = ((glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)glewGetProcAddress((const GLubyte*)"glGetShaderSource")) == NULL) || r; - r = ((glGetShaderiv = (PFNGLGETSHADERIVPROC)glewGetProcAddress((const GLubyte*)"glGetShaderiv")) == NULL) || r; - r = ((glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetUniformLocation")) == NULL) || r; - r = ((glGetUniformfv = (PFNGLGETUNIFORMFVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformfv")) == NULL) || r; - r = ((glGetUniformiv = (PFNGLGETUNIFORMIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformiv")) == NULL) || r; - r = ((glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointerv")) == NULL) || r; - r = ((glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdv")) == NULL) || r; - r = ((glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfv")) == NULL) || r; - r = ((glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribiv")) == NULL) || r; - r = ((glIsProgram = (PFNGLISPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glIsProgram")) == NULL) || r; - r = ((glIsShader = (PFNGLISSHADERPROC)glewGetProcAddress((const GLubyte*)"glIsShader")) == NULL) || r; - r = ((glLinkProgram = (PFNGLLINKPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glLinkProgram")) == NULL) || r; - r = ((glShaderSource = (PFNGLSHADERSOURCEPROC)glewGetProcAddress((const GLubyte*)"glShaderSource")) == NULL) || r; - r = ((glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilFuncSeparate")) == NULL) || r; - r = ((glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilMaskSeparate")) == NULL) || r; - r = ((glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilOpSeparate")) == NULL) || r; - r = ((glUniform1f = (PFNGLUNIFORM1FPROC)glewGetProcAddress((const GLubyte*)"glUniform1f")) == NULL) || r; - r = ((glUniform1fv = (PFNGLUNIFORM1FVPROC)glewGetProcAddress((const GLubyte*)"glUniform1fv")) == NULL) || r; - r = ((glUniform1i = (PFNGLUNIFORM1IPROC)glewGetProcAddress((const GLubyte*)"glUniform1i")) == NULL) || r; - r = ((glUniform1iv = (PFNGLUNIFORM1IVPROC)glewGetProcAddress((const GLubyte*)"glUniform1iv")) == NULL) || r; - r = ((glUniform2f = (PFNGLUNIFORM2FPROC)glewGetProcAddress((const GLubyte*)"glUniform2f")) == NULL) || r; - r = ((glUniform2fv = (PFNGLUNIFORM2FVPROC)glewGetProcAddress((const GLubyte*)"glUniform2fv")) == NULL) || r; - r = ((glUniform2i = (PFNGLUNIFORM2IPROC)glewGetProcAddress((const GLubyte*)"glUniform2i")) == NULL) || r; - r = ((glUniform2iv = (PFNGLUNIFORM2IVPROC)glewGetProcAddress((const GLubyte*)"glUniform2iv")) == NULL) || r; - r = ((glUniform3f = (PFNGLUNIFORM3FPROC)glewGetProcAddress((const GLubyte*)"glUniform3f")) == NULL) || r; - r = ((glUniform3fv = (PFNGLUNIFORM3FVPROC)glewGetProcAddress((const GLubyte*)"glUniform3fv")) == NULL) || r; - r = ((glUniform3i = (PFNGLUNIFORM3IPROC)glewGetProcAddress((const GLubyte*)"glUniform3i")) == NULL) || r; - r = ((glUniform3iv = (PFNGLUNIFORM3IVPROC)glewGetProcAddress((const GLubyte*)"glUniform3iv")) == NULL) || r; - r = ((glUniform4f = (PFNGLUNIFORM4FPROC)glewGetProcAddress((const GLubyte*)"glUniform4f")) == NULL) || r; - r = ((glUniform4fv = (PFNGLUNIFORM4FVPROC)glewGetProcAddress((const GLubyte*)"glUniform4fv")) == NULL) || r; - r = ((glUniform4i = (PFNGLUNIFORM4IPROC)glewGetProcAddress((const GLubyte*)"glUniform4i")) == NULL) || r; - r = ((glUniform4iv = (PFNGLUNIFORM4IVPROC)glewGetProcAddress((const GLubyte*)"glUniform4iv")) == NULL) || r; - r = ((glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2fv")) == NULL) || r; - r = ((glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3fv")) == NULL) || r; - r = ((glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4fv")) == NULL) || r; - r = ((glUseProgram = (PFNGLUSEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glUseProgram")) == NULL) || r; - r = ((glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glValidateProgram")) == NULL) || r; - r = ((glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1d")) == NULL) || r; - r = ((glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dv")) == NULL) || r; - r = ((glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1f")) == NULL) || r; - r = ((glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fv")) == NULL) || r; - r = ((glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1s")) == NULL) || r; - r = ((glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sv")) == NULL) || r; - r = ((glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2d")) == NULL) || r; - r = ((glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dv")) == NULL) || r; - r = ((glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2f")) == NULL) || r; - r = ((glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fv")) == NULL) || r; - r = ((glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2s")) == NULL) || r; - r = ((glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sv")) == NULL) || r; - r = ((glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3d")) == NULL) || r; - r = ((glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dv")) == NULL) || r; - r = ((glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3f")) == NULL) || r; - r = ((glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fv")) == NULL) || r; - r = ((glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3s")) == NULL) || r; - r = ((glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sv")) == NULL) || r; - r = ((glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nbv")) == NULL) || r; - r = ((glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Niv")) == NULL) || r; - r = ((glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nsv")) == NULL) || r; - r = ((glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nub")) == NULL) || r; - r = ((glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nubv")) == NULL) || r; - r = ((glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nuiv")) == NULL) || r; - r = ((glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nusv")) == NULL) || r; - r = ((glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4bv")) == NULL) || r; - r = ((glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4d")) == NULL) || r; - r = ((glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dv")) == NULL) || r; - r = ((glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4f")) == NULL) || r; - r = ((glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fv")) == NULL) || r; - r = ((glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4iv")) == NULL) || r; - r = ((glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4s")) == NULL) || r; - r = ((glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sv")) == NULL) || r; - r = ((glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubv")) == NULL) || r; - r = ((glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4uiv")) == NULL) || r; - r = ((glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4usv")) == NULL) || r; - r = ((glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointer")) == NULL) || r; - - return r; -} - -#endif /* GL_VERSION_2_0 */ - -#ifdef GL_VERSION_2_1 - -static GLboolean _glewInit_GL_VERSION_2_1 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x3fv")) == NULL) || r; - r = ((glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x4fv")) == NULL) || r; - r = ((glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x2fv")) == NULL) || r; - r = ((glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x4fv")) == NULL) || r; - r = ((glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x2fv")) == NULL) || r; - r = ((glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x3fv")) == NULL) || r; - - return r; -} - -#endif /* GL_VERSION_2_1 */ - -#ifdef GL_VERSION_3_0 - -static GLboolean _glewInit_GL_VERSION_3_0 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRender")) == NULL) || r; - r = ((glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedback")) == NULL) || r; - r = ((glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocation")) == NULL) || r; - r = ((glClampColor = (PFNGLCLAMPCOLORPROC)glewGetProcAddress((const GLubyte*)"glClampColor")) == NULL) || r; - r = ((glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)glewGetProcAddress((const GLubyte*)"glClearBufferfi")) == NULL) || r; - r = ((glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferfv")) == NULL) || r; - r = ((glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferiv")) == NULL) || r; - r = ((glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferuiv")) == NULL) || r; - r = ((glColorMaski = (PFNGLCOLORMASKIPROC)glewGetProcAddress((const GLubyte*)"glColorMaski")) == NULL) || r; - r = ((glDisablei = (PFNGLDISABLEIPROC)glewGetProcAddress((const GLubyte*)"glDisablei")) == NULL) || r; - r = ((glEnablei = (PFNGLENABLEIPROC)glewGetProcAddress((const GLubyte*)"glEnablei")) == NULL) || r; - r = ((glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRender")) == NULL) || r; - r = ((glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedback")) == NULL) || r; - r = ((glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)glewGetProcAddress((const GLubyte*)"glGetBooleani_v")) == NULL) || r; - r = ((glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataLocation")) == NULL) || r; - r = ((glGetStringi = (PFNGLGETSTRINGIPROC)glewGetProcAddress((const GLubyte*)"glGetStringi")) == NULL) || r; - r = ((glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIiv")) == NULL) || r; - r = ((glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIuiv")) == NULL) || r; - r = ((glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVarying")) == NULL) || r; - r = ((glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformuiv")) == NULL) || r; - r = ((glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIiv")) == NULL) || r; - r = ((glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIuiv")) == NULL) || r; - r = ((glIsEnabledi = (PFNGLISENABLEDIPROC)glewGetProcAddress((const GLubyte*)"glIsEnabledi")) == NULL) || r; - r = ((glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIiv")) == NULL) || r; - r = ((glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIuiv")) == NULL) || r; - r = ((glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryings")) == NULL) || r; - r = ((glUniform1ui = (PFNGLUNIFORM1UIPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui")) == NULL) || r; - r = ((glUniform1uiv = (PFNGLUNIFORM1UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform1uiv")) == NULL) || r; - r = ((glUniform2ui = (PFNGLUNIFORM2UIPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui")) == NULL) || r; - r = ((glUniform2uiv = (PFNGLUNIFORM2UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform2uiv")) == NULL) || r; - r = ((glUniform3ui = (PFNGLUNIFORM3UIPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui")) == NULL) || r; - r = ((glUniform3uiv = (PFNGLUNIFORM3UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform3uiv")) == NULL) || r; - r = ((glUniform4ui = (PFNGLUNIFORM4UIPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui")) == NULL) || r; - r = ((glUniform4uiv = (PFNGLUNIFORM4UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform4uiv")) == NULL) || r; - r = ((glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1i")) == NULL) || r; - r = ((glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1iv")) == NULL) || r; - r = ((glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1ui")) == NULL) || r; - r = ((glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uiv")) == NULL) || r; - r = ((glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2i")) == NULL) || r; - r = ((glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2iv")) == NULL) || r; - r = ((glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2ui")) == NULL) || r; - r = ((glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uiv")) == NULL) || r; - r = ((glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3i")) == NULL) || r; - r = ((glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3iv")) == NULL) || r; - r = ((glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3ui")) == NULL) || r; - r = ((glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uiv")) == NULL) || r; - r = ((glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4bv")) == NULL) || r; - r = ((glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4i")) == NULL) || r; - r = ((glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4iv")) == NULL) || r; - r = ((glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4sv")) == NULL) || r; - r = ((glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ubv")) == NULL) || r; - r = ((glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ui")) == NULL) || r; - r = ((glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uiv")) == NULL) || r; - r = ((glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4usv")) == NULL) || r; - r = ((glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIPointer")) == NULL) || r; - - return r; -} - -#endif /* GL_VERSION_3_0 */ - -#ifdef GL_VERSION_3_1 - -static GLboolean _glewInit_GL_VERSION_3_1 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstanced")) == NULL) || r; - r = ((glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstanced")) == NULL) || r; - r = ((glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartIndex")) == NULL) || r; - r = ((glTexBuffer = (PFNGLTEXBUFFERPROC)glewGetProcAddress((const GLubyte*)"glTexBuffer")) == NULL) || r; - - return r; -} - -#endif /* GL_VERSION_3_1 */ - -#ifdef GL_VERSION_3_2 - -static GLboolean _glewInit_GL_VERSION_3_2 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture")) == NULL) || r; - r = ((glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameteri64v")) == NULL) || r; - r = ((glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)glewGetProcAddress((const GLubyte*)"glGetInteger64i_v")) == NULL) || r; - - return r; -} - -#endif /* GL_VERSION_3_2 */ - -#ifdef GL_VERSION_3_3 - -static GLboolean _glewInit_GL_VERSION_3_3 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisor")) == NULL) || r; - - return r; -} - -#endif /* GL_VERSION_3_3 */ - -#ifdef GL_VERSION_4_0 - -static GLboolean _glewInit_GL_VERSION_4_0 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBlendEquationSeparatei = (PFNGLBLENDEQUATIONSEPARATEIPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparatei")) == NULL) || r; - r = ((glBlendEquationi = (PFNGLBLENDEQUATIONIPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationi")) == NULL) || r; - r = ((glBlendFuncSeparatei = (PFNGLBLENDFUNCSEPARATEIPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparatei")) == NULL) || r; - r = ((glBlendFunci = (PFNGLBLENDFUNCIPROC)glewGetProcAddress((const GLubyte*)"glBlendFunci")) == NULL) || r; - r = ((glMinSampleShading = (PFNGLMINSAMPLESHADINGPROC)glewGetProcAddress((const GLubyte*)"glMinSampleShading")) == NULL) || r; - - return r; -} - -#endif /* GL_VERSION_4_0 */ - -#ifdef GL_VERSION_4_5 - -static GLboolean _glewInit_GL_VERSION_4_5 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetGraphicsResetStatus = (PFNGLGETGRAPHICSRESETSTATUSPROC)glewGetProcAddress((const GLubyte*)"glGetGraphicsResetStatus")) == NULL) || r; - r = ((glGetnCompressedTexImage = (PFNGLGETNCOMPRESSEDTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetnCompressedTexImage")) == NULL) || r; - r = ((glGetnTexImage = (PFNGLGETNTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetnTexImage")) == NULL) || r; - r = ((glGetnUniformdv = (PFNGLGETNUNIFORMDVPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformdv")) == NULL) || r; - - return r; -} - -#endif /* GL_VERSION_4_5 */ - -#ifdef GL_3DFX_tbuffer - -static GLboolean _glewInit_GL_3DFX_tbuffer (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTbufferMask3DFX = (PFNGLTBUFFERMASK3DFXPROC)glewGetProcAddress((const GLubyte*)"glTbufferMask3DFX")) == NULL) || r; - - return r; -} - -#endif /* GL_3DFX_tbuffer */ - -#ifdef GL_AMD_debug_output - -static GLboolean _glewInit_GL_AMD_debug_output (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDebugMessageCallbackAMD = (PFNGLDEBUGMESSAGECALLBACKAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallbackAMD")) == NULL) || r; - r = ((glDebugMessageEnableAMD = (PFNGLDEBUGMESSAGEENABLEAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageEnableAMD")) == NULL) || r; - r = ((glDebugMessageInsertAMD = (PFNGLDEBUGMESSAGEINSERTAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsertAMD")) == NULL) || r; - r = ((glGetDebugMessageLogAMD = (PFNGLGETDEBUGMESSAGELOGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLogAMD")) == NULL) || r; - - return r; -} - -#endif /* GL_AMD_debug_output */ - -#ifdef GL_AMD_draw_buffers_blend - -static GLboolean _glewInit_GL_AMD_draw_buffers_blend (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBlendEquationIndexedAMD = (PFNGLBLENDEQUATIONINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationIndexedAMD")) == NULL) || r; - r = ((glBlendEquationSeparateIndexedAMD = (PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateIndexedAMD")) == NULL) || r; - r = ((glBlendFuncIndexedAMD = (PFNGLBLENDFUNCINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncIndexedAMD")) == NULL) || r; - r = ((glBlendFuncSeparateIndexedAMD = (PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateIndexedAMD")) == NULL) || r; - - return r; -} - -#endif /* GL_AMD_draw_buffers_blend */ - -#ifdef GL_AMD_interleaved_elements - -static GLboolean _glewInit_GL_AMD_interleaved_elements (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glVertexAttribParameteriAMD = (PFNGLVERTEXATTRIBPARAMETERIAMDPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribParameteriAMD")) == NULL) || r; - - return r; -} - -#endif /* GL_AMD_interleaved_elements */ - -#ifdef GL_AMD_multi_draw_indirect - -static GLboolean _glewInit_GL_AMD_multi_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glMultiDrawArraysIndirectAMD = (PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectAMD")) == NULL) || r; - r = ((glMultiDrawElementsIndirectAMD = (PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectAMD")) == NULL) || r; - - return r; -} - -#endif /* GL_AMD_multi_draw_indirect */ - -#ifdef GL_AMD_name_gen_delete - -static GLboolean _glewInit_GL_AMD_name_gen_delete (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDeleteNamesAMD = (PFNGLDELETENAMESAMDPROC)glewGetProcAddress((const GLubyte*)"glDeleteNamesAMD")) == NULL) || r; - r = ((glGenNamesAMD = (PFNGLGENNAMESAMDPROC)glewGetProcAddress((const GLubyte*)"glGenNamesAMD")) == NULL) || r; - r = ((glIsNameAMD = (PFNGLISNAMEAMDPROC)glewGetProcAddress((const GLubyte*)"glIsNameAMD")) == NULL) || r; - - return r; -} - -#endif /* GL_AMD_name_gen_delete */ - -#ifdef GL_AMD_occlusion_query_event - -static GLboolean _glewInit_GL_AMD_occlusion_query_event (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glQueryObjectParameteruiAMD = (PFNGLQUERYOBJECTPARAMETERUIAMDPROC)glewGetProcAddress((const GLubyte*)"glQueryObjectParameteruiAMD")) == NULL) || r; - - return r; -} - -#endif /* GL_AMD_occlusion_query_event */ - -#ifdef GL_AMD_performance_monitor - -static GLboolean _glewInit_GL_AMD_performance_monitor (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBeginPerfMonitorAMD = (PFNGLBEGINPERFMONITORAMDPROC)glewGetProcAddress((const GLubyte*)"glBeginPerfMonitorAMD")) == NULL) || r; - r = ((glDeletePerfMonitorsAMD = (PFNGLDELETEPERFMONITORSAMDPROC)glewGetProcAddress((const GLubyte*)"glDeletePerfMonitorsAMD")) == NULL) || r; - r = ((glEndPerfMonitorAMD = (PFNGLENDPERFMONITORAMDPROC)glewGetProcAddress((const GLubyte*)"glEndPerfMonitorAMD")) == NULL) || r; - r = ((glGenPerfMonitorsAMD = (PFNGLGENPERFMONITORSAMDPROC)glewGetProcAddress((const GLubyte*)"glGenPerfMonitorsAMD")) == NULL) || r; - r = ((glGetPerfMonitorCounterDataAMD = (PFNGLGETPERFMONITORCOUNTERDATAAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterDataAMD")) == NULL) || r; - r = ((glGetPerfMonitorCounterInfoAMD = (PFNGLGETPERFMONITORCOUNTERINFOAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterInfoAMD")) == NULL) || r; - r = ((glGetPerfMonitorCounterStringAMD = (PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterStringAMD")) == NULL) || r; - r = ((glGetPerfMonitorCountersAMD = (PFNGLGETPERFMONITORCOUNTERSAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCountersAMD")) == NULL) || r; - r = ((glGetPerfMonitorGroupStringAMD = (PFNGLGETPERFMONITORGROUPSTRINGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorGroupStringAMD")) == NULL) || r; - r = ((glGetPerfMonitorGroupsAMD = (PFNGLGETPERFMONITORGROUPSAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorGroupsAMD")) == NULL) || r; - r = ((glSelectPerfMonitorCountersAMD = (PFNGLSELECTPERFMONITORCOUNTERSAMDPROC)glewGetProcAddress((const GLubyte*)"glSelectPerfMonitorCountersAMD")) == NULL) || r; - - return r; -} - -#endif /* GL_AMD_performance_monitor */ - -#ifdef GL_AMD_sample_positions - -static GLboolean _glewInit_GL_AMD_sample_positions (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glSetMultisamplefvAMD = (PFNGLSETMULTISAMPLEFVAMDPROC)glewGetProcAddress((const GLubyte*)"glSetMultisamplefvAMD")) == NULL) || r; - - return r; -} - -#endif /* GL_AMD_sample_positions */ - -#ifdef GL_AMD_sparse_texture - -static GLboolean _glewInit_GL_AMD_sparse_texture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTexStorageSparseAMD = (PFNGLTEXSTORAGESPARSEAMDPROC)glewGetProcAddress((const GLubyte*)"glTexStorageSparseAMD")) == NULL) || r; - r = ((glTextureStorageSparseAMD = (PFNGLTEXTURESTORAGESPARSEAMDPROC)glewGetProcAddress((const GLubyte*)"glTextureStorageSparseAMD")) == NULL) || r; - - return r; -} - -#endif /* GL_AMD_sparse_texture */ - -#ifdef GL_AMD_stencil_operation_extended - -static GLboolean _glewInit_GL_AMD_stencil_operation_extended (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glStencilOpValueAMD = (PFNGLSTENCILOPVALUEAMDPROC)glewGetProcAddress((const GLubyte*)"glStencilOpValueAMD")) == NULL) || r; - - return r; -} - -#endif /* GL_AMD_stencil_operation_extended */ - -#ifdef GL_AMD_vertex_shader_tessellator - -static GLboolean _glewInit_GL_AMD_vertex_shader_tessellator (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTessellationFactorAMD = (PFNGLTESSELLATIONFACTORAMDPROC)glewGetProcAddress((const GLubyte*)"glTessellationFactorAMD")) == NULL) || r; - r = ((glTessellationModeAMD = (PFNGLTESSELLATIONMODEAMDPROC)glewGetProcAddress((const GLubyte*)"glTessellationModeAMD")) == NULL) || r; - - return r; -} - -#endif /* GL_AMD_vertex_shader_tessellator */ - -#ifdef GL_ANGLE_framebuffer_blit - -static GLboolean _glewInit_GL_ANGLE_framebuffer_blit (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBlitFramebufferANGLE = (PFNGLBLITFRAMEBUFFERANGLEPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebufferANGLE")) == NULL) || r; - - return r; -} - -#endif /* GL_ANGLE_framebuffer_blit */ - -#ifdef GL_ANGLE_framebuffer_multisample - -static GLboolean _glewInit_GL_ANGLE_framebuffer_multisample (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glRenderbufferStorageMultisampleANGLE = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleANGLE")) == NULL) || r; - - return r; -} - -#endif /* GL_ANGLE_framebuffer_multisample */ - -#ifdef GL_ANGLE_instanced_arrays - -static GLboolean _glewInit_GL_ANGLE_instanced_arrays (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawArraysInstancedANGLE = (PFNGLDRAWARRAYSINSTANCEDANGLEPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedANGLE")) == NULL) || r; - r = ((glDrawElementsInstancedANGLE = (PFNGLDRAWELEMENTSINSTANCEDANGLEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedANGLE")) == NULL) || r; - r = ((glVertexAttribDivisorANGLE = (PFNGLVERTEXATTRIBDIVISORANGLEPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisorANGLE")) == NULL) || r; - - return r; -} - -#endif /* GL_ANGLE_instanced_arrays */ - -#ifdef GL_ANGLE_timer_query - -static GLboolean _glewInit_GL_ANGLE_timer_query (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBeginQueryANGLE = (PFNGLBEGINQUERYANGLEPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryANGLE")) == NULL) || r; - r = ((glDeleteQueriesANGLE = (PFNGLDELETEQUERIESANGLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueriesANGLE")) == NULL) || r; - r = ((glEndQueryANGLE = (PFNGLENDQUERYANGLEPROC)glewGetProcAddress((const GLubyte*)"glEndQueryANGLE")) == NULL) || r; - r = ((glGenQueriesANGLE = (PFNGLGENQUERIESANGLEPROC)glewGetProcAddress((const GLubyte*)"glGenQueriesANGLE")) == NULL) || r; - r = ((glGetQueryObjecti64vANGLE = (PFNGLGETQUERYOBJECTI64VANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64vANGLE")) == NULL) || r; - r = ((glGetQueryObjectivANGLE = (PFNGLGETQUERYOBJECTIVANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectivANGLE")) == NULL) || r; - r = ((glGetQueryObjectui64vANGLE = (PFNGLGETQUERYOBJECTUI64VANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64vANGLE")) == NULL) || r; - r = ((glGetQueryObjectuivANGLE = (PFNGLGETQUERYOBJECTUIVANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuivANGLE")) == NULL) || r; - r = ((glGetQueryivANGLE = (PFNGLGETQUERYIVANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryivANGLE")) == NULL) || r; - r = ((glIsQueryANGLE = (PFNGLISQUERYANGLEPROC)glewGetProcAddress((const GLubyte*)"glIsQueryANGLE")) == NULL) || r; - r = ((glQueryCounterANGLE = (PFNGLQUERYCOUNTERANGLEPROC)glewGetProcAddress((const GLubyte*)"glQueryCounterANGLE")) == NULL) || r; - - return r; -} - -#endif /* GL_ANGLE_timer_query */ - -#ifdef GL_ANGLE_translated_shader_source - -static GLboolean _glewInit_GL_ANGLE_translated_shader_source (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetTranslatedShaderSourceANGLE = (PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetTranslatedShaderSourceANGLE")) == NULL) || r; - - return r; -} - -#endif /* GL_ANGLE_translated_shader_source */ - -#ifdef GL_APPLE_element_array - -static GLboolean _glewInit_GL_APPLE_element_array (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawElementArrayAPPLE = (PFNGLDRAWELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementArrayAPPLE")) == NULL) || r; - r = ((glDrawRangeElementArrayAPPLE = (PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementArrayAPPLE")) == NULL) || r; - r = ((glElementPointerAPPLE = (PFNGLELEMENTPOINTERAPPLEPROC)glewGetProcAddress((const GLubyte*)"glElementPointerAPPLE")) == NULL) || r; - r = ((glMultiDrawElementArrayAPPLE = (PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementArrayAPPLE")) == NULL) || r; - r = ((glMultiDrawRangeElementArrayAPPLE = (PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawRangeElementArrayAPPLE")) == NULL) || r; - - return r; -} - -#endif /* GL_APPLE_element_array */ - -#ifdef GL_APPLE_fence - -static GLboolean _glewInit_GL_APPLE_fence (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDeleteFencesAPPLE = (PFNGLDELETEFENCESAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteFencesAPPLE")) == NULL) || r; - r = ((glFinishFenceAPPLE = (PFNGLFINISHFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFinishFenceAPPLE")) == NULL) || r; - r = ((glFinishObjectAPPLE = (PFNGLFINISHOBJECTAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFinishObjectAPPLE")) == NULL) || r; - r = ((glGenFencesAPPLE = (PFNGLGENFENCESAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGenFencesAPPLE")) == NULL) || r; - r = ((glIsFenceAPPLE = (PFNGLISFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsFenceAPPLE")) == NULL) || r; - r = ((glSetFenceAPPLE = (PFNGLSETFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glSetFenceAPPLE")) == NULL) || r; - r = ((glTestFenceAPPLE = (PFNGLTESTFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTestFenceAPPLE")) == NULL) || r; - r = ((glTestObjectAPPLE = (PFNGLTESTOBJECTAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTestObjectAPPLE")) == NULL) || r; - - return r; -} - -#endif /* GL_APPLE_fence */ - -#ifdef GL_APPLE_flush_buffer_range - -static GLboolean _glewInit_GL_APPLE_flush_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBufferParameteriAPPLE = (PFNGLBUFFERPARAMETERIAPPLEPROC)glewGetProcAddress((const GLubyte*)"glBufferParameteriAPPLE")) == NULL) || r; - r = ((glFlushMappedBufferRangeAPPLE = (PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedBufferRangeAPPLE")) == NULL) || r; - - return r; -} - -#endif /* GL_APPLE_flush_buffer_range */ - -#ifdef GL_APPLE_object_purgeable - -static GLboolean _glewInit_GL_APPLE_object_purgeable (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetObjectParameterivAPPLE = (PFNGLGETOBJECTPARAMETERIVAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterivAPPLE")) == NULL) || r; - r = ((glObjectPurgeableAPPLE = (PFNGLOBJECTPURGEABLEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glObjectPurgeableAPPLE")) == NULL) || r; - r = ((glObjectUnpurgeableAPPLE = (PFNGLOBJECTUNPURGEABLEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glObjectUnpurgeableAPPLE")) == NULL) || r; - - return r; -} - -#endif /* GL_APPLE_object_purgeable */ - -#ifdef GL_APPLE_texture_range - -static GLboolean _glewInit_GL_APPLE_texture_range (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetTexParameterPointervAPPLE = (PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterPointervAPPLE")) == NULL) || r; - r = ((glTextureRangeAPPLE = (PFNGLTEXTURERANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTextureRangeAPPLE")) == NULL) || r; - - return r; -} - -#endif /* GL_APPLE_texture_range */ - -#ifdef GL_APPLE_vertex_array_object - -static GLboolean _glewInit_GL_APPLE_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindVertexArrayAPPLE = (PFNGLBINDVERTEXARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glBindVertexArrayAPPLE")) == NULL) || r; - r = ((glDeleteVertexArraysAPPLE = (PFNGLDELETEVERTEXARRAYSAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexArraysAPPLE")) == NULL) || r; - r = ((glGenVertexArraysAPPLE = (PFNGLGENVERTEXARRAYSAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGenVertexArraysAPPLE")) == NULL) || r; - r = ((glIsVertexArrayAPPLE = (PFNGLISVERTEXARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsVertexArrayAPPLE")) == NULL) || r; - - return r; -} - -#endif /* GL_APPLE_vertex_array_object */ - -#ifdef GL_APPLE_vertex_array_range - -static GLboolean _glewInit_GL_APPLE_vertex_array_range (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFlushVertexArrayRangeAPPLE = (PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFlushVertexArrayRangeAPPLE")) == NULL) || r; - r = ((glVertexArrayParameteriAPPLE = (PFNGLVERTEXARRAYPARAMETERIAPPLEPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayParameteriAPPLE")) == NULL) || r; - r = ((glVertexArrayRangeAPPLE = (PFNGLVERTEXARRAYRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayRangeAPPLE")) == NULL) || r; - - return r; -} - -#endif /* GL_APPLE_vertex_array_range */ - -#ifdef GL_APPLE_vertex_program_evaluators - -static GLboolean _glewInit_GL_APPLE_vertex_program_evaluators (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDisableVertexAttribAPPLE = (PFNGLDISABLEVERTEXATTRIBAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribAPPLE")) == NULL) || r; - r = ((glEnableVertexAttribAPPLE = (PFNGLENABLEVERTEXATTRIBAPPLEPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribAPPLE")) == NULL) || r; - r = ((glIsVertexAttribEnabledAPPLE = (PFNGLISVERTEXATTRIBENABLEDAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsVertexAttribEnabledAPPLE")) == NULL) || r; - r = ((glMapVertexAttrib1dAPPLE = (PFNGLMAPVERTEXATTRIB1DAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib1dAPPLE")) == NULL) || r; - r = ((glMapVertexAttrib1fAPPLE = (PFNGLMAPVERTEXATTRIB1FAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib1fAPPLE")) == NULL) || r; - r = ((glMapVertexAttrib2dAPPLE = (PFNGLMAPVERTEXATTRIB2DAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib2dAPPLE")) == NULL) || r; - r = ((glMapVertexAttrib2fAPPLE = (PFNGLMAPVERTEXATTRIB2FAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib2fAPPLE")) == NULL) || r; - - return r; -} - -#endif /* GL_APPLE_vertex_program_evaluators */ - -#ifdef GL_ARB_ES2_compatibility - -static GLboolean _glewInit_GL_ARB_ES2_compatibility (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glClearDepthf = (PFNGLCLEARDEPTHFPROC)glewGetProcAddress((const GLubyte*)"glClearDepthf")) == NULL) || r; - r = ((glDepthRangef = (PFNGLDEPTHRANGEFPROC)glewGetProcAddress((const GLubyte*)"glDepthRangef")) == NULL) || r; - r = ((glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC)glewGetProcAddress((const GLubyte*)"glGetShaderPrecisionFormat")) == NULL) || r; - r = ((glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC)glewGetProcAddress((const GLubyte*)"glReleaseShaderCompiler")) == NULL) || r; - r = ((glShaderBinary = (PFNGLSHADERBINARYPROC)glewGetProcAddress((const GLubyte*)"glShaderBinary")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_ES2_compatibility */ - -#ifdef GL_ARB_ES3_1_compatibility - -static GLboolean _glewInit_GL_ARB_ES3_1_compatibility (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glMemoryBarrierByRegion = (PFNGLMEMORYBARRIERBYREGIONPROC)glewGetProcAddress((const GLubyte*)"glMemoryBarrierByRegion")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_ES3_1_compatibility */ - -#ifdef GL_ARB_ES3_2_compatibility - -static GLboolean _glewInit_GL_ARB_ES3_2_compatibility (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glPrimitiveBoundingBoxARB = (PFNGLPRIMITIVEBOUNDINGBOXARBPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveBoundingBoxARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_ES3_2_compatibility */ - -#ifdef GL_ARB_base_instance - -static GLboolean _glewInit_GL_ARB_base_instance (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawArraysInstancedBaseInstance = (PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedBaseInstance")) == NULL) || r; - r = ((glDrawElementsInstancedBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseInstance")) == NULL) || r; - r = ((glDrawElementsInstancedBaseVertexBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseVertexBaseInstance")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_base_instance */ - -#ifdef GL_ARB_bindless_texture - -static GLboolean _glewInit_GL_ARB_bindless_texture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetImageHandleARB = (PFNGLGETIMAGEHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetImageHandleARB")) == NULL) || r; - r = ((glGetTextureHandleARB = (PFNGLGETTEXTUREHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetTextureHandleARB")) == NULL) || r; - r = ((glGetTextureSamplerHandleARB = (PFNGLGETTEXTURESAMPLERHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetTextureSamplerHandleARB")) == NULL) || r; - r = ((glGetVertexAttribLui64vARB = (PFNGLGETVERTEXATTRIBLUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLui64vARB")) == NULL) || r; - r = ((glIsImageHandleResidentARB = (PFNGLISIMAGEHANDLERESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glIsImageHandleResidentARB")) == NULL) || r; - r = ((glIsTextureHandleResidentARB = (PFNGLISTEXTUREHANDLERESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glIsTextureHandleResidentARB")) == NULL) || r; - r = ((glMakeImageHandleNonResidentARB = (PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleNonResidentARB")) == NULL) || r; - r = ((glMakeImageHandleResidentARB = (PFNGLMAKEIMAGEHANDLERESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleResidentARB")) == NULL) || r; - r = ((glMakeTextureHandleNonResidentARB = (PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleNonResidentARB")) == NULL) || r; - r = ((glMakeTextureHandleResidentARB = (PFNGLMAKETEXTUREHANDLERESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleResidentARB")) == NULL) || r; - r = ((glProgramUniformHandleui64ARB = (PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64ARB")) == NULL) || r; - r = ((glProgramUniformHandleui64vARB = (PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64vARB")) == NULL) || r; - r = ((glUniformHandleui64ARB = (PFNGLUNIFORMHANDLEUI64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64ARB")) == NULL) || r; - r = ((glUniformHandleui64vARB = (PFNGLUNIFORMHANDLEUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64vARB")) == NULL) || r; - r = ((glVertexAttribL1ui64ARB = (PFNGLVERTEXATTRIBL1UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64ARB")) == NULL) || r; - r = ((glVertexAttribL1ui64vARB = (PFNGLVERTEXATTRIBL1UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64vARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_bindless_texture */ - -#ifdef GL_ARB_blend_func_extended - -static GLboolean _glewInit_GL_ARB_blend_func_extended (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocationIndexed")) == NULL) || r; - r = ((glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataIndex")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_blend_func_extended */ - -#ifdef GL_ARB_buffer_storage - -static GLboolean _glewInit_GL_ARB_buffer_storage (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBufferStorage = (PFNGLBUFFERSTORAGEPROC)glewGetProcAddress((const GLubyte*)"glBufferStorage")) == NULL) || r; - r = ((glNamedBufferStorageEXT = (PFNGLNAMEDBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferStorageEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_buffer_storage */ - -#ifdef GL_ARB_cl_event - -static GLboolean _glewInit_GL_ARB_cl_event (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCreateSyncFromCLeventARB = (PFNGLCREATESYNCFROMCLEVENTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateSyncFromCLeventARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_cl_event */ - -#ifdef GL_ARB_clear_buffer_object - -static GLboolean _glewInit_GL_ARB_clear_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glClearBufferData = (PFNGLCLEARBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glClearBufferData")) == NULL) || r; - r = ((glClearBufferSubData = (PFNGLCLEARBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glClearBufferSubData")) == NULL) || r; - r = ((glClearNamedBufferDataEXT = (PFNGLCLEARNAMEDBUFFERDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferDataEXT")) == NULL) || r; - r = ((glClearNamedBufferSubDataEXT = (PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferSubDataEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_clear_buffer_object */ - -#ifdef GL_ARB_clear_texture - -static GLboolean _glewInit_GL_ARB_clear_texture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glClearTexImage = (PFNGLCLEARTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glClearTexImage")) == NULL) || r; - r = ((glClearTexSubImage = (PFNGLCLEARTEXSUBIMAGEPROC)glewGetProcAddress((const GLubyte*)"glClearTexSubImage")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_clear_texture */ - -#ifdef GL_ARB_clip_control - -static GLboolean _glewInit_GL_ARB_clip_control (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glClipControl = (PFNGLCLIPCONTROLPROC)glewGetProcAddress((const GLubyte*)"glClipControl")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_clip_control */ - -#ifdef GL_ARB_color_buffer_float - -static GLboolean _glewInit_GL_ARB_color_buffer_float (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glClampColorARB = (PFNGLCLAMPCOLORARBPROC)glewGetProcAddress((const GLubyte*)"glClampColorARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_color_buffer_float */ - -#ifdef GL_ARB_compute_shader - -static GLboolean _glewInit_GL_ARB_compute_shader (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDispatchCompute = (PFNGLDISPATCHCOMPUTEPROC)glewGetProcAddress((const GLubyte*)"glDispatchCompute")) == NULL) || r; - r = ((glDispatchComputeIndirect = (PFNGLDISPATCHCOMPUTEINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDispatchComputeIndirect")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_compute_shader */ - -#ifdef GL_ARB_compute_variable_group_size - -static GLboolean _glewInit_GL_ARB_compute_variable_group_size (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDispatchComputeGroupSizeARB = (PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC)glewGetProcAddress((const GLubyte*)"glDispatchComputeGroupSizeARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_compute_variable_group_size */ - -#ifdef GL_ARB_copy_buffer - -static GLboolean _glewInit_GL_ARB_copy_buffer (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glCopyBufferSubData")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_copy_buffer */ - -#ifdef GL_ARB_copy_image - -static GLboolean _glewInit_GL_ARB_copy_image (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCopyImageSubData = (PFNGLCOPYIMAGESUBDATAPROC)glewGetProcAddress((const GLubyte*)"glCopyImageSubData")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_copy_image */ - -#ifdef GL_ARB_debug_output - -static GLboolean _glewInit_GL_ARB_debug_output (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallbackARB")) == NULL) || r; - r = ((glDebugMessageControlARB = (PFNGLDEBUGMESSAGECONTROLARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageControlARB")) == NULL) || r; - r = ((glDebugMessageInsertARB = (PFNGLDEBUGMESSAGEINSERTARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsertARB")) == NULL) || r; - r = ((glGetDebugMessageLogARB = (PFNGLGETDEBUGMESSAGELOGARBPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLogARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_debug_output */ - -#ifdef GL_ARB_direct_state_access - -static GLboolean _glewInit_GL_ARB_direct_state_access (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindTextureUnit = (PFNGLBINDTEXTUREUNITPROC)glewGetProcAddress((const GLubyte*)"glBindTextureUnit")) == NULL) || r; - r = ((glBlitNamedFramebuffer = (PFNGLBLITNAMEDFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBlitNamedFramebuffer")) == NULL) || r; - r = ((glCheckNamedFramebufferStatus = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC)glewGetProcAddress((const GLubyte*)"glCheckNamedFramebufferStatus")) == NULL) || r; - r = ((glClearNamedBufferData = (PFNGLCLEARNAMEDBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferData")) == NULL) || r; - r = ((glClearNamedBufferSubData = (PFNGLCLEARNAMEDBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferSubData")) == NULL) || r; - r = ((glClearNamedFramebufferfi = (PFNGLCLEARNAMEDFRAMEBUFFERFIPROC)glewGetProcAddress((const GLubyte*)"glClearNamedFramebufferfi")) == NULL) || r; - r = ((glClearNamedFramebufferfv = (PFNGLCLEARNAMEDFRAMEBUFFERFVPROC)glewGetProcAddress((const GLubyte*)"glClearNamedFramebufferfv")) == NULL) || r; - r = ((glClearNamedFramebufferiv = (PFNGLCLEARNAMEDFRAMEBUFFERIVPROC)glewGetProcAddress((const GLubyte*)"glClearNamedFramebufferiv")) == NULL) || r; - r = ((glClearNamedFramebufferuiv = (PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC)glewGetProcAddress((const GLubyte*)"glClearNamedFramebufferuiv")) == NULL) || r; - r = ((glCompressedTextureSubImage1D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage1D")) == NULL) || r; - r = ((glCompressedTextureSubImage2D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage2D")) == NULL) || r; - r = ((glCompressedTextureSubImage3D = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage3D")) == NULL) || r; - r = ((glCopyNamedBufferSubData = (PFNGLCOPYNAMEDBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glCopyNamedBufferSubData")) == NULL) || r; - r = ((glCopyTextureSubImage1D = (PFNGLCOPYTEXTURESUBIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage1D")) == NULL) || r; - r = ((glCopyTextureSubImage2D = (PFNGLCOPYTEXTURESUBIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage2D")) == NULL) || r; - r = ((glCopyTextureSubImage3D = (PFNGLCOPYTEXTURESUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage3D")) == NULL) || r; - r = ((glCreateBuffers = (PFNGLCREATEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glCreateBuffers")) == NULL) || r; - r = ((glCreateFramebuffers = (PFNGLCREATEFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glCreateFramebuffers")) == NULL) || r; - r = ((glCreateProgramPipelines = (PFNGLCREATEPROGRAMPIPELINESPROC)glewGetProcAddress((const GLubyte*)"glCreateProgramPipelines")) == NULL) || r; - r = ((glCreateQueries = (PFNGLCREATEQUERIESPROC)glewGetProcAddress((const GLubyte*)"glCreateQueries")) == NULL) || r; - r = ((glCreateRenderbuffers = (PFNGLCREATERENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glCreateRenderbuffers")) == NULL) || r; - r = ((glCreateSamplers = (PFNGLCREATESAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glCreateSamplers")) == NULL) || r; - r = ((glCreateTextures = (PFNGLCREATETEXTURESPROC)glewGetProcAddress((const GLubyte*)"glCreateTextures")) == NULL) || r; - r = ((glCreateTransformFeedbacks = (PFNGLCREATETRANSFORMFEEDBACKSPROC)glewGetProcAddress((const GLubyte*)"glCreateTransformFeedbacks")) == NULL) || r; - r = ((glCreateVertexArrays = (PFNGLCREATEVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glCreateVertexArrays")) == NULL) || r; - r = ((glDisableVertexArrayAttrib = (PFNGLDISABLEVERTEXARRAYATTRIBPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexArrayAttrib")) == NULL) || r; - r = ((glEnableVertexArrayAttrib = (PFNGLENABLEVERTEXARRAYATTRIBPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexArrayAttrib")) == NULL) || r; - r = ((glFlushMappedNamedBufferRange = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedNamedBufferRange")) == NULL) || r; - r = ((glGenerateTextureMipmap = (PFNGLGENERATETEXTUREMIPMAPPROC)glewGetProcAddress((const GLubyte*)"glGenerateTextureMipmap")) == NULL) || r; - r = ((glGetCompressedTextureImage = (PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTextureImage")) == NULL) || r; - r = ((glGetNamedBufferParameteri64v = (PFNGLGETNAMEDBUFFERPARAMETERI64VPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameteri64v")) == NULL) || r; - r = ((glGetNamedBufferParameteriv = (PFNGLGETNAMEDBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameteriv")) == NULL) || r; - r = ((glGetNamedBufferPointerv = (PFNGLGETNAMEDBUFFERPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferPointerv")) == NULL) || r; - r = ((glGetNamedBufferSubData = (PFNGLGETNAMEDBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferSubData")) == NULL) || r; - r = ((glGetNamedFramebufferAttachmentParameteriv = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferAttachmentParameteriv")) == NULL) || r; - r = ((glGetNamedFramebufferParameteriv = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferParameteriv")) == NULL) || r; - r = ((glGetNamedRenderbufferParameteriv = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedRenderbufferParameteriv")) == NULL) || r; - r = ((glGetQueryBufferObjecti64v = (PFNGLGETQUERYBUFFEROBJECTI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryBufferObjecti64v")) == NULL) || r; - r = ((glGetQueryBufferObjectiv = (PFNGLGETQUERYBUFFEROBJECTIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryBufferObjectiv")) == NULL) || r; - r = ((glGetQueryBufferObjectui64v = (PFNGLGETQUERYBUFFEROBJECTUI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryBufferObjectui64v")) == NULL) || r; - r = ((glGetQueryBufferObjectuiv = (PFNGLGETQUERYBUFFEROBJECTUIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryBufferObjectuiv")) == NULL) || r; - r = ((glGetTextureImage = (PFNGLGETTEXTUREIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetTextureImage")) == NULL) || r; - r = ((glGetTextureLevelParameterfv = (PFNGLGETTEXTURELEVELPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterfv")) == NULL) || r; - r = ((glGetTextureLevelParameteriv = (PFNGLGETTEXTURELEVELPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameteriv")) == NULL) || r; - r = ((glGetTextureParameterIiv = (PFNGLGETTEXTUREPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIiv")) == NULL) || r; - r = ((glGetTextureParameterIuiv = (PFNGLGETTEXTUREPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIuiv")) == NULL) || r; - r = ((glGetTextureParameterfv = (PFNGLGETTEXTUREPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterfv")) == NULL) || r; - r = ((glGetTextureParameteriv = (PFNGLGETTEXTUREPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameteriv")) == NULL) || r; - r = ((glGetTransformFeedbacki64_v = (PFNGLGETTRANSFORMFEEDBACKI64_VPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbacki64_v")) == NULL) || r; - r = ((glGetTransformFeedbacki_v = (PFNGLGETTRANSFORMFEEDBACKI_VPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbacki_v")) == NULL) || r; - r = ((glGetTransformFeedbackiv = (PFNGLGETTRANSFORMFEEDBACKIVPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackiv")) == NULL) || r; - r = ((glGetVertexArrayIndexed64iv = (PFNGLGETVERTEXARRAYINDEXED64IVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIndexed64iv")) == NULL) || r; - r = ((glGetVertexArrayIndexediv = (PFNGLGETVERTEXARRAYINDEXEDIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIndexediv")) == NULL) || r; - r = ((glGetVertexArrayiv = (PFNGLGETVERTEXARRAYIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayiv")) == NULL) || r; - r = ((glInvalidateNamedFramebufferData = (PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateNamedFramebufferData")) == NULL) || r; - r = ((glInvalidateNamedFramebufferSubData = (PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateNamedFramebufferSubData")) == NULL) || r; - r = ((glMapNamedBuffer = (PFNGLMAPNAMEDBUFFERPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBuffer")) == NULL) || r; - r = ((glMapNamedBufferRange = (PFNGLMAPNAMEDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBufferRange")) == NULL) || r; - r = ((glNamedBufferData = (PFNGLNAMEDBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferData")) == NULL) || r; - r = ((glNamedBufferStorage = (PFNGLNAMEDBUFFERSTORAGEPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferStorage")) == NULL) || r; - r = ((glNamedBufferSubData = (PFNGLNAMEDBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferSubData")) == NULL) || r; - r = ((glNamedFramebufferDrawBuffer = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferDrawBuffer")) == NULL) || r; - r = ((glNamedFramebufferDrawBuffers = (PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferDrawBuffers")) == NULL) || r; - r = ((glNamedFramebufferParameteri = (PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferParameteri")) == NULL) || r; - r = ((glNamedFramebufferReadBuffer = (PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferReadBuffer")) == NULL) || r; - r = ((glNamedFramebufferRenderbuffer = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferRenderbuffer")) == NULL) || r; - r = ((glNamedFramebufferTexture = (PFNGLNAMEDFRAMEBUFFERTEXTUREPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture")) == NULL) || r; - r = ((glNamedFramebufferTextureLayer = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureLayer")) == NULL) || r; - r = ((glNamedRenderbufferStorage = (PFNGLNAMEDRENDERBUFFERSTORAGEPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorage")) == NULL) || r; - r = ((glNamedRenderbufferStorageMultisample = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisample")) == NULL) || r; - r = ((glTextureBuffer = (PFNGLTEXTUREBUFFERPROC)glewGetProcAddress((const GLubyte*)"glTextureBuffer")) == NULL) || r; - r = ((glTextureBufferRange = (PFNGLTEXTUREBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glTextureBufferRange")) == NULL) || r; - r = ((glTextureParameterIiv = (PFNGLTEXTUREPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIiv")) == NULL) || r; - r = ((glTextureParameterIuiv = (PFNGLTEXTUREPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIuiv")) == NULL) || r; - r = ((glTextureParameterf = (PFNGLTEXTUREPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterf")) == NULL) || r; - r = ((glTextureParameterfv = (PFNGLTEXTUREPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfv")) == NULL) || r; - r = ((glTextureParameteri = (PFNGLTEXTUREPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glTextureParameteri")) == NULL) || r; - r = ((glTextureParameteriv = (PFNGLTEXTUREPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glTextureParameteriv")) == NULL) || r; - r = ((glTextureStorage1D = (PFNGLTEXTURESTORAGE1DPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage1D")) == NULL) || r; - r = ((glTextureStorage2D = (PFNGLTEXTURESTORAGE2DPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2D")) == NULL) || r; - r = ((glTextureStorage2DMultisample = (PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2DMultisample")) == NULL) || r; - r = ((glTextureStorage3D = (PFNGLTEXTURESTORAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3D")) == NULL) || r; - r = ((glTextureStorage3DMultisample = (PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3DMultisample")) == NULL) || r; - r = ((glTextureSubImage1D = (PFNGLTEXTURESUBIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage1D")) == NULL) || r; - r = ((glTextureSubImage2D = (PFNGLTEXTURESUBIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage2D")) == NULL) || r; - r = ((glTextureSubImage3D = (PFNGLTEXTURESUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage3D")) == NULL) || r; - r = ((glTransformFeedbackBufferBase = (PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackBufferBase")) == NULL) || r; - r = ((glTransformFeedbackBufferRange = (PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackBufferRange")) == NULL) || r; - r = ((glUnmapNamedBuffer = (PFNGLUNMAPNAMEDBUFFERPROC)glewGetProcAddress((const GLubyte*)"glUnmapNamedBuffer")) == NULL) || r; - r = ((glVertexArrayAttribBinding = (PFNGLVERTEXARRAYATTRIBBINDINGPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayAttribBinding")) == NULL) || r; - r = ((glVertexArrayAttribFormat = (PFNGLVERTEXARRAYATTRIBFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayAttribFormat")) == NULL) || r; - r = ((glVertexArrayAttribIFormat = (PFNGLVERTEXARRAYATTRIBIFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayAttribIFormat")) == NULL) || r; - r = ((glVertexArrayAttribLFormat = (PFNGLVERTEXARRAYATTRIBLFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayAttribLFormat")) == NULL) || r; - r = ((glVertexArrayBindingDivisor = (PFNGLVERTEXARRAYBINDINGDIVISORPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayBindingDivisor")) == NULL) || r; - r = ((glVertexArrayElementBuffer = (PFNGLVERTEXARRAYELEMENTBUFFERPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayElementBuffer")) == NULL) || r; - r = ((glVertexArrayVertexBuffer = (PFNGLVERTEXARRAYVERTEXBUFFERPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexBuffer")) == NULL) || r; - r = ((glVertexArrayVertexBuffers = (PFNGLVERTEXARRAYVERTEXBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexBuffers")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_direct_state_access */ - -#ifdef GL_ARB_draw_buffers - -static GLboolean _glewInit_GL_ARB_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawBuffersARB = (PFNGLDRAWBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_draw_buffers */ - -#ifdef GL_ARB_draw_buffers_blend - -static GLboolean _glewInit_GL_ARB_draw_buffers_blend (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBlendEquationSeparateiARB = (PFNGLBLENDEQUATIONSEPARATEIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateiARB")) == NULL) || r; - r = ((glBlendEquationiARB = (PFNGLBLENDEQUATIONIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationiARB")) == NULL) || r; - r = ((glBlendFuncSeparateiARB = (PFNGLBLENDFUNCSEPARATEIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateiARB")) == NULL) || r; - r = ((glBlendFunciARB = (PFNGLBLENDFUNCIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendFunciARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_draw_buffers_blend */ - -#ifdef GL_ARB_draw_elements_base_vertex - -static GLboolean _glewInit_GL_ARB_draw_elements_base_vertex (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsBaseVertex")) == NULL) || r; - r = ((glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseVertex")) == NULL) || r; - r = ((glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementsBaseVertex")) == NULL) || r; - r = ((glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsBaseVertex")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_draw_elements_base_vertex */ - -#ifdef GL_ARB_draw_indirect - -static GLboolean _glewInit_GL_ARB_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawArraysIndirect = (PFNGLDRAWARRAYSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysIndirect")) == NULL) || r; - r = ((glDrawElementsIndirect = (PFNGLDRAWELEMENTSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsIndirect")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_draw_indirect */ - -#ifdef GL_ARB_framebuffer_no_attachments - -static GLboolean _glewInit_GL_ARB_framebuffer_no_attachments (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFramebufferParameteri = (PFNGLFRAMEBUFFERPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glFramebufferParameteri")) == NULL) || r; - r = ((glGetFramebufferParameteriv = (PFNGLGETFRAMEBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferParameteriv")) == NULL) || r; - r = ((glGetNamedFramebufferParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferParameterivEXT")) == NULL) || r; - r = ((glNamedFramebufferParameteriEXT = (PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferParameteriEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_framebuffer_no_attachments */ - -#ifdef GL_ARB_framebuffer_object - -static GLboolean _glewInit_GL_ARB_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindFramebuffer")) == NULL) || r; - r = ((glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindRenderbuffer")) == NULL) || r; - r = ((glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebuffer")) == NULL) || r; - r = ((glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)glewGetProcAddress((const GLubyte*)"glCheckFramebufferStatus")) == NULL) || r; - r = ((glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteFramebuffers")) == NULL) || r; - r = ((glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteRenderbuffers")) == NULL) || r; - r = ((glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferRenderbuffer")) == NULL) || r; - r = ((glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture1D")) == NULL) || r; - r = ((glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2D")) == NULL) || r; - r = ((glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture3D")) == NULL) || r; - r = ((glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayer")) == NULL) || r; - r = ((glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenFramebuffers")) == NULL) || r; - r = ((glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenRenderbuffers")) == NULL) || r; - r = ((glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)glewGetProcAddress((const GLubyte*)"glGenerateMipmap")) == NULL) || r; - r = ((glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferAttachmentParameteriv")) == NULL) || r; - r = ((glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetRenderbufferParameteriv")) == NULL) || r; - r = ((glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsFramebuffer")) == NULL) || r; - r = ((glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsRenderbuffer")) == NULL) || r; - r = ((glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorage")) == NULL) || r; - r = ((glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisample")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_framebuffer_object */ - -#ifdef GL_ARB_geometry_shader4 - -static GLboolean _glewInit_GL_ARB_geometry_shader4 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFramebufferTextureARB = (PFNGLFRAMEBUFFERTEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureARB")) == NULL) || r; - r = ((glFramebufferTextureFaceARB = (PFNGLFRAMEBUFFERTEXTUREFACEARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureFaceARB")) == NULL) || r; - r = ((glFramebufferTextureLayerARB = (PFNGLFRAMEBUFFERTEXTURELAYERARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayerARB")) == NULL) || r; - r = ((glProgramParameteriARB = (PFNGLPROGRAMPARAMETERIARBPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteriARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_geometry_shader4 */ - -#ifdef GL_ARB_get_program_binary - -static GLboolean _glewInit_GL_ARB_get_program_binary (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC)glewGetProcAddress((const GLubyte*)"glGetProgramBinary")) == NULL) || r; - r = ((glProgramBinary = (PFNGLPROGRAMBINARYPROC)glewGetProcAddress((const GLubyte*)"glProgramBinary")) == NULL) || r; - r = ((glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteri")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_get_program_binary */ - -#ifdef GL_ARB_get_texture_sub_image - -static GLboolean _glewInit_GL_ARB_get_texture_sub_image (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetCompressedTextureSubImage = (PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTextureSubImage")) == NULL) || r; - r = ((glGetTextureSubImage = (PFNGLGETTEXTURESUBIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetTextureSubImage")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_get_texture_sub_image */ - -#ifdef GL_ARB_gpu_shader_fp64 - -static GLboolean _glewInit_GL_ARB_gpu_shader_fp64 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetUniformdv = (PFNGLGETUNIFORMDVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformdv")) == NULL) || r; - r = ((glUniform1d = (PFNGLUNIFORM1DPROC)glewGetProcAddress((const GLubyte*)"glUniform1d")) == NULL) || r; - r = ((glUniform1dv = (PFNGLUNIFORM1DVPROC)glewGetProcAddress((const GLubyte*)"glUniform1dv")) == NULL) || r; - r = ((glUniform2d = (PFNGLUNIFORM2DPROC)glewGetProcAddress((const GLubyte*)"glUniform2d")) == NULL) || r; - r = ((glUniform2dv = (PFNGLUNIFORM2DVPROC)glewGetProcAddress((const GLubyte*)"glUniform2dv")) == NULL) || r; - r = ((glUniform3d = (PFNGLUNIFORM3DPROC)glewGetProcAddress((const GLubyte*)"glUniform3d")) == NULL) || r; - r = ((glUniform3dv = (PFNGLUNIFORM3DVPROC)glewGetProcAddress((const GLubyte*)"glUniform3dv")) == NULL) || r; - r = ((glUniform4d = (PFNGLUNIFORM4DPROC)glewGetProcAddress((const GLubyte*)"glUniform4d")) == NULL) || r; - r = ((glUniform4dv = (PFNGLUNIFORM4DVPROC)glewGetProcAddress((const GLubyte*)"glUniform4dv")) == NULL) || r; - r = ((glUniformMatrix2dv = (PFNGLUNIFORMMATRIX2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2dv")) == NULL) || r; - r = ((glUniformMatrix2x3dv = (PFNGLUNIFORMMATRIX2X3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x3dv")) == NULL) || r; - r = ((glUniformMatrix2x4dv = (PFNGLUNIFORMMATRIX2X4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x4dv")) == NULL) || r; - r = ((glUniformMatrix3dv = (PFNGLUNIFORMMATRIX3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3dv")) == NULL) || r; - r = ((glUniformMatrix3x2dv = (PFNGLUNIFORMMATRIX3X2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x2dv")) == NULL) || r; - r = ((glUniformMatrix3x4dv = (PFNGLUNIFORMMATRIX3X4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x4dv")) == NULL) || r; - r = ((glUniformMatrix4dv = (PFNGLUNIFORMMATRIX4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4dv")) == NULL) || r; - r = ((glUniformMatrix4x2dv = (PFNGLUNIFORMMATRIX4X2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x2dv")) == NULL) || r; - r = ((glUniformMatrix4x3dv = (PFNGLUNIFORMMATRIX4X3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x3dv")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_gpu_shader_fp64 */ - -#ifdef GL_ARB_gpu_shader_int64 - -static GLboolean _glewInit_GL_ARB_gpu_shader_int64 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetUniformi64vARB = (PFNGLGETUNIFORMI64VARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformi64vARB")) == NULL) || r; - r = ((glGetUniformui64vARB = (PFNGLGETUNIFORMUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformui64vARB")) == NULL) || r; - r = ((glGetnUniformi64vARB = (PFNGLGETNUNIFORMI64VARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformi64vARB")) == NULL) || r; - r = ((glGetnUniformui64vARB = (PFNGLGETNUNIFORMUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformui64vARB")) == NULL) || r; - r = ((glProgramUniform1i64ARB = (PFNGLPROGRAMUNIFORM1I64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64ARB")) == NULL) || r; - r = ((glProgramUniform1i64vARB = (PFNGLPROGRAMUNIFORM1I64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64vARB")) == NULL) || r; - r = ((glProgramUniform1ui64ARB = (PFNGLPROGRAMUNIFORM1UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64ARB")) == NULL) || r; - r = ((glProgramUniform1ui64vARB = (PFNGLPROGRAMUNIFORM1UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64vARB")) == NULL) || r; - r = ((glProgramUniform2i64ARB = (PFNGLPROGRAMUNIFORM2I64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64ARB")) == NULL) || r; - r = ((glProgramUniform2i64vARB = (PFNGLPROGRAMUNIFORM2I64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64vARB")) == NULL) || r; - r = ((glProgramUniform2ui64ARB = (PFNGLPROGRAMUNIFORM2UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64ARB")) == NULL) || r; - r = ((glProgramUniform2ui64vARB = (PFNGLPROGRAMUNIFORM2UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64vARB")) == NULL) || r; - r = ((glProgramUniform3i64ARB = (PFNGLPROGRAMUNIFORM3I64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64ARB")) == NULL) || r; - r = ((glProgramUniform3i64vARB = (PFNGLPROGRAMUNIFORM3I64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64vARB")) == NULL) || r; - r = ((glProgramUniform3ui64ARB = (PFNGLPROGRAMUNIFORM3UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64ARB")) == NULL) || r; - r = ((glProgramUniform3ui64vARB = (PFNGLPROGRAMUNIFORM3UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64vARB")) == NULL) || r; - r = ((glProgramUniform4i64ARB = (PFNGLPROGRAMUNIFORM4I64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64ARB")) == NULL) || r; - r = ((glProgramUniform4i64vARB = (PFNGLPROGRAMUNIFORM4I64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64vARB")) == NULL) || r; - r = ((glProgramUniform4ui64ARB = (PFNGLPROGRAMUNIFORM4UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64ARB")) == NULL) || r; - r = ((glProgramUniform4ui64vARB = (PFNGLPROGRAMUNIFORM4UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64vARB")) == NULL) || r; - r = ((glUniform1i64ARB = (PFNGLUNIFORM1I64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64ARB")) == NULL) || r; - r = ((glUniform1i64vARB = (PFNGLUNIFORM1I64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64vARB")) == NULL) || r; - r = ((glUniform1ui64ARB = (PFNGLUNIFORM1UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64ARB")) == NULL) || r; - r = ((glUniform1ui64vARB = (PFNGLUNIFORM1UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64vARB")) == NULL) || r; - r = ((glUniform2i64ARB = (PFNGLUNIFORM2I64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64ARB")) == NULL) || r; - r = ((glUniform2i64vARB = (PFNGLUNIFORM2I64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64vARB")) == NULL) || r; - r = ((glUniform2ui64ARB = (PFNGLUNIFORM2UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64ARB")) == NULL) || r; - r = ((glUniform2ui64vARB = (PFNGLUNIFORM2UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64vARB")) == NULL) || r; - r = ((glUniform3i64ARB = (PFNGLUNIFORM3I64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64ARB")) == NULL) || r; - r = ((glUniform3i64vARB = (PFNGLUNIFORM3I64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64vARB")) == NULL) || r; - r = ((glUniform3ui64ARB = (PFNGLUNIFORM3UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64ARB")) == NULL) || r; - r = ((glUniform3ui64vARB = (PFNGLUNIFORM3UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64vARB")) == NULL) || r; - r = ((glUniform4i64ARB = (PFNGLUNIFORM4I64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64ARB")) == NULL) || r; - r = ((glUniform4i64vARB = (PFNGLUNIFORM4I64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64vARB")) == NULL) || r; - r = ((glUniform4ui64ARB = (PFNGLUNIFORM4UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64ARB")) == NULL) || r; - r = ((glUniform4ui64vARB = (PFNGLUNIFORM4UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64vARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_gpu_shader_int64 */ - -#ifdef GL_ARB_imaging - -static GLboolean _glewInit_GL_ARB_imaging (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)"glBlendEquation")) == NULL) || r; - r = ((glColorSubTable = (PFNGLCOLORSUBTABLEPROC)glewGetProcAddress((const GLubyte*)"glColorSubTable")) == NULL) || r; - r = ((glColorTable = (PFNGLCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glColorTable")) == NULL) || r; - r = ((glColorTableParameterfv = (PFNGLCOLORTABLEPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterfv")) == NULL) || r; - r = ((glColorTableParameteriv = (PFNGLCOLORTABLEPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameteriv")) == NULL) || r; - r = ((glConvolutionFilter1D = (PFNGLCONVOLUTIONFILTER1DPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter1D")) == NULL) || r; - r = ((glConvolutionFilter2D = (PFNGLCONVOLUTIONFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter2D")) == NULL) || r; - r = ((glConvolutionParameterf = (PFNGLCONVOLUTIONPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterf")) == NULL) || r; - r = ((glConvolutionParameterfv = (PFNGLCONVOLUTIONPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfv")) == NULL) || r; - r = ((glConvolutionParameteri = (PFNGLCONVOLUTIONPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteri")) == NULL) || r; - r = ((glConvolutionParameteriv = (PFNGLCONVOLUTIONPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteriv")) == NULL) || r; - r = ((glCopyColorSubTable = (PFNGLCOPYCOLORSUBTABLEPROC)glewGetProcAddress((const GLubyte*)"glCopyColorSubTable")) == NULL) || r; - r = ((glCopyColorTable = (PFNGLCOPYCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glCopyColorTable")) == NULL) || r; - r = ((glCopyConvolutionFilter1D = (PFNGLCOPYCONVOLUTIONFILTER1DPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter1D")) == NULL) || r; - r = ((glCopyConvolutionFilter2D = (PFNGLCOPYCONVOLUTIONFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter2D")) == NULL) || r; - r = ((glGetColorTable = (PFNGLGETCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glGetColorTable")) == NULL) || r; - r = ((glGetColorTableParameterfv = (PFNGLGETCOLORTABLEPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfv")) == NULL) || r; - r = ((glGetColorTableParameteriv = (PFNGLGETCOLORTABLEPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameteriv")) == NULL) || r; - r = ((glGetConvolutionFilter = (PFNGLGETCONVOLUTIONFILTERPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionFilter")) == NULL) || r; - r = ((glGetConvolutionParameterfv = (PFNGLGETCONVOLUTIONPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterfv")) == NULL) || r; - r = ((glGetConvolutionParameteriv = (PFNGLGETCONVOLUTIONPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameteriv")) == NULL) || r; - r = ((glGetHistogram = (PFNGLGETHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glGetHistogram")) == NULL) || r; - r = ((glGetHistogramParameterfv = (PFNGLGETHISTOGRAMPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterfv")) == NULL) || r; - r = ((glGetHistogramParameteriv = (PFNGLGETHISTOGRAMPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameteriv")) == NULL) || r; - r = ((glGetMinmax = (PFNGLGETMINMAXPROC)glewGetProcAddress((const GLubyte*)"glGetMinmax")) == NULL) || r; - r = ((glGetMinmaxParameterfv = (PFNGLGETMINMAXPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterfv")) == NULL) || r; - r = ((glGetMinmaxParameteriv = (PFNGLGETMINMAXPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameteriv")) == NULL) || r; - r = ((glGetSeparableFilter = (PFNGLGETSEPARABLEFILTERPROC)glewGetProcAddress((const GLubyte*)"glGetSeparableFilter")) == NULL) || r; - r = ((glHistogram = (PFNGLHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glHistogram")) == NULL) || r; - r = ((glMinmax = (PFNGLMINMAXPROC)glewGetProcAddress((const GLubyte*)"glMinmax")) == NULL) || r; - r = ((glResetHistogram = (PFNGLRESETHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glResetHistogram")) == NULL) || r; - r = ((glResetMinmax = (PFNGLRESETMINMAXPROC)glewGetProcAddress((const GLubyte*)"glResetMinmax")) == NULL) || r; - r = ((glSeparableFilter2D = (PFNGLSEPARABLEFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glSeparableFilter2D")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_imaging */ - -#ifdef GL_ARB_indirect_parameters - -static GLboolean _glewInit_GL_ARB_indirect_parameters (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glMultiDrawArraysIndirectCountARB = (PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectCountARB")) == NULL) || r; - r = ((glMultiDrawElementsIndirectCountARB = (PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectCountARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_indirect_parameters */ - -#ifdef GL_ARB_instanced_arrays - -static GLboolean _glewInit_GL_ARB_instanced_arrays (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawArraysInstancedARB = (PFNGLDRAWARRAYSINSTANCEDARBPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedARB")) == NULL) || r; - r = ((glDrawElementsInstancedARB = (PFNGLDRAWELEMENTSINSTANCEDARBPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedARB")) == NULL) || r; - r = ((glVertexAttribDivisorARB = (PFNGLVERTEXATTRIBDIVISORARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisorARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_instanced_arrays */ - -#ifdef GL_ARB_internalformat_query - -static GLboolean _glewInit_GL_ARB_internalformat_query (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetInternalformativ = (PFNGLGETINTERNALFORMATIVPROC)glewGetProcAddress((const GLubyte*)"glGetInternalformativ")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_internalformat_query */ - -#ifdef GL_ARB_internalformat_query2 - -static GLboolean _glewInit_GL_ARB_internalformat_query2 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetInternalformati64v = (PFNGLGETINTERNALFORMATI64VPROC)glewGetProcAddress((const GLubyte*)"glGetInternalformati64v")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_internalformat_query2 */ - -#ifdef GL_ARB_invalidate_subdata - -static GLboolean _glewInit_GL_ARB_invalidate_subdata (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glInvalidateBufferData = (PFNGLINVALIDATEBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateBufferData")) == NULL) || r; - r = ((glInvalidateBufferSubData = (PFNGLINVALIDATEBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateBufferSubData")) == NULL) || r; - r = ((glInvalidateFramebuffer = (PFNGLINVALIDATEFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glInvalidateFramebuffer")) == NULL) || r; - r = ((glInvalidateSubFramebuffer = (PFNGLINVALIDATESUBFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glInvalidateSubFramebuffer")) == NULL) || r; - r = ((glInvalidateTexImage = (PFNGLINVALIDATETEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glInvalidateTexImage")) == NULL) || r; - r = ((glInvalidateTexSubImage = (PFNGLINVALIDATETEXSUBIMAGEPROC)glewGetProcAddress((const GLubyte*)"glInvalidateTexSubImage")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_invalidate_subdata */ - -#ifdef GL_ARB_map_buffer_range - -static GLboolean _glewInit_GL_ARB_map_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedBufferRange")) == NULL) || r; - r = ((glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glMapBufferRange")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_map_buffer_range */ - -#ifdef GL_ARB_matrix_palette - -static GLboolean _glewInit_GL_ARB_matrix_palette (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCurrentPaletteMatrixARB = (PFNGLCURRENTPALETTEMATRIXARBPROC)glewGetProcAddress((const GLubyte*)"glCurrentPaletteMatrixARB")) == NULL) || r; - r = ((glMatrixIndexPointerARB = (PFNGLMATRIXINDEXPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexPointerARB")) == NULL) || r; - r = ((glMatrixIndexubvARB = (PFNGLMATRIXINDEXUBVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexubvARB")) == NULL) || r; - r = ((glMatrixIndexuivARB = (PFNGLMATRIXINDEXUIVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexuivARB")) == NULL) || r; - r = ((glMatrixIndexusvARB = (PFNGLMATRIXINDEXUSVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexusvARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_matrix_palette */ - -#ifdef GL_ARB_multi_bind - -static GLboolean _glewInit_GL_ARB_multi_bind (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindBuffersBase = (PFNGLBINDBUFFERSBASEPROC)glewGetProcAddress((const GLubyte*)"glBindBuffersBase")) == NULL) || r; - r = ((glBindBuffersRange = (PFNGLBINDBUFFERSRANGEPROC)glewGetProcAddress((const GLubyte*)"glBindBuffersRange")) == NULL) || r; - r = ((glBindImageTextures = (PFNGLBINDIMAGETEXTURESPROC)glewGetProcAddress((const GLubyte*)"glBindImageTextures")) == NULL) || r; - r = ((glBindSamplers = (PFNGLBINDSAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glBindSamplers")) == NULL) || r; - r = ((glBindTextures = (PFNGLBINDTEXTURESPROC)glewGetProcAddress((const GLubyte*)"glBindTextures")) == NULL) || r; - r = ((glBindVertexBuffers = (PFNGLBINDVERTEXBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glBindVertexBuffers")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_multi_bind */ - -#ifdef GL_ARB_multi_draw_indirect - -static GLboolean _glewInit_GL_ARB_multi_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glMultiDrawArraysIndirect = (PFNGLMULTIDRAWARRAYSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirect")) == NULL) || r; - r = ((glMultiDrawElementsIndirect = (PFNGLMULTIDRAWELEMENTSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirect")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_multi_draw_indirect */ - -#ifdef GL_ARB_multisample - -static GLboolean _glewInit_GL_ARB_multisample (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glSampleCoverageARB = (PFNGLSAMPLECOVERAGEARBPROC)glewGetProcAddress((const GLubyte*)"glSampleCoverageARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_multisample */ - -#ifdef GL_ARB_multitexture - -static GLboolean _glewInit_GL_ARB_multitexture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glActiveTextureARB")) == NULL) || r; - r = ((glClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glClientActiveTextureARB")) == NULL) || r; - r = ((glMultiTexCoord1dARB = (PFNGLMULTITEXCOORD1DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dARB")) == NULL) || r; - r = ((glMultiTexCoord1dvARB = (PFNGLMULTITEXCOORD1DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dvARB")) == NULL) || r; - r = ((glMultiTexCoord1fARB = (PFNGLMULTITEXCOORD1FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fARB")) == NULL) || r; - r = ((glMultiTexCoord1fvARB = (PFNGLMULTITEXCOORD1FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fvARB")) == NULL) || r; - r = ((glMultiTexCoord1iARB = (PFNGLMULTITEXCOORD1IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1iARB")) == NULL) || r; - r = ((glMultiTexCoord1ivARB = (PFNGLMULTITEXCOORD1IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1ivARB")) == NULL) || r; - r = ((glMultiTexCoord1sARB = (PFNGLMULTITEXCOORD1SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1sARB")) == NULL) || r; - r = ((glMultiTexCoord1svARB = (PFNGLMULTITEXCOORD1SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1svARB")) == NULL) || r; - r = ((glMultiTexCoord2dARB = (PFNGLMULTITEXCOORD2DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dARB")) == NULL) || r; - r = ((glMultiTexCoord2dvARB = (PFNGLMULTITEXCOORD2DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dvARB")) == NULL) || r; - r = ((glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fARB")) == NULL) || r; - r = ((glMultiTexCoord2fvARB = (PFNGLMULTITEXCOORD2FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fvARB")) == NULL) || r; - r = ((glMultiTexCoord2iARB = (PFNGLMULTITEXCOORD2IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2iARB")) == NULL) || r; - r = ((glMultiTexCoord2ivARB = (PFNGLMULTITEXCOORD2IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2ivARB")) == NULL) || r; - r = ((glMultiTexCoord2sARB = (PFNGLMULTITEXCOORD2SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2sARB")) == NULL) || r; - r = ((glMultiTexCoord2svARB = (PFNGLMULTITEXCOORD2SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2svARB")) == NULL) || r; - r = ((glMultiTexCoord3dARB = (PFNGLMULTITEXCOORD3DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dARB")) == NULL) || r; - r = ((glMultiTexCoord3dvARB = (PFNGLMULTITEXCOORD3DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dvARB")) == NULL) || r; - r = ((glMultiTexCoord3fARB = (PFNGLMULTITEXCOORD3FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fARB")) == NULL) || r; - r = ((glMultiTexCoord3fvARB = (PFNGLMULTITEXCOORD3FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fvARB")) == NULL) || r; - r = ((glMultiTexCoord3iARB = (PFNGLMULTITEXCOORD3IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3iARB")) == NULL) || r; - r = ((glMultiTexCoord3ivARB = (PFNGLMULTITEXCOORD3IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3ivARB")) == NULL) || r; - r = ((glMultiTexCoord3sARB = (PFNGLMULTITEXCOORD3SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3sARB")) == NULL) || r; - r = ((glMultiTexCoord3svARB = (PFNGLMULTITEXCOORD3SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3svARB")) == NULL) || r; - r = ((glMultiTexCoord4dARB = (PFNGLMULTITEXCOORD4DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dARB")) == NULL) || r; - r = ((glMultiTexCoord4dvARB = (PFNGLMULTITEXCOORD4DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dvARB")) == NULL) || r; - r = ((glMultiTexCoord4fARB = (PFNGLMULTITEXCOORD4FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fARB")) == NULL) || r; - r = ((glMultiTexCoord4fvARB = (PFNGLMULTITEXCOORD4FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fvARB")) == NULL) || r; - r = ((glMultiTexCoord4iARB = (PFNGLMULTITEXCOORD4IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4iARB")) == NULL) || r; - r = ((glMultiTexCoord4ivARB = (PFNGLMULTITEXCOORD4IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4ivARB")) == NULL) || r; - r = ((glMultiTexCoord4sARB = (PFNGLMULTITEXCOORD4SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4sARB")) == NULL) || r; - r = ((glMultiTexCoord4svARB = (PFNGLMULTITEXCOORD4SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4svARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_multitexture */ - -#ifdef GL_ARB_occlusion_query - -static GLboolean _glewInit_GL_ARB_occlusion_query (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBeginQueryARB = (PFNGLBEGINQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryARB")) == NULL) || r; - r = ((glDeleteQueriesARB = (PFNGLDELETEQUERIESARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueriesARB")) == NULL) || r; - r = ((glEndQueryARB = (PFNGLENDQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glEndQueryARB")) == NULL) || r; - r = ((glGenQueriesARB = (PFNGLGENQUERIESARBPROC)glewGetProcAddress((const GLubyte*)"glGenQueriesARB")) == NULL) || r; - r = ((glGetQueryObjectivARB = (PFNGLGETQUERYOBJECTIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectivARB")) == NULL) || r; - r = ((glGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuivARB")) == NULL) || r; - r = ((glGetQueryivARB = (PFNGLGETQUERYIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryivARB")) == NULL) || r; - r = ((glIsQueryARB = (PFNGLISQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glIsQueryARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_occlusion_query */ - -#ifdef GL_ARB_parallel_shader_compile - -static GLboolean _glewInit_GL_ARB_parallel_shader_compile (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glMaxShaderCompilerThreadsARB = (PFNGLMAXSHADERCOMPILERTHREADSARBPROC)glewGetProcAddress((const GLubyte*)"glMaxShaderCompilerThreadsARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_parallel_shader_compile */ - -#ifdef GL_ARB_point_parameters - -static GLboolean _glewInit_GL_ARB_point_parameters (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glPointParameterfARB = (PFNGLPOINTPARAMETERFARBPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfARB")) == NULL) || r; - r = ((glPointParameterfvARB = (PFNGLPOINTPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfvARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_point_parameters */ - -#ifdef GL_ARB_program_interface_query - -static GLboolean _glewInit_GL_ARB_program_interface_query (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetProgramInterfaceiv = (PFNGLGETPROGRAMINTERFACEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramInterfaceiv")) == NULL) || r; - r = ((glGetProgramResourceIndex = (PFNGLGETPROGRAMRESOURCEINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceIndex")) == NULL) || r; - r = ((glGetProgramResourceLocation = (PFNGLGETPROGRAMRESOURCELOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceLocation")) == NULL) || r; - r = ((glGetProgramResourceLocationIndex = (PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceLocationIndex")) == NULL) || r; - r = ((glGetProgramResourceName = (PFNGLGETPROGRAMRESOURCENAMEPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceName")) == NULL) || r; - r = ((glGetProgramResourceiv = (PFNGLGETPROGRAMRESOURCEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceiv")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_program_interface_query */ - -#ifdef GL_ARB_provoking_vertex - -static GLboolean _glewInit_GL_ARB_provoking_vertex (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)glewGetProcAddress((const GLubyte*)"glProvokingVertex")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_provoking_vertex */ - -#ifdef GL_ARB_robustness - -static GLboolean _glewInit_GL_ARB_robustness (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetGraphicsResetStatusARB = (PFNGLGETGRAPHICSRESETSTATUSARBPROC)glewGetProcAddress((const GLubyte*)"glGetGraphicsResetStatusARB")) == NULL) || r; - r = ((glGetnColorTableARB = (PFNGLGETNCOLORTABLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnColorTableARB")) == NULL) || r; - r = ((glGetnCompressedTexImageARB = (PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnCompressedTexImageARB")) == NULL) || r; - r = ((glGetnConvolutionFilterARB = (PFNGLGETNCONVOLUTIONFILTERARBPROC)glewGetProcAddress((const GLubyte*)"glGetnConvolutionFilterARB")) == NULL) || r; - r = ((glGetnHistogramARB = (PFNGLGETNHISTOGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glGetnHistogramARB")) == NULL) || r; - r = ((glGetnMapdvARB = (PFNGLGETNMAPDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapdvARB")) == NULL) || r; - r = ((glGetnMapfvARB = (PFNGLGETNMAPFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapfvARB")) == NULL) || r; - r = ((glGetnMapivARB = (PFNGLGETNMAPIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapivARB")) == NULL) || r; - r = ((glGetnMinmaxARB = (PFNGLGETNMINMAXARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMinmaxARB")) == NULL) || r; - r = ((glGetnPixelMapfvARB = (PFNGLGETNPIXELMAPFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapfvARB")) == NULL) || r; - r = ((glGetnPixelMapuivARB = (PFNGLGETNPIXELMAPUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapuivARB")) == NULL) || r; - r = ((glGetnPixelMapusvARB = (PFNGLGETNPIXELMAPUSVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapusvARB")) == NULL) || r; - r = ((glGetnPolygonStippleARB = (PFNGLGETNPOLYGONSTIPPLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPolygonStippleARB")) == NULL) || r; - r = ((glGetnSeparableFilterARB = (PFNGLGETNSEPARABLEFILTERARBPROC)glewGetProcAddress((const GLubyte*)"glGetnSeparableFilterARB")) == NULL) || r; - r = ((glGetnTexImageARB = (PFNGLGETNTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnTexImageARB")) == NULL) || r; - r = ((glGetnUniformdvARB = (PFNGLGETNUNIFORMDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformdvARB")) == NULL) || r; - r = ((glGetnUniformfvARB = (PFNGLGETNUNIFORMFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformfvARB")) == NULL) || r; - r = ((glGetnUniformivARB = (PFNGLGETNUNIFORMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformivARB")) == NULL) || r; - r = ((glGetnUniformuivARB = (PFNGLGETNUNIFORMUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformuivARB")) == NULL) || r; - r = ((glReadnPixelsARB = (PFNGLREADNPIXELSARBPROC)glewGetProcAddress((const GLubyte*)"glReadnPixelsARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_robustness */ - -#ifdef GL_ARB_sample_locations - -static GLboolean _glewInit_GL_ARB_sample_locations (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFramebufferSampleLocationsfvARB = (PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferSampleLocationsfvARB")) == NULL) || r; - r = ((glNamedFramebufferSampleLocationsfvARB = (PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferSampleLocationsfvARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_sample_locations */ - -#ifdef GL_ARB_sample_shading - -static GLboolean _glewInit_GL_ARB_sample_shading (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glMinSampleShadingARB = (PFNGLMINSAMPLESHADINGARBPROC)glewGetProcAddress((const GLubyte*)"glMinSampleShadingARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_sample_shading */ - -#ifdef GL_ARB_sampler_objects - -static GLboolean _glewInit_GL_ARB_sampler_objects (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindSampler = (PFNGLBINDSAMPLERPROC)glewGetProcAddress((const GLubyte*)"glBindSampler")) == NULL) || r; - r = ((glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteSamplers")) == NULL) || r; - r = ((glGenSamplers = (PFNGLGENSAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glGenSamplers")) == NULL) || r; - r = ((glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterIiv")) == NULL) || r; - r = ((glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterIuiv")) == NULL) || r; - r = ((glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterfv")) == NULL) || r; - r = ((glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameteriv")) == NULL) || r; - r = ((glIsSampler = (PFNGLISSAMPLERPROC)glewGetProcAddress((const GLubyte*)"glIsSampler")) == NULL) || r; - r = ((glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterIiv")) == NULL) || r; - r = ((glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterIuiv")) == NULL) || r; - r = ((glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterf")) == NULL) || r; - r = ((glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterfv")) == NULL) || r; - r = ((glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameteri")) == NULL) || r; - r = ((glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameteriv")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_sampler_objects */ - -#ifdef GL_ARB_separate_shader_objects - -static GLboolean _glewInit_GL_ARB_separate_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glActiveShaderProgram = (PFNGLACTIVESHADERPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glActiveShaderProgram")) == NULL) || r; - r = ((glBindProgramPipeline = (PFNGLBINDPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glBindProgramPipeline")) == NULL) || r; - r = ((glCreateShaderProgramv = (PFNGLCREATESHADERPROGRAMVPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderProgramv")) == NULL) || r; - r = ((glDeleteProgramPipelines = (PFNGLDELETEPROGRAMPIPELINESPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramPipelines")) == NULL) || r; - r = ((glGenProgramPipelines = (PFNGLGENPROGRAMPIPELINESPROC)glewGetProcAddress((const GLubyte*)"glGenProgramPipelines")) == NULL) || r; - r = ((glGetProgramPipelineInfoLog = (PFNGLGETPROGRAMPIPELINEINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetProgramPipelineInfoLog")) == NULL) || r; - r = ((glGetProgramPipelineiv = (PFNGLGETPROGRAMPIPELINEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramPipelineiv")) == NULL) || r; - r = ((glIsProgramPipeline = (PFNGLISPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glIsProgramPipeline")) == NULL) || r; - r = ((glProgramUniform1d = (PFNGLPROGRAMUNIFORM1DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1d")) == NULL) || r; - r = ((glProgramUniform1dv = (PFNGLPROGRAMUNIFORM1DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1dv")) == NULL) || r; - r = ((glProgramUniform1f = (PFNGLPROGRAMUNIFORM1FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1f")) == NULL) || r; - r = ((glProgramUniform1fv = (PFNGLPROGRAMUNIFORM1FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fv")) == NULL) || r; - r = ((glProgramUniform1i = (PFNGLPROGRAMUNIFORM1IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i")) == NULL) || r; - r = ((glProgramUniform1iv = (PFNGLPROGRAMUNIFORM1IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1iv")) == NULL) || r; - r = ((glProgramUniform1ui = (PFNGLPROGRAMUNIFORM1UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui")) == NULL) || r; - r = ((glProgramUniform1uiv = (PFNGLPROGRAMUNIFORM1UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uiv")) == NULL) || r; - r = ((glProgramUniform2d = (PFNGLPROGRAMUNIFORM2DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2d")) == NULL) || r; - r = ((glProgramUniform2dv = (PFNGLPROGRAMUNIFORM2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2dv")) == NULL) || r; - r = ((glProgramUniform2f = (PFNGLPROGRAMUNIFORM2FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2f")) == NULL) || r; - r = ((glProgramUniform2fv = (PFNGLPROGRAMUNIFORM2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fv")) == NULL) || r; - r = ((glProgramUniform2i = (PFNGLPROGRAMUNIFORM2IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i")) == NULL) || r; - r = ((glProgramUniform2iv = (PFNGLPROGRAMUNIFORM2IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2iv")) == NULL) || r; - r = ((glProgramUniform2ui = (PFNGLPROGRAMUNIFORM2UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui")) == NULL) || r; - r = ((glProgramUniform2uiv = (PFNGLPROGRAMUNIFORM2UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uiv")) == NULL) || r; - r = ((glProgramUniform3d = (PFNGLPROGRAMUNIFORM3DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3d")) == NULL) || r; - r = ((glProgramUniform3dv = (PFNGLPROGRAMUNIFORM3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3dv")) == NULL) || r; - r = ((glProgramUniform3f = (PFNGLPROGRAMUNIFORM3FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3f")) == NULL) || r; - r = ((glProgramUniform3fv = (PFNGLPROGRAMUNIFORM3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fv")) == NULL) || r; - r = ((glProgramUniform3i = (PFNGLPROGRAMUNIFORM3IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i")) == NULL) || r; - r = ((glProgramUniform3iv = (PFNGLPROGRAMUNIFORM3IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3iv")) == NULL) || r; - r = ((glProgramUniform3ui = (PFNGLPROGRAMUNIFORM3UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui")) == NULL) || r; - r = ((glProgramUniform3uiv = (PFNGLPROGRAMUNIFORM3UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uiv")) == NULL) || r; - r = ((glProgramUniform4d = (PFNGLPROGRAMUNIFORM4DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4d")) == NULL) || r; - r = ((glProgramUniform4dv = (PFNGLPROGRAMUNIFORM4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4dv")) == NULL) || r; - r = ((glProgramUniform4f = (PFNGLPROGRAMUNIFORM4FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4f")) == NULL) || r; - r = ((glProgramUniform4fv = (PFNGLPROGRAMUNIFORM4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fv")) == NULL) || r; - r = ((glProgramUniform4i = (PFNGLPROGRAMUNIFORM4IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i")) == NULL) || r; - r = ((glProgramUniform4iv = (PFNGLPROGRAMUNIFORM4IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4iv")) == NULL) || r; - r = ((glProgramUniform4ui = (PFNGLPROGRAMUNIFORM4UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui")) == NULL) || r; - r = ((glProgramUniform4uiv = (PFNGLPROGRAMUNIFORM4UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uiv")) == NULL) || r; - r = ((glProgramUniformMatrix2dv = (PFNGLPROGRAMUNIFORMMATRIX2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2dv")) == NULL) || r; - r = ((glProgramUniformMatrix2fv = (PFNGLPROGRAMUNIFORMMATRIX2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2fv")) == NULL) || r; - r = ((glProgramUniformMatrix2x3dv = (PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3dv")) == NULL) || r; - r = ((glProgramUniformMatrix2x3fv = (PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3fv")) == NULL) || r; - r = ((glProgramUniformMatrix2x4dv = (PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4dv")) == NULL) || r; - r = ((glProgramUniformMatrix2x4fv = (PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4fv")) == NULL) || r; - r = ((glProgramUniformMatrix3dv = (PFNGLPROGRAMUNIFORMMATRIX3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3dv")) == NULL) || r; - r = ((glProgramUniformMatrix3fv = (PFNGLPROGRAMUNIFORMMATRIX3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3fv")) == NULL) || r; - r = ((glProgramUniformMatrix3x2dv = (PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2dv")) == NULL) || r; - r = ((glProgramUniformMatrix3x2fv = (PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2fv")) == NULL) || r; - r = ((glProgramUniformMatrix3x4dv = (PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4dv")) == NULL) || r; - r = ((glProgramUniformMatrix3x4fv = (PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4fv")) == NULL) || r; - r = ((glProgramUniformMatrix4dv = (PFNGLPROGRAMUNIFORMMATRIX4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4dv")) == NULL) || r; - r = ((glProgramUniformMatrix4fv = (PFNGLPROGRAMUNIFORMMATRIX4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4fv")) == NULL) || r; - r = ((glProgramUniformMatrix4x2dv = (PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2dv")) == NULL) || r; - r = ((glProgramUniformMatrix4x2fv = (PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2fv")) == NULL) || r; - r = ((glProgramUniformMatrix4x3dv = (PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3dv")) == NULL) || r; - r = ((glProgramUniformMatrix4x3fv = (PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3fv")) == NULL) || r; - r = ((glUseProgramStages = (PFNGLUSEPROGRAMSTAGESPROC)glewGetProcAddress((const GLubyte*)"glUseProgramStages")) == NULL) || r; - r = ((glValidateProgramPipeline = (PFNGLVALIDATEPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glValidateProgramPipeline")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_separate_shader_objects */ - -#ifdef GL_ARB_shader_atomic_counters - -static GLboolean _glewInit_GL_ARB_shader_atomic_counters (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetActiveAtomicCounterBufferiv = (PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAtomicCounterBufferiv")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_shader_atomic_counters */ - -#ifdef GL_ARB_shader_image_load_store - -static GLboolean _glewInit_GL_ARB_shader_image_load_store (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindImageTexture = (PFNGLBINDIMAGETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glBindImageTexture")) == NULL) || r; - r = ((glMemoryBarrier = (PFNGLMEMORYBARRIERPROC)glewGetProcAddress((const GLubyte*)"glMemoryBarrier")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_shader_image_load_store */ - -#ifdef GL_ARB_shader_objects - -static GLboolean _glewInit_GL_ARB_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glAttachObjectARB")) == NULL) || r; - r = ((glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)glewGetProcAddress((const GLubyte*)"glCompileShaderARB")) == NULL) || r; - r = ((glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateProgramObjectARB")) == NULL) || r; - r = ((glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderObjectARB")) == NULL) || r; - r = ((glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteObjectARB")) == NULL) || r; - r = ((glDetachObjectARB = (PFNGLDETACHOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glDetachObjectARB")) == NULL) || r; - r = ((glGetActiveUniformARB = (PFNGLGETACTIVEUNIFORMARBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformARB")) == NULL) || r; - r = ((glGetAttachedObjectsARB = (PFNGLGETATTACHEDOBJECTSARBPROC)glewGetProcAddress((const GLubyte*)"glGetAttachedObjectsARB")) == NULL) || r; - r = ((glGetHandleARB = (PFNGLGETHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetHandleARB")) == NULL) || r; - r = ((glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)glewGetProcAddress((const GLubyte*)"glGetInfoLogARB")) == NULL) || r; - r = ((glGetObjectParameterfvARB = (PFNGLGETOBJECTPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterfvARB")) == NULL) || r; - r = ((glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterivARB")) == NULL) || r; - r = ((glGetShaderSourceARB = (PFNGLGETSHADERSOURCEARBPROC)glewGetProcAddress((const GLubyte*)"glGetShaderSourceARB")) == NULL) || r; - r = ((glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformLocationARB")) == NULL) || r; - r = ((glGetUniformfvARB = (PFNGLGETUNIFORMFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformfvARB")) == NULL) || r; - r = ((glGetUniformivARB = (PFNGLGETUNIFORMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformivARB")) == NULL) || r; - r = ((glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glLinkProgramARB")) == NULL) || r; - r = ((glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)glewGetProcAddress((const GLubyte*)"glShaderSourceARB")) == NULL) || r; - r = ((glUniform1fARB = (PFNGLUNIFORM1FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1fARB")) == NULL) || r; - r = ((glUniform1fvARB = (PFNGLUNIFORM1FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1fvARB")) == NULL) || r; - r = ((glUniform1iARB = (PFNGLUNIFORM1IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1iARB")) == NULL) || r; - r = ((glUniform1ivARB = (PFNGLUNIFORM1IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1ivARB")) == NULL) || r; - r = ((glUniform2fARB = (PFNGLUNIFORM2FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2fARB")) == NULL) || r; - r = ((glUniform2fvARB = (PFNGLUNIFORM2FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2fvARB")) == NULL) || r; - r = ((glUniform2iARB = (PFNGLUNIFORM2IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2iARB")) == NULL) || r; - r = ((glUniform2ivARB = (PFNGLUNIFORM2IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2ivARB")) == NULL) || r; - r = ((glUniform3fARB = (PFNGLUNIFORM3FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3fARB")) == NULL) || r; - r = ((glUniform3fvARB = (PFNGLUNIFORM3FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3fvARB")) == NULL) || r; - r = ((glUniform3iARB = (PFNGLUNIFORM3IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3iARB")) == NULL) || r; - r = ((glUniform3ivARB = (PFNGLUNIFORM3IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3ivARB")) == NULL) || r; - r = ((glUniform4fARB = (PFNGLUNIFORM4FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4fARB")) == NULL) || r; - r = ((glUniform4fvARB = (PFNGLUNIFORM4FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4fvARB")) == NULL) || r; - r = ((glUniform4iARB = (PFNGLUNIFORM4IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4iARB")) == NULL) || r; - r = ((glUniform4ivARB = (PFNGLUNIFORM4IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4ivARB")) == NULL) || r; - r = ((glUniformMatrix2fvARB = (PFNGLUNIFORMMATRIX2FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2fvARB")) == NULL) || r; - r = ((glUniformMatrix3fvARB = (PFNGLUNIFORMMATRIX3FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3fvARB")) == NULL) || r; - r = ((glUniformMatrix4fvARB = (PFNGLUNIFORMMATRIX4FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4fvARB")) == NULL) || r; - r = ((glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glUseProgramObjectARB")) == NULL) || r; - r = ((glValidateProgramARB = (PFNGLVALIDATEPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glValidateProgramARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_shader_objects */ - -#ifdef GL_ARB_shader_storage_buffer_object - -static GLboolean _glewInit_GL_ARB_shader_storage_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glShaderStorageBlockBinding = (PFNGLSHADERSTORAGEBLOCKBINDINGPROC)glewGetProcAddress((const GLubyte*)"glShaderStorageBlockBinding")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_shader_storage_buffer_object */ - -#ifdef GL_ARB_shader_subroutine - -static GLboolean _glewInit_GL_ARB_shader_subroutine (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetActiveSubroutineName = (PFNGLGETACTIVESUBROUTINENAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineName")) == NULL) || r; - r = ((glGetActiveSubroutineUniformName = (PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineUniformName")) == NULL) || r; - r = ((glGetActiveSubroutineUniformiv = (PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineUniformiv")) == NULL) || r; - r = ((glGetProgramStageiv = (PFNGLGETPROGRAMSTAGEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStageiv")) == NULL) || r; - r = ((glGetSubroutineIndex = (PFNGLGETSUBROUTINEINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetSubroutineIndex")) == NULL) || r; - r = ((glGetSubroutineUniformLocation = (PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetSubroutineUniformLocation")) == NULL) || r; - r = ((glGetUniformSubroutineuiv = (PFNGLGETUNIFORMSUBROUTINEUIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformSubroutineuiv")) == NULL) || r; - r = ((glUniformSubroutinesuiv = (PFNGLUNIFORMSUBROUTINESUIVPROC)glewGetProcAddress((const GLubyte*)"glUniformSubroutinesuiv")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_shader_subroutine */ - -#ifdef GL_ARB_shading_language_include - -static GLboolean _glewInit_GL_ARB_shading_language_include (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCompileShaderIncludeARB = (PFNGLCOMPILESHADERINCLUDEARBPROC)glewGetProcAddress((const GLubyte*)"glCompileShaderIncludeARB")) == NULL) || r; - r = ((glDeleteNamedStringARB = (PFNGLDELETENAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteNamedStringARB")) == NULL) || r; - r = ((glGetNamedStringARB = (PFNGLGETNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glGetNamedStringARB")) == NULL) || r; - r = ((glGetNamedStringivARB = (PFNGLGETNAMEDSTRINGIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetNamedStringivARB")) == NULL) || r; - r = ((glIsNamedStringARB = (PFNGLISNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glIsNamedStringARB")) == NULL) || r; - r = ((glNamedStringARB = (PFNGLNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glNamedStringARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_shading_language_include */ - -#ifdef GL_ARB_sparse_buffer - -static GLboolean _glewInit_GL_ARB_sparse_buffer (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBufferPageCommitmentARB = (PFNGLBUFFERPAGECOMMITMENTARBPROC)glewGetProcAddress((const GLubyte*)"glBufferPageCommitmentARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_sparse_buffer */ - -#ifdef GL_ARB_sparse_texture - -static GLboolean _glewInit_GL_ARB_sparse_texture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTexPageCommitmentARB = (PFNGLTEXPAGECOMMITMENTARBPROC)glewGetProcAddress((const GLubyte*)"glTexPageCommitmentARB")) == NULL) || r; - r = ((glTexturePageCommitmentEXT = (PFNGLTEXTUREPAGECOMMITMENTEXTPROC)glewGetProcAddress((const GLubyte*)"glTexturePageCommitmentEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_sparse_texture */ - -#ifdef GL_ARB_sync - -static GLboolean _glewInit_GL_ARB_sync (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)glewGetProcAddress((const GLubyte*)"glClientWaitSync")) == NULL) || r; - r = ((glDeleteSync = (PFNGLDELETESYNCPROC)glewGetProcAddress((const GLubyte*)"glDeleteSync")) == NULL) || r; - r = ((glFenceSync = (PFNGLFENCESYNCPROC)glewGetProcAddress((const GLubyte*)"glFenceSync")) == NULL) || r; - r = ((glGetInteger64v = (PFNGLGETINTEGER64VPROC)glewGetProcAddress((const GLubyte*)"glGetInteger64v")) == NULL) || r; - r = ((glGetSynciv = (PFNGLGETSYNCIVPROC)glewGetProcAddress((const GLubyte*)"glGetSynciv")) == NULL) || r; - r = ((glIsSync = (PFNGLISSYNCPROC)glewGetProcAddress((const GLubyte*)"glIsSync")) == NULL) || r; - r = ((glWaitSync = (PFNGLWAITSYNCPROC)glewGetProcAddress((const GLubyte*)"glWaitSync")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_sync */ - -#ifdef GL_ARB_tessellation_shader - -static GLboolean _glewInit_GL_ARB_tessellation_shader (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glPatchParameterfv = (PFNGLPATCHPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glPatchParameterfv")) == NULL) || r; - r = ((glPatchParameteri = (PFNGLPATCHPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glPatchParameteri")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_tessellation_shader */ - -#ifdef GL_ARB_texture_barrier - -static GLboolean _glewInit_GL_ARB_texture_barrier (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTextureBarrier = (PFNGLTEXTUREBARRIERPROC)glewGetProcAddress((const GLubyte*)"glTextureBarrier")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_texture_barrier */ - -#ifdef GL_ARB_texture_buffer_object - -static GLboolean _glewInit_GL_ARB_texture_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTexBufferARB = (PFNGLTEXBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glTexBufferARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_texture_buffer_object */ - -#ifdef GL_ARB_texture_buffer_range - -static GLboolean _glewInit_GL_ARB_texture_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTexBufferRange = (PFNGLTEXBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glTexBufferRange")) == NULL) || r; - r = ((glTextureBufferRangeEXT = (PFNGLTEXTUREBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureBufferRangeEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_texture_buffer_range */ - -#ifdef GL_ARB_texture_compression - -static GLboolean _glewInit_GL_ARB_texture_compression (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCompressedTexImage1DARB = (PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage1DARB")) == NULL) || r; - r = ((glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage2DARB")) == NULL) || r; - r = ((glCompressedTexImage3DARB = (PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage3DARB")) == NULL) || r; - r = ((glCompressedTexSubImage1DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage1DARB")) == NULL) || r; - r = ((glCompressedTexSubImage2DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage2DARB")) == NULL) || r; - r = ((glCompressedTexSubImage3DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage3DARB")) == NULL) || r; - r = ((glGetCompressedTexImageARB = (PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTexImageARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_texture_compression */ - -#ifdef GL_ARB_texture_multisample - -static GLboolean _glewInit_GL_ARB_texture_multisample (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)glewGetProcAddress((const GLubyte*)"glGetMultisamplefv")) == NULL) || r; - r = ((glSampleMaski = (PFNGLSAMPLEMASKIPROC)glewGetProcAddress((const GLubyte*)"glSampleMaski")) == NULL) || r; - r = ((glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexImage2DMultisample")) == NULL) || r; - r = ((glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DMultisample")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_texture_multisample */ - -#ifdef GL_ARB_texture_storage - -static GLboolean _glewInit_GL_ARB_texture_storage (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTexStorage1D = (PFNGLTEXSTORAGE1DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage1D")) == NULL) || r; - r = ((glTexStorage2D = (PFNGLTEXSTORAGE2DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage2D")) == NULL) || r; - r = ((glTexStorage3D = (PFNGLTEXSTORAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage3D")) == NULL) || r; - r = ((glTextureStorage1DEXT = (PFNGLTEXTURESTORAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage1DEXT")) == NULL) || r; - r = ((glTextureStorage2DEXT = (PFNGLTEXTURESTORAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2DEXT")) == NULL) || r; - r = ((glTextureStorage3DEXT = (PFNGLTEXTURESTORAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3DEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_texture_storage */ - -#ifdef GL_ARB_texture_storage_multisample - -static GLboolean _glewInit_GL_ARB_texture_storage_multisample (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTexStorage2DMultisample = (PFNGLTEXSTORAGE2DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexStorage2DMultisample")) == NULL) || r; - r = ((glTexStorage3DMultisample = (PFNGLTEXSTORAGE3DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexStorage3DMultisample")) == NULL) || r; - r = ((glTextureStorage2DMultisampleEXT = (PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2DMultisampleEXT")) == NULL) || r; - r = ((glTextureStorage3DMultisampleEXT = (PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3DMultisampleEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_texture_storage_multisample */ - -#ifdef GL_ARB_texture_view - -static GLboolean _glewInit_GL_ARB_texture_view (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTextureView = (PFNGLTEXTUREVIEWPROC)glewGetProcAddress((const GLubyte*)"glTextureView")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_texture_view */ - -#ifdef GL_ARB_timer_query - -static GLboolean _glewInit_GL_ARB_timer_query (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64v")) == NULL) || r; - r = ((glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64v")) == NULL) || r; - r = ((glQueryCounter = (PFNGLQUERYCOUNTERPROC)glewGetProcAddress((const GLubyte*)"glQueryCounter")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_timer_query */ - -#ifdef GL_ARB_transform_feedback2 - -static GLboolean _glewInit_GL_ARB_transform_feedback2 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glBindTransformFeedback")) == NULL) || r; - r = ((glDeleteTransformFeedbacks = (PFNGLDELETETRANSFORMFEEDBACKSPROC)glewGetProcAddress((const GLubyte*)"glDeleteTransformFeedbacks")) == NULL) || r; - r = ((glDrawTransformFeedback = (PFNGLDRAWTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedback")) == NULL) || r; - r = ((glGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC)glewGetProcAddress((const GLubyte*)"glGenTransformFeedbacks")) == NULL) || r; - r = ((glIsTransformFeedback = (PFNGLISTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glIsTransformFeedback")) == NULL) || r; - r = ((glPauseTransformFeedback = (PFNGLPAUSETRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glPauseTransformFeedback")) == NULL) || r; - r = ((glResumeTransformFeedback = (PFNGLRESUMETRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glResumeTransformFeedback")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_transform_feedback2 */ - -#ifdef GL_ARB_transform_feedback3 - -static GLboolean _glewInit_GL_ARB_transform_feedback3 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBeginQueryIndexed = (PFNGLBEGINQUERYINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryIndexed")) == NULL) || r; - r = ((glDrawTransformFeedbackStream = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackStream")) == NULL) || r; - r = ((glEndQueryIndexed = (PFNGLENDQUERYINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glEndQueryIndexed")) == NULL) || r; - r = ((glGetQueryIndexediv = (PFNGLGETQUERYINDEXEDIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryIndexediv")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_transform_feedback3 */ - -#ifdef GL_ARB_transform_feedback_instanced - -static GLboolean _glewInit_GL_ARB_transform_feedback_instanced (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawTransformFeedbackInstanced = (PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackInstanced")) == NULL) || r; - r = ((glDrawTransformFeedbackStreamInstanced = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackStreamInstanced")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_transform_feedback_instanced */ - -#ifdef GL_ARB_transpose_matrix - -static GLboolean _glewInit_GL_ARB_transpose_matrix (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glLoadTransposeMatrixdARB = (PFNGLLOADTRANSPOSEMATRIXDARBPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixdARB")) == NULL) || r; - r = ((glLoadTransposeMatrixfARB = (PFNGLLOADTRANSPOSEMATRIXFARBPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixfARB")) == NULL) || r; - r = ((glMultTransposeMatrixdARB = (PFNGLMULTTRANSPOSEMATRIXDARBPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixdARB")) == NULL) || r; - r = ((glMultTransposeMatrixfARB = (PFNGLMULTTRANSPOSEMATRIXFARBPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixfARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_transpose_matrix */ - -#ifdef GL_ARB_uniform_buffer_object - -static GLboolean _glewInit_GL_ARB_uniform_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBase")) == NULL) || r; - r = ((glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRange")) == NULL) || r; - r = ((glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformBlockName")) == NULL) || r; - r = ((glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformBlockiv")) == NULL) || r; - r = ((glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformName")) == NULL) || r; - r = ((glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformsiv")) == NULL) || r; - r = ((glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)glewGetProcAddress((const GLubyte*)"glGetIntegeri_v")) == NULL) || r; - r = ((glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetUniformBlockIndex")) == NULL) || r; - r = ((glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)glewGetProcAddress((const GLubyte*)"glGetUniformIndices")) == NULL) || r; - r = ((glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)glewGetProcAddress((const GLubyte*)"glUniformBlockBinding")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_uniform_buffer_object */ - -#ifdef GL_ARB_vertex_array_object - -static GLboolean _glewInit_GL_ARB_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)glewGetProcAddress((const GLubyte*)"glBindVertexArray")) == NULL) || r; - r = ((glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexArrays")) == NULL) || r; - r = ((glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glGenVertexArrays")) == NULL) || r; - r = ((glIsVertexArray = (PFNGLISVERTEXARRAYPROC)glewGetProcAddress((const GLubyte*)"glIsVertexArray")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_vertex_array_object */ - -#ifdef GL_ARB_vertex_attrib_64bit - -static GLboolean _glewInit_GL_ARB_vertex_attrib_64bit (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetVertexAttribLdv = (PFNGLGETVERTEXATTRIBLDVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLdv")) == NULL) || r; - r = ((glVertexAttribL1d = (PFNGLVERTEXATTRIBL1DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1d")) == NULL) || r; - r = ((glVertexAttribL1dv = (PFNGLVERTEXATTRIBL1DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dv")) == NULL) || r; - r = ((glVertexAttribL2d = (PFNGLVERTEXATTRIBL2DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2d")) == NULL) || r; - r = ((glVertexAttribL2dv = (PFNGLVERTEXATTRIBL2DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dv")) == NULL) || r; - r = ((glVertexAttribL3d = (PFNGLVERTEXATTRIBL3DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3d")) == NULL) || r; - r = ((glVertexAttribL3dv = (PFNGLVERTEXATTRIBL3DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dv")) == NULL) || r; - r = ((glVertexAttribL4d = (PFNGLVERTEXATTRIBL4DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4d")) == NULL) || r; - r = ((glVertexAttribL4dv = (PFNGLVERTEXATTRIBL4DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dv")) == NULL) || r; - r = ((glVertexAttribLPointer = (PFNGLVERTEXATTRIBLPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLPointer")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_vertex_attrib_64bit */ - -#ifdef GL_ARB_vertex_attrib_binding - -static GLboolean _glewInit_GL_ARB_vertex_attrib_binding (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindVertexBuffer = (PFNGLBINDVERTEXBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindVertexBuffer")) == NULL) || r; - r = ((glVertexArrayBindVertexBufferEXT = (PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayBindVertexBufferEXT")) == NULL) || r; - r = ((glVertexArrayVertexAttribBindingEXT = (PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribBindingEXT")) == NULL) || r; - r = ((glVertexArrayVertexAttribFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribFormatEXT")) == NULL) || r; - r = ((glVertexArrayVertexAttribIFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribIFormatEXT")) == NULL) || r; - r = ((glVertexArrayVertexAttribLFormatEXT = (PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribLFormatEXT")) == NULL) || r; - r = ((glVertexArrayVertexBindingDivisorEXT = (PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexBindingDivisorEXT")) == NULL) || r; - r = ((glVertexAttribBinding = (PFNGLVERTEXATTRIBBINDINGPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribBinding")) == NULL) || r; - r = ((glVertexAttribFormat = (PFNGLVERTEXATTRIBFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribFormat")) == NULL) || r; - r = ((glVertexAttribIFormat = (PFNGLVERTEXATTRIBIFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIFormat")) == NULL) || r; - r = ((glVertexAttribLFormat = (PFNGLVERTEXATTRIBLFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLFormat")) == NULL) || r; - r = ((glVertexBindingDivisor = (PFNGLVERTEXBINDINGDIVISORPROC)glewGetProcAddress((const GLubyte*)"glVertexBindingDivisor")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_vertex_attrib_binding */ - -#ifdef GL_ARB_vertex_blend - -static GLboolean _glewInit_GL_ARB_vertex_blend (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glVertexBlendARB = (PFNGLVERTEXBLENDARBPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendARB")) == NULL) || r; - r = ((glWeightPointerARB = (PFNGLWEIGHTPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glWeightPointerARB")) == NULL) || r; - r = ((glWeightbvARB = (PFNGLWEIGHTBVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightbvARB")) == NULL) || r; - r = ((glWeightdvARB = (PFNGLWEIGHTDVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightdvARB")) == NULL) || r; - r = ((glWeightfvARB = (PFNGLWEIGHTFVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightfvARB")) == NULL) || r; - r = ((glWeightivARB = (PFNGLWEIGHTIVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightivARB")) == NULL) || r; - r = ((glWeightsvARB = (PFNGLWEIGHTSVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightsvARB")) == NULL) || r; - r = ((glWeightubvARB = (PFNGLWEIGHTUBVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightubvARB")) == NULL) || r; - r = ((glWeightuivARB = (PFNGLWEIGHTUIVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightuivARB")) == NULL) || r; - r = ((glWeightusvARB = (PFNGLWEIGHTUSVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightusvARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_vertex_blend */ - -#ifdef GL_ARB_vertex_buffer_object - -static GLboolean _glewInit_GL_ARB_vertex_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindBufferARB = (PFNGLBINDBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glBindBufferARB")) == NULL) || r; - r = ((glBufferDataARB = (PFNGLBUFFERDATAARBPROC)glewGetProcAddress((const GLubyte*)"glBufferDataARB")) == NULL) || r; - r = ((glBufferSubDataARB = (PFNGLBUFFERSUBDATAARBPROC)glewGetProcAddress((const GLubyte*)"glBufferSubDataARB")) == NULL) || r; - r = ((glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteBuffersARB")) == NULL) || r; - r = ((glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glGenBuffersARB")) == NULL) || r; - r = ((glGetBufferParameterivARB = (PFNGLGETBUFFERPARAMETERIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameterivARB")) == NULL) || r; - r = ((glGetBufferPointervARB = (PFNGLGETBUFFERPOINTERVARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferPointervARB")) == NULL) || r; - r = ((glGetBufferSubDataARB = (PFNGLGETBUFFERSUBDATAARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferSubDataARB")) == NULL) || r; - r = ((glIsBufferARB = (PFNGLISBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glIsBufferARB")) == NULL) || r; - r = ((glMapBufferARB = (PFNGLMAPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glMapBufferARB")) == NULL) || r; - r = ((glUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glUnmapBufferARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_vertex_buffer_object */ - -#ifdef GL_ARB_vertex_program - -static GLboolean _glewInit_GL_ARB_vertex_program (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glBindProgramARB")) == NULL) || r; - r = ((glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramsARB")) == NULL) || r; - r = ((glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribArrayARB")) == NULL) || r; - r = ((glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribArrayARB")) == NULL) || r; - r = ((glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)glewGetProcAddress((const GLubyte*)"glGenProgramsARB")) == NULL) || r; - r = ((glGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramEnvParameterdvARB")) == NULL) || r; - r = ((glGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramEnvParameterfvARB")) == NULL) || r; - r = ((glGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramLocalParameterdvARB")) == NULL) || r; - r = ((glGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramLocalParameterfvARB")) == NULL) || r; - r = ((glGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStringARB")) == NULL) || r; - r = ((glGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramivARB")) == NULL) || r; - r = ((glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointervARB")) == NULL) || r; - r = ((glGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdvARB")) == NULL) || r; - r = ((glGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfvARB")) == NULL) || r; - r = ((glGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribivARB")) == NULL) || r; - r = ((glIsProgramARB = (PFNGLISPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glIsProgramARB")) == NULL) || r; - r = ((glProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4dARB")) == NULL) || r; - r = ((glProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4dvARB")) == NULL) || r; - r = ((glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4fARB")) == NULL) || r; - r = ((glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4fvARB")) == NULL) || r; - r = ((glProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4dARB")) == NULL) || r; - r = ((glProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4dvARB")) == NULL) || r; - r = ((glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4fARB")) == NULL) || r; - r = ((glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4fvARB")) == NULL) || r; - r = ((glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glProgramStringARB")) == NULL) || r; - r = ((glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dARB")) == NULL) || r; - r = ((glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dvARB")) == NULL) || r; - r = ((glVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fARB")) == NULL) || r; - r = ((glVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fvARB")) == NULL) || r; - r = ((glVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sARB")) == NULL) || r; - r = ((glVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1svARB")) == NULL) || r; - r = ((glVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dARB")) == NULL) || r; - r = ((glVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dvARB")) == NULL) || r; - r = ((glVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fARB")) == NULL) || r; - r = ((glVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fvARB")) == NULL) || r; - r = ((glVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sARB")) == NULL) || r; - r = ((glVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2svARB")) == NULL) || r; - r = ((glVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dARB")) == NULL) || r; - r = ((glVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dvARB")) == NULL) || r; - r = ((glVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fARB")) == NULL) || r; - r = ((glVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fvARB")) == NULL) || r; - r = ((glVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sARB")) == NULL) || r; - r = ((glVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3svARB")) == NULL) || r; - r = ((glVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NbvARB")) == NULL) || r; - r = ((glVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NivARB")) == NULL) || r; - r = ((glVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NsvARB")) == NULL) || r; - r = ((glVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NubARB")) == NULL) || r; - r = ((glVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NubvARB")) == NULL) || r; - r = ((glVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NuivARB")) == NULL) || r; - r = ((glVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NusvARB")) == NULL) || r; - r = ((glVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4bvARB")) == NULL) || r; - r = ((glVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dARB")) == NULL) || r; - r = ((glVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dvARB")) == NULL) || r; - r = ((glVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fARB")) == NULL) || r; - r = ((glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fvARB")) == NULL) || r; - r = ((glVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ivARB")) == NULL) || r; - r = ((glVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sARB")) == NULL) || r; - r = ((glVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4svARB")) == NULL) || r; - r = ((glVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubvARB")) == NULL) || r; - r = ((glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4uivARB")) == NULL) || r; - r = ((glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4usvARB")) == NULL) || r; - r = ((glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointerARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_vertex_program */ - -#ifdef GL_ARB_vertex_shader - -static GLboolean _glewInit_GL_ARB_vertex_shader (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glBindAttribLocationARB")) == NULL) || r; - r = ((glGetActiveAttribARB = (PFNGLGETACTIVEATTRIBARBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAttribARB")) == NULL) || r; - r = ((glGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glGetAttribLocationARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_vertex_shader */ - -#ifdef GL_ARB_vertex_type_2_10_10_10_rev - -static GLboolean _glewInit_GL_ARB_vertex_type_2_10_10_10_rev (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glColorP3ui = (PFNGLCOLORP3UIPROC)glewGetProcAddress((const GLubyte*)"glColorP3ui")) == NULL) || r; - r = ((glColorP3uiv = (PFNGLCOLORP3UIVPROC)glewGetProcAddress((const GLubyte*)"glColorP3uiv")) == NULL) || r; - r = ((glColorP4ui = (PFNGLCOLORP4UIPROC)glewGetProcAddress((const GLubyte*)"glColorP4ui")) == NULL) || r; - r = ((glColorP4uiv = (PFNGLCOLORP4UIVPROC)glewGetProcAddress((const GLubyte*)"glColorP4uiv")) == NULL) || r; - r = ((glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP1ui")) == NULL) || r; - r = ((glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP1uiv")) == NULL) || r; - r = ((glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP2ui")) == NULL) || r; - r = ((glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP2uiv")) == NULL) || r; - r = ((glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP3ui")) == NULL) || r; - r = ((glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP3uiv")) == NULL) || r; - r = ((glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP4ui")) == NULL) || r; - r = ((glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP4uiv")) == NULL) || r; - r = ((glNormalP3ui = (PFNGLNORMALP3UIPROC)glewGetProcAddress((const GLubyte*)"glNormalP3ui")) == NULL) || r; - r = ((glNormalP3uiv = (PFNGLNORMALP3UIVPROC)glewGetProcAddress((const GLubyte*)"glNormalP3uiv")) == NULL) || r; - r = ((glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorP3ui")) == NULL) || r; - r = ((glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorP3uiv")) == NULL) || r; - r = ((glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP1ui")) == NULL) || r; - r = ((glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP1uiv")) == NULL) || r; - r = ((glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP2ui")) == NULL) || r; - r = ((glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP2uiv")) == NULL) || r; - r = ((glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP3ui")) == NULL) || r; - r = ((glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP3uiv")) == NULL) || r; - r = ((glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP4ui")) == NULL) || r; - r = ((glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP4uiv")) == NULL) || r; - r = ((glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP1ui")) == NULL) || r; - r = ((glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP1uiv")) == NULL) || r; - r = ((glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP2ui")) == NULL) || r; - r = ((glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP2uiv")) == NULL) || r; - r = ((glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP3ui")) == NULL) || r; - r = ((glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP3uiv")) == NULL) || r; - r = ((glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP4ui")) == NULL) || r; - r = ((glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP4uiv")) == NULL) || r; - r = ((glVertexP2ui = (PFNGLVERTEXP2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP2ui")) == NULL) || r; - r = ((glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP2uiv")) == NULL) || r; - r = ((glVertexP3ui = (PFNGLVERTEXP3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP3ui")) == NULL) || r; - r = ((glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP3uiv")) == NULL) || r; - r = ((glVertexP4ui = (PFNGLVERTEXP4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP4ui")) == NULL) || r; - r = ((glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP4uiv")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ - -#ifdef GL_ARB_viewport_array - -static GLboolean _glewInit_GL_ARB_viewport_array (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDepthRangeArrayv = (PFNGLDEPTHRANGEARRAYVPROC)glewGetProcAddress((const GLubyte*)"glDepthRangeArrayv")) == NULL) || r; - r = ((glDepthRangeIndexed = (PFNGLDEPTHRANGEINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glDepthRangeIndexed")) == NULL) || r; - r = ((glGetDoublei_v = (PFNGLGETDOUBLEI_VPROC)glewGetProcAddress((const GLubyte*)"glGetDoublei_v")) == NULL) || r; - r = ((glGetFloati_v = (PFNGLGETFLOATI_VPROC)glewGetProcAddress((const GLubyte*)"glGetFloati_v")) == NULL) || r; - r = ((glScissorArrayv = (PFNGLSCISSORARRAYVPROC)glewGetProcAddress((const GLubyte*)"glScissorArrayv")) == NULL) || r; - r = ((glScissorIndexed = (PFNGLSCISSORINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glScissorIndexed")) == NULL) || r; - r = ((glScissorIndexedv = (PFNGLSCISSORINDEXEDVPROC)glewGetProcAddress((const GLubyte*)"glScissorIndexedv")) == NULL) || r; - r = ((glViewportArrayv = (PFNGLVIEWPORTARRAYVPROC)glewGetProcAddress((const GLubyte*)"glViewportArrayv")) == NULL) || r; - r = ((glViewportIndexedf = (PFNGLVIEWPORTINDEXEDFPROC)glewGetProcAddress((const GLubyte*)"glViewportIndexedf")) == NULL) || r; - r = ((glViewportIndexedfv = (PFNGLVIEWPORTINDEXEDFVPROC)glewGetProcAddress((const GLubyte*)"glViewportIndexedfv")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_viewport_array */ - -#ifdef GL_ARB_window_pos - -static GLboolean _glewInit_GL_ARB_window_pos (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glWindowPos2dARB = (PFNGLWINDOWPOS2DARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dARB")) == NULL) || r; - r = ((glWindowPos2dvARB = (PFNGLWINDOWPOS2DVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dvARB")) == NULL) || r; - r = ((glWindowPos2fARB = (PFNGLWINDOWPOS2FARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fARB")) == NULL) || r; - r = ((glWindowPos2fvARB = (PFNGLWINDOWPOS2FVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fvARB")) == NULL) || r; - r = ((glWindowPos2iARB = (PFNGLWINDOWPOS2IARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iARB")) == NULL) || r; - r = ((glWindowPos2ivARB = (PFNGLWINDOWPOS2IVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2ivARB")) == NULL) || r; - r = ((glWindowPos2sARB = (PFNGLWINDOWPOS2SARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sARB")) == NULL) || r; - r = ((glWindowPos2svARB = (PFNGLWINDOWPOS2SVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2svARB")) == NULL) || r; - r = ((glWindowPos3dARB = (PFNGLWINDOWPOS3DARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dARB")) == NULL) || r; - r = ((glWindowPos3dvARB = (PFNGLWINDOWPOS3DVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dvARB")) == NULL) || r; - r = ((glWindowPos3fARB = (PFNGLWINDOWPOS3FARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fARB")) == NULL) || r; - r = ((glWindowPos3fvARB = (PFNGLWINDOWPOS3FVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fvARB")) == NULL) || r; - r = ((glWindowPos3iARB = (PFNGLWINDOWPOS3IARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iARB")) == NULL) || r; - r = ((glWindowPos3ivARB = (PFNGLWINDOWPOS3IVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3ivARB")) == NULL) || r; - r = ((glWindowPos3sARB = (PFNGLWINDOWPOS3SARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sARB")) == NULL) || r; - r = ((glWindowPos3svARB = (PFNGLWINDOWPOS3SVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3svARB")) == NULL) || r; - - return r; -} - -#endif /* GL_ARB_window_pos */ - -#ifdef GL_ATI_draw_buffers - -static GLboolean _glewInit_GL_ATI_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawBuffersATI = (PFNGLDRAWBUFFERSATIPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersATI")) == NULL) || r; - - return r; -} - -#endif /* GL_ATI_draw_buffers */ - -#ifdef GL_ATI_element_array - -static GLboolean _glewInit_GL_ATI_element_array (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawElementArrayATI = (PFNGLDRAWELEMENTARRAYATIPROC)glewGetProcAddress((const GLubyte*)"glDrawElementArrayATI")) == NULL) || r; - r = ((glDrawRangeElementArrayATI = (PFNGLDRAWRANGEELEMENTARRAYATIPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementArrayATI")) == NULL) || r; - r = ((glElementPointerATI = (PFNGLELEMENTPOINTERATIPROC)glewGetProcAddress((const GLubyte*)"glElementPointerATI")) == NULL) || r; - - return r; -} - -#endif /* GL_ATI_element_array */ - -#ifdef GL_ATI_envmap_bumpmap - -static GLboolean _glewInit_GL_ATI_envmap_bumpmap (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetTexBumpParameterfvATI = (PFNGLGETTEXBUMPPARAMETERFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetTexBumpParameterfvATI")) == NULL) || r; - r = ((glGetTexBumpParameterivATI = (PFNGLGETTEXBUMPPARAMETERIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetTexBumpParameterivATI")) == NULL) || r; - r = ((glTexBumpParameterfvATI = (PFNGLTEXBUMPPARAMETERFVATIPROC)glewGetProcAddress((const GLubyte*)"glTexBumpParameterfvATI")) == NULL) || r; - r = ((glTexBumpParameterivATI = (PFNGLTEXBUMPPARAMETERIVATIPROC)glewGetProcAddress((const GLubyte*)"glTexBumpParameterivATI")) == NULL) || r; - - return r; -} - -#endif /* GL_ATI_envmap_bumpmap */ - -#ifdef GL_ATI_fragment_shader - -static GLboolean _glewInit_GL_ATI_fragment_shader (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glAlphaFragmentOp1ATI = (PFNGLALPHAFRAGMENTOP1ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp1ATI")) == NULL) || r; - r = ((glAlphaFragmentOp2ATI = (PFNGLALPHAFRAGMENTOP2ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp2ATI")) == NULL) || r; - r = ((glAlphaFragmentOp3ATI = (PFNGLALPHAFRAGMENTOP3ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp3ATI")) == NULL) || r; - r = ((glBeginFragmentShaderATI = (PFNGLBEGINFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glBeginFragmentShaderATI")) == NULL) || r; - r = ((glBindFragmentShaderATI = (PFNGLBINDFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glBindFragmentShaderATI")) == NULL) || r; - r = ((glColorFragmentOp1ATI = (PFNGLCOLORFRAGMENTOP1ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp1ATI")) == NULL) || r; - r = ((glColorFragmentOp2ATI = (PFNGLCOLORFRAGMENTOP2ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp2ATI")) == NULL) || r; - r = ((glColorFragmentOp3ATI = (PFNGLCOLORFRAGMENTOP3ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp3ATI")) == NULL) || r; - r = ((glDeleteFragmentShaderATI = (PFNGLDELETEFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glDeleteFragmentShaderATI")) == NULL) || r; - r = ((glEndFragmentShaderATI = (PFNGLENDFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glEndFragmentShaderATI")) == NULL) || r; - r = ((glGenFragmentShadersATI = (PFNGLGENFRAGMENTSHADERSATIPROC)glewGetProcAddress((const GLubyte*)"glGenFragmentShadersATI")) == NULL) || r; - r = ((glPassTexCoordATI = (PFNGLPASSTEXCOORDATIPROC)glewGetProcAddress((const GLubyte*)"glPassTexCoordATI")) == NULL) || r; - r = ((glSampleMapATI = (PFNGLSAMPLEMAPATIPROC)glewGetProcAddress((const GLubyte*)"glSampleMapATI")) == NULL) || r; - r = ((glSetFragmentShaderConstantATI = (PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)glewGetProcAddress((const GLubyte*)"glSetFragmentShaderConstantATI")) == NULL) || r; - - return r; -} - -#endif /* GL_ATI_fragment_shader */ - -#ifdef GL_ATI_map_object_buffer - -static GLboolean _glewInit_GL_ATI_map_object_buffer (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glMapObjectBufferATI = (PFNGLMAPOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glMapObjectBufferATI")) == NULL) || r; - r = ((glUnmapObjectBufferATI = (PFNGLUNMAPOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glUnmapObjectBufferATI")) == NULL) || r; - - return r; -} - -#endif /* GL_ATI_map_object_buffer */ - -#ifdef GL_ATI_pn_triangles - -static GLboolean _glewInit_GL_ATI_pn_triangles (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glPNTrianglesfATI = (PFNGLPNTRIANGLESFATIPROC)glewGetProcAddress((const GLubyte*)"glPNTrianglesfATI")) == NULL) || r; - r = ((glPNTrianglesiATI = (PFNGLPNTRIANGLESIATIPROC)glewGetProcAddress((const GLubyte*)"glPNTrianglesiATI")) == NULL) || r; - - return r; -} - -#endif /* GL_ATI_pn_triangles */ - -#ifdef GL_ATI_separate_stencil - -static GLboolean _glewInit_GL_ATI_separate_stencil (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glStencilFuncSeparateATI = (PFNGLSTENCILFUNCSEPARATEATIPROC)glewGetProcAddress((const GLubyte*)"glStencilFuncSeparateATI")) == NULL) || r; - r = ((glStencilOpSeparateATI = (PFNGLSTENCILOPSEPARATEATIPROC)glewGetProcAddress((const GLubyte*)"glStencilOpSeparateATI")) == NULL) || r; - - return r; -} - -#endif /* GL_ATI_separate_stencil */ - -#ifdef GL_ATI_vertex_array_object - -static GLboolean _glewInit_GL_ATI_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glArrayObjectATI = (PFNGLARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glArrayObjectATI")) == NULL) || r; - r = ((glFreeObjectBufferATI = (PFNGLFREEOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glFreeObjectBufferATI")) == NULL) || r; - r = ((glGetArrayObjectfvATI = (PFNGLGETARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetArrayObjectfvATI")) == NULL) || r; - r = ((glGetArrayObjectivATI = (PFNGLGETARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetArrayObjectivATI")) == NULL) || r; - r = ((glGetObjectBufferfvATI = (PFNGLGETOBJECTBUFFERFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetObjectBufferfvATI")) == NULL) || r; - r = ((glGetObjectBufferivATI = (PFNGLGETOBJECTBUFFERIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetObjectBufferivATI")) == NULL) || r; - r = ((glGetVariantArrayObjectfvATI = (PFNGLGETVARIANTARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVariantArrayObjectfvATI")) == NULL) || r; - r = ((glGetVariantArrayObjectivATI = (PFNGLGETVARIANTARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVariantArrayObjectivATI")) == NULL) || r; - r = ((glIsObjectBufferATI = (PFNGLISOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glIsObjectBufferATI")) == NULL) || r; - r = ((glNewObjectBufferATI = (PFNGLNEWOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glNewObjectBufferATI")) == NULL) || r; - r = ((glUpdateObjectBufferATI = (PFNGLUPDATEOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glUpdateObjectBufferATI")) == NULL) || r; - r = ((glVariantArrayObjectATI = (PFNGLVARIANTARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glVariantArrayObjectATI")) == NULL) || r; - - return r; -} - -#endif /* GL_ATI_vertex_array_object */ - -#ifdef GL_ATI_vertex_attrib_array_object - -static GLboolean _glewInit_GL_ATI_vertex_attrib_array_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetVertexAttribArrayObjectfvATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribArrayObjectfvATI")) == NULL) || r; - r = ((glGetVertexAttribArrayObjectivATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribArrayObjectivATI")) == NULL) || r; - r = ((glVertexAttribArrayObjectATI = (PFNGLVERTEXATTRIBARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribArrayObjectATI")) == NULL) || r; - - return r; -} - -#endif /* GL_ATI_vertex_attrib_array_object */ - -#ifdef GL_ATI_vertex_streams - -static GLboolean _glewInit_GL_ATI_vertex_streams (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glClientActiveVertexStreamATI = (PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC)glewGetProcAddress((const GLubyte*)"glClientActiveVertexStreamATI")) == NULL) || r; - r = ((glNormalStream3bATI = (PFNGLNORMALSTREAM3BATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3bATI")) == NULL) || r; - r = ((glNormalStream3bvATI = (PFNGLNORMALSTREAM3BVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3bvATI")) == NULL) || r; - r = ((glNormalStream3dATI = (PFNGLNORMALSTREAM3DATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3dATI")) == NULL) || r; - r = ((glNormalStream3dvATI = (PFNGLNORMALSTREAM3DVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3dvATI")) == NULL) || r; - r = ((glNormalStream3fATI = (PFNGLNORMALSTREAM3FATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3fATI")) == NULL) || r; - r = ((glNormalStream3fvATI = (PFNGLNORMALSTREAM3FVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3fvATI")) == NULL) || r; - r = ((glNormalStream3iATI = (PFNGLNORMALSTREAM3IATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3iATI")) == NULL) || r; - r = ((glNormalStream3ivATI = (PFNGLNORMALSTREAM3IVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3ivATI")) == NULL) || r; - r = ((glNormalStream3sATI = (PFNGLNORMALSTREAM3SATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3sATI")) == NULL) || r; - r = ((glNormalStream3svATI = (PFNGLNORMALSTREAM3SVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3svATI")) == NULL) || r; - r = ((glVertexBlendEnvfATI = (PFNGLVERTEXBLENDENVFATIPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendEnvfATI")) == NULL) || r; - r = ((glVertexBlendEnviATI = (PFNGLVERTEXBLENDENVIATIPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendEnviATI")) == NULL) || r; - r = ((glVertexStream1dATI = (PFNGLVERTEXSTREAM1DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1dATI")) == NULL) || r; - r = ((glVertexStream1dvATI = (PFNGLVERTEXSTREAM1DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1dvATI")) == NULL) || r; - r = ((glVertexStream1fATI = (PFNGLVERTEXSTREAM1FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1fATI")) == NULL) || r; - r = ((glVertexStream1fvATI = (PFNGLVERTEXSTREAM1FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1fvATI")) == NULL) || r; - r = ((glVertexStream1iATI = (PFNGLVERTEXSTREAM1IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1iATI")) == NULL) || r; - r = ((glVertexStream1ivATI = (PFNGLVERTEXSTREAM1IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1ivATI")) == NULL) || r; - r = ((glVertexStream1sATI = (PFNGLVERTEXSTREAM1SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1sATI")) == NULL) || r; - r = ((glVertexStream1svATI = (PFNGLVERTEXSTREAM1SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1svATI")) == NULL) || r; - r = ((glVertexStream2dATI = (PFNGLVERTEXSTREAM2DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2dATI")) == NULL) || r; - r = ((glVertexStream2dvATI = (PFNGLVERTEXSTREAM2DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2dvATI")) == NULL) || r; - r = ((glVertexStream2fATI = (PFNGLVERTEXSTREAM2FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2fATI")) == NULL) || r; - r = ((glVertexStream2fvATI = (PFNGLVERTEXSTREAM2FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2fvATI")) == NULL) || r; - r = ((glVertexStream2iATI = (PFNGLVERTEXSTREAM2IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2iATI")) == NULL) || r; - r = ((glVertexStream2ivATI = (PFNGLVERTEXSTREAM2IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2ivATI")) == NULL) || r; - r = ((glVertexStream2sATI = (PFNGLVERTEXSTREAM2SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2sATI")) == NULL) || r; - r = ((glVertexStream2svATI = (PFNGLVERTEXSTREAM2SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2svATI")) == NULL) || r; - r = ((glVertexStream3dATI = (PFNGLVERTEXSTREAM3DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3dATI")) == NULL) || r; - r = ((glVertexStream3dvATI = (PFNGLVERTEXSTREAM3DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3dvATI")) == NULL) || r; - r = ((glVertexStream3fATI = (PFNGLVERTEXSTREAM3FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3fATI")) == NULL) || r; - r = ((glVertexStream3fvATI = (PFNGLVERTEXSTREAM3FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3fvATI")) == NULL) || r; - r = ((glVertexStream3iATI = (PFNGLVERTEXSTREAM3IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3iATI")) == NULL) || r; - r = ((glVertexStream3ivATI = (PFNGLVERTEXSTREAM3IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3ivATI")) == NULL) || r; - r = ((glVertexStream3sATI = (PFNGLVERTEXSTREAM3SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3sATI")) == NULL) || r; - r = ((glVertexStream3svATI = (PFNGLVERTEXSTREAM3SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3svATI")) == NULL) || r; - r = ((glVertexStream4dATI = (PFNGLVERTEXSTREAM4DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4dATI")) == NULL) || r; - r = ((glVertexStream4dvATI = (PFNGLVERTEXSTREAM4DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4dvATI")) == NULL) || r; - r = ((glVertexStream4fATI = (PFNGLVERTEXSTREAM4FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4fATI")) == NULL) || r; - r = ((glVertexStream4fvATI = (PFNGLVERTEXSTREAM4FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4fvATI")) == NULL) || r; - r = ((glVertexStream4iATI = (PFNGLVERTEXSTREAM4IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4iATI")) == NULL) || r; - r = ((glVertexStream4ivATI = (PFNGLVERTEXSTREAM4IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4ivATI")) == NULL) || r; - r = ((glVertexStream4sATI = (PFNGLVERTEXSTREAM4SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4sATI")) == NULL) || r; - r = ((glVertexStream4svATI = (PFNGLVERTEXSTREAM4SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4svATI")) == NULL) || r; - - return r; -} - -#endif /* GL_ATI_vertex_streams */ - -#ifdef GL_EXT_bindable_uniform - -static GLboolean _glewInit_GL_EXT_bindable_uniform (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetUniformBufferSizeEXT = (PFNGLGETUNIFORMBUFFERSIZEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformBufferSizeEXT")) == NULL) || r; - r = ((glGetUniformOffsetEXT = (PFNGLGETUNIFORMOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformOffsetEXT")) == NULL) || r; - r = ((glUniformBufferEXT = (PFNGLUNIFORMBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glUniformBufferEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_bindable_uniform */ - -#ifdef GL_EXT_blend_color - -static GLboolean _glewInit_GL_EXT_blend_color (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBlendColorEXT = (PFNGLBLENDCOLOREXTPROC)glewGetProcAddress((const GLubyte*)"glBlendColorEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_blend_color */ - -#ifdef GL_EXT_blend_equation_separate - -static GLboolean _glewInit_GL_EXT_blend_equation_separate (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBlendEquationSeparateEXT = (PFNGLBLENDEQUATIONSEPARATEEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_blend_equation_separate */ - -#ifdef GL_EXT_blend_func_separate - -static GLboolean _glewInit_GL_EXT_blend_func_separate (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBlendFuncSeparateEXT = (PFNGLBLENDFUNCSEPARATEEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_blend_func_separate */ - -#ifdef GL_EXT_blend_minmax - -static GLboolean _glewInit_GL_EXT_blend_minmax (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBlendEquationEXT = (PFNGLBLENDEQUATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_blend_minmax */ - -#ifdef GL_EXT_color_subtable - -static GLboolean _glewInit_GL_EXT_color_subtable (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glColorSubTableEXT = (PFNGLCOLORSUBTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glColorSubTableEXT")) == NULL) || r; - r = ((glCopyColorSubTableEXT = (PFNGLCOPYCOLORSUBTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyColorSubTableEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_color_subtable */ - -#ifdef GL_EXT_compiled_vertex_array - -static GLboolean _glewInit_GL_EXT_compiled_vertex_array (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glLockArraysEXT = (PFNGLLOCKARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glLockArraysEXT")) == NULL) || r; - r = ((glUnlockArraysEXT = (PFNGLUNLOCKARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glUnlockArraysEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_compiled_vertex_array */ - -#ifdef GL_EXT_convolution - -static GLboolean _glewInit_GL_EXT_convolution (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glConvolutionFilter1DEXT = (PFNGLCONVOLUTIONFILTER1DEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter1DEXT")) == NULL) || r; - r = ((glConvolutionFilter2DEXT = (PFNGLCONVOLUTIONFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter2DEXT")) == NULL) || r; - r = ((glConvolutionParameterfEXT = (PFNGLCONVOLUTIONPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfEXT")) == NULL) || r; - r = ((glConvolutionParameterfvEXT = (PFNGLCONVOLUTIONPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfvEXT")) == NULL) || r; - r = ((glConvolutionParameteriEXT = (PFNGLCONVOLUTIONPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteriEXT")) == NULL) || r; - r = ((glConvolutionParameterivEXT = (PFNGLCONVOLUTIONPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterivEXT")) == NULL) || r; - r = ((glCopyConvolutionFilter1DEXT = (PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter1DEXT")) == NULL) || r; - r = ((glCopyConvolutionFilter2DEXT = (PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter2DEXT")) == NULL) || r; - r = ((glGetConvolutionFilterEXT = (PFNGLGETCONVOLUTIONFILTEREXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionFilterEXT")) == NULL) || r; - r = ((glGetConvolutionParameterfvEXT = (PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterfvEXT")) == NULL) || r; - r = ((glGetConvolutionParameterivEXT = (PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterivEXT")) == NULL) || r; - r = ((glGetSeparableFilterEXT = (PFNGLGETSEPARABLEFILTEREXTPROC)glewGetProcAddress((const GLubyte*)"glGetSeparableFilterEXT")) == NULL) || r; - r = ((glSeparableFilter2DEXT = (PFNGLSEPARABLEFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glSeparableFilter2DEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_convolution */ - -#ifdef GL_EXT_coordinate_frame - -static GLboolean _glewInit_GL_EXT_coordinate_frame (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBinormalPointerEXT = (PFNGLBINORMALPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glBinormalPointerEXT")) == NULL) || r; - r = ((glTangentPointerEXT = (PFNGLTANGENTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glTangentPointerEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_coordinate_frame */ - -#ifdef GL_EXT_copy_texture - -static GLboolean _glewInit_GL_EXT_copy_texture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCopyTexImage1DEXT = (PFNGLCOPYTEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexImage1DEXT")) == NULL) || r; - r = ((glCopyTexImage2DEXT = (PFNGLCOPYTEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexImage2DEXT")) == NULL) || r; - r = ((glCopyTexSubImage1DEXT = (PFNGLCOPYTEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage1DEXT")) == NULL) || r; - r = ((glCopyTexSubImage2DEXT = (PFNGLCOPYTEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage2DEXT")) == NULL) || r; - r = ((glCopyTexSubImage3DEXT = (PFNGLCOPYTEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage3DEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_copy_texture */ - -#ifdef GL_EXT_cull_vertex - -static GLboolean _glewInit_GL_EXT_cull_vertex (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCullParameterdvEXT = (PFNGLCULLPARAMETERDVEXTPROC)glewGetProcAddress((const GLubyte*)"glCullParameterdvEXT")) == NULL) || r; - r = ((glCullParameterfvEXT = (PFNGLCULLPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glCullParameterfvEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_cull_vertex */ - -#ifdef GL_EXT_debug_label - -static GLboolean _glewInit_GL_EXT_debug_label (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetObjectLabelEXT = (PFNGLGETOBJECTLABELEXTPROC)glewGetProcAddress((const GLubyte*)"glGetObjectLabelEXT")) == NULL) || r; - r = ((glLabelObjectEXT = (PFNGLLABELOBJECTEXTPROC)glewGetProcAddress((const GLubyte*)"glLabelObjectEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_debug_label */ - -#ifdef GL_EXT_debug_marker - -static GLboolean _glewInit_GL_EXT_debug_marker (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glInsertEventMarkerEXT = (PFNGLINSERTEVENTMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glInsertEventMarkerEXT")) == NULL) || r; - r = ((glPopGroupMarkerEXT = (PFNGLPOPGROUPMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glPopGroupMarkerEXT")) == NULL) || r; - r = ((glPushGroupMarkerEXT = (PFNGLPUSHGROUPMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glPushGroupMarkerEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_debug_marker */ - -#ifdef GL_EXT_depth_bounds_test - -static GLboolean _glewInit_GL_EXT_depth_bounds_test (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDepthBoundsEXT = (PFNGLDEPTHBOUNDSEXTPROC)glewGetProcAddress((const GLubyte*)"glDepthBoundsEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_depth_bounds_test */ - -#ifdef GL_EXT_direct_state_access - -static GLboolean _glewInit_GL_EXT_direct_state_access (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindMultiTextureEXT = (PFNGLBINDMULTITEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindMultiTextureEXT")) == NULL) || r; - r = ((glCheckNamedFramebufferStatusEXT = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC)glewGetProcAddress((const GLubyte*)"glCheckNamedFramebufferStatusEXT")) == NULL) || r; - r = ((glClientAttribDefaultEXT = (PFNGLCLIENTATTRIBDEFAULTEXTPROC)glewGetProcAddress((const GLubyte*)"glClientAttribDefaultEXT")) == NULL) || r; - r = ((glCompressedMultiTexImage1DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage1DEXT")) == NULL) || r; - r = ((glCompressedMultiTexImage2DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage2DEXT")) == NULL) || r; - r = ((glCompressedMultiTexImage3DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage3DEXT")) == NULL) || r; - r = ((glCompressedMultiTexSubImage1DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage1DEXT")) == NULL) || r; - r = ((glCompressedMultiTexSubImage2DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage2DEXT")) == NULL) || r; - r = ((glCompressedMultiTexSubImage3DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage3DEXT")) == NULL) || r; - r = ((glCompressedTextureImage1DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage1DEXT")) == NULL) || r; - r = ((glCompressedTextureImage2DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage2DEXT")) == NULL) || r; - r = ((glCompressedTextureImage3DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage3DEXT")) == NULL) || r; - r = ((glCompressedTextureSubImage1DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage1DEXT")) == NULL) || r; - r = ((glCompressedTextureSubImage2DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage2DEXT")) == NULL) || r; - r = ((glCompressedTextureSubImage3DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage3DEXT")) == NULL) || r; - r = ((glCopyMultiTexImage1DEXT = (PFNGLCOPYMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexImage1DEXT")) == NULL) || r; - r = ((glCopyMultiTexImage2DEXT = (PFNGLCOPYMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexImage2DEXT")) == NULL) || r; - r = ((glCopyMultiTexSubImage1DEXT = (PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage1DEXT")) == NULL) || r; - r = ((glCopyMultiTexSubImage2DEXT = (PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage2DEXT")) == NULL) || r; - r = ((glCopyMultiTexSubImage3DEXT = (PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage3DEXT")) == NULL) || r; - r = ((glCopyTextureImage1DEXT = (PFNGLCOPYTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureImage1DEXT")) == NULL) || r; - r = ((glCopyTextureImage2DEXT = (PFNGLCOPYTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureImage2DEXT")) == NULL) || r; - r = ((glCopyTextureSubImage1DEXT = (PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage1DEXT")) == NULL) || r; - r = ((glCopyTextureSubImage2DEXT = (PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage2DEXT")) == NULL) || r; - r = ((glCopyTextureSubImage3DEXT = (PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage3DEXT")) == NULL) || r; - r = ((glDisableClientStateIndexedEXT = (PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableClientStateIndexedEXT")) == NULL) || r; - r = ((glDisableClientStateiEXT = (PFNGLDISABLECLIENTSTATEIEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableClientStateiEXT")) == NULL) || r; - r = ((glDisableVertexArrayAttribEXT = (PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexArrayAttribEXT")) == NULL) || r; - r = ((glDisableVertexArrayEXT = (PFNGLDISABLEVERTEXARRAYEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexArrayEXT")) == NULL) || r; - r = ((glEnableClientStateIndexedEXT = (PFNGLENABLECLIENTSTATEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableClientStateIndexedEXT")) == NULL) || r; - r = ((glEnableClientStateiEXT = (PFNGLENABLECLIENTSTATEIEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableClientStateiEXT")) == NULL) || r; - r = ((glEnableVertexArrayAttribEXT = (PFNGLENABLEVERTEXARRAYATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexArrayAttribEXT")) == NULL) || r; - r = ((glEnableVertexArrayEXT = (PFNGLENABLEVERTEXARRAYEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexArrayEXT")) == NULL) || r; - r = ((glFlushMappedNamedBufferRangeEXT = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedNamedBufferRangeEXT")) == NULL) || r; - r = ((glFramebufferDrawBufferEXT = (PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferDrawBufferEXT")) == NULL) || r; - r = ((glFramebufferDrawBuffersEXT = (PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferDrawBuffersEXT")) == NULL) || r; - r = ((glFramebufferReadBufferEXT = (PFNGLFRAMEBUFFERREADBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferReadBufferEXT")) == NULL) || r; - r = ((glGenerateMultiTexMipmapEXT = (PFNGLGENERATEMULTITEXMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateMultiTexMipmapEXT")) == NULL) || r; - r = ((glGenerateTextureMipmapEXT = (PFNGLGENERATETEXTUREMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateTextureMipmapEXT")) == NULL) || r; - r = ((glGetCompressedMultiTexImageEXT = (PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedMultiTexImageEXT")) == NULL) || r; - r = ((glGetCompressedTextureImageEXT = (PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTextureImageEXT")) == NULL) || r; - r = ((glGetDoubleIndexedvEXT = (PFNGLGETDOUBLEINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetDoubleIndexedvEXT")) == NULL) || r; - r = ((glGetDoublei_vEXT = (PFNGLGETDOUBLEI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetDoublei_vEXT")) == NULL) || r; - r = ((glGetFloatIndexedvEXT = (PFNGLGETFLOATINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFloatIndexedvEXT")) == NULL) || r; - r = ((glGetFloati_vEXT = (PFNGLGETFLOATI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFloati_vEXT")) == NULL) || r; - r = ((glGetFramebufferParameterivEXT = (PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferParameterivEXT")) == NULL) || r; - r = ((glGetMultiTexEnvfvEXT = (PFNGLGETMULTITEXENVFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexEnvfvEXT")) == NULL) || r; - r = ((glGetMultiTexEnvivEXT = (PFNGLGETMULTITEXENVIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexEnvivEXT")) == NULL) || r; - r = ((glGetMultiTexGendvEXT = (PFNGLGETMULTITEXGENDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGendvEXT")) == NULL) || r; - r = ((glGetMultiTexGenfvEXT = (PFNGLGETMULTITEXGENFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGenfvEXT")) == NULL) || r; - r = ((glGetMultiTexGenivEXT = (PFNGLGETMULTITEXGENIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGenivEXT")) == NULL) || r; - r = ((glGetMultiTexImageEXT = (PFNGLGETMULTITEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexImageEXT")) == NULL) || r; - r = ((glGetMultiTexLevelParameterfvEXT = (PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexLevelParameterfvEXT")) == NULL) || r; - r = ((glGetMultiTexLevelParameterivEXT = (PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexLevelParameterivEXT")) == NULL) || r; - r = ((glGetMultiTexParameterIivEXT = (PFNGLGETMULTITEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterIivEXT")) == NULL) || r; - r = ((glGetMultiTexParameterIuivEXT = (PFNGLGETMULTITEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterIuivEXT")) == NULL) || r; - r = ((glGetMultiTexParameterfvEXT = (PFNGLGETMULTITEXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterfvEXT")) == NULL) || r; - r = ((glGetMultiTexParameterivEXT = (PFNGLGETMULTITEXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterivEXT")) == NULL) || r; - r = ((glGetNamedBufferParameterivEXT = (PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameterivEXT")) == NULL) || r; - r = ((glGetNamedBufferPointervEXT = (PFNGLGETNAMEDBUFFERPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferPointervEXT")) == NULL) || r; - r = ((glGetNamedBufferSubDataEXT = (PFNGLGETNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferSubDataEXT")) == NULL) || r; - r = ((glGetNamedFramebufferAttachmentParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferAttachmentParameterivEXT")) == NULL) || r; - r = ((glGetNamedProgramLocalParameterIivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterIivEXT")) == NULL) || r; - r = ((glGetNamedProgramLocalParameterIuivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterIuivEXT")) == NULL) || r; - r = ((glGetNamedProgramLocalParameterdvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterdvEXT")) == NULL) || r; - r = ((glGetNamedProgramLocalParameterfvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterfvEXT")) == NULL) || r; - r = ((glGetNamedProgramStringEXT = (PFNGLGETNAMEDPROGRAMSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramStringEXT")) == NULL) || r; - r = ((glGetNamedProgramivEXT = (PFNGLGETNAMEDPROGRAMIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramivEXT")) == NULL) || r; - r = ((glGetNamedRenderbufferParameterivEXT = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedRenderbufferParameterivEXT")) == NULL) || r; - r = ((glGetPointerIndexedvEXT = (PFNGLGETPOINTERINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPointerIndexedvEXT")) == NULL) || r; - r = ((glGetPointeri_vEXT = (PFNGLGETPOINTERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPointeri_vEXT")) == NULL) || r; - r = ((glGetTextureImageEXT = (PFNGLGETTEXTUREIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureImageEXT")) == NULL) || r; - r = ((glGetTextureLevelParameterfvEXT = (PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterfvEXT")) == NULL) || r; - r = ((glGetTextureLevelParameterivEXT = (PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterivEXT")) == NULL) || r; - r = ((glGetTextureParameterIivEXT = (PFNGLGETTEXTUREPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIivEXT")) == NULL) || r; - r = ((glGetTextureParameterIuivEXT = (PFNGLGETTEXTUREPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIuivEXT")) == NULL) || r; - r = ((glGetTextureParameterfvEXT = (PFNGLGETTEXTUREPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterfvEXT")) == NULL) || r; - r = ((glGetTextureParameterivEXT = (PFNGLGETTEXTUREPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterivEXT")) == NULL) || r; - r = ((glGetVertexArrayIntegeri_vEXT = (PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIntegeri_vEXT")) == NULL) || r; - r = ((glGetVertexArrayIntegervEXT = (PFNGLGETVERTEXARRAYINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIntegervEXT")) == NULL) || r; - r = ((glGetVertexArrayPointeri_vEXT = (PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayPointeri_vEXT")) == NULL) || r; - r = ((glGetVertexArrayPointervEXT = (PFNGLGETVERTEXARRAYPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayPointervEXT")) == NULL) || r; - r = ((glMapNamedBufferEXT = (PFNGLMAPNAMEDBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBufferEXT")) == NULL) || r; - r = ((glMapNamedBufferRangeEXT = (PFNGLMAPNAMEDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBufferRangeEXT")) == NULL) || r; - r = ((glMatrixFrustumEXT = (PFNGLMATRIXFRUSTUMEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixFrustumEXT")) == NULL) || r; - r = ((glMatrixLoadIdentityEXT = (PFNGLMATRIXLOADIDENTITYEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadIdentityEXT")) == NULL) || r; - r = ((glMatrixLoadTransposedEXT = (PFNGLMATRIXLOADTRANSPOSEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTransposedEXT")) == NULL) || r; - r = ((glMatrixLoadTransposefEXT = (PFNGLMATRIXLOADTRANSPOSEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTransposefEXT")) == NULL) || r; - r = ((glMatrixLoaddEXT = (PFNGLMATRIXLOADDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoaddEXT")) == NULL) || r; - r = ((glMatrixLoadfEXT = (PFNGLMATRIXLOADFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadfEXT")) == NULL) || r; - r = ((glMatrixMultTransposedEXT = (PFNGLMATRIXMULTTRANSPOSEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTransposedEXT")) == NULL) || r; - r = ((glMatrixMultTransposefEXT = (PFNGLMATRIXMULTTRANSPOSEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTransposefEXT")) == NULL) || r; - r = ((glMatrixMultdEXT = (PFNGLMATRIXMULTDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultdEXT")) == NULL) || r; - r = ((glMatrixMultfEXT = (PFNGLMATRIXMULTFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultfEXT")) == NULL) || r; - r = ((glMatrixOrthoEXT = (PFNGLMATRIXORTHOEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixOrthoEXT")) == NULL) || r; - r = ((glMatrixPopEXT = (PFNGLMATRIXPOPEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixPopEXT")) == NULL) || r; - r = ((glMatrixPushEXT = (PFNGLMATRIXPUSHEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixPushEXT")) == NULL) || r; - r = ((glMatrixRotatedEXT = (PFNGLMATRIXROTATEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixRotatedEXT")) == NULL) || r; - r = ((glMatrixRotatefEXT = (PFNGLMATRIXROTATEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixRotatefEXT")) == NULL) || r; - r = ((glMatrixScaledEXT = (PFNGLMATRIXSCALEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixScaledEXT")) == NULL) || r; - r = ((glMatrixScalefEXT = (PFNGLMATRIXSCALEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixScalefEXT")) == NULL) || r; - r = ((glMatrixTranslatedEXT = (PFNGLMATRIXTRANSLATEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixTranslatedEXT")) == NULL) || r; - r = ((glMatrixTranslatefEXT = (PFNGLMATRIXTRANSLATEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixTranslatefEXT")) == NULL) || r; - r = ((glMultiTexBufferEXT = (PFNGLMULTITEXBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexBufferEXT")) == NULL) || r; - r = ((glMultiTexCoordPointerEXT = (PFNGLMULTITEXCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordPointerEXT")) == NULL) || r; - r = ((glMultiTexEnvfEXT = (PFNGLMULTITEXENVFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvfEXT")) == NULL) || r; - r = ((glMultiTexEnvfvEXT = (PFNGLMULTITEXENVFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvfvEXT")) == NULL) || r; - r = ((glMultiTexEnviEXT = (PFNGLMULTITEXENVIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnviEXT")) == NULL) || r; - r = ((glMultiTexEnvivEXT = (PFNGLMULTITEXENVIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvivEXT")) == NULL) || r; - r = ((glMultiTexGendEXT = (PFNGLMULTITEXGENDEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGendEXT")) == NULL) || r; - r = ((glMultiTexGendvEXT = (PFNGLMULTITEXGENDVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGendvEXT")) == NULL) || r; - r = ((glMultiTexGenfEXT = (PFNGLMULTITEXGENFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenfEXT")) == NULL) || r; - r = ((glMultiTexGenfvEXT = (PFNGLMULTITEXGENFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenfvEXT")) == NULL) || r; - r = ((glMultiTexGeniEXT = (PFNGLMULTITEXGENIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGeniEXT")) == NULL) || r; - r = ((glMultiTexGenivEXT = (PFNGLMULTITEXGENIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenivEXT")) == NULL) || r; - r = ((glMultiTexImage1DEXT = (PFNGLMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage1DEXT")) == NULL) || r; - r = ((glMultiTexImage2DEXT = (PFNGLMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage2DEXT")) == NULL) || r; - r = ((glMultiTexImage3DEXT = (PFNGLMULTITEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage3DEXT")) == NULL) || r; - r = ((glMultiTexParameterIivEXT = (PFNGLMULTITEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterIivEXT")) == NULL) || r; - r = ((glMultiTexParameterIuivEXT = (PFNGLMULTITEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterIuivEXT")) == NULL) || r; - r = ((glMultiTexParameterfEXT = (PFNGLMULTITEXPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterfEXT")) == NULL) || r; - r = ((glMultiTexParameterfvEXT = (PFNGLMULTITEXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterfvEXT")) == NULL) || r; - r = ((glMultiTexParameteriEXT = (PFNGLMULTITEXPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameteriEXT")) == NULL) || r; - r = ((glMultiTexParameterivEXT = (PFNGLMULTITEXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterivEXT")) == NULL) || r; - r = ((glMultiTexRenderbufferEXT = (PFNGLMULTITEXRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexRenderbufferEXT")) == NULL) || r; - r = ((glMultiTexSubImage1DEXT = (PFNGLMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage1DEXT")) == NULL) || r; - r = ((glMultiTexSubImage2DEXT = (PFNGLMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage2DEXT")) == NULL) || r; - r = ((glMultiTexSubImage3DEXT = (PFNGLMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage3DEXT")) == NULL) || r; - r = ((glNamedBufferDataEXT = (PFNGLNAMEDBUFFERDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferDataEXT")) == NULL) || r; - r = ((glNamedBufferSubDataEXT = (PFNGLNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferSubDataEXT")) == NULL) || r; - r = ((glNamedCopyBufferSubDataEXT = (PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedCopyBufferSubDataEXT")) == NULL) || r; - r = ((glNamedFramebufferRenderbufferEXT = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferRenderbufferEXT")) == NULL) || r; - r = ((glNamedFramebufferTexture1DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture1DEXT")) == NULL) || r; - r = ((glNamedFramebufferTexture2DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture2DEXT")) == NULL) || r; - r = ((glNamedFramebufferTexture3DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture3DEXT")) == NULL) || r; - r = ((glNamedFramebufferTextureEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureEXT")) == NULL) || r; - r = ((glNamedFramebufferTextureFaceEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureFaceEXT")) == NULL) || r; - r = ((glNamedFramebufferTextureLayerEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureLayerEXT")) == NULL) || r; - r = ((glNamedProgramLocalParameter4dEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4dEXT")) == NULL) || r; - r = ((glNamedProgramLocalParameter4dvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4dvEXT")) == NULL) || r; - r = ((glNamedProgramLocalParameter4fEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4fEXT")) == NULL) || r; - r = ((glNamedProgramLocalParameter4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4fvEXT")) == NULL) || r; - r = ((glNamedProgramLocalParameterI4iEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4iEXT")) == NULL) || r; - r = ((glNamedProgramLocalParameterI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4ivEXT")) == NULL) || r; - r = ((glNamedProgramLocalParameterI4uiEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4uiEXT")) == NULL) || r; - r = ((glNamedProgramLocalParameterI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4uivEXT")) == NULL) || r; - r = ((glNamedProgramLocalParameters4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameters4fvEXT")) == NULL) || r; - r = ((glNamedProgramLocalParametersI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParametersI4ivEXT")) == NULL) || r; - r = ((glNamedProgramLocalParametersI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParametersI4uivEXT")) == NULL) || r; - r = ((glNamedProgramStringEXT = (PFNGLNAMEDPROGRAMSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramStringEXT")) == NULL) || r; - r = ((glNamedRenderbufferStorageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageEXT")) == NULL) || r; - r = ((glNamedRenderbufferStorageMultisampleCoverageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisampleCoverageEXT")) == NULL) || r; - r = ((glNamedRenderbufferStorageMultisampleEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisampleEXT")) == NULL) || r; - r = ((glProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fEXT")) == NULL) || r; - r = ((glProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fvEXT")) == NULL) || r; - r = ((glProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1iEXT")) == NULL) || r; - r = ((glProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ivEXT")) == NULL) || r; - r = ((glProgramUniform1uiEXT = (PFNGLPROGRAMUNIFORM1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uiEXT")) == NULL) || r; - r = ((glProgramUniform1uivEXT = (PFNGLPROGRAMUNIFORM1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uivEXT")) == NULL) || r; - r = ((glProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fEXT")) == NULL) || r; - r = ((glProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fvEXT")) == NULL) || r; - r = ((glProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2iEXT")) == NULL) || r; - r = ((glProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ivEXT")) == NULL) || r; - r = ((glProgramUniform2uiEXT = (PFNGLPROGRAMUNIFORM2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uiEXT")) == NULL) || r; - r = ((glProgramUniform2uivEXT = (PFNGLPROGRAMUNIFORM2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uivEXT")) == NULL) || r; - r = ((glProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fEXT")) == NULL) || r; - r = ((glProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fvEXT")) == NULL) || r; - r = ((glProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3iEXT")) == NULL) || r; - r = ((glProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ivEXT")) == NULL) || r; - r = ((glProgramUniform3uiEXT = (PFNGLPROGRAMUNIFORM3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uiEXT")) == NULL) || r; - r = ((glProgramUniform3uivEXT = (PFNGLPROGRAMUNIFORM3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uivEXT")) == NULL) || r; - r = ((glProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fEXT")) == NULL) || r; - r = ((glProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fvEXT")) == NULL) || r; - r = ((glProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4iEXT")) == NULL) || r; - r = ((glProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ivEXT")) == NULL) || r; - r = ((glProgramUniform4uiEXT = (PFNGLPROGRAMUNIFORM4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uiEXT")) == NULL) || r; - r = ((glProgramUniform4uivEXT = (PFNGLPROGRAMUNIFORM4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uivEXT")) == NULL) || r; - r = ((glProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2fvEXT")) == NULL) || r; - r = ((glProgramUniformMatrix2x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3fvEXT")) == NULL) || r; - r = ((glProgramUniformMatrix2x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4fvEXT")) == NULL) || r; - r = ((glProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3fvEXT")) == NULL) || r; - r = ((glProgramUniformMatrix3x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2fvEXT")) == NULL) || r; - r = ((glProgramUniformMatrix3x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4fvEXT")) == NULL) || r; - r = ((glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4fvEXT")) == NULL) || r; - r = ((glProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2fvEXT")) == NULL) || r; - r = ((glProgramUniformMatrix4x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3fvEXT")) == NULL) || r; - r = ((glPushClientAttribDefaultEXT = (PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC)glewGetProcAddress((const GLubyte*)"glPushClientAttribDefaultEXT")) == NULL) || r; - r = ((glTextureBufferEXT = (PFNGLTEXTUREBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTextureBufferEXT")) == NULL) || r; - r = ((glTextureImage1DEXT = (PFNGLTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage1DEXT")) == NULL) || r; - r = ((glTextureImage2DEXT = (PFNGLTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DEXT")) == NULL) || r; - r = ((glTextureImage3DEXT = (PFNGLTEXTUREIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DEXT")) == NULL) || r; - r = ((glTextureParameterIivEXT = (PFNGLTEXTUREPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIivEXT")) == NULL) || r; - r = ((glTextureParameterIuivEXT = (PFNGLTEXTUREPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIuivEXT")) == NULL) || r; - r = ((glTextureParameterfEXT = (PFNGLTEXTUREPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfEXT")) == NULL) || r; - r = ((glTextureParameterfvEXT = (PFNGLTEXTUREPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfvEXT")) == NULL) || r; - r = ((glTextureParameteriEXT = (PFNGLTEXTUREPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameteriEXT")) == NULL) || r; - r = ((glTextureParameterivEXT = (PFNGLTEXTUREPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterivEXT")) == NULL) || r; - r = ((glTextureRenderbufferEXT = (PFNGLTEXTURERENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTextureRenderbufferEXT")) == NULL) || r; - r = ((glTextureSubImage1DEXT = (PFNGLTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage1DEXT")) == NULL) || r; - r = ((glTextureSubImage2DEXT = (PFNGLTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage2DEXT")) == NULL) || r; - r = ((glTextureSubImage3DEXT = (PFNGLTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage3DEXT")) == NULL) || r; - r = ((glUnmapNamedBufferEXT = (PFNGLUNMAPNAMEDBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glUnmapNamedBufferEXT")) == NULL) || r; - r = ((glVertexArrayColorOffsetEXT = (PFNGLVERTEXARRAYCOLOROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayColorOffsetEXT")) == NULL) || r; - r = ((glVertexArrayEdgeFlagOffsetEXT = (PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayEdgeFlagOffsetEXT")) == NULL) || r; - r = ((glVertexArrayFogCoordOffsetEXT = (PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayFogCoordOffsetEXT")) == NULL) || r; - r = ((glVertexArrayIndexOffsetEXT = (PFNGLVERTEXARRAYINDEXOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayIndexOffsetEXT")) == NULL) || r; - r = ((glVertexArrayMultiTexCoordOffsetEXT = (PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayMultiTexCoordOffsetEXT")) == NULL) || r; - r = ((glVertexArrayNormalOffsetEXT = (PFNGLVERTEXARRAYNORMALOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayNormalOffsetEXT")) == NULL) || r; - r = ((glVertexArraySecondaryColorOffsetEXT = (PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArraySecondaryColorOffsetEXT")) == NULL) || r; - r = ((glVertexArrayTexCoordOffsetEXT = (PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayTexCoordOffsetEXT")) == NULL) || r; - r = ((glVertexArrayVertexAttribDivisorEXT = (PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribDivisorEXT")) == NULL) || r; - r = ((glVertexArrayVertexAttribIOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribIOffsetEXT")) == NULL) || r; - r = ((glVertexArrayVertexAttribOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribOffsetEXT")) == NULL) || r; - r = ((glVertexArrayVertexOffsetEXT = (PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexOffsetEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_direct_state_access */ - -#ifdef GL_EXT_draw_buffers2 - -static GLboolean _glewInit_GL_EXT_draw_buffers2 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glColorMaskIndexedEXT = (PFNGLCOLORMASKINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glColorMaskIndexedEXT")) == NULL) || r; - r = ((glDisableIndexedEXT = (PFNGLDISABLEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableIndexedEXT")) == NULL) || r; - r = ((glEnableIndexedEXT = (PFNGLENABLEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableIndexedEXT")) == NULL) || r; - r = ((glGetBooleanIndexedvEXT = (PFNGLGETBOOLEANINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetBooleanIndexedvEXT")) == NULL) || r; - r = ((glGetIntegerIndexedvEXT = (PFNGLGETINTEGERINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerIndexedvEXT")) == NULL) || r; - r = ((glIsEnabledIndexedEXT = (PFNGLISENABLEDINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glIsEnabledIndexedEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_draw_buffers2 */ - -#ifdef GL_EXT_draw_instanced - -static GLboolean _glewInit_GL_EXT_draw_instanced (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawArraysInstancedEXT = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedEXT")) == NULL) || r; - r = ((glDrawElementsInstancedEXT = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_draw_instanced */ - -#ifdef GL_EXT_draw_range_elements - -static GLboolean _glewInit_GL_EXT_draw_range_elements (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawRangeElementsEXT = (PFNGLDRAWRANGEELEMENTSEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementsEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_draw_range_elements */ - -#ifdef GL_EXT_fog_coord - -static GLboolean _glewInit_GL_EXT_fog_coord (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFogCoordPointerEXT = (PFNGLFOGCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointerEXT")) == NULL) || r; - r = ((glFogCoorddEXT = (PFNGLFOGCOORDDEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddEXT")) == NULL) || r; - r = ((glFogCoorddvEXT = (PFNGLFOGCOORDDVEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddvEXT")) == NULL) || r; - r = ((glFogCoordfEXT = (PFNGLFOGCOORDFEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfEXT")) == NULL) || r; - r = ((glFogCoordfvEXT = (PFNGLFOGCOORDFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfvEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_fog_coord */ - -#ifdef GL_EXT_fragment_lighting - -static GLboolean _glewInit_GL_EXT_fragment_lighting (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFragmentColorMaterialEXT = (PFNGLFRAGMENTCOLORMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentColorMaterialEXT")) == NULL) || r; - r = ((glFragmentLightModelfEXT = (PFNGLFRAGMENTLIGHTMODELFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfEXT")) == NULL) || r; - r = ((glFragmentLightModelfvEXT = (PFNGLFRAGMENTLIGHTMODELFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfvEXT")) == NULL) || r; - r = ((glFragmentLightModeliEXT = (PFNGLFRAGMENTLIGHTMODELIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModeliEXT")) == NULL) || r; - r = ((glFragmentLightModelivEXT = (PFNGLFRAGMENTLIGHTMODELIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelivEXT")) == NULL) || r; - r = ((glFragmentLightfEXT = (PFNGLFRAGMENTLIGHTFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfEXT")) == NULL) || r; - r = ((glFragmentLightfvEXT = (PFNGLFRAGMENTLIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfvEXT")) == NULL) || r; - r = ((glFragmentLightiEXT = (PFNGLFRAGMENTLIGHTIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightiEXT")) == NULL) || r; - r = ((glFragmentLightivEXT = (PFNGLFRAGMENTLIGHTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightivEXT")) == NULL) || r; - r = ((glFragmentMaterialfEXT = (PFNGLFRAGMENTMATERIALFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfEXT")) == NULL) || r; - r = ((glFragmentMaterialfvEXT = (PFNGLFRAGMENTMATERIALFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfvEXT")) == NULL) || r; - r = ((glFragmentMaterialiEXT = (PFNGLFRAGMENTMATERIALIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialiEXT")) == NULL) || r; - r = ((glFragmentMaterialivEXT = (PFNGLFRAGMENTMATERIALIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialivEXT")) == NULL) || r; - r = ((glGetFragmentLightfvEXT = (PFNGLGETFRAGMENTLIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightfvEXT")) == NULL) || r; - r = ((glGetFragmentLightivEXT = (PFNGLGETFRAGMENTLIGHTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightivEXT")) == NULL) || r; - r = ((glGetFragmentMaterialfvEXT = (PFNGLGETFRAGMENTMATERIALFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialfvEXT")) == NULL) || r; - r = ((glGetFragmentMaterialivEXT = (PFNGLGETFRAGMENTMATERIALIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialivEXT")) == NULL) || r; - r = ((glLightEnviEXT = (PFNGLLIGHTENVIEXTPROC)glewGetProcAddress((const GLubyte*)"glLightEnviEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_fragment_lighting */ - -#ifdef GL_EXT_framebuffer_blit - -static GLboolean _glewInit_GL_EXT_framebuffer_blit (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBlitFramebufferEXT = (PFNGLBLITFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebufferEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_framebuffer_blit */ - -#ifdef GL_EXT_framebuffer_multisample - -static GLboolean _glewInit_GL_EXT_framebuffer_multisample (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glRenderbufferStorageMultisampleEXT = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_framebuffer_multisample */ - -#ifdef GL_EXT_framebuffer_object - -static GLboolean _glewInit_GL_EXT_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindFramebufferEXT")) == NULL) || r; - r = ((glBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindRenderbufferEXT")) == NULL) || r; - r = ((glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)glewGetProcAddress((const GLubyte*)"glCheckFramebufferStatusEXT")) == NULL) || r; - r = ((glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteFramebuffersEXT")) == NULL) || r; - r = ((glDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteRenderbuffersEXT")) == NULL) || r; - r = ((glFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferRenderbufferEXT")) == NULL) || r; - r = ((glFramebufferTexture1DEXT = (PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture1DEXT")) == NULL) || r; - r = ((glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2DEXT")) == NULL) || r; - r = ((glFramebufferTexture3DEXT = (PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture3DEXT")) == NULL) || r; - r = ((glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenFramebuffersEXT")) == NULL) || r; - r = ((glGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenRenderbuffersEXT")) == NULL) || r; - r = ((glGenerateMipmapEXT = (PFNGLGENERATEMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateMipmapEXT")) == NULL) || r; - r = ((glGetFramebufferAttachmentParameterivEXT = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferAttachmentParameterivEXT")) == NULL) || r; - r = ((glGetRenderbufferParameterivEXT = (PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetRenderbufferParameterivEXT")) == NULL) || r; - r = ((glIsFramebufferEXT = (PFNGLISFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glIsFramebufferEXT")) == NULL) || r; - r = ((glIsRenderbufferEXT = (PFNGLISRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glIsRenderbufferEXT")) == NULL) || r; - r = ((glRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_framebuffer_object */ - -#ifdef GL_EXT_geometry_shader4 - -static GLboolean _glewInit_GL_EXT_geometry_shader4 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFramebufferTextureEXT = (PFNGLFRAMEBUFFERTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureEXT")) == NULL) || r; - r = ((glFramebufferTextureFaceEXT = (PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureFaceEXT")) == NULL) || r; - r = ((glProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteriEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_geometry_shader4 */ - -#ifdef GL_EXT_gpu_program_parameters - -static GLboolean _glewInit_GL_EXT_gpu_program_parameters (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glProgramEnvParameters4fvEXT = (PFNGLPROGRAMENVPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameters4fvEXT")) == NULL) || r; - r = ((glProgramLocalParameters4fvEXT = (PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameters4fvEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_gpu_program_parameters */ - -#ifdef GL_EXT_gpu_shader4 - -static GLboolean _glewInit_GL_EXT_gpu_shader4 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindFragDataLocationEXT = (PFNGLBINDFRAGDATALOCATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocationEXT")) == NULL) || r; - r = ((glGetFragDataLocationEXT = (PFNGLGETFRAGDATALOCATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataLocationEXT")) == NULL) || r; - r = ((glGetUniformuivEXT = (PFNGLGETUNIFORMUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformuivEXT")) == NULL) || r; - r = ((glGetVertexAttribIivEXT = (PFNGLGETVERTEXATTRIBIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIivEXT")) == NULL) || r; - r = ((glGetVertexAttribIuivEXT = (PFNGLGETVERTEXATTRIBIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIuivEXT")) == NULL) || r; - r = ((glUniform1uiEXT = (PFNGLUNIFORM1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform1uiEXT")) == NULL) || r; - r = ((glUniform1uivEXT = (PFNGLUNIFORM1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform1uivEXT")) == NULL) || r; - r = ((glUniform2uiEXT = (PFNGLUNIFORM2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform2uiEXT")) == NULL) || r; - r = ((glUniform2uivEXT = (PFNGLUNIFORM2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform2uivEXT")) == NULL) || r; - r = ((glUniform3uiEXT = (PFNGLUNIFORM3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform3uiEXT")) == NULL) || r; - r = ((glUniform3uivEXT = (PFNGLUNIFORM3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform3uivEXT")) == NULL) || r; - r = ((glUniform4uiEXT = (PFNGLUNIFORM4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform4uiEXT")) == NULL) || r; - r = ((glUniform4uivEXT = (PFNGLUNIFORM4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform4uivEXT")) == NULL) || r; - r = ((glVertexAttribI1iEXT = (PFNGLVERTEXATTRIBI1IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1iEXT")) == NULL) || r; - r = ((glVertexAttribI1ivEXT = (PFNGLVERTEXATTRIBI1IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1ivEXT")) == NULL) || r; - r = ((glVertexAttribI1uiEXT = (PFNGLVERTEXATTRIBI1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uiEXT")) == NULL) || r; - r = ((glVertexAttribI1uivEXT = (PFNGLVERTEXATTRIBI1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uivEXT")) == NULL) || r; - r = ((glVertexAttribI2iEXT = (PFNGLVERTEXATTRIBI2IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2iEXT")) == NULL) || r; - r = ((glVertexAttribI2ivEXT = (PFNGLVERTEXATTRIBI2IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2ivEXT")) == NULL) || r; - r = ((glVertexAttribI2uiEXT = (PFNGLVERTEXATTRIBI2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uiEXT")) == NULL) || r; - r = ((glVertexAttribI2uivEXT = (PFNGLVERTEXATTRIBI2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uivEXT")) == NULL) || r; - r = ((glVertexAttribI3iEXT = (PFNGLVERTEXATTRIBI3IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3iEXT")) == NULL) || r; - r = ((glVertexAttribI3ivEXT = (PFNGLVERTEXATTRIBI3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3ivEXT")) == NULL) || r; - r = ((glVertexAttribI3uiEXT = (PFNGLVERTEXATTRIBI3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uiEXT")) == NULL) || r; - r = ((glVertexAttribI3uivEXT = (PFNGLVERTEXATTRIBI3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uivEXT")) == NULL) || r; - r = ((glVertexAttribI4bvEXT = (PFNGLVERTEXATTRIBI4BVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4bvEXT")) == NULL) || r; - r = ((glVertexAttribI4iEXT = (PFNGLVERTEXATTRIBI4IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4iEXT")) == NULL) || r; - r = ((glVertexAttribI4ivEXT = (PFNGLVERTEXATTRIBI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ivEXT")) == NULL) || r; - r = ((glVertexAttribI4svEXT = (PFNGLVERTEXATTRIBI4SVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4svEXT")) == NULL) || r; - r = ((glVertexAttribI4ubvEXT = (PFNGLVERTEXATTRIBI4UBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ubvEXT")) == NULL) || r; - r = ((glVertexAttribI4uiEXT = (PFNGLVERTEXATTRIBI4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uiEXT")) == NULL) || r; - r = ((glVertexAttribI4uivEXT = (PFNGLVERTEXATTRIBI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uivEXT")) == NULL) || r; - r = ((glVertexAttribI4usvEXT = (PFNGLVERTEXATTRIBI4USVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4usvEXT")) == NULL) || r; - r = ((glVertexAttribIPointerEXT = (PFNGLVERTEXATTRIBIPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIPointerEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_gpu_shader4 */ - -#ifdef GL_EXT_histogram - -static GLboolean _glewInit_GL_EXT_histogram (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetHistogramEXT = (PFNGLGETHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramEXT")) == NULL) || r; - r = ((glGetHistogramParameterfvEXT = (PFNGLGETHISTOGRAMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterfvEXT")) == NULL) || r; - r = ((glGetHistogramParameterivEXT = (PFNGLGETHISTOGRAMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterivEXT")) == NULL) || r; - r = ((glGetMinmaxEXT = (PFNGLGETMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxEXT")) == NULL) || r; - r = ((glGetMinmaxParameterfvEXT = (PFNGLGETMINMAXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterfvEXT")) == NULL) || r; - r = ((glGetMinmaxParameterivEXT = (PFNGLGETMINMAXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterivEXT")) == NULL) || r; - r = ((glHistogramEXT = (PFNGLHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glHistogramEXT")) == NULL) || r; - r = ((glMinmaxEXT = (PFNGLMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glMinmaxEXT")) == NULL) || r; - r = ((glResetHistogramEXT = (PFNGLRESETHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glResetHistogramEXT")) == NULL) || r; - r = ((glResetMinmaxEXT = (PFNGLRESETMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glResetMinmaxEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_histogram */ - -#ifdef GL_EXT_index_func - -static GLboolean _glewInit_GL_EXT_index_func (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glIndexFuncEXT = (PFNGLINDEXFUNCEXTPROC)glewGetProcAddress((const GLubyte*)"glIndexFuncEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_index_func */ - -#ifdef GL_EXT_index_material - -static GLboolean _glewInit_GL_EXT_index_material (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glIndexMaterialEXT = (PFNGLINDEXMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glIndexMaterialEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_index_material */ - -#ifdef GL_EXT_light_texture - -static GLboolean _glewInit_GL_EXT_light_texture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glApplyTextureEXT = (PFNGLAPPLYTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glApplyTextureEXT")) == NULL) || r; - r = ((glTextureLightEXT = (PFNGLTEXTURELIGHTEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureLightEXT")) == NULL) || r; - r = ((glTextureMaterialEXT = (PFNGLTEXTUREMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureMaterialEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_light_texture */ - -#ifdef GL_EXT_multi_draw_arrays - -static GLboolean _glewInit_GL_EXT_multi_draw_arrays (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glMultiDrawArraysEXT = (PFNGLMULTIDRAWARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysEXT")) == NULL) || r; - r = ((glMultiDrawElementsEXT = (PFNGLMULTIDRAWELEMENTSEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_multi_draw_arrays */ - -#ifdef GL_EXT_multisample - -static GLboolean _glewInit_GL_EXT_multisample (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glSampleMaskEXT = (PFNGLSAMPLEMASKEXTPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskEXT")) == NULL) || r; - r = ((glSamplePatternEXT = (PFNGLSAMPLEPATTERNEXTPROC)glewGetProcAddress((const GLubyte*)"glSamplePatternEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_multisample */ - -#ifdef GL_EXT_paletted_texture - -static GLboolean _glewInit_GL_EXT_paletted_texture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glColorTableEXT = (PFNGLCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glColorTableEXT")) == NULL) || r; - r = ((glGetColorTableEXT = (PFNGLGETCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableEXT")) == NULL) || r; - r = ((glGetColorTableParameterfvEXT = (PFNGLGETCOLORTABLEPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfvEXT")) == NULL) || r; - r = ((glGetColorTableParameterivEXT = (PFNGLGETCOLORTABLEPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterivEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_paletted_texture */ - -#ifdef GL_EXT_pixel_transform - -static GLboolean _glewInit_GL_EXT_pixel_transform (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetPixelTransformParameterfvEXT = (PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPixelTransformParameterfvEXT")) == NULL) || r; - r = ((glGetPixelTransformParameterivEXT = (PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPixelTransformParameterivEXT")) == NULL) || r; - r = ((glPixelTransformParameterfEXT = (PFNGLPIXELTRANSFORMPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterfEXT")) == NULL) || r; - r = ((glPixelTransformParameterfvEXT = (PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterfvEXT")) == NULL) || r; - r = ((glPixelTransformParameteriEXT = (PFNGLPIXELTRANSFORMPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameteriEXT")) == NULL) || r; - r = ((glPixelTransformParameterivEXT = (PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterivEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_pixel_transform */ - -#ifdef GL_EXT_point_parameters - -static GLboolean _glewInit_GL_EXT_point_parameters (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glPointParameterfEXT = (PFNGLPOINTPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfEXT")) == NULL) || r; - r = ((glPointParameterfvEXT = (PFNGLPOINTPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfvEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_point_parameters */ - -#ifdef GL_EXT_polygon_offset - -static GLboolean _glewInit_GL_EXT_polygon_offset (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glPolygonOffsetEXT = (PFNGLPOLYGONOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glPolygonOffsetEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_polygon_offset */ - -#ifdef GL_EXT_polygon_offset_clamp - -static GLboolean _glewInit_GL_EXT_polygon_offset_clamp (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glPolygonOffsetClampEXT = (PFNGLPOLYGONOFFSETCLAMPEXTPROC)glewGetProcAddress((const GLubyte*)"glPolygonOffsetClampEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_polygon_offset_clamp */ - -#ifdef GL_EXT_provoking_vertex - -static GLboolean _glewInit_GL_EXT_provoking_vertex (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glProvokingVertexEXT = (PFNGLPROVOKINGVERTEXEXTPROC)glewGetProcAddress((const GLubyte*)"glProvokingVertexEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_provoking_vertex */ - -#ifdef GL_EXT_raster_multisample - -static GLboolean _glewInit_GL_EXT_raster_multisample (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCoverageModulationNV = (PFNGLCOVERAGEMODULATIONNVPROC)glewGetProcAddress((const GLubyte*)"glCoverageModulationNV")) == NULL) || r; - r = ((glCoverageModulationTableNV = (PFNGLCOVERAGEMODULATIONTABLENVPROC)glewGetProcAddress((const GLubyte*)"glCoverageModulationTableNV")) == NULL) || r; - r = ((glGetCoverageModulationTableNV = (PFNGLGETCOVERAGEMODULATIONTABLENVPROC)glewGetProcAddress((const GLubyte*)"glGetCoverageModulationTableNV")) == NULL) || r; - r = ((glRasterSamplesEXT = (PFNGLRASTERSAMPLESEXTPROC)glewGetProcAddress((const GLubyte*)"glRasterSamplesEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_raster_multisample */ - -#ifdef GL_EXT_scene_marker - -static GLboolean _glewInit_GL_EXT_scene_marker (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBeginSceneEXT = (PFNGLBEGINSCENEEXTPROC)glewGetProcAddress((const GLubyte*)"glBeginSceneEXT")) == NULL) || r; - r = ((glEndSceneEXT = (PFNGLENDSCENEEXTPROC)glewGetProcAddress((const GLubyte*)"glEndSceneEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_scene_marker */ - -#ifdef GL_EXT_secondary_color - -static GLboolean _glewInit_GL_EXT_secondary_color (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glSecondaryColor3bEXT = (PFNGLSECONDARYCOLOR3BEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bEXT")) == NULL) || r; - r = ((glSecondaryColor3bvEXT = (PFNGLSECONDARYCOLOR3BVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bvEXT")) == NULL) || r; - r = ((glSecondaryColor3dEXT = (PFNGLSECONDARYCOLOR3DEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dEXT")) == NULL) || r; - r = ((glSecondaryColor3dvEXT = (PFNGLSECONDARYCOLOR3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dvEXT")) == NULL) || r; - r = ((glSecondaryColor3fEXT = (PFNGLSECONDARYCOLOR3FEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fEXT")) == NULL) || r; - r = ((glSecondaryColor3fvEXT = (PFNGLSECONDARYCOLOR3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fvEXT")) == NULL) || r; - r = ((glSecondaryColor3iEXT = (PFNGLSECONDARYCOLOR3IEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3iEXT")) == NULL) || r; - r = ((glSecondaryColor3ivEXT = (PFNGLSECONDARYCOLOR3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ivEXT")) == NULL) || r; - r = ((glSecondaryColor3sEXT = (PFNGLSECONDARYCOLOR3SEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3sEXT")) == NULL) || r; - r = ((glSecondaryColor3svEXT = (PFNGLSECONDARYCOLOR3SVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3svEXT")) == NULL) || r; - r = ((glSecondaryColor3ubEXT = (PFNGLSECONDARYCOLOR3UBEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubEXT")) == NULL) || r; - r = ((glSecondaryColor3ubvEXT = (PFNGLSECONDARYCOLOR3UBVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubvEXT")) == NULL) || r; - r = ((glSecondaryColor3uiEXT = (PFNGLSECONDARYCOLOR3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uiEXT")) == NULL) || r; - r = ((glSecondaryColor3uivEXT = (PFNGLSECONDARYCOLOR3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uivEXT")) == NULL) || r; - r = ((glSecondaryColor3usEXT = (PFNGLSECONDARYCOLOR3USEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usEXT")) == NULL) || r; - r = ((glSecondaryColor3usvEXT = (PFNGLSECONDARYCOLOR3USVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usvEXT")) == NULL) || r; - r = ((glSecondaryColorPointerEXT = (PFNGLSECONDARYCOLORPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointerEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_secondary_color */ - -#ifdef GL_EXT_separate_shader_objects - -static GLboolean _glewInit_GL_EXT_separate_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glActiveProgramEXT = (PFNGLACTIVEPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glActiveProgramEXT")) == NULL) || r; - r = ((glCreateShaderProgramEXT = (PFNGLCREATESHADERPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderProgramEXT")) == NULL) || r; - r = ((glUseShaderProgramEXT = (PFNGLUSESHADERPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glUseShaderProgramEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_separate_shader_objects */ - -#ifdef GL_EXT_shader_image_load_store - -static GLboolean _glewInit_GL_EXT_shader_image_load_store (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindImageTextureEXT = (PFNGLBINDIMAGETEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindImageTextureEXT")) == NULL) || r; - r = ((glMemoryBarrierEXT = (PFNGLMEMORYBARRIEREXTPROC)glewGetProcAddress((const GLubyte*)"glMemoryBarrierEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_shader_image_load_store */ - -#ifdef GL_EXT_stencil_two_side - -static GLboolean _glewInit_GL_EXT_stencil_two_side (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glActiveStencilFaceEXT = (PFNGLACTIVESTENCILFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glActiveStencilFaceEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_stencil_two_side */ - -#ifdef GL_EXT_subtexture - -static GLboolean _glewInit_GL_EXT_subtexture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTexSubImage1DEXT = (PFNGLTEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage1DEXT")) == NULL) || r; - r = ((glTexSubImage2DEXT = (PFNGLTEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage2DEXT")) == NULL) || r; - r = ((glTexSubImage3DEXT = (PFNGLTEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage3DEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_subtexture */ - -#ifdef GL_EXT_texture3D - -static GLboolean _glewInit_GL_EXT_texture3D (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTexImage3DEXT = (PFNGLTEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_texture3D */ - -#ifdef GL_EXT_texture_array - -static GLboolean _glewInit_GL_EXT_texture_array (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFramebufferTextureLayerEXT = (PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayerEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_texture_array */ - -#ifdef GL_EXT_texture_buffer_object - -static GLboolean _glewInit_GL_EXT_texture_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTexBufferEXT = (PFNGLTEXBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTexBufferEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_texture_buffer_object */ - -#ifdef GL_EXT_texture_integer - -static GLboolean _glewInit_GL_EXT_texture_integer (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glClearColorIiEXT = (PFNGLCLEARCOLORIIEXTPROC)glewGetProcAddress((const GLubyte*)"glClearColorIiEXT")) == NULL) || r; - r = ((glClearColorIuiEXT = (PFNGLCLEARCOLORIUIEXTPROC)glewGetProcAddress((const GLubyte*)"glClearColorIuiEXT")) == NULL) || r; - r = ((glGetTexParameterIivEXT = (PFNGLGETTEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIivEXT")) == NULL) || r; - r = ((glGetTexParameterIuivEXT = (PFNGLGETTEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIuivEXT")) == NULL) || r; - r = ((glTexParameterIivEXT = (PFNGLTEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIivEXT")) == NULL) || r; - r = ((glTexParameterIuivEXT = (PFNGLTEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIuivEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_texture_integer */ - -#ifdef GL_EXT_texture_object - -static GLboolean _glewInit_GL_EXT_texture_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glAreTexturesResidentEXT = (PFNGLARETEXTURESRESIDENTEXTPROC)glewGetProcAddress((const GLubyte*)"glAreTexturesResidentEXT")) == NULL) || r; - r = ((glBindTextureEXT = (PFNGLBINDTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindTextureEXT")) == NULL) || r; - r = ((glDeleteTexturesEXT = (PFNGLDELETETEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteTexturesEXT")) == NULL) || r; - r = ((glGenTexturesEXT = (PFNGLGENTEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glGenTexturesEXT")) == NULL) || r; - r = ((glIsTextureEXT = (PFNGLISTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glIsTextureEXT")) == NULL) || r; - r = ((glPrioritizeTexturesEXT = (PFNGLPRIORITIZETEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glPrioritizeTexturesEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_texture_object */ - -#ifdef GL_EXT_texture_perturb_normal - -static GLboolean _glewInit_GL_EXT_texture_perturb_normal (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTextureNormalEXT = (PFNGLTEXTURENORMALEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureNormalEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_texture_perturb_normal */ - -#ifdef GL_EXT_timer_query - -static GLboolean _glewInit_GL_EXT_timer_query (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetQueryObjecti64vEXT = (PFNGLGETQUERYOBJECTI64VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64vEXT")) == NULL) || r; - r = ((glGetQueryObjectui64vEXT = (PFNGLGETQUERYOBJECTUI64VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64vEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_timer_query */ - -#ifdef GL_EXT_transform_feedback - -static GLboolean _glewInit_GL_EXT_transform_feedback (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBeginTransformFeedbackEXT = (PFNGLBEGINTRANSFORMFEEDBACKEXTPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedbackEXT")) == NULL) || r; - r = ((glBindBufferBaseEXT = (PFNGLBINDBUFFERBASEEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBaseEXT")) == NULL) || r; - r = ((glBindBufferOffsetEXT = (PFNGLBINDBUFFEROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferOffsetEXT")) == NULL) || r; - r = ((glBindBufferRangeEXT = (PFNGLBINDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRangeEXT")) == NULL) || r; - r = ((glEndTransformFeedbackEXT = (PFNGLENDTRANSFORMFEEDBACKEXTPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedbackEXT")) == NULL) || r; - r = ((glGetTransformFeedbackVaryingEXT = (PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVaryingEXT")) == NULL) || r; - r = ((glTransformFeedbackVaryingsEXT = (PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryingsEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_transform_feedback */ - -#ifdef GL_EXT_vertex_array - -static GLboolean _glewInit_GL_EXT_vertex_array (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glArrayElementEXT = (PFNGLARRAYELEMENTEXTPROC)glewGetProcAddress((const GLubyte*)"glArrayElementEXT")) == NULL) || r; - r = ((glColorPointerEXT = (PFNGLCOLORPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glColorPointerEXT")) == NULL) || r; - r = ((glDrawArraysEXT = (PFNGLDRAWARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysEXT")) == NULL) || r; - r = ((glEdgeFlagPointerEXT = (PFNGLEDGEFLAGPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagPointerEXT")) == NULL) || r; - r = ((glIndexPointerEXT = (PFNGLINDEXPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glIndexPointerEXT")) == NULL) || r; - r = ((glNormalPointerEXT = (PFNGLNORMALPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glNormalPointerEXT")) == NULL) || r; - r = ((glTexCoordPointerEXT = (PFNGLTEXCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointerEXT")) == NULL) || r; - r = ((glVertexPointerEXT = (PFNGLVERTEXPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexPointerEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_vertex_array */ - -#ifdef GL_EXT_vertex_attrib_64bit - -static GLboolean _glewInit_GL_EXT_vertex_attrib_64bit (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetVertexAttribLdvEXT = (PFNGLGETVERTEXATTRIBLDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLdvEXT")) == NULL) || r; - r = ((glVertexArrayVertexAttribLOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribLOffsetEXT")) == NULL) || r; - r = ((glVertexAttribL1dEXT = (PFNGLVERTEXATTRIBL1DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dEXT")) == NULL) || r; - r = ((glVertexAttribL1dvEXT = (PFNGLVERTEXATTRIBL1DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dvEXT")) == NULL) || r; - r = ((glVertexAttribL2dEXT = (PFNGLVERTEXATTRIBL2DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dEXT")) == NULL) || r; - r = ((glVertexAttribL2dvEXT = (PFNGLVERTEXATTRIBL2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dvEXT")) == NULL) || r; - r = ((glVertexAttribL3dEXT = (PFNGLVERTEXATTRIBL3DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dEXT")) == NULL) || r; - r = ((glVertexAttribL3dvEXT = (PFNGLVERTEXATTRIBL3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dvEXT")) == NULL) || r; - r = ((glVertexAttribL4dEXT = (PFNGLVERTEXATTRIBL4DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dEXT")) == NULL) || r; - r = ((glVertexAttribL4dvEXT = (PFNGLVERTEXATTRIBL4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dvEXT")) == NULL) || r; - r = ((glVertexAttribLPointerEXT = (PFNGLVERTEXATTRIBLPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLPointerEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_vertex_attrib_64bit */ - -#ifdef GL_EXT_vertex_shader - -static GLboolean _glewInit_GL_EXT_vertex_shader (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBeginVertexShaderEXT = (PFNGLBEGINVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glBeginVertexShaderEXT")) == NULL) || r; - r = ((glBindLightParameterEXT = (PFNGLBINDLIGHTPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindLightParameterEXT")) == NULL) || r; - r = ((glBindMaterialParameterEXT = (PFNGLBINDMATERIALPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindMaterialParameterEXT")) == NULL) || r; - r = ((glBindParameterEXT = (PFNGLBINDPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindParameterEXT")) == NULL) || r; - r = ((glBindTexGenParameterEXT = (PFNGLBINDTEXGENPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindTexGenParameterEXT")) == NULL) || r; - r = ((glBindTextureUnitParameterEXT = (PFNGLBINDTEXTUREUNITPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindTextureUnitParameterEXT")) == NULL) || r; - r = ((glBindVertexShaderEXT = (PFNGLBINDVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindVertexShaderEXT")) == NULL) || r; - r = ((glDeleteVertexShaderEXT = (PFNGLDELETEVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexShaderEXT")) == NULL) || r; - r = ((glDisableVariantClientStateEXT = (PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVariantClientStateEXT")) == NULL) || r; - r = ((glEnableVariantClientStateEXT = (PFNGLENABLEVARIANTCLIENTSTATEEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVariantClientStateEXT")) == NULL) || r; - r = ((glEndVertexShaderEXT = (PFNGLENDVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glEndVertexShaderEXT")) == NULL) || r; - r = ((glExtractComponentEXT = (PFNGLEXTRACTCOMPONENTEXTPROC)glewGetProcAddress((const GLubyte*)"glExtractComponentEXT")) == NULL) || r; - r = ((glGenSymbolsEXT = (PFNGLGENSYMBOLSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenSymbolsEXT")) == NULL) || r; - r = ((glGenVertexShadersEXT = (PFNGLGENVERTEXSHADERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenVertexShadersEXT")) == NULL) || r; - r = ((glGetInvariantBooleanvEXT = (PFNGLGETINVARIANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantBooleanvEXT")) == NULL) || r; - r = ((glGetInvariantFloatvEXT = (PFNGLGETINVARIANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantFloatvEXT")) == NULL) || r; - r = ((glGetInvariantIntegervEXT = (PFNGLGETINVARIANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantIntegervEXT")) == NULL) || r; - r = ((glGetLocalConstantBooleanvEXT = (PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantBooleanvEXT")) == NULL) || r; - r = ((glGetLocalConstantFloatvEXT = (PFNGLGETLOCALCONSTANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantFloatvEXT")) == NULL) || r; - r = ((glGetLocalConstantIntegervEXT = (PFNGLGETLOCALCONSTANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantIntegervEXT")) == NULL) || r; - r = ((glGetVariantBooleanvEXT = (PFNGLGETVARIANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantBooleanvEXT")) == NULL) || r; - r = ((glGetVariantFloatvEXT = (PFNGLGETVARIANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantFloatvEXT")) == NULL) || r; - r = ((glGetVariantIntegervEXT = (PFNGLGETVARIANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantIntegervEXT")) == NULL) || r; - r = ((glGetVariantPointervEXT = (PFNGLGETVARIANTPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantPointervEXT")) == NULL) || r; - r = ((glInsertComponentEXT = (PFNGLINSERTCOMPONENTEXTPROC)glewGetProcAddress((const GLubyte*)"glInsertComponentEXT")) == NULL) || r; - r = ((glIsVariantEnabledEXT = (PFNGLISVARIANTENABLEDEXTPROC)glewGetProcAddress((const GLubyte*)"glIsVariantEnabledEXT")) == NULL) || r; - r = ((glSetInvariantEXT = (PFNGLSETINVARIANTEXTPROC)glewGetProcAddress((const GLubyte*)"glSetInvariantEXT")) == NULL) || r; - r = ((glSetLocalConstantEXT = (PFNGLSETLOCALCONSTANTEXTPROC)glewGetProcAddress((const GLubyte*)"glSetLocalConstantEXT")) == NULL) || r; - r = ((glShaderOp1EXT = (PFNGLSHADEROP1EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp1EXT")) == NULL) || r; - r = ((glShaderOp2EXT = (PFNGLSHADEROP2EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp2EXT")) == NULL) || r; - r = ((glShaderOp3EXT = (PFNGLSHADEROP3EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp3EXT")) == NULL) || r; - r = ((glSwizzleEXT = (PFNGLSWIZZLEEXTPROC)glewGetProcAddress((const GLubyte*)"glSwizzleEXT")) == NULL) || r; - r = ((glVariantPointerEXT = (PFNGLVARIANTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVariantPointerEXT")) == NULL) || r; - r = ((glVariantbvEXT = (PFNGLVARIANTBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantbvEXT")) == NULL) || r; - r = ((glVariantdvEXT = (PFNGLVARIANTDVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantdvEXT")) == NULL) || r; - r = ((glVariantfvEXT = (PFNGLVARIANTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantfvEXT")) == NULL) || r; - r = ((glVariantivEXT = (PFNGLVARIANTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantivEXT")) == NULL) || r; - r = ((glVariantsvEXT = (PFNGLVARIANTSVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantsvEXT")) == NULL) || r; - r = ((glVariantubvEXT = (PFNGLVARIANTUBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantubvEXT")) == NULL) || r; - r = ((glVariantuivEXT = (PFNGLVARIANTUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantuivEXT")) == NULL) || r; - r = ((glVariantusvEXT = (PFNGLVARIANTUSVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantusvEXT")) == NULL) || r; - r = ((glWriteMaskEXT = (PFNGLWRITEMASKEXTPROC)glewGetProcAddress((const GLubyte*)"glWriteMaskEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_vertex_shader */ - -#ifdef GL_EXT_vertex_weighting - -static GLboolean _glewInit_GL_EXT_vertex_weighting (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glVertexWeightPointerEXT = (PFNGLVERTEXWEIGHTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightPointerEXT")) == NULL) || r; - r = ((glVertexWeightfEXT = (PFNGLVERTEXWEIGHTFEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightfEXT")) == NULL) || r; - r = ((glVertexWeightfvEXT = (PFNGLVERTEXWEIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightfvEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_vertex_weighting */ - -#ifdef GL_EXT_x11_sync_object - -static GLboolean _glewInit_GL_EXT_x11_sync_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glImportSyncEXT = (PFNGLIMPORTSYNCEXTPROC)glewGetProcAddress((const GLubyte*)"glImportSyncEXT")) == NULL) || r; - - return r; -} - -#endif /* GL_EXT_x11_sync_object */ - -#ifdef GL_GREMEDY_frame_terminator - -static GLboolean _glewInit_GL_GREMEDY_frame_terminator (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFrameTerminatorGREMEDY = (PFNGLFRAMETERMINATORGREMEDYPROC)glewGetProcAddress((const GLubyte*)"glFrameTerminatorGREMEDY")) == NULL) || r; - - return r; -} - -#endif /* GL_GREMEDY_frame_terminator */ - -#ifdef GL_GREMEDY_string_marker - -static GLboolean _glewInit_GL_GREMEDY_string_marker (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glStringMarkerGREMEDY = (PFNGLSTRINGMARKERGREMEDYPROC)glewGetProcAddress((const GLubyte*)"glStringMarkerGREMEDY")) == NULL) || r; - - return r; -} - -#endif /* GL_GREMEDY_string_marker */ - -#ifdef GL_HP_image_transform - -static GLboolean _glewInit_GL_HP_image_transform (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetImageTransformParameterfvHP = (PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC)glewGetProcAddress((const GLubyte*)"glGetImageTransformParameterfvHP")) == NULL) || r; - r = ((glGetImageTransformParameterivHP = (PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC)glewGetProcAddress((const GLubyte*)"glGetImageTransformParameterivHP")) == NULL) || r; - r = ((glImageTransformParameterfHP = (PFNGLIMAGETRANSFORMPARAMETERFHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterfHP")) == NULL) || r; - r = ((glImageTransformParameterfvHP = (PFNGLIMAGETRANSFORMPARAMETERFVHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterfvHP")) == NULL) || r; - r = ((glImageTransformParameteriHP = (PFNGLIMAGETRANSFORMPARAMETERIHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameteriHP")) == NULL) || r; - r = ((glImageTransformParameterivHP = (PFNGLIMAGETRANSFORMPARAMETERIVHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterivHP")) == NULL) || r; - - return r; -} - -#endif /* GL_HP_image_transform */ - -#ifdef GL_IBM_multimode_draw_arrays - -static GLboolean _glewInit_GL_IBM_multimode_draw_arrays (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glMultiModeDrawArraysIBM = (PFNGLMULTIMODEDRAWARRAYSIBMPROC)glewGetProcAddress((const GLubyte*)"glMultiModeDrawArraysIBM")) == NULL) || r; - r = ((glMultiModeDrawElementsIBM = (PFNGLMULTIMODEDRAWELEMENTSIBMPROC)glewGetProcAddress((const GLubyte*)"glMultiModeDrawElementsIBM")) == NULL) || r; - - return r; -} - -#endif /* GL_IBM_multimode_draw_arrays */ - -#ifdef GL_IBM_vertex_array_lists - -static GLboolean _glewInit_GL_IBM_vertex_array_lists (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glColorPointerListIBM = (PFNGLCOLORPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glColorPointerListIBM")) == NULL) || r; - r = ((glEdgeFlagPointerListIBM = (PFNGLEDGEFLAGPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagPointerListIBM")) == NULL) || r; - r = ((glFogCoordPointerListIBM = (PFNGLFOGCOORDPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointerListIBM")) == NULL) || r; - r = ((glIndexPointerListIBM = (PFNGLINDEXPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glIndexPointerListIBM")) == NULL) || r; - r = ((glNormalPointerListIBM = (PFNGLNORMALPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glNormalPointerListIBM")) == NULL) || r; - r = ((glSecondaryColorPointerListIBM = (PFNGLSECONDARYCOLORPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointerListIBM")) == NULL) || r; - r = ((glTexCoordPointerListIBM = (PFNGLTEXCOORDPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointerListIBM")) == NULL) || r; - r = ((glVertexPointerListIBM = (PFNGLVERTEXPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glVertexPointerListIBM")) == NULL) || r; - - return r; -} - -#endif /* GL_IBM_vertex_array_lists */ - -#ifdef GL_INTEL_map_texture - -static GLboolean _glewInit_GL_INTEL_map_texture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glMapTexture2DINTEL = (PFNGLMAPTEXTURE2DINTELPROC)glewGetProcAddress((const GLubyte*)"glMapTexture2DINTEL")) == NULL) || r; - r = ((glSyncTextureINTEL = (PFNGLSYNCTEXTUREINTELPROC)glewGetProcAddress((const GLubyte*)"glSyncTextureINTEL")) == NULL) || r; - r = ((glUnmapTexture2DINTEL = (PFNGLUNMAPTEXTURE2DINTELPROC)glewGetProcAddress((const GLubyte*)"glUnmapTexture2DINTEL")) == NULL) || r; - - return r; -} - -#endif /* GL_INTEL_map_texture */ - -#ifdef GL_INTEL_parallel_arrays - -static GLboolean _glewInit_GL_INTEL_parallel_arrays (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glColorPointervINTEL = (PFNGLCOLORPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glColorPointervINTEL")) == NULL) || r; - r = ((glNormalPointervINTEL = (PFNGLNORMALPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glNormalPointervINTEL")) == NULL) || r; - r = ((glTexCoordPointervINTEL = (PFNGLTEXCOORDPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointervINTEL")) == NULL) || r; - r = ((glVertexPointervINTEL = (PFNGLVERTEXPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glVertexPointervINTEL")) == NULL) || r; - - return r; -} - -#endif /* GL_INTEL_parallel_arrays */ - -#ifdef GL_INTEL_performance_query - -static GLboolean _glewInit_GL_INTEL_performance_query (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBeginPerfQueryINTEL = (PFNGLBEGINPERFQUERYINTELPROC)glewGetProcAddress((const GLubyte*)"glBeginPerfQueryINTEL")) == NULL) || r; - r = ((glCreatePerfQueryINTEL = (PFNGLCREATEPERFQUERYINTELPROC)glewGetProcAddress((const GLubyte*)"glCreatePerfQueryINTEL")) == NULL) || r; - r = ((glDeletePerfQueryINTEL = (PFNGLDELETEPERFQUERYINTELPROC)glewGetProcAddress((const GLubyte*)"glDeletePerfQueryINTEL")) == NULL) || r; - r = ((glEndPerfQueryINTEL = (PFNGLENDPERFQUERYINTELPROC)glewGetProcAddress((const GLubyte*)"glEndPerfQueryINTEL")) == NULL) || r; - r = ((glGetFirstPerfQueryIdINTEL = (PFNGLGETFIRSTPERFQUERYIDINTELPROC)glewGetProcAddress((const GLubyte*)"glGetFirstPerfQueryIdINTEL")) == NULL) || r; - r = ((glGetNextPerfQueryIdINTEL = (PFNGLGETNEXTPERFQUERYIDINTELPROC)glewGetProcAddress((const GLubyte*)"glGetNextPerfQueryIdINTEL")) == NULL) || r; - r = ((glGetPerfCounterInfoINTEL = (PFNGLGETPERFCOUNTERINFOINTELPROC)glewGetProcAddress((const GLubyte*)"glGetPerfCounterInfoINTEL")) == NULL) || r; - r = ((glGetPerfQueryDataINTEL = (PFNGLGETPERFQUERYDATAINTELPROC)glewGetProcAddress((const GLubyte*)"glGetPerfQueryDataINTEL")) == NULL) || r; - r = ((glGetPerfQueryIdByNameINTEL = (PFNGLGETPERFQUERYIDBYNAMEINTELPROC)glewGetProcAddress((const GLubyte*)"glGetPerfQueryIdByNameINTEL")) == NULL) || r; - r = ((glGetPerfQueryInfoINTEL = (PFNGLGETPERFQUERYINFOINTELPROC)glewGetProcAddress((const GLubyte*)"glGetPerfQueryInfoINTEL")) == NULL) || r; - - return r; -} - -#endif /* GL_INTEL_performance_query */ - -#ifdef GL_INTEL_texture_scissor - -static GLboolean _glewInit_GL_INTEL_texture_scissor (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTexScissorFuncINTEL = (PFNGLTEXSCISSORFUNCINTELPROC)glewGetProcAddress((const GLubyte*)"glTexScissorFuncINTEL")) == NULL) || r; - r = ((glTexScissorINTEL = (PFNGLTEXSCISSORINTELPROC)glewGetProcAddress((const GLubyte*)"glTexScissorINTEL")) == NULL) || r; - - return r; -} - -#endif /* GL_INTEL_texture_scissor */ - -#ifdef GL_KHR_blend_equation_advanced - -static GLboolean _glewInit_GL_KHR_blend_equation_advanced (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBlendBarrierKHR = (PFNGLBLENDBARRIERKHRPROC)glewGetProcAddress((const GLubyte*)"glBlendBarrierKHR")) == NULL) || r; - - return r; -} - -#endif /* GL_KHR_blend_equation_advanced */ - -#ifdef GL_KHR_debug - -static GLboolean _glewInit_GL_KHR_debug (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallback")) == NULL) || r; - r = ((glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageControl")) == NULL) || r; - r = ((glDebugMessageInsert = (PFNGLDEBUGMESSAGEINSERTPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsert")) == NULL) || r; - r = ((glGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLog")) == NULL) || r; - r = ((glGetObjectLabel = (PFNGLGETOBJECTLABELPROC)glewGetProcAddress((const GLubyte*)"glGetObjectLabel")) == NULL) || r; - r = ((glGetObjectPtrLabel = (PFNGLGETOBJECTPTRLABELPROC)glewGetProcAddress((const GLubyte*)"glGetObjectPtrLabel")) == NULL) || r; - r = ((glObjectLabel = (PFNGLOBJECTLABELPROC)glewGetProcAddress((const GLubyte*)"glObjectLabel")) == NULL) || r; - r = ((glObjectPtrLabel = (PFNGLOBJECTPTRLABELPROC)glewGetProcAddress((const GLubyte*)"glObjectPtrLabel")) == NULL) || r; - r = ((glPopDebugGroup = (PFNGLPOPDEBUGGROUPPROC)glewGetProcAddress((const GLubyte*)"glPopDebugGroup")) == NULL) || r; - r = ((glPushDebugGroup = (PFNGLPUSHDEBUGGROUPPROC)glewGetProcAddress((const GLubyte*)"glPushDebugGroup")) == NULL) || r; - - return r; -} - -#endif /* GL_KHR_debug */ - -#ifdef GL_KHR_robustness - -static GLboolean _glewInit_GL_KHR_robustness (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetnUniformfv = (PFNGLGETNUNIFORMFVPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformfv")) == NULL) || r; - r = ((glGetnUniformiv = (PFNGLGETNUNIFORMIVPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformiv")) == NULL) || r; - r = ((glGetnUniformuiv = (PFNGLGETNUNIFORMUIVPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformuiv")) == NULL) || r; - r = ((glReadnPixels = (PFNGLREADNPIXELSPROC)glewGetProcAddress((const GLubyte*)"glReadnPixels")) == NULL) || r; - - return r; -} - -#endif /* GL_KHR_robustness */ - -#ifdef GL_KTX_buffer_region - -static GLboolean _glewInit_GL_KTX_buffer_region (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBufferRegionEnabled = (PFNGLBUFFERREGIONENABLEDPROC)glewGetProcAddress((const GLubyte*)"glBufferRegionEnabled")) == NULL) || r; - r = ((glDeleteBufferRegion = (PFNGLDELETEBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glDeleteBufferRegion")) == NULL) || r; - r = ((glDrawBufferRegion = (PFNGLDRAWBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glDrawBufferRegion")) == NULL) || r; - r = ((glNewBufferRegion = (PFNGLNEWBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glNewBufferRegion")) == NULL) || r; - r = ((glReadBufferRegion = (PFNGLREADBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glReadBufferRegion")) == NULL) || r; - - return r; -} - -#endif /* GL_KTX_buffer_region */ - -#ifdef GL_MESA_resize_buffers - -static GLboolean _glewInit_GL_MESA_resize_buffers (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glResizeBuffersMESA = (PFNGLRESIZEBUFFERSMESAPROC)glewGetProcAddress((const GLubyte*)"glResizeBuffersMESA")) == NULL) || r; - - return r; -} - -#endif /* GL_MESA_resize_buffers */ - -#ifdef GL_MESA_window_pos - -static GLboolean _glewInit_GL_MESA_window_pos (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glWindowPos2dMESA = (PFNGLWINDOWPOS2DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dMESA")) == NULL) || r; - r = ((glWindowPos2dvMESA = (PFNGLWINDOWPOS2DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dvMESA")) == NULL) || r; - r = ((glWindowPos2fMESA = (PFNGLWINDOWPOS2FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fMESA")) == NULL) || r; - r = ((glWindowPos2fvMESA = (PFNGLWINDOWPOS2FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fvMESA")) == NULL) || r; - r = ((glWindowPos2iMESA = (PFNGLWINDOWPOS2IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iMESA")) == NULL) || r; - r = ((glWindowPos2ivMESA = (PFNGLWINDOWPOS2IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2ivMESA")) == NULL) || r; - r = ((glWindowPos2sMESA = (PFNGLWINDOWPOS2SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sMESA")) == NULL) || r; - r = ((glWindowPos2svMESA = (PFNGLWINDOWPOS2SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2svMESA")) == NULL) || r; - r = ((glWindowPos3dMESA = (PFNGLWINDOWPOS3DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dMESA")) == NULL) || r; - r = ((glWindowPos3dvMESA = (PFNGLWINDOWPOS3DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dvMESA")) == NULL) || r; - r = ((glWindowPos3fMESA = (PFNGLWINDOWPOS3FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fMESA")) == NULL) || r; - r = ((glWindowPos3fvMESA = (PFNGLWINDOWPOS3FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fvMESA")) == NULL) || r; - r = ((glWindowPos3iMESA = (PFNGLWINDOWPOS3IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iMESA")) == NULL) || r; - r = ((glWindowPos3ivMESA = (PFNGLWINDOWPOS3IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3ivMESA")) == NULL) || r; - r = ((glWindowPos3sMESA = (PFNGLWINDOWPOS3SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sMESA")) == NULL) || r; - r = ((glWindowPos3svMESA = (PFNGLWINDOWPOS3SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3svMESA")) == NULL) || r; - r = ((glWindowPos4dMESA = (PFNGLWINDOWPOS4DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4dMESA")) == NULL) || r; - r = ((glWindowPos4dvMESA = (PFNGLWINDOWPOS4DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4dvMESA")) == NULL) || r; - r = ((glWindowPos4fMESA = (PFNGLWINDOWPOS4FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4fMESA")) == NULL) || r; - r = ((glWindowPos4fvMESA = (PFNGLWINDOWPOS4FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4fvMESA")) == NULL) || r; - r = ((glWindowPos4iMESA = (PFNGLWINDOWPOS4IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4iMESA")) == NULL) || r; - r = ((glWindowPos4ivMESA = (PFNGLWINDOWPOS4IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4ivMESA")) == NULL) || r; - r = ((glWindowPos4sMESA = (PFNGLWINDOWPOS4SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4sMESA")) == NULL) || r; - r = ((glWindowPos4svMESA = (PFNGLWINDOWPOS4SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4svMESA")) == NULL) || r; - - return r; -} - -#endif /* GL_MESA_window_pos */ - -#ifdef GL_NVX_conditional_render - -static GLboolean _glewInit_GL_NVX_conditional_render (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBeginConditionalRenderNVX = (PFNGLBEGINCONDITIONALRENDERNVXPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRenderNVX")) == NULL) || r; - r = ((glEndConditionalRenderNVX = (PFNGLENDCONDITIONALRENDERNVXPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRenderNVX")) == NULL) || r; - - return r; -} - -#endif /* GL_NVX_conditional_render */ - -#ifdef GL_NV_bindless_multi_draw_indirect - -static GLboolean _glewInit_GL_NV_bindless_multi_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glMultiDrawArraysIndirectBindlessNV = (PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectBindlessNV")) == NULL) || r; - r = ((glMultiDrawElementsIndirectBindlessNV = (PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectBindlessNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_bindless_multi_draw_indirect */ - -#ifdef GL_NV_bindless_multi_draw_indirect_count - -static GLboolean _glewInit_GL_NV_bindless_multi_draw_indirect_count (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glMultiDrawArraysIndirectBindlessCountNV = (PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectBindlessCountNV")) == NULL) || r; - r = ((glMultiDrawElementsIndirectBindlessCountNV = (PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectBindlessCountNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_bindless_multi_draw_indirect_count */ - -#ifdef GL_NV_bindless_texture - -static GLboolean _glewInit_GL_NV_bindless_texture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetImageHandleNV = (PFNGLGETIMAGEHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetImageHandleNV")) == NULL) || r; - r = ((glGetTextureHandleNV = (PFNGLGETTEXTUREHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureHandleNV")) == NULL) || r; - r = ((glGetTextureSamplerHandleNV = (PFNGLGETTEXTURESAMPLERHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureSamplerHandleNV")) == NULL) || r; - r = ((glIsImageHandleResidentNV = (PFNGLISIMAGEHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsImageHandleResidentNV")) == NULL) || r; - r = ((glIsTextureHandleResidentNV = (PFNGLISTEXTUREHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsTextureHandleResidentNV")) == NULL) || r; - r = ((glMakeImageHandleNonResidentNV = (PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleNonResidentNV")) == NULL) || r; - r = ((glMakeImageHandleResidentNV = (PFNGLMAKEIMAGEHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleResidentNV")) == NULL) || r; - r = ((glMakeTextureHandleNonResidentNV = (PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleNonResidentNV")) == NULL) || r; - r = ((glMakeTextureHandleResidentNV = (PFNGLMAKETEXTUREHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleResidentNV")) == NULL) || r; - r = ((glProgramUniformHandleui64NV = (PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64NV")) == NULL) || r; - r = ((glProgramUniformHandleui64vNV = (PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64vNV")) == NULL) || r; - r = ((glUniformHandleui64NV = (PFNGLUNIFORMHANDLEUI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64NV")) == NULL) || r; - r = ((glUniformHandleui64vNV = (PFNGLUNIFORMHANDLEUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64vNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_bindless_texture */ - -#ifdef GL_NV_blend_equation_advanced - -static GLboolean _glewInit_GL_NV_blend_equation_advanced (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBlendBarrierNV = (PFNGLBLENDBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glBlendBarrierNV")) == NULL) || r; - r = ((glBlendParameteriNV = (PFNGLBLENDPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glBlendParameteriNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_blend_equation_advanced */ - -#ifdef GL_NV_conditional_render - -static GLboolean _glewInit_GL_NV_conditional_render (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBeginConditionalRenderNV = (PFNGLBEGINCONDITIONALRENDERNVPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRenderNV")) == NULL) || r; - r = ((glEndConditionalRenderNV = (PFNGLENDCONDITIONALRENDERNVPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRenderNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_conditional_render */ - -#ifdef GL_NV_conservative_raster - -static GLboolean _glewInit_GL_NV_conservative_raster (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glSubpixelPrecisionBiasNV = (PFNGLSUBPIXELPRECISIONBIASNVPROC)glewGetProcAddress((const GLubyte*)"glSubpixelPrecisionBiasNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_conservative_raster */ - -#ifdef GL_NV_conservative_raster_dilate - -static GLboolean _glewInit_GL_NV_conservative_raster_dilate (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glConservativeRasterParameterfNV = (PFNGLCONSERVATIVERASTERPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glConservativeRasterParameterfNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_conservative_raster_dilate */ - -#ifdef GL_NV_copy_image - -static GLboolean _glewInit_GL_NV_copy_image (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCopyImageSubDataNV = (PFNGLCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glCopyImageSubDataNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_copy_image */ - -#ifdef GL_NV_depth_buffer_float - -static GLboolean _glewInit_GL_NV_depth_buffer_float (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glClearDepthdNV = (PFNGLCLEARDEPTHDNVPROC)glewGetProcAddress((const GLubyte*)"glClearDepthdNV")) == NULL) || r; - r = ((glDepthBoundsdNV = (PFNGLDEPTHBOUNDSDNVPROC)glewGetProcAddress((const GLubyte*)"glDepthBoundsdNV")) == NULL) || r; - r = ((glDepthRangedNV = (PFNGLDEPTHRANGEDNVPROC)glewGetProcAddress((const GLubyte*)"glDepthRangedNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_depth_buffer_float */ - -#ifdef GL_NV_draw_texture - -static GLboolean _glewInit_GL_NV_draw_texture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDrawTextureNV = (PFNGLDRAWTEXTURENVPROC)glewGetProcAddress((const GLubyte*)"glDrawTextureNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_draw_texture */ - -#ifdef GL_NV_evaluators - -static GLboolean _glewInit_GL_NV_evaluators (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glEvalMapsNV = (PFNGLEVALMAPSNVPROC)glewGetProcAddress((const GLubyte*)"glEvalMapsNV")) == NULL) || r; - r = ((glGetMapAttribParameterfvNV = (PFNGLGETMAPATTRIBPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapAttribParameterfvNV")) == NULL) || r; - r = ((glGetMapAttribParameterivNV = (PFNGLGETMAPATTRIBPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapAttribParameterivNV")) == NULL) || r; - r = ((glGetMapControlPointsNV = (PFNGLGETMAPCONTROLPOINTSNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapControlPointsNV")) == NULL) || r; - r = ((glGetMapParameterfvNV = (PFNGLGETMAPPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapParameterfvNV")) == NULL) || r; - r = ((glGetMapParameterivNV = (PFNGLGETMAPPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapParameterivNV")) == NULL) || r; - r = ((glMapControlPointsNV = (PFNGLMAPCONTROLPOINTSNVPROC)glewGetProcAddress((const GLubyte*)"glMapControlPointsNV")) == NULL) || r; - r = ((glMapParameterfvNV = (PFNGLMAPPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glMapParameterfvNV")) == NULL) || r; - r = ((glMapParameterivNV = (PFNGLMAPPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glMapParameterivNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_evaluators */ - -#ifdef GL_NV_explicit_multisample - -static GLboolean _glewInit_GL_NV_explicit_multisample (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetMultisamplefvNV = (PFNGLGETMULTISAMPLEFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMultisamplefvNV")) == NULL) || r; - r = ((glSampleMaskIndexedNV = (PFNGLSAMPLEMASKINDEXEDNVPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskIndexedNV")) == NULL) || r; - r = ((glTexRenderbufferNV = (PFNGLTEXRENDERBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"glTexRenderbufferNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_explicit_multisample */ - -#ifdef GL_NV_fence - -static GLboolean _glewInit_GL_NV_fence (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDeleteFencesNV = (PFNGLDELETEFENCESNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteFencesNV")) == NULL) || r; - r = ((glFinishFenceNV = (PFNGLFINISHFENCENVPROC)glewGetProcAddress((const GLubyte*)"glFinishFenceNV")) == NULL) || r; - r = ((glGenFencesNV = (PFNGLGENFENCESNVPROC)glewGetProcAddress((const GLubyte*)"glGenFencesNV")) == NULL) || r; - r = ((glGetFenceivNV = (PFNGLGETFENCEIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFenceivNV")) == NULL) || r; - r = ((glIsFenceNV = (PFNGLISFENCENVPROC)glewGetProcAddress((const GLubyte*)"glIsFenceNV")) == NULL) || r; - r = ((glSetFenceNV = (PFNGLSETFENCENVPROC)glewGetProcAddress((const GLubyte*)"glSetFenceNV")) == NULL) || r; - r = ((glTestFenceNV = (PFNGLTESTFENCENVPROC)glewGetProcAddress((const GLubyte*)"glTestFenceNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_fence */ - -#ifdef GL_NV_fragment_coverage_to_color - -static GLboolean _glewInit_GL_NV_fragment_coverage_to_color (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFragmentCoverageColorNV = (PFNGLFRAGMENTCOVERAGECOLORNVPROC)glewGetProcAddress((const GLubyte*)"glFragmentCoverageColorNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_fragment_coverage_to_color */ - -#ifdef GL_NV_fragment_program - -static GLboolean _glewInit_GL_NV_fragment_program (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetProgramNamedParameterdvNV = (PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramNamedParameterdvNV")) == NULL) || r; - r = ((glGetProgramNamedParameterfvNV = (PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramNamedParameterfvNV")) == NULL) || r; - r = ((glProgramNamedParameter4dNV = (PFNGLPROGRAMNAMEDPARAMETER4DNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4dNV")) == NULL) || r; - r = ((glProgramNamedParameter4dvNV = (PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4dvNV")) == NULL) || r; - r = ((glProgramNamedParameter4fNV = (PFNGLPROGRAMNAMEDPARAMETER4FNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4fNV")) == NULL) || r; - r = ((glProgramNamedParameter4fvNV = (PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4fvNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_fragment_program */ - -#ifdef GL_NV_framebuffer_multisample_coverage - -static GLboolean _glewInit_GL_NV_framebuffer_multisample_coverage (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glRenderbufferStorageMultisampleCoverageNV = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleCoverageNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_framebuffer_multisample_coverage */ - -#ifdef GL_NV_geometry_program4 - -static GLboolean _glewInit_GL_NV_geometry_program4 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glProgramVertexLimitNV = (PFNGLPROGRAMVERTEXLIMITNVPROC)glewGetProcAddress((const GLubyte*)"glProgramVertexLimitNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_geometry_program4 */ - -#ifdef GL_NV_gpu_program4 - -static GLboolean _glewInit_GL_NV_gpu_program4 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glProgramEnvParameterI4iNV = (PFNGLPROGRAMENVPARAMETERI4INVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4iNV")) == NULL) || r; - r = ((glProgramEnvParameterI4ivNV = (PFNGLPROGRAMENVPARAMETERI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4ivNV")) == NULL) || r; - r = ((glProgramEnvParameterI4uiNV = (PFNGLPROGRAMENVPARAMETERI4UINVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4uiNV")) == NULL) || r; - r = ((glProgramEnvParameterI4uivNV = (PFNGLPROGRAMENVPARAMETERI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4uivNV")) == NULL) || r; - r = ((glProgramEnvParametersI4ivNV = (PFNGLPROGRAMENVPARAMETERSI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParametersI4ivNV")) == NULL) || r; - r = ((glProgramEnvParametersI4uivNV = (PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParametersI4uivNV")) == NULL) || r; - r = ((glProgramLocalParameterI4iNV = (PFNGLPROGRAMLOCALPARAMETERI4INVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4iNV")) == NULL) || r; - r = ((glProgramLocalParameterI4ivNV = (PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4ivNV")) == NULL) || r; - r = ((glProgramLocalParameterI4uiNV = (PFNGLPROGRAMLOCALPARAMETERI4UINVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4uiNV")) == NULL) || r; - r = ((glProgramLocalParameterI4uivNV = (PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4uivNV")) == NULL) || r; - r = ((glProgramLocalParametersI4ivNV = (PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParametersI4ivNV")) == NULL) || r; - r = ((glProgramLocalParametersI4uivNV = (PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParametersI4uivNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_gpu_program4 */ - -#ifdef GL_NV_gpu_shader5 - -static GLboolean _glewInit_GL_NV_gpu_shader5 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetUniformi64vNV = (PFNGLGETUNIFORMI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformi64vNV")) == NULL) || r; - r = ((glGetUniformui64vNV = (PFNGLGETUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformui64vNV")) == NULL) || r; - r = ((glProgramUniform1i64NV = (PFNGLPROGRAMUNIFORM1I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64NV")) == NULL) || r; - r = ((glProgramUniform1i64vNV = (PFNGLPROGRAMUNIFORM1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64vNV")) == NULL) || r; - r = ((glProgramUniform1ui64NV = (PFNGLPROGRAMUNIFORM1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64NV")) == NULL) || r; - r = ((glProgramUniform1ui64vNV = (PFNGLPROGRAMUNIFORM1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64vNV")) == NULL) || r; - r = ((glProgramUniform2i64NV = (PFNGLPROGRAMUNIFORM2I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64NV")) == NULL) || r; - r = ((glProgramUniform2i64vNV = (PFNGLPROGRAMUNIFORM2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64vNV")) == NULL) || r; - r = ((glProgramUniform2ui64NV = (PFNGLPROGRAMUNIFORM2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64NV")) == NULL) || r; - r = ((glProgramUniform2ui64vNV = (PFNGLPROGRAMUNIFORM2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64vNV")) == NULL) || r; - r = ((glProgramUniform3i64NV = (PFNGLPROGRAMUNIFORM3I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64NV")) == NULL) || r; - r = ((glProgramUniform3i64vNV = (PFNGLPROGRAMUNIFORM3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64vNV")) == NULL) || r; - r = ((glProgramUniform3ui64NV = (PFNGLPROGRAMUNIFORM3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64NV")) == NULL) || r; - r = ((glProgramUniform3ui64vNV = (PFNGLPROGRAMUNIFORM3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64vNV")) == NULL) || r; - r = ((glProgramUniform4i64NV = (PFNGLPROGRAMUNIFORM4I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64NV")) == NULL) || r; - r = ((glProgramUniform4i64vNV = (PFNGLPROGRAMUNIFORM4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64vNV")) == NULL) || r; - r = ((glProgramUniform4ui64NV = (PFNGLPROGRAMUNIFORM4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64NV")) == NULL) || r; - r = ((glProgramUniform4ui64vNV = (PFNGLPROGRAMUNIFORM4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64vNV")) == NULL) || r; - r = ((glUniform1i64NV = (PFNGLUNIFORM1I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64NV")) == NULL) || r; - r = ((glUniform1i64vNV = (PFNGLUNIFORM1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64vNV")) == NULL) || r; - r = ((glUniform1ui64NV = (PFNGLUNIFORM1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64NV")) == NULL) || r; - r = ((glUniform1ui64vNV = (PFNGLUNIFORM1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64vNV")) == NULL) || r; - r = ((glUniform2i64NV = (PFNGLUNIFORM2I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64NV")) == NULL) || r; - r = ((glUniform2i64vNV = (PFNGLUNIFORM2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64vNV")) == NULL) || r; - r = ((glUniform2ui64NV = (PFNGLUNIFORM2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64NV")) == NULL) || r; - r = ((glUniform2ui64vNV = (PFNGLUNIFORM2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64vNV")) == NULL) || r; - r = ((glUniform3i64NV = (PFNGLUNIFORM3I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64NV")) == NULL) || r; - r = ((glUniform3i64vNV = (PFNGLUNIFORM3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64vNV")) == NULL) || r; - r = ((glUniform3ui64NV = (PFNGLUNIFORM3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64NV")) == NULL) || r; - r = ((glUniform3ui64vNV = (PFNGLUNIFORM3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64vNV")) == NULL) || r; - r = ((glUniform4i64NV = (PFNGLUNIFORM4I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64NV")) == NULL) || r; - r = ((glUniform4i64vNV = (PFNGLUNIFORM4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64vNV")) == NULL) || r; - r = ((glUniform4ui64NV = (PFNGLUNIFORM4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64NV")) == NULL) || r; - r = ((glUniform4ui64vNV = (PFNGLUNIFORM4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64vNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_gpu_shader5 */ - -#ifdef GL_NV_half_float - -static GLboolean _glewInit_GL_NV_half_float (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glColor3hNV = (PFNGLCOLOR3HNVPROC)glewGetProcAddress((const GLubyte*)"glColor3hNV")) == NULL) || r; - r = ((glColor3hvNV = (PFNGLCOLOR3HVNVPROC)glewGetProcAddress((const GLubyte*)"glColor3hvNV")) == NULL) || r; - r = ((glColor4hNV = (PFNGLCOLOR4HNVPROC)glewGetProcAddress((const GLubyte*)"glColor4hNV")) == NULL) || r; - r = ((glColor4hvNV = (PFNGLCOLOR4HVNVPROC)glewGetProcAddress((const GLubyte*)"glColor4hvNV")) == NULL) || r; - r = ((glFogCoordhNV = (PFNGLFOGCOORDHNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordhNV")) == NULL) || r; - r = ((glFogCoordhvNV = (PFNGLFOGCOORDHVNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordhvNV")) == NULL) || r; - r = ((glMultiTexCoord1hNV = (PFNGLMULTITEXCOORD1HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1hNV")) == NULL) || r; - r = ((glMultiTexCoord1hvNV = (PFNGLMULTITEXCOORD1HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1hvNV")) == NULL) || r; - r = ((glMultiTexCoord2hNV = (PFNGLMULTITEXCOORD2HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2hNV")) == NULL) || r; - r = ((glMultiTexCoord2hvNV = (PFNGLMULTITEXCOORD2HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2hvNV")) == NULL) || r; - r = ((glMultiTexCoord3hNV = (PFNGLMULTITEXCOORD3HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3hNV")) == NULL) || r; - r = ((glMultiTexCoord3hvNV = (PFNGLMULTITEXCOORD3HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3hvNV")) == NULL) || r; - r = ((glMultiTexCoord4hNV = (PFNGLMULTITEXCOORD4HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4hNV")) == NULL) || r; - r = ((glMultiTexCoord4hvNV = (PFNGLMULTITEXCOORD4HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4hvNV")) == NULL) || r; - r = ((glNormal3hNV = (PFNGLNORMAL3HNVPROC)glewGetProcAddress((const GLubyte*)"glNormal3hNV")) == NULL) || r; - r = ((glNormal3hvNV = (PFNGLNORMAL3HVNVPROC)glewGetProcAddress((const GLubyte*)"glNormal3hvNV")) == NULL) || r; - r = ((glSecondaryColor3hNV = (PFNGLSECONDARYCOLOR3HNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3hNV")) == NULL) || r; - r = ((glSecondaryColor3hvNV = (PFNGLSECONDARYCOLOR3HVNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3hvNV")) == NULL) || r; - r = ((glTexCoord1hNV = (PFNGLTEXCOORD1HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord1hNV")) == NULL) || r; - r = ((glTexCoord1hvNV = (PFNGLTEXCOORD1HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord1hvNV")) == NULL) || r; - r = ((glTexCoord2hNV = (PFNGLTEXCOORD2HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2hNV")) == NULL) || r; - r = ((glTexCoord2hvNV = (PFNGLTEXCOORD2HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2hvNV")) == NULL) || r; - r = ((glTexCoord3hNV = (PFNGLTEXCOORD3HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord3hNV")) == NULL) || r; - r = ((glTexCoord3hvNV = (PFNGLTEXCOORD3HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord3hvNV")) == NULL) || r; - r = ((glTexCoord4hNV = (PFNGLTEXCOORD4HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4hNV")) == NULL) || r; - r = ((glTexCoord4hvNV = (PFNGLTEXCOORD4HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4hvNV")) == NULL) || r; - r = ((glVertex2hNV = (PFNGLVERTEX2HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex2hNV")) == NULL) || r; - r = ((glVertex2hvNV = (PFNGLVERTEX2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex2hvNV")) == NULL) || r; - r = ((glVertex3hNV = (PFNGLVERTEX3HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex3hNV")) == NULL) || r; - r = ((glVertex3hvNV = (PFNGLVERTEX3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex3hvNV")) == NULL) || r; - r = ((glVertex4hNV = (PFNGLVERTEX4HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex4hNV")) == NULL) || r; - r = ((glVertex4hvNV = (PFNGLVERTEX4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex4hvNV")) == NULL) || r; - r = ((glVertexAttrib1hNV = (PFNGLVERTEXATTRIB1HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1hNV")) == NULL) || r; - r = ((glVertexAttrib1hvNV = (PFNGLVERTEXATTRIB1HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1hvNV")) == NULL) || r; - r = ((glVertexAttrib2hNV = (PFNGLVERTEXATTRIB2HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2hNV")) == NULL) || r; - r = ((glVertexAttrib2hvNV = (PFNGLVERTEXATTRIB2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2hvNV")) == NULL) || r; - r = ((glVertexAttrib3hNV = (PFNGLVERTEXATTRIB3HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3hNV")) == NULL) || r; - r = ((glVertexAttrib3hvNV = (PFNGLVERTEXATTRIB3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3hvNV")) == NULL) || r; - r = ((glVertexAttrib4hNV = (PFNGLVERTEXATTRIB4HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4hNV")) == NULL) || r; - r = ((glVertexAttrib4hvNV = (PFNGLVERTEXATTRIB4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4hvNV")) == NULL) || r; - r = ((glVertexAttribs1hvNV = (PFNGLVERTEXATTRIBS1HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1hvNV")) == NULL) || r; - r = ((glVertexAttribs2hvNV = (PFNGLVERTEXATTRIBS2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2hvNV")) == NULL) || r; - r = ((glVertexAttribs3hvNV = (PFNGLVERTEXATTRIBS3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3hvNV")) == NULL) || r; - r = ((glVertexAttribs4hvNV = (PFNGLVERTEXATTRIBS4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4hvNV")) == NULL) || r; - r = ((glVertexWeighthNV = (PFNGLVERTEXWEIGHTHNVPROC)glewGetProcAddress((const GLubyte*)"glVertexWeighthNV")) == NULL) || r; - r = ((glVertexWeighthvNV = (PFNGLVERTEXWEIGHTHVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexWeighthvNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_half_float */ - -#ifdef GL_NV_internalformat_sample_query - -static GLboolean _glewInit_GL_NV_internalformat_sample_query (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetInternalformatSampleivNV = (PFNGLGETINTERNALFORMATSAMPLEIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetInternalformatSampleivNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_internalformat_sample_query */ - -#ifdef GL_NV_occlusion_query - -static GLboolean _glewInit_GL_NV_occlusion_query (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBeginOcclusionQueryNV = (PFNGLBEGINOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glBeginOcclusionQueryNV")) == NULL) || r; - r = ((glDeleteOcclusionQueriesNV = (PFNGLDELETEOCCLUSIONQUERIESNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteOcclusionQueriesNV")) == NULL) || r; - r = ((glEndOcclusionQueryNV = (PFNGLENDOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glEndOcclusionQueryNV")) == NULL) || r; - r = ((glGenOcclusionQueriesNV = (PFNGLGENOCCLUSIONQUERIESNVPROC)glewGetProcAddress((const GLubyte*)"glGenOcclusionQueriesNV")) == NULL) || r; - r = ((glGetOcclusionQueryivNV = (PFNGLGETOCCLUSIONQUERYIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetOcclusionQueryivNV")) == NULL) || r; - r = ((glGetOcclusionQueryuivNV = (PFNGLGETOCCLUSIONQUERYUIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetOcclusionQueryuivNV")) == NULL) || r; - r = ((glIsOcclusionQueryNV = (PFNGLISOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glIsOcclusionQueryNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_occlusion_query */ - -#ifdef GL_NV_parameter_buffer_object - -static GLboolean _glewInit_GL_NV_parameter_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glProgramBufferParametersIivNV = (PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersIivNV")) == NULL) || r; - r = ((glProgramBufferParametersIuivNV = (PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersIuivNV")) == NULL) || r; - r = ((glProgramBufferParametersfvNV = (PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersfvNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_parameter_buffer_object */ - -#ifdef GL_NV_path_rendering - -static GLboolean _glewInit_GL_NV_path_rendering (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCopyPathNV = (PFNGLCOPYPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCopyPathNV")) == NULL) || r; - r = ((glCoverFillPathInstancedNV = (PFNGLCOVERFILLPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glCoverFillPathInstancedNV")) == NULL) || r; - r = ((glCoverFillPathNV = (PFNGLCOVERFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCoverFillPathNV")) == NULL) || r; - r = ((glCoverStrokePathInstancedNV = (PFNGLCOVERSTROKEPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glCoverStrokePathInstancedNV")) == NULL) || r; - r = ((glCoverStrokePathNV = (PFNGLCOVERSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCoverStrokePathNV")) == NULL) || r; - r = ((glDeletePathsNV = (PFNGLDELETEPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glDeletePathsNV")) == NULL) || r; - r = ((glGenPathsNV = (PFNGLGENPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glGenPathsNV")) == NULL) || r; - r = ((glGetPathColorGenfvNV = (PFNGLGETPATHCOLORGENFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathColorGenfvNV")) == NULL) || r; - r = ((glGetPathColorGenivNV = (PFNGLGETPATHCOLORGENIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathColorGenivNV")) == NULL) || r; - r = ((glGetPathCommandsNV = (PFNGLGETPATHCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathCommandsNV")) == NULL) || r; - r = ((glGetPathCoordsNV = (PFNGLGETPATHCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathCoordsNV")) == NULL) || r; - r = ((glGetPathDashArrayNV = (PFNGLGETPATHDASHARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathDashArrayNV")) == NULL) || r; - r = ((glGetPathLengthNV = (PFNGLGETPATHLENGTHNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathLengthNV")) == NULL) || r; - r = ((glGetPathMetricRangeNV = (PFNGLGETPATHMETRICRANGENVPROC)glewGetProcAddress((const GLubyte*)"glGetPathMetricRangeNV")) == NULL) || r; - r = ((glGetPathMetricsNV = (PFNGLGETPATHMETRICSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathMetricsNV")) == NULL) || r; - r = ((glGetPathParameterfvNV = (PFNGLGETPATHPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathParameterfvNV")) == NULL) || r; - r = ((glGetPathParameterivNV = (PFNGLGETPATHPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathParameterivNV")) == NULL) || r; - r = ((glGetPathSpacingNV = (PFNGLGETPATHSPACINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathSpacingNV")) == NULL) || r; - r = ((glGetPathTexGenfvNV = (PFNGLGETPATHTEXGENFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathTexGenfvNV")) == NULL) || r; - r = ((glGetPathTexGenivNV = (PFNGLGETPATHTEXGENIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathTexGenivNV")) == NULL) || r; - r = ((glGetProgramResourcefvNV = (PFNGLGETPROGRAMRESOURCEFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourcefvNV")) == NULL) || r; - r = ((glInterpolatePathsNV = (PFNGLINTERPOLATEPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glInterpolatePathsNV")) == NULL) || r; - r = ((glIsPathNV = (PFNGLISPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPathNV")) == NULL) || r; - r = ((glIsPointInFillPathNV = (PFNGLISPOINTINFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPointInFillPathNV")) == NULL) || r; - r = ((glIsPointInStrokePathNV = (PFNGLISPOINTINSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPointInStrokePathNV")) == NULL) || r; - r = ((glMatrixLoad3x2fNV = (PFNGLMATRIXLOAD3X2FNVPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoad3x2fNV")) == NULL) || r; - r = ((glMatrixLoad3x3fNV = (PFNGLMATRIXLOAD3X3FNVPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoad3x3fNV")) == NULL) || r; - r = ((glMatrixLoadTranspose3x3fNV = (PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTranspose3x3fNV")) == NULL) || r; - r = ((glMatrixMult3x2fNV = (PFNGLMATRIXMULT3X2FNVPROC)glewGetProcAddress((const GLubyte*)"glMatrixMult3x2fNV")) == NULL) || r; - r = ((glMatrixMult3x3fNV = (PFNGLMATRIXMULT3X3FNVPROC)glewGetProcAddress((const GLubyte*)"glMatrixMult3x3fNV")) == NULL) || r; - r = ((glMatrixMultTranspose3x3fNV = (PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTranspose3x3fNV")) == NULL) || r; - r = ((glPathColorGenNV = (PFNGLPATHCOLORGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathColorGenNV")) == NULL) || r; - r = ((glPathCommandsNV = (PFNGLPATHCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathCommandsNV")) == NULL) || r; - r = ((glPathCoordsNV = (PFNGLPATHCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathCoordsNV")) == NULL) || r; - r = ((glPathCoverDepthFuncNV = (PFNGLPATHCOVERDEPTHFUNCNVPROC)glewGetProcAddress((const GLubyte*)"glPathCoverDepthFuncNV")) == NULL) || r; - r = ((glPathDashArrayNV = (PFNGLPATHDASHARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glPathDashArrayNV")) == NULL) || r; - r = ((glPathFogGenNV = (PFNGLPATHFOGGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathFogGenNV")) == NULL) || r; - r = ((glPathGlyphIndexArrayNV = (PFNGLPATHGLYPHINDEXARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphIndexArrayNV")) == NULL) || r; - r = ((glPathGlyphIndexRangeNV = (PFNGLPATHGLYPHINDEXRANGENVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphIndexRangeNV")) == NULL) || r; - r = ((glPathGlyphRangeNV = (PFNGLPATHGLYPHRANGENVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphRangeNV")) == NULL) || r; - r = ((glPathGlyphsNV = (PFNGLPATHGLYPHSNVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphsNV")) == NULL) || r; - r = ((glPathMemoryGlyphIndexArrayNV = (PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glPathMemoryGlyphIndexArrayNV")) == NULL) || r; - r = ((glPathParameterfNV = (PFNGLPATHPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterfNV")) == NULL) || r; - r = ((glPathParameterfvNV = (PFNGLPATHPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterfvNV")) == NULL) || r; - r = ((glPathParameteriNV = (PFNGLPATHPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glPathParameteriNV")) == NULL) || r; - r = ((glPathParameterivNV = (PFNGLPATHPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterivNV")) == NULL) || r; - r = ((glPathStencilDepthOffsetNV = (PFNGLPATHSTENCILDEPTHOFFSETNVPROC)glewGetProcAddress((const GLubyte*)"glPathStencilDepthOffsetNV")) == NULL) || r; - r = ((glPathStencilFuncNV = (PFNGLPATHSTENCILFUNCNVPROC)glewGetProcAddress((const GLubyte*)"glPathStencilFuncNV")) == NULL) || r; - r = ((glPathStringNV = (PFNGLPATHSTRINGNVPROC)glewGetProcAddress((const GLubyte*)"glPathStringNV")) == NULL) || r; - r = ((glPathSubCommandsNV = (PFNGLPATHSUBCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathSubCommandsNV")) == NULL) || r; - r = ((glPathSubCoordsNV = (PFNGLPATHSUBCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathSubCoordsNV")) == NULL) || r; - r = ((glPathTexGenNV = (PFNGLPATHTEXGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathTexGenNV")) == NULL) || r; - r = ((glPointAlongPathNV = (PFNGLPOINTALONGPATHNVPROC)glewGetProcAddress((const GLubyte*)"glPointAlongPathNV")) == NULL) || r; - r = ((glProgramPathFragmentInputGenNV = (PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC)glewGetProcAddress((const GLubyte*)"glProgramPathFragmentInputGenNV")) == NULL) || r; - r = ((glStencilFillPathInstancedNV = (PFNGLSTENCILFILLPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilFillPathInstancedNV")) == NULL) || r; - r = ((glStencilFillPathNV = (PFNGLSTENCILFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilFillPathNV")) == NULL) || r; - r = ((glStencilStrokePathInstancedNV = (PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilStrokePathInstancedNV")) == NULL) || r; - r = ((glStencilStrokePathNV = (PFNGLSTENCILSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilStrokePathNV")) == NULL) || r; - r = ((glStencilThenCoverFillPathInstancedNV = (PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilThenCoverFillPathInstancedNV")) == NULL) || r; - r = ((glStencilThenCoverFillPathNV = (PFNGLSTENCILTHENCOVERFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilThenCoverFillPathNV")) == NULL) || r; - r = ((glStencilThenCoverStrokePathInstancedNV = (PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilThenCoverStrokePathInstancedNV")) == NULL) || r; - r = ((glStencilThenCoverStrokePathNV = (PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilThenCoverStrokePathNV")) == NULL) || r; - r = ((glTransformPathNV = (PFNGLTRANSFORMPATHNVPROC)glewGetProcAddress((const GLubyte*)"glTransformPathNV")) == NULL) || r; - r = ((glWeightPathsNV = (PFNGLWEIGHTPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glWeightPathsNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_path_rendering */ - -#ifdef GL_NV_pixel_data_range - -static GLboolean _glewInit_GL_NV_pixel_data_range (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFlushPixelDataRangeNV = (PFNGLFLUSHPIXELDATARANGENVPROC)glewGetProcAddress((const GLubyte*)"glFlushPixelDataRangeNV")) == NULL) || r; - r = ((glPixelDataRangeNV = (PFNGLPIXELDATARANGENVPROC)glewGetProcAddress((const GLubyte*)"glPixelDataRangeNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_pixel_data_range */ - -#ifdef GL_NV_point_sprite - -static GLboolean _glewInit_GL_NV_point_sprite (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glPointParameteriNV = (PFNGLPOINTPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glPointParameteriNV")) == NULL) || r; - r = ((glPointParameterivNV = (PFNGLPOINTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterivNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_point_sprite */ - -#ifdef GL_NV_present_video - -static GLboolean _glewInit_GL_NV_present_video (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetVideoi64vNV = (PFNGLGETVIDEOI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoi64vNV")) == NULL) || r; - r = ((glGetVideoivNV = (PFNGLGETVIDEOIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoivNV")) == NULL) || r; - r = ((glGetVideoui64vNV = (PFNGLGETVIDEOUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoui64vNV")) == NULL) || r; - r = ((glGetVideouivNV = (PFNGLGETVIDEOUIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideouivNV")) == NULL) || r; - r = ((glPresentFrameDualFillNV = (PFNGLPRESENTFRAMEDUALFILLNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameDualFillNV")) == NULL) || r; - r = ((glPresentFrameKeyedNV = (PFNGLPRESENTFRAMEKEYEDNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameKeyedNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_present_video */ - -#ifdef GL_NV_primitive_restart - -static GLboolean _glewInit_GL_NV_primitive_restart (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glPrimitiveRestartIndexNV = (PFNGLPRIMITIVERESTARTINDEXNVPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartIndexNV")) == NULL) || r; - r = ((glPrimitiveRestartNV = (PFNGLPRIMITIVERESTARTNVPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_primitive_restart */ - -#ifdef GL_NV_register_combiners - -static GLboolean _glewInit_GL_NV_register_combiners (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCombinerInputNV = (PFNGLCOMBINERINPUTNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerInputNV")) == NULL) || r; - r = ((glCombinerOutputNV = (PFNGLCOMBINEROUTPUTNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerOutputNV")) == NULL) || r; - r = ((glCombinerParameterfNV = (PFNGLCOMBINERPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterfNV")) == NULL) || r; - r = ((glCombinerParameterfvNV = (PFNGLCOMBINERPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterfvNV")) == NULL) || r; - r = ((glCombinerParameteriNV = (PFNGLCOMBINERPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameteriNV")) == NULL) || r; - r = ((glCombinerParameterivNV = (PFNGLCOMBINERPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterivNV")) == NULL) || r; - r = ((glFinalCombinerInputNV = (PFNGLFINALCOMBINERINPUTNVPROC)glewGetProcAddress((const GLubyte*)"glFinalCombinerInputNV")) == NULL) || r; - r = ((glGetCombinerInputParameterfvNV = (PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerInputParameterfvNV")) == NULL) || r; - r = ((glGetCombinerInputParameterivNV = (PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerInputParameterivNV")) == NULL) || r; - r = ((glGetCombinerOutputParameterfvNV = (PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerOutputParameterfvNV")) == NULL) || r; - r = ((glGetCombinerOutputParameterivNV = (PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerOutputParameterivNV")) == NULL) || r; - r = ((glGetFinalCombinerInputParameterfvNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFinalCombinerInputParameterfvNV")) == NULL) || r; - r = ((glGetFinalCombinerInputParameterivNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFinalCombinerInputParameterivNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_register_combiners */ - -#ifdef GL_NV_register_combiners2 - -static GLboolean _glewInit_GL_NV_register_combiners2 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glCombinerStageParameterfvNV = (PFNGLCOMBINERSTAGEPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerStageParameterfvNV")) == NULL) || r; - r = ((glGetCombinerStageParameterfvNV = (PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerStageParameterfvNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_register_combiners2 */ - -#ifdef GL_NV_sample_locations - -static GLboolean _glewInit_GL_NV_sample_locations (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFramebufferSampleLocationsfvNV = (PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)glewGetProcAddress((const GLubyte*)"glFramebufferSampleLocationsfvNV")) == NULL) || r; - r = ((glNamedFramebufferSampleLocationsfvNV = (PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferSampleLocationsfvNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_sample_locations */ - -#ifdef GL_NV_shader_buffer_load - -static GLboolean _glewInit_GL_NV_shader_buffer_load (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetBufferParameterui64vNV = (PFNGLGETBUFFERPARAMETERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameterui64vNV")) == NULL) || r; - r = ((glGetIntegerui64vNV = (PFNGLGETINTEGERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerui64vNV")) == NULL) || r; - r = ((glGetNamedBufferParameterui64vNV = (PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameterui64vNV")) == NULL) || r; - r = ((glIsBufferResidentNV = (PFNGLISBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsBufferResidentNV")) == NULL) || r; - r = ((glIsNamedBufferResidentNV = (PFNGLISNAMEDBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsNamedBufferResidentNV")) == NULL) || r; - r = ((glMakeBufferNonResidentNV = (PFNGLMAKEBUFFERNONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeBufferNonResidentNV")) == NULL) || r; - r = ((glMakeBufferResidentNV = (PFNGLMAKEBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeBufferResidentNV")) == NULL) || r; - r = ((glMakeNamedBufferNonResidentNV = (PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeNamedBufferNonResidentNV")) == NULL) || r; - r = ((glMakeNamedBufferResidentNV = (PFNGLMAKENAMEDBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeNamedBufferResidentNV")) == NULL) || r; - r = ((glProgramUniformui64NV = (PFNGLPROGRAMUNIFORMUI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformui64NV")) == NULL) || r; - r = ((glProgramUniformui64vNV = (PFNGLPROGRAMUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformui64vNV")) == NULL) || r; - r = ((glUniformui64NV = (PFNGLUNIFORMUI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniformui64NV")) == NULL) || r; - r = ((glUniformui64vNV = (PFNGLUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniformui64vNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_shader_buffer_load */ - -#ifdef GL_NV_texture_barrier - -static GLboolean _glewInit_GL_NV_texture_barrier (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTextureBarrierNV = (PFNGLTEXTUREBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glTextureBarrierNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_texture_barrier */ - -#ifdef GL_NV_texture_multisample - -static GLboolean _glewInit_GL_NV_texture_multisample (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTexImage2DMultisampleCoverageNV = (PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTexImage2DMultisampleCoverageNV")) == NULL) || r; - r = ((glTexImage3DMultisampleCoverageNV = (PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DMultisampleCoverageNV")) == NULL) || r; - r = ((glTextureImage2DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DMultisampleCoverageNV")) == NULL) || r; - r = ((glTextureImage2DMultisampleNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DMultisampleNV")) == NULL) || r; - r = ((glTextureImage3DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DMultisampleCoverageNV")) == NULL) || r; - r = ((glTextureImage3DMultisampleNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DMultisampleNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_texture_multisample */ - -#ifdef GL_NV_transform_feedback - -static GLboolean _glewInit_GL_NV_transform_feedback (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glActiveVaryingNV = (PFNGLACTIVEVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glActiveVaryingNV")) == NULL) || r; - r = ((glBeginTransformFeedbackNV = (PFNGLBEGINTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedbackNV")) == NULL) || r; - r = ((glBindBufferBaseNV = (PFNGLBINDBUFFERBASENVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBaseNV")) == NULL) || r; - r = ((glBindBufferOffsetNV = (PFNGLBINDBUFFEROFFSETNVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferOffsetNV")) == NULL) || r; - r = ((glBindBufferRangeNV = (PFNGLBINDBUFFERRANGENVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRangeNV")) == NULL) || r; - r = ((glEndTransformFeedbackNV = (PFNGLENDTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedbackNV")) == NULL) || r; - r = ((glGetActiveVaryingNV = (PFNGLGETACTIVEVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveVaryingNV")) == NULL) || r; - r = ((glGetTransformFeedbackVaryingNV = (PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVaryingNV")) == NULL) || r; - r = ((glGetVaryingLocationNV = (PFNGLGETVARYINGLOCATIONNVPROC)glewGetProcAddress((const GLubyte*)"glGetVaryingLocationNV")) == NULL) || r; - r = ((glTransformFeedbackAttribsNV = (PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackAttribsNV")) == NULL) || r; - r = ((glTransformFeedbackVaryingsNV = (PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryingsNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_transform_feedback */ - -#ifdef GL_NV_transform_feedback2 - -static GLboolean _glewInit_GL_NV_transform_feedback2 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBindTransformFeedbackNV = (PFNGLBINDTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glBindTransformFeedbackNV")) == NULL) || r; - r = ((glDeleteTransformFeedbacksNV = (PFNGLDELETETRANSFORMFEEDBACKSNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteTransformFeedbacksNV")) == NULL) || r; - r = ((glDrawTransformFeedbackNV = (PFNGLDRAWTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackNV")) == NULL) || r; - r = ((glGenTransformFeedbacksNV = (PFNGLGENTRANSFORMFEEDBACKSNVPROC)glewGetProcAddress((const GLubyte*)"glGenTransformFeedbacksNV")) == NULL) || r; - r = ((glIsTransformFeedbackNV = (PFNGLISTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glIsTransformFeedbackNV")) == NULL) || r; - r = ((glPauseTransformFeedbackNV = (PFNGLPAUSETRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glPauseTransformFeedbackNV")) == NULL) || r; - r = ((glResumeTransformFeedbackNV = (PFNGLRESUMETRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glResumeTransformFeedbackNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_transform_feedback2 */ - -#ifdef GL_NV_vdpau_interop - -static GLboolean _glewInit_GL_NV_vdpau_interop (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glVDPAUFiniNV = (PFNGLVDPAUFININVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUFiniNV")) == NULL) || r; - r = ((glVDPAUGetSurfaceivNV = (PFNGLVDPAUGETSURFACEIVNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUGetSurfaceivNV")) == NULL) || r; - r = ((glVDPAUInitNV = (PFNGLVDPAUINITNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUInitNV")) == NULL) || r; - r = ((glVDPAUIsSurfaceNV = (PFNGLVDPAUISSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUIsSurfaceNV")) == NULL) || r; - r = ((glVDPAUMapSurfacesNV = (PFNGLVDPAUMAPSURFACESNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUMapSurfacesNV")) == NULL) || r; - r = ((glVDPAURegisterOutputSurfaceNV = (PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAURegisterOutputSurfaceNV")) == NULL) || r; - r = ((glVDPAURegisterVideoSurfaceNV = (PFNGLVDPAUREGISTERVIDEOSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAURegisterVideoSurfaceNV")) == NULL) || r; - r = ((glVDPAUSurfaceAccessNV = (PFNGLVDPAUSURFACEACCESSNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUSurfaceAccessNV")) == NULL) || r; - r = ((glVDPAUUnmapSurfacesNV = (PFNGLVDPAUUNMAPSURFACESNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUUnmapSurfacesNV")) == NULL) || r; - r = ((glVDPAUUnregisterSurfaceNV = (PFNGLVDPAUUNREGISTERSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUUnregisterSurfaceNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_vdpau_interop */ - -#ifdef GL_NV_vertex_array_range - -static GLboolean _glewInit_GL_NV_vertex_array_range (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFlushVertexArrayRangeNV = (PFNGLFLUSHVERTEXARRAYRANGENVPROC)glewGetProcAddress((const GLubyte*)"glFlushVertexArrayRangeNV")) == NULL) || r; - r = ((glVertexArrayRangeNV = (PFNGLVERTEXARRAYRANGENVPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayRangeNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_vertex_array_range */ - -#ifdef GL_NV_vertex_attrib_integer_64bit - -static GLboolean _glewInit_GL_NV_vertex_attrib_integer_64bit (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetVertexAttribLi64vNV = (PFNGLGETVERTEXATTRIBLI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLi64vNV")) == NULL) || r; - r = ((glGetVertexAttribLui64vNV = (PFNGLGETVERTEXATTRIBLUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLui64vNV")) == NULL) || r; - r = ((glVertexAttribL1i64NV = (PFNGLVERTEXATTRIBL1I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1i64NV")) == NULL) || r; - r = ((glVertexAttribL1i64vNV = (PFNGLVERTEXATTRIBL1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1i64vNV")) == NULL) || r; - r = ((glVertexAttribL1ui64NV = (PFNGLVERTEXATTRIBL1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64NV")) == NULL) || r; - r = ((glVertexAttribL1ui64vNV = (PFNGLVERTEXATTRIBL1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64vNV")) == NULL) || r; - r = ((glVertexAttribL2i64NV = (PFNGLVERTEXATTRIBL2I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2i64NV")) == NULL) || r; - r = ((glVertexAttribL2i64vNV = (PFNGLVERTEXATTRIBL2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2i64vNV")) == NULL) || r; - r = ((glVertexAttribL2ui64NV = (PFNGLVERTEXATTRIBL2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2ui64NV")) == NULL) || r; - r = ((glVertexAttribL2ui64vNV = (PFNGLVERTEXATTRIBL2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2ui64vNV")) == NULL) || r; - r = ((glVertexAttribL3i64NV = (PFNGLVERTEXATTRIBL3I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3i64NV")) == NULL) || r; - r = ((glVertexAttribL3i64vNV = (PFNGLVERTEXATTRIBL3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3i64vNV")) == NULL) || r; - r = ((glVertexAttribL3ui64NV = (PFNGLVERTEXATTRIBL3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3ui64NV")) == NULL) || r; - r = ((glVertexAttribL3ui64vNV = (PFNGLVERTEXATTRIBL3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3ui64vNV")) == NULL) || r; - r = ((glVertexAttribL4i64NV = (PFNGLVERTEXATTRIBL4I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4i64NV")) == NULL) || r; - r = ((glVertexAttribL4i64vNV = (PFNGLVERTEXATTRIBL4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4i64vNV")) == NULL) || r; - r = ((glVertexAttribL4ui64NV = (PFNGLVERTEXATTRIBL4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4ui64NV")) == NULL) || r; - r = ((glVertexAttribL4ui64vNV = (PFNGLVERTEXATTRIBL4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4ui64vNV")) == NULL) || r; - r = ((glVertexAttribLFormatNV = (PFNGLVERTEXATTRIBLFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLFormatNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_vertex_attrib_integer_64bit */ - -#ifdef GL_NV_vertex_buffer_unified_memory - -static GLboolean _glewInit_GL_NV_vertex_buffer_unified_memory (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBufferAddressRangeNV = (PFNGLBUFFERADDRESSRANGENVPROC)glewGetProcAddress((const GLubyte*)"glBufferAddressRangeNV")) == NULL) || r; - r = ((glColorFormatNV = (PFNGLCOLORFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glColorFormatNV")) == NULL) || r; - r = ((glEdgeFlagFormatNV = (PFNGLEDGEFLAGFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagFormatNV")) == NULL) || r; - r = ((glFogCoordFormatNV = (PFNGLFOGCOORDFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordFormatNV")) == NULL) || r; - r = ((glGetIntegerui64i_vNV = (PFNGLGETINTEGERUI64I_VNVPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerui64i_vNV")) == NULL) || r; - r = ((glIndexFormatNV = (PFNGLINDEXFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glIndexFormatNV")) == NULL) || r; - r = ((glNormalFormatNV = (PFNGLNORMALFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glNormalFormatNV")) == NULL) || r; - r = ((glSecondaryColorFormatNV = (PFNGLSECONDARYCOLORFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorFormatNV")) == NULL) || r; - r = ((glTexCoordFormatNV = (PFNGLTEXCOORDFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordFormatNV")) == NULL) || r; - r = ((glVertexAttribFormatNV = (PFNGLVERTEXATTRIBFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribFormatNV")) == NULL) || r; - r = ((glVertexAttribIFormatNV = (PFNGLVERTEXATTRIBIFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIFormatNV")) == NULL) || r; - r = ((glVertexFormatNV = (PFNGLVERTEXFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexFormatNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_vertex_buffer_unified_memory */ - -#ifdef GL_NV_vertex_program - -static GLboolean _glewInit_GL_NV_vertex_program (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glAreProgramsResidentNV = (PFNGLAREPROGRAMSRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glAreProgramsResidentNV")) == NULL) || r; - r = ((glBindProgramNV = (PFNGLBINDPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glBindProgramNV")) == NULL) || r; - r = ((glDeleteProgramsNV = (PFNGLDELETEPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramsNV")) == NULL) || r; - r = ((glExecuteProgramNV = (PFNGLEXECUTEPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glExecuteProgramNV")) == NULL) || r; - r = ((glGenProgramsNV = (PFNGLGENPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glGenProgramsNV")) == NULL) || r; - r = ((glGetProgramParameterdvNV = (PFNGLGETPROGRAMPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramParameterdvNV")) == NULL) || r; - r = ((glGetProgramParameterfvNV = (PFNGLGETPROGRAMPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramParameterfvNV")) == NULL) || r; - r = ((glGetProgramStringNV = (PFNGLGETPROGRAMSTRINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStringNV")) == NULL) || r; - r = ((glGetProgramivNV = (PFNGLGETPROGRAMIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramivNV")) == NULL) || r; - r = ((glGetTrackMatrixivNV = (PFNGLGETTRACKMATRIXIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetTrackMatrixivNV")) == NULL) || r; - r = ((glGetVertexAttribPointervNV = (PFNGLGETVERTEXATTRIBPOINTERVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointervNV")) == NULL) || r; - r = ((glGetVertexAttribdvNV = (PFNGLGETVERTEXATTRIBDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdvNV")) == NULL) || r; - r = ((glGetVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfvNV")) == NULL) || r; - r = ((glGetVertexAttribivNV = (PFNGLGETVERTEXATTRIBIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribivNV")) == NULL) || r; - r = ((glIsProgramNV = (PFNGLISPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glIsProgramNV")) == NULL) || r; - r = ((glLoadProgramNV = (PFNGLLOADPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glLoadProgramNV")) == NULL) || r; - r = ((glProgramParameter4dNV = (PFNGLPROGRAMPARAMETER4DNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4dNV")) == NULL) || r; - r = ((glProgramParameter4dvNV = (PFNGLPROGRAMPARAMETER4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4dvNV")) == NULL) || r; - r = ((glProgramParameter4fNV = (PFNGLPROGRAMPARAMETER4FNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4fNV")) == NULL) || r; - r = ((glProgramParameter4fvNV = (PFNGLPROGRAMPARAMETER4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4fvNV")) == NULL) || r; - r = ((glProgramParameters4dvNV = (PFNGLPROGRAMPARAMETERS4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameters4dvNV")) == NULL) || r; - r = ((glProgramParameters4fvNV = (PFNGLPROGRAMPARAMETERS4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameters4fvNV")) == NULL) || r; - r = ((glRequestResidentProgramsNV = (PFNGLREQUESTRESIDENTPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glRequestResidentProgramsNV")) == NULL) || r; - r = ((glTrackMatrixNV = (PFNGLTRACKMATRIXNVPROC)glewGetProcAddress((const GLubyte*)"glTrackMatrixNV")) == NULL) || r; - r = ((glVertexAttrib1dNV = (PFNGLVERTEXATTRIB1DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dNV")) == NULL) || r; - r = ((glVertexAttrib1dvNV = (PFNGLVERTEXATTRIB1DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dvNV")) == NULL) || r; - r = ((glVertexAttrib1fNV = (PFNGLVERTEXATTRIB1FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fNV")) == NULL) || r; - r = ((glVertexAttrib1fvNV = (PFNGLVERTEXATTRIB1FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fvNV")) == NULL) || r; - r = ((glVertexAttrib1sNV = (PFNGLVERTEXATTRIB1SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sNV")) == NULL) || r; - r = ((glVertexAttrib1svNV = (PFNGLVERTEXATTRIB1SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1svNV")) == NULL) || r; - r = ((glVertexAttrib2dNV = (PFNGLVERTEXATTRIB2DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dNV")) == NULL) || r; - r = ((glVertexAttrib2dvNV = (PFNGLVERTEXATTRIB2DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dvNV")) == NULL) || r; - r = ((glVertexAttrib2fNV = (PFNGLVERTEXATTRIB2FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fNV")) == NULL) || r; - r = ((glVertexAttrib2fvNV = (PFNGLVERTEXATTRIB2FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fvNV")) == NULL) || r; - r = ((glVertexAttrib2sNV = (PFNGLVERTEXATTRIB2SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sNV")) == NULL) || r; - r = ((glVertexAttrib2svNV = (PFNGLVERTEXATTRIB2SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2svNV")) == NULL) || r; - r = ((glVertexAttrib3dNV = (PFNGLVERTEXATTRIB3DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dNV")) == NULL) || r; - r = ((glVertexAttrib3dvNV = (PFNGLVERTEXATTRIB3DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dvNV")) == NULL) || r; - r = ((glVertexAttrib3fNV = (PFNGLVERTEXATTRIB3FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fNV")) == NULL) || r; - r = ((glVertexAttrib3fvNV = (PFNGLVERTEXATTRIB3FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fvNV")) == NULL) || r; - r = ((glVertexAttrib3sNV = (PFNGLVERTEXATTRIB3SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sNV")) == NULL) || r; - r = ((glVertexAttrib3svNV = (PFNGLVERTEXATTRIB3SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3svNV")) == NULL) || r; - r = ((glVertexAttrib4dNV = (PFNGLVERTEXATTRIB4DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dNV")) == NULL) || r; - r = ((glVertexAttrib4dvNV = (PFNGLVERTEXATTRIB4DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dvNV")) == NULL) || r; - r = ((glVertexAttrib4fNV = (PFNGLVERTEXATTRIB4FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fNV")) == NULL) || r; - r = ((glVertexAttrib4fvNV = (PFNGLVERTEXATTRIB4FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fvNV")) == NULL) || r; - r = ((glVertexAttrib4sNV = (PFNGLVERTEXATTRIB4SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sNV")) == NULL) || r; - r = ((glVertexAttrib4svNV = (PFNGLVERTEXATTRIB4SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4svNV")) == NULL) || r; - r = ((glVertexAttrib4ubNV = (PFNGLVERTEXATTRIB4UBNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubNV")) == NULL) || r; - r = ((glVertexAttrib4ubvNV = (PFNGLVERTEXATTRIB4UBVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubvNV")) == NULL) || r; - r = ((glVertexAttribPointerNV = (PFNGLVERTEXATTRIBPOINTERNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointerNV")) == NULL) || r; - r = ((glVertexAttribs1dvNV = (PFNGLVERTEXATTRIBS1DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1dvNV")) == NULL) || r; - r = ((glVertexAttribs1fvNV = (PFNGLVERTEXATTRIBS1FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1fvNV")) == NULL) || r; - r = ((glVertexAttribs1svNV = (PFNGLVERTEXATTRIBS1SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1svNV")) == NULL) || r; - r = ((glVertexAttribs2dvNV = (PFNGLVERTEXATTRIBS2DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2dvNV")) == NULL) || r; - r = ((glVertexAttribs2fvNV = (PFNGLVERTEXATTRIBS2FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2fvNV")) == NULL) || r; - r = ((glVertexAttribs2svNV = (PFNGLVERTEXATTRIBS2SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2svNV")) == NULL) || r; - r = ((glVertexAttribs3dvNV = (PFNGLVERTEXATTRIBS3DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3dvNV")) == NULL) || r; - r = ((glVertexAttribs3fvNV = (PFNGLVERTEXATTRIBS3FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3fvNV")) == NULL) || r; - r = ((glVertexAttribs3svNV = (PFNGLVERTEXATTRIBS3SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3svNV")) == NULL) || r; - r = ((glVertexAttribs4dvNV = (PFNGLVERTEXATTRIBS4DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4dvNV")) == NULL) || r; - r = ((glVertexAttribs4fvNV = (PFNGLVERTEXATTRIBS4FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4fvNV")) == NULL) || r; - r = ((glVertexAttribs4svNV = (PFNGLVERTEXATTRIBS4SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4svNV")) == NULL) || r; - r = ((glVertexAttribs4ubvNV = (PFNGLVERTEXATTRIBS4UBVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4ubvNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_vertex_program */ - -#ifdef GL_NV_video_capture - -static GLboolean _glewInit_GL_NV_video_capture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glBeginVideoCaptureNV = (PFNGLBEGINVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glBeginVideoCaptureNV")) == NULL) || r; - r = ((glBindVideoCaptureStreamBufferNV = (PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"glBindVideoCaptureStreamBufferNV")) == NULL) || r; - r = ((glBindVideoCaptureStreamTextureNV = (PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC)glewGetProcAddress((const GLubyte*)"glBindVideoCaptureStreamTextureNV")) == NULL) || r; - r = ((glEndVideoCaptureNV = (PFNGLENDVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glEndVideoCaptureNV")) == NULL) || r; - r = ((glGetVideoCaptureStreamdvNV = (PFNGLGETVIDEOCAPTURESTREAMDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamdvNV")) == NULL) || r; - r = ((glGetVideoCaptureStreamfvNV = (PFNGLGETVIDEOCAPTURESTREAMFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamfvNV")) == NULL) || r; - r = ((glGetVideoCaptureStreamivNV = (PFNGLGETVIDEOCAPTURESTREAMIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamivNV")) == NULL) || r; - r = ((glGetVideoCaptureivNV = (PFNGLGETVIDEOCAPTUREIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureivNV")) == NULL) || r; - r = ((glVideoCaptureNV = (PFNGLVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureNV")) == NULL) || r; - r = ((glVideoCaptureStreamParameterdvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterdvNV")) == NULL) || r; - r = ((glVideoCaptureStreamParameterfvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterfvNV")) == NULL) || r; - r = ((glVideoCaptureStreamParameterivNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterivNV")) == NULL) || r; - - return r; -} - -#endif /* GL_NV_video_capture */ - -#ifdef GL_OES_single_precision - -static GLboolean _glewInit_GL_OES_single_precision (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glClearDepthfOES = (PFNGLCLEARDEPTHFOESPROC)glewGetProcAddress((const GLubyte*)"glClearDepthfOES")) == NULL) || r; - r = ((glClipPlanefOES = (PFNGLCLIPPLANEFOESPROC)glewGetProcAddress((const GLubyte*)"glClipPlanefOES")) == NULL) || r; - r = ((glDepthRangefOES = (PFNGLDEPTHRANGEFOESPROC)glewGetProcAddress((const GLubyte*)"glDepthRangefOES")) == NULL) || r; - r = ((glFrustumfOES = (PFNGLFRUSTUMFOESPROC)glewGetProcAddress((const GLubyte*)"glFrustumfOES")) == NULL) || r; - r = ((glGetClipPlanefOES = (PFNGLGETCLIPPLANEFOESPROC)glewGetProcAddress((const GLubyte*)"glGetClipPlanefOES")) == NULL) || r; - r = ((glOrthofOES = (PFNGLORTHOFOESPROC)glewGetProcAddress((const GLubyte*)"glOrthofOES")) == NULL) || r; - - return r; -} - -#endif /* GL_OES_single_precision */ - -#ifdef GL_OVR_multiview - -static GLboolean _glewInit_GL_OVR_multiview (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFramebufferTextureMultiviewOVR = (PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureMultiviewOVR")) == NULL) || r; - - return r; -} - -#endif /* GL_OVR_multiview */ - -#ifdef GL_REGAL_ES1_0_compatibility - -static GLboolean _glewInit_GL_REGAL_ES1_0_compatibility (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glAlphaFuncx = (PFNGLALPHAFUNCXPROC)glewGetProcAddress((const GLubyte*)"glAlphaFuncx")) == NULL) || r; - r = ((glClearColorx = (PFNGLCLEARCOLORXPROC)glewGetProcAddress((const GLubyte*)"glClearColorx")) == NULL) || r; - r = ((glClearDepthx = (PFNGLCLEARDEPTHXPROC)glewGetProcAddress((const GLubyte*)"glClearDepthx")) == NULL) || r; - r = ((glColor4x = (PFNGLCOLOR4XPROC)glewGetProcAddress((const GLubyte*)"glColor4x")) == NULL) || r; - r = ((glDepthRangex = (PFNGLDEPTHRANGEXPROC)glewGetProcAddress((const GLubyte*)"glDepthRangex")) == NULL) || r; - r = ((glFogx = (PFNGLFOGXPROC)glewGetProcAddress((const GLubyte*)"glFogx")) == NULL) || r; - r = ((glFogxv = (PFNGLFOGXVPROC)glewGetProcAddress((const GLubyte*)"glFogxv")) == NULL) || r; - r = ((glFrustumf = (PFNGLFRUSTUMFPROC)glewGetProcAddress((const GLubyte*)"glFrustumf")) == NULL) || r; - r = ((glFrustumx = (PFNGLFRUSTUMXPROC)glewGetProcAddress((const GLubyte*)"glFrustumx")) == NULL) || r; - r = ((glLightModelx = (PFNGLLIGHTMODELXPROC)glewGetProcAddress((const GLubyte*)"glLightModelx")) == NULL) || r; - r = ((glLightModelxv = (PFNGLLIGHTMODELXVPROC)glewGetProcAddress((const GLubyte*)"glLightModelxv")) == NULL) || r; - r = ((glLightx = (PFNGLLIGHTXPROC)glewGetProcAddress((const GLubyte*)"glLightx")) == NULL) || r; - r = ((glLightxv = (PFNGLLIGHTXVPROC)glewGetProcAddress((const GLubyte*)"glLightxv")) == NULL) || r; - r = ((glLineWidthx = (PFNGLLINEWIDTHXPROC)glewGetProcAddress((const GLubyte*)"glLineWidthx")) == NULL) || r; - r = ((glLoadMatrixx = (PFNGLLOADMATRIXXPROC)glewGetProcAddress((const GLubyte*)"glLoadMatrixx")) == NULL) || r; - r = ((glMaterialx = (PFNGLMATERIALXPROC)glewGetProcAddress((const GLubyte*)"glMaterialx")) == NULL) || r; - r = ((glMaterialxv = (PFNGLMATERIALXVPROC)glewGetProcAddress((const GLubyte*)"glMaterialxv")) == NULL) || r; - r = ((glMultMatrixx = (PFNGLMULTMATRIXXPROC)glewGetProcAddress((const GLubyte*)"glMultMatrixx")) == NULL) || r; - r = ((glMultiTexCoord4x = (PFNGLMULTITEXCOORD4XPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4x")) == NULL) || r; - r = ((glNormal3x = (PFNGLNORMAL3XPROC)glewGetProcAddress((const GLubyte*)"glNormal3x")) == NULL) || r; - r = ((glOrthof = (PFNGLORTHOFPROC)glewGetProcAddress((const GLubyte*)"glOrthof")) == NULL) || r; - r = ((glOrthox = (PFNGLORTHOXPROC)glewGetProcAddress((const GLubyte*)"glOrthox")) == NULL) || r; - r = ((glPointSizex = (PFNGLPOINTSIZEXPROC)glewGetProcAddress((const GLubyte*)"glPointSizex")) == NULL) || r; - r = ((glPolygonOffsetx = (PFNGLPOLYGONOFFSETXPROC)glewGetProcAddress((const GLubyte*)"glPolygonOffsetx")) == NULL) || r; - r = ((glRotatex = (PFNGLROTATEXPROC)glewGetProcAddress((const GLubyte*)"glRotatex")) == NULL) || r; - r = ((glSampleCoveragex = (PFNGLSAMPLECOVERAGEXPROC)glewGetProcAddress((const GLubyte*)"glSampleCoveragex")) == NULL) || r; - r = ((glScalex = (PFNGLSCALEXPROC)glewGetProcAddress((const GLubyte*)"glScalex")) == NULL) || r; - r = ((glTexEnvx = (PFNGLTEXENVXPROC)glewGetProcAddress((const GLubyte*)"glTexEnvx")) == NULL) || r; - r = ((glTexEnvxv = (PFNGLTEXENVXVPROC)glewGetProcAddress((const GLubyte*)"glTexEnvxv")) == NULL) || r; - r = ((glTexParameterx = (PFNGLTEXPARAMETERXPROC)glewGetProcAddress((const GLubyte*)"glTexParameterx")) == NULL) || r; - r = ((glTranslatex = (PFNGLTRANSLATEXPROC)glewGetProcAddress((const GLubyte*)"glTranslatex")) == NULL) || r; - - return r; -} - -#endif /* GL_REGAL_ES1_0_compatibility */ - -#ifdef GL_REGAL_ES1_1_compatibility - -static GLboolean _glewInit_GL_REGAL_ES1_1_compatibility (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glClipPlanef = (PFNGLCLIPPLANEFPROC)glewGetProcAddress((const GLubyte*)"glClipPlanef")) == NULL) || r; - r = ((glClipPlanex = (PFNGLCLIPPLANEXPROC)glewGetProcAddress((const GLubyte*)"glClipPlanex")) == NULL) || r; - r = ((glGetClipPlanef = (PFNGLGETCLIPPLANEFPROC)glewGetProcAddress((const GLubyte*)"glGetClipPlanef")) == NULL) || r; - r = ((glGetClipPlanex = (PFNGLGETCLIPPLANEXPROC)glewGetProcAddress((const GLubyte*)"glGetClipPlanex")) == NULL) || r; - r = ((glGetFixedv = (PFNGLGETFIXEDVPROC)glewGetProcAddress((const GLubyte*)"glGetFixedv")) == NULL) || r; - r = ((glGetLightxv = (PFNGLGETLIGHTXVPROC)glewGetProcAddress((const GLubyte*)"glGetLightxv")) == NULL) || r; - r = ((glGetMaterialxv = (PFNGLGETMATERIALXVPROC)glewGetProcAddress((const GLubyte*)"glGetMaterialxv")) == NULL) || r; - r = ((glGetTexEnvxv = (PFNGLGETTEXENVXVPROC)glewGetProcAddress((const GLubyte*)"glGetTexEnvxv")) == NULL) || r; - r = ((glGetTexParameterxv = (PFNGLGETTEXPARAMETERXVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterxv")) == NULL) || r; - r = ((glPointParameterx = (PFNGLPOINTPARAMETERXPROC)glewGetProcAddress((const GLubyte*)"glPointParameterx")) == NULL) || r; - r = ((glPointParameterxv = (PFNGLPOINTPARAMETERXVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterxv")) == NULL) || r; - r = ((glPointSizePointerOES = (PFNGLPOINTSIZEPOINTEROESPROC)glewGetProcAddress((const GLubyte*)"glPointSizePointerOES")) == NULL) || r; - r = ((glTexParameterxv = (PFNGLTEXPARAMETERXVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterxv")) == NULL) || r; - - return r; -} - -#endif /* GL_REGAL_ES1_1_compatibility */ - -#ifdef GL_REGAL_error_string - -static GLboolean _glewInit_GL_REGAL_error_string (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glErrorStringREGAL = (PFNGLERRORSTRINGREGALPROC)glewGetProcAddress((const GLubyte*)"glErrorStringREGAL")) == NULL) || r; - - return r; -} - -#endif /* GL_REGAL_error_string */ - -#ifdef GL_REGAL_extension_query - -static GLboolean _glewInit_GL_REGAL_extension_query (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetExtensionREGAL = (PFNGLGETEXTENSIONREGALPROC)glewGetProcAddress((const GLubyte*)"glGetExtensionREGAL")) == NULL) || r; - r = ((glIsSupportedREGAL = (PFNGLISSUPPORTEDREGALPROC)glewGetProcAddress((const GLubyte*)"glIsSupportedREGAL")) == NULL) || r; - - return r; -} - -#endif /* GL_REGAL_extension_query */ - -#ifdef GL_REGAL_log - -static GLboolean _glewInit_GL_REGAL_log (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glLogMessageCallbackREGAL = (PFNGLLOGMESSAGECALLBACKREGALPROC)glewGetProcAddress((const GLubyte*)"glLogMessageCallbackREGAL")) == NULL) || r; - - return r; -} - -#endif /* GL_REGAL_log */ - -#ifdef GL_REGAL_proc_address - -static GLboolean _glewInit_GL_REGAL_proc_address (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetProcAddressREGAL = (PFNGLGETPROCADDRESSREGALPROC)glewGetProcAddress((const GLubyte*)"glGetProcAddressREGAL")) == NULL) || r; - - return r; -} - -#endif /* GL_REGAL_proc_address */ - -#ifdef GL_SGIS_detail_texture - -static GLboolean _glewInit_GL_SGIS_detail_texture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glDetailTexFuncSGIS = (PFNGLDETAILTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glDetailTexFuncSGIS")) == NULL) || r; - r = ((glGetDetailTexFuncSGIS = (PFNGLGETDETAILTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetDetailTexFuncSGIS")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIS_detail_texture */ - -#ifdef GL_SGIS_fog_function - -static GLboolean _glewInit_GL_SGIS_fog_function (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFogFuncSGIS = (PFNGLFOGFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glFogFuncSGIS")) == NULL) || r; - r = ((glGetFogFuncSGIS = (PFNGLGETFOGFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetFogFuncSGIS")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIS_fog_function */ - -#ifdef GL_SGIS_multisample - -static GLboolean _glewInit_GL_SGIS_multisample (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glSampleMaskSGIS = (PFNGLSAMPLEMASKSGISPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskSGIS")) == NULL) || r; - r = ((glSamplePatternSGIS = (PFNGLSAMPLEPATTERNSGISPROC)glewGetProcAddress((const GLubyte*)"glSamplePatternSGIS")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIS_multisample */ - -#ifdef GL_SGIS_sharpen_texture - -static GLboolean _glewInit_GL_SGIS_sharpen_texture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetSharpenTexFuncSGIS = (PFNGLGETSHARPENTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetSharpenTexFuncSGIS")) == NULL) || r; - r = ((glSharpenTexFuncSGIS = (PFNGLSHARPENTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glSharpenTexFuncSGIS")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIS_sharpen_texture */ - -#ifdef GL_SGIS_texture4D - -static GLboolean _glewInit_GL_SGIS_texture4D (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTexImage4DSGIS = (PFNGLTEXIMAGE4DSGISPROC)glewGetProcAddress((const GLubyte*)"glTexImage4DSGIS")) == NULL) || r; - r = ((glTexSubImage4DSGIS = (PFNGLTEXSUBIMAGE4DSGISPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage4DSGIS")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIS_texture4D */ - -#ifdef GL_SGIS_texture_filter4 - -static GLboolean _glewInit_GL_SGIS_texture_filter4 (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGetTexFilterFuncSGIS = (PFNGLGETTEXFILTERFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetTexFilterFuncSGIS")) == NULL) || r; - r = ((glTexFilterFuncSGIS = (PFNGLTEXFILTERFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glTexFilterFuncSGIS")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIS_texture_filter4 */ - -#ifdef GL_SGIX_async - -static GLboolean _glewInit_GL_SGIX_async (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glAsyncMarkerSGIX = (PFNGLASYNCMARKERSGIXPROC)glewGetProcAddress((const GLubyte*)"glAsyncMarkerSGIX")) == NULL) || r; - r = ((glDeleteAsyncMarkersSGIX = (PFNGLDELETEASYNCMARKERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glDeleteAsyncMarkersSGIX")) == NULL) || r; - r = ((glFinishAsyncSGIX = (PFNGLFINISHASYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glFinishAsyncSGIX")) == NULL) || r; - r = ((glGenAsyncMarkersSGIX = (PFNGLGENASYNCMARKERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glGenAsyncMarkersSGIX")) == NULL) || r; - r = ((glIsAsyncMarkerSGIX = (PFNGLISASYNCMARKERSGIXPROC)glewGetProcAddress((const GLubyte*)"glIsAsyncMarkerSGIX")) == NULL) || r; - r = ((glPollAsyncSGIX = (PFNGLPOLLASYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glPollAsyncSGIX")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIX_async */ - -#ifdef GL_SGIX_flush_raster - -static GLboolean _glewInit_GL_SGIX_flush_raster (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFlushRasterSGIX = (PFNGLFLUSHRASTERSGIXPROC)glewGetProcAddress((const GLubyte*)"glFlushRasterSGIX")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIX_flush_raster */ - -#ifdef GL_SGIX_fog_texture - -static GLboolean _glewInit_GL_SGIX_fog_texture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTextureFogSGIX = (PFNGLTEXTUREFOGSGIXPROC)glewGetProcAddress((const GLubyte*)"glTextureFogSGIX")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIX_fog_texture */ - -#ifdef GL_SGIX_fragment_specular_lighting - -static GLboolean _glewInit_GL_SGIX_fragment_specular_lighting (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFragmentColorMaterialSGIX = (PFNGLFRAGMENTCOLORMATERIALSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentColorMaterialSGIX")) == NULL) || r; - r = ((glFragmentLightModelfSGIX = (PFNGLFRAGMENTLIGHTMODELFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfSGIX")) == NULL) || r; - r = ((glFragmentLightModelfvSGIX = (PFNGLFRAGMENTLIGHTMODELFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfvSGIX")) == NULL) || r; - r = ((glFragmentLightModeliSGIX = (PFNGLFRAGMENTLIGHTMODELISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModeliSGIX")) == NULL) || r; - r = ((glFragmentLightModelivSGIX = (PFNGLFRAGMENTLIGHTMODELIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelivSGIX")) == NULL) || r; - r = ((glFragmentLightfSGIX = (PFNGLFRAGMENTLIGHTFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfSGIX")) == NULL) || r; - r = ((glFragmentLightfvSGIX = (PFNGLFRAGMENTLIGHTFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfvSGIX")) == NULL) || r; - r = ((glFragmentLightiSGIX = (PFNGLFRAGMENTLIGHTISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightiSGIX")) == NULL) || r; - r = ((glFragmentLightivSGIX = (PFNGLFRAGMENTLIGHTIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightivSGIX")) == NULL) || r; - r = ((glFragmentMaterialfSGIX = (PFNGLFRAGMENTMATERIALFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfSGIX")) == NULL) || r; - r = ((glFragmentMaterialfvSGIX = (PFNGLFRAGMENTMATERIALFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfvSGIX")) == NULL) || r; - r = ((glFragmentMaterialiSGIX = (PFNGLFRAGMENTMATERIALISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialiSGIX")) == NULL) || r; - r = ((glFragmentMaterialivSGIX = (PFNGLFRAGMENTMATERIALIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialivSGIX")) == NULL) || r; - r = ((glGetFragmentLightfvSGIX = (PFNGLGETFRAGMENTLIGHTFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightfvSGIX")) == NULL) || r; - r = ((glGetFragmentLightivSGIX = (PFNGLGETFRAGMENTLIGHTIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightivSGIX")) == NULL) || r; - r = ((glGetFragmentMaterialfvSGIX = (PFNGLGETFRAGMENTMATERIALFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialfvSGIX")) == NULL) || r; - r = ((glGetFragmentMaterialivSGIX = (PFNGLGETFRAGMENTMATERIALIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialivSGIX")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIX_fragment_specular_lighting */ - -#ifdef GL_SGIX_framezoom - -static GLboolean _glewInit_GL_SGIX_framezoom (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFrameZoomSGIX = (PFNGLFRAMEZOOMSGIXPROC)glewGetProcAddress((const GLubyte*)"glFrameZoomSGIX")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIX_framezoom */ - -#ifdef GL_SGIX_pixel_texture - -static GLboolean _glewInit_GL_SGIX_pixel_texture (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glPixelTexGenSGIX = (PFNGLPIXELTEXGENSGIXPROC)glewGetProcAddress((const GLubyte*)"glPixelTexGenSGIX")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIX_pixel_texture */ - -#ifdef GL_SGIX_reference_plane - -static GLboolean _glewInit_GL_SGIX_reference_plane (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glReferencePlaneSGIX = (PFNGLREFERENCEPLANESGIXPROC)glewGetProcAddress((const GLubyte*)"glReferencePlaneSGIX")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIX_reference_plane */ - -#ifdef GL_SGIX_sprite - -static GLboolean _glewInit_GL_SGIX_sprite (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glSpriteParameterfSGIX = (PFNGLSPRITEPARAMETERFSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterfSGIX")) == NULL) || r; - r = ((glSpriteParameterfvSGIX = (PFNGLSPRITEPARAMETERFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterfvSGIX")) == NULL) || r; - r = ((glSpriteParameteriSGIX = (PFNGLSPRITEPARAMETERISGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameteriSGIX")) == NULL) || r; - r = ((glSpriteParameterivSGIX = (PFNGLSPRITEPARAMETERIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterivSGIX")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIX_sprite */ - -#ifdef GL_SGIX_tag_sample_buffer - -static GLboolean _glewInit_GL_SGIX_tag_sample_buffer (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glTagSampleBufferSGIX = (PFNGLTAGSAMPLEBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glTagSampleBufferSGIX")) == NULL) || r; - - return r; -} - -#endif /* GL_SGIX_tag_sample_buffer */ - -#ifdef GL_SGI_color_table - -static GLboolean _glewInit_GL_SGI_color_table (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glColorTableParameterfvSGI = (PFNGLCOLORTABLEPARAMETERFVSGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterfvSGI")) == NULL) || r; - r = ((glColorTableParameterivSGI = (PFNGLCOLORTABLEPARAMETERIVSGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterivSGI")) == NULL) || r; - r = ((glColorTableSGI = (PFNGLCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableSGI")) == NULL) || r; - r = ((glCopyColorTableSGI = (PFNGLCOPYCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glCopyColorTableSGI")) == NULL) || r; - r = ((glGetColorTableParameterfvSGI = (PFNGLGETCOLORTABLEPARAMETERFVSGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfvSGI")) == NULL) || r; - r = ((glGetColorTableParameterivSGI = (PFNGLGETCOLORTABLEPARAMETERIVSGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterivSGI")) == NULL) || r; - r = ((glGetColorTableSGI = (PFNGLGETCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableSGI")) == NULL) || r; - - return r; -} - -#endif /* GL_SGI_color_table */ - -#ifdef GL_SUNX_constant_data - -static GLboolean _glewInit_GL_SUNX_constant_data (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glFinishTextureSUNX = (PFNGLFINISHTEXTURESUNXPROC)glewGetProcAddress((const GLubyte*)"glFinishTextureSUNX")) == NULL) || r; - - return r; -} - -#endif /* GL_SUNX_constant_data */ - -#ifdef GL_SUN_global_alpha - -static GLboolean _glewInit_GL_SUN_global_alpha (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glGlobalAlphaFactorbSUN = (PFNGLGLOBALALPHAFACTORBSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorbSUN")) == NULL) || r; - r = ((glGlobalAlphaFactordSUN = (PFNGLGLOBALALPHAFACTORDSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactordSUN")) == NULL) || r; - r = ((glGlobalAlphaFactorfSUN = (PFNGLGLOBALALPHAFACTORFSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorfSUN")) == NULL) || r; - r = ((glGlobalAlphaFactoriSUN = (PFNGLGLOBALALPHAFACTORISUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactoriSUN")) == NULL) || r; - r = ((glGlobalAlphaFactorsSUN = (PFNGLGLOBALALPHAFACTORSSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorsSUN")) == NULL) || r; - r = ((glGlobalAlphaFactorubSUN = (PFNGLGLOBALALPHAFACTORUBSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorubSUN")) == NULL) || r; - r = ((glGlobalAlphaFactoruiSUN = (PFNGLGLOBALALPHAFACTORUISUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactoruiSUN")) == NULL) || r; - r = ((glGlobalAlphaFactorusSUN = (PFNGLGLOBALALPHAFACTORUSSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorusSUN")) == NULL) || r; - - return r; -} - -#endif /* GL_SUN_global_alpha */ - -#ifdef GL_SUN_read_video_pixels - -static GLboolean _glewInit_GL_SUN_read_video_pixels (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glReadVideoPixelsSUN = (PFNGLREADVIDEOPIXELSSUNPROC)glewGetProcAddress((const GLubyte*)"glReadVideoPixelsSUN")) == NULL) || r; - - return r; -} - -#endif /* GL_SUN_read_video_pixels */ - -#ifdef GL_SUN_triangle_list - -static GLboolean _glewInit_GL_SUN_triangle_list (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glReplacementCodePointerSUN = (PFNGLREPLACEMENTCODEPOINTERSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodePointerSUN")) == NULL) || r; - r = ((glReplacementCodeubSUN = (PFNGLREPLACEMENTCODEUBSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeubSUN")) == NULL) || r; - r = ((glReplacementCodeubvSUN = (PFNGLREPLACEMENTCODEUBVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeubvSUN")) == NULL) || r; - r = ((glReplacementCodeuiSUN = (PFNGLREPLACEMENTCODEUISUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiSUN")) == NULL) || r; - r = ((glReplacementCodeuivSUN = (PFNGLREPLACEMENTCODEUIVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuivSUN")) == NULL) || r; - r = ((glReplacementCodeusSUN = (PFNGLREPLACEMENTCODEUSSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeusSUN")) == NULL) || r; - r = ((glReplacementCodeusvSUN = (PFNGLREPLACEMENTCODEUSVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeusvSUN")) == NULL) || r; - - return r; -} - -#endif /* GL_SUN_triangle_list */ - -#ifdef GL_SUN_vertex - -static GLboolean _glewInit_GL_SUN_vertex (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glColor3fVertex3fSUN = (PFNGLCOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor3fVertex3fSUN")) == NULL) || r; - r = ((glColor3fVertex3fvSUN = (PFNGLCOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor3fVertex3fvSUN")) == NULL) || r; - r = ((glColor4fNormal3fVertex3fSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4fNormal3fVertex3fSUN")) == NULL) || r; - r = ((glColor4fNormal3fVertex3fvSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4fNormal3fVertex3fvSUN")) == NULL) || r; - r = ((glColor4ubVertex2fSUN = (PFNGLCOLOR4UBVERTEX2FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex2fSUN")) == NULL) || r; - r = ((glColor4ubVertex2fvSUN = (PFNGLCOLOR4UBVERTEX2FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex2fvSUN")) == NULL) || r; - r = ((glColor4ubVertex3fSUN = (PFNGLCOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex3fSUN")) == NULL) || r; - r = ((glColor4ubVertex3fvSUN = (PFNGLCOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex3fvSUN")) == NULL) || r; - r = ((glNormal3fVertex3fSUN = (PFNGLNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glNormal3fVertex3fSUN")) == NULL) || r; - r = ((glNormal3fVertex3fvSUN = (PFNGLNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glNormal3fVertex3fvSUN")) == NULL) || r; - r = ((glReplacementCodeuiColor3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor3fVertex3fSUN")) == NULL) || r; - r = ((glReplacementCodeuiColor3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor3fVertex3fvSUN")) == NULL) || r; - r = ((glReplacementCodeuiColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4fNormal3fVertex3fSUN")) == NULL) || r; - r = ((glReplacementCodeuiColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4fNormal3fVertex3fvSUN")) == NULL) || r; - r = ((glReplacementCodeuiColor4ubVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4ubVertex3fSUN")) == NULL) || r; - r = ((glReplacementCodeuiColor4ubVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4ubVertex3fvSUN")) == NULL) || r; - r = ((glReplacementCodeuiNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiNormal3fVertex3fSUN")) == NULL) || r; - r = ((glReplacementCodeuiNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiNormal3fVertex3fvSUN")) == NULL) || r; - r = ((glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN")) == NULL) || r; - r = ((glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN")) == NULL) || r; - r = ((glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN")) == NULL) || r; - r = ((glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN")) == NULL) || r; - r = ((glReplacementCodeuiTexCoord2fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fVertex3fSUN")) == NULL) || r; - r = ((glReplacementCodeuiTexCoord2fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fVertex3fvSUN")) == NULL) || r; - r = ((glReplacementCodeuiVertex3fSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiVertex3fSUN")) == NULL) || r; - r = ((glReplacementCodeuiVertex3fvSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiVertex3fvSUN")) == NULL) || r; - r = ((glTexCoord2fColor3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor3fVertex3fSUN")) == NULL) || r; - r = ((glTexCoord2fColor3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor3fVertex3fvSUN")) == NULL) || r; - r = ((glTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4fNormal3fVertex3fSUN")) == NULL) || r; - r = ((glTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4fNormal3fVertex3fvSUN")) == NULL) || r; - r = ((glTexCoord2fColor4ubVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4ubVertex3fSUN")) == NULL) || r; - r = ((glTexCoord2fColor4ubVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4ubVertex3fvSUN")) == NULL) || r; - r = ((glTexCoord2fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fNormal3fVertex3fSUN")) == NULL) || r; - r = ((glTexCoord2fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fNormal3fVertex3fvSUN")) == NULL) || r; - r = ((glTexCoord2fVertex3fSUN = (PFNGLTEXCOORD2FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fVertex3fSUN")) == NULL) || r; - r = ((glTexCoord2fVertex3fvSUN = (PFNGLTEXCOORD2FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fVertex3fvSUN")) == NULL) || r; - r = ((glTexCoord4fColor4fNormal3fVertex4fSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fColor4fNormal3fVertex4fSUN")) == NULL) || r; - r = ((glTexCoord4fColor4fNormal3fVertex4fvSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fColor4fNormal3fVertex4fvSUN")) == NULL) || r; - r = ((glTexCoord4fVertex4fSUN = (PFNGLTEXCOORD4FVERTEX4FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fVertex4fSUN")) == NULL) || r; - r = ((glTexCoord4fVertex4fvSUN = (PFNGLTEXCOORD4FVERTEX4FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fVertex4fvSUN")) == NULL) || r; - - return r; -} - -#endif /* GL_SUN_vertex */ - -#ifdef GL_WIN_swap_hint - -static GLboolean _glewInit_GL_WIN_swap_hint (GLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glAddSwapHintRectWIN = (PFNGLADDSWAPHINTRECTWINPROC)glewGetProcAddress((const GLubyte*)"glAddSwapHintRectWIN")) == NULL) || r; - - return r; -} - -#endif /* GL_WIN_swap_hint */ - -/* ------------------------------------------------------------------------- */ - -GLboolean GLEWAPIENTRY glewGetExtension (const char* name) -{ - const GLubyte* start; - const GLubyte* end; - start = (const GLubyte*)glGetString(GL_EXTENSIONS); - if (start == 0) - return GL_FALSE; - end = start + _glewStrLen(start); - return _glewSearchExtension(name, start, end); -} - -/* ------------------------------------------------------------------------- */ - -#ifndef GLEW_MX -static -#endif -GLenum GLEWAPIENTRY glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) -{ - const GLubyte* s; - GLuint dot; - GLint major, minor; - const GLubyte* extStart; - const GLubyte* extEnd; - /* query opengl version */ - s = glGetString(GL_VERSION); - dot = _glewStrCLen(s, '.'); - if (dot == 0) - return GLEW_ERROR_NO_GL_VERSION; - - major = s[dot-1]-'0'; - minor = s[dot+1]-'0'; - - if (minor < 0 || minor > 9) - minor = 0; - if (major<0 || major>9) - return GLEW_ERROR_NO_GL_VERSION; - - - if (major == 1 && minor == 0) - { - return GLEW_ERROR_GL_VERSION_10_ONLY; - } - else - { - GLEW_VERSION_4_5 = ( major > 4 ) || ( major == 4 && minor >= 5 ) ? GL_TRUE : GL_FALSE; - GLEW_VERSION_4_4 = GLEW_VERSION_4_5 == GL_TRUE || ( major == 4 && minor >= 4 ) ? GL_TRUE : GL_FALSE; - GLEW_VERSION_4_3 = GLEW_VERSION_4_4 == GL_TRUE || ( major == 4 && minor >= 3 ) ? GL_TRUE : GL_FALSE; - GLEW_VERSION_4_2 = GLEW_VERSION_4_3 == GL_TRUE || ( major == 4 && minor >= 2 ) ? GL_TRUE : GL_FALSE; - GLEW_VERSION_4_1 = GLEW_VERSION_4_2 == GL_TRUE || ( major == 4 && minor >= 1 ) ? GL_TRUE : GL_FALSE; - GLEW_VERSION_4_0 = GLEW_VERSION_4_1 == GL_TRUE || ( major == 4 ) ? GL_TRUE : GL_FALSE; - GLEW_VERSION_3_3 = GLEW_VERSION_4_0 == GL_TRUE || ( major == 3 && minor >= 3 ) ? GL_TRUE : GL_FALSE; - GLEW_VERSION_3_2 = GLEW_VERSION_3_3 == GL_TRUE || ( major == 3 && minor >= 2 ) ? GL_TRUE : GL_FALSE; - GLEW_VERSION_3_1 = GLEW_VERSION_3_2 == GL_TRUE || ( major == 3 && minor >= 1 ) ? GL_TRUE : GL_FALSE; - GLEW_VERSION_3_0 = GLEW_VERSION_3_1 == GL_TRUE || ( major == 3 ) ? GL_TRUE : GL_FALSE; - GLEW_VERSION_2_1 = GLEW_VERSION_3_0 == GL_TRUE || ( major == 2 && minor >= 1 ) ? GL_TRUE : GL_FALSE; - GLEW_VERSION_2_0 = GLEW_VERSION_2_1 == GL_TRUE || ( major == 2 ) ? GL_TRUE : GL_FALSE; - GLEW_VERSION_1_5 = GLEW_VERSION_2_0 == GL_TRUE || ( major == 1 && minor >= 5 ) ? GL_TRUE : GL_FALSE; - GLEW_VERSION_1_4 = GLEW_VERSION_1_5 == GL_TRUE || ( major == 1 && minor >= 4 ) ? GL_TRUE : GL_FALSE; - GLEW_VERSION_1_3 = GLEW_VERSION_1_4 == GL_TRUE || ( major == 1 && minor >= 3 ) ? GL_TRUE : GL_FALSE; - GLEW_VERSION_1_2_1 = GLEW_VERSION_1_3 == GL_TRUE ? GL_TRUE : GL_FALSE; - GLEW_VERSION_1_2 = GLEW_VERSION_1_2_1 == GL_TRUE || ( major == 1 && minor >= 2 ) ? GL_TRUE : GL_FALSE; - GLEW_VERSION_1_1 = GLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE; - } - - /* query opengl extensions string */ - extStart = glGetString(GL_EXTENSIONS); - if (extStart == 0) - extStart = (const GLubyte*)""; - extEnd = extStart + _glewStrLen(extStart); - - /* initialize extensions */ -#ifdef GL_VERSION_1_2 - if (glewExperimental || GLEW_VERSION_1_2) GLEW_VERSION_1_2 = !_glewInit_GL_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_VERSION_1_2 */ -#ifdef GL_VERSION_1_2_1 -#endif /* GL_VERSION_1_2_1 */ -#ifdef GL_VERSION_1_3 - if (glewExperimental || GLEW_VERSION_1_3) GLEW_VERSION_1_3 = !_glewInit_GL_VERSION_1_3(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_VERSION_1_3 */ -#ifdef GL_VERSION_1_4 - if (glewExperimental || GLEW_VERSION_1_4) GLEW_VERSION_1_4 = !_glewInit_GL_VERSION_1_4(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_VERSION_1_4 */ -#ifdef GL_VERSION_1_5 - if (glewExperimental || GLEW_VERSION_1_5) GLEW_VERSION_1_5 = !_glewInit_GL_VERSION_1_5(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_VERSION_1_5 */ -#ifdef GL_VERSION_2_0 - if (glewExperimental || GLEW_VERSION_2_0) GLEW_VERSION_2_0 = !_glewInit_GL_VERSION_2_0(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_VERSION_2_0 */ -#ifdef GL_VERSION_2_1 - if (glewExperimental || GLEW_VERSION_2_1) GLEW_VERSION_2_1 = !_glewInit_GL_VERSION_2_1(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_VERSION_2_1 */ -#ifdef GL_VERSION_3_0 - if (glewExperimental || GLEW_VERSION_3_0) GLEW_VERSION_3_0 = !_glewInit_GL_VERSION_3_0(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_VERSION_3_0 */ -#ifdef GL_VERSION_3_1 - if (glewExperimental || GLEW_VERSION_3_1) GLEW_VERSION_3_1 = !_glewInit_GL_VERSION_3_1(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_VERSION_3_1 */ -#ifdef GL_VERSION_3_2 - if (glewExperimental || GLEW_VERSION_3_2) GLEW_VERSION_3_2 = !_glewInit_GL_VERSION_3_2(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_VERSION_3_2 */ -#ifdef GL_VERSION_3_3 - if (glewExperimental || GLEW_VERSION_3_3) GLEW_VERSION_3_3 = !_glewInit_GL_VERSION_3_3(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_VERSION_3_3 */ -#ifdef GL_VERSION_4_0 - if (glewExperimental || GLEW_VERSION_4_0) GLEW_VERSION_4_0 = !_glewInit_GL_VERSION_4_0(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_VERSION_4_0 */ -#ifdef GL_VERSION_4_1 -#endif /* GL_VERSION_4_1 */ -#ifdef GL_VERSION_4_2 -#endif /* GL_VERSION_4_2 */ -#ifdef GL_VERSION_4_3 -#endif /* GL_VERSION_4_3 */ -#ifdef GL_VERSION_4_4 -#endif /* GL_VERSION_4_4 */ -#ifdef GL_VERSION_4_5 - if (glewExperimental || GLEW_VERSION_4_5) GLEW_VERSION_4_5 = !_glewInit_GL_VERSION_4_5(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_VERSION_4_5 */ -#ifdef GL_3DFX_multisample - GLEW_3DFX_multisample = _glewSearchExtension("GL_3DFX_multisample", extStart, extEnd); -#endif /* GL_3DFX_multisample */ -#ifdef GL_3DFX_tbuffer - GLEW_3DFX_tbuffer = _glewSearchExtension("GL_3DFX_tbuffer", extStart, extEnd); - if (glewExperimental || GLEW_3DFX_tbuffer) GLEW_3DFX_tbuffer = !_glewInit_GL_3DFX_tbuffer(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_3DFX_tbuffer */ -#ifdef GL_3DFX_texture_compression_FXT1 - GLEW_3DFX_texture_compression_FXT1 = _glewSearchExtension("GL_3DFX_texture_compression_FXT1", extStart, extEnd); -#endif /* GL_3DFX_texture_compression_FXT1 */ -#ifdef GL_AMD_blend_minmax_factor - GLEW_AMD_blend_minmax_factor = _glewSearchExtension("GL_AMD_blend_minmax_factor", extStart, extEnd); -#endif /* GL_AMD_blend_minmax_factor */ -#ifdef GL_AMD_conservative_depth - GLEW_AMD_conservative_depth = _glewSearchExtension("GL_AMD_conservative_depth", extStart, extEnd); -#endif /* GL_AMD_conservative_depth */ -#ifdef GL_AMD_debug_output - GLEW_AMD_debug_output = _glewSearchExtension("GL_AMD_debug_output", extStart, extEnd); - if (glewExperimental || GLEW_AMD_debug_output) GLEW_AMD_debug_output = !_glewInit_GL_AMD_debug_output(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_AMD_debug_output */ -#ifdef GL_AMD_depth_clamp_separate - GLEW_AMD_depth_clamp_separate = _glewSearchExtension("GL_AMD_depth_clamp_separate", extStart, extEnd); -#endif /* GL_AMD_depth_clamp_separate */ -#ifdef GL_AMD_draw_buffers_blend - GLEW_AMD_draw_buffers_blend = _glewSearchExtension("GL_AMD_draw_buffers_blend", extStart, extEnd); - if (glewExperimental || GLEW_AMD_draw_buffers_blend) GLEW_AMD_draw_buffers_blend = !_glewInit_GL_AMD_draw_buffers_blend(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_AMD_draw_buffers_blend */ -#ifdef GL_AMD_gcn_shader - GLEW_AMD_gcn_shader = _glewSearchExtension("GL_AMD_gcn_shader", extStart, extEnd); -#endif /* GL_AMD_gcn_shader */ -#ifdef GL_AMD_gpu_shader_int64 - GLEW_AMD_gpu_shader_int64 = _glewSearchExtension("GL_AMD_gpu_shader_int64", extStart, extEnd); -#endif /* GL_AMD_gpu_shader_int64 */ -#ifdef GL_AMD_interleaved_elements - GLEW_AMD_interleaved_elements = _glewSearchExtension("GL_AMD_interleaved_elements", extStart, extEnd); - if (glewExperimental || GLEW_AMD_interleaved_elements) GLEW_AMD_interleaved_elements = !_glewInit_GL_AMD_interleaved_elements(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_AMD_interleaved_elements */ -#ifdef GL_AMD_multi_draw_indirect - GLEW_AMD_multi_draw_indirect = _glewSearchExtension("GL_AMD_multi_draw_indirect", extStart, extEnd); - if (glewExperimental || GLEW_AMD_multi_draw_indirect) GLEW_AMD_multi_draw_indirect = !_glewInit_GL_AMD_multi_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_AMD_multi_draw_indirect */ -#ifdef GL_AMD_name_gen_delete - GLEW_AMD_name_gen_delete = _glewSearchExtension("GL_AMD_name_gen_delete", extStart, extEnd); - if (glewExperimental || GLEW_AMD_name_gen_delete) GLEW_AMD_name_gen_delete = !_glewInit_GL_AMD_name_gen_delete(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_AMD_name_gen_delete */ -#ifdef GL_AMD_occlusion_query_event - GLEW_AMD_occlusion_query_event = _glewSearchExtension("GL_AMD_occlusion_query_event", extStart, extEnd); - if (glewExperimental || GLEW_AMD_occlusion_query_event) GLEW_AMD_occlusion_query_event = !_glewInit_GL_AMD_occlusion_query_event(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_AMD_occlusion_query_event */ -#ifdef GL_AMD_performance_monitor - GLEW_AMD_performance_monitor = _glewSearchExtension("GL_AMD_performance_monitor", extStart, extEnd); - if (glewExperimental || GLEW_AMD_performance_monitor) GLEW_AMD_performance_monitor = !_glewInit_GL_AMD_performance_monitor(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_AMD_performance_monitor */ -#ifdef GL_AMD_pinned_memory - GLEW_AMD_pinned_memory = _glewSearchExtension("GL_AMD_pinned_memory", extStart, extEnd); -#endif /* GL_AMD_pinned_memory */ -#ifdef GL_AMD_query_buffer_object - GLEW_AMD_query_buffer_object = _glewSearchExtension("GL_AMD_query_buffer_object", extStart, extEnd); -#endif /* GL_AMD_query_buffer_object */ -#ifdef GL_AMD_sample_positions - GLEW_AMD_sample_positions = _glewSearchExtension("GL_AMD_sample_positions", extStart, extEnd); - if (glewExperimental || GLEW_AMD_sample_positions) GLEW_AMD_sample_positions = !_glewInit_GL_AMD_sample_positions(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_AMD_sample_positions */ -#ifdef GL_AMD_seamless_cubemap_per_texture - GLEW_AMD_seamless_cubemap_per_texture = _glewSearchExtension("GL_AMD_seamless_cubemap_per_texture", extStart, extEnd); -#endif /* GL_AMD_seamless_cubemap_per_texture */ -#ifdef GL_AMD_shader_atomic_counter_ops - GLEW_AMD_shader_atomic_counter_ops = _glewSearchExtension("GL_AMD_shader_atomic_counter_ops", extStart, extEnd); -#endif /* GL_AMD_shader_atomic_counter_ops */ -#ifdef GL_AMD_shader_stencil_export - GLEW_AMD_shader_stencil_export = _glewSearchExtension("GL_AMD_shader_stencil_export", extStart, extEnd); -#endif /* GL_AMD_shader_stencil_export */ -#ifdef GL_AMD_shader_stencil_value_export - GLEW_AMD_shader_stencil_value_export = _glewSearchExtension("GL_AMD_shader_stencil_value_export", extStart, extEnd); -#endif /* GL_AMD_shader_stencil_value_export */ -#ifdef GL_AMD_shader_trinary_minmax - GLEW_AMD_shader_trinary_minmax = _glewSearchExtension("GL_AMD_shader_trinary_minmax", extStart, extEnd); -#endif /* GL_AMD_shader_trinary_minmax */ -#ifdef GL_AMD_sparse_texture - GLEW_AMD_sparse_texture = _glewSearchExtension("GL_AMD_sparse_texture", extStart, extEnd); - if (glewExperimental || GLEW_AMD_sparse_texture) GLEW_AMD_sparse_texture = !_glewInit_GL_AMD_sparse_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_AMD_sparse_texture */ -#ifdef GL_AMD_stencil_operation_extended - GLEW_AMD_stencil_operation_extended = _glewSearchExtension("GL_AMD_stencil_operation_extended", extStart, extEnd); - if (glewExperimental || GLEW_AMD_stencil_operation_extended) GLEW_AMD_stencil_operation_extended = !_glewInit_GL_AMD_stencil_operation_extended(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_AMD_stencil_operation_extended */ -#ifdef GL_AMD_texture_texture4 - GLEW_AMD_texture_texture4 = _glewSearchExtension("GL_AMD_texture_texture4", extStart, extEnd); -#endif /* GL_AMD_texture_texture4 */ -#ifdef GL_AMD_transform_feedback3_lines_triangles - GLEW_AMD_transform_feedback3_lines_triangles = _glewSearchExtension("GL_AMD_transform_feedback3_lines_triangles", extStart, extEnd); -#endif /* GL_AMD_transform_feedback3_lines_triangles */ -#ifdef GL_AMD_transform_feedback4 - GLEW_AMD_transform_feedback4 = _glewSearchExtension("GL_AMD_transform_feedback4", extStart, extEnd); -#endif /* GL_AMD_transform_feedback4 */ -#ifdef GL_AMD_vertex_shader_layer - GLEW_AMD_vertex_shader_layer = _glewSearchExtension("GL_AMD_vertex_shader_layer", extStart, extEnd); -#endif /* GL_AMD_vertex_shader_layer */ -#ifdef GL_AMD_vertex_shader_tessellator - GLEW_AMD_vertex_shader_tessellator = _glewSearchExtension("GL_AMD_vertex_shader_tessellator", extStart, extEnd); - if (glewExperimental || GLEW_AMD_vertex_shader_tessellator) GLEW_AMD_vertex_shader_tessellator = !_glewInit_GL_AMD_vertex_shader_tessellator(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_AMD_vertex_shader_tessellator */ -#ifdef GL_AMD_vertex_shader_viewport_index - GLEW_AMD_vertex_shader_viewport_index = _glewSearchExtension("GL_AMD_vertex_shader_viewport_index", extStart, extEnd); -#endif /* GL_AMD_vertex_shader_viewport_index */ -#ifdef GL_ANGLE_depth_texture - GLEW_ANGLE_depth_texture = _glewSearchExtension("GL_ANGLE_depth_texture", extStart, extEnd); -#endif /* GL_ANGLE_depth_texture */ -#ifdef GL_ANGLE_framebuffer_blit - GLEW_ANGLE_framebuffer_blit = _glewSearchExtension("GL_ANGLE_framebuffer_blit", extStart, extEnd); - if (glewExperimental || GLEW_ANGLE_framebuffer_blit) GLEW_ANGLE_framebuffer_blit = !_glewInit_GL_ANGLE_framebuffer_blit(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ANGLE_framebuffer_blit */ -#ifdef GL_ANGLE_framebuffer_multisample - GLEW_ANGLE_framebuffer_multisample = _glewSearchExtension("GL_ANGLE_framebuffer_multisample", extStart, extEnd); - if (glewExperimental || GLEW_ANGLE_framebuffer_multisample) GLEW_ANGLE_framebuffer_multisample = !_glewInit_GL_ANGLE_framebuffer_multisample(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ANGLE_framebuffer_multisample */ -#ifdef GL_ANGLE_instanced_arrays - GLEW_ANGLE_instanced_arrays = _glewSearchExtension("GL_ANGLE_instanced_arrays", extStart, extEnd); - if (glewExperimental || GLEW_ANGLE_instanced_arrays) GLEW_ANGLE_instanced_arrays = !_glewInit_GL_ANGLE_instanced_arrays(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ANGLE_instanced_arrays */ -#ifdef GL_ANGLE_pack_reverse_row_order - GLEW_ANGLE_pack_reverse_row_order = _glewSearchExtension("GL_ANGLE_pack_reverse_row_order", extStart, extEnd); -#endif /* GL_ANGLE_pack_reverse_row_order */ -#ifdef GL_ANGLE_program_binary - GLEW_ANGLE_program_binary = _glewSearchExtension("GL_ANGLE_program_binary", extStart, extEnd); -#endif /* GL_ANGLE_program_binary */ -#ifdef GL_ANGLE_texture_compression_dxt1 - GLEW_ANGLE_texture_compression_dxt1 = _glewSearchExtension("GL_ANGLE_texture_compression_dxt1", extStart, extEnd); -#endif /* GL_ANGLE_texture_compression_dxt1 */ -#ifdef GL_ANGLE_texture_compression_dxt3 - GLEW_ANGLE_texture_compression_dxt3 = _glewSearchExtension("GL_ANGLE_texture_compression_dxt3", extStart, extEnd); -#endif /* GL_ANGLE_texture_compression_dxt3 */ -#ifdef GL_ANGLE_texture_compression_dxt5 - GLEW_ANGLE_texture_compression_dxt5 = _glewSearchExtension("GL_ANGLE_texture_compression_dxt5", extStart, extEnd); -#endif /* GL_ANGLE_texture_compression_dxt5 */ -#ifdef GL_ANGLE_texture_usage - GLEW_ANGLE_texture_usage = _glewSearchExtension("GL_ANGLE_texture_usage", extStart, extEnd); -#endif /* GL_ANGLE_texture_usage */ -#ifdef GL_ANGLE_timer_query - GLEW_ANGLE_timer_query = _glewSearchExtension("GL_ANGLE_timer_query", extStart, extEnd); - if (glewExperimental || GLEW_ANGLE_timer_query) GLEW_ANGLE_timer_query = !_glewInit_GL_ANGLE_timer_query(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ANGLE_timer_query */ -#ifdef GL_ANGLE_translated_shader_source - GLEW_ANGLE_translated_shader_source = _glewSearchExtension("GL_ANGLE_translated_shader_source", extStart, extEnd); - if (glewExperimental || GLEW_ANGLE_translated_shader_source) GLEW_ANGLE_translated_shader_source = !_glewInit_GL_ANGLE_translated_shader_source(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ANGLE_translated_shader_source */ -#ifdef GL_APPLE_aux_depth_stencil - GLEW_APPLE_aux_depth_stencil = _glewSearchExtension("GL_APPLE_aux_depth_stencil", extStart, extEnd); -#endif /* GL_APPLE_aux_depth_stencil */ -#ifdef GL_APPLE_client_storage - GLEW_APPLE_client_storage = _glewSearchExtension("GL_APPLE_client_storage", extStart, extEnd); -#endif /* GL_APPLE_client_storage */ -#ifdef GL_APPLE_element_array - GLEW_APPLE_element_array = _glewSearchExtension("GL_APPLE_element_array", extStart, extEnd); - if (glewExperimental || GLEW_APPLE_element_array) GLEW_APPLE_element_array = !_glewInit_GL_APPLE_element_array(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_APPLE_element_array */ -#ifdef GL_APPLE_fence - GLEW_APPLE_fence = _glewSearchExtension("GL_APPLE_fence", extStart, extEnd); - if (glewExperimental || GLEW_APPLE_fence) GLEW_APPLE_fence = !_glewInit_GL_APPLE_fence(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_APPLE_fence */ -#ifdef GL_APPLE_float_pixels - GLEW_APPLE_float_pixels = _glewSearchExtension("GL_APPLE_float_pixels", extStart, extEnd); -#endif /* GL_APPLE_float_pixels */ -#ifdef GL_APPLE_flush_buffer_range - GLEW_APPLE_flush_buffer_range = _glewSearchExtension("GL_APPLE_flush_buffer_range", extStart, extEnd); - if (glewExperimental || GLEW_APPLE_flush_buffer_range) GLEW_APPLE_flush_buffer_range = !_glewInit_GL_APPLE_flush_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_APPLE_flush_buffer_range */ -#ifdef GL_APPLE_object_purgeable - GLEW_APPLE_object_purgeable = _glewSearchExtension("GL_APPLE_object_purgeable", extStart, extEnd); - if (glewExperimental || GLEW_APPLE_object_purgeable) GLEW_APPLE_object_purgeable = !_glewInit_GL_APPLE_object_purgeable(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_APPLE_object_purgeable */ -#ifdef GL_APPLE_pixel_buffer - GLEW_APPLE_pixel_buffer = _glewSearchExtension("GL_APPLE_pixel_buffer", extStart, extEnd); -#endif /* GL_APPLE_pixel_buffer */ -#ifdef GL_APPLE_rgb_422 - GLEW_APPLE_rgb_422 = _glewSearchExtension("GL_APPLE_rgb_422", extStart, extEnd); -#endif /* GL_APPLE_rgb_422 */ -#ifdef GL_APPLE_row_bytes - GLEW_APPLE_row_bytes = _glewSearchExtension("GL_APPLE_row_bytes", extStart, extEnd); -#endif /* GL_APPLE_row_bytes */ -#ifdef GL_APPLE_specular_vector - GLEW_APPLE_specular_vector = _glewSearchExtension("GL_APPLE_specular_vector", extStart, extEnd); -#endif /* GL_APPLE_specular_vector */ -#ifdef GL_APPLE_texture_range - GLEW_APPLE_texture_range = _glewSearchExtension("GL_APPLE_texture_range", extStart, extEnd); - if (glewExperimental || GLEW_APPLE_texture_range) GLEW_APPLE_texture_range = !_glewInit_GL_APPLE_texture_range(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_APPLE_texture_range */ -#ifdef GL_APPLE_transform_hint - GLEW_APPLE_transform_hint = _glewSearchExtension("GL_APPLE_transform_hint", extStart, extEnd); -#endif /* GL_APPLE_transform_hint */ -#ifdef GL_APPLE_vertex_array_object - GLEW_APPLE_vertex_array_object = _glewSearchExtension("GL_APPLE_vertex_array_object", extStart, extEnd); - if (glewExperimental || GLEW_APPLE_vertex_array_object) GLEW_APPLE_vertex_array_object = !_glewInit_GL_APPLE_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_APPLE_vertex_array_object */ -#ifdef GL_APPLE_vertex_array_range - GLEW_APPLE_vertex_array_range = _glewSearchExtension("GL_APPLE_vertex_array_range", extStart, extEnd); - if (glewExperimental || GLEW_APPLE_vertex_array_range) GLEW_APPLE_vertex_array_range = !_glewInit_GL_APPLE_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_APPLE_vertex_array_range */ -#ifdef GL_APPLE_vertex_program_evaluators - GLEW_APPLE_vertex_program_evaluators = _glewSearchExtension("GL_APPLE_vertex_program_evaluators", extStart, extEnd); - if (glewExperimental || GLEW_APPLE_vertex_program_evaluators) GLEW_APPLE_vertex_program_evaluators = !_glewInit_GL_APPLE_vertex_program_evaluators(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_APPLE_vertex_program_evaluators */ -#ifdef GL_APPLE_ycbcr_422 - GLEW_APPLE_ycbcr_422 = _glewSearchExtension("GL_APPLE_ycbcr_422", extStart, extEnd); -#endif /* GL_APPLE_ycbcr_422 */ -#ifdef GL_ARB_ES2_compatibility - GLEW_ARB_ES2_compatibility = _glewSearchExtension("GL_ARB_ES2_compatibility", extStart, extEnd); - if (glewExperimental || GLEW_ARB_ES2_compatibility) GLEW_ARB_ES2_compatibility = !_glewInit_GL_ARB_ES2_compatibility(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_ES2_compatibility */ -#ifdef GL_ARB_ES3_1_compatibility - GLEW_ARB_ES3_1_compatibility = _glewSearchExtension("GL_ARB_ES3_1_compatibility", extStart, extEnd); - if (glewExperimental || GLEW_ARB_ES3_1_compatibility) GLEW_ARB_ES3_1_compatibility = !_glewInit_GL_ARB_ES3_1_compatibility(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_ES3_1_compatibility */ -#ifdef GL_ARB_ES3_2_compatibility - GLEW_ARB_ES3_2_compatibility = _glewSearchExtension("GL_ARB_ES3_2_compatibility", extStart, extEnd); - if (glewExperimental || GLEW_ARB_ES3_2_compatibility) GLEW_ARB_ES3_2_compatibility = !_glewInit_GL_ARB_ES3_2_compatibility(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_ES3_2_compatibility */ -#ifdef GL_ARB_ES3_compatibility - GLEW_ARB_ES3_compatibility = _glewSearchExtension("GL_ARB_ES3_compatibility", extStart, extEnd); -#endif /* GL_ARB_ES3_compatibility */ -#ifdef GL_ARB_arrays_of_arrays - GLEW_ARB_arrays_of_arrays = _glewSearchExtension("GL_ARB_arrays_of_arrays", extStart, extEnd); -#endif /* GL_ARB_arrays_of_arrays */ -#ifdef GL_ARB_base_instance - GLEW_ARB_base_instance = _glewSearchExtension("GL_ARB_base_instance", extStart, extEnd); - if (glewExperimental || GLEW_ARB_base_instance) GLEW_ARB_base_instance = !_glewInit_GL_ARB_base_instance(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_base_instance */ -#ifdef GL_ARB_bindless_texture - GLEW_ARB_bindless_texture = _glewSearchExtension("GL_ARB_bindless_texture", extStart, extEnd); - if (glewExperimental || GLEW_ARB_bindless_texture) GLEW_ARB_bindless_texture = !_glewInit_GL_ARB_bindless_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_bindless_texture */ -#ifdef GL_ARB_blend_func_extended - GLEW_ARB_blend_func_extended = _glewSearchExtension("GL_ARB_blend_func_extended", extStart, extEnd); - if (glewExperimental || GLEW_ARB_blend_func_extended) GLEW_ARB_blend_func_extended = !_glewInit_GL_ARB_blend_func_extended(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_blend_func_extended */ -#ifdef GL_ARB_buffer_storage - GLEW_ARB_buffer_storage = _glewSearchExtension("GL_ARB_buffer_storage", extStart, extEnd); - if (glewExperimental || GLEW_ARB_buffer_storage) GLEW_ARB_buffer_storage = !_glewInit_GL_ARB_buffer_storage(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_buffer_storage */ -#ifdef GL_ARB_cl_event - GLEW_ARB_cl_event = _glewSearchExtension("GL_ARB_cl_event", extStart, extEnd); - if (glewExperimental || GLEW_ARB_cl_event) GLEW_ARB_cl_event = !_glewInit_GL_ARB_cl_event(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_cl_event */ -#ifdef GL_ARB_clear_buffer_object - GLEW_ARB_clear_buffer_object = _glewSearchExtension("GL_ARB_clear_buffer_object", extStart, extEnd); - if (glewExperimental || GLEW_ARB_clear_buffer_object) GLEW_ARB_clear_buffer_object = !_glewInit_GL_ARB_clear_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_clear_buffer_object */ -#ifdef GL_ARB_clear_texture - GLEW_ARB_clear_texture = _glewSearchExtension("GL_ARB_clear_texture", extStart, extEnd); - if (glewExperimental || GLEW_ARB_clear_texture) GLEW_ARB_clear_texture = !_glewInit_GL_ARB_clear_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_clear_texture */ -#ifdef GL_ARB_clip_control - GLEW_ARB_clip_control = _glewSearchExtension("GL_ARB_clip_control", extStart, extEnd); - if (glewExperimental || GLEW_ARB_clip_control) GLEW_ARB_clip_control = !_glewInit_GL_ARB_clip_control(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_clip_control */ -#ifdef GL_ARB_color_buffer_float - GLEW_ARB_color_buffer_float = _glewSearchExtension("GL_ARB_color_buffer_float", extStart, extEnd); - if (glewExperimental || GLEW_ARB_color_buffer_float) GLEW_ARB_color_buffer_float = !_glewInit_GL_ARB_color_buffer_float(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_color_buffer_float */ -#ifdef GL_ARB_compatibility - GLEW_ARB_compatibility = _glewSearchExtension("GL_ARB_compatibility", extStart, extEnd); -#endif /* GL_ARB_compatibility */ -#ifdef GL_ARB_compressed_texture_pixel_storage - GLEW_ARB_compressed_texture_pixel_storage = _glewSearchExtension("GL_ARB_compressed_texture_pixel_storage", extStart, extEnd); -#endif /* GL_ARB_compressed_texture_pixel_storage */ -#ifdef GL_ARB_compute_shader - GLEW_ARB_compute_shader = _glewSearchExtension("GL_ARB_compute_shader", extStart, extEnd); - if (glewExperimental || GLEW_ARB_compute_shader) GLEW_ARB_compute_shader = !_glewInit_GL_ARB_compute_shader(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_compute_shader */ -#ifdef GL_ARB_compute_variable_group_size - GLEW_ARB_compute_variable_group_size = _glewSearchExtension("GL_ARB_compute_variable_group_size", extStart, extEnd); - if (glewExperimental || GLEW_ARB_compute_variable_group_size) GLEW_ARB_compute_variable_group_size = !_glewInit_GL_ARB_compute_variable_group_size(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_compute_variable_group_size */ -#ifdef GL_ARB_conditional_render_inverted - GLEW_ARB_conditional_render_inverted = _glewSearchExtension("GL_ARB_conditional_render_inverted", extStart, extEnd); -#endif /* GL_ARB_conditional_render_inverted */ -#ifdef GL_ARB_conservative_depth - GLEW_ARB_conservative_depth = _glewSearchExtension("GL_ARB_conservative_depth", extStart, extEnd); -#endif /* GL_ARB_conservative_depth */ -#ifdef GL_ARB_copy_buffer - GLEW_ARB_copy_buffer = _glewSearchExtension("GL_ARB_copy_buffer", extStart, extEnd); - if (glewExperimental || GLEW_ARB_copy_buffer) GLEW_ARB_copy_buffer = !_glewInit_GL_ARB_copy_buffer(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_copy_buffer */ -#ifdef GL_ARB_copy_image - GLEW_ARB_copy_image = _glewSearchExtension("GL_ARB_copy_image", extStart, extEnd); - if (glewExperimental || GLEW_ARB_copy_image) GLEW_ARB_copy_image = !_glewInit_GL_ARB_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_copy_image */ -#ifdef GL_ARB_cull_distance - GLEW_ARB_cull_distance = _glewSearchExtension("GL_ARB_cull_distance", extStart, extEnd); -#endif /* GL_ARB_cull_distance */ -#ifdef GL_ARB_debug_output - GLEW_ARB_debug_output = _glewSearchExtension("GL_ARB_debug_output", extStart, extEnd); - if (glewExperimental || GLEW_ARB_debug_output) GLEW_ARB_debug_output = !_glewInit_GL_ARB_debug_output(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_debug_output */ -#ifdef GL_ARB_depth_buffer_float - GLEW_ARB_depth_buffer_float = _glewSearchExtension("GL_ARB_depth_buffer_float", extStart, extEnd); -#endif /* GL_ARB_depth_buffer_float */ -#ifdef GL_ARB_depth_clamp - GLEW_ARB_depth_clamp = _glewSearchExtension("GL_ARB_depth_clamp", extStart, extEnd); -#endif /* GL_ARB_depth_clamp */ -#ifdef GL_ARB_depth_texture - GLEW_ARB_depth_texture = _glewSearchExtension("GL_ARB_depth_texture", extStart, extEnd); -#endif /* GL_ARB_depth_texture */ -#ifdef GL_ARB_derivative_control - GLEW_ARB_derivative_control = _glewSearchExtension("GL_ARB_derivative_control", extStart, extEnd); -#endif /* GL_ARB_derivative_control */ -#ifdef GL_ARB_direct_state_access - GLEW_ARB_direct_state_access = _glewSearchExtension("GL_ARB_direct_state_access", extStart, extEnd); - if (glewExperimental || GLEW_ARB_direct_state_access) GLEW_ARB_direct_state_access = !_glewInit_GL_ARB_direct_state_access(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_direct_state_access */ -#ifdef GL_ARB_draw_buffers - GLEW_ARB_draw_buffers = _glewSearchExtension("GL_ARB_draw_buffers", extStart, extEnd); - if (glewExperimental || GLEW_ARB_draw_buffers) GLEW_ARB_draw_buffers = !_glewInit_GL_ARB_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_draw_buffers */ -#ifdef GL_ARB_draw_buffers_blend - GLEW_ARB_draw_buffers_blend = _glewSearchExtension("GL_ARB_draw_buffers_blend", extStart, extEnd); - if (glewExperimental || GLEW_ARB_draw_buffers_blend) GLEW_ARB_draw_buffers_blend = !_glewInit_GL_ARB_draw_buffers_blend(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_draw_buffers_blend */ -#ifdef GL_ARB_draw_elements_base_vertex - GLEW_ARB_draw_elements_base_vertex = _glewSearchExtension("GL_ARB_draw_elements_base_vertex", extStart, extEnd); - if (glewExperimental || GLEW_ARB_draw_elements_base_vertex) GLEW_ARB_draw_elements_base_vertex = !_glewInit_GL_ARB_draw_elements_base_vertex(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_draw_elements_base_vertex */ -#ifdef GL_ARB_draw_indirect - GLEW_ARB_draw_indirect = _glewSearchExtension("GL_ARB_draw_indirect", extStart, extEnd); - if (glewExperimental || GLEW_ARB_draw_indirect) GLEW_ARB_draw_indirect = !_glewInit_GL_ARB_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_draw_indirect */ -#ifdef GL_ARB_draw_instanced - GLEW_ARB_draw_instanced = _glewSearchExtension("GL_ARB_draw_instanced", extStart, extEnd); -#endif /* GL_ARB_draw_instanced */ -#ifdef GL_ARB_enhanced_layouts - GLEW_ARB_enhanced_layouts = _glewSearchExtension("GL_ARB_enhanced_layouts", extStart, extEnd); -#endif /* GL_ARB_enhanced_layouts */ -#ifdef GL_ARB_explicit_attrib_location - GLEW_ARB_explicit_attrib_location = _glewSearchExtension("GL_ARB_explicit_attrib_location", extStart, extEnd); -#endif /* GL_ARB_explicit_attrib_location */ -#ifdef GL_ARB_explicit_uniform_location - GLEW_ARB_explicit_uniform_location = _glewSearchExtension("GL_ARB_explicit_uniform_location", extStart, extEnd); -#endif /* GL_ARB_explicit_uniform_location */ -#ifdef GL_ARB_fragment_coord_conventions - GLEW_ARB_fragment_coord_conventions = _glewSearchExtension("GL_ARB_fragment_coord_conventions", extStart, extEnd); -#endif /* GL_ARB_fragment_coord_conventions */ -#ifdef GL_ARB_fragment_layer_viewport - GLEW_ARB_fragment_layer_viewport = _glewSearchExtension("GL_ARB_fragment_layer_viewport", extStart, extEnd); -#endif /* GL_ARB_fragment_layer_viewport */ -#ifdef GL_ARB_fragment_program - GLEW_ARB_fragment_program = _glewSearchExtension("GL_ARB_fragment_program", extStart, extEnd); -#endif /* GL_ARB_fragment_program */ -#ifdef GL_ARB_fragment_program_shadow - GLEW_ARB_fragment_program_shadow = _glewSearchExtension("GL_ARB_fragment_program_shadow", extStart, extEnd); -#endif /* GL_ARB_fragment_program_shadow */ -#ifdef GL_ARB_fragment_shader - GLEW_ARB_fragment_shader = _glewSearchExtension("GL_ARB_fragment_shader", extStart, extEnd); -#endif /* GL_ARB_fragment_shader */ -#ifdef GL_ARB_fragment_shader_interlock - GLEW_ARB_fragment_shader_interlock = _glewSearchExtension("GL_ARB_fragment_shader_interlock", extStart, extEnd); -#endif /* GL_ARB_fragment_shader_interlock */ -#ifdef GL_ARB_framebuffer_no_attachments - GLEW_ARB_framebuffer_no_attachments = _glewSearchExtension("GL_ARB_framebuffer_no_attachments", extStart, extEnd); - if (glewExperimental || GLEW_ARB_framebuffer_no_attachments) GLEW_ARB_framebuffer_no_attachments = !_glewInit_GL_ARB_framebuffer_no_attachments(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_framebuffer_no_attachments */ -#ifdef GL_ARB_framebuffer_object - GLEW_ARB_framebuffer_object = _glewSearchExtension("GL_ARB_framebuffer_object", extStart, extEnd); - if (glewExperimental || GLEW_ARB_framebuffer_object) GLEW_ARB_framebuffer_object = !_glewInit_GL_ARB_framebuffer_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_framebuffer_object */ -#ifdef GL_ARB_framebuffer_sRGB - GLEW_ARB_framebuffer_sRGB = _glewSearchExtension("GL_ARB_framebuffer_sRGB", extStart, extEnd); -#endif /* GL_ARB_framebuffer_sRGB */ -#ifdef GL_ARB_geometry_shader4 - GLEW_ARB_geometry_shader4 = _glewSearchExtension("GL_ARB_geometry_shader4", extStart, extEnd); - if (glewExperimental || GLEW_ARB_geometry_shader4) GLEW_ARB_geometry_shader4 = !_glewInit_GL_ARB_geometry_shader4(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_geometry_shader4 */ -#ifdef GL_ARB_get_program_binary - GLEW_ARB_get_program_binary = _glewSearchExtension("GL_ARB_get_program_binary", extStart, extEnd); - if (glewExperimental || GLEW_ARB_get_program_binary) GLEW_ARB_get_program_binary = !_glewInit_GL_ARB_get_program_binary(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_get_program_binary */ -#ifdef GL_ARB_get_texture_sub_image - GLEW_ARB_get_texture_sub_image = _glewSearchExtension("GL_ARB_get_texture_sub_image", extStart, extEnd); - if (glewExperimental || GLEW_ARB_get_texture_sub_image) GLEW_ARB_get_texture_sub_image = !_glewInit_GL_ARB_get_texture_sub_image(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_get_texture_sub_image */ -#ifdef GL_ARB_gpu_shader5 - GLEW_ARB_gpu_shader5 = _glewSearchExtension("GL_ARB_gpu_shader5", extStart, extEnd); -#endif /* GL_ARB_gpu_shader5 */ -#ifdef GL_ARB_gpu_shader_fp64 - GLEW_ARB_gpu_shader_fp64 = _glewSearchExtension("GL_ARB_gpu_shader_fp64", extStart, extEnd); - if (glewExperimental || GLEW_ARB_gpu_shader_fp64) GLEW_ARB_gpu_shader_fp64 = !_glewInit_GL_ARB_gpu_shader_fp64(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_gpu_shader_fp64 */ -#ifdef GL_ARB_gpu_shader_int64 - GLEW_ARB_gpu_shader_int64 = _glewSearchExtension("GL_ARB_gpu_shader_int64", extStart, extEnd); - if (glewExperimental || GLEW_ARB_gpu_shader_int64) GLEW_ARB_gpu_shader_int64 = !_glewInit_GL_ARB_gpu_shader_int64(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_gpu_shader_int64 */ -#ifdef GL_ARB_half_float_pixel - GLEW_ARB_half_float_pixel = _glewSearchExtension("GL_ARB_half_float_pixel", extStart, extEnd); -#endif /* GL_ARB_half_float_pixel */ -#ifdef GL_ARB_half_float_vertex - GLEW_ARB_half_float_vertex = _glewSearchExtension("GL_ARB_half_float_vertex", extStart, extEnd); -#endif /* GL_ARB_half_float_vertex */ -#ifdef GL_ARB_imaging - GLEW_ARB_imaging = _glewSearchExtension("GL_ARB_imaging", extStart, extEnd); - if (glewExperimental || GLEW_ARB_imaging) GLEW_ARB_imaging = !_glewInit_GL_ARB_imaging(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_imaging */ -#ifdef GL_ARB_indirect_parameters - GLEW_ARB_indirect_parameters = _glewSearchExtension("GL_ARB_indirect_parameters", extStart, extEnd); - if (glewExperimental || GLEW_ARB_indirect_parameters) GLEW_ARB_indirect_parameters = !_glewInit_GL_ARB_indirect_parameters(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_indirect_parameters */ -#ifdef GL_ARB_instanced_arrays - GLEW_ARB_instanced_arrays = _glewSearchExtension("GL_ARB_instanced_arrays", extStart, extEnd); - if (glewExperimental || GLEW_ARB_instanced_arrays) GLEW_ARB_instanced_arrays = !_glewInit_GL_ARB_instanced_arrays(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_instanced_arrays */ -#ifdef GL_ARB_internalformat_query - GLEW_ARB_internalformat_query = _glewSearchExtension("GL_ARB_internalformat_query", extStart, extEnd); - if (glewExperimental || GLEW_ARB_internalformat_query) GLEW_ARB_internalformat_query = !_glewInit_GL_ARB_internalformat_query(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_internalformat_query */ -#ifdef GL_ARB_internalformat_query2 - GLEW_ARB_internalformat_query2 = _glewSearchExtension("GL_ARB_internalformat_query2", extStart, extEnd); - if (glewExperimental || GLEW_ARB_internalformat_query2) GLEW_ARB_internalformat_query2 = !_glewInit_GL_ARB_internalformat_query2(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_internalformat_query2 */ -#ifdef GL_ARB_invalidate_subdata - GLEW_ARB_invalidate_subdata = _glewSearchExtension("GL_ARB_invalidate_subdata", extStart, extEnd); - if (glewExperimental || GLEW_ARB_invalidate_subdata) GLEW_ARB_invalidate_subdata = !_glewInit_GL_ARB_invalidate_subdata(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_invalidate_subdata */ -#ifdef GL_ARB_map_buffer_alignment - GLEW_ARB_map_buffer_alignment = _glewSearchExtension("GL_ARB_map_buffer_alignment", extStart, extEnd); -#endif /* GL_ARB_map_buffer_alignment */ -#ifdef GL_ARB_map_buffer_range - GLEW_ARB_map_buffer_range = _glewSearchExtension("GL_ARB_map_buffer_range", extStart, extEnd); - if (glewExperimental || GLEW_ARB_map_buffer_range) GLEW_ARB_map_buffer_range = !_glewInit_GL_ARB_map_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_map_buffer_range */ -#ifdef GL_ARB_matrix_palette - GLEW_ARB_matrix_palette = _glewSearchExtension("GL_ARB_matrix_palette", extStart, extEnd); - if (glewExperimental || GLEW_ARB_matrix_palette) GLEW_ARB_matrix_palette = !_glewInit_GL_ARB_matrix_palette(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_matrix_palette */ -#ifdef GL_ARB_multi_bind - GLEW_ARB_multi_bind = _glewSearchExtension("GL_ARB_multi_bind", extStart, extEnd); - if (glewExperimental || GLEW_ARB_multi_bind) GLEW_ARB_multi_bind = !_glewInit_GL_ARB_multi_bind(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_multi_bind */ -#ifdef GL_ARB_multi_draw_indirect - GLEW_ARB_multi_draw_indirect = _glewSearchExtension("GL_ARB_multi_draw_indirect", extStart, extEnd); - if (glewExperimental || GLEW_ARB_multi_draw_indirect) GLEW_ARB_multi_draw_indirect = !_glewInit_GL_ARB_multi_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_multi_draw_indirect */ -#ifdef GL_ARB_multisample - GLEW_ARB_multisample = _glewSearchExtension("GL_ARB_multisample", extStart, extEnd); - if (glewExperimental || GLEW_ARB_multisample) GLEW_ARB_multisample = !_glewInit_GL_ARB_multisample(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_multisample */ -#ifdef GL_ARB_multitexture - GLEW_ARB_multitexture = _glewSearchExtension("GL_ARB_multitexture", extStart, extEnd); - if (glewExperimental || GLEW_ARB_multitexture) GLEW_ARB_multitexture = !_glewInit_GL_ARB_multitexture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_multitexture */ -#ifdef GL_ARB_occlusion_query - GLEW_ARB_occlusion_query = _glewSearchExtension("GL_ARB_occlusion_query", extStart, extEnd); - if (glewExperimental || GLEW_ARB_occlusion_query) GLEW_ARB_occlusion_query = !_glewInit_GL_ARB_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_occlusion_query */ -#ifdef GL_ARB_occlusion_query2 - GLEW_ARB_occlusion_query2 = _glewSearchExtension("GL_ARB_occlusion_query2", extStart, extEnd); -#endif /* GL_ARB_occlusion_query2 */ -#ifdef GL_ARB_parallel_shader_compile - GLEW_ARB_parallel_shader_compile = _glewSearchExtension("GL_ARB_parallel_shader_compile", extStart, extEnd); - if (glewExperimental || GLEW_ARB_parallel_shader_compile) GLEW_ARB_parallel_shader_compile = !_glewInit_GL_ARB_parallel_shader_compile(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_parallel_shader_compile */ -#ifdef GL_ARB_pipeline_statistics_query - GLEW_ARB_pipeline_statistics_query = _glewSearchExtension("GL_ARB_pipeline_statistics_query", extStart, extEnd); -#endif /* GL_ARB_pipeline_statistics_query */ -#ifdef GL_ARB_pixel_buffer_object - GLEW_ARB_pixel_buffer_object = _glewSearchExtension("GL_ARB_pixel_buffer_object", extStart, extEnd); -#endif /* GL_ARB_pixel_buffer_object */ -#ifdef GL_ARB_point_parameters - GLEW_ARB_point_parameters = _glewSearchExtension("GL_ARB_point_parameters", extStart, extEnd); - if (glewExperimental || GLEW_ARB_point_parameters) GLEW_ARB_point_parameters = !_glewInit_GL_ARB_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_point_parameters */ -#ifdef GL_ARB_point_sprite - GLEW_ARB_point_sprite = _glewSearchExtension("GL_ARB_point_sprite", extStart, extEnd); -#endif /* GL_ARB_point_sprite */ -#ifdef GL_ARB_post_depth_coverage - GLEW_ARB_post_depth_coverage = _glewSearchExtension("GL_ARB_post_depth_coverage", extStart, extEnd); -#endif /* GL_ARB_post_depth_coverage */ -#ifdef GL_ARB_program_interface_query - GLEW_ARB_program_interface_query = _glewSearchExtension("GL_ARB_program_interface_query", extStart, extEnd); - if (glewExperimental || GLEW_ARB_program_interface_query) GLEW_ARB_program_interface_query = !_glewInit_GL_ARB_program_interface_query(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_program_interface_query */ -#ifdef GL_ARB_provoking_vertex - GLEW_ARB_provoking_vertex = _glewSearchExtension("GL_ARB_provoking_vertex", extStart, extEnd); - if (glewExperimental || GLEW_ARB_provoking_vertex) GLEW_ARB_provoking_vertex = !_glewInit_GL_ARB_provoking_vertex(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_provoking_vertex */ -#ifdef GL_ARB_query_buffer_object - GLEW_ARB_query_buffer_object = _glewSearchExtension("GL_ARB_query_buffer_object", extStart, extEnd); -#endif /* GL_ARB_query_buffer_object */ -#ifdef GL_ARB_robust_buffer_access_behavior - GLEW_ARB_robust_buffer_access_behavior = _glewSearchExtension("GL_ARB_robust_buffer_access_behavior", extStart, extEnd); -#endif /* GL_ARB_robust_buffer_access_behavior */ -#ifdef GL_ARB_robustness - GLEW_ARB_robustness = _glewSearchExtension("GL_ARB_robustness", extStart, extEnd); - if (glewExperimental || GLEW_ARB_robustness) GLEW_ARB_robustness = !_glewInit_GL_ARB_robustness(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_robustness */ -#ifdef GL_ARB_robustness_application_isolation - GLEW_ARB_robustness_application_isolation = _glewSearchExtension("GL_ARB_robustness_application_isolation", extStart, extEnd); -#endif /* GL_ARB_robustness_application_isolation */ -#ifdef GL_ARB_robustness_share_group_isolation - GLEW_ARB_robustness_share_group_isolation = _glewSearchExtension("GL_ARB_robustness_share_group_isolation", extStart, extEnd); -#endif /* GL_ARB_robustness_share_group_isolation */ -#ifdef GL_ARB_sample_locations - GLEW_ARB_sample_locations = _glewSearchExtension("GL_ARB_sample_locations", extStart, extEnd); - if (glewExperimental || GLEW_ARB_sample_locations) GLEW_ARB_sample_locations = !_glewInit_GL_ARB_sample_locations(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_sample_locations */ -#ifdef GL_ARB_sample_shading - GLEW_ARB_sample_shading = _glewSearchExtension("GL_ARB_sample_shading", extStart, extEnd); - if (glewExperimental || GLEW_ARB_sample_shading) GLEW_ARB_sample_shading = !_glewInit_GL_ARB_sample_shading(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_sample_shading */ -#ifdef GL_ARB_sampler_objects - GLEW_ARB_sampler_objects = _glewSearchExtension("GL_ARB_sampler_objects", extStart, extEnd); - if (glewExperimental || GLEW_ARB_sampler_objects) GLEW_ARB_sampler_objects = !_glewInit_GL_ARB_sampler_objects(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_sampler_objects */ -#ifdef GL_ARB_seamless_cube_map - GLEW_ARB_seamless_cube_map = _glewSearchExtension("GL_ARB_seamless_cube_map", extStart, extEnd); -#endif /* GL_ARB_seamless_cube_map */ -#ifdef GL_ARB_seamless_cubemap_per_texture - GLEW_ARB_seamless_cubemap_per_texture = _glewSearchExtension("GL_ARB_seamless_cubemap_per_texture", extStart, extEnd); -#endif /* GL_ARB_seamless_cubemap_per_texture */ -#ifdef GL_ARB_separate_shader_objects - GLEW_ARB_separate_shader_objects = _glewSearchExtension("GL_ARB_separate_shader_objects", extStart, extEnd); - if (glewExperimental || GLEW_ARB_separate_shader_objects) GLEW_ARB_separate_shader_objects = !_glewInit_GL_ARB_separate_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_separate_shader_objects */ -#ifdef GL_ARB_shader_atomic_counter_ops - GLEW_ARB_shader_atomic_counter_ops = _glewSearchExtension("GL_ARB_shader_atomic_counter_ops", extStart, extEnd); -#endif /* GL_ARB_shader_atomic_counter_ops */ -#ifdef GL_ARB_shader_atomic_counters - GLEW_ARB_shader_atomic_counters = _glewSearchExtension("GL_ARB_shader_atomic_counters", extStart, extEnd); - if (glewExperimental || GLEW_ARB_shader_atomic_counters) GLEW_ARB_shader_atomic_counters = !_glewInit_GL_ARB_shader_atomic_counters(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_shader_atomic_counters */ -#ifdef GL_ARB_shader_ballot - GLEW_ARB_shader_ballot = _glewSearchExtension("GL_ARB_shader_ballot", extStart, extEnd); -#endif /* GL_ARB_shader_ballot */ -#ifdef GL_ARB_shader_bit_encoding - GLEW_ARB_shader_bit_encoding = _glewSearchExtension("GL_ARB_shader_bit_encoding", extStart, extEnd); -#endif /* GL_ARB_shader_bit_encoding */ -#ifdef GL_ARB_shader_clock - GLEW_ARB_shader_clock = _glewSearchExtension("GL_ARB_shader_clock", extStart, extEnd); -#endif /* GL_ARB_shader_clock */ -#ifdef GL_ARB_shader_draw_parameters - GLEW_ARB_shader_draw_parameters = _glewSearchExtension("GL_ARB_shader_draw_parameters", extStart, extEnd); -#endif /* GL_ARB_shader_draw_parameters */ -#ifdef GL_ARB_shader_group_vote - GLEW_ARB_shader_group_vote = _glewSearchExtension("GL_ARB_shader_group_vote", extStart, extEnd); -#endif /* GL_ARB_shader_group_vote */ -#ifdef GL_ARB_shader_image_load_store - GLEW_ARB_shader_image_load_store = _glewSearchExtension("GL_ARB_shader_image_load_store", extStart, extEnd); - if (glewExperimental || GLEW_ARB_shader_image_load_store) GLEW_ARB_shader_image_load_store = !_glewInit_GL_ARB_shader_image_load_store(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_shader_image_load_store */ -#ifdef GL_ARB_shader_image_size - GLEW_ARB_shader_image_size = _glewSearchExtension("GL_ARB_shader_image_size", extStart, extEnd); -#endif /* GL_ARB_shader_image_size */ -#ifdef GL_ARB_shader_objects - GLEW_ARB_shader_objects = _glewSearchExtension("GL_ARB_shader_objects", extStart, extEnd); - if (glewExperimental || GLEW_ARB_shader_objects) GLEW_ARB_shader_objects = !_glewInit_GL_ARB_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_shader_objects */ -#ifdef GL_ARB_shader_precision - GLEW_ARB_shader_precision = _glewSearchExtension("GL_ARB_shader_precision", extStart, extEnd); -#endif /* GL_ARB_shader_precision */ -#ifdef GL_ARB_shader_stencil_export - GLEW_ARB_shader_stencil_export = _glewSearchExtension("GL_ARB_shader_stencil_export", extStart, extEnd); -#endif /* GL_ARB_shader_stencil_export */ -#ifdef GL_ARB_shader_storage_buffer_object - GLEW_ARB_shader_storage_buffer_object = _glewSearchExtension("GL_ARB_shader_storage_buffer_object", extStart, extEnd); - if (glewExperimental || GLEW_ARB_shader_storage_buffer_object) GLEW_ARB_shader_storage_buffer_object = !_glewInit_GL_ARB_shader_storage_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_shader_storage_buffer_object */ -#ifdef GL_ARB_shader_subroutine - GLEW_ARB_shader_subroutine = _glewSearchExtension("GL_ARB_shader_subroutine", extStart, extEnd); - if (glewExperimental || GLEW_ARB_shader_subroutine) GLEW_ARB_shader_subroutine = !_glewInit_GL_ARB_shader_subroutine(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_shader_subroutine */ -#ifdef GL_ARB_shader_texture_image_samples - GLEW_ARB_shader_texture_image_samples = _glewSearchExtension("GL_ARB_shader_texture_image_samples", extStart, extEnd); -#endif /* GL_ARB_shader_texture_image_samples */ -#ifdef GL_ARB_shader_texture_lod - GLEW_ARB_shader_texture_lod = _glewSearchExtension("GL_ARB_shader_texture_lod", extStart, extEnd); -#endif /* GL_ARB_shader_texture_lod */ -#ifdef GL_ARB_shader_viewport_layer_array - GLEW_ARB_shader_viewport_layer_array = _glewSearchExtension("GL_ARB_shader_viewport_layer_array", extStart, extEnd); -#endif /* GL_ARB_shader_viewport_layer_array */ -#ifdef GL_ARB_shading_language_100 - GLEW_ARB_shading_language_100 = _glewSearchExtension("GL_ARB_shading_language_100", extStart, extEnd); -#endif /* GL_ARB_shading_language_100 */ -#ifdef GL_ARB_shading_language_420pack - GLEW_ARB_shading_language_420pack = _glewSearchExtension("GL_ARB_shading_language_420pack", extStart, extEnd); -#endif /* GL_ARB_shading_language_420pack */ -#ifdef GL_ARB_shading_language_include - GLEW_ARB_shading_language_include = _glewSearchExtension("GL_ARB_shading_language_include", extStart, extEnd); - if (glewExperimental || GLEW_ARB_shading_language_include) GLEW_ARB_shading_language_include = !_glewInit_GL_ARB_shading_language_include(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_shading_language_include */ -#ifdef GL_ARB_shading_language_packing - GLEW_ARB_shading_language_packing = _glewSearchExtension("GL_ARB_shading_language_packing", extStart, extEnd); -#endif /* GL_ARB_shading_language_packing */ -#ifdef GL_ARB_shadow - GLEW_ARB_shadow = _glewSearchExtension("GL_ARB_shadow", extStart, extEnd); -#endif /* GL_ARB_shadow */ -#ifdef GL_ARB_shadow_ambient - GLEW_ARB_shadow_ambient = _glewSearchExtension("GL_ARB_shadow_ambient", extStart, extEnd); -#endif /* GL_ARB_shadow_ambient */ -#ifdef GL_ARB_sparse_buffer - GLEW_ARB_sparse_buffer = _glewSearchExtension("GL_ARB_sparse_buffer", extStart, extEnd); - if (glewExperimental || GLEW_ARB_sparse_buffer) GLEW_ARB_sparse_buffer = !_glewInit_GL_ARB_sparse_buffer(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_sparse_buffer */ -#ifdef GL_ARB_sparse_texture - GLEW_ARB_sparse_texture = _glewSearchExtension("GL_ARB_sparse_texture", extStart, extEnd); - if (glewExperimental || GLEW_ARB_sparse_texture) GLEW_ARB_sparse_texture = !_glewInit_GL_ARB_sparse_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_sparse_texture */ -#ifdef GL_ARB_sparse_texture2 - GLEW_ARB_sparse_texture2 = _glewSearchExtension("GL_ARB_sparse_texture2", extStart, extEnd); -#endif /* GL_ARB_sparse_texture2 */ -#ifdef GL_ARB_sparse_texture_clamp - GLEW_ARB_sparse_texture_clamp = _glewSearchExtension("GL_ARB_sparse_texture_clamp", extStart, extEnd); -#endif /* GL_ARB_sparse_texture_clamp */ -#ifdef GL_ARB_stencil_texturing - GLEW_ARB_stencil_texturing = _glewSearchExtension("GL_ARB_stencil_texturing", extStart, extEnd); -#endif /* GL_ARB_stencil_texturing */ -#ifdef GL_ARB_sync - GLEW_ARB_sync = _glewSearchExtension("GL_ARB_sync", extStart, extEnd); - if (glewExperimental || GLEW_ARB_sync) GLEW_ARB_sync = !_glewInit_GL_ARB_sync(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_sync */ -#ifdef GL_ARB_tessellation_shader - GLEW_ARB_tessellation_shader = _glewSearchExtension("GL_ARB_tessellation_shader", extStart, extEnd); - if (glewExperimental || GLEW_ARB_tessellation_shader) GLEW_ARB_tessellation_shader = !_glewInit_GL_ARB_tessellation_shader(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_tessellation_shader */ -#ifdef GL_ARB_texture_barrier - GLEW_ARB_texture_barrier = _glewSearchExtension("GL_ARB_texture_barrier", extStart, extEnd); - if (glewExperimental || GLEW_ARB_texture_barrier) GLEW_ARB_texture_barrier = !_glewInit_GL_ARB_texture_barrier(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_texture_barrier */ -#ifdef GL_ARB_texture_border_clamp - GLEW_ARB_texture_border_clamp = _glewSearchExtension("GL_ARB_texture_border_clamp", extStart, extEnd); -#endif /* GL_ARB_texture_border_clamp */ -#ifdef GL_ARB_texture_buffer_object - GLEW_ARB_texture_buffer_object = _glewSearchExtension("GL_ARB_texture_buffer_object", extStart, extEnd); - if (glewExperimental || GLEW_ARB_texture_buffer_object) GLEW_ARB_texture_buffer_object = !_glewInit_GL_ARB_texture_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_texture_buffer_object */ -#ifdef GL_ARB_texture_buffer_object_rgb32 - GLEW_ARB_texture_buffer_object_rgb32 = _glewSearchExtension("GL_ARB_texture_buffer_object_rgb32", extStart, extEnd); -#endif /* GL_ARB_texture_buffer_object_rgb32 */ -#ifdef GL_ARB_texture_buffer_range - GLEW_ARB_texture_buffer_range = _glewSearchExtension("GL_ARB_texture_buffer_range", extStart, extEnd); - if (glewExperimental || GLEW_ARB_texture_buffer_range) GLEW_ARB_texture_buffer_range = !_glewInit_GL_ARB_texture_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_texture_buffer_range */ -#ifdef GL_ARB_texture_compression - GLEW_ARB_texture_compression = _glewSearchExtension("GL_ARB_texture_compression", extStart, extEnd); - if (glewExperimental || GLEW_ARB_texture_compression) GLEW_ARB_texture_compression = !_glewInit_GL_ARB_texture_compression(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_texture_compression */ -#ifdef GL_ARB_texture_compression_bptc - GLEW_ARB_texture_compression_bptc = _glewSearchExtension("GL_ARB_texture_compression_bptc", extStart, extEnd); -#endif /* GL_ARB_texture_compression_bptc */ -#ifdef GL_ARB_texture_compression_rgtc - GLEW_ARB_texture_compression_rgtc = _glewSearchExtension("GL_ARB_texture_compression_rgtc", extStart, extEnd); -#endif /* GL_ARB_texture_compression_rgtc */ -#ifdef GL_ARB_texture_cube_map - GLEW_ARB_texture_cube_map = _glewSearchExtension("GL_ARB_texture_cube_map", extStart, extEnd); -#endif /* GL_ARB_texture_cube_map */ -#ifdef GL_ARB_texture_cube_map_array - GLEW_ARB_texture_cube_map_array = _glewSearchExtension("GL_ARB_texture_cube_map_array", extStart, extEnd); -#endif /* GL_ARB_texture_cube_map_array */ -#ifdef GL_ARB_texture_env_add - GLEW_ARB_texture_env_add = _glewSearchExtension("GL_ARB_texture_env_add", extStart, extEnd); -#endif /* GL_ARB_texture_env_add */ -#ifdef GL_ARB_texture_env_combine - GLEW_ARB_texture_env_combine = _glewSearchExtension("GL_ARB_texture_env_combine", extStart, extEnd); -#endif /* GL_ARB_texture_env_combine */ -#ifdef GL_ARB_texture_env_crossbar - GLEW_ARB_texture_env_crossbar = _glewSearchExtension("GL_ARB_texture_env_crossbar", extStart, extEnd); -#endif /* GL_ARB_texture_env_crossbar */ -#ifdef GL_ARB_texture_env_dot3 - GLEW_ARB_texture_env_dot3 = _glewSearchExtension("GL_ARB_texture_env_dot3", extStart, extEnd); -#endif /* GL_ARB_texture_env_dot3 */ -#ifdef GL_ARB_texture_filter_minmax - GLEW_ARB_texture_filter_minmax = _glewSearchExtension("GL_ARB_texture_filter_minmax", extStart, extEnd); -#endif /* GL_ARB_texture_filter_minmax */ -#ifdef GL_ARB_texture_float - GLEW_ARB_texture_float = _glewSearchExtension("GL_ARB_texture_float", extStart, extEnd); -#endif /* GL_ARB_texture_float */ -#ifdef GL_ARB_texture_gather - GLEW_ARB_texture_gather = _glewSearchExtension("GL_ARB_texture_gather", extStart, extEnd); -#endif /* GL_ARB_texture_gather */ -#ifdef GL_ARB_texture_mirror_clamp_to_edge - GLEW_ARB_texture_mirror_clamp_to_edge = _glewSearchExtension("GL_ARB_texture_mirror_clamp_to_edge", extStart, extEnd); -#endif /* GL_ARB_texture_mirror_clamp_to_edge */ -#ifdef GL_ARB_texture_mirrored_repeat - GLEW_ARB_texture_mirrored_repeat = _glewSearchExtension("GL_ARB_texture_mirrored_repeat", extStart, extEnd); -#endif /* GL_ARB_texture_mirrored_repeat */ -#ifdef GL_ARB_texture_multisample - GLEW_ARB_texture_multisample = _glewSearchExtension("GL_ARB_texture_multisample", extStart, extEnd); - if (glewExperimental || GLEW_ARB_texture_multisample) GLEW_ARB_texture_multisample = !_glewInit_GL_ARB_texture_multisample(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_texture_multisample */ -#ifdef GL_ARB_texture_non_power_of_two - GLEW_ARB_texture_non_power_of_two = _glewSearchExtension("GL_ARB_texture_non_power_of_two", extStart, extEnd); -#endif /* GL_ARB_texture_non_power_of_two */ -#ifdef GL_ARB_texture_query_levels - GLEW_ARB_texture_query_levels = _glewSearchExtension("GL_ARB_texture_query_levels", extStart, extEnd); -#endif /* GL_ARB_texture_query_levels */ -#ifdef GL_ARB_texture_query_lod - GLEW_ARB_texture_query_lod = _glewSearchExtension("GL_ARB_texture_query_lod", extStart, extEnd); -#endif /* GL_ARB_texture_query_lod */ -#ifdef GL_ARB_texture_rectangle - GLEW_ARB_texture_rectangle = _glewSearchExtension("GL_ARB_texture_rectangle", extStart, extEnd); -#endif /* GL_ARB_texture_rectangle */ -#ifdef GL_ARB_texture_rg - GLEW_ARB_texture_rg = _glewSearchExtension("GL_ARB_texture_rg", extStart, extEnd); -#endif /* GL_ARB_texture_rg */ -#ifdef GL_ARB_texture_rgb10_a2ui - GLEW_ARB_texture_rgb10_a2ui = _glewSearchExtension("GL_ARB_texture_rgb10_a2ui", extStart, extEnd); -#endif /* GL_ARB_texture_rgb10_a2ui */ -#ifdef GL_ARB_texture_stencil8 - GLEW_ARB_texture_stencil8 = _glewSearchExtension("GL_ARB_texture_stencil8", extStart, extEnd); -#endif /* GL_ARB_texture_stencil8 */ -#ifdef GL_ARB_texture_storage - GLEW_ARB_texture_storage = _glewSearchExtension("GL_ARB_texture_storage", extStart, extEnd); - if (glewExperimental || GLEW_ARB_texture_storage) GLEW_ARB_texture_storage = !_glewInit_GL_ARB_texture_storage(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_texture_storage */ -#ifdef GL_ARB_texture_storage_multisample - GLEW_ARB_texture_storage_multisample = _glewSearchExtension("GL_ARB_texture_storage_multisample", extStart, extEnd); - if (glewExperimental || GLEW_ARB_texture_storage_multisample) GLEW_ARB_texture_storage_multisample = !_glewInit_GL_ARB_texture_storage_multisample(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_texture_storage_multisample */ -#ifdef GL_ARB_texture_swizzle - GLEW_ARB_texture_swizzle = _glewSearchExtension("GL_ARB_texture_swizzle", extStart, extEnd); -#endif /* GL_ARB_texture_swizzle */ -#ifdef GL_ARB_texture_view - GLEW_ARB_texture_view = _glewSearchExtension("GL_ARB_texture_view", extStart, extEnd); - if (glewExperimental || GLEW_ARB_texture_view) GLEW_ARB_texture_view = !_glewInit_GL_ARB_texture_view(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_texture_view */ -#ifdef GL_ARB_timer_query - GLEW_ARB_timer_query = _glewSearchExtension("GL_ARB_timer_query", extStart, extEnd); - if (glewExperimental || GLEW_ARB_timer_query) GLEW_ARB_timer_query = !_glewInit_GL_ARB_timer_query(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_timer_query */ -#ifdef GL_ARB_transform_feedback2 - GLEW_ARB_transform_feedback2 = _glewSearchExtension("GL_ARB_transform_feedback2", extStart, extEnd); - if (glewExperimental || GLEW_ARB_transform_feedback2) GLEW_ARB_transform_feedback2 = !_glewInit_GL_ARB_transform_feedback2(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_transform_feedback2 */ -#ifdef GL_ARB_transform_feedback3 - GLEW_ARB_transform_feedback3 = _glewSearchExtension("GL_ARB_transform_feedback3", extStart, extEnd); - if (glewExperimental || GLEW_ARB_transform_feedback3) GLEW_ARB_transform_feedback3 = !_glewInit_GL_ARB_transform_feedback3(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_transform_feedback3 */ -#ifdef GL_ARB_transform_feedback_instanced - GLEW_ARB_transform_feedback_instanced = _glewSearchExtension("GL_ARB_transform_feedback_instanced", extStart, extEnd); - if (glewExperimental || GLEW_ARB_transform_feedback_instanced) GLEW_ARB_transform_feedback_instanced = !_glewInit_GL_ARB_transform_feedback_instanced(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_transform_feedback_instanced */ -#ifdef GL_ARB_transform_feedback_overflow_query - GLEW_ARB_transform_feedback_overflow_query = _glewSearchExtension("GL_ARB_transform_feedback_overflow_query", extStart, extEnd); -#endif /* GL_ARB_transform_feedback_overflow_query */ -#ifdef GL_ARB_transpose_matrix - GLEW_ARB_transpose_matrix = _glewSearchExtension("GL_ARB_transpose_matrix", extStart, extEnd); - if (glewExperimental || GLEW_ARB_transpose_matrix) GLEW_ARB_transpose_matrix = !_glewInit_GL_ARB_transpose_matrix(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_transpose_matrix */ -#ifdef GL_ARB_uniform_buffer_object - GLEW_ARB_uniform_buffer_object = _glewSearchExtension("GL_ARB_uniform_buffer_object", extStart, extEnd); - if (glewExperimental || GLEW_ARB_uniform_buffer_object) GLEW_ARB_uniform_buffer_object = !_glewInit_GL_ARB_uniform_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_uniform_buffer_object */ -#ifdef GL_ARB_vertex_array_bgra - GLEW_ARB_vertex_array_bgra = _glewSearchExtension("GL_ARB_vertex_array_bgra", extStart, extEnd); -#endif /* GL_ARB_vertex_array_bgra */ -#ifdef GL_ARB_vertex_array_object - GLEW_ARB_vertex_array_object = _glewSearchExtension("GL_ARB_vertex_array_object", extStart, extEnd); - if (glewExperimental || GLEW_ARB_vertex_array_object) GLEW_ARB_vertex_array_object = !_glewInit_GL_ARB_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_vertex_array_object */ -#ifdef GL_ARB_vertex_attrib_64bit - GLEW_ARB_vertex_attrib_64bit = _glewSearchExtension("GL_ARB_vertex_attrib_64bit", extStart, extEnd); - if (glewExperimental || GLEW_ARB_vertex_attrib_64bit) GLEW_ARB_vertex_attrib_64bit = !_glewInit_GL_ARB_vertex_attrib_64bit(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_vertex_attrib_64bit */ -#ifdef GL_ARB_vertex_attrib_binding - GLEW_ARB_vertex_attrib_binding = _glewSearchExtension("GL_ARB_vertex_attrib_binding", extStart, extEnd); - if (glewExperimental || GLEW_ARB_vertex_attrib_binding) GLEW_ARB_vertex_attrib_binding = !_glewInit_GL_ARB_vertex_attrib_binding(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_vertex_attrib_binding */ -#ifdef GL_ARB_vertex_blend - GLEW_ARB_vertex_blend = _glewSearchExtension("GL_ARB_vertex_blend", extStart, extEnd); - if (glewExperimental || GLEW_ARB_vertex_blend) GLEW_ARB_vertex_blend = !_glewInit_GL_ARB_vertex_blend(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_vertex_blend */ -#ifdef GL_ARB_vertex_buffer_object - GLEW_ARB_vertex_buffer_object = _glewSearchExtension("GL_ARB_vertex_buffer_object", extStart, extEnd); - if (glewExperimental || GLEW_ARB_vertex_buffer_object) GLEW_ARB_vertex_buffer_object = !_glewInit_GL_ARB_vertex_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_vertex_buffer_object */ -#ifdef GL_ARB_vertex_program - GLEW_ARB_vertex_program = _glewSearchExtension("GL_ARB_vertex_program", extStart, extEnd); - if (glewExperimental || GLEW_ARB_vertex_program) GLEW_ARB_vertex_program = !_glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_vertex_program */ -#ifdef GL_ARB_vertex_shader - GLEW_ARB_vertex_shader = _glewSearchExtension("GL_ARB_vertex_shader", extStart, extEnd); - if (glewExperimental || GLEW_ARB_vertex_shader) { GLEW_ARB_vertex_shader = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); _glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); } -#endif /* GL_ARB_vertex_shader */ -#ifdef GL_ARB_vertex_type_10f_11f_11f_rev - GLEW_ARB_vertex_type_10f_11f_11f_rev = _glewSearchExtension("GL_ARB_vertex_type_10f_11f_11f_rev", extStart, extEnd); -#endif /* GL_ARB_vertex_type_10f_11f_11f_rev */ -#ifdef GL_ARB_vertex_type_2_10_10_10_rev - GLEW_ARB_vertex_type_2_10_10_10_rev = _glewSearchExtension("GL_ARB_vertex_type_2_10_10_10_rev", extStart, extEnd); - if (glewExperimental || GLEW_ARB_vertex_type_2_10_10_10_rev) GLEW_ARB_vertex_type_2_10_10_10_rev = !_glewInit_GL_ARB_vertex_type_2_10_10_10_rev(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ -#ifdef GL_ARB_viewport_array - GLEW_ARB_viewport_array = _glewSearchExtension("GL_ARB_viewport_array", extStart, extEnd); - if (glewExperimental || GLEW_ARB_viewport_array) GLEW_ARB_viewport_array = !_glewInit_GL_ARB_viewport_array(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_viewport_array */ -#ifdef GL_ARB_window_pos - GLEW_ARB_window_pos = _glewSearchExtension("GL_ARB_window_pos", extStart, extEnd); - if (glewExperimental || GLEW_ARB_window_pos) GLEW_ARB_window_pos = !_glewInit_GL_ARB_window_pos(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ARB_window_pos */ -#ifdef GL_ATIX_point_sprites - GLEW_ATIX_point_sprites = _glewSearchExtension("GL_ATIX_point_sprites", extStart, extEnd); -#endif /* GL_ATIX_point_sprites */ -#ifdef GL_ATIX_texture_env_combine3 - GLEW_ATIX_texture_env_combine3 = _glewSearchExtension("GL_ATIX_texture_env_combine3", extStart, extEnd); -#endif /* GL_ATIX_texture_env_combine3 */ -#ifdef GL_ATIX_texture_env_route - GLEW_ATIX_texture_env_route = _glewSearchExtension("GL_ATIX_texture_env_route", extStart, extEnd); -#endif /* GL_ATIX_texture_env_route */ -#ifdef GL_ATIX_vertex_shader_output_point_size - GLEW_ATIX_vertex_shader_output_point_size = _glewSearchExtension("GL_ATIX_vertex_shader_output_point_size", extStart, extEnd); -#endif /* GL_ATIX_vertex_shader_output_point_size */ -#ifdef GL_ATI_draw_buffers - GLEW_ATI_draw_buffers = _glewSearchExtension("GL_ATI_draw_buffers", extStart, extEnd); - if (glewExperimental || GLEW_ATI_draw_buffers) GLEW_ATI_draw_buffers = !_glewInit_GL_ATI_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ATI_draw_buffers */ -#ifdef GL_ATI_element_array - GLEW_ATI_element_array = _glewSearchExtension("GL_ATI_element_array", extStart, extEnd); - if (glewExperimental || GLEW_ATI_element_array) GLEW_ATI_element_array = !_glewInit_GL_ATI_element_array(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ATI_element_array */ -#ifdef GL_ATI_envmap_bumpmap - GLEW_ATI_envmap_bumpmap = _glewSearchExtension("GL_ATI_envmap_bumpmap", extStart, extEnd); - if (glewExperimental || GLEW_ATI_envmap_bumpmap) GLEW_ATI_envmap_bumpmap = !_glewInit_GL_ATI_envmap_bumpmap(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ATI_envmap_bumpmap */ -#ifdef GL_ATI_fragment_shader - GLEW_ATI_fragment_shader = _glewSearchExtension("GL_ATI_fragment_shader", extStart, extEnd); - if (glewExperimental || GLEW_ATI_fragment_shader) GLEW_ATI_fragment_shader = !_glewInit_GL_ATI_fragment_shader(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ATI_fragment_shader */ -#ifdef GL_ATI_map_object_buffer - GLEW_ATI_map_object_buffer = _glewSearchExtension("GL_ATI_map_object_buffer", extStart, extEnd); - if (glewExperimental || GLEW_ATI_map_object_buffer) GLEW_ATI_map_object_buffer = !_glewInit_GL_ATI_map_object_buffer(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ATI_map_object_buffer */ -#ifdef GL_ATI_meminfo - GLEW_ATI_meminfo = _glewSearchExtension("GL_ATI_meminfo", extStart, extEnd); -#endif /* GL_ATI_meminfo */ -#ifdef GL_ATI_pn_triangles - GLEW_ATI_pn_triangles = _glewSearchExtension("GL_ATI_pn_triangles", extStart, extEnd); - if (glewExperimental || GLEW_ATI_pn_triangles) GLEW_ATI_pn_triangles = !_glewInit_GL_ATI_pn_triangles(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ATI_pn_triangles */ -#ifdef GL_ATI_separate_stencil - GLEW_ATI_separate_stencil = _glewSearchExtension("GL_ATI_separate_stencil", extStart, extEnd); - if (glewExperimental || GLEW_ATI_separate_stencil) GLEW_ATI_separate_stencil = !_glewInit_GL_ATI_separate_stencil(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ATI_separate_stencil */ -#ifdef GL_ATI_shader_texture_lod - GLEW_ATI_shader_texture_lod = _glewSearchExtension("GL_ATI_shader_texture_lod", extStart, extEnd); -#endif /* GL_ATI_shader_texture_lod */ -#ifdef GL_ATI_text_fragment_shader - GLEW_ATI_text_fragment_shader = _glewSearchExtension("GL_ATI_text_fragment_shader", extStart, extEnd); -#endif /* GL_ATI_text_fragment_shader */ -#ifdef GL_ATI_texture_compression_3dc - GLEW_ATI_texture_compression_3dc = _glewSearchExtension("GL_ATI_texture_compression_3dc", extStart, extEnd); -#endif /* GL_ATI_texture_compression_3dc */ -#ifdef GL_ATI_texture_env_combine3 - GLEW_ATI_texture_env_combine3 = _glewSearchExtension("GL_ATI_texture_env_combine3", extStart, extEnd); -#endif /* GL_ATI_texture_env_combine3 */ -#ifdef GL_ATI_texture_float - GLEW_ATI_texture_float = _glewSearchExtension("GL_ATI_texture_float", extStart, extEnd); -#endif /* GL_ATI_texture_float */ -#ifdef GL_ATI_texture_mirror_once - GLEW_ATI_texture_mirror_once = _glewSearchExtension("GL_ATI_texture_mirror_once", extStart, extEnd); -#endif /* GL_ATI_texture_mirror_once */ -#ifdef GL_ATI_vertex_array_object - GLEW_ATI_vertex_array_object = _glewSearchExtension("GL_ATI_vertex_array_object", extStart, extEnd); - if (glewExperimental || GLEW_ATI_vertex_array_object) GLEW_ATI_vertex_array_object = !_glewInit_GL_ATI_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ATI_vertex_array_object */ -#ifdef GL_ATI_vertex_attrib_array_object - GLEW_ATI_vertex_attrib_array_object = _glewSearchExtension("GL_ATI_vertex_attrib_array_object", extStart, extEnd); - if (glewExperimental || GLEW_ATI_vertex_attrib_array_object) GLEW_ATI_vertex_attrib_array_object = !_glewInit_GL_ATI_vertex_attrib_array_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ATI_vertex_attrib_array_object */ -#ifdef GL_ATI_vertex_streams - GLEW_ATI_vertex_streams = _glewSearchExtension("GL_ATI_vertex_streams", extStart, extEnd); - if (glewExperimental || GLEW_ATI_vertex_streams) GLEW_ATI_vertex_streams = !_glewInit_GL_ATI_vertex_streams(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_ATI_vertex_streams */ -#ifdef GL_EXT_422_pixels - GLEW_EXT_422_pixels = _glewSearchExtension("GL_EXT_422_pixels", extStart, extEnd); -#endif /* GL_EXT_422_pixels */ -#ifdef GL_EXT_Cg_shader - GLEW_EXT_Cg_shader = _glewSearchExtension("GL_EXT_Cg_shader", extStart, extEnd); -#endif /* GL_EXT_Cg_shader */ -#ifdef GL_EXT_abgr - GLEW_EXT_abgr = _glewSearchExtension("GL_EXT_abgr", extStart, extEnd); -#endif /* GL_EXT_abgr */ -#ifdef GL_EXT_bgra - GLEW_EXT_bgra = _glewSearchExtension("GL_EXT_bgra", extStart, extEnd); -#endif /* GL_EXT_bgra */ -#ifdef GL_EXT_bindable_uniform - GLEW_EXT_bindable_uniform = _glewSearchExtension("GL_EXT_bindable_uniform", extStart, extEnd); - if (glewExperimental || GLEW_EXT_bindable_uniform) GLEW_EXT_bindable_uniform = !_glewInit_GL_EXT_bindable_uniform(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_bindable_uniform */ -#ifdef GL_EXT_blend_color - GLEW_EXT_blend_color = _glewSearchExtension("GL_EXT_blend_color", extStart, extEnd); - if (glewExperimental || GLEW_EXT_blend_color) GLEW_EXT_blend_color = !_glewInit_GL_EXT_blend_color(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_blend_color */ -#ifdef GL_EXT_blend_equation_separate - GLEW_EXT_blend_equation_separate = _glewSearchExtension("GL_EXT_blend_equation_separate", extStart, extEnd); - if (glewExperimental || GLEW_EXT_blend_equation_separate) GLEW_EXT_blend_equation_separate = !_glewInit_GL_EXT_blend_equation_separate(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_blend_equation_separate */ -#ifdef GL_EXT_blend_func_separate - GLEW_EXT_blend_func_separate = _glewSearchExtension("GL_EXT_blend_func_separate", extStart, extEnd); - if (glewExperimental || GLEW_EXT_blend_func_separate) GLEW_EXT_blend_func_separate = !_glewInit_GL_EXT_blend_func_separate(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_blend_func_separate */ -#ifdef GL_EXT_blend_logic_op - GLEW_EXT_blend_logic_op = _glewSearchExtension("GL_EXT_blend_logic_op", extStart, extEnd); -#endif /* GL_EXT_blend_logic_op */ -#ifdef GL_EXT_blend_minmax - GLEW_EXT_blend_minmax = _glewSearchExtension("GL_EXT_blend_minmax", extStart, extEnd); - if (glewExperimental || GLEW_EXT_blend_minmax) GLEW_EXT_blend_minmax = !_glewInit_GL_EXT_blend_minmax(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_blend_minmax */ -#ifdef GL_EXT_blend_subtract - GLEW_EXT_blend_subtract = _glewSearchExtension("GL_EXT_blend_subtract", extStart, extEnd); -#endif /* GL_EXT_blend_subtract */ -#ifdef GL_EXT_clip_volume_hint - GLEW_EXT_clip_volume_hint = _glewSearchExtension("GL_EXT_clip_volume_hint", extStart, extEnd); -#endif /* GL_EXT_clip_volume_hint */ -#ifdef GL_EXT_cmyka - GLEW_EXT_cmyka = _glewSearchExtension("GL_EXT_cmyka", extStart, extEnd); -#endif /* GL_EXT_cmyka */ -#ifdef GL_EXT_color_subtable - GLEW_EXT_color_subtable = _glewSearchExtension("GL_EXT_color_subtable", extStart, extEnd); - if (glewExperimental || GLEW_EXT_color_subtable) GLEW_EXT_color_subtable = !_glewInit_GL_EXT_color_subtable(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_color_subtable */ -#ifdef GL_EXT_compiled_vertex_array - GLEW_EXT_compiled_vertex_array = _glewSearchExtension("GL_EXT_compiled_vertex_array", extStart, extEnd); - if (glewExperimental || GLEW_EXT_compiled_vertex_array) GLEW_EXT_compiled_vertex_array = !_glewInit_GL_EXT_compiled_vertex_array(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_compiled_vertex_array */ -#ifdef GL_EXT_convolution - GLEW_EXT_convolution = _glewSearchExtension("GL_EXT_convolution", extStart, extEnd); - if (glewExperimental || GLEW_EXT_convolution) GLEW_EXT_convolution = !_glewInit_GL_EXT_convolution(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_convolution */ -#ifdef GL_EXT_coordinate_frame - GLEW_EXT_coordinate_frame = _glewSearchExtension("GL_EXT_coordinate_frame", extStart, extEnd); - if (glewExperimental || GLEW_EXT_coordinate_frame) GLEW_EXT_coordinate_frame = !_glewInit_GL_EXT_coordinate_frame(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_coordinate_frame */ -#ifdef GL_EXT_copy_texture - GLEW_EXT_copy_texture = _glewSearchExtension("GL_EXT_copy_texture", extStart, extEnd); - if (glewExperimental || GLEW_EXT_copy_texture) GLEW_EXT_copy_texture = !_glewInit_GL_EXT_copy_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_copy_texture */ -#ifdef GL_EXT_cull_vertex - GLEW_EXT_cull_vertex = _glewSearchExtension("GL_EXT_cull_vertex", extStart, extEnd); - if (glewExperimental || GLEW_EXT_cull_vertex) GLEW_EXT_cull_vertex = !_glewInit_GL_EXT_cull_vertex(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_cull_vertex */ -#ifdef GL_EXT_debug_label - GLEW_EXT_debug_label = _glewSearchExtension("GL_EXT_debug_label", extStart, extEnd); - if (glewExperimental || GLEW_EXT_debug_label) GLEW_EXT_debug_label = !_glewInit_GL_EXT_debug_label(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_debug_label */ -#ifdef GL_EXT_debug_marker - GLEW_EXT_debug_marker = _glewSearchExtension("GL_EXT_debug_marker", extStart, extEnd); - if (glewExperimental || GLEW_EXT_debug_marker) GLEW_EXT_debug_marker = !_glewInit_GL_EXT_debug_marker(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_debug_marker */ -#ifdef GL_EXT_depth_bounds_test - GLEW_EXT_depth_bounds_test = _glewSearchExtension("GL_EXT_depth_bounds_test", extStart, extEnd); - if (glewExperimental || GLEW_EXT_depth_bounds_test) GLEW_EXT_depth_bounds_test = !_glewInit_GL_EXT_depth_bounds_test(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_depth_bounds_test */ -#ifdef GL_EXT_direct_state_access - GLEW_EXT_direct_state_access = _glewSearchExtension("GL_EXT_direct_state_access", extStart, extEnd); - if (glewExperimental || GLEW_EXT_direct_state_access) GLEW_EXT_direct_state_access = !_glewInit_GL_EXT_direct_state_access(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_direct_state_access */ -#ifdef GL_EXT_draw_buffers2 - GLEW_EXT_draw_buffers2 = _glewSearchExtension("GL_EXT_draw_buffers2", extStart, extEnd); - if (glewExperimental || GLEW_EXT_draw_buffers2) GLEW_EXT_draw_buffers2 = !_glewInit_GL_EXT_draw_buffers2(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_draw_buffers2 */ -#ifdef GL_EXT_draw_instanced - GLEW_EXT_draw_instanced = _glewSearchExtension("GL_EXT_draw_instanced", extStart, extEnd); - if (glewExperimental || GLEW_EXT_draw_instanced) GLEW_EXT_draw_instanced = !_glewInit_GL_EXT_draw_instanced(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_draw_instanced */ -#ifdef GL_EXT_draw_range_elements - GLEW_EXT_draw_range_elements = _glewSearchExtension("GL_EXT_draw_range_elements", extStart, extEnd); - if (glewExperimental || GLEW_EXT_draw_range_elements) GLEW_EXT_draw_range_elements = !_glewInit_GL_EXT_draw_range_elements(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_draw_range_elements */ -#ifdef GL_EXT_fog_coord - GLEW_EXT_fog_coord = _glewSearchExtension("GL_EXT_fog_coord", extStart, extEnd); - if (glewExperimental || GLEW_EXT_fog_coord) GLEW_EXT_fog_coord = !_glewInit_GL_EXT_fog_coord(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_fog_coord */ -#ifdef GL_EXT_fragment_lighting - GLEW_EXT_fragment_lighting = _glewSearchExtension("GL_EXT_fragment_lighting", extStart, extEnd); - if (glewExperimental || GLEW_EXT_fragment_lighting) GLEW_EXT_fragment_lighting = !_glewInit_GL_EXT_fragment_lighting(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_fragment_lighting */ -#ifdef GL_EXT_framebuffer_blit - GLEW_EXT_framebuffer_blit = _glewSearchExtension("GL_EXT_framebuffer_blit", extStart, extEnd); - if (glewExperimental || GLEW_EXT_framebuffer_blit) GLEW_EXT_framebuffer_blit = !_glewInit_GL_EXT_framebuffer_blit(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_framebuffer_blit */ -#ifdef GL_EXT_framebuffer_multisample - GLEW_EXT_framebuffer_multisample = _glewSearchExtension("GL_EXT_framebuffer_multisample", extStart, extEnd); - if (glewExperimental || GLEW_EXT_framebuffer_multisample) GLEW_EXT_framebuffer_multisample = !_glewInit_GL_EXT_framebuffer_multisample(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_framebuffer_multisample */ -#ifdef GL_EXT_framebuffer_multisample_blit_scaled - GLEW_EXT_framebuffer_multisample_blit_scaled = _glewSearchExtension("GL_EXT_framebuffer_multisample_blit_scaled", extStart, extEnd); -#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ -#ifdef GL_EXT_framebuffer_object - GLEW_EXT_framebuffer_object = _glewSearchExtension("GL_EXT_framebuffer_object", extStart, extEnd); - if (glewExperimental || GLEW_EXT_framebuffer_object) GLEW_EXT_framebuffer_object = !_glewInit_GL_EXT_framebuffer_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_framebuffer_object */ -#ifdef GL_EXT_framebuffer_sRGB - GLEW_EXT_framebuffer_sRGB = _glewSearchExtension("GL_EXT_framebuffer_sRGB", extStart, extEnd); -#endif /* GL_EXT_framebuffer_sRGB */ -#ifdef GL_EXT_geometry_shader4 - GLEW_EXT_geometry_shader4 = _glewSearchExtension("GL_EXT_geometry_shader4", extStart, extEnd); - if (glewExperimental || GLEW_EXT_geometry_shader4) GLEW_EXT_geometry_shader4 = !_glewInit_GL_EXT_geometry_shader4(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_geometry_shader4 */ -#ifdef GL_EXT_gpu_program_parameters - GLEW_EXT_gpu_program_parameters = _glewSearchExtension("GL_EXT_gpu_program_parameters", extStart, extEnd); - if (glewExperimental || GLEW_EXT_gpu_program_parameters) GLEW_EXT_gpu_program_parameters = !_glewInit_GL_EXT_gpu_program_parameters(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_gpu_program_parameters */ -#ifdef GL_EXT_gpu_shader4 - GLEW_EXT_gpu_shader4 = _glewSearchExtension("GL_EXT_gpu_shader4", extStart, extEnd); - if (glewExperimental || GLEW_EXT_gpu_shader4) GLEW_EXT_gpu_shader4 = !_glewInit_GL_EXT_gpu_shader4(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_gpu_shader4 */ -#ifdef GL_EXT_histogram - GLEW_EXT_histogram = _glewSearchExtension("GL_EXT_histogram", extStart, extEnd); - if (glewExperimental || GLEW_EXT_histogram) GLEW_EXT_histogram = !_glewInit_GL_EXT_histogram(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_histogram */ -#ifdef GL_EXT_index_array_formats - GLEW_EXT_index_array_formats = _glewSearchExtension("GL_EXT_index_array_formats", extStart, extEnd); -#endif /* GL_EXT_index_array_formats */ -#ifdef GL_EXT_index_func - GLEW_EXT_index_func = _glewSearchExtension("GL_EXT_index_func", extStart, extEnd); - if (glewExperimental || GLEW_EXT_index_func) GLEW_EXT_index_func = !_glewInit_GL_EXT_index_func(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_index_func */ -#ifdef GL_EXT_index_material - GLEW_EXT_index_material = _glewSearchExtension("GL_EXT_index_material", extStart, extEnd); - if (glewExperimental || GLEW_EXT_index_material) GLEW_EXT_index_material = !_glewInit_GL_EXT_index_material(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_index_material */ -#ifdef GL_EXT_index_texture - GLEW_EXT_index_texture = _glewSearchExtension("GL_EXT_index_texture", extStart, extEnd); -#endif /* GL_EXT_index_texture */ -#ifdef GL_EXT_light_texture - GLEW_EXT_light_texture = _glewSearchExtension("GL_EXT_light_texture", extStart, extEnd); - if (glewExperimental || GLEW_EXT_light_texture) GLEW_EXT_light_texture = !_glewInit_GL_EXT_light_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_light_texture */ -#ifdef GL_EXT_misc_attribute - GLEW_EXT_misc_attribute = _glewSearchExtension("GL_EXT_misc_attribute", extStart, extEnd); -#endif /* GL_EXT_misc_attribute */ -#ifdef GL_EXT_multi_draw_arrays - GLEW_EXT_multi_draw_arrays = _glewSearchExtension("GL_EXT_multi_draw_arrays", extStart, extEnd); - if (glewExperimental || GLEW_EXT_multi_draw_arrays) GLEW_EXT_multi_draw_arrays = !_glewInit_GL_EXT_multi_draw_arrays(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_multi_draw_arrays */ -#ifdef GL_EXT_multisample - GLEW_EXT_multisample = _glewSearchExtension("GL_EXT_multisample", extStart, extEnd); - if (glewExperimental || GLEW_EXT_multisample) GLEW_EXT_multisample = !_glewInit_GL_EXT_multisample(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_multisample */ -#ifdef GL_EXT_packed_depth_stencil - GLEW_EXT_packed_depth_stencil = _glewSearchExtension("GL_EXT_packed_depth_stencil", extStart, extEnd); -#endif /* GL_EXT_packed_depth_stencil */ -#ifdef GL_EXT_packed_float - GLEW_EXT_packed_float = _glewSearchExtension("GL_EXT_packed_float", extStart, extEnd); -#endif /* GL_EXT_packed_float */ -#ifdef GL_EXT_packed_pixels - GLEW_EXT_packed_pixels = _glewSearchExtension("GL_EXT_packed_pixels", extStart, extEnd); -#endif /* GL_EXT_packed_pixels */ -#ifdef GL_EXT_paletted_texture - GLEW_EXT_paletted_texture = _glewSearchExtension("GL_EXT_paletted_texture", extStart, extEnd); - if (glewExperimental || GLEW_EXT_paletted_texture) GLEW_EXT_paletted_texture = !_glewInit_GL_EXT_paletted_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_paletted_texture */ -#ifdef GL_EXT_pixel_buffer_object - GLEW_EXT_pixel_buffer_object = _glewSearchExtension("GL_EXT_pixel_buffer_object", extStart, extEnd); -#endif /* GL_EXT_pixel_buffer_object */ -#ifdef GL_EXT_pixel_transform - GLEW_EXT_pixel_transform = _glewSearchExtension("GL_EXT_pixel_transform", extStart, extEnd); - if (glewExperimental || GLEW_EXT_pixel_transform) GLEW_EXT_pixel_transform = !_glewInit_GL_EXT_pixel_transform(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_pixel_transform */ -#ifdef GL_EXT_pixel_transform_color_table - GLEW_EXT_pixel_transform_color_table = _glewSearchExtension("GL_EXT_pixel_transform_color_table", extStart, extEnd); -#endif /* GL_EXT_pixel_transform_color_table */ -#ifdef GL_EXT_point_parameters - GLEW_EXT_point_parameters = _glewSearchExtension("GL_EXT_point_parameters", extStart, extEnd); - if (glewExperimental || GLEW_EXT_point_parameters) GLEW_EXT_point_parameters = !_glewInit_GL_EXT_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_point_parameters */ -#ifdef GL_EXT_polygon_offset - GLEW_EXT_polygon_offset = _glewSearchExtension("GL_EXT_polygon_offset", extStart, extEnd); - if (glewExperimental || GLEW_EXT_polygon_offset) GLEW_EXT_polygon_offset = !_glewInit_GL_EXT_polygon_offset(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_polygon_offset */ -#ifdef GL_EXT_polygon_offset_clamp - GLEW_EXT_polygon_offset_clamp = _glewSearchExtension("GL_EXT_polygon_offset_clamp", extStart, extEnd); - if (glewExperimental || GLEW_EXT_polygon_offset_clamp) GLEW_EXT_polygon_offset_clamp = !_glewInit_GL_EXT_polygon_offset_clamp(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_polygon_offset_clamp */ -#ifdef GL_EXT_post_depth_coverage - GLEW_EXT_post_depth_coverage = _glewSearchExtension("GL_EXT_post_depth_coverage", extStart, extEnd); -#endif /* GL_EXT_post_depth_coverage */ -#ifdef GL_EXT_provoking_vertex - GLEW_EXT_provoking_vertex = _glewSearchExtension("GL_EXT_provoking_vertex", extStart, extEnd); - if (glewExperimental || GLEW_EXT_provoking_vertex) GLEW_EXT_provoking_vertex = !_glewInit_GL_EXT_provoking_vertex(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_provoking_vertex */ -#ifdef GL_EXT_raster_multisample - GLEW_EXT_raster_multisample = _glewSearchExtension("GL_EXT_raster_multisample", extStart, extEnd); - if (glewExperimental || GLEW_EXT_raster_multisample) GLEW_EXT_raster_multisample = !_glewInit_GL_EXT_raster_multisample(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_raster_multisample */ -#ifdef GL_EXT_rescale_normal - GLEW_EXT_rescale_normal = _glewSearchExtension("GL_EXT_rescale_normal", extStart, extEnd); -#endif /* GL_EXT_rescale_normal */ -#ifdef GL_EXT_scene_marker - GLEW_EXT_scene_marker = _glewSearchExtension("GL_EXT_scene_marker", extStart, extEnd); - if (glewExperimental || GLEW_EXT_scene_marker) GLEW_EXT_scene_marker = !_glewInit_GL_EXT_scene_marker(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_scene_marker */ -#ifdef GL_EXT_secondary_color - GLEW_EXT_secondary_color = _glewSearchExtension("GL_EXT_secondary_color", extStart, extEnd); - if (glewExperimental || GLEW_EXT_secondary_color) GLEW_EXT_secondary_color = !_glewInit_GL_EXT_secondary_color(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_secondary_color */ -#ifdef GL_EXT_separate_shader_objects - GLEW_EXT_separate_shader_objects = _glewSearchExtension("GL_EXT_separate_shader_objects", extStart, extEnd); - if (glewExperimental || GLEW_EXT_separate_shader_objects) GLEW_EXT_separate_shader_objects = !_glewInit_GL_EXT_separate_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_separate_shader_objects */ -#ifdef GL_EXT_separate_specular_color - GLEW_EXT_separate_specular_color = _glewSearchExtension("GL_EXT_separate_specular_color", extStart, extEnd); -#endif /* GL_EXT_separate_specular_color */ -#ifdef GL_EXT_shader_image_load_formatted - GLEW_EXT_shader_image_load_formatted = _glewSearchExtension("GL_EXT_shader_image_load_formatted", extStart, extEnd); -#endif /* GL_EXT_shader_image_load_formatted */ -#ifdef GL_EXT_shader_image_load_store - GLEW_EXT_shader_image_load_store = _glewSearchExtension("GL_EXT_shader_image_load_store", extStart, extEnd); - if (glewExperimental || GLEW_EXT_shader_image_load_store) GLEW_EXT_shader_image_load_store = !_glewInit_GL_EXT_shader_image_load_store(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_shader_image_load_store */ -#ifdef GL_EXT_shader_integer_mix - GLEW_EXT_shader_integer_mix = _glewSearchExtension("GL_EXT_shader_integer_mix", extStart, extEnd); -#endif /* GL_EXT_shader_integer_mix */ -#ifdef GL_EXT_shadow_funcs - GLEW_EXT_shadow_funcs = _glewSearchExtension("GL_EXT_shadow_funcs", extStart, extEnd); -#endif /* GL_EXT_shadow_funcs */ -#ifdef GL_EXT_shared_texture_palette - GLEW_EXT_shared_texture_palette = _glewSearchExtension("GL_EXT_shared_texture_palette", extStart, extEnd); -#endif /* GL_EXT_shared_texture_palette */ -#ifdef GL_EXT_sparse_texture2 - GLEW_EXT_sparse_texture2 = _glewSearchExtension("GL_EXT_sparse_texture2", extStart, extEnd); -#endif /* GL_EXT_sparse_texture2 */ -#ifdef GL_EXT_stencil_clear_tag - GLEW_EXT_stencil_clear_tag = _glewSearchExtension("GL_EXT_stencil_clear_tag", extStart, extEnd); -#endif /* GL_EXT_stencil_clear_tag */ -#ifdef GL_EXT_stencil_two_side - GLEW_EXT_stencil_two_side = _glewSearchExtension("GL_EXT_stencil_two_side", extStart, extEnd); - if (glewExperimental || GLEW_EXT_stencil_two_side) GLEW_EXT_stencil_two_side = !_glewInit_GL_EXT_stencil_two_side(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_stencil_two_side */ -#ifdef GL_EXT_stencil_wrap - GLEW_EXT_stencil_wrap = _glewSearchExtension("GL_EXT_stencil_wrap", extStart, extEnd); -#endif /* GL_EXT_stencil_wrap */ -#ifdef GL_EXT_subtexture - GLEW_EXT_subtexture = _glewSearchExtension("GL_EXT_subtexture", extStart, extEnd); - if (glewExperimental || GLEW_EXT_subtexture) GLEW_EXT_subtexture = !_glewInit_GL_EXT_subtexture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_subtexture */ -#ifdef GL_EXT_texture - GLEW_EXT_texture = _glewSearchExtension("GL_EXT_texture", extStart, extEnd); -#endif /* GL_EXT_texture */ -#ifdef GL_EXT_texture3D - GLEW_EXT_texture3D = _glewSearchExtension("GL_EXT_texture3D", extStart, extEnd); - if (glewExperimental || GLEW_EXT_texture3D) GLEW_EXT_texture3D = !_glewInit_GL_EXT_texture3D(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_texture3D */ -#ifdef GL_EXT_texture_array - GLEW_EXT_texture_array = _glewSearchExtension("GL_EXT_texture_array", extStart, extEnd); - if (glewExperimental || GLEW_EXT_texture_array) GLEW_EXT_texture_array = !_glewInit_GL_EXT_texture_array(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_texture_array */ -#ifdef GL_EXT_texture_buffer_object - GLEW_EXT_texture_buffer_object = _glewSearchExtension("GL_EXT_texture_buffer_object", extStart, extEnd); - if (glewExperimental || GLEW_EXT_texture_buffer_object) GLEW_EXT_texture_buffer_object = !_glewInit_GL_EXT_texture_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_texture_buffer_object */ -#ifdef GL_EXT_texture_compression_dxt1 - GLEW_EXT_texture_compression_dxt1 = _glewSearchExtension("GL_EXT_texture_compression_dxt1", extStart, extEnd); -#endif /* GL_EXT_texture_compression_dxt1 */ -#ifdef GL_EXT_texture_compression_latc - GLEW_EXT_texture_compression_latc = _glewSearchExtension("GL_EXT_texture_compression_latc", extStart, extEnd); -#endif /* GL_EXT_texture_compression_latc */ -#ifdef GL_EXT_texture_compression_rgtc - GLEW_EXT_texture_compression_rgtc = _glewSearchExtension("GL_EXT_texture_compression_rgtc", extStart, extEnd); -#endif /* GL_EXT_texture_compression_rgtc */ -#ifdef GL_EXT_texture_compression_s3tc - GLEW_EXT_texture_compression_s3tc = _glewSearchExtension("GL_EXT_texture_compression_s3tc", extStart, extEnd); -#endif /* GL_EXT_texture_compression_s3tc */ -#ifdef GL_EXT_texture_cube_map - GLEW_EXT_texture_cube_map = _glewSearchExtension("GL_EXT_texture_cube_map", extStart, extEnd); -#endif /* GL_EXT_texture_cube_map */ -#ifdef GL_EXT_texture_edge_clamp - GLEW_EXT_texture_edge_clamp = _glewSearchExtension("GL_EXT_texture_edge_clamp", extStart, extEnd); -#endif /* GL_EXT_texture_edge_clamp */ -#ifdef GL_EXT_texture_env - GLEW_EXT_texture_env = _glewSearchExtension("GL_EXT_texture_env", extStart, extEnd); -#endif /* GL_EXT_texture_env */ -#ifdef GL_EXT_texture_env_add - GLEW_EXT_texture_env_add = _glewSearchExtension("GL_EXT_texture_env_add", extStart, extEnd); -#endif /* GL_EXT_texture_env_add */ -#ifdef GL_EXT_texture_env_combine - GLEW_EXT_texture_env_combine = _glewSearchExtension("GL_EXT_texture_env_combine", extStart, extEnd); -#endif /* GL_EXT_texture_env_combine */ -#ifdef GL_EXT_texture_env_dot3 - GLEW_EXT_texture_env_dot3 = _glewSearchExtension("GL_EXT_texture_env_dot3", extStart, extEnd); -#endif /* GL_EXT_texture_env_dot3 */ -#ifdef GL_EXT_texture_filter_anisotropic - GLEW_EXT_texture_filter_anisotropic = _glewSearchExtension("GL_EXT_texture_filter_anisotropic", extStart, extEnd); -#endif /* GL_EXT_texture_filter_anisotropic */ -#ifdef GL_EXT_texture_filter_minmax - GLEW_EXT_texture_filter_minmax = _glewSearchExtension("GL_EXT_texture_filter_minmax", extStart, extEnd); -#endif /* GL_EXT_texture_filter_minmax */ -#ifdef GL_EXT_texture_integer - GLEW_EXT_texture_integer = _glewSearchExtension("GL_EXT_texture_integer", extStart, extEnd); - if (glewExperimental || GLEW_EXT_texture_integer) GLEW_EXT_texture_integer = !_glewInit_GL_EXT_texture_integer(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_texture_integer */ -#ifdef GL_EXT_texture_lod_bias - GLEW_EXT_texture_lod_bias = _glewSearchExtension("GL_EXT_texture_lod_bias", extStart, extEnd); -#endif /* GL_EXT_texture_lod_bias */ -#ifdef GL_EXT_texture_mirror_clamp - GLEW_EXT_texture_mirror_clamp = _glewSearchExtension("GL_EXT_texture_mirror_clamp", extStart, extEnd); -#endif /* GL_EXT_texture_mirror_clamp */ -#ifdef GL_EXT_texture_object - GLEW_EXT_texture_object = _glewSearchExtension("GL_EXT_texture_object", extStart, extEnd); - if (glewExperimental || GLEW_EXT_texture_object) GLEW_EXT_texture_object = !_glewInit_GL_EXT_texture_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_texture_object */ -#ifdef GL_EXT_texture_perturb_normal - GLEW_EXT_texture_perturb_normal = _glewSearchExtension("GL_EXT_texture_perturb_normal", extStart, extEnd); - if (glewExperimental || GLEW_EXT_texture_perturb_normal) GLEW_EXT_texture_perturb_normal = !_glewInit_GL_EXT_texture_perturb_normal(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_texture_perturb_normal */ -#ifdef GL_EXT_texture_rectangle - GLEW_EXT_texture_rectangle = _glewSearchExtension("GL_EXT_texture_rectangle", extStart, extEnd); -#endif /* GL_EXT_texture_rectangle */ -#ifdef GL_EXT_texture_sRGB - GLEW_EXT_texture_sRGB = _glewSearchExtension("GL_EXT_texture_sRGB", extStart, extEnd); -#endif /* GL_EXT_texture_sRGB */ -#ifdef GL_EXT_texture_sRGB_decode - GLEW_EXT_texture_sRGB_decode = _glewSearchExtension("GL_EXT_texture_sRGB_decode", extStart, extEnd); -#endif /* GL_EXT_texture_sRGB_decode */ -#ifdef GL_EXT_texture_shared_exponent - GLEW_EXT_texture_shared_exponent = _glewSearchExtension("GL_EXT_texture_shared_exponent", extStart, extEnd); -#endif /* GL_EXT_texture_shared_exponent */ -#ifdef GL_EXT_texture_snorm - GLEW_EXT_texture_snorm = _glewSearchExtension("GL_EXT_texture_snorm", extStart, extEnd); -#endif /* GL_EXT_texture_snorm */ -#ifdef GL_EXT_texture_swizzle - GLEW_EXT_texture_swizzle = _glewSearchExtension("GL_EXT_texture_swizzle", extStart, extEnd); -#endif /* GL_EXT_texture_swizzle */ -#ifdef GL_EXT_timer_query - GLEW_EXT_timer_query = _glewSearchExtension("GL_EXT_timer_query", extStart, extEnd); - if (glewExperimental || GLEW_EXT_timer_query) GLEW_EXT_timer_query = !_glewInit_GL_EXT_timer_query(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_timer_query */ -#ifdef GL_EXT_transform_feedback - GLEW_EXT_transform_feedback = _glewSearchExtension("GL_EXT_transform_feedback", extStart, extEnd); - if (glewExperimental || GLEW_EXT_transform_feedback) GLEW_EXT_transform_feedback = !_glewInit_GL_EXT_transform_feedback(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_transform_feedback */ -#ifdef GL_EXT_vertex_array - GLEW_EXT_vertex_array = _glewSearchExtension("GL_EXT_vertex_array", extStart, extEnd); - if (glewExperimental || GLEW_EXT_vertex_array) GLEW_EXT_vertex_array = !_glewInit_GL_EXT_vertex_array(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_vertex_array */ -#ifdef GL_EXT_vertex_array_bgra - GLEW_EXT_vertex_array_bgra = _glewSearchExtension("GL_EXT_vertex_array_bgra", extStart, extEnd); -#endif /* GL_EXT_vertex_array_bgra */ -#ifdef GL_EXT_vertex_attrib_64bit - GLEW_EXT_vertex_attrib_64bit = _glewSearchExtension("GL_EXT_vertex_attrib_64bit", extStart, extEnd); - if (glewExperimental || GLEW_EXT_vertex_attrib_64bit) GLEW_EXT_vertex_attrib_64bit = !_glewInit_GL_EXT_vertex_attrib_64bit(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_vertex_attrib_64bit */ -#ifdef GL_EXT_vertex_shader - GLEW_EXT_vertex_shader = _glewSearchExtension("GL_EXT_vertex_shader", extStart, extEnd); - if (glewExperimental || GLEW_EXT_vertex_shader) GLEW_EXT_vertex_shader = !_glewInit_GL_EXT_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_vertex_shader */ -#ifdef GL_EXT_vertex_weighting - GLEW_EXT_vertex_weighting = _glewSearchExtension("GL_EXT_vertex_weighting", extStart, extEnd); - if (glewExperimental || GLEW_EXT_vertex_weighting) GLEW_EXT_vertex_weighting = !_glewInit_GL_EXT_vertex_weighting(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_vertex_weighting */ -#ifdef GL_EXT_x11_sync_object - GLEW_EXT_x11_sync_object = _glewSearchExtension("GL_EXT_x11_sync_object", extStart, extEnd); - if (glewExperimental || GLEW_EXT_x11_sync_object) GLEW_EXT_x11_sync_object = !_glewInit_GL_EXT_x11_sync_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_EXT_x11_sync_object */ -#ifdef GL_GREMEDY_frame_terminator - GLEW_GREMEDY_frame_terminator = _glewSearchExtension("GL_GREMEDY_frame_terminator", extStart, extEnd); - if (glewExperimental || GLEW_GREMEDY_frame_terminator) GLEW_GREMEDY_frame_terminator = !_glewInit_GL_GREMEDY_frame_terminator(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_GREMEDY_frame_terminator */ -#ifdef GL_GREMEDY_string_marker - GLEW_GREMEDY_string_marker = _glewSearchExtension("GL_GREMEDY_string_marker", extStart, extEnd); - if (glewExperimental || GLEW_GREMEDY_string_marker) GLEW_GREMEDY_string_marker = !_glewInit_GL_GREMEDY_string_marker(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_GREMEDY_string_marker */ -#ifdef GL_HP_convolution_border_modes - GLEW_HP_convolution_border_modes = _glewSearchExtension("GL_HP_convolution_border_modes", extStart, extEnd); -#endif /* GL_HP_convolution_border_modes */ -#ifdef GL_HP_image_transform - GLEW_HP_image_transform = _glewSearchExtension("GL_HP_image_transform", extStart, extEnd); - if (glewExperimental || GLEW_HP_image_transform) GLEW_HP_image_transform = !_glewInit_GL_HP_image_transform(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_HP_image_transform */ -#ifdef GL_HP_occlusion_test - GLEW_HP_occlusion_test = _glewSearchExtension("GL_HP_occlusion_test", extStart, extEnd); -#endif /* GL_HP_occlusion_test */ -#ifdef GL_HP_texture_lighting - GLEW_HP_texture_lighting = _glewSearchExtension("GL_HP_texture_lighting", extStart, extEnd); -#endif /* GL_HP_texture_lighting */ -#ifdef GL_IBM_cull_vertex - GLEW_IBM_cull_vertex = _glewSearchExtension("GL_IBM_cull_vertex", extStart, extEnd); -#endif /* GL_IBM_cull_vertex */ -#ifdef GL_IBM_multimode_draw_arrays - GLEW_IBM_multimode_draw_arrays = _glewSearchExtension("GL_IBM_multimode_draw_arrays", extStart, extEnd); - if (glewExperimental || GLEW_IBM_multimode_draw_arrays) GLEW_IBM_multimode_draw_arrays = !_glewInit_GL_IBM_multimode_draw_arrays(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_IBM_multimode_draw_arrays */ -#ifdef GL_IBM_rasterpos_clip - GLEW_IBM_rasterpos_clip = _glewSearchExtension("GL_IBM_rasterpos_clip", extStart, extEnd); -#endif /* GL_IBM_rasterpos_clip */ -#ifdef GL_IBM_static_data - GLEW_IBM_static_data = _glewSearchExtension("GL_IBM_static_data", extStart, extEnd); -#endif /* GL_IBM_static_data */ -#ifdef GL_IBM_texture_mirrored_repeat - GLEW_IBM_texture_mirrored_repeat = _glewSearchExtension("GL_IBM_texture_mirrored_repeat", extStart, extEnd); -#endif /* GL_IBM_texture_mirrored_repeat */ -#ifdef GL_IBM_vertex_array_lists - GLEW_IBM_vertex_array_lists = _glewSearchExtension("GL_IBM_vertex_array_lists", extStart, extEnd); - if (glewExperimental || GLEW_IBM_vertex_array_lists) GLEW_IBM_vertex_array_lists = !_glewInit_GL_IBM_vertex_array_lists(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_IBM_vertex_array_lists */ -#ifdef GL_INGR_color_clamp - GLEW_INGR_color_clamp = _glewSearchExtension("GL_INGR_color_clamp", extStart, extEnd); -#endif /* GL_INGR_color_clamp */ -#ifdef GL_INGR_interlace_read - GLEW_INGR_interlace_read = _glewSearchExtension("GL_INGR_interlace_read", extStart, extEnd); -#endif /* GL_INGR_interlace_read */ -#ifdef GL_INTEL_fragment_shader_ordering - GLEW_INTEL_fragment_shader_ordering = _glewSearchExtension("GL_INTEL_fragment_shader_ordering", extStart, extEnd); -#endif /* GL_INTEL_fragment_shader_ordering */ -#ifdef GL_INTEL_framebuffer_CMAA - GLEW_INTEL_framebuffer_CMAA = _glewSearchExtension("GL_INTEL_framebuffer_CMAA", extStart, extEnd); -#endif /* GL_INTEL_framebuffer_CMAA */ -#ifdef GL_INTEL_map_texture - GLEW_INTEL_map_texture = _glewSearchExtension("GL_INTEL_map_texture", extStart, extEnd); - if (glewExperimental || GLEW_INTEL_map_texture) GLEW_INTEL_map_texture = !_glewInit_GL_INTEL_map_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_INTEL_map_texture */ -#ifdef GL_INTEL_parallel_arrays - GLEW_INTEL_parallel_arrays = _glewSearchExtension("GL_INTEL_parallel_arrays", extStart, extEnd); - if (glewExperimental || GLEW_INTEL_parallel_arrays) GLEW_INTEL_parallel_arrays = !_glewInit_GL_INTEL_parallel_arrays(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_INTEL_parallel_arrays */ -#ifdef GL_INTEL_performance_query - GLEW_INTEL_performance_query = _glewSearchExtension("GL_INTEL_performance_query", extStart, extEnd); - if (glewExperimental || GLEW_INTEL_performance_query) GLEW_INTEL_performance_query = !_glewInit_GL_INTEL_performance_query(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_INTEL_performance_query */ -#ifdef GL_INTEL_texture_scissor - GLEW_INTEL_texture_scissor = _glewSearchExtension("GL_INTEL_texture_scissor", extStart, extEnd); - if (glewExperimental || GLEW_INTEL_texture_scissor) GLEW_INTEL_texture_scissor = !_glewInit_GL_INTEL_texture_scissor(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_INTEL_texture_scissor */ -#ifdef GL_KHR_blend_equation_advanced - GLEW_KHR_blend_equation_advanced = _glewSearchExtension("GL_KHR_blend_equation_advanced", extStart, extEnd); - if (glewExperimental || GLEW_KHR_blend_equation_advanced) GLEW_KHR_blend_equation_advanced = !_glewInit_GL_KHR_blend_equation_advanced(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_KHR_blend_equation_advanced */ -#ifdef GL_KHR_blend_equation_advanced_coherent - GLEW_KHR_blend_equation_advanced_coherent = _glewSearchExtension("GL_KHR_blend_equation_advanced_coherent", extStart, extEnd); -#endif /* GL_KHR_blend_equation_advanced_coherent */ -#ifdef GL_KHR_context_flush_control - GLEW_KHR_context_flush_control = _glewSearchExtension("GL_KHR_context_flush_control", extStart, extEnd); -#endif /* GL_KHR_context_flush_control */ -#ifdef GL_KHR_debug - GLEW_KHR_debug = _glewSearchExtension("GL_KHR_debug", extStart, extEnd); - if (glewExperimental || GLEW_KHR_debug) GLEW_KHR_debug = !_glewInit_GL_KHR_debug(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_KHR_debug */ -#ifdef GL_KHR_no_error - GLEW_KHR_no_error = _glewSearchExtension("GL_KHR_no_error", extStart, extEnd); -#endif /* GL_KHR_no_error */ -#ifdef GL_KHR_robust_buffer_access_behavior - GLEW_KHR_robust_buffer_access_behavior = _glewSearchExtension("GL_KHR_robust_buffer_access_behavior", extStart, extEnd); -#endif /* GL_KHR_robust_buffer_access_behavior */ -#ifdef GL_KHR_robustness - GLEW_KHR_robustness = _glewSearchExtension("GL_KHR_robustness", extStart, extEnd); - if (glewExperimental || GLEW_KHR_robustness) GLEW_KHR_robustness = !_glewInit_GL_KHR_robustness(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_KHR_robustness */ -#ifdef GL_KHR_texture_compression_astc_hdr - GLEW_KHR_texture_compression_astc_hdr = _glewSearchExtension("GL_KHR_texture_compression_astc_hdr", extStart, extEnd); -#endif /* GL_KHR_texture_compression_astc_hdr */ -#ifdef GL_KHR_texture_compression_astc_ldr - GLEW_KHR_texture_compression_astc_ldr = _glewSearchExtension("GL_KHR_texture_compression_astc_ldr", extStart, extEnd); -#endif /* GL_KHR_texture_compression_astc_ldr */ -#ifdef GL_KTX_buffer_region - GLEW_KTX_buffer_region = _glewSearchExtension("GL_KTX_buffer_region", extStart, extEnd); - if (glewExperimental || GLEW_KTX_buffer_region) GLEW_KTX_buffer_region = !_glewInit_GL_KTX_buffer_region(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_KTX_buffer_region */ -#ifdef GL_MESAX_texture_stack - GLEW_MESAX_texture_stack = _glewSearchExtension("GL_MESAX_texture_stack", extStart, extEnd); -#endif /* GL_MESAX_texture_stack */ -#ifdef GL_MESA_pack_invert - GLEW_MESA_pack_invert = _glewSearchExtension("GL_MESA_pack_invert", extStart, extEnd); -#endif /* GL_MESA_pack_invert */ -#ifdef GL_MESA_resize_buffers - GLEW_MESA_resize_buffers = _glewSearchExtension("GL_MESA_resize_buffers", extStart, extEnd); - if (glewExperimental || GLEW_MESA_resize_buffers) GLEW_MESA_resize_buffers = !_glewInit_GL_MESA_resize_buffers(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_MESA_resize_buffers */ -#ifdef GL_MESA_window_pos - GLEW_MESA_window_pos = _glewSearchExtension("GL_MESA_window_pos", extStart, extEnd); - if (glewExperimental || GLEW_MESA_window_pos) GLEW_MESA_window_pos = !_glewInit_GL_MESA_window_pos(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_MESA_window_pos */ -#ifdef GL_MESA_ycbcr_texture - GLEW_MESA_ycbcr_texture = _glewSearchExtension("GL_MESA_ycbcr_texture", extStart, extEnd); -#endif /* GL_MESA_ycbcr_texture */ -#ifdef GL_NVX_conditional_render - GLEW_NVX_conditional_render = _glewSearchExtension("GL_NVX_conditional_render", extStart, extEnd); - if (glewExperimental || GLEW_NVX_conditional_render) GLEW_NVX_conditional_render = !_glewInit_GL_NVX_conditional_render(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NVX_conditional_render */ -#ifdef GL_NVX_gpu_memory_info - GLEW_NVX_gpu_memory_info = _glewSearchExtension("GL_NVX_gpu_memory_info", extStart, extEnd); -#endif /* GL_NVX_gpu_memory_info */ -#ifdef GL_NV_bindless_multi_draw_indirect - GLEW_NV_bindless_multi_draw_indirect = _glewSearchExtension("GL_NV_bindless_multi_draw_indirect", extStart, extEnd); - if (glewExperimental || GLEW_NV_bindless_multi_draw_indirect) GLEW_NV_bindless_multi_draw_indirect = !_glewInit_GL_NV_bindless_multi_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_bindless_multi_draw_indirect */ -#ifdef GL_NV_bindless_multi_draw_indirect_count - GLEW_NV_bindless_multi_draw_indirect_count = _glewSearchExtension("GL_NV_bindless_multi_draw_indirect_count", extStart, extEnd); - if (glewExperimental || GLEW_NV_bindless_multi_draw_indirect_count) GLEW_NV_bindless_multi_draw_indirect_count = !_glewInit_GL_NV_bindless_multi_draw_indirect_count(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_bindless_multi_draw_indirect_count */ -#ifdef GL_NV_bindless_texture - GLEW_NV_bindless_texture = _glewSearchExtension("GL_NV_bindless_texture", extStart, extEnd); - if (glewExperimental || GLEW_NV_bindless_texture) GLEW_NV_bindless_texture = !_glewInit_GL_NV_bindless_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_bindless_texture */ -#ifdef GL_NV_blend_equation_advanced - GLEW_NV_blend_equation_advanced = _glewSearchExtension("GL_NV_blend_equation_advanced", extStart, extEnd); - if (glewExperimental || GLEW_NV_blend_equation_advanced) GLEW_NV_blend_equation_advanced = !_glewInit_GL_NV_blend_equation_advanced(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_blend_equation_advanced */ -#ifdef GL_NV_blend_equation_advanced_coherent - GLEW_NV_blend_equation_advanced_coherent = _glewSearchExtension("GL_NV_blend_equation_advanced_coherent", extStart, extEnd); -#endif /* GL_NV_blend_equation_advanced_coherent */ -#ifdef GL_NV_blend_square - GLEW_NV_blend_square = _glewSearchExtension("GL_NV_blend_square", extStart, extEnd); -#endif /* GL_NV_blend_square */ -#ifdef GL_NV_compute_program5 - GLEW_NV_compute_program5 = _glewSearchExtension("GL_NV_compute_program5", extStart, extEnd); -#endif /* GL_NV_compute_program5 */ -#ifdef GL_NV_conditional_render - GLEW_NV_conditional_render = _glewSearchExtension("GL_NV_conditional_render", extStart, extEnd); - if (glewExperimental || GLEW_NV_conditional_render) GLEW_NV_conditional_render = !_glewInit_GL_NV_conditional_render(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_conditional_render */ -#ifdef GL_NV_conservative_raster - GLEW_NV_conservative_raster = _glewSearchExtension("GL_NV_conservative_raster", extStart, extEnd); - if (glewExperimental || GLEW_NV_conservative_raster) GLEW_NV_conservative_raster = !_glewInit_GL_NV_conservative_raster(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_conservative_raster */ -#ifdef GL_NV_conservative_raster_dilate - GLEW_NV_conservative_raster_dilate = _glewSearchExtension("GL_NV_conservative_raster_dilate", extStart, extEnd); - if (glewExperimental || GLEW_NV_conservative_raster_dilate) GLEW_NV_conservative_raster_dilate = !_glewInit_GL_NV_conservative_raster_dilate(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_conservative_raster_dilate */ -#ifdef GL_NV_copy_depth_to_color - GLEW_NV_copy_depth_to_color = _glewSearchExtension("GL_NV_copy_depth_to_color", extStart, extEnd); -#endif /* GL_NV_copy_depth_to_color */ -#ifdef GL_NV_copy_image - GLEW_NV_copy_image = _glewSearchExtension("GL_NV_copy_image", extStart, extEnd); - if (glewExperimental || GLEW_NV_copy_image) GLEW_NV_copy_image = !_glewInit_GL_NV_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_copy_image */ -#ifdef GL_NV_deep_texture3D - GLEW_NV_deep_texture3D = _glewSearchExtension("GL_NV_deep_texture3D", extStart, extEnd); -#endif /* GL_NV_deep_texture3D */ -#ifdef GL_NV_depth_buffer_float - GLEW_NV_depth_buffer_float = _glewSearchExtension("GL_NV_depth_buffer_float", extStart, extEnd); - if (glewExperimental || GLEW_NV_depth_buffer_float) GLEW_NV_depth_buffer_float = !_glewInit_GL_NV_depth_buffer_float(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_depth_buffer_float */ -#ifdef GL_NV_depth_clamp - GLEW_NV_depth_clamp = _glewSearchExtension("GL_NV_depth_clamp", extStart, extEnd); -#endif /* GL_NV_depth_clamp */ -#ifdef GL_NV_depth_range_unclamped - GLEW_NV_depth_range_unclamped = _glewSearchExtension("GL_NV_depth_range_unclamped", extStart, extEnd); -#endif /* GL_NV_depth_range_unclamped */ -#ifdef GL_NV_draw_texture - GLEW_NV_draw_texture = _glewSearchExtension("GL_NV_draw_texture", extStart, extEnd); - if (glewExperimental || GLEW_NV_draw_texture) GLEW_NV_draw_texture = !_glewInit_GL_NV_draw_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_draw_texture */ -#ifdef GL_NV_evaluators - GLEW_NV_evaluators = _glewSearchExtension("GL_NV_evaluators", extStart, extEnd); - if (glewExperimental || GLEW_NV_evaluators) GLEW_NV_evaluators = !_glewInit_GL_NV_evaluators(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_evaluators */ -#ifdef GL_NV_explicit_multisample - GLEW_NV_explicit_multisample = _glewSearchExtension("GL_NV_explicit_multisample", extStart, extEnd); - if (glewExperimental || GLEW_NV_explicit_multisample) GLEW_NV_explicit_multisample = !_glewInit_GL_NV_explicit_multisample(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_explicit_multisample */ -#ifdef GL_NV_fence - GLEW_NV_fence = _glewSearchExtension("GL_NV_fence", extStart, extEnd); - if (glewExperimental || GLEW_NV_fence) GLEW_NV_fence = !_glewInit_GL_NV_fence(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_fence */ -#ifdef GL_NV_fill_rectangle - GLEW_NV_fill_rectangle = _glewSearchExtension("GL_NV_fill_rectangle", extStart, extEnd); -#endif /* GL_NV_fill_rectangle */ -#ifdef GL_NV_float_buffer - GLEW_NV_float_buffer = _glewSearchExtension("GL_NV_float_buffer", extStart, extEnd); -#endif /* GL_NV_float_buffer */ -#ifdef GL_NV_fog_distance - GLEW_NV_fog_distance = _glewSearchExtension("GL_NV_fog_distance", extStart, extEnd); -#endif /* GL_NV_fog_distance */ -#ifdef GL_NV_fragment_coverage_to_color - GLEW_NV_fragment_coverage_to_color = _glewSearchExtension("GL_NV_fragment_coverage_to_color", extStart, extEnd); - if (glewExperimental || GLEW_NV_fragment_coverage_to_color) GLEW_NV_fragment_coverage_to_color = !_glewInit_GL_NV_fragment_coverage_to_color(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_fragment_coverage_to_color */ -#ifdef GL_NV_fragment_program - GLEW_NV_fragment_program = _glewSearchExtension("GL_NV_fragment_program", extStart, extEnd); - if (glewExperimental || GLEW_NV_fragment_program) GLEW_NV_fragment_program = !_glewInit_GL_NV_fragment_program(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_fragment_program */ -#ifdef GL_NV_fragment_program2 - GLEW_NV_fragment_program2 = _glewSearchExtension("GL_NV_fragment_program2", extStart, extEnd); -#endif /* GL_NV_fragment_program2 */ -#ifdef GL_NV_fragment_program4 - GLEW_NV_fragment_program4 = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd); -#endif /* GL_NV_fragment_program4 */ -#ifdef GL_NV_fragment_program_option - GLEW_NV_fragment_program_option = _glewSearchExtension("GL_NV_fragment_program_option", extStart, extEnd); -#endif /* GL_NV_fragment_program_option */ -#ifdef GL_NV_fragment_shader_interlock - GLEW_NV_fragment_shader_interlock = _glewSearchExtension("GL_NV_fragment_shader_interlock", extStart, extEnd); -#endif /* GL_NV_fragment_shader_interlock */ -#ifdef GL_NV_framebuffer_mixed_samples - GLEW_NV_framebuffer_mixed_samples = _glewSearchExtension("GL_NV_framebuffer_mixed_samples", extStart, extEnd); -#endif /* GL_NV_framebuffer_mixed_samples */ -#ifdef GL_NV_framebuffer_multisample_coverage - GLEW_NV_framebuffer_multisample_coverage = _glewSearchExtension("GL_NV_framebuffer_multisample_coverage", extStart, extEnd); - if (glewExperimental || GLEW_NV_framebuffer_multisample_coverage) GLEW_NV_framebuffer_multisample_coverage = !_glewInit_GL_NV_framebuffer_multisample_coverage(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_framebuffer_multisample_coverage */ -#ifdef GL_NV_geometry_program4 - GLEW_NV_geometry_program4 = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd); - if (glewExperimental || GLEW_NV_geometry_program4) GLEW_NV_geometry_program4 = !_glewInit_GL_NV_geometry_program4(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_geometry_program4 */ -#ifdef GL_NV_geometry_shader4 - GLEW_NV_geometry_shader4 = _glewSearchExtension("GL_NV_geometry_shader4", extStart, extEnd); -#endif /* GL_NV_geometry_shader4 */ -#ifdef GL_NV_geometry_shader_passthrough - GLEW_NV_geometry_shader_passthrough = _glewSearchExtension("GL_NV_geometry_shader_passthrough", extStart, extEnd); -#endif /* GL_NV_geometry_shader_passthrough */ -#ifdef GL_NV_gpu_program4 - GLEW_NV_gpu_program4 = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd); - if (glewExperimental || GLEW_NV_gpu_program4) GLEW_NV_gpu_program4 = !_glewInit_GL_NV_gpu_program4(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_gpu_program4 */ -#ifdef GL_NV_gpu_program5 - GLEW_NV_gpu_program5 = _glewSearchExtension("GL_NV_gpu_program5", extStart, extEnd); -#endif /* GL_NV_gpu_program5 */ -#ifdef GL_NV_gpu_program5_mem_extended - GLEW_NV_gpu_program5_mem_extended = _glewSearchExtension("GL_NV_gpu_program5_mem_extended", extStart, extEnd); -#endif /* GL_NV_gpu_program5_mem_extended */ -#ifdef GL_NV_gpu_program_fp64 - GLEW_NV_gpu_program_fp64 = _glewSearchExtension("GL_NV_gpu_program_fp64", extStart, extEnd); -#endif /* GL_NV_gpu_program_fp64 */ -#ifdef GL_NV_gpu_shader5 - GLEW_NV_gpu_shader5 = _glewSearchExtension("GL_NV_gpu_shader5", extStart, extEnd); - if (glewExperimental || GLEW_NV_gpu_shader5) GLEW_NV_gpu_shader5 = !_glewInit_GL_NV_gpu_shader5(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_gpu_shader5 */ -#ifdef GL_NV_half_float - GLEW_NV_half_float = _glewSearchExtension("GL_NV_half_float", extStart, extEnd); - if (glewExperimental || GLEW_NV_half_float) GLEW_NV_half_float = !_glewInit_GL_NV_half_float(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_half_float */ -#ifdef GL_NV_internalformat_sample_query - GLEW_NV_internalformat_sample_query = _glewSearchExtension("GL_NV_internalformat_sample_query", extStart, extEnd); - if (glewExperimental || GLEW_NV_internalformat_sample_query) GLEW_NV_internalformat_sample_query = !_glewInit_GL_NV_internalformat_sample_query(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_internalformat_sample_query */ -#ifdef GL_NV_light_max_exponent - GLEW_NV_light_max_exponent = _glewSearchExtension("GL_NV_light_max_exponent", extStart, extEnd); -#endif /* GL_NV_light_max_exponent */ -#ifdef GL_NV_multisample_coverage - GLEW_NV_multisample_coverage = _glewSearchExtension("GL_NV_multisample_coverage", extStart, extEnd); -#endif /* GL_NV_multisample_coverage */ -#ifdef GL_NV_multisample_filter_hint - GLEW_NV_multisample_filter_hint = _glewSearchExtension("GL_NV_multisample_filter_hint", extStart, extEnd); -#endif /* GL_NV_multisample_filter_hint */ -#ifdef GL_NV_occlusion_query - GLEW_NV_occlusion_query = _glewSearchExtension("GL_NV_occlusion_query", extStart, extEnd); - if (glewExperimental || GLEW_NV_occlusion_query) GLEW_NV_occlusion_query = !_glewInit_GL_NV_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_occlusion_query */ -#ifdef GL_NV_packed_depth_stencil - GLEW_NV_packed_depth_stencil = _glewSearchExtension("GL_NV_packed_depth_stencil", extStart, extEnd); -#endif /* GL_NV_packed_depth_stencil */ -#ifdef GL_NV_parameter_buffer_object - GLEW_NV_parameter_buffer_object = _glewSearchExtension("GL_NV_parameter_buffer_object", extStart, extEnd); - if (glewExperimental || GLEW_NV_parameter_buffer_object) GLEW_NV_parameter_buffer_object = !_glewInit_GL_NV_parameter_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_parameter_buffer_object */ -#ifdef GL_NV_parameter_buffer_object2 - GLEW_NV_parameter_buffer_object2 = _glewSearchExtension("GL_NV_parameter_buffer_object2", extStart, extEnd); -#endif /* GL_NV_parameter_buffer_object2 */ -#ifdef GL_NV_path_rendering - GLEW_NV_path_rendering = _glewSearchExtension("GL_NV_path_rendering", extStart, extEnd); - if (glewExperimental || GLEW_NV_path_rendering) GLEW_NV_path_rendering = !_glewInit_GL_NV_path_rendering(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_path_rendering */ -#ifdef GL_NV_path_rendering_shared_edge - GLEW_NV_path_rendering_shared_edge = _glewSearchExtension("GL_NV_path_rendering_shared_edge", extStart, extEnd); -#endif /* GL_NV_path_rendering_shared_edge */ -#ifdef GL_NV_pixel_data_range - GLEW_NV_pixel_data_range = _glewSearchExtension("GL_NV_pixel_data_range", extStart, extEnd); - if (glewExperimental || GLEW_NV_pixel_data_range) GLEW_NV_pixel_data_range = !_glewInit_GL_NV_pixel_data_range(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_pixel_data_range */ -#ifdef GL_NV_point_sprite - GLEW_NV_point_sprite = _glewSearchExtension("GL_NV_point_sprite", extStart, extEnd); - if (glewExperimental || GLEW_NV_point_sprite) GLEW_NV_point_sprite = !_glewInit_GL_NV_point_sprite(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_point_sprite */ -#ifdef GL_NV_present_video - GLEW_NV_present_video = _glewSearchExtension("GL_NV_present_video", extStart, extEnd); - if (glewExperimental || GLEW_NV_present_video) GLEW_NV_present_video = !_glewInit_GL_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_present_video */ -#ifdef GL_NV_primitive_restart - GLEW_NV_primitive_restart = _glewSearchExtension("GL_NV_primitive_restart", extStart, extEnd); - if (glewExperimental || GLEW_NV_primitive_restart) GLEW_NV_primitive_restart = !_glewInit_GL_NV_primitive_restart(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_primitive_restart */ -#ifdef GL_NV_register_combiners - GLEW_NV_register_combiners = _glewSearchExtension("GL_NV_register_combiners", extStart, extEnd); - if (glewExperimental || GLEW_NV_register_combiners) GLEW_NV_register_combiners = !_glewInit_GL_NV_register_combiners(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_register_combiners */ -#ifdef GL_NV_register_combiners2 - GLEW_NV_register_combiners2 = _glewSearchExtension("GL_NV_register_combiners2", extStart, extEnd); - if (glewExperimental || GLEW_NV_register_combiners2) GLEW_NV_register_combiners2 = !_glewInit_GL_NV_register_combiners2(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_register_combiners2 */ -#ifdef GL_NV_sample_locations - GLEW_NV_sample_locations = _glewSearchExtension("GL_NV_sample_locations", extStart, extEnd); - if (glewExperimental || GLEW_NV_sample_locations) GLEW_NV_sample_locations = !_glewInit_GL_NV_sample_locations(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_sample_locations */ -#ifdef GL_NV_sample_mask_override_coverage - GLEW_NV_sample_mask_override_coverage = _glewSearchExtension("GL_NV_sample_mask_override_coverage", extStart, extEnd); -#endif /* GL_NV_sample_mask_override_coverage */ -#ifdef GL_NV_shader_atomic_counters - GLEW_NV_shader_atomic_counters = _glewSearchExtension("GL_NV_shader_atomic_counters", extStart, extEnd); -#endif /* GL_NV_shader_atomic_counters */ -#ifdef GL_NV_shader_atomic_float - GLEW_NV_shader_atomic_float = _glewSearchExtension("GL_NV_shader_atomic_float", extStart, extEnd); -#endif /* GL_NV_shader_atomic_float */ -#ifdef GL_NV_shader_atomic_fp16_vector - GLEW_NV_shader_atomic_fp16_vector = _glewSearchExtension("GL_NV_shader_atomic_fp16_vector", extStart, extEnd); -#endif /* GL_NV_shader_atomic_fp16_vector */ -#ifdef GL_NV_shader_atomic_int64 - GLEW_NV_shader_atomic_int64 = _glewSearchExtension("GL_NV_shader_atomic_int64", extStart, extEnd); -#endif /* GL_NV_shader_atomic_int64 */ -#ifdef GL_NV_shader_buffer_load - GLEW_NV_shader_buffer_load = _glewSearchExtension("GL_NV_shader_buffer_load", extStart, extEnd); - if (glewExperimental || GLEW_NV_shader_buffer_load) GLEW_NV_shader_buffer_load = !_glewInit_GL_NV_shader_buffer_load(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_shader_buffer_load */ -#ifdef GL_NV_shader_storage_buffer_object - GLEW_NV_shader_storage_buffer_object = _glewSearchExtension("GL_NV_shader_storage_buffer_object", extStart, extEnd); -#endif /* GL_NV_shader_storage_buffer_object */ -#ifdef GL_NV_shader_thread_group - GLEW_NV_shader_thread_group = _glewSearchExtension("GL_NV_shader_thread_group", extStart, extEnd); -#endif /* GL_NV_shader_thread_group */ -#ifdef GL_NV_shader_thread_shuffle - GLEW_NV_shader_thread_shuffle = _glewSearchExtension("GL_NV_shader_thread_shuffle", extStart, extEnd); -#endif /* GL_NV_shader_thread_shuffle */ -#ifdef GL_NV_tessellation_program5 - GLEW_NV_tessellation_program5 = _glewSearchExtension("GL_NV_gpu_program5", extStart, extEnd); -#endif /* GL_NV_tessellation_program5 */ -#ifdef GL_NV_texgen_emboss - GLEW_NV_texgen_emboss = _glewSearchExtension("GL_NV_texgen_emboss", extStart, extEnd); -#endif /* GL_NV_texgen_emboss */ -#ifdef GL_NV_texgen_reflection - GLEW_NV_texgen_reflection = _glewSearchExtension("GL_NV_texgen_reflection", extStart, extEnd); -#endif /* GL_NV_texgen_reflection */ -#ifdef GL_NV_texture_barrier - GLEW_NV_texture_barrier = _glewSearchExtension("GL_NV_texture_barrier", extStart, extEnd); - if (glewExperimental || GLEW_NV_texture_barrier) GLEW_NV_texture_barrier = !_glewInit_GL_NV_texture_barrier(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_texture_barrier */ -#ifdef GL_NV_texture_compression_vtc - GLEW_NV_texture_compression_vtc = _glewSearchExtension("GL_NV_texture_compression_vtc", extStart, extEnd); -#endif /* GL_NV_texture_compression_vtc */ -#ifdef GL_NV_texture_env_combine4 - GLEW_NV_texture_env_combine4 = _glewSearchExtension("GL_NV_texture_env_combine4", extStart, extEnd); -#endif /* GL_NV_texture_env_combine4 */ -#ifdef GL_NV_texture_expand_normal - GLEW_NV_texture_expand_normal = _glewSearchExtension("GL_NV_texture_expand_normal", extStart, extEnd); -#endif /* GL_NV_texture_expand_normal */ -#ifdef GL_NV_texture_multisample - GLEW_NV_texture_multisample = _glewSearchExtension("GL_NV_texture_multisample", extStart, extEnd); - if (glewExperimental || GLEW_NV_texture_multisample) GLEW_NV_texture_multisample = !_glewInit_GL_NV_texture_multisample(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_texture_multisample */ -#ifdef GL_NV_texture_rectangle - GLEW_NV_texture_rectangle = _glewSearchExtension("GL_NV_texture_rectangle", extStart, extEnd); -#endif /* GL_NV_texture_rectangle */ -#ifdef GL_NV_texture_shader - GLEW_NV_texture_shader = _glewSearchExtension("GL_NV_texture_shader", extStart, extEnd); -#endif /* GL_NV_texture_shader */ -#ifdef GL_NV_texture_shader2 - GLEW_NV_texture_shader2 = _glewSearchExtension("GL_NV_texture_shader2", extStart, extEnd); -#endif /* GL_NV_texture_shader2 */ -#ifdef GL_NV_texture_shader3 - GLEW_NV_texture_shader3 = _glewSearchExtension("GL_NV_texture_shader3", extStart, extEnd); -#endif /* GL_NV_texture_shader3 */ -#ifdef GL_NV_transform_feedback - GLEW_NV_transform_feedback = _glewSearchExtension("GL_NV_transform_feedback", extStart, extEnd); - if (glewExperimental || GLEW_NV_transform_feedback) GLEW_NV_transform_feedback = !_glewInit_GL_NV_transform_feedback(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_transform_feedback */ -#ifdef GL_NV_transform_feedback2 - GLEW_NV_transform_feedback2 = _glewSearchExtension("GL_NV_transform_feedback2", extStart, extEnd); - if (glewExperimental || GLEW_NV_transform_feedback2) GLEW_NV_transform_feedback2 = !_glewInit_GL_NV_transform_feedback2(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_transform_feedback2 */ -#ifdef GL_NV_uniform_buffer_unified_memory - GLEW_NV_uniform_buffer_unified_memory = _glewSearchExtension("GL_NV_uniform_buffer_unified_memory", extStart, extEnd); -#endif /* GL_NV_uniform_buffer_unified_memory */ -#ifdef GL_NV_vdpau_interop - GLEW_NV_vdpau_interop = _glewSearchExtension("GL_NV_vdpau_interop", extStart, extEnd); - if (glewExperimental || GLEW_NV_vdpau_interop) GLEW_NV_vdpau_interop = !_glewInit_GL_NV_vdpau_interop(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_vdpau_interop */ -#ifdef GL_NV_vertex_array_range - GLEW_NV_vertex_array_range = _glewSearchExtension("GL_NV_vertex_array_range", extStart, extEnd); - if (glewExperimental || GLEW_NV_vertex_array_range) GLEW_NV_vertex_array_range = !_glewInit_GL_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_vertex_array_range */ -#ifdef GL_NV_vertex_array_range2 - GLEW_NV_vertex_array_range2 = _glewSearchExtension("GL_NV_vertex_array_range2", extStart, extEnd); -#endif /* GL_NV_vertex_array_range2 */ -#ifdef GL_NV_vertex_attrib_integer_64bit - GLEW_NV_vertex_attrib_integer_64bit = _glewSearchExtension("GL_NV_vertex_attrib_integer_64bit", extStart, extEnd); - if (glewExperimental || GLEW_NV_vertex_attrib_integer_64bit) GLEW_NV_vertex_attrib_integer_64bit = !_glewInit_GL_NV_vertex_attrib_integer_64bit(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_vertex_attrib_integer_64bit */ -#ifdef GL_NV_vertex_buffer_unified_memory - GLEW_NV_vertex_buffer_unified_memory = _glewSearchExtension("GL_NV_vertex_buffer_unified_memory", extStart, extEnd); - if (glewExperimental || GLEW_NV_vertex_buffer_unified_memory) GLEW_NV_vertex_buffer_unified_memory = !_glewInit_GL_NV_vertex_buffer_unified_memory(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_vertex_buffer_unified_memory */ -#ifdef GL_NV_vertex_program - GLEW_NV_vertex_program = _glewSearchExtension("GL_NV_vertex_program", extStart, extEnd); - if (glewExperimental || GLEW_NV_vertex_program) GLEW_NV_vertex_program = !_glewInit_GL_NV_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_vertex_program */ -#ifdef GL_NV_vertex_program1_1 - GLEW_NV_vertex_program1_1 = _glewSearchExtension("GL_NV_vertex_program1_1", extStart, extEnd); -#endif /* GL_NV_vertex_program1_1 */ -#ifdef GL_NV_vertex_program2 - GLEW_NV_vertex_program2 = _glewSearchExtension("GL_NV_vertex_program2", extStart, extEnd); -#endif /* GL_NV_vertex_program2 */ -#ifdef GL_NV_vertex_program2_option - GLEW_NV_vertex_program2_option = _glewSearchExtension("GL_NV_vertex_program2_option", extStart, extEnd); -#endif /* GL_NV_vertex_program2_option */ -#ifdef GL_NV_vertex_program3 - GLEW_NV_vertex_program3 = _glewSearchExtension("GL_NV_vertex_program3", extStart, extEnd); -#endif /* GL_NV_vertex_program3 */ -#ifdef GL_NV_vertex_program4 - GLEW_NV_vertex_program4 = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd); -#endif /* GL_NV_vertex_program4 */ -#ifdef GL_NV_video_capture - GLEW_NV_video_capture = _glewSearchExtension("GL_NV_video_capture", extStart, extEnd); - if (glewExperimental || GLEW_NV_video_capture) GLEW_NV_video_capture = !_glewInit_GL_NV_video_capture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_NV_video_capture */ -#ifdef GL_NV_viewport_array2 - GLEW_NV_viewport_array2 = _glewSearchExtension("GL_NV_viewport_array2", extStart, extEnd); -#endif /* GL_NV_viewport_array2 */ -#ifdef GL_OES_byte_coordinates - GLEW_OES_byte_coordinates = _glewSearchExtension("GL_OES_byte_coordinates", extStart, extEnd); -#endif /* GL_OES_byte_coordinates */ -#ifdef GL_OES_compressed_paletted_texture - GLEW_OES_compressed_paletted_texture = _glewSearchExtension("GL_OES_compressed_paletted_texture", extStart, extEnd); -#endif /* GL_OES_compressed_paletted_texture */ -#ifdef GL_OES_read_format - GLEW_OES_read_format = _glewSearchExtension("GL_OES_read_format", extStart, extEnd); -#endif /* GL_OES_read_format */ -#ifdef GL_OES_single_precision - GLEW_OES_single_precision = _glewSearchExtension("GL_OES_single_precision", extStart, extEnd); - if (glewExperimental || GLEW_OES_single_precision) GLEW_OES_single_precision = !_glewInit_GL_OES_single_precision(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_OES_single_precision */ -#ifdef GL_OML_interlace - GLEW_OML_interlace = _glewSearchExtension("GL_OML_interlace", extStart, extEnd); -#endif /* GL_OML_interlace */ -#ifdef GL_OML_resample - GLEW_OML_resample = _glewSearchExtension("GL_OML_resample", extStart, extEnd); -#endif /* GL_OML_resample */ -#ifdef GL_OML_subsample - GLEW_OML_subsample = _glewSearchExtension("GL_OML_subsample", extStart, extEnd); -#endif /* GL_OML_subsample */ -#ifdef GL_OVR_multiview - GLEW_OVR_multiview = _glewSearchExtension("GL_OVR_multiview", extStart, extEnd); - if (glewExperimental || GLEW_OVR_multiview) GLEW_OVR_multiview = !_glewInit_GL_OVR_multiview(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_OVR_multiview */ -#ifdef GL_OVR_multiview2 - GLEW_OVR_multiview2 = _glewSearchExtension("GL_OVR_multiview2", extStart, extEnd); -#endif /* GL_OVR_multiview2 */ -#ifdef GL_PGI_misc_hints - GLEW_PGI_misc_hints = _glewSearchExtension("GL_PGI_misc_hints", extStart, extEnd); -#endif /* GL_PGI_misc_hints */ -#ifdef GL_PGI_vertex_hints - GLEW_PGI_vertex_hints = _glewSearchExtension("GL_PGI_vertex_hints", extStart, extEnd); -#endif /* GL_PGI_vertex_hints */ -#ifdef GL_REGAL_ES1_0_compatibility - GLEW_REGAL_ES1_0_compatibility = _glewSearchExtension("GL_REGAL_ES1_0_compatibility", extStart, extEnd); - if (glewExperimental || GLEW_REGAL_ES1_0_compatibility) GLEW_REGAL_ES1_0_compatibility = !_glewInit_GL_REGAL_ES1_0_compatibility(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_REGAL_ES1_0_compatibility */ -#ifdef GL_REGAL_ES1_1_compatibility - GLEW_REGAL_ES1_1_compatibility = _glewSearchExtension("GL_REGAL_ES1_1_compatibility", extStart, extEnd); - if (glewExperimental || GLEW_REGAL_ES1_1_compatibility) GLEW_REGAL_ES1_1_compatibility = !_glewInit_GL_REGAL_ES1_1_compatibility(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_REGAL_ES1_1_compatibility */ -#ifdef GL_REGAL_enable - GLEW_REGAL_enable = _glewSearchExtension("GL_REGAL_enable", extStart, extEnd); -#endif /* GL_REGAL_enable */ -#ifdef GL_REGAL_error_string - GLEW_REGAL_error_string = _glewSearchExtension("GL_REGAL_error_string", extStart, extEnd); - if (glewExperimental || GLEW_REGAL_error_string) GLEW_REGAL_error_string = !_glewInit_GL_REGAL_error_string(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_REGAL_error_string */ -#ifdef GL_REGAL_extension_query - GLEW_REGAL_extension_query = _glewSearchExtension("GL_REGAL_extension_query", extStart, extEnd); - if (glewExperimental || GLEW_REGAL_extension_query) GLEW_REGAL_extension_query = !_glewInit_GL_REGAL_extension_query(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_REGAL_extension_query */ -#ifdef GL_REGAL_log - GLEW_REGAL_log = _glewSearchExtension("GL_REGAL_log", extStart, extEnd); - if (glewExperimental || GLEW_REGAL_log) GLEW_REGAL_log = !_glewInit_GL_REGAL_log(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_REGAL_log */ -#ifdef GL_REGAL_proc_address - GLEW_REGAL_proc_address = _glewSearchExtension("GL_REGAL_proc_address", extStart, extEnd); - if (glewExperimental || GLEW_REGAL_proc_address) GLEW_REGAL_proc_address = !_glewInit_GL_REGAL_proc_address(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_REGAL_proc_address */ -#ifdef GL_REND_screen_coordinates - GLEW_REND_screen_coordinates = _glewSearchExtension("GL_REND_screen_coordinates", extStart, extEnd); -#endif /* GL_REND_screen_coordinates */ -#ifdef GL_S3_s3tc - GLEW_S3_s3tc = _glewSearchExtension("GL_S3_s3tc", extStart, extEnd); -#endif /* GL_S3_s3tc */ -#ifdef GL_SGIS_color_range - GLEW_SGIS_color_range = _glewSearchExtension("GL_SGIS_color_range", extStart, extEnd); -#endif /* GL_SGIS_color_range */ -#ifdef GL_SGIS_detail_texture - GLEW_SGIS_detail_texture = _glewSearchExtension("GL_SGIS_detail_texture", extStart, extEnd); - if (glewExperimental || GLEW_SGIS_detail_texture) GLEW_SGIS_detail_texture = !_glewInit_GL_SGIS_detail_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIS_detail_texture */ -#ifdef GL_SGIS_fog_function - GLEW_SGIS_fog_function = _glewSearchExtension("GL_SGIS_fog_function", extStart, extEnd); - if (glewExperimental || GLEW_SGIS_fog_function) GLEW_SGIS_fog_function = !_glewInit_GL_SGIS_fog_function(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIS_fog_function */ -#ifdef GL_SGIS_generate_mipmap - GLEW_SGIS_generate_mipmap = _glewSearchExtension("GL_SGIS_generate_mipmap", extStart, extEnd); -#endif /* GL_SGIS_generate_mipmap */ -#ifdef GL_SGIS_multisample - GLEW_SGIS_multisample = _glewSearchExtension("GL_SGIS_multisample", extStart, extEnd); - if (glewExperimental || GLEW_SGIS_multisample) GLEW_SGIS_multisample = !_glewInit_GL_SGIS_multisample(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIS_multisample */ -#ifdef GL_SGIS_pixel_texture - GLEW_SGIS_pixel_texture = _glewSearchExtension("GL_SGIS_pixel_texture", extStart, extEnd); -#endif /* GL_SGIS_pixel_texture */ -#ifdef GL_SGIS_point_line_texgen - GLEW_SGIS_point_line_texgen = _glewSearchExtension("GL_SGIS_point_line_texgen", extStart, extEnd); -#endif /* GL_SGIS_point_line_texgen */ -#ifdef GL_SGIS_sharpen_texture - GLEW_SGIS_sharpen_texture = _glewSearchExtension("GL_SGIS_sharpen_texture", extStart, extEnd); - if (glewExperimental || GLEW_SGIS_sharpen_texture) GLEW_SGIS_sharpen_texture = !_glewInit_GL_SGIS_sharpen_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIS_sharpen_texture */ -#ifdef GL_SGIS_texture4D - GLEW_SGIS_texture4D = _glewSearchExtension("GL_SGIS_texture4D", extStart, extEnd); - if (glewExperimental || GLEW_SGIS_texture4D) GLEW_SGIS_texture4D = !_glewInit_GL_SGIS_texture4D(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIS_texture4D */ -#ifdef GL_SGIS_texture_border_clamp - GLEW_SGIS_texture_border_clamp = _glewSearchExtension("GL_SGIS_texture_border_clamp", extStart, extEnd); -#endif /* GL_SGIS_texture_border_clamp */ -#ifdef GL_SGIS_texture_edge_clamp - GLEW_SGIS_texture_edge_clamp = _glewSearchExtension("GL_SGIS_texture_edge_clamp", extStart, extEnd); -#endif /* GL_SGIS_texture_edge_clamp */ -#ifdef GL_SGIS_texture_filter4 - GLEW_SGIS_texture_filter4 = _glewSearchExtension("GL_SGIS_texture_filter4", extStart, extEnd); - if (glewExperimental || GLEW_SGIS_texture_filter4) GLEW_SGIS_texture_filter4 = !_glewInit_GL_SGIS_texture_filter4(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIS_texture_filter4 */ -#ifdef GL_SGIS_texture_lod - GLEW_SGIS_texture_lod = _glewSearchExtension("GL_SGIS_texture_lod", extStart, extEnd); -#endif /* GL_SGIS_texture_lod */ -#ifdef GL_SGIS_texture_select - GLEW_SGIS_texture_select = _glewSearchExtension("GL_SGIS_texture_select", extStart, extEnd); -#endif /* GL_SGIS_texture_select */ -#ifdef GL_SGIX_async - GLEW_SGIX_async = _glewSearchExtension("GL_SGIX_async", extStart, extEnd); - if (glewExperimental || GLEW_SGIX_async) GLEW_SGIX_async = !_glewInit_GL_SGIX_async(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIX_async */ -#ifdef GL_SGIX_async_histogram - GLEW_SGIX_async_histogram = _glewSearchExtension("GL_SGIX_async_histogram", extStart, extEnd); -#endif /* GL_SGIX_async_histogram */ -#ifdef GL_SGIX_async_pixel - GLEW_SGIX_async_pixel = _glewSearchExtension("GL_SGIX_async_pixel", extStart, extEnd); -#endif /* GL_SGIX_async_pixel */ -#ifdef GL_SGIX_blend_alpha_minmax - GLEW_SGIX_blend_alpha_minmax = _glewSearchExtension("GL_SGIX_blend_alpha_minmax", extStart, extEnd); -#endif /* GL_SGIX_blend_alpha_minmax */ -#ifdef GL_SGIX_clipmap - GLEW_SGIX_clipmap = _glewSearchExtension("GL_SGIX_clipmap", extStart, extEnd); -#endif /* GL_SGIX_clipmap */ -#ifdef GL_SGIX_convolution_accuracy - GLEW_SGIX_convolution_accuracy = _glewSearchExtension("GL_SGIX_convolution_accuracy", extStart, extEnd); -#endif /* GL_SGIX_convolution_accuracy */ -#ifdef GL_SGIX_depth_texture - GLEW_SGIX_depth_texture = _glewSearchExtension("GL_SGIX_depth_texture", extStart, extEnd); -#endif /* GL_SGIX_depth_texture */ -#ifdef GL_SGIX_flush_raster - GLEW_SGIX_flush_raster = _glewSearchExtension("GL_SGIX_flush_raster", extStart, extEnd); - if (glewExperimental || GLEW_SGIX_flush_raster) GLEW_SGIX_flush_raster = !_glewInit_GL_SGIX_flush_raster(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIX_flush_raster */ -#ifdef GL_SGIX_fog_offset - GLEW_SGIX_fog_offset = _glewSearchExtension("GL_SGIX_fog_offset", extStart, extEnd); -#endif /* GL_SGIX_fog_offset */ -#ifdef GL_SGIX_fog_texture - GLEW_SGIX_fog_texture = _glewSearchExtension("GL_SGIX_fog_texture", extStart, extEnd); - if (glewExperimental || GLEW_SGIX_fog_texture) GLEW_SGIX_fog_texture = !_glewInit_GL_SGIX_fog_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIX_fog_texture */ -#ifdef GL_SGIX_fragment_specular_lighting - GLEW_SGIX_fragment_specular_lighting = _glewSearchExtension("GL_SGIX_fragment_specular_lighting", extStart, extEnd); - if (glewExperimental || GLEW_SGIX_fragment_specular_lighting) GLEW_SGIX_fragment_specular_lighting = !_glewInit_GL_SGIX_fragment_specular_lighting(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIX_fragment_specular_lighting */ -#ifdef GL_SGIX_framezoom - GLEW_SGIX_framezoom = _glewSearchExtension("GL_SGIX_framezoom", extStart, extEnd); - if (glewExperimental || GLEW_SGIX_framezoom) GLEW_SGIX_framezoom = !_glewInit_GL_SGIX_framezoom(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIX_framezoom */ -#ifdef GL_SGIX_interlace - GLEW_SGIX_interlace = _glewSearchExtension("GL_SGIX_interlace", extStart, extEnd); -#endif /* GL_SGIX_interlace */ -#ifdef GL_SGIX_ir_instrument1 - GLEW_SGIX_ir_instrument1 = _glewSearchExtension("GL_SGIX_ir_instrument1", extStart, extEnd); -#endif /* GL_SGIX_ir_instrument1 */ -#ifdef GL_SGIX_list_priority - GLEW_SGIX_list_priority = _glewSearchExtension("GL_SGIX_list_priority", extStart, extEnd); -#endif /* GL_SGIX_list_priority */ -#ifdef GL_SGIX_pixel_texture - GLEW_SGIX_pixel_texture = _glewSearchExtension("GL_SGIX_pixel_texture", extStart, extEnd); - if (glewExperimental || GLEW_SGIX_pixel_texture) GLEW_SGIX_pixel_texture = !_glewInit_GL_SGIX_pixel_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIX_pixel_texture */ -#ifdef GL_SGIX_pixel_texture_bits - GLEW_SGIX_pixel_texture_bits = _glewSearchExtension("GL_SGIX_pixel_texture_bits", extStart, extEnd); -#endif /* GL_SGIX_pixel_texture_bits */ -#ifdef GL_SGIX_reference_plane - GLEW_SGIX_reference_plane = _glewSearchExtension("GL_SGIX_reference_plane", extStart, extEnd); - if (glewExperimental || GLEW_SGIX_reference_plane) GLEW_SGIX_reference_plane = !_glewInit_GL_SGIX_reference_plane(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIX_reference_plane */ -#ifdef GL_SGIX_resample - GLEW_SGIX_resample = _glewSearchExtension("GL_SGIX_resample", extStart, extEnd); -#endif /* GL_SGIX_resample */ -#ifdef GL_SGIX_shadow - GLEW_SGIX_shadow = _glewSearchExtension("GL_SGIX_shadow", extStart, extEnd); -#endif /* GL_SGIX_shadow */ -#ifdef GL_SGIX_shadow_ambient - GLEW_SGIX_shadow_ambient = _glewSearchExtension("GL_SGIX_shadow_ambient", extStart, extEnd); -#endif /* GL_SGIX_shadow_ambient */ -#ifdef GL_SGIX_sprite - GLEW_SGIX_sprite = _glewSearchExtension("GL_SGIX_sprite", extStart, extEnd); - if (glewExperimental || GLEW_SGIX_sprite) GLEW_SGIX_sprite = !_glewInit_GL_SGIX_sprite(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIX_sprite */ -#ifdef GL_SGIX_tag_sample_buffer - GLEW_SGIX_tag_sample_buffer = _glewSearchExtension("GL_SGIX_tag_sample_buffer", extStart, extEnd); - if (glewExperimental || GLEW_SGIX_tag_sample_buffer) GLEW_SGIX_tag_sample_buffer = !_glewInit_GL_SGIX_tag_sample_buffer(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGIX_tag_sample_buffer */ -#ifdef GL_SGIX_texture_add_env - GLEW_SGIX_texture_add_env = _glewSearchExtension("GL_SGIX_texture_add_env", extStart, extEnd); -#endif /* GL_SGIX_texture_add_env */ -#ifdef GL_SGIX_texture_coordinate_clamp - GLEW_SGIX_texture_coordinate_clamp = _glewSearchExtension("GL_SGIX_texture_coordinate_clamp", extStart, extEnd); -#endif /* GL_SGIX_texture_coordinate_clamp */ -#ifdef GL_SGIX_texture_lod_bias - GLEW_SGIX_texture_lod_bias = _glewSearchExtension("GL_SGIX_texture_lod_bias", extStart, extEnd); -#endif /* GL_SGIX_texture_lod_bias */ -#ifdef GL_SGIX_texture_multi_buffer - GLEW_SGIX_texture_multi_buffer = _glewSearchExtension("GL_SGIX_texture_multi_buffer", extStart, extEnd); -#endif /* GL_SGIX_texture_multi_buffer */ -#ifdef GL_SGIX_texture_range - GLEW_SGIX_texture_range = _glewSearchExtension("GL_SGIX_texture_range", extStart, extEnd); -#endif /* GL_SGIX_texture_range */ -#ifdef GL_SGIX_texture_scale_bias - GLEW_SGIX_texture_scale_bias = _glewSearchExtension("GL_SGIX_texture_scale_bias", extStart, extEnd); -#endif /* GL_SGIX_texture_scale_bias */ -#ifdef GL_SGIX_vertex_preclip - GLEW_SGIX_vertex_preclip = _glewSearchExtension("GL_SGIX_vertex_preclip", extStart, extEnd); -#endif /* GL_SGIX_vertex_preclip */ -#ifdef GL_SGIX_vertex_preclip_hint - GLEW_SGIX_vertex_preclip_hint = _glewSearchExtension("GL_SGIX_vertex_preclip_hint", extStart, extEnd); -#endif /* GL_SGIX_vertex_preclip_hint */ -#ifdef GL_SGIX_ycrcb - GLEW_SGIX_ycrcb = _glewSearchExtension("GL_SGIX_ycrcb", extStart, extEnd); -#endif /* GL_SGIX_ycrcb */ -#ifdef GL_SGI_color_matrix - GLEW_SGI_color_matrix = _glewSearchExtension("GL_SGI_color_matrix", extStart, extEnd); -#endif /* GL_SGI_color_matrix */ -#ifdef GL_SGI_color_table - GLEW_SGI_color_table = _glewSearchExtension("GL_SGI_color_table", extStart, extEnd); - if (glewExperimental || GLEW_SGI_color_table) GLEW_SGI_color_table = !_glewInit_GL_SGI_color_table(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SGI_color_table */ -#ifdef GL_SGI_texture_color_table - GLEW_SGI_texture_color_table = _glewSearchExtension("GL_SGI_texture_color_table", extStart, extEnd); -#endif /* GL_SGI_texture_color_table */ -#ifdef GL_SUNX_constant_data - GLEW_SUNX_constant_data = _glewSearchExtension("GL_SUNX_constant_data", extStart, extEnd); - if (glewExperimental || GLEW_SUNX_constant_data) GLEW_SUNX_constant_data = !_glewInit_GL_SUNX_constant_data(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SUNX_constant_data */ -#ifdef GL_SUN_convolution_border_modes - GLEW_SUN_convolution_border_modes = _glewSearchExtension("GL_SUN_convolution_border_modes", extStart, extEnd); -#endif /* GL_SUN_convolution_border_modes */ -#ifdef GL_SUN_global_alpha - GLEW_SUN_global_alpha = _glewSearchExtension("GL_SUN_global_alpha", extStart, extEnd); - if (glewExperimental || GLEW_SUN_global_alpha) GLEW_SUN_global_alpha = !_glewInit_GL_SUN_global_alpha(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SUN_global_alpha */ -#ifdef GL_SUN_mesh_array - GLEW_SUN_mesh_array = _glewSearchExtension("GL_SUN_mesh_array", extStart, extEnd); -#endif /* GL_SUN_mesh_array */ -#ifdef GL_SUN_read_video_pixels - GLEW_SUN_read_video_pixels = _glewSearchExtension("GL_SUN_read_video_pixels", extStart, extEnd); - if (glewExperimental || GLEW_SUN_read_video_pixels) GLEW_SUN_read_video_pixels = !_glewInit_GL_SUN_read_video_pixels(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SUN_read_video_pixels */ -#ifdef GL_SUN_slice_accum - GLEW_SUN_slice_accum = _glewSearchExtension("GL_SUN_slice_accum", extStart, extEnd); -#endif /* GL_SUN_slice_accum */ -#ifdef GL_SUN_triangle_list - GLEW_SUN_triangle_list = _glewSearchExtension("GL_SUN_triangle_list", extStart, extEnd); - if (glewExperimental || GLEW_SUN_triangle_list) GLEW_SUN_triangle_list = !_glewInit_GL_SUN_triangle_list(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SUN_triangle_list */ -#ifdef GL_SUN_vertex - GLEW_SUN_vertex = _glewSearchExtension("GL_SUN_vertex", extStart, extEnd); - if (glewExperimental || GLEW_SUN_vertex) GLEW_SUN_vertex = !_glewInit_GL_SUN_vertex(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_SUN_vertex */ -#ifdef GL_WIN_phong_shading - GLEW_WIN_phong_shading = _glewSearchExtension("GL_WIN_phong_shading", extStart, extEnd); -#endif /* GL_WIN_phong_shading */ -#ifdef GL_WIN_specular_fog - GLEW_WIN_specular_fog = _glewSearchExtension("GL_WIN_specular_fog", extStart, extEnd); -#endif /* GL_WIN_specular_fog */ -#ifdef GL_WIN_swap_hint - GLEW_WIN_swap_hint = _glewSearchExtension("GL_WIN_swap_hint", extStart, extEnd); - if (glewExperimental || GLEW_WIN_swap_hint) GLEW_WIN_swap_hint = !_glewInit_GL_WIN_swap_hint(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GL_WIN_swap_hint */ - - return GLEW_OK; -} - - -#if defined(_WIN32) - -#if !defined(GLEW_MX) - -PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL = NULL; - -PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD = NULL; -PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD = NULL; -PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD = NULL; -PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD = NULL; -PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD = NULL; -PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD = NULL; -PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD = NULL; -PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD = NULL; -PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD = NULL; - -PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB = NULL; -PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB = NULL; -PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB = NULL; -PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB = NULL; - -PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB = NULL; - -PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB = NULL; - -PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB = NULL; -PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB = NULL; - -PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB = NULL; -PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB = NULL; -PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB = NULL; -PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB = NULL; -PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB = NULL; - -PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB = NULL; -PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB = NULL; -PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB = NULL; - -PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB = NULL; -PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB = NULL; -PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB = NULL; - -PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT = NULL; -PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT = NULL; -PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT = NULL; -PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT = NULL; - -PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT = NULL; - -PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT = NULL; -PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT = NULL; - -PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT = NULL; -PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT = NULL; -PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT = NULL; -PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT = NULL; -PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT = NULL; - -PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT = NULL; -PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT = NULL; -PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT = NULL; - -PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT = NULL; -PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT = NULL; - -PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D = NULL; -PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D = NULL; - -PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D = NULL; -PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D = NULL; -PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D = NULL; -PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D = NULL; - -PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D = NULL; -PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D = NULL; -PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D = NULL; -PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D = NULL; -PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D = NULL; -PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D = NULL; -PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D = NULL; -PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D = NULL; -PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D = NULL; -PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D = NULL; -PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D = NULL; -PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D = NULL; - -PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D = NULL; -PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D = NULL; -PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D = NULL; -PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D = NULL; - -PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D = NULL; -PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D = NULL; -PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D = NULL; -PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D = NULL; - -PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D = NULL; -PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D = NULL; -PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D = NULL; -PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D = NULL; - -PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV = NULL; -PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV = NULL; -PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV = NULL; -PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV = NULL; -PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV = NULL; -PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV = NULL; -PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV = NULL; -PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV = NULL; - -PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV = NULL; - -PFNWGLDELAYBEFORESWAPNVPROC __wglewDelayBeforeSwapNV = NULL; - -PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV = NULL; -PFNWGLDELETEDCNVPROC __wglewDeleteDCNV = NULL; -PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV = NULL; -PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV = NULL; -PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV = NULL; - -PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV = NULL; -PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV = NULL; -PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV = NULL; - -PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV = NULL; -PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV = NULL; -PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV = NULL; -PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV = NULL; -PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV = NULL; -PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV = NULL; - -PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV = NULL; -PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV = NULL; - -PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV = NULL; -PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV = NULL; -PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV = NULL; -PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV = NULL; -PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV = NULL; - -PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV = NULL; -PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV = NULL; -PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV = NULL; -PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV = NULL; -PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV = NULL; -PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV = NULL; - -PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML = NULL; -PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML = NULL; -PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML = NULL; -PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML = NULL; -PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML = NULL; -PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML = NULL; -GLboolean __WGLEW_3DFX_multisample = GL_FALSE; -GLboolean __WGLEW_3DL_stereo_control = GL_FALSE; -GLboolean __WGLEW_AMD_gpu_association = GL_FALSE; -GLboolean __WGLEW_ARB_buffer_region = GL_FALSE; -GLboolean __WGLEW_ARB_context_flush_control = GL_FALSE; -GLboolean __WGLEW_ARB_create_context = GL_FALSE; -GLboolean __WGLEW_ARB_create_context_profile = GL_FALSE; -GLboolean __WGLEW_ARB_create_context_robustness = GL_FALSE; -GLboolean __WGLEW_ARB_extensions_string = GL_FALSE; -GLboolean __WGLEW_ARB_framebuffer_sRGB = GL_FALSE; -GLboolean __WGLEW_ARB_make_current_read = GL_FALSE; -GLboolean __WGLEW_ARB_multisample = GL_FALSE; -GLboolean __WGLEW_ARB_pbuffer = GL_FALSE; -GLboolean __WGLEW_ARB_pixel_format = GL_FALSE; -GLboolean __WGLEW_ARB_pixel_format_float = GL_FALSE; -GLboolean __WGLEW_ARB_render_texture = GL_FALSE; -GLboolean __WGLEW_ARB_robustness_application_isolation = GL_FALSE; -GLboolean __WGLEW_ARB_robustness_share_group_isolation = GL_FALSE; -GLboolean __WGLEW_ATI_pixel_format_float = GL_FALSE; -GLboolean __WGLEW_ATI_render_texture_rectangle = GL_FALSE; -GLboolean __WGLEW_EXT_create_context_es2_profile = GL_FALSE; -GLboolean __WGLEW_EXT_create_context_es_profile = GL_FALSE; -GLboolean __WGLEW_EXT_depth_float = GL_FALSE; -GLboolean __WGLEW_EXT_display_color_table = GL_FALSE; -GLboolean __WGLEW_EXT_extensions_string = GL_FALSE; -GLboolean __WGLEW_EXT_framebuffer_sRGB = GL_FALSE; -GLboolean __WGLEW_EXT_make_current_read = GL_FALSE; -GLboolean __WGLEW_EXT_multisample = GL_FALSE; -GLboolean __WGLEW_EXT_pbuffer = GL_FALSE; -GLboolean __WGLEW_EXT_pixel_format = GL_FALSE; -GLboolean __WGLEW_EXT_pixel_format_packed_float = GL_FALSE; -GLboolean __WGLEW_EXT_swap_control = GL_FALSE; -GLboolean __WGLEW_EXT_swap_control_tear = GL_FALSE; -GLboolean __WGLEW_I3D_digital_video_control = GL_FALSE; -GLboolean __WGLEW_I3D_gamma = GL_FALSE; -GLboolean __WGLEW_I3D_genlock = GL_FALSE; -GLboolean __WGLEW_I3D_image_buffer = GL_FALSE; -GLboolean __WGLEW_I3D_swap_frame_lock = GL_FALSE; -GLboolean __WGLEW_I3D_swap_frame_usage = GL_FALSE; -GLboolean __WGLEW_NV_DX_interop = GL_FALSE; -GLboolean __WGLEW_NV_DX_interop2 = GL_FALSE; -GLboolean __WGLEW_NV_copy_image = GL_FALSE; -GLboolean __WGLEW_NV_delay_before_swap = GL_FALSE; -GLboolean __WGLEW_NV_float_buffer = GL_FALSE; -GLboolean __WGLEW_NV_gpu_affinity = GL_FALSE; -GLboolean __WGLEW_NV_multisample_coverage = GL_FALSE; -GLboolean __WGLEW_NV_present_video = GL_FALSE; -GLboolean __WGLEW_NV_render_depth_texture = GL_FALSE; -GLboolean __WGLEW_NV_render_texture_rectangle = GL_FALSE; -GLboolean __WGLEW_NV_swap_group = GL_FALSE; -GLboolean __WGLEW_NV_vertex_array_range = GL_FALSE; -GLboolean __WGLEW_NV_video_capture = GL_FALSE; -GLboolean __WGLEW_NV_video_output = GL_FALSE; -GLboolean __WGLEW_OML_sync_control = GL_FALSE; - -#endif /* !GLEW_MX */ - -#ifdef WGL_3DL_stereo_control - -static GLboolean _glewInit_WGL_3DL_stereo_control (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglSetStereoEmitterState3DL = (PFNWGLSETSTEREOEMITTERSTATE3DLPROC)glewGetProcAddress((const GLubyte*)"wglSetStereoEmitterState3DL")) == NULL) || r; - - return r; -} - -#endif /* WGL_3DL_stereo_control */ - -#ifdef WGL_AMD_gpu_association - -static GLboolean _glewInit_WGL_AMD_gpu_association (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglBlitContextFramebufferAMD = (PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC)glewGetProcAddress((const GLubyte*)"wglBlitContextFramebufferAMD")) == NULL) || r; - r = ((wglCreateAssociatedContextAMD = (PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglCreateAssociatedContextAMD")) == NULL) || r; - r = ((wglCreateAssociatedContextAttribsAMD = (PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC)glewGetProcAddress((const GLubyte*)"wglCreateAssociatedContextAttribsAMD")) == NULL) || r; - r = ((wglDeleteAssociatedContextAMD = (PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglDeleteAssociatedContextAMD")) == NULL) || r; - r = ((wglGetContextGPUIDAMD = (PFNWGLGETCONTEXTGPUIDAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetContextGPUIDAMD")) == NULL) || r; - r = ((wglGetCurrentAssociatedContextAMD = (PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentAssociatedContextAMD")) == NULL) || r; - r = ((wglGetGPUIDsAMD = (PFNWGLGETGPUIDSAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetGPUIDsAMD")) == NULL) || r; - r = ((wglGetGPUInfoAMD = (PFNWGLGETGPUINFOAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetGPUInfoAMD")) == NULL) || r; - r = ((wglMakeAssociatedContextCurrentAMD = (PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC)glewGetProcAddress((const GLubyte*)"wglMakeAssociatedContextCurrentAMD")) == NULL) || r; - - return r; -} - -#endif /* WGL_AMD_gpu_association */ - -#ifdef WGL_ARB_buffer_region - -static GLboolean _glewInit_WGL_ARB_buffer_region (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglCreateBufferRegionARB = (PFNWGLCREATEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglCreateBufferRegionARB")) == NULL) || r; - r = ((wglDeleteBufferRegionARB = (PFNWGLDELETEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglDeleteBufferRegionARB")) == NULL) || r; - r = ((wglRestoreBufferRegionARB = (PFNWGLRESTOREBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglRestoreBufferRegionARB")) == NULL) || r; - r = ((wglSaveBufferRegionARB = (PFNWGLSAVEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglSaveBufferRegionARB")) == NULL) || r; - - return r; -} - -#endif /* WGL_ARB_buffer_region */ - -#ifdef WGL_ARB_create_context - -static GLboolean _glewInit_WGL_ARB_create_context (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)glewGetProcAddress((const GLubyte*)"wglCreateContextAttribsARB")) == NULL) || r; - - return r; -} - -#endif /* WGL_ARB_create_context */ - -#ifdef WGL_ARB_extensions_string - -static GLboolean _glewInit_WGL_ARB_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB")) == NULL) || r; - - return r; -} - -#endif /* WGL_ARB_extensions_string */ - -#ifdef WGL_ARB_make_current_read - -static GLboolean _glewInit_WGL_ARB_make_current_read (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglGetCurrentReadDCARB = (PFNWGLGETCURRENTREADDCARBPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentReadDCARB")) == NULL) || r; - r = ((wglMakeContextCurrentARB = (PFNWGLMAKECONTEXTCURRENTARBPROC)glewGetProcAddress((const GLubyte*)"wglMakeContextCurrentARB")) == NULL) || r; - - return r; -} - -#endif /* WGL_ARB_make_current_read */ - -#ifdef WGL_ARB_pbuffer - -static GLboolean _glewInit_WGL_ARB_pbuffer (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglCreatePbufferARB = (PFNWGLCREATEPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglCreatePbufferARB")) == NULL) || r; - r = ((wglDestroyPbufferARB = (PFNWGLDESTROYPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglDestroyPbufferARB")) == NULL) || r; - r = ((wglGetPbufferDCARB = (PFNWGLGETPBUFFERDCARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPbufferDCARB")) == NULL) || r; - r = ((wglQueryPbufferARB = (PFNWGLQUERYPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglQueryPbufferARB")) == NULL) || r; - r = ((wglReleasePbufferDCARB = (PFNWGLRELEASEPBUFFERDCARBPROC)glewGetProcAddress((const GLubyte*)"wglReleasePbufferDCARB")) == NULL) || r; - - return r; -} - -#endif /* WGL_ARB_pbuffer */ - -#ifdef WGL_ARB_pixel_format - -static GLboolean _glewInit_WGL_ARB_pixel_format (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)glewGetProcAddress((const GLubyte*)"wglChoosePixelFormatARB")) == NULL) || r; - r = ((wglGetPixelFormatAttribfvARB = (PFNWGLGETPIXELFORMATATTRIBFVARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribfvARB")) == NULL) || r; - r = ((wglGetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribivARB")) == NULL) || r; - - return r; -} - -#endif /* WGL_ARB_pixel_format */ - -#ifdef WGL_ARB_render_texture - -static GLboolean _glewInit_WGL_ARB_render_texture (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglBindTexImageARB = (PFNWGLBINDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"wglBindTexImageARB")) == NULL) || r; - r = ((wglReleaseTexImageARB = (PFNWGLRELEASETEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"wglReleaseTexImageARB")) == NULL) || r; - r = ((wglSetPbufferAttribARB = (PFNWGLSETPBUFFERATTRIBARBPROC)glewGetProcAddress((const GLubyte*)"wglSetPbufferAttribARB")) == NULL) || r; - - return r; -} - -#endif /* WGL_ARB_render_texture */ - -#ifdef WGL_EXT_display_color_table - -static GLboolean _glewInit_WGL_EXT_display_color_table (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglBindDisplayColorTableEXT = (PFNWGLBINDDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglBindDisplayColorTableEXT")) == NULL) || r; - r = ((wglCreateDisplayColorTableEXT = (PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglCreateDisplayColorTableEXT")) == NULL) || r; - r = ((wglDestroyDisplayColorTableEXT = (PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglDestroyDisplayColorTableEXT")) == NULL) || r; - r = ((wglLoadDisplayColorTableEXT = (PFNWGLLOADDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglLoadDisplayColorTableEXT")) == NULL) || r; - - return r; -} - -#endif /* WGL_EXT_display_color_table */ - -#ifdef WGL_EXT_extensions_string - -static GLboolean _glewInit_WGL_EXT_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT")) == NULL) || r; - - return r; -} - -#endif /* WGL_EXT_extensions_string */ - -#ifdef WGL_EXT_make_current_read - -static GLboolean _glewInit_WGL_EXT_make_current_read (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglGetCurrentReadDCEXT = (PFNWGLGETCURRENTREADDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentReadDCEXT")) == NULL) || r; - r = ((wglMakeContextCurrentEXT = (PFNWGLMAKECONTEXTCURRENTEXTPROC)glewGetProcAddress((const GLubyte*)"wglMakeContextCurrentEXT")) == NULL) || r; - - return r; -} - -#endif /* WGL_EXT_make_current_read */ - -#ifdef WGL_EXT_pbuffer - -static GLboolean _glewInit_WGL_EXT_pbuffer (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglCreatePbufferEXT = (PFNWGLCREATEPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglCreatePbufferEXT")) == NULL) || r; - r = ((wglDestroyPbufferEXT = (PFNWGLDESTROYPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglDestroyPbufferEXT")) == NULL) || r; - r = ((wglGetPbufferDCEXT = (PFNWGLGETPBUFFERDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPbufferDCEXT")) == NULL) || r; - r = ((wglQueryPbufferEXT = (PFNWGLQUERYPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglQueryPbufferEXT")) == NULL) || r; - r = ((wglReleasePbufferDCEXT = (PFNWGLRELEASEPBUFFERDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglReleasePbufferDCEXT")) == NULL) || r; - - return r; -} - -#endif /* WGL_EXT_pbuffer */ - -#ifdef WGL_EXT_pixel_format - -static GLboolean _glewInit_WGL_EXT_pixel_format (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglChoosePixelFormatEXT = (PFNWGLCHOOSEPIXELFORMATEXTPROC)glewGetProcAddress((const GLubyte*)"wglChoosePixelFormatEXT")) == NULL) || r; - r = ((wglGetPixelFormatAttribfvEXT = (PFNWGLGETPIXELFORMATATTRIBFVEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribfvEXT")) == NULL) || r; - r = ((wglGetPixelFormatAttribivEXT = (PFNWGLGETPIXELFORMATATTRIBIVEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribivEXT")) == NULL) || r; - - return r; -} - -#endif /* WGL_EXT_pixel_format */ - -#ifdef WGL_EXT_swap_control - -static GLboolean _glewInit_WGL_EXT_swap_control (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetSwapIntervalEXT")) == NULL) || r; - r = ((wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"wglSwapIntervalEXT")) == NULL) || r; - - return r; -} - -#endif /* WGL_EXT_swap_control */ - -#ifdef WGL_I3D_digital_video_control - -static GLboolean _glewInit_WGL_I3D_digital_video_control (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglGetDigitalVideoParametersI3D = (PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetDigitalVideoParametersI3D")) == NULL) || r; - r = ((wglSetDigitalVideoParametersI3D = (PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetDigitalVideoParametersI3D")) == NULL) || r; - - return r; -} - -#endif /* WGL_I3D_digital_video_control */ - -#ifdef WGL_I3D_gamma - -static GLboolean _glewInit_WGL_I3D_gamma (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglGetGammaTableI3D = (PFNWGLGETGAMMATABLEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGammaTableI3D")) == NULL) || r; - r = ((wglGetGammaTableParametersI3D = (PFNWGLGETGAMMATABLEPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGammaTableParametersI3D")) == NULL) || r; - r = ((wglSetGammaTableI3D = (PFNWGLSETGAMMATABLEI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetGammaTableI3D")) == NULL) || r; - r = ((wglSetGammaTableParametersI3D = (PFNWGLSETGAMMATABLEPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetGammaTableParametersI3D")) == NULL) || r; - - return r; -} - -#endif /* WGL_I3D_gamma */ - -#ifdef WGL_I3D_genlock - -static GLboolean _glewInit_WGL_I3D_genlock (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglDisableGenlockI3D = (PFNWGLDISABLEGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglDisableGenlockI3D")) == NULL) || r; - r = ((wglEnableGenlockI3D = (PFNWGLENABLEGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglEnableGenlockI3D")) == NULL) || r; - r = ((wglGenlockSampleRateI3D = (PFNWGLGENLOCKSAMPLERATEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSampleRateI3D")) == NULL) || r; - r = ((wglGenlockSourceDelayI3D = (PFNWGLGENLOCKSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceDelayI3D")) == NULL) || r; - r = ((wglGenlockSourceEdgeI3D = (PFNWGLGENLOCKSOURCEEDGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceEdgeI3D")) == NULL) || r; - r = ((wglGenlockSourceI3D = (PFNWGLGENLOCKSOURCEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceI3D")) == NULL) || r; - r = ((wglGetGenlockSampleRateI3D = (PFNWGLGETGENLOCKSAMPLERATEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSampleRateI3D")) == NULL) || r; - r = ((wglGetGenlockSourceDelayI3D = (PFNWGLGETGENLOCKSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceDelayI3D")) == NULL) || r; - r = ((wglGetGenlockSourceEdgeI3D = (PFNWGLGETGENLOCKSOURCEEDGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceEdgeI3D")) == NULL) || r; - r = ((wglGetGenlockSourceI3D = (PFNWGLGETGENLOCKSOURCEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceI3D")) == NULL) || r; - r = ((wglIsEnabledGenlockI3D = (PFNWGLISENABLEDGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglIsEnabledGenlockI3D")) == NULL) || r; - r = ((wglQueryGenlockMaxSourceDelayI3D = (PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryGenlockMaxSourceDelayI3D")) == NULL) || r; - - return r; -} - -#endif /* WGL_I3D_genlock */ - -#ifdef WGL_I3D_image_buffer - -static GLboolean _glewInit_WGL_I3D_image_buffer (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglAssociateImageBufferEventsI3D = (PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC)glewGetProcAddress((const GLubyte*)"wglAssociateImageBufferEventsI3D")) == NULL) || r; - r = ((wglCreateImageBufferI3D = (PFNWGLCREATEIMAGEBUFFERI3DPROC)glewGetProcAddress((const GLubyte*)"wglCreateImageBufferI3D")) == NULL) || r; - r = ((wglDestroyImageBufferI3D = (PFNWGLDESTROYIMAGEBUFFERI3DPROC)glewGetProcAddress((const GLubyte*)"wglDestroyImageBufferI3D")) == NULL) || r; - r = ((wglReleaseImageBufferEventsI3D = (PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC)glewGetProcAddress((const GLubyte*)"wglReleaseImageBufferEventsI3D")) == NULL) || r; - - return r; -} - -#endif /* WGL_I3D_image_buffer */ - -#ifdef WGL_I3D_swap_frame_lock - -static GLboolean _glewInit_WGL_I3D_swap_frame_lock (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglDisableFrameLockI3D = (PFNWGLDISABLEFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglDisableFrameLockI3D")) == NULL) || r; - r = ((wglEnableFrameLockI3D = (PFNWGLENABLEFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglEnableFrameLockI3D")) == NULL) || r; - r = ((wglIsEnabledFrameLockI3D = (PFNWGLISENABLEDFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglIsEnabledFrameLockI3D")) == NULL) || r; - r = ((wglQueryFrameLockMasterI3D = (PFNWGLQUERYFRAMELOCKMASTERI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameLockMasterI3D")) == NULL) || r; - - return r; -} - -#endif /* WGL_I3D_swap_frame_lock */ - -#ifdef WGL_I3D_swap_frame_usage - -static GLboolean _glewInit_WGL_I3D_swap_frame_usage (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglBeginFrameTrackingI3D = (PFNWGLBEGINFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglBeginFrameTrackingI3D")) == NULL) || r; - r = ((wglEndFrameTrackingI3D = (PFNWGLENDFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglEndFrameTrackingI3D")) == NULL) || r; - r = ((wglGetFrameUsageI3D = (PFNWGLGETFRAMEUSAGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetFrameUsageI3D")) == NULL) || r; - r = ((wglQueryFrameTrackingI3D = (PFNWGLQUERYFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameTrackingI3D")) == NULL) || r; - - return r; -} - -#endif /* WGL_I3D_swap_frame_usage */ - -#ifdef WGL_NV_DX_interop - -static GLboolean _glewInit_WGL_NV_DX_interop (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglDXCloseDeviceNV = (PFNWGLDXCLOSEDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglDXCloseDeviceNV")) == NULL) || r; - r = ((wglDXLockObjectsNV = (PFNWGLDXLOCKOBJECTSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXLockObjectsNV")) == NULL) || r; - r = ((wglDXObjectAccessNV = (PFNWGLDXOBJECTACCESSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXObjectAccessNV")) == NULL) || r; - r = ((wglDXOpenDeviceNV = (PFNWGLDXOPENDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglDXOpenDeviceNV")) == NULL) || r; - r = ((wglDXRegisterObjectNV = (PFNWGLDXREGISTEROBJECTNVPROC)glewGetProcAddress((const GLubyte*)"wglDXRegisterObjectNV")) == NULL) || r; - r = ((wglDXSetResourceShareHandleNV = (PFNWGLDXSETRESOURCESHAREHANDLENVPROC)glewGetProcAddress((const GLubyte*)"wglDXSetResourceShareHandleNV")) == NULL) || r; - r = ((wglDXUnlockObjectsNV = (PFNWGLDXUNLOCKOBJECTSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXUnlockObjectsNV")) == NULL) || r; - r = ((wglDXUnregisterObjectNV = (PFNWGLDXUNREGISTEROBJECTNVPROC)glewGetProcAddress((const GLubyte*)"wglDXUnregisterObjectNV")) == NULL) || r; - - return r; -} - -#endif /* WGL_NV_DX_interop */ - -#ifdef WGL_NV_copy_image - -static GLboolean _glewInit_WGL_NV_copy_image (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglCopyImageSubDataNV = (PFNWGLCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"wglCopyImageSubDataNV")) == NULL) || r; - - return r; -} - -#endif /* WGL_NV_copy_image */ - -#ifdef WGL_NV_delay_before_swap - -static GLboolean _glewInit_WGL_NV_delay_before_swap (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglDelayBeforeSwapNV = (PFNWGLDELAYBEFORESWAPNVPROC)glewGetProcAddress((const GLubyte*)"wglDelayBeforeSwapNV")) == NULL) || r; - - return r; -} - -#endif /* WGL_NV_delay_before_swap */ - -#ifdef WGL_NV_gpu_affinity - -static GLboolean _glewInit_WGL_NV_gpu_affinity (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglCreateAffinityDCNV = (PFNWGLCREATEAFFINITYDCNVPROC)glewGetProcAddress((const GLubyte*)"wglCreateAffinityDCNV")) == NULL) || r; - r = ((wglDeleteDCNV = (PFNWGLDELETEDCNVPROC)glewGetProcAddress((const GLubyte*)"wglDeleteDCNV")) == NULL) || r; - r = ((wglEnumGpuDevicesNV = (PFNWGLENUMGPUDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpuDevicesNV")) == NULL) || r; - r = ((wglEnumGpusFromAffinityDCNV = (PFNWGLENUMGPUSFROMAFFINITYDCNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpusFromAffinityDCNV")) == NULL) || r; - r = ((wglEnumGpusNV = (PFNWGLENUMGPUSNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpusNV")) == NULL) || r; - - return r; -} - -#endif /* WGL_NV_gpu_affinity */ - -#ifdef WGL_NV_present_video - -static GLboolean _glewInit_WGL_NV_present_video (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglBindVideoDeviceNV = (PFNWGLBINDVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoDeviceNV")) == NULL) || r; - r = ((wglEnumerateVideoDevicesNV = (PFNWGLENUMERATEVIDEODEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumerateVideoDevicesNV")) == NULL) || r; - r = ((wglQueryCurrentContextNV = (PFNWGLQUERYCURRENTCONTEXTNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryCurrentContextNV")) == NULL) || r; - - return r; -} - -#endif /* WGL_NV_present_video */ - -#ifdef WGL_NV_swap_group - -static GLboolean _glewInit_WGL_NV_swap_group (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglBindSwapBarrierNV = (PFNWGLBINDSWAPBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"wglBindSwapBarrierNV")) == NULL) || r; - r = ((wglJoinSwapGroupNV = (PFNWGLJOINSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"wglJoinSwapGroupNV")) == NULL) || r; - r = ((wglQueryFrameCountNV = (PFNWGLQUERYFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameCountNV")) == NULL) || r; - r = ((wglQueryMaxSwapGroupsNV = (PFNWGLQUERYMAXSWAPGROUPSNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryMaxSwapGroupsNV")) == NULL) || r; - r = ((wglQuerySwapGroupNV = (PFNWGLQUERYSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"wglQuerySwapGroupNV")) == NULL) || r; - r = ((wglResetFrameCountNV = (PFNWGLRESETFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"wglResetFrameCountNV")) == NULL) || r; - - return r; -} - -#endif /* WGL_NV_swap_group */ - -#ifdef WGL_NV_vertex_array_range - -static GLboolean _glewInit_WGL_NV_vertex_array_range (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglAllocateMemoryNV = (PFNWGLALLOCATEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"wglAllocateMemoryNV")) == NULL) || r; - r = ((wglFreeMemoryNV = (PFNWGLFREEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"wglFreeMemoryNV")) == NULL) || r; - - return r; -} - -#endif /* WGL_NV_vertex_array_range */ - -#ifdef WGL_NV_video_capture - -static GLboolean _glewInit_WGL_NV_video_capture (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglBindVideoCaptureDeviceNV = (PFNWGLBINDVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoCaptureDeviceNV")) == NULL) || r; - r = ((wglEnumerateVideoCaptureDevicesNV = (PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumerateVideoCaptureDevicesNV")) == NULL) || r; - r = ((wglLockVideoCaptureDeviceNV = (PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglLockVideoCaptureDeviceNV")) == NULL) || r; - r = ((wglQueryVideoCaptureDeviceNV = (PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglQueryVideoCaptureDeviceNV")) == NULL) || r; - r = ((wglReleaseVideoCaptureDeviceNV = (PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoCaptureDeviceNV")) == NULL) || r; - - return r; -} - -#endif /* WGL_NV_video_capture */ - -#ifdef WGL_NV_video_output - -static GLboolean _glewInit_WGL_NV_video_output (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglBindVideoImageNV = (PFNWGLBINDVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoImageNV")) == NULL) || r; - r = ((wglGetVideoDeviceNV = (PFNWGLGETVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglGetVideoDeviceNV")) == NULL) || r; - r = ((wglGetVideoInfoNV = (PFNWGLGETVIDEOINFONVPROC)glewGetProcAddress((const GLubyte*)"wglGetVideoInfoNV")) == NULL) || r; - r = ((wglReleaseVideoDeviceNV = (PFNWGLRELEASEVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoDeviceNV")) == NULL) || r; - r = ((wglReleaseVideoImageNV = (PFNWGLRELEASEVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoImageNV")) == NULL) || r; - r = ((wglSendPbufferToVideoNV = (PFNWGLSENDPBUFFERTOVIDEONVPROC)glewGetProcAddress((const GLubyte*)"wglSendPbufferToVideoNV")) == NULL) || r; - - return r; -} - -#endif /* WGL_NV_video_output */ - -#ifdef WGL_OML_sync_control - -static GLboolean _glewInit_WGL_OML_sync_control (WGLEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((wglGetMscRateOML = (PFNWGLGETMSCRATEOMLPROC)glewGetProcAddress((const GLubyte*)"wglGetMscRateOML")) == NULL) || r; - r = ((wglGetSyncValuesOML = (PFNWGLGETSYNCVALUESOMLPROC)glewGetProcAddress((const GLubyte*)"wglGetSyncValuesOML")) == NULL) || r; - r = ((wglSwapBuffersMscOML = (PFNWGLSWAPBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglSwapBuffersMscOML")) == NULL) || r; - r = ((wglSwapLayerBuffersMscOML = (PFNWGLSWAPLAYERBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglSwapLayerBuffersMscOML")) == NULL) || r; - r = ((wglWaitForMscOML = (PFNWGLWAITFORMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglWaitForMscOML")) == NULL) || r; - r = ((wglWaitForSbcOML = (PFNWGLWAITFORSBCOMLPROC)glewGetProcAddress((const GLubyte*)"wglWaitForSbcOML")) == NULL) || r; - - return r; -} - -#endif /* WGL_OML_sync_control */ - -/* ------------------------------------------------------------------------- */ - -static PFNWGLGETEXTENSIONSSTRINGARBPROC _wglewGetExtensionsStringARB = NULL; -static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT = NULL; - -GLboolean GLEWAPIENTRY wglewGetExtension (const char* name) -{ - const GLubyte* start; - const GLubyte* end; - if (_wglewGetExtensionsStringARB == NULL) - if (_wglewGetExtensionsStringEXT == NULL) - return GL_FALSE; - else - start = (const GLubyte*)_wglewGetExtensionsStringEXT(); - else - start = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC()); - if (start == 0) - return GL_FALSE; - end = start + _glewStrLen(start); - return _glewSearchExtension(name, start, end); -} - -#ifdef GLEW_MX -GLenum GLEWAPIENTRY wglewContextInit (WGLEW_CONTEXT_ARG_DEF_LIST) -#else -GLenum GLEWAPIENTRY wglewInit (WGLEW_CONTEXT_ARG_DEF_LIST) -#endif -{ - GLboolean crippled; - const GLubyte* extStart; - const GLubyte* extEnd; - /* find wgl extension string query functions */ - _wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB"); - _wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT"); - /* query wgl extension string */ - if (_wglewGetExtensionsStringARB == NULL) - if (_wglewGetExtensionsStringEXT == NULL) - extStart = (const GLubyte*)""; - else - extStart = (const GLubyte*)_wglewGetExtensionsStringEXT(); - else - extStart = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC()); - extEnd = extStart + _glewStrLen(extStart); - /* initialize extensions */ - crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL; -#ifdef WGL_3DFX_multisample - WGLEW_3DFX_multisample = _glewSearchExtension("WGL_3DFX_multisample", extStart, extEnd); -#endif /* WGL_3DFX_multisample */ -#ifdef WGL_3DL_stereo_control - WGLEW_3DL_stereo_control = _glewSearchExtension("WGL_3DL_stereo_control", extStart, extEnd); - if (glewExperimental || WGLEW_3DL_stereo_control|| crippled) WGLEW_3DL_stereo_control= !_glewInit_WGL_3DL_stereo_control(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_3DL_stereo_control */ -#ifdef WGL_AMD_gpu_association - WGLEW_AMD_gpu_association = _glewSearchExtension("WGL_AMD_gpu_association", extStart, extEnd); - if (glewExperimental || WGLEW_AMD_gpu_association|| crippled) WGLEW_AMD_gpu_association= !_glewInit_WGL_AMD_gpu_association(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_AMD_gpu_association */ -#ifdef WGL_ARB_buffer_region - WGLEW_ARB_buffer_region = _glewSearchExtension("WGL_ARB_buffer_region", extStart, extEnd); - if (glewExperimental || WGLEW_ARB_buffer_region|| crippled) WGLEW_ARB_buffer_region= !_glewInit_WGL_ARB_buffer_region(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_ARB_buffer_region */ -#ifdef WGL_ARB_context_flush_control - WGLEW_ARB_context_flush_control = _glewSearchExtension("WGL_ARB_context_flush_control", extStart, extEnd); -#endif /* WGL_ARB_context_flush_control */ -#ifdef WGL_ARB_create_context - WGLEW_ARB_create_context = _glewSearchExtension("WGL_ARB_create_context", extStart, extEnd); - if (glewExperimental || WGLEW_ARB_create_context|| crippled) WGLEW_ARB_create_context= !_glewInit_WGL_ARB_create_context(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_ARB_create_context */ -#ifdef WGL_ARB_create_context_profile - WGLEW_ARB_create_context_profile = _glewSearchExtension("WGL_ARB_create_context_profile", extStart, extEnd); -#endif /* WGL_ARB_create_context_profile */ -#ifdef WGL_ARB_create_context_robustness - WGLEW_ARB_create_context_robustness = _glewSearchExtension("WGL_ARB_create_context_robustness", extStart, extEnd); -#endif /* WGL_ARB_create_context_robustness */ -#ifdef WGL_ARB_extensions_string - WGLEW_ARB_extensions_string = _glewSearchExtension("WGL_ARB_extensions_string", extStart, extEnd); - if (glewExperimental || WGLEW_ARB_extensions_string|| crippled) WGLEW_ARB_extensions_string= !_glewInit_WGL_ARB_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_ARB_extensions_string */ -#ifdef WGL_ARB_framebuffer_sRGB - WGLEW_ARB_framebuffer_sRGB = _glewSearchExtension("WGL_ARB_framebuffer_sRGB", extStart, extEnd); -#endif /* WGL_ARB_framebuffer_sRGB */ -#ifdef WGL_ARB_make_current_read - WGLEW_ARB_make_current_read = _glewSearchExtension("WGL_ARB_make_current_read", extStart, extEnd); - if (glewExperimental || WGLEW_ARB_make_current_read|| crippled) WGLEW_ARB_make_current_read= !_glewInit_WGL_ARB_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_ARB_make_current_read */ -#ifdef WGL_ARB_multisample - WGLEW_ARB_multisample = _glewSearchExtension("WGL_ARB_multisample", extStart, extEnd); -#endif /* WGL_ARB_multisample */ -#ifdef WGL_ARB_pbuffer - WGLEW_ARB_pbuffer = _glewSearchExtension("WGL_ARB_pbuffer", extStart, extEnd); - if (glewExperimental || WGLEW_ARB_pbuffer|| crippled) WGLEW_ARB_pbuffer= !_glewInit_WGL_ARB_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_ARB_pbuffer */ -#ifdef WGL_ARB_pixel_format - WGLEW_ARB_pixel_format = _glewSearchExtension("WGL_ARB_pixel_format", extStart, extEnd); - if (glewExperimental || WGLEW_ARB_pixel_format|| crippled) WGLEW_ARB_pixel_format= !_glewInit_WGL_ARB_pixel_format(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_ARB_pixel_format */ -#ifdef WGL_ARB_pixel_format_float - WGLEW_ARB_pixel_format_float = _glewSearchExtension("WGL_ARB_pixel_format_float", extStart, extEnd); -#endif /* WGL_ARB_pixel_format_float */ -#ifdef WGL_ARB_render_texture - WGLEW_ARB_render_texture = _glewSearchExtension("WGL_ARB_render_texture", extStart, extEnd); - if (glewExperimental || WGLEW_ARB_render_texture|| crippled) WGLEW_ARB_render_texture= !_glewInit_WGL_ARB_render_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_ARB_render_texture */ -#ifdef WGL_ARB_robustness_application_isolation - WGLEW_ARB_robustness_application_isolation = _glewSearchExtension("WGL_ARB_robustness_application_isolation", extStart, extEnd); -#endif /* WGL_ARB_robustness_application_isolation */ -#ifdef WGL_ARB_robustness_share_group_isolation - WGLEW_ARB_robustness_share_group_isolation = _glewSearchExtension("WGL_ARB_robustness_share_group_isolation", extStart, extEnd); -#endif /* WGL_ARB_robustness_share_group_isolation */ -#ifdef WGL_ATI_pixel_format_float - WGLEW_ATI_pixel_format_float = _glewSearchExtension("WGL_ATI_pixel_format_float", extStart, extEnd); -#endif /* WGL_ATI_pixel_format_float */ -#ifdef WGL_ATI_render_texture_rectangle - WGLEW_ATI_render_texture_rectangle = _glewSearchExtension("WGL_ATI_render_texture_rectangle", extStart, extEnd); -#endif /* WGL_ATI_render_texture_rectangle */ -#ifdef WGL_EXT_create_context_es2_profile - WGLEW_EXT_create_context_es2_profile = _glewSearchExtension("WGL_EXT_create_context_es2_profile", extStart, extEnd); -#endif /* WGL_EXT_create_context_es2_profile */ -#ifdef WGL_EXT_create_context_es_profile - WGLEW_EXT_create_context_es_profile = _glewSearchExtension("WGL_EXT_create_context_es_profile", extStart, extEnd); -#endif /* WGL_EXT_create_context_es_profile */ -#ifdef WGL_EXT_depth_float - WGLEW_EXT_depth_float = _glewSearchExtension("WGL_EXT_depth_float", extStart, extEnd); -#endif /* WGL_EXT_depth_float */ -#ifdef WGL_EXT_display_color_table - WGLEW_EXT_display_color_table = _glewSearchExtension("WGL_EXT_display_color_table", extStart, extEnd); - if (glewExperimental || WGLEW_EXT_display_color_table|| crippled) WGLEW_EXT_display_color_table= !_glewInit_WGL_EXT_display_color_table(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_EXT_display_color_table */ -#ifdef WGL_EXT_extensions_string - WGLEW_EXT_extensions_string = _glewSearchExtension("WGL_EXT_extensions_string", extStart, extEnd); - if (glewExperimental || WGLEW_EXT_extensions_string|| crippled) WGLEW_EXT_extensions_string= !_glewInit_WGL_EXT_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_EXT_extensions_string */ -#ifdef WGL_EXT_framebuffer_sRGB - WGLEW_EXT_framebuffer_sRGB = _glewSearchExtension("WGL_EXT_framebuffer_sRGB", extStart, extEnd); -#endif /* WGL_EXT_framebuffer_sRGB */ -#ifdef WGL_EXT_make_current_read - WGLEW_EXT_make_current_read = _glewSearchExtension("WGL_EXT_make_current_read", extStart, extEnd); - if (glewExperimental || WGLEW_EXT_make_current_read|| crippled) WGLEW_EXT_make_current_read= !_glewInit_WGL_EXT_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_EXT_make_current_read */ -#ifdef WGL_EXT_multisample - WGLEW_EXT_multisample = _glewSearchExtension("WGL_EXT_multisample", extStart, extEnd); -#endif /* WGL_EXT_multisample */ -#ifdef WGL_EXT_pbuffer - WGLEW_EXT_pbuffer = _glewSearchExtension("WGL_EXT_pbuffer", extStart, extEnd); - if (glewExperimental || WGLEW_EXT_pbuffer|| crippled) WGLEW_EXT_pbuffer= !_glewInit_WGL_EXT_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_EXT_pbuffer */ -#ifdef WGL_EXT_pixel_format - WGLEW_EXT_pixel_format = _glewSearchExtension("WGL_EXT_pixel_format", extStart, extEnd); - if (glewExperimental || WGLEW_EXT_pixel_format|| crippled) WGLEW_EXT_pixel_format= !_glewInit_WGL_EXT_pixel_format(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_EXT_pixel_format */ -#ifdef WGL_EXT_pixel_format_packed_float - WGLEW_EXT_pixel_format_packed_float = _glewSearchExtension("WGL_EXT_pixel_format_packed_float", extStart, extEnd); -#endif /* WGL_EXT_pixel_format_packed_float */ -#ifdef WGL_EXT_swap_control - WGLEW_EXT_swap_control = _glewSearchExtension("WGL_EXT_swap_control", extStart, extEnd); - if (glewExperimental || WGLEW_EXT_swap_control|| crippled) WGLEW_EXT_swap_control= !_glewInit_WGL_EXT_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_EXT_swap_control */ -#ifdef WGL_EXT_swap_control_tear - WGLEW_EXT_swap_control_tear = _glewSearchExtension("WGL_EXT_swap_control_tear", extStart, extEnd); -#endif /* WGL_EXT_swap_control_tear */ -#ifdef WGL_I3D_digital_video_control - WGLEW_I3D_digital_video_control = _glewSearchExtension("WGL_I3D_digital_video_control", extStart, extEnd); - if (glewExperimental || WGLEW_I3D_digital_video_control|| crippled) WGLEW_I3D_digital_video_control= !_glewInit_WGL_I3D_digital_video_control(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_I3D_digital_video_control */ -#ifdef WGL_I3D_gamma - WGLEW_I3D_gamma = _glewSearchExtension("WGL_I3D_gamma", extStart, extEnd); - if (glewExperimental || WGLEW_I3D_gamma|| crippled) WGLEW_I3D_gamma= !_glewInit_WGL_I3D_gamma(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_I3D_gamma */ -#ifdef WGL_I3D_genlock - WGLEW_I3D_genlock = _glewSearchExtension("WGL_I3D_genlock", extStart, extEnd); - if (glewExperimental || WGLEW_I3D_genlock|| crippled) WGLEW_I3D_genlock= !_glewInit_WGL_I3D_genlock(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_I3D_genlock */ -#ifdef WGL_I3D_image_buffer - WGLEW_I3D_image_buffer = _glewSearchExtension("WGL_I3D_image_buffer", extStart, extEnd); - if (glewExperimental || WGLEW_I3D_image_buffer|| crippled) WGLEW_I3D_image_buffer= !_glewInit_WGL_I3D_image_buffer(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_I3D_image_buffer */ -#ifdef WGL_I3D_swap_frame_lock - WGLEW_I3D_swap_frame_lock = _glewSearchExtension("WGL_I3D_swap_frame_lock", extStart, extEnd); - if (glewExperimental || WGLEW_I3D_swap_frame_lock|| crippled) WGLEW_I3D_swap_frame_lock= !_glewInit_WGL_I3D_swap_frame_lock(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_I3D_swap_frame_lock */ -#ifdef WGL_I3D_swap_frame_usage - WGLEW_I3D_swap_frame_usage = _glewSearchExtension("WGL_I3D_swap_frame_usage", extStart, extEnd); - if (glewExperimental || WGLEW_I3D_swap_frame_usage|| crippled) WGLEW_I3D_swap_frame_usage= !_glewInit_WGL_I3D_swap_frame_usage(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_I3D_swap_frame_usage */ -#ifdef WGL_NV_DX_interop - WGLEW_NV_DX_interop = _glewSearchExtension("WGL_NV_DX_interop", extStart, extEnd); - if (glewExperimental || WGLEW_NV_DX_interop|| crippled) WGLEW_NV_DX_interop= !_glewInit_WGL_NV_DX_interop(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_NV_DX_interop */ -#ifdef WGL_NV_DX_interop2 - WGLEW_NV_DX_interop2 = _glewSearchExtension("WGL_NV_DX_interop2", extStart, extEnd); -#endif /* WGL_NV_DX_interop2 */ -#ifdef WGL_NV_copy_image - WGLEW_NV_copy_image = _glewSearchExtension("WGL_NV_copy_image", extStart, extEnd); - if (glewExperimental || WGLEW_NV_copy_image|| crippled) WGLEW_NV_copy_image= !_glewInit_WGL_NV_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_NV_copy_image */ -#ifdef WGL_NV_delay_before_swap - WGLEW_NV_delay_before_swap = _glewSearchExtension("WGL_NV_delay_before_swap", extStart, extEnd); - if (glewExperimental || WGLEW_NV_delay_before_swap|| crippled) WGLEW_NV_delay_before_swap= !_glewInit_WGL_NV_delay_before_swap(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_NV_delay_before_swap */ -#ifdef WGL_NV_float_buffer - WGLEW_NV_float_buffer = _glewSearchExtension("WGL_NV_float_buffer", extStart, extEnd); -#endif /* WGL_NV_float_buffer */ -#ifdef WGL_NV_gpu_affinity - WGLEW_NV_gpu_affinity = _glewSearchExtension("WGL_NV_gpu_affinity", extStart, extEnd); - if (glewExperimental || WGLEW_NV_gpu_affinity|| crippled) WGLEW_NV_gpu_affinity= !_glewInit_WGL_NV_gpu_affinity(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_NV_gpu_affinity */ -#ifdef WGL_NV_multisample_coverage - WGLEW_NV_multisample_coverage = _glewSearchExtension("WGL_NV_multisample_coverage", extStart, extEnd); -#endif /* WGL_NV_multisample_coverage */ -#ifdef WGL_NV_present_video - WGLEW_NV_present_video = _glewSearchExtension("WGL_NV_present_video", extStart, extEnd); - if (glewExperimental || WGLEW_NV_present_video|| crippled) WGLEW_NV_present_video= !_glewInit_WGL_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_NV_present_video */ -#ifdef WGL_NV_render_depth_texture - WGLEW_NV_render_depth_texture = _glewSearchExtension("WGL_NV_render_depth_texture", extStart, extEnd); -#endif /* WGL_NV_render_depth_texture */ -#ifdef WGL_NV_render_texture_rectangle - WGLEW_NV_render_texture_rectangle = _glewSearchExtension("WGL_NV_render_texture_rectangle", extStart, extEnd); -#endif /* WGL_NV_render_texture_rectangle */ -#ifdef WGL_NV_swap_group - WGLEW_NV_swap_group = _glewSearchExtension("WGL_NV_swap_group", extStart, extEnd); - if (glewExperimental || WGLEW_NV_swap_group|| crippled) WGLEW_NV_swap_group= !_glewInit_WGL_NV_swap_group(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_NV_swap_group */ -#ifdef WGL_NV_vertex_array_range - WGLEW_NV_vertex_array_range = _glewSearchExtension("WGL_NV_vertex_array_range", extStart, extEnd); - if (glewExperimental || WGLEW_NV_vertex_array_range|| crippled) WGLEW_NV_vertex_array_range= !_glewInit_WGL_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_NV_vertex_array_range */ -#ifdef WGL_NV_video_capture - WGLEW_NV_video_capture = _glewSearchExtension("WGL_NV_video_capture", extStart, extEnd); - if (glewExperimental || WGLEW_NV_video_capture|| crippled) WGLEW_NV_video_capture= !_glewInit_WGL_NV_video_capture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_NV_video_capture */ -#ifdef WGL_NV_video_output - WGLEW_NV_video_output = _glewSearchExtension("WGL_NV_video_output", extStart, extEnd); - if (glewExperimental || WGLEW_NV_video_output|| crippled) WGLEW_NV_video_output= !_glewInit_WGL_NV_video_output(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_NV_video_output */ -#ifdef WGL_OML_sync_control - WGLEW_OML_sync_control = _glewSearchExtension("WGL_OML_sync_control", extStart, extEnd); - if (glewExperimental || WGLEW_OML_sync_control|| crippled) WGLEW_OML_sync_control= !_glewInit_WGL_OML_sync_control(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* WGL_OML_sync_control */ - - return GLEW_OK; -} - -#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) - -PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay = NULL; - -PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig = NULL; -PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext = NULL; -PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer = NULL; -PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap = NULL; -PFNGLXCREATEWINDOWPROC __glewXCreateWindow = NULL; -PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer = NULL; -PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap = NULL; -PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow = NULL; -PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable = NULL; -PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib = NULL; -PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs = NULL; -PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent = NULL; -PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig = NULL; -PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent = NULL; -PFNGLXQUERYCONTEXTPROC __glewXQueryContext = NULL; -PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable = NULL; -PFNGLXSELECTEVENTPROC __glewXSelectEvent = NULL; - -PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC __glewXBlitContextFramebufferAMD = NULL; -PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC __glewXCreateAssociatedContextAMD = NULL; -PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __glewXCreateAssociatedContextAttribsAMD = NULL; -PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC __glewXDeleteAssociatedContextAMD = NULL; -PFNGLXGETCONTEXTGPUIDAMDPROC __glewXGetContextGPUIDAMD = NULL; -PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC __glewXGetCurrentAssociatedContextAMD = NULL; -PFNGLXGETGPUIDSAMDPROC __glewXGetGPUIDsAMD = NULL; -PFNGLXGETGPUINFOAMDPROC __glewXGetGPUInfoAMD = NULL; -PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __glewXMakeAssociatedContextCurrentAMD = NULL; - -PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB = NULL; - -PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI = NULL; -PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI = NULL; -PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI = NULL; - -PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT = NULL; -PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT = NULL; -PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT = NULL; -PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT = NULL; - -PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT = NULL; - -PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT = NULL; -PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT = NULL; - -PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA = NULL; - -PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA = NULL; - -PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA = NULL; - -PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC __glewXQueryCurrentRendererIntegerMESA = NULL; -PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC __glewXQueryCurrentRendererStringMESA = NULL; -PFNGLXQUERYRENDERERINTEGERMESAPROC __glewXQueryRendererIntegerMESA = NULL; -PFNGLXQUERYRENDERERSTRINGMESAPROC __glewXQueryRendererStringMESA = NULL; - -PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA = NULL; - -PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA = NULL; - -PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA = NULL; -PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA = NULL; - -PFNGLXCOPYBUFFERSUBDATANVPROC __glewXCopyBufferSubDataNV = NULL; -PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC __glewXNamedCopyBufferSubDataNV = NULL; - -PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV = NULL; - -PFNGLXDELAYBEFORESWAPNVPROC __glewXDelayBeforeSwapNV = NULL; - -PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV = NULL; -PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV = NULL; - -PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV = NULL; -PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV = NULL; -PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV = NULL; -PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV = NULL; -PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV = NULL; -PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV = NULL; - -PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV = NULL; -PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV = NULL; - -PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV = NULL; -PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV = NULL; -PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV = NULL; -PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV = NULL; -PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV = NULL; - -PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV = NULL; -PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV = NULL; -PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV = NULL; -PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV = NULL; -PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV = NULL; -PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV = NULL; - -PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML = NULL; -PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML = NULL; -PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML = NULL; -PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML = NULL; -PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML = NULL; - -PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX = NULL; -PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX = NULL; -PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX = NULL; -PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX = NULL; -PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX = NULL; -PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX = NULL; - -PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX = NULL; -PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX = NULL; -PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX = NULL; -PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX = NULL; -PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX = NULL; -PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX = NULL; -PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX = NULL; -PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX = NULL; - -PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX = NULL; -PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX = NULL; -PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX = NULL; -PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX = NULL; -PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX = NULL; - -PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX = NULL; -PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX = NULL; - -PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX = NULL; - -PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX = NULL; -PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX = NULL; -PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX = NULL; -PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX = NULL; -PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX = NULL; - -PFNGLXCUSHIONSGIPROC __glewXCushionSGI = NULL; - -PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI = NULL; -PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI = NULL; - -PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI = NULL; - -PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI = NULL; -PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI = NULL; - -PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN = NULL; - -PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN = NULL; -PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN = NULL; - -#if !defined(GLEW_MX) - -GLboolean __GLXEW_VERSION_1_0 = GL_FALSE; -GLboolean __GLXEW_VERSION_1_1 = GL_FALSE; -GLboolean __GLXEW_VERSION_1_2 = GL_FALSE; -GLboolean __GLXEW_VERSION_1_3 = GL_FALSE; -GLboolean __GLXEW_VERSION_1_4 = GL_FALSE; -GLboolean __GLXEW_3DFX_multisample = GL_FALSE; -GLboolean __GLXEW_AMD_gpu_association = GL_FALSE; -GLboolean __GLXEW_ARB_context_flush_control = GL_FALSE; -GLboolean __GLXEW_ARB_create_context = GL_FALSE; -GLboolean __GLXEW_ARB_create_context_profile = GL_FALSE; -GLboolean __GLXEW_ARB_create_context_robustness = GL_FALSE; -GLboolean __GLXEW_ARB_fbconfig_float = GL_FALSE; -GLboolean __GLXEW_ARB_framebuffer_sRGB = GL_FALSE; -GLboolean __GLXEW_ARB_get_proc_address = GL_FALSE; -GLboolean __GLXEW_ARB_multisample = GL_FALSE; -GLboolean __GLXEW_ARB_robustness_application_isolation = GL_FALSE; -GLboolean __GLXEW_ARB_robustness_share_group_isolation = GL_FALSE; -GLboolean __GLXEW_ARB_vertex_buffer_object = GL_FALSE; -GLboolean __GLXEW_ATI_pixel_format_float = GL_FALSE; -GLboolean __GLXEW_ATI_render_texture = GL_FALSE; -GLboolean __GLXEW_EXT_buffer_age = GL_FALSE; -GLboolean __GLXEW_EXT_create_context_es2_profile = GL_FALSE; -GLboolean __GLXEW_EXT_create_context_es_profile = GL_FALSE; -GLboolean __GLXEW_EXT_fbconfig_packed_float = GL_FALSE; -GLboolean __GLXEW_EXT_framebuffer_sRGB = GL_FALSE; -GLboolean __GLXEW_EXT_import_context = GL_FALSE; -GLboolean __GLXEW_EXT_scene_marker = GL_FALSE; -GLboolean __GLXEW_EXT_stereo_tree = GL_FALSE; -GLboolean __GLXEW_EXT_swap_control = GL_FALSE; -GLboolean __GLXEW_EXT_swap_control_tear = GL_FALSE; -GLboolean __GLXEW_EXT_texture_from_pixmap = GL_FALSE; -GLboolean __GLXEW_EXT_visual_info = GL_FALSE; -GLboolean __GLXEW_EXT_visual_rating = GL_FALSE; -GLboolean __GLXEW_INTEL_swap_event = GL_FALSE; -GLboolean __GLXEW_MESA_agp_offset = GL_FALSE; -GLboolean __GLXEW_MESA_copy_sub_buffer = GL_FALSE; -GLboolean __GLXEW_MESA_pixmap_colormap = GL_FALSE; -GLboolean __GLXEW_MESA_query_renderer = GL_FALSE; -GLboolean __GLXEW_MESA_release_buffers = GL_FALSE; -GLboolean __GLXEW_MESA_set_3dfx_mode = GL_FALSE; -GLboolean __GLXEW_MESA_swap_control = GL_FALSE; -GLboolean __GLXEW_NV_copy_buffer = GL_FALSE; -GLboolean __GLXEW_NV_copy_image = GL_FALSE; -GLboolean __GLXEW_NV_delay_before_swap = GL_FALSE; -GLboolean __GLXEW_NV_float_buffer = GL_FALSE; -GLboolean __GLXEW_NV_multisample_coverage = GL_FALSE; -GLboolean __GLXEW_NV_present_video = GL_FALSE; -GLboolean __GLXEW_NV_swap_group = GL_FALSE; -GLboolean __GLXEW_NV_vertex_array_range = GL_FALSE; -GLboolean __GLXEW_NV_video_capture = GL_FALSE; -GLboolean __GLXEW_NV_video_out = GL_FALSE; -GLboolean __GLXEW_OML_swap_method = GL_FALSE; -GLboolean __GLXEW_OML_sync_control = GL_FALSE; -GLboolean __GLXEW_SGIS_blended_overlay = GL_FALSE; -GLboolean __GLXEW_SGIS_color_range = GL_FALSE; -GLboolean __GLXEW_SGIS_multisample = GL_FALSE; -GLboolean __GLXEW_SGIS_shared_multisample = GL_FALSE; -GLboolean __GLXEW_SGIX_fbconfig = GL_FALSE; -GLboolean __GLXEW_SGIX_hyperpipe = GL_FALSE; -GLboolean __GLXEW_SGIX_pbuffer = GL_FALSE; -GLboolean __GLXEW_SGIX_swap_barrier = GL_FALSE; -GLboolean __GLXEW_SGIX_swap_group = GL_FALSE; -GLboolean __GLXEW_SGIX_video_resize = GL_FALSE; -GLboolean __GLXEW_SGIX_visual_select_group = GL_FALSE; -GLboolean __GLXEW_SGI_cushion = GL_FALSE; -GLboolean __GLXEW_SGI_make_current_read = GL_FALSE; -GLboolean __GLXEW_SGI_swap_control = GL_FALSE; -GLboolean __GLXEW_SGI_video_sync = GL_FALSE; -GLboolean __GLXEW_SUN_get_transparent_index = GL_FALSE; -GLboolean __GLXEW_SUN_video_resize = GL_FALSE; - -#endif /* !GLEW_MX */ - -#ifdef GLX_VERSION_1_2 - -static GLboolean _glewInit_GLX_VERSION_1_2 (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXGetCurrentDisplay = (PFNGLXGETCURRENTDISPLAYPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentDisplay")) == NULL) || r; - - return r; -} - -#endif /* GLX_VERSION_1_2 */ - -#ifdef GLX_VERSION_1_3 - -static GLboolean _glewInit_GLX_VERSION_1_3 (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXChooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC)glewGetProcAddress((const GLubyte*)"glXChooseFBConfig")) == NULL) || r; - r = ((glXCreateNewContext = (PFNGLXCREATENEWCONTEXTPROC)glewGetProcAddress((const GLubyte*)"glXCreateNewContext")) == NULL) || r; - r = ((glXCreatePbuffer = (PFNGLXCREATEPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glXCreatePbuffer")) == NULL) || r; - r = ((glXCreatePixmap = (PFNGLXCREATEPIXMAPPROC)glewGetProcAddress((const GLubyte*)"glXCreatePixmap")) == NULL) || r; - r = ((glXCreateWindow = (PFNGLXCREATEWINDOWPROC)glewGetProcAddress((const GLubyte*)"glXCreateWindow")) == NULL) || r; - r = ((glXDestroyPbuffer = (PFNGLXDESTROYPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glXDestroyPbuffer")) == NULL) || r; - r = ((glXDestroyPixmap = (PFNGLXDESTROYPIXMAPPROC)glewGetProcAddress((const GLubyte*)"glXDestroyPixmap")) == NULL) || r; - r = ((glXDestroyWindow = (PFNGLXDESTROYWINDOWPROC)glewGetProcAddress((const GLubyte*)"glXDestroyWindow")) == NULL) || r; - r = ((glXGetCurrentReadDrawable = (PFNGLXGETCURRENTREADDRAWABLEPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentReadDrawable")) == NULL) || r; - r = ((glXGetFBConfigAttrib = (PFNGLXGETFBCONFIGATTRIBPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigAttrib")) == NULL) || r; - r = ((glXGetFBConfigs = (PFNGLXGETFBCONFIGSPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigs")) == NULL) || r; - r = ((glXGetSelectedEvent = (PFNGLXGETSELECTEDEVENTPROC)glewGetProcAddress((const GLubyte*)"glXGetSelectedEvent")) == NULL) || r; - r = ((glXGetVisualFromFBConfig = (PFNGLXGETVISUALFROMFBCONFIGPROC)glewGetProcAddress((const GLubyte*)"glXGetVisualFromFBConfig")) == NULL) || r; - r = ((glXMakeContextCurrent = (PFNGLXMAKECONTEXTCURRENTPROC)glewGetProcAddress((const GLubyte*)"glXMakeContextCurrent")) == NULL) || r; - r = ((glXQueryContext = (PFNGLXQUERYCONTEXTPROC)glewGetProcAddress((const GLubyte*)"glXQueryContext")) == NULL) || r; - r = ((glXQueryDrawable = (PFNGLXQUERYDRAWABLEPROC)glewGetProcAddress((const GLubyte*)"glXQueryDrawable")) == NULL) || r; - r = ((glXSelectEvent = (PFNGLXSELECTEVENTPROC)glewGetProcAddress((const GLubyte*)"glXSelectEvent")) == NULL) || r; - - return r; -} - -#endif /* GLX_VERSION_1_3 */ - -#ifdef GLX_AMD_gpu_association - -static GLboolean _glewInit_GLX_AMD_gpu_association (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXBlitContextFramebufferAMD = (PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC)glewGetProcAddress((const GLubyte*)"glXBlitContextFramebufferAMD")) == NULL) || r; - r = ((glXCreateAssociatedContextAMD = (PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"glXCreateAssociatedContextAMD")) == NULL) || r; - r = ((glXCreateAssociatedContextAttribsAMD = (PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC)glewGetProcAddress((const GLubyte*)"glXCreateAssociatedContextAttribsAMD")) == NULL) || r; - r = ((glXDeleteAssociatedContextAMD = (PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"glXDeleteAssociatedContextAMD")) == NULL) || r; - r = ((glXGetContextGPUIDAMD = (PFNGLXGETCONTEXTGPUIDAMDPROC)glewGetProcAddress((const GLubyte*)"glXGetContextGPUIDAMD")) == NULL) || r; - r = ((glXGetCurrentAssociatedContextAMD = (PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentAssociatedContextAMD")) == NULL) || r; - r = ((glXGetGPUIDsAMD = (PFNGLXGETGPUIDSAMDPROC)glewGetProcAddress((const GLubyte*)"glXGetGPUIDsAMD")) == NULL) || r; - r = ((glXGetGPUInfoAMD = (PFNGLXGETGPUINFOAMDPROC)glewGetProcAddress((const GLubyte*)"glXGetGPUInfoAMD")) == NULL) || r; - r = ((glXMakeAssociatedContextCurrentAMD = (PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC)glewGetProcAddress((const GLubyte*)"glXMakeAssociatedContextCurrentAMD")) == NULL) || r; - - return r; -} - -#endif /* GLX_AMD_gpu_association */ - -#ifdef GLX_ARB_create_context - -static GLboolean _glewInit_GLX_ARB_create_context (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)glewGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB")) == NULL) || r; - - return r; -} - -#endif /* GLX_ARB_create_context */ - -#ifdef GLX_ATI_render_texture - -static GLboolean _glewInit_GLX_ATI_render_texture (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXBindTexImageATI = (PFNGLXBINDTEXIMAGEATIPROC)glewGetProcAddress((const GLubyte*)"glXBindTexImageATI")) == NULL) || r; - r = ((glXDrawableAttribATI = (PFNGLXDRAWABLEATTRIBATIPROC)glewGetProcAddress((const GLubyte*)"glXDrawableAttribATI")) == NULL) || r; - r = ((glXReleaseTexImageATI = (PFNGLXRELEASETEXIMAGEATIPROC)glewGetProcAddress((const GLubyte*)"glXReleaseTexImageATI")) == NULL) || r; - - return r; -} - -#endif /* GLX_ATI_render_texture */ - -#ifdef GLX_EXT_import_context - -static GLboolean _glewInit_GLX_EXT_import_context (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXFreeContextEXT = (PFNGLXFREECONTEXTEXTPROC)glewGetProcAddress((const GLubyte*)"glXFreeContextEXT")) == NULL) || r; - r = ((glXGetContextIDEXT = (PFNGLXGETCONTEXTIDEXTPROC)glewGetProcAddress((const GLubyte*)"glXGetContextIDEXT")) == NULL) || r; - r = ((glXImportContextEXT = (PFNGLXIMPORTCONTEXTEXTPROC)glewGetProcAddress((const GLubyte*)"glXImportContextEXT")) == NULL) || r; - r = ((glXQueryContextInfoEXT = (PFNGLXQUERYCONTEXTINFOEXTPROC)glewGetProcAddress((const GLubyte*)"glXQueryContextInfoEXT")) == NULL) || r; - - return r; -} - -#endif /* GLX_EXT_import_context */ - -#ifdef GLX_EXT_swap_control - -static GLboolean _glewInit_GLX_EXT_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXSwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalEXT")) == NULL) || r; - - return r; -} - -#endif /* GLX_EXT_swap_control */ - -#ifdef GLX_EXT_texture_from_pixmap - -static GLboolean _glewInit_GLX_EXT_texture_from_pixmap (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXBindTexImageEXT = (PFNGLXBINDTEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glXBindTexImageEXT")) == NULL) || r; - r = ((glXReleaseTexImageEXT = (PFNGLXRELEASETEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glXReleaseTexImageEXT")) == NULL) || r; - - return r; -} - -#endif /* GLX_EXT_texture_from_pixmap */ - -#ifdef GLX_MESA_agp_offset - -static GLboolean _glewInit_GLX_MESA_agp_offset (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXGetAGPOffsetMESA = (PFNGLXGETAGPOFFSETMESAPROC)glewGetProcAddress((const GLubyte*)"glXGetAGPOffsetMESA")) == NULL) || r; - - return r; -} - -#endif /* GLX_MESA_agp_offset */ - -#ifdef GLX_MESA_copy_sub_buffer - -static GLboolean _glewInit_GLX_MESA_copy_sub_buffer (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXCopySubBufferMESA = (PFNGLXCOPYSUBBUFFERMESAPROC)glewGetProcAddress((const GLubyte*)"glXCopySubBufferMESA")) == NULL) || r; - - return r; -} - -#endif /* GLX_MESA_copy_sub_buffer */ - -#ifdef GLX_MESA_pixmap_colormap - -static GLboolean _glewInit_GLX_MESA_pixmap_colormap (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXCreateGLXPixmapMESA = (PFNGLXCREATEGLXPIXMAPMESAPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPixmapMESA")) == NULL) || r; - - return r; -} - -#endif /* GLX_MESA_pixmap_colormap */ - -#ifdef GLX_MESA_query_renderer - -static GLboolean _glewInit_GLX_MESA_query_renderer (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXQueryCurrentRendererIntegerMESA = (PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC)glewGetProcAddress((const GLubyte*)"glXQueryCurrentRendererIntegerMESA")) == NULL) || r; - r = ((glXQueryCurrentRendererStringMESA = (PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC)glewGetProcAddress((const GLubyte*)"glXQueryCurrentRendererStringMESA")) == NULL) || r; - r = ((glXQueryRendererIntegerMESA = (PFNGLXQUERYRENDERERINTEGERMESAPROC)glewGetProcAddress((const GLubyte*)"glXQueryRendererIntegerMESA")) == NULL) || r; - r = ((glXQueryRendererStringMESA = (PFNGLXQUERYRENDERERSTRINGMESAPROC)glewGetProcAddress((const GLubyte*)"glXQueryRendererStringMESA")) == NULL) || r; - - return r; -} - -#endif /* GLX_MESA_query_renderer */ - -#ifdef GLX_MESA_release_buffers - -static GLboolean _glewInit_GLX_MESA_release_buffers (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXReleaseBuffersMESA = (PFNGLXRELEASEBUFFERSMESAPROC)glewGetProcAddress((const GLubyte*)"glXReleaseBuffersMESA")) == NULL) || r; - - return r; -} - -#endif /* GLX_MESA_release_buffers */ - -#ifdef GLX_MESA_set_3dfx_mode - -static GLboolean _glewInit_GLX_MESA_set_3dfx_mode (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXSet3DfxModeMESA = (PFNGLXSET3DFXMODEMESAPROC)glewGetProcAddress((const GLubyte*)"glXSet3DfxModeMESA")) == NULL) || r; - - return r; -} - -#endif /* GLX_MESA_set_3dfx_mode */ - -#ifdef GLX_MESA_swap_control - -static GLboolean _glewInit_GLX_MESA_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXGetSwapIntervalMESA = (PFNGLXGETSWAPINTERVALMESAPROC)glewGetProcAddress((const GLubyte*)"glXGetSwapIntervalMESA")) == NULL) || r; - r = ((glXSwapIntervalMESA = (PFNGLXSWAPINTERVALMESAPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalMESA")) == NULL) || r; - - return r; -} - -#endif /* GLX_MESA_swap_control */ - -#ifdef GLX_NV_copy_buffer - -static GLboolean _glewInit_GLX_NV_copy_buffer (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXCopyBufferSubDataNV = (PFNGLXCOPYBUFFERSUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glXCopyBufferSubDataNV")) == NULL) || r; - r = ((glXNamedCopyBufferSubDataNV = (PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glXNamedCopyBufferSubDataNV")) == NULL) || r; - - return r; -} - -#endif /* GLX_NV_copy_buffer */ - -#ifdef GLX_NV_copy_image - -static GLboolean _glewInit_GLX_NV_copy_image (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXCopyImageSubDataNV = (PFNGLXCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glXCopyImageSubDataNV")) == NULL) || r; - - return r; -} - -#endif /* GLX_NV_copy_image */ - -#ifdef GLX_NV_delay_before_swap - -static GLboolean _glewInit_GLX_NV_delay_before_swap (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXDelayBeforeSwapNV = (PFNGLXDELAYBEFORESWAPNVPROC)glewGetProcAddress((const GLubyte*)"glXDelayBeforeSwapNV")) == NULL) || r; - - return r; -} - -#endif /* GLX_NV_delay_before_swap */ - -#ifdef GLX_NV_present_video - -static GLboolean _glewInit_GLX_NV_present_video (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXBindVideoDeviceNV = (PFNGLXBINDVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoDeviceNV")) == NULL) || r; - r = ((glXEnumerateVideoDevicesNV = (PFNGLXENUMERATEVIDEODEVICESNVPROC)glewGetProcAddress((const GLubyte*)"glXEnumerateVideoDevicesNV")) == NULL) || r; - - return r; -} - -#endif /* GLX_NV_present_video */ - -#ifdef GLX_NV_swap_group - -static GLboolean _glewInit_GLX_NV_swap_group (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXBindSwapBarrierNV = (PFNGLXBINDSWAPBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glXBindSwapBarrierNV")) == NULL) || r; - r = ((glXJoinSwapGroupNV = (PFNGLXJOINSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"glXJoinSwapGroupNV")) == NULL) || r; - r = ((glXQueryFrameCountNV = (PFNGLXQUERYFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glXQueryFrameCountNV")) == NULL) || r; - r = ((glXQueryMaxSwapGroupsNV = (PFNGLXQUERYMAXSWAPGROUPSNVPROC)glewGetProcAddress((const GLubyte*)"glXQueryMaxSwapGroupsNV")) == NULL) || r; - r = ((glXQuerySwapGroupNV = (PFNGLXQUERYSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"glXQuerySwapGroupNV")) == NULL) || r; - r = ((glXResetFrameCountNV = (PFNGLXRESETFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glXResetFrameCountNV")) == NULL) || r; - - return r; -} - -#endif /* GLX_NV_swap_group */ - -#ifdef GLX_NV_vertex_array_range - -static GLboolean _glewInit_GLX_NV_vertex_array_range (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXAllocateMemoryNV = (PFNGLXALLOCATEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"glXAllocateMemoryNV")) == NULL) || r; - r = ((glXFreeMemoryNV = (PFNGLXFREEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"glXFreeMemoryNV")) == NULL) || r; - - return r; -} - -#endif /* GLX_NV_vertex_array_range */ - -#ifdef GLX_NV_video_capture - -static GLboolean _glewInit_GLX_NV_video_capture (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXBindVideoCaptureDeviceNV = (PFNGLXBINDVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoCaptureDeviceNV")) == NULL) || r; - r = ((glXEnumerateVideoCaptureDevicesNV = (PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"glXEnumerateVideoCaptureDevicesNV")) == NULL) || r; - r = ((glXLockVideoCaptureDeviceNV = (PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXLockVideoCaptureDeviceNV")) == NULL) || r; - r = ((glXQueryVideoCaptureDeviceNV = (PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXQueryVideoCaptureDeviceNV")) == NULL) || r; - r = ((glXReleaseVideoCaptureDeviceNV = (PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoCaptureDeviceNV")) == NULL) || r; - - return r; -} - -#endif /* GLX_NV_video_capture */ - -#ifdef GLX_NV_video_out - -static GLboolean _glewInit_GLX_NV_video_out (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXBindVideoImageNV = (PFNGLXBINDVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoImageNV")) == NULL) || r; - r = ((glXGetVideoDeviceNV = (PFNGLXGETVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoDeviceNV")) == NULL) || r; - r = ((glXGetVideoInfoNV = (PFNGLXGETVIDEOINFONVPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoInfoNV")) == NULL) || r; - r = ((glXReleaseVideoDeviceNV = (PFNGLXRELEASEVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoDeviceNV")) == NULL) || r; - r = ((glXReleaseVideoImageNV = (PFNGLXRELEASEVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoImageNV")) == NULL) || r; - r = ((glXSendPbufferToVideoNV = (PFNGLXSENDPBUFFERTOVIDEONVPROC)glewGetProcAddress((const GLubyte*)"glXSendPbufferToVideoNV")) == NULL) || r; - - return r; -} - -#endif /* GLX_NV_video_out */ - -#ifdef GLX_OML_sync_control - -static GLboolean _glewInit_GLX_OML_sync_control (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXGetMscRateOML = (PFNGLXGETMSCRATEOMLPROC)glewGetProcAddress((const GLubyte*)"glXGetMscRateOML")) == NULL) || r; - r = ((glXGetSyncValuesOML = (PFNGLXGETSYNCVALUESOMLPROC)glewGetProcAddress((const GLubyte*)"glXGetSyncValuesOML")) == NULL) || r; - r = ((glXSwapBuffersMscOML = (PFNGLXSWAPBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"glXSwapBuffersMscOML")) == NULL) || r; - r = ((glXWaitForMscOML = (PFNGLXWAITFORMSCOMLPROC)glewGetProcAddress((const GLubyte*)"glXWaitForMscOML")) == NULL) || r; - r = ((glXWaitForSbcOML = (PFNGLXWAITFORSBCOMLPROC)glewGetProcAddress((const GLubyte*)"glXWaitForSbcOML")) == NULL) || r; - - return r; -} - -#endif /* GLX_OML_sync_control */ - -#ifdef GLX_SGIX_fbconfig - -static GLboolean _glewInit_GLX_SGIX_fbconfig (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXChooseFBConfigSGIX = (PFNGLXCHOOSEFBCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChooseFBConfigSGIX")) == NULL) || r; - r = ((glXCreateContextWithConfigSGIX = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateContextWithConfigSGIX")) == NULL) || r; - r = ((glXCreateGLXPixmapWithConfigSGIX = (PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPixmapWithConfigSGIX")) == NULL) || r; - r = ((glXGetFBConfigAttribSGIX = (PFNGLXGETFBCONFIGATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigAttribSGIX")) == NULL) || r; - r = ((glXGetFBConfigFromVisualSGIX = (PFNGLXGETFBCONFIGFROMVISUALSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigFromVisualSGIX")) == NULL) || r; - r = ((glXGetVisualFromFBConfigSGIX = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetVisualFromFBConfigSGIX")) == NULL) || r; - - return r; -} - -#endif /* GLX_SGIX_fbconfig */ - -#ifdef GLX_SGIX_hyperpipe - -static GLboolean _glewInit_GLX_SGIX_hyperpipe (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXBindHyperpipeSGIX = (PFNGLXBINDHYPERPIPESGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindHyperpipeSGIX")) == NULL) || r; - r = ((glXDestroyHyperpipeConfigSGIX = (PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXDestroyHyperpipeConfigSGIX")) == NULL) || r; - r = ((glXHyperpipeAttribSGIX = (PFNGLXHYPERPIPEATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXHyperpipeAttribSGIX")) == NULL) || r; - r = ((glXHyperpipeConfigSGIX = (PFNGLXHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXHyperpipeConfigSGIX")) == NULL) || r; - r = ((glXQueryHyperpipeAttribSGIX = (PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeAttribSGIX")) == NULL) || r; - r = ((glXQueryHyperpipeBestAttribSGIX = (PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeBestAttribSGIX")) == NULL) || r; - r = ((glXQueryHyperpipeConfigSGIX = (PFNGLXQUERYHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeConfigSGIX")) == NULL) || r; - r = ((glXQueryHyperpipeNetworkSGIX = (PFNGLXQUERYHYPERPIPENETWORKSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeNetworkSGIX")) == NULL) || r; - - return r; -} - -#endif /* GLX_SGIX_hyperpipe */ - -#ifdef GLX_SGIX_pbuffer - -static GLboolean _glewInit_GLX_SGIX_pbuffer (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXCreateGLXPbufferSGIX = (PFNGLXCREATEGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPbufferSGIX")) == NULL) || r; - r = ((glXDestroyGLXPbufferSGIX = (PFNGLXDESTROYGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXDestroyGLXPbufferSGIX")) == NULL) || r; - r = ((glXGetSelectedEventSGIX = (PFNGLXGETSELECTEDEVENTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetSelectedEventSGIX")) == NULL) || r; - r = ((glXQueryGLXPbufferSGIX = (PFNGLXQUERYGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryGLXPbufferSGIX")) == NULL) || r; - r = ((glXSelectEventSGIX = (PFNGLXSELECTEVENTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXSelectEventSGIX")) == NULL) || r; - - return r; -} - -#endif /* GLX_SGIX_pbuffer */ - -#ifdef GLX_SGIX_swap_barrier - -static GLboolean _glewInit_GLX_SGIX_swap_barrier (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXBindSwapBarrierSGIX = (PFNGLXBINDSWAPBARRIERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindSwapBarrierSGIX")) == NULL) || r; - r = ((glXQueryMaxSwapBarriersSGIX = (PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryMaxSwapBarriersSGIX")) == NULL) || r; - - return r; -} - -#endif /* GLX_SGIX_swap_barrier */ - -#ifdef GLX_SGIX_swap_group - -static GLboolean _glewInit_GLX_SGIX_swap_group (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXJoinSwapGroupSGIX = (PFNGLXJOINSWAPGROUPSGIXPROC)glewGetProcAddress((const GLubyte*)"glXJoinSwapGroupSGIX")) == NULL) || r; - - return r; -} - -#endif /* GLX_SGIX_swap_group */ - -#ifdef GLX_SGIX_video_resize - -static GLboolean _glewInit_GLX_SGIX_video_resize (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXBindChannelToWindowSGIX = (PFNGLXBINDCHANNELTOWINDOWSGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindChannelToWindowSGIX")) == NULL) || r; - r = ((glXChannelRectSGIX = (PFNGLXCHANNELRECTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChannelRectSGIX")) == NULL) || r; - r = ((glXChannelRectSyncSGIX = (PFNGLXCHANNELRECTSYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChannelRectSyncSGIX")) == NULL) || r; - r = ((glXQueryChannelDeltasSGIX = (PFNGLXQUERYCHANNELDELTASSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryChannelDeltasSGIX")) == NULL) || r; - r = ((glXQueryChannelRectSGIX = (PFNGLXQUERYCHANNELRECTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryChannelRectSGIX")) == NULL) || r; - - return r; -} - -#endif /* GLX_SGIX_video_resize */ - -#ifdef GLX_SGI_cushion - -static GLboolean _glewInit_GLX_SGI_cushion (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXCushionSGI = (PFNGLXCUSHIONSGIPROC)glewGetProcAddress((const GLubyte*)"glXCushionSGI")) == NULL) || r; - - return r; -} - -#endif /* GLX_SGI_cushion */ - -#ifdef GLX_SGI_make_current_read - -static GLboolean _glewInit_GLX_SGI_make_current_read (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXGetCurrentReadDrawableSGI = (PFNGLXGETCURRENTREADDRAWABLESGIPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentReadDrawableSGI")) == NULL) || r; - r = ((glXMakeCurrentReadSGI = (PFNGLXMAKECURRENTREADSGIPROC)glewGetProcAddress((const GLubyte*)"glXMakeCurrentReadSGI")) == NULL) || r; - - return r; -} - -#endif /* GLX_SGI_make_current_read */ - -#ifdef GLX_SGI_swap_control - -static GLboolean _glewInit_GLX_SGI_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalSGI")) == NULL) || r; - - return r; -} - -#endif /* GLX_SGI_swap_control */ - -#ifdef GLX_SGI_video_sync - -static GLboolean _glewInit_GLX_SGI_video_sync (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXGetVideoSyncSGI = (PFNGLXGETVIDEOSYNCSGIPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoSyncSGI")) == NULL) || r; - r = ((glXWaitVideoSyncSGI = (PFNGLXWAITVIDEOSYNCSGIPROC)glewGetProcAddress((const GLubyte*)"glXWaitVideoSyncSGI")) == NULL) || r; - - return r; -} - -#endif /* GLX_SGI_video_sync */ - -#ifdef GLX_SUN_get_transparent_index - -static GLboolean _glewInit_GLX_SUN_get_transparent_index (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXGetTransparentIndexSUN = (PFNGLXGETTRANSPARENTINDEXSUNPROC)glewGetProcAddress((const GLubyte*)"glXGetTransparentIndexSUN")) == NULL) || r; - - return r; -} - -#endif /* GLX_SUN_get_transparent_index */ - -#ifdef GLX_SUN_video_resize - -static GLboolean _glewInit_GLX_SUN_video_resize (GLXEW_CONTEXT_ARG_DEF_INIT) -{ - GLboolean r = GL_FALSE; - - r = ((glXGetVideoResizeSUN = (PFNGLXGETVIDEORESIZESUNPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoResizeSUN")) == NULL) || r; - r = ((glXVideoResizeSUN = (PFNGLXVIDEORESIZESUNPROC)glewGetProcAddress((const GLubyte*)"glXVideoResizeSUN")) == NULL) || r; - - return r; -} - -#endif /* GLX_SUN_video_resize */ - -/* ------------------------------------------------------------------------ */ - -GLboolean glxewGetExtension (const char* name) -{ - const GLubyte* start; - const GLubyte* end; - - if (glXGetCurrentDisplay == NULL) return GL_FALSE; - start = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); - if (0 == start) return GL_FALSE; - end = start + _glewStrLen(start); - return _glewSearchExtension(name, start, end); -} - -#ifdef GLEW_MX -GLenum glxewContextInit (GLXEW_CONTEXT_ARG_DEF_LIST) -#else -GLenum glxewInit (GLXEW_CONTEXT_ARG_DEF_LIST) -#endif -{ - int major, minor; - const GLubyte* extStart; - const GLubyte* extEnd; - /* initialize core GLX 1.2 */ - if (_glewInit_GLX_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT)) return GLEW_ERROR_GLX_VERSION_11_ONLY; - /* initialize flags */ - GLXEW_VERSION_1_0 = GL_TRUE; - GLXEW_VERSION_1_1 = GL_TRUE; - GLXEW_VERSION_1_2 = GL_TRUE; - GLXEW_VERSION_1_3 = GL_TRUE; - GLXEW_VERSION_1_4 = GL_TRUE; - /* query GLX version */ - glXQueryVersion(glXGetCurrentDisplay(), &major, &minor); - if (major == 1 && minor <= 3) - { - switch (minor) - { - case 3: - GLXEW_VERSION_1_4 = GL_FALSE; - break; - case 2: - GLXEW_VERSION_1_4 = GL_FALSE; - GLXEW_VERSION_1_3 = GL_FALSE; - break; - default: - return GLEW_ERROR_GLX_VERSION_11_ONLY; - break; - } - } - /* query GLX extension string */ - extStart = 0; - if (glXGetCurrentDisplay != NULL) - extStart = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); - if (extStart == 0) - extStart = (const GLubyte *)""; - extEnd = extStart + _glewStrLen(extStart); - /* initialize extensions */ -#ifdef GLX_VERSION_1_3 - if (glewExperimental || GLXEW_VERSION_1_3) GLXEW_VERSION_1_3 = !_glewInit_GLX_VERSION_1_3(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_VERSION_1_3 */ -#ifdef GLX_3DFX_multisample - GLXEW_3DFX_multisample = _glewSearchExtension("GLX_3DFX_multisample", extStart, extEnd); -#endif /* GLX_3DFX_multisample */ -#ifdef GLX_AMD_gpu_association - GLXEW_AMD_gpu_association = _glewSearchExtension("GLX_AMD_gpu_association", extStart, extEnd); - if (glewExperimental || GLXEW_AMD_gpu_association) GLXEW_AMD_gpu_association = !_glewInit_GLX_AMD_gpu_association(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_AMD_gpu_association */ -#ifdef GLX_ARB_context_flush_control - GLXEW_ARB_context_flush_control = _glewSearchExtension("GLX_ARB_context_flush_control", extStart, extEnd); -#endif /* GLX_ARB_context_flush_control */ -#ifdef GLX_ARB_create_context - GLXEW_ARB_create_context = _glewSearchExtension("GLX_ARB_create_context", extStart, extEnd); - if (glewExperimental || GLXEW_ARB_create_context) GLXEW_ARB_create_context = !_glewInit_GLX_ARB_create_context(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_ARB_create_context */ -#ifdef GLX_ARB_create_context_profile - GLXEW_ARB_create_context_profile = _glewSearchExtension("GLX_ARB_create_context_profile", extStart, extEnd); -#endif /* GLX_ARB_create_context_profile */ -#ifdef GLX_ARB_create_context_robustness - GLXEW_ARB_create_context_robustness = _glewSearchExtension("GLX_ARB_create_context_robustness", extStart, extEnd); -#endif /* GLX_ARB_create_context_robustness */ -#ifdef GLX_ARB_fbconfig_float - GLXEW_ARB_fbconfig_float = _glewSearchExtension("GLX_ARB_fbconfig_float", extStart, extEnd); -#endif /* GLX_ARB_fbconfig_float */ -#ifdef GLX_ARB_framebuffer_sRGB - GLXEW_ARB_framebuffer_sRGB = _glewSearchExtension("GLX_ARB_framebuffer_sRGB", extStart, extEnd); -#endif /* GLX_ARB_framebuffer_sRGB */ -#ifdef GLX_ARB_get_proc_address - GLXEW_ARB_get_proc_address = _glewSearchExtension("GLX_ARB_get_proc_address", extStart, extEnd); -#endif /* GLX_ARB_get_proc_address */ -#ifdef GLX_ARB_multisample - GLXEW_ARB_multisample = _glewSearchExtension("GLX_ARB_multisample", extStart, extEnd); -#endif /* GLX_ARB_multisample */ -#ifdef GLX_ARB_robustness_application_isolation - GLXEW_ARB_robustness_application_isolation = _glewSearchExtension("GLX_ARB_robustness_application_isolation", extStart, extEnd); -#endif /* GLX_ARB_robustness_application_isolation */ -#ifdef GLX_ARB_robustness_share_group_isolation - GLXEW_ARB_robustness_share_group_isolation = _glewSearchExtension("GLX_ARB_robustness_share_group_isolation", extStart, extEnd); -#endif /* GLX_ARB_robustness_share_group_isolation */ -#ifdef GLX_ARB_vertex_buffer_object - GLXEW_ARB_vertex_buffer_object = _glewSearchExtension("GLX_ARB_vertex_buffer_object", extStart, extEnd); -#endif /* GLX_ARB_vertex_buffer_object */ -#ifdef GLX_ATI_pixel_format_float - GLXEW_ATI_pixel_format_float = _glewSearchExtension("GLX_ATI_pixel_format_float", extStart, extEnd); -#endif /* GLX_ATI_pixel_format_float */ -#ifdef GLX_ATI_render_texture - GLXEW_ATI_render_texture = _glewSearchExtension("GLX_ATI_render_texture", extStart, extEnd); - if (glewExperimental || GLXEW_ATI_render_texture) GLXEW_ATI_render_texture = !_glewInit_GLX_ATI_render_texture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_ATI_render_texture */ -#ifdef GLX_EXT_buffer_age - GLXEW_EXT_buffer_age = _glewSearchExtension("GLX_EXT_buffer_age", extStart, extEnd); -#endif /* GLX_EXT_buffer_age */ -#ifdef GLX_EXT_create_context_es2_profile - GLXEW_EXT_create_context_es2_profile = _glewSearchExtension("GLX_EXT_create_context_es2_profile", extStart, extEnd); -#endif /* GLX_EXT_create_context_es2_profile */ -#ifdef GLX_EXT_create_context_es_profile - GLXEW_EXT_create_context_es_profile = _glewSearchExtension("GLX_EXT_create_context_es_profile", extStart, extEnd); -#endif /* GLX_EXT_create_context_es_profile */ -#ifdef GLX_EXT_fbconfig_packed_float - GLXEW_EXT_fbconfig_packed_float = _glewSearchExtension("GLX_EXT_fbconfig_packed_float", extStart, extEnd); -#endif /* GLX_EXT_fbconfig_packed_float */ -#ifdef GLX_EXT_framebuffer_sRGB - GLXEW_EXT_framebuffer_sRGB = _glewSearchExtension("GLX_EXT_framebuffer_sRGB", extStart, extEnd); -#endif /* GLX_EXT_framebuffer_sRGB */ -#ifdef GLX_EXT_import_context - GLXEW_EXT_import_context = _glewSearchExtension("GLX_EXT_import_context", extStart, extEnd); - if (glewExperimental || GLXEW_EXT_import_context) GLXEW_EXT_import_context = !_glewInit_GLX_EXT_import_context(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_EXT_import_context */ -#ifdef GLX_EXT_scene_marker - GLXEW_EXT_scene_marker = _glewSearchExtension("GLX_EXT_scene_marker", extStart, extEnd); -#endif /* GLX_EXT_scene_marker */ -#ifdef GLX_EXT_stereo_tree - GLXEW_EXT_stereo_tree = _glewSearchExtension("GLX_EXT_stereo_tree", extStart, extEnd); -#endif /* GLX_EXT_stereo_tree */ -#ifdef GLX_EXT_swap_control - GLXEW_EXT_swap_control = _glewSearchExtension("GLX_EXT_swap_control", extStart, extEnd); - if (glewExperimental || GLXEW_EXT_swap_control) GLXEW_EXT_swap_control = !_glewInit_GLX_EXT_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_EXT_swap_control */ -#ifdef GLX_EXT_swap_control_tear - GLXEW_EXT_swap_control_tear = _glewSearchExtension("GLX_EXT_swap_control_tear", extStart, extEnd); -#endif /* GLX_EXT_swap_control_tear */ -#ifdef GLX_EXT_texture_from_pixmap - GLXEW_EXT_texture_from_pixmap = _glewSearchExtension("GLX_EXT_texture_from_pixmap", extStart, extEnd); - if (glewExperimental || GLXEW_EXT_texture_from_pixmap) GLXEW_EXT_texture_from_pixmap = !_glewInit_GLX_EXT_texture_from_pixmap(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_EXT_texture_from_pixmap */ -#ifdef GLX_EXT_visual_info - GLXEW_EXT_visual_info = _glewSearchExtension("GLX_EXT_visual_info", extStart, extEnd); -#endif /* GLX_EXT_visual_info */ -#ifdef GLX_EXT_visual_rating - GLXEW_EXT_visual_rating = _glewSearchExtension("GLX_EXT_visual_rating", extStart, extEnd); -#endif /* GLX_EXT_visual_rating */ -#ifdef GLX_INTEL_swap_event - GLXEW_INTEL_swap_event = _glewSearchExtension("GLX_INTEL_swap_event", extStart, extEnd); -#endif /* GLX_INTEL_swap_event */ -#ifdef GLX_MESA_agp_offset - GLXEW_MESA_agp_offset = _glewSearchExtension("GLX_MESA_agp_offset", extStart, extEnd); - if (glewExperimental || GLXEW_MESA_agp_offset) GLXEW_MESA_agp_offset = !_glewInit_GLX_MESA_agp_offset(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_MESA_agp_offset */ -#ifdef GLX_MESA_copy_sub_buffer - GLXEW_MESA_copy_sub_buffer = _glewSearchExtension("GLX_MESA_copy_sub_buffer", extStart, extEnd); - if (glewExperimental || GLXEW_MESA_copy_sub_buffer) GLXEW_MESA_copy_sub_buffer = !_glewInit_GLX_MESA_copy_sub_buffer(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_MESA_copy_sub_buffer */ -#ifdef GLX_MESA_pixmap_colormap - GLXEW_MESA_pixmap_colormap = _glewSearchExtension("GLX_MESA_pixmap_colormap", extStart, extEnd); - if (glewExperimental || GLXEW_MESA_pixmap_colormap) GLXEW_MESA_pixmap_colormap = !_glewInit_GLX_MESA_pixmap_colormap(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_MESA_pixmap_colormap */ -#ifdef GLX_MESA_query_renderer - GLXEW_MESA_query_renderer = _glewSearchExtension("GLX_MESA_query_renderer", extStart, extEnd); - if (glewExperimental || GLXEW_MESA_query_renderer) GLXEW_MESA_query_renderer = !_glewInit_GLX_MESA_query_renderer(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_MESA_query_renderer */ -#ifdef GLX_MESA_release_buffers - GLXEW_MESA_release_buffers = _glewSearchExtension("GLX_MESA_release_buffers", extStart, extEnd); - if (glewExperimental || GLXEW_MESA_release_buffers) GLXEW_MESA_release_buffers = !_glewInit_GLX_MESA_release_buffers(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_MESA_release_buffers */ -#ifdef GLX_MESA_set_3dfx_mode - GLXEW_MESA_set_3dfx_mode = _glewSearchExtension("GLX_MESA_set_3dfx_mode", extStart, extEnd); - if (glewExperimental || GLXEW_MESA_set_3dfx_mode) GLXEW_MESA_set_3dfx_mode = !_glewInit_GLX_MESA_set_3dfx_mode(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_MESA_set_3dfx_mode */ -#ifdef GLX_MESA_swap_control - GLXEW_MESA_swap_control = _glewSearchExtension("GLX_MESA_swap_control", extStart, extEnd); - if (glewExperimental || GLXEW_MESA_swap_control) GLXEW_MESA_swap_control = !_glewInit_GLX_MESA_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_MESA_swap_control */ -#ifdef GLX_NV_copy_buffer - GLXEW_NV_copy_buffer = _glewSearchExtension("GLX_NV_copy_buffer", extStart, extEnd); - if (glewExperimental || GLXEW_NV_copy_buffer) GLXEW_NV_copy_buffer = !_glewInit_GLX_NV_copy_buffer(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_NV_copy_buffer */ -#ifdef GLX_NV_copy_image - GLXEW_NV_copy_image = _glewSearchExtension("GLX_NV_copy_image", extStart, extEnd); - if (glewExperimental || GLXEW_NV_copy_image) GLXEW_NV_copy_image = !_glewInit_GLX_NV_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_NV_copy_image */ -#ifdef GLX_NV_delay_before_swap - GLXEW_NV_delay_before_swap = _glewSearchExtension("GLX_NV_delay_before_swap", extStart, extEnd); - if (glewExperimental || GLXEW_NV_delay_before_swap) GLXEW_NV_delay_before_swap = !_glewInit_GLX_NV_delay_before_swap(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_NV_delay_before_swap */ -#ifdef GLX_NV_float_buffer - GLXEW_NV_float_buffer = _glewSearchExtension("GLX_NV_float_buffer", extStart, extEnd); -#endif /* GLX_NV_float_buffer */ -#ifdef GLX_NV_multisample_coverage - GLXEW_NV_multisample_coverage = _glewSearchExtension("GLX_NV_multisample_coverage", extStart, extEnd); -#endif /* GLX_NV_multisample_coverage */ -#ifdef GLX_NV_present_video - GLXEW_NV_present_video = _glewSearchExtension("GLX_NV_present_video", extStart, extEnd); - if (glewExperimental || GLXEW_NV_present_video) GLXEW_NV_present_video = !_glewInit_GLX_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_NV_present_video */ -#ifdef GLX_NV_swap_group - GLXEW_NV_swap_group = _glewSearchExtension("GLX_NV_swap_group", extStart, extEnd); - if (glewExperimental || GLXEW_NV_swap_group) GLXEW_NV_swap_group = !_glewInit_GLX_NV_swap_group(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_NV_swap_group */ -#ifdef GLX_NV_vertex_array_range - GLXEW_NV_vertex_array_range = _glewSearchExtension("GLX_NV_vertex_array_range", extStart, extEnd); - if (glewExperimental || GLXEW_NV_vertex_array_range) GLXEW_NV_vertex_array_range = !_glewInit_GLX_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_NV_vertex_array_range */ -#ifdef GLX_NV_video_capture - GLXEW_NV_video_capture = _glewSearchExtension("GLX_NV_video_capture", extStart, extEnd); - if (glewExperimental || GLXEW_NV_video_capture) GLXEW_NV_video_capture = !_glewInit_GLX_NV_video_capture(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_NV_video_capture */ -#ifdef GLX_NV_video_out - GLXEW_NV_video_out = _glewSearchExtension("GLX_NV_video_out", extStart, extEnd); - if (glewExperimental || GLXEW_NV_video_out) GLXEW_NV_video_out = !_glewInit_GLX_NV_video_out(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_NV_video_out */ -#ifdef GLX_OML_swap_method - GLXEW_OML_swap_method = _glewSearchExtension("GLX_OML_swap_method", extStart, extEnd); -#endif /* GLX_OML_swap_method */ -#ifdef GLX_OML_sync_control - GLXEW_OML_sync_control = _glewSearchExtension("GLX_OML_sync_control", extStart, extEnd); - if (glewExperimental || GLXEW_OML_sync_control) GLXEW_OML_sync_control = !_glewInit_GLX_OML_sync_control(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_OML_sync_control */ -#ifdef GLX_SGIS_blended_overlay - GLXEW_SGIS_blended_overlay = _glewSearchExtension("GLX_SGIS_blended_overlay", extStart, extEnd); -#endif /* GLX_SGIS_blended_overlay */ -#ifdef GLX_SGIS_color_range - GLXEW_SGIS_color_range = _glewSearchExtension("GLX_SGIS_color_range", extStart, extEnd); -#endif /* GLX_SGIS_color_range */ -#ifdef GLX_SGIS_multisample - GLXEW_SGIS_multisample = _glewSearchExtension("GLX_SGIS_multisample", extStart, extEnd); -#endif /* GLX_SGIS_multisample */ -#ifdef GLX_SGIS_shared_multisample - GLXEW_SGIS_shared_multisample = _glewSearchExtension("GLX_SGIS_shared_multisample", extStart, extEnd); -#endif /* GLX_SGIS_shared_multisample */ -#ifdef GLX_SGIX_fbconfig - GLXEW_SGIX_fbconfig = _glewSearchExtension("GLX_SGIX_fbconfig", extStart, extEnd); - if (glewExperimental || GLXEW_SGIX_fbconfig) GLXEW_SGIX_fbconfig = !_glewInit_GLX_SGIX_fbconfig(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_SGIX_fbconfig */ -#ifdef GLX_SGIX_hyperpipe - GLXEW_SGIX_hyperpipe = _glewSearchExtension("GLX_SGIX_hyperpipe", extStart, extEnd); - if (glewExperimental || GLXEW_SGIX_hyperpipe) GLXEW_SGIX_hyperpipe = !_glewInit_GLX_SGIX_hyperpipe(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_SGIX_hyperpipe */ -#ifdef GLX_SGIX_pbuffer - GLXEW_SGIX_pbuffer = _glewSearchExtension("GLX_SGIX_pbuffer", extStart, extEnd); - if (glewExperimental || GLXEW_SGIX_pbuffer) GLXEW_SGIX_pbuffer = !_glewInit_GLX_SGIX_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_SGIX_pbuffer */ -#ifdef GLX_SGIX_swap_barrier - GLXEW_SGIX_swap_barrier = _glewSearchExtension("GLX_SGIX_swap_barrier", extStart, extEnd); - if (glewExperimental || GLXEW_SGIX_swap_barrier) GLXEW_SGIX_swap_barrier = !_glewInit_GLX_SGIX_swap_barrier(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_SGIX_swap_barrier */ -#ifdef GLX_SGIX_swap_group - GLXEW_SGIX_swap_group = _glewSearchExtension("GLX_SGIX_swap_group", extStart, extEnd); - if (glewExperimental || GLXEW_SGIX_swap_group) GLXEW_SGIX_swap_group = !_glewInit_GLX_SGIX_swap_group(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_SGIX_swap_group */ -#ifdef GLX_SGIX_video_resize - GLXEW_SGIX_video_resize = _glewSearchExtension("GLX_SGIX_video_resize", extStart, extEnd); - if (glewExperimental || GLXEW_SGIX_video_resize) GLXEW_SGIX_video_resize = !_glewInit_GLX_SGIX_video_resize(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_SGIX_video_resize */ -#ifdef GLX_SGIX_visual_select_group - GLXEW_SGIX_visual_select_group = _glewSearchExtension("GLX_SGIX_visual_select_group", extStart, extEnd); -#endif /* GLX_SGIX_visual_select_group */ -#ifdef GLX_SGI_cushion - GLXEW_SGI_cushion = _glewSearchExtension("GLX_SGI_cushion", extStart, extEnd); - if (glewExperimental || GLXEW_SGI_cushion) GLXEW_SGI_cushion = !_glewInit_GLX_SGI_cushion(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_SGI_cushion */ -#ifdef GLX_SGI_make_current_read - GLXEW_SGI_make_current_read = _glewSearchExtension("GLX_SGI_make_current_read", extStart, extEnd); - if (glewExperimental || GLXEW_SGI_make_current_read) GLXEW_SGI_make_current_read = !_glewInit_GLX_SGI_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_SGI_make_current_read */ -#ifdef GLX_SGI_swap_control - GLXEW_SGI_swap_control = _glewSearchExtension("GLX_SGI_swap_control", extStart, extEnd); - if (glewExperimental || GLXEW_SGI_swap_control) GLXEW_SGI_swap_control = !_glewInit_GLX_SGI_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_SGI_swap_control */ -#ifdef GLX_SGI_video_sync - GLXEW_SGI_video_sync = _glewSearchExtension("GLX_SGI_video_sync", extStart, extEnd); - if (glewExperimental || GLXEW_SGI_video_sync) GLXEW_SGI_video_sync = !_glewInit_GLX_SGI_video_sync(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_SGI_video_sync */ -#ifdef GLX_SUN_get_transparent_index - GLXEW_SUN_get_transparent_index = _glewSearchExtension("GLX_SUN_get_transparent_index", extStart, extEnd); - if (glewExperimental || GLXEW_SUN_get_transparent_index) GLXEW_SUN_get_transparent_index = !_glewInit_GLX_SUN_get_transparent_index(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_SUN_get_transparent_index */ -#ifdef GLX_SUN_video_resize - GLXEW_SUN_video_resize = _glewSearchExtension("GLX_SUN_video_resize", extStart, extEnd); - if (glewExperimental || GLXEW_SUN_video_resize) GLXEW_SUN_video_resize = !_glewInit_GLX_SUN_video_resize(GLEW_CONTEXT_ARG_VAR_INIT); -#endif /* GLX_SUN_video_resize */ - - return GLEW_OK; -} - -#endif /* !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) */ - -/* ------------------------------------------------------------------------ */ - -const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error) -{ - static const GLubyte* _glewErrorString[] = - { - (const GLubyte*)"No error", - (const GLubyte*)"Missing GL version", - (const GLubyte*)"GL 1.1 and up are not supported", - (const GLubyte*)"GLX 1.2 and up are not supported", - (const GLubyte*)"Unknown error" - }; - const size_t max_error = sizeof(_glewErrorString)/sizeof(*_glewErrorString) - 1; - return _glewErrorString[(size_t)error > max_error ? max_error : (size_t)error]; -} - -const GLubyte * GLEWAPIENTRY glewGetString (GLenum name) -{ - static const GLubyte* _glewString[] = - { - (const GLubyte*)NULL, - (const GLubyte*)"1.13.0", - (const GLubyte*)"1", - (const GLubyte*)"13", - (const GLubyte*)"0" - }; - const size_t max_string = sizeof(_glewString)/sizeof(*_glewString) - 1; - return _glewString[(size_t)name > max_string ? 0 : (size_t)name]; -} - -/* ------------------------------------------------------------------------ */ - -GLboolean glewExperimental = GL_FALSE; - -#if !defined(GLEW_MX) - -GLenum GLEWAPIENTRY glewInit (void) -{ - GLenum r; - r = glewContextInit(); - if ( r != 0 ) return r; -#if defined(_WIN32) - return wglewInit(); -#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) /* _UNIX */ - return glxewInit(); -#else - return r; -#endif /* _WIN32 */ -} - -#endif /* !GLEW_MX */ -#ifdef GLEW_MX -GLboolean GLEWAPIENTRY glewContextIsSupported (const GLEWContext* ctx, const char* name) -#else -GLboolean GLEWAPIENTRY glewIsSupported (const char* name) -#endif -{ - const GLubyte* pos = (const GLubyte*)name; - GLuint len = _glewStrLen(pos); - GLboolean ret = GL_TRUE; - while (ret && len > 0) - { - if (_glewStrSame1(&pos, &len, (const GLubyte*)"GL_", 3)) - { - if (_glewStrSame2(&pos, &len, (const GLubyte*)"VERSION_", 8)) - { -#ifdef GL_VERSION_1_2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2", 3)) - { - ret = GLEW_VERSION_1_2; - continue; - } -#endif -#ifdef GL_VERSION_1_2_1 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2_1", 5)) - { - ret = GLEW_VERSION_1_2_1; - continue; - } -#endif -#ifdef GL_VERSION_1_3 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_3", 3)) - { - ret = GLEW_VERSION_1_3; - continue; - } -#endif -#ifdef GL_VERSION_1_4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_4", 3)) - { - ret = GLEW_VERSION_1_4; - continue; - } -#endif -#ifdef GL_VERSION_1_5 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_5", 3)) - { - ret = GLEW_VERSION_1_5; - continue; - } -#endif -#ifdef GL_VERSION_2_0 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"2_0", 3)) - { - ret = GLEW_VERSION_2_0; - continue; - } -#endif -#ifdef GL_VERSION_2_1 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"2_1", 3)) - { - ret = GLEW_VERSION_2_1; - continue; - } -#endif -#ifdef GL_VERSION_3_0 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_0", 3)) - { - ret = GLEW_VERSION_3_0; - continue; - } -#endif -#ifdef GL_VERSION_3_1 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_1", 3)) - { - ret = GLEW_VERSION_3_1; - continue; - } -#endif -#ifdef GL_VERSION_3_2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_2", 3)) - { - ret = GLEW_VERSION_3_2; - continue; - } -#endif -#ifdef GL_VERSION_3_3 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_3", 3)) - { - ret = GLEW_VERSION_3_3; - continue; - } -#endif -#ifdef GL_VERSION_4_0 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_0", 3)) - { - ret = GLEW_VERSION_4_0; - continue; - } -#endif -#ifdef GL_VERSION_4_1 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_1", 3)) - { - ret = GLEW_VERSION_4_1; - continue; - } -#endif -#ifdef GL_VERSION_4_2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_2", 3)) - { - ret = GLEW_VERSION_4_2; - continue; - } -#endif -#ifdef GL_VERSION_4_3 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_3", 3)) - { - ret = GLEW_VERSION_4_3; - continue; - } -#endif -#ifdef GL_VERSION_4_4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_4", 3)) - { - ret = GLEW_VERSION_4_4; - continue; - } -#endif -#ifdef GL_VERSION_4_5 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_5", 3)) - { - ret = GLEW_VERSION_4_5; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) - { -#ifdef GL_3DFX_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) - { - ret = GLEW_3DFX_multisample; - continue; - } -#endif -#ifdef GL_3DFX_tbuffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"tbuffer", 7)) - { - ret = GLEW_3DFX_tbuffer; - continue; - } -#endif -#ifdef GL_3DFX_texture_compression_FXT1 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_FXT1", 24)) - { - ret = GLEW_3DFX_texture_compression_FXT1; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) - { -#ifdef GL_AMD_blend_minmax_factor - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_minmax_factor", 19)) - { - ret = GLEW_AMD_blend_minmax_factor; - continue; - } -#endif -#ifdef GL_AMD_conservative_depth - if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_depth", 18)) - { - ret = GLEW_AMD_conservative_depth; - continue; - } -#endif -#ifdef GL_AMD_debug_output - if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_output", 12)) - { - ret = GLEW_AMD_debug_output; - continue; - } -#endif -#ifdef GL_AMD_depth_clamp_separate - if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp_separate", 20)) - { - ret = GLEW_AMD_depth_clamp_separate; - continue; - } -#endif -#ifdef GL_AMD_draw_buffers_blend - if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers_blend", 18)) - { - ret = GLEW_AMD_draw_buffers_blend; - continue; - } -#endif -#ifdef GL_AMD_gcn_shader - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gcn_shader", 10)) - { - ret = GLEW_AMD_gcn_shader; - continue; - } -#endif -#ifdef GL_AMD_gpu_shader_int64 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader_int64", 16)) - { - ret = GLEW_AMD_gpu_shader_int64; - continue; - } -#endif -#ifdef GL_AMD_interleaved_elements - if (_glewStrSame3(&pos, &len, (const GLubyte*)"interleaved_elements", 20)) - { - ret = GLEW_AMD_interleaved_elements; - continue; - } -#endif -#ifdef GL_AMD_multi_draw_indirect - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_indirect", 19)) - { - ret = GLEW_AMD_multi_draw_indirect; - continue; - } -#endif -#ifdef GL_AMD_name_gen_delete - if (_glewStrSame3(&pos, &len, (const GLubyte*)"name_gen_delete", 15)) - { - ret = GLEW_AMD_name_gen_delete; - continue; - } -#endif -#ifdef GL_AMD_occlusion_query_event - if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query_event", 21)) - { - ret = GLEW_AMD_occlusion_query_event; - continue; - } -#endif -#ifdef GL_AMD_performance_monitor - if (_glewStrSame3(&pos, &len, (const GLubyte*)"performance_monitor", 19)) - { - ret = GLEW_AMD_performance_monitor; - continue; - } -#endif -#ifdef GL_AMD_pinned_memory - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pinned_memory", 13)) - { - ret = GLEW_AMD_pinned_memory; - continue; - } -#endif -#ifdef GL_AMD_query_buffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"query_buffer_object", 19)) - { - ret = GLEW_AMD_query_buffer_object; - continue; - } -#endif -#ifdef GL_AMD_sample_positions - if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_positions", 16)) - { - ret = GLEW_AMD_sample_positions; - continue; - } -#endif -#ifdef GL_AMD_seamless_cubemap_per_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cubemap_per_texture", 28)) - { - ret = GLEW_AMD_seamless_cubemap_per_texture; - continue; - } -#endif -#ifdef GL_AMD_shader_atomic_counter_ops - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_counter_ops", 25)) - { - ret = GLEW_AMD_shader_atomic_counter_ops; - continue; - } -#endif -#ifdef GL_AMD_shader_stencil_export - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_stencil_export", 21)) - { - ret = GLEW_AMD_shader_stencil_export; - continue; - } -#endif -#ifdef GL_AMD_shader_stencil_value_export - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_stencil_value_export", 27)) - { - ret = GLEW_AMD_shader_stencil_value_export; - continue; - } -#endif -#ifdef GL_AMD_shader_trinary_minmax - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_trinary_minmax", 21)) - { - ret = GLEW_AMD_shader_trinary_minmax; - continue; - } -#endif -#ifdef GL_AMD_sparse_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture", 14)) - { - ret = GLEW_AMD_sparse_texture; - continue; - } -#endif -#ifdef GL_AMD_stencil_operation_extended - if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_operation_extended", 26)) - { - ret = GLEW_AMD_stencil_operation_extended; - continue; - } -#endif -#ifdef GL_AMD_texture_texture4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_texture4", 16)) - { - ret = GLEW_AMD_texture_texture4; - continue; - } -#endif -#ifdef GL_AMD_transform_feedback3_lines_triangles - if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback3_lines_triangles", 35)) - { - ret = GLEW_AMD_transform_feedback3_lines_triangles; - continue; - } -#endif -#ifdef GL_AMD_transform_feedback4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback4", 19)) - { - ret = GLEW_AMD_transform_feedback4; - continue; - } -#endif -#ifdef GL_AMD_vertex_shader_layer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_layer", 19)) - { - ret = GLEW_AMD_vertex_shader_layer; - continue; - } -#endif -#ifdef GL_AMD_vertex_shader_tessellator - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_tessellator", 25)) - { - ret = GLEW_AMD_vertex_shader_tessellator; - continue; - } -#endif -#ifdef GL_AMD_vertex_shader_viewport_index - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_viewport_index", 28)) - { - ret = GLEW_AMD_vertex_shader_viewport_index; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"ANGLE_", 6)) - { -#ifdef GL_ANGLE_depth_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13)) - { - ret = GLEW_ANGLE_depth_texture; - continue; - } -#endif -#ifdef GL_ANGLE_framebuffer_blit - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_blit", 16)) - { - ret = GLEW_ANGLE_framebuffer_blit; - continue; - } -#endif -#ifdef GL_ANGLE_framebuffer_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample", 23)) - { - ret = GLEW_ANGLE_framebuffer_multisample; - continue; - } -#endif -#ifdef GL_ANGLE_instanced_arrays - if (_glewStrSame3(&pos, &len, (const GLubyte*)"instanced_arrays", 16)) - { - ret = GLEW_ANGLE_instanced_arrays; - continue; - } -#endif -#ifdef GL_ANGLE_pack_reverse_row_order - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pack_reverse_row_order", 22)) - { - ret = GLEW_ANGLE_pack_reverse_row_order; - continue; - } -#endif -#ifdef GL_ANGLE_program_binary - if (_glewStrSame3(&pos, &len, (const GLubyte*)"program_binary", 14)) - { - ret = GLEW_ANGLE_program_binary; - continue; - } -#endif -#ifdef GL_ANGLE_texture_compression_dxt1 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt1", 24)) - { - ret = GLEW_ANGLE_texture_compression_dxt1; - continue; - } -#endif -#ifdef GL_ANGLE_texture_compression_dxt3 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt3", 24)) - { - ret = GLEW_ANGLE_texture_compression_dxt3; - continue; - } -#endif -#ifdef GL_ANGLE_texture_compression_dxt5 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt5", 24)) - { - ret = GLEW_ANGLE_texture_compression_dxt5; - continue; - } -#endif -#ifdef GL_ANGLE_texture_usage - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_usage", 13)) - { - ret = GLEW_ANGLE_texture_usage; - continue; - } -#endif -#ifdef GL_ANGLE_timer_query - if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11)) - { - ret = GLEW_ANGLE_timer_query; - continue; - } -#endif -#ifdef GL_ANGLE_translated_shader_source - if (_glewStrSame3(&pos, &len, (const GLubyte*)"translated_shader_source", 24)) - { - ret = GLEW_ANGLE_translated_shader_source; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"APPLE_", 6)) - { -#ifdef GL_APPLE_aux_depth_stencil - if (_glewStrSame3(&pos, &len, (const GLubyte*)"aux_depth_stencil", 17)) - { - ret = GLEW_APPLE_aux_depth_stencil; - continue; - } -#endif -#ifdef GL_APPLE_client_storage - if (_glewStrSame3(&pos, &len, (const GLubyte*)"client_storage", 14)) - { - ret = GLEW_APPLE_client_storage; - continue; - } -#endif -#ifdef GL_APPLE_element_array - if (_glewStrSame3(&pos, &len, (const GLubyte*)"element_array", 13)) - { - ret = GLEW_APPLE_element_array; - continue; - } -#endif -#ifdef GL_APPLE_fence - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fence", 5)) - { - ret = GLEW_APPLE_fence; - continue; - } -#endif -#ifdef GL_APPLE_float_pixels - if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_pixels", 12)) - { - ret = GLEW_APPLE_float_pixels; - continue; - } -#endif -#ifdef GL_APPLE_flush_buffer_range - if (_glewStrSame3(&pos, &len, (const GLubyte*)"flush_buffer_range", 18)) - { - ret = GLEW_APPLE_flush_buffer_range; - continue; - } -#endif -#ifdef GL_APPLE_object_purgeable - if (_glewStrSame3(&pos, &len, (const GLubyte*)"object_purgeable", 16)) - { - ret = GLEW_APPLE_object_purgeable; - continue; - } -#endif -#ifdef GL_APPLE_pixel_buffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer", 12)) - { - ret = GLEW_APPLE_pixel_buffer; - continue; - } -#endif -#ifdef GL_APPLE_rgb_422 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"rgb_422", 7)) - { - ret = GLEW_APPLE_rgb_422; - continue; - } -#endif -#ifdef GL_APPLE_row_bytes - if (_glewStrSame3(&pos, &len, (const GLubyte*)"row_bytes", 9)) - { - ret = GLEW_APPLE_row_bytes; - continue; - } -#endif -#ifdef GL_APPLE_specular_vector - if (_glewStrSame3(&pos, &len, (const GLubyte*)"specular_vector", 15)) - { - ret = GLEW_APPLE_specular_vector; - continue; - } -#endif -#ifdef GL_APPLE_texture_range - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_range", 13)) - { - ret = GLEW_APPLE_texture_range; - continue; - } -#endif -#ifdef GL_APPLE_transform_hint - if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_hint", 14)) - { - ret = GLEW_APPLE_transform_hint; - continue; - } -#endif -#ifdef GL_APPLE_vertex_array_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) - { - ret = GLEW_APPLE_vertex_array_object; - continue; - } -#endif -#ifdef GL_APPLE_vertex_array_range - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) - { - ret = GLEW_APPLE_vertex_array_range; - continue; - } -#endif -#ifdef GL_APPLE_vertex_program_evaluators - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program_evaluators", 25)) - { - ret = GLEW_APPLE_vertex_program_evaluators; - continue; - } -#endif -#ifdef GL_APPLE_ycbcr_422 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycbcr_422", 9)) - { - ret = GLEW_APPLE_ycbcr_422; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) - { -#ifdef GL_ARB_ES2_compatibility - if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES2_compatibility", 17)) - { - ret = GLEW_ARB_ES2_compatibility; - continue; - } -#endif -#ifdef GL_ARB_ES3_1_compatibility - if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES3_1_compatibility", 19)) - { - ret = GLEW_ARB_ES3_1_compatibility; - continue; - } -#endif -#ifdef GL_ARB_ES3_2_compatibility - if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES3_2_compatibility", 19)) - { - ret = GLEW_ARB_ES3_2_compatibility; - continue; - } -#endif -#ifdef GL_ARB_ES3_compatibility - if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES3_compatibility", 17)) - { - ret = GLEW_ARB_ES3_compatibility; - continue; - } -#endif -#ifdef GL_ARB_arrays_of_arrays - if (_glewStrSame3(&pos, &len, (const GLubyte*)"arrays_of_arrays", 16)) - { - ret = GLEW_ARB_arrays_of_arrays; - continue; - } -#endif -#ifdef GL_ARB_base_instance - if (_glewStrSame3(&pos, &len, (const GLubyte*)"base_instance", 13)) - { - ret = GLEW_ARB_base_instance; - continue; - } -#endif -#ifdef GL_ARB_bindless_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindless_texture", 16)) - { - ret = GLEW_ARB_bindless_texture; - continue; - } -#endif -#ifdef GL_ARB_blend_func_extended - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_func_extended", 19)) - { - ret = GLEW_ARB_blend_func_extended; - continue; - } -#endif -#ifdef GL_ARB_buffer_storage - if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_storage", 14)) - { - ret = GLEW_ARB_buffer_storage; - continue; - } -#endif -#ifdef GL_ARB_cl_event - if (_glewStrSame3(&pos, &len, (const GLubyte*)"cl_event", 8)) - { - ret = GLEW_ARB_cl_event; - continue; - } -#endif -#ifdef GL_ARB_clear_buffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"clear_buffer_object", 19)) - { - ret = GLEW_ARB_clear_buffer_object; - continue; - } -#endif -#ifdef GL_ARB_clear_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"clear_texture", 13)) - { - ret = GLEW_ARB_clear_texture; - continue; - } -#endif -#ifdef GL_ARB_clip_control - if (_glewStrSame3(&pos, &len, (const GLubyte*)"clip_control", 12)) - { - ret = GLEW_ARB_clip_control; - continue; - } -#endif -#ifdef GL_ARB_color_buffer_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_buffer_float", 18)) - { - ret = GLEW_ARB_color_buffer_float; - continue; - } -#endif -#ifdef GL_ARB_compatibility - if (_glewStrSame3(&pos, &len, (const GLubyte*)"compatibility", 13)) - { - ret = GLEW_ARB_compatibility; - continue; - } -#endif -#ifdef GL_ARB_compressed_texture_pixel_storage - if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_texture_pixel_storage", 32)) - { - ret = GLEW_ARB_compressed_texture_pixel_storage; - continue; - } -#endif -#ifdef GL_ARB_compute_shader - if (_glewStrSame3(&pos, &len, (const GLubyte*)"compute_shader", 14)) - { - ret = GLEW_ARB_compute_shader; - continue; - } -#endif -#ifdef GL_ARB_compute_variable_group_size - if (_glewStrSame3(&pos, &len, (const GLubyte*)"compute_variable_group_size", 27)) - { - ret = GLEW_ARB_compute_variable_group_size; - continue; - } -#endif -#ifdef GL_ARB_conditional_render_inverted - if (_glewStrSame3(&pos, &len, (const GLubyte*)"conditional_render_inverted", 27)) - { - ret = GLEW_ARB_conditional_render_inverted; - continue; - } -#endif -#ifdef GL_ARB_conservative_depth - if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_depth", 18)) - { - ret = GLEW_ARB_conservative_depth; - continue; - } -#endif -#ifdef GL_ARB_copy_buffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_buffer", 11)) - { - ret = GLEW_ARB_copy_buffer; - continue; - } -#endif -#ifdef GL_ARB_copy_image - if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) - { - ret = GLEW_ARB_copy_image; - continue; - } -#endif -#ifdef GL_ARB_cull_distance - if (_glewStrSame3(&pos, &len, (const GLubyte*)"cull_distance", 13)) - { - ret = GLEW_ARB_cull_distance; - continue; - } -#endif -#ifdef GL_ARB_debug_output - if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_output", 12)) - { - ret = GLEW_ARB_debug_output; - continue; - } -#endif -#ifdef GL_ARB_depth_buffer_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_buffer_float", 18)) - { - ret = GLEW_ARB_depth_buffer_float; - continue; - } -#endif -#ifdef GL_ARB_depth_clamp - if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp", 11)) - { - ret = GLEW_ARB_depth_clamp; - continue; - } -#endif -#ifdef GL_ARB_depth_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13)) - { - ret = GLEW_ARB_depth_texture; - continue; - } -#endif -#ifdef GL_ARB_derivative_control - if (_glewStrSame3(&pos, &len, (const GLubyte*)"derivative_control", 18)) - { - ret = GLEW_ARB_derivative_control; - continue; - } -#endif -#ifdef GL_ARB_direct_state_access - if (_glewStrSame3(&pos, &len, (const GLubyte*)"direct_state_access", 19)) - { - ret = GLEW_ARB_direct_state_access; - continue; - } -#endif -#ifdef GL_ARB_draw_buffers - if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers", 12)) - { - ret = GLEW_ARB_draw_buffers; - continue; - } -#endif -#ifdef GL_ARB_draw_buffers_blend - if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers_blend", 18)) - { - ret = GLEW_ARB_draw_buffers_blend; - continue; - } -#endif -#ifdef GL_ARB_draw_elements_base_vertex - if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_elements_base_vertex", 25)) - { - ret = GLEW_ARB_draw_elements_base_vertex; - continue; - } -#endif -#ifdef GL_ARB_draw_indirect - if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_indirect", 13)) - { - ret = GLEW_ARB_draw_indirect; - continue; - } -#endif -#ifdef GL_ARB_draw_instanced - if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_instanced", 14)) - { - ret = GLEW_ARB_draw_instanced; - continue; - } -#endif -#ifdef GL_ARB_enhanced_layouts - if (_glewStrSame3(&pos, &len, (const GLubyte*)"enhanced_layouts", 16)) - { - ret = GLEW_ARB_enhanced_layouts; - continue; - } -#endif -#ifdef GL_ARB_explicit_attrib_location - if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_attrib_location", 24)) - { - ret = GLEW_ARB_explicit_attrib_location; - continue; - } -#endif -#ifdef GL_ARB_explicit_uniform_location - if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_uniform_location", 25)) - { - ret = GLEW_ARB_explicit_uniform_location; - continue; - } -#endif -#ifdef GL_ARB_fragment_coord_conventions - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_coord_conventions", 26)) - { - ret = GLEW_ARB_fragment_coord_conventions; - continue; - } -#endif -#ifdef GL_ARB_fragment_layer_viewport - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_layer_viewport", 23)) - { - ret = GLEW_ARB_fragment_layer_viewport; - continue; - } -#endif -#ifdef GL_ARB_fragment_program - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program", 16)) - { - ret = GLEW_ARB_fragment_program; - continue; - } -#endif -#ifdef GL_ARB_fragment_program_shadow - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program_shadow", 23)) - { - ret = GLEW_ARB_fragment_program_shadow; - continue; - } -#endif -#ifdef GL_ARB_fragment_shader - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader", 15)) - { - ret = GLEW_ARB_fragment_shader; - continue; - } -#endif -#ifdef GL_ARB_fragment_shader_interlock - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader_interlock", 25)) - { - ret = GLEW_ARB_fragment_shader_interlock; - continue; - } -#endif -#ifdef GL_ARB_framebuffer_no_attachments - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_no_attachments", 26)) - { - ret = GLEW_ARB_framebuffer_no_attachments; - continue; - } -#endif -#ifdef GL_ARB_framebuffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_object", 18)) - { - ret = GLEW_ARB_framebuffer_object; - continue; - } -#endif -#ifdef GL_ARB_framebuffer_sRGB - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) - { - ret = GLEW_ARB_framebuffer_sRGB; - continue; - } -#endif -#ifdef GL_ARB_geometry_shader4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) - { - ret = GLEW_ARB_geometry_shader4; - continue; - } -#endif -#ifdef GL_ARB_get_program_binary - if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_program_binary", 18)) - { - ret = GLEW_ARB_get_program_binary; - continue; - } -#endif -#ifdef GL_ARB_get_texture_sub_image - if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_texture_sub_image", 21)) - { - ret = GLEW_ARB_get_texture_sub_image; - continue; - } -#endif -#ifdef GL_ARB_gpu_shader5 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader5", 11)) - { - ret = GLEW_ARB_gpu_shader5; - continue; - } -#endif -#ifdef GL_ARB_gpu_shader_fp64 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader_fp64", 15)) - { - ret = GLEW_ARB_gpu_shader_fp64; - continue; - } -#endif -#ifdef GL_ARB_gpu_shader_int64 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader_int64", 16)) - { - ret = GLEW_ARB_gpu_shader_int64; - continue; - } -#endif -#ifdef GL_ARB_half_float_pixel - if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float_pixel", 16)) - { - ret = GLEW_ARB_half_float_pixel; - continue; - } -#endif -#ifdef GL_ARB_half_float_vertex - if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float_vertex", 17)) - { - ret = GLEW_ARB_half_float_vertex; - continue; - } -#endif -#ifdef GL_ARB_imaging - if (_glewStrSame3(&pos, &len, (const GLubyte*)"imaging", 7)) - { - ret = GLEW_ARB_imaging; - continue; - } -#endif -#ifdef GL_ARB_indirect_parameters - if (_glewStrSame3(&pos, &len, (const GLubyte*)"indirect_parameters", 19)) - { - ret = GLEW_ARB_indirect_parameters; - continue; - } -#endif -#ifdef GL_ARB_instanced_arrays - if (_glewStrSame3(&pos, &len, (const GLubyte*)"instanced_arrays", 16)) - { - ret = GLEW_ARB_instanced_arrays; - continue; - } -#endif -#ifdef GL_ARB_internalformat_query - if (_glewStrSame3(&pos, &len, (const GLubyte*)"internalformat_query", 20)) - { - ret = GLEW_ARB_internalformat_query; - continue; - } -#endif -#ifdef GL_ARB_internalformat_query2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"internalformat_query2", 21)) - { - ret = GLEW_ARB_internalformat_query2; - continue; - } -#endif -#ifdef GL_ARB_invalidate_subdata - if (_glewStrSame3(&pos, &len, (const GLubyte*)"invalidate_subdata", 18)) - { - ret = GLEW_ARB_invalidate_subdata; - continue; - } -#endif -#ifdef GL_ARB_map_buffer_alignment - if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_buffer_alignment", 20)) - { - ret = GLEW_ARB_map_buffer_alignment; - continue; - } -#endif -#ifdef GL_ARB_map_buffer_range - if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_buffer_range", 16)) - { - ret = GLEW_ARB_map_buffer_range; - continue; - } -#endif -#ifdef GL_ARB_matrix_palette - if (_glewStrSame3(&pos, &len, (const GLubyte*)"matrix_palette", 14)) - { - ret = GLEW_ARB_matrix_palette; - continue; - } -#endif -#ifdef GL_ARB_multi_bind - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_bind", 10)) - { - ret = GLEW_ARB_multi_bind; - continue; - } -#endif -#ifdef GL_ARB_multi_draw_indirect - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_indirect", 19)) - { - ret = GLEW_ARB_multi_draw_indirect; - continue; - } -#endif -#ifdef GL_ARB_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) - { - ret = GLEW_ARB_multisample; - continue; - } -#endif -#ifdef GL_ARB_multitexture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multitexture", 12)) - { - ret = GLEW_ARB_multitexture; - continue; - } -#endif -#ifdef GL_ARB_occlusion_query - if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query", 15)) - { - ret = GLEW_ARB_occlusion_query; - continue; - } -#endif -#ifdef GL_ARB_occlusion_query2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query2", 16)) - { - ret = GLEW_ARB_occlusion_query2; - continue; - } -#endif -#ifdef GL_ARB_parallel_shader_compile - if (_glewStrSame3(&pos, &len, (const GLubyte*)"parallel_shader_compile", 23)) - { - ret = GLEW_ARB_parallel_shader_compile; - continue; - } -#endif -#ifdef GL_ARB_pipeline_statistics_query - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pipeline_statistics_query", 25)) - { - ret = GLEW_ARB_pipeline_statistics_query; - continue; - } -#endif -#ifdef GL_ARB_pixel_buffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer_object", 19)) - { - ret = GLEW_ARB_pixel_buffer_object; - continue; - } -#endif -#ifdef GL_ARB_point_parameters - if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_parameters", 16)) - { - ret = GLEW_ARB_point_parameters; - continue; - } -#endif -#ifdef GL_ARB_point_sprite - if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprite", 12)) - { - ret = GLEW_ARB_point_sprite; - continue; - } -#endif -#ifdef GL_ARB_post_depth_coverage - if (_glewStrSame3(&pos, &len, (const GLubyte*)"post_depth_coverage", 19)) - { - ret = GLEW_ARB_post_depth_coverage; - continue; - } -#endif -#ifdef GL_ARB_program_interface_query - if (_glewStrSame3(&pos, &len, (const GLubyte*)"program_interface_query", 23)) - { - ret = GLEW_ARB_program_interface_query; - continue; - } -#endif -#ifdef GL_ARB_provoking_vertex - if (_glewStrSame3(&pos, &len, (const GLubyte*)"provoking_vertex", 16)) - { - ret = GLEW_ARB_provoking_vertex; - continue; - } -#endif -#ifdef GL_ARB_query_buffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"query_buffer_object", 19)) - { - ret = GLEW_ARB_query_buffer_object; - continue; - } -#endif -#ifdef GL_ARB_robust_buffer_access_behavior - if (_glewStrSame3(&pos, &len, (const GLubyte*)"robust_buffer_access_behavior", 29)) - { - ret = GLEW_ARB_robust_buffer_access_behavior; - continue; - } -#endif -#ifdef GL_ARB_robustness - if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness", 10)) - { - ret = GLEW_ARB_robustness; - continue; - } -#endif -#ifdef GL_ARB_robustness_application_isolation - if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_application_isolation", 32)) - { - ret = GLEW_ARB_robustness_application_isolation; - continue; - } -#endif -#ifdef GL_ARB_robustness_share_group_isolation - if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_share_group_isolation", 32)) - { - ret = GLEW_ARB_robustness_share_group_isolation; - continue; - } -#endif -#ifdef GL_ARB_sample_locations - if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_locations", 16)) - { - ret = GLEW_ARB_sample_locations; - continue; - } -#endif -#ifdef GL_ARB_sample_shading - if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_shading", 14)) - { - ret = GLEW_ARB_sample_shading; - continue; - } -#endif -#ifdef GL_ARB_sampler_objects - if (_glewStrSame3(&pos, &len, (const GLubyte*)"sampler_objects", 15)) - { - ret = GLEW_ARB_sampler_objects; - continue; - } -#endif -#ifdef GL_ARB_seamless_cube_map - if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cube_map", 17)) - { - ret = GLEW_ARB_seamless_cube_map; - continue; - } -#endif -#ifdef GL_ARB_seamless_cubemap_per_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cubemap_per_texture", 28)) - { - ret = GLEW_ARB_seamless_cubemap_per_texture; - continue; - } -#endif -#ifdef GL_ARB_separate_shader_objects - if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_shader_objects", 23)) - { - ret = GLEW_ARB_separate_shader_objects; - continue; - } -#endif -#ifdef GL_ARB_shader_atomic_counter_ops - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_counter_ops", 25)) - { - ret = GLEW_ARB_shader_atomic_counter_ops; - continue; - } -#endif -#ifdef GL_ARB_shader_atomic_counters - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_counters", 22)) - { - ret = GLEW_ARB_shader_atomic_counters; - continue; - } -#endif -#ifdef GL_ARB_shader_ballot - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_ballot", 13)) - { - ret = GLEW_ARB_shader_ballot; - continue; - } -#endif -#ifdef GL_ARB_shader_bit_encoding - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_bit_encoding", 19)) - { - ret = GLEW_ARB_shader_bit_encoding; - continue; - } -#endif -#ifdef GL_ARB_shader_clock - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_clock", 12)) - { - ret = GLEW_ARB_shader_clock; - continue; - } -#endif -#ifdef GL_ARB_shader_draw_parameters - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_draw_parameters", 22)) - { - ret = GLEW_ARB_shader_draw_parameters; - continue; - } -#endif -#ifdef GL_ARB_shader_group_vote - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_group_vote", 17)) - { - ret = GLEW_ARB_shader_group_vote; - continue; - } -#endif -#ifdef GL_ARB_shader_image_load_store - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_load_store", 23)) - { - ret = GLEW_ARB_shader_image_load_store; - continue; - } -#endif -#ifdef GL_ARB_shader_image_size - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_size", 17)) - { - ret = GLEW_ARB_shader_image_size; - continue; - } -#endif -#ifdef GL_ARB_shader_objects - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_objects", 14)) - { - ret = GLEW_ARB_shader_objects; - continue; - } -#endif -#ifdef GL_ARB_shader_precision - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_precision", 16)) - { - ret = GLEW_ARB_shader_precision; - continue; - } -#endif -#ifdef GL_ARB_shader_stencil_export - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_stencil_export", 21)) - { - ret = GLEW_ARB_shader_stencil_export; - continue; - } -#endif -#ifdef GL_ARB_shader_storage_buffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_storage_buffer_object", 28)) - { - ret = GLEW_ARB_shader_storage_buffer_object; - continue; - } -#endif -#ifdef GL_ARB_shader_subroutine - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_subroutine", 17)) - { - ret = GLEW_ARB_shader_subroutine; - continue; - } -#endif -#ifdef GL_ARB_shader_texture_image_samples - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_image_samples", 28)) - { - ret = GLEW_ARB_shader_texture_image_samples; - continue; - } -#endif -#ifdef GL_ARB_shader_texture_lod - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_lod", 18)) - { - ret = GLEW_ARB_shader_texture_lod; - continue; - } -#endif -#ifdef GL_ARB_shader_viewport_layer_array - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_viewport_layer_array", 27)) - { - ret = GLEW_ARB_shader_viewport_layer_array; - continue; - } -#endif -#ifdef GL_ARB_shading_language_100 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_100", 20)) - { - ret = GLEW_ARB_shading_language_100; - continue; - } -#endif -#ifdef GL_ARB_shading_language_420pack - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_420pack", 24)) - { - ret = GLEW_ARB_shading_language_420pack; - continue; - } -#endif -#ifdef GL_ARB_shading_language_include - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_include", 24)) - { - ret = GLEW_ARB_shading_language_include; - continue; - } -#endif -#ifdef GL_ARB_shading_language_packing - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_packing", 24)) - { - ret = GLEW_ARB_shading_language_packing; - continue; - } -#endif -#ifdef GL_ARB_shadow - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow", 6)) - { - ret = GLEW_ARB_shadow; - continue; - } -#endif -#ifdef GL_ARB_shadow_ambient - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_ambient", 14)) - { - ret = GLEW_ARB_shadow_ambient; - continue; - } -#endif -#ifdef GL_ARB_sparse_buffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_buffer", 13)) - { - ret = GLEW_ARB_sparse_buffer; - continue; - } -#endif -#ifdef GL_ARB_sparse_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture", 14)) - { - ret = GLEW_ARB_sparse_texture; - continue; - } -#endif -#ifdef GL_ARB_sparse_texture2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture2", 15)) - { - ret = GLEW_ARB_sparse_texture2; - continue; - } -#endif -#ifdef GL_ARB_sparse_texture_clamp - if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture_clamp", 20)) - { - ret = GLEW_ARB_sparse_texture_clamp; - continue; - } -#endif -#ifdef GL_ARB_stencil_texturing - if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_texturing", 17)) - { - ret = GLEW_ARB_stencil_texturing; - continue; - } -#endif -#ifdef GL_ARB_sync - if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync", 4)) - { - ret = GLEW_ARB_sync; - continue; - } -#endif -#ifdef GL_ARB_tessellation_shader - if (_glewStrSame3(&pos, &len, (const GLubyte*)"tessellation_shader", 19)) - { - ret = GLEW_ARB_tessellation_shader; - continue; - } -#endif -#ifdef GL_ARB_texture_barrier - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_barrier", 15)) - { - ret = GLEW_ARB_texture_barrier; - continue; - } -#endif -#ifdef GL_ARB_texture_border_clamp - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_border_clamp", 20)) - { - ret = GLEW_ARB_texture_border_clamp; - continue; - } -#endif -#ifdef GL_ARB_texture_buffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object", 21)) - { - ret = GLEW_ARB_texture_buffer_object; - continue; - } -#endif -#ifdef GL_ARB_texture_buffer_object_rgb32 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object_rgb32", 27)) - { - ret = GLEW_ARB_texture_buffer_object_rgb32; - continue; - } -#endif -#ifdef GL_ARB_texture_buffer_range - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_range", 20)) - { - ret = GLEW_ARB_texture_buffer_range; - continue; - } -#endif -#ifdef GL_ARB_texture_compression - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression", 19)) - { - ret = GLEW_ARB_texture_compression; - continue; - } -#endif -#ifdef GL_ARB_texture_compression_bptc - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_bptc", 24)) - { - ret = GLEW_ARB_texture_compression_bptc; - continue; - } -#endif -#ifdef GL_ARB_texture_compression_rgtc - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_rgtc", 24)) - { - ret = GLEW_ARB_texture_compression_rgtc; - continue; - } -#endif -#ifdef GL_ARB_texture_cube_map - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map", 16)) - { - ret = GLEW_ARB_texture_cube_map; - continue; - } -#endif -#ifdef GL_ARB_texture_cube_map_array - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map_array", 22)) - { - ret = GLEW_ARB_texture_cube_map_array; - continue; - } -#endif -#ifdef GL_ARB_texture_env_add - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_add", 15)) - { - ret = GLEW_ARB_texture_env_add; - continue; - } -#endif -#ifdef GL_ARB_texture_env_combine - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine", 19)) - { - ret = GLEW_ARB_texture_env_combine; - continue; - } -#endif -#ifdef GL_ARB_texture_env_crossbar - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_crossbar", 20)) - { - ret = GLEW_ARB_texture_env_crossbar; - continue; - } -#endif -#ifdef GL_ARB_texture_env_dot3 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_dot3", 16)) - { - ret = GLEW_ARB_texture_env_dot3; - continue; - } -#endif -#ifdef GL_ARB_texture_filter_minmax - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter_minmax", 21)) - { - ret = GLEW_ARB_texture_filter_minmax; - continue; - } -#endif -#ifdef GL_ARB_texture_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_float", 13)) - { - ret = GLEW_ARB_texture_float; - continue; - } -#endif -#ifdef GL_ARB_texture_gather - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_gather", 14)) - { - ret = GLEW_ARB_texture_gather; - continue; - } -#endif -#ifdef GL_ARB_texture_mirror_clamp_to_edge - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_clamp_to_edge", 28)) - { - ret = GLEW_ARB_texture_mirror_clamp_to_edge; - continue; - } -#endif -#ifdef GL_ARB_texture_mirrored_repeat - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirrored_repeat", 23)) - { - ret = GLEW_ARB_texture_mirrored_repeat; - continue; - } -#endif -#ifdef GL_ARB_texture_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multisample", 19)) - { - ret = GLEW_ARB_texture_multisample; - continue; - } -#endif -#ifdef GL_ARB_texture_non_power_of_two - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_non_power_of_two", 24)) - { - ret = GLEW_ARB_texture_non_power_of_two; - continue; - } -#endif -#ifdef GL_ARB_texture_query_levels - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_query_levels", 20)) - { - ret = GLEW_ARB_texture_query_levels; - continue; - } -#endif -#ifdef GL_ARB_texture_query_lod - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_query_lod", 17)) - { - ret = GLEW_ARB_texture_query_lod; - continue; - } -#endif -#ifdef GL_ARB_texture_rectangle - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) - { - ret = GLEW_ARB_texture_rectangle; - continue; - } -#endif -#ifdef GL_ARB_texture_rg - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rg", 10)) - { - ret = GLEW_ARB_texture_rg; - continue; - } -#endif -#ifdef GL_ARB_texture_rgb10_a2ui - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rgb10_a2ui", 18)) - { - ret = GLEW_ARB_texture_rgb10_a2ui; - continue; - } -#endif -#ifdef GL_ARB_texture_stencil8 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_stencil8", 16)) - { - ret = GLEW_ARB_texture_stencil8; - continue; - } -#endif -#ifdef GL_ARB_texture_storage - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_storage", 15)) - { - ret = GLEW_ARB_texture_storage; - continue; - } -#endif -#ifdef GL_ARB_texture_storage_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_storage_multisample", 27)) - { - ret = GLEW_ARB_texture_storage_multisample; - continue; - } -#endif -#ifdef GL_ARB_texture_swizzle - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_swizzle", 15)) - { - ret = GLEW_ARB_texture_swizzle; - continue; - } -#endif -#ifdef GL_ARB_texture_view - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_view", 12)) - { - ret = GLEW_ARB_texture_view; - continue; - } -#endif -#ifdef GL_ARB_timer_query - if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11)) - { - ret = GLEW_ARB_timer_query; - continue; - } -#endif -#ifdef GL_ARB_transform_feedback2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback2", 19)) - { - ret = GLEW_ARB_transform_feedback2; - continue; - } -#endif -#ifdef GL_ARB_transform_feedback3 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback3", 19)) - { - ret = GLEW_ARB_transform_feedback3; - continue; - } -#endif -#ifdef GL_ARB_transform_feedback_instanced - if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback_instanced", 28)) - { - ret = GLEW_ARB_transform_feedback_instanced; - continue; - } -#endif -#ifdef GL_ARB_transform_feedback_overflow_query - if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback_overflow_query", 33)) - { - ret = GLEW_ARB_transform_feedback_overflow_query; - continue; - } -#endif -#ifdef GL_ARB_transpose_matrix - if (_glewStrSame3(&pos, &len, (const GLubyte*)"transpose_matrix", 16)) - { - ret = GLEW_ARB_transpose_matrix; - continue; - } -#endif -#ifdef GL_ARB_uniform_buffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"uniform_buffer_object", 21)) - { - ret = GLEW_ARB_uniform_buffer_object; - continue; - } -#endif -#ifdef GL_ARB_vertex_array_bgra - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_bgra", 17)) - { - ret = GLEW_ARB_vertex_array_bgra; - continue; - } -#endif -#ifdef GL_ARB_vertex_array_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) - { - ret = GLEW_ARB_vertex_array_object; - continue; - } -#endif -#ifdef GL_ARB_vertex_attrib_64bit - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_64bit", 19)) - { - ret = GLEW_ARB_vertex_attrib_64bit; - continue; - } -#endif -#ifdef GL_ARB_vertex_attrib_binding - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_binding", 21)) - { - ret = GLEW_ARB_vertex_attrib_binding; - continue; - } -#endif -#ifdef GL_ARB_vertex_blend - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_blend", 12)) - { - ret = GLEW_ARB_vertex_blend; - continue; - } -#endif -#ifdef GL_ARB_vertex_buffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_object", 20)) - { - ret = GLEW_ARB_vertex_buffer_object; - continue; - } -#endif -#ifdef GL_ARB_vertex_program - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program", 14)) - { - ret = GLEW_ARB_vertex_program; - continue; - } -#endif -#ifdef GL_ARB_vertex_shader - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader", 13)) - { - ret = GLEW_ARB_vertex_shader; - continue; - } -#endif -#ifdef GL_ARB_vertex_type_10f_11f_11f_rev - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_type_10f_11f_11f_rev", 27)) - { - ret = GLEW_ARB_vertex_type_10f_11f_11f_rev; - continue; - } -#endif -#ifdef GL_ARB_vertex_type_2_10_10_10_rev - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_type_2_10_10_10_rev", 26)) - { - ret = GLEW_ARB_vertex_type_2_10_10_10_rev; - continue; - } -#endif -#ifdef GL_ARB_viewport_array - if (_glewStrSame3(&pos, &len, (const GLubyte*)"viewport_array", 14)) - { - ret = GLEW_ARB_viewport_array; - continue; - } -#endif -#ifdef GL_ARB_window_pos - if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_pos", 10)) - { - ret = GLEW_ARB_window_pos; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATIX_", 5)) - { -#ifdef GL_ATIX_point_sprites - if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprites", 13)) - { - ret = GLEW_ATIX_point_sprites; - continue; - } -#endif -#ifdef GL_ATIX_texture_env_combine3 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine3", 20)) - { - ret = GLEW_ATIX_texture_env_combine3; - continue; - } -#endif -#ifdef GL_ATIX_texture_env_route - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_route", 17)) - { - ret = GLEW_ATIX_texture_env_route; - continue; - } -#endif -#ifdef GL_ATIX_vertex_shader_output_point_size - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_output_point_size", 31)) - { - ret = GLEW_ATIX_vertex_shader_output_point_size; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) - { -#ifdef GL_ATI_draw_buffers - if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers", 12)) - { - ret = GLEW_ATI_draw_buffers; - continue; - } -#endif -#ifdef GL_ATI_element_array - if (_glewStrSame3(&pos, &len, (const GLubyte*)"element_array", 13)) - { - ret = GLEW_ATI_element_array; - continue; - } -#endif -#ifdef GL_ATI_envmap_bumpmap - if (_glewStrSame3(&pos, &len, (const GLubyte*)"envmap_bumpmap", 14)) - { - ret = GLEW_ATI_envmap_bumpmap; - continue; - } -#endif -#ifdef GL_ATI_fragment_shader - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader", 15)) - { - ret = GLEW_ATI_fragment_shader; - continue; - } -#endif -#ifdef GL_ATI_map_object_buffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_object_buffer", 17)) - { - ret = GLEW_ATI_map_object_buffer; - continue; - } -#endif -#ifdef GL_ATI_meminfo - if (_glewStrSame3(&pos, &len, (const GLubyte*)"meminfo", 7)) - { - ret = GLEW_ATI_meminfo; - continue; - } -#endif -#ifdef GL_ATI_pn_triangles - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pn_triangles", 12)) - { - ret = GLEW_ATI_pn_triangles; - continue; - } -#endif -#ifdef GL_ATI_separate_stencil - if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_stencil", 16)) - { - ret = GLEW_ATI_separate_stencil; - continue; - } -#endif -#ifdef GL_ATI_shader_texture_lod - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_lod", 18)) - { - ret = GLEW_ATI_shader_texture_lod; - continue; - } -#endif -#ifdef GL_ATI_text_fragment_shader - if (_glewStrSame3(&pos, &len, (const GLubyte*)"text_fragment_shader", 20)) - { - ret = GLEW_ATI_text_fragment_shader; - continue; - } -#endif -#ifdef GL_ATI_texture_compression_3dc - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_3dc", 23)) - { - ret = GLEW_ATI_texture_compression_3dc; - continue; - } -#endif -#ifdef GL_ATI_texture_env_combine3 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine3", 20)) - { - ret = GLEW_ATI_texture_env_combine3; - continue; - } -#endif -#ifdef GL_ATI_texture_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_float", 13)) - { - ret = GLEW_ATI_texture_float; - continue; - } -#endif -#ifdef GL_ATI_texture_mirror_once - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_once", 19)) - { - ret = GLEW_ATI_texture_mirror_once; - continue; - } -#endif -#ifdef GL_ATI_vertex_array_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) - { - ret = GLEW_ATI_vertex_array_object; - continue; - } -#endif -#ifdef GL_ATI_vertex_attrib_array_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_array_object", 26)) - { - ret = GLEW_ATI_vertex_attrib_array_object; - continue; - } -#endif -#ifdef GL_ATI_vertex_streams - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_streams", 14)) - { - ret = GLEW_ATI_vertex_streams; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) - { -#ifdef GL_EXT_422_pixels - if (_glewStrSame3(&pos, &len, (const GLubyte*)"422_pixels", 10)) - { - ret = GLEW_EXT_422_pixels; - continue; - } -#endif -#ifdef GL_EXT_Cg_shader - if (_glewStrSame3(&pos, &len, (const GLubyte*)"Cg_shader", 9)) - { - ret = GLEW_EXT_Cg_shader; - continue; - } -#endif -#ifdef GL_EXT_abgr - if (_glewStrSame3(&pos, &len, (const GLubyte*)"abgr", 4)) - { - ret = GLEW_EXT_abgr; - continue; - } -#endif -#ifdef GL_EXT_bgra - if (_glewStrSame3(&pos, &len, (const GLubyte*)"bgra", 4)) - { - ret = GLEW_EXT_bgra; - continue; - } -#endif -#ifdef GL_EXT_bindable_uniform - if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindable_uniform", 16)) - { - ret = GLEW_EXT_bindable_uniform; - continue; - } -#endif -#ifdef GL_EXT_blend_color - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_color", 11)) - { - ret = GLEW_EXT_blend_color; - continue; - } -#endif -#ifdef GL_EXT_blend_equation_separate - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_separate", 23)) - { - ret = GLEW_EXT_blend_equation_separate; - continue; - } -#endif -#ifdef GL_EXT_blend_func_separate - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_func_separate", 19)) - { - ret = GLEW_EXT_blend_func_separate; - continue; - } -#endif -#ifdef GL_EXT_blend_logic_op - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_logic_op", 14)) - { - ret = GLEW_EXT_blend_logic_op; - continue; - } -#endif -#ifdef GL_EXT_blend_minmax - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_minmax", 12)) - { - ret = GLEW_EXT_blend_minmax; - continue; - } -#endif -#ifdef GL_EXT_blend_subtract - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_subtract", 14)) - { - ret = GLEW_EXT_blend_subtract; - continue; - } -#endif -#ifdef GL_EXT_clip_volume_hint - if (_glewStrSame3(&pos, &len, (const GLubyte*)"clip_volume_hint", 16)) - { - ret = GLEW_EXT_clip_volume_hint; - continue; - } -#endif -#ifdef GL_EXT_cmyka - if (_glewStrSame3(&pos, &len, (const GLubyte*)"cmyka", 5)) - { - ret = GLEW_EXT_cmyka; - continue; - } -#endif -#ifdef GL_EXT_color_subtable - if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_subtable", 14)) - { - ret = GLEW_EXT_color_subtable; - continue; - } -#endif -#ifdef GL_EXT_compiled_vertex_array - if (_glewStrSame3(&pos, &len, (const GLubyte*)"compiled_vertex_array", 21)) - { - ret = GLEW_EXT_compiled_vertex_array; - continue; - } -#endif -#ifdef GL_EXT_convolution - if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution", 11)) - { - ret = GLEW_EXT_convolution; - continue; - } -#endif -#ifdef GL_EXT_coordinate_frame - if (_glewStrSame3(&pos, &len, (const GLubyte*)"coordinate_frame", 16)) - { - ret = GLEW_EXT_coordinate_frame; - continue; - } -#endif -#ifdef GL_EXT_copy_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_texture", 12)) - { - ret = GLEW_EXT_copy_texture; - continue; - } -#endif -#ifdef GL_EXT_cull_vertex - if (_glewStrSame3(&pos, &len, (const GLubyte*)"cull_vertex", 11)) - { - ret = GLEW_EXT_cull_vertex; - continue; - } -#endif -#ifdef GL_EXT_debug_label - if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_label", 11)) - { - ret = GLEW_EXT_debug_label; - continue; - } -#endif -#ifdef GL_EXT_debug_marker - if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_marker", 12)) - { - ret = GLEW_EXT_debug_marker; - continue; - } -#endif -#ifdef GL_EXT_depth_bounds_test - if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_bounds_test", 17)) - { - ret = GLEW_EXT_depth_bounds_test; - continue; - } -#endif -#ifdef GL_EXT_direct_state_access - if (_glewStrSame3(&pos, &len, (const GLubyte*)"direct_state_access", 19)) - { - ret = GLEW_EXT_direct_state_access; - continue; - } -#endif -#ifdef GL_EXT_draw_buffers2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers2", 13)) - { - ret = GLEW_EXT_draw_buffers2; - continue; - } -#endif -#ifdef GL_EXT_draw_instanced - if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_instanced", 14)) - { - ret = GLEW_EXT_draw_instanced; - continue; - } -#endif -#ifdef GL_EXT_draw_range_elements - if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_range_elements", 19)) - { - ret = GLEW_EXT_draw_range_elements; - continue; - } -#endif -#ifdef GL_EXT_fog_coord - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_coord", 9)) - { - ret = GLEW_EXT_fog_coord; - continue; - } -#endif -#ifdef GL_EXT_fragment_lighting - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_lighting", 17)) - { - ret = GLEW_EXT_fragment_lighting; - continue; - } -#endif -#ifdef GL_EXT_framebuffer_blit - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_blit", 16)) - { - ret = GLEW_EXT_framebuffer_blit; - continue; - } -#endif -#ifdef GL_EXT_framebuffer_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample", 23)) - { - ret = GLEW_EXT_framebuffer_multisample; - continue; - } -#endif -#ifdef GL_EXT_framebuffer_multisample_blit_scaled - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample_blit_scaled", 35)) - { - ret = GLEW_EXT_framebuffer_multisample_blit_scaled; - continue; - } -#endif -#ifdef GL_EXT_framebuffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_object", 18)) - { - ret = GLEW_EXT_framebuffer_object; - continue; - } -#endif -#ifdef GL_EXT_framebuffer_sRGB - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) - { - ret = GLEW_EXT_framebuffer_sRGB; - continue; - } -#endif -#ifdef GL_EXT_geometry_shader4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) - { - ret = GLEW_EXT_geometry_shader4; - continue; - } -#endif -#ifdef GL_EXT_gpu_program_parameters - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program_parameters", 22)) - { - ret = GLEW_EXT_gpu_program_parameters; - continue; - } -#endif -#ifdef GL_EXT_gpu_shader4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader4", 11)) - { - ret = GLEW_EXT_gpu_shader4; - continue; - } -#endif -#ifdef GL_EXT_histogram - if (_glewStrSame3(&pos, &len, (const GLubyte*)"histogram", 9)) - { - ret = GLEW_EXT_histogram; - continue; - } -#endif -#ifdef GL_EXT_index_array_formats - if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_array_formats", 19)) - { - ret = GLEW_EXT_index_array_formats; - continue; - } -#endif -#ifdef GL_EXT_index_func - if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_func", 10)) - { - ret = GLEW_EXT_index_func; - continue; - } -#endif -#ifdef GL_EXT_index_material - if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_material", 14)) - { - ret = GLEW_EXT_index_material; - continue; - } -#endif -#ifdef GL_EXT_index_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_texture", 13)) - { - ret = GLEW_EXT_index_texture; - continue; - } -#endif -#ifdef GL_EXT_light_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"light_texture", 13)) - { - ret = GLEW_EXT_light_texture; - continue; - } -#endif -#ifdef GL_EXT_misc_attribute - if (_glewStrSame3(&pos, &len, (const GLubyte*)"misc_attribute", 14)) - { - ret = GLEW_EXT_misc_attribute; - continue; - } -#endif -#ifdef GL_EXT_multi_draw_arrays - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_arrays", 17)) - { - ret = GLEW_EXT_multi_draw_arrays; - continue; - } -#endif -#ifdef GL_EXT_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) - { - ret = GLEW_EXT_multisample; - continue; - } -#endif -#ifdef GL_EXT_packed_depth_stencil - if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_depth_stencil", 20)) - { - ret = GLEW_EXT_packed_depth_stencil; - continue; - } -#endif -#ifdef GL_EXT_packed_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_float", 12)) - { - ret = GLEW_EXT_packed_float; - continue; - } -#endif -#ifdef GL_EXT_packed_pixels - if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_pixels", 13)) - { - ret = GLEW_EXT_packed_pixels; - continue; - } -#endif -#ifdef GL_EXT_paletted_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"paletted_texture", 16)) - { - ret = GLEW_EXT_paletted_texture; - continue; - } -#endif -#ifdef GL_EXT_pixel_buffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer_object", 19)) - { - ret = GLEW_EXT_pixel_buffer_object; - continue; - } -#endif -#ifdef GL_EXT_pixel_transform - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_transform", 15)) - { - ret = GLEW_EXT_pixel_transform; - continue; - } -#endif -#ifdef GL_EXT_pixel_transform_color_table - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_transform_color_table", 27)) - { - ret = GLEW_EXT_pixel_transform_color_table; - continue; - } -#endif -#ifdef GL_EXT_point_parameters - if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_parameters", 16)) - { - ret = GLEW_EXT_point_parameters; - continue; - } -#endif -#ifdef GL_EXT_polygon_offset - if (_glewStrSame3(&pos, &len, (const GLubyte*)"polygon_offset", 14)) - { - ret = GLEW_EXT_polygon_offset; - continue; - } -#endif -#ifdef GL_EXT_polygon_offset_clamp - if (_glewStrSame3(&pos, &len, (const GLubyte*)"polygon_offset_clamp", 20)) - { - ret = GLEW_EXT_polygon_offset_clamp; - continue; - } -#endif -#ifdef GL_EXT_post_depth_coverage - if (_glewStrSame3(&pos, &len, (const GLubyte*)"post_depth_coverage", 19)) - { - ret = GLEW_EXT_post_depth_coverage; - continue; - } -#endif -#ifdef GL_EXT_provoking_vertex - if (_glewStrSame3(&pos, &len, (const GLubyte*)"provoking_vertex", 16)) - { - ret = GLEW_EXT_provoking_vertex; - continue; - } -#endif -#ifdef GL_EXT_raster_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"raster_multisample", 18)) - { - ret = GLEW_EXT_raster_multisample; - continue; - } -#endif -#ifdef GL_EXT_rescale_normal - if (_glewStrSame3(&pos, &len, (const GLubyte*)"rescale_normal", 14)) - { - ret = GLEW_EXT_rescale_normal; - continue; - } -#endif -#ifdef GL_EXT_scene_marker - if (_glewStrSame3(&pos, &len, (const GLubyte*)"scene_marker", 12)) - { - ret = GLEW_EXT_scene_marker; - continue; - } -#endif -#ifdef GL_EXT_secondary_color - if (_glewStrSame3(&pos, &len, (const GLubyte*)"secondary_color", 15)) - { - ret = GLEW_EXT_secondary_color; - continue; - } -#endif -#ifdef GL_EXT_separate_shader_objects - if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_shader_objects", 23)) - { - ret = GLEW_EXT_separate_shader_objects; - continue; - } -#endif -#ifdef GL_EXT_separate_specular_color - if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_specular_color", 23)) - { - ret = GLEW_EXT_separate_specular_color; - continue; - } -#endif -#ifdef GL_EXT_shader_image_load_formatted - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_load_formatted", 27)) - { - ret = GLEW_EXT_shader_image_load_formatted; - continue; - } -#endif -#ifdef GL_EXT_shader_image_load_store - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_load_store", 23)) - { - ret = GLEW_EXT_shader_image_load_store; - continue; - } -#endif -#ifdef GL_EXT_shader_integer_mix - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_integer_mix", 18)) - { - ret = GLEW_EXT_shader_integer_mix; - continue; - } -#endif -#ifdef GL_EXT_shadow_funcs - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_funcs", 12)) - { - ret = GLEW_EXT_shadow_funcs; - continue; - } -#endif -#ifdef GL_EXT_shared_texture_palette - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shared_texture_palette", 22)) - { - ret = GLEW_EXT_shared_texture_palette; - continue; - } -#endif -#ifdef GL_EXT_sparse_texture2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture2", 15)) - { - ret = GLEW_EXT_sparse_texture2; - continue; - } -#endif -#ifdef GL_EXT_stencil_clear_tag - if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_clear_tag", 17)) - { - ret = GLEW_EXT_stencil_clear_tag; - continue; - } -#endif -#ifdef GL_EXT_stencil_two_side - if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_two_side", 16)) - { - ret = GLEW_EXT_stencil_two_side; - continue; - } -#endif -#ifdef GL_EXT_stencil_wrap - if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_wrap", 12)) - { - ret = GLEW_EXT_stencil_wrap; - continue; - } -#endif -#ifdef GL_EXT_subtexture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"subtexture", 10)) - { - ret = GLEW_EXT_subtexture; - continue; - } -#endif -#ifdef GL_EXT_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture", 7)) - { - ret = GLEW_EXT_texture; - continue; - } -#endif -#ifdef GL_EXT_texture3D - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture3D", 9)) - { - ret = GLEW_EXT_texture3D; - continue; - } -#endif -#ifdef GL_EXT_texture_array - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_array", 13)) - { - ret = GLEW_EXT_texture_array; - continue; - } -#endif -#ifdef GL_EXT_texture_buffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object", 21)) - { - ret = GLEW_EXT_texture_buffer_object; - continue; - } -#endif -#ifdef GL_EXT_texture_compression_dxt1 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt1", 24)) - { - ret = GLEW_EXT_texture_compression_dxt1; - continue; - } -#endif -#ifdef GL_EXT_texture_compression_latc - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_latc", 24)) - { - ret = GLEW_EXT_texture_compression_latc; - continue; - } -#endif -#ifdef GL_EXT_texture_compression_rgtc - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_rgtc", 24)) - { - ret = GLEW_EXT_texture_compression_rgtc; - continue; - } -#endif -#ifdef GL_EXT_texture_compression_s3tc - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_s3tc", 24)) - { - ret = GLEW_EXT_texture_compression_s3tc; - continue; - } -#endif -#ifdef GL_EXT_texture_cube_map - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map", 16)) - { - ret = GLEW_EXT_texture_cube_map; - continue; - } -#endif -#ifdef GL_EXT_texture_edge_clamp - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_edge_clamp", 18)) - { - ret = GLEW_EXT_texture_edge_clamp; - continue; - } -#endif -#ifdef GL_EXT_texture_env - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env", 11)) - { - ret = GLEW_EXT_texture_env; - continue; - } -#endif -#ifdef GL_EXT_texture_env_add - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_add", 15)) - { - ret = GLEW_EXT_texture_env_add; - continue; - } -#endif -#ifdef GL_EXT_texture_env_combine - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine", 19)) - { - ret = GLEW_EXT_texture_env_combine; - continue; - } -#endif -#ifdef GL_EXT_texture_env_dot3 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_dot3", 16)) - { - ret = GLEW_EXT_texture_env_dot3; - continue; - } -#endif -#ifdef GL_EXT_texture_filter_anisotropic - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter_anisotropic", 26)) - { - ret = GLEW_EXT_texture_filter_anisotropic; - continue; - } -#endif -#ifdef GL_EXT_texture_filter_minmax - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter_minmax", 21)) - { - ret = GLEW_EXT_texture_filter_minmax; - continue; - } -#endif -#ifdef GL_EXT_texture_integer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_integer", 15)) - { - ret = GLEW_EXT_texture_integer; - continue; - } -#endif -#ifdef GL_EXT_texture_lod_bias - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod_bias", 16)) - { - ret = GLEW_EXT_texture_lod_bias; - continue; - } -#endif -#ifdef GL_EXT_texture_mirror_clamp - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_clamp", 20)) - { - ret = GLEW_EXT_texture_mirror_clamp; - continue; - } -#endif -#ifdef GL_EXT_texture_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_object", 14)) - { - ret = GLEW_EXT_texture_object; - continue; - } -#endif -#ifdef GL_EXT_texture_perturb_normal - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_perturb_normal", 22)) - { - ret = GLEW_EXT_texture_perturb_normal; - continue; - } -#endif -#ifdef GL_EXT_texture_rectangle - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) - { - ret = GLEW_EXT_texture_rectangle; - continue; - } -#endif -#ifdef GL_EXT_texture_sRGB - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB", 12)) - { - ret = GLEW_EXT_texture_sRGB; - continue; - } -#endif -#ifdef GL_EXT_texture_sRGB_decode - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB_decode", 19)) - { - ret = GLEW_EXT_texture_sRGB_decode; - continue; - } -#endif -#ifdef GL_EXT_texture_shared_exponent - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shared_exponent", 23)) - { - ret = GLEW_EXT_texture_shared_exponent; - continue; - } -#endif -#ifdef GL_EXT_texture_snorm - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_snorm", 13)) - { - ret = GLEW_EXT_texture_snorm; - continue; - } -#endif -#ifdef GL_EXT_texture_swizzle - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_swizzle", 15)) - { - ret = GLEW_EXT_texture_swizzle; - continue; - } -#endif -#ifdef GL_EXT_timer_query - if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11)) - { - ret = GLEW_EXT_timer_query; - continue; - } -#endif -#ifdef GL_EXT_transform_feedback - if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback", 18)) - { - ret = GLEW_EXT_transform_feedback; - continue; - } -#endif -#ifdef GL_EXT_vertex_array - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array", 12)) - { - ret = GLEW_EXT_vertex_array; - continue; - } -#endif -#ifdef GL_EXT_vertex_array_bgra - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_bgra", 17)) - { - ret = GLEW_EXT_vertex_array_bgra; - continue; - } -#endif -#ifdef GL_EXT_vertex_attrib_64bit - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_64bit", 19)) - { - ret = GLEW_EXT_vertex_attrib_64bit; - continue; - } -#endif -#ifdef GL_EXT_vertex_shader - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader", 13)) - { - ret = GLEW_EXT_vertex_shader; - continue; - } -#endif -#ifdef GL_EXT_vertex_weighting - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_weighting", 16)) - { - ret = GLEW_EXT_vertex_weighting; - continue; - } -#endif -#ifdef GL_EXT_x11_sync_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"x11_sync_object", 15)) - { - ret = GLEW_EXT_x11_sync_object; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"GREMEDY_", 8)) - { -#ifdef GL_GREMEDY_frame_terminator - if (_glewStrSame3(&pos, &len, (const GLubyte*)"frame_terminator", 16)) - { - ret = GLEW_GREMEDY_frame_terminator; - continue; - } -#endif -#ifdef GL_GREMEDY_string_marker - if (_glewStrSame3(&pos, &len, (const GLubyte*)"string_marker", 13)) - { - ret = GLEW_GREMEDY_string_marker; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"HP_", 3)) - { -#ifdef GL_HP_convolution_border_modes - if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_border_modes", 24)) - { - ret = GLEW_HP_convolution_border_modes; - continue; - } -#endif -#ifdef GL_HP_image_transform - if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_transform", 15)) - { - ret = GLEW_HP_image_transform; - continue; - } -#endif -#ifdef GL_HP_occlusion_test - if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_test", 14)) - { - ret = GLEW_HP_occlusion_test; - continue; - } -#endif -#ifdef GL_HP_texture_lighting - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lighting", 16)) - { - ret = GLEW_HP_texture_lighting; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"IBM_", 4)) - { -#ifdef GL_IBM_cull_vertex - if (_glewStrSame3(&pos, &len, (const GLubyte*)"cull_vertex", 11)) - { - ret = GLEW_IBM_cull_vertex; - continue; - } -#endif -#ifdef GL_IBM_multimode_draw_arrays - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multimode_draw_arrays", 21)) - { - ret = GLEW_IBM_multimode_draw_arrays; - continue; - } -#endif -#ifdef GL_IBM_rasterpos_clip - if (_glewStrSame3(&pos, &len, (const GLubyte*)"rasterpos_clip", 14)) - { - ret = GLEW_IBM_rasterpos_clip; - continue; - } -#endif -#ifdef GL_IBM_static_data - if (_glewStrSame3(&pos, &len, (const GLubyte*)"static_data", 11)) - { - ret = GLEW_IBM_static_data; - continue; - } -#endif -#ifdef GL_IBM_texture_mirrored_repeat - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirrored_repeat", 23)) - { - ret = GLEW_IBM_texture_mirrored_repeat; - continue; - } -#endif -#ifdef GL_IBM_vertex_array_lists - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_lists", 18)) - { - ret = GLEW_IBM_vertex_array_lists; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"INGR_", 5)) - { -#ifdef GL_INGR_color_clamp - if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_clamp", 11)) - { - ret = GLEW_INGR_color_clamp; - continue; - } -#endif -#ifdef GL_INGR_interlace_read - if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace_read", 14)) - { - ret = GLEW_INGR_interlace_read; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"INTEL_", 6)) - { -#ifdef GL_INTEL_fragment_shader_ordering - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader_ordering", 24)) - { - ret = GLEW_INTEL_fragment_shader_ordering; - continue; - } -#endif -#ifdef GL_INTEL_framebuffer_CMAA - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_CMAA", 16)) - { - ret = GLEW_INTEL_framebuffer_CMAA; - continue; - } -#endif -#ifdef GL_INTEL_map_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_texture", 11)) - { - ret = GLEW_INTEL_map_texture; - continue; - } -#endif -#ifdef GL_INTEL_parallel_arrays - if (_glewStrSame3(&pos, &len, (const GLubyte*)"parallel_arrays", 15)) - { - ret = GLEW_INTEL_parallel_arrays; - continue; - } -#endif -#ifdef GL_INTEL_performance_query - if (_glewStrSame3(&pos, &len, (const GLubyte*)"performance_query", 17)) - { - ret = GLEW_INTEL_performance_query; - continue; - } -#endif -#ifdef GL_INTEL_texture_scissor - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_scissor", 15)) - { - ret = GLEW_INTEL_texture_scissor; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"KHR_", 4)) - { -#ifdef GL_KHR_blend_equation_advanced - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_advanced", 23)) - { - ret = GLEW_KHR_blend_equation_advanced; - continue; - } -#endif -#ifdef GL_KHR_blend_equation_advanced_coherent - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_advanced_coherent", 32)) - { - ret = GLEW_KHR_blend_equation_advanced_coherent; - continue; - } -#endif -#ifdef GL_KHR_context_flush_control - if (_glewStrSame3(&pos, &len, (const GLubyte*)"context_flush_control", 21)) - { - ret = GLEW_KHR_context_flush_control; - continue; - } -#endif -#ifdef GL_KHR_debug - if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug", 5)) - { - ret = GLEW_KHR_debug; - continue; - } -#endif -#ifdef GL_KHR_no_error - if (_glewStrSame3(&pos, &len, (const GLubyte*)"no_error", 8)) - { - ret = GLEW_KHR_no_error; - continue; - } -#endif -#ifdef GL_KHR_robust_buffer_access_behavior - if (_glewStrSame3(&pos, &len, (const GLubyte*)"robust_buffer_access_behavior", 29)) - { - ret = GLEW_KHR_robust_buffer_access_behavior; - continue; - } -#endif -#ifdef GL_KHR_robustness - if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness", 10)) - { - ret = GLEW_KHR_robustness; - continue; - } -#endif -#ifdef GL_KHR_texture_compression_astc_hdr - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_astc_hdr", 28)) - { - ret = GLEW_KHR_texture_compression_astc_hdr; - continue; - } -#endif -#ifdef GL_KHR_texture_compression_astc_ldr - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_astc_ldr", 28)) - { - ret = GLEW_KHR_texture_compression_astc_ldr; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"KTX_", 4)) - { -#ifdef GL_KTX_buffer_region - if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_region", 13)) - { - ret = GLEW_KTX_buffer_region; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESAX_", 6)) - { -#ifdef GL_MESAX_texture_stack - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_stack", 13)) - { - ret = GLEW_MESAX_texture_stack; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESA_", 5)) - { -#ifdef GL_MESA_pack_invert - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pack_invert", 11)) - { - ret = GLEW_MESA_pack_invert; - continue; - } -#endif -#ifdef GL_MESA_resize_buffers - if (_glewStrSame3(&pos, &len, (const GLubyte*)"resize_buffers", 14)) - { - ret = GLEW_MESA_resize_buffers; - continue; - } -#endif -#ifdef GL_MESA_window_pos - if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_pos", 10)) - { - ret = GLEW_MESA_window_pos; - continue; - } -#endif -#ifdef GL_MESA_ycbcr_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycbcr_texture", 13)) - { - ret = GLEW_MESA_ycbcr_texture; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"NVX_", 4)) - { -#ifdef GL_NVX_conditional_render - if (_glewStrSame3(&pos, &len, (const GLubyte*)"conditional_render", 18)) - { - ret = GLEW_NVX_conditional_render; - continue; - } -#endif -#ifdef GL_NVX_gpu_memory_info - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_memory_info", 15)) - { - ret = GLEW_NVX_gpu_memory_info; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) - { -#ifdef GL_NV_bindless_multi_draw_indirect - if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindless_multi_draw_indirect", 28)) - { - ret = GLEW_NV_bindless_multi_draw_indirect; - continue; - } -#endif -#ifdef GL_NV_bindless_multi_draw_indirect_count - if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindless_multi_draw_indirect_count", 34)) - { - ret = GLEW_NV_bindless_multi_draw_indirect_count; - continue; - } -#endif -#ifdef GL_NV_bindless_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindless_texture", 16)) - { - ret = GLEW_NV_bindless_texture; - continue; - } -#endif -#ifdef GL_NV_blend_equation_advanced - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_advanced", 23)) - { - ret = GLEW_NV_blend_equation_advanced; - continue; - } -#endif -#ifdef GL_NV_blend_equation_advanced_coherent - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_advanced_coherent", 32)) - { - ret = GLEW_NV_blend_equation_advanced_coherent; - continue; - } -#endif -#ifdef GL_NV_blend_square - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_square", 12)) - { - ret = GLEW_NV_blend_square; - continue; - } -#endif -#ifdef GL_NV_compute_program5 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"compute_program5", 16)) - { - ret = GLEW_NV_compute_program5; - continue; - } -#endif -#ifdef GL_NV_conditional_render - if (_glewStrSame3(&pos, &len, (const GLubyte*)"conditional_render", 18)) - { - ret = GLEW_NV_conditional_render; - continue; - } -#endif -#ifdef GL_NV_conservative_raster - if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_raster", 19)) - { - ret = GLEW_NV_conservative_raster; - continue; - } -#endif -#ifdef GL_NV_conservative_raster_dilate - if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_raster_dilate", 26)) - { - ret = GLEW_NV_conservative_raster_dilate; - continue; - } -#endif -#ifdef GL_NV_copy_depth_to_color - if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_depth_to_color", 19)) - { - ret = GLEW_NV_copy_depth_to_color; - continue; - } -#endif -#ifdef GL_NV_copy_image - if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) - { - ret = GLEW_NV_copy_image; - continue; - } -#endif -#ifdef GL_NV_deep_texture3D - if (_glewStrSame3(&pos, &len, (const GLubyte*)"deep_texture3D", 14)) - { - ret = GLEW_NV_deep_texture3D; - continue; - } -#endif -#ifdef GL_NV_depth_buffer_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_buffer_float", 18)) - { - ret = GLEW_NV_depth_buffer_float; - continue; - } -#endif -#ifdef GL_NV_depth_clamp - if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp", 11)) - { - ret = GLEW_NV_depth_clamp; - continue; - } -#endif -#ifdef GL_NV_depth_range_unclamped - if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_range_unclamped", 21)) - { - ret = GLEW_NV_depth_range_unclamped; - continue; - } -#endif -#ifdef GL_NV_draw_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_texture", 12)) - { - ret = GLEW_NV_draw_texture; - continue; - } -#endif -#ifdef GL_NV_evaluators - if (_glewStrSame3(&pos, &len, (const GLubyte*)"evaluators", 10)) - { - ret = GLEW_NV_evaluators; - continue; - } -#endif -#ifdef GL_NV_explicit_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_multisample", 20)) - { - ret = GLEW_NV_explicit_multisample; - continue; - } -#endif -#ifdef GL_NV_fence - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fence", 5)) - { - ret = GLEW_NV_fence; - continue; - } -#endif -#ifdef GL_NV_fill_rectangle - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fill_rectangle", 14)) - { - ret = GLEW_NV_fill_rectangle; - continue; - } -#endif -#ifdef GL_NV_float_buffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) - { - ret = GLEW_NV_float_buffer; - continue; - } -#endif -#ifdef GL_NV_fog_distance - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_distance", 12)) - { - ret = GLEW_NV_fog_distance; - continue; - } -#endif -#ifdef GL_NV_fragment_coverage_to_color - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_coverage_to_color", 26)) - { - ret = GLEW_NV_fragment_coverage_to_color; - continue; - } -#endif -#ifdef GL_NV_fragment_program - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program", 16)) - { - ret = GLEW_NV_fragment_program; - continue; - } -#endif -#ifdef GL_NV_fragment_program2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program2", 17)) - { - ret = GLEW_NV_fragment_program2; - continue; - } -#endif -#ifdef GL_NV_fragment_program4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program4", 17)) - { - ret = GLEW_NV_fragment_program4; - continue; - } -#endif -#ifdef GL_NV_fragment_program_option - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program_option", 23)) - { - ret = GLEW_NV_fragment_program_option; - continue; - } -#endif -#ifdef GL_NV_fragment_shader_interlock - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader_interlock", 25)) - { - ret = GLEW_NV_fragment_shader_interlock; - continue; - } -#endif -#ifdef GL_NV_framebuffer_mixed_samples - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_mixed_samples", 25)) - { - ret = GLEW_NV_framebuffer_mixed_samples; - continue; - } -#endif -#ifdef GL_NV_framebuffer_multisample_coverage - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample_coverage", 32)) - { - ret = GLEW_NV_framebuffer_multisample_coverage; - continue; - } -#endif -#ifdef GL_NV_geometry_program4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_program4", 17)) - { - ret = GLEW_NV_geometry_program4; - continue; - } -#endif -#ifdef GL_NV_geometry_shader4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) - { - ret = GLEW_NV_geometry_shader4; - continue; - } -#endif -#ifdef GL_NV_geometry_shader_passthrough - if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader_passthrough", 27)) - { - ret = GLEW_NV_geometry_shader_passthrough; - continue; - } -#endif -#ifdef GL_NV_gpu_program4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program4", 12)) - { - ret = GLEW_NV_gpu_program4; - continue; - } -#endif -#ifdef GL_NV_gpu_program5 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program5", 12)) - { - ret = GLEW_NV_gpu_program5; - continue; - } -#endif -#ifdef GL_NV_gpu_program5_mem_extended - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program5_mem_extended", 25)) - { - ret = GLEW_NV_gpu_program5_mem_extended; - continue; - } -#endif -#ifdef GL_NV_gpu_program_fp64 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program_fp64", 16)) - { - ret = GLEW_NV_gpu_program_fp64; - continue; - } -#endif -#ifdef GL_NV_gpu_shader5 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader5", 11)) - { - ret = GLEW_NV_gpu_shader5; - continue; - } -#endif -#ifdef GL_NV_half_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float", 10)) - { - ret = GLEW_NV_half_float; - continue; - } -#endif -#ifdef GL_NV_internalformat_sample_query - if (_glewStrSame3(&pos, &len, (const GLubyte*)"internalformat_sample_query", 27)) - { - ret = GLEW_NV_internalformat_sample_query; - continue; - } -#endif -#ifdef GL_NV_light_max_exponent - if (_glewStrSame3(&pos, &len, (const GLubyte*)"light_max_exponent", 18)) - { - ret = GLEW_NV_light_max_exponent; - continue; - } -#endif -#ifdef GL_NV_multisample_coverage - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) - { - ret = GLEW_NV_multisample_coverage; - continue; - } -#endif -#ifdef GL_NV_multisample_filter_hint - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_filter_hint", 23)) - { - ret = GLEW_NV_multisample_filter_hint; - continue; - } -#endif -#ifdef GL_NV_occlusion_query - if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query", 15)) - { - ret = GLEW_NV_occlusion_query; - continue; - } -#endif -#ifdef GL_NV_packed_depth_stencil - if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_depth_stencil", 20)) - { - ret = GLEW_NV_packed_depth_stencil; - continue; - } -#endif -#ifdef GL_NV_parameter_buffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"parameter_buffer_object", 23)) - { - ret = GLEW_NV_parameter_buffer_object; - continue; - } -#endif -#ifdef GL_NV_parameter_buffer_object2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"parameter_buffer_object2", 24)) - { - ret = GLEW_NV_parameter_buffer_object2; - continue; - } -#endif -#ifdef GL_NV_path_rendering - if (_glewStrSame3(&pos, &len, (const GLubyte*)"path_rendering", 14)) - { - ret = GLEW_NV_path_rendering; - continue; - } -#endif -#ifdef GL_NV_path_rendering_shared_edge - if (_glewStrSame3(&pos, &len, (const GLubyte*)"path_rendering_shared_edge", 26)) - { - ret = GLEW_NV_path_rendering_shared_edge; - continue; - } -#endif -#ifdef GL_NV_pixel_data_range - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_data_range", 16)) - { - ret = GLEW_NV_pixel_data_range; - continue; - } -#endif -#ifdef GL_NV_point_sprite - if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprite", 12)) - { - ret = GLEW_NV_point_sprite; - continue; - } -#endif -#ifdef GL_NV_present_video - if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) - { - ret = GLEW_NV_present_video; - continue; - } -#endif -#ifdef GL_NV_primitive_restart - if (_glewStrSame3(&pos, &len, (const GLubyte*)"primitive_restart", 17)) - { - ret = GLEW_NV_primitive_restart; - continue; - } -#endif -#ifdef GL_NV_register_combiners - if (_glewStrSame3(&pos, &len, (const GLubyte*)"register_combiners", 18)) - { - ret = GLEW_NV_register_combiners; - continue; - } -#endif -#ifdef GL_NV_register_combiners2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"register_combiners2", 19)) - { - ret = GLEW_NV_register_combiners2; - continue; - } -#endif -#ifdef GL_NV_sample_locations - if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_locations", 16)) - { - ret = GLEW_NV_sample_locations; - continue; - } -#endif -#ifdef GL_NV_sample_mask_override_coverage - if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_mask_override_coverage", 29)) - { - ret = GLEW_NV_sample_mask_override_coverage; - continue; - } -#endif -#ifdef GL_NV_shader_atomic_counters - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_counters", 22)) - { - ret = GLEW_NV_shader_atomic_counters; - continue; - } -#endif -#ifdef GL_NV_shader_atomic_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_float", 19)) - { - ret = GLEW_NV_shader_atomic_float; - continue; - } -#endif -#ifdef GL_NV_shader_atomic_fp16_vector - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_fp16_vector", 25)) - { - ret = GLEW_NV_shader_atomic_fp16_vector; - continue; - } -#endif -#ifdef GL_NV_shader_atomic_int64 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_int64", 19)) - { - ret = GLEW_NV_shader_atomic_int64; - continue; - } -#endif -#ifdef GL_NV_shader_buffer_load - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_buffer_load", 18)) - { - ret = GLEW_NV_shader_buffer_load; - continue; - } -#endif -#ifdef GL_NV_shader_storage_buffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_storage_buffer_object", 28)) - { - ret = GLEW_NV_shader_storage_buffer_object; - continue; - } -#endif -#ifdef GL_NV_shader_thread_group - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_thread_group", 19)) - { - ret = GLEW_NV_shader_thread_group; - continue; - } -#endif -#ifdef GL_NV_shader_thread_shuffle - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_thread_shuffle", 21)) - { - ret = GLEW_NV_shader_thread_shuffle; - continue; - } -#endif -#ifdef GL_NV_tessellation_program5 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"tessellation_program5", 21)) - { - ret = GLEW_NV_tessellation_program5; - continue; - } -#endif -#ifdef GL_NV_texgen_emboss - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texgen_emboss", 13)) - { - ret = GLEW_NV_texgen_emboss; - continue; - } -#endif -#ifdef GL_NV_texgen_reflection - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texgen_reflection", 17)) - { - ret = GLEW_NV_texgen_reflection; - continue; - } -#endif -#ifdef GL_NV_texture_barrier - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_barrier", 15)) - { - ret = GLEW_NV_texture_barrier; - continue; - } -#endif -#ifdef GL_NV_texture_compression_vtc - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_vtc", 23)) - { - ret = GLEW_NV_texture_compression_vtc; - continue; - } -#endif -#ifdef GL_NV_texture_env_combine4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine4", 20)) - { - ret = GLEW_NV_texture_env_combine4; - continue; - } -#endif -#ifdef GL_NV_texture_expand_normal - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_expand_normal", 21)) - { - ret = GLEW_NV_texture_expand_normal; - continue; - } -#endif -#ifdef GL_NV_texture_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multisample", 19)) - { - ret = GLEW_NV_texture_multisample; - continue; - } -#endif -#ifdef GL_NV_texture_rectangle - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) - { - ret = GLEW_NV_texture_rectangle; - continue; - } -#endif -#ifdef GL_NV_texture_shader - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader", 14)) - { - ret = GLEW_NV_texture_shader; - continue; - } -#endif -#ifdef GL_NV_texture_shader2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader2", 15)) - { - ret = GLEW_NV_texture_shader2; - continue; - } -#endif -#ifdef GL_NV_texture_shader3 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader3", 15)) - { - ret = GLEW_NV_texture_shader3; - continue; - } -#endif -#ifdef GL_NV_transform_feedback - if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback", 18)) - { - ret = GLEW_NV_transform_feedback; - continue; - } -#endif -#ifdef GL_NV_transform_feedback2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback2", 19)) - { - ret = GLEW_NV_transform_feedback2; - continue; - } -#endif -#ifdef GL_NV_uniform_buffer_unified_memory - if (_glewStrSame3(&pos, &len, (const GLubyte*)"uniform_buffer_unified_memory", 29)) - { - ret = GLEW_NV_uniform_buffer_unified_memory; - continue; - } -#endif -#ifdef GL_NV_vdpau_interop - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vdpau_interop", 13)) - { - ret = GLEW_NV_vdpau_interop; - continue; - } -#endif -#ifdef GL_NV_vertex_array_range - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) - { - ret = GLEW_NV_vertex_array_range; - continue; - } -#endif -#ifdef GL_NV_vertex_array_range2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range2", 19)) - { - ret = GLEW_NV_vertex_array_range2; - continue; - } -#endif -#ifdef GL_NV_vertex_attrib_integer_64bit - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_integer_64bit", 27)) - { - ret = GLEW_NV_vertex_attrib_integer_64bit; - continue; - } -#endif -#ifdef GL_NV_vertex_buffer_unified_memory - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_unified_memory", 28)) - { - ret = GLEW_NV_vertex_buffer_unified_memory; - continue; - } -#endif -#ifdef GL_NV_vertex_program - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program", 14)) - { - ret = GLEW_NV_vertex_program; - continue; - } -#endif -#ifdef GL_NV_vertex_program1_1 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program1_1", 17)) - { - ret = GLEW_NV_vertex_program1_1; - continue; - } -#endif -#ifdef GL_NV_vertex_program2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program2", 15)) - { - ret = GLEW_NV_vertex_program2; - continue; - } -#endif -#ifdef GL_NV_vertex_program2_option - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program2_option", 22)) - { - ret = GLEW_NV_vertex_program2_option; - continue; - } -#endif -#ifdef GL_NV_vertex_program3 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program3", 15)) - { - ret = GLEW_NV_vertex_program3; - continue; - } -#endif -#ifdef GL_NV_vertex_program4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program4", 15)) - { - ret = GLEW_NV_vertex_program4; - continue; - } -#endif -#ifdef GL_NV_video_capture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13)) - { - ret = GLEW_NV_video_capture; - continue; - } -#endif -#ifdef GL_NV_viewport_array2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"viewport_array2", 15)) - { - ret = GLEW_NV_viewport_array2; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"OES_", 4)) - { -#ifdef GL_OES_byte_coordinates - if (_glewStrSame3(&pos, &len, (const GLubyte*)"byte_coordinates", 16)) - { - ret = GLEW_OES_byte_coordinates; - continue; - } -#endif -#ifdef GL_OES_compressed_paletted_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_paletted_texture", 27)) - { - ret = GLEW_OES_compressed_paletted_texture; - continue; - } -#endif -#ifdef GL_OES_read_format - if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_format", 11)) - { - ret = GLEW_OES_read_format; - continue; - } -#endif -#ifdef GL_OES_single_precision - if (_glewStrSame3(&pos, &len, (const GLubyte*)"single_precision", 16)) - { - ret = GLEW_OES_single_precision; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) - { -#ifdef GL_OML_interlace - if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace", 9)) - { - ret = GLEW_OML_interlace; - continue; - } -#endif -#ifdef GL_OML_resample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"resample", 8)) - { - ret = GLEW_OML_resample; - continue; - } -#endif -#ifdef GL_OML_subsample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"subsample", 9)) - { - ret = GLEW_OML_subsample; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"OVR_", 4)) - { -#ifdef GL_OVR_multiview - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multiview", 9)) - { - ret = GLEW_OVR_multiview; - continue; - } -#endif -#ifdef GL_OVR_multiview2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multiview2", 10)) - { - ret = GLEW_OVR_multiview2; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"PGI_", 4)) - { -#ifdef GL_PGI_misc_hints - if (_glewStrSame3(&pos, &len, (const GLubyte*)"misc_hints", 10)) - { - ret = GLEW_PGI_misc_hints; - continue; - } -#endif -#ifdef GL_PGI_vertex_hints - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_hints", 12)) - { - ret = GLEW_PGI_vertex_hints; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"REGAL_", 6)) - { -#ifdef GL_REGAL_ES1_0_compatibility - if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES1_0_compatibility", 19)) - { - ret = GLEW_REGAL_ES1_0_compatibility; - continue; - } -#endif -#ifdef GL_REGAL_ES1_1_compatibility - if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES1_1_compatibility", 19)) - { - ret = GLEW_REGAL_ES1_1_compatibility; - continue; - } -#endif -#ifdef GL_REGAL_enable - if (_glewStrSame3(&pos, &len, (const GLubyte*)"enable", 6)) - { - ret = GLEW_REGAL_enable; - continue; - } -#endif -#ifdef GL_REGAL_error_string - if (_glewStrSame3(&pos, &len, (const GLubyte*)"error_string", 12)) - { - ret = GLEW_REGAL_error_string; - continue; - } -#endif -#ifdef GL_REGAL_extension_query - if (_glewStrSame3(&pos, &len, (const GLubyte*)"extension_query", 15)) - { - ret = GLEW_REGAL_extension_query; - continue; - } -#endif -#ifdef GL_REGAL_log - if (_glewStrSame3(&pos, &len, (const GLubyte*)"log", 3)) - { - ret = GLEW_REGAL_log; - continue; - } -#endif -#ifdef GL_REGAL_proc_address - if (_glewStrSame3(&pos, &len, (const GLubyte*)"proc_address", 12)) - { - ret = GLEW_REGAL_proc_address; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"REND_", 5)) - { -#ifdef GL_REND_screen_coordinates - if (_glewStrSame3(&pos, &len, (const GLubyte*)"screen_coordinates", 18)) - { - ret = GLEW_REND_screen_coordinates; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"S3_", 3)) - { -#ifdef GL_S3_s3tc - if (_glewStrSame3(&pos, &len, (const GLubyte*)"s3tc", 4)) - { - ret = GLEW_S3_s3tc; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIS_", 5)) - { -#ifdef GL_SGIS_color_range - if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_range", 11)) - { - ret = GLEW_SGIS_color_range; - continue; - } -#endif -#ifdef GL_SGIS_detail_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"detail_texture", 14)) - { - ret = GLEW_SGIS_detail_texture; - continue; - } -#endif -#ifdef GL_SGIS_fog_function - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_function", 12)) - { - ret = GLEW_SGIS_fog_function; - continue; - } -#endif -#ifdef GL_SGIS_generate_mipmap - if (_glewStrSame3(&pos, &len, (const GLubyte*)"generate_mipmap", 15)) - { - ret = GLEW_SGIS_generate_mipmap; - continue; - } -#endif -#ifdef GL_SGIS_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) - { - ret = GLEW_SGIS_multisample; - continue; - } -#endif -#ifdef GL_SGIS_pixel_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture", 13)) - { - ret = GLEW_SGIS_pixel_texture; - continue; - } -#endif -#ifdef GL_SGIS_point_line_texgen - if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_line_texgen", 17)) - { - ret = GLEW_SGIS_point_line_texgen; - continue; - } -#endif -#ifdef GL_SGIS_sharpen_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"sharpen_texture", 15)) - { - ret = GLEW_SGIS_sharpen_texture; - continue; - } -#endif -#ifdef GL_SGIS_texture4D - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture4D", 9)) - { - ret = GLEW_SGIS_texture4D; - continue; - } -#endif -#ifdef GL_SGIS_texture_border_clamp - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_border_clamp", 20)) - { - ret = GLEW_SGIS_texture_border_clamp; - continue; - } -#endif -#ifdef GL_SGIS_texture_edge_clamp - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_edge_clamp", 18)) - { - ret = GLEW_SGIS_texture_edge_clamp; - continue; - } -#endif -#ifdef GL_SGIS_texture_filter4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter4", 15)) - { - ret = GLEW_SGIS_texture_filter4; - continue; - } -#endif -#ifdef GL_SGIS_texture_lod - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod", 11)) - { - ret = GLEW_SGIS_texture_lod; - continue; - } -#endif -#ifdef GL_SGIS_texture_select - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_select", 14)) - { - ret = GLEW_SGIS_texture_select; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIX_", 5)) - { -#ifdef GL_SGIX_async - if (_glewStrSame3(&pos, &len, (const GLubyte*)"async", 5)) - { - ret = GLEW_SGIX_async; - continue; - } -#endif -#ifdef GL_SGIX_async_histogram - if (_glewStrSame3(&pos, &len, (const GLubyte*)"async_histogram", 15)) - { - ret = GLEW_SGIX_async_histogram; - continue; - } -#endif -#ifdef GL_SGIX_async_pixel - if (_glewStrSame3(&pos, &len, (const GLubyte*)"async_pixel", 11)) - { - ret = GLEW_SGIX_async_pixel; - continue; - } -#endif -#ifdef GL_SGIX_blend_alpha_minmax - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_alpha_minmax", 18)) - { - ret = GLEW_SGIX_blend_alpha_minmax; - continue; - } -#endif -#ifdef GL_SGIX_clipmap - if (_glewStrSame3(&pos, &len, (const GLubyte*)"clipmap", 7)) - { - ret = GLEW_SGIX_clipmap; - continue; - } -#endif -#ifdef GL_SGIX_convolution_accuracy - if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_accuracy", 20)) - { - ret = GLEW_SGIX_convolution_accuracy; - continue; - } -#endif -#ifdef GL_SGIX_depth_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13)) - { - ret = GLEW_SGIX_depth_texture; - continue; - } -#endif -#ifdef GL_SGIX_flush_raster - if (_glewStrSame3(&pos, &len, (const GLubyte*)"flush_raster", 12)) - { - ret = GLEW_SGIX_flush_raster; - continue; - } -#endif -#ifdef GL_SGIX_fog_offset - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_offset", 10)) - { - ret = GLEW_SGIX_fog_offset; - continue; - } -#endif -#ifdef GL_SGIX_fog_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_texture", 11)) - { - ret = GLEW_SGIX_fog_texture; - continue; - } -#endif -#ifdef GL_SGIX_fragment_specular_lighting - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_specular_lighting", 26)) - { - ret = GLEW_SGIX_fragment_specular_lighting; - continue; - } -#endif -#ifdef GL_SGIX_framezoom - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framezoom", 9)) - { - ret = GLEW_SGIX_framezoom; - continue; - } -#endif -#ifdef GL_SGIX_interlace - if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace", 9)) - { - ret = GLEW_SGIX_interlace; - continue; - } -#endif -#ifdef GL_SGIX_ir_instrument1 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"ir_instrument1", 14)) - { - ret = GLEW_SGIX_ir_instrument1; - continue; - } -#endif -#ifdef GL_SGIX_list_priority - if (_glewStrSame3(&pos, &len, (const GLubyte*)"list_priority", 13)) - { - ret = GLEW_SGIX_list_priority; - continue; - } -#endif -#ifdef GL_SGIX_pixel_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture", 13)) - { - ret = GLEW_SGIX_pixel_texture; - continue; - } -#endif -#ifdef GL_SGIX_pixel_texture_bits - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture_bits", 18)) - { - ret = GLEW_SGIX_pixel_texture_bits; - continue; - } -#endif -#ifdef GL_SGIX_reference_plane - if (_glewStrSame3(&pos, &len, (const GLubyte*)"reference_plane", 15)) - { - ret = GLEW_SGIX_reference_plane; - continue; - } -#endif -#ifdef GL_SGIX_resample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"resample", 8)) - { - ret = GLEW_SGIX_resample; - continue; - } -#endif -#ifdef GL_SGIX_shadow - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow", 6)) - { - ret = GLEW_SGIX_shadow; - continue; - } -#endif -#ifdef GL_SGIX_shadow_ambient - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_ambient", 14)) - { - ret = GLEW_SGIX_shadow_ambient; - continue; - } -#endif -#ifdef GL_SGIX_sprite - if (_glewStrSame3(&pos, &len, (const GLubyte*)"sprite", 6)) - { - ret = GLEW_SGIX_sprite; - continue; - } -#endif -#ifdef GL_SGIX_tag_sample_buffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"tag_sample_buffer", 17)) - { - ret = GLEW_SGIX_tag_sample_buffer; - continue; - } -#endif -#ifdef GL_SGIX_texture_add_env - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_add_env", 15)) - { - ret = GLEW_SGIX_texture_add_env; - continue; - } -#endif -#ifdef GL_SGIX_texture_coordinate_clamp - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_coordinate_clamp", 24)) - { - ret = GLEW_SGIX_texture_coordinate_clamp; - continue; - } -#endif -#ifdef GL_SGIX_texture_lod_bias - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod_bias", 16)) - { - ret = GLEW_SGIX_texture_lod_bias; - continue; - } -#endif -#ifdef GL_SGIX_texture_multi_buffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multi_buffer", 20)) - { - ret = GLEW_SGIX_texture_multi_buffer; - continue; - } -#endif -#ifdef GL_SGIX_texture_range - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_range", 13)) - { - ret = GLEW_SGIX_texture_range; - continue; - } -#endif -#ifdef GL_SGIX_texture_scale_bias - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_scale_bias", 18)) - { - ret = GLEW_SGIX_texture_scale_bias; - continue; - } -#endif -#ifdef GL_SGIX_vertex_preclip - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_preclip", 14)) - { - ret = GLEW_SGIX_vertex_preclip; - continue; - } -#endif -#ifdef GL_SGIX_vertex_preclip_hint - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_preclip_hint", 19)) - { - ret = GLEW_SGIX_vertex_preclip_hint; - continue; - } -#endif -#ifdef GL_SGIX_ycrcb - if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycrcb", 5)) - { - ret = GLEW_SGIX_ycrcb; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGI_", 4)) - { -#ifdef GL_SGI_color_matrix - if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_matrix", 12)) - { - ret = GLEW_SGI_color_matrix; - continue; - } -#endif -#ifdef GL_SGI_color_table - if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_table", 11)) - { - ret = GLEW_SGI_color_table; - continue; - } -#endif -#ifdef GL_SGI_texture_color_table - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_color_table", 19)) - { - ret = GLEW_SGI_texture_color_table; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUNX_", 5)) - { -#ifdef GL_SUNX_constant_data - if (_glewStrSame3(&pos, &len, (const GLubyte*)"constant_data", 13)) - { - ret = GLEW_SUNX_constant_data; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUN_", 4)) - { -#ifdef GL_SUN_convolution_border_modes - if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_border_modes", 24)) - { - ret = GLEW_SUN_convolution_border_modes; - continue; - } -#endif -#ifdef GL_SUN_global_alpha - if (_glewStrSame3(&pos, &len, (const GLubyte*)"global_alpha", 12)) - { - ret = GLEW_SUN_global_alpha; - continue; - } -#endif -#ifdef GL_SUN_mesh_array - if (_glewStrSame3(&pos, &len, (const GLubyte*)"mesh_array", 10)) - { - ret = GLEW_SUN_mesh_array; - continue; - } -#endif -#ifdef GL_SUN_read_video_pixels - if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_video_pixels", 17)) - { - ret = GLEW_SUN_read_video_pixels; - continue; - } -#endif -#ifdef GL_SUN_slice_accum - if (_glewStrSame3(&pos, &len, (const GLubyte*)"slice_accum", 11)) - { - ret = GLEW_SUN_slice_accum; - continue; - } -#endif -#ifdef GL_SUN_triangle_list - if (_glewStrSame3(&pos, &len, (const GLubyte*)"triangle_list", 13)) - { - ret = GLEW_SUN_triangle_list; - continue; - } -#endif -#ifdef GL_SUN_vertex - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex", 6)) - { - ret = GLEW_SUN_vertex; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"WIN_", 4)) - { -#ifdef GL_WIN_phong_shading - if (_glewStrSame3(&pos, &len, (const GLubyte*)"phong_shading", 13)) - { - ret = GLEW_WIN_phong_shading; - continue; - } -#endif -#ifdef GL_WIN_specular_fog - if (_glewStrSame3(&pos, &len, (const GLubyte*)"specular_fog", 12)) - { - ret = GLEW_WIN_specular_fog; - continue; - } -#endif -#ifdef GL_WIN_swap_hint - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_hint", 9)) - { - ret = GLEW_WIN_swap_hint; - continue; - } -#endif - } - } - ret = (len == 0); - } - return ret; -} - -#if defined(_WIN32) - -#if defined(GLEW_MX) -GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext* ctx, const char* name) -#else -GLboolean GLEWAPIENTRY wglewIsSupported (const char* name) -#endif -{ - const GLubyte* pos = (const GLubyte*)name; - GLuint len = _glewStrLen(pos); - GLboolean ret = GL_TRUE; - while (ret && len > 0) - { - if (_glewStrSame1(&pos, &len, (const GLubyte*)"WGL_", 4)) - { - if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) - { -#ifdef WGL_3DFX_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) - { - ret = WGLEW_3DFX_multisample; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DL_", 4)) - { -#ifdef WGL_3DL_stereo_control - if (_glewStrSame3(&pos, &len, (const GLubyte*)"stereo_control", 14)) - { - ret = WGLEW_3DL_stereo_control; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) - { -#ifdef WGL_AMD_gpu_association - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_association", 15)) - { - ret = WGLEW_AMD_gpu_association; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) - { -#ifdef WGL_ARB_buffer_region - if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_region", 13)) - { - ret = WGLEW_ARB_buffer_region; - continue; - } -#endif -#ifdef WGL_ARB_context_flush_control - if (_glewStrSame3(&pos, &len, (const GLubyte*)"context_flush_control", 21)) - { - ret = WGLEW_ARB_context_flush_control; - continue; - } -#endif -#ifdef WGL_ARB_create_context - if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context", 14)) - { - ret = WGLEW_ARB_create_context; - continue; - } -#endif -#ifdef WGL_ARB_create_context_profile - if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_profile", 22)) - { - ret = WGLEW_ARB_create_context_profile; - continue; - } -#endif -#ifdef WGL_ARB_create_context_robustness - if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_robustness", 25)) - { - ret = WGLEW_ARB_create_context_robustness; - continue; - } -#endif -#ifdef WGL_ARB_extensions_string - if (_glewStrSame3(&pos, &len, (const GLubyte*)"extensions_string", 17)) - { - ret = WGLEW_ARB_extensions_string; - continue; - } -#endif -#ifdef WGL_ARB_framebuffer_sRGB - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) - { - ret = WGLEW_ARB_framebuffer_sRGB; - continue; - } -#endif -#ifdef WGL_ARB_make_current_read - if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) - { - ret = WGLEW_ARB_make_current_read; - continue; - } -#endif -#ifdef WGL_ARB_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) - { - ret = WGLEW_ARB_multisample; - continue; - } -#endif -#ifdef WGL_ARB_pbuffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) - { - ret = WGLEW_ARB_pbuffer; - continue; - } -#endif -#ifdef WGL_ARB_pixel_format - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format", 12)) - { - ret = WGLEW_ARB_pixel_format; - continue; - } -#endif -#ifdef WGL_ARB_pixel_format_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) - { - ret = WGLEW_ARB_pixel_format_float; - continue; - } -#endif -#ifdef WGL_ARB_render_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture", 14)) - { - ret = WGLEW_ARB_render_texture; - continue; - } -#endif -#ifdef WGL_ARB_robustness_application_isolation - if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_application_isolation", 32)) - { - ret = WGLEW_ARB_robustness_application_isolation; - continue; - } -#endif -#ifdef WGL_ARB_robustness_share_group_isolation - if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_share_group_isolation", 32)) - { - ret = WGLEW_ARB_robustness_share_group_isolation; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) - { -#ifdef WGL_ATI_pixel_format_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) - { - ret = WGLEW_ATI_pixel_format_float; - continue; - } -#endif -#ifdef WGL_ATI_render_texture_rectangle - if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture_rectangle", 24)) - { - ret = WGLEW_ATI_render_texture_rectangle; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) - { -#ifdef WGL_EXT_create_context_es2_profile - if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es2_profile", 26)) - { - ret = WGLEW_EXT_create_context_es2_profile; - continue; - } -#endif -#ifdef WGL_EXT_create_context_es_profile - if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es_profile", 25)) - { - ret = WGLEW_EXT_create_context_es_profile; - continue; - } -#endif -#ifdef WGL_EXT_depth_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_float", 11)) - { - ret = WGLEW_EXT_depth_float; - continue; - } -#endif -#ifdef WGL_EXT_display_color_table - if (_glewStrSame3(&pos, &len, (const GLubyte*)"display_color_table", 19)) - { - ret = WGLEW_EXT_display_color_table; - continue; - } -#endif -#ifdef WGL_EXT_extensions_string - if (_glewStrSame3(&pos, &len, (const GLubyte*)"extensions_string", 17)) - { - ret = WGLEW_EXT_extensions_string; - continue; - } -#endif -#ifdef WGL_EXT_framebuffer_sRGB - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) - { - ret = WGLEW_EXT_framebuffer_sRGB; - continue; - } -#endif -#ifdef WGL_EXT_make_current_read - if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) - { - ret = WGLEW_EXT_make_current_read; - continue; - } -#endif -#ifdef WGL_EXT_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) - { - ret = WGLEW_EXT_multisample; - continue; - } -#endif -#ifdef WGL_EXT_pbuffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) - { - ret = WGLEW_EXT_pbuffer; - continue; - } -#endif -#ifdef WGL_EXT_pixel_format - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format", 12)) - { - ret = WGLEW_EXT_pixel_format; - continue; - } -#endif -#ifdef WGL_EXT_pixel_format_packed_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_packed_float", 25)) - { - ret = WGLEW_EXT_pixel_format_packed_float; - continue; - } -#endif -#ifdef WGL_EXT_swap_control - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) - { - ret = WGLEW_EXT_swap_control; - continue; - } -#endif -#ifdef WGL_EXT_swap_control_tear - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control_tear", 17)) - { - ret = WGLEW_EXT_swap_control_tear; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"I3D_", 4)) - { -#ifdef WGL_I3D_digital_video_control - if (_glewStrSame3(&pos, &len, (const GLubyte*)"digital_video_control", 21)) - { - ret = WGLEW_I3D_digital_video_control; - continue; - } -#endif -#ifdef WGL_I3D_gamma - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gamma", 5)) - { - ret = WGLEW_I3D_gamma; - continue; - } -#endif -#ifdef WGL_I3D_genlock - if (_glewStrSame3(&pos, &len, (const GLubyte*)"genlock", 7)) - { - ret = WGLEW_I3D_genlock; - continue; - } -#endif -#ifdef WGL_I3D_image_buffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_buffer", 12)) - { - ret = WGLEW_I3D_image_buffer; - continue; - } -#endif -#ifdef WGL_I3D_swap_frame_lock - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_frame_lock", 15)) - { - ret = WGLEW_I3D_swap_frame_lock; - continue; - } -#endif -#ifdef WGL_I3D_swap_frame_usage - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_frame_usage", 16)) - { - ret = WGLEW_I3D_swap_frame_usage; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) - { -#ifdef WGL_NV_DX_interop - if (_glewStrSame3(&pos, &len, (const GLubyte*)"DX_interop", 10)) - { - ret = WGLEW_NV_DX_interop; - continue; - } -#endif -#ifdef WGL_NV_DX_interop2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"DX_interop2", 11)) - { - ret = WGLEW_NV_DX_interop2; - continue; - } -#endif -#ifdef WGL_NV_copy_image - if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) - { - ret = WGLEW_NV_copy_image; - continue; - } -#endif -#ifdef WGL_NV_delay_before_swap - if (_glewStrSame3(&pos, &len, (const GLubyte*)"delay_before_swap", 17)) - { - ret = WGLEW_NV_delay_before_swap; - continue; - } -#endif -#ifdef WGL_NV_float_buffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) - { - ret = WGLEW_NV_float_buffer; - continue; - } -#endif -#ifdef WGL_NV_gpu_affinity - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_affinity", 12)) - { - ret = WGLEW_NV_gpu_affinity; - continue; - } -#endif -#ifdef WGL_NV_multisample_coverage - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) - { - ret = WGLEW_NV_multisample_coverage; - continue; - } -#endif -#ifdef WGL_NV_present_video - if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) - { - ret = WGLEW_NV_present_video; - continue; - } -#endif -#ifdef WGL_NV_render_depth_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_depth_texture", 20)) - { - ret = WGLEW_NV_render_depth_texture; - continue; - } -#endif -#ifdef WGL_NV_render_texture_rectangle - if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture_rectangle", 24)) - { - ret = WGLEW_NV_render_texture_rectangle; - continue; - } -#endif -#ifdef WGL_NV_swap_group - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) - { - ret = WGLEW_NV_swap_group; - continue; - } -#endif -#ifdef WGL_NV_vertex_array_range - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) - { - ret = WGLEW_NV_vertex_array_range; - continue; - } -#endif -#ifdef WGL_NV_video_capture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13)) - { - ret = WGLEW_NV_video_capture; - continue; - } -#endif -#ifdef WGL_NV_video_output - if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_output", 12)) - { - ret = WGLEW_NV_video_output; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) - { -#ifdef WGL_OML_sync_control - if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync_control", 12)) - { - ret = WGLEW_OML_sync_control; - continue; - } -#endif - } - } - ret = (len == 0); - } - return ret; -} - -#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__HAIKU__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX) - -#if defined(GLEW_MX) -GLboolean glxewContextIsSupported (const GLXEWContext* ctx, const char* name) -#else -GLboolean glxewIsSupported (const char* name) -#endif -{ - const GLubyte* pos = (const GLubyte*)name; - GLuint len = _glewStrLen(pos); - GLboolean ret = GL_TRUE; - while (ret && len > 0) - { - if(_glewStrSame1(&pos, &len, (const GLubyte*)"GLX_", 4)) - { - if (_glewStrSame2(&pos, &len, (const GLubyte*)"VERSION_", 8)) - { -#ifdef GLX_VERSION_1_2 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2", 3)) - { - ret = GLXEW_VERSION_1_2; - continue; - } -#endif -#ifdef GLX_VERSION_1_3 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_3", 3)) - { - ret = GLXEW_VERSION_1_3; - continue; - } -#endif -#ifdef GLX_VERSION_1_4 - if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_4", 3)) - { - ret = GLXEW_VERSION_1_4; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) - { -#ifdef GLX_3DFX_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) - { - ret = GLXEW_3DFX_multisample; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) - { -#ifdef GLX_AMD_gpu_association - if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_association", 15)) - { - ret = GLXEW_AMD_gpu_association; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) - { -#ifdef GLX_ARB_context_flush_control - if (_glewStrSame3(&pos, &len, (const GLubyte*)"context_flush_control", 21)) - { - ret = GLXEW_ARB_context_flush_control; - continue; - } -#endif -#ifdef GLX_ARB_create_context - if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context", 14)) - { - ret = GLXEW_ARB_create_context; - continue; - } -#endif -#ifdef GLX_ARB_create_context_profile - if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_profile", 22)) - { - ret = GLXEW_ARB_create_context_profile; - continue; - } -#endif -#ifdef GLX_ARB_create_context_robustness - if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_robustness", 25)) - { - ret = GLXEW_ARB_create_context_robustness; - continue; - } -#endif -#ifdef GLX_ARB_fbconfig_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig_float", 14)) - { - ret = GLXEW_ARB_fbconfig_float; - continue; - } -#endif -#ifdef GLX_ARB_framebuffer_sRGB - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) - { - ret = GLXEW_ARB_framebuffer_sRGB; - continue; - } -#endif -#ifdef GLX_ARB_get_proc_address - if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_proc_address", 16)) - { - ret = GLXEW_ARB_get_proc_address; - continue; - } -#endif -#ifdef GLX_ARB_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) - { - ret = GLXEW_ARB_multisample; - continue; - } -#endif -#ifdef GLX_ARB_robustness_application_isolation - if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_application_isolation", 32)) - { - ret = GLXEW_ARB_robustness_application_isolation; - continue; - } -#endif -#ifdef GLX_ARB_robustness_share_group_isolation - if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_share_group_isolation", 32)) - { - ret = GLXEW_ARB_robustness_share_group_isolation; - continue; - } -#endif -#ifdef GLX_ARB_vertex_buffer_object - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_object", 20)) - { - ret = GLXEW_ARB_vertex_buffer_object; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) - { -#ifdef GLX_ATI_pixel_format_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) - { - ret = GLXEW_ATI_pixel_format_float; - continue; - } -#endif -#ifdef GLX_ATI_render_texture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture", 14)) - { - ret = GLXEW_ATI_render_texture; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) - { -#ifdef GLX_EXT_buffer_age - if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_age", 10)) - { - ret = GLXEW_EXT_buffer_age; - continue; - } -#endif -#ifdef GLX_EXT_create_context_es2_profile - if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es2_profile", 26)) - { - ret = GLXEW_EXT_create_context_es2_profile; - continue; - } -#endif -#ifdef GLX_EXT_create_context_es_profile - if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es_profile", 25)) - { - ret = GLXEW_EXT_create_context_es_profile; - continue; - } -#endif -#ifdef GLX_EXT_fbconfig_packed_float - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig_packed_float", 21)) - { - ret = GLXEW_EXT_fbconfig_packed_float; - continue; - } -#endif -#ifdef GLX_EXT_framebuffer_sRGB - if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) - { - ret = GLXEW_EXT_framebuffer_sRGB; - continue; - } -#endif -#ifdef GLX_EXT_import_context - if (_glewStrSame3(&pos, &len, (const GLubyte*)"import_context", 14)) - { - ret = GLXEW_EXT_import_context; - continue; - } -#endif -#ifdef GLX_EXT_scene_marker - if (_glewStrSame3(&pos, &len, (const GLubyte*)"scene_marker", 12)) - { - ret = GLXEW_EXT_scene_marker; - continue; - } -#endif -#ifdef GLX_EXT_stereo_tree - if (_glewStrSame3(&pos, &len, (const GLubyte*)"stereo_tree", 11)) - { - ret = GLXEW_EXT_stereo_tree; - continue; - } -#endif -#ifdef GLX_EXT_swap_control - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) - { - ret = GLXEW_EXT_swap_control; - continue; - } -#endif -#ifdef GLX_EXT_swap_control_tear - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control_tear", 17)) - { - ret = GLXEW_EXT_swap_control_tear; - continue; - } -#endif -#ifdef GLX_EXT_texture_from_pixmap - if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_from_pixmap", 19)) - { - ret = GLXEW_EXT_texture_from_pixmap; - continue; - } -#endif -#ifdef GLX_EXT_visual_info - if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_info", 11)) - { - ret = GLXEW_EXT_visual_info; - continue; - } -#endif -#ifdef GLX_EXT_visual_rating - if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_rating", 13)) - { - ret = GLXEW_EXT_visual_rating; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"INTEL_", 6)) - { -#ifdef GLX_INTEL_swap_event - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_event", 10)) - { - ret = GLXEW_INTEL_swap_event; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESA_", 5)) - { -#ifdef GLX_MESA_agp_offset - if (_glewStrSame3(&pos, &len, (const GLubyte*)"agp_offset", 10)) - { - ret = GLXEW_MESA_agp_offset; - continue; - } -#endif -#ifdef GLX_MESA_copy_sub_buffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_sub_buffer", 15)) - { - ret = GLXEW_MESA_copy_sub_buffer; - continue; - } -#endif -#ifdef GLX_MESA_pixmap_colormap - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixmap_colormap", 15)) - { - ret = GLXEW_MESA_pixmap_colormap; - continue; - } -#endif -#ifdef GLX_MESA_query_renderer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"query_renderer", 14)) - { - ret = GLXEW_MESA_query_renderer; - continue; - } -#endif -#ifdef GLX_MESA_release_buffers - if (_glewStrSame3(&pos, &len, (const GLubyte*)"release_buffers", 15)) - { - ret = GLXEW_MESA_release_buffers; - continue; - } -#endif -#ifdef GLX_MESA_set_3dfx_mode - if (_glewStrSame3(&pos, &len, (const GLubyte*)"set_3dfx_mode", 13)) - { - ret = GLXEW_MESA_set_3dfx_mode; - continue; - } -#endif -#ifdef GLX_MESA_swap_control - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) - { - ret = GLXEW_MESA_swap_control; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) - { -#ifdef GLX_NV_copy_buffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_buffer", 11)) - { - ret = GLXEW_NV_copy_buffer; - continue; - } -#endif -#ifdef GLX_NV_copy_image - if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) - { - ret = GLXEW_NV_copy_image; - continue; - } -#endif -#ifdef GLX_NV_delay_before_swap - if (_glewStrSame3(&pos, &len, (const GLubyte*)"delay_before_swap", 17)) - { - ret = GLXEW_NV_delay_before_swap; - continue; - } -#endif -#ifdef GLX_NV_float_buffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) - { - ret = GLXEW_NV_float_buffer; - continue; - } -#endif -#ifdef GLX_NV_multisample_coverage - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) - { - ret = GLXEW_NV_multisample_coverage; - continue; - } -#endif -#ifdef GLX_NV_present_video - if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) - { - ret = GLXEW_NV_present_video; - continue; - } -#endif -#ifdef GLX_NV_swap_group - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) - { - ret = GLXEW_NV_swap_group; - continue; - } -#endif -#ifdef GLX_NV_vertex_array_range - if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) - { - ret = GLXEW_NV_vertex_array_range; - continue; - } -#endif -#ifdef GLX_NV_video_capture - if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13)) - { - ret = GLXEW_NV_video_capture; - continue; - } -#endif -#ifdef GLX_NV_video_out - if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_out", 9)) - { - ret = GLXEW_NV_video_out; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) - { -#ifdef GLX_OML_swap_method - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_method", 11)) - { - ret = GLXEW_OML_swap_method; - continue; - } -#endif -#ifdef GLX_OML_sync_control - if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync_control", 12)) - { - ret = GLXEW_OML_sync_control; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIS_", 5)) - { -#ifdef GLX_SGIS_blended_overlay - if (_glewStrSame3(&pos, &len, (const GLubyte*)"blended_overlay", 15)) - { - ret = GLXEW_SGIS_blended_overlay; - continue; - } -#endif -#ifdef GLX_SGIS_color_range - if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_range", 11)) - { - ret = GLXEW_SGIS_color_range; - continue; - } -#endif -#ifdef GLX_SGIS_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) - { - ret = GLXEW_SGIS_multisample; - continue; - } -#endif -#ifdef GLX_SGIS_shared_multisample - if (_glewStrSame3(&pos, &len, (const GLubyte*)"shared_multisample", 18)) - { - ret = GLXEW_SGIS_shared_multisample; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIX_", 5)) - { -#ifdef GLX_SGIX_fbconfig - if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig", 8)) - { - ret = GLXEW_SGIX_fbconfig; - continue; - } -#endif -#ifdef GLX_SGIX_hyperpipe - if (_glewStrSame3(&pos, &len, (const GLubyte*)"hyperpipe", 9)) - { - ret = GLXEW_SGIX_hyperpipe; - continue; - } -#endif -#ifdef GLX_SGIX_pbuffer - if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) - { - ret = GLXEW_SGIX_pbuffer; - continue; - } -#endif -#ifdef GLX_SGIX_swap_barrier - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_barrier", 12)) - { - ret = GLXEW_SGIX_swap_barrier; - continue; - } -#endif -#ifdef GLX_SGIX_swap_group - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) - { - ret = GLXEW_SGIX_swap_group; - continue; - } -#endif -#ifdef GLX_SGIX_video_resize - if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_resize", 12)) - { - ret = GLXEW_SGIX_video_resize; - continue; - } -#endif -#ifdef GLX_SGIX_visual_select_group - if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_select_group", 19)) - { - ret = GLXEW_SGIX_visual_select_group; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGI_", 4)) - { -#ifdef GLX_SGI_cushion - if (_glewStrSame3(&pos, &len, (const GLubyte*)"cushion", 7)) - { - ret = GLXEW_SGI_cushion; - continue; - } -#endif -#ifdef GLX_SGI_make_current_read - if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) - { - ret = GLXEW_SGI_make_current_read; - continue; - } -#endif -#ifdef GLX_SGI_swap_control - if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) - { - ret = GLXEW_SGI_swap_control; - continue; - } -#endif -#ifdef GLX_SGI_video_sync - if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_sync", 10)) - { - ret = GLXEW_SGI_video_sync; - continue; - } -#endif - } - if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUN_", 4)) - { -#ifdef GLX_SUN_get_transparent_index - if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_transparent_index", 21)) - { - ret = GLXEW_SUN_get_transparent_index; - continue; - } -#endif -#ifdef GLX_SUN_video_resize - if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_resize", 12)) - { - ret = GLXEW_SUN_video_resize; - continue; - } -#endif - } - } - ret = (len == 0); - } - return ret; -} - -#endif /* _WIN32 */ diff --git a/thirdparty/libpng/png.c b/thirdparty/libpng/png.c index 6d5633cc09..78ce39f46d 100644 --- a/thirdparty/libpng/png.c +++ b/thirdparty/libpng/png.c @@ -1,8 +1,8 @@ /* png.c - location for general purpose libpng functions * - * Last changed in libpng 1.6.26 [October 20, 2016] - * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson + * Last changed in libpng 1.6.28 [January 5, 2017] + * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -14,7 +14,7 @@ #include "pngpriv.h" /* Generate a compiler error if there is an old png.h in the search path. */ -typedef png_libpng_version_1_6_26 Your_png_h_is_not_version_1_6_26; +typedef png_libpng_version_1_6_28 Your_png_h_is_not_version_1_6_28; /* Tells libpng that we have already handled the first "num_bytes" bytes * of the PNG file signature. If the PNG data is embedded into another @@ -477,6 +477,7 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask, png_free(png_ptr, info_ptr->text); info_ptr->text = NULL; info_ptr->num_text = 0; + info_ptr->max_text = 0; } } #endif @@ -775,15 +776,15 @@ png_get_copyright(png_const_structrp png_ptr) #else # ifdef __STDC__ return PNG_STRING_NEWLINE \ - "libpng version 1.6.26 - October 20, 2016" PNG_STRING_NEWLINE \ - "Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson" \ + "libpng version 1.6.28 - January 5, 2017" PNG_STRING_NEWLINE \ + "Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson" \ PNG_STRING_NEWLINE \ "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ PNG_STRING_NEWLINE; # else - return "libpng version 1.6.26 - October 20, 2016\ - Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson\ + return "libpng version 1.6.28 - January 5, 2017\ + Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson\ Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."; # endif @@ -4259,11 +4260,11 @@ png_set_option(png_structrp png_ptr, int option, int onoff) if (png_ptr != NULL && option >= 0 && option < PNG_OPTION_NEXT && (option & 1) == 0) { - int mask = 3 << option; - int setting = (2 + (onoff != 0)) << option; - int current = png_ptr->options; + png_uint_32 mask = 3 << option; + png_uint_32 setting = (2 + (onoff != 0)) << option; + png_uint_32 current = png_ptr->options; - png_ptr->options = (png_byte)(((current & ~mask) | setting) & 0xff); + png_ptr->options = (png_uint_32)(((current & ~mask) | setting) & 0xff); return (current & mask) >> option; } diff --git a/thirdparty/libpng/png.h b/thirdparty/libpng/png.h index f0944631e0..e4cf032816 100644 --- a/thirdparty/libpng/png.h +++ b/thirdparty/libpng/png.h @@ -1,9 +1,9 @@ /* png.h - header file for PNG reference library * - * libpng version 1.6.26, October 20, 2016 + * libpng version 1.6.28, January 5, 2017 * - * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson + * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -12,7 +12,7 @@ * Authors and maintainers: * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger - * libpng versions 0.97, January 1998, through 1.6.26, October 20, 2016: + * libpng versions 0.97, January 1998, through 1.6.28, January 5, 2017: * Glenn Randers-Pehrson. * See also "Contributing Authors", below. */ @@ -25,12 +25,8 @@ * * This code is released under the libpng license. * - * Some files in the "contrib" directory and some configure-generated - * files that are distributed with libpng have other copyright owners and - * are released under other open source licenses. - * - * libpng versions 1.0.7, July 1, 2000 through 1.6.26, October 20, 2016 are - * Copyright (c) 2000-2002, 2004, 2006-2016 Glenn Randers-Pehrson, are + * libpng versions 1.0.7, July 1, 2000 through 1.6.28, January 5, 2017 are + * Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are * derived from libpng-1.0.6, and are distributed according to the same * disclaimer and license as libpng-1.0.6 with the following individuals * added to the list of Contributing Authors: @@ -52,10 +48,10 @@ * risk of satisfactory quality, performance, accuracy, and effort is with * the user. * - * Some files in the "contrib" directory have other copyright owners and + * Some files in the "contrib" directory and some configure-generated + * files that are distributed with libpng have other copyright owners and * are released under other open source licenses. * - * * libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are * Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from * libpng-0.96, and are distributed according to the same disclaimer and @@ -66,9 +62,6 @@ * Glenn Randers-Pehrson * Willem van Schaik * - * Some files in the "scripts" directory have different copyright owners - * but are also released under this license. - * * libpng versions 0.89, June 1996, through 0.96, May 1997, are * Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, * and are distributed according to the same disclaimer and license as @@ -214,11 +207,11 @@ * ... * 1.0.19 10 10019 10.so.0.19[.0] * ... - * 1.2.56 13 10256 12.so.0.56[.0] + * 1.2.57 13 10257 12.so.0.57[.0] * ... - * 1.5.27 15 10527 15.so.15.27[.0] + * 1.5.28 15 10527 15.so.15.28[.0] * ... - * 1.6.26 16 10626 16.so.16.26[.0] + * 1.6.28 16 10628 16.so.16.28[.0] * * Henceforth the source version will match the shared-library major * and minor numbers; the shared-library major version number will be @@ -246,13 +239,13 @@ * Y2K compliance in libpng: * ========================= * - * October 20, 2016 + * January 5, 2017 * * Since the PNG Development group is an ad-hoc body, we can't make * an official declaration. * * This is your unofficial assurance that libpng from version 0.71 and - * upward through 1.6.26 are Y2K compliant. It is my belief that + * upward through 1.6.28 are Y2K compliant. It is my belief that * earlier versions were also Y2K compliant. * * Libpng only has two year fields. One is a 2-byte unsigned integer @@ -314,8 +307,8 @@ */ /* Version information for png.h - this should match the version in png.c */ -#define PNG_LIBPNG_VER_STRING "1.6.26" -#define PNG_HEADER_VERSION_STRING " libpng version 1.6.26 - October 20, 2016\n" +#define PNG_LIBPNG_VER_STRING "1.6.28" +#define PNG_HEADER_VERSION_STRING " libpng version 1.6.28 - January 5, 2017\n" #define PNG_LIBPNG_VER_SONUM 16 #define PNG_LIBPNG_VER_DLLNUM 16 @@ -323,7 +316,7 @@ /* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */ #define PNG_LIBPNG_VER_MAJOR 1 #define PNG_LIBPNG_VER_MINOR 6 -#define PNG_LIBPNG_VER_RELEASE 26 +#define PNG_LIBPNG_VER_RELEASE 28 /* This should match the numeric part of the final component of * PNG_LIBPNG_VER_STRING, omitting any leading zero: @@ -354,7 +347,7 @@ * version 1.0.0 was mis-numbered 100 instead of 10000). From * version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release */ -#define PNG_LIBPNG_VER 10626 /* 1.6.26 */ +#define PNG_LIBPNG_VER 10628 /* 1.6.28 */ /* Library configuration: these options cannot be changed after * the library has been built. @@ -464,7 +457,7 @@ extern "C" { /* This triggers a compiler error in png.c, if png.c and png.h * do not agree upon the version number. */ -typedef char* png_libpng_version_1_6_26; +typedef char* png_libpng_version_1_6_28; /* Basic control structions. Read libpng-manual.txt or libpng.3 for more info. * @@ -3230,7 +3223,8 @@ PNG_EXPORT(245, int, png_image_write_to_memory, (png_imagep image, void *memory, #ifdef PNG_MIPS_MSA_API_SUPPORTED # define PNG_MIPS_MSA 6 /* HARDWARE: MIPS Msa SIMD instructions supported */ #endif -#define PNG_OPTION_NEXT 8 /* Next option - numbers must be even */ +#define PNG_IGNORE_ADLER32 8 +#define PNG_OPTION_NEXT 10 /* Next option - numbers must be even */ /* Return values: NOTE: there are four values and 'off' is *not* zero */ #define PNG_OPTION_UNSET 0 /* Unset - defaults to off */ diff --git a/thirdparty/libpng/pngconf.h b/thirdparty/libpng/pngconf.h index 5c891eb8b8..5e8b40bcfb 100644 --- a/thirdparty/libpng/pngconf.h +++ b/thirdparty/libpng/pngconf.h @@ -1,7 +1,7 @@ /* pngconf.h - machine configurable file for libpng * - * libpng version 1.6.26, October 20, 2016 + * libpng version 1.6.28, January 5, 2017 * * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) diff --git a/thirdparty/libpng/pnglibconf.h b/thirdparty/libpng/pnglibconf.h index ba7805ff59..ee70573605 100644 --- a/thirdparty/libpng/pnglibconf.h +++ b/thirdparty/libpng/pnglibconf.h @@ -1,8 +1,8 @@ -/* libpng 1.6.26 STANDARD API DEFINITION */ +/* libpng 1.6.28 STANDARD API DEFINITION */ /* pnglibconf.h - library build configuration */ -/* Libpng version 1.6.26 - October 20, 2016 */ +/* Libpng version 1.6.28 - January 5, 2017 */ /* Copyright (c) 1998-2015 Glenn Randers-Pehrson */ diff --git a/thirdparty/libpng/pngrutil.c b/thirdparty/libpng/pngrutil.c index fb5f5f083d..bee0ea1158 100644 --- a/thirdparty/libpng/pngrutil.c +++ b/thirdparty/libpng/pngrutil.c @@ -1,7 +1,7 @@ /* pngrutil.c - utilities to read a PNG file * - * Last changed in libpng 1.6.26 [October 20, 2016] + * Last changed in libpng 1.6.27 [January 5, 2017] * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -418,9 +418,10 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner) png_ptr->flags |= PNG_FLAG_ZSTREAM_INITIALIZED; } -#if ZLIB_VERNUM >= 0x1281 - /* Turn off validation of the ADLER32 checksum */ - if ((png_ptr->flags & PNG_FLAG_CRC_CRITICAL_IGNORE) != 0) +#if ZLIB_VERNUM >= 0x1281 && \ + defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_IGNORE_ADLER32) + if (((png_ptr->options >> PNG_IGNORE_ADLER32) & 3) == PNG_OPTION_ON) + /* Turn off validation of the ADLER32 checksum in IDAT chunks */ ret = inflateValidate(&png_ptr->zstream, 0); #endif @@ -716,7 +717,7 @@ png_decompress_chunk(png_structrp png_ptr, * the extra space may otherwise be used as a Trojan Horse. */ if (ret == Z_STREAM_END && - chunklength - prefix_size != lzsize) + chunklength - prefix_size != lzsize) png_chunk_benign_error(png_ptr, "extra compressed data"); } @@ -826,7 +827,7 @@ png_inflate_read(png_structrp png_ptr, png_bytep read_buffer, uInt read_size, return Z_STREAM_ERROR; } } -#endif +#endif /* READ_iCCP */ /* Read and check the IDHR chunk */ @@ -4107,15 +4108,7 @@ png_read_IDAT_data(png_structrp png_ptr, png_bytep output, png_zstream_error(png_ptr, ret); if (output != NULL) - { - if(!strncmp(png_ptr->zstream.msg,"incorrect data check",20)) - { - png_chunk_benign_error(png_ptr, "ADLER32 checksum mismatch"); - continue; - } - else - png_chunk_error(png_ptr, png_ptr->zstream.msg); - } + png_chunk_error(png_ptr, png_ptr->zstream.msg); else /* checking */ { diff --git a/thirdparty/libpng/pngstruct.h b/thirdparty/libpng/pngstruct.h index 55516eaaa1..749d7e35b1 100644 --- a/thirdparty/libpng/pngstruct.h +++ b/thirdparty/libpng/pngstruct.h @@ -1,8 +1,8 @@ /* pngstruct.h - header file for PNG reference library * - * Last changed in libpng 1.6.24 [August 4, 2016] - * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson + * Last changed in libpng 1.6.28 [January 5, 2017] + * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -353,7 +353,7 @@ struct png_struct_def /* Options */ #ifdef PNG_SET_OPTION_SUPPORTED - png_byte options; /* On/off state (up to 4 options) */ + png_uint_32 options; /* On/off state (up to 16 options) */ #endif #if PNG_LIBPNG_VER < 10700 diff --git a/thirdparty/libsimplewebm/OpusVorbisDecoder.cpp b/thirdparty/libsimplewebm/OpusVorbisDecoder.cpp index d7869f599b..06447aca57 100644 --- a/thirdparty/libsimplewebm/OpusVorbisDecoder.cpp +++ b/thirdparty/libsimplewebm/OpusVorbisDecoder.cpp @@ -43,16 +43,17 @@ struct VorbisDecoder OpusVorbisDecoder::OpusVorbisDecoder(const WebMDemuxer &demuxer) : m_vorbis(NULL), m_opus(NULL), - m_numSamples(0), - m_channels(demuxer.getChannels()) + m_numSamples(0) { switch (demuxer.getAudioCodec()) { case WebMDemuxer::AUDIO_VORBIS: + m_channels = demuxer.getChannels(); if (openVorbis(demuxer)) return; break; case WebMDemuxer::AUDIO_OPUS: + m_channels = demuxer.getChannels(); if (openOpus(demuxer)) return; break; diff --git a/thirdparty/libvpx/vpx_config.h b/thirdparty/libvpx/vpx_config.h index 7058f0327b..9ed45d4006 100644 --- a/thirdparty/libvpx/vpx_config.h +++ b/thirdparty/libvpx/vpx_config.h @@ -9,7 +9,11 @@ #ifndef VPX_CONFIG_H #define VPX_CONFIG_H #define RESTRICT -#define INLINE inline +#if defined(_MSC_VER) && (_MSC_VER < 1900) + #define INLINE __inline +#else + #define INLINE inline +#endif #define HAVE_MIPS32 0 #define HAVE_MEDIA 0 diff --git a/thirdparty/libwebp/dec/alpha.c b/thirdparty/libwebp/dec/alpha.c index 028eb3d50b..d88f01d8de 100644 --- a/thirdparty/libwebp/dec/alpha.c +++ b/thirdparty/libwebp/dec/alpha.c @@ -67,7 +67,7 @@ static int ALPHInit(ALPHDecoder* const dec, const uint8_t* data, } dec->method_ = (data[0] >> 0) & 0x03; - dec->filter_ = (data[0] >> 2) & 0x03; + dec->filter_ = (WEBP_FILTER_TYPE)((data[0] >> 2) & 0x03); dec->pre_processing_ = (data[0] >> 4) & 0x03; rsrv = (data[0] >> 6) & 0x03; if (dec->method_ < ALPHA_NO_COMPRESSION || diff --git a/thirdparty/libwebp/dec/vp8i.h b/thirdparty/libwebp/dec/vp8i.h index 00da02badc..313d8a7b94 100644 --- a/thirdparty/libwebp/dec/vp8i.h +++ b/thirdparty/libwebp/dec/vp8i.h @@ -32,7 +32,7 @@ extern "C" { // version numbers #define DEC_MAJ_VERSION 0 #define DEC_MIN_VERSION 5 -#define DEC_REV_VERSION 1 +#define DEC_REV_VERSION 2 // YUV-cache parameters. Cache is 32-bytes wide (= one cacheline). // Constraints are: We need to store one 16x16 block of luma samples (y), diff --git a/thirdparty/libwebp/demux/anim_decode.c b/thirdparty/libwebp/demux/anim_decode.c index 1989eb4ab4..f1cf176e72 100644 --- a/thirdparty/libwebp/demux/anim_decode.c +++ b/thirdparty/libwebp/demux/anim_decode.c @@ -112,18 +112,15 @@ WebPAnimDecoder* WebPAnimDecoderNewInternal( dec->info_.bgcolor = WebPDemuxGetI(dec->demux_, WEBP_FF_BACKGROUND_COLOR); dec->info_.frame_count = WebPDemuxGetI(dec->demux_, WEBP_FF_FRAME_COUNT); - { - const int canvas_bytes = - dec->info_.canvas_width * NUM_CHANNELS * dec->info_.canvas_height; - // Note: calloc() because we fill frame with zeroes as well. - dec->curr_frame_ = WebPSafeCalloc(1ULL, canvas_bytes); - if (dec->curr_frame_ == NULL) goto Error; - dec->prev_frame_disposed_ = WebPSafeCalloc(1ULL, canvas_bytes); - if (dec->prev_frame_disposed_ == NULL) goto Error; - } + // Note: calloc() because we fill frame with zeroes as well. + dec->curr_frame_ = (uint8_t*)WebPSafeCalloc( + dec->info_.canvas_width * NUM_CHANNELS, dec->info_.canvas_height); + if (dec->curr_frame_ == NULL) goto Error; + dec->prev_frame_disposed_ = (uint8_t*)WebPSafeCalloc( + dec->info_.canvas_width * NUM_CHANNELS, dec->info_.canvas_height); + if (dec->prev_frame_disposed_ == NULL) goto Error; WebPAnimDecoderReset(dec); - return dec; Error: @@ -144,9 +141,13 @@ static int IsFullFrame(int width, int height, int canvas_width, } // Clear the canvas to transparent. -static void ZeroFillCanvas(uint8_t* buf, uint32_t canvas_width, - uint32_t canvas_height) { - memset(buf, 0, canvas_width * NUM_CHANNELS * canvas_height); +static int ZeroFillCanvas(uint8_t* buf, uint32_t canvas_width, + uint32_t canvas_height) { + const uint64_t size = + (uint64_t)canvas_width * canvas_height * NUM_CHANNELS * sizeof(*buf); + if (size != (size_t)size) return 0; + memset(buf, 0, (size_t)size); + return 1; } // Clear given frame rectangle to transparent. @@ -162,10 +163,13 @@ static void ZeroFillFrameRect(uint8_t* buf, int buf_stride, int x_offset, } // Copy width * height pixels from 'src' to 'dst'. -static void CopyCanvas(const uint8_t* src, uint8_t* dst, - uint32_t width, uint32_t height) { +static int CopyCanvas(const uint8_t* src, uint8_t* dst, + uint32_t width, uint32_t height) { + const uint64_t size = (uint64_t)width * height * NUM_CHANNELS; + if (size != (size_t)size) return 0; assert(src != NULL && dst != NULL); - memcpy(dst, src, width * NUM_CHANNELS * height); + memcpy(dst, src, (size_t)size); + return 1; } // Returns true if the current frame is a key-frame. @@ -328,9 +332,14 @@ int WebPAnimDecoderGetNext(WebPAnimDecoder* dec, is_key_frame = IsKeyFrame(&iter, &dec->prev_iter_, dec->prev_frame_was_keyframe_, width, height); if (is_key_frame) { - ZeroFillCanvas(dec->curr_frame_, width, height); + if (!ZeroFillCanvas(dec->curr_frame_, width, height)) { + goto Error; + } } else { - CopyCanvas(dec->prev_frame_disposed_, dec->curr_frame_, width, height); + if (!CopyCanvas(dec->prev_frame_disposed_, dec->curr_frame_, + width, height)) { + goto Error; + } } // Decode. @@ -393,6 +402,7 @@ int WebPAnimDecoderGetNext(WebPAnimDecoder* dec, // Update info of the previous frame and dispose it for the next iteration. dec->prev_frame_timestamp_ = timestamp; + WebPDemuxReleaseIterator(&dec->prev_iter_); dec->prev_iter_ = iter; dec->prev_frame_was_keyframe_ = is_key_frame; CopyCanvas(dec->curr_frame_, dec->prev_frame_disposed_, width, height); @@ -421,6 +431,7 @@ int WebPAnimDecoderHasMoreFrames(const WebPAnimDecoder* dec) { void WebPAnimDecoderReset(WebPAnimDecoder* dec) { if (dec != NULL) { dec->prev_frame_timestamp_ = 0; + WebPDemuxReleaseIterator(&dec->prev_iter_); memset(&dec->prev_iter_, 0, sizeof(dec->prev_iter_)); dec->prev_frame_was_keyframe_ = 0; dec->next_frame_ = 1; @@ -434,6 +445,7 @@ const WebPDemuxer* WebPAnimDecoderGetDemuxer(const WebPAnimDecoder* dec) { void WebPAnimDecoderDelete(WebPAnimDecoder* dec) { if (dec != NULL) { + WebPDemuxReleaseIterator(&dec->prev_iter_); WebPDemuxDelete(dec->demux_); WebPSafeFree(dec->curr_frame_); WebPSafeFree(dec->prev_frame_disposed_); diff --git a/thirdparty/libwebp/demux/demux.c b/thirdparty/libwebp/demux/demux.c index 0d2989f6f4..1cb9bd5780 100644 --- a/thirdparty/libwebp/demux/demux.c +++ b/thirdparty/libwebp/demux/demux.c @@ -25,7 +25,7 @@ #define DMUX_MAJ_VERSION 0 #define DMUX_MIN_VERSION 3 -#define DMUX_REV_VERSION 0 +#define DMUX_REV_VERSION 1 typedef struct { size_t start_; // start location of the data diff --git a/thirdparty/libwebp/dsp/dec.c b/thirdparty/libwebp/dsp/dec.c index e92d693362..49bd16d976 100644 --- a/thirdparty/libwebp/dsp/dec.c +++ b/thirdparty/libwebp/dsp/dec.c @@ -239,7 +239,7 @@ VP8PredFunc VP8PredLuma16[NUM_B_DC_MODES]; //------------------------------------------------------------------------------ // 4x4 -#define AVG3(a, b, c) (((a) + 2 * (b) + (c) + 2) >> 2) +#define AVG3(a, b, c) ((uint8_t)(((a) + 2 * (b) + (c) + 2) >> 2)) #define AVG2(a, b) (((a) + (b) + 1) >> 1) static void VE4(uint8_t* dst) { // vertical diff --git a/thirdparty/libwebp/dsp/enc.c b/thirdparty/libwebp/dsp/enc.c index f639f5570c..db0e9e70ae 100644 --- a/thirdparty/libwebp/dsp/enc.c +++ b/thirdparty/libwebp/dsp/enc.c @@ -335,7 +335,7 @@ static void Intra16Preds(uint8_t* dst, // luma 4x4 prediction #define DST(x, y) dst[(x) + (y) * BPS] -#define AVG3(a, b, c) (((a) + 2 * (b) + (c) + 2) >> 2) +#define AVG3(a, b, c) ((uint8_t)(((a) + 2 * (b) + (c) + 2) >> 2)) #define AVG2(a, b) (((a) + (b) + 1) >> 1) static void VE4(uint8_t* dst, const uint8_t* top) { // vertical diff --git a/thirdparty/libwebp/dsp/rescaler.c b/thirdparty/libwebp/dsp/rescaler.c index bc743d5dc5..f5b07756cf 100644 --- a/thirdparty/libwebp/dsp/rescaler.c +++ b/thirdparty/libwebp/dsp/rescaler.c @@ -173,10 +173,10 @@ void WebPRescalerExportRow(WebPRescaler* const wrk) { WebPRescalerExportRowExpand(wrk); } else if (wrk->fxy_scale) { WebPRescalerExportRowShrink(wrk); - } else { // very special case for src = dst = 1x1 + } else { // special case int i; + assert(wrk->src_height == wrk->dst_height && wrk->x_add == 1); assert(wrk->src_width == 1 && wrk->dst_width <= 2); - assert(wrk->src_height == 1 && wrk->dst_height == 1); for (i = 0; i < wrk->num_channels * wrk->dst_width; ++i) { wrk->dst[i] = wrk->irow[i]; wrk->irow[i] = 0; diff --git a/thirdparty/libwebp/enc/analysis.c b/thirdparty/libwebp/enc/analysis.c index b55128fd48..136c331289 100644 --- a/thirdparty/libwebp/enc/analysis.c +++ b/thirdparty/libwebp/enc/analysis.c @@ -307,6 +307,7 @@ static int MBAnalyzeBestIntra4Mode(VP8EncIterator* const it, static int MBAnalyzeBestUVMode(VP8EncIterator* const it) { int best_alpha = DEFAULT_ALPHA; + int smallest_alpha = 0; int best_mode = 0; const int max_mode = MAX_UV_MODE; int mode; @@ -322,6 +323,10 @@ static int MBAnalyzeBestUVMode(VP8EncIterator* const it) { alpha = GetAlpha(&histo); if (IS_BETTER_ALPHA(alpha, best_alpha)) { best_alpha = alpha; + } + // The best prediction mode tends to be the one with the smallest alpha. + if (mode == 0 || alpha < smallest_alpha) { + smallest_alpha = alpha; best_mode = mode; } } diff --git a/thirdparty/libwebp/enc/cost.c b/thirdparty/libwebp/enc/cost.c index ae7fe01388..87f89378a7 100644 --- a/thirdparty/libwebp/enc/cost.c +++ b/thirdparty/libwebp/enc/cost.c @@ -281,18 +281,6 @@ int VP8GetCostUV(VP8EncIterator* const it, const VP8ModeScore* const rd) { //------------------------------------------------------------------------------ // Recording of token probabilities. -// Record proba context used -static int Record(int bit, proba_t* const stats) { - proba_t p = *stats; - if (p >= 0xffff0000u) { // an overflow is inbound. - p = ((p + 1u) >> 1) & 0x7fff7fffu; // -> divide the stats by 2. - } - // record bit count (lower 16 bits) and increment total count (upper 16 bits). - p += 0x00010000u + bit; - *stats = p; - return bit; -} - // We keep the table-free variant around for reference, in case. #define USE_LEVEL_CODE_TABLE @@ -303,31 +291,31 @@ int VP8RecordCoeffs(int ctx, const VP8Residual* const res) { // should be stats[VP8EncBands[n]], but it's equivalent for n=0 or 1 proba_t* s = res->stats[n][ctx]; if (res->last < 0) { - Record(0, s + 0); + VP8RecordStats(0, s + 0); return 0; } while (n <= res->last) { int v; - Record(1, s + 0); // order of record doesn't matter + VP8RecordStats(1, s + 0); // order of record doesn't matter while ((v = res->coeffs[n++]) == 0) { - Record(0, s + 1); + VP8RecordStats(0, s + 1); s = res->stats[VP8EncBands[n]][0]; } - Record(1, s + 1); - if (!Record(2u < (unsigned int)(v + 1), s + 2)) { // v = -1 or 1 + VP8RecordStats(1, s + 1); + if (!VP8RecordStats(2u < (unsigned int)(v + 1), s + 2)) { // v = -1 or 1 s = res->stats[VP8EncBands[n]][1]; } else { v = abs(v); #if !defined(USE_LEVEL_CODE_TABLE) - if (!Record(v > 4, s + 3)) { - if (Record(v != 2, s + 4)) - Record(v == 4, s + 5); - } else if (!Record(v > 10, s + 6)) { - Record(v > 6, s + 7); - } else if (!Record((v >= 3 + (8 << 2)), s + 8)) { - Record((v >= 3 + (8 << 1)), s + 9); + if (!VP8RecordStats(v > 4, s + 3)) { + if (VP8RecordStats(v != 2, s + 4)) + VP8RecordStats(v == 4, s + 5); + } else if (!VP8RecordStats(v > 10, s + 6)) { + VP8RecordStats(v > 6, s + 7); + } else if (!VP8RecordStats((v >= 3 + (8 << 2)), s + 8)) { + VP8RecordStats((v >= 3 + (8 << 1)), s + 9); } else { - Record((v >= 3 + (8 << 3)), s + 10); + VP8RecordStats((v >= 3 + (8 << 3)), s + 10); } #else if (v > MAX_VARIABLE_LEVEL) { @@ -340,14 +328,14 @@ int VP8RecordCoeffs(int ctx, const VP8Residual* const res) { int i; for (i = 0; (pattern >>= 1) != 0; ++i) { const int mask = 2 << i; - if (pattern & 1) Record(!!(bits & mask), s + 3 + i); + if (pattern & 1) VP8RecordStats(!!(bits & mask), s + 3 + i); } } #endif s = res->stats[VP8EncBands[n]][2]; } } - if (n < 16) Record(0, s + 0); + if (n < 16) VP8RecordStats(0, s + 0); return 1; } diff --git a/thirdparty/libwebp/enc/cost.h b/thirdparty/libwebp/enc/cost.h index 20960d6d74..ad7959feb4 100644 --- a/thirdparty/libwebp/enc/cost.h +++ b/thirdparty/libwebp/enc/cost.h @@ -41,6 +41,20 @@ void VP8InitResidual(int first, int coeff_type, int VP8RecordCoeffs(int ctx, const VP8Residual* const res); +// Record proba context used. +static WEBP_INLINE int VP8RecordStats(int bit, proba_t* const stats) { + proba_t p = *stats; + // An overflow is inbound. Note we handle this at 0xfffe0000u instead of + // 0xffff0000u to make sure p + 1u does not overflow. + if (p >= 0xfffe0000u) { + p = ((p + 1u) >> 1) & 0x7fff7fffu; // -> divide the stats by 2. + } + // record bit count (lower 16 bits) and increment total count (upper 16 bits). + p += 0x00010000u + bit; + *stats = p; + return bit; +} + // Cost of coding one event with probability 'proba'. static WEBP_INLINE int VP8BitCost(int bit, uint8_t proba) { return !bit ? VP8EntropyCost[proba] : VP8EntropyCost[255 - proba]; diff --git a/thirdparty/libwebp/enc/frame.c b/thirdparty/libwebp/enc/frame.c index 5b7a40b9ad..57fc471d17 100644 --- a/thirdparty/libwebp/enc/frame.c +++ b/thirdparty/libwebp/enc/frame.c @@ -185,6 +185,13 @@ static int GetProba(int a, int b) { : (255 * a + total / 2) / total; // rounded proba } +static void ResetSegments(VP8Encoder* const enc) { + int n; + for (n = 0; n < enc->mb_w_ * enc->mb_h_; ++n) { + enc->mb_info_[n].segment_ = 0; + } +} + static void SetSegmentProbas(VP8Encoder* const enc) { int p[NUM_MB_SEGMENTS] = { 0 }; int n; @@ -206,6 +213,7 @@ static void SetSegmentProbas(VP8Encoder* const enc) { enc->segment_hdr_.update_map_ = (probas[0] != 255) || (probas[1] != 255) || (probas[2] != 255); + if (!enc->segment_hdr_.update_map_) ResetSegments(enc); enc->segment_hdr_.size_ = p[0] * (VP8BitCost(0, probas[0]) + VP8BitCost(0, probas[1])) + p[1] * (VP8BitCost(0, probas[0]) + VP8BitCost(1, probas[1])) + @@ -406,9 +414,7 @@ static int RecordTokens(VP8EncIterator* const it, const VP8ModeScore* const rd, VP8InitResidual(0, 1, enc, &res); VP8SetResidualCoeffs(rd->y_dc_levels, &res); it->top_nz_[8] = it->left_nz_[8] = - VP8RecordCoeffTokens(ctx, 1, - res.first, res.last, res.coeffs, tokens); - VP8RecordCoeffs(ctx, &res); + VP8RecordCoeffTokens(ctx, &res, tokens); VP8InitResidual(1, 0, enc, &res); } else { VP8InitResidual(0, 3, enc, &res); @@ -420,9 +426,7 @@ static int RecordTokens(VP8EncIterator* const it, const VP8ModeScore* const rd, const int ctx = it->top_nz_[x] + it->left_nz_[y]; VP8SetResidualCoeffs(rd->y_ac_levels[x + y * 4], &res); it->top_nz_[x] = it->left_nz_[y] = - VP8RecordCoeffTokens(ctx, res.coeff_type, - res.first, res.last, res.coeffs, tokens); - VP8RecordCoeffs(ctx, &res); + VP8RecordCoeffTokens(ctx, &res, tokens); } } @@ -434,9 +438,7 @@ static int RecordTokens(VP8EncIterator* const it, const VP8ModeScore* const rd, const int ctx = it->top_nz_[4 + ch + x] + it->left_nz_[4 + ch + y]; VP8SetResidualCoeffs(rd->uv_levels[ch * 2 + x + y * 2], &res); it->top_nz_[4 + ch + x] = it->left_nz_[4 + ch + y] = - VP8RecordCoeffTokens(ctx, 2, - res.first, res.last, res.coeffs, tokens); - VP8RecordCoeffs(ctx, &res); + VP8RecordCoeffTokens(ctx, &res, tokens); } } } @@ -814,7 +816,7 @@ int VP8EncTokenLoop(VP8Encoder* const enc) { num_pass_left, stats.last_value, stats.value, stats.last_q, stats.q, stats.dq); #endif - if (size_p0 > PARTITION0_SIZE_LIMIT) { + if (enc->max_i4_header_bits_ > 0 && size_p0 > PARTITION0_SIZE_LIMIT) { ++num_pass_left; enc->max_i4_header_bits_ >>= 1; // strengthen header bit limitation... continue; // ...and start over diff --git a/thirdparty/libwebp/enc/histogram.c b/thirdparty/libwebp/enc/histogram.c index 395372b245..36b7f22625 100644 --- a/thirdparty/libwebp/enc/histogram.c +++ b/thirdparty/libwebp/enc/histogram.c @@ -592,8 +592,8 @@ static int HistoQueueInit(HistoQueue* const histo_queue, const int max_index) { histo_queue->max_size = max_index * max_index; // We allocate max_size + 1 because the last element at index "size" is // used as temporary data (and it could be up to max_size). - histo_queue->queue = WebPSafeMalloc(histo_queue->max_size + 1, - sizeof(*histo_queue->queue)); + histo_queue->queue = (HistogramPair*)WebPSafeMalloc( + histo_queue->max_size + 1, sizeof(*histo_queue->queue)); return histo_queue->queue != NULL; } @@ -659,7 +659,8 @@ static int HistogramCombineGreedy(VP8LHistogramSet* const image_histo) { int i, j; VP8LHistogram** const histograms = image_histo->histograms; // Indexes of remaining histograms. - int* const clusters = WebPSafeMalloc(image_histo_size, sizeof(*clusters)); + int* const clusters = + (int*)WebPSafeMalloc(image_histo_size, sizeof(*clusters)); // Priority queue of histogram pairs. HistoQueue histo_queue; diff --git a/thirdparty/libwebp/enc/picture.c b/thirdparty/libwebp/enc/picture.c index d9befbc47d..28c56cd6e5 100644 --- a/thirdparty/libwebp/enc/picture.c +++ b/thirdparty/libwebp/enc/picture.c @@ -88,8 +88,9 @@ int WebPPictureAllocARGB(WebPPicture* const picture, int width, int height) { } int WebPPictureAllocYUVA(WebPPicture* const picture, int width, int height) { - const WebPEncCSP uv_csp = picture->colorspace & WEBP_CSP_UV_MASK; - const int has_alpha = picture->colorspace & WEBP_CSP_ALPHA_BIT; + const WebPEncCSP uv_csp = + (WebPEncCSP)((int)picture->colorspace & WEBP_CSP_UV_MASK); + const int has_alpha = (int)picture->colorspace & WEBP_CSP_ALPHA_BIT; const int y_stride = width; const int uv_width = (width + 1) >> 1; const int uv_height = (height + 1) >> 1; diff --git a/thirdparty/libwebp/enc/picture_csp.c b/thirdparty/libwebp/enc/picture_csp.c index 607a6240b0..188a3ca55b 100644 --- a/thirdparty/libwebp/enc/picture_csp.c +++ b/thirdparty/libwebp/enc/picture_csp.c @@ -381,36 +381,42 @@ static WEBP_INLINE uint8_t ConvertRGBToV(int r, int g, int b) { return clip_8b(128 + (v >> (YUV_FIX + SFIX))); } -static int ConvertWRGBToYUV(const fixed_y_t* const best_y, - const fixed_t* const best_uv, +static int ConvertWRGBToYUV(const fixed_y_t* best_y, const fixed_t* best_uv, WebPPicture* const picture) { int i, j; + uint8_t* dst_y = picture->y; + uint8_t* dst_u = picture->u; + uint8_t* dst_v = picture->v; + const fixed_t* const best_uv_base = best_uv; const int w = (picture->width + 1) & ~1; const int h = (picture->height + 1) & ~1; const int uv_w = w >> 1; const int uv_h = h >> 1; - for (j = 0; j < picture->height; ++j) { + for (best_uv = best_uv_base, j = 0; j < picture->height; ++j) { for (i = 0; i < picture->width; ++i) { - const int off = 3 * ((i >> 1) + (j >> 1) * uv_w); - const int off2 = i + j * picture->y_stride; - const int W = best_y[i + j * w]; + const int off = 3 * (i >> 1); + const int W = best_y[i]; const int r = best_uv[off + 0] + W; const int g = best_uv[off + 1] + W; const int b = best_uv[off + 2] + W; - picture->y[off2] = ConvertRGBToY(r, g, b); + dst_y[i] = ConvertRGBToY(r, g, b); } + best_y += w; + best_uv += (j & 1) * 3 * uv_w; + dst_y += picture->y_stride; } - for (j = 0; j < uv_h; ++j) { - uint8_t* const dst_u = picture->u + j * picture->uv_stride; - uint8_t* const dst_v = picture->v + j * picture->uv_stride; + for (best_uv = best_uv_base, j = 0; j < uv_h; ++j) { for (i = 0; i < uv_w; ++i) { - const int off = 3 * (i + j * uv_w); + const int off = 3 * i; const int r = best_uv[off + 0]; const int g = best_uv[off + 1]; const int b = best_uv[off + 2]; dst_u[i] = ConvertRGBToU(r, g, b); dst_v[i] = ConvertRGBToV(r, g, b); } + best_uv += 3 * uv_w; + dst_u += picture->uv_stride; + dst_v += picture->uv_stride; } return 1; } @@ -420,9 +426,9 @@ static int ConvertWRGBToYUV(const fixed_y_t* const best_y, #define SAFE_ALLOC(W, H, T) ((T*)WebPSafeMalloc((W) * (H), sizeof(T))) -static int PreprocessARGB(const uint8_t* const r_ptr, - const uint8_t* const g_ptr, - const uint8_t* const b_ptr, +static int PreprocessARGB(const uint8_t* r_ptr, + const uint8_t* g_ptr, + const uint8_t* b_ptr, int step, int rgb_stride, WebPPicture* const picture) { // we expand the right/bottom border if needed @@ -435,20 +441,24 @@ static int PreprocessARGB(const uint8_t* const r_ptr, // TODO(skal): allocate one big memory chunk. But for now, it's easier // for valgrind debugging to have several chunks. fixed_y_t* const tmp_buffer = SAFE_ALLOC(w * 3, 2, fixed_y_t); // scratch - fixed_y_t* const best_y = SAFE_ALLOC(w, h, fixed_y_t); - fixed_y_t* const target_y = SAFE_ALLOC(w, h, fixed_y_t); + fixed_y_t* const best_y_base = SAFE_ALLOC(w, h, fixed_y_t); + fixed_y_t* const target_y_base = SAFE_ALLOC(w, h, fixed_y_t); fixed_y_t* const best_rgb_y = SAFE_ALLOC(w, 2, fixed_y_t); - fixed_t* const best_uv = SAFE_ALLOC(uv_w * 3, uv_h, fixed_t); - fixed_t* const target_uv = SAFE_ALLOC(uv_w * 3, uv_h, fixed_t); + fixed_t* const best_uv_base = SAFE_ALLOC(uv_w * 3, uv_h, fixed_t); + fixed_t* const target_uv_base = SAFE_ALLOC(uv_w * 3, uv_h, fixed_t); fixed_t* const best_rgb_uv = SAFE_ALLOC(uv_w * 3, 1, fixed_t); + fixed_y_t* best_y = best_y_base; + fixed_y_t* target_y = target_y_base; + fixed_t* best_uv = best_uv_base; + fixed_t* target_uv = target_uv_base; int ok; int diff_sum = 0; const int first_diff_threshold = (int)(2.5 * w * h); const int min_improvement = 5; // stop if improvement is below this % const int min_first_improvement = 80; - if (best_y == NULL || best_uv == NULL || - target_y == NULL || target_uv == NULL || + if (best_y_base == NULL || best_uv_base == NULL || + target_y_base == NULL || target_uv_base == NULL || best_rgb_y == NULL || best_rgb_uv == NULL || tmp_buffer == NULL) { ok = WebPEncodingSetError(picture, VP8_ENC_ERROR_OUT_OF_MEMORY); @@ -462,41 +472,47 @@ static int PreprocessARGB(const uint8_t* const r_ptr, const int is_last_row = (j == picture->height - 1); fixed_y_t* const src1 = tmp_buffer; fixed_y_t* const src2 = tmp_buffer + 3 * w; - const int off1 = j * rgb_stride; - const int off2 = off1 + rgb_stride; - const int uv_off = (j >> 1) * 3 * uv_w; - fixed_y_t* const dst_y = best_y + j * w; // prepare two rows of input - ImportOneRow(r_ptr + off1, g_ptr + off1, b_ptr + off1, - step, picture->width, src1); + ImportOneRow(r_ptr, g_ptr, b_ptr, step, picture->width, src1); if (!is_last_row) { - ImportOneRow(r_ptr + off2, g_ptr + off2, b_ptr + off2, + ImportOneRow(r_ptr + rgb_stride, g_ptr + rgb_stride, b_ptr + rgb_stride, step, picture->width, src2); } else { memcpy(src2, src1, 3 * w * sizeof(*src2)); } - UpdateW(src1, target_y + (j + 0) * w, w); - UpdateW(src2, target_y + (j + 1) * w, w); - diff_sum += UpdateChroma(src1, src2, target_uv + uv_off, dst_y, uv_w); - memcpy(best_uv + uv_off, target_uv + uv_off, 3 * uv_w * sizeof(*best_uv)); - memcpy(dst_y + w, dst_y, w * sizeof(*dst_y)); + UpdateW(src1, target_y, w); + UpdateW(src2, target_y + w, w); + diff_sum += UpdateChroma(src1, src2, target_uv, best_y, uv_w); + memcpy(best_uv, target_uv, 3 * uv_w * sizeof(*best_uv)); + memcpy(best_y + w, best_y, w * sizeof(*best_y)); + best_y += 2 * w; + best_uv += 3 * uv_w; + target_y += 2 * w; + target_uv += 3 * uv_w; + r_ptr += 2 * rgb_stride; + g_ptr += 2 * rgb_stride; + b_ptr += 2 * rgb_stride; } // Iterate and resolve clipping conflicts. for (iter = 0; iter < kNumIterations; ++iter) { int k; - const fixed_t* cur_uv = best_uv; - const fixed_t* prev_uv = best_uv; + const fixed_t* cur_uv = best_uv_base; + const fixed_t* prev_uv = best_uv_base; const int old_diff_sum = diff_sum; diff_sum = 0; + + best_y = best_y_base; + best_uv = best_uv_base; + target_y = target_y_base; + target_uv = target_uv_base; for (j = 0; j < h; j += 2) { fixed_y_t* const src1 = tmp_buffer; fixed_y_t* const src2 = tmp_buffer + 3 * w; { const fixed_t* const next_uv = cur_uv + ((j < h - 2) ? 3 * uv_w : 0); - InterpolateTwoRows(best_y + j * w, prev_uv, cur_uv, next_uv, - w, src1, src2); + InterpolateTwoRows(best_y, prev_uv, cur_uv, next_uv, w, src1, src2); prev_uv = cur_uv; cur_uv = next_uv; } @@ -507,16 +523,15 @@ static int PreprocessARGB(const uint8_t* const r_ptr, // update two rows of Y and one row of RGB for (i = 0; i < 2 * w; ++i) { - const int off = i + j * w; - const int diff_y = target_y[off] - best_rgb_y[i]; - const int new_y = (int)best_y[off] + diff_y; - best_y[off] = clip_y(new_y); + const int diff_y = target_y[i] - best_rgb_y[i]; + const int new_y = (int)best_y[i] + diff_y; + best_y[i] = clip_y(new_y); } for (i = 0; i < uv_w; ++i) { - const int off = 3 * (i + (j >> 1) * uv_w); + const int off = 3 * i; int W; for (k = 0; k <= 2; ++k) { - const int diff_uv = (int)target_uv[off + k] - best_rgb_uv[3 * i + k]; + const int diff_uv = (int)target_uv[off + k] - best_rgb_uv[off + k]; best_uv[off + k] += diff_uv; } W = RGBToGray(best_uv[off + 0], best_uv[off + 1], best_uv[off + 2]); @@ -524,6 +539,10 @@ static int PreprocessARGB(const uint8_t* const r_ptr, best_uv[off + k] -= W; } } + best_y += 2 * w; + best_uv += 3 * uv_w; + target_y += 2 * w; + target_uv += 3 * uv_w; } // test exit condition if (diff_sum > 0) { @@ -545,13 +564,13 @@ static int PreprocessARGB(const uint8_t* const r_ptr, } // final reconstruction - ok = ConvertWRGBToYUV(best_y, best_uv, picture); + ok = ConvertWRGBToYUV(best_y_base, best_uv_base, picture); End: - WebPSafeFree(best_y); - WebPSafeFree(best_uv); - WebPSafeFree(target_y); - WebPSafeFree(target_uv); + WebPSafeFree(best_y_base); + WebPSafeFree(best_uv_base); + WebPSafeFree(target_y_base); + WebPSafeFree(target_uv_base); WebPSafeFree(best_rgb_y); WebPSafeFree(best_rgb_uv); WebPSafeFree(tmp_buffer); @@ -830,10 +849,10 @@ static WEBP_INLINE void ConvertRowsToUV(const uint16_t* rgb, } } -static int ImportYUVAFromRGBA(const uint8_t* const r_ptr, - const uint8_t* const g_ptr, - const uint8_t* const b_ptr, - const uint8_t* const a_ptr, +static int ImportYUVAFromRGBA(const uint8_t* r_ptr, + const uint8_t* g_ptr, + const uint8_t* b_ptr, + const uint8_t* a_ptr, int step, // bytes per pixel int rgb_stride, // bytes per scanline float dithering, @@ -900,36 +919,34 @@ static int ImportYUVAFromRGBA(const uint8_t* const r_ptr, // Downsample Y/U/V planes, two rows at a time for (y = 0; y < (height >> 1); ++y) { int rows_have_alpha = has_alpha; - const int off1 = (2 * y + 0) * rgb_stride; - const int off2 = (2 * y + 1) * rgb_stride; if (use_dsp) { if (is_rgb) { - WebPConvertRGB24ToY(r_ptr + off1, dst_y, width); - WebPConvertRGB24ToY(r_ptr + off2, dst_y + picture->y_stride, width); + WebPConvertRGB24ToY(r_ptr, dst_y, width); + WebPConvertRGB24ToY(r_ptr + rgb_stride, + dst_y + picture->y_stride, width); } else { - WebPConvertBGR24ToY(b_ptr + off1, dst_y, width); - WebPConvertBGR24ToY(b_ptr + off2, dst_y + picture->y_stride, width); + WebPConvertBGR24ToY(b_ptr, dst_y, width); + WebPConvertBGR24ToY(b_ptr + rgb_stride, + dst_y + picture->y_stride, width); } } else { - ConvertRowToY(r_ptr + off1, g_ptr + off1, b_ptr + off1, step, - dst_y, width, rg); - ConvertRowToY(r_ptr + off2, g_ptr + off2, b_ptr + off2, step, + ConvertRowToY(r_ptr, g_ptr, b_ptr, step, dst_y, width, rg); + ConvertRowToY(r_ptr + rgb_stride, + g_ptr + rgb_stride, + b_ptr + rgb_stride, step, dst_y + picture->y_stride, width, rg); } dst_y += 2 * picture->y_stride; if (has_alpha) { - rows_have_alpha &= !WebPExtractAlpha(a_ptr + off1, rgb_stride, - width, 2, + rows_have_alpha &= !WebPExtractAlpha(a_ptr, rgb_stride, width, 2, dst_a, picture->a_stride); dst_a += 2 * picture->a_stride; } // Collect averaged R/G/B(/A) if (!rows_have_alpha) { - AccumulateRGB(r_ptr + off1, g_ptr + off1, b_ptr + off1, - step, rgb_stride, tmp_rgb, width); + AccumulateRGB(r_ptr, g_ptr, b_ptr, step, rgb_stride, tmp_rgb, width); } else { - AccumulateRGBA(r_ptr + off1, g_ptr + off1, b_ptr + off1, a_ptr + off1, - rgb_stride, tmp_rgb, width); + AccumulateRGBA(r_ptr, g_ptr, b_ptr, a_ptr, rgb_stride, tmp_rgb, width); } // Convert to U/V if (rg == NULL) { @@ -939,31 +956,33 @@ static int ImportYUVAFromRGBA(const uint8_t* const r_ptr, } dst_u += picture->uv_stride; dst_v += picture->uv_stride; + r_ptr += 2 * rgb_stride; + b_ptr += 2 * rgb_stride; + g_ptr += 2 * rgb_stride; + if (has_alpha) a_ptr += 2 * rgb_stride; } if (height & 1) { // extra last row - const int off = 2 * y * rgb_stride; int row_has_alpha = has_alpha; if (use_dsp) { if (r_ptr < b_ptr) { - WebPConvertRGB24ToY(r_ptr + off, dst_y, width); + WebPConvertRGB24ToY(r_ptr, dst_y, width); } else { - WebPConvertBGR24ToY(b_ptr + off, dst_y, width); + WebPConvertBGR24ToY(b_ptr, dst_y, width); } } else { - ConvertRowToY(r_ptr + off, g_ptr + off, b_ptr + off, step, - dst_y, width, rg); + ConvertRowToY(r_ptr, g_ptr, b_ptr, step, dst_y, width, rg); } if (row_has_alpha) { - row_has_alpha &= !WebPExtractAlpha(a_ptr + off, 0, width, 1, dst_a, 0); + row_has_alpha &= !WebPExtractAlpha(a_ptr, 0, width, 1, dst_a, 0); } // Collect averaged R/G/B(/A) if (!row_has_alpha) { // Collect averaged R/G/B - AccumulateRGB(r_ptr + off, g_ptr + off, b_ptr + off, - step, /* rgb_stride = */ 0, tmp_rgb, width); + AccumulateRGB(r_ptr, g_ptr, b_ptr, step, /* rgb_stride = */ 0, + tmp_rgb, width); } else { - AccumulateRGBA(r_ptr + off, g_ptr + off, b_ptr + off, a_ptr + off, - /* rgb_stride = */ 0, tmp_rgb, width); + AccumulateRGBA(r_ptr, g_ptr, b_ptr, a_ptr, /* rgb_stride = */ 0, + tmp_rgb, width); } if (rg == NULL) { WebPConvertRGBA32ToUV(tmp_rgb, dst_u, dst_v, uv_width); @@ -1086,10 +1105,10 @@ static int Import(WebPPicture* const picture, const uint8_t* const rgb, int rgb_stride, int step, int swap_rb, int import_alpha) { int y; - const uint8_t* const r_ptr = rgb + (swap_rb ? 2 : 0); - const uint8_t* const g_ptr = rgb + 1; - const uint8_t* const b_ptr = rgb + (swap_rb ? 0 : 2); - const uint8_t* const a_ptr = import_alpha ? rgb + 3 : NULL; + const uint8_t* r_ptr = rgb + (swap_rb ? 2 : 0); + const uint8_t* g_ptr = rgb + 1; + const uint8_t* b_ptr = rgb + (swap_rb ? 0 : 2); + const uint8_t* a_ptr = import_alpha ? rgb + 3 : NULL; const int width = picture->width; const int height = picture->height; @@ -1102,20 +1121,25 @@ static int Import(WebPPicture* const picture, VP8EncDspARGBInit(); if (import_alpha) { + uint32_t* dst = picture->argb; assert(step == 4); for (y = 0; y < height; ++y) { - uint32_t* const dst = &picture->argb[y * picture->argb_stride]; - const int offset = y * rgb_stride; - VP8PackARGB(a_ptr + offset, r_ptr + offset, g_ptr + offset, - b_ptr + offset, width, dst); + VP8PackARGB(a_ptr, r_ptr, g_ptr, b_ptr, width, dst); + a_ptr += rgb_stride; + r_ptr += rgb_stride; + g_ptr += rgb_stride; + b_ptr += rgb_stride; + dst += picture->argb_stride; } } else { + uint32_t* dst = picture->argb; assert(step >= 3); for (y = 0; y < height; ++y) { - uint32_t* const dst = &picture->argb[y * picture->argb_stride]; - const int offset = y * rgb_stride; - VP8PackRGB(r_ptr + offset, g_ptr + offset, b_ptr + offset, - width, step, dst); + VP8PackRGB(r_ptr, g_ptr, b_ptr, width, step, dst); + r_ptr += rgb_stride; + g_ptr += rgb_stride; + b_ptr += rgb_stride; + dst += picture->argb_stride; } } return 1; diff --git a/thirdparty/libwebp/enc/picture_psnr.c b/thirdparty/libwebp/enc/picture_psnr.c index 81ab1b5ca1..329757deb1 100644 --- a/thirdparty/libwebp/enc/picture_psnr.c +++ b/thirdparty/libwebp/enc/picture_psnr.c @@ -110,7 +110,7 @@ int WebPPictureDistortion(const WebPPicture* src, const WebPPicture* ref, VP8SSIMAccumulatePlane(tmp1, w, tmp2, w, w, h, &stats[c]); } } - free(tmp_plane); + WebPSafeFree(tmp_plane); } } else { int has_alpha, uv_w, uv_h; diff --git a/thirdparty/libwebp/enc/quant.c b/thirdparty/libwebp/enc/quant.c index 549ad26f93..07ffaf0aeb 100644 --- a/thirdparty/libwebp/enc/quant.c +++ b/thirdparty/libwebp/enc/quant.c @@ -278,7 +278,7 @@ static void SetupMatrices(VP8Encoder* enc) { CheckLambdaValue(&m->lambda_trellis_uv_); CheckLambdaValue(&m->tlambda_); - m->min_disto_ = 10 * m->y1_.q_[0]; // quantization-aware min disto + m->min_disto_ = 20 * m->y1_.q_[0]; // quantization-aware min disto m->max_edge_ = 0; m->i4_penalty_ = 1000 * q_i4 * q_i4; @@ -874,9 +874,9 @@ static void StoreMaxDelta(VP8SegmentInfo* const dqm, const int16_t DCs[16]) { // We look at the first three AC coefficients to determine what is the average // delta between each sub-4x4 block. const int v0 = abs(DCs[1]); - const int v1 = abs(DCs[4]); - const int v2 = abs(DCs[5]); - int max_v = (v0 > v1) ? v1 : v0; + const int v1 = abs(DCs[2]); + const int v2 = abs(DCs[4]); + int max_v = (v1 > v0) ? v1 : v0; max_v = (v2 > max_v) ? v2 : max_v; if (max_v > dqm->max_edge_) dqm->max_edge_ = max_v; } @@ -957,7 +957,7 @@ static void PickBestIntra16(VP8EncIterator* const it, VP8ModeScore* rd) { // we have a blocky macroblock (only DCs are non-zero) with fairly high // distortion, record max delta so we can later adjust the minimal filtering // strength needed to smooth these blocks out. - if ((rd->nz & 0xffff) == 0 && rd->D > dqm->min_disto_) { + if ((rd->nz & 0x100ffff) == 0x1000000 && rd->D > dqm->min_disto_) { StoreMaxDelta(dqm, rd->y_dc_levels); } } @@ -1155,7 +1155,8 @@ static void RefineUsingDistortion(VP8EncIterator* const it, const int lambda_d_uv = 120; score_t score_i4 = dqm->i4_penalty_; score_t i4_bit_sum = 0; - const score_t bit_limit = it->enc_->mb_header_limit_; + const score_t bit_limit = try_both_modes ? it->enc_->mb_header_limit_ + : MAX_COST; // no early-out allowed if (is_i16) { // First, evaluate Intra16 distortion int best_mode = -1; diff --git a/thirdparty/libwebp/enc/token.c b/thirdparty/libwebp/enc/token.c index e73256b37e..087940e5ff 100644 --- a/thirdparty/libwebp/enc/token.c +++ b/thirdparty/libwebp/enc/token.c @@ -87,14 +87,16 @@ static int TBufferNewPage(VP8TBuffer* const b) { #define TOKEN_ID(t, b, ctx) \ (NUM_PROBAS * ((ctx) + NUM_CTX * ((b) + NUM_BANDS * (t)))) -static WEBP_INLINE uint32_t AddToken(VP8TBuffer* const b, - uint32_t bit, uint32_t proba_idx) { +static WEBP_INLINE uint32_t AddToken(VP8TBuffer* const b, uint32_t bit, + uint32_t proba_idx, + proba_t* const stats) { assert(proba_idx < FIXED_PROBA_BIT); assert(bit <= 1); if (b->left_ > 0 || TBufferNewPage(b)) { const int slot = --b->left_; b->tokens_[slot] = (bit << 15) | proba_idx; } + VP8RecordStats(bit, stats); return bit; } @@ -108,13 +110,16 @@ static WEBP_INLINE void AddConstantToken(VP8TBuffer* const b, } } -int VP8RecordCoeffTokens(const int ctx, const int coeff_type, - int first, int last, - const int16_t* const coeffs, +int VP8RecordCoeffTokens(int ctx, const struct VP8Residual* const res, VP8TBuffer* const tokens) { - int n = first; + const int16_t* const coeffs = res->coeffs; + const int coeff_type = res->coeff_type; + const int last = res->last; + int n = res->first; uint32_t base_id = TOKEN_ID(coeff_type, n, ctx); - if (!AddToken(tokens, last >= 0, base_id + 0)) { + // should be stats[VP8EncBands[n]], but it's equivalent for n=0 or 1 + proba_t* s = res->stats[n][ctx]; + if (!AddToken(tokens, last >= 0, base_id + 0, s + 0)) { return 0; } @@ -122,18 +127,20 @@ int VP8RecordCoeffTokens(const int ctx, const int coeff_type, const int c = coeffs[n++]; const int sign = c < 0; const uint32_t v = sign ? -c : c; - if (!AddToken(tokens, v != 0, base_id + 1)) { + if (!AddToken(tokens, v != 0, base_id + 1, s + 1)) { base_id = TOKEN_ID(coeff_type, VP8EncBands[n], 0); // ctx=0 + s = res->stats[VP8EncBands[n]][0]; continue; } - if (!AddToken(tokens, v > 1, base_id + 2)) { + if (!AddToken(tokens, v > 1, base_id + 2, s + 2)) { base_id = TOKEN_ID(coeff_type, VP8EncBands[n], 1); // ctx=1 + s = res->stats[VP8EncBands[n]][1]; } else { - if (!AddToken(tokens, v > 4, base_id + 3)) { - if (AddToken(tokens, v != 2, base_id + 4)) - AddToken(tokens, v == 4, base_id + 5); - } else if (!AddToken(tokens, v > 10, base_id + 6)) { - if (!AddToken(tokens, v > 6, base_id + 7)) { + if (!AddToken(tokens, v > 4, base_id + 3, s + 3)) { + if (AddToken(tokens, v != 2, base_id + 4, s + 4)) + AddToken(tokens, v == 4, base_id + 5, s + 5); + } else if (!AddToken(tokens, v > 10, base_id + 6, s + 6)) { + if (!AddToken(tokens, v > 6, base_id + 7, s + 7)) { AddConstantToken(tokens, v == 6, 159); } else { AddConstantToken(tokens, v >= 9, 165); @@ -144,26 +151,26 @@ int VP8RecordCoeffTokens(const int ctx, const int coeff_type, const uint8_t* tab; uint32_t residue = v - 3; if (residue < (8 << 1)) { // VP8Cat3 (3b) - AddToken(tokens, 0, base_id + 8); - AddToken(tokens, 0, base_id + 9); + AddToken(tokens, 0, base_id + 8, s + 8); + AddToken(tokens, 0, base_id + 9, s + 9); residue -= (8 << 0); mask = 1 << 2; tab = VP8Cat3; } else if (residue < (8 << 2)) { // VP8Cat4 (4b) - AddToken(tokens, 0, base_id + 8); - AddToken(tokens, 1, base_id + 9); + AddToken(tokens, 0, base_id + 8, s + 8); + AddToken(tokens, 1, base_id + 9, s + 9); residue -= (8 << 1); mask = 1 << 3; tab = VP8Cat4; } else if (residue < (8 << 3)) { // VP8Cat5 (5b) - AddToken(tokens, 1, base_id + 8); - AddToken(tokens, 0, base_id + 10); + AddToken(tokens, 1, base_id + 8, s + 8); + AddToken(tokens, 0, base_id + 10, s + 9); residue -= (8 << 2); mask = 1 << 4; tab = VP8Cat5; } else { // VP8Cat6 (11b) - AddToken(tokens, 1, base_id + 8); - AddToken(tokens, 1, base_id + 10); + AddToken(tokens, 1, base_id + 8, s + 8); + AddToken(tokens, 1, base_id + 10, s + 9); residue -= (8 << 3); mask = 1 << 10; tab = VP8Cat6; @@ -174,9 +181,10 @@ int VP8RecordCoeffTokens(const int ctx, const int coeff_type, } } base_id = TOKEN_ID(coeff_type, VP8EncBands[n], 2); // ctx=2 + s = res->stats[VP8EncBands[n]][2]; } AddConstantToken(tokens, sign, 128); - if (n == 16 || !AddToken(tokens, n <= last, base_id + 0)) { + if (n == 16 || !AddToken(tokens, n <= last, base_id + 0, s + 0)) { return 1; // EOB } } diff --git a/thirdparty/libwebp/enc/vp8enci.h b/thirdparty/libwebp/enc/vp8enci.h index c1fbd7644e..5b4e162a58 100644 --- a/thirdparty/libwebp/enc/vp8enci.h +++ b/thirdparty/libwebp/enc/vp8enci.h @@ -32,7 +32,7 @@ extern "C" { // version numbers #define ENC_MAJ_VERSION 0 #define ENC_MIN_VERSION 5 -#define ENC_REV_VERSION 1 +#define ENC_REV_VERSION 2 enum { MAX_LF_LEVELS = 64, // Maximum loop filter level MAX_VARIABLE_LEVEL = 67, // last (inclusive) level with variable cost @@ -325,9 +325,7 @@ int VP8EmitTokens(VP8TBuffer* const b, VP8BitWriter* const bw, const uint8_t* const probas, int final_pass); // record the coding of coefficients without knowing the probabilities yet -int VP8RecordCoeffTokens(const int ctx, const int coeff_type, - int first, int last, - const int16_t* const coeffs, +int VP8RecordCoeffTokens(int ctx, const struct VP8Residual* const res, VP8TBuffer* const tokens); // Estimate the final coded size given a set of 'probas'. diff --git a/thirdparty/libwebp/enc/vp8l.c b/thirdparty/libwebp/enc/vp8l.c index c16e2560ec..e4ad2959b8 100644 --- a/thirdparty/libwebp/enc/vp8l.c +++ b/thirdparty/libwebp/enc/vp8l.c @@ -34,8 +34,8 @@ // Palette reordering for smaller sum of deltas (and for smaller storage). static int PaletteCompareColorsForQsort(const void* p1, const void* p2) { - const uint32_t a = WebPMemToUint32(p1); - const uint32_t b = WebPMemToUint32(p2); + const uint32_t a = WebPMemToUint32((uint8_t*)p1); + const uint32_t b = WebPMemToUint32((uint8_t*)p2); assert(a != b); return (a < b) ? -1 : 1; } @@ -224,9 +224,8 @@ static int AnalyzeEntropy(const uint32_t* argb, { double entropy_comp[kHistoTotal]; double entropy[kNumEntropyIx]; - EntropyIx k; - EntropyIx last_mode_to_analyze = - use_palette ? kPalette : kSpatialSubGreen; + int k; + int last_mode_to_analyze = use_palette ? kPalette : kSpatialSubGreen; int j; // Let's add one zero to the predicted histograms. The zeros are removed // too efficiently by the pix_diff == 0 comparison, at least one of the @@ -263,7 +262,7 @@ static int AnalyzeEntropy(const uint32_t* argb, *min_entropy_ix = kDirect; for (k = kDirect + 1; k <= last_mode_to_analyze; ++k) { if (entropy[*min_entropy_ix] > entropy[k]) { - *min_entropy_ix = k; + *min_entropy_ix = (EntropyIx)k; } } *red_and_blue_always_zero = 1; diff --git a/thirdparty/libwebp/mux/anim_encode.c b/thirdparty/libwebp/mux/anim_encode.c index 53e2906a82..398ba8d850 100644 --- a/thirdparty/libwebp/mux/anim_encode.c +++ b/thirdparty/libwebp/mux/anim_encode.c @@ -829,8 +829,8 @@ static WebPEncodingError GenerateCandidates( WebPPicture* const curr_canvas = &enc->curr_canvas_copy_; const WebPPicture* const prev_canvas = is_dispose_none ? &enc->prev_canvas_ : &enc->prev_canvas_disposed_; - int use_blending_ll; - int use_blending_lossy; + int use_blending_ll, use_blending_lossy; + int evaluate_ll, evaluate_lossy; CopyCurrentCanvas(enc); use_blending_ll = @@ -843,16 +843,19 @@ static WebPEncodingError GenerateCandidates( // Pick candidates to be tried. if (!enc->options_.allow_mixed) { - candidate_ll->evaluate_ = is_lossless; - candidate_lossy->evaluate_ = !is_lossless; + evaluate_ll = is_lossless; + evaluate_lossy = !is_lossless; + } else if (enc->options_.minimize_size) { + evaluate_ll = 1; + evaluate_lossy = 1; } else { // Use a heuristic for trying lossless and/or lossy compression. const int num_colors = WebPGetColorPalette(¶ms->sub_frame_ll_, NULL); - candidate_ll->evaluate_ = (num_colors < MAX_COLORS_LOSSLESS); - candidate_lossy->evaluate_ = (num_colors >= MIN_COLORS_LOSSY); + evaluate_ll = (num_colors < MAX_COLORS_LOSSLESS); + evaluate_lossy = (num_colors >= MIN_COLORS_LOSSY); } // Generate candidates. - if (candidate_ll->evaluate_) { + if (evaluate_ll) { CopyCurrentCanvas(enc); if (use_blending_ll) { enc->curr_canvas_copy_modified_ = @@ -862,7 +865,7 @@ static WebPEncodingError GenerateCandidates( config_ll, use_blending_ll, candidate_ll); if (error_code != VP8_ENC_OK) return error_code; } - if (candidate_lossy->evaluate_) { + if (evaluate_lossy) { CopyCurrentCanvas(enc); if (use_blending_lossy) { enc->curr_canvas_copy_modified_ = @@ -1029,6 +1032,8 @@ static WebPEncodingError SetFrame(WebPAnimEncoder* const enc, const WebPPicture* const prev_canvas = &enc->prev_canvas_; Candidate candidates[CANDIDATE_COUNT]; const int is_lossless = config->lossless; + const int consider_lossless = is_lossless || enc->options_.allow_mixed; + const int consider_lossy = !is_lossless || enc->options_.allow_mixed; const int is_first_frame = enc->is_first_frame_; // First frame cannot be skipped as there is no 'previous frame' to merge it @@ -1066,9 +1071,7 @@ static WebPEncodingError SetFrame(WebPAnimEncoder* const enc, return VP8_ENC_ERROR_INVALID_CONFIGURATION; } - for (i = 0; i < CANDIDATE_COUNT; ++i) { - candidates[i].evaluate_ = 0; - } + memset(candidates, 0, sizeof(candidates)); // Change-rectangle assuming previous frame was DISPOSE_NONE. if (!GetSubRects(prev_canvas, curr_canvas, is_key_frame, is_first_frame, @@ -1077,8 +1080,8 @@ static WebPEncodingError SetFrame(WebPAnimEncoder* const enc, goto Err; } - if ((is_lossless && IsEmptyRect(&dispose_none_params.rect_ll_)) || - (!is_lossless && IsEmptyRect(&dispose_none_params.rect_lossy_))) { + if ((consider_lossless && IsEmptyRect(&dispose_none_params.rect_ll_)) || + (consider_lossy && IsEmptyRect(&dispose_none_params.rect_lossy_))) { // Don't encode the frame at all. Instead, the duration of the previous // frame will be increased later. assert(empty_rect_allowed_none); @@ -1187,16 +1190,20 @@ static int CacheFrame(WebPAnimEncoder* const enc, enc->prev_candidate_undecided_ = 0; } else { int64_t curr_delta; + FrameRect prev_rect_key, prev_rect_sub; // Add this as a frame rectangle to enc. error_code = SetFrame(enc, config, 0, encoded_frame, &frame_skipped); if (error_code != VP8_ENC_OK) goto End; if (frame_skipped) goto Skip; + prev_rect_sub = enc->prev_rect_; + // Add this as a key-frame to enc, too. error_code = SetFrame(enc, config, 1, encoded_frame, &frame_skipped); if (error_code != VP8_ENC_OK) goto End; assert(frame_skipped == 0); // Key-frame cannot be an empty rectangle. + prev_rect_key = enc->prev_rect_; // Analyze size difference of the two variants. curr_delta = KeyFramePenalty(encoded_frame); @@ -1207,11 +1214,13 @@ static int CacheFrame(WebPAnimEncoder* const enc, old_keyframe->is_key_frame_ = 0; } encoded_frame->is_key_frame_ = 1; + enc->prev_candidate_undecided_ = 1; enc->keyframe_ = (int)position; enc->best_delta_ = curr_delta; enc->flush_count_ = enc->count_ - 1; // We can flush previous frames. } else { encoded_frame->is_key_frame_ = 0; + enc->prev_candidate_undecided_ = 0; } // Note: We need '>=' below because when kmin and kmax are both zero, // count_since_key_frame will always be > kmax. @@ -1221,7 +1230,10 @@ static int CacheFrame(WebPAnimEncoder* const enc, enc->keyframe_ = KEYFRAME_NONE; enc->best_delta_ = DELTA_INFINITY; } - enc->prev_candidate_undecided_ = 1; + if (!enc->prev_candidate_undecided_) { + enc->prev_rect_ = + encoded_frame->is_key_frame_ ? prev_rect_key : prev_rect_sub; + } } } diff --git a/thirdparty/libwebp/mux/muxi.h b/thirdparty/libwebp/mux/muxi.h index d4d5cbad91..b4865fe36f 100644 --- a/thirdparty/libwebp/mux/muxi.h +++ b/thirdparty/libwebp/mux/muxi.h @@ -28,7 +28,7 @@ extern "C" { #define MUX_MAJ_VERSION 0 #define MUX_MIN_VERSION 3 -#define MUX_REV_VERSION 1 +#define MUX_REV_VERSION 2 // Chunk object. typedef struct WebPChunk WebPChunk; diff --git a/thirdparty/libwebp/mux/muxinternal.c b/thirdparty/libwebp/mux/muxinternal.c index 4babbe82fc..372c6a9674 100644 --- a/thirdparty/libwebp/mux/muxinternal.c +++ b/thirdparty/libwebp/mux/muxinternal.c @@ -16,7 +16,7 @@ #include "./muxi.h" #include "../utils/utils.h" -#define UNDEFINED_CHUNK_SIZE (-1) +#define UNDEFINED_CHUNK_SIZE ((uint32_t)(-1)) const ChunkInfo kChunks[] = { { MKFOURCC('V', 'P', '8', 'X'), WEBP_CHUNK_VP8X, VP8X_CHUNK_SIZE }, @@ -439,7 +439,7 @@ static int IsNotCompatible(int feature, int num_items) { return (feature != 0) != (num_items > 0); } -#define NO_FLAG 0 +#define NO_FLAG ((WebPFeatureFlags)0) // Test basic constraints: // retrieval, maximum number of chunks by index (use -1 to skip) diff --git a/thirdparty/libwebp/utils/rescaler.c b/thirdparty/libwebp/utils/rescaler.c index 00c9300bfb..d2278a52ff 100644 --- a/thirdparty/libwebp/utils/rescaler.c +++ b/thirdparty/libwebp/utils/rescaler.c @@ -48,11 +48,15 @@ void WebPRescalerInit(WebPRescaler* const wrk, int src_width, int src_height, wrk->y_sub = wrk->y_expand ? y_sub - 1 : y_sub; wrk->y_accum = wrk->y_expand ? wrk->y_sub : wrk->y_add; if (!wrk->y_expand) { - // this is WEBP_RESCALER_FRAC(dst_height, x_add * y_add) without the cast. + // This is WEBP_RESCALER_FRAC(dst_height, x_add * y_add) without the cast. + // Its value is <= WEBP_RESCALER_ONE, because dst_height <= wrk->y_add, and + // wrk->x_add >= 1; const uint64_t ratio = (uint64_t)dst_height * WEBP_RESCALER_ONE / (wrk->x_add * wrk->y_add); if (ratio != (uint32_t)ratio) { - // We can't represent the ratio with the current fixed-point precision. + // When ratio == WEBP_RESCALER_ONE, we can't represent the ratio with the + // current fixed-point precision. This happens when src_height == + // wrk->y_add (which == src_height), and wrk->x_add == 1. // => We special-case fxy_scale = 0, in WebPRescalerExportRow(). wrk->fxy_scale = 0; } else { diff --git a/thirdparty/libwebp/utils/utils.c b/thirdparty/libwebp/utils/utils.c index 2602ca3c9f..82dbf8d5e5 100644 --- a/thirdparty/libwebp/utils/utils.c +++ b/thirdparty/libwebp/utils/utils.c @@ -175,8 +175,12 @@ static int CheckSizeArgumentsOverflow(uint64_t nmemb, size_t size) { } #endif #if defined(MALLOC_LIMIT) - if (mem_limit > 0 && total_mem + total_size >= mem_limit) { - return 0; // fake fail! + if (mem_limit > 0) { + const uint64_t new_total_mem = (uint64_t)total_mem + total_size; + if (new_total_mem != (size_t)new_total_mem || + new_total_mem > mem_limit) { + return 0; // fake fail! + } } #endif diff --git a/thirdparty/libwebp/utils/utils.h b/thirdparty/libwebp/utils/utils.h index e0a81126df..3a5d4e6a78 100644 --- a/thirdparty/libwebp/utils/utils.h +++ b/thirdparty/libwebp/utils/utils.h @@ -20,6 +20,7 @@ #endif #include <assert.h> +#include <limits.h> #include "../dsp/dsp.h" #include "../webp/types.h" @@ -32,7 +33,14 @@ extern "C" { // Memory allocation // This is the maximum memory amount that libwebp will ever try to allocate. -#define WEBP_MAX_ALLOCABLE_MEMORY (1ULL << 40) +#ifndef WEBP_MAX_ALLOCABLE_MEMORY +#if SIZE_MAX > (1ULL << 34) +#define WEBP_MAX_ALLOCABLE_MEMORY (1ULL << 34) +#else +// For 32-bit targets keep this below INT_MAX to avoid valgrind warnings. +#define WEBP_MAX_ALLOCABLE_MEMORY ((1ULL << 31) - (1 << 16)) +#endif +#endif // WEBP_MAX_ALLOCABLE_MEMORY // size-checking safe malloc/calloc: verify that the requested size is not too // large, or return NULL. You don't need to call these for constructs like diff --git a/thirdparty/libwebp/webp/decode.h b/thirdparty/libwebp/webp/decode.h index 7a3bed93a4..4c5e74ac36 100644 --- a/thirdparty/libwebp/webp/decode.h +++ b/thirdparty/libwebp/webp/decode.h @@ -248,19 +248,19 @@ typedef enum VP8StatusCode { // picture is only partially decoded, pending additional input. // Code example: // -// WebPInitDecBuffer(&buffer); -// buffer.colorspace = mode; +// WebPInitDecBuffer(&output_buffer); +// output_buffer.colorspace = mode; // ... -// WebPIDecoder* idec = WebPINewDecoder(&buffer); -// while (has_more_data) { -// // ... (get additional data) +// WebPIDecoder* idec = WebPINewDecoder(&output_buffer); +// while (additional_data_is_available) { +// // ... (get additional data in some new_data[] buffer) // status = WebPIAppend(idec, new_data, new_data_size); -// if (status != VP8_STATUS_SUSPENDED || -// break; +// if (status != VP8_STATUS_OK && status != VP8_STATUS_SUSPENDED) { +// break; // an error occurred. // } // // // The above call decodes the current available buffer. -// // Part of the image can now be refreshed by calling to +// // Part of the image can now be refreshed by calling // // WebPIDecGetRGB()/WebPIDecGetYUVA() etc. // } // WebPIDelete(idec); diff --git a/thirdparty/libwebp/webp/encode.h b/thirdparty/libwebp/webp/encode.h index 9291b7195c..b65e27e7fd 100644 --- a/thirdparty/libwebp/webp/encode.h +++ b/thirdparty/libwebp/webp/encode.h @@ -481,10 +481,10 @@ WEBP_EXTERN(int) WebPPictureARGBToYUVADithered( WEBP_EXTERN(int) WebPPictureSmartARGBToYUVA(WebPPicture* picture); // Converts picture->yuv to picture->argb and sets picture->use_argb to true. -// The input format must be YUV_420 or YUV_420A. -// Note that the use of this method is discouraged if one has access to the -// raw ARGB samples, since using YUV420 is comparatively lossy. Also, the -// conversion from YUV420 to ARGB incurs a small loss too. +// The input format must be YUV_420 or YUV_420A. The conversion from YUV420 to +// ARGB incurs a small loss too. +// Note that the use of this colorspace is discouraged if one has access to the +// raw ARGB samples, since using YUV420 is comparatively lossy. // Returns false in case of error. WEBP_EXTERN(int) WebPPictureYUVAToARGB(WebPPicture* picture); diff --git a/thirdparty/opus/COPYING b/thirdparty/opus/COPYING index 7b53d665df..9c739c34a3 100644 --- a/thirdparty/opus/COPYING +++ b/thirdparty/opus/COPYING @@ -1,4 +1,7 @@ -Copyright (c) 1994-2013 Xiph.Org Foundation and contributors +Copyright 2001-2011 Xiph.Org, Skype Limited, Octasic, + Jean-Marc Valin, Timothy B. Terriberry, + CSIRO, Gregory Maxwell, Mark Borgerding, + Erik de Castro Lopo Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -11,18 +14,31 @@ notice, this list of conditions and the following disclaimer. notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -- Neither the name of the Xiph.Org Foundation nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. +- Neither the name of Internet Society, IETF or IETF Trust, nor the +names of specific contributors, may be used to endorse or promote +products derived from this software without specific prior written +permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION -OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Opus is subject to the royalty-free patent licenses which are +specified at: + +Xiph.Org Foundation: +https://datatracker.ietf.org/ipr/1524/ + +Microsoft Corporation: +https://datatracker.ietf.org/ipr/1914/ + +Broadcom Corporation: +https://datatracker.ietf.org/ipr/1526/ diff --git a/thirdparty/opus/analysis.c b/thirdparty/opus/analysis.c index 360ebcc8dd..663431a436 100644 --- a/thirdparty/opus/analysis.c +++ b/thirdparty/opus/analysis.c @@ -540,17 +540,14 @@ static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode *celt /* Instantaneous probability of speech and music, with beta pre-applied. */ float speech0; float music0; + float p, q; /* One transition every 3 minutes of active audio */ tau = .00005f*frame_probs[1]; - beta = .05f; - if (1) { - /* Adapt beta based on how "unexpected" the new prob is */ - float p, q; - p = MAX16(.05f,MIN16(.95f,frame_probs[0])); - q = MAX16(.05f,MIN16(.95f,tonal->music_prob)); - beta = .01f+.05f*ABS16(p-q)/(p*(1-q)+q*(1-p)); - } + /* Adapt beta based on how "unexpected" the new prob is */ + p = MAX16(.05f,MIN16(.95f,frame_probs[0])); + q = MAX16(.05f,MIN16(.95f,tonal->music_prob)); + beta = .01f+.05f*ABS16(p-q)/(p*(1-q)+q*(1-p)); /* p0 and p1 are the probabilities of speech and music at this frame using only information from previous frame and applying the state transition model */ diff --git a/thirdparty/opus/http.c b/thirdparty/opus/http.c index cfd4e626a4..99fa8c08e0 100644 --- a/thirdparty/opus/http.c +++ b/thirdparty/opus/http.c @@ -231,7 +231,7 @@ typedef SOCKET op_sock; # define POLLRDBAND (0x0200) /*There is data to read.*/ # define POLLIN (POLLRDNORM|POLLRDBAND) -/* There is urgent data to read.*/ +/*There is urgent data to read.*/ # define POLLPRI (0x0400) /*Equivalent to POLLOUT.*/ # define POLLWRNORM (0x0010) @@ -894,7 +894,7 @@ static void op_http_stream_init(OpusHTTPStream *_stream){ /*Close the connection and move it to the free list. _stream: The stream containing the free list. _conn: The connection to close. - _penxt: The linked-list pointer currently pointing to this connection. + _pnext: The linked-list pointer currently pointing to this connection. _gracefully: Whether or not to shut down cleanly.*/ static void op_http_conn_close(OpusHTTPStream *_stream,OpusHTTPConn *_conn, OpusHTTPConn **_pnext,int _gracefully){ @@ -1517,10 +1517,17 @@ static long op_bio_retry_ctrl(BIO *_b,int _cmd,long _num,void *_ptr){ return ret; } +# if OPENSSL_VERSION_NUMBER<0x10100000L +# define BIO_set_data(_b,_ptr) ((_b)->ptr=(_ptr)) +# define BIO_set_init(_b,_init) ((_b)->init=(_init)) +# endif + static int op_bio_retry_new(BIO *_b){ - _b->init=1; + BIO_set_init(_b,1); +# if OPENSSL_VERSION_NUMBER<0x10100000L _b->num=0; - _b->ptr=NULL; +# endif + BIO_set_data(_b,NULL); return 1; } @@ -1528,6 +1535,7 @@ static int op_bio_retry_free(BIO *_b){ return _b!=NULL; } +# if OPENSSL_VERSION_NUMBER<0x10100000L /*This is not const because OpenSSL doesn't allow it, even though it won't write to it.*/ static BIO_METHOD op_bio_retry_method={ @@ -1542,11 +1550,15 @@ static BIO_METHOD op_bio_retry_method={ op_bio_retry_free, NULL }; +# endif /*Establish a CONNECT tunnel and pipeline the start of the TLS handshake for proxying https URL requests.*/ static int op_http_conn_establish_tunnel(OpusHTTPStream *_stream, OpusHTTPConn *_conn,op_sock _fd,SSL *_ssl_conn,BIO *_ssl_bio){ +# if OPENSSL_VERSION_NUMBER>=0x10100000L + BIO_METHOD *bio_retry_method; +# endif BIO *retry_bio; char *status_code; char *next; @@ -1557,13 +1569,32 @@ static int op_http_conn_establish_tunnel(OpusHTTPStream *_stream, ret=op_http_conn_write_fully(_conn, _stream->proxy_connect.buf,_stream->proxy_connect.nbuf); if(OP_UNLIKELY(ret<0))return ret; +# if OPENSSL_VERSION_NUMBER>=0x10100000L + bio_retry_method=BIO_meth_new(BIO_TYPE_NULL,"retry"); + if(bio_retry_method==NULL)return OP_EFAULT; + BIO_meth_set_write(bio_retry_method,op_bio_retry_write); + BIO_meth_set_read(bio_retry_method,op_bio_retry_read); + BIO_meth_set_puts(bio_retry_method,op_bio_retry_puts); + BIO_meth_set_ctrl(bio_retry_method,op_bio_retry_ctrl); + BIO_meth_set_create(bio_retry_method,op_bio_retry_new); + BIO_meth_set_destroy(bio_retry_method,op_bio_retry_free); + retry_bio=BIO_new(bio_retry_method); + if(OP_UNLIKELY(retry_bio==NULL)){ + BIO_meth_free(bio_retry_method); + return OP_EFAULT; + } +# else retry_bio=BIO_new(&op_bio_retry_method); if(OP_UNLIKELY(retry_bio==NULL))return OP_EFAULT; +# endif SSL_set_bio(_ssl_conn,retry_bio,_ssl_bio); SSL_set_connect_state(_ssl_conn); /*This shouldn't succeed, since we can't read yet.*/ OP_ALWAYS_TRUE(SSL_connect(_ssl_conn)<0); SSL_set_bio(_ssl_conn,_ssl_bio,_ssl_bio); +# if OPENSSL_VERSION_NUMBER>=0x10100000L + BIO_meth_free(bio_retry_method); +# endif /*Only now do we disable write coalescing, to allow the CONNECT request and the start of the TLS handshake to be combined.*/ op_sock_set_tcp_nodelay(_fd,1); @@ -2200,7 +2231,8 @@ static int op_http_stream_open(OpusHTTPStream *_stream,const char *_url, /*Initialize the SSL library if necessary.*/ if(OP_URL_IS_SSL(&_stream->url)&&_stream->ssl_ctx==NULL){ SSL_CTX *ssl_ctx; -# if !defined(OPENSSL_NO_LOCKING) +# if OPENSSL_VERSION_NUMBER<0x10100000L +# if !defined(OPENSSL_NO_LOCKING) /*The documentation says SSL_library_init() is not reentrant. We don't want to add our own depenencies on a threading library, and it appears that it's safe to call OpenSSL's locking functions before the @@ -2210,12 +2242,16 @@ static int op_http_stream_open(OpusHTTPStream *_stream,const char *_url, calling SSL_library_init() at the same time, but there's not much we can do about that.*/ CRYPTO_w_lock(CRYPTO_LOCK_SSL); -# endif +# endif SSL_library_init(); /*Needed to get SHA2 algorithms with old OpenSSL versions.*/ OpenSSL_add_ssl_algorithms(); -# if !defined(OPENSSL_NO_LOCKING) +# if !defined(OPENSSL_NO_LOCKING) CRYPTO_w_unlock(CRYPTO_LOCK_SSL); +# endif +# else + /*Finally, OpenSSL does this for us, but as penance, it can now fail.*/ + if(!OPENSSL_init_ssl(0,NULL))return OP_EFAULT; # endif ssl_ctx=SSL_CTX_new(SSLv23_client_method()); if(ssl_ctx==NULL)return OP_EFAULT; @@ -2779,7 +2815,7 @@ static int op_http_conn_read_body(OpusHTTPStream *_stream, Otherwise, we'd need a _pnext pointer if we needed to close the connection, and re-opening it would re-organize the lists.*/ OP_ASSERT(_stream->lru_head==_conn); - /*We should have filterd out empty reads by this point.*/ + /*We should have filtered out empty reads by this point.*/ OP_ASSERT(_buf_size>0); pos=_conn->pos; end_pos=_conn->end_pos; diff --git a/thirdparty/opus/info.c b/thirdparty/opus/info.c index 55e2906d5f..c36f9a9ee1 100644 --- a/thirdparty/opus/info.c +++ b/thirdparty/opus/info.c @@ -199,16 +199,21 @@ static int opus_tags_parse_impl(OpusTags *_tags, if(_tags->user_comments[ci]==NULL)return OP_EFAULT; _tags->comment_lengths[ci]=(int)count; _tags->comments=ci+1; + /*Needed by opus_tags_clear() if we fail before parsing the (optional) + binary metadata.*/ + _tags->user_comments[ci+1]=NULL; } _data+=count; len-=count; } if(len>0&&(_data[0]&1)){ if(len>(opus_uint32)INT_MAX)return OP_EFAULT; - _tags->user_comments[ncomments]=(char *)_ogg_malloc(len); - if(OP_UNLIKELY(_tags->user_comments[ncomments]==NULL))return OP_EFAULT; - memcpy(_tags->user_comments[ncomments],_data,len); - _tags->comment_lengths[ncomments]=(int)len; + if(_tags!=NULL){ + _tags->user_comments[ncomments]=(char *)_ogg_malloc(len); + if(OP_UNLIKELY(_tags->user_comments[ncomments]==NULL))return OP_EFAULT; + memcpy(_tags->user_comments[ncomments],_data,len); + _tags->comment_lengths[ncomments]=(int)len; + } } return 0; } @@ -306,7 +311,7 @@ int opus_tags_add_comment(OpusTags *_tags,const char *_comment){ if(OP_UNLIKELY(ret<0))return ret; comment_len=(int)strlen(_comment); comment=op_strdup_with_len(_comment,comment_len); - if(OP_UNLIKELY(_tags->user_comments[ncomments]==NULL))return OP_EFAULT; + if(OP_UNLIKELY(comment==NULL))return OP_EFAULT; _tags->user_comments[ncomments]=comment; _tags->comment_lengths[ncomments]=comment_len; _tags->comments=ncomments+1; diff --git a/thirdparty/opus/opus.c b/thirdparty/opus/opus.c index e9ce93b308..f76f125cfa 100644 --- a/thirdparty/opus/opus.c +++ b/thirdparty/opus/opus.c @@ -104,6 +104,10 @@ OPUS_EXPORT void opus_pcm_soft_clip(float *_x, int N, int C, float *declip_mem) /* Compute a such that maxval + a*maxval^2 = 1 */ a=(maxval-1)/(maxval*maxval); + /* Slightly boost "a" by 2^-22. This is just enough to ensure -ffast-math + does not cause output values larger than +/-1, but small enough not + to matter even for 24-bit output. */ + a += a*2.4e-7; if (x[i*C]>0) a = -a; /* Apply soft clipping */ @@ -201,8 +205,10 @@ int opus_packet_parse_impl(const unsigned char *data, opus_int32 len, opus_int32 pad = 0; const unsigned char *data0 = data; - if (size==NULL) + if (size==NULL || len<0) return OPUS_BAD_ARG; + if (len==0) + return OPUS_INVALID_PACKET; framesize = opus_packet_get_samples_per_frame(data, 48000); diff --git a/thirdparty/opus/opus/opus.h b/thirdparty/opus/opus/opus.h index b0bdf6f2df..5be73ddf4e 100644 --- a/thirdparty/opus/opus/opus.h +++ b/thirdparty/opus/opus/opus.h @@ -142,7 +142,7 @@ extern "C" { * * opus_encode() and opus_encode_float() return the number of bytes actually written to the packet. * The return value <b>can be negative</b>, which indicates that an error has occurred. If the return value - * is 1 byte, then the packet does not need to be transmitted (DTX). + * is 2 bytes or less, then the packet does not need to be transmitted (DTX). * * Once the encoder state if no longer needed, it can be destroyed with * diff --git a/thirdparty/opus/opus/opus_defines.h b/thirdparty/opus/opus/opus_defines.h index 647ed5d6f2..315412dd1d 100644 --- a/thirdparty/opus/opus/opus_defines.h +++ b/thirdparty/opus/opus/opus_defines.h @@ -65,7 +65,7 @@ extern "C" { #ifndef OPUS_EXPORT # if defined(WIN32) -# ifdef OPUS_BUILD +# if defined(OPUS_BUILD) && defined(DLL_EXPORT) # define OPUS_EXPORT __declspec(dllexport) # else # define OPUS_EXPORT diff --git a/thirdparty/opus/opus/opus_multistream.h b/thirdparty/opus/opus/opus_multistream.h index 47e03900bd..3622e009fb 100644 --- a/thirdparty/opus/opus/opus_multistream.h +++ b/thirdparty/opus/opus/opus_multistream.h @@ -110,10 +110,10 @@ extern "C" { * packets produced by the encoder. Some basic information, such as packet * duration, can be computed without any special negotiation. * - * The format for multistream Opus packets is defined in the - * <a href="https://tools.ietf.org/html/draft-ietf-codec-oggopus">Ogg - * encapsulation specification</a> and is based on the self-delimited Opus - * framing described in Appendix B of <a href="https://tools.ietf.org/html/rfc6716">RFC 6716</a>. + * The format for multistream Opus packets is defined in + * <a href="https://tools.ietf.org/html/rfc7845">RFC 7845</a> + * and is based on the self-delimited Opus framing described in Appendix B of + * <a href="https://tools.ietf.org/html/rfc6716">RFC 6716</a>. * Normal Opus packets are just a degenerate case of multistream Opus packets, * and can be encoded or decoded with the multistream API by setting * <code>streams</code> to <code>1</code> when initializing the encoder or diff --git a/thirdparty/opus/opus/opusfile.h b/thirdparty/opus/opus/opusfile.h index 3604115c31..4bf2fba926 100644 --- a/thirdparty/opus/opus/opusfile.h +++ b/thirdparty/opus/opus/opusfile.h @@ -1713,11 +1713,11 @@ int op_pcm_seek(OggOpusFile *_of,ogg_int64_t _pcm_offset) OP_ARG_NONNULL(1); These downmix multichannel files to two channels, so they can always return samples in the same format for every link in a chained file. - If the rest of your audio processing chain can handle floating point, those - routines should be preferred, as floating point output avoids introducing - clipping and other issues which might be avoided entirely if, e.g., you - scale down the volume at some other stage. - However, if you intend to direct consume 16-bit samples, the conversion in + If the rest of your audio processing chain can handle floating point, the + floating-point routines should be preferred, as they prevent clipping and + other issues which might be avoided entirely if, e.g., you scale down the + volume at some other stage. + However, if you intend to consume 16-bit samples directly, the conversion in <tt>libopusfile</tt> provides noise-shaping dithering and, if compiled against <tt>libopus</tt> 1.1 or later, soft-clipping prevention. @@ -1770,26 +1770,35 @@ int op_pcm_seek(OggOpusFile *_of,ogg_int64_t _pcm_offset) OP_ARG_NONNULL(1); #OP_DEC_FORMAT_FLOAT. \param _li The index of the link from which this packet was decoded. \return A non-negative value on success, or a negative value on error. - The error codes should be the same as those returned by + Any error codes should be the same as those returned by opus_multistream_decode() or opus_multistream_decode_float(). + Success codes are as follows: \retval 0 Decoding was successful. The application has filled the buffer with exactly <code>\a _nsamples*\a _nchannels</code> samples in the requested format. \retval #OP_DEC_USE_DEFAULT No decoding was done. - <tt>libopusfile</tt> should decode normally - instead.*/ + <tt>libopusfile</tt> should do the decoding + by itself instead.*/ typedef int (*op_decode_cb_func)(void *_ctx,OpusMSDecoder *_decoder,void *_pcm, const ogg_packet *_op,int _nsamples,int _nchannels,int _format,int _li); /**Sets the packet decode callback function. - This is called once for each packet that needs to be decoded. + If set, this is called once for each packet that needs to be decoded. + This can be used by advanced applications to do additional processing on the + compressed or uncompressed data. + For example, an application might save the final entropy coder state for + debugging and testing purposes, or it might apply additional filters + before the downmixing, dithering, or soft-clipping performed by + <tt>libopusfile</tt>, so long as these filters do not introduce any + latency. + A call to this function is no guarantee that the audio will eventually be delivered to the application. - Some or all of the data from the packet may be discarded (i.e., at the - beginning or end of a link, or after a seek), however the callback is - required to provide all of it. + <tt>libopusfile</tt> may discard some or all of the decoded audio data + (i.e., at the beginning or end of a link, or after a seek), however the + callback is still required to provide all of it. \param _of The \c OggOpusFile on which to set the decode callback. \param _decode_cb The callback function to call. This may be <code>NULL</code> to disable calling the diff --git a/thirdparty/opus/opus_encoder.c b/thirdparty/opus/opus_encoder.c index a7e19127d6..9a516a884a 100644 --- a/thirdparty/opus/opus_encoder.c +++ b/thirdparty/opus/opus_encoder.c @@ -860,9 +860,6 @@ opus_int32 compute_frame_size(const void *analysis_pcm, int frame_size, opus_val16 compute_stereo_width(const opus_val16 *pcm, int frame_size, opus_int32 Fs, StereoWidthState *mem) { - opus_val16 corr; - opus_val16 ldiff; - opus_val16 width; opus_val32 xx, xy, yy; opus_val16 sqrt_xx, sqrt_yy; opus_val16 qrrt_xx, qrrt_yy; @@ -871,9 +868,12 @@ opus_val16 compute_stereo_width(const opus_val16 *pcm, int frame_size, opus_int3 opus_val16 short_alpha; frame_rate = Fs/frame_size; - short_alpha = Q15ONE - 25*Q15ONE/IMAX(50,frame_rate); + short_alpha = Q15ONE - MULT16_16(25, Q15ONE)/IMAX(50,frame_rate); xx=xy=yy=0; - for (i=0;i<frame_size;i+=4) + /* Unroll by 4. The frame size is always a multiple of 4 *except* for + 2.5 ms frames at 12 kHz. Since this setting is very rare (and very + stupid), we just discard the last two samples. */ + for (i=0;i<frame_size-3;i+=4) { opus_val32 pxx=0; opus_val32 pxy=0; @@ -912,6 +912,9 @@ opus_val16 compute_stereo_width(const opus_val16 *pcm, int frame_size, opus_int3 mem->YY = MAX32(0, mem->YY); if (MAX32(mem->XX, mem->YY)>QCONST16(8e-4f, 18)) { + opus_val16 corr; + opus_val16 ldiff; + opus_val16 width; sqrt_xx = celt_sqrt(mem->XX); sqrt_yy = celt_sqrt(mem->YY); qrrt_xx = celt_sqrt(sqrt_xx); @@ -920,19 +923,15 @@ opus_val16 compute_stereo_width(const opus_val16 *pcm, int frame_size, opus_int3 mem->XY = MIN32(mem->XY, sqrt_xx*sqrt_yy); corr = SHR32(frac_div32(mem->XY,EPSILON+MULT16_16(sqrt_xx,sqrt_yy)),16); /* Approximate loudness difference */ - ldiff = Q15ONE*ABS16(qrrt_xx-qrrt_yy)/(EPSILON+qrrt_xx+qrrt_yy); + ldiff = MULT16_16(Q15ONE, ABS16(qrrt_xx-qrrt_yy))/(EPSILON+qrrt_xx+qrrt_yy); width = MULT16_16_Q15(celt_sqrt(QCONST32(1.f,30)-MULT16_16(corr,corr)), ldiff); /* Smoothing over one second */ mem->smoothed_width += (width-mem->smoothed_width)/frame_rate; /* Peak follower */ mem->max_follower = MAX16(mem->max_follower-QCONST16(.02f,15)/frame_rate, mem->smoothed_width); - } else { - width = 0; - corr=Q15ONE; - ldiff=0; } /*printf("%f %f %f %f %f ", corr/(float)Q15ONE, ldiff/(float)Q15ONE, width/(float)Q15ONE, mem->smoothed_width/(float)Q15ONE, mem->max_follower/(float)Q15ONE);*/ - return EXTRACT16(MIN32(Q15ONE,20*mem->max_follower)); + return EXTRACT16(MIN32(Q15ONE, MULT16_16(20, mem->max_follower))); } opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_size, @@ -1050,6 +1049,16 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ st->bitrate_bps = user_bitrate_to_bitrate(st, frame_size, max_data_bytes); frame_rate = st->Fs/frame_size; + if (!st->use_vbr) + { + int cbrBytes; + /* Multiply by 3 to make sure the division is exact. */ + int frame_rate3 = 3*st->Fs/frame_size; + /* We need to make sure that "int" values always fit in 16 bits. */ + cbrBytes = IMIN( (3*st->bitrate_bps/8 + frame_rate3/2)/frame_rate3, max_data_bytes); + st->bitrate_bps = cbrBytes*(opus_int32)frame_rate3*8/3; + max_data_bytes = cbrBytes; + } if (max_data_bytes<3 || st->bitrate_bps < 3*frame_rate*8 || (frame_rate<50 && (max_data_bytes*frame_rate<300 || st->bitrate_bps < 2400))) { @@ -1066,18 +1075,18 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ bw=OPUS_BANDWIDTH_WIDEBAND; else if (tocmode==MODE_CELT_ONLY&&bw==OPUS_BANDWIDTH_MEDIUMBAND) bw=OPUS_BANDWIDTH_NARROWBAND; - else if (bw<=OPUS_BANDWIDTH_SUPERWIDEBAND) + else if (tocmode==MODE_HYBRID&&bw<=OPUS_BANDWIDTH_SUPERWIDEBAND) bw=OPUS_BANDWIDTH_SUPERWIDEBAND; data[0] = gen_toc(tocmode, frame_rate, bw, st->stream_channels); + ret = 1; + if (!st->use_vbr) + { + ret = opus_packet_pad(data, ret, max_data_bytes); + if (ret == OPUS_OK) + ret = max_data_bytes; + } RESTORE_STACK; - return 1; - } - if (!st->use_vbr) - { - int cbrBytes; - cbrBytes = IMIN( (st->bitrate_bps + 4*frame_rate)/(8*frame_rate) , max_data_bytes); - st->bitrate_bps = cbrBytes * (8*frame_rate); - max_data_bytes = cbrBytes; + return ret; } max_rate = frame_rate*max_data_bytes*8; @@ -1513,7 +1522,7 @@ opus_int32 opus_encode_native(OpusEncoder *st, const opus_val16 *pcm, int frame_ celt_rate = total_bitRate - st->silk_mode.bitRate; HB_gain_ref = (curr_bandwidth == OPUS_BANDWIDTH_SUPERWIDEBAND) ? 3000 : 3600; HB_gain = SHL32((opus_val32)celt_rate, 9) / SHR32((opus_val32)celt_rate + st->stream_channels * HB_gain_ref, 6); - HB_gain = HB_gain < Q15ONE*6/7 ? HB_gain + Q15ONE/7 : Q15ONE; + HB_gain = HB_gain < (opus_val32)Q15ONE*6/7 ? HB_gain + Q15ONE/7 : Q15ONE; } } else { /* SILK gets all bits */ diff --git a/thirdparty/opus/opus_multistream_encoder.c b/thirdparty/opus/opus_multistream_encoder.c index 9e85773573..e722e31ab8 100644 --- a/thirdparty/opus/opus_multistream_encoder.c +++ b/thirdparty/opus/opus_multistream_encoder.c @@ -70,13 +70,22 @@ typedef void (*opus_copy_channel_in_func)( int frame_size ); +typedef enum { + MAPPING_TYPE_NONE, + MAPPING_TYPE_SURROUND +#ifdef ENABLE_EXPERIMENTAL_AMBISONICS + , /* Do not include comma at end of enumerator list */ + MAPPING_TYPE_AMBISONICS +#endif +} MappingType; + struct OpusMSEncoder { ChannelLayout layout; int arch; int lfe_stream; int application; int variable_duration; - int surround; + MappingType mapping_type; opus_int32 bitrate_bps; float subframe_mem[3]; /* Encoder states go here */ @@ -242,6 +251,7 @@ void surround_analysis(const CELTMode *celt_mode, const void *pcm, opus_val16 *b upsample = resampling_factor(rate); frame_size = len*upsample; + /* LM = log2(frame_size / 120) */ for (LM=0;LM<celt_mode->maxLM;LM++) if (celt_mode->shortMdctSize<<LM==frame_size) break; @@ -398,6 +408,12 @@ opus_int32 opus_multistream_surround_encoder_get_size(int channels, int mapping_ { nb_streams=channels; nb_coupled_streams=0; +#ifdef ENABLE_EXPERIMENTAL_AMBISONICS + } else if (mapping_family==254) + { + nb_streams=channels; + nb_coupled_streams=0; +#endif } else return 0; size = opus_multistream_encoder_get_size(nb_streams, nb_coupled_streams); @@ -408,7 +424,6 @@ opus_int32 opus_multistream_surround_encoder_get_size(int channels, int mapping_ return size; } - static int opus_multistream_encoder_init_impl( OpusMSEncoder *st, opus_int32 Fs, @@ -417,7 +432,7 @@ static int opus_multistream_encoder_init_impl( int coupled_streams, const unsigned char *mapping, int application, - int surround + MappingType mapping_type ) { int coupled_size; @@ -434,7 +449,7 @@ static int opus_multistream_encoder_init_impl( st->layout.nb_streams = streams; st->layout.nb_coupled_streams = coupled_streams; st->subframe_mem[0]=st->subframe_mem[1]=st->subframe_mem[2]=0; - if (!surround) + if (mapping_type != MAPPING_TYPE_SURROUND) st->lfe_stream = -1; st->bitrate_bps = OPUS_AUTO; st->application = application; @@ -463,12 +478,12 @@ static int opus_multistream_encoder_init_impl( if(ret!=OPUS_OK)return ret; ptr += align(mono_size); } - if (surround) + if (mapping_type == MAPPING_TYPE_SURROUND) { OPUS_CLEAR(ms_get_preemph_mem(st), channels); OPUS_CLEAR(ms_get_window_mem(st), channels*120); } - st->surround = surround; + st->mapping_type = mapping_type; return OPUS_OK; } @@ -482,7 +497,9 @@ int opus_multistream_encoder_init( int application ) { - return opus_multistream_encoder_init_impl(st, Fs, channels, streams, coupled_streams, mapping, application, 0); + return opus_multistream_encoder_init_impl(st, Fs, channels, streams, + coupled_streams, mapping, + application, MAPPING_TYPE_NONE); } int opus_multistream_surround_encoder_init( @@ -496,6 +513,8 @@ int opus_multistream_surround_encoder_init( int application ) { + MappingType mapping_type; + if ((channels>255) || (channels<1)) return OPUS_BAD_ARG; st->lfe_stream = -1; @@ -530,10 +549,32 @@ int opus_multistream_surround_encoder_init( *coupled_streams=0; for(i=0;i<channels;i++) mapping[i] = i; +#ifdef ENABLE_EXPERIMENTAL_AMBISONICS + } else if (mapping_family==254) + { + int i; + *streams=channels; + *coupled_streams=0; + for(i=0;i<channels;i++) + mapping[i] = i; +#endif } else return OPUS_UNIMPLEMENTED; - return opus_multistream_encoder_init_impl(st, Fs, channels, *streams, *coupled_streams, - mapping, application, channels>2&&mapping_family==1); + + if (channels>2 && mapping_family==1) { + mapping_type = MAPPING_TYPE_SURROUND; +#ifdef ENABLE_EXPERIMENTAL_AMBISONICS + } else if (mapping_family==254) + { + mapping_type = MAPPING_TYPE_AMBISONICS; +#endif + } else + { + mapping_type = MAPPING_TYPE_NONE; + } + return opus_multistream_encoder_init_impl(st, Fs, channels, *streams, + *coupled_streams, mapping, + application, mapping_type); } OpusMSEncoder *opus_multistream_encoder_create( @@ -618,24 +659,19 @@ OpusMSEncoder *opus_multistream_surround_encoder_create( return st; } -static opus_int32 surround_rate_allocation( +static void surround_rate_allocation( OpusMSEncoder *st, opus_int32 *rate, - int frame_size + int frame_size, + opus_int32 Fs ) { int i; opus_int32 channel_rate; - opus_int32 Fs; - char *ptr; int stream_offset; int lfe_offset; int coupled_ratio; /* Q8 */ int lfe_ratio; /* Q8 */ - opus_int32 rate_sum=0; - - ptr = (char*)st + align(sizeof(OpusMSEncoder)); - opus_encoder_ctl((OpusEncoder*)ptr, OPUS_GET_SAMPLE_RATE(&Fs)); if (st->bitrate_bps > st->layout.nb_channels*40000) stream_offset = 20000; @@ -688,6 +724,88 @@ static opus_int32 surround_rate_allocation( rate[i] = stream_offset+channel_rate; else rate[i] = lfe_offset+(channel_rate*lfe_ratio>>8); + } +} + +#ifdef ENABLE_EXPERIMENTAL_AMBISONICS +static void ambisonics_rate_allocation( + OpusMSEncoder *st, + opus_int32 *rate, + int frame_size, + opus_int32 Fs + ) +{ + int i; + int non_mono_rate; + int total_rate; + + /* The mono channel gets (rate_ratio_num / rate_ratio_den) times as many bits + * as all other channels */ + const int rate_ratio_num = 4; + const int rate_ratio_den = 3; + const int num_channels = st->layout.nb_streams; + + if (st->bitrate_bps==OPUS_AUTO) + { + total_rate = num_channels * (20000 + st->layout.nb_streams*(Fs+60*Fs/frame_size)); + } else if (st->bitrate_bps==OPUS_BITRATE_MAX) + { + total_rate = num_channels * 320000; + } else { + total_rate = st->bitrate_bps; + } + + /* Let y be the non-mono rate and let p, q be integers such that the mono + * channel rate is (p/q) * y. + * Also let T be the total bitrate to allocate. Then + * (n - 1) y + (p/q) y = T + * y = (T q) / (qn - q + p) + */ + non_mono_rate = + total_rate * rate_ratio_den + / (rate_ratio_den*num_channels + rate_ratio_num - rate_ratio_den); + +#ifndef FIXED_POINT + if (st->variable_duration==OPUS_FRAMESIZE_VARIABLE && frame_size != Fs/50) + { + opus_int32 bonus = 60*(Fs/frame_size-50); + non_mono_rate += bonus; + } +#endif + + rate[0] = total_rate - (num_channels - 1) * non_mono_rate; + for (i=1;i<st->layout.nb_streams;i++) + { + rate[i] = non_mono_rate; + } +} +#endif /* ENABLE_EXPERIMENTAL_AMBISONICS */ + +static opus_int32 rate_allocation( + OpusMSEncoder *st, + opus_int32 *rate, + int frame_size + ) +{ + int i; + opus_int32 rate_sum=0; + opus_int32 Fs; + char *ptr; + + ptr = (char*)st + align(sizeof(OpusMSEncoder)); + opus_encoder_ctl((OpusEncoder*)ptr, OPUS_GET_SAMPLE_RATE(&Fs)); + +#ifdef ENABLE_EXPERIMENTAL_AMBISONICS + if (st->mapping_type == MAPPING_TYPE_AMBISONICS) { + ambisonics_rate_allocation(st, rate, frame_size, Fs); + } else +#endif + { + surround_rate_allocation(st, rate, frame_size, Fs); + } + + for (i=0;i<st->layout.nb_streams;i++) + { rate[i] = IMAX(rate[i], 500); rate_sum += rate[i]; } @@ -730,7 +848,7 @@ static int opus_multistream_encode_native opus_int32 smallest_packet; ALLOC_STACK; - if (st->surround) + if (st->mapping_type == MAPPING_TYPE_SURROUND) { preemph_mem = ms_get_preemph_mem(st); mem = ms_get_window_mem(st); @@ -784,13 +902,13 @@ static int opus_multistream_encode_native mono_size = opus_encoder_get_size(1); ALLOC(bandSMR, 21*st->layout.nb_channels, opus_val16); - if (st->surround) + if (st->mapping_type == MAPPING_TYPE_SURROUND) { surround_analysis(celt_mode, pcm, bandSMR, mem, preemph_mem, frame_size, 120, st->layout.nb_channels, Fs, copy_channel_in, st->arch); } /* Compute bitrate allocation between streams (this could be a lot better) */ - rate_sum = surround_rate_allocation(st, bitrates, frame_size); + rate_sum = rate_allocation(st, bitrates, frame_size); if (!vbr) { @@ -813,7 +931,7 @@ static int opus_multistream_encode_native else ptr += align(mono_size); opus_encoder_ctl(enc, OPUS_SET_BITRATE(bitrates[s])); - if (st->surround) + if (st->mapping_type == MAPPING_TYPE_SURROUND) { opus_int32 equiv_rate; equiv_rate = st->bitrate_bps; @@ -834,6 +952,11 @@ static int opus_multistream_encode_native opus_encoder_ctl(enc, OPUS_SET_FORCE_CHANNELS(2)); } } +#ifdef ENABLE_EXPERIMENTAL_AMBISONICS + else if (st->mapping_type == MAPPING_TYPE_AMBISONICS) { + opus_encoder_ctl(enc, OPUS_SET_FORCE_MODE(MODE_CELT_ONLY)); + } +#endif } ptr = (char*)st + align(sizeof(OpusMSEncoder)); @@ -845,6 +968,7 @@ static int opus_multistream_encode_native int len; int curr_max; int c1, c2; + int ret; opus_repacketizer_init(&rp); enc = (OpusEncoder*)ptr; @@ -859,7 +983,7 @@ static int opus_multistream_encode_native (*copy_channel_in)(buf+1, 2, pcm, st->layout.nb_channels, right, frame_size); ptr += align(coupled_size); - if (st->surround) + if (st->mapping_type == MAPPING_TYPE_SURROUND) { for (i=0;i<21;i++) { @@ -875,7 +999,7 @@ static int opus_multistream_encode_native (*copy_channel_in)(buf, 1, pcm, st->layout.nb_channels, chan, frame_size); ptr += align(mono_size); - if (st->surround) + if (st->mapping_type == MAPPING_TYPE_SURROUND) { for (i=0;i<21;i++) bandLogE[i] = bandSMR[21*chan+i]; @@ -883,7 +1007,7 @@ static int opus_multistream_encode_native c1 = chan; c2 = -1; } - if (st->surround) + if (st->mapping_type == MAPPING_TYPE_SURROUND) opus_encoder_ctl(enc, OPUS_SET_ENERGY_MASK(bandLogE)); /* number of bytes left (+Toc) */ curr_max = max_data_bytes - tot_size; @@ -904,7 +1028,14 @@ static int opus_multistream_encode_native /* We need to use the repacketizer to add the self-delimiting lengths while taking into account the fact that the encoder can now return more than one frame at a time (e.g. 60 ms CELT-only) */ - opus_repacketizer_cat(&rp, tmp_data, len); + ret = opus_repacketizer_cat(&rp, tmp_data, len); + /* If the opus_repacketizer_cat() fails, then something's seriously wrong + with the encoder. */ + if (ret != OPUS_OK) + { + RESTORE_STACK; + return OPUS_INTERNAL_ERROR; + } len = opus_repacketizer_out_range_impl(&rp, 0, opus_repacketizer_get_nb_frames(&rp), data, max_data_bytes-tot_size, s != st->layout.nb_streams-1, !vbr && s == st->layout.nb_streams-1); data += len; @@ -1183,7 +1314,7 @@ int opus_multistream_encoder_ctl(OpusMSEncoder *st, int request, ...) { int s; st->subframe_mem[0] = st->subframe_mem[1] = st->subframe_mem[2] = 0; - if (st->surround) + if (st->mapping_type == MAPPING_TYPE_SURROUND) { OPUS_CLEAR(ms_get_preemph_mem(st), st->layout.nb_channels); OPUS_CLEAR(ms_get_window_mem(st), st->layout.nb_channels*120); diff --git a/thirdparty/opus/opusfile.c b/thirdparty/opus/opusfile.c index 9c9b684ca4..b8b3a354cf 100644 --- a/thirdparty/opus/opusfile.c +++ b/thirdparty/opus/opusfile.c @@ -505,6 +505,7 @@ static int op_fetch_headers_impl(OggOpusFile *_of,OpusHead *_head, Everything else is fatal.*/ else if(ret!=OP_ENOTFORMAT)return ret; } + /*TODO: Should a BOS page with no packets be an error?*/ } /*Get the next page. No need to clamp the boundary offset against _of->end, as all errors @@ -1823,14 +1824,11 @@ opus_int32 op_bitrate_instant(OggOpusFile *_of){ This handles the case where we're at a bitstream boundary and dumps the decoding machine. If the decoding machine is unloaded, it loads it. - It also keeps prev_packet_gp up to date (seek and read both use this; seek - uses a special hack with _readp). + It also keeps prev_packet_gp up to date (seek and read both use this). Return: <0) Error, OP_HOLE (lost packet), or OP_EOF. - 0) Need more data (only if _readp==0). - 1) Got at least one audio data packet.*/ + 0) Got at least one audio data packet.*/ static int op_fetch_and_process_page(OggOpusFile *_of, - ogg_page *_og,opus_int64 _page_offset, - int _readp,int _spanp,int _ignore_holes){ + ogg_page *_og,opus_int64 _page_offset,int _spanp,int _ignore_holes){ OggOpusLink *links; ogg_uint32_t cur_serialno; int seekable; @@ -1838,7 +1836,6 @@ static int op_fetch_and_process_page(OggOpusFile *_of, int ret; /*We shouldn't get here if we have unprocessed packets.*/ OP_ASSERT(_of->ready_state<OP_INITSET||_of->op_pos>=_of->op_count); - if(!_readp)return 0; seekable=_of->seekable; links=_of->links; cur_link=seekable?_of->cur_link:0; @@ -1847,36 +1844,27 @@ static int op_fetch_and_process_page(OggOpusFile *_of, for(;;){ ogg_page og; OP_ASSERT(_of->ready_state>=OP_OPENED); - /*This loop is not strictly necessary, but there's no sense in doing the - extra checks of the larger loop for the common case in a multiplexed - bistream where the page is simply part of a different logical - bitstream.*/ - do{ - /*If we were given a page to use, use it.*/ - if(_og!=NULL){ - *&og=*_og; - _og=NULL; - } - /*Keep reading until we get a page with the correct serialno.*/ - else _page_offset=op_get_next_page(_of,&og,_of->end); - /*EOF: Leave uninitialized.*/ - if(_page_offset<0)return _page_offset<OP_FALSE?(int)_page_offset:OP_EOF; - if(OP_LIKELY(_of->ready_state>=OP_STREAMSET)){ - if(cur_serialno!=(ogg_uint32_t)ogg_page_serialno(&og)){ - /*Two possibilities: - 1) Another stream is multiplexed into this logical section, or*/ - if(OP_LIKELY(!ogg_page_bos(&og)))continue; - /* 2) Our decoding just traversed a bitstream boundary.*/ - if(!_spanp)return OP_EOF; - if(OP_LIKELY(_of->ready_state>=OP_INITSET))op_decode_clear(_of); - break; - } - } - /*Bitrate tracking: add the header's bytes here. - The body bytes are counted when we consume the packets.*/ - _of->bytes_tracked+=og.header_len; + /*If we were given a page to use, use it.*/ + if(_og!=NULL){ + *&og=*_og; + _og=NULL; + } + /*Keep reading until we get a page with the correct serialno.*/ + else _page_offset=op_get_next_page(_of,&og,_of->end); + /*EOF: Leave uninitialized.*/ + if(_page_offset<0)return _page_offset<OP_FALSE?(int)_page_offset:OP_EOF; + if(OP_LIKELY(_of->ready_state>=OP_STREAMSET) + &&cur_serialno!=(ogg_uint32_t)ogg_page_serialno(&og)){ + /*Two possibilities: + 1) Another stream is multiplexed into this logical section, or*/ + if(OP_LIKELY(!ogg_page_bos(&og)))continue; + /* 2) Our decoding just traversed a bitstream boundary.*/ + if(!_spanp)return OP_EOF; + if(OP_LIKELY(_of->ready_state>=OP_INITSET))op_decode_clear(_of); } - while(0); + /*Bitrate tracking: add the header's bytes here. + The body bytes are counted when we consume the packets.*/ + else _of->bytes_tracked+=og.header_len; /*Do we need to load a new machine before submitting the page? This is different in the seekable and non-seekable cases. In the seekable case, we already have all the header information loaded @@ -1934,10 +1922,12 @@ static int op_fetch_and_process_page(OggOpusFile *_of, /*If we didn't get any packets out of op_find_initial_pcm_offset(), keep going (this is possible if end-trimming trimmed them all).*/ if(_of->op_count<=0)continue; - /*Otherwise, we're done.*/ + /*Otherwise, we're done. + TODO: This resets bytes_tracked, which misses the header bytes + already processed by op_find_initial_pcm_offset().*/ ret=op_make_decode_ready(_of); if(OP_UNLIKELY(ret<0))return ret; - return 1; + return 0; } } /*The buffered page is the data we want, and we're ready for it. @@ -2088,7 +2078,7 @@ static int op_fetch_and_process_page(OggOpusFile *_of, _of->prev_page_offset=_page_offset; _of->op_count=pi; /*If end-trimming didn't trim all the packets, we're done.*/ - if(OP_LIKELY(pi>0))return 1; + if(OP_LIKELY(pi>0))return 0; } } } @@ -2106,7 +2096,7 @@ int op_raw_seek(OggOpusFile *_of,opus_int64 _pos){ _of->samples_tracked=0; ret=op_seek_helper(_of,_pos); if(OP_UNLIKELY(ret<0))return OP_EREAD; - ret=op_fetch_and_process_page(_of,NULL,-1,1,1,1); + ret=op_fetch_and_process_page(_of,NULL,-1,1,1); /*If we hit EOF, op_fetch_and_process_page() leaves us uninitialized. Instead, jump to the end.*/ if(ret==OP_EOF){ @@ -2118,7 +2108,6 @@ int op_raw_seek(OggOpusFile *_of,opus_int64 _pos){ _of->cur_discard_count=0; ret=0; } - else if(ret>0)ret=0; return ret; } @@ -2506,8 +2495,8 @@ static int op_pcm_seek_page(OggOpusFile *_of, /*Update prev_packet_gp to allow per-packet granule position assignment.*/ _of->prev_packet_gp=best_gp; _of->prev_page_offset=best_start; - ret=op_fetch_and_process_page(_of,page_offset<0?NULL:&og,page_offset,1,0,1); - if(OP_UNLIKELY(ret<=0))return OP_EBADLINK; + ret=op_fetch_and_process_page(_of,page_offset<0?NULL:&og,page_offset,0,1); + if(OP_UNLIKELY(ret<0))return OP_EBADLINK; /*Verify result.*/ if(OP_UNLIKELY(op_granpos_cmp(_of->prev_packet_gp,_target_gp)>0)){ return OP_EBADLINK; @@ -2589,8 +2578,8 @@ int op_pcm_seek(OggOpusFile *_of,ogg_int64_t _pcm_offset){ if(op_pos<op_count)break; /*We skipped all the packets on this page. Fetch another.*/ - ret=op_fetch_and_process_page(_of,NULL,-1,1,0,1); - if(OP_UNLIKELY(ret<=0))return OP_EBADLINK; + ret=op_fetch_and_process_page(_of,NULL,-1,0,1); + if(OP_UNLIKELY(ret<0))return OP_EBADLINK; } OP_ALWAYS_TRUE(!op_granpos_diff(&diff,prev_packet_gp,pcm_start)); /*We skipped too far. @@ -2854,7 +2843,7 @@ static int op_read_native(OggOpusFile *_of, } } /*Suck in another page.*/ - ret=op_fetch_and_process_page(_of,NULL,-1,1,1,0); + ret=op_fetch_and_process_page(_of,NULL,-1,1,0); if(OP_UNLIKELY(ret==OP_EOF)){ if(_li!=NULL)*_li=_of->cur_link; return 0; diff --git a/thirdparty/opus/repacketizer.c b/thirdparty/opus/repacketizer.c index f27e9ab958..c80ee7f001 100644 --- a/thirdparty/opus/repacketizer.c +++ b/thirdparty/opus/repacketizer.c @@ -249,7 +249,9 @@ int opus_packet_pad(unsigned char *data, opus_int32 len, opus_int32 new_len) opus_repacketizer_init(&rp); /* Moving payload to the end of the packet so we can do in-place padding */ OPUS_MOVE(data+new_len-len, data, len); - opus_repacketizer_cat(&rp, data+new_len-len, len); + ret = opus_repacketizer_cat(&rp, data+new_len-len, len); + if (ret != OPUS_OK) + return ret; ret = opus_repacketizer_out_range_impl(&rp, 0, rp.nb_frames, data, new_len, 0, 1); if (ret > 0) return OPUS_OK; diff --git a/thirdparty/zlib/adler32.c b/thirdparty/zlib/adler32.c index a868f073d8..d0be4380a3 100644 --- a/thirdparty/zlib/adler32.c +++ b/thirdparty/zlib/adler32.c @@ -1,5 +1,5 @@ /* adler32.c -- compute the Adler-32 checksum of a data stream - * Copyright (C) 1995-2011 Mark Adler + * Copyright (C) 1995-2011, 2016 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -7,11 +7,9 @@ #include "zutil.h" -#define local static - local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); -#define BASE 65521 /* largest prime smaller than 65536 */ +#define BASE 65521U /* largest prime smaller than 65536 */ #define NMAX 5552 /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ @@ -62,10 +60,10 @@ local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); #endif /* ========================================================================= */ -uLong ZEXPORT adler32(adler, buf, len) +uLong ZEXPORT adler32_z(adler, buf, len) uLong adler; const Bytef *buf; - uInt len; + z_size_t len; { unsigned long sum2; unsigned n; @@ -133,6 +131,15 @@ uLong ZEXPORT adler32(adler, buf, len) } /* ========================================================================= */ +uLong ZEXPORT adler32(adler, buf, len) + uLong adler; + const Bytef *buf; + uInt len; +{ + return adler32_z(adler, buf, len); +} + +/* ========================================================================= */ local uLong adler32_combine_(adler1, adler2, len2) uLong adler1; uLong adler2; @@ -156,7 +163,7 @@ local uLong adler32_combine_(adler1, adler2, len2) sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem; if (sum1 >= BASE) sum1 -= BASE; if (sum1 >= BASE) sum1 -= BASE; - if (sum2 >= (BASE << 1)) sum2 -= (BASE << 1); + if (sum2 >= ((unsigned long)BASE << 1)) sum2 -= ((unsigned long)BASE << 1); if (sum2 >= BASE) sum2 -= BASE; return sum1 | (sum2 << 16); } diff --git a/thirdparty/zlib/compress.c b/thirdparty/zlib/compress.c index 6e9762676a..e2db404abf 100644 --- a/thirdparty/zlib/compress.c +++ b/thirdparty/zlib/compress.c @@ -1,5 +1,5 @@ /* compress.c -- compress a memory buffer - * Copyright (C) 1995-2005 Jean-loup Gailly. + * Copyright (C) 1995-2005, 2014, 2016 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -28,16 +28,11 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) { z_stream stream; int err; + const uInt max = (uInt)-1; + uLong left; - stream.next_in = (z_const Bytef *)source; - stream.avail_in = (uInt)sourceLen; -#ifdef MAXSEG_64K - /* Check for source > 64K on 16-bit machine: */ - if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; -#endif - stream.next_out = dest; - stream.avail_out = (uInt)*destLen; - if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; + left = *destLen; + *destLen = 0; stream.zalloc = (alloc_func)0; stream.zfree = (free_func)0; @@ -46,15 +41,26 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) err = deflateInit(&stream, level); if (err != Z_OK) return err; - err = deflate(&stream, Z_FINISH); - if (err != Z_STREAM_END) { - deflateEnd(&stream); - return err == Z_OK ? Z_BUF_ERROR : err; - } - *destLen = stream.total_out; + stream.next_out = dest; + stream.avail_out = 0; + stream.next_in = (z_const Bytef *)source; + stream.avail_in = 0; + + do { + if (stream.avail_out == 0) { + stream.avail_out = left > (uLong)max ? max : (uInt)left; + left -= stream.avail_out; + } + if (stream.avail_in == 0) { + stream.avail_in = sourceLen > (uLong)max ? max : (uInt)sourceLen; + sourceLen -= stream.avail_in; + } + err = deflate(&stream, sourceLen ? Z_NO_FLUSH : Z_FINISH); + } while (err == Z_OK); - err = deflateEnd(&stream); - return err; + *destLen = stream.total_out; + deflateEnd(&stream); + return err == Z_STREAM_END ? Z_OK : err; } /* =========================================================================== diff --git a/thirdparty/zlib/crc32.c b/thirdparty/zlib/crc32.c index 979a7190a3..9580440c0e 100644 --- a/thirdparty/zlib/crc32.c +++ b/thirdparty/zlib/crc32.c @@ -1,5 +1,5 @@ /* crc32.c -- compute the CRC-32 of a data stream - * Copyright (C) 1995-2006, 2010, 2011, 2012 Mark Adler + * Copyright (C) 1995-2006, 2010, 2011, 2012, 2016 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h * * Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster @@ -30,17 +30,15 @@ #include "zutil.h" /* for STDC and FAR definitions */ -#define local static - /* Definitions for doing the crc four data bytes at a time. */ #if !defined(NOBYFOUR) && defined(Z_U4) # define BYFOUR #endif #ifdef BYFOUR local unsigned long crc32_little OF((unsigned long, - const unsigned char FAR *, unsigned)); + const unsigned char FAR *, z_size_t)); local unsigned long crc32_big OF((unsigned long, - const unsigned char FAR *, unsigned)); + const unsigned char FAR *, z_size_t)); # define TBLS 8 #else # define TBLS 1 @@ -201,10 +199,10 @@ const z_crc_t FAR * ZEXPORT get_crc_table() #define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1 /* ========================================================================= */ -unsigned long ZEXPORT crc32(crc, buf, len) +unsigned long ZEXPORT crc32_z(crc, buf, len) unsigned long crc; const unsigned char FAR *buf; - uInt len; + z_size_t len; { if (buf == Z_NULL) return 0UL; @@ -235,8 +233,29 @@ unsigned long ZEXPORT crc32(crc, buf, len) return crc ^ 0xffffffffUL; } +/* ========================================================================= */ +unsigned long ZEXPORT crc32(crc, buf, len) + unsigned long crc; + const unsigned char FAR *buf; + uInt len; +{ + return crc32_z(crc, buf, len); +} + #ifdef BYFOUR +/* + This BYFOUR code accesses the passed unsigned char * buffer with a 32-bit + integer pointer type. This violates the strict aliasing rule, where a + compiler can assume, for optimization purposes, that two pointers to + fundamentally different types won't ever point to the same memory. This can + manifest as a problem only if one of the pointers is written to. This code + only reads from those pointers. So long as this code remains isolated in + this compilation unit, there won't be a problem. For this reason, this code + should not be copied and pasted into a compilation unit in which other code + writes to the buffer that is passed to these routines. + */ + /* ========================================================================= */ #define DOLIT4 c ^= *buf4++; \ c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \ @@ -247,7 +266,7 @@ unsigned long ZEXPORT crc32(crc, buf, len) local unsigned long crc32_little(crc, buf, len) unsigned long crc; const unsigned char FAR *buf; - unsigned len; + z_size_t len; { register z_crc_t c; register const z_crc_t FAR *buf4; @@ -278,7 +297,7 @@ local unsigned long crc32_little(crc, buf, len) } /* ========================================================================= */ -#define DOBIG4 c ^= *++buf4; \ +#define DOBIG4 c ^= *buf4++; \ c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \ crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24] #define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4 @@ -287,7 +306,7 @@ local unsigned long crc32_little(crc, buf, len) local unsigned long crc32_big(crc, buf, len) unsigned long crc; const unsigned char FAR *buf; - unsigned len; + z_size_t len; { register z_crc_t c; register const z_crc_t FAR *buf4; @@ -300,7 +319,6 @@ local unsigned long crc32_big(crc, buf, len) } buf4 = (const z_crc_t FAR *)(const void FAR *)buf; - buf4--; while (len >= 32) { DOBIG32; len -= 32; @@ -309,7 +327,6 @@ local unsigned long crc32_big(crc, buf, len) DOBIG4; len -= 4; } - buf4++; buf = (const unsigned char FAR *)buf4; if (len) do { diff --git a/thirdparty/zlib/deflate.c b/thirdparty/zlib/deflate.c index 696957705b..2ad890e354 100644 --- a/thirdparty/zlib/deflate.c +++ b/thirdparty/zlib/deflate.c @@ -1,5 +1,5 @@ /* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler + * Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -52,7 +52,7 @@ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.2.8 Copyright 1995-2013 Jean-loup Gailly and Mark Adler "; + " deflate 1.2.10 Copyright 1995-2017 Jean-loup Gailly and Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -73,6 +73,8 @@ typedef enum { typedef block_state (*compress_func) OF((deflate_state *s, int flush)); /* Compression function. Returns the block state after the call. */ +local int deflateStateCheck OF((z_streamp strm)); +local void slide_hash OF((deflate_state *s)); local void fill_window OF((deflate_state *s)); local block_state deflate_stored OF((deflate_state *s, int flush)); local block_state deflate_fast OF((deflate_state *s, int flush)); @@ -84,15 +86,16 @@ local block_state deflate_huff OF((deflate_state *s, int flush)); local void lm_init OF((deflate_state *s)); local void putShortMSB OF((deflate_state *s, uInt b)); local void flush_pending OF((z_streamp strm)); -local int read_buf OF((z_streamp strm, Bytef *buf, unsigned size)); +local unsigned read_buf OF((z_streamp strm, Bytef *buf, unsigned size)); #ifdef ASMV +# pragma message("Assembler code may have bugs -- use at your own risk") void match_init OF((void)); /* asm code initialization */ uInt longest_match OF((deflate_state *s, IPos cur_match)); #else local uInt longest_match OF((deflate_state *s, IPos cur_match)); #endif -#ifdef DEBUG +#ifdef ZLIB_DEBUG local void check_match OF((deflate_state *s, IPos start, IPos match, int length)); #endif @@ -148,21 +151,14 @@ local const config configuration_table[10] = { * meaning. */ -#define EQUAL 0 -/* result of memcmp for equal strings */ - -#ifndef NO_DUMMY_DECL -struct static_tree_desc_s {int dummy;}; /* for buggy compilers */ -#endif - /* rank Z_BLOCK between Z_NO_FLUSH and Z_PARTIAL_FLUSH */ -#define RANK(f) (((f) << 1) - ((f) > 4 ? 9 : 0)) +#define RANK(f) (((f) * 2) - ((f) > 4 ? 9 : 0)) /* =========================================================================== * Update a hash value with the given input byte - * IN assertion: all calls to to UPDATE_HASH are made with consecutive - * input characters, so that a running hash key can be computed from the - * previous key instead of complete recalculation each time. + * IN assertion: all calls to UPDATE_HASH are made with consecutive input + * characters, so that a running hash key can be computed from the previous + * key instead of complete recalculation each time. */ #define UPDATE_HASH(s,h,c) (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask) @@ -173,9 +169,9 @@ struct static_tree_desc_s {int dummy;}; /* for buggy compilers */ * the previous length of the hash chain. * If this file is compiled with -DFASTEST, the compression level is forced * to 1, and no hash chains are maintained. - * IN assertion: all calls to to INSERT_STRING are made with consecutive - * input characters and the first MIN_MATCH bytes of str are valid - * (except for the last MIN_MATCH-1 bytes of the input file). + * IN assertion: all calls to INSERT_STRING are made with consecutive input + * characters and the first MIN_MATCH bytes of str are valid (except for + * the last MIN_MATCH-1 bytes of the input file). */ #ifdef FASTEST #define INSERT_STRING(s, str, match_head) \ @@ -197,6 +193,37 @@ struct static_tree_desc_s {int dummy;}; /* for buggy compilers */ s->head[s->hash_size-1] = NIL; \ zmemzero((Bytef *)s->head, (unsigned)(s->hash_size-1)*sizeof(*s->head)); +/* =========================================================================== + * Slide the hash table when sliding the window down (could be avoided with 32 + * bit values at the expense of memory usage). We slide even when level == 0 to + * keep the hash table consistent if we switch back to level > 0 later. + */ +local void slide_hash(s) + deflate_state *s; +{ + unsigned n, m; + Posf *p; + uInt wsize = s->w_size; + + n = s->hash_size; + p = &s->head[n]; + do { + m = *--p; + *p = (Pos)(m >= wsize ? m - wsize : NIL); + } while (--n); + n = wsize; +#ifndef FASTEST + p = &s->prev[n]; + do { + m = *--p; + *p = (Pos)(m >= wsize ? m - wsize : NIL); + /* If n is not on any hash chain, prev[n] is garbage but + * its value will never be used. + */ + } while (--n); +#endif +} + /* ========================================================================= */ int ZEXPORT deflateInit_(strm, level, version, stream_size) z_streamp strm; @@ -270,7 +297,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, #endif if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || - strategy < 0 || strategy > Z_FIXED) { + strategy < 0 || strategy > Z_FIXED || (windowBits == 8 && wrap != 1)) { return Z_STREAM_ERROR; } if (windowBits == 8) windowBits = 9; /* until 256-byte window bug fixed */ @@ -278,14 +305,15 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, if (s == Z_NULL) return Z_MEM_ERROR; strm->state = (struct internal_state FAR *)s; s->strm = strm; + s->status = INIT_STATE; /* to pass state test in deflateReset() */ s->wrap = wrap; s->gzhead = Z_NULL; - s->w_bits = windowBits; + s->w_bits = (uInt)windowBits; s->w_size = 1 << s->w_bits; s->w_mask = s->w_size - 1; - s->hash_bits = memLevel + 7; + s->hash_bits = (uInt)memLevel + 7; s->hash_size = 1 << s->hash_bits; s->hash_mask = s->hash_size - 1; s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH); @@ -319,6 +347,31 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, return deflateReset(strm); } +/* ========================================================================= + * Check for a valid deflate stream state. Return 0 if ok, 1 if not. + */ +local int deflateStateCheck (strm) + z_streamp strm; +{ + deflate_state *s; + if (strm == Z_NULL || + strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) + return 1; + s = strm->state; + if (s == Z_NULL || s->strm != strm || (s->status != INIT_STATE && +#ifdef GZIP + s->status != GZIP_STATE && +#endif + s->status != EXTRA_STATE && + s->status != NAME_STATE && + s->status != COMMENT_STATE && + s->status != HCRC_STATE && + s->status != BUSY_STATE && + s->status != FINISH_STATE)) + return 1; + return 0; +} + /* ========================================================================= */ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) z_streamp strm; @@ -331,7 +384,7 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) unsigned avail; z_const unsigned char *next; - if (strm == Z_NULL || strm->state == Z_NULL || dictionary == Z_NULL) + if (deflateStateCheck(strm) || dictionary == Z_NULL) return Z_STREAM_ERROR; s = strm->state; wrap = s->wrap; @@ -389,13 +442,34 @@ int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength) } /* ========================================================================= */ +int ZEXPORT deflateGetDictionary (strm, dictionary, dictLength) + z_streamp strm; + Bytef *dictionary; + uInt *dictLength; +{ + deflate_state *s; + uInt len; + + if (deflateStateCheck(strm)) + return Z_STREAM_ERROR; + s = strm->state; + len = s->strstart + s->lookahead; + if (len > s->w_size) + len = s->w_size; + if (dictionary != Z_NULL && len) + zmemcpy(dictionary, s->window + s->strstart + s->lookahead - len, len); + if (dictLength != Z_NULL) + *dictLength = len; + return Z_OK; +} + +/* ========================================================================= */ int ZEXPORT deflateResetKeep (strm) z_streamp strm; { deflate_state *s; - if (strm == Z_NULL || strm->state == Z_NULL || - strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) { + if (deflateStateCheck(strm)) { return Z_STREAM_ERROR; } @@ -410,7 +484,11 @@ int ZEXPORT deflateResetKeep (strm) if (s->wrap < 0) { s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */ } - s->status = s->wrap ? INIT_STATE : BUSY_STATE; + s->status = +#ifdef GZIP + s->wrap == 2 ? GZIP_STATE : +#endif + s->wrap ? INIT_STATE : BUSY_STATE; strm->adler = #ifdef GZIP s->wrap == 2 ? crc32(0L, Z_NULL, 0) : @@ -440,8 +518,8 @@ int ZEXPORT deflateSetHeader (strm, head) z_streamp strm; gz_headerp head; { - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - if (strm->state->wrap != 2) return Z_STREAM_ERROR; + if (deflateStateCheck(strm) || strm->state->wrap != 2) + return Z_STREAM_ERROR; strm->state->gzhead = head; return Z_OK; } @@ -452,7 +530,7 @@ int ZEXPORT deflatePending (strm, pending, bits) int *bits; z_streamp strm; { - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (deflateStateCheck(strm)) return Z_STREAM_ERROR; if (pending != Z_NULL) *pending = strm->state->pending; if (bits != Z_NULL) @@ -469,7 +547,7 @@ int ZEXPORT deflatePrime (strm, bits, value) deflate_state *s; int put; - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (deflateStateCheck(strm)) return Z_STREAM_ERROR; s = strm->state; if ((Bytef *)(s->d_buf) < s->pending_out + ((Buf_size + 7) >> 3)) return Z_BUF_ERROR; @@ -494,9 +572,8 @@ int ZEXPORT deflateParams(strm, level, strategy) { deflate_state *s; compress_func func; - int err = Z_OK; - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (deflateStateCheck(strm)) return Z_STREAM_ERROR; s = strm->state; #ifdef FASTEST @@ -509,14 +586,22 @@ int ZEXPORT deflateParams(strm, level, strategy) } func = configuration_table[s->level].func; - if ((strategy != s->strategy || func != configuration_table[level].func) && - strm->total_in != 0) { + if ((strategy != s->strategy || func != configuration_table[level].func)) { /* Flush the last buffer: */ - err = deflate(strm, Z_BLOCK); - if (err == Z_BUF_ERROR && s->pending == 0) - err = Z_OK; + int err = deflate(strm, Z_BLOCK); + if (err == Z_STREAM_ERROR) + return err; + if (strm->avail_out == 0) + return Z_BUF_ERROR; } if (s->level != level) { + if (s->level == 0 && s->matches != 0) { + if (s->matches == 1) + slide_hash(s); + else + CLEAR_HASH(s); + s->matches = 0; + } s->level = level; s->max_lazy_match = configuration_table[level].max_lazy; s->good_match = configuration_table[level].good_length; @@ -524,7 +609,7 @@ int ZEXPORT deflateParams(strm, level, strategy) s->max_chain_length = configuration_table[level].max_chain; } s->strategy = strategy; - return err; + return Z_OK; } /* ========================================================================= */ @@ -537,12 +622,12 @@ int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain) { deflate_state *s; - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (deflateStateCheck(strm)) return Z_STREAM_ERROR; s = strm->state; - s->good_match = good_length; - s->max_lazy_match = max_lazy; + s->good_match = (uInt)good_length; + s->max_lazy_match = (uInt)max_lazy; s->nice_match = nice_length; - s->max_chain_length = max_chain; + s->max_chain_length = (uInt)max_chain; return Z_OK; } @@ -569,14 +654,13 @@ uLong ZEXPORT deflateBound(strm, sourceLen) { deflate_state *s; uLong complen, wraplen; - Bytef *str; /* conservative upper bound for compressed data */ complen = sourceLen + ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5; /* if can't get parameters, return conservative bound plus zlib wrapper */ - if (strm == Z_NULL || strm->state == Z_NULL) + if (deflateStateCheck(strm)) return complen + 6; /* compute wrapper length */ @@ -588,9 +672,11 @@ uLong ZEXPORT deflateBound(strm, sourceLen) case 1: /* zlib wrapper */ wraplen = 6 + (s->strstart ? 4 : 0); break; +#ifdef GZIP case 2: /* gzip wrapper */ wraplen = 18; if (s->gzhead != Z_NULL) { /* user-supplied gzip header */ + Bytef *str; if (s->gzhead->extra != Z_NULL) wraplen += 2 + s->gzhead->extra_len; str = s->gzhead->name; @@ -607,6 +693,7 @@ uLong ZEXPORT deflateBound(strm, sourceLen) wraplen += 2; } break; +#endif default: /* for compiler happiness */ wraplen = 6; } @@ -634,10 +721,10 @@ local void putShortMSB (s, b) } /* ========================================================================= - * Flush as much pending output as possible. All deflate() output goes - * through this function so some applications may wish to modify it - * to avoid allocating a large strm->next_out buffer and copying into it. - * (See also read_buf()). + * Flush as much pending output as possible. All deflate() output, except for + * some deflate_stored() output, goes through this function so some + * applications may wish to modify it to avoid allocating a large + * strm->next_out buffer and copying into it. (See also read_buf()). */ local void flush_pending(strm) z_streamp strm; @@ -654,13 +741,23 @@ local void flush_pending(strm) strm->next_out += len; s->pending_out += len; strm->total_out += len; - strm->avail_out -= len; - s->pending -= len; + strm->avail_out -= len; + s->pending -= len; if (s->pending == 0) { s->pending_out = s->pending_buf; } } +/* =========================================================================== + * Update the header CRC with the bytes s->pending_buf[beg..s->pending - 1]. + */ +#define HCRC_UPDATE(beg) \ + do { \ + if (s->gzhead->hcrc && s->pending > (beg)) \ + strm->adler = crc32(strm->adler, s->pending_buf + (beg), \ + s->pending - (beg)); \ + } while (0) + /* ========================================================================= */ int ZEXPORT deflate (strm, flush) z_streamp strm; @@ -669,230 +766,229 @@ int ZEXPORT deflate (strm, flush) int old_flush; /* value of flush param for previous deflate call */ deflate_state *s; - if (strm == Z_NULL || strm->state == Z_NULL || - flush > Z_BLOCK || flush < 0) { + if (deflateStateCheck(strm) || flush > Z_BLOCK || flush < 0) { return Z_STREAM_ERROR; } s = strm->state; if (strm->next_out == Z_NULL || - (strm->next_in == Z_NULL && strm->avail_in != 0) || + (strm->avail_in != 0 && strm->next_in == Z_NULL) || (s->status == FINISH_STATE && flush != Z_FINISH)) { ERR_RETURN(strm, Z_STREAM_ERROR); } if (strm->avail_out == 0) ERR_RETURN(strm, Z_BUF_ERROR); - s->strm = strm; /* just in case */ old_flush = s->last_flush; s->last_flush = flush; + /* Flush as much pending output as possible */ + if (s->pending != 0) { + flush_pending(strm); + if (strm->avail_out == 0) { + /* Since avail_out is 0, deflate will be called again with + * more output space, but possibly with both pending and + * avail_in equal to zero. There won't be anything to do, + * but this is not an error situation so make sure we + * return OK instead of BUF_ERROR at next call of deflate: + */ + s->last_flush = -1; + return Z_OK; + } + + /* Make sure there is something to do and avoid duplicate consecutive + * flushes. For repeated and useless calls with Z_FINISH, we keep + * returning Z_STREAM_END instead of Z_BUF_ERROR. + */ + } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) && + flush != Z_FINISH) { + ERR_RETURN(strm, Z_BUF_ERROR); + } + + /* User must not provide more input after the first FINISH: */ + if (s->status == FINISH_STATE && strm->avail_in != 0) { + ERR_RETURN(strm, Z_BUF_ERROR); + } + /* Write the header */ if (s->status == INIT_STATE) { -#ifdef GZIP - if (s->wrap == 2) { - strm->adler = crc32(0L, Z_NULL, 0); - put_byte(s, 31); - put_byte(s, 139); - put_byte(s, 8); - if (s->gzhead == Z_NULL) { - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, s->level == 9 ? 2 : - (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? - 4 : 0)); - put_byte(s, OS_CODE); - s->status = BUSY_STATE; - } - else { - put_byte(s, (s->gzhead->text ? 1 : 0) + - (s->gzhead->hcrc ? 2 : 0) + - (s->gzhead->extra == Z_NULL ? 0 : 4) + - (s->gzhead->name == Z_NULL ? 0 : 8) + - (s->gzhead->comment == Z_NULL ? 0 : 16) - ); - put_byte(s, (Byte)(s->gzhead->time & 0xff)); - put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff)); - put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff)); - put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff)); - put_byte(s, s->level == 9 ? 2 : - (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? - 4 : 0)); - put_byte(s, s->gzhead->os & 0xff); - if (s->gzhead->extra != Z_NULL) { - put_byte(s, s->gzhead->extra_len & 0xff); - put_byte(s, (s->gzhead->extra_len >> 8) & 0xff); - } - if (s->gzhead->hcrc) - strm->adler = crc32(strm->adler, s->pending_buf, - s->pending); - s->gzindex = 0; - s->status = EXTRA_STATE; - } - } + /* zlib header */ + uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8; + uInt level_flags; + + if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2) + level_flags = 0; + else if (s->level < 6) + level_flags = 1; + else if (s->level == 6) + level_flags = 2; else -#endif - { - uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8; - uInt level_flags; - - if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2) - level_flags = 0; - else if (s->level < 6) - level_flags = 1; - else if (s->level == 6) - level_flags = 2; - else - level_flags = 3; - header |= (level_flags << 6); - if (s->strstart != 0) header |= PRESET_DICT; - header += 31 - (header % 31); + level_flags = 3; + header |= (level_flags << 6); + if (s->strstart != 0) header |= PRESET_DICT; + header += 31 - (header % 31); + + putShortMSB(s, header); + /* Save the adler32 of the preset dictionary: */ + if (s->strstart != 0) { + putShortMSB(s, (uInt)(strm->adler >> 16)); + putShortMSB(s, (uInt)(strm->adler & 0xffff)); + } + strm->adler = adler32(0L, Z_NULL, 0); + s->status = BUSY_STATE; + + /* Compression must start with an empty pending buffer */ + flush_pending(strm); + if (s->pending != 0) { + s->last_flush = -1; + return Z_OK; + } + } +#ifdef GZIP + if (s->status == GZIP_STATE) { + /* gzip header */ + strm->adler = crc32(0L, Z_NULL, 0); + put_byte(s, 31); + put_byte(s, 139); + put_byte(s, 8); + if (s->gzhead == Z_NULL) { + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, s->level == 9 ? 2 : + (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? + 4 : 0)); + put_byte(s, OS_CODE); s->status = BUSY_STATE; - putShortMSB(s, header); - /* Save the adler32 of the preset dictionary: */ - if (s->strstart != 0) { - putShortMSB(s, (uInt)(strm->adler >> 16)); - putShortMSB(s, (uInt)(strm->adler & 0xffff)); + /* Compression must start with an empty pending buffer */ + flush_pending(strm); + if (s->pending != 0) { + s->last_flush = -1; + return Z_OK; + } + } + else { + put_byte(s, (s->gzhead->text ? 1 : 0) + + (s->gzhead->hcrc ? 2 : 0) + + (s->gzhead->extra == Z_NULL ? 0 : 4) + + (s->gzhead->name == Z_NULL ? 0 : 8) + + (s->gzhead->comment == Z_NULL ? 0 : 16) + ); + put_byte(s, (Byte)(s->gzhead->time & 0xff)); + put_byte(s, (Byte)((s->gzhead->time >> 8) & 0xff)); + put_byte(s, (Byte)((s->gzhead->time >> 16) & 0xff)); + put_byte(s, (Byte)((s->gzhead->time >> 24) & 0xff)); + put_byte(s, s->level == 9 ? 2 : + (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? + 4 : 0)); + put_byte(s, s->gzhead->os & 0xff); + if (s->gzhead->extra != Z_NULL) { + put_byte(s, s->gzhead->extra_len & 0xff); + put_byte(s, (s->gzhead->extra_len >> 8) & 0xff); } - strm->adler = adler32(0L, Z_NULL, 0); + if (s->gzhead->hcrc) + strm->adler = crc32(strm->adler, s->pending_buf, + s->pending); + s->gzindex = 0; + s->status = EXTRA_STATE; } } -#ifdef GZIP if (s->status == EXTRA_STATE) { if (s->gzhead->extra != Z_NULL) { - uInt beg = s->pending; /* start of bytes to update crc */ - - while (s->gzindex < (s->gzhead->extra_len & 0xffff)) { - if (s->pending == s->pending_buf_size) { - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - flush_pending(strm); - beg = s->pending; - if (s->pending == s->pending_buf_size) - break; + ulg beg = s->pending; /* start of bytes to update crc */ + uInt left = (s->gzhead->extra_len & 0xffff) - s->gzindex; + while (s->pending + left > s->pending_buf_size) { + uInt copy = s->pending_buf_size - s->pending; + zmemcpy(s->pending_buf + s->pending, + s->gzhead->extra + s->gzindex, copy); + s->pending = s->pending_buf_size; + HCRC_UPDATE(beg); + s->gzindex += copy; + flush_pending(strm); + if (s->pending != 0) { + s->last_flush = -1; + return Z_OK; } - put_byte(s, s->gzhead->extra[s->gzindex]); - s->gzindex++; - } - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - if (s->gzindex == s->gzhead->extra_len) { - s->gzindex = 0; - s->status = NAME_STATE; + beg = 0; + left -= copy; } + zmemcpy(s->pending_buf + s->pending, + s->gzhead->extra + s->gzindex, left); + s->pending += left; + HCRC_UPDATE(beg); + s->gzindex = 0; } - else - s->status = NAME_STATE; + s->status = NAME_STATE; } if (s->status == NAME_STATE) { if (s->gzhead->name != Z_NULL) { - uInt beg = s->pending; /* start of bytes to update crc */ + ulg beg = s->pending; /* start of bytes to update crc */ int val; - do { if (s->pending == s->pending_buf_size) { - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); + HCRC_UPDATE(beg); flush_pending(strm); - beg = s->pending; - if (s->pending == s->pending_buf_size) { - val = 1; - break; + if (s->pending != 0) { + s->last_flush = -1; + return Z_OK; } + beg = 0; } val = s->gzhead->name[s->gzindex++]; put_byte(s, val); } while (val != 0); - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - if (val == 0) { - s->gzindex = 0; - s->status = COMMENT_STATE; - } + HCRC_UPDATE(beg); + s->gzindex = 0; } - else - s->status = COMMENT_STATE; + s->status = COMMENT_STATE; } if (s->status == COMMENT_STATE) { if (s->gzhead->comment != Z_NULL) { - uInt beg = s->pending; /* start of bytes to update crc */ + ulg beg = s->pending; /* start of bytes to update crc */ int val; - do { if (s->pending == s->pending_buf_size) { - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); + HCRC_UPDATE(beg); flush_pending(strm); - beg = s->pending; - if (s->pending == s->pending_buf_size) { - val = 1; - break; + if (s->pending != 0) { + s->last_flush = -1; + return Z_OK; } + beg = 0; } val = s->gzhead->comment[s->gzindex++]; put_byte(s, val); } while (val != 0); - if (s->gzhead->hcrc && s->pending > beg) - strm->adler = crc32(strm->adler, s->pending_buf + beg, - s->pending - beg); - if (val == 0) - s->status = HCRC_STATE; + HCRC_UPDATE(beg); } - else - s->status = HCRC_STATE; + s->status = HCRC_STATE; } if (s->status == HCRC_STATE) { if (s->gzhead->hcrc) { - if (s->pending + 2 > s->pending_buf_size) + if (s->pending + 2 > s->pending_buf_size) { flush_pending(strm); - if (s->pending + 2 <= s->pending_buf_size) { - put_byte(s, (Byte)(strm->adler & 0xff)); - put_byte(s, (Byte)((strm->adler >> 8) & 0xff)); - strm->adler = crc32(0L, Z_NULL, 0); - s->status = BUSY_STATE; + if (s->pending != 0) { + s->last_flush = -1; + return Z_OK; + } } + put_byte(s, (Byte)(strm->adler & 0xff)); + put_byte(s, (Byte)((strm->adler >> 8) & 0xff)); + strm->adler = crc32(0L, Z_NULL, 0); } - else - s->status = BUSY_STATE; - } -#endif + s->status = BUSY_STATE; - /* Flush as much pending output as possible */ - if (s->pending != 0) { + /* Compression must start with an empty pending buffer */ flush_pending(strm); - if (strm->avail_out == 0) { - /* Since avail_out is 0, deflate will be called again with - * more output space, but possibly with both pending and - * avail_in equal to zero. There won't be anything to do, - * but this is not an error situation so make sure we - * return OK instead of BUF_ERROR at next call of deflate: - */ + if (s->pending != 0) { s->last_flush = -1; return Z_OK; } - - /* Make sure there is something to do and avoid duplicate consecutive - * flushes. For repeated and useless calls with Z_FINISH, we keep - * returning Z_STREAM_END instead of Z_BUF_ERROR. - */ - } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) && - flush != Z_FINISH) { - ERR_RETURN(strm, Z_BUF_ERROR); - } - - /* User must not provide more input after the first FINISH: */ - if (s->status == FINISH_STATE && strm->avail_in != 0) { - ERR_RETURN(strm, Z_BUF_ERROR); } +#endif /* Start a new block or continue the current one. */ @@ -900,9 +996,10 @@ int ZEXPORT deflate (strm, flush) (flush != Z_NO_FLUSH && s->status != FINISH_STATE)) { block_state bstate; - bstate = s->strategy == Z_HUFFMAN_ONLY ? deflate_huff(s, flush) : - (s->strategy == Z_RLE ? deflate_rle(s, flush) : - (*(configuration_table[s->level].func))(s, flush)); + bstate = s->level == 0 ? deflate_stored(s, flush) : + s->strategy == Z_HUFFMAN_ONLY ? deflate_huff(s, flush) : + s->strategy == Z_RLE ? deflate_rle(s, flush) : + (*(configuration_table[s->level].func))(s, flush); if (bstate == finish_started || bstate == finish_done) { s->status = FINISH_STATE; @@ -944,7 +1041,6 @@ int ZEXPORT deflate (strm, flush) } } } - Assert(strm->avail_out > 0, "bug2"); if (flush != Z_FINISH) return Z_OK; if (s->wrap <= 0) return Z_STREAM_END; @@ -981,18 +1077,9 @@ int ZEXPORT deflateEnd (strm) { int status; - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (deflateStateCheck(strm)) return Z_STREAM_ERROR; status = strm->state->status; - if (status != INIT_STATE && - status != EXTRA_STATE && - status != NAME_STATE && - status != COMMENT_STATE && - status != HCRC_STATE && - status != BUSY_STATE && - status != FINISH_STATE) { - return Z_STREAM_ERROR; - } /* Deallocate in reverse order of allocations: */ TRY_FREE(strm, strm->state->pending_buf); @@ -1023,7 +1110,7 @@ int ZEXPORT deflateCopy (dest, source) ushf *overlay; - if (source == Z_NULL || dest == Z_NULL || source->state == Z_NULL) { + if (deflateStateCheck(source) || dest == Z_NULL) { return Z_STREAM_ERROR; } @@ -1073,7 +1160,7 @@ int ZEXPORT deflateCopy (dest, source) * allocating a large strm->next_in buffer and copying from it. * (See also flush_pending()). */ -local int read_buf(strm, buf, size) +local unsigned read_buf(strm, buf, size) z_streamp strm; Bytef *buf; unsigned size; @@ -1097,7 +1184,7 @@ local int read_buf(strm, buf, size) strm->next_in += len; strm->total_in += len; - return (int)len; + return len; } /* =========================================================================== @@ -1151,9 +1238,9 @@ local uInt longest_match(s, cur_match) { unsigned chain_length = s->max_chain_length;/* max hash chain length */ register Bytef *scan = s->window + s->strstart; /* current string */ - register Bytef *match; /* matched string */ + register Bytef *match; /* matched string */ register int len; /* length of current match */ - int best_len = s->prev_length; /* best match length so far */ + int best_len = (int)s->prev_length; /* best match length so far */ int nice_match = s->nice_match; /* stop if match long enough */ IPos limit = s->strstart > (IPos)MAX_DIST(s) ? s->strstart - (IPos)MAX_DIST(s) : NIL; @@ -1188,7 +1275,7 @@ local uInt longest_match(s, cur_match) /* Do not look for matches beyond the end of the input. This is necessary * to make deflate deterministic. */ - if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; + if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead; Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); @@ -1349,7 +1436,11 @@ local uInt longest_match(s, cur_match) #endif /* FASTEST */ -#ifdef DEBUG +#ifdef ZLIB_DEBUG + +#define EQUAL 0 +/* result of memcmp for equal strings */ + /* =========================================================================== * Check that the match at match_start is indeed a match. */ @@ -1375,7 +1466,7 @@ local void check_match(s, start, match, length) } #else # define check_match(s, start, match, length) -#endif /* DEBUG */ +#endif /* ZLIB_DEBUG */ /* =========================================================================== * Fill the window when the lookahead becomes insufficient. @@ -1390,8 +1481,7 @@ local void check_match(s, start, match, length) local void fill_window(s) deflate_state *s; { - register unsigned n, m; - register Posf *p; + unsigned n; unsigned more; /* Amount of free space at the end of the window. */ uInt wsize = s->w_size; @@ -1418,35 +1508,11 @@ local void fill_window(s) */ if (s->strstart >= wsize+MAX_DIST(s)) { - zmemcpy(s->window, s->window+wsize, (unsigned)wsize); + zmemcpy(s->window, s->window+wsize, (unsigned)wsize - more); s->match_start -= wsize; s->strstart -= wsize; /* we now have strstart >= MAX_DIST */ s->block_start -= (long) wsize; - - /* Slide the hash table (could be avoided with 32 bit values - at the expense of memory usage). We slide even when level == 0 - to keep the hash table consistent if we switch back to level > 0 - later. (Using level 0 permanently is not an optimal usage of - zlib, so we don't care about this pathological case.) - */ - n = s->hash_size; - p = &s->head[n]; - do { - m = *--p; - *p = (Pos)(m >= wsize ? m-wsize : NIL); - } while (--n); - - n = wsize; -#ifndef FASTEST - p = &s->prev[n]; - do { - m = *--p; - *p = (Pos)(m >= wsize ? m-wsize : NIL); - /* If n is not on any hash chain, prev[n] is garbage but - * its value will never be used. - */ - } while (--n); -#endif + slide_hash(s); more += wsize; } if (s->strm->avail_in == 0) break; @@ -1552,70 +1618,195 @@ local void fill_window(s) if (s->strm->avail_out == 0) return (last) ? finish_started : need_more; \ } +/* Maximum stored block length in deflate format (not including header). */ +#define MAX_STORED 65535 + +/* Minimum of a and b. */ +#define MIN(a, b) ((a) > (b) ? (b) : (a)) + /* =========================================================================== * Copy without compression as much as possible from the input stream, return * the current block state. - * This function does not insert new strings in the dictionary since - * uncompressible data is probably not useful. This function is used - * only for the level=0 compression option. - * NOTE: this function should be optimized to avoid extra copying from - * window to pending_buf. + * + * In case deflateParams() is used to later switch to a non-zero compression + * level, s->matches (otherwise unused when storing) keeps track of the number + * of hash table slides to perform. If s->matches is 1, then one hash table + * slide will be done when switching. If s->matches is 2, the maximum value + * allowed here, then the hash table will be cleared, since two or more slides + * is the same as a clear. + * + * deflate_stored() is written to minimize the number of times an input byte is + * copied. It is most efficient with large input and output buffers, which + * maximizes the opportunites to have a single copy from next_in to next_out. */ local block_state deflate_stored(s, flush) deflate_state *s; int flush; { - /* Stored blocks are limited to 0xffff bytes, pending_buf is limited - * to pending_buf_size, and each stored block has a 5 byte header: + /* Smallest worthy block size when not flushing or finishing. By default + * this is 32K. This can be as small as 507 bytes for memLevel == 1. For + * large input and output buffers, the stored block size will be larger. */ - ulg max_block_size = 0xffff; - ulg max_start; - - if (max_block_size > s->pending_buf_size - 5) { - max_block_size = s->pending_buf_size - 5; - } + unsigned min_block = MIN(s->pending_buf_size - 5, s->w_size); - /* Copy as much as possible from input to output: */ - for (;;) { - /* Fill the window as much as possible: */ - if (s->lookahead <= 1) { - - Assert(s->strstart < s->w_size+MAX_DIST(s) || - s->block_start >= (long)s->w_size, "slide too late"); + /* Copy as many min_block or larger stored blocks directly to next_out as + * possible. If flushing, copy the remaining available input to next_out as + * stored blocks, if there is enough space. + */ + unsigned len, left, have, last = 0; + unsigned used = s->strm->avail_in; + do { + /* Set len to the maximum size block that we can copy directly with the + * available input data and output space. Set left to how much of that + * would be copied from what's left in the window. + */ + len = MAX_STORED; /* maximum deflate stored block length */ + have = (s->bi_valid + 42) >> 3; /* number of header bytes */ + if (s->strm->avail_out < have) /* need room for header */ + break; + /* maximum stored block length that will fit in avail_out: */ + have = s->strm->avail_out - have; + left = s->strstart - s->block_start; /* bytes left in window */ + if (len > (ulg)left + s->strm->avail_in) + len = left + s->strm->avail_in; /* limit len to the input */ + if (len > have) + len = have; /* limit len to the output */ + if (left > len) + left = len; /* limit window pull to len */ + + /* If the stored block would be less than min_block in length, or if + * unable to copy all of the available input when flushing, then try + * copying to the window and the pending buffer instead. Also don't + * write an empty block when flushing -- deflate() does that. + */ + if (len < min_block && ((len == 0 && flush != Z_FINISH) || + flush == Z_NO_FLUSH || + len - left != s->strm->avail_in)) + break; - fill_window(s); - if (s->lookahead == 0 && flush == Z_NO_FLUSH) return need_more; + /* Make a dummy stored block in pending to get the header bytes, + * including any pending bits. This also updates the debugging counts. + */ + last = flush == Z_FINISH && len - left == s->strm->avail_in ? 1 : 0; + _tr_stored_block(s, (char *)0, 0L, last); + + /* Replace the lengths in the dummy stored block with len. */ + s->pending_buf[s->pending - 4] = len; + s->pending_buf[s->pending - 3] = len >> 8; + s->pending_buf[s->pending - 2] = ~len; + s->pending_buf[s->pending - 1] = ~len >> 8; + + /* Write the stored block header bytes. */ + flush_pending(s->strm); + + /* Update debugging counts for the data about to be copied. */ +#ifdef ZLIB_DEBUG + s->compressed_len += len << 3; + s->bits_sent += len << 3; +#endif - if (s->lookahead == 0) break; /* flush the current block */ + /* Copy uncompressed bytes from the window to next_out. */ + if (left) { + zmemcpy(s->strm->next_out, s->window + s->block_start, left); + s->strm->next_out += left; + s->strm->avail_out -= left; + s->strm->total_out += left; + s->block_start += left; + len -= left; } - Assert(s->block_start >= 0L, "block gone"); - - s->strstart += s->lookahead; - s->lookahead = 0; - - /* Emit a stored block if pending_buf will be full: */ - max_start = s->block_start + max_block_size; - if (s->strstart == 0 || (ulg)s->strstart >= max_start) { - /* strstart == 0 is possible when wraparound on 16-bit machine */ - s->lookahead = (uInt)(s->strstart - max_start); - s->strstart = (uInt)max_start; - FLUSH_BLOCK(s, 0); + + /* Copy uncompressed bytes directly from next_in to next_out, updating + * the check value. + */ + if (len) { + read_buf(s->strm, s->strm->next_out, len); + s->strm->next_out += len; + s->strm->avail_out -= len; + s->strm->total_out += len; } - /* Flush if we may have to slide, otherwise block_start may become - * negative and the data will be gone: + } while (last == 0); + + /* Update the sliding window with the last s->w_size bytes of the copied + * data, or append all of the copied data to the existing window if less + * than s->w_size bytes were copied. Also update the number of bytes to + * insert in the hash tables, in the event that deflateParams() switches to + * a non-zero compression level. + */ + used -= s->strm->avail_in; /* number of input bytes directly copied */ + if (used) { + /* If any input was used, then no unused input remains in the window, + * therefore s->block_start == s->strstart. */ - if (s->strstart - (uInt)s->block_start >= MAX_DIST(s)) { - FLUSH_BLOCK(s, 0); + if (used >= s->w_size) { /* supplant the previous history */ + s->matches = 2; /* clear hash */ + zmemcpy(s->window, s->strm->next_in - s->w_size, s->w_size); + s->strstart = s->w_size; } + else { + if (s->window_size - s->strstart <= used) { + /* Slide the window down. */ + s->strstart -= s->w_size; + zmemcpy(s->window, s->window + s->w_size, s->strstart); + if (s->matches < 2) + s->matches++; /* add a pending slide_hash() */ + } + zmemcpy(s->window + s->strstart, s->strm->next_in - used, used); + s->strstart += used; + } + s->block_start = s->strstart; + s->insert += MIN(used, s->w_size - s->insert); } - s->insert = 0; - if (flush == Z_FINISH) { - FLUSH_BLOCK(s, 1); + + /* If the last block was written to next_out, then done. */ + if (last) return finish_done; + + /* If flushing and all input has been consumed, then done. */ + if (flush != Z_NO_FLUSH && flush != Z_FINISH && + s->strm->avail_in == 0 && (long)s->strstart == s->block_start) + return block_done; + + /* Fill the window with any remaining input. */ + have = s->window_size - s->strstart - 1; + if (s->strm->avail_in > have && s->block_start >= (long)s->w_size) { + /* Slide the window down. */ + s->block_start -= s->w_size; + s->strstart -= s->w_size; + zmemcpy(s->window, s->window + s->w_size, s->strstart); + if (s->matches < 2) + s->matches++; /* add a pending slide_hash() */ + have += s->w_size; /* more space now */ } - if ((long)s->strstart > s->block_start) - FLUSH_BLOCK(s, 0); - return block_done; + if (have > s->strm->avail_in) + have = s->strm->avail_in; + if (have) { + read_buf(s->strm, s->window + s->strstart, have); + s->strstart += have; + } + + /* There was not enough avail_out to write a complete worthy or flushed + * stored block to next_out. Write a stored block to pending instead, if we + * have enough input for a worthy block, or if flushing and there is enough + * room for the remaining input as a stored block in the pending buffer. + */ + have = (s->bi_valid + 42) >> 3; /* number of header bytes */ + /* maximum stored block length that will fit in pending: */ + have = MIN(s->pending_buf_size - have, MAX_STORED); + min_block = MIN(have, s->w_size); + left = s->strstart - s->block_start; + if (left >= min_block || + ((left || flush == Z_FINISH) && flush != Z_NO_FLUSH && + s->strm->avail_in == 0 && left <= have)) { + len = MIN(left, have); + last = flush == Z_FINISH && s->strm->avail_in == 0 && + len == left ? 1 : 0; + _tr_stored_block(s, (charf *)s->window + s->block_start, len, last); + s->block_start += len; + flush_pending(s->strm); + } + + /* We've done all we can with the available input and output. */ + return last ? finish_started : need_more; } /* =========================================================================== @@ -1892,7 +2083,7 @@ local block_state deflate_rle(s, flush) prev == *++scan && prev == *++scan && prev == *++scan && prev == *++scan && scan < strend); - s->match_length = MAX_MATCH - (int)(strend - scan); + s->match_length = MAX_MATCH - (uInt)(strend - scan); if (s->match_length > s->lookahead) s->match_length = s->lookahead; } diff --git a/thirdparty/zlib/deflate.h b/thirdparty/zlib/deflate.h index ce0299edd1..23ecdd312b 100644 --- a/thirdparty/zlib/deflate.h +++ b/thirdparty/zlib/deflate.h @@ -1,5 +1,5 @@ /* deflate.h -- internal compression state - * Copyright (C) 1995-2012 Jean-loup Gailly + * Copyright (C) 1995-2016 Jean-loup Gailly * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -51,13 +51,16 @@ #define Buf_size 16 /* size of bit buffer in bi_buf */ -#define INIT_STATE 42 -#define EXTRA_STATE 69 -#define NAME_STATE 73 -#define COMMENT_STATE 91 -#define HCRC_STATE 103 -#define BUSY_STATE 113 -#define FINISH_STATE 666 +#define INIT_STATE 42 /* zlib header -> BUSY_STATE */ +#ifdef GZIP +# define GZIP_STATE 57 /* gzip header -> BUSY_STATE | EXTRA_STATE */ +#endif +#define EXTRA_STATE 69 /* gzip extra block -> NAME_STATE */ +#define NAME_STATE 73 /* gzip file name -> COMMENT_STATE */ +#define COMMENT_STATE 91 /* gzip comment -> HCRC_STATE */ +#define HCRC_STATE 103 /* gzip header CRC -> BUSY_STATE */ +#define BUSY_STATE 113 /* deflate -> FINISH_STATE */ +#define FINISH_STATE 666 /* stream complete */ /* Stream status */ @@ -83,7 +86,7 @@ typedef struct static_tree_desc_s static_tree_desc; typedef struct tree_desc_s { ct_data *dyn_tree; /* the dynamic tree */ int max_code; /* largest code with non zero frequency */ - static_tree_desc *stat_desc; /* the corresponding static tree */ + const static_tree_desc *stat_desc; /* the corresponding static tree */ } FAR tree_desc; typedef ush Pos; @@ -100,10 +103,10 @@ typedef struct internal_state { Bytef *pending_buf; /* output still pending */ ulg pending_buf_size; /* size of pending_buf */ Bytef *pending_out; /* next pending byte to output to the stream */ - uInt pending; /* nb of bytes in the pending buffer */ + ulg pending; /* nb of bytes in the pending buffer */ int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ gz_headerp gzhead; /* gzip header information to write */ - uInt gzindex; /* where in extra, name, or comment */ + ulg gzindex; /* where in extra, name, or comment */ Byte method; /* can only be DEFLATED */ int last_flush; /* value of flush param for previous deflate call */ @@ -249,7 +252,7 @@ typedef struct internal_state { uInt matches; /* number of string matches in current block */ uInt insert; /* bytes at end of window left to insert */ -#ifdef DEBUG +#ifdef ZLIB_DEBUG ulg compressed_len; /* total bit length of compressed file mod 2^32 */ ulg bits_sent; /* bit length of compressed data sent mod 2^32 */ #endif @@ -275,7 +278,7 @@ typedef struct internal_state { /* Output a byte on the stream. * IN assertion: there is enough room in pending_buf. */ -#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);} +#define put_byte(s, c) {s->pending_buf[s->pending++] = (Bytef)(c);} #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) @@ -309,7 +312,7 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf, * used. */ -#ifndef DEBUG +#ifndef ZLIB_DEBUG /* Inline versions of _tr_tally for speed: */ #if defined(GEN_TREES_H) || !defined(STDC) @@ -328,8 +331,8 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf, flush = (s->last_lit == s->lit_bufsize-1); \ } # define _tr_tally_dist(s, distance, length, flush) \ - { uch len = (length); \ - ush dist = (distance); \ + { uch len = (uch)(length); \ + ush dist = (ush)(distance); \ s->d_buf[s->last_lit] = dist; \ s->l_buf[s->last_lit++] = len; \ dist--; \ diff --git a/thirdparty/zlib/gzclose.c b/thirdparty/zlib/gzclose.c new file mode 100644 index 0000000000..caeb99a317 --- /dev/null +++ b/thirdparty/zlib/gzclose.c @@ -0,0 +1,25 @@ +/* gzclose.c -- zlib gzclose() function + * Copyright (C) 2004, 2010 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "gzguts.h" + +/* gzclose() is in a separate file so that it is linked in only if it is used. + That way the other gzclose functions can be used instead to avoid linking in + unneeded compression or decompression routines. */ +int ZEXPORT gzclose(file) + gzFile file; +{ +#ifndef NO_GZCOMPRESS + gz_statep state; + + if (file == NULL) + return Z_STREAM_ERROR; + state = (gz_statep)file; + + return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); +#else + return gzclose_r(file); +#endif +} diff --git a/thirdparty/zlib/gzguts.h b/thirdparty/zlib/gzguts.h new file mode 100644 index 0000000000..990a4d2514 --- /dev/null +++ b/thirdparty/zlib/gzguts.h @@ -0,0 +1,218 @@ +/* gzguts.h -- zlib internal header definitions for gz* operations + * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013, 2016 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#ifdef _LARGEFILE64_SOURCE +# ifndef _LARGEFILE_SOURCE +# define _LARGEFILE_SOURCE 1 +# endif +# ifdef _FILE_OFFSET_BITS +# undef _FILE_OFFSET_BITS +# endif +#endif + +#ifdef HAVE_HIDDEN +# define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) +#else +# define ZLIB_INTERNAL +#endif + +#include <stdio.h> +#include "zlib.h" +#ifdef STDC +# include <string.h> +# include <stdlib.h> +# include <limits.h> +#endif + +#ifndef _POSIX_SOURCE +# define _POSIX_SOURCE +#endif +#include <fcntl.h> + +#ifdef _WIN32 +# include <stddef.h> +#endif + +#if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32) +# include <io.h> +#endif + +#if defined(_WIN32) || defined(__CYGWIN__) +# define WIDECHAR +#endif + +#ifdef WINAPI_FAMILY +# define open _open +# define read _read +# define write _write +# define close _close +#endif + +#ifdef NO_DEFLATE /* for compatibility with old definition */ +# define NO_GZCOMPRESS +#endif + +#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550) +# ifndef HAVE_VSNPRINTF +# define HAVE_VSNPRINTF +# endif +#endif + +#if defined(__CYGWIN__) +# ifndef HAVE_VSNPRINTF +# define HAVE_VSNPRINTF +# endif +#endif + +#if defined(MSDOS) && defined(__BORLANDC__) && (BORLANDC > 0x410) +# ifndef HAVE_VSNPRINTF +# define HAVE_VSNPRINTF +# endif +#endif + +#ifndef HAVE_VSNPRINTF +# ifdef MSDOS +/* vsnprintf may exist on some MS-DOS compilers (DJGPP?), + but for now we just assume it doesn't. */ +# define NO_vsnprintf +# endif +# ifdef __TURBOC__ +# define NO_vsnprintf +# endif +# ifdef WIN32 +/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */ +# if !defined(vsnprintf) && !defined(NO_vsnprintf) +# if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 ) +# define vsnprintf _vsnprintf +# endif +# endif +# endif +# ifdef __SASC +# define NO_vsnprintf +# endif +# ifdef VMS +# define NO_vsnprintf +# endif +# ifdef __OS400__ +# define NO_vsnprintf +# endif +# ifdef __MVS__ +# define NO_vsnprintf +# endif +#endif + +/* unlike snprintf (which is required in C99), _snprintf does not guarantee + null termination of the result -- however this is only used in gzlib.c where + the result is assured to fit in the space provided */ +#if defined(_MSC_VER) && _MSC_VER < 1900 +# define snprintf _snprintf +#endif + +#ifndef local +# define local static +#endif +/* since "static" is used to mean two completely different things in C, we + define "local" for the non-static meaning of "static", for readability + (compile with -Dlocal if your debugger can't find static symbols) */ + +/* gz* functions always use library allocation functions */ +#ifndef STDC + extern voidp malloc OF((uInt size)); + extern void free OF((voidpf ptr)); +#endif + +/* get errno and strerror definition */ +#if defined UNDER_CE +# include <windows.h> +# define zstrerror() gz_strwinerror((DWORD)GetLastError()) +#else +# ifndef NO_STRERROR +# include <errno.h> +# define zstrerror() strerror(errno) +# else +# define zstrerror() "stdio error (consult errno)" +# endif +#endif + +/* provide prototypes for these when building zlib without LFS */ +#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0 + ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); + ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); + ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); + ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); +#endif + +/* default memLevel */ +#if MAX_MEM_LEVEL >= 8 +# define DEF_MEM_LEVEL 8 +#else +# define DEF_MEM_LEVEL MAX_MEM_LEVEL +#endif + +/* default i/o buffer size -- double this for output when reading (this and + twice this must be able to fit in an unsigned type) */ +#define GZBUFSIZE 8192 + +/* gzip modes, also provide a little integrity check on the passed structure */ +#define GZ_NONE 0 +#define GZ_READ 7247 +#define GZ_WRITE 31153 +#define GZ_APPEND 1 /* mode set to GZ_WRITE after the file is opened */ + +/* values for gz_state how */ +#define LOOK 0 /* look for a gzip header */ +#define COPY 1 /* copy input directly */ +#define GZIP 2 /* decompress a gzip stream */ + +/* internal gzip file state data structure */ +typedef struct { + /* exposed contents for gzgetc() macro */ + struct gzFile_s x; /* "x" for exposed */ + /* x.have: number of bytes available at x.next */ + /* x.next: next output data to deliver or write */ + /* x.pos: current position in uncompressed data */ + /* used for both reading and writing */ + int mode; /* see gzip modes above */ + int fd; /* file descriptor */ + char *path; /* path or fd for error messages */ + unsigned size; /* buffer size, zero if not allocated yet */ + unsigned want; /* requested buffer size, default is GZBUFSIZE */ + unsigned char *in; /* input buffer (double-sized when writing) */ + unsigned char *out; /* output buffer (double-sized when reading) */ + int direct; /* 0 if processing gzip, 1 if transparent */ + /* just for reading */ + int how; /* 0: get header, 1: copy, 2: decompress */ + z_off64_t start; /* where the gzip data started, for rewinding */ + int eof; /* true if end of input file reached */ + int past; /* true if read requested past end */ + /* just for writing */ + int level; /* compression level */ + int strategy; /* compression strategy */ + /* seek request */ + z_off64_t skip; /* amount to skip (already rewound if backwards) */ + int seek; /* true if seek request pending */ + /* error information */ + int err; /* error code */ + char *msg; /* error message */ + /* zlib inflate or deflate stream */ + z_stream strm; /* stream structure in-place (not a pointer) */ +} gz_state; +typedef gz_state FAR *gz_statep; + +/* shared functions */ +void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *)); +#if defined UNDER_CE +char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error)); +#endif + +/* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t + value -- needed when comparing unsigned to z_off64_t, which is signed + (possible z_off64_t types off_t, off64_t, and long are all signed) */ +#ifdef INT_MAX +# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX) +#else +unsigned ZLIB_INTERNAL gz_intmax OF((void)); +# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax()) +#endif diff --git a/thirdparty/zlib/gzlib.c b/thirdparty/zlib/gzlib.c new file mode 100644 index 0000000000..e142ffb3d7 --- /dev/null +++ b/thirdparty/zlib/gzlib.c @@ -0,0 +1,637 @@ +/* gzlib.c -- zlib functions common to reading and writing gzip files + * Copyright (C) 2004, 2010, 2011, 2012, 2013, 2016 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "gzguts.h" + +#if defined(_WIN32) && !defined(__BORLANDC__) && !defined(__MINGW32__) +# define LSEEK _lseeki64 +#else +#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 +# define LSEEK lseek64 +#else +# define LSEEK lseek +#endif +#endif + +/* Local functions */ +local void gz_reset OF((gz_statep)); +local gzFile gz_open OF((const void *, int, const char *)); + +#if defined UNDER_CE + +/* Map the Windows error number in ERROR to a locale-dependent error message + string and return a pointer to it. Typically, the values for ERROR come + from GetLastError. + + The string pointed to shall not be modified by the application, but may be + overwritten by a subsequent call to gz_strwinerror + + The gz_strwinerror function does not change the current setting of + GetLastError. */ +char ZLIB_INTERNAL *gz_strwinerror (error) + DWORD error; +{ + static char buf[1024]; + + wchar_t *msgbuf; + DWORD lasterr = GetLastError(); + DWORD chars = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM + | FORMAT_MESSAGE_ALLOCATE_BUFFER, + NULL, + error, + 0, /* Default language */ + (LPVOID)&msgbuf, + 0, + NULL); + if (chars != 0) { + /* If there is an \r\n appended, zap it. */ + if (chars >= 2 + && msgbuf[chars - 2] == '\r' && msgbuf[chars - 1] == '\n') { + chars -= 2; + msgbuf[chars] = 0; + } + + if (chars > sizeof (buf) - 1) { + chars = sizeof (buf) - 1; + msgbuf[chars] = 0; + } + + wcstombs(buf, msgbuf, chars + 1); + LocalFree(msgbuf); + } + else { + sprintf(buf, "unknown win32 error (%ld)", error); + } + + SetLastError(lasterr); + return buf; +} + +#endif /* UNDER_CE */ + +/* Reset gzip file state */ +local void gz_reset(state) + gz_statep state; +{ + state->x.have = 0; /* no output data available */ + if (state->mode == GZ_READ) { /* for reading ... */ + state->eof = 0; /* not at end of file */ + state->past = 0; /* have not read past end yet */ + state->how = LOOK; /* look for gzip header */ + } + state->seek = 0; /* no seek request pending */ + gz_error(state, Z_OK, NULL); /* clear error */ + state->x.pos = 0; /* no uncompressed data yet */ + state->strm.avail_in = 0; /* no input data yet */ +} + +/* Open a gzip file either by name or file descriptor. */ +local gzFile gz_open(path, fd, mode) + const void *path; + int fd; + const char *mode; +{ + gz_statep state; + z_size_t len; + int oflag; +#ifdef O_CLOEXEC + int cloexec = 0; +#endif +#ifdef O_EXCL + int exclusive = 0; +#endif + + /* check input */ + if (path == NULL) + return NULL; + + /* allocate gzFile structure to return */ + state = (gz_statep)malloc(sizeof(gz_state)); + if (state == NULL) + return NULL; + state->size = 0; /* no buffers allocated yet */ + state->want = GZBUFSIZE; /* requested buffer size */ + state->msg = NULL; /* no error message yet */ + + /* interpret mode */ + state->mode = GZ_NONE; + state->level = Z_DEFAULT_COMPRESSION; + state->strategy = Z_DEFAULT_STRATEGY; + state->direct = 0; + while (*mode) { + if (*mode >= '0' && *mode <= '9') + state->level = *mode - '0'; + else + switch (*mode) { + case 'r': + state->mode = GZ_READ; + break; +#ifndef NO_GZCOMPRESS + case 'w': + state->mode = GZ_WRITE; + break; + case 'a': + state->mode = GZ_APPEND; + break; +#endif + case '+': /* can't read and write at the same time */ + free(state); + return NULL; + case 'b': /* ignore -- will request binary anyway */ + break; +#ifdef O_CLOEXEC + case 'e': + cloexec = 1; + break; +#endif +#ifdef O_EXCL + case 'x': + exclusive = 1; + break; +#endif + case 'f': + state->strategy = Z_FILTERED; + break; + case 'h': + state->strategy = Z_HUFFMAN_ONLY; + break; + case 'R': + state->strategy = Z_RLE; + break; + case 'F': + state->strategy = Z_FIXED; + break; + case 'T': + state->direct = 1; + break; + default: /* could consider as an error, but just ignore */ + ; + } + mode++; + } + + /* must provide an "r", "w", or "a" */ + if (state->mode == GZ_NONE) { + free(state); + return NULL; + } + + /* can't force transparent read */ + if (state->mode == GZ_READ) { + if (state->direct) { + free(state); + return NULL; + } + state->direct = 1; /* for empty file */ + } + + /* save the path name for error messages */ +#ifdef WIDECHAR + if (fd == -2) { + len = wcstombs(NULL, path, 0); + if (len == (z_size_t)-1) + len = 0; + } + else +#endif + len = strlen((const char *)path); + state->path = (char *)malloc(len + 1); + if (state->path == NULL) { + free(state); + return NULL; + } +#ifdef WIDECHAR + if (fd == -2) + if (len) + wcstombs(state->path, path, len + 1); + else + *(state->path) = 0; + else +#endif +#if !defined(NO_snprintf) && !defined(NO_vsnprintf) + (void)snprintf(state->path, len + 1, "%s", (const char *)path); +#else + strcpy(state->path, path); +#endif + + /* compute the flags for open() */ + oflag = +#ifdef O_LARGEFILE + O_LARGEFILE | +#endif +#ifdef O_BINARY + O_BINARY | +#endif +#ifdef O_CLOEXEC + (cloexec ? O_CLOEXEC : 0) | +#endif + (state->mode == GZ_READ ? + O_RDONLY : + (O_WRONLY | O_CREAT | +#ifdef O_EXCL + (exclusive ? O_EXCL : 0) | +#endif + (state->mode == GZ_WRITE ? + O_TRUNC : + O_APPEND))); + + /* open the file with the appropriate flags (or just use fd) */ + state->fd = fd > -1 ? fd : ( +#ifdef WIDECHAR + fd == -2 ? _wopen(path, oflag, 0666) : +#endif + open((const char *)path, oflag, 0666)); + if (state->fd == -1) { + free(state->path); + free(state); + return NULL; + } + if (state->mode == GZ_APPEND) { + LSEEK(state->fd, 0, SEEK_END); /* so gzoffset() is correct */ + state->mode = GZ_WRITE; /* simplify later checks */ + } + + /* save the current position for rewinding (only if reading) */ + if (state->mode == GZ_READ) { + state->start = LSEEK(state->fd, 0, SEEK_CUR); + if (state->start == -1) state->start = 0; + } + + /* initialize stream */ + gz_reset(state); + + /* return stream */ + return (gzFile)state; +} + +/* -- see zlib.h -- */ +gzFile ZEXPORT gzopen(path, mode) + const char *path; + const char *mode; +{ + return gz_open(path, -1, mode); +} + +/* -- see zlib.h -- */ +gzFile ZEXPORT gzopen64(path, mode) + const char *path; + const char *mode; +{ + return gz_open(path, -1, mode); +} + +/* -- see zlib.h -- */ +gzFile ZEXPORT gzdopen(fd, mode) + int fd; + const char *mode; +{ + char *path; /* identifier for error messages */ + gzFile gz; + + if (fd == -1 || (path = (char *)malloc(7 + 3 * sizeof(int))) == NULL) + return NULL; +#if !defined(NO_snprintf) && !defined(NO_vsnprintf) + (void)snprintf(path, 7 + 3 * sizeof(int), "<fd:%d>", fd); +#else + sprintf(path, "<fd:%d>", fd); /* for debugging */ +#endif + gz = gz_open(path, fd, mode); + free(path); + return gz; +} + +/* -- see zlib.h -- */ +#ifdef WIDECHAR +gzFile ZEXPORT gzopen_w(path, mode) + const wchar_t *path; + const char *mode; +{ + return gz_open(path, -2, mode); +} +#endif + +/* -- see zlib.h -- */ +int ZEXPORT gzbuffer(file, size) + gzFile file; + unsigned size; +{ + gz_statep state; + + /* get internal structure and check integrity */ + if (file == NULL) + return -1; + state = (gz_statep)file; + if (state->mode != GZ_READ && state->mode != GZ_WRITE) + return -1; + + /* make sure we haven't already allocated memory */ + if (state->size != 0) + return -1; + + /* check and set requested size */ + if ((size << 1) < size) + return -1; /* need to be able to double it */ + if (size < 2) + size = 2; /* need two bytes to check magic header */ + state->want = size; + return 0; +} + +/* -- see zlib.h -- */ +int ZEXPORT gzrewind(file) + gzFile file; +{ + gz_statep state; + + /* get internal structure */ + if (file == NULL) + return -1; + state = (gz_statep)file; + + /* check that we're reading and that there's no error */ + if (state->mode != GZ_READ || + (state->err != Z_OK && state->err != Z_BUF_ERROR)) + return -1; + + /* back up and start over */ + if (LSEEK(state->fd, state->start, SEEK_SET) == -1) + return -1; + gz_reset(state); + return 0; +} + +/* -- see zlib.h -- */ +z_off64_t ZEXPORT gzseek64(file, offset, whence) + gzFile file; + z_off64_t offset; + int whence; +{ + unsigned n; + z_off64_t ret; + gz_statep state; + + /* get internal structure and check integrity */ + if (file == NULL) + return -1; + state = (gz_statep)file; + if (state->mode != GZ_READ && state->mode != GZ_WRITE) + return -1; + + /* check that there's no error */ + if (state->err != Z_OK && state->err != Z_BUF_ERROR) + return -1; + + /* can only seek from start or relative to current position */ + if (whence != SEEK_SET && whence != SEEK_CUR) + return -1; + + /* normalize offset to a SEEK_CUR specification */ + if (whence == SEEK_SET) + offset -= state->x.pos; + else if (state->seek) + offset += state->skip; + state->seek = 0; + + /* if within raw area while reading, just go there */ + if (state->mode == GZ_READ && state->how == COPY && + state->x.pos + offset >= 0) { + ret = LSEEK(state->fd, offset - state->x.have, SEEK_CUR); + if (ret == -1) + return -1; + state->x.have = 0; + state->eof = 0; + state->past = 0; + state->seek = 0; + gz_error(state, Z_OK, NULL); + state->strm.avail_in = 0; + state->x.pos += offset; + return state->x.pos; + } + + /* calculate skip amount, rewinding if needed for back seek when reading */ + if (offset < 0) { + if (state->mode != GZ_READ) /* writing -- can't go backwards */ + return -1; + offset += state->x.pos; + if (offset < 0) /* before start of file! */ + return -1; + if (gzrewind(file) == -1) /* rewind, then skip to offset */ + return -1; + } + + /* if reading, skip what's in output buffer (one less gzgetc() check) */ + if (state->mode == GZ_READ) { + n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > offset ? + (unsigned)offset : state->x.have; + state->x.have -= n; + state->x.next += n; + state->x.pos += n; + offset -= n; + } + + /* request skip (if not zero) */ + if (offset) { + state->seek = 1; + state->skip = offset; + } + return state->x.pos + offset; +} + +/* -- see zlib.h -- */ +z_off_t ZEXPORT gzseek(file, offset, whence) + gzFile file; + z_off_t offset; + int whence; +{ + z_off64_t ret; + + ret = gzseek64(file, (z_off64_t)offset, whence); + return ret == (z_off_t)ret ? (z_off_t)ret : -1; +} + +/* -- see zlib.h -- */ +z_off64_t ZEXPORT gztell64(file) + gzFile file; +{ + gz_statep state; + + /* get internal structure and check integrity */ + if (file == NULL) + return -1; + state = (gz_statep)file; + if (state->mode != GZ_READ && state->mode != GZ_WRITE) + return -1; + + /* return position */ + return state->x.pos + (state->seek ? state->skip : 0); +} + +/* -- see zlib.h -- */ +z_off_t ZEXPORT gztell(file) + gzFile file; +{ + z_off64_t ret; + + ret = gztell64(file); + return ret == (z_off_t)ret ? (z_off_t)ret : -1; +} + +/* -- see zlib.h -- */ +z_off64_t ZEXPORT gzoffset64(file) + gzFile file; +{ + z_off64_t offset; + gz_statep state; + + /* get internal structure and check integrity */ + if (file == NULL) + return -1; + state = (gz_statep)file; + if (state->mode != GZ_READ && state->mode != GZ_WRITE) + return -1; + + /* compute and return effective offset in file */ + offset = LSEEK(state->fd, 0, SEEK_CUR); + if (offset == -1) + return -1; + if (state->mode == GZ_READ) /* reading */ + offset -= state->strm.avail_in; /* don't count buffered input */ + return offset; +} + +/* -- see zlib.h -- */ +z_off_t ZEXPORT gzoffset(file) + gzFile file; +{ + z_off64_t ret; + + ret = gzoffset64(file); + return ret == (z_off_t)ret ? (z_off_t)ret : -1; +} + +/* -- see zlib.h -- */ +int ZEXPORT gzeof(file) + gzFile file; +{ + gz_statep state; + + /* get internal structure and check integrity */ + if (file == NULL) + return 0; + state = (gz_statep)file; + if (state->mode != GZ_READ && state->mode != GZ_WRITE) + return 0; + + /* return end-of-file state */ + return state->mode == GZ_READ ? state->past : 0; +} + +/* -- see zlib.h -- */ +const char * ZEXPORT gzerror(file, errnum) + gzFile file; + int *errnum; +{ + gz_statep state; + + /* get internal structure and check integrity */ + if (file == NULL) + return NULL; + state = (gz_statep)file; + if (state->mode != GZ_READ && state->mode != GZ_WRITE) + return NULL; + + /* return error information */ + if (errnum != NULL) + *errnum = state->err; + return state->err == Z_MEM_ERROR ? "out of memory" : + (state->msg == NULL ? "" : state->msg); +} + +/* -- see zlib.h -- */ +void ZEXPORT gzclearerr(file) + gzFile file; +{ + gz_statep state; + + /* get internal structure and check integrity */ + if (file == NULL) + return; + state = (gz_statep)file; + if (state->mode != GZ_READ && state->mode != GZ_WRITE) + return; + + /* clear error and end-of-file */ + if (state->mode == GZ_READ) { + state->eof = 0; + state->past = 0; + } + gz_error(state, Z_OK, NULL); +} + +/* Create an error message in allocated memory and set state->err and + state->msg accordingly. Free any previous error message already there. Do + not try to free or allocate space if the error is Z_MEM_ERROR (out of + memory). Simply save the error message as a static string. If there is an + allocation failure constructing the error message, then convert the error to + out of memory. */ +void ZLIB_INTERNAL gz_error(state, err, msg) + gz_statep state; + int err; + const char *msg; +{ + /* free previously allocated message and clear */ + if (state->msg != NULL) { + if (state->err != Z_MEM_ERROR) + free(state->msg); + state->msg = NULL; + } + + /* if fatal, set state->x.have to 0 so that the gzgetc() macro fails */ + if (err != Z_OK && err != Z_BUF_ERROR) + state->x.have = 0; + + /* set error code, and if no message, then done */ + state->err = err; + if (msg == NULL) + return; + + /* for an out of memory error, return literal string when requested */ + if (err == Z_MEM_ERROR) + return; + + /* construct error message with path */ + if ((state->msg = (char *)malloc(strlen(state->path) + strlen(msg) + 3)) == + NULL) { + state->err = Z_MEM_ERROR; + return; + } +#if !defined(NO_snprintf) && !defined(NO_vsnprintf) + (void)snprintf(state->msg, strlen(state->path) + strlen(msg) + 3, + "%s%s%s", state->path, ": ", msg); +#else + strcpy(state->msg, state->path); + strcat(state->msg, ": "); + strcat(state->msg, msg); +#endif +} + +#ifndef INT_MAX +/* portably return maximum value for an int (when limits.h presumed not + available) -- we need to do this to cover cases where 2's complement not + used, since C standard permits 1's complement and sign-bit representations, + otherwise we could just use ((unsigned)-1) >> 1 */ +unsigned ZLIB_INTERNAL gz_intmax() +{ + unsigned p, q; + + p = 1; + do { + q = p; + p <<= 1; + p++; + } while (p > q); + return q >> 1; +} +#endif diff --git a/thirdparty/zlib/gzread.c b/thirdparty/zlib/gzread.c new file mode 100644 index 0000000000..956b91ea7d --- /dev/null +++ b/thirdparty/zlib/gzread.c @@ -0,0 +1,654 @@ +/* gzread.c -- zlib functions for reading gzip files + * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013, 2016 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "gzguts.h" + +/* Local functions */ +local int gz_load OF((gz_statep, unsigned char *, unsigned, unsigned *)); +local int gz_avail OF((gz_statep)); +local int gz_look OF((gz_statep)); +local int gz_decomp OF((gz_statep)); +local int gz_fetch OF((gz_statep)); +local int gz_skip OF((gz_statep, z_off64_t)); +local z_size_t gz_read OF((gz_statep, voidp, z_size_t)); + +/* Use read() to load a buffer -- return -1 on error, otherwise 0. Read from + state->fd, and update state->eof, state->err, and state->msg as appropriate. + This function needs to loop on read(), since read() is not guaranteed to + read the number of bytes requested, depending on the type of descriptor. */ +local int gz_load(state, buf, len, have) + gz_statep state; + unsigned char *buf; + unsigned len; + unsigned *have; +{ + int ret; + unsigned get, max = ((unsigned)-1 >> 2) + 1; + + *have = 0; + do { + get = len - *have; + if (get > max) + get = max; + ret = read(state->fd, buf + *have, get); + if (ret <= 0) + break; + *have += (unsigned)ret; + } while (*have < len); + if (ret < 0) { + gz_error(state, Z_ERRNO, zstrerror()); + return -1; + } + if (ret == 0) + state->eof = 1; + return 0; +} + +/* Load up input buffer and set eof flag if last data loaded -- return -1 on + error, 0 otherwise. Note that the eof flag is set when the end of the input + file is reached, even though there may be unused data in the buffer. Once + that data has been used, no more attempts will be made to read the file. + If strm->avail_in != 0, then the current data is moved to the beginning of + the input buffer, and then the remainder of the buffer is loaded with the + available data from the input file. */ +local int gz_avail(state) + gz_statep state; +{ + unsigned got; + z_streamp strm = &(state->strm); + + if (state->err != Z_OK && state->err != Z_BUF_ERROR) + return -1; + if (state->eof == 0) { + if (strm->avail_in) { /* copy what's there to the start */ + unsigned char *p = state->in; + unsigned const char *q = strm->next_in; + unsigned n = strm->avail_in; + do { + *p++ = *q++; + } while (--n); + } + if (gz_load(state, state->in + strm->avail_in, + state->size - strm->avail_in, &got) == -1) + return -1; + strm->avail_in += got; + strm->next_in = state->in; + } + return 0; +} + +/* Look for gzip header, set up for inflate or copy. state->x.have must be 0. + If this is the first time in, allocate required memory. state->how will be + left unchanged if there is no more input data available, will be set to COPY + if there is no gzip header and direct copying will be performed, or it will + be set to GZIP for decompression. If direct copying, then leftover input + data from the input buffer will be copied to the output buffer. In that + case, all further file reads will be directly to either the output buffer or + a user buffer. If decompressing, the inflate state will be initialized. + gz_look() will return 0 on success or -1 on failure. */ +local int gz_look(state) + gz_statep state; +{ + z_streamp strm = &(state->strm); + + /* allocate read buffers and inflate memory */ + if (state->size == 0) { + /* allocate buffers */ + state->in = (unsigned char *)malloc(state->want); + state->out = (unsigned char *)malloc(state->want << 1); + if (state->in == NULL || state->out == NULL) { + free(state->out); + free(state->in); + gz_error(state, Z_MEM_ERROR, "out of memory"); + return -1; + } + state->size = state->want; + + /* allocate inflate memory */ + state->strm.zalloc = Z_NULL; + state->strm.zfree = Z_NULL; + state->strm.opaque = Z_NULL; + state->strm.avail_in = 0; + state->strm.next_in = Z_NULL; + if (inflateInit2(&(state->strm), 15 + 16) != Z_OK) { /* gunzip */ + free(state->out); + free(state->in); + state->size = 0; + gz_error(state, Z_MEM_ERROR, "out of memory"); + return -1; + } + } + + /* get at least the magic bytes in the input buffer */ + if (strm->avail_in < 2) { + if (gz_avail(state) == -1) + return -1; + if (strm->avail_in == 0) + return 0; + } + + /* look for gzip magic bytes -- if there, do gzip decoding (note: there is + a logical dilemma here when considering the case of a partially written + gzip file, to wit, if a single 31 byte is written, then we cannot tell + whether this is a single-byte file, or just a partially written gzip + file -- for here we assume that if a gzip file is being written, then + the header will be written in a single operation, so that reading a + single byte is sufficient indication that it is not a gzip file) */ + if (strm->avail_in > 1 && + strm->next_in[0] == 31 && strm->next_in[1] == 139) { + inflateReset(strm); + state->how = GZIP; + state->direct = 0; + return 0; + } + + /* no gzip header -- if we were decoding gzip before, then this is trailing + garbage. Ignore the trailing garbage and finish. */ + if (state->direct == 0) { + strm->avail_in = 0; + state->eof = 1; + state->x.have = 0; + return 0; + } + + /* doing raw i/o, copy any leftover input to output -- this assumes that + the output buffer is larger than the input buffer, which also assures + space for gzungetc() */ + state->x.next = state->out; + if (strm->avail_in) { + memcpy(state->x.next, strm->next_in, strm->avail_in); + state->x.have = strm->avail_in; + strm->avail_in = 0; + } + state->how = COPY; + state->direct = 1; + return 0; +} + +/* Decompress from input to the provided next_out and avail_out in the state. + On return, state->x.have and state->x.next point to the just decompressed + data. If the gzip stream completes, state->how is reset to LOOK to look for + the next gzip stream or raw data, once state->x.have is depleted. Returns 0 + on success, -1 on failure. */ +local int gz_decomp(state) + gz_statep state; +{ + int ret = Z_OK; + unsigned had; + z_streamp strm = &(state->strm); + + /* fill output buffer up to end of deflate stream */ + had = strm->avail_out; + do { + /* get more input for inflate() */ + if (strm->avail_in == 0 && gz_avail(state) == -1) + return -1; + if (strm->avail_in == 0) { + gz_error(state, Z_BUF_ERROR, "unexpected end of file"); + break; + } + + /* decompress and handle errors */ + ret = inflate(strm, Z_NO_FLUSH); + if (ret == Z_STREAM_ERROR || ret == Z_NEED_DICT) { + gz_error(state, Z_STREAM_ERROR, + "internal error: inflate stream corrupt"); + return -1; + } + if (ret == Z_MEM_ERROR) { + gz_error(state, Z_MEM_ERROR, "out of memory"); + return -1; + } + if (ret == Z_DATA_ERROR) { /* deflate stream invalid */ + gz_error(state, Z_DATA_ERROR, + strm->msg == NULL ? "compressed data error" : strm->msg); + return -1; + } + } while (strm->avail_out && ret != Z_STREAM_END); + + /* update available output */ + state->x.have = had - strm->avail_out; + state->x.next = strm->next_out - state->x.have; + + /* if the gzip stream completed successfully, look for another */ + if (ret == Z_STREAM_END) + state->how = LOOK; + + /* good decompression */ + return 0; +} + +/* Fetch data and put it in the output buffer. Assumes state->x.have is 0. + Data is either copied from the input file or decompressed from the input + file depending on state->how. If state->how is LOOK, then a gzip header is + looked for to determine whether to copy or decompress. Returns -1 on error, + otherwise 0. gz_fetch() will leave state->how as COPY or GZIP unless the + end of the input file has been reached and all data has been processed. */ +local int gz_fetch(state) + gz_statep state; +{ + z_streamp strm = &(state->strm); + + do { + switch(state->how) { + case LOOK: /* -> LOOK, COPY (only if never GZIP), or GZIP */ + if (gz_look(state) == -1) + return -1; + if (state->how == LOOK) + return 0; + break; + case COPY: /* -> COPY */ + if (gz_load(state, state->out, state->size << 1, &(state->x.have)) + == -1) + return -1; + state->x.next = state->out; + return 0; + case GZIP: /* -> GZIP or LOOK (if end of gzip stream) */ + strm->avail_out = state->size << 1; + strm->next_out = state->out; + if (gz_decomp(state) == -1) + return -1; + } + } while (state->x.have == 0 && (!state->eof || strm->avail_in)); + return 0; +} + +/* Skip len uncompressed bytes of output. Return -1 on error, 0 on success. */ +local int gz_skip(state, len) + gz_statep state; + z_off64_t len; +{ + unsigned n; + + /* skip over len bytes or reach end-of-file, whichever comes first */ + while (len) + /* skip over whatever is in output buffer */ + if (state->x.have) { + n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > len ? + (unsigned)len : state->x.have; + state->x.have -= n; + state->x.next += n; + state->x.pos += n; + len -= n; + } + + /* output buffer empty -- return if we're at the end of the input */ + else if (state->eof && state->strm.avail_in == 0) + break; + + /* need more data to skip -- load up output buffer */ + else { + /* get more output, looking for header if required */ + if (gz_fetch(state) == -1) + return -1; + } + return 0; +} + +/* Read len bytes into buf from file, or less than len up to the end of the + input. Return the number of bytes read. If zero is returned, either the + end of file was reached, or there was an error. state->err must be + consulted in that case to determine which. */ +local z_size_t gz_read(state, buf, len) + gz_statep state; + voidp buf; + z_size_t len; +{ + z_size_t got; + unsigned n; + + /* if len is zero, avoid unnecessary operations */ + if (len == 0) + return 0; + + /* process a skip request */ + if (state->seek) { + state->seek = 0; + if (gz_skip(state, state->skip) == -1) + return 0; + } + + /* get len bytes to buf, or less than len if at the end */ + got = 0; + do { + /* set n to the maximum amount of len that fits in an unsigned int */ + n = -1; + if (n > len) + n = len; + + /* first just try copying data from the output buffer */ + if (state->x.have) { + if (state->x.have < n) + n = state->x.have; + memcpy(buf, state->x.next, n); + state->x.next += n; + state->x.have -= n; + } + + /* output buffer empty -- return if we're at the end of the input */ + else if (state->eof && state->strm.avail_in == 0) { + state->past = 1; /* tried to read past end */ + break; + } + + /* need output data -- for small len or new stream load up our output + buffer */ + else if (state->how == LOOK || n < (state->size << 1)) { + /* get more output, looking for header if required */ + if (gz_fetch(state) == -1) + return 0; + continue; /* no progress yet -- go back to copy above */ + /* the copy above assures that we will leave with space in the + output buffer, allowing at least one gzungetc() to succeed */ + } + + /* large len -- read directly into user buffer */ + else if (state->how == COPY) { /* read directly */ + if (gz_load(state, (unsigned char *)buf, n, &n) == -1) + return 0; + } + + /* large len -- decompress directly into user buffer */ + else { /* state->how == GZIP */ + state->strm.avail_out = n; + state->strm.next_out = (unsigned char *)buf; + if (gz_decomp(state) == -1) + return 0; + n = state->x.have; + state->x.have = 0; + } + + /* update progress */ + len -= n; + buf = (char *)buf + n; + got += n; + state->x.pos += n; + } while (len); + + /* return number of bytes read into user buffer */ + return got; +} + +/* -- see zlib.h -- */ +int ZEXPORT gzread(file, buf, len) + gzFile file; + voidp buf; + unsigned len; +{ + gz_statep state; + + /* get internal structure */ + if (file == NULL) + return -1; + state = (gz_statep)file; + + /* check that we're reading and that there's no (serious) error */ + if (state->mode != GZ_READ || + (state->err != Z_OK && state->err != Z_BUF_ERROR)) + return -1; + + /* since an int is returned, make sure len fits in one, otherwise return + with an error (this avoids a flaw in the interface) */ + if ((int)len < 0) { + gz_error(state, Z_STREAM_ERROR, "request does not fit in an int"); + return -1; + } + + /* read len or fewer bytes to buf */ + len = gz_read(state, buf, len); + + /* check for an error */ + if (len == 0 && state->err != Z_OK && state->err != Z_BUF_ERROR) + return -1; + + /* return the number of bytes read (this is assured to fit in an int) */ + return (int)len; +} + +/* -- see zlib.h -- */ +z_size_t ZEXPORT gzfread(buf, size, nitems, file) + voidp buf; + z_size_t size; + z_size_t nitems; + gzFile file; +{ + z_size_t len; + gz_statep state; + + /* get internal structure */ + if (file == NULL) + return 0; + state = (gz_statep)file; + + /* check that we're reading and that there's no (serious) error */ + if (state->mode != GZ_READ || + (state->err != Z_OK && state->err != Z_BUF_ERROR)) + return 0; + + /* compute bytes to read -- error on overflow */ + len = nitems * size; + if (size && len / size != nitems) { + gz_error(state, Z_STREAM_ERROR, "request does not fit in a size_t"); + return 0; + } + + /* read len or fewer bytes to buf, return the number of full items read */ + return len ? gz_read(state, buf, len) / size : 0; +} + +/* -- see zlib.h -- */ +#ifdef Z_PREFIX_SET +# undef z_gzgetc +#else +# undef gzgetc +#endif +int ZEXPORT gzgetc(file) + gzFile file; +{ + int ret; + unsigned char buf[1]; + gz_statep state; + + /* get internal structure */ + if (file == NULL) + return -1; + state = (gz_statep)file; + + /* check that we're reading and that there's no (serious) error */ + if (state->mode != GZ_READ || + (state->err != Z_OK && state->err != Z_BUF_ERROR)) + return -1; + + /* try output buffer (no need to check for skip request) */ + if (state->x.have) { + state->x.have--; + state->x.pos++; + return *(state->x.next)++; + } + + /* nothing there -- try gz_read() */ + ret = gz_read(state, buf, 1); + return ret < 1 ? -1 : buf[0]; +} + +int ZEXPORT gzgetc_(file) +gzFile file; +{ + return gzgetc(file); +} + +/* -- see zlib.h -- */ +int ZEXPORT gzungetc(c, file) + int c; + gzFile file; +{ + gz_statep state; + + /* get internal structure */ + if (file == NULL) + return -1; + state = (gz_statep)file; + + /* check that we're reading and that there's no (serious) error */ + if (state->mode != GZ_READ || + (state->err != Z_OK && state->err != Z_BUF_ERROR)) + return -1; + + /* process a skip request */ + if (state->seek) { + state->seek = 0; + if (gz_skip(state, state->skip) == -1) + return -1; + } + + /* can't push EOF */ + if (c < 0) + return -1; + + /* if output buffer empty, put byte at end (allows more pushing) */ + if (state->x.have == 0) { + state->x.have = 1; + state->x.next = state->out + (state->size << 1) - 1; + state->x.next[0] = (unsigned char)c; + state->x.pos--; + state->past = 0; + return c; + } + + /* if no room, give up (must have already done a gzungetc()) */ + if (state->x.have == (state->size << 1)) { + gz_error(state, Z_DATA_ERROR, "out of room to push characters"); + return -1; + } + + /* slide output data if needed and insert byte before existing data */ + if (state->x.next == state->out) { + unsigned char *src = state->out + state->x.have; + unsigned char *dest = state->out + (state->size << 1); + while (src > state->out) + *--dest = *--src; + state->x.next = dest; + } + state->x.have++; + state->x.next--; + state->x.next[0] = (unsigned char)c; + state->x.pos--; + state->past = 0; + return c; +} + +/* -- see zlib.h -- */ +char * ZEXPORT gzgets(file, buf, len) + gzFile file; + char *buf; + int len; +{ + unsigned left, n; + char *str; + unsigned char *eol; + gz_statep state; + + /* check parameters and get internal structure */ + if (file == NULL || buf == NULL || len < 1) + return NULL; + state = (gz_statep)file; + + /* check that we're reading and that there's no (serious) error */ + if (state->mode != GZ_READ || + (state->err != Z_OK && state->err != Z_BUF_ERROR)) + return NULL; + + /* process a skip request */ + if (state->seek) { + state->seek = 0; + if (gz_skip(state, state->skip) == -1) + return NULL; + } + + /* copy output bytes up to new line or len - 1, whichever comes first -- + append a terminating zero to the string (we don't check for a zero in + the contents, let the user worry about that) */ + str = buf; + left = (unsigned)len - 1; + if (left) do { + /* assure that something is in the output buffer */ + if (state->x.have == 0 && gz_fetch(state) == -1) + return NULL; /* error */ + if (state->x.have == 0) { /* end of file */ + state->past = 1; /* read past end */ + break; /* return what we have */ + } + + /* look for end-of-line in current output buffer */ + n = state->x.have > left ? left : state->x.have; + eol = (unsigned char *)memchr(state->x.next, '\n', n); + if (eol != NULL) + n = (unsigned)(eol - state->x.next) + 1; + + /* copy through end-of-line, or remainder if not found */ + memcpy(buf, state->x.next, n); + state->x.have -= n; + state->x.next += n; + state->x.pos += n; + left -= n; + buf += n; + } while (left && eol == NULL); + + /* return terminated string, or if nothing, end of file */ + if (buf == str) + return NULL; + buf[0] = 0; + return str; +} + +/* -- see zlib.h -- */ +int ZEXPORT gzdirect(file) + gzFile file; +{ + gz_statep state; + + /* get internal structure */ + if (file == NULL) + return 0; + state = (gz_statep)file; + + /* if the state is not known, but we can find out, then do so (this is + mainly for right after a gzopen() or gzdopen()) */ + if (state->mode == GZ_READ && state->how == LOOK && state->x.have == 0) + (void)gz_look(state); + + /* return 1 if transparent, 0 if processing a gzip stream */ + return state->direct; +} + +/* -- see zlib.h -- */ +int ZEXPORT gzclose_r(file) + gzFile file; +{ + int ret, err; + gz_statep state; + + /* get internal structure */ + if (file == NULL) + return Z_STREAM_ERROR; + state = (gz_statep)file; + + /* check that we're reading */ + if (state->mode != GZ_READ) + return Z_STREAM_ERROR; + + /* free memory and close file */ + if (state->size) { + inflateEnd(&(state->strm)); + free(state->out); + free(state->in); + } + err = state->err == Z_BUF_ERROR ? Z_BUF_ERROR : Z_OK; + gz_error(state, Z_OK, NULL); + free(state->path); + ret = close(state->fd); + free(state); + return ret ? Z_ERRNO : err; +} diff --git a/thirdparty/zlib/gzwrite.c b/thirdparty/zlib/gzwrite.c new file mode 100644 index 0000000000..1ec1da4095 --- /dev/null +++ b/thirdparty/zlib/gzwrite.c @@ -0,0 +1,665 @@ +/* gzwrite.c -- zlib functions for writing gzip files + * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013, 2016 Mark Adler + * For conditions of distribution and use, see copyright notice in zlib.h + */ + +#include "gzguts.h" + +/* Local functions */ +local int gz_init OF((gz_statep)); +local int gz_comp OF((gz_statep, int)); +local int gz_zero OF((gz_statep, z_off64_t)); +local z_size_t gz_write OF((gz_statep, voidpc, z_size_t)); + +/* Initialize state for writing a gzip file. Mark initialization by setting + state->size to non-zero. Return -1 on a memory allocation failure, or 0 on + success. */ +local int gz_init(state) + gz_statep state; +{ + int ret; + z_streamp strm = &(state->strm); + + /* allocate input buffer (double size for gzprintf) */ + state->in = (unsigned char *)malloc(state->want << 1); + if (state->in == NULL) { + gz_error(state, Z_MEM_ERROR, "out of memory"); + return -1; + } + + /* only need output buffer and deflate state if compressing */ + if (!state->direct) { + /* allocate output buffer */ + state->out = (unsigned char *)malloc(state->want); + if (state->out == NULL) { + free(state->in); + gz_error(state, Z_MEM_ERROR, "out of memory"); + return -1; + } + + /* allocate deflate memory, set up for gzip compression */ + strm->zalloc = Z_NULL; + strm->zfree = Z_NULL; + strm->opaque = Z_NULL; + ret = deflateInit2(strm, state->level, Z_DEFLATED, + MAX_WBITS + 16, DEF_MEM_LEVEL, state->strategy); + if (ret != Z_OK) { + free(state->out); + free(state->in); + gz_error(state, Z_MEM_ERROR, "out of memory"); + return -1; + } + strm->next_in = NULL; + } + + /* mark state as initialized */ + state->size = state->want; + + /* initialize write buffer if compressing */ + if (!state->direct) { + strm->avail_out = state->size; + strm->next_out = state->out; + state->x.next = strm->next_out; + } + return 0; +} + +/* Compress whatever is at avail_in and next_in and write to the output file. + Return -1 if there is an error writing to the output file or if gz_init() + fails to allocate memory, otherwise 0. flush is assumed to be a valid + deflate() flush value. If flush is Z_FINISH, then the deflate() state is + reset to start a new gzip stream. If gz->direct is true, then simply write + to the output file without compressing, and ignore flush. */ +local int gz_comp(state, flush) + gz_statep state; + int flush; +{ + int ret, writ; + unsigned have, put, max = ((unsigned)-1 >> 2) + 1; + z_streamp strm = &(state->strm); + + /* allocate memory if this is the first time through */ + if (state->size == 0 && gz_init(state) == -1) + return -1; + + /* write directly if requested */ + if (state->direct) { + while (strm->avail_in) { + put = strm->avail_in > max ? max : strm->avail_in; + writ = write(state->fd, strm->next_in, put); + if (writ < 0) { + gz_error(state, Z_ERRNO, zstrerror()); + return -1; + } + strm->avail_in -= (unsigned)writ; + strm->next_in += writ; + } + return 0; + } + + /* run deflate() on provided input until it produces no more output */ + ret = Z_OK; + do { + /* write out current buffer contents if full, or if flushing, but if + doing Z_FINISH then don't write until we get to Z_STREAM_END */ + if (strm->avail_out == 0 || (flush != Z_NO_FLUSH && + (flush != Z_FINISH || ret == Z_STREAM_END))) { + while (strm->next_out > state->x.next) { + put = strm->next_out - state->x.next > (int)max ? max : + (unsigned)(strm->next_out - state->x.next); + writ = write(state->fd, state->x.next, put); + if (writ < 0) { + gz_error(state, Z_ERRNO, zstrerror()); + return -1; + } + state->x.next += writ; + } + if (strm->avail_out == 0) { + strm->avail_out = state->size; + strm->next_out = state->out; + state->x.next = state->out; + } + } + + /* compress */ + have = strm->avail_out; + ret = deflate(strm, flush); + if (ret == Z_STREAM_ERROR) { + gz_error(state, Z_STREAM_ERROR, + "internal error: deflate stream corrupt"); + return -1; + } + have -= strm->avail_out; + } while (have); + + /* if that completed a deflate stream, allow another to start */ + if (flush == Z_FINISH) + deflateReset(strm); + + /* all done, no errors */ + return 0; +} + +/* Compress len zeros to output. Return -1 on a write error or memory + allocation failure by gz_comp(), or 0 on success. */ +local int gz_zero(state, len) + gz_statep state; + z_off64_t len; +{ + int first; + unsigned n; + z_streamp strm = &(state->strm); + + /* consume whatever's left in the input buffer */ + if (strm->avail_in && gz_comp(state, Z_NO_FLUSH) == -1) + return -1; + + /* compress len zeros (len guaranteed > 0) */ + first = 1; + while (len) { + n = GT_OFF(state->size) || (z_off64_t)state->size > len ? + (unsigned)len : state->size; + if (first) { + memset(state->in, 0, n); + first = 0; + } + strm->avail_in = n; + strm->next_in = state->in; + state->x.pos += n; + if (gz_comp(state, Z_NO_FLUSH) == -1) + return -1; + len -= n; + } + return 0; +} + +/* Write len bytes from buf to file. Return the number of bytes written. If + the returned value is less than len, then there was an error. */ +local z_size_t gz_write(state, buf, len) + gz_statep state; + voidpc buf; + z_size_t len; +{ + z_size_t put = len; + + /* if len is zero, avoid unnecessary operations */ + if (len == 0) + return 0; + + /* allocate memory if this is the first time through */ + if (state->size == 0 && gz_init(state) == -1) + return 0; + + /* check for seek request */ + if (state->seek) { + state->seek = 0; + if (gz_zero(state, state->skip) == -1) + return 0; + } + + /* for small len, copy to input buffer, otherwise compress directly */ + if (len < state->size) { + /* copy to input buffer, compress when full */ + do { + unsigned have, copy; + + if (state->strm.avail_in == 0) + state->strm.next_in = state->in; + have = (unsigned)((state->strm.next_in + state->strm.avail_in) - + state->in); + copy = state->size - have; + if (copy > len) + copy = len; + memcpy(state->in + have, buf, copy); + state->strm.avail_in += copy; + state->x.pos += copy; + buf = (const char *)buf + copy; + len -= copy; + if (len && gz_comp(state, Z_NO_FLUSH) == -1) + return 0; + } while (len); + } + else { + /* consume whatever's left in the input buffer */ + if (state->strm.avail_in && gz_comp(state, Z_NO_FLUSH) == -1) + return 0; + + /* directly compress user buffer to file */ + state->strm.next_in = (z_const Bytef *)buf; + do { + unsigned n = (unsigned)-1; + if (n > len) + n = len; + state->strm.avail_in = n; + state->x.pos += n; + if (gz_comp(state, Z_NO_FLUSH) == -1) + return 0; + len -= n; + } while (len); + } + + /* input was all buffered or compressed */ + return put; +} + +/* -- see zlib.h -- */ +int ZEXPORT gzwrite(file, buf, len) + gzFile file; + voidpc buf; + unsigned len; +{ + gz_statep state; + + /* get internal structure */ + if (file == NULL) + return 0; + state = (gz_statep)file; + + /* check that we're writing and that there's no error */ + if (state->mode != GZ_WRITE || state->err != Z_OK) + return 0; + + /* since an int is returned, make sure len fits in one, otherwise return + with an error (this avoids a flaw in the interface) */ + if ((int)len < 0) { + gz_error(state, Z_DATA_ERROR, "requested length does not fit in int"); + return 0; + } + + /* write len bytes from buf (the return value will fit in an int) */ + return (int)gz_write(state, buf, len); +} + +/* -- see zlib.h -- */ +z_size_t ZEXPORT gzfwrite(buf, size, nitems, file) + voidpc buf; + z_size_t size; + z_size_t nitems; + gzFile file; +{ + z_size_t len; + gz_statep state; + + /* get internal structure */ + if (file == NULL) + return 0; + state = (gz_statep)file; + + /* check that we're writing and that there's no error */ + if (state->mode != GZ_WRITE || state->err != Z_OK) + return 0; + + /* compute bytes to read -- error on overflow */ + len = nitems * size; + if (size && len / size != nitems) { + gz_error(state, Z_STREAM_ERROR, "request does not fit in a size_t"); + return 0; + } + + /* write len bytes to buf, return the number of full items written */ + return len ? gz_write(state, buf, len) / size : 0; +} + +/* -- see zlib.h -- */ +int ZEXPORT gzputc(file, c) + gzFile file; + int c; +{ + unsigned have; + unsigned char buf[1]; + gz_statep state; + z_streamp strm; + + /* get internal structure */ + if (file == NULL) + return -1; + state = (gz_statep)file; + strm = &(state->strm); + + /* check that we're writing and that there's no error */ + if (state->mode != GZ_WRITE || state->err != Z_OK) + return -1; + + /* check for seek request */ + if (state->seek) { + state->seek = 0; + if (gz_zero(state, state->skip) == -1) + return -1; + } + + /* try writing to input buffer for speed (state->size == 0 if buffer not + initialized) */ + if (state->size) { + if (strm->avail_in == 0) + strm->next_in = state->in; + have = (unsigned)((strm->next_in + strm->avail_in) - state->in); + if (have < state->size) { + state->in[have] = (unsigned char)c; + strm->avail_in++; + state->x.pos++; + return c & 0xff; + } + } + + /* no room in buffer or not initialized, use gz_write() */ + buf[0] = (unsigned char)c; + if (gz_write(state, buf, 1) != 1) + return -1; + return c & 0xff; +} + +/* -- see zlib.h -- */ +int ZEXPORT gzputs(file, str) + gzFile file; + const char *str; +{ + int ret; + z_size_t len; + gz_statep state; + + /* get internal structure */ + if (file == NULL) + return -1; + state = (gz_statep)file; + + /* check that we're writing and that there's no error */ + if (state->mode != GZ_WRITE || state->err != Z_OK) + return -1; + + /* write string */ + len = strlen(str); + ret = gz_write(state, str, len); + return ret == 0 && len != 0 ? -1 : ret; +} + +#if defined(STDC) || defined(Z_HAVE_STDARG_H) +#include <stdarg.h> + +/* -- see zlib.h -- */ +int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va) +{ + int len; + unsigned left; + char *next; + gz_statep state; + z_streamp strm; + + /* get internal structure */ + if (file == NULL) + return Z_STREAM_ERROR; + state = (gz_statep)file; + strm = &(state->strm); + + /* check that we're writing and that there's no error */ + if (state->mode != GZ_WRITE || state->err != Z_OK) + return Z_STREAM_ERROR; + + /* make sure we have some buffer space */ + if (state->size == 0 && gz_init(state) == -1) + return state->err; + + /* check for seek request */ + if (state->seek) { + state->seek = 0; + if (gz_zero(state, state->skip) == -1) + return state->err; + } + + /* do the printf() into the input buffer, put length in len -- the input + buffer is double-sized just for this function, so there is guaranteed to + be state->size bytes available after the current contents */ + if (strm->avail_in == 0) + strm->next_in = state->in; + next = (char *)(state->in + (strm->next_in - state->in) + strm->avail_in); + next[state->size - 1] = 0; +#ifdef NO_vsnprintf +# ifdef HAS_vsprintf_void + (void)vsprintf(next, format, va); + for (len = 0; len < state->size; len++) + if (next[len] == 0) break; +# else + len = vsprintf(next, format, va); +# endif +#else +# ifdef HAS_vsnprintf_void + (void)vsnprintf(next, state->size, format, va); + len = strlen(next); +# else + len = vsnprintf(next, state->size, format, va); +# endif +#endif + + /* check that printf() results fit in buffer */ + if (len == 0 || (unsigned)len >= state->size || next[state->size - 1] != 0) + return 0; + + /* update buffer and position, compress first half if past that */ + strm->avail_in += (unsigned)len; + state->x.pos += len; + if (strm->avail_in >= state->size) { + left = strm->avail_in - state->size; + strm->avail_in = state->size; + if (gz_comp(state, Z_NO_FLUSH) == -1) + return state->err; + memcpy(state->in, state->in + state->size, left); + strm->next_in = state->in; + strm->avail_in = left; + } + return len; +} + +int ZEXPORTVA gzprintf(gzFile file, const char *format, ...) +{ + va_list va; + int ret; + + va_start(va, format); + ret = gzvprintf(file, format, va); + va_end(va); + return ret; +} + +#else /* !STDC && !Z_HAVE_STDARG_H */ + +/* -- see zlib.h -- */ +int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, + a11, a12, a13, a14, a15, a16, a17, a18, a19, a20) + gzFile file; + const char *format; + int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, + a11, a12, a13, a14, a15, a16, a17, a18, a19, a20; +{ + unsigned len, left; + char *next; + gz_statep state; + z_streamp strm; + + /* get internal structure */ + if (file == NULL) + return Z_STREAM_ERROR; + state = (gz_statep)file; + strm = &(state->strm); + + /* check that can really pass pointer in ints */ + if (sizeof(int) != sizeof(void *)) + return Z_STREAM_ERROR; + + /* check that we're writing and that there's no error */ + if (state->mode != GZ_WRITE || state->err != Z_OK) + return Z_STREAM_ERROR; + + /* make sure we have some buffer space */ + if (state->size == 0 && gz_init(state) == -1) + return state->error; + + /* check for seek request */ + if (state->seek) { + state->seek = 0; + if (gz_zero(state, state->skip) == -1) + return state->error; + } + + /* do the printf() into the input buffer, put length in len -- the input + buffer is double-sized just for this function, so there is guaranteed to + be state->size bytes available after the current contents */ + if (strm->avail_in == 0) + strm->next_in = state->in; + next = (char *)(strm->next_in + strm->avail_in); + next[state->size - 1] = 0; +#ifdef NO_snprintf +# ifdef HAS_sprintf_void + sprintf(next, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, + a13, a14, a15, a16, a17, a18, a19, a20); + for (len = 0; len < size; len++) + if (next[len] == 0) + break; +# else + len = sprintf(next, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, + a12, a13, a14, a15, a16, a17, a18, a19, a20); +# endif +#else +# ifdef HAS_snprintf_void + snprintf(next, state->size, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); + len = strlen(next); +# else + len = snprintf(next, state->size, format, a1, a2, a3, a4, a5, a6, a7, a8, + a9, a10, a11, a12, a13, a14, a15, a16, a17, a18, a19, a20); +# endif +#endif + + /* check that printf() results fit in buffer */ + if (len == 0 || len >= state->size || next[state->size - 1] != 0) + return 0; + + /* update buffer and position, compress first half if past that */ + strm->avail_in += len; + state->x.pos += len; + if (strm->avail_in >= state->size) { + left = strm->avail_in - state->size; + strm->avail_in = state->size; + if (gz_comp(state, Z_NO_FLUSH) == -1) + return state->err; + memcpy(state->in, state->in + state->size, left); + strm->next_in = state->in; + strm->avail_in = left; + } + return (int)len; +} + +#endif + +/* -- see zlib.h -- */ +int ZEXPORT gzflush(file, flush) + gzFile file; + int flush; +{ + gz_statep state; + + /* get internal structure */ + if (file == NULL) + return Z_STREAM_ERROR; + state = (gz_statep)file; + + /* check that we're writing and that there's no error */ + if (state->mode != GZ_WRITE || state->err != Z_OK) + return Z_STREAM_ERROR; + + /* check flush parameter */ + if (flush < 0 || flush > Z_FINISH) + return Z_STREAM_ERROR; + + /* check for seek request */ + if (state->seek) { + state->seek = 0; + if (gz_zero(state, state->skip) == -1) + return state->err; + } + + /* compress remaining data with requested flush */ + (void)gz_comp(state, flush); + return state->err; +} + +/* -- see zlib.h -- */ +int ZEXPORT gzsetparams(file, level, strategy) + gzFile file; + int level; + int strategy; +{ + gz_statep state; + z_streamp strm; + + /* get internal structure */ + if (file == NULL) + return Z_STREAM_ERROR; + state = (gz_statep)file; + strm = &(state->strm); + + /* check that we're writing and that there's no error */ + if (state->mode != GZ_WRITE || state->err != Z_OK) + return Z_STREAM_ERROR; + + /* if no change is requested, then do nothing */ + if (level == state->level && strategy == state->strategy) + return Z_OK; + + /* check for seek request */ + if (state->seek) { + state->seek = 0; + if (gz_zero(state, state->skip) == -1) + return state->err; + } + + /* change compression parameters for subsequent input */ + if (state->size) { + /* flush previous input with previous parameters before changing */ + if (strm->avail_in && gz_comp(state, Z_BLOCK) == -1) + return state->err; + deflateParams(strm, level, strategy); + } + state->level = level; + state->strategy = strategy; + return Z_OK; +} + +/* -- see zlib.h -- */ +int ZEXPORT gzclose_w(file) + gzFile file; +{ + int ret = Z_OK; + gz_statep state; + + /* get internal structure */ + if (file == NULL) + return Z_STREAM_ERROR; + state = (gz_statep)file; + + /* check that we're writing */ + if (state->mode != GZ_WRITE) + return Z_STREAM_ERROR; + + /* check for seek request */ + if (state->seek) { + state->seek = 0; + if (gz_zero(state, state->skip) == -1) + ret = state->err; + } + + /* flush, free memory, and close file */ + if (gz_comp(state, Z_FINISH) == -1) + ret = state->err; + if (state->size) { + if (!state->direct) { + (void)deflateEnd(&(state->strm)); + free(state->out); + } + free(state->in); + } + gz_error(state, Z_OK, NULL); + free(state->path); + if (close(state->fd) == -1) + ret = Z_ERRNO; + free(state); + return ret; +} diff --git a/thirdparty/zlib/infback.c b/thirdparty/zlib/infback.c index f3833c2e43..59679ecbfc 100644 --- a/thirdparty/zlib/infback.c +++ b/thirdparty/zlib/infback.c @@ -1,5 +1,5 @@ /* infback.c -- inflate using a call-back interface - * Copyright (C) 1995-2011 Mark Adler + * Copyright (C) 1995-2016 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -61,7 +61,7 @@ int stream_size; Tracev((stderr, "inflate: allocated\n")); strm->state = (struct internal_state FAR *)state; state->dmax = 32768U; - state->wbits = windowBits; + state->wbits = (uInt)windowBits; state->wsize = 1U << windowBits; state->window = window; state->wnext = 0; diff --git a/thirdparty/zlib/inffast.c b/thirdparty/zlib/inffast.c index bda59ceb6a..29eb7d8244 100644 --- a/thirdparty/zlib/inffast.c +++ b/thirdparty/zlib/inffast.c @@ -1,5 +1,5 @@ /* inffast.c -- fast decoding - * Copyright (C) 1995-2008, 2010, 2013 Mark Adler + * Copyright (C) 1995-2008, 2010, 2013, 2016 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -8,26 +8,9 @@ #include "inflate.h" #include "inffast.h" -#ifndef ASMINF - -/* Allow machine dependent optimization for post-increment or pre-increment. - Based on testing to date, - Pre-increment preferred for: - - PowerPC G3 (Adler) - - MIPS R5000 (Randers-Pehrson) - Post-increment preferred for: - - none - No measurable difference: - - Pentium III (Anderson) - - M68060 (Nikl) - */ -#ifdef POSTINC -# define OFF 0 -# define PUP(a) *(a)++ +#ifdef ASMINF +# pragma message("Assembler code may have bugs -- use at your own risk") #else -# define OFF 1 -# define PUP(a) *++(a) -#endif /* Decode literal, length, and distance codes and write out the resulting @@ -96,9 +79,9 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ /* copy state to local variables */ state = (struct inflate_state FAR *)strm->state; - in = strm->next_in - OFF; + in = strm->next_in; last = in + (strm->avail_in - 5); - out = strm->next_out - OFF; + out = strm->next_out; beg = out - (start - strm->avail_out); end = out + (strm->avail_out - 257); #ifdef INFLATE_STRICT @@ -119,9 +102,9 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ input data or output space */ do { if (bits < 15) { - hold += (unsigned long)(PUP(in)) << bits; + hold += (unsigned long)(*in++) << bits; bits += 8; - hold += (unsigned long)(PUP(in)) << bits; + hold += (unsigned long)(*in++) << bits; bits += 8; } here = lcode[hold & lmask]; @@ -134,14 +117,14 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? "inflate: literal '%c'\n" : "inflate: literal 0x%02x\n", here.val)); - PUP(out) = (unsigned char)(here.val); + *out++ = (unsigned char)(here.val); } else if (op & 16) { /* length base */ len = (unsigned)(here.val); op &= 15; /* number of extra bits */ if (op) { if (bits < op) { - hold += (unsigned long)(PUP(in)) << bits; + hold += (unsigned long)(*in++) << bits; bits += 8; } len += (unsigned)hold & ((1U << op) - 1); @@ -150,9 +133,9 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ } Tracevv((stderr, "inflate: length %u\n", len)); if (bits < 15) { - hold += (unsigned long)(PUP(in)) << bits; + hold += (unsigned long)(*in++) << bits; bits += 8; - hold += (unsigned long)(PUP(in)) << bits; + hold += (unsigned long)(*in++) << bits; bits += 8; } here = dcode[hold & dmask]; @@ -165,10 +148,10 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ dist = (unsigned)(here.val); op &= 15; /* number of extra bits */ if (bits < op) { - hold += (unsigned long)(PUP(in)) << bits; + hold += (unsigned long)(*in++) << bits; bits += 8; if (bits < op) { - hold += (unsigned long)(PUP(in)) << bits; + hold += (unsigned long)(*in++) << bits; bits += 8; } } @@ -196,30 +179,30 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ #ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR if (len <= op - whave) { do { - PUP(out) = 0; + *out++ = 0; } while (--len); continue; } len -= op - whave; do { - PUP(out) = 0; + *out++ = 0; } while (--op > whave); if (op == 0) { from = out - dist; do { - PUP(out) = PUP(from); + *out++ = *from++; } while (--len); continue; } #endif } - from = window - OFF; + from = window; if (wnext == 0) { /* very common case */ from += wsize - op; if (op < len) { /* some from window */ len -= op; do { - PUP(out) = PUP(from); + *out++ = *from++; } while (--op); from = out - dist; /* rest from output */ } @@ -230,14 +213,14 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ if (op < len) { /* some from end of window */ len -= op; do { - PUP(out) = PUP(from); + *out++ = *from++; } while (--op); - from = window - OFF; + from = window; if (wnext < len) { /* some from start of window */ op = wnext; len -= op; do { - PUP(out) = PUP(from); + *out++ = *from++; } while (--op); from = out - dist; /* rest from output */ } @@ -248,35 +231,35 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ if (op < len) { /* some from window */ len -= op; do { - PUP(out) = PUP(from); + *out++ = *from++; } while (--op); from = out - dist; /* rest from output */ } } while (len > 2) { - PUP(out) = PUP(from); - PUP(out) = PUP(from); - PUP(out) = PUP(from); + *out++ = *from++; + *out++ = *from++; + *out++ = *from++; len -= 3; } if (len) { - PUP(out) = PUP(from); + *out++ = *from++; if (len > 1) - PUP(out) = PUP(from); + *out++ = *from++; } } else { from = out - dist; /* copy direct from output */ do { /* minimum length is three */ - PUP(out) = PUP(from); - PUP(out) = PUP(from); - PUP(out) = PUP(from); + *out++ = *from++; + *out++ = *from++; + *out++ = *from++; len -= 3; } while (len > 2); if (len) { - PUP(out) = PUP(from); + *out++ = *from++; if (len > 1) - PUP(out) = PUP(from); + *out++ = *from++; } } } @@ -313,8 +296,8 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ hold &= (1U << bits) - 1; /* update state and return */ - strm->next_in = in + OFF; - strm->next_out = out + OFF; + strm->next_in = in; + strm->next_out = out; strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last)); strm->avail_out = (unsigned)(out < end ? 257 + (end - out) : 257 - (out - end)); diff --git a/thirdparty/zlib/inflate.c b/thirdparty/zlib/inflate.c index 870f89bb4d..ac333e8c2e 100644 --- a/thirdparty/zlib/inflate.c +++ b/thirdparty/zlib/inflate.c @@ -1,5 +1,5 @@ /* inflate.c -- zlib decompression - * Copyright (C) 1995-2012 Mark Adler + * Copyright (C) 1995-2016 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -92,6 +92,7 @@ #endif /* function prototypes */ +local int inflateStateCheck OF((z_streamp strm)); local void fixedtables OF((struct inflate_state FAR *state)); local int updatewindow OF((z_streamp strm, const unsigned char FAR *end, unsigned copy)); @@ -101,12 +102,26 @@ local int updatewindow OF((z_streamp strm, const unsigned char FAR *end, local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf, unsigned len)); +local int inflateStateCheck(strm) +z_streamp strm; +{ + struct inflate_state FAR *state; + if (strm == Z_NULL || + strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) + return 1; + state = (struct inflate_state FAR *)strm->state; + if (state == Z_NULL || state->strm != strm || + state->mode < HEAD || state->mode > SYNC) + return 1; + return 0; +} + int ZEXPORT inflateResetKeep(strm) z_streamp strm; { struct inflate_state FAR *state; - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (inflateStateCheck(strm)) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; strm->total_in = strm->total_out = state->total = 0; strm->msg = Z_NULL; @@ -131,7 +146,7 @@ z_streamp strm; { struct inflate_state FAR *state; - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (inflateStateCheck(strm)) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; state->wsize = 0; state->whave = 0; @@ -147,7 +162,7 @@ int windowBits; struct inflate_state FAR *state; /* get the state */ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (inflateStateCheck(strm)) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; /* extract wrap request from windowBits parameter */ @@ -156,7 +171,7 @@ int windowBits; windowBits = -windowBits; } else { - wrap = (windowBits >> 4) + 1; + wrap = (windowBits >> 4) + 5; #ifdef GUNZIP if (windowBits < 48) windowBits &= 15; @@ -210,7 +225,9 @@ int stream_size; if (state == Z_NULL) return Z_MEM_ERROR; Tracev((stderr, "inflate: allocated\n")); strm->state = (struct internal_state FAR *)state; + state->strm = strm; state->window = Z_NULL; + state->mode = HEAD; /* to pass state test in inflateReset2() */ ret = inflateReset2(strm, windowBits); if (ret != Z_OK) { ZFREE(strm, state); @@ -234,17 +251,17 @@ int value; { struct inflate_state FAR *state; - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (inflateStateCheck(strm)) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; if (bits < 0) { state->hold = 0; state->bits = 0; return Z_OK; } - if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR; + if (bits > 16 || state->bits + (uInt)bits > 32) return Z_STREAM_ERROR; value &= (1L << bits) - 1; - state->hold += value << state->bits; - state->bits += bits; + state->hold += (unsigned)value << state->bits; + state->bits += (uInt)bits; return Z_OK; } @@ -625,7 +642,7 @@ int flush; static const unsigned short order[19] = /* permutation of code lengths */ {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; - if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL || + if (inflateStateCheck(strm) || strm->next_out == Z_NULL || (strm->next_in == Z_NULL && strm->avail_in != 0)) return Z_STREAM_ERROR; @@ -645,6 +662,8 @@ int flush; NEEDBITS(16); #ifdef GUNZIP if ((state->wrap & 2) && hold == 0x8b1f) { /* gzip header */ + if (state->wbits == 0) + state->wbits = 15; state->check = crc32(0L, Z_NULL, 0); CRC2(state->check, hold); INITBITS(); @@ -672,7 +691,7 @@ int flush; len = BITS(4) + 8; if (state->wbits == 0) state->wbits = len; - else if (len > state->wbits) { + if (len > 15 || len > state->wbits) { strm->msg = (char *)"invalid window size"; state->mode = BAD; break; @@ -699,14 +718,16 @@ int flush; } if (state->head != Z_NULL) state->head->text = (int)((hold >> 8) & 1); - if (state->flags & 0x0200) CRC2(state->check, hold); + if ((state->flags & 0x0200) && (state->wrap & 4)) + CRC2(state->check, hold); INITBITS(); state->mode = TIME; case TIME: NEEDBITS(32); if (state->head != Z_NULL) state->head->time = hold; - if (state->flags & 0x0200) CRC4(state->check, hold); + if ((state->flags & 0x0200) && (state->wrap & 4)) + CRC4(state->check, hold); INITBITS(); state->mode = OS; case OS: @@ -715,7 +736,8 @@ int flush; state->head->xflags = (int)(hold & 0xff); state->head->os = (int)(hold >> 8); } - if (state->flags & 0x0200) CRC2(state->check, hold); + if ((state->flags & 0x0200) && (state->wrap & 4)) + CRC2(state->check, hold); INITBITS(); state->mode = EXLEN; case EXLEN: @@ -724,7 +746,8 @@ int flush; state->length = (unsigned)(hold); if (state->head != Z_NULL) state->head->extra_len = (unsigned)hold; - if (state->flags & 0x0200) CRC2(state->check, hold); + if ((state->flags & 0x0200) && (state->wrap & 4)) + CRC2(state->check, hold); INITBITS(); } else if (state->head != Z_NULL) @@ -742,7 +765,7 @@ int flush; len + copy > state->head->extra_max ? state->head->extra_max - len : copy); } - if (state->flags & 0x0200) + if ((state->flags & 0x0200) && (state->wrap & 4)) state->check = crc32(state->check, next, copy); have -= copy; next += copy; @@ -761,9 +784,9 @@ int flush; if (state->head != Z_NULL && state->head->name != Z_NULL && state->length < state->head->name_max) - state->head->name[state->length++] = len; + state->head->name[state->length++] = (Bytef)len; } while (len && copy < have); - if (state->flags & 0x0200) + if ((state->flags & 0x0200) && (state->wrap & 4)) state->check = crc32(state->check, next, copy); have -= copy; next += copy; @@ -782,9 +805,9 @@ int flush; if (state->head != Z_NULL && state->head->comment != Z_NULL && state->length < state->head->comm_max) - state->head->comment[state->length++] = len; + state->head->comment[state->length++] = (Bytef)len; } while (len && copy < have); - if (state->flags & 0x0200) + if ((state->flags & 0x0200) && (state->wrap & 4)) state->check = crc32(state->check, next, copy); have -= copy; next += copy; @@ -796,7 +819,7 @@ int flush; case HCRC: if (state->flags & 0x0200) { NEEDBITS(16); - if (hold != (state->check & 0xffff)) { + if ((state->wrap & 4) && hold != (state->check & 0xffff)) { strm->msg = (char *)"header crc mismatch"; state->mode = BAD; break; @@ -1177,11 +1200,11 @@ int flush; out -= left; strm->total_out += out; state->total += out; - if (out) + if ((state->wrap & 4) && out) strm->adler = state->check = UPDATE(state->check, put - out, out); out = left; - if (( + if ((state->wrap & 4) && ( #ifdef GUNZIP state->flags ? hold : #endif @@ -1240,10 +1263,10 @@ int flush; strm->total_in += in; strm->total_out += out; state->total += out; - if (state->wrap && out) + if ((state->wrap & 4) && out) strm->adler = state->check = UPDATE(state->check, strm->next_out - out, out); - strm->data_type = state->bits + (state->last ? 64 : 0) + + strm->data_type = (int)state->bits + (state->last ? 64 : 0) + (state->mode == TYPE ? 128 : 0) + (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0); if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK) @@ -1255,7 +1278,7 @@ int ZEXPORT inflateEnd(strm) z_streamp strm; { struct inflate_state FAR *state; - if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) + if (inflateStateCheck(strm)) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; if (state->window != Z_NULL) ZFREE(strm, state->window); @@ -1273,7 +1296,7 @@ uInt *dictLength; struct inflate_state FAR *state; /* check state */ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (inflateStateCheck(strm)) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; /* copy dictionary */ @@ -1298,7 +1321,7 @@ uInt dictLength; int ret; /* check state */ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (inflateStateCheck(strm)) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; if (state->wrap != 0 && state->mode != DICT) return Z_STREAM_ERROR; @@ -1330,7 +1353,7 @@ gz_headerp head; struct inflate_state FAR *state; /* check state */ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (inflateStateCheck(strm)) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; if ((state->wrap & 2) == 0) return Z_STREAM_ERROR; @@ -1383,7 +1406,7 @@ z_streamp strm; struct inflate_state FAR *state; /* check parameters */ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (inflateStateCheck(strm)) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR; @@ -1430,7 +1453,7 @@ z_streamp strm; { struct inflate_state FAR *state; - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (inflateStateCheck(strm)) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; return state->mode == STORED && state->bits == 0; } @@ -1445,8 +1468,7 @@ z_streamp source; unsigned wsize; /* check input */ - if (dest == Z_NULL || source == Z_NULL || source->state == Z_NULL || - source->zalloc == (alloc_func)0 || source->zfree == (free_func)0) + if (inflateStateCheck(source) || dest == Z_NULL) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)source->state; @@ -1467,6 +1489,7 @@ z_streamp source; /* copy state */ zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream)); zmemcpy((voidpf)copy, (voidpf)state, sizeof(struct inflate_state)); + copy->strm = dest; if (state->lencode >= state->codes && state->lencode <= state->codes + ENOUGH - 1) { copy->lencode = copy->codes + (state->lencode - state->codes); @@ -1488,25 +1511,51 @@ int subvert; { struct inflate_state FAR *state; - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (inflateStateCheck(strm)) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; - state->sane = !subvert; #ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR + state->sane = !subvert; return Z_OK; #else + (void)subvert; state->sane = 1; return Z_DATA_ERROR; #endif } +int ZEXPORT inflateValidate(strm, check) +z_streamp strm; +int check; +{ + struct inflate_state FAR *state; + + if (inflateStateCheck(strm)) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if (check) + state->wrap |= 4; + else + state->wrap &= ~4; + return Z_OK; +} + long ZEXPORT inflateMark(strm) z_streamp strm; { struct inflate_state FAR *state; - if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16; + if (inflateStateCheck(strm)) + return -(1L << 16); state = (struct inflate_state FAR *)strm->state; - return ((long)(state->back) << 16) + + return (long)(((unsigned long)((long)state->back)) << 16) + (state->mode == COPY ? state->length : (state->mode == MATCH ? state->was - state->length : 0)); } + +unsigned long ZEXPORT inflateCodesUsed(strm) +z_streamp strm; +{ + struct inflate_state FAR *state; + if (inflateStateCheck(strm)) return (unsigned long)-1; + state = (struct inflate_state FAR *)strm->state; + return (unsigned long)(state->next - state->codes); +} diff --git a/thirdparty/zlib/inflate.h b/thirdparty/zlib/inflate.h index 95f4986d40..a46cce6b6d 100644 --- a/thirdparty/zlib/inflate.h +++ b/thirdparty/zlib/inflate.h @@ -1,5 +1,5 @@ /* inflate.h -- internal inflate state definition - * Copyright (C) 1995-2009 Mark Adler + * Copyright (C) 1995-2016 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -18,7 +18,7 @@ /* Possible inflate modes between inflate() calls */ typedef enum { - HEAD, /* i: waiting for magic header */ + HEAD = 16180, /* i: waiting for magic header */ FLAGS, /* i: waiting for method and flags (gzip) */ TIME, /* i: waiting for modification time (gzip) */ OS, /* i: waiting for extra flags and operating system (gzip) */ @@ -77,11 +77,14 @@ typedef enum { CHECK -> LENGTH -> DONE */ -/* state maintained between inflate() calls. Approximately 10K bytes. */ +/* State maintained between inflate() calls -- approximately 7K bytes, not + including the allocated sliding window, which is up to 32K bytes. */ struct inflate_state { + z_streamp strm; /* pointer back to this zlib stream */ inflate_mode mode; /* current inflate mode */ int last; /* true if processing last block */ - int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ + int wrap; /* bit 0 true for zlib, bit 1 true for gzip, + bit 2 true to validate check value */ int havedict; /* true if dictionary provided */ int flags; /* gzip header method and flags (0 if zlib) */ unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */ diff --git a/thirdparty/zlib/inftrees.c b/thirdparty/zlib/inftrees.c index 44d89cf24e..8a904ddbce 100644 --- a/thirdparty/zlib/inftrees.c +++ b/thirdparty/zlib/inftrees.c @@ -1,5 +1,5 @@ /* inftrees.c -- generate Huffman trees for efficient decoding - * Copyright (C) 1995-2013 Mark Adler + * Copyright (C) 1995-2017 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -9,7 +9,7 @@ #define MAXBITS 15 const char inflate_copyright[] = - " inflate 1.2.8 Copyright 1995-2013 Mark Adler "; + " inflate 1.2.10 Copyright 1995-2017 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -54,7 +54,7 @@ unsigned short FAR *work; code FAR *next; /* next available space in table */ const unsigned short FAR *base; /* base value table to use */ const unsigned short FAR *extra; /* extra bits table to use */ - int end; /* use base and extra for symbol > end */ + unsigned match; /* use base and extra for symbol >= match */ unsigned short count[MAXBITS+1]; /* number of codes of each length */ unsigned short offs[MAXBITS+1]; /* offsets in table for each length */ static const unsigned short lbase[31] = { /* Length codes 257..285 base */ @@ -62,7 +62,7 @@ unsigned short FAR *work; 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78}; + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 192, 202}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, @@ -181,19 +181,17 @@ unsigned short FAR *work; switch (type) { case CODES: base = extra = work; /* dummy value--not used */ - end = 19; + match = 20; break; case LENS: base = lbase; - base -= 257; extra = lext; - extra -= 257; - end = 256; + match = 257; break; - default: /* DISTS */ + default: /* DISTS */ base = dbase; extra = dext; - end = -1; + match = 0; } /* initialize state for loop */ @@ -216,13 +214,13 @@ unsigned short FAR *work; for (;;) { /* create table entry */ here.bits = (unsigned char)(len - drop); - if ((int)(work[sym]) < end) { + if (work[sym] + 1U < match) { here.op = (unsigned char)0; here.val = work[sym]; } - else if ((int)(work[sym]) > end) { - here.op = (unsigned char)(extra[work[sym]]); - here.val = base[work[sym]]; + else if (work[sym] >= match) { + here.op = (unsigned char)(extra[work[sym] - match]); + here.val = base[work[sym] - match]; } else { here.op = (unsigned char)(32 + 64); /* end of block */ diff --git a/thirdparty/zlib/trees.c b/thirdparty/zlib/trees.c index 1fd7759ef0..357f313925 100644 --- a/thirdparty/zlib/trees.c +++ b/thirdparty/zlib/trees.c @@ -1,5 +1,5 @@ /* trees.c -- output deflated data using Huffman coding - * Copyright (C) 1995-2012 Jean-loup Gailly + * Copyright (C) 1995-2016 Jean-loup Gailly * detect_data_type() function provided freely by Cosmin Truta, 2006 * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -36,7 +36,7 @@ #include "deflate.h" -#ifdef DEBUG +#ifdef ZLIB_DEBUG # include <ctype.h> #endif @@ -122,13 +122,13 @@ struct static_tree_desc_s { int max_length; /* max bit length for the codes */ }; -local static_tree_desc static_l_desc = +local const static_tree_desc static_l_desc = {static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS}; -local static_tree_desc static_d_desc = +local const static_tree_desc static_d_desc = {static_dtree, extra_dbits, 0, D_CODES, MAX_BITS}; -local static_tree_desc static_bl_desc = +local const static_tree_desc static_bl_desc = {(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS}; /* =========================================================================== @@ -152,18 +152,16 @@ local int detect_data_type OF((deflate_state *s)); local unsigned bi_reverse OF((unsigned value, int length)); local void bi_windup OF((deflate_state *s)); local void bi_flush OF((deflate_state *s)); -local void copy_block OF((deflate_state *s, charf *buf, unsigned len, - int header)); #ifdef GEN_TREES_H local void gen_trees_header OF((void)); #endif -#ifndef DEBUG +#ifndef ZLIB_DEBUG # define send_code(s, c, tree) send_bits(s, tree[c].Code, tree[c].Len) /* Send a code of the given tree. c and tree must not have side effects */ -#else /* DEBUG */ +#else /* !ZLIB_DEBUG */ # define send_code(s, c, tree) \ { if (z_verbose>2) fprintf(stderr,"\ncd %3d ",(c)); \ send_bits(s, tree[c].Code, tree[c].Len); } @@ -182,7 +180,7 @@ local void gen_trees_header OF((void)); * Send a value on a given number of bits. * IN assertion: length <= 16 and value fits in length bits. */ -#ifdef DEBUG +#ifdef ZLIB_DEBUG local void send_bits OF((deflate_state *s, int value, int length)); local void send_bits(s, value, length) @@ -208,12 +206,12 @@ local void send_bits(s, value, length) s->bi_valid += length; } } -#else /* !DEBUG */ +#else /* !ZLIB_DEBUG */ #define send_bits(s, value, length) \ { int len = length;\ if (s->bi_valid > (int)Buf_size - len) {\ - int val = value;\ + int val = (int)value;\ s->bi_buf |= (ush)val << s->bi_valid;\ put_short(s, s->bi_buf);\ s->bi_buf = (ush)val >> (Buf_size - s->bi_valid);\ @@ -223,7 +221,7 @@ local void send_bits(s, value, length) s->bi_valid += len;\ }\ } -#endif /* DEBUG */ +#endif /* ZLIB_DEBUG */ /* the arguments must not have side effects */ @@ -317,7 +315,7 @@ local void tr_static_init() * Genererate the file trees.h describing the static trees. */ #ifdef GEN_TREES_H -# ifndef DEBUG +# ifndef ZLIB_DEBUG # include <stdio.h> # endif @@ -394,7 +392,7 @@ void ZLIB_INTERNAL _tr_init(s) s->bi_buf = 0; s->bi_valid = 0; -#ifdef DEBUG +#ifdef ZLIB_DEBUG s->compressed_len = 0L; s->bits_sent = 0L; #endif @@ -522,12 +520,12 @@ local void gen_bitlen(s, desc) xbits = 0; if (n >= base) xbits = extra[n-base]; f = tree[n].Freq; - s->opt_len += (ulg)f * (bits + xbits); - if (stree) s->static_len += (ulg)f * (stree[n].Len + xbits); + s->opt_len += (ulg)f * (unsigned)(bits + xbits); + if (stree) s->static_len += (ulg)f * (unsigned)(stree[n].Len + xbits); } if (overflow == 0) return; - Trace((stderr,"\nbit length overflow\n")); + Tracev((stderr,"\nbit length overflow\n")); /* This happens for example on obj2 and pic of the Calgary corpus */ /* Find the first bit length which could increase: */ @@ -554,9 +552,8 @@ local void gen_bitlen(s, desc) m = s->heap[--h]; if (m > max_code) continue; if ((unsigned) tree[m].Len != (unsigned) bits) { - Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); - s->opt_len += ((long)bits - (long)tree[m].Len) - *(long)tree[m].Freq; + Tracev((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); + s->opt_len += ((ulg)bits - tree[m].Len) * tree[m].Freq; tree[m].Len = (ush)bits; } n--; @@ -578,7 +575,7 @@ local void gen_codes (tree, max_code, bl_count) ushf *bl_count; /* number of codes at each bit length */ { ush next_code[MAX_BITS+1]; /* next code value for each bit length */ - ush code = 0; /* running code value */ + unsigned code = 0; /* running code value */ int bits; /* bit index */ int n; /* code index */ @@ -586,7 +583,8 @@ local void gen_codes (tree, max_code, bl_count) * without bit reversal. */ for (bits = 1; bits <= MAX_BITS; bits++) { - next_code[bits] = code = (code + bl_count[bits-1]) << 1; + code = (code + bl_count[bits-1]) << 1; + next_code[bits] = (ush)code; } /* Check that the bit counts in bl_count are consistent. The last code * must be all ones. @@ -599,7 +597,7 @@ local void gen_codes (tree, max_code, bl_count) int len = tree[n].Len; if (len == 0) continue; /* Now reverse the bits */ - tree[n].Code = bi_reverse(next_code[len]++, len); + tree[n].Code = (ush)bi_reverse(next_code[len]++, len); Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ", n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1)); @@ -821,7 +819,7 @@ local int build_bl_tree(s) if (s->bl_tree[bl_order[max_blindex]].Len != 0) break; } /* Update opt_len to include the bit length tree and counts */ - s->opt_len += 3*(max_blindex+1) + 5+5+4; + s->opt_len += 3*((ulg)max_blindex+1) + 5+5+4; Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld", s->opt_len, s->static_len)); @@ -869,11 +867,17 @@ void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last) int last; /* one if this is the last block for a file */ { send_bits(s, (STORED_BLOCK<<1)+last, 3); /* send block type */ -#ifdef DEBUG + bi_windup(s); /* align on byte boundary */ + put_short(s, (ush)stored_len); + put_short(s, (ush)~stored_len); + zmemcpy(s->pending_buf + s->pending, (Bytef *)buf, stored_len); + s->pending += stored_len; +#ifdef ZLIB_DEBUG s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L; s->compressed_len += (stored_len + 4) << 3; + s->bits_sent += 2*16; + s->bits_sent += stored_len<<3; #endif - copy_block(s, buf, (unsigned)stored_len, 1); /* with header */ } /* =========================================================================== @@ -894,7 +898,7 @@ void ZLIB_INTERNAL _tr_align(s) { send_bits(s, STATIC_TREES<<1, 3); send_code(s, END_BLOCK, static_ltree); -#ifdef DEBUG +#ifdef ZLIB_DEBUG s->compressed_len += 10L; /* 3 for block type, 7 for EOB */ #endif bi_flush(s); @@ -974,7 +978,7 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) send_bits(s, (STATIC_TREES<<1)+last, 3); compress_block(s, (const ct_data *)static_ltree, (const ct_data *)static_dtree); -#ifdef DEBUG +#ifdef ZLIB_DEBUG s->compressed_len += 3 + s->static_len; #endif } else { @@ -983,7 +987,7 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) max_blindex+1); compress_block(s, (const ct_data *)s->dyn_ltree, (const ct_data *)s->dyn_dtree); -#ifdef DEBUG +#ifdef ZLIB_DEBUG s->compressed_len += 3 + s->opt_len; #endif } @@ -995,7 +999,7 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) if (last) { bi_windup(s); -#ifdef DEBUG +#ifdef ZLIB_DEBUG s->compressed_len += 7; /* align on byte boundary */ #endif } @@ -1090,7 +1094,7 @@ local void compress_block(s, ltree, dtree) send_code(s, code, dtree); /* send the distance code */ extra = extra_dbits[code]; if (extra != 0) { - dist -= base_dist[code]; + dist -= (unsigned)base_dist[code]; send_bits(s, dist, extra); /* send the extra distance bits */ } } /* literal or match pair ? */ @@ -1193,34 +1197,7 @@ local void bi_windup(s) } s->bi_buf = 0; s->bi_valid = 0; -#ifdef DEBUG +#ifdef ZLIB_DEBUG s->bits_sent = (s->bits_sent+7) & ~7; #endif } - -/* =========================================================================== - * Copy a stored block, storing first the length and its - * one's complement if requested. - */ -local void copy_block(s, buf, len, header) - deflate_state *s; - charf *buf; /* the input data */ - unsigned len; /* its length */ - int header; /* true if block header must be written */ -{ - bi_windup(s); /* align on byte boundary */ - - if (header) { - put_short(s, (ush)len); - put_short(s, (ush)~len); -#ifdef DEBUG - s->bits_sent += 2*16; -#endif - } -#ifdef DEBUG - s->bits_sent += (ulg)len<<3; -#endif - while (len--) { - put_byte(s, *buf++); - } -} diff --git a/thirdparty/zlib/uncompr.c b/thirdparty/zlib/uncompr.c index 242e9493df..f03a1a865e 100644 --- a/thirdparty/zlib/uncompr.c +++ b/thirdparty/zlib/uncompr.c @@ -1,5 +1,5 @@ /* uncompr.c -- decompress a memory buffer - * Copyright (C) 1995-2003, 2010 Jean-loup Gailly. + * Copyright (C) 1995-2003, 2010, 2014, 2016 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -9,51 +9,85 @@ #include "zlib.h" /* =========================================================================== - Decompresses the source buffer into the destination buffer. sourceLen is - the byte length of the source buffer. Upon entry, destLen is the total - size of the destination buffer, which must be large enough to hold the - entire uncompressed data. (The size of the uncompressed data must have - been saved previously by the compressor and transmitted to the decompressor - by some mechanism outside the scope of this compression library.) - Upon exit, destLen is the actual size of the compressed buffer. - - uncompress returns Z_OK if success, Z_MEM_ERROR if there was not - enough memory, Z_BUF_ERROR if there was not enough room in the output - buffer, or Z_DATA_ERROR if the input data was corrupted. + Decompresses the source buffer into the destination buffer. *sourceLen is + the byte length of the source buffer. Upon entry, *destLen is the total size + of the destination buffer, which must be large enough to hold the entire + uncompressed data. (The size of the uncompressed data must have been saved + previously by the compressor and transmitted to the decompressor by some + mechanism outside the scope of this compression library.) Upon exit, + *destLen is the size of the decompressed data and *sourceLen is the number + of source bytes consumed. Upon return, source + *sourceLen points to the + first unused input byte. + + uncompress returns Z_OK if success, Z_MEM_ERROR if there was not enough + memory, Z_BUF_ERROR if there was not enough room in the output buffer, or + Z_DATA_ERROR if the input data was corrupted, including if the input data is + an incomplete zlib stream. */ -int ZEXPORT uncompress (dest, destLen, source, sourceLen) +int ZEXPORT uncompress2 (dest, destLen, source, sourceLen) Bytef *dest; uLongf *destLen; const Bytef *source; - uLong sourceLen; + uLong *sourceLen; { z_stream stream; int err; + const uInt max = (uInt)-1; + uLong len, left; + Byte buf[1]; /* for detection of incomplete stream when *destLen == 0 */ - stream.next_in = (z_const Bytef *)source; - stream.avail_in = (uInt)sourceLen; - /* Check for source > 64K on 16-bit machine: */ - if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; - - stream.next_out = dest; - stream.avail_out = (uInt)*destLen; - if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; + len = *sourceLen; + if (*destLen) { + left = *destLen; + *destLen = 0; + } + else { + left = 1; + dest = buf; + } + stream.next_in = (z_const Bytef *)source; + stream.avail_in = 0; stream.zalloc = (alloc_func)0; stream.zfree = (free_func)0; + stream.opaque = (voidpf)0; err = inflateInit(&stream); if (err != Z_OK) return err; - err = inflate(&stream, Z_FINISH); - if (err != Z_STREAM_END) { - inflateEnd(&stream); - if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) - return Z_DATA_ERROR; - return err; - } - *destLen = stream.total_out; + stream.next_out = dest; + stream.avail_out = 0; - err = inflateEnd(&stream); - return err; + do { + if (stream.avail_out == 0) { + stream.avail_out = left > (uLong)max ? max : (uInt)left; + left -= stream.avail_out; + } + if (stream.avail_in == 0) { + stream.avail_in = len > (uLong)max ? max : (uInt)len; + len -= stream.avail_in; + } + err = inflate(&stream, Z_NO_FLUSH); + } while (err == Z_OK); + + *sourceLen -= len + stream.avail_in; + if (dest != buf) + *destLen = stream.total_out; + else if (stream.total_out && err == Z_BUF_ERROR) + left = 1; + + inflateEnd(&stream); + return err == Z_STREAM_END ? Z_OK : + err == Z_NEED_DICT ? Z_DATA_ERROR : + err == Z_BUF_ERROR && left + stream.avail_out ? Z_DATA_ERROR : + err; +} + +int ZEXPORT uncompress (dest, destLen, source, sourceLen) + Bytef *dest; + uLongf *destLen; + const Bytef *source; + uLong sourceLen; +{ + return uncompress2(dest, destLen, source, &sourceLen); } diff --git a/thirdparty/zlib/zconf.h b/thirdparty/zlib/zconf.h index f44af82fc2..5e1d68a004 100644 --- a/thirdparty/zlib/zconf.h +++ b/thirdparty/zlib/zconf.h @@ -1,5 +1,5 @@ /* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2013 Jean-loup Gailly. + * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -14,14 +14,10 @@ * Even better than compiling with -DZ_PREFIX would be to use configure to set * this permanently in zconf.h using "./configure --zprefix". */ - -#define Z_PREFIX -#define Z_SOLO - #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ # define Z_PREFIX_SET -/* all linked symbols */ +/* all linked symbols and init macros */ # define _dist_code z__dist_code # define _length_code z__length_code # define _tr_align z__tr_align @@ -33,6 +29,7 @@ # define adler32 z_adler32 # define adler32_combine z_adler32_combine # define adler32_combine64 z_adler32_combine64 +# define adler32_z z_adler32_z # ifndef Z_SOLO # define compress z_compress # define compress2 z_compress2 @@ -41,10 +38,14 @@ # define crc32 z_crc32 # define crc32_combine z_crc32_combine # define crc32_combine64 z_crc32_combine64 +# define crc32_z z_crc32_z # define deflate z_deflate # define deflateBound z_deflateBound # define deflateCopy z_deflateCopy # define deflateEnd z_deflateEnd +# define deflateGetDictionary z_deflateGetDictionary +# define deflateInit z_deflateInit +# define deflateInit2 z_deflateInit2 # define deflateInit2_ z_deflateInit2_ # define deflateInit_ z_deflateInit_ # define deflateParams z_deflateParams @@ -71,6 +72,8 @@ # define gzeof z_gzeof # define gzerror z_gzerror # define gzflush z_gzflush +# define gzfread z_gzfread +# define gzfwrite z_gzfwrite # define gzgetc z_gzgetc # define gzgetc_ z_gzgetc_ # define gzgets z_gzgets @@ -82,7 +85,6 @@ # define gzopen_w z_gzopen_w # endif # define gzprintf z_gzprintf -# define gzvprintf z_gzvprintf # define gzputc z_gzputc # define gzputs z_gzputs # define gzread z_gzread @@ -93,32 +95,39 @@ # define gztell z_gztell # define gztell64 z_gztell64 # define gzungetc z_gzungetc +# define gzvprintf z_gzvprintf # define gzwrite z_gzwrite # endif # define inflate z_inflate # define inflateBack z_inflateBack # define inflateBackEnd z_inflateBackEnd +# define inflateBackInit z_inflateBackInit # define inflateBackInit_ z_inflateBackInit_ +# define inflateCodesUsed z_inflateCodesUsed # define inflateCopy z_inflateCopy # define inflateEnd z_inflateEnd +# define inflateGetDictionary z_inflateGetDictionary # define inflateGetHeader z_inflateGetHeader +# define inflateInit z_inflateInit +# define inflateInit2 z_inflateInit2 # define inflateInit2_ z_inflateInit2_ # define inflateInit_ z_inflateInit_ # define inflateMark z_inflateMark # define inflatePrime z_inflatePrime # define inflateReset z_inflateReset # define inflateReset2 z_inflateReset2 +# define inflateResetKeep z_inflateResetKeep # define inflateSetDictionary z_inflateSetDictionary -# define inflateGetDictionary z_inflateGetDictionary # define inflateSync z_inflateSync # define inflateSyncPoint z_inflateSyncPoint # define inflateUndermine z_inflateUndermine -# define inflateResetKeep z_inflateResetKeep +# define inflateValidate z_inflateValidate # define inflate_copyright z_inflate_copyright # define inflate_fast z_inflate_fast # define inflate_table z_inflate_table # ifndef Z_SOLO # define uncompress z_uncompress +# define uncompress2 z_uncompress2 # endif # define zError z_zError # ifndef Z_SOLO @@ -228,9 +237,19 @@ # define z_const #endif -/* Some Mac compilers merge all .h files incorrectly: */ -#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) -# define NO_DUMMY_DECL +#ifdef Z_SOLO + typedef unsigned long z_size_t; +#else +# define z_longlong long long +# if defined(NO_SIZE_T) + typedef unsigned NO_SIZE_T z_size_t; +# elif defined(STDC) +# include <stddef.h> + typedef size_t z_size_t; +# else + typedef unsigned long z_size_t; +# endif +# undef z_longlong #endif /* Maximum value for memLevel in deflateInit2 */ @@ -260,7 +279,7 @@ Of course this will generally degrade compression (there's no free lunch). The memory requirements for inflate are (in bytes) 1 << windowBits - that is, 32K for windowBits=15 (default value) plus a few kilobytes + that is, 32K for windowBits=15 (default value) plus about 7 kilobytes for small objects. */ diff --git a/thirdparty/zlib/zlib.h b/thirdparty/zlib/zlib.h index 3e0c7672ac..dc90dc8d22 100644 --- a/thirdparty/zlib/zlib.h +++ b/thirdparty/zlib/zlib.h @@ -1,7 +1,7 @@ /* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.8, April 28th, 2013 + version 1.2.10, January 2nd, 2017 - Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler + Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -37,11 +37,11 @@ extern "C" { #endif -#define ZLIB_VERSION "1.2.8" -#define ZLIB_VERNUM 0x1280 +#define ZLIB_VERSION "1.2.10" +#define ZLIB_VERNUM 0x12a0 #define ZLIB_VER_MAJOR 1 #define ZLIB_VER_MINOR 2 -#define ZLIB_VER_REVISION 8 +#define ZLIB_VER_REVISION 10 #define ZLIB_VER_SUBREVISION 0 /* @@ -65,7 +65,8 @@ extern "C" { with "gz". The gzip format is different from the zlib format. gzip is a gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. - This library can optionally read and write gzip streams in memory as well. + This library can optionally read and write gzip and raw deflate streams in + memory as well. The zlib format was designed to be compact and fast for use in memory and on communications channels. The gzip format was designed for single- @@ -74,7 +75,7 @@ extern "C" { The library does not install any signal handler. The decoder checks the consistency of the compressed data, so the library should never crash - even in case of corrupted input. + even in the case of corrupted input. */ typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); @@ -87,7 +88,7 @@ typedef struct z_stream_s { uInt avail_in; /* number of bytes available at next_in */ uLong total_in; /* total number of input bytes read so far */ - Bytef *next_out; /* next output byte should be put there */ + Bytef *next_out; /* next output byte will go here */ uInt avail_out; /* remaining free space at next_out */ uLong total_out; /* total number of bytes output so far */ @@ -98,8 +99,9 @@ typedef struct z_stream_s { free_func zfree; /* used to free the internal state */ voidpf opaque; /* private data object passed to zalloc and zfree */ - int data_type; /* best guess about the data type: binary or text */ - uLong adler; /* adler32 value of the uncompressed data */ + int data_type; /* best guess about the data type: binary or text + for deflate, or the decoding state for inflate */ + uLong adler; /* Adler-32 or CRC-32 value of the uncompressed data */ uLong reserved; /* reserved for future use */ } z_stream; @@ -142,7 +144,9 @@ typedef gz_header FAR *gz_headerp; zalloc must return Z_NULL if there is not enough memory for the object. If zlib is used in a multi-threaded application, zalloc and zfree must be - thread safe. + thread safe. In that case, zlib is thread-safe. When zalloc and zfree are + Z_NULL on entry to the initialization function, they are set to internal + routines that use the standard library functions malloc() and free(). On 16-bit systems, the functions zalloc and zfree must be able to allocate exactly 65536 bytes, but will not be required to allocate more than this if @@ -155,7 +159,7 @@ typedef gz_header FAR *gz_headerp; The fields total_in and total_out can be used for statistics or progress reports. After compression, total_in holds the total size of the - uncompressed data and may be saved for use in the decompressor (particularly + uncompressed data and may be saved for use by the decompressor (particularly if the decompressor wants to decompress everything in a single step). */ @@ -200,7 +204,7 @@ typedef gz_header FAR *gz_headerp; #define Z_TEXT 1 #define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ #define Z_UNKNOWN 2 -/* Possible values of the data_type field (though see inflate()) */ +/* Possible values of the data_type field for deflate() */ #define Z_DEFLATED 8 /* The deflate compression method (the only one supported in this version) */ @@ -258,11 +262,11 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); enough room in the output buffer), next_in and avail_in are updated and processing will resume at this point for the next call of deflate(). - - Provide more output starting at next_out and update next_out and avail_out + - Generate more output starting at next_out and update next_out and avail_out accordingly. This action is forced if the parameter flush is non zero. Forcing flush frequently degrades the compression ratio, so this parameter - should be set only when necessary (in interactive applications). Some - output may be provided even if flush is not set. + should be set only when necessary. Some output may be provided even if + flush is zero. Before the call of deflate(), the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more @@ -271,7 +275,9 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); output when it wants, for example when the output buffer is full (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK and with zero avail_out, it must be called again after making room in the output - buffer because there might be more output pending. + buffer because there might be more output pending. See deflatePending(), + which can be used if desired to determine whether or not there is more ouput + in that case. Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to decide how much data to accumulate before producing output, in order to @@ -292,8 +298,8 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. This completes the current deflate block and follows it with an empty fixed codes block that is 10 bits long. This assures that enough bytes are output - in order for the decompressor to finish the block before the empty fixed code - block. + in order for the decompressor to finish the block before the empty fixed + codes block. If flush is set to Z_BLOCK, a deflate block is completed and emitted, as for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to @@ -319,34 +325,38 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); If the parameter flush is set to Z_FINISH, pending input is processed, pending output is flushed and deflate returns with Z_STREAM_END if there was - enough output space; if deflate returns with Z_OK, this function must be - called again with Z_FINISH and more output space (updated avail_out) but no - more input data, until it returns with Z_STREAM_END or an error. After - deflate has returned Z_STREAM_END, the only possible operations on the stream - are deflateReset or deflateEnd. - - Z_FINISH can be used immediately after deflateInit if all the compression - is to be done in a single step. In this case, avail_out must be at least the - value returned by deflateBound (see below). Then deflate is guaranteed to - return Z_STREAM_END. If not enough output space is provided, deflate will - not return Z_STREAM_END, and it must be called again as described above. - - deflate() sets strm->adler to the adler32 checksum of all input read - so far (that is, total_in bytes). + enough output space. If deflate returns with Z_OK or Z_BUF_ERROR, this + function must be called again with Z_FINISH and more output space (updated + avail_out) but no more input data, until it returns with Z_STREAM_END or an + error. After deflate has returned Z_STREAM_END, the only possible operations + on the stream are deflateReset or deflateEnd. + + Z_FINISH can be used in the first deflate call after deflateInit if all the + compression is to be done in a single step. In order to complete in one + call, avail_out must be at least the value returned by deflateBound (see + below). Then deflate is guaranteed to return Z_STREAM_END. If not enough + output space is provided, deflate will not return Z_STREAM_END, and it must + be called again as described above. + + deflate() sets strm->adler to the Adler-32 checksum of all input read + so far (that is, total_in bytes). If a gzip stream is being generated, then + strm->adler will be the CRC-32 checksum of the input read so far. (See + deflateInit2 below.) deflate() may update strm->data_type if it can make a good guess about - the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered - binary. This field is only for information purposes and does not affect the - compression algorithm in any manner. + the input data type (Z_BINARY or Z_TEXT). If in doubt, the data is + considered binary. This field is only for information purposes and does not + affect the compression algorithm in any manner. deflate() returns Z_OK if some progress has been made (more input processed or more output produced), Z_STREAM_END if all input has been consumed and all output has been produced (only when flush is set to Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example - if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible - (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not - fatal, and deflate() can be called again with more input and more output - space to continue compressing. + if next_in or next_out was Z_NULL or the state was inadvertently written over + by the application), or Z_BUF_ERROR if no progress is possible (for example + avail_in or avail_out was zero). Note that Z_BUF_ERROR is not fatal, and + deflate() can be called again with more input and more output space to + continue compressing. */ @@ -369,23 +379,21 @@ ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); Initializes the internal stream state for decompression. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized before by - the caller. If next_in is not Z_NULL and avail_in is large enough (the - exact value depends on the compression method), inflateInit determines the - compression method from the zlib header and allocates all data structures - accordingly; otherwise the allocation will be deferred to the first call of - inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to - use default allocation functions. + the caller. In the current version of inflate, the provided input is not + read or consumed. The allocation of a sliding window will be deferred to + the first call of inflate (if the decompression does not complete on the + first call). If zalloc and zfree are set to Z_NULL, inflateInit updates + them to use default allocation functions. inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the version assumed by the caller, or Z_STREAM_ERROR if the parameters are invalid, such as a null pointer to the structure. msg is set to null if - there is no error message. inflateInit does not perform any decompression - apart from possibly reading the zlib header if present: actual decompression - will be done by inflate(). (So next_in and avail_in may be modified, but - next_out and avail_out are unused and unchanged.) The current implementation - of inflateInit() does not process any header information -- that is deferred - until inflate() is called. + there is no error message. inflateInit does not perform any decompression. + Actual decompression will be done by inflate(). So next_in, and avail_in, + next_out, and avail_out are unused and unchanged. The current + implementation of inflateInit() does not process any header information -- + that is deferred until inflate() is called. */ @@ -401,17 +409,20 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); - Decompress more input starting at next_in and update next_in and avail_in accordingly. If not all input can be processed (because there is not - enough room in the output buffer), next_in is updated and processing will - resume at this point for the next call of inflate(). + enough room in the output buffer), then next_in and avail_in are updated + accordingly, and processing will resume at this point for the next call of + inflate(). - - Provide more output starting at next_out and update next_out and avail_out + - Generate more output starting at next_out and update next_out and avail_out accordingly. inflate() provides as much output as possible, until there is no more input data or no more space in the output buffer (see below about the flush parameter). Before the call of inflate(), the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more - output, and updating the next_* and avail_* values accordingly. The + output, and updating the next_* and avail_* values accordingly. If the + caller of inflate() does not provide both available input and available + output space, it is possible that there will be no progress made. The application can consume the uncompressed output when it wants, for example when the output buffer is full (avail_out == 0), or after each call of inflate(). If inflate returns Z_OK and with zero avail_out, it must be @@ -428,7 +439,7 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); gets to the end of that block, or when it runs out of data. The Z_BLOCK option assists in appending to or combining deflate streams. - Also to assist in this, on return inflate() will set strm->data_type to the + To assist in this, on return inflate() always sets strm->data_type to the number of unused bits in the last byte taken from strm->next_in, plus 64 if inflate() is currently decoding the last block in the deflate stream, plus 128 if inflate() returned immediately after decoding an end-of-block code or @@ -454,7 +465,7 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); this case all pending input is processed and all pending output is flushed; avail_out must be large enough to hold all of the uncompressed data for the operation to complete. (The size of the uncompressed data may have been - saved by the compressor for this purpose.) The use of Z_FINISH is not + saved by the compressor for this purpose.) The use of Z_FINISH is not required to perform an inflation in one step. However it may be used to inform inflate that a faster approach can be used for the single inflate() call. Z_FINISH also informs inflate to not maintain a sliding window if the @@ -476,32 +487,33 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); chosen by the compressor and returns Z_NEED_DICT; otherwise it sets strm->adler to the Adler-32 checksum of all output produced so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described - below. At the end of the stream, inflate() checks that its computed adler32 + below. At the end of the stream, inflate() checks that its computed Adler-32 checksum is equal to that saved by the compressor and returns Z_STREAM_END only if the checksum is correct. inflate() can decompress and check either zlib-wrapped or gzip-wrapped deflate data. The header type is detected automatically, if requested when initializing with inflateInit2(). Any information contained in the gzip - header is not retained, so applications that need that information should - instead use raw inflate, see inflateInit2() below, or inflateBack() and - perform their own processing of the gzip header and trailer. When processing + header is not retained unless inflateGetHeader() is used. When processing gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output - producted so far. The CRC-32 is checked against the gzip trailer. + produced so far. The CRC-32 is checked against the gzip trailer, as is the + uncompressed length, modulo 2^32. inflate() returns Z_OK if some progress has been made (more input processed or more output produced), Z_STREAM_END if the end of the compressed data has been reached and all uncompressed output has been produced, Z_NEED_DICT if a preset dictionary is needed at this point, Z_DATA_ERROR if the input data was corrupted (input stream not conforming to the zlib format or incorrect check - value), Z_STREAM_ERROR if the stream structure was inconsistent (for example - next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory, - Z_BUF_ERROR if no progress is possible or if there was not enough room in the - output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and + value, in which case strm->msg points to a string with a more specific + error), Z_STREAM_ERROR if the stream structure was inconsistent (for example + next_in or next_out was Z_NULL, or the state was inadvertently written over + by the application), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR + if no progress was possible or if there was not enough room in the output + buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and inflate() can be called again with more input and more output space to continue decompressing. If Z_DATA_ERROR is returned, the application may then call inflateSync() to look for a good compression block if a partial - recovery of the data is desired. + recovery of the data is to be attempted. */ @@ -511,9 +523,8 @@ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); This function discards any unprocessed input and does not flush any pending output. - inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state - was inconsistent. In the error case, msg may be set but then points to a - static string (which must not be deallocated). + inflateEnd returns Z_OK if success, or Z_STREAM_ERROR if the stream state + was inconsistent. */ @@ -544,16 +555,29 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, compression at the expense of memory usage. The default value is 15 if deflateInit is used instead. + For the current implementation of deflate(), a windowBits value of 8 (a + window size of 256 bytes) is not supported. As a result, a request for 8 + will result in 9 (a 512-byte window). In that case, providing 8 to + inflateInit2() will result in an error when the zlib header with 9 is + checked against the initialization of inflate(). The remedy is to not use 8 + with deflateInit2() with this initialization, or at least in that case use 9 + with inflateInit2(). + windowBits can also be -8..-15 for raw deflate. In this case, -windowBits determines the window size. deflate() will then generate raw deflate data - with no zlib header or trailer, and will not compute an adler32 check value. + with no zlib header or trailer, and will not compute a check value. windowBits can also be greater than 15 for optional gzip encoding. Add 16 to windowBits to write a simple gzip header and trailer around the compressed data instead of a zlib wrapper. The gzip header will have no file name, no extra data, no comment, no modification time (set to zero), no - header crc, and the operating system will be set to 255 (unknown). If a - gzip stream is being written, strm->adler is a crc32 instead of an adler32. + header crc, and the operating system will be set to the appropriate value, + if the operating system was determined at compile time. If a gzip stream is + being written, strm->adler is a CRC-32 instead of an Adler-32. + + For raw deflate or gzip encoding, a request for a 256-byte window is + rejected as invalid, since only the zlib header provides a means of + transmitting the window size to the decompressor. The memLevel parameter specifies how much memory should be allocated for the internal compression state. memLevel=1 uses minimum memory but is @@ -614,12 +638,12 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, addition, the current implementation of deflate will use at most the window size minus 262 bytes of the provided dictionary. - Upon return of this function, strm->adler is set to the adler32 value + Upon return of this function, strm->adler is set to the Adler-32 value of the dictionary; the decompressor may later use this value to determine - which dictionary has been used by the compressor. (The adler32 value + which dictionary has been used by the compressor. (The Adler-32 value applies to the whole dictionary even if only a subset of the dictionary is actually used by the compressor.) If a raw deflate was requested, then the - adler32 value is not computed and strm->adler is not set. + Adler-32 value is not computed and strm->adler is not set. deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is @@ -628,6 +652,28 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, not perform any compression: this will be done by deflate(). */ +ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm, + Bytef *dictionary, + uInt *dictLength)); +/* + Returns the sliding dictionary being maintained by deflate. dictLength is + set to the number of bytes in the dictionary, and that many bytes are copied + to dictionary. dictionary must have enough space, where 32768 bytes is + always enough. If deflateGetDictionary() is called with dictionary equal to + Z_NULL, then only the dictionary length is returned, and nothing is copied. + Similary, if dictLength is Z_NULL, then it is not set. + + deflateGetDictionary() may return a length less than the window size, even + when more than the window size in input has been provided. It may return up + to 258 bytes less in that case, due to how zlib's implementation of deflate + manages the sliding window and lookahead for matches, where matches can be + up to 258 bytes long. If the application needs the last window-size bytes of + input, then that would need to be saved by the application outside of zlib. + + deflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the + stream state is inconsistent. +*/ + ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, z_streamp source)); /* @@ -648,10 +694,10 @@ ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); /* - This function is equivalent to deflateEnd followed by deflateInit, - but does not free and reallocate all the internal compression state. The - stream will keep the same compression level and any other attributes that - may have been set by deflateInit2. + This function is equivalent to deflateEnd followed by deflateInit, but + does not free and reallocate the internal compression state. The stream + will leave the compression level and any other attributes that may have been + set unchanged. deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL). @@ -662,20 +708,35 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, int strategy)); /* Dynamically update the compression level and compression strategy. The - interpretation of level and strategy is as in deflateInit2. This can be + interpretation of level and strategy is as in deflateInit2(). This can be used to switch between compression and straight copy of the input data, or to switch to a different kind of input data requiring a different strategy. - If the compression level is changed, the input available so far is - compressed with the old level (and may be flushed); the new level will take - effect only at the next call of deflate(). - - Before the call of deflateParams, the stream state must be set as for - a call of deflate(), since the currently available input may have to be - compressed and flushed. In particular, strm->avail_out must be non-zero. - - deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source - stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if - strm->avail_out was zero. + If the compression approach (which is a function of the level) or the + strategy is changed, then the input available so far is compressed with the + old level and strategy using deflate(strm, Z_BLOCK). There are three + approaches for the compression levels 0, 1..3, and 4..9 respectively. The + new level and strategy will take effect at the next call of deflate(). + + If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does + not have enough output space to complete, then the parameter change will not + take effect. In this case, deflateParams() can be called again with the + same parameters and more output space to try again. + + In order to assure a change in the parameters on the first try, the + deflate stream should be flushed using deflate() with Z_BLOCK or other flush + request until strm.avail_out is not zero, before calling deflateParams(). + Then no more input data should be provided before the deflateParams() call. + If this is done, the old level and strategy will be applied to the data + compressed before deflateParams(), and the new level and strategy will be + applied to the the data compressed after deflateParams(). + + deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream + state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if + there was not enough output space to complete the compression of the + available input data before a change in the strategy or approach. Note that + in the case of a Z_BUF_ERROR, the parameters are not changed. A return + value of Z_BUF_ERROR is not fatal, in which case deflateParams() can be + retried with more output space. */ ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, @@ -793,7 +854,7 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, is for use with other formats that use the deflate compressed data format such as zip. Those formats provide their own check values. If a custom format is developed using the raw deflate format for compressed data, it is - recommended that a check value such as an adler32 or a crc32 be applied to + recommended that a check value such as an Adler-32 or a CRC-32 be applied to the uncompressed data as is done in the zlib, gzip, and zip formats. For most applications, the zlib format should be used as is. Note that comments above on the use in deflateInit2() applies to the magnitude of windowBits. @@ -802,7 +863,10 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, 32 to windowBits to enable zlib and gzip decoding with automatic header detection, or add 16 to decode only the gzip format (the zlib format will return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a - crc32 instead of an adler32. + CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see + below), inflate() will not automatically decode concatenated gzip streams. + inflate() will return Z_STREAM_END at the end of the gzip stream. The state + would need to be reset to continue decoding a subsequent gzip stream. inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the @@ -823,7 +887,7 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, Initializes the decompression dictionary from the given uncompressed byte sequence. This function must be called immediately after a call of inflate, if that call returned Z_NEED_DICT. The dictionary chosen by the compressor - can be determined from the adler32 value returned by that call of inflate. + can be determined from the Adler-32 value returned by that call of inflate. The compressor and decompressor must use exactly the same dictionary (see deflateSetDictionary). For raw inflate, this function can be called at any time to set the dictionary. If the provided dictionary is smaller than the @@ -834,7 +898,7 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the - expected one (incorrect adler32 value). inflateSetDictionary does not + expected one (incorrect Adler-32 value). inflateSetDictionary does not perform any decompression: this will be done by subsequent calls of inflate(). */ @@ -892,7 +956,7 @@ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); /* This function is equivalent to inflateEnd followed by inflateInit, - but does not free and reallocate all the internal decompression state. The + but does not free and reallocate the internal decompression state. The stream will keep attributes that may have been set by inflateInit2. inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source @@ -904,7 +968,9 @@ ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, /* This function is the same as inflateReset, but it also permits changing the wrap and window size requests. The windowBits parameter is interpreted - the same as it is for inflateInit2. + the same as it is for inflateInit2. If the window size is changed, then the + memory allocated for the window is freed, and the window will be reallocated + by inflate() if needed. inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL), or if @@ -956,7 +1022,7 @@ ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); location in the input stream can be determined from avail_in and data_type as noted in the description for the Z_BLOCK flush parameter for inflate. - inflateMark returns the value noted above or -1 << 16 if the provided + inflateMark returns the value noted above, or -65536 if the provided source stream state was inconsistent. */ @@ -1048,9 +1114,9 @@ ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, This routine would normally be used in a utility that reads zip or gzip files and writes out uncompressed files. The utility would decode the header and process the trailer on its own, hence this routine expects only - the raw deflate stream to decompress. This is different from the normal - behavior of inflate(), which expects either a zlib or gzip header and - trailer around the deflate stream. + the raw deflate stream to decompress. This is different from the default + behavior of inflate(), which expects a zlib header and trailer around the + deflate stream. inflateBack() uses two subroutines supplied by the caller that are then called by inflateBack() for input and output. inflateBack() calls those @@ -1059,12 +1125,12 @@ ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, parameters and return types are defined above in the in_func and out_func typedefs. inflateBack() will call in(in_desc, &buf) which should return the number of bytes of provided input, and a pointer to that input in buf. If - there is no input available, in() must return zero--buf is ignored in that - case--and inflateBack() will return a buffer error. inflateBack() will call - out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out() - should return zero on success, or non-zero on failure. If out() returns - non-zero, inflateBack() will return with an error. Neither in() nor out() - are permitted to change the contents of the window provided to + there is no input available, in() must return zero -- buf is ignored in that + case -- and inflateBack() will return a buffer error. inflateBack() will + call out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. + out() should return zero on success, or non-zero on failure. If out() + returns non-zero, inflateBack() will return with an error. Neither in() nor + out() are permitted to change the contents of the window provided to inflateBackInit(), which is also the buffer that out() uses to write from. The length written by out() will be at most the window size. Any non-zero amount of input may be provided by in(). @@ -1092,7 +1158,7 @@ ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, using strm->next_in which will be Z_NULL only if in() returned an error. If strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning non-zero. (in() will always be called before out(), so strm->next_in is - assured to be defined if out() returns non-zero.) Note that inflateBack() + assured to be defined if out() returns non-zero.) Note that inflateBack() cannot return Z_OK. */ @@ -1114,7 +1180,7 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); 7.6: size of z_off_t Compiler, assembler, and debug options: - 8: DEBUG + 8: ZLIB_DEBUG 9: ASMV or ASMINF -- use ASM code 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention 11: 0 (reserved) @@ -1164,7 +1230,8 @@ ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, the byte length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. + compressed data. compress() is equivalent to compress2() with a level + parameter of Z_DEFAULT_COMPRESSION. compress returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output @@ -1180,7 +1247,7 @@ ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the - compressed buffer. + compressed data. compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output buffer, @@ -1203,7 +1270,7 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, uncompressed data. (The size of the uncompressed data must have been saved previously by the compressor and transmitted to the decompressor by some mechanism outside the scope of this compression library.) Upon exit, destLen - is the actual size of the uncompressed buffer. + is the actual size of the uncompressed data. uncompress returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output @@ -1212,6 +1279,14 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, buffer with the uncompressed data up to that point. */ +ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen, + const Bytef *source, uLong *sourceLen)); +/* + Same as uncompress, except that sourceLen is a pointer, where the + length of the source is *sourceLen. On return, *sourceLen is the number of + source bytes consumed. +*/ + /* gzip file access functions */ /* @@ -1290,10 +1365,9 @@ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); default buffer size is 8192 bytes. This function must be called after gzopen() or gzdopen(), and before any other calls that read or write the file. The buffer memory allocation is always deferred to the first read or - write. Two buffers are allocated, either both of the specified size when - writing, or one of the specified size and the other twice that size when - reading. A larger buffer size of, for example, 64K or 128K bytes will - noticeably increase the speed of decompression (reading). + write. Three times that size in buffer space is allocated. A larger buffer + size of, for example, 64K or 128K bytes will noticeably increase the speed + of decompression (reading). The new buffer size also affects the maximum length for gzprintf(). @@ -1304,10 +1378,12 @@ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); /* Dynamically update the compression level or strategy. See the description - of deflateInit2 for the meaning of these parameters. + of deflateInit2 for the meaning of these parameters. Previously provided + data is flushed before the parameter change. - gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not - opened for writing. + gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not + opened for writing, Z_ERRNO if there is an error writing the flushed data, + or Z_MEM_ERROR if there is a memory allocation error. */ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); @@ -1335,7 +1411,35 @@ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); case. gzread returns the number of uncompressed bytes actually read, less than - len for end of file, or -1 for error. + len for end of file, or -1 for error. If len is too large to fit in an int, + then nothing is read, -1 is returned, and the error state is set to + Z_STREAM_ERROR. +*/ + +ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems, + gzFile file)); +/* + Read up to nitems items of size size from file to buf, otherwise operating + as gzread() does. This duplicates the interface of stdio's fread(), with + size_t request and return types. If the library defines size_t, then + z_size_t is identical to size_t. If not, then z_size_t is an unsigned + integer type that can contain a pointer. + + gzfread() returns the number of full items read of size size, or zero if + the end of the file was reached and a full item could not be read, or if + there was an error. gzerror() must be consulted if zero is returned in + order to determine if there was an error. If the multiplication of size and + nitems overflows, i.e. the product does not fit in a z_size_t, then nothing + is read, zero is returned, and the error state is set to Z_STREAM_ERROR. + + In the event that the end of file is reached and only a partial item is + available at the end, i.e. the remaining uncompressed data length is not a + multiple of size, then the final partial item is nevetheless read into buf + and the end-of-file flag is set. The length of the partial item read is not + provided, but could be inferred from the result of gztell(). This behavior + is the same as the behavior of fread() implementations in common libraries, + but it prevents the direct use of gzfread() to read a concurrently written + file, reseting and retrying on end-of-file, when size is not 1. */ ZEXTERN int ZEXPORT gzwrite OF((gzFile file, @@ -1346,19 +1450,33 @@ ZEXTERN int ZEXPORT gzwrite OF((gzFile file, error. */ +ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size, + z_size_t nitems, gzFile file)); +/* + gzfwrite() writes nitems items of size size from buf to file, duplicating + the interface of stdio's fwrite(), with size_t request and return types. If + the library defines size_t, then z_size_t is identical to size_t. If not, + then z_size_t is an unsigned integer type that can contain a pointer. + + gzfwrite() returns the number of full items written of size size, or zero + if there was an error. If the multiplication of size and nitems overflows, + i.e. the product does not fit in a z_size_t, then nothing is written, zero + is returned, and the error state is set to Z_STREAM_ERROR. +*/ + ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...)); /* Converts, formats, and writes the arguments to the compressed file under control of the format string, as in fprintf. gzprintf returns the number of - uncompressed bytes actually written, or 0 in case of error. The number of - uncompressed bytes written is limited to 8191, or one less than the buffer - size given to gzbuffer(). The caller should assure that this limit is not - exceeded. If it is exceeded, then gzprintf() will return an error (0) with - nothing written. In this case, there may also be a buffer overflow with - unpredictable consequences, which is possible only if zlib was compiled with - the insecure functions sprintf() or vsprintf() because the secure snprintf() - or vsnprintf() functions were not available. This can be determined using - zlibCompileFlags(). + uncompressed bytes actually written, or a negative zlib error code in case + of error. The number of uncompressed bytes written is limited to 8191, or + one less than the buffer size given to gzbuffer(). The caller should assure + that this limit is not exceeded. If it is exceeded, then gzprintf() will + return an error (0) with nothing written. In this case, there may also be a + buffer overflow with unpredictable consequences, which is possible only if + zlib was compiled with the insecure functions sprintf() or vsprintf() + because the secure snprintf() or vsnprintf() functions were not available. + This can be determined using zlibCompileFlags(). */ ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); @@ -1418,7 +1536,7 @@ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); If the flush parameter is Z_FINISH, the remaining data is written and the gzip stream is completed in the output. If gzwrite() is called again, a new gzip stream will be started in the output. gzread() is able to read such - concatented gzip streams. + concatenated gzip streams. gzflush should be called only when strictly necessary because it will degrade compression if called too often. @@ -1572,7 +1690,7 @@ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); return the updated checksum. If buf is Z_NULL, this function returns the required initial value for the checksum. - An Adler-32 checksum is almost as reliable as a CRC32 but can be computed + An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed much faster. Usage example: @@ -1585,6 +1703,12 @@ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); if (adler != original_adler) error(); */ +ZEXTERN uLong ZEXPORT adler32_z OF((uLong adler, const Bytef *buf, + z_size_t len)); +/* + Same as adler32(), but with a size_t length. +*/ + /* ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, z_off_t len2)); @@ -1614,6 +1738,12 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); if (crc != original_crc) error(); */ +ZEXTERN uLong ZEXPORT crc32_z OF((uLong adler, const Bytef *buf, + z_size_t len)); +/* + Same as crc32(), but with a size_t length. +*/ + /* ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); @@ -1644,19 +1774,35 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, unsigned char FAR *window, const char *version, int stream_size)); -#define deflateInit(strm, level) \ - deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) -#define inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) -#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ - deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ - (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) -#define inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ - (int)sizeof(z_stream)) -#define inflateBackInit(strm, windowBits, window) \ - inflateBackInit_((strm), (windowBits), (window), \ - ZLIB_VERSION, (int)sizeof(z_stream)) +#ifdef Z_PREFIX_SET +# define z_deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) +# define z_inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) +# define z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ + (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) +# define z_inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ + (int)sizeof(z_stream)) +# define z_inflateBackInit(strm, windowBits, window) \ + inflateBackInit_((strm), (windowBits), (window), \ + ZLIB_VERSION, (int)sizeof(z_stream)) +#else +# define deflateInit(strm, level) \ + deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream)) +# define inflateInit(strm) \ + inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream)) +# define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ + (strategy), ZLIB_VERSION, (int)sizeof(z_stream)) +# define inflateInit2(strm, windowBits) \ + inflateInit2_((strm), (windowBits), ZLIB_VERSION, \ + (int)sizeof(z_stream)) +# define inflateBackInit(strm, windowBits, window) \ + inflateBackInit_((strm), (windowBits), (window), \ + ZLIB_VERSION, (int)sizeof(z_stream)) +#endif #ifndef Z_SOLO @@ -1676,10 +1822,10 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ #ifdef Z_PREFIX_SET # undef z_gzgetc # define z_gzgetc(g) \ - ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g)) + ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) #else # define gzgetc(g) \ - ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : gzgetc(g)) + ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g)) #endif /* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or @@ -1737,19 +1883,16 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */ #endif /* !Z_SOLO */ -/* hack for buggy compilers */ -#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) - struct internal_state {int dummy;}; -#endif - /* undocumented functions */ ZEXTERN const char * ZEXPORT zError OF((int)); ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void)); ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); +ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int)); +ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp)); ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp)); ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp)); -#if defined(_WIN32) && !defined(Z_SOLO) +#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(Z_SOLO) ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path, const char *mode)); #endif diff --git a/thirdparty/zlib/zutil.c b/thirdparty/zlib/zutil.c index 23d2ebef00..56534fba0f 100644 --- a/thirdparty/zlib/zutil.c +++ b/thirdparty/zlib/zutil.c @@ -1,5 +1,5 @@ /* zutil.c -- target dependent utility functions for the compression library - * Copyright (C) 1995-2005, 2010, 2011, 2012 Jean-loup Gailly. + * Copyright (C) 1995-2005, 2010, 2011, 2012, 2016 Jean-loup Gailly * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -10,21 +10,18 @@ # include "gzguts.h" #endif -#ifndef NO_DUMMY_DECL -struct internal_state {int dummy;}; /* for buggy compilers */ -#endif - z_const char * const z_errmsg[10] = { -"need dictionary", /* Z_NEED_DICT 2 */ -"stream end", /* Z_STREAM_END 1 */ -"", /* Z_OK 0 */ -"file error", /* Z_ERRNO (-1) */ -"stream error", /* Z_STREAM_ERROR (-2) */ -"data error", /* Z_DATA_ERROR (-3) */ -"insufficient memory", /* Z_MEM_ERROR (-4) */ -"buffer error", /* Z_BUF_ERROR (-5) */ -"incompatible version",/* Z_VERSION_ERROR (-6) */ -""}; + (z_const char *)"need dictionary", /* Z_NEED_DICT 2 */ + (z_const char *)"stream end", /* Z_STREAM_END 1 */ + (z_const char *)"", /* Z_OK 0 */ + (z_const char *)"file error", /* Z_ERRNO (-1) */ + (z_const char *)"stream error", /* Z_STREAM_ERROR (-2) */ + (z_const char *)"data error", /* Z_DATA_ERROR (-3) */ + (z_const char *)"insufficient memory", /* Z_MEM_ERROR (-4) */ + (z_const char *)"buffer error", /* Z_BUF_ERROR (-5) */ + (z_const char *)"incompatible version",/* Z_VERSION_ERROR (-6) */ + (z_const char *)"" +}; const char * ZEXPORT zlibVersion() @@ -61,7 +58,7 @@ uLong ZEXPORT zlibCompileFlags() case 8: flags += 2 << 6; break; default: flags += 3 << 6; } -#ifdef DEBUG +#ifdef ZLIB_DEBUG flags += 1 << 8; #endif #if defined(ASMV) || defined(ASMINF) @@ -115,8 +112,8 @@ uLong ZEXPORT zlibCompileFlags() return flags; } -#ifdef DEBUG - +#ifdef ZLIB_DEBUG +#include <stdlib.h> # ifndef verbose # define verbose 0 # endif @@ -219,9 +216,11 @@ local ptr_table table[MAX_PTR]; voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size) { - voidpf buf = opaque; /* just to make some compilers happy */ + voidpf buf; ulg bsize = (ulg)items*size; + (void)opaque; + /* If we allocate less than 65520 bytes, we assume that farmalloc * will return a usable pointer which doesn't have to be normalized. */ @@ -244,6 +243,9 @@ voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size) void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) { int n; + + (void)opaque; + if (*(ush*)&ptr != 0) { /* object < 64K */ farfree(ptr); return; @@ -259,7 +261,6 @@ void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) next_ptr--; return; } - ptr = opaque; /* just to make some compilers happy */ Assert(0, "zcfree: ptr not found"); } @@ -278,13 +279,13 @@ void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size) { - if (opaque) opaque = 0; /* to make compiler happy */ + (void)opaque; return _halloc((long)items, size); } void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) { - if (opaque) opaque = 0; /* to make compiler happy */ + (void)opaque; _hfree(ptr); } @@ -306,7 +307,7 @@ voidpf ZLIB_INTERNAL zcalloc (opaque, items, size) unsigned items; unsigned size; { - if (opaque) items += size - size; /* make compiler happy */ + (void)opaque; return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) : (voidpf)calloc(items, size); } @@ -315,8 +316,8 @@ void ZLIB_INTERNAL zcfree (opaque, ptr) voidpf opaque; voidpf ptr; { + (void)opaque; free(ptr); - if (opaque) return; /* make compiler happy */ } #endif /* MY_ZCALLOC */ diff --git a/thirdparty/zlib/zutil.h b/thirdparty/zlib/zutil.h index 24ab06b1cf..b079ea6a80 100644 --- a/thirdparty/zlib/zutil.h +++ b/thirdparty/zlib/zutil.h @@ -1,5 +1,5 @@ /* zutil.h -- internal interface and configuration of the compression library - * Copyright (C) 1995-2013 Jean-loup Gailly. + * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -36,7 +36,9 @@ #ifndef local # define local static #endif -/* compile with -Dlocal if your debugger can't find static symbols */ +/* since "static" is used to mean two completely different things in C, we + define "local" for the non-static meaning of "static", for readability + (compile with -Dlocal if your debugger can't find static symbols) */ typedef unsigned char uch; typedef uch FAR uchf; @@ -98,28 +100,38 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ #endif #ifdef AMIGA -# define OS_CODE 0x01 +# define OS_CODE 1 #endif #if defined(VAXC) || defined(VMS) -# define OS_CODE 0x02 +# define OS_CODE 2 # define F_OPEN(name, mode) \ fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") #endif +#ifdef __370__ +# if __TARGET_LIB__ < 0x20000000 +# define OS_CODE 4 +# elif __TARGET_LIB__ < 0x40000000 +# define OS_CODE 11 +# else +# define OS_CODE 8 +# endif +#endif + #if defined(ATARI) || defined(atarist) -# define OS_CODE 0x05 +# define OS_CODE 5 #endif #ifdef OS2 -# define OS_CODE 0x06 +# define OS_CODE 6 # if defined(M_I86) && !defined(Z_SOLO) # include <malloc.h> # endif #endif #if defined(MACOS) || defined(TARGET_OS_MAC) -# define OS_CODE 0x07 +# define OS_CODE 7 # ifndef Z_SOLO # if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os # include <unix.h> /* for fdopen */ @@ -131,18 +143,24 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ # endif #endif -#ifdef TOPS20 -# define OS_CODE 0x0a +#ifdef __acorn +# define OS_CODE 13 #endif -#ifdef WIN32 -# ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */ -# define OS_CODE 0x0b -# endif +#if defined(WIN32) && !defined(__CYGWIN__) +# define OS_CODE 10 +#endif + +#ifdef _BEOS_ +# define OS_CODE 16 +#endif + +#ifdef __TOS_OS400__ +# define OS_CODE 18 #endif -#ifdef __50SERIES /* Prime/PRIMOS */ -# define OS_CODE 0x0f +#ifdef __APPLE__ +# define OS_CODE 19 #endif #if defined(_BEOS_) || defined(RISCOS) @@ -177,7 +195,7 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ /* common defaults */ #ifndef OS_CODE -# define OS_CODE 0x03 /* assume Unix */ +# define OS_CODE 3 /* assume Unix */ #endif #ifndef F_OPEN @@ -216,7 +234,7 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ #endif /* Diagnostic functions */ -#ifdef DEBUG +#ifdef ZLIB_DEBUG # include <stdio.h> extern int ZLIB_INTERNAL z_verbose; extern void ZLIB_INTERNAL z_error OF((char *m)); diff --git a/tools/collada/collada.cpp b/tools/collada/collada.cpp index 268d42a613..9f2416223e 100644 --- a/tools/collada/collada.cpp +++ b/tools/collada/collada.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -144,7 +144,7 @@ Transform Collada::Node::compute_transform(Collada &state) const { case XForm::OP_ROTATE: { if (xf.data.size()>=4) { - xform_step.rotate(Vector3(xf.data[0],xf.data[1],xf.data[2]),-Math::deg2rad(xf.data[3])); + xform_step.rotate(Vector3(xf.data[0],xf.data[1],xf.data[2]),Math::deg2rad(xf.data[3])); } } break; case XForm::OP_SCALE: { @@ -322,7 +322,7 @@ void Collada::_parse_image(XMLParser& parser) { String path = parser.get_attribute_value("source").strip_edges(); if (path.find("://")==-1 && path.is_rel_path()) { // path is relative to file being loaded, so convert to a resource path - image.path=Globals::get_singleton()->localize_path(state.local_path.get_base_dir()+"/"+path.percent_decode()); + image.path=GlobalConfig::get_singleton()->localize_path(state.local_path.get_base_dir()+"/"+path.percent_decode()); } } else { @@ -342,11 +342,11 @@ void Collada::_parse_image(XMLParser& parser) { if (path.find("://")==-1 && path.is_rel_path()) { // path is relative to file being loaded, so convert to a resource path - path=Globals::get_singleton()->localize_path(state.local_path.get_base_dir()+"/"+path); + path=GlobalConfig::get_singleton()->localize_path(state.local_path.get_base_dir()+"/"+path); } else if (path.find("file:///")==0) { path=path.replace_first("file:///",""); - path=Globals::get_singleton()->localize_path(path); + path=GlobalConfig::get_singleton()->localize_path(path); } image.path=path; @@ -463,7 +463,7 @@ Transform Collada::_read_transform(XMLParser& parser) { if (parser.is_empty()) return Transform(); - Vector<float> array; + Vector<String> array; while(parser.read()==OK) { // TODO: check for comments inside the element // and ignore them. @@ -471,7 +471,7 @@ Transform Collada::_read_transform(XMLParser& parser) { if (parser.get_node_type() == XMLParser::NODE_TEXT) { // parse float data String str = parser.get_node_data(); - array=str.split_floats(" ",false); + array=str.split_spaces(); } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END) @@ -479,7 +479,13 @@ Transform Collada::_read_transform(XMLParser& parser) { } ERR_FAIL_COND_V(array.size()!=16,Transform()); - return _read_transform_from_array(array); + Vector<float> farr; + farr.resize(16); + for(int i=0;i<16;i++) { + farr[i]=array[i].to_double(); + } + + return _read_transform_from_array(farr); } String Collada::_read_empty_draw_type(XMLParser& parser) { @@ -1598,7 +1604,7 @@ Collada::Node* Collada::_parse_visual_instance_camera(XMLParser& parser) { cam->camera= _uri_to_id(parser.get_attribute_value_safe("url")); if (state.up_axis==Vector3::AXIS_Z) //collada weirdness - cam->post_transform.basis.rotate(Vector3(1,0,0),Math_PI*0.5); + cam->post_transform.basis.rotate(Vector3(1,0,0),-Math_PI*0.5); if (parser.is_empty()) //nothing else to parse... return cam; @@ -1619,7 +1625,7 @@ Collada::Node* Collada::_parse_visual_instance_light(XMLParser& parser) { cam->light= _uri_to_id(parser.get_attribute_value_safe("url")); if (state.up_axis==Vector3::AXIS_Z) //collada weirdness - cam->post_transform.basis.rotate(Vector3(1,0,0),Math_PI*0.5); + cam->post_transform.basis.rotate(Vector3(1,0,0),-Math_PI*0.5); if (parser.is_empty()) //nothing else to parse... return cam; @@ -2714,7 +2720,7 @@ Error Collada::load(const String& p_path, int p_flags) { Error err = parser.open(p_path); ERR_FAIL_COND_V(err,err); - state.local_path = Globals::get_singleton()->localize_path(p_path); + state.local_path = GlobalConfig::get_singleton()->localize_path(p_path); state.import_flags=p_flags; /* Skip headers */ err=OK; diff --git a/tools/collada/collada.h b/tools/collada/collada.h index 9340cdd3f3..fd7ad4920d 100644 --- a/tools/collada/collada.h +++ b/tools/collada/collada.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/dist/ios_xcode/godot_xcode/godot_ios/main.m b/tools/dist/ios_xcode/godot_xcode/godot_ios/main.m index 3e4ea5e129..88b8e60670 100644 --- a/tools/dist/ios_xcode/godot_xcode/godot_ios/main.m +++ b/tools/dist/ios_xcode/godot_xcode/godot_ios/main.m @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/dist/osx_template.app/Contents/Info.plist b/tools/dist/osx_template.app/Contents/Info.plist index 5146c875bc..eee787bdaf 100755 --- a/tools/dist/osx_template.app/Contents/Info.plist +++ b/tools/dist/osx_template.app/Contents/Info.plist @@ -27,11 +27,11 @@ <key>NSHumanReadableCopyright</key> <string>$copyright</string> <key>LSMinimumSystemVersion</key> - <string>10.6.0</string> + <string>10.9.0</string> <key>LSMinimumSystemVersionByArchitecture</key> <dict> <key>x86_64</key> - <string>10.6.0</string> + <string>10.9.0</string> </dict> <key>NSHighResolutionCapable</key> $highres diff --git a/tools/dist/osx_tools.app/Contents/Info.plist b/tools/dist/osx_tools.app/Contents/Info.plist index 2a3e727133..4d88e97503 100755 --- a/tools/dist/osx_tools.app/Contents/Info.plist +++ b/tools/dist/osx_tools.app/Contents/Info.plist @@ -9,7 +9,7 @@ <key>CFBundleName</key> <string>Godot</string> <key>CFBundleGetInfoString</key> - <string>(c) 2007-2016 Juan Linietsky, Ariel Manzur</string> + <string>(c) 2007-2017 Juan Linietsky, Ariel Manzur</string> <key>CFBundleIconFile</key> <string>Godot.icns</string> <key>CFBundleIdentifier</key> @@ -25,13 +25,13 @@ <key>CFBundleVersion</key> <string>2.2-dev</string> <key>NSHumanReadableCopyright</key> - <string>© 2007-2016 Juan Linietsky, Ariel Manzur</string> + <string>© 2007-2017 Juan Linietsky, Ariel Manzur</string> <key>LSMinimumSystemVersion</key> - <string>10.6.0</string> + <string>10.9.0</string> <key>LSMinimumSystemVersionByArchitecture</key> <dict> <key>x86_64</key> - <string>10.6.0</string> + <string>10.9.0</string> </dict> <key>NSHighResolutionCapable</key> <true/> diff --git a/tools/doc/doc_data.cpp b/tools/doc/doc_data.cpp index 4a8fdfb215..6b6a864ecc 100644 --- a/tools/doc/doc_data.cpp +++ b/tools/doc/doc_data.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -132,6 +132,9 @@ void DocData::merge_from(const DocData& p_data) { const PropertyDoc &pf = cf.properties[j]; p.description=pf.description; + p.setter=pf.setter; + p.getter=pf.getter; + break; } } @@ -159,7 +162,7 @@ void DocData::generate(bool p_basic_types) { List<StringName> classes; - ObjectTypeDB::get_type_list(&classes); + ClassDB::get_class_list(&classes); classes.sort_custom<StringName::AlphCompare>(); while(classes.size()) { @@ -172,11 +175,35 @@ void DocData::generate(bool p_basic_types) { class_list[cname]=ClassDoc(); ClassDoc& c = class_list[cname]; c.name=cname; - c.inherits=ObjectTypeDB::type_inherits_from(name); - c.category=ObjectTypeDB::get_category(name); + c.inherits=ClassDB::get_parent_class(name); + c.category=ClassDB::get_category(name); + + + List<PropertyInfo> properties; + ClassDB::get_property_list(name,&properties,true); + + for(List<PropertyInfo>::Element *E=properties.front();E;E=E->next()) { + if (E->get().usage& PROPERTY_USAGE_GROUP || E->get().usage& PROPERTY_USAGE_CATEGORY) + continue; + + PropertyDoc prop; + StringName setter = ClassDB::get_property_setter(name,E->get().name); + StringName getter = ClassDB::get_property_getter(name,E->get().name); + + prop.name=E->get().name; + prop.setter=setter; + prop.getter=getter; + if (E->get().type==Variant::OBJECT && E->get().hint==PROPERTY_HINT_RESOURCE_TYPE) + prop.type=E->get().hint_string; + else + prop.type=Variant::get_type_name(E->get().type); + + c.properties.push_back(prop); + } + List<MethodInfo> method_list; - ObjectTypeDB::get_method_list(name,&method_list,true); + ClassDB::get_method_list(name,&method_list,true); method_list.sort(); @@ -189,7 +216,7 @@ void DocData::generate(bool p_basic_types) { method.name=E->get().name; - MethodBind *m = ObjectTypeDB::get_method(name,E->get().name); + MethodBind *m = ClassDB::get_method(name,E->get().name); if (E->get().flags&METHOD_FLAG_VIRTUAL) @@ -281,23 +308,23 @@ void DocData::generate(bool p_basic_types) { default_arg_text=Variant::get_type_name(default_arg.get_type())+"("+default_arg_text+")"; break; - case Variant::_AABB: //sorry naming convention fail :( not like it's used often // 10 + case Variant::RECT3: //sorry naming convention fail :( not like it's used often // 10 case Variant::COLOR: case Variant::PLANE: - case Variant::RAW_ARRAY: - case Variant::INT_ARRAY: - case Variant::REAL_ARRAY: - case Variant::STRING_ARRAY: //25 - case Variant::VECTOR2_ARRAY: - case Variant::VECTOR3_ARRAY: - case Variant::COLOR_ARRAY: + case Variant::POOL_BYTE_ARRAY: + case Variant::POOL_INT_ARRAY: + case Variant::POOL_REAL_ARRAY: + case Variant::POOL_STRING_ARRAY: //25 + case Variant::POOL_VECTOR2_ARRAY: + case Variant::POOL_VECTOR3_ARRAY: + case Variant::POOL_COLOR_ARRAY: default_arg_text=Variant::get_type_name(default_arg.get_type())+"("+default_arg_text+")"; break; case Variant::VECTOR2: // 5 case Variant::RECT2: case Variant::VECTOR3: case Variant::QUAT: - case Variant::MATRIX3: + case Variant::BASIS: default_arg_text=Variant::get_type_name(default_arg.get_type())+default_arg_text; break; case Variant::OBJECT: @@ -358,7 +385,7 @@ void DocData::generate(bool p_basic_types) { } List<MethodInfo> signal_list; - ObjectTypeDB::get_signal_list(name,&signal_list,true); + ClassDB::get_signal_list(name,&signal_list,true); if (signal_list.size()) { @@ -383,13 +410,13 @@ void DocData::generate(bool p_basic_types) { } List<String> constant_list; - ObjectTypeDB::get_integer_constant_list(name, &constant_list, true); + ClassDB::get_integer_constant_list(name, &constant_list, true); for(List<String>::Element *E=constant_list.front();E;E=E->next()) { ConstantDoc constant; constant.name=E->get(); - constant.value=itos(ObjectTypeDB::get_integer_constant(name, E->get())); + constant.value=itos(ClassDB::get_integer_constant(name, E->get())); c.constants.push_back(constant); } @@ -476,7 +503,7 @@ void DocData::generate(bool p_basic_types) { if (i==Variant::INPUT_EVENT) { static const char* ie_type[InputEvent::TYPE_MAX]={ - "","Key","MouseMotion","MouseButton","JoystickMotion","JoystickButton","ScreenTouch","ScreenDrag","Action" + "","Key","MouseMotion","MouseButton","JoypadMotion","JoypadButton","ScreenTouch","ScreenDrag","Action" }; cname+=ie_type[j]; } @@ -581,18 +608,18 @@ void DocData::generate(bool p_basic_types) { c.constants.push_back(cd); } - List<Globals::Singleton> singletons; - Globals::get_singleton()->get_singletons(&singletons); + List<GlobalConfig::Singleton> singletons; + GlobalConfig::get_singleton()->get_singletons(&singletons); //servers (this is kind of hackish) - for(List<Globals::Singleton>::Element *E=singletons.front();E;E=E->next()) { + for(List<GlobalConfig::Singleton>::Element *E=singletons.front();E;E=E->next()) { PropertyDoc pd; - Globals::Singleton &s=E->get(); + GlobalConfig::Singleton &s=E->get(); pd.name=s.name; - pd.type=s.ptr->get_type(); - while (String(ObjectTypeDB::type_inherits_from(pd.type))!="Object") - pd.type=ObjectTypeDB::type_inherits_from(pd.type); + pd.type=s.ptr->get_class(); + while (String(ClassDB::get_parent_class(pd.type))!="Object") + pd.type=ClassDB::get_parent_class(pd.type); if (pd.type.begins_with("_")) pd.type=pd.type.substr(1,pd.type.length()); c.properties.push_back(pd); @@ -825,6 +852,13 @@ Error DocData::_load(Ref<XMLParser> parser) { prop.name=parser->get_attribute_value("name"); ERR_FAIL_COND_V(!parser->has_attribute("type"),ERR_FILE_CORRUPT); prop.type=parser->get_attribute_value("type"); + if (parser->has_attribute("setter")) + prop.setter=parser->get_attribute_value("setter"); + if (parser->has_attribute("getter")) + prop.getter=parser->get_attribute_value("getter"); + if (parser->has_attribute("brief")) + prop.brief_description=parser->get_attribute_value("brief").xml_unescape(); + parser->read(); if (parser->get_node_type()==XMLParser::NODE_TEXT) prop.description=parser->get_node_data().strip_edges(); @@ -1009,7 +1043,7 @@ Error DocData::save(const String& p_path) { PropertyDoc &p=c.properties[i]; - _write_string(f,2,"<member name=\""+p.name+"\" type=\""+p.type+"\">"); + _write_string(f,2,"<member name=\""+p.name+"\" type=\""+p.type+"\" setter=\""+p.setter+"\" getter=\""+p.getter+"\" brief=\""+p.brief_description.xml_escape(true)+"\">"); if (p.description!="") _write_string(f,3,p.description.xml_escape()); _write_string(f,2,"</member>"); diff --git a/tools/doc/doc_data.h b/tools/doc/doc_data.h index 7996071c74..fead1da510 100644 --- a/tools/doc/doc_data.h +++ b/tools/doc/doc_data.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -66,7 +66,9 @@ public: String name; String type; + String brief_description; String description; + String setter,getter; bool operator<(const PropertyDoc& p_prop) const { return name<p_prop.name; } diff --git a/tools/doc/doc_dump.cpp b/tools/doc/doc_dump.cpp index fbf13f9e8f..e1ffcfbbb2 100644 --- a/tools/doc/doc_dump.cpp +++ b/tools/doc/doc_dump.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -77,7 +77,7 @@ void DocDump::dump(const String& p_file) { List<StringName> class_list; - ObjectTypeDB::get_type_list(&class_list); + ClassDB::get_class_list(&class_list); class_list.sort_custom<StringName::AlphCompare>(); @@ -92,10 +92,10 @@ void DocDump::dump(const String& p_file) { String name=class_list.front()->get(); String header="<class name=\""+name+"\""; - String inherits=ObjectTypeDB::type_inherits_from(name); + String inherits=ClassDB::get_parent_class(name); if (inherits!="") header+=" inherits=\""+inherits+"\""; - String category=ObjectTypeDB::get_category(name); + String category=ClassDB::get_category(name); if (category=="") category="Core"; header+=" category=\""+category+"\""; @@ -108,7 +108,7 @@ void DocDump::dump(const String& p_file) { _write_string(f,1,"<methods>"); List<MethodInfo> method_list; - ObjectTypeDB::get_method_list(name,&method_list,true); + ClassDB::get_method_list(name,&method_list,true); method_list.sort(); @@ -116,7 +116,7 @@ void DocDump::dump(const String& p_file) { if (E->get().name=="" || E->get().name[0]=='_') continue; //hiden - MethodBind *m = ObjectTypeDB::get_method(name,E->get().name); + MethodBind *m = ClassDB::get_method(name,E->get().name); String qualifiers; if (E->get().flags&METHOD_FLAG_CONST) @@ -187,15 +187,15 @@ void DocDump::dump(const String& p_file) { case Variant::VECTOR3: case Variant::PLANE: case Variant::QUAT: - case Variant::_AABB: //sorry naming convention fail :( not like it's used often // 10 - case Variant::MATRIX3: + case Variant::RECT3: //sorry naming convention fail :( not like it's used often // 10 + case Variant::BASIS: case Variant::COLOR: - case Variant::RAW_ARRAY: - case Variant::INT_ARRAY: - case Variant::REAL_ARRAY: - case Variant::STRING_ARRAY: //25 - case Variant::VECTOR3_ARRAY: - case Variant::COLOR_ARRAY: + case Variant::POOL_BYTE_ARRAY: + case Variant::POOL_INT_ARRAY: + case Variant::POOL_REAL_ARRAY: + case Variant::POOL_STRING_ARRAY: //25 + case Variant::POOL_VECTOR3_ARRAY: + case Variant::POOL_COLOR_ARRAY: default_arg_text=Variant::get_type_name(default_arg.get_type())+"("+default_arg_text+")"; break; case Variant::OBJECT: @@ -251,7 +251,7 @@ void DocDump::dump(const String& p_file) { _write_string(f,1,"</methods>"); List<MethodInfo> signal_list; - ObjectTypeDB::get_signal_list(name,&signal_list,true); + ClassDB::get_signal_list(name,&signal_list,true); if (signal_list.size()) { @@ -278,7 +278,7 @@ void DocDump::dump(const String& p_file) { List<String> constant_list; - ObjectTypeDB::get_integer_constant_list(name, &constant_list, true); + ClassDB::get_integer_constant_list(name, &constant_list, true); /* constants are sorted in a special way */ @@ -287,7 +287,7 @@ void DocDump::dump(const String& p_file) { for(List<String>::Element *E=constant_list.front();E;E=E->next()) { _ConstantSort cs; cs.name=E->get(); - cs.value=ObjectTypeDB::get_integer_constant(name, E->get()); + cs.value=ClassDB::get_integer_constant(name, E->get()); constant_sort.push_back(cs); } diff --git a/tools/doc/doc_dump.h b/tools/doc/doc_dump.h index 372f5e0969..4577af078e 100644 --- a/tools/doc/doc_dump.h +++ b/tools/doc/doc_dump.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/animation_editor.cpp b/tools/editor/animation_editor.cpp index a556031e5e..a98a435ea2 100644 --- a/tools/editor/animation_editor.cpp +++ b/tools/editor/animation_editor.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -48,7 +48,7 @@ class AnimationCurveEdit : public Control { - OBJ_TYPE( AnimationCurveEdit, Control ); + GDCLASS( AnimationCurveEdit, Control ); public: enum Mode { MODE_DISABLED, @@ -157,7 +157,7 @@ private: } } - void _input_event(const InputEvent& p_ev) { + void _gui_input(const InputEvent& p_ev) { if (p_ev.type==InputEvent::MOUSE_MOTION && p_ev.mouse_motion.button_mask&BUTTON_MASK_LEFT) { if (mode==MODE_DISABLED) @@ -198,8 +198,8 @@ public: static void _bind_methods() { - // ObjectTypeDB::bind_method("_update_obj",&AnimationKeyEdit::_update_obj); - ObjectTypeDB::bind_method("_input_event",&AnimationCurveEdit::_input_event); + // ClassDB::bind_method("_update_obj",&AnimationKeyEdit::_update_obj); + ClassDB::bind_method("_gui_input",&AnimationCurveEdit::_gui_input); ADD_SIGNAL(MethodInfo("transition_changed")); } @@ -243,15 +243,15 @@ public: class AnimationKeyEdit : public Object { - OBJ_TYPE(AnimationKeyEdit,Object); + GDCLASS(AnimationKeyEdit,Object); public: bool setting; bool hidden; static void _bind_methods() { - ObjectTypeDB::bind_method("_update_obj",&AnimationKeyEdit::_update_obj); - ObjectTypeDB::bind_method("_key_ofs_changed",&AnimationKeyEdit::_key_ofs_changed); + ClassDB::bind_method("_update_obj",&AnimationKeyEdit::_update_obj); + ClassDB::bind_method("_key_ofs_changed",&AnimationKeyEdit::_key_ofs_changed); } //PopupDialog *ke_dialog; @@ -612,7 +612,7 @@ public: if (res.is_valid()) { hint=PROPERTY_HINT_RESOURCE_TYPE; - hint_string=res->get_type(); + hint_string=res->get_class(); } } @@ -1040,7 +1040,7 @@ void AnimationKeyEditor::_animation_optimize() { - animation->optimize(optimize_linear_error->get_val(),optimize_angular_error->get_val(),optimize_max_angle->get_val()); + animation->optimize(optimize_linear_error->get_value(),optimize_angular_error->get_value(),optimize_max_angle->get_value()); track_editor->update(); undo_redo->clear_history(); @@ -1049,7 +1049,7 @@ void AnimationKeyEditor::_animation_optimize() { float AnimationKeyEditor::_get_zoom_scale() const { - float zv = zoom->get_val(); + float zv = zoom->get_value(); if (zv<1) { zv = 1.0-zv; return Math::pow(1.0+zv,8.0)*100; @@ -1072,7 +1072,7 @@ void AnimationKeyEditor::_track_pos_draw() { int settings_limit = size.width - right_data_size_cache; int name_limit = settings_limit * name_column_ratio; - float keys_from= h_scroll->get_val(); + float keys_from= h_scroll->get_value(); float zoom_scale = _get_zoom_scale(); float keys_to=keys_from+(settings_limit-name_limit) / zoom_scale; @@ -1081,7 +1081,7 @@ void AnimationKeyEditor::_track_pos_draw() { //will move to separate control! (for speedup) if (timeline_pos >= keys_from && timeline_pos<keys_to) { //draw position - int pixel = (timeline_pos - h_scroll->get_val()) * zoom_scale; + int pixel = (timeline_pos - h_scroll->get_value()) * zoom_scale; pixel+=name_limit; track_pos->draw_line(ofs+Point2(pixel,0),ofs+Point2(pixel,size.height),Color(1,0.3,0.3,0.8)); @@ -1090,7 +1090,6 @@ void AnimationKeyEditor::_track_pos_draw() { void AnimationKeyEditor::_track_editor_draw() { - VisualServer::get_singleton()->canvas_item_set_clip(track_editor->get_canvas_item(),true); if (animation.is_valid() && animation->get_track_count()) { if (selected_track < 0) @@ -1157,6 +1156,12 @@ void AnimationKeyEditor::_track_editor_draw() { Ref<Texture> add_key_icon = get_icon("TrackAddKey","EditorIcons"); Ref<Texture> add_key_icon_hl = get_icon("TrackAddKeyHl","EditorIcons"); Ref<Texture> down_icon = get_icon("select_arrow","Tree"); + + Ref<Texture> wrap_icon[2]={ + get_icon("InterpWrapClamp","EditorIcons"), + get_icon("InterpWrapLoop","EditorIcons"), + }; + Ref<Texture> interp_icon[3]={ get_icon("InterpRaw","EditorIcons"), get_icon("InterpLinear","EditorIcons"), @@ -1181,7 +1186,7 @@ void AnimationKeyEditor::_track_editor_draw() { Ref<Texture> type_hover=get_icon("KeyHover","EditorIcons"); Ref<Texture> type_selected=get_icon("KeySelected","EditorIcons"); - int right_separator_ofs = down_icon->get_width() *2 + add_key_icon->get_width() + interp_icon[0]->get_width() + cont_icon[0]->get_width() + hsep*7; + int right_separator_ofs = down_icon->get_width() *3 + add_key_icon->get_width() + interp_icon[0]->get_width() + wrap_icon[0]->get_width() + cont_icon[0]->get_width() + hsep*9; int h = font->get_height()+sep; @@ -1227,8 +1232,8 @@ void AnimationKeyEditor::_track_editor_draw() { if (l<=0) l=0.001; //avoid crashor - int end_px = (l - h_scroll->get_val()) * scale; - int begin_px = -h_scroll->get_val() * scale; + int end_px = (l - h_scroll->get_value()) * scale; + int begin_px = -h_scroll->get_value() * scale; Color notimecol; notimecol.r=timecolor.gray(); notimecol.g=notimecol.r; @@ -1254,7 +1259,7 @@ void AnimationKeyEditor::_track_editor_draw() { - keys_from= h_scroll->get_val(); + keys_from= h_scroll->get_value(); keys_to=keys_from+zoomw / scale; { @@ -1331,8 +1336,8 @@ void AnimationKeyEditor::_track_editor_draw() { for(int i=0;i<zoomw;i++) { - float pos = h_scroll->get_val() + double(i)/scale; - float prev = h_scroll->get_val() + (double(i)-1.0)/scale; + float pos = h_scroll->get_value() + double(i)/scale; + float prev = h_scroll->get_value() + (double(i)-1.0)/scale; int sc = int(Math::floor(pos*SC_ADJ)); @@ -1356,7 +1361,7 @@ void AnimationKeyEditor::_track_editor_draw() { //this code sucks, i always forget how it works - int idx = v_scroll->get_val() + i; + int idx = v_scroll->get_value() + i; if (idx>=animation->get_track_count()) break; int y = h+i*h+sep; @@ -1421,6 +1426,20 @@ void AnimationKeyEditor::_track_editor_draw() { icon_ofs.x-=hsep; */ + track_ofs[0]=size.width-icon_ofs.x; + icon_ofs.x-=down_icon->get_width(); + te->draw_texture(down_icon,icon_ofs); + + int wrap_type = animation->track_get_interpolation_loop_wrap(idx)?1:0; + icon_ofs.x-=hsep; + icon_ofs.x-=wrap_icon[wrap_type]->get_width(); + te->draw_texture(wrap_icon[wrap_type],icon_ofs); + + icon_ofs.x-=hsep; + te->draw_line(Point2(icon_ofs.x,ofs.y+y),Point2(icon_ofs.x,ofs.y+y+h),sepcolor); + + track_ofs[1]=size.width-icon_ofs.x; + icon_ofs.x-=down_icon->get_width(); te->draw_texture(down_icon,icon_ofs); @@ -1433,6 +1452,8 @@ void AnimationKeyEditor::_track_editor_draw() { icon_ofs.x-=hsep; te->draw_line(Point2(icon_ofs.x,ofs.y+y),Point2(icon_ofs.x,ofs.y+y+h),sepcolor); + track_ofs[2]=size.width-icon_ofs.x; + if (animation->track_get_type(idx)==Animation::TYPE_VALUE) { @@ -1453,10 +1474,14 @@ void AnimationKeyEditor::_track_editor_draw() { icon_ofs.x-=hsep; te->draw_line(Point2(icon_ofs.x,ofs.y+y),Point2(icon_ofs.x,ofs.y+y+h),sepcolor); + track_ofs[3]=size.width-icon_ofs.x; + icon_ofs.x-=hsep; icon_ofs.x-=add_key_icon->get_width(); te->draw_texture((mouse_over.over==MouseOver::OVER_ADD_KEY && mouse_over.track==idx)?add_key_icon_hl:add_key_icon,icon_ofs); + track_ofs[4]=size.width-icon_ofs.x; + //draw the keys; int tt = animation->track_get_type(idx); float key_vofs = Math::floor((h - type_icon[tt]->get_height())/2); @@ -1552,14 +1577,14 @@ void AnimationKeyEditor::_track_editor_draw() { } float motion = from_t+(click.to.x - click.at.x)/zoom_scale; - if (step->get_val()) - motion = Math::stepify(motion,step->get_val()); + if (step->get_value()) + motion = Math::stepify(motion,step->get_value()); for(Map<SelectedKey,KeyInfo>::Element *E=selection.front();E;E=E->next()) { int idx = E->key().track; - int i = idx-v_scroll->get_val(); + int i = idx-v_scroll->get_value(); if (i<0 || i>=fit) continue; int y = h+i*h+sep; @@ -1621,6 +1646,14 @@ void AnimationKeyEditor::_track_menu_selected(int p_idx) { undo_redo->add_do_method(animation.ptr(),"value_track_set_update_mode",cont_editing,p_idx); undo_redo->add_undo_method(animation.ptr(),"value_track_set_update_mode",cont_editing,animation->value_track_get_update_mode(cont_editing)); undo_redo->commit_action(); + } else if (wrap_editing!=-1) { + + ERR_FAIL_INDEX(wrap_editing,animation->get_track_count()); + + undo_redo->create_action(TTR("Anim Track Change Wrap Mode")); + undo_redo->add_do_method(animation.ptr(),"track_set_interpolation_loop_wrap",wrap_editing,p_idx?true:false); + undo_redo->add_undo_method(animation.ptr(),"track_set_interpolation_loop_wrap",wrap_editing,animation->track_get_interpolation_loop_wrap(wrap_editing)); + undo_redo->commit_action(); } else { switch (p_idx) { @@ -1811,7 +1844,7 @@ void AnimationKeyEditor::_anim_delete_keys() { } } -void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { +void AnimationKeyEditor::_track_editor_gui_input(const InputEvent& p_input) { Control *te=track_editor; Ref<StyleBox> style = get_stylebox("normal","TextEdit"); @@ -1833,6 +1866,10 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { Ref<Texture> hsize_icon = get_icon("Hsize","EditorIcons"); Ref<Texture> add_key_icon = get_icon("TrackAddKey","EditorIcons"); + Ref<Texture> wrap_icon[2]={ + get_icon("InterpWrapClamp","EditorIcons"), + get_icon("InterpWrapLoop","EditorIcons"), + }; Ref<Texture> interp_icon[3]={ get_icon("InterpRaw","EditorIcons"), get_icon("InterpLinear","EditorIcons"), @@ -1848,7 +1885,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { get_icon("KeyXform","EditorIcons"), get_icon("KeyCall","EditorIcons") }; - int right_separator_ofs = down_icon->get_width() *2 + add_key_icon->get_width() + interp_icon[0]->get_width() + cont_icon[0]->get_width() + hsep*7; + int right_separator_ofs = down_icon->get_width() *3 + add_key_icon->get_width() + interp_icon[0]->get_width() + wrap_icon[0]->get_width() + cont_icon[0]->get_width() + hsep*9; int h = font->get_height()+sep; @@ -1896,8 +1933,8 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { if (v_scroll->is_visible()) { - if (v_scroll->get_val() > selected_track) - v_scroll->set_val(selected_track); + if (v_scroll->get_value() > selected_track) + v_scroll->set_value(selected_track); } @@ -1916,8 +1953,8 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { if (selected_track >= animation->get_track_count()) selected_track=animation->get_track_count()-1; - if (v_scroll->is_visible() && v_scroll->get_page()+v_scroll->get_val() < selected_track+1) { - v_scroll->set_val(selected_track-v_scroll->get_page()+1); + if (v_scroll->is_visible() && v_scroll->get_page()+v_scroll->get_value() < selected_track+1) { + v_scroll->set_value(selected_track-v_scroll->get_page()+1); } track_editor->update(); @@ -1934,18 +1971,18 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { if (mb.button_index==BUTTON_WHEEL_UP && mb.pressed) { if (mb.mod.command) { - zoom->set_val(zoom->get_val() + zoom->get_step()); + zoom->set_value(zoom->get_value() + zoom->get_step()); } else { - v_scroll->set_val( v_scroll->get_val() - v_scroll->get_page() / 8 ); + v_scroll->set_value( v_scroll->get_value() - v_scroll->get_page() / 8 ); } } if (mb.button_index==BUTTON_WHEEL_DOWN && mb.pressed) { if (mb.mod.command) { - zoom->set_val(zoom->get_val() - zoom->get_step()); + zoom->set_value(zoom->get_value() - zoom->get_step()); } else { - v_scroll->set_val( v_scroll->get_val() + v_scroll->get_page() / 8 ); + v_scroll->set_value( v_scroll->get_value() + v_scroll->get_page() / 8 ); } } @@ -1966,7 +2003,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { mpos.y -= h; int idx = mpos.y / h; - idx+=v_scroll->get_val(); + idx+=v_scroll->get_value(); if (idx <0 || idx>=animation->get_track_count()) break; @@ -1974,7 +2011,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { } else if (mpos.x < settings_limit) { float pos = mpos.x - name_limit; pos/=_get_zoom_scale(); - pos+=h_scroll->get_val(); + pos+=h_scroll->get_value(); float w_time = (type_icon[0]->get_width() / _get_zoom_scale())/2.0; int kidx = animation->track_find_key(idx,pos); @@ -2054,6 +2091,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { interp_editing=-1; cont_editing=-1; + wrap_editing=-1; track_menu->popup(); } @@ -2083,7 +2121,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { //seek //int zoomw = settings_limit-name_limit; float scale = _get_zoom_scale(); - float pos = h_scroll->get_val() + (mpos.x-name_limit) / scale; + float pos = h_scroll->get_value() + (mpos.x-name_limit) / scale; if (animation->get_step()) pos=Math::stepify(pos,animation->get_step()); @@ -2105,7 +2143,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { mpos.y -= h; int idx = mpos.y / h; - idx+=v_scroll->get_val(); + idx+=v_scroll->get_value(); if (idx <0) break; @@ -2146,7 +2184,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { float pos = mpos.x - name_limit; pos/=_get_zoom_scale(); - pos+=h_scroll->get_val(); + pos+=h_scroll->get_value(); float w_time = (type_icon[0]->get_width() / _get_zoom_scale())/2.0; int kidx = animation->track_find_key(idx,pos); @@ -2277,7 +2315,33 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { ofsx-=hsep*3+move_up_icon->get_width(); */ - if (ofsx < down_icon->get_width() + interp_icon[0]->get_width() + hsep*2) { + + if (ofsx < track_ofs[1]) { + + track_menu->clear(); + track_menu->set_size(Point2(1,1)); + static const char *interp_name[2]={"Clamp Loop Interp","Wrap Loop Interp"}; + for(int i=0;i<2;i++) { + track_menu->add_icon_item(wrap_icon[i],interp_name[i]); + } + + int popup_y = ofs.y+((int(mpos.y)/h)+2)*h; + int popup_x = size.width-track_ofs[1]; + + track_menu->set_pos(te->get_global_pos()+Point2(popup_x,popup_y)); + + + wrap_editing=idx; + interp_editing=-1; + cont_editing=-1; + + track_menu->popup(); + + return; + } + + + if (ofsx < track_ofs[2]) { track_menu->clear(); track_menu->set_size(Point2(1,1)); @@ -2286,24 +2350,22 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { track_menu->add_icon_item(interp_icon[i],interp_name[i]); } - int lofs = remove_icon->get_width() + move_up_icon->get_width() + move_down_icon->get_width() + down_icon->get_width() *2 + hsep*7;//interp_icon[0]->get_width() + cont_icon[0]->get_width() ; int popup_y = ofs.y+((int(mpos.y)/h)+2)*h; - int popup_x = ofs.x+size.width-lofs; + int popup_x = size.width-track_ofs[2]; track_menu->set_pos(te->get_global_pos()+Point2(popup_x,popup_y)); interp_editing=idx; cont_editing=-1; + wrap_editing=-1; track_menu->popup(); return; } - ofsx-=hsep*2+interp_icon[0]->get_width()+down_icon->get_width(); - - if (ofsx < down_icon->get_width() + cont_icon[0]->get_width()) { + if (ofsx < track_ofs[3]) { track_menu->clear(); track_menu->set_size(Point2(1,1)); @@ -2312,13 +2374,14 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { track_menu->add_icon_item(cont_icon[i],cont_name[i]); } - int lofs = settings_limit; + int popup_y = ofs.y+((int(mpos.y)/h)+2)*h; - int popup_x = ofs.x+lofs; + int popup_x = size.width-track_ofs[3]; track_menu->set_pos(te->get_global_pos()+Point2(popup_x,popup_y)); interp_editing=-1; + wrap_editing=-1; cont_editing=idx; track_menu->popup(); @@ -2326,9 +2389,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { return; } - ofsx-=hsep*3+cont_icon[0]->get_width()+down_icon->get_width(); - - if (ofsx < add_key_icon->get_width()) { + if (ofsx < track_ofs[4]) { Animation::TrackType tt = animation->track_get_type(idx); @@ -2403,7 +2464,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { float zoom_scale=_get_zoom_scale(); - float keys_from = h_scroll->get_val(); + float keys_from = h_scroll->get_value(); float keys_to = keys_from + (settings_limit-name_limit) / zoom_scale; float from_time = keys_from + ( click.at.x - (name_limit+ofs.x)) / zoom_scale; @@ -2423,8 +2484,8 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { to_time = keys_to; - int from_track = int(click.at.y-ofs.y-h-sep) / h + v_scroll->get_val(); - int to_track = int(click.to.y-ofs.y-h-sep) / h + v_scroll->get_val(); + int from_track = int(click.at.y-ofs.y-h-sep) / h + v_scroll->get_value(); + int to_track = int(click.to.y-ofs.y-h-sep) / h + v_scroll->get_value(); int from_mod = int(click.at.y-ofs.y-sep) % h; int to_mod = int(click.to.y-ofs.y-sep) % h; @@ -2452,8 +2513,8 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { break; } - int tracks_from = v_scroll->get_val(); - int tracks_to = v_scroll->get_val()+fit-1; + int tracks_from = v_scroll->get_value(); + int tracks_to = v_scroll->get_value()+fit-1; if (tracks_to>=animation->get_track_count()) tracks_to=animation->get_track_count()-1; @@ -2536,8 +2597,8 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { } float motion = from_t+(click.to.x - click.at.x)/_get_zoom_scale(); - if (step->get_val()) - motion = Math::stepify(motion,step->get_val()); + if (step->get_value()) + motion = Math::stepify(motion,step->get_value()); @@ -2700,7 +2761,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { //int zoomw = settings_limit-name_limit; float scale = _get_zoom_scale(); - float pos = h_scroll->get_val() + (mpos.x-name_limit) / scale; + float pos = h_scroll->get_value() + (mpos.x-name_limit) / scale; if (animation->get_step()) { pos=Math::stepify(pos,animation->get_step()); @@ -2710,10 +2771,10 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { if (pos>=animation->get_length()) pos=animation->get_length(); - if (pos < h_scroll->get_val()) { - h_scroll->set_val(pos); - } else if (pos > h_scroll->get_val() + (settings_limit - name_limit) / scale) { - h_scroll->set_val( pos - (settings_limit - name_limit) / scale ); + if (pos < h_scroll->get_value()) { + h_scroll->set_value(pos); + } else if (pos > h_scroll->get_value() + (settings_limit - name_limit) / scale) { + h_scroll->set_value( pos - (settings_limit - name_limit) / scale ); } timeline_pos=pos; @@ -2727,18 +2788,18 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { click.to=Point2(mb.x,mb.y); if (click.to.y<h && click.at.y>h && mb.relative_y<0) { - float prev = v_scroll->get_val(); - v_scroll->set_val( v_scroll->get_val() -1 ); - if (prev!=v_scroll->get_val()) + float prev = v_scroll->get_value(); + v_scroll->set_value( v_scroll->get_value() -1 ); + if (prev!=v_scroll->get_value()) click.at.y+=h; } if (click.to.y>size.height && click.at.y<size.height && mb.relative_y>0) { - float prev = v_scroll->get_val(); - v_scroll->set_val( v_scroll->get_val() +1 ); - if (prev!=v_scroll->get_val()) + float prev = v_scroll->get_value(); + v_scroll->set_value( v_scroll->get_value() +1 ); + if (prev!=v_scroll->get_value()) click.at.y-=h; } @@ -2755,7 +2816,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { int rel = mb.relative_x; float relf = rel / _get_zoom_scale(); - h_scroll->set_val( h_scroll->get_val() - relf ); + h_scroll->set_value( h_scroll->get_value() - relf ); } if (mb.button_mask==0) { @@ -2781,7 +2842,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { mpos.y -= h; int idx = mpos.y / h; - idx+=v_scroll->get_val(); + idx+=v_scroll->get_value(); if (idx <0 || idx>=animation->get_track_count()) break; @@ -2797,7 +2858,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { float pos = mpos.x - name_limit; pos/=_get_zoom_scale(); - pos+=h_scroll->get_val(); + pos+=h_scroll->get_value(); float w_time = (type_icon[0]->get_width() / _get_zoom_scale())/2.0; int kidx = animation->track_find_key(idx,pos); @@ -2940,7 +3001,15 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { */ - if (ofsx < down_icon->get_width() + interp_icon[0]->get_width() + hsep*2) { + if (ofsx < down_icon->get_width() + wrap_icon[0]->get_width() + hsep*3) { + + mouse_over.over=MouseOver::OVER_WRAP; + return; + } + + ofsx-=hsep*3+wrap_icon[0]->get_width() + down_icon->get_width(); + + if (ofsx < down_icon->get_width() + interp_icon[0]->get_width() + hsep*3) { mouse_over.over=MouseOver::OVER_INTERP; return; @@ -3012,7 +3081,7 @@ void AnimationKeyEditor::_notification(int p_what) { tpp->add_item(TTR("In-Out"),TRACK_MENU_SET_ALL_TRANS_INOUT); tpp->add_item(TTR("Out-In"),TRACK_MENU_SET_ALL_TRANS_OUTIN); tpp->set_name(TTR("Transitions")); - tpp->connect("item_pressed",this,"_menu_track"); + tpp->connect("id_pressed",this,"_menu_track"); optimize_dialog->connect("confirmed",this,"_animation_optimize"); menu_track->get_popup()->add_child(tpp); @@ -3068,8 +3137,13 @@ void AnimationKeyEditor::_notification(int p_what) { get_icon("TrackTrigger","EditorIcons") }; + Ref<Texture> wrap_icon[2]={ + get_icon("InterpWrapClamp","EditorIcons"), + get_icon("InterpWrapLoop","EditorIcons"), + }; + //right_data_size_cache = remove_icon->get_width() + move_up_icon->get_width() + move_down_icon->get_width() + down_icon->get_width() *2 + interp_icon[0]->get_width() + cont_icon[0]->get_width() + add_key_icon->get_width() + hsep*11; - right_data_size_cache = down_icon->get_width() *2 + add_key_icon->get_width() + interp_icon[0]->get_width() + cont_icon[0]->get_width() + hsep*7; + right_data_size_cache = down_icon->get_width() *3 + add_key_icon->get_width() + interp_icon[0]->get_width() + cont_icon[0]->get_width() + wrap_icon[0]->get_width() + hsep*8; } @@ -3112,8 +3186,8 @@ void AnimationKeyEditor::_update_paths() { //timeline->set_max(animation->get_length()); //timeline->set_step(0.01); track_editor->update(); - length->set_val(animation->get_length()); - step->set_val(animation->get_step()); + length->set_value(animation->get_length()); + step->set_value(animation->get_step()); } } @@ -3130,9 +3204,9 @@ void AnimationKeyEditor::_update_menu() { if (animation.is_valid()) { - length->set_val(animation->get_length()); + length->set_value(animation->get_length()); loop->set_pressed(animation->has_loop()); - step->set_val(animation->get_step()); + step->set_value(animation->get_step()); } track_editor->update(); @@ -3233,7 +3307,7 @@ void AnimationKeyEditor::_query_insert(const InsertData& p_id) { insert_data.push_back(p_id); if (p_id.track_idx==-1) { - if (bool(EDITOR_DEF("animation/confirm_insert_track",true))) { + if (bool(EDITOR_DEF("editors/animation/confirm_insert_track",true))) { //potential new key, does not exist if (insert_data.size()==1) insert_confirm->set_text(vformat(TTR("Create NEW track for %s and insert key?"),p_id.query)); @@ -3451,7 +3525,7 @@ int AnimationKeyEditor::_confirm_insert(InsertData p_id,int p_last_track) { h.type==Variant::VECTOR2 || h.type==Variant::RECT2 || h.type==Variant::VECTOR3 || - h.type==Variant::_AABB || + h.type==Variant::RECT3 || h.type==Variant::QUAT || h.type==Variant::COLOR || h.type==Variant::TRANSFORM ) { @@ -3710,7 +3784,7 @@ void AnimationKeyEditor::_scale() { } - float s = scale->get_val(); + float s = scale->get_value(); if (s==0) { ERR_PRINT("Can't scale to 0"); } @@ -3841,48 +3915,48 @@ void AnimationKeyEditor::cleanup() { void AnimationKeyEditor::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_root_removed"),&AnimationKeyEditor::_root_removed); - ObjectTypeDB::bind_method(_MD("_scale"),&AnimationKeyEditor::_scale); - ObjectTypeDB::bind_method(_MD("set_root"),&AnimationKeyEditor::set_root); + ClassDB::bind_method(_MD("_root_removed"),&AnimationKeyEditor::_root_removed); + ClassDB::bind_method(_MD("_scale"),&AnimationKeyEditor::_scale); + ClassDB::bind_method(_MD("set_root"),&AnimationKeyEditor::set_root); -// ObjectTypeDB::bind_method(_MD("_confirm_insert"),&AnimationKeyEditor::_confirm_insert); - ObjectTypeDB::bind_method(_MD("_confirm_insert_list"),&AnimationKeyEditor::_confirm_insert_list); +// ClassDB::bind_method(_MD("_confirm_insert"),&AnimationKeyEditor::_confirm_insert); + ClassDB::bind_method(_MD("_confirm_insert_list"),&AnimationKeyEditor::_confirm_insert_list); - ObjectTypeDB::bind_method(_MD("_update_paths"),&AnimationKeyEditor::_update_paths); - ObjectTypeDB::bind_method(_MD("_track_editor_draw"),&AnimationKeyEditor::_track_editor_draw); + ClassDB::bind_method(_MD("_update_paths"),&AnimationKeyEditor::_update_paths); + ClassDB::bind_method(_MD("_track_editor_draw"),&AnimationKeyEditor::_track_editor_draw); - ObjectTypeDB::bind_method(_MD("_animation_changed"),&AnimationKeyEditor::_animation_changed); - ObjectTypeDB::bind_method(_MD("_scroll_changed"),&AnimationKeyEditor::_scroll_changed); - ObjectTypeDB::bind_method(_MD("_track_editor_input_event"),&AnimationKeyEditor::_track_editor_input_event); - ObjectTypeDB::bind_method(_MD("_track_name_changed"),&AnimationKeyEditor::_track_name_changed); - ObjectTypeDB::bind_method(_MD("_track_menu_selected"),&AnimationKeyEditor::_track_menu_selected); - ObjectTypeDB::bind_method(_MD("_menu_add_track"),&AnimationKeyEditor::_menu_add_track); - ObjectTypeDB::bind_method(_MD("_menu_track"),&AnimationKeyEditor::_menu_track); - ObjectTypeDB::bind_method(_MD("_clear_selection_for_anim"),&AnimationKeyEditor::_clear_selection_for_anim); - ObjectTypeDB::bind_method(_MD("_select_at_anim"),&AnimationKeyEditor::_select_at_anim); - ObjectTypeDB::bind_method(_MD("_track_pos_draw"),&AnimationKeyEditor::_track_pos_draw); - ObjectTypeDB::bind_method(_MD("_insert_delay"),&AnimationKeyEditor::_insert_delay); - ObjectTypeDB::bind_method(_MD("_step_changed"),&AnimationKeyEditor::_step_changed); + ClassDB::bind_method(_MD("_animation_changed"),&AnimationKeyEditor::_animation_changed); + ClassDB::bind_method(_MD("_scroll_changed"),&AnimationKeyEditor::_scroll_changed); + ClassDB::bind_method(_MD("_track_editor_gui_input"),&AnimationKeyEditor::_track_editor_gui_input); + ClassDB::bind_method(_MD("_track_name_changed"),&AnimationKeyEditor::_track_name_changed); + ClassDB::bind_method(_MD("_track_menu_selected"),&AnimationKeyEditor::_track_menu_selected); + ClassDB::bind_method(_MD("_menu_add_track"),&AnimationKeyEditor::_menu_add_track); + ClassDB::bind_method(_MD("_menu_track"),&AnimationKeyEditor::_menu_track); + ClassDB::bind_method(_MD("_clear_selection_for_anim"),&AnimationKeyEditor::_clear_selection_for_anim); + ClassDB::bind_method(_MD("_select_at_anim"),&AnimationKeyEditor::_select_at_anim); + ClassDB::bind_method(_MD("_track_pos_draw"),&AnimationKeyEditor::_track_pos_draw); + ClassDB::bind_method(_MD("_insert_delay"),&AnimationKeyEditor::_insert_delay); + ClassDB::bind_method(_MD("_step_changed"),&AnimationKeyEditor::_step_changed); - ObjectTypeDB::bind_method(_MD("_animation_loop_changed"),&AnimationKeyEditor::_animation_loop_changed); - ObjectTypeDB::bind_method(_MD("_animation_len_changed"),&AnimationKeyEditor::_animation_len_changed); - ObjectTypeDB::bind_method(_MD("_create_value_item"),&AnimationKeyEditor::_create_value_item); - ObjectTypeDB::bind_method(_MD("_pane_drag"),&AnimationKeyEditor::_pane_drag); + ClassDB::bind_method(_MD("_animation_loop_changed"),&AnimationKeyEditor::_animation_loop_changed); + ClassDB::bind_method(_MD("_animation_len_changed"),&AnimationKeyEditor::_animation_len_changed); + ClassDB::bind_method(_MD("_create_value_item"),&AnimationKeyEditor::_create_value_item); + ClassDB::bind_method(_MD("_pane_drag"),&AnimationKeyEditor::_pane_drag); - ObjectTypeDB::bind_method(_MD("_animation_len_update"),&AnimationKeyEditor::_animation_len_update); + ClassDB::bind_method(_MD("_animation_len_update"),&AnimationKeyEditor::_animation_len_update); - ObjectTypeDB::bind_method(_MD("set_animation"),&AnimationKeyEditor::set_animation); - ObjectTypeDB::bind_method(_MD("_animation_optimize"),&AnimationKeyEditor::_animation_optimize); - ObjectTypeDB::bind_method(_MD("_curve_transition_changed"),&AnimationKeyEditor::_curve_transition_changed); - ObjectTypeDB::bind_method(_MD("_toggle_edit_curves"),&AnimationKeyEditor::_toggle_edit_curves); - ObjectTypeDB::bind_method(_MD("_add_call_track"),&AnimationKeyEditor::_add_call_track); + ClassDB::bind_method(_MD("set_animation"),&AnimationKeyEditor::set_animation); + ClassDB::bind_method(_MD("_animation_optimize"),&AnimationKeyEditor::_animation_optimize); + ClassDB::bind_method(_MD("_curve_transition_changed"),&AnimationKeyEditor::_curve_transition_changed); + ClassDB::bind_method(_MD("_toggle_edit_curves"),&AnimationKeyEditor::_toggle_edit_curves); + ClassDB::bind_method(_MD("_add_call_track"),&AnimationKeyEditor::_add_call_track); ADD_SIGNAL( MethodInfo("resource_selected", PropertyInfo( Variant::OBJECT, "res"),PropertyInfo( Variant::STRING, "prop") ) ); @@ -3914,7 +3988,7 @@ AnimationKeyEditor::AnimationKeyEditor() { h_scroll = memnew( HScrollBar ); h_scroll->connect("value_changed",this,"_scroll_changed"); add_child(h_scroll); - h_scroll->set_val(0); + h_scroll->set_value(0); HBoxContainer *hb = memnew( HBoxContainer ); @@ -3936,7 +4010,7 @@ AnimationKeyEditor::AnimationKeyEditor() { zoom->set_step(0.01); zoom->set_min(0.0); zoom->set_max(2.0); - zoom->set_val(1.0); + zoom->set_value(1.0); zoom->set_h_size_flags(SIZE_EXPAND_FILL); zoom->set_stretch_ratio(2); hb->add_child(zoom); @@ -3968,7 +4042,7 @@ AnimationKeyEditor::AnimationKeyEditor() { step->set_min(0.00); step->set_max(128); step->set_step(0.01); - step->set_val(0.0); + step->set_value(0.0); step->set_h_size_flags(SIZE_EXPAND_FILL); step->set_stretch_ratio(1); step->set_tooltip(TTR("Cursor step snap (in seconds).")); @@ -3986,7 +4060,7 @@ AnimationKeyEditor::AnimationKeyEditor() { menu_add_track = memnew( MenuButton ); hb->add_child(menu_add_track); - menu_add_track->get_popup()->connect("item_pressed",this,"_menu_add_track"); + menu_add_track->get_popup()->connect("id_pressed",this,"_menu_add_track"); menu_add_track->set_tooltip(TTR("Add new tracks.")); move_up_button = memnew( ToolButton ); @@ -4014,7 +4088,7 @@ AnimationKeyEditor::AnimationKeyEditor() { menu_track = memnew( MenuButton ); hb->add_child(menu_track); - menu_track->get_popup()->connect("item_pressed",this,"_menu_track"); + menu_track->get_popup()->connect("id_pressed",this,"_menu_track"); menu_track->set_tooltip(TTR("Track tools")); edit_button = memnew( ToolButton ); @@ -4030,18 +4104,18 @@ AnimationKeyEditor::AnimationKeyEditor() { optimize_dialog->set_title(TTR("Anim. Optimizer")); VBoxContainer *optimize_vb = memnew( VBoxContainer ); optimize_dialog->add_child(optimize_vb); - optimize_dialog->set_child_rect(optimize_vb); + optimize_linear_error = memnew( SpinBox ); optimize_linear_error->set_max(1.0); optimize_linear_error->set_min(0.001); optimize_linear_error->set_step(0.001); - optimize_linear_error->set_val(0.05); + optimize_linear_error->set_value(0.05); optimize_vb->add_margin_child(TTR("Max. Linear Error:"),optimize_linear_error); optimize_angular_error = memnew( SpinBox ); optimize_angular_error->set_max(1.0); optimize_angular_error->set_min(0.001); optimize_angular_error->set_step(0.001); - optimize_angular_error->set_val(0.01); + optimize_angular_error->set_value(0.01); optimize_vb->add_margin_child(TTR("Max. Angular Error:"),optimize_angular_error); optimize_max_angle = memnew( SpinBox ); @@ -4049,7 +4123,7 @@ AnimationKeyEditor::AnimationKeyEditor() { optimize_max_angle->set_max(360.0); optimize_max_angle->set_min(0.0); optimize_max_angle->set_step(0.1); - optimize_max_angle->set_val(22); + optimize_max_angle->set_value(22); optimize_dialog->get_ok()->set_text(TTR("Optimize")); @@ -4071,7 +4145,7 @@ AnimationKeyEditor::AnimationKeyEditor() { l->set_pos(Point2(0,3)); // dr_panel->add_child(l);*/ -// menu->get_popup()->connect("item_pressed",this,"_menu_callback"); +// menu->get_popup()->connect("id_pressed",this,"_menu_callback"); hb = memnew( HBoxContainer); @@ -4082,7 +4156,7 @@ AnimationKeyEditor::AnimationKeyEditor() { track_editor = memnew( Control ); track_editor->connect("draw",this,"_track_editor_draw"); hb->add_child(track_editor); - track_editor->connect("input_event",this,"_track_editor_input_event"); + track_editor->connect("gui_input",this,"_track_editor_gui_input"); track_editor->set_focus_mode(Control::FOCUS_ALL); track_editor->set_h_size_flags(SIZE_EXPAND_FILL); @@ -4090,7 +4164,7 @@ AnimationKeyEditor::AnimationKeyEditor() { track_pos = memnew( Control ); track_pos->set_area_as_parent_rect(); - track_pos->set_ignore_mouse(true); + track_pos->set_mouse_filter(MOUSE_FILTER_IGNORE); track_editor->add_child(track_pos); track_pos->connect("draw",this,"_track_pos_draw"); @@ -4107,7 +4181,7 @@ AnimationKeyEditor::AnimationKeyEditor() { v_scroll = memnew( VScrollBar ); hb->add_child(v_scroll); v_scroll->connect("value_changed",this,"_scroll_changed"); - v_scroll->set_val(0); + v_scroll->set_value(0); key_editor_tab = memnew(TabContainer); hb->add_child(key_editor_tab); @@ -4127,7 +4201,7 @@ AnimationKeyEditor::AnimationKeyEditor() { add_child(type_menu); for(int i=0;i<Variant::VARIANT_MAX;i++) type_menu->add_item(Variant::get_type_name(Variant::Type(i)),i); - type_menu->connect("item_pressed",this,"_create_value_item"); + type_menu->connect("id_pressed",this,"_create_value_item"); VBoxContainer *curve_vb = memnew( VBoxContainer ); curve_vb->set_name(TTR("Transition")); @@ -4166,7 +4240,7 @@ AnimationKeyEditor::AnimationKeyEditor() { track_name->connect("text_entered",this,"_track_name_changed"); track_menu = memnew( PopupMenu ); add_child(track_menu); - track_menu->connect("item_pressed",this,"_track_menu_selected"); + track_menu->connect("id_pressed",this,"_track_menu_selected"); key_editor_tab->hide(); @@ -4198,7 +4272,7 @@ AnimationKeyEditor::AnimationKeyEditor() { scale_dialog = memnew( ConfirmationDialog ); VBoxContainer *vbc = memnew( VBoxContainer ); scale_dialog->add_child(vbc); - scale_dialog->set_child_rect(vbc); + scale = memnew( SpinBox ); scale->set_min(-99999); scale->set_max(99999); @@ -4215,7 +4289,7 @@ AnimationKeyEditor::AnimationKeyEditor() { add_child(cleanup_dialog); VBoxContainer *cleanup_vb = memnew( VBoxContainer ); cleanup_dialog->add_child(cleanup_vb); - cleanup_dialog->set_child_rect(cleanup_vb); + cleanup_keys = memnew( CheckButton ); cleanup_keys->set_text(TTR("Remove invalid keys")); cleanup_keys->set_pressed(true); @@ -4237,6 +4311,7 @@ AnimationKeyEditor::AnimationKeyEditor() { add_constant_override("separation",get_constant("separation","VBoxContainer")); + track_editor->set_clip_contents(true); } diff --git a/tools/editor/animation_editor.h b/tools/editor/animation_editor.h index 3078b3288b..0c9b0b5ac6 100644 --- a/tools/editor/animation_editor.h +++ b/tools/editor/animation_editor.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -51,7 +51,7 @@ class AnimationCurveEdit; class AnimationKeyEditor : public VBoxContainer { - OBJ_TYPE( AnimationKeyEditor, VBoxContainer ); + GDCLASS( AnimationKeyEditor, VBoxContainer ); /* enum { @@ -113,6 +113,7 @@ class AnimationKeyEditor : public VBoxContainer { OVER_KEY, OVER_VALUE, OVER_INTERP, + OVER_WRAP, OVER_UP, OVER_DOWN, OVER_REMOVE, @@ -166,7 +167,9 @@ class AnimationKeyEditor : public VBoxContainer { int track_name_editing; int interp_editing; int cont_editing; + int wrap_editing; int selected_track; + int track_ofs[5]; int last_menu_track_opt; LineEdit *track_name; @@ -274,7 +277,7 @@ class AnimationKeyEditor : public VBoxContainer { float _get_zoom_scale() const; void _track_editor_draw(); - void _track_editor_input_event(const InputEvent& p_input); + void _track_editor_gui_input(const InputEvent& p_input); void _track_pos_draw(); diff --git a/tools/editor/array_property_edit.cpp b/tools/editor/array_property_edit.cpp index b6219ce67b..d7e980980c 100644 --- a/tools/editor/array_property_edit.cpp +++ b/tools/editor/array_property_edit.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -258,10 +258,10 @@ Node *ArrayPropertyEdit::get_node() { void ArrayPropertyEdit::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_set_size"),&ArrayPropertyEdit::_set_size); - ObjectTypeDB::bind_method(_MD("_set_value"),&ArrayPropertyEdit::_set_value); - ObjectTypeDB::bind_method(_MD("_notif_change"),&ArrayPropertyEdit::_notif_change); - ObjectTypeDB::bind_method(_MD("_notif_changev"),&ArrayPropertyEdit::_notif_changev); + ClassDB::bind_method(_MD("_set_size"),&ArrayPropertyEdit::_set_size); + ClassDB::bind_method(_MD("_set_value"),&ArrayPropertyEdit::_set_value); + ClassDB::bind_method(_MD("_notif_change"),&ArrayPropertyEdit::_notif_change); + ClassDB::bind_method(_MD("_notif_changev"),&ArrayPropertyEdit::_notif_changev); } ArrayPropertyEdit::ArrayPropertyEdit() diff --git a/tools/editor/array_property_edit.h b/tools/editor/array_property_edit.h index a2aa24c8ed..f904f3c159 100644 --- a/tools/editor/array_property_edit.h +++ b/tools/editor/array_property_edit.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class ArrayPropertyEdit : public Reference { - OBJ_TYPE(ArrayPropertyEdit,Reference); + GDCLASS(ArrayPropertyEdit,Reference); int page; ObjectID obj; diff --git a/tools/editor/asset_library_editor_plugin.cpp b/tools/editor/asset_library_editor_plugin.cpp index 3fd5d2b5d1..11d7a2b58b 100644 --- a/tools/editor/asset_library_editor_plugin.cpp +++ b/tools/editor/asset_library_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -29,7 +29,7 @@ #include "asset_library_editor_plugin.h" #include "editor_node.h" #include "editor_settings.h" - +#include "io/json.h" @@ -89,10 +89,10 @@ void EditorAssetLibraryItem::_author_clicked(){ void EditorAssetLibraryItem::_bind_methods() { - ObjectTypeDB::bind_method("set_image",&EditorAssetLibraryItem::set_image); - ObjectTypeDB::bind_method("_asset_clicked",&EditorAssetLibraryItem::_asset_clicked); - ObjectTypeDB::bind_method("_category_clicked",&EditorAssetLibraryItem::_category_clicked); - ObjectTypeDB::bind_method("_author_clicked",&EditorAssetLibraryItem::_author_clicked); + ClassDB::bind_method("set_image",&EditorAssetLibraryItem::set_image); + ClassDB::bind_method("_asset_clicked",&EditorAssetLibraryItem::_asset_clicked); + ClassDB::bind_method("_category_clicked",&EditorAssetLibraryItem::_category_clicked); + ClassDB::bind_method("_author_clicked",&EditorAssetLibraryItem::_author_clicked); ADD_SIGNAL( MethodInfo("asset_selected")); ADD_SIGNAL( MethodInfo("category_selected")); ADD_SIGNAL( MethodInfo("author_selected")); @@ -157,7 +157,7 @@ EditorAssetLibraryItem::EditorAssetLibraryItem() { set_custom_minimum_size(Size2(250,100)); set_h_size_flags(SIZE_EXPAND_FILL); - set_stop_mouse(false); + set_mouse_filter(MOUSE_FILTER_PASS); } ////////////////////////////////////////////////////////////////////////////// @@ -199,9 +199,9 @@ void EditorAssetLibraryItemDescription::set_image(int p_type,int p_index,const R } void EditorAssetLibraryItemDescription::_bind_methods() { - ObjectTypeDB::bind_method(_MD("set_image"),&EditorAssetLibraryItemDescription::set_image); - ObjectTypeDB::bind_method(_MD("_link_click"),&EditorAssetLibraryItemDescription::_link_click); - ObjectTypeDB::bind_method(_MD("_preview_click"),&EditorAssetLibraryItemDescription::_preview_click); + ClassDB::bind_method(_MD("set_image"),&EditorAssetLibraryItemDescription::set_image); + ClassDB::bind_method(_MD("_link_click"),&EditorAssetLibraryItemDescription::_link_click); + ClassDB::bind_method(_MD("_preview_click"),&EditorAssetLibraryItemDescription::_preview_click); } @@ -270,7 +270,7 @@ EditorAssetLibraryItemDescription::EditorAssetLibraryItemDescription() { VBoxContainer *vbox = memnew( VBoxContainer ); add_child(vbox); - set_child_rect(vbox); + HBoxContainer *hbox = memnew( HBoxContainer); @@ -321,7 +321,7 @@ EditorAssetLibraryItemDescription::EditorAssetLibraryItemDescription() { } /////////////////////////////////////////////////////////////////////////////////// -void EditorAssetLibraryItemDownload::_http_download_completed(int p_status, int p_code, const StringArray& headers, const ByteArray& p_data) { +void EditorAssetLibraryItemDownload::_http_download_completed(int p_status, int p_code, const PoolStringArray& headers, const PoolByteArray& p_data) { String error_text; @@ -379,12 +379,12 @@ void EditorAssetLibraryItemDownload::_http_download_completed(int p_status, int } progress->set_max( download->get_body_size() ); - progress->set_val(download->get_downloaded_bytes()); + progress->set_value(download->get_downloaded_bytes()); print_line("max: "+itos(download->get_body_size())+" bytes: "+itos(download->get_downloaded_bytes())); install->set_disabled(false); - progress->set_val(download->get_downloaded_bytes()); + progress->set_value(download->get_downloaded_bytes()); status->set_text("Success! ("+String::humanize_size(download->get_downloaded_bytes())+")"); set_process(false); @@ -411,7 +411,7 @@ void EditorAssetLibraryItemDownload::_notification(int p_what) { if (p_what==NOTIFICATION_PROCESS) { progress->set_max( download->get_body_size() ); - progress->set_val(download->get_downloaded_bytes()); + progress->set_value(download->get_downloaded_bytes()); int cstatus = download->get_http_client_status(); @@ -472,10 +472,10 @@ void EditorAssetLibraryItemDownload::_make_request() { void EditorAssetLibraryItemDownload::_bind_methods() { - ObjectTypeDB::bind_method("_http_download_completed",&EditorAssetLibraryItemDownload::_http_download_completed); - ObjectTypeDB::bind_method("_install",&EditorAssetLibraryItemDownload::_install); - ObjectTypeDB::bind_method("_close",&EditorAssetLibraryItemDownload::_close); - ObjectTypeDB::bind_method("_make_request",&EditorAssetLibraryItemDownload::_make_request); + ClassDB::bind_method("_http_download_completed",&EditorAssetLibraryItemDownload::_http_download_completed); + ClassDB::bind_method("_install",&EditorAssetLibraryItemDownload::_install); + ClassDB::bind_method("_close",&EditorAssetLibraryItemDownload::_close); + ClassDB::bind_method("_make_request",&EditorAssetLibraryItemDownload::_make_request); ADD_SIGNAL(MethodInfo("install_asset",PropertyInfo(Variant::STRING,"zip_path"),PropertyInfo(Variant::STRING,"name"))); @@ -582,16 +582,16 @@ void EditorAssetLibrary::_notification(int p_what) { switch(s) { case HTTPClient::STATUS_RESOLVING: { - load_status->set_val(0.1); + load_status->set_value(0.1); } break; case HTTPClient::STATUS_CONNECTING: { - load_status->set_val(0.2); + load_status->set_value(0.2); } break; case HTTPClient::STATUS_REQUESTING: { - load_status->set_val(0.3); + load_status->set_value(0.3); } break; case HTTPClient::STATUS_BODY: { - load_status->set_val(0.4); + load_status->set_value(0.4); } break; default: {} @@ -691,12 +691,12 @@ void EditorAssetLibrary::_select_asset(int p_id){ description->popup_centered_minsize();*/ } -void EditorAssetLibrary::_image_update(bool use_cache, bool final, const ByteArray& p_data, int p_queue_id) { +void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PoolByteArray& p_data, int p_queue_id) { Object *obj = ObjectDB::get_instance(image_queue[p_queue_id].target); if (obj) { bool image_set = false; - ByteArray image_data = p_data; + PoolByteArray image_data = p_data; if(use_cache) { String cache_filename_base = EditorSettings::get_singleton()->get_settings_path().plus_file("tmp").plus_file("assetimage_"+image_queue[p_queue_id].image_url.md5_text()); @@ -704,11 +704,11 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const ByteArr FileAccess* file = FileAccess::open(cache_filename_base+".data", FileAccess::READ); if(file) { - ByteArray cached_data; + PoolByteArray cached_data; int len=file->get_32(); cached_data.resize(len); - ByteArray::Write w=cached_data.write(); + PoolByteArray::Write w=cached_data.write(); file->get_buffer(w.ptr(), len); image_data = cached_data; @@ -717,7 +717,7 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const ByteArr } int len=image_data.size(); - ByteArray::Read r=image_data.read(); + PoolByteArray::Read r=image_data.read(); Image image(r.ptr(),len); if (!image.empty()) { float max_height = 10000; @@ -745,7 +745,7 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const ByteArr } } -void EditorAssetLibrary::_image_request_completed(int p_status, int p_code, const StringArray& headers, const ByteArray& p_data,int p_queue_id) { +void EditorAssetLibrary::_image_request_completed(int p_status, int p_code, const PoolStringArray& headers, const PoolByteArray& p_data,int p_queue_id) { ERR_FAIL_COND( !image_queue.has(p_queue_id) ); @@ -767,7 +767,7 @@ void EditorAssetLibrary::_image_request_completed(int p_status, int p_code, cons } int len=p_data.size(); - ByteArray::Read r=p_data.read(); + PoolByteArray::Read r=p_data.read(); file = FileAccess::open(cache_filename_base+".data", FileAccess::WRITE); if(file) { file->store_32(len); @@ -855,7 +855,7 @@ void EditorAssetLibrary::_request_image(ObjectID p_for,String p_image_url,ImageT add_child(iq.request); - _image_update(true, false, ByteArray(), iq.queue_id); + _image_update(true, false, PoolByteArray(), iq.queue_id); _update_image_queue(); @@ -1021,14 +1021,14 @@ void EditorAssetLibrary::_api_request(const String& p_request, RequestType p_req -void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const StringArray& headers, const ByteArray& p_data) { +void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const PoolStringArray& headers, const PoolByteArray& p_data) { String str; { int datalen=p_data.size(); - ByteArray::Read r = p_data.read(); + PoolByteArray::Read r = p_data.read(); str.parse_utf8((const char*)r.ptr(),datalen); } @@ -1076,8 +1076,16 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const } print_line("response: "+itos(p_status)+" code: "+itos(p_code)); + Dictionary d; - d.parse_json(str); + { + Variant js; + String errs; + int errl; + JSON::parse(str,js,errs,errl); + d=js; + } + print_line(Variant(d).get_construct_string()); @@ -1288,20 +1296,20 @@ void EditorAssetLibrary::_install_external_asset(String p_zip_path,String p_titl void EditorAssetLibrary::_bind_methods() { - ObjectTypeDB::bind_method("_http_request_completed",&EditorAssetLibrary::_http_request_completed); - ObjectTypeDB::bind_method("_select_asset",&EditorAssetLibrary::_select_asset); - ObjectTypeDB::bind_method("_select_author",&EditorAssetLibrary::_select_author); - ObjectTypeDB::bind_method("_select_category",&EditorAssetLibrary::_select_category); - ObjectTypeDB::bind_method("_image_request_completed",&EditorAssetLibrary::_image_request_completed); - ObjectTypeDB::bind_method("_search",&EditorAssetLibrary::_search,DEFVAL(0)); - ObjectTypeDB::bind_method("_install_asset",&EditorAssetLibrary::_install_asset); - ObjectTypeDB::bind_method("_manage_plugins",&EditorAssetLibrary::_manage_plugins); - ObjectTypeDB::bind_method("_asset_open",&EditorAssetLibrary::_asset_open); - ObjectTypeDB::bind_method("_asset_file_selected",&EditorAssetLibrary::_asset_file_selected); - ObjectTypeDB::bind_method("_repository_changed",&EditorAssetLibrary::_repository_changed); - ObjectTypeDB::bind_method("_support_toggled",&EditorAssetLibrary::_support_toggled); - ObjectTypeDB::bind_method("_rerun_search",&EditorAssetLibrary::_rerun_search); - ObjectTypeDB::bind_method("_install_external_asset",&EditorAssetLibrary::_install_external_asset); + ClassDB::bind_method("_http_request_completed",&EditorAssetLibrary::_http_request_completed); + ClassDB::bind_method("_select_asset",&EditorAssetLibrary::_select_asset); + ClassDB::bind_method("_select_author",&EditorAssetLibrary::_select_author); + ClassDB::bind_method("_select_category",&EditorAssetLibrary::_select_category); + ClassDB::bind_method("_image_request_completed",&EditorAssetLibrary::_image_request_completed); + ClassDB::bind_method("_search",&EditorAssetLibrary::_search,DEFVAL(0)); + ClassDB::bind_method("_install_asset",&EditorAssetLibrary::_install_asset); + ClassDB::bind_method("_manage_plugins",&EditorAssetLibrary::_manage_plugins); + ClassDB::bind_method("_asset_open",&EditorAssetLibrary::_asset_open); + ClassDB::bind_method("_asset_file_selected",&EditorAssetLibrary::_asset_file_selected); + ClassDB::bind_method("_repository_changed",&EditorAssetLibrary::_repository_changed); + ClassDB::bind_method("_support_toggled",&EditorAssetLibrary::_support_toggled); + ClassDB::bind_method("_rerun_search",&EditorAssetLibrary::_rerun_search); + ClassDB::bind_method("_install_external_asset",&EditorAssetLibrary::_install_external_asset); @@ -1418,7 +1426,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { support->get_popup()->add_check_item(TTR("Testing"),SUPPORT_TESTING); support->get_popup()->set_item_checked(SUPPORT_OFFICIAL,true); support->get_popup()->set_item_checked(SUPPORT_COMMUNITY,true); - support->get_popup()->connect("item_pressed",this,"_support_toggled"); + support->get_popup()->connect("id_pressed",this,"_support_toggled"); ///////// @@ -1446,7 +1454,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { library_scroll->add_child(library_vb_border); library_vb_border->add_style_override("panel",border2); library_vb_border->set_h_size_flags(SIZE_EXPAND_FILL); - library_vb_border->set_stop_mouse(false); + library_vb_border->set_mouse_filter(MOUSE_FILTER_PASS); diff --git a/tools/editor/asset_library_editor_plugin.h b/tools/editor/asset_library_editor_plugin.h index fe40255af9..4ae229cefe 100644 --- a/tools/editor/asset_library_editor_plugin.h +++ b/tools/editor/asset_library_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -52,7 +52,7 @@ class EditorAssetLibraryItem : public PanelContainer { - OBJ_TYPE( EditorAssetLibraryItem, PanelContainer ); + GDCLASS( EditorAssetLibraryItem, PanelContainer ); TextureButton *icon; LinkButton* title; @@ -88,7 +88,7 @@ public: class EditorAssetLibraryItemDescription : public ConfirmationDialog { - OBJ_TYPE(EditorAssetLibraryItemDescription, ConfirmationDialog); + GDCLASS(EditorAssetLibraryItemDescription, ConfirmationDialog); EditorAssetLibraryItem *item; RichTextLabel *description; @@ -135,7 +135,7 @@ public: class EditorAssetLibraryItemDownload : public PanelContainer { - OBJ_TYPE(EditorAssetLibraryItemDownload, PanelContainer); + GDCLASS(EditorAssetLibraryItemDownload, PanelContainer); TextureFrame *icon; @@ -162,7 +162,7 @@ class EditorAssetLibraryItemDownload : public PanelContainer { void _close(); void _install(); void _make_request(); - void _http_download_completed(int p_status, int p_code, const StringArray& headers, const ByteArray& p_data); + void _http_download_completed(int p_status, int p_code, const PoolStringArray& headers, const PoolByteArray& p_data); protected: @@ -178,7 +178,7 @@ public: }; class EditorAssetLibrary : public PanelContainer { - OBJ_TYPE(EditorAssetLibrary,PanelContainer); + GDCLASS(EditorAssetLibrary,PanelContainer); String host; @@ -259,8 +259,8 @@ class EditorAssetLibrary : public PanelContainer { int last_queue_id; Map<int,ImageQueue> image_queue; - void _image_update(bool use_cache, bool final, const ByteArray& p_data, int p_queue_id); - void _image_request_completed(int p_status, int p_code, const StringArray& headers, const ByteArray& p_data, int p_queue_id); + void _image_update(bool use_cache, bool final, const PoolByteArray& p_data, int p_queue_id); + void _image_request_completed(int p_status, int p_code, const PoolStringArray& headers, const PoolByteArray& p_data, int p_queue_id); void _request_image(ObjectID p_for,String p_image_url,ImageType p_type,int p_image_index); void _update_image_queue(); @@ -298,8 +298,8 @@ class EditorAssetLibrary : public PanelContainer { void _search(int p_page=0); void _rerun_search(int p_ignore); void _api_request(const String& p_request, RequestType p_request_type, const String &p_arguments=""); - void _http_request_completed(int p_status, int p_code, const StringArray& headers, const ByteArray& p_data); - void _http_download_completed(int p_status, int p_code, const StringArray& headers, const ByteArray& p_data); + void _http_request_completed(int p_status, int p_code, const PoolStringArray& headers, const PoolByteArray& p_data); + void _http_download_completed(int p_status, int p_code, const PoolStringArray& headers, const PoolByteArray& p_data); void _repository_changed(int p_repository_id); void _support_toggled(int p_support); @@ -318,7 +318,7 @@ public: class AssetLibraryEditorPlugin : public EditorPlugin { - OBJ_TYPE( AssetLibraryEditorPlugin, EditorPlugin ); + GDCLASS( AssetLibraryEditorPlugin, EditorPlugin ); EditorAssetLibrary *addon_library; EditorNode *editor; diff --git a/tools/editor/call_dialog.cpp b/tools/editor/call_dialog.cpp index 0c6c64a33b..054a5098f0 100644 --- a/tools/editor/call_dialog.cpp +++ b/tools/editor/call_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -28,6 +28,7 @@ /*************************************************************************/ #include "call_dialog.h" +#if 0 #include "scene/gui/label.h" #include "object_type_db.h" #include "print_string.h" @@ -35,7 +36,7 @@ class CallDialogParams : public Object { - OBJ_TYPE( CallDialogParams, Object ); + GDCLASS( CallDialogParams, Object ); public: bool _set(const StringName& p_name, const Variant& p_value) { @@ -170,11 +171,11 @@ void CallDialog::_update_method_list() { List<String> inheritance_list; - String type = object->get_type(); + String type = object->get_class(); while(type!="") { inheritance_list.push_back( type ); - type=ObjectTypeDB::type_inherits_from(type); + type=ClassDB::get_parent_class(type); } TreeItem *selected_item=NULL; @@ -182,7 +183,7 @@ void CallDialog::_update_method_list() { for(int i=0;i<inheritance_list.size();i++) { String type=inheritance_list[i]; - String parent_type=ObjectTypeDB::type_inherits_from(type); + String parent_type=ClassDB::get_parent_class(type); TreeItem *type_item=NULL; @@ -192,7 +193,7 @@ void CallDialog::_update_method_list() { N=E->next(); - if (parent_type!="" && ObjectTypeDB::get_method(parent_type,E->get().name)!=NULL) { + if (parent_type!="" && ClassDB::get_method(parent_type,E->get().name)!=NULL) { E=N; continue; } @@ -224,9 +225,9 @@ void CallDialog::_update_method_list() { void CallDialog::_bind_methods() { - ObjectTypeDB::bind_method("_call",&CallDialog::_call); - ObjectTypeDB::bind_method("_cancel",&CallDialog::_cancel); - ObjectTypeDB::bind_method("_item_selected", &CallDialog::_item_selected); + ClassDB::bind_method("_call",&CallDialog::_call); + ClassDB::bind_method("_cancel",&CallDialog::_cancel); + ClassDB::bind_method("_item_selected", &CallDialog::_item_selected); } @@ -239,7 +240,7 @@ void CallDialog::set_object(Object *p_object,StringName p_selected) { return_value->clear(); _update_method_list(); - method_label->set_text(vformat(TTR("Method List For '%s':"),p_object->get_type())); + method_label->set_text(vformat(TTR("Method List For '%s':"),p_object->get_class())); } CallDialog::CallDialog() { @@ -268,7 +269,6 @@ CallDialog::CallDialog() { tree = memnew( Tree ); - tree->set_anchor( MARGIN_RIGHT, ANCHOR_RATIO ); tree->set_anchor( MARGIN_BOTTOM, ANCHOR_END ); tree->set_begin( Point2( 20,50 ) ); tree->set_margin(MARGIN_BOTTOM, 44 ); @@ -283,7 +283,7 @@ CallDialog::CallDialog() { property_editor->set_anchor_and_margin( MARGIN_RIGHT, ANCHOR_END, 15 ); property_editor->set_anchor_and_margin( MARGIN_TOP, ANCHOR_BEGIN, 50 ); - property_editor->set_anchor_and_margin( MARGIN_LEFT, ANCHOR_RATIO, 0.55 ); +// property_editor->set_anchor_and_margin( MARGIN_LEFT, ANCHOR_RATIO, 0.55 ); property_editor->set_anchor_and_margin( MARGIN_BOTTOM, ANCHOR_END, 90 ); property_editor->get_scene_tree()->set_hide_root( true ); property_editor->hide_top_label(); @@ -296,21 +296,21 @@ CallDialog::CallDialog() { add_child(method_label); Label *label = memnew( Label ); - label->set_anchor_and_margin( MARGIN_LEFT, ANCHOR_RATIO, 0.53 ); + //label->set_anchor_and_margin( MARGIN_LEFT, ANCHOR_RATIO, 0.53 ); label->set_anchor_and_margin( MARGIN_TOP, ANCHOR_BEGIN, 25 ); label->set_text(TTR("Arguments:")); add_child(label); return_label = memnew( Label ); - return_label->set_anchor_and_margin( MARGIN_LEFT, ANCHOR_RATIO, 0.53 ); + //return_label->set_anchor_and_margin( MARGIN_LEFT, ANCHOR_RATIO, 0.53 ); return_label->set_anchor_and_margin( MARGIN_TOP, ANCHOR_END, 85 ); return_label->set_text(TTR("Return:")); add_child(return_label); return_value = memnew( LineEdit ); - return_value->set_anchor_and_margin( MARGIN_LEFT, ANCHOR_RATIO, 0.55 ); + //return_value->set_anchor_and_margin( MARGIN_LEFT, ANCHOR_RATIO, 0.55 ); return_value->set_anchor_and_margin( MARGIN_RIGHT, ANCHOR_END, 15 ); return_value->set_anchor_and_margin( MARGIN_TOP, ANCHOR_END, 65 ); @@ -338,3 +338,4 @@ CallDialog::~CallDialog() { memdelete(call_params); } +#endif diff --git a/tools/editor/call_dialog.h b/tools/editor/call_dialog.h index a2ca925ff1..b0ebe68d86 100644 --- a/tools/editor/call_dialog.h +++ b/tools/editor/call_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,12 +39,13 @@ @author Juan Linietsky <reduzio@gmail.com> */ +#if 0 class CallDialogParams; class CallDialog : public Popup { - OBJ_TYPE( CallDialog, Popup ); + GDCLASS( CallDialog, Popup ); Label* method_label; @@ -81,3 +82,4 @@ public: }; #endif +#endif diff --git a/tools/editor/code_editor.cpp b/tools/editor/code_editor.cpp index 626f86d33d..0d7dc558ac 100644 --- a/tools/editor/code_editor.cpp +++ b/tools/editor/code_editor.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -459,19 +459,19 @@ void FindReplaceBar::set_text_edit(TextEdit *p_text_edit) { void FindReplaceBar::_bind_methods() { - ObjectTypeDB::bind_method("_unhandled_input",&FindReplaceBar::_unhandled_input); + ClassDB::bind_method("_unhandled_input",&FindReplaceBar::_unhandled_input); - ObjectTypeDB::bind_method("_editor_text_changed",&FindReplaceBar::_editor_text_changed); - ObjectTypeDB::bind_method("_search_text_changed",&FindReplaceBar::_search_text_changed); - ObjectTypeDB::bind_method("_search_text_entered",&FindReplaceBar::_search_text_entered); - ObjectTypeDB::bind_method("_replace_text_entered",&FindReplaceBar::_replace_text_entered); - ObjectTypeDB::bind_method("_search_current",&FindReplaceBar::search_current); - ObjectTypeDB::bind_method("_search_next",&FindReplaceBar::search_next); - ObjectTypeDB::bind_method("_search_prev",&FindReplaceBar::search_prev); - ObjectTypeDB::bind_method("_replace_pressed",&FindReplaceBar::_replace); - ObjectTypeDB::bind_method("_replace_all_pressed",&FindReplaceBar::_replace_all); - ObjectTypeDB::bind_method("_search_options_changed",&FindReplaceBar::_search_options_changed); - ObjectTypeDB::bind_method("_hide_pressed",&FindReplaceBar::_hide_bar); + ClassDB::bind_method("_editor_text_changed",&FindReplaceBar::_editor_text_changed); + ClassDB::bind_method("_search_text_changed",&FindReplaceBar::_search_text_changed); + ClassDB::bind_method("_search_text_entered",&FindReplaceBar::_search_text_entered); + ClassDB::bind_method("_replace_text_entered",&FindReplaceBar::_replace_text_entered); + ClassDB::bind_method("_search_current",&FindReplaceBar::search_current); + ClassDB::bind_method("_search_next",&FindReplaceBar::search_next); + ClassDB::bind_method("_search_prev",&FindReplaceBar::search_prev); + ClassDB::bind_method("_replace_pressed",&FindReplaceBar::_replace); + ClassDB::bind_method("_replace_all_pressed",&FindReplaceBar::_replace_all); + ClassDB::bind_method("_search_options_changed",&FindReplaceBar::_search_options_changed); + ClassDB::bind_method("_hide_pressed",&FindReplaceBar::_hide_bar); ADD_SIGNAL(MethodInfo("search")); } @@ -884,10 +884,10 @@ void FindReplaceDialog::search_next() { void FindReplaceDialog::_bind_methods() { - ObjectTypeDB::bind_method("_search_text_entered",&FindReplaceDialog::_search_text_entered); - ObjectTypeDB::bind_method("_replace_text_entered",&FindReplaceDialog::_replace_text_entered); - ObjectTypeDB::bind_method("_prompt_changed",&FindReplaceDialog::_prompt_changed); - ObjectTypeDB::bind_method("_skip_pressed",&FindReplaceDialog::_skip_pressed); + ClassDB::bind_method("_search_text_entered",&FindReplaceDialog::_search_text_entered); + ClassDB::bind_method("_replace_text_entered",&FindReplaceDialog::_replace_text_entered); + ClassDB::bind_method("_prompt_changed",&FindReplaceDialog::_prompt_changed); + ClassDB::bind_method("_skip_pressed",&FindReplaceDialog::_skip_pressed); ADD_SIGNAL(MethodInfo("search")); ADD_SIGNAL(MethodInfo("skip")); @@ -895,11 +895,11 @@ void FindReplaceDialog::_bind_methods() { FindReplaceDialog::FindReplaceDialog() { - set_self_opacity(0.8); + set_self_modulate(Color(1,1,1,0.8)); VBoxContainer *vb = memnew( VBoxContainer ); add_child(vb); - set_child_rect(vb); + search_text = memnew( LineEdit ); @@ -995,7 +995,7 @@ FindReplaceDialog::FindReplaceDialog() { /*** CODE EDITOR ****/ -void CodeTextEditor::_text_editor_input_event(const InputEvent& p_event) { +void CodeTextEditor::_text_editor_gui_input(const InputEvent& p_event) { if (p_event.type==InputEvent::MOUSE_BUTTON) { @@ -1043,7 +1043,7 @@ void CodeTextEditor::_reset_zoom() { Ref<DynamicFont> font = text_editor->get_font("font"); // reset source font size to default if (font.is_valid()) { - EditorSettings::get_singleton()->set("global/source_font_size",14); + EditorSettings::get_singleton()->set("interface/source_font_size",14); font->set_size(14); } } @@ -1097,7 +1097,7 @@ void CodeTextEditor::_font_resize_timeout() { int size=font->get_size()+font_resize_val; if (size>=8 && size<=96) { - EditorSettings::get_singleton()->set("global/source_font_size",size); + EditorSettings::get_singleton()->set("interface/source_font_size",size); font->set_size(size); } @@ -1107,20 +1107,20 @@ void CodeTextEditor::_font_resize_timeout() { void CodeTextEditor::update_editor_settings() { - text_editor->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/auto_brace_complete")); - text_editor->set_scroll_pass_end_of_file(EditorSettings::get_singleton()->get("text_editor/scroll_past_end_of_file")); - text_editor->set_tab_size(EditorSettings::get_singleton()->get("text_editor/tab_size")); - text_editor->set_draw_tabs(EditorSettings::get_singleton()->get("text_editor/draw_tabs")); - text_editor->set_show_line_numbers(EditorSettings::get_singleton()->get("text_editor/show_line_numbers")); - text_editor->set_line_numbers_zero_padded(EditorSettings::get_singleton()->get("text_editor/line_numbers_zero_padded")); - text_editor->set_show_line_length_guideline(EditorSettings::get_singleton()->get("text_editor/show_line_length_guideline")); - text_editor->set_line_length_guideline_column(EditorSettings::get_singleton()->get("text_editor/line_length_guideline_column")); - text_editor->set_syntax_coloring(EditorSettings::get_singleton()->get("text_editor/syntax_highlighting")); - text_editor->set_highlight_all_occurrences(EditorSettings::get_singleton()->get("text_editor/highlight_all_occurrences")); - text_editor->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/caret_blink")); - text_editor->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/caret_blink_speed")); - text_editor->set_draw_breakpoint_gutter(EditorSettings::get_singleton()->get("text_editor/show_breakpoint_gutter")); - text_editor->cursor_set_block_mode(EditorSettings::get_singleton()->get("text_editor/block_caret")); + text_editor->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/completion/auto_brace_complete")); + text_editor->set_scroll_pass_end_of_file(EditorSettings::get_singleton()->get("text_editor/cursor/scroll_past_end_of_file")); + text_editor->set_tab_size(EditorSettings::get_singleton()->get("text_editor/indent/tab_size")); + text_editor->set_draw_tabs(EditorSettings::get_singleton()->get("text_editor/indent/draw_tabs")); + text_editor->set_show_line_numbers(EditorSettings::get_singleton()->get("text_editor/line_numbers/show_line_numbers")); + text_editor->set_line_numbers_zero_padded(EditorSettings::get_singleton()->get("text_editor/line_numbers/line_numbers_zero_padded")); + text_editor->set_show_line_length_guideline(EditorSettings::get_singleton()->get("text_editor/line_numbers/show_line_length_guideline")); + text_editor->set_line_length_guideline_column(EditorSettings::get_singleton()->get("text_editor/line_numbers/line_length_guideline_column")); + text_editor->set_syntax_coloring(EditorSettings::get_singleton()->get("text_editor/highlighting/syntax_highlighting")); + text_editor->set_highlight_all_occurrences(EditorSettings::get_singleton()->get("text_editor/highlighting/highlight_all_occurrences")); + text_editor->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/cursor/caret_blink")); + text_editor->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/cursor/caret_blink_speed")); + text_editor->set_draw_breakpoint_gutter(EditorSettings::get_singleton()->get("text_editor/line_numbers/show_breakpoint_gutter")); + text_editor->cursor_set_block_mode(EditorSettings::get_singleton()->get("text_editor/cursor/block_caret")); } void CodeTextEditor::set_error(const String& p_error) { @@ -1137,7 +1137,7 @@ void CodeTextEditor::set_error(const String& p_error) { void CodeTextEditor::_update_font() { // FONTS - String editor_font = EDITOR_DEF("text_editor/font", ""); + String editor_font = EDITOR_DEF("text_editor/theme/font", ""); bool font_overridden = false; if (editor_font!="") { Ref<Font> fnt = ResourceLoader::load(editor_font); @@ -1158,19 +1158,19 @@ void CodeTextEditor::_on_settings_change() { // AUTO BRACE COMPLETION text_editor->set_auto_brace_completion( - EDITOR_DEF("text_editor/auto_brace_complete", true) + EDITOR_DEF("text_editor/completion/auto_brace_complete", true) ); code_complete_timer->set_wait_time( - EDITOR_DEF("text_editor/code_complete_delay",.3f) + EDITOR_DEF("text_editor/completion/code_complete_delay",.3f) ); - enable_complete_timer = EDITOR_DEF("text_editor/enable_code_completion_delay",true); + enable_complete_timer = EDITOR_DEF("text_editor/completion/enable_code_completion_delay",true); // call hint settings text_editor->set_callhint_settings( - EDITOR_DEF("text_editor/put_callhint_tooltip_below_current_line", true), - EDITOR_DEF("text_editor/callhint_tooltip_offset", Vector2()) + EDITOR_DEF("text_editor/completion/put_callhint_tooltip_below_current_line", true), + EDITOR_DEF("text_editor/completion/callhint_tooltip_offset", Vector2()) ); } @@ -1195,14 +1195,14 @@ void CodeTextEditor::_notification(int p_what) { void CodeTextEditor::_bind_methods() { - ObjectTypeDB::bind_method("_text_editor_input_event",&CodeTextEditor::_text_editor_input_event); - ObjectTypeDB::bind_method("_line_col_changed",&CodeTextEditor::_line_col_changed); - ObjectTypeDB::bind_method("_text_changed",&CodeTextEditor::_text_changed); - ObjectTypeDB::bind_method("_on_settings_change",&CodeTextEditor::_on_settings_change); - ObjectTypeDB::bind_method("_text_changed_idle_timeout",&CodeTextEditor::_text_changed_idle_timeout); - ObjectTypeDB::bind_method("_code_complete_timer_timeout",&CodeTextEditor::_code_complete_timer_timeout); - ObjectTypeDB::bind_method("_complete_request",&CodeTextEditor::_complete_request); - ObjectTypeDB::bind_method("_font_resize_timeout",&CodeTextEditor::_font_resize_timeout); + ClassDB::bind_method("_text_editor_gui_input",&CodeTextEditor::_text_editor_gui_input); + ClassDB::bind_method("_line_col_changed",&CodeTextEditor::_line_col_changed); + ClassDB::bind_method("_text_changed",&CodeTextEditor::_text_changed); + ClassDB::bind_method("_on_settings_change",&CodeTextEditor::_on_settings_change); + ClassDB::bind_method("_text_changed_idle_timeout",&CodeTextEditor::_text_changed_idle_timeout); + ClassDB::bind_method("_code_complete_timer_timeout",&CodeTextEditor::_code_complete_timer_timeout); + ClassDB::bind_method("_complete_request",&CodeTextEditor::_complete_request); + ClassDB::bind_method("_font_resize_timeout",&CodeTextEditor::_font_resize_timeout); ADD_SIGNAL(MethodInfo("validate_script")); ADD_SIGNAL(MethodInfo("load_theme_settings")); @@ -1252,14 +1252,14 @@ CodeTextEditor::CodeTextEditor() { idle = memnew( Timer ); add_child(idle); idle->set_one_shot(true); - idle->set_wait_time(EDITOR_DEF("text_editor/idle_parse_delay",2)); + idle->set_wait_time(EDITOR_DEF("text_editor/completion/idle_parse_delay",2)); code_complete_timer = memnew(Timer); add_child(code_complete_timer); code_complete_timer->set_one_shot(true); - enable_complete_timer = EDITOR_DEF("text_editor/enable_code_completion_delay",true); + enable_complete_timer = EDITOR_DEF("text_editor/completion/enable_code_completion_delay",true); - code_complete_timer->set_wait_time(EDITOR_DEF("text_editor/code_complete_delay",.3f)); + code_complete_timer->set_wait_time(EDITOR_DEF("text_editor/completion/code_complete_delay",.3f)); error = memnew( Label ); status_bar->add_child(error); @@ -1297,7 +1297,7 @@ CodeTextEditor::CodeTextEditor() { col_nb->set_autowrap(true); // workaround to prevent resizing the label on each change col_nb->set_custom_minimum_size(Size2(40,1)*EDSCALE); - text_editor->connect("input_event", this,"_text_editor_input_event"); + text_editor->connect("gui_input", this,"_text_editor_gui_input"); text_editor->connect("cursor_changed", this,"_line_col_changed"); text_editor->connect("text_changed", this,"_text_changed"); text_editor->connect("request_completion", this,"_complete_request"); @@ -1305,6 +1305,7 @@ CodeTextEditor::CodeTextEditor() { cs.push_back("."); cs.push_back(","); cs.push_back("("); + cs.push_back("$"); text_editor->set_completion(true,cs); idle->connect("timeout", this,"_text_changed_idle_timeout"); diff --git a/tools/editor/code_editor.h b/tools/editor/code_editor.h index ce3b5bee26..a000f02010 100644 --- a/tools/editor/code_editor.h +++ b/tools/editor/code_editor.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -42,7 +42,7 @@ class GotoLineDialog : public ConfirmationDialog { - OBJ_TYPE(GotoLineDialog,ConfirmationDialog); + GDCLASS(GotoLineDialog,ConfirmationDialog); Label *line_label; LineEdit *line; @@ -62,7 +62,7 @@ public: class FindReplaceBar : public HBoxContainer { - OBJ_TYPE(FindReplaceBar,HBoxContainer); + GDCLASS(FindReplaceBar,HBoxContainer); LineEdit *search_text; ToolButton *find_prev; @@ -134,7 +134,7 @@ public: class FindReplaceDialog : public ConfirmationDialog { - OBJ_TYPE(FindReplaceDialog,ConfirmationDialog); + GDCLASS(FindReplaceDialog,ConfirmationDialog); LineEdit *search_text; LineEdit *replace_text; @@ -194,7 +194,7 @@ typedef void (*CodeTextEditorCodeCompleteFunc)(void* p_ud,const String& p_code, class CodeTextEditor : public VBoxContainer { - OBJ_TYPE(CodeTextEditor,VBoxContainer); + GDCLASS(CodeTextEditor,VBoxContainer); TextEdit *text_editor; FindReplaceBar *find_replace_bar; @@ -217,7 +217,7 @@ class CodeTextEditor : public VBoxContainer { void _complete_request(); void _font_resize_timeout(); - void _text_editor_input_event(const InputEvent& p_event); + void _text_editor_gui_input(const InputEvent& p_event); void _zoom_in(); void _zoom_out(); void _reset_zoom(); diff --git a/tools/editor/connections_dialog.cpp b/tools/editor/connections_dialog.cpp index 1baad2c6b3..6e53c32080 100644 --- a/tools/editor/connections_dialog.cpp +++ b/tools/editor/connections_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,7 +39,7 @@ class ConnectDialogBinds : public Object { - OBJ_TYPE( ConnectDialogBinds, Object ); + GDCLASS( ConnectDialogBinds, Object ); public: Vector<Variant> params; @@ -127,7 +127,7 @@ void ConnectDialog::_tree_node_selected() { if (E->get().name.length() && E->get().name[0]=='_') continue; // hidden method, not show! - if (ObjectTypeDB::has_method(node->get_type(),"Node") || ObjectTypeDB::has_method(node->get_type(),"Control",true)) + if (ClassDB::has_method(node->get_type(),"Node") || ClassDB::has_method(node->get_type(),"Control",true)) continue; //avoid too much unnecesary stuff String method=E->get().name+"("; @@ -249,8 +249,8 @@ void ConnectDialog::_add_bind() { case Variant::VECTOR3: value = Vector3(); break; case Variant::PLANE: value = Plane(); break; case Variant::QUAT: value = Quat(); break; - case Variant::_AABB: value = AABB(); break; - case Variant::MATRIX3: value = Matrix3(); break; + case Variant::RECT3: value = Rect3(); break; + case Variant::BASIS: value = Basis(); break; case Variant::TRANSFORM: value = Transform(); break; case Variant::COLOR: value = Color(); break; case Variant::IMAGE: value = Image(); break; @@ -290,13 +290,13 @@ void ConnectDialog::set_dst_method(const StringName& p_method) { void ConnectDialog::_bind_methods() { - //ObjectTypeDB::bind_method("_ok",&ConnectDialog::_ok_pressed); - ObjectTypeDB::bind_method("_cancel",&ConnectDialog::_cancel_pressed); - //ObjectTypeDB::bind_method("_dst_method_list_selected",&ConnectDialog::_dst_method_list_selected); - ObjectTypeDB::bind_method("_tree_node_selected",&ConnectDialog::_tree_node_selected); + //ClassDB::bind_method("_ok",&ConnectDialog::_ok_pressed); + ClassDB::bind_method("_cancel",&ConnectDialog::_cancel_pressed); + //ClassDB::bind_method("_dst_method_list_selected",&ConnectDialog::_dst_method_list_selected); + ClassDB::bind_method("_tree_node_selected",&ConnectDialog::_tree_node_selected); - ObjectTypeDB::bind_method("_add_bind",&ConnectDialog::_add_bind); - ObjectTypeDB::bind_method("_remove_bind",&ConnectDialog::_remove_bind); + ClassDB::bind_method("_add_bind",&ConnectDialog::_add_bind); + ClassDB::bind_method("_remove_bind",&ConnectDialog::_remove_bind); ADD_SIGNAL( MethodInfo("connected") ); } @@ -305,7 +305,7 @@ ConnectDialog::ConnectDialog() { VBoxContainer *vbc = memnew( VBoxContainer ); add_child(vbc); - set_child_rect(vbc); + HBoxContainer *main_hb = memnew( HBoxContainer ); vbc->add_child(main_hb); @@ -343,8 +343,8 @@ ConnectDialog::ConnectDialog() { type_list->add_item("Vector3",Variant::VECTOR3); type_list->add_item("Plane",Variant::PLANE); type_list->add_item("Quat",Variant::QUAT); - type_list->add_item("AABB",Variant::_AABB); - type_list->add_item("Matrix3",Variant::MATRIX3); + type_list->add_item("Rect3",Variant::RECT3); + type_list->add_item("Basis",Variant::BASIS); type_list->add_item("Transform",Variant::TRANSFORM); //type_list->add_separator(); type_list->add_item("Color",Variant::COLOR); @@ -395,7 +395,7 @@ ConnectDialog::ConnectDialog() { make_callback = memnew( CheckButton ); make_callback->set_toggle_mode(true); - make_callback->set_pressed( EDITOR_DEF("text_editor/create_signal_callbacks",true)); + make_callback->set_pressed( EDITOR_DEF("text_editor/tools/create_signal_callbacks",true)); make_callback->set_text(TTR("Make Function")); dstm_hb->add_child(make_callback); @@ -421,7 +421,7 @@ ConnectDialog::ConnectDialog() { -// dst_method_list->get_popup()->connect("item_pressed", this,"_dst_method_list_selected"); +// dst_method_list->get_popup()->connect("id_pressed", this,"_dst_method_list_selected"); tree->connect("node_selected", this,"_tree_node_selected"); set_as_toplevel(true); @@ -475,7 +475,7 @@ void ConnectionsDock::_connect() { bool defer=connect_dialog->get_deferred(); bool oshot=connect_dialog->get_oneshot(); Vector<Variant> binds = connect_dialog->get_binds(); - StringArray args = it->get_metadata(0).operator Dictionary()["args"]; + PoolStringArray args = it->get_metadata(0).operator Dictionary()["args"]; int flags = CONNECT_PERSIST | (defer?CONNECT_DEFERRED:0) | (oshot?CONNECT_ONESHOT:0); undo_redo->create_action(vformat(TTR("Connect '%s' to '%s'"),signal,String(dst_method))); @@ -616,7 +616,7 @@ void ConnectionsDock::update_tree() { //node_signals.sort_custom<_ConnectionsDockMethodInfoSort>(); bool did_script=false; - StringName base = node->get_type(); + StringName base = node->get_class(); while(base) { @@ -632,16 +632,16 @@ void ConnectionsDock::update_tree() { if (scr->get_path().is_resource_file()) name=scr->get_path().get_file(); else - name=scr->get_type(); + name=scr->get_class(); - if (has_icon(scr->get_type(),"EditorIcons")) { - icon=get_icon(scr->get_type(),"EditorIcons"); + if (has_icon(scr->get_class(),"EditorIcons")) { + icon=get_icon(scr->get_class(),"EditorIcons"); } } } else { - ObjectTypeDB::get_signal_list(base,&node_signals,true); + ClassDB::get_signal_list(base,&node_signals,true); if (has_icon(base,"EditorIcons")) { icon=get_icon(base,"EditorIcons"); } @@ -668,7 +668,7 @@ void ConnectionsDock::update_tree() { String signaldesc; signaldesc=mi.name+"("; - StringArray argnames; + PoolStringArray argnames; if (mi.arguments.size()) { signaldesc+=" "; for(int i=0;i<mi.arguments.size();i++) { @@ -740,7 +740,7 @@ void ConnectionsDock::update_tree() { if (!did_script) { did_script=true; } else { - base=ObjectTypeDB::type_inherits_from(base); + base=ClassDB::get_parent_class(base); } } @@ -825,12 +825,12 @@ void ConnectionsDock::_something_activated() { void ConnectionsDock::_bind_methods() { - ObjectTypeDB::bind_method("_connect",&ConnectionsDock::_connect); - ObjectTypeDB::bind_method("_something_selected",&ConnectionsDock::_something_selected); - ObjectTypeDB::bind_method("_something_activated",&ConnectionsDock::_something_activated); - ObjectTypeDB::bind_method("_close",&ConnectionsDock::_close); - ObjectTypeDB::bind_method("_connect_pressed",&ConnectionsDock::_connect_pressed); - ObjectTypeDB::bind_method("update_tree",&ConnectionsDock::update_tree); + ClassDB::bind_method("_connect",&ConnectionsDock::_connect); + ClassDB::bind_method("_something_selected",&ConnectionsDock::_something_selected); + ClassDB::bind_method("_something_activated",&ConnectionsDock::_something_activated); + ClassDB::bind_method("_close",&ConnectionsDock::_close); + ClassDB::bind_method("_connect_pressed",&ConnectionsDock::_connect_pressed); + ClassDB::bind_method("update_tree",&ConnectionsDock::update_tree); } diff --git a/tools/editor/connections_dialog.h b/tools/editor/connections_dialog.h index 73f52abc9e..bfc75266e9 100644 --- a/tools/editor/connections_dialog.h +++ b/tools/editor/connections_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -48,7 +48,7 @@ class ConnectDialogBinds; class ConnectDialog : public ConfirmationDialog { - OBJ_TYPE( ConnectDialog, ConfirmationDialog ); + GDCLASS( ConnectDialog, ConfirmationDialog ); ConfirmationDialog *error; @@ -97,7 +97,7 @@ public: class ConnectionsDock : public VBoxContainer { - OBJ_TYPE( ConnectionsDock , VBoxContainer ); + GDCLASS( ConnectionsDock , VBoxContainer ); Button *connect_button; EditorNode *editor; diff --git a/tools/editor/create_dialog.cpp b/tools/editor/create_dialog.cpp index 320939cb97..3e057ecf90 100644 --- a/tools/editor/create_dialog.cpp +++ b/tools/editor/create_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -141,7 +141,7 @@ void CreateDialog::_sbox_input(const InputEvent& p_ie) { p_ie.key.scancode == KEY_PAGEUP || p_ie.key.scancode == KEY_PAGEDOWN ) ) { - search_options->call("_input_event",p_ie); + search_options->call("_gui_input",p_ie); search_box->accept_event(); } @@ -151,10 +151,10 @@ void CreateDialog::add_type(const String& p_type,HashMap<String,TreeItem*>& p_ty if (p_types.has(p_type)) return; - if (!ObjectTypeDB::is_type(p_type,base_type) || p_type==base_type) + if (!ClassDB::is_parent_class(p_type,base_type) || p_type==base_type) return; - String inherits=ObjectTypeDB::type_inherits_from(p_type); + String inherits=ClassDB::get_parent_class(p_type); TreeItem *parent=p_root; @@ -172,7 +172,7 @@ void CreateDialog::add_type(const String& p_type,HashMap<String,TreeItem*>& p_ty TreeItem *item = search_options->create_item(parent); item->set_text(0,p_type); - if (!ObjectTypeDB::can_instance(p_type)) { + if (!ClassDB::can_instance(p_type)) { item->set_custom_color(0, Color(0.5,0.5,0.5) ); item->set_selectable(0,false); } else { @@ -183,7 +183,7 @@ void CreateDialog::add_type(const String& p_type,HashMap<String,TreeItem*>& p_ty } - if (bool(EditorSettings::get_singleton()->get("scenetree_editor/start_create_dialog_fully_expanded"))) { + if (bool(EditorSettings::get_singleton()->get("docks/scene_tree/start_create_dialog_fully_expanded"))) { item->set_collapsed(false); } else { // don't collapse search results @@ -191,7 +191,7 @@ void CreateDialog::add_type(const String& p_type,HashMap<String,TreeItem*>& p_ty // don't collapse the root node collapse &= (item != p_root); // don't collapse abstract nodes on the first tree level - collapse &= ((parent != p_root) || (ObjectTypeDB::can_instance(p_type))); + collapse &= ((parent != p_root) || (ClassDB::can_instance(p_type))); item->set_collapsed(collapse); } @@ -222,7 +222,7 @@ void CreateDialog::_update_search() { */ List<StringName> type_list; - ObjectTypeDB::get_type_list(&type_list); + ClassDB::get_class_list(&type_list); HashMap<String,TreeItem*> types; @@ -245,7 +245,7 @@ void CreateDialog::_update_search() { if (base_type=="Node" && type.begins_with("Editor")) continue; // do not show editor nodes - if (!ObjectTypeDB::can_instance(type)) + if (!ClassDB::can_instance(type)) continue; // cant create what can't be instanced if (search_box->get_text()=="") { @@ -254,14 +254,14 @@ void CreateDialog::_update_search() { bool found=false; String type=I->get(); - while(type!="" && ObjectTypeDB::is_type(type,base_type) && type!=base_type) { + while(type!="" && ClassDB::is_parent_class(type,base_type) && type!=base_type) { if (search_box->get_text().is_subsequence_ofi(type)) { found=true; break; } - type=ObjectTypeDB::type_inherits_from(type); + type=ClassDB::get_parent_class(type); } @@ -269,7 +269,7 @@ void CreateDialog::_update_search() { add_type(I->get(),types,root,&to_select); } - if (EditorNode::get_editor_data().get_custom_types().has(type) && ObjectTypeDB::is_type(type, base_type)) { + if (EditorNode::get_editor_data().get_custom_types().has(type) && ClassDB::is_parent_class(type, base_type)) { //there are custom types based on this... cool. //print_line("there are custom types"); @@ -400,8 +400,11 @@ Object *CreateDialog::instance_selected() { if (selected) { - String custom = selected->get_metadata(0); + Variant md = selected->get_metadata(0); + String custom; + if (md.get_type()!=Variant::NIL) + custom=md; if (custom!=String()) { if (EditorNode::get_editor_data().get_custom_types().has(custom)) { @@ -412,9 +415,9 @@ Object *CreateDialog::instance_selected() { Ref<Script> script = EditorNode::get_editor_data().get_custom_types()[custom][i].script; String name = selected->get_text(0); - Object *ob = ObjectTypeDB::instance(custom); + Object *ob = ClassDB::instance(custom); ERR_FAIL_COND_V(!ob,NULL); - if (ob->is_type("Node")) { + if (ob->is_class("Node")) { ob->call("set_name",name); } ob->set_script(script.get_ref_ptr()); @@ -427,7 +430,7 @@ Object *CreateDialog::instance_selected() { } } else { - return ObjectTypeDB::instance(selected->get_text(0)); + return ClassDB::instance(selected->get_text(0)); } } @@ -621,20 +624,20 @@ void CreateDialog::drop_data_fw(const Point2& p_point,const Variant& p_data,Cont void CreateDialog::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_text_changed"),&CreateDialog::_text_changed); - ObjectTypeDB::bind_method(_MD("_confirmed"),&CreateDialog::_confirmed); - ObjectTypeDB::bind_method(_MD("_sbox_input"),&CreateDialog::_sbox_input); - ObjectTypeDB::bind_method(_MD("_item_selected"),&CreateDialog::_item_selected); - ObjectTypeDB::bind_method(_MD("_favorite_toggled"),&CreateDialog::_favorite_toggled); - ObjectTypeDB::bind_method(_MD("_history_selected"),&CreateDialog::_history_selected); - ObjectTypeDB::bind_method(_MD("_favorite_selected"),&CreateDialog::_favorite_selected); - ObjectTypeDB::bind_method(_MD("_history_activated"),&CreateDialog::_history_activated); - ObjectTypeDB::bind_method(_MD("_favorite_activated"),&CreateDialog::_favorite_activated); + ClassDB::bind_method(_MD("_text_changed"),&CreateDialog::_text_changed); + ClassDB::bind_method(_MD("_confirmed"),&CreateDialog::_confirmed); + ClassDB::bind_method(_MD("_sbox_input"),&CreateDialog::_sbox_input); + ClassDB::bind_method(_MD("_item_selected"),&CreateDialog::_item_selected); + ClassDB::bind_method(_MD("_favorite_toggled"),&CreateDialog::_favorite_toggled); + ClassDB::bind_method(_MD("_history_selected"),&CreateDialog::_history_selected); + ClassDB::bind_method(_MD("_favorite_selected"),&CreateDialog::_favorite_selected); + ClassDB::bind_method(_MD("_history_activated"),&CreateDialog::_history_activated); + ClassDB::bind_method(_MD("_favorite_activated"),&CreateDialog::_favorite_activated); - ObjectTypeDB::bind_method("get_drag_data_fw",&CreateDialog::get_drag_data_fw); - ObjectTypeDB::bind_method("can_drop_data_fw",&CreateDialog::can_drop_data_fw); - ObjectTypeDB::bind_method("drop_data_fw",&CreateDialog::drop_data_fw); + ClassDB::bind_method("get_drag_data_fw",&CreateDialog::get_drag_data_fw); + ClassDB::bind_method("can_drop_data_fw",&CreateDialog::can_drop_data_fw); + ClassDB::bind_method("drop_data_fw",&CreateDialog::drop_data_fw); ADD_SIGNAL(MethodInfo("create")); @@ -646,7 +649,7 @@ CreateDialog::CreateDialog() { HSplitContainer *hbc = memnew( HSplitContainer ); add_child(hbc); - set_child_rect(hbc); + VBoxContainer *lvbc = memnew( VBoxContainer); hbc->add_child(lvbc); @@ -682,7 +685,7 @@ CreateDialog::CreateDialog() { favorite->connect("pressed",this,"_favorite_toggled"); vbc->add_margin_child(TTR("Search:"),search_hb); search_box->connect("text_changed",this,"_text_changed"); - search_box->connect("input_event",this,"_sbox_input"); + search_box->connect("gui_input",this,"_sbox_input"); search_options = memnew( Tree ); vbc->add_margin_child(TTR("Matches:"),search_options,true); get_ok()->set_text(TTR("Create")); @@ -740,10 +743,10 @@ void CreateDialog::add_type(const String& p_type,HashMap<String,TreeItem*>& p_ty if (p_types.has(p_type)) return; - if (!ObjectTypeDB::is_type(p_type,base) || p_type==base) + if (!ClassDB::is_type(p_type,base) || p_type==base) return; - String inherits=ObjectTypeDB::type_inherits_from(p_type); + String inherits=ClassDB::type_inherits_from(p_type); TreeItem *parent=p_root; @@ -761,7 +764,7 @@ void CreateDialog::add_type(const String& p_type,HashMap<String,TreeItem*>& p_ty TreeItem *item = tree->create_item(parent); item->set_text(0,p_type); - if (!ObjectTypeDB::can_instance(p_type)) { + if (!ClassDB::can_instance(p_type)) { item->set_custom_color(0, Color(0.5,0.5,0.5) ); item->set_selectable(0,false); } @@ -782,7 +785,7 @@ void CreateDialog::update_tree() { tree->clear(); List<String> type_list; - ObjectTypeDB::get_type_list(&type_list); + ClassDB::get_type_list(&type_list); HashMap<String,TreeItem*> types; @@ -798,7 +801,7 @@ void CreateDialog::update_tree() { String type=I->get(); - if (!ObjectTypeDB::can_instance(type)) + if (!ClassDB::can_instance(type)) continue; // cant create what can't be instanced if (filter->get_text()=="") add_type(type,types,root); @@ -806,14 +809,14 @@ void CreateDialog::update_tree() { bool found=false; String type=I->get(); - while(type!="" && ObjectTypeDB::is_type(type,base) && type!=base) { + while(type!="" && ClassDB::is_type(type,base) && type!=base) { if (type.findn(filter->get_text())!=-1) { found=true; break; } - type=ObjectTypeDB::type_inherits_from(type); + type=ClassDB::type_inherits_from(type); } @@ -875,7 +878,7 @@ Object *CreateDialog::instance_selected() { if (ct[i].name==name) { - Object* obj = ObjectTypeDB::instance(base); + Object* obj = ClassDB::instance(base); ERR_FAIL_COND_V(!obj,NULL); obj->set_script(ct[i].script.get_ref_ptr()); if (ct[i].icon.is_valid()) @@ -891,16 +894,16 @@ Object *CreateDialog::instance_selected() { } - return ObjectTypeDB::instance(tree->get_selected()->get_text(0)); + return ClassDB::instance(tree->get_selected()->get_text(0)); } void CreateDialog::_bind_methods() { - ObjectTypeDB::bind_method("_create",&CreateDialog::_create); - ObjectTypeDB::bind_method("_cancel",&CreateDialog::_cancel); - ObjectTypeDB::bind_method("_text_changed", &CreateDialog::_text_changed); + ClassDB::bind_method("_create",&CreateDialog::_create); + ClassDB::bind_method("_cancel",&CreateDialog::_cancel); + ClassDB::bind_method("_text_changed", &CreateDialog::_text_changed); ADD_SIGNAL( MethodInfo("create")); } @@ -929,7 +932,7 @@ CreateDialog::CreateDialog() { VBoxContainer *vbc = memnew( VBoxContainer ); add_child(vbc); - set_child_rect(vbc); + get_ok()->set_text("Create"); diff --git a/tools/editor/create_dialog.h b/tools/editor/create_dialog.h index 706a06ae16..5ecb4db2c3 100644 --- a/tools/editor/create_dialog.h +++ b/tools/editor/create_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -45,7 +45,7 @@ class CreateDialog : public ConfirmationDialog { - OBJ_TYPE(CreateDialog,ConfirmationDialog ) + GDCLASS(CreateDialog,ConfirmationDialog ) Vector<String> favorite_list; @@ -108,7 +108,7 @@ public: class CreateDialog : public ConfirmationDialog { - OBJ_TYPE( CreateDialog, ConfirmationDialog ); + GDCLASS( CreateDialog, ConfirmationDialog ); Tree *tree; Button *create; diff --git a/tools/editor/dependency_editor.cpp b/tools/editor/dependency_editor.cpp index 049bcefc75..20e185104b 100644 --- a/tools/editor/dependency_editor.cpp +++ b/tools/editor/dependency_editor.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -250,9 +250,9 @@ void DependencyEditor::edit(const String& p_path) { void DependencyEditor::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_searched"),&DependencyEditor::_searched); - ObjectTypeDB::bind_method(_MD("_load_pressed"),&DependencyEditor::_load_pressed); - ObjectTypeDB::bind_method(_MD("_fix_all"),&DependencyEditor::_fix_all); + ClassDB::bind_method(_MD("_searched"),&DependencyEditor::_searched); + ClassDB::bind_method(_MD("_load_pressed"),&DependencyEditor::_load_pressed); + ClassDB::bind_method(_MD("_fix_all"),&DependencyEditor::_fix_all); } @@ -261,7 +261,7 @@ DependencyEditor::DependencyEditor() { VBoxContainer *vb = memnew( VBoxContainer ); vb->set_name(TTR("Dependencies")); add_child(vb); - set_child_rect(vb); + tree = memnew( Tree ); tree->set_columns(2); @@ -354,7 +354,7 @@ DependencyEditorOwners::DependencyEditorOwners() { owners = memnew( ItemList ); add_child(owners); - set_child_rect(owners); + } @@ -459,7 +459,7 @@ DependencyRemoveDialog::DependencyRemoveDialog() { VBoxContainer *vb = memnew( VBoxContainer ); add_child(vb); - set_child_rect(vb); + text = memnew( Label ); vb->add_child(text); @@ -522,7 +522,7 @@ DependencyErrorDialog::DependencyErrorDialog() { VBoxContainer *vb = memnew( VBoxContainer ); add_child(vb); - set_child_rect(vb); + files = memnew( Tree ); @@ -690,8 +690,8 @@ void OrphanResourcesDialog::_button_pressed(Object *p_item,int p_column, int p_i void OrphanResourcesDialog::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_delete_confirm"),&OrphanResourcesDialog::_delete_confirm); - ObjectTypeDB::bind_method(_MD("_button_pressed"),&OrphanResourcesDialog::_button_pressed); + ClassDB::bind_method(_MD("_delete_confirm"),&OrphanResourcesDialog::_delete_confirm); + ClassDB::bind_method(_MD("_button_pressed"),&OrphanResourcesDialog::_button_pressed); } @@ -699,7 +699,7 @@ OrphanResourcesDialog::OrphanResourcesDialog(){ VBoxContainer *vbc = memnew( VBoxContainer ); add_child(vbc); - set_child_rect(vbc); + files = memnew( Tree ); files->set_columns(2); files->set_column_titles_visible(true); diff --git a/tools/editor/dependency_editor.h b/tools/editor/dependency_editor.h index 60758f8f4e..a96ffe5fcf 100644 --- a/tools/editor/dependency_editor.h +++ b/tools/editor/dependency_editor.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ class EditorFileSystemDirectory; class DependencyEditor : public AcceptDialog { - OBJ_TYPE(DependencyEditor,AcceptDialog); + GDCLASS(DependencyEditor,AcceptDialog); Tree *tree; @@ -71,7 +71,7 @@ public: }; class DependencyEditorOwners : public AcceptDialog { - OBJ_TYPE(DependencyEditorOwners,AcceptDialog); + GDCLASS(DependencyEditorOwners,AcceptDialog); ItemList *owners; String editing; @@ -84,7 +84,7 @@ public: }; class DependencyRemoveDialog : public ConfirmationDialog { - OBJ_TYPE(DependencyRemoveDialog,ConfirmationDialog); + GDCLASS(DependencyRemoveDialog,ConfirmationDialog); Label *text; @@ -103,7 +103,7 @@ public: class DependencyErrorDialog : public ConfirmationDialog { - OBJ_TYPE(DependencyErrorDialog,ConfirmationDialog); + GDCLASS(DependencyErrorDialog,ConfirmationDialog); String for_file; @@ -122,7 +122,7 @@ public: class OrphanResourcesDialog : public ConfirmationDialog { - OBJ_TYPE(OrphanResourcesDialog,ConfirmationDialog); + GDCLASS(OrphanResourcesDialog,ConfirmationDialog); DependencyEditor *dep_edit; Tree *files; diff --git a/tools/editor/doc_code_font.h b/tools/editor/doc_code_font.h index 879c873ea1..55f335ab78 100644 --- a/tools/editor/doc_code_font.h +++ b/tools/editor/doc_code_font.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/doc_font.h b/tools/editor/doc_font.h index a3c3b58b21..b598ee26f8 100644 --- a/tools/editor/doc_font.h +++ b/tools/editor/doc_font.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/doc_title_font.h b/tools/editor/doc_title_font.h index 75a3f049f0..afa0f61eda 100644 --- a/tools/editor/doc_title_font.h +++ b/tools/editor/doc_title_font.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_asset_installer.cpp b/tools/editor/editor_asset_installer.cpp index b6051886c0..54099ddce5 100644 --- a/tools/editor/editor_asset_installer.cpp +++ b/tools/editor/editor_asset_installer.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -331,7 +331,7 @@ void EditorAssetInstaller::ok_pressed() { void EditorAssetInstaller::_bind_methods() { - ObjectTypeDB::bind_method("_item_edited",&EditorAssetInstaller::_item_edited); + ClassDB::bind_method("_item_edited",&EditorAssetInstaller::_item_edited); } @@ -339,7 +339,7 @@ EditorAssetInstaller::EditorAssetInstaller() { VBoxContainer *vb = memnew( VBoxContainer ); add_child(vb); - set_child_rect(vb); + tree = memnew( Tree ); vb->add_margin_child("Package Contents:",tree,true); diff --git a/tools/editor/editor_asset_installer.h b/tools/editor/editor_asset_installer.h index d6e71dbb3c..2d0486a6f6 100644 --- a/tools/editor/editor_asset_installer.h +++ b/tools/editor/editor_asset_installer.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ #include "scene/gui/tree.h" class EditorAssetInstaller : public ConfirmationDialog { - OBJ_TYPE( EditorAssetInstaller, ConfirmationDialog ); + GDCLASS( EditorAssetInstaller, ConfirmationDialog ); Tree *tree; String package_path; diff --git a/tools/editor/editor_autoload_settings.cpp b/tools/editor/editor_autoload_settings.cpp index 97062b1480..071a237ea8 100644 --- a/tools/editor/editor_autoload_settings.cpp +++ b/tools/editor/editor_autoload_settings.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -62,7 +62,7 @@ bool EditorAutoloadSettings::_autoload_name_is_valid(const String& p_name, Strin return false; } - if (ObjectTypeDB::type_exists(p_name)) { + if (ClassDB::class_exists(p_name)) { if (r_error) *r_error = TTR("Invalid name. Must not collide with an existing engine class name."); @@ -116,13 +116,12 @@ void EditorAutoloadSettings::_autoload_add() { UndoRedo* undo_redo = EditorNode::get_singleton()->get_undo_redo(); undo_redo->create_action(TTR("Add AutoLoad")); - undo_redo->add_do_property(Globals::get_singleton(), name, "*" + path); - undo_redo->add_do_method(Globals::get_singleton(), "set_persisting", name, true); + undo_redo->add_do_property(GlobalConfig::get_singleton(), name, "*" + path); - if (Globals::get_singleton()->has(name)) { - undo_redo->add_undo_property(Globals::get_singleton(), name, Globals::get_singleton()->get(name)); + if (GlobalConfig::get_singleton()->has(name)) { + undo_redo->add_undo_property(GlobalConfig::get_singleton(), name, GlobalConfig::get_singleton()->get(name)); } else { - undo_redo->add_undo_property(Globals::get_singleton(), name, Variant()); + undo_redo->add_undo_property(GlobalConfig::get_singleton(), name, Variant()); } undo_redo->add_do_method(this, "update_autoload"); @@ -171,7 +170,7 @@ void EditorAutoloadSettings::_autoload_edited() { return; } - if (Globals::get_singleton()->has("autoload/" + name)) { + if (GlobalConfig::get_singleton()->has("autoload/" + name)) { ti->set_text(0, old_name); EditorNode::get_singleton()->show_warning(vformat(TTR("Autoload '%s' already exists!"), name)); return; @@ -181,21 +180,18 @@ void EditorAutoloadSettings::_autoload_edited() { name = "autoload/" + name; - bool persisting = Globals::get_singleton()->get(selected_autoload); - int order = Globals::get_singleton()->get(selected_autoload); - String path = Globals::get_singleton()->get(selected_autoload); + int order = GlobalConfig::get_singleton()->get_order(selected_autoload); + String path = GlobalConfig::get_singleton()->get(selected_autoload); undo_redo->create_action(TTR("Rename Autoload")); - undo_redo->add_do_property(Globals::get_singleton(), name, path); - undo_redo->add_do_method(Globals::get_singleton(), "set_persisting", name, persisting); - undo_redo->add_do_method(Globals::get_singleton(), "set_order", name, order); - undo_redo->add_do_method(Globals::get_singleton(), "clear", selected_autoload); + undo_redo->add_do_property(GlobalConfig::get_singleton(), name, path); + undo_redo->add_do_method(GlobalConfig::get_singleton(), "set_order", name, order); + undo_redo->add_do_method(GlobalConfig::get_singleton(), "clear", selected_autoload); - undo_redo->add_undo_property(Globals::get_singleton(), selected_autoload, path); - undo_redo->add_undo_method(Globals::get_singleton(), "set_persisting", selected_autoload, persisting); - undo_redo->add_undo_method(Globals::get_singleton(), "set_order", selected_autoload, order); - undo_redo->add_undo_method(Globals::get_singleton(), "clear", name); + undo_redo->add_undo_property(GlobalConfig::get_singleton(), selected_autoload, path); + undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_order", selected_autoload, order); + undo_redo->add_undo_method(GlobalConfig::get_singleton(), "clear", name); undo_redo->add_do_method(this, "update_autoload"); undo_redo->add_undo_method(this, "update_autoload"); @@ -212,8 +208,8 @@ void EditorAutoloadSettings::_autoload_edited() { bool checked = ti->is_checked(2); String base = "autoload/" + ti->get_text(0); - int order = Globals::get_singleton()->get_order(base); - String path = Globals::get_singleton()->get(base); + int order = GlobalConfig::get_singleton()->get_order(base); + String path = GlobalConfig::get_singleton()->get(base); if (path.begins_with("*")) path = path.substr(1, path.length()); @@ -223,11 +219,11 @@ void EditorAutoloadSettings::_autoload_edited() { undo_redo->create_action(TTR("Toggle AutoLoad Globals")); - undo_redo->add_do_property(Globals::get_singleton(), base, path); - undo_redo->add_undo_property(Globals::get_singleton(), base, Globals::get_singleton()->get(base)); + undo_redo->add_do_property(GlobalConfig::get_singleton(), base, path); + undo_redo->add_undo_property(GlobalConfig::get_singleton(), base, GlobalConfig::get_singleton()->get(base)); - undo_redo->add_do_method(Globals::get_singleton(),"set_order", base, order); - undo_redo->add_undo_method(Globals::get_singleton(),"set_order", base, order); + undo_redo->add_do_method(GlobalConfig::get_singleton(),"set_order", base, order); + undo_redo->add_undo_method(GlobalConfig::get_singleton(),"set_order", base, order); undo_redo->add_do_method(this, "update_autoload"); undo_redo->add_undo_method(this, "update_autoload"); @@ -267,16 +263,16 @@ void EditorAutoloadSettings::_autoload_button_pressed(Object *p_item, int p_colu String swap_name = "autoload/" + swap->get_text(0); - int order = Globals::get_singleton()->get_order(name); - int swap_order = Globals::get_singleton()->get_order(swap_name); + int order = GlobalConfig::get_singleton()->get_order(name); + int swap_order = GlobalConfig::get_singleton()->get_order(swap_name); undo_redo->create_action(TTR("Move Autoload")); - undo_redo->add_do_method(Globals::get_singleton(), "set_order", name, swap_order); - undo_redo->add_undo_method(Globals::get_singleton(), "set_order", name, order); + undo_redo->add_do_method(GlobalConfig::get_singleton(), "set_order", name, swap_order); + undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_order", name, order); - undo_redo->add_do_method(Globals::get_singleton(), "set_order", swap_name, order); - undo_redo->add_undo_method(Globals::get_singleton(), "set_order", swap_name, swap_order); + undo_redo->add_do_method(GlobalConfig::get_singleton(), "set_order", swap_name, order); + undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_order", swap_name, swap_order); undo_redo->add_do_method(this, "update_autoload"); undo_redo->add_undo_method(this, "update_autoload"); @@ -288,15 +284,15 @@ void EditorAutoloadSettings::_autoload_button_pressed(Object *p_item, int p_colu } break; case BUTTON_DELETE: { - int order = Globals::get_singleton()->get_order(name); + int order = GlobalConfig::get_singleton()->get_order(name); undo_redo->create_action(TTR("Remove Autoload")); - undo_redo->add_do_property(Globals::get_singleton(), name, Variant()); + undo_redo->add_do_property(GlobalConfig::get_singleton(), name, Variant()); - undo_redo->add_undo_property(Globals::get_singleton(), name, Globals::get_singleton()->get(name)); - undo_redo->add_undo_method(Globals::get_singleton(), "set_persisting", name, true); - undo_redo->add_undo_method(Globals::get_singleton(), "set_order", order); + undo_redo->add_undo_property(GlobalConfig::get_singleton(), name, GlobalConfig::get_singleton()->get(name)); + undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_persisting", name, true); + undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_order", order); undo_redo->add_do_method(this, "update_autoload"); undo_redo->add_undo_method(this, "update_autoload"); @@ -327,7 +323,7 @@ void EditorAutoloadSettings::update_autoload() { TreeItem *root = tree->create_item(); List<PropertyInfo> props; - Globals::get_singleton()->get_property_list(&props); + GlobalConfig::get_singleton()->get_property_list(&props); for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) { @@ -337,14 +333,14 @@ void EditorAutoloadSettings::update_autoload() { continue; String name = pi.name.get_slice("/", 1); - String path = Globals::get_singleton()->get(pi.name); + String path = GlobalConfig::get_singleton()->get(pi.name); if (name.empty()) continue; AutoLoadInfo info; info.name = pi.name; - info.order = Globals::get_singleton()->get_order(pi.name); + info.order = GlobalConfig::get_singleton()->get_order(pi.name); autoload_cache.push_back(info); @@ -381,7 +377,7 @@ Variant EditorAutoloadSettings::get_drag_data_fw(const Point2& p_point, Control if (autoload_cache.size() <= 1) return false; - StringArray autoloads; + PoolStringArray autoloads; TreeItem *next = tree->get_next_selected(NULL); @@ -399,7 +395,7 @@ Variant EditorAutoloadSettings::get_drag_data_fw(const Point2& p_point, Control for (int i = 0; i < max_size; i++) { Label *label = memnew( Label(autoloads[i]) ); - label->set_self_opacity(Math::lerp(1, 0, float(i)/PREVIEW_LIST_MAX_SIZE)); + label->set_self_modulate(Color(1,1,1,Math::lerp(1, 0, float(i)/PREVIEW_LIST_MAX_SIZE))); preview->add_child(label); } @@ -464,7 +460,7 @@ void EditorAutoloadSettings::drop_data_fw(const Point2& p_point, const Variant& move_to_back = true; } - int order = Globals::get_singleton()->get_order("autoload/" + name); + int order = GlobalConfig::get_singleton()->get_order("autoload/" + name); AutoLoadInfo aux; List<AutoLoadInfo>::Element *E = NULL; @@ -475,13 +471,13 @@ void EditorAutoloadSettings::drop_data_fw(const Point2& p_point, const Variant& } Dictionary drop_data = p_data; - StringArray autoloads = drop_data["autoloads"]; + PoolStringArray autoloads = drop_data["autoloads"]; Vector<int> orders; orders.resize(autoload_cache.size()); for (int i = 0; i < autoloads.size(); i++) { - aux.order = Globals::get_singleton()->get_order("autoload/" + autoloads[i]); + aux.order = GlobalConfig::get_singleton()->get_order("autoload/" + autoloads[i]); List<AutoLoadInfo>::Element *I = autoload_cache.find(aux); @@ -511,8 +507,8 @@ void EditorAutoloadSettings::drop_data_fw(const Point2& p_point, const Variant& i = 0; for (List<AutoLoadInfo>::Element *E = autoload_cache.front(); E; E = E->next()) { - undo_redo->add_do_method(Globals::get_singleton(), "set_order", E->get().name, orders[i++]); - undo_redo->add_undo_method(Globals::get_singleton(), "set_order", E->get().name, E->get().order); + undo_redo->add_do_method(GlobalConfig::get_singleton(), "set_order", E->get().name, orders[i++]); + undo_redo->add_undo_method(GlobalConfig::get_singleton(), "set_order", E->get().name, E->get().order); } orders.clear(); @@ -528,17 +524,17 @@ void EditorAutoloadSettings::drop_data_fw(const Point2& p_point, const Variant& void EditorAutoloadSettings::_bind_methods() { - ObjectTypeDB::bind_method("_autoload_add", &EditorAutoloadSettings::_autoload_add); - ObjectTypeDB::bind_method("_autoload_selected", &EditorAutoloadSettings::_autoload_selected); - ObjectTypeDB::bind_method("_autoload_edited", &EditorAutoloadSettings::_autoload_edited); - ObjectTypeDB::bind_method("_autoload_button_pressed", &EditorAutoloadSettings::_autoload_button_pressed); - ObjectTypeDB::bind_method("_autoload_file_callback", &EditorAutoloadSettings::_autoload_file_callback); + ClassDB::bind_method("_autoload_add", &EditorAutoloadSettings::_autoload_add); + ClassDB::bind_method("_autoload_selected", &EditorAutoloadSettings::_autoload_selected); + ClassDB::bind_method("_autoload_edited", &EditorAutoloadSettings::_autoload_edited); + ClassDB::bind_method("_autoload_button_pressed", &EditorAutoloadSettings::_autoload_button_pressed); + ClassDB::bind_method("_autoload_file_callback", &EditorAutoloadSettings::_autoload_file_callback); - ObjectTypeDB::bind_method("get_drag_data_fw", &EditorAutoloadSettings::get_drag_data_fw); - ObjectTypeDB::bind_method("can_drop_data_fw", &EditorAutoloadSettings::can_drop_data_fw); - ObjectTypeDB::bind_method("drop_data_fw", &EditorAutoloadSettings::drop_data_fw); + ClassDB::bind_method("get_drag_data_fw", &EditorAutoloadSettings::get_drag_data_fw); + ClassDB::bind_method("can_drop_data_fw", &EditorAutoloadSettings::can_drop_data_fw); + ClassDB::bind_method("drop_data_fw", &EditorAutoloadSettings::drop_data_fw); - ObjectTypeDB::bind_method("update_autoload", &EditorAutoloadSettings::update_autoload); + ClassDB::bind_method("update_autoload", &EditorAutoloadSettings::update_autoload); ADD_SIGNAL(MethodInfo("autoload_changed")); } diff --git a/tools/editor/editor_autoload_settings.h b/tools/editor/editor_autoload_settings.h index b61c44b9c2..2afe239000 100644 --- a/tools/editor/editor_autoload_settings.h +++ b/tools/editor/editor_autoload_settings.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ class EditorAutoloadSettings : public VBoxContainer { - OBJ_TYPE( EditorAutoloadSettings, VBoxContainer ); + GDCLASS( EditorAutoloadSettings, VBoxContainer ); enum { BUTTON_MOVE_UP, diff --git a/tools/editor/editor_data.cpp b/tools/editor/editor_data.cpp index 8fc18b5b39..f27fe79a85 100644 --- a/tools/editor/editor_data.cpp +++ b/tools/editor/editor_data.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -584,7 +584,7 @@ bool EditorData::check_and_update_scene(int p_idx) { Error err = pscene->pack(edited_scene[p_idx].root); ERR_FAIL_COND_V(err!=OK,false); ep.step(TTR("Updating scene.."),1); - Node *new_scene = pscene->instance(true); + Node *new_scene = pscene->instance(PackedScene::GEN_EDIT_STATE_MAIN); ERR_FAIL_COND_V(!new_scene,false); //transfer selection @@ -667,7 +667,7 @@ String EditorData::get_scene_type(int p_idx) const { ERR_FAIL_INDEX_V(p_idx,edited_scene.size(),String()); if (!edited_scene[p_idx].root) return ""; - return edited_scene[p_idx].root->get_type(); + return edited_scene[p_idx].root->get_class(); } void EditorData::move_edited_scene_to_index(int p_idx) { @@ -903,12 +903,12 @@ Array EditorSelection::_get_selected_nodes() { void EditorSelection::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_node_removed"),&EditorSelection::_node_removed); - ObjectTypeDB::bind_method(_MD("clear"),&EditorSelection::clear); - ObjectTypeDB::bind_method(_MD("add_node","node:Node"),&EditorSelection::add_node); - ObjectTypeDB::bind_method(_MD("remove_node","node:Node"),&EditorSelection::remove_node); - ObjectTypeDB::bind_method(_MD("get_selected_nodes"),&EditorSelection::_get_selected_nodes); - ObjectTypeDB::bind_method(_MD("get_transformable_selected_nodes"),&EditorSelection::_get_transformable_selected_nodes); + ClassDB::bind_method(_MD("_node_removed"),&EditorSelection::_node_removed); + ClassDB::bind_method(_MD("clear"),&EditorSelection::clear); + ClassDB::bind_method(_MD("add_node","node:Node"),&EditorSelection::add_node); + ClassDB::bind_method(_MD("remove_node","node:Node"),&EditorSelection::remove_node); + ClassDB::bind_method(_MD("get_selected_nodes"),&EditorSelection::_get_selected_nodes); + ClassDB::bind_method(_MD("get_transformable_selected_nodes"),&EditorSelection::_get_transformable_selected_nodes); ADD_SIGNAL( MethodInfo("selection_changed") ); } diff --git a/tools/editor/editor_data.h b/tools/editor/editor_data.h index 59f9d4e4f3..f0bc5983a2 100644 --- a/tools/editor/editor_data.h +++ b/tools/editor/editor_data.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -218,7 +218,7 @@ public: class EditorSelection : public Object { - OBJ_TYPE(EditorSelection,Object); + GDCLASS(EditorSelection,Object); public: Map<Node*,Object*> selection; diff --git a/tools/editor/editor_dir_dialog.cpp b/tools/editor/editor_dir_dialog.cpp index cf0732501e..56f9a0fb0b 100644 --- a/tools/editor/editor_dir_dialog.cpp +++ b/tools/editor/editor_dir_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -46,7 +46,7 @@ void EditorDirDialog::_update_dir(TreeItem* p_item) { List<String> dirs; bool ishidden; - bool show_hidden = EditorSettings::get_singleton()->get("file_dialog/show_hidden_files"); + bool show_hidden = EditorSettings::get_singleton()->get("filesystem/file_dialog/show_hidden_files"); while(p!="") { @@ -145,7 +145,7 @@ void EditorDirDialog::set_current_path(const String& p_path) { if (p.begins_with("res://")) p = p.replace_first("res://",""); - Vector<String> dirs = p.split("/"); + Vector<String> dirs = p.split("/",false); TreeItem *r=tree->get_root(); for(int i=0;i<dirs.size();i++) { @@ -224,10 +224,10 @@ void EditorDirDialog::_make_dir_confirm() { void EditorDirDialog::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_item_collapsed"),&EditorDirDialog::_item_collapsed); - ObjectTypeDB::bind_method(_MD("_make_dir"),&EditorDirDialog::_make_dir); - ObjectTypeDB::bind_method(_MD("_make_dir_confirm"),&EditorDirDialog::_make_dir_confirm); - ObjectTypeDB::bind_method(_MD("reload"),&EditorDirDialog::reload); + ClassDB::bind_method(_MD("_item_collapsed"),&EditorDirDialog::_item_collapsed); + ClassDB::bind_method(_MD("_make_dir"),&EditorDirDialog::_make_dir); + ClassDB::bind_method(_MD("_make_dir_confirm"),&EditorDirDialog::_make_dir_confirm); + ClassDB::bind_method(_MD("reload"),&EditorDirDialog::reload); ADD_SIGNAL(MethodInfo("dir_selected",PropertyInfo(Variant::STRING,"dir"))); } @@ -243,7 +243,7 @@ EditorDirDialog::EditorDirDialog() { tree = memnew( Tree ); add_child(tree); - set_child_rect(tree); + tree->connect("item_activated",this,"_ok"); makedir = add_button(TTR("Create Folder"),OS::get_singleton()->get_swap_ok_cancel()?true:false,"makedir"); @@ -255,7 +255,7 @@ EditorDirDialog::EditorDirDialog() { VBoxContainer *makevb= memnew( VBoxContainer ); makedialog->add_child(makevb); - makedialog->set_child_rect(makevb); +// makedialog->set_child_rect(makevb); makedirname = memnew( LineEdit ); makevb->add_margin_child(TTR("Name:"),makedirname); diff --git a/tools/editor/editor_dir_dialog.h b/tools/editor/editor_dir_dialog.h index 69f9850c30..0577ff0442 100644 --- a/tools/editor/editor_dir_dialog.h +++ b/tools/editor/editor_dir_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ #include "scene/gui/tree.h" class EditorDirDialog : public ConfirmationDialog { - OBJ_TYPE(EditorDirDialog,ConfirmationDialog); + GDCLASS(EditorDirDialog,ConfirmationDialog); ConfirmationDialog *makedialog; diff --git a/tools/editor/editor_file_dialog.cpp b/tools/editor/editor_file_dialog.cpp index 90289a275e..408818f729 100644 --- a/tools/editor/editor_file_dialog.cpp +++ b/tools/editor/editor_file_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -87,10 +87,10 @@ void EditorFileDialog::_notification(int p_what) { } else if (p_what==EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { - bool show_hidden=EditorSettings::get_singleton()->get("file_dialog/show_hidden_files"); + bool show_hidden=EditorSettings::get_singleton()->get("filesystem/file_dialog/show_hidden_files"); if (show_hidden_files!=show_hidden) set_show_hidden_files(show_hidden); - set_display_mode((DisplayMode)EditorSettings::get_singleton()->get("file_dialog/display_mode").operator int()); + set_display_mode((DisplayMode)EditorSettings::get_singleton()->get("filesystem/file_dialog/display_mode").operator int()); } } @@ -121,7 +121,7 @@ void EditorFileDialog::_unhandled_input(const InputEvent& p_event) { if (ED_IS_SHORTCUT("file_dialog/toggle_hidden_files", p_event)) { bool show=!show_hidden_files; set_show_hidden_files(show); - EditorSettings::get_singleton()->set("file_dialog/show_hidden_files",show); + EditorSettings::get_singleton()->set("filesystem/file_dialog/show_hidden_files",show); handled=true; } if (ED_IS_SHORTCUT("file_dialog/toggle_favorite", p_event)) { @@ -313,7 +313,7 @@ void EditorFileDialog::_action_pressed() { String fbase=dir_access->get_current_dir(); - DVector<String> files; + PoolVector<String> files; for(int i=0;i<item_list->get_item_count();i++) { if (item_list->is_selected(i)) files.push_back( fbase.plus_file(item_list->get_item_text(i) )); @@ -490,7 +490,7 @@ void EditorFileDialog::_item_dc_selected(int p_item) { void EditorFileDialog::update_file_list() { - int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size"); + int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size"); thumbnail_size*=EDSCALE; Ref<Texture> folder_thumbnail; Ref<Texture> file_thumbnail; @@ -1160,58 +1160,58 @@ EditorFileDialog::DisplayMode EditorFileDialog::get_display_mode() const{ void EditorFileDialog::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_unhandled_input"),&EditorFileDialog::_unhandled_input); - - ObjectTypeDB::bind_method(_MD("_item_selected"),&EditorFileDialog::_item_selected); - ObjectTypeDB::bind_method(_MD("_item_db_selected"),&EditorFileDialog::_item_dc_selected); - ObjectTypeDB::bind_method(_MD("_dir_entered"),&EditorFileDialog::_dir_entered); - ObjectTypeDB::bind_method(_MD("_file_entered"),&EditorFileDialog::_file_entered); - ObjectTypeDB::bind_method(_MD("_action_pressed"),&EditorFileDialog::_action_pressed); - ObjectTypeDB::bind_method(_MD("_cancel_pressed"),&EditorFileDialog::_cancel_pressed); - ObjectTypeDB::bind_method(_MD("_filter_selected"),&EditorFileDialog::_filter_selected); - ObjectTypeDB::bind_method(_MD("_save_confirm_pressed"),&EditorFileDialog::_save_confirm_pressed); - - ObjectTypeDB::bind_method(_MD("clear_filters"),&EditorFileDialog::clear_filters); - ObjectTypeDB::bind_method(_MD("add_filter","filter"),&EditorFileDialog::add_filter); - ObjectTypeDB::bind_method(_MD("get_current_dir"),&EditorFileDialog::get_current_dir); - ObjectTypeDB::bind_method(_MD("get_current_file"),&EditorFileDialog::get_current_file); - ObjectTypeDB::bind_method(_MD("get_current_path"),&EditorFileDialog::get_current_path); - ObjectTypeDB::bind_method(_MD("set_current_dir","dir"),&EditorFileDialog::set_current_dir); - ObjectTypeDB::bind_method(_MD("set_current_file","file"),&EditorFileDialog::set_current_file); - ObjectTypeDB::bind_method(_MD("set_current_path","path"),&EditorFileDialog::set_current_path); - ObjectTypeDB::bind_method(_MD("set_mode","mode"),&EditorFileDialog::set_mode); - ObjectTypeDB::bind_method(_MD("get_mode"),&EditorFileDialog::get_mode); - ObjectTypeDB::bind_method(_MD("get_vbox:VBoxContainer"),&EditorFileDialog::get_vbox); - ObjectTypeDB::bind_method(_MD("set_access","access"),&EditorFileDialog::set_access); - ObjectTypeDB::bind_method(_MD("get_access"),&EditorFileDialog::get_access); - ObjectTypeDB::bind_method(_MD("set_show_hidden_files","show"),&EditorFileDialog::set_show_hidden_files); - ObjectTypeDB::bind_method(_MD("is_showing_hidden_files"),&EditorFileDialog::is_showing_hidden_files); - ObjectTypeDB::bind_method(_MD("_select_drive"),&EditorFileDialog::_select_drive); - ObjectTypeDB::bind_method(_MD("_make_dir"),&EditorFileDialog::_make_dir); - ObjectTypeDB::bind_method(_MD("_make_dir_confirm"),&EditorFileDialog::_make_dir_confirm); - ObjectTypeDB::bind_method(_MD("_update_file_list"),&EditorFileDialog::update_file_list); - ObjectTypeDB::bind_method(_MD("_update_dir"),&EditorFileDialog::update_dir); - ObjectTypeDB::bind_method(_MD("_thumbnail_done"),&EditorFileDialog::_thumbnail_done); - ObjectTypeDB::bind_method(_MD("set_display_mode","mode"),&EditorFileDialog::set_display_mode); - ObjectTypeDB::bind_method(_MD("get_display_mode"),&EditorFileDialog::get_display_mode); - ObjectTypeDB::bind_method(_MD("_thumbnail_result"),&EditorFileDialog::_thumbnail_result); - ObjectTypeDB::bind_method(_MD("set_disable_overwrite_warning","disable"),&EditorFileDialog::set_disable_overwrite_warning); - ObjectTypeDB::bind_method(_MD("is_overwrite_warning_disabled"),&EditorFileDialog::is_overwrite_warning_disabled); - - ObjectTypeDB::bind_method(_MD("_recent_selected"),&EditorFileDialog::_recent_selected); - ObjectTypeDB::bind_method(_MD("_go_back"),&EditorFileDialog::_go_back); - ObjectTypeDB::bind_method(_MD("_go_forward"),&EditorFileDialog::_go_forward); - ObjectTypeDB::bind_method(_MD("_go_up"),&EditorFileDialog::_go_up); - - ObjectTypeDB::bind_method(_MD("_favorite_toggled"),&EditorFileDialog::_favorite_toggled); - ObjectTypeDB::bind_method(_MD("_favorite_selected"),&EditorFileDialog::_favorite_selected); - ObjectTypeDB::bind_method(_MD("_favorite_move_up"),&EditorFileDialog::_favorite_move_up); - ObjectTypeDB::bind_method(_MD("_favorite_move_down"),&EditorFileDialog::_favorite_move_down); - - ObjectTypeDB::bind_method(_MD("invalidate"),&EditorFileDialog::invalidate); + ClassDB::bind_method(_MD("_unhandled_input"),&EditorFileDialog::_unhandled_input); + + ClassDB::bind_method(_MD("_item_selected"),&EditorFileDialog::_item_selected); + ClassDB::bind_method(_MD("_item_db_selected"),&EditorFileDialog::_item_dc_selected); + ClassDB::bind_method(_MD("_dir_entered"),&EditorFileDialog::_dir_entered); + ClassDB::bind_method(_MD("_file_entered"),&EditorFileDialog::_file_entered); + ClassDB::bind_method(_MD("_action_pressed"),&EditorFileDialog::_action_pressed); + ClassDB::bind_method(_MD("_cancel_pressed"),&EditorFileDialog::_cancel_pressed); + ClassDB::bind_method(_MD("_filter_selected"),&EditorFileDialog::_filter_selected); + ClassDB::bind_method(_MD("_save_confirm_pressed"),&EditorFileDialog::_save_confirm_pressed); + + ClassDB::bind_method(_MD("clear_filters"),&EditorFileDialog::clear_filters); + ClassDB::bind_method(_MD("add_filter","filter"),&EditorFileDialog::add_filter); + ClassDB::bind_method(_MD("get_current_dir"),&EditorFileDialog::get_current_dir); + ClassDB::bind_method(_MD("get_current_file"),&EditorFileDialog::get_current_file); + ClassDB::bind_method(_MD("get_current_path"),&EditorFileDialog::get_current_path); + ClassDB::bind_method(_MD("set_current_dir","dir"),&EditorFileDialog::set_current_dir); + ClassDB::bind_method(_MD("set_current_file","file"),&EditorFileDialog::set_current_file); + ClassDB::bind_method(_MD("set_current_path","path"),&EditorFileDialog::set_current_path); + ClassDB::bind_method(_MD("set_mode","mode"),&EditorFileDialog::set_mode); + ClassDB::bind_method(_MD("get_mode"),&EditorFileDialog::get_mode); + ClassDB::bind_method(_MD("get_vbox:VBoxContainer"),&EditorFileDialog::get_vbox); + ClassDB::bind_method(_MD("set_access","access"),&EditorFileDialog::set_access); + ClassDB::bind_method(_MD("get_access"),&EditorFileDialog::get_access); + ClassDB::bind_method(_MD("set_show_hidden_files","show"),&EditorFileDialog::set_show_hidden_files); + ClassDB::bind_method(_MD("is_showing_hidden_files"),&EditorFileDialog::is_showing_hidden_files); + ClassDB::bind_method(_MD("_select_drive"),&EditorFileDialog::_select_drive); + ClassDB::bind_method(_MD("_make_dir"),&EditorFileDialog::_make_dir); + ClassDB::bind_method(_MD("_make_dir_confirm"),&EditorFileDialog::_make_dir_confirm); + ClassDB::bind_method(_MD("_update_file_list"),&EditorFileDialog::update_file_list); + ClassDB::bind_method(_MD("_update_dir"),&EditorFileDialog::update_dir); + ClassDB::bind_method(_MD("_thumbnail_done"),&EditorFileDialog::_thumbnail_done); + ClassDB::bind_method(_MD("set_display_mode","mode"),&EditorFileDialog::set_display_mode); + ClassDB::bind_method(_MD("get_display_mode"),&EditorFileDialog::get_display_mode); + ClassDB::bind_method(_MD("_thumbnail_result"),&EditorFileDialog::_thumbnail_result); + ClassDB::bind_method(_MD("set_disable_overwrite_warning","disable"),&EditorFileDialog::set_disable_overwrite_warning); + ClassDB::bind_method(_MD("is_overwrite_warning_disabled"),&EditorFileDialog::is_overwrite_warning_disabled); + + ClassDB::bind_method(_MD("_recent_selected"),&EditorFileDialog::_recent_selected); + ClassDB::bind_method(_MD("_go_back"),&EditorFileDialog::_go_back); + ClassDB::bind_method(_MD("_go_forward"),&EditorFileDialog::_go_forward); + ClassDB::bind_method(_MD("_go_up"),&EditorFileDialog::_go_up); + + ClassDB::bind_method(_MD("_favorite_toggled"),&EditorFileDialog::_favorite_toggled); + ClassDB::bind_method(_MD("_favorite_selected"),&EditorFileDialog::_favorite_selected); + ClassDB::bind_method(_MD("_favorite_move_up"),&EditorFileDialog::_favorite_move_up); + ClassDB::bind_method(_MD("_favorite_move_down"),&EditorFileDialog::_favorite_move_down); + + ClassDB::bind_method(_MD("invalidate"),&EditorFileDialog::invalidate); ADD_SIGNAL(MethodInfo("file_selected",PropertyInfo( Variant::STRING,"path"))); - ADD_SIGNAL(MethodInfo("files_selected",PropertyInfo( Variant::STRING_ARRAY,"paths"))); + ADD_SIGNAL(MethodInfo("files_selected",PropertyInfo( Variant::POOL_STRING_ARRAY,"paths"))); ADD_SIGNAL(MethodInfo("dir_selected",PropertyInfo( Variant::STRING,"dir"))); BIND_CONSTANT( MODE_OPEN_FILE ); @@ -1289,7 +1289,6 @@ EditorFileDialog::EditorFileDialog() { disable_overwrite_warning=false; VBoxContainer *vbc = memnew( VBoxContainer ); add_child(vbc); - set_child_rect(vbc); mode=MODE_SAVE_FILE; set_title(TTR("Save a File")); @@ -1446,7 +1445,7 @@ EditorFileDialog::EditorFileDialog() { makedialog->set_title(TTR("Create Folder")); VBoxContainer *makevb= memnew( VBoxContainer ); makedialog->add_child(makevb); - makedialog->set_child_rect(makevb); + makedirname = memnew( LineEdit ); makevb->add_margin_child(TTR("Name:"),makedirname); add_child(makedialog); @@ -1490,11 +1489,11 @@ EditorFileDialog::~EditorFileDialog() { void EditorLineEditFileChooser::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_browse"),&EditorLineEditFileChooser::_browse); - ObjectTypeDB::bind_method(_MD("_chosen"),&EditorLineEditFileChooser::_chosen); - ObjectTypeDB::bind_method(_MD("get_button:Button"),&EditorLineEditFileChooser::get_button); - ObjectTypeDB::bind_method(_MD("get_line_edit:LineEdit"),&EditorLineEditFileChooser::get_line_edit); - ObjectTypeDB::bind_method(_MD("get_file_dialog:EditorFileDialog"),&EditorLineEditFileChooser::get_file_dialog); + ClassDB::bind_method(_MD("_browse"),&EditorLineEditFileChooser::_browse); + ClassDB::bind_method(_MD("_chosen"),&EditorLineEditFileChooser::_chosen); + ClassDB::bind_method(_MD("get_button:Button"),&EditorLineEditFileChooser::get_button); + ClassDB::bind_method(_MD("get_line_edit:LineEdit"),&EditorLineEditFileChooser::get_line_edit); + ClassDB::bind_method(_MD("get_file_dialog:EditorFileDialog"),&EditorLineEditFileChooser::get_file_dialog); } diff --git a/tools/editor/editor_file_dialog.h b/tools/editor/editor_file_dialog.h index 14683856c0..e2a40cd5df 100644 --- a/tools/editor/editor_file_dialog.h +++ b/tools/editor/editor_file_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -42,7 +42,7 @@ */ class EditorFileDialog : public ConfirmationDialog { - OBJ_TYPE( EditorFileDialog, ConfirmationDialog ); + GDCLASS( EditorFileDialog, ConfirmationDialog ); public: @@ -227,7 +227,7 @@ public: class EditorLineEditFileChooser : public HBoxContainer { - OBJ_TYPE( EditorLineEditFileChooser, HBoxContainer ); + GDCLASS( EditorLineEditFileChooser, HBoxContainer ); Button *button; LineEdit *line_edit; EditorFileDialog *dialog; diff --git a/tools/editor/editor_file_system.cpp b/tools/editor/editor_file_system.cpp index be1af16576..5fb274f38f 100644 --- a/tools/editor/editor_file_system.cpp +++ b/tools/editor/editor_file_system.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -203,18 +203,18 @@ EditorFileSystemDirectory *EditorFileSystemDirectory::get_parent() { void EditorFileSystemDirectory::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_subdir_count"),&EditorFileSystemDirectory::get_subdir_count); - ObjectTypeDB::bind_method(_MD("get_subdir","idx"),&EditorFileSystemDirectory::get_subdir); - ObjectTypeDB::bind_method(_MD("get_file_count"),&EditorFileSystemDirectory::get_file_count); - ObjectTypeDB::bind_method(_MD("get_file","idx"),&EditorFileSystemDirectory::get_file); - ObjectTypeDB::bind_method(_MD("get_file_path","idx"),&EditorFileSystemDirectory::get_file_path); - ObjectTypeDB::bind_method(_MD("get_file_type","idx"),&EditorFileSystemDirectory::get_file_type); - ObjectTypeDB::bind_method(_MD("is_missing_sources","idx"),&EditorFileSystemDirectory::is_missing_sources); - ObjectTypeDB::bind_method(_MD("get_name"),&EditorFileSystemDirectory::get_name); - ObjectTypeDB::bind_method(_MD("get_path"),&EditorFileSystemDirectory::get_path); - ObjectTypeDB::bind_method(_MD("get_parent:EditorFileSystemDirectory"),&EditorFileSystemDirectory::get_parent); - ObjectTypeDB::bind_method(_MD("find_file_index","name"),&EditorFileSystemDirectory::find_file_index); - ObjectTypeDB::bind_method(_MD("find_dir_index","name"),&EditorFileSystemDirectory::find_dir_index); + ClassDB::bind_method(_MD("get_subdir_count"),&EditorFileSystemDirectory::get_subdir_count); + ClassDB::bind_method(_MD("get_subdir","idx"),&EditorFileSystemDirectory::get_subdir); + ClassDB::bind_method(_MD("get_file_count"),&EditorFileSystemDirectory::get_file_count); + ClassDB::bind_method(_MD("get_file","idx"),&EditorFileSystemDirectory::get_file); + ClassDB::bind_method(_MD("get_file_path","idx"),&EditorFileSystemDirectory::get_file_path); + ClassDB::bind_method(_MD("get_file_type","idx"),&EditorFileSystemDirectory::get_file_type); + ClassDB::bind_method(_MD("is_missing_sources","idx"),&EditorFileSystemDirectory::is_missing_sources); + ClassDB::bind_method(_MD("get_name"),&EditorFileSystemDirectory::get_name); + ClassDB::bind_method(_MD("get_path"),&EditorFileSystemDirectory::get_path); + ClassDB::bind_method(_MD("get_parent:EditorFileSystemDirectory"),&EditorFileSystemDirectory::get_parent); + ClassDB::bind_method(_MD("find_file_index","name"),&EditorFileSystemDirectory::find_file_index); + ClassDB::bind_method(_MD("find_dir_index","name"),&EditorFileSystemDirectory::find_dir_index); } @@ -286,7 +286,7 @@ void EditorFileSystem::_scan_filesystem() { sources_changed.clear(); file_cache.clear(); - String project=Globals::get_singleton()->get_resource_path(); + String project=GlobalConfig::get_singleton()->get_resource_path(); String fscache = EditorSettings::get_singleton()->get_project_settings_path().plus_file("filesystem_cache"); FileAccess *f =FileAccess::open(fscache,FileAccess::READ); @@ -488,7 +488,7 @@ bool EditorFileSystem::_update_scan_actions() { void EditorFileSystem::scan() { - if (bool(Globals::get_singleton()->get("debug/disable_scan"))) + if (false /*&& bool(Globals::get_singleton()->get("debug/disable_scan"))*/) return; if (scanning || scanning_sources|| thread) @@ -1088,7 +1088,7 @@ bool EditorFileSystem::_find_file(const String& p_file,EditorFileSystemDirectory return false; - String f = Globals::get_singleton()->localize_path(p_file); + String f = GlobalConfig::get_singleton()->localize_path(p_file); if (!f.begins_with("res://")) return false; @@ -1204,7 +1204,7 @@ EditorFileSystemDirectory *EditorFileSystem::get_path(const String& p_path) { return NULL; - String f = Globals::get_singleton()->localize_path(p_path); + String f = GlobalConfig::get_singleton()->localize_path(p_path); if (!f.begins_with("res://")) return NULL; @@ -1346,14 +1346,14 @@ void EditorFileSystem::update_file(const String& p_file) { void EditorFileSystem::_bind_methods() { - ObjectTypeDB::bind_method(_MD("get_filesystem:EditorFileSystemDirectory"),&EditorFileSystem::get_filesystem); - ObjectTypeDB::bind_method(_MD("is_scanning"),&EditorFileSystem::is_scanning); - ObjectTypeDB::bind_method(_MD("get_scanning_progress"),&EditorFileSystem::get_scanning_progress); - ObjectTypeDB::bind_method(_MD("scan"),&EditorFileSystem::scan); - ObjectTypeDB::bind_method(_MD("scan_sources"),&EditorFileSystem::scan_sources); - ObjectTypeDB::bind_method(_MD("update_file","path"),&EditorFileSystem::update_file); - ObjectTypeDB::bind_method(_MD("get_path:EditorFileSystemDirectory","path"),&EditorFileSystem::get_path); - ObjectTypeDB::bind_method(_MD("get_file_type","path"),&EditorFileSystem::get_file_type); + ClassDB::bind_method(_MD("get_filesystem:EditorFileSystemDirectory"),&EditorFileSystem::get_filesystem); + ClassDB::bind_method(_MD("is_scanning"),&EditorFileSystem::is_scanning); + ClassDB::bind_method(_MD("get_scanning_progress"),&EditorFileSystem::get_scanning_progress); + ClassDB::bind_method(_MD("scan"),&EditorFileSystem::scan); + ClassDB::bind_method(_MD("scan_sources"),&EditorFileSystem::scan_sources); + ClassDB::bind_method(_MD("update_file","path"),&EditorFileSystem::update_file); + ClassDB::bind_method(_MD("get_path:EditorFileSystemDirectory","path"),&EditorFileSystem::get_path); + ClassDB::bind_method(_MD("get_file_type","path"),&EditorFileSystem::get_file_type); ADD_SIGNAL( MethodInfo("filesystem_changed") ); ADD_SIGNAL( MethodInfo("sources_changed",PropertyInfo(Variant::BOOL,"exist")) ); diff --git a/tools/editor/editor_file_system.h b/tools/editor/editor_file_system.h index fb768fb358..97c253c70b 100644 --- a/tools/editor/editor_file_system.h +++ b/tools/editor/editor_file_system.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,7 +39,7 @@ class FileAccess; struct EditorProgressBG; class EditorFileSystemDirectory : public Object { - OBJ_TYPE( EditorFileSystemDirectory,Object ); + GDCLASS( EditorFileSystemDirectory,Object ); String name; uint64_t modified_time; @@ -122,7 +122,7 @@ public: class EditorFileSystem : public Node { - OBJ_TYPE( EditorFileSystem, Node ); + GDCLASS( EditorFileSystem, Node ); _THREAD_SAFE_CLASS_ diff --git a/tools/editor/editor_fonts.cpp b/tools/editor/editor_fonts.cpp index bcf41cbac8..3e128e7759 100644 --- a/tools/editor/editor_fonts.cpp +++ b/tools/editor/editor_fonts.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -122,7 +122,7 @@ void editor_register_fonts(Ref<Theme> p_theme) { dfmono->set_font_ptr(_font_source_code_pro,_font_source_code_pro_size); //dfd->set_force_autohinter(true); //just looks better..i think? - MAKE_DROID_SANS(df,int(EditorSettings::get_singleton()->get("global/font_size"))*EDSCALE); + MAKE_DROID_SANS(df,int(EditorSettings::get_singleton()->get("interface/font_size"))*EDSCALE); p_theme->set_default_theme_font(df); @@ -131,9 +131,9 @@ void editor_register_fonts(Ref<Theme> p_theme) { // Ref<BitmapFont> doc_title_font = make_font(_bi_font_doc_title_font_height,_bi_font_doc_title_font_ascent,0,_bi_font_doc_title_font_charcount,_bi_font_doc_title_font_characters,p_theme->get_icon("DocTitleFont","EditorIcons")); // Ref<BitmapFont> doc_code_font = make_font(_bi_font_doc_code_font_height,_bi_font_doc_code_font_ascent,0,_bi_font_doc_code_font_charcount,_bi_font_doc_code_font_characters,p_theme->get_icon("DocCodeFont","EditorIcons")); - MAKE_DROID_SANS(df_title,int(EDITOR_DEF("help/help_title_font_size",18))*EDSCALE); + MAKE_DROID_SANS(df_title,int(EDITOR_DEF("text_editor/help/help_title_font_size",18))*EDSCALE); - MAKE_DROID_SANS(df_doc,int(EDITOR_DEF("help/help_font_size",16))*EDSCALE); + MAKE_DROID_SANS(df_doc,int(EDITOR_DEF("text_editor/help/help_font_size",16))*EDSCALE); p_theme->set_font("doc","EditorFonts",df_doc); @@ -142,7 +142,7 @@ void editor_register_fonts(Ref<Theme> p_theme) { Ref<DynamicFont> df_code; df_code.instance(); - df_code->set_size(int(EditorSettings::get_singleton()->get("global/source_font_size"))*EDSCALE); + df_code->set_size(int(EditorSettings::get_singleton()->get("interface/source_font_size"))*EDSCALE); df_code->set_font_data(dfmono); MAKE_FALLBACKS(df_code); @@ -150,7 +150,7 @@ void editor_register_fonts(Ref<Theme> p_theme) { Ref<DynamicFont> df_doc_code; df_doc_code.instance(); - df_doc_code->set_size(int(EDITOR_DEF("help/help_source_font_size",14))*EDSCALE); + df_doc_code->set_size(int(EDITOR_DEF("text_editor/help/help_source_font_size",14))*EDSCALE); df_doc_code->set_font_data(dfmono); MAKE_FALLBACKS(df_doc_code); diff --git a/tools/editor/editor_fonts.h b/tools/editor/editor_fonts.h index 3b2422c3e3..0e8ce20609 100644 --- a/tools/editor/editor_fonts.h +++ b/tools/editor/editor_fonts.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_help.cpp b/tools/editor/editor_help.cpp index 4f83dc2f66..11eeaffdb6 100644 --- a/tools/editor/editor_help.cpp +++ b/tools/editor/editor_help.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -71,7 +71,7 @@ void EditorHelpSearch::_sbox_input(const InputEvent& p_ie) { p_ie.key.scancode == KEY_PAGEUP || p_ie.key.scancode == KEY_PAGEDOWN ) ) { - search_options->call("_input_event",p_ie); + search_options->call("_gui_input",p_ie); search_box->accept_event(); } @@ -88,7 +88,7 @@ void EditorHelpSearch::_update_search() { */ List<StringName> type_list; - ObjectTypeDB::get_type_list(&type_list); + ClassDB::get_class_list(&type_list); DocData *doc=EditorHelp::get_doc_data(); String term = search_box->get_text(); @@ -299,10 +299,10 @@ void EditorHelpSearch::_notification(int p_what) { void EditorHelpSearch::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_text_changed"),&EditorHelpSearch::_text_changed); - ObjectTypeDB::bind_method(_MD("_confirmed"),&EditorHelpSearch::_confirmed); - ObjectTypeDB::bind_method(_MD("_sbox_input"),&EditorHelpSearch::_sbox_input); - ObjectTypeDB::bind_method(_MD("_update_search"),&EditorHelpSearch::_update_search); + ClassDB::bind_method(_MD("_text_changed"),&EditorHelpSearch::_text_changed); + ClassDB::bind_method(_MD("_confirmed"),&EditorHelpSearch::_confirmed); + ClassDB::bind_method(_MD("_sbox_input"),&EditorHelpSearch::_sbox_input); + ClassDB::bind_method(_MD("_update_search"),&EditorHelpSearch::_update_search); ADD_SIGNAL(MethodInfo("go_to_help")); @@ -314,7 +314,7 @@ EditorHelpSearch::EditorHelpSearch() { editor=EditorNode::get_singleton(); VBoxContainer *vbc = memnew( VBoxContainer ); add_child(vbc); - set_child_rect(vbc); + HBoxContainer *sb_hb = memnew( HBoxContainer); search_box = memnew( LineEdit ); sb_hb->add_child(search_box); @@ -324,7 +324,7 @@ EditorHelpSearch::EditorHelpSearch() { sb_hb->add_child(sb); vbc->add_margin_child(TTR("Search:"),sb_hb); search_box->connect("text_changed",this,"_text_changed"); - search_box->connect("input_event",this,"_sbox_input"); + search_box->connect("gui_input",this,"_sbox_input"); search_options = memnew( Tree ); vbc->add_margin_child(TTR("Matches:"),search_options,true); get_ok()->set_text(TTR("Open")); @@ -349,7 +349,7 @@ void EditorHelpIndex::add_type(const String& p_type,HashMap<String,TreeItem*>& p if (p_types.has(p_type)) return; -// if (!ObjectTypeDB::is_type(p_type,base) || p_type==base) +// if (!ClassDB::is_type(p_type,base) || p_type==base) // return; String inherits=EditorHelp::get_doc_data()->class_list[p_type].inherits; @@ -488,17 +488,17 @@ void EditorHelpIndex::_sbox_input(const InputEvent& p_ie) { p_ie.key.scancode == KEY_PAGEUP || p_ie.key.scancode == KEY_PAGEDOWN ) ) { - class_list->call("_input_event",p_ie); + class_list->call("_gui_input",p_ie); search_box->accept_event(); } } void EditorHelpIndex::_bind_methods() { - ObjectTypeDB::bind_method("_tree_item_selected",&EditorHelpIndex::_tree_item_selected); - ObjectTypeDB::bind_method("_text_changed",&EditorHelpIndex::_text_changed); - ObjectTypeDB::bind_method("_sbox_input",&EditorHelpIndex::_sbox_input); - ObjectTypeDB::bind_method("select_class",&EditorHelpIndex::select_class); + ClassDB::bind_method("_tree_item_selected",&EditorHelpIndex::_tree_item_selected); + ClassDB::bind_method("_text_changed",&EditorHelpIndex::_text_changed); + ClassDB::bind_method("_sbox_input",&EditorHelpIndex::_sbox_input); + ClassDB::bind_method("select_class",&EditorHelpIndex::select_class); ADD_SIGNAL( MethodInfo("open_class")); } @@ -508,7 +508,6 @@ EditorHelpIndex::EditorHelpIndex() { VBoxContainer *vbc = memnew( VBoxContainer ); add_child(vbc); - set_child_rect(vbc); search_box = memnew( LineEdit ); vbc->add_margin_child(TTR("Search:"), search_box); @@ -517,7 +516,7 @@ EditorHelpIndex::EditorHelpIndex() { register_text_enter(search_box); search_box->connect("text_changed", this, "_text_changed"); - search_box->connect("input_event", this, "_sbox_input"); + search_box->connect("gui_input", this, "_sbox_input"); class_list = memnew( Tree ); vbc->add_margin_child(TTR("Class List:")+" ", class_list, true); @@ -660,7 +659,7 @@ void EditorHelp::_add_type(const String& p_type) { t="void"; bool can_ref = (t!="int" && t!="real" && t!="bool" && t!="void"); - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/base_type_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/base_type_color")); if (can_ref) class_desc->push_meta("#"+t); //class class_desc->add_text(t); @@ -719,9 +718,9 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { h_color=Color(1,1,1,1); class_desc->push_font(doc_title_font); - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color")); class_desc->add_text(TTR("Class:")+" "); - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/base_type_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/base_type_color")); _add_text(p_class); class_desc->pop(); class_desc->pop(); @@ -730,7 +729,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { if (cd.inherits!="") { - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color")); class_desc->push_font(doc_title_font); class_desc->add_text(TTR("Inherits:")+" "); class_desc->pop(); @@ -754,7 +753,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { class_desc->add_newline(); } - if (ObjectTypeDB::type_exists(cd.name)) { + if (ClassDB::class_exists(cd.name)) { bool found = false; bool prev = false; @@ -764,7 +763,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { if (E->get().inherits == cd.name) { if (!found) { - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color")); class_desc->push_font(doc_title_font); class_desc->add_text(TTR("Inherited by:")+" "); class_desc->pop(); @@ -795,7 +794,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { if (cd.brief_description!="") { - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color")); class_desc->push_font(doc_title_font); class_desc->add_text(TTR("Brief Description:")); class_desc->pop(); @@ -803,7 +802,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { //class_desc->add_newline(); class_desc->add_newline(); - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color")); class_desc->push_font( doc_font ); class_desc->push_indent(1); _add_text(cd.brief_description); @@ -814,16 +813,111 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { class_desc->add_newline(); } + Set<String> skip_methods; + bool property_descr=false; + + if (cd.properties.size()) { + + + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color")); + class_desc->push_font(doc_title_font); + class_desc->add_text(TTR("Members:")); + class_desc->pop(); + class_desc->pop(); +// class_desc->add_newline(); + + class_desc->push_indent(1); + class_desc->push_table(2); + class_desc->set_table_column_expand(1,1); + + for(int i=0;i<cd.properties.size();i++) { + property_line[cd.properties[i].name]=class_desc->get_line_count()-2; //gets overriden if description + + class_desc->push_cell(); + class_desc->push_align(RichTextLabel::ALIGN_RIGHT); + class_desc->push_font(doc_code_font); + _add_type(cd.properties[i].type); + class_desc->add_text(" "); + class_desc->pop(); + class_desc->pop(); + class_desc->pop(); + + bool describe=false; + + if (cd.properties[i].setter!="") { + skip_methods.insert(cd.properties[i].setter); + describe=true; + + } + if (cd.properties[i].getter!="") { + skip_methods.insert(cd.properties[i].getter); + describe=true; + } + + if (cd.properties[i].description!="") { + describe=true; + + } + class_desc->push_cell(); + if (describe) { + class_desc->push_meta("@"+cd.properties[i].name); + } + + class_desc->push_font(doc_code_font); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color")); + _add_text(cd.properties[i].name); + + if (describe) { + class_desc->pop(); + } + + + if (cd.properties[i].brief_description!="") { + class_desc->push_font(doc_font); + class_desc->add_text(" "); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/comment_color")); + _add_text(cd.properties[i].description); + class_desc->pop(); + class_desc->pop(); + + } + + if (describe) { + property_descr=true; + } + + + class_desc->pop(); + class_desc->pop(); + class_desc->pop(); + + } + + + class_desc->pop(); //table + class_desc->pop(); + class_desc->add_newline(); + class_desc->add_newline(); + } + + bool method_descr=false; - bool sort_methods = EditorSettings::get_singleton()->get("help/sort_functions_alphabetically"); + bool sort_methods = EditorSettings::get_singleton()->get("text_editor/help/sort_functions_alphabetically"); + + Vector<DocData::MethodDoc> methods; + for(int i=0;i<cd.methods.size();i++) { + if (skip_methods.has(cd.methods[i].name)) + continue; + methods.push_back(cd.methods[i]); + } - if (cd.methods.size()) { + if (methods.size()) { if (sort_methods) - cd.methods.sort(); + methods.sort(); - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color")); class_desc->push_font(doc_title_font); class_desc->add_text(TTR("Public Methods:")); class_desc->pop(); @@ -836,15 +930,15 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { class_desc->push_table(2); class_desc->set_table_column_expand(1,1); - for(int i=0;i<cd.methods.size();i++) { + for(int i=0;i<methods.size();i++) { class_desc->push_cell(); - method_line[cd.methods[i].name]=class_desc->get_line_count()-2; //gets overriden if description + method_line[methods[i].name]=class_desc->get_line_count()-2; //gets overriden if description class_desc->push_align(RichTextLabel::ALIGN_RIGHT); class_desc->push_font(doc_code_font); - _add_type(cd.methods[i].return_type); + _add_type(methods[i].return_type); //class_desc->add_text(" "); class_desc->pop(); //align class_desc->pop(); //font @@ -852,53 +946,53 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { class_desc->push_cell(); class_desc->push_font(doc_code_font); - if (cd.methods[i].description!="") { + if (methods[i].description!="") { method_descr=true; - class_desc->push_meta("@"+cd.methods[i].name); + class_desc->push_meta("@"+methods[i].name); } - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color")); - _add_text(cd.methods[i].name); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color")); + _add_text(methods[i].name); class_desc->pop(); - if (cd.methods[i].description!="") + if (methods[i].description!="") class_desc->pop(); - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color")); - class_desc->add_text(cd.methods[i].arguments.size()?"( ":"("); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color")); + class_desc->add_text(methods[i].arguments.size()?"( ":"("); class_desc->pop(); - for(int j=0;j<cd.methods[i].arguments.size();j++) { - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color")); + for(int j=0;j<methods[i].arguments.size();j++) { + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color")); if (j>0) class_desc->add_text(", "); - _add_type(cd.methods[i].arguments[j].type); + _add_type(methods[i].arguments[j].type); class_desc->add_text(" "); - _add_text(cd.methods[i].arguments[j].name); - if (cd.methods[i].arguments[j].default_value!="") { + _add_text(methods[i].arguments[j].name); + if (methods[i].arguments[j].default_value!="") { - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color")); class_desc->add_text("="); class_desc->pop(); - _add_text(cd.methods[i].arguments[j].default_value); + _add_text(methods[i].arguments[j].default_value); } class_desc->pop(); } - if (cd.methods[i].qualifiers.find("vararg")!=-1) { - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color")); + if (methods[i].qualifiers.find("vararg")!=-1) { + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color")); class_desc->add_text(","); - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color")); class_desc->add_text(" ... "); class_desc->pop(); class_desc->pop(); } - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color")); - class_desc->add_text(cd.methods[i].arguments.size()?" )":")"); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color")); + class_desc->add_text(methods[i].arguments.size()?" )":")"); class_desc->pop(); - if (cd.methods[i].qualifiers!="") { + if (methods[i].qualifiers!="") { - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color")); class_desc->add_text(" "); - _add_text(cd.methods[i].qualifiers); + _add_text(methods[i].qualifiers); class_desc->pop(); } @@ -914,53 +1008,11 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { } - if (cd.properties.size()) { - - - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); - class_desc->push_font(doc_title_font); - class_desc->add_text(TTR("Members:")); - class_desc->pop(); - class_desc->pop(); - class_desc->add_newline(); - - class_desc->push_indent(1); - - //class_desc->add_newline(); - - for(int i=0;i<cd.properties.size();i++) { - - property_line[cd.properties[i].name]=class_desc->get_line_count()-2; //gets overriden if description - class_desc->push_font(doc_code_font); - _add_type(cd.properties[i].type); - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color")); - class_desc->add_text(" "); - _add_text(cd.properties[i].name); - class_desc->pop(); - class_desc->pop(); - - if (cd.properties[i].description!="") { - class_desc->push_font(doc_font); - class_desc->add_text(" "); - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/comment_color")); - _add_text(cd.properties[i].description); - class_desc->pop(); - class_desc->pop(); - - } - - class_desc->add_newline(); - } - - - class_desc->pop(); - class_desc->add_newline(); - } if (cd.theme_properties.size()) { - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color")); class_desc->push_font(doc_title_font); class_desc->add_text(TTR("GUI Theme Items:")); class_desc->pop(); @@ -976,7 +1028,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { theme_property_line[cd.theme_properties[i].name]=class_desc->get_line_count()-2; //gets overriden if description class_desc->push_font(doc_code_font); _add_type(cd.theme_properties[i].type); - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color")); class_desc->add_text(" "); _add_text(cd.theme_properties[i].name); class_desc->pop(); @@ -985,7 +1037,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { if (cd.theme_properties[i].description!="") { class_desc->push_font(doc_font); class_desc->add_text(" "); - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/comment_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/comment_color")); _add_text(cd.theme_properties[i].description); class_desc->pop(); class_desc->pop(); @@ -1004,7 +1056,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { if (sort_methods) { cd.signals.sort(); } - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color")); class_desc->push_font(doc_title_font); class_desc->add_text(TTR("Signals:")); class_desc->pop(); @@ -1021,14 +1073,14 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { class_desc->push_font(doc_code_font); // monofont //_add_type("void"); //class_desc->add_text(" "); - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color")); _add_text(cd.signals[i].name); class_desc->pop(); - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color")); class_desc->add_text(cd.signals[i].arguments.size()?"( ":"("); class_desc->pop(); for(int j=0;j<cd.signals[i].arguments.size();j++) { - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color")); if (j>0) class_desc->add_text(", "); _add_type(cd.signals[i].arguments[j].type); @@ -1036,7 +1088,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { _add_text(cd.signals[i].arguments[j].name); if (cd.signals[i].arguments[j].default_value!="") { - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color")); class_desc->add_text("="); class_desc->pop(); _add_text(cd.signals[i].arguments[j].default_value); @@ -1045,13 +1097,13 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { class_desc->pop(); } - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color")); class_desc->add_text(cd.signals[i].arguments.size()?" )":")"); class_desc->pop(); class_desc->pop(); // end monofont if (cd.signals[i].description!="") { - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/comment_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/comment_color")); class_desc->add_text(" "); _add_text(cd.signals[i].description); class_desc->pop(); @@ -1069,7 +1121,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { if (cd.constants.size()) { - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color")); class_desc->push_font(doc_title_font); class_desc->add_text(TTR("Constants:")); class_desc->pop(); @@ -1083,20 +1135,20 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { constant_line[cd.constants[i].name]=class_desc->get_line_count()-2; class_desc->push_font(doc_code_font); - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/base_type_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/base_type_color")); _add_text(cd.constants[i].name); class_desc->pop(); - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color")); class_desc->add_text(" = "); class_desc->pop(); - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color")); _add_text(cd.constants[i].value); class_desc->pop(); class_desc->pop(); if (cd.constants[i].description!="") { class_desc->push_font(doc_font); class_desc->add_text(" "); - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/comment_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/comment_color")); _add_text(cd.constants[i].description); class_desc->pop(); class_desc->pop(); @@ -1114,7 +1166,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { if (cd.description!="") { description_line=class_desc->get_line_count()-2; - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color")); class_desc->push_font(doc_title_font); class_desc->add_text(TTR("Description:")); class_desc->pop(); @@ -1122,7 +1174,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { class_desc->add_newline(); class_desc->add_newline(); - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color")); class_desc->push_font( doc_font ); class_desc->push_indent(1); _add_text(cd.description); @@ -1133,9 +1185,92 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { class_desc->add_newline(); } + if (property_descr) { + + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color")); + class_desc->push_font(doc_title_font); + class_desc->add_text(TTR("Property Description:")); + class_desc->pop(); + class_desc->pop(); + + class_desc->add_newline(); + class_desc->add_newline(); + + + for(int i=0;i<cd.properties.size();i++) { + + method_line[cd.properties[i].name]=class_desc->get_line_count()-2; + + class_desc->push_font(doc_code_font); + _add_type(cd.properties[i].type); + + class_desc->add_text(" "); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color")); + _add_text(cd.properties[i].name); + class_desc->pop(); //color + + class_desc->add_text(" "); + + class_desc->pop(); //font + + if (cd.properties[i].setter!="") { + + class_desc->push_font( doc_font ); + + class_desc->push_indent(2); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color")); + class_desc->add_text("Setter: "); + class_desc->pop(); + + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color")); + class_desc->add_text(cd.properties[i].setter+"(value)"); + class_desc->pop(); //color + + class_desc->pop(); //indent + + class_desc->pop(); //font + + } + + if (cd.properties[i].getter!="") { + + class_desc->push_font( doc_font ); + + class_desc->push_indent(2); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color")); + class_desc->add_text("Getter: "); + class_desc->pop(); + + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color")); + class_desc->add_text(cd.properties[i].getter+"()"); + class_desc->pop(); //color + + class_desc->pop(); //indent + + class_desc->pop(); //font + + } + + class_desc->add_newline(); + + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color")); + class_desc->push_font( doc_font ); + class_desc->push_indent(1); + _add_text(cd.properties[i].description); + class_desc->pop(); + class_desc->pop(); + class_desc->pop(); + class_desc->add_newline(); + class_desc->add_newline(); + class_desc->add_newline(); + + } + + } + if (method_descr) { - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color")); class_desc->push_font(doc_title_font); class_desc->add_text(TTR("Method Description:")); class_desc->pop(); @@ -1145,46 +1280,46 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { class_desc->add_newline(); - for(int i=0;i<cd.methods.size();i++) { + for(int i=0;i<methods.size();i++) { - method_line[cd.methods[i].name]=class_desc->get_line_count()-2; + method_line[methods[i].name]=class_desc->get_line_count()-2; class_desc->push_font(doc_code_font); - _add_type(cd.methods[i].return_type); + _add_type(methods[i].return_type); class_desc->add_text(" "); - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color")); - _add_text(cd.methods[i].name); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color")); + _add_text(methods[i].name); class_desc->pop(); - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color")); - class_desc->add_text(cd.methods[i].arguments.size()?"( ":"("); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color")); + class_desc->add_text(methods[i].arguments.size()?"( ":"("); class_desc->pop(); - for(int j=0;j<cd.methods[i].arguments.size();j++) { - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color")); + for(int j=0;j<methods[i].arguments.size();j++) { + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color")); if (j>0) class_desc->add_text(", "); - _add_type(cd.methods[i].arguments[j].type); + _add_type(methods[i].arguments[j].type); class_desc->add_text(" "); - _add_text(cd.methods[i].arguments[j].name); - if (cd.methods[i].arguments[j].default_value!="") { + _add_text(methods[i].arguments[j].name); + if (methods[i].arguments[j].default_value!="") { - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color")); class_desc->add_text("="); class_desc->pop(); - _add_text(cd.methods[i].arguments[j].default_value); + _add_text(methods[i].arguments[j].default_value); } class_desc->pop(); } - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color")); - class_desc->add_text(cd.methods[i].arguments.size()?" )":")"); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color")); + class_desc->add_text(methods[i].arguments.size()?" )":")"); class_desc->pop(); - if (cd.methods[i].qualifiers!="") { + if (methods[i].qualifiers!="") { - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color")); class_desc->add_text(" "); - _add_text(cd.methods[i].qualifiers); + _add_text(methods[i].qualifiers); class_desc->pop(); } @@ -1192,10 +1327,10 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { class_desc->pop(); class_desc->add_newline(); - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color")); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color")); class_desc->push_font( doc_font ); class_desc->push_indent(1); - _add_text(cd.methods[i].description); + _add_text(methods[i].description); class_desc->pop(); class_desc->pop(); class_desc->pop(); @@ -1272,7 +1407,7 @@ static void _add_text_to_rt(const String& p_bbcode,RichTextLabel *p_rt) { DocData *doc = EditorHelp::get_doc_data(); String base_path; - /*p_rt->push_color(EditorSettings::get_singleton()->get("text_editor/text_color")); + /*p_rt->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/text_color")); p_rt->push_font( get_font("normal","Fonts") ); p_rt->push_indent(1);*/ int pos = 0; @@ -1388,7 +1523,7 @@ static void _add_text_to_rt(const String& p_bbcode,RichTextLabel *p_rt) { } else if (tag.begins_with("method ")) { String m = tag.substr(7,tag.length()); - p_rt->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); + p_rt->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color")); p_rt->push_meta("@"+m); p_rt->add_text(m+"()"); p_rt->pop(); @@ -1398,7 +1533,7 @@ static void _add_text_to_rt(const String& p_bbcode,RichTextLabel *p_rt) { } else if (doc->class_list.has(tag)) { - p_rt->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); + p_rt->push_color(EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color")); p_rt->push_meta("#"+tag); p_rt->add_text(tag); p_rt->pop(); @@ -1414,7 +1549,7 @@ static void _add_text_to_rt(const String& p_bbcode,RichTextLabel *p_rt) { } else if (tag=="i") { //use italics font - Color text_color = EditorSettings::get_singleton()->get("text_editor/text_color"); + Color text_color = EditorSettings::get_singleton()->get("text_editor/highlighting/text_color"); //no italics so emphasize with color text_color.r*=1.1; text_color.g*=1.1; @@ -1629,7 +1764,7 @@ void EditorHelp::_search_cbk() { _search(search->get_text()); } -String EditorHelp::get_class_name() { +String EditorHelp::get_class() { return edited_class; } @@ -1640,27 +1775,27 @@ void EditorHelp::search_again() { int EditorHelp::get_scroll() const { - return class_desc->get_v_scroll()->get_val(); + return class_desc->get_v_scroll()->get_value(); } void EditorHelp::set_scroll(int p_scroll) { - class_desc->get_v_scroll()->set_val(p_scroll); + class_desc->get_v_scroll()->set_value(p_scroll); } void EditorHelp::_bind_methods() { - ObjectTypeDB::bind_method("_class_list_select",&EditorHelp::_class_list_select); - ObjectTypeDB::bind_method("_class_desc_select",&EditorHelp::_class_desc_select); - ObjectTypeDB::bind_method("_class_desc_input",&EditorHelp::_class_desc_input); -// ObjectTypeDB::bind_method("_button_pressed",&EditorHelp::_button_pressed); - ObjectTypeDB::bind_method("_scroll_changed",&EditorHelp::_scroll_changed); - ObjectTypeDB::bind_method("_request_help",&EditorHelp::_request_help); - ObjectTypeDB::bind_method("_unhandled_key_input",&EditorHelp::_unhandled_key_input); - ObjectTypeDB::bind_method("_search",&EditorHelp::_search); - ObjectTypeDB::bind_method("_search_cbk",&EditorHelp::_search_cbk); - ObjectTypeDB::bind_method("_help_callback",&EditorHelp::_help_callback); + ClassDB::bind_method("_class_list_select",&EditorHelp::_class_list_select); + ClassDB::bind_method("_class_desc_select",&EditorHelp::_class_desc_select); + ClassDB::bind_method("_class_desc_input",&EditorHelp::_class_desc_input); +// ClassDB::bind_method("_button_pressed",&EditorHelp::_button_pressed); + ClassDB::bind_method("_scroll_changed",&EditorHelp::_scroll_changed); + ClassDB::bind_method("_request_help",&EditorHelp::_request_help); + ClassDB::bind_method("_unhandled_key_input",&EditorHelp::_unhandled_key_input); + ClassDB::bind_method("_search",&EditorHelp::_search); + ClassDB::bind_method("_search_cbk",&EditorHelp::_search_cbk); + ClassDB::bind_method("_help_callback",&EditorHelp::_help_callback); ADD_SIGNAL(MethodInfo("go_to_help")); @@ -1672,7 +1807,7 @@ EditorHelp::EditorHelp() { VBoxContainer *vbc = this; - EDITOR_DEF("help/sort_functions_alphabetically",true); + EDITOR_DEF("text_editor/help/sort_functions_alphabetically",true); //class_list->connect("meta_clicked",this,"_class_list_select"); //class_list->set_selection_enabled(true); @@ -1680,7 +1815,7 @@ EditorHelp::EditorHelp() { { Panel *pc = memnew( Panel ); Ref<StyleBoxFlat> style( memnew( StyleBoxFlat ) ); - style->set_bg_color( EditorSettings::get_singleton()->get("text_editor/background_color") ); + style->set_bg_color( EditorSettings::get_singleton()->get("text_editor/highlighting/background_color") ); pc->set_v_size_flags(SIZE_EXPAND_FILL); pc->add_style_override("panel", style); //get_stylebox("normal","TextEdit")); vbc->add_child(pc); @@ -1688,7 +1823,7 @@ EditorHelp::EditorHelp() { pc->add_child(class_desc); class_desc->set_area_as_parent_rect(8); class_desc->connect("meta_clicked",this,"_class_desc_select"); - class_desc->connect("input_event",this,"_class_desc_input"); + class_desc->connect("gui_input",this,"_class_desc_input"); } class_desc->get_v_scroll()->connect("value_changed",this,"_scroll_changed"); @@ -1703,14 +1838,14 @@ EditorHelp::EditorHelp() { add_child(search_dialog); VBoxContainer *search_vb = memnew( VBoxContainer ); search_dialog->add_child(search_vb); - search_dialog->set_child_rect(search_vb); + search = memnew( LineEdit ); search_dialog->register_text_enter(search); search_vb->add_margin_child(TTR("Search Text"),search); search_dialog->get_ok()->set_text(TTR("Find")); search_dialog->connect("confirmed",this,"_search_cbk"); search_dialog->set_hide_on_ok(false); - search_dialog->set_self_opacity(0.8); + search_dialog->set_self_modulate(Color(1,1,1,0.8)); /*class_search = memnew( EditorHelpSearch(editor) ); @@ -1765,7 +1900,7 @@ void EditorHelpBit::_meta_clicked(String p_select) { void EditorHelpBit::_bind_methods() { - ObjectTypeDB::bind_method("_meta_clicked",&EditorHelpBit::_meta_clicked); + ClassDB::bind_method("_meta_clicked",&EditorHelpBit::_meta_clicked); ADD_SIGNAL(MethodInfo("request_hide")); } diff --git a/tools/editor/editor_help.h b/tools/editor/editor_help.h index b0dc2809fe..85bac27705 100644 --- a/tools/editor/editor_help.h +++ b/tools/editor/editor_help.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -47,7 +47,7 @@ class EditorNode; class EditorHelpSearch : public ConfirmationDialog { - OBJ_TYPE(EditorHelpSearch,ConfirmationDialog ) + GDCLASS(EditorHelpSearch,ConfirmationDialog ) EditorNode *editor; LineEdit *search_box; @@ -75,7 +75,7 @@ public: }; class EditorHelpIndex : public ConfirmationDialog { - OBJ_TYPE( EditorHelpIndex, ConfirmationDialog ); + GDCLASS( EditorHelpIndex, ConfirmationDialog ); LineEdit *search_box; Tree *class_list; @@ -104,7 +104,7 @@ public: class EditorHelp : public VBoxContainer { - OBJ_TYPE( EditorHelp, VBoxContainer ); + GDCLASS( EditorHelp, VBoxContainer ); enum Page { @@ -187,7 +187,7 @@ public: void popup_search(); void search_again(); - String get_class_name(); + String get_class(); void set_focused() { class_desc->grab_focus(); } @@ -202,7 +202,7 @@ public: class EditorHelpBit : public Panel { - OBJ_TYPE( EditorHelpBit, Panel); + GDCLASS( EditorHelpBit, Panel); RichTextLabel *rich_text; void _go_to_help(String p_what); diff --git a/tools/editor/editor_icons.h b/tools/editor/editor_icons.h index 191b908682..7e8d8c0828 100644 --- a/tools/editor/editor_icons.h +++ b/tools/editor/editor_icons.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_import_export.cpp b/tools/editor/editor_import_export.cpp index d90a175811..0003e232c8 100644 --- a/tools/editor/editor_import_export.cpp +++ b/tools/editor/editor_import_export.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -46,8 +46,8 @@ String EditorImportPlugin::validate_source_path(const String& p_path) { - String gp = Globals::get_singleton()->globalize_path(p_path); - String rp = Globals::get_singleton()->get_resource_path(); + String gp = GlobalConfig::get_singleton()->globalize_path(p_path); + String rp = GlobalConfig::get_singleton()->get_resource_path(); if (!rp.ends_with("/")) rp+="/"; @@ -57,7 +57,7 @@ String EditorImportPlugin::validate_source_path(const String& p_path) { String EditorImportPlugin::expand_source_path(const String& p_path) { if (p_path.is_rel_path()) { - return Globals::get_singleton()->get_resource_path().plus_file(p_path).simplify_path(); + return GlobalConfig::get_singleton()->get_resource_path().plus_file(p_path).simplify_path(); } else { return p_path; } @@ -77,17 +77,17 @@ String EditorImportPlugin::_expand_source_path(const String& p_path) { void EditorImportPlugin::_bind_methods() { - ObjectTypeDB::bind_method(_MD("validate_source_path","path"),&EditorImportPlugin::_validate_source_path); - ObjectTypeDB::bind_method(_MD("expand_source_path","path"),&EditorImportPlugin::_expand_source_path); + ClassDB::bind_method(_MD("validate_source_path","path"),&EditorImportPlugin::_validate_source_path); + ClassDB::bind_method(_MD("expand_source_path","path"),&EditorImportPlugin::_expand_source_path); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::STRING,"get_name")); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::STRING,"get_visible_name")); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("import_dialog",PropertyInfo(Variant::STRING,"from"))); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::INT,"import",PropertyInfo(Variant::STRING,"path"),PropertyInfo(Variant::OBJECT,"from",PROPERTY_HINT_RESOURCE_TYPE,"ResourceImportMetadata"))); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::RAW_ARRAY,"custom_export",PropertyInfo(Variant::STRING,"path"),PropertyInfo(Variant::OBJECT,"platform",PROPERTY_HINT_RESOURCE_TYPE,"EditorExportPlatform"))); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("import_from_drop",PropertyInfo(Variant::STRING_ARRAY,"files"),PropertyInfo(Variant::STRING,"dest_path"))); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("reimport_multiple_files",PropertyInfo(Variant::STRING_ARRAY,"files"))); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::BOOL,"can_reimport_multiple_files")); + ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::STRING,"get_name")); + ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::STRING,"get_visible_name")); + ClassDB::add_virtual_method(get_class_static(),MethodInfo("import_dialog",PropertyInfo(Variant::STRING,"from"))); + ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::INT,"import",PropertyInfo(Variant::STRING,"path"),PropertyInfo(Variant::OBJECT,"from",PROPERTY_HINT_RESOURCE_TYPE,"ResourceImportMetadata"))); + ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::POOL_BYTE_ARRAY,"custom_export",PropertyInfo(Variant::STRING,"path"),PropertyInfo(Variant::OBJECT,"platform",PROPERTY_HINT_RESOURCE_TYPE,"EditorExportPlatform"))); + ClassDB::add_virtual_method(get_class_static(),MethodInfo("import_from_drop",PropertyInfo(Variant::POOL_STRING_ARRAY,"files"),PropertyInfo(Variant::STRING,"dest_path"))); + ClassDB::add_virtual_method(get_class_static(),MethodInfo("reimport_multiple_files",PropertyInfo(Variant::POOL_STRING_ARRAY,"files"))); + ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::BOOL,"can_reimport_multiple_files")); // BIND_VMETHOD( mi ); } @@ -175,7 +175,7 @@ EditorImportPlugin::EditorImportPlugin() { void EditorExportPlugin::_bind_methods() { MethodInfo mi = MethodInfo("custom_export:Variant",PropertyInfo(Variant::STRING,"name"),PropertyInfo(Variant::OBJECT,"platform",PROPERTY_HINT_RESOURCE_TYPE,"EditorExportPlatform")); - mi.return_val.type=Variant::RAW_ARRAY; + mi.return_val.type=Variant::POOL_BYTE_ARRAY; BIND_VMETHOD( mi ); } @@ -188,7 +188,7 @@ Vector<uint8_t> EditorExportPlugin::custom_export(String& p_path,const Ref<Edito Variant d = get_script_instance()->call("custom_export",p_path,p_platform); if (d.get_type()==Variant::NIL) return Vector<uint8_t>(); - if (d.get_type()==Variant::RAW_ARRAY) + if (d.get_type()==Variant::POOL_BYTE_ARRAY) return d; ERR_FAIL_COND_V(d.get_type()!=Variant::DICTIONARY,Vector<uint8_t>()); @@ -765,7 +765,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func { MD5_CTX ctx; MD5Init(&ctx); - String path = Globals::get_singleton()->get_resource_path()+"::"+String(E->get())+"::"+get_name(); + String path = GlobalConfig::get_singleton()->get_resource_path()+"::"+String(E->get())+"::"+get_name(); MD5Update(&ctx,(unsigned char*)path.utf8().get_data(),path.utf8().length()); MD5Final(&ctx); md5 = String::md5(ctx.digest); @@ -783,7 +783,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func if (atlas_valid) { //compare options - Dictionary options; + /*Dictionary options; options.parse_json(f->get_line()); if (!options.has("lossy_quality") || float(options["lossy_quality"])!=group_lossy_quality) atlas_valid=false; @@ -794,7 +794,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func if (!atlas_valid) print_line("JSON INVALID"); - +*/ } @@ -874,11 +874,11 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func int flags=0; - if (Globals::get_singleton()->get("image_loader/filter")) + if (GlobalConfig::get_singleton()->get("image_loader/filter")) flags|=EditorTextureImportPlugin::IMAGE_FLAG_FILTER; - if (!Globals::get_singleton()->get("image_loader/gen_mipmaps")) + if (!GlobalConfig::get_singleton()->get("image_loader/gen_mipmaps")) flags|=EditorTextureImportPlugin::IMAGE_FLAG_NO_MIPMAPS; - if (!Globals::get_singleton()->get("image_loader/repeat")) + if (!GlobalConfig::get_singleton()->get("image_loader/repeat")) flags|=EditorTextureImportPlugin::IMAGE_FLAG_REPEAT; flags|=EditorTextureImportPlugin::IMAGE_FLAG_FIX_BORDER_ALPHA; @@ -921,7 +921,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func options["lossy_quality"]=group_lossy_quality; options["shrink"]=EditorImportExport::get_singleton()->image_export_group_get_shrink(E->get()); options["image_format"]=group_format; - f->store_line(options.to_json()); +// f->store_line(options.to_json()); f->store_line(image_list_md5); } @@ -987,7 +987,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func StringName engine_cfg="res://engine.cfg"; StringName boot_splash; { - String splash=Globals::get_singleton()->get("application/boot_splash"); //avoid splash from being converted + String splash=GlobalConfig::get_singleton()->get("application/boot_splash"); //avoid splash from being converted splash=splash.strip_edges(); if (splash!=String()) { if (!splash.begins_with("res://")) @@ -998,7 +998,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func } StringName custom_cursor; { - String splash=Globals::get_singleton()->get("display/custom_mouse_cursor"); //avoid splash from being converted + String splash=GlobalConfig::get_singleton()->get("display/custom_mouse_cursor"); //avoid splash from being converted splash=splash.strip_edges(); if (splash!=String()) { if (!splash.begins_with("res://")) @@ -1084,7 +1084,7 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func String remap_file="engine.cfb"; String engine_cfb =EditorSettings::get_singleton()->get_settings_path()+"/tmp/tmp"+remap_file; - Globals::get_singleton()->save_custom(engine_cfb,custom); + GlobalConfig::get_singleton()->save_custom(engine_cfb,custom); Vector<uint8_t> data = FileAccess::get_file_as_array(engine_cfb); Error err = p_func(p_udata,"res://"+remap_file,data,counter,files.size()); @@ -1115,8 +1115,8 @@ void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags host="localhost"; if (p_flags&EXPORT_DUMB_CLIENT) { - int port = EditorSettings::get_singleton()->get("file_server/port"); - String passwd = EditorSettings::get_singleton()->get("file_server/password"); + int port = EditorSettings::get_singleton()->get("filesystem/file_server/port"); + String passwd = EditorSettings::get_singleton()->get("filesystem/file_server/password"); r_flags.push_back("-rfs"); r_flags.push_back(host+":"+itos(port)); if (passwd!="") { @@ -1129,7 +1129,7 @@ void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags r_flags.push_back("-rdebug"); - r_flags.push_back(host+":"+String::num(GLOBAL_DEF("debug/debug_port", 6007))); + r_flags.push_back(host+":"+String::num(GLOBAL_DEF("network/debug/remote_port", 6007))); List<String> breakpoints; ScriptEditor::get_singleton()->get_breakpoints(&breakpoints); @@ -2174,9 +2174,9 @@ bool EditorImportExport::sample_get_trim() const{ return sample_action_trim; } -DVector<String> EditorImportExport::_get_export_file_list() { +PoolVector<String> EditorImportExport::_get_export_file_list() { - DVector<String> fl; + PoolVector<String> fl; for (Map<StringName,FileAction>::Element *E=files.front();E;E=E->next()) { fl.push_back(E->key()); @@ -2185,9 +2185,9 @@ DVector<String> EditorImportExport::_get_export_file_list() { return fl; } -DVector<String> EditorImportExport::_get_export_platforms() { +PoolVector<String> EditorImportExport::_get_export_platforms() { - DVector<String> ep; + PoolVector<String> ep; for (Map<StringName,Ref<EditorExportPlatform> >::Element *E=exporters.front();E;E=E->next()) { ep.push_back(E->key()); @@ -2199,49 +2199,49 @@ DVector<String> EditorImportExport::_get_export_platforms() { void EditorImportExport::_bind_methods() { - ObjectTypeDB::bind_method(_MD("add_import_plugin","plugin:EditorImportPlugin"),&EditorImportExport::add_import_plugin); - ObjectTypeDB::bind_method(_MD("remove_import_plugin","plugin:EditorImportPlugin"),&EditorImportExport::remove_import_plugin); - ObjectTypeDB::bind_method(_MD("get_import_plugin_count"),&EditorImportExport::get_import_plugin_count); - ObjectTypeDB::bind_method(_MD("get_import_plugin:EditorImportPlugin","idx"),&EditorImportExport::get_import_plugin); - ObjectTypeDB::bind_method(_MD("get_import_plugin_by_name:EditorImportPlugin","name"),&EditorImportExport::get_import_plugin_by_name); - - ObjectTypeDB::bind_method(_MD("add_export_plugin","plugin:EditorExportPlugin"),&EditorImportExport::add_export_plugin); - ObjectTypeDB::bind_method(_MD("remove_export_plugin","plugin:EditorExportPlugin"),&EditorImportExport::remove_export_plugin); - ObjectTypeDB::bind_method(_MD("get_export_plugin_count"),&EditorImportExport::get_export_plugin_count); - ObjectTypeDB::bind_method(_MD("get_export_plugin:EditorExportPlugin","idx"),&EditorImportExport::get_export_plugin); - - ObjectTypeDB::bind_method(_MD("set_export_file_action","file","action"),&EditorImportExport::set_export_file_action); - ObjectTypeDB::bind_method(_MD("get_export_file_action","file"),&EditorImportExport::get_export_file_action); - ObjectTypeDB::bind_method(_MD("get_export_file_list"),&EditorImportExport::_get_export_file_list); - - ObjectTypeDB::bind_method(_MD("add_export_platform","platform:EditorExportplatform"),&EditorImportExport::add_export_platform); - //ObjectTypeDB::bind_method(_MD("remove_export_platform","platform:EditorExportplatform"),&EditorImportExport::add_export_platform); - ObjectTypeDB::bind_method(_MD("get_export_platform:EditorExportPlatform","name"),&EditorImportExport::get_export_platform); - ObjectTypeDB::bind_method(_MD("get_export_platforms"),&EditorImportExport::_get_export_platforms); - - ObjectTypeDB::bind_method(_MD("set_export_filter","filter"),&EditorImportExport::set_export_filter); - ObjectTypeDB::bind_method(_MD("get_export_filter"),&EditorImportExport::get_export_filter); - - ObjectTypeDB::bind_method(_MD("set_export_custom_filter","filter"),&EditorImportExport::set_export_custom_filter); - ObjectTypeDB::bind_method(_MD("get_export_custom_filter"),&EditorImportExport::get_export_custom_filter); - - ObjectTypeDB::bind_method(_MD("set_export_custom_filter_exclude","filter_exclude"),&EditorImportExport::set_export_custom_filter_exclude); - ObjectTypeDB::bind_method(_MD("get_export_custom_filter_exclude"),&EditorImportExport::get_export_custom_filter_exclude); - - - ObjectTypeDB::bind_method(_MD("image_export_group_create"),&EditorImportExport::image_export_group_create); - ObjectTypeDB::bind_method(_MD("image_export_group_remove"),&EditorImportExport::image_export_group_remove); - ObjectTypeDB::bind_method(_MD("image_export_group_set_image_action"),&EditorImportExport::image_export_group_set_image_action); - ObjectTypeDB::bind_method(_MD("image_export_group_set_make_atlas"),&EditorImportExport::image_export_group_set_make_atlas); - ObjectTypeDB::bind_method(_MD("image_export_group_set_shrink"),&EditorImportExport::image_export_group_set_shrink); - ObjectTypeDB::bind_method(_MD("image_export_group_get_image_action"),&EditorImportExport::image_export_group_get_image_action); - ObjectTypeDB::bind_method(_MD("image_export_group_get_make_atlas"),&EditorImportExport::image_export_group_get_make_atlas); - ObjectTypeDB::bind_method(_MD("image_export_group_get_shrink"),&EditorImportExport::image_export_group_get_shrink); - ObjectTypeDB::bind_method(_MD("image_add_to_export_group"),&EditorImportExport::image_add_to_export_group); - ObjectTypeDB::bind_method(_MD("script_set_action"),&EditorImportExport::script_set_action); - ObjectTypeDB::bind_method(_MD("script_set_encryption_key"),&EditorImportExport::script_set_encryption_key); - ObjectTypeDB::bind_method(_MD("script_get_action"),&EditorImportExport::script_get_action); - ObjectTypeDB::bind_method(_MD("script_get_encryption_key"),&EditorImportExport::script_get_encryption_key); + ClassDB::bind_method(_MD("add_import_plugin","plugin:EditorImportPlugin"),&EditorImportExport::add_import_plugin); + ClassDB::bind_method(_MD("remove_import_plugin","plugin:EditorImportPlugin"),&EditorImportExport::remove_import_plugin); + ClassDB::bind_method(_MD("get_import_plugin_count"),&EditorImportExport::get_import_plugin_count); + ClassDB::bind_method(_MD("get_import_plugin:EditorImportPlugin","idx"),&EditorImportExport::get_import_plugin); + ClassDB::bind_method(_MD("get_import_plugin_by_name:EditorImportPlugin","name"),&EditorImportExport::get_import_plugin_by_name); + + ClassDB::bind_method(_MD("add_export_plugin","plugin:EditorExportPlugin"),&EditorImportExport::add_export_plugin); + ClassDB::bind_method(_MD("remove_export_plugin","plugin:EditorExportPlugin"),&EditorImportExport::remove_export_plugin); + ClassDB::bind_method(_MD("get_export_plugin_count"),&EditorImportExport::get_export_plugin_count); + ClassDB::bind_method(_MD("get_export_plugin:EditorExportPlugin","idx"),&EditorImportExport::get_export_plugin); + + ClassDB::bind_method(_MD("set_export_file_action","file","action"),&EditorImportExport::set_export_file_action); + ClassDB::bind_method(_MD("get_export_file_action","file"),&EditorImportExport::get_export_file_action); + ClassDB::bind_method(_MD("get_export_file_list"),&EditorImportExport::_get_export_file_list); + + ClassDB::bind_method(_MD("add_export_platform","platform:EditorExportplatform"),&EditorImportExport::add_export_platform); + //ClassDB::bind_method(_MD("remove_export_platform","platform:EditorExportplatform"),&EditorImportExport::add_export_platform); + ClassDB::bind_method(_MD("get_export_platform:EditorExportPlatform","name"),&EditorImportExport::get_export_platform); + ClassDB::bind_method(_MD("get_export_platforms"),&EditorImportExport::_get_export_platforms); + + ClassDB::bind_method(_MD("set_export_filter","filter"),&EditorImportExport::set_export_filter); + ClassDB::bind_method(_MD("get_export_filter"),&EditorImportExport::get_export_filter); + + ClassDB::bind_method(_MD("set_export_custom_filter","filter"),&EditorImportExport::set_export_custom_filter); + ClassDB::bind_method(_MD("get_export_custom_filter"),&EditorImportExport::get_export_custom_filter); + + ClassDB::bind_method(_MD("set_export_custom_filter_exclude","filter_exclude"),&EditorImportExport::set_export_custom_filter_exclude); + ClassDB::bind_method(_MD("get_export_custom_filter_exclude"),&EditorImportExport::get_export_custom_filter_exclude); + + + ClassDB::bind_method(_MD("image_export_group_create"),&EditorImportExport::image_export_group_create); + ClassDB::bind_method(_MD("image_export_group_remove"),&EditorImportExport::image_export_group_remove); + ClassDB::bind_method(_MD("image_export_group_set_image_action"),&EditorImportExport::image_export_group_set_image_action); + ClassDB::bind_method(_MD("image_export_group_set_make_atlas"),&EditorImportExport::image_export_group_set_make_atlas); + ClassDB::bind_method(_MD("image_export_group_set_shrink"),&EditorImportExport::image_export_group_set_shrink); + ClassDB::bind_method(_MD("image_export_group_get_image_action"),&EditorImportExport::image_export_group_get_image_action); + ClassDB::bind_method(_MD("image_export_group_get_make_atlas"),&EditorImportExport::image_export_group_get_make_atlas); + ClassDB::bind_method(_MD("image_export_group_get_shrink"),&EditorImportExport::image_export_group_get_shrink); + ClassDB::bind_method(_MD("image_add_to_export_group"),&EditorImportExport::image_add_to_export_group); + ClassDB::bind_method(_MD("script_set_action"),&EditorImportExport::script_set_action); + ClassDB::bind_method(_MD("script_set_encryption_key"),&EditorImportExport::script_set_encryption_key); + ClassDB::bind_method(_MD("script_get_action"),&EditorImportExport::script_get_action); + ClassDB::bind_method(_MD("script_get_encryption_key"),&EditorImportExport::script_get_encryption_key); diff --git a/tools/editor/editor_import_export.h b/tools/editor/editor_import_export.h index e21fd8c8f8..fb75373f17 100644 --- a/tools/editor/editor_import_export.h +++ b/tools/editor/editor_import_export.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -40,7 +40,7 @@ struct EditorProgress; class EditorImportPlugin : public Reference { - OBJ_TYPE( EditorImportPlugin, Reference); + GDCLASS( EditorImportPlugin, Reference); protected: @@ -70,7 +70,7 @@ public: class EditorExportPlugin : public Reference { - OBJ_TYPE( EditorExportPlugin, Reference); + GDCLASS( EditorExportPlugin, Reference); protected: static void _bind_methods(); @@ -84,7 +84,7 @@ public: class EditorExportPlatform : public Reference { - OBJ_TYPE( EditorExportPlatform,Reference ); + GDCLASS( EditorExportPlatform,Reference ); public: @@ -187,7 +187,7 @@ public: class EditorExportPlatformPC : public EditorExportPlatform { - OBJ_TYPE( EditorExportPlatformPC,EditorExportPlatform ); + GDCLASS( EditorExportPlatformPC,EditorExportPlatform ); public: @@ -247,7 +247,7 @@ public: class EditorImportExport : public Node { - OBJ_TYPE(EditorImportExport,Node); + GDCLASS(EditorImportExport,Node); public: enum FileAction { @@ -321,8 +321,8 @@ protected: static EditorImportExport* singleton; - DVector<String> _get_export_file_list(); - DVector<String> _get_export_platforms(); + PoolVector<String> _get_export_file_list(); + PoolVector<String> _get_export_platforms(); static void _bind_methods(); public: diff --git a/tools/editor/editor_initialize_ssl.cpp b/tools/editor/editor_initialize_ssl.cpp index c0b55b302f..9ac4f90e9f 100644 --- a/tools/editor/editor_initialize_ssl.cpp +++ b/tools/editor/editor_initialize_ssl.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,11 +34,12 @@ void editor_initialize_certificates() { - ByteArray data; - data.resize(_certs_uncompressed_size); + PoolByteArray data; + data.resize(_certs_uncompressed_size+1); { - ByteArray::Write w = data.write(); + PoolByteArray::Write w = data.write(); Compression::decompress(w.ptr(),_certs_uncompressed_size,_certs_compressed,_certs_compressed_size,Compression::MODE_DEFLATE); + w[_certs_uncompressed_size]=0; //make sure it ends at zero } StreamPeerSSL::load_certs_from_memory(data); diff --git a/tools/editor/editor_initialize_ssl.h b/tools/editor/editor_initialize_ssl.h index 082d546832..0b34ac1d7e 100644 --- a/tools/editor/editor_initialize_ssl.h +++ b/tools/editor/editor_initialize_ssl.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_log.cpp b/tools/editor/editor_log.cpp index 02af9712a8..06459928f0 100644 --- a/tools/editor/editor_log.cpp +++ b/tools/editor/editor_log.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -67,6 +67,10 @@ void EditorLog::_error_handler(void *p_self, const char*p_func, const char*p_fil icon = self->get_icon("ScriptError","EditorIcons"); } break; + case ERR_HANDLER_SHADER: { + + icon = self->get_icon("Shader","EditorIcons"); + } break; } @@ -160,9 +164,9 @@ void EditorLog::_undo_redo_cbk(void *p_self,const String& p_name) { void EditorLog::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_clear_request"),&EditorLog::_clear_request ); - ObjectTypeDB::bind_method("_override_logger_styles",&EditorLog::_override_logger_styles ); - //ObjectTypeDB::bind_method(_MD("_dragged"),&EditorLog::_dragged ); + ClassDB::bind_method(_MD("_clear_request"),&EditorLog::_clear_request ); + ClassDB::bind_method("_override_logger_styles",&EditorLog::_override_logger_styles ); + //ClassDB::bind_method(_MD("_dragged"),&EditorLog::_dragged ); ADD_SIGNAL( MethodInfo("clear_request")); } @@ -203,7 +207,7 @@ EditorLog::EditorLog() { log->set_selection_enabled(true); log->set_focus_mode(FOCUS_CLICK); pc->add_child(log); - add_message(VERSION_FULL_NAME" (c) 2008-2016 Juan Linietsky, Ariel Manzur."); + add_message(VERSION_FULL_NAME" (c) 2008-2017 Juan Linietsky, Ariel Manzur."); //log->add_text("Initialization Complete.\n"); //because it looks cool. eh.errfunc=_error_handler; diff --git a/tools/editor/editor_log.h b/tools/editor/editor_log.h index bbf35b63cb..e59b877ea0 100644 --- a/tools/editor/editor_log.h +++ b/tools/editor/editor_log.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -42,7 +42,7 @@ #include "os/thread.h" class EditorLog : public VBoxContainer { - OBJ_TYPE( EditorLog, VBoxContainer ); + GDCLASS( EditorLog, VBoxContainer ); Button *clearbutton; Label *title; diff --git a/tools/editor/editor_name_dialog.cpp b/tools/editor/editor_name_dialog.cpp index c221b908e0..e7dcea4d40 100644 --- a/tools/editor/editor_name_dialog.cpp +++ b/tools/editor/editor_name_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,7 +31,7 @@ #include "object_type_db.h" #include "os/keyboard.h" -void EditorNameDialog::_line_input_event(const InputEvent& p_event) { +void EditorNameDialog::_line_gui_input(const InputEvent& p_event) { if (p_event.type == InputEvent::KEY) { @@ -72,7 +72,7 @@ void EditorNameDialog::ok_pressed() { void EditorNameDialog::_bind_methods() { - ObjectTypeDB::bind_method("_line_input_event",&EditorNameDialog::_line_input_event); + ClassDB::bind_method("_line_gui_input",&EditorNameDialog::_line_gui_input); ADD_SIGNAL(MethodInfo("name_confirmed",PropertyInfo( Variant::STRING,"name"))); } @@ -85,5 +85,5 @@ EditorNameDialog::EditorNameDialog() name->set_margin(MARGIN_TOP,5); name->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_BEGIN,5); name->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_END,5); - name->connect("input_event", this, "_line_input_event"); + name->connect("gui_input", this, "_line_gui_input"); } diff --git a/tools/editor/editor_name_dialog.h b/tools/editor/editor_name_dialog.h index 9e66908899..d6bc7eca94 100644 --- a/tools/editor/editor_name_dialog.h +++ b/tools/editor/editor_name_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,11 +35,11 @@ class EditorNameDialog : public ConfirmationDialog { - OBJ_TYPE( EditorNameDialog, ConfirmationDialog ); + GDCLASS( EditorNameDialog, ConfirmationDialog ); LineEdit *name; - void _line_input_event(const InputEvent& p_event); + void _line_gui_input(const InputEvent& p_event); protected: diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 5a3deb7b9d..096999d5e7 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -99,6 +99,7 @@ #include "plugins/light_occluder_2d_editor_plugin.h" #include "plugins/color_ramp_editor_plugin.h" #include "plugins/collision_shape_2d_editor_plugin.h" +#include "plugins/gi_probe_editor_plugin.h" #include "main/input_default.h" // end #include "tools/editor/editor_settings.h" @@ -119,7 +120,7 @@ EditorNode *EditorNode::singleton=NULL; void EditorNode::_update_scene_tabs() { - bool show_rb = EditorSettings::get_singleton()->get("global/show_script_in_scene_tabs"); + bool show_rb = EditorSettings::get_singleton()->get("interface/show_script_in_scene_tabs"); scene_tabs->clear_tabs(); Ref<Texture> script_icon = gui_base->get_icon("Script","EditorIcons"); @@ -156,7 +157,7 @@ void EditorNode::_update_scene_tabs() { void EditorNode::_update_title() { - String appname = Globals::get_singleton()->get("application/name"); + String appname = GlobalConfig::get_singleton()->get("application/name"); String title = appname.empty()?String(VERSION_FULL_NAME):String(_MKSTR(VERSION_NAME) + String(" - ") + appname); String edited = editor_data.get_edited_scene_root()?editor_data.get_edited_scene_root()->get_filename():String(); if (!edited.empty()) @@ -267,16 +268,14 @@ void EditorNode::_notification(int p_what) { circle_step=0; circle_step_msec=tick; - circle_step_frame=frame+1; + circle_step_frame=frame+1; - // update the circle itself only when its enabled - if (!update_menu->get_popup()->is_item_checked(3)){ - update_menu->set_icon(gui_base->get_icon("Progress"+itos(circle_step+1),"EditorIcons")); - } + // update the circle itself only when its enabled + if (!update_menu->get_popup()->is_item_checked(3)){ + update_menu->set_icon(gui_base->get_icon("Progress"+itos(circle_step+1),"EditorIcons")); + } } - scene_root->set_size_override(true,Size2(Globals::get_singleton()->get("display/width"),Globals::get_singleton()->get("display/height"))); - editor_selection->update(); { @@ -286,16 +285,16 @@ void EditorNode::_notification(int p_what) { if (peak<-80) peak=-80; - float vu = audio_vu->get_val(); + float vu = audio_vu->get_value(); if (peak > vu) { - audio_vu->set_val(peak); + audio_vu->set_value(peak); } else { float new_vu = vu - get_process_delta_time()*70.0; if (new_vu<-80) new_vu=-80; if (new_vu !=-80 && vu !=-80) - audio_vu->set_val(new_vu); + audio_vu->set_value(new_vu); } } @@ -303,7 +302,7 @@ void EditorNode::_notification(int p_what) { } if (p_what==NOTIFICATION_ENTER_TREE) { - + get_tree()->get_root()->set_disable_3d(true); //MessageQueue::get_singleton()->push_call(this,"_get_scene_metadata"); get_tree()->set_editor_hint(true); get_tree()->get_root()->set_as_audio_listener(false); @@ -392,7 +391,7 @@ void EditorNode::_notification(int p_what) { } */ - if (bool(EDITOR_DEF("resources/auto_reload_modified_images",true))) { + if (bool(EDITOR_DEF("filesystem/resources/auto_reload_modified_images",true))) { _menu_option_confirm(DEPENDENCY_LOAD_CHANGED_IMAGES,true); } @@ -408,7 +407,7 @@ void EditorNode::_notification(int p_what) { }; if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { - scene_tabs->set_tab_close_display_policy( (bool(EDITOR_DEF("global/always_show_close_button_in_scene_tabs", false)) ? Tabs::CLOSE_BUTTON_SHOW_ALWAYS : Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY) ); + scene_tabs->set_tab_close_display_policy( (bool(EDITOR_DEF("interface/always_show_close_button_in_scene_tabs", false)) ? Tabs::CLOSE_BUTTON_SHOW_ALWAYS : Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY) ); } } @@ -435,7 +434,7 @@ void EditorNode::_fs_changed() { void EditorNode::_sources_changed(bool p_exist) { - if (p_exist && bool(EditorSettings::get_singleton()->get("import/automatic_reimport_on_sources_changed"))) { + if (p_exist && bool(EditorSettings::get_singleton()->get("filesystem/import/automatic_reimport_on_sources_changed"))) { p_exist=false; List<String> changed_sources; @@ -556,12 +555,12 @@ void EditorNode::save_resource_in_path(const Ref<Resource>& p_resource,const Str editor_data.apply_changes_in_editors(); int flg=0; - if (EditorSettings::get_singleton()->get("on_save/compress_binary_resources")) + if (EditorSettings::get_singleton()->get("filesystem/on_save/compress_binary_resources")) flg|=ResourceSaver::FLAG_COMPRESS; - //if (EditorSettings::get_singleton()->get("on_save/save_paths_as_relative")) + //if (EditorSettings::get_singleton()->get("filesystem/on_save/save_paths_as_relative")) // flg|=ResourceSaver::FLAG_RELATIVE_PATHS; - String path = Globals::get_singleton()->localize_path(p_path); + String path = GlobalConfig::get_singleton()->localize_path(p_path); Error err = ResourceSaver::save(path,p_resource,flg|ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS); if (err!=OK) { @@ -598,7 +597,7 @@ void EditorNode::save_resource_as(const Ref<Resource>& p_resource,const String& List<String> preferred; for(int i=0;i<extensions.size();i++) { - if (p_resource->is_type("Script") && (extensions[i]=="tres" || extensions[i]=="res" || extensions[i]=="xml")) { + if (p_resource->is_class("Script") && (extensions[i]=="tres" || extensions[i]=="res" || extensions[i]=="xml")) { //this serves no purpose and confused people continue; } @@ -615,7 +614,7 @@ void EditorNode::save_resource_as(const Ref<Resource>& p_resource,const String& file->set_current_file(p_resource->get_path().get_file()); } else { if (extensions.size()) { - file->set_current_file("new_"+p_resource->get_type().to_lower()+"."+preferred.front()->get().to_lower()); + file->set_current_file("new_"+p_resource->get_class().to_lower()+"."+preferred.front()->get().to_lower()); } else { file->set_current_file(String()); } @@ -633,7 +632,7 @@ void EditorNode::save_resource_as(const Ref<Resource>& p_resource,const String& String existing; if (extensions.size()) { - existing="new_"+p_resource->get_type().to_lower()+"."+preferred.front()->get().to_lower(); + existing="new_"+p_resource->get_class().to_lower()+"."+preferred.front()->get().to_lower(); } file->set_current_path(existing); @@ -865,12 +864,12 @@ void EditorNode::_save_edited_subresources(Node* scene,Map<RES,bool>& processed, void EditorNode::_find_node_types(Node* p_node, int&count_2d, int&count_3d) { - if (p_node->is_type("Viewport") || (p_node!=editor_data.get_edited_scene_root() && p_node->get_owner()!=editor_data.get_edited_scene_root())) + if (p_node->is_class("Viewport") || (p_node!=editor_data.get_edited_scene_root() && p_node->get_owner()!=editor_data.get_edited_scene_root())) return; - if (p_node->is_type("CanvasItem")) + if (p_node->is_class("CanvasItem")) count_2d++; - else if (p_node->is_type("Spatial")) + else if (p_node->is_class("Spatial")) count_3d++; for(int i=0;i<p_node->get_child_count();i++) @@ -910,11 +909,12 @@ void EditorNode::_save_scene_with_preview(String p_file) { _editor_select(is2d?EDITOR_2D:EDITOR_3D); - VS::get_singleton()->viewport_queue_screen_capture(viewport); + save.step(TTR("Creating Thumbnail"),2); save.step(TTR("Creating Thumbnail"),3); - Image img = VS::get_singleton()->viewport_get_screen_capture(viewport); - int preview_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size");; +#if 0 + Image img = VS::get_singleton()->viewport_texture(scree_capture(viewport); + int preview_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size");; preview_size*=EDSCALE; int width,height; if (img.get_width() > preview_size && img.get_width() >= img.get_height()) { @@ -931,7 +931,7 @@ void EditorNode::_save_scene_with_preview(String p_file) { height=img.get_height(); } - img.convert(Image::FORMAT_RGB); + img.convert(Image::FORMAT_RGB8); img.resize(width,height); String pfile = EditorSettings::get_singleton()->get_settings_path().plus_file("tmp/last_scene_preview.png"); @@ -943,7 +943,7 @@ void EditorNode::_save_scene_with_preview(String p_file) { if (editor_data.get_edited_scene_import_metadata().is_null()) editor_data.set_edited_scene_import_metadata(Ref<ResourceImportMetadata>( memnew( ResourceImportMetadata ) ) ); editor_data.get_edited_scene_import_metadata()->set_option("thumbnail",imgdata); - +#endif //tamanio tel thumbnail if (screen!=-1) { _editor_select(screen); @@ -1003,9 +1003,9 @@ void EditorNode::_save_scene(String p_file, int idx) { sdata->set_import_metadata(editor_data.get_edited_scene_import_metadata(idx)); int flg=0; - if (EditorSettings::get_singleton()->get("on_save/compress_binary_resources")) + if (EditorSettings::get_singleton()->get("filesystem/on_save/compress_binary_resources")) flg|=ResourceSaver::FLAG_COMPRESS; - //if (EditorSettings::get_singleton()->get("on_save/save_paths_as_relative")) + //if (EditorSettings::get_singleton()->get("filesystem/on_save/save_paths_as_relative")) // flg|=ResourceSaver::FLAG_RELATIVE_PATHS; flg|=ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS; @@ -1015,7 +1015,7 @@ void EditorNode::_save_scene(String p_file, int idx) { _save_edited_subresources(scene,processed,flg); editor_data.save_editor_external_data(); if (err==OK) { - scene->set_filename( Globals::get_singleton()->localize_path(p_file) ); + scene->set_filename( GlobalConfig::get_singleton()->localize_path(p_file) ); //EditorFileSystem::get_singleton()->update_file(p_file,sdata->get_type()); if (idx < 0 || idx == editor_data.get_edited_scene()) set_current_version(editor_data.get_undo_redo().get_version()); @@ -1059,7 +1059,7 @@ void EditorNode::_import_action(const String& p_action) { EditorImport::generate_version_hashes(src); - Node *dst = SceneLoader::load(editor_data.get_imported_scene(Globals::get_singleton()->localize_path(_tmp_import_path))); + Node *dst = SceneLoader::load(editor_data.get_imported_scene(GlobalConfig::get_singleton()->localize_path(_tmp_import_path))); if (!dst) { @@ -1167,9 +1167,8 @@ void EditorNode::_dialog_action(String p_file) { } break; case SETTINGS_PICK_MAIN_SCENE: { - Globals::get_singleton()->set("application/main_scene",p_file); - Globals::get_singleton()->set_persisting("application/main_scene",true); - Globals::get_singleton()->save(); + GlobalConfig::get_singleton()->set("application/main_scene",p_file); + GlobalConfig::get_singleton()->save(); //would be nice to show the project manager opened with the hilighted field.. } break; case FILE_SAVE_OPTIMIZED: { @@ -1246,7 +1245,7 @@ void EditorNode::_dialog_action(String p_file) { ml = Ref<MeshLibrary>( memnew( MeshLibrary )); } - MeshLibraryEditor::update_library_file(editor_data.get_edited_scene_root(),ml,true); +// MeshLibraryEditor::update_library_file(editor_data.get_edited_scene_root(),ml,true); Error err = ResourceSaver::save(p_file,ml); if (err) { @@ -1511,8 +1510,8 @@ void EditorNode::_prepare_history() { already.insert(id); Ref<Texture> icon = gui_base->get_icon("Object","EditorIcons"); - if (gui_base->has_icon(obj->get_type(),"EditorIcons")) - icon=gui_base->get_icon(obj->get_type(),"EditorIcons"); + if (gui_base->has_icon(obj->get_class(),"EditorIcons")) + icon=gui_base->get_icon(obj->get_class(),"EditorIcons"); else icon=base_icon; @@ -1524,12 +1523,12 @@ void EditorNode::_prepare_history() { else if (r->get_name()!=String()) { text=r->get_name(); } else { - text=r->get_type(); + text=r->get_class(); } } else if (obj->cast_to<Node>()) { text=obj->cast_to<Node>()->get_name(); } else { - text=obj->get_type(); + text=obj->get_class(); } if (i==editor_history.get_history_pos()) { @@ -1617,8 +1616,8 @@ void EditorNode::_edit_current() { object_menu->set_disabled(true); - bool is_resource = current_obj->is_type("Resource"); - bool is_node = current_obj->is_type("Node"); + bool is_resource = current_obj->is_class("Resource"); + bool is_node = current_obj->is_class("Node"); resource_save_button->set_disabled(!is_resource); if (is_resource) { @@ -1668,7 +1667,7 @@ void EditorNode::_edit_current() { if (main_plugin) { // special case if use of external editor is true - if (main_plugin->get_name() == "Script" && bool(EditorSettings::get_singleton()->get("external_editor/use_external_editor"))){ + if (main_plugin->get_name() == "Script" && bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor"))){ main_plugin->edit(current_obj); } @@ -1848,7 +1847,6 @@ void EditorNode::_run(bool p_current,const String& p_custom) { run_filename=scene->get_filename(); } else { - args=run_settings_dialog->get_custom_arguments(); current_filename=scene->get_filename(); } @@ -1893,7 +1891,7 @@ void EditorNode::_run(bool p_current,const String& p_custom) { } - if (bool(EDITOR_DEF("run/auto_save_before_running",true))) { + if (bool(EDITOR_DEF("run/auto_save/save_before_running",true))) { if (unsaved_cache) { @@ -1923,9 +1921,14 @@ void EditorNode::_run(bool p_current,const String& p_custom) { log->clear(); } + if (bool(EDITOR_DEF("run/always_open_output_on_play", true))) { + make_bottom_panel_item_visible(log); + } List<String> breakpoints; editor_data.get_editor_breakpoints(&breakpoints); + + args = GlobalConfig::get_singleton()->get("editor/main_run_args"); Error error = editor_run.run(run_filename,args,breakpoints,current_filename); @@ -2494,7 +2497,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { } instanced_scene->generate_instance_state(); - instanced_scene->set_filename( Globals::get_singleton()->localize_path(external_file) ); + instanced_scene->set_filename( GlobalConfig::get_singleton()->localize_path(external_file) ); editor_data.get_undo_redo().create_action("Instance Scene"); editor_data.get_undo_redo().add_do_method(parent,"add_child",instanced_scene); @@ -2577,7 +2580,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { if (current) { _editor_select(EDITOR_SCRIPT); - emit_signal("request_help",current->get_type()); + emit_signal("request_help",current->get_class()); } @@ -2635,12 +2638,6 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { _set_editing_top_editors(current); } break; - case OBJECT_CALL_METHOD: { - - editor_data.apply_changes_in_editors();; - call_dialog->set_object(current); - call_dialog->popup_centered_ratio(); - } break; case RUN_PLAY: { _menu_option_confirm(RUN_STOP,true); _call_build(); @@ -2685,7 +2682,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) { } break; case RUN_PLAY_NATIVE: { - bool autosave = EDITOR_DEF("run/auto_save_before_running",true); + bool autosave = EDITOR_DEF("run/auto_save/save_before_running",true); if (autosave) { _menu_option_confirm(FILE_SAVE_ALL_SCENES, false); } @@ -3078,11 +3075,9 @@ void EditorNode::_update_addon_config() { } if (enabled_addons.size()==0) { - Globals::get_singleton()->set("editor_plugins/enabled",Variant()); - Globals::get_singleton()->set_persisting("editor_plugins/enabled",false); + GlobalConfig::get_singleton()->set("editor_plugins/enabled",Variant()); } else { - Globals::get_singleton()->set("editor_plugins/enabled",enabled_addons); - Globals::get_singleton()->set_persisting("editor_plugins/enabled",true); + GlobalConfig::get_singleton()->set("editor_plugins/enabled",enabled_addons); } project_settings->queue_save(); @@ -3275,7 +3270,7 @@ Error EditorNode::save_translatable_strings(const String& p_to_file) { OS::Time time = OS::get_singleton()->get_time(); f->store_line("# Translation Strings Dump."); f->store_line("# Created By."); - f->store_line("# \t" VERSION_FULL_NAME " (c) 2008-2016 Juan Linietsky, Ariel Manzur."); + f->store_line("# \t" VERSION_FULL_NAME " (c) 2008-2017 Juan Linietsky, Ariel Manzur."); f->store_line("# From Scene: "); f->store_line("# \t"+get_edited_scene()->get_filename()); f->store_line(""); @@ -3347,7 +3342,7 @@ Error EditorNode::save_optimized_copy(const String& p_scene,const String& p_pres } - String src_scene=Globals::get_singleton()->localize_path(get_edited_scene()->get_filename()); + String src_scene=GlobalConfig::get_singleton()->localize_path(get_edited_scene()->get_filename()); String path=p_scene; @@ -3358,13 +3353,13 @@ Error EditorNode::save_optimized_copy(const String& p_scene,const String& p_pres print_line("rel path!?"); path=src_scene.get_base_dir()+"/"+path; } - path = Globals::get_singleton()->localize_path(path); + path = GlobalConfig::get_singleton()->localize_path(path); print_line("path: "+path); String preset = "optimizer_presets/"+p_preset; - if (!Globals::get_singleton()->has(preset)) { + if (!GlobalConfig::get_singleton()->has(preset)) { //accept->"()->hide(); accept->get_ok()->set_text("I see.."); @@ -3375,7 +3370,7 @@ Error EditorNode::save_optimized_copy(const String& p_scene,const String& p_pres } - Dictionary d = Globals::get_singleton()->get(preset); + Dictionary d = GlobalConfig::get_singleton()->get(preset); ERR_FAIL_COND_V(!d.has("__type__"),ERR_INVALID_DATA); String type=d["__type__"]; @@ -3464,8 +3459,8 @@ Dictionary EditorNode::_get_main_scene_state() { Dictionary state; state["main_tab"]=_get_current_main_editor(); - state["scene_tree_offset"]=scene_tree_dock->get_tree_editor()->get_scene_tree()->get_vscroll_bar()->get_val(); - state["property_edit_offset"]=get_property_editor()->get_scene_tree()->get_vscroll_bar()->get_val(); + state["scene_tree_offset"]=scene_tree_dock->get_tree_editor()->get_scene_tree()->get_vscroll_bar()->get_value(); + state["property_edit_offset"]=get_property_editor()->get_scene_tree()->get_vscroll_bar()->get_value(); state["saved_version"]=saved_version; state["node_filter"]=scene_tree_dock->get_filter(); //print_line(" getting main tab: "+itos(state["main_tab"])); @@ -3531,9 +3526,9 @@ void EditorNode::_set_main_scene_state(Dictionary p_state,Node* p_for_scene) { if (p_state.has("scene_tree_offset")) - scene_tree_dock->get_tree_editor()->get_scene_tree()->get_vscroll_bar()->set_val(p_state["scene_tree_offset"]); + scene_tree_dock->get_tree_editor()->get_scene_tree()->get_vscroll_bar()->set_value(p_state["scene_tree_offset"]); if (p_state.has("property_edit_offset")) - get_property_editor()->get_scene_tree()->get_vscroll_bar()->set_val(p_state["property_edit_offset"]); + get_property_editor()->get_scene_tree()->get_vscroll_bar()->set_value(p_state["property_edit_offset"]); if (p_state.has("node_filter")) scene_tree_dock->set_filter(p_state["node_filter"]); @@ -3661,7 +3656,7 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo if (p_clear_errors) load_errors->clear(); - String lpath = Globals::get_singleton()->localize_path(p_scene); + String lpath = GlobalConfig::get_singleton()->localize_path(p_scene); if (!lpath.begins_with("res://")) { @@ -3750,7 +3745,7 @@ Error EditorNode::load_scene(const String& p_scene, bool p_ignore_broken_deps,bo sdata->set_path(lpath,true); //take over path } - Node*new_scene=sdata->instance(true); + Node*new_scene=sdata->instance(PackedScene::GEN_EDIT_STATE_MAIN); if (!new_scene) { @@ -3952,7 +3947,7 @@ void EditorNode::animation_editor_make_visible(bool p_visible) { #endif void EditorNode::_add_to_recent_scenes(const String& p_scene) { - String base="_"+Globals::get_singleton()->get_resource_path().replace("\\","::").replace("/","::"); + String base="_"+GlobalConfig::get_singleton()->get_resource_path().replace("\\","::").replace("/","::"); Vector<String> rc = EDITOR_DEF(base+"/_recent_scenes",Array()); String name = p_scene; name=name.replace("res://",""); @@ -3970,7 +3965,7 @@ void EditorNode::_add_to_recent_scenes(const String& p_scene) { void EditorNode::_open_recent_scene(int p_idx) { - String base="_"+Globals::get_singleton()->get_resource_path().replace("\\","::").replace("/","::"); + String base="_"+GlobalConfig::get_singleton()->get_resource_path().replace("\\","::").replace("/","::"); Vector<String> rc = EDITOR_DEF(base+"/_recent_scenes",Array()); ERR_FAIL_INDEX(p_idx,rc.size()); @@ -4026,13 +4021,13 @@ void EditorNode::_save_optimized() { } - project_settings->add_remapped_path(Globals::get_singleton()->localize_path(get_edited_scene()->get_filename()),Globals::get_singleton()->localize_path(path),platform); + project_settings->add_remapped_path(GlobalConfig::get_singleton()->localize_path(get_edited_scene()->get_filename()),GlobalConfig::get_singleton()->localize_path(path),platform); #endif } void EditorNode::_update_recent_scenes() { - String base="_"+Globals::get_singleton()->get_resource_path().replace("\\","::").replace("/","::"); + String base="_"+GlobalConfig::get_singleton()->get_resource_path().replace("\\","::").replace("/","::"); Vector<String> rc = EDITOR_DEF(base+"/_recent_scenes",Array()); recent_scenes->clear(); for(int i=0;i<rc.size();i++) { @@ -4146,25 +4141,25 @@ bool EditorNode::is_scene_in_use(const String& p_path) { void EditorNode::register_editor_types() { - ObjectTypeDB::register_type<EditorPlugin>(); - ObjectTypeDB::register_type<EditorImportPlugin>(); - ObjectTypeDB::register_type<EditorExportPlugin>(); - ObjectTypeDB::register_type<EditorScenePostImport>(); - ObjectTypeDB::register_type<EditorScript>(); - ObjectTypeDB::register_type<EditorSelection>(); - ObjectTypeDB::register_type<EditorFileDialog>(); - //ObjectTypeDB::register_type<EditorImportExport>(); - ObjectTypeDB::register_type<EditorSettings>(); - ObjectTypeDB::register_type<EditorSpatialGizmo>(); - ObjectTypeDB::register_type<EditorResourcePreview>(); - ObjectTypeDB::register_type<EditorResourcePreviewGenerator>(); - ObjectTypeDB::register_type<EditorFileSystem>(); - ObjectTypeDB::register_type<EditorFileSystemDirectory>(); + ClassDB::register_class<EditorPlugin>(); + ClassDB::register_class<EditorImportPlugin>(); + ClassDB::register_class<EditorExportPlugin>(); + ClassDB::register_class<EditorScenePostImport>(); + ClassDB::register_class<EditorScript>(); + ClassDB::register_class<EditorSelection>(); + ClassDB::register_class<EditorFileDialog>(); + //ClassDB::register_type<EditorImportExport>(); + ClassDB::register_class<EditorSettings>(); + ClassDB::register_class<EditorSpatialGizmo>(); + ClassDB::register_class<EditorResourcePreview>(); + ClassDB::register_class<EditorResourcePreviewGenerator>(); + ClassDB::register_class<EditorFileSystem>(); + ClassDB::register_class<EditorFileSystemDirectory>(); - //ObjectTypeDB::register_type<EditorImporter>(); -// ObjectTypeDB::register_type<EditorPostImport>(); + //ClassDB::register_type<EditorImporter>(); +// ClassDB::register_type<EditorPostImport>(); } void EditorNode::unregister_editor_types() { @@ -5085,7 +5080,7 @@ Variant EditorNode::drag_resource(const Ref<Resource>& p_res,Control* p_from) { } else if (p_res->get_name()!="") { label->set_text(p_res->get_name()); } else { - label->set_text(p_res->get_type()); + label->set_text(p_res->get_class()); } @@ -5284,94 +5279,103 @@ void EditorNode::_call_build() { void EditorNode::_bind_methods() { - ObjectTypeDB::bind_method("_menu_option",&EditorNode::_menu_option); - ObjectTypeDB::bind_method("_menu_confirm_current",&EditorNode::_menu_confirm_current); - ObjectTypeDB::bind_method("_dialog_action",&EditorNode::_dialog_action); - ObjectTypeDB::bind_method("_resource_selected",&EditorNode::_resource_selected,DEFVAL("")); - ObjectTypeDB::bind_method("_property_editor_forward",&EditorNode::_property_editor_forward); - ObjectTypeDB::bind_method("_property_editor_back",&EditorNode::_property_editor_back); - ObjectTypeDB::bind_method("_editor_select",&EditorNode::_editor_select); - ObjectTypeDB::bind_method("_node_renamed",&EditorNode::_node_renamed); - ObjectTypeDB::bind_method("edit_node",&EditorNode::edit_node); - ObjectTypeDB::bind_method("_imported",&EditorNode::_imported); - ObjectTypeDB::bind_method("_unhandled_input",&EditorNode::_unhandled_input); - - ObjectTypeDB::bind_method("_get_scene_metadata",&EditorNode::_get_scene_metadata); - ObjectTypeDB::bind_method("set_edited_scene",&EditorNode::set_edited_scene); - ObjectTypeDB::bind_method("open_request",&EditorNode::open_request); - ObjectTypeDB::bind_method("_instance_request",&EditorNode::_instance_request); - ObjectTypeDB::bind_method("update_keying",&EditorNode::update_keying); - ObjectTypeDB::bind_method("_property_keyed",&EditorNode::_property_keyed); - ObjectTypeDB::bind_method("_transform_keyed",&EditorNode::_transform_keyed); - ObjectTypeDB::bind_method("_close_messages",&EditorNode::_close_messages); - ObjectTypeDB::bind_method("_show_messages",&EditorNode::_show_messages); - ObjectTypeDB::bind_method("_vp_resized",&EditorNode::_vp_resized); - ObjectTypeDB::bind_method("_quick_opened",&EditorNode::_quick_opened); - ObjectTypeDB::bind_method("_quick_run",&EditorNode::_quick_run); - - ObjectTypeDB::bind_method("_resource_created",&EditorNode::_resource_created); - - ObjectTypeDB::bind_method("_import_action",&EditorNode::_import_action); - //ObjectTypeDB::bind_method("_import",&EditorNode::_import); -// ObjectTypeDB::bind_method("_import_conflicts_solved",&EditorNode::_import_conflicts_solved); - ObjectTypeDB::bind_method("_open_recent_scene",&EditorNode::_open_recent_scene); -// ObjectTypeDB::bind_method("_open_recent_scene_confirm",&EditorNode::_open_recent_scene_confirm); - - ObjectTypeDB::bind_method("_save_optimized",&EditorNode::_save_optimized); - - ObjectTypeDB::bind_method("stop_child_process",&EditorNode::stop_child_process); - - ObjectTypeDB::bind_method("_sources_changed",&EditorNode::_sources_changed); - ObjectTypeDB::bind_method("_fs_changed",&EditorNode::_fs_changed); - ObjectTypeDB::bind_method("_dock_select_draw",&EditorNode::_dock_select_draw); - ObjectTypeDB::bind_method("_dock_select_input",&EditorNode::_dock_select_input); - ObjectTypeDB::bind_method("_dock_pre_popup",&EditorNode::_dock_pre_popup); - ObjectTypeDB::bind_method("_dock_split_dragged",&EditorNode::_dock_split_dragged); - ObjectTypeDB::bind_method("_save_docks",&EditorNode::_save_docks); - ObjectTypeDB::bind_method("_dock_popup_exit",&EditorNode::_dock_popup_exit); - ObjectTypeDB::bind_method("_dock_move_left",&EditorNode::_dock_move_left); - ObjectTypeDB::bind_method("_dock_move_right",&EditorNode::_dock_move_right); - - ObjectTypeDB::bind_method("_layout_menu_option",&EditorNode::_layout_menu_option); - - ObjectTypeDB::bind_method("set_current_scene",&EditorNode::set_current_scene); - ObjectTypeDB::bind_method("set_current_version",&EditorNode::set_current_version); - ObjectTypeDB::bind_method("_scene_tab_changed",&EditorNode::_scene_tab_changed); - ObjectTypeDB::bind_method("_scene_tab_closed",&EditorNode::_scene_tab_closed); - ObjectTypeDB::bind_method("_scene_tab_script_edited",&EditorNode::_scene_tab_script_edited); - ObjectTypeDB::bind_method("_set_main_scene_state",&EditorNode::_set_main_scene_state); - ObjectTypeDB::bind_method("_update_scene_tabs",&EditorNode::_update_scene_tabs); - - ObjectTypeDB::bind_method("_prepare_history",&EditorNode::_prepare_history); - ObjectTypeDB::bind_method("_select_history",&EditorNode::_select_history); - - ObjectTypeDB::bind_method("_toggle_search_bar",&EditorNode::_toggle_search_bar); - ObjectTypeDB::bind_method("_clear_search_box",&EditorNode::_clear_search_box); - ObjectTypeDB::bind_method("_clear_undo_history",&EditorNode::_clear_undo_history); - ObjectTypeDB::bind_method("_dropped_files",&EditorNode::_dropped_files); - ObjectTypeDB::bind_method("_toggle_distraction_free_mode",&EditorNode::_toggle_distraction_free_mode); - - - - ObjectTypeDB::bind_method(_MD("add_editor_import_plugin", "plugin"), &EditorNode::add_editor_import_plugin); - ObjectTypeDB::bind_method(_MD("remove_editor_import_plugin", "plugin"), &EditorNode::remove_editor_import_plugin); - ObjectTypeDB::bind_method(_MD("get_gui_base"), &EditorNode::get_gui_base); - ObjectTypeDB::bind_method(_MD("_bottom_panel_switch"), &EditorNode::_bottom_panel_switch); + ClassDB::bind_method("_menu_option",&EditorNode::_menu_option); + ClassDB::bind_method("_menu_confirm_current",&EditorNode::_menu_confirm_current); + ClassDB::bind_method("_dialog_action",&EditorNode::_dialog_action); + ClassDB::bind_method("_resource_selected",&EditorNode::_resource_selected,DEFVAL("")); + ClassDB::bind_method("_property_editor_forward",&EditorNode::_property_editor_forward); + ClassDB::bind_method("_property_editor_back",&EditorNode::_property_editor_back); + ClassDB::bind_method("_editor_select",&EditorNode::_editor_select); + ClassDB::bind_method("_node_renamed",&EditorNode::_node_renamed); + ClassDB::bind_method("edit_node",&EditorNode::edit_node); + ClassDB::bind_method("_imported",&EditorNode::_imported); + ClassDB::bind_method("_unhandled_input",&EditorNode::_unhandled_input); + + ClassDB::bind_method("_get_scene_metadata",&EditorNode::_get_scene_metadata); + ClassDB::bind_method("set_edited_scene",&EditorNode::set_edited_scene); + ClassDB::bind_method("open_request",&EditorNode::open_request); + ClassDB::bind_method("_instance_request",&EditorNode::_instance_request); + ClassDB::bind_method("update_keying",&EditorNode::update_keying); + ClassDB::bind_method("_property_keyed",&EditorNode::_property_keyed); + ClassDB::bind_method("_transform_keyed",&EditorNode::_transform_keyed); + ClassDB::bind_method("_close_messages",&EditorNode::_close_messages); + ClassDB::bind_method("_show_messages",&EditorNode::_show_messages); + ClassDB::bind_method("_vp_resized",&EditorNode::_vp_resized); + ClassDB::bind_method("_quick_opened",&EditorNode::_quick_opened); + ClassDB::bind_method("_quick_run",&EditorNode::_quick_run); + + ClassDB::bind_method("_resource_created",&EditorNode::_resource_created); + + ClassDB::bind_method("_import_action",&EditorNode::_import_action); + //ClassDB::bind_method("_import",&EditorNode::_import); +// ClassDB::bind_method("_import_conflicts_solved",&EditorNode::_import_conflicts_solved); + ClassDB::bind_method("_open_recent_scene",&EditorNode::_open_recent_scene); +// ClassDB::bind_method("_open_recent_scene_confirm",&EditorNode::_open_recent_scene_confirm); + + ClassDB::bind_method("_save_optimized",&EditorNode::_save_optimized); + + ClassDB::bind_method("stop_child_process",&EditorNode::stop_child_process); + + ClassDB::bind_method("_sources_changed",&EditorNode::_sources_changed); + ClassDB::bind_method("_fs_changed",&EditorNode::_fs_changed); + ClassDB::bind_method("_dock_select_draw",&EditorNode::_dock_select_draw); + ClassDB::bind_method("_dock_select_input",&EditorNode::_dock_select_input); + ClassDB::bind_method("_dock_pre_popup",&EditorNode::_dock_pre_popup); + ClassDB::bind_method("_dock_split_dragged",&EditorNode::_dock_split_dragged); + ClassDB::bind_method("_save_docks",&EditorNode::_save_docks); + ClassDB::bind_method("_dock_popup_exit",&EditorNode::_dock_popup_exit); + ClassDB::bind_method("_dock_move_left",&EditorNode::_dock_move_left); + ClassDB::bind_method("_dock_move_right",&EditorNode::_dock_move_right); + + ClassDB::bind_method("_layout_menu_option",&EditorNode::_layout_menu_option); + + ClassDB::bind_method("set_current_scene",&EditorNode::set_current_scene); + ClassDB::bind_method("set_current_version",&EditorNode::set_current_version); + ClassDB::bind_method("_scene_tab_changed",&EditorNode::_scene_tab_changed); + ClassDB::bind_method("_scene_tab_closed",&EditorNode::_scene_tab_closed); + ClassDB::bind_method("_scene_tab_script_edited",&EditorNode::_scene_tab_script_edited); + ClassDB::bind_method("_set_main_scene_state",&EditorNode::_set_main_scene_state); + ClassDB::bind_method("_update_scene_tabs",&EditorNode::_update_scene_tabs); + + ClassDB::bind_method("_prepare_history",&EditorNode::_prepare_history); + ClassDB::bind_method("_select_history",&EditorNode::_select_history); + + ClassDB::bind_method("_toggle_search_bar",&EditorNode::_toggle_search_bar); + ClassDB::bind_method("_clear_search_box",&EditorNode::_clear_search_box); + ClassDB::bind_method("_clear_undo_history",&EditorNode::_clear_undo_history); + ClassDB::bind_method("_dropped_files",&EditorNode::_dropped_files); + ClassDB::bind_method("_toggle_distraction_free_mode",&EditorNode::_toggle_distraction_free_mode); + + + + ClassDB::bind_method(_MD("add_editor_import_plugin", "plugin"), &EditorNode::add_editor_import_plugin); + ClassDB::bind_method(_MD("remove_editor_import_plugin", "plugin"), &EditorNode::remove_editor_import_plugin); + ClassDB::bind_method(_MD("get_gui_base"), &EditorNode::get_gui_base); + ClassDB::bind_method(_MD("_bottom_panel_switch"), &EditorNode::_bottom_panel_switch); ADD_SIGNAL( MethodInfo("play_pressed") ); ADD_SIGNAL( MethodInfo("pause_pressed") ); ADD_SIGNAL( MethodInfo("stop_pressed") ); ADD_SIGNAL( MethodInfo("request_help") ); - ADD_SIGNAL( MethodInfo("script_add_function_request",PropertyInfo(Variant::OBJECT,"obj"),PropertyInfo(Variant::STRING,"function"),PropertyInfo(Variant::STRING_ARRAY,"args")) ); + ADD_SIGNAL( MethodInfo("script_add_function_request",PropertyInfo(Variant::OBJECT,"obj"),PropertyInfo(Variant::STRING,"function"),PropertyInfo(Variant::POOL_STRING_ARRAY,"args")) ); ADD_SIGNAL( MethodInfo("resource_saved",PropertyInfo(Variant::OBJECT,"obj")) ); } +static Node* _resource_get_edited_scene() { + + return EditorNode::get_singleton()->get_edited_scene(); +} + EditorNode::EditorNode() { + Resource::_get_local_scene_func=_resource_get_edited_scene; + + VisualServer::get_singleton()->textures_keep_original(true); + EditorHelp::generate_doc(); //before any editor classes are crated SceneState::set_disable_placeholders(true); editor_initialize_certificates(); //for asset sharing @@ -5406,7 +5410,7 @@ EditorNode::EditorNode() { bool use_single_dock_column = false; { - int dpi_mode = EditorSettings::get_singleton()->get("global/hidpi_mode"); + int dpi_mode = EditorSettings::get_singleton()->get("interface/hidpi_mode"); if (dpi_mode==0) { editor_set_scale( OS::get_singleton()->get_screen_dpi(0) > 150 && OS::get_singleton()->get_screen_size(OS::get_singleton()->get_current_screen()).x>2000 ? 2.0 : 1.0 ); @@ -5425,9 +5429,9 @@ EditorNode::EditorNode() { ResourceLoader::set_abort_on_missing_resources(false); - FileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("file_dialog/show_hidden_files")); - EditorFileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("file_dialog/show_hidden_files")); - EditorFileDialog::set_default_display_mode((EditorFileDialog::DisplayMode)EditorSettings::get_singleton()->get("file_dialog/display_mode").operator int()); + FileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("filesystem/file_dialog/show_hidden_files")); + EditorFileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("filesystem/file_dialog/show_hidden_files")); + EditorFileDialog::set_default_display_mode((EditorFileDialog::DisplayMode)EditorSettings::get_singleton()->get("filesystem/file_dialog/display_mode").operator int()); ResourceLoader::set_error_notify_func(this,_load_error_notify); ResourceLoader::set_dependency_error_notify_func(this,_dependency_error_report); @@ -5458,11 +5462,11 @@ EditorNode::EditorNode() { editor_import_export->load_config(); - GLOBAL_DEF("editor/main_run_args","$exec -path $path -scene $scene $main_scene"); + GLOBAL_DEF("editor/main_run_args","$scene"); - ObjectTypeDB::set_type_enabled("CollisionShape",true); - ObjectTypeDB::set_type_enabled("CollisionShape2D",true); - ObjectTypeDB::set_type_enabled("CollisionPolygon2D",true); + ClassDB::set_class_enabled("CollisionShape",true); + ClassDB::set_class_enabled("CollisionShape2D",true); + ClassDB::set_class_enabled("CollisionPolygon2D",true); Control *theme_base = memnew( Control ); add_child(theme_base); @@ -5615,14 +5619,14 @@ EditorNode::EditorNode() { dock_select = memnew( Control ); dock_select->set_custom_minimum_size(Size2(128,64)*EDSCALE); - dock_select->connect("input_event",this,"_dock_select_input"); + dock_select->connect("gui_input",this,"_dock_select_input"); dock_select->connect("draw",this,"_dock_select_draw"); dock_select->connect("mouse_exit",this,"_dock_popup_exit"); dock_select->set_v_size_flags(Control::SIZE_EXPAND_FILL); dock_vb->add_child(dock_select); - dock_select_popoup->set_child_rect(dock_vb); + dock_select_popoup->set_as_minsize(); dock_select_rect_over=-1; dock_popup_selected=-1; @@ -5661,7 +5665,7 @@ EditorNode::EditorNode() { scene_tabs=memnew( Tabs ); scene_tabs->add_tab("unsaved"); scene_tabs->set_tab_align(Tabs::ALIGN_CENTER); - scene_tabs->set_tab_close_display_policy( (bool(EDITOR_DEF("global/always_show_close_button_in_scene_tabs", false)) ? Tabs::CLOSE_BUTTON_SHOW_ALWAYS : Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY) ); + scene_tabs->set_tab_close_display_policy( (bool(EDITOR_DEF("interface/always_show_close_button_in_scene_tabs", false)) ? Tabs::CLOSE_BUTTON_SHOW_ALWAYS : Tabs::CLOSE_BUTTON_SHOW_ACTIVE_ONLY) ); scene_tabs->connect("tab_changed",this,"_scene_tab_changed"); scene_tabs->connect("right_button_pressed",this,"_scene_tab_script_edited"); scene_tabs->connect("tab_close", this, "_scene_tab_closed"); @@ -5672,6 +5676,7 @@ EditorNode::EditorNode() { scene_root_parent->set_custom_minimum_size(Size2(0,80)*EDSCALE); + //Ref<StyleBox> sp = scene_root_parent->get_stylebox("panel","TabContainer"); //scene_root_parent->add_style_override("panel",sp); @@ -5685,6 +5690,8 @@ EditorNode::EditorNode() { scene_root = memnew( Viewport ); + scene_root->set_disable_3d(true); + //scene_root_base->add_child(scene_root); @@ -5692,7 +5699,7 @@ EditorNode::EditorNode() { VisualServer::get_singleton()->viewport_set_hide_scenario(scene_root->get_viewport(),true); scene_root->set_disable_input(true); scene_root->set_as_audio_listener_2d(true); - scene_root->set_size_override(true,Size2(Globals::get_singleton()->get("display/width"),Globals::get_singleton()->get("display/height"))); + //scene_root->set_size_override(true,Size2(GlobalConfig::get_singleton()->get("display/width"),GlobalConfig::get_singleton()->get("display/height"))); // scene_root->set_world_2d( Ref<World2D>( memnew( World2D )) ); @@ -5705,6 +5712,7 @@ EditorNode::EditorNode() { scene_root_parent->add_child(viewport); + PanelContainer *top_region = memnew( PanelContainer ); top_region->add_style_override("panel",gui_base->get_stylebox("hover","Button")); HBoxContainer *left_menu_hb = memnew( HBoxContainer ); @@ -5764,11 +5772,11 @@ EditorNode::EditorNode() { pm_export->add_separator(); pm_export->add_shortcut(ED_SHORTCUT("editor/convert_to_MeshLibrary", TTR("MeshLibrary..")), FILE_EXPORT_MESH_LIBRARY); pm_export->add_shortcut(ED_SHORTCUT("editor/convert_to_TileSet", TTR("TileSet..")), FILE_EXPORT_TILESET); - pm_export->connect("item_pressed",this,"_menu_option"); + pm_export->connect("id_pressed",this,"_menu_option"); p->add_separator(); - p->add_item(TTR("Undo"),EDIT_UNDO,KEY_MASK_CMD+KEY_Z); - p->add_item(TTR("Redo"),EDIT_REDO,KEY_MASK_CMD+KEY_MASK_SHIFT+KEY_Z); + p->add_shortcut(ED_SHORTCUT("editor/undo", TTR("Undo"),KEY_MASK_CMD+KEY_Z),EDIT_UNDO,true); + p->add_shortcut(ED_SHORTCUT("editor/redo", TTR("Redo"),KEY_MASK_SHIFT+KEY_MASK_CMD+KEY_Z),EDIT_REDO,true); p->add_separator(); p->add_item(TTR("Run Script"),FILE_RUN_SCRIPT,KEY_MASK_SHIFT+KEY_MASK_CMD+KEY_R); p->add_separator(); @@ -5786,7 +5794,7 @@ EditorNode::EditorNode() { recent_scenes = memnew( PopupMenu ); recent_scenes->set_name("RecentScenes"); p->add_child(recent_scenes); - recent_scenes->connect("item_pressed",this,"_open_recent_scene"); + recent_scenes->connect("id_pressed",this,"_open_recent_scene"); { Control *sp = memnew( Control ); @@ -5843,7 +5851,7 @@ EditorNode::EditorNode() { left_menu_hb->add_child( import_menu ); p=import_menu->get_popup(); - p->connect("item_pressed",this,"_menu_option"); + p->connect("id_pressed",this,"_menu_option"); tool_menu = memnew( MenuButton ); tool_menu->set_tooltip(TTR("Miscellaneous project or scene-wide tools.")); @@ -5853,7 +5861,7 @@ EditorNode::EditorNode() { left_menu_hb->add_child( tool_menu ); p=tool_menu->get_popup(); - p->connect("item_pressed",this,"_menu_option"); + p->connect("id_pressed",this,"_menu_option"); p->add_item(TTR("Orphan Resource Explorer"),TOOLS_ORPHAN_RESOURCES); export_button = memnew( ToolButton ); @@ -5872,7 +5880,7 @@ EditorNode::EditorNode() { play_cc = memnew( CenterContainer ); - play_cc->set_ignore_mouse(true); + play_cc->set_mouse_filter(Control::MOUSE_FILTER_IGNORE); gui_base->add_child( play_cc ); play_cc->set_area_as_parent_rect(); play_cc->set_anchor_and_margin(MARGIN_BOTTOM,Control::ANCHOR_BEGIN,10); @@ -5923,7 +5931,7 @@ EditorNode::EditorNode() { native_play_button->set_text("NTV"); menu_hb->add_child(native_play_button); native_play_button->hide(); - native_play_button->get_popup()->connect("item_pressed",this,"_run_in_device"); + native_play_button->get_popup()->connect("id_pressed",this,"_run_in_device"); run_native->connect("native_run",this,"_menu_option",varray(RUN_PLAY_NATIVE)); // VSeparator *s1 = memnew( VSeparator ); @@ -5957,6 +5965,7 @@ EditorNode::EditorNode() { debug_button->set_tooltip(TTR("Debug options")); p=debug_button->get_popup(); + p->set_hide_on_item_selection(false); p->add_check_item(TTR("Deploy with Remote Debug"),RUN_DEPLOY_REMOTE_DEBUG); p->set_item_tooltip(p->get_item_count()-1,TTR("When exporting or deploying, the resulting executable will attempt to connect to the IP of this computer in order to be debugged.")); p->add_check_item(TTR("Small Deploy with Network FS"),RUN_FILE_SERVER); @@ -5971,7 +5980,7 @@ EditorNode::EditorNode() { p->set_item_tooltip(p->get_item_count()-1,TTR("When this option is turned on, any changes made to the scene in the editor will be replicated in the running game.\nWhen used remotely on a device, this is more efficient with network filesystem.")); p->add_check_item(TTR("Sync Script Changes"),RUN_RELOAD_SCRIPTS); p->set_item_tooltip(p->get_item_count()-1,TTR("When this option is turned on, any script that is saved will be reloaded on the running game.\nWhen used remotely on a device, this is more efficient with network filesystem.")); - p->connect("item_pressed",this,"_menu_option"); + p->connect("id_pressed",this,"_menu_option"); /* run_settings_button = memnew( ToolButton ); @@ -6015,7 +6024,7 @@ EditorNode::EditorNode() { audio_vu->set_max(24); audio_vu->set_min(-80); audio_vu->set_step(0.01); - audio_vu->set_val(0); + audio_vu->set_value(0); { Control *sp = memnew( Control ); @@ -6045,7 +6054,7 @@ EditorNode::EditorNode() { editor_layouts = memnew( PopupMenu ); editor_layouts->set_name("Layouts"); p->add_child(editor_layouts); - editor_layouts->connect("item_pressed",this,"_layout_menu_option"); + editor_layouts->connect("id_pressed",this,"_layout_menu_option"); p->add_submenu_item(TTR("Editor Layout"), "Layouts"); p->add_shortcut(ED_SHORTCUT("editor/fullscreen_mode",TTR("Toggle Fullscreen"),KEY_MASK_SHIFT|KEY_F11),SETTINGS_TOGGLE_FULLSCREN); @@ -6157,7 +6166,7 @@ EditorNode::EditorNode() { prop_editor_hb->add_child(resource_save_button); resource_save_button->get_popup()->add_item(TTR("Save"),RESOURCE_SAVE); resource_save_button->get_popup()->add_item(TTR("Save As.."),RESOURCE_SAVE_AS); - resource_save_button->get_popup()->connect("item_pressed",this,"_menu_option"); + resource_save_button->get_popup()->connect("id_pressed",this,"_menu_option"); resource_save_button->set_focus_mode(Control::FOCUS_NONE); resource_save_button->set_disabled(true); @@ -6185,7 +6194,7 @@ EditorNode::EditorNode() { editor_history_menu->set_icon( gui_base->get_icon("History","EditorIcons")); prop_editor_hb->add_child(editor_history_menu); editor_history_menu->connect("about_to_show",this,"_prepare_history"); - editor_history_menu->get_popup()->connect("item_pressed",this,"_select_history"); + editor_history_menu->get_popup()->connect("id_pressed",this,"_select_history"); prop_editor_hb = memnew( HBoxContainer ); //again... @@ -6252,7 +6261,7 @@ EditorNode::EditorNode() { scenes_dock = memnew( FileSystemDock(this) ); scenes_dock->set_name(TTR("FileSystem")); - scenes_dock->set_display_mode(int(EditorSettings::get_singleton()->get("filesystem_dock/display_mode"))); + scenes_dock->set_display_mode(int(EditorSettings::get_singleton()->get("docks/filesystem/display_mode"))); if (use_single_dock_column) { dock_slot[DOCK_SLOT_RIGHT_BL]->add_child(scenes_dock); @@ -6338,9 +6347,7 @@ EditorNode::EditorNode() { - call_dialog = memnew( CallDialog ); - call_dialog->hide(); - gui_base->add_child( call_dialog ); + @@ -6421,7 +6428,7 @@ EditorNode::EditorNode() { about->get_ok()->set_text(TTR("Thanks!")); about->set_hide_on_ok(true); Label *about_text = memnew( Label ); - about_text->set_text(VERSION_FULL_NAME"\n(c) 2008-2016 Juan Linietsky, Ariel Manzur.\n"); + about_text->set_text(VERSION_FULL_NAME"\n(c) 2008-2017 Juan Linietsky, Ariel Manzur.\n"); about_text->set_pos(Point2(gui_base->get_icon("Logo","EditorIcons")->get_size().width+30,20)); gui_base->add_child(about); about->add_child(about_text); @@ -6496,11 +6503,11 @@ EditorNode::EditorNode() { - file_menu->get_popup()->connect("item_pressed", this,"_menu_option"); - object_menu->get_popup()->connect("item_pressed", this,"_menu_option"); + file_menu->get_popup()->connect("id_pressed", this,"_menu_option"); + object_menu->get_popup()->connect("id_pressed", this,"_menu_option"); - update_menu->get_popup()->connect("item_pressed", this,"_menu_option"); - settings_menu->get_popup()->connect("item_pressed", this,"_menu_option"); + update_menu->get_popup()->connect("id_pressed", this,"_menu_option"); + settings_menu->get_popup()->connect("id_pressed", this,"_menu_option"); file->connect("file_selected", this,"_dialog_action"); @@ -6549,10 +6556,11 @@ EditorNode::EditorNode() { //more visually meaningful to have this later raise_bottom_panel_item(AnimationPlayerEditor::singleton); - add_editor_plugin( memnew( ShaderGraphEditorPlugin(this,true) ) ); + add_editor_plugin( memnew( ShaderEditorPlugin(this) ) ); +/* add_editor_plugin( memnew( ShaderGraphEditorPlugin(this,true) ) ); add_editor_plugin( memnew( ShaderGraphEditorPlugin(this,false) ) ); - add_editor_plugin( memnew( ShaderEditorPlugin(this,true) ) ); - add_editor_plugin( memnew( ShaderEditorPlugin(this,false) ) ); + + add_editor_plugin( memnew( ShaderEditorPlugin(this,false) ) );*/ add_editor_plugin( memnew( CameraEditorPlugin(this) ) ); add_editor_plugin( memnew( SampleEditorPlugin(this) ) ); add_editor_plugin( memnew( SampleLibraryEditorPlugin(this) ) ); @@ -6561,31 +6569,32 @@ EditorNode::EditorNode() { add_editor_plugin( memnew( MeshInstanceEditorPlugin(this) ) ); add_editor_plugin( memnew( AnimationTreeEditorPlugin(this) ) ); //add_editor_plugin( memnew( SamplePlayerEditorPlugin(this) ) ); - this is kind of useless at this point - add_editor_plugin( memnew( MeshLibraryEditorPlugin(this) ) ); +// add_editor_plugin( memnew( MeshLibraryEditorPlugin(this) ) ); //add_editor_plugin( memnew( StreamEditorPlugin(this) ) ); add_editor_plugin( memnew( StyleBoxEditorPlugin(this) ) ); - add_editor_plugin( memnew( ParticlesEditorPlugin(this) ) ); + //add_editor_plugin( memnew( ParticlesEditorPlugin(this) ) ); add_editor_plugin( memnew( ResourcePreloaderEditorPlugin(this) ) ); add_editor_plugin( memnew( ItemListEditorPlugin(this) ) ); //add_editor_plugin( memnew( RichTextEditorPlugin(this) ) ); - add_editor_plugin( memnew( CollisionPolygonEditorPlugin(this) ) ); +// add_editor_plugin( memnew( CollisionPolygonEditorPlugin(this) ) ); add_editor_plugin( memnew( CollisionPolygon2DEditorPlugin(this) ) ); add_editor_plugin( memnew( TileSetEditorPlugin(this) ) ); add_editor_plugin( memnew( TileMapEditorPlugin(this) ) ); add_editor_plugin( memnew( SpriteFramesEditorPlugin(this) ) ); add_editor_plugin( memnew( TextureRegionEditorPlugin(this) ) ); add_editor_plugin( memnew( Particles2DEditorPlugin(this) ) ); + add_editor_plugin( memnew( GIProbeEditorPlugin(this) ) ); add_editor_plugin( memnew( Path2DEditorPlugin(this) ) ); - add_editor_plugin( memnew( PathEditorPlugin(this) ) ); - add_editor_plugin( memnew( BakedLightEditorPlugin(this) ) ); +// add_editor_plugin( memnew( PathEditorPlugin(this) ) ); + //add_editor_plugin( memnew( BakedLightEditorPlugin(this) ) ); add_editor_plugin( memnew( Polygon2DEditorPlugin(this) ) ); add_editor_plugin( memnew( LightOccluder2DEditorPlugin(this) ) ); add_editor_plugin( memnew( NavigationPolygonEditorPlugin(this) ) ); add_editor_plugin( memnew( ColorRampEditorPlugin(this) ) ); add_editor_plugin( memnew( CollisionShape2DEditorPlugin(this) ) ); add_editor_plugin( memnew( TextureEditorPlugin(this) ) ); - add_editor_plugin( memnew( MaterialEditorPlugin(this) ) ); - add_editor_plugin( memnew( MeshEditorPlugin(this) ) ); +// add_editor_plugin( memnew( MaterialEditorPlugin(this) ) ); +// add_editor_plugin( memnew( MeshEditorPlugin(this) ) ); for(int i=0;i<EditorPlugins::get_plugin_count();i++) add_editor_plugin( EditorPlugins::create(i,this) ); @@ -6594,14 +6603,14 @@ EditorNode::EditorNode() { plugin_init_callbacks[i](); } - resource_preview->add_preview_generator( Ref<EditorTexturePreviewPlugin>( memnew(EditorTexturePreviewPlugin ))); + /*resource_preview->add_preview_generator( Ref<EditorTexturePreviewPlugin>( memnew(EditorTexturePreviewPlugin ))); resource_preview->add_preview_generator( Ref<EditorPackedScenePreviewPlugin>( memnew(EditorPackedScenePreviewPlugin ))); resource_preview->add_preview_generator( Ref<EditorMaterialPreviewPlugin>( memnew(EditorMaterialPreviewPlugin ))); resource_preview->add_preview_generator( Ref<EditorScriptPreviewPlugin>( memnew(EditorScriptPreviewPlugin ))); resource_preview->add_preview_generator( Ref<EditorSamplePreviewPlugin>( memnew(EditorSamplePreviewPlugin ))); resource_preview->add_preview_generator( Ref<EditorMeshPreviewPlugin>( memnew(EditorMeshPreviewPlugin ))); resource_preview->add_preview_generator( Ref<EditorBitmapPreviewPlugin>( memnew(EditorBitmapPreviewPlugin ))); - +*/ circle_step_msec=OS::get_singleton()->get_ticks_msec(); @@ -6621,8 +6630,8 @@ EditorNode::EditorNode() { Physics2DServer::get_singleton()->set_active(false); // no physics by default if editor ScriptServer::set_scripting_enabled(false); // no scripting by default if editor - Globals::get_singleton()->set("debug/indicators_enabled",true); - Globals::get_singleton()->set("render/room_cull_enabled",false); + +// GlobalConfig::get_singleton()->set("render/room_cull_enabled",false); reference_resource_mem=true; save_external_resources_mem=true; @@ -6636,7 +6645,7 @@ EditorNode::EditorNode() { //store project name in ssettings String project_name; //figure it out from path - project_name=Globals::get_singleton()->get_resource_path().replace("\\","/"); + project_name=GlobalConfig::get_singleton()->get_resource_path().replace("\\","/"); print_line("path: "+project_name); if (project_name.length() && project_name[project_name.length()-1]=='/') project_name=project_name.substr(0,project_name.length()-1); @@ -6644,7 +6653,7 @@ EditorNode::EditorNode() { project_name=project_name.replace("/","::"); if (project_name!="") { - EditorSettings::get_singleton()->set("projects/"+project_name,Globals::get_singleton()->get_resource_path()); + EditorSettings::get_singleton()->set("projects/"+project_name,GlobalConfig::get_singleton()->get_resource_path()); EditorSettings::get_singleton()->raise_order("projects/"+project_name); EditorSettings::get_singleton()->save(); } @@ -6681,9 +6690,10 @@ EditorNode::EditorNode() { load_error_dialog = memnew( AcceptDialog ); load_error_dialog->add_child(load_errors); load_error_dialog->set_title(TTR("Load Errors")); - load_error_dialog->set_child_rect(load_errors); + //load_error_dialog->set_child_rect(load_errors); gui_base->add_child(load_error_dialog); + //EditorImport::add_importer( Ref<EditorImporterCollada>( memnew(EditorImporterCollada ))); EditorFileSystem::get_singleton()->connect("sources_changed",this,"_sources_changed"); @@ -6696,7 +6706,7 @@ EditorNode::EditorNode() { theme_base->get_theme()->get_icon_list(ei,&tl); for(List<StringName>::Element *E=tl.front();E;E=E->next()) { - if (!ObjectTypeDB::type_exists(E->get())) + if (!ClassDB::class_exists(E->get())) continue; icon_type_cache[E->get()]=theme_base->get_theme()->get_icon(E->get(),ei); } @@ -6725,7 +6735,7 @@ EditorNode::EditorNode() { { _initializing_addons=true; - Vector<String> addons = Globals::get_singleton()->get("editor_plugins/enabled"); + Vector<String> addons = GlobalConfig::get_singleton()->get("editor_plugins/enabled"); for(int i=0;i<addons.size();i++) { set_addon_plugin_enabled(addons[i],true); @@ -6774,12 +6784,12 @@ void EditorPluginList::edit(Object* p_object) { } -bool EditorPluginList::forward_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { +bool EditorPluginList::forward_gui_input(const Transform2D& p_canvas_xform,const InputEvent& p_event) { bool discard = false; for (int i = 0; i < plugins_list.size(); i++) { - if (plugins_list[i]->forward_canvas_input_event(p_canvas_xform,p_event)) { + if (plugins_list[i]->forward_canvas_gui_input(p_canvas_xform,p_event)) { discard = true; } } @@ -6787,11 +6797,11 @@ bool EditorPluginList::forward_input_event(const Matrix32& p_canvas_xform,const return discard; } -bool EditorPluginList::forward_spatial_input_event(Camera* p_camera, const InputEvent& p_event) { +bool EditorPluginList::forward_spatial_gui_input(Camera* p_camera, const InputEvent& p_event) { bool discard = false; for (int i = 0; i < plugins_list.size(); i++) { - if (plugins_list[i]->forward_spatial_input_event(p_camera, p_event)) { + if (plugins_list[i]->forward_spatial_gui_input(p_camera, p_event)) { discard = true; } } @@ -6799,7 +6809,7 @@ bool EditorPluginList::forward_spatial_input_event(Camera* p_camera, const Input return discard; } -void EditorPluginList::forward_draw_over_canvas(const Matrix32& p_canvas_xform,Control* p_canvas) { +void EditorPluginList::forward_draw_over_canvas(const Transform2D& p_canvas_xform,Control* p_canvas) { for (int i = 0; i < plugins_list.size(); i++) { plugins_list[i]->forward_draw_over_canvas(p_canvas_xform,p_canvas); diff --git a/tools/editor/editor_node.h b/tools/editor/editor_node.h index 6392b96f8f..2cb1cd00ab 100644 --- a/tools/editor/editor_node.h +++ b/tools/editor/editor_node.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -79,7 +79,7 @@ #include "fileserver/editor_file_server.h" #include "editor_resource_preview.h" - +#include "scene/gui/viewport_container.h" #include "progress_dialog.h" @@ -101,7 +101,7 @@ class EditorPluginList; class EditorNode : public Node { - OBJ_TYPE( EditorNode, Node ); + GDCLASS( EditorNode, Node ); public: enum DockSlot { @@ -159,7 +159,6 @@ private: OBJECT_COPY_PARAMS, OBJECT_PASTE_PARAMS, OBJECT_UNIQUE_RESOURCES, - OBJECT_CALL_METHOD, OBJECT_REQUEST_HELP, RUN_PLAY, @@ -208,7 +207,7 @@ private: //Ref<ResourceImportMetadata> scene_import_metadata; - Control* scene_root_parent; + PanelContainer* scene_root_parent; Control *gui_base; VBoxContainer *main_vbox; @@ -287,7 +286,7 @@ private: CreateDialog *create_dialog; - CallDialog *call_dialog; +// CallDialog *call_dialog; ConfirmationDialog *confirmation; ConfirmationDialog *import_confirmation; ConfirmationDialog *open_recent_confirmation; @@ -793,9 +792,9 @@ public: void make_visible(bool p_visible); void edit(Object *p_object); - bool forward_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event); - bool forward_spatial_input_event(Camera* p_camera, const InputEvent& p_event); - void forward_draw_over_canvas(const Matrix32& p_canvas_xform,Control* p_canvas); + bool forward_gui_input(const Transform2D& p_canvas_xform,const InputEvent& p_event); + bool forward_spatial_gui_input(Camera* p_camera, const InputEvent& p_event); + void forward_draw_over_canvas(const Transform2D& p_canvas_xform,Control* p_canvas); void clear(); bool empty(); diff --git a/tools/editor/editor_path.cpp b/tools/editor/editor_path.cpp index 6b804b6a24..b359522e4f 100644 --- a/tools/editor/editor_path.cpp +++ b/tools/editor/editor_path.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -27,33 +27,106 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "editor_path.h" +#include "editor_scale.h" +#include "editor_node.h" +void EditorPath::_add_children_to_popup(Object* p_obj,int p_depth) { + + if (p_depth>8) + return; + + List<PropertyInfo> pinfo; + p_obj->get_property_list(&pinfo); + for (List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) { + + if (!(E->get().usage&PROPERTY_USAGE_EDITOR)) + continue; + if (E->get().hint!=PROPERTY_HINT_RESOURCE_TYPE) + continue; + + Variant value = p_obj->get(E->get().name); + if (value.get_type()!=Variant::OBJECT) + continue; + Object *obj = value; + if (!obj) + continue; + + Ref<Texture> icon; + + if (has_icon(obj->get_class(),"EditorIcons")) + icon=get_icon(obj->get_class(),"EditorIcons"); + else + icon=get_icon("Object","EditorIcons"); + + int index = popup->get_item_count(); + popup->add_icon_item(icon,E->get().name.capitalize(),objects.size()); + popup->set_item_h_offset(index,p_depth*10*EDSCALE); + objects.push_back(obj->get_instance_ID()); + + _add_children_to_popup(obj,p_depth+1); + } +} + +void EditorPath::_gui_input(const InputEvent& p_event) { + + if (p_event.type==InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index==BUTTON_LEFT && p_event.mouse_button.pressed) { + + + Object *obj = ObjectDB::get_instance(history->get_path_object( history->get_path_size()-1)); + if (!obj) + return; + + + + objects.clear(); + popup->clear(); + _add_children_to_popup(obj); + popup->set_pos( get_global_pos() + Vector2(0,get_size().height)); + popup->set_size( Size2(get_size().width,1)); + popup->popup(); + } +} void EditorPath::_notification(int p_what) { switch(p_what) { + case NOTIFICATION_MOUSE_ENTER: { + mouse_over=true; + update(); + } break; + case NOTIFICATION_MOUSE_EXIT: { + mouse_over=false; + update(); + } break; case NOTIFICATION_DRAW: { RID ci=get_canvas_item(); Ref<Font> label_font = get_font("font","Label"); Size2i size = get_size(); Ref<Texture> sn = get_icon("SmallNext","EditorIcons"); + Ref<StyleBox> sb = get_stylebox("pressed","Button"); + + + int ofs=sb->get_margin(MARGIN_LEFT); + + if (mouse_over) { + draw_style_box(sb,Rect2(Point2(),get_size())); + } - int ofs=5; for(int i=0;i<history->get_path_size();i++) { Object *obj = ObjectDB::get_instance(history->get_path_object(i)); if (!obj) continue; - String type = obj->get_type(); + String type = obj->get_class(); Ref<Texture> icon; - if (has_icon(obj->get_type(),"EditorIcons")) - icon=get_icon(obj->get_type(),"EditorIcons"); + if (has_icon(obj->get_class(),"EditorIcons")) + icon=get_icon(obj->get_class(),"EditorIcons"); else icon=get_icon("Object","EditorIcons"); @@ -78,17 +151,17 @@ void EditorPath::_notification(int p_what) { name=r->get_name(); if (name=="") - name=r->get_type(); + name=r->get_class(); } else if (obj->cast_to<Node>()) { name=obj->cast_to<Node>()->get_name(); } else if (obj->cast_to<Resource>() && obj->cast_to<Resource>()->get_name()!="") { name=obj->cast_to<Resource>()->get_name(); } else { - name=obj->get_type(); + name=obj->get_class(); } - set_tooltip(obj->get_type()); + set_tooltip(obj->get_class()); label_font->draw(ci,Point2i(ofs,(size.height-label_font->get_height())/2+label_font->get_ascent()),name,Color(1,1,1),left); @@ -108,11 +181,34 @@ void EditorPath::_notification(int p_what) { void EditorPath::update_path() { + update(); } +void EditorPath::_popup_select(int p_idx) { + + ERR_FAIL_INDEX(p_idx,objects.size()); + + Object* obj = ObjectDB::get_instance(objects[p_idx]); + if (!obj) + return; + + EditorNode::get_singleton()->push_item(obj); +} + +void EditorPath::_bind_methods() { + + ClassDB::bind_method("_gui_input",&EditorPath::_gui_input); + ClassDB::bind_method("_popup_select",&EditorPath::_popup_select); +} + EditorPath::EditorPath(EditorHistory *p_history) { history=p_history; + mouse_over=false; + popup = memnew( PopupMenu ); + popup->connect("id_pressed",this,"_popup_select"); + add_child(popup); + } diff --git a/tools/editor/editor_path.h b/tools/editor/editor_path.h index 11e1005ba3..fd5b469d07 100644 --- a/tools/editor/editor_path.h +++ b/tools/editor/editor_path.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -30,19 +30,27 @@ #define EDITOR_PATH_H #include "scene/gui/control.h" +#include "scene/gui/popup_menu.h" #include "editor_data.h" class EditorPath : public Control { - OBJ_TYPE(EditorPath,Control); + GDCLASS(EditorPath,Control); EditorHistory *history; + Vector<ObjectID> objects; + PopupMenu *popup; + bool mouse_over; EditorPath(); + void _popup_select(int p_idx); + void _gui_input(const InputEvent& p_event); + void _add_children_to_popup(Object* p_obj,int p_depth=0); protected: + static void _bind_methods(); void _notification(int p_what); public: diff --git a/tools/editor/editor_plugin.cpp b/tools/editor/editor_plugin.cpp index 4b82d5e59c..8769fe2cd8 100644 --- a/tools/editor/editor_plugin.cpp +++ b/tools/editor/editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -76,6 +76,11 @@ Control * EditorPlugin::get_editor_viewport() { return EditorNode::get_singleton()->get_viewport(); } +void EditorPlugin::edit_resource(const Ref<Resource>& p_resource){ + + EditorNode::get_singleton()->edit_resource(p_resource); +} + void EditorPlugin::add_control_to_container(CustomControlContainer p_location,Control *p_control) { switch(p_location) { @@ -136,15 +141,15 @@ Ref<SpatialEditorGizmo> EditorPlugin::create_spatial_gizmo(Spatial* p_spatial) { return Ref<SpatialEditorGizmo>(); } -bool EditorPlugin::forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { +bool EditorPlugin::forward_canvas_gui_input(const Transform2D& p_canvas_xform,const InputEvent& p_event) { - if (get_script_instance() && get_script_instance()->has_method("forward_canvas_input_event")) { - return get_script_instance()->call("forward_canvas_input_event",p_canvas_xform,p_event); + if (get_script_instance() && get_script_instance()->has_method("forward_canvas_gui_input")) { + return get_script_instance()->call("forward_canvas_gui_input",p_canvas_xform,p_event); } return false; } -void EditorPlugin::forward_draw_over_canvas(const Matrix32& p_canvas_xform,Control *p_canvas) { +void EditorPlugin::forward_draw_over_canvas(const Transform2D& p_canvas_xform,Control *p_canvas) { if (get_script_instance() && get_script_instance()->has_method("forward_draw_over_canvas")) { get_script_instance()->call("forward_draw_over_canvas",p_canvas_xform,p_canvas); @@ -155,10 +160,10 @@ void EditorPlugin::update_canvas() { CanvasItemEditor::get_singleton()->get_viewport_control()->update(); } -bool EditorPlugin::forward_spatial_input_event(Camera* p_camera,const InputEvent& p_event) { +bool EditorPlugin::forward_spatial_gui_input(Camera* p_camera,const InputEvent& p_event) { - if (get_script_instance() && get_script_instance()->has_method("forward_spatial_input_event")) { - return get_script_instance()->call("forward_spatial_input_event",p_camera,p_event); + if (get_script_instance() && get_script_instance()->has_method("forward_spatial_gui_input")) { + return get_script_instance()->call("forward_spatial_gui_input",p_camera,p_event); } return false; @@ -248,7 +253,7 @@ void EditorPlugin::apply_changes() { void EditorPlugin::get_breakpoints(List<String> *p_breakpoints) { if (get_script_instance() && get_script_instance()->has_method("get_breakpoints")) { - StringArray arr = get_script_instance()->call("get_breakpoints"); + PoolStringArray arr = get_script_instance()->call("get_breakpoints"); for(int i=0;i<arr.size();i++) p_breakpoints->push_back(arr[i]); } @@ -341,56 +346,57 @@ EditorFileSystem *EditorPlugin::get_resource_file_system() { void EditorPlugin::_bind_methods() { - ObjectTypeDB::bind_method(_MD("add_control_to_container","container","control:Control"),&EditorPlugin::add_control_to_container); - ObjectTypeDB::bind_method(_MD("add_control_to_bottom_panel:ToolButton","control:Control","title"),&EditorPlugin::add_control_to_bottom_panel); - ObjectTypeDB::bind_method(_MD("add_control_to_dock","slot","control:Control"),&EditorPlugin::add_control_to_dock); - ObjectTypeDB::bind_method(_MD("remove_control_from_docks","control:Control"),&EditorPlugin::remove_control_from_docks); - ObjectTypeDB::bind_method(_MD("remove_control_from_bottom_panel","control:Control"),&EditorPlugin::remove_control_from_bottom_panel); - ObjectTypeDB::bind_method(_MD("add_custom_type","type","base","script:Script","icon:Texture"),&EditorPlugin::add_custom_type); - ObjectTypeDB::bind_method(_MD("remove_custom_type","type"),&EditorPlugin::remove_custom_type); - ObjectTypeDB::bind_method(_MD("get_editor_viewport:Control"), &EditorPlugin::get_editor_viewport); + ClassDB::bind_method(_MD("add_control_to_container","container","control:Control"),&EditorPlugin::add_control_to_container); + ClassDB::bind_method(_MD("add_control_to_bottom_panel:ToolButton","control:Control","title"),&EditorPlugin::add_control_to_bottom_panel); + ClassDB::bind_method(_MD("add_control_to_dock","slot","control:Control"),&EditorPlugin::add_control_to_dock); + ClassDB::bind_method(_MD("remove_control_from_docks","control:Control"),&EditorPlugin::remove_control_from_docks); + ClassDB::bind_method(_MD("remove_control_from_bottom_panel","control:Control"),&EditorPlugin::remove_control_from_bottom_panel); + ClassDB::bind_method(_MD("add_custom_type","type","base","script:Script","icon:Texture"),&EditorPlugin::add_custom_type); + ClassDB::bind_method(_MD("remove_custom_type","type"),&EditorPlugin::remove_custom_type); + ClassDB::bind_method(_MD("get_editor_viewport:Control"), &EditorPlugin::get_editor_viewport); - ObjectTypeDB::bind_method(_MD("add_import_plugin","plugin:EditorImportPlugin"),&EditorPlugin::add_import_plugin); - ObjectTypeDB::bind_method(_MD("remove_import_plugin","plugin:EditorImportPlugin"),&EditorPlugin::remove_import_plugin); + ClassDB::bind_method(_MD("add_import_plugin","plugin:EditorImportPlugin"),&EditorPlugin::add_import_plugin); + ClassDB::bind_method(_MD("remove_import_plugin","plugin:EditorImportPlugin"),&EditorPlugin::remove_import_plugin); - ObjectTypeDB::bind_method(_MD("add_export_plugin","plugin:EditorExportPlugin"),&EditorPlugin::add_export_plugin); - ObjectTypeDB::bind_method(_MD("remove_export_plugin","plugin:EditorExportPlugin"),&EditorPlugin::remove_export_plugin); + ClassDB::bind_method(_MD("add_export_plugin","plugin:EditorExportPlugin"),&EditorPlugin::add_export_plugin); + ClassDB::bind_method(_MD("remove_export_plugin","plugin:EditorExportPlugin"),&EditorPlugin::remove_export_plugin); - ObjectTypeDB::bind_method(_MD("get_resource_previewer:EditorResourcePreview"),&EditorPlugin::get_resource_previewer); - ObjectTypeDB::bind_method(_MD("get_resource_filesystem:EditorFileSystem"),&EditorPlugin::get_resource_file_system); + ClassDB::bind_method(_MD("get_resource_previewer:EditorResourcePreview"),&EditorPlugin::get_resource_previewer); + ClassDB::bind_method(_MD("get_resource_filesystem:EditorFileSystem"),&EditorPlugin::get_resource_file_system); - ObjectTypeDB::bind_method(_MD("inspect_object","object","for_property"),&EditorPlugin::inspect_object,DEFVAL(String())); - ObjectTypeDB::bind_method(_MD("update_canvas"),&EditorPlugin::update_canvas); + ClassDB::bind_method(_MD("inspect_object","object","for_property"),&EditorPlugin::inspect_object,DEFVAL(String())); + ClassDB::bind_method(_MD("update_canvas"),&EditorPlugin::update_canvas); - ObjectTypeDB::bind_method(_MD("make_bottom_panel_item_visible","item:Control"), &EditorPlugin::make_bottom_panel_item_visible); - ObjectTypeDB::bind_method(_MD("hide_bottom_panel"), &EditorPlugin::hide_bottom_panel); + ClassDB::bind_method(_MD("make_bottom_panel_item_visible","item:Control"), &EditorPlugin::make_bottom_panel_item_visible); + ClassDB::bind_method(_MD("hide_bottom_panel"), &EditorPlugin::hide_bottom_panel); - ObjectTypeDB::bind_method(_MD("get_base_control:Control"),&EditorPlugin::get_base_control); - ObjectTypeDB::bind_method(_MD("get_undo_redo:UndoRedo"),&EditorPlugin::_get_undo_redo); - ObjectTypeDB::bind_method(_MD("get_selection:EditorSelection"),&EditorPlugin::get_selection); - ObjectTypeDB::bind_method(_MD("get_editor_settings:EditorSettings"),&EditorPlugin::get_editor_settings); - ObjectTypeDB::bind_method(_MD("queue_save_layout"),&EditorPlugin::queue_save_layout); + ClassDB::bind_method(_MD("get_base_control:Control"),&EditorPlugin::get_base_control); + ClassDB::bind_method(_MD("get_undo_redo:UndoRedo"),&EditorPlugin::_get_undo_redo); + ClassDB::bind_method(_MD("get_selection:EditorSelection"),&EditorPlugin::get_selection); + ClassDB::bind_method(_MD("get_editor_settings:EditorSettings"),&EditorPlugin::get_editor_settings); + ClassDB::bind_method(_MD("queue_save_layout"),&EditorPlugin::queue_save_layout); + ClassDB::bind_method(_MD("edit_resource"),&EditorPlugin::edit_resource); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::BOOL,"forward_canvas_input_event",PropertyInfo(Variant::MATRIX32,"canvas_xform"),PropertyInfo(Variant::INPUT_EVENT,"event"))); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("forward_draw_over_canvas",PropertyInfo(Variant::MATRIX32,"canvas_xform"),PropertyInfo(Variant::OBJECT,"canvas:Control"))); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::BOOL,"forward_spatial_input_event",PropertyInfo(Variant::OBJECT,"camera",PROPERTY_HINT_RESOURCE_TYPE,"Camera"),PropertyInfo(Variant::INPUT_EVENT,"event"))); + ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::BOOL,"forward_canvas_gui_input",PropertyInfo(Variant::TRANSFORM2D,"canvas_xform"),PropertyInfo(Variant::INPUT_EVENT,"event"))); + ClassDB::add_virtual_method(get_class_static(),MethodInfo("forward_draw_over_canvas",PropertyInfo(Variant::TRANSFORM2D,"canvas_xform"),PropertyInfo(Variant::OBJECT,"canvas:Control"))); + ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::BOOL,"forward_spatial_gui_input",PropertyInfo(Variant::OBJECT,"camera",PROPERTY_HINT_RESOURCE_TYPE,"Camera"),PropertyInfo(Variant::INPUT_EVENT,"event"))); MethodInfo gizmo = MethodInfo(Variant::OBJECT,"create_spatial_gizmo",PropertyInfo(Variant::OBJECT,"for_spatial:Spatial")); gizmo.return_val.hint=PROPERTY_HINT_RESOURCE_TYPE; gizmo.return_val.hint_string="EditorSpatialGizmo"; - ObjectTypeDB::add_virtual_method(get_type_static(),gizmo); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::STRING,"get_name")); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::BOOL,"has_main_screen")); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("make_visible",PropertyInfo(Variant::BOOL,"visible"))); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("edit",PropertyInfo(Variant::OBJECT,"object"))); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::BOOL,"handles",PropertyInfo(Variant::OBJECT,"object"))); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::DICTIONARY,"get_state")); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("set_state",PropertyInfo(Variant::DICTIONARY,"state"))); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("clear")); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("save_external_data")); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("apply_changes")); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::STRING_ARRAY,"get_breakpoints")); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("set_window_layout",PropertyInfo(Variant::OBJECT,"layout",PROPERTY_HINT_RESOURCE_TYPE,"ConfigFile"))); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo("get_window_layout",PropertyInfo(Variant::OBJECT,"layout",PROPERTY_HINT_RESOURCE_TYPE,"ConfigFile"))); + ClassDB::add_virtual_method(get_class_static(),gizmo); + ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::STRING,"get_name")); + ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::BOOL,"has_main_screen")); + ClassDB::add_virtual_method(get_class_static(),MethodInfo("make_visible",PropertyInfo(Variant::BOOL,"visible"))); + ClassDB::add_virtual_method(get_class_static(),MethodInfo("edit",PropertyInfo(Variant::OBJECT,"object"))); + ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::BOOL,"handles",PropertyInfo(Variant::OBJECT,"object"))); + ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::DICTIONARY,"get_state")); + ClassDB::add_virtual_method(get_class_static(),MethodInfo("set_state",PropertyInfo(Variant::DICTIONARY,"state"))); + ClassDB::add_virtual_method(get_class_static(),MethodInfo("clear")); + ClassDB::add_virtual_method(get_class_static(),MethodInfo("save_external_data")); + ClassDB::add_virtual_method(get_class_static(),MethodInfo("apply_changes")); + ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::POOL_STRING_ARRAY,"get_breakpoints")); + ClassDB::add_virtual_method(get_class_static(),MethodInfo("set_window_layout",PropertyInfo(Variant::OBJECT,"layout",PROPERTY_HINT_RESOURCE_TYPE,"ConfigFile"))); + ClassDB::add_virtual_method(get_class_static(),MethodInfo("get_window_layout",PropertyInfo(Variant::OBJECT,"layout",PROPERTY_HINT_RESOURCE_TYPE,"ConfigFile"))); BIND_CONSTANT( CONTAINER_TOOLBAR ); BIND_CONSTANT( CONTAINER_SPATIAL_EDITOR_MENU ); diff --git a/tools/editor/editor_plugin.h b/tools/editor/editor_plugin.h index 2700c49a6c..9943e94d98 100644 --- a/tools/editor/editor_plugin.h +++ b/tools/editor/editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -53,7 +53,7 @@ class EditorFileSystem; class EditorPlugin : public Node { - OBJ_TYPE( EditorPlugin, Node ); + GDCLASS( EditorPlugin, Node ); friend class EditorData; UndoRedo *undo_redo; @@ -101,11 +101,12 @@ public: void remove_control_from_docks(Control *p_control); void remove_control_from_bottom_panel(Control *p_control); Control* get_editor_viewport(); + void edit_resource(const Ref<Resource>& p_resource); virtual Ref<SpatialEditorGizmo> create_spatial_gizmo(Spatial* p_spatial); - virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform, const InputEvent& p_event); - virtual void forward_draw_over_canvas(const Matrix32& p_canvas_xform,Control *p_canvas); - virtual bool forward_spatial_input_event(Camera* p_camera,const InputEvent& p_event); + virtual bool forward_canvas_gui_input(const Transform2D& p_canvas_xform, const InputEvent& p_event); + virtual void forward_draw_over_canvas(const Transform2D& p_canvas_xform,Control *p_canvas); + virtual bool forward_spatial_gui_input(Camera* p_camera,const InputEvent& p_event); virtual String get_name() const; virtual bool has_main_screen() const; virtual void make_visible(bool p_visible); diff --git a/tools/editor/editor_plugin_settings.cpp b/tools/editor/editor_plugin_settings.cpp index 5342007e6d..208e576a8a 100644 --- a/tools/editor/editor_plugin_settings.cpp +++ b/tools/editor/editor_plugin_settings.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -81,7 +81,7 @@ void EditorPluginSettings::update_plugins() { plugins.sort(); - Vector<String> active_plugins = Globals::get_singleton()->get("plugins/active"); + Vector<String> active_plugins = GlobalConfig::get_singleton()->get("plugins/active"); for(int i=0;i<plugins.size();i++) { @@ -171,8 +171,8 @@ void EditorPluginSettings::_plugin_activity_changed() { void EditorPluginSettings::_bind_methods() { - ObjectTypeDB::bind_method("update_plugins",&EditorPluginSettings::update_plugins); - ObjectTypeDB::bind_method("_plugin_activity_changed",&EditorPluginSettings::_plugin_activity_changed); + ClassDB::bind_method("update_plugins",&EditorPluginSettings::update_plugins); + ClassDB::bind_method("_plugin_activity_changed",&EditorPluginSettings::_plugin_activity_changed); } EditorPluginSettings::EditorPluginSettings() { diff --git a/tools/editor/editor_plugin_settings.h b/tools/editor/editor_plugin_settings.h index 4a982e40e2..e24880a21d 100644 --- a/tools/editor/editor_plugin_settings.h +++ b/tools/editor/editor_plugin_settings.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ class EditorPluginSettings : public VBoxContainer { - OBJ_TYPE(EditorPluginSettings,VBoxContainer); + GDCLASS(EditorPluginSettings,VBoxContainer); Button* update_list; Tree *plugin_list; diff --git a/tools/editor/editor_profiler.cpp b/tools/editor/editor_profiler.cpp index 13327f0be9..162e1d05f5 100644 --- a/tools/editor/editor_profiler.cpp +++ b/tools/editor/editor_profiler.cpp @@ -28,7 +28,7 @@ void EditorProfiler::add_frame_metric(const Metric& p_metric,bool p_final) { if (!seeking) { - cursor_metric_edit->set_val(frame_metrics[last_metric].frame_number); + cursor_metric_edit->set_value(frame_metrics[last_metric].frame_number); if (hover_metric!=-1) { hover_metric++; if (hover_metric>=frame_metrics.size()) { @@ -70,7 +70,7 @@ void EditorProfiler::clear() { updating_frame=true; cursor_metric_edit->set_min(0); cursor_metric_edit->set_max(0); - cursor_metric_edit->set_val(0); + cursor_metric_edit->set_value(0); updating_frame=false; hover_metric=-1; seeking=false; @@ -154,7 +154,7 @@ void EditorProfiler::_update_plot() { } - DVector<uint8_t>::Write wr = graph_image.write(); + PoolVector<uint8_t>::Write wr = graph_image.write(); @@ -336,9 +336,9 @@ void EditorProfiler::_update_plot() { } - wr = DVector<uint8_t>::Write(); + wr = PoolVector<uint8_t>::Write(); - Image img(w,h,0,Image::FORMAT_RGBA,graph_image); + Image img(w,h,0,Image::FORMAT_RGBA8,graph_image); if (reset_texture) { @@ -453,7 +453,7 @@ void EditorProfiler::_graph_tex_draw() { if (seeking) { int max_frames = frame_metrics.size(); - int frame = cursor_metric_edit->get_val() - (frame_metrics[last_metric].frame_number-max_frames+1); + int frame = cursor_metric_edit->get_value() - (frame_metrics[last_metric].frame_number-max_frames+1); if (frame<0) frame=0; @@ -559,7 +559,7 @@ void EditorProfiler::_graph_tex_input(const InputEvent& p_ev){ } if (valid) - cursor_metric_edit->set_val(frame_metrics[metric].frame_number); + cursor_metric_edit->set_value(frame_metrics[metric].frame_number); updating_frame=false; @@ -590,7 +590,7 @@ int EditorProfiler::_get_cursor_index() const { if (!frame_metrics[last_metric].valid) return 0; - int diff = (frame_metrics[last_metric].frame_number-cursor_metric_edit->get_val()); + int diff = (frame_metrics[last_metric].frame_number-cursor_metric_edit->get_value()); int idx = last_metric - diff; while (idx<0) { @@ -617,16 +617,16 @@ void EditorProfiler::_combo_changed(int) { void EditorProfiler::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_update_frame"),&EditorProfiler::_update_frame); - ObjectTypeDB::bind_method(_MD("_update_plot"),&EditorProfiler::_update_plot); - ObjectTypeDB::bind_method(_MD("_activate_pressed"),&EditorProfiler::_activate_pressed); - ObjectTypeDB::bind_method(_MD("_graph_tex_draw"),&EditorProfiler::_graph_tex_draw); - ObjectTypeDB::bind_method(_MD("_graph_tex_input"),&EditorProfiler::_graph_tex_input); - ObjectTypeDB::bind_method(_MD("_graph_tex_mouse_exit"),&EditorProfiler::_graph_tex_mouse_exit); - ObjectTypeDB::bind_method(_MD("_cursor_metric_changed"),&EditorProfiler::_cursor_metric_changed); - ObjectTypeDB::bind_method(_MD("_combo_changed"),&EditorProfiler::_combo_changed); + ClassDB::bind_method(_MD("_update_frame"),&EditorProfiler::_update_frame); + ClassDB::bind_method(_MD("_update_plot"),&EditorProfiler::_update_plot); + ClassDB::bind_method(_MD("_activate_pressed"),&EditorProfiler::_activate_pressed); + ClassDB::bind_method(_MD("_graph_tex_draw"),&EditorProfiler::_graph_tex_draw); + ClassDB::bind_method(_MD("_graph_tex_input"),&EditorProfiler::_graph_tex_input); + ClassDB::bind_method(_MD("_graph_tex_mouse_exit"),&EditorProfiler::_graph_tex_mouse_exit); + ClassDB::bind_method(_MD("_cursor_metric_changed"),&EditorProfiler::_cursor_metric_changed); + ClassDB::bind_method(_MD("_combo_changed"),&EditorProfiler::_combo_changed); - ObjectTypeDB::bind_method(_MD("_item_edited"),&EditorProfiler::_item_edited); + ClassDB::bind_method(_MD("_item_edited"),&EditorProfiler::_item_edited); ADD_SIGNAL( MethodInfo("enable_profiling",PropertyInfo(Variant::BOOL,"enable"))); ADD_SIGNAL( MethodInfo("break_request")); @@ -710,10 +710,10 @@ EditorProfiler::EditorProfiler() graph = memnew( TextureFrame ); graph->set_expand(true); - graph->set_stop_mouse(true); - graph->set_ignore_mouse(false); + graph->set_mouse_filter(MOUSE_FILTER_STOP); + //graph->set_ignore_mouse(false); graph->connect("draw",this,"_graph_tex_draw"); - graph->connect("input_event",this,"_graph_tex_input"); + graph->connect("gui_input",this,"_graph_tex_input"); graph->connect("mouse_exit",this,"_graph_tex_mouse_exit"); h_split->add_child(graph); diff --git a/tools/editor/editor_profiler.h b/tools/editor/editor_profiler.h index f5cea118ce..233bc2e0fd 100644 --- a/tools/editor/editor_profiler.h +++ b/tools/editor/editor_profiler.h @@ -14,7 +14,7 @@ class EditorProfiler : public VBoxContainer { - OBJ_TYPE(EditorProfiler,VBoxContainer) + GDCLASS(EditorProfiler,VBoxContainer) public: @@ -73,7 +73,7 @@ private: Button *activate; TextureFrame *graph; Ref<ImageTexture> graph_texture; - DVector<uint8_t> graph_image; + PoolVector<uint8_t> graph_image; Tree *variables; HSplitContainer *h_split; diff --git a/tools/editor/editor_reimport_dialog.cpp b/tools/editor/editor_reimport_dialog.cpp index b6311a7604..c6a8f13dc7 100644 --- a/tools/editor/editor_reimport_dialog.cpp +++ b/tools/editor/editor_reimport_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -135,7 +135,7 @@ EditorReImportDialog::EditorReImportDialog() { tree = memnew( Tree ); add_child(tree); tree->set_hide_root(true); - set_child_rect(tree); + //set_child_rect(tree); set_title(TTR("Re-Import Changed Resources")); error = memnew( AcceptDialog); add_child(error); diff --git a/tools/editor/editor_reimport_dialog.h b/tools/editor/editor_reimport_dialog.h index 0c2d0eb52c..68e1ca0597 100644 --- a/tools/editor/editor_reimport_dialog.h +++ b/tools/editor/editor_reimport_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class EditorReImportDialog : public ConfirmationDialog { - OBJ_TYPE(EditorReImportDialog,ConfirmationDialog); + GDCLASS(EditorReImportDialog,ConfirmationDialog); Tree *tree; Vector<TreeItem*> items; diff --git a/tools/editor/editor_resource_preview.cpp b/tools/editor/editor_resource_preview.cpp index 6afc3e2a34..76ae53d821 100644 --- a/tools/editor/editor_resource_preview.cpp +++ b/tools/editor/editor_resource_preview.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -69,9 +69,9 @@ Ref<Texture> EditorResourcePreviewGenerator::generate_from_path(const String& p_ void EditorResourcePreviewGenerator::_bind_methods() { - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::BOOL,"handles",PropertyInfo(Variant::STRING,"type"))); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::OBJECT,"generate:Texture",PropertyInfo(Variant::OBJECT,"from",PROPERTY_HINT_RESOURCE_TYPE,"Resource"))); - ObjectTypeDB::add_virtual_method(get_type_static(),MethodInfo(Variant::OBJECT,"generate_from_path:Texture",PropertyInfo(Variant::STRING,"path",PROPERTY_HINT_FILE))); + ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::BOOL,"handles",PropertyInfo(Variant::STRING,"type"))); + ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::OBJECT,"generate:Texture",PropertyInfo(Variant::OBJECT,"from",PROPERTY_HINT_RESOURCE_TYPE,"Resource"))); + ClassDB::add_virtual_method(get_class_static(),MethodInfo(Variant::OBJECT,"generate_from_path:Texture",PropertyInfo(Variant::STRING,"path",PROPERTY_HINT_FILE))); } @@ -127,7 +127,7 @@ Ref<Texture> EditorResourcePreview::_generate_preview(const QueueItem& p_item,co String type; if (p_item.resource.is_valid()) - type=p_item.resource->get_type(); + type=p_item.resource->get_class(); else type=ResourceLoader::get_resource_type(p_item.path); //print_line("resource type is: "+type); @@ -154,7 +154,7 @@ Ref<Texture> EditorResourcePreview::_generate_preview(const QueueItem& p_item,co // cache the preview in case it's a resource on disk if (generated.is_valid()) { //print_line("was generated"); - int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size"); + int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size"); thumbnail_size*=EDSCALE; //wow it generated a preview... save cache ResourceSaver::save(cache_base+".png",generated); @@ -207,7 +207,7 @@ void EditorResourcePreview::_thread() { //print_line("pop from queue "+item.path); - int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size"); + int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size"); thumbnail_size*=EDSCALE; @@ -221,7 +221,7 @@ void EditorResourcePreview::_thread() { String temp_path=EditorSettings::get_singleton()->get_settings_path().plus_file("tmp"); - String cache_base = Globals::get_singleton()->globalize_path(item.path).md5_text(); + String cache_base = GlobalConfig::get_singleton()->globalize_path(item.path).md5_text(); cache_base = temp_path.plus_file("resthumb-"+cache_base); //does not have it, try to load a cached thumbnail @@ -267,6 +267,8 @@ void EditorResourcePreview::_thread() { memdelete(f); } + cache_valid=false; + if (cache_valid) { texture = ResourceLoader::load(cache_base+".png","ImageTexture",true); @@ -374,13 +376,13 @@ EditorResourcePreview* EditorResourcePreview::get_singleton() { void EditorResourcePreview::_bind_methods() { - ObjectTypeDB::bind_method("_preview_ready",&EditorResourcePreview::_preview_ready); + ClassDB::bind_method("_preview_ready",&EditorResourcePreview::_preview_ready); - ObjectTypeDB::bind_method(_MD("queue_resource_preview","path","receiver","receiver_func","userdata:Variant"),&EditorResourcePreview::queue_resource_preview); - ObjectTypeDB::bind_method(_MD("queue_edited_resource_preview","resource:Resource","receiver","receiver_func","userdata:Variant"),&EditorResourcePreview::queue_edited_resource_preview); - ObjectTypeDB::bind_method(_MD("add_preview_generator","generator:EditorResourcePreviewGenerator"),&EditorResourcePreview::add_preview_generator); - ObjectTypeDB::bind_method(_MD("remove_preview_generator","generator:EditorResourcePreviewGenerator"),&EditorResourcePreview::remove_preview_generator); - ObjectTypeDB::bind_method(_MD("check_for_invalidation","path"),&EditorResourcePreview::check_for_invalidation); + ClassDB::bind_method(_MD("queue_resource_preview","path","receiver","receiver_func","userdata:Variant"),&EditorResourcePreview::queue_resource_preview); + ClassDB::bind_method(_MD("queue_edited_resource_preview","resource:Resource","receiver","receiver_func","userdata:Variant"),&EditorResourcePreview::queue_edited_resource_preview); + ClassDB::bind_method(_MD("add_preview_generator","generator:EditorResourcePreviewGenerator"),&EditorResourcePreview::add_preview_generator); + ClassDB::bind_method(_MD("remove_preview_generator","generator:EditorResourcePreviewGenerator"),&EditorResourcePreview::remove_preview_generator); + ClassDB::bind_method(_MD("check_for_invalidation","path"),&EditorResourcePreview::check_for_invalidation); ADD_SIGNAL(MethodInfo("preview_invalidated",PropertyInfo(Variant::STRING,"path"))); diff --git a/tools/editor/editor_resource_preview.h b/tools/editor/editor_resource_preview.h index 2756360130..e4a593330d 100644 --- a/tools/editor/editor_resource_preview.h +++ b/tools/editor/editor_resource_preview.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -55,7 +55,7 @@ class EditorResourcePreviewGenerator : public Reference { - OBJ_TYPE(EditorResourcePreviewGenerator,Reference ); + GDCLASS(EditorResourcePreviewGenerator,Reference ); protected: @@ -72,7 +72,7 @@ public: class EditorResourcePreview : public Node { - OBJ_TYPE(EditorResourcePreview,Node); + GDCLASS(EditorResourcePreview,Node); static EditorResourcePreview* singleton; diff --git a/tools/editor/editor_run.cpp b/tools/editor/editor_run.cpp index 5fbb4ae2a0..7d79412b3b 100644 --- a/tools/editor/editor_run.cpp +++ b/tools/editor/editor_run.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,7 +39,7 @@ Error EditorRun::run(const String& p_scene,const String p_custom_args,const List List<String> args; - String resource_path = Globals::get_singleton()->get_resource_path(); + String resource_path = GlobalConfig::get_singleton()->get_resource_path(); if (resource_path!="") { args.push_back("-path"); @@ -49,21 +49,12 @@ Error EditorRun::run(const String& p_scene,const String p_custom_args,const List if (true) { args.push_back("-rdebug"); - args.push_back("localhost:"+String::num(GLOBAL_DEF("debug/debug_port", 6007))); + args.push_back("localhost:"+String::num(GLOBAL_GET("network/debug/remote_port"))); } args.push_back("-epid"); args.push_back(String::num(OS::get_singleton()->get_process_ID())); - if (p_custom_args!="") { - - Vector<String> cargs=p_custom_args.split(" ",false); - for(int i=0;i<cargs.size();i++) { - - args.push_back(cargs[i].replace("%20"," ").replace("$scene",p_edited_scene.replace(" ","%20"))); - } - } - if (debug_collisions) { args.push_back("-debugcol"); } @@ -72,7 +63,7 @@ Error EditorRun::run(const String& p_scene,const String p_custom_args,const List args.push_back("-debugnav"); } - int screen = EditorSettings::get_singleton()->get("game_window_placement/screen"); + int screen = EditorSettings::get_singleton()->get("run/window_placement/screen"); if (screen==0) { screen=OS::get_singleton()->get_current_screen(); @@ -87,19 +78,19 @@ Error EditorRun::run(const String& p_scene,const String p_custom_args,const List Size2 desired_size; - desired_size.x=Globals::get_singleton()->get("display/width"); - desired_size.y=Globals::get_singleton()->get("display/height"); + desired_size.x=GlobalConfig::get_singleton()->get("display/width"); + desired_size.y=GlobalConfig::get_singleton()->get("display/height"); Size2 test_size; - test_size.x=Globals::get_singleton()->get("display/test_width"); - test_size.y=Globals::get_singleton()->get("display/test_height"); + test_size.x=GlobalConfig::get_singleton()->get("display/test_width"); + test_size.y=GlobalConfig::get_singleton()->get("display/test_height"); if (test_size.x>0 && test_size.y>0) { desired_size=test_size; } - int window_placement=EditorSettings::get_singleton()->get("game_window_placement/rect"); + int window_placement=EditorSettings::get_singleton()->get("run/window_placement/rect"); switch(window_placement) { case 0: { // default @@ -113,7 +104,7 @@ Error EditorRun::run(const String& p_scene,const String p_custom_args,const List args.push_back(itos(pos.x)+"x"+itos(pos.y)); } break; case 2: { // custom pos - Vector2 pos = EditorSettings::get_singleton()->get("game_window_placement/rect_custom_position"); + Vector2 pos = EditorSettings::get_singleton()->get("run/window_placement/rect_custom_position"); pos+=screen_rect.pos; args.push_back("-p"); args.push_back(itos(pos.x)+"x"+itos(pos.y)); @@ -150,7 +141,12 @@ Error EditorRun::run(const String& p_scene,const String p_custom_args,const List args.push_back(bpoints); } - args.push_back(p_scene); + if (p_custom_args!="") { + Vector<String> cargs=p_custom_args.split(" ",false); + for(int i=0;i<cargs.size();i++) { + args.push_back(cargs[i].replace("$scene",p_scene).replace(" ","%20")); + } + } String exec = OS::get_singleton()->get_executable_path(); diff --git a/tools/editor/editor_run.h b/tools/editor/editor_run.h index 5aa2adf801..78fa892488 100644 --- a/tools/editor/editor_run.h +++ b/tools/editor/editor_run.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/editor_run_native.cpp b/tools/editor/editor_run_native.cpp index edbcc71284..caa1bf5db7 100644 --- a/tools/editor/editor_run_native.cpp +++ b/tools/editor/editor_run_native.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -54,7 +54,8 @@ void EditorRunNative::_notification(int p_what) { Ref<ImageTexture> small_icon = memnew( ImageTexture); small_icon->create_from_image(im); MenuButton *mb = memnew( MenuButton ); - mb->get_popup()->connect("item_pressed",this,"_run_native",varray(E->get())); + mb->get_popup()->connect("id_pressed",this,"_run_native",varray(E->get())); + mb->connect("pressed",this,"_run_native",varray(-1, E->get())); mb->set_icon(small_icon); add_child(mb); menus[E->get()]=mb; @@ -79,13 +80,16 @@ void EditorRunNative::_notification(int p_what) { if (dc==0) { mb->hide(); } else { - mb->get_popup()->clear(); mb->show(); - for(int i=0;i<dc;i++) { - - mb->get_popup()->add_icon_item(get_icon("Play","EditorIcons"),eep->get_device_name(i)); - mb->get_popup()->set_item_tooltip(mb->get_popup()->get_item_count() -1,eep->get_device_info(i)); + if (dc == 1) { + mb->set_tooltip(eep->get_device_name(0) + "\n\n" + eep->get_device_info(0).strip_edges()); + } else { + mb->set_tooltip("Select device from the list"); + for(int i=0;i<dc;i++) { + mb->get_popup()->add_icon_item(get_icon("Play","EditorIcons"),eep->get_device_name(i)); + mb->get_popup()->set_item_tooltip(mb->get_popup()->get_item_count() -1,eep->get_device_info(i).strip_edges()); + } } } } @@ -96,11 +100,18 @@ void EditorRunNative::_notification(int p_what) { } - void EditorRunNative::_run_native(int p_idx,const String& p_platform) { Ref<EditorExportPlatform> eep = EditorImportExport::get_singleton()->get_export_platform(p_platform); ERR_FAIL_COND(eep.is_null()); + if (p_idx == -1) { + if (eep->get_device_count() == 1) { + menus[p_platform]->get_popup()->hide(); + p_idx = 0; + } else { + return; + } + } emit_signal("native_run"); int flags=0; @@ -118,7 +129,7 @@ void EditorRunNative::_run_native(int p_idx,const String& p_platform) { void EditorRunNative::_bind_methods() { - ObjectTypeDB::bind_method("_run_native",&EditorRunNative::_run_native); + ClassDB::bind_method("_run_native",&EditorRunNative::_run_native); ADD_SIGNAL(MethodInfo("native_run")); } diff --git a/tools/editor/editor_run_native.h b/tools/editor/editor_run_native.h index 04dad6b6aa..c62021148b 100644 --- a/tools/editor/editor_run_native.h +++ b/tools/editor/editor_run_native.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,7 +34,7 @@ class EditorRunNative : public HBoxContainer { - OBJ_TYPE(EditorRunNative,BoxContainer); + GDCLASS(EditorRunNative,BoxContainer); Map<StringName,MenuButton*> menus; bool first; diff --git a/tools/editor/editor_run_script.cpp b/tools/editor/editor_run_script.cpp index 765f36d3bc..c8f3f9fc5d 100644 --- a/tools/editor/editor_run_script.cpp +++ b/tools/editor/editor_run_script.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -86,8 +86,8 @@ void EditorScript::set_editor(EditorNode *p_editor) { void EditorScript::_bind_methods() { - ObjectTypeDB::bind_method(_MD("add_root_node","node"),&EditorScript::add_root_node); - ObjectTypeDB::bind_method(_MD("get_scene"),&EditorScript::get_scene); + ClassDB::bind_method(_MD("add_root_node","node"),&EditorScript::add_root_node); + ClassDB::bind_method(_MD("get_scene"),&EditorScript::get_scene); BIND_VMETHOD( MethodInfo("_run") ); diff --git a/tools/editor/editor_run_script.h b/tools/editor/editor_run_script.h index 144fad5ab1..3ab8525cc6 100644 --- a/tools/editor/editor_run_script.h +++ b/tools/editor/editor_run_script.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class EditorNode; class EditorScript : public Reference { - OBJ_TYPE( EditorScript, Reference ); + GDCLASS( EditorScript, Reference ); EditorNode *editor; protected: diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp index 78bfd7cf25..ef2aaeda53 100644 --- a/tools/editor/editor_settings.cpp +++ b/tools/editor/editor_settings.cpp @@ -3,9 +3,9 @@ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ -/* http://www.godotengine.org */ +/* http:/www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -123,8 +123,10 @@ bool EditorSettings::_get(const StringName& p_name,Variant &r_ret) const { } const VariantContainer *v=props.getptr(p_name); - if (!v) + if (!v) { + //print_line("WARNING NOT FOUND: "+String(p_name)); return false; + } r_ret = v->variant; return true; } @@ -257,7 +259,7 @@ void EditorSettings::create() { } }; - ObjectTypeDB::register_type<EditorSettings>(); //otherwise it can't be unserialized + ClassDB::register_class<EditorSettings>(); //otherwise it can't be unserialized String config_file_path; if (config_path!=""){ @@ -307,7 +309,7 @@ void EditorSettings::create() { dir->change_dir("config"); - String pcp=Globals::get_singleton()->get_resource_path(); + String pcp=GlobalConfig::get_singleton()->get_resource_path(); if (pcp.ends_with("/")) pcp=config_path.substr(0,pcp.size()-1); pcp=pcp.get_file()+"-"+pcp.md5_text(); @@ -323,20 +325,13 @@ void EditorSettings::create() { // path at least is validated, so validate config file - config_file_path = config_path+"/"+config_dir+"/editor_settings.tres"; + config_file_path = config_path+"/"+config_dir+"/editor_config.tres"; String open_path = config_file_path; - if (!dir->file_exists("editor_settings.tres")) { - - open_path = config_path+"/"+config_dir+"/editor_settings.xml"; - - if (!dir->file_exists("editor_settings.xml")) { + if (!dir->file_exists("editor_config.tres")) { - memdelete(dir); - WARN_PRINT("Config file does not exist, creating."); - goto fail; - } + goto fail; } memdelete(dir); @@ -402,9 +397,9 @@ String EditorSettings::get_settings_path() const { void EditorSettings::setup_language() { - String lang = get("global/editor_language"); + String lang = get("interface/editor_language"); if (lang=="en") - return; //none to do + return;//none to do for(int i=0;i<translations.size();i++) { if (translations[i]->get_locale()==lang) { @@ -506,158 +501,159 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { best="en"; } - set("global/editor_language",best); - hints["global/editor_language"]=PropertyInfo(Variant::STRING,"global/editor_language",PROPERTY_HINT_ENUM,lang_hint,PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED); + set("interface/editor_language",best); + hints["interface/editor_language"]=PropertyInfo(Variant::STRING,"interface/editor_language",PROPERTY_HINT_ENUM,lang_hint,PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED); } - set("global/hidpi_mode",0); - hints["global/hidpi_mode"]=PropertyInfo(Variant::INT,"global/hidpi_mode",PROPERTY_HINT_ENUM,"Auto,VeryLoDPI,LoDPI,MidDPI,HiDPI",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED); - set("global/show_script_in_scene_tabs",false); - set("global/font_size",14); - hints["global/font_size"]=PropertyInfo(Variant::INT,"global/font_size",PROPERTY_HINT_RANGE,"10,40,1",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED); - set("global/source_font_size",14); - hints["global/source_font_size"]=PropertyInfo(Variant::INT,"global/source_font_size",PROPERTY_HINT_RANGE,"8,96,1",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED); - set("global/custom_font",""); - hints["global/custom_font"]=PropertyInfo(Variant::STRING,"global/custom_font",PROPERTY_HINT_GLOBAL_FILE,"*.fnt",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED); - set("global/custom_theme",""); - hints["global/custom_theme"]=PropertyInfo(Variant::STRING,"global/custom_theme",PROPERTY_HINT_GLOBAL_FILE,"*.res,*.tres,*.theme",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED); - - - set("global/autoscan_project_path",""); - hints["global/autoscan_project_path"]=PropertyInfo(Variant::STRING,"global/autoscan_project_path",PROPERTY_HINT_GLOBAL_DIR); - set("global/default_project_path",""); - hints["global/default_project_path"]=PropertyInfo(Variant::STRING,"global/default_project_path",PROPERTY_HINT_GLOBAL_DIR); - set("global/default_project_export_path",""); + set("interface/hidpi_mode",0); + hints["interface/hidpi_mode"]=PropertyInfo(Variant::INT,"interface/hidpi_mode",PROPERTY_HINT_ENUM,"Auto,VeryLoDPI,LoDPI,MidDPI,HiDPI",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED); + set("interface/show_script_in_scene_tabs",false); + set("interface/font_size",14); + hints["interface/font_size"]=PropertyInfo(Variant::INT,"interface/font_size",PROPERTY_HINT_RANGE,"10,40,1",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED); + set("interface/source_font_size",14); + hints["interface/source_font_size"]=PropertyInfo(Variant::INT,"interface/source_font_size",PROPERTY_HINT_RANGE,"8,96,1",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED); + set("interface/custom_font",""); + hints["interface/custom_font"]=PropertyInfo(Variant::STRING,"interface/custom_font",PROPERTY_HINT_GLOBAL_FILE,"*.fnt",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED); + set("interface/custom_theme",""); + hints["interface/custom_theme"]=PropertyInfo(Variant::STRING,"interface/custom_theme",PROPERTY_HINT_GLOBAL_FILE,"*.res,*.tres,*.theme",PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED); + + + set("filesystem/directories/autoscan_project_path",""); + hints["filesystem/directories/autoscan_project_path"]=PropertyInfo(Variant::STRING,"filesystem/directories/autoscan_project_path",PROPERTY_HINT_GLOBAL_DIR); + set("filesystem/directories/default_project_path",""); + hints["filesystem/directories/default_project_path"]=PropertyInfo(Variant::STRING,"filesystem/directories/default_project_path",PROPERTY_HINT_GLOBAL_DIR); + set("filesystem/directories/default_project_export_path",""); hints["global/default_project_export_path"]=PropertyInfo(Variant::STRING,"global/default_project_export_path",PROPERTY_HINT_GLOBAL_DIR); - set("global/show_script_in_scene_tabs",false); - - - set("text_editor/color_theme","Default"); - hints["text_editor/color_theme"]=PropertyInfo(Variant::STRING,"text_editor/color_theme",PROPERTY_HINT_ENUM,"Default"); - - _load_default_text_editor_theme(); - - set("text_editor/syntax_highlighting", true); + set("interface/show_script_in_scene_tabs",false); - set("text_editor/highlight_all_occurrences", true); - set("text_editor/scroll_past_end_of_file", false); - set("text_editor/tab_size", 4); - hints["text_editor/tab_size"]=PropertyInfo(Variant::INT,"text_editor/tab_size",PROPERTY_HINT_RANGE,"1, 64, 1"); // size of 0 crashes. - set("text_editor/draw_tabs", true); + set("text_editor/theme/color_theme","Default"); + hints["text_editor/theme/color_theme"]=PropertyInfo(Variant::STRING,"text_editor/theme/color_theme",PROPERTY_HINT_ENUM,"Default"); - set("text_editor/line_numbers_zero_padded", false); + set("text_editor/theme/line_spacing",4); - set("text_editor/show_line_numbers", true); - set("text_editor/show_breakpoint_gutter", true); - set("text_editor/show_line_length_guideline", false); - set("text_editor/line_length_guideline_column", 80); - hints["text_editor/line_length_guideline_column"]=PropertyInfo(Variant::INT,"text_editor/line_length_guideline_column",PROPERTY_HINT_RANGE,"20, 160, 10"); - - set("text_editor/trim_trailing_whitespace_on_save", false); - set("text_editor/idle_parse_delay",2); - set("text_editor/create_signal_callbacks",true); - set("text_editor/autosave_interval_secs",0); - - set("text_editor/block_caret", false); - set("text_editor/caret_blink", false); - set("text_editor/caret_blink_speed", 0.65); - hints["text_editor/caret_blink_speed"]=PropertyInfo(Variant::REAL,"text_editor/caret_blink_speed",PROPERTY_HINT_RANGE,"0.1, 10, 0.1"); - - set("text_editor/font",""); - hints["text_editor/font"]=PropertyInfo(Variant::STRING,"text_editor/font",PROPERTY_HINT_GLOBAL_FILE,"*.fnt"); - set("text_editor/auto_brace_complete", false); - set("text_editor/restore_scripts_on_load",true); - - - //set("scenetree_editor/display_old_action_buttons",false); - set("scenetree_editor/start_create_dialog_fully_expanded",false); - set("scenetree_editor/draw_relationship_lines",false); - set("scenetree_editor/relationship_line_color",Color::html("464646")); - - set("grid_map/pick_distance", 5000.0); - - set("3d_editor/grid_color",Color(0,1,0,0.2)); - hints["3d_editor/grid_color"]=PropertyInfo(Variant::COLOR,"3d_editor/grid_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED); - - set("3d_editor/default_fov",45.0); - set("3d_editor/default_z_near",0.1); - set("3d_editor/default_z_far",500.0); - - set("3d_editor/navigation_scheme",0); - hints["3d_editor/navigation_scheme"]=PropertyInfo(Variant::INT,"3d_editor/navigation_scheme",PROPERTY_HINT_ENUM,"Godot,Maya,Modo"); - set("3d_editor/zoom_style",0); - hints["3d_editor/zoom_style"]=PropertyInfo(Variant::INT,"3d_editor/zoom_style",PROPERTY_HINT_ENUM,"Vertical, Horizontal"); - set("3d_editor/orbit_modifier",0); - hints["3d_editor/orbit_modifier"]=PropertyInfo(Variant::INT,"3d_editor/orbit_modifier",PROPERTY_HINT_ENUM,"None,Shift,Alt,Meta,Ctrl"); - set("3d_editor/pan_modifier",1); - hints["3d_editor/pan_modifier"]=PropertyInfo(Variant::INT,"3d_editor/pan_modifier",PROPERTY_HINT_ENUM,"None,Shift,Alt,Meta,Ctrl"); - set("3d_editor/zoom_modifier",4); - hints["3d_editor/zoom_modifier"]=PropertyInfo(Variant::INT,"3d_editor/zoom_modifier",PROPERTY_HINT_ENUM,"None,Shift,Alt,Meta,Ctrl"); - set("3d_editor/emulate_numpad",false); - set("3d_editor/emulate_3_button_mouse", false); - - set("2d_editor/bone_width",5); - set("2d_editor/bone_color1",Color(1.0,1.0,1.0,0.9)); - set("2d_editor/bone_color2",Color(0.75,0.75,0.75,0.9)); - set("2d_editor/bone_selected_color",Color(0.9,0.45,0.45,0.9)); - set("2d_editor/bone_ik_color",Color(0.9,0.9,0.45,0.9)); - - set("2d_editor/keep_margins_when_changing_anchors", false); + _load_default_text_editor_theme(); - set("game_window_placement/rect",0); - hints["game_window_placement/rect"]=PropertyInfo(Variant::INT,"game_window_placement/rect",PROPERTY_HINT_ENUM,"Default,Centered,Custom Position,Force Maximized,Force Full Screen"); + set("text_editor/highlighting/syntax_highlighting", true); + + set("text_editor/highlighting/highlight_all_occurrences", true); + set("text_editor/cursor/scroll_past_end_of_file", false); + + set("text_editor/indent/tab_size", 4); + hints["text_editor/indent/tab_size"]=PropertyInfo(Variant::INT,"text_editor/indent/tab_size",PROPERTY_HINT_RANGE,"1, 64, 1"); // size of 0 crashes. + set("text_editor/indent/draw_tabs", true); + + set("text_editor/line_numbers/show_line_numbers", true); + set("text_editor/line_numbers/line_numbers_zero_padded", false); + set("text_editor/line_numbers/show_breakpoint_gutter", true); + set("text_editor/line_numbers/show_line_length_guideline", false); + set("text_editor/line_numbers/line_length_guideline_column", 80); + hints["text_editor/line_numbers/line_length_guideline_column"]=PropertyInfo(Variant::INT,"text_editor/line_numbers/line_length_guideline_column",PROPERTY_HINT_RANGE,"20, 160, 10"); + + set("text_editor/files/trim_trailing_whitespace_on_save", false); + set("text_editor/completion/idle_parse_delay",2); + set("text_editor/tools/create_signal_callbacks",true); + set("text_editor/files/autosave_interval_secs",0); + + set("text_editor/cursor/block_caret", false); + set("text_editor/cursor/caret_blink", false); + set("text_editor/cursor/caret_blink_speed", 0.65); + hints["text_editor/cursor/caret_blink_speed"]=PropertyInfo(Variant::REAL,"text_editor/cursor/caret_blink_speed",PROPERTY_HINT_RANGE,"0.1, 10, 0.1"); + + set("text_editor/theme/font",""); + hints["text_editor/theme/font"]=PropertyInfo(Variant::STRING,"text_editor/theme/font",PROPERTY_HINT_GLOBAL_FILE,"*.fnt"); + set("text_editor/completion/auto_brace_complete", false); + set("text_editor/files/restore_scripts_on_load",true); + + + //set("docks/scene_tree/display_old_action_buttons",false); + set("docks/scene_tree/start_create_dialog_fully_expanded",false); + set("docks/scene_tree/draw_relationship_lines",false); + set("docks/scene_tree/relationship_line_color",Color::html("464646")); + + set("editors/grid_map/pick_distance", 5000.0); + + set("editors/3d/grid_color",Color(0,1,0,0.2)); + hints["editors/3d/grid_color"]=PropertyInfo(Variant::COLOR,"editors/3d/grid_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT|PROPERTY_USAGE_RESTART_IF_CHANGED); + + set("editors/3d/default_fov",45.0); + set("editors/3d/default_z_near",0.1); + set("editors/3d/default_z_far",500.0); + + set("editors/3d/navigation_scheme",0); + hints["editors/3d/navigation_scheme"]=PropertyInfo(Variant::INT,"editors/3d/navigation_scheme",PROPERTY_HINT_ENUM,"Godot,Maya,Modo"); + set("editors/3d/zoom_style",0); + hints["editors/3d/zoom_style"]=PropertyInfo(Variant::INT,"editors/3d/zoom_style",PROPERTY_HINT_ENUM,"Vertical, Horizontal"); + set("editors/3d/orbit_modifier",0); + hints["editors/3d/orbit_modifier"]=PropertyInfo(Variant::INT,"editors/3d/orbit_modifier",PROPERTY_HINT_ENUM,"None,Shift,Alt,Meta,Ctrl"); + set("editors/3d/pan_modifier",1); + hints["editors/3d/pan_modifier"]=PropertyInfo(Variant::INT,"editors/3d/pan_modifier",PROPERTY_HINT_ENUM,"None,Shift,Alt,Meta,Ctrl"); + set("editors/3d/zoom_modifier",4); + hints["editors/3d/zoom_modifier"]=PropertyInfo(Variant::INT,"editors/3d/zoom_modifier",PROPERTY_HINT_ENUM,"None,Shift,Alt,Meta,Ctrl"); + set("editors/3d/emulate_numpad",false); + set("editors/3d/emulate_3_button_mouse", false); + + set("editors/2d/bone_width",5); + set("editors/2d/bone_color1",Color(1.0,1.0,1.0,0.9)); + set("editors/2d/bone_color2",Color(0.75,0.75,0.75,0.9)); + set("editors/2d/bone_selected_color",Color(0.9,0.45,0.45,0.9)); + set("editors/2d/bone_ik_color",Color(0.9,0.9,0.45,0.9)); + + set("editors/2d/keep_margins_when_changing_anchors", false); + + set("run/window_placement/rect",0); + hints["run/window_placement/rect"]=PropertyInfo(Variant::INT,"run/window_placement/rect",PROPERTY_HINT_ENUM,"Default,Centered,Custom Position,Force Maximized,Force Full Screen"); String screen_hints=TTR("Default (Same as Editor)"); for(int i=0;i<OS::get_singleton()->get_screen_count();i++) { screen_hints+=",Monitor "+itos(i+1); } - set("game_window_placement/rect_custom_position",Vector2()); - set("game_window_placement/screen",0); - hints["game_window_placement/screen"]=PropertyInfo(Variant::INT,"game_window_placement/screen",PROPERTY_HINT_ENUM,screen_hints); + set("run/window_placement/rect_custom_position",Vector2()); + set("run/window_placement/screen",0); + hints["run/window_placement/screen"]=PropertyInfo(Variant::INT,"run/window_placement/screen",PROPERTY_HINT_ENUM,screen_hints); - set("on_save/compress_binary_resources",true); - set("on_save/save_modified_external_resources",true); - //set("on_save/save_paths_as_relative",false); - //set("on_save/save_paths_without_extension",false); + set("filesystem/on_save/compress_binary_resources",true); + set("filesystem/on_save/save_modified_external_resources",true); + //set("filesystem/on_save/save_paths_as_relative",false); + //set("filesystem/on_save/save_paths_without_extension",false); - set("text_editor/create_signal_callbacks",true); + set("text_editor/tools/create_signal_callbacks",true); - set("file_dialog/show_hidden_files", false); - set("file_dialog/display_mode", 0); - hints["file_dialog/display_mode"]=PropertyInfo(Variant::INT,"file_dialog/display_mode",PROPERTY_HINT_ENUM,"Thumbnails,List"); - set("file_dialog/thumbnail_size", 64); - hints["file_dialog/thumbnail_size"]=PropertyInfo(Variant::INT,"file_dialog/thumbnail_size",PROPERTY_HINT_RANGE,"32,128,16"); + set("filesystem/file_dialog/show_hidden_files", false); + set("filesystem/file_dialog/display_mode", 0); + hints["filesystem/file_dialog/display_mode"]=PropertyInfo(Variant::INT,"filesystem/file_dialog/display_mode",PROPERTY_HINT_ENUM,"Thumbnails,List"); + set("filesystem/file_dialog/thumbnail_size", 64); + hints["filesystem/file_dialog/thumbnail_size"]=PropertyInfo(Variant::INT,"filesystem/file_dialog/thumbnail_size",PROPERTY_HINT_RANGE,"32,128,16"); - set("filesystem_dock/display_mode", 0); - hints["filesystem_dock/display_mode"]=PropertyInfo(Variant::INT,"filesystem_dock/display_mode",PROPERTY_HINT_ENUM,"Thumbnails,List"); - set("filesystem_dock/thumbnail_size", 64); - hints["filesystem_dock/thumbnail_size"]=PropertyInfo(Variant::INT,"filesystem_dock/thumbnail_size",PROPERTY_HINT_RANGE,"32,128,16"); + set("docks/filesystem/display_mode", 0); + hints["docks/filesystem/display_mode"]=PropertyInfo(Variant::INT,"docks/filesystem/display_mode",PROPERTY_HINT_ENUM,"Thumbnails,List"); + set("docks/filesystem/thumbnail_size", 64); + hints["docks/filesystem/thumbnail_size"]=PropertyInfo(Variant::INT,"docks/filesystem/thumbnail_size",PROPERTY_HINT_RANGE,"32,128,16"); - set("animation/autorename_animation_tracks",true); - set("animation/confirm_insert_track",true); + set("editors/animation/autorename_animation_tracks",true); + set("editors/animation/confirm_insert_track",true); - set("property_editor/texture_preview_width",48); - set("property_editor/auto_refresh_interval",0.3); - set("help/doc_path",""); + set("docks/property_editor/texture_preview_width",48); + set("docks/property_editor/auto_refresh_interval",0.3); + set("text_editor/help/doc_path",""); - set("import/ask_save_before_reimport",false); + set("filesystem/import/ask_save_before_reimport",false); - set("import/pvrtc_texture_tool",""); + set("filesystem/import/pvrtc_texture_tool",""); #ifdef WINDOWS_ENABLED - hints["import/pvrtc_texture_tool"]=PropertyInfo(Variant::STRING,"import/pvrtc_texture_tool",PROPERTY_HINT_GLOBAL_FILE,"*.exe"); + hints["filesystem/import/pvrtc_texture_tool"]=PropertyInfo(Variant::STRING,"import/pvrtc_texture_tool",PROPERTY_HINT_GLOBAL_FILE,"*.exe"); #else hints["import/pvrtc_texture_tool"]=PropertyInfo(Variant::STRING,"import/pvrtc_texture_tool",PROPERTY_HINT_GLOBAL_FILE,""); #endif - // TODO: Rename to "import/pvrtc_fast_conversion" to match other names? - set("PVRTC/fast_conversion",false); + // TODO: Rename to "filesystem/import/pvrtc_fast_conversion" to match other names? + set("filesystem/import/pvrtc_fast_conversion",false); - set("run/auto_save_before_running",true); - set("resources/save_compressed_resources",true); - set("resources/auto_reload_modified_images",true); + set("run/auto_save/save_before_running",true); + set("filesystem/resources/save_compressed_resources",true); + set("filesystem/resources/auto_reload_modified_images",true); - set("import/automatic_reimport_on_sources_changed",true); + set("filesystem/import/automatic_reimport_on_sources_changed",true); if (p_extra_config.is_valid()) { @@ -691,34 +687,34 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { } void EditorSettings::_load_default_text_editor_theme() { - set("text_editor/background_color",Color::html("3b000000")); - set("text_editor/completion_background_color", Color::html("2C2A32")); - set("text_editor/completion_selected_color", Color::html("434244")); - set("text_editor/completion_existing_color", Color::html("21dfdfdf")); - set("text_editor/completion_scroll_color", Color::html("ffffff")); - set("text_editor/completion_font_color", Color::html("aaaaaa")); - set("text_editor/caret_color",Color::html("aaaaaa")); - set("text_editor/caret_background_color", Color::html("000000")); - set("text_editor/line_number_color",Color::html("66aaaaaa")); - set("text_editor/text_color",Color::html("aaaaaa")); - set("text_editor/text_selected_color",Color::html("000000")); - set("text_editor/keyword_color",Color::html("ffffb3")); - set("text_editor/base_type_color",Color::html("a4ffd4")); - set("text_editor/engine_type_color",Color::html("83d3ff")); - set("text_editor/function_color",Color::html("66a2ce")); - set("text_editor/member_variable_color",Color::html("e64e59")); - set("text_editor/comment_color",Color::html("676767")); - set("text_editor/string_color",Color::html("ef6ebe")); - set("text_editor/number_color",Color::html("EB9532")); - set("text_editor/symbol_color",Color::html("badfff")); - set("text_editor/selection_color",Color::html("7b5dbe")); - set("text_editor/brace_mismatch_color",Color(1,0.2,0.2)); - set("text_editor/current_line_color",Color(0.3,0.5,0.8,0.15)); - set("text_editor/mark_color", Color(1.0,0.4,0.4,0.4)); - set("text_editor/breakpoint_color", Color(0.8,0.8,0.4,0.2)); - set("text_editor/word_highlighted_color",Color(0.8,0.9,0.9,0.15)); - set("text_editor/search_result_color",Color(0.05,0.25,0.05,1)); - set("text_editor/search_result_border_color",Color(0.1,0.45,0.1,1)); + set("text_editor/highlighting/background_color",Color::html("3b000000")); + set("text_editor/highlighting/completion_background_color", Color::html("2C2A32")); + set("text_editor/highlighting/completion_selected_color", Color::html("434244")); + set("text_editor/highlighting/completion_existing_color", Color::html("21dfdfdf")); + set("text_editor/highlighting/completion_scroll_color", Color::html("ffffff")); + set("text_editor/highlighting/completion_font_color", Color::html("aaaaaa")); + set("text_editor/highlighting/caret_color",Color::html("aaaaaa")); + set("text_editor/highlighting/caret_background_color", Color::html("000000")); + set("text_editor/highlighting/line_number_color",Color::html("66aaaaaa")); + set("text_editor/highlighting/text_color",Color::html("aaaaaa")); + set("text_editor/highlighting/text_selected_color",Color::html("000000")); + set("text_editor/highlighting/keyword_color",Color::html("ffffb3")); + set("text_editor/highlighting/base_type_color",Color::html("a4ffd4")); + set("text_editor/highlighting/engine_type_color",Color::html("83d3ff")); + set("text_editor/highlighting/function_color",Color::html("66a2ce")); + set("text_editor/highlighting/member_variable_color",Color::html("e64e59")); + set("text_editor/highlighting/comment_color",Color::html("676767")); + set("text_editor/highlighting/string_color",Color::html("ef6ebe")); + set("text_editor/highlighting/number_color",Color::html("EB9532")); + set("text_editor/highlighting/symbol_color",Color::html("badfff")); + set("text_editor/highlighting/selection_color",Color::html("7b5dbe")); + set("text_editor/highlighting/brace_mismatch_color",Color(1,0.2,0.2)); + set("text_editor/highlighting/current_line_color",Color(0.3,0.5,0.8,0.15)); + set("text_editor/highlighting/mark_color", Color(1.0,0.4,0.4,0.4)); + set("text_editor/highlighting/breakpoint_color", Color(0.8,0.8,0.4,0.2)); + set("text_editor/highlighting/word_highlighted_color",Color(0.8,0.9,0.9,0.15)); + set("text_editor/highlighting/search_result_color",Color(0.05,0.25,0.05,1)); + set("text_editor/highlighting/search_result_border_color",Color(0.1,0.45,0.1,1)); } void EditorSettings::notify_changes() { @@ -854,16 +850,16 @@ void EditorSettings::list_text_editor_themes() { d->list_dir_end(); memdelete(d); } - add_property_hint(PropertyInfo(Variant::STRING,"text_editor/color_theme",PROPERTY_HINT_ENUM,themes)); + add_property_hint(PropertyInfo(Variant::STRING,"text_editor/theme/color_theme",PROPERTY_HINT_ENUM,themes)); } void EditorSettings::load_text_editor_theme() { - if (get("text_editor/color_theme") == "Default") { + if (get("text_editor/theme/color_theme") == "Default") { _load_default_text_editor_theme(); // sorry for "Settings changed" console spam return; } - String theme_path = get_settings_path() + "/text_editor_themes/" + get("text_editor/color_theme") + ".tet"; + String theme_path = get_settings_path() + "/text_editor_themes/" + get("text_editor/theme/color_theme") + ".tet"; Ref<ConfigFile> cf = memnew( ConfigFile ); Error err = cf->load(theme_path); @@ -913,7 +909,7 @@ bool EditorSettings::import_text_editor_theme(String p_file) { bool EditorSettings::save_text_editor_theme() { - String p_file = get("text_editor/color_theme"); + String p_file = get("text_editor/theme/color_theme"); if (p_file.get_file().to_lower() == "default") { return false; @@ -937,7 +933,7 @@ bool EditorSettings::save_text_editor_theme_as(String p_file) { String theme_name = p_file.substr(0, p_file.length() - 4).get_file(); if (p_file.get_base_dir() == get_settings_path() + "/text_editor_themes") { - set("text_editor/color_theme", theme_name); + set("text_editor/theme/color_theme", theme_name); load_text_editor_theme(); } return true; @@ -1051,17 +1047,17 @@ void EditorSettings::set_last_selected_language(String p_language) void EditorSettings::_bind_methods() { - ObjectTypeDB::bind_method(_MD("erase","property"),&EditorSettings::erase); - ObjectTypeDB::bind_method(_MD("get_settings_path"),&EditorSettings::get_settings_path); - ObjectTypeDB::bind_method(_MD("get_project_settings_path"),&EditorSettings::get_project_settings_path); + ClassDB::bind_method(_MD("erase","property"),&EditorSettings::erase); + ClassDB::bind_method(_MD("get_settings_path"),&EditorSettings::get_settings_path); + ClassDB::bind_method(_MD("get_project_settings_path"),&EditorSettings::get_project_settings_path); - ObjectTypeDB::bind_method(_MD("add_property_info", "info"),&EditorSettings::_add_property_info_bind); + ClassDB::bind_method(_MD("add_property_info", "info"),&EditorSettings::_add_property_info_bind); - ObjectTypeDB::bind_method(_MD("set_favorite_dirs","dirs"),&EditorSettings::set_favorite_dirs); - ObjectTypeDB::bind_method(_MD("get_favorite_dirs"),&EditorSettings::get_favorite_dirs); + ClassDB::bind_method(_MD("set_favorite_dirs","dirs"),&EditorSettings::set_favorite_dirs); + ClassDB::bind_method(_MD("get_favorite_dirs"),&EditorSettings::get_favorite_dirs); - ObjectTypeDB::bind_method(_MD("set_recent_dirs","dirs"),&EditorSettings::set_recent_dirs); - ObjectTypeDB::bind_method(_MD("get_recent_dirs"),&EditorSettings::get_recent_dirs); + ClassDB::bind_method(_MD("set_recent_dirs","dirs"),&EditorSettings::set_recent_dirs); + ClassDB::bind_method(_MD("get_recent_dirs"),&EditorSettings::get_recent_dirs); ADD_SIGNAL(MethodInfo("settings_changed")); @@ -1098,7 +1094,6 @@ EditorSettings::EditorSettings() { } _load_defaults(); - save_changed_setting=false; } diff --git a/tools/editor/editor_settings.h b/tools/editor/editor_settings.h index a976602304..c11feef667 100644 --- a/tools/editor/editor_settings.h +++ b/tools/editor/editor_settings.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -41,7 +41,7 @@ class EditorPlugin; class EditorSettings : public Resource { - OBJ_TYPE( EditorSettings, Resource ); + GDCLASS( EditorSettings, Resource ); private: _THREAD_SAFE_CLASS_ diff --git a/tools/editor/editor_sub_scene.cpp b/tools/editor/editor_sub_scene.cpp index d32dbcd2e6..8f1f24f769 100644 --- a/tools/editor/editor_sub_scene.cpp +++ b/tools/editor/editor_sub_scene.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -90,8 +90,8 @@ void EditorSubScene::_fill_tree(Node* p_node,TreeItem *p_parent) { it->set_text(0,p_node->get_name()); it->set_editable(0,false); it->set_selectable(0,true); - if (has_icon(p_node->get_type(),"EditorIcons")) { - it->set_icon(0,get_icon(p_node->get_type(),"EditorIcons")); + if (has_icon(p_node->get_class(),"EditorIcons")) { + it->set_icon(0,get_icon(p_node->get_class(),"EditorIcons")); } @@ -186,9 +186,9 @@ void EditorSubScene::clear() { void EditorSubScene::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_path_selected"),&EditorSubScene::_path_selected); - ObjectTypeDB::bind_method(_MD("_path_changed"),&EditorSubScene::_path_changed); - ObjectTypeDB::bind_method(_MD("_path_browse"),&EditorSubScene::_path_browse); + ClassDB::bind_method(_MD("_path_selected"),&EditorSubScene::_path_selected); + ClassDB::bind_method(_MD("_path_changed"),&EditorSubScene::_path_changed); + ClassDB::bind_method(_MD("_path_browse"),&EditorSubScene::_path_browse); ADD_SIGNAL( MethodInfo("subscene_selected")); } @@ -203,7 +203,7 @@ EditorSubScene::EditorSubScene() { VBoxContainer *vb = memnew( VBoxContainer ); add_child(vb); - set_child_rect(vb); +// set_child_rect(vb); HBoxContainer *hb = memnew( HBoxContainer ); path = memnew( LineEdit ); diff --git a/tools/editor/editor_sub_scene.h b/tools/editor/editor_sub_scene.h index 3dd86eefda..cc9faffc77 100644 --- a/tools/editor/editor_sub_scene.h +++ b/tools/editor/editor_sub_scene.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class EditorSubScene : public ConfirmationDialog { - OBJ_TYPE(EditorSubScene,ConfirmationDialog); + GDCLASS(EditorSubScene,ConfirmationDialog); LineEdit *path; diff --git a/tools/editor/editor_themes.cpp b/tools/editor/editor_themes.cpp index 08f14ec167..56654cad7a 100644 --- a/tools/editor/editor_themes.cpp +++ b/tools/editor/editor_themes.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -62,12 +62,12 @@ Ref<Theme> create_custom_theme() { Ref<Theme> theme; - String custom_theme = EditorSettings::get_singleton()->get("global/custom_theme"); + String custom_theme = EditorSettings::get_singleton()->get("interface/custom_theme"); if (custom_theme!="") { theme = ResourceLoader::load(custom_theme); } - String global_font = EditorSettings::get_singleton()->get("global/custom_font"); + String global_font = EditorSettings::get_singleton()->get("interface/custom_font"); if (global_font!="") { Ref<Font> fnt = ResourceLoader::load(global_font); if (fnt.is_valid()) { diff --git a/tools/editor/editor_themes.h b/tools/editor/editor_themes.h index db49801600..83e7dde78a 100644 --- a/tools/editor/editor_themes.h +++ b/tools/editor/editor_themes.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/file_type_cache.cpp b/tools/editor/file_type_cache.cpp index 8a47f49b03..176205a7df 100644 --- a/tools/editor/file_type_cache.cpp +++ b/tools/editor/file_type_cache.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -55,7 +55,7 @@ void FileTypeCache::set_file_type(const String& p_path,const String& p_type){ void FileTypeCache::load() { GLOBAL_LOCK_FUNCTION - String project=Globals::get_singleton()->get_resource_path(); + String project=GlobalConfig::get_singleton()->get_resource_path(); FileAccess *f =FileAccess::open(project+"/file_type_cache.cch",FileAccess::READ); if (!f) { @@ -81,7 +81,7 @@ void FileTypeCache::load() { void FileTypeCache::save() { GLOBAL_LOCK_FUNCTION - String project=Globals::get_singleton()->get_resource_path(); + String project=GlobalConfig::get_singleton()->get_resource_path(); FileAccess *f =FileAccess::open(project+"/file_type_cache.cch",FileAccess::WRITE); if (!f) { diff --git a/tools/editor/file_type_cache.h b/tools/editor/file_type_cache.h index 18451cbe19..25755f168c 100644 --- a/tools/editor/file_type_cache.h +++ b/tools/editor/file_type_cache.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class FileTypeCache : Object { - OBJ_TYPE(FileTypeCache,Object); + GDCLASS(FileTypeCache,Object); HashMap<String,String> file_type_map; diff --git a/tools/editor/fileserver/editor_file_server.cpp b/tools/editor/fileserver/editor_file_server.cpp index c464e10fc2..d640b0ad1d 100644 --- a/tools/editor/fileserver/editor_file_server.cpp +++ b/tools/editor/fileserver/editor_file_server.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -321,8 +321,8 @@ void EditorFileServer::start() { stop(); - port=EDITOR_DEF("file_server/port",6010); - password=EDITOR_DEF("file_server/password",""); + port=EDITOR_DEF("filesystem/file_server/port",6010); + password=EDITOR_DEF("filesystem/file_server/password",""); cmd=CMD_ACTIVATE; } @@ -346,8 +346,8 @@ EditorFileServer::EditorFileServer() { cmd=CMD_NONE; thread=Thread::create(_thread_start,this); - EDITOR_DEF("file_server/port",6010); - EDITOR_DEF("file_server/password",""); + EDITOR_DEF("filesystem/file_server/port",6010); + EDITOR_DEF("filesystem/file_server/password",""); } EditorFileServer::~EditorFileServer() { diff --git a/tools/editor/fileserver/editor_file_server.h b/tools/editor/fileserver/editor_file_server.h index fcb3d8546c..31f8ae84b8 100644 --- a/tools/editor/fileserver/editor_file_server.h +++ b/tools/editor/fileserver/editor_file_server.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ class EditorFileServer : public Object { - OBJ_TYPE(EditorFileServer,Object); + GDCLASS(EditorFileServer,Object); enum Command { CMD_NONE, diff --git a/tools/editor/filesystem_dock.cpp b/tools/editor/filesystem_dock.cpp index 5b1e80fc3b..1bf91d4ceb 100644 --- a/tools/editor/filesystem_dock.cpp +++ b/tools/editor/filesystem_dock.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -38,14 +38,16 @@ #include "editor_settings.h" #include "scene/main/viewport.h" - bool FileSystemDock::_create_tree(TreeItem *p_parent,EditorFileSystemDirectory *p_dir) { - TreeItem *item = tree->create_item(p_parent); String dname=p_dir->get_name(); if (dname=="") dname="res://"; + else { + // collapse every tree item but the root folder + item->set_collapsed(true); + } item->set_text(0,dname); item->set_icon(0,get_icon("Folder","EditorIcons")); @@ -160,7 +162,8 @@ void FileSystemDock::_notification(int p_what) { button_hist_next->set_icon( get_icon("Forward","EditorIcons")); button_hist_prev->set_icon( get_icon("Back","EditorIcons")); - file_options->connect("item_pressed",this,"_file_option"); + file_options->connect("id_pressed",this,"_file_option"); + folder_options->connect("id_pressed",this,"_folder_option"); button_back->connect("pressed",this,"_go_to_tree",varray(),CONNECT_DEFERRED); @@ -174,7 +177,7 @@ void FileSystemDock::_notification(int p_what) { } break; case NOTIFICATION_PROCESS: { if (EditorFileSystem::get_singleton()->is_scanning()) { - scanning_progress->set_val(EditorFileSystem::get_singleton()->get_scanning_progress()*100); + scanning_progress->set_value(EditorFileSystem::get_singleton()->get_scanning_progress()*100); } } break; case NOTIFICATION_EXIT_TREE: { @@ -201,7 +204,7 @@ void FileSystemDock::_notification(int p_what) { } break; case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: { - int new_mode = int(EditorSettings::get_singleton()->get("filesystem_dock/display_mode")); + int new_mode = int(EditorSettings::get_singleton()->get("docks/filesystem/display_mode")); if (new_mode != display_mode) { set_display_mode(new_mode); @@ -323,7 +326,7 @@ void FileSystemDock::_change_file_display() { button_display_mode->set_icon( get_icon("FileList","EditorIcons")); } - EditorSettings::get_singleton()->set("filesystem_dock/display_mode", display_mode); + EditorSettings::get_singleton()->set("docks/filesystem/display_mode", display_mode); _update_files(true); } @@ -397,7 +400,7 @@ void FileSystemDock::_update_files(bool p_keep_selection) { if (!efd) return; - int thumbnail_size = EditorSettings::get_singleton()->get("filesystem_dock/thumbnail_size"); + int thumbnail_size = EditorSettings::get_singleton()->get("docks/filesystem/thumbnail_size"); thumbnail_size*=EDSCALE; Ref<Texture> folder_thumbnail; Ref<Texture> file_thumbnail; @@ -668,9 +671,9 @@ void FileSystemDock::_set_scannig_mode() { scanning_vb->show(); set_process(true); if (EditorFileSystem::get_singleton()->is_scanning()) { - scanning_progress->set_val(EditorFileSystem::get_singleton()->get_scanning_progress()*100); + scanning_progress->set_value(EditorFileSystem::get_singleton()->get_scanning_progress()*100); } else { - scanning_progress->set_val(0); + scanning_progress->set_value(0); } } @@ -927,7 +930,7 @@ void FileSystemDock::_file_option(int p_option) { String path = files->get_item_metadata(idx); if (p_option == FILE_SHOW_IN_EXPLORER) { - String dir = Globals::get_singleton()->globalize_path(path); + String dir = GlobalConfig::get_singleton()->globalize_path(path); dir = dir.substr(0, dir.find_last("/")); OS::get_singleton()->shell_open(String("file://")+dir); return; @@ -1096,6 +1099,30 @@ void FileSystemDock::_file_option(int p_option) { } } +void FileSystemDock::_folder_option(int p_option) { + + TreeItem *item = tree->get_selected(); + TreeItem *child = item->get_children(); + + switch(p_option) { + + case FOLDER_EXPAND_ALL: + item->set_collapsed(false); + while(child) { + child->set_collapsed(false); + child = child->get_next(); + } + break; + + case FOLDER_COLLAPSE_ALL: + while(child) { + child->set_collapsed(true); + child = child->get_next(); + } + break; + } +} + void FileSystemDock::_open_pressed(){ @@ -1126,6 +1153,17 @@ void FileSystemDock::_open_pressed(){ } +void FileSystemDock::_dir_rmb_pressed(const Vector2& p_pos) { + folder_options->clear(); + folder_options->set_size(Size2(1,1)); + + folder_options->add_item(TTR("Expand all"),FOLDER_EXPAND_ALL); + folder_options->add_item(TTR("Collapse all"),FOLDER_COLLAPSE_ALL); + + folder_options->set_pos(files->get_global_pos() + p_pos); + folder_options->popup(); +} + void FileSystemDock::_search_changed(const String& p_text) { @@ -1581,36 +1619,38 @@ void FileSystemDock::_files_list_rmb_select(int p_item,const Vector2& p_pos) { void FileSystemDock::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_update_tree"),&FileSystemDock::_update_tree); - ObjectTypeDB::bind_method(_MD("_rescan"),&FileSystemDock::_rescan); - ObjectTypeDB::bind_method(_MD("_favorites_pressed"),&FileSystemDock::_favorites_pressed); -// ObjectTypeDB::bind_method(_MD("_instance_pressed"),&ScenesDock::_instance_pressed); - ObjectTypeDB::bind_method(_MD("_open_pressed"),&FileSystemDock::_open_pressed); - - ObjectTypeDB::bind_method(_MD("_thumbnail_done"),&FileSystemDock::_thumbnail_done); - ObjectTypeDB::bind_method(_MD("_select_file"), &FileSystemDock::_select_file); - ObjectTypeDB::bind_method(_MD("_go_to_tree"), &FileSystemDock::_go_to_tree); - ObjectTypeDB::bind_method(_MD("_go_to_dir"), &FileSystemDock::_go_to_dir); - ObjectTypeDB::bind_method(_MD("_change_file_display"), &FileSystemDock::_change_file_display); - ObjectTypeDB::bind_method(_MD("_fw_history"), &FileSystemDock::_fw_history); - ObjectTypeDB::bind_method(_MD("_bw_history"), &FileSystemDock::_bw_history); - ObjectTypeDB::bind_method(_MD("_fs_changed"), &FileSystemDock::_fs_changed); - ObjectTypeDB::bind_method(_MD("_dir_selected"), &FileSystemDock::_dir_selected); - ObjectTypeDB::bind_method(_MD("_file_option"), &FileSystemDock::_file_option); - ObjectTypeDB::bind_method(_MD("_move_operation"), &FileSystemDock::_move_operation); - ObjectTypeDB::bind_method(_MD("_rename_operation"), &FileSystemDock::_rename_operation); - - ObjectTypeDB::bind_method(_MD("_search_changed"), &FileSystemDock::_search_changed); - - ObjectTypeDB::bind_method(_MD("get_drag_data_fw"), &FileSystemDock::get_drag_data_fw); - ObjectTypeDB::bind_method(_MD("can_drop_data_fw"), &FileSystemDock::can_drop_data_fw); - ObjectTypeDB::bind_method(_MD("drop_data_fw"), &FileSystemDock::drop_data_fw); - ObjectTypeDB::bind_method(_MD("_files_list_rmb_select"),&FileSystemDock::_files_list_rmb_select); - - ObjectTypeDB::bind_method(_MD("_preview_invalidated"),&FileSystemDock::_preview_invalidated); - - - ADD_SIGNAL(MethodInfo("instance", PropertyInfo(Variant::STRING_ARRAY, "files"))); + ClassDB::bind_method(_MD("_update_tree"),&FileSystemDock::_update_tree); + ClassDB::bind_method(_MD("_rescan"),&FileSystemDock::_rescan); + ClassDB::bind_method(_MD("_favorites_pressed"),&FileSystemDock::_favorites_pressed); +// ClassDB::bind_method(_MD("_instance_pressed"),&ScenesDock::_instance_pressed); + ClassDB::bind_method(_MD("_open_pressed"),&FileSystemDock::_open_pressed); + ClassDB::bind_method(_MD("_dir_rmb_pressed"),&FileSystemDock::_dir_rmb_pressed); + + ClassDB::bind_method(_MD("_thumbnail_done"),&FileSystemDock::_thumbnail_done); + ClassDB::bind_method(_MD("_select_file"), &FileSystemDock::_select_file); + ClassDB::bind_method(_MD("_go_to_tree"), &FileSystemDock::_go_to_tree); + ClassDB::bind_method(_MD("_go_to_dir"), &FileSystemDock::_go_to_dir); + ClassDB::bind_method(_MD("_change_file_display"), &FileSystemDock::_change_file_display); + ClassDB::bind_method(_MD("_fw_history"), &FileSystemDock::_fw_history); + ClassDB::bind_method(_MD("_bw_history"), &FileSystemDock::_bw_history); + ClassDB::bind_method(_MD("_fs_changed"), &FileSystemDock::_fs_changed); + ClassDB::bind_method(_MD("_dir_selected"), &FileSystemDock::_dir_selected); + ClassDB::bind_method(_MD("_file_option"), &FileSystemDock::_file_option); + ClassDB::bind_method(_MD("_folder_option"), &FileSystemDock::_folder_option); + ClassDB::bind_method(_MD("_move_operation"), &FileSystemDock::_move_operation); + ClassDB::bind_method(_MD("_rename_operation"), &FileSystemDock::_rename_operation); + + ClassDB::bind_method(_MD("_search_changed"), &FileSystemDock::_search_changed); + + ClassDB::bind_method(_MD("get_drag_data_fw"), &FileSystemDock::get_drag_data_fw); + ClassDB::bind_method(_MD("can_drop_data_fw"), &FileSystemDock::can_drop_data_fw); + ClassDB::bind_method(_MD("drop_data_fw"), &FileSystemDock::drop_data_fw); + ClassDB::bind_method(_MD("_files_list_rmb_select"),&FileSystemDock::_files_list_rmb_select); + + ClassDB::bind_method(_MD("_preview_invalidated"),&FileSystemDock::_preview_invalidated); + + + ADD_SIGNAL(MethodInfo("instance", PropertyInfo(Variant::POOL_STRING_ARRAY, "files"))); ADD_SIGNAL(MethodInfo("open")); } @@ -1686,6 +1726,9 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { file_options = memnew( PopupMenu ); add_child(file_options); + folder_options = memnew ( PopupMenu ); + add_child(folder_options); + split_box = memnew( VSplitContainer ); add_child(split_box); split_box->set_v_size_flags(SIZE_EXPAND_FILL); @@ -1695,12 +1738,14 @@ FileSystemDock::FileSystemDock(EditorNode *p_editor) { tree->set_hide_root(true); split_box->add_child(tree); tree->set_drag_forwarding(this); + tree->set_allow_rmb_select(true); //tree->set_v_size_flags(SIZE_EXPAND_FILL); tree->connect("item_edited",this,"_favorite_toggled"); tree->connect("item_activated",this,"_open_pressed"); tree->connect("cell_selected",this,"_dir_selected"); + tree->connect("item_rmb_selected",this,"_dir_rmb_pressed"); files = memnew( ItemList ); files->set_v_size_flags(SIZE_EXPAND_FILL); diff --git a/tools/editor/filesystem_dock.h b/tools/editor/filesystem_dock.h index f5b96760fc..804017be73 100644 --- a/tools/editor/filesystem_dock.h +++ b/tools/editor/filesystem_dock.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -52,7 +52,7 @@ class EditorNode; class FileSystemDock : public VBoxContainer { - OBJ_TYPE( FileSystemDock, VBoxContainer ); + GDCLASS( FileSystemDock, VBoxContainer ); public: enum DisplayMode { @@ -73,6 +73,11 @@ private: FILE_COPY_PATH }; + enum FolderMenu { + FOLDER_EXPAND_ALL, + FOLDER_COLLAPSE_ALL + }; + VBoxContainer *scanning_vb; ProgressBar *scanning_progress; @@ -97,6 +102,7 @@ private: DisplayMode display_mode; PopupMenu *file_options; + PopupMenu *folder_options; DependencyEditor *deps_editor; DependencyEditorOwners *owners_editor; @@ -134,6 +140,7 @@ private: void _file_option(int p_option); + void _folder_option(int p_option); void _update_files(bool p_keep_selection); void _change_file_display(); @@ -151,6 +158,7 @@ private: void _favorites_pressed(); void _open_pressed(); + void _dir_rmb_pressed(const Vector2& local_mouse_pos); void _search_changed(const String& p_text); diff --git a/tools/editor/groups_editor.cpp b/tools/editor/groups_editor.cpp index 5b7bc1da78..07b2bca385 100644 --- a/tools/editor/groups_editor.cpp +++ b/tools/editor/groups_editor.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -147,9 +147,9 @@ void GroupsEditor::set_current(Node* p_node) { void GroupsEditor::_bind_methods() { - ObjectTypeDB::bind_method("_add_group",&GroupsEditor::_add_group); - ObjectTypeDB::bind_method("_remove_group",&GroupsEditor::_remove_group); - ObjectTypeDB::bind_method("update_tree",&GroupsEditor::update_tree); + ClassDB::bind_method("_add_group",&GroupsEditor::_add_group); + ClassDB::bind_method("_remove_group",&GroupsEditor::_remove_group); + ClassDB::bind_method("update_tree",&GroupsEditor::update_tree); } GroupsEditor::GroupsEditor() { diff --git a/tools/editor/groups_editor.h b/tools/editor/groups_editor.h index 6edb577140..9ab75c6cfd 100644 --- a/tools/editor/groups_editor.h +++ b/tools/editor/groups_editor.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -41,7 +41,7 @@ class GroupsEditor : public VBoxContainer { - OBJ_TYPE(GroupsEditor,VBoxContainer); + GDCLASS(GroupsEditor,VBoxContainer); Node *node; diff --git a/tools/editor/icons/2x/icon_bit_map.png b/tools/editor/icons/2x/icon_bit_map.png Binary files differnew file mode 100644 index 0000000000..7372b85944 --- /dev/null +++ b/tools/editor/icons/2x/icon_bit_map.png diff --git a/tools/editor/icons/2x/icon_cube_map.png b/tools/editor/icons/2x/icon_cube_map.png Binary files differnew file mode 100644 index 0000000000..0edf82a88e --- /dev/null +++ b/tools/editor/icons/2x/icon_cube_map.png diff --git a/tools/editor/icons/2x/icon_curve_2d.png b/tools/editor/icons/2x/icon_curve_2d.png Binary files differnew file mode 100644 index 0000000000..69a6f9a9dc --- /dev/null +++ b/tools/editor/icons/2x/icon_curve_2d.png diff --git a/tools/editor/icons/2x/icon_curve_3d.png b/tools/editor/icons/2x/icon_curve_3d.png Binary files differnew file mode 100644 index 0000000000..e989df4769 --- /dev/null +++ b/tools/editor/icons/2x/icon_curve_3d.png diff --git a/tools/editor/icons/2x/icon_environment.png b/tools/editor/icons/2x/icon_environment.png Binary files differnew file mode 100644 index 0000000000..4c4c30b0e5 --- /dev/null +++ b/tools/editor/icons/2x/icon_environment.png diff --git a/tools/editor/icons/2x/icon_fixed_spatial_material.png b/tools/editor/icons/2x/icon_fixed_spatial_material.png Binary files differnew file mode 100644 index 0000000000..b95e78d6cc --- /dev/null +++ b/tools/editor/icons/2x/icon_fixed_spatial_material.png diff --git a/tools/editor/icons/2x/icon_g_i_probe.png b/tools/editor/icons/2x/icon_g_i_probe.png Binary files differnew file mode 100644 index 0000000000..921f1cca42 --- /dev/null +++ b/tools/editor/icons/2x/icon_g_i_probe.png diff --git a/tools/editor/icons/2x/icon_g_i_probe_data.png b/tools/editor/icons/2x/icon_g_i_probe_data.png Binary files differnew file mode 100644 index 0000000000..69c4ed7184 --- /dev/null +++ b/tools/editor/icons/2x/icon_g_i_probe_data.png diff --git a/tools/editor/icons/2x/icon_image_sky_box.png b/tools/editor/icons/2x/icon_image_sky_box.png Binary files differnew file mode 100644 index 0000000000..487178afab --- /dev/null +++ b/tools/editor/icons/2x/icon_image_sky_box.png diff --git a/tools/editor/icons/2x/icon_interp_wrap_clamp.png b/tools/editor/icons/2x/icon_interp_wrap_clamp.png Binary files differnew file mode 100644 index 0000000000..93a5bc56ee --- /dev/null +++ b/tools/editor/icons/2x/icon_interp_wrap_clamp.png diff --git a/tools/editor/icons/2x/icon_interp_wrap_loop.png b/tools/editor/icons/2x/icon_interp_wrap_loop.png Binary files differnew file mode 100644 index 0000000000..3e656f7b07 --- /dev/null +++ b/tools/editor/icons/2x/icon_interp_wrap_loop.png diff --git a/tools/editor/icons/2x/icon_joystick.png b/tools/editor/icons/2x/icon_joypad.png Binary files differindex 285d048544..285d048544 100644 --- a/tools/editor/icons/2x/icon_joystick.png +++ b/tools/editor/icons/2x/icon_joypad.png diff --git a/tools/editor/icons/2x/icon_large_texture.png b/tools/editor/icons/2x/icon_large_texture.png Binary files differnew file mode 100644 index 0000000000..dd1ec86d39 --- /dev/null +++ b/tools/editor/icons/2x/icon_large_texture.png diff --git a/tools/editor/icons/2x/icon_load.png b/tools/editor/icons/2x/icon_load.png Binary files differindex 729eedd2dd..759381d636 100644 --- a/tools/editor/icons/2x/icon_load.png +++ b/tools/editor/icons/2x/icon_load.png diff --git a/tools/editor/icons/2x/icon_mesh_library.png b/tools/editor/icons/2x/icon_mesh_library.png Binary files differnew file mode 100644 index 0000000000..2495e4a037 --- /dev/null +++ b/tools/editor/icons/2x/icon_mesh_library.png diff --git a/tools/editor/icons/2x/icon_navigation_mesh.png b/tools/editor/icons/2x/icon_navigation_mesh.png Binary files differnew file mode 100644 index 0000000000..35b893c3bb --- /dev/null +++ b/tools/editor/icons/2x/icon_navigation_mesh.png diff --git a/tools/editor/icons/2x/icon_navigation_polygon.png b/tools/editor/icons/2x/icon_navigation_polygon.png Binary files differnew file mode 100644 index 0000000000..3f4845e206 --- /dev/null +++ b/tools/editor/icons/2x/icon_navigation_polygon.png diff --git a/tools/editor/icons/2x/icon_open.png b/tools/editor/icons/2x/icon_open.png Binary files differnew file mode 100644 index 0000000000..2e797c448b --- /dev/null +++ b/tools/editor/icons/2x/icon_open.png diff --git a/tools/editor/icons/2x/icon_packed_data_container.png b/tools/editor/icons/2x/icon_packed_data_container.png Binary files differnew file mode 100644 index 0000000000..958e41ede2 --- /dev/null +++ b/tools/editor/icons/2x/icon_packed_data_container.png diff --git a/tools/editor/icons/2x/icon_particles_shader.png b/tools/editor/icons/2x/icon_particles_shader.png Binary files differnew file mode 100644 index 0000000000..26ce8f6809 --- /dev/null +++ b/tools/editor/icons/2x/icon_particles_shader.png diff --git a/tools/editor/icons/2x/icon_polygon_path_finder.png b/tools/editor/icons/2x/icon_polygon_path_finder.png Binary files differnew file mode 100644 index 0000000000..ee6423c265 --- /dev/null +++ b/tools/editor/icons/2x/icon_polygon_path_finder.png diff --git a/tools/editor/icons/2x/icon_reflection_probe.png b/tools/editor/icons/2x/icon_reflection_probe.png Binary files differnew file mode 100644 index 0000000000..5604b403df --- /dev/null +++ b/tools/editor/icons/2x/icon_reflection_probe.png diff --git a/tools/editor/icons/2x/icon_room.png b/tools/editor/icons/2x/icon_room.png Binary files differindex e5e5bb52f8..946f95e955 100644 --- a/tools/editor/icons/2x/icon_room.png +++ b/tools/editor/icons/2x/icon_room.png diff --git a/tools/editor/icons/2x/icon_room_bounds.png b/tools/editor/icons/2x/icon_room_bounds.png Binary files differnew file mode 100644 index 0000000000..94da9c437d --- /dev/null +++ b/tools/editor/icons/2x/icon_room_bounds.png diff --git a/tools/editor/icons/2x/icon_sample_library.png b/tools/editor/icons/2x/icon_sample_library.png Binary files differnew file mode 100644 index 0000000000..3f76a78aca --- /dev/null +++ b/tools/editor/icons/2x/icon_sample_library.png diff --git a/tools/editor/icons/2x/icon_script_create.png b/tools/editor/icons/2x/icon_script_create.png Binary files differindex 67f80e8760..f1e25efe1c 100644 --- a/tools/editor/icons/2x/icon_script_create.png +++ b/tools/editor/icons/2x/icon_script_create.png diff --git a/tools/editor/icons/2x/icon_short_cut.png b/tools/editor/icons/2x/icon_short_cut.png Binary files differnew file mode 100644 index 0000000000..58c3e08ca4 --- /dev/null +++ b/tools/editor/icons/2x/icon_short_cut.png diff --git a/tools/editor/icons/2x/icon_spatial_shader.png b/tools/editor/icons/2x/icon_spatial_shader.png Binary files differnew file mode 100644 index 0000000000..68f6cf8dac --- /dev/null +++ b/tools/editor/icons/2x/icon_spatial_shader.png diff --git a/tools/editor/icons/2x/icon_sprite_frames.png b/tools/editor/icons/2x/icon_sprite_frames.png Binary files differnew file mode 100644 index 0000000000..263f5c4aad --- /dev/null +++ b/tools/editor/icons/2x/icon_sprite_frames.png diff --git a/tools/editor/icons/2x/icon_style_box_empty.png b/tools/editor/icons/2x/icon_style_box_empty.png Binary files differnew file mode 100644 index 0000000000..e790af4de4 --- /dev/null +++ b/tools/editor/icons/2x/icon_style_box_empty.png diff --git a/tools/editor/icons/2x/icon_style_box_flat.png b/tools/editor/icons/2x/icon_style_box_flat.png Binary files differnew file mode 100644 index 0000000000..1cd5c7f69a --- /dev/null +++ b/tools/editor/icons/2x/icon_style_box_flat.png diff --git a/tools/editor/icons/2x/icon_style_box_texture.png b/tools/editor/icons/2x/icon_style_box_texture.png Binary files differnew file mode 100644 index 0000000000..a93e0228bd --- /dev/null +++ b/tools/editor/icons/2x/icon_style_box_texture.png diff --git a/tools/editor/icons/2x/icon_test_cube.png b/tools/editor/icons/2x/icon_test_cube.png Binary files differindex 13d54db87d..f2e523be3f 100644 --- a/tools/editor/icons/2x/icon_test_cube.png +++ b/tools/editor/icons/2x/icon_test_cube.png diff --git a/tools/editor/icons/2x/icon_theme.png b/tools/editor/icons/2x/icon_theme.png Binary files differnew file mode 100644 index 0000000000..55b51428dd --- /dev/null +++ b/tools/editor/icons/2x/icon_theme.png diff --git a/tools/editor/icons/2x/icon_tile_set.png b/tools/editor/icons/2x/icon_tile_set.png Binary files differnew file mode 100644 index 0000000000..9fbd0b4719 --- /dev/null +++ b/tools/editor/icons/2x/icon_tile_set.png diff --git a/tools/editor/icons/2x/icon_viewport_texture.png b/tools/editor/icons/2x/icon_viewport_texture.png Binary files differnew file mode 100644 index 0000000000..f798f1d221 --- /dev/null +++ b/tools/editor/icons/2x/icon_viewport_texture.png diff --git a/tools/editor/icons/2x/icon_world.png b/tools/editor/icons/2x/icon_world.png Binary files differnew file mode 100644 index 0000000000..51b587c01e --- /dev/null +++ b/tools/editor/icons/2x/icon_world.png diff --git a/tools/editor/icons/2x/icon_world_2d.png b/tools/editor/icons/2x/icon_world_2d.png Binary files differnew file mode 100644 index 0000000000..e9cfa10461 --- /dev/null +++ b/tools/editor/icons/2x/icon_world_2d.png diff --git a/tools/editor/icons/SCsub b/tools/editor/icons/SCsub index af6ebd67fd..f86ae2b10d 100644 --- a/tools/editor/icons/SCsub +++ b/tools/editor/icons/SCsub @@ -63,7 +63,7 @@ def make_editor_icons_action(target, source, env): s.write("\tRef<ImageTexture> texture( memnew( ImageTexture ) );\n") s.write("\tbool use_hidpi_image=(editor_get_scale()>1.0&&p_hidpi_png);\n") s.write("\tImage img(use_hidpi_image?p_hidpi_png:p_png);\n") - s.write("\tif (editor_get_scale()>1.0 && !p_hidpi_png) { img.convert(Image::FORMAT_RGBA); img.expand_x2_hq2x(); use_hidpi_image=true;}\n") + s.write("\tif (editor_get_scale()>1.0 && !p_hidpi_png) { img.convert(Image::FORMAT_RGBA8); img.expand_x2_hq2x(); use_hidpi_image=true;}\n") s.write("\timg.resize(img.get_width()*EDSCALE/(use_hidpi_image?2:1),img.get_height()*EDSCALE/(use_hidpi_image?2:1));\n") s.write("\ttexture->create_from_image( img,ImageTexture::FLAG_FILTER );\n") s.write("\treturn texture;\n") diff --git a/tools/editor/icons/icon_bit_map.png b/tools/editor/icons/icon_bit_map.png Binary files differnew file mode 100644 index 0000000000..50dd8157d1 --- /dev/null +++ b/tools/editor/icons/icon_bit_map.png diff --git a/tools/editor/icons/icon_cube_map.png b/tools/editor/icons/icon_cube_map.png Binary files differnew file mode 100644 index 0000000000..9c4c6fdc9f --- /dev/null +++ b/tools/editor/icons/icon_cube_map.png diff --git a/tools/editor/icons/icon_curve_2d.png b/tools/editor/icons/icon_curve_2d.png Binary files differnew file mode 100644 index 0000000000..ce46dcaad4 --- /dev/null +++ b/tools/editor/icons/icon_curve_2d.png diff --git a/tools/editor/icons/icon_curve_3d.png b/tools/editor/icons/icon_curve_3d.png Binary files differnew file mode 100644 index 0000000000..561837e4de --- /dev/null +++ b/tools/editor/icons/icon_curve_3d.png diff --git a/tools/editor/icons/icon_environment.png b/tools/editor/icons/icon_environment.png Binary files differnew file mode 100644 index 0000000000..c8c4da3e8f --- /dev/null +++ b/tools/editor/icons/icon_environment.png diff --git a/tools/editor/icons/icon_fixed_spatial_material.png b/tools/editor/icons/icon_fixed_spatial_material.png Binary files differnew file mode 100644 index 0000000000..2e52c45a46 --- /dev/null +++ b/tools/editor/icons/icon_fixed_spatial_material.png diff --git a/tools/editor/icons/icon_g_i_probe.png b/tools/editor/icons/icon_g_i_probe.png Binary files differnew file mode 100644 index 0000000000..a15ae18675 --- /dev/null +++ b/tools/editor/icons/icon_g_i_probe.png diff --git a/tools/editor/icons/icon_g_i_probe_data.png b/tools/editor/icons/icon_g_i_probe_data.png Binary files differnew file mode 100644 index 0000000000..0aabcc49cb --- /dev/null +++ b/tools/editor/icons/icon_g_i_probe_data.png diff --git a/tools/editor/icons/icon_image_sky_box.png b/tools/editor/icons/icon_image_sky_box.png Binary files differnew file mode 100644 index 0000000000..cf80258577 --- /dev/null +++ b/tools/editor/icons/icon_image_sky_box.png diff --git a/tools/editor/icons/icon_interp_wrap_clamp.png b/tools/editor/icons/icon_interp_wrap_clamp.png Binary files differnew file mode 100644 index 0000000000..1024bd7d29 --- /dev/null +++ b/tools/editor/icons/icon_interp_wrap_clamp.png diff --git a/tools/editor/icons/icon_interp_wrap_loop.png b/tools/editor/icons/icon_interp_wrap_loop.png Binary files differnew file mode 100644 index 0000000000..3a7ddacdb2 --- /dev/null +++ b/tools/editor/icons/icon_interp_wrap_loop.png diff --git a/tools/editor/icons/icon_joystick.png b/tools/editor/icons/icon_joypad.png Binary files differindex 5df471109a..5df471109a 100644 --- a/tools/editor/icons/icon_joystick.png +++ b/tools/editor/icons/icon_joypad.png diff --git a/tools/editor/icons/icon_large_texture.png b/tools/editor/icons/icon_large_texture.png Binary files differnew file mode 100644 index 0000000000..1727e2409f --- /dev/null +++ b/tools/editor/icons/icon_large_texture.png diff --git a/tools/editor/icons/icon_load.png b/tools/editor/icons/icon_load.png Binary files differindex 98da8135f2..81835efa25 100644 --- a/tools/editor/icons/icon_load.png +++ b/tools/editor/icons/icon_load.png diff --git a/tools/editor/icons/icon_mesh_library.png b/tools/editor/icons/icon_mesh_library.png Binary files differnew file mode 100644 index 0000000000..0bb37b1da3 --- /dev/null +++ b/tools/editor/icons/icon_mesh_library.png diff --git a/tools/editor/icons/icon_navigation_mesh.png b/tools/editor/icons/icon_navigation_mesh.png Binary files differnew file mode 100644 index 0000000000..e3bb7f775f --- /dev/null +++ b/tools/editor/icons/icon_navigation_mesh.png diff --git a/tools/editor/icons/icon_navigation_polygon.png b/tools/editor/icons/icon_navigation_polygon.png Binary files differnew file mode 100644 index 0000000000..bfc4bfb542 --- /dev/null +++ b/tools/editor/icons/icon_navigation_polygon.png diff --git a/tools/editor/icons/icon_open.png b/tools/editor/icons/icon_open.png Binary files differnew file mode 100644 index 0000000000..cc05e98ebb --- /dev/null +++ b/tools/editor/icons/icon_open.png diff --git a/tools/editor/icons/icon_packed_data_container.png b/tools/editor/icons/icon_packed_data_container.png Binary files differnew file mode 100644 index 0000000000..af89da48a9 --- /dev/null +++ b/tools/editor/icons/icon_packed_data_container.png diff --git a/tools/editor/icons/icon_particles_shader.png b/tools/editor/icons/icon_particles_shader.png Binary files differnew file mode 100644 index 0000000000..3b5c5644b2 --- /dev/null +++ b/tools/editor/icons/icon_particles_shader.png diff --git a/tools/editor/icons/icon_polygon_path_finder.png b/tools/editor/icons/icon_polygon_path_finder.png Binary files differnew file mode 100644 index 0000000000..9d76d872db --- /dev/null +++ b/tools/editor/icons/icon_polygon_path_finder.png diff --git a/tools/editor/icons/icon_reflection_probe.png b/tools/editor/icons/icon_reflection_probe.png Binary files differnew file mode 100644 index 0000000000..a6646114fb --- /dev/null +++ b/tools/editor/icons/icon_reflection_probe.png diff --git a/tools/editor/icons/icon_room.png b/tools/editor/icons/icon_room.png Binary files differindex 9390391279..840db145fd 100644 --- a/tools/editor/icons/icon_room.png +++ b/tools/editor/icons/icon_room.png diff --git a/tools/editor/icons/icon_room_bounds.png b/tools/editor/icons/icon_room_bounds.png Binary files differnew file mode 100644 index 0000000000..15b198e821 --- /dev/null +++ b/tools/editor/icons/icon_room_bounds.png diff --git a/tools/editor/icons/icon_sample_library.png b/tools/editor/icons/icon_sample_library.png Binary files differnew file mode 100644 index 0000000000..5921aa86e7 --- /dev/null +++ b/tools/editor/icons/icon_sample_library.png diff --git a/tools/editor/icons/icon_script_create.png b/tools/editor/icons/icon_script_create.png Binary files differindex f5d8b0cfd6..86c19f748b 100644 --- a/tools/editor/icons/icon_script_create.png +++ b/tools/editor/icons/icon_script_create.png diff --git a/tools/editor/icons/icon_short_cut.png b/tools/editor/icons/icon_short_cut.png Binary files differnew file mode 100644 index 0000000000..22e15c3889 --- /dev/null +++ b/tools/editor/icons/icon_short_cut.png diff --git a/tools/editor/icons/icon_spatial_shader.png b/tools/editor/icons/icon_spatial_shader.png Binary files differnew file mode 100644 index 0000000000..7608fc9036 --- /dev/null +++ b/tools/editor/icons/icon_spatial_shader.png diff --git a/tools/editor/icons/icon_sprite_frames.png b/tools/editor/icons/icon_sprite_frames.png Binary files differnew file mode 100644 index 0000000000..5576b24f2e --- /dev/null +++ b/tools/editor/icons/icon_sprite_frames.png diff --git a/tools/editor/icons/icon_style_box_empty.png b/tools/editor/icons/icon_style_box_empty.png Binary files differnew file mode 100644 index 0000000000..f595eaaa57 --- /dev/null +++ b/tools/editor/icons/icon_style_box_empty.png diff --git a/tools/editor/icons/icon_style_box_flat.png b/tools/editor/icons/icon_style_box_flat.png Binary files differnew file mode 100644 index 0000000000..6ec6a6dd35 --- /dev/null +++ b/tools/editor/icons/icon_style_box_flat.png diff --git a/tools/editor/icons/icon_style_box_texture.png b/tools/editor/icons/icon_style_box_texture.png Binary files differnew file mode 100644 index 0000000000..f649508418 --- /dev/null +++ b/tools/editor/icons/icon_style_box_texture.png diff --git a/tools/editor/icons/icon_test_cube.png b/tools/editor/icons/icon_test_cube.png Binary files differindex 6a16fb5092..4d11a69c3e 100644 --- a/tools/editor/icons/icon_test_cube.png +++ b/tools/editor/icons/icon_test_cube.png diff --git a/tools/editor/icons/icon_theme.png b/tools/editor/icons/icon_theme.png Binary files differnew file mode 100644 index 0000000000..55d799c722 --- /dev/null +++ b/tools/editor/icons/icon_theme.png diff --git a/tools/editor/icons/icon_tile_set.png b/tools/editor/icons/icon_tile_set.png Binary files differnew file mode 100644 index 0000000000..a1c3fccddd --- /dev/null +++ b/tools/editor/icons/icon_tile_set.png diff --git a/tools/editor/icons/icon_viewport_texture.png b/tools/editor/icons/icon_viewport_texture.png Binary files differnew file mode 100644 index 0000000000..ae744cc407 --- /dev/null +++ b/tools/editor/icons/icon_viewport_texture.png diff --git a/tools/editor/icons/icon_world.png b/tools/editor/icons/icon_world.png Binary files differnew file mode 100644 index 0000000000..d54b979cad --- /dev/null +++ b/tools/editor/icons/icon_world.png diff --git a/tools/editor/icons/icon_world_2d.png b/tools/editor/icons/icon_world_2d.png Binary files differnew file mode 100644 index 0000000000..ebe54262ff --- /dev/null +++ b/tools/editor/icons/icon_world_2d.png diff --git a/tools/editor/icons/source/icon_bit_map.svg b/tools/editor/icons/source/icon_bit_map.svg new file mode 100644 index 0000000000..fbaf573af6 --- /dev/null +++ b/tools/editor/icons/source/icon_bit_map.svg @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_bit_map.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="32" + inkscape:cx="-0.178935" + inkscape:cy="8.367044" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:object-paths="false" + inkscape:snap-intersection-paths="false" + inkscape:object-nodes="true" + inkscape:snap-smooth-nodes="true" + inkscape:snap-midpoints="true"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 1 1 L 1 3 L 3 3 L 3 1 L 1 1 z M 3 3 L 3 5 L 5 5 L 5 3 L 3 3 z M 5 3 L 7 3 L 7 1 L 5 1 L 5 3 z M 7 3 L 7 5 L 9 5 L 9 3 L 7 3 z M 9 3 L 11 3 L 11 1 L 9 1 L 9 3 z M 11 3 L 11 5 L 13 5 L 13 3 L 11 3 z M 13 3 L 15 3 L 15 1 L 13 1 L 13 3 z M 13 5 L 13 7 L 15 7 L 15 5 L 13 5 z M 13 7 L 11 7 L 11 9 L 13 9 L 13 7 z M 13 9 L 13 11 L 15 11 L 15 9 L 13 9 z M 13 11 L 11 11 L 11 13 L 13 13 L 13 11 z M 13 13 L 13 15 L 15 15 L 15 13 L 13 13 z M 11 13 L 9 13 L 9 15 L 11 15 L 11 13 z M 9 13 L 9 11 L 7 11 L 7 13 L 9 13 z M 7 13 L 5 13 L 5 15 L 7 15 L 7 13 z M 5 13 L 5 11 L 3 11 L 3 13 L 5 13 z M 3 13 L 1 13 L 1 15 L 3 15 L 3 13 z M 3 11 L 3 9 L 1 9 L 1 11 L 3 11 z M 3 9 L 5 9 L 5 7 L 3 7 L 3 9 z M 3 7 L 3 5 L 1 5 L 1 7 L 3 7 z M 5 7 L 7 7 L 7 5 L 5 5 L 5 7 z M 7 7 L 7 9 L 9 9 L 9 7 L 7 7 z M 9 7 L 11 7 L 11 5 L 9 5 L 9 7 z M 9 9 L 9 11 L 11 11 L 11 9 L 9 9 z M 7 9 L 5 9 L 5 11 L 7 11 L 7 9 z " + id="rect4170" + transform="translate(0,1036.3622)" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_cube_map.svg b/tools/editor/icons/source/icon_cube_map.svg new file mode 100644 index 0000000000..4fd86b1233 --- /dev/null +++ b/tools/editor/icons/source/icon_cube_map.svg @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + sodipodi:docname="icon_cube_map.svg" + inkscape:export-ydpi="90" + inkscape:export-xdpi="90" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_box_shape.png" + inkscape:version="0.91 r13725" + version="1.1" + id="svg2" + viewBox="0 0 16 16" + height="16" + width="16"> + <sodipodi:namedview + inkscape:snap-smooth-nodes="true" + inkscape:object-nodes="true" + inkscape:snap-intersection-paths="false" + inkscape:object-paths="false" + inkscape:window-maximized="1" + inkscape:window-y="27" + inkscape:window-x="0" + inkscape:window-height="1016" + inkscape:window-width="1920" + inkscape:snap-center="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:bbox-nodes="true" + inkscape:bbox-paths="true" + inkscape:snap-bbox="true" + units="px" + showgrid="true" + inkscape:current-layer="layer1" + inkscape:document-units="px" + inkscape:cy="11.01934" + inkscape:cx="19.581751" + inkscape:zoom="16" + inkscape:pageshadow="2" + inkscape:pageopacity="0.0" + borderopacity="1.0" + bordercolor="#666666" + pagecolor="#ffffff" + id="base" + inkscape:snap-midpoints="true"> + <inkscape:grid + id="grid3336" + type="xygrid" + empspacing="4" /> + </sodipodi:namedview> + <defs + id="defs4" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + transform="translate(0,-1036.3622)" + id="layer1" + inkscape:groupmode="layer" + inkscape:label="Layer 1"> + <rect + style="opacity:1;fill:#84ffb1;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4161" + width="4" + height="4" + x="0" + y="1042.3622" /> + <rect + y="1042.3622" + x="4" + height="4" + width="4" + id="rect4167" + style="opacity:1;fill:#ff8484;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + style="opacity:1;fill:#84ffb1;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4169" + width="4" + height="4" + x="8" + y="1042.3622" /> + <rect + y="1042.3622" + x="12" + height="4" + width="4" + id="rect4171" + style="opacity:1;fill:#ff8484;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + style="opacity:1;fill:#84c2ff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4173" + width="4" + height="4" + x="4" + y="1038.3622" /> + <rect + y="1046.3622" + x="4" + height="4" + width="4" + id="rect4175" + style="opacity:1;fill:#84c2ff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_curve_2d.svg b/tools/editor/icons/source/icon_curve_2d.svg new file mode 100644 index 0000000000..34719e37de --- /dev/null +++ b/tools/editor/icons/source/icon_curve_2d.svg @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + sodipodi:docname="icon_curve_2d.svg" + inkscape:export-ydpi="90" + inkscape:export-xdpi="90" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_box_shape.png" + inkscape:version="0.91 r13725" + version="1.1" + id="svg2" + viewBox="0 0 16 16" + height="16" + width="16"> + <sodipodi:namedview + inkscape:snap-smooth-nodes="false" + inkscape:object-nodes="false" + inkscape:snap-intersection-paths="false" + inkscape:object-paths="false" + inkscape:window-maximized="1" + inkscape:window-y="27" + inkscape:window-x="0" + inkscape:window-height="1016" + inkscape:window-width="1920" + inkscape:snap-center="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:bbox-nodes="true" + inkscape:bbox-paths="true" + inkscape:snap-bbox="true" + units="px" + showgrid="true" + inkscape:current-layer="layer1" + inkscape:document-units="px" + inkscape:cy="7.8406355" + inkscape:cx="5.0331401" + inkscape:zoom="22.627416" + inkscape:pageshadow="2" + inkscape:pageopacity="0.0" + borderopacity="1.0" + bordercolor="#666666" + pagecolor="#ffffff" + id="base"> + <inkscape:grid + id="grid3336" + type="xygrid" + empspacing="4" /> + </sodipodi:namedview> + <defs + id="defs4" /> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + transform="translate(0,-1036.3622)" + id="layer1" + inkscape:groupmode="layer" + inkscape:label="Layer 1"> + <path + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="m 14,1037.3613 c -3.166667,0 -5.1044619,0.854 -6.0820312,2.3203 C 6.9403994,1041.148 7,1042.8613 7,1044.3613 c 0,1.5 -0.059601,2.7867 -0.5820312,3.5703 -0.5224307,0.7837 -1.5846355,1.4297 -4.4179688,1.4297 a 1.0001,1.0001 0 1 0 0,2 c 3.1666667,0 5.1044619,-0.8539 6.0820312,-2.3203 C 9.0596006,1047.5747 9,1045.8613 9,1044.3613 c 0,-1.5 0.059601,-2.7866 0.5820312,-3.5703 0.5224308,-0.7836 1.5846358,-1.4297 4.4179688,-1.4297 a 1.0001,1.0001 0 1 0 0,-2 z" + id="path4154" + inkscape:connector-curvature="0" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_curve_3d.svg b/tools/editor/icons/source/icon_curve_3d.svg new file mode 100644 index 0000000000..66034968b2 --- /dev/null +++ b/tools/editor/icons/source/icon_curve_3d.svg @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_curve_3d.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="45.254834" + inkscape:cx="8.9774722" + inkscape:cy="7.1326353" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:object-paths="false" + inkscape:snap-intersection-paths="false" + inkscape:object-nodes="true" + inkscape:snap-smooth-nodes="true" + inkscape:snap-midpoints="true"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="m 8.0039062,1037.3555 a 1.0001,1.0001 0 0 0 -0.4511718,0.1113 l -6,3 a 1.0001,1.0001 0 0 0 0,1.7891 l 6,3 a 1.0001,1.0001 0 0 0 0.8945312,0 L 13,1042.9805 l 0,3.7636 -5,2.5 -5.5527344,-2.7773 a 1.0001331,1.0001331 0 0 0 -0.8945312,1.7891 l 6,3 a 1.0001,1.0001 0 0 0 0.8945312,0 l 6.0000004,-3 A 1.0001,1.0001 0 0 0 15,1047.3613 l 0,-6 a 1.0001,1.0001 0 0 0 -1.447266,-0.8945 L 8,1043.2441 l -3.7636719,-1.8828 4.2109375,-2.1054 a 1.0001,1.0001 0 0 0 -0.4433594,-1.9004 z" + id="path4160" + inkscape:connector-curvature="0" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_environment.svg b/tools/editor/icons/source/icon_environment.svg new file mode 100644 index 0000000000..45add2c7f7 --- /dev/null +++ b/tools/editor/icons/source/icon_environment.svg @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/icon_node_2d.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_environment.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="16" + inkscape:cx="10.741006" + inkscape:cy="10.690232" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:object-paths="true" + inkscape:snap-intersection-paths="true" + inkscape:object-nodes="true" + inkscape:snap-smooth-nodes="true"> + <inkscape:grid + type="xygrid" + id="grid3336" + empspacing="4" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="opacity:1;fill:#e1e1e1;fill-opacity:0.99215686;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" + d="M 8 1 A 7 7 0 0 0 1 8 A 7 7 0 0 0 8 15 A 7 7 0 0 0 15 8 A 7 7 0 0 0 8 1 z M 7.0273438 2.0820312 C 6.3462908 2.6213949 5.3431503 3.5860946 4.6757812 5 L 2.8105469 5 A 6 6 0 0 1 7.0273438 2.0820312 z M 8.9785156 2.0859375 A 6 6 0 0 1 13.1875 5 L 11.324219 5 C 10.658501 3.5895934 9.6595492 2.6261235 8.9785156 2.0859375 z M 8 2.6054688 C 8.3858776 2.856627 9.3974911 3.6104334 10.185547 5 L 5.8144531 5 C 6.6025089 3.6104334 7.6141224 2.856627 8 2.6054688 z M 2.3515625 6 L 4.2949219 6 C 4.1145279 6.6059544 4 7.2695302 4 8 C 4 8.7306855 4.1144398 9.3938115 4.2949219 10 L 2.3496094 10 A 6 6 0 0 1 2 8 A 6 6 0 0 1 2.3515625 6 z M 5.3398438 6 L 10.660156 6 C 10.868048 6.5934731 11 7.2583063 11 8 C 11 8.7421382 10.866303 9.4061377 10.658203 10 L 5.3417969 10 C 5.1336971 9.4061377 5 8.7421382 5 8 C 5 7.2583063 5.1319522 6.5934731 5.3398438 6 z M 11.705078 6 L 13.650391 6 A 6 6 0 0 1 14 8 A 6 6 0 0 1 13.648438 10 L 11.705078 10 C 11.88556 9.3938115 12 8.7306855 12 8 C 12 7.2695302 11.885472 6.6059544 11.705078 6 z M 2.8125 11 L 4.6777344 11 C 5.343895 12.410381 6.3427806 13.374042 7.0234375 13.914062 A 6 6 0 0 1 2.8125 11 z M 5.8144531 11 L 10.185547 11 C 9.3971916 12.390235 8.3853773 13.145488 8 13.396484 C 7.6146227 13.145488 6.6028084 12.390235 5.8144531 11 z M 11.322266 11 L 13.189453 11 A 6 6 0 0 1 8.9707031 13.917969 C 9.651376 13.378771 10.654456 12.413873 11.322266 11 z " + transform="translate(0,1036.3622)" + id="path4158" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_fixed_spatial_material.svg b/tools/editor/icons/source/icon_fixed_spatial_material.svg new file mode 100644 index 0000000000..575b0d06c6 --- /dev/null +++ b/tools/editor/icons/source/icon_fixed_spatial_material.svg @@ -0,0 +1,147 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_fixed_spatial_material.svg"> + <defs + id="defs4"> + <linearGradient + inkscape:collect="always" + id="linearGradient4257"> + <stop + style="stop-color:#ff70ac;stop-opacity:1" + offset="0" + id="stop4259" /> + <stop + id="stop4273" + offset="0.17862372" + style="stop-color:#9f70ff;stop-opacity:1" /> + <stop + id="stop4271" + offset="0.3572498" + style="stop-color:#70deff;stop-opacity:1" /> + <stop + id="stop4269" + offset="0.53587586" + style="stop-color:#70ffb9;stop-opacity:1" /> + <stop + id="stop4267" + offset="0.71450192" + style="stop-color:#9dff70;stop-opacity:1" /> + <stop + id="stop4265" + offset="0.89312798" + style="stop-color:#ffeb70;stop-opacity:1" /> + <stop + style="stop-color:#ff7070;stop-opacity:1" + offset="1" + id="stop4261" /> + </linearGradient> + <clipPath + id="clipPath4189" + clipPathUnits="userSpaceOnUse"> + <path + inkscape:connector-curvature="0" + id="path4191" + d="m 6.3750001,1025.8622 a 1.6876688,1.5001498 0 0 0 -1.6875,1.5 l 0,18 a 1.6876688,1.5001498 0 0 0 1.6875,1.5 l 10.1217039,0 c -0.747392,-0.8796 -1.304338,-1.8888 -1.562256,-3 l -6.8719479,0 0,-15 16.8749999,0 0,3.3486 a 3.4281247,3.0472216 0 0 1 1.282105,1.1279 c 0.537834,0.828 1.294284,1.677 2.092895,2.5723 l 0,-8.5488 a 1.6876688,1.5001498 0 0 0 -1.6875,-1.5 l -20.2499999,0 z m 11.8124999,4.5 0,1.5 -1.6875,0 0,1.5 -3.375,0 0,1.5 -1.6875,0 0,1.5 -1.6874999,0 0,1.5 3.3749999,0 3.375,0 0.02637,0 c 0.246127,-0.317 0.496441,-0.6239 0.738282,-0.9053 1.145331,-1.3327 2.270672,-2.4711 3.015746,-3.6182 a 3.4281247,3.0472216 0 0 1 1.282105,-1.1279 l 0,-0.3486 -1.6875,0 0,-1.5 -1.6875,0 z m 5.0625,4.5 c -1.948558,3 -5.0625,5.0146 -5.0625,7.5 0,2.4853 2.266559,4.5 5.0625,4.5 2.795941,0 5.0625,-2.0147 5.0625,-4.5 0,-2.4854 -3.113942,-4.5 -5.0625,-7.5 z" + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" /> + </clipPath> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient4257" + id="radialGradient4263" + cx="13.333239" + cy="1043.3622" + fx="13.333239" + fy="1043.3622" + r="7" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(-0.93305925,0.79975529,-0.85714494,-0.99999821,914.75331,2076.0592)" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="22.627417" + inkscape:cx="12.314693" + inkscape:cy="10.250946" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:object-paths="false" + inkscape:snap-intersection-paths="false" + inkscape:object-nodes="false" + inkscape:snap-smooth-nodes="false" + inkscape:snap-midpoints="false"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + inkscape:connector-curvature="0" + style="fill:url(#radialGradient4263);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="m 8,1037.3622 -7,3 0,8 7,3 7,-3 0,-8 -7,-3 z" + id="path4151" /> + <path + style="fill:#ffffff;fill-opacity:0.72222221;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="m 1,1040.3622 7,3 7,-3 -7,-3 z" + id="path4149" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + id="path4145" + d="m 8,1051.3622 7,-3 0,-8 -7,3 z" + style="fill:#000000;fill-opacity:0.46969697;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + sodipodi:nodetypes="ccccc" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_g_i_probe.svg b/tools/editor/icons/source/icon_g_i_probe.svg new file mode 100644 index 0000000000..d803a5f63d --- /dev/null +++ b/tools/editor/icons/source/icon_g_i_probe.svg @@ -0,0 +1,110 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_g_i_probe.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="32" + inkscape:cx="4.4024065" + inkscape:cy="8.249577" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:object-paths="false" + inkscape:snap-intersection-paths="false" + inkscape:object-nodes="true" + inkscape:snap-smooth-nodes="true" + inkscape:snap-midpoints="true"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" + d="m 11,1040.3622 a 3.9999826,3.9999826 0 0 0 -4,4 3.9999826,3.9999826 0 0 0 4,4 3.9999826,3.9999826 0 0 0 4,-4 3.9999826,3.9999826 0 0 0 -4,-4 z m 0,2 a 2.0000174,2.0000174 0 0 1 2,2 2.0000174,2.0000174 0 0 1 -2,2 2.0000174,2.0000174 0 0 1 -2,-2 2.0000174,2.0000174 0 0 1 2,-2 z" + id="path4255" + inkscape:connector-curvature="0" /> + <rect + style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" + id="rect4265" + width="4" + height="2.0000348" + x="9" + y="1046.3622" /> + <rect + style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" + id="rect4269" + width="2" + height="1.0000174" + x="10" + y="1050.3622" /> + <rect + y="1047.3622" + x="9" + height="2.0000348" + width="4" + id="rect4274" + style="opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" + ry="1.0000174" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#fc9c9c;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 6,1050.3622 -4,0 0,-12 10,0" + id="path4293" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccc" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_g_i_probe_data.svg b/tools/editor/icons/source/icon_g_i_probe_data.svg new file mode 100644 index 0000000000..96fa62723c --- /dev/null +++ b/tools/editor/icons/source/icon_g_i_probe_data.svg @@ -0,0 +1,108 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_g_i_probe_data.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="32" + inkscape:cx="11.914815" + inkscape:cy="6.460794" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:object-paths="false" + inkscape:snap-intersection-paths="false" + inkscape:object-nodes="true" + inkscape:snap-smooth-nodes="true" + inkscape:snap-midpoints="true"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" + d="M 11 4 A 3.9999826 3.9999826 0 0 0 7 8 A 3.9999826 3.9999826 0 0 0 9 11.458984 L 9 12 C 9 12.55401 9.4459904 13 10 13 L 12 13 C 12.55401 13 13 12.55401 13 12 L 13 11.458984 A 3.9999826 3.9999826 0 0 0 15 8 A 3.9999826 3.9999826 0 0 0 11 4 z M 11 6 A 2.0000174 2.0000174 0 0 1 13 8 A 2.0000174 2.0000174 0 0 1 11 10 A 2.0000174 2.0000174 0 0 1 9 8 A 2.0000174 2.0000174 0 0 1 11 6 z M 10 14 L 10 15 L 12 15 L 12 14 L 10 14 z " + transform="translate(0,1036.3622)" + id="path4255" /> + <path + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="m 2,1037.3613 a 1.0001,1.0001 0 0 0 -1,1 l 0,12 a 1.0001,1.0001 0 0 0 1,1 l 4,0 0,-2 -3,0 0,-10 9,0 0,-2 -10,0 z" + id="path4293" + inkscape:connector-curvature="0" /> + <rect + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4170" + width="2" + height="2" + x="4" + y="1040.3622" /> + <rect + y="1043.3622" + x="4" + height="2" + width="2" + id="rect4172" + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4174" + width="2" + height="2" + x="4" + y="1046.3622" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_image_sky_box.svg b/tools/editor/icons/source/icon_image_sky_box.svg new file mode 100644 index 0000000000..9a89c04e58 --- /dev/null +++ b/tools/editor/icons/source/icon_image_sky_box.svg @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + sodipodi:docname="icon_image_sky_box.svg" + inkscape:export-ydpi="90" + inkscape:export-xdpi="90" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_box_shape.png" + inkscape:version="0.91 r13725" + version="1.1" + id="svg2" + viewBox="0 0 16 16" + height="16" + width="16"> + <sodipodi:namedview + inkscape:snap-smooth-nodes="true" + inkscape:object-nodes="true" + inkscape:snap-intersection-paths="false" + inkscape:object-paths="false" + inkscape:window-maximized="1" + inkscape:window-y="27" + inkscape:window-x="0" + inkscape:window-height="1016" + inkscape:window-width="1920" + inkscape:snap-center="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:bbox-nodes="true" + inkscape:bbox-paths="true" + inkscape:snap-bbox="true" + units="px" + showgrid="true" + inkscape:current-layer="layer1" + inkscape:document-units="px" + inkscape:cy="9.413879" + inkscape:cx="10.701686" + inkscape:zoom="32" + inkscape:pageshadow="2" + inkscape:pageopacity="0.0" + borderopacity="1.0" + bordercolor="#666666" + pagecolor="#ffffff" + id="base" + inkscape:snap-midpoints="true"> + <inkscape:grid + id="grid3336" + type="xygrid" + empspacing="4" /> + </sodipodi:namedview> + <defs + id="defs4"> + <linearGradient + inkscape:collect="always" + id="linearGradient4142"> + <stop + style="stop-color:#84c2ff;stop-opacity:1" + offset="0" + id="stop4144" /> + <stop + style="stop-color:#46a3ff;stop-opacity:1" + offset="1" + id="stop4146" /> + </linearGradient> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient4142" + id="radialGradient4148" + cx="9.9399967" + cy="1051.0801" + fx="9.9399967" + fy="1051.0801" + r="7" + gradientTransform="matrix(1.3337828e-5,-1.9999995,1.5714282,2.7945105e-6,-1643.697,1071.2392)" + gradientUnits="userSpaceOnUse" /> + </defs> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + transform="translate(0,-1036.3622)" + id="layer1" + inkscape:groupmode="layer" + inkscape:label="Layer 1"> + <rect + style="opacity:1;fill:url(#radialGradient4148);fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4140" + width="14" + height="13.999983" + x="1" + y="1037.3622" + ry="2.0000174" /> + <path + style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 6 4 A 1 1 0 0 0 5 5 A 1 1 0 0 0 6 6 A 1 1 0 0 0 7 5 A 1 1 0 0 0 6 4 z M 11 5 A 2 2 0 0 0 9 7 A 1 1 0 0 0 8 8 A 1 1 0 0 0 9 9 L 13 9 A 1 1 0 0 0 14 8 A 1 1 0 0 0 13 7 A 2 2 0 0 0 11 5 z M 3 9 A 1 1 0 0 0 2 10 A 1 1 0 0 0 3 11 L 5 11 A 1 1 0 0 0 4 12 A 1 1 0 0 0 5 13 L 8 13 A 1 1 0 0 0 9 12 A 1 1 0 0 0 8 11 L 6 11 A 1 1 0 0 0 7 10 A 1 1 0 0 0 6 9 L 3 9 z " + transform="translate(0,1036.3622)" + id="path4150" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_interp_wrap_clamp.svg b/tools/editor/icons/source/icon_interp_wrap_clamp.svg new file mode 100644 index 0000000000..068e79ace0 --- /dev/null +++ b/tools/editor/icons/source/icon_interp_wrap_clamp.svg @@ -0,0 +1,110 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="8" + viewBox="0 0 16 8" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_bone.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_interp_wrap_clamp.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="45.254834" + inkscape:cx="8.8989222" + inkscape:cy="4.5067976" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + showguides="true" + inkscape:snap-smooth-nodes="true" + inkscape:object-nodes="true" + inkscape:object-paths="true" + inkscape:snap-intersection-paths="true"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1044.3622)"> + <rect + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4154" + width="2" + height="5.9999828" + x="1" + y="1045.3622" + rx="1.7382812e-05" + ry="1.7382812e-05" /> + <rect + ry="1.7382812e-05" + rx="1.7382812e-05" + y="1045.3622" + x="13" + height="5.9999828" + width="2" + id="rect4156" + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#e0e0e0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" + d="m 5,1048.3622 6,0" + id="path4158" + inkscape:connector-curvature="0" /> + <path + style="fill:none;fill-rule:evenodd;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 6,1046.3622 -2,2 2,2" + id="path4160" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + id="path4162" + d="m 10,1046.3622 2,2 -2,2" + style="fill:none;fill-rule:evenodd;stroke:#e0e0e0;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_interp_wrap_loop.svg b/tools/editor/icons/source/icon_interp_wrap_loop.svg new file mode 100644 index 0000000000..bfca46331b --- /dev/null +++ b/tools/editor/icons/source/icon_interp_wrap_loop.svg @@ -0,0 +1,121 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="8" + viewBox="0 0 16 8" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_bone.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_interp_wrap_loop.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="45.254834" + inkscape:cx="7.8700453" + inkscape:cy="4.2719762" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + showguides="true" + inkscape:snap-smooth-nodes="true" + inkscape:object-nodes="true" + inkscape:object-paths="true" + inkscape:snap-intersection-paths="true"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1044.3622)"> + <path + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 12 1 L 12 3 A 1.0000174 1.0000174 0 0 1 13 4 A 1.0000174 1.0000174 0 0 1 12 5 L 12 7 A 3 3 0 0 0 15 4 A 3 3 0 0 0 12 1 z " + id="path4159" + transform="translate(0,1044.3622)" /> + <path + cx="12" + cy="1048.3622" + r="3" + id="path4161" + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 4 1 A 3 3 0 0 0 1 4 A 3 3 0 0 0 4 7 L 4 5 A 1.0000174 1.0000174 0 0 1 3 4 A 1.0000174 1.0000174 0 0 1 4 3 L 4 1 z " + id="path4176" + transform="translate(0,1044.3622)" /> + <rect + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4180" + width="3" + height="2" + x="9" + y="1045.3622" + rx="6.5185495e-06" + ry="1.7382799e-05" /> + <rect + ry="1.7382799e-05" + rx="6.5185495e-06" + y="1049.3622" + x="4" + height="2" + width="3" + id="rect4182" + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + style="fill:#e0e0e0;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1" + d="m 7,1048.3622 0,4 3,-2 z" + id="path4186" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + id="path4190" + d="m 9,1044.3622 0,4 -3,-2 z" + style="fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_joystick.svg b/tools/editor/icons/source/icon_joypad.svg index 5395060175..fb84462919 100644 --- a/tools/editor/icons/source/icon_joystick.svg +++ b/tools/editor/icons/source/icon_joypad.svg @@ -18,7 +18,7 @@ inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_key.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" - sodipodi:docname="icon_joystick.svg"> + sodipodi:docname="icon_joypad.svg"> <defs id="defs4" /> <sodipodi:namedview diff --git a/tools/editor/icons/source/icon_large_texture.svg b/tools/editor/icons/source/icon_large_texture.svg new file mode 100644 index 0000000000..4db0342041 --- /dev/null +++ b/tools/editor/icons/source/icon_large_texture.svg @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_sprite.png" + inkscape:export-xdpi="45" + inkscape:export-ydpi="45" + sodipodi:docname="icon_large_texture.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="32" + inkscape:cx="10.856598" + inkscape:cy="8.2673025" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:snap-smooth-nodes="true" + inkscape:object-nodes="true" + inkscape:snap-intersection-paths="true"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="opacity:1;fill:#e0e0e0;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" + d="M 1 1 L 1 2 L 1 4 L 2 4 L 2 2 L 4 2 L 4 1 L 1 1 z M 12 1 L 12 2 L 14 2 L 14 4 L 15 4 L 15 1 L 12 1 z M 9 6 L 9 7 L 8 7 L 8 8 L 6 8 L 6 9 L 5 9 L 5 10 L 4 10 L 4 11 L 6 11 L 8 11 L 10 11 L 12 11 L 12 9 L 11 9 L 11 8 L 11 7 L 10 7 L 10 6 L 9 6 z M 1 12 L 1 14 L 1 15 L 4 15 L 4 14 L 2 14 L 2 12 L 1 12 z M 14 12 L 14 14 L 12 14 L 12 15 L 15 15 L 15 14 L 15 12 L 14 12 z " + transform="translate(0,1036.3622)" + id="rect4179" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_load.svg b/tools/editor/icons/source/icon_load.svg index f8e78fb4ea..395a5c1b8a 100644 --- a/tools/editor/icons/source/icon_load.svg +++ b/tools/editor/icons/source/icon_load.svg @@ -29,11 +29,11 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="22.627417" - inkscape:cx="12.685427" - inkscape:cy="1.6294402" + inkscape:cx="6.3187685" + inkscape:cy="7.6629717" inkscape:document-units="px" inkscape:current-layer="layer1" - showgrid="false" + showgrid="true" units="px" inkscape:snap-bbox="true" inkscape:bbox-paths="true" @@ -43,9 +43,9 @@ inkscape:snap-object-midpoints="true" inkscape:snap-center="true" inkscape:window-width="1920" - inkscape:window-height="1119" + inkscape:window-height="1016" inkscape:window-x="0" - inkscape:window-y="26" + inkscape:window-y="27" inkscape:window-maximized="1" inkscape:snap-smooth-nodes="true" inkscape:object-nodes="true" @@ -53,8 +53,8 @@ <inkscape:grid type="xygrid" id="grid3336" - spacingx="0.5" - spacingy="0.5" + spacingx="1" + spacingy="1" empspacing="2" /> </sodipodi:namedview> <metadata @@ -74,12 +74,74 @@ inkscape:groupmode="layer" id="layer1" transform="translate(0,-1036.3622)"> + <rect + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4153" + width="1" + height="8.9999657" + x="1" + y="1040.3622" /> <path - style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" - d="M 1.5000703,2 C 1.0834036,2 0.7251221,2.1928844 0.4590547,2.4589844 0.1929873,2.7250844 7.03e-5,3.0834 7.03e-5,3.5 l 0.5,8.5 c 0.041565,0.581917 0.1536332,1.110716 0.5214844,1.478516 C 1.3894058,13.846416 1.916737,14 2.5000703,14 l 0.5,0 0.5,0 9.9997657,0 c 0.231666,-10e-5 0.432919,-0.159266 0.486328,-0.384766 l 2,-7.4999996 C 16.060474,5.8013344 15.822456,5.5002 15.499836,5.5 L 4.7559297,5.5 C 4.5236856,5.5003 4.3126587,5.6584963 4.2696015,5.8867188 L 3.0383769,12.412759 C 2.9838992,12.701515 2.7130529,12.963778 2.2988984,12.972656 1.7175274,12.985119 1.5058274,12.46121 1.5000703,12 l -0.5,-8.5 c 0,-0.083 0.057083,-0.2249844 0.1660156,-0.3339844 C 1.2750185,3.0571156 1.416737,3 1.5000703,3 L 12.499836,3 c 0.08333,0 0.225052,0.057016 0.333984,0.1660156 0.108933,0.109 0.224913,0.2750776 0.166016,0.3339844 l 0,1 1,0 0,-1 c 0,-0.4166 -0.192917,-0.7749156 -0.458984,-1.0410156 C 13.274784,2.1928844 12.916503,2 12.499836,2 Z" + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 3,1038.3622 c -1.1045695,0 -2,0.8954 -2,2 l 1,0 c 0,-0.5523 0.4477153,-1 1,-1 z" + id="path4155" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ccccc" /> + <path + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 6,6 C 5.643017,6.0002824 5.313257,6.1908435 5.1347656,6.5 5.0426478,6.6588009 4.9960226,6.8398957 5,7.0234375 L 4,13 c -0.091144,0.544728 -0.4477153,1 -1,1 l 0,1 9,0 c 1.10457,0 1.818405,-0.910429 2,-2 L 15,7 C 15.003977,6.8164581 14.957352,6.6588009 14.865234,6.5 14.686743,6.1908437 14.356983,6.0002826 14,6 Z" transform="translate(0,1036.3622)" - id="path8167" + id="rect4159" + inkscape:connector-curvature="0" + sodipodi:nodetypes="cccsccsscccc" /> + <rect + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4182" + width="2" + height="1" + x="3" + y="1038.3622" /> + <path + sodipodi:nodetypes="ccccc" inkscape:connector-curvature="0" - sodipodi:nodetypes="sscccscccccccssscccssssccssss" /> + id="path4184" + d="m 5,1038.3622 c 1.10457,0 2,0.8954 2,2 l -1,0 c 0,-0.5523 -0.4477153,-1 -1,-1 z" + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + sodipodi:nodetypes="ccccc" + inkscape:connector-curvature="0" + id="path4188" + d="m 3,1051.3622 c -1.1045695,0 -2,-0.8954 -2,-2 l 1,0 c 0,0.5523 0.4477153,1 1,1 z" + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + y="1040.3622" + x="7" + height="1" + width="4" + id="rect4192" + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + d="M 7,1041.3622 A 1,1 0 0 1 6.2928932,1041.0693 1,1 0 0 1 6,1040.3622 l 1,0 z" + sodipodi:end="3.1415927" + sodipodi:start="1.5707963" + sodipodi:ry="1" + sodipodi:rx="1" + sodipodi:cy="1040.3622" + sodipodi:cx="7" + sodipodi:type="arc" + id="path4208" + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path4210" + sodipodi:type="arc" + sodipodi:cx="-11" + sodipodi:cy="-1041.3622" + sodipodi:rx="1" + sodipodi:ry="1" + sodipodi:start="1.5707963" + sodipodi:end="3.1415927" + d="m -11,-1040.3622 a 1,1 0 0 1 -0.707107,-0.2929 A 1,1 0 0 1 -12,-1041.3622 l 1,0 z" + transform="scale(-1,-1)" /> </g> </svg> diff --git a/tools/editor/icons/source/icon_mesh_library.svg b/tools/editor/icons/source/icon_mesh_library.svg new file mode 100644 index 0000000000..b908a4db6e --- /dev/null +++ b/tools/editor/icons/source/icon_mesh_library.svg @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node_2d.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_mesh_library.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="31.999999" + inkscape:cx="10.839298" + inkscape:cy="6.916789" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1"> + <inkscape:grid + type="xygrid" + id="grid3336" + empspacing="4" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="opacity:1;fill:#ffd684;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M 3 1 A 2 2 0 0 0 1 3 A 2 2 0 0 0 2 4.7304688 L 2 11.271484 A 2 2 0 0 0 1 13 A 2 2 0 0 0 3 15 A 2 2 0 0 0 4.7304688 14 L 7 14 L 7 12 L 4.7285156 12 A 2 2 0 0 0 4 11.269531 L 4 5.4140625 L 7 8.4140625 L 7 8 A 2.0002 2.0002 0 0 1 7.8085938 6.3945312 L 5.4140625 4 L 11.271484 4 A 2 2 0 0 0 12 4.7304688 L 12 6 A 2.0002 2.0002 0 0 1 12.998047 6.2714844 A 2.0002 2.0002 0 0 1 14 6 L 14 4.7285156 A 2 2 0 0 0 15 3 A 2 2 0 0 0 13 1 A 2 2 0 0 0 11.269531 2 L 4.7285156 2 A 2 2 0 0 0 3 1 z M 9 8 L 9 9 L 9 14 L 9 15 L 14 15 C 14.552285 15 15 14.5523 15 14 L 15 9 C 15 8.4477 14.552285 8 14 8 L 14 12 L 13 11 L 12 12 L 12 8 L 9 8 z " + transform="translate(0,1036.3622)" + id="path4162" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_navigation_mesh.svg b/tools/editor/icons/source/icon_navigation_mesh.svg new file mode 100644 index 0000000000..31ab5df8ad --- /dev/null +++ b/tools/editor/icons/source/icon_navigation_mesh.svg @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node_2d.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_navigation_mesh.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="31.999999" + inkscape:cx="9.4708391" + inkscape:cy="9.3796697" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1"> + <inkscape:grid + type="xygrid" + id="grid3336" + empspacing="4" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="opacity:1;fill:#ffd684;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M 3 1 A 2 2 0 0 0 1 3 A 2 2 0 0 0 2 4.7304688 L 2 11.271484 A 2 2 0 0 0 1 13 A 2 2 0 0 0 3 15 A 2 2 0 0 0 4.7304688 14 L 7.2382812 14 L 7.9882812 12 L 4.7285156 12 A 2 2 0 0 0 4 11.269531 L 4 5.4140625 L 8.6972656 10.111328 L 9.46875 8.0546875 L 5.4140625 4 L 11.271484 4 A 2 2 0 0 0 12 4.7304688 L 12 5.0019531 A 2.0002 2.0002 0 0 1 12.023438 5.0019531 A 2.0002 2.0002 0 0 1 13.873047 6.2988281 L 14 6.6367188 L 14 4.7285156 A 2 2 0 0 0 15 3 A 2 2 0 0 0 13 1 A 2 2 0 0 0 11.269531 2 L 4.7285156 2 A 2 2 0 0 0 3 1 z M 12 7 L 9 15 L 12 13 L 15 15 L 12 7 z " + transform="translate(0,1036.3622)" + id="path4162" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_navigation_polygon.svg b/tools/editor/icons/source/icon_navigation_polygon.svg new file mode 100644 index 0000000000..f3b6fcbcc3 --- /dev/null +++ b/tools/editor/icons/source/icon_navigation_polygon.svg @@ -0,0 +1,88 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_2d.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_navigation_polygon.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="22.627416" + inkscape:cx="11.686357" + inkscape:cy="9.3308993" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <g + id="layer1-5" + inkscape:label="Layer 1" + style="fill:#e0e0e0;fill-opacity:1"> + <path + id="path4144-6" + transform="translate(0,1036.3622)" + d="M 2,1 A 1.0001,1.0001 0 0 0 1,2 l 0,12 a 1.0001,1.0001 0 0 0 1,1 l 4.9023438,0 A 2.1002099,2.1002099 0 0 1 7.0332031,14.263672 L 7.5078125,13 3,13 3,3 11.585938,3 7.2929688,7.2929688 a 1.0001,1.0001 0 0 0 0,1.4140624 L 8.6191406,10.033203 10.033203,6.2636719 a 2.1002099,2.1002099 0 0 1 1.992188,-1.3613281 2.1002099,2.1002099 0 0 1 0.435547,0.050781 L 14.707031,2.7070312 A 1.0001,1.0001 0 0 0 14,1 L 2,1 Z" + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + inkscape:connector-curvature="0" /> + <path + inkscape:connector-curvature="0" + id="path4163" + d="m 15,1051.3622 -3,-8 -3,8 3,-2 z" + style="fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + </g> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_packed_data_container.svg b/tools/editor/icons/source/icon_packed_data_container.svg new file mode 100644 index 0000000000..70aed22f2c --- /dev/null +++ b/tools/editor/icons/source/icon_packed_data_container.svg @@ -0,0 +1,138 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_packed_data_container.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="22.627417" + inkscape:cx="17.645108" + inkscape:cy="9.7856584" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:object-paths="false" + inkscape:snap-intersection-paths="false" + inkscape:object-nodes="true" + inkscape:snap-smooth-nodes="true" + inkscape:snap-midpoints="true"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="fill:none;fill-rule:evenodd;stroke:#e0e0e0;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" + d="m 2,1038.3622 0,12 12,0 0,-12 z" + id="path4154" + inkscape:connector-curvature="0" /> + <rect + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4167" + width="2" + height="2.0000174" + x="4" + y="1040.3622" /> + <rect + y="1043.3622" + x="4" + height="2.0000174" + width="2" + id="rect4183" + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4185" + width="2" + height="2.0000174" + x="4" + y="1046.3622" /> + <rect + y="1040.3622" + x="7" + height="2.0000174" + width="2" + id="rect4187" + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4189" + width="2" + height="2.0000174" + x="7" + y="1043.3622" /> + <rect + y="1046.3622" + x="7" + height="2.0000174" + width="2" + id="rect4191" + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4193" + width="2" + height="2.0000174" + x="10" + y="1040.3622" /> + <rect + y="1043.3622" + x="10" + height="2.0000174" + width="2" + id="rect4195" + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_particles_shader.svg b/tools/editor/icons/source/icon_particles_shader.svg new file mode 100644 index 0000000000..b4c2ef7ccd --- /dev/null +++ b/tools/editor/icons/source/icon_particles_shader.svg @@ -0,0 +1,159 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node_2d.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_particles_shader.svg"> + <defs + id="defs4"> + <clipPath + clipPathUnits="userSpaceOnUse" + id="clipPath4253"> + <path + style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 16.458984,1024.37 a 12.000027,12.000027 0 0 0 -3.564453,0.4004 12.000027,12.000027 0 0 0 -8.4863279,14.6973 12.000027,12.000027 0 0 0 14.6972659,8.4863 12.000027,12.000027 0 0 0 8.486328,-14.6973 12.000027,12.000027 0 0 0 -11.132813,-8.8867 z M 16.25,1029.8212 a 6.5451717,6.5451717 0 0 1 6.072266,4.8476 6.5451717,6.5451717 0 0 1 -4.628907,8.0157 6.5451717,6.5451717 0 0 1 -8.0156246,-4.6289 6.5451717,6.5451717 0 0 1 4.6289066,-8.0157 6.5451717,6.5451717 0 0 1 1.943359,-0.2187 z" + id="path4255" + inkscape:connector-curvature="0" /> + </clipPath> + <clipPath + clipPathUnits="userSpaceOnUse" + id="clipPath4199"> + <path + inkscape:connector-curvature="0" + id="path4201" + d="m 16.5,1025.8622 a 11.8125,10.499999 0 0 0 -11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125,-10.5 11.8125,10.499999 0 0 0 -11.8125,-10.5 z m -3.375,3 a 3.375,2.9999997 0 0 1 3.375,3 3.375,2.9999997 0 0 1 -3.375,3 3.375,2.9999997 0 0 1 -3.3750001,-3 3.375,2.9999997 0 0 1 3.3750001,-3 z" + style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> + </clipPath> + <clipPath + clipPathUnits="userSpaceOnUse" + id="clipPath4208"> + <path + style="opacity:1;fill:#a5b7f5;fill-opacity:0.98823529;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" + d="M 8,1037.3622 A 4.4999948,4.9999847 0 0 0 3.5859375,1041.3934 3,3 0 0 0 1,1044.3622 a 3,3 0 0 0 3,3 l 8,0 a 3,3 0 0 0 3,-3 3,3 0 0 0 -2.589844,-2.9668 A 4.4999948,4.9999847 0 0 0 8,1037.3622 Z m -4,11 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z m 8,0 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z m -4,1 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" + id="path4210" + inkscape:connector-curvature="0" /> + </clipPath> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="15.999999" + inkscape:cx="8.2922739" + inkscape:cy="6.6952763" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:object-paths="true" + inkscape:snap-intersection-paths="true" + inkscape:object-nodes="true" + inkscape:snap-smooth-nodes="true"> + <inkscape:grid + type="xygrid" + id="grid3336" + empspacing="4" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <g + id="g4271" + clip-path="url(#clipPath4208)" + transform="translate(0,1.8694115e-5)"> + <rect + y="1037.3622" + x="0" + height="2.0000031" + width="16" + id="rect4159" + style="fill:#ff7070;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + style="fill:#ffeb70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4161" + width="16" + height="2.0000029" + x="0" + y="1039.3622" /> + <rect + style="fill:#9dff70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4163" + width="16" + height="1.9999999" + x="0" + y="1041.3622" /> + <rect + y="1043.3622" + x="0" + height="2.0000024" + width="16" + id="rect4165" + style="fill:#70ffb9;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + y="1045.3622" + x="0" + height="2.0000021" + width="16" + id="rect4167" + style="fill:#70deff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + style="fill:#ff70ac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4169" + width="16" + height="1.9999987" + x="0" + y="1049.3622" /> + <rect + style="fill:#9f70ff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4146" + width="16" + height="2.0000021" + x="0" + y="1047.3622" /> + </g> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_polygon_path_finder.svg b/tools/editor/icons/source/icon_polygon_path_finder.svg new file mode 100644 index 0000000000..c2f8d80c3d --- /dev/null +++ b/tools/editor/icons/source/icon_polygon_path_finder.svg @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_2d.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_polygon_path_finder.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="31.999999" + inkscape:cx="4.2632138" + inkscape:cy="9.710537" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="M 2 1 C 1.4477381 1.0000552 1.0000552 1.4477381 1 2 L 1 3 L 3 3 L 3 1 L 2 1 z M 5 1 L 5 3 L 7 3 L 7 1 L 5 1 z M 9 1 L 9 3 L 11 3 L 11 1 L 9 1 z M 13 1 L 13 3 L 14.414062 3 L 14.707031 2.7070312 C 15.336587 2.0770367 14.890637 1.0003496 14 1 L 13 1 z M 1 5 L 1 7 L 3 7 L 3 5 L 1 5 z M 12 7 L 9 15 L 12 13 L 15 15 L 12 7 z M 1 9 L 1 11 L 3 11 L 3 9 L 1 9 z M 1 13 L 1 14 C 1.0000552 14.552262 1.4477381 14.999945 2 15 L 3 15 L 3 13 L 1 13 z M 5 13 L 5 15 L 6.9023438 15 C 6.9015603 14.748705 6.9458828 14.499309 7.0332031 14.263672 L 7.5078125 13 L 5 13 z " + transform="translate(0,1036.3622)" + id="path4144" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_reflection_probe.svg b/tools/editor/icons/source/icon_reflection_probe.svg new file mode 100644 index 0000000000..64b6493d6d --- /dev/null +++ b/tools/editor/icons/source/icon_reflection_probe.svg @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_reflection_probe.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="32" + inkscape:cx="8.348015" + inkscape:cy="11.115501" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:object-paths="false" + inkscape:snap-intersection-paths="false" + inkscape:object-nodes="true" + inkscape:snap-smooth-nodes="true" + inkscape:snap-midpoints="true"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="M 7.9628906 1.0019531 A 1.0001 1.0001 0 0 0 7.5527344 1.1054688 L 1.5527344 4.1054688 A 1.0001 1.0001 0 0 0 1 5 L 1 11 A 1.0001 1.0001 0 0 0 1.5527344 11.894531 L 7.5527344 14.894531 A 1.0001 1.0001 0 0 0 8.4472656 14.894531 L 14.447266 11.894531 A 1.0001 1.0001 0 0 0 15 11 L 15 5 A 1.0001 1.0001 0 0 0 14.447266 4.1054688 L 8.4472656 1.1054688 A 1.0001 1.0001 0 0 0 7.9628906 1.0019531 z M 7 3.6191406 L 7 12.382812 L 3 10.382812 L 3 5.6191406 L 7 3.6191406 z M 9 3.6191406 L 13 5.6191406 L 13 10.382812 L 9 12.382812 L 9 3.6191406 z " + transform="translate(0,1036.3622)" + id="path4139" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_room.svg b/tools/editor/icons/source/icon_room.svg index 8a2ccc30c8..599bbeb770 100644 --- a/tools/editor/icons/source/icon_room.svg +++ b/tools/editor/icons/source/icon_room.svg @@ -29,8 +29,8 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="22.627416" - inkscape:cx="11.210875" - inkscape:cy="4.4642701" + inkscape:cx="11.166681" + inkscape:cy="6.6297847" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -60,7 +60,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -69,27 +69,10 @@ inkscape:groupmode="layer" id="layer1" transform="translate(0,-1036.3622)"> - <g - id="layer1-7" - inkscape:label="Layer 1" - transform="translate(0,1.1802001e-5)" - style="stroke:#fc9c9c;stroke-opacity:0.99607843"> - <path - sodipodi:nodetypes="ccccccc" - inkscape:connector-curvature="0" - id="path4139" - d="m 8,1050.3622 -6,-3 0,-6 6,-3 6,3 0,6 z" - style="fill:none;fill-rule:evenodd;stroke:#fc9c9c;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" /> - </g> <path - style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" - d="M 7 2 L 7 7.3828125 L 1.5527344 10.105469 L 2.4472656 11.894531 L 8 9.1191406 L 13.552734 11.894531 L 14.447266 10.105469 L 9 7.3828125 L 9 2 L 7 2 z " + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="M 7.9628906 1.0019531 A 1.0001 1.0001 0 0 0 7.5527344 1.1054688 L 1.5527344 4.1054688 A 1.0001 1.0001 0 0 0 1 5 L 1 11 A 1.0001 1.0001 0 0 0 1.5527344 11.894531 L 7.5527344 14.894531 A 1.0001 1.0001 0 0 0 8.4472656 14.894531 L 14.447266 11.894531 A 1.0001 1.0001 0 0 0 15 11 L 15 5 A 1.0001 1.0001 0 0 0 14.447266 4.1054688 L 8.4472656 1.1054688 A 1.0001 1.0001 0 0 0 7.9628906 1.0019531 z M 9 3.6191406 L 13 5.6191406 L 13 9.3828125 L 9 7.3828125 L 9 3.6191406 z M 8 9.1191406 L 11.763672 11 L 8 12.882812 L 4.2363281 11 L 8 9.1191406 z " transform="translate(0,1036.3622)" - id="path4200" /> - <path - style="fill:#fc9c9c;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:0.99607843" - d="m 2,1047.3622 0,-6 6,-3 0,6 z" - id="path4209" - inkscape:connector-curvature="0" /> + id="path4139" /> </g> </svg> diff --git a/tools/editor/icons/source/icon_room_bounds.svg b/tools/editor/icons/source/icon_room_bounds.svg new file mode 100644 index 0000000000..8f7e6e6c83 --- /dev/null +++ b/tools/editor/icons/source/icon_room_bounds.svg @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_node_2d.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_room_bounds.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="31.999999" + inkscape:cx="9.5548877" + inkscape:cy="9.0516113" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1"> + <inkscape:grid + type="xygrid" + id="grid3336" + empspacing="4" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="M 1 1 L 1 2 L 1 3 L 2 3 L 2 2 L 3 2 L 3 1 L 2 1 L 1 1 z M 13 1 L 13 2 L 14 2 L 14 3 L 15 3 L 15 2 L 15 1 L 14 1 L 13 1 z M 7.9628906 1.0019531 A 1.0001 1.0001 0 0 0 7.5527344 1.1054688 L 1.5527344 4.1054688 A 1.0001 1.0001 0 0 0 1 5 L 1 11 A 1.0001 1.0001 0 0 0 1.5527344 11.894531 L 7.5527344 14.894531 A 1.0001 1.0001 0 0 0 8.4472656 14.894531 L 14.447266 11.894531 A 1.0001 1.0001 0 0 0 15 11 L 15 5 A 1.0001 1.0001 0 0 0 14.447266 4.1054688 L 8.4472656 1.1054688 A 1.0001 1.0001 0 0 0 7.9628906 1.0019531 z M 9 3.6191406 L 13 5.6191406 L 13 9.3828125 L 9 7.3828125 L 9 3.6191406 z M 8 9.1191406 L 11.763672 11 L 8 12.882812 L 4.2363281 11 L 8 9.1191406 z M 1 13 L 1 14 L 1 15 L 2 15 L 3 15 L 3 14 L 2 14 L 2 13 L 1 13 z M 14 13 L 14 14 L 13 14 L 13 15 L 14 15 L 15 15 L 15 14 L 15 13 L 14 13 z " + transform="translate(0,1036.3622)" + id="path4139" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_sample_library.svg b/tools/editor/icons/source/icon_sample_library.svg new file mode 100644 index 0000000000..78b01430c2 --- /dev/null +++ b/tools/editor/icons/source/icon_sample_library.svg @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_dependency_changed_hl.png" + inkscape:export-xdpi="45" + inkscape:export-ydpi="45" + sodipodi:docname="icon_sample_library.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="21.70867" + inkscape:cx="6.3137691" + inkscape:cy="6.7376711" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="false" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:snap-midpoints="true" + inkscape:snap-smooth-nodes="true" + inkscape:object-nodes="true"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="opacity:1;fill:#ff8484;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 9,8 0,1 0,5 0,1 5,0 c 0.552285,0 1,-0.447715 1,-1 L 15,9 C 15,8.4477153 14.552285,8 14,8 l 0,4 -1,-1 -1,1 0,-4 z" + transform="translate(0,1036.3622)" + id="rect4161" + inkscape:connector-curvature="0" + sodipodi:nodetypes="ccccssscccccc" /> + <path + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ff8484;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="m 7.0214844,1037.3633 a 1.0001,1.0001 0 0 0 -1,0.875 l -0.5898438,4.7226 -0.5234375,-1.0468 a 1.0001,1.0001 0 0 0 -0.8945312,-0.5528 l -2,0 a 1.0001,1.0001 0 1 0 0,2 l 1.3828125,0 1.7226562,3.4473 a 1.0001,1.0001 0 0 0 1.8867188,-0.3223 l 0.5898437,-4.7226 0.5234375,1.0449 a 1.0001,1.0001 0 0 0 0.8945313,0.5527 l 3.0000001,0 a 1.0001,1.0001 0 1 0 0,-2 l -2.3808595,0 -1.7246094,-3.4472 a 1.0001,1.0001 0 0 0 -0.8867187,-0.5508 z" + id="path4181" + inkscape:connector-curvature="0" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_script_create.svg b/tools/editor/icons/source/icon_script_create.svg index c3f69c4601..0cf16a9c3b 100644 --- a/tools/editor/icons/source/icon_script_create.svg +++ b/tools/editor/icons/source/icon_script_create.svg @@ -28,9 +28,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="29.966667" - inkscape:cx="5.495872" - inkscape:cy="2.1206692" + inkscape:zoom="21.189633" + inkscape:cx="7.8202901" + inkscape:cy="11.917121" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -43,11 +43,13 @@ inkscape:snap-object-midpoints="true" inkscape:snap-center="true" inkscape:window-width="1920" - inkscape:window-height="1119" + inkscape:window-height="1016" inkscape:window-x="0" - inkscape:window-y="26" + inkscape:window-y="27" inkscape:window-maximized="1" - showguides="false"> + showguides="false" + inkscape:snap-smooth-nodes="true" + inkscape:object-nodes="true"> <inkscape:grid type="xygrid" id="grid3336" @@ -61,7 +63,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -72,14 +74,14 @@ transform="translate(0,-1036.3622)"> <path style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" - d="M 6 1 L 6 2 A 1 1 0 0 0 5 3 L 5 13 L 4 13 L 4 11 L 2 11 L 2 13 A 1 1 0 0 0 2.5 13.865234 A 1 1 0 0 0 3 14 L 3 15 L 10 15 L 10 14 L 7 14 L 7 10 L 10 10 L 10 7 L 12 7 L 12 5 L 15 5 L 15 3 A 2 2 0 0 0 13 1 L 6 1 z M 11 8 L 11 11 L 8 11 L 8 13 L 11 13 L 11 14.730469 A 2 2 0 0 0 12 13 L 12 8 L 11 8 z " + d="M 6 1 L 6 2 C 5.4477153 2 5 2.4477153 5 3 L 5 13 L 4 13 L 4 11 L 2 11 L 2 13 C 2.0002826 13.356983 2.1908437 13.686743 2.5 13.865234 C 2.6519425 13.953279 2.8243914 13.999759 3 14 L 3 15 L 8 15 L 9 15 L 9 14 L 8 14 L 8 10 L 10 10 L 10 8 L 12 8 L 12 5 L 15 5 L 15 3 C 15 1.8954305 14.104569 1 13 1 L 6 1 z " transform="translate(0,1036.3622)" id="rect4255" /> <path style="opacity:1;fill:#b4b4b4;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" d="M 6 1 C 4.8954305 1 4 1.8954305 4 3 L 4 10 L 2 10 L 1 10 L 1 11 L 1 13 C 1 14.104569 1.8954305 15 3 15 C 4.1045695 15 5 14.104569 5 13 L 5 3 C 5 2.4477153 5.4477153 2 6 2 C 6.5522847 2 7 2.4477153 7 3 L 7 4 L 7 5 L 7 6 L 8 6 L 12 6 L 12 5 L 8 5 L 8 4 L 8 3 C 8 1.8954305 7.1045695 1 6 1 z M 2 11 L 4 11 L 4 13 C 4 13.552285 3.5522847 14 3 14 C 2.4477153 14 2 13.552285 2 13 L 2 11 z " - transform="translate(0,1036.3622)" - id="path4265" /> + id="path4265" + transform="translate(0,1036.3622)" /> <circle cy="1048.3622" cx="3" @@ -88,9 +90,10 @@ ry="1.0000174" rx="1" /> <path - style="fill:#e0e0e0;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1" - d="m 13,1049.3622 3,0 0,-2 -3,0 0,-3 -2,0 0,3 -3,0 0,2 3,0 0,3 2,0 z" + style="fill:#84ffb1;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="m 13,1049.3622 2,0 0,-2 -2,0 0,-2 -2,0 0,2 -2,0 0,2 2,0 0,2 2,0 z" id="path8069" - inkscape:connector-curvature="0" /> + inkscape:connector-curvature="0" + sodipodi:nodetypes="ccccccccccccc" /> </g> </svg> diff --git a/tools/editor/icons/source/icon_shader.svg b/tools/editor/icons/source/icon_shader.svg index 4c7b5aafc1..ba12b007ad 100644 --- a/tools/editor/icons/source/icon_shader.svg +++ b/tools/editor/icons/source/icon_shader.svg @@ -7,7 +7,6 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="16" @@ -22,30 +21,6 @@ sodipodi:docname="icon_shader.svg"> <defs id="defs4"> - <linearGradient - inkscape:collect="always" - id="linearGradient4174"> - <stop - style="stop-color:#ff5353;stop-opacity:1" - offset="0" - id="stop4176" /> - <stop - id="stop4186" - offset="0.29999271" - style="stop-color:#f1e17a;stop-opacity:1" /> - <stop - id="stop4184" - offset="0.55557561" - style="stop-color:#6bfcef;stop-opacity:1" /> - <stop - style="stop-color:#9765fd;stop-opacity:1" - offset="0.8889094" - id="stop4188" /> - <stop - style="stop-color:#ff6092;stop-opacity:1" - offset="1" - id="stop4178" /> - </linearGradient> <clipPath clipPathUnits="userSpaceOnUse" id="clipPath4253"> @@ -55,17 +30,6 @@ id="path4255" inkscape:connector-curvature="0" /> </clipPath> - <radialGradient - inkscape:collect="always" - xlink:href="#linearGradient4174" - id="radialGradient4161" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(1.2857125,1.428583,-1.4285914,1.2857189,1540.5411,-308.80327)" - cx="7.5384259" - cy="1041.7489" - fx="7.5384259" - fy="1041.7489" - r="7" /> <clipPath clipPathUnits="userSpaceOnUse" id="clipPath4199"> @@ -83,9 +47,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="45.254832" - inkscape:cx="1.7751371" - inkscape:cy="8.8192435" + inkscape:zoom="31.999999" + inkscape:cx="6.7591143" + inkscape:cy="9.6862321" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -183,93 +147,5 @@ x="3" y="1040.8622" /> </g> - <path - inkscape:connector-curvature="0" - style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="m 29.5,1037.3622 -7,3 0,8 7,3 7,-3 0,-8 -7,-3 z" - id="path4151" /> - <path - style="fill:#ffff91;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="m 22.5,1046.3622 7,3 7,-3 -7,-3 z" - id="path4223" - inkscape:connector-curvature="0" /> - <path - inkscape:connector-curvature="0" - id="path4221" - d="m 22.5,1043.3622 7,3 7,-3 -7,-3 z" - style="fill:#ff91ff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - style="fill:#00ffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="m 29.5,1045.3622 -7,-3 0,-2 7,3 z" - id="path4143" - inkscape:connector-curvature="0" - sodipodi:nodetypes="ccccc" /> - <path - inkscape:connector-curvature="0" - id="path4145" - d="m 29.5,1045.3622 7,-3 0,-2 -7,3 z" - style="fill:#00d8d8;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - sodipodi:nodetypes="ccccc" /> - <path - style="fill:#91ffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="m 22.5,1040.3622 7,3 7,-3 -7,-3 z" - id="path4149" - inkscape:connector-curvature="0" /> - <path - sodipodi:nodetypes="ccccc" - style="fill:#d800d8;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="m 29.5,1048.3622 7,-3 0,-2 -7,3 z" - id="path4208" - inkscape:connector-curvature="0" /> - <path - inkscape:connector-curvature="0" - id="path4215" - d="m 29.5,1048.3622 -7,-3 0,-2 7,3 z" - style="fill:#ff00ff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - sodipodi:nodetypes="ccccc" /> - <path - inkscape:connector-curvature="0" - id="path4217" - d="m 29.5,1051.3622 7,-3 0,-2 -7,3 z" - style="fill:#d8d800;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - sodipodi:nodetypes="ccccc" /> - <path - sodipodi:nodetypes="ccccc" - style="fill:#ffff00;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="m 29.5,1051.3622 -7,-3 0,-2 7,3 z" - id="path4219" - inkscape:connector-curvature="0" /> - <g - inkscape:label="Layer 1" - id="layer1-5" - transform="translate(18,1)"> - <path - id="path4151-1" - d="m 29.5,1037.3622 -7,3 0,8 7,3 7,-3 0,-8 -7,-3 z" - style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - inkscape:connector-curvature="0" /> - <path - inkscape:connector-curvature="0" - id="path4149-2" - d="m 22.5,1040.3622 7,3 7,-3 -7,-3 z" - style="fill:#00ffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - sodipodi:nodetypes="ccccc" - inkscape:connector-curvature="0" - id="path4143-0" - d="m 29.5,1051.3622 -7,-3 0,-8 7,3 z" - style="fill:#ff00ff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - sodipodi:nodetypes="ccccc" - style="fill:#ffff00;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - d="m 29.5,1051.3622 7,-3 0,-8 -7,3 z" - id="path4145-0" - inkscape:connector-curvature="0" /> - </g> - <path - style="opacity:1;fill:url(#radialGradient4161);fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - d="m 64,1037.3622 a 7,7.0000001 0 0 0 -7,7 7,7.0000001 0 0 0 7,7 7,7.0000001 0 0 0 7,-7 7,7.0000001 0 0 0 -7,-7 z m -2,2 a 2,2 0 0 1 2,2 2,2 0 0 1 -2,2 2,2 0 0 1 -2,-2 2,2 0 0 1 2,-2 z" - id="path4159" - inkscape:connector-curvature="0" /> </g> </svg> diff --git a/tools/editor/icons/source/icon_short_cut.svg b/tools/editor/icons/source/icon_short_cut.svg new file mode 100644 index 0000000000..05069e8ea1 --- /dev/null +++ b/tools/editor/icons/source/icon_short_cut.svg @@ -0,0 +1,89 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_key.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_short_cut.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="45.254835" + inkscape:cx="7.0902833" + inkscape:cy="8.378548" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="false" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:object-paths="false" + inkscape:snap-intersection-paths="false" + inkscape:object-nodes="true" + inkscape:snap-smooth-nodes="true" + inkscape:snap-midpoints="true"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="opacity:1;fill:#e0e0e0;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M 4 2 C 3.4477153 2 3 2.4477 3 3 L 3 12.083984 C 3.0004015 12.589984 3.4479991 13 4 13 L 12 13 C 12.552001 13 12.999599 12.589984 13 12.083984 L 13 3 C 13 2.4477 12.552285 2 12 2 L 4 2 z M 1 4 L 1 13 A 2 2 0 0 0 3 15 L 13 15 A 2 2 0 0 0 15 13 L 15 4 L 14 4 L 14 13 A 0.9999826 0.9999826 0 0 1 13 14 L 3 14 A 1 1 0 0 1 2 13 L 2 4 L 1 4 z M 7 4 L 10 4 L 9 7 L 11 7 L 7 11 L 8 8 L 6 8 L 7 4 z " + transform="translate(0,1036.3622)" + id="rect4155" /> + <rect + style="opacity:1;fill:#ffffff;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + id="rect4194" + width="7" + height="14" + x="27" + y="1038.3622" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_spatial_shader.svg b/tools/editor/icons/source/icon_spatial_shader.svg new file mode 100644 index 0000000000..329354b716 --- /dev/null +++ b/tools/editor/icons/source/icon_spatial_shader.svg @@ -0,0 +1,165 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_spatial_shader.svg"> + <defs + id="defs4"> + <clipPath + id="clipPath4253" + clipPathUnits="userSpaceOnUse"> + <path + inkscape:connector-curvature="0" + id="path4255" + d="m 16.458984,1024.37 a 12.000027,12.000027 0 0 0 -3.564453,0.4004 12.000027,12.000027 0 0 0 -8.4863279,14.6973 12.000027,12.000027 0 0 0 14.6972659,8.4863 12.000027,12.000027 0 0 0 8.486328,-14.6973 12.000027,12.000027 0 0 0 -11.132813,-8.8867 z M 16.25,1029.8212 a 6.5451717,6.5451717 0 0 1 6.072266,4.8476 6.5451717,6.5451717 0 0 1 -4.628907,8.0157 6.5451717,6.5451717 0 0 1 -8.0156246,-4.6289 6.5451717,6.5451717 0 0 1 4.6289066,-8.0157 6.5451717,6.5451717 0 0 1 1.943359,-0.2187 z" + style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + </clipPath> + <clipPath + id="clipPath4199" + clipPathUnits="userSpaceOnUse"> + <path + style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="m 16.5,1025.8622 a 11.8125,10.499999 0 0 0 -11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125001,10.5 11.8125,10.499999 0 0 0 11.8125,-10.5 11.8125,10.499999 0 0 0 -11.8125,-10.5 z m -3.375,3 a 3.375,2.9999997 0 0 1 3.375,3 3.375,2.9999997 0 0 1 -3.375,3 3.375,2.9999997 0 0 1 -3.3750001,-3 3.375,2.9999997 0 0 1 3.3750001,-3 z" + id="path4201" + inkscape:connector-curvature="0" /> + </clipPath> + <clipPath + clipPathUnits="userSpaceOnUse" + id="clipPath4280"> + <g + id="g4282" + inkscape:label="Layer 1" + transform="translate(0,1.1802001e-5)" + style="stroke:#fc9c9c;stroke-opacity:0.99607843"> + <path + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="M 7.9628906,1.0019531 A 1.0001,1.0001 0 0 0 7.5527344,1.1054688 l -6,3 A 1.0001,1.0001 0 0 0 1,5 l 0,6 a 1.0001,1.0001 0 0 0 0.5527344,0.894531 l 6,3 a 1.0001,1.0001 0 0 0 0.8945312,0 l 6.0000004,-3 A 1.0001,1.0001 0 0 0 15,11 L 15,5 A 1.0001,1.0001 0 0 0 14.447266,4.1054688 l -6.0000004,-3 A 1.0001,1.0001 0 0 0 7.9628906,1.0019531 Z M 8,3.1191406 11.763672,5 8,6.8828125 4.2363281,5 8,3.1191406 Z m -5,3.5 4,2 0,3.7636714 -4,-2 0,-3.7636714 z m 10,0 0,3.7636714 -4,2 0,-3.7636714 4,-2 z" + transform="translate(0,1036.3622)" + id="path4284" + inkscape:connector-curvature="0" /> + </g> + </clipPath> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="22.627417" + inkscape:cx="7.8442401" + inkscape:cy="13.929239" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:object-paths="false" + inkscape:snap-intersection-paths="false" + inkscape:object-nodes="false" + inkscape:snap-smooth-nodes="false" + inkscape:snap-midpoints="true"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <g + id="g4271" + clip-path="url(#clipPath4280)"> + <rect + y="1037.3622" + x="0" + height="2.0000031" + width="16" + id="rect4159" + style="fill:#ff7070;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + style="fill:#ffeb70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4161" + width="16" + height="2.0000029" + x="0" + y="1039.3622" /> + <rect + style="fill:#9dff70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4163" + width="16" + height="1.9999999" + x="0" + y="1041.3622" /> + <rect + y="1043.3622" + x="0" + height="2.0000024" + width="16" + id="rect4165" + style="fill:#70ffb9;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + y="1045.3622" + x="0" + height="2.0000021" + width="16" + id="rect4167" + style="fill:#70deff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + style="fill:#ff70ac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4169" + width="16" + height="1.9999987" + x="0" + y="1049.3622" /> + <rect + style="fill:#9f70ff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4146" + width="16" + height="2.0000021" + x="0" + y="1047.3622" /> + </g> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_sprite_frames.svg b/tools/editor/icons/source/icon_sprite_frames.svg new file mode 100644 index 0000000000..dc445da773 --- /dev/null +++ b/tools/editor/icons/source/icon_sprite_frames.svg @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_add_track.png" + inkscape:export-xdpi="45" + inkscape:export-ydpi="45" + sodipodi:docname="icon_sprite_frames.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="45.254835" + inkscape:cx="10.147205" + inkscape:cy="8.653875" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="false" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <rect + y="1046.3622" + x="10" + height="2.0000086" + width="2" + id="rect4230" + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4232" + width="2" + height="2.0000086" + x="13" + y="1046.3622" /> + <rect + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4234" + width="2" + height="2.0000086" + x="10" + y="1049.3622" /> + <rect + y="1049.3622" + x="13" + height="2.0000086" + width="2" + id="rect4236" + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <path + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 6 1 A 5 5 0 0 0 1 6 A 5 5 0 0 0 6 11 A 5 5 0 0 0 11 6 A 5 5 0 0 0 6 1 z M 3 5 A 1 1 0 0 1 4 6 A 1 1 0 0 1 3 7 A 1 1 0 0 1 2 6 A 1 1 0 0 1 3 5 z M 9 5 A 1 1 0 0 1 10 6 A 1 1 0 0 1 9 7 A 1 1 0 0 1 8 6 A 1 1 0 0 1 9 5 z M 7.9960938 7.4921875 A 0.50005 0.50005 0 0 1 8.3535156 8.3535156 C 7.7356645 8.9714156 6.8611111 9.25 6 9.25 C 5.1388889 9.25 4.2643355 8.9714156 3.6464844 8.3535156 A 0.50005 0.50005 0 0 1 3.9941406 7.4960938 A 0.50005 0.50005 0 0 1 4.3535156 7.6464844 C 4.7356645 8.0286844 5.3611111 8.25 6 8.25 C 6.6388889 8.25 7.2643355 8.0286844 7.6464844 7.6464844 A 0.50005 0.50005 0 0 1 7.9960938 7.4921875 z " + transform="translate(0,1036.3622)" + id="path4238" /> + <rect + y="1043.3622" + x="13" + height="2.0000086" + width="2" + id="rect4246" + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + y="1049.3622" + x="7" + height="2.0000086" + width="2" + id="rect4248" + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_style_box_empty.svg b/tools/editor/icons/source/icon_style_box_empty.svg new file mode 100644 index 0000000000..c881fe1c10 --- /dev/null +++ b/tools/editor/icons/source/icon_style_box_empty.svg @@ -0,0 +1,140 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_style_box_empty.svg"> + <defs + id="defs4"> + <clipPath + clipPathUnits="userSpaceOnUse" + id="clipPath4313"> + <path + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="m 6.3750001,1025.8622 c -0.931942,2e-4 -1.6874069,0.6716 -1.6875,1.5 l 0,1.5 3.375,0 0,-3 -1.6875,0 z m 5.0624999,0 0,3 3.375,0 0,-3 -3.375,0 z m 6.75,0 0,3 3.375,0 0,-3 -3.375,0 z m 6.75,0 0,3 3.375,0 0,-1.5 c -9.3e-5,-0.8284 -0.755558,-1.4998 -1.6875,-1.5 l -1.6875,0 z m -20.2499999,6 0,3 3.375,0 0,-3 -3.375,0 z m 20.2499999,0 0,0.3486 c 0.532973,0.2675 0.975667,0.657 1.282105,1.128 0.537834,0.828 1.294284,1.6769 2.092895,2.5722 l 0,-4.0488 -3.375,0 z m -1.6875,3 c -1.948558,3 -5.0625,5.0147 -5.0625,7.5 0,2.4854 2.266559,4.5 5.0625,4.5 2.795941,0 5.0625,-2.0146 5.0625,-4.5 0,-2.4853 -3.113942,-4.5 -5.0625,-7.5 z m -18.5624999,3 0,3 3.375,0 0,-3 -3.375,0 z m 0,6 0,1.5 c 9.31e-5,0.8284 0.755558,1.4998 1.6875,1.5 l 1.6875,0 0,-3 -3.375,0 z m 6.7499999,0 0,3 3.375,0 0,-3 -3.375,0 z" + id="path4315" + inkscape:connector-curvature="0" /> + </clipPath> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="32" + inkscape:cx="10.442024" + inkscape:cy="8.6470776" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:snap-smooth-nodes="true" + inkscape:object-nodes="true" + inkscape:snap-midpoints="true"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <g + id="g4181" + mask="none" + clip-path="url(#clipPath4313)" + transform="matrix(0.59259259,0,0,0.66666674,-1.7777778,353.45399)"> + <rect + y="1025.8622" + x="3" + height="3.0000043" + width="27" + id="rect4159" + style="fill:#ff7070;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + style="fill:#ffeb70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4161" + width="27" + height="3.0000041" + x="3" + y="1028.8622" /> + <rect + style="fill:#9dff70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4163" + width="27" + height="2.9999995" + x="3" + y="1031.8622" /> + <rect + y="1034.8622" + x="3" + height="3.0000031" + width="27" + id="rect4165" + style="fill:#70ffb9;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + y="1037.8622" + x="3" + height="3.0000029" + width="27" + id="rect4167" + style="fill:#70deff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + style="fill:#ff70ac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4169" + width="27" + height="2.9999976" + x="3" + y="1043.8622" /> + <rect + style="fill:#9f70ff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4146" + width="27" + height="3.0000029" + x="3" + y="1040.8622" /> + </g> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_style_box_flat.svg b/tools/editor/icons/source/icon_style_box_flat.svg new file mode 100644 index 0000000000..9071014ff3 --- /dev/null +++ b/tools/editor/icons/source/icon_style_box_flat.svg @@ -0,0 +1,149 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_style_box_flat.svg"> + <defs + id="defs4"> + <clipPath + clipPathUnits="userSpaceOnUse" + id="clipPath4313"> + <path + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="m 6.3750001,1025.8622 c -0.931942,2e-4 -1.6874069,0.6716 -1.6875,1.5 l 0,1.5 3.375,0 0,-3 -1.6875,0 z m 5.0624999,0 0,3 3.375,0 0,-3 -3.375,0 z m 6.75,0 0,3 3.375,0 0,-3 -3.375,0 z m 6.75,0 0,3 3.375,0 0,-1.5 c -9.3e-5,-0.8284 -0.755558,-1.4998 -1.6875,-1.5 l -1.6875,0 z m -20.2499999,6 0,3 3.375,0 0,-3 -3.375,0 z m 20.2499999,0 0,0.3486 c 0.532973,0.2675 0.975667,0.657 1.282105,1.128 0.537834,0.828 1.294284,1.6769 2.092895,2.5722 l 0,-4.0488 -3.375,0 z m -1.6875,3 c -1.948558,3 -5.0625,5.0147 -5.0625,7.5 0,2.4854 2.266559,4.5 5.0625,4.5 2.795941,0 5.0625,-2.0146 5.0625,-4.5 0,-2.4853 -3.113942,-4.5 -5.0625,-7.5 z m -18.5624999,3 0,3 3.375,0 0,-3 -3.375,0 z m 0,6 0,1.5 c 9.31e-5,0.8284 0.755558,1.4998 1.6875,1.5 l 1.6875,0 0,-3 -3.375,0 z m 6.7499999,0 0,3 3.375,0 0,-3 -3.375,0 z" + id="path4315" + inkscape:connector-curvature="0" /> + </clipPath> + <clipPath + clipPathUnits="userSpaceOnUse" + id="clipPath4391"> + <path + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="m 6.3750001,1025.8622 c -0.931942,2e-4 -1.6874069,0.6716 -1.6875,1.5 l 0,18 c 9.31e-5,0.8284 0.755558,1.4998 1.6875,1.5 l 10.1876219,0 c -1.081633,-1.2612 -1.750122,-2.8111 -1.750122,-4.5 0,-2.3563 1.351562,-4.0453 2.494995,-5.376 1.143433,-1.3305 2.270438,-2.4714 3.019043,-3.624 0.571813,-0.8788 1.604865,-1.4416 2.745483,-1.4941 1.267652,-0.06 2.465974,0.5173 3.101441,1.4941 0.549842,0.8466 1.32435,1.7113 2.139038,2.625 l 0,-8.625 c -9.3e-5,-0.8284 -0.755558,-1.4998 -1.6875,-1.5 l -20.2499999,0 z m 16.8749999,9 c -1.948558,3 -5.0625,5.0147 -5.0625,7.5 0,2.4854 2.266559,4.5 5.0625,4.5 2.795941,0 5.0625,-2.0146 5.0625,-4.5 0,-2.4853 -3.113942,-4.5 -5.0625,-7.5 z" + id="path4393" + inkscape:connector-curvature="0" /> + </clipPath> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="32" + inkscape:cx="11.34212" + inkscape:cy="7.7545325" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:snap-smooth-nodes="true" + inkscape:object-nodes="true" + inkscape:snap-midpoints="true"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <g + id="g4181" + mask="none" + clip-path="url(#clipPath4391)" + transform="matrix(0.59259259,0,0,0.66666674,-1.7777778,353.45399)"> + <rect + y="1025.8622" + x="3" + height="3.0000043" + width="27" + id="rect4159" + style="fill:#ff7070;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + style="fill:#ffeb70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4161" + width="27" + height="3.0000041" + x="3" + y="1028.8622" /> + <rect + style="fill:#9dff70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4163" + width="27" + height="2.9999995" + x="3" + y="1031.8622" /> + <rect + y="1034.8622" + x="3" + height="3.0000031" + width="27" + id="rect4165" + style="fill:#70ffb9;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + y="1037.8622" + x="3" + height="3.0000029" + width="27" + id="rect4167" + style="fill:#70deff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + style="fill:#ff70ac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4169" + width="27" + height="2.9999976" + x="3" + y="1043.8622" /> + <rect + style="fill:#9f70ff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4146" + width="27" + height="3.0000029" + x="3" + y="1040.8622" /> + </g> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_style_box_texture.svg b/tools/editor/icons/source/icon_style_box_texture.svg new file mode 100644 index 0000000000..30b1f1af68 --- /dev/null +++ b/tools/editor/icons/source/icon_style_box_texture.svg @@ -0,0 +1,140 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_center_container.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_style_box_texture.svg"> + <defs + id="defs4"> + <clipPath + clipPathUnits="userSpaceOnUse" + id="clipPath4189"> + <path + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="m 6.3750001,1025.8622 a 1.6876688,1.5001498 0 0 0 -1.6875,1.5 l 0,18 a 1.6876688,1.5001498 0 0 0 1.6875,1.5 l 10.1217039,0 c -0.747392,-0.8796 -1.304338,-1.8888 -1.562256,-3 l -6.8719479,0 0,-15 16.8749999,0 0,3.3486 a 3.4281247,3.0472216 0 0 1 1.282105,1.1279 c 0.537834,0.828 1.294284,1.677 2.092895,2.5723 l 0,-8.5488 a 1.6876688,1.5001498 0 0 0 -1.6875,-1.5 l -20.2499999,0 z m 11.8124999,4.5 0,1.5 -1.6875,0 0,1.5 -3.375,0 0,1.5 -1.6875,0 0,1.5 -1.6874999,0 0,1.5 3.3749999,0 3.375,0 0.02637,0 c 0.246127,-0.317 0.496441,-0.6239 0.738282,-0.9053 1.145331,-1.3327 2.270672,-2.4711 3.015746,-3.6182 a 3.4281247,3.0472216 0 0 1 1.282105,-1.1279 l 0,-0.3486 -1.6875,0 0,-1.5 -1.6875,0 z m 5.0625,4.5 c -1.948558,3 -5.0625,5.0146 -5.0625,7.5 0,2.4853 2.266559,4.5 5.0625,4.5 2.795941,0 5.0625,-2.0147 5.0625,-4.5 0,-2.4854 -3.113942,-4.5 -5.0625,-7.5 z" + id="path4191" + inkscape:connector-curvature="0" /> + </clipPath> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="22.627417" + inkscape:cx="9.8110364" + inkscape:cy="10.993538" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:snap-smooth-nodes="true" + inkscape:object-nodes="true" + inkscape:snap-midpoints="true"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <g + id="g4181" + mask="none" + clip-path="url(#clipPath4189)" + transform="matrix(0.59259259,0,0,0.66666674,-1.7777778,353.454)"> + <rect + y="1025.8622" + x="3" + height="3.0000043" + width="27" + id="rect4159" + style="fill:#ff7070;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + style="fill:#ffeb70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4161" + width="27" + height="3.0000041" + x="3" + y="1028.8622" /> + <rect + style="fill:#9dff70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4163" + width="27" + height="2.9999995" + x="3" + y="1031.8622" /> + <rect + y="1034.8622" + x="3" + height="3.0000031" + width="27" + id="rect4165" + style="fill:#70ffb9;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + y="1037.8622" + x="3" + height="3.0000029" + width="27" + id="rect4167" + style="fill:#70deff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + style="fill:#ff70ac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4169" + width="27" + height="2.9999976" + x="3" + y="1043.8622" /> + <rect + style="fill:#9f70ff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4146" + width="27" + height="3.0000029" + x="3" + y="1040.8622" /> + </g> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_test_cube.svg b/tools/editor/icons/source/icon_test_cube.svg index 8b5db2dc5d..c42c0bb674 100644 --- a/tools/editor/icons/source/icon_test_cube.svg +++ b/tools/editor/icons/source/icon_test_cube.svg @@ -29,8 +29,8 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="45.254834" - inkscape:cx="7.2538994" - inkscape:cy="5.8068101" + inkscape:cx="7.5411615" + inkscape:cy="7.1105382" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" @@ -64,7 +64,7 @@ <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> + <dc:title /> </cc:Work> </rdf:RDF> </metadata> @@ -79,16 +79,10 @@ transform="translate(0,1.1802001e-5)" style="stroke:#fc9c9c;stroke-opacity:0.99607843"> <path - sodipodi:nodetypes="ccccccc" - inkscape:connector-curvature="0" - id="path4139" - d="m 8,1050.3622 -6,-3 0,-6 6,-3 6,3 0,6 z" - style="fill:none;fill-rule:evenodd;stroke:#fc9c9c;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843" /> + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="M 7.9628906 1.0019531 A 1.0001 1.0001 0 0 0 7.5527344 1.1054688 L 1.5527344 4.1054688 A 1.0001 1.0001 0 0 0 1 5 L 1 11 A 1.0001 1.0001 0 0 0 1.5527344 11.894531 L 7.5527344 14.894531 A 1.0001 1.0001 0 0 0 8.4472656 14.894531 L 14.447266 11.894531 A 1.0001 1.0001 0 0 0 15 11 L 15 5 A 1.0001 1.0001 0 0 0 14.447266 4.1054688 L 8.4472656 1.1054688 A 1.0001 1.0001 0 0 0 7.9628906 1.0019531 z M 8 3.1191406 L 11.763672 5 L 8 6.8828125 L 4.2363281 5 L 8 3.1191406 z M 3 6.6191406 L 7 8.6191406 L 7 12.382812 L 3 10.382812 L 3 6.6191406 z M 13 6.6191406 L 13 10.382812 L 9 12.382812 L 9 8.6191406 L 13 6.6191406 z " + transform="translate(0,1036.3622)" + id="path4139" /> </g> - <path - style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#fc9c9c;fill-opacity:0.99607843;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" - d="M 2.4472656 4.1054688 L 1.5527344 5.8945312 L 7 8.6191406 L 7 14 L 9 14 L 9 8.6191406 L 14.447266 5.8945312 L 13.552734 4.1054688 L 8 6.8828125 L 2.4472656 4.1054688 z " - transform="translate(0,1036.3622)" - id="path4155" /> </g> </svg> diff --git a/tools/editor/icons/source/icon_theme.svg b/tools/editor/icons/source/icon_theme.svg new file mode 100644 index 0000000000..2cacb9755a --- /dev/null +++ b/tools/editor/icons/source/icon_theme.svg @@ -0,0 +1,144 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_bone.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_theme.svg"> + <defs + id="defs4"> + <clipPath + clipPathUnits="userSpaceOnUse" + id="clipPath4370"> + <g + id="g4372" + inkscape:label="Layer 1" + transform="matrix(1.6875,0,0,1.4999998,2.9999999,-530.18094)"> + <path + id="path4374" + transform="translate(0,1036.3622)" + d="M 7,1 6.4355469,3.2578125 A 5.0000172,5.0000172 0 0 0 5.7460938,3.5371094 L 3.7578125,2.34375 2.34375,3.7578125 3.5390625,5.7519531 A 5.0000172,5.0000172 0 0 0 3.2539062,6.4375 L 1,7 1,9 3.2578125,9.5644531 A 5.0000172,5.0000172 0 0 0 3.5371094,10.251953 L 2.34375,12.242188 3.7578125,13.65625 5.7519531,12.460938 A 5.0000172,5.0000172 0 0 0 6.4375,12.746094 L 7,15 9,15 9.5644531,12.742188 a 5.0000172,5.0000172 0 0 0 0.6874999,-0.279297 l 1.990235,1.193359 1.414062,-1.414062 -1.195312,-1.994141 A 5.0000172,5.0000172 0 0 0 12.746094,9.5625 L 15,9 15,7 12.742188,6.4355469 a 5.0000172,5.0000172 0 0 0 -0.279297,-0.6875 L 13.65625,3.7578125 12.242188,2.34375 10.248047,3.5390625 A 5.0000172,5.0000172 0 0 0 9.5625,3.2539062 L 9,1 7,1 Z M 8,6 A 2.0000174,2.0000174 0 0 1 10,8 2.0000174,2.0000174 0 0 1 8,10 2.0000174,2.0000174 0 0 1 6,8 2.0000174,2.0000174 0 0 1 8,6 Z" + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + inkscape:connector-curvature="0" /> + </g> + </clipPath> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="16" + inkscape:cx="10.857726" + inkscape:cy="9.3127855" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + showguides="true"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <g + id="g4181" + mask="none" + clip-path="url(#clipPath4370)" + transform="matrix(0.59259259,0,0,0.66666674,-1.7777777,353.454)"> + <rect + y="1025.8622" + x="3" + height="3.0000043" + width="27" + id="rect4159" + style="fill:#ff7070;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + style="fill:#ffeb70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4161-3" + width="27" + height="3.0000041" + x="3" + y="1028.8622" /> + <rect + style="fill:#9dff70;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4163-6" + width="27" + height="2.9999995" + x="3" + y="1031.8622" /> + <rect + y="1034.8622" + x="3" + height="3.0000031" + width="27" + id="rect4165-1" + style="fill:#70ffb9;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + y="1037.8622" + x="3" + height="3.0000029" + width="27" + id="rect4167" + style="fill:#70deff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + <rect + style="fill:#ff70ac;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4169" + width="27" + height="2.9999976" + x="3" + y="1043.8622" /> + <rect + style="fill:#9f70ff;fill-opacity:1;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="rect4146" + width="27" + height="3.0000029" + x="3" + y="1040.8622" /> + </g> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_tile_set.svg b/tools/editor/icons/source/icon_tile_set.svg new file mode 100644 index 0000000000..e697f03888 --- /dev/null +++ b/tools/editor/icons/source/icon_tile_set.svg @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_dependency_changed_hl.png" + inkscape:export-xdpi="45" + inkscape:export-ydpi="45" + sodipodi:docname="icon_tile_set.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="30.700696" + inkscape:cx="7.5612844" + inkscape:cy="6.4018109" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="false" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:snap-midpoints="true" + inkscape:snap-smooth-nodes="true" + inkscape:object-nodes="true"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 1 1 L 1 3 L 3 3 L 3 1 L 1 1 z M 4 1 L 4 3 L 6 3 L 6 1 L 4 1 z M 7 1 L 7 3 L 9 3 L 9 1 L 7 1 z M 10 1 L 10 3 L 12 3 L 12 1 L 10 1 z M 13 1 L 13 3 L 15 3 L 15 1 L 13 1 z M 1 4 L 1 6 L 3 6 L 3 4 L 1 4 z M 4 4 L 4 6 L 6 6 L 6 4 L 4 4 z M 7 4 L 7 6 L 9 6 L 9 4 L 7 4 z M 10 4 L 10 6 L 12 6 L 12 4 L 10 4 z M 13 4 L 13 6 L 15 6 L 15 4 L 13 4 z M 1 7 L 1 9 L 3 9 L 3 7 L 1 7 z M 4 7 L 4 9 L 6 9 L 6 7 L 4 7 z M 9 8 L 9 9 L 9 14 L 9 15 L 14 15 C 14.552285 15 15 14.552285 15 14 L 15 9 C 15 8.4477153 14.552285 8 14 8 L 14 12 L 13 11 L 12 12 L 12 8 L 9 8 z M 1 10 L 1 12 L 3 12 L 3 10 L 1 10 z M 4 10 L 4 12 L 6 12 L 6 10 L 4 10 z M 1 13 L 1 15 L 3 15 L 3 13 L 1 13 z M 4 13 L 4 15 L 6 15 L 6 13 L 4 13 z " + transform="translate(0,1036.3622)" + id="rect4161" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_viewport_texture.svg b/tools/editor/icons/source/icon_viewport_texture.svg new file mode 100644 index 0000000000..4cf6532059 --- /dev/null +++ b/tools/editor/icons/source/icon_viewport_texture.svg @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_sprite.png" + inkscape:export-xdpi="45" + inkscape:export-ydpi="45" + sodipodi:docname="icon_viewport_texture.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="22.627417" + inkscape:cx="18.523635" + inkscape:cy="6.064799" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:snap-smooth-nodes="true" + inkscape:object-nodes="true" + inkscape:snap-intersection-paths="true"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="opacity:1;fill:#e0e0e0;fill-opacity:0.99607843;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.99607843" + d="M 3 2 C 2.4695977 2.0000801 1.9609485 2.2108464 1.5859375 2.5859375 C 1.2108464 2.9609485 1.0000801 3.4695977 1 4 L 1 12 C 1.0000803 12.530402 1.2108465 13.039051 1.5859375 13.414062 C 1.9609484 13.789154 2.4695976 13.99992 3 14 L 13 14 C 14.104569 14 15 13.104569 15 12 L 15 4 C 15 2.8954305 14.104569 2 13 2 L 3 2 z M 3 3 L 13 3 C 13.552281 3.0000096 13.99999 3.4477192 14 4 L 14 12 C 13.99999 12.552281 13.552281 12.99999 13 13 L 3 13 C 2.4477192 12.99999 2.0000096 12.552281 2 12 L 2 4 C 2.0000096 3.4477192 2.4477192 3.0000096 3 3 z M 9 6 L 9 7 L 8 7 L 8 8 L 6 8 L 6 9 L 5 9 L 5 10 L 4 10 L 4 11 L 6 11 L 8 11 L 10 11 L 12 11 L 12 9 L 11 9 L 11 8 L 11 7 L 10 7 L 10 6 L 9 6 z " + transform="translate(0,1036.3622)" + id="rect4179" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_world.svg b/tools/editor/icons/source/icon_world.svg new file mode 100644 index 0000000000..b2be396217 --- /dev/null +++ b/tools/editor/icons/source/icon_world.svg @@ -0,0 +1,89 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_world.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="45.254834" + inkscape:cx="10.207753" + inkscape:cy="6.6325397" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:object-paths="false" + inkscape:snap-intersection-paths="false" + inkscape:object-nodes="true" + inkscape:snap-smooth-nodes="true" + inkscape:snap-midpoints="true"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <circle + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path4219" + cx="5.9999828" + cy="1046.3622" + r="4.9999828" /> + <circle + style="opacity:1;fill:#e0e0e0;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path4221" + cx="12" + cy="1039.3622" + r="1" /> + </g> +</svg> diff --git a/tools/editor/icons/source/icon_world_2d.svg b/tools/editor/icons/source/icon_world_2d.svg new file mode 100644 index 0000000000..cb4427808a --- /dev/null +++ b/tools/editor/icons/source/icon_world_2d.svg @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="16" + height="16" + viewBox="0 0 16 16" + id="svg2" + version="1.1" + inkscape:version="0.91 r13725" + inkscape:export-filename="/home/djrm/Projects/godot/tools/editor/icons/icon_collision_shape.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + sodipodi:docname="icon_world_2d.svg"> + <defs + id="defs4" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="22.627417" + inkscape:cx="17.648364" + inkscape:cy="4.8796811" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="true" + units="px" + inkscape:snap-bbox="true" + inkscape:bbox-paths="true" + inkscape:bbox-nodes="true" + inkscape:snap-bbox-edge-midpoints="true" + inkscape:snap-bbox-midpoints="true" + inkscape:snap-object-midpoints="true" + inkscape:snap-center="true" + inkscape:window-width="1920" + inkscape:window-height="1016" + inkscape:window-x="0" + inkscape:window-y="27" + inkscape:window-maximized="1" + inkscape:object-paths="false" + inkscape:snap-intersection-paths="false" + inkscape:object-nodes="true" + inkscape:snap-smooth-nodes="true" + inkscape:snap-midpoints="true"> + <inkscape:grid + type="xygrid" + id="grid3336" /> + </sodipodi:namedview> + <metadata + id="metadata7"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(0,-1036.3622)"> + <path + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" + d="m 2,1037.3613 a 1.0001,1.0001 0 0 0 -1,1 l 0,10 a 1.0001,1.0001 0 0 0 1,1 c 2.3666667,0 3.9746094,0.4629 5.7246094,0.9629 1.75,0.5 3.6420576,1.0371 6.2753906,1.0371 a 1.0001,1.0001 0 0 0 1,-1 l 0,-10 a 1.0001,1.0001 0 0 0 -1,-1 c -2.366667,0 -3.974609,-0.4609 -5.7246094,-0.9609 -1.75,-0.5 -3.6420573,-1.0391 -6.2753906,-1.0391 z m 1,2.0957 c 1.798426,0.1158 3.2574477,0.448 4.7246094,0.8672 1.4977347,0.4279 3.1940466,0.8188 5.2753906,0.9414 l 0,8.002 c -1.79849,-0.1158 -3.2574125,-0.448 -4.7246094,-0.8672 C 6.7776425,1047.9725 5.0813715,1047.5796 3,1047.457 l 0,-8 z" + id="path4157" + inkscape:connector-curvature="0" /> + </g> +</svg> diff --git a/tools/editor/inspector_dock.cpp b/tools/editor/inspector_dock.cpp index 7b06761e53..253f9bcc01 100644 --- a/tools/editor/inspector_dock.cpp +++ b/tools/editor/inspector_dock.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/inspector_dock.h b/tools/editor/inspector_dock.h index 40c153e2d4..be6ed5fa87 100644 --- a/tools/editor/inspector_dock.h +++ b/tools/editor/inspector_dock.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -38,7 +38,7 @@ #if 0 class InspectorDock : public VBoxContainer { - OBJ_TYPE(InspectorDock,VBoxContainer); + GDCLASS(InspectorDock,VBoxContainer); PropertyEditor *property_editor; diff --git a/tools/editor/io_plugins/editor_atlas.cpp b/tools/editor/io_plugins/editor_atlas.cpp index f69e383fb0..ac776f4ff5 100644 --- a/tools/editor/io_plugins/editor_atlas.cpp +++ b/tools/editor/io_plugins/editor_atlas.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/io_plugins/editor_atlas.h b/tools/editor/io_plugins/editor_atlas.h index 0135e76622..e0cf76576e 100644 --- a/tools/editor/io_plugins/editor_atlas.h +++ b/tools/editor/io_plugins/editor_atlas.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp b/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp index 757d2ed5d4..b4e0c4b82a 100644 --- a/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_bitmask_import_plugin.cpp @@ -11,7 +11,7 @@ class _EditorBitMaskImportOptions : public Object { - OBJ_TYPE(_EditorBitMaskImportOptions, Object); + GDCLASS(_EditorBitMaskImportOptions, Object); public: bool _set(const StringName& p_name, const Variant& p_value) { @@ -42,7 +42,7 @@ public: class EditorBitMaskImportDialog : public ConfirmationDialog { - OBJ_TYPE(EditorBitMaskImportDialog, ConfirmationDialog); + GDCLASS(EditorBitMaskImportDialog, ConfirmationDialog); EditorBitMaskImportPlugin *plugin; @@ -162,11 +162,11 @@ public: static void _bind_methods() { - ObjectTypeDB::bind_method("_choose_files", &EditorBitMaskImportDialog::_choose_files); - ObjectTypeDB::bind_method("_choose_save_dir", &EditorBitMaskImportDialog::_choose_save_dir); - ObjectTypeDB::bind_method("_import", &EditorBitMaskImportDialog::_import); - ObjectTypeDB::bind_method("_browse", &EditorBitMaskImportDialog::_browse); - ObjectTypeDB::bind_method("_browse_target", &EditorBitMaskImportDialog::_browse_target); + ClassDB::bind_method("_choose_files", &EditorBitMaskImportDialog::_choose_files); + ClassDB::bind_method("_choose_save_dir", &EditorBitMaskImportDialog::_choose_save_dir); + ClassDB::bind_method("_import", &EditorBitMaskImportDialog::_import); + ClassDB::bind_method("_browse", &EditorBitMaskImportDialog::_browse); + ClassDB::bind_method("_browse_target", &EditorBitMaskImportDialog::_browse_target); // ADD_SIGNAL( MethodInfo("imported",PropertyInfo(Variant::OBJECT,"scene")) ); } @@ -179,7 +179,7 @@ public: VBoxContainer *vbc = memnew(VBoxContainer); add_child(vbc); - set_child_rect(vbc); + //set_child_rect(vbc); HBoxContainer *hbc = memnew(HBoxContainer); diff --git a/tools/editor/io_plugins/editor_bitmask_import_plugin.h b/tools/editor/io_plugins/editor_bitmask_import_plugin.h index d9ca33cd97..28dddca50a 100644 --- a/tools/editor/io_plugins/editor_bitmask_import_plugin.h +++ b/tools/editor/io_plugins/editor_bitmask_import_plugin.h @@ -9,7 +9,7 @@ class EditorBitMaskImportDialog; class EditorBitMaskImportPlugin : public EditorImportPlugin { - OBJ_TYPE(EditorBitMaskImportPlugin, EditorImportPlugin); + GDCLASS(EditorBitMaskImportPlugin, EditorImportPlugin); EditorBitMaskImportDialog *dialog; public: @@ -30,7 +30,7 @@ public: class EditorBitMaskExportPlugin : public EditorExportPlugin { - OBJ_TYPE(EditorBitMaskExportPlugin, EditorExportPlugin); + GDCLASS(EditorBitMaskExportPlugin, EditorExportPlugin); public: diff --git a/tools/editor/io_plugins/editor_export_scene.cpp b/tools/editor/io_plugins/editor_export_scene.cpp index acbbf8c737..c2e037cfd7 100644 --- a/tools/editor/io_plugins/editor_export_scene.cpp +++ b/tools/editor/io_plugins/editor_export_scene.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -61,7 +61,7 @@ Vector<uint8_t> EditorSceneExportPlugin::custom_export(String& p_path,const Ref< uint64_t sd=0; String smd5; - String gp = Globals::get_singleton()->globalize_path(p_path); + String gp = GlobalConfig::get_singleton()->globalize_path(p_path); String md5=gp.md5_text(); String tmp_path = EditorSettings::get_singleton()->get_settings_path().plus_file("tmp/"); diff --git a/tools/editor/io_plugins/editor_export_scene.h b/tools/editor/io_plugins/editor_export_scene.h index 2c7fe9a1ab..13493220cb 100644 --- a/tools/editor/io_plugins/editor_export_scene.h +++ b/tools/editor/io_plugins/editor_export_scene.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class EditorSceneExportPlugin : public EditorExportPlugin { - OBJ_TYPE( EditorSceneExportPlugin, EditorExportPlugin ); + GDCLASS( EditorSceneExportPlugin, EditorExportPlugin ); public: virtual Vector<uint8_t> custom_export(String& p_path,const Ref<EditorExportPlatform> &p_platform); diff --git a/tools/editor/io_plugins/editor_font_import_plugin.cpp b/tools/editor/io_plugins/editor_font_import_plugin.cpp index df3741f0d4..388ca4ca89 100644 --- a/tools/editor/io_plugins/editor_font_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_font_import_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -44,7 +44,7 @@ class _EditorFontImportOptions : public Object { - OBJ_TYPE(_EditorFontImportOptions,Object); + GDCLASS(_EditorFontImportOptions,Object); public: enum FontMode { @@ -384,7 +384,7 @@ public: class EditorFontImportDialog : public ConfirmationDialog { - OBJ_TYPE(EditorFontImportDialog, ConfirmationDialog); + GDCLASS(EditorFontImportDialog, ConfirmationDialog); EditorLineEditFileChooser *source; @@ -418,7 +418,7 @@ class EditorFontImportDialog : public ConfirmationDialog { //print_line("pre src path "+source->get_line_edit()->get_text()); //print_line("src path "+src_path); imd->add_source(src_path); - imd->set_option("font/size",font_size->get_val()); + imd->set_option("font/size",font_size->get_value()); return imd; @@ -572,14 +572,14 @@ class EditorFontImportDialog : public ConfirmationDialog { static void _bind_methods() { - ObjectTypeDB::bind_method("_update",&EditorFontImportDialog::_update); - ObjectTypeDB::bind_method("_update_text",&EditorFontImportDialog::_update_text); - ObjectTypeDB::bind_method("_update_text2",&EditorFontImportDialog::_update_text2); - ObjectTypeDB::bind_method("_update_text3",&EditorFontImportDialog::_update_text3); - ObjectTypeDB::bind_method("_prop_changed",&EditorFontImportDialog::_prop_changed); - ObjectTypeDB::bind_method("_src_changed",&EditorFontImportDialog::_src_changed); - ObjectTypeDB::bind_method("_font_size_changed",&EditorFontImportDialog::_font_size_changed); - ObjectTypeDB::bind_method("_import",&EditorFontImportDialog::_import); + ClassDB::bind_method("_update",&EditorFontImportDialog::_update); + ClassDB::bind_method("_update_text",&EditorFontImportDialog::_update_text); + ClassDB::bind_method("_update_text2",&EditorFontImportDialog::_update_text2); + ClassDB::bind_method("_update_text3",&EditorFontImportDialog::_update_text3); + ClassDB::bind_method("_prop_changed",&EditorFontImportDialog::_prop_changed); + ClassDB::bind_method("_src_changed",&EditorFontImportDialog::_src_changed); + ClassDB::bind_method("_font_size_changed",&EditorFontImportDialog::_font_size_changed); + ClassDB::bind_method("_import",&EditorFontImportDialog::_import); } @@ -619,7 +619,7 @@ public: } source->get_line_edit()->set_text(src); - font_size->set_val(rimd->get_option("font/size")); + font_size->set_value(rimd->get_option("font/size")); } } @@ -634,7 +634,7 @@ public: plugin=p_plugin; VBoxContainer *vbc = memnew( VBoxContainer ); add_child(vbc); - set_child_rect(vbc); + //set_child_rect(vbc); HBoxContainer *hbc = memnew( HBoxContainer); vbc->add_child(hbc); VBoxContainer *vbl = memnew( VBoxContainer ); @@ -658,7 +658,7 @@ public: vbl->add_margin_child(TTR("Source Font Size:"),font_size); font_size->set_min(3); font_size->set_max(256); - font_size->set_val(16); + font_size->set_value(16); font_size->connect("value_changed",this,"_font_size_changed"); dest = memnew( EditorLineEditFileChooser ); // @@ -1330,7 +1330,7 @@ Ref<BitmapFont> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMe if (err==OK) { for(int i=0;i<height;i++){ - color[i]=img.get_pixel(0,i*img.get_height()/height); + //color[i]=img.get_pixel(0,i*img.get_height()/height); } } else { @@ -1380,10 +1380,10 @@ Ref<BitmapFont> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMe int ow=font_data_list[i]->width; int oh=font_data_list[i]->height; - DVector<uint8_t> pixels; + PoolVector<uint8_t> pixels; pixels.resize(s.x*s.y*4); - DVector<uint8_t>::Write w = pixels.write(); + PoolVector<uint8_t>::Write w = pixels.write(); //print_line("val: "+itos(font_data_list[i]->valign)); for(int y=0;y<s.height;y++) { @@ -1512,9 +1512,9 @@ Ref<BitmapFont> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMe } - w=DVector<uint8_t>::Write(); + w=PoolVector<uint8_t>::Write(); - Image img(s.width,s.height,0,Image::FORMAT_RGBA,pixels); + Image img(s.width,s.height,0,Image::FORMAT_RGBA8,pixels); font_data_list[i]->blit=img; font_data_list[i]->blit_ofs=o; @@ -1537,7 +1537,7 @@ Ref<BitmapFont> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMe res_size.y=nearest_power_of_2(res_size.y); print_line("Atlas size: "+res_size); - Image atlas(res_size.x,res_size.y,0,Image::FORMAT_RGBA); + Image atlas(res_size.x,res_size.y,0,Image::FORMAT_RGBA8); for(int i=0;i<font_data_list.size();i++) { @@ -1552,10 +1552,10 @@ Ref<BitmapFont> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMe if (from->has_option("advanced/premultiply_alpha") && bool(from->get_option("advanced/premultiply_alpha"))) { - DVector<uint8_t> data = atlas.get_data(); + PoolVector<uint8_t> data = atlas.get_data(); int dl = data.size(); { - DVector<uint8_t>::Write w = data.write(); + PoolVector<uint8_t>::Write w = data.write(); for(int i=0;i<dl;i+=4) { @@ -1565,12 +1565,12 @@ Ref<BitmapFont> EditorFontImportPlugin::generate_font(const Ref<ResourceImportMe } } - atlas=Image(res_size.x,res_size.y,0,Image::FORMAT_RGBA,data); + atlas=Image(res_size.x,res_size.y,0,Image::FORMAT_RGBA8,data); } if (from->has_option("color/monochrome") && bool(from->get_option("color/monochrome"))) { - atlas.convert(Image::FORMAT_GRAYSCALE_ALPHA); + atlas.convert(Image::FORMAT_LA8); } diff --git a/tools/editor/io_plugins/editor_font_import_plugin.h b/tools/editor/io_plugins/editor_font_import_plugin.h index 25914e6f83..73c699c090 100644 --- a/tools/editor/io_plugins/editor_font_import_plugin.h +++ b/tools/editor/io_plugins/editor_font_import_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ class EditorFontImportDialog; class EditorFontImportPlugin : public EditorImportPlugin { - OBJ_TYPE(EditorFontImportPlugin,EditorImportPlugin); + GDCLASS(EditorFontImportPlugin,EditorImportPlugin); EditorFontImportDialog *dialog; public: diff --git a/tools/editor/io_plugins/editor_import_collada.cpp b/tools/editor/io_plugins/editor_import_collada.cpp index 2211167dbb..5720e15caa 100644 --- a/tools/editor/io_plugins/editor_import_collada.cpp +++ b/tools/editor/io_plugins/editor_import_collada.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -85,7 +85,7 @@ struct ColladaImport { Error _create_scene(Collada::Node *p_node, Spatial *p_parent); Error _create_resources(Collada::Node *p_node); Error _create_material(const String& p_material); - Error _create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,const Map<String,Collada::NodeGeometry::Material>& p_material_map,const Collada::MeshData &meshdata,const Transform& p_local_xform,const Vector<int> &bone_remap, const Collada::SkinControllerData *p_skin_data, const Collada::MorphControllerData *p_morph_data,Vector<Ref<Mesh> > p_morph_meshes=Vector<Ref<Mesh> >()); + Error _create_mesh_surfaces(bool p_optimize, Ref<Mesh>& p_mesh, const Map<String,Collada::NodeGeometry::Material>& p_material_map, const Collada::MeshData &meshdata, const Transform& p_local_xform, const Vector<int> &bone_remap, const Collada::SkinControllerData *p_skin_data, const Collada::MorphControllerData *p_morph_data, Vector<Ref<Mesh> > p_morph_meshes=Vector<Ref<Mesh> >(), bool p_for_morph=false); Error load(const String& p_path, int p_flags, bool p_force_make_tangents=false); void _fix_param_animation_tracks(); void create_animation(int p_clip,bool p_make_tracks_in_all_bones, bool p_import_value_tracks); @@ -237,8 +237,8 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) { //well, it's an ambient light.. Light *l = memnew( DirectionalLight ); // l->set_color(Light::COLOR_AMBIENT,ld.color); - l->set_color(Light::COLOR_DIFFUSE,Color(0,0,0)); - l->set_color(Light::COLOR_SPECULAR,Color(0,0,0)); +// l->set_color(Light::COLOR_DIFFUSE,Color(0,0,0)); +// l->set_color(Light::COLOR_SPECULAR,Color(0,0,0)); node = l; } else if (ld.mode==Collada::LightData::MODE_DIRECTIONAL) { @@ -248,8 +248,8 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) { //if (found_ambient) //use it here // l->set_color(Light::COLOR_AMBIENT,ambient); - l->set_color(Light::COLOR_DIFFUSE,ld.color); - l->set_color(Light::COLOR_SPECULAR,Color(1,1,1)); +// l->set_color(Light::COLOR_DIFFUSE,ld.color); +// l->set_color(Light::COLOR_SPECULAR,Color(1,1,1)); node = l; } else { @@ -259,14 +259,14 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) { l=memnew( OmniLight ); else { l=memnew( SpotLight ); - l->set_parameter(Light::PARAM_SPOT_ANGLE,ld.spot_angle); - l->set_parameter(Light::PARAM_SPOT_ATTENUATION,ld.spot_exp); +// l->set_parameter(Light::PARAM_SPOT_ANGLE,ld.spot_angle); +// l->set_parameter(Light::PARAM_SPOT_ATTENUATION,ld.spot_exp); } // - l->set_color(Light::COLOR_DIFFUSE,ld.color); - l->set_color(Light::COLOR_SPECULAR,Color(1,1,1)); - l->approximate_opengl_attenuation(ld.constant_att,ld.linear_att,ld.quad_att); +// l->set_color(Light::COLOR_DIFFUSE,ld.color); +// l->set_color(Light::COLOR_SPECULAR,Color(1,1,1)); +// l->approximate_opengl_attenuation(ld.constant_att,ld.linear_att,ld.quad_att); node=l; } @@ -377,7 +377,7 @@ Error ColladaImport::_create_material(const String& p_target) { ERR_FAIL_COND_V(!collada.state.effect_map.has(src_mat.instance_effect),ERR_INVALID_PARAMETER); Collada::Effect &effect=collada.state.effect_map[src_mat.instance_effect]; - Ref<FixedMaterial> material= memnew( FixedMaterial ); + Ref<FixedSpatialMaterial> material= memnew( FixedSpatialMaterial ); if (src_mat.name!="") material->set_name(src_mat.name); @@ -394,14 +394,15 @@ Error ColladaImport::_create_material(const String& p_target) { Ref<Texture> texture = ResourceLoader::load(texfile,"Texture"); if (texture.is_valid()) { - material->set_texture(FixedMaterial::PARAM_DIFFUSE,texture); - material->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(1,1,1,1)); + material->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO,texture); + material->set_albedo(Color(1,1,1,1)); +// material->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,Color(1,1,1,1)); } else { missing_textures.push_back(texfile.get_file()); } } } else { - material->set_parameter(FixedMaterial::PARAM_DIFFUSE,effect.diffuse.color); +// material->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,effect.diffuse.color); } // SPECULAR @@ -413,16 +414,18 @@ Error ColladaImport::_create_material(const String& p_target) { Ref<Texture> texture = ResourceLoader::load(texfile,"Texture"); if (texture.is_valid()) { + material->set_texture(FixedSpatialMaterial::TEXTURE_SPECULAR,texture); + material->set_specular(Color(1,1,1,1)); - material->set_texture(FixedMaterial::PARAM_SPECULAR,texture); - material->set_parameter(FixedMaterial::PARAM_SPECULAR,Color(1,1,1,1)); +// material->set_texture(FixedSpatialMaterial::PARAM_SPECULAR,texture); +// material->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR,Color(1,1,1,1)); } else { missing_textures.push_back(texfile.get_file()); } } } else { - material->set_parameter(FixedMaterial::PARAM_SPECULAR,effect.specular.color); +// material->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR,effect.specular.color); } // EMISSION @@ -435,15 +438,17 @@ Error ColladaImport::_create_material(const String& p_target) { Ref<Texture> texture = ResourceLoader::load(texfile,"Texture"); if (texture.is_valid()) { - material->set_texture(FixedMaterial::PARAM_EMISSION,texture); - material->set_parameter(FixedMaterial::PARAM_EMISSION,Color(1,1,1,1)); + material->set_texture(FixedSpatialMaterial::TEXTURE_EMISSION,texture); + material->set_emission(Color(1,1,1,1)); + +// material->set_parameter(FixedSpatialMaterial::PARAM_EMISSION,Color(1,1,1,1)); }else { - missing_textures.push_back(texfile.get_file()); +// missing_textures.push_back(texfile.get_file()); } } } else { - material->set_parameter(FixedMaterial::PARAM_EMISSION,effect.emission.color); +// material->set_parameter(FixedSpatialMaterial::PARAM_EMISSION,effect.emission.color); } // NORMAL @@ -455,19 +460,23 @@ Error ColladaImport::_create_material(const String& p_target) { Ref<Texture> texture = ResourceLoader::load(texfile,"Texture"); if (texture.is_valid()) { + material->set_texture(FixedSpatialMaterial::TEXTURE_NORMAL,texture); +// material->set_emission(Color(1,1,1,1)); - material->set_texture(FixedMaterial::PARAM_NORMAL,texture); + // material->set_texture(FixedSpatialMaterial::PARAM_NORMAL,texture); }else { - missing_textures.push_back(texfile.get_file()); +// missing_textures.push_back(texfile.get_file()); } } } - material->set_parameter(FixedMaterial::PARAM_SPECULAR_EXP,effect.shininess); - material->set_flag(Material::FLAG_DOUBLE_SIDED,effect.double_sided); - material->set_flag(Material::FLAG_UNSHADED,effect.unshaded); +// material->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR_EXP,effect.shininess); + if (effect.double_sided) { + material->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED); + } + material->set_flag(FixedSpatialMaterial::FLAG_UNSHADED,effect.unshaded); @@ -476,15 +485,15 @@ Error ColladaImport::_create_material(const String& p_target) { } -static void _generate_normals(const DVector<int>& p_indices,const DVector<Vector3>& p_vertices,DVector<Vector3>&r_normals) { +static void _generate_normals(const PoolVector<int>& p_indices,const PoolVector<Vector3>& p_vertices,PoolVector<Vector3>&r_normals) { r_normals.resize(p_vertices.size()); - DVector<Vector3>::Write narrayw = r_normals.write(); + PoolVector<Vector3>::Write narrayw = r_normals.write(); int iacount=p_indices.size()/3; - DVector<int>::Read index_arrayr = p_indices.read(); - DVector<Vector3>::Read vertex_arrayr = p_vertices.read(); + PoolVector<int>::Read index_arrayr = p_indices.read(); + PoolVector<Vector3>::Read vertex_arrayr = p_vertices.read(); for(int idx=0;idx<iacount;idx++) { @@ -510,7 +519,7 @@ static void _generate_normals(const DVector<int>& p_indices,const DVector<Vector } -static void _generate_tangents_and_binormals(const DVector<int>& p_indices,const DVector<Vector3>& p_vertices,const DVector<Vector3>& p_uvs,const DVector<Vector3>& p_normals,DVector<real_t>&r_tangents) { +static void _generate_tangents_and_binormals(const PoolVector<int>& p_indices,const PoolVector<Vector3>& p_vertices,const PoolVector<Vector3>& p_uvs,const PoolVector<Vector3>& p_normals,PoolVector<real_t>&r_tangents) { int vlen=p_vertices.size(); @@ -522,10 +531,10 @@ static void _generate_tangents_and_binormals(const DVector<int>& p_indices,const int iacount=p_indices.size()/3; - DVector<int>::Read index_arrayr = p_indices.read(); - DVector<Vector3>::Read vertex_arrayr = p_vertices.read(); - DVector<Vector3>::Read narrayr = p_normals.read(); - DVector<Vector3>::Read uvarrayr = p_uvs.read(); + PoolVector<int>::Read index_arrayr = p_indices.read(); + PoolVector<Vector3>::Read vertex_arrayr = p_vertices.read(); + PoolVector<Vector3>::Read narrayr = p_normals.read(); + PoolVector<Vector3>::Read uvarrayr = p_uvs.read(); for(int idx=0;idx<iacount;idx++) { @@ -579,7 +588,7 @@ static void _generate_tangents_and_binormals(const DVector<int>& p_indices,const } r_tangents.resize(vlen*4); - DVector<real_t>::Write tarrayw = r_tangents.write(); + PoolVector<real_t>::Write tarrayw = r_tangents.write(); for(int idx=0;idx<vlen;idx++) { Vector3 tangent = tangents[idx]; @@ -597,7 +606,7 @@ static void _generate_tangents_and_binormals(const DVector<int>& p_indices,const } } -Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,const Map<String,Collada::NodeGeometry::Material>& p_material_map,const Collada::MeshData &meshdata,const Transform& p_local_xform,const Vector<int> &bone_remap, const Collada::SkinControllerData *skin_controller, const Collada::MorphControllerData *p_morph_data,Vector<Ref<Mesh> > p_morph_meshes) { +Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,const Map<String,Collada::NodeGeometry::Material>& p_material_map,const Collada::MeshData &meshdata,const Transform& p_local_xform,const Vector<int> &bone_remap, const Collada::SkinControllerData *skin_controller, const Collada::MorphControllerData *p_morph_data,Vector<Ref<Mesh> > p_morph_meshes,bool p_for_morph) { bool local_xform_mirror=p_local_xform.basis.determinant() < 0; @@ -1022,9 +1031,9 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con } - DVector<int> index_array; + PoolVector<int> index_array; index_array.resize(indices_list.size()); - DVector<int>::Write index_arrayw = index_array.write(); + PoolVector<int>::Write index_arrayw = index_array.write(); int iidx=0; for(List<int>::Element *F=indices_list.front();F;F=F->next()) { @@ -1032,7 +1041,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con index_arrayw[iidx++]=F->get(); } - index_arrayw=DVector<int>::Write(); + index_arrayw=PoolVector<int>::Write(); /*****************/ @@ -1042,7 +1051,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con { - Ref<FixedMaterial> material; + Ref<FixedSpatialMaterial> material; //find material Mesh::PrimitiveType primitive=Mesh::PRIMITIVE_TRIANGLES; @@ -1066,14 +1075,14 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con - DVector<Vector3> final_vertex_array; - DVector<Vector3> final_normal_array; - DVector<float> final_tangent_array; - DVector<Color> final_color_array; - DVector<Vector3> final_uv_array; - DVector<Vector3> final_uv2_array; - DVector<float> final_bone_array; - DVector<float> final_weight_array; + PoolVector<Vector3> final_vertex_array; + PoolVector<Vector3> final_normal_array; + PoolVector<float> final_tangent_array; + PoolVector<Color> final_color_array; + PoolVector<Vector3> final_uv_array; + PoolVector<Vector3> final_uv2_array; + PoolVector<int> final_bone_array; + PoolVector<float> final_weight_array; uint32_t final_format=0; @@ -1108,61 +1117,61 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con int vlen = vertex_array.size(); { //vertices - DVector<Vector3> varray; + PoolVector<Vector3> varray; varray.resize(vertex_array.size()); - DVector<Vector3>::Write varrayw = varray.write(); + PoolVector<Vector3>::Write varrayw = varray.write(); for(int k=0;k<vlen;k++) varrayw[k]=vertex_array[k].vertex; - varrayw = DVector<Vector3>::Write(); + varrayw = PoolVector<Vector3>::Write(); final_vertex_array=varray; } if (uv_src) { //compute uv first, may be needed for computing tangent/bionrmal - DVector<Vector3> uvarray; + PoolVector<Vector3> uvarray; uvarray.resize(vertex_array.size()); - DVector<Vector3>::Write uvarrayw = uvarray.write(); + PoolVector<Vector3>::Write uvarrayw = uvarray.write(); for(int k=0;k<vlen;k++) { uvarrayw[k]=vertex_array[k].uv; } - uvarrayw = DVector<Vector3>::Write(); + uvarrayw = PoolVector<Vector3>::Write(); final_uv_array=uvarray; } if (uv2_src) { //compute uv first, may be needed for computing tangent/bionrmal - DVector<Vector3> uv2array; + PoolVector<Vector3> uv2array; uv2array.resize(vertex_array.size()); - DVector<Vector3>::Write uv2arrayw = uv2array.write(); + PoolVector<Vector3>::Write uv2arrayw = uv2array.write(); for(int k=0;k<vlen;k++) { uv2arrayw[k]=vertex_array[k].uv2; } - uv2arrayw = DVector<Vector3>::Write(); + uv2arrayw = PoolVector<Vector3>::Write(); final_uv2_array=uv2array; } if (normal_src) { - DVector<Vector3> narray; + PoolVector<Vector3> narray; narray.resize(vertex_array.size()); - DVector<Vector3>::Write narrayw = narray.write(); + PoolVector<Vector3>::Write narrayw = narray.write(); for(int k=0;k<vlen;k++) { narrayw[k]=vertex_array[k].normal; } - narrayw = DVector<Vector3>::Write(); + narrayw = PoolVector<Vector3>::Write(); final_normal_array=narray; - //DVector<Vector3> altnaray; + //PoolVector<Vector3> altnaray; //_generate_normals(index_array,final_vertex_array,altnaray); //for(int i=0;i<altnaray.size();i++) @@ -1180,9 +1189,9 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con if (final_normal_array.size() && uv_src && binormal_src && tangent_src && !force_make_tangents) { - DVector<real_t> tarray; + PoolVector<real_t> tarray; tarray.resize(vertex_array.size()*4); - DVector<real_t>::Write tarrayw = tarray.write(); + PoolVector<real_t>::Write tarrayw = tarray.write(); for(int k=0;k<vlen;k++) { @@ -1193,10 +1202,10 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con } - tarrayw = DVector<real_t>::Write(); + tarrayw = PoolVector<real_t>::Write(); final_tangent_array=tarray; - } else if (final_normal_array.size() && primitive==Mesh::PRIMITIVE_TRIANGLES && final_uv_array.size() && (force_make_tangents || (material.is_valid() && material->get_texture(FixedMaterial::PARAM_NORMAL).is_valid()))){ + } else if (final_normal_array.size() && primitive==Mesh::PRIMITIVE_TRIANGLES && final_uv_array.size() && (force_make_tangents || (material.is_valid()))){ //if this uses triangles, there are uvs and the material is using a normalmap, generate tangents and binormals, because they WILL be needed //generate binormals/tangents _generate_tangents_and_binormals(index_array,final_vertex_array,final_uv_array,final_normal_array,final_tangent_array); @@ -1208,27 +1217,27 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con if (color_src) { - DVector<Color> colorarray; + PoolVector<Color> colorarray; colorarray.resize(vertex_array.size()); - DVector<Color>::Write colorarrayw = colorarray.write(); + PoolVector<Color>::Write colorarrayw = colorarray.write(); for(int k=0;k<vlen;k++) { colorarrayw[k]=vertex_array[k].color; } - colorarrayw = DVector<Color>::Write(); + colorarrayw = PoolVector<Color>::Write(); final_color_array=colorarray; } if (has_weights) { - DVector<float> weightarray; - DVector<float> bonearray; + PoolVector<float> weightarray; + PoolVector<int> bonearray; weightarray.resize(vertex_array.size()*4); - DVector<float>::Write weightarrayw = weightarray.write(); + PoolVector<float>::Write weightarrayw = weightarray.write(); bonearray.resize(vertex_array.size()*4); - DVector<float>::Write bonearrayw = bonearray.write(); + PoolVector<int>::Write bonearrayw = bonearray.write(); for(int k=0;k<vlen;k++) { float sum=0; @@ -1237,7 +1246,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con if (l<vertex_array[k].weights.size()) { weightarrayw[k*VS::ARRAY_WEIGHTS_SIZE+l]=vertex_array[k].weights[l].weight; sum+=weightarrayw[k*VS::ARRAY_WEIGHTS_SIZE+l]; - bonearrayw[k*VS::ARRAY_WEIGHTS_SIZE+l]=vertex_array[k].weights[l].bone_idx; + bonearrayw[k*VS::ARRAY_WEIGHTS_SIZE+l]=int(vertex_array[k].weights[l].bone_idx); //COLLADA_PRINT(itos(k)+": "+rtos(bonearrayw[k*VS::ARRAY_WEIGHTS_SIZE+l])+":"+rtos(weightarray[k*VS::ARRAY_WEIGHTS_SIZE+l])); } else { @@ -1253,8 +1262,8 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con } - weightarrayw = DVector<float>::Write(); - bonearrayw = DVector<float>::Write(); + weightarrayw = PoolVector<float>::Write(); + bonearrayw = PoolVector<int>::Write(); final_weight_array = weightarray; final_bone_array = bonearray; @@ -1317,7 +1326,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con // morph anything but "POSITIONS" seem to exit. Because of this, normals and binormals/tangents have to be regenerated here, // which may result in inaccurate (but most of the time good enough) results. - DVector<Vector3> vertices; + PoolVector<Vector3> vertices; vertices.resize(vlen); ERR_FAIL_COND_V( md.vertices.size() != 1, ERR_INVALID_DATA); @@ -1336,7 +1345,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con //read vertices from morph target - DVector<Vector3>::Write vertw = vertices.write(); + PoolVector<Vector3>::Write vertw = vertices.write(); for(int m_i=0;m_i<m->array.size()/stride;m_i++) { @@ -1372,9 +1381,9 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con //vertices are in place, now generate everything else - vertw = DVector<Vector3>::Write(); - DVector<Vector3> normals; - DVector<float> tangents; + vertw = PoolVector<Vector3>::Write(); + PoolVector<Vector3> normals; + PoolVector<float> tangents; print_line("vertex source id: "+vertex_src_id); if(md.vertices[vertex_src_id].sources.has("NORMAL")){ //has normals @@ -1393,7 +1402,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con //read normals from morph target - DVector<Vector3>::Write vertw = normals.write(); + PoolVector<Vector3>::Write vertw = normals.write(); for(int m_i=0;m_i<m->array.size()/stride;m_i++) { @@ -1461,14 +1470,20 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize,Ref<Mesh>& p_mesh,con // print_line("want surface "+itos(mi)+" has "+itos(p_morph_meshes[mi]->get_surface_count())); Array a = p_morph_meshes[mi]->surface_get_arrays(surface); - a[Mesh::ARRAY_BONES]=Variant(); - a[Mesh::ARRAY_WEIGHTS]=Variant(); + //add valid weight and bone arrays if they exist, TODO check if they are unique to shape (generally not) + + if (final_weight_array.size()) + a[Mesh::ARRAY_WEIGHTS]=final_weight_array; + if (final_bone_array.size()) + a[Mesh::ARRAY_BONES]=final_bone_array; + a[Mesh::ARRAY_INDEX]=Variant(); //a.resize(Mesh::ARRAY_MAX); //no need for index mr.push_back(a); } - p_mesh->add_surface(Mesh::PRIMITIVE_TRIANGLES,d,mr); + + p_mesh->add_surface_from_arrays(Mesh::PRIMITIVE_TRIANGLES,d,mr,p_for_morph?0:Mesh::ARRAY_COMPRESS_DEFAULT); if (material.is_valid()) { p_mesh->surface_set_material(surface, material); @@ -1692,7 +1707,7 @@ Error ColladaImport::_create_resources(Collada::Node *p_node) { if (collada.state.mesh_data_map.has(meshid)) { Ref<Mesh> mesh=Ref<Mesh>(memnew( Mesh )); const Collada::MeshData &meshdata = collada.state.mesh_data_map[meshid]; - Error err = _create_mesh_surfaces(false,mesh,ng->material_map,meshdata,apply_xform,bone_remap,skin,NULL); + Error err = _create_mesh_surfaces(false,mesh,ng->material_map,meshdata,apply_xform,bone_remap,skin,NULL,Vector<Ref<Mesh> >(),true); ERR_FAIL_COND_V(err,err); morphs.push_back(mesh); diff --git a/tools/editor/io_plugins/editor_import_collada.h b/tools/editor/io_plugins/editor_import_collada.h index de45dc38f4..f6642778ed 100644 --- a/tools/editor/io_plugins/editor_import_collada.h +++ b/tools/editor/io_plugins/editor_import_collada.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class EditorSceneImporterCollada : public EditorSceneImporter { - OBJ_TYPE(EditorSceneImporterCollada,EditorSceneImporter ); + GDCLASS(EditorSceneImporterCollada,EditorSceneImporter ); public: virtual uint32_t get_import_flags() const; diff --git a/tools/editor/io_plugins/editor_mesh_import_plugin.cpp b/tools/editor/io_plugins/editor_mesh_import_plugin.cpp index da608292c1..f33693c304 100644 --- a/tools/editor/io_plugins/editor_mesh_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_mesh_import_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -40,7 +40,7 @@ class _EditorMeshImportOptions : public Object { - OBJ_TYPE(_EditorMeshImportOptions,Object); + GDCLASS(_EditorMeshImportOptions,Object); public: @@ -148,7 +148,7 @@ public: class EditorMeshImportDialog : public ConfirmationDialog { - OBJ_TYPE(EditorMeshImportDialog,ConfirmationDialog); + GDCLASS(EditorMeshImportDialog,ConfirmationDialog); EditorMeshImportPlugin *plugin; @@ -278,11 +278,11 @@ public: static void _bind_methods() { - ObjectTypeDB::bind_method("_choose_files",&EditorMeshImportDialog::_choose_files); - ObjectTypeDB::bind_method("_choose_save_dir",&EditorMeshImportDialog::_choose_save_dir); - ObjectTypeDB::bind_method("_import",&EditorMeshImportDialog::_import); - ObjectTypeDB::bind_method("_browse",&EditorMeshImportDialog::_browse); - ObjectTypeDB::bind_method("_browse_target",&EditorMeshImportDialog::_browse_target); + ClassDB::bind_method("_choose_files",&EditorMeshImportDialog::_choose_files); + ClassDB::bind_method("_choose_save_dir",&EditorMeshImportDialog::_choose_save_dir); + ClassDB::bind_method("_import",&EditorMeshImportDialog::_import); + ClassDB::bind_method("_browse",&EditorMeshImportDialog::_browse); + ClassDB::bind_method("_browse_target",&EditorMeshImportDialog::_browse_target); } EditorMeshImportDialog(EditorMeshImportPlugin *p_plugin) { @@ -294,7 +294,7 @@ public: VBoxContainer *vbc = memnew( VBoxContainer ); add_child(vbc); - set_child_rect(vbc); + //set_child_rect(vbc); HBoxContainer *hbc = memnew( HBoxContainer ); vbc->add_margin_child(TTR("Source Mesh(es):"),hbc); diff --git a/tools/editor/io_plugins/editor_mesh_import_plugin.h b/tools/editor/io_plugins/editor_mesh_import_plugin.h index d200603e6a..1f15fee3a7 100644 --- a/tools/editor/io_plugins/editor_mesh_import_plugin.h +++ b/tools/editor/io_plugins/editor_mesh_import_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -38,7 +38,7 @@ class EditorMeshImportDialog; class EditorMeshImportPlugin : public EditorImportPlugin { - OBJ_TYPE(EditorMeshImportPlugin,EditorImportPlugin); + GDCLASS(EditorMeshImportPlugin,EditorImportPlugin); EditorMeshImportDialog *dialog; diff --git a/tools/editor/io_plugins/editor_sample_import_plugin.cpp b/tools/editor/io_plugins/editor_sample_import_plugin.cpp index 7dc74e58dd..da4e24dc84 100644 --- a/tools/editor/io_plugins/editor_sample_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_sample_import_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,7 +39,7 @@ class _EditorSampleImportOptions : public Object { - OBJ_TYPE(_EditorSampleImportOptions,Object); + GDCLASS(_EditorSampleImportOptions,Object); public: enum CompressMode { @@ -166,7 +166,7 @@ public: class EditorSampleImportDialog : public ConfirmationDialog { - OBJ_TYPE(EditorSampleImportDialog,ConfirmationDialog); + GDCLASS(EditorSampleImportDialog,ConfirmationDialog); EditorSampleImportPlugin *plugin; @@ -318,11 +318,11 @@ public: static void _bind_methods() { - ObjectTypeDB::bind_method("_choose_files",&EditorSampleImportDialog::_choose_files); - ObjectTypeDB::bind_method("_choose_save_dir",&EditorSampleImportDialog::_choose_save_dir); - ObjectTypeDB::bind_method("_import",&EditorSampleImportDialog::_import); - ObjectTypeDB::bind_method("_browse",&EditorSampleImportDialog::_browse); - ObjectTypeDB::bind_method("_browse_target",&EditorSampleImportDialog::_browse_target); + ClassDB::bind_method("_choose_files",&EditorSampleImportDialog::_choose_files); + ClassDB::bind_method("_choose_save_dir",&EditorSampleImportDialog::_choose_save_dir); + ClassDB::bind_method("_import",&EditorSampleImportDialog::_import); + ClassDB::bind_method("_browse",&EditorSampleImportDialog::_browse); + ClassDB::bind_method("_browse_target",&EditorSampleImportDialog::_browse_target); // ADD_SIGNAL( MethodInfo("imported",PropertyInfo(Variant::OBJECT,"scene")) ); } @@ -335,7 +335,7 @@ public: VBoxContainer *vbc = memnew( VBoxContainer ); add_child(vbc); - set_child_rect(vbc); + //set_child_rect(vbc); HBoxContainer *hbc = memnew( HBoxContainer ); @@ -443,8 +443,8 @@ Error EditorSampleImportPlugin::import(const String& p_path, const Ref<ResourceI data.resize(len*chans); { - DVector<uint8_t> src_data = smp->get_data(); - DVector<uint8_t>::Read sr = src_data.read(); + PoolVector<uint8_t> src_data = smp->get_data(); + PoolVector<uint8_t>::Read sr = src_data.read(); for(int i=0;i<len*chans;i++) { @@ -602,7 +602,7 @@ Error EditorSampleImportPlugin::import(const String& p_path, const Ref<ResourceI } - DVector<uint8_t> dst_data; + PoolVector<uint8_t> dst_data; Sample::Format dst_format; if ( compression == _EditorSampleImportOptions::COMPRESS_MODE_RAM) { @@ -629,8 +629,8 @@ Error EditorSampleImportPlugin::import(const String& p_path, const Ref<ResourceI right[i]=data[i*2+1]; } - DVector<uint8_t> bleft; - DVector<uint8_t> bright; + PoolVector<uint8_t> bleft; + PoolVector<uint8_t> bright; _compress_ima_adpcm(left,bleft); _compress_ima_adpcm(right,bright); @@ -638,9 +638,9 @@ Error EditorSampleImportPlugin::import(const String& p_path, const Ref<ResourceI int dl = bleft.size(); dst_data.resize( dl *2 ); - DVector<uint8_t>::Write w=dst_data.write(); - DVector<uint8_t>::Read rl=bleft.read(); - DVector<uint8_t>::Read rr=bright.read(); + PoolVector<uint8_t>::Write w=dst_data.write(); + PoolVector<uint8_t>::Read rl=bleft.read(); + PoolVector<uint8_t>::Read rr=bright.read(); for(int i=0;i<dl;i++) { w[i*2+0]=rl[i]; @@ -655,7 +655,7 @@ Error EditorSampleImportPlugin::import(const String& p_path, const Ref<ResourceI dst_format=is16?Sample::FORMAT_PCM16:Sample::FORMAT_PCM8; dst_data.resize( data.size() * (is16?2:1)); { - DVector<uint8_t>::Write w = dst_data.write(); + PoolVector<uint8_t>::Write w = dst_data.write(); int ds=data.size(); for(int i=0;i<ds;i++) { @@ -700,7 +700,7 @@ Error EditorSampleImportPlugin::import(const String& p_path, const Ref<ResourceI } -void EditorSampleImportPlugin::_compress_ima_adpcm(const Vector<float>& p_data,DVector<uint8_t>& dst_data) { +void EditorSampleImportPlugin::_compress_ima_adpcm(const Vector<float>& p_data,PoolVector<uint8_t>& dst_data) { /*p_sample_data->data = (void*)malloc(len); @@ -730,7 +730,7 @@ void EditorSampleImportPlugin::_compress_ima_adpcm(const Vector<float>& p_data,D datalen++; dst_data.resize(datalen/2+4); - DVector<uint8_t>::Write w = dst_data.write(); + PoolVector<uint8_t>::Write w = dst_data.write(); int i,step_idx=0,prev=0; diff --git a/tools/editor/io_plugins/editor_sample_import_plugin.h b/tools/editor/io_plugins/editor_sample_import_plugin.h index a2686ebe4f..6d781756b2 100644 --- a/tools/editor/io_plugins/editor_sample_import_plugin.h +++ b/tools/editor/io_plugins/editor_sample_import_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,10 +37,10 @@ class EditorSampleImportDialog; class EditorSampleImportPlugin : public EditorImportPlugin { - OBJ_TYPE(EditorSampleImportPlugin,EditorImportPlugin); + GDCLASS(EditorSampleImportPlugin,EditorImportPlugin); EditorSampleImportDialog *dialog; - void _compress_ima_adpcm(const Vector<float>& p_data,DVector<uint8_t>& dst_data); + void _compress_ima_adpcm(const Vector<float>& p_data,PoolVector<uint8_t>& dst_data); public: static EditorSampleImportPlugin *singleton; @@ -59,7 +59,7 @@ public: class EditorSampleExportPlugin : public EditorExportPlugin { - OBJ_TYPE( EditorSampleExportPlugin, EditorExportPlugin); + GDCLASS( EditorSampleExportPlugin, EditorExportPlugin); public: diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.cpp b/tools/editor/io_plugins/editor_scene_import_plugin.cpp index cb8ec6d0bc..8fd78f11f3 100644 --- a/tools/editor/io_plugins/editor_scene_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_scene_import_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -82,7 +82,7 @@ EditorScenePostImport::EditorScenePostImport() { class EditorImportAnimationOptions : public VBoxContainer { - OBJ_TYPE( EditorImportAnimationOptions, VBoxContainer ); + GDCLASS( EditorImportAnimationOptions, VBoxContainer ); @@ -147,7 +147,7 @@ public: class EditorSceneImportDialog : public ConfirmationDialog { - OBJ_TYPE(EditorSceneImportDialog,ConfirmationDialog); + GDCLASS(EditorSceneImportDialog,ConfirmationDialog); struct FlagInfo { @@ -374,10 +374,10 @@ void EditorImportAnimationOptions::_item_edited() { void EditorImportAnimationOptions::_bind_methods() { - ObjectTypeDB::bind_method("_changed",&EditorImportAnimationOptions::_changed); - ObjectTypeDB::bind_method("_item_edited",&EditorImportAnimationOptions::_item_edited); - ObjectTypeDB::bind_method("_button_action",&EditorImportAnimationOptions::_button_action); -// ObjectTypeDB::bind_method("_changedp",&EditorImportAnimationOptions::_changedp); + ClassDB::bind_method("_changed",&EditorImportAnimationOptions::_changed); + ClassDB::bind_method("_item_edited",&EditorImportAnimationOptions::_item_edited); + ClassDB::bind_method("_button_action",&EditorImportAnimationOptions::_button_action); +// ClassDB::bind_method("_changedp",&EditorImportAnimationOptions::_changedp); ADD_SIGNAL(MethodInfo("changed")); } @@ -670,9 +670,9 @@ void EditorSceneImportDialog::_choose_save_file(const String& p_path) { void EditorSceneImportDialog::_choose_script(const String& p_path) { - String p = Globals::get_singleton()->localize_path(p_path); + String p = GlobalConfig::get_singleton()->localize_path(p_path); if (!p.is_resource_file()) - p=Globals::get_singleton()->get_resource_path().path_to(p_path.get_base_dir())+p_path.get_file(); + p=GlobalConfig::get_singleton()->get_resource_path().path_to(p_path.get_base_dir())+p_path.get_file(); script_path->set_text(p); } @@ -725,7 +725,7 @@ void EditorSceneImportDialog::_import(bool p_and_open) { if (texture_action->get_selected()==0) dst_path=save_path->get_text();//.get_base_dir(); else - dst_path=Globals::get_singleton()->get("import/shared_textures"); + dst_path=GlobalConfig::get_singleton()->get("import/shared_textures"); uint32_t flags=0; @@ -894,9 +894,9 @@ void EditorSceneImportDialog::_browse() { void EditorSceneImportDialog::_browse_target() { + save_select->popup_centered_ratio(); if (save_path->get_text()!="") save_select->set_current_path(save_path->get_text()); - save_select->popup_centered_ratio(); } @@ -1058,19 +1058,19 @@ void EditorSceneImportDialog::_set_root_type() { void EditorSceneImportDialog::_bind_methods() { - ObjectTypeDB::bind_method("_choose_file",&EditorSceneImportDialog::_choose_file); - ObjectTypeDB::bind_method("_choose_save_file",&EditorSceneImportDialog::_choose_save_file); - ObjectTypeDB::bind_method("_choose_script",&EditorSceneImportDialog::_choose_script); - ObjectTypeDB::bind_method("_import",&EditorSceneImportDialog::_import,DEFVAL(false)); - ObjectTypeDB::bind_method("_browse",&EditorSceneImportDialog::_browse); - ObjectTypeDB::bind_method("_browse_target",&EditorSceneImportDialog::_browse_target); - ObjectTypeDB::bind_method("_browse_script",&EditorSceneImportDialog::_browse_script); - ObjectTypeDB::bind_method("_dialog_hid",&EditorSceneImportDialog::_dialog_hid); - ObjectTypeDB::bind_method("_import_confirm",&EditorSceneImportDialog::_import_confirm); - ObjectTypeDB::bind_method("_open_and_import",&EditorSceneImportDialog::_open_and_import); - ObjectTypeDB::bind_method("_root_default_pressed",&EditorSceneImportDialog::_root_default_pressed); - ObjectTypeDB::bind_method("_root_type_pressed",&EditorSceneImportDialog::_root_type_pressed); - ObjectTypeDB::bind_method("_set_root_type",&EditorSceneImportDialog::_set_root_type); + ClassDB::bind_method("_choose_file",&EditorSceneImportDialog::_choose_file); + ClassDB::bind_method("_choose_save_file",&EditorSceneImportDialog::_choose_save_file); + ClassDB::bind_method("_choose_script",&EditorSceneImportDialog::_choose_script); + ClassDB::bind_method("_import",&EditorSceneImportDialog::_import,DEFVAL(false)); + ClassDB::bind_method("_browse",&EditorSceneImportDialog::_browse); + ClassDB::bind_method("_browse_target",&EditorSceneImportDialog::_browse_target); + ClassDB::bind_method("_browse_script",&EditorSceneImportDialog::_browse_script); + ClassDB::bind_method("_dialog_hid",&EditorSceneImportDialog::_dialog_hid); + ClassDB::bind_method("_import_confirm",&EditorSceneImportDialog::_import_confirm); + ClassDB::bind_method("_open_and_import",&EditorSceneImportDialog::_open_and_import); + ClassDB::bind_method("_root_default_pressed",&EditorSceneImportDialog::_root_default_pressed); + ClassDB::bind_method("_root_type_pressed",&EditorSceneImportDialog::_root_type_pressed); + ClassDB::bind_method("_set_root_type",&EditorSceneImportDialog::_set_root_type); ADD_SIGNAL( MethodInfo("imported",PropertyInfo(Variant::OBJECT,"scene")) ); @@ -1115,7 +1115,7 @@ EditorSceneImportDialog::EditorSceneImportDialog(EditorNode *p_editor, EditorSce set_title(TTR("Import 3D Scene")); HBoxContainer *import_hb = memnew( HBoxContainer ); add_child(import_hb); - set_child_rect(import_hb); + //set_child_rect(import_hb); VBoxContainer *vbc = memnew( VBoxContainer ); import_hb->add_child(vbc); @@ -1275,7 +1275,7 @@ EditorSceneImportDialog::EditorSceneImportDialog(EditorNode *p_editor, EditorSce set_hide_on_ok(false); GLOBAL_DEF("import/shared_textures","res://"); - Globals::get_singleton()->set_custom_property_info("import/shared_textures",PropertyInfo(Variant::STRING,"import/shared_textures",PROPERTY_HINT_DIR)); + GlobalConfig::get_singleton()->set_custom_property_info("import/shared_textures",PropertyInfo(Variant::STRING,"import/shared_textures",PROPERTY_HINT_DIR)); import_hb->add_constant_override("separation",30); @@ -1302,7 +1302,7 @@ EditorSceneImportDialog::EditorSceneImportDialog(EditorNode *p_editor, EditorSce add_child(confirm_import); VBoxContainer *cvb = memnew( VBoxContainer ); confirm_import->add_child(cvb); - confirm_import->set_child_rect(cvb); +// confirm_import->set_child_rect(cvb); PanelContainer *pc = memnew( PanelContainer ); pc->add_style_override("panel",get_stylebox("normal","TextEdit")); @@ -1394,7 +1394,7 @@ void EditorSceneImportPlugin::_find_resources(const Variant& p_var, Map<Ref<Imag Ref<Resource> res = p_var; if (res.is_valid()) { - if (res->is_type("Texture") && !image_map.has(res)) { + if (res->is_class("Texture") && !image_map.has(res)) { image_map.insert(res,TEXTURE_ROLE_DEFAULT); @@ -1407,7 +1407,7 @@ void EditorSceneImportPlugin::_find_resources(const Variant& p_var, Map<Ref<Imag for(List<PropertyInfo>::Element *E=pl.front();E;E=E->next()) { if (E->get().type==Variant::OBJECT || E->get().type==Variant::ARRAY || E->get().type==Variant::DICTIONARY) { - if (E->get().type==Variant::OBJECT && res->cast_to<FixedMaterial>() && (E->get().name=="textures/diffuse" || E->get().name=="textures/detail" || E->get().name=="textures/emission")) { + if (E->get().type==Variant::OBJECT && res->cast_to<FixedSpatialMaterial>() && (E->get().name=="textures/diffuse" || E->get().name=="textures/detail" || E->get().name=="textures/emission")) { Ref<ImageTexture> tex =res->get(E->get().name); if (tex.is_valid()) { @@ -1415,15 +1415,15 @@ void EditorSceneImportPlugin::_find_resources(const Variant& p_var, Map<Ref<Imag image_map.insert(tex,TEXTURE_ROLE_DIFFUSE); } - } else if (E->get().type==Variant::OBJECT && res->cast_to<FixedMaterial>() && (E->get().name=="textures/normal")) { + } else if (E->get().type==Variant::OBJECT && res->cast_to<FixedSpatialMaterial>() && (E->get().name=="textures/normal")) { Ref<ImageTexture> tex =res->get(E->get().name); if (tex.is_valid()) { image_map.insert(tex,TEXTURE_ROLE_NORMALMAP); - if (p_flags&SCENE_FLAG_CONVERT_NORMALMAPS_TO_XY) - res->cast_to<FixedMaterial>()->set_fixed_flag(FixedMaterial::FLAG_USE_XY_NORMALMAP,true); - } + //if (p_flags&SCENE_FLAG_CONVERT_NORMALMAPS_TO_XY) + // res->cast_to<FixedSpatialMaterial>()->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_XY_NORMALMAP,true); + }// } else { @@ -1529,12 +1529,12 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh> Ref<Mesh> m = mi->get_mesh(); for(int i=0;i<m->get_surface_count();i++) { - Ref<FixedMaterial> fm = m->surface_get_material(i); + Ref<FixedSpatialMaterial> fm = m->surface_get_material(i); if (fm.is_valid()) { - fm->set_flag(Material::FLAG_UNSHADED,true); - fm->set_flag(Material::FLAG_DOUBLE_SIDED,true); - fm->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER); - fm->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA,true); + // fm->set_flag(Material::FLAG_UNSHADED,true); + // fm->set_flag(Material::FLAG_DOUBLE_SIDED,true); + // fm->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER); + // fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true); } } } @@ -1552,23 +1552,23 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh> for(int i=0;i<m->get_surface_count();i++) { - Ref<FixedMaterial> mat = m->surface_get_material(i); + Ref<FixedSpatialMaterial> mat = m->surface_get_material(i); if (!mat.is_valid()) continue; if (p_flags&SCENE_FLAG_DETECT_ALPHA && _teststr(mat->get_name(),"alpha")) { - mat->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA,true); - mat->set_name(_fixstr(mat->get_name(),"alpha")); + // mat->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true); + // mat->set_name(_fixstr(mat->get_name(),"alpha")); } if (p_flags&SCENE_FLAG_DETECT_VCOLOR && _teststr(mat->get_name(),"vcol")) { - mat->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY,true); - mat->set_name(_fixstr(mat->get_name(),"vcol")); + //mat->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_COLOR_ARRAY,true); + //mat->set_name(_fixstr(mat->get_name(),"vcol")); } if (p_flags&SCENE_FLAG_SET_LIGHTMAP_TO_UV2_IF_EXISTS && m->surface_get_format(i)&Mesh::ARRAY_FORMAT_TEX_UV2) { - mat->set_flag(Material::FLAG_LIGHTMAP_ON_UV2,true); + //mat->set_flag(Material::FLAG_LIGHTMAP_ON_UV2,true); } } @@ -1627,23 +1627,23 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh> float dist = d.to_double(); mi->set_flag(GeometryInstance::FLAG_BILLBOARD,true); mi->set_flag(GeometryInstance::FLAG_BILLBOARD_FIX_Y,true); - mi->set_draw_range_begin(dist); - mi->set_draw_range_end(100000); + //mi->set_draw_range_begin(dist); + //mi->set_draw_range_end(100000); - mip->set_draw_range_begin(0); - mip->set_draw_range_end(dist); + //mip->set_draw_range_begin(0); + //mip->set_draw_range_end(dist); if (mi->get_mesh().is_valid()) { Ref<Mesh> m = mi->get_mesh(); for(int i=0;i<m->get_surface_count();i++) { - Ref<FixedMaterial> fm = m->surface_get_material(i); + Ref<FixedSpatialMaterial> fm = m->surface_get_material(i); if (fm.is_valid()) { - fm->set_flag(Material::FLAG_UNSHADED,true); - fm->set_flag(Material::FLAG_DOUBLE_SIDED,true); - fm->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER); - fm->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA,true); + // fm->set_flag(Material::FLAG_UNSHADED,true); + // fm->set_flag(Material::FLAG_DOUBLE_SIDED,true); + // fm->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER); + // fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true); } } } @@ -1675,23 +1675,23 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh> d=d.substr(1,d.length()); if (d.length() && d[0]>='0' && d[0]<='9') { float dist = d.to_double(); - mi->set_draw_range_begin(dist); - mi->set_draw_range_end(100000); + /// mi->set_draw_range_begin(dist); + // mi->set_draw_range_end(100000); - mip->set_draw_range_begin(0); - mip->set_draw_range_end(dist); + // mip->set_draw_range_begin(0); + // mip->set_draw_range_end(dist); /*if (mi->get_mesh().is_valid()) { Ref<Mesh> m = mi->get_mesh(); for(int i=0;i<m->get_surface_count();i++) { - Ref<FixedMaterial> fm = m->surface_get_material(i); + Ref<FixedSpatialMaterial> fm = m->surface_get_material(i); if (fm.is_valid()) { fm->set_flag(Material::FLAG_UNSHADED,true); fm->set_flag(Material::FLAG_DOUBLE_SIDED,true); fm->set_hint(Material::HINT_NO_DEPTH_DRAW,true); - fm->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA,true); + fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true); } } }*/ @@ -1707,7 +1707,7 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh> String str=name; int layer = str.substr(str.find("lm")+3,str.length()).to_int(); - mi->set_baked_light_texture_id(layer); + //mi->set_baked_light_texture_id(layer); } if (p_flags&SCENE_FLAG_CREATE_COLLISIONS && _teststr(name,"colonly")) { @@ -1773,7 +1773,7 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh> // get mesh instance and bounding box MeshInstance *mi = p_node->cast_to<MeshInstance>(); - AABB aabb = mi->get_aabb(); + Rect3 aabb = mi->get_aabb(); // create a new rigid body collision node RigidBody * rigid_body = memnew( RigidBody ); @@ -1788,7 +1788,7 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh> Node * mesh = p_node->duplicate(); mesh->set_name(_fixstr(name,"rigid")); // reset the xform matrix of the duplicated node so it can inherit parent node xform - mesh->cast_to<Spatial>()->set_transform(Transform(Matrix3())); + mesh->cast_to<Spatial>()->set_transform(Transform(Basis())); // reparent the new mesh node to the rigid body collision node p_node->add_child(mesh); mesh->set_owner(p_node->get_owner()); @@ -1897,14 +1897,14 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh> return p_node; MeshInstance *mi = p_node->cast_to<MeshInstance>(); - DVector<Face3> faces = mi->get_faces(VisualInstance::FACES_SOLID); + PoolVector<Face3> faces = mi->get_faces(VisualInstance::FACES_SOLID); BSP_Tree bsptree(faces); Ref<RoomBounds> area = memnew( RoomBounds ); - area->set_bounds(faces); - area->set_geometry_hint(faces); + //area->set_bounds(faces); + //area->set_geometry_hint(faces); Room * room = memnew( Room ); @@ -1932,7 +1932,7 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh> memdelete(p_node); p_node=room; - room->compute_room_from_subtree(); + //room->compute_room_from_subtree(); } else if (p_flags&SCENE_FLAG_CREATE_PORTALS &&_teststr(name,"portal") && p_node->cast_to<MeshInstance>()) { @@ -1940,7 +1940,7 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh> return p_node; MeshInstance *mi = p_node->cast_to<MeshInstance>(); - DVector<Face3> faces = mi->get_faces(VisualInstance::FACES_SOLID); + PoolVector<Face3> faces = mi->get_faces(VisualInstance::FACES_SOLID); ERR_FAIL_COND_V(faces.size()==0,NULL); //step 1 compute the plane @@ -2059,18 +2059,18 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh> for(int i=0;i<mesh->get_surface_count();i++) { - Ref<FixedMaterial> fm = mesh->surface_get_material(i); + Ref<FixedSpatialMaterial> fm = mesh->surface_get_material(i); if (fm.is_valid()) { String name = fm->get_name(); - if (_teststr(name,"alpha")) { - fm->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA,true); + /* if (_teststr(name,"alpha")) { + fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA,true); name=_fixstr(name,"alpha"); } if (_teststr(name,"vcol")) { - fm->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY,true); + fm->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_COLOR_ARRAY,true); name=_fixstr(name,"vcol"); - } + }*/ fm->set_name(name); } } @@ -2189,7 +2189,7 @@ Error EditorSceneImportPlugin::import1(const Ref<ResourceImportMetadata>& p_from if (from->has_option("root_type")) { String type = from->get_option("root_type"); - Object *base = ObjectTypeDB::instance(type); + Object *base = ClassDB::instance(type); Node *base_node = NULL; if (base) base_node=base->cast_to<Node>(); @@ -2801,7 +2801,7 @@ Error EditorSceneImportPlugin::import2(Node *scene, const String& p_dest_path, c String path = texture->get_path(); String fname= path.get_file(); - String target_path = Globals::get_singleton()->localize_path(target_res_path.plus_file(fname)); + String target_path = GlobalConfig::get_singleton()->localize_path(target_res_path.plus_file(fname)); progress.step(TTR("Import Image:")+" "+fname,3+(idx)*100/imagemap.size()); idx++; diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.h b/tools/editor/io_plugins/editor_scene_import_plugin.h index 2c27f06960..61153e3654 100644 --- a/tools/editor/io_plugins/editor_scene_import_plugin.h +++ b/tools/editor/io_plugins/editor_scene_import_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -51,7 +51,7 @@ class EditorSceneImportDialog; class EditorSceneImporter : public Reference { - OBJ_TYPE(EditorSceneImporter,Reference ); + GDCLASS(EditorSceneImporter,Reference ); public: enum ImportFlags { @@ -83,7 +83,7 @@ public: class EditorScenePostImport : public Reference { - OBJ_TYPE(EditorScenePostImport,Reference ); + GDCLASS(EditorScenePostImport,Reference ); protected: static void _bind_methods(); @@ -96,7 +96,7 @@ public: class EditorSceneImportPlugin : public EditorImportPlugin { - OBJ_TYPE(EditorSceneImportPlugin,EditorImportPlugin); + GDCLASS(EditorSceneImportPlugin,EditorImportPlugin); EditorSceneImportDialog *dialog; @@ -174,7 +174,7 @@ public: class EditorSceneAnimationImportPlugin : public EditorImportPlugin { - OBJ_TYPE(EditorSceneAnimationImportPlugin,EditorImportPlugin); + GDCLASS(EditorSceneAnimationImportPlugin,EditorImportPlugin); public: diff --git a/tools/editor/io_plugins/editor_scene_importer_fbxconv.cpp b/tools/editor/io_plugins/editor_scene_importer_fbxconv.cpp index ac3c4637c2..e1b0719941 100644 --- a/tools/editor/io_plugins/editor_scene_importer_fbxconv.cpp +++ b/tools/editor/io_plugins/editor_scene_importer_fbxconv.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ #include "scene/3d/mesh_instance.h" #include "scene/animation/animation_player.h" - +#if 0 String EditorSceneImporterFBXConv::_id(const String& p_id) const { return p_id.replace(":","_").replace("/","_"); @@ -336,7 +336,7 @@ void EditorSceneImporterFBXConv::_add_surface(State& state,Ref<Mesh>& m,const Di int idx = m->get_surface_count(); Array array = state.surface_cache[id].array; - DVector<float> indices = array[Mesh::ARRAY_BONES]; + PoolVector<float> indices = array[Mesh::ARRAY_BONES]; if (indices.size() && part.has("bones")) { @@ -361,7 +361,7 @@ void EditorSceneImporterFBXConv::_add_surface(State& state,Ref<Mesh>& m,const Di int ilen=indices.size(); { - DVector<float>::Write iw=indices.write(); + PoolVector<float>::Write iw=indices.write(); for(int j=0;j<ilen;j++) { int b = iw[j]; ERR_CONTINUE(!index_map.has(b)); @@ -482,29 +482,29 @@ void EditorSceneImporterFBXConv::_parse_materials(State& state) { ERR_CONTINUE(!material.has("id")); String id = _id(material["id"]); - Ref<FixedMaterial> mat = memnew( FixedMaterial ); + Ref<FixedSpatialMaterial> mat = memnew( FixedSpatialMaterial ); if (material.has("diffuse")) { - mat->set_parameter(FixedMaterial::PARAM_DIFFUSE,_get_color(material["diffuse"])); + mat->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,_get_color(material["diffuse"])); } if (material.has("specular")) { - mat->set_parameter(FixedMaterial::PARAM_SPECULAR,_get_color(material["specular"])); + mat->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR,_get_color(material["specular"])); } if (material.has("emissive")) { - mat->set_parameter(FixedMaterial::PARAM_EMISSION,_get_color(material["emissive"])); + mat->set_parameter(FixedSpatialMaterial::PARAM_EMISSION,_get_color(material["emissive"])); } if (material.has("shininess")) { float exp = material["shininess"]; - mat->set_parameter(FixedMaterial::PARAM_SPECULAR_EXP,exp); + mat->set_parameter(FixedSpatialMaterial::PARAM_SPECULAR_EXP,exp); } if (material.has("opacity")) { - Color c = mat->get_parameter(FixedMaterial::PARAM_DIFFUSE); + Color c = mat->get_parameter(FixedSpatialMaterial::PARAM_DIFFUSE); c.a=material["opacity"]; - mat->set_parameter(FixedMaterial::PARAM_DIFFUSE,c); + mat->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,c); } @@ -536,15 +536,15 @@ void EditorSceneImporterFBXConv::_parse_materials(State& state) { String type=texture["type"]; if (type=="DIFFUSE") - mat->set_texture(FixedMaterial::PARAM_DIFFUSE,tex); + mat->set_texture(FixedSpatialMaterial::PARAM_DIFFUSE,tex); else if (type=="SPECULAR") - mat->set_texture(FixedMaterial::PARAM_SPECULAR,tex); + mat->set_texture(FixedSpatialMaterial::PARAM_SPECULAR,tex); else if (type=="SHININESS") - mat->set_texture(FixedMaterial::PARAM_SPECULAR_EXP,tex); + mat->set_texture(FixedSpatialMaterial::PARAM_SPECULAR_EXP,tex); else if (type=="NORMAL") - mat->set_texture(FixedMaterial::PARAM_NORMAL,tex); + mat->set_texture(FixedSpatialMaterial::PARAM_NORMAL,tex); else if (type=="EMISSIVE") - mat->set_texture(FixedMaterial::PARAM_EMISSION,tex); + mat->set_texture(FixedSpatialMaterial::PARAM_EMISSION,tex); } } @@ -680,11 +680,11 @@ void EditorSceneImporterFBXConv::_parse_surfaces(State& state) { case Mesh::ARRAY_VERTEX: case Mesh::ARRAY_NORMAL: { - DVector<Vector3> vtx; + PoolVector<Vector3> vtx; vtx.resize(array.size()); { int len=array.size(); - DVector<Vector3>::Write w = vtx.write(); + PoolVector<Vector3>::Write w = vtx.write(); for(int l=0;l<len;l++) { int pos = array[l]; @@ -701,12 +701,12 @@ void EditorSceneImporterFBXConv::_parse_surfaces(State& state) { if (binormal_ofs<0) break; - DVector<float> tangents; + PoolVector<float> tangents; tangents.resize(array.size()*4); { int len=array.size(); - DVector<float>::Write w = tangents.write(); + PoolVector<float>::Write w = tangents.write(); for(int l=0;l<len;l++) { int pos = array[l]; @@ -736,11 +736,11 @@ void EditorSceneImporterFBXConv::_parse_surfaces(State& state) { } break; case Mesh::ARRAY_COLOR: { - DVector<Color> cols; + PoolVector<Color> cols; cols.resize(array.size()); { int len=array.size(); - DVector<Color>::Write w = cols.write(); + PoolVector<Color>::Write w = cols.write(); for(int l=0;l<len;l++) { int pos = array[l]; @@ -756,11 +756,11 @@ void EditorSceneImporterFBXConv::_parse_surfaces(State& state) { case Mesh::ARRAY_TEX_UV: case Mesh::ARRAY_TEX_UV2: { - DVector<Vector2> uvs; + PoolVector<Vector2> uvs; uvs.resize(array.size()); { int len=array.size(); - DVector<Vector2>::Write w = uvs.write(); + PoolVector<Vector2>::Write w = uvs.write(); for(int l=0;l<len;l++) { int pos = array[l]; @@ -775,14 +775,14 @@ void EditorSceneImporterFBXConv::_parse_surfaces(State& state) { case Mesh::ARRAY_BONES: case Mesh::ARRAY_WEIGHTS: { - DVector<float> arr; + PoolVector<float> arr; arr.resize(array.size()*4); int po=k==Mesh::ARRAY_WEIGHTS?1:0; lofs=ofs[Mesh::ARRAY_BONES]; { int len=array.size(); - DVector<float>::Write w = arr.write(); + PoolVector<float>::Write w = arr.write(); for(int l=0;l<len;l++) { int pos = array[l]; @@ -801,12 +801,12 @@ void EditorSceneImporterFBXConv::_parse_surfaces(State& state) { } break; case Mesh::ARRAY_INDEX: { - DVector<int> arr; + PoolVector<int> arr; arr.resize(indices.size()); { int len=indices.size(); - DVector<int>::Write w = arr.write(); + PoolVector<int>::Write w = arr.write(); for(int l=0;l<len;l++) { w[l]=iarray[ indices[l] ]; @@ -838,10 +838,10 @@ void EditorSceneImporterFBXConv::_parse_surfaces(State& state) { } if (pt==Mesh::PRIMITIVE_TRIANGLES) { - DVector<int> ia=arrays[Mesh::ARRAY_INDEX]; + PoolVector<int> ia=arrays[Mesh::ARRAY_INDEX]; int len=ia.size(); { - DVector<int>::Write w=ia.write(); + PoolVector<int>::Write w=ia.write(); for(int l=0;l<len;l+=3) { SWAP(w[l+1],w[l+2]); } @@ -1132,3 +1132,4 @@ EditorSceneImporterFBXConv::EditorSceneImporterFBXConv() { #endif } +#endif diff --git a/tools/editor/io_plugins/editor_scene_importer_fbxconv.h b/tools/editor/io_plugins/editor_scene_importer_fbxconv.h index b0cbc07ba3..1bf96ba0e5 100644 --- a/tools/editor/io_plugins/editor_scene_importer_fbxconv.h +++ b/tools/editor/io_plugins/editor_scene_importer_fbxconv.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,10 +32,11 @@ #include "tools/editor/io_plugins/editor_scene_import_plugin.h" #include "scene/3d/skeleton.h" +#if 0 class EditorSceneImporterFBXConv : public EditorSceneImporter { - OBJ_TYPE(EditorSceneImporterFBXConv,EditorSceneImporter ); + GDCLASS(EditorSceneImporterFBXConv,EditorSceneImporter ); struct BoneInfo { @@ -107,3 +108,4 @@ public: }; #endif // EDITOR_SCENE_IMPORTER_FBXCONV_H +#endif diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.cpp b/tools/editor/io_plugins/editor_texture_import_plugin.cpp index 2935ea8fe2..fd18dc6cb8 100644 --- a/tools/editor/io_plugins/editor_texture_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_texture_import_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -106,12 +106,12 @@ void EditorImportTextureOptions::set_flags(uint32_t p_flags){ void EditorImportTextureOptions::set_quality(float p_quality) { - quality->set_val(p_quality); + quality->set_value(p_quality); } float EditorImportTextureOptions::get_quality() const { - return quality->get_val(); + return quality->get_value(); } @@ -148,8 +148,8 @@ void EditorImportTextureOptions::_changed() { void EditorImportTextureOptions::_bind_methods() { - ObjectTypeDB::bind_method("_changed",&EditorImportTextureOptions::_changed); - ObjectTypeDB::bind_method("_changedp",&EditorImportTextureOptions::_changedp); + ClassDB::bind_method("_changed",&EditorImportTextureOptions::_changed); + ClassDB::bind_method("_changedp",&EditorImportTextureOptions::_changedp); ADD_SIGNAL(MethodInfo("changed")); } @@ -200,7 +200,7 @@ EditorImportTextureOptions::EditorImportTextureOptions() { hs->set_min(0); hs->set_max(1.0); hs->set_step(0.01); - hs->set_val(0.7); + hs->set_value(0.7); quality=hs; quality_vb->add_margin_child(TTR("Texture Compression Quality (WebP):"),quality_hb); @@ -236,7 +236,7 @@ EditorImportTextureOptions::EditorImportTextureOptions() { class EditorTextureImportDialog : public ConfirmationDialog { - OBJ_TYPE(EditorTextureImportDialog,ConfirmationDialog); + GDCLASS(EditorTextureImportDialog,ConfirmationDialog); @@ -396,7 +396,7 @@ void EditorTextureImportDialog::_import() { imd->set_option("flags",texture_options->get_flags()); imd->set_option("quality",texture_options->get_quality()); imd->set_option("atlas",true); - imd->set_option("atlas_size",int(size->get_val())); + imd->set_option("atlas_size",int(size->get_value())); imd->set_option("large",false); imd->set_option("crop",crop_source->is_pressed()); imd->set_option("mode",mode); @@ -430,7 +430,7 @@ void EditorTextureImportDialog::_import() { imd->set_option("quality",texture_options->get_quality()); imd->set_option("atlas",false); imd->set_option("large",true); - imd->set_option("large_cell_size",int(size->get_val())); + imd->set_option("large_cell_size",int(size->get_value())); imd->set_option("crop",crop_source->is_pressed()); imd->set_option("mode",mode); @@ -569,7 +569,7 @@ void EditorTextureImportDialog::_mode_changed(int p_mode) { if (p_mode==EditorTextureImportPlugin::MODE_ATLAS) { size_label->set_text(TTR("Max Texture Size:")); - size->set_val(2048); + size->set_value(2048); crop_source->show(); size_label->show(); size->show(); @@ -587,7 +587,7 @@ void EditorTextureImportDialog::_mode_changed(int p_mode) { if (p_mode==EditorTextureImportPlugin::MODE_LARGE) { size_label->set_text(TTR("Cell Size:")); - size->set_val(256); + size->set_value(256); size_label->show(); size->show(); @@ -636,13 +636,13 @@ void EditorTextureImportDialog::_mode_changed(int p_mode) { void EditorTextureImportDialog::_bind_methods() { - ObjectTypeDB::bind_method("_choose_files",&EditorTextureImportDialog::_choose_files); - ObjectTypeDB::bind_method("_choose_file",&EditorTextureImportDialog::_choose_file); - ObjectTypeDB::bind_method("_choose_save_dir",&EditorTextureImportDialog::_choose_save_dir); - ObjectTypeDB::bind_method("_import",&EditorTextureImportDialog::_import); - ObjectTypeDB::bind_method("_browse",&EditorTextureImportDialog::_browse); - ObjectTypeDB::bind_method("_browse_target",&EditorTextureImportDialog::_browse_target); - ObjectTypeDB::bind_method("_mode_changed",&EditorTextureImportDialog::_mode_changed); + ClassDB::bind_method("_choose_files",&EditorTextureImportDialog::_choose_files); + ClassDB::bind_method("_choose_file",&EditorTextureImportDialog::_choose_file); + ClassDB::bind_method("_choose_save_dir",&EditorTextureImportDialog::_choose_save_dir); + ClassDB::bind_method("_import",&EditorTextureImportDialog::_import); + ClassDB::bind_method("_browse",&EditorTextureImportDialog::_browse); + ClassDB::bind_method("_browse_target",&EditorTextureImportDialog::_browse_target); + ClassDB::bind_method("_mode_changed",&EditorTextureImportDialog::_mode_changed); // ADD_SIGNAL( MethodInfo("imported",PropertyInfo(Variant::OBJECT,"scene")) ); } @@ -657,14 +657,14 @@ EditorTextureImportDialog::EditorTextureImportDialog(EditorTextureImportPlugin* mode_hb = memnew( HBoxContainer ); add_child(mode_hb); - set_child_rect(mode_hb); + //set_child_rect(mode_hb); VBoxContainer *vbcg = memnew( VBoxContainer); mode_hb->add_child(vbcg); mode_hb->add_constant_override("separation",15); - ButtonGroup *bg = memnew( ButtonGroup ); + VBoxContainer *bg = memnew( VBoxContainer ); vbcg->add_margin_child("Import Mode",bg); for(int i=0;i<EditorTextureImportPlugin::MODE_MAX;i++) { @@ -727,7 +727,7 @@ EditorTextureImportDialog::EditorTextureImportDialog(EditorTextureImportPlugin* size->set_max(16384); - size->set_val(256); + size->set_value(256); size_mc=vbc->add_margin_child(TTR("Cell Size:"),size); size_label=vbc->get_child(size_mc->get_index()-1)->cast_to<Label>(); @@ -843,33 +843,27 @@ void EditorTextureImportPlugin::compress_image(EditorExportPlatform::ImageCompre //do absolutely nothing - } break; - case EditorExportPlatform::IMAGE_COMPRESSION_INDEXED: { - - //quantize - image.quantize(); - - } break; + } break; case EditorExportPlatform::IMAGE_COMPRESSION_BC: { // for maximum compatibility, BC shall always use mipmaps and be PO2 image.resize_to_po2(); - if (image.get_mipmaps()==0) + if (!image.has_mipmaps()) image.generate_mipmaps(); - image.compress(Image::COMPRESS_BC); + image.compress(Image::COMPRESS_S3TC); /* if (has_alpha) { if (flags&IMAGE_FLAG_ALPHA_BIT) { - image.convert(Image::FORMAT_BC3); + image.convert(Image::FORMAT_DXT5); } else { - image.convert(Image::FORMAT_BC2); + image.convert(Image::FORMAT_DXT3); } } else { - image.convert(Image::FORMAT_BC1); + image.convert(Image::FORMAT_DXT1); }*/ @@ -880,24 +874,24 @@ void EditorTextureImportPlugin::compress_image(EditorExportPlatform::ImageCompre // for maximum compatibility (hi apple!), PVRT shall always // use mipmaps, be PO2 and square - if (image.get_mipmaps()==0) + if (!image.has_mipmaps()) image.generate_mipmaps(); image.resize_to_po2(true); if (p_smaller) { image.compress(Image::COMPRESS_PVRTC2); - //image.convert(has_alpha ? Image::FORMAT_PVRTC2_ALPHA : Image::FORMAT_PVRTC2); + //image.convert(has_alpha ? Image::FORMAT_PVRTC2A : Image::FORMAT_PVRTC2); } else { image.compress(Image::COMPRESS_PVRTC4); - //image.convert(has_alpha ? Image::FORMAT_PVRTC4_ALPHA : Image::FORMAT_PVRTC4); + //image.convert(has_alpha ? Image::FORMAT_PVRTC4A : Image::FORMAT_PVRTC4); } } break; case EditorExportPlatform::IMAGE_COMPRESSION_ETC1: { image.resize_to_po2(); //square or not? - if (image.get_mipmaps()==0) + if (!image.has_mipmaps()) image.generate_mipmaps(); if (!image.detect_alpha()) { //ETC1 is only opaque @@ -930,18 +924,18 @@ Error EditorTextureImportPlugin::_process_texture_data(Ref<ImageTexture> &textur ERR_FAIL_COND_V(image.empty(),ERR_INVALID_DATA); bool has_alpha=image.detect_alpha(); - if (!has_alpha && image.get_format()==Image::FORMAT_RGBA) { + if (!has_alpha && image.get_format()==Image::FORMAT_RGBA8) { - image.convert(Image::FORMAT_RGB); + image.convert(Image::FORMAT_RGB8); } - if (image.get_format()==Image::FORMAT_RGBA && flags&IMAGE_FLAG_FIX_BORDER_ALPHA) { + if (image.get_format()==Image::FORMAT_RGBA8 && flags&IMAGE_FLAG_FIX_BORDER_ALPHA) { image.fix_alpha_edges(); } - if (image.get_format()==Image::FORMAT_RGBA && flags&IMAGE_FLAG_PREMULT_ALPHA) { + if (image.get_format()==Image::FORMAT_RGBA8 && flags&IMAGE_FLAG_PREMULT_ALPHA) { image.premultiply_alpha(); } @@ -950,7 +944,7 @@ Error EditorTextureImportPlugin::_process_texture_data(Ref<ImageTexture> &textur image.normalmap_to_xy(); } - //if ((image.get_format()==Image::FORMAT_RGB || image.get_format()==Image::FORMAT_RGBA) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) { + //if ((image.get_format()==Image::FORMAT_RGB8 || image.get_format()==Image::FORMAT_RGBA8) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) { // image.srgb_to_linear(); //} @@ -989,18 +983,18 @@ Error EditorTextureImportPlugin::_process_texture_data(Ref<ImageTexture> &textur bool has_alpha=image.detect_alpha(); - if (!has_alpha && image.get_format()==Image::FORMAT_RGBA) { + if (!has_alpha && image.get_format()==Image::FORMAT_RGBA8) { - image.convert(Image::FORMAT_RGB); + image.convert(Image::FORMAT_RGB8); } - if (image.get_format()==Image::FORMAT_RGBA && flags&IMAGE_FLAG_FIX_BORDER_ALPHA) { + if (image.get_format()==Image::FORMAT_RGBA8 && flags&IMAGE_FLAG_FIX_BORDER_ALPHA) { image.fix_alpha_edges(); } - if (image.get_format()==Image::FORMAT_RGBA && flags&IMAGE_FLAG_PREMULT_ALPHA) { + if (image.get_format()==Image::FORMAT_RGBA8 && flags&IMAGE_FLAG_PREMULT_ALPHA) { image.premultiply_alpha(); } @@ -1009,7 +1003,7 @@ Error EditorTextureImportPlugin::_process_texture_data(Ref<ImageTexture> &textur image.normalmap_to_xy(); } - //if ((image.get_format()==Image::FORMAT_RGB || image.get_format()==Image::FORMAT_RGBA) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) { + //if ((image.get_format()==Image::FORMAT_RGB8 || image.get_format()==Image::FORMAT_RGBA8) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) { // // print_line("CONVERT BECAUSE: "+itos(flags)); // image.srgb_to_linear(); @@ -1200,14 +1194,14 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc Image src = tsources[i]; if (alpha) { - src.convert(Image::FORMAT_RGBA); + src.convert(Image::FORMAT_RGBA8); } else { - src.convert(Image::FORMAT_RGB); + src.convert(Image::FORMAT_RGB8); } - DVector<uint8_t> data = src.get_data(); + PoolVector<uint8_t> data = src.get_data(); MD5_CTX md5; - DVector<uint8_t>::Read r=data.read(); + PoolVector<uint8_t>::Read r=data.read(); MD5Init(&md5); int len=data.size(); for(int j=0;j<len;j++) { @@ -1280,7 +1274,7 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc atlas_h=nearest_power_of_2(dst_size.height); } Image atlas; - atlas.create(atlas_w,atlas_h,0,alpha?Image::FORMAT_RGBA:Image::FORMAT_RGB); + atlas.create(atlas_w,atlas_h,0,alpha?Image::FORMAT_RGBA8:Image::FORMAT_RGB8); atlases.resize(from->get_source_count()); @@ -1411,18 +1405,18 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc ERR_FAIL_COND_V(image.empty(),ERR_INVALID_DATA); bool has_alpha=image.detect_alpha(); - if (!has_alpha && image.get_format()==Image::FORMAT_RGBA) { + if (!has_alpha && image.get_format()==Image::FORMAT_RGBA8) { - image.convert(Image::FORMAT_RGB); + image.convert(Image::FORMAT_RGB8); } - if (image.get_format()==Image::FORMAT_RGBA && flags&IMAGE_FLAG_FIX_BORDER_ALPHA) { + if (image.get_format()==Image::FORMAT_RGBA8 && flags&IMAGE_FLAG_FIX_BORDER_ALPHA) { image.fix_alpha_edges(); } - if (image.get_format()==Image::FORMAT_RGBA && flags&IMAGE_FLAG_PREMULT_ALPHA) { + if (image.get_format()==Image::FORMAT_RGBA8 && flags&IMAGE_FLAG_PREMULT_ALPHA) { image.premultiply_alpha(); } @@ -1431,7 +1425,7 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc image.normalmap_to_xy(); } - //if ((image.get_format()==Image::FORMAT_RGB || image.get_format()==Image::FORMAT_RGBA) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) { + //if ((image.get_format()==Image::FORMAT_RGB8 || image.get_format()==Image::FORMAT_RGBA8) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) { // image.srgb_to_linear(); //} @@ -1470,18 +1464,18 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc bool has_alpha=image.detect_alpha(); - if (!has_alpha && image.get_format()==Image::FORMAT_RGBA) { + if (!has_alpha && image.get_format()==Image::FORMAT_RGBA8) { - image.convert(Image::FORMAT_RGB); + image.convert(Image::FORMAT_RGB8); } - if (image.get_format()==Image::FORMAT_RGBA && flags&IMAGE_FLAG_FIX_BORDER_ALPHA) { + if (image.get_format()==Image::FORMAT_RGBA8 && flags&IMAGE_FLAG_FIX_BORDER_ALPHA) { image.fix_alpha_edges(); } - if (image.get_format()==Image::FORMAT_RGBA && flags&IMAGE_FLAG_PREMULT_ALPHA) { + if (image.get_format()==Image::FORMAT_RGBA8 && flags&IMAGE_FLAG_PREMULT_ALPHA) { image.premultiply_alpha(); } @@ -1490,7 +1484,7 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref<Resourc image.normalmap_to_xy(); } - //if ((image.get_format()==Image::FORMAT_RGB || image.get_format()==Image::FORMAT_RGBA) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) { + //if ((image.get_format()==Image::FORMAT_RGB8 || image.get_format()==Image::FORMAT_RGBA8) && flags&IMAGE_FLAG_CONVERT_TO_LINEAR) { // // print_line("CONVERT BECAUSE: "+itos(flags)); // image.srgb_to_linear(); @@ -1645,7 +1639,7 @@ Vector<uint8_t> EditorTextureImportPlugin::custom_export(const String& p_path, c uint8_t f4[4]; encode_uint32(flags,&f4[0]); MD5Init(&ctx); - String gp = Globals::get_singleton()->globalize_path(p_path); + String gp = GlobalConfig::get_singleton()->globalize_path(p_path); CharString cs = gp.utf8(); MD5Update(&ctx,(unsigned char*)cs.get_data(),cs.length()); MD5Update(&ctx,f4,4); diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.h b/tools/editor/io_plugins/editor_texture_import_plugin.h index 22c10a1a3a..b2117f1475 100644 --- a/tools/editor/io_plugins/editor_texture_import_plugin.h +++ b/tools/editor/io_plugins/editor_texture_import_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -49,7 +49,7 @@ class EditorTextureImportDialog; class EditorTextureImportPlugin : public EditorImportPlugin { - OBJ_TYPE(EditorTextureImportPlugin,EditorImportPlugin); + GDCLASS(EditorTextureImportPlugin,EditorImportPlugin); public: @@ -119,7 +119,7 @@ public: class EditorTextureExportPlugin : public EditorExportPlugin { - OBJ_TYPE( EditorTextureExportPlugin, EditorExportPlugin); + GDCLASS( EditorTextureExportPlugin, EditorExportPlugin); public: @@ -130,7 +130,7 @@ public: class EditorImportTextureOptions : public VBoxContainer { - OBJ_TYPE( EditorImportTextureOptions, VBoxContainer ); + GDCLASS( EditorImportTextureOptions, VBoxContainer ); OptionButton *format; diff --git a/tools/editor/io_plugins/editor_translation_import_plugin.cpp b/tools/editor/io_plugins/editor_translation_import_plugin.cpp index 9ee3e98486..73d9e989ac 100644 --- a/tools/editor/io_plugins/editor_translation_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_translation_import_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -41,7 +41,7 @@ class EditorTranslationImportDialog : public ConfirmationDialog { - OBJ_TYPE(EditorTranslationImportDialog,ConfirmationDialog); + GDCLASS(EditorTranslationImportDialog,ConfirmationDialog); EditorTranslationImportPlugin *plugin; @@ -282,11 +282,11 @@ public: static void _bind_methods() { - ObjectTypeDB::bind_method("_choose_file",&EditorTranslationImportDialog::_choose_file); - ObjectTypeDB::bind_method("_choose_save_dir",&EditorTranslationImportDialog::_choose_save_dir); - ObjectTypeDB::bind_method("_import",&EditorTranslationImportDialog::_import); - ObjectTypeDB::bind_method("_browse",&EditorTranslationImportDialog::_browse); - ObjectTypeDB::bind_method("_browse_target",&EditorTranslationImportDialog::_browse_target); + ClassDB::bind_method("_choose_file",&EditorTranslationImportDialog::_choose_file); + ClassDB::bind_method("_choose_save_dir",&EditorTranslationImportDialog::_choose_save_dir); + ClassDB::bind_method("_import",&EditorTranslationImportDialog::_import); + ClassDB::bind_method("_browse",&EditorTranslationImportDialog::_browse); + ClassDB::bind_method("_browse_target",&EditorTranslationImportDialog::_browse_target); // ADD_SIGNAL( MethodInfo("imported",PropertyInfo(Variant::OBJECT,"scene")) ); } @@ -299,7 +299,7 @@ public: VBoxContainer *vbc = memnew( VBoxContainer ); add_child(vbc); - set_child_rect(vbc); + //set_child_rect(vbc); diff --git a/tools/editor/io_plugins/editor_translation_import_plugin.h b/tools/editor/io_plugins/editor_translation_import_plugin.h index 532f2cedcc..38727bd778 100644 --- a/tools/editor/io_plugins/editor_translation_import_plugin.h +++ b/tools/editor/io_plugins/editor_translation_import_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ class EditorTranslationImportDialog; class EditorTranslationImportPlugin : public EditorImportPlugin { - OBJ_TYPE(EditorTranslationImportPlugin,EditorImportPlugin); + GDCLASS(EditorTranslationImportPlugin,EditorImportPlugin); EditorTranslationImportDialog *dialog; public: diff --git a/tools/editor/multi_node_edit.cpp b/tools/editor/multi_node_edit.cpp index e4ceaf4a8b..47b776ed06 100644 --- a/tools/editor/multi_node_edit.cpp +++ b/tools/editor/multi_node_edit.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/multi_node_edit.h b/tools/editor/multi_node_edit.h index fd50dc5bf4..290c529d48 100644 --- a/tools/editor/multi_node_edit.h +++ b/tools/editor/multi_node_edit.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ class MultiNodeEdit : public Reference { - OBJ_TYPE(MultiNodeEdit,Reference); + GDCLASS(MultiNodeEdit,Reference); List<NodePath> nodes; struct PLData { diff --git a/tools/editor/node_dock.cpp b/tools/editor/node_dock.cpp index fb5a50e633..a8e66a8680 100644 --- a/tools/editor/node_dock.cpp +++ b/tools/editor/node_dock.cpp @@ -20,8 +20,8 @@ void NodeDock::show_connections(){ void NodeDock::_bind_methods() { - ObjectTypeDB::bind_method(_MD("show_groups"),&NodeDock::show_groups); - ObjectTypeDB::bind_method(_MD("show_connections"),&NodeDock::show_connections); + ClassDB::bind_method(_MD("show_groups"),&NodeDock::show_groups); + ClassDB::bind_method(_MD("show_connections"),&NodeDock::show_connections); } void NodeDock::_notification(int p_what) { diff --git a/tools/editor/node_dock.h b/tools/editor/node_dock.h index 02312b90b5..fd4105d1b2 100644 --- a/tools/editor/node_dock.h +++ b/tools/editor/node_dock.h @@ -6,7 +6,7 @@ class NodeDock : public VBoxContainer { - OBJ_TYPE(NodeDock,VBoxContainer); + GDCLASS(NodeDock,VBoxContainer); ToolButton *connections_button; ToolButton *groups_button; diff --git a/tools/editor/output_strings.cpp b/tools/editor/output_strings.cpp index a6126466c4..9ba97451c0 100644 --- a/tools/editor/output_strings.cpp +++ b/tools/editor/output_strings.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -68,7 +68,7 @@ void OutputStrings::_notification(int p_what) { if (following) { updating=true; - v_scroll->set_val( v_scroll->get_max() - v_scroll->get_page() ); + v_scroll->set_value( v_scroll->get_max() - v_scroll->get_page() ); updating=false; } @@ -85,8 +85,8 @@ void OutputStrings::_notification(int p_what) { // int lines = (size_height-(int)margin.y) / font_height; Point2 ofs=tree_st->get_offset(); - LineMap::Element *E = line_map.find(v_scroll->get_val()); - float h_ofs = (int)h_scroll->get_val(); + LineMap::Element *E = line_map.find(v_scroll->get_value()); + float h_ofs = (int)h_scroll->get_value(); Point2 icon_ofs=Point2(0,(font_height-(int)icon_error->get_height())/2); while( E && ofs.y < (size_height-(int)margin.y) ) { @@ -194,8 +194,8 @@ void OutputStrings::add_line(const String& p_text, const Variant& p_meta, const void OutputStrings::_bind_methods() { - ObjectTypeDB::bind_method("_vscroll_changed",&OutputStrings::_vscroll_changed); - ObjectTypeDB::bind_method("_hscroll_changed",&OutputStrings::_hscroll_changed); + ClassDB::bind_method("_vscroll_changed",&OutputStrings::_vscroll_changed); + ClassDB::bind_method("_hscroll_changed",&OutputStrings::_hscroll_changed); } OutputStrings::OutputStrings() { diff --git a/tools/editor/output_strings.h b/tools/editor/output_strings.h index 29c6ea799f..cc721ef652 100644 --- a/tools/editor/output_strings.h +++ b/tools/editor/output_strings.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ class OutputStrings : public Control { - OBJ_TYPE( OutputStrings, Control ); + GDCLASS( OutputStrings, Control ); public: enum LineType { diff --git a/tools/editor/pane_drag.cpp b/tools/editor/pane_drag.cpp index 8e8c2941ec..122abd37b9 100644 --- a/tools/editor/pane_drag.cpp +++ b/tools/editor/pane_drag.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -29,7 +29,7 @@ #include "pane_drag.h" -void PaneDrag::_input_event(const InputEvent& p_input) { +void PaneDrag::_gui_input(const InputEvent& p_input) { if (p_input.type==InputEvent::MOUSE_MOTION && p_input.mouse_motion.button_mask&BUTTON_MASK_LEFT) { @@ -64,7 +64,7 @@ Size2 PaneDrag::get_minimum_size() const { void PaneDrag::_bind_methods() { - ObjectTypeDB::bind_method("_input_event",&PaneDrag::_input_event); + ClassDB::bind_method("_gui_input",&PaneDrag::_gui_input); ADD_SIGNAL(MethodInfo("dragged",PropertyInfo(Variant::VECTOR2,"amount"))); } diff --git a/tools/editor/pane_drag.h b/tools/editor/pane_drag.h index 24f2ef7ed8..8796fc2594 100644 --- a/tools/editor/pane_drag.h +++ b/tools/editor/pane_drag.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,14 +33,14 @@ class PaneDrag : public Control { - OBJ_TYPE( PaneDrag, Control ); + GDCLASS( PaneDrag, Control ); bool mouse_over; protected: - void _input_event(const InputEvent& p_input); + void _gui_input(const InputEvent& p_input); void _notification(int p_what); virtual Size2 get_minimum_size() const; static void _bind_methods(); diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp index d6d452dd72..3201db1116 100644 --- a/tools/editor/plugins/animation_player_editor_plugin.cpp +++ b/tools/editor/plugins/animation_player_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -50,7 +50,7 @@ void AnimationPlayerEditor::_node_removed(Node *p_node) { } } -void AnimationPlayerEditor::_input_event(InputEvent p_event) { +void AnimationPlayerEditor::_gui_input(InputEvent p_event) { } @@ -77,14 +77,14 @@ void AnimationPlayerEditor::_notification(int p_what) { } } } - frame->set_val(player->get_current_animation_pos()); + frame->set_value(player->get_current_animation_pos()); key_editor->set_anim_pos(player->get_current_animation_pos()); EditorNode::get_singleton()->get_property_editor()->refresh(); } else if (last_active) { //need the last frame after it stopped - frame->set_val(player->get_current_animation_pos()); + frame->set_value(player->get_current_animation_pos()); } last_active=player->is_playing(); @@ -101,7 +101,7 @@ void AnimationPlayerEditor::_notification(int p_what) { autoplay->set_icon( get_icon("AutoPlay","EditorIcons") ); load_anim->set_icon( get_icon("Folder","EditorIcons") ); save_anim->set_icon(get_icon("Save", "EditorIcons")); - save_anim->get_popup()->connect("item_pressed", this, "_animation_save_menu"); + save_anim->get_popup()->connect("id_pressed", this, "_animation_save_menu"); remove_anim->set_icon( get_icon("Remove","EditorIcons") ); blend_anim->set_icon( get_icon("Blend","EditorIcons") ); @@ -115,7 +115,7 @@ void AnimationPlayerEditor::_notification(int p_what) { resource_edit_anim->set_icon( get_icon("EditResource","EditorIcons") ); pin->set_icon(get_icon("Pin","EditorIcons") ); tool_anim->set_icon(get_icon("Tools","EditorIcons")); - tool_anim->get_popup()->connect("item_pressed",this,"_animation_tool_menu"); + tool_anim->get_popup()->connect("id_pressed",this,"_animation_tool_menu"); blend_editor.next->connect("item_selected", this, "_blend_editor_next_changed"); @@ -375,12 +375,12 @@ void AnimationPlayerEditor::_animation_load() { void AnimationPlayerEditor::_animation_save_in_path(const Ref<Resource>& p_resource, const String& p_path) { int flg = 0; - if (EditorSettings::get_singleton()->get("on_save/compress_binary_resources")) + if (EditorSettings::get_singleton()->get("filesystem/on_save/compress_binary_resources")) flg |= ResourceSaver::FLAG_COMPRESS; - //if (EditorSettings::get_singleton()->get("on_save/save_paths_as_relative")) + //if (EditorSettings::get_singleton()->get("filesystem/on_save/save_paths_as_relative")) // flg |= ResourceSaver::FLAG_RELATIVE_PATHS; - String path = Globals::get_singleton()->localize_path(p_path); + String path = GlobalConfig::get_singleton()->localize_path(p_path); Error err = ResourceSaver::save(path, p_resource, flg | ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS); if (err != OK) { @@ -431,7 +431,7 @@ void AnimationPlayerEditor::_animation_save_as(const Ref<Resource>& p_resource) String existing; if (extensions.size()) { - existing = "new_" + p_resource->get_type().to_lower() + "." + extensions.front()->get().to_lower(); + existing = "new_" + p_resource->get_class().to_lower() + "." + extensions.front()->get().to_lower(); } file->set_current_path(existing); @@ -723,7 +723,7 @@ void AnimationPlayerEditor::_dialog_action(String p_file) { Ref<Resource> res = ResourceLoader::load(p_file, "Animation"); ERR_FAIL_COND(res.is_null()); - ERR_FAIL_COND(!res->is_type("Animation")); + ERR_FAIL_COND(!res->is_class("Animation")); if (p_file.find_last("/") != -1) { p_file = p_file.substr(p_file.find_last("/") + 1, p_file.length()); @@ -1108,7 +1108,7 @@ void AnimationPlayerEditor::_animation_key_editor_seek(float p_pos,bool p_drag) return; updating=true; - frame->set_val(p_pos); + frame->set_value(p_pos); updating=false; _seek_value_changed(p_pos,!p_drag); @@ -1245,42 +1245,42 @@ void AnimationPlayerEditor::_unhandled_key_input(const InputEvent& p_ev) { void AnimationPlayerEditor::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_input_event"),&AnimationPlayerEditor::_input_event); - ObjectTypeDB::bind_method(_MD("_node_removed"),&AnimationPlayerEditor::_node_removed); - ObjectTypeDB::bind_method(_MD("_play_pressed"),&AnimationPlayerEditor::_play_pressed); - ObjectTypeDB::bind_method(_MD("_play_from_pressed"),&AnimationPlayerEditor::_play_from_pressed); - ObjectTypeDB::bind_method(_MD("_play_bw_pressed"),&AnimationPlayerEditor::_play_bw_pressed); - ObjectTypeDB::bind_method(_MD("_play_bw_from_pressed"),&AnimationPlayerEditor::_play_bw_from_pressed); - ObjectTypeDB::bind_method(_MD("_stop_pressed"),&AnimationPlayerEditor::_stop_pressed); - ObjectTypeDB::bind_method(_MD("_autoplay_pressed"),&AnimationPlayerEditor::_autoplay_pressed); - ObjectTypeDB::bind_method(_MD("_pause_pressed"),&AnimationPlayerEditor::_pause_pressed); - ObjectTypeDB::bind_method(_MD("_animation_selected"),&AnimationPlayerEditor::_animation_selected); - ObjectTypeDB::bind_method(_MD("_animation_name_edited"),&AnimationPlayerEditor::_animation_name_edited); - ObjectTypeDB::bind_method(_MD("_animation_new"),&AnimationPlayerEditor::_animation_new); - ObjectTypeDB::bind_method(_MD("_animation_rename"),&AnimationPlayerEditor::_animation_rename); - ObjectTypeDB::bind_method(_MD("_animation_load"),&AnimationPlayerEditor::_animation_load); - ObjectTypeDB::bind_method(_MD("_animation_remove"),&AnimationPlayerEditor::_animation_remove); - ObjectTypeDB::bind_method(_MD("_animation_blend"),&AnimationPlayerEditor::_animation_blend); - ObjectTypeDB::bind_method(_MD("_animation_edit"),&AnimationPlayerEditor::_animation_edit); - ObjectTypeDB::bind_method(_MD("_animation_resource_edit"),&AnimationPlayerEditor::_animation_resource_edit); - ObjectTypeDB::bind_method(_MD("_dialog_action"),&AnimationPlayerEditor::_dialog_action); - ObjectTypeDB::bind_method(_MD("_seek_value_changed"),&AnimationPlayerEditor::_seek_value_changed,DEFVAL(true)); - ObjectTypeDB::bind_method(_MD("_animation_player_changed"),&AnimationPlayerEditor::_animation_player_changed); - ObjectTypeDB::bind_method(_MD("_blend_edited"),&AnimationPlayerEditor::_blend_edited); -// ObjectTypeDB::bind_method(_MD("_seek_frame_changed"),&AnimationPlayerEditor::_seek_frame_changed); - ObjectTypeDB::bind_method(_MD("_scale_changed"),&AnimationPlayerEditor::_scale_changed); - //ObjectTypeDB::bind_method(_MD("_editor_store_all"),&AnimationPlayerEditor::_editor_store_all); + ClassDB::bind_method(_MD("_gui_input"),&AnimationPlayerEditor::_gui_input); + ClassDB::bind_method(_MD("_node_removed"),&AnimationPlayerEditor::_node_removed); + ClassDB::bind_method(_MD("_play_pressed"),&AnimationPlayerEditor::_play_pressed); + ClassDB::bind_method(_MD("_play_from_pressed"),&AnimationPlayerEditor::_play_from_pressed); + ClassDB::bind_method(_MD("_play_bw_pressed"),&AnimationPlayerEditor::_play_bw_pressed); + ClassDB::bind_method(_MD("_play_bw_from_pressed"),&AnimationPlayerEditor::_play_bw_from_pressed); + ClassDB::bind_method(_MD("_stop_pressed"),&AnimationPlayerEditor::_stop_pressed); + ClassDB::bind_method(_MD("_autoplay_pressed"),&AnimationPlayerEditor::_autoplay_pressed); + ClassDB::bind_method(_MD("_pause_pressed"),&AnimationPlayerEditor::_pause_pressed); + ClassDB::bind_method(_MD("_animation_selected"),&AnimationPlayerEditor::_animation_selected); + ClassDB::bind_method(_MD("_animation_name_edited"),&AnimationPlayerEditor::_animation_name_edited); + ClassDB::bind_method(_MD("_animation_new"),&AnimationPlayerEditor::_animation_new); + ClassDB::bind_method(_MD("_animation_rename"),&AnimationPlayerEditor::_animation_rename); + ClassDB::bind_method(_MD("_animation_load"),&AnimationPlayerEditor::_animation_load); + ClassDB::bind_method(_MD("_animation_remove"),&AnimationPlayerEditor::_animation_remove); + ClassDB::bind_method(_MD("_animation_blend"),&AnimationPlayerEditor::_animation_blend); + ClassDB::bind_method(_MD("_animation_edit"),&AnimationPlayerEditor::_animation_edit); + ClassDB::bind_method(_MD("_animation_resource_edit"),&AnimationPlayerEditor::_animation_resource_edit); + ClassDB::bind_method(_MD("_dialog_action"),&AnimationPlayerEditor::_dialog_action); + ClassDB::bind_method(_MD("_seek_value_changed"),&AnimationPlayerEditor::_seek_value_changed,DEFVAL(true)); + ClassDB::bind_method(_MD("_animation_player_changed"),&AnimationPlayerEditor::_animation_player_changed); + ClassDB::bind_method(_MD("_blend_edited"),&AnimationPlayerEditor::_blend_edited); +// ClassDB::bind_method(_MD("_seek_frame_changed"),&AnimationPlayerEditor::_seek_frame_changed); + ClassDB::bind_method(_MD("_scale_changed"),&AnimationPlayerEditor::_scale_changed); + //ClassDB::bind_method(_MD("_editor_store_all"),&AnimationPlayerEditor::_editor_store_all); ///jectTypeDB::bind_method(_MD("_editor_load_all"),&AnimationPlayerEditor::_editor_load_all); - ObjectTypeDB::bind_method(_MD("_list_changed"),&AnimationPlayerEditor::_list_changed); - ObjectTypeDB::bind_method(_MD("_animation_key_editor_seek"),&AnimationPlayerEditor::_animation_key_editor_seek); - ObjectTypeDB::bind_method(_MD("_animation_key_editor_anim_len_changed"),&AnimationPlayerEditor::_animation_key_editor_anim_len_changed); - ObjectTypeDB::bind_method(_MD("_animation_key_editor_anim_step_changed"),&AnimationPlayerEditor::_animation_key_editor_anim_step_changed); - ObjectTypeDB::bind_method(_MD("_hide_anim_editors"),&AnimationPlayerEditor::_hide_anim_editors); - ObjectTypeDB::bind_method(_MD("_animation_duplicate"),&AnimationPlayerEditor::_animation_duplicate); - ObjectTypeDB::bind_method(_MD("_blend_editor_next_changed"),&AnimationPlayerEditor::_blend_editor_next_changed); - ObjectTypeDB::bind_method(_MD("_unhandled_key_input"),&AnimationPlayerEditor::_unhandled_key_input); - ObjectTypeDB::bind_method(_MD("_animation_tool_menu"),&AnimationPlayerEditor::_animation_tool_menu); - ObjectTypeDB::bind_method(_MD("_animation_save_menu"), &AnimationPlayerEditor::_animation_save_menu); + ClassDB::bind_method(_MD("_list_changed"),&AnimationPlayerEditor::_list_changed); + ClassDB::bind_method(_MD("_animation_key_editor_seek"),&AnimationPlayerEditor::_animation_key_editor_seek); + ClassDB::bind_method(_MD("_animation_key_editor_anim_len_changed"),&AnimationPlayerEditor::_animation_key_editor_anim_len_changed); + ClassDB::bind_method(_MD("_animation_key_editor_anim_step_changed"),&AnimationPlayerEditor::_animation_key_editor_anim_step_changed); + ClassDB::bind_method(_MD("_hide_anim_editors"),&AnimationPlayerEditor::_hide_anim_editors); + ClassDB::bind_method(_MD("_animation_duplicate"),&AnimationPlayerEditor::_animation_duplicate); + ClassDB::bind_method(_MD("_blend_editor_next_changed"),&AnimationPlayerEditor::_blend_editor_next_changed); + ClassDB::bind_method(_MD("_unhandled_key_input"),&AnimationPlayerEditor::_unhandled_key_input); + ClassDB::bind_method(_MD("_animation_tool_menu"),&AnimationPlayerEditor::_animation_tool_menu); + ClassDB::bind_method(_MD("_animation_save_menu"), &AnimationPlayerEditor::_animation_save_menu); @@ -1477,7 +1477,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor) { blend_editor.dialog->set_hide_on_ok(true); VBoxContainer *blend_vb = memnew( VBoxContainer); blend_editor.dialog->add_child(blend_vb); - blend_editor.dialog->set_child_rect(blend_vb); + //blend_editor.dialog->set_child_rect(blend_vb); blend_editor.tree = memnew( Tree ); blend_editor.tree->set_columns(2); blend_vb->add_margin_child(TTR("Blend Times:"),blend_editor.tree,true); @@ -1542,7 +1542,7 @@ void AnimationPlayerEditorPlugin::edit(Object *p_object) { bool AnimationPlayerEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("AnimationPlayer"); + return p_object->is_class("AnimationPlayer"); } void AnimationPlayerEditorPlugin::make_visible(bool p_visible) { diff --git a/tools/editor/plugins/animation_player_editor_plugin.h b/tools/editor/plugins/animation_player_editor_plugin.h index b0c930b66e..9074eb127b 100644 --- a/tools/editor/plugins/animation_player_editor_plugin.h +++ b/tools/editor/plugins/animation_player_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -44,7 +44,7 @@ class AnimationKeyEditor; class AnimationPlayerEditor : public VBoxContainer { - OBJ_TYPE(AnimationPlayerEditor, VBoxContainer ); + GDCLASS(AnimationPlayerEditor, VBoxContainer ); EditorNode *editor; AnimationPlayer *player; @@ -171,7 +171,7 @@ class AnimationPlayerEditor : public VBoxContainer { protected: void _notification(int p_what); - void _input_event(InputEvent p_event); + void _gui_input(InputEvent p_event); void _node_removed(Node *p_node); static void _bind_methods(); public: @@ -193,7 +193,7 @@ public: class AnimationPlayerEditorPlugin : public EditorPlugin { - OBJ_TYPE( AnimationPlayerEditorPlugin, EditorPlugin ); + GDCLASS( AnimationPlayerEditorPlugin, EditorPlugin ); AnimationPlayerEditor *anim_editor; EditorNode *editor; diff --git a/tools/editor/plugins/animation_tree_editor_plugin.cpp b/tools/editor/plugins/animation_tree_editor_plugin.cpp index 24914e4bc5..3b28e8610b 100644 --- a/tools/editor/plugins/animation_tree_editor_plugin.cpp +++ b/tools/editor/plugins/animation_tree_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -183,20 +183,20 @@ void AnimationTreeEditor::_edit_dialog_changed() { case AnimationTreePlayer::NODE_MIX: - anim_tree->mix_node_set_amount(edited_node,edit_scroll[0]->get_val()); + anim_tree->mix_node_set_amount(edited_node,edit_scroll[0]->get_value()); break; case AnimationTreePlayer::NODE_BLEND2: - anim_tree->blend2_node_set_amount(edited_node,edit_scroll[0]->get_val()); + anim_tree->blend2_node_set_amount(edited_node,edit_scroll[0]->get_value()); break; case AnimationTreePlayer::NODE_BLEND3: - anim_tree->blend3_node_set_amount(edited_node,edit_scroll[0]->get_val()); + anim_tree->blend3_node_set_amount(edited_node,edit_scroll[0]->get_value()); break; case AnimationTreePlayer::NODE_BLEND4: - anim_tree->blend4_node_set_amount(edited_node,Point2(edit_scroll[0]->get_val(),edit_scroll[1]->get_val())); + anim_tree->blend4_node_set_amount(edited_node,Point2(edit_scroll[0]->get_value(),edit_scroll[1]->get_value())); break; @@ -265,7 +265,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { filter_button->hide(); edit_check->hide();; - Point2 pos = anim_tree->node_get_pos(edited_node)-Point2(h_scroll->get_val(),v_scroll->get_val()); + Point2 pos = anim_tree->node_get_pos(edited_node)-Point2(h_scroll->get_value(),v_scroll->get_value()); Ref<StyleBox> style = get_stylebox("panel","PopupMenu"); Size2 size = get_node_size(edited_node); Point2 popup_pos( pos.x+style->get_margin(MARGIN_LEFT), pos.y+size.y-style->get_margin(MARGIN_BOTTOM)); @@ -380,7 +380,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { edit_label[0]->show(); edit_scroll[0]->set_min(0); edit_scroll[0]->set_max(1); - edit_scroll[0]->set_val(anim_tree->mix_node_get_amount(edited_node)); + edit_scroll[0]->set_value(anim_tree->mix_node_get_amount(edited_node)); edit_scroll[0]->set_begin(Point2(15,25)); edit_scroll[0]->show(); edit_dialog->set_size(Size2(150,50)); @@ -392,7 +392,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { edit_label[0]->show(); edit_scroll[0]->set_min(0); edit_scroll[0]->set_max(1); - edit_scroll[0]->set_val(anim_tree->blend2_node_get_amount(edited_node)); + edit_scroll[0]->set_value(anim_tree->blend2_node_get_amount(edited_node)); edit_scroll[0]->set_begin(Point2(15,25)); edit_scroll[0]->show(); filter_button->set_begin(Point2(10,47)); @@ -407,7 +407,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { edit_label[0]->show(); edit_scroll[0]->set_min(-1); edit_scroll[0]->set_max(1); - edit_scroll[0]->set_val(anim_tree->blend3_node_get_amount(edited_node)); + edit_scroll[0]->set_value(anim_tree->blend3_node_get_amount(edited_node)); edit_scroll[0]->set_begin(Point2(15,25)); edit_scroll[0]->show(); edit_dialog->set_size(Size2(150,50)); @@ -420,7 +420,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { edit_label[0]->show(); edit_scroll[0]->set_min(0); edit_scroll[0]->set_max(1); - edit_scroll[0]->set_val(anim_tree->blend4_node_get_amount(edited_node).x); + edit_scroll[0]->set_value(anim_tree->blend4_node_get_amount(edited_node).x); edit_scroll[0]->set_begin(Point2(15,25)); edit_scroll[0]->show(); edit_label[1]->set_text(TTR("Blend 1:")); @@ -428,7 +428,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { edit_label[1]->show(); edit_scroll[1]->set_min(0); edit_scroll[1]->set_max(1); - edit_scroll[1]->set_val(anim_tree->blend4_node_get_amount(edited_node).y); + edit_scroll[1]->set_value(anim_tree->blend4_node_get_amount(edited_node).y); edit_scroll[1]->set_begin(Point2(15,75)); edit_scroll[1]->show(); edit_dialog->set_size(Size2(150,100)); @@ -500,7 +500,7 @@ void AnimationTreeEditor::_draw_node(const StringName& p_node) { } - pos-=Point2(h_scroll->get_val(),v_scroll->get_val()); + pos-=Point2(h_scroll->get_value(),v_scroll->get_value()); style->draw(ci,Rect2(pos,size)); @@ -644,7 +644,7 @@ AnimationTreeEditor::ClickType AnimationTreeEditor::_locate_click(const Point2& Point2 pos = anim_tree->node_get_pos(node); Size2 size = get_node_size(node); - pos-=Point2(h_scroll->get_val(),v_scroll->get_val()); + pos-=Point2(h_scroll->get_value(),v_scroll->get_value()); if (!Rect2(pos,size).has_point(p_click)) continue; @@ -709,7 +709,7 @@ Point2 AnimationTreeEditor::_get_slot_pos(const StringName& p_node,bool p_input, } - pos-=Point2(h_scroll->get_val(),v_scroll->get_val()); + pos-=Point2(h_scroll->get_value(),v_scroll->get_value()); float w = size.width-style->get_minimum_size().width; @@ -759,7 +759,7 @@ void AnimationTreeEditor::_node_edit_property(const StringName& p_node) { } #endif -void AnimationTreeEditor::_input_event(InputEvent p_event) { +void AnimationTreeEditor::_gui_input(InputEvent p_event) { switch(p_event.type) { @@ -892,8 +892,8 @@ void AnimationTreeEditor::_input_event(InputEvent p_event) { } if ((p_event.mouse_motion.button_mask&4 || Input::get_singleton()->is_key_pressed(KEY_SPACE))) { - h_scroll->set_val( h_scroll->get_val() - p_event.mouse_motion.relative_x ); - v_scroll->set_val( v_scroll->get_val() - p_event.mouse_motion.relative_y ); + h_scroll->set_value( h_scroll->get_value() - p_event.mouse_motion.relative_x ); + v_scroll->set_value( v_scroll->get_value() - p_event.mouse_motion.relative_y ); update(); } @@ -947,7 +947,6 @@ void AnimationTreeEditor::_notification(int p_what) { _update_scrollbars(); //VisualServer::get_singleton()->canvas_item_add_rect(get_canvas_item(),Rect2(Point2(),get_size()),Color(0,0,0,1)); get_stylebox("bg","Tree")->draw(get_canvas_item(),Rect2(Point2(),get_size())); - VisualServer::get_singleton()->canvas_item_set_clip(get_canvas_item(),true); for(List<StringName>::Element *E=order.front();E;E=E->next()) { @@ -1026,7 +1025,7 @@ void AnimationTreeEditor::_update_scrollbars() { v_scroll->show(); v_scroll->set_max(min.height); v_scroll->set_page(size.height - hmin.height); - offset.y=v_scroll->get_val(); + offset.y=v_scroll->get_value(); } if (min.width < size.width - vmin.width) { @@ -1038,14 +1037,14 @@ void AnimationTreeEditor::_update_scrollbars() { h_scroll->show(); h_scroll->set_max(min.width); h_scroll->set_page(size.width - vmin.width); - offset.x=h_scroll->get_val(); + offset.x=h_scroll->get_value(); } } void AnimationTreeEditor::_scroll_moved(float) { - offset.x=h_scroll->get_val(); - offset.y=v_scroll->get_val(); + offset.x=h_scroll->get_value(); + offset.y=v_scroll->get_value(); update(); } @@ -1323,23 +1322,23 @@ void AnimationTreeEditor::_edit_filters() { void AnimationTreeEditor::_bind_methods() { - ObjectTypeDB::bind_method( "_add_menu_item", &AnimationTreeEditor::_add_menu_item ); - ObjectTypeDB::bind_method( "_node_menu_item", &AnimationTreeEditor::_node_menu_item ); - ObjectTypeDB::bind_method( "_input_event", &AnimationTreeEditor::_input_event ); -// ObjectTypeDB::bind_method( "_node_param_changed", &AnimationTreeEditor::_node_param_changed ); - ObjectTypeDB::bind_method( "_scroll_moved", &AnimationTreeEditor::_scroll_moved ); - ObjectTypeDB::bind_method( "_edit_dialog_changeds", &AnimationTreeEditor::_edit_dialog_changeds ); - ObjectTypeDB::bind_method( "_edit_dialog_changede", &AnimationTreeEditor::_edit_dialog_changede ); - ObjectTypeDB::bind_method( "_edit_dialog_changedf", &AnimationTreeEditor::_edit_dialog_changedf ); - ObjectTypeDB::bind_method( "_edit_dialog_changed", &AnimationTreeEditor::_edit_dialog_changed ); - ObjectTypeDB::bind_method( "_edit_dialog_animation_changed", &AnimationTreeEditor::_edit_dialog_animation_changed ); - ObjectTypeDB::bind_method( "_edit_dialog_edit_animation", &AnimationTreeEditor::_edit_dialog_edit_animation ); - ObjectTypeDB::bind_method( "_play_toggled", &AnimationTreeEditor::_play_toggled ); - ObjectTypeDB::bind_method( "_edit_oneshot_start", &AnimationTreeEditor::_edit_oneshot_start ); - ObjectTypeDB::bind_method( "_file_dialog_selected", &AnimationTreeEditor::_file_dialog_selected); - ObjectTypeDB::bind_method( "_master_anim_menu_item", &AnimationTreeEditor::_master_anim_menu_item); - ObjectTypeDB::bind_method( "_edit_filters", &AnimationTreeEditor::_edit_filters); - ObjectTypeDB::bind_method( "_filter_edited", &AnimationTreeEditor::_filter_edited); + ClassDB::bind_method( "_add_menu_item", &AnimationTreeEditor::_add_menu_item ); + ClassDB::bind_method( "_node_menu_item", &AnimationTreeEditor::_node_menu_item ); + ClassDB::bind_method( "_gui_input", &AnimationTreeEditor::_gui_input ); +// ClassDB::bind_method( "_node_param_changed", &AnimationTreeEditor::_node_param_changed ); + ClassDB::bind_method( "_scroll_moved", &AnimationTreeEditor::_scroll_moved ); + ClassDB::bind_method( "_edit_dialog_changeds", &AnimationTreeEditor::_edit_dialog_changeds ); + ClassDB::bind_method( "_edit_dialog_changede", &AnimationTreeEditor::_edit_dialog_changede ); + ClassDB::bind_method( "_edit_dialog_changedf", &AnimationTreeEditor::_edit_dialog_changedf ); + ClassDB::bind_method( "_edit_dialog_changed", &AnimationTreeEditor::_edit_dialog_changed ); + ClassDB::bind_method( "_edit_dialog_animation_changed", &AnimationTreeEditor::_edit_dialog_animation_changed ); + ClassDB::bind_method( "_edit_dialog_edit_animation", &AnimationTreeEditor::_edit_dialog_edit_animation ); + ClassDB::bind_method( "_play_toggled", &AnimationTreeEditor::_play_toggled ); + ClassDB::bind_method( "_edit_oneshot_start", &AnimationTreeEditor::_edit_oneshot_start ); + ClassDB::bind_method( "_file_dialog_selected", &AnimationTreeEditor::_file_dialog_selected); + ClassDB::bind_method( "_master_anim_menu_item", &AnimationTreeEditor::_master_anim_menu_item); + ClassDB::bind_method( "_edit_filters", &AnimationTreeEditor::_edit_filters); + ClassDB::bind_method( "_filter_edited", &AnimationTreeEditor::_filter_edited); } @@ -1371,7 +1370,7 @@ AnimationTreeEditor::AnimationTreeEditor() { p->add_separator(); p->add_item(TTR("Clear"),MENU_GRAPH_CLEAR); - p->connect("item_pressed", this,"_add_menu_item"); + p->connect("id_pressed", this,"_add_menu_item"); play_button = memnew(Button); play_button->set_pos(Point2(25,0)); @@ -1407,10 +1406,10 @@ AnimationTreeEditor::AnimationTreeEditor() { master_anim_popup = memnew( PopupMenu ); add_child(master_anim_popup); - master_anim_popup->connect("item_pressed",this,"_master_anim_menu_item"); + master_anim_popup->connect("id_pressed",this,"_master_anim_menu_item"); - node_popup->connect("item_pressed", this,"_node_menu_item"); + node_popup->connect("id_pressed", this,"_node_menu_item"); updating_edit=false; @@ -1464,7 +1463,7 @@ AnimationTreeEditor::AnimationTreeEditor() { file_dialog = memnew( EditorFileDialog ); file_dialog->set_enable_multiple_selection(true); - file_dialog->set_current_dir(Globals::get_singleton()->get_resource_path()); + file_dialog->set_current_dir(GlobalConfig::get_singleton()->get_resource_path()); add_child(file_dialog); file_dialog->connect("file_selected", this, "_file_dialog_selected"); @@ -1474,7 +1473,7 @@ AnimationTreeEditor::AnimationTreeEditor() { filter = memnew( Tree ); filter_dialog->add_child(filter); - filter_dialog->set_child_rect(filter); + //filter_dialog->set_child_rect(filter); filter->connect("item_edited",this,"_filter_edited"); filter_button = memnew( Button ); @@ -1485,6 +1484,7 @@ AnimationTreeEditor::AnimationTreeEditor() { filter_button->set_text(TTR("Filters..")); filter_button->connect("pressed", this,"_edit_filters"); + set_clip_contents(true); } @@ -1496,7 +1496,7 @@ void AnimationTreeEditorPlugin::edit(Object *p_object) { bool AnimationTreeEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("AnimationTreePlayer"); + return p_object->is_class("AnimationTreePlayer"); } void AnimationTreeEditorPlugin::make_visible(bool p_visible) { diff --git a/tools/editor/plugins/animation_tree_editor_plugin.h b/tools/editor/plugins/animation_tree_editor_plugin.h index 4884a22d90..253ad1878d 100644 --- a/tools/editor/plugins/animation_tree_editor_plugin.h +++ b/tools/editor/plugins/animation_tree_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -42,7 +42,7 @@ class AnimationTreeEditor : public Control { - OBJ_TYPE(AnimationTreeEditor, Control ); + GDCLASS(AnimationTreeEditor, Control ); static const char* _node_type_names[]; @@ -160,7 +160,7 @@ class AnimationTreeEditor : public Control { protected: void _notification(int p_what); - void _input_event(InputEvent p_event); + void _gui_input(InputEvent p_event); static void _bind_methods(); public: @@ -172,7 +172,7 @@ public: class AnimationTreeEditorPlugin : public EditorPlugin { - OBJ_TYPE( AnimationTreeEditorPlugin, EditorPlugin ); + GDCLASS( AnimationTreeEditorPlugin, EditorPlugin ); AnimationTreeEditor *anim_tree_editor; EditorNode *editor; diff --git a/tools/editor/plugins/baked_light_baker.cpp b/tools/editor/plugins/baked_light_baker.cpp index f43bec1cd3..2d91524ef9 100644 --- a/tools/editor/plugins/baked_light_baker.cpp +++ b/tools/editor/plugins/baked_light_baker.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ #include "tools/editor/editor_node.h" #include "tools/editor/editor_settings.h" - +#if 0 void baked_light_baker_add_64f(double *dst,double value); void baked_light_baker_add_64i(int64_t *dst,int64_t value); @@ -91,15 +91,15 @@ BakedLightBaker::MeshTexture* BakedLightBaker::_get_mat_tex(const Ref<Texture>& if (image.empty()) return NULL; - if (image.get_format()!=Image::FORMAT_RGBA) { + if (image.get_format()!=Image::FORMAT_RGBA8) { if (image.get_format()>Image::FORMAT_INDEXED_ALPHA) { Error err = image.decompress(); if (err) return NULL; } - if (image.get_format()!=Image::FORMAT_RGBA) - image.convert(Image::FORMAT_RGBA); + if (image.get_format()!=Image::FORMAT_RGBA8) + image.convert(Image::FORMAT_RGBA8); } if (imgtex->get_flags()&Texture::FLAG_CONVERT_TO_LINEAR) { @@ -108,8 +108,8 @@ BakedLightBaker::MeshTexture* BakedLightBaker::_get_mat_tex(const Ref<Texture>& image=copy; } - DVector<uint8_t> dvt=image.get_data(); - DVector<uint8_t>::Read r=dvt.read(); + PoolVector<uint8_t> dvt=image.get_data(); + PoolVector<uint8_t>::Read r=dvt.read(); MeshTexture mt; mt.tex_w=image.get_width(); mt.tex_h=image.get_height(); @@ -143,18 +143,18 @@ void BakedLightBaker::_add_mesh(const Ref<Mesh>& p_mesh,const Ref<Material>& p_m MeshMaterial mm; - Ref<FixedMaterial> fm = mat; + Ref<FixedSpatialMaterial> fm = mat; if (fm.is_valid()) { //fixed route - mm.diffuse.color=fm->get_parameter(FixedMaterial::PARAM_DIFFUSE); + mm.diffuse.color=fm->get_parameter(FixedSpatialMaterial::PARAM_DIFFUSE); if (linear_color) mm.diffuse.color=mm.diffuse.color.to_linear(); - mm.diffuse.tex=_get_mat_tex(fm->get_texture(FixedMaterial::PARAM_DIFFUSE)); - mm.specular.color=fm->get_parameter(FixedMaterial::PARAM_SPECULAR); + mm.diffuse.tex=_get_mat_tex(fm->get_texture(FixedSpatialMaterial::PARAM_DIFFUSE)); + mm.specular.color=fm->get_parameter(FixedSpatialMaterial::PARAM_SPECULAR); if (linear_color) mm.specular.color=mm.specular.color.to_linear(); - mm.specular.tex=_get_mat_tex(fm->get_texture(FixedMaterial::PARAM_SPECULAR)); + mm.specular.tex=_get_mat_tex(fm->get_texture(FixedSpatialMaterial::PARAM_SPECULAR)); } else { mm.diffuse.color=Color(1,1,1,1); @@ -194,14 +194,14 @@ void BakedLightBaker::_add_mesh(const Ref<Mesh>& p_mesh,const Ref<Material>& p_m Array a = p_mesh->surface_get_arrays(i); - DVector<Vector3> vertices = a[Mesh::ARRAY_VERTEX]; - DVector<Vector3>::Read vr=vertices.read(); - DVector<Vector2> uv; - DVector<Vector2>::Read uvr; - DVector<Vector2> uv2; - DVector<Vector2>::Read uv2r; - DVector<Vector3> normal; - DVector<Vector3>::Read normalr; + PoolVector<Vector3> vertices = a[Mesh::ARRAY_VERTEX]; + PoolVector<Vector3>::Read vr=vertices.read(); + PoolVector<Vector2> uv; + PoolVector<Vector2>::Read uvr; + PoolVector<Vector2> uv2; + PoolVector<Vector2>::Read uv2r; + PoolVector<Vector3> normal; + PoolVector<Vector3>::Read normalr; bool read_uv=false; bool read_normal=false; @@ -236,8 +236,8 @@ void BakedLightBaker::_add_mesh(const Ref<Mesh>& p_mesh,const Ref<Material>& p_m if (p_mesh->surface_get_format(i)&Mesh::ARRAY_FORMAT_INDEX) { - DVector<int> indices = a[Mesh::ARRAY_INDEX]; - DVector<int>::Read ir = indices.read(); + PoolVector<int> indices = a[Mesh::ARRAY_INDEX]; + PoolVector<int>::Read ir = indices.read(); for(int i=0;i<facecount;i++) { Triangle &t=triangles[tbase+i]; @@ -1788,7 +1788,7 @@ void BakedLightBaker::bake(const Ref<BakedLight> &p_light, Node* p_node) { } -void BakedLightBaker::update_octree_sampler(DVector<int> &p_sampler) { +void BakedLightBaker::update_octree_sampler(PoolVector<int> &p_sampler) { BakedLightBaker::Octant *octants=octant_pool.ptr(); double norm = 1.0/double(total_rays); @@ -1845,7 +1845,7 @@ void BakedLightBaker::update_octree_sampler(DVector<int> &p_sampler) { } p_sampler.resize(tmp_smp.size()); - DVector<int>::Write w = p_sampler.write(); + PoolVector<int>::Write w = p_sampler.write(); int ss = tmp_smp.size(); for(int i=0;i<ss;i++) { w[i]=tmp_smp[i]; @@ -1859,7 +1859,7 @@ void BakedLightBaker::update_octree_sampler(DVector<int> &p_sampler) { double mult = baked_light->get_energy_multiplier(); float saturation = baked_light->get_saturation(); - DVector<int>::Write w = p_sampler.write(); + PoolVector<int>::Write w = p_sampler.write(); encode_uint32(octree_depth,(uint8_t*)&w[2]); encode_uint32(linear_color,(uint8_t*)&w[3]); @@ -1900,7 +1900,7 @@ void BakedLightBaker::update_octree_sampler(DVector<int> &p_sampler) { } -void BakedLightBaker::update_octree_images(DVector<uint8_t> &p_octree,DVector<uint8_t> &p_light) { +void BakedLightBaker::update_octree_images(PoolVector<uint8_t> &p_octree,PoolVector<uint8_t> &p_light) { int len = baked_octree_texture_w*baked_octree_texture_h*4; @@ -1910,10 +1910,10 @@ void BakedLightBaker::update_octree_images(DVector<uint8_t> &p_octree,DVector<ui p_light.resize(ilen); - DVector<uint8_t>::Write w = p_octree.write(); + PoolVector<uint8_t>::Write w = p_octree.write(); zeromem(w.ptr(),len); - DVector<uint8_t>::Write iw = p_light.write(); + PoolVector<uint8_t>::Write iw = p_light.write(); zeromem(iw.ptr(),ilen); float gamma = baked_light->get_gamma_adjust(); @@ -2612,14 +2612,14 @@ Error BakedLightBaker::transfer_to_lightmaps() { } } - DVector<uint8_t> dv; + PoolVector<uint8_t> dv; dv.resize(baked_textures[i].data.size()); { - DVector<uint8_t>::Write w = dv.write(); + PoolVector<uint8_t>::Write w = dv.write(); copymem(w.ptr(),baked_textures[i].data.ptr(),baked_textures[i].data.size()); } - Image img(baked_textures[i].width,baked_textures[i].height,0,Image::FORMAT_RGBA,dv); + Image img(baked_textures[i].width,baked_textures[i].height,0,Image::FORMAT_RGBA8,dv); Ref<ImageTexture> tex = memnew( ImageTexture ); tex->create_from_image(img); baked_light->set_lightmap_texture(i,tex); @@ -2720,3 +2720,4 @@ BakedLightBaker::~BakedLightBaker() { clear(); } +#endif diff --git a/tools/editor/plugins/baked_light_baker.h b/tools/editor/plugins/baked_light_baker.h index d0fddf5563..6fcf78dd0a 100644 --- a/tools/editor/plugins/baked_light_baker.h +++ b/tools/editor/plugins/baked_light_baker.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -34,6 +34,8 @@ #include "scene/3d/mesh_instance.h" #include "os/thread.h" +#if 0 + class BakedLightBaker { public: @@ -362,8 +364,8 @@ public: Error transfer_to_lightmaps(); - void update_octree_sampler(DVector<int> &p_sampler); - void update_octree_images(DVector<uint8_t> &p_octree,DVector<uint8_t> &p_light); + void update_octree_sampler(PoolVector<int> &p_sampler); + void update_octree_images(PoolVector<uint8_t> &p_octree,PoolVector<uint8_t> &p_light); Ref<BakedLight> get_baked_light() { return baked_light; } @@ -375,3 +377,4 @@ public: }; #endif // BAKED_LIGHT_BAKER_H +#endif diff --git a/tools/editor/plugins/baked_light_baker_cmpxchg.cpp b/tools/editor/plugins/baked_light_baker_cmpxchg.cpp index c581995916..5e9228b7de 100644 --- a/tools/editor/plugins/baked_light_baker_cmpxchg.cpp +++ b/tools/editor/plugins/baked_light_baker_cmpxchg.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/plugins/baked_light_editor_plugin.cpp b/tools/editor/plugins/baked_light_editor_plugin.cpp index a58a0c25e2..8f564a3247 100644 --- a/tools/editor/plugins/baked_light_editor_plugin.cpp +++ b/tools/editor/plugins/baked_light_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,7 +33,7 @@ #include "io/resource_saver.h" - +#if 0 void BakedLightEditor::_end_baking() { @@ -88,7 +88,7 @@ void BakedLightEditor::_notification(int p_option) { float max_lum=0; { - DVector<Color>::Write cw=colors.write(); + PoolVector<Color>::Write cw=colors.write(); BakedLightBaker::Octant *octants=baker->octant_pool.ptr(); BakedLightBaker::Octant *oct = &octants[baker->leaf_list]; int vert_idx=0; @@ -145,7 +145,7 @@ void BakedLightEditor::_notification(int p_option) { #if 1 //debug - Image img(baker->baked_octree_texture_w,baker->baked_octree_texture_h,0,Image::FORMAT_RGBA,octree_texture); + Image img(baker->baked_octree_texture_w,baker->baked_octree_texture_h,0,Image::FORMAT_RGBA8,octree_texture); Ref<ImageTexture> it = memnew( ImageTexture ); it->create_from_image(img); ResourceSaver::save("baked_octree.png",it); @@ -283,10 +283,10 @@ void BakedLightEditor::_bake_lightmaps() { void BakedLightEditor::_bind_methods() { - ObjectTypeDB::bind_method("_menu_option",&BakedLightEditor::_menu_option); - ObjectTypeDB::bind_method("_bake_pressed",&BakedLightEditor::_bake_pressed); - ObjectTypeDB::bind_method("_clear_pressed",&BakedLightEditor::_clear_pressed); - ObjectTypeDB::bind_method("_bake_lightmaps",&BakedLightEditor::_bake_lightmaps); + ClassDB::bind_method("_menu_option",&BakedLightEditor::_menu_option); + ClassDB::bind_method("_bake_pressed",&BakedLightEditor::_bake_pressed); + ClassDB::bind_method("_clear_pressed",&BakedLightEditor::_clear_pressed); + ClassDB::bind_method("_bake_lightmaps",&BakedLightEditor::_bake_lightmaps); } BakedLightEditor::BakedLightEditor() { @@ -373,3 +373,4 @@ BakedLightEditorPlugin::~BakedLightEditorPlugin() } +#endif diff --git a/tools/editor/plugins/baked_light_editor_plugin.h b/tools/editor/plugins/baked_light_editor_plugin.h index 4985d7513e..e311fe9f17 100644 --- a/tools/editor/plugins/baked_light_editor_plugin.h +++ b/tools/editor/plugins/baked_light_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -40,19 +40,19 @@ @author Juan Linietsky <reduzio@gmail.com> */ - +#if 0 class MeshInstance; class BakedLightEditor : public Control { - OBJ_TYPE(BakedLightEditor, Control ); + GDCLASS(BakedLightEditor, Control ); float update_timeout; - DVector<uint8_t> octree_texture; - DVector<uint8_t> light_texture; - DVector<int> octree_sampler; + PoolVector<uint8_t> octree_texture; + PoolVector<uint8_t> light_texture; + PoolVector<int> octree_sampler; BakedLightBaker *baker; AcceptDialog *err_dialog; @@ -97,7 +97,7 @@ public: class BakedLightEditorPlugin : public EditorPlugin { - OBJ_TYPE( BakedLightEditorPlugin, EditorPlugin ); + GDCLASS( BakedLightEditorPlugin, EditorPlugin ); BakedLightEditor *baked_light_editor; EditorNode *editor; @@ -116,5 +116,5 @@ public: }; #endif // MULTIMESH_EDITOR_PLUGIN_H - +#endif diff --git a/tools/editor/plugins/camera_editor_plugin.cpp b/tools/editor/plugins/camera_editor_plugin.cpp index 9c25de695c..67f776ba0b 100644 --- a/tools/editor/plugins/camera_editor_plugin.cpp +++ b/tools/editor/plugins/camera_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -61,7 +61,7 @@ void CameraEditor::_pressed() { void CameraEditor::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_pressed"),&CameraEditor::_pressed); + ClassDB::bind_method(_MD("_pressed"),&CameraEditor::_pressed); } @@ -108,7 +108,7 @@ void CameraEditorPlugin::edit(Object *p_object) { bool CameraEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("Camera"); + return p_object->is_class("Camera"); } void CameraEditorPlugin::make_visible(bool p_visible) { diff --git a/tools/editor/plugins/camera_editor_plugin.h b/tools/editor/plugins/camera_editor_plugin.h index ea016ecb4d..56702f174b 100644 --- a/tools/editor/plugins/camera_editor_plugin.h +++ b/tools/editor/plugins/camera_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,7 +39,7 @@ class CameraEditor : public Control { - OBJ_TYPE(CameraEditor, Control ); + GDCLASS(CameraEditor, Control ); Panel *panel; Button * preview; @@ -58,7 +58,7 @@ public: class CameraEditorPlugin : public EditorPlugin { - OBJ_TYPE( CameraEditorPlugin, EditorPlugin ); + GDCLASS( CameraEditorPlugin, EditorPlugin ); // CameraEditor *camera_editor; EditorNode *editor; diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp index af9fd69ae7..5fce9f8f53 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.cpp +++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -55,7 +55,7 @@ class SnapDialog : public ConfirmationDialog { - OBJ_TYPE(SnapDialog,ConfirmationDialog); + GDCLASS(SnapDialog,ConfirmationDialog); friend class CanvasItemEditor; @@ -79,7 +79,7 @@ public: container = memnew( VBoxContainer ); add_child(container); - set_child_rect(container); + // set_child_rect(container); child_container = memnew( GridContainer ); child_container->set_columns(3); @@ -149,21 +149,21 @@ public: } void set_fields(const Point2 p_grid_offset, const Size2 p_grid_step, const float p_rotation_offset, const float p_rotation_step) { - grid_offset_x->set_val(p_grid_offset.x); - grid_offset_y->set_val(p_grid_offset.y); - grid_step_x->set_val(p_grid_step.x); - grid_step_y->set_val(p_grid_step.y); - rotation_offset->set_val(p_rotation_offset * (180 / Math_PI)); - rotation_step->set_val(p_rotation_step * (180 / Math_PI)); + grid_offset_x->set_value(p_grid_offset.x); + grid_offset_y->set_value(p_grid_offset.y); + grid_step_x->set_value(p_grid_step.x); + grid_step_y->set_value(p_grid_step.y); + rotation_offset->set_value(p_rotation_offset * (180 / Math_PI)); + rotation_step->set_value(p_rotation_step * (180 / Math_PI)); } void get_fields(Point2 &p_grid_offset, Size2 &p_grid_step, float &p_rotation_offset, float &p_rotation_step) { - p_grid_offset.x = grid_offset_x->get_val(); - p_grid_offset.y = grid_offset_y->get_val(); - p_grid_step.x = grid_step_x->get_val(); - p_grid_step.y = grid_step_y->get_val(); - p_rotation_offset = rotation_offset->get_val() / (180 / Math_PI); - p_rotation_step = rotation_step->get_val() / (180 / Math_PI); + p_grid_offset.x = grid_offset_x->get_value(); + p_grid_offset.y = grid_offset_y->get_value(); + p_grid_step.x = grid_step_x->get_value(); + p_grid_step.y = grid_step_y->get_value(); + p_rotation_offset = rotation_offset->get_value() / (180 / Math_PI); + p_rotation_step = rotation_step->get_value() / (180 / Math_PI); } }; @@ -179,7 +179,7 @@ void CanvasItemEditor::_edit_set_pivot(const Vector2& mouse_pos) { if (n2d && n2d->edit_has_pivot()) { Vector2 offset = n2d->edit_get_pivot(); - Vector2 gpos = n2d->get_global_pos(); + Vector2 gpos = n2d->get_global_position(); Vector2 local_mouse_pos = n2d->get_canvas_transform().affine_inverse().xform(mouse_pos); @@ -194,8 +194,8 @@ void CanvasItemEditor::_edit_set_pivot(const Vector2& mouse_pos) { if (!n2dc) continue; - undo_redo->add_do_method(n2dc,"set_global_pos",n2dc->get_global_pos()); - undo_redo->add_undo_method(n2dc,"set_global_pos",n2dc->get_global_pos()); + undo_redo->add_do_method(n2dc,"set_global_pos",n2dc->get_global_position()); + undo_redo->add_undo_method(n2dc,"set_global_pos",n2dc->get_global_position()); } @@ -286,7 +286,7 @@ Dictionary CanvasItemEditor::get_state() const { Dictionary state; state["zoom"]=zoom; - state["ofs"]=Point2(h_scroll->get_val(),v_scroll->get_val()); + state["ofs"]=Point2(h_scroll->get_value(),v_scroll->get_value()); // state["ofs"]=-transform.get_origin(); state["snap_offset"]=snap_offset; state["snap_step"]=snap_step; @@ -310,8 +310,8 @@ void CanvasItemEditor::set_state(const Dictionary& p_state){ if (state.has("ofs")) { _update_scrollbars(); // i wonder how safe is calling this here.. Point2 ofs=p_state["ofs"]; - h_scroll->set_val(ofs.x); - v_scroll->set_val(ofs.y); + h_scroll->set_value(ofs.x); + v_scroll->set_value(ofs.y); } if (state.has("snap_step")) { @@ -440,7 +440,7 @@ bool CanvasItemEditor::_is_part_of_subscene(CanvasItem *p_item) { } // slow but modern computers should have no problem -CanvasItem* CanvasItemEditor::_select_canvas_item_at_pos(const Point2& p_pos,Node* p_node,const Matrix32& p_parent_xform,const Matrix32& p_canvas_xform) { +CanvasItem* CanvasItemEditor::_select_canvas_item_at_pos(const Point2& p_pos,Node* p_node,const Transform2D& p_parent_xform,const Transform2D& p_canvas_xform) { if (!p_node) return NULL; @@ -479,7 +479,7 @@ CanvasItem* CanvasItemEditor::_select_canvas_item_at_pos(const Point2& p_pos,Nod return NULL; } -void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos,Node* p_node,const Matrix32& p_parent_xform,const Matrix32& p_canvas_xform, Vector<_SelectResult> &r_items) { +void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos,Node* p_node,const Transform2D& p_parent_xform,const Transform2D& p_canvas_xform, Vector<_SelectResult> &r_items) { if (!p_node) return; if (p_node->cast_to<Viewport>()) @@ -519,7 +519,7 @@ void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos,Node* p_nod return; } -void CanvasItemEditor::_find_canvas_items_at_rect(const Rect2& p_rect,Node* p_node,const Matrix32& p_parent_xform,const Matrix32& p_canvas_xform,List<CanvasItem*> *r_items) { +void CanvasItemEditor::_find_canvas_items_at_rect(const Rect2& p_rect,Node* p_node,const Transform2D& p_parent_xform,const Transform2D& p_canvas_xform,List<CanvasItem*> *r_items) { if (!p_node) return; @@ -529,21 +529,28 @@ void CanvasItemEditor::_find_canvas_items_at_rect(const Rect2& p_rect,Node* p_no CanvasItem *c=p_node->cast_to<CanvasItem>(); - for (int i=p_node->get_child_count()-1;i>=0;i--) { + bool inherited=p_node!=get_tree()->get_edited_scene_root() && p_node->get_filename()!=""; + bool editable=false; + if (inherited){ + editable=EditorNode::get_singleton()->get_edited_scene()->is_editable_instance(p_node); + } + bool lock_children=p_node->has_meta("_edit_group_") && p_node->get_meta("_edit_group_"); + if (!lock_children && (!inherited || editable)) { + for (int i=p_node->get_child_count()-1;i>=0;i--) { - if (c && !c->is_set_as_toplevel()) - _find_canvas_items_at_rect(p_rect,p_node->get_child(i),p_parent_xform * c->get_transform(),p_canvas_xform,r_items); - else { - CanvasLayer *cl = p_node->cast_to<CanvasLayer>(); - _find_canvas_items_at_rect(p_rect,p_node->get_child(i),transform,cl?cl->get_transform():p_canvas_xform,r_items); + if (c && !c->is_set_as_toplevel()) + _find_canvas_items_at_rect(p_rect,p_node->get_child(i),p_parent_xform * c->get_transform(),p_canvas_xform,r_items); + else { + CanvasLayer *cl = p_node->cast_to<CanvasLayer>(); + _find_canvas_items_at_rect(p_rect,p_node->get_child(i),transform,cl?cl->get_transform():p_canvas_xform,r_items); + } } } - if (c && c->is_visible() && !c->has_meta("_edit_lock_") && !c->cast_to<CanvasLayer>()) { Rect2 rect = c->get_item_rect(); - Matrix32 xform = p_parent_xform * p_canvas_xform * c->get_transform(); + Transform2D xform = p_parent_xform * p_canvas_xform * c->get_transform(); if ( p_rect.has_point( xform.xform( rect.pos ) ) && p_rect.has_point( xform.xform( rect.pos+Vector2(rect.size.x,0) ) ) && @@ -701,11 +708,11 @@ void CanvasItemEditor::_key_move(const Vector2& p_dir, bool p_snap, KeyMoveMODE if (Node2D *node_2d = canvas_item->cast_to<Node2D>()) { if (p_move_mode == MOVE_LOCAL_WITH_ROT) { - Matrix32 m; - m.rotate( node_2d->get_rot() ); + Transform2D m; + m.rotate( node_2d->get_rotation() ); drag = m.xform(drag); } - node_2d->set_pos(node_2d->get_pos() + drag); + node_2d->set_position(node_2d->get_position() + drag); } else if (Control *control = canvas_item->cast_to<Control>()) { @@ -740,7 +747,7 @@ Point2 CanvasItemEditor::_find_topleftmost_point() { Rect2 rect=canvas_item->get_item_rect(); - Matrix32 xform=canvas_item->get_global_transform_with_canvas(); + Transform2D xform=canvas_item->get_global_transform_with_canvas(); r2.expand_to(xform.xform(rect.pos)); r2.expand_to(xform.xform(rect.pos+Vector2(rect.size.x,0))); @@ -798,15 +805,15 @@ CanvasItem *CanvasItemEditor::get_single_item() { return single_item; } -CanvasItemEditor::DragType CanvasItemEditor::_find_drag_type(const Matrix32& p_xform, const Rect2& p_local_rect, const Point2& p_click, Vector2& r_point) { +CanvasItemEditor::DragType CanvasItemEditor::_find_drag_type(const Transform2D& p_xform, const Rect2& p_local_rect, const Point2& p_click, Vector2& r_point) { CanvasItem *canvas_item = get_single_item(); ERR_FAIL_COND_V(!canvas_item,DRAG_NONE); Rect2 rect=canvas_item->get_item_rect(); - Matrix32 xforml=canvas_item->get_global_transform_with_canvas(); - Matrix32 xform=transform * xforml; + Transform2D xforml=canvas_item->get_global_transform_with_canvas(); + Transform2D xform=transform * xforml; Vector2 endpoints[4]={ @@ -954,7 +961,7 @@ void CanvasItemEditor::_dialog_value_changed(double) { case ZOOM_SET: { - zoom=dialog_val->get_val()/100.0; + zoom=dialog_val->get_value()/100.0; _update_scroll(0); viewport->update(); @@ -996,7 +1003,7 @@ void CanvasItemEditor::_list_select(const InputEventMouseButton& b) { if (!scene) return; - _find_canvas_items_at_pos(click, scene,transform,Matrix32(), selection_results); + _find_canvas_items_at_pos(click, scene,transform,Transform2D(), selection_results); for(int i=0;i<selection_results.size();i++) { CanvasItem *item=selection_results[i].item; @@ -1033,7 +1040,7 @@ void CanvasItemEditor::_list_select(const InputEventMouseButton& b) { if (item->has_meta("_editor_icon")) icon=item->get_meta("_editor_icon"); else - icon=get_icon( has_icon(item->get_type(),"EditorIcons")?item->get_type():String("Object"),"EditorIcons"); + icon=get_icon( has_icon(item->get_class(),"EditorIcons")?item->get_class():String("Object"),"EditorIcons"); String node_path="/"+root_name+"/"+root_path.rel_path_to(item->get_path()); @@ -1041,7 +1048,7 @@ void CanvasItemEditor::_list_select(const InputEventMouseButton& b) { selection_menu->set_item_icon(i, icon ); selection_menu->set_item_metadata(i, node_path); selection_menu->set_item_tooltip(i,String(item->get_name())+ - "\nType: "+item->get_type()+"\nPath: "+node_path); + "\nType: "+item->get_class()+"\nPath: "+node_path); } additive_selection=b.mod.shift; @@ -1057,7 +1064,7 @@ void CanvasItemEditor::_list_select(const InputEventMouseButton& b) { } -void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { +void CanvasItemEditor::_viewport_gui_input(const InputEvent& p_event) { { @@ -1065,7 +1072,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { EditorPluginList *over_plugin_list = en->get_editor_plugins_over(); if (!over_plugin_list->empty()) { - bool discard = over_plugin_list->forward_input_event(transform,p_event); + bool discard = over_plugin_list->forward_gui_input(transform,p_event); if (discard) { accept_event(); return; @@ -1089,8 +1096,8 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { { Point2 ofs(b.x,b.y); ofs = ofs/prev_zoom - ofs/zoom; - h_scroll->set_val( h_scroll->get_val() + ofs.x ); - v_scroll->set_val( v_scroll->get_val() + ofs.y ); + h_scroll->set_value( h_scroll->get_value() + ofs.x ); + v_scroll->set_value( v_scroll->get_value() + ofs.y ); } _update_scroll(0); viewport->update(); @@ -1107,8 +1114,8 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { { Point2 ofs(b.x,b.y); ofs = ofs/prev_zoom - ofs/zoom; - h_scroll->set_val( h_scroll->get_val() + ofs.x ); - v_scroll->set_val( v_scroll->get_val() + ofs.y ); + h_scroll->set_value( h_scroll->get_value() + ofs.x ); + v_scroll->set_value( v_scroll->get_value() + ofs.y ); } _update_scroll(0); @@ -1288,7 +1295,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { if (bsfrom.y>bsto.y) SWAP(bsfrom.y,bsto.y); - _find_canvas_items_at_rect(Rect2(bsfrom,bsto-bsfrom),scene,transform,Matrix32(),&selitems); + _find_canvas_items_at_rect(Rect2(bsfrom,bsto-bsfrom),scene,transform,Transform2D(),&selitems); for(List<CanvasItem*>::Element *E=selitems.front();E;E=E->next()) { @@ -1310,7 +1317,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { { bone_ik_list.clear(); float closest_dist=1e20; - int bone_width = EditorSettings::get_singleton()->get("2d_editor/bone_width"); + int bone_width = EditorSettings::get_singleton()->get("editors/2dbone_width"); for(Map<ObjectID,BoneList>::Element *E=bone_list.front();E;E=E->next()) { if (E->get().from == E->get().to) @@ -1348,7 +1355,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { if (!pi) break; - float len=pi->get_global_transform().get_origin().distance_to(b->get_global_pos()); + float len=pi->get_global_transform().get_origin().distance_to(b->get_global_position()); b=pi->cast_to<Node2D>(); if (!b) break; @@ -1408,7 +1415,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { return; } - Matrix32 xform = transform * canvas_item->get_global_transform_with_canvas(); + Transform2D xform = transform * canvas_item->get_global_transform_with_canvas(); Rect2 rect=canvas_item->get_item_rect(); // float handle_radius = handle_len * 1.4144; //magic number, guess what it means! @@ -1497,7 +1504,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { } if (!c) { - c =_select_canvas_item_at_pos(click, scene,transform,Matrix32()); + c =_select_canvas_item_at_pos(click, scene,transform,Transform2D()); CanvasItem* cn = c; @@ -1512,7 +1519,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { Node* n = c; - while ((n && n != scene && n->get_owner() != scene) || (n && !n->is_type("CanvasItem"))) { + while ((n && n != scene && n->get_owner() != scene) || (n && !n->is_class("CanvasItem"))) { n = n->get_parent(); }; c = n->cast_to<CanvasItem>(); @@ -1547,8 +1554,8 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { if ( (m.button_mask&BUTTON_MASK_LEFT && tool == TOOL_PAN) || m.button_mask&BUTTON_MASK_MIDDLE || (m.button_mask&BUTTON_MASK_LEFT && Input::get_singleton()->is_key_pressed(KEY_SPACE))) { - h_scroll->set_val( h_scroll->get_val() - m.relative_x/zoom); - v_scroll->set_val( v_scroll->get_val() - m.relative_y/zoom); + h_scroll->set_value( h_scroll->get_value() - m.relative_x/zoom); + v_scroll->set_value( v_scroll->get_value() - m.relative_y/zoom); } return; @@ -1594,10 +1601,8 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { if (node) { - Matrix32 rot; - rot.elements[1] = (dfrom - center).normalized(); - rot.elements[0] = rot.elements[1].tangent(); - node->set_rot(snap_angle(rot.xform_inv(dto-center).angle() + node->get_rot(), node->get_rot())); + real_t angle = node->get_rotation(); + node->set_rotation(snap_angle( angle + (dfrom - center).angle_to(dto-center), angle )); display_rotate_to = dto; display_rotate_from = center; viewport->update(); @@ -1609,10 +1614,8 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { if (node) { - Matrix32 rot; - rot.elements[1] = (dfrom - center).normalized(); - rot.elements[0] = rot.elements[1].tangent(); - node->set_rotation(snap_angle(rot.xform_inv(dto-center).angle() + node->get_rotation(), node->get_rotation())); + real_t angle = node->get_rotation(); + node->set_rotation(snap_angle( angle + (dfrom - center).angle_to(dto-center), angle )); display_rotate_to = dto; display_rotate_from = center; viewport->update(); @@ -1745,7 +1748,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { Node2D *n2d = canvas_item->cast_to<Node2D>(); - Matrix32 final_xform = bone_orig_xform; + Transform2D final_xform = bone_orig_xform; @@ -1847,11 +1850,11 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { if (!E->prev()) { //last goes to what it was - final_xform.set_origin(n->get_global_pos()); + final_xform.set_origin(n->get_global_position()); n->set_global_transform(final_xform); } else { - Vector2 rel = (E->prev()->get().node->get_global_pos() - n->get_global_pos()).normalized(); + Vector2 rel = (E->prev()->get().node->get_global_position() - n->get_global_position()).normalized(); Vector2 rel2 = (E->prev()->get().pos - E->get().pos).normalized(); float rot = rel.angle_to(rel2); if (n->get_global_transform().basis_determinant()<0) { @@ -1917,7 +1920,7 @@ void CanvasItemEditor::_viewport_draw() { if (snap_show_grid) { Size2 s = viewport->get_size(); int last_cell; - Matrix32 xform = transform.affine_inverse(); + Transform2D xform = transform.affine_inverse(); if (snap_step.x!=0) { for(int i=0;i<s.width;i++) { @@ -1955,7 +1958,6 @@ void CanvasItemEditor::_viewport_draw() { Ref<Texture> lock = get_icon("Lock","EditorIcons"); Ref<Texture> group = get_icon("Group","EditorIcons"); - VisualServer::get_singleton()->canvas_item_set_clip(ci,true); bool single = get_single_item()!=NULL; @@ -1978,7 +1980,7 @@ void CanvasItemEditor::_viewport_draw() { Rect2 rect=canvas_item->get_item_rect(); - Matrix32 xform=transform * canvas_item->get_global_transform_with_canvas(); + Transform2D xform=transform * canvas_item->get_global_transform_with_canvas(); VisualServer::get_singleton()->canvas_item_add_set_transform(ci,xform); Vector2 endpoints[4]={ @@ -1991,7 +1993,7 @@ void CanvasItemEditor::_viewport_draw() { Color c = Color(1,0.6,0.4,0.7); - VisualServer::get_singleton()->canvas_item_add_set_transform(ci,Matrix32()); + VisualServer::get_singleton()->canvas_item_add_set_transform(ci,Transform2D()); for(int i=0;i<4;i++) { viewport->draw_line(endpoints[i],endpoints[(i+1)%4],c,2); @@ -2041,7 +2043,7 @@ void CanvasItemEditor::_viewport_draw() { } pivot_button->set_disabled(!pivot_found); - VisualServer::get_singleton()->canvas_item_add_set_transform(ci,Matrix32()); + VisualServer::get_singleton()->canvas_item_add_set_transform(ci,Transform2D()); @@ -2067,7 +2069,7 @@ void CanvasItemEditor::_viewport_draw() { VisualServer::get_singleton()->canvas_item_add_line(ci,transform.xform(display_rotate_from), transform.xform(display_rotate_to),rotate_color); } - Size2 screen_size = Size2( Globals::get_singleton()->get("display/width"), Globals::get_singleton()->get("display/height") ); + Size2 screen_size = Size2( GlobalConfig::get_singleton()->get("display/width"), GlobalConfig::get_singleton()->get("display/height") ); Vector2 screen_endpoints[4]= { transform.xform(Vector2(0,0)), @@ -2110,11 +2112,11 @@ void CanvasItemEditor::_viewport_draw() { } if (skeleton_show_bones) { - int bone_width = EditorSettings::get_singleton()->get("2d_editor/bone_width"); - Color bone_color1 = EditorSettings::get_singleton()->get("2d_editor/bone_color1"); - Color bone_color2 = EditorSettings::get_singleton()->get("2d_editor/bone_color2"); - Color bone_ik_color = EditorSettings::get_singleton()->get("2d_editor/bone_ik_color"); - Color bone_selected_color = EditorSettings::get_singleton()->get("2d_editor/bone_selected_color"); + int bone_width = EditorSettings::get_singleton()->get("editors/2dbone_width"); + Color bone_color1 = EditorSettings::get_singleton()->get("editors/2dbone_color1"); + Color bone_color2 = EditorSettings::get_singleton()->get("editors/2dbone_color2"); + Color bone_ik_color = EditorSettings::get_singleton()->get("editors/2dbone_ik_color"); + Color bone_selected_color = EditorSettings::get_singleton()->get("editors/2dbone_selected_color"); for(Map<ObjectID,BoneList>::Element*E=bone_list.front();E;E=E->next()) { @@ -2140,8 +2142,8 @@ void CanvasItemEditor::_viewport_draw() { if (!pn2d) continue; - Vector2 from = transform.xform(pn2d->get_global_pos()); - Vector2 to = transform.xform(n2d->get_global_pos()); + Vector2 from = transform.xform(pn2d->get_global_position()); + Vector2 to = transform.xform(n2d->get_global_position()); E->get().from=from; E->get().to=to; @@ -2213,7 +2215,7 @@ void CanvasItemEditor::_notification(int p_what) { Rect2 r=canvas_item->get_item_rect(); - Matrix32 xform = canvas_item->get_transform(); + Transform2D xform = canvas_item->get_transform(); if (r != se->prev_rect || xform!=se->prev_xform) { viewport->update(); @@ -2328,7 +2330,7 @@ void CanvasItemEditor::edit(CanvasItem *p_canvas_item) { } -void CanvasItemEditor::_find_canvas_items_span(Node *p_node, Rect2& r_rect, const Matrix32& p_xform) { +void CanvasItemEditor::_find_canvas_items_span(Node *p_node, Rect2& r_rect, const Transform2D& p_xform) { @@ -2345,7 +2347,7 @@ void CanvasItemEditor::_find_canvas_items_span(Node *p_node, Rect2& r_rect, cons if (c && !c->is_set_as_toplevel()) _find_canvas_items_span(p_node->get_child(i),r_rect,p_xform * c->get_transform()); else - _find_canvas_items_span(p_node->get_child(i),r_rect,Matrix32()); + _find_canvas_items_span(p_node->get_child(i),r_rect,Transform2D()); } @@ -2353,7 +2355,7 @@ void CanvasItemEditor::_find_canvas_items_span(Node *p_node, Rect2& r_rect, cons if (c) { Rect2 rect = c->get_item_rect(); - Matrix32 xform = p_xform * c->get_transform(); + Transform2D xform = p_xform * c->get_transform(); LockList lock; @@ -2402,7 +2404,7 @@ void CanvasItemEditor::_update_scrollbars() { h_scroll->set_end( Point2(size.width-vmin.width, size.height) ); - Size2 screen_rect = Size2( Globals::get_singleton()->get("display/width"), Globals::get_singleton()->get("display/height") ); + Size2 screen_rect = Size2( GlobalConfig::get_singleton()->get("display/width"), GlobalConfig::get_singleton()->get("display/height") ); Rect2 local_rect = Rect2(Point2(),viewport->get_size()-Size2(vmin.width,hmin.height)); @@ -2414,7 +2416,7 @@ void CanvasItemEditor::_update_scrollbars() { if (editor->get_edited_scene()) - _find_canvas_items_span(editor->get_edited_scene(),canvas_item_rect,Matrix32()); + _find_canvas_items_span(editor->get_edited_scene(),canvas_item_rect,Transform2D()); List<Map<ObjectID,BoneList>::Element*> bone_to_erase; @@ -2449,13 +2451,13 @@ void CanvasItemEditor::_update_scrollbars() { v_scroll->set_page(local_rect.size.y/zoom); if (first_update) { //so 0,0 is visible - v_scroll->set_val(-10); - h_scroll->set_val(-10); + v_scroll->set_value(-10); + h_scroll->set_value(-10); first_update=false; } - ofs.y=v_scroll->get_val(); + ofs.y=v_scroll->get_value(); } if (canvas_item_rect.size.width <= (local_rect.size.x/zoom)) { @@ -2468,7 +2470,7 @@ void CanvasItemEditor::_update_scrollbars() { h_scroll->set_min(canvas_item_rect.pos.x); h_scroll->set_max(canvas_item_rect.pos.x+canvas_item_rect.size.x); h_scroll->set_page(local_rect.size.x/zoom); - ofs.x=h_scroll->get_val(); + ofs.x=h_scroll->get_value(); } // transform=Matrix32(); @@ -2490,12 +2492,12 @@ void CanvasItemEditor::_update_scroll(float) { return; Point2 ofs; - ofs.x=h_scroll->get_val(); - ofs.y=v_scroll->get_val(); + ofs.x=h_scroll->get_value(); + ofs.y=v_scroll->get_value(); // current_window->set_scroll(-ofs); - transform=Matrix32(); + transform=Transform2D(); transform.scale_basis(Size2(zoom,zoom)); transform.elements[2]=-ofs; @@ -2604,7 +2606,7 @@ void CanvasItemEditor::_popup_callback(int p_op) { dialog_val->set_min(0.1); dialog_val->set_step(0.1); dialog_val->set_max(800); - dialog_val->set_val(zoom*100); + dialog_val->set_value(zoom*100); value_dialog->popup_centered(Size2(200,85)); updating_value_dialog=false; @@ -2826,9 +2828,9 @@ void CanvasItemEditor::_popup_callback(int p_op) { Node2D *n2d = canvas_item->cast_to<Node2D>(); if (key_pos) - AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d,"transform/pos",n2d->get_pos(),existing); + AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d,"transform/pos",n2d->get_position(),existing); if (key_rot) - AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d,"transform/rot",Math::rad2deg(n2d->get_rot()),existing); + AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d,"transform/rot",Math::rad2deg(n2d->get_rotation()),existing); if (key_scale) AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d,"transform/scale",n2d->get_scale(),existing); @@ -2858,9 +2860,9 @@ void CanvasItemEditor::_popup_callback(int p_op) { for(List<Node2D*>::Element *F=ik_chain.front();F;F=F->next()) { if (key_pos) - AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(),"transform/pos",F->get()->get_pos(),existing); + AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(),"transform/pos",F->get()->get_position(),existing); if (key_rot) - AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(),"transform/rot",Math::rad2deg(F->get()->get_rot()),existing); + AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(),"transform/rot",Math::rad2deg(F->get()->get_rotation()),existing); if (key_scale) AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(),"transform/scale",F->get()->get_scale(),existing); @@ -2940,8 +2942,8 @@ void CanvasItemEditor::_popup_callback(int p_op) { Node2D *n2d = canvas_item->cast_to<Node2D>(); PoseClipboard pc; - pc.pos=n2d->get_pos(); - pc.rot=n2d->get_rot(); + pc.pos=n2d->get_position(); + pc.rot=n2d->get_rotation(); pc.scale=n2d->get_scale(); pc.id=n2d->get_instance_ID(); pose_clipboard.push_back(pc); @@ -2967,8 +2969,8 @@ void CanvasItemEditor::_popup_callback(int p_op) { undo_redo->add_do_method(n2d,"set_pos",E->get().pos); undo_redo->add_do_method(n2d,"set_rot",E->get().rot); undo_redo->add_do_method(n2d,"set_scale",E->get().scale); - undo_redo->add_undo_method(n2d,"set_pos",n2d->get_pos()); - undo_redo->add_undo_method(n2d,"set_rot",n2d->get_rot()); + undo_redo->add_undo_method(n2d,"set_pos",n2d->get_position()); + undo_redo->add_undo_method(n2d,"set_rot",n2d->get_rotation()); undo_redo->add_undo_method(n2d,"set_scale",n2d->get_scale()); } undo_redo->commit_action(); @@ -2991,9 +2993,9 @@ void CanvasItemEditor::_popup_callback(int p_op) { Node2D *n2d = canvas_item->cast_to<Node2D>(); if (key_pos) - n2d->set_pos(Vector2()); + n2d->set_position(Vector2()); if (key_rot) - n2d->set_rot(0); + n2d->set_rotation(0); if (key_scale) n2d->set_scale(Vector2(1,1)); } else if (canvas_item->cast_to<Control>()) { @@ -3158,7 +3160,7 @@ void CanvasItemEditor::_focus_selection(int p_op) { Vector2 scale = canvas_item->get_global_transform().get_scale(); real_t angle = canvas_item->get_global_transform().get_rotation(); - Matrix32 t(angle, Vector2(0.f,0.f)); + Transform2D t(angle, Vector2(0.f,0.f)); item_rect = t.xform(item_rect); Rect2 canvas_item_rect(pos + scale*item_rect.pos, scale*item_rect.size); if (count == 1) { @@ -3173,8 +3175,8 @@ void CanvasItemEditor::_focus_selection(int p_op) { center = rect.pos + rect.size/2; Vector2 offset = viewport->get_size()/2 - editor->get_scene_root()->get_global_canvas_transform().xform(center); - h_scroll->set_val(h_scroll->get_val() - offset.x/zoom); - v_scroll->set_val(v_scroll->get_val() - offset.y/zoom); + h_scroll->set_value(h_scroll->get_value() - offset.x/zoom); + v_scroll->set_value(v_scroll->get_value() - offset.y/zoom); } else { // VIEW_FRAME_TO_SELECTION @@ -3192,20 +3194,20 @@ void CanvasItemEditor::_focus_selection(int p_op) { void CanvasItemEditor::_bind_methods() { - ObjectTypeDB::bind_method("_node_removed",&CanvasItemEditor::_node_removed); - ObjectTypeDB::bind_method("_update_scroll",&CanvasItemEditor::_update_scroll); - ObjectTypeDB::bind_method("_popup_callback",&CanvasItemEditor::_popup_callback); - ObjectTypeDB::bind_method("_visibility_changed",&CanvasItemEditor::_visibility_changed); - ObjectTypeDB::bind_method("_dialog_value_changed",&CanvasItemEditor::_dialog_value_changed); - ObjectTypeDB::bind_method("_get_editor_data",&CanvasItemEditor::_get_editor_data); - ObjectTypeDB::bind_method("_tool_select",&CanvasItemEditor::_tool_select); - ObjectTypeDB::bind_method("_keying_changed",&CanvasItemEditor::_keying_changed); - ObjectTypeDB::bind_method("_unhandled_key_input",&CanvasItemEditor::_unhandled_key_input); - ObjectTypeDB::bind_method("_viewport_draw",&CanvasItemEditor::_viewport_draw); - ObjectTypeDB::bind_method("_viewport_input_event",&CanvasItemEditor::_viewport_input_event); - ObjectTypeDB::bind_method("_snap_changed",&CanvasItemEditor::_snap_changed); - ObjectTypeDB::bind_method(_MD("_selection_result_pressed"),&CanvasItemEditor::_selection_result_pressed); - ObjectTypeDB::bind_method(_MD("_selection_menu_hide"),&CanvasItemEditor::_selection_menu_hide); + ClassDB::bind_method("_node_removed",&CanvasItemEditor::_node_removed); + ClassDB::bind_method("_update_scroll",&CanvasItemEditor::_update_scroll); + ClassDB::bind_method("_popup_callback",&CanvasItemEditor::_popup_callback); + ClassDB::bind_method("_visibility_changed",&CanvasItemEditor::_visibility_changed); + ClassDB::bind_method("_dialog_value_changed",&CanvasItemEditor::_dialog_value_changed); + ClassDB::bind_method("_get_editor_data",&CanvasItemEditor::_get_editor_data); + ClassDB::bind_method("_tool_select",&CanvasItemEditor::_tool_select); + ClassDB::bind_method("_keying_changed",&CanvasItemEditor::_keying_changed); + ClassDB::bind_method("_unhandled_key_input",&CanvasItemEditor::_unhandled_key_input); + ClassDB::bind_method("_viewport_draw",&CanvasItemEditor::_viewport_draw); + ClassDB::bind_method("_viewport_gui_input",&CanvasItemEditor::_viewport_gui_input); + ClassDB::bind_method("_snap_changed",&CanvasItemEditor::_snap_changed); + ClassDB::bind_method(_MD("_selection_result_pressed"),&CanvasItemEditor::_selection_result_pressed); + ClassDB::bind_method(_MD("_selection_menu_hide"),&CanvasItemEditor::_selection_menu_hide); ADD_SIGNAL( MethodInfo("item_lock_status_changed") ); ADD_SIGNAL( MethodInfo("item_group_status_changed") ); @@ -3327,7 +3329,8 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { vp_base->set_v_size_flags(SIZE_EXPAND_FILL); palette_split->add_child(vp_base); - Control *vp = memnew (Control); + ViewportContainer *vp = memnew (ViewportContainer); + vp->set_stretch(true); vp_base->add_child(vp); vp->set_area_as_parent_rect(); vp->add_child(p_editor->get_scene_root()); @@ -3336,6 +3339,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { viewport = memnew( CanvasItemEditorViewport(p_editor, this) ); vp_base->add_child(viewport); viewport->set_area_as_parent_rect(); + viewport->set_clip_contents(true); h_scroll = memnew( HScrollBar ); v_scroll = memnew( VScrollBar ); @@ -3343,7 +3347,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { viewport->add_child(h_scroll); viewport->add_child(v_scroll); viewport->connect("draw",this,"_viewport_draw"); - viewport->connect("input_event",this,"_viewport_input_event"); + viewport->connect("gui_input",this,"_viewport_gui_input"); h_scroll->connect("value_changed", this,"_update_scroll",Vector<Variant>(),true); @@ -3428,7 +3432,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { edit_menu = memnew( MenuButton ); edit_menu->set_text(TTR("Edit")); hb->add_child(edit_menu); - edit_menu->get_popup()->connect("item_pressed", this,"_popup_callback"); + edit_menu->get_popup()->connect("id_pressed", this,"_popup_callback"); PopupMenu *p; p = edit_menu->get_popup(); @@ -3453,7 +3457,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { skeleton_menu->add_separator(); skeleton_menu->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_set_ik_chain", TTR("Make IK Chain")), SKELETON_SET_IK_CHAIN); skeleton_menu->add_shortcut(ED_SHORTCUT("canvas_item_editor/skeleton_clear_ik_chain", TTR("Clear IK Chain")), SKELETON_CLEAR_IK_CHAIN); - skeleton_menu->connect("item_pressed", this,"_popup_callback"); + skeleton_menu->connect("id_pressed", this,"_popup_callback"); /* @@ -3465,7 +3469,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { view_menu = memnew( MenuButton ); view_menu->set_text(TTR("View")); hb->add_child(view_menu); - view_menu->get_popup()->connect("item_pressed", this,"_popup_callback"); + view_menu->get_popup()->connect("id_pressed", this,"_popup_callback"); p = view_menu->get_popup(); @@ -3480,7 +3484,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { anchor_menu = memnew( MenuButton ); anchor_menu->set_text(TTR("Anchor")); hb->add_child(anchor_menu); - anchor_menu->get_popup()->connect("item_pressed", this,"_popup_callback"); + anchor_menu->get_popup()->connect("id_pressed", this,"_popup_callback"); anchor_menu->hide(); //p = anchor_menu->get_popup(); @@ -3526,7 +3530,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { animation_menu = memnew( MenuButton ); animation_menu->set_text(TTR("Animation")); animation_hb->add_child(animation_menu); - animation_menu->get_popup()->connect("item_pressed", this,"_popup_callback"); + animation_menu->get_popup()->connect("id_pressed", this,"_popup_callback"); p = animation_menu->get_popup(); @@ -3563,7 +3567,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { selection_menu = memnew( PopupMenu ); add_child(selection_menu); selection_menu->set_custom_minimum_size(Vector2(100, 0)); - selection_menu->connect("item_pressed", this, "_selection_result_pressed"); + selection_menu->connect("id_pressed", this, "_selection_result_pressed"); selection_menu->connect("popup_hide", this, "_selection_menu_hide"); key_pos=true; @@ -3603,7 +3607,7 @@ void CanvasItemEditorPlugin::edit(Object *p_object) { bool CanvasItemEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("CanvasItem"); + return p_object->is_class("CanvasItem"); } void CanvasItemEditorPlugin::make_visible(bool p_visible) { @@ -3663,7 +3667,10 @@ void CanvasItemEditorViewport::_on_select_type(Object* selected) { } void CanvasItemEditorViewport::_on_change_type() { - CheckBox* check=btn_group->get_pressed_button()->cast_to<CheckBox>(); + if (!button_group->get_pressed_button()) + return; + + CheckBox* check=button_group->get_pressed_button()->cast_to<CheckBox>(); default_type=check->get_text(); _perform_drop_data(); selector->hide(); @@ -3675,13 +3682,13 @@ void CanvasItemEditorViewport::_create_preview(const Vector<String>& files) cons for (int i=0;i<files.size();i++) { String path=files[i]; RES res=ResourceLoader::load(path); - String type=res->get_type(); + String type=res->get_class(); if (type=="ImageTexture" || type=="PackedScene") { if (type=="ImageTexture") { Ref<ImageTexture> texture=Ref<ImageTexture> ( ResourceCache::get(path)->cast_to<ImageTexture>() ); Sprite* sprite=memnew(Sprite); sprite->set_texture(texture); - sprite->set_opacity(0.7f); + sprite->set_modulate(Color(1,1,1,0.7f)); preview->add_child(sprite); label->show(); label_desc->show(); @@ -3738,7 +3745,7 @@ void CanvasItemEditorViewport::_create_nodes(Node* parent, Node* child, String& String new_name=parent->validate_child_name(child); ScriptEditorDebugger *sed=ScriptEditor::get_singleton()->get_debugger(); - editor_data->get_undo_redo().add_do_method(sed,"live_debug_create_node",editor->get_edited_scene()->get_path_to(parent),child->get_type(),new_name); + editor_data->get_undo_redo().add_do_method(sed,"live_debug_create_node",editor->get_edited_scene()->get_path_to(parent),child->get_class(),new_name); editor_data->get_undo_redo().add_undo_method(sed,"live_debug_remove_node",NodePath(String(editor->get_edited_scene()->get_path_to(parent))+"/"+new_name)); // handle with different property for texture @@ -3763,7 +3770,7 @@ void CanvasItemEditorViewport::_create_nodes(Node* parent, Node* child, String& if (default_type=="Patch9Frame") { editor_data->get_undo_redo().add_do_property(child,"rect/size",texture_size); } else if (default_type=="Polygon2D") { - DVector<Vector2> list; + PoolVector<Vector2> list; list.push_back(Vector2(0,0)); list.push_back(Vector2(texture_size.width,0)); list.push_back(Vector2(texture_size.width,texture_size.height)); @@ -3776,7 +3783,7 @@ void CanvasItemEditorViewport::_create_nodes(Node* parent, Node* child, String& if (parent->has_method("get_global_pos")) { pos=parent->call("get_global_pos"); } - Matrix32 trans=canvas->get_canvas_transform(); + Transform2D trans=canvas->get_canvas_transform(); Point2 target_pos = (p_point-trans.get_origin())/trans.get_scale().x-pos; if (default_type=="Polygon2D" || default_type=="TouchScreenButton" || default_type=="TextureFrame" || default_type=="Patch9Frame") { target_pos -= texture_size/2; @@ -3790,7 +3797,7 @@ bool CanvasItemEditorViewport::_create_instance(Node* parent, String& path, cons return false; } - Node* instanced_scene=sdata->instance(true); + Node* instanced_scene=sdata->instance(PackedScene::GEN_EDIT_STATE_INSTANCE); if (!instanced_scene) { // error on instancing return false; } @@ -3802,7 +3809,7 @@ bool CanvasItemEditorViewport::_create_instance(Node* parent, String& path, cons } } - instanced_scene->set_filename( Globals::get_singleton()->localize_path(path) ); + instanced_scene->set_filename( GlobalConfig::get_singleton()->localize_path(path) ); editor_data->get_undo_redo().add_do_method(parent,"add_child",instanced_scene); editor_data->get_undo_redo().add_do_method(instanced_scene,"set_owner",editor->get_edited_scene()); @@ -3817,14 +3824,14 @@ bool CanvasItemEditorViewport::_create_instance(Node* parent, String& path, cons Point2 pos; Node2D* parent_node2d=parent->cast_to<Node2D>(); if (parent_node2d) { - pos=parent_node2d->get_global_pos(); + pos=parent_node2d->get_global_position(); } else { Control* parent_control=parent->cast_to<Control>(); if (parent_control) { pos=parent_control->get_global_pos(); } } - Matrix32 trans=canvas->get_canvas_transform(); + Transform2D trans=canvas->get_canvas_transform(); editor_data->get_undo_redo().add_do_method(instanced_scene,"set_pos",(p_point-trans.get_origin())/trans.get_scale().x-pos); return true; @@ -3843,7 +3850,7 @@ void CanvasItemEditorViewport::_perform_drop_data(){ if (res.is_null()) { continue; } - String type=res->get_type(); + String type=res->get_class(); if (type=="ImageTexture") { Node* child; if (default_type=="Light2D") child=memnew(Light2D); @@ -3888,10 +3895,10 @@ bool CanvasItemEditorViewport::can_drop_data(const Point2& p_point,const Variant if (res.is_null()) { continue; } - String type=res->get_type(); + String type=res->get_class(); if (type=="PackedScene") { Ref<PackedScene> sdata=ResourceLoader::load(files[i]); - Node* instanced_scene=sdata->instance(true); + Node* instanced_scene=sdata->instance(PackedScene::GEN_EDIT_STATE_INSTANCE); if (!instanced_scene) { continue; } @@ -3904,8 +3911,8 @@ bool CanvasItemEditorViewport::can_drop_data(const Point2& p_point,const Variant if (!preview->get_parent()){ // create preview only once _create_preview(files); } - Matrix32 trans=canvas->get_canvas_transform(); - preview->set_pos((p_point-trans.get_origin())/trans.get_scale().x); + Transform2D trans=canvas->get_canvas_transform(); + preview->set_position((p_point-trans.get_origin())/trans.get_scale().x); label->set_text(vformat(TTR("Adding %s..."),default_type)); } return can_instance; @@ -3949,7 +3956,8 @@ void CanvasItemEditorViewport::drop_data(const Point2& p_point,const Variant& p_ if (is_alt) { List<BaseButton*> btn_list; - btn_group->get_button_list(&btn_list); + button_group->get_buttons(&btn_list); + for (int i=0;i<btn_list.size();i++) { CheckBox* check=btn_list[i]->cast_to<CheckBox>(); check->set_pressed(check->get_text()==default_type); @@ -3970,9 +3978,9 @@ void CanvasItemEditorViewport::_notification(int p_what) { } void CanvasItemEditorViewport::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_on_select_type"),&CanvasItemEditorViewport::_on_select_type); - ObjectTypeDB::bind_method(_MD("_on_change_type"),&CanvasItemEditorViewport::_on_change_type); - ObjectTypeDB::bind_method(_MD("_on_mouse_exit"),&CanvasItemEditorViewport::_on_mouse_exit); + ClassDB::bind_method(_MD("_on_select_type"),&CanvasItemEditorViewport::_on_select_type); + ClassDB::bind_method(_MD("_on_change_type"),&CanvasItemEditorViewport::_on_change_type); + ClassDB::bind_method(_MD("_on_mouse_exit"),&CanvasItemEditorViewport::_on_mouse_exit); } CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasItemEditor* p_canvas) { @@ -4008,7 +4016,9 @@ CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasIte selector_label->set_custom_minimum_size(Size2(0,30)*EDSCALE); vbc->add_child(selector_label); - btn_group=memnew( ButtonGroup ); + button_group.instance(); + + btn_group=memnew( VBoxContainer ); btn_group->set_h_size_flags(0); btn_group->connect("button_selected", this, "_on_select_type"); @@ -4016,6 +4026,7 @@ CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasIte CheckBox* check=memnew(CheckBox); check->set_text(types[i]); btn_group->add_child(check); + check->set_button_group(button_group); } vbc->add_child(btn_group); diff --git a/tools/editor/plugins/canvas_item_editor_plugin.h b/tools/editor/plugins/canvas_item_editor_plugin.h index bbec078e02..f4f628fe28 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.h +++ b/tools/editor/plugins/canvas_item_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -46,12 +46,12 @@ class CanvasItemEditorViewport; class CanvasItemEditorSelectedItem : public Object { - OBJ_TYPE(CanvasItemEditorSelectedItem,Object); + GDCLASS(CanvasItemEditorSelectedItem,Object); public: Variant undo_state; Vector2 undo_pivot; - Matrix32 prev_xform; + Transform2D prev_xform; float prev_rot; Rect2 prev_rect; @@ -60,7 +60,7 @@ public: class CanvasItemEditor : public VBoxContainer { - OBJ_TYPE(CanvasItemEditor, VBoxContainer ); + GDCLASS(CanvasItemEditor, VBoxContainer ); EditorNode *editor; @@ -166,7 +166,7 @@ class CanvasItemEditor : public VBoxContainer { VScrollBar *v_scroll; HBoxContainer *hb; - Matrix32 transform; + Transform2D transform; float zoom; Vector2 snap_offset; Vector2 snap_step; @@ -212,7 +212,7 @@ class CanvasItemEditor : public VBoxContainer { struct BoneList { - Matrix32 xform; + Transform2D xform; Vector2 from; Vector2 to; ObjectID bone; @@ -222,7 +222,7 @@ class CanvasItemEditor : public VBoxContainer { uint64_t bone_last_frame; Map<ObjectID,BoneList> bone_list; - Matrix32 bone_orig_xform; + Transform2D bone_orig_xform; struct BoneIK { @@ -300,9 +300,9 @@ class CanvasItemEditor : public VBoxContainer { int handle_len; bool _is_part_of_subscene(CanvasItem *p_item); - CanvasItem* _select_canvas_item_at_pos(const Point2 &p_pos,Node* p_node,const Matrix32& p_parent_xform,const Matrix32& p_canvas_xform); - void _find_canvas_items_at_pos(const Point2 &p_pos,Node* p_node,const Matrix32& p_parent_xform,const Matrix32& p_canvas_xform, Vector<_SelectResult> &r_items); - void _find_canvas_items_at_rect(const Rect2& p_rect,Node* p_node,const Matrix32& p_parent_xform,const Matrix32& p_canvas_xform,List<CanvasItem*> *r_items); + CanvasItem* _select_canvas_item_at_pos(const Point2 &p_pos,Node* p_node,const Transform2D& p_parent_xform,const Transform2D& p_canvas_xform); + void _find_canvas_items_at_pos(const Point2 &p_pos,Node* p_node,const Transform2D& p_parent_xform,const Transform2D& p_canvas_xform, Vector<_SelectResult> &r_items); + void _find_canvas_items_at_rect(const Rect2& p_rect,Node* p_node,const Transform2D& p_parent_xform,const Transform2D& p_canvas_xform,List<CanvasItem*> *r_items); bool _select(CanvasItem *item, Point2 p_click_pos, bool p_append, bool p_drag=true); @@ -322,7 +322,7 @@ class CanvasItemEditor : public VBoxContainer { void _key_move(const Vector2& p_dir, bool p_snap, KeyMoveMODE p_move_mode); void _list_select(const InputEventMouseButton& b); - DragType _find_drag_type(const Matrix32& p_xform, const Rect2& p_local_rect, const Point2& p_click, Vector2& r_point); + DragType _find_drag_type(const Transform2D& p_xform, const Rect2& p_local_rect, const Point2& p_click, Vector2& r_point); void _popup_callback(int p_op); bool updating_scroll; @@ -342,7 +342,7 @@ class CanvasItemEditor : public VBoxContainer { Point2 _find_topleftmost_point(); - void _find_canvas_items_span(Node *p_node, Rect2& r_rect, const Matrix32& p_xform); + void _find_canvas_items_span(Node *p_node, Rect2& r_rect, const Transform2D& p_xform); Object *_get_editor_data(Object *p_what); @@ -353,7 +353,7 @@ class CanvasItemEditor : public VBoxContainer { void _unhandled_key_input(const InputEvent& p_ev); - void _viewport_input_event(const InputEvent& p_event); + void _viewport_gui_input(const InputEvent& p_event); void _viewport_draw(); void _focus_selection(int p_op); @@ -407,7 +407,7 @@ public: Vector2 snap_point(Vector2 p_target, Vector2 p_start = Vector2(0, 0)) const; float snap_angle(float p_target, float p_start = 0) const; - Matrix32 get_canvas_transform() const { return transform; } + Transform2D get_canvas_transform() const { return transform; } static CanvasItemEditor *get_singleton() { return singleton; } Dictionary get_state() const; @@ -431,7 +431,7 @@ public: class CanvasItemEditorPlugin : public EditorPlugin { - OBJ_TYPE( CanvasItemEditorPlugin, EditorPlugin ); + GDCLASS( CanvasItemEditorPlugin, EditorPlugin ); CanvasItemEditor *canvas_item_editor; EditorNode *editor; @@ -455,7 +455,7 @@ public: }; class CanvasItemEditorViewport : public VBoxContainer { - OBJ_TYPE( CanvasItemEditorViewport, VBoxContainer ); + GDCLASS( CanvasItemEditorViewport, VBoxContainer ); String default_type; Vector<String> types; @@ -473,7 +473,8 @@ class CanvasItemEditorViewport : public VBoxContainer { Label* selector_label; Label* label; Label* label_desc; - ButtonGroup* btn_group; + VBoxContainer* btn_group; + Ref<ButtonGroup> button_group; void _on_mouse_exit(); void _on_select_type(Object* selected); diff --git a/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp b/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp index 95364e8921..263d96ecdf 100644 --- a/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp +++ b/tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -99,7 +99,7 @@ void CollisionPolygon2DEditor::_wip_close() { edited_point=-1; } -bool CollisionPolygon2DEditor::forward_input_event(const InputEvent& p_event) { +bool CollisionPolygon2DEditor::forward_gui_input(const InputEvent& p_event) { if (!node) @@ -111,7 +111,7 @@ bool CollisionPolygon2DEditor::forward_input_event(const InputEvent& p_event) { const InputEventMouseButton &mb=p_event.mouse_button; - Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); + Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); Vector2 gpoint = Point2(mb.x,mb.y); @@ -122,7 +122,7 @@ bool CollisionPolygon2DEditor::forward_input_event(const InputEvent& p_event) { Vector<Vector2> poly = node->get_polygon(); //first check if a point is to be added (segment split) - real_t grab_treshold=EDITOR_DEF("poly_editor/point_grab_radius",8); + real_t grab_treshold=EDITOR_DEF("editors/poly_editor/point_grab_radius",8); switch(mode) { @@ -346,7 +346,7 @@ void CollisionPolygon2DEditor::_canvas_draw() { poly=node->get_polygon(); - Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); + Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); Ref<Texture> handle= get_icon("EditorHandle","EditorIcons"); for(int i=0;i<poly.size();i++) { @@ -398,9 +398,9 @@ void CollisionPolygon2DEditor::edit(Node *p_collision_polygon) { void CollisionPolygon2DEditor::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_menu_option"),&CollisionPolygon2DEditor::_menu_option); - ObjectTypeDB::bind_method(_MD("_canvas_draw"),&CollisionPolygon2DEditor::_canvas_draw); - ObjectTypeDB::bind_method(_MD("_node_removed"),&CollisionPolygon2DEditor::_node_removed); + ClassDB::bind_method(_MD("_menu_option"),&CollisionPolygon2DEditor::_menu_option); + ClassDB::bind_method(_MD("_canvas_draw"),&CollisionPolygon2DEditor::_canvas_draw); + ClassDB::bind_method(_MD("_node_removed"),&CollisionPolygon2DEditor::_node_removed); } @@ -432,7 +432,7 @@ CollisionPolygon2DEditor::CollisionPolygon2DEditor(EditorNode *p_editor) { options->set_area_as_parent_rect(); options->set_text("Polygon"); //options->get_popup()->add_item("Parse BBCode",PARSE_BBCODE); - options->get_popup()->connect("item_pressed", this,"_menu_option"); + options->get_popup()->connect("id_pressed", this,"_menu_option"); #endif mode = MODE_EDIT; @@ -448,7 +448,7 @@ void CollisionPolygon2DEditorPlugin::edit(Object *p_object) { bool CollisionPolygon2DEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("CollisionPolygon2D"); + return p_object->is_class("CollisionPolygon2D"); } void CollisionPolygon2DEditorPlugin::make_visible(bool p_visible) { diff --git a/tools/editor/plugins/collision_polygon_2d_editor_plugin.h b/tools/editor/plugins/collision_polygon_2d_editor_plugin.h index 431d3651c1..2c573c1dcf 100644 --- a/tools/editor/plugins/collision_polygon_2d_editor_plugin.h +++ b/tools/editor/plugins/collision_polygon_2d_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -43,7 +43,7 @@ class CanvasItemEditor; class CollisionPolygon2DEditor : public HBoxContainer { - OBJ_TYPE(CollisionPolygon2DEditor, HBoxContainer ); + GDCLASS(CollisionPolygon2DEditor, HBoxContainer ); UndoRedo *undo_redo; enum Mode { @@ -81,21 +81,21 @@ protected: static void _bind_methods(); public: - bool forward_input_event(const InputEvent& p_event); + bool forward_gui_input(const InputEvent& p_event); void edit(Node *p_collision_polygon); CollisionPolygon2DEditor(EditorNode *p_editor); }; class CollisionPolygon2DEditorPlugin : public EditorPlugin { - OBJ_TYPE( CollisionPolygon2DEditorPlugin, EditorPlugin ); + GDCLASS( CollisionPolygon2DEditorPlugin, EditorPlugin ); CollisionPolygon2DEditor *collision_polygon_editor; EditorNode *editor; public: - virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); } + virtual bool forward_canvas_gui_input(const Transform2D& p_canvas_xform,const InputEvent& p_event) { return collision_polygon_editor->forward_gui_input(p_event); } virtual String get_name() const { return "CollisionPolygon2D"; } bool has_main_screen() const { return false; } diff --git a/tools/editor/plugins/collision_polygon_editor_plugin.cpp b/tools/editor/plugins/collision_polygon_editor_plugin.cpp index 0b06b3ba21..010d6f1a47 100644 --- a/tools/editor/plugins/collision_polygon_editor_plugin.cpp +++ b/tools/editor/plugins/collision_polygon_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,6 +33,8 @@ #include "scene/3d/camera.h" #include "canvas_item_editor_plugin.h" +#if 0 + void CollisionPolygonEditor::_notification(int p_what) { switch(p_what) { @@ -107,7 +109,7 @@ void CollisionPolygonEditor::_wip_close() { } -bool CollisionPolygonEditor::forward_spatial_input_event(Camera* p_camera,const InputEvent& p_event) { +bool CollisionPolygonEditor::forward_spatial_gui_input(Camera* p_camera,const InputEvent& p_event) { if (!node) return false; @@ -145,7 +147,7 @@ bool CollisionPolygonEditor::forward_spatial_input_event(Camera* p_camera,const Vector<Vector2> poly = node->get_polygon(); //first check if a point is to be added (segment split) - real_t grab_treshold=EDITOR_DEF("poly_editor/point_grab_radius",8); + real_t grab_treshold=EDITOR_DEF("editors/poly_editor/point_grab_radius",8); switch(mode) { @@ -476,11 +478,11 @@ void CollisionPolygonEditor::_polygon_draw() { Array a; a.resize(Mesh::ARRAY_MAX); - DVector<Vector3> va; + PoolVector<Vector3> va; { va.resize(poly.size()); - DVector<Vector3>::Write w=va.write(); + PoolVector<Vector3>::Write w=va.write(); for(int i=0;i<poly.size();i++) { @@ -527,9 +529,9 @@ void CollisionPolygonEditor::edit(Node *p_collision_polygon) { void CollisionPolygonEditor::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_menu_option"),&CollisionPolygonEditor::_menu_option); - ObjectTypeDB::bind_method(_MD("_polygon_draw"),&CollisionPolygonEditor::_polygon_draw); - ObjectTypeDB::bind_method(_MD("_node_removed"),&CollisionPolygonEditor::_node_removed); + ClassDB::bind_method(_MD("_menu_option"),&CollisionPolygonEditor::_menu_option); + ClassDB::bind_method(_MD("_polygon_draw"),&CollisionPolygonEditor::_polygon_draw); + ClassDB::bind_method(_MD("_node_removed"),&CollisionPolygonEditor::_node_removed); } @@ -559,7 +561,7 @@ CollisionPolygonEditor::CollisionPolygonEditor(EditorNode *p_editor) { options->set_area_as_parent_rect(); options->set_text("Polygon"); //options->get_popup()->add_item("Parse BBCode",PARSE_BBCODE); - options->get_popup()->connect("item_pressed", this,"_menu_option"); + options->get_popup()->connect("id_pressed", this,"_menu_option"); #endif mode = MODE_EDIT; @@ -568,25 +570,25 @@ CollisionPolygonEditor::CollisionPolygonEditor(EditorNode *p_editor) { imgeom->set_transform(Transform(Matrix3(),Vector3(0,0,0.00001))); - line_material = Ref<FixedMaterial>( memnew( FixedMaterial )); + line_material = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial )); line_material->set_flag(Material::FLAG_UNSHADED, true); line_material->set_line_width(3.0); - line_material->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true); - line_material->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY, true); - line_material->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(1,1,1)); + line_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA, true); + line_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_COLOR_ARRAY, true); + line_material->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,Color(1,1,1)); - handle_material = Ref<FixedMaterial>( memnew( FixedMaterial )); + handle_material = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial )); handle_material->set_flag(Material::FLAG_UNSHADED, true); - handle_material->set_fixed_flag(FixedMaterial::FLAG_USE_POINT_SIZE, true); - handle_material->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(1,1,1)); - handle_material->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true); - handle_material->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY, false); + handle_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_POINT_SIZE, true); + handle_material->set_parameter(FixedSpatialMaterial::PARAM_DIFFUSE,Color(1,1,1)); + handle_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA, true); + handle_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_COLOR_ARRAY, false); Ref<Texture> handle=editor->get_gui_base()->get_icon("Editor3DHandle","EditorIcons"); handle_material->set_point_size(handle->get_width()); - handle_material->set_texture(FixedMaterial::PARAM_DIFFUSE,handle); + handle_material->set_texture(FixedSpatialMaterial::PARAM_DIFFUSE,handle); pointsm = memnew( MeshInstance ); imgeom->add_child(pointsm); @@ -642,3 +644,4 @@ CollisionPolygonEditorPlugin::~CollisionPolygonEditorPlugin() { } +#endif diff --git a/tools/editor/plugins/collision_polygon_editor_plugin.h b/tools/editor/plugins/collision_polygon_editor_plugin.h index 45e287ef00..cd722048db 100644 --- a/tools/editor/plugins/collision_polygon_editor_plugin.h +++ b/tools/editor/plugins/collision_polygon_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -40,11 +40,13 @@ /** @author Juan Linietsky <reduzio@gmail.com> */ + +#if 0 class CanvasItemEditor; class CollisionPolygonEditor : public HBoxContainer { - OBJ_TYPE(CollisionPolygonEditor, HBoxContainer ); + GDCLASS(CollisionPolygonEditor, HBoxContainer ); UndoRedo *undo_redo; enum Mode { @@ -60,8 +62,8 @@ class CollisionPolygonEditor : public HBoxContainer { ToolButton *button_edit; - Ref<FixedMaterial> line_material; - Ref<FixedMaterial> handle_material; + Ref<FixedSpatialMaterial> line_material; + Ref<FixedSpatialMaterial> handle_material; EditorNode *editor; Panel *panel; @@ -90,7 +92,7 @@ protected: static void _bind_methods(); public: - virtual bool forward_spatial_input_event(Camera* p_camera,const InputEvent& p_event); + virtual bool forward_spatial_gui_input(Camera* p_camera,const InputEvent& p_event); void edit(Node *p_collision_polygon); CollisionPolygonEditor(EditorNode *p_editor); ~CollisionPolygonEditor(); @@ -98,14 +100,14 @@ public: class CollisionPolygonEditorPlugin : public EditorPlugin { - OBJ_TYPE( CollisionPolygonEditorPlugin, EditorPlugin ); + GDCLASS( CollisionPolygonEditorPlugin, EditorPlugin ); CollisionPolygonEditor *collision_polygon_editor; EditorNode *editor; public: - virtual bool forward_spatial_input_event(Camera* p_camera,const InputEvent& p_event) { return collision_polygon_editor->forward_spatial_input_event(p_camera,p_event); } + virtual bool forward_spatial_gui_input(Camera* p_camera,const InputEvent& p_event) { return collision_polygon_editor->forward_spatial_gui_input(p_camera,p_event); } virtual String get_name() const { return "CollisionPolygon"; } bool has_main_screen() const { return false; } @@ -117,5 +119,5 @@ public: ~CollisionPolygonEditorPlugin(); }; - +#endif #endif // COLLISION_POLYGON_EDITOR_PLUGIN_H diff --git a/tools/editor/plugins/collision_shape_2d_editor_plugin.cpp b/tools/editor/plugins/collision_shape_2d_editor_plugin.cpp index d0cd73dcad..626ca9e132 100644 --- a/tools/editor/plugins/collision_shape_2d_editor_plugin.cpp +++ b/tools/editor/plugins/collision_shape_2d_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -303,7 +303,7 @@ void CollisionShape2DEditor::commit_handle(int idx, Variant& p_org) { undo_redo->commit_action(); } -bool CollisionShape2DEditor::forward_input_event(const InputEvent& p_event) { +bool CollisionShape2DEditor::forward_gui_input(const InputEvent& p_event) { if (!node) { return false; @@ -321,7 +321,7 @@ bool CollisionShape2DEditor::forward_input_event(const InputEvent& p_event) { case InputEvent::MOUSE_BUTTON: { const InputEventMouseButton& mb = p_event.mouse_button; - Matrix32 gt = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); + Transform2D gt = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); Point2 gpoint(mb.x,mb.y); @@ -436,7 +436,7 @@ void CollisionShape2DEditor::_canvas_draw() { } Control *c = canvas_item_editor->get_viewport_control(); - Matrix32 gt = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); + Transform2D gt = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); Ref<Texture> h = get_icon("EditorHandle","EditorIcons"); Vector2 size = h->get_size()*0.5; @@ -555,8 +555,8 @@ void CollisionShape2DEditor::edit(Node* p_node) { void CollisionShape2DEditor::_bind_methods() { - ObjectTypeDB::bind_method("_canvas_draw",&CollisionShape2DEditor::_canvas_draw); - ObjectTypeDB::bind_method("_get_current_shape_type",&CollisionShape2DEditor::_get_current_shape_type); + ClassDB::bind_method("_canvas_draw",&CollisionShape2DEditor::_canvas_draw); + ClassDB::bind_method("_get_current_shape_type",&CollisionShape2DEditor::_get_current_shape_type); } CollisionShape2DEditor::CollisionShape2DEditor(EditorNode* p_editor) { @@ -578,7 +578,7 @@ void CollisionShape2DEditorPlugin::edit(Object* p_obj) { bool CollisionShape2DEditorPlugin::handles(Object* p_obj) const { - return p_obj->is_type("CollisionShape2D"); + return p_obj->is_class("CollisionShape2D"); } void CollisionShape2DEditorPlugin::make_visible(bool visible) { diff --git a/tools/editor/plugins/collision_shape_2d_editor_plugin.h b/tools/editor/plugins/collision_shape_2d_editor_plugin.h index a8930dc0f2..37708db5e0 100644 --- a/tools/editor/plugins/collision_shape_2d_editor_plugin.h +++ b/tools/editor/plugins/collision_shape_2d_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ class CanvasItemEditor; class CollisionShape2DEditor : public Control { - OBJ_TYPE(CollisionShape2DEditor, Control); + GDCLASS(CollisionShape2DEditor, Control); enum ShapeType { CAPSULE_SHAPE, @@ -73,20 +73,20 @@ protected: static void _bind_methods(); public: - bool forward_input_event(const InputEvent& p_event); + bool forward_gui_input(const InputEvent& p_event); void edit(Node* p_node); CollisionShape2DEditor(EditorNode* p_editor); }; class CollisionShape2DEditorPlugin : public EditorPlugin { - OBJ_TYPE(CollisionShape2DEditorPlugin, EditorPlugin); + GDCLASS(CollisionShape2DEditorPlugin, EditorPlugin); CollisionShape2DEditor* collision_shape_2d_editor; EditorNode* editor; public: - virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return collision_shape_2d_editor->forward_input_event(p_event); } + virtual bool forward_canvas_gui_input(const Transform2D& p_canvas_xform,const InputEvent& p_event) { return collision_shape_2d_editor->forward_gui_input(p_event); } virtual String get_name() const { return "CollisionShape2D"; } bool has_main_screen() const { return false; } diff --git a/tools/editor/plugins/color_ramp_editor_plugin.cpp b/tools/editor/plugins/color_ramp_editor_plugin.cpp index 4e2045edc6..90ec1e9f4e 100644 --- a/tools/editor/plugins/color_ramp_editor_plugin.cpp +++ b/tools/editor/plugins/color_ramp_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -54,7 +54,7 @@ void ColorRampEditorPlugin::edit(Object *p_object) { bool ColorRampEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("ColorRamp"); + return p_object->is_class("ColorRamp"); } @@ -75,7 +75,7 @@ void ColorRampEditorPlugin::_ramp_changed() { UndoRedo *ur=EditorNode::get_singleton()->get_undo_redo(); - //Not sure if I should convert this data to DVector + //Not sure if I should convert this data to PoolVector Vector<float> new_offsets=ramp_editor->get_offsets(); Vector<Color> new_colors=ramp_editor->get_colors(); Vector<float> old_offsets=color_ramp_ref->get_offsets(); @@ -106,6 +106,6 @@ ColorRampEditorPlugin::~ColorRampEditorPlugin(){ } void ColorRampEditorPlugin::_bind_methods() { - ObjectTypeDB::bind_method(_MD("ramp_changed"),&ColorRampEditorPlugin::_ramp_changed); - ObjectTypeDB::bind_method(_MD("undo_redo_color_ramp","offsets","colors"),&ColorRampEditorPlugin::_undo_redo_color_ramp); + ClassDB::bind_method(_MD("ramp_changed"),&ColorRampEditorPlugin::_ramp_changed); + ClassDB::bind_method(_MD("undo_redo_color_ramp","offsets","colors"),&ColorRampEditorPlugin::_undo_redo_color_ramp); } diff --git a/tools/editor/plugins/color_ramp_editor_plugin.h b/tools/editor/plugins/color_ramp_editor_plugin.h index 300a9030b9..2f55ad65f1 100644 --- a/tools/editor/plugins/color_ramp_editor_plugin.h +++ b/tools/editor/plugins/color_ramp_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class ColorRampEditorPlugin : public EditorPlugin { - OBJ_TYPE( ColorRampEditorPlugin, EditorPlugin ); + GDCLASS( ColorRampEditorPlugin, EditorPlugin ); bool _2d; Ref<ColorRamp> color_ramp_ref; diff --git a/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp b/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp index b6f3db73f7..da5c07221e 100644 --- a/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp +++ b/tools/editor/plugins/cube_grid_theme_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -28,6 +28,7 @@ /*************************************************************************/ #include "cube_grid_theme_editor_plugin.h" +#if 0 #include "scene/3d/mesh_instance.h" #include "scene/3d/physics_body.h" #include "scene/main/viewport.h" @@ -150,8 +151,8 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library, VS::ViewportRect vr; vr.x=0; vr.y=0; - vr.width=EditorSettings::get_singleton()->get("grid_map/preview_size"); - vr.height=EditorSettings::get_singleton()->get("grid_map/preview_size"); + vr.width=EditorSettings::get_singleton()->get("editors/grid_map/preview_size"); + vr.height=EditorSettings::get_singleton()->get("editors/grid_map/preview_size"); VS::get_singleton()->viewport_set_rect(vp,vr); VS::get_singleton()->viewport_set_as_render_target(vp,true); VS::get_singleton()->viewport_set_render_target_update_mode(vp,VS::RENDER_TARGET_UPDATE_ALWAYS); @@ -178,8 +179,8 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library, Vector3 ofs = aabb.pos + aabb.size*0.5; aabb.pos-=ofs; Transform xform; - xform.basis=Matrix3().rotated(Vector3(0,1,0),Math_PI*0.25); - xform.basis = Matrix3().rotated(Vector3(1,0,0),-Math_PI*0.25)*xform.basis; + xform.basis=Matrix3().rotated(Vector3(0,1,0),-Math_PI*0.25); + xform.basis = Matrix3().rotated(Vector3(1,0,0),Math_PI*0.25)*xform.basis; AABB rot_aabb = xform.xform(aabb); print_line("rot_aabb: "+rot_aabb); float m = MAX(rot_aabb.size.x,rot_aabb.size.y)*0.5; @@ -275,9 +276,9 @@ void MeshLibraryEditor::_menu_cbk(int p_option) { void MeshLibraryEditor::_bind_methods() { - ObjectTypeDB::bind_method("_menu_cbk",&MeshLibraryEditor::_menu_cbk); - ObjectTypeDB::bind_method("_menu_confirm",&MeshLibraryEditor::_menu_confirm); - ObjectTypeDB::bind_method("_import_scene_cbk",&MeshLibraryEditor::_import_scene_cbk); + ClassDB::bind_method("_menu_cbk",&MeshLibraryEditor::_menu_cbk); + ClassDB::bind_method("_menu_confirm",&MeshLibraryEditor::_menu_confirm); + ClassDB::bind_method("_import_scene_cbk",&MeshLibraryEditor::_import_scene_cbk); } MeshLibraryEditor::MeshLibraryEditor(EditorNode *p_editor) { @@ -309,7 +310,7 @@ MeshLibraryEditor::MeshLibraryEditor(EditorNode *p_editor) { options->get_popup()->add_item(TTR("Import from Scene"),MENU_OPTION_IMPORT_FROM_SCENE); options->get_popup()->add_item(TTR("Update from Scene"),MENU_OPTION_UPDATE_FROM_SCENE); options->get_popup()->set_item_disabled(options->get_popup()->get_item_index(MENU_OPTION_UPDATE_FROM_SCENE),true); - options->get_popup()->connect("item_pressed", this,"_menu_cbk"); + options->get_popup()->connect("id_pressed", this,"_menu_cbk"); menu=options; editor=p_editor; cd = memnew(ConfirmationDialog); @@ -342,7 +343,7 @@ void MeshLibraryEditorPlugin::make_visible(bool p_visible){ MeshLibraryEditorPlugin::MeshLibraryEditorPlugin(EditorNode *p_node) { - EDITOR_DEF("grid_map/preview_size",64); + EDITOR_DEF("editors/grid_map/preview_size",64); theme_editor = memnew( MeshLibraryEditor(p_node) ); p_node->get_viewport()->add_child(theme_editor); @@ -353,4 +354,4 @@ MeshLibraryEditorPlugin::MeshLibraryEditorPlugin(EditorNode *p_node) { theme_editor->hide(); } - +#endif diff --git a/tools/editor/plugins/cube_grid_theme_editor_plugin.h b/tools/editor/plugins/cube_grid_theme_editor_plugin.h index 72ee171e19..f32f601023 100644 --- a/tools/editor/plugins/cube_grid_theme_editor_plugin.h +++ b/tools/editor/plugins/cube_grid_theme_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,10 +32,10 @@ #include "scene/resources/mesh_library.h" #include "tools/editor/editor_node.h" - +#if 0 class MeshLibraryEditor : public Control { - OBJ_TYPE( MeshLibraryEditor, Control ); + GDCLASS( MeshLibraryEditor, Control ); Ref<MeshLibrary> theme; @@ -74,7 +74,7 @@ public: class MeshLibraryEditorPlugin : public EditorPlugin { - OBJ_TYPE( MeshLibraryEditorPlugin, EditorPlugin ); + GDCLASS( MeshLibraryEditorPlugin, EditorPlugin ); MeshLibraryEditor *theme_editor; EditorNode *editor; @@ -93,3 +93,4 @@ public: #endif // CUBE_GRID_THEME_EDITOR_PLUGIN_H +#endif diff --git a/tools/editor/plugins/editor_preview_plugins.cpp b/tools/editor/plugins/editor_preview_plugins.cpp index b1bce60484..9dcfc2fa94 100644 --- a/tools/editor/plugins/editor_preview_plugins.cpp +++ b/tools/editor/plugins/editor_preview_plugins.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,9 +37,10 @@ #include "scene/resources/bit_mask.h" #include "tools/editor/editor_scale.h" +#if 0 bool EditorTexturePreviewPlugin::handles(const String& p_type) const { - return (ObjectTypeDB::is_type(p_type,"ImageTexture") || ObjectTypeDB::is_type(p_type, "AtlasTexture")); + return (ClassDB::is_type(p_type,"ImageTexture") || ClassDB::is_type(p_type, "AtlasTexture")); } Ref<Texture> EditorTexturePreviewPlugin::generate(const RES& p_from) { @@ -64,13 +65,13 @@ Ref<Texture> EditorTexturePreviewPlugin::generate(const RES& p_from) { img.clear_mipmaps(); - int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size"); + int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size"); thumbnail_size*=EDSCALE; if (img.is_compressed()) { if (img.decompress()!=OK) return Ref<Texture>(); - } else if (img.get_format()!=Image::FORMAT_RGB && img.get_format()!=Image::FORMAT_RGBA) { - img.convert(Image::FORMAT_RGBA); + } else if (img.get_format()!=Image::FORMAT_RGB8 && img.get_format()!=Image::FORMAT_RGBA8) { + img.convert(Image::FORMAT_RGBA8); } int width,height; @@ -106,7 +107,7 @@ EditorTexturePreviewPlugin::EditorTexturePreviewPlugin() { bool EditorBitmapPreviewPlugin::handles(const String& p_type) const { - return ObjectTypeDB::is_type(p_type,"BitMap"); + return ClassDB::is_type(p_type,"BitMap"); } Ref<Texture> EditorBitmapPreviewPlugin::generate(const RES& p_from) { @@ -117,12 +118,12 @@ Ref<Texture> EditorBitmapPreviewPlugin::generate(const RES& p_from) { return Ref<Texture>(); } - DVector<uint8_t> data; + PoolVector<uint8_t> data; data.resize(bm->get_size().width*bm->get_size().height); { - DVector<uint8_t>::Write w=data.write(); + PoolVector<uint8_t>::Write w=data.write(); for(int i=0;i<bm->get_size().width;i++) { for(int j=0;j<bm->get_size().height;j++) { @@ -138,15 +139,15 @@ Ref<Texture> EditorBitmapPreviewPlugin::generate(const RES& p_from) { } - Image img(bm->get_size().width,bm->get_size().height,0,Image::FORMAT_GRAYSCALE,data); + Image img(bm->get_size().width,bm->get_size().height,0,Image::FORMAT_L8,data); - int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size"); + int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size"); thumbnail_size*=EDSCALE; if (img.is_compressed()) { if (img.decompress()!=OK) return Ref<Texture>(); - } else if (img.get_format()!=Image::FORMAT_RGB && img.get_format()!=Image::FORMAT_RGBA) { - img.convert(Image::FORMAT_RGBA); + } else if (img.get_format()!=Image::FORMAT_RGB8 && img.get_format()!=Image::FORMAT_RGBA8) { + img.convert(Image::FORMAT_RGBA8); } int width,height; @@ -192,14 +193,14 @@ Ref<Texture> EditorPackedScenePreviewPlugin::_gen_from_imd(Ref<ResourceImportMet Variant tn = p_imd->get_option("thumbnail"); //print_line(Variant::get_type_name(tn.get_type())); - DVector<uint8_t> thumbnail = tn; + PoolVector<uint8_t> thumbnail = tn; int len = thumbnail.size(); if (len==0) return Ref<Texture>(); - DVector<uint8_t>::Read r = thumbnail.read(); + PoolVector<uint8_t>::Read r = thumbnail.read(); Image img(r.ptr(),len); if (img.empty()) @@ -213,7 +214,7 @@ Ref<Texture> EditorPackedScenePreviewPlugin::_gen_from_imd(Ref<ResourceImportMet bool EditorPackedScenePreviewPlugin::handles(const String& p_type) const { - return ObjectTypeDB::is_type(p_type,"PackedScene"); + return ClassDB::is_type(p_type,"PackedScene"); } Ref<Texture> EditorPackedScenePreviewPlugin::generate(const RES& p_from) { @@ -235,7 +236,7 @@ EditorPackedScenePreviewPlugin::EditorPackedScenePreviewPlugin() { bool EditorMaterialPreviewPlugin::handles(const String& p_type) const { - return ObjectTypeDB::is_type(p_type,"Material"); //any material + return ClassDB::is_type(p_type,"Material"); //any material } Ref<Texture> EditorMaterialPreviewPlugin::generate(const RES& p_from) { @@ -263,7 +264,7 @@ Ref<Texture> EditorMaterialPreviewPlugin::generate(const RES& p_from) { //print_line("captured!"); VS::get_singleton()->mesh_surface_set_material(sphere,0,RID()); - int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size"); + int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size"); thumbnail_size*=EDSCALE; img.resize(thumbnail_size,thumbnail_size); @@ -310,10 +311,10 @@ EditorMaterialPreviewPlugin::EditorMaterialPreviewPlugin() { int lons=32; float radius=1.0; - DVector<Vector3> vertices; - DVector<Vector3> normals; - DVector<Vector2> uvs; - DVector<float> tangents; + PoolVector<Vector3> vertices; + PoolVector<Vector3> normals; + PoolVector<Vector2> uvs; + PoolVector<float> tangents; Matrix3 tt = Matrix3(Vector3(0,1,0),Math_PI*0.5); for(int i = 1; i <= lats; i++) { @@ -404,7 +405,7 @@ static bool _is_text_char(CharType c) { bool EditorScriptPreviewPlugin::handles(const String& p_type) const { - return ObjectTypeDB::is_type(p_type,"Script"); + return ClassDB::is_type(p_type,"Script"); } Ref<Texture> EditorScriptPreviewPlugin::generate(const RES& p_from) { @@ -432,17 +433,17 @@ Ref<Texture> EditorScriptPreviewPlugin::generate(const RES& p_from) { int line = 0; int col=0; - int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size"); + int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size"); thumbnail_size*=EDSCALE; - Image img(thumbnail_size,thumbnail_size,0,Image::FORMAT_RGBA); + Image img(thumbnail_size,thumbnail_size,0,Image::FORMAT_RGBA8); - Color bg_color = EditorSettings::get_singleton()->get("text_editor/background_color"); + Color bg_color = EditorSettings::get_singleton()->get("text_editor/highlighting/background_color"); bg_color.a=1.0; - Color keyword_color = EditorSettings::get_singleton()->get("text_editor/keyword_color"); - Color text_color = EditorSettings::get_singleton()->get("text_editor/text_color"); - Color symbol_color = EditorSettings::get_singleton()->get("text_editor/symbol_color"); + Color keyword_color = EditorSettings::get_singleton()->get("text_editor/highlighting/keyword_color"); + Color text_color = EditorSettings::get_singleton()->get("text_editor/highlighting/text_color"); + Color symbol_color = EditorSettings::get_singleton()->get("text_editor/highlighting/symbol_color"); for(int i=0;i<thumbnail_size;i++) { @@ -523,7 +524,7 @@ EditorScriptPreviewPlugin::EditorScriptPreviewPlugin() { bool EditorSamplePreviewPlugin::handles(const String& p_type) const { - return ObjectTypeDB::is_type(p_type,"Sample"); + return ClassDB::is_type(p_type,"Sample"); } Ref<Texture> EditorSamplePreviewPlugin::generate(const RES& p_from) { @@ -532,17 +533,17 @@ Ref<Texture> EditorSamplePreviewPlugin::generate(const RES& p_from) { ERR_FAIL_COND_V(smp.is_null(),Ref<Texture>()); - int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size"); + int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size"); thumbnail_size*=EDSCALE; - DVector<uint8_t> img; + PoolVector<uint8_t> img; int w = thumbnail_size; int h = thumbnail_size; img.resize(w*h*3); - DVector<uint8_t>::Write imgdata = img.write(); + PoolVector<uint8_t>::Write imgdata = img.write(); uint8_t * imgw = imgdata.ptr(); - DVector<uint8_t> data = smp->get_data(); - DVector<uint8_t>::Read sampledata = data.read(); + PoolVector<uint8_t> data = smp->get_data(); + PoolVector<uint8_t>::Read sampledata = data.read(); const uint8_t *sdata=sampledata.ptr(); bool stereo = smp->is_stereo(); @@ -775,10 +776,10 @@ Ref<Texture> EditorSamplePreviewPlugin::generate(const RES& p_from) { } } - imgdata = DVector<uint8_t>::Write(); + imgdata = PoolVector<uint8_t>::Write(); Ref<ImageTexture> ptex = Ref<ImageTexture>( memnew( ImageTexture)); - ptex->create_from_image(Image(w,h,0,Image::FORMAT_RGB,img),0); + ptex->create_from_image(Image(w,h,0,Image::FORMAT_RGB8,img),0); return ptex; } @@ -792,7 +793,7 @@ EditorSamplePreviewPlugin::EditorSamplePreviewPlugin() { bool EditorMeshPreviewPlugin::handles(const String& p_type) const { - return ObjectTypeDB::is_type(p_type,"Mesh"); //any Mesh + return ClassDB::is_type(p_type,"Mesh"); //any Mesh } Ref<Texture> EditorMeshPreviewPlugin::generate(const RES& p_from) { @@ -806,8 +807,8 @@ Ref<Texture> EditorMeshPreviewPlugin::generate(const RES& p_from) { Vector3 ofs = aabb.pos + aabb.size*0.5; aabb.pos-=ofs; Transform xform; - xform.basis=Matrix3().rotated(Vector3(0,1,0),Math_PI*0.125); - xform.basis = Matrix3().rotated(Vector3(1,0,0),-Math_PI*0.125)*xform.basis; + xform.basis=Matrix3().rotated(Vector3(0,1,0),-Math_PI*0.125); + xform.basis = Matrix3().rotated(Vector3(1,0,0),Math_PI*0.125)*xform.basis; AABB rot_aabb = xform.xform(aabb); float m = MAX(rot_aabb.size.x,rot_aabb.size.y)*0.5; if (m==0) @@ -840,7 +841,7 @@ Ref<Texture> EditorMeshPreviewPlugin::generate(const RES& p_from) { //print_line("captured!"); VS::get_singleton()->instance_set_base(mesh_instance,RID()); - int thumbnail_size = EditorSettings::get_singleton()->get("file_dialog/thumbnail_size"); + int thumbnail_size = EditorSettings::get_singleton()->get("filesystem/file_dialog/thumbnail_size"); thumbnail_size*=EDSCALE; img.resize(thumbnail_size,thumbnail_size); @@ -888,6 +889,7 @@ EditorMeshPreviewPlugin::EditorMeshPreviewPlugin() { } + EditorMeshPreviewPlugin::~EditorMeshPreviewPlugin() { //VS::get_singleton()->free(sphere); @@ -901,3 +903,4 @@ EditorMeshPreviewPlugin::~EditorMeshPreviewPlugin() { VS::get_singleton()->free(scenario); } +#endif diff --git a/tools/editor/plugins/editor_preview_plugins.h b/tools/editor/plugins/editor_preview_plugins.h index b33aefaa23..3c1689e61e 100644 --- a/tools/editor/plugins/editor_preview_plugins.h +++ b/tools/editor/plugins/editor_preview_plugins.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,6 +31,7 @@ #include "tools/editor/editor_resource_preview.h" +#if 0 class EditorTexturePreviewPlugin : public EditorResourcePreviewGenerator { public: @@ -123,5 +124,5 @@ public: ~EditorMeshPreviewPlugin(); }; - +#endif #endif // EDITORPREVIEWPLUGINS_H diff --git a/tools/editor/plugins/gi_probe_editor_plugin.cpp b/tools/editor/plugins/gi_probe_editor_plugin.cpp new file mode 100644 index 0000000000..f550b7972a --- /dev/null +++ b/tools/editor/plugins/gi_probe_editor_plugin.cpp @@ -0,0 +1,57 @@ +#include "gi_probe_editor_plugin.h" + + +void GIProbeEditorPlugin::_bake() { + + if (gi_probe) { + gi_probe->bake(); + } +} + + +void GIProbeEditorPlugin::edit(Object *p_object) { + + GIProbe * s = p_object->cast_to<GIProbe>(); + if (!s) + return; + + gi_probe=s; +} + +bool GIProbeEditorPlugin::handles(Object *p_object) const { + + return p_object->is_class("GIProbe"); +} + +void GIProbeEditorPlugin::make_visible(bool p_visible) { + + if (p_visible) { + bake->show(); + } else { + + bake->hide(); + } + +} + +void GIProbeEditorPlugin::_bind_methods() { + + ClassDB::bind_method("_bake",&GIProbeEditorPlugin::_bake); +} + +GIProbeEditorPlugin::GIProbeEditorPlugin(EditorNode *p_node) { + + editor=p_node; + bake = memnew( Button ); + bake->set_icon(editor->get_gui_base()->get_icon("BakedLight","EditorIcons")); + bake->hide();; + bake->connect("pressed",this,"_bake"); + add_control_to_container(CONTAINER_SPATIAL_EDITOR_MENU,bake); + gi_probe=NULL; +} + + +GIProbeEditorPlugin::~GIProbeEditorPlugin() { + + memdelete(bake); +} diff --git a/tools/editor/plugins/gi_probe_editor_plugin.h b/tools/editor/plugins/gi_probe_editor_plugin.h new file mode 100644 index 0000000000..8d2ec17d2f --- /dev/null +++ b/tools/editor/plugins/gi_probe_editor_plugin.h @@ -0,0 +1,37 @@ +#ifndef GIPROBEEDITORPLUGIN_H +#define GIPROBEEDITORPLUGIN_H + +#include "tools/editor/editor_plugin.h" +#include "tools/editor/editor_node.h" +#include "scene/resources/material.h" +#include "scene/3d/gi_probe.h" + + + +class GIProbeEditorPlugin : public EditorPlugin { + + GDCLASS( GIProbeEditorPlugin, EditorPlugin ); + + GIProbe *gi_probe; + + Button *bake; + EditorNode *editor; + + void _bake(); +protected: + + static void _bind_methods(); +public: + + virtual String get_name() const { return "GIProbe"; } + bool has_main_screen() const { return false; } + virtual void edit(Object *p_node); + virtual bool handles(Object *p_node) const; + virtual void make_visible(bool p_visible); + + GIProbeEditorPlugin(EditorNode *p_node); + ~GIProbeEditorPlugin(); + +}; + +#endif // GIPROBEEDITORPLUGIN_H diff --git a/tools/editor/plugins/item_list_editor_plugin.cpp b/tools/editor/plugins/item_list_editor_plugin.cpp index b711e13193..f31074a9dc 100644 --- a/tools/editor/plugins/item_list_editor_plugin.cpp +++ b/tools/editor/plugins/item_list_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -119,7 +119,7 @@ void ItemListOptionButtonPlugin::set_object(Object *p_object) { bool ItemListOptionButtonPlugin::handles(Object *p_object) const { - return p_object->is_type("OptionButton"); + return p_object->is_class("OptionButton"); } int ItemListOptionButtonPlugin::get_flags() const { @@ -153,7 +153,7 @@ ItemListOptionButtonPlugin::ItemListOptionButtonPlugin() { void ItemListPopupMenuPlugin::set_object(Object *p_object) { - if (p_object->is_type("MenuButton")) + if (p_object->is_class("MenuButton")) pp = p_object->cast_to<MenuButton>()->get_popup(); else pp = p_object->cast_to<PopupMenu>(); @@ -161,7 +161,7 @@ void ItemListPopupMenuPlugin::set_object(Object *p_object) { bool ItemListPopupMenuPlugin::handles(Object *p_object) const { - return p_object->is_type("PopupMenu") || p_object->is_type("MenuButton"); + return p_object->is_class("PopupMenu") || p_object->is_class("MenuButton"); } int ItemListPopupMenuPlugin::get_flags() const { @@ -260,8 +260,8 @@ void ItemListEditor::edit(Node *p_item_list) { item_plugins[i]->set_object(p_item_list); property_editor->edit(item_plugins[i]); - if (has_icon(item_list->get_type(), "EditorIcons")) - toolbar_button->set_icon(get_icon(item_list->get_type(), "EditorIcons")); + if (has_icon(item_list->get_class(), "EditorIcons")) + toolbar_button->set_icon(get_icon(item_list->get_class(), "EditorIcons")); else toolbar_button->set_icon(Ref<Texture>()); @@ -287,9 +287,9 @@ bool ItemListEditor::handles(Object *p_object) const { void ItemListEditor::_bind_methods() { - ObjectTypeDB::bind_method("_edit_items",&ItemListEditor::_edit_items); - ObjectTypeDB::bind_method("_add_button",&ItemListEditor::_add_pressed); - ObjectTypeDB::bind_method("_delete_button",&ItemListEditor::_delete_pressed); + ClassDB::bind_method("_edit_items",&ItemListEditor::_edit_items); + ClassDB::bind_method("_add_button",&ItemListEditor::_add_pressed); + ClassDB::bind_method("_delete_button",&ItemListEditor::_delete_pressed); } ItemListEditor::ItemListEditor() { @@ -309,7 +309,7 @@ ItemListEditor::ItemListEditor() { VBoxContainer *vbc = memnew( VBoxContainer ); dialog->add_child(vbc); - dialog->set_child_rect(vbc); + //dialog->set_child_rect(vbc); HBoxContainer *hbc = memnew( HBoxContainer ); hbc->set_h_size_flags(SIZE_EXPAND_FILL); diff --git a/tools/editor/plugins/item_list_editor_plugin.h b/tools/editor/plugins/item_list_editor_plugin.h index 95d316b199..74700d615e 100644 --- a/tools/editor/plugins/item_list_editor_plugin.h +++ b/tools/editor/plugins/item_list_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -44,7 +44,7 @@ class ItemListPlugin : public Object { - OBJ_TYPE(ItemListPlugin,Object); + GDCLASS(ItemListPlugin,Object); protected: @@ -100,7 +100,7 @@ public: class ItemListOptionButtonPlugin : public ItemListPlugin { - OBJ_TYPE(ItemListOptionButtonPlugin,ItemListPlugin); + GDCLASS(ItemListOptionButtonPlugin,ItemListPlugin); OptionButton *ob; public: @@ -130,7 +130,7 @@ public: class ItemListPopupMenuPlugin : public ItemListPlugin { - OBJ_TYPE(ItemListPopupMenuPlugin,ItemListPlugin); + GDCLASS(ItemListPopupMenuPlugin,ItemListPlugin); PopupMenu *pp; public: @@ -171,7 +171,7 @@ public: class ItemListEditor : public HBoxContainer { - OBJ_TYPE(ItemListEditor,HBoxContainer); + GDCLASS(ItemListEditor,HBoxContainer); Node *item_list; @@ -209,7 +209,7 @@ public: class ItemListEditorPlugin : public EditorPlugin { - OBJ_TYPE(ItemListEditorPlugin,EditorPlugin); + GDCLASS(ItemListEditorPlugin,EditorPlugin); ItemListEditor *item_list_editor; EditorNode *editor; diff --git a/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp b/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp index 56e58bc983..f6a51632a0 100644 --- a/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp +++ b/tools/editor/plugins/light_occluder_2d_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -102,7 +102,7 @@ void LightOccluder2DEditor::_wip_close(bool p_closed) { edited_point=-1; } -bool LightOccluder2DEditor::forward_input_event(const InputEvent& p_event) { +bool LightOccluder2DEditor::forward_gui_input(const InputEvent& p_event) { if (!node) @@ -121,7 +121,7 @@ bool LightOccluder2DEditor::forward_input_event(const InputEvent& p_event) { const InputEventMouseButton &mb=p_event.mouse_button; - Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); + Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); Vector2 gpoint = Point2(mb.x,mb.y); @@ -132,7 +132,7 @@ bool LightOccluder2DEditor::forward_input_event(const InputEvent& p_event) { Vector<Vector2> poly = Variant(node->get_occluder_polygon()->get_polygon()); //first check if a point is to be added (segment split) - real_t grab_treshold=EDITOR_DEF("poly_editor/point_grab_radius",8); + real_t grab_treshold=EDITOR_DEF("editors/poly_editor/point_grab_radius",8); switch(mode) { @@ -361,7 +361,7 @@ void LightOccluder2DEditor::_canvas_draw() { poly=Variant(node->get_occluder_polygon()->get_polygon()); - Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); + Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); Ref<Texture> handle= get_icon("EditorHandle","EditorIcons"); for(int i=0;i<poly.size();i++) { @@ -427,10 +427,10 @@ void LightOccluder2DEditor::_create_poly() { void LightOccluder2DEditor::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_menu_option"),&LightOccluder2DEditor::_menu_option); - ObjectTypeDB::bind_method(_MD("_canvas_draw"),&LightOccluder2DEditor::_canvas_draw); - ObjectTypeDB::bind_method(_MD("_node_removed"),&LightOccluder2DEditor::_node_removed); - ObjectTypeDB::bind_method(_MD("_create_poly"),&LightOccluder2DEditor::_create_poly); + ClassDB::bind_method(_MD("_menu_option"),&LightOccluder2DEditor::_menu_option); + ClassDB::bind_method(_MD("_canvas_draw"),&LightOccluder2DEditor::_canvas_draw); + ClassDB::bind_method(_MD("_node_removed"),&LightOccluder2DEditor::_node_removed); + ClassDB::bind_method(_MD("_create_poly"),&LightOccluder2DEditor::_create_poly); } @@ -468,7 +468,7 @@ LightOccluder2DEditor::LightOccluder2DEditor(EditorNode *p_editor) { options->set_area_as_parent_rect(); options->set_text("Polygon"); //options->get_popup()->add_item("Parse BBCode",PARSE_BBCODE); - options->get_popup()->connect("item_pressed", this,"_menu_option"); + options->get_popup()->connect("id_pressed", this,"_menu_option"); #endif mode = MODE_EDIT; @@ -484,7 +484,7 @@ void LightOccluder2DEditorPlugin::edit(Object *p_object) { bool LightOccluder2DEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("LightOccluder2D"); + return p_object->is_class("LightOccluder2D"); } void LightOccluder2DEditorPlugin::make_visible(bool p_visible) { diff --git a/tools/editor/plugins/light_occluder_2d_editor_plugin.h b/tools/editor/plugins/light_occluder_2d_editor_plugin.h index 0176eb87dd..431c01fe75 100644 --- a/tools/editor/plugins/light_occluder_2d_editor_plugin.h +++ b/tools/editor/plugins/light_occluder_2d_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -44,7 +44,7 @@ class CanvasItemEditor; class LightOccluder2DEditor : public HBoxContainer { - OBJ_TYPE(LightOccluder2DEditor, HBoxContainer ); + GDCLASS(LightOccluder2DEditor, HBoxContainer ); UndoRedo *undo_redo; enum Mode { @@ -85,21 +85,21 @@ protected: public: Vector2 snap_point(const Vector2& p_point) const; - bool forward_input_event(const InputEvent& p_event); + bool forward_gui_input(const InputEvent& p_event); void edit(Node *p_collision_polygon); LightOccluder2DEditor(EditorNode *p_editor); }; class LightOccluder2DEditorPlugin : public EditorPlugin { - OBJ_TYPE( LightOccluder2DEditorPlugin, EditorPlugin ); + GDCLASS( LightOccluder2DEditorPlugin, EditorPlugin ); LightOccluder2DEditor *collision_polygon_editor; EditorNode *editor; public: - virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); } + virtual bool forward_canvas_gui_input(const Transform2D& p_canvas_xform,const InputEvent& p_event) { return collision_polygon_editor->forward_gui_input(p_event); } virtual String get_name() const { return "LightOccluder2D"; } bool has_main_screen() const { return false; } diff --git a/tools/editor/plugins/material_editor_plugin.cpp b/tools/editor/plugins/material_editor_plugin.cpp index 876fab0d6e..d5ddd3804b 100644 --- a/tools/editor/plugins/material_editor_plugin.cpp +++ b/tools/editor/plugins/material_editor_plugin.cpp @@ -1,7 +1,9 @@ #include "material_editor_plugin.h" #include "scene/main/viewport.h" -void MaterialEditor::_input_event(InputEvent p_event) { +#if 0 + +void MaterialEditor::_gui_input(InputEvent p_event) { } @@ -91,8 +93,8 @@ void MaterialEditor::_button_pressed(Node* p_button) { void MaterialEditor::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_input_event"),&MaterialEditor::_input_event); - ObjectTypeDB::bind_method(_MD("_button_pressed"),&MaterialEditor::_button_pressed); + ClassDB::bind_method(_MD("_gui_input"),&MaterialEditor::_gui_input); + ClassDB::bind_method(_MD("_button_pressed"),&MaterialEditor::_button_pressed); } @@ -127,8 +129,8 @@ MaterialEditor::MaterialEditor() { viewport->add_child(box_instance); Transform box_xform; - box_xform.basis.rotate(Vector3(1,0,0),Math::deg2rad(-25)); - box_xform.basis = box_xform.basis * Matrix3().rotated(Vector3(0,1,0),Math::deg2rad(-25)); + box_xform.basis.rotate(Vector3(1,0,0),Math::deg2rad(25)); + box_xform.basis = box_xform.basis * Matrix3().rotated(Vector3(0,1,0),Math::deg2rad(25)); box_xform.basis.scale(Vector3(0.8,0.8,0.8)); box_instance->set_transform(box_xform); @@ -141,10 +143,10 @@ MaterialEditor::MaterialEditor() { int lons=32; float radius=1.0; - DVector<Vector3> vertices; - DVector<Vector3> normals; - DVector<Vector2> uvs; - DVector<float> tangents; + PoolVector<Vector3> vertices; + PoolVector<Vector3> normals; + PoolVector<Vector2> uvs; + PoolVector<float> tangents; Matrix3 tt = Matrix3(Vector3(0,1,0),Math_PI*0.5); for(int i = 1; i <= lats; i++) { @@ -219,10 +221,10 @@ MaterialEditor::MaterialEditor() { box_mesh.instance(); - DVector<Vector3> vertices; - DVector<Vector3> normals; - DVector<float> tangents; - DVector<Vector3> uvs; + PoolVector<Vector3> vertices; + PoolVector<Vector3> normals; + PoolVector<float> tangents; + PoolVector<Vector3> uvs; int vtx_idx=0; #define ADD_VTX(m_idx);\ @@ -280,7 +282,7 @@ MaterialEditor::MaterialEditor() { d[VisualServer::ARRAY_TEX_UV]= uvs ; d[VisualServer::ARRAY_VERTEX]= vertices ; - DVector<int> indices; + PoolVector<int> indices; indices.resize(vertices.size()); for(int i=0;i<vertices.size();i++) indices.set(i,i); @@ -379,3 +381,4 @@ MaterialEditorPlugin::~MaterialEditorPlugin() } +#endif diff --git a/tools/editor/plugins/material_editor_plugin.h b/tools/editor/plugins/material_editor_plugin.h index 49e92493b3..556e56e66b 100644 --- a/tools/editor/plugins/material_editor_plugin.h +++ b/tools/editor/plugins/material_editor_plugin.h @@ -8,10 +8,10 @@ #include "scene/3d/mesh_instance.h" #include "scene/3d/camera.h" - +#if 0 class MaterialEditor : public Control { - OBJ_TYPE(MaterialEditor, Control); + GDCLASS(MaterialEditor, Control); Viewport *viewport; @@ -39,7 +39,7 @@ class MaterialEditor : public Control { protected: void _notification(int p_what); - void _input_event(InputEvent p_event); + void _gui_input(InputEvent p_event); static void _bind_methods(); public: @@ -50,7 +50,7 @@ public: class MaterialEditorPlugin : public EditorPlugin { - OBJ_TYPE( MaterialEditorPlugin, EditorPlugin ); + GDCLASS( MaterialEditorPlugin, EditorPlugin ); MaterialEditor *material_editor; EditorNode *editor; @@ -69,3 +69,4 @@ public: }; #endif // MATERIAL_EDITOR_PLUGIN_H +#endif diff --git a/tools/editor/plugins/mesh_editor_plugin.cpp b/tools/editor/plugins/mesh_editor_plugin.cpp index b70cbad25f..db96a60808 100644 --- a/tools/editor/plugins/mesh_editor_plugin.cpp +++ b/tools/editor/plugins/mesh_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -28,7 +28,8 @@ /*************************************************************************/ #include "mesh_editor_plugin.h" -void MeshEditor::_input_event(InputEvent p_event) { +#if 0 +void MeshEditor::_gui_input(InputEvent p_event) { if (p_event.type==InputEvent::MOUSE_MOTION && p_event.mouse_motion.button_mask&BUTTON_MASK_LEFT) { @@ -81,8 +82,8 @@ void MeshEditor::_notification(int p_what) { void MeshEditor::_update_rotation() { Transform t; - t.basis.rotate(Vector3(0, 1, 0), rot_y); - t.basis.rotate(Vector3(1, 0, 0), rot_x); + t.basis.rotate(Vector3(0, 1, 0), -rot_y); + t.basis.rotate(Vector3(1, 0, 0), -rot_x); mesh_instance->set_transform(t); } @@ -135,8 +136,8 @@ void MeshEditor::_button_pressed(Node* p_button) { void MeshEditor::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_input_event"),&MeshEditor::_input_event); - ObjectTypeDB::bind_method(_MD("_button_pressed"),&MeshEditor::_button_pressed); + ClassDB::bind_method(_MD("_gui_input"),&MeshEditor::_gui_input); + ClassDB::bind_method(_MD("_button_pressed"),&MeshEditor::_button_pressed); } @@ -241,3 +242,4 @@ MeshEditorPlugin::MeshEditorPlugin(EditorNode *p_node) { MeshEditorPlugin::~MeshEditorPlugin() { } +#endif diff --git a/tools/editor/plugins/mesh_editor_plugin.h b/tools/editor/plugins/mesh_editor_plugin.h index 0715a96e74..136290ffd4 100644 --- a/tools/editor/plugins/mesh_editor_plugin.h +++ b/tools/editor/plugins/mesh_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -29,6 +29,8 @@ #ifndef MESH_EDITOR_PLUGIN_H #define MESH_EDITOR_PLUGIN_H +#if 0 + #include "tools/editor/editor_plugin.h" #include "tools/editor/editor_node.h" #include "scene/resources/material.h" @@ -38,7 +40,7 @@ class MeshEditor : public Control { - OBJ_TYPE(MeshEditor, Control); + GDCLASS(MeshEditor, Control); @@ -63,7 +65,7 @@ class MeshEditor : public Control { void _update_rotation(); protected: void _notification(int p_what); - void _input_event(InputEvent p_event); + void _gui_input(InputEvent p_event); static void _bind_methods(); public: @@ -74,7 +76,7 @@ public: class MeshEditorPlugin : public EditorPlugin { - OBJ_TYPE( MeshEditorPlugin, EditorPlugin ); + GDCLASS( MeshEditorPlugin, EditorPlugin ); MeshEditor *mesh_editor; EditorNode *editor; @@ -93,3 +95,4 @@ public: }; #endif // MESH_EDITOR_PLUGIN_H +#endif diff --git a/tools/editor/plugins/mesh_instance_editor_plugin.cpp b/tools/editor/plugins/mesh_instance_editor_plugin.cpp index c952feb1da..de29991057 100644 --- a/tools/editor/plugins/mesh_instance_editor_plugin.cpp +++ b/tools/editor/plugins/mesh_instance_editor_plugin.cpp @@ -189,7 +189,7 @@ void MeshInstanceEditor::_create_outline_mesh() { return; } - Ref<Mesh> mesho = mesh->create_outline(outline_size->get_val()); + Ref<Mesh> mesho = mesh->create_outline(outline_size->get_value()); if (mesho.is_null()) { err_dialog->set_text(TTR("Could not create outline!")); @@ -218,8 +218,8 @@ void MeshInstanceEditor::_create_outline_mesh() { void MeshInstanceEditor::_bind_methods() { - ObjectTypeDB::bind_method("_menu_option",&MeshInstanceEditor::_menu_option); - ObjectTypeDB::bind_method("_create_outline_mesh",&MeshInstanceEditor::_create_outline_mesh); + ClassDB::bind_method("_menu_option",&MeshInstanceEditor::_menu_option); + ClassDB::bind_method("_create_outline_mesh",&MeshInstanceEditor::_create_outline_mesh); } MeshInstanceEditor::MeshInstanceEditor() { @@ -241,7 +241,7 @@ MeshInstanceEditor::MeshInstanceEditor() { options->get_popup()->add_separator(); options->get_popup()->add_item(TTR("Create Outline Mesh.."),MENU_OPTION_CREATE_OUTLINE_MESH); - options->get_popup()->connect("item_pressed", this,"_menu_option"); + options->get_popup()->connect("id_pressed", this,"_menu_option"); outline_dialog = memnew( ConfirmationDialog ); outline_dialog->set_title(TTR("Create Outline Mesh")); @@ -249,13 +249,13 @@ MeshInstanceEditor::MeshInstanceEditor() { VBoxContainer *outline_dialog_vbc = memnew( VBoxContainer ); outline_dialog->add_child(outline_dialog_vbc); - outline_dialog->set_child_rect(outline_dialog_vbc); + //outline_dialog->set_child_rect(outline_dialog_vbc); outline_size = memnew( SpinBox ); outline_size->set_min(0.001); outline_size->set_max(1024); outline_size->set_step(0.001); - outline_size->set_val(0.05); + outline_size->set_value(0.05); outline_dialog_vbc->add_margin_child(TTR("Outline Size:"),outline_size); add_child(outline_dialog); @@ -274,7 +274,7 @@ void MeshInstanceEditorPlugin::edit(Object *p_object) { bool MeshInstanceEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("MeshInstance"); + return p_object->is_class("MeshInstance"); } void MeshInstanceEditorPlugin::make_visible(bool p_visible) { diff --git a/tools/editor/plugins/mesh_instance_editor_plugin.h b/tools/editor/plugins/mesh_instance_editor_plugin.h index a698cf382f..23dcbfc9b1 100644 --- a/tools/editor/plugins/mesh_instance_editor_plugin.h +++ b/tools/editor/plugins/mesh_instance_editor_plugin.h @@ -10,7 +10,7 @@ class MeshInstanceEditor : public Node { - OBJ_TYPE(MeshInstanceEditor, Node ); + GDCLASS(MeshInstanceEditor, Node ); enum Menu { @@ -48,7 +48,7 @@ public: class MeshInstanceEditorPlugin : public EditorPlugin { - OBJ_TYPE( MeshInstanceEditorPlugin, EditorPlugin ); + GDCLASS( MeshInstanceEditorPlugin, EditorPlugin ); MeshInstanceEditor *mesh_editor; EditorNode *editor; diff --git a/tools/editor/plugins/multimesh_editor_plugin.cpp b/tools/editor/plugins/multimesh_editor_plugin.cpp index 8a0c6b3fe8..cce1c52215 100644 --- a/tools/editor/plugins/multimesh_editor_plugin.cpp +++ b/tools/editor/plugins/multimesh_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -125,7 +125,7 @@ void MultiMeshEditor::_populate() { Transform geom_xform = node->get_global_transform().affine_inverse() * ss_instance->get_global_transform(); - DVector<Face3> geometry = ss_instance->get_faces(VisualInstance::FACES_SOLID); + PoolVector<Face3> geometry = ss_instance->get_faces(VisualInstance::FACES_SOLID); if (geometry.size()==0) { @@ -137,7 +137,7 @@ void MultiMeshEditor::_populate() { //make all faces local int gc = geometry.size(); - DVector<Face3>::Write w = geometry.write(); + PoolVector<Face3>::Write w = geometry.write(); for(int i=0;i<gc;i++) { for(int j=0;j<3;j++) { @@ -147,7 +147,7 @@ void MultiMeshEditor::_populate() { - w = DVector<Face3>::Write(); + w = PoolVector<Face3>::Write(); #if 0 node->get_multimesh()->set_instance_count(populate_amount->get_val()); node->populate_parent(populate_rotate_random->get_val(),populate_tilt_random->get_val(),populate_scale_random->get_val(),populate_scale->get_val()); @@ -164,12 +164,12 @@ void MultiMeshEditor::_populate() { ERR_FAIL_COND(!vi); #endif - DVector<Face3> faces = geometry; + PoolVector<Face3> faces = geometry; ERR_EXPLAIN(TTR("Parent has no solid faces to populate.")); int facecount=faces.size(); ERR_FAIL_COND(!facecount); - DVector<Face3>::Read r = faces.read(); + PoolVector<Face3>::Read r = faces.read(); @@ -193,22 +193,24 @@ void MultiMeshEditor::_populate() { Ref<MultiMesh> multimesh = memnew( MultiMesh ); multimesh->set_mesh(mesh); - int instance_count=populate_amount->get_val(); + int instance_count=populate_amount->get_value(); + multimesh->set_transform_format(MultiMesh::TRANSFORM_3D); + multimesh->set_color_format(MultiMesh::COLOR_NONE); multimesh->set_instance_count(instance_count); - float _tilt_random = populate_tilt_random->get_val(); - float _rotate_random = populate_rotate_random->get_val(); - float _scale_random = populate_scale_random->get_val(); - float _scale = populate_scale->get_val(); + float _tilt_random = populate_tilt_random->get_value(); + float _rotate_random = populate_rotate_random->get_value(); + float _scale_random = populate_scale_random->get_value(); + float _scale = populate_scale->get_value(); int axis = populate_axis->get_selected(); Transform axis_xform; if (axis==Vector3::AXIS_Z) { - axis_xform.rotate(Vector3(1,0,0),Math_PI*0.5); + axis_xform.rotate(Vector3(1,0,0),-Math_PI*0.5); } if (axis==Vector3::AXIS_X) { - axis_xform.rotate(Vector3(0,0,1),Math_PI*0.5); + axis_xform.rotate(Vector3(0,0,1),-Math_PI*0.5); } for(int i=0;i<instance_count;i++) { @@ -234,11 +236,12 @@ void MultiMeshEditor::_populate() { xform = xform * axis_xform; - Matrix3 post_xform; + Basis post_xform; + + post_xform.rotate(xform.basis.get_axis(1),-Math::random(-_rotate_random,_rotate_random)*Math_PI); + post_xform.rotate(xform.basis.get_axis(2),-Math::random(-_tilt_random,_tilt_random)*Math_PI); + post_xform.rotate(xform.basis.get_axis(0),-Math::random(-_tilt_random,_tilt_random)*Math_PI); - post_xform.rotate(xform.basis.get_axis(0),Math::random(-_tilt_random,_tilt_random)*Math_PI); - post_xform.rotate(xform.basis.get_axis(2),Math::random(-_tilt_random,_tilt_random)*Math_PI); - post_xform.rotate(xform.basis.get_axis(1),Math::random(-_rotate_random,_rotate_random)*Math_PI); xform.basis = post_xform * xform.basis; //xform.basis.orthonormalize(); @@ -247,10 +250,10 @@ void MultiMeshEditor::_populate() { multimesh->set_instance_transform(i,xform); - multimesh->set_instance_color(i,Color(1,1,1,1)); + } - multimesh->generate_aabb(); + node->set_multimesh(multimesh); @@ -281,11 +284,11 @@ void MultiMeshEditor::_menu_option(int p_option) { surface_source->set_text(".."); mesh_source->set_text(".."); populate_axis->select(1); - populate_rotate_random->set_val(0); - populate_tilt_random->set_val(0); - populate_scale_random->set_val(0); - populate_scale->set_val(1); - populate_amount->set_val(128); + populate_rotate_random->set_value(0); + populate_tilt_random->set_value(0); + populate_scale_random->set_value(0); + populate_scale->set_value(1); + populate_amount->set_value(128); _last_pp_node=node; } @@ -315,10 +318,10 @@ void MultiMeshEditor::_browse(bool p_source) { void MultiMeshEditor::_bind_methods() { - ObjectTypeDB::bind_method("_menu_option",&MultiMeshEditor::_menu_option); - ObjectTypeDB::bind_method("_populate",&MultiMeshEditor::_populate); - ObjectTypeDB::bind_method("_browsed",&MultiMeshEditor::_browsed); - ObjectTypeDB::bind_method("_browse",&MultiMeshEditor::_browse); + ClassDB::bind_method("_menu_option",&MultiMeshEditor::_menu_option); + ClassDB::bind_method("_populate",&MultiMeshEditor::_populate); + ClassDB::bind_method("_browsed",&MultiMeshEditor::_browsed); + ClassDB::bind_method("_browse",&MultiMeshEditor::_browse); } MultiMeshEditor::MultiMeshEditor() { @@ -331,7 +334,7 @@ MultiMeshEditor::MultiMeshEditor() { options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("MultiMeshInstance","EditorIcons")); options->get_popup()->add_item(TTR("Populate Surface")); - options->get_popup()->connect("item_pressed", this,"_menu_option"); + options->get_popup()->connect("id_pressed", this,"_menu_option"); populate_dialog = memnew( ConfirmationDialog ); populate_dialog->set_title(TTR("Populate MultiMesh")); @@ -339,7 +342,7 @@ MultiMeshEditor::MultiMeshEditor() { VBoxContainer *vbc = memnew( VBoxContainer ); populate_dialog->add_child(vbc); - populate_dialog->set_child_rect(vbc); + //populate_dialog->set_child_rect(vbc); HBoxContainer *hbc = memnew( HBoxContainer ); @@ -385,14 +388,16 @@ MultiMeshEditor::MultiMeshEditor() { populate_scale_random = memnew( SpinBox ); populate_scale_random->set_min(0); populate_scale_random->set_max(1); - populate_scale_random->set_val(0); + populate_scale_random->set_value(0); + populate_scale_random->set_step(0.01); vbc->add_margin_child(TTR("Random Scale:"),populate_scale_random); populate_scale = memnew( SpinBox ); populate_scale->set_min(0.001); populate_scale->set_max(4096); - populate_scale->set_val(1); + populate_scale->set_value(1); + populate_scale->set_step(0.01); vbc->add_margin_child(TTR("Scale:"),populate_scale); @@ -403,7 +408,7 @@ MultiMeshEditor::MultiMeshEditor() { populate_amount->set_end( Point2(5,237)); populate_amount->set_min(1); populate_amount->set_max(65536); - populate_amount->set_val(128); + populate_amount->set_value(128); vbc->add_margin_child(TTR("Amount:"),populate_amount); populate_dialog->get_ok()->set_text(TTR("Populate")); @@ -427,7 +432,7 @@ void MultiMeshEditorPlugin::edit(Object *p_object) { bool MultiMeshEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("MultiMeshInstance"); + return p_object->is_class("MultiMeshInstance"); } void MultiMeshEditorPlugin::make_visible(bool p_visible) { diff --git a/tools/editor/plugins/multimesh_editor_plugin.h b/tools/editor/plugins/multimesh_editor_plugin.h index 245da1eeb7..e322850238 100644 --- a/tools/editor/plugins/multimesh_editor_plugin.h +++ b/tools/editor/plugins/multimesh_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -40,7 +40,7 @@ class MultiMeshEditor : public Control { - OBJ_TYPE(MultiMeshEditor, Control ); + GDCLASS(MultiMeshEditor, Control ); friend class MultiMeshEditorPlugin; @@ -86,7 +86,7 @@ public: class MultiMeshEditorPlugin : public EditorPlugin { - OBJ_TYPE( MultiMeshEditorPlugin, EditorPlugin ); + GDCLASS( MultiMeshEditorPlugin, EditorPlugin ); MultiMeshEditor *multimesh_editor; EditorNode *editor; diff --git a/tools/editor/plugins/navigation_polygon_editor_plugin.cpp b/tools/editor/plugins/navigation_polygon_editor_plugin.cpp index 22546c72f3..b2d62af7bb 100644 --- a/tools/editor/plugins/navigation_polygon_editor_plugin.cpp +++ b/tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -116,7 +116,7 @@ void NavigationPolygonEditor::_wip_close() { edited_point=-1; } -bool NavigationPolygonEditor::forward_input_event(const InputEvent& p_event) { +bool NavigationPolygonEditor::forward_gui_input(const InputEvent& p_event) { if (!node) @@ -137,7 +137,7 @@ bool NavigationPolygonEditor::forward_input_event(const InputEvent& p_event) { const InputEventMouseButton &mb=p_event.mouse_button; - Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); + Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); Vector2 gpoint = Point2(mb.x,mb.y); @@ -148,7 +148,7 @@ bool NavigationPolygonEditor::forward_input_event(const InputEvent& p_event) { //first check if a point is to be added (segment split) - real_t grab_treshold=EDITOR_DEF("poly_editor/point_grab_radius",8); + real_t grab_treshold=EDITOR_DEF("editors/poly_editor/point_grab_radius",8); switch(mode) { @@ -211,10 +211,10 @@ bool NavigationPolygonEditor::forward_input_event(const InputEvent& p_event) { for(int j=0;j<node->get_navigation_polygon()->get_outline_count();j++) { - DVector<Vector2> points=node->get_navigation_polygon()->get_outline(j); + PoolVector<Vector2> points=node->get_navigation_polygon()->get_outline(j); int pc=points.size(); - DVector<Vector2>::Read poly=points.read(); + PoolVector<Vector2>::Read poly=points.read(); for(int i=0;i<pc;i++) { @@ -240,7 +240,7 @@ bool NavigationPolygonEditor::forward_input_event(const InputEvent& p_event) { if (closest_idx>=0) { pre_move_edit=node->get_navigation_polygon()->get_outline(closest_outline); - DVector<Point2> poly = pre_move_edit; + PoolVector<Point2> poly = pre_move_edit; poly.insert(closest_idx+1,xform.affine_inverse().xform(closest_pos)); edited_point=closest_idx+1; edited_outline=closest_outline; @@ -260,10 +260,10 @@ bool NavigationPolygonEditor::forward_input_event(const InputEvent& p_event) { for(int j=0;j<node->get_navigation_polygon()->get_outline_count();j++) { - DVector<Vector2> points=node->get_navigation_polygon()->get_outline(j); + PoolVector<Vector2> points=node->get_navigation_polygon()->get_outline(j); int pc=points.size(); - DVector<Vector2>::Read poly=points.read(); + PoolVector<Vector2>::Read poly=points.read(); for(int i=0;i<pc;i++) { @@ -296,7 +296,7 @@ bool NavigationPolygonEditor::forward_input_event(const InputEvent& p_event) { //apply - DVector<Vector2> poly = node->get_navigation_polygon()->get_outline(edited_outline); + PoolVector<Vector2> poly = node->get_navigation_polygon()->get_outline(edited_outline); ERR_FAIL_INDEX_V(edited_point,poly.size(),false); poly.set(edited_point,edited_point_pos); undo_redo->create_action(TTR("Edit Poly")); @@ -322,10 +322,10 @@ bool NavigationPolygonEditor::forward_input_event(const InputEvent& p_event) { for(int j=0;j<node->get_navigation_polygon()->get_outline_count();j++) { - DVector<Vector2> points=node->get_navigation_polygon()->get_outline(j); + PoolVector<Vector2> points=node->get_navigation_polygon()->get_outline(j); int pc=points.size(); - DVector<Vector2>::Read poly=points.read(); + PoolVector<Vector2>::Read poly=points.read(); for(int i=0;i<pc;i++) { @@ -345,7 +345,7 @@ bool NavigationPolygonEditor::forward_input_event(const InputEvent& p_event) { if (closest_idx>=0) { - DVector<Vector2> poly = node->get_navigation_polygon()->get_outline(closest_outline); + PoolVector<Vector2> poly = node->get_navigation_polygon()->get_outline(closest_outline); if (poly.size()>3) { undo_redo->create_action(TTR("Edit Poly (Remove Point)")); @@ -411,7 +411,7 @@ void NavigationPolygonEditor::_canvas_draw() { if (node->get_navigation_polygon().is_null()) return; - Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); + Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); Ref<Texture> handle= get_icon("EditorHandle","EditorIcons"); @@ -477,10 +477,10 @@ void NavigationPolygonEditor::edit(Node *p_collision_polygon) { void NavigationPolygonEditor::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_menu_option"),&NavigationPolygonEditor::_menu_option); - ObjectTypeDB::bind_method(_MD("_canvas_draw"),&NavigationPolygonEditor::_canvas_draw); - ObjectTypeDB::bind_method(_MD("_node_removed"),&NavigationPolygonEditor::_node_removed); - ObjectTypeDB::bind_method(_MD("_create_nav"),&NavigationPolygonEditor::_create_nav); + ClassDB::bind_method(_MD("_menu_option"),&NavigationPolygonEditor::_menu_option); + ClassDB::bind_method(_MD("_canvas_draw"),&NavigationPolygonEditor::_canvas_draw); + ClassDB::bind_method(_MD("_node_removed"),&NavigationPolygonEditor::_node_removed); + ClassDB::bind_method(_MD("_create_nav"),&NavigationPolygonEditor::_create_nav); } @@ -515,7 +515,7 @@ NavigationPolygonEditor::NavigationPolygonEditor(EditorNode *p_editor) { options->set_area_as_parent_rect(); options->set_text("Polygon"); //options->get_popup()->add_item("Parse BBCode",PARSE_BBCODE); - options->get_popup()->connect("item_pressed", this,"_menu_option"); + options->get_popup()->connect("id_pressed", this,"_menu_option"); #endif mode = MODE_EDIT; @@ -532,7 +532,7 @@ void NavigationPolygonEditorPlugin::edit(Object *p_object) { bool NavigationPolygonEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("NavigationPolygonInstance"); + return p_object->is_class("NavigationPolygonInstance"); } void NavigationPolygonEditorPlugin::make_visible(bool p_visible) { diff --git a/tools/editor/plugins/navigation_polygon_editor_plugin.h b/tools/editor/plugins/navigation_polygon_editor_plugin.h index defdebbec2..50df4df744 100644 --- a/tools/editor/plugins/navigation_polygon_editor_plugin.h +++ b/tools/editor/plugins/navigation_polygon_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -44,7 +44,7 @@ class CanvasItemEditor; class NavigationPolygonEditor : public HBoxContainer { - OBJ_TYPE(NavigationPolygonEditor, HBoxContainer ); + GDCLASS(NavigationPolygonEditor, HBoxContainer ); UndoRedo *undo_redo; enum Mode { @@ -70,7 +70,7 @@ class NavigationPolygonEditor : public HBoxContainer { int edited_outline; int edited_point; Vector2 edited_point_pos; - DVector<Vector2> pre_move_edit; + PoolVector<Vector2> pre_move_edit; Vector<Vector2> wip; bool wip_active; @@ -87,21 +87,21 @@ protected: static void _bind_methods(); public: - bool forward_input_event(const InputEvent& p_event); + bool forward_gui_input(const InputEvent& p_event); void edit(Node *p_collision_polygon); NavigationPolygonEditor(EditorNode *p_editor); }; class NavigationPolygonEditorPlugin : public EditorPlugin { - OBJ_TYPE( NavigationPolygonEditorPlugin, EditorPlugin ); + GDCLASS( NavigationPolygonEditorPlugin, EditorPlugin ); NavigationPolygonEditor *collision_polygon_editor; EditorNode *editor; public: - virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); } + virtual bool forward_canvas_gui_input(const Transform2D& p_canvas_xform,const InputEvent& p_event) { return collision_polygon_editor->forward_gui_input(p_event); } virtual String get_name() const { return "NavigationPolygonInstance"; } bool has_main_screen() const { return false; } diff --git a/tools/editor/plugins/particles_2d_editor_plugin.cpp b/tools/editor/plugins/particles_2d_editor_plugin.cpp index ce25f34c1f..331a958518 100644 --- a/tools/editor/plugins/particles_2d_editor_plugin.cpp +++ b/tools/editor/plugins/particles_2d_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -43,7 +43,7 @@ void Particles2DEditorPlugin::edit(Object *p_object) { bool Particles2DEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("Particles2D"); + return p_object->is_class("Particles2D"); } void Particles2DEditorPlugin::make_visible(bool p_visible) { @@ -62,20 +62,20 @@ void Particles2DEditorPlugin::_file_selected(const String& p_file) { print_line("file: "+p_file); - int epc=epoints->get_val(); + int epc=epoints->get_value(); Image img; Error err = ImageLoader::load_image(p_file,&img); ERR_EXPLAIN(TTR("Error loading image:")+" "+p_file); ERR_FAIL_COND(err!=OK); - img.convert(Image::FORMAT_GRAYSCALE_ALPHA); - ERR_FAIL_COND(img.get_format()!=Image::FORMAT_GRAYSCALE_ALPHA); + img.convert(Image::FORMAT_LA8); + ERR_FAIL_COND(img.get_format()!=Image::FORMAT_LA8); Size2i s = Size2(img.get_width(),img.get_height()); ERR_FAIL_COND(s.width==0 || s.height==0); - DVector<uint8_t> data = img.get_data(); - DVector<uint8_t>::Read r = data.read(); + PoolVector<uint8_t> data = img.get_data(); + PoolVector<uint8_t>::Read r = data.read(); Vector<Point2i> valid_positions; valid_positions.resize(s.width*s.height); @@ -95,9 +95,9 @@ void Particles2DEditorPlugin::_file_selected(const String& p_file) { ERR_EXPLAIN(TTR("No pixels with transparency > 128 in image..")); ERR_FAIL_COND(valid_positions.size()==0); - DVector<Point2> epoints; + PoolVector<Point2> epoints; epoints.resize(epc); - DVector<Point2>::Write w = epoints.write(); + PoolVector<Point2>::Write w = epoints.write(); Size2 extents = Size2(img.get_width()*0.5,img.get_height()*0.5); @@ -108,7 +108,7 @@ void Particles2DEditorPlugin::_file_selected(const String& p_file) { w[i]=p/extents; } - w = DVector<Point2>::Write(); + w = PoolVector<Point2>::Write(); undo_redo->create_action(TTR("Set Emission Mask")); undo_redo->add_do_method(particles,"set_emission_points",epoints); @@ -131,7 +131,7 @@ void Particles2DEditorPlugin::_menu_callback(int p_idx) { case MENU_CLEAR_EMISSION_MASK: { undo_redo->create_action(TTR("Clear Emission Mask")); - undo_redo->add_do_method(particles,"set_emission_points",DVector<Vector2>()); + undo_redo->add_do_method(particles,"set_emission_points",PoolVector<Vector2>()); undo_redo->add_undo_method(particles,"set_emission_points",particles->get_emission_points()); undo_redo->commit_action(); } break; @@ -144,7 +144,7 @@ void Particles2DEditorPlugin::_notification(int p_what) { if (p_what==NOTIFICATION_ENTER_TREE) { - menu->get_popup()->connect("item_pressed",this,"_menu_callback"); + menu->get_popup()->connect("id_pressed",this,"_menu_callback"); menu->set_icon(menu->get_popup()->get_icon("Particles2D","EditorIcons")); file->connect("file_selected",this,"_file_selected"); } @@ -152,8 +152,8 @@ void Particles2DEditorPlugin::_notification(int p_what) { void Particles2DEditorPlugin::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_menu_callback"),&Particles2DEditorPlugin::_menu_callback); - ObjectTypeDB::bind_method(_MD("_file_selected"),&Particles2DEditorPlugin::_file_selected); + ClassDB::bind_method(_MD("_menu_callback"),&Particles2DEditorPlugin::_menu_callback); + ClassDB::bind_method(_MD("_file_selected"),&Particles2DEditorPlugin::_file_selected); } @@ -189,7 +189,7 @@ Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) { epoints->set_min(1); epoints->set_max(8192); epoints->set_step(1); - epoints->set_val(512); + epoints->set_value(512); file->get_vbox()->add_margin_child(TTR("Generated Point Count:"),epoints); } diff --git a/tools/editor/plugins/particles_2d_editor_plugin.h b/tools/editor/plugins/particles_2d_editor_plugin.h index ce2056b482..c532a5fe73 100644 --- a/tools/editor/plugins/particles_2d_editor_plugin.h +++ b/tools/editor/plugins/particles_2d_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,7 +39,7 @@ class Particles2DEditorPlugin : public EditorPlugin { - OBJ_TYPE( Particles2DEditorPlugin, EditorPlugin ); + GDCLASS( Particles2DEditorPlugin, EditorPlugin ); enum { diff --git a/tools/editor/plugins/particles_editor_plugin.cpp b/tools/editor/plugins/particles_editor_plugin.cpp index 7e20cc3f54..382dc29c61 100644 --- a/tools/editor/plugins/particles_editor_plugin.cpp +++ b/tools/editor/plugins/particles_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -26,6 +26,8 @@ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ + +#if 0 #include "particles_editor_plugin.h" #include "io/resource_loader.h" #include "servers/visual/particle_system_sw.h" @@ -75,7 +77,7 @@ void ParticlesEditor::_node_selected(const NodePath& p_path){ Transform geom_xform = node->get_global_transform().affine_inverse() * vi->get_global_transform(); int gc = geometry.size(); - DVector<Face3>::Write w = geometry.write(); + PoolVector<Face3>::Write w = geometry.write(); for(int i=0;i<gc;i++) { @@ -85,7 +87,7 @@ void ParticlesEditor::_node_selected(const NodePath& p_path){ } - w = DVector<Face3>::Write(); + w = PoolVector<Face3>::Write(); emission_dialog->popup_centered(Size2(300,130)); } @@ -200,7 +202,7 @@ void ParticlesEditor::edit(Particles *p_particles) { void ParticlesEditor::_generate_emission_points() { /// hacer codigo aca - DVector<Vector3> points; + PoolVector<Vector3> points; if (emission_fill->get_selected()==0) { @@ -254,7 +256,7 @@ void ParticlesEditor::_generate_emission_points() { return; } - DVector<Face3>::Read r = geometry.read(); + PoolVector<Face3>::Read r = geometry.read(); AABB aabb; @@ -330,12 +332,12 @@ void ParticlesEditor::_generate_emission_points() { void ParticlesEditor::_bind_methods() { - ObjectTypeDB::bind_method("_menu_option",&ParticlesEditor::_menu_option); - ObjectTypeDB::bind_method("_resource_seleted",&ParticlesEditor::_resource_seleted); - ObjectTypeDB::bind_method("_node_selected",&ParticlesEditor::_node_selected); - ObjectTypeDB::bind_method("_generate_emission_points",&ParticlesEditor::_generate_emission_points); + ClassDB::bind_method("_menu_option",&ParticlesEditor::_menu_option); + ClassDB::bind_method("_resource_seleted",&ParticlesEditor::_resource_seleted); + ClassDB::bind_method("_node_selected",&ParticlesEditor::_node_selected); + ClassDB::bind_method("_generate_emission_points",&ParticlesEditor::_generate_emission_points); - //ObjectTypeDB::bind_method("_populate",&ParticlesEditor::_populate); + //ClassDB::bind_method("_populate",&ParticlesEditor::_populate); } @@ -354,7 +356,7 @@ ParticlesEditor::ParticlesEditor() { options->get_popup()->add_item(TTR("Create Emitter From Node"),MENU_OPTION_CREATE_EMISSION_VOLUME_FROM_NODE); options->get_popup()->add_item(TTR("Clear Emitter"),MENU_OPTION_CLEAR_EMISSION_VOLUME); - options->get_popup()->connect("item_pressed", this,"_menu_option"); + options->get_popup()->connect("id_pressed", this,"_menu_option"); emission_dialog = memnew( ConfirmationDialog ); emission_dialog->set_title(TTR("Create Emitter")); @@ -456,3 +458,4 @@ ParticlesEditorPlugin::~ParticlesEditorPlugin() } +#endif diff --git a/tools/editor/plugins/particles_editor_plugin.h b/tools/editor/plugins/particles_editor_plugin.h index ff80bffc29..c32fbe5ada 100644 --- a/tools/editor/plugins/particles_editor_plugin.h +++ b/tools/editor/plugins/particles_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,10 +37,10 @@ /** @author Juan Linietsky <reduzio@gmail.com> */ - +#if 0 class ParticlesEditor : public Control { - OBJ_TYPE(ParticlesEditor, Control ); + GDCLASS(ParticlesEditor, Control ); Panel *panel; MenuButton *options; @@ -69,7 +69,7 @@ class ParticlesEditor : public Control { }; - DVector<Face3> geometry; + PoolVector<Face3> geometry; void _generate_emission_points(); void _resource_seleted(const String& p_res); @@ -94,7 +94,7 @@ public: class ParticlesEditorPlugin : public EditorPlugin { - OBJ_TYPE( ParticlesEditorPlugin, EditorPlugin ); + GDCLASS( ParticlesEditorPlugin, EditorPlugin ); ParticlesEditor *particles_editor; EditorNode *editor; @@ -113,3 +113,4 @@ public: }; #endif // PARTICLES_EDITOR_PLUGIN_H +#endif diff --git a/tools/editor/plugins/path_2d_editor_plugin.cpp b/tools/editor/plugins/path_2d_editor_plugin.cpp index 95f330a1d5..69be969c51 100644 --- a/tools/editor/plugins/path_2d_editor_plugin.cpp +++ b/tools/editor/plugins/path_2d_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -62,7 +62,7 @@ void Path2DEditor::_node_removed(Node *p_node) { } -bool Path2DEditor::forward_input_event(const InputEvent& p_event) { +bool Path2DEditor::forward_gui_input(const InputEvent& p_event) { if (!node) return false; @@ -79,14 +79,14 @@ bool Path2DEditor::forward_input_event(const InputEvent& p_event) { const InputEventMouseButton &mb=p_event.mouse_button; - Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); + Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); Vector2 gpoint = Point2(mb.x,mb.y); Vector2 cpoint = !mb.mod.alt? canvas_item_editor->snap_point(xform.affine_inverse().xform(gpoint)) : node->get_global_transform().affine_inverse().xform( canvas_item_editor->snap_point(canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint)) ); //first check if a point is to be added (segment split) - real_t grab_treshold=EDITOR_DEF("poly_editor/point_grab_radius",8); + real_t grab_treshold=EDITOR_DEF("editors/poly_editor/point_grab_radius",8); @@ -421,7 +421,7 @@ bool Path2DEditor::forward_input_event(const InputEvent& p_event) { if ( action!=ACTION_NONE) { - Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); + Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); Vector2 gpoint = Point2(mm.x,mm.y); Vector2 cpoint = !mm.mod.alt? canvas_item_editor->snap_point(xform.affine_inverse().xform(gpoint)) : node->get_global_transform().affine_inverse().xform( canvas_item_editor->snap_point(canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint)) ); @@ -481,7 +481,7 @@ void Path2DEditor::_canvas_draw() { if (!node->get_curve().is_valid()) return ; - Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); + Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); Ref<Texture> handle= get_icon("EditorHandle","EditorIcons"); Size2 handle_size = handle->get_size(); @@ -550,10 +550,10 @@ void Path2DEditor::edit(Node *p_path2d) { void Path2DEditor::_bind_methods() { - //ObjectTypeDB::bind_method(_MD("_menu_option"),&Path2DEditor::_menu_option); - ObjectTypeDB::bind_method(_MD("_canvas_draw"),&Path2DEditor::_canvas_draw); - ObjectTypeDB::bind_method(_MD("_node_visibility_changed"),&Path2DEditor::_node_visibility_changed); - ObjectTypeDB::bind_method(_MD("_mode_selected"),&Path2DEditor::_mode_selected); + //ClassDB::bind_method(_MD("_menu_option"),&Path2DEditor::_menu_option); + ClassDB::bind_method(_MD("_canvas_draw"),&Path2DEditor::_canvas_draw); + ClassDB::bind_method(_MD("_node_visibility_changed"),&Path2DEditor::_node_visibility_changed); + ClassDB::bind_method(_MD("_mode_selected"),&Path2DEditor::_mode_selected); } void Path2DEditor::_mode_selected(int p_mode) { @@ -624,7 +624,7 @@ Path2DEditor::Path2DEditor(EditorNode *p_editor) { options->set_area_as_parent_rect(); options->set_text("Polygon"); //options->get_popup()->add_item("Parse BBCode",PARSE_BBCODE); - options->get_popup()->connect("item_pressed", this,"_menu_option"); + options->get_popup()->connect("id_pressed", this,"_menu_option"); #endif base_hb = memnew( HBoxContainer ); @@ -683,7 +683,7 @@ void Path2DEditorPlugin::edit(Object *p_object) { bool Path2DEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("Path2D"); + return p_object->is_class("Path2D"); } void Path2DEditorPlugin::make_visible(bool p_visible) { diff --git a/tools/editor/plugins/path_2d_editor_plugin.h b/tools/editor/plugins/path_2d_editor_plugin.h index acbc481e09..aa940e4edf 100644 --- a/tools/editor/plugins/path_2d_editor_plugin.h +++ b/tools/editor/plugins/path_2d_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -42,7 +42,7 @@ class CanvasItemEditor; class Path2DEditor : public HBoxContainer { - OBJ_TYPE(Path2DEditor, HBoxContainer); + GDCLASS(Path2DEditor, HBoxContainer); UndoRedo *undo_redo; @@ -94,21 +94,21 @@ protected: static void _bind_methods(); public: - bool forward_input_event(const InputEvent& p_event); + bool forward_gui_input(const InputEvent& p_event); void edit(Node *p_path2d); Path2DEditor(EditorNode *p_editor); }; class Path2DEditorPlugin : public EditorPlugin { - OBJ_TYPE( Path2DEditorPlugin, EditorPlugin ); + GDCLASS( Path2DEditorPlugin, EditorPlugin ); Path2DEditor *path2d_editor; EditorNode *editor; public: - virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return path2d_editor->forward_input_event(p_event); } + virtual bool forward_canvas_gui_input(const Transform2D& p_canvas_xform,const InputEvent& p_event) { return path2d_editor->forward_gui_input(p_event); } virtual String get_name() const { return "Path2D"; } bool has_main_screen() const { return false; } diff --git a/tools/editor/plugins/path_editor_plugin.cpp b/tools/editor/plugins/path_editor_plugin.cpp index 33ef71efab..a69de2e78d 100644 --- a/tools/editor/plugins/path_editor_plugin.cpp +++ b/tools/editor/plugins/path_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -31,6 +31,7 @@ #include "scene/resources/curve.h" #include "os/keyboard.h" +#if 0 String PathSpatialGizmo::get_handle_name(int p_idx) const { Ref<Curve3D> c = path->get_curve(); @@ -103,6 +104,12 @@ void PathSpatialGizmo::set_handle(int p_idx,Camera *p_camera, const Point2& p_po if (p.intersects_ray(ray_from,ray_dir,&inters)) { + if(SpatialEditor::get_singleton()->is_snap_enabled()) + { + float snap = SpatialEditor::get_singleton()->get_translate_snap(); + inters.snap(snap); + } + Vector3 local = gi.xform(inters); c->set_point_pos(p_idx,local); } @@ -278,7 +285,7 @@ Ref<SpatialEditorGizmo> PathEditorPlugin::create_spatial_gizmo(Spatial* p_spatia return Ref<SpatialEditorGizmo>(); } -bool PathEditorPlugin::forward_spatial_input_event(Camera* p_camera,const InputEvent& p_event) { +bool PathEditorPlugin::forward_spatial_gui_input(Camera* p_camera,const InputEvent& p_event) { if (!path) return false; @@ -509,8 +516,8 @@ void PathEditorPlugin::_notification(int p_what) { void PathEditorPlugin::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_mode_changed"),&PathEditorPlugin::_mode_changed); - ObjectTypeDB::bind_method(_MD("_close_curve"),&PathEditorPlugin::_close_curve); + ClassDB::bind_method(_MD("_mode_changed"),&PathEditorPlugin::_mode_changed); + ClassDB::bind_method(_MD("_close_curve"),&PathEditorPlugin::_close_curve); } PathEditorPlugin* PathEditorPlugin::singleton=NULL; @@ -522,16 +529,16 @@ PathEditorPlugin::PathEditorPlugin(EditorNode *p_node) { editor=p_node; singleton=this; - path_material = Ref<FixedMaterial>( memnew( FixedMaterial )); - path_material->set_parameter( FixedMaterial::PARAM_DIFFUSE,Color(0.5,0.5,1.0,0.8) ); - path_material->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true); + path_material = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial )); + path_material->set_parameter( FixedSpatialMaterial::PARAM_DIFFUSE,Color(0.5,0.5,1.0,0.8) ); + path_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA, true); path_material->set_line_width(3); path_material->set_flag(Material::FLAG_DOUBLE_SIDED,true); path_material->set_flag(Material::FLAG_UNSHADED,true); - path_thin_material = Ref<FixedMaterial>( memnew( FixedMaterial )); - path_thin_material->set_parameter( FixedMaterial::PARAM_DIFFUSE,Color(0.5,0.5,1.0,0.4) ); - path_thin_material->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true); + path_thin_material = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial )); + path_thin_material->set_parameter( FixedSpatialMaterial::PARAM_DIFFUSE,Color(0.5,0.5,1.0,0.4) ); + path_thin_material->set_fixed_flag(FixedSpatialMaterial::FLAG_USE_ALPHA, true); path_thin_material->set_line_width(1); path_thin_material->set_flag(Material::FLAG_DOUBLE_SIDED,true); path_thin_material->set_flag(Material::FLAG_UNSHADED,true); @@ -593,3 +600,4 @@ PathEditorPlugin::~PathEditorPlugin() { } +#endif diff --git a/tools/editor/plugins/path_editor_plugin.h b/tools/editor/plugins/path_editor_plugin.h index 0afd957af7..e446dfa7c7 100644 --- a/tools/editor/plugins/path_editor_plugin.h +++ b/tools/editor/plugins/path_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -32,9 +32,10 @@ #include "tools/editor/spatial_editor_gizmos.h" #include "scene/3d/path.h" +# if 0 class PathSpatialGizmo : public EditorSpatialGizmo { - OBJ_TYPE(PathSpatialGizmo,EditorSpatialGizmo); + GDCLASS(PathSpatialGizmo,EditorSpatialGizmo); Path* path; mutable Vector3 original; @@ -53,7 +54,7 @@ public: class PathEditorPlugin : public EditorPlugin { - OBJ_TYPE( PathEditorPlugin, EditorPlugin ); + GDCLASS( PathEditorPlugin, EditorPlugin ); Separator *sep; @@ -78,11 +79,11 @@ public: Path *get_edited_path() { return path; } static PathEditorPlugin* singleton; - Ref<FixedMaterial> path_material; - Ref<FixedMaterial> path_thin_material; - virtual bool forward_spatial_input_event(Camera* p_camera,const InputEvent& p_event); + Ref<FixedSpatialMaterial> path_material; + Ref<FixedSpatialMaterial> path_thin_material; + virtual bool forward_spatial_gui_input(Camera* p_camera,const InputEvent& p_event); -// virtual bool forward_input_event(const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); } +// virtual bool forward_gui_input(const InputEvent& p_event) { return collision_polygon_editor->forward_gui_input(p_event); } virtual Ref<SpatialEditorGizmo> create_spatial_gizmo(Spatial* p_spatial); virtual String get_name() const { return "Path"; } bool has_main_screen() const { return false; } @@ -95,5 +96,5 @@ public: }; - +#endif #endif // PATH_EDITOR_PLUGIN_H diff --git a/tools/editor/plugins/polygon_2d_editor_plugin.cpp b/tools/editor/plugins/polygon_2d_editor_plugin.cpp index 19d1ccc06f..ee625cf703 100644 --- a/tools/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/tools/editor/plugins/polygon_2d_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -102,8 +102,8 @@ void Polygon2DEditor::_menu_option(int p_option) { } - DVector<Vector2> points = node->get_polygon(); - DVector<Vector2> uvs = node->get_uv(); + PoolVector<Vector2> points = node->get_polygon(); + PoolVector<Vector2> uvs = node->get_uv(); if (uvs.size()!=points.size()) { undo_redo->create_action(TTR("Create UV Map")); undo_redo->add_do_method(node,"set_uv",points); @@ -119,10 +119,10 @@ void Polygon2DEditor::_menu_option(int p_option) { } break; case UVEDIT_POLYGON_TO_UV: { - DVector<Vector2> points = node->get_polygon(); + PoolVector<Vector2> points = node->get_polygon(); if (points.size()==0) break; - DVector<Vector2> uvs = node->get_uv(); + PoolVector<Vector2> uvs = node->get_uv(); undo_redo->create_action(TTR("Create UV Map")); undo_redo->add_do_method(node,"set_uv",points); undo_redo->add_undo_method(node,"set_uv",uvs); @@ -134,8 +134,8 @@ void Polygon2DEditor::_menu_option(int p_option) { } break; case UVEDIT_UV_TO_POLYGON: { - DVector<Vector2> points = node->get_polygon(); - DVector<Vector2> uvs = node->get_uv(); + PoolVector<Vector2> points = node->get_polygon(); + PoolVector<Vector2> uvs = node->get_uv(); if (uvs.size()==0) break; @@ -149,11 +149,11 @@ void Polygon2DEditor::_menu_option(int p_option) { } break; case UVEDIT_UV_CLEAR: { - DVector<Vector2> uvs = node->get_uv(); + PoolVector<Vector2> uvs = node->get_uv(); if (uvs.size()==0) break; undo_redo->create_action(TTR("Create UV Map")); - undo_redo->add_do_method(node,"set_uv",DVector<Vector2>()); + undo_redo->add_do_method(node,"set_uv",PoolVector<Vector2>()); undo_redo->add_undo_method(node,"set_uv",uvs); undo_redo->add_do_method(uv_edit_draw,"update"); undo_redo->add_undo_method(uv_edit_draw,"update"); @@ -216,7 +216,7 @@ void Polygon2DEditor::_wip_close() { edited_point=-1; } -bool Polygon2DEditor::forward_input_event(const InputEvent& p_event) { +bool Polygon2DEditor::forward_gui_input(const InputEvent& p_event) { if (node==NULL) return false; @@ -227,7 +227,7 @@ bool Polygon2DEditor::forward_input_event(const InputEvent& p_event) { const InputEventMouseButton &mb=p_event.mouse_button; - Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); + Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); Vector2 gpoint = Point2(mb.x,mb.y); @@ -239,7 +239,7 @@ bool Polygon2DEditor::forward_input_event(const InputEvent& p_event) { Vector<Vector2> poly = Variant(node->get_polygon()); //first check if a point is to be added (segment split) - real_t grab_treshold=EDITOR_DEF("poly_editor/point_grab_radius",8); + real_t grab_treshold=EDITOR_DEF("editors/poly_editor/point_grab_radius",8); switch(mode) { @@ -463,7 +463,7 @@ void Polygon2DEditor::_canvas_draw() { poly=Variant(node->get_polygon()); - Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); + Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform(); Ref<Texture> handle= get_icon("EditorHandle","EditorIcons"); for(int i=0;i<poly.size();i++) { @@ -499,7 +499,7 @@ void Polygon2DEditor::_uv_mode(int p_mode) { void Polygon2DEditor::_uv_input(const InputEvent& p_input) { - Matrix32 mtx; + Transform2D mtx; mtx.elements[2]=-uv_draw_ofs; mtx.scale_basis(Vector2(uv_draw_zoom,uv_draw_zoom)); @@ -567,10 +567,10 @@ void Polygon2DEditor::_uv_input(const InputEvent& p_input) { } else if (mb.button_index==BUTTON_WHEEL_UP && mb.pressed) { - uv_zoom->set_val( uv_zoom->get_val()/0.9 ); + uv_zoom->set_value( uv_zoom->get_value()/0.9 ); } else if (mb.button_index==BUTTON_WHEEL_DOWN && mb.pressed) { - uv_zoom->set_val( uv_zoom->get_val()*0.9); + uv_zoom->set_value( uv_zoom->get_value()*0.9); } } else if (p_input.type==InputEvent::MOUSE_MOTION) { @@ -580,8 +580,8 @@ void Polygon2DEditor::_uv_input(const InputEvent& p_input) { if (mm.button_mask&BUTTON_MASK_MIDDLE || Input::get_singleton()->is_key_pressed(KEY_SPACE)) { Vector2 drag(mm.relative_x,mm.relative_y); - uv_hscroll->set_val( uv_hscroll->get_val()-drag.x ); - uv_vscroll->set_val( uv_vscroll->get_val()-drag.y ); + uv_hscroll->set_value( uv_hscroll->get_value()-drag.x ); + uv_vscroll->set_value( uv_vscroll->get_value()-drag.y ); } else if (uv_drag) { @@ -593,13 +593,13 @@ void Polygon2DEditor::_uv_input(const InputEvent& p_input) { case UV_MODE_EDIT_POINT: { - DVector<Vector2> uv_new=uv_prev; + PoolVector<Vector2> uv_new=uv_prev; uv_new.set( uv_drag_index, uv_new[uv_drag_index]+drag ); node->set_uv(uv_new); } break; case UV_MODE_MOVE: { - DVector<Vector2> uv_new=uv_prev; + PoolVector<Vector2> uv_new=uv_prev; for(int i=0;i<uv_new.size();i++) uv_new.set( i, uv_new[i]+drag ); @@ -610,7 +610,7 @@ void Polygon2DEditor::_uv_input(const InputEvent& p_input) { case UV_MODE_ROTATE: { Vector2 center; - DVector<Vector2> uv_new=uv_prev; + PoolVector<Vector2> uv_new=uv_prev; for(int i=0;i<uv_new.size();i++) center+=uv_prev[i]; @@ -630,7 +630,7 @@ void Polygon2DEditor::_uv_input(const InputEvent& p_input) { case UV_MODE_SCALE: { Vector2 center; - DVector<Vector2> uv_new=uv_prev; + PoolVector<Vector2> uv_new=uv_prev; for(int i=0;i<uv_new.size();i++) center+=uv_prev[i]; @@ -668,9 +668,9 @@ void Polygon2DEditor::_uv_scroll_changed(float) { if (updating_uv_scroll) return; - uv_draw_ofs.x=uv_hscroll->get_val(); - uv_draw_ofs.y=uv_vscroll->get_val(); - uv_draw_zoom=uv_zoom->get_val(); + uv_draw_ofs.x=uv_hscroll->get_value(); + uv_draw_ofs.y=uv_vscroll->get_value(); + uv_draw_zoom=uv_zoom->get_value(); uv_edit_draw->update(); } @@ -680,14 +680,13 @@ void Polygon2DEditor::_uv_draw() { if (base_tex.is_null()) return; - Matrix32 mtx; + Transform2D mtx; mtx.elements[2]=-uv_draw_ofs; mtx.scale_basis(Vector2(uv_draw_zoom,uv_draw_zoom)); - VS::get_singleton()->canvas_item_set_clip(uv_edit_draw->get_canvas_item(),true); VS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(),mtx); uv_edit_draw->draw_texture(base_tex,Point2()); - VS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(),Matrix32()); + VS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(),Transform2D()); if (snap_show_grid) { Size2 s = uv_edit_draw->get_size(); @@ -716,7 +715,7 @@ void Polygon2DEditor::_uv_draw() { } } - DVector<Vector2> uvs = node->get_uv(); + PoolVector<Vector2> uvs = node->get_uv(); Ref<Texture> handle = get_icon("EditorHandle","EditorIcons"); Rect2 rect(Point2(),mtx.basis_xform(base_tex->get_size())); @@ -735,13 +734,13 @@ void Polygon2DEditor::_uv_draw() { uv_hscroll->set_min(rect.pos.x); uv_hscroll->set_max(rect.pos.x+rect.size.x); uv_hscroll->set_page(uv_edit_draw->get_size().x); - uv_hscroll->set_val(uv_draw_ofs.x); + uv_hscroll->set_value(uv_draw_ofs.x); uv_hscroll->set_step(0.001); uv_vscroll->set_min(rect.pos.y); uv_vscroll->set_max(rect.pos.y+rect.size.y); uv_vscroll->set_page(uv_edit_draw->get_size().y); - uv_vscroll->set_val(uv_draw_ofs.y); + uv_vscroll->set_value(uv_draw_ofs.y); uv_vscroll->set_step(0.001); updating_uv_scroll=false; @@ -776,19 +775,19 @@ void Polygon2DEditor::edit(Node *p_collision_polygon) { void Polygon2DEditor::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_menu_option"),&Polygon2DEditor::_menu_option); - ObjectTypeDB::bind_method(_MD("_canvas_draw"),&Polygon2DEditor::_canvas_draw); - ObjectTypeDB::bind_method(_MD("_uv_mode"),&Polygon2DEditor::_uv_mode); - ObjectTypeDB::bind_method(_MD("_uv_draw"),&Polygon2DEditor::_uv_draw); - ObjectTypeDB::bind_method(_MD("_uv_input"),&Polygon2DEditor::_uv_input); - ObjectTypeDB::bind_method(_MD("_uv_scroll_changed"),&Polygon2DEditor::_uv_scroll_changed); - ObjectTypeDB::bind_method(_MD("_node_removed"),&Polygon2DEditor::_node_removed); - ObjectTypeDB::bind_method(_MD("_set_use_snap"),&Polygon2DEditor::_set_use_snap); - ObjectTypeDB::bind_method(_MD("_set_show_grid"),&Polygon2DEditor::_set_show_grid); - ObjectTypeDB::bind_method(_MD("_set_snap_off_x"),&Polygon2DEditor::_set_snap_off_x); - ObjectTypeDB::bind_method(_MD("_set_snap_off_y"),&Polygon2DEditor::_set_snap_off_y); - ObjectTypeDB::bind_method(_MD("_set_snap_step_x"),&Polygon2DEditor::_set_snap_step_x); - ObjectTypeDB::bind_method(_MD("_set_snap_step_y"),&Polygon2DEditor::_set_snap_step_y); + ClassDB::bind_method(_MD("_menu_option"),&Polygon2DEditor::_menu_option); + ClassDB::bind_method(_MD("_canvas_draw"),&Polygon2DEditor::_canvas_draw); + ClassDB::bind_method(_MD("_uv_mode"),&Polygon2DEditor::_uv_mode); + ClassDB::bind_method(_MD("_uv_draw"),&Polygon2DEditor::_uv_draw); + ClassDB::bind_method(_MD("_uv_input"),&Polygon2DEditor::_uv_input); + ClassDB::bind_method(_MD("_uv_scroll_changed"),&Polygon2DEditor::_uv_scroll_changed); + ClassDB::bind_method(_MD("_node_removed"),&Polygon2DEditor::_node_removed); + ClassDB::bind_method(_MD("_set_use_snap"),&Polygon2DEditor::_set_use_snap); + ClassDB::bind_method(_MD("_set_show_grid"),&Polygon2DEditor::_set_show_grid); + ClassDB::bind_method(_MD("_set_snap_off_x"),&Polygon2DEditor::_set_snap_off_x); + ClassDB::bind_method(_MD("_set_snap_off_y"),&Polygon2DEditor::_set_snap_off_y); + ClassDB::bind_method(_MD("_set_snap_step_x"),&Polygon2DEditor::_set_snap_step_x); + ClassDB::bind_method(_MD("_set_snap_step_y"),&Polygon2DEditor::_set_snap_step_y); } @@ -840,7 +839,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { options->set_area_as_parent_rect(); options->set_text("Polygon"); //options->get_popup()->add_item("Parse BBCode",PARSE_BBCODE); - options->get_popup()->connect("item_pressed", this,"_menu_option"); + options->get_popup()->connect("id_pressed", this,"_menu_option"); #endif mode = MODE_EDIT; @@ -850,11 +849,11 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { uv_edit = memnew( AcceptDialog ); add_child(uv_edit); uv_edit->set_title(TTR("Polygon 2D UV Editor")); - uv_edit->set_self_opacity(0.9); + uv_edit->set_self_modulate(Color(1,1,1,0.9)); VBoxContainer *uv_main_vb = memnew( VBoxContainer ); uv_edit->add_child(uv_main_vb); - uv_edit->set_child_rect(uv_main_vb); + //uv_edit->set_child_rect(uv_main_vb); HBoxContainer *uv_mode_hb = memnew( HBoxContainer ); uv_main_vb->add_child(uv_mode_hb); for(int i=0;i<UV_MODE_MAX;i++) { @@ -885,7 +884,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { uv_menu->get_popup()->add_item(TTR("UV->Polygon"),UVEDIT_UV_TO_POLYGON); uv_menu->get_popup()->add_separator(); uv_menu->get_popup()->add_item(TTR("Clear UV"),UVEDIT_UV_CLEAR); - uv_menu->get_popup()->connect("item_pressed",this,"_menu_option"); + uv_menu->get_popup()->connect("id_pressed",this,"_menu_option"); uv_mode_hb->add_child( memnew( VSeparator )); @@ -914,7 +913,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { sb_off_x->set_min(-256); sb_off_x->set_max(256); sb_off_x->set_step(1); - sb_off_x->set_val(snap_offset.x); + sb_off_x->set_value(snap_offset.x); sb_off_x->set_suffix("px"); sb_off_x->connect("value_changed", this, "_set_snap_off_x"); uv_mode_hb->add_child(sb_off_x); @@ -923,7 +922,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { sb_off_y->set_min(-256); sb_off_y->set_max(256); sb_off_y->set_step(1); - sb_off_y->set_val(snap_offset.y); + sb_off_y->set_value(snap_offset.y); sb_off_y->set_suffix("px"); sb_off_y->connect("value_changed", this, "_set_snap_off_y"); uv_mode_hb->add_child(sb_off_y); @@ -935,7 +934,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { sb_step_x->set_min(-256); sb_step_x->set_max(256); sb_step_x->set_step(1); - sb_step_x->set_val(snap_step.x); + sb_step_x->set_value(snap_step.x); sb_step_x->set_suffix("px"); sb_step_x->connect("value_changed", this, "_set_snap_step_x"); uv_mode_hb->add_child(sb_step_x); @@ -944,7 +943,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { sb_step_y->set_min(-256); sb_step_y->set_max(256); sb_step_y->set_step(1); - sb_step_y->set_val(snap_step.y); + sb_step_y->set_value(snap_step.y); sb_step_y->set_suffix("px"); sb_step_y->connect("value_changed", this, "_set_snap_step_y"); uv_mode_hb->add_child(sb_step_y); @@ -955,7 +954,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { uv_zoom = memnew( HSlider ); uv_zoom->set_min(0.01); uv_zoom->set_max(4); - uv_zoom->set_val(1); + uv_zoom->set_value(1); uv_zoom->set_step(0.01); uv_mode_hb->add_child(uv_zoom); uv_zoom->set_custom_minimum_size(Size2(200,0)); @@ -975,7 +974,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { uv_hscroll->connect("value_changed",this,"_uv_scroll_changed"); uv_edit_draw->connect("draw",this,"_uv_draw"); - uv_edit_draw->connect("input_event",this,"_uv_input"); + uv_edit_draw->connect("gui_input",this,"_uv_input"); uv_draw_zoom=1.0; uv_drag_index=-1; uv_drag=false; @@ -984,6 +983,8 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { error = memnew( AcceptDialog); add_child(error); + uv_edit_draw->set_clip_contents(true); + } @@ -995,7 +996,7 @@ void Polygon2DEditorPlugin::edit(Object *p_object) { bool Polygon2DEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("Polygon2D"); + return p_object->is_class("Polygon2D"); } void Polygon2DEditorPlugin::make_visible(bool p_visible) { diff --git a/tools/editor/plugins/polygon_2d_editor_plugin.h b/tools/editor/plugins/polygon_2d_editor_plugin.h index 33bae94340..bff7f4c44c 100644 --- a/tools/editor/plugins/polygon_2d_editor_plugin.h +++ b/tools/editor/plugins/polygon_2d_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -42,7 +42,7 @@ class CanvasItemEditor; class Polygon2DEditor : public HBoxContainer { - OBJ_TYPE(Polygon2DEditor, HBoxContainer ); + GDCLASS(Polygon2DEditor, HBoxContainer ); UndoRedo *undo_redo; enum Mode { @@ -81,7 +81,7 @@ class Polygon2DEditor : public HBoxContainer { Vector2 uv_draw_ofs; float uv_draw_zoom; - DVector<Vector2> uv_prev; + PoolVector<Vector2> uv_prev; int uv_drag_index; bool uv_drag; UVMode uv_move_current; @@ -137,21 +137,21 @@ protected: public: - bool forward_input_event(const InputEvent& p_event); + bool forward_gui_input(const InputEvent& p_event); void edit(Node *p_collision_polygon); Polygon2DEditor(EditorNode *p_editor); }; class Polygon2DEditorPlugin : public EditorPlugin { - OBJ_TYPE( Polygon2DEditorPlugin, EditorPlugin ); + GDCLASS( Polygon2DEditorPlugin, EditorPlugin ); Polygon2DEditor *collision_polygon_editor; EditorNode *editor; public: - virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return collision_polygon_editor->forward_input_event(p_event); } + virtual bool forward_canvas_gui_input(const Transform2D& p_canvas_xform,const InputEvent& p_event) { return collision_polygon_editor->forward_gui_input(p_event); } virtual String get_name() const { return "Polygon2D"; } bool has_main_screen() const { return false; } diff --git a/tools/editor/plugins/resource_preloader_editor_plugin.cpp b/tools/editor/plugins/resource_preloader_editor_plugin.cpp index cce0ba3d62..fc6a548595 100644 --- a/tools/editor/plugins/resource_preloader_editor_plugin.cpp +++ b/tools/editor/plugins/resource_preloader_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -30,11 +30,11 @@ #include "io/resource_loader.h" #include "globals.h" #include "tools/editor/editor_settings.h" -#include "scene/resources/scene_preloader.h" -void ResourcePreloaderEditor::_input_event(InputEvent p_event) { + +void ResourcePreloaderEditor::_gui_input(InputEvent p_event) { } @@ -179,7 +179,7 @@ void ResourcePreloaderEditor::_paste_pressed() { if (name=="") name=r->get_path().get_file(); if (name=="") - name=r->get_type(); + name=r->get_class(); String basename = name; int counter=1; @@ -248,7 +248,7 @@ void ResourcePreloaderEditor::_update_library() { ERR_CONTINUE(r.is_null()); ti->set_tooltip(0,r->get_path()); - String type = r->get_type(); + String type = r->get_class(); ti->set_text(1,type); ti->set_selectable(1,false); @@ -381,19 +381,19 @@ void ResourcePreloaderEditor::drop_data_fw(const Point2& p_point,const Variant& void ResourcePreloaderEditor::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_input_event"),&ResourcePreloaderEditor::_input_event); - ObjectTypeDB::bind_method(_MD("_load_pressed"),&ResourcePreloaderEditor::_load_pressed); - ObjectTypeDB::bind_method(_MD("_item_edited"),&ResourcePreloaderEditor::_item_edited); - ObjectTypeDB::bind_method(_MD("_delete_pressed"),&ResourcePreloaderEditor::_delete_pressed); - ObjectTypeDB::bind_method(_MD("_paste_pressed"),&ResourcePreloaderEditor::_paste_pressed); - ObjectTypeDB::bind_method(_MD("_delete_confirm_pressed"),&ResourcePreloaderEditor::_delete_confirm_pressed); - ObjectTypeDB::bind_method(_MD("_files_load_request"),&ResourcePreloaderEditor::_files_load_request); - ObjectTypeDB::bind_method(_MD("_update_library"),&ResourcePreloaderEditor::_update_library); + ClassDB::bind_method(_MD("_gui_input"),&ResourcePreloaderEditor::_gui_input); + ClassDB::bind_method(_MD("_load_pressed"),&ResourcePreloaderEditor::_load_pressed); + ClassDB::bind_method(_MD("_item_edited"),&ResourcePreloaderEditor::_item_edited); + ClassDB::bind_method(_MD("_delete_pressed"),&ResourcePreloaderEditor::_delete_pressed); + ClassDB::bind_method(_MD("_paste_pressed"),&ResourcePreloaderEditor::_paste_pressed); + ClassDB::bind_method(_MD("_delete_confirm_pressed"),&ResourcePreloaderEditor::_delete_confirm_pressed); + ClassDB::bind_method(_MD("_files_load_request"),&ResourcePreloaderEditor::_files_load_request); + ClassDB::bind_method(_MD("_update_library"),&ResourcePreloaderEditor::_update_library); - ObjectTypeDB::bind_method(_MD("get_drag_data_fw"), &ResourcePreloaderEditor::get_drag_data_fw); - ObjectTypeDB::bind_method(_MD("can_drop_data_fw"), &ResourcePreloaderEditor::can_drop_data_fw); - ObjectTypeDB::bind_method(_MD("drop_data_fw"), &ResourcePreloaderEditor::drop_data_fw); + ClassDB::bind_method(_MD("get_drag_data_fw"), &ResourcePreloaderEditor::get_drag_data_fw); + ClassDB::bind_method(_MD("can_drop_data_fw"), &ResourcePreloaderEditor::can_drop_data_fw); + ClassDB::bind_method(_MD("drop_data_fw"), &ResourcePreloaderEditor::drop_data_fw); } @@ -462,7 +462,7 @@ void ResourcePreloaderEditorPlugin::edit(Object *p_object) { bool ResourcePreloaderEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("ResourcePreloader"); + return p_object->is_class("ResourcePreloader"); } void ResourcePreloaderEditorPlugin::make_visible(bool p_visible) { diff --git a/tools/editor/plugins/resource_preloader_editor_plugin.h b/tools/editor/plugins/resource_preloader_editor_plugin.h index 4f0cb4be37..6990301ded 100644 --- a/tools/editor/plugins/resource_preloader_editor_plugin.h +++ b/tools/editor/plugins/resource_preloader_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -40,7 +40,7 @@ class ResourcePreloaderEditor : public PanelContainer { - OBJ_TYPE(ResourcePreloaderEditor, PanelContainer ); + GDCLASS(ResourcePreloaderEditor, PanelContainer ); Button *load; Button *_delete; @@ -74,7 +74,7 @@ class ResourcePreloaderEditor : public PanelContainer { protected: void _notification(int p_what); - void _input_event(InputEvent p_event); + void _gui_input(InputEvent p_event); static void _bind_methods(); public: @@ -86,7 +86,7 @@ public: class ResourcePreloaderEditorPlugin : public EditorPlugin { - OBJ_TYPE( ResourcePreloaderEditorPlugin, EditorPlugin ); + GDCLASS( ResourcePreloaderEditorPlugin, EditorPlugin ); ResourcePreloaderEditor *preloader_editor; EditorNode *editor; diff --git a/tools/editor/plugins/rich_text_editor_plugin.cpp b/tools/editor/plugins/rich_text_editor_plugin.cpp index bec48ca293..f91af2fa60 100644 --- a/tools/editor/plugins/rich_text_editor_plugin.cpp +++ b/tools/editor/plugins/rich_text_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -89,8 +89,8 @@ void RichTextEditor::_menu_option(int p_option) { void RichTextEditor::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_menu_option"),&RichTextEditor::_menu_option); - ObjectTypeDB::bind_method(_MD("_file_selected"),&RichTextEditor::_file_selected); + ClassDB::bind_method(_MD("_menu_option"),&RichTextEditor::_menu_option); + ClassDB::bind_method(_MD("_file_selected"),&RichTextEditor::_file_selected); } @@ -110,7 +110,7 @@ RichTextEditor::RichTextEditor() { options->get_popup()->add_item(TTR("Parse BBCode"),PARSE_BBCODE); options->get_popup()->add_item(TTR("Clear"),CLEAR); - options->get_popup()->connect("item_pressed", this,"_menu_option"); + options->get_popup()->connect("id_pressed", this,"_menu_option"); file_dialog = memnew( EditorFileDialog ); add_child(file_dialog); file_dialog->add_filter("*.txt"); @@ -126,7 +126,7 @@ void RichTextEditorPlugin::edit(Object *p_object) { bool RichTextEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("RichTextLabel"); + return p_object->is_class("RichTextLabel"); } void RichTextEditorPlugin::make_visible(bool p_visible) { diff --git a/tools/editor/plugins/rich_text_editor_plugin.h b/tools/editor/plugins/rich_text_editor_plugin.h index ae1d04be01..cf97d7517c 100644 --- a/tools/editor/plugins/rich_text_editor_plugin.h +++ b/tools/editor/plugins/rich_text_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -40,7 +40,7 @@ class RichTextEditor : public Control { - OBJ_TYPE(RichTextEditor, Control ); + GDCLASS(RichTextEditor, Control ); friend class RichTextEditorPlugin; @@ -70,7 +70,7 @@ public: class RichTextEditorPlugin : public EditorPlugin { - OBJ_TYPE( RichTextEditorPlugin, EditorPlugin ); + GDCLASS( RichTextEditorPlugin, EditorPlugin ); RichTextEditor *rich_text_editor; EditorNode *editor; diff --git a/tools/editor/plugins/sample_editor_plugin.cpp b/tools/editor/plugins/sample_editor_plugin.cpp index 7965fa54ae..12ec7c8260 100644 --- a/tools/editor/plugins/sample_editor_plugin.cpp +++ b/tools/editor/plugins/sample_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ -void SampleEditor::_input_event(InputEvent p_event) { +void SampleEditor::_gui_input(InputEvent p_event) { } @@ -77,15 +77,15 @@ void SampleEditor::_stop_pressed() { void SampleEditor::generate_preview_texture(const Ref<Sample>& p_sample,Ref<ImageTexture> &p_texture) { - DVector<uint8_t> data = p_sample->get_data(); + PoolVector<uint8_t> data = p_sample->get_data(); - DVector<uint8_t> img; + PoolVector<uint8_t> img; int w = p_texture->get_width(); int h = p_texture->get_height(); img.resize(w*h*3); - DVector<uint8_t>::Write imgdata = img.write(); + PoolVector<uint8_t>::Write imgdata = img.write(); uint8_t * imgw = imgdata.ptr(); - DVector<uint8_t>::Read sampledata = data.read(); + PoolVector<uint8_t>::Read sampledata = data.read(); const uint8_t *sdata=sampledata.ptr(); bool stereo = p_sample->is_stereo(); @@ -308,10 +308,10 @@ void SampleEditor::generate_preview_texture(const Ref<Sample>& p_sample,Ref<Imag } } - imgdata = DVector<uint8_t>::Write(); + imgdata = PoolVector<uint8_t>::Write(); - p_texture->set_data(Image(w,h,0,Image::FORMAT_RGB,img)); + p_texture->set_data(Image(w,h,0,Image::FORMAT_RGB8,img)); } @@ -348,9 +348,9 @@ void SampleEditor::edit(Ref<Sample> p_sample) { void SampleEditor::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_input_event"),&SampleEditor::_input_event); - ObjectTypeDB::bind_method(_MD("_play_pressed"),&SampleEditor::_play_pressed); - ObjectTypeDB::bind_method(_MD("_stop_pressed"),&SampleEditor::_stop_pressed); + ClassDB::bind_method(_MD("_gui_input"),&SampleEditor::_gui_input); + ClassDB::bind_method(_MD("_play_pressed"),&SampleEditor::_play_pressed); + ClassDB::bind_method(_MD("_stop_pressed"),&SampleEditor::_stop_pressed); } @@ -392,7 +392,7 @@ SampleEditor::SampleEditor() { add_child(stop); peakdisplay=Ref<ImageTexture>( memnew( ImageTexture) ); - peakdisplay->create( EDITOR_DEF("audio/sample_editor_preview_width",512),EDITOR_DEF("audio/sample_editor_preview_height",128),Image::FORMAT_RGB); + peakdisplay->create( EDITOR_DEF("editors/sample_editor/preview_width",512),EDITOR_DEF("editors/sample_editor/preview_height",128),Image::FORMAT_RGB8); sample_texframe->set_expand(true); sample_texframe->set_texture(peakdisplay); @@ -415,7 +415,7 @@ void SampleEditorPlugin::edit(Object *p_object) { bool SampleEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("Sample"); + return p_object->is_class("Sample"); } void SampleEditorPlugin::make_visible(bool p_visible) { diff --git a/tools/editor/plugins/sample_editor_plugin.h b/tools/editor/plugins/sample_editor_plugin.h index 22dc75b53b..59cdb10304 100644 --- a/tools/editor/plugins/sample_editor_plugin.h +++ b/tools/editor/plugins/sample_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -39,7 +39,7 @@ class SampleEditor : public Panel { - OBJ_TYPE(SampleEditor, Panel ); + GDCLASS(SampleEditor, Panel ); SamplePlayer *player; @@ -57,7 +57,7 @@ class SampleEditor : public Panel { protected: void _notification(int p_what); - void _input_event(InputEvent p_event); + void _gui_input(InputEvent p_event); static void _bind_methods(); public: @@ -69,7 +69,7 @@ public: class SampleEditorPlugin : public EditorPlugin { - OBJ_TYPE( SampleEditorPlugin, EditorPlugin ); + GDCLASS( SampleEditorPlugin, EditorPlugin ); SampleEditor *sample_editor; EditorNode *editor; diff --git a/tools/editor/plugins/sample_library_editor_plugin.cpp b/tools/editor/plugins/sample_library_editor_plugin.cpp index 2a6940332c..a7ccfb6978 100644 --- a/tools/editor/plugins/sample_library_editor_plugin.cpp +++ b/tools/editor/plugins/sample_library_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ #include "sample_editor_plugin.h" -void SampleLibraryEditor::_input_event(InputEvent p_event) { +void SampleLibraryEditor::_gui_input(InputEvent p_event) { } @@ -66,7 +66,7 @@ void SampleLibraryEditor::_notification(int p_what) { } } -void SampleLibraryEditor::_file_load_request(const DVector<String>& p_path) { +void SampleLibraryEditor::_file_load_request(const PoolVector<String>& p_path) { for(int i=0;i<p_path.size();i++) { @@ -236,7 +236,7 @@ void SampleLibraryEditor::_update_library() { // Preview/edit Ref<ImageTexture> preview( memnew( ImageTexture )); - preview->create(128,16,Image::FORMAT_RGB); + preview->create(128,16,Image::FORMAT_RGB8); SampleEditor::generate_preview_texture(smp,preview); ti->set_cell_mode(1,TreeItem::CELL_MODE_ICON); ti->set_selectable(1,false); @@ -400,7 +400,7 @@ void SampleLibraryEditor::drop_data_fw(const Point2& p_point,const Variant& p_da if (String(d["type"])=="files") { - DVector<String> files = d["files"]; + PoolVector<String> files = d["files"]; _file_load_request(files); @@ -411,17 +411,17 @@ void SampleLibraryEditor::drop_data_fw(const Point2& p_point,const Variant& p_da void SampleLibraryEditor::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_input_event"),&SampleLibraryEditor::_input_event); - ObjectTypeDB::bind_method(_MD("_load_pressed"),&SampleLibraryEditor::_load_pressed); - ObjectTypeDB::bind_method(_MD("_item_edited"),&SampleLibraryEditor::_item_edited); - ObjectTypeDB::bind_method(_MD("_delete_pressed"),&SampleLibraryEditor::_delete_pressed); - ObjectTypeDB::bind_method(_MD("_file_load_request"),&SampleLibraryEditor::_file_load_request); - ObjectTypeDB::bind_method(_MD("_update_library"),&SampleLibraryEditor::_update_library); - ObjectTypeDB::bind_method(_MD("_button_pressed"),&SampleLibraryEditor::_button_pressed); + ClassDB::bind_method(_MD("_gui_input"),&SampleLibraryEditor::_gui_input); + ClassDB::bind_method(_MD("_load_pressed"),&SampleLibraryEditor::_load_pressed); + ClassDB::bind_method(_MD("_item_edited"),&SampleLibraryEditor::_item_edited); + ClassDB::bind_method(_MD("_delete_pressed"),&SampleLibraryEditor::_delete_pressed); + ClassDB::bind_method(_MD("_file_load_request"),&SampleLibraryEditor::_file_load_request); + ClassDB::bind_method(_MD("_update_library"),&SampleLibraryEditor::_update_library); + ClassDB::bind_method(_MD("_button_pressed"),&SampleLibraryEditor::_button_pressed); - ObjectTypeDB::bind_method(_MD("get_drag_data_fw"), &SampleLibraryEditor::get_drag_data_fw); - ObjectTypeDB::bind_method(_MD("can_drop_data_fw"), &SampleLibraryEditor::can_drop_data_fw); - ObjectTypeDB::bind_method(_MD("drop_data_fw"), &SampleLibraryEditor::drop_data_fw); + ClassDB::bind_method(_MD("get_drag_data_fw"), &SampleLibraryEditor::get_drag_data_fw); + ClassDB::bind_method(_MD("can_drop_data_fw"), &SampleLibraryEditor::can_drop_data_fw); + ClassDB::bind_method(_MD("drop_data_fw"), &SampleLibraryEditor::drop_data_fw); } @@ -497,7 +497,7 @@ void SampleLibraryEditorPlugin::edit(Object *p_object) { bool SampleLibraryEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("SampleLibrary"); + return p_object->is_class("SampleLibrary"); } void SampleLibraryEditorPlugin::make_visible(bool p_visible) { diff --git a/tools/editor/plugins/sample_library_editor_plugin.h b/tools/editor/plugins/sample_library_editor_plugin.h index f9fb184b7c..1856d338ed 100644 --- a/tools/editor/plugins/sample_library_editor_plugin.h +++ b/tools/editor/plugins/sample_library_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -42,7 +42,7 @@ class SampleLibraryEditor : public Panel { - OBJ_TYPE(SampleLibraryEditor, Panel ); + GDCLASS(SampleLibraryEditor, Panel ); @@ -59,7 +59,7 @@ class SampleLibraryEditor : public Panel { void _load_pressed(); - void _file_load_request(const DVector<String>& p_path); + void _file_load_request(const PoolVector<String>& p_path); void _delete_pressed(); void _update_library(); void _item_edited(); @@ -74,7 +74,7 @@ class SampleLibraryEditor : public Panel { protected: void _notification(int p_what); - void _input_event(InputEvent p_event); + void _gui_input(InputEvent p_event); static void _bind_methods(); public: @@ -85,7 +85,7 @@ public: class SampleLibraryEditorPlugin : public EditorPlugin { - OBJ_TYPE( SampleLibraryEditorPlugin, EditorPlugin ); + GDCLASS( SampleLibraryEditorPlugin, EditorPlugin ); SampleLibraryEditor *sample_library_editor; EditorNode *editor; diff --git a/tools/editor/plugins/sample_player_editor_plugin.cpp b/tools/editor/plugins/sample_player_editor_plugin.cpp index 3085ad87d8..ae958a5c6e 100644 --- a/tools/editor/plugins/sample_player_editor_plugin.cpp +++ b/tools/editor/plugins/sample_player_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -50,8 +50,8 @@ void SamplePlayerEditor::_node_removed(Node *p_node) { void SamplePlayerEditor::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_play"),&SamplePlayerEditor::_play); - ObjectTypeDB::bind_method(_MD("_stop"),&SamplePlayerEditor::_stop); + ClassDB::bind_method(_MD("_play"),&SamplePlayerEditor::_play); + ClassDB::bind_method(_MD("_stop"),&SamplePlayerEditor::_stop); } @@ -153,7 +153,7 @@ void SamplePlayerEditorPlugin::edit(Object *p_object) { bool SamplePlayerEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("SamplePlayer2D") || p_object->is_type("SamplePlayer") || p_object->is_type("SpatialSamplePlayer"); + return p_object->is_class("SamplePlayer2D") || p_object->is_class("SamplePlayer") || p_object->is_class("SpatialSamplePlayer"); } void SamplePlayerEditorPlugin::make_visible(bool p_visible) { diff --git a/tools/editor/plugins/sample_player_editor_plugin.h b/tools/editor/plugins/sample_player_editor_plugin.h index 013b042487..d18496b4fd 100644 --- a/tools/editor/plugins/sample_player_editor_plugin.h +++ b/tools/editor/plugins/sample_player_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -41,7 +41,7 @@ class SamplePlayerEditor : public Control { - OBJ_TYPE(SamplePlayerEditor, Control ); + GDCLASS(SamplePlayerEditor, Control ); Panel *panel; Button * play; @@ -66,7 +66,7 @@ public: class SamplePlayerEditorPlugin : public EditorPlugin { - OBJ_TYPE( SamplePlayerEditorPlugin, EditorPlugin ); + GDCLASS( SamplePlayerEditorPlugin, EditorPlugin ); SamplePlayerEditor *sample_player_editor; EditorNode *editor; diff --git a/tools/editor/plugins/script_editor_plugin.cpp b/tools/editor/plugins/script_editor_plugin.cpp index e7170a23f3..5b2cb4aa5d 100644 --- a/tools/editor/plugins/script_editor_plugin.cpp +++ b/tools/editor/plugins/script_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -183,7 +183,7 @@ void ScriptEditorQuickOpen::_sbox_input(const InputEvent& p_ie) { p_ie.key.scancode == KEY_PAGEUP || p_ie.key.scancode == KEY_PAGEDOWN ) ) { - search_options->call("_input_event",p_ie); + search_options->call("_gui_input",p_ie); search_box->accept_event(); } @@ -240,9 +240,9 @@ void ScriptEditorQuickOpen::_notification(int p_what) { void ScriptEditorQuickOpen::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_text_changed"),&ScriptEditorQuickOpen::_text_changed); - ObjectTypeDB::bind_method(_MD("_confirmed"),&ScriptEditorQuickOpen::_confirmed); - ObjectTypeDB::bind_method(_MD("_sbox_input"),&ScriptEditorQuickOpen::_sbox_input); + ClassDB::bind_method(_MD("_text_changed"),&ScriptEditorQuickOpen::_text_changed); + ClassDB::bind_method(_MD("_confirmed"),&ScriptEditorQuickOpen::_confirmed); + ClassDB::bind_method(_MD("_sbox_input"),&ScriptEditorQuickOpen::_sbox_input); ADD_SIGNAL(MethodInfo("goto_line",PropertyInfo(Variant::INT,"line"))); @@ -254,11 +254,11 @@ ScriptEditorQuickOpen::ScriptEditorQuickOpen() { VBoxContainer *vbc = memnew( VBoxContainer ); add_child(vbc); - set_child_rect(vbc); + //set_child_rect(vbc); search_box = memnew( LineEdit ); vbc->add_margin_child(TTR("Search:"),search_box); search_box->connect("text_changed",this,"_text_changed"); - search_box->connect("input_event",this,"_sbox_input"); + search_box->connect("gui_input",this,"_sbox_input"); search_options = memnew( Tree ); vbc->add_margin_child(TTR("Matches:"),search_options,true); get_ok()->set_text(TTR("Open")); @@ -431,7 +431,7 @@ void ScriptEditor::_go_to_tab(int p_idx) { } if (c->cast_to<EditorHelp>()) { - script_name_label->set_text(c->cast_to<EditorHelp>()->get_class_name()); + script_name_label->set_text(c->cast_to<EditorHelp>()->get_class()); script_icon->set_texture(get_icon("Help","EditorIcons")); if (is_visible()) c->cast_to<EditorHelp>()->set_focused(); @@ -605,7 +605,7 @@ void ScriptEditor::_reload_scripts(){ } - Ref<Script> rel_script = ResourceLoader::load(script->get_path(),script->get_type(),true); + Ref<Script> rel_script = ResourceLoader::load(script->get_path(),script->get_class(),true); ERR_CONTINUE(!rel_script.is_valid()); script->set_source_code( rel_script->get_source_code() ); script->set_last_modified_time( rel_script->get_last_modified_time() ); @@ -672,7 +672,7 @@ bool ScriptEditor::_test_script_times_on_disk(Ref<Script> p_for_script) { bool need_ask=false; bool need_reload=false; - bool use_autoreload=bool(EDITOR_DEF("text_editor/auto_reload_scripts_on_external_change",false)); + bool use_autoreload=bool(EDITOR_DEF("text_editor/files/auto_reload_scripts_on_external_change",false)); @@ -783,7 +783,7 @@ void ScriptEditor::_menu_option(int p_option) { file_dialog_option = FILE_SAVE_THEME_AS; file_dialog->clear_filters(); file_dialog->add_filter("*.tet"); - file_dialog->set_current_path(EditorSettings::get_singleton()->get_settings_path() + "/text_editor_themes/" + EditorSettings::get_singleton()->get("text_editor/color_theme")); + file_dialog->set_current_path(EditorSettings::get_singleton()->get_settings_path() + "/text_editor_themes/" + EditorSettings::get_singleton()->get("text_editor/theme/color_theme")); file_dialog->popup_centered_ratio(); file_dialog->set_title(TTR("Save Theme As..")); } break; @@ -798,7 +798,7 @@ void ScriptEditor::_menu_option(int p_option) { if (tab_container->get_tab_count()>0) { EditorHelp *eh = tab_container->get_child( tab_container->get_current_tab() )->cast_to<EditorHelp>(); if (eh) { - current=eh->get_class_name(); + current=eh->get_class(); } } @@ -991,7 +991,7 @@ void ScriptEditor::_notification(int p_what) { script_split->connect("dragged",this,"_script_split_dragged"); autosave_timer->connect("timeout",this,"_autosave_scripts"); { - float autosave_time = EditorSettings::get_singleton()->get("text_editor/autosave_interval_secs"); + float autosave_time = EditorSettings::get_singleton()->get("text_editor/files/autosave_interval_secs"); if (autosave_time>0) { autosave_timer->set_wait_time(autosave_time); autosave_timer->start(); @@ -1343,12 +1343,12 @@ struct _ScriptEditorItemData { void ScriptEditor::_update_script_colors() { - bool script_temperature_enabled = EditorSettings::get_singleton()->get("text_editor/script_temperature_enabled"); - bool highlight_current = EditorSettings::get_singleton()->get("text_editor/highlight_current_script"); + bool script_temperature_enabled = EditorSettings::get_singleton()->get("text_editor/open_scripts/script_temperature_enabled"); + bool highlight_current = EditorSettings::get_singleton()->get("text_editor/open_scripts/highlight_current_script"); - int hist_size = EditorSettings::get_singleton()->get("text_editor/script_temperature_history_size"); - Color hot_color=EditorSettings::get_singleton()->get("text_editor/script_temperature_hot_color"); - Color cold_color=EditorSettings::get_singleton()->get("text_editor/script_temperature_cold_color"); + int hist_size = EditorSettings::get_singleton()->get("text_editor/open_scripts/script_temperature_history_size"); + Color hot_color=EditorSettings::get_singleton()->get("text_editor/open_scripts/script_temperature_hot_color"); + Color cold_color=EditorSettings::get_singleton()->get("text_editor/open_scripts/script_temperature_cold_color"); for(int i=0;i<script_list->get_item_count();i++) { @@ -1395,7 +1395,7 @@ void ScriptEditor::_update_script_names() { } script_list->clear(); - bool split_script_help = EditorSettings::get_singleton()->get("text_editor/group_help_pages"); + bool split_script_help = EditorSettings::get_singleton()->get("text_editor/open_scripts/group_help_pages"); Vector<_ScriptEditorItemData> sedata; @@ -1423,7 +1423,7 @@ void ScriptEditor::_update_script_names() { EditorHelp *eh = tab_container->get_child(i)->cast_to<EditorHelp>(); if (eh) { - String name = eh->get_class_name(); + String name = eh->get_class(); Ref<Texture> icon = get_icon("Help","EditorIcons"); String tooltip = name+" Class Reference"; @@ -1481,12 +1481,12 @@ void ScriptEditor::edit(const Ref<Script>& p_script, bool p_grab_focus) { // see if already has it - bool open_dominant = EditorSettings::get_singleton()->get("text_editor/open_dominant_script_on_scene_change"); + bool open_dominant = EditorSettings::get_singleton()->get("text_editor/files/open_dominant_script_on_scene_change"); - if (p_script->get_path().is_resource_file() && bool(EditorSettings::get_singleton()->get("external_editor/use_external_editor"))) { + if (p_script->get_path().is_resource_file() && bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor"))) { - String path = EditorSettings::get_singleton()->get("external_editor/exec_path"); - String flags = EditorSettings::get_singleton()->get("external_editor/exec_flags"); + String path = EditorSettings::get_singleton()->get("text_editor/external/exec_path"); + String flags = EditorSettings::get_singleton()->get("text_editor/external/exec_flags"); List<String> args; flags=flags.strip_edges(); if (flags!=String()) { @@ -1495,7 +1495,7 @@ void ScriptEditor::edit(const Ref<Script>& p_script, bool p_grab_focus) { args.push_back(flagss[i]); } - args.push_back(Globals::get_singleton()->globalize_path(p_script->get_path())); + args.push_back(GlobalConfig::get_singleton()->globalize_path(p_script->get_path())); Error err = OS::get_singleton()->execute(path,args,false); if (err==OK) return; @@ -1654,7 +1654,7 @@ void ScriptEditor::_editor_stop() { } -void ScriptEditor::_add_callback(Object *p_obj, const String& p_function, const StringArray& p_args) { +void ScriptEditor::_add_callback(Object *p_obj, const String& p_function, const PoolStringArray& p_args) { //print_line("add callback! hohoho"); kinda sad to remove this ERR_FAIL_COND(!p_obj); @@ -1694,8 +1694,8 @@ void ScriptEditor::_save_layout() { void ScriptEditor::_editor_settings_changed() { - trim_trailing_whitespace_on_save = EditorSettings::get_singleton()->get("text_editor/trim_trailing_whitespace_on_save"); - float autosave_time = EditorSettings::get_singleton()->get("text_editor/autosave_interval_secs"); + trim_trailing_whitespace_on_save = EditorSettings::get_singleton()->get("text_editor/files/trim_trailing_whitespace_on_save"); + float autosave_time = EditorSettings::get_singleton()->get("text_editor/files/autosave_interval_secs"); if (autosave_time>0) { autosave_timer->set_wait_time(autosave_time); autosave_timer->start(); @@ -1704,9 +1704,9 @@ void ScriptEditor::_editor_settings_changed() { } if (current_theme == "") { - current_theme = EditorSettings::get_singleton()->get("text_editor/color_theme"); - } else if (current_theme != EditorSettings::get_singleton()->get("text_editor/color_theme")) { - current_theme = EditorSettings::get_singleton()->get("text_editor/color_theme"); + current_theme = EditorSettings::get_singleton()->get("text_editor/theme/color_theme"); + } else if (current_theme != EditorSettings::get_singleton()->get("text_editor/theme/color_theme")) { + current_theme = EditorSettings::get_singleton()->get("text_editor/theme/color_theme"); EditorSettings::get_singleton()->load_text_editor_theme(); } @@ -1720,7 +1720,7 @@ void ScriptEditor::_editor_settings_changed() { } _update_script_colors(); - ScriptServer::set_reload_scripts_on_save(EDITOR_DEF("text_editor/auto_reload_and_parse_scripts_on_save",true)); + ScriptServer::set_reload_scripts_on_save(EDITOR_DEF("text_editor/files/auto_reload_and_parse_scripts_on_save",true)); } @@ -1761,7 +1761,7 @@ void ScriptEditor::_unhandled_input(const InputEvent& p_event) { void ScriptEditor::set_window_layout(Ref<ConfigFile> p_layout) { - if (!bool(EDITOR_DEF("text_editor/restore_scripts_on_load",true))) { + if (!bool(EDITOR_DEF("text_editor/files/restore_scripts_on_load",true))) { return; } @@ -1827,7 +1827,7 @@ void ScriptEditor::get_window_layout(Ref<ConfigFile> p_layout) { if (eh) { - helps.push_back(eh->get_class_name()); + helps.push_back(eh->get_class()); } @@ -1841,12 +1841,14 @@ void ScriptEditor::get_window_layout(Ref<ConfigFile> p_layout) { void ScriptEditor::_help_class_open(const String& p_class) { + if (p_class=="") + return; for(int i=0;i<tab_container->get_child_count();i++) { EditorHelp *eh = tab_container->get_child(i)->cast_to<EditorHelp>(); - if (eh && eh->get_class_name()==p_class) { + if (eh && eh->get_class()==p_class) { _go_to_tab(i); _update_script_names(); @@ -1874,7 +1876,7 @@ void ScriptEditor::_help_class_goto(const String& p_desc) { EditorHelp *eh = tab_container->get_child(i)->cast_to<EditorHelp>(); - if (eh && eh->get_class_name()==cname) { + if (eh && eh->get_class()==cname) { _go_to_tab(i); eh->go_to_help(p_desc); @@ -1972,9 +1974,9 @@ void ScriptEditor::_history_back(){ } void ScriptEditor::set_scene_root_script( Ref<Script> p_script ) { - bool open_dominant = EditorSettings::get_singleton()->get("text_editor/open_dominant_script_on_scene_change"); + bool open_dominant = EditorSettings::get_singleton()->get("text_editor/files/open_dominant_script_on_scene_change"); - if (bool(EditorSettings::get_singleton()->get("external_editor/use_external_editor"))) + if (bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor"))) return; if (open_dominant && p_script.is_valid() && _can_open_in_editor(p_script.ptr())) { @@ -2027,43 +2029,43 @@ void ScriptEditor::register_create_script_editor_function(CreateScriptEditorFunc void ScriptEditor::_bind_methods() { - ObjectTypeDB::bind_method("_file_dialog_action",&ScriptEditor::_file_dialog_action); - ObjectTypeDB::bind_method("_tab_changed",&ScriptEditor::_tab_changed); - ObjectTypeDB::bind_method("_menu_option",&ScriptEditor::_menu_option); - ObjectTypeDB::bind_method("_close_current_tab",&ScriptEditor::_close_current_tab); - ObjectTypeDB::bind_method("_close_docs_tab", &ScriptEditor::_close_docs_tab); - ObjectTypeDB::bind_method("_close_all_tabs", &ScriptEditor::_close_all_tabs); - ObjectTypeDB::bind_method("_editor_play",&ScriptEditor::_editor_play); - ObjectTypeDB::bind_method("_editor_pause",&ScriptEditor::_editor_pause); - ObjectTypeDB::bind_method("_editor_stop",&ScriptEditor::_editor_stop); - ObjectTypeDB::bind_method("_add_callback",&ScriptEditor::_add_callback); - ObjectTypeDB::bind_method("_reload_scripts",&ScriptEditor::_reload_scripts); - ObjectTypeDB::bind_method("_resave_scripts",&ScriptEditor::_resave_scripts); - ObjectTypeDB::bind_method("_res_saved_callback",&ScriptEditor::_res_saved_callback); - ObjectTypeDB::bind_method("_goto_script_line",&ScriptEditor::_goto_script_line); - ObjectTypeDB::bind_method("_goto_script_line2",&ScriptEditor::_goto_script_line2); - ObjectTypeDB::bind_method("_help_search",&ScriptEditor::_help_search); - ObjectTypeDB::bind_method("_save_history",&ScriptEditor::_save_history); - - - - ObjectTypeDB::bind_method("_breaked",&ScriptEditor::_breaked); - ObjectTypeDB::bind_method("_show_debugger",&ScriptEditor::_show_debugger); - ObjectTypeDB::bind_method("_get_debug_tooltip",&ScriptEditor::_get_debug_tooltip); - ObjectTypeDB::bind_method("_autosave_scripts",&ScriptEditor::_autosave_scripts); - ObjectTypeDB::bind_method("_editor_settings_changed",&ScriptEditor::_editor_settings_changed); - ObjectTypeDB::bind_method("_update_script_names",&ScriptEditor::_update_script_names); - ObjectTypeDB::bind_method("_tree_changed",&ScriptEditor::_tree_changed); - ObjectTypeDB::bind_method("_script_selected",&ScriptEditor::_script_selected); - ObjectTypeDB::bind_method("_script_created",&ScriptEditor::_script_created); - ObjectTypeDB::bind_method("_script_split_dragged",&ScriptEditor::_script_split_dragged); - ObjectTypeDB::bind_method("_help_class_open",&ScriptEditor::_help_class_open); - ObjectTypeDB::bind_method("_help_class_goto",&ScriptEditor::_help_class_goto); - ObjectTypeDB::bind_method("_request_help",&ScriptEditor::_help_class_open); - ObjectTypeDB::bind_method("_history_forward",&ScriptEditor::_history_forward); - ObjectTypeDB::bind_method("_history_back",&ScriptEditor::_history_back); - ObjectTypeDB::bind_method("_live_auto_reload_running_scripts",&ScriptEditor::_live_auto_reload_running_scripts); - ObjectTypeDB::bind_method("_unhandled_input",&ScriptEditor::_unhandled_input); + ClassDB::bind_method("_file_dialog_action",&ScriptEditor::_file_dialog_action); + ClassDB::bind_method("_tab_changed",&ScriptEditor::_tab_changed); + ClassDB::bind_method("_menu_option",&ScriptEditor::_menu_option); + ClassDB::bind_method("_close_current_tab",&ScriptEditor::_close_current_tab); + ClassDB::bind_method("_close_docs_tab", &ScriptEditor::_close_docs_tab); + ClassDB::bind_method("_close_all_tabs", &ScriptEditor::_close_all_tabs); + ClassDB::bind_method("_editor_play",&ScriptEditor::_editor_play); + ClassDB::bind_method("_editor_pause",&ScriptEditor::_editor_pause); + ClassDB::bind_method("_editor_stop",&ScriptEditor::_editor_stop); + ClassDB::bind_method("_add_callback",&ScriptEditor::_add_callback); + ClassDB::bind_method("_reload_scripts",&ScriptEditor::_reload_scripts); + ClassDB::bind_method("_resave_scripts",&ScriptEditor::_resave_scripts); + ClassDB::bind_method("_res_saved_callback",&ScriptEditor::_res_saved_callback); + ClassDB::bind_method("_goto_script_line",&ScriptEditor::_goto_script_line); + ClassDB::bind_method("_goto_script_line2",&ScriptEditor::_goto_script_line2); + ClassDB::bind_method("_help_search",&ScriptEditor::_help_search); + ClassDB::bind_method("_save_history",&ScriptEditor::_save_history); + + + + ClassDB::bind_method("_breaked",&ScriptEditor::_breaked); + ClassDB::bind_method("_show_debugger",&ScriptEditor::_show_debugger); + ClassDB::bind_method("_get_debug_tooltip",&ScriptEditor::_get_debug_tooltip); + ClassDB::bind_method("_autosave_scripts",&ScriptEditor::_autosave_scripts); + ClassDB::bind_method("_editor_settings_changed",&ScriptEditor::_editor_settings_changed); + ClassDB::bind_method("_update_script_names",&ScriptEditor::_update_script_names); + ClassDB::bind_method("_tree_changed",&ScriptEditor::_tree_changed); + ClassDB::bind_method("_script_selected",&ScriptEditor::_script_selected); + ClassDB::bind_method("_script_created",&ScriptEditor::_script_created); + ClassDB::bind_method("_script_split_dragged",&ScriptEditor::_script_split_dragged); + ClassDB::bind_method("_help_class_open",&ScriptEditor::_help_class_open); + ClassDB::bind_method("_help_class_goto",&ScriptEditor::_help_class_goto); + ClassDB::bind_method("_request_help",&ScriptEditor::_help_class_open); + ClassDB::bind_method("_history_forward",&ScriptEditor::_history_forward); + ClassDB::bind_method("_history_back",&ScriptEditor::_history_back); + ClassDB::bind_method("_live_auto_reload_running_scripts",&ScriptEditor::_live_auto_reload_running_scripts); + ClassDB::bind_method("_unhandled_input",&ScriptEditor::_unhandled_input); } @@ -2126,7 +2128,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_docs", TTR("Close Docs")), CLOSE_DOCS); file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_file", TTR("Close"), KEY_MASK_CMD | KEY_W), FILE_CLOSE); file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/close_all", TTR("Close All")), CLOSE_ALL); - file_menu->get_popup()->connect("item_pressed", this,"_menu_option"); + file_menu->get_popup()->connect("id_pressed", this,"_menu_option"); @@ -2135,7 +2137,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { script_search_menu->set_text(TTR("Search")); script_search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find", TTR("Find.."), KEY_MASK_CMD|KEY_F), HELP_SEARCH_FIND); script_search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find_next", TTR("Find Next"), KEY_F3), HELP_SEARCH_FIND_NEXT); - script_search_menu->get_popup()->connect("item_pressed", this,"_menu_option"); + script_search_menu->get_popup()->connect("id_pressed", this,"_menu_option"); script_search_menu->hide(); @@ -2151,7 +2153,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { debug_menu->get_popup()->add_separator(); //debug_menu->get_popup()->add_check_item("Show Debugger",DEBUG_SHOW); debug_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("debugger/keep_debugger_open", TTR("Keep Debugger Open")), DEBUG_SHOW_KEEP_OPEN); - debug_menu->get_popup()->connect("item_pressed", this,"_menu_option"); + debug_menu->get_popup()->connect("id_pressed", this,"_menu_option"); debug_menu->get_popup()->set_item_disabled( debug_menu->get_popup()->get_item_index(DEBUG_NEXT), true); debug_menu->get_popup()->set_item_disabled( debug_menu->get_popup()->get_item_index(DEBUG_STEP), true ); @@ -2168,7 +2170,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { window_menu->get_popup()->add_item(TTR("Move Left"),WINDOW_MOVE_LEFT,KEY_MASK_CMD|KEY_LEFT); window_menu->get_popup()->add_item(TTR("Move Right"),WINDOW_MOVE_RIGHT,KEY_MASK_CMD|KEY_RIGHT); window_menu->get_popup()->add_separator(); - window_menu->get_popup()->connect("item_pressed", this,"_menu_option"); + window_menu->get_popup()->connect("id_pressed", this,"_menu_option"); #endif @@ -2245,7 +2247,7 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) { { VBoxContainer *vbc = memnew( VBoxContainer ); disk_changed->add_child(vbc); - disk_changed->set_child_rect(vbc); + // disk_changed->set_child_rect(vbc); Label *dl = memnew( Label ); dl->set_text(TTR("The following files are newer on disk.\nWhat action should be taken?:")); @@ -2326,7 +2328,7 @@ bool ScriptEditorPlugin::handles(Object *p_object) const { return valid; } - return p_object->is_type("Script"); + return p_object->is_class("Script"); } void ScriptEditorPlugin::make_visible(bool p_visible) { @@ -2414,20 +2416,20 @@ ScriptEditorPlugin::ScriptEditorPlugin(EditorNode *p_node) { script_editor->hide(); - EDITOR_DEF("text_editor/auto_reload_scripts_on_external_change",true); - ScriptServer::set_reload_scripts_on_save(EDITOR_DEF("text_editor/auto_reload_and_parse_scripts_on_save",true)); - EDITOR_DEF("text_editor/open_dominant_script_on_scene_change",true); - EDITOR_DEF("external_editor/use_external_editor",false); - EDITOR_DEF("external_editor/exec_path",""); - EDITOR_DEF("text_editor/script_temperature_enabled",true); - EDITOR_DEF("text_editor/highlight_current_script", true); - EDITOR_DEF("text_editor/script_temperature_history_size",15); - EDITOR_DEF("text_editor/script_temperature_hot_color",Color(1,0,0,0.3)); - EDITOR_DEF("text_editor/script_temperature_cold_color",Color(0,0,1,0.3)); - EDITOR_DEF("text_editor/current_script_background_color",Color(0.81,0.81,0.14,0.63)); - EDITOR_DEF("text_editor/group_help_pages",true); - EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"external_editor/exec_path",PROPERTY_HINT_GLOBAL_FILE)); - EDITOR_DEF("external_editor/exec_flags",""); + EDITOR_DEF("text_editor/files/auto_reload_scripts_on_external_change",true); + ScriptServer::set_reload_scripts_on_save(EDITOR_DEF("text_editor/files/auto_reload_and_parse_scripts_on_save",true)); + EDITOR_DEF("text_editor/files/open_dominant_script_on_scene_change",true); + EDITOR_DEF("text_editor/external/use_external_editor",false); + EDITOR_DEF("text_editor/external/exec_path",""); + EDITOR_DEF("text_editor/open_scripts/script_temperature_enabled",true); + EDITOR_DEF("text_editor/open_scripts/highlight_current_script", true); + EDITOR_DEF("text_editor/open_scripts/script_temperature_history_size",15); + EDITOR_DEF("text_editor/open_scripts/script_temperature_hot_color",Color(1,0,0,0.3)); + EDITOR_DEF("text_editor/open_scripts/script_temperature_cold_color",Color(0,0,1,0.3)); + EDITOR_DEF("text_editor/open_scripts/current_script_background_color",Color(0.81,0.81,0.14,0.63)); + EDITOR_DEF("text_editor/open_scripts/group_help_pages",true); + EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"text_editor/external/exec_path",PROPERTY_HINT_GLOBAL_FILE)); + EDITOR_DEF("text_editor/external/exec_flags",""); } diff --git a/tools/editor/plugins/script_editor_plugin.h b/tools/editor/plugins/script_editor_plugin.h index 10f3bce14e..26120c8497 100644 --- a/tools/editor/plugins/script_editor_plugin.h +++ b/tools/editor/plugins/script_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -45,7 +45,7 @@ class ScriptEditorQuickOpen : public ConfirmationDialog { - OBJ_TYPE(ScriptEditorQuickOpen,ConfirmationDialog ) + GDCLASS(ScriptEditorQuickOpen,ConfirmationDialog ) LineEdit *search_box; Tree *search_options; @@ -77,7 +77,7 @@ class ScriptEditorDebugger; class ScriptEditorBase : public Control { - OBJ_TYPE( ScriptEditorBase, Control ); + GDCLASS( ScriptEditorBase, Control ); protected: static void _bind_methods(); public: @@ -99,7 +99,7 @@ public: virtual void reload(bool p_soft)=0; virtual void get_breakpoints(List<int> *p_breakpoints)=0; virtual bool goto_method(const String& p_method)=0; - virtual void add_callback(const String& p_function,StringArray p_args)=0; + virtual void add_callback(const String& p_function,PoolStringArray p_args)=0; virtual void update_settings()=0; virtual void set_debugger_active(bool p_active)=0; virtual bool can_lose_focus_on_node_selection() { return true; } @@ -118,7 +118,7 @@ class EditorScriptCodeCompletionCache; class ScriptEditor : public VBoxContainer { - OBJ_TYPE(ScriptEditor, VBoxContainer ); + GDCLASS(ScriptEditor, VBoxContainer ); EditorNode *editor; @@ -243,7 +243,7 @@ class ScriptEditor : public VBoxContainer { int edit_pass; - void _add_callback(Object *p_obj, const String& p_function, const StringArray& p_args); + void _add_callback(Object *p_obj, const String& p_function, const PoolStringArray& p_args); void _res_saved_callback(const Ref<Resource>& p_res); bool trim_trailing_whitespace_on_save; @@ -343,7 +343,7 @@ public: class ScriptEditorPlugin : public EditorPlugin { - OBJ_TYPE( ScriptEditorPlugin, EditorPlugin ); + GDCLASS( ScriptEditorPlugin, EditorPlugin ); ScriptEditor *script_editor; EditorNode *editor; diff --git a/tools/editor/plugins/script_text_editor.cpp b/tools/editor/plugins/script_text_editor.cpp index 23252c4077..05a2bfdba0 100644 --- a/tools/editor/plugins/script_text_editor.cpp +++ b/tools/editor/plugins/script_text_editor.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -100,32 +100,32 @@ void ScriptTextEditor::_load_theme_settings() { /* keyword color */ - text_edit->add_color_override("background_color", EDITOR_DEF("text_editor/background_color",Color(0,0,0,0))); - text_edit->add_color_override("completion_background_color", EDITOR_DEF("text_editor/completion_background_color", Color(0,0,0,0))); - text_edit->add_color_override("completion_selected_color", EDITOR_DEF("text_editor/completion_selected_color", Color::html("434244"))); - text_edit->add_color_override("completion_existing_color", EDITOR_DEF("text_editor/completion_existing_color", Color::html("21dfdfdf"))); - text_edit->add_color_override("completion_scroll_color", EDITOR_DEF("text_editor/completion_scroll_color", Color::html("ffffff"))); - text_edit->add_color_override("completion_font_color", EDITOR_DEF("text_editor/completion_font_color", Color::html("aaaaaa"))); - text_edit->add_color_override("font_color",EDITOR_DEF("text_editor/text_color",Color(0,0,0))); - text_edit->add_color_override("line_number_color",EDITOR_DEF("text_editor/line_number_color",Color(0,0,0))); - text_edit->add_color_override("caret_color",EDITOR_DEF("text_editor/caret_color",Color(0,0,0))); - text_edit->add_color_override("caret_background_color",EDITOR_DEF("text_editor/caret_background_color",Color(0,0,0))); - text_edit->add_color_override("font_selected_color",EDITOR_DEF("text_editor/text_selected_color",Color(1,1,1))); - text_edit->add_color_override("selection_color",EDITOR_DEF("text_editor/selection_color",Color(0.2,0.2,1))); - text_edit->add_color_override("brace_mismatch_color",EDITOR_DEF("text_editor/brace_mismatch_color",Color(1,0.2,0.2))); - text_edit->add_color_override("current_line_color",EDITOR_DEF("text_editor/current_line_color",Color(0.3,0.5,0.8,0.15))); - text_edit->add_color_override("word_highlighted_color",EDITOR_DEF("text_editor/word_highlighted_color",Color(0.8,0.9,0.9,0.15))); - text_edit->add_color_override("number_color",EDITOR_DEF("text_editor/number_color",Color(0.9,0.6,0.0,2))); - text_edit->add_color_override("function_color",EDITOR_DEF("text_editor/function_color",Color(0.4,0.6,0.8))); - text_edit->add_color_override("member_variable_color",EDITOR_DEF("text_editor/member_variable_color",Color(0.9,0.3,0.3))); - text_edit->add_color_override("mark_color", EDITOR_DEF("text_editor/mark_color", Color(1.0,0.4,0.4,0.4))); - text_edit->add_color_override("breakpoint_color", EDITOR_DEF("text_editor/breakpoint_color", Color(0.8,0.8,0.4,0.2))); - text_edit->add_color_override("search_result_color",EDITOR_DEF("text_editor/search_result_color",Color(0.05,0.25,0.05,1))); - text_edit->add_color_override("search_result_border_color",EDITOR_DEF("text_editor/search_result_border_color",Color(0.1,0.45,0.1,1))); - text_edit->add_color_override("symbol_color",EDITOR_DEF("text_editor/symbol_color",Color::hex(0x005291ff))); - text_edit->add_constant_override("line_spacing", EDITOR_DEF("text_editor/line_spacing",4)); - - Color keyword_color= EDITOR_DEF("text_editor/keyword_color",Color(0.5,0.0,0.2)); + text_edit->add_color_override("background_color", EDITOR_DEF("text_editor/highlighting/background_color",Color(0,0,0,0))); + text_edit->add_color_override("completion_background_color", EDITOR_DEF("text_editor/highlighting/completion_background_color", Color(0,0,0,0))); + text_edit->add_color_override("completion_selected_color", EDITOR_DEF("text_editor/highlighting/completion_selected_color", Color::html("434244"))); + text_edit->add_color_override("completion_existing_color", EDITOR_DEF("text_editor/highlighting/completion_existing_color", Color::html("21dfdfdf"))); + text_edit->add_color_override("completion_scroll_color", EDITOR_DEF("text_editor/highlighting/completion_scroll_color", Color::html("ffffff"))); + text_edit->add_color_override("completion_font_color", EDITOR_DEF("text_editor/highlighting/completion_font_color", Color::html("aaaaaa"))); + text_edit->add_color_override("font_color",EDITOR_DEF("text_editor/highlighting/text_color",Color(0,0,0))); + text_edit->add_color_override("line_number_color",EDITOR_DEF("text_editor/highlighting/line_number_color",Color(0,0,0))); + text_edit->add_color_override("caret_color",EDITOR_DEF("text_editor/highlighting/caret_color",Color(0,0,0))); + text_edit->add_color_override("caret_background_color",EDITOR_DEF("text_editor/highlighting/caret_background_color",Color(0,0,0))); + text_edit->add_color_override("font_selected_color",EDITOR_DEF("text_editor/highlighting/text_selected_color",Color(1,1,1))); + text_edit->add_color_override("selection_color",EDITOR_DEF("text_editor/highlighting/selection_color",Color(0.2,0.2,1))); + text_edit->add_color_override("brace_mismatch_color",EDITOR_DEF("text_editor/highlighting/brace_mismatch_color",Color(1,0.2,0.2))); + text_edit->add_color_override("current_line_color",EDITOR_DEF("text_editor/highlighting/current_line_color",Color(0.3,0.5,0.8,0.15))); + text_edit->add_color_override("word_highlighted_color",EDITOR_DEF("text_editor/highlighting/word_highlighted_color",Color(0.8,0.9,0.9,0.15))); + text_edit->add_color_override("number_color",EDITOR_DEF("text_editor/highlighting/number_color",Color(0.9,0.6,0.0,2))); + text_edit->add_color_override("function_color",EDITOR_DEF("text_editor/highlighting/function_color",Color(0.4,0.6,0.8))); + text_edit->add_color_override("member_variable_color",EDITOR_DEF("text_editor/highlighting/member_variable_color",Color(0.9,0.3,0.3))); + text_edit->add_color_override("mark_color", EDITOR_DEF("text_editor/highlighting/mark_color", Color(1.0,0.4,0.4,0.4))); + text_edit->add_color_override("breakpoint_color", EDITOR_DEF("text_editor/highlighting/breakpoint_color", Color(0.8,0.8,0.4,0.2))); + text_edit->add_color_override("search_result_color",EDITOR_DEF("text_editor/highlighting/search_result_color",Color(0.05,0.25,0.05,1))); + text_edit->add_color_override("search_result_border_color",EDITOR_DEF("text_editor/highlighting/search_result_border_color",Color(0.1,0.45,0.1,1))); + text_edit->add_color_override("symbol_color",EDITOR_DEF("text_editor/highlighting/symbol_color",Color::hex(0x005291ff))); + text_edit->add_constant_override("line_spacing", EDITOR_DEF("text_editor/theme/line_spacing",4)); + + Color keyword_color= EDITOR_DEF("text_editor/highlighting/keyword_color",Color(0.5,0.0,0.2)); List<String> keywords; script->get_language()->get_reserved_words(&keywords); @@ -135,7 +135,7 @@ void ScriptTextEditor::_load_theme_settings() { } //colorize core types - Color basetype_color= EDITOR_DEF("text_editor/base_type_color",Color(0.3,0.3,0.0)); + Color basetype_color= EDITOR_DEF("text_editor/highlighting/base_type_color",Color(0.3,0.3,0.0)); text_edit->add_keyword_color("Vector2",basetype_color); text_edit->add_keyword_color("Vector3",basetype_color); @@ -151,10 +151,10 @@ void ScriptTextEditor::_load_theme_settings() { text_edit->add_keyword_color("NodePath",basetype_color); //colorize engine types - Color type_color= EDITOR_DEF("text_editor/engine_type_color",Color(0.0,0.2,0.4)); + Color type_color= EDITOR_DEF("text_editor/highlighting/engine_type_color",Color(0.0,0.2,0.4)); List<StringName> types; - ObjectTypeDB::get_type_list(&types); + ClassDB::get_class_list(&types); for(List<StringName>::Element *E=types.front();E;E=E->next()) { @@ -166,7 +166,7 @@ void ScriptTextEditor::_load_theme_settings() { } //colorize comments - Color comment_color = EDITOR_DEF("text_editor/comment_color",Color::hex(0x797e7eff)); + Color comment_color = EDITOR_DEF("text_editor/highlighting/comment_color",Color::hex(0x797e7eff)); List<String> comments; script->get_language()->get_comment_delimiters(&comments); @@ -180,7 +180,7 @@ void ScriptTextEditor::_load_theme_settings() { } //colorize strings - Color string_color = EDITOR_DEF("text_editor/string_color",Color::hex(0x6b6f00ff)); + Color string_color = EDITOR_DEF("text_editor/highlighting/string_color",Color::hex(0x6b6f00ff)); List<String> strings; script->get_language()->get_string_delimiters(&strings); @@ -225,7 +225,7 @@ void ScriptTextEditor::_notification(int p_what) { } } -void ScriptTextEditor::add_callback(const String& p_function,StringArray p_args) { +void ScriptTextEditor::add_callback(const String& p_function,PoolStringArray p_args) { String code = code_editor->get_text_edit()->get_text(); int pos = script->get_language()->find_function(p_function,code); @@ -332,7 +332,7 @@ String ScriptTextEditor::get_name() { } else if (script->get_name()!="") name=script->get_name(); else - name=script->get_type()+"("+itos(script->get_instance_ID())+")"; + name=script->get_class()+"("+itos(script->get_instance_ID())+")"; return name; @@ -340,8 +340,8 @@ String ScriptTextEditor::get_name() { Ref<Texture> ScriptTextEditor::get_icon() { - if (get_parent_control() && get_parent_control()->has_icon(script->get_type(),"EditorIcons")) { - return get_parent_control()->get_icon(script->get_type(),"EditorIcons"); + if (get_parent_control() && get_parent_control()->has_icon(script->get_class(),"EditorIcons")) { + return get_parent_control()->get_icon(script->get_class(),"EditorIcons"); } return Ref<Texture>(); @@ -438,7 +438,7 @@ static void _find_changed_scripts_for_external_editor(Node* p_base, Node*p_curre void ScriptEditor::_update_modified_scripts_for_external_editor(Ref<Script> p_for_script) { - if (!bool(EditorSettings::get_singleton()->get("external_editor/use_external_editor"))) + if (!bool(EditorSettings::get_singleton()->get("text_editor/external/use_external_editor"))) return; Set<Ref<Script> > scripts; @@ -465,7 +465,7 @@ void ScriptEditor::_update_modified_scripts_for_external_editor(Ref<Script> p_fo if (last_date!=date) { - Ref<Script> rel_script = ResourceLoader::load(script->get_path(),script->get_type(),true); + Ref<Script> rel_script = ResourceLoader::load(script->get_path(),script->get_class(),true); ERR_CONTINUE(!rel_script.is_valid()); script->set_source_code( rel_script->get_source_code() ); script->set_last_modified_time( rel_script->get_last_modified_time() ); @@ -544,10 +544,10 @@ void ScriptTextEditor::_lookup_symbol(const String& p_symbol,int p_row, int p_co StringName cname = result.class_name; bool success; while(true) { - ObjectTypeDB::get_integer_constant(cname,result.class_member,&success); + ClassDB::get_integer_constant(cname,result.class_member,&success); if (success) { result.class_name=cname; - cname=ObjectTypeDB::type_inherits_from(cname); + cname=ClassDB::get_parent_class(cname); } else { break; } @@ -566,9 +566,9 @@ void ScriptTextEditor::_lookup_symbol(const String& p_symbol,int p_row, int p_co StringName cname = result.class_name; while(true) { - if (ObjectTypeDB::has_method(cname,result.class_member)) { + if (ClassDB::has_method(cname,result.class_member)) { result.class_name=cname; - cname=ObjectTypeDB::type_inherits_from(cname); + cname=ClassDB::get_parent_class(cname); } else { break; } @@ -973,19 +973,19 @@ void ScriptTextEditor::_edit_option(int p_op) { void ScriptTextEditor::_bind_methods() { - ObjectTypeDB::bind_method("_validate_script",&ScriptTextEditor::_validate_script); - ObjectTypeDB::bind_method("_load_theme_settings",&ScriptTextEditor::_load_theme_settings); - ObjectTypeDB::bind_method("_breakpoint_toggled",&ScriptTextEditor::_breakpoint_toggled); - ObjectTypeDB::bind_method("_edit_option",&ScriptTextEditor::_edit_option); - ObjectTypeDB::bind_method("_goto_line",&ScriptTextEditor::_goto_line); - ObjectTypeDB::bind_method("_lookup_symbol",&ScriptTextEditor::_lookup_symbol); - ObjectTypeDB::bind_method("_text_edit_input_event", &ScriptTextEditor::_text_edit_input_event); - ObjectTypeDB::bind_method("_color_changed", &ScriptTextEditor::_color_changed); + ClassDB::bind_method("_validate_script",&ScriptTextEditor::_validate_script); + ClassDB::bind_method("_load_theme_settings",&ScriptTextEditor::_load_theme_settings); + ClassDB::bind_method("_breakpoint_toggled",&ScriptTextEditor::_breakpoint_toggled); + ClassDB::bind_method("_edit_option",&ScriptTextEditor::_edit_option); + ClassDB::bind_method("_goto_line",&ScriptTextEditor::_goto_line); + ClassDB::bind_method("_lookup_symbol",&ScriptTextEditor::_lookup_symbol); + ClassDB::bind_method("_text_edit_gui_input", &ScriptTextEditor::_text_edit_gui_input); + ClassDB::bind_method("_color_changed", &ScriptTextEditor::_color_changed); - ObjectTypeDB::bind_method("get_drag_data_fw",&ScriptTextEditor::get_drag_data_fw); - ObjectTypeDB::bind_method("can_drop_data_fw",&ScriptTextEditor::can_drop_data_fw); - ObjectTypeDB::bind_method("drop_data_fw",&ScriptTextEditor::drop_data_fw); + ClassDB::bind_method("get_drag_data_fw",&ScriptTextEditor::get_drag_data_fw); + ClassDB::bind_method("can_drop_data_fw",&ScriptTextEditor::can_drop_data_fw); + ClassDB::bind_method("drop_data_fw",&ScriptTextEditor::drop_data_fw); } @@ -1159,7 +1159,7 @@ void ScriptTextEditor::drop_data_fw(const Point2& p_point,const Variant& p_data, } -void ScriptTextEditor::_text_edit_input_event(const InputEvent& ev) { +void ScriptTextEditor::_text_edit_gui_input(const InputEvent& ev) { if (ev.type == InputEvent::MOUSE_BUTTON) { InputEventMouseButton mb = ev.mouse_button; if (mb.button_index == BUTTON_RIGHT && !mb.pressed) { @@ -1226,20 +1226,21 @@ void ScriptTextEditor::_make_context_menu(bool p_selection, bool p_color) { context_menu->clear(); if (p_selection) { - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/cut")); - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/copy")); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/cut"), EDIT_CUT); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/copy"), EDIT_COPY); } - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/paste")); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/paste"), EDIT_PASTE); context_menu->add_separator(); - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/select_all")); - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/undo")); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/select_all"), EDIT_SELECT_ALL); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/undo"), EDIT_UNDO); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/redo"), EDIT_REDO); if (p_selection) { context_menu->add_separator(); - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/indent_left")); - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/indent_right")); - context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/toggle_comment")); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/indent_left"), EDIT_INDENT_LEFT); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/indent_right"), EDIT_INDENT_RIGHT); + context_menu->add_shortcut(ED_GET_SHORTCUT("script_text_editor/toggle_comment"), EDIT_TOGGLE_COMMENT); } if (p_color) { context_menu->add_separator(); @@ -1264,22 +1265,22 @@ ScriptTextEditor::ScriptTextEditor() { update_settings(); code_editor->get_text_edit()->set_callhint_settings( - EditorSettings::get_singleton()->get("text_editor/put_callhint_tooltip_below_current_line"), - EditorSettings::get_singleton()->get("text_editor/callhint_tooltip_offset")); + EditorSettings::get_singleton()->get("text_editor/completion/put_callhint_tooltip_below_current_line"), + EditorSettings::get_singleton()->get("text_editor/completion/callhint_tooltip_offset")); code_editor->get_text_edit()->set_select_identifiers_on_hover(true); code_editor->get_text_edit()->set_context_menu_enabled(false); - code_editor->get_text_edit()->connect("input_event", this, "_text_edit_input_event"); + code_editor->get_text_edit()->connect("gui_input", this, "_text_edit_gui_input"); context_menu = memnew(PopupMenu); add_child(context_menu); - context_menu->connect("item_pressed", this, "_edit_option"); + context_menu->connect("id_pressed", this, "_edit_option"); color_panel = memnew(PopupPanel); add_child(color_panel); color_picker = memnew(ColorPicker); color_panel->add_child(color_picker); - color_panel->set_child_rect(color_picker); + color_panel->set_child_rect(color_picker); //NOT color_picker->connect("color_changed", this, "_color_changed"); edit_hb = memnew (HBoxContainer); @@ -1309,7 +1310,7 @@ ScriptTextEditor::ScriptTextEditor() { #endif edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/trim_trailing_whitespace"), EDIT_TRIM_TRAILING_WHITESAPCE); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/auto_indent"), EDIT_AUTO_INDENT); - edit_menu->get_popup()->connect("item_pressed", this,"_edit_option"); + edit_menu->get_popup()->connect("id_pressed", this,"_edit_option"); edit_menu->get_popup()->add_separator(); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/toggle_breakpoint"), DEBUG_TOGGLE_BREAKPOINT); edit_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/remove_all_breakpoints"), DEBUG_REMOVE_ALL_BREAKPOINTS); @@ -1329,7 +1330,7 @@ ScriptTextEditor::ScriptTextEditor() { search_menu->get_popup()->add_separator(); search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/contextual_help"), HELP_CONTEXTUAL); - search_menu->get_popup()->connect("item_pressed", this,"_edit_option"); + search_menu->get_popup()->connect("id_pressed", this,"_edit_option"); edit_hb->add_child(edit_menu); @@ -1363,8 +1364,12 @@ void ScriptTextEditor::register_editor() { ED_SHORTCUT("script_text_editor/select_all", TTR("Select All"), KEY_MASK_CMD|KEY_A); ED_SHORTCUT("script_text_editor/move_up", TTR("Move Up"), KEY_MASK_ALT|KEY_UP); ED_SHORTCUT("script_text_editor/move_down", TTR("Move Down"), KEY_MASK_ALT|KEY_DOWN); - ED_SHORTCUT("script_text_editor/indent_left", TTR("Indent Left"), KEY_MASK_ALT|KEY_LEFT); - ED_SHORTCUT("script_text_editor/indent_right", TTR("Indent Right"), KEY_MASK_ALT|KEY_RIGHT); + + //leave these at zero, same can be accomplished with tab/shift-tab, including selection + //the next/previous in history shortcut in this case makes a lot more sene. + + ED_SHORTCUT("script_text_editor/indent_left", TTR("Indent Left"), 0); + ED_SHORTCUT("script_text_editor/indent_right", TTR("Indent Right"), 0); ED_SHORTCUT("script_text_editor/toggle_comment", TTR("Toggle Comment"), KEY_MASK_CMD|KEY_K); ED_SHORTCUT("script_text_editor/clone_down", TTR("Clone Down"), KEY_MASK_CMD|KEY_B); #ifdef OSX_ENABLED diff --git a/tools/editor/plugins/script_text_editor.h b/tools/editor/plugins/script_text_editor.h index ceef50f0bc..e30a78340e 100644 --- a/tools/editor/plugins/script_text_editor.h +++ b/tools/editor/plugins/script_text_editor.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ class ScriptTextEditor : public ScriptEditorBase { - OBJ_TYPE( ScriptTextEditor, ScriptEditorBase ); + GDCLASS( ScriptTextEditor, ScriptEditorBase ); CodeTextEditor *code_editor; @@ -105,7 +105,7 @@ protected: void _edit_option(int p_op); void _make_context_menu(bool p_selection, bool p_color); - void _text_edit_input_event(const InputEvent& ev); + void _text_edit_gui_input(const InputEvent& ev); void _color_changed(const Color& p_color); void _goto_line(int p_line) { goto_line(p_line); } @@ -137,7 +137,7 @@ public: virtual void reload(bool p_soft); virtual void get_breakpoints(List<int> *p_breakpoints); - virtual void add_callback(const String& p_function,StringArray p_args); + virtual void add_callback(const String& p_function,PoolStringArray p_args); virtual void update_settings(); virtual bool goto_method(const String& p_method); diff --git a/tools/editor/plugins/shader_editor_plugin.cpp b/tools/editor/plugins/shader_editor_plugin.cpp index f67151d8e9..17b10ecd70 100644 --- a/tools/editor/plugins/shader_editor_plugin.cpp +++ b/tools/editor/plugins/shader_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ #include "tools/editor/editor_node.h" #include "tools/editor/property_editor.h" #include "os/os.h" - +#include "servers/visual/shader_types.h" /*** SETTINGS EDITOR ****/ @@ -51,19 +51,14 @@ Ref<Shader> ShaderTextEditor::get_edited_shader() const { return shader; } -void ShaderTextEditor::set_edited_shader(const Ref<Shader>& p_shader,ShaderLanguage::ShaderType p_type) { +void ShaderTextEditor::set_edited_shader(const Ref<Shader>& p_shader) { shader=p_shader; - type=p_type; + _load_theme_settings(); - if (p_type==ShaderLanguage::SHADER_MATERIAL_LIGHT || p_type==ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT) - get_text_edit()->set_text(shader->get_light_code()); - else if (p_type==ShaderLanguage::SHADER_MATERIAL_VERTEX || p_type==ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX) - get_text_edit()->set_text(shader->get_vertex_code()); - else - get_text_edit()->set_text(shader->get_fragment_code()); + get_text_edit()->set_text(p_shader->get_code()); _line_col_changed(); @@ -77,35 +72,53 @@ void ShaderTextEditor::_load_theme_settings() { /* keyword color */ - get_text_edit()->add_color_override("background_color", EDITOR_DEF("text_editor/background_color",Color(0,0,0,0))); - get_text_edit()->add_color_override("completion_background_color", EDITOR_DEF("text_editor/completion_background_color", Color(0,0,0,0))); - get_text_edit()->add_color_override("completion_selected_color", EDITOR_DEF("text_editor/completion_selected_color", Color::html("434244"))); - get_text_edit()->add_color_override("completion_existing_color", EDITOR_DEF("text_editor/completion_existing_color", Color::html("21dfdfdf"))); - get_text_edit()->add_color_override("completion_scroll_color", EDITOR_DEF("text_editor/completion_scroll_color", Color::html("ffffff"))); - get_text_edit()->add_color_override("completion_font_color", EDITOR_DEF("text_editor/completion_font_color", Color::html("aaaaaa"))); - get_text_edit()->add_color_override("font_color",EDITOR_DEF("text_editor/text_color",Color(0,0,0))); - get_text_edit()->add_color_override("line_number_color",EDITOR_DEF("text_editor/line_number_color",Color(0,0,0))); - get_text_edit()->add_color_override("caret_color",EDITOR_DEF("text_editor/caret_color",Color(0,0,0))); - get_text_edit()->add_color_override("caret_background_color",EDITOR_DEF("text_editor/caret_background_color",Color(0,0,0))); - get_text_edit()->add_color_override("font_selected_color",EDITOR_DEF("text_editor/text_selected_color",Color(1,1,1))); - get_text_edit()->add_color_override("selection_color",EDITOR_DEF("text_editor/selection_color",Color(0.2,0.2,1))); - get_text_edit()->add_color_override("brace_mismatch_color",EDITOR_DEF("text_editor/brace_mismatch_color",Color(1,0.2,0.2))); - get_text_edit()->add_color_override("current_line_color",EDITOR_DEF("text_editor/current_line_color",Color(0.3,0.5,0.8,0.15))); - get_text_edit()->add_color_override("word_highlighted_color",EDITOR_DEF("text_editor/word_highlighted_color",Color(0.8,0.9,0.9,0.15))); - get_text_edit()->add_color_override("number_color",EDITOR_DEF("text_editor/number_color",Color(0.9,0.6,0.0,2))); - get_text_edit()->add_color_override("function_color",EDITOR_DEF("text_editor/function_color",Color(0.4,0.6,0.8))); - get_text_edit()->add_color_override("member_variable_color",EDITOR_DEF("text_editor/member_variable_color",Color(0.9,0.3,0.3))); - get_text_edit()->add_color_override("mark_color", EDITOR_DEF("text_editor/mark_color", Color(1.0,0.4,0.4,0.4))); - get_text_edit()->add_color_override("breakpoint_color", EDITOR_DEF("text_editor/breakpoint_color", Color(0.8,0.8,0.4,0.2))); - get_text_edit()->add_color_override("search_result_color",EDITOR_DEF("text_editor/search_result_color",Color(0.05,0.25,0.05,1))); - get_text_edit()->add_color_override("search_result_border_color",EDITOR_DEF("text_editor/search_result_border_color",Color(0.1,0.45,0.1,1))); - get_text_edit()->add_color_override("symbol_color",EDITOR_DEF("text_editor/symbol_color",Color::hex(0x005291ff))); - - Color keyword_color= EDITOR_DEF("text_editor/keyword_color",Color(0.5,0.0,0.2)); + get_text_edit()->add_color_override("background_color", EDITOR_DEF("text_editor/highlighting/background_color",Color(0,0,0,0))); + get_text_edit()->add_color_override("completion_background_color", EDITOR_DEF("text_editor/highlighting/completion_background_color", Color(0,0,0,0))); + get_text_edit()->add_color_override("completion_selected_color", EDITOR_DEF("text_editor/highlighting/completion_selected_color", Color::html("434244"))); + get_text_edit()->add_color_override("completion_existing_color", EDITOR_DEF("text_editor/highlighting/completion_existing_color", Color::html("21dfdfdf"))); + get_text_edit()->add_color_override("completion_scroll_color", EDITOR_DEF("text_editor/highlighting/completion_scroll_color", Color::html("ffffff"))); + get_text_edit()->add_color_override("completion_font_color", EDITOR_DEF("text_editor/highlighting/completion_font_color", Color::html("aaaaaa"))); + get_text_edit()->add_color_override("font_color",EDITOR_DEF("text_editor/highlighting/text_color",Color(0,0,0))); + get_text_edit()->add_color_override("line_number_color",EDITOR_DEF("text_editor/highlighting/line_number_color",Color(0,0,0))); + get_text_edit()->add_color_override("caret_color",EDITOR_DEF("text_editor/highlighting/caret_color",Color(0,0,0))); + get_text_edit()->add_color_override("caret_background_color",EDITOR_DEF("text_editor/highlighting/caret_background_color",Color(0,0,0))); + get_text_edit()->add_color_override("font_selected_color",EDITOR_DEF("text_editor/highlighting/text_selected_color",Color(1,1,1))); + get_text_edit()->add_color_override("selection_color",EDITOR_DEF("text_editor/highlighting/selection_color",Color(0.2,0.2,1))); + get_text_edit()->add_color_override("brace_mismatch_color",EDITOR_DEF("text_editor/highlighting/brace_mismatch_color",Color(1,0.2,0.2))); + get_text_edit()->add_color_override("current_line_color",EDITOR_DEF("text_editor/highlighting/current_line_color",Color(0.3,0.5,0.8,0.15))); + get_text_edit()->add_color_override("word_highlighted_color",EDITOR_DEF("text_editor/highlighting/word_highlighted_color",Color(0.8,0.9,0.9,0.15))); + get_text_edit()->add_color_override("number_color",EDITOR_DEF("text_editor/highlighting/number_color",Color(0.9,0.6,0.0,2))); + get_text_edit()->add_color_override("function_color",EDITOR_DEF("text_editor/highlighting/function_color",Color(0.4,0.6,0.8))); + get_text_edit()->add_color_override("member_variable_color",EDITOR_DEF("text_editor/highlighting/member_variable_color",Color(0.9,0.3,0.3))); + get_text_edit()->add_color_override("mark_color", EDITOR_DEF("text_editor/highlighting/mark_color", Color(1.0,0.4,0.4,0.4))); + get_text_edit()->add_color_override("breakpoint_color", EDITOR_DEF("text_editor/highlighting/breakpoint_color", Color(0.8,0.8,0.4,0.2))); + get_text_edit()->add_color_override("search_result_color",EDITOR_DEF("text_editor/highlighting/search_result_color",Color(0.05,0.25,0.05,1))); + get_text_edit()->add_color_override("search_result_border_color",EDITOR_DEF("text_editor/highlighting/search_result_border_color",Color(0.1,0.45,0.1,1))); + get_text_edit()->add_color_override("symbol_color",EDITOR_DEF("text_editor/highlighting/symbol_color",Color::hex(0x005291ff))); + + Color keyword_color= EDITOR_DEF("text_editor/highlighting/keyword_color",Color(0.5,0.0,0.2)); List<String> keywords; - ShaderLanguage::get_keyword_list(type,&keywords); + ShaderLanguage::get_keyword_list(&keywords); + + if (shader.is_valid()) { + + + for(const Map< StringName, Map<StringName,ShaderLanguage::DataType> >::Element *E=ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader->get_mode())).front();E;E=E->next()) { + + for (const Map<StringName,ShaderLanguage::DataType>::Element *F=E->get().front();F;F=F->next()) { + keywords.push_back(F->key()); + } + + } + + for(const Set<String>::Element *E =ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode())).front();E;E=E->next()) { + + keywords.push_back(E->get()); + + } + } for(List<String>::Element *E=keywords.front();E;E=E->next()) { @@ -118,7 +131,7 @@ void ShaderTextEditor::_load_theme_settings() { //colorize comments - Color comment_color = EDITOR_DEF("text_editor/comment_color",Color::hex(0x797e7eff)); + Color comment_color = EDITOR_DEF("text_editor/highlighting/comment_color",Color::hex(0x797e7eff)); get_text_edit()->add_color_region("/*","*/",comment_color,false); get_text_edit()->add_color_region("//","",comment_color,false); @@ -138,22 +151,34 @@ void ShaderTextEditor::_load_theme_settings() { }*/ } +void ShaderTextEditor::_code_complete_script(const String& p_code, List<String>* r_options) { -void ShaderTextEditor::_validate_script() { + print_line("code complete"); + + ShaderLanguage sl; + String calltip; + + Error err = sl.complete(p_code,ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader->get_mode())),ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode())),r_options,calltip); + + if (calltip!="") { + get_text_edit()->set_code_hint(calltip); + } +} - String errortxt; - int line,col; +void ShaderTextEditor::_validate_script() { String code=get_text_edit()->get_text(); //List<StringName> params; //shader->get_param_list(¶ms); - Error err = ShaderLanguage::compile(code,type,NULL,NULL,&errortxt,&line,&col); + ShaderLanguage sl; + + Error err = sl.compile(code,ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader->get_mode())),ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode()))); if (err!=OK) { - String error_text="error("+itos(line+1)+","+itos(col+1)+"): "+errortxt; + String error_text="error("+itos(sl.get_error_line())+"): "+sl.get_error_text(); set_error(error_text); - get_text_edit()->set_line_as_marked(line,true); + get_text_edit()->set_line_as_marked(sl.get_error_line(),true); } else { for(int i=0;i<get_text_edit()->get_line_count();i++) @@ -183,9 +208,7 @@ ShaderTextEditor::ShaderTextEditor() { void ShaderEditor::_menu_option(int p_option) { - ShaderTextEditor *current = tab_container->get_current_tab_control()->cast_to<ShaderTextEditor>(); - if (!current) - return; + ShaderTextEditor *current = shader_editor; switch(p_option) { case EDIT_UNDO: { @@ -241,24 +264,11 @@ void ShaderEditor::_menu_option(int p_option) { } } -void ShaderEditor::_tab_changed(int p_which) { - - ShaderTextEditor *shader_editor = tab_container->get_tab_control(p_which)->cast_to<ShaderTextEditor>(); - - if (shader_editor && is_inside_tree()) - shader_editor->get_text_edit()->grab_focus(); - - ensure_select_current(); -} void ShaderEditor::_notification(int p_what) { if (p_what==NOTIFICATION_ENTER_TREE) { - close->set_normal_texture( get_icon("Close","EditorIcons")); - close->set_hover_texture( get_icon("CloseHover","EditorIcons")); - close->set_pressed_texture( get_icon("Close","EditorIcons")); - close->connect("pressed",this,"_close_callback"); } if (p_what==NOTIFICATION_DRAW) { @@ -361,27 +371,32 @@ void ShaderEditor::clear() { void ShaderEditor::_params_changed() { - fragment_editor->_validate_script(); - vertex_editor->_validate_script(); - light_editor->_validate_script(); + shader_editor->_validate_script(); } void ShaderEditor::_editor_settings_changed() { - vertex_editor->update_editor_settings(); - fragment_editor->update_editor_settings(); - light_editor->update_editor_settings(); + shader_editor->get_text_edit()->set_auto_brace_completion(EditorSettings::get_singleton()->get("text_editor/completion/auto_brace_complete")); + shader_editor->get_text_edit()->set_scroll_pass_end_of_file(EditorSettings::get_singleton()->get("text_editor/cursor/scroll_past_end_of_file")); + shader_editor->get_text_edit()->set_tab_size(EditorSettings::get_singleton()->get("text_editor/indent/tab_size")); + shader_editor->get_text_edit()->set_draw_tabs(EditorSettings::get_singleton()->get("text_editor/indent/draw_tabs")); + shader_editor->get_text_edit()->set_show_line_numbers(EditorSettings::get_singleton()->get("text_editor/line_numbers/show_line_numbers")); + shader_editor->get_text_edit()->set_syntax_coloring(EditorSettings::get_singleton()->get("text_editor/highlighting/syntax_highlighting")); + shader_editor->get_text_edit()->set_highlight_all_occurrences(EditorSettings::get_singleton()->get("text_editor/highlighting/highlight_all_occurrences")); + shader_editor->get_text_edit()->cursor_set_blink_enabled(EditorSettings::get_singleton()->get("text_editor/cursor/caret_blink")); + shader_editor->get_text_edit()->cursor_set_blink_speed(EditorSettings::get_singleton()->get("text_editor/cursor/caret_blink_speed")); + shader_editor->get_text_edit()->add_constant_override("line_spacing", EditorSettings::get_singleton()->get("text_editor/theme/line_spacing")); + shader_editor->get_text_edit()->cursor_set_block_mode(EditorSettings::get_singleton()->get("text_editor/cursor/block_caret")); } void ShaderEditor::_bind_methods() { - ObjectTypeDB::bind_method("_editor_settings_changed",&ShaderEditor::_editor_settings_changed); - ObjectTypeDB::bind_method("_tab_changed",&ShaderEditor::_tab_changed); - ObjectTypeDB::bind_method("_menu_option",&ShaderEditor::_menu_option); - ObjectTypeDB::bind_method("_params_changed",&ShaderEditor::_params_changed); - ObjectTypeDB::bind_method("_close_callback",&ShaderEditor::_close_callback); - ObjectTypeDB::bind_method("apply_shaders",&ShaderEditor::apply_shaders); -// ObjectTypeDB::bind_method("_close_current_tab",&ShaderEditor::_close_current_tab); + ClassDB::bind_method("_editor_settings_changed",&ShaderEditor::_editor_settings_changed); + + ClassDB::bind_method("_menu_option",&ShaderEditor::_menu_option); + ClassDB::bind_method("_params_changed",&ShaderEditor::_params_changed); + ClassDB::bind_method("apply_shaders",&ShaderEditor::apply_shaders); +// ClassDB::bind_method("_close_current_tab",&ShaderEditor::_close_current_tab); } void ShaderEditor::ensure_select_current() { @@ -405,16 +420,7 @@ void ShaderEditor::edit(const Ref<Shader>& p_shader) { shader=p_shader; - if (shader->get_mode()==Shader::MODE_MATERIAL) { - vertex_editor->set_edited_shader(p_shader,ShaderLanguage::SHADER_MATERIAL_VERTEX); - fragment_editor->set_edited_shader(p_shader,ShaderLanguage::SHADER_MATERIAL_FRAGMENT); - light_editor->set_edited_shader(shader,ShaderLanguage::SHADER_MATERIAL_LIGHT); - } else if (shader->get_mode()==Shader::MODE_CANVAS_ITEM) { - - vertex_editor->set_edited_shader(p_shader,ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX); - fragment_editor->set_edited_shader(p_shader,ShaderLanguage::SHADER_CANVAS_ITEM_FRAGMENT); - light_editor->set_edited_shader(shader,ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT); - } + shader_editor->set_edited_shader(p_shader); //vertex_editor->set_edited_shader(shader,ShaderLanguage::SHADER_MATERIAL_VERTEX); // see if already has it @@ -438,35 +444,21 @@ void ShaderEditor::apply_shaders() { if (shader.is_valid()) { - shader->set_code(vertex_editor->get_text_edit()->get_text(),fragment_editor->get_text_edit()->get_text(),light_editor->get_text_edit()->get_text(),0,0); + shader->set_code(shader_editor->get_text_edit()->get_text()); shader->set_edited(true); } } -void ShaderEditor::_close_callback() { - - hide(); -} - ShaderEditor::ShaderEditor() { - tab_container = memnew( TabContainer ); - add_child(tab_container); - tab_container->set_area_as_parent_rect(); - tab_container->set_begin(Point2(0,0)); - //tab_container->set_begin(Point2(0,0)); - - close = memnew( TextureButton ); - close->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_END,20); - close->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_END,4); - close->set_anchor_and_margin(MARGIN_TOP,ANCHOR_BEGIN,2); - add_child(close); + HBoxContainer *hbc = memnew( HBoxContainer); + add_child(hbc); edit_menu = memnew( MenuButton ); - add_child(edit_menu); + hbc->add_child(edit_menu); edit_menu->set_pos(Point2(5,-1)); edit_menu->set_text(TTR("Edit")); edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/undo", TTR("Undo"), KEY_MASK_CMD|KEY_Z), EDIT_UNDO); @@ -477,11 +469,11 @@ ShaderEditor::ShaderEditor() { edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/paste", TTR("Paste"), KEY_MASK_CMD|KEY_V), EDIT_PASTE); edit_menu->get_popup()->add_separator(); edit_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/select_all", TTR("Select All"), KEY_MASK_CMD|KEY_A), EDIT_SELECT_ALL); - edit_menu->get_popup()->connect("item_pressed", this,"_menu_option"); + edit_menu->get_popup()->connect("id_pressed", this,"_menu_option"); search_menu = memnew( MenuButton ); - add_child(search_menu); + hbc->add_child(search_menu); search_menu->set_pos(Point2(38,-1)); search_menu->set_text(TTR("Search")); search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/find", TTR("Find.."), KEY_MASK_CMD|KEY_F), SEARCH_FIND); @@ -491,37 +483,18 @@ ShaderEditor::ShaderEditor() { search_menu->get_popup()->add_separator(); // search_menu->get_popup()->add_item("Locate Symbol..",SEARCH_LOCATE_SYMBOL,KEY_MASK_CMD|KEY_K); search_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/goto_line", TTR("Goto Line.."), KEY_MASK_CMD|KEY_L), SEARCH_GOTO_LINE); - search_menu->get_popup()->connect("item_pressed", this,"_menu_option"); - - - tab_container->connect("tab_changed", this,"_tab_changed"); - - erase_tab_confirm = memnew( ConfirmationDialog ); - add_child(erase_tab_confirm); - erase_tab_confirm->connect("confirmed", this,"_close_current_tab"); + search_menu->get_popup()->connect("id_pressed", this,"_menu_option"); goto_line_dialog = memnew(GotoLineDialog); add_child(goto_line_dialog); - vertex_editor = memnew( ShaderTextEditor ); - tab_container->add_child(vertex_editor); - vertex_editor->set_name(TTR("Vertex")); + shader_editor = memnew( ShaderTextEditor ); + add_child(shader_editor); + shader_editor->set_v_size_flags(SIZE_EXPAND_FILL); - fragment_editor = memnew( ShaderTextEditor ); - tab_container->add_child(fragment_editor); - fragment_editor->set_name(TTR("Fragment")); - light_editor = memnew( ShaderTextEditor ); - tab_container->add_child(light_editor); - light_editor->set_name(TTR("Lighting")); - - tab_container->set_current_tab(1); - - - vertex_editor->connect("script_changed", this,"apply_shaders"); - fragment_editor->connect("script_changed", this,"apply_shaders"); - light_editor->connect("script_changed", this,"apply_shaders"); + shader_editor->connect("script_changed", this,"apply_shaders"); EditorSettings::get_singleton()->connect("settings_changed",this,"_editor_settings_changed"); _editor_settings_changed(); @@ -531,15 +504,7 @@ ShaderEditor::ShaderEditor() { void ShaderEditorPlugin::edit(Object *p_object) { Shader* s = p_object->cast_to<Shader>(); - if (!s || s->cast_to<ShaderGraph>()) { - shader_editor->hide(); //Dont edit ShaderGraph - return; - } - - if (_2d && s->get_mode()==Shader::MODE_CANVAS_ITEM) - shader_editor->edit(s); - else if (!_2d && s->get_mode()==Shader::MODE_MATERIAL) - shader_editor->edit(s); + shader_editor->edit(s); } @@ -547,24 +512,25 @@ bool ShaderEditorPlugin::handles(Object *p_object) const { bool handles = true; Shader *shader=p_object->cast_to<Shader>(); - if (!shader || shader->cast_to<ShaderGraph>()) // Dont handle ShaderGraph's - handles = false; - if (handles && _2d) - handles = shader->get_mode()==Shader::MODE_CANVAS_ITEM; - else if (handles && !_2d) - return shader->get_mode()==Shader::MODE_MATERIAL; - - if (!handles) - shader_editor->hide(); - return handles; + //if (!shader || shader->cast_to<ShaderGraph>()) // Dont handle ShaderGraph's + // handles = false; + + return shader!=NULL; } void ShaderEditorPlugin::make_visible(bool p_visible) { if (p_visible) { - shader_editor->show(); + button->show(); + editor->make_bottom_panel_item_visible(shader_editor); + } else { + + button->hide(); + if (shader_editor->is_visible()) + editor->hide_bottom_panel(); shader_editor->apply_shaders(); + } } @@ -598,19 +564,14 @@ void ShaderEditorPlugin::apply_changes() { shader_editor->apply_shaders(); } -ShaderEditorPlugin::ShaderEditorPlugin(EditorNode *p_node, bool p_2d) { +ShaderEditorPlugin::ShaderEditorPlugin(EditorNode *p_node) { + editor=p_node; shader_editor = memnew( ShaderEditor ); - _2d=p_2d; - if (p_2d) - add_control_to_container(CONTAINER_CANVAS_EDITOR_BOTTOM,shader_editor); - else - add_control_to_container(CONTAINER_SPATIAL_EDITOR_BOTTOM,shader_editor); -// editor->get_viewport()->add_child(shader_editor); -// shader_editor->set_area_as_parent_rect(); - shader_editor->hide(); + shader_editor->set_custom_minimum_size(Size2(0,300)); + button=editor->add_bottom_panel_item("Shader",shader_editor); } @@ -618,3 +579,4 @@ ShaderEditorPlugin::ShaderEditorPlugin(EditorNode *p_node, bool p_2d) { ShaderEditorPlugin::~ShaderEditorPlugin() { } + diff --git a/tools/editor/plugins/shader_editor_plugin.h b/tools/editor/plugins/shader_editor_plugin.h index 9219a1fbc2..e94b4d9c25 100644 --- a/tools/editor/plugins/shader_editor_plugin.h +++ b/tools/editor/plugins/shader_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -38,33 +38,34 @@ #include "scene/resources/shader.h" #include "servers/visual/shader_language.h" - class ShaderTextEditor : public CodeTextEditor { - OBJ_TYPE( ShaderTextEditor, CodeTextEditor ); + GDCLASS( ShaderTextEditor, CodeTextEditor ); Ref<Shader> shader; - ShaderLanguage::ShaderType type; protected: static void _bind_methods(); virtual void _load_theme_settings(); + + virtual void _code_complete_script(const String& p_code, List<String>* r_options); + public: virtual void _validate_script(); Ref<Shader> get_edited_shader() const; - void set_edited_shader(const Ref<Shader>& p_shader,ShaderLanguage::ShaderType p_type); + void set_edited_shader(const Ref<Shader>& p_shader); ShaderTextEditor(); }; -class ShaderEditor : public Control { +class ShaderEditor : public VBoxContainer { - OBJ_TYPE(ShaderEditor, Control ); + GDCLASS(ShaderEditor, VBoxContainer ); enum { @@ -88,22 +89,17 @@ class ShaderEditor : public Control { MenuButton *settings_menu; uint64_t idle; - TabContainer *tab_container; GotoLineDialog *goto_line_dialog; ConfirmationDialog *erase_tab_confirm; - TextureButton *close; - ShaderTextEditor *vertex_editor; - ShaderTextEditor *fragment_editor; - ShaderTextEditor *light_editor; + ShaderTextEditor *shader_editor; + - void _tab_changed(int p_which); void _menu_option(int p_optin); void _params_changed(); mutable Ref<Shader> shader; - void _close_callback(); void _editor_settings_changed(); @@ -129,11 +125,13 @@ public: class ShaderEditorPlugin : public EditorPlugin { - OBJ_TYPE( ShaderEditorPlugin, EditorPlugin ); + GDCLASS( ShaderEditorPlugin, EditorPlugin ); bool _2d; ShaderEditor *shader_editor; EditorNode *editor; + Button *button; + public: virtual String get_name() const { return "Shader"; } @@ -150,8 +148,9 @@ public: virtual void save_external_data(); virtual void apply_changes(); - ShaderEditorPlugin(EditorNode *p_node,bool p_2d); + ShaderEditorPlugin(EditorNode *p_node); ~ShaderEditorPlugin(); }; + #endif diff --git a/tools/editor/plugins/shader_graph_editor_plugin.cpp b/tools/editor/plugins/shader_graph_editor_plugin.cpp index 3ab906f84e..2ff9f94d99 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.cpp +++ b/tools/editor/plugins/shader_graph_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -28,6 +28,7 @@ /*************************************************************************/ #include "shader_graph_editor_plugin.h" +#if 0 #include "scene/gui/check_box.h" #include "scene/gui/menu_button.h" @@ -36,7 +37,7 @@ #include "os/keyboard.h" #include "canvas_item_editor_plugin.h" -void GraphColorRampEdit::_input_event(const InputEvent& p_event) { +void GraphColorRampEdit::_gui_input(const InputEvent& p_event) { if (p_event.type==InputEvent::KEY && p_event.key.pressed && p_event.key.scancode==KEY_DELETE && grabbed!=-1) { @@ -295,8 +296,8 @@ Vector<Color> GraphColorRampEdit::get_colors() const{ void GraphColorRampEdit::_bind_methods(){ - ObjectTypeDB::bind_method(_MD("_input_event"),&GraphColorRampEdit::_input_event); - ObjectTypeDB::bind_method(_MD("_color_changed"),&GraphColorRampEdit::_color_changed); + ClassDB::bind_method(_MD("_gui_input"),&GraphColorRampEdit::_gui_input); + ClassDB::bind_method(_MD("_color_changed"),&GraphColorRampEdit::_color_changed); ADD_SIGNAL(MethodInfo("ramp_changed")); } @@ -309,13 +310,13 @@ GraphColorRampEdit::GraphColorRampEdit(){ popup = memnew( PopupPanel ); picker = memnew( ColorPicker ); popup->add_child(picker); - popup->set_child_rect(picker); + /popup->set_child_rect(picker); add_child(popup); } //////////// -void GraphCurveMapEdit::_input_event(const InputEvent& p_event) { +void GraphCurveMapEdit::_gui_input(const InputEvent& p_event) { if (p_event.type==InputEvent::KEY && p_event.key.pressed && p_event.key.scancode==KEY_DELETE && grabbed!=-1) { @@ -657,7 +658,7 @@ Vector<Vector2> GraphCurveMapEdit::get_points() const { void GraphCurveMapEdit::_bind_methods(){ - ObjectTypeDB::bind_method(_MD("_input_event"),&GraphCurveMapEdit::_input_event); + ClassDB::bind_method(_MD("_gui_input"),&GraphCurveMapEdit::_gui_input); ADD_SIGNAL(MethodInfo("curve_changed")); } @@ -985,13 +986,13 @@ void ShaderGraphView::_color_ramp_changed(int p_id,Node* p_ramp) { Vector<float> offsets=cr->get_offsets(); Vector<Color> colors=cr->get_colors(); - DVector<float> new_offsets; - DVector<Color> new_colors; + PoolVector<float> new_offsets; + PoolVector<Color> new_colors; { new_offsets.resize(offsets.size()); new_colors.resize(colors.size()); - DVector<float>::Write ow=new_offsets.write(); - DVector<Color>::Write cw=new_colors.write(); + PoolVector<float>::Write ow=new_offsets.write(); + PoolVector<Color>::Write cw=new_colors.write(); for(int i=0;i<new_offsets.size();i++) { ow[i]=offsets[i]; cw[i]=colors[i]; @@ -1000,8 +1001,8 @@ void ShaderGraphView::_color_ramp_changed(int p_id,Node* p_ramp) { } - DVector<float> old_offsets=graph->color_ramp_node_get_offsets(type,p_id); - DVector<Color> old_colors=graph->color_ramp_node_get_colors(type,p_id); + PoolVector<float> old_offsets=graph->color_ramp_node_get_offsets(type,p_id); + PoolVector<Color> old_colors=graph->color_ramp_node_get_colors(type,p_id); if (old_offsets.size()!=new_offsets.size()) ur->create_action(TTR("Add/Remove to Color Ramp")); @@ -1026,10 +1027,10 @@ void ShaderGraphView::_curve_changed(int p_id,Node* p_curve) { Vector<Point2> points=cr->get_points(); - DVector<Vector2> new_points; + PoolVector<Vector2> new_points; { new_points.resize(points.size()); - DVector<Vector2>::Write ow=new_points.write(); + PoolVector<Vector2>::Write ow=new_points.write(); for(int i=0;i<new_points.size();i++) { ow[i]=points[i]; } @@ -1037,7 +1038,7 @@ void ShaderGraphView::_curve_changed(int p_id,Node* p_curve) { } - DVector<Vector2> old_points=graph->curve_map_node_get_points(type,p_id); + PoolVector<Vector2> old_points=graph->curve_map_node_get_points(type,p_id); if (old_points.size()!=new_points.size()) ur->create_action(TTR("Add/Remove to Curve Map")); @@ -1377,7 +1378,7 @@ ToolButton *ShaderGraphView::make_editor(String text,GraphNode* gn,int p_id,int edit->set_icon(ped_popup->get_icon("Matrix", "EditorIcons")); break; case Variant::COLOR: { - Image icon_color = Image(15,15,false,Image::FORMAT_RGB); + Image icon_color = Image(15,15,false,Image::FORMAT_RGB8); Color c = graph->default_get_value(type,p_id,param); for (int x=1;x<14;x++) for (int y=1;y<14;y++) @@ -2130,14 +2131,14 @@ void ShaderGraphView::_create_node(int p_id) { gn->set_title("ColorRamp"); GraphColorRampEdit * ramp = memnew( GraphColorRampEdit ); - DVector<real_t> offsets = graph->color_ramp_node_get_offsets(type,p_id); - DVector<Color> colors = graph->color_ramp_node_get_colors(type,p_id); + PoolVector<real_t> offsets = graph->color_ramp_node_get_offsets(type,p_id); + PoolVector<Color> colors = graph->color_ramp_node_get_colors(type,p_id); int oc = offsets.size(); if (oc) { - DVector<real_t>::Read rofs = offsets.read(); - DVector<Color>::Read rcol = colors.read(); + PoolVector<real_t>::Read rofs = offsets.read(); + PoolVector<Color>::Read rcol = colors.read(); Vector<float> ofsv; Vector<Color> colorv; @@ -2183,12 +2184,12 @@ void ShaderGraphView::_create_node(int p_id) { gn->set_title("CurveMap"); GraphCurveMapEdit * map = memnew( GraphCurveMapEdit ); - DVector<Vector2> points = graph->curve_map_node_get_points(type,p_id); + PoolVector<Vector2> points = graph->curve_map_node_get_points(type,p_id); int oc = points.size(); if (oc) { - DVector<Vector2>::Read rofs = points.read(); + PoolVector<Vector2>::Read rofs = points.read(); Vector<Vector2> ofsv; @@ -2319,7 +2320,7 @@ void ShaderGraphView::_create_node(int p_id) { tex->set_custom_minimum_size(Size2(80,80)); tex->set_drag_forwarding(this); gn->add_child(tex); - tex->set_ignore_mouse(false); + tex->set_mouse_filter(MOUSE_FILTER_PASS); tex->set_texture(graph->texture_input_node_get_value(type,p_id)); ToolButton *edit = memnew( ToolButton ); edit->set_text("edit.."); @@ -2694,49 +2695,49 @@ void ShaderGraphView::add_node(int p_type, const Vector2 &location) { void ShaderGraphView::_bind_methods() { - ObjectTypeDB::bind_method("_update_graph",&ShaderGraphView::_update_graph); - ObjectTypeDB::bind_method("_begin_node_move", &ShaderGraphView::_begin_node_move); - ObjectTypeDB::bind_method("_node_moved",&ShaderGraphView::_node_moved); - ObjectTypeDB::bind_method("_end_node_move", &ShaderGraphView::_end_node_move); - ObjectTypeDB::bind_method("_move_node",&ShaderGraphView::_move_node); - ObjectTypeDB::bind_method("_node_removed",&ShaderGraphView::_node_removed); - ObjectTypeDB::bind_method("_connection_request",&ShaderGraphView::_connection_request); - ObjectTypeDB::bind_method("_disconnection_request",&ShaderGraphView::_disconnection_request); - ObjectTypeDB::bind_method("_duplicate_nodes_request", &ShaderGraphView::_duplicate_nodes_request); - ObjectTypeDB::bind_method("_duplicate_nodes", &ShaderGraphView::_duplicate_nodes); - ObjectTypeDB::bind_method("_delete_nodes_request", &ShaderGraphView::_delete_nodes_request); - - ObjectTypeDB::bind_method("_default_changed",&ShaderGraphView::_default_changed); - ObjectTypeDB::bind_method("_scalar_const_changed",&ShaderGraphView::_scalar_const_changed); - ObjectTypeDB::bind_method("_vec_const_changed",&ShaderGraphView::_vec_const_changed); - ObjectTypeDB::bind_method("_rgb_const_changed",&ShaderGraphView::_rgb_const_changed); - ObjectTypeDB::bind_method("_xform_const_changed",&ShaderGraphView::_xform_const_changed); - ObjectTypeDB::bind_method("_scalar_op_changed",&ShaderGraphView::_scalar_op_changed); - ObjectTypeDB::bind_method("_vec_op_changed",&ShaderGraphView::_vec_op_changed); - ObjectTypeDB::bind_method("_vec_scalar_op_changed",&ShaderGraphView::_vec_scalar_op_changed); - ObjectTypeDB::bind_method("_rgb_op_changed",&ShaderGraphView::_rgb_op_changed); - ObjectTypeDB::bind_method("_xform_inv_rev_changed",&ShaderGraphView::_xform_inv_rev_changed); - ObjectTypeDB::bind_method("_scalar_func_changed",&ShaderGraphView::_scalar_func_changed); - ObjectTypeDB::bind_method("_vec_func_changed",&ShaderGraphView::_vec_func_changed); - ObjectTypeDB::bind_method("_scalar_input_changed",&ShaderGraphView::_scalar_input_changed); - ObjectTypeDB::bind_method("_vec_input_changed",&ShaderGraphView::_vec_input_changed); - ObjectTypeDB::bind_method("_xform_input_changed",&ShaderGraphView::_xform_input_changed); - ObjectTypeDB::bind_method("_rgb_input_changed",&ShaderGraphView::_rgb_input_changed); - ObjectTypeDB::bind_method("_tex_input_change",&ShaderGraphView::_tex_input_change); - ObjectTypeDB::bind_method("_cube_input_change",&ShaderGraphView::_cube_input_change); - ObjectTypeDB::bind_method("_input_name_changed",&ShaderGraphView::_input_name_changed); - ObjectTypeDB::bind_method("_tex_edited",&ShaderGraphView::_tex_edited); - ObjectTypeDB::bind_method("_variant_edited",&ShaderGraphView::_variant_edited); - ObjectTypeDB::bind_method("_cube_edited",&ShaderGraphView::_cube_edited); - ObjectTypeDB::bind_method("_comment_edited",&ShaderGraphView::_comment_edited); - ObjectTypeDB::bind_method("_color_ramp_changed",&ShaderGraphView::_color_ramp_changed); - ObjectTypeDB::bind_method("_curve_changed",&ShaderGraphView::_curve_changed); - - ObjectTypeDB::bind_method(_MD("get_drag_data_fw"), &ShaderGraphView::get_drag_data_fw); - ObjectTypeDB::bind_method(_MD("can_drop_data_fw"), &ShaderGraphView::can_drop_data_fw); - ObjectTypeDB::bind_method(_MD("drop_data_fw"), &ShaderGraphView::drop_data_fw); - - ObjectTypeDB::bind_method("_sg_updated",&ShaderGraphView::_sg_updated); + ClassDB::bind_method("_update_graph",&ShaderGraphView::_update_graph); + ClassDB::bind_method("_begin_node_move", &ShaderGraphView::_begin_node_move); + ClassDB::bind_method("_node_moved",&ShaderGraphView::_node_moved); + ClassDB::bind_method("_end_node_move", &ShaderGraphView::_end_node_move); + ClassDB::bind_method("_move_node",&ShaderGraphView::_move_node); + ClassDB::bind_method("_node_removed",&ShaderGraphView::_node_removed); + ClassDB::bind_method("_connection_request",&ShaderGraphView::_connection_request); + ClassDB::bind_method("_disconnection_request",&ShaderGraphView::_disconnection_request); + ClassDB::bind_method("_duplicate_nodes_request", &ShaderGraphView::_duplicate_nodes_request); + ClassDB::bind_method("_duplicate_nodes", &ShaderGraphView::_duplicate_nodes); + ClassDB::bind_method("_delete_nodes_request", &ShaderGraphView::_delete_nodes_request); + + ClassDB::bind_method("_default_changed",&ShaderGraphView::_default_changed); + ClassDB::bind_method("_scalar_const_changed",&ShaderGraphView::_scalar_const_changed); + ClassDB::bind_method("_vec_const_changed",&ShaderGraphView::_vec_const_changed); + ClassDB::bind_method("_rgb_const_changed",&ShaderGraphView::_rgb_const_changed); + ClassDB::bind_method("_xform_const_changed",&ShaderGraphView::_xform_const_changed); + ClassDB::bind_method("_scalar_op_changed",&ShaderGraphView::_scalar_op_changed); + ClassDB::bind_method("_vec_op_changed",&ShaderGraphView::_vec_op_changed); + ClassDB::bind_method("_vec_scalar_op_changed",&ShaderGraphView::_vec_scalar_op_changed); + ClassDB::bind_method("_rgb_op_changed",&ShaderGraphView::_rgb_op_changed); + ClassDB::bind_method("_xform_inv_rev_changed",&ShaderGraphView::_xform_inv_rev_changed); + ClassDB::bind_method("_scalar_func_changed",&ShaderGraphView::_scalar_func_changed); + ClassDB::bind_method("_vec_func_changed",&ShaderGraphView::_vec_func_changed); + ClassDB::bind_method("_scalar_input_changed",&ShaderGraphView::_scalar_input_changed); + ClassDB::bind_method("_vec_input_changed",&ShaderGraphView::_vec_input_changed); + ClassDB::bind_method("_xform_input_changed",&ShaderGraphView::_xform_input_changed); + ClassDB::bind_method("_rgb_input_changed",&ShaderGraphView::_rgb_input_changed); + ClassDB::bind_method("_tex_input_change",&ShaderGraphView::_tex_input_change); + ClassDB::bind_method("_cube_input_change",&ShaderGraphView::_cube_input_change); + ClassDB::bind_method("_input_name_changed",&ShaderGraphView::_input_name_changed); + ClassDB::bind_method("_tex_edited",&ShaderGraphView::_tex_edited); + ClassDB::bind_method("_variant_edited",&ShaderGraphView::_variant_edited); + ClassDB::bind_method("_cube_edited",&ShaderGraphView::_cube_edited); + ClassDB::bind_method("_comment_edited",&ShaderGraphView::_comment_edited); + ClassDB::bind_method("_color_ramp_changed",&ShaderGraphView::_color_ramp_changed); + ClassDB::bind_method("_curve_changed",&ShaderGraphView::_curve_changed); + + ClassDB::bind_method(_MD("get_drag_data_fw"), &ShaderGraphView::get_drag_data_fw); + ClassDB::bind_method(_MD("can_drop_data_fw"), &ShaderGraphView::can_drop_data_fw); + ClassDB::bind_method(_MD("drop_data_fw"), &ShaderGraphView::drop_data_fw); + + ClassDB::bind_method("_sg_updated",&ShaderGraphView::_sg_updated); } ShaderGraphView::ShaderGraphView(ShaderGraph::ShaderType p_type) { @@ -2806,7 +2807,7 @@ void ShaderGraphEditor::_notification(int p_what) { if (addsep) popup->add_separator(); } - popup->connect("item_pressed",this,"_add_node"); + popup->connect("id_pressed",this,"_add_node"); } @@ -2814,8 +2815,8 @@ void ShaderGraphEditor::_notification(int p_what) { void ShaderGraphEditor::_bind_methods() { - ObjectTypeDB::bind_method("_add_node",&ShaderGraphEditor::_add_node); - ObjectTypeDB::bind_method("_popup_requested",&ShaderGraphEditor::_popup_requested); + ClassDB::bind_method("_add_node",&ShaderGraphEditor::_add_node); + ClassDB::bind_method("_popup_requested",&ShaderGraphEditor::_popup_requested); } @@ -2945,3 +2946,4 @@ ShaderGraphEditorPlugin::~ShaderGraphEditorPlugin() +#endif diff --git a/tools/editor/plugins/shader_graph_editor_plugin.h b/tools/editor/plugins/shader_graph_editor_plugin.h index 67ee5e2d45..477a45bd1f 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.h +++ b/tools/editor/plugins/shader_graph_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -43,10 +43,10 @@ @author Juan Linietsky <reduzio@gmail.com> */ - +#if 0 class GraphColorRampEdit : public Control { - OBJ_TYPE(GraphColorRampEdit,Control); + GDCLASS(GraphColorRampEdit,Control); struct Point { @@ -70,7 +70,7 @@ class GraphColorRampEdit : public Control { void _color_changed(const Color& p_color); protected: - void _input_event(const InputEvent& p_event); + void _gui_input(const InputEvent& p_event); void _notification(int p_what); static void _bind_methods(); public: @@ -85,7 +85,7 @@ public: class GraphCurveMapEdit : public Control { - OBJ_TYPE(GraphCurveMapEdit,Control); + GDCLASS(GraphCurveMapEdit,Control); struct Point { @@ -104,7 +104,7 @@ class GraphCurveMapEdit : public Control { void _plot_curve(const Vector2& p_a,const Vector2& p_b,const Vector2& p_c,const Vector2& p_d); protected: - void _input_event(const InputEvent& p_event); + void _gui_input(const InputEvent& p_event); void _notification(int p_what); static void _bind_methods(); public: @@ -117,7 +117,7 @@ public: class ShaderGraphView : public Control { - OBJ_TYPE(ShaderGraphView,Control); + GDCLASS(ShaderGraphView,Control); @@ -198,7 +198,7 @@ public: class ShaderGraphEditor : public VBoxContainer { - OBJ_TYPE(ShaderGraphEditor,VBoxContainer); + GDCLASS(ShaderGraphEditor,VBoxContainer); PopupMenu *popup; TabContainer *tabs; @@ -220,7 +220,7 @@ public: class ShaderGraphEditorPlugin : public EditorPlugin { - OBJ_TYPE( ShaderGraphEditorPlugin, EditorPlugin ); + GDCLASS( ShaderGraphEditorPlugin, EditorPlugin ); bool _2d; ShaderGraphEditor *shader_editor; @@ -239,4 +239,4 @@ public: }; #endif - +#endif diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp index 6dcc71422a..6a1098bc6e 100644 --- a/tools/editor/plugins/spatial_editor_plugin.cpp +++ b/tools/editor/plugins/spatial_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -61,8 +61,8 @@ void SpatialEditorViewport::_update_camera() { Transform camera_transform; camera_transform.translate(cursor.pos); - camera_transform.basis.rotate(Vector3(0, 1, 0), cursor.y_rot); - camera_transform.basis.rotate(Vector3(1, 0, 0), cursor.x_rot); + camera_transform.basis.rotate(Vector3(1, 0, 0), -cursor.x_rot); + camera_transform.basis.rotate(Vector3(0, 1, 0), -cursor.y_rot); if (orthogonal) camera_transform.translate(0, 0, 4096); @@ -274,7 +274,7 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2& p_pos, bool p_append,b Vector3 ray=_get_ray(p_pos); Vector3 pos=_get_ray_pos(p_pos); - Vector<RID> instances=VisualServer::get_singleton()->instances_cull_ray(pos,ray,get_tree()->get_root()->get_world()->get_scenario() ); + Vector<ObjectID> instances=VisualServer::get_singleton()->instances_cull_ray(pos,ray,get_tree()->get_root()->get_world()->get_scenario() ); Set<Ref<SpatialEditorGizmo> > found_gizmos; //uint32_t closest=0; @@ -286,8 +286,7 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2& p_pos, bool p_append,b for (int i=0;i<instances.size();i++) { - uint32_t id=VisualServer::get_singleton()->instance_get_object_instance_ID(instances[i]); - Object *obj=ObjectDB::get_instance(id); + Object *obj=ObjectDB::get_instance(instances[i]); if (!obj) continue; @@ -405,15 +404,15 @@ void SpatialEditorViewport::_find_items_at_pos(const Point2& p_pos,bool &r_inclu Vector3 ray=_get_ray(p_pos); Vector3 pos=_get_ray_pos(p_pos); - Vector<RID> instances=VisualServer::get_singleton()->instances_cull_ray(pos,ray,get_tree()->get_root()->get_world()->get_scenario() ); + Vector<ObjectID> instances=VisualServer::get_singleton()->instances_cull_ray(pos,ray,get_tree()->get_root()->get_world()->get_scenario() ); Set<Ref<SpatialEditorGizmo> > found_gizmos; r_includes_current=false; for (int i=0;i<instances.size();i++) { - uint32_t id=VisualServer::get_singleton()->instance_get_object_instance_ID(instances[i]); - Object *obj=ObjectDB::get_instance(id); + Object *obj=ObjectDB::get_instance(instances[i]); + if (!obj) continue; @@ -475,8 +474,8 @@ Vector3 SpatialEditorViewport::_get_screen_to_space(const Vector3& p_pos) { Transform camera_transform; camera_transform.translate( cursor.pos ); - camera_transform.basis.rotate(Vector3(0,1,0),cursor.y_rot); - camera_transform.basis.rotate(Vector3(1,0,0),cursor.x_rot); + camera_transform.basis.rotate(Vector3(1,0,0),-cursor.x_rot); + camera_transform.basis.rotate(Vector3(0,1,0),-cursor.y_rot); camera_transform.translate(0,0,cursor.distance); return camera_transform.xform(Vector3( ((p_pos.x/get_size().width)*2.0-1.0)*screen_w, ((1.0-(p_pos.y/get_size().height))*2.0-1.0)*screen_h,-get_znear())); @@ -534,14 +533,12 @@ void SpatialEditorViewport::_select_region() { frustum.push_back( far ); - Vector<RID> instances=VisualServer::get_singleton()->instances_cull_convex(frustum,get_tree()->get_root()->get_world()->get_scenario()); + Vector<ObjectID> instances=VisualServer::get_singleton()->instances_cull_convex(frustum,get_tree()->get_root()->get_world()->get_scenario()); for (int i=0;i<instances.size();i++) { - uint32_t id=VisualServer::get_singleton()->instance_get_object_instance_ID(instances[i]); - - Object *obj=ObjectDB::get_instance(id); + Object *obj=ObjectDB::get_instance(instances[i]); if (!obj) continue; Spatial *sp = obj->cast_to<Spatial>(); @@ -795,7 +792,7 @@ void SpatialEditorViewport::_list_select(InputEventMouseButton b) { if (spat->has_meta("_editor_icon")) icon=spat->get_meta("_editor_icon"); else - icon=get_icon( has_icon(spat->get_type(),"EditorIcons")?spat->get_type():String("Object"),"EditorIcons"); + icon=get_icon( has_icon(spat->get_class(),"EditorIcons")?spat->get_class():String("Object"),"EditorIcons"); String node_path="/"+root_name+"/"+root_path.rel_path_to(spat->get_path()); @@ -803,7 +800,7 @@ void SpatialEditorViewport::_list_select(InputEventMouseButton b) { selection_menu->set_item_icon(i, icon ); selection_menu->set_item_metadata(i, node_path); selection_menu->set_item_tooltip(i,String(spat->get_name())+ - "\nType: "+spat->get_type()+"\nPath: "+node_path); + "\nType: "+spat->get_class()+"\nPath: "+node_path); } selection_menu->set_global_pos(Vector2( b.global_x, b.global_y )); @@ -827,7 +824,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { EditorPluginList *over_plugin_list = en->get_editor_plugins_over(); if (!over_plugin_list->empty()) { - bool discard = over_plugin_list->forward_spatial_input_event(camera,p_event); + bool discard = over_plugin_list->forward_spatial_gui_input(camera,p_event); if (discard) return; } @@ -857,7 +854,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { } break; case BUTTON_RIGHT: { - NavigationScheme nav_scheme = _get_navigation_schema("3d_editor/navigation_scheme"); + NavigationScheme nav_scheme = _get_navigation_schema("editors/3d/navigation_scheme"); if (b.pressed && _edit.gizmo.is_valid()) { //restore @@ -877,7 +874,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { if (b.mod.control) { - Vector<RID> instances=VisualServer::get_singleton()->instances_cull_ray(ray_origin,ray_dir,get_tree()->get_root()->get_world()->get_scenario() ); + Vector<ObjectID> instances=VisualServer::get_singleton()->instances_cull_ray(ray_origin,ray_dir,get_tree()->get_root()->get_world()->get_scenario() ); Plane p(ray_origin,_get_camera_normal()); @@ -886,8 +883,9 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { for (int i=0;i<instances.size();i++) { - uint32_t id=VisualServer::get_singleton()->instance_get_object_instance_ID(instances[i]); - Object *obj=ObjectDB::get_instance(id); + + Object *obj=ObjectDB::get_instance(instances[i]); + if (!obj) continue; @@ -896,14 +894,14 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { continue; //optimize by checking AABB (although should pre sort by distance) - AABB aabb = vi->get_global_transform().xform(vi->get_aabb()); + Rect3 aabb = vi->get_global_transform().xform(vi->get_aabb()); if (p.distance_to(aabb.get_support(-ray_dir))>min_d) continue; - DVector<Face3> faces = vi->get_faces(VisualInstance::FACES_SOLID); + PoolVector<Face3> faces = vi->get_faces(VisualInstance::FACES_SOLID); int c = faces.size(); if (c>0) { - DVector<Face3>::Read r = faces.read(); + PoolVector<Face3>::Read r = faces.read(); for(int j=0;j<c;j++) { @@ -1016,7 +1014,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { if (b.pressed) { - NavigationScheme nav_scheme = _get_navigation_schema("3d_editor/navigation_scheme"); + NavigationScheme nav_scheme = _get_navigation_schema("editors/3d/navigation_scheme"); if ( (nav_scheme==NAVIGATION_MAYA || nav_scheme==NAVIGATION_MODO) && b.mod.alt) { break; } @@ -1253,7 +1251,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { } - NavigationScheme nav_scheme = _get_navigation_schema("3d_editor/navigation_scheme"); + NavigationScheme nav_scheme = _get_navigation_schema("editors/3d/navigation_scheme"); NavigationMode nav_mode = NAVIGATION_NONE; if (_edit.gizmo.is_valid()) { @@ -1354,7 +1352,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { Transform original=se->original; - Transform base=Transform( Matrix3(), _edit.center); + Transform base=Transform( Basis(), _edit.center); Transform t=base * (r * (base.inverse() * original)); sp->set_global_transform(t); @@ -1486,7 +1484,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { Transform r; - r.basis.rotate(plane.normal,-angle); + r.basis.rotate(plane.normal,angle); List<Node*> &selection = editor_selection->get_selected_node_list(); @@ -1503,8 +1501,8 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { Transform original=se->original; - Transform base=Transform( Matrix3(), _edit.center); - Transform t=base * (r * (base.inverse() * original)); + Transform base=Transform( Basis(), _edit.center); + Transform t=base * r * base.inverse() * original; sp->set_global_transform(t); } @@ -1560,7 +1558,7 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { nav_mode = NAVIGATION_PAN; } - } else if (EditorSettings::get_singleton()->get("3d_editor/emulate_3_button_mouse")) { + } else if (EditorSettings::get_singleton()->get("editors/3d/emulate_3_button_mouse")) { // Handle trackpad (no external mouse) use case int mod = 0; if (m.mod.shift) @@ -1593,8 +1591,8 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) { Transform camera_transform; camera_transform.translate(cursor.pos); - camera_transform.basis.rotate(Vector3(0,1,0),cursor.y_rot); - camera_transform.basis.rotate(Vector3(1,0,0),cursor.x_rot); + camera_transform.basis.rotate(Vector3(1,0,0),-cursor.x_rot); + camera_transform.basis.rotate(Vector3(0,1,0),-cursor.y_rot); Vector3 translation(-m.relative_x*pan_speed,m.relative_y*pan_speed,0); translation*=cursor.distance/DISTANCE_DEFAULT; camera_transform.translate(translation); @@ -1793,7 +1791,7 @@ void SpatialEditorViewport::_notification(int p_what) { if (se->aabb.has_no_surface()) { - se->aabb=vi?vi->get_aabb():AABB( Vector3(-0.2,-0.2,-0.2),Vector3(0.4,0.4,0.4)); + se->aabb=vi?vi->get_aabb():Rect3( Vector3(-0.2,-0.2,-0.2),Vector3(0.4,0.4,0.4)); } Transform t=sp->get_global_transform(); @@ -1825,12 +1823,36 @@ void SpatialEditorViewport::_notification(int p_what) { surface->update(); } + //update shadow atlas if changed + + int shadowmap_size = GlobalConfig::get_singleton()->get("rendering/shadow_atlas/size"); + int atlas_q0 = GlobalConfig::get_singleton()->get("rendering/shadow_atlas/quadrant_0_subdiv"); + int atlas_q1 = GlobalConfig::get_singleton()->get("rendering/shadow_atlas/quadrant_1_subdiv"); + int atlas_q2 = GlobalConfig::get_singleton()->get("rendering/shadow_atlas/quadrant_2_subdiv"); + int atlas_q3 = GlobalConfig::get_singleton()->get("rendering/shadow_atlas/quadrant_3_subdiv"); + + + viewport->set_shadow_atlas_size(shadowmap_size); + viewport->set_shadow_atlas_quadrant_subdiv(0,Viewport::ShadowAtlasQuadrantSubdiv(atlas_q0)); + viewport->set_shadow_atlas_quadrant_subdiv(1,Viewport::ShadowAtlasQuadrantSubdiv(atlas_q1)); + viewport->set_shadow_atlas_quadrant_subdiv(2,Viewport::ShadowAtlasQuadrantSubdiv(atlas_q2)); + viewport->set_shadow_atlas_quadrant_subdiv(3,Viewport::ShadowAtlasQuadrantSubdiv(atlas_q3)); + + //update msaa if changed + + int msaa_mode = GlobalConfig::get_singleton()->get("rendering/antialias/msaa"); + viewport->set_msaa(Viewport::MSAA(msaa_mode)); + + bool hdr = GlobalConfig::get_singleton()->get("rendering/dynamic_range/hdr"); + viewport->set_hdr(hdr); + + } if (p_what==NOTIFICATION_ENTER_TREE) { surface->connect("draw",this,"_draw"); - surface->connect("input_event",this,"_sinput"); + surface->connect("gui_input",this,"_sinput"); surface->connect("mouse_enter",this,"_smouseenter"); preview_camera->set_icon(get_icon("Camera","EditorIcons")); _init_gizmo_instance(index); @@ -1892,7 +1914,7 @@ void SpatialEditorViewport::_draw() { if (previewing) { - Size2 ss = Size2( Globals::get_singleton()->get("display/width"), Globals::get_singleton()->get("display/height") ); + Size2 ss = Size2( GlobalConfig::get_singleton()->get("display/width"), GlobalConfig::get_singleton()->get("display/height") ); float aspect = ss.get_aspect(); Size2 s = get_size(); @@ -2066,9 +2088,9 @@ void SpatialEditorViewport::_menu_option(int p_option) { bool current = view_menu->get_popup()->is_item_checked( idx ); current=!current; if (current) - camera->set_visible_layers( ((1<<20)-1)|(1<<(GIZMO_BASE_LAYER+index))|(1<<GIZMO_EDIT_LAYER)|(1<<GIZMO_GRID_LAYER) ); + camera->set_cull_mask( ((1<<20)-1)|(1<<(GIZMO_BASE_LAYER+index))|(1<<GIZMO_EDIT_LAYER)|(1<<GIZMO_GRID_LAYER) ); else - camera->set_visible_layers( ((1<<20)-1)|(1<<(GIZMO_BASE_LAYER+index))|(1<<GIZMO_GRID_LAYER) ); + camera->set_cull_mask( ((1<<20)-1)|(1<<(GIZMO_BASE_LAYER+index))|(1<<GIZMO_GRID_LAYER) ); view_menu->get_popup()->set_item_checked( idx, current ); } break; @@ -2094,7 +2116,7 @@ void SpatialEditorViewport::_init_gizmo_instance(int p_idx) { move_gizmo_instance[i]=VS::get_singleton()->instance_create(); VS::get_singleton()->instance_set_base(move_gizmo_instance[i],spatial_editor->get_move_gizmo(i)->get_rid()); VS::get_singleton()->instance_set_scenario(move_gizmo_instance[i],get_tree()->get_root()->get_world()->get_scenario()); - VS::get_singleton()->instance_geometry_set_flag(move_gizmo_instance[i],VS::INSTANCE_FLAG_VISIBLE,false); + VS::get_singleton()->instance_set_visible(move_gizmo_instance[i],false); //VS::get_singleton()->instance_geometry_set_flag(move_gizmo_instance[i],VS::INSTANCE_FLAG_DEPH_SCALE,true); VS::get_singleton()->instance_geometry_set_cast_shadows_setting(move_gizmo_instance[i], VS::SHADOW_CASTING_SETTING_OFF); VS::get_singleton()->instance_set_layer_mask(move_gizmo_instance[i],layer); @@ -2102,7 +2124,7 @@ void SpatialEditorViewport::_init_gizmo_instance(int p_idx) { rotate_gizmo_instance[i]=VS::get_singleton()->instance_create(); VS::get_singleton()->instance_set_base(rotate_gizmo_instance[i],spatial_editor->get_rotate_gizmo(i)->get_rid()); VS::get_singleton()->instance_set_scenario(rotate_gizmo_instance[i],get_tree()->get_root()->get_world()->get_scenario()); - VS::get_singleton()->instance_geometry_set_flag(rotate_gizmo_instance[i],VS::INSTANCE_FLAG_VISIBLE,false); + VS::get_singleton()->instance_set_visible(rotate_gizmo_instance[i],false); //VS::get_singleton()->instance_geometry_set_flag(rotate_gizmo_instance[i],VS::INSTANCE_FLAG_DEPH_SCALE,true); VS::get_singleton()->instance_geometry_set_cast_shadows_setting(rotate_gizmo_instance[i], VS::SHADOW_CASTING_SETTING_OFF); VS::get_singleton()->instance_set_layer_mask(rotate_gizmo_instance[i],layer); @@ -2200,7 +2222,7 @@ void SpatialEditorViewport::update_transform_gizmo_view() { if (dd==0) dd=0.0001; - float gsize = EditorSettings::get_singleton()->get("3d_editor/manipulator_gizmo_size"); + float gsize = EditorSettings::get_singleton()->get("editors/3d/manipulator_gizmo_size"); gizmo_scale=(gsize/Math::abs(dd)); Vector3 scale = Vector3(1,1,1) * gizmo_scale; @@ -2211,9 +2233,9 @@ void SpatialEditorViewport::update_transform_gizmo_view() { for(int i=0;i<3;i++) { VisualServer::get_singleton()->instance_set_transform(move_gizmo_instance[i], xform ); - VisualServer::get_singleton()->instance_geometry_set_flag(move_gizmo_instance[i],VS::INSTANCE_FLAG_VISIBLE,spatial_editor->is_gizmo_visible()&& (spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_MOVE) ); + VisualServer::get_singleton()->instance_set_visible(move_gizmo_instance[i],spatial_editor->is_gizmo_visible()&& (spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_MOVE) ); VisualServer::get_singleton()->instance_set_transform(rotate_gizmo_instance[i], xform ); - VisualServer::get_singleton()->instance_geometry_set_flag(rotate_gizmo_instance[i],VS::INSTANCE_FLAG_VISIBLE,spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_ROTATE) ); + VisualServer::get_singleton()->instance_set_visible(rotate_gizmo_instance[i],spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_ROTATE) ); } } @@ -2274,15 +2296,15 @@ Dictionary SpatialEditorViewport::get_state() const { void SpatialEditorViewport::_bind_methods(){ - ObjectTypeDB::bind_method(_MD("_draw"),&SpatialEditorViewport::_draw); - ObjectTypeDB::bind_method(_MD("_smouseenter"),&SpatialEditorViewport::_smouseenter); - ObjectTypeDB::bind_method(_MD("_sinput"),&SpatialEditorViewport::_sinput); - ObjectTypeDB::bind_method(_MD("_menu_option"),&SpatialEditorViewport::_menu_option); - ObjectTypeDB::bind_method(_MD("_toggle_camera_preview"),&SpatialEditorViewport::_toggle_camera_preview); - ObjectTypeDB::bind_method(_MD("_preview_exited_scene"),&SpatialEditorViewport::_preview_exited_scene); - ObjectTypeDB::bind_method(_MD("update_transform_gizmo_view"),&SpatialEditorViewport::update_transform_gizmo_view); - ObjectTypeDB::bind_method(_MD("_selection_result_pressed"),&SpatialEditorViewport::_selection_result_pressed); - ObjectTypeDB::bind_method(_MD("_selection_menu_hide"),&SpatialEditorViewport::_selection_menu_hide); + ClassDB::bind_method(_MD("_draw"),&SpatialEditorViewport::_draw); + ClassDB::bind_method(_MD("_smouseenter"),&SpatialEditorViewport::_smouseenter); + ClassDB::bind_method(_MD("_sinput"),&SpatialEditorViewport::_sinput); + ClassDB::bind_method(_MD("_menu_option"),&SpatialEditorViewport::_menu_option); + ClassDB::bind_method(_MD("_toggle_camera_preview"),&SpatialEditorViewport::_toggle_camera_preview); + ClassDB::bind_method(_MD("_preview_exited_scene"),&SpatialEditorViewport::_preview_exited_scene); + ClassDB::bind_method(_MD("update_transform_gizmo_view"),&SpatialEditorViewport::update_transform_gizmo_view); + ClassDB::bind_method(_MD("_selection_result_pressed"),&SpatialEditorViewport::_selection_result_pressed); + ClassDB::bind_method(_MD("_selection_menu_hide"),&SpatialEditorViewport::_selection_menu_hide); ADD_SIGNAL( MethodInfo("toggle_maximize_view", PropertyInfo(Variant::OBJECT, "viewport")) ); } @@ -2355,18 +2377,20 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed message_time=0; spatial_editor=p_spatial_editor; - Control *c=memnew(Control); + ViewportContainer *c=memnew(ViewportContainer); + c->set_stretch(true); add_child(c); c->set_area_as_parent_rect(); viewport = memnew( Viewport ); viewport->set_disable_input(true); + c->add_child(viewport); surface = memnew( Control ); add_child(surface); surface->set_area_as_parent_rect(); camera = memnew(Camera); camera->set_disable_gizmo(true); - camera->set_visible_layers( ((1<<20)-1)|(1<<(GIZMO_BASE_LAYER+p_index))|(1<<GIZMO_EDIT_LAYER)|(1<<GIZMO_GRID_LAYER) ); + camera->set_cull_mask( ((1<<20)-1)|(1<<(GIZMO_BASE_LAYER+p_index))|(1<<GIZMO_EDIT_LAYER)|(1<<GIZMO_GRID_LAYER) ); //camera->set_environment(SpatialEditor::get_singleton()->get_viewport_environment()); viewport->add_child(camera); camera->make_current(); @@ -2375,7 +2399,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed view_menu = memnew( MenuButton ); surface->add_child(view_menu); view_menu->set_pos( Point2(4,4)); - view_menu->set_self_opacity(0.5); + view_menu->set_self_modulate(Color(1,1,1,0.5)); view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/top_view"), VIEW_TOP); view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/bottom_view"), VIEW_BOTTOM); view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/left_view"), VIEW_LEFT); @@ -2399,7 +2423,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/focus_origin"), VIEW_CENTER_TO_ORIGIN); view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/focus_selection"), VIEW_CENTER_TO_SELECTION); view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/align_selection_with_view"), VIEW_ALIGN_SELECTION_WITH_VIEW); - view_menu->get_popup()->connect("item_pressed",this,"_menu_option"); + view_menu->get_popup()->connect("id_pressed",this,"_menu_option"); preview_camera = memnew( Button ); preview_camera->set_toggle_mode(true); @@ -2416,7 +2440,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed selection_menu = memnew( PopupMenu ); add_child(selection_menu); selection_menu->set_custom_minimum_size(Vector2(100, 0)); - selection_menu->connect("item_pressed", this, "_selection_result_pressed"); + selection_menu->connect("id_pressed", this, "_selection_result_pressed"); selection_menu->connect("popup_hide", this, "_selection_menu_hide"); if (p_index==0) { @@ -2462,10 +2486,10 @@ void SpatialEditor::select_gizmo_hilight_axis(int p_axis) { void SpatialEditor::update_transform_gizmo() { List<Node*> &selection = editor_selection->get_selected_node_list(); - AABB center; + Rect3 center; bool first=true; - Matrix3 gizmo_basis; + Basis gizmo_basis; bool local_gizmo_coords = transform_menu->get_popup()->is_item_checked( transform_menu->get_popup()->get_item_index(MENU_TRANSFORM_LOCAL_COORDS) ); @@ -2489,7 +2513,7 @@ void SpatialEditor::update_transform_gizmo() { } } else { center.expand_to(xf.origin); - gizmo_basis=Matrix3(); + gizmo_basis=Basis(); } // count++; } @@ -2527,7 +2551,7 @@ Object *SpatialEditor::_get_editor_data(Object *p_what) { void SpatialEditor::_generate_selection_box() { - AABB aabb( Vector3(), Vector3(1,1,1) ); + Rect3 aabb( Vector3(), Vector3(1,1,1) ); aabb.grow_by( aabb.get_longest_axis_size()/20.0 ); Ref<SurfaceTool> st = memnew( SurfaceTool ); @@ -2555,11 +2579,12 @@ void SpatialEditor::_generate_selection_box() { } - Ref<FixedMaterial> mat = memnew( FixedMaterial ); - mat->set_flag(Material::FLAG_UNSHADED,true); - mat->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(1,1,1)); - mat->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA,true); - mat->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY,true); + Ref<FixedSpatialMaterial> mat = memnew( FixedSpatialMaterial ); + mat->set_flag(FixedSpatialMaterial::FLAG_UNSHADED,true); + mat->set_albedo(Color(1,1,1)); + mat->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT,true); + mat->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR,true); + mat->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR,true); st->set_material(mat); selection_box = st->commit(); } @@ -2666,11 +2691,11 @@ void SpatialEditor::set_state(const Dictionary& p_state) { } if (d.has("zfar")) - settings_zfar->set_val(float(d["zfar"])); + settings_zfar->set_value(float(d["zfar"])); if (d.has("znear")) - settings_znear->set_val(float(d["znear"])); + settings_znear->set_value(float(d["znear"])); if (d.has("fov")) - settings_fov->set_val(float(d["fov"])); + settings_fov->set_value(float(d["fov"])); if (d.has("default_light")) { bool use = d["default_light"]; @@ -2691,14 +2716,14 @@ void SpatialEditor::set_state(const Dictionary& p_state) { } if (d.has("ambient_light_color")) { settings_ambient_color->set_color(d["ambient_light_color"]); - viewport_environment->fx_set_param(Environment::FX_PARAM_AMBIENT_LIGHT_COLOR,d["ambient_light_color"]); + //viewport_environment->fx_set_param(Environment::FX_PARAM_AMBIENT_LIGHT_COLOR,d["ambient_light_color"]); } if (d.has("default_srgb")) { bool use = d["default_srgb"]; - viewport_environment->set_enable_fx(Environment::FX_SRGB,use); - view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_DEFAULT_SRGB), use ); + //viewport_environment->set_enable_fx(Environment::FX_SRGB,use); + //view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_DEFAULT_SRGB), use ); } if (d.has("show_grid")) { bool use = d["show_grid"]; @@ -2713,7 +2738,7 @@ void SpatialEditor::set_state(const Dictionary& p_state) { if (use!=view_menu->get_popup()->is_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_ORIGIN))) { view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_ORIGIN), use ); - VisualServer::get_singleton()->instance_geometry_set_flag(origin_instance,VS::INSTANCE_FLAG_VISIBLE,use); + VisualServer::get_singleton()->instance_set_visible(origin_instance,use); } } @@ -2778,21 +2803,10 @@ void SpatialEditor::_xform_dialog_action() { rotate[i]=Math::deg2rad(xform_rotate[i]->get_text().to_double()); scale[i]=xform_scale[i]->get_text().to_double(); } - + + t.basis.scale(scale); + t.basis.rotate(rotate); t.origin=translate; - for(int i=0;i<3;i++) { - if (!rotate[i]) - continue; - Vector3 axis; - axis[i]=1.0; - t.basis.rotate(axis,rotate[i]); - } - - for(int i=0;i<3;i++) { - if (scale[i]==1) - continue; - t.basis.set_axis(i,t.basis.get_axis(i)*scale[i]); - } undo_redo->create_action(TTR("XForm Dialog")); @@ -2898,9 +2912,9 @@ void SpatialEditor::_menu_item_pressed(int p_option) { bool is_checked = view_menu->get_popup()->is_item_checked( view_menu->get_popup()->get_item_index(p_option) ); if (is_checked) { - viewport_environment->set_enable_fx(Environment::FX_SRGB,false); + //viewport_environment->set_enable_fx(Environment::FX_SRGB,false); } else { - viewport_environment->set_enable_fx(Environment::FX_SRGB,true); + //viewport_environment->set_enable_fx(Environment::FX_SRGB,true); } is_checked = ! is_checked; @@ -2938,9 +2952,9 @@ void SpatialEditor::_menu_item_pressed(int p_option) { } viewports[0]->set_area_as_parent_rect(); - viewports[0]->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_RATIO,0.5); + //viewports[0]->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_RATIO,0.5); viewports[2]->set_area_as_parent_rect(); - viewports[2]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5); + //viewports[2]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5); view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), false ); view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), true ); @@ -2962,9 +2976,9 @@ void SpatialEditor::_menu_item_pressed(int p_option) { } viewports[0]->set_area_as_parent_rect(); - viewports[0]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5); + //viewports[0]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5); viewports[2]->set_area_as_parent_rect(); - viewports[2]->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_RATIO,0.5); + //viewports[2]->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_RATIO,0.5); view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), false ); view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), false ); @@ -2984,13 +2998,13 @@ void SpatialEditor::_menu_item_pressed(int p_option) { viewports[i]->show(); } viewports[0]->set_area_as_parent_rect(); - viewports[0]->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_RATIO,0.5); + //viewports[0]->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_RATIO,0.5); viewports[2]->set_area_as_parent_rect(); - viewports[2]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5); - viewports[2]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5); + //viewports[2]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5); + //viewports[2]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5); viewports[3]->set_area_as_parent_rect(); - viewports[3]->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_RATIO,0.5); - viewports[3]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5); + //viewports[3]->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_RATIO,0.5); + //viewports[3]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5); view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), false ); view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), false ); @@ -3010,13 +3024,13 @@ void SpatialEditor::_menu_item_pressed(int p_option) { viewports[i]->show(); } viewports[0]->set_area_as_parent_rect(); - viewports[0]->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_RATIO,0.5); - viewports[0]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5); + //viewports[0]->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_RATIO,0.5); + //viewports[0]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5); viewports[2]->set_area_as_parent_rect(); - viewports[2]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5); - viewports[2]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5); + //viewports[2]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5); + //viewports[2]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5); viewports[3]->set_area_as_parent_rect(); - viewports[3]->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_RATIO,0.5); + //viewports[3]->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_RATIO,0.5); view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), false ); view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), false ); @@ -3033,17 +3047,17 @@ void SpatialEditor::_menu_item_pressed(int p_option) { viewports[i]->show(); } viewports[0]->set_area_as_parent_rect(); - viewports[0]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5); - viewports[0]->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_RATIO,0.5); + //viewports[0]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5); + //viewports[0]->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_RATIO,0.5); viewports[1]->set_area_as_parent_rect(); - viewports[1]->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_RATIO,0.5); - viewports[1]->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_RATIO,0.5); + //viewports[1]->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_RATIO,0.5); + //viewports[1]->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_RATIO,0.5); viewports[2]->set_area_as_parent_rect(); - viewports[2]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5); - viewports[2]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5); + //viewports[2]->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_RATIO,0.5); + //viewports[2]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5); viewports[3]->set_area_as_parent_rect(); - viewports[3]->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_RATIO,0.5); - viewports[3]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5); + //viewports[3]->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_RATIO,0.5); + //viewports[3]->set_anchor_and_margin(MARGIN_TOP,ANCHOR_RATIO,0.5); view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), false ); view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), false ); @@ -3096,7 +3110,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) { bool is_checked = view_menu->get_popup()->is_item_checked( view_menu->get_popup()->get_item_index(p_option) ); is_checked=!is_checked; - VisualServer::get_singleton()->instance_geometry_set_flag(origin_instance,VS::INSTANCE_FLAG_VISIBLE,is_checked); + VisualServer::get_singleton()->instance_set_visible(origin_instance,is_checked); view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(p_option), is_checked); } break; @@ -3108,7 +3122,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) { for(int i=0;i<3;++i) { if (grid_enable[i]) { - VisualServer::get_singleton()->instance_geometry_set_flag(grid_instance[i],VS::INSTANCE_FLAG_VISIBLE,grid_enabled); + VisualServer::get_singleton()->instance_set_visible(grid_instance[i],grid_enabled); grid_visible[i]=grid_enabled; } } @@ -3135,7 +3149,7 @@ void SpatialEditor::_init_indicators() { - light_transform.rotate(Vector3(1,0,0),Math_PI/5.0); + light_transform.rotate(Vector3(1,0,0),-Math_PI/5.0); VisualServer::get_singleton()->instance_set_transform(light_instance,light_transform); @@ -3146,18 +3160,20 @@ void SpatialEditor::_init_indicators() { { - indicator_mat = VisualServer::get_singleton()->fixed_material_create(); - VisualServer::get_singleton()->material_set_flag( indicator_mat, VisualServer::MATERIAL_FLAG_UNSHADED, true ); - VisualServer::get_singleton()->material_set_flag( indicator_mat, VisualServer::MATERIAL_FLAG_ONTOP, false ); - VisualServer::get_singleton()->fixed_material_set_flag(indicator_mat, VisualServer::FIXED_MATERIAL_FLAG_USE_ALPHA,true); - VisualServer::get_singleton()->fixed_material_set_flag(indicator_mat, VisualServer::FIXED_MATERIAL_FLAG_USE_COLOR_ARRAY,true); + indicator_mat.instance();; + indicator_mat->set_flag(FixedSpatialMaterial::FLAG_UNSHADED,true); + indicator_mat->set_flag(FixedSpatialMaterial::FLAG_ONTOP,true); + indicator_mat->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR,true); + indicator_mat->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR,true); + + indicator_mat->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT,true); - DVector<Color> grid_colors[3]; - DVector<Vector3> grid_points[3]; + PoolVector<Color> grid_colors[3]; + PoolVector<Vector3> grid_points[3]; Vector<Color> origin_colors; Vector<Vector3> origin_points; - Color grid_color = EditorSettings::get_singleton()->get("3d_editor/grid_color"); + Color grid_color = EditorSettings::get_singleton()->get("editors/3d/grid_color"); for(int i=0;i<3;i++) { Vector3 axis; @@ -3192,13 +3208,13 @@ void SpatialEditor::_init_indicators() { d.resize(VS::ARRAY_MAX); d[VisualServer::ARRAY_VERTEX]=grid_points[i]; d[VisualServer::ARRAY_COLOR]=grid_colors[i]; - VisualServer::get_singleton()->mesh_add_surface(grid[i],VisualServer::PRIMITIVE_LINES,d); - VisualServer::get_singleton()->mesh_surface_set_material(grid[i],0,indicator_mat); + VisualServer::get_singleton()->mesh_add_surface_from_arrays(grid[i],VisualServer::PRIMITIVE_LINES,d); + VisualServer::get_singleton()->mesh_surface_set_material(grid[i],0,indicator_mat->get_rid()); grid_instance[i] = VisualServer::get_singleton()->instance_create2(grid[i],get_tree()->get_root()->get_world()->get_scenario()); grid_visible[i]=false; grid_enable[i]=false; - VisualServer::get_singleton()->instance_geometry_set_flag(grid_instance[i],VS::INSTANCE_FLAG_VISIBLE,false); + VisualServer::get_singleton()->instance_set_visible(grid_instance[i],false); VisualServer::get_singleton()->instance_geometry_set_cast_shadows_setting(grid_instance[i], VS::SHADOW_CASTING_SETTING_OFF); VS::get_singleton()->instance_set_layer_mask(grid_instance[i], 1 << SpatialEditorViewport::GIZMO_GRID_LAYER); @@ -3211,8 +3227,8 @@ void SpatialEditor::_init_indicators() { d[VisualServer::ARRAY_VERTEX]=origin_points; d[VisualServer::ARRAY_COLOR]=origin_colors; - VisualServer::get_singleton()->mesh_add_surface(origin,VisualServer::PRIMITIVE_LINES,d); - VisualServer::get_singleton()->mesh_surface_set_material(origin,0,indicator_mat); + VisualServer::get_singleton()->mesh_add_surface_from_arrays(origin,VisualServer::PRIMITIVE_LINES,d); + VisualServer::get_singleton()->mesh_surface_set_material(origin,0,indicator_mat->get_rid()); // origin = VisualServer::get_singleton()->poly_create(); @@ -3225,7 +3241,7 @@ void SpatialEditor::_init_indicators() { - VisualServer::get_singleton()->instance_geometry_set_flag(grid_instance[1],VS::INSTANCE_FLAG_VISIBLE,true); + VisualServer::get_singleton()->instance_set_visible(grid_instance[1],true); grid_enable[1]=true; grid_visible[1]=true; grid_enabled=true; @@ -3235,7 +3251,7 @@ void SpatialEditor::_init_indicators() { { cursor_mesh = VisualServer::get_singleton()->mesh_create(); - DVector<Vector3> cursor_points; + PoolVector<Vector3> cursor_points; float cs = 0.25; cursor_points.push_back(Vector3(+cs,0,0)); cursor_points.push_back(Vector3(-cs,0,0)); @@ -3243,17 +3259,15 @@ void SpatialEditor::_init_indicators() { cursor_points.push_back(Vector3(0,-cs,0)); cursor_points.push_back(Vector3(0,0,+cs)); cursor_points.push_back(Vector3(0,0,-cs)); - cursor_material=VisualServer::get_singleton()->fixed_material_create(); - VisualServer::get_singleton()->fixed_material_set_param(cursor_material,VS::FIXED_MATERIAL_PARAM_DIFFUSE,Color(0,1,1)); - VisualServer::get_singleton()->material_set_flag( cursor_material, VisualServer::MATERIAL_FLAG_UNSHADED, true ); - VisualServer::get_singleton()->fixed_material_set_flag(cursor_material, VisualServer::FIXED_MATERIAL_FLAG_USE_ALPHA,true); - VisualServer::get_singleton()->fixed_material_set_flag(cursor_material, VisualServer::FIXED_MATERIAL_FLAG_USE_COLOR_ARRAY,true); + cursor_material.instance(); + cursor_material->set_albedo(Color(0,1,1)); + cursor_material->set_flag(FixedSpatialMaterial::FLAG_UNSHADED,true); Array d; d.resize(VS::ARRAY_MAX); d[VS::ARRAY_VERTEX]=cursor_points; - VisualServer::get_singleton()->mesh_add_surface(cursor_mesh,VS::PRIMITIVE_LINES,d); - VisualServer::get_singleton()->mesh_surface_set_material(cursor_mesh,0,cursor_material); + VisualServer::get_singleton()->mesh_add_surface_from_arrays(cursor_mesh,VS::PRIMITIVE_LINES,d); + VisualServer::get_singleton()->mesh_surface_set_material(cursor_mesh,0,cursor_material->get_rid()); cursor_instance = VisualServer::get_singleton()->instance_create2(cursor_mesh,get_tree()->get_root()->get_world()->get_scenario()); VS::get_singleton()->instance_set_layer_mask(cursor_instance,1<<SpatialEditorViewport::GIZMO_GRID_LAYER); @@ -3269,13 +3283,13 @@ void SpatialEditor::_init_indicators() { //move gizmo - float gizmo_alph = EditorSettings::get_singleton()->get("3d_editor/manipulator_gizmo_opacity"); + float gizmo_alph = EditorSettings::get_singleton()->get("editors/3d/manipulator_gizmo_opacity"); - gizmo_hl = Ref<FixedMaterial>( memnew( FixedMaterial ) ); - gizmo_hl->set_flag(Material::FLAG_UNSHADED, true); - gizmo_hl->set_flag(Material::FLAG_ONTOP, true); - gizmo_hl->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true); - gizmo_hl->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(1,1,1,gizmo_alph+0.2f)); + gizmo_hl = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial ) ); + gizmo_hl->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true); + gizmo_hl->set_flag(FixedSpatialMaterial::FLAG_ONTOP, true); + gizmo_hl->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true); + gizmo_hl->set_albedo(Color(1,1,1,gizmo_alph+0.2f)); for(int i=0;i<3;i++) { @@ -3283,14 +3297,14 @@ void SpatialEditor::_init_indicators() { rotate_gizmo[i]=Ref<Mesh>( memnew( Mesh ) ); - Ref<FixedMaterial> mat = memnew( FixedMaterial ); - mat->set_flag(Material::FLAG_UNSHADED, true); - mat->set_flag(Material::FLAG_ONTOP, true); - mat->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true); + Ref<FixedSpatialMaterial> mat = memnew( FixedSpatialMaterial ); + mat->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true); + mat->set_flag(FixedSpatialMaterial::FLAG_ONTOP, true); + mat->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true); Color col; col[i]=1.0; col.a= gizmo_alph; - mat->set_parameter(FixedMaterial::PARAM_DIFFUSE,col); + mat->set_albedo(col); gizmo_color[i]=mat; @@ -3329,8 +3343,8 @@ void SpatialEditor::_init_indicators() { for(int k = 0; k < 7 ; k++) { - Matrix3 ma(ivec,Math_PI*2*float(k)/arrow_sides); - Matrix3 mb(ivec,Math_PI*2*float(k+1)/arrow_sides); + Basis ma(ivec,Math_PI*2*float(k)/arrow_sides); + Basis mb(ivec,Math_PI*2*float(k+1)/arrow_sides); for(int j=0;j<arrow_points-1;j++) { @@ -3374,8 +3388,8 @@ void SpatialEditor::_init_indicators() { for(int k = 0; k < 33 ; k++) { - Matrix3 ma(ivec,Math_PI*2*float(k)/32); - Matrix3 mb(ivec,Math_PI*2*float(k+1)/32); + Basis ma(ivec,Math_PI*2*float(k)/32); + Basis mb(ivec,Math_PI*2*float(k+1)/32); for(int j=0;j<4;j++) { @@ -3436,8 +3450,6 @@ void SpatialEditor::_finish_indicators() { VisualServer::get_singleton()->free(cursor_instance); VisualServer::get_singleton()->free(cursor_mesh); - VisualServer::get_singleton()->free(indicator_mat); - VisualServer::get_singleton()->free(cursor_material); } void SpatialEditor::_instance_scene() { @@ -3482,7 +3494,7 @@ void SpatialEditor::_unhandled_key_input(InputEvent p_event) { EditorNode *en = editor; EditorPluginList *over_plugin_list = en->get_editor_plugins_over(); - if (!over_plugin_list->empty() && over_plugin_list->forward_input_event(p_event)) { + if (!over_plugin_list->empty() && over_plugin_list->forward_gui_input(p_event)) { return; //ate the over input event } @@ -3679,17 +3691,17 @@ void SpatialEditor::_node_removed(Node* p_node) { void SpatialEditor::_bind_methods() { -// ObjectTypeDB::bind_method("_input_event",&SpatialEditor::_input_event); - ObjectTypeDB::bind_method("_unhandled_key_input",&SpatialEditor::_unhandled_key_input); - ObjectTypeDB::bind_method("_node_removed",&SpatialEditor::_node_removed); - ObjectTypeDB::bind_method("_menu_item_pressed",&SpatialEditor::_menu_item_pressed); - ObjectTypeDB::bind_method("_xform_dialog_action",&SpatialEditor::_xform_dialog_action); - ObjectTypeDB::bind_method("_instance_scene",&SpatialEditor::_instance_scene); - ObjectTypeDB::bind_method("_get_editor_data",&SpatialEditor::_get_editor_data); - ObjectTypeDB::bind_method("_request_gizmo",&SpatialEditor::_request_gizmo); - ObjectTypeDB::bind_method("_default_light_angle_input",&SpatialEditor::_default_light_angle_input); - ObjectTypeDB::bind_method("_update_ambient_light_color",&SpatialEditor::_update_ambient_light_color); - ObjectTypeDB::bind_method("_toggle_maximize_view",&SpatialEditor::_toggle_maximize_view); +// ClassDB::bind_method("_gui_input",&SpatialEditor::_gui_input); + ClassDB::bind_method("_unhandled_key_input",&SpatialEditor::_unhandled_key_input); + ClassDB::bind_method("_node_removed",&SpatialEditor::_node_removed); + ClassDB::bind_method("_menu_item_pressed",&SpatialEditor::_menu_item_pressed); + ClassDB::bind_method("_xform_dialog_action",&SpatialEditor::_xform_dialog_action); + ClassDB::bind_method("_instance_scene",&SpatialEditor::_instance_scene); + ClassDB::bind_method("_get_editor_data",&SpatialEditor::_get_editor_data); + ClassDB::bind_method("_request_gizmo",&SpatialEditor::_request_gizmo); + ClassDB::bind_method("_default_light_angle_input",&SpatialEditor::_default_light_angle_input); + ClassDB::bind_method("_update_ambient_light_color",&SpatialEditor::_update_ambient_light_color); + ClassDB::bind_method("_toggle_maximize_view",&SpatialEditor::_toggle_maximize_view); ADD_SIGNAL( MethodInfo("transform_key_request") ); @@ -3698,9 +3710,9 @@ void SpatialEditor::_bind_methods() { void SpatialEditor::clear() { - settings_fov->set_val(EDITOR_DEF("3d_editor/default_fov",60.0)); - settings_znear->set_val(EDITOR_DEF("3d_editor/default_z_near",0.1)); - settings_zfar->set_val(EDITOR_DEF("3d_editor/default_z_far",1500.0)); + settings_fov->set_value(EDITOR_DEF("editors/3d/default_fov",60.0)); + settings_znear->set_value(EDITOR_DEF("editors/3d/default_z_near",0.1)); + settings_zfar->set_value(EDITOR_DEF("editors/3d/default_z_far",1500.0)); for(int i=0;i<4;i++) { viewports[i]->reset(); @@ -3710,11 +3722,11 @@ void SpatialEditor::clear() { _menu_item_pressed(MENU_VIEW_DISPLAY_NORMAL); - VisualServer::get_singleton()->instance_geometry_set_flag(origin_instance,VS::INSTANCE_FLAG_VISIBLE,true); + VisualServer::get_singleton()->instance_set_visible(origin_instance,true); view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_ORIGIN), true); for(int i=0;i<3;++i) { if (grid_enable[i]) { - VisualServer::get_singleton()->instance_geometry_set_flag(grid_instance[i],VS::INSTANCE_FLAG_VISIBLE,true); + VisualServer::get_singleton()->instance_set_visible(grid_instance[i],true); grid_visible[i]=true; } } @@ -3730,7 +3742,7 @@ void SpatialEditor::clear() { settings_default_light_rot_x=Math_PI*0.3; settings_default_light_rot_y=Math_PI*0.2; - viewport_environment->fx_set_param(Environment::FX_PARAM_AMBIENT_LIGHT_COLOR,Color(0.15,0.15,0.15)); + //viewport_environment->fx_set_param(Environment::FX_PARAM_AMBIENT_LIGHT_COLOR,Color(0.15,0.15,0.15)); settings_ambient_color->set_color(Color(0.15,0.15,0.15)); if (!light_instance.is_valid()) _menu_item_pressed(MENU_VIEW_USE_DEFAULT_LIGHT); @@ -3743,15 +3755,15 @@ void SpatialEditor::clear() { void SpatialEditor::_update_ambient_light_color(const Color& p_color) { - viewport_environment->fx_set_param(Environment::FX_PARAM_AMBIENT_LIGHT_COLOR,settings_ambient_color->get_color()); +// viewport_environment->fx_set_param(Environment::FX_PARAM_AMBIENT_LIGHT_COLOR,settings_ambient_color->get_color()); } void SpatialEditor::_update_default_light_angle() { Transform t; - t.basis.rotate(Vector3(1,0,0),settings_default_light_rot_x); - t.basis.rotate(Vector3(0,1,0),settings_default_light_rot_y); + t.basis.rotate(Vector3(1,0,0),-settings_default_light_rot_x); + t.basis.rotate(Vector3(0,1,0),-settings_default_light_rot_y); settings_dlight->set_transform(t); if (light_instance.is_valid()) { VS::get_singleton()->instance_set_transform(light_instance,t); @@ -3884,7 +3896,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { p->add_separator(); p->add_shortcut(ED_SHORTCUT("spatial_editor/transform_dialog", TTR("Transform Dialog..")), MENU_TRANSFORM_DIALOG); - p->connect("item_pressed", this,"_menu_item_pressed"); + p->connect("id_pressed", this,"_menu_item_pressed"); view_menu = memnew( MenuButton ); view_menu->set_text(TTR("View")); @@ -3922,7 +3934,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { p->set_item_checked( p->get_item_index(MENU_VIEW_GRID), true ); - p->connect("item_pressed", this,"_menu_item_pressed"); + p->connect("id_pressed", this,"_menu_item_pressed"); /* REST OF MENU */ @@ -3956,7 +3968,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { VBoxContainer *snap_dialog_vbc = memnew( VBoxContainer ); snap_dialog->add_child(snap_dialog_vbc); - snap_dialog->set_child_rect(snap_dialog_vbc); + //snap_dialog->set_child_rect(snap_dialog_vbc); snap_translate = memnew( LineEdit ); snap_translate->set_text("1"); @@ -3978,13 +3990,13 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { settings_vbc = memnew( VBoxContainer ); settings_vbc->set_custom_minimum_size(Size2(200,0)); settings_dialog->add_child(settings_vbc); - settings_dialog->set_child_rect(settings_vbc); + //settings_dialog->set_child_rect(settings_vbc); - settings_light_base = memnew( Control ); + settings_light_base = memnew( ViewportContainer ); settings_light_base->set_custom_minimum_size(Size2(128,128)); - settings_light_base->connect("input_event",this,"_default_light_angle_input"); + settings_light_base->connect("gui_input",this,"_default_light_angle_input"); settings_vbc->add_margin_child(TTR("Default Light Normal:"),settings_light_base); settings_light_vp = memnew( Viewport ); settings_light_vp->set_disable_input(true); @@ -4013,8 +4025,8 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { settings_vbc->add_margin_child(TTR("Ambient Light Color:"),settings_ambient_color); settings_ambient_color->connect("color_changed",this,"_update_ambient_light_color"); - viewport_environment->set_enable_fx(Environment::FX_AMBIENT_LIGHT,true); - viewport_environment->fx_set_param(Environment::FX_PARAM_AMBIENT_LIGHT_COLOR,Color(0.15,0.15,0.15)); +// viewport_environment->set_enable_fx(Environment::FX_AMBIENT_LIGHT,true); +// viewport_environment->fx_set_param(Environment::FX_PARAM_AMBIENT_LIGHT_COLOR,Color(0.15,0.15,0.15)); settings_ambient_color->set_color(Color(0.15,0.15,0.15)); @@ -4022,21 +4034,21 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { settings_fov->set_max(179); settings_fov->set_min(1); settings_fov->set_step(0.01); - settings_fov->set_val(EDITOR_DEF("3d_editor/default_fov",60.0)); + settings_fov->set_value(EDITOR_DEF("editors/3d/default_fov",60.0)); settings_vbc->add_margin_child(TTR("Perspective FOV (deg.):"),settings_fov); settings_znear = memnew( SpinBox ); settings_znear->set_max(10000); settings_znear->set_min(0.1); settings_znear->set_step(0.01); - settings_znear->set_val(EDITOR_DEF("3d_editor/default_z_near",0.1)); + settings_znear->set_value(EDITOR_DEF("editors/3d/default_z_near",0.1)); settings_vbc->add_margin_child(TTR("View Z-Near:"),settings_znear); settings_zfar = memnew( SpinBox ); settings_zfar->set_max(10000); settings_zfar->set_min(0.1); settings_zfar->set_step(0.01); - settings_zfar->set_val(EDITOR_DEF("3d_editor/default_z_far",1500)); + settings_zfar->set_value(EDITOR_DEF("editors/3d/default_z_far",1500)); settings_vbc->add_margin_child(TTR("View Z-Far:"),settings_zfar); //settings_dialog->get_cancel()->hide(); @@ -4104,9 +4116,9 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { set_process_unhandled_key_input(true); add_to_group("_spatial_editor_group"); - EDITOR_DEF("3d_editor/manipulator_gizmo_size",80); + EDITOR_DEF("editors/3d/manipulator_gizmo_size",80); EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT,"3d_editor/manipulator_gizmo_size",PROPERTY_HINT_RANGE,"16,1024,1")); - EDITOR_DEF("3d_editor/manipulator_gizmo_opacity",0.2); + EDITOR_DEF("editors/3d/manipulator_gizmo_opacity",0.2); over_gizmo_handle=-1; } @@ -4145,7 +4157,7 @@ void SpatialEditorPlugin::edit(Object *p_object) { bool SpatialEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("Spatial"); + return p_object->is_class("Spatial"); } Dictionary SpatialEditorPlugin::get_state() const { @@ -4164,7 +4176,7 @@ void SpatialEditor::snap_cursor_to_plane(const Plane& p_plane) { void SpatialEditorPlugin::_bind_methods() { - ObjectTypeDB::bind_method("snap_cursor_to_plane",&SpatialEditorPlugin::snap_cursor_to_plane); + ClassDB::bind_method("snap_cursor_to_plane",&SpatialEditorPlugin::snap_cursor_to_plane); } diff --git a/tools/editor/plugins/spatial_editor_plugin.h b/tools/editor/plugins/spatial_editor_plugin.h index 89587526ee..b05b7d8545 100644 --- a/tools/editor/plugins/spatial_editor_plugin.h +++ b/tools/editor/plugins/spatial_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -45,7 +45,7 @@ class SpatialEditorGizmos; class SpatialEditorGizmo : public SpatialGizmo { - OBJ_TYPE(SpatialEditorGizmo,SpatialGizmo); + GDCLASS(SpatialEditorGizmo,SpatialGizmo); bool selected; public: @@ -66,7 +66,7 @@ public: class SpatialEditorViewport : public Control { - OBJ_TYPE( SpatialEditorViewport, Control ); + GDCLASS( SpatialEditorViewport, Control ); friend class SpatialEditor; enum { @@ -267,11 +267,11 @@ public: class SpatialEditorSelectedItem : public Object { - OBJ_TYPE(SpatialEditorSelectedItem,Object); + GDCLASS(SpatialEditorSelectedItem,Object); public: - AABB aabb; + Rect3 aabb; Transform original; // original location when moving Transform last_xform; // last transform Spatial *sp; @@ -283,7 +283,7 @@ public: class SpatialEditor : public VBoxContainer { - OBJ_TYPE(SpatialEditor, VBoxContainer ); + GDCLASS(SpatialEditor, VBoxContainer ); public: enum ToolMode { @@ -332,8 +332,8 @@ private: bool grid_enabled; Ref<Mesh> move_gizmo[3], rotate_gizmo[3]; - Ref<FixedMaterial> gizmo_color[3]; - Ref<FixedMaterial> gizmo_hl; + Ref<FixedSpatialMaterial> gizmo_color[3]; + Ref<FixedSpatialMaterial> gizmo_hl; int over_gizmo_handle; @@ -345,8 +345,8 @@ private: RID indicators_instance; RID cursor_mesh; RID cursor_instance; - RID indicator_mat; - RID cursor_material; + Ref<FixedSpatialMaterial> indicator_mat; + Ref<FixedSpatialMaterial> cursor_material; /* struct Selected { @@ -431,7 +431,7 @@ private: float settings_default_light_rot_x; float settings_default_light_rot_y; - Control *settings_light_base; + ViewportContainer *settings_light_base; Viewport *settings_light_vp; ColorPickerButton *settings_ambient_color; Image settings_light_dir_image; @@ -481,7 +481,7 @@ protected: void _notification(int p_what); - //void _input_event(InputEvent p_event); + //void _gui_input(InputEvent p_event); void _unhandled_key_input(InputEvent p_event); static void _bind_methods(); @@ -491,9 +491,9 @@ public: static SpatialEditor *get_singleton() { return singleton; } void snap_cursor_to_plane(const Plane& p_plane); - float get_znear() const { return settings_znear->get_val(); } - float get_zfar() const { return settings_zfar->get_val(); } - float get_fov() const { return settings_fov->get_val(); } + float get_znear() const { return settings_znear->get_value(); } + float get_zfar() const { return settings_zfar->get_value(); } + float get_fov() const { return settings_fov->get_value(); } Transform get_gizmo_transform() const { return gizmo.transform; } bool is_gizmo_visible() const { return gizmo.visible; } @@ -546,7 +546,7 @@ public: class SpatialEditorPlugin : public EditorPlugin { - OBJ_TYPE( SpatialEditorPlugin, EditorPlugin ); + GDCLASS( SpatialEditorPlugin, EditorPlugin ); SpatialEditor *spatial_editor; EditorNode *editor; diff --git a/tools/editor/plugins/sprite_frames_editor_plugin.cpp b/tools/editor/plugins/sprite_frames_editor_plugin.cpp index 41beaa96a1..67948b0302 100644 --- a/tools/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/tools/editor/plugins/sprite_frames_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ -void SpriteFramesEditor::_input_event(InputEvent p_event) { +void SpriteFramesEditor::_gui_input(InputEvent p_event) { } @@ -64,7 +64,7 @@ void SpriteFramesEditor::_notification(int p_what) { } } -void SpriteFramesEditor::_file_load_request(const DVector<String>& p_path,int p_at_pos) { +void SpriteFramesEditor::_file_load_request(const PoolVector<String>& p_path,int p_at_pos) { ERR_FAIL_COND(!frames->has_animation(edited_anim)); @@ -605,7 +605,7 @@ void SpriteFramesEditor::_update_library(bool p_skip_selector) { tree->select(tree->get_item_count()-1); } - anim_speed->set_val(frames->get_animation_speed(edited_anim)); + anim_speed->set_value(frames->get_animation_speed(edited_anim)); anim_loop->set_pressed(frames->get_animation_loop(edited_anim)); updating=false; @@ -700,7 +700,7 @@ bool SpriteFramesEditor::can_drop_data_fw(const Point2& p_point,const Variant& p String file = files[0]; String ftype = EditorFileSystem::get_singleton()->get_file_type(file); - if (!ObjectTypeDB::is_type(ftype,"Texture")) { + if (!ClassDB::is_parent_class(ftype,"Texture")) { return false; } @@ -744,7 +744,7 @@ void SpriteFramesEditor::drop_data_fw(const Point2& p_point,const Variant& p_dat if (String(d["type"])=="files") { - DVector<String> files = d["files"]; + PoolVector<String> files = d["files"]; _file_load_request(files,at_pos); } @@ -754,27 +754,27 @@ void SpriteFramesEditor::drop_data_fw(const Point2& p_point,const Variant& p_dat void SpriteFramesEditor::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_input_event"),&SpriteFramesEditor::_input_event); - ObjectTypeDB::bind_method(_MD("_load_pressed"),&SpriteFramesEditor::_load_pressed); - ObjectTypeDB::bind_method(_MD("_empty_pressed"),&SpriteFramesEditor::_empty_pressed); - ObjectTypeDB::bind_method(_MD("_empty2_pressed"),&SpriteFramesEditor::_empty2_pressed); - ObjectTypeDB::bind_method(_MD("_item_edited"),&SpriteFramesEditor::_item_edited); - ObjectTypeDB::bind_method(_MD("_delete_pressed"),&SpriteFramesEditor::_delete_pressed); - ObjectTypeDB::bind_method(_MD("_paste_pressed"),&SpriteFramesEditor::_paste_pressed); - ObjectTypeDB::bind_method(_MD("_delete_confirm_pressed"),&SpriteFramesEditor::_delete_confirm_pressed); - ObjectTypeDB::bind_method(_MD("_file_load_request","files","atpos"),&SpriteFramesEditor::_file_load_request,DEFVAL(-1)); - ObjectTypeDB::bind_method(_MD("_update_library","skipsel"),&SpriteFramesEditor::_update_library,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("_up_pressed"),&SpriteFramesEditor::_up_pressed); - ObjectTypeDB::bind_method(_MD("_down_pressed"),&SpriteFramesEditor::_down_pressed); - ObjectTypeDB::bind_method(_MD("_animation_select"),&SpriteFramesEditor::_animation_select); - ObjectTypeDB::bind_method(_MD("_animation_name_edited"),&SpriteFramesEditor::_animation_name_edited); - ObjectTypeDB::bind_method(_MD("_animation_add"),&SpriteFramesEditor::_animation_add); - ObjectTypeDB::bind_method(_MD("_animation_remove"),&SpriteFramesEditor::_animation_remove); - ObjectTypeDB::bind_method(_MD("_animation_loop_changed"),&SpriteFramesEditor::_animation_loop_changed); - ObjectTypeDB::bind_method(_MD("_animation_fps_changed"),&SpriteFramesEditor::_animation_fps_changed); - ObjectTypeDB::bind_method(_MD("get_drag_data_fw"), &SpriteFramesEditor::get_drag_data_fw); - ObjectTypeDB::bind_method(_MD("can_drop_data_fw"), &SpriteFramesEditor::can_drop_data_fw); - ObjectTypeDB::bind_method(_MD("drop_data_fw"), &SpriteFramesEditor::drop_data_fw); + ClassDB::bind_method(_MD("_gui_input"),&SpriteFramesEditor::_gui_input); + ClassDB::bind_method(_MD("_load_pressed"),&SpriteFramesEditor::_load_pressed); + ClassDB::bind_method(_MD("_empty_pressed"),&SpriteFramesEditor::_empty_pressed); + ClassDB::bind_method(_MD("_empty2_pressed"),&SpriteFramesEditor::_empty2_pressed); + ClassDB::bind_method(_MD("_item_edited"),&SpriteFramesEditor::_item_edited); + ClassDB::bind_method(_MD("_delete_pressed"),&SpriteFramesEditor::_delete_pressed); + ClassDB::bind_method(_MD("_paste_pressed"),&SpriteFramesEditor::_paste_pressed); + ClassDB::bind_method(_MD("_delete_confirm_pressed"),&SpriteFramesEditor::_delete_confirm_pressed); + ClassDB::bind_method(_MD("_file_load_request","files","atpos"),&SpriteFramesEditor::_file_load_request,DEFVAL(-1)); + ClassDB::bind_method(_MD("_update_library","skipsel"),&SpriteFramesEditor::_update_library,DEFVAL(false)); + ClassDB::bind_method(_MD("_up_pressed"),&SpriteFramesEditor::_up_pressed); + ClassDB::bind_method(_MD("_down_pressed"),&SpriteFramesEditor::_down_pressed); + ClassDB::bind_method(_MD("_animation_select"),&SpriteFramesEditor::_animation_select); + ClassDB::bind_method(_MD("_animation_name_edited"),&SpriteFramesEditor::_animation_name_edited); + ClassDB::bind_method(_MD("_animation_add"),&SpriteFramesEditor::_animation_add); + ClassDB::bind_method(_MD("_animation_remove"),&SpriteFramesEditor::_animation_remove); + ClassDB::bind_method(_MD("_animation_loop_changed"),&SpriteFramesEditor::_animation_loop_changed); + ClassDB::bind_method(_MD("_animation_fps_changed"),&SpriteFramesEditor::_animation_fps_changed); + ClassDB::bind_method(_MD("get_drag_data_fw"), &SpriteFramesEditor::get_drag_data_fw); + ClassDB::bind_method(_MD("can_drop_data_fw"), &SpriteFramesEditor::can_drop_data_fw); + ClassDB::bind_method(_MD("drop_data_fw"), &SpriteFramesEditor::drop_data_fw); } @@ -929,7 +929,7 @@ void SpriteFramesEditorPlugin::edit(Object *p_object) { bool SpriteFramesEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("SpriteFrames"); + return p_object->is_class("SpriteFrames"); } void SpriteFramesEditorPlugin::make_visible(bool p_visible) { diff --git a/tools/editor/plugins/sprite_frames_editor_plugin.h b/tools/editor/plugins/sprite_frames_editor_plugin.h index f0aa84c23a..36a022b7e4 100644 --- a/tools/editor/plugins/sprite_frames_editor_plugin.h +++ b/tools/editor/plugins/sprite_frames_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -41,7 +41,7 @@ class SpriteFramesEditor : public PanelContainer { - OBJ_TYPE(SpriteFramesEditor, PanelContainer ); + GDCLASS(SpriteFramesEditor, PanelContainer ); Button *load; Button *_delete; @@ -73,7 +73,7 @@ class SpriteFramesEditor : public PanelContainer { void _load_pressed(); void _load_scene_pressed(); - void _file_load_request(const DVector<String>& p_path, int p_at_pos=-1); + void _file_load_request(const PoolVector<String>& p_path, int p_at_pos=-1); void _paste_pressed(); void _empty_pressed(); void _empty2_pressed(); @@ -104,7 +104,7 @@ class SpriteFramesEditor : public PanelContainer { protected: void _notification(int p_what); - void _input_event(InputEvent p_event); + void _gui_input(InputEvent p_event); static void _bind_methods(); public: @@ -116,7 +116,7 @@ public: class SpriteFramesEditorPlugin : public EditorPlugin { - OBJ_TYPE( SpriteFramesEditorPlugin, EditorPlugin ); + GDCLASS( SpriteFramesEditorPlugin, EditorPlugin ); SpriteFramesEditor *frames_editor; EditorNode *editor; diff --git a/tools/editor/plugins/stream_editor_plugin.cpp b/tools/editor/plugins/stream_editor_plugin.cpp index d896784074..00d7b208c8 100644 --- a/tools/editor/plugins/stream_editor_plugin.cpp +++ b/tools/editor/plugins/stream_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -59,8 +59,8 @@ void StreamEditor::_stop() { void StreamEditor::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_play"),&StreamEditor::_play); - ObjectTypeDB::bind_method(_MD("_stop"),&StreamEditor::_stop); + ClassDB::bind_method(_MD("_play"),&StreamEditor::_play); + ClassDB::bind_method(_MD("_stop"),&StreamEditor::_stop); } @@ -104,7 +104,7 @@ void StreamEditorPlugin::edit(Object *p_object) { bool StreamEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("StreamPlayer") || p_object->is_type("SpatialStreamPlayer"); + return p_object->is_class("StreamPlayer") || p_object->is_class("SpatialStreamPlayer"); } void StreamEditorPlugin::make_visible(bool p_visible) { diff --git a/tools/editor/plugins/stream_editor_plugin.h b/tools/editor/plugins/stream_editor_plugin.h index 5730612d61..af29f64f93 100644 --- a/tools/editor/plugins/stream_editor_plugin.h +++ b/tools/editor/plugins/stream_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -40,7 +40,7 @@ class StreamEditor : public Control { - OBJ_TYPE(StreamEditor, Control ); + GDCLASS(StreamEditor, Control ); Button * play; Button * stop; @@ -62,7 +62,7 @@ public: class StreamEditorPlugin : public EditorPlugin { - OBJ_TYPE( StreamEditorPlugin, EditorPlugin ); + GDCLASS( StreamEditorPlugin, EditorPlugin ); StreamEditor *stream_editor; EditorNode *editor; diff --git a/tools/editor/plugins/style_box_editor_plugin.cpp b/tools/editor/plugins/style_box_editor_plugin.cpp index d5c885bd55..4319832adb 100644 --- a/tools/editor/plugins/style_box_editor_plugin.cpp +++ b/tools/editor/plugins/style_box_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -48,10 +48,10 @@ void StyleBoxEditor::_sb_changed() { void StyleBoxEditor::_bind_methods() { - ObjectTypeDB::bind_method("_sb_changed",&StyleBoxEditor::_sb_changed); -// ObjectTypeDB::bind_method("_import",&StyleBoxEditor::_import); -// ObjectTypeDB::bind_method("_import_accept",&StyleBoxEditor::_import_accept); -// ObjectTypeDB::bind_method("_preview_text_changed",&StyleBoxEditor::_preview_text_changed); + ClassDB::bind_method("_sb_changed",&StyleBoxEditor::_sb_changed); +// ClassDB::bind_method("_import",&StyleBoxEditor::_import); +// ClassDB::bind_method("_import_accept",&StyleBoxEditor::_import_accept); +// ClassDB::bind_method("_preview_text_changed",&StyleBoxEditor::_preview_text_changed); } StyleBoxEditor::StyleBoxEditor() { @@ -85,7 +85,7 @@ void StyleBoxEditorPlugin::edit(Object *p_node) { bool StyleBoxEditorPlugin::handles(Object *p_node) const{ - return p_node->is_type("StyleBox"); + return p_node->is_class("StyleBox"); } void StyleBoxEditorPlugin::make_visible(bool p_visible){ diff --git a/tools/editor/plugins/style_box_editor_plugin.h b/tools/editor/plugins/style_box_editor_plugin.h index 737f830bbb..b2288b8e74 100644 --- a/tools/editor/plugins/style_box_editor_plugin.h +++ b/tools/editor/plugins/style_box_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ class StyleBoxEditor : public Control { - OBJ_TYPE( StyleBoxEditor, Control ); + GDCLASS( StyleBoxEditor, Control ); Panel *panel; Panel *preview; @@ -61,7 +61,7 @@ public: class StyleBoxEditorPlugin : public EditorPlugin { - OBJ_TYPE( StyleBoxEditorPlugin, EditorPlugin ); + GDCLASS( StyleBoxEditorPlugin, EditorPlugin ); StyleBoxEditor *stylebox_editor; EditorNode *editor; diff --git a/tools/editor/plugins/texture_editor_plugin.cpp b/tools/editor/plugins/texture_editor_plugin.cpp index 1305e91105..7ff7d0f2f7 100644 --- a/tools/editor/plugins/texture_editor_plugin.cpp +++ b/tools/editor/plugins/texture_editor_plugin.cpp @@ -4,7 +4,7 @@ #include "globals.h" #include "tools/editor/editor_settings.h" -void TextureEditor::_input_event(InputEvent p_event) { +void TextureEditor::_gui_input(InputEvent p_event) { } @@ -49,7 +49,7 @@ void TextureEditor::_notification(int p_what) { if (texture->cast_to<ImageTexture>()) { format = Image::get_format_name(texture->cast_to<ImageTexture>()->get_format()); } else { - format=texture->get_type(); + format=texture->get_class(); } String text = itos(texture->get_width())+"x"+itos(texture->get_height())+" "+format; @@ -84,7 +84,7 @@ void TextureEditor::edit(Ref<Texture> p_texture) { void TextureEditor::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_input_event"),&TextureEditor::_input_event); + ClassDB::bind_method(_MD("_gui_input"),&TextureEditor::_gui_input); } @@ -106,7 +106,7 @@ void TextureEditorPlugin::edit(Object *p_object) { bool TextureEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("Texture"); + return p_object->is_class("Texture"); } void TextureEditorPlugin::make_visible(bool p_visible) { diff --git a/tools/editor/plugins/texture_editor_plugin.h b/tools/editor/plugins/texture_editor_plugin.h index 5f58f4fcdb..4b05f7f7ab 100644 --- a/tools/editor/plugins/texture_editor_plugin.h +++ b/tools/editor/plugins/texture_editor_plugin.h @@ -10,14 +10,14 @@ class TextureEditor : public Control { - OBJ_TYPE(TextureEditor, Control); + GDCLASS(TextureEditor, Control); Ref<Texture> texture; protected: void _notification(int p_what); - void _input_event(InputEvent p_event); + void _gui_input(InputEvent p_event); static void _bind_methods(); public: @@ -28,7 +28,7 @@ public: class TextureEditorPlugin : public EditorPlugin { - OBJ_TYPE( TextureEditorPlugin, EditorPlugin ); + GDCLASS( TextureEditorPlugin, EditorPlugin ); TextureEditor *texture_editor; EditorNode *editor; diff --git a/tools/editor/plugins/texture_region_editor_plugin.cpp b/tools/editor/plugins/texture_region_editor_plugin.cpp index 6b918e6e8f..15fe95075c 100644 --- a/tools/editor/plugins/texture_region_editor_plugin.cpp +++ b/tools/editor/plugins/texture_region_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Author: Mariano Suligoy */ /* */ @@ -57,14 +57,13 @@ void TextureRegionEditor::_region_draw() if (base_tex.is_null()) return; - Matrix32 mtx; + Transform2D mtx; mtx.elements[2]=-draw_ofs; mtx.scale_basis(Vector2(draw_zoom,draw_zoom)); - VS::get_singleton()->canvas_item_set_clip(edit_draw->get_canvas_item(),true); VS::get_singleton()->canvas_item_add_set_transform(edit_draw->get_canvas_item(),mtx); edit_draw->draw_texture(base_tex,Point2()); - VS::get_singleton()->canvas_item_add_set_transform(edit_draw->get_canvas_item(),Matrix32()); + VS::get_singleton()->canvas_item_add_set_transform(edit_draw->get_canvas_item(),Transform2D()); if (snap_mode == SNAP_GRID) { Size2 s = edit_draw->get_size(); @@ -166,13 +165,13 @@ void TextureRegionEditor::_region_draw() hscroll->set_min(scroll_rect.pos.x); hscroll->set_max(scroll_rect.pos.x+scroll_rect.size.x); hscroll->set_page(edit_draw->get_size().x); - hscroll->set_val(draw_ofs.x); + hscroll->set_value(draw_ofs.x); hscroll->set_step(0.001); vscroll->set_min(scroll_rect.pos.y); vscroll->set_max(scroll_rect.pos.y+scroll_rect.size.y); vscroll->set_page(edit_draw->get_size().y); - vscroll->set_val(draw_ofs.y); + vscroll->set_value(draw_ofs.y); vscroll->set_step(0.001); updating_scroll=false; @@ -204,7 +203,7 @@ void TextureRegionEditor::_region_draw() void TextureRegionEditor::_region_input(const InputEvent& p_input) { - Matrix32 mtx; + Transform2D mtx; mtx.elements[2]=-draw_ofs; mtx.scale_basis(Vector2(draw_zoom,draw_zoom)); @@ -388,9 +387,9 @@ void TextureRegionEditor::_region_input(const InputEvent& p_input) drag_index = -1; } } - } else if (mb.button_index == BUTTON_WHEEL_UP) { + } else if (mb.button_index == BUTTON_WHEEL_UP && mb.pressed) { _zoom_in(); - } else if (mb.button_index == BUTTON_WHEEL_DOWN) { + } else if (mb.button_index == BUTTON_WHEEL_DOWN && mb.pressed) { _zoom_out(); } } else if (p_input.type==InputEvent::MOUSE_MOTION) { @@ -400,8 +399,8 @@ void TextureRegionEditor::_region_input(const InputEvent& p_input) if (mm.button_mask&BUTTON_MASK_MIDDLE || Input::get_singleton()->is_key_pressed(KEY_SPACE)) { Vector2 draged(mm.relative_x,mm.relative_y); - hscroll->set_val( hscroll->get_val()-draged.x ); - vscroll->set_val( vscroll->get_val()-draged.y ); + hscroll->set_value( hscroll->get_value()-draged.x ); + vscroll->set_value( vscroll->get_value()-draged.y ); } else if (drag) { @@ -500,15 +499,15 @@ void TextureRegionEditor::_scroll_changed(float) if (updating_scroll) return; - draw_ofs.x=hscroll->get_val(); - draw_ofs.y=vscroll->get_val(); + draw_ofs.x=hscroll->get_value(); + draw_ofs.y=vscroll->get_value(); edit_draw->update(); } void TextureRegionEditor::_set_snap_mode(int p_mode) { - snap_mode = p_mode; snap_mode_button->get_popup()->set_item_checked(snap_mode,false); + snap_mode = p_mode; snap_mode_button->set_text(snap_mode_button->get_popup()->get_item_text(p_mode)); snap_mode_button->get_popup()->set_item_checked(snap_mode,true); @@ -615,21 +614,21 @@ void TextureRegionEditor::_node_removed(Object *p_obj) void TextureRegionEditor::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_edit_region"),&TextureRegionEditor::_edit_region); - ObjectTypeDB::bind_method(_MD("_region_draw"),&TextureRegionEditor::_region_draw); - ObjectTypeDB::bind_method(_MD("_region_input"),&TextureRegionEditor::_region_input); - ObjectTypeDB::bind_method(_MD("_scroll_changed"),&TextureRegionEditor::_scroll_changed); - ObjectTypeDB::bind_method(_MD("_node_removed"),&TextureRegionEditor::_node_removed); - ObjectTypeDB::bind_method(_MD("_set_snap_mode"),&TextureRegionEditor::_set_snap_mode); - ObjectTypeDB::bind_method(_MD("_set_snap_off_x"),&TextureRegionEditor::_set_snap_off_x); - ObjectTypeDB::bind_method(_MD("_set_snap_off_y"),&TextureRegionEditor::_set_snap_off_y); - ObjectTypeDB::bind_method(_MD("_set_snap_step_x"),&TextureRegionEditor::_set_snap_step_x); - ObjectTypeDB::bind_method(_MD("_set_snap_step_y"),&TextureRegionEditor::_set_snap_step_y); - ObjectTypeDB::bind_method(_MD("_set_snap_sep_x"),&TextureRegionEditor::_set_snap_sep_x); - ObjectTypeDB::bind_method(_MD("_set_snap_sep_y"),&TextureRegionEditor::_set_snap_sep_y); - ObjectTypeDB::bind_method(_MD("_zoom_in"),&TextureRegionEditor::_zoom_in); - ObjectTypeDB::bind_method(_MD("_zoom_reset"),&TextureRegionEditor::_zoom_reset); - ObjectTypeDB::bind_method(_MD("_zoom_out"),&TextureRegionEditor::_zoom_out); + ClassDB::bind_method(_MD("_edit_region"),&TextureRegionEditor::_edit_region); + ClassDB::bind_method(_MD("_region_draw"),&TextureRegionEditor::_region_draw); + ClassDB::bind_method(_MD("_region_input"),&TextureRegionEditor::_region_input); + ClassDB::bind_method(_MD("_scroll_changed"),&TextureRegionEditor::_scroll_changed); + ClassDB::bind_method(_MD("_node_removed"),&TextureRegionEditor::_node_removed); + ClassDB::bind_method(_MD("_set_snap_mode"),&TextureRegionEditor::_set_snap_mode); + ClassDB::bind_method(_MD("_set_snap_off_x"),&TextureRegionEditor::_set_snap_off_x); + ClassDB::bind_method(_MD("_set_snap_off_y"),&TextureRegionEditor::_set_snap_off_y); + ClassDB::bind_method(_MD("_set_snap_step_x"),&TextureRegionEditor::_set_snap_step_x); + ClassDB::bind_method(_MD("_set_snap_step_y"),&TextureRegionEditor::_set_snap_step_y); + ClassDB::bind_method(_MD("_set_snap_sep_x"),&TextureRegionEditor::_set_snap_sep_x); + ClassDB::bind_method(_MD("_set_snap_sep_y"),&TextureRegionEditor::_set_snap_sep_y); + ClassDB::bind_method(_MD("_zoom_in"),&TextureRegionEditor::_zoom_in); + ClassDB::bind_method(_MD("_zoom_reset"),&TextureRegionEditor::_zoom_reset); + ClassDB::bind_method(_MD("_zoom_out"),&TextureRegionEditor::_zoom_out); } void TextureRegionEditor::edit(Object *p_obj) @@ -818,7 +817,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor) for (int i = 0; i < 4; i++) p->set_item_as_checkable(i,true); p->set_item_checked(0,true); - p->connect("item_pressed", this, "_set_snap_mode"); + p->connect("id_pressed", this, "_set_snap_mode"); hb_grid = memnew( HBoxContainer ); hb_tools->add_child(hb_grid); hb_grid->add_child( memnew( VSeparator )); @@ -829,7 +828,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor) sb_off_x->set_min(-256); sb_off_x->set_max(256); sb_off_x->set_step(1); - sb_off_x->set_val(snap_offset.x); + sb_off_x->set_value(snap_offset.x); sb_off_x->set_suffix("px"); sb_off_x->connect("value_changed", this, "_set_snap_off_x"); hb_grid->add_child(sb_off_x); @@ -838,7 +837,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor) sb_off_y->set_min(-256); sb_off_y->set_max(256); sb_off_y->set_step(1); - sb_off_y->set_val(snap_offset.y); + sb_off_y->set_value(snap_offset.y); sb_off_y->set_suffix("px"); sb_off_y->connect("value_changed", this, "_set_snap_off_y"); hb_grid->add_child(sb_off_y); @@ -850,7 +849,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor) sb_step_x->set_min(-256); sb_step_x->set_max(256); sb_step_x->set_step(1); - sb_step_x->set_val(snap_step.x); + sb_step_x->set_value(snap_step.x); sb_step_x->set_suffix("px"); sb_step_x->connect("value_changed", this, "_set_snap_step_x"); hb_grid->add_child(sb_step_x); @@ -859,7 +858,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor) sb_step_y->set_min(-256); sb_step_y->set_max(256); sb_step_y->set_step(1); - sb_step_y->set_val(snap_step.y); + sb_step_y->set_value(snap_step.y); sb_step_y->set_suffix("px"); sb_step_y->connect("value_changed", this, "_set_snap_step_y"); hb_grid->add_child(sb_step_y); @@ -871,7 +870,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor) sb_sep_x->set_min(0); sb_sep_x->set_max(256); sb_sep_x->set_step(1); - sb_sep_x->set_val(snap_separation.x); + sb_sep_x->set_value(snap_separation.x); sb_sep_x->set_suffix("px"); sb_sep_x->connect("value_changed", this, "_set_snap_sep_x"); hb_grid->add_child(sb_sep_x); @@ -880,7 +879,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor) sb_sep_y->set_min(0); sb_sep_y->set_max(256); sb_sep_y->set_step(1); - sb_sep_y->set_val(snap_separation.y); + sb_sep_y->set_value(snap_separation.y); sb_sep_y->set_suffix("px"); sb_sep_y->connect("value_changed", this, "_set_snap_sep_y"); hb_grid->add_child(sb_sep_y); @@ -921,10 +920,12 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor) hscroll->connect("value_changed",this,"_scroll_changed"); edit_draw->connect("draw",this,"_region_draw"); - edit_draw->connect("input_event",this,"_region_input"); + edit_draw->connect("gui_input",this,"_region_input"); draw_zoom=1.0; updating_scroll=false; + edit_draw->set_clip_contents(true); + } void TextureRegionEditorPlugin::edit(Object *p_node) @@ -934,7 +935,7 @@ void TextureRegionEditorPlugin::edit(Object *p_node) bool TextureRegionEditorPlugin::handles(Object *p_obj) const { - return p_obj->is_type("Sprite") || p_obj->is_type("Patch9Frame") || p_obj->is_type("StyleBoxTexture") || p_obj->is_type("AtlasTexture"); + return p_obj->is_class("Sprite") || p_obj->is_class("Patch9Frame") || p_obj->is_class("StyleBoxTexture") || p_obj->is_class("AtlasTexture"); } void TextureRegionEditorPlugin::make_visible(bool p_visible) @@ -971,22 +972,22 @@ void TextureRegionEditorPlugin::set_state(const Dictionary& p_state){ if (state.has("snap_step")) { Vector2 s = state["snap_step"]; - region_editor->sb_step_x->set_val(s.x); - region_editor->sb_step_y->set_val(s.y); + region_editor->sb_step_x->set_value(s.x); + region_editor->sb_step_y->set_value(s.y); region_editor->snap_step = s; } if (state.has("snap_offset")) { Vector2 ofs = state["snap_offset"]; - region_editor->sb_off_x->set_val(ofs.x); - region_editor->sb_off_y->set_val(ofs.y); + region_editor->sb_off_x->set_value(ofs.x); + region_editor->sb_off_y->set_value(ofs.y); region_editor->snap_offset = ofs; } if (state.has("snap_separation")) { Vector2 sep = state["snap_separation"]; - region_editor->sb_sep_x->set_val(sep.x); - region_editor->sb_sep_y->set_val(sep.y); + region_editor->sb_sep_x->set_value(sep.x); + region_editor->sb_sep_y->set_value(sep.y); region_editor->snap_separation = sep; } diff --git a/tools/editor/plugins/texture_region_editor_plugin.h b/tools/editor/plugins/texture_region_editor_plugin.h index f0bb7c9bc2..32cf389c35 100644 --- a/tools/editor/plugins/texture_region_editor_plugin.h +++ b/tools/editor/plugins/texture_region_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Author: Mariano Suligoy */ /* */ @@ -42,7 +42,7 @@ class TextureRegionEditor : public Control { - OBJ_TYPE(TextureRegionEditor, Control ); + GDCLASS(TextureRegionEditor, Control ); enum SnapMode { SNAP_NONE, @@ -132,7 +132,7 @@ public: class TextureRegionEditorPlugin : public EditorPlugin { - OBJ_TYPE( TextureRegionEditorPlugin, EditorPlugin ); + GDCLASS( TextureRegionEditorPlugin, EditorPlugin ); Button *region_button; TextureRegionEditor *region_editor; diff --git a/tools/editor/plugins/theme_editor_plugin.cpp b/tools/editor/plugins/theme_editor_plugin.cpp index 84568aa8c0..a700ddce7a 100644 --- a/tools/editor/plugins/theme_editor_plugin.cpp +++ b/tools/editor/plugins/theme_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -631,12 +631,12 @@ void ThemeEditor::_notification(int p_what) { void ThemeEditor::_bind_methods() { - ObjectTypeDB::bind_method("_type_menu_cbk",&ThemeEditor::_type_menu_cbk); - ObjectTypeDB::bind_method("_name_menu_about_to_show",&ThemeEditor::_name_menu_about_to_show); - ObjectTypeDB::bind_method("_name_menu_cbk",&ThemeEditor::_name_menu_cbk); - ObjectTypeDB::bind_method("_theme_menu_cbk",&ThemeEditor::_theme_menu_cbk); - ObjectTypeDB::bind_method("_dialog_cbk",&ThemeEditor::_dialog_cbk); - ObjectTypeDB::bind_method("_save_template_cbk",&ThemeEditor::_save_template_cbk); + ClassDB::bind_method("_type_menu_cbk",&ThemeEditor::_type_menu_cbk); + ClassDB::bind_method("_name_menu_about_to_show",&ThemeEditor::_name_menu_about_to_show); + ClassDB::bind_method("_name_menu_cbk",&ThemeEditor::_name_menu_cbk); + ClassDB::bind_method("_theme_menu_cbk",&ThemeEditor::_theme_menu_cbk); + ClassDB::bind_method("_dialog_cbk",&ThemeEditor::_dialog_cbk); + ClassDB::bind_method("_save_template_cbk",&ThemeEditor::_save_template_cbk); } ThemeEditor::ThemeEditor() { @@ -679,7 +679,7 @@ ThemeEditor::ThemeEditor() { add_child(theme_menu); theme_menu->set_pos(Vector2(3,3)*EDSCALE); - theme_menu->get_popup()->connect("item_pressed", this,"_theme_menu_cbk"); + theme_menu->get_popup()->connect("id_pressed", this,"_theme_menu_cbk"); HBoxContainer *main_hb = memnew( HBoxContainer ); @@ -711,7 +711,7 @@ ThemeEditor::ThemeEditor() { first_vb->add_child(cbx ); - ButtonGroup *bg = memnew( ButtonGroup ); + VBoxContainer *bg = memnew( VBoxContainer ); bg->set_v_size_flags(SIZE_EXPAND_FILL); VBoxContainer *gbvb = memnew( VBoxContainer ); gbvb->set_v_size_flags(SIZE_EXPAND_FILL); @@ -750,7 +750,7 @@ ThemeEditor::ThemeEditor() { first_vb->add_child( memnew( HScrollBar )); first_vb->add_child( memnew( SpinBox )); ProgressBar *pb=memnew( ProgressBar ); - pb->set_val(50); + pb->set_value(50); first_vb->add_child( pb); Panel *pn=memnew( Panel ); pn->set_custom_minimum_size(Size2(40,40)*EDSCALE); @@ -898,7 +898,7 @@ ThemeEditor::ThemeEditor() { type_menu->set_text(".."); add_del_dialog->add_child(type_menu); - type_menu->get_popup()->connect("item_pressed", this,"_type_menu_cbk"); + type_menu->get_popup()->connect("id_pressed", this,"_type_menu_cbk"); l = memnew( Label ); l->set_pos( Point2(200,5)*EDSCALE ); @@ -918,7 +918,7 @@ ThemeEditor::ThemeEditor() { add_del_dialog->add_child(name_menu); name_menu->get_popup()->connect("about_to_show", this,"_name_menu_about_to_show"); - name_menu->get_popup()->connect("item_pressed", this,"_name_menu_cbk"); + name_menu->get_popup()->connect("id_pressed", this,"_name_menu_cbk"); type_select_label= memnew( Label ); type_select_label->set_pos( Point2(400,5)*EDSCALE ); @@ -963,7 +963,7 @@ void ThemeEditorPlugin::edit(Object *p_node) { bool ThemeEditorPlugin::handles(Object *p_node) const{ - return p_node->is_type("Theme"); + return p_node->is_class("Theme"); } void ThemeEditorPlugin::make_visible(bool p_visible){ diff --git a/tools/editor/plugins/theme_editor_plugin.h b/tools/editor/plugins/theme_editor_plugin.h index ea8f8c1d3c..0af9128bf2 100644 --- a/tools/editor/plugins/theme_editor_plugin.h +++ b/tools/editor/plugins/theme_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -44,7 +44,7 @@ class ThemeEditor : public Control { - OBJ_TYPE( ThemeEditor, Control ); + GDCLASS( ThemeEditor, Control ); ScrollContainer *scroll; @@ -103,7 +103,7 @@ public: class ThemeEditorPlugin : public EditorPlugin { - OBJ_TYPE( ThemeEditorPlugin, EditorPlugin ); + GDCLASS( ThemeEditorPlugin, EditorPlugin ); ThemeEditor *theme_editor; EditorNode *editor; diff --git a/tools/editor/plugins/tile_map_editor_plugin.cpp b/tools/editor/plugins/tile_map_editor_plugin.cpp index 43fe7d7ea9..0d384ea3a2 100644 --- a/tools/editor/plugins/tile_map_editor_plugin.cpp +++ b/tools/editor/plugins/tile_map_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -189,7 +189,7 @@ void TileMapEditor::_sbox_input(const InputEvent& p_ie) { p_ie.key.scancode == KEY_PAGEUP || p_ie.key.scancode == KEY_PAGEDOWN ) ) { - palette->call("_input_event", p_ie); + palette->call("_gui_input", p_ie); search_box->accept_event(); } } @@ -212,16 +212,16 @@ void TileMapEditor::_update_palette() { if (tiles.empty()) return; - float min_size = EDITOR_DEF("tile_map/preview_size", 64); + float min_size = EDITOR_DEF("editors/tile_map/preview_size", 64); min_size *= EDSCALE; - int hseparation = EDITOR_DEF("tile_map/palette_item_hseparation",8); - bool show_tile_names = bool(EDITOR_DEF("tile_map/show_tile_names", true)); + int hseparation = EDITOR_DEF("editors/tile_map/palette_item_hseparation",8); + bool show_tile_names = bool(EDITOR_DEF("editors/tile_map/show_tile_names", true)); palette->add_constant_override("hseparation", hseparation*EDSCALE); palette->add_constant_override("vseparation", 8*EDSCALE); palette->set_fixed_icon_size(Size2(min_size, min_size)); - palette->set_fixed_column_width(min_size * MAX(size_slider->get_val(), 1)); + palette->set_fixed_column_width(min_size * MAX(size_slider->get_value(), 1)); String filter = search_box->get_text().strip_edges(); @@ -289,7 +289,7 @@ void TileMapEditor::_pick_tile(const Point2& p_pos) { canvas_item_editor->update(); } -DVector<Vector2> TileMapEditor::_bucket_fill(const Point2i& p_start, bool erase) { +PoolVector<Vector2> TileMapEditor::_bucket_fill(const Point2i& p_start, bool erase, bool preview) { int prev_id = node->get_cell(p_start.x, p_start.y); int id = TileMap::INVALID_CELL; @@ -297,14 +297,43 @@ DVector<Vector2> TileMapEditor::_bucket_fill(const Point2i& p_start, bool erase) id = get_selected_tile(); if (id == TileMap::INVALID_CELL) - return DVector<Vector2>(); + return PoolVector<Vector2>(); } - Rect2 r = node->get_item_rect(); + Rect2i r = node->get_item_rect(); r.pos = r.pos/node->get_cell_size(); r.size = r.size/node->get_cell_size(); - DVector<Vector2> points; + int area = r.get_area(); + if(preview) { + // Test if we can re-use the result from preview bucket fill + bool invalidate_cache = false; + // Area changed + if(r != bucket_cache_rect) + _clear_bucket_cache(); + // Cache grid is not initialized + if(bucket_cache_visited == 0) { + bucket_cache_visited = new bool[area]; + invalidate_cache = true; + } + // Tile ID changed or position wasn't visited by the previous fill + int loc = (p_start.x - r.get_pos().x) + (p_start.y - r.get_pos().y) * r.get_size().x; + if(prev_id != bucket_cache_tile || !bucket_cache_visited[loc]) { + invalidate_cache = true; + } + if(invalidate_cache) { + for(int i = 0; i < area; ++i) + bucket_cache_visited[i] = false; + bucket_cache = PoolVector<Vector2>(); + bucket_cache_tile = prev_id; + bucket_cache_rect = r; + } + else { + return bucket_cache; + } + } + + PoolVector<Vector2> points; List<Point2i> queue; queue.push_back(p_start); @@ -319,9 +348,17 @@ DVector<Vector2> TileMapEditor::_bucket_fill(const Point2i& p_start, bool erase) if (node->get_cell(n.x, n.y) == prev_id) { - node->set_cellv(n, id, flip_h, flip_v, transpose); - - points.push_back(n); + if(preview) { + int loc = (n.x - r.get_pos().x) + (n.y - r.get_pos().y) * r.get_size().x; + if(bucket_cache_visited[loc]) + continue; + bucket_cache_visited[loc] = true; + bucket_cache.push_back(n); + } + else { + node->set_cellv(n, id, flip_h, flip_v, transpose); + points.push_back(n); + } queue.push_back(n + Point2i(0, 1)); queue.push_back(n + Point2i(0, -1)); @@ -330,13 +367,13 @@ DVector<Vector2> TileMapEditor::_bucket_fill(const Point2i& p_start, bool erase) } } - return points; + return preview ? bucket_cache : points; } -void TileMapEditor::_fill_points(const DVector<Vector2> p_points, const Dictionary& p_op) { +void TileMapEditor::_fill_points(const PoolVector<Vector2> p_points, const Dictionary& p_op) { int len = p_points.size(); - DVector<Vector2>::Read pr = p_points.read(); + PoolVector<Vector2>::Read pr = p_points.read(); int id = p_op["id"]; bool xf = p_op["flip_h"]; @@ -349,10 +386,10 @@ void TileMapEditor::_fill_points(const DVector<Vector2> p_points, const Dictiona } } -void TileMapEditor::_erase_points(const DVector<Vector2> p_points) { +void TileMapEditor::_erase_points(const PoolVector<Vector2> p_points) { int len = p_points.size(); - DVector<Vector2>::Read pr = p_points.read(); + PoolVector<Vector2>::Read pr = p_points.read(); for (int i=0;i<len;i++) { @@ -380,7 +417,7 @@ void TileMapEditor::_select(const Point2i& p_from, const Point2i& p_to) { canvas_item_editor->update(); } -void TileMapEditor::_draw_cell(int p_cell, const Point2i& p_point, bool p_flip_h, bool p_flip_v, bool p_transpose, const Matrix32& p_xform) { +void TileMapEditor::_draw_cell(int p_cell, const Point2i& p_point, bool p_flip_h, bool p_flip_v, bool p_transpose, const Transform2D& p_xform) { Ref<Texture> t = node->get_tileset()->tile_get_texture(p_cell); @@ -468,6 +505,25 @@ void TileMapEditor::_draw_cell(int p_cell, const Point2i& p_point, bool p_flip_h canvas_item_editor->draw_texture_rect_region(t, rect, r, Color(1,1,1,0.5), p_transpose); } +void TileMapEditor::_draw_fill_preview(int p_cell, const Point2i& p_point, bool p_flip_h, bool p_flip_v, bool p_transpose, const Transform2D& p_xform) { + + PoolVector<Vector2> points = _bucket_fill(p_point, false, true); + PoolVector<Vector2>::Read pr = points.read(); + int len = points.size(); + int time_after = OS::get_singleton()->get_ticks_msec(); + + for(int i = 0; i < len; ++i) { + _draw_cell(p_cell, pr[i], p_flip_h, p_flip_v, p_transpose, p_xform); + } +} + +void TileMapEditor::_clear_bucket_cache() { + if(bucket_cache_visited) { + delete[] bucket_cache_visited; + bucket_cache_visited = 0; + } +} + void TileMapEditor::_update_copydata() { copydata.clear(); @@ -539,13 +595,13 @@ static inline Vector<Point2i> line(int x0, int x1, int y0, int y1) { return points; } -bool TileMapEditor::forward_input_event(const InputEvent& p_event) { +bool TileMapEditor::forward_gui_input(const InputEvent& p_event) { if (!node || !node->get_tileset().is_valid() || !node->is_visible()) return false; - Matrix32 xform = CanvasItemEditor::get_singleton()->get_canvas_transform() * node->get_global_transform(); - Matrix32 xform_inv = xform.affine_inverse(); + Transform2D xform = CanvasItemEditor::get_singleton()->get_canvas_transform() * node->get_global_transform(); + Transform2D xform_inv = xform.affine_inverse(); switch(p_event.type) { @@ -692,7 +748,7 @@ bool TileMapEditor::forward_input_event(const InputEvent& p_event) { pop["flip_v"] = node->is_cell_y_flipped(over_tile.x, over_tile.y); pop["transpose"] = node->is_cell_transposed(over_tile.x, over_tile.y); - DVector<Vector2> points = _bucket_fill(over_tile); + PoolVector<Vector2> points = _bucket_fill(over_tile); if (points.size() == 0) return false; @@ -798,7 +854,7 @@ bool TileMapEditor::forward_input_event(const InputEvent& p_event) { pop["flip_v"] = node->is_cell_y_flipped(over_tile.x, over_tile.y); pop["transpose"] = node->is_cell_transposed(over_tile.x, over_tile.y); - DVector<Vector2> points = _bucket_fill(over_tile, true); + PoolVector<Vector2> points = _bucket_fill(over_tile, true); if (points.size() == 0) return false; @@ -1015,10 +1071,10 @@ void TileMapEditor::_canvas_draw() { if (!node) return; - Matrix32 cell_xf = node->get_cell_transform(); + Transform2D cell_xf = node->get_cell_transform(); - Matrix32 xform = CanvasItemEditor::get_singleton()->get_canvas_transform() * node->get_global_transform(); - Matrix32 xform_inv = xform.affine_inverse(); + Transform2D xform = CanvasItemEditor::get_singleton()->get_canvas_transform() * node->get_global_transform(); + Transform2D xform_inv = xform.affine_inverse(); Size2 screen_size=canvas_item_editor->get_size(); @@ -1148,8 +1204,8 @@ void TileMapEditor::_canvas_draw() { canvas_item_editor->draw_line(endpoints[i],endpoints[(i+1)%4],col,2); - if (tool==TOOL_SELECTING || tool==TOOL_PICKING || tool==TOOL_BUCKET) { - + bool bucket_preview = EditorSettings::get_singleton()->get("editors/tile_map/bucket_fill_preview"); + if (tool==TOOL_SELECTING || tool==TOOL_PICKING || !bucket_preview) { return; } @@ -1214,6 +1270,11 @@ void TileMapEditor::_canvas_draw() { canvas_item_editor->draw_colored_polygon(points, Color(0.2,1.0,0.8,0.2)); + } else if(tool == TOOL_BUCKET) { + + int tile = get_selected_tile(); + _draw_fill_preview(tile, over_tile, flip_h, flip_v, transpose, xform); + } else { int st = get_selected_tile(); @@ -1264,6 +1325,8 @@ void TileMapEditor::edit(Node *p_tile_map) { if (node) node->connect("settings_changed",this,"_tileset_settings_changed"); + _clear_bucket_cache(); + } void TileMapEditor::_tileset_settings_changed() { @@ -1283,20 +1346,20 @@ void TileMapEditor::_icon_size_changed(float p_value) { void TileMapEditor::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_text_entered"),&TileMapEditor::_text_entered); - ObjectTypeDB::bind_method(_MD("_text_changed"),&TileMapEditor::_text_changed); - ObjectTypeDB::bind_method(_MD("_sbox_input"),&TileMapEditor::_sbox_input); - ObjectTypeDB::bind_method(_MD("_menu_option"),&TileMapEditor::_menu_option); - ObjectTypeDB::bind_method(_MD("_canvas_draw"),&TileMapEditor::_canvas_draw); - ObjectTypeDB::bind_method(_MD("_canvas_mouse_enter"),&TileMapEditor::_canvas_mouse_enter); - ObjectTypeDB::bind_method(_MD("_canvas_mouse_exit"),&TileMapEditor::_canvas_mouse_exit); - ObjectTypeDB::bind_method(_MD("_tileset_settings_changed"),&TileMapEditor::_tileset_settings_changed); - ObjectTypeDB::bind_method(_MD("_update_transform_buttons"),&TileMapEditor::_update_transform_buttons); + ClassDB::bind_method(_MD("_text_entered"),&TileMapEditor::_text_entered); + ClassDB::bind_method(_MD("_text_changed"),&TileMapEditor::_text_changed); + ClassDB::bind_method(_MD("_sbox_input"),&TileMapEditor::_sbox_input); + ClassDB::bind_method(_MD("_menu_option"),&TileMapEditor::_menu_option); + ClassDB::bind_method(_MD("_canvas_draw"),&TileMapEditor::_canvas_draw); + ClassDB::bind_method(_MD("_canvas_mouse_enter"),&TileMapEditor::_canvas_mouse_enter); + ClassDB::bind_method(_MD("_canvas_mouse_exit"),&TileMapEditor::_canvas_mouse_exit); + ClassDB::bind_method(_MD("_tileset_settings_changed"),&TileMapEditor::_tileset_settings_changed); + ClassDB::bind_method(_MD("_update_transform_buttons"),&TileMapEditor::_update_transform_buttons); - ObjectTypeDB::bind_method(_MD("_fill_points"),&TileMapEditor::_fill_points); - ObjectTypeDB::bind_method(_MD("_erase_points"),&TileMapEditor::_erase_points); + ClassDB::bind_method(_MD("_fill_points"),&TileMapEditor::_fill_points); + ClassDB::bind_method(_MD("_erase_points"),&TileMapEditor::_erase_points); - ObjectTypeDB::bind_method(_MD("_icon_size_changed"), &TileMapEditor::_icon_size_changed); + ClassDB::bind_method(_MD("_icon_size_changed"), &TileMapEditor::_icon_size_changed); } TileMapEditor::CellOp TileMapEditor::_get_op_from_cell(const Point2i& p_pos) @@ -1365,6 +1428,9 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { flip_v=false; transpose=false; + bucket_cache_tile = -1; + bucket_cache_visited = 0; + ED_SHORTCUT("tile_map_editor/erase_selection", TTR("Erase selection"), KEY_DELETE); ED_SHORTCUT("tile_map_editor/find_tile", TTR("Find tile"), KEY_MASK_CMD+KEY_F); ED_SHORTCUT("tile_map_editor/transpose", TTR("Transpose")); @@ -1375,7 +1441,7 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { search_box->set_h_size_flags(SIZE_EXPAND_FILL); search_box->connect("text_entered", this, "_text_entered"); search_box->connect("text_changed", this, "_text_changed"); - search_box->connect("input_event", this, "_sbox_input"); + search_box->connect("gui_input", this, "_sbox_input"); add_child(search_box); size_slider = memnew( HSlider ); @@ -1383,11 +1449,11 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { size_slider->set_min(0.1f); size_slider->set_max(4.0f); size_slider->set_step(0.1f); - size_slider->set_val(1.0f); + size_slider->set_value(1.0f); size_slider->connect("value_changed", this, "_icon_size_changed"); add_child(size_slider); - int mw = EDITOR_DEF("tile_map/palette_min_width", 80); + int mw = EDITOR_DEF("editors/tile_map/palette_min_width", 80); // Add tile palette palette = memnew( ItemList ); @@ -1423,7 +1489,7 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { p->add_shortcut(ED_SHORTCUT("tile_map_editor/duplicate_selection", TTR("Duplicate Selection"), KEY_MASK_CMD+KEY_D), OPTION_DUPLICATE); p->add_shortcut(ED_GET_SHORTCUT("tile_map_editor/erase_selection"), OPTION_ERASE_SELECTION); - p->connect("item_pressed", this, "_menu_option"); + p->connect("id_pressed", this, "_menu_option"); toolbar->add_child(options); @@ -1479,6 +1545,10 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { rotate_0->set_pressed(true); } +TileMapEditor::~TileMapEditor() { + _clear_bucket_cache(); +} + /////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////// @@ -1490,7 +1560,7 @@ void TileMapEditorPlugin::edit(Object *p_object) { bool TileMapEditorPlugin::handles(Object *p_object) const { - return p_object->is_type("TileMap"); + return p_object->is_class("TileMap"); } void TileMapEditorPlugin::make_visible(bool p_visible) { @@ -1509,9 +1579,10 @@ void TileMapEditorPlugin::make_visible(bool p_visible) { TileMapEditorPlugin::TileMapEditorPlugin(EditorNode *p_node) { - EDITOR_DEF("tile_map/preview_size",64); - EDITOR_DEF("tile_map/palette_item_hseparation",8); - EDITOR_DEF("tile_map/show_tile_names", true); + EDITOR_DEF("editors/tile_map/preview_size",64); + EDITOR_DEF("editors/tile_map/palette_item_hseparation",8); + EDITOR_DEF("editors/tile_map/show_tile_names", true); + EDITOR_DEF("editors/tile_map/bucket_fill_preview", true); tile_map_editor = memnew( TileMapEditor(p_node) ); add_control_to_container(CONTAINER_CANVAS_EDITOR_SIDE, tile_map_editor); diff --git a/tools/editor/plugins/tile_map_editor_plugin.h b/tools/editor/plugins/tile_map_editor_plugin.h index 2f24002770..08032d9afd 100644 --- a/tools/editor/plugins/tile_map_editor_plugin.h +++ b/tools/editor/plugins/tile_map_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -44,7 +44,7 @@ class TileMapEditor : public VBoxContainer { - OBJ_TYPE(TileMapEditor, VBoxContainer ); + GDCLASS(TileMapEditor, VBoxContainer ); enum Tool { @@ -106,6 +106,11 @@ class TileMapEditor : public VBoxContainer { Point2i over_tile; + bool * bucket_cache_visited; + Rect2i bucket_cache_rect; + int bucket_cache_tile; + PoolVector<Vector2> bucket_cache; + struct CellOp { int idx; bool xf; @@ -129,14 +134,17 @@ class TileMapEditor : public VBoxContainer { void _pick_tile(const Point2& p_pos); - DVector<Vector2> _bucket_fill(const Point2i& p_start, bool erase=false); + PoolVector<Vector2> _bucket_fill(const Point2i& p_start, bool erase=false, bool preview=false); - void _fill_points(const DVector<Vector2> p_points, const Dictionary& p_op); - void _erase_points(const DVector<Vector2> p_points); + void _fill_points(const PoolVector<Vector2> p_points, const Dictionary& p_op); + void _erase_points(const PoolVector<Vector2> p_points); void _select(const Point2i& p_from, const Point2i& p_to); - void _draw_cell(int p_cell, const Point2i& p_point, bool p_flip_h, bool p_flip_v, bool p_transpose, const Matrix32& p_xform); + void _draw_cell(int p_cell, const Point2i& p_point, bool p_flip_h, bool p_flip_v, bool p_transpose, const Transform2D& p_xform); + void _draw_fill_preview(int p_cell, const Point2i& p_point, bool p_flip_h, bool p_flip_v, bool p_transpose, const Transform2D& p_xform); + void _clear_bucket_cache(); + void _update_copydata(); int get_selected_tile() const; @@ -167,21 +175,22 @@ public: HBoxContainer *get_toolbar() const { return toolbar; } - bool forward_input_event(const InputEvent& p_event); + bool forward_gui_input(const InputEvent& p_event); void edit(Node *p_tile_map); TileMapEditor(EditorNode *p_editor); + ~TileMapEditor(); }; class TileMapEditorPlugin : public EditorPlugin { - OBJ_TYPE( TileMapEditorPlugin, EditorPlugin ); + GDCLASS( TileMapEditorPlugin, EditorPlugin ); TileMapEditor *tile_map_editor; public: - virtual bool forward_canvas_input_event(const Matrix32& p_canvas_xform,const InputEvent& p_event) { return tile_map_editor->forward_input_event(p_event); } + virtual bool forward_canvas_gui_input(const Transform2D& p_canvas_xform,const InputEvent& p_event) { return tile_map_editor->forward_gui_input(p_event); } virtual String get_name() const { return "TileMap"; } bool has_main_screen() const { return false; } diff --git a/tools/editor/plugins/tile_set_editor_plugin.cpp b/tools/editor/plugins/tile_set_editor_plugin.cpp index 39a15189e7..34002ee863 100644 --- a/tools/editor/plugins/tile_set_editor_plugin.cpp +++ b/tools/editor/plugins/tile_set_editor_plugin.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -221,9 +221,9 @@ Error TileSetEditor::update_library_file(Node *p_base_scene, Ref<TileSet> ml,boo void TileSetEditor::_bind_methods() { - ObjectTypeDB::bind_method("_menu_cbk",&TileSetEditor::_menu_cbk); - ObjectTypeDB::bind_method("_menu_confirm",&TileSetEditor::_menu_confirm); - ObjectTypeDB::bind_method("_name_dialog_confirm",&TileSetEditor::_name_dialog_confirm); + ClassDB::bind_method("_menu_cbk",&TileSetEditor::_menu_cbk); + ClassDB::bind_method("_menu_confirm",&TileSetEditor::_menu_confirm); + ClassDB::bind_method("_name_dialog_confirm",&TileSetEditor::_name_dialog_confirm); } TileSetEditor::TileSetEditor(EditorNode *p_editor) { @@ -240,7 +240,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) { options->get_popup()->add_separator(); options->get_popup()->add_item(TTR("Create from Scene"),MENU_OPTION_CREATE_FROM_SCENE); options->get_popup()->add_item(TTR("Merge from Scene"),MENU_OPTION_MERGE_FROM_SCENE); - options->get_popup()->connect("item_pressed", this,"_menu_cbk"); + options->get_popup()->connect("id_pressed", this,"_menu_cbk"); editor=p_editor; cd = memnew(ConfirmationDialog); add_child(cd); @@ -268,7 +268,7 @@ void TileSetEditorPlugin::edit(Object *p_node) { bool TileSetEditorPlugin::handles(Object *p_node) const{ - return p_node->is_type("TileSet"); + return p_node->is_class("TileSet"); } void TileSetEditorPlugin::make_visible(bool p_visible){ diff --git a/tools/editor/plugins/tile_set_editor_plugin.h b/tools/editor/plugins/tile_set_editor_plugin.h index 3f47520e2a..7fec7fa162 100644 --- a/tools/editor/plugins/tile_set_editor_plugin.h +++ b/tools/editor/plugins/tile_set_editor_plugin.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -38,7 +38,7 @@ class TileSetEditor : public Control { - OBJ_TYPE( TileSetEditor, Control ); + GDCLASS( TileSetEditor, Control ); Ref<TileSet> tileset; @@ -78,7 +78,7 @@ public: class TileSetEditorPlugin : public EditorPlugin { - OBJ_TYPE( TileSetEditorPlugin, EditorPlugin ); + GDCLASS( TileSetEditorPlugin, EditorPlugin ); TileSetEditor *tileset_editor; EditorNode *editor; diff --git a/tools/editor/progress_dialog.cpp b/tools/editor/progress_dialog.cpp index a950f7acfc..03303b8c48 100644 --- a/tools/editor/progress_dialog.cpp +++ b/tools/editor/progress_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -42,7 +42,7 @@ void BackgroundProgress::_add_task(const String& p_task,const String& p_label, i t.hb->add_child(l); t.progress = memnew( ProgressBar ); t.progress->set_max(p_steps); - t.progress->set_val(p_steps); + t.progress->set_value(p_steps); Control *ec = memnew( Control ); ec->set_h_size_flags(SIZE_EXPAND_FILL); ec->set_v_size_flags(SIZE_EXPAND_FILL); @@ -83,9 +83,9 @@ void BackgroundProgress::_task_step(const String& p_task, int p_step){ Task &t=tasks[p_task]; if (p_step<0) - t.progress->set_val(t.progress->get_val()+1); + t.progress->set_value(t.progress->get_value()+1); else - t.progress->set_val(p_step); + t.progress->set_value(p_step); } void BackgroundProgress::_end_task(const String& p_task){ @@ -101,10 +101,10 @@ void BackgroundProgress::_end_task(const String& p_task){ void BackgroundProgress::_bind_methods(){ - ObjectTypeDB::bind_method("_add_task",&BackgroundProgress::_add_task); - ObjectTypeDB::bind_method("_task_step",&BackgroundProgress::_task_step); - ObjectTypeDB::bind_method("_end_task",&BackgroundProgress::_end_task); - ObjectTypeDB::bind_method("_update",&BackgroundProgress::_update); + ClassDB::bind_method("_add_task",&BackgroundProgress::_add_task); + ClassDB::bind_method("_task_step",&BackgroundProgress::_task_step); + ClassDB::bind_method("_end_task",&BackgroundProgress::_end_task); + ClassDB::bind_method("_update",&BackgroundProgress::_update); } @@ -182,7 +182,7 @@ void ProgressDialog::add_task(const String& p_task,const String& p_label,int p_s t.vb->add_margin_child(p_label,vb2); t.progress = memnew( ProgressBar ); t.progress->set_max(p_steps); - t.progress->set_val(p_steps); + t.progress->set_value(p_steps); vb2->add_child(t.progress); t.state=memnew( Label ); t.state->set_clip_text(true); @@ -206,9 +206,9 @@ void ProgressDialog::task_step(const String& p_task, const String& p_state, int Task &t=tasks[p_task]; if (p_step<0) - t.progress->set_val(t.progress->get_val()+1); + t.progress->set_value(t.progress->get_value()+1); else - t.progress->set_val(p_step); + t.progress->set_value(p_step); t.state->set_text(p_state); last_progress_tick=OS::get_singleton()->get_ticks_usec(); diff --git a/tools/editor/progress_dialog.h b/tools/editor/progress_dialog.h index c254d45753..60acf825a9 100644 --- a/tools/editor/progress_dialog.h +++ b/tools/editor/progress_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ class BackgroundProgress : public HBoxContainer { - OBJ_TYPE(BackgroundProgress,HBoxContainer); + GDCLASS(BackgroundProgress,HBoxContainer); _THREAD_SAFE_CLASS_ @@ -72,7 +72,7 @@ public: class ProgressDialog : public Popup { - OBJ_TYPE( ProgressDialog, Popup ); + GDCLASS( ProgressDialog, Popup ); struct Task { String task; diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp index 103962716b..27f2f7dbc9 100644 --- a/tools/editor/project_export.cpp +++ b/tools/editor/project_export.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -274,7 +274,7 @@ void ProjectExportDialog::_script_edited(Variant v) { void ProjectExportDialog::_sample_convert_edited(int what) { EditorImportExport::get_singleton()->sample_set_action( EditorImportExport::SampleAction(sample_mode->get_selected())); - EditorImportExport::get_singleton()->sample_set_max_hz( sample_max_hz->get_val() ); + EditorImportExport::get_singleton()->sample_set_max_hz( sample_max_hz->get_value() ); EditorImportExport::get_singleton()->sample_set_trim( sample_trim->is_pressed() ); _save_export_cfg(); @@ -325,8 +325,8 @@ void ProjectExportDialog::_notification(int p_what) { tree_vb->show(); image_action->select(EditorImportExport::get_singleton()->get_export_image_action()); - image_quality->set_val(EditorImportExport::get_singleton()->get_export_image_quality()); - image_shrink->set_val(EditorImportExport::get_singleton()->get_export_image_shrink()); + image_quality->set_value(EditorImportExport::get_singleton()->get_export_image_quality()); + image_shrink->set_value(EditorImportExport::get_singleton()->get_export_image_shrink()); _update_script(); @@ -350,7 +350,7 @@ void ProjectExportDialog::_notification(int p_what) { _update_group_tree(); sample_mode->select( EditorImportExport::get_singleton()->sample_get_action() ); - sample_max_hz->set_val( EditorImportExport::get_singleton()->sample_get_max_hz() ); + sample_max_hz->set_value( EditorImportExport::get_singleton()->sample_get_max_hz() ); sample_trim->set_pressed( EditorImportExport::get_singleton()->sample_get_trim() ); sample_mode->connect("item_selected",this,"_sample_convert_edited"); @@ -448,7 +448,7 @@ void ProjectExportDialog::_export_mode_changed(int p_idx) { void ProjectExportDialog::_export_action(const String& p_file) { - String location = Globals::get_singleton()->globalize_path(p_file).get_base_dir().replace("\\","/"); + String location = GlobalConfig::get_singleton()->globalize_path(p_file).get_base_dir().replace("\\","/"); while(true) { @@ -589,6 +589,11 @@ void ProjectExportDialog::custom_action(const String&) { return; } + if (platform.to_lower()=="android" && _check_android_setting(exporter)==false){ + // not filled all field for Android release + return; + } + String extension = exporter->get_binary_extension(); file_export_password->set_editable( exporter->requires_password(exporter->is_debugging_enabled()) ); @@ -602,6 +607,204 @@ void ProjectExportDialog::custom_action(const String&) { } +LineEdit* ProjectExportDialog::_create_keystore_input(Control* container, const String& p_label, const String& name) { + + HBoxContainer* hb=memnew(HBoxContainer); + Label* lb=memnew(Label); + LineEdit* input=memnew(LineEdit); + + lb->set_text(p_label); + lb->set_custom_minimum_size(Size2(140*EDSCALE,0)); + lb->set_align(Label::ALIGN_RIGHT); + + input->set_custom_minimum_size(Size2(170*EDSCALE,0)); + input->set_name(name); + + hb->add_constant_override("separation", 10*EDSCALE); + hb->add_child(lb); + hb->add_child(input); + container->add_child(hb); + + return input; + +} + +void ProjectExportDialog::_create_android_keystore_window() { + + keystore_file_dialog = memnew( EditorFileDialog ); + add_child(keystore_file_dialog); + keystore_file_dialog->set_mode(EditorFileDialog::MODE_OPEN_DIR); + keystore_file_dialog->set_access(EditorFileDialog::ACCESS_FILESYSTEM); + keystore_file_dialog->set_current_dir( "res://" ); + + keystore_file_dialog->set_title(TTR("Target Path:")); + keystore_file_dialog->connect("dir_selected", this,"_keystore_dir_selected"); + + keystore_create_dialog=memnew(ConfirmationDialog); + VBoxContainer* vb=memnew(VBoxContainer); + vb->set_size(Size2(340*EDSCALE,0)); + keystore_create_dialog->set_title(TTR("Create Android keystore")); + + _create_keystore_input(vb, TTR("Full name"), "name"); + _create_keystore_input(vb, TTR("Organizational unit"), "unit"); + _create_keystore_input(vb, TTR("Organization"), "org"); + _create_keystore_input(vb, TTR("City"), "city"); + _create_keystore_input(vb, TTR("State"), "state"); + _create_keystore_input(vb, TTR("2 letter country code"), "code"); + _create_keystore_input(vb, TTR("User alias"), "alias"); + LineEdit* pass=_create_keystore_input(vb, TTR("Password"), "pass"); + pass->set_placeholder(TTR("at least 6 characters")); + _create_keystore_input(vb, TTR("File name"), "file"); + + Label* lb_path=memnew(Label); + LineEdit* path=memnew(LineEdit); + Button* btn=memnew(Button); + HBoxContainer* hb=memnew(HBoxContainer); + + lb_path->set_text(TTR("Path : (better to save outside of project)")); + path->set_h_size_flags(SIZE_EXPAND_FILL); + path->set_name("path"); + btn->set_text(" .. "); + btn->connect("pressed", keystore_file_dialog, "popup_centered_ratio"); + + vb->add_spacer(); + vb->add_child(lb_path); + hb->add_child(path); + hb->add_child(btn); + vb->add_child(hb); + + keystore_create_dialog->add_child(vb); + //keystore_create_dialog->set_child_rect(vb); + add_child(keystore_create_dialog); + + keystore_create_dialog->connect("confirmed", this, "_create_android_keystore"); + path->connect("text_changed", this, "_check_keystore_path"); + + confirm_keystore = memnew(ConfirmationDialog); + confirm_keystore->connect("confirmed", keystore_create_dialog, "popup_centered_minsize"); + add_child(confirm_keystore); + +} + +void ProjectExportDialog::_keystore_dir_selected(const String& path) { + + LineEdit* edit=keystore_create_dialog->find_node("path", true, false)->cast_to<LineEdit>(); + edit->set_text(path.simplify_path()); + +} + +void ProjectExportDialog::_keystore_created() { + + if (error->is_connected("popup_hide", this, "_keystore_created")){ + error->disconnect("popup_hide", this, "_keystore_created"); + } + custom_action("export_pck"); + +} + +void ProjectExportDialog::_check_keystore_path(const String& path) { + + LineEdit* edit=keystore_create_dialog->find_node("path", true, false)->cast_to<LineEdit>(); + bool exists = DirAccess::exists(path); + if (!exists) { + edit->add_color_override("font_color", Color(1,0,0,1)); + } else { + edit->add_color_override("font_color", Color(0,1,0,1)); + } + +} + +void ProjectExportDialog::_create_android_keystore() { + + Vector<String> names=String("name,unit,org,city,state,code,alias,pass").split(","); + String path=keystore_create_dialog->find_node("path", true, false)->cast_to<LineEdit>()->get_text(); + String file=keystore_create_dialog->find_node("file", true, false)->cast_to<LineEdit>()->get_text(); + + if (file.ends_with(".keystore")==false) { + file+=".keystore"; + } + String fullpath=path.plus_file(file); + String info="CN=$name, OU=$unit, O=$org, L=$city, S=$state, C=$code"; + Dictionary dic; + + for (int i=0;i<names.size();i++){ + LineEdit* edit = keystore_create_dialog->find_node(names[i], true, false)->cast_to<LineEdit>(); + dic[names[i]]=edit->get_text(); + info=info.replace("$"+names[i], edit->get_text()); + } + + String jarsigner=EditorSettings::get_singleton()->get("export/android/jarsigner"); + String keytool=jarsigner.get_base_dir().plus_file("keytool"); + String os_name=OS::get_singleton()->get_name(); + if (os_name.to_lower()=="windows") { + keytool+=".exe"; + } + + bool exist=FileAccess::exists(keytool); + if (!exist) { + error->set_text("Can't find 'keytool'"); + error->popup_centered_minsize(); + return; + } + + List<String> args; + args.push_back("-genkey"); + args.push_back("-v"); + args.push_back("-keystore"); + args.push_back(fullpath); + args.push_back("-alias"); + args.push_back(dic["alias"]); + args.push_back("-storepass"); + args.push_back(dic["pass"]); + args.push_back("-keypass"); + args.push_back(dic["pass"]); + args.push_back("-keyalg"); + args.push_back("RSA"); + args.push_back("-keysize"); + args.push_back("2048"); + args.push_back("-validity"); + args.push_back("10000"); + args.push_back("-dname"); + args.push_back(info); + int retval; + OS::get_singleton()->execute(keytool,args,true,NULL,NULL,&retval); + + if (retval==0) { // success + platform_options->_edit_set("keystore/release", fullpath); + platform_options->_edit_set("keystore/release_user", dic["alias"]); + platform_options->_edit_set("keystore/release_password", dic["pass"]); + + error->set_text("Android keystore created at \n"+fullpath); + error->connect("popup_hide", this, "_keystore_created"); + error->popup_centered_minsize(); + } else { // fail + error->set_text("Fail to create android keystore at \n"+fullpath); + error->popup_centered_minsize(); + } + +} + +bool ProjectExportDialog::_check_android_setting(const Ref<EditorExportPlatform>& exporter) { + + bool is_debugging = exporter->get("debug/debugging_enabled"); + String release = exporter->get("keystore/release"); + String user = exporter->get("keystore/release_user"); + String password = exporter->get("keystore/release_password"); + + if (!is_debugging && (release=="" || user=="" || password=="")){ + if (release==""){ + confirm_keystore->set_text(TTR("Release keystore is not set.\nDo you want to create one?")); + confirm_keystore->popup_centered_minsize(); + } else { + error->set_text(TTR("Fill Keystore/Release User and Release Password")); + error->popup_centered_minsize(); + } + return false; + } + + return true; + +} void ProjectExportDialog::_group_selected() { @@ -683,8 +886,8 @@ void ProjectExportDialog::_update_group() { StringName name = _get_selected_group(); group_image_action->select(EditorImportExport::get_singleton()->image_export_group_get_image_action(name)); group_atlas->set_pressed(EditorImportExport::get_singleton()->image_export_group_get_make_atlas(name)); - group_shrink->set_val(EditorImportExport::get_singleton()->image_export_group_get_shrink(name)); - group_lossy_quality->set_val(EditorImportExport::get_singleton()->image_export_group_get_lossy_quality(name)); + group_shrink->set_value(EditorImportExport::get_singleton()->image_export_group_get_shrink(name)); + group_lossy_quality->set_value(EditorImportExport::get_singleton()->image_export_group_get_lossy_quality(name)); if (group_atlas->is_pressed()) atlas_preview->show(); else @@ -806,8 +1009,8 @@ void ProjectExportDialog::_group_changed(Variant v) { EditorNode::get_undo_redo()->create_action(TTR("Change Image Group")); EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_export_group_set_image_action",name,group_image_action->get_selected()); EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_export_group_set_make_atlas",name,group_atlas->is_pressed()); - EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_export_group_set_shrink",name,group_shrink->get_val()); - EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_export_group_set_lossy_quality",name,group_lossy_quality->get_val()); + EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_export_group_set_shrink",name,group_shrink->get_value()); + EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_export_group_set_lossy_quality",name,group_lossy_quality->get_value()); EditorNode::get_undo_redo()->add_undo_method(EditorImportExport::get_singleton(),"image_export_group_set_image_action",name,EditorImportExport::get_singleton()->image_export_group_get_image_action(name)); EditorNode::get_undo_redo()->add_undo_method(EditorImportExport::get_singleton(),"image_export_group_set_make_atlas",name,EditorImportExport::get_singleton()->image_export_group_get_make_atlas(name)); EditorNode::get_undo_redo()->add_undo_method(EditorImportExport::get_singleton(),"image_export_group_set_shrink",name,EditorImportExport::get_singleton()->image_export_group_get_shrink(name)); @@ -1040,11 +1243,11 @@ void ProjectExportDialog::_group_atlas_preview() { int flags=0; - if (Globals::get_singleton()->get("image_loader/filter")) + if (GlobalConfig::get_singleton()->get("image_loader/filter")) flags|=EditorTextureImportPlugin::IMAGE_FLAG_FILTER; - if (!Globals::get_singleton()->get("image_loader/gen_mipmaps")) + if (!GlobalConfig::get_singleton()->get("image_loader/gen_mipmaps")) flags|=EditorTextureImportPlugin::IMAGE_FLAG_NO_MIPMAPS; - if (!Globals::get_singleton()->get("image_loader/repeat")) + if (!GlobalConfig::get_singleton()->get("image_loader/repeat")) flags|=EditorTextureImportPlugin::IMAGE_FLAG_REPEAT; flags|=EditorTextureImportPlugin::IMAGE_FLAG_FIX_BORDER_ALPHA; @@ -1089,40 +1292,44 @@ void ProjectExportDialog::_image_filter_changed(String) { void ProjectExportDialog::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_rescan"),&ProjectExportDialog::_rescan); - ObjectTypeDB::bind_method(_MD("_tree_changed"),&ProjectExportDialog::_tree_changed); - ObjectTypeDB::bind_method(_MD("_scan_finished"),&ProjectExportDialog::_scan_finished); - ObjectTypeDB::bind_method(_MD("_platform_selected"),&ProjectExportDialog::_platform_selected); - ObjectTypeDB::bind_method(_MD("_prop_edited"),&ProjectExportDialog::_prop_edited); - ObjectTypeDB::bind_method(_MD("_export_mode_changed"),&ProjectExportDialog::_export_mode_changed); - ObjectTypeDB::bind_method(_MD("_filters_edited"),&ProjectExportDialog::_filters_edited); - ObjectTypeDB::bind_method(_MD("_filters_exclude_edited"),&ProjectExportDialog::_filters_exclude_edited); - ObjectTypeDB::bind_method(_MD("_export_action"),&ProjectExportDialog::_export_action); - ObjectTypeDB::bind_method(_MD("_export_action_pck"),&ProjectExportDialog::_export_action_pck); - ObjectTypeDB::bind_method(_MD("_quality_edited"),&ProjectExportDialog::_quality_edited); - ObjectTypeDB::bind_method(_MD("_shrink_edited"),&ProjectExportDialog::_shrink_edited); - ObjectTypeDB::bind_method(_MD("_image_export_edited"),&ProjectExportDialog::_image_export_edited); - ObjectTypeDB::bind_method(_MD("_format_toggled"),&ProjectExportDialog::_format_toggled); - ObjectTypeDB::bind_method(_MD("_group_changed"),&ProjectExportDialog::_group_changed); - ObjectTypeDB::bind_method(_MD("_group_add"),&ProjectExportDialog::_group_add); - ObjectTypeDB::bind_method(_MD("_group_del"),&ProjectExportDialog::_group_del); - ObjectTypeDB::bind_method(_MD("_group_selected"),&ProjectExportDialog::_group_selected); - ObjectTypeDB::bind_method(_MD("_update_group"),&ProjectExportDialog::_update_group); - ObjectTypeDB::bind_method(_MD("_update_group_list"),&ProjectExportDialog::_update_group_list); - ObjectTypeDB::bind_method(_MD("_select_group"),&ProjectExportDialog::_select_group); - ObjectTypeDB::bind_method(_MD("_update_group_tree"),&ProjectExportDialog::_update_group_tree); - ObjectTypeDB::bind_method(_MD("_group_item_edited"),&ProjectExportDialog::_group_item_edited); - ObjectTypeDB::bind_method(_MD("_save_export_cfg"),&ProjectExportDialog::_save_export_cfg); - ObjectTypeDB::bind_method(_MD("_image_filter_changed"),&ProjectExportDialog::_image_filter_changed); - ObjectTypeDB::bind_method(_MD("_group_atlas_preview"),&ProjectExportDialog::_group_atlas_preview); - ObjectTypeDB::bind_method(_MD("_group_select_all"),&ProjectExportDialog::_group_select_all); - ObjectTypeDB::bind_method(_MD("_group_select_none"),&ProjectExportDialog::_group_select_none); - ObjectTypeDB::bind_method(_MD("_script_edited"),&ProjectExportDialog::_script_edited); - ObjectTypeDB::bind_method(_MD("_update_script"),&ProjectExportDialog::_update_script); - ObjectTypeDB::bind_method(_MD("_sample_convert_edited"),&ProjectExportDialog::_sample_convert_edited); - - - ObjectTypeDB::bind_method(_MD("export_platform"),&ProjectExportDialog::export_platform); + ClassDB::bind_method(_MD("_rescan"),&ProjectExportDialog::_rescan); + ClassDB::bind_method(_MD("_tree_changed"),&ProjectExportDialog::_tree_changed); + ClassDB::bind_method(_MD("_scan_finished"),&ProjectExportDialog::_scan_finished); + ClassDB::bind_method(_MD("_platform_selected"),&ProjectExportDialog::_platform_selected); + ClassDB::bind_method(_MD("_prop_edited"),&ProjectExportDialog::_prop_edited); + ClassDB::bind_method(_MD("_export_mode_changed"),&ProjectExportDialog::_export_mode_changed); + ClassDB::bind_method(_MD("_filters_edited"),&ProjectExportDialog::_filters_edited); + ClassDB::bind_method(_MD("_filters_exclude_edited"),&ProjectExportDialog::_filters_exclude_edited); + ClassDB::bind_method(_MD("_export_action"),&ProjectExportDialog::_export_action); + ClassDB::bind_method(_MD("_export_action_pck"),&ProjectExportDialog::_export_action_pck); + ClassDB::bind_method(_MD("_quality_edited"),&ProjectExportDialog::_quality_edited); + ClassDB::bind_method(_MD("_shrink_edited"),&ProjectExportDialog::_shrink_edited); + ClassDB::bind_method(_MD("_image_export_edited"),&ProjectExportDialog::_image_export_edited); + ClassDB::bind_method(_MD("_format_toggled"),&ProjectExportDialog::_format_toggled); + ClassDB::bind_method(_MD("_group_changed"),&ProjectExportDialog::_group_changed); + ClassDB::bind_method(_MD("_group_add"),&ProjectExportDialog::_group_add); + ClassDB::bind_method(_MD("_group_del"),&ProjectExportDialog::_group_del); + ClassDB::bind_method(_MD("_group_selected"),&ProjectExportDialog::_group_selected); + ClassDB::bind_method(_MD("_update_group"),&ProjectExportDialog::_update_group); + ClassDB::bind_method(_MD("_update_group_list"),&ProjectExportDialog::_update_group_list); + ClassDB::bind_method(_MD("_select_group"),&ProjectExportDialog::_select_group); + ClassDB::bind_method(_MD("_update_group_tree"),&ProjectExportDialog::_update_group_tree); + ClassDB::bind_method(_MD("_group_item_edited"),&ProjectExportDialog::_group_item_edited); + ClassDB::bind_method(_MD("_save_export_cfg"),&ProjectExportDialog::_save_export_cfg); + ClassDB::bind_method(_MD("_image_filter_changed"),&ProjectExportDialog::_image_filter_changed); + ClassDB::bind_method(_MD("_group_atlas_preview"),&ProjectExportDialog::_group_atlas_preview); + ClassDB::bind_method(_MD("_group_select_all"),&ProjectExportDialog::_group_select_all); + ClassDB::bind_method(_MD("_group_select_none"),&ProjectExportDialog::_group_select_none); + ClassDB::bind_method(_MD("_script_edited"),&ProjectExportDialog::_script_edited); + ClassDB::bind_method(_MD("_update_script"),&ProjectExportDialog::_update_script); + ClassDB::bind_method(_MD("_sample_convert_edited"),&ProjectExportDialog::_sample_convert_edited); + + + ClassDB::bind_method(_MD("export_platform"),&ProjectExportDialog::export_platform); + ClassDB::bind_method(_MD("_create_android_keystore"),&ProjectExportDialog::_create_android_keystore); + ClassDB::bind_method(_MD("_check_keystore_path"),&ProjectExportDialog::_check_keystore_path); + ClassDB::bind_method(_MD("_keystore_dir_selected"),&ProjectExportDialog::_keystore_dir_selected); + ClassDB::bind_method(_MD("_keystore_created"),&ProjectExportDialog::_keystore_created); // ADD_SIGNAL(MethodInfo("instance")); @@ -1138,7 +1345,7 @@ ProjectExportDialog::ProjectExportDialog(EditorNode *p_editor) { sections = memnew( TabContainer ); add_child(sections); - set_child_rect(sections); + //set_child_rect(sections); VBoxContainer *pvbox = memnew( VBoxContainer ); sections->add_child(pvbox); @@ -1309,7 +1516,7 @@ ProjectExportDialog::ProjectExportDialog(EditorNode *p_editor) { group_lossy_quality->set_min(0.1); group_lossy_quality->set_max(1.0); group_lossy_quality->set_step(0.01); - group_lossy_quality->set_val(0.7); + group_lossy_quality->set_value(0.7); group_lossy_quality->connect("value_changed",this,"_quality_edited"); HBoxContainer *gqhb = memnew( HBoxContainer ); @@ -1328,7 +1535,7 @@ ProjectExportDialog::ProjectExportDialog(EditorNode *p_editor) { group_shrink = memnew(SpinBox); group_shrink->set_min(1); group_shrink->set_max(8); - group_shrink->set_val(1); + group_shrink->set_value(1); group_shrink->set_step(0.001); group_options->add_margin_child(TTR("Shrink By:"),group_shrink); group_shrink->connect("value_changed",this,"_group_changed"); @@ -1370,7 +1577,7 @@ ProjectExportDialog::ProjectExportDialog(EditorNode *p_editor) { atlas_preview_dialog = memnew( AcceptDialog ); ScrollContainer *scroll = memnew( ScrollContainer ); atlas_preview_dialog->add_child(scroll); - atlas_preview_dialog->set_child_rect(scroll); + //atlas_preview_dialog->set_child_rect(scroll); atlas_preview_frame = memnew( TextureFrame ); scroll->add_child(atlas_preview_frame); add_child(atlas_preview_dialog); @@ -1454,7 +1661,7 @@ ProjectExportDialog::ProjectExportDialog(EditorNode *p_editor) { file_export = memnew( EditorFileDialog ); add_child(file_export); file_export->set_access(EditorFileDialog::ACCESS_FILESYSTEM); - file_export->set_current_dir( EditorSettings::get_singleton()->get("global/default_project_export_path") ); + file_export->set_current_dir( EditorSettings::get_singleton()->get("filesystem/directories/default_project_export_path") ); file_export->set_title(TTR("Export Project")); file_export->connect("file_selected", this,"_export_action"); @@ -1466,7 +1673,7 @@ ProjectExportDialog::ProjectExportDialog(EditorNode *p_editor) { pck_export = memnew( EditorFileDialog ); pck_export->set_access(EditorFileDialog::ACCESS_FILESYSTEM); - pck_export->set_current_dir( EditorSettings::get_singleton()->get("global/default_project_export_path") ); + pck_export->set_current_dir( EditorSettings::get_singleton()->get("filesystem/directories/default_project_export_path") ); pck_export->set_title(TTR("Export Project PCK")); pck_export->connect("file_selected", this,"_export_action_pck"); pck_export->add_filter("*.pck ; Data Pack"); @@ -1479,6 +1686,8 @@ ProjectExportDialog::ProjectExportDialog(EditorNode *p_editor) { ei="EditorIcons"; ot="Object"; pending_update_tree=true; + + _create_android_keystore_window(); } @@ -1493,7 +1702,7 @@ void ProjectExport::popup_export() { presets.insert("default"); List<PropertyInfo> pi; - Globals::get_singleton()->get_property_list(&pi); + GlobalConfig::get_singleton()->get_property_list(&pi); export_preset->clear(); for (List<PropertyInfo>::Element *E=pi.front();E;E=E->next()) { @@ -1523,8 +1732,8 @@ Error ProjectExport::export_project(const String& p_preset) { String selected=p_preset; - DVector<String> preset_settings = Globals::get_singleton()->get("export_presets/"+selected); - String preset_path=Globals::get_singleton()->get("export_presets_path/"+selected); + PoolVector<String> preset_settings = GlobalConfig::get_singleton()->get("export_presets/"+selected); + String preset_path=GlobalConfig::get_singleton()->get("export_presets_path/"+selected); if (preset_path=="") { error->set_text("Export path empty, see export options"); @@ -1578,7 +1787,7 @@ Error ProjectExport::export_project(const String& p_preset) { } } - Vector<String> names = Globals::get_singleton()->get_optimizer_presets(); + Vector<String> names = GlobalConfig::get_singleton()->get_optimizer_presets(); //prepare base paths @@ -1688,7 +1897,7 @@ Error ProjectExport::export_project(const String& p_preset) { print_line("Exporting "+itos(idx)+"/"+itos(export_action.size())+": "+path); - String base_dir = Globals::get_singleton()->localize_path(path.get_base_dir()).replace("\\","/").replace("res://",""); + String base_dir = GlobalConfig::get_singleton()->localize_path(path.get_base_dir()).replace("\\","/").replace("res://",""); DirAccess *da=DirAccess::create(DirAccess::ACCESS_FILESYSTEM); String cwd = d->get_current_dir(); da->change_dir(cwd); @@ -1738,14 +1947,14 @@ Error ProjectExport::export_project(const String& p_preset) { delete_source=true; //create an optimized source file - if (!Globals::get_singleton()->has("optimizer_presets/"+preset)) { + if (!GlobalConfig::get_singleton()->has("optimizer_presets/"+preset)) { memdelete(d); ERR_EXPLAIN("Unknown optimizer preset: "+preset); ERR_FAIL_V(ERR_INVALID_DATA); } - Dictionary dc = Globals::get_singleton()->get("optimizer_presets/"+preset); + Dictionary dc = GlobalConfig::get_singleton()->get("optimizer_presets/"+preset); ERR_FAIL_COND_V(!dc.has("__type__"),ERR_INVALID_DATA); String type=dc["__type__"]; @@ -1875,7 +2084,7 @@ Error ProjectExport::export_project(const String& p_preset) { for (Map<String,Map<String,String> >::Element *E=remapped_paths.front();E;E=E->next()) { String platform=E->key(); - DVector<String> remaps; + PoolVector<String> remaps; for(Map<String,String>::Element *F=E->get().front();F;F=F->next() ) { remaps.push_back(F->key()); @@ -1890,7 +2099,7 @@ Error ProjectExport::export_project(const String& p_preset) { String engine_cfg_path=d->get_current_dir()+"/engine.cfg"; print_line("enginecfg: "+engine_cfg_path); - Globals::get_singleton()->save_custom(engine_cfg_path,added_settings); + GlobalConfig::get_singleton()->save_custom(engine_cfg_path,added_settings); memdelete(d); return OK; @@ -1902,7 +2111,7 @@ ProjectExport::ProjectExport(EditorData* p_data) { editor_data=p_data; VBoxContainer *vbc = memnew( VBoxContainer ); add_child(vbc); - set_child_rect(vbc); + //set_child_rect(vbc); set_title(TTR("Project Export")); label = memnew( Label ); label->set_text(TTR("Export Preset:")); diff --git a/tools/editor/project_export.h b/tools/editor/project_export.h index 8cf2bf3afc..2110c54b9d 100644 --- a/tools/editor/project_export.h +++ b/tools/editor/project_export.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -49,7 +49,7 @@ class EditorNode; class ProjectExportDialog : public ConfirmationDialog { - OBJ_TYPE( ProjectExportDialog, ConfirmationDialog ); + GDCLASS( ProjectExportDialog, ConfirmationDialog ); public: enum ExportAction { @@ -73,6 +73,7 @@ private: bool pending_update_tree; AcceptDialog *error; ConfirmationDialog *confirm; + ConfirmationDialog *confirm_keystore; Button *button_reload; LineEdit *filters, *filters_exclude; @@ -145,6 +146,9 @@ private: SpinBox *sample_max_hz; CheckButton *sample_trim; + ConfirmationDialog* keystore_create_dialog; + EditorFileDialog* keystore_file_dialog; + void _export_mode_changed(int p_idx); void _prop_edited(String what); @@ -190,6 +194,13 @@ private: void _export_action_pck(const String& p_file); void ok_pressed(); void custom_action(const String&); + LineEdit* _create_keystore_input(Control* container, const String& p_label, const String& name); + void _create_android_keystore_window(); + void _create_android_keystore(); + bool _check_android_setting(const Ref<EditorExportPlatform>& exporter); + void _check_keystore_path(const String& path); + void _keystore_dir_selected(const String& path); + void _keystore_created(); void _save_export_cfg(); void _format_toggled(); @@ -212,7 +223,7 @@ public: class EditorData; class ProjectExport : public ConfirmationDialog { - OBJ_TYPE( ProjectExport, ConfirmationDialog ); + GDCLASS( ProjectExport, ConfirmationDialog ); EditorData *editor_data; diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp index 069d7cef81..fa41090624 100644 --- a/tools/editor/project_manager.cpp +++ b/tools/editor/project_manager.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -54,7 +54,7 @@ class NewProjectDialog : public ConfirmationDialog { - OBJ_TYPE(NewProjectDialog,ConfirmationDialog); + GDCLASS(NewProjectDialog,ConfirmationDialog); public: @@ -75,15 +75,22 @@ private: String zip_title; AcceptDialog *dialog_error; - bool _test_path() { + String _test_path() { error->set_text(""); get_ok()->set_disabled(true); DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); - if (project_path->get_text() != "" && d->change_dir(project_path->get_text())!=OK) { + String valid_path; + if (d->change_dir(project_path->get_text())==OK){ + valid_path=project_path->get_text(); + } else if (d->change_dir(project_path->get_text().strip_edges())==OK) { + valid_path=project_path->get_text().strip_edges(); + } + + if (valid_path == "") { error->set_text(TTR("Invalid project path, the path must exist!")); memdelete(d); - return false; + return ""; } if (mode!=MODE_IMPORT) { @@ -92,30 +99,29 @@ private: error->set_text(TTR("Invalid project path, engine.cfg must not exist.")); memdelete(d); - return false; + return ""; } } else { - if (project_path->get_text() != "" && !d->file_exists("engine.cfg")) { + if (valid_path != "" && !d->file_exists("engine.cfg")) { error->set_text(TTR("Invalid project path, engine.cfg must exist.")); memdelete(d); - return false; + return ""; } } memdelete(d); get_ok()->set_disabled(false); - return true; + return valid_path; } void _path_text_changed(const String& p_path) { - if ( _test_path() ) { - - String sp=p_path; + String sp=_test_path(); + if ( sp!="" ) { sp=sp.replace("\\","/"); int lidx=sp.find_last("/"); @@ -173,27 +179,15 @@ private: void ok_pressed() { - if (!_test_path()) + String dir=_test_path(); + if (dir=="") { + error->set_text(TTR("Invalid project path (changed anything?).")); return; - - String dir; + } if (mode==MODE_IMPORT) { - dir=project_path->get_text(); - - + // nothing to do } else { - DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); - - if (d->change_dir(project_path->get_text())!=OK) { - error->set_text(TTR("Invalid project path (changed anything?).")); - memdelete(d); - return; - } - - dir=d->get_current_dir(); - memdelete(d); - if (mode==MODE_NEW) { @@ -321,8 +315,6 @@ private: } - - } dir=dir.replace("\\","/"); @@ -343,11 +335,11 @@ protected: static void _bind_methods() { - ObjectTypeDB::bind_method("_browse_path",&NewProjectDialog::_browse_path); - ObjectTypeDB::bind_method("_text_changed",&NewProjectDialog::_text_changed); - ObjectTypeDB::bind_method("_path_text_changed",&NewProjectDialog::_path_text_changed); - ObjectTypeDB::bind_method("_path_selected",&NewProjectDialog::_path_selected); - ObjectTypeDB::bind_method("_file_selected",&NewProjectDialog::_file_selected); + ClassDB::bind_method("_browse_path",&NewProjectDialog::_browse_path); + ClassDB::bind_method("_text_changed",&NewProjectDialog::_text_changed); + ClassDB::bind_method("_path_text_changed",&NewProjectDialog::_path_text_changed); + ClassDB::bind_method("_path_selected",&NewProjectDialog::_path_selected); + ClassDB::bind_method("_file_selected",&NewProjectDialog::_file_selected); ADD_SIGNAL( MethodInfo("project_created") ); } @@ -402,7 +394,7 @@ public: popup_centered(Size2(500,125)*EDSCALE); } - + project_path->grab_focus(); _test_path(); } @@ -412,7 +404,7 @@ public: VBoxContainer *vb = memnew( VBoxContainer ); add_child(vb); - set_child_rect(vb); + // set_child_rect(vb); Label* l = memnew(Label); l->set_text(TTR("Project Path:")); @@ -459,7 +451,7 @@ public: fdialog = memnew( FileDialog ); add_child(fdialog); fdialog->set_access(FileDialog::ACCESS_FILESYSTEM); - fdialog->set_current_dir( EditorSettings::get_singleton()->get("global/default_project_path") ); + fdialog->set_current_dir( EditorSettings::get_singleton()->get("filesystem/directories/default_project_path") ); project_name->connect("text_changed", this,"_text_changed"); project_path->connect("text_changed", this,"_path_text_changed"); fdialog->connect("dir_selected", this,"_path_selected"); @@ -864,14 +856,14 @@ void ProjectManager::_load_recent_projects() { hb->set_meta("main_scene",main_scene); hb->set_meta("favorite",is_favorite); hb->connect("draw",this,"_panel_draw",varray(hb)); - hb->connect("input_event",this,"_panel_input",varray(hb)); + hb->connect("gui_input",this,"_panel_input",varray(hb)); hb->add_constant_override("separation",10*EDSCALE); VBoxContainer *favorite_box = memnew( VBoxContainer ); TextureButton *favorite = memnew( TextureButton ); favorite->set_normal_texture(favorite_icon); if (!is_favorite) - favorite->set_opacity(0.2); + favorite->set_modulate(Color(1,1,1,0.2)); favorite->set_v_size_flags(SIZE_EXPAND); favorite->connect("pressed",this,"_favorite_pressed",varray(hb)); favorite_box->add_child(favorite); @@ -894,7 +886,7 @@ void ProjectManager::_load_recent_projects() { Label *fpath = memnew( Label(path) ); fpath->set_name("path"); vb->add_child(fpath); - fpath->set_opacity(0.5); + fpath->set_modulate(Color(1,1,1,0.5)); fpath->add_color_override("font_color",font_color); scroll_childs->add_child(hb); @@ -1141,7 +1133,7 @@ void ProjectManager::_install_project(const String& p_zip_path,const String& p_t npdialog->show_dialog(); } -void ProjectManager::_files_dropped(StringArray p_files, int p_screen) { +void ProjectManager::_files_dropped(PoolStringArray p_files, int p_screen) { Set<String> folders_set; DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); for (int i = 0; i < p_files.size(); i++) { @@ -1150,7 +1142,7 @@ void ProjectManager::_files_dropped(StringArray p_files, int p_screen) { } memdelete(da); if (folders_set.size()>0) { - StringArray folders; + PoolStringArray folders; for (Set<String>::Element *E=folders_set.front();E;E=E->next()) { folders.append(E->get()); } @@ -1162,7 +1154,7 @@ void ProjectManager::_files_dropped(StringArray p_files, int p_screen) { dir->list_dir_begin(); String file = dir->get_next(); while(confirm && file!=String()) { - if (!da->current_is_dir() && file.ends_with("engine.cfg")) { + if (!dir->current_is_dir() && file.ends_with("engine.cfg")) { confirm = false; } file = dir->get_next(); @@ -1182,7 +1174,7 @@ void ProjectManager::_files_dropped(StringArray p_files, int p_screen) { } } -void ProjectManager::_scan_multiple_folders(StringArray p_files) +void ProjectManager::_scan_multiple_folders(PoolStringArray p_files) { for (int i = 0; i < p_files.size(); i++) { _scan_begin(p_files.get(i)); @@ -1191,27 +1183,27 @@ void ProjectManager::_scan_multiple_folders(StringArray p_files) void ProjectManager::_bind_methods() { - ObjectTypeDB::bind_method("_open_project",&ProjectManager::_open_project); - ObjectTypeDB::bind_method("_open_project_confirm",&ProjectManager::_open_project_confirm); - ObjectTypeDB::bind_method("_run_project",&ProjectManager::_run_project); - ObjectTypeDB::bind_method("_run_project_confirm",&ProjectManager::_run_project_confirm); - ObjectTypeDB::bind_method("_scan_projects",&ProjectManager::_scan_projects); - ObjectTypeDB::bind_method("_scan_begin",&ProjectManager::_scan_begin); - ObjectTypeDB::bind_method("_import_project",&ProjectManager::_import_project); - ObjectTypeDB::bind_method("_new_project",&ProjectManager::_new_project); - ObjectTypeDB::bind_method("_erase_project",&ProjectManager::_erase_project); - ObjectTypeDB::bind_method("_erase_project_confirm",&ProjectManager::_erase_project_confirm); - ObjectTypeDB::bind_method("_exit_dialog",&ProjectManager::_exit_dialog); - ObjectTypeDB::bind_method("_load_recent_projects",&ProjectManager::_load_recent_projects); - ObjectTypeDB::bind_method("_on_project_created",&ProjectManager::_on_project_created); - ObjectTypeDB::bind_method("_update_scroll_pos",&ProjectManager::_update_scroll_pos); - ObjectTypeDB::bind_method("_panel_draw",&ProjectManager::_panel_draw); - ObjectTypeDB::bind_method("_panel_input",&ProjectManager::_panel_input); - ObjectTypeDB::bind_method("_unhandled_input",&ProjectManager::_unhandled_input); - ObjectTypeDB::bind_method("_favorite_pressed",&ProjectManager::_favorite_pressed); - ObjectTypeDB::bind_method("_install_project",&ProjectManager::_install_project); - ObjectTypeDB::bind_method("_files_dropped",&ProjectManager::_files_dropped); - ObjectTypeDB::bind_method(_MD("_scan_multiple_folders", "files"),&ProjectManager::_scan_multiple_folders); + ClassDB::bind_method("_open_project",&ProjectManager::_open_project); + ClassDB::bind_method("_open_project_confirm",&ProjectManager::_open_project_confirm); + ClassDB::bind_method("_run_project",&ProjectManager::_run_project); + ClassDB::bind_method("_run_project_confirm",&ProjectManager::_run_project_confirm); + ClassDB::bind_method("_scan_projects",&ProjectManager::_scan_projects); + ClassDB::bind_method("_scan_begin",&ProjectManager::_scan_begin); + ClassDB::bind_method("_import_project",&ProjectManager::_import_project); + ClassDB::bind_method("_new_project",&ProjectManager::_new_project); + ClassDB::bind_method("_erase_project",&ProjectManager::_erase_project); + ClassDB::bind_method("_erase_project_confirm",&ProjectManager::_erase_project_confirm); + ClassDB::bind_method("_exit_dialog",&ProjectManager::_exit_dialog); + ClassDB::bind_method("_load_recent_projects",&ProjectManager::_load_recent_projects); + ClassDB::bind_method("_on_project_created",&ProjectManager::_on_project_created); + ClassDB::bind_method("_update_scroll_pos",&ProjectManager::_update_scroll_pos); + ClassDB::bind_method("_panel_draw",&ProjectManager::_panel_draw); + ClassDB::bind_method("_panel_input",&ProjectManager::_panel_input); + ClassDB::bind_method("_unhandled_input",&ProjectManager::_unhandled_input); + ClassDB::bind_method("_favorite_pressed",&ProjectManager::_favorite_pressed); + ClassDB::bind_method("_install_project",&ProjectManager::_install_project); + ClassDB::bind_method("_files_dropped",&ProjectManager::_files_dropped); + ClassDB::bind_method(_MD("_scan_multiple_folders", "files"),&ProjectManager::_scan_multiple_folders); } @@ -1226,7 +1218,7 @@ ProjectManager::ProjectManager() { EditorSettings::get_singleton()->set_optimize_save(false); //just write settings as they came { - int dpi_mode = EditorSettings::get_singleton()->get("global/hidpi_mode"); + int dpi_mode = EditorSettings::get_singleton()->get("interface/hidpi_mode"); if (dpi_mode==0) { editor_set_scale( OS::get_singleton()->get_screen_dpi(0) > 150 && OS::get_singleton()->get_screen_size(OS::get_singleton()->get_current_screen()).x>2000 ? 2.0 : 1.0 ); } else if (dpi_mode==1) { @@ -1240,7 +1232,7 @@ ProjectManager::ProjectManager() { } } - FileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("file_dialog/show_hidden_files")); + FileDialog::set_default_show_hidden_files(EditorSettings::get_singleton()->get("filesytem/file_dialog/show_hidden_files")); set_area_as_parent_rect(); set_theme(create_editor_theme()); @@ -1264,7 +1256,7 @@ ProjectManager::ProjectManager() { String cp; cp.push_back(0xA9); cp.push_back(0); - OS::get_singleton()->set_window_title(_MKSTR(VERSION_NAME)+String(" - ")+TTR("Project Manager")+" - "+cp+" 2008-2016 Juan Linietsky, Ariel Manzur."); + OS::get_singleton()->set_window_title(_MKSTR(VERSION_NAME)+String(" - ")+TTR("Project Manager")+" - "+cp+" 2008-2017 Juan Linietsky, Ariel Manzur."); HBoxContainer *top_hb = memnew( HBoxContainer); vb->add_child(top_hb); @@ -1349,7 +1341,7 @@ ProjectManager::ProjectManager() { scan_dir->set_access(FileDialog::ACCESS_FILESYSTEM); scan_dir->set_mode(FileDialog::MODE_OPEN_DIR); scan_dir->set_title(TTR("Select a Folder to Scan")); // must be after mode or it's overridden - scan_dir->set_current_dir( EditorSettings::get_singleton()->get("global/default_project_path") ); + scan_dir->set_current_dir( EditorSettings::get_singleton()->get("filesystem/directories/default_project_path") ); gui_base->add_child(scan_dir); scan_dir->connect("dir_selected",this,"_scan_begin"); @@ -1426,8 +1418,8 @@ ProjectManager::ProjectManager() { npdialog->connect("project_created", this,"_on_project_created"); _load_recent_projects(); - if ( EditorSettings::get_singleton()->get("global/autoscan_project_path") ) { - _scan_begin( EditorSettings::get_singleton()->get("global/autoscan_project_path") ); + if ( EditorSettings::get_singleton()->get("filesystem/directories/autoscan_project_path") ) { + _scan_begin( EditorSettings::get_singleton()->get("filesystem/directories/autoscan_project_path") ); } //get_ok()->set_text("Open"); @@ -1494,9 +1486,9 @@ void ProjectListFilter::_notification(int p_what) { void ProjectListFilter::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_command"),&ProjectListFilter::_command); - ObjectTypeDB::bind_method(_MD("_search_text_changed"), &ProjectListFilter::_search_text_changed); - ObjectTypeDB::bind_method(_MD("_filter_option_selected"), &ProjectListFilter::_filter_option_selected); + ClassDB::bind_method(_MD("_command"),&ProjectListFilter::_command); + ClassDB::bind_method(_MD("_search_text_changed"), &ProjectListFilter::_search_text_changed); + ClassDB::bind_method(_MD("_filter_option_selected"), &ProjectListFilter::_filter_option_selected); ADD_SIGNAL( MethodInfo("filter_changed") ); } diff --git a/tools/editor/project_manager.h b/tools/editor/project_manager.h index af2d47aeb3..1fd8a301ea 100644 --- a/tools/editor/project_manager.h +++ b/tools/editor/project_manager.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -40,7 +40,7 @@ class NewProjectDialog; class ProjectListFilter; class ProjectManager : public Control { - OBJ_TYPE( ProjectManager, Control ); + GDCLASS( ProjectManager, Control ); Button *erase_btn; Button *open_btn; @@ -95,8 +95,8 @@ class ProjectManager : public Control { void _panel_input(const InputEvent& p_ev,Node *p_hb); void _unhandled_input(const InputEvent& p_ev); void _favorite_pressed(Node *p_hb); - void _files_dropped(StringArray p_files, int p_screen); - void _scan_multiple_folders(StringArray p_files); + void _files_dropped(PoolStringArray p_files, int p_screen); + void _scan_multiple_folders(PoolStringArray p_files); protected: @@ -109,7 +109,7 @@ public: class ProjectListFilter : public HBoxContainer { - OBJ_TYPE( ProjectListFilter, HBoxContainer ); + GDCLASS( ProjectListFilter, HBoxContainer ); private: diff --git a/tools/editor/project_settings.cpp b/tools/editor/project_settings.cpp index 02d95abfa2..968333d466 100644 --- a/tools/editor/project_settings.cpp +++ b/tools/editor/project_settings.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -74,7 +74,7 @@ void ProjectSettings::_notification(int p_what) { if (p_what==NOTIFICATION_ENTER_TREE) { - globals_editor->edit(Globals::get_singleton()); + globals_editor->edit(GlobalConfig::get_singleton()); search_button->set_icon(get_icon("Zoom","EditorIcons")); clear_button->set_icon(get_icon("Close","EditorIcons")); @@ -82,8 +82,8 @@ void ProjectSettings::_notification(int p_what) { translation_list->connect("button_pressed",this,"_translation_delete"); _update_actions(); popup_add->add_icon_item(get_icon("Keyboard","EditorIcons"),TTR("Key "),InputEvent::KEY);//"Key " - because the word 'key' has already been used as a key animation - popup_add->add_icon_item(get_icon("JoyButton","EditorIcons"),TTR("Joy Button"),InputEvent::JOYSTICK_BUTTON); - popup_add->add_icon_item(get_icon("JoyAxis","EditorIcons"),TTR("Joy Axis"),InputEvent::JOYSTICK_MOTION); + popup_add->add_icon_item(get_icon("JoyButton","EditorIcons"),TTR("Joy Button"),InputEvent::JOYPAD_BUTTON); + popup_add->add_icon_item(get_icon("JoyAxis","EditorIcons"),TTR("Joy Axis"),InputEvent::JOYPAD_MOTION); popup_add->add_icon_item(get_icon("Mouse","EditorIcons"),TTR("Mouse Button"),InputEvent::MOUSE_BUTTON); List<String> tfn; @@ -136,7 +136,7 @@ void ProjectSettings::_action_edited() { String action_prop="input/"+new_name; - if (Globals::get_singleton()->has(action_prop)) { + if (GlobalConfig::get_singleton()->has(action_prop)) { ti->set_text(0,old_name); add_at="input/"+old_name; @@ -146,20 +146,17 @@ void ProjectSettings::_action_edited() { return; } - int order = Globals::get_singleton()->get_order(add_at); - Array va = Globals::get_singleton()->get(add_at); - bool persisting = Globals::get_singleton()->is_persisting(add_at); + int order = GlobalConfig::get_singleton()->get_order(add_at); + Array va = GlobalConfig::get_singleton()->get(add_at); setting=true; undo_redo->create_action(TTR("Rename Input Action Event")); - undo_redo->add_do_method(Globals::get_singleton(),"clear",add_at); - undo_redo->add_do_method(Globals::get_singleton(),"set",action_prop,va); - undo_redo->add_do_method(Globals::get_singleton(),"set_persisting",action_prop,persisting); - undo_redo->add_do_method(Globals::get_singleton(),"set_order",action_prop,order); - undo_redo->add_undo_method(Globals::get_singleton(),"clear",action_prop); - undo_redo->add_undo_method(Globals::get_singleton(),"set",add_at,va); - undo_redo->add_undo_method(Globals::get_singleton(),"set_persisting",add_at,persisting); - undo_redo->add_undo_method(Globals::get_singleton(),"set_order",add_at,order); + undo_redo->add_do_method(GlobalConfig::get_singleton(),"clear",add_at); + undo_redo->add_do_method(GlobalConfig::get_singleton(),"set",action_prop,va); + undo_redo->add_do_method(GlobalConfig::get_singleton(),"set_order",action_prop,order); + undo_redo->add_undo_method(GlobalConfig::get_singleton(),"clear",action_prop); + undo_redo->add_undo_method(GlobalConfig::get_singleton(),"set",add_at,va); + undo_redo->add_undo_method(GlobalConfig::get_singleton(),"set_order",add_at,order); undo_redo->add_do_method(this,"_update_actions"); undo_redo->add_undo_method(this,"_update_actions"); undo_redo->add_do_method(this,"_settings_changed"); @@ -179,9 +176,9 @@ void ProjectSettings::_device_input_add() { InputEvent ie; String name=add_at; - Variant old_val = Globals::get_singleton()->get(name); + Variant old_val = GlobalConfig::get_singleton()->get(name); Array arr=old_val; - ie.device=device_id->get_val(); + ie.device=device_id->get_value(); ie.type=add_type; @@ -201,7 +198,7 @@ void ProjectSettings::_device_input_add() { } } break; - case InputEvent::JOYSTICK_MOTION: { + case InputEvent::JOYPAD_MOTION: { ie.joy_motion.axis = device_index->get_selected()>>1; ie.joy_motion.axis_value = device_index->get_selected()&1?1:-1; @@ -210,20 +207,20 @@ void ProjectSettings::_device_input_add() { for(int i=0;i<arr.size();i++) { InputEvent aie=arr[i]; - if (aie.device == ie.device && aie.type==InputEvent::JOYSTICK_MOTION && aie.joy_motion.axis==ie.joy_motion.axis && aie.joy_motion.axis_value==ie.joy_motion.axis_value) { + if (aie.device == ie.device && aie.type==InputEvent::JOYPAD_MOTION && aie.joy_motion.axis==ie.joy_motion.axis && aie.joy_motion.axis_value==ie.joy_motion.axis_value) { return; } } } break; - case InputEvent::JOYSTICK_BUTTON: { + case InputEvent::JOYPAD_BUTTON: { ie.joy_button.button_index=device_index->get_selected(); for(int i=0;i<arr.size();i++) { InputEvent aie=arr[i]; - if (aie.device == ie.device && aie.type==InputEvent::JOYSTICK_BUTTON && aie.joy_button.button_index==ie.joy_button.button_index) { + if (aie.device == ie.device && aie.type==InputEvent::JOYPAD_BUTTON && aie.joy_button.button_index==ie.joy_button.button_index) { return; } } @@ -236,9 +233,8 @@ void ProjectSettings::_device_input_add() { arr.push_back(ie); undo_redo->create_action(TTR("Add Input Action Event")); - undo_redo->add_do_method(Globals::get_singleton(),"set",name,arr); - undo_redo->add_do_method(Globals::get_singleton(),"set_persisting",name,true); - undo_redo->add_undo_method(Globals::get_singleton(),"set",name,old_val); + undo_redo->add_do_method(GlobalConfig::get_singleton(),"set",name,arr); + undo_redo->add_undo_method(GlobalConfig::get_singleton(),"set",name,old_val); undo_redo->add_do_method(this,"_update_actions"); undo_redo->add_undo_method(this,"_update_actions"); undo_redo->add_do_method(this,"_settings_changed"); @@ -260,7 +256,7 @@ void ProjectSettings::_press_a_key_confirm() { ie.key.mod=last_wait_for_key.key.mod; String name=add_at; - Variant old_val = Globals::get_singleton()->get(name); + Variant old_val = GlobalConfig::get_singleton()->get(name); Array arr=old_val; for(int i=0;i<arr.size();i++) { @@ -274,9 +270,8 @@ void ProjectSettings::_press_a_key_confirm() { arr.push_back(ie); undo_redo->create_action(TTR("Add Input Action Event")); - undo_redo->add_do_method(Globals::get_singleton(),"set",name,arr); - undo_redo->add_do_method(Globals::get_singleton(),"set_persisting",name,true); - undo_redo->add_undo_method(Globals::get_singleton(),"set",name,old_val); + undo_redo->add_do_method(GlobalConfig::get_singleton(),"set",name,arr); + undo_redo->add_undo_method(GlobalConfig::get_singleton(),"set",name,old_val); undo_redo->add_do_method(this,"_update_actions"); undo_redo->add_undo_method(this,"_update_actions"); undo_redo->add_do_method(this,"_settings_changed"); @@ -352,7 +347,7 @@ void ProjectSettings::_add_item(int p_item){ } break; case InputEvent::MOUSE_BUTTON: { - device_id->set_val(0); + device_id->set_value(0); device_index_label->set_text(TTR("Mouse Button Index:")); device_index->clear(); device_index->add_item(TTR("Left Button")); @@ -366,10 +361,10 @@ void ProjectSettings::_add_item(int p_item){ device_index->add_item(TTR("Button 9")); device_input->popup_centered_minsize(Size2(350,95)); } break; - case InputEvent::JOYSTICK_MOTION: { + case InputEvent::JOYPAD_MOTION: { - device_id->set_val(0); - device_index_label->set_text(TTR("Joystick Axis Index:")); + device_id->set_value(0); + device_index_label->set_text(TTR("Joypad Axis Index:")); device_index->clear(); for(int i=0;i<JOY_AXIS_MAX*2;i++) { @@ -379,10 +374,10 @@ void ProjectSettings::_add_item(int p_item){ device_input->popup_centered_minsize(Size2(350,95)); } break; - case InputEvent::JOYSTICK_BUTTON: { + case InputEvent::JOYPAD_BUTTON: { - device_id->set_val(3); - device_index_label->set_text(TTR("Joystick Button Index:")); + device_id->set_value(3); + device_index_label->set_text(TTR("Joypad Button Index:")); device_index->clear(); for(int i=0;i<JOY_BUTTON_MAX;i++) { @@ -423,14 +418,13 @@ void ProjectSettings::_action_button_pressed(Object* p_obj, int p_column,int p_i //remove main thing String name="input/"+ti->get_text(0); - Variant old_val = Globals::get_singleton()->get(name); - int order=Globals::get_singleton()->get_order(name); + Variant old_val = GlobalConfig::get_singleton()->get(name); + int order=GlobalConfig::get_singleton()->get_order(name); undo_redo->create_action(TTR("Add Input Action")); - undo_redo->add_do_method(Globals::get_singleton(),"clear",name); - undo_redo->add_undo_method(Globals::get_singleton(),"set",name,old_val); - undo_redo->add_undo_method(Globals::get_singleton(),"set_order",name,order); - undo_redo->add_undo_method(Globals::get_singleton(),"set_persisting",name,Globals::get_singleton()->is_persisting(name)); + undo_redo->add_do_method(GlobalConfig::get_singleton(),"clear",name); + undo_redo->add_undo_method(GlobalConfig::get_singleton(),"set",name,old_val); + undo_redo->add_undo_method(GlobalConfig::get_singleton(),"set_order",name,order); undo_redo->add_do_method(this,"_update_actions"); undo_redo->add_undo_method(this,"_update_actions"); undo_redo->add_do_method(this,"_settings_changed"); @@ -440,7 +434,7 @@ void ProjectSettings::_action_button_pressed(Object* p_obj, int p_column,int p_i } else { //remove action String name="input/"+ti->get_parent()->get_text(0); - Variant old_val = Globals::get_singleton()->get(name); + Variant old_val = GlobalConfig::get_singleton()->get(name); int idx = ti->get_metadata(0); Array va = old_val; @@ -456,8 +450,8 @@ void ProjectSettings::_action_button_pressed(Object* p_obj, int p_column,int p_i undo_redo->create_action(TTR("Erase Input Action Event")); - undo_redo->add_do_method(Globals::get_singleton(),"set",name,va); - undo_redo->add_undo_method(Globals::get_singleton(),"set",name,old_val); + undo_redo->add_do_method(GlobalConfig::get_singleton(),"set",name,va); + undo_redo->add_undo_method(GlobalConfig::get_singleton(),"set",name,old_val); undo_redo->add_do_method(this,"_update_actions"); undo_redo->add_undo_method(this,"_update_actions"); undo_redo->add_do_method(this,"_settings_changed"); @@ -480,7 +474,7 @@ void ProjectSettings::_update_actions() { input_editor->set_hide_root(true); List<PropertyInfo> props; - Globals::get_singleton()->get_property_list(&props); + GlobalConfig::get_singleton()->get_property_list(&props); for(List<PropertyInfo>::Element *E=props.front();E;E=E->next()) { @@ -496,7 +490,7 @@ void ProjectSettings::_update_actions() { //item->set_cell_mode(0,TreeItem::CELL_MODE_CHECK); item->set_text(0,name); item->add_button(0,get_icon("Add","EditorIcons"),1); - if (!Globals::get_singleton()->get_input_presets().find(pi.name)) { + if (!GlobalConfig::get_singleton()->get_input_presets().find(pi.name)) { item->add_button(0,get_icon("Remove","EditorIcons"),2); item->set_editable(0,true); } @@ -504,7 +498,7 @@ void ProjectSettings::_update_actions() { //item->set_checked(0,pi.usage&PROPERTY_USAGE_CHECKED); - Array actions=Globals::get_singleton()->get(pi.name); + Array actions=GlobalConfig::get_singleton()->get(pi.name); for(int i=0;i<actions.size();i++) { @@ -532,7 +526,7 @@ void ProjectSettings::_update_actions() { action->set_icon(0,get_icon("Keyboard","EditorIcons")); } break; - case InputEvent::JOYSTICK_BUTTON: { + case InputEvent::JOYPAD_BUTTON: { String str = TTR("Device")+" "+itos(ie.device)+", "+TTR("Button")+" "+itos(ie.joy_button.button_index); if (ie.joy_button.button_index>=0 && ie.joy_button.button_index<JOY_BUTTON_MAX) @@ -558,7 +552,7 @@ void ProjectSettings::_update_actions() { action->set_text(0,str); action->set_icon(0,get_icon("Mouse","EditorIcons")); } break; - case InputEvent::JOYSTICK_MOTION: { + case InputEvent::JOYPAD_MOTION: { int ax = ie.joy_motion.axis; int n = 2*ax + (ie.joy_motion.axis_value<0 ? 0:1); @@ -636,13 +630,12 @@ void ProjectSettings::_item_add() { undo_redo->create_action("Add Global Property"); - undo_redo->add_do_property(Globals::get_singleton(), name, value); - undo_redo->add_do_method(Globals::get_singleton(), "set_persisting", name, true); + undo_redo->add_do_property(GlobalConfig::get_singleton(), name, value); - if (Globals::get_singleton()->has(name)) { - undo_redo->add_undo_property(Globals::get_singleton(), name, Globals::get_singleton()->get(name)); + if (GlobalConfig::get_singleton()->has(name)) { + undo_redo->add_undo_property(GlobalConfig::get_singleton(), name, GlobalConfig::get_singleton()->get(name)); } else { - undo_redo->add_undo_property(Globals::get_singleton(), name, Variant()); + undo_redo->add_undo_property(GlobalConfig::get_singleton(), name, Variant()); } undo_redo->add_do_method(globals_editor, "update_category_list"); @@ -669,10 +662,9 @@ void ProjectSettings::_item_del() { undo_redo->create_action("Delete Global Property"); - undo_redo->add_do_property(Globals::get_singleton(), name, Variant()); + undo_redo->add_do_property(GlobalConfig::get_singleton(), name, Variant()); - undo_redo->add_undo_property(Globals::get_singleton(), name, Globals::get_singleton()->get(name)); - undo_redo->add_undo_method(Globals::get_singleton(), "set_persisting", name, Globals::get_singleton()->is_persisting(name)); + undo_redo->add_undo_property(GlobalConfig::get_singleton(), name, GlobalConfig::get_singleton()->get(name)); undo_redo->add_do_method(globals_editor, "update_category_list"); undo_redo->add_undo_method(globals_editor, "update_category_list"); @@ -699,7 +691,7 @@ void ProjectSettings::_action_add() { return; } - if (Globals::get_singleton()->has("input/"+action)) { + if (GlobalConfig::get_singleton()->has("input/"+action)) { message->set_text(vformat(TTR("Action '%s' already exists!"),action)); message->popup_centered(Size2(300,100)); return; @@ -708,9 +700,8 @@ void ProjectSettings::_action_add() { Array va; String name = "input/"+action; undo_redo->create_action(TTR("Add Input Action Event")); - undo_redo->add_do_method(Globals::get_singleton(),"set",name,va); - undo_redo->add_do_method(Globals::get_singleton(),"set_persisting",name,true); - undo_redo->add_undo_method(Globals::get_singleton(),"clear",name); + undo_redo->add_do_method(GlobalConfig::get_singleton(),"set",name,va); + undo_redo->add_undo_method(GlobalConfig::get_singleton(),"clear",name); undo_redo->add_do_method(this,"_update_actions"); undo_redo->add_undo_method(this,"_update_actions"); undo_redo->add_do_method(this,"_settings_changed"); @@ -737,23 +728,14 @@ void ProjectSettings::_action_add() { void ProjectSettings::_item_checked(const String& p_item, bool p_check) { - undo_redo->create_action(TTR("Toggle Persisting")); - String full_item = globals_editor->get_full_item_path(p_item); - undo_redo->add_do_method(Globals::get_singleton(),"set_persisting",full_item,p_check); - undo_redo->add_undo_method(Globals::get_singleton(),"set_persisting",full_item,!p_check); - undo_redo->add_do_method(this,"_settings_changed"); - undo_redo->add_undo_method(this,"_settings_changed"); - undo_redo->add_do_method(globals_editor->get_property_editor(),"update_tree"); - undo_redo->add_undo_method(globals_editor->get_property_editor(),"update_tree"); - undo_redo->commit_action(); } void ProjectSettings::_save() { - Error err = Globals::get_singleton()->save(); + Error err = GlobalConfig::get_singleton()->save(); message->set_text(err!=OK?TTR("Error saving settings."):TTR("Settings saved OK.")); message->popup_centered(Size2(300,100)); } @@ -764,21 +746,6 @@ void ProjectSettings::_settings_prop_edited(const String& p_name) { String full_item = globals_editor->get_full_item_path(p_name); - if (!Globals::get_singleton()->is_persisting(full_item)) { - Globals::get_singleton()->set_persisting(full_item,true); - - { - //small usability workaround, if anything related to resolution scaling or size is modified, change all of them together - if (full_item=="display/width" || full_item=="display/height" || full_item=="display/stretch_mode") { - Globals::get_singleton()->set_persisting("display/height",true); - Globals::get_singleton()->set_persisting("display/width",true); - } - } - - -// globals_editor->update_property(p_name); - globals_editor->get_property_editor()->update_tree(); - } _settings_changed(); } @@ -810,12 +777,12 @@ void ProjectSettings::_copy_to_platform(int p_which) { } String name = catname+"/"+propname; - Variant value=Globals::get_singleton()->get(name); + Variant value=GlobalConfig::get_singleton()->get(name); catname+="."+popup_platform->get_popup()->get_item_text(p_which);; name = catname+"/"+propname; - Globals::get_singleton()->set(name,value); + GlobalConfig::get_singleton()->set(name,value); globals_editor->get_property_editor()->update_tree(); } @@ -828,7 +795,7 @@ void ProjectSettings::add_translation(const String& p_translation) { void ProjectSettings::_translation_add(const String& p_path) { - StringArray translations = Globals::get_singleton()->get("locale/translations"); + PoolStringArray translations = GlobalConfig::get_singleton()->get("locale/translations"); for(int i=0;i<translations.size();i++) { @@ -839,9 +806,8 @@ void ProjectSettings::_translation_add(const String& p_path) { translations.push_back(p_path); undo_redo->create_action(TTR("Add Translation")); - undo_redo->add_do_property(Globals::get_singleton(),"locale/translations",translations); - undo_redo->add_undo_property(Globals::get_singleton(),"locale/translations",Globals::get_singleton()->get("locale/translations")); - undo_redo->add_do_method(Globals::get_singleton(),"set_persisting","locale/translations",true); + undo_redo->add_do_property(GlobalConfig::get_singleton(),"locale/translations",translations); + undo_redo->add_undo_property(GlobalConfig::get_singleton(),"locale/translations",GlobalConfig::get_singleton()->get("locale/translations")); undo_redo->add_do_method(this,"_update_translations"); undo_redo->add_undo_method(this,"_update_translations"); undo_redo->add_do_method(this,"_settings_changed"); @@ -862,15 +828,15 @@ void ProjectSettings::_translation_delete(Object *p_item,int p_column, int p_but int idx=ti->get_metadata(0); - StringArray translations = Globals::get_singleton()->get("locale/translations"); + PoolStringArray translations = GlobalConfig::get_singleton()->get("locale/translations"); ERR_FAIL_INDEX(idx,translations.size()); translations.remove(idx); undo_redo->create_action(TTR("Remove Translation")); - undo_redo->add_do_property(Globals::get_singleton(),"locale/translations",translations); - undo_redo->add_undo_property(Globals::get_singleton(),"locale/translations",Globals::get_singleton()->get("locale/translations")); + undo_redo->add_do_property(GlobalConfig::get_singleton(),"locale/translations",translations); + undo_redo->add_undo_property(GlobalConfig::get_singleton(),"locale/translations",GlobalConfig::get_singleton()->get("locale/translations")); undo_redo->add_do_method(this,"_update_translations"); undo_redo->add_undo_method(this,"_update_translations"); undo_redo->add_do_method(this,"_settings_changed"); @@ -891,20 +857,19 @@ void ProjectSettings::_translation_res_add(const String& p_path){ Variant prev; Dictionary remaps; - if (Globals::get_singleton()->has("locale/translation_remaps")) { - remaps = Globals::get_singleton()->get("locale/translation_remaps"); + if (GlobalConfig::get_singleton()->has("locale/translation_remaps")) { + remaps = GlobalConfig::get_singleton()->get("locale/translation_remaps"); prev=remaps; } if (remaps.has(p_path)) return; //pointless already has it - remaps[p_path]=StringArray(); + remaps[p_path]=PoolStringArray(); undo_redo->create_action(TTR("Add Remapped Path")); - undo_redo->add_do_property(Globals::get_singleton(),"locale/translation_remaps",remaps); - undo_redo->add_do_method(Globals::get_singleton(),"set_persisting","locale/translation_remaps",true); - undo_redo->add_undo_property(Globals::get_singleton(),"locale/translation_remaps",prev); + undo_redo->add_do_property(GlobalConfig::get_singleton(),"locale/translation_remaps",remaps); + undo_redo->add_undo_property(GlobalConfig::get_singleton(),"locale/translation_remaps",prev); undo_redo->add_do_method(this,"_update_translations"); undo_redo->add_undo_method(this,"_update_translations"); undo_redo->add_do_method(this,"_settings_changed"); @@ -920,9 +885,9 @@ void ProjectSettings::_translation_res_option_file_open(){ } void ProjectSettings::_translation_res_option_add(const String& p_path) { - ERR_FAIL_COND(!Globals::get_singleton()->has("locale/translation_remaps")); + ERR_FAIL_COND(!GlobalConfig::get_singleton()->has("locale/translation_remaps")); - Dictionary remaps = Globals::get_singleton()->get("locale/translation_remaps"); + Dictionary remaps = GlobalConfig::get_singleton()->get("locale/translation_remaps"); TreeItem *k = translation_remap->get_selected(); ERR_FAIL_COND(!k); @@ -930,15 +895,14 @@ void ProjectSettings::_translation_res_option_add(const String& p_path) { String key = k->get_metadata(0); ERR_FAIL_COND(!remaps.has(key)); - StringArray r = remaps[key]; + PoolStringArray r = remaps[key]; r.push_back(p_path+":"+"en"); remaps[key]=r; undo_redo->create_action(TTR("Resource Remap Add Remap")); - undo_redo->add_do_property(Globals::get_singleton(),"locale/translation_remaps",remaps); - undo_redo->add_do_method(Globals::get_singleton(),"set_persisting","locale/translation_remaps",true); - undo_redo->add_undo_property(Globals::get_singleton(),"locale/translation_remaps",Globals::get_singleton()->get("locale/translation_remaps")); + undo_redo->add_do_property(GlobalConfig::get_singleton(),"locale/translation_remaps",remaps); + undo_redo->add_undo_property(GlobalConfig::get_singleton(),"locale/translation_remaps",GlobalConfig::get_singleton()->get("locale/translation_remaps")); undo_redo->add_do_method(this,"_update_translations"); undo_redo->add_undo_method(this,"_update_translations"); undo_redo->add_do_method(this,"_settings_changed"); @@ -963,10 +927,10 @@ void ProjectSettings::_translation_res_option_changed() { if (updating_translations) return; - if (!Globals::get_singleton()->has("locale/translation_remaps")) + if (!GlobalConfig::get_singleton()->has("locale/translation_remaps")) return; - Dictionary remaps = Globals::get_singleton()->get("locale/translation_remaps"); + Dictionary remaps = GlobalConfig::get_singleton()->get("locale/translation_remaps"); TreeItem *k = translation_remap->get_selected(); ERR_FAIL_COND(!k); @@ -984,16 +948,15 @@ void ProjectSettings::_translation_res_option_changed() { ERR_FAIL_COND(!remaps.has(key)); - StringArray r = remaps[key]; + PoolStringArray r = remaps[key]; ERR_FAIL_INDEX(idx,r.size()); r.set(idx,path+":"+langs[which]); remaps[key]=r; updating_translations=true; undo_redo->create_action(TTR("Change Resource Remap Language")); - undo_redo->add_do_property(Globals::get_singleton(),"locale/translation_remaps",remaps); - undo_redo->add_do_method(Globals::get_singleton(),"set_persisting","locale/translation_remaps",true); - undo_redo->add_undo_property(Globals::get_singleton(),"locale/translation_remaps",Globals::get_singleton()->get("locale/translation_remaps")); + undo_redo->add_do_property(GlobalConfig::get_singleton(),"locale/translation_remaps",remaps); + undo_redo->add_undo_property(GlobalConfig::get_singleton(),"locale/translation_remaps",GlobalConfig::get_singleton()->get("locale/translation_remaps")); undo_redo->add_do_method(this,"_update_translations"); undo_redo->add_undo_method(this,"_update_translations"); undo_redo->add_do_method(this,"_settings_changed"); @@ -1010,10 +973,10 @@ void ProjectSettings::_translation_res_delete(Object *p_item,int p_column, int p if (updating_translations) return; - if (!Globals::get_singleton()->has("locale/translation_remaps")) + if (!GlobalConfig::get_singleton()->has("locale/translation_remaps")) return; - Dictionary remaps = Globals::get_singleton()->get("locale/translation_remaps"); + Dictionary remaps = GlobalConfig::get_singleton()->get("locale/translation_remaps"); TreeItem *k = p_item->cast_to<TreeItem>(); @@ -1023,9 +986,8 @@ void ProjectSettings::_translation_res_delete(Object *p_item,int p_column, int p remaps.erase(key); undo_redo->create_action(TTR("Remove Resource Remap")); - undo_redo->add_do_property(Globals::get_singleton(),"locale/translation_remaps",remaps); - undo_redo->add_do_method(Globals::get_singleton(),"set_persisting","locale/translation_remaps",true); - undo_redo->add_undo_property(Globals::get_singleton(),"locale/translation_remaps",Globals::get_singleton()->get("locale/translation_remaps")); + undo_redo->add_do_property(GlobalConfig::get_singleton(),"locale/translation_remaps",remaps); + undo_redo->add_undo_property(GlobalConfig::get_singleton(),"locale/translation_remaps",GlobalConfig::get_singleton()->get("locale/translation_remaps")); undo_redo->add_do_method(this,"_update_translations"); undo_redo->add_undo_method(this,"_update_translations"); undo_redo->add_do_method(this,"_settings_changed"); @@ -1038,10 +1000,10 @@ void ProjectSettings::_translation_res_option_delete(Object *p_item,int p_column if (updating_translations) return; - if (!Globals::get_singleton()->has("locale/translation_remaps")) + if (!GlobalConfig::get_singleton()->has("locale/translation_remaps")) return; - Dictionary remaps = Globals::get_singleton()->get("locale/translation_remaps"); + Dictionary remaps = GlobalConfig::get_singleton()->get("locale/translation_remaps"); TreeItem *k = translation_remap->get_selected(); ERR_FAIL_COND(!k); @@ -1052,16 +1014,15 @@ void ProjectSettings::_translation_res_option_delete(Object *p_item,int p_column int idx = ed->get_metadata(0); ERR_FAIL_COND(!remaps.has(key)); - StringArray r = remaps[key]; + PoolStringArray r = remaps[key]; ERR_FAIL_INDEX(idx,remaps.size()); r.remove(idx); remaps[key]=r; undo_redo->create_action(TTR("Remove Resource Remap Option")); - undo_redo->add_do_property(Globals::get_singleton(),"locale/translation_remaps",remaps); - undo_redo->add_do_method(Globals::get_singleton(),"set_persisting","locale/translation_remaps",true); - undo_redo->add_undo_property(Globals::get_singleton(),"locale/translation_remaps",Globals::get_singleton()->get("locale/translation_remaps")); + undo_redo->add_do_property(GlobalConfig::get_singleton(),"locale/translation_remaps",remaps); + undo_redo->add_undo_property(GlobalConfig::get_singleton(),"locale/translation_remaps",GlobalConfig::get_singleton()->get("locale/translation_remaps")); undo_redo->add_do_method(this,"_update_translations"); undo_redo->add_undo_method(this,"_update_translations"); undo_redo->add_do_method(this,"_settings_changed"); @@ -1082,9 +1043,9 @@ void ProjectSettings::_update_translations() { translation_list->clear(); TreeItem *root = translation_list->create_item(NULL); translation_list->set_hide_root(true); - if (Globals::get_singleton()->has("locale/translations")) { + if (GlobalConfig::get_singleton()->has("locale/translations")) { - StringArray translations = Globals::get_singleton()->get("locale/translations"); + PoolStringArray translations = GlobalConfig::get_singleton()->get("locale/translations"); for(int i=0;i<translations.size();i++) { TreeItem *t = translation_list->create_item(root); @@ -1121,9 +1082,9 @@ void ProjectSettings::_update_translations() { langnames+=names[i]; } - if (Globals::get_singleton()->has("locale/translation_remaps")) { + if (GlobalConfig::get_singleton()->has("locale/translation_remaps")) { - Dictionary remaps = Globals::get_singleton()->get("locale/translation_remaps"); + Dictionary remaps = GlobalConfig::get_singleton()->get("locale/translation_remaps"); List<Variant> rk; remaps.get_key_list(&rk); Vector<String> keys; @@ -1144,7 +1105,7 @@ void ProjectSettings::_update_translations() { t->select(0); translation_res_option_add_button->set_disabled(false); - StringArray selected = remaps[keys[i]]; + PoolStringArray selected = remaps[keys[i]]; for(int j=0;j<selected.size();j++) { String s = selected[j]; @@ -1213,41 +1174,41 @@ void ProjectSettings::set_plugins_page() { void ProjectSettings::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_item_selected"),&ProjectSettings::_item_selected); - ObjectTypeDB::bind_method(_MD("_item_add"),&ProjectSettings::_item_add); - ObjectTypeDB::bind_method(_MD("_item_adds"),&ProjectSettings::_item_adds); - ObjectTypeDB::bind_method(_MD("_item_del"),&ProjectSettings::_item_del); - ObjectTypeDB::bind_method(_MD("_item_checked"),&ProjectSettings::_item_checked); - ObjectTypeDB::bind_method(_MD("_save"),&ProjectSettings::_save); - ObjectTypeDB::bind_method(_MD("_action_add"),&ProjectSettings::_action_add); - ObjectTypeDB::bind_method(_MD("_action_adds"),&ProjectSettings::_action_adds); - ObjectTypeDB::bind_method(_MD("_action_selected"),&ProjectSettings::_action_selected); - ObjectTypeDB::bind_method(_MD("_action_edited"),&ProjectSettings::_action_edited); - ObjectTypeDB::bind_method(_MD("_action_button_pressed"),&ProjectSettings::_action_button_pressed); - ObjectTypeDB::bind_method(_MD("_update_actions"),&ProjectSettings::_update_actions); - ObjectTypeDB::bind_method(_MD("_wait_for_key"),&ProjectSettings::_wait_for_key); - ObjectTypeDB::bind_method(_MD("_add_item"),&ProjectSettings::_add_item); - ObjectTypeDB::bind_method(_MD("_device_input_add"),&ProjectSettings::_device_input_add); - ObjectTypeDB::bind_method(_MD("_press_a_key_confirm"),&ProjectSettings::_press_a_key_confirm); - ObjectTypeDB::bind_method(_MD("_settings_prop_edited"),&ProjectSettings::_settings_prop_edited); - ObjectTypeDB::bind_method(_MD("_copy_to_platform"),&ProjectSettings::_copy_to_platform); - ObjectTypeDB::bind_method(_MD("_update_translations"),&ProjectSettings::_update_translations); - ObjectTypeDB::bind_method(_MD("_translation_delete"),&ProjectSettings::_translation_delete); - ObjectTypeDB::bind_method(_MD("_settings_changed"),&ProjectSettings::_settings_changed); - ObjectTypeDB::bind_method(_MD("_translation_add"),&ProjectSettings::_translation_add); - ObjectTypeDB::bind_method(_MD("_translation_file_open"),&ProjectSettings::_translation_file_open); - - ObjectTypeDB::bind_method(_MD("_translation_res_add"),&ProjectSettings::_translation_res_add); - ObjectTypeDB::bind_method(_MD("_translation_res_file_open"),&ProjectSettings::_translation_res_file_open); - ObjectTypeDB::bind_method(_MD("_translation_res_option_add"),&ProjectSettings::_translation_res_option_add); - ObjectTypeDB::bind_method(_MD("_translation_res_option_file_open"),&ProjectSettings::_translation_res_option_file_open); - ObjectTypeDB::bind_method(_MD("_translation_res_select"),&ProjectSettings::_translation_res_select); - ObjectTypeDB::bind_method(_MD("_translation_res_option_changed"),&ProjectSettings::_translation_res_option_changed); - ObjectTypeDB::bind_method(_MD("_translation_res_delete"),&ProjectSettings::_translation_res_delete); - ObjectTypeDB::bind_method(_MD("_translation_res_option_delete"),&ProjectSettings::_translation_res_option_delete); - - ObjectTypeDB::bind_method(_MD("_clear_search_box"),&ProjectSettings::_clear_search_box); - ObjectTypeDB::bind_method(_MD("_toggle_search_bar"),&ProjectSettings::_toggle_search_bar); + ClassDB::bind_method(_MD("_item_selected"),&ProjectSettings::_item_selected); + ClassDB::bind_method(_MD("_item_add"),&ProjectSettings::_item_add); + ClassDB::bind_method(_MD("_item_adds"),&ProjectSettings::_item_adds); + ClassDB::bind_method(_MD("_item_del"),&ProjectSettings::_item_del); + ClassDB::bind_method(_MD("_item_checked"),&ProjectSettings::_item_checked); + ClassDB::bind_method(_MD("_save"),&ProjectSettings::_save); + ClassDB::bind_method(_MD("_action_add"),&ProjectSettings::_action_add); + ClassDB::bind_method(_MD("_action_adds"),&ProjectSettings::_action_adds); + ClassDB::bind_method(_MD("_action_selected"),&ProjectSettings::_action_selected); + ClassDB::bind_method(_MD("_action_edited"),&ProjectSettings::_action_edited); + ClassDB::bind_method(_MD("_action_button_pressed"),&ProjectSettings::_action_button_pressed); + ClassDB::bind_method(_MD("_update_actions"),&ProjectSettings::_update_actions); + ClassDB::bind_method(_MD("_wait_for_key"),&ProjectSettings::_wait_for_key); + ClassDB::bind_method(_MD("_add_item"),&ProjectSettings::_add_item); + ClassDB::bind_method(_MD("_device_input_add"),&ProjectSettings::_device_input_add); + ClassDB::bind_method(_MD("_press_a_key_confirm"),&ProjectSettings::_press_a_key_confirm); + ClassDB::bind_method(_MD("_settings_prop_edited"),&ProjectSettings::_settings_prop_edited); + ClassDB::bind_method(_MD("_copy_to_platform"),&ProjectSettings::_copy_to_platform); + ClassDB::bind_method(_MD("_update_translations"),&ProjectSettings::_update_translations); + ClassDB::bind_method(_MD("_translation_delete"),&ProjectSettings::_translation_delete); + ClassDB::bind_method(_MD("_settings_changed"),&ProjectSettings::_settings_changed); + ClassDB::bind_method(_MD("_translation_add"),&ProjectSettings::_translation_add); + ClassDB::bind_method(_MD("_translation_file_open"),&ProjectSettings::_translation_file_open); + + ClassDB::bind_method(_MD("_translation_res_add"),&ProjectSettings::_translation_res_add); + ClassDB::bind_method(_MD("_translation_res_file_open"),&ProjectSettings::_translation_res_file_open); + ClassDB::bind_method(_MD("_translation_res_option_add"),&ProjectSettings::_translation_res_option_add); + ClassDB::bind_method(_MD("_translation_res_option_file_open"),&ProjectSettings::_translation_res_option_file_open); + ClassDB::bind_method(_MD("_translation_res_select"),&ProjectSettings::_translation_res_select); + ClassDB::bind_method(_MD("_translation_res_option_changed"),&ProjectSettings::_translation_res_option_changed); + ClassDB::bind_method(_MD("_translation_res_delete"),&ProjectSettings::_translation_res_delete); + ClassDB::bind_method(_MD("_translation_res_option_delete"),&ProjectSettings::_translation_res_option_delete); + + ClassDB::bind_method(_MD("_clear_search_box"),&ProjectSettings::_clear_search_box); + ClassDB::bind_method(_MD("_toggle_search_bar"),&ProjectSettings::_toggle_search_bar); } @@ -1262,7 +1223,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) { tab_container = memnew( TabContainer ); add_child(tab_container); - set_child_rect(tab_container); + //set_child_rect(tab_container); //tab_container->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_BEGIN, 15 ); //tab_container->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_END, 15 ); @@ -1347,6 +1308,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) { globals_editor = memnew( SectionedPropertyEditor ); props_base->add_child(globals_editor); + globals_editor->get_property_editor()->set_undo_redo(EditorNode::get_singleton()->get_undo_redo()); //globals_editor->hide_top_label(); globals_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL); globals_editor->get_property_editor()->register_text_enter(search_box); @@ -1389,7 +1351,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) { } - popup_platform->get_popup()->connect("item_pressed",this,"_copy_to_platform"); + popup_platform->get_popup()->connect("id_pressed",this,"_copy_to_platform"); get_ok()->set_text(TTR("Close")); set_hide_on_ok(true); @@ -1437,7 +1399,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) { input_editor->connect("button_pressed",this,"_action_button_pressed"); popup_add = memnew( PopupMenu ); add_child(popup_add); - popup_add->connect("item_pressed",this,"_add_item"); + popup_add->connect("id_pressed",this,"_add_item"); press_a_key = memnew( ConfirmationDialog ); press_a_key->set_focus_mode(FOCUS_ALL); @@ -1451,7 +1413,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) { l->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_BEGIN,30); press_a_key_label=l; press_a_key->add_child(l); - press_a_key->connect("input_event",this,"_wait_for_key"); + press_a_key->connect("gui_input",this,"_wait_for_key"); press_a_key->connect("confirmed",this,"_press_a_key_confirm"); @@ -1462,7 +1424,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) { hbc = memnew( HBoxContainer ); device_input->add_child(hbc); - device_input->set_child_rect(hbc); +// device_input->set_child_rect(hbc); VBoxContainer *vbc_left = memnew( VBoxContainer ); hbc->add_child(vbc_left); @@ -1472,7 +1434,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) { vbc_left->add_child(l); device_id = memnew( SpinBox ); - device_id->set_val(0); + device_id->set_value(0); vbc_left->add_child(device_id); VBoxContainer *vbc_right = memnew( VBoxContainer ); @@ -1606,7 +1568,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) { timer = memnew( Timer ); timer->set_wait_time(1.5); - timer->connect("timeout",Globals::get_singleton(),"save"); + timer->connect("timeout",GlobalConfig::get_singleton(),"save"); timer->set_one_shot(true); add_child(timer); diff --git a/tools/editor/project_settings.h b/tools/editor/project_settings.h index 61ad094d00..bb925a5fd9 100644 --- a/tools/editor/project_settings.h +++ b/tools/editor/project_settings.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -40,7 +40,7 @@ //#include "project_export_settings.h" class ProjectSettings : public AcceptDialog { - OBJ_TYPE( ProjectSettings, AcceptDialog ); + GDCLASS( ProjectSettings, AcceptDialog ); TabContainer *tab_container; diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index ef6b1aa47c..d59833f0ed 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -47,6 +47,7 @@ #include "editor_file_system.h" #include "create_dialog.h" #include "property_selector.h" +#include "globals.h" void CustomPropertyEditor::_notification(int p_what) { @@ -173,9 +174,9 @@ void CustomPropertyEditor::_menu_option(int p_which) { propvalues.push_back(p); } - String orig_type = res_orig->get_type(); + String orig_type = res_orig->get_class(); - Object *inst = ObjectTypeDB::instance( orig_type ); + Object *inst = ClassDB::instance( orig_type ); Ref<Resource> res = Ref<Resource>( inst->cast_to<Resource>() ); @@ -226,15 +227,26 @@ void CustomPropertyEditor::_menu_option(int p_which) { ERR_FAIL_COND( inheritors_array.empty() ); + + String intype=inheritors_array[p_which-TYPE_BASE_ID]; - Object *obj = ObjectTypeDB::instance(intype); + if (intype=="ViewportTexture") { + + scene_tree->set_title(TTR("Pick a Viewport")); + scene_tree->popup_centered_ratio(); + picking_viewport=true; + return; + + } + + Object *obj = ClassDB::instance(intype); ERR_BREAK( !obj ); Resource *res=obj->cast_to<Resource>(); ERR_BREAK( !res ); if (owner && hint==PROPERTY_HINT_RESOURCE_TYPE && hint_text=="Script") { //make visual script the right type - res->call("set_instance_base_type",owner->get_type()); + res->call("set_instance_base_type",owner->get_class()); } v=Ref<Resource>(res).get_ref_ptr(); @@ -295,6 +307,7 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty action_buttons[i]->hide(); } + checks20gc->hide(); for(int i=0;i<20;i++) checks20[i]->hide(); @@ -305,12 +318,16 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty case Variant::BOOL: { + checks20gc->show(); + CheckBox *c=checks20[0]; c->set_text("True"); - c->set_pos(Vector2(4,4)); + checks20gc->set_pos(Vector2(4,4)); c->set_pressed(v); c->show(); - set_size(checks20[0]->get_pos()+checks20[0]->get_size()+Vector2(4,4)*EDSCALE); + + checks20gc->set_size(checks20gc->get_minimum_size()); + set_size(checks20gc->get_pos()+checks20gc->get_size()+Vector2(4,4)*EDSCALE); } break; case Variant::INT: @@ -341,14 +358,14 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty slider->set_min(min); slider->set_max(max); slider->set_step(step); - slider->set_val(v); + slider->set_value(v); slider->show(); set_size(Size2(110,30)*EDSCALE); } else { spinbox->set_min(min); spinbox->set_max(max); spinbox->set_step(step); - spinbox->set_val(v); + spinbox->set_value(v); spinbox->show(); set_size(Size2(70,35)*EDSCALE); } @@ -367,10 +384,19 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty return false; - } else if (hint==PROPERTY_HINT_ALL_FLAGS) { + } else if (hint==PROPERTY_HINT_LAYERS_2D_PHYSICS || hint==PROPERTY_HINT_LAYERS_2D_RENDER || hint==PROPERTY_HINT_LAYERS_3D_PHYSICS || hint==PROPERTY_HINT_LAYERS_3D_RENDER) { + - checks20[0]->set_text(""); + String title; + String basename; + switch (hint) { + case PROPERTY_HINT_LAYERS_2D_RENDER: basename="layer_names/2d_render"; title="2D Render Layers"; break; + case PROPERTY_HINT_LAYERS_2D_PHYSICS: basename="layer_names/2d_physics"; title="2D Physics Layers"; break; + case PROPERTY_HINT_LAYERS_3D_RENDER: basename="layer_names/3d_render"; title="3D Render Layers"; break; + case PROPERTY_HINT_LAYERS_3D_PHYSICS: basename="layer_names/3d_physics";title="3D Physics Layers"; break; + } + checks20gc->show(); uint32_t flgs = v; for(int i=0;i<2;i++) { @@ -378,12 +404,9 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty ofs.y+=22*i; for(int j=0;j<10;j++) { - CheckBox *c=checks20[i*10+j]; - Point2 o=ofs; - o.x+=j*22; - if (j>=5) - o.x+=4; - c->set_pos(o); + int idx = i*10+j; + CheckBox *c=checks20[idx]; + c->set_text(GlobalConfig::get_singleton()->get(basename+"/layer_"+itos(idx+1))); c->set_pressed( flgs & (1<<(i*10+j)) ); c->show(); } @@ -391,7 +414,16 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty } - set_size(checks20[19]->get_pos()+Size2(20,25)*EDSCALE); + show(); + + value_label[0]->set_text(title); + value_label[0]->show(); + value_label[0]->set_pos(Vector2(4,4)*EDSCALE); + + checks20gc->set_pos(Vector2(4,4)*EDSCALE+Vector2(0,value_label[0]->get_size().height+4*EDSCALE)); + checks20gc->set_size(checks20gc->get_minimum_size()); + + set_size(Vector2(4,4)*EDSCALE+checks20gc->get_pos()+checks20gc->get_size()); } else if (hint==PROPERTY_HINT_EXP_EASING) { @@ -689,7 +721,7 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty value_editor[3]->set_text( String::num( q.w ) ); } break; - case Variant::_AABB: { + case Variant::RECT3: { List<String> names; names.push_back("px"); @@ -700,7 +732,7 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty names.push_back("sz"); config_value_editors(6,3,16,names); - AABB aabb=v; + Rect3 aabb=v; value_editor[0]->set_text( String::num( aabb.pos.x ) ); value_editor[1]->set_text( String::num( aabb.pos.y ) ); value_editor[2]->set_text( String::num( aabb.pos.z ) ); @@ -709,7 +741,7 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty value_editor[5]->set_text( String::num( aabb.size.z ) ); } break; - case Variant::MATRIX32: { + case Variant::TRANSFORM2D: { List<String> names; names.push_back("xx"); @@ -720,14 +752,14 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty names.push_back("oy"); config_value_editors(6,2,16,names); - Matrix32 basis=v; + Transform2D basis=v; for(int i=0;i<6;i++) { value_editor[i]->set_text( String::num( basis.elements[i/2][i%2] ) ); } } break; - case Variant::MATRIX3: { + case Variant::BASIS: { List<String> names; names.push_back("xx"); @@ -741,7 +773,7 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty names.push_back("zz"); config_value_editors(9,3,16,names); - Matrix3 basis=v; + Basis basis=v; for(int i=0;i<9;i++) { value_editor[i]->set_text( String::num( basis.elements[i/3][i%3] ) ); @@ -871,7 +903,7 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty Set<String> valid_inheritors; valid_inheritors.insert(base); List<StringName> inheritors; - ObjectTypeDB::get_inheriters_from(base.strip_edges(),&inheritors); + ClassDB::get_inheriters_from_class(base.strip_edges(),&inheritors); List<StringName>::Element *E=inheritors.front(); while(E) { valid_inheritors.insert(E->get()); @@ -880,7 +912,7 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty for(Set<String>::Element *E=valid_inheritors.front();E;E=E->next()) { String t = E->get(); - if (!ObjectTypeDB::can_instance(t)) + if (!ClassDB::can_instance(t)) continue; inheritors_array.push_back(t); @@ -934,7 +966,7 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty paste_valid=true; else for (int i = 0; i < hint_text.get_slice_count(",");i++) - if (ObjectTypeDB::is_type(cb->get_type(),hint_text.get_slice(",",i))) { + if (ClassDB::is_parent_class(cb->get_class(),hint_text.get_slice(",",i))) { paste_valid=true; break; } @@ -973,27 +1005,27 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty } break; - case Variant::RAW_ARRAY: { + case Variant::POOL_BYTE_ARRAY: { } break; - case Variant::INT_ARRAY: { + case Variant::POOL_INT_ARRAY: { } break; - case Variant::REAL_ARRAY: { + case Variant::POOL_REAL_ARRAY: { } break; - case Variant::STRING_ARRAY: { + case Variant::POOL_STRING_ARRAY: { } break; - case Variant::VECTOR3_ARRAY: { + case Variant::POOL_VECTOR3_ARRAY: { } break; - case Variant::COLOR_ARRAY: { + case Variant::POOL_COLOR_ARRAY: { } break; @@ -1012,7 +1044,7 @@ void CustomPropertyEditor::_file_selected(String p_file) { if (hint==PROPERTY_HINT_FILE || hint==PROPERTY_HINT_DIR) { - v=Globals::get_singleton()->localize_path(p_file); + v=GlobalConfig::get_singleton()->localize_path(p_file); emit_signal("variant_changed"); hide(); } @@ -1095,13 +1127,13 @@ void CustomPropertyEditor::_type_create_selected(int p_idx) { ERR_FAIL_INDEX(p_idx,inheritors_array.size()); //List<String> inheritors; - //ObjectTypeDB::get_inheriters_from(hint_text,&inheritors); + //ClassDB::get_inheriters_from(hint_text,&inheritors); //inheritors.push_front(hint_text); //ERR_FAIL_INDEX( p_idx, inheritors.size() ); String intype=inheritors_array[p_idx]; - Object *obj = ObjectTypeDB::instance(intype); + Object *obj = ClassDB::instance(intype); ERR_FAIL_COND( !obj ); @@ -1126,6 +1158,22 @@ void CustomPropertyEditor::_color_changed(const Color& p_color) { void CustomPropertyEditor::_node_path_selected(NodePath p_path) { + if (picking_viewport) { + + Node* to_node=get_node(p_path); + if (!to_node->cast_to<Viewport>()) { + EditorNode::get_singleton()->show_warning("Selected node is not a Viewport!"); + return; + } + + Ref<ViewportTexture> vt; + vt.instance(); + vt->set_viewport_path_in_scene(get_tree()->get_edited_scene_root()->get_path_to(to_node)); + vt->setup_local_to_scene(); + v=vt; + emit_signal("variant_changed"); + return; + } if (hint==PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE && hint_text!=String()) { @@ -1142,9 +1190,9 @@ void CustomPropertyEditor::_node_path_selected(NodePath p_path) { Node *node=NULL; - if (owner->is_type("Node")) + if (owner->is_class("Node")) node = owner->cast_to<Node>(); - else if (owner->is_type("ArrayPropertyEdit")) + else if (owner->is_class("ArrayPropertyEdit")) node = owner->cast_to<ArrayPropertyEdit>()->get_node(); if (!node) { @@ -1179,7 +1227,7 @@ void CustomPropertyEditor::_action_pressed(int p_which) { } break; case Variant::INT: { - if (hint==PROPERTY_HINT_ALL_FLAGS) { + if (hint==PROPERTY_HINT_LAYERS_2D_PHYSICS || hint==PROPERTY_HINT_LAYERS_2D_RENDER || hint==PROPERTY_HINT_LAYERS_3D_PHYSICS || hint==PROPERTY_HINT_LAYERS_3D_RENDER) { uint32_t f = v; if (checks20[p_which]->is_pressed()) @@ -1262,7 +1310,8 @@ void CustomPropertyEditor::_action_pressed(int p_which) { if (p_which==0) { - + picking_viewport=false; + scene_tree->set_title(TTR("Pick a Node")); scene_tree->popup_centered_ratio(); } else if (p_which==1) { @@ -1285,7 +1334,7 @@ void CustomPropertyEditor::_action_pressed(int p_which) { if (hint==PROPERTY_HINT_RESOURCE_TYPE) { - Object *obj = ObjectTypeDB::instance(intype); + Object *obj = ClassDB::instance(intype); ERR_BREAK( !obj ); Resource *res=obj->cast_to<Resource>(); ERR_BREAK( !res ); @@ -1353,7 +1402,7 @@ void CustomPropertyEditor::_action_pressed(int p_which) { propvalues.push_back(p); } - Ref<Resource> res = Ref<Resource>( ObjectTypeDB::instance( res_orig->get_type() )); + Ref<Resource> res = Ref<Resource>( ClassDB::instance( res_orig->get_class() )); ERR_FAIL_COND(res.is_null()); @@ -1654,7 +1703,7 @@ void CustomPropertyEditor::_modified(String p_string) { emit_signal("variant_changed"); } break; - case Variant::_AABB: { + case Variant::RECT3: { Vector3 pos; Vector3 size; @@ -1674,13 +1723,13 @@ void CustomPropertyEditor::_modified(String p_string) { size.y=value_editor[4]->get_text().to_double(); size.z=value_editor[5]->get_text().to_double(); } - v=AABB(pos,size); + v=Rect3(pos,size); emit_signal("variant_changed"); } break; - case Variant::MATRIX32: { + case Variant::TRANSFORM2D: { - Matrix32 m; + Transform2D m; for(int i=0;i<6;i++) { if (evaluator) { m.elements[i/2][i%2]=evaluator->eval(value_editor[i]->get_text()); @@ -1693,9 +1742,9 @@ void CustomPropertyEditor::_modified(String p_string) { emit_signal("variant_changed"); } break; - case Variant::MATRIX3: { + case Variant::BASIS: { - Matrix3 m; + Basis m; for(int i=0;i<9;i++) { if (evaluator) { @@ -1711,7 +1760,7 @@ void CustomPropertyEditor::_modified(String p_string) { } break; case Variant::TRANSFORM: { - Matrix3 basis; + Basis basis; for(int i=0;i<9;i++) { if (evaluator) { @@ -1771,27 +1820,27 @@ void CustomPropertyEditor::_modified(String p_string) { } break; - case Variant::RAW_ARRAY: { + case Variant::POOL_BYTE_ARRAY: { } break; - case Variant::INT_ARRAY: { + case Variant::POOL_INT_ARRAY: { } break; - case Variant::REAL_ARRAY: { + case Variant::POOL_REAL_ARRAY: { } break; - case Variant::STRING_ARRAY: { + case Variant::POOL_STRING_ARRAY: { } break; - case Variant::VECTOR3_ARRAY: { + case Variant::POOL_VECTOR3_ARRAY: { } break; - case Variant::COLOR_ARRAY: { + case Variant::POOL_COLOR_ARRAY: { } break; @@ -1816,9 +1865,9 @@ void CustomPropertyEditor::_focus_enter() { case Variant::VECTOR3: case Variant::PLANE: case Variant::QUAT: - case Variant::_AABB: - case Variant::MATRIX32: - case Variant::MATRIX3: + case Variant::RECT3: + case Variant::TRANSFORM2D: + case Variant::BASIS: case Variant::TRANSFORM: { for (int i=0;i<MAX_VALUE_EDITORS;++i) { if (value_editor[i]->has_focus()) { @@ -1841,9 +1890,9 @@ void CustomPropertyEditor::_focus_exit() { case Variant::VECTOR3: case Variant::PLANE: case Variant::QUAT: - case Variant::_AABB: - case Variant::MATRIX32: - case Variant::MATRIX3: + case Variant::RECT3: + case Variant::TRANSFORM2D: + case Variant::BASIS: case Variant::TRANSFORM: { for (int i=0;i<MAX_VALUE_EDITORS;++i) { value_editor[i]->select(0, 0); @@ -1914,22 +1963,22 @@ void CustomPropertyEditor::config_value_editors(int p_amount, int p_columns,int void CustomPropertyEditor::_bind_methods() { - ObjectTypeDB::bind_method("_focus_enter", &CustomPropertyEditor::_focus_enter); - ObjectTypeDB::bind_method("_focus_exit", &CustomPropertyEditor::_focus_exit); - ObjectTypeDB::bind_method("_modified",&CustomPropertyEditor::_modified); - ObjectTypeDB::bind_method("_range_modified", &CustomPropertyEditor::_range_modified); - ObjectTypeDB::bind_method("_scroll_modified",&CustomPropertyEditor::_scroll_modified); - ObjectTypeDB::bind_method("_action_pressed",&CustomPropertyEditor::_action_pressed); - ObjectTypeDB::bind_method("_file_selected",&CustomPropertyEditor::_file_selected); - ObjectTypeDB::bind_method("_type_create_selected",&CustomPropertyEditor::_type_create_selected); - ObjectTypeDB::bind_method("_node_path_selected",&CustomPropertyEditor::_node_path_selected); - ObjectTypeDB::bind_method("_color_changed",&CustomPropertyEditor::_color_changed); - ObjectTypeDB::bind_method("_draw_easing",&CustomPropertyEditor::_draw_easing); - ObjectTypeDB::bind_method("_drag_easing",&CustomPropertyEditor::_drag_easing); - ObjectTypeDB::bind_method( "_text_edit_changed",&CustomPropertyEditor::_text_edit_changed); - ObjectTypeDB::bind_method( "_menu_option",&CustomPropertyEditor::_menu_option); - ObjectTypeDB::bind_method( "_create_dialog_callback",&CustomPropertyEditor::_create_dialog_callback); - ObjectTypeDB::bind_method( "_create_selected_property",&CustomPropertyEditor::_create_selected_property); + ClassDB::bind_method("_focus_enter", &CustomPropertyEditor::_focus_enter); + ClassDB::bind_method("_focus_exit", &CustomPropertyEditor::_focus_exit); + ClassDB::bind_method("_modified",&CustomPropertyEditor::_modified); + ClassDB::bind_method("_range_modified", &CustomPropertyEditor::_range_modified); + ClassDB::bind_method("_scroll_modified",&CustomPropertyEditor::_scroll_modified); + ClassDB::bind_method("_action_pressed",&CustomPropertyEditor::_action_pressed); + ClassDB::bind_method("_file_selected",&CustomPropertyEditor::_file_selected); + ClassDB::bind_method("_type_create_selected",&CustomPropertyEditor::_type_create_selected); + ClassDB::bind_method("_node_path_selected",&CustomPropertyEditor::_node_path_selected); + ClassDB::bind_method("_color_changed",&CustomPropertyEditor::_color_changed); + ClassDB::bind_method("_draw_easing",&CustomPropertyEditor::_draw_easing); + ClassDB::bind_method("_drag_easing",&CustomPropertyEditor::_drag_easing); + ClassDB::bind_method( "_text_edit_changed",&CustomPropertyEditor::_text_edit_changed); + ClassDB::bind_method( "_menu_option",&CustomPropertyEditor::_menu_option); + ClassDB::bind_method( "_create_dialog_callback",&CustomPropertyEditor::_create_dialog_callback); + ClassDB::bind_method( "_create_selected_property",&CustomPropertyEditor::_create_selected_property); @@ -1967,11 +2016,21 @@ CustomPropertyEditor::CustomPropertyEditor() { } + checks20gc = memnew( GridContainer ); + add_child(checks20gc); + checks20gc->set_columns(11); + for(int i=0;i<20;i++) { + if (i==5 || i==15) { + Control *space = memnew( Control ); + space->set_custom_minimum_size(Size2(20,0)*EDSCALE); + checks20gc->add_child(space); + } + checks20[i]=memnew( CheckBox ); checks20[i]->set_toggle_mode(true); - checks20[i]->set_focus_mode(FOCUS_NONE); - add_child(checks20[i]); + checks20[i]->set_focus_mode(FOCUS_NONE); + checks20gc->add_child(checks20[i]); checks20[i]->hide(); checks20[i]->connect("pressed",this,"_action_pressed",make_binds(i)); checks20[i]->set_tooltip(vformat(TTR("Bit %d, val %d."), i, 1<<i)); @@ -2017,7 +2076,7 @@ CustomPropertyEditor::CustomPropertyEditor() { type_button = memnew( MenuButton ); add_child(type_button); type_button->hide(); - type_button->get_popup()->connect("item_pressed", this,"_type_create_selected"); + type_button->get_popup()->connect("id_pressed", this,"_type_create_selected"); scene_tree = memnew( SceneTreeDialog ); @@ -2033,13 +2092,13 @@ CustomPropertyEditor::CustomPropertyEditor() { add_child(easing_draw); easing_draw->hide(); easing_draw->connect("draw",this,"_draw_easing"); - easing_draw->connect("input_event",this,"_drag_easing"); + easing_draw->connect("gui_input",this,"_drag_easing"); //easing_draw->emit_signal(SceneStringNames::get_singleton()->input_event,InputEvent()); easing_draw->set_default_cursor_shape(Control::CURSOR_MOVE); menu = memnew(PopupMenu); add_child(menu); - menu->connect("item_pressed",this,"_menu_option"); + menu->connect("id_pressed",this,"_menu_option"); evaluator = NULL; @@ -2274,7 +2333,7 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String& p case Variant::REAL: case Variant::INT: { - if (p_hint==PROPERTY_HINT_ALL_FLAGS) { + if (p_hint==PROPERTY_HINT_LAYERS_2D_PHYSICS || p_hint==PROPERTY_HINT_LAYERS_2D_RENDER || p_hint==PROPERTY_HINT_LAYERS_3D_PHYSICS || p_hint==PROPERTY_HINT_LAYERS_3D_RENDER) { tree->update(); break; } @@ -2360,10 +2419,10 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String& p case Variant::VECTOR3: case Variant::QUAT: case Variant::VECTOR2: - case Variant::_AABB: + case Variant::RECT3: case Variant::RECT2: - case Variant::MATRIX32: - case Variant::MATRIX3: + case Variant::TRANSFORM2D: + case Variant::BASIS: case Variant::TRANSFORM: { p_item->set_text(1,obj->get(p_name)); @@ -2404,8 +2463,8 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String& p } else { RES res = obj->get( p_name ).operator RefPtr(); - if (res->is_type("Texture")) { - int tw = EditorSettings::get_singleton()->get("property_editor/texture_preview_width"); + if (res->is_class("Texture")) { + int tw = EditorSettings::get_singleton()->get("docks/property_editor/texture_preview_width"); p_item->set_icon_max_width(1,tw); p_item->set_icon(1,res); p_item->set_text(1,""); @@ -2416,20 +2475,20 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String& p } else if (res->get_path()!="" && !res->get_path().begins_with("local://")) { p_item->set_text(1, res->get_path().get_file()); } else { - p_item->set_text(1,"<"+res->get_type()+">"); + p_item->set_text(1,"<"+res->get_class()+">"); }; if (res.is_valid() && res->get_path().is_resource_file()) { p_item->set_tooltip(1,res->get_path()); } else if (res.is_valid()) { - p_item->set_tooltip(1,res->get_name()+" ("+res->get_type()+")"); + p_item->set_tooltip(1,res->get_name()+" ("+res->get_class()+")"); } - if (has_icon(res->get_type(),"EditorIcons")) { + if (has_icon(res->get_class(),"EditorIcons")) { - p_item->set_icon(0,get_icon(res->get_type(),"EditorIcons")); + p_item->set_icon(0,get_icon(res->get_class(),"EditorIcons")); } else { Dictionary d = p_item->get_metadata(0); @@ -2448,7 +2507,7 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String& p } } - if (!res->is_type("Texture")) { + if (!res->is_class("Texture")) { //texture already previews via itself EditorResourcePreview::get_singleton()->queue_edited_resource_preview(res,this,"_resource_preview_done",p_item->get_instance_ID()); } @@ -2509,6 +2568,12 @@ void PropertyEditor::_check_reload_status(const String&p_name, TreeItem* item) { } + if (obj->call("property_can_revert",p_name).operator bool()) { + + has_reload=true; + } + + if (!has_reload && !obj->get_script().is_null()) { Ref<Script> scr = obj->get_script(); Variant orig_value; @@ -2555,7 +2620,7 @@ bool PropertyEditor::_is_drop_valid(const Dictionary& p_drag_data, const Diction Ref<Resource> res = drag_data["resource"]; for(int i=0;i<allowed_type.get_slice_count(",");i++) { String at = allowed_type.get_slice(",",i).strip_edges(); - if (res.is_valid() && ObjectTypeDB::is_type(res->get_type(),at)) { + if (res.is_valid() && ClassDB::is_parent_class(res->get_class(),at)) { return true; } } @@ -2573,7 +2638,7 @@ bool PropertyEditor::_is_drop_valid(const Dictionary& p_drag_data, const Diction for(int i=0;i<allowed_type.get_slice_count(",");i++) { String at = allowed_type.get_slice(",",i).strip_edges(); - if (ObjectTypeDB::is_type(ftype,at)) { + if (ClassDB::is_parent_class(ftype,at)) { return true; } } @@ -2923,7 +2988,7 @@ void PropertyEditor::refresh() { if (refresh_countdown>0) return; - refresh_countdown=EditorSettings::get_singleton()->get("property_editor/auto_refresh_interval"); + refresh_countdown=EditorSettings::get_singleton()->get("docks/property_editor/auto_refresh_interval"); } @@ -2998,6 +3063,8 @@ void PropertyEditor::update_tree() { TreeItem * current_category=NULL; String filter = search_box ? search_box->get_text() : ""; + String group; + String group_base; for (List<PropertyInfo>::Element *I=plist.front() ; I ; I=I->next()) { @@ -3005,7 +3072,17 @@ void PropertyEditor::update_tree() { //make sure the property can be edited - if (p.usage&PROPERTY_USAGE_CATEGORY) { + if (p.usage&PROPERTY_USAGE_GROUP) { + + group=p.name; + group_base=p.hint_string; + + continue; + + } else if (p.usage&PROPERTY_USAGE_CATEGORY) { + + group=""; + group_base=""; if (!show_categories) continue; @@ -3062,12 +3139,27 @@ void PropertyEditor::update_tree() { } else if ( ! (p.usage&PROPERTY_USAGE_EDITOR ) ) continue; - String name = (p.name.find("/")!=-1)?p.name.right( p.name.find_last("/")+1 ):p.name; + String basename=p.name; + if (group!="") { + if (group_base!="") { + if (basename.begins_with(group_base)) { + basename=basename.replace_first(group_base,""); + } else { + group=""; //no longer using group base, clear + } + } + } + + if (group!="") { + basename=group+"/"+basename; + } + + String name = (basename.find("/")!=-1)?basename.right( basename.find_last("/")+1 ):basename; if (capitalize_paths) name = name.camelcase_to_underscore().capitalize(); - String path=p.name.left( p.name.find_last("/") ) ; + String path=basename.left( basename.find_last("/") ) ; if (use_filter && filter!="") { @@ -3080,7 +3172,7 @@ void PropertyEditor::update_tree() { continue; } - //printf("property %s\n",p.name.ascii().get_data()); + //printf("property %s\n",basename.ascii().get_data()); TreeItem * parent = get_parent_node(path,item_path,current_category?current_category:root ); //if (parent->get_parent()==root) // parent=root; @@ -3122,7 +3214,7 @@ void PropertyEditor::update_tree() { if (use_doc_hints) { StringName setter; StringName type; - if (ObjectTypeDB::get_setter_and_type_for_property(obj->get_type_name(),p.name,type,setter)) { + if (ClassDB::get_setter_and_type_for_property(obj->get_class_name(),p.name,type,setter)) { String descr; bool found=false; @@ -3204,7 +3296,7 @@ void PropertyEditor::update_tree() { } - if (p.hint==PROPERTY_HINT_ALL_FLAGS) { + if (p.hint==PROPERTY_HINT_LAYERS_2D_PHYSICS || p.hint==PROPERTY_HINT_LAYERS_2D_RENDER || p.hint==PROPERTY_HINT_LAYERS_3D_PHYSICS || p.hint==PROPERTY_HINT_LAYERS_3D_RENDER) { item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM ); item->set_editable(1,!read_only); @@ -3413,7 +3505,7 @@ void PropertyEditor::update_tree() { } break; - case Variant::INT_ARRAY: { + case Variant::POOL_INT_ARRAY: { item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM ); item->add_button(1,get_icon("EditResource","EditorIcons")); @@ -3428,7 +3520,7 @@ void PropertyEditor::update_tree() { } break; - case Variant::REAL_ARRAY: { + case Variant::POOL_REAL_ARRAY: { item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM ); item->add_button(1,get_icon("EditResource","EditorIcons")); @@ -3443,7 +3535,7 @@ void PropertyEditor::update_tree() { } break; - case Variant::STRING_ARRAY: { + case Variant::POOL_STRING_ARRAY: { item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM ); item->add_button(1,get_icon("EditResource","EditorIcons")); @@ -3458,7 +3550,7 @@ void PropertyEditor::update_tree() { } break; - case Variant::RAW_ARRAY: { + case Variant::POOL_BYTE_ARRAY: { item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM ); item->add_button(1,get_icon("EditResource","EditorIcons")); @@ -3473,7 +3565,7 @@ void PropertyEditor::update_tree() { } break; - case Variant::VECTOR2_ARRAY: { + case Variant::POOL_VECTOR2_ARRAY: { item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM ); item->add_button(1,get_icon("EditResource","EditorIcons")); @@ -3488,7 +3580,7 @@ void PropertyEditor::update_tree() { } break; - case Variant::VECTOR3_ARRAY: { + case Variant::POOL_VECTOR3_ARRAY: { item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM ); item->add_button(1,get_icon("EditResource","EditorIcons")); @@ -3503,7 +3595,7 @@ void PropertyEditor::update_tree() { } break; - case Variant::COLOR_ARRAY: { + case Variant::POOL_COLOR_ARRAY: { item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM ); item->add_button(1,get_icon("EditResource","EditorIcons")); @@ -3545,8 +3637,8 @@ void PropertyEditor::update_tree() { item->set_icon( 0,get_icon("Vector","EditorIcons") ); } break; - case Variant::MATRIX32: - case Variant::MATRIX3: { + case Variant::TRANSFORM2D: + case Variant::BASIS: { item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM ); item->set_editable( 1, true ); @@ -3570,11 +3662,11 @@ void PropertyEditor::update_tree() { item->set_icon( 0,get_icon("Plane","EditorIcons") ); } break; - case Variant::_AABB: { + case Variant::RECT3: { item->set_cell_mode( 1, TreeItem::CELL_MODE_CUSTOM ); item->set_editable( 1, true ); - item->set_text(1,"AABB"); + item->set_text(1,"Rect3"); if (show_type_icons) item->set_icon( 0,get_icon("Rect3","EditorIcons") ); } break; @@ -3635,8 +3727,8 @@ void PropertyEditor::update_tree() { } else { RES res = obj->get( p.name ).operator RefPtr(); - if (res->is_type("Texture")) { - int tw = EditorSettings::get_singleton()->get("property_editor/texture_preview_width"); + if (res->is_class("Texture")) { + int tw = EditorSettings::get_singleton()->get("docks/property_editor/texture_preview_width"); item->set_icon_max_width(1,tw); item->set_icon(1,res); item->set_text(1,""); @@ -3648,19 +3740,19 @@ void PropertyEditor::update_tree() { item->set_text(1, res->get_path().get_file()); } else { - item->set_text(1,"<"+res->get_type()+">"); + item->set_text(1,"<"+res->get_class()+">"); } - if (has_icon(res->get_type(),"EditorIcons")) { - type=res->get_type(); + if (has_icon(res->get_class(),"EditorIcons")) { + type=res->get_class(); } if (res.is_valid() && res->get_path().is_resource_file()) { item->set_tooltip(1,res->get_path()); } else if (res.is_valid()) { - item->set_tooltip(1,res->get_name()+" ("+res->get_type()+")"); + item->set_tooltip(1,res->get_name()+" ("+res->get_class()+")"); } - if (!res->is_type("Texture")) { + if (!res->is_class("Texture")) { //texture already previews via itself EditorResourcePreview::get_singleton()->queue_edited_resource_preview(res,this,"_resource_preview_done",item->get_instance_ID()); } @@ -3715,6 +3807,12 @@ void PropertyEditor::update_tree() { } + if (obj->call("property_can_revert",p.name).operator bool()) { + + item->add_button(1,get_icon("ReloadSmall","EditorIcons"),3); + has_reload=true; + } + if (!has_reload && !obj->get_script().is_null()) { Ref<Script> scr = obj->get_script(); Variant orig_value; @@ -3765,22 +3863,34 @@ void PropertyEditor::_edit_set(const String& p_name, const Variant& p_value) { } else { - undo_redo->create_action(TTR("Set")+" "+p_name,UndoRedo::MERGE_ENDS); undo_redo->add_do_property(obj,p_name,p_value); undo_redo->add_undo_property(obj,p_name,obj->get(p_name)); + + undo_redo->add_do_method(this,"_changed_callback",obj,p_name); undo_redo->add_undo_method(this,"_changed_callback",obj,p_name); - undo_redo->add_undo_method(this,"_changed_callback",obj,p_name); + Resource *r = obj->cast_to<Resource>(); if (r) { if (!r->is_edited() && String(p_name)!="resource/edited") { undo_redo->add_do_method(r,"set_edited",true); undo_redo->add_undo_method(r,"set_edited",false); } + + if (String(p_name)=="resource_local_to_scene") { + bool prev = obj->get(p_name); + bool next = p_value; + if (next) { + undo_redo->add_do_method(this,"setup_local_to_scene"); + } + if (prev) { + undo_redo->add_undo_method(this,"setup_local_to_scene"); + } + } } - _prop_edited_name[0]=p_name; - undo_redo->add_do_method(this,"emit_signal",_prop_edited,_prop_edited_name); + undo_redo->add_do_method(this,"emit_signal",_prop_edited,p_name); + undo_redo->add_undo_method(this,"emit_signal",_prop_edited,p_name); undo_redo->commit_action(); } } @@ -3835,7 +3945,7 @@ void PropertyEditor::_item_edited() { case Variant::INT: case Variant::REAL: { - if (hint==PROPERTY_HINT_ALL_FLAGS) + if (hint==PROPERTY_HINT_LAYERS_2D_PHYSICS || hint==PROPERTY_HINT_LAYERS_2D_RENDER || hint==PROPERTY_HINT_LAYERS_3D_PHYSICS || hint==PROPERTY_HINT_LAYERS_3D_RENDER) break; if (hint==PROPERTY_HINT_EXP_EASING) break; @@ -3876,10 +3986,10 @@ void PropertyEditor::_item_edited() { case Variant::QUAT: { } break; - case Variant::_AABB: { + case Variant::RECT3: { } break; - case Variant::MATRIX3: { + case Variant::BASIS: { } break; case Variant::TRANSFORM: { @@ -3905,22 +4015,22 @@ void PropertyEditor::_item_edited() { } break; // arrays - case Variant::RAW_ARRAY: { + case Variant::POOL_BYTE_ARRAY: { } break; - case Variant::INT_ARRAY: { + case Variant::POOL_INT_ARRAY: { } break; - case Variant::REAL_ARRAY: { + case Variant::POOL_REAL_ARRAY: { } break; - case Variant::STRING_ARRAY: { + case Variant::POOL_STRING_ARRAY: { } break; - case Variant::VECTOR3_ARRAY: { + case Variant::POOL_VECTOR3_ARRAY: { } break; - case Variant::COLOR_ARRAY: { + case Variant::POOL_COLOR_ARRAY: { } break; @@ -4043,6 +4153,11 @@ void PropertyEditor::_edit_button(Object *p_item, int p_column, int p_button) { return; } + if (obj->call("property_can_revert",prop).operator bool()) { + Variant rev = obj->call("property_get_revert",prop); + _edit_set(prop,rev); + } + if (!obj->get_script().is_null()) { Ref<Script> scr = obj->get_script(); Variant orig_value; @@ -4108,7 +4223,7 @@ void PropertyEditor::_edit_button(Object *p_item, int p_column, int p_button) { emit_signal("object_id_selected",obj->get(n)); print_line("OBJ ID SELECTED"); - } else if (t==Variant::ARRAY || t==Variant::INT_ARRAY || t==Variant::REAL_ARRAY || t==Variant::STRING_ARRAY || t==Variant::VECTOR2_ARRAY || t==Variant::VECTOR3_ARRAY || t==Variant::COLOR_ARRAY || t==Variant::RAW_ARRAY) { + } else if (t==Variant::ARRAY || t==Variant::POOL_INT_ARRAY || t==Variant::POOL_REAL_ARRAY || t==Variant::POOL_STRING_ARRAY || t==Variant::POOL_VECTOR2_ARRAY || t==Variant::POOL_VECTOR3_ARRAY || t==Variant::POOL_COLOR_ARRAY || t==Variant::POOL_BYTE_ARRAY) { Variant v = obj->get(n); @@ -4206,7 +4321,7 @@ void PropertyEditor::_resource_preview_done(const String& p_path,const Ref<Textu ERR_FAIL_COND(!ti); - int tw = EditorSettings::get_singleton()->get("property_editor/texture_preview_width"); + int tw = EditorSettings::get_singleton()->get("docks/property_editor/texture_preview_width"); ti->set_icon(1,p_preview); //should be scaled I think? ti->set_icon_max_width(1,tw); @@ -4214,24 +4329,24 @@ void PropertyEditor::_resource_preview_done(const String& p_path,const Ref<Textu } void PropertyEditor::_bind_methods() { - ObjectTypeDB::bind_method( "_item_edited",&PropertyEditor::_item_edited); - ObjectTypeDB::bind_method( "_item_selected",&PropertyEditor::_item_selected); - ObjectTypeDB::bind_method( "_custom_editor_request",&PropertyEditor::_custom_editor_request); - ObjectTypeDB::bind_method( "_custom_editor_edited",&PropertyEditor::_custom_editor_edited); - ObjectTypeDB::bind_method( "_resource_edit_request",&PropertyEditor::_resource_edit_request); - ObjectTypeDB::bind_method( "_node_removed",&PropertyEditor::_node_removed); - ObjectTypeDB::bind_method( "_edit_button",&PropertyEditor::_edit_button); - ObjectTypeDB::bind_method( "_changed_callback",&PropertyEditor::_changed_callbacks); - ObjectTypeDB::bind_method( "_draw_flags",&PropertyEditor::_draw_flags); - ObjectTypeDB::bind_method( "_set_range_def",&PropertyEditor::_set_range_def); - ObjectTypeDB::bind_method( "_filter_changed",&PropertyEditor::_filter_changed); - ObjectTypeDB::bind_method( "update_tree",&PropertyEditor::update_tree); - ObjectTypeDB::bind_method( "_resource_preview_done",&PropertyEditor::_resource_preview_done); - ObjectTypeDB::bind_method( "refresh",&PropertyEditor::refresh); - - ObjectTypeDB::bind_method(_MD("get_drag_data_fw"), &PropertyEditor::get_drag_data_fw); - ObjectTypeDB::bind_method(_MD("can_drop_data_fw"), &PropertyEditor::can_drop_data_fw); - ObjectTypeDB::bind_method(_MD("drop_data_fw"), &PropertyEditor::drop_data_fw); + ClassDB::bind_method( "_item_edited",&PropertyEditor::_item_edited); + ClassDB::bind_method( "_item_selected",&PropertyEditor::_item_selected); + ClassDB::bind_method( "_custom_editor_request",&PropertyEditor::_custom_editor_request); + ClassDB::bind_method( "_custom_editor_edited",&PropertyEditor::_custom_editor_edited); + ClassDB::bind_method( "_resource_edit_request",&PropertyEditor::_resource_edit_request); + ClassDB::bind_method( "_node_removed",&PropertyEditor::_node_removed); + ClassDB::bind_method( "_edit_button",&PropertyEditor::_edit_button); + ClassDB::bind_method( "_changed_callback",&PropertyEditor::_changed_callbacks); + ClassDB::bind_method( "_draw_flags",&PropertyEditor::_draw_flags); + ClassDB::bind_method( "_set_range_def",&PropertyEditor::_set_range_def); + ClassDB::bind_method( "_filter_changed",&PropertyEditor::_filter_changed); + ClassDB::bind_method( "update_tree",&PropertyEditor::update_tree); + ClassDB::bind_method( "_resource_preview_done",&PropertyEditor::_resource_preview_done); + ClassDB::bind_method( "refresh",&PropertyEditor::refresh); + + ClassDB::bind_method(_MD("get_drag_data_fw"), &PropertyEditor::get_drag_data_fw); + ClassDB::bind_method(_MD("can_drop_data_fw"), &PropertyEditor::can_drop_data_fw); + ClassDB::bind_method(_MD("drop_data_fw"), &PropertyEditor::drop_data_fw); ADD_SIGNAL( MethodInfo("property_toggled",PropertyInfo( Variant::STRING, "property"),PropertyInfo( Variant::BOOL, "value"))); ADD_SIGNAL( MethodInfo("resource_selected", PropertyInfo( Variant::OBJECT, "res"),PropertyInfo( Variant::STRING, "prop") ) ); @@ -4317,7 +4432,7 @@ void PropertyEditor::set_subsection_selectable(bool p_selectable) { PropertyEditor::PropertyEditor() { _prop_edited="property_edited"; - _prop_edited_name.push_back(String()); + undo_redo=NULL; obj=NULL; search_box=NULL; @@ -4379,7 +4494,7 @@ PropertyEditor::PropertyEditor() { use_doc_hints=false; use_filter=false; subsection_selectable=false; - show_type_icons=EDITOR_DEF("inspector/show_type_icons",false); + show_type_icons=EDITOR_DEF("interface/show_type_icons",false); } @@ -4398,10 +4513,11 @@ PropertyEditor::~PropertyEditor() class SectionedPropertyEditorFilter : public Object { - OBJ_TYPE( SectionedPropertyEditorFilter, Object ); + GDCLASS( SectionedPropertyEditorFilter, Object ); Object *edited; String section; + bool allow_sub; bool _set(const StringName& p_name, const Variant& p_value) { @@ -4415,6 +4531,7 @@ class SectionedPropertyEditorFilter : public Object { bool valid; edited->set(name,p_value,&valid); + //_change_notify(p_name.operator String().utf8().get_data()); return valid; } @@ -4446,25 +4563,48 @@ class SectionedPropertyEditorFilter : public Object { PropertyInfo pi=E->get(); int sp = pi.name.find("/"); - if (sp!=-1) { - String ss = pi.name.substr(0,sp); - if (ss==section) { - pi.name=pi.name.substr(sp+1,pi.name.length()); - p_list->push_back(pi); - } - } else { - if (section=="") - p_list->push_back(pi); + if (pi.name=="resource_path" || pi.name=="resource_name" || pi.name.begins_with("script/")) //skip resource stuff + continue; + + if (sp==-1) { + pi.name="Global/"+pi.name; + + } + + if (pi.name.begins_with(section+"/")) { + pi.name=pi.name.replace_first(section+"/",""); + if (!allow_sub && pi.name.find("/")!=-1) + continue; + p_list->push_back(pi); } } } + + bool property_can_revert(const String& p_name) { + + return edited->call("property_can_revert",section+"/"+p_name); + } + + Variant property_get_revert(const String& p_name) { + + return edited->call("property_get_revert",section+"/"+p_name); + } + +protected: + static void _bind_methods() { + + ClassDB::bind_method("property_can_revert",&SectionedPropertyEditorFilter::property_can_revert); + ClassDB::bind_method("property_get_revert",&SectionedPropertyEditorFilter::property_get_revert); + } + public: - void set_section(const String& p_section) { + void set_section(const String& p_section,bool p_allow_sub) { section=p_section; + allow_sub=p_allow_sub; _change_notify(); } @@ -4482,36 +4622,30 @@ public: void SectionedPropertyEditor::_bind_methods() { - ObjectTypeDB::bind_method("_section_selected",&SectionedPropertyEditor::_section_selected); + ClassDB::bind_method("_section_selected",&SectionedPropertyEditor::_section_selected); - ObjectTypeDB::bind_method("update_category_list", &SectionedPropertyEditor::update_category_list); + ClassDB::bind_method("update_category_list", &SectionedPropertyEditor::update_category_list); } -void SectionedPropertyEditor::_section_selected(int p_which) { +void SectionedPropertyEditor::_section_selected() { - filter->set_section( sections->get_item_metadata(p_which) ); + if (!sections->get_selected()) + return; + + filter->set_section( sections->get_selected()->get_metadata(0), sections->get_selected()->get_children()==NULL); } void SectionedPropertyEditor::set_current_section(const String& p_section) { - int section_idx = sections->find_metadata(p_section); - - if (section_idx==sections->get_current()) - return; - - if (section_idx!=-1) { - sections->select(section_idx); - _section_selected(section_idx); - } else if (sections->get_item_count()) { - sections->select(0); - _section_selected(0); + if (section_map.has(p_section)) { + section_map[p_section]->select(0);; } } String SectionedPropertyEditor::get_current_section() const { - if (sections->get_current()!=-1) - return sections->get_item_metadata( sections->get_current() ); + if (sections->get_selected()) + return sections->get_selected()->get_metadata(0); else return ""; } @@ -4548,8 +4682,9 @@ void SectionedPropertyEditor::edit(Object* p_object) { filter->set_edited(p_object); editor->edit(filter); - sections->select(0); - _section_selected(0); + if (sections->get_root()->get_children()) { + sections->get_root()->get_children()->select(0); + } } else { update_category_list(); @@ -4569,7 +4704,12 @@ void SectionedPropertyEditor::update_category_list() { List<PropertyInfo> pinfo; o->get_property_list(&pinfo); - Set<String> existing_sections; + section_map.clear(); + + TreeItem *root = sections->create_item(); + section_map[""]=root; + + for (List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) { PropertyInfo pi=E->get(); @@ -4579,27 +4719,41 @@ void SectionedPropertyEditor::update_category_list() { else if ( !(pi.usage&PROPERTY_USAGE_EDITOR) ) continue; - if (pi.name.find(":")!=-1 || pi.name=="script/script" || pi.name.begins_with("resource/")) + if (pi.name.find(":")!=-1 || pi.name=="script/script" || pi.name=="resource_name" || pi.name=="resource_path") continue; int sp = pi.name.find("/"); - if (sp!=-1) { - String sname=pi.name.substr(0,sp); - if (!existing_sections.has(sname)) { - existing_sections.insert(sname); - sections->add_item(sname.capitalize()); - sections->set_item_metadata(sections->get_item_count()-1,sname); + if (sp==-1) + pi.name="Global/"+pi.name; + + Vector<String> sectionarr = pi.name.split("/"); + String metasection; + + + for(int i=0;i<MIN(2,sectionarr.size()-1);i++) { + + TreeItem *parent = section_map[metasection]; + + if (i>0) { + metasection+="/"+sectionarr[i]; + } else { + metasection=sectionarr[i]; } - } else { - if (!existing_sections.has("")) { - existing_sections.insert(""); - sections->add_item(TTR("Global")); - sections->set_item_metadata(sections->get_item_count()-1,""); + + if (!section_map.has(metasection)) { + TreeItem *ms = sections->create_item(parent); + section_map[metasection]=ms; + ms->set_text(0,sectionarr[i].capitalize()); + ms->set_metadata(0,metasection); + } } + } - set_current_section(selected_category); + if (section_map.has(selected_category)) { + section_map[selected_category]->select(0); + } } PropertyEditor *SectionedPropertyEditor::get_property_editor() { @@ -4615,8 +4769,9 @@ SectionedPropertyEditor::SectionedPropertyEditor() { left_vb->set_custom_minimum_size(Size2(160,0)*EDSCALE); add_child(left_vb); - sections = memnew( ItemList ); + sections = memnew( Tree ); sections->set_v_size_flags(SIZE_EXPAND_FILL); + sections->set_hide_root(true); left_vb->add_margin_child(TTR("Sections:"),sections,true); @@ -4634,7 +4789,7 @@ SectionedPropertyEditor::SectionedPropertyEditor() { editor->hide_top_label(); - sections->connect("item_selected",this,"_section_selected"); + sections->connect("cell_selected",this,"_section_selected"); } diff --git a/tools/editor/property_editor.h b/tools/editor/property_editor.h index 3fe332bf87..8f429ab979 100644 --- a/tools/editor/property_editor.h +++ b/tools/editor/property_editor.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -41,6 +41,7 @@ #include "scene/gui/text_edit.h" #include "scene/gui/check_button.h" #include "scene/gui/split_container.h" +#include "scene/gui/grid_container.h" #include "scene_tree_editor.h" /** @@ -53,7 +54,7 @@ class PropertySelector; class CustomPropertyEditor : public Popup { - OBJ_TYPE( CustomPropertyEditor, Popup ); + GDCLASS( CustomPropertyEditor, Popup ); enum { MAX_VALUE_EDITORS=12, @@ -99,6 +100,8 @@ class CustomPropertyEditor : public Popup { ColorPicker *color_picker; TextEdit *text_edit; bool read_only; + bool picking_viewport; + GridContainer *checks20gc; CheckBox *checks20[20]; SpinBox *spinbox; HSlider *slider; @@ -163,7 +166,7 @@ public: class PropertyEditor : public Control { - OBJ_TYPE( PropertyEditor, Control ); + GDCLASS( PropertyEditor, Control ); Tree *tree; Label *top_label; @@ -174,7 +177,7 @@ class PropertyEditor : public Control { Object* obj; - Array _prop_edited_name; + StringName _prop_edited; bool capitalize_paths; @@ -219,6 +222,8 @@ class PropertyEditor : public Control { void _edit_button(Object *p_item, int p_column, int p_button); void _node_removed(Node *p_node); + +friend class ProjectExportDialog; void _edit_set(const String& p_name, const Variant& p_value); void _draw_flags(Object *ti,const Rect2& p_rect); @@ -287,17 +292,19 @@ class SectionedPropertyEditorFilter; class SectionedPropertyEditor : public HBoxContainer { - OBJ_TYPE(SectionedPropertyEditor,HBoxContainer); + GDCLASS(SectionedPropertyEditor,HBoxContainer); ObjectID obj; - ItemList *sections; + Tree *sections; SectionedPropertyEditorFilter *filter; + + Map<String,TreeItem*> section_map; PropertyEditor *editor; static void _bind_methods(); - void _section_selected(int p_which); + void _section_selected(); public: @@ -315,7 +322,7 @@ public: }; class PropertyValueEvaluator : public ValueEvaluator { - OBJ_TYPE( PropertyValueEvaluator, ValueEvaluator ); + GDCLASS( PropertyValueEvaluator, ValueEvaluator ); Object *obj; ScriptLanguage *script_language; diff --git a/tools/editor/property_selector.cpp b/tools/editor/property_selector.cpp index 20b72240d9..3d9695ac2a 100644 --- a/tools/editor/property_selector.cpp +++ b/tools/editor/property_selector.cpp @@ -18,7 +18,7 @@ void PropertySelector::_sbox_input(const InputEvent& p_ie) { case KEY_PAGEUP: case KEY_PAGEDOWN: { - search_options->call("_input_event", p_ie); + search_options->call("_gui_input", p_ie); search_box->accept_event(); TreeItem *root = search_options->get_root(); @@ -87,8 +87,8 @@ void PropertySelector::_update_search() { StringName base=base_type; while(base) { props.push_back(PropertyInfo(Variant::NIL,base,PROPERTY_HINT_NONE,"",PROPERTY_USAGE_CATEGORY)); - ObjectTypeDB::get_property_list(base,&props,true); - base=ObjectTypeDB::type_inherits_from(base); + ClassDB::get_property_list(base,&props,true); + base=ClassDB::get_parent_class(base); } } @@ -194,8 +194,8 @@ void PropertySelector::_update_search() { StringName base=base_type; while(base) { methods.push_back(MethodInfo("*"+String(base))); - ObjectTypeDB::get_method_list(base,&methods,true); - base=ObjectTypeDB::type_inherits_from(base); + ClassDB::get_method_list(base,&methods,true); + base=ClassDB::get_parent_class(base); } } @@ -321,8 +321,8 @@ void PropertySelector::_item_selected() { case InputEvent::KEY: class_type="InputEventKey"; break; case InputEvent::MOUSE_MOTION: class_type="InputEventMouseMotion"; break; case InputEvent::MOUSE_BUTTON: class_type="InputEventMouseButton"; break; - case InputEvent::JOYSTICK_MOTION: class_type="InputEventJoystickMotion"; break; - case InputEvent::JOYSTICK_BUTTON: class_type="InputEventJoystickButton"; break; + case InputEvent::JOYPAD_MOTION: class_type="InputEventJoypadMotion"; break; + case InputEvent::JOYPAD_BUTTON: class_type="InputEventJoypadButton"; break; case InputEvent::SCREEN_TOUCH: class_type="InputEventScreenTouch"; break; case InputEvent::SCREEN_DRAG: class_type="InputEventScreenDrag"; break; case InputEvent::ACTION: class_type="InputEventAction"; break; @@ -358,14 +358,14 @@ void PropertySelector::_item_selected() { } } - at_class=ObjectTypeDB::type_inherits_from(at_class); + at_class=ClassDB::get_parent_class(at_class); } if (text==String()) { StringName setter; StringName type; - if (ObjectTypeDB::get_setter_and_type_for_property(class_type,name,type,setter)) { + if (ClassDB::get_setter_and_type_for_property(class_type,name,type,setter)) { Map<String,DocData::ClassDoc>::Element *E=dd->class_list.find(type); if (E) { for(int i=0;i<E->get().methods.size();i++) { @@ -395,7 +395,7 @@ void PropertySelector::_item_selected() { } } - at_class=ObjectTypeDB::type_inherits_from(at_class); + at_class=ClassDB::get_parent_class(at_class); } } @@ -470,7 +470,7 @@ void PropertySelector::select_method_from_basic_type(Variant::Type p_type, const void PropertySelector::select_method_from_instance(Object* p_instance, const String &p_current){ - base_type=p_instance->get_type(); + base_type=p_instance->get_class(); selected=p_current; type=Variant::NIL; script=0; @@ -559,10 +559,10 @@ void PropertySelector::select_property_from_instance(Object* p_instance, const S void PropertySelector::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_text_changed"),&PropertySelector::_text_changed); - ObjectTypeDB::bind_method(_MD("_confirmed"),&PropertySelector::_confirmed); - ObjectTypeDB::bind_method(_MD("_sbox_input"),&PropertySelector::_sbox_input); - ObjectTypeDB::bind_method(_MD("_item_selected"),&PropertySelector::_item_selected); + ClassDB::bind_method(_MD("_text_changed"),&PropertySelector::_text_changed); + ClassDB::bind_method(_MD("_confirmed"),&PropertySelector::_confirmed); + ClassDB::bind_method(_MD("_sbox_input"),&PropertySelector::_sbox_input); + ClassDB::bind_method(_MD("_item_selected"),&PropertySelector::_item_selected); ADD_SIGNAL(MethodInfo("selected",PropertyInfo(Variant::STRING,"name"))); @@ -574,11 +574,11 @@ PropertySelector::PropertySelector() { VBoxContainer *vbc = memnew( VBoxContainer ); add_child(vbc); - set_child_rect(vbc); + //set_child_rect(vbc); search_box = memnew( LineEdit ); vbc->add_margin_child(TTR("Search:"),search_box); search_box->connect("text_changed",this,"_text_changed"); - search_box->connect("input_event",this,"_sbox_input"); + search_box->connect("gui_input",this,"_sbox_input"); search_options = memnew( Tree ); vbc->add_margin_child(TTR("Matches:"),search_options,true); get_ok()->set_text(TTR("Open")); diff --git a/tools/editor/property_selector.h b/tools/editor/property_selector.h index f7f0e7e167..4823d50e0f 100644 --- a/tools/editor/property_selector.h +++ b/tools/editor/property_selector.h @@ -6,7 +6,7 @@ #include "editor_help.h" class PropertySelector : public ConfirmationDialog { - OBJ_TYPE(PropertySelector,ConfirmationDialog ) + GDCLASS(PropertySelector,ConfirmationDialog ) LineEdit *search_box; diff --git a/tools/editor/pvrtc_compress.cpp b/tools/editor/pvrtc_compress.cpp index 75b5c69bc2..7f84d8d00e 100644 --- a/tools/editor/pvrtc_compress.cpp +++ b/tools/editor/pvrtc_compress.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -38,7 +38,7 @@ static void (*_base_image_compress_pvrtc4_func)(Image *)=NULL; static void _compress_image(Image::CompressMode p_mode,Image *p_image) { - String ttpath = EditorSettings::get_singleton()->get("PVRTC/texture_tool"); + String ttpath = EditorSettings::get_singleton()->get("filesystem/import/pvrtc_texture_tool"); if (ttpath.strip_edges()=="" || !FileAccess::exists(ttpath)) { switch(p_mode) { @@ -82,10 +82,10 @@ static void _compress_image(Image::CompressMode p_mode,Image *p_image) { } - if (EditorSettings::get_singleton()->get("PVRTC/fast_conversion").operator bool()) { + if (EditorSettings::get_singleton()->get("filesystem/import/pvrtc_fast_conversion").operator bool()) { args.push_back("-pvrtcfast"); } - if (p_image->get_mipmaps()>0) + if (p_image->has_mipmaps()) args.push_back("-m"); Ref<ImageTexture> t = memnew( ImageTexture ); diff --git a/tools/editor/pvrtc_compress.h b/tools/editor/pvrtc_compress.h index 129faee080..4ba29026c5 100644 --- a/tools/editor/pvrtc_compress.h +++ b/tools/editor/pvrtc_compress.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/quick_open.cpp b/tools/editor/quick_open.cpp index e18dc584d5..ff5ecdf01b 100644 --- a/tools/editor/quick_open.cpp +++ b/tools/editor/quick_open.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -86,7 +86,7 @@ void EditorQuickOpen::_sbox_input(const InputEvent& p_ie) { case KEY_PAGEUP: case KEY_PAGEDOWN: { - search_options->call("_input_event", p_ie); + search_options->call("_gui_input", p_ie); search_box->accept_event(); TreeItem *root = search_options->get_root(); @@ -166,7 +166,7 @@ void EditorQuickOpen::_parse_fs(EditorFileSystemDirectory *efsd, Vector< Pair< S String file = efsd->get_file_path(i); file=file.substr(6,file.length()); - if (ObjectTypeDB::is_type(efsd->get_file_type(i),base_type) && (search_text.is_subsequence_ofi(file))) { + if (ClassDB::is_parent_class(efsd->get_file_type(i),base_type) && (search_text.is_subsequence_ofi(file))) { Pair< String, Ref<Texture> > pair; pair.first = file; pair.second = get_icon((has_icon(efsd->get_file_type(i), ei) ? efsd->get_file_type(i) : ot), ei); @@ -252,9 +252,9 @@ StringName EditorQuickOpen::get_base_type() const { void EditorQuickOpen::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_text_changed"),&EditorQuickOpen::_text_changed); - ObjectTypeDB::bind_method(_MD("_confirmed"),&EditorQuickOpen::_confirmed); - ObjectTypeDB::bind_method(_MD("_sbox_input"),&EditorQuickOpen::_sbox_input); + ClassDB::bind_method(_MD("_text_changed"),&EditorQuickOpen::_text_changed); + ClassDB::bind_method(_MD("_confirmed"),&EditorQuickOpen::_confirmed); + ClassDB::bind_method(_MD("_sbox_input"),&EditorQuickOpen::_sbox_input); ADD_SIGNAL(MethodInfo("quick_open")); @@ -266,11 +266,11 @@ EditorQuickOpen::EditorQuickOpen() { VBoxContainer *vbc = memnew( VBoxContainer ); add_child(vbc); - set_child_rect(vbc); + //set_child_rect(vbc); search_box = memnew( LineEdit ); vbc->add_margin_child(TTR("Search:"),search_box); search_box->connect("text_changed",this,"_text_changed"); - search_box->connect("input_event",this,"_sbox_input"); + search_box->connect("gui_input",this,"_sbox_input"); search_options = memnew( Tree ); vbc->add_margin_child(TTR("Matches:"),search_options,true); get_ok()->set_text(TTR("Open")); diff --git a/tools/editor/quick_open.h b/tools/editor/quick_open.h index c253f7606e..ef91d910b1 100644 --- a/tools/editor/quick_open.h +++ b/tools/editor/quick_open.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -35,7 +35,7 @@ #include "pair.h" class EditorQuickOpen : public ConfirmationDialog { - OBJ_TYPE(EditorQuickOpen,ConfirmationDialog ) + GDCLASS(EditorQuickOpen,ConfirmationDialog ) LineEdit *search_box; Tree *search_options; diff --git a/tools/editor/register_exporters.h b/tools/editor/register_exporters.h index dccaa0641f..30ec522a00 100644 --- a/tools/editor/register_exporters.h +++ b/tools/editor/register_exporters.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/editor/reparent_dialog.cpp b/tools/editor/reparent_dialog.cpp index 38b0372232..a8909b0772 100644 --- a/tools/editor/reparent_dialog.cpp +++ b/tools/editor/reparent_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -75,8 +75,8 @@ void ReparentDialog::set_current(const Set<Node*>& p_selection) { void ReparentDialog::_bind_methods() { - ObjectTypeDB::bind_method("_reparent",&ReparentDialog::_reparent); - ObjectTypeDB::bind_method("_cancel",&ReparentDialog::_cancel); + ClassDB::bind_method("_reparent",&ReparentDialog::_reparent); + ClassDB::bind_method("_cancel",&ReparentDialog::_cancel); ADD_SIGNAL( MethodInfo("reparent",PropertyInfo(Variant::NODE_PATH,"path"),PropertyInfo(Variant::BOOL,"keep_global_xform"))); } @@ -88,7 +88,7 @@ ReparentDialog::ReparentDialog() { VBoxContainer *vbc = memnew( VBoxContainer ); add_child(vbc); - set_child_rect(vbc); +// set_child_rect(vbc); tree = memnew( SceneTreeEditor(false) ); tree->set_show_enabled_subscene(true); diff --git a/tools/editor/reparent_dialog.h b/tools/editor/reparent_dialog.h index 1c0fbd2459..5e21f84581 100644 --- a/tools/editor/reparent_dialog.h +++ b/tools/editor/reparent_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -40,7 +40,7 @@ */ class ReparentDialog : public ConfirmationDialog { - OBJ_TYPE( ReparentDialog, ConfirmationDialog ); + GDCLASS( ReparentDialog, ConfirmationDialog ); SceneTreeEditor *tree; CheckBox *keep_transform; diff --git a/tools/editor/resources_dock.cpp b/tools/editor/resources_dock.cpp index c73c8c081c..c8fa1eda77 100644 --- a/tools/editor/resources_dock.cpp +++ b/tools/editor/resources_dock.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -129,7 +129,7 @@ void ResourcesDock::save_resource(const String& p_path,const Ref<Resource>& p_re //if (EditorSettings::get_singleton()->get("on_save/save_paths_as_relative")) // flg|=ResourceSaver::FLAG_RELATIVE_PATHS; - String path = Globals::get_singleton()->localize_path(p_path); + String path = GlobalConfig::get_singleton()->localize_path(p_path); Error err = ResourceSaver::save(path,p_resource,flg|ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS); if (err!=OK) { @@ -161,7 +161,7 @@ void ResourcesDock::save_resource_as(const Ref<Resource>& p_resource) { String existing; if (extensions.size()) { - existing="new_"+res->get_type().to_lower()+"."+extensions.front()->get().to_lower(); + existing="new_"+res->get_class().to_lower()+"."+extensions.front()->get().to_lower(); } file->set_current_file(existing); @@ -214,7 +214,7 @@ void ResourcesDock::_update_name(TreeItem *item) { else if (res->get_path()!="" && res->get_path().find("::")==-1) item->set_text(0,res->get_path().get_file()); else - item->set_text(0,res->get_type()+" ("+itos(res->get_instance_ID())+")"); + item->set_text(0,res->get_class()+" ("+itos(res->get_instance_ID())+")"); } @@ -267,8 +267,8 @@ void ResourcesDock::add_resource(const Ref<Resource>& p_resource) { TreeItem *res = resources->create_item(root); res->set_metadata(0,p_resource); - if (has_icon(p_resource->get_type(),"EditorIcons")) { - res->set_icon(0,get_icon(p_resource->get_type(),"EditorIcons")); + if (has_icon(p_resource->get_class(),"EditorIcons")) { + res->set_icon(0,get_icon(p_resource->get_class(),"EditorIcons")); } _update_name(res); @@ -319,12 +319,12 @@ void ResourcesDock::_create() { void ResourcesDock::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_tool_selected"),&ResourcesDock::_tool_selected); - ObjectTypeDB::bind_method(_MD("_create"),&ResourcesDock::_create); - ObjectTypeDB::bind_method(_MD("_resource_selected"),&ResourcesDock::_resource_selected); - ObjectTypeDB::bind_method(_MD("_delete"),&ResourcesDock::_delete); - ObjectTypeDB::bind_method(_MD("remove_resource"),&ResourcesDock::remove_resource); - ObjectTypeDB::bind_method(_MD("_file_action"),&ResourcesDock::_file_action); + ClassDB::bind_method(_MD("_tool_selected"),&ResourcesDock::_tool_selected); + ClassDB::bind_method(_MD("_create"),&ResourcesDock::_create); + ClassDB::bind_method(_MD("_resource_selected"),&ResourcesDock::_resource_selected); + ClassDB::bind_method(_MD("_delete"),&ResourcesDock::_delete); + ClassDB::bind_method(_MD("remove_resource"),&ResourcesDock::remove_resource); + ClassDB::bind_method(_MD("_file_action"),&ResourcesDock::_file_action); @@ -366,7 +366,7 @@ ResourcesDock::ResourcesDock(EditorNode *p_editor) { mb->set_tooltip(TTR("Save Resource")); mb->get_popup()->add_item(TTR("Save Resource"),TOOL_SAVE); mb->get_popup()->add_item(TTR("Save Resource As.."),TOOL_SAVE_AS); - mb->get_popup()->connect("item_pressed",this,"_tool_selected" ); + mb->get_popup()->connect("id_pressed",this,"_tool_selected" ); hbc->add_child( mb ); button_save=mb; @@ -377,7 +377,7 @@ ResourcesDock::ResourcesDock(EditorNode *p_editor) { mb->get_popup()->add_item(TTR("Make Local"),TOOL_MAKE_LOCAL); mb->get_popup()->add_item(TTR("Copy"),TOOL_COPY); mb->get_popup()->add_item(TTR("Paste"),TOOL_PASTE); - mb->get_popup()->connect("item_pressed",this,"_tool_selected" ); + mb->get_popup()->connect("id_pressed",this,"_tool_selected" ); hbc->add_child( mb ); button_tools=mb; diff --git a/tools/editor/resources_dock.h b/tools/editor/resources_dock.h index 978291fc3f..e225786583 100644 --- a/tools/editor/resources_dock.h +++ b/tools/editor/resources_dock.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -45,7 +45,7 @@ class EditorNode; class ResourcesDock : public VBoxContainer { - OBJ_TYPE( ResourcesDock, VBoxContainer ); + GDCLASS( ResourcesDock, VBoxContainer ); enum { TOOL_NEW, diff --git a/tools/editor/run_settings_dialog.cpp b/tools/editor/run_settings_dialog.cpp index abcfe125f3..4d69c7ad84 100644 --- a/tools/editor/run_settings_dialog.cpp +++ b/tools/editor/run_settings_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -47,8 +47,8 @@ String RunSettingsDialog::get_custom_arguments() const { void RunSettingsDialog::_bind_methods() { - ObjectTypeDB::bind_method("_run_mode_changed",&RunSettingsDialog::_run_mode_changed); - //ObjectTypeDB::bind_method("_browse_selected_file",&RunSettingsDialog::_browse_selected_file); + ClassDB::bind_method("_run_mode_changed",&RunSettingsDialog::_run_mode_changed); + //ClassDB::bind_method("_browse_selected_file",&RunSettingsDialog::_browse_selected_file); } void RunSettingsDialog::_run_mode_changed(int idx) { @@ -76,7 +76,7 @@ RunSettingsDialog::RunSettingsDialog() { VBoxContainer *vbc = memnew( VBoxContainer ); add_child(vbc); - set_child_rect(vbc); + //set_child_rect(vbc); run_mode = memnew( OptionButton ); vbc->add_margin_child(TTR("Run Mode:"),run_mode); diff --git a/tools/editor/run_settings_dialog.h b/tools/editor/run_settings_dialog.h index 09319702f3..2efc18e43f 100644 --- a/tools/editor/run_settings_dialog.h +++ b/tools/editor/run_settings_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ class RunSettingsDialog : public AcceptDialog { - OBJ_TYPE( RunSettingsDialog, AcceptDialog); + GDCLASS( RunSettingsDialog, AcceptDialog); public: enum RunMode { RUN_LOCAL_SCENE, diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp index b9cce34454..c171c49c7b 100644 --- a/tools/editor/scene_tree_dock.cpp +++ b/tools/editor/scene_tree_dock.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -80,11 +80,8 @@ void SceneTreeDock::_unhandled_key_input(InputEvent p_event) { else if (ED_IS_SHORTCUT("scene_tree/duplicate", p_event)) { _tool_selected(TOOL_DUPLICATE); } - else if (ED_IS_SHORTCUT("scene_tree/add_script", p_event)) { - _tool_selected(TOOL_CREATE_SCRIPT); - } - else if (ED_IS_SHORTCUT("scene_tree/load_script", p_event)) { - _tool_selected(TOOL_LOAD_SCRIPT); + else if (ED_IS_SHORTCUT("scene_tree/attach_script", p_event)) { + _tool_selected(TOOL_ATTACH_SCRIPT); } else if(ED_IS_SHORTCUT("scene_tree/clear_script", p_event)) { _tool_selected(TOOL_CLEAR_SCRIPT); @@ -177,7 +174,7 @@ void SceneTreeDock::_perform_instance_scenes(const Vector<String>& p_files,Node* } - Node*instanced_scene=sdata->instance(true); + Node*instanced_scene=sdata->instance(PackedScene::GEN_EDIT_STATE_INSTANCE); if (!instanced_scene) { current_option=-1; //accept->get_cancel()->hide(); @@ -201,7 +198,7 @@ void SceneTreeDock::_perform_instance_scenes(const Vector<String>& p_files,Node* } } - instanced_scene->set_filename( Globals::get_singleton()->localize_path(p_files[i]) ); + instanced_scene->set_filename( GlobalConfig::get_singleton()->localize_path(p_files[i]) ); instances.push_back(instanced_scene); } @@ -253,7 +250,7 @@ void SceneTreeDock::_replace_with_branch_scene(const String& p_file,Node* base) return; } - Node *instanced_scene=sdata->instance(true); + Node *instanced_scene=sdata->instance(PackedScene::GEN_EDIT_STATE_INSTANCE); if (!instanced_scene) { accept->get_ok()->set_text(TTR("Ugh")); accept->set_text(vformat(TTR("Error instancing scene from %s"),p_file)); @@ -272,24 +269,6 @@ void SceneTreeDock::_replace_with_branch_scene(const String& p_file,Node* base) scene_tree->set_selected(instanced_scene); } - -void SceneTreeDock::_file_selected(String p_file) { - RES p_script = ResourceLoader::load(p_file, "Script"); - if (p_script.is_null()) { - accept->get_ok()->set_text(TTR("Ugh")); - accept->set_text(vformat(TTR("Error loading script from %s"), p_file)); - accept->popup_centered_minsize(); - return; - } - - Node *selected = scene_tree->get_selected(); - if (!selected) - return; - selected->set_script(p_script.get_ref_ptr()); - editor->push_item(p_script.operator->()); - file_dialog->hide(); -} - bool SceneTreeDock::_cyclical_dependency_exists(const String& p_target_scene_path, Node* p_desired_node) { int childCount = p_desired_node->get_child_count(); @@ -382,22 +361,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { //groups_editor->set_current(current); //groups_editor->popup_centered_ratio(); } break; - case TOOL_LOAD_SCRIPT: { - Node *selected = scene_tree->get_selected(); - if (!selected) - break; - - file_dialog->set_mode(EditorFileDialog::MODE_OPEN_FILE); - - List<String> extensions; - ResourceLoader::get_recognized_extensions_for_type("Script", &extensions); - file_dialog->clear_filters(); - for (List<String>::Element *E = extensions.front(); E; E = E->next()) - file_dialog->add_filter("*." + E->get() + " ; " + E->get().to_upper()); - - file_dialog->popup_centered_ratio(); - } break; - case TOOL_CREATE_SCRIPT: { + case TOOL_ATTACH_SCRIPT: { Node *selected = scene_tree->get_selected(); if (!selected) @@ -411,7 +375,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { editor->push_item(existing.ptr()); else { String path = selected->get_filename(); - script_create_dialog->config(selected->get_type(),path); + script_create_dialog->config(selected->get_class(),path); script_create_dialog->popup_centered(Size2(300,290)); //script_create_dialog->popup_centered_minsize(); @@ -725,7 +689,6 @@ void SceneTreeDock::_notification(int p_what) { button_add->set_icon(get_icon("Add","EditorIcons")); button_instance->set_icon(get_icon("Instance","EditorIcons")); button_create_script->set_icon(get_icon("ScriptCreate","EditorIcons")); - button_load_script->set_icon(get_icon("Script", "EditorIcons")); button_clear_script->set_icon(get_icon("Remove", "EditorIcons")); @@ -781,11 +744,11 @@ Node *SceneTreeDock::_duplicate(Node *p_node, Map<Node*,Node*> &duplimap) { Ref<PackedScene> sd = ResourceLoader::load( p_node->get_filename() ); ERR_FAIL_COND_V(!sd.is_valid(),NULL); - node = sd->instance(true); + node = sd->instance(PackedScene::GEN_EDIT_STATE_INSTANCE); ERR_FAIL_COND_V(!node,NULL); //node->generate_instance_state(); } else { - Object *obj = ObjectTypeDB::instance(p_node->get_type()); + Object *obj = ClassDB::instance(p_node->get_class()); ERR_FAIL_COND_V(!obj,NULL); node = obj->cast_to<Node>(); if (!node) @@ -883,7 +846,7 @@ void SceneTreeDock::_fill_path_renames(Vector<StringName> base_path,Vector<Strin void SceneTreeDock::fill_path_renames(Node* p_node, Node *p_new_parent, List<Pair<NodePath,NodePath> > *p_renames) { - if (!bool(EDITOR_DEF("animation/autorename_animation_tracks",true))) + if (!bool(EDITOR_DEF("editors/animation/autorename_animation_tracks",true))) return; @@ -916,7 +879,7 @@ void SceneTreeDock::perform_node_renames(Node* p_base,List<Pair<NodePath,NodePat if (!r_rem_anims) r_rem_anims=&rem_anims; - if (!bool(EDITOR_DEF("animation/autorename_animation_tracks",true))) + if (!bool(EDITOR_DEF("editors/animation/autorename_animation_tracks",true))) return; if (!p_base) { @@ -1359,17 +1322,14 @@ void SceneTreeDock::_selection_changed() { if (selection_size==1) { if(EditorNode::get_singleton()->get_editor_selection()->get_selection().front()->key()->get_script().is_null()) { button_create_script->show(); - button_load_script->show(); button_clear_script->hide(); } else { button_create_script->hide(); - button_load_script->hide(); button_clear_script->show(); } } else { button_create_script->hide(); - button_load_script->hide(); button_clear_script->hide(); } @@ -1418,7 +1378,7 @@ void SceneTreeDock::_create() { String new_name = parent->validate_child_name(child); ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger(); - editor_data->get_undo_redo().add_do_method(sed,"live_debug_create_node",edited_scene->get_path_to(parent),child->get_type(),new_name); + editor_data->get_undo_redo().add_do_method(sed,"live_debug_create_node",edited_scene->get_path_to(parent),child->get_class(),new_name); editor_data->get_undo_redo().add_undo_method(sed,"live_debug_remove_node",NodePath(String(edited_scene->get_path_to(parent))+"/"+new_name)); } else { @@ -1594,9 +1554,9 @@ void SceneTreeDock::_new_scene_from(String p_file) { } int flg=0; - if (EditorSettings::get_singleton()->get("on_save/compress_binary_resources")) + if (EditorSettings::get_singleton()->get("filesystem/on_save/compress_binary_resources")) flg|=ResourceSaver::FLAG_COMPRESS; - //if (EditorSettings::get_singleton()->get("on_save/save_paths_as_relative")) + //if (EditorSettings::get_singleton()->get("filesystem/on_save/save_paths_as_relative")) // flg|=ResourceSaver::FLAG_RELATIVE_PATHS; @@ -1823,8 +1783,7 @@ void SceneTreeDock::_tree_rmb(const Vector2& p_menu_pos) { //menu->add_icon_item(get_icon("Groups","EditorIcons"),TTR("Edit Groups"),TOOL_GROUP); //menu->add_icon_item(get_icon("Connect","EditorIcons"),TTR("Edit Connections"),TOOL_CONNECT); menu->add_separator(); - menu->add_icon_shortcut(get_icon("ScriptCreate", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/add_script"), TOOL_CREATE_SCRIPT); - menu->add_icon_shortcut(get_icon("Script", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/load_script"), TOOL_LOAD_SCRIPT); + menu->add_icon_shortcut(get_icon("ScriptCreate", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/attach_script"), TOOL_ATTACH_SCRIPT); menu->add_icon_shortcut(get_icon("Remove", "EditorIcons"), ED_GET_SHORTCUT("scene_tree/clear_script"), TOOL_CLEAR_SCRIPT); menu->add_separator(); } @@ -1872,7 +1831,7 @@ void SceneTreeDock::_focus_node() { Node *node = scene_tree->get_selected(); ERR_FAIL_COND(!node); - if (node->is_type("CanvasItem")) { + if (node->is_class("CanvasItem")) { CanvasItemEditorPlugin *editor = editor_data->get_editor("2D")->cast_to<CanvasItemEditorPlugin>(); editor->get_canvas_item_editor()->focus_selection(); } else { @@ -1884,39 +1843,38 @@ void SceneTreeDock::_focus_node() { void SceneTreeDock::open_script_dialog(Node* p_for_node) { scene_tree->set_selected(p_for_node,false); - _tool_selected(TOOL_CREATE_SCRIPT); + _tool_selected(TOOL_ATTACH_SCRIPT); } void SceneTreeDock::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_tool_selected"),&SceneTreeDock::_tool_selected,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("_create"),&SceneTreeDock::_create); - //ObjectTypeDB::bind_method(_MD("_script_created"),&SceneTreeDock::_script_created); - ObjectTypeDB::bind_method(_MD("_node_reparent"),&SceneTreeDock::_node_reparent); - ObjectTypeDB::bind_method(_MD("_set_owners"),&SceneTreeDock::_set_owners); - ObjectTypeDB::bind_method(_MD("_node_selected"),&SceneTreeDock::_node_selected); - ObjectTypeDB::bind_method(_MD("_node_renamed"),&SceneTreeDock::_node_renamed); - ObjectTypeDB::bind_method(_MD("_script_created"),&SceneTreeDock::_script_created); - ObjectTypeDB::bind_method(_MD("_load_request"),&SceneTreeDock::_load_request); - ObjectTypeDB::bind_method(_MD("_script_open_request"),&SceneTreeDock::_script_open_request); - ObjectTypeDB::bind_method(_MD("_unhandled_key_input"),&SceneTreeDock::_unhandled_key_input); - ObjectTypeDB::bind_method(_MD("_input"),&SceneTreeDock::_input); - ObjectTypeDB::bind_method(_MD("_nodes_drag_begin"),&SceneTreeDock::_nodes_drag_begin); - ObjectTypeDB::bind_method(_MD("_delete_confirm"),&SceneTreeDock::_delete_confirm); - ObjectTypeDB::bind_method(_MD("_node_prerenamed"),&SceneTreeDock::_node_prerenamed); - ObjectTypeDB::bind_method(_MD("_import_subscene"),&SceneTreeDock::_import_subscene); - ObjectTypeDB::bind_method(_MD("_selection_changed"),&SceneTreeDock::_selection_changed); - ObjectTypeDB::bind_method(_MD("_new_scene_from"),&SceneTreeDock::_new_scene_from); - ObjectTypeDB::bind_method(_MD("_nodes_dragged"),&SceneTreeDock::_nodes_dragged); - ObjectTypeDB::bind_method(_MD("_files_dropped"),&SceneTreeDock::_files_dropped); - ObjectTypeDB::bind_method(_MD("_script_dropped"),&SceneTreeDock::_script_dropped); - ObjectTypeDB::bind_method(_MD("_tree_rmb"),&SceneTreeDock::_tree_rmb); - ObjectTypeDB::bind_method(_MD("_filter_changed"),&SceneTreeDock::_filter_changed); - ObjectTypeDB::bind_method(_MD("_focus_node"),&SceneTreeDock::_focus_node); - ObjectTypeDB::bind_method(_MD("_file_selected"), &SceneTreeDock::_file_selected); - - - ObjectTypeDB::bind_method(_MD("instance"),&SceneTreeDock::instance); + ClassDB::bind_method(_MD("_tool_selected"),&SceneTreeDock::_tool_selected,DEFVAL(false)); + ClassDB::bind_method(_MD("_create"),&SceneTreeDock::_create); + //ClassDB::bind_method(_MD("_script_created"),&SceneTreeDock::_script_created); + ClassDB::bind_method(_MD("_node_reparent"),&SceneTreeDock::_node_reparent); + ClassDB::bind_method(_MD("_set_owners"),&SceneTreeDock::_set_owners); + ClassDB::bind_method(_MD("_node_selected"),&SceneTreeDock::_node_selected); + ClassDB::bind_method(_MD("_node_renamed"),&SceneTreeDock::_node_renamed); + ClassDB::bind_method(_MD("_script_created"),&SceneTreeDock::_script_created); + ClassDB::bind_method(_MD("_load_request"),&SceneTreeDock::_load_request); + ClassDB::bind_method(_MD("_script_open_request"),&SceneTreeDock::_script_open_request); + ClassDB::bind_method(_MD("_unhandled_key_input"),&SceneTreeDock::_unhandled_key_input); + ClassDB::bind_method(_MD("_input"),&SceneTreeDock::_input); + ClassDB::bind_method(_MD("_nodes_drag_begin"),&SceneTreeDock::_nodes_drag_begin); + ClassDB::bind_method(_MD("_delete_confirm"),&SceneTreeDock::_delete_confirm); + ClassDB::bind_method(_MD("_node_prerenamed"),&SceneTreeDock::_node_prerenamed); + ClassDB::bind_method(_MD("_import_subscene"),&SceneTreeDock::_import_subscene); + ClassDB::bind_method(_MD("_selection_changed"),&SceneTreeDock::_selection_changed); + ClassDB::bind_method(_MD("_new_scene_from"),&SceneTreeDock::_new_scene_from); + ClassDB::bind_method(_MD("_nodes_dragged"),&SceneTreeDock::_nodes_dragged); + ClassDB::bind_method(_MD("_files_dropped"),&SceneTreeDock::_files_dropped); + ClassDB::bind_method(_MD("_script_dropped"),&SceneTreeDock::_script_dropped); + ClassDB::bind_method(_MD("_tree_rmb"),&SceneTreeDock::_tree_rmb); + ClassDB::bind_method(_MD("_filter_changed"),&SceneTreeDock::_filter_changed); + ClassDB::bind_method(_MD("_focus_node"),&SceneTreeDock::_focus_node); + + + ClassDB::bind_method(_MD("instance"),&SceneTreeDock::instance); } @@ -1937,8 +1895,7 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor,Node *p_scene_root,EditorSelec ED_SHORTCUT("scene_tree/add_child_node",TTR("Add Child Node"), KEY_MASK_CMD|KEY_A); ED_SHORTCUT("scene_tree/instance_scene",TTR("Instance Child Scene")); ED_SHORTCUT("scene_tree/change_node_type", TTR("Change Type")); - ED_SHORTCUT("scene_tree/add_script", TTR("Add Script")); - ED_SHORTCUT("scene_tree/load_script", TTR("Load Script")); + ED_SHORTCUT("scene_tree/attach_script", TTR("Attach Script")); ED_SHORTCUT("scene_tree/clear_script", TTR("Clear Script")); ED_SHORTCUT("scene_tree/move_up", TTR("Move Up"), KEY_MASK_CMD | KEY_UP); ED_SHORTCUT("scene_tree/move_down", TTR("Move Down"), KEY_MASK_CMD | KEY_DOWN); @@ -1976,20 +1933,13 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor,Node *p_scene_root,EditorSelec tb = memnew( ToolButton ); - tb->connect("pressed",this,"_tool_selected",make_binds(TOOL_CREATE_SCRIPT, false)); - tb->set_tooltip(TTR("Create a new script for the selected node.")); - tb->set_shortcut(ED_GET_SHORTCUT("scene_tree/add_script")); + tb->connect("pressed",this,"_tool_selected",make_binds(TOOL_ATTACH_SCRIPT, false)); + tb->set_tooltip(TTR("Attach a new or existing script for the selected node.")); + tb->set_shortcut(ED_GET_SHORTCUT("scene_tree/attach_script")); filter_hbc->add_child(tb); button_create_script=tb; tb = memnew(ToolButton); - tb->connect("pressed", this, "_tool_selected", make_binds(TOOL_LOAD_SCRIPT, false)); - tb->set_tooltip(TTR("Load a script for the selected node.")); - tb->set_shortcut(ED_GET_SHORTCUT("scene_tree/load_script")); - filter_hbc->add_child(tb); - button_load_script = tb; - - tb = memnew(ToolButton); tb->connect("pressed", this, "_tool_selected", make_binds(TOOL_CLEAR_SCRIPT, false)); tb->set_tooltip(TTR("Clear a script for the selected node.")); tb->set_shortcut(ED_GET_SHORTCUT("scene_tree/clear_script")); @@ -2023,11 +1973,6 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor,Node *p_scene_root,EditorSelec add_child(create_dialog); create_dialog->connect("create",this,"_create"); - file_dialog = memnew(EditorFileDialog); - add_child(file_dialog); - file_dialog->hide(); - file_dialog->connect("file_selected", this, "_file_selected"); - //groups_editor = memnew( GroupsEditor ); //add_child(groups_editor); //groups_editor->set_undo_redo(&editor_data->get_undo_redo()); @@ -2068,7 +2013,7 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor,Node *p_scene_root,EditorSelec menu = memnew( PopupMenu ); add_child(menu); - menu->connect("item_pressed",this,"_tool_selected"); + menu->connect("id_pressed",this,"_tool_selected"); first_enter=true; restore_script_editor_on_drag=false; diff --git a/tools/editor/scene_tree_dock.h b/tools/editor/scene_tree_dock.h index 86fe3bb136..8dade67337 100644 --- a/tools/editor/scene_tree_dock.h +++ b/tools/editor/scene_tree_dock.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -49,7 +49,7 @@ class EditorNode; class SceneTreeDock : public VBoxContainer { - OBJ_TYPE( SceneTreeDock, VBoxContainer ); + GDCLASS( SceneTreeDock, VBoxContainer ); enum Tool { @@ -58,8 +58,7 @@ class SceneTreeDock : public VBoxContainer { TOOL_REPLACE, TOOL_CONNECT, TOOL_GROUP, - TOOL_CREATE_SCRIPT, - TOOL_LOAD_SCRIPT, + TOOL_ATTACH_SCRIPT, TOOL_CLEAR_SCRIPT, TOOL_MOVE_UP, TOOL_MOVE_DOWN, @@ -77,12 +76,10 @@ class SceneTreeDock : public VBoxContainer { int current_option; CreateDialog *create_dialog; - EditorFileDialog *file_dialog; ToolButton *button_add; ToolButton *button_instance; ToolButton *button_create_script; - ToolButton *button_load_script; ToolButton *button_clear_script; SceneTreeEditor *scene_tree; diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp index f5628d0c8f..1c881dfd5e 100644 --- a/tools/editor/scene_tree_editor.cpp +++ b/tools/editor/scene_tree_editor.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -206,28 +206,15 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item,int p_column,int p_id) } else if (p_id==BUTTON_VISIBILITY) { - if (n->is_type("Spatial")) { - - Spatial *ci = n->cast_to<Spatial>(); - if (!ci->is_visible() && ci->get_parent_spatial() && !ci->get_parent_spatial()->is_visible()) { - error->set_text(TTR("This item cannot be made visible because the parent is hidden. Unhide the parent first.")); - error->popup_centered_minsize(); - return; - } + if (n->is_class("Spatial")) { bool v = !bool(n->call("is_hidden")); undo_redo->create_action(TTR("Toggle Spatial Visible")); undo_redo->add_do_method(n,"_set_visible_",!v); undo_redo->add_undo_method(n,"_set_visible_",v); undo_redo->commit_action(); - } else if (n->is_type("CanvasItem")) { + } else if (n->is_class("CanvasItem")) { - CanvasItem *ci = n->cast_to<CanvasItem>(); - if (!ci->is_visible() && ci->get_parent_item() && !ci->get_parent_item()->is_visible()) { - error->set_text(TTR("This item cannot be made visible because the parent is hidden. Unhide the parent first.")); - error->popup_centered_minsize(); - return; - } bool v = !bool(n->call("is_hidden")); undo_redo->create_action(TTR("Toggle CanvasItem Visible")); undo_redo->add_do_method(n,v?"hide":"show"); @@ -237,14 +224,14 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item,int p_column,int p_id) } else if (p_id==BUTTON_LOCK) { - if (n->is_type("CanvasItem")) { + if (n->is_class("CanvasItem")) { n->set_meta("_edit_lock_", Variant()); _update_tree(); emit_signal("node_changed"); } } else if (p_id==BUTTON_GROUP) { - if (n->is_type("CanvasItem")) { + if (n->is_class("CanvasItem")) { n->set_meta("_edit_group_", Variant()); _update_tree(); emit_signal("node_changed"); @@ -327,7 +314,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node,TreeItem *p_parent) { if (p_node->has_meta("_editor_icon")) icon=p_node->get_meta("_editor_icon"); else - icon=get_icon( (has_icon(p_node->get_type(),"EditorIcons")?p_node->get_type():String("Object")),"EditorIcons"); + icon=get_icon( (has_icon(p_node->get_class(),"EditorIcons")?p_node->get_class():String("Object")),"EditorIcons"); item->set_icon(0, icon ); item->set_metadata( 0,p_node->get_path() ); @@ -376,13 +363,13 @@ bool SceneTreeEditor::_add_nodes(Node *p_node,TreeItem *p_parent) { if (p_node==get_scene_node() && p_node->get_scene_inherited_state().is_valid()) { item->add_button(0,get_icon("InstanceOptions","EditorIcons"),BUTTON_SUBSCENE); - item->set_tooltip(0,TTR("Inherits:")+" "+p_node->get_scene_inherited_state()->get_path()+"\n"+TTR("Type:")+" "+p_node->get_type()); + item->set_tooltip(0,TTR("Inherits:")+" "+p_node->get_scene_inherited_state()->get_path()+"\n"+TTR("Type:")+" "+p_node->get_class()); } else if (p_node!=get_scene_node() && p_node->get_filename()!="" && can_open_instance) { item->add_button(0,get_icon("InstanceOptions","EditorIcons"),BUTTON_SUBSCENE); - item->set_tooltip(0,TTR("Instance:")+" "+p_node->get_filename()+"\n"+TTR("Type:")+" "+p_node->get_type()); + item->set_tooltip(0,TTR("Instance:")+" "+p_node->get_filename()+"\n"+TTR("Type:")+" "+p_node->get_class()); } else { - item->set_tooltip(0,String(p_node->get_name())+"\n"+TTR("Type:")+" "+p_node->get_type()); + item->set_tooltip(0,String(p_node->get_name())+"\n"+TTR("Type:")+" "+p_node->get_class()); } if (can_open_instance) { @@ -396,7 +383,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node,TreeItem *p_parent) { item->add_button(0,get_icon("Script","EditorIcons"),BUTTON_SCRIPT); } - if (p_node->is_type("CanvasItem")) { + if (p_node->is_class("CanvasItem")) { bool is_locked = p_node->has_meta("_edit_lock_");//_edit_group_ if (is_locked) @@ -415,7 +402,8 @@ bool SceneTreeEditor::_add_nodes(Node *p_node,TreeItem *p_parent) { if (!p_node->is_connected("visibility_changed",this,"_node_visibility_changed")) p_node->connect("visibility_changed",this,"_node_visibility_changed",varray(p_node)); - } else if (p_node->is_type("Spatial")) { + _update_visibility_color(p_node, item); + } else if (p_node->is_class("Spatial")) { bool h = p_node->call("is_hidden"); if (h) @@ -426,6 +414,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node,TreeItem *p_parent) { if (!p_node->is_connected("visibility_changed",this,"_node_visibility_changed")) p_node->connect("visibility_changed",this,"_node_visibility_changed",varray(p_node)); + _update_visibility_color(p_node, item); } } @@ -480,9 +469,9 @@ void SceneTreeEditor::_node_visibility_changed(Node *p_node) { bool visible=false; - if (p_node->is_type("CanvasItem")) { + if (p_node->is_class("CanvasItem")) { visible = !p_node->call("is_hidden"); - } else if (p_node->is_type("Spatial")) { + } else if (p_node->is_class("Spatial")) { visible = !p_node->call("is_hidden"); } @@ -491,9 +480,20 @@ void SceneTreeEditor::_node_visibility_changed(Node *p_node) { else item->set_button(0,idx,get_icon("Visible","EditorIcons")); - + _update_visibility_color(p_node, item); } +void SceneTreeEditor::_update_visibility_color(Node *p_node, TreeItem *p_item) { + if (p_node->is_class("CanvasItem") || p_node->is_class("Spatial")) { + Color color(1,1,1,1); + bool visible_on_screen = p_node->call("is_visible"); + if (!visible_on_screen) { + color = Color(0.6,0.6,0.6,1); + } + int idx=p_item->get_button_by_id(0,BUTTON_VISIBILITY); + p_item->set_button_color(0,idx,color); + } +} void SceneTreeEditor::_node_script_changed(Node *p_node) { @@ -524,7 +524,7 @@ void SceneTreeEditor::_node_removed(Node *p_node) { if (p_node->is_connected("script_changed",this,"_node_script_changed")) p_node->disconnect("script_changed",this,"_node_script_changed"); - if (p_node->is_type("Spatial") || p_node->is_type("CanvasItem")) { + if (p_node->is_class("Spatial") || p_node->is_class("CanvasItem")) { if (p_node->is_connected("visibility_changed",this,"_node_visibility_changed")) p_node->disconnect("visibility_changed",this,"_node_visibility_changed"); } @@ -725,6 +725,12 @@ void SceneTreeEditor::set_selected(Node *p_node,bool p_emit_selected) { TreeItem* item=p_node?_find(tree->get_root(),p_node->get_path()):NULL; if (item) { + // make visible when it's collapsed + TreeItem* node=item->get_parent(); + while (node && node!=tree->get_root()) { + node->set_collapsed(false); + node=node->get_parent(); + } item->select(0); item->set_as_cursor(0); selected=p_node; @@ -953,7 +959,7 @@ Variant SceneTreeEditor::get_drag_data_fw(const Point2& p_point,Control* p_from) Label *label = memnew( Label( selected[i]->get_name() ) ); hb->add_child(label); vb->add_child(hb); - hb->set_opacity(opacity_item); + hb->set_modulate(Color(1,1,1,opacity_item)); opacity_item -= opacity_step; } NodePath p = selected[i]->get_path(); @@ -1081,8 +1087,8 @@ void SceneTreeEditor::_warning_changed(Node* p_for_node) { void SceneTreeEditor::_editor_settings_changed() { - bool enable_rl = EditorSettings::get_singleton()->get("scenetree_editor/draw_relationship_lines"); - Color rl_color = EditorSettings::get_singleton()->get("scenetree_editor/relationship_line_color"); + bool enable_rl = EditorSettings::get_singleton()->get("docks/scene_tree/draw_relationship_lines"); + Color rl_color = EditorSettings::get_singleton()->get("docks/scene_tree/relationship_line_color"); if (enable_rl) { tree->add_constant_override("draw_relationship_lines",1); @@ -1096,31 +1102,31 @@ void SceneTreeEditor::_editor_settings_changed() { void SceneTreeEditor::_bind_methods() { - ObjectTypeDB::bind_method("_tree_changed",&SceneTreeEditor::_tree_changed); - ObjectTypeDB::bind_method("_update_tree",&SceneTreeEditor::_update_tree); - ObjectTypeDB::bind_method("_node_removed",&SceneTreeEditor::_node_removed); - ObjectTypeDB::bind_method("_selected_changed",&SceneTreeEditor::_selected_changed); - ObjectTypeDB::bind_method("_renamed",&SceneTreeEditor::_renamed); - ObjectTypeDB::bind_method("_rename_node",&SceneTreeEditor::_rename_node); - ObjectTypeDB::bind_method("_test_update_tree",&SceneTreeEditor::_test_update_tree); - ObjectTypeDB::bind_method("_cell_multi_selected",&SceneTreeEditor::_cell_multi_selected); - ObjectTypeDB::bind_method("_selection_changed",&SceneTreeEditor::_selection_changed); - ObjectTypeDB::bind_method("_cell_button_pressed",&SceneTreeEditor::_cell_button_pressed); - ObjectTypeDB::bind_method("_cell_collapsed",&SceneTreeEditor::_cell_collapsed); - ObjectTypeDB::bind_method("_subscene_option",&SceneTreeEditor::_subscene_option); - ObjectTypeDB::bind_method("_rmb_select",&SceneTreeEditor::_rmb_select); - ObjectTypeDB::bind_method("_warning_changed",&SceneTreeEditor::_warning_changed); + ClassDB::bind_method("_tree_changed",&SceneTreeEditor::_tree_changed); + ClassDB::bind_method("_update_tree",&SceneTreeEditor::_update_tree); + ClassDB::bind_method("_node_removed",&SceneTreeEditor::_node_removed); + ClassDB::bind_method("_selected_changed",&SceneTreeEditor::_selected_changed); + ClassDB::bind_method("_renamed",&SceneTreeEditor::_renamed); + ClassDB::bind_method("_rename_node",&SceneTreeEditor::_rename_node); + ClassDB::bind_method("_test_update_tree",&SceneTreeEditor::_test_update_tree); + ClassDB::bind_method("_cell_multi_selected",&SceneTreeEditor::_cell_multi_selected); + ClassDB::bind_method("_selection_changed",&SceneTreeEditor::_selection_changed); + ClassDB::bind_method("_cell_button_pressed",&SceneTreeEditor::_cell_button_pressed); + ClassDB::bind_method("_cell_collapsed",&SceneTreeEditor::_cell_collapsed); + ClassDB::bind_method("_subscene_option",&SceneTreeEditor::_subscene_option); + ClassDB::bind_method("_rmb_select",&SceneTreeEditor::_rmb_select); + ClassDB::bind_method("_warning_changed",&SceneTreeEditor::_warning_changed); - ObjectTypeDB::bind_method("_node_script_changed",&SceneTreeEditor::_node_script_changed); - ObjectTypeDB::bind_method("_node_visibility_changed",&SceneTreeEditor::_node_visibility_changed); + ClassDB::bind_method("_node_script_changed",&SceneTreeEditor::_node_script_changed); + ClassDB::bind_method("_node_visibility_changed",&SceneTreeEditor::_node_visibility_changed); - ObjectTypeDB::bind_method("_editor_settings_changed", &SceneTreeEditor::_editor_settings_changed); + ClassDB::bind_method("_editor_settings_changed", &SceneTreeEditor::_editor_settings_changed); - ObjectTypeDB::bind_method(_MD("get_drag_data_fw"), &SceneTreeEditor::get_drag_data_fw); - ObjectTypeDB::bind_method(_MD("can_drop_data_fw"), &SceneTreeEditor::can_drop_data_fw); - ObjectTypeDB::bind_method(_MD("drop_data_fw"), &SceneTreeEditor::drop_data_fw); + ClassDB::bind_method(_MD("get_drag_data_fw"), &SceneTreeEditor::get_drag_data_fw); + ClassDB::bind_method(_MD("can_drop_data_fw"), &SceneTreeEditor::can_drop_data_fw); + ClassDB::bind_method(_MD("drop_data_fw"), &SceneTreeEditor::drop_data_fw); - ObjectTypeDB::bind_method(_MD("update_tree"), &SceneTreeEditor::update_tree); + ClassDB::bind_method(_MD("update_tree"), &SceneTreeEditor::update_tree); ADD_SIGNAL( MethodInfo("node_selected") ); ADD_SIGNAL( MethodInfo("node_renamed") ); @@ -1128,7 +1134,7 @@ void SceneTreeEditor::_bind_methods() { ADD_SIGNAL( MethodInfo("node_changed") ); ADD_SIGNAL( MethodInfo("nodes_dragged") ); ADD_SIGNAL( MethodInfo("nodes_rearranged",PropertyInfo(Variant::ARRAY,"paths"),PropertyInfo(Variant::NODE_PATH,"to_path"),PropertyInfo(Variant::INT,"type") ) ); - ADD_SIGNAL( MethodInfo("files_dropped",PropertyInfo(Variant::STRING_ARRAY,"files"),PropertyInfo(Variant::NODE_PATH,"to_path"),PropertyInfo(Variant::INT,"type") ) ); + ADD_SIGNAL( MethodInfo("files_dropped",PropertyInfo(Variant::POOL_STRING_ARRAY,"files"),PropertyInfo(Variant::NODE_PATH,"to_path"),PropertyInfo(Variant::INT,"type") ) ); ADD_SIGNAL( MethodInfo("script_dropped",PropertyInfo(Variant::STRING,"file"),PropertyInfo(Variant::NODE_PATH,"to_path"))); ADD_SIGNAL( MethodInfo("rmb_pressed",PropertyInfo(Variant::VECTOR2,"pos")) ) ; @@ -1204,14 +1210,14 @@ SceneTreeEditor::SceneTreeEditor(bool p_label,bool p_can_rename, bool p_can_open instance_menu->add_item(TTR("Discard Instancing"),SCENE_MENU_CLEAR_INSTANCING); instance_menu->add_separator(); instance_menu->add_item(TTR("Open in Editor"),SCENE_MENU_OPEN); - instance_menu->connect("item_pressed",this,"_subscene_option"); + instance_menu->connect("id_pressed",this,"_subscene_option"); add_child(instance_menu); inheritance_menu = memnew( PopupMenu ); inheritance_menu->add_item(TTR("Clear Inheritance"),SCENE_MENU_CLEAR_INHERITANCE); inheritance_menu->add_separator(); inheritance_menu->add_item(TTR("Open in Editor"),SCENE_MENU_OPEN_INHERITED); - inheritance_menu->connect("item_pressed",this,"_subscene_option"); + inheritance_menu->connect("id_pressed",this,"_subscene_option"); add_child(inheritance_menu); @@ -1227,7 +1233,7 @@ SceneTreeEditor::SceneTreeEditor(bool p_label,bool p_can_rename, bool p_can_open add_child(update_timer); script_types = memnew(List<StringName>); - ObjectTypeDB::get_inheriters_from("Script", script_types); + ClassDB::get_inheriters_from_class("Script", script_types); } @@ -1283,8 +1289,8 @@ void SceneTreeDialog::_select() { void SceneTreeDialog::_bind_methods() { - ObjectTypeDB::bind_method("_select",&SceneTreeDialog::_select); - ObjectTypeDB::bind_method("_cancel",&SceneTreeDialog::_cancel); + ClassDB::bind_method("_select",&SceneTreeDialog::_select); + ClassDB::bind_method("_cancel",&SceneTreeDialog::_cancel); ADD_SIGNAL( MethodInfo("selected",PropertyInfo(Variant::NODE_PATH,"path"))); } @@ -1296,7 +1302,7 @@ SceneTreeDialog::SceneTreeDialog() { tree = memnew( SceneTreeEditor(false,false) ); add_child(tree); - set_child_rect(tree); + //set_child_rect(tree); tree->get_scene_tree()->connect("item_activated",this,"_select"); diff --git a/tools/editor/scene_tree_editor.h b/tools/editor/scene_tree_editor.h index 12d85ecdeb..3cc1bd2388 100644 --- a/tools/editor/scene_tree_editor.h +++ b/tools/editor/scene_tree_editor.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -40,7 +40,7 @@ */ class SceneTreeEditor : public Control { - OBJ_TYPE( SceneTreeEditor, Control ); + GDCLASS( SceneTreeEditor, Control ); EditorSelection *editor_selection; @@ -117,6 +117,7 @@ class SceneTreeEditor : public Control { void _update_selection(TreeItem *item); void _node_script_changed(Node *p_node); void _node_visibility_changed(Node *p_node); + void _update_visibility_color(Node *p_node, TreeItem *p_item); void _subscene_option(int p_idx); void _node_replace_owner(Node* p_base,Node* p_node,Node* p_root); @@ -171,7 +172,7 @@ public: class SceneTreeDialog : public ConfirmationDialog { - OBJ_TYPE( SceneTreeDialog, ConfirmationDialog ); + GDCLASS( SceneTreeDialog, ConfirmationDialog ); SceneTreeEditor *tree; // Button *select; diff --git a/tools/editor/script_create_dialog.cpp b/tools/editor/script_create_dialog.cpp index 62d5c7cd84..d1095271fc 100644 --- a/tools/editor/script_create_dialog.cpp +++ b/tools/editor/script_create_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -96,8 +96,20 @@ void ScriptCreateDialog::_class_name_changed(const String& p_name) { void ScriptCreateDialog::ok_pressed() { - if (class_name->is_editable() && !_validate(class_name->get_text())) { + if (create_new){ + _create_new(); + } else { + _load_exist(); + } + + create_new=true; + _update_controls(); + +} + +void ScriptCreateDialog::_create_new() { + if (class_name->is_editable() && !_validate(class_name->get_text())) { alert->set_text(TTR("Class name is invalid!")); alert->popup_centered_minsize(); return; @@ -105,21 +117,14 @@ void ScriptCreateDialog::ok_pressed() { if (!_validate(parent_name->get_text())) { alert->set_text(TTR("Parent class name is invalid!")); alert->popup_centered_minsize(); - return; - } - String cname; if (class_name->is_editable()) cname=class_name->get_text(); - - - Ref<Script> scr = ScriptServer::get_language( language_menu->get_selected() )->get_template(cname,parent_name->get_text()); - //scr->set_source_code(text); String selected_language = language_menu->get_item_text(language_menu->get_selected()); editor_settings->set_last_selected_language(selected_language); @@ -127,34 +132,40 @@ void ScriptCreateDialog::ok_pressed() { if (cname!="") scr->set_name(cname); - if (!internal->is_pressed()) { - - - String lpath = Globals::get_singleton()->localize_path(file_path->get_text()); + String lpath = GlobalConfig::get_singleton()->localize_path(file_path->get_text()); scr->set_path(lpath); if (!path_valid) { - alert->set_text(TTR("Invalid path!")); alert->popup_centered_minsize(); return; - } Error err = ResourceSaver::save(lpath,scr,ResourceSaver::FLAG_CHANGE_PATH); if (err!=OK) { - alert->set_text(TTR("Could not create script in filesystem.")); alert->popup_centered_minsize(); return; } - //scr->set_path(lpath); - //EditorFileSystem::get_singleton()->update_file(lpath,scr->get_type()); + } + hide(); + emit_signal("script_created",scr); + +} +void ScriptCreateDialog::_load_exist() { + + String path=file_path->get_text(); + RES p_script = ResourceLoader::load(path, "Script"); + if (p_script.is_null()) { + alert->get_ok()->set_text(TTR("Ugh")); + alert->set_text(vformat(TTR("Error loading script from %s"), path)); + alert->popup_centered_minsize(); + return; } hide(); - emit_signal("script_created",scr); + emit_signal("script_created",p_script.get_ref_ptr()); } @@ -166,10 +177,35 @@ void ScriptCreateDialog::_lang_changed(int l) { } else { class_name->set_editable(false); } - if (file_path->get_text().basename()==initial_bp) { - file_path->set_text(initial_bp+"."+ScriptServer::get_language( l )->get_extension()); - _path_changed(file_path->get_text()); + + String selected_ext="."+ScriptServer::get_language( l )->get_extension(); + String path=file_path->get_text(); + String extension=""; + if (path.find(".")>=0) { + extension=path.extension(); + } + + if (extension.length()==0) { + // add extension if none + path+=selected_ext; + _path_changed(path); + } else { + // change extension by selected language + List<String> extensions; + // get all possible extensions for script + for (int l=0;l<language_menu->get_item_count();l++) { + ScriptServer::get_language( l )->get_recognized_extensions(&extensions); + } + + for(List<String>::Element *E=extensions.front();E;E=E->next()) { + if (E->get().nocasecmp_to(extension)==0) { + path=path.basename()+selected_ext; + _path_changed(path); + break; + } + } } + file_path->set_text(path); _class_name_changed(class_name->get_text()); } @@ -191,8 +227,10 @@ void ScriptCreateDialog::_browse_path() { file_browse->clear_filters(); List<String> extensions; - int l=language_menu->get_selected(); - ScriptServer::get_language( l )->get_recognized_extensions(&extensions); + // get all possible extensions for script + for (int l=0;l<language_menu->get_item_count();l++) { + ScriptServer::get_language( l )->get_recognized_extensions(&extensions); + } for(List<String>::Element *E=extensions.front();E;E=E->next()) { file_browse->add_filter("*."+E->get()); @@ -205,7 +243,7 @@ void ScriptCreateDialog::_browse_path() { void ScriptCreateDialog::_file_selected(const String& p_file) { - String p = Globals::get_singleton()->localize_path(p_file); + String p = GlobalConfig::get_singleton()->localize_path(p_file); file_path->set_text(p); _path_changed(p); @@ -224,7 +262,7 @@ void ScriptCreateDialog::_path_changed(const String& p_path) { } - p = Globals::get_singleton()->localize_path(p); + p = GlobalConfig::get_singleton()->localize_path(p); if (!p.begins_with("res://")) { path_error_label->set_text(TTR("Path is not local")); @@ -246,58 +284,66 @@ void ScriptCreateDialog::_path_changed(const String& p_path) { memdelete(d); } - - FileAccess *f = FileAccess::create(FileAccess::ACCESS_RESOURCES); - - if (f->file_exists(p)) { - - path_error_label->set_text(TTR("File exists")); - path_error_label->add_color_override("font_color",Color(1,0.4,0.0,0.8)); - memdelete(f); - return; - } - + create_new=!f->file_exists(p); memdelete(f); String extension=p.extension(); List<String> extensions; - int l=language_menu->get_selected(); - ScriptServer::get_language( l )->get_recognized_extensions(&extensions); + // get all possible extensions for script + for (int l=0;l<language_menu->get_item_count();l++) { + ScriptServer::get_language( l )->get_recognized_extensions(&extensions); + } bool found=false; + int index=0; for(List<String>::Element *E=extensions.front();E;E=E->next()) { if (E->get().nocasecmp_to(extension)==0) { + language_menu->select(index); // change Language option by extension found=true; break; } + index++; } if (!found) { - path_error_label->set_text(TTR("Invalid extension")); path_error_label->add_color_override("font_color",Color(1,0.4,0.0,0.8)); return; } + _update_controls(); - path_error_label->set_text(TTR("Valid path")); path_error_label->add_color_override("font_color",Color(0,1.0,0.8,0.8)); path_valid=true; } +void ScriptCreateDialog::_update_controls() { + + if (create_new) { + path_error_label->set_text(TTR("Create new script")); + get_ok()->set_text(TTR("Create")); + } else { + path_error_label->set_text(TTR("Load existing script")); + get_ok()->set_text(TTR("Load")); + } + parent_name->set_editable(create_new); + internal->set_disabled(!create_new); + +} + void ScriptCreateDialog::_bind_methods() { - ObjectTypeDB::bind_method("_class_name_changed",&ScriptCreateDialog::_class_name_changed); - ObjectTypeDB::bind_method("_lang_changed",&ScriptCreateDialog::_lang_changed); - ObjectTypeDB::bind_method("_built_in_pressed",&ScriptCreateDialog::_built_in_pressed); - ObjectTypeDB::bind_method("_browse_path",&ScriptCreateDialog::_browse_path); - ObjectTypeDB::bind_method("_file_selected",&ScriptCreateDialog::_file_selected); - ObjectTypeDB::bind_method("_path_changed",&ScriptCreateDialog::_path_changed); + ClassDB::bind_method("_class_name_changed",&ScriptCreateDialog::_class_name_changed); + ClassDB::bind_method("_lang_changed",&ScriptCreateDialog::_lang_changed); + ClassDB::bind_method("_built_in_pressed",&ScriptCreateDialog::_built_in_pressed); + ClassDB::bind_method("_browse_path",&ScriptCreateDialog::_browse_path); + ClassDB::bind_method("_file_selected",&ScriptCreateDialog::_file_selected); + ClassDB::bind_method("_path_changed",&ScriptCreateDialog::_path_changed); ADD_SIGNAL(MethodInfo("script_created",PropertyInfo(Variant::OBJECT,"script",PROPERTY_HINT_RESOURCE_TYPE,"Script"))); } @@ -307,7 +353,7 @@ ScriptCreateDialog::ScriptCreateDialog() { VBoxContainer *vb = memnew( VBoxContainer ); add_child(vb); - set_child_rect(vb); + //set_child_rect(vb); class_name = memnew( LineEdit ); @@ -376,7 +422,7 @@ ScriptCreateDialog::ScriptCreateDialog() { set_size(Size2(200,150)); set_hide_on_ok(false); - set_title(TTR("Create Node Script")); + set_title(TTR("Attach Node Script")); file_browse = memnew( EditorFileDialog ); file_browse->connect("file_selected",this,"_file_selected"); @@ -385,4 +431,6 @@ ScriptCreateDialog::ScriptCreateDialog() { alert = memnew( AcceptDialog ); add_child(alert); _lang_changed(0); + + create_new=true; } diff --git a/tools/editor/script_create_dialog.h b/tools/editor/script_create_dialog.h index c71ea16d39..df16efc73c 100644 --- a/tools/editor/script_create_dialog.h +++ b/tools/editor/script_create_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -37,7 +37,7 @@ #include "scene/gui/check_button.h" class ScriptCreateDialog : public ConfirmationDialog { - OBJ_TYPE(ScriptCreateDialog,ConfirmationDialog); + GDCLASS(ScriptCreateDialog,ConfirmationDialog); LineEdit *class_name; Label *error_label; @@ -50,6 +50,7 @@ class ScriptCreateDialog : public ConfirmationDialog { VBoxContainer *path_vb; AcceptDialog *alert; bool path_valid; + bool create_new; String initial_bp; EditorSettings *editor_settings; @@ -62,6 +63,9 @@ class ScriptCreateDialog : public ConfirmationDialog { void _browse_path(); void _file_selected(const String& p_file); virtual void ok_pressed(); + void _create_new(); + void _load_exist(); + void _update_controls(); protected: static void _bind_methods(); diff --git a/tools/editor/script_editor_debugger.cpp b/tools/editor/script_editor_debugger.cpp index c8170ca9a3..24b7befb9f 100644 --- a/tools/editor/script_editor_debugger.cpp +++ b/tools/editor/script_editor_debugger.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -46,7 +46,7 @@ class ScriptEditorDebuggerVariables : public Object { - OBJ_TYPE( ScriptEditorDebuggerVariables, Object ); + GDCLASS( ScriptEditorDebuggerVariables, Object ); List<PropertyInfo> props; Map<StringName,Variant> values; @@ -114,7 +114,7 @@ public: class ScriptEditorDebuggerInspectedObject : public Object { - OBJ_TYPE( ScriptEditorDebuggerInspectedObject, Object); + GDCLASS( ScriptEditorDebuggerInspectedObject, Object); @@ -581,7 +581,6 @@ void ScriptEditorDebugger::_parse_message(const String& p_msg,const Array& p_dat //LOG if (EditorNode::get_log()->is_hidden()) { - log_forced_visible=true; if (EditorNode::get_singleton()->are_bottom_panels_hidden()) { EditorNode::get_singleton()->make_bottom_panel_item_visible(EditorNode::get_log()); } @@ -957,7 +956,6 @@ void ScriptEditorDebugger::_notification(int p_what) { break; EditorNode::get_log()->add_message("** Debug Process Started **"); - log_forced_visible=false; ppeer->set_stream_peer(connection); @@ -1089,11 +1087,11 @@ void ScriptEditorDebugger::start() { stop(); - if (!EditorNode::get_log()->is_visible()) { - EditorNode::get_singleton()->make_bottom_panel_item_visible(EditorNode::get_log()); + if (is_visible()) { + EditorNode::get_singleton()->make_bottom_panel_item_visible(this); } - uint16_t port = GLOBAL_DEF("debug/remote_port",6007); + uint16_t port = GLOBAL_GET("network/debug/remote_port"); perf_history.clear(); for(int i=0;i<Performance::MONITOR_MAX;i++) { @@ -1132,13 +1130,6 @@ void ScriptEditorDebugger::stop(){ pending_in_queue=0; message.clear(); - if (log_forced_visible) { - //EditorNode::get_singleton()->make_bottom_panel_item_visible(this); - if (EditorNode::get_log()->is_visible()) - EditorNode::get_singleton()->hide_bottom_panel(); - log_forced_visible=false; - } - node_path_cache.clear(); res_path_cache.clear(); profiler_signature.clear(); @@ -1643,39 +1634,39 @@ void ScriptEditorDebugger::_paused() { void ScriptEditorDebugger::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_stack_dump_frame_selected"),&ScriptEditorDebugger::_stack_dump_frame_selected); - ObjectTypeDB::bind_method(_MD("debug_next"),&ScriptEditorDebugger::debug_next); - ObjectTypeDB::bind_method(_MD("debug_step"),&ScriptEditorDebugger::debug_step); - ObjectTypeDB::bind_method(_MD("debug_break"),&ScriptEditorDebugger::debug_break); - ObjectTypeDB::bind_method(_MD("debug_continue"),&ScriptEditorDebugger::debug_continue); - ObjectTypeDB::bind_method(_MD("_output_clear"),&ScriptEditorDebugger::_output_clear); - ObjectTypeDB::bind_method(_MD("_performance_draw"),&ScriptEditorDebugger::_performance_draw); - ObjectTypeDB::bind_method(_MD("_performance_select"),&ScriptEditorDebugger::_performance_select); - ObjectTypeDB::bind_method(_MD("_scene_tree_request"),&ScriptEditorDebugger::_scene_tree_request); - ObjectTypeDB::bind_method(_MD("_video_mem_request"),&ScriptEditorDebugger::_video_mem_request); - ObjectTypeDB::bind_method(_MD("_live_edit_set"),&ScriptEditorDebugger::_live_edit_set); - ObjectTypeDB::bind_method(_MD("_live_edit_clear"),&ScriptEditorDebugger::_live_edit_clear); - - ObjectTypeDB::bind_method(_MD("_error_selected"),&ScriptEditorDebugger::_error_selected); - ObjectTypeDB::bind_method(_MD("_error_stack_selected"),&ScriptEditorDebugger::_error_stack_selected); - ObjectTypeDB::bind_method(_MD("_profiler_activate"),&ScriptEditorDebugger::_profiler_activate); - ObjectTypeDB::bind_method(_MD("_profiler_seeked"),&ScriptEditorDebugger::_profiler_seeked); - - ObjectTypeDB::bind_method(_MD("_paused"),&ScriptEditorDebugger::_paused); - - ObjectTypeDB::bind_method(_MD("_scene_tree_selected"),&ScriptEditorDebugger::_scene_tree_selected); - ObjectTypeDB::bind_method(_MD("_scene_tree_folded"),&ScriptEditorDebugger::_scene_tree_folded); - - - ObjectTypeDB::bind_method(_MD("live_debug_create_node"),&ScriptEditorDebugger::live_debug_create_node); - ObjectTypeDB::bind_method(_MD("live_debug_instance_node"),&ScriptEditorDebugger::live_debug_instance_node); - ObjectTypeDB::bind_method(_MD("live_debug_remove_node"),&ScriptEditorDebugger::live_debug_remove_node); - ObjectTypeDB::bind_method(_MD("live_debug_remove_and_keep_node"),&ScriptEditorDebugger::live_debug_remove_and_keep_node); - ObjectTypeDB::bind_method(_MD("live_debug_restore_node"),&ScriptEditorDebugger::live_debug_restore_node); - ObjectTypeDB::bind_method(_MD("live_debug_duplicate_node"),&ScriptEditorDebugger::live_debug_duplicate_node); - ObjectTypeDB::bind_method(_MD("live_debug_reparent_node"),&ScriptEditorDebugger::live_debug_reparent_node); - ObjectTypeDB::bind_method(_MD("_scene_tree_property_select_object"),&ScriptEditorDebugger::_scene_tree_property_select_object); - ObjectTypeDB::bind_method(_MD("_scene_tree_property_value_edited"),&ScriptEditorDebugger::_scene_tree_property_value_edited); + ClassDB::bind_method(_MD("_stack_dump_frame_selected"),&ScriptEditorDebugger::_stack_dump_frame_selected); + ClassDB::bind_method(_MD("debug_next"),&ScriptEditorDebugger::debug_next); + ClassDB::bind_method(_MD("debug_step"),&ScriptEditorDebugger::debug_step); + ClassDB::bind_method(_MD("debug_break"),&ScriptEditorDebugger::debug_break); + ClassDB::bind_method(_MD("debug_continue"),&ScriptEditorDebugger::debug_continue); + ClassDB::bind_method(_MD("_output_clear"),&ScriptEditorDebugger::_output_clear); + ClassDB::bind_method(_MD("_performance_draw"),&ScriptEditorDebugger::_performance_draw); + ClassDB::bind_method(_MD("_performance_select"),&ScriptEditorDebugger::_performance_select); + ClassDB::bind_method(_MD("_scene_tree_request"),&ScriptEditorDebugger::_scene_tree_request); + ClassDB::bind_method(_MD("_video_mem_request"),&ScriptEditorDebugger::_video_mem_request); + ClassDB::bind_method(_MD("_live_edit_set"),&ScriptEditorDebugger::_live_edit_set); + ClassDB::bind_method(_MD("_live_edit_clear"),&ScriptEditorDebugger::_live_edit_clear); + + ClassDB::bind_method(_MD("_error_selected"),&ScriptEditorDebugger::_error_selected); + ClassDB::bind_method(_MD("_error_stack_selected"),&ScriptEditorDebugger::_error_stack_selected); + ClassDB::bind_method(_MD("_profiler_activate"),&ScriptEditorDebugger::_profiler_activate); + ClassDB::bind_method(_MD("_profiler_seeked"),&ScriptEditorDebugger::_profiler_seeked); + + ClassDB::bind_method(_MD("_paused"),&ScriptEditorDebugger::_paused); + + ClassDB::bind_method(_MD("_scene_tree_selected"),&ScriptEditorDebugger::_scene_tree_selected); + ClassDB::bind_method(_MD("_scene_tree_folded"),&ScriptEditorDebugger::_scene_tree_folded); + + + ClassDB::bind_method(_MD("live_debug_create_node"),&ScriptEditorDebugger::live_debug_create_node); + ClassDB::bind_method(_MD("live_debug_instance_node"),&ScriptEditorDebugger::live_debug_instance_node); + ClassDB::bind_method(_MD("live_debug_remove_node"),&ScriptEditorDebugger::live_debug_remove_node); + ClassDB::bind_method(_MD("live_debug_remove_and_keep_node"),&ScriptEditorDebugger::live_debug_remove_and_keep_node); + ClassDB::bind_method(_MD("live_debug_restore_node"),&ScriptEditorDebugger::live_debug_restore_node); + ClassDB::bind_method(_MD("live_debug_duplicate_node"),&ScriptEditorDebugger::live_debug_duplicate_node); + ClassDB::bind_method(_MD("live_debug_reparent_node"),&ScriptEditorDebugger::live_debug_reparent_node); + ClassDB::bind_method(_MD("_scene_tree_property_select_object"),&ScriptEditorDebugger::_scene_tree_property_select_object); + ClassDB::bind_method(_MD("_scene_tree_property_value_edited"),&ScriptEditorDebugger::_scene_tree_property_value_edited); ADD_SIGNAL(MethodInfo("goto_script_line")); ADD_SIGNAL(MethodInfo("breaked",PropertyInfo(Variant::BOOL,"reallydid"),PropertyInfo(Variant::BOOL,"can_debug"))); @@ -1980,8 +1971,6 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor){ msgdialog = memnew( AcceptDialog ); add_child(msgdialog); - log_forced_visible=false; - p_editor->get_undo_redo()->set_method_notify_callback(_method_changeds,this); p_editor->get_undo_redo()->set_property_notify_callback(_property_changeds,this); live_debug=false; diff --git a/tools/editor/script_editor_debugger.h b/tools/editor/script_editor_debugger.h index c4a7cea1b7..a02934bbaf 100644 --- a/tools/editor/script_editor_debugger.h +++ b/tools/editor/script_editor_debugger.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -55,7 +55,7 @@ class ScriptEditorDebuggerInspectedObject; class ScriptEditorDebugger : public Control { - OBJ_TYPE( ScriptEditorDebugger, Control ); + GDCLASS( ScriptEditorDebugger, Control ); AcceptDialog *msgdialog; @@ -96,7 +96,6 @@ class ScriptEditorDebugger : public Control { TabContainer *tabs; LineEdit *reason; - bool log_forced_visible; ScriptEditorDebuggerVariables *variables; Button *step; diff --git a/tools/editor/settings_config_dialog.cpp b/tools/editor/settings_config_dialog.cpp index 50989ea5cb..c72f2641b7 100644 --- a/tools/editor/settings_config_dialog.cpp +++ b/tools/editor/settings_config_dialog.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -55,7 +55,7 @@ void EditorSettingsDialog::_settings_property_edited(const String& p_name) { // Small usability workaround to update the text color settings when the // color theme is changed - if (full_name == "text_editor/color_theme") { + if (full_name == "text_editor/theme/color_theme") { property_editor->get_property_editor()->update_tree(); } } @@ -288,16 +288,16 @@ void EditorSettingsDialog::_press_a_key_confirm() { void EditorSettingsDialog::_bind_methods() { - ObjectTypeDB::bind_method(_MD("_settings_save"),&EditorSettingsDialog::_settings_save); - ObjectTypeDB::bind_method(_MD("_settings_changed"),&EditorSettingsDialog::_settings_changed); - ObjectTypeDB::bind_method(_MD("_settings_property_edited"),&EditorSettingsDialog::_settings_property_edited); - ObjectTypeDB::bind_method(_MD("_clear_search_box"),&EditorSettingsDialog::_clear_search_box); - ObjectTypeDB::bind_method(_MD("_clear_shortcut_search_box"),&EditorSettingsDialog::_clear_shortcut_search_box); - ObjectTypeDB::bind_method(_MD("_shortcut_button_pressed"),&EditorSettingsDialog::_shortcut_button_pressed); - ObjectTypeDB::bind_method(_MD("_filter_shortcuts"),&EditorSettingsDialog::_filter_shortcuts); - ObjectTypeDB::bind_method(_MD("_update_shortcuts"),&EditorSettingsDialog::_update_shortcuts); - ObjectTypeDB::bind_method(_MD("_press_a_key_confirm"),&EditorSettingsDialog::_press_a_key_confirm); - ObjectTypeDB::bind_method(_MD("_wait_for_key"),&EditorSettingsDialog::_wait_for_key); + ClassDB::bind_method(_MD("_settings_save"),&EditorSettingsDialog::_settings_save); + ClassDB::bind_method(_MD("_settings_changed"),&EditorSettingsDialog::_settings_changed); + ClassDB::bind_method(_MD("_settings_property_edited"),&EditorSettingsDialog::_settings_property_edited); + ClassDB::bind_method(_MD("_clear_search_box"),&EditorSettingsDialog::_clear_search_box); + ClassDB::bind_method(_MD("_clear_shortcut_search_box"),&EditorSettingsDialog::_clear_shortcut_search_box); + ClassDB::bind_method(_MD("_shortcut_button_pressed"),&EditorSettingsDialog::_shortcut_button_pressed); + ClassDB::bind_method(_MD("_filter_shortcuts"),&EditorSettingsDialog::_filter_shortcuts); + ClassDB::bind_method(_MD("_update_shortcuts"),&EditorSettingsDialog::_update_shortcuts); + ClassDB::bind_method(_MD("_press_a_key_confirm"),&EditorSettingsDialog::_press_a_key_confirm); + ClassDB::bind_method(_MD("_wait_for_key"),&EditorSettingsDialog::_wait_for_key); } @@ -307,7 +307,7 @@ EditorSettingsDialog::EditorSettingsDialog() { tabs = memnew( TabContainer ); add_child(tabs); - set_child_rect(tabs); + //set_child_rect(tabs); VBoxContainer *vbc = memnew( VBoxContainer ); tabs->add_child(vbc); @@ -380,7 +380,7 @@ EditorSettingsDialog::EditorSettingsDialog() { l->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_BEGIN,30); press_a_key_label=l; press_a_key->add_child(l); - press_a_key->connect("input_event",this,"_wait_for_key"); + press_a_key->connect("gui_input",this,"_wait_for_key"); press_a_key->connect("confirmed",this,"_press_a_key_confirm"); //Button *load = memnew( Button ); diff --git a/tools/editor/settings_config_dialog.h b/tools/editor/settings_config_dialog.h index 3b91c7f019..17a05c27d3 100644 --- a/tools/editor/settings_config_dialog.h +++ b/tools/editor/settings_config_dialog.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -36,7 +36,7 @@ class EditorSettingsDialog : public AcceptDialog { - OBJ_TYPE(EditorSettingsDialog,AcceptDialog); + GDCLASS(EditorSettingsDialog,AcceptDialog); diff --git a/tools/editor/spatial_editor_gizmos.cpp b/tools/editor/spatial_editor_gizmos.cpp index 84803eb6db..62de22a4b3 100644 --- a/tools/editor/spatial_editor_gizmos.cpp +++ b/tools/editor/spatial_editor_gizmos.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -41,6 +41,8 @@ // Keep small children away from this file. // It's so ugly it will eat them alive + + #define HANDLE_HALF_SIZE 0.05 void EditorSpatialGizmo::clear() { @@ -82,7 +84,6 @@ void EditorSpatialGizmo::Instance::create_instance(Spatial *p_base) { if (extra_margin) VS::get_singleton()->instance_set_extra_visibility_margin(instance,1); VS::get_singleton()->instance_geometry_set_cast_shadows_setting(instance,VS::SHADOW_CASTING_SETTING_OFF); - VS::get_singleton()->instance_geometry_set_flag(instance,VS::INSTANCE_FLAG_RECEIVE_SHADOWS,false); VS::get_singleton()->instance_set_layer_mask(instance,1<<SpatialEditorViewport::GIZMO_EDIT_LAYER); //gizmos are 26 } @@ -116,10 +117,10 @@ void EditorSpatialGizmo::add_lines(const Vector<Vector3> &p_lines, const Ref<Mat a[Mesh::ARRAY_VERTEX]=p_lines; - DVector<Color> color; + PoolVector<Color> color; color.resize(p_lines.size()); { - DVector<Color>::Write w = color.write(); + PoolVector<Color>::Write w = color.write(); for(int i=0;i<p_lines.size();i++) { if (is_selected()) w[i]=Color(1,1,1,0.6); @@ -132,7 +133,7 @@ void EditorSpatialGizmo::add_lines(const Vector<Vector3> &p_lines, const Ref<Mat a[Mesh::ARRAY_COLOR]=color; - mesh->add_surface(Mesh::PRIMITIVE_LINES,a); + mesh->add_surface_from_arrays(Mesh::PRIMITIVE_LINES,a); mesh->surface_set_material(0,p_material); if (p_billboard) { @@ -143,7 +144,7 @@ void EditorSpatialGizmo::add_lines(const Vector<Vector3> &p_lines, const Ref<Mat } if (md) { - mesh->set_custom_aabb(AABB(Vector3(-md,-md,-md),Vector3(md,md,md)*2.0)); + mesh->set_custom_aabb(Rect3(Vector3(-md,-md,-md),Vector3(md,md,md)*2.0)); } } @@ -181,7 +182,7 @@ void EditorSpatialGizmo::add_unscaled_billboard(const Ref<Material>& p_material, a.resize(Mesh::ARRAY_MAX); a[Mesh::ARRAY_VERTEX]=vs; a[Mesh::ARRAY_TEX_UV]=uv; - mesh->add_surface(Mesh::PRIMITIVE_TRIANGLE_FAN,a); + mesh->add_surface_from_arrays(Mesh::PRIMITIVE_TRIANGLE_FAN,a); mesh->surface_set_material(0,p_material); if (true) { @@ -192,7 +193,7 @@ void EditorSpatialGizmo::add_unscaled_billboard(const Ref<Material>& p_material, } if (md) { - mesh->set_custom_aabb(AABB(Vector3(-md,-md,-md),Vector3(md,md,md)*2.0)); + mesh->set_custom_aabb(Rect3(Vector3(-md,-md,-md),Vector3(md,md,md)*2.0)); } } @@ -244,10 +245,11 @@ void EditorSpatialGizmo::add_handles(const Vector<Vector3> &p_handles, bool p_bi Array a; a.resize(VS::ARRAY_MAX); a[VS::ARRAY_VERTEX]=p_handles; - DVector<Color> colors; + print_line("handles?: "+itos(p_handles.size())); + PoolVector<Color> colors; { colors.resize(p_handles.size()); - DVector<Color>::Write w=colors.write(); + PoolVector<Color>::Write w=colors.write(); for(int i=0;i<p_handles.size();i++) { Color col(1,1,1,1); @@ -258,7 +260,7 @@ void EditorSpatialGizmo::add_handles(const Vector<Vector3> &p_handles, bool p_bi } a[VS::ARRAY_COLOR]=colors; - mesh->add_surface(Mesh::PRIMITIVE_POINTS,a); + mesh->add_surface_from_arrays(Mesh::PRIMITIVE_POINTS,a); mesh->surface_set_material(0,SpatialEditorGizmos::singleton->handle2_material); if (p_billboard) { @@ -269,7 +271,7 @@ void EditorSpatialGizmo::add_handles(const Vector<Vector3> &p_handles, bool p_bi } if (md) { - mesh->set_custom_aabb(AABB(Vector3(-md,-md,-md),Vector3(md,md,md)*2.0)); + mesh->set_custom_aabb(Rect3(Vector3(-md,-md,-md),Vector3(md,md,md)*2.0)); } } @@ -614,14 +616,14 @@ void EditorSpatialGizmo::free(){ void EditorSpatialGizmo::_bind_methods() { - ObjectTypeDB::bind_method(_MD("add_lines","lines","material:Material","billboard"),&EditorSpatialGizmo::add_lines,DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("add_mesh","mesh:Mesh","billboard","skeleton"),&EditorSpatialGizmo::add_mesh,DEFVAL(false),DEFVAL(RID())); - ObjectTypeDB::bind_method(_MD("add_collision_segments","segments"),&EditorSpatialGizmo::add_collision_segments); - ObjectTypeDB::bind_method(_MD("add_collision_triangles","triangles:TriangleMesh"),&EditorSpatialGizmo::add_collision_triangles); - ObjectTypeDB::bind_method(_MD("add_unscaled_billboard","material:Material","default_scale"),&EditorSpatialGizmo::add_unscaled_billboard,DEFVAL(1)); - ObjectTypeDB::bind_method(_MD("add_handles","handles","billboard","secondary"),&EditorSpatialGizmo::add_handles,DEFVAL(false),DEFVAL(false)); - ObjectTypeDB::bind_method(_MD("set_spatial_node","node:Spatial"),&EditorSpatialGizmo::_set_spatial_node); - ObjectTypeDB::bind_method(_MD("clear"),&EditorSpatialGizmo::clear); + ClassDB::bind_method(_MD("add_lines","lines","material:Material","billboard"),&EditorSpatialGizmo::add_lines,DEFVAL(false)); + ClassDB::bind_method(_MD("add_mesh","mesh:Mesh","billboard","skeleton"),&EditorSpatialGizmo::add_mesh,DEFVAL(false),DEFVAL(RID())); + ClassDB::bind_method(_MD("add_collision_segments","segments"),&EditorSpatialGizmo::add_collision_segments); + ClassDB::bind_method(_MD("add_collision_triangles","triangles:TriangleMesh"),&EditorSpatialGizmo::add_collision_triangles); + ClassDB::bind_method(_MD("add_unscaled_billboard","material:Material","default_scale"),&EditorSpatialGizmo::add_unscaled_billboard,DEFVAL(1)); + ClassDB::bind_method(_MD("add_handles","handles","billboard","secondary"),&EditorSpatialGizmo::add_handles,DEFVAL(false),DEFVAL(false)); + ClassDB::bind_method(_MD("set_spatial_node","node:Spatial"),&EditorSpatialGizmo::_set_spatial_node); + ClassDB::bind_method(_MD("clear"),&EditorSpatialGizmo::clear); BIND_VMETHOD( MethodInfo("redraw")); BIND_VMETHOD( MethodInfo(Variant::STRING,"get_handle_name",PropertyInfo(Variant::INT,"index"))); @@ -667,9 +669,9 @@ String LightSpatialGizmo::get_handle_name(int p_idx) const { Variant LightSpatialGizmo::get_handle_value(int p_idx) const{ if (p_idx==0) - return light->get_parameter(Light::PARAM_RADIUS); + return light->get_param(Light::PARAM_RANGE); if (p_idx==1) - return light->get_parameter(Light::PARAM_SPOT_ANGLE); + return light->get_param(Light::PARAM_SPOT_ANGLE); return Variant(); } @@ -727,7 +729,7 @@ void LightSpatialGizmo::set_handle(int p_idx,Camera *p_camera, const Point2& p_p if (d<0) d=0; - light->set_parameter(Light::PARAM_RADIUS,d); + light->set_param(Light::PARAM_RANGE,d); } else if (light->cast_to<OmniLight>()) { Plane cp=Plane( gt.origin, p_camera->get_transform().basis.get_axis(2)); @@ -736,15 +738,15 @@ void LightSpatialGizmo::set_handle(int p_idx,Camera *p_camera, const Point2& p_p if (cp.intersects_ray(ray_from,ray_dir,&inters)) { float r = inters.distance_to(gt.origin); - light->set_parameter(Light::PARAM_RADIUS,r); + light->set_param(Light::PARAM_RANGE,r); } } } else if (p_idx==1) { - float a = _find_closest_angle_to_half_pi_arc(s[0],s[1],light->get_parameter(Light::PARAM_RADIUS),gt); - light->set_parameter(Light::PARAM_SPOT_ANGLE,CLAMP(a,0.01,89.99)); + float a = _find_closest_angle_to_half_pi_arc(s[0],s[1],light->get_param(Light::PARAM_RANGE),gt); + light->set_param(Light::PARAM_SPOT_ANGLE,CLAMP(a,0.01,89.99)); } } @@ -752,21 +754,21 @@ void LightSpatialGizmo::commit_handle(int p_idx,const Variant& p_restore,bool p_ if (p_cancel) { - light->set_parameter(p_idx==0?Light::PARAM_RADIUS:Light::PARAM_SPOT_ANGLE,p_restore); + light->set_param(p_idx==0?Light::PARAM_RANGE:Light::PARAM_SPOT_ANGLE,p_restore); } else if (p_idx==0) { UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo(); ur->create_action(TTR("Change Light Radius")); - ur->add_do_method(light,"set_parameter",Light::PARAM_RADIUS,light->get_parameter(Light::PARAM_RADIUS)); - ur->add_undo_method(light,"set_parameter",Light::PARAM_RADIUS,p_restore); + ur->add_do_method(light,"set_param",Light::PARAM_RANGE,light->get_param(Light::PARAM_RANGE)); + ur->add_undo_method(light,"set_param",Light::PARAM_RANGE,p_restore); ur->commit_action(); } else if (p_idx==1) { UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo(); ur->create_action(TTR("Change Light Radius")); - ur->add_do_method(light,"set_parameter",Light::PARAM_SPOT_ANGLE,light->get_parameter(Light::PARAM_SPOT_ANGLE)); - ur->add_undo_method(light,"set_parameter",Light::PARAM_SPOT_ANGLE,p_restore); + ur->add_do_method(light,"set_param",Light::PARAM_SPOT_ANGLE,light->get_param(Light::PARAM_SPOT_ANGLE)); + ur->add_undo_method(light,"set_param",Light::PARAM_SPOT_ANGLE,p_restore); ur->commit_action(); } @@ -798,8 +800,8 @@ void LightSpatialGizmo::redraw() { for(int i = 0; i < arrow_sides ; i++) { - Matrix3 ma(Vector3(0,0,1),Math_PI*2*float(i)/arrow_sides); - Matrix3 mb(Vector3(0,0,1),Math_PI*2*float(i+1)/arrow_sides); + Basis ma(Vector3(0,0,1),Math_PI*2*float(i)/arrow_sides); + Basis mb(Vector3(0,0,1),Math_PI*2*float(i+1)/arrow_sides); for(int j=1;j<arrow_points-1;j++) { @@ -829,7 +831,7 @@ void LightSpatialGizmo::redraw() { OmniLight *on = light->cast_to<OmniLight>(); - float r = on->get_parameter(Light::PARAM_RADIUS); + float r = on->get_param(Light::PARAM_RANGE); Vector<Vector3> points; @@ -869,9 +871,9 @@ void LightSpatialGizmo::redraw() { Vector<Vector3> points; SpotLight *on = light->cast_to<SpotLight>(); - float r = on->get_parameter(Light::PARAM_RADIUS); - float w = r*Math::sin(Math::deg2rad(on->get_parameter(Light::PARAM_SPOT_ANGLE))); - float d = r*Math::cos(Math::deg2rad(on->get_parameter(Light::PARAM_SPOT_ANGLE))); + float r = on->get_param(Light::PARAM_RANGE); + float w = r*Math::sin(Math::deg2rad(on->get_param(Light::PARAM_SPOT_ANGLE))); + float d = r*Math::cos(Math::deg2rad(on->get_param(Light::PARAM_SPOT_ANGLE))); @@ -1217,7 +1219,7 @@ void SkeletonSpatialGizmo::redraw() { weights[0]=1; - AABB aabb; + Rect3 aabb; Color bonecolor = Color(1.0,0.4,0.4,0.3); Color rootcolor = Color(0.4,1.0,0.4,0.1); @@ -1423,11 +1425,11 @@ void RoomSpatialGizmo::redraw() { Ref<RoomBounds> roomie = room->get_room(); if (roomie.is_null()) return; - DVector<Face3> faces = roomie->get_geometry_hint(); + PoolVector<Face3> faces = roomie->get_geometry_hint(); Vector<Vector3> lines; int fc=faces.size(); - DVector<Face3>::Read r =faces.read(); + PoolVector<Face3>::Read r =faces.read(); Map<_EdgeKey,Vector3> edge_map; @@ -1541,7 +1543,7 @@ void RayCastSpatialGizmo::redraw() { } -RayCastSpatialGizmo::RayCastSpatialGizmo(RayCast* p_raycast){ +RayCastSpatialGizmo::RayCastSpatialGizmo(RayCast* p_raycast) { set_spatial_node(p_raycast); raycast=p_raycast; @@ -1913,7 +1915,7 @@ void CollisionShapeSpatialGizmo::redraw(){ Ref<BoxShape> bs=s; Vector<Vector3> lines; - AABB aabb; + Rect3 aabb; aabb.pos=-bs->get_extents(); aabb.size=aabb.pos*-2; @@ -2054,7 +2056,7 @@ void CollisionShapeSpatialGizmo::redraw(){ if (s->cast_to<ConvexPolygonShape>()) { - DVector<Vector3> points = s->cast_to<ConvexPolygonShape>()->get_points(); + PoolVector<Vector3> points = s->cast_to<ConvexPolygonShape>()->get_points(); if (points.size()>3) { @@ -2161,7 +2163,7 @@ void VisibilityNotifierGizmo::set_handle(int p_idx,Camera *p_camera, const Point //gt.orthonormalize(); Transform gi = gt.affine_inverse(); - AABB aabb = notifier->get_aabb(); + Rect3 aabb = notifier->get_aabb(); Vector3 ray_from = p_camera->project_ray_origin(p_point); Vector3 ray_dir = p_camera->project_ray_normal(p_point); @@ -2203,7 +2205,7 @@ void VisibilityNotifierGizmo::redraw(){ clear(); Vector<Vector3> lines; - AABB aabb = notifier->get_aabb(); + Rect3 aabb = notifier->get_aabb(); for(int i=0;i<12;i++) { Vector3 a,b; @@ -2237,6 +2239,321 @@ VisibilityNotifierGizmo::VisibilityNotifierGizmo(VisibilityNotifier* p_notifier) //////// +/// + + +String ReflectionProbeGizmo::get_handle_name(int p_idx) const { + + switch(p_idx) { + case 0: return "Extents X"; + case 1: return "Extents Y"; + case 2: return "Extents Z"; + case 3: return "Origin X"; + case 4: return "Origin Y"; + case 5: return "Origin Z"; + } + + return ""; +} +Variant ReflectionProbeGizmo::get_handle_value(int p_idx) const{ + + return Rect3(probe->get_extents(),probe->get_origin_offset()); +} +void ReflectionProbeGizmo::set_handle(int p_idx,Camera *p_camera, const Point2& p_point){ + + Transform gt = probe->get_global_transform(); + //gt.orthonormalize(); + Transform gi = gt.affine_inverse(); + + + if (p_idx<3) { + Vector3 extents = probe->get_extents(); + + Vector3 ray_from = p_camera->project_ray_origin(p_point); + Vector3 ray_dir = p_camera->project_ray_normal(p_point); + + Vector3 sg[2]={gi.xform(ray_from),gi.xform(ray_from+ray_dir*16384)}; + + Vector3 axis; + axis[p_idx]=1.0; + + Vector3 ra,rb; + Geometry::get_closest_points_between_segments(Vector3(),axis*16384,sg[0],sg[1],ra,rb); + float d = ra[p_idx]; + if (d<0.001) + d=0.001; + + extents[p_idx]=d; + probe->set_extents(extents); + } else { + + p_idx-=3; + + Vector3 origin = probe->get_origin_offset(); + origin[p_idx]=0; + + Vector3 ray_from = p_camera->project_ray_origin(p_point); + Vector3 ray_dir = p_camera->project_ray_normal(p_point); + + Vector3 sg[2]={gi.xform(ray_from),gi.xform(ray_from+ray_dir*16384)}; + + Vector3 axis; + axis[p_idx]=1.0; + + Vector3 ra,rb; + Geometry::get_closest_points_between_segments(origin-axis*16384,origin+axis*16384,sg[0],sg[1],ra,rb); + float d = ra[p_idx]; + d+=0.25; + + origin[p_idx]=d; + probe->set_origin_offset(origin); + + } +} + +void ReflectionProbeGizmo::commit_handle(int p_idx,const Variant& p_restore,bool p_cancel){ + + Rect3 restore = p_restore; + + if (p_cancel) { + probe->set_extents(restore.pos); + probe->set_origin_offset(restore.size); + return; + } + + UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo(); + ur->create_action(TTR("Change Probe Extents")); + ur->add_do_method(probe,"set_extents",probe->get_extents()); + ur->add_do_method(probe,"set_origin_offset",probe->get_origin_offset()); + ur->add_undo_method(probe,"set_extents",restore.pos); + ur->add_undo_method(probe,"set_origin_offset",restore.size); + ur->commit_action(); + +} + +void ReflectionProbeGizmo::redraw(){ + + clear(); + + Vector<Vector3> lines; + Vector<Vector3> internal_lines; + Vector3 extents = probe->get_extents(); + + Rect3 aabb; + aabb.pos=-extents; + aabb.size=extents*2; + + for(int i=0;i<12;i++) { + Vector3 a,b; + aabb.get_edge(i,a,b); + lines.push_back(a); + lines.push_back(b); + } + + for(int i=0;i<8;i++) { + Vector3 ep = aabb.get_endpoint(i); + internal_lines.push_back(probe->get_origin_offset()); + internal_lines.push_back(ep); + + + } + + Vector<Vector3> handles; + + + for(int i=0;i<3;i++) { + + Vector3 ax; + ax[i]=aabb.pos[i]+aabb.size[i]; + handles.push_back(ax); + } + + for(int i=0;i<3;i++) { + + + Vector3 orig_handle=probe->get_origin_offset(); + orig_handle[i]-=0.25; + lines.push_back(orig_handle); + handles.push_back(orig_handle); + + orig_handle[i]+=0.5; + lines.push_back(orig_handle); + } + + add_lines(lines,SpatialEditorGizmos::singleton->reflection_probe_material); + add_lines(internal_lines,SpatialEditorGizmos::singleton->reflection_probe_material_internal); + //add_unscaled_billboard(SpatialEditorGizmos::singleton->visi,0.05); + add_collision_segments(lines); + add_handles(handles); + +} +ReflectionProbeGizmo::ReflectionProbeGizmo(ReflectionProbe* p_probe){ + + probe=p_probe; + set_spatial_node(p_probe); +} + +//////// + + + +/// + + +String GIProbeGizmo::get_handle_name(int p_idx) const { + + switch(p_idx) { + case 0: return "Extents X"; + case 1: return "Extents Y"; + case 2: return "Extents Z"; + } + + return ""; +} +Variant GIProbeGizmo::get_handle_value(int p_idx) const{ + + return probe->get_extents(); +} +void GIProbeGizmo::set_handle(int p_idx,Camera *p_camera, const Point2& p_point){ + + Transform gt = probe->get_global_transform(); + //gt.orthonormalize(); + Transform gi = gt.affine_inverse(); + + + Vector3 extents = probe->get_extents(); + + Vector3 ray_from = p_camera->project_ray_origin(p_point); + Vector3 ray_dir = p_camera->project_ray_normal(p_point); + + Vector3 sg[2]={gi.xform(ray_from),gi.xform(ray_from+ray_dir*16384)}; + + Vector3 axis; + axis[p_idx]=1.0; + + Vector3 ra,rb; + Geometry::get_closest_points_between_segments(Vector3(),axis*16384,sg[0],sg[1],ra,rb); + float d = ra[p_idx]; + if (d<0.001) + d=0.001; + + extents[p_idx]=d; + probe->set_extents(extents); + +} + +void GIProbeGizmo::commit_handle(int p_idx,const Variant& p_restore,bool p_cancel){ + + Vector3 restore = p_restore; + + if (p_cancel) { + probe->set_extents(restore); + return; + } + + UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo(); + ur->create_action(TTR("Change Probe Extents")); + ur->add_do_method(probe,"set_extents",probe->get_extents()); + ur->add_undo_method(probe,"set_extents",restore); + ur->commit_action(); + +} + +void GIProbeGizmo::redraw(){ + + clear(); + + Vector<Vector3> lines; + Vector3 extents = probe->get_extents(); + + static const int subdivs[GIProbe::SUBDIV_MAX]={64,128,256,512}; + + Rect3 aabb = Rect3(-extents,extents*2); + int subdiv = subdivs[probe->get_subdiv()]; + float cell_size = aabb.get_longest_axis_size()/subdiv; + + + for(int i=0;i<12;i++) { + Vector3 a,b; + aabb.get_edge(i,a,b); + lines.push_back(a); + lines.push_back(b); + } + + add_lines(lines,SpatialEditorGizmos::singleton->gi_probe_material); + add_collision_segments(lines); + + lines.clear(); + + for(int i=1;i<subdiv;i++) { + + for(int j=0;j<3;j++) { + + + + if (cell_size*i>aabb.size[j]) { + continue; + } + + Vector2 dir; + dir[j]=1.0; + Vector2 ta,tb; + int j_n1=(j+1)%3; + int j_n2=(j+2)%3; + ta[j_n1]=1.0; + tb[j_n2]=1.0; + + + for(int k=0;k<4;k++) { + + Vector3 from=aabb.pos,to=aabb.pos; + from[j]+= cell_size*i; + to[j]+=cell_size*i; + + if (k&1) { + to[j_n1]+=aabb.size[j_n1]; + } else { + + to[j_n2]+=aabb.size[j_n2]; + } + + if (k&2) { + from[j_n1]+=aabb.size[j_n1]; + from[j_n2]+=aabb.size[j_n2]; + } + + lines.push_back(from); + lines.push_back(to); + } + + } + + } + + add_lines(lines,SpatialEditorGizmos::singleton->reflection_probe_material_internal); + + Vector<Vector3> handles; + + + for(int i=0;i<3;i++) { + + Vector3 ax; + ax[i]=aabb.pos[i]+aabb.size[i]; + handles.push_back(ax); + } + + + add_handles(handles); + +} +GIProbeGizmo::GIProbeGizmo(GIProbe* p_probe){ + + probe=p_probe; + set_spatial_node(p_probe); +} + +//////// + void NavigationMeshSpatialGizmo::redraw() { @@ -2245,8 +2562,8 @@ void NavigationMeshSpatialGizmo::redraw() { if (navmeshie.is_null()) return; - DVector<Vector3> vertices = navmeshie->get_vertices(); - DVector<Vector3>::Read vr=vertices.read(); + PoolVector<Vector3> vertices = navmeshie->get_vertices(); + PoolVector<Vector3>::Read vr=vertices.read(); List<Face3> faces; for(int i=0;i<navmeshie->get_polygon_count();i++) { Vector<int> p = navmeshie->get_polygon(i); @@ -2265,11 +2582,11 @@ void NavigationMeshSpatialGizmo::redraw() { return; Map<_EdgeKey,bool> edge_map; - DVector<Vector3> tmeshfaces; + PoolVector<Vector3> tmeshfaces; tmeshfaces.resize(faces.size()*3); { - DVector<Vector3>::Write tw=tmeshfaces.write(); + PoolVector<Vector3>::Write tw=tmeshfaces.write(); int tidx=0; @@ -2320,7 +2637,7 @@ void NavigationMeshSpatialGizmo::redraw() { Array a; a.resize(Mesh::ARRAY_MAX); a[0]=tmeshfaces; - m->add_surface(Mesh::PRIMITIVE_TRIANGLES,a); + m->add_surface_from_arrays(Mesh::PRIMITIVE_TRIANGLES,a); m->surface_set_material(0,navmesh->is_enabled()?SpatialEditorGizmos::singleton->navmesh_solid_material:SpatialEditorGizmos::singleton->navmesh_solid_material_disabled); add_mesh(m); add_collision_segments(lines); @@ -2928,6 +3245,17 @@ Ref<SpatialEditorGizmo> SpatialEditorGizmos::get_gizmo(Spatial *p_spatial) { return misg; } + if (p_spatial->cast_to<ReflectionProbe>()) { + + Ref<ReflectionProbeGizmo> misg = memnew( ReflectionProbeGizmo(p_spatial->cast_to<ReflectionProbe>()) ); + return misg; + } + if (p_spatial->cast_to<GIProbe>()) { + + Ref<GIProbeGizmo> misg = memnew( GIProbeGizmo(p_spatial->cast_to<GIProbe>()) ); + return misg; + } + if (p_spatial->cast_to<VehicleWheel>()) { Ref<VehicleWheelSpatialGizmo> misg = memnew( VehicleWheelSpatialGizmo(p_spatial->cast_to<VehicleWheel>()) ); @@ -2974,25 +3302,26 @@ Ref<SpatialEditorGizmo> SpatialEditorGizmos::get_gizmo(Spatial *p_spatial) { } -Ref<FixedMaterial> SpatialEditorGizmos::create_line_material(const Color& p_base_color) { +Ref<FixedSpatialMaterial> SpatialEditorGizmos::create_line_material(const Color& p_base_color) { - Ref<FixedMaterial> line_material = Ref<FixedMaterial>( memnew( FixedMaterial )); - line_material->set_flag(Material::FLAG_UNSHADED, true); + Ref<FixedSpatialMaterial> line_material = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial )); + line_material->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true); line_material->set_line_width(3.0); - line_material->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true); - line_material->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY, true); - line_material->set_parameter(FixedMaterial::PARAM_DIFFUSE,p_base_color); + line_material->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true); + //line_material->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true); + //->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true); + line_material->set_albedo(p_base_color); return line_material; } -Ref<FixedMaterial> SpatialEditorGizmos::create_solid_material(const Color& p_base_color) { +Ref<FixedSpatialMaterial> SpatialEditorGizmos::create_solid_material(const Color& p_base_color) { - Ref<FixedMaterial> line_material = Ref<FixedMaterial>( memnew( FixedMaterial )); - line_material->set_flag(Material::FLAG_UNSHADED, true); - line_material->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true); - line_material->set_parameter(FixedMaterial::PARAM_DIFFUSE,p_base_color); + Ref<FixedSpatialMaterial> line_material = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial )); + line_material->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true); + line_material->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true); + line_material->set_albedo(p_base_color); return line_material; @@ -3002,65 +3331,68 @@ SpatialEditorGizmos::SpatialEditorGizmos() { singleton=this; - handle_material = Ref<FixedMaterial>( memnew( FixedMaterial )); - handle_material->set_flag(Material::FLAG_UNSHADED, true); - handle_material->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(0.8,0.8,0.8)); + handle_material = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial )); + handle_material->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true); + handle_material->set_albedo(Color(0.8,0.8,0.8)); - handle2_material = Ref<FixedMaterial>( memnew( FixedMaterial )); - handle2_material->set_flag(Material::FLAG_UNSHADED, true); - handle2_material->set_fixed_flag(FixedMaterial::FLAG_USE_POINT_SIZE, true); + handle2_material = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial )); + handle2_material->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true); + handle2_material->set_flag(FixedSpatialMaterial::FLAG_USE_POINT_SIZE, true); handle_t = SpatialEditor::get_singleton()->get_icon("Editor3DHandle","EditorIcons"); handle2_material->set_point_size(handle_t->get_width()); - handle2_material->set_texture(FixedMaterial::PARAM_DIFFUSE,handle_t); - handle2_material->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(1,1,1)); - handle2_material->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true); - handle2_material->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY, true); + handle2_material->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO,handle_t); + handle2_material->set_albedo(Color(1,1,1)); + handle2_material->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true); + handle2_material->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true); + handle2_material->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true); light_material = create_line_material(Color(1,1,0.2)); - light_material_omni_icon = Ref<FixedMaterial>( memnew( FixedMaterial )); - light_material_omni_icon->set_flag(Material::FLAG_UNSHADED, true); - light_material_omni_icon->set_flag(Material::FLAG_DOUBLE_SIDED, true); - light_material_omni_icon->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER); - light_material_omni_icon->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true); - light_material_omni_icon->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(1,1,1,0.9)); - light_material_omni_icon->set_texture(FixedMaterial::PARAM_DIFFUSE,SpatialEditor::get_singleton()->get_icon("GizmoLight","EditorIcons")); + light_material_omni_icon = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial )); + light_material_omni_icon->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true); + light_material_omni_icon->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED); + light_material_omni_icon->set_depth_draw_mode(FixedSpatialMaterial::DEPTH_DRAW_DISABLED); + light_material_omni_icon->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true); + light_material_omni_icon->set_albedo(Color(1,1,1,0.9)); + light_material_omni_icon->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO,SpatialEditor::get_singleton()->get_icon("GizmoLight","EditorIcons")); - light_material_directional_icon = Ref<FixedMaterial>( memnew( FixedMaterial )); - light_material_directional_icon->set_flag(Material::FLAG_UNSHADED, true); - light_material_directional_icon->set_flag(Material::FLAG_DOUBLE_SIDED, true); - light_material_directional_icon->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER); - light_material_directional_icon->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true); - light_material_directional_icon->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(1,1,1,0.9)); - light_material_directional_icon->set_texture(FixedMaterial::PARAM_DIFFUSE,SpatialEditor::get_singleton()->get_icon("GizmoDirectionalLight","EditorIcons")); + light_material_directional_icon = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial )); + light_material_directional_icon->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true); + light_material_directional_icon->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED); + light_material_directional_icon->set_depth_draw_mode(FixedSpatialMaterial::DEPTH_DRAW_DISABLED); + light_material_directional_icon->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true); + light_material_directional_icon->set_albedo(Color(1,1,1,0.9)); + light_material_directional_icon->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO,SpatialEditor::get_singleton()->get_icon("GizmoDirectionalLight","EditorIcons")); camera_material = create_line_material(Color(1.0,0.5,1.0)); navmesh_edge_material = create_line_material(Color(0.1,0.8,1.0)); navmesh_solid_material = create_solid_material(Color(0.1,0.8,1.0,0.4)); - navmesh_edge_material->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY, false); - navmesh_solid_material->set_flag(Material::FLAG_DOUBLE_SIDED,true); + navmesh_edge_material->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, false); + navmesh_edge_material->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR, false); + navmesh_solid_material->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED); navmesh_edge_material_disabled = create_line_material(Color(1.0,0.8,0.1)); navmesh_solid_material_disabled = create_solid_material(Color(1.0,0.8,0.1,0.4)); - navmesh_edge_material_disabled->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY, false); - navmesh_solid_material_disabled->set_flag(Material::FLAG_DOUBLE_SIDED,true); + navmesh_edge_material_disabled->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, false); + navmesh_edge_material_disabled->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR, false); + navmesh_solid_material_disabled->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED); skeleton_material = create_line_material(Color(0.6,1.0,0.3)); - skeleton_material->set_flag(Material::FLAG_DOUBLE_SIDED,true); - skeleton_material->set_flag(Material::FLAG_UNSHADED,true); - skeleton_material->set_flag(Material::FLAG_ONTOP,true); - skeleton_material->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER); + skeleton_material->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED); + skeleton_material->set_flag(FixedSpatialMaterial::FLAG_UNSHADED,true); + skeleton_material->set_flag(FixedSpatialMaterial::FLAG_ONTOP,true); + skeleton_material->set_depth_draw_mode(FixedSpatialMaterial::DEPTH_DRAW_DISABLED); //position 3D Shared mesh pos3d_mesh = Ref<Mesh>( memnew( Mesh ) ); { - DVector<Vector3> cursor_points; - DVector<Color> cursor_colors; + PoolVector<Vector3> cursor_points; + PoolVector<Color> cursor_colors; float cs = 0.25; cursor_points.push_back(Vector3(+cs,0,0)); cursor_points.push_back(Vector3(-cs,0,0)); @@ -3075,85 +3407,91 @@ SpatialEditorGizmos::SpatialEditorGizmos() { cursor_colors.push_back(Color(0.5,0.5,1,0.7)); cursor_colors.push_back(Color(0.5,0.5,1,0.7)); - Ref<FixedMaterial> mat = memnew( FixedMaterial ); - mat->set_flag(Material::FLAG_UNSHADED,true); - mat->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY,true); - mat->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA,true); + Ref<FixedSpatialMaterial> mat = memnew( FixedSpatialMaterial ); + mat->set_flag(FixedSpatialMaterial::FLAG_UNSHADED,true); + mat->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR,true); + mat->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR,true); + mat->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT,true); mat->set_line_width(3); Array d; d.resize(VS::ARRAY_MAX); d[Mesh::ARRAY_VERTEX]=cursor_points; d[Mesh::ARRAY_COLOR]=cursor_colors; - pos3d_mesh->add_surface(Mesh::PRIMITIVE_LINES,d); + pos3d_mesh->add_surface_from_arrays(Mesh::PRIMITIVE_LINES,d); pos3d_mesh->surface_set_material(0,mat); } listener_line_mesh = Ref<Mesh>(memnew(Mesh)); { - DVector<Vector3> cursor_points; - DVector<Color> cursor_colors; + PoolVector<Vector3> cursor_points; + PoolVector<Color> cursor_colors; cursor_points.push_back(Vector3(0, 0, 0)); cursor_points.push_back(Vector3(0, 0, -1.0)); cursor_colors.push_back(Color(0.5, 0.5, 0.5, 0.7)); cursor_colors.push_back(Color(0.5, 0.5, 0.5, 0.7)); - Ref<FixedMaterial> mat = memnew(FixedMaterial); - mat->set_flag(Material::FLAG_UNSHADED, true); - mat->set_fixed_flag(FixedMaterial::FLAG_USE_COLOR_ARRAY, true); - mat->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true); + Ref<FixedSpatialMaterial> mat = memnew(FixedSpatialMaterial); + mat->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true); + mat->set_flag(FixedSpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true); + mat->set_flag(FixedSpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true); + mat->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true); mat->set_line_width(3); Array d; d.resize(VS::ARRAY_MAX); d[Mesh::ARRAY_VERTEX] = cursor_points; d[Mesh::ARRAY_COLOR] = cursor_colors; - listener_line_mesh->add_surface(Mesh::PRIMITIVE_LINES, d); + listener_line_mesh->add_surface_from_arrays(Mesh::PRIMITIVE_LINES, d); listener_line_mesh->surface_set_material(0, mat); } - sample_player_icon = Ref<FixedMaterial>( memnew( FixedMaterial )); - sample_player_icon->set_flag(Material::FLAG_UNSHADED, true); - sample_player_icon->set_flag(Material::FLAG_DOUBLE_SIDED, true); - sample_player_icon->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER); - sample_player_icon->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true); - sample_player_icon->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(1,1,1,0.9)); - sample_player_icon->set_texture(FixedMaterial::PARAM_DIFFUSE,SpatialEditor::get_singleton()->get_icon("GizmoSpatialSamplePlayer","EditorIcons")); + sample_player_icon = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial )); + sample_player_icon->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true); + sample_player_icon->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED); + sample_player_icon->set_depth_draw_mode(FixedSpatialMaterial::DEPTH_DRAW_DISABLED); + sample_player_icon->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true); + sample_player_icon->set_albedo(Color(1,1,1,0.9)); + sample_player_icon->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO,SpatialEditor::get_singleton()->get_icon("GizmoSpatialSamplePlayer","EditorIcons")); room_material = create_line_material(Color(1.0,0.6,0.9)); portal_material = create_line_material(Color(1.0,0.8,0.6)); raycast_material = create_line_material(Color(1.0,0.8,0.6)); car_wheel_material = create_line_material(Color(0.6,0.8,1.0)); visibility_notifier_material = create_line_material(Color(1.0,0.5,1.0)); + reflection_probe_material = create_line_material(Color(0.5,1.0,0.7)); + reflection_probe_material_internal = create_line_material(Color(0.3,0.8,0.5,0.15)); + gi_probe_material = create_line_material(Color(0.7,1.0,0.5)); + gi_probe_material_internal = create_line_material(Color(0.5,0.8,0.3,0.4)); joint_material = create_line_material(Color(0.6,0.8,1.0)); - stream_player_icon = Ref<FixedMaterial>( memnew( FixedMaterial )); - stream_player_icon->set_flag(Material::FLAG_UNSHADED, true); - stream_player_icon->set_flag(Material::FLAG_DOUBLE_SIDED, true); - stream_player_icon->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER); - stream_player_icon->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true); - stream_player_icon->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(1,1,1,0.9)); - stream_player_icon->set_texture(FixedMaterial::PARAM_DIFFUSE,SpatialEditor::get_singleton()->get_icon("GizmoSpatialStreamPlayer","EditorIcons")); - - visibility_notifier_icon = Ref<FixedMaterial>( memnew( FixedMaterial )); - visibility_notifier_icon->set_flag(Material::FLAG_UNSHADED, true); - visibility_notifier_icon->set_flag(Material::FLAG_DOUBLE_SIDED, true); - visibility_notifier_icon->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER); - visibility_notifier_icon->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true); - visibility_notifier_icon->set_parameter(FixedMaterial::PARAM_DIFFUSE,Color(1,1,1,0.9)); - visibility_notifier_icon->set_texture(FixedMaterial::PARAM_DIFFUSE,SpatialEditor::get_singleton()->get_icon("Visible","EditorIcons")); - - listener_icon = Ref<FixedMaterial>(memnew(FixedMaterial)); - listener_icon->set_flag(Material::FLAG_UNSHADED, true); - listener_icon->set_flag(Material::FLAG_DOUBLE_SIDED, true); - listener_icon->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER); - listener_icon->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA, true); - listener_icon->set_parameter(FixedMaterial::PARAM_DIFFUSE, Color(1, 1, 1, 0.9)); - listener_icon->set_texture(FixedMaterial::PARAM_DIFFUSE, SpatialEditor::get_singleton()->get_icon("GizmoListener", "EditorIcons")); + stream_player_icon = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial )); + stream_player_icon->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true); + stream_player_icon->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED); + stream_player_icon->set_depth_draw_mode(FixedSpatialMaterial::DEPTH_DRAW_DISABLED); + stream_player_icon->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true); + stream_player_icon->set_albedo(Color(1,1,1,0.9)); + stream_player_icon->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO,SpatialEditor::get_singleton()->get_icon("GizmoSpatialStreamPlayer","EditorIcons")); + + visibility_notifier_icon = Ref<FixedSpatialMaterial>( memnew( FixedSpatialMaterial )); + visibility_notifier_icon->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true); + visibility_notifier_icon->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED); + visibility_notifier_icon->set_depth_draw_mode(FixedSpatialMaterial::DEPTH_DRAW_DISABLED); + visibility_notifier_icon->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true); + visibility_notifier_icon->set_albedo(Color(1,1,1,0.9)); + visibility_notifier_icon->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO,SpatialEditor::get_singleton()->get_icon("Visible","EditorIcons")); + + listener_icon = Ref<FixedSpatialMaterial>(memnew(FixedSpatialMaterial)); + listener_icon->set_flag(FixedSpatialMaterial::FLAG_UNSHADED, true); + listener_icon->set_cull_mode(FixedSpatialMaterial::CULL_DISABLED); + listener_icon->set_depth_draw_mode(FixedSpatialMaterial::DEPTH_DRAW_DISABLED); + listener_icon->set_feature(FixedSpatialMaterial::FEATURE_TRANSPARENT, true); + listener_icon->set_albedo( Color(1, 1, 1, 0.9)); + listener_icon->set_texture(FixedSpatialMaterial::TEXTURE_ALBEDO, SpatialEditor::get_singleton()->get_icon("GizmoListener", "EditorIcons")); { - DVector<Vector3> vertices; + PoolVector<Vector3> vertices; #undef ADD_VTX #define ADD_VTX(m_idx);\ @@ -3198,3 +3536,4 @@ SpatialEditorGizmos::SpatialEditorGizmos() { } + diff --git a/tools/editor/spatial_editor_gizmos.h b/tools/editor/spatial_editor_gizmos.h index 3d7272f522..8fde52b05a 100644 --- a/tools/editor/spatial_editor_gizmos.h +++ b/tools/editor/spatial_editor_gizmos.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -45,6 +45,8 @@ #include "scene/3d/portal.h" #include "scene/3d/ray_cast.h" #include "scene/3d/navigation_mesh.h" +#include "scene/3d/reflection_probe.h" +#include "scene/3d/gi_probe.h" #include "scene/3d/vehicle_body.h" #include "scene/3d/collision_polygon.h" @@ -55,7 +57,7 @@ class Camera; class EditorSpatialGizmo : public SpatialEditorGizmo { - OBJ_TYPE(EditorSpatialGizmo,SpatialGizmo); + GDCLASS(EditorSpatialGizmo,SpatialGizmo); struct Instance{ @@ -127,7 +129,7 @@ public: class LightSpatialGizmo : public EditorSpatialGizmo { - OBJ_TYPE(LightSpatialGizmo,EditorSpatialGizmo); + GDCLASS(LightSpatialGizmo,EditorSpatialGizmo); Light* light; @@ -146,7 +148,7 @@ public: class ListenerSpatialGizmo : public EditorSpatialGizmo { - OBJ_TYPE(ListenerSpatialGizmo, EditorSpatialGizmo); + GDCLASS(ListenerSpatialGizmo, EditorSpatialGizmo); Listener* listener; @@ -159,7 +161,7 @@ public: class CameraSpatialGizmo : public EditorSpatialGizmo { - OBJ_TYPE(CameraSpatialGizmo,EditorSpatialGizmo); + GDCLASS(CameraSpatialGizmo,EditorSpatialGizmo); Camera* camera; @@ -180,7 +182,7 @@ public: class MeshInstanceSpatialGizmo : public EditorSpatialGizmo { - OBJ_TYPE(MeshInstanceSpatialGizmo,EditorSpatialGizmo); + GDCLASS(MeshInstanceSpatialGizmo,EditorSpatialGizmo); MeshInstance* mesh; @@ -193,7 +195,7 @@ public: class Position3DSpatialGizmo : public EditorSpatialGizmo { - OBJ_TYPE(Position3DSpatialGizmo,EditorSpatialGizmo); + GDCLASS(Position3DSpatialGizmo,EditorSpatialGizmo); Position3D* p3d; @@ -206,7 +208,7 @@ public: class SkeletonSpatialGizmo : public EditorSpatialGizmo { - OBJ_TYPE(SkeletonSpatialGizmo,EditorSpatialGizmo); + GDCLASS(SkeletonSpatialGizmo,EditorSpatialGizmo); Skeleton* skel; @@ -222,7 +224,7 @@ public: class SpatialPlayerSpatialGizmo : public EditorSpatialGizmo { - OBJ_TYPE(SpatialPlayerSpatialGizmo,EditorSpatialGizmo); + GDCLASS(SpatialPlayerSpatialGizmo,EditorSpatialGizmo); SpatialPlayer* splayer; @@ -237,7 +239,7 @@ public: class TestCubeSpatialGizmo : public EditorSpatialGizmo { - OBJ_TYPE(TestCubeSpatialGizmo,EditorSpatialGizmo); + GDCLASS(TestCubeSpatialGizmo,EditorSpatialGizmo); TestCube* tc; @@ -250,7 +252,7 @@ public: class RoomSpatialGizmo : public EditorSpatialGizmo { - OBJ_TYPE(RoomSpatialGizmo,EditorSpatialGizmo); + GDCLASS(RoomSpatialGizmo,EditorSpatialGizmo); struct _EdgeKey { @@ -275,7 +277,7 @@ public: class PortalSpatialGizmo : public EditorSpatialGizmo { - OBJ_TYPE(PortalSpatialGizmo,EditorSpatialGizmo); + GDCLASS(PortalSpatialGizmo,EditorSpatialGizmo); Portal* portal; @@ -289,7 +291,7 @@ public: class VisibilityNotifierGizmo : public EditorSpatialGizmo { - OBJ_TYPE(VisibilityNotifierGizmo ,EditorSpatialGizmo); + GDCLASS(VisibilityNotifierGizmo ,EditorSpatialGizmo); VisibilityNotifier* notifier; @@ -307,10 +309,48 @@ public: }; +class ReflectionProbeGizmo : public EditorSpatialGizmo { + + GDCLASS(ReflectionProbeGizmo ,EditorSpatialGizmo); + + + ReflectionProbe* probe; + +public: + + virtual String get_handle_name(int p_idx) const; + virtual Variant get_handle_value(int p_idx) const; + virtual void set_handle(int p_idx,Camera *p_camera, const Point2& p_point); + virtual void commit_handle(int p_idx,const Variant& p_restore,bool p_cancel=false); + + void redraw(); + ReflectionProbeGizmo(ReflectionProbe* p_notifier=NULL); + +}; + +class GIProbeGizmo : public EditorSpatialGizmo { + + GDCLASS(GIProbeGizmo ,EditorSpatialGizmo); + + + GIProbe* probe; + +public: + + virtual String get_handle_name(int p_idx) const; + virtual Variant get_handle_value(int p_idx) const; + virtual void set_handle(int p_idx,Camera *p_camera, const Point2& p_point); + virtual void commit_handle(int p_idx,const Variant& p_restore,bool p_cancel=false); + + void redraw(); + GIProbeGizmo(GIProbe* p_notifier=NULL); + +}; + class CollisionShapeSpatialGizmo : public EditorSpatialGizmo { - OBJ_TYPE(CollisionShapeSpatialGizmo,EditorSpatialGizmo); + GDCLASS(CollisionShapeSpatialGizmo,EditorSpatialGizmo); CollisionShape* cs; @@ -327,7 +367,7 @@ public: class CollisionPolygonSpatialGizmo : public EditorSpatialGizmo { - OBJ_TYPE(CollisionPolygonSpatialGizmo,EditorSpatialGizmo); + GDCLASS(CollisionPolygonSpatialGizmo,EditorSpatialGizmo); CollisionPolygon* polygon; @@ -339,9 +379,10 @@ public: }; + class RayCastSpatialGizmo : public EditorSpatialGizmo { - OBJ_TYPE(RayCastSpatialGizmo,EditorSpatialGizmo); + GDCLASS(RayCastSpatialGizmo,EditorSpatialGizmo); RayCast* raycast; @@ -356,7 +397,7 @@ public: class VehicleWheelSpatialGizmo : public EditorSpatialGizmo { - OBJ_TYPE(VehicleWheelSpatialGizmo,EditorSpatialGizmo); + GDCLASS(VehicleWheelSpatialGizmo,EditorSpatialGizmo); VehicleWheel* car_wheel; @@ -370,7 +411,7 @@ public: class NavigationMeshSpatialGizmo : public EditorSpatialGizmo { - OBJ_TYPE(NavigationMeshSpatialGizmo,EditorSpatialGizmo); + GDCLASS(NavigationMeshSpatialGizmo,EditorSpatialGizmo); struct _EdgeKey { @@ -395,7 +436,7 @@ public: class PinJointSpatialGizmo : public EditorSpatialGizmo { - OBJ_TYPE(PinJointSpatialGizmo,EditorSpatialGizmo); + GDCLASS(PinJointSpatialGizmo,EditorSpatialGizmo); PinJoint* p3d; @@ -409,7 +450,7 @@ public: class HingeJointSpatialGizmo : public EditorSpatialGizmo { - OBJ_TYPE(HingeJointSpatialGizmo,EditorSpatialGizmo); + GDCLASS(HingeJointSpatialGizmo,EditorSpatialGizmo); HingeJoint* p3d; @@ -422,7 +463,7 @@ public: class SliderJointSpatialGizmo : public EditorSpatialGizmo { - OBJ_TYPE(SliderJointSpatialGizmo,EditorSpatialGizmo); + GDCLASS(SliderJointSpatialGizmo,EditorSpatialGizmo); SliderJoint* p3d; @@ -435,7 +476,7 @@ public: class ConeTwistJointSpatialGizmo : public EditorSpatialGizmo { - OBJ_TYPE(ConeTwistJointSpatialGizmo,EditorSpatialGizmo); + GDCLASS(ConeTwistJointSpatialGizmo,EditorSpatialGizmo); ConeTwistJoint* p3d; @@ -449,7 +490,7 @@ public: class Generic6DOFJointSpatialGizmo : public EditorSpatialGizmo { - OBJ_TYPE(Generic6DOFJointSpatialGizmo,EditorSpatialGizmo); + GDCLASS(Generic6DOFJointSpatialGizmo,EditorSpatialGizmo); Generic6DOFJoint* p3d; @@ -464,34 +505,38 @@ public: class SpatialEditorGizmos { public: - Ref<FixedMaterial> create_line_material(const Color& p_base_color); - Ref<FixedMaterial> create_solid_material(const Color& p_base_color); - Ref<FixedMaterial> handle2_material; - Ref<FixedMaterial> handle_material; - Ref<FixedMaterial> light_material; - Ref<FixedMaterial> light_material_omni_icon; - Ref<FixedMaterial> light_material_directional_icon; - Ref<FixedMaterial> camera_material; - Ref<FixedMaterial> skeleton_material; - Ref<FixedMaterial> room_material; - Ref<FixedMaterial> portal_material; - Ref<FixedMaterial> raycast_material; - Ref<FixedMaterial> visibility_notifier_material; - Ref<FixedMaterial> car_wheel_material; - Ref<FixedMaterial> joint_material; - - Ref<FixedMaterial> navmesh_edge_material; - Ref<FixedMaterial> navmesh_solid_material; - Ref<FixedMaterial> navmesh_edge_material_disabled; - Ref<FixedMaterial> navmesh_solid_material_disabled; - - Ref<FixedMaterial> listener_icon; - - Ref<FixedMaterial> sample_player_icon; - Ref<FixedMaterial> stream_player_icon; - Ref<FixedMaterial> visibility_notifier_icon; - - Ref<FixedMaterial> shape_material; + Ref<FixedSpatialMaterial> create_line_material(const Color& p_base_color); + Ref<FixedSpatialMaterial> create_solid_material(const Color& p_base_color); + Ref<FixedSpatialMaterial> handle2_material; + Ref<FixedSpatialMaterial> handle_material; + Ref<FixedSpatialMaterial> light_material; + Ref<FixedSpatialMaterial> light_material_omni_icon; + Ref<FixedSpatialMaterial> light_material_directional_icon; + Ref<FixedSpatialMaterial> camera_material; + Ref<FixedSpatialMaterial> skeleton_material; + Ref<FixedSpatialMaterial> reflection_probe_material; + Ref<FixedSpatialMaterial> reflection_probe_material_internal; + Ref<FixedSpatialMaterial> gi_probe_material; + Ref<FixedSpatialMaterial> gi_probe_material_internal; + Ref<FixedSpatialMaterial> room_material; + Ref<FixedSpatialMaterial> portal_material; + Ref<FixedSpatialMaterial> raycast_material; + Ref<FixedSpatialMaterial> visibility_notifier_material; + Ref<FixedSpatialMaterial> car_wheel_material; + Ref<FixedSpatialMaterial> joint_material; + + Ref<FixedSpatialMaterial> navmesh_edge_material; + Ref<FixedSpatialMaterial> navmesh_solid_material; + Ref<FixedSpatialMaterial> navmesh_edge_material_disabled; + Ref<FixedSpatialMaterial> navmesh_solid_material_disabled; + + Ref<FixedSpatialMaterial> listener_icon; + + Ref<FixedSpatialMaterial> sample_player_icon; + Ref<FixedSpatialMaterial> stream_player_icon; + Ref<FixedSpatialMaterial> visibility_notifier_icon; + + Ref<FixedSpatialMaterial> shape_material; Ref<Texture> handle_t; Ref<Mesh> pos3d_mesh; @@ -505,5 +550,4 @@ public: SpatialEditorGizmos(); }; - #endif // SPATIAL_EDITOR_GIZMOS_H diff --git a/tools/scripts/addheader.py b/tools/scripts/addheader.py index 7838e16ae0..056e807c81 100644 --- a/tools/scripts/addheader.py +++ b/tools/scripts/addheader.py @@ -6,7 +6,7 @@ header = """\ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ diff --git a/tools/translations/ar.po b/tools/translations/ar.po index de03046e16..0bfef1cfe1 100644 --- a/tools/translations/ar.po +++ b/tools/translations/ar.po @@ -1,5 +1,5 @@ # Arabic translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # # Mohammmad Khashashneh <mohammad.rasmi@gmail.com>, 2016. @@ -33,12 +33,6 @@ msgid "step argument is zero!" msgstr "" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" msgstr "" @@ -383,74 +377,74 @@ msgstr "" msgid "just released" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid unique name." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid product GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid background color." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" @@ -562,10 +556,6 @@ msgid "" "as parent." msgstr "" -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "" - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -625,7 +615,8 @@ msgstr "" msgid "Cancel" msgstr "" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "" @@ -1768,6 +1759,11 @@ msgid "Constants:" msgstr "" #: tools/editor/editor_help.cpp +#, fuzzy +msgid "Property Description:" +msgstr "عمل اشتراك" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "" @@ -1835,7 +1831,9 @@ msgstr "" msgid "Save Resource As.." msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "" @@ -2060,7 +2058,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "" @@ -2740,6 +2740,7 @@ msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "" @@ -2967,6 +2968,10 @@ msgid "Auto" msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +msgid "Root Node Name:" +msgstr "" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "" @@ -3867,6 +3872,49 @@ msgstr "" msgid "Snap (Pixels):" msgstr "" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Change default type" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4731,18 +4779,6 @@ msgstr "" msgid "Contextual Help" msgstr "" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "" @@ -5505,6 +5541,64 @@ msgid "No exporter for platform '%s' yet." msgstr "" #: tools/editor/project_export.cpp +msgid "Create Android keystore" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Full name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organization" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "State" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Password" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "at least 6 characters" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "File name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "" @@ -5964,10 +6058,6 @@ msgid "Erase Input Action Event" msgstr "" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "" @@ -6111,7 +6201,7 @@ msgstr "" msgid "Dir.." msgstr "" -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "" @@ -6144,10 +6234,6 @@ msgid "Properties:" msgstr "" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "" @@ -6224,14 +6310,6 @@ msgid "Scene Run Settings" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "" @@ -6240,10 +6318,6 @@ msgid "Error loading scene from %s" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "" @@ -6282,10 +6356,6 @@ msgid "This operation can't be done without a scene." msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "" @@ -6310,10 +6380,6 @@ msgid "Remove Node(s)" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6352,10 +6418,15 @@ msgid "Change Type" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" +msgid "Attach Script" msgstr "" #: tools/editor/scene_tree_dock.cpp +#, fuzzy +msgid "Clear Script" +msgstr "عمل اشتراك" + +#: tools/editor/scene_tree_dock.cpp msgid "Merge From Scene" msgstr "" @@ -6378,13 +6449,11 @@ msgid "" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." +msgid "Attach a new or existing script for the selected node." msgstr "" -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." msgstr "" #: tools/editor/scene_tree_editor.cpp @@ -6480,6 +6549,10 @@ msgid "Could not create script in filesystem." msgstr "" #: tools/editor/script_create_dialog.cpp +msgid "Error loading script from %s" +msgstr "" + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "" @@ -6492,15 +6565,16 @@ msgid "Invalid base path" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "File exists" +msgid "Invalid extension" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Invalid extension" -msgstr "" +#, fuzzy +msgid "Create new script" +msgstr "عمل اشتراك" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" +msgid "Load existing script" msgstr "" #: tools/editor/script_create_dialog.cpp @@ -6512,7 +6586,7 @@ msgid "Built-In Script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" +msgid "Attach Node Script" msgstr "" #: tools/editor/script_editor_debugger.cpp @@ -6678,3 +6752,7 @@ msgstr "" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Notifier Extents" msgstr "" + +#: tools/editor/spatial_editor_gizmos.cpp +msgid "Change Probe Extents" +msgstr "" diff --git a/tools/translations/bg.po b/tools/translations/bg.po index f1fdc9086a..9197a6e702 100644 --- a/tools/translations/bg.po +++ b/tools/translations/bg.po @@ -1,5 +1,5 @@ # Bulgarian translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # # Bojidar Marinov <bojidar.marinov.bg@gmail.com>, 2016. @@ -35,12 +35,6 @@ msgid "step argument is zero!" msgstr "Стъпката на range() е нула!" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp #, fuzzy msgid "Not a script with an instance" msgstr "Скриптът няма инстанция" @@ -395,75 +389,75 @@ msgstr "" msgid "just released" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Error creating the signature object." msgstr "Имаше грешка при изнасяне на проекта!" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid unique name." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid product GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid background color." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" @@ -601,10 +595,6 @@ msgid "" "as parent." msgstr "" -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "" - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -667,7 +657,8 @@ msgstr "" msgid "Cancel" msgstr "Отказ" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "Добре" @@ -1811,6 +1802,10 @@ msgid "Constants:" msgstr "" #: tools/editor/editor_help.cpp +msgid "Property Description:" +msgstr "" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "" @@ -1878,7 +1873,9 @@ msgstr "" msgid "Save Resource As.." msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "" @@ -2103,7 +2100,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "Изберете главна сцена" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "" @@ -2784,6 +2783,7 @@ msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "" @@ -3011,6 +3011,10 @@ msgid "Auto" msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +msgid "Root Node Name:" +msgstr "" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "" @@ -3911,6 +3915,49 @@ msgstr "" msgid "Snap (Pixels):" msgstr "" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Change default type" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4776,18 +4823,6 @@ msgstr "" msgid "Contextual Help" msgstr "" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "" @@ -5550,6 +5585,66 @@ msgid "No exporter for platform '%s' yet." msgstr "" #: tools/editor/project_export.cpp +#, fuzzy +msgid "Create Android keystore" +msgstr "Създаване на папка" + +#: tools/editor/project_export.cpp +msgid "Full name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Organization" +msgstr "Преходи" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "State" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Password" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "at least 6 characters" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "File name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "" @@ -6009,10 +6104,6 @@ msgid "Erase Input Action Event" msgstr "" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "" @@ -6156,7 +6247,7 @@ msgstr "" msgid "Dir.." msgstr "" -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "" @@ -6190,10 +6281,6 @@ msgid "Properties:" msgstr "" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "" @@ -6272,14 +6359,6 @@ msgid "Scene Run Settings" msgstr "Настройки за пускане на сцена" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "" @@ -6288,10 +6367,6 @@ msgid "Error loading scene from %s" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "" @@ -6330,10 +6405,6 @@ msgid "This operation can't be done without a scene." msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "" @@ -6358,10 +6429,6 @@ msgid "Remove Node(s)" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6400,8 +6467,14 @@ msgid "Change Type" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" -msgstr "" +#, fuzzy +msgid "Attach Script" +msgstr "Нова сцена" + +#: tools/editor/scene_tree_dock.cpp +#, fuzzy +msgid "Clear Script" +msgstr "Нова сцена" #: tools/editor/scene_tree_dock.cpp msgid "Merge From Scene" @@ -6427,13 +6500,11 @@ msgid "" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." +msgid "Attach a new or existing script for the selected node." msgstr "" -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." msgstr "" #: tools/editor/scene_tree_editor.cpp @@ -6529,6 +6600,11 @@ msgid "Could not create script in filesystem." msgstr "" #: tools/editor/script_create_dialog.cpp +#, fuzzy +msgid "Error loading script from %s" +msgstr "Грешка при зареждането на шрифта." + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "" @@ -6541,15 +6617,16 @@ msgid "Invalid base path" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "File exists" +msgid "Invalid extension" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Invalid extension" -msgstr "" +#, fuzzy +msgid "Create new script" +msgstr "Създаване на папка" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" +msgid "Load existing script" msgstr "" #: tools/editor/script_create_dialog.cpp @@ -6561,8 +6638,9 @@ msgid "Built-In Script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" -msgstr "" +#, fuzzy +msgid "Attach Node Script" +msgstr "Нова сцена" #: tools/editor/script_editor_debugger.cpp msgid "Bytes:" @@ -6727,3 +6805,7 @@ msgstr "" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Notifier Extents" msgstr "" + +#: tools/editor/spatial_editor_gizmos.cpp +msgid "Change Probe Extents" +msgstr "" diff --git a/tools/translations/bn.po b/tools/translations/bn.po index 19861e2158..a3a3a072fc 100644 --- a/tools/translations/bn.po +++ b/tools/translations/bn.po @@ -1,14 +1,14 @@ # Bengali translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # -# Abu Md. Maruf Sarker <maruf.webdev@gmail.com>, 2016. +# Abu Md. Maruf Sarker <maruf.webdev@gmail.com>, 2016-2017. # Tahmid Karim <tahmidk15@gmail.com>, 2016. # msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" -"PO-Revision-Date: 2016-09-02 13:47+0000\n" +"PO-Revision-Date: 2017-01-07 04:19+0000\n" "Last-Translator: ABU MD. MARUF SARKER <maruf.webdev@gmail.com>\n" "Language-Team: Bengali <https://hosted.weblate.org/projects/godot-engine/" "godot/bn/>\n" @@ -16,12 +16,12 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8-bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 2.8\n" +"X-Generator: Weblate 2.11-dev\n" #: modules/gdscript/gd_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp msgid "Invalid type argument to convert(), use TYPE_* constants." -msgstr "অগ্রহণযোগ্য মান convert()-এ গিয়েছে, TYPE_* ধ্রুবক ব্যবহার করুন।" +msgstr "অগ্রহণযোগ্য মান/আর্গুমেন্ট convert()-এ গিয়েছে, TYPE_* ধ্রুবক ব্যবহার করুন।" #: modules/gdscript/gd_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -30,13 +30,7 @@ msgstr "বিন্যাস জানার জন্য যথেষ্ট #: modules/gdscript/gd_functions.cpp msgid "step argument is zero!" -msgstr "ধাপ মান শূন্য!" - -#: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" +msgstr "ধাপ মান/আর্গুমেন্ট শূন্য!" #: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" @@ -167,9 +161,8 @@ msgid "Editing Signal:" msgstr "সংকেত/সিগন্যাল সম্পাদন:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Change Expression" -msgstr "অ্যানিমেশনের (Anim) ট্র্যানজিশন/স্থানান্তরণ পরিবর্তন করুন" +msgstr "অভিব্যক্তি (Expression) পরিবর্তন করুন" #: modules/visual_script/visual_script_editor.cpp msgid "Add Node" @@ -178,84 +171,86 @@ msgstr "নোড সংযোজন করুন" #: modules/visual_script/visual_script_editor.cpp msgid "Hold Meta to drop a Getter. Hold Shift to drop a generic signature." msgstr "" -"গেটার (Getter) ফেলতে/নামাতে মেটা কী (Meta) চাপুন। জেনেরিক সিগনেচার (generic " -"signature) ফেলতে/নামাতে শিফট কী (Shift) চাপুন।" +"গেটার (Getter) তৈরি করতে/নামাতে মেটা কী (Meta) চেপে রাখুন। জেনেরিক সিগনেচার " +"(generic signature) তৈরি করতে/নামাতে শিফট কী (Shift) চেপে রাখুন।" #: modules/visual_script/visual_script_editor.cpp msgid "Hold Ctrl to drop a Getter. Hold Shift to drop a generic signature." msgstr "" -"গেটার (Getter) ফেলতে/নামাতে কন্ট্রোল কী (Ctrl) চাপুন। জেনেরিক সিগনেচার (generic " -"signature) ফেলতে/নামাতে শিফট কী (Shift) চাপুন।" +"গেটার (Getter) তৈরি করতে/নামাতে কন্ট্রোল কী (Ctrl) চেপে রাখুন। জেনেরিক সিগনেচার " +"(generic signature) তৈরি করতে/নামাতে শিফট কী (Shift) চেপে রাখুন।" #: modules/visual_script/visual_script_editor.cpp msgid "Hold Meta to drop a simple reference to the node." msgstr "" +"নোডে সাধারণ সম্পর্ক (reference) তৈরি করতে/নামাতে মেটা কী (Meta) চেপে রাখুন।" #: modules/visual_script/visual_script_editor.cpp msgid "Hold Ctrl to drop a simple reference to the node." msgstr "" +"নোডে সাধারণ সম্পর্ক (reference) তৈরি করতে/নামাতে কন্ট্রোল কী (Ctrl) চেপে রাখুন।" #: modules/visual_script/visual_script_editor.cpp msgid "Hold Meta to drop a Variable Setter." -msgstr "" +msgstr "চলক সেটার (Variable Setter) তৈরি করতে/নামাতে মেটা কী (Meta) চেপে রাখুন।" #: modules/visual_script/visual_script_editor.cpp msgid "Hold Ctrl to drop a Variable Setter." msgstr "" +"চলক সেটার (Variable Setter) তৈরি করতে/নামাতে কন্ট্রোল কী (Ctrl) চেপে রাখুন।" #: modules/visual_script/visual_script_editor.cpp msgid "Add Preload Node" -msgstr "" +msgstr "প্রিলোড নোড যুক্ত করুন" #: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" -msgstr "" +msgstr "শাখা (tree) হতে নোড (সমূহ) যুক্ত করুন" #: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" -msgstr "" +msgstr "গেটার (Getter) এর বৈশিষ্ট্যে যুক্ত করুন" #: modules/visual_script/visual_script_editor.cpp msgid "Add Setter Property" -msgstr "" +msgstr "সেটার (Setter) এর বৈশিষ্ট্যে যুক্ত করুন" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Condition" -msgstr "অনুবাদসমূহ" +msgstr "শর্ত (Condition)" #: modules/visual_script/visual_script_editor.cpp msgid "Sequence" -msgstr "" +msgstr "ক্রম (Sequence)" #: modules/visual_script/visual_script_editor.cpp msgid "Switch" -msgstr "" +msgstr "সুইচ (Switch)" #: modules/visual_script/visual_script_editor.cpp msgid "Iterator" -msgstr "" +msgstr "পুনরুক্তিকারী (Iterator)" #: modules/visual_script/visual_script_editor.cpp msgid "While" -msgstr "" +msgstr "যতক্ষণ (While)" #: modules/visual_script/visual_script_editor.cpp msgid "Return" -msgstr "" +msgstr "ফেরৎ পাঠান (Return)" #: modules/visual_script/visual_script_editor.cpp tools/editor/call_dialog.cpp msgid "Call" -msgstr "" +msgstr "ডাকুন (Call)" #: modules/visual_script/visual_script_editor.cpp msgid "Get" -msgstr "" +msgstr "মান পান (Get)" #: modules/visual_script/visual_script_editor.cpp #: tools/editor/property_editor.cpp msgid "Set" -msgstr "" +msgstr "নিযুক্ত করুন (Set)" #: modules/visual_script/visual_script_editor.cpp #: tools/editor/plugins/canvas_item_editor_plugin.cpp @@ -264,23 +259,23 @@ msgstr "" #: tools/editor/plugins/shader_editor_plugin.cpp #: tools/editor/project_manager.cpp msgid "Edit" -msgstr "" +msgstr "সম্পাদন করুন (Edit)" #: modules/visual_script/visual_script_editor.cpp msgid "Base Type:" -msgstr "" +msgstr "তলের ধরণ (Base Type):" #: modules/visual_script/visual_script_editor.cpp tools/editor/editor_help.cpp msgid "Members:" -msgstr "" +msgstr "সদস্যগণ (Members):" #: modules/visual_script/visual_script_editor.cpp msgid "Available Nodes:" -msgstr "" +msgstr "উপস্থিত নোডসমূহ:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit graph" -msgstr "" +msgstr "গ্রাফ সম্পাদন করতে ফাংশন নির্বাচন অথবা তৈরি করুন" #: modules/visual_script/visual_script_editor.cpp tools/editor/call_dialog.cpp #: tools/editor/connections_dialog.cpp @@ -293,19 +288,19 @@ msgstr "" #: tools/editor/project_settings.cpp tools/editor/property_editor.cpp #: tools/editor/run_settings_dialog.cpp tools/editor/settings_config_dialog.cpp msgid "Close" -msgstr "" +msgstr "বন্ধ করুন" #: modules/visual_script/visual_script_editor.cpp msgid "Edit Signal Arguments:" -msgstr "" +msgstr "সংকেত/সিগন্যাল-এর মান/আর্গুমেন্ট-সমূহ সম্পাদন করুন:" #: modules/visual_script/visual_script_editor.cpp msgid "Edit Variable:" -msgstr "" +msgstr "চলক/ভেরিয়েবল সম্পাদন করুন:" #: modules/visual_script/visual_script_editor.cpp msgid "Change" -msgstr "" +msgstr "পরিবর্তন করুন" #: modules/visual_script/visual_script_editor.cpp msgid "Delete Selected" @@ -314,19 +309,19 @@ msgstr "নির্বাচিত সমূহ অপসারণ করুন #: modules/visual_script/visual_script_editor.cpp #: tools/editor/plugins/script_text_editor.cpp msgid "Toggle Breakpoint" -msgstr "" +msgstr "ছেদবিন্দু অদলবদল করুন (টগল ব্রেকপয়েন্ট)" #: modules/visual_script/visual_script_editor.cpp msgid "Find Node Type" -msgstr "" +msgstr "নোডের ধরণ সন্ধান করুন" #: modules/visual_script/visual_script_editor.cpp msgid "Copy Nodes" -msgstr "" +msgstr "নোড-সমূহ প্রতিলিপি/কপি করুন" #: modules/visual_script/visual_script_editor.cpp msgid "Cut Nodes" -msgstr "" +msgstr "নোড-সমূহ কর্তন/কাট করুন" #: modules/visual_script/visual_script_editor.cpp msgid "Paste Nodes" @@ -334,138 +329,142 @@ msgstr "নোড-সমূহ প্রতিলেপন/পেস্ট ক #: modules/visual_script/visual_script_flow_control.cpp msgid "Input type not iterable: " -msgstr "" +msgstr "যোগান/ইনপুট-এর ধরণ পুনরাবৃত্তিমূলক নয়: " #: modules/visual_script/visual_script_flow_control.cpp msgid "Iterator became invalid" -msgstr "" +msgstr "পুনরাবৃত্তকারী অকার্যকর হয়ে পড়েছে" #: modules/visual_script/visual_script_flow_control.cpp msgid "Iterator became invalid: " -msgstr "" +msgstr "পুনরাবৃত্তকারী অকার্যকর হয়ে পড়েছে: " #: modules/visual_script/visual_script_func_nodes.cpp msgid "Invalid index property name." -msgstr "" +msgstr "সূচক/ইনডেক্স মানের অগ্রহনযোগ্য নাম।" #: modules/visual_script/visual_script_func_nodes.cpp msgid "Base object is not a Node!" -msgstr "" +msgstr "ভিত্তিটি (বেস) নোড নয়!" #: modules/visual_script/visual_script_func_nodes.cpp msgid "Path does not lead Node!" -msgstr "" +msgstr "পথটি নোডকে দিকনির্দেশ করে না!" #: modules/visual_script/visual_script_func_nodes.cpp msgid "Invalid index property name '%s' in node %s." -msgstr "" +msgstr "%s নোডে সূচক/ইনডেক্স মানের অগ্রহনযোগ্য নাম '%s'।" #: modules/visual_script/visual_script_nodes.cpp msgid ": Invalid argument of type: " -msgstr "" +msgstr ": অগ্রহনযোগ্য মান/আর্গুমেন্ট-এর ধরণ: " #: modules/visual_script/visual_script_nodes.cpp msgid ": Invalid arguments: " -msgstr "" +msgstr ": অগ্রহনযোগ্য মান/আর্গুমেন্ট-সমূহ: " #: modules/visual_script/visual_script_nodes.cpp msgid "VariableGet not found in script: " -msgstr "" +msgstr "স্ক্রিপ্টে চলক-প্রাপক (VariableGet) পাওয়া যায়নি: " #: modules/visual_script/visual_script_nodes.cpp msgid "VariableSet not found in script: " -msgstr "" +msgstr "স্ক্রিপ্টে চলক-স্থাপক (VariableSet) পাওয়া যায়নি: " #: modules/visual_script/visual_script_nodes.cpp msgid "Custom node has no _step() method, can't process graph." -msgstr "" +msgstr "স্বনির্মিত (custom) নোডে কোনো _step() মেথড নেই, গ্রাফ প্রক্রিয়াকরণ অসম্ভব।" #: modules/visual_script/visual_script_nodes.cpp msgid "" "Invalid return value from _step(), must be integer (seq out), or string " "(error)." msgstr "" +"_step() হতে অগ্রহনযোগ্য মান ফেরৎ এসেছে, মান অবশ্যই পূর্ণসংখ্যা (integer) (ক্রমিক), " +"অথবা শব্দমালা/বাক্য (string) (ভুল/সমস্যা) হতে হবে।" #: modules/visual_script/visual_script_nodes.cpp msgid "just pressed" -msgstr "" +msgstr "এইমাত্র চাপিত" #: modules/visual_script/visual_script_nodes.cpp msgid "just released" -msgstr "" +msgstr "এইমাত্র অব্যাহিত/মুক্ত" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" +"সার্টিফিকেট ফাইলটি পড়া সম্ভব হচ্ছে না। ফাইলের পথ এবং পাসওয়ার্ড দুটোই কি সঠিক দেয়া " +"হয়েছে?" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." -msgstr "" +msgstr "স্বাক্ষরিত বস্তু (signature object) তৈরিতে সমস্যা হয়েছে।" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." -msgstr "" +msgstr "প্যাকেজের স্বাক্ষর (package signature) তৈরিতে সমস্যা হয়েছে।" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" +"এক্সপোর্ট এর জন্য প্রয়োজণীয় টেমপ্লেট পাওয়া যায়নি।\n" +"এক্সপোর্ট টেমপ্লেট-সমূহ ডাউনলোড করে ইন্সটল করুন।" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." -msgstr "" +msgstr "স্বনির্মিত ডিবাগ (debug) প্যাকেজ খুঁজে পাওয়া যায়নি।" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." -msgstr "" +msgstr "স্বনির্মিত রিলিস (release) প্যাকেজ খুঁজে পাওয়া যায়নি।" -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid unique name." -msgstr "ফন্টের আকার অগ্র্যহনযোগ্য।" +msgstr "একক (অনন্য) নামটি অগ্রহনযোগ্য।" -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid product GUID." -msgstr "ফন্টের আকার অগ্র্যহনযোগ্য।" +msgstr "পণ্যের অগ্রহনযোগ্য GUID।" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." -msgstr "" +msgstr "প্রকাশকের অগ্রহনযোগ্য GUID।" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid background color." -msgstr "" +msgstr "পটভূমির (background) অগ্রহনযোগ্য রঙ।" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." -msgstr "" +msgstr "স্টোর লোগোর (Store Logo) ছবির অগ্রহনযোগ্য মাত্রা (৫০x৫০ হতে হবে)।" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." -msgstr "" +msgstr "৪৪x৪৪ বর্গ লোগোর (logo) ছবির অগ্রহনযোগ্য মাত্রা (৪৪x৪৪ হতে হবে)।" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." -msgstr "" +msgstr "৭১x৭১ বর্গ লোগোর (logo) ছবির অগ্রহনযোগ্য মাত্রা (৭১x৭১ হতে হবে)।" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." -msgstr "" +msgstr "১৫০x১৫০ বর্গ লোগোর (logo) ছবির অগ্রহনযোগ্য মাত্রা (১৫০x১৫০ হতে হবে)।" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." -msgstr "" +msgstr "৩১০x৩১০ বর্গ লোগোর (logo) ছবির অগ্রহনযোগ্য মাত্রা (৩১০x৩১০ হতে হবে)।" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." -msgstr "" +msgstr "৩১০x১৫০ প্রশস্ত লোগোর (logo) ছবির অগ্রহনযোগ্য মাত্রা (৩১০x১৫০ হতে হবে)।" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." -msgstr "" +msgstr "স্প্ল্যাশ পর্দার (splash screen) ছবির অগ্রহনযোগ্য মাত্রা (৬২০x৩০০ হতে হবে)।" #: scene/2d/animated_sprite.cpp msgid "" @@ -480,8 +479,8 @@ msgid "" "Only one visible CanvasModulate is allowed per scene (or set of instanced " "scenes). The first created one will work, while the rest will be ignored." msgstr "" -"প্রতি scene-এ (অথবা ইন্সট্যান্সড scene-এর সম্মেলনে) সর্বোচ্চ একটি দৃশ্যমান " -"CanvasModulate সম্ভব। সর্বপ্রথমেরটি দৃশ্যত হলেও বাকিগুলো বাতিল হয়ে যাবে।" +"প্রতি দৃশ্যে (অথবা ইন্সট্যান্সড দৃশ্যের সম্মেলনে) সর্বোচ্চ একটি দৃশ্যমান CanvasModulate " +"সম্ভব। সর্বপ্রথমেরটি দৃশ্যত হলেও বাকিগুলো বাতিল হয়ে যাবে।" #: scene/2d/collision_polygon_2d.cpp msgid "" @@ -598,10 +597,6 @@ msgstr "" "VisibilityEnable2D সর্বোত্তম কার্যকর হয় যখন সম্পাদিত দৃশ্য মূল দৃশ্য হিসেবে সরাসরি " "ব্যবহৃত হয়।" -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "" - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -649,16 +644,15 @@ msgstr "" "এটা শুধুমাত্র ন্যাভিগেশনের তথ্য প্রদান করে।" #: scene/3d/remote_transform.cpp -#, fuzzy msgid "Path property must point to a valid Spatial node to work." -msgstr "Path এর দিক অবশ্যই একটি কার্যকর Particles2D এর দিকে নির্দেশ করাতে হবে।" +msgstr "Path এর দিক অবশ্যই একটি কার্যকর Spatial নোডের এর দিকে নির্দেশ করাতে হবে।" #: scene/3d/scenario_fx.cpp msgid "" "Only one WorldEnvironment is allowed per scene (or set of instanced scenes)." msgstr "" -"প্রতি scene-এ (অথবা ইন্সট্যান্সড scene-এর সম্মেলনে) সর্বোচ্চ একটি দৃশ্যমান " -"WorldEnvironment সম্ভব।" +"প্রতি দৃশ্যে (অথবা ইন্সট্যান্সড দৃশ্যের সম্মেলনে) সর্বোচ্চ একটি দৃশ্যমান WorldEnvironment " +"সম্ভব।" #: scene/3d/spatial_sample_player.cpp msgid "" @@ -680,7 +674,8 @@ msgstr "" msgid "Cancel" msgstr "বাতিল" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "সঠিক" @@ -912,7 +907,7 @@ msgstr "ফন্ট তুলতে/লোডে সমস্যা হয়ে #: scene/resources/dynamic_font.cpp #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "Invalid font size." -msgstr "ফন্টের আকার অগ্র্যহনযোগ্য।" +msgstr "ফন্টের আকার অগ্রহনযোগ্য।" #: tools/editor/animation_editor.cpp msgid "Disabled" @@ -1171,83 +1166,84 @@ msgstr "নির্বাচিত ট্র্যাক/পথ অপসার #: tools/editor/animation_editor.cpp msgid "Track tools" -msgstr "" +msgstr "ট্র্যাক/পথের সরঞ্জামসমূহ" #: tools/editor/animation_editor.cpp msgid "Enable editing of individual keys by clicking them." -msgstr "" +msgstr "প্রতিটি চাবির সম্পাদন-যোগ্যতা সক্রিয় করার জন্য তাদের নির্বাচন করুন।" #: tools/editor/animation_editor.cpp msgid "Anim. Optimizer" -msgstr "" +msgstr "অ্যানিমেশন পরিমার্জনকারী" #: tools/editor/animation_editor.cpp msgid "Max. Linear Error:" -msgstr "" +msgstr "সর্বোচ্চ রৈখিক ভুল/সমস্যা:" #: tools/editor/animation_editor.cpp msgid "Max. Angular Error:" -msgstr "" +msgstr "সর্বোচ্চ কৌণিক ভুল/সমস্যা:" #: tools/editor/animation_editor.cpp msgid "Max Optimizable Angle:" -msgstr "" +msgstr "সর্বোচ্চ পরিশোধনযোগ্য কোণ:" #: tools/editor/animation_editor.cpp msgid "Optimize" -msgstr "" +msgstr "পরিমার্জন করুন" #: tools/editor/animation_editor.cpp msgid "Select an AnimationPlayer from the Scene Tree to edit animations." msgstr "" +"অ্যানিমেশনসমূহ সম্পাদন করতে দৃশ্যের তালিকা থেকে একটি AnimationPlayer নির্বাচন করুন।" #: tools/editor/animation_editor.cpp msgid "Key" -msgstr "" +msgstr "চাবি" #: tools/editor/animation_editor.cpp msgid "Transition" -msgstr "" +msgstr "ট্র্যানজিশন/স্থানান্তরণ" #: tools/editor/animation_editor.cpp msgid "Scale Ratio:" -msgstr "" +msgstr "স্কেল/মাপের অনুপাত:" #: tools/editor/animation_editor.cpp msgid "Call Functions in Which Node?" -msgstr "" +msgstr "কোন নোডে ফাংশন(সমূহ) ডাকবেন?" #: tools/editor/animation_editor.cpp msgid "Remove invalid keys" -msgstr "" +msgstr "অগ্রহনযোগ্য চাবিসমূহ অপসারণ করুন" #: tools/editor/animation_editor.cpp msgid "Remove unresolved and empty tracks" -msgstr "" +msgstr "অমীমাংসিত এবং খালি/অসার ট্র্যাক/পথসমূহ অপসারণ করুন" #: tools/editor/animation_editor.cpp msgid "Clean-up all animations" -msgstr "" +msgstr "সকল অ্যানিমেশনসমূহ পরিচ্ছন্ন করুন" #: tools/editor/animation_editor.cpp msgid "Clean-Up Animation(s) (NO UNDO!)" -msgstr "" +msgstr "সকল অ্যানিমেশনসমূহ পরিচ্ছন্ন করুন (অফেরৎযোগ্য!)" #: tools/editor/animation_editor.cpp msgid "Clean-Up" -msgstr "" +msgstr "পরিচ্ছন্ন করুন" #: tools/editor/array_property_edit.cpp msgid "Resize Array" -msgstr "" +msgstr "শ্রেণীবিন্যাস/সারি পুনর্মাপন করুন" #: tools/editor/array_property_edit.cpp msgid "Change Array Value Type" -msgstr "" +msgstr "শ্রেণীবিন্যাস/সারির মানের ধরণ পরিবর্তন করুন" #: tools/editor/array_property_edit.cpp msgid "Change Array Value" -msgstr "" +msgstr "শ্রেণীবিন্যাস/সারির মান পরিবর্তন করুন" #: tools/editor/asset_library_editor_plugin.cpp tools/editor/create_dialog.cpp #: tools/editor/editor_help.cpp tools/editor/editor_node.cpp @@ -1255,100 +1251,100 @@ msgstr "" #: tools/editor/property_selector.cpp tools/editor/quick_open.cpp #: tools/editor/settings_config_dialog.cpp msgid "Search:" -msgstr "" +msgstr "অনুসন্ধান করুন:" #: tools/editor/asset_library_editor_plugin.cpp msgid "Sort:" -msgstr "" +msgstr "সাজান:" #: tools/editor/asset_library_editor_plugin.cpp msgid "Reverse" -msgstr "" +msgstr "উল্টান/বিপরীত দিকে ফিরান" #: tools/editor/asset_library_editor_plugin.cpp #: tools/editor/project_settings.cpp msgid "Category:" -msgstr "" +msgstr "বিভাগ:" #: tools/editor/asset_library_editor_plugin.cpp msgid "All" -msgstr "" +msgstr "সকল" #: tools/editor/asset_library_editor_plugin.cpp msgid "Site:" -msgstr "" +msgstr "ওয়েবসাইট:" #: tools/editor/asset_library_editor_plugin.cpp msgid "Support.." -msgstr "" +msgstr "সমর্থন.." #: tools/editor/asset_library_editor_plugin.cpp msgid "Official" -msgstr "" +msgstr "অফিসিয়াল/প্রাথমিক উৎস" #: tools/editor/asset_library_editor_plugin.cpp msgid "Community" -msgstr "" +msgstr "কমিউনিটি/যৌথ-সামাজিক উৎস" #: tools/editor/asset_library_editor_plugin.cpp msgid "Testing" -msgstr "" +msgstr "পরীক্ষামূলক উৎস" #: tools/editor/asset_library_editor_plugin.cpp msgid "Assets ZIP File" -msgstr "" +msgstr "প্রয়োজনীয় উপকরণসমূহের ZIP ফাইল" #: tools/editor/call_dialog.cpp msgid "Method List For '%s':" -msgstr "" +msgstr "'%s' এর জন্য মেথডের তালিকা:" #: tools/editor/call_dialog.cpp msgid "Method List:" -msgstr "" +msgstr "মেথডের তালিকা:" #: tools/editor/call_dialog.cpp msgid "Arguments:" -msgstr "" +msgstr "মান/আর্গুমেন্ট-সমূহ:" #: tools/editor/call_dialog.cpp msgid "Return:" -msgstr "" +msgstr "প্রত্যাবর্তন:" #: tools/editor/code_editor.cpp msgid "Go to Line" -msgstr "" +msgstr "লাইন-এ যান" #: tools/editor/code_editor.cpp msgid "Line Number:" -msgstr "" +msgstr "লাইন নাম্বার:" #: tools/editor/code_editor.cpp msgid "No Matches" -msgstr "" +msgstr "কোনো মিল নেই" #: tools/editor/code_editor.cpp msgid "Replaced %d Ocurrence(s)." -msgstr "" +msgstr "%d টি সংঘটন প্রতিস্থাপিত হয়েছে।" #: tools/editor/code_editor.cpp msgid "Replace" -msgstr "" +msgstr "প্রতিস্থাপন করুন" #: tools/editor/code_editor.cpp msgid "Replace All" -msgstr "" +msgstr "সমস্তগুলি প্রতিস্থাপন করুন" #: tools/editor/code_editor.cpp msgid "Match Case" -msgstr "" +msgstr "অক্ষরের মাত্রা (বড়/ছোট-হাতের) মিল করুন" #: tools/editor/code_editor.cpp msgid "Whole Words" -msgstr "" +msgstr "সম্পূর্ণ শব্দ" #: tools/editor/code_editor.cpp msgid "Selection Only" -msgstr "" +msgstr "শুধুমাত্র নির্বাচিতসমূহ" #: tools/editor/code_editor.cpp tools/editor/editor_help.cpp #: tools/editor/plugins/script_editor_plugin.cpp @@ -1356,79 +1352,81 @@ msgstr "" #: tools/editor/plugins/shader_editor_plugin.cpp #: tools/editor/project_settings.cpp msgid "Search" -msgstr "" +msgstr "অনুসন্ধান করুন" #: tools/editor/code_editor.cpp tools/editor/editor_help.cpp msgid "Find" -msgstr "" +msgstr "সন্ধান করুন" #: tools/editor/code_editor.cpp msgid "Next" -msgstr "" +msgstr "পরবর্তী" #: tools/editor/code_editor.cpp msgid "Replaced %d ocurrence(s)." -msgstr "" +msgstr "%d টি সংঘটন প্রতিস্থাপিত হয়েছে।" #: tools/editor/code_editor.cpp msgid "Not found!" -msgstr "" +msgstr "খুঁজে পাওয়া যায়নি!" #: tools/editor/code_editor.cpp msgid "Replace By" -msgstr "" +msgstr "এর দ্বারা প্রতিস্থাপন করুন" #: tools/editor/code_editor.cpp msgid "Case Sensitive" -msgstr "" +msgstr "অক্ষরের মাত্রা (বড়/ছোট-হাতের) সংবেদনশীল" #: tools/editor/code_editor.cpp msgid "Backwards" -msgstr "" +msgstr "পিছনের/অতীতের দিকে" #: tools/editor/code_editor.cpp msgid "Prompt On Replace" -msgstr "" +msgstr "প্রতিস্থাপনে অবহিত করুন" #: tools/editor/code_editor.cpp msgid "Skip" -msgstr "" +msgstr "অতিক্রম করে যান" #: tools/editor/code_editor.cpp #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Zoom In" -msgstr "" +msgstr "সম্প্রসারিত করুন (জুম্ ইন)" #: tools/editor/code_editor.cpp #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Zoom Out" -msgstr "" +msgstr "সংকুচিত করুন (জুম্ আউট)" #: tools/editor/code_editor.cpp msgid "Reset Zoom" -msgstr "" +msgstr "সম্প্রসারন/সংকোচন অপসারণ করুন (রিসেট জুম্)" #: tools/editor/code_editor.cpp tools/editor/script_editor_debugger.cpp msgid "Line:" -msgstr "" +msgstr "লাইন:" #: tools/editor/code_editor.cpp msgid "Col:" -msgstr "" +msgstr "কলাম:" #: tools/editor/connections_dialog.cpp msgid "Method in target Node must be specified!" -msgstr "" +msgstr "নির্দেশিত নোডের মেথড নির্দিষ্ট করতে হবে!" #: tools/editor/connections_dialog.cpp msgid "" "Target method not found! Specify a valid method or attach a script to target " "Node." msgstr "" +"উদ্দেশ্যিত মেথড পাওয়া যায়নি! উদ্দেশ্যিত নোডে একটি কার্যকর মেথড নির্দিষ্ট করুন অথবা " +"একটি স্ক্রিপ্ট ফাইল সংযুক্ত করুন।" #: tools/editor/connections_dialog.cpp msgid "Connect To Node:" -msgstr "" +msgstr "নোডের সাথে সংযুক্ত করুন:" #: tools/editor/connections_dialog.cpp #: tools/editor/editor_autoload_settings.cpp tools/editor/groups_editor.cpp @@ -1436,144 +1434,148 @@ msgstr "" #: tools/editor/plugins/theme_editor_plugin.cpp #: tools/editor/project_settings.cpp msgid "Add" -msgstr "" +msgstr "সংযোজন করুন" #: tools/editor/connections_dialog.cpp tools/editor/dependency_editor.cpp #: tools/editor/plugins/animation_tree_editor_plugin.cpp #: tools/editor/plugins/theme_editor_plugin.cpp #: tools/editor/project_manager.cpp msgid "Remove" -msgstr "" +msgstr "অপসারণ করুন" #: tools/editor/connections_dialog.cpp msgid "Add Extra Call Argument:" -msgstr "" +msgstr "ডাকযোগ্য অতিরিক্ত মান/আর্গুমেন্ট সংযুক্ত করুন:" #: tools/editor/connections_dialog.cpp msgid "Extra Call Arguments:" -msgstr "" +msgstr "ডাকযোগ্য অতিরিক্ত মান/আর্গুমেন্ট-সমূহ:" #: tools/editor/connections_dialog.cpp msgid "Path to Node:" -msgstr "" +msgstr "নোডের পথ:" #: tools/editor/connections_dialog.cpp msgid "Make Function" -msgstr "" +msgstr "নির্মাণ ফাংশন" #: tools/editor/connections_dialog.cpp msgid "Deferred" -msgstr "" +msgstr "বিলম্বিত" #: tools/editor/connections_dialog.cpp msgid "Oneshot" -msgstr "" +msgstr "ওয়ান-শট" #: tools/editor/connections_dialog.cpp msgid "Connect" -msgstr "" +msgstr "সংযোগ" #: tools/editor/connections_dialog.cpp msgid "Connect '%s' to '%s'" -msgstr "" +msgstr "'%s' এর সাথে '%s' সংযুক্ত করুন" #: tools/editor/connections_dialog.cpp msgid "Connecting Signal:" -msgstr "" +msgstr "সংযোজক সংকেত/সিগন্যাল:" #: tools/editor/connections_dialog.cpp msgid "Create Subscription" -msgstr "" +msgstr "সদস্যতা/সাবস্ক্রিপশন তৈরি করুন" #: tools/editor/connections_dialog.cpp msgid "Connect.." -msgstr "" +msgstr "সংযোগ.." #: tools/editor/connections_dialog.cpp #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Disconnect" -msgstr "" +msgstr "সংযোগ বিচ্ছিন্ন করুন" #: tools/editor/connections_dialog.cpp tools/editor/node_dock.cpp msgid "Signals" -msgstr "" +msgstr "সংকেতসমূহ" #: tools/editor/create_dialog.cpp msgid "Create New" -msgstr "" +msgstr "নতুন তৈরি করুন" #: tools/editor/create_dialog.cpp tools/editor/editor_file_dialog.cpp #: tools/editor/filesystem_dock.cpp msgid "Favorites:" -msgstr "" +msgstr "ফেবরিট/প্রিয়-সমূহ:" #: tools/editor/create_dialog.cpp tools/editor/editor_file_dialog.cpp msgid "Recent:" -msgstr "" +msgstr "সাম্প্রতিক:" #: tools/editor/create_dialog.cpp tools/editor/editor_help.cpp #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/property_selector.cpp tools/editor/quick_open.cpp msgid "Matches:" -msgstr "" +msgstr "মিলসমূহ:" #: tools/editor/create_dialog.cpp tools/editor/editor_help.cpp #: tools/editor/property_selector.cpp tools/editor/script_editor_debugger.cpp msgid "Description:" -msgstr "" +msgstr "বর্ণনা:" #: tools/editor/dependency_editor.cpp msgid "Search Replacement For:" -msgstr "" +msgstr "এর জন্য প্রতিস্থাপকের অনুসন্ধান করুন:" #: tools/editor/dependency_editor.cpp msgid "Dependencies For:" -msgstr "" +msgstr "এর জন্য নির্ভরতা-সমূহ:" #: tools/editor/dependency_editor.cpp msgid "" "Scene '%s' is currently being edited.\n" "Changes will not take effect unless reloaded." msgstr "" +"'%s' দৃশ্যটি এই-মুহূর্তে সম্পাদিত হচ্ছে।\n" +"পুনরায়-লোড (রিলোড) না করা পর্যন্ত পরিবর্তন-সমূহ কার্যকর হবে না।" #: tools/editor/dependency_editor.cpp msgid "" "Resource '%s' is in use.\n" "Changes will take effect when reloaded." msgstr "" +"'%s' রিসোর্সটি ব্যবহৃত হচ্ছে।\n" +"পুনরায়-লোড (রিলোড)-এর সময় পরিবর্তনসমূহ কার্যকর হবে।" #: tools/editor/dependency_editor.cpp msgid "Dependencies" -msgstr "" +msgstr "নির্ভরতা-সমূহ" #: tools/editor/dependency_editor.cpp msgid "Resource" -msgstr "" +msgstr "রিসোর্স" #: tools/editor/dependency_editor.cpp tools/editor/editor_autoload_settings.cpp #: tools/editor/project_manager.cpp tools/editor/project_settings.cpp msgid "Path" -msgstr "" +msgstr "পথ" #: tools/editor/dependency_editor.cpp msgid "Dependencies:" -msgstr "" +msgstr "নির্ভরতা-সমূহ:" #: tools/editor/dependency_editor.cpp msgid "Fix Broken" -msgstr "" +msgstr "ত্রুটিপূর্ণ/ভগ্ন-অংশসমূহ ঠিক করুন" #: tools/editor/dependency_editor.cpp msgid "Dependency Editor" -msgstr "" +msgstr "নির্ভরতা-সমূহের এডিটর" #: tools/editor/dependency_editor.cpp msgid "Search Replacement Resource:" -msgstr "" +msgstr "প্রতিস্থাপক রিসোর্স-এর অনুসন্ধান করুন:" #: tools/editor/dependency_editor.cpp msgid "Owners Of:" -msgstr "" +msgstr "স্বত্বাধিকারীসমূহ:" #: tools/editor/dependency_editor.cpp msgid "" @@ -1583,432 +1585,447 @@ msgid "" msgstr "" "যেসব ফাইল অপসারিত হচ্ছে তারা অন্যান্য রিসোর্স ফাইলের কার্যকররুপে কাজ করার জন্য " "দরকারি।\n" -"তবুও তাদের অপসারণ করবেন? (তাদের আর ফেরত পাবেন না/আনডু অসম্ভব)" +"তবুও তাদের অপসারণ করবেন? (অফেরৎযোগ্য)" #: tools/editor/dependency_editor.cpp msgid "Remove selected files from the project? (no undo)" -msgstr "" +msgstr "নির্বাচিত ফাইলসমূহ প্রকল্প হতে অপসারণ করবেন? (অফেরৎযোগ্য)" #: tools/editor/dependency_editor.cpp msgid "Error loading:" -msgstr "" +msgstr "লোডে সমস্যা হয়েছে:" #: tools/editor/dependency_editor.cpp msgid "Scene failed to load due to missing dependencies:" -msgstr "" +msgstr "নির্ভরতা-সমূহের অনুপস্থিতিতে দৃশ্যের লোড ব্যর্থ হয়েছে:" #: tools/editor/dependency_editor.cpp msgid "Open Anyway" -msgstr "" +msgstr "যেকোনো উপায়েই খুলুন" #: tools/editor/dependency_editor.cpp msgid "Which action should be taken?" -msgstr "" +msgstr "কোন সিধান্তটি নেয়া উচিত হবে?" #: tools/editor/dependency_editor.cpp msgid "Fix Dependencies" -msgstr "" +msgstr "নির্ভরতা-সমূহ ঠিক করুন" #: tools/editor/dependency_editor.cpp msgid "Errors loading!" -msgstr "" +msgstr "লোডে একাধিক সমস্যা হয়েছে!" #: tools/editor/dependency_editor.cpp msgid "Permanently delete %d item(s)? (No undo!)" -msgstr "" +msgstr "%d -টি বস্তু(সমূহ) স্থায়ীভাবে মুছে ফেলবেন? (অফেরৎযোগ্য!)" #: tools/editor/dependency_editor.cpp msgid "Owns" -msgstr "" +msgstr "আয়ত্তে" #: tools/editor/dependency_editor.cpp msgid "Resources Without Explicit Ownership:" -msgstr "" +msgstr "স্পষ্ট মালিকানা বিহীন রিসোর্সসমূহ:" #: tools/editor/dependency_editor.cpp tools/editor/editor_node.cpp msgid "Orphan Resource Explorer" -msgstr "" +msgstr "মালিকবিহীন রিসোর্সের অনুসন্ধানকারী" #: tools/editor/dependency_editor.cpp msgid "Delete selected files?" -msgstr "" +msgstr "নির্বাচিত ফাইলসমূহ অপসারণ করবেন?" #: tools/editor/dependency_editor.cpp tools/editor/editor_node.cpp #: tools/editor/filesystem_dock.cpp #: tools/editor/plugins/item_list_editor_plugin.cpp #: tools/editor/scene_tree_dock.cpp msgid "Delete" -msgstr "" +msgstr "অপসারণ করুন" #: tools/editor/editor_autoload_settings.cpp msgid "Invalid name." -msgstr "" +msgstr "অগ্রহনযোগ্য নাম।" #: tools/editor/editor_autoload_settings.cpp msgid "Valid characters:" -msgstr "" +msgstr "গ্রহনযোগ্য অক্ষরসমূহ:" #: tools/editor/editor_autoload_settings.cpp msgid "Invalid name. Must not collide with an existing engine class name." msgstr "" +"অগ্রহনযোগ্য নাম। নামটি অবশ্যই ইঞ্জিনে বিদ্যমান ক্লাসের নামের সাথে পরম্পরবিরোধী হতে " +"পারবে না।" #: tools/editor/editor_autoload_settings.cpp msgid "Invalid name. Must not collide with an existing buit-in type name." msgstr "" +"অগ্রহনযোগ্য নাম। নামটি অবশ্যই বিদ্যমান পূর্বনির্মিত ধরণের নামের সাথে পরম্পরবিরোধী " +"হতে পারবে না।" #: tools/editor/editor_autoload_settings.cpp msgid "Invalid name. Must not collide with an existing global constant name." msgstr "" +"অগ্রহনযোগ্য নাম। নামটি অবশ্যই বিদ্যমান সার্বজনীন ধ্রুবকের নামের সাথে পরম্পরবিরোধী " +"হতে পারবে না।" #: tools/editor/editor_autoload_settings.cpp msgid "Invalid Path." -msgstr "" +msgstr "অকার্যকর পথ।" #: tools/editor/editor_autoload_settings.cpp msgid "File does not exist." -msgstr "" +msgstr "ফাইলটি বিদ্যমান নয়।" #: tools/editor/editor_autoload_settings.cpp msgid "Not in resource path." -msgstr "" +msgstr "রিসোর্সের পথে নয়।" #: tools/editor/editor_autoload_settings.cpp msgid "Add AutoLoad" -msgstr "" +msgstr "AutoLoad সংযুক্ত করুন" #: tools/editor/editor_autoload_settings.cpp msgid "Autoload '%s' already exists!" -msgstr "" +msgstr "'%s' এর AutoLoad ইতিমধ্যেই বিদ্যমান!" #: tools/editor/editor_autoload_settings.cpp msgid "Rename Autoload" -msgstr "" +msgstr "Autoload পুনঃনামকরণ করুন" #: tools/editor/editor_autoload_settings.cpp msgid "Toggle AutoLoad Globals" -msgstr "" +msgstr "AutoLoad এর সার্বজনীন মানসমূহ অদলবদল/টগল করুন" #: tools/editor/editor_autoload_settings.cpp msgid "Move Autoload" -msgstr "" +msgstr "Autoload স্থানান্তর করুন" #: tools/editor/editor_autoload_settings.cpp msgid "Remove Autoload" -msgstr "" +msgstr "Autoload অপসারণ করুন" #: tools/editor/editor_autoload_settings.cpp msgid "Enable" -msgstr "" +msgstr "সক্রিয় করুন" #: tools/editor/editor_autoload_settings.cpp msgid "Rearrange Autoloads" -msgstr "" +msgstr "Autoload সমূহ পুনর্বিন্যস্ত করুন" #: tools/editor/editor_autoload_settings.cpp msgid "Node Name:" -msgstr "" +msgstr "নোডের নাম:" #: tools/editor/editor_autoload_settings.cpp #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/plugins/sample_library_editor_plugin.cpp #: tools/editor/project_manager.cpp msgid "Name" -msgstr "" +msgstr "নাম" #: tools/editor/editor_autoload_settings.cpp msgid "Singleton" -msgstr "" +msgstr "একক-বস্তু/সিঙ্গেলটোন" #: tools/editor/editor_autoload_settings.cpp msgid "List:" -msgstr "" +msgstr "তালিকা:" #: tools/editor/editor_data.cpp msgid "Updating Scene" -msgstr "" +msgstr "দৃশ্য হাল নাগাদ হচ্ছে" #: tools/editor/editor_data.cpp msgid "Storing local changes.." -msgstr "" +msgstr "স্থানীয় পরিবর্তন-সমূহ সংরক্ষিত হচ্ছে.." #: tools/editor/editor_data.cpp msgid "Updating scene.." -msgstr "" +msgstr "দৃশ্য হাল নাগাদ হচ্ছে.." #: tools/editor/editor_dir_dialog.cpp msgid "Choose a Directory" -msgstr "" +msgstr "একটি স্থান পছন্দ করুন" #: tools/editor/editor_dir_dialog.cpp msgid "Choose" -msgstr "" +msgstr "পছন্দ করুন" #: tools/editor/editor_file_dialog.cpp msgid "Go Back" -msgstr "" +msgstr "পিছনের দিকে যান" #: tools/editor/editor_file_dialog.cpp msgid "Go Forward" -msgstr "" +msgstr "সামনের দিকে যান" #: tools/editor/editor_file_dialog.cpp msgid "Go Up" -msgstr "" +msgstr "উপরের দিকে যান" #: tools/editor/editor_file_dialog.cpp msgid "Refresh" -msgstr "" +msgstr "রিফ্রেস করুন" #: tools/editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" -msgstr "" +msgstr "অদৃশ্য ফাইলসমূহ অদলবদল/টগল করুন" #: tools/editor/editor_file_dialog.cpp msgid "Toggle Favorite" -msgstr "" +msgstr "ফেবরিট/প্রিয়-সমূহ অদলবদল/টগল করুন" #: tools/editor/editor_file_dialog.cpp msgid "Toggle Mode" -msgstr "" +msgstr "মোড অদলবদল/টগল করুন" #: tools/editor/editor_file_dialog.cpp msgid "Focus Path" -msgstr "" +msgstr "পথের উপর ফোকাস করুন" #: tools/editor/editor_file_dialog.cpp msgid "Move Favorite Up" -msgstr "" +msgstr "ফেবরিট/প্রিয়কে উপরের দিকে তুলুন" #: tools/editor/editor_file_dialog.cpp msgid "Move Favorite Down" -msgstr "" +msgstr "ফেবরিট/প্রিয়কে নিচের দিকে নামান" #: tools/editor/editor_file_dialog.cpp msgid "Preview:" -msgstr "" +msgstr "প্রিভিউ:" #: tools/editor/editor_file_system.cpp msgid "ScanSources" -msgstr "" +msgstr "উৎসসমূহ স্ক্যান করুন" #: tools/editor/editor_help.cpp tools/editor/plugins/script_editor_plugin.cpp msgid "Search Help" -msgstr "" +msgstr "সাহায্য অনুসন্ধান করুন" #: tools/editor/editor_help.cpp msgid "Class List:" -msgstr "" +msgstr "ক্লাসের তালিকা:" #: tools/editor/editor_help.cpp msgid "Search Classes" -msgstr "" +msgstr "ক্লাসের অনুসন্ধান করুন" #: tools/editor/editor_help.cpp tools/editor/property_editor.cpp msgid "Class:" -msgstr "" +msgstr "ক্লাস:" #: tools/editor/editor_help.cpp tools/editor/scene_tree_editor.cpp #: tools/editor/script_create_dialog.cpp msgid "Inherits:" -msgstr "" +msgstr "গ্রহণ করে:" #: tools/editor/editor_help.cpp msgid "Inherited by:" -msgstr "" +msgstr "গৃহীত হয়েছে:" #: tools/editor/editor_help.cpp msgid "Brief Description:" -msgstr "" +msgstr "সংক্ষিপ্ত বর্ণনা:" #: tools/editor/editor_help.cpp msgid "Public Methods:" -msgstr "" +msgstr "সর্বজনীন/প্রকাশ্য মেথডসমূহ:" #: tools/editor/editor_help.cpp msgid "GUI Theme Items:" -msgstr "" +msgstr "GUI থিম এর বস্তুসমূহ:" #: tools/editor/editor_help.cpp msgid "Constants:" -msgstr "" +msgstr "ধ্রুবকসমূহ:" + +#: tools/editor/editor_help.cpp +#, fuzzy +msgid "Property Description:" +msgstr "সংক্ষিপ্ত বর্ণনা:" #: tools/editor/editor_help.cpp msgid "Method Description:" -msgstr "" +msgstr "মেথডের বর্ণ্না:" #: tools/editor/editor_help.cpp msgid "Search Text" -msgstr "" +msgstr "টেক্সট অনুসন্ধান করুন" #: tools/editor/editor_import_export.cpp msgid "Added:" -msgstr "" +msgstr "সংযোজিত:" #: tools/editor/editor_import_export.cpp msgid "Removed:" -msgstr "" +msgstr "অপসারিত:" #: tools/editor/editor_import_export.cpp tools/editor/project_export.cpp msgid "Error saving atlas:" -msgstr "" +msgstr "এটলাস/মানচিত্রাবলী সংরক্ষণে সমস্যা হয়েছে:" #: tools/editor/editor_import_export.cpp msgid "Could not save atlas subtexture:" -msgstr "" +msgstr "এটলাস/মানচিত্রাবলীর উপ-গঠনবিন্যাস (subtexture) সংরক্ষণ অসমর্থ হয়েছে:" #: tools/editor/editor_import_export.cpp msgid "Storing File:" -msgstr "" +msgstr "সংরক্ষিত ফাইল:" #: tools/editor/editor_import_export.cpp msgid "Packing" -msgstr "" +msgstr "প্যাক/গুচ্ছিত করা" #: tools/editor/editor_import_export.cpp msgid "Exporting for %s" -msgstr "" +msgstr "%s এর জন্য এক্সপোর্ট (export) হচ্ছে" #: tools/editor/editor_import_export.cpp msgid "Setting Up.." -msgstr "" +msgstr "স্থাপিত/বিন্যস্ত হচ্ছে.." #: tools/editor/editor_log.cpp msgid " Output:" -msgstr "" +msgstr " আউটপুট/ফলাফল:" #: tools/editor/editor_node.cpp tools/editor/editor_reimport_dialog.cpp msgid "Re-Importing" -msgstr "" +msgstr "পুনরায় ইম্পোর্ট হচ্ছে" #: tools/editor/editor_node.cpp msgid "Importing:" -msgstr "" +msgstr "ইম্পোর্ট হচ্ছে:" #: tools/editor/editor_node.cpp msgid "Node From Scene" -msgstr "" +msgstr "দৃশ্য হতে নোড" #: tools/editor/editor_node.cpp #: tools/editor/plugins/animation_player_editor_plugin.cpp #: tools/editor/resources_dock.cpp msgid "Error saving resource!" -msgstr "" +msgstr "রিসোর্স সংরক্ষণে সমস্যা হয়েছে!" #: tools/editor/editor_node.cpp #: tools/editor/plugins/animation_player_editor_plugin.cpp #: tools/editor/resources_dock.cpp msgid "Save Resource As.." -msgstr "" +msgstr "রিসোর্স এইরূপে সংরক্ষণ করুন.." -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." -msgstr "" +msgstr "বুঝলাম.." #: tools/editor/editor_node.cpp msgid "Can't open file for writing:" -msgstr "" +msgstr "লেখার জন্য ফাইলটি খোলায় সমস্যা হয়েছে:" #: tools/editor/editor_node.cpp msgid "Requested file format unknown:" -msgstr "" +msgstr "আবেদনকৃত ফাইল ফরম্যাট/ধরণ অজানা:" #: tools/editor/editor_node.cpp msgid "Error while saving." -msgstr "" +msgstr "সংরক্ষণের সময় সমস্যা হয়েছে।" #: tools/editor/editor_node.cpp msgid "Saving Scene" -msgstr "" +msgstr "দৃশ্য সংরক্ষিত হচ্ছে" #: tools/editor/editor_node.cpp msgid "Analyzing" -msgstr "" +msgstr "বিশ্লেষণ হচ্ছে" #: tools/editor/editor_node.cpp msgid "Creating Thumbnail" -msgstr "" +msgstr "থাম্বনেইল তৈরি হচ্ছে" #: tools/editor/editor_node.cpp msgid "" "Couldn't save scene. Likely dependencies (instances) couldn't be satisfied." msgstr "" +"দৃশ্যটি সংরক্ষণ করা সম্ভব হচ্ছে না। সম্ভবত যেসবের (ইন্সট্যান্স) উপর নির্ভর করছে তাদের " +"সন্তুষ্ট করা সম্ভব হচ্ছে না।" #: tools/editor/editor_node.cpp msgid "Failed to load resource." -msgstr "" +msgstr "রিসোর্স লোড ব্যর্থ হয়েছে।" #: tools/editor/editor_node.cpp msgid "Can't load MeshLibrary for merging!" -msgstr "" +msgstr "একত্রিত করার জন্য প্রয়োজনীয় MeshLibrary লোড অসম্ভব হয়েছে!" #: tools/editor/editor_node.cpp msgid "Error saving MeshLibrary!" -msgstr "" +msgstr "MeshLibrary সংরক্ষণে সমস্যা হয়েছে!" #: tools/editor/editor_node.cpp msgid "Can't load TileSet for merging!" -msgstr "" +msgstr "একত্রিত করার জন্য প্রয়োজনীয় TileSet লোড অসম্ভব হয়েছে!" #: tools/editor/editor_node.cpp msgid "Error saving TileSet!" -msgstr "" +msgstr "TileSet সংরক্ষণে সমস্যা হয়েছে!" #: tools/editor/editor_node.cpp msgid "Can't open export templates zip." -msgstr "" +msgstr "এক্সপোর্ট টেমপ্লেটের zip খোলায় সমস্যা হয়েছে।" #: tools/editor/editor_node.cpp msgid "Loading Export Templates" -msgstr "" +msgstr "এক্সপোর্ট টেমপ্লেটসমূহ লোড হচ্ছে" #: tools/editor/editor_node.cpp msgid "Error trying to save layout!" -msgstr "" +msgstr "লেআউট/নকশা সংরক্ষণের চেষ্টায় সমস্যা হয়েছে!" #: tools/editor/editor_node.cpp msgid "Default editor layout overridden." -msgstr "" +msgstr "এডিটরের সাধারণ লেআউট/নকশা পরিবর্তিত হয়েছে।" #: tools/editor/editor_node.cpp msgid "Layout name not found!" -msgstr "" +msgstr "লেআউট/নকশার নাম পাওয়া যায়নি!" #: tools/editor/editor_node.cpp msgid "Restored default layout to base settings." -msgstr "" +msgstr "সাধারণ লেআউট/নকশা আদি সেটিংসে প্রত্যাবর্তিত হয়েছে।" #: tools/editor/editor_node.cpp msgid "Copy Params" -msgstr "" +msgstr "মানসমূহ প্রতিলিপি/কপি করুন" #: tools/editor/editor_node.cpp msgid "Paste Params" -msgstr "" +msgstr "মানসমূহ প্রতিলেপন/পেস্ট করুন" #: tools/editor/editor_node.cpp #: tools/editor/plugins/resource_preloader_editor_plugin.cpp msgid "Paste Resource" -msgstr "" +msgstr "রিসোর্স প্রতিলেপন/পেস্ট করুন" #: tools/editor/editor_node.cpp msgid "Copy Resource" -msgstr "" +msgstr "রিসোর্স প্রতিলিপি/কপি করুন" #: tools/editor/editor_node.cpp msgid "Make Built-In" -msgstr "" +msgstr "পূর্বনির্মাণ হিসেবে তৈরি করুন" #: tools/editor/editor_node.cpp msgid "Make Sub-Resources Unique" -msgstr "" +msgstr "উপ-রিসোর্সকে অনন্য হিসেবে তৈরি করুন" #: tools/editor/editor_node.cpp msgid "Open in Help" -msgstr "" +msgstr "সাহায্যের পাতায় খুলুন" #: tools/editor/editor_node.cpp msgid "There is no defined scene to run." -msgstr "" +msgstr "চালানোর জন্য কোনো দৃশ্য নির্দিষ্ট করা নেই।" #: tools/editor/editor_node.cpp msgid "" @@ -2016,6 +2033,9 @@ msgid "" "You can change it later in later in \"Project Settings\" under the " "'application' category." msgstr "" +"কোনো মুখ্য দৃশ্য নির্ধারণ করা হয়নি, নির্ধারণ করবেন?\n" +"আপনি পরবর্তিতে তা 'অ্যাপ্লিকেশন (application)' বিভাগের \\\"প্রকল্পের সেটিংস " +"(Project Settings)\\\"-এ পরিবর্তন করতে পারবেন।" #: tools/editor/editor_node.cpp msgid "" @@ -2023,6 +2043,9 @@ msgid "" "You can change it later in \"Project Settings\" under the 'application' " "category." msgstr "" +"নির্বাচিত '%s' দৃশ্যটি বিদ্যমান নয়, একটি কার্যকর দৃশ্য নির্ধারণ করবেন?\n" +"আপনি পরবর্তিতে তা 'অ্যাপ্লিকেশন (application)' বিভাগের \\\"প্রকল্পের সেটিংস " +"(Project Settings)\\\"-এ পরিবর্তন করতে পারবেন।" #: tools/editor/editor_node.cpp msgid "" @@ -2030,244 +2053,255 @@ msgid "" "You can change it later in \"Project Settings\" under the 'application' " "category." msgstr "" +"নির্বাচিত '%s' দৃশ্যটি কোনো দৃশ্যের ফাইল নয়, একটি কার্যকর দৃশ্যের ফাইল নির্ধারণ " +"করবেন?\n" +"আপনি পরবর্তিতে তা 'অ্যাপ্লিকেশন (application)' বিভাগের \\\"প্রকল্পের সেটিংস " +"(Project Settings)\\\"-এ পরিবর্তন করতে পারবেন।" #: tools/editor/editor_node.cpp msgid "Current scene was never saved, please save it prior to running." msgstr "" +"বর্তমান দৃশ্যটি কখনোই সংরক্ষণ করা হয় নি, অনুগ্রহ করে চালানোর পূর্বে এটি সংরক্ষণ করুন।" #: tools/editor/editor_node.cpp msgid "Could not start subprocess!" -msgstr "" +msgstr "উপ-প্রক্রিয়াকে শুরু করা সম্ভব হয়নি!" #: tools/editor/editor_node.cpp msgid "Open Scene" -msgstr "" +msgstr "দৃশ্য খুলুন" #: tools/editor/editor_node.cpp msgid "Open Base Scene" -msgstr "" +msgstr "গোড়ার দৃশ্য খুলুন" #: tools/editor/editor_node.cpp msgid "Quick Open Scene.." -msgstr "" +msgstr "দ্রুত দৃশ্য খুলুন.." #: tools/editor/editor_node.cpp msgid "Quick Open Script.." -msgstr "" +msgstr "দ্রুত স্ক্রিপ্ট খুলুন.." #: tools/editor/editor_node.cpp msgid "Yes" -msgstr "" +msgstr "হ্যাঁ" #: tools/editor/editor_node.cpp msgid "Close scene? (Unsaved changes will be lost)" -msgstr "" +msgstr "দৃশ্য বন্ধ করবেন? (অসংরক্ষিত পরিবর্তনসমূহ হারিয়ে যাবে)" #: tools/editor/editor_node.cpp msgid "Save Scene As.." -msgstr "" +msgstr "দৃশ্য এইরূপে সংরক্ষণ করুন.." #: tools/editor/editor_node.cpp msgid "This scene has never been saved. Save before running?" -msgstr "" +msgstr "এই দৃশ্যটি কখনোই সংরক্ষণ করা হয় নি। চালানোর পূর্বে সংরক্ষণ করবেন?" #: tools/editor/editor_node.cpp msgid "Please save the scene first." -msgstr "" +msgstr "প্রথমে অনুগ্রহ করে দৃশ্যটি সংরক্ষণ করুন।" #: tools/editor/editor_node.cpp msgid "Save Translatable Strings" -msgstr "" +msgstr "অনুবাদ-সম্ভব শব্দমালা/বাক্য-সমূহ সংরক্ষণ করুন" #: tools/editor/editor_node.cpp msgid "Export Mesh Library" -msgstr "" +msgstr "Mesh Library এক্সপোর্ট করুন" #: tools/editor/editor_node.cpp msgid "Export Tile Set" -msgstr "" +msgstr "Tile Set এক্সপোর্ট করুন" #: tools/editor/editor_node.cpp msgid "Quit" -msgstr "" +msgstr "প্রস্থান করুন" #: tools/editor/editor_node.cpp msgid "Exit the editor?" -msgstr "" +msgstr "এডিটর হতে প্রস্থান করবেন?" #: tools/editor/editor_node.cpp msgid "Current scene not saved. Open anyway?" -msgstr "" +msgstr "বর্তমান দৃশ্যটি সংরক্ষিত হয়নি। তবুও খুলবেন?" #: tools/editor/editor_node.cpp msgid "Can't reload a scene that was never saved." -msgstr "" +msgstr "পূর্বে কখনোই সংরক্ষিত হয়নি এমন দৃশ্য পুনরায়-লোড (রিলোড) করা অসম্ভব।" #: tools/editor/editor_node.cpp msgid "Revert" -msgstr "" +msgstr "প্রত্যাবর্তন করুন" #: tools/editor/editor_node.cpp msgid "This action cannot be undone. Revert anyway?" -msgstr "" +msgstr "এই কাজটি অসম্পাদিত করা সম্ভব হবে না। তবুও প্রত্যাবর্তন করবেন?" #: tools/editor/editor_node.cpp msgid "Quick Run Scene.." -msgstr "" +msgstr "দ্রুত দৃশ্য চালান.." #: tools/editor/editor_node.cpp msgid "" "Open Project Manager? \n" "(Unsaved changes will be lost)" msgstr "" +"প্রকল্প ম্যানেজার (Project Manager) খুলবেন? \n" +"(অ-সংরক্ষিত পরিবর্তন-সমূহ হারিয়ে যাবে)" #: tools/editor/editor_node.cpp msgid "Pick a Main Scene" -msgstr "" +msgstr "একটি মুখ্য দৃশ্য মনোনীত করুন" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" -msgstr "" +msgstr "আহ্" #: tools/editor/editor_node.cpp msgid "" "Error loading scene, it must be inside the project path. Use 'Import' to " "open the scene, then save it inside the project path." msgstr "" +"দৃশ্য লোডে সমস্যা হয়েছে, দৃশ্যটি অবশ্যই প্রকল্পের পথের ভিতরে হতে হবে। 'ইম্পোর্ট " +"(Import)' ব্যবহার করে দৃশ্যটি খুলুন, তারপর তা প্রকল্পের পথের ভিতরে সংরক্ষণ করুন।" #: tools/editor/editor_node.cpp msgid "Error loading scene." -msgstr "" +msgstr "দৃশ্য লোডে সমস্যা হয়েছে।" #: tools/editor/editor_node.cpp msgid "Scene '%s' has broken dependencies:" -msgstr "" +msgstr "'%s' দৃশ্যটির অসংলগ্ন নির্ভরতা রয়েছে:" #: tools/editor/editor_node.cpp msgid "Save Layout" -msgstr "" +msgstr "লেআউট/নকশা সংরক্ষণ করুন" #: tools/editor/editor_node.cpp msgid "Delete Layout" -msgstr "" +msgstr "লেআউট/নকশা অপসারণ করুন" #: tools/editor/editor_node.cpp tools/editor/project_export.cpp msgid "Default" -msgstr "" +msgstr "সাধারণ/ডিফল্ট" #: tools/editor/editor_node.cpp msgid "Switch Scene Tab" -msgstr "" +msgstr "দৃশ্যের ট্যাব পরিবর্তন করুন" #: tools/editor/editor_node.cpp msgid "%d more file(s)" -msgstr "" +msgstr "%d টি অধিক ফাইল(সমূহ)" #: tools/editor/editor_node.cpp msgid "%d more file(s) or folder(s)" -msgstr "" +msgstr "%d টি অধিক ফাইল(সমূহ) বা ফোল্ডার(সমূহ)" #: tools/editor/editor_node.cpp #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Scene" -msgstr "" +msgstr "দৃশ্য" #: tools/editor/editor_node.cpp msgid "Go to previously opened scene." -msgstr "" +msgstr "পূর্বে খোলা দৃশ্যে যান।" #: tools/editor/editor_node.cpp msgid "Next tab" -msgstr "" +msgstr "পরের ট্যাব" #: tools/editor/editor_node.cpp msgid "Previous tab" -msgstr "" +msgstr "পূর্বের ট্যাব" #: tools/editor/editor_node.cpp msgid "Operations with scene files." -msgstr "" +msgstr "দৃশ্যের ফাইলের সাথে কার্যকলাপসমূহ।" #: tools/editor/editor_node.cpp msgid "New Scene" -msgstr "" +msgstr "নতুন দৃশ্য" #: tools/editor/editor_node.cpp msgid "New Inherited Scene.." -msgstr "" +msgstr "নতুন উত্তরাধিকারী দৃশ্য.." #: tools/editor/editor_node.cpp msgid "Open Scene.." -msgstr "" +msgstr "দৃশ্য খুলুন.." #: tools/editor/editor_node.cpp msgid "Save Scene" -msgstr "" +msgstr "দৃশ্য সংরক্ষণ করুন" #: tools/editor/editor_node.cpp msgid "Save all Scenes" -msgstr "" +msgstr "সকল দৃশ্য সংরক্ষণ করুন" #: tools/editor/editor_node.cpp msgid "Close Scene" -msgstr "" +msgstr "দৃশ্য বন্ধ করুন" #: tools/editor/editor_node.cpp msgid "Close Goto Prev. Scene" -msgstr "" +msgstr "বন্ধ করে পূর্বের দৃশ্যে যান" #: tools/editor/editor_node.cpp msgid "Open Recent" -msgstr "" +msgstr "সাম্প্রতিকসমূহ খুলুন" #: tools/editor/editor_node.cpp msgid "Quick Filter Files.." -msgstr "" +msgstr "দ্রুত ফাইলসমূহ ফিল্টার করুন.." #: tools/editor/editor_node.cpp msgid "Convert To.." -msgstr "" +msgstr "এতে রূপান্তর করুন.." #: tools/editor/editor_node.cpp msgid "Translatable Strings.." -msgstr "" +msgstr "অনুবাদ-সম্ভব শব্দমালা/বাক্য-সমূহ.." #: tools/editor/editor_node.cpp msgid "MeshLibrary.." -msgstr "" +msgstr "MeshLibrary (মেস-লাইব্রেরি).." #: tools/editor/editor_node.cpp msgid "TileSet.." -msgstr "" +msgstr "TileSet (টাইল-সেট).." #: tools/editor/editor_node.cpp tools/editor/plugins/script_text_editor.cpp #: tools/editor/plugins/shader_editor_plugin.cpp msgid "Redo" -msgstr "" +msgstr "পুনরায় করুন" #: tools/editor/editor_node.cpp msgid "Run Script" -msgstr "" +msgstr "স্ক্রিপ্ট চালান" #: tools/editor/editor_node.cpp msgid "Project Settings" -msgstr "" +msgstr "প্রকল্পের সেটিংস" #: tools/editor/editor_node.cpp msgid "Revert Scene" -msgstr "" +msgstr "দৃশ্য প্রত্যাবৃত্ত করুন" #: tools/editor/editor_node.cpp msgid "Quit to Project List" -msgstr "" +msgstr "প্রকল্পের তালিকায় প্রস্থান করুন" #: tools/editor/editor_node.cpp msgid "Distraction Free Mode" -msgstr "" +msgstr "বিক্ষেপ-হীন মোড" #: tools/editor/editor_node.cpp msgid "Import assets to the project." -msgstr "" +msgstr "উপাদানসমূহ প্রকল্পে ইম্পোর্ট করুন।" #: tools/editor/editor_node.cpp #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp @@ -2279,83 +2313,85 @@ msgstr "" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp #: tools/editor/project_manager.cpp msgid "Import" -msgstr "" +msgstr "ইম্পোর্ট" #: tools/editor/editor_node.cpp msgid "Miscellaneous project or scene-wide tools." -msgstr "" +msgstr "প্রকল্প অথবা দৃশ্যে-ব্যাপী বিবিধ সরঞ্জাম-সমূহ।" #: tools/editor/editor_node.cpp msgid "Tools" -msgstr "" +msgstr "সরঞ্জাম-সমূহ" #: tools/editor/editor_node.cpp msgid "Export the project to many platforms." -msgstr "" +msgstr "প্রকল্পটি একাধিক প্লাটফর্মে এক্সপোর্ট করুন।" #: tools/editor/editor_node.cpp tools/editor/project_export.cpp msgid "Export" -msgstr "" +msgstr "এক্সপোর্ট" #: tools/editor/editor_node.cpp msgid "Play the project." -msgstr "" +msgstr "প্রকল্পটি চালান।" #: tools/editor/editor_node.cpp #: tools/editor/plugins/sample_library_editor_plugin.cpp msgid "Play" -msgstr "" +msgstr "চালান" #: tools/editor/editor_node.cpp msgid "Pause the scene" -msgstr "" +msgstr "দৃশ্যটিকে বিরতি দিন" #: tools/editor/editor_node.cpp msgid "Pause Scene" -msgstr "" +msgstr "দৃশ্যকে বিরতি দিন" #: tools/editor/editor_node.cpp msgid "Stop the scene." -msgstr "" +msgstr "দৃশ্যটিকে থামান।" #: tools/editor/editor_node.cpp #: tools/editor/plugins/sample_library_editor_plugin.cpp msgid "Stop" -msgstr "" +msgstr "থামান" #: tools/editor/editor_node.cpp msgid "Play the edited scene." -msgstr "" +msgstr "সম্পাদিত দৃশ্যটি চালান।" #: tools/editor/editor_node.cpp msgid "Play Scene" -msgstr "" +msgstr "দৃশ্য চালান" #: tools/editor/editor_node.cpp msgid "Play custom scene" -msgstr "" +msgstr "স্বনির্বাচিত দৃশ্য চালান" #: tools/editor/editor_node.cpp msgid "Play Custom Scene" -msgstr "" +msgstr "স্বনির্বাচিত দৃশ্য চালান" #: tools/editor/editor_node.cpp msgid "Debug options" -msgstr "" +msgstr "ডিবাগের সিদ্ধান্তসমূহ" #: tools/editor/editor_node.cpp msgid "Deploy with Remote Debug" -msgstr "" +msgstr "দূরবর্তী ডিবাগের সহিত ডিপ্লয় করুন" #: tools/editor/editor_node.cpp msgid "" "When exporting or deploying, the resulting executable will attempt to " "connect to the IP of this computer in order to be debugged." msgstr "" +"এক্সপোর্ট (Export) বা ডিপ্লয় (Deploy)-এর সময় প্রস্তুতকৃত এক্সিকিউটেবল (executable) " +"ডিবাগ (debug)-এর উদ্দেশ্যে এই কম্পিউটারের আইপি (IP)-তে সংযোগ করার চেষ্টা করবে।" #: tools/editor/editor_node.cpp msgid "Small Deploy with Network FS" -msgstr "" +msgstr "নেটওয়ার্ক ফাইল-সিস্টেমের সহিত ক্ষুদ্র-ডিপ্লয় করুন" #: tools/editor/editor_node.cpp msgid "" @@ -2366,30 +2402,40 @@ msgid "" "On Android, deploy will use the USB cable for faster performance. This " "option speeds up testing for games with a large footprint." msgstr "" +"এই সিদ্ধান্তটি (অপশন) সক্রিয় করলে, এক্সপোর্ট (Export) বা ডিপ্লয় (Deploy)-এ স্বল্পতম " +"মানের এক্সিকিউটেবল (executable) উৎপাদন হবে।\n" +"ফাইল-সিস্টেম (filesystem) প্রকল্প হতে এডিটর (editor) দিয়ে নেটওয়ার্ক-এর মাধ্যমে " +"যোগান দেয়া হবে।\n" +"অ্যান্ড্রয়েড ডিপ্লয়ে (deploy) দ্রুততর কর্মক্ষমতার জন্য ইউএসবি (USB) ক্যাবল ব্যবহৃত হবে। " +"এই সিদ্ধান্তটি (অপশন) বৃহৎ মানের গেমের পরীক্ষা দ্রুততর করে তুলে।" #: tools/editor/editor_node.cpp msgid "Visible Collision Shapes" -msgstr "" +msgstr "দৃশ্যমান সাংঘর্ষিক আকারসমূহ (Collision Shapes)" #: tools/editor/editor_node.cpp msgid "" "Collision shapes and raycast nodes (for 2D and 3D) will be visible on the " "running game if this option is turned on." msgstr "" +"এই সিদ্ধান্তটি (অপশন) সক্রিয় করলে চলমান গেমে কলিশ়ন (Collision) আকৃতি এবং রে-কাস্ট " +"(RayCast) নোড (2D এবং 3D) দৃশ্যমান হবে।" #: tools/editor/editor_node.cpp msgid "Visible Navigation" -msgstr "" +msgstr "দৃশ্যমান নেভিগেশন (Navigation)" #: tools/editor/editor_node.cpp msgid "" "Navigation meshes and polygons will be visible on the running game if this " "option is turned on." msgstr "" +"এই সিদ্ধান্তটি (অপশন) সক্রিয় করলে চলমান গেমে ন্যাভিগেশন (Navigation) মেস এবং " +"পলিগন-সমূহ দৃশ্যমান হবে।" #: tools/editor/editor_node.cpp msgid "Sync Scene Changes" -msgstr "" +msgstr "দৃশ্যের পরিবর্তনসমূহ সুসংগত/সমন্বয় করুন" #: tools/editor/editor_node.cpp msgid "" @@ -2398,10 +2444,14 @@ msgid "" "When used remotely on a device, this is more efficient with network " "filesystem." msgstr "" +"এই সিদ্ধান্তটি (অপশন) সক্রিয় থাকলে, এডিটরে কোনো দৃশ্যের পরিবর্তন করলে তা চলমান " +"গেমে প্রতিফলিত হবে।\n" +"রিমোট ডিভাইসে ব্যবহারের সময়, নেটওয়ার্ক ফাইল-সিস্টেম (filesystem) এটিকে আরো " +"কার্যকর করবে।" #: tools/editor/editor_node.cpp msgid "Sync Script Changes" -msgstr "" +msgstr "স্ক্রিপ্টের পরিবর্তনসমূহ সুসংগত/সমন্বয় করুন" #: tools/editor/editor_node.cpp msgid "" @@ -2410,278 +2460,284 @@ msgid "" "When used remotely on a device, this is more efficient with network " "filesystem." msgstr "" +"এই সিদ্ধান্তটি (অপশন) সক্রিয় থাকলে, কোনো স্ক্রিপ্টের পরিবর্তন সংরক্ষণে তা চলমান গেমে " +"প্রতিফলিত হবে।\n" +"রিমোট ডিভাইসে ব্যবহারের সময়, নেটওয়ার্ক ফাইল-সিস্টেম (filesystem) এটিকে আরো " +"কার্যকর করবে।" #: tools/editor/editor_node.cpp tools/editor/plugins/spatial_editor_plugin.cpp msgid "Settings" -msgstr "" +msgstr "সেটিংস" #: tools/editor/editor_node.cpp tools/editor/settings_config_dialog.cpp msgid "Editor Settings" -msgstr "" +msgstr "এডিটরের সেটিংস" #: tools/editor/editor_node.cpp msgid "Editor Layout" -msgstr "" +msgstr "এডিটরের লেআউট/নকশা" #: tools/editor/editor_node.cpp msgid "Toggle Fullscreen" -msgstr "" +msgstr "পূর্ণ-পর্দা অদলবদল/টগল করুন" #: tools/editor/editor_node.cpp msgid "Install Export Templates" -msgstr "" +msgstr "এক্সপোর্টের টেমপ্লেটসমূহ ইন্সটল করুন" #: tools/editor/editor_node.cpp msgid "About" -msgstr "" +msgstr "সম্বন্ধে/সম্পর্কে" #: tools/editor/editor_node.cpp msgid "Alerts when an external resource has changed." -msgstr "" +msgstr "বহি:স্থ রিসোর্সের পরিবর্তনে সতর্ক করে।" #: tools/editor/editor_node.cpp msgid "Spins when the editor window repaints!" -msgstr "" +msgstr "এডিটরের পুন-অঙ্কনে এটি ঘূর্ণন করে!" #: tools/editor/editor_node.cpp msgid "Update Always" -msgstr "" +msgstr "সর্বদা হাল-নাগাদ করুন" #: tools/editor/editor_node.cpp msgid "Update Changes" -msgstr "" +msgstr "পরিবর্তনসমূহ হাল-নাগাদ করুন" #: tools/editor/editor_node.cpp msgid "Disable Update Spinner" -msgstr "" +msgstr "হাল-নাগাদকারী ঘূর্ণক নিষ্ক্রিয় করুন" #: tools/editor/editor_node.cpp msgid "Inspector" -msgstr "" +msgstr "পরিদর্শক/পরীক্ষক" #: tools/editor/editor_node.cpp msgid "Create a new resource in memory and edit it." -msgstr "" +msgstr "মেমোরিতে নতুন একটি রিসোর্স তৈরি করুন এবং সম্পাদন করুন।" #: tools/editor/editor_node.cpp msgid "Load an existing resource from disk and edit it." -msgstr "" +msgstr "ডিস্ক হতে একটি বিদ্যমান রিসোর্স লোড করুন এবং সম্পাদন করুন।" #: tools/editor/editor_node.cpp msgid "Save the currently edited resource." -msgstr "" +msgstr "এই-মুহূর্তে সম্পাদিত রিসোর্সটি সংরক্ষণ করুন।" #: tools/editor/editor_node.cpp tools/editor/plugins/script_editor_plugin.cpp msgid "Save As.." -msgstr "" +msgstr "এইরূপে সংরক্ষণ করুন.." #: tools/editor/editor_node.cpp msgid "Go to the previous edited object in history." -msgstr "" +msgstr "স্মৃতিতে অবস্থিত পূর্বে সম্পাদিত বস্তুতে যান।" #: tools/editor/editor_node.cpp msgid "Go to the next edited object in history." -msgstr "" +msgstr "স্মৃতিতে অবস্থিত পরবর্তিতে সম্পাদিত বস্তুতে যান।" #: tools/editor/editor_node.cpp msgid "History of recently edited objects." -msgstr "" +msgstr "সাম্প্রতিক সময়ে সম্পাদিত বস্তুর স্মৃতি।" #: tools/editor/editor_node.cpp msgid "Object properties." -msgstr "" +msgstr "বস্তুর বৈশিষ্ট্যসমূহ।" #: tools/editor/editor_node.cpp msgid "FileSystem" -msgstr "" +msgstr "ফাইলসিস্টেম" #: tools/editor/editor_node.cpp tools/editor/node_dock.cpp msgid "Node" -msgstr "" +msgstr "নোড" #: tools/editor/editor_node.cpp msgid "Output" -msgstr "" +msgstr "আউটপুট/ফলাফল" #: tools/editor/editor_node.cpp tools/editor/editor_reimport_dialog.cpp msgid "Re-Import" -msgstr "" +msgstr "পুন-ইম্পোর্ট" #: tools/editor/editor_node.cpp tools/editor/editor_plugin_settings.cpp msgid "Update" -msgstr "" +msgstr "হালনাগাদ" #: tools/editor/editor_node.cpp msgid "Thanks from the Godot community!" -msgstr "" +msgstr "Godot কমিউনিটি হতে আপনাকে ধন্যবাদ!" #: tools/editor/editor_node.cpp msgid "Thanks!" -msgstr "" +msgstr "ধন্যবাদ!" #: tools/editor/editor_node.cpp msgid "Import Templates From ZIP File" -msgstr "" +msgstr "ZIP ফাইল হতে টেমপ্লেট-সমূহ ইম্পোর্ট করুন" #: tools/editor/editor_node.cpp tools/editor/project_export.cpp msgid "Export Project" -msgstr "" +msgstr "প্রকল্প এক্সপোর্ট করুন" #: tools/editor/editor_node.cpp msgid "Export Library" -msgstr "" +msgstr "লাইব্রেরি এক্সপোর্ট করুন" #: tools/editor/editor_node.cpp msgid "Merge With Existing" -msgstr "" +msgstr "বিদ্যমানের সাথে একত্রিত করুন" #: tools/editor/editor_node.cpp tools/editor/project_export.cpp msgid "Password:" -msgstr "" +msgstr "পাসওয়ার্ড:" #: tools/editor/editor_node.cpp msgid "Open & Run a Script" -msgstr "" +msgstr "একটি স্ক্রিপ্ট খুলুন এবং চালান" #: tools/editor/editor_node.cpp msgid "Load Errors" -msgstr "" +msgstr "ভুল/সমস্যা-সমূহ লোড করুন" #: tools/editor/editor_plugin_settings.cpp msgid "Installed Plugins:" -msgstr "" +msgstr "ইন্সটল-কৃত প্লাগইন-সমূহ:" #: tools/editor/editor_plugin_settings.cpp msgid "Version:" -msgstr "" +msgstr "সংস্করণ:" #: tools/editor/editor_plugin_settings.cpp msgid "Author:" -msgstr "" +msgstr "লেখক:" #: tools/editor/editor_plugin_settings.cpp msgid "Status:" -msgstr "" +msgstr "অবস্থা:" #: tools/editor/editor_profiler.cpp msgid "Stop Profiling" -msgstr "" +msgstr "প্রোফাইলিং বন্ধ করুন" #: tools/editor/editor_profiler.cpp msgid "Start Profiling" -msgstr "" +msgstr "প্রোফাইলিং শুরু করুন" #: tools/editor/editor_profiler.cpp msgid "Measure:" -msgstr "" +msgstr "মাপ:" #: tools/editor/editor_profiler.cpp msgid "Frame Time (sec)" -msgstr "" +msgstr "ফ্রেম-এর সময় (সেঃ)" #: tools/editor/editor_profiler.cpp msgid "Average Time (sec)" -msgstr "" +msgstr "গড় সময় (সেঃ)" #: tools/editor/editor_profiler.cpp msgid "Frame %" -msgstr "" +msgstr "ফ্রেম %" #: tools/editor/editor_profiler.cpp msgid "Fixed Frame %" -msgstr "" +msgstr "স্থির/বদ্ধ ফ্রেম %" #: tools/editor/editor_profiler.cpp tools/editor/script_editor_debugger.cpp msgid "Time:" -msgstr "" +msgstr "সময়:" #: tools/editor/editor_profiler.cpp msgid "Inclusive" -msgstr "" +msgstr "অন্তর্ভুক্ত" #: tools/editor/editor_profiler.cpp msgid "Self" -msgstr "" +msgstr "স্বীয়" #: tools/editor/editor_profiler.cpp msgid "Frame #:" -msgstr "" +msgstr "ফ্রেম #:" #: tools/editor/editor_reimport_dialog.cpp msgid "Please wait for scan to complete." -msgstr "" +msgstr "স্ক্যান সম্পন্ন হওয়া পর্যন্ত অনুগ্রহ করে অপেক্ষা করুন।" #: tools/editor/editor_reimport_dialog.cpp msgid "Current scene must be saved to re-import." -msgstr "" +msgstr "পুনরায়-ইম্পোর্ট করতে বর্তমান দৃশ্যটিকে অবশ্যই সংরক্ষণ করতে হবে।" #: tools/editor/editor_reimport_dialog.cpp msgid "Save & Re-Import" -msgstr "" +msgstr "সংরক্ষণ এবং পুন-ইম্পোর্ট করুন" #: tools/editor/editor_reimport_dialog.cpp msgid "Re-Import Changed Resources" -msgstr "" +msgstr "পুন-ইম্পোর্টে রিসোর্স-সমূহ পরিবর্তিত হয়েছে" #: tools/editor/editor_run_script.cpp msgid "Write your logic in the _run() method." -msgstr "" +msgstr "আপনার লজিক/যুক্তি-সমূহ _run() মেথডে লিখুন।" #: tools/editor/editor_run_script.cpp msgid "There is an edited scene already." -msgstr "" +msgstr "এখানে ইতিমধ্যেই একটি সম্পাদিত দৃশ্য রয়েছে।" #: tools/editor/editor_run_script.cpp msgid "Couldn't instance script:" -msgstr "" +msgstr "স্ক্রিপ্ট ইনস্ট্যান্স করা সম্ভব হয়নি:" #: tools/editor/editor_run_script.cpp msgid "Did you forget the 'tool' keyword?" -msgstr "" +msgstr "আপনি কি 'tool' কীওয়ার্ড/শব্দটি দিতে ভুলেছেন?" #: tools/editor/editor_run_script.cpp msgid "Couldn't run script:" -msgstr "" +msgstr "স্ক্রিপ্ট চালানো সম্ভব হয়নি:" #: tools/editor/editor_run_script.cpp msgid "Did you forget the '_run' method?" -msgstr "" +msgstr "আপনি কি '_run' মেথডটি দিতে ভুলেছেন?" #: tools/editor/editor_settings.cpp msgid "Default (Same as Editor)" -msgstr "" +msgstr "ডিফল্ট/সাধারণ (এডিটরের মতোই)" #: tools/editor/editor_sub_scene.cpp msgid "Select Node(s) to Import" -msgstr "" +msgstr "ইম্পোর্টের জন্য নোড(সমূহ) নির্বাচন করুন" #: tools/editor/editor_sub_scene.cpp msgid "Scene Path:" -msgstr "" +msgstr "দৃশ্যের পথ:" #: tools/editor/editor_sub_scene.cpp msgid "Import From Node:" -msgstr "" +msgstr "নোড হতে ইম্পোর্ট করুন:" #: tools/editor/file_type_cache.cpp msgid "Can't open file_type_cache.cch for writing, not saving file type cache!" msgstr "" +"লেখার জন্য file_type_cache.cch খোলা সম্ভব হচ্ছে না, ফাইলের ধরণ ক্যাশ (cache) " +"সংরক্ষিত হচ্ছে না!" #: tools/editor/filesystem_dock.cpp msgid "Same source and destination files, doing nothing." -msgstr "" +msgstr "ফাইল্গুলোর একই উৎস এবং গন্তব্যস্থান, কিছুই করা হচ্ছে না।" #: tools/editor/filesystem_dock.cpp msgid "Same source and destination paths, doing nothing." -msgstr "" +msgstr "পথগুলোর একই উৎস এবং গন্তব্যস্থান, কিছুই করা হচ্ছে না।" #: tools/editor/filesystem_dock.cpp msgid "Can't move directories to within themselves." -msgstr "" +msgstr "স্থানসমূহকে তাদের মাঝেই স্থানান্তর করা সম্ভব নয়।" #: tools/editor/filesystem_dock.cpp msgid "Can't operate on '..'" -msgstr "" +msgstr "'..' তে পরিচালনা করা সম্ভব নয়" #: tools/editor/filesystem_dock.cpp msgid "Pick New Name and Location For:" @@ -2693,111 +2749,111 @@ msgstr "কোনো ফাইল নির্বাচিত হয়নি!" #: tools/editor/filesystem_dock.cpp msgid "Instance" -msgstr "" +msgstr "ইনস্ট্যান্স" #: tools/editor/filesystem_dock.cpp msgid "Edit Dependencies.." -msgstr "" +msgstr "নির্ভরতাসমূহ সম্পাদন করুন.." #: tools/editor/filesystem_dock.cpp msgid "View Owners.." -msgstr "" +msgstr "স্বত্বাধিকারীদের দেখুন.." #: tools/editor/filesystem_dock.cpp msgid "Copy Path" -msgstr "" +msgstr "পথ প্রতিলিপি/কপি করুন" #: tools/editor/filesystem_dock.cpp msgid "Rename or Move.." -msgstr "" +msgstr "পুনঃনামকরণ করুন অথবা সরান.." #: tools/editor/filesystem_dock.cpp msgid "Move To.." -msgstr "" +msgstr "এখানে সরান.." #: tools/editor/filesystem_dock.cpp msgid "Info" -msgstr "" +msgstr "তথ্য" #: tools/editor/filesystem_dock.cpp msgid "Show In File Manager" -msgstr "" +msgstr "ফাইল-ম্যানেজারে দেখুন" #: tools/editor/filesystem_dock.cpp msgid "Re-Import.." -msgstr "" +msgstr "পুন-ইম্পোর্ট.." #: tools/editor/filesystem_dock.cpp msgid "Previous Directory" -msgstr "" +msgstr "পূর্বের স্থান" #: tools/editor/filesystem_dock.cpp msgid "Next Directory" -msgstr "" +msgstr "পরের স্থান" #: tools/editor/filesystem_dock.cpp msgid "Re-Scan Filesystem" -msgstr "" +msgstr "ফাইলসিস্টেম পুন-স্ক্যান করুন" #: tools/editor/filesystem_dock.cpp msgid "Toggle folder status as Favorite" -msgstr "" +msgstr "ফোল্ডারের অবস্থা ফেবরিট/প্রিয় হিসেবে অদলবদল/টগল করুন" #: tools/editor/filesystem_dock.cpp msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" +msgstr "নির্বাচিত দৃশ্য(সমূহ)-কে নির্বাচিত নোডের অংশ হিসেবে ইনস্ট্যান্স করুন।" #: tools/editor/filesystem_dock.cpp msgid "Move" -msgstr "" +msgstr "সরান" #: tools/editor/groups_editor.cpp msgid "Add to Group" -msgstr "" +msgstr "গ্রুপ/দলে যোগ করুন" #: tools/editor/groups_editor.cpp msgid "Remove from Group" -msgstr "" +msgstr "গ্রুপ/দল হতে অপসারণ করুন" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp msgid "No bit masks to import!" -msgstr "" +msgstr "ইম্পোর্ট করার জন্য কোনো বিট মাস্ক নেই!" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp #: tools/editor/io_plugins/editor_sample_import_plugin.cpp #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Target path is empty." -msgstr "" +msgstr "উদ্দেশ্যিত পথটি খালি।" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp #: tools/editor/io_plugins/editor_sample_import_plugin.cpp #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Target path must be a complete resource path." -msgstr "" +msgstr "উদ্দেশ্যিত পথটি অবশ্যই একটি সম্পুর্ণ রিসোর্স পথ হতে হবে।" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp #: tools/editor/io_plugins/editor_sample_import_plugin.cpp #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Target path must exist." -msgstr "" +msgstr "উদ্দেশ্যিত পথটি অবশ্যই বিদ্যমান হতে হবে।" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp #: tools/editor/io_plugins/editor_mesh_import_plugin.cpp #: tools/editor/io_plugins/editor_sample_import_plugin.cpp msgid "Save path is empty!" -msgstr "" +msgstr "সংরক্ষণের পথটি খালি!" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp msgid "Import BitMasks" -msgstr "" +msgstr "BitMasks ইম্পোর্ট করুন" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Source Texture(s):" -msgstr "" +msgstr "টেক্সার(সমূহ)-এর উৎস:" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp #: tools/editor/io_plugins/editor_mesh_import_plugin.cpp @@ -2805,8 +2861,9 @@ msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" -msgstr "" +msgstr "উদ্দেশ্যিত পথ:" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp #: tools/editor/io_plugins/editor_font_import_plugin.cpp @@ -2815,676 +2872,688 @@ msgstr "" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Accept" -msgstr "" +msgstr "গ্রহণ করুন" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp msgid "Bit Mask" -msgstr "" +msgstr "বিট-মাস্ক (Bit Mask)" #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "No source font file!" -msgstr "" +msgstr "ফন্টের কোনো উৎস ফাইল নেই!" #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "No target font resource!" -msgstr "" +msgstr "ফন্টের কোনো উদ্দেশ্যিত রিসোর্স নেই!" #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "" "Invalid file extension.\n" "Please use .fnt." msgstr "" +"ফাইলের অগ্রহনযোগ্য এক্সটেনশন।\n" +"অনুগ্রহ করে .fnt ব্যবহার করুন।" #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "Can't load/process source font." -msgstr "" +msgstr "ফন্টের উৎস লোড/প্রসেস করা সম্ভব হচ্ছে না।" #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "Couldn't save font." -msgstr "" +msgstr "ফন্ট সংরক্ষণ করা সম্ভব হয়নি।" #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "Source Font:" -msgstr "" +msgstr "ফন্টের উৎস:" #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "Source Font Size:" -msgstr "" +msgstr "উৎস ফন্টের আকার:" #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "Dest Resource:" -msgstr "" +msgstr "রিসোর্সের গন্তব্যস্থান:" #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "The quick brown fox jumps over the lazy dog." msgstr "" +"বাদামী রঙ্গের দ্রুত শিয়ালটি অলস কুকুরের উপর দিয়ে লাফিয়ে যায় (The quick brown fox " +"jumps over the lazy dog.)।" #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "Test:" -msgstr "" +msgstr "পরীক্ষা:" #: tools/editor/io_plugins/editor_font_import_plugin.cpp #: tools/editor/io_plugins/editor_mesh_import_plugin.cpp #: tools/editor/io_plugins/editor_sample_import_plugin.cpp #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Options:" -msgstr "" +msgstr "সিদ্ধান্তসমূহ (অপশন):" #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "Font Import" -msgstr "" +msgstr "ফন্ট ইম্পোর্ট করুন" #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "" "This file is already a Godot font file, please supply a BMFont type file " "instead." msgstr "" +"এই ফাইলটি ইতিমধ্যেই একটি Godot ফন্ট ফাইল, পরিবর্তে অনুগ্রহ করে BMFont ধরণের ফাইল " +"প্রদান করুন।" #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "Failed opening as BMFont file." -msgstr "" +msgstr "BMFont ফাইল খোলা ব্যর্থ হয়েছে।" #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "Invalid font custom source." -msgstr "" +msgstr "স্বনির্মিত ফন্টের অগ্রহনযোগ্য উৎস।" #: tools/editor/io_plugins/editor_font_import_plugin.cpp #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Font" -msgstr "" +msgstr "ফন্ট" #: tools/editor/io_plugins/editor_mesh_import_plugin.cpp msgid "No meshes to import!" -msgstr "" +msgstr "ইম্পোর্ট করার মতো কোনো মেস নেই!" #: tools/editor/io_plugins/editor_mesh_import_plugin.cpp msgid "Single Mesh Import" -msgstr "" +msgstr "একক মেস ইম্পোর্ট করুন" #: tools/editor/io_plugins/editor_mesh_import_plugin.cpp msgid "Source Mesh(es):" -msgstr "" +msgstr "মেস(সমূহ)-এর উৎস:" #: tools/editor/io_plugins/editor_mesh_import_plugin.cpp #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Mesh" -msgstr "" +msgstr "মেস" #: tools/editor/io_plugins/editor_mesh_import_plugin.cpp msgid "Surface %d" -msgstr "" +msgstr "পৃষ্ঠতল %d" #: tools/editor/io_plugins/editor_sample_import_plugin.cpp msgid "No samples to import!" -msgstr "" +msgstr "ইম্পোর্ট করার মতো কোনো নমুনা নেই!" #: tools/editor/io_plugins/editor_sample_import_plugin.cpp msgid "Import Audio Samples" -msgstr "" +msgstr "শব্দের নমুনাসমূহ ইম্পোর্ট করুন" #: tools/editor/io_plugins/editor_sample_import_plugin.cpp msgid "Source Sample(s):" -msgstr "" +msgstr "নমুনা(সমূহ)-এর উৎস:" #: tools/editor/io_plugins/editor_sample_import_plugin.cpp msgid "Audio Sample" -msgstr "" +msgstr "শব্দের নমুনা" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "New Clip" -msgstr "" +msgstr "নতুন ক্লিপ" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Animation Options" -msgstr "" +msgstr "অ্যানিমেশনের সিদ্ধান্তসমূহ" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Flags" -msgstr "" +msgstr "পতাকাসমূহ" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Bake FPS:" -msgstr "" +msgstr "সিদ্ধ FPS:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Optimizer" -msgstr "" +msgstr "পরিমার্জক" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Max Linear Error" -msgstr "" +msgstr "সর্বোচ্চ রৈখিক ভুল/সমস্যা" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Max Angular Error" -msgstr "" +msgstr "সর্বোচ্চ কৌণিক ভুল/সমস্যা" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Max Angle" -msgstr "" +msgstr "সর্বোচ্চ কোণ" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Clips" -msgstr "" +msgstr "ক্লিপসমূহ" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Start(s)" -msgstr "" +msgstr "আরম্ভ(সমূহ)" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "End(s)" -msgstr "" +msgstr "সমাপ্তি(সমূহ)" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Loop" -msgstr "" +msgstr "লুপ" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Filters" -msgstr "" +msgstr "ফিল্টারসমূহ" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Source path is empty." -msgstr "" +msgstr "উৎসের পথটি খালি।" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Couldn't load post-import script." -msgstr "" +msgstr "ইম্পোর্ট-পরবর্তী স্ক্রিপ্ট লোড করা সম্ভব হয়নি।" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Invalid/broken script for post-import." -msgstr "" +msgstr "ইম্পোর্ট-পরবর্তী স্ক্রিপ্ট অকার্যকর/ত্রুটিপূর্ণ।" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Error importing scene." -msgstr "" +msgstr "দৃশ্য ইম্পোর্টে সমস্যা হয়েছে।" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Import 3D Scene" -msgstr "" +msgstr "3D দৃশ্য ইম্পোর্ট করুন" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Source Scene:" -msgstr "" +msgstr "উৎস দৃশ্য:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Same as Target Scene" -msgstr "" +msgstr "উদ্দেশ্যিত দৃশ্যের ন্যায়" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Shared" -msgstr "" +msgstr "শেয়ারকৃত" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Target Texture Folder:" -msgstr "" +msgstr "গঠনবিন্যাসের উদ্দেশ্যিত ফোল্ডার:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Post-Process Script:" -msgstr "" +msgstr "প্রক্রিয়া-পরবর্তী স্ক্রিপ্ট:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Custom Root Node Type:" -msgstr "" +msgstr "স্বনির্মিত মূল নোডের ধরণ:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Auto" -msgstr "" +msgstr "স্বয়ংক্রিয়" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp +msgid "Root Node Name:" +msgstr "মূল নোডের নাম:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" -msgstr "" +msgstr "নিম্নোক্ত ফাইলসমূহ অনুপস্থিত:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Import Anyway" -msgstr "" +msgstr "যেকোনো উপায়েই ইম্পোর্ট করুন" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Import & Open" -msgstr "" +msgstr "ইম্পোর্ট করুন এবং খুলুন" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Edited scene has not been saved, open imported scene anyway?" -msgstr "" +msgstr "সম্পাদিত দৃশ্য সংরক্ষণ করা হয়নি, তবুও ইম্পোর্ট করা দৃশ্যটি খুলবেন?" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/plugins/cube_grid_theme_editor_plugin.cpp msgid "Import Scene" -msgstr "" +msgstr "দৃশ্য ইম্পোর্ট করুন" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Importing Scene.." -msgstr "" +msgstr "দৃশ্য ইম্পোর্ট করা হচ্ছে.." #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Running Custom Script.." -msgstr "" +msgstr "স্বনির্মিত স্ক্রিপ্ট চালানো হচ্ছে.." #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Couldn't load post-import script:" -msgstr "" +msgstr "ইম্পোর্ট-পরবর্তী স্ক্রিপ্ট লোড করা সম্ভব হয়নি:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Invalid/broken script for post-import (check console):" -msgstr "" +msgstr "ইম্পোর্ট-পরবর্তী স্ক্রিপ্ট অকার্যকর/ত্রুটিপূর্ণ (কনসোল দেখুন):" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Error running post-import script:" -msgstr "" +msgstr "ইম্পোর্ট-পরবর্তী স্ক্রিপ্ট চালানোয় সমস্যা হয়েছে:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Import Image:" -msgstr "" +msgstr "ছবি ইম্পোর্ট করুন:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Can't import a file over itself:" -msgstr "" +msgstr "ফাইলকে তার নিজের উপরেই ইম্পোর্ট করা সম্ভব নয়:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Couldn't localize path: %s (already local)" -msgstr "" +msgstr "পথ স্থানীয়করণ সম্ভব হচ্ছে না: %s (ইতিমধ্যেই স্থানীয়)" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Saving.." -msgstr "" +msgstr "সংরক্ষিত হচ্ছে.." #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "3D Scene Animation" -msgstr "" +msgstr "3D দৃশ্যের অ্যানিমেশন" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Uncompressed" -msgstr "" +msgstr "অসংকুচিত" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Compress Lossless (PNG)" -msgstr "" +msgstr "ধ্বংসবিহীন সঙ্কোচন (PNG)" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Compress Lossy (WebP)" -msgstr "" +msgstr "ধ্বংসাত্মক সঙ্কোচন (WebP)" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Compress (VRAM)" -msgstr "" +msgstr "সঙ্কোচন (VRAM)" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Texture Format" -msgstr "" +msgstr "গঠনবিন্যাসের ফরম্যাট" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Texture Compression Quality (WebP):" -msgstr "" +msgstr "গঠনবিন্যাস সঙ্কোচনের গুণমান (WebP):" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Texture Options" -msgstr "" +msgstr "গঠনবিন্যাসের সিদ্ধান্ত (অপশন)-সমূহ" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Please specify some files!" -msgstr "" +msgstr "অনুগ্রহ করে কিছু ফাইল নির্দিষ্ট করে দিন!" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "At least one file needed for Atlas." -msgstr "" +msgstr "এটলাস/মানচিত্রাবলীর জন্য কমপক্ষে একটি ফাইল প্রয়োজন।" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Error importing:" -msgstr "" +msgstr "ইম্পোর্টে সমস্যা হয়েছে:" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Only one file is required for large texture." -msgstr "" +msgstr "বৃহৎ গঠনবিন্যাসের জন্য শুধুমাত্র একটি ফাইল প্রয়োজন।" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Max Texture Size:" -msgstr "" +msgstr "গঠনবিন্যাসের সর্বোচ্চ আকার:" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Import Textures for Atlas (2D)" -msgstr "" +msgstr "এটলাস/মানচিত্রাবলীর জন্য গঠনবিন্যাস ইম্পোর্ট করুন (2D)" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Cell Size:" -msgstr "" +msgstr "সেল (Cell)-এর আকার:" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Large Texture" -msgstr "" +msgstr "বৃহৎ গঠনবিন্যাস" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Import Large Textures (2D)" -msgstr "" +msgstr "বৃহৎ গঠনবিন্যাস ইম্পোর্ট করুন (2D)" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Source Texture" -msgstr "" +msgstr "গঠনবিন্যাসের উৎস" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Base Atlas Texture" -msgstr "" +msgstr "গোড়ার এটলাস/মানচিত্রাবলীর গঠনবিন্যাস" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Source Texture(s)" -msgstr "" +msgstr "গঠনবিন্যাস(সমূহ)-এর উৎস" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Import Textures for 2D" -msgstr "" +msgstr "2D-এর জন্য গঠনবিন্যাসসমূহ ইম্পোর্ট করুন" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Import Textures for 3D" -msgstr "" +msgstr "3D-এর জন্য গঠনবিন্যাসসমূহ ইম্পোর্ট করুন" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Import Textures" -msgstr "" +msgstr "গঠনবিন্যাসসমূহ ইম্পোর্ট করুন" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "2D Texture" -msgstr "" +msgstr "2D গঠনবিন্যাস" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "3D Texture" -msgstr "" +msgstr "3D গঠনবিন্যাস" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Atlas Texture" -msgstr "" +msgstr "এটলাস/মানচিত্রাবলীর গঠনবিন্যাস" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "" "NOTICE: Importing 2D textures is not mandatory. Just copy png/jpg files to " "the project." msgstr "" +"নোটিশ: 2D টেক্সচার (texture) ইম্পোর্ট (import) করা অত্যাবশ্যক নয়। শুধুমাত্র png/jpg " +"ফাইলসমূহ প্রকল্পে প্রতিলিপি/কপি করুন।" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Crop empty space." -msgstr "" +msgstr "খালি স্থান ছেঁটে ফেলুন।" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Texture" -msgstr "" +msgstr "গঠনবিন্যাস" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Import Large Texture" -msgstr "" +msgstr "বৃহৎ গঠনবিন্যাস ইম্পোর্ট করুন" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Load Source Image" -msgstr "" +msgstr "উৎস হতে ছবি লোড করুন" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Slicing" -msgstr "" +msgstr "টুকরো করুন" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Inserting" -msgstr "" +msgstr "সন্নিবেশিত হচ্ছে" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Saving" -msgstr "" +msgstr "সংরক্ষিত হচ্ছে" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Couldn't save large texture:" -msgstr "" +msgstr "বৃহৎ গঠনবিন্যাস সংরক্ষণ করা সম্ভব হচ্ছে না:" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Build Atlas For:" -msgstr "" +msgstr "এটলাস/মানচিত্রাবলী নির্মাণ করুন:" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Loading Image:" -msgstr "" +msgstr "ছবি লোড করা হচ্ছে:" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Couldn't load image:" -msgstr "" +msgstr "ছবি লোড করা সম্ভব হচ্ছে না:" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Converting Images" -msgstr "" +msgstr "ছবিসমূহ রূপান্তর করা হচ্ছে" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Cropping Images" -msgstr "" +msgstr "ছবিসমূহ ছাঁটা হচ্ছে" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Blitting Images" -msgstr "" +msgstr "ছবিসমূহ ব্লিটিং (Blitting) করা হচ্ছে" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Couldn't save atlas image:" -msgstr "" +msgstr "এটলাস/মানচিত্রাবলীর ছবি সংরক্ষণ করা সম্ভব হচ্ছে না:" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Couldn't save converted texture:" -msgstr "" +msgstr "রূপান্তরিত গঠনবিন্যাস সংরক্ষণ করা সম্ভব হচ্ছে না:" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Invalid source!" -msgstr "" +msgstr "অকার্যকর উৎস!" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Invalid translation source!" -msgstr "" +msgstr "অকার্যকর অনুবাদের উৎস!" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Column" -msgstr "" +msgstr "কলাম" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp #: tools/editor/script_create_dialog.cpp msgid "Language" -msgstr "" +msgstr "ভাষা" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "No items to import!" -msgstr "" +msgstr "ইম্পোর্ট করার মতো কোনো বস্তু নেই!" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "No target path!" -msgstr "" +msgstr "কোনো উদ্দেশ্যিত পথ নেই!" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Import Translations" -msgstr "" +msgstr "অনুবাদসমূহ ইম্পোর্ট করুন" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Couldn't import!" -msgstr "" +msgstr "ইম্পোর্ট করা সম্ভব হচ্ছে না!" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Import Translation" -msgstr "" +msgstr "অনুবাদ ইম্পোর্ট করুন" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Source CSV:" -msgstr "" +msgstr "CSV-এর উৎস:" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Ignore First Row" -msgstr "" +msgstr "প্রথম সারি অগ্রাহ্য করুন" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Compress" -msgstr "" +msgstr "সঙ্কোচন করুন" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Add to Project (engine.cfg)" -msgstr "" +msgstr "প্রকল্পে সংযুক্ত করুন (engine.cfg)" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Import Languages:" -msgstr "" +msgstr "ভাষাসমূহ ইম্পোর্ট করুন:" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Translation" -msgstr "" +msgstr "অনুবাদ" #: tools/editor/multi_node_edit.cpp msgid "MultiNode Set" -msgstr "" +msgstr "মাল্টি-নোড স্থাপন করুন" #: tools/editor/node_dock.cpp msgid "Groups" -msgstr "" +msgstr "দলসমূহ" #: tools/editor/node_dock.cpp msgid "Select a Node to edit Signals and Groups." -msgstr "" +msgstr "সিগন্যাল-সমূহ এবং দলসমূহ সম্পাদন করতে একটি নোড নির্বাচন করুন।" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Toggle Autoplay" -msgstr "" +msgstr "স্বয়ংক্রিয়ভাবে চালানো টগল করুন" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "New Animation Name:" -msgstr "" +msgstr "নতুন অ্যানিমেশনের নাম:" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "New Anim" -msgstr "" +msgstr "নতুন অ্যানিমেশন" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Change Animation Name:" -msgstr "" +msgstr "অ্যানিমেশনের নাম পরিবর্তন করুন:" #: tools/editor/plugins/animation_player_editor_plugin.cpp #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Remove Animation" -msgstr "" +msgstr "অ্যানিমেশন অপসারণ করুন" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "ERROR: Invalid animation name!" -msgstr "" +msgstr "ভুল: অগ্রহনযোগ্য অ্যানিমেশনের নাম!" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "ERROR: Animation name already exists!" -msgstr "" +msgstr "ভুল: অ্যানিমেশনের নাম ইতিমধ্যেই বিদ্যমান!" #: tools/editor/plugins/animation_player_editor_plugin.cpp #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Rename Animation" -msgstr "" +msgstr "অ্যানিমেশন পুনঃনামকরণ করুন" #: tools/editor/plugins/animation_player_editor_plugin.cpp #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Add Animation" -msgstr "" +msgstr "অ্যানিমেশন যুক্ত করুন" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Blend Next Changed" -msgstr "" +msgstr "পরবর্তী পরিবর্তনের সাথে ব্লেন্ড করুন" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Change Blend Time" -msgstr "" +msgstr "ব্লেন্ড-এর সময় পরিবর্তন করুন" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Load Animation" -msgstr "" +msgstr "অ্যানিমেশন লোড করুন" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Duplicate Animation" -msgstr "" +msgstr "অ্যানিমেশন প্রতিলিপি করুন" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "ERROR: No animation to copy!" -msgstr "" +msgstr "ভুল: প্রতিলিপি করার মতো কোনো অ্যানিমেশন নেই!" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "ERROR: No animation resource on clipboard!" -msgstr "" +msgstr "ভুল: ক্লীপবোর্ডে অ্যানিমেশনের কোনো রিসোর্স নেই!" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Pasted Animation" -msgstr "" +msgstr "প্রতিলিপিত অ্যানিমেশন" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Paste Animation" -msgstr "" +msgstr "অ্যানিমেশন প্রতিলেপন করুন" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "ERROR: No animation to edit!" -msgstr "" +msgstr "ভুল: সম্পাদন করার মতো কোনো অ্যানিমেশন নেই!" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Play selected animation backwards from current pos. (A)" -msgstr "" +msgstr "নির্বাচিত অ্যানিমেশনটি বর্তমান স্থান হতে পিছনের দিকে চালান। (A)" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Play selected animation backwards from end. (Shift+A)" -msgstr "" +msgstr "নির্বাচিত অ্যানিমেশনটি শেষ হতে পিছনের দিকে চালান। (Shift+A)" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Stop animation playback. (S)" -msgstr "" +msgstr "অ্যানিমেশনের চালনা বন্ধ করুন। (S)" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Play selected animation from start. (Shift+D)" -msgstr "" +msgstr "নির্বাচিত অ্যানিমেশনটি শুরু হতে চালান। (Shift+D)" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Play selected animation from current pos. (D)" -msgstr "" +msgstr "নির্বাচিত অ্যানিমেশনটি বর্তমান স্থান হতে চালান। (D)" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Animation position (in seconds)." -msgstr "" +msgstr "অ্যানিমেশনের স্থান (সেকেন্ডে)।" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Scale animation playback globally for the node." -msgstr "" +msgstr "নোডের অ্যানিমেশন চালনার স্কেল/মাপ সার্বজনীনভাবে পরিবর্তন করুন।" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Create new animation in player." -msgstr "" +msgstr "প্লেয়ারে নতুন অ্যানিমেশন তৈরি করুন।" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Load animation from disk." -msgstr "" +msgstr "ডিস্ক হতে অ্যানিমেশন লোড করুন।" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Load an animation from disk." -msgstr "" +msgstr "ডিস্ক হতে একটি অ্যানিমেশন লোড করুন।" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Save the current animation" -msgstr "" +msgstr "বর্তমান অ্যানিমেশন সংরক্ষণ করুন" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Save As" -msgstr "" +msgstr "এইরূপে সংরক্ষণ করুন" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Display list of animations in player." -msgstr "" +msgstr "প্লেয়ারে অ্যানিমেশনসমূহের তালিকা দেখান।" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Autoplay on Load" -msgstr "" +msgstr "লোডের পরেই স্বয়ংক্রিয়ভাবে চালান্" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Edit Target Blend Times" -msgstr "" +msgstr "উদ্দেশ্যিত ব্লেন্ড-এর সময় সম্পাদন করুন" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Animation Tools" -msgstr "" +msgstr "অ্যানিমেশনের সরঞ্জামসমূহ" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Copy Animation" -msgstr "" +msgstr "অ্যানিমেশন প্রতিলিপি করুন" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Create New Animation" -msgstr "" +msgstr "নতুন অ্যানিমেশন তৈরি করুন" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Animation Name:" -msgstr "" +msgstr "অ্যানিমেশনের নাম:" #: tools/editor/plugins/animation_player_editor_plugin.cpp #: tools/editor/plugins/resource_preloader_editor_plugin.cpp @@ -3492,277 +3561,278 @@ msgstr "" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp #: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Error!" -msgstr "" +msgstr "ভুল/সমস্যা!" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Blend Times:" -msgstr "" +msgstr "ব্লেন্ড-এর সময়সমূহ:" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Next (Auto Queue):" -msgstr "" +msgstr "পরবর্তী (স্বয়ংক্রিয়ভাবে সারিবদ্ধ করুন):" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Cross-Animation Blend Times" -msgstr "" +msgstr "আন্ত-অ্যানিমেশন ব্লেন্ড সময়" #: tools/editor/plugins/animation_player_editor_plugin.cpp #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Animation" -msgstr "" +msgstr "অ্যানিমেশন" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "New name:" -msgstr "" +msgstr "নতুন নাম:" #: tools/editor/plugins/animation_tree_editor_plugin.cpp #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Scale:" -msgstr "" +msgstr "স্কেল/মাপ:" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Fade In (s):" -msgstr "" +msgstr "অন্তঃস্থ ফেড/বিলীন (সেঃ):" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Fade Out (s):" -msgstr "" +msgstr "বহিঃস্থ ফেড/বিলীন (সেঃ):" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Blend" -msgstr "" +msgstr "ব্লেন্ড/মিশ্রণ" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Mix" -msgstr "" +msgstr "মিশ্রিত করুন" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Auto Restart:" -msgstr "" +msgstr "স্বয়ংক্রিয়ভাবে পুনরারম্ভ করুন:" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Restart (s):" -msgstr "" +msgstr "পুনরারম্ভ (সেঃ):" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Random Restart (s):" -msgstr "" +msgstr "যথেচ্ছ পুনরারম্ভ (সেঃ):" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Start!" -msgstr "" +msgstr "আরম্ভ!" #: tools/editor/plugins/animation_tree_editor_plugin.cpp #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Amount:" -msgstr "" +msgstr "পরিমাণ:" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Blend:" -msgstr "" +msgstr "ব্লেন্ড/মিশ্রণ:" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Blend 0:" -msgstr "" +msgstr "ব্লেন্ড/মিশ্রণ ০:" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Blend 1:" -msgstr "" +msgstr "ব্লেন্ড/মিশ্রণ ১:" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "X-Fade Time (s):" -msgstr "" +msgstr "X-ফেড/বিলীন সময় (সেঃ):" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Current:" -msgstr "" +msgstr "বর্তমান:" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Add Input" -msgstr "" +msgstr "ইনপুট যোগ করুন" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Clear Auto-Advance" -msgstr "" +msgstr "স্বয়ংক্রিয়-অগ্রগতি পরিষ্কার করুন" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Set Auto-Advance" -msgstr "" +msgstr "স্বয়ংক্রিয়-অগ্রগতি স্থাপন করুন" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Delete Input" -msgstr "" +msgstr "ইনপুট অপসারণ করুন" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Rename" -msgstr "" +msgstr "পুনঃনামকরণ করুন" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Animation tree is valid." -msgstr "" +msgstr "অ্যানিমেশনের তালিকাটি কার্যকর।" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Animation tree is invalid." -msgstr "" +msgstr "অ্যানিমেশনের তালিকাটি অকার্যকর।" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Animation Node" -msgstr "" +msgstr "অ্যানিমেশনের নোড" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "OneShot Node" -msgstr "" +msgstr "ওয়ান-শট নোড" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Mix Node" -msgstr "" +msgstr "মিশ্র নোড" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Blend2 Node" -msgstr "" +msgstr "ব্লেন্ড২ নোড" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Blend3 Node" -msgstr "" +msgstr "ব্লেন্ড৩ নোড" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Blend4 Node" -msgstr "" +msgstr "ব্লেন্ড৪ নোড" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "TimeScale Node" -msgstr "" +msgstr "টাইম-স্কেল নোড" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "TimeSeek Node" -msgstr "" +msgstr "টাইম-সীক্ নোড" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Transition Node" -msgstr "" +msgstr "ট্র্যানজিশন নোড" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Import Animations.." -msgstr "" +msgstr "অ্যানিমেশনসমূহ ইম্পোর্ট করুন.." #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Edit Node Filters" -msgstr "" +msgstr "নোড ফিল্টারসমূহ সম্পাদন করুন" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Filters.." -msgstr "" +msgstr "ফিল্টারসমূহ.." #: tools/editor/plugins/baked_light_baker.cpp msgid "Parsing %d Triangles:" -msgstr "" +msgstr "%d টি ত্রিভুজ বিশ্লেষণ করা হচ্ছে:" #: tools/editor/plugins/baked_light_baker.cpp msgid "Triangle #" -msgstr "" +msgstr "ত্রিভুজ #" #: tools/editor/plugins/baked_light_baker.cpp msgid "Light Baker Setup:" -msgstr "" +msgstr "লাইট্ সিদ্ধ/বেক্-এর সেটআপ:" #: tools/editor/plugins/baked_light_baker.cpp msgid "Parsing Geometry" -msgstr "" +msgstr "জ্যামিতিক-আকার বিশ্লেষণ করা হচ্ছে" #: tools/editor/plugins/baked_light_baker.cpp msgid "Fixing Lights" -msgstr "" +msgstr "লাইট্সমূহ ঠিক করা হচ্ছে" #: tools/editor/plugins/baked_light_baker.cpp msgid "Making BVH" -msgstr "" +msgstr "BVH তৈরি করা হচ্ছে" #: tools/editor/plugins/baked_light_baker.cpp msgid "Creating Light Octree" -msgstr "" +msgstr "লাইটের ওকট্রী (octree) তৈরি করা হচ্ছে" #: tools/editor/plugins/baked_light_baker.cpp msgid "Creating Octree Texture" -msgstr "" +msgstr "ওকট্রী (octree) গঠনবিন্যাস তৈরি করা হচ্ছে" #: tools/editor/plugins/baked_light_baker.cpp msgid "Transfer to Lightmaps:" -msgstr "" +msgstr "লাইট্ম্যাপে হস্তান্তর করুন:" #: tools/editor/plugins/baked_light_baker.cpp msgid "Allocating Texture #" -msgstr "" +msgstr "গঠনবিন্যাস বণ্টিত হচ্ছে #" #: tools/editor/plugins/baked_light_baker.cpp msgid "Baking Triangle #" -msgstr "" +msgstr "ত্রিভুজ সিদ্ধ/বেক্ করা হচ্ছে #" #: tools/editor/plugins/baked_light_baker.cpp msgid "Post-Processing Texture #" -msgstr "" +msgstr "গঠনবিন্যাসের প্রক্রিয়া-পরবর্তী প্রক্রিয়াকরণ #" #: tools/editor/plugins/baked_light_editor_plugin.cpp msgid "Bake!" -msgstr "" +msgstr "সিদ্ধ/বেক্!" #: tools/editor/plugins/baked_light_editor_plugin.cpp msgid "Reset the lightmap octree baking process (start over)." msgstr "" +"লাইট্ম্যাপ ওকট্রীর (octree) সিদ্ধ/বেক্-এর প্রক্রিয়াকরণ পুন:স্থাপন করুন (পুনরারম্ভ)।" #: tools/editor/plugins/camera_editor_plugin.cpp #: tools/editor/plugins/sample_library_editor_plugin.cpp msgid "Preview" -msgstr "" +msgstr "প্রিভিউ" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Configure Snap" -msgstr "" +msgstr "স্ন্যাপ কনফিগার করুন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Grid Offset:" -msgstr "" +msgstr "গ্রিডের অফসেট/ভারসাম্য:" #: tools/editor/plugins/canvas_item_editor_plugin.cpp #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Grid Step:" -msgstr "" +msgstr "গ্রিডের পদক্ষেপ:" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Rotation Offset:" -msgstr "" +msgstr "ঘূর্ণায়নের অফসেট/ভারসাম্য:" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Rotation Step:" -msgstr "" +msgstr "ঘূর্ণায়নের পদক্ষেপ:" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Move Pivot" -msgstr "" +msgstr "কেন্দ্র স্থানান্তর করুন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Move Action" -msgstr "" +msgstr "প্রক্রিয়া স্থানান্তর করুন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Edit IK Chain" -msgstr "" +msgstr "IK চেইন সম্পাদন করুন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Edit CanvasItem" -msgstr "" +msgstr "CanvasItem সম্পাদন করুন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Change Anchors" -msgstr "" +msgstr "অ্যাংকরসমূহ পরিবর্তন করুন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Zoom (%):" -msgstr "" +msgstr "জুম্ (%):" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Paste Pose" -msgstr "" +msgstr "ভঙ্গি প্রতিলেপন করুন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Select Mode" @@ -3770,19 +3840,19 @@ msgstr "মোড (Mode) বাছাই করুন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Drag: Rotate" -msgstr "" +msgstr "টান: ঘূর্ণন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Alt+Drag: Move" -msgstr "" +msgstr "অল্টার কী + টান: স্থানান্তর" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Press 'v' to Change Pivot, 'Shift+v' to Drag Pivot (while moving)." -msgstr "" +msgstr "কেন্দ্র পরিবর্তন করতে 'v' চাপুন, কেন্দ্র টানতে 'Shift+v' চাপুন (যখন সরাচ্ছেন)।" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Alt+RMB: Depth list selection" -msgstr "" +msgstr "অল্টার কী + মাউসের ডান বোতাম: গভীর তালিকায় নির্বাচন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Move Mode" @@ -3790,7 +3860,7 @@ msgstr "মোড (Mode) সরান" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Rotate Mode" -msgstr "" +msgstr "ঘূর্ণায়ন মোড" #: tools/editor/plugins/canvas_item_editor_plugin.cpp #: tools/editor/plugins/spatial_editor_plugin.cpp @@ -3798,145 +3868,192 @@ msgid "" "Show a list of all objects at the position clicked\n" "(same as Alt+RMB in select mode)." msgstr "" +"ক্লিক-কৃত স্থানে সকল বস্তুর একটি তালিকা দেখুন\n" +"(ঠিক যেমন সিলেক্ট মোডে অল্টার কী (Alt) + মাউসের ডান বোতাম (RMB))।" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Click to change object's rotation pivot." -msgstr "" +msgstr "বস্তুর ঘূর্ণায়ন কেন্দ্র পরিবর্তন করতে ক্লিক করুন।" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Pan Mode" -msgstr "" +msgstr "প্যান মোড" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Lock the selected object in place (can't be moved)." -msgstr "" +msgstr "নির্বাচিত বস্তুটিকে এই স্থানে আটকিয়ে রাখুন (সরানো সম্ভব হবেনা)।" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Unlock the selected object (can be moved)." -msgstr "" +msgstr "নির্বাচিত বস্তুটিকে মুক্ত করুন (সরানো সম্ভব হবে)।" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Makes sure the object's children are not selectable." -msgstr "" +msgstr "বস্তুর অন্তর্ভুক্ত-সমূহ যাতে নির্বাচনযোগ্য না হয় তা নিশ্চিত করে।" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Restores the object's children's ability to be selected." -msgstr "" +msgstr "বস্তুর অন্তর্ভুক্ত-সমূহের নির্বাচনযোগ্যতা পুনরায় ফিরিয়ে আনে।" #: tools/editor/plugins/canvas_item_editor_plugin.cpp #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Use Snap" -msgstr "" +msgstr "স্ন্যাপ ব্যবহার করুন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Show Grid" -msgstr "" +msgstr "গ্রিড দেখান" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" -msgstr "" +msgstr "ঘূর্ণন স্ন্যাপ ব্যবহার করুন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Snap Relative" -msgstr "" +msgstr "আপেক্ষিক স্ন্যাপ" #: tools/editor/plugins/canvas_item_editor_plugin.cpp #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Configure Snap.." -msgstr "" +msgstr "স্ন্যাপ কনফিগার করুন.." #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Pixel Snap" -msgstr "" +msgstr "পিক্সেল স্ন্যাপ ব্যবহার করুন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Expand to Parent" -msgstr "" +msgstr "ধারক/বাহক পর্যন্ত বিস্তৃত করুন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Skeleton.." -msgstr "" +msgstr "স্কেলেটন/কাঠাম.." #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Make Bones" -msgstr "" +msgstr "বোন্/হাড় তৈরি করুন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Clear Bones" -msgstr "" +msgstr "বোন্/হাড় পরিষ্কার করুন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Show Bones" -msgstr "" +msgstr "বোন্/হাড় দেখান" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Make IK Chain" -msgstr "" +msgstr "IK চেইন তৈরি করুন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Clear IK Chain" -msgstr "" +msgstr "IK চেইন পরিষ্কার করুন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "View" -msgstr "" +msgstr "দৃশ্য/পরিদর্শন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Zoom Reset" -msgstr "" +msgstr "জুম্ পুন:স্থাপন করুন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Zoom Set.." -msgstr "" +msgstr "জুম্ নির্ধারণ করুন.." #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Center Selection" -msgstr "" +msgstr "নির্বাচনকে কেন্দ্রীভূত করুন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Frame Selection" -msgstr "" +msgstr "নির্বাচনকে ফ্রেমভূক্ত করুন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Anchor" -msgstr "" +msgstr "অ্যাংকর" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Insert Keys" -msgstr "" +msgstr "চাবিসমূহ সন্নিবেশ করুন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Insert Key" -msgstr "" +msgstr "চাবি সন্নিবেশ করুন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Insert Key (Existing Tracks)" -msgstr "" +msgstr "চাবি সন্নিবেশ করুন (বিদ্যমান ট্র্যাক/পথসমূহ)" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Copy Pose" -msgstr "" +msgstr "ভঙ্গি প্রতিলিপি করুন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Clear Pose" -msgstr "" +msgstr "ভঙ্গি পরিষ্কার করুন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Set a Value" -msgstr "" +msgstr "একটি মান নির্ধারণ করুন" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Snap (Pixels):" +msgstr "স্ন্যাপ (পিক্সেলসমূহ):" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "%s সংযুক্ত করুন" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "%s সংযুক্ত হচ্ছে..." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "নোড তৈরি করুন" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "%s হতে দৃশ্য ইনস্ট্যান্স করাতে সমস্যা হয়েছে" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "ঠিক আছে :(" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "ইনস্ট্যান্স করার জন্য প্রয়োজনীয় ধারক উপস্থিত নেই।" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "এই কাজটি করার জন্য একটি একক নির্বাচিত নোড প্রয়োজন।" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Change default type" +msgstr "ডিফল্ট ধরণ পরিবর্তন করুন" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" msgstr "" +"টানুন এবং ফেলুন + শিফট কী (Shift) : সহোদর নোড সংযোজন করতে\n" +"টানুন এবং ফেলুন + অল্টার কী (Alt) : নোডের ধরণ পরিবর্তন করতে" #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Create Poly" -msgstr "" +msgstr "Poly তৈরি করুন" #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/collision_polygon_editor_plugin.cpp @@ -3945,7 +4062,7 @@ msgstr "" #: tools/editor/plugins/path_2d_editor_plugin.cpp #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Edit Poly" -msgstr "" +msgstr "Poly সম্পাদন করুন" #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/collision_polygon_editor_plugin.cpp @@ -3954,2267 +4071,2318 @@ msgstr "" #: tools/editor/plugins/path_2d_editor_plugin.cpp #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Edit Poly (Remove Point)" -msgstr "" +msgstr "Poly সম্পাদন করুন (বিন্দু অপসারণ করুন)" #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp msgid "Create a new polygon from scratch." -msgstr "" +msgstr "আরম্ভ হতে নতুন polygon তৈরি করুন।" #: tools/editor/plugins/collision_polygon_editor_plugin.cpp msgid "Create Poly3D" -msgstr "" +msgstr "Poly3D তৈরি করুন" #: tools/editor/plugins/collision_shape_2d_editor_plugin.cpp msgid "Set Handle" -msgstr "" +msgstr "হ্যান্ডেল স্থাপন করুন" #: tools/editor/plugins/color_ramp_editor_plugin.cpp msgid "Add/Remove Color Ramp Point" -msgstr "" +msgstr "রঙ্গের র্যাম্প বিন্দু সংযোজন/বিয়োজন করুন" #: tools/editor/plugins/color_ramp_editor_plugin.cpp #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Modify Color Ramp" -msgstr "" +msgstr "রঙ্গের র্যাম্প পরিবর্তন করুন" #: tools/editor/plugins/cube_grid_theme_editor_plugin.cpp msgid "Creating Mesh Library" -msgstr "" +msgstr "মেস লাইব্রেরি তৈরি হচ্ছে" #: tools/editor/plugins/cube_grid_theme_editor_plugin.cpp msgid "Thumbnail.." -msgstr "" +msgstr "থাম্বনেইল.." #: tools/editor/plugins/cube_grid_theme_editor_plugin.cpp msgid "Remove item %d?" -msgstr "" +msgstr "%d টি বস্তু অপসারণ করবেন?" #: tools/editor/plugins/cube_grid_theme_editor_plugin.cpp #: tools/editor/plugins/theme_editor_plugin.cpp #: tools/editor/plugins/tile_set_editor_plugin.cpp msgid "Add Item" -msgstr "" +msgstr "বস্তু যোগ করুন" #: tools/editor/plugins/cube_grid_theme_editor_plugin.cpp msgid "Remove Selected Item" -msgstr "" +msgstr "নির্বাচিত বস্তুটি অপসারণ করুন" #: tools/editor/plugins/cube_grid_theme_editor_plugin.cpp msgid "Import from Scene" -msgstr "" +msgstr "দৃশ্য হতে ইম্পোর্ট করুন" #: tools/editor/plugins/cube_grid_theme_editor_plugin.cpp msgid "Update from Scene" -msgstr "" +msgstr "দৃশ্য হতে হালনাগাদ করুন" #: tools/editor/plugins/item_list_editor_plugin.cpp msgid "Item %d" -msgstr "" +msgstr "বস্তু %d" #: tools/editor/plugins/item_list_editor_plugin.cpp msgid "Items" -msgstr "" +msgstr "বস্তুসমূহ" #: tools/editor/plugins/item_list_editor_plugin.cpp msgid "Item List Editor" -msgstr "" +msgstr "বস্তুর তালিকা এডিটর" #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp msgid "Create Occluder Polygon" -msgstr "" +msgstr "অকলুডার (occluder) পলিগন তৈরি করুন" #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp msgid "Edit existing polygon:" -msgstr "" +msgstr "বিদ্যমান পলিগন সম্পাদন করুন:" #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp msgid "LMB: Move Point." -msgstr "" +msgstr "মাউসের বাম বোতাম: বিন্দু সরান।" #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp msgid "Ctrl+LMB: Split Segment." -msgstr "" +msgstr "কন্ট্রোল + মাউসের বাম বোতাম: অংশ বিভক্ত করুন।" #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp msgid "RMB: Erase Point." -msgstr "" +msgstr "মাউসের ডান বোতাম: বিন্দু মুছে ফেলুন।" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Mesh is empty!" -msgstr "" +msgstr "মেসটি খালি!" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Static Trimesh Body" -msgstr "" +msgstr "স্থিত-ট্রাইমেস বডি গঠন করুন" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Static Convex Body" -msgstr "" +msgstr "স্থিত-কনভেক্স বডি গঠন করুন" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "This doesn't work on scene root!" -msgstr "" +msgstr "দৃশ্যের গোড়ায় এটি কাজ করেনা!" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Trimesh Shape" -msgstr "" +msgstr "ট্রাইমেস আকার তৈরি করুন" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Convex Shape" -msgstr "" +msgstr "কনভেক্স আকার তৈরি করুন" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Navigation Mesh" -msgstr "" +msgstr "Navigation Mesh তৈরি করুন" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "MeshInstance lacks a Mesh!" -msgstr "" +msgstr "MeshInstance-এ Mesh নেই!" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Mesh has not surface to create outlines from!" -msgstr "" +msgstr "প্রান্তরেখা তৈরি করার জন্য প্রয়োজনীয় Mesh এর কোনো পৃষ্ঠতল নেই!" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Could not create outline!" -msgstr "" +msgstr "প্রান্তরেখা তৈরি করা সম্ভব হয়নি!" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Outline" -msgstr "" +msgstr "প্রান্তরেখা তৈরি করুন" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Trimesh Static Body" -msgstr "" +msgstr "স্থিত-ট্রাইমেস বডি তৈরি করুন" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Convex Static Body" -msgstr "" +msgstr "স্থিত-কনভেক্স বডি তৈরি করুন" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Trimesh Collision Sibling" -msgstr "" +msgstr "ট্রাইমেস কলিশ়ন সহোদর তৈরি করুন" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Convex Collision Sibling" -msgstr "" +msgstr "কনভেক্স কলিশ়ন সহোদর তৈরি করুন" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Outline Mesh.." -msgstr "" +msgstr "প্রান্তরেখা মেস তৈরি করুন.." #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Outline Mesh" -msgstr "" +msgstr "প্রান্তরেখা মেস তৈরি করুন" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Outline Size:" -msgstr "" +msgstr "প্রান্তরেখার আকার:" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "No mesh source specified (and no MultiMesh set in node)." -msgstr "" +msgstr "মেসের কোনো উৎস নির্দিষ্ট করা নেই (এবং নোডে কোনো মাল্টিমেস স্থাপন করা নেই)।" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "No mesh source specified (and MultiMesh contains no Mesh)." -msgstr "" +msgstr "মেসের কোনো উৎস নির্দিষ্ট করা নেই (এবং মাল্টিমেসে কোনো মেস নেই)।" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Mesh source is invalid (invalid path)." -msgstr "" +msgstr "মেসের উৎস আকার্যকর (আকার্যকর পথ)।" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Mesh source is invalid (not a MeshInstance)." -msgstr "" +msgstr "Mesh-এর উৎস অগ্রহণযোগ্য (MeshInstance নয়)।" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Mesh source is invalid (contains no Mesh resource)." -msgstr "" +msgstr "Mesh-এর উৎস অগ্রহণযোগ্য (কোনো Mesh রিসোর্স নেই)।" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "No surface source specified." -msgstr "" +msgstr "কোনো পৃষ্ঠতলের উৎস নির্দিষ্ট করা নেই।" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Surface source is invalid (invalid path)." -msgstr "" +msgstr "পৃষ্ঠতলের উৎস অকার্যকর (অকার্যকর পথ)।" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Surface source is invalid (no geometry)." -msgstr "" +msgstr "পৃষ্ঠতলের উৎস অকার্যকর (কোনো জ্যামিতিক আকার নেই)।" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Surface source is invalid (no faces)." -msgstr "" +msgstr "পৃষ্ঠতলের উৎস অকার্যকর (কোনো ফোকাস নেই)।" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Parent has no solid faces to populate." -msgstr "" +msgstr "পপুলেট করার জন্য ধারকের কোনো নিরেট পৃষ্ঠ নেই।" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Couldn't map area." -msgstr "" +msgstr "এলাকার নকশা করা সম্ভব হয়নি।" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Select a Source Mesh:" -msgstr "" +msgstr "Mesh-এর একটি উৎস নির্বাচন করুন:" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Select a Target Surface:" -msgstr "" +msgstr "একটি উদ্দেশ্যিত পৃষ্ঠতল নির্বাচন করুন:" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Populate Surface" -msgstr "" +msgstr "পৃষ্ঠতল পপুলেট করুন" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Populate MultiMesh" -msgstr "" +msgstr "MultiMesh পপুলেট করুন" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Target Surface:" -msgstr "" +msgstr "উদ্দেশ্যিত পৃষ্ঠতল:" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Source Mesh:" -msgstr "" +msgstr "উৎস Mesh:" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "X-Axis" -msgstr "" +msgstr "X-অক্ষ" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Y-Axis" -msgstr "" +msgstr "Y-অক্ষ" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Z-Axis" -msgstr "" +msgstr "Z-অক্ষ" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Mesh Up Axis:" -msgstr "" +msgstr "অক্ষতে Mesh দিন:" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Random Rotation:" -msgstr "" +msgstr "যথেচ্ছ ঘূর্ণায়ন:" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Random Tilt:" -msgstr "" +msgstr "যথেচ্ছ ঢাল:" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Random Scale:" -msgstr "" +msgstr "যথেচ্ছ মাপ:" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Populate" -msgstr "" +msgstr "পপুলেট" #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp msgid "Create Navigation Polygon" -msgstr "" +msgstr "Navigation Polygon তৈরি করুন" #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp msgid "Remove Poly And Point" -msgstr "" +msgstr "পলি এবং বিন্দু অপসারণ করুন" #: tools/editor/plugins/particles_2d_editor_plugin.cpp msgid "Error loading image:" -msgstr "" +msgstr "ছবি লোডে সমস্যা হয়েছে:" #: tools/editor/plugins/particles_2d_editor_plugin.cpp msgid "No pixels with transparency > 128 in image.." -msgstr "" +msgstr "স্বচ্ছতাসহ কোনো পিক্সেল নেই > ছবিতে ১২৮.." #: tools/editor/plugins/particles_2d_editor_plugin.cpp msgid "Set Emission Mask" -msgstr "" +msgstr "Emission Mask স্থাপন করুন" #: tools/editor/plugins/particles_2d_editor_plugin.cpp msgid "Clear Emission Mask" -msgstr "" +msgstr "Emission Mask পরিস্কার করুন" #: tools/editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" -msgstr "" +msgstr "Emission Mask লোড করুন" #: tools/editor/plugins/particles_2d_editor_plugin.cpp msgid "Generated Point Count:" -msgstr "" +msgstr "উৎপাদিত বিন্দুর সংখ্যা:" #: tools/editor/plugins/particles_editor_plugin.cpp msgid "Node does not contain geometry." -msgstr "" +msgstr "নোডে কোনো জ্যামিতিক আকার নেই।" #: tools/editor/plugins/particles_editor_plugin.cpp msgid "Node does not contain geometry (faces)." -msgstr "" +msgstr "নোডে কোনো জ্যামিতিক আকার নেই (পৃষ্ঠ)।" #: tools/editor/plugins/particles_editor_plugin.cpp msgid "Faces contain no area!" -msgstr "" +msgstr "পৃষ্ঠসমূহ কোনো আকার নেই!" #: tools/editor/plugins/particles_editor_plugin.cpp msgid "No faces!" -msgstr "" +msgstr "কোনো পৃষ্ঠ নেই!" #: tools/editor/plugins/particles_editor_plugin.cpp msgid "Generate AABB" -msgstr "" +msgstr "AABB উৎপন্ন করুন" #: tools/editor/plugins/particles_editor_plugin.cpp msgid "Create Emitter From Mesh" -msgstr "" +msgstr "Mesh হতে Emitter তৈরি করুন" #: tools/editor/plugins/particles_editor_plugin.cpp msgid "Create Emitter From Node" -msgstr "" +msgstr "Node হতে Emitter তৈরি করুন" #: tools/editor/plugins/particles_editor_plugin.cpp msgid "Clear Emitter" -msgstr "" +msgstr "Emitter পরিস্কার করুন" #: tools/editor/plugins/particles_editor_plugin.cpp msgid "Create Emitter" -msgstr "" +msgstr "Emitter তৈরি করুন" #: tools/editor/plugins/particles_editor_plugin.cpp msgid "Emission Positions:" -msgstr "" +msgstr "Emission-এর স্থানসমূহ:" #: tools/editor/plugins/particles_editor_plugin.cpp msgid "Emission Fill:" -msgstr "" +msgstr "Emission পূরণ:" #: tools/editor/plugins/particles_editor_plugin.cpp msgid "Surface" -msgstr "" +msgstr "পৃষ্ঠতল" #: tools/editor/plugins/particles_editor_plugin.cpp msgid "Volume" -msgstr "" +msgstr "আয়তন" #: tools/editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" -msgstr "" +msgstr "বক্ররেখা হতে বিন্দু অপসারণ করুন" #: tools/editor/plugins/path_2d_editor_plugin.cpp #: tools/editor/plugins/path_editor_plugin.cpp msgid "Add Point to Curve" -msgstr "" +msgstr "বক্ররেখায় বিন্দু যোগ করুন" #: tools/editor/plugins/path_2d_editor_plugin.cpp msgid "Move Point in Curve" -msgstr "" +msgstr "বক্ররেখায় বিন্দু সরান" #: tools/editor/plugins/path_2d_editor_plugin.cpp msgid "Move In-Control in Curve" -msgstr "" +msgstr "বক্ররেখা আন্ত-নিয়ন্ত্রণে সরান" #: tools/editor/plugins/path_2d_editor_plugin.cpp msgid "Move Out-Control in Curve" -msgstr "" +msgstr "বক্ররেখা বহিঃ-নিয়ন্ত্রণে সরান" #: tools/editor/plugins/path_2d_editor_plugin.cpp #: tools/editor/plugins/path_editor_plugin.cpp msgid "Select Points" -msgstr "" +msgstr "বিন্দুসমূহ নির্বাচন করুন" #: tools/editor/plugins/path_2d_editor_plugin.cpp #: tools/editor/plugins/path_editor_plugin.cpp msgid "Shift+Drag: Select Control Points" -msgstr "" +msgstr "শিফট + টান: নিয়ন্ত্রণ বিন্দুসমূহ নির্বাচন করুন" #: tools/editor/plugins/path_2d_editor_plugin.cpp #: tools/editor/plugins/path_editor_plugin.cpp msgid "Click: Add Point" -msgstr "" +msgstr "ক্লিক: বিন্দু যোগ করুন" #: tools/editor/plugins/path_2d_editor_plugin.cpp #: tools/editor/plugins/path_editor_plugin.cpp msgid "Right Click: Delete Point" -msgstr "" +msgstr "ডান ক্লিক: বিন্দু অপসারণ করুন" #: tools/editor/plugins/path_2d_editor_plugin.cpp msgid "Select Control Points (Shift+Drag)" -msgstr "" +msgstr "নিয়ন্ত্রণ বিন্দুসমূহ নির্বাচন করুন (শিফট + টান)" #: tools/editor/plugins/path_2d_editor_plugin.cpp #: tools/editor/plugins/path_editor_plugin.cpp msgid "Add Point (in empty space)" -msgstr "" +msgstr "বিন্দু যোগ করুন (শূন্যস্থানে)" #: tools/editor/plugins/path_2d_editor_plugin.cpp #: tools/editor/plugins/path_editor_plugin.cpp msgid "Split Segment (in curve)" -msgstr "" +msgstr "অংশ বিভক্ত করুন (বক্ররেখায়)" #: tools/editor/plugins/path_2d_editor_plugin.cpp #: tools/editor/plugins/path_editor_plugin.cpp msgid "Delete Point" -msgstr "" +msgstr "বিন্দু অপসারণ করুন" #: tools/editor/plugins/path_2d_editor_plugin.cpp #: tools/editor/plugins/path_editor_plugin.cpp msgid "Close Curve" -msgstr "" +msgstr "বক্ররেখা বন্ধ করুন" #: tools/editor/plugins/path_editor_plugin.cpp msgid "Curve Point #" -msgstr "" +msgstr "বক্ররেখার বিন্দু #" #: tools/editor/plugins/path_editor_plugin.cpp msgid "Set Curve Point Pos" -msgstr "" +msgstr "বক্ররেখার বিন্দুর স্থান নির্ধারণ করুন" #: tools/editor/plugins/path_editor_plugin.cpp msgid "Set Curve In Pos" -msgstr "" +msgstr "আন্ত-বক্ররেখার স্থান নির্ধারণ করুন" #: tools/editor/plugins/path_editor_plugin.cpp msgid "Set Curve Out Pos" -msgstr "" +msgstr "বহিঃ-বক্ররেখার স্থান নির্ধারণ করুন" #: tools/editor/plugins/path_editor_plugin.cpp msgid "Split Path" -msgstr "" +msgstr "পথ বিভক্ত করুন" #: tools/editor/plugins/path_editor_plugin.cpp msgid "Remove Path Point" -msgstr "" +msgstr "পথের বিন্দু অপসারণ করুন" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Create UV Map" -msgstr "" +msgstr "UV Map তৈরি করুন" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Transform UV Map" -msgstr "" +msgstr "UV Map রুপান্তর করুন" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Polygon 2D UV Editor" -msgstr "" +msgstr "Polygon 2D UV এডিটর" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Move Point" -msgstr "" +msgstr "বিন্দু সরান" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Ctrl: Rotate" -msgstr "" +msgstr "কন্ট্রোল বোতাম: ঘূর্ণন" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Shift: Move All" -msgstr "" +msgstr "শিফট্: সবগুলি নড়ান" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Shift+Ctrl: Scale" -msgstr "" +msgstr "শিফট্ + কন্ট্রোল: মাপ" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Move Polygon" -msgstr "" +msgstr "পলিগন সরান" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Rotate Polygon" -msgstr "" +msgstr "পলিগন ঘুরান" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Scale Polygon" -msgstr "" +msgstr "পলিগন মাপ করুন" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Polygon->UV" -msgstr "" +msgstr "পলিগন->UV" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "UV->Polygon" -msgstr "" +msgstr "UV->পলিগন" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Clear UV" -msgstr "" +msgstr "UV পরিস্কার করুন" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Snap" -msgstr "" +msgstr "স্ন্যাপ" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Enable Snap" -msgstr "" +msgstr "স্ন্যাপ সক্রিয় করুন" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Grid" -msgstr "" +msgstr "গ্রিড" #: tools/editor/plugins/resource_preloader_editor_plugin.cpp msgid "ERROR: Couldn't load resource!" -msgstr "" +msgstr "সমস্যা: রিসোর্স লোড করা সম্ভব হয়নি!" #: tools/editor/plugins/resource_preloader_editor_plugin.cpp msgid "Add Resource" -msgstr "" +msgstr "রিসোর্স যোগ করুন" #: tools/editor/plugins/resource_preloader_editor_plugin.cpp msgid "Rename Resource" -msgstr "" +msgstr "রিসোর্স পুনঃনামকরণ করুন" #: tools/editor/plugins/resource_preloader_editor_plugin.cpp #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Delete Resource" -msgstr "" +msgstr "রিসোর্স অপসারণ করুন" #: tools/editor/plugins/resource_preloader_editor_plugin.cpp msgid "Resource clipboard is empty!" -msgstr "" +msgstr "রিসোর্সের ক্লীপবোর্ড খালি!" #: tools/editor/plugins/resource_preloader_editor_plugin.cpp #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Load Resource" -msgstr "" +msgstr "রিসোর্স লোড করুন" #: tools/editor/plugins/rich_text_editor_plugin.cpp msgid "Parse BBCode" -msgstr "" +msgstr "BBCode বিশ্লেষণ করুন" #: tools/editor/plugins/sample_editor_plugin.cpp msgid "Length:" -msgstr "" +msgstr "লম্বা:" #: tools/editor/plugins/sample_library_editor_plugin.cpp msgid "Open Sample File(s)" -msgstr "" +msgstr "নমুনা ফাইল(সমূহ) খুলুন" #: tools/editor/plugins/sample_library_editor_plugin.cpp msgid "ERROR: Couldn't load sample!" -msgstr "" +msgstr "সমস্যা: নমুনা লোড করা সম্ভব হয়নি!" #: tools/editor/plugins/sample_library_editor_plugin.cpp msgid "Add Sample" -msgstr "" +msgstr "নমুনা যোগ করুন" #: tools/editor/plugins/sample_library_editor_plugin.cpp msgid "Rename Sample" -msgstr "" +msgstr "নমুনা পুনঃনামকরণ করুন" #: tools/editor/plugins/sample_library_editor_plugin.cpp msgid "Delete Sample" -msgstr "" +msgstr "নমুনা অপসারণ করুন" #: tools/editor/plugins/sample_library_editor_plugin.cpp msgid "16 Bits" -msgstr "" +msgstr "১৬ বিটস্" #: tools/editor/plugins/sample_library_editor_plugin.cpp msgid "8 Bits" -msgstr "" +msgstr "৮ বিটস্" #: tools/editor/plugins/sample_library_editor_plugin.cpp msgid "Stereo" -msgstr "" +msgstr "স্টেরিও" #: tools/editor/plugins/sample_library_editor_plugin.cpp msgid "Mono" -msgstr "" +msgstr "মনো" #: tools/editor/plugins/sample_library_editor_plugin.cpp #: tools/editor/script_editor_debugger.cpp msgid "Format" -msgstr "" +msgstr "ফরম্যাট" #: tools/editor/plugins/sample_library_editor_plugin.cpp msgid "Pitch" -msgstr "" +msgstr "পিচ্" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Error while saving theme" -msgstr "" +msgstr "থিম সংরক্ষণে সমস্যা হয়েছে" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Error saving" -msgstr "" +msgstr "সংরক্ষণে সমস্যা হয়েছে" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Error importing theme" -msgstr "" +msgstr "থিম ইম্পোর্টে সমস্যা হয়েছে" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Error importing" -msgstr "" +msgstr "ইম্পোর্টে সমস্যা হয়েছে" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Import Theme" -msgstr "" +msgstr "থিম ইম্পোর্ট করুন" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Save Theme As.." -msgstr "" +msgstr "থিম এইরূপে সংরক্ষণ করুন.." #: tools/editor/plugins/script_editor_plugin.cpp msgid "Next script" -msgstr "" +msgstr "পরবর্তী স্ক্রিপ্ট" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Previous script" -msgstr "" +msgstr "পূর্ববর্তী স্ক্রিপ্ট" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/project_export.cpp msgid "File" -msgstr "" +msgstr "ফাইল" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/property_editor.cpp msgid "New" -msgstr "" +msgstr "নতুন" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Save All" -msgstr "" +msgstr "সকল্গুলি সংরক্ষণ করুন" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Soft Reload Script" -msgstr "" +msgstr "স্বল্প-প্রভাবসহ স্ক্রিপ্ট রিলোড করুন" #: tools/editor/plugins/script_editor_plugin.cpp msgid "History Prev" -msgstr "" +msgstr "পূর্বের ইতিহাস" #: tools/editor/plugins/script_editor_plugin.cpp msgid "History Next" -msgstr "" +msgstr "পরের ইতিহাস" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Reload Theme" -msgstr "" +msgstr "থিম রিলোড করুন" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Save Theme" -msgstr "" +msgstr "থিম সংরক্ষণ করুন" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Save Theme As" -msgstr "" +msgstr "থিম এইরূপে সংরক্ষণ করুন" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Close Docs" -msgstr "" +msgstr "ডকুমেন্টসমূহ বন্ধ করুন" #: tools/editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Close All" -msgstr "সবগুলি বাছাই করুন" +msgstr "সবগুলি বন্ধ করুন" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/plugins/script_text_editor.cpp #: tools/editor/plugins/shader_editor_plugin.cpp msgid "Find.." -msgstr "" +msgstr "খুঁজুন.." #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/plugins/script_text_editor.cpp #: tools/editor/plugins/shader_editor_plugin.cpp msgid "Find Next" -msgstr "" +msgstr "পরবর্তী খুঁজুন" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Debug" -msgstr "" +msgstr "ডিবাগ" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/script_editor_debugger.cpp msgid "Step Over" -msgstr "" +msgstr "ধাপ লাফিয়ে যান" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/script_editor_debugger.cpp msgid "Step Into" -msgstr "" +msgstr "পদার্পণ করুন" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/script_editor_debugger.cpp msgid "Break" -msgstr "" +msgstr "বিরতি/ভাঙ্গন" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/script_editor_debugger.cpp msgid "Continue" -msgstr "" +msgstr "সচল" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Keep Debugger Open" -msgstr "" +msgstr "ডিবাগার খোলা রাখুন" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Window" -msgstr "" +msgstr "উইন্ডো" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Move Left" -msgstr "" +msgstr "বামে সরান" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Move Right" -msgstr "" +msgstr "ডানে সরান" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Tutorials" -msgstr "" +msgstr "টিউটোরিয়ালসমূহ" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Open https://godotengine.org at tutorials section." -msgstr "" +msgstr "টিউটোরিয়ালের স্থানে https://godotengine.org খুলুন।" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Classes" -msgstr "" +msgstr "ক্লাসসমূহ" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Search the class hierarchy." -msgstr "" +msgstr "ক্লাসের ক্রমোচ্চতা খুঁজুন।" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." -msgstr "" +msgstr "রেফারেন্সের ডকুমেন্টেশনে খুঁজুন।" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Go to previous edited document." -msgstr "" +msgstr "পূর্বের সম্পাদিত ডকুমেন্টে যান।" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Go to next edited document." -msgstr "" +msgstr "পরের সম্পাদিত ডকুমেন্টে যান।" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Create Script" -msgstr "" +msgstr "স্ক্রিপ্ট তৈরি করুন" #: tools/editor/plugins/script_editor_plugin.cpp msgid "" "The following files are newer on disk.\n" "What action should be taken?:" msgstr "" +"নিম্নোক্ত ফাইলসমূহ ডিস্কে নতুনতর।\n" +"কোন সিধান্তটি নেয়া উচিত হবে?:" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Reload" -msgstr "" +msgstr "রিলোড" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Resave" -msgstr "" +msgstr "পুনঃসংরক্ষণ" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/script_editor_debugger.cpp msgid "Debugger" -msgstr "" +msgstr "ডিবাগার" #: tools/editor/plugins/script_editor_plugin.cpp msgid "" "Built-in scripts can only be edited when the scene they belong to is loaded" -msgstr "" +msgstr "পূর্বনির্মিত স্ক্রিপ্ট শুধুমাত্র তাদের অধিকারী দৃশ্য লোড করা হলেই সম্পাদন করা যাবে" #: tools/editor/plugins/script_text_editor.cpp msgid "Pick Color" -msgstr "" +msgstr "রঙ পছন্দ করুন" #: tools/editor/plugins/script_text_editor.cpp tools/editor/scene_tree_dock.cpp msgid "Move Up" -msgstr "" +msgstr "উপরে যান" #: tools/editor/plugins/script_text_editor.cpp tools/editor/scene_tree_dock.cpp msgid "Move Down" -msgstr "" +msgstr "নীচে যান" #: tools/editor/plugins/script_text_editor.cpp msgid "Indent Left" -msgstr "" +msgstr "বামে মাত্রা দিন" #: tools/editor/plugins/script_text_editor.cpp msgid "Indent Right" -msgstr "" +msgstr "ডানে মাত্রা দিন" #: tools/editor/plugins/script_text_editor.cpp msgid "Toggle Comment" -msgstr "" +msgstr "কমেন্ট টগল করুন" #: tools/editor/plugins/script_text_editor.cpp msgid "Clone Down" -msgstr "" +msgstr "ক্লোন করে নীচে নিন" #: tools/editor/plugins/script_text_editor.cpp msgid "Complete Symbol" -msgstr "" +msgstr "সিম্বল সম্পূর্ণ করুন" #: tools/editor/plugins/script_text_editor.cpp msgid "Trim Trailing Whitespace" -msgstr "" +msgstr "শেষের হোয়াইটস্পেস ছেঁটে ফেলুন" #: tools/editor/plugins/script_text_editor.cpp msgid "Auto Indent" -msgstr "" +msgstr "স্বয়ংক্রিয়ভাবে মাত্রা দিন" #: tools/editor/plugins/script_text_editor.cpp msgid "Remove All Breakpoints" -msgstr "" +msgstr "সকল বিরতি-বিন্দু-সমূহ অপসারণ করুন" #: tools/editor/plugins/script_text_editor.cpp msgid "Goto Next Breakpoint" -msgstr "" +msgstr "পরের বিরতিবিন্দুতে যান" #: tools/editor/plugins/script_text_editor.cpp msgid "Goto Previous Breakpoint" -msgstr "" +msgstr "পূর্বের বিরতিবিন্দুতে যান" #: tools/editor/plugins/script_text_editor.cpp #: tools/editor/plugins/shader_editor_plugin.cpp msgid "Find Previous" -msgstr "" +msgstr "পূর্বে খুঁজুন" #: tools/editor/plugins/script_text_editor.cpp #: tools/editor/plugins/shader_editor_plugin.cpp msgid "Replace.." -msgstr "" +msgstr "প্রতিস্থাপন.." #: tools/editor/plugins/script_text_editor.cpp msgid "Goto Function.." -msgstr "" +msgstr "ফাংশনে যান.." #: tools/editor/plugins/script_text_editor.cpp #: tools/editor/plugins/shader_editor_plugin.cpp msgid "Goto Line.." -msgstr "" +msgstr "লাইনে যান.." #: tools/editor/plugins/script_text_editor.cpp msgid "Contextual Help" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "" +msgstr "প্রাসঙ্গিক সাহায্য" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" -msgstr "" +msgstr "স্কেলার ধ্রুবক পরিবর্তন করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Vec Constant" -msgstr "" +msgstr "ভেক্টর ধ্রুবক পরিবর্তন করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change RGB Constant" -msgstr "" +msgstr "RGB ধ্রুবক পরিবর্তন করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Operator" -msgstr "" +msgstr "স্কেলার অপারেটর পরিবর্তন করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Vec Operator" -msgstr "" +msgstr "ভেক্টর অপারেটর পরিবর্তন করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Vec Scalar Operator" -msgstr "" +msgstr "ভেক্টর স্কেলার অপারেটর পরিবর্তন করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change RGB Operator" -msgstr "" +msgstr "RGB অপারেটর পরিবর্তন করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Toggle Rot Only" -msgstr "" +msgstr "শুধুমাত্র ঘূর্ণন টগল করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Function" -msgstr "" +msgstr "স্কেলার ফাংশন পরিবর্তন করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Vec Function" -msgstr "" +msgstr "ভেক্টর ফাংশন পরিবর্তন করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Uniform" -msgstr "" +msgstr "স্কেলার ইউনিফর্ম পরিবর্তন করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Vec Uniform" -msgstr "" +msgstr "ভেক্টর ইউনিফর্ম পরিবর্তন করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change RGB Uniform" -msgstr "" +msgstr "RGB ইউনিফর্ম পরিবর্তন করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Default Value" -msgstr "" +msgstr "প্রাথমিক মান পরিবর্তন করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change XForm Uniform" -msgstr "" +msgstr "XForm ইউনিফর্ম পরিবর্তন করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Texture Uniform" -msgstr "" +msgstr "টেক্সার ইউনিফর্ম পরিবর্তন করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Cubemap Uniform" -msgstr "" +msgstr "Cubemap ইউনিফর্ম পরিবর্তন করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Comment" -msgstr "" +msgstr "কমেন্ট পরিবর্তন করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Add/Remove to Color Ramp" -msgstr "" +msgstr "রঙ্গের র্যাম্পে সংযোজন/বিয়োজন করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Add/Remove to Curve Map" -msgstr "" +msgstr "Curve Map-এ সংযোজন/বিয়োজন করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Modify Curve Map" -msgstr "" +msgstr "Curve Map পরিবর্তন করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Input Name" -msgstr "" +msgstr "ইনপুট নাম পরিবর্তন করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Connect Graph Nodes" -msgstr "" +msgstr "গ্রাফের নোডসমূহ সংযুক্ত করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Disconnect Graph Nodes" -msgstr "" +msgstr "গ্রাফের নোডসমূহ বিচ্ছিন্ন করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Remove Shader Graph Node" -msgstr "" +msgstr "Shader Graph Node অপসারণ করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Move Shader Graph Node" -msgstr "" +msgstr "Shader Graph Node সরান" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Duplicate Graph Node(s)" -msgstr "" +msgstr "গ্রাফ নোড(সমূহ) প্রতিলিপি করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Delete Shader Graph Node(s)" -msgstr "" +msgstr "Shader Graph Node(s) অপসারণ করুন" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Error: Cyclic Connection Link" -msgstr "" +msgstr "সমস্যা: আবর্তনশীল সংযোগ লিঙ্ক" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Error: Missing Input Connections" -msgstr "" +msgstr "সমস্যা: ইনপুট সংযোগ নেই" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Add Shader Graph Node" -msgstr "" +msgstr "Shader Graph Node যোগ করুন" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Orthogonal" -msgstr "" +msgstr "সমকোণীয় (Orthogonal)" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Perspective" -msgstr "" +msgstr "পরিপ্রেক্ষিত (Perspective)" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Transform Aborted." -msgstr "" +msgstr "রুপান্তর নিষ্ফলা করা হয়েছে।" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "X-Axis Transform." -msgstr "" +msgstr "X-অক্ষ রুপান্তর।" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Y-Axis Transform." -msgstr "" +msgstr "Y-অক্ষ রুপান্তর।" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Z-Axis Transform." -msgstr "" +msgstr "Z-অক্ষ রুপান্তর।" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "View Plane Transform." -msgstr "" +msgstr "প্লেন-এর রুপান্তর দেখুন।" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Scaling to %s%%." -msgstr "" +msgstr "%s%% -এ মাপিত হচ্ছে।" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Rotating %s degrees." -msgstr "" +msgstr "%s ডিগ্রি ঘূর্ণিত হচ্ছে।" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View." -msgstr "" +msgstr "নিম্ন দর্শন।" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Bottom" -msgstr "" +msgstr "নিম্ন" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Top View." -msgstr "" +msgstr "শীর্ষ দর্শন।" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Top" -msgstr "" +msgstr "শীর্ষ" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Rear View." -msgstr "" +msgstr "পশ্চাৎ দর্শন।" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Rear" -msgstr "" +msgstr "পশ্চাৎ" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Front View." -msgstr "" +msgstr "সন্মুখ দর্শন।" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Front" -msgstr "" +msgstr "সন্মুখ" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Left View." -msgstr "" +msgstr "বাম দর্শন।" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Left" -msgstr "" +msgstr "বাম" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Right View." -msgstr "" +msgstr "ডান দর্শন।" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Right" -msgstr "" +msgstr "ডান" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Keying is disabled (no key inserted)." -msgstr "" +msgstr "চাবিসংযোক নিষ্ক্রিয় আছে (কোনো চাবি সংযুক্ত হয়নি)।" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Animation Key Inserted." -msgstr "" +msgstr "অ্যানিমেশনের চাবি সন্নিবেশিত হয়েছে।" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Align with view" -msgstr "" +msgstr "দর্শনের সাথে সারিবদ্ধ করুন" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Environment" -msgstr "" +msgstr "পরিবেশ (Environment)" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Audio Listener" -msgstr "" +msgstr "অডিও শ্রোতা" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Gizmos" -msgstr "" +msgstr "গিজমোস" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" -msgstr "" +msgstr "XForm এর সংলাপ" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "No scene selected to instance!" -msgstr "" +msgstr "ইন্সট্যান্স করার জন্য কোনো দৃশ্য নির্বাচন করা হয়নি!" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Instance at Cursor" -msgstr "" +msgstr "কার্সরের স্থানে ইন্সট্যান্স করুন" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Could not instance scene!" -msgstr "" +msgstr "দৃশ্য ইন্সট্যান্স করা সম্ভব হয়নি!" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Move Mode (W)" -msgstr "" +msgstr "সরানোর মোড (W)" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Rotate Mode (E)" -msgstr "" +msgstr "ঘোরানোর মোড (E)" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Scale Mode (R)" -msgstr "" +msgstr "মাপের মোড করুন (R)" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" -msgstr "" +msgstr "নিম্ন দর্শন" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Top View" -msgstr "" +msgstr "শীর্ষ দর্শন" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Rear View" -msgstr "" +msgstr "পশ্চাৎ দর্শন" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Front View" -msgstr "" +msgstr "সন্মুখ দর্শন" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Left View" -msgstr "" +msgstr "বাম দর্শন" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Right View" -msgstr "" +msgstr "ডান দর্শন" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Switch Perspective/Orthogonal view" -msgstr "" +msgstr "পরিপ্রেক্ষিত/সমকোণীয় (Perspective/Orthogonal) দর্শন পরিবর্তন করুন" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Insert Animation Key" -msgstr "" +msgstr "অ্যানিমেশনের চাবি সন্নিবেশ করুন" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Focus Origin" -msgstr "" +msgstr "অরিজিনে ফোকাস করুন" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Focus Selection" -msgstr "" +msgstr "নির্বাচনে ফোকাস করুন" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Align Selection With View" -msgstr "" +msgstr "নির্বাচনকে দর্শনের সাথে সারিবদ্ধ করুন" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Transform" -msgstr "" +msgstr "রুপান্তর" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Local Coords" -msgstr "" +msgstr "স্থানীয় স্থানাঙ্কসমূহ" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Transform Dialog.." -msgstr "" +msgstr "রুপান্তরের এর সংলাপ.." #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Use Default Light" -msgstr "" +msgstr "প্রাথমিক লাইট ব্যবহার করুন" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Use Default sRGB" -msgstr "" +msgstr "প্রাথমিক sRGB ব্যবহার করুন" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "1 Viewport" -msgstr "" +msgstr "১ টি Viewport" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "2 Viewports" -msgstr "" +msgstr "২ টি Viewports" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "2 Viewports (Alt)" -msgstr "" +msgstr "২ টি Viewports (অল্টার)" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "3 Viewports" -msgstr "" +msgstr "৩ টি Viewports" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "3 Viewports (Alt)" -msgstr "" +msgstr "৩ টি Viewports (অল্টার)" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "4 Viewports" -msgstr "" +msgstr "৪ টি Viewports" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Display Normal" -msgstr "" +msgstr "Normal প্রদর্শন" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Display Wireframe" -msgstr "" +msgstr "Wireframe প্রদর্শন" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Display Overdraw" -msgstr "" +msgstr "Overdraw প্রদর্শন" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Display Shadeless" -msgstr "" +msgstr "Shadeless প্রদর্শন" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "View Origin" -msgstr "" +msgstr "অরিজিন দেখুন" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "View Grid" -msgstr "" +msgstr "গ্রিড দেখুন" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Snap Settings" -msgstr "" +msgstr "স্ন্যাপ সেটিংস" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Translate Snap:" -msgstr "" +msgstr "স্ন্যাপ-এর স্থানান্তর:" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Rotate Snap (deg.):" -msgstr "" +msgstr "স্ন্যাপ-এর ঘূর্ণন (ডিগ্রি):" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Scale Snap (%):" -msgstr "" +msgstr "স্ন্যাপ-এর মাপন (%):" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Viewport Settings" -msgstr "" +msgstr "Viewport সেটিংস" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Default Light Normal:" -msgstr "" +msgstr "লাইটের প্রাথমিক নরমাল:" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Ambient Light Color:" -msgstr "" +msgstr "অ্যাম্বিয়েন্ট লাইটের রঙ:" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Perspective FOV (deg.):" -msgstr "" +msgstr "পরিপ্রেক্ষিত (Perspective) FOV (ডিগ্রি):" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "View Z-Near:" -msgstr "" +msgstr "Z-Near দেখুন:" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "View Z-Far:" -msgstr "" +msgstr "Z-Far দেখুন:" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Transform Change" -msgstr "" +msgstr "রুপান্তরের পরিবর্তন" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Translate:" -msgstr "" +msgstr "স্থানান্তর (Translate):" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Rotate (deg.):" -msgstr "" +msgstr "ঘূর্ণন (ডিগ্রি):" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Scale (ratio):" -msgstr "" +msgstr "মাপন (অনুপাত):" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Transform Type" -msgstr "" +msgstr "রুপান্তরের ধরণ" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Pre" -msgstr "" +msgstr "পূর্ব (Pre)" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Post" -msgstr "" +msgstr "পরবর্তী (Post)" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "ERROR: Couldn't load frame resource!" -msgstr "" +msgstr "সমস্যা: ফ্রেম রিসোর্স লোড করা সম্ভব হয়নি!" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Add Frame" -msgstr "" +msgstr "ফ্রেম যোগ করুন" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Resource clipboard is empty or not a texture!" -msgstr "" +msgstr "রিসোর্স ক্লীপবোর্ড খালি অথবা কোনো টেক্সার নয়!" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Paste Frame" -msgstr "" +msgstr "ফ্রেম প্রতিলেপন করুন" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Add Empty" -msgstr "" +msgstr "খালি বস্তু যোগ করুন" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Change Animation Loop" -msgstr "" +msgstr "অ্যানিমেশনের লুপ পরিবর্তন করুন" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Change Animation FPS" -msgstr "" +msgstr "অ্যানিমেশনের FPS পরিবর্তন করুন" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "(empty)" -msgstr "" +msgstr "(খালি/শূন্য)" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Animations" -msgstr "" +msgstr "অ্যানিমেশনসমূহ" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Speed (FPS):" -msgstr "" +msgstr "গতি (FPS):" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Animation Frames" -msgstr "" +msgstr "অ্যানিমেশনের ফ্রেমসমূহ" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Insert Empty (Before)" -msgstr "" +msgstr "খালি বস্তু যুক্ত করুন (পূর্বে)" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Insert Empty (After)" -msgstr "" +msgstr "খালি বস্তু যুক্ত করুন (পরে)" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Up" -msgstr "" +msgstr "উপরে" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Down" -msgstr "" +msgstr "নীচে" #: tools/editor/plugins/style_box_editor_plugin.cpp msgid "StyleBox Preview:" -msgstr "" +msgstr "StyleBox প্রিভিউ:" #: tools/editor/plugins/texture_region_editor_plugin.cpp msgid "Snap Mode:" -msgstr "" +msgstr "স্ন্যাপ মোড:" #: tools/editor/plugins/texture_region_editor_plugin.cpp msgid "<None>" -msgstr "" +msgstr "<নান/কিছুই না>" #: tools/editor/plugins/texture_region_editor_plugin.cpp msgid "Pixel Snap" -msgstr "" +msgstr "পিক্সেল স্ন্যাপ" #: tools/editor/plugins/texture_region_editor_plugin.cpp msgid "Grid Snap" -msgstr "" +msgstr "গ্রিড স্ন্যাপ" #: tools/editor/plugins/texture_region_editor_plugin.cpp msgid "Auto Slice" -msgstr "" +msgstr "স্বয়ংক্রিয় টুকরো" #: tools/editor/plugins/texture_region_editor_plugin.cpp msgid "Offset:" -msgstr "" +msgstr "অফসেট/ভারসাম্য:" #: tools/editor/plugins/texture_region_editor_plugin.cpp msgid "Step:" -msgstr "" +msgstr "পদক্ষেপ:" #: tools/editor/plugins/texture_region_editor_plugin.cpp msgid "Separation:" -msgstr "" +msgstr "বিচ্ছেদ:" #: tools/editor/plugins/texture_region_editor_plugin.cpp msgid "Texture Region" -msgstr "" +msgstr "গঠনবিন্যাসের এলাকা" #: tools/editor/plugins/texture_region_editor_plugin.cpp msgid "Texture Region Editor" -msgstr "" +msgstr "গঠনবিন্যাসের এলাকা এডিটর" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Can't save theme to file:" -msgstr "" +msgstr "থিমটি ফাইলে সংরক্ষণ করা সম্ভব হয়নি:" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Add All Items" -msgstr "" +msgstr "সকল বস্তু যোগ করুন" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Add All" -msgstr "" +msgstr "সবগুলি যোগ করুন" #: tools/editor/plugins/theme_editor_plugin.cpp #: tools/editor/plugins/tile_set_editor_plugin.cpp msgid "Remove Item" -msgstr "" +msgstr "বস্তু অপসারণ করুন" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Theme" -msgstr "" +msgstr "থিম" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Add Class Items" -msgstr "" +msgstr "ক্লাসের আইটেম যোগ করুন" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Remove Class Items" -msgstr "" +msgstr "ক্লাসের আইটেম অপসারণ করুন" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Create Empty Template" -msgstr "" +msgstr "খালি টেমপ্লেট তৈরি করুন" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Create Empty Editor Template" -msgstr "" +msgstr "এডিটরের খালি টেমপ্লেট তৈরি করুন" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "CheckBox Radio1" -msgstr "" +msgstr "CheckBox Radio১" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "CheckBox Radio2" -msgstr "" +msgstr "CheckBox Radio২" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Item" -msgstr "" +msgstr "বস্তু/আইটেম" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Check Item" -msgstr "" +msgstr "আইটেম চিহ্নিত করুন" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Checked Item" -msgstr "" +msgstr "চিহ্নিত আইটেম" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Has" -msgstr "" +msgstr "আছে" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Many" -msgstr "" +msgstr "অনেক" #: tools/editor/plugins/theme_editor_plugin.cpp tools/editor/project_export.cpp msgid "Options" -msgstr "" +msgstr "সিদ্ধান্তসমূহ" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Have,Many,Several,Options!" -msgstr "" +msgstr "আছে,অনেক,একাধিক,সিদ্ধান্তসমূহ!" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Tab 1" -msgstr "" +msgstr "ট্যাব ১" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Tab 2" -msgstr "" +msgstr "ট্যাব ২" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Tab 3" -msgstr "" +msgstr "ট্যাব ৩" #: tools/editor/plugins/theme_editor_plugin.cpp #: tools/editor/project_settings.cpp tools/editor/scene_tree_editor.cpp #: tools/editor/script_editor_debugger.cpp msgid "Type:" -msgstr "" +msgstr "ধরণ:" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Data Type:" -msgstr "" +msgstr "ডাটার ধরণ:" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Icon" -msgstr "" +msgstr "আইকন" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Style" -msgstr "" +msgstr "স্টাইল" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Color" -msgstr "" +msgstr "রঙ" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Paint TileMap" -msgstr "" +msgstr "TileMap আঁকুন" #: tools/editor/plugins/tile_map_editor_plugin.cpp #: tools/editor/scene_tree_dock.cpp msgid "Duplicate" -msgstr "" +msgstr "প্রতিলিপি" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Erase TileMap" -msgstr "" +msgstr "TileMap মুছে ফেলুন" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Erase selection" -msgstr "" +msgstr "নির্বাচিতসমূহ মুছে ফেলুন" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Find tile" -msgstr "" +msgstr "টাইল খুঁজুন" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Transpose" -msgstr "" +msgstr "পক্ষান্তরিত করুন" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Mirror X" -msgstr "" +msgstr "প্রতিবিম্ব X" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Mirror Y" -msgstr "" +msgstr "প্রতিবিম্ব Y" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Bucket" -msgstr "" +msgstr "বাকেট্" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Pick Tile" -msgstr "" +msgstr "টাইল পছন্দ করুন" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Select" -msgstr "" +msgstr "নির্বাচন করুন" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Rotate 0 degrees" -msgstr "" +msgstr "০ ডিগ্রি ঘোরান্" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Rotate 90 degrees" -msgstr "" +msgstr "৯০ ডিগ্রি ঘোরান্" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Rotate 180 degrees" -msgstr "" +msgstr "১৮০ ডিগ্রি ঘোরান্" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Rotate 270 degrees" -msgstr "" +msgstr "২৭০ ডিগ্রি ঘোরান্" #: tools/editor/plugins/tile_set_editor_plugin.cpp msgid "Could not find tile:" -msgstr "" +msgstr "টাইলটি খুঁজে পাওয়া যায়নি:" #: tools/editor/plugins/tile_set_editor_plugin.cpp msgid "Item name or ID:" -msgstr "" +msgstr "আইটেমের নাম বা আইডি:" #: tools/editor/plugins/tile_set_editor_plugin.cpp msgid "Create from scene?" -msgstr "" +msgstr "দৃশ্য হতে তৈরি করবেন?" #: tools/editor/plugins/tile_set_editor_plugin.cpp msgid "Merge from scene?" -msgstr "" +msgstr "দৃশ্য হতে একত্রিত করবেন?" #: tools/editor/plugins/tile_set_editor_plugin.cpp msgid "Create from Scene" -msgstr "" +msgstr "দৃশ্য হতে তৈরি করবেন" #: tools/editor/plugins/tile_set_editor_plugin.cpp msgid "Merge from Scene" -msgstr "" +msgstr "দৃশ্য হতে একত্রিত করবেন" #: tools/editor/plugins/tile_set_editor_plugin.cpp #: tools/editor/script_editor_debugger.cpp msgid "Error" -msgstr "" +msgstr "সমস্যা/ভুল" #: tools/editor/project_export.cpp msgid "Edit Script Options" -msgstr "" +msgstr "স্ক্রিপ্ট-এর সিদ্ধান্তসমূহ সম্পাদন করুন" #: tools/editor/project_export.cpp msgid "Please export outside the project folder!" -msgstr "" +msgstr "অনুগ্রহ করে প্রকল্পের ফোল্ডারের বাইরে এক্সপোর্ট করুন!" #: tools/editor/project_export.cpp msgid "Error exporting project!" -msgstr "" +msgstr "প্রকল্প এক্সপোর্টে সমস্যা হয়েছে!" #: tools/editor/project_export.cpp msgid "Error writing the project PCK!" -msgstr "" +msgstr "প্রকল্পের PCK লিখতে সমস্যা হয়েছে!" #: tools/editor/project_export.cpp msgid "No exporter for platform '%s' yet." +msgstr "'%s' প্ল্যাটফর্মের জন্য এখনো কোনো এক্সপোর্টার নেই।" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Create Android keystore" +msgstr "নতুন রিসোর্স তৈরি করুন" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Full name" +msgstr "গ্রহণযোগ্য নাম" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" msgstr "" #: tools/editor/project_export.cpp -msgid "Include" +#, fuzzy +msgid "Organization" +msgstr "ট্র্যানজিশন/স্থানান্তরণ" + +#: tools/editor/project_export.cpp +msgid "City" msgstr "" #: tools/editor/project_export.cpp -msgid "Change Image Group" +#, fuzzy +msgid "State" +msgstr "অবস্থা:" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" msgstr "" #: tools/editor/project_export.cpp -msgid "Group name can't be empty!" +msgid "User alias" msgstr "" #: tools/editor/project_export.cpp -msgid "Invalid character in group name!" +#, fuzzy +msgid "Password" +msgstr "পাসওয়ার্ড:" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "at least 6 characters" +msgstr "গ্রহনযোগ্য অক্ষরসমূহ:" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "File name" +msgstr "নতুন নাম:" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" msgstr "" #: tools/editor/project_export.cpp -msgid "Group name already exists!" +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" msgstr "" #: tools/editor/project_export.cpp -msgid "Add Image Group" +msgid "Fill Keystore/Release User and Release Password" msgstr "" #: tools/editor/project_export.cpp +msgid "Include" +msgstr "অন্তর্ভুক্ত করুন" + +#: tools/editor/project_export.cpp +msgid "Change Image Group" +msgstr "ছবির গ্রুপ পরিবর্তন করুন" + +#: tools/editor/project_export.cpp +msgid "Group name can't be empty!" +msgstr "গ্রুপের নাম খালি হতে পারবে না!" + +#: tools/editor/project_export.cpp +msgid "Invalid character in group name!" +msgstr "গ্রুপের নামে অগ্রহনযোগ্য অক্ষর!" + +#: tools/editor/project_export.cpp +msgid "Group name already exists!" +msgstr "গ্রুপের নাম ইতিমধ্যেই আছে!" + +#: tools/editor/project_export.cpp +msgid "Add Image Group" +msgstr "ছবির গ্রুপ যোগ করুন" + +#: tools/editor/project_export.cpp msgid "Delete Image Group" -msgstr "" +msgstr "ছবির গ্রুপ অপসারণ করুন" #: tools/editor/project_export.cpp msgid "Atlas Preview" -msgstr "" +msgstr "এটলাস/মানচিত্রাবলী প্রিভিউ" #: tools/editor/project_export.cpp msgid "Project Export Settings" -msgstr "" +msgstr "প্রকল্প এক্সপোর্ট-এর সেটিংস" #: tools/editor/project_export.cpp msgid "Target" -msgstr "" +msgstr "টার্গেট" #: tools/editor/project_export.cpp msgid "Export to Platform" -msgstr "" +msgstr "প্লাটফর্মে এক্সপোর্ট করুন" #: tools/editor/project_export.cpp msgid "Resources" -msgstr "" +msgstr "রিসোর্সসমূহ" #: tools/editor/project_export.cpp msgid "Export selected resources (including dependencies)." -msgstr "" +msgstr "নির্বাচিত রিসোর্সসমূহ এক্সপোর্ট করুন (ডিপেন্ডেন্সী সহ)।" #: tools/editor/project_export.cpp msgid "Export all resources in the project." -msgstr "" +msgstr "প্রকল্পের সকল রিসোর্স এক্সপোর্ট করুন।" #: tools/editor/project_export.cpp msgid "Export all files in the project directory." -msgstr "" +msgstr "প্রকল্পের পথে সকল ফাইল এক্সপোর্ট করুন।" #: tools/editor/project_export.cpp msgid "Export Mode:" -msgstr "" +msgstr "এক্সপোর্ট মোড:" #: tools/editor/project_export.cpp msgid "Resources to Export:" -msgstr "" +msgstr "এক্সপোর্টের জন্য রিসোর্স:" #: tools/editor/project_export.cpp msgid "Action" -msgstr "" +msgstr "প্রক্রিয়া/অ্যাকশন" #: tools/editor/project_export.cpp msgid "" "Filters to export non-resource files (comma-separated, e.g.: *.json, *.txt):" msgstr "" +"রিসোর্স-নয় এমন ফাইল এক্সপোর্ট করার ফিল্টারসমূহ (কমা-বিভক্ত, যেমন: *.json, *.txt):" #: tools/editor/project_export.cpp msgid "Filters to exclude from export (comma-separated, e.g.: *.json, *.txt):" msgstr "" +"এক্সপোর্ট (export) হতে বর্জনকৃত ফিল্টারসমূহ (filter) (কমা-বিভক্ত, যেমন: *.json, *." +"txt):" #: tools/editor/project_export.cpp msgid "Convert text scenes to binary on export." -msgstr "" +msgstr "এক্সপর্টের সময় টেক্সট দৃশ্যগুলোকে বাইনারিতে রুপান্তর করুন।" #: tools/editor/project_export.cpp msgid "Images" -msgstr "" +msgstr "ছবিসমূহ" #: tools/editor/project_export.cpp msgid "Keep Original" -msgstr "" +msgstr "মূলটিই (অরিজিনাল) রাখুন" #: tools/editor/project_export.cpp msgid "Compress for Disk (Lossy, WebP)" -msgstr "" +msgstr "ডিস্কের জন্য সংকুচিত করুন (ধ্বংসাত্মক, WebP)" #: tools/editor/project_export.cpp msgid "Compress for RAM (BC/PVRTC/ETC)" -msgstr "" +msgstr "RAM-এর জন্য সংকুচিত করুন (BC/PVRTC/ETC)" #: tools/editor/project_export.cpp msgid "Convert Images (*.png):" -msgstr "" +msgstr "ছবিসমূহ রূপান্তর করুন (*.png):" #: tools/editor/project_export.cpp msgid "Compress for Disk (Lossy) Quality:" -msgstr "" +msgstr "ডিস্ক-এর জন্য সংকুচিত করুন (ধ্বংসাত্মক গুণের):" #: tools/editor/project_export.cpp msgid "Shrink All Images:" -msgstr "" +msgstr "সকল ছবি সংকুচিত করুন:" #: tools/editor/project_export.cpp msgid "Compress Formats:" -msgstr "" +msgstr "ধরণসমূহ সংকোচন করুন:" #: tools/editor/project_export.cpp msgid "Image Groups" -msgstr "" +msgstr "ছবির গ্রুপসমূহ" #: tools/editor/project_export.cpp msgid "Groups:" -msgstr "" +msgstr "গ্রুপসমূহ:" #: tools/editor/project_export.cpp msgid "Compress Disk" -msgstr "" +msgstr "ডিস্ক সঙ্কোচন" #: tools/editor/project_export.cpp msgid "Compress RAM" -msgstr "" +msgstr "RAM সঙ্কোচন" #: tools/editor/project_export.cpp msgid "Compress Mode:" -msgstr "" +msgstr "সঙ্কোচন মোড:" #: tools/editor/project_export.cpp msgid "Lossy Quality:" -msgstr "" +msgstr "ধ্বংসাত্মক গুণের:" #: tools/editor/project_export.cpp msgid "Atlas:" -msgstr "" +msgstr "এটলাস/মানচিত্রাবলী:" #: tools/editor/project_export.cpp msgid "Shrink By:" -msgstr "" +msgstr "সঙ্কোচন দ্বারা:" #: tools/editor/project_export.cpp msgid "Preview Atlas" -msgstr "" +msgstr "এটলাস/মানচিত্রাবলী প্রিভিউ" #: tools/editor/project_export.cpp msgid "Image Filter:" -msgstr "" +msgstr "ছবির ফিল্টার:" #: tools/editor/project_export.cpp msgid "Images:" -msgstr "" +msgstr "ছবিসমূহ:" #: tools/editor/project_export.cpp msgid "Select None" -msgstr "" +msgstr "কোনোটাই নির্বাচন করবেন না" #: tools/editor/project_export.cpp msgid "Group" -msgstr "" +msgstr "গ্রুপ" #: tools/editor/project_export.cpp msgid "Samples" -msgstr "" +msgstr "নমুনাসমূহ" #: tools/editor/project_export.cpp msgid "Sample Conversion Mode: (.wav files):" -msgstr "" +msgstr "নমুনা রূপান্তর মোড: (.wav ফাইল):" #: tools/editor/project_export.cpp msgid "Keep" -msgstr "" +msgstr "রাখুন" #: tools/editor/project_export.cpp msgid "Compress (RAM - IMA-ADPCM)" -msgstr "" +msgstr "সঙ্কোচন (RAM - IMA-ADPCM)" #: tools/editor/project_export.cpp msgid "Sampling Rate Limit (Hz):" -msgstr "" +msgstr "আদর্শ রেট লিমিট (Hz):" #: tools/editor/project_export.cpp msgid "Trim" -msgstr "" +msgstr "ছাঁটা" #: tools/editor/project_export.cpp msgid "Trailing Silence:" -msgstr "" +msgstr "পরিশিষ্ট নীরবতা:" #: tools/editor/project_export.cpp msgid "Script" -msgstr "" +msgstr "স্ক্রিপ্ট" #: tools/editor/project_export.cpp msgid "Script Export Mode:" -msgstr "" +msgstr "স্ক্রিপ্ট এক্সপোর্ট মোড:" #: tools/editor/project_export.cpp msgid "Text" -msgstr "" +msgstr "টেক্সট" #: tools/editor/project_export.cpp msgid "Compiled" -msgstr "" +msgstr "কম্পাইল্ড" #: tools/editor/project_export.cpp msgid "Encrypted (Provide Key Below)" -msgstr "" +msgstr "এনক্রিপ্ট করুন (নীচে কী/চাবি দিন)" #: tools/editor/project_export.cpp msgid "Script Encryption Key (256-bits as hex):" -msgstr "" +msgstr "স্ক্রিপ্ট এনক্রিপশন কী/চাবি (২৫৬-বিটস হেক্স):" #: tools/editor/project_export.cpp msgid "Export PCK/Zip" -msgstr "" +msgstr "এক্সপোর্ট PCK/Zip" #: tools/editor/project_export.cpp msgid "Export Project PCK" -msgstr "" +msgstr "প্রকল্পের PCK এক্সপোর্ট করুন" #: tools/editor/project_export.cpp msgid "Export.." -msgstr "" +msgstr "এক্সপোর্ট.." #: tools/editor/project_export.cpp msgid "Project Export" -msgstr "" +msgstr "এক্সপোর্ট প্রকল্প" #: tools/editor/project_export.cpp msgid "Export Preset:" -msgstr "" +msgstr "এক্সপোর্টের প্রিসেট:" #: tools/editor/project_manager.cpp msgid "Invalid project path, the path must exist!" -msgstr "" +msgstr "অকার্যকর প্রকল্পের পথ, পথটি অবশ্যই বিদ্যমান হতে হবে!" #: tools/editor/project_manager.cpp msgid "Invalid project path, engine.cfg must not exist." -msgstr "" +msgstr "অকার্যকর প্রকল্পের পথ, engine.cfg অবশ্যই অনুপস্থিত হতে হবে।" #: tools/editor/project_manager.cpp msgid "Invalid project path, engine.cfg must exist." -msgstr "" +msgstr "অকার্যকর প্রকল্পের পথ, engine.cfg অবশ্যই উপস্থিত হতে হবে।" #: tools/editor/project_manager.cpp msgid "Imported Project" -msgstr "" +msgstr "প্রকল্প ইম্পোর্ট করা হয়েছে" #: tools/editor/project_manager.cpp msgid "Invalid project path (changed anything?)." -msgstr "" +msgstr "অকার্যকর প্রকল্পের পথ (কোনোকিছু পরিবর্তন করেছেন?)।" #: tools/editor/project_manager.cpp msgid "Couldn't create engine.cfg in project path." -msgstr "" +msgstr "প্রকল্পের পথে engine.cfg তৈরি করা সম্ভব হয়নি।" #: tools/editor/project_manager.cpp msgid "The following files failed extraction from package:" -msgstr "" +msgstr "প্যাকেজ হতে নীম্নোক্ত ফাইলসমূহ এক্সট্রাক্ট করা অসফল হয়েছে:" #: tools/editor/project_manager.cpp msgid "Package Installed Successfully!" -msgstr "" +msgstr "প্যাকেজ ইন্সটল সফল হয়েছে!" #: tools/editor/project_manager.cpp msgid "Import Existing Project" -msgstr "" +msgstr "বিদ্যমান প্রকল্প ইম্পোর্ট করুন" #: tools/editor/project_manager.cpp msgid "Project Path (Must Exist):" -msgstr "" +msgstr "প্রকল্পের পথ (অবশ্যই বিদ্যমান হতে হবে):" #: tools/editor/project_manager.cpp msgid "Project Name:" -msgstr "" +msgstr "প্রকল্পের নাম:" #: tools/editor/project_manager.cpp msgid "Create New Project" -msgstr "" +msgstr "নতুন প্রকল্প তৈরি করুন" #: tools/editor/project_manager.cpp msgid "Project Path:" -msgstr "" +msgstr "প্রকল্পের পথ:" #: tools/editor/project_manager.cpp msgid "Install Project:" -msgstr "" +msgstr "প্রকল্প ইন্সটল করুন:" #: tools/editor/project_manager.cpp msgid "Install" -msgstr "" +msgstr "ইন্সটল" #: tools/editor/project_manager.cpp msgid "Browse" -msgstr "" +msgstr "ব্রাউস" #: tools/editor/project_manager.cpp msgid "New Game Project" -msgstr "" +msgstr "নতুন গেম প্রকল্প" #: tools/editor/project_manager.cpp msgid "That's a BINGO!" -msgstr "" +msgstr "দারুণ খবর!" #: tools/editor/project_manager.cpp msgid "Unnamed Project" -msgstr "" +msgstr "নামহীন প্রকল্প" #: tools/editor/project_manager.cpp msgid "Are you sure to open more than one project?" -msgstr "" +msgstr "একধিক প্রকল্প খোলায় আপনি সুনিশ্চিত?" #: tools/editor/project_manager.cpp msgid "Are you sure to run more than one project?" -msgstr "" +msgstr "একধিক প্রকল্প চালানোয় আপনি সুনিশ্চিত?" #: tools/editor/project_manager.cpp msgid "Remove project from the list? (Folder contents will not be modified)" -msgstr "" +msgstr "তালিকা হতে প্রকল্প অপসারণ করবেন? (ফোল্ডারের বিষয়াদি পরিবর্তন হবে না)" #: tools/editor/project_manager.cpp msgid "" "You are about the scan %s folders for existing Godot projects. Do you " "confirm?" msgstr "" +"বিদ্যমান Godot প্রজেক্টের খোঁজে আপনি %s ফোল্ডারসমূহ স্ক্যান করতে যাচ্ছেন। আপনি কি " +"সুনিশ্চিত?" #: tools/editor/project_manager.cpp msgid "Project Manager" -msgstr "" +msgstr "প্রকল্প ম্যানেজার" #: tools/editor/project_manager.cpp msgid "Project List" -msgstr "" +msgstr "প্রকল্পের তালিকা" #: tools/editor/project_manager.cpp msgid "Run" -msgstr "" +msgstr "চালান" #: tools/editor/project_manager.cpp msgid "Scan" -msgstr "" +msgstr "স্ক্যান" #: tools/editor/project_manager.cpp msgid "Select a Folder to Scan" -msgstr "" +msgstr "স্ক্যান করার জন্য ফোল্ডার নির্বাচন করুন" #: tools/editor/project_manager.cpp msgid "New Project" -msgstr "" +msgstr "নতুন প্রকল্প" #: tools/editor/project_manager.cpp msgid "Exit" -msgstr "" +msgstr "প্রস্থান করুন" #: tools/editor/project_settings.cpp msgid "Key " -msgstr "" +msgstr "কী/চাবি " #: tools/editor/project_settings.cpp msgid "Joy Button" -msgstr "" +msgstr "জয়স্টিক বোতাম" #: tools/editor/project_settings.cpp msgid "Joy Axis" -msgstr "" +msgstr "জয়স্টিক অক্ষ" #: tools/editor/project_settings.cpp msgid "Mouse Button" -msgstr "" +msgstr "মাউসের বোতাম" #: tools/editor/project_settings.cpp msgid "Invalid action (anything goes but '/' or ':')." -msgstr "" +msgstr "অকার্যকর অ্যাকশন ('/' বা ':' ছাড়া কিছুই যাবে না)।" #: tools/editor/project_settings.cpp msgid "Action '%s' already exists!" -msgstr "" +msgstr "'%s' অ্যাকশন ইতিমধ্যেই বিদ্যমান!" #: tools/editor/project_settings.cpp msgid "Rename Input Action Event" -msgstr "" +msgstr "ইনপুট অ্যাকশন ইভেন্ট পুনঃনামকরণ করুন" #: tools/editor/project_settings.cpp msgid "Add Input Action Event" -msgstr "" +msgstr "ইনপুট অ্যাকশন ইভেন্ট যোগ করুন" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp msgid "Control+" -msgstr "" +msgstr "কন্ট্রোল+" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp msgid "Press a Key.." -msgstr "" +msgstr "যেকোনো কী/চাবি চাপুন.." #: tools/editor/project_settings.cpp msgid "Mouse Button Index:" -msgstr "" +msgstr "মাউসের বোতাম ইন্ডেক্স:" #: tools/editor/project_settings.cpp msgid "Left Button" -msgstr "" +msgstr "বাম বোতাম" #: tools/editor/project_settings.cpp msgid "Right Button" -msgstr "" +msgstr "ডান বোতাম" #: tools/editor/project_settings.cpp msgid "Middle Button" -msgstr "" +msgstr "মধ্য বোতাম" #: tools/editor/project_settings.cpp msgid "Wheel Up Button" -msgstr "" +msgstr "চাকা উপরে তোলার বোতাম" #: tools/editor/project_settings.cpp msgid "Wheel Down Button" -msgstr "" +msgstr "চাকা নিচে নামানোর বোতাম" #: tools/editor/project_settings.cpp msgid "Button 6" -msgstr "" +msgstr "বোতাম ৬" #: tools/editor/project_settings.cpp msgid "Button 7" -msgstr "" +msgstr "বোতাম ৭" #: tools/editor/project_settings.cpp msgid "Button 8" -msgstr "" +msgstr "বোতাম ৮" #: tools/editor/project_settings.cpp msgid "Button 9" -msgstr "" +msgstr "বোতাম ৯" #: tools/editor/project_settings.cpp msgid "Joystick Axis Index:" -msgstr "" +msgstr "জয়স্টিক অক্ষ ইন্ডেক্স:" #: tools/editor/project_settings.cpp msgid "Joystick Button Index:" -msgstr "" +msgstr "জয়স্টিক বোতাম ইন্ডেক্স:" #: tools/editor/project_settings.cpp msgid "Add Input Action" -msgstr "" +msgstr "ইনপুট অ্যাকশন যোগ করুন" #: tools/editor/project_settings.cpp msgid "Erase Input Action Event" -msgstr "" - -#: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "" +msgstr "ইনপুট অ্যাকশন ইভেন্ট মুছে ফেলুন" #: tools/editor/project_settings.cpp msgid "Error saving settings." -msgstr "" +msgstr "সংরক্ষণে সমস্যা হয়েছে।" #: tools/editor/project_settings.cpp msgid "Settings saved OK." -msgstr "" +msgstr "সেটিংস সংরক্ষণ সফল হয়েছে।" #: tools/editor/project_settings.cpp msgid "Add Translation" -msgstr "" +msgstr "অনুবাদ সংযোগ করুন" #: tools/editor/project_settings.cpp msgid "Remove Translation" -msgstr "" +msgstr "অনুবাদ অপসারণ করুন" #: tools/editor/project_settings.cpp msgid "Add Remapped Path" -msgstr "" +msgstr "পুনঃ-চিত্রাঙ্কিত পথ যোগ করুন" #: tools/editor/project_settings.cpp msgid "Resource Remap Add Remap" -msgstr "" +msgstr "রিসোর্স পুনঃ-চিত্রাঙ্কিত করে যুক্ত করুন" #: tools/editor/project_settings.cpp msgid "Change Resource Remap Language" -msgstr "" +msgstr "রিসোর্স পুনঃ-নকশার ভাষা পরিবর্তন করুন" #: tools/editor/project_settings.cpp msgid "Remove Resource Remap" -msgstr "" +msgstr "রিসোর্সের পুনঃ-নকশা অপসারণ করুন" #: tools/editor/project_settings.cpp msgid "Remove Resource Remap Option" -msgstr "" +msgstr "রিসোর্সের পুনঃ-নকশার সিদ্ধান্ত অপসারণ করুন" #: tools/editor/project_settings.cpp msgid "Project Settings (engine.cfg)" -msgstr "" +msgstr "প্রকল্পের সেটিংস (engine.cfg)" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp msgid "General" -msgstr "" +msgstr "জেনেরাল" #: tools/editor/project_settings.cpp tools/editor/property_editor.cpp msgid "Property:" -msgstr "" +msgstr "প্রপার্টি:" #: tools/editor/project_settings.cpp msgid "Del" -msgstr "" +msgstr "ডিলিট/অপসারণ" #: tools/editor/project_settings.cpp msgid "Copy To Platform.." -msgstr "" +msgstr "প্লাটফর্মে প্রতিলিপি করুন.." #: tools/editor/project_settings.cpp msgid "Input Map" -msgstr "" +msgstr "ইনপুট ম্যাপ/নকশা" #: tools/editor/project_settings.cpp msgid "Action:" -msgstr "" +msgstr "অ্যাকশন:" #: tools/editor/project_settings.cpp msgid "Device:" -msgstr "" +msgstr "ডিভাইস:" #: tools/editor/project_settings.cpp msgid "Index:" -msgstr "" +msgstr "ইন্ডেক্স:" #: tools/editor/project_settings.cpp msgid "Localization" -msgstr "" +msgstr "স্থানীয়করণ" #: tools/editor/project_settings.cpp msgid "Translations" -msgstr "" +msgstr "অনুবাদসমূহ" #: tools/editor/project_settings.cpp msgid "Translations:" -msgstr "" +msgstr "অনুবাদসমূহ:" #: tools/editor/project_settings.cpp msgid "Add.." -msgstr "" +msgstr "সংযোগ.." #: tools/editor/project_settings.cpp msgid "Remaps" -msgstr "" +msgstr "পুনঃনকশাসমূহ" #: tools/editor/project_settings.cpp msgid "Resources:" -msgstr "" +msgstr "রিসোর্সসমূহ:" #: tools/editor/project_settings.cpp msgid "Remaps by Locale:" -msgstr "" +msgstr "ঘটনাস্থল দ্বারা পুনঃনকশা:" #: tools/editor/project_settings.cpp msgid "Locale" -msgstr "" +msgstr "ঘটনাস্থল" #: tools/editor/project_settings.cpp msgid "AutoLoad" -msgstr "" +msgstr "স্বয়ংক্রিয়-লোড" #: tools/editor/project_settings.cpp msgid "Plugins" -msgstr "" +msgstr "প্লাগইন-সমূহ" #: tools/editor/property_editor.cpp msgid "Preset.." -msgstr "" +msgstr "প্রিসেট.." #: tools/editor/property_editor.cpp msgid "Ease In" -msgstr "" +msgstr "আন্ত-সহজাগমন" #: tools/editor/property_editor.cpp msgid "Ease Out" -msgstr "" +msgstr "বহিঃ-সহজাগমন" #: tools/editor/property_editor.cpp msgid "Zero" -msgstr "" +msgstr "শূন্য" #: tools/editor/property_editor.cpp msgid "Easing In-Out" -msgstr "" +msgstr "আগমন-গমন সহজ/আলগা করন" #: tools/editor/property_editor.cpp msgid "Easing Out-In" -msgstr "" +msgstr "গমন-আগমন সহজ/আলগা করন" #: tools/editor/property_editor.cpp msgid "File.." -msgstr "" +msgstr "ফাইল.." #: tools/editor/property_editor.cpp msgid "Dir.." -msgstr "" +msgstr "পথ.." -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" -msgstr "" +msgstr "লোড" #: tools/editor/property_editor.cpp msgid "Assign" -msgstr "" +msgstr "নিযুক্ত" #: tools/editor/property_editor.cpp msgid "New Script" -msgstr "" +msgstr "নতুন স্ক্রিপ্ট" #: tools/editor/property_editor.cpp msgid "Error loading file: Not a resource!" -msgstr "" +msgstr "ফাইল লোডে সমস্যা: রিসোর্স নয়!" #: tools/editor/property_editor.cpp msgid "Couldn't load image" -msgstr "" +msgstr "ছবি লোড অসম্ভব হয়েছে" #: tools/editor/property_editor.cpp msgid "Bit %d, val %d." -msgstr "" +msgstr "বিট %d, মান %d।" #: tools/editor/property_editor.cpp msgid "On" -msgstr "" +msgstr "চালু" #: tools/editor/property_editor.cpp msgid "Properties:" -msgstr "" - -#: tools/editor/property_editor.cpp -msgid "Global" -msgstr "" +msgstr "প্রোপার্টি-সমূহ:" #: tools/editor/property_editor.cpp msgid "Sections:" -msgstr "" +msgstr "অংশাদি:" #: tools/editor/property_selector.cpp msgid "Select Property" @@ -6226,207 +6394,195 @@ msgstr "মেথড/পদ্ধতি বাছাই করুন" #: tools/editor/pvrtc_compress.cpp msgid "Could not execute PVRTC tool:" -msgstr "" +msgstr "PVRTC সরঞ্জাম এক্সিকিউট করা সম্ভব হচ্ছে না:" #: tools/editor/pvrtc_compress.cpp msgid "Can't load back converted image using PVRTC tool:" -msgstr "" +msgstr "PVRTC সরঞ্জাম দ্বারা রূপান্তরিত ছবি পুনরায় লোড করা সম্ভব নয়:" #: tools/editor/reparent_dialog.cpp tools/editor/scene_tree_dock.cpp msgid "Reparent Node" -msgstr "" +msgstr "নোডের নতুন অভিভাবক দান করুন" #: tools/editor/reparent_dialog.cpp msgid "Reparent Location (Select new Parent):" -msgstr "" +msgstr "নতুন অভিভাবকের স্থান (নতুন অভিভাবক নির্বাচন করুন):" #: tools/editor/reparent_dialog.cpp msgid "Keep Global Transform" -msgstr "" +msgstr "সার্বজনীন রূপান্তর রাখুন" #: tools/editor/reparent_dialog.cpp tools/editor/scene_tree_dock.cpp msgid "Reparent" -msgstr "" +msgstr "নতুন অভিভাবক দান করুন" #: tools/editor/resources_dock.cpp msgid "Create New Resource" -msgstr "" +msgstr "নতুন রিসোর্স তৈরি করুন" #: tools/editor/resources_dock.cpp msgid "Open Resource" -msgstr "" +msgstr "রিসোর্স খুলুন" #: tools/editor/resources_dock.cpp msgid "Save Resource" -msgstr "" +msgstr "রিসোর্স সংরক্ষণ করুন" #: tools/editor/resources_dock.cpp msgid "Resource Tools" -msgstr "" +msgstr "রিসোর্স-এর সরঞ্জামসমূহ" #: tools/editor/resources_dock.cpp msgid "Make Local" -msgstr "" +msgstr "স্থানীয় করুন" #: tools/editor/run_settings_dialog.cpp msgid "Run Mode:" -msgstr "" +msgstr "চালানোর মোড:" #: tools/editor/run_settings_dialog.cpp msgid "Current Scene" -msgstr "" +msgstr "বর্তমান দৃশ্য" #: tools/editor/run_settings_dialog.cpp msgid "Main Scene" -msgstr "" +msgstr "প্রধান দৃশ্য" #: tools/editor/run_settings_dialog.cpp msgid "Main Scene Arguments:" -msgstr "" +msgstr "প্রধান দৃশ্যের মান/আর্গুমেন্ট-সমূহ:" #: tools/editor/run_settings_dialog.cpp msgid "Scene Run Settings" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "" +msgstr "দৃশ্য চালানোর সেটিংস" #: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." -msgstr "" +msgstr "দৃশ্যসমূহ ইন্সট্যান্স করার মতো কোনো অভিভাবক নেই।" #: tools/editor/scene_tree_dock.cpp msgid "Error loading scene from %s" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "" +msgstr "%s হতে দৃশ্য লোড করতে সমস্যা হয়েছে" #: tools/editor/scene_tree_dock.cpp msgid "Ok" -msgstr "" +msgstr "ঠিক আছে" #: tools/editor/scene_tree_dock.cpp msgid "" "Cannot instance the scene '%s' because the current scene exists within one " "of its nodes." msgstr "" +"বর্তমান দৃশ্যটি '%s' দৃশ্যের একটি নোডের মাঝে অবস্থান করায় দৃশ্যটিকে ইনস্ট্যান্স করা " +"সম্ভব হচ্ছে না।" #: tools/editor/scene_tree_dock.cpp msgid "Instance Scene(s)" -msgstr "" +msgstr "দৃশ্য(সমূহ) ইন্সট্যান্স করুন" #: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on the tree root." -msgstr "" +msgstr "শাখার মূলে এটি করা সম্ভব হবে না।" #: tools/editor/scene_tree_dock.cpp msgid "Move Node In Parent" -msgstr "" +msgstr "অভিভাবকে নোড সরান" #: tools/editor/scene_tree_dock.cpp msgid "Move Nodes In Parent" -msgstr "" +msgstr "অভিভাবকে নোডসমূহ সরান" #: tools/editor/scene_tree_dock.cpp msgid "Duplicate Node(s)" -msgstr "" +msgstr "নোড(সমূহ) প্রতিলিপি করুন" #: tools/editor/scene_tree_dock.cpp msgid "Delete Node(s)?" -msgstr "" +msgstr "নোড(সমূহ) অপসারণ করবেন?" #: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done without a scene." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "" +msgstr "দৃশ্য ছাড়া এটি করা সম্ভব হবে না।" #: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." -msgstr "" +msgstr "ইন্সট্যান্স করা দৃশ্যে এটি করা সম্ভব হবে না।" #: tools/editor/scene_tree_dock.cpp msgid "Save New Scene As.." -msgstr "" +msgstr "নতুন দৃশ্য এইরূপে সংরক্ষণ করুন.." #: tools/editor/scene_tree_dock.cpp msgid "Makes Sense!" -msgstr "" +msgstr "অর্থপূর্ন!" #: tools/editor/scene_tree_dock.cpp msgid "Can't operate on nodes from a foreign scene!" -msgstr "" +msgstr "বাহিরের দৃশ্যের নোডে এটি করা সম্ভব হবে না!" #: tools/editor/scene_tree_dock.cpp msgid "Can't operate on nodes the current scene inherits from!" -msgstr "" +msgstr "বর্তমান দৃশ্য যার হতে উৎপত্তি হয় তার নোডে এটি করা সম্ভব হবে না!" #: tools/editor/scene_tree_dock.cpp msgid "Remove Node(s)" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "" +msgstr "নোড(সমূহ) অপসারণ করুন" #: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." msgstr "" +"নতুন দৃশ্যটি সংরক্ষণ করা সম্ভব হচ্ছে না। সম্ভবত যেসবের (ইন্সট্যান্স) উপর নির্ভর করছে " +"তাদের সন্তুষ্ট করা সম্ভব হচ্ছে না।" #: tools/editor/scene_tree_dock.cpp msgid "Error saving scene." -msgstr "" +msgstr "দৃশ্য সংরক্ষণে সমস্যা হয়েছে।" #: tools/editor/scene_tree_dock.cpp msgid "Error duplicating scene to save it." -msgstr "" +msgstr "দৃশ্য প্রতিলিপি করে সংরক্ষণে সমস্যা হয়েছে।" #: tools/editor/scene_tree_dock.cpp msgid "Edit Groups" -msgstr "" +msgstr "গ্রুপসমূহ সম্পাদন করুন" #: tools/editor/scene_tree_dock.cpp msgid "Edit Connections" -msgstr "" +msgstr "সংযোগসমূহ সম্পাদন করুন" #: tools/editor/scene_tree_dock.cpp msgid "Delete Node(s)" -msgstr "" +msgstr "নোড(সমূহ) অপসারণ করুন" #: tools/editor/scene_tree_dock.cpp msgid "Add Child Node" -msgstr "" +msgstr "শীষ্য নোড তৈরি করুন" #: tools/editor/scene_tree_dock.cpp msgid "Instance Child Scene" -msgstr "" +msgstr "শীষ্য নোড ইন্সট্যান্স করুন" #: tools/editor/scene_tree_dock.cpp msgid "Change Type" -msgstr "" +msgstr "ধরণ পরিবর্তন করুন" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" -msgstr "" +msgid "Attach Script" +msgstr "স্ক্রিপ্ট সংযুক্ত করুন" + +#: tools/editor/scene_tree_dock.cpp +msgid "Clear Script" +msgstr "স্ক্রিপ্ট পরিস্কার করুন" #: tools/editor/scene_tree_dock.cpp msgid "Merge From Scene" -msgstr "" +msgstr "দৃশ্য হতে একত্রিত করুন" #: tools/editor/scene_tree_dock.cpp msgid "Save Branch as Scene" -msgstr "" +msgstr "প্রশাখাকে দৃশ্য হিসেবে সংরক্ষণ করুন" #: tools/editor/scene_tree_dock.cpp msgid "Delete (No Confirm)" @@ -6434,279 +6590,283 @@ msgstr "অপসারণ করুন (নিশ্চয়তাকরণ ন #: tools/editor/scene_tree_dock.cpp msgid "Add/Create a New Node" -msgstr "" +msgstr "অপসারণ করুন (নিশ্চয়তাকরণ নেই)" #: tools/editor/scene_tree_dock.cpp msgid "" "Instance a scene file as a Node. Creates an inherited scene if no root node " "exists." msgstr "" +"একটি দৃশ্য ফাইলকে নোড হিসেবে ইন্সট্যান্স করুন। যদি কোনো মূল নোড না থাকে একটি " +"উত্তরাধিকারী দৃশ্য তৈরি করে।" #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." -msgstr "" +msgid "Attach a new or existing script for the selected node." +msgstr "একটি নতুন বা বিদ্যমান স্ক্রিপ্ট নির্বাচিত নোডে সংযুক্ত করুন।" -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." -msgstr "" +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." +msgstr "নির্বাচিত নোড হতে একটি স্ক্রিপ্ট পরিস্কার করুন।" #: tools/editor/scene_tree_editor.cpp msgid "Toggle Spatial Visible" -msgstr "" +msgstr "Spatial দৃশ্যমানতা টগল করুন" #: tools/editor/scene_tree_editor.cpp msgid "Toggle CanvasItem Visible" -msgstr "" +msgstr "CanvasItem দৃশ্যমানতা টগল করুন" #: tools/editor/scene_tree_editor.cpp msgid "Instance:" -msgstr "" +msgstr "ইন্সট্যান্স:" #: tools/editor/scene_tree_editor.cpp msgid "Invalid node name, the following characters are not allowed:" -msgstr "" +msgstr "অগ্রহণযোগ্য নোডের নাম, নীম্নোক্ত অক্ষরসমূহ গ্রহণযোগ্য নয়:" #: tools/editor/scene_tree_editor.cpp msgid "Rename Node" -msgstr "" +msgstr "নোড পুনঃনামকরণ করুন" #: tools/editor/scene_tree_editor.cpp msgid "Scene Tree (Nodes):" -msgstr "" +msgstr "দৃশ্যের শাখা (নোডসমূহ):" #: tools/editor/scene_tree_editor.cpp msgid "Editable Children" -msgstr "" +msgstr "সম্পাদনযোগ্য অংশীদারীসমূহ" #: tools/editor/scene_tree_editor.cpp msgid "Load As Placeholder" -msgstr "" +msgstr "প্লেসহোল্ডার হিসেবে লোড করুন" #: tools/editor/scene_tree_editor.cpp msgid "Discard Instancing" -msgstr "" +msgstr "ইন্সট্যান্স করা বাতিল করুন" #: tools/editor/scene_tree_editor.cpp msgid "Open in Editor" -msgstr "" +msgstr "এডিটরে খুলুন" #: tools/editor/scene_tree_editor.cpp msgid "Clear Inheritance" -msgstr "" +msgstr "উত্তরাধিকারত্ব পরিস্কার করুন" #: tools/editor/scene_tree_editor.cpp msgid "Clear Inheritance? (No Undo!)" -msgstr "" +msgstr "উত্তরাধিকারত্ব পরিস্কার করবেন? (ফেরৎ পাবেন না!)" #: tools/editor/scene_tree_editor.cpp msgid "Clear!" -msgstr "" +msgstr "পরিস্কার করুন!" #: tools/editor/scene_tree_editor.cpp msgid "Select a Node" -msgstr "" +msgstr "একটি নোড নির্বাচন করুন" #: tools/editor/script_create_dialog.cpp msgid "Invalid parent class name" -msgstr "" +msgstr "অভিভাবকের অগ্রহণযোগ্য ক্লাস নাম" #: tools/editor/script_create_dialog.cpp msgid "Valid chars:" -msgstr "" +msgstr "গ্রহণযোগ্য অক্ষরসমূহ:" #: tools/editor/script_create_dialog.cpp msgid "Invalid class name" -msgstr "" +msgstr "অগ্রহণযোগ্য ক্লাস নাম" #: tools/editor/script_create_dialog.cpp msgid "Valid name" -msgstr "" +msgstr "গ্রহণযোগ্য নাম" #: tools/editor/script_create_dialog.cpp msgid "N/A" -msgstr "" +msgstr "না/আ" #: tools/editor/script_create_dialog.cpp msgid "Class name is invalid!" -msgstr "" +msgstr "ক্লাস নাম অগ্রহণযোগ্য!" #: tools/editor/script_create_dialog.cpp msgid "Parent class name is invalid!" -msgstr "" +msgstr "অভিভাবকের ক্লাস নাম অগ্রহণযোগ্য!" #: tools/editor/script_create_dialog.cpp msgid "Invalid path!" -msgstr "" +msgstr "অগ্রহণযোগ্য পথ!" #: tools/editor/script_create_dialog.cpp msgid "Could not create script in filesystem." -msgstr "" +msgstr "ফাইলসিস্টেমে স্ক্রিপ্ট তৈরি করা সম্ভব হয়নি।" + +#: tools/editor/script_create_dialog.cpp +msgid "Error loading script from %s" +msgstr "%s হতে স্ক্রিপ্ট তুলতে/লোডে সমস্যা হয়েছে" #: tools/editor/script_create_dialog.cpp msgid "Path is empty" -msgstr "" +msgstr "পথটি খালি" #: tools/editor/script_create_dialog.cpp msgid "Path is not local" -msgstr "" +msgstr "পথটি স্থানীয় নয়" #: tools/editor/script_create_dialog.cpp msgid "Invalid base path" -msgstr "" +msgstr "বেস পথ অগ্রহণযোগ্য" #: tools/editor/script_create_dialog.cpp -msgid "File exists" -msgstr "" +msgid "Invalid extension" +msgstr "অগ্রহণযোগ্য এক্সটেনশন" #: tools/editor/script_create_dialog.cpp -msgid "Invalid extension" -msgstr "" +msgid "Create new script" +msgstr "নতুন স্ক্রিপ্ট তৈরি করুন" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" -msgstr "" +msgid "Load existing script" +msgstr "বিদ্যমান স্ক্রিপ্ট লোড করুন" #: tools/editor/script_create_dialog.cpp msgid "Class Name:" -msgstr "" +msgstr "ক্লাস নাম:" #: tools/editor/script_create_dialog.cpp msgid "Built-In Script" -msgstr "" +msgstr "পূর্বনির্মিত স্ক্রিপ্ট" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" -msgstr "" +msgid "Attach Node Script" +msgstr "নোড স্ক্রিপ্ট সংযুক্ত করুন" #: tools/editor/script_editor_debugger.cpp msgid "Bytes:" -msgstr "" +msgstr "বাইটস:" #: tools/editor/script_editor_debugger.cpp msgid "Warning" -msgstr "" +msgstr "সতর্কতা" #: tools/editor/script_editor_debugger.cpp msgid "Error:" -msgstr "" +msgstr "সমস্যা:" #: tools/editor/script_editor_debugger.cpp msgid "Source:" -msgstr "" +msgstr "উৎস:" #: tools/editor/script_editor_debugger.cpp msgid "Function:" -msgstr "" +msgstr "ফাংশন:" #: tools/editor/script_editor_debugger.cpp msgid "Errors" -msgstr "" +msgstr "সমস্যাসমূহ" #: tools/editor/script_editor_debugger.cpp msgid "Child Process Connected" -msgstr "" +msgstr "চাইল্ড প্রসেস সংযুক্ত হয়েছে" #: tools/editor/script_editor_debugger.cpp msgid "Inspect Previous Instance" -msgstr "" +msgstr "পূর্ববর্তী ইন্সট্যান্স পরীক্ষা করুন" #: tools/editor/script_editor_debugger.cpp msgid "Inspect Next Instance" -msgstr "" +msgstr "পরবর্তী ইন্সট্যান্স পরীক্ষা করুন" #: tools/editor/script_editor_debugger.cpp msgid "Stack Frames" -msgstr "" +msgstr "ফ্রেমসমূহ স্তূপ করুন" #: tools/editor/script_editor_debugger.cpp msgid "Variable" -msgstr "" +msgstr "চলক/ভেরিয়েবল" #: tools/editor/script_editor_debugger.cpp msgid "Errors:" -msgstr "" +msgstr "সমস্যাসমূহ:" #: tools/editor/script_editor_debugger.cpp msgid "Stack Trace (if applicable):" -msgstr "" +msgstr "পদাঙ্ক স্তূপ করুন (প্রযোজ্য হলে):" #: tools/editor/script_editor_debugger.cpp msgid "Remote Inspector" -msgstr "" +msgstr "রিমোট পরীক্ষক" #: tools/editor/script_editor_debugger.cpp msgid "Live Scene Tree:" -msgstr "" +msgstr "দৃশ্যের সক্রিয় শাখা:" #: tools/editor/script_editor_debugger.cpp msgid "Remote Object Properties: " -msgstr "" +msgstr "রিমোট বস্তুর প্রোপার্টিস: " #: tools/editor/script_editor_debugger.cpp msgid "Profiler" -msgstr "" +msgstr "প্রোফাইলার" #: tools/editor/script_editor_debugger.cpp msgid "Monitor" -msgstr "" +msgstr "মনিটর" #: tools/editor/script_editor_debugger.cpp msgid "Value" -msgstr "" +msgstr "মান" #: tools/editor/script_editor_debugger.cpp msgid "Monitors" -msgstr "" +msgstr "মনিটরস" #: tools/editor/script_editor_debugger.cpp msgid "List of Video Memory Usage by Resource:" -msgstr "" +msgstr "রিসোর্স অনুসারে ভিডিও মেমোরির ব্যবহারের তালিকা করুন:" #: tools/editor/script_editor_debugger.cpp msgid "Total:" -msgstr "" +msgstr "সর্বমোট:" #: tools/editor/script_editor_debugger.cpp msgid "Video Mem" -msgstr "" +msgstr "ভিডিও মেমোরি" #: tools/editor/script_editor_debugger.cpp msgid "Resource Path" -msgstr "" +msgstr "রিসোর্স-এর পথ" #: tools/editor/script_editor_debugger.cpp msgid "Type" -msgstr "" +msgstr "ধরণ" #: tools/editor/script_editor_debugger.cpp msgid "Usage" -msgstr "" +msgstr "ব্যবহার" #: tools/editor/script_editor_debugger.cpp msgid "Misc" -msgstr "" +msgstr "বিবিধ" #: tools/editor/script_editor_debugger.cpp msgid "Clicked Control:" -msgstr "" +msgstr "ক্লিক-কৃত কন্ট্রোল:" #: tools/editor/script_editor_debugger.cpp msgid "Clicked Control Type:" -msgstr "" +msgstr "ক্লিক-কৃত কন্ট্রোলের ধরণ:" #: tools/editor/script_editor_debugger.cpp msgid "Live Edit Root:" -msgstr "" +msgstr "সক্রিয়ভাবে মূল সম্পাদন করুন:" #: tools/editor/script_editor_debugger.cpp msgid "Set From Tree" -msgstr "" +msgstr "শাখা হতে স্থাপন করুন" #: tools/editor/settings_config_dialog.cpp msgid "Shortcuts" -msgstr "" +msgstr "শর্টকাটসমূহ" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Light Radius" @@ -6743,3 +6903,33 @@ msgstr "Ray Shape এর দৈর্ঘ্য পরিবর্তন কর #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Notifier Extents" msgstr "Notifier এর সীমা পরিবর্তন করুন" + +#: tools/editor/spatial_editor_gizmos.cpp +#, fuzzy +msgid "Change Probe Extents" +msgstr "Notifier এর সীমা পরিবর্তন করুন" + +#~ msgid "BakedLightInstance does not contain a BakedLight resource." +#~ msgstr "BakedLightInstance কোনো BakedLight রিসোর্স ধারণ করে না।" + +#~ msgid "Vertex" +#~ msgstr "ভারটেক্স" + +#~ msgid "Fragment" +#~ msgstr "ফ্রাগমেন্ট" + +#~ msgid "Lighting" +#~ msgstr "লাইটিং" + +#~ msgid "Toggle Persisting" +#~ msgstr "স্থায়ীয়তা টগল করুন" + +#~ msgid "Global" +#~ msgstr "সার্বজনীন" + +#~ msgid "" +#~ "This item cannot be made visible because the parent is hidden. Unhide the " +#~ "parent first." +#~ msgstr "" +#~ "এর ধারক/বাহক অদৃশ্য হওয়ায় এই বস্তুটি দৃশ্যমান করা সম্ভব নয়। প্রথমে ধারক/বাহককে " +#~ "দৃশ্যমান করুন।" diff --git a/tools/translations/ca.po b/tools/translations/ca.po index 9922663465..266551ee60 100644 --- a/tools/translations/ca.po +++ b/tools/translations/ca.po @@ -1,5 +1,5 @@ # Catalan translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # # Roger BR <drai_kin@hotmail.com>, 2016. @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" -"PO-Revision-Date: 2016-09-11 09:26+0000\n" +"PO-Revision-Date: 2016-10-11 08:26+0000\n" "Last-Translator: Roger BR <drai_kin@hotmail.com>\n" "Language-Team: Catalan <https://hosted.weblate.org/projects/godot-engine/" "godot/ca/>\n" @@ -15,7 +15,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8-bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 2.8\n" +"X-Generator: Weblate 2.9-dev\n" #: modules/gdscript/gd_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -34,12 +34,6 @@ msgid "step argument is zero!" msgstr "L'argument pas (step) és zero!" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" msgstr "Script sense instància" @@ -231,19 +225,19 @@ msgstr "Transició" #: modules/visual_script/visual_script_editor.cpp msgid "Sequence" -msgstr "" +msgstr "Seqüència" #: modules/visual_script/visual_script_editor.cpp msgid "Switch" -msgstr "" +msgstr "commutador" #: modules/visual_script/visual_script_editor.cpp msgid "Iterator" -msgstr "" +msgstr "Iterador" #: modules/visual_script/visual_script_editor.cpp msgid "While" -msgstr "" +msgstr "Mentre" #: modules/visual_script/visual_script_editor.cpp #, fuzzy @@ -256,12 +250,12 @@ msgstr "Crida" #: modules/visual_script/visual_script_editor.cpp msgid "Get" -msgstr "" +msgstr "Obtenir" #: modules/visual_script/visual_script_editor.cpp #: tools/editor/property_editor.cpp msgid "Set" -msgstr "" +msgstr "Especifica" #: modules/visual_script/visual_script_editor.cpp #: tools/editor/plugins/canvas_item_editor_plugin.cpp @@ -399,85 +393,91 @@ msgstr "" #: modules/visual_script/visual_script_nodes.cpp msgid "just pressed" -msgstr "" +msgstr "premut" #: modules/visual_script/visual_script_nodes.cpp msgid "just released" -msgstr "" +msgstr "alliberat" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" +"No s'ha pogut llegir el certificat. Comproveu que tant el camí com la " +"contrasenya són correctes" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." -msgstr "" +msgstr "No s'ha pogut l'objecte signatura." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." -msgstr "" +msgstr "No s'ha pogut crear el paquet signatura." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" +"No s'ha trobat cap plantilla.\n" +"Descarregueu i instal·leu alguna plantilla d'exportació." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." -msgstr "" +msgstr "No s'ha trobat cap paquet de depuració personalitzat." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." -msgstr "" +msgstr "No s'ha trobat cap paquet de llançament personalitzat." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid unique name." msgstr "Nom no vàlid." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid product GUID." msgstr "La mida de la lletra no és vàlida." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." -msgstr "" +msgstr "GUID d'editor no vàlid." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid background color." msgstr "Lletra personalitzada no vàlida." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." -msgstr "" +msgstr "Imatge Store Logo no vàlida. La mida hauria de ser 50x50 ." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." -msgstr "" +msgstr "Imatge Logo quadrat 44x44 no vàlida. La mida hauria de ser 44x44." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." -msgstr "" +msgstr "Imatge Logo quadrat 71x71 no vàlida. La mida hauria de ser 71x71 ." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." -msgstr "" +msgstr "Imatge logo quadrat 150x150 no vàlida. La mida hauria de ser 150x150 ." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." -msgstr "" +msgstr "Imatge logo quadrat 310x310 no vàlida. La mida hauria de ser 310x310." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." -msgstr "" +msgstr "Imatge logo quadrat 310x150 no vàlida. La mida hauria de ser 310x150." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" +"Imatge de la pantalla de presentació no vàlida. La mida hauria de ser " +"620x300." #: scene/2d/animated_sprite.cpp msgid "" @@ -485,7 +485,7 @@ msgid "" "order for AnimatedSprite to display frames." msgstr "" "Un recurs del tipus SpriteFrames s'ha de crear or especificar en la " -"propietat \"Quadres (Frames)\" perquè AnimatedSprite pugui mostrar els " +"propietat \"Fotogrames (Frames)\" perquè AnimatedSprite pugui mostrar els " "quadres." #: scene/2d/canvas_modulate.cpp @@ -494,7 +494,7 @@ msgid "" "scenes). The first created one will work, while the rest will be ignored." msgstr "" "Només es permet un sol CanvasModulate per escena (o conjunt d'escenes " -"instanciades). El primer funcionara, mentre que la resta seran ignorats." +"instanciades). El primer funcionarà, mentre que la resta seran ignorats." #: scene/2d/collision_polygon_2d.cpp msgid "" @@ -619,10 +619,6 @@ msgstr "" "VisibilityEnable2D funciona millor quan l'arrel de l'escena editada " "s'utilitza com a pare." -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "BakedLightInstance no conté cap recurs BakedLight." - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -702,7 +698,8 @@ msgstr "" msgid "Cancel" msgstr "Cancel·la" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "D'acord" @@ -1864,6 +1861,11 @@ msgid "Constants:" msgstr "Constants:" #: tools/editor/editor_help.cpp +#, fuzzy +msgid "Property Description:" +msgstr "Descripció breu:" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "Descripció del mètode:" @@ -1931,7 +1933,9 @@ msgstr "Error en desar recurs!" msgid "Save Resource As.." msgstr "Desar Recurs com..." -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "Vaja..." @@ -2172,7 +2176,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "Tria una Escena Principal" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "Uf..." @@ -2879,6 +2885,7 @@ msgstr "Textures Font:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "Camí de Destinació:" @@ -3113,6 +3120,11 @@ msgid "Auto" msgstr "Auto" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +#, fuzzy +msgid "Root Node Name:" +msgstr "Nom del node:" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "Manquen els següents Fitxers:" @@ -4013,6 +4025,50 @@ msgstr "" msgid "Snap (Pixels):" msgstr "" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Change default type" +msgstr "Canvia Tipus de la Matriu" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4878,18 +4934,6 @@ msgstr "" msgid "Contextual Help" msgstr "" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "" @@ -5652,6 +5696,69 @@ msgid "No exporter for platform '%s' yet." msgstr "" #: tools/editor/project_export.cpp +#, fuzzy +msgid "Create Android keystore" +msgstr "Crea una Carpeta" + +#: tools/editor/project_export.cpp +msgid "Full name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Organization" +msgstr "Transició" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "State" +msgstr "Estat:" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Password" +msgstr "Contrasenya:" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "at least 6 characters" +msgstr "Caràcters vàlids:" + +#: tools/editor/project_export.cpp +msgid "File name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "" @@ -6111,10 +6218,6 @@ msgid "Erase Input Action Event" msgstr "" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "No s'ha pogut desar la configuració." @@ -6258,7 +6361,7 @@ msgstr "" msgid "Dir.." msgstr "" -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "" @@ -6292,10 +6395,6 @@ msgid "Properties:" msgstr "" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "" @@ -6374,14 +6473,6 @@ msgid "Scene Run Settings" msgstr "Configuració d'Execució d'Escenes" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "" @@ -6390,10 +6481,6 @@ msgid "Error loading scene from %s" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "" @@ -6432,10 +6519,6 @@ msgid "This operation can't be done without a scene." msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "" @@ -6460,10 +6543,6 @@ msgid "Remove Node(s)" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6502,8 +6581,14 @@ msgid "Change Type" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" -msgstr "" +#, fuzzy +msgid "Attach Script" +msgstr "Executa Script" + +#: tools/editor/scene_tree_dock.cpp +#, fuzzy +msgid "Clear Script" +msgstr "Executa Script" #: tools/editor/scene_tree_dock.cpp msgid "Merge From Scene" @@ -6528,13 +6613,11 @@ msgid "" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." +msgid "Attach a new or existing script for the selected node." msgstr "" -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." msgstr "" #: tools/editor/scene_tree_editor.cpp @@ -6630,6 +6713,11 @@ msgid "Could not create script in filesystem." msgstr "" #: tools/editor/script_create_dialog.cpp +#, fuzzy +msgid "Error loading script from %s" +msgstr "Error carregant lletra." + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "" @@ -6642,16 +6730,18 @@ msgid "Invalid base path" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "File exists" +msgid "Invalid extension" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Invalid extension" -msgstr "" +#, fuzzy +msgid "Create new script" +msgstr "Crea Subscripció" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" -msgstr "" +#, fuzzy +msgid "Load existing script" +msgstr "No s'ha pogut instanciar l'script:" #: tools/editor/script_create_dialog.cpp msgid "Class Name:" @@ -6662,8 +6752,9 @@ msgid "Built-In Script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" -msgstr "" +#, fuzzy +msgid "Attach Node Script" +msgstr "Executa Script" #: tools/editor/script_editor_debugger.cpp msgid "Bytes:" @@ -6829,6 +6920,20 @@ msgstr "" msgid "Change Notifier Extents" msgstr "" +#: tools/editor/spatial_editor_gizmos.cpp +msgid "Change Probe Extents" +msgstr "" + +#~ msgid "BakedLightInstance does not contain a BakedLight resource." +#~ msgstr "BakedLightInstance no conté cap recurs BakedLight." + +#~ msgid "" +#~ "Paths cannot start with '/', absolute paths must start with 'res://', " +#~ "'user://', or 'local://'" +#~ msgstr "" +#~ "No es pot començar un camí per '/'. Els camins absoluts han de començar " +#~ "per 'res://', 'user://' o 'local://'" + #~ msgid "" #~ "Custom node has no _get_output_port_unsequenced(idx,wmem), but " #~ "unsequenced ports were specified." diff --git a/tools/translations/cs.po b/tools/translations/cs.po index 0975e3c550..4020725d74 100644 --- a/tools/translations/cs.po +++ b/tools/translations/cs.po @@ -1,5 +1,5 @@ # Czech translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # # Jan 'spl!te' Kondelík <j.kondelik@centrum.cz>, 2016. @@ -33,12 +33,6 @@ msgid "step argument is zero!" msgstr "" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" msgstr "Skript nemá instanci" @@ -395,76 +389,76 @@ msgstr "" msgid "just released" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid unique name." msgstr "Neplatný název." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid product GUID." msgstr "Neplatná velikost fontu." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid background color." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" @@ -595,10 +589,6 @@ msgid "" "as parent." msgstr "" -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "BakedLightInstance neobsahuje zdroj BakedLight." - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -679,7 +669,8 @@ msgstr "" msgid "Cancel" msgstr "Zrušit" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "OK" @@ -1837,6 +1828,11 @@ msgid "Constants:" msgstr "" #: tools/editor/editor_help.cpp +#, fuzzy +msgid "Property Description:" +msgstr "Vytvořit odběr" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "" @@ -1904,7 +1900,9 @@ msgstr "" msgid "Save Resource As.." msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "" @@ -2129,7 +2127,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "" @@ -2809,6 +2809,7 @@ msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "" @@ -3036,6 +3037,10 @@ msgid "Auto" msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +msgid "Root Node Name:" +msgstr "" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "" @@ -3936,6 +3941,50 @@ msgstr "" msgid "Snap (Pixels):" msgstr "" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Change default type" +msgstr "Změnit typ hodnot pole" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4801,18 +4850,6 @@ msgstr "" msgid "Contextual Help" msgstr "" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "" @@ -5575,6 +5612,67 @@ msgid "No exporter for platform '%s' yet." msgstr "" #: tools/editor/project_export.cpp +#, fuzzy +msgid "Create Android keystore" +msgstr "Vytvořit složku" + +#: tools/editor/project_export.cpp +msgid "Full name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Organization" +msgstr "Přechod" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "State" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Password" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "at least 6 characters" +msgstr "Platné znaky:" + +#: tools/editor/project_export.cpp +msgid "File name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "" @@ -6034,10 +6132,6 @@ msgid "Erase Input Action Event" msgstr "" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "" @@ -6181,7 +6275,7 @@ msgstr "" msgid "Dir.." msgstr "" -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "" @@ -6214,10 +6308,6 @@ msgid "Properties:" msgstr "" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "" @@ -6296,14 +6386,6 @@ msgid "Scene Run Settings" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "" @@ -6312,10 +6394,6 @@ msgid "Error loading scene from %s" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "" @@ -6354,10 +6432,6 @@ msgid "This operation can't be done without a scene." msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "" @@ -6382,10 +6456,6 @@ msgid "Remove Node(s)" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6424,10 +6494,15 @@ msgid "Change Type" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" +msgid "Attach Script" msgstr "" #: tools/editor/scene_tree_dock.cpp +#, fuzzy +msgid "Clear Script" +msgstr "Vytvořit odběr" + +#: tools/editor/scene_tree_dock.cpp msgid "Merge From Scene" msgstr "" @@ -6451,13 +6526,11 @@ msgid "" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." +msgid "Attach a new or existing script for the selected node." msgstr "" -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." msgstr "" #: tools/editor/scene_tree_editor.cpp @@ -6553,6 +6626,11 @@ msgid "Could not create script in filesystem." msgstr "" #: tools/editor/script_create_dialog.cpp +#, fuzzy +msgid "Error loading script from %s" +msgstr "Chyba nahrávání fontu." + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "" @@ -6565,15 +6643,16 @@ msgid "Invalid base path" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "File exists" +msgid "Invalid extension" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Invalid extension" -msgstr "" +#, fuzzy +msgid "Create new script" +msgstr "Vytvořit odběr" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" +msgid "Load existing script" msgstr "" #: tools/editor/script_create_dialog.cpp @@ -6585,7 +6664,7 @@ msgid "Built-In Script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" +msgid "Attach Node Script" msgstr "" #: tools/editor/script_editor_debugger.cpp @@ -6751,3 +6830,10 @@ msgstr "" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Notifier Extents" msgstr "" + +#: tools/editor/spatial_editor_gizmos.cpp +msgid "Change Probe Extents" +msgstr "" + +#~ msgid "BakedLightInstance does not contain a BakedLight resource." +#~ msgstr "BakedLightInstance neobsahuje zdroj BakedLight." diff --git a/tools/translations/da.po b/tools/translations/da.po index 3294ca2105..e0d4d9bd98 100644 --- a/tools/translations/da.po +++ b/tools/translations/da.po @@ -1,5 +1,5 @@ # Danish translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # # David Lamhauge <davidlamhauge@gmail.com>, 2016. @@ -32,12 +32,6 @@ msgid "step argument is zero!" msgstr "trin argument er nul!" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" msgstr "Ikke et script med en instans" @@ -396,76 +390,76 @@ msgstr "" msgid "just released" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid unique name." msgstr "Ugyldigt index egenskabsnavn." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid product GUID." msgstr "Ugyldig skriftstørrelse." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid background color." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" @@ -603,10 +597,6 @@ msgstr "" "VisibilityEnable2D fungerer bedst, når det bruges med den redigerede " "scenerod direkte som parent." -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "BakedLightInstance indeholder ikke en BakedLight ressource." - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -685,7 +675,8 @@ msgstr "" msgid "Cancel" msgstr "Annuller" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "Ok" @@ -1839,6 +1830,11 @@ msgid "Constants:" msgstr "" #: tools/editor/editor_help.cpp +#, fuzzy +msgid "Property Description:" +msgstr "Opret abonnement" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "" @@ -1906,7 +1902,9 @@ msgstr "" msgid "Save Resource As.." msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "" @@ -2131,7 +2129,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "" @@ -2811,6 +2811,7 @@ msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "" @@ -3038,6 +3039,10 @@ msgid "Auto" msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +msgid "Root Node Name:" +msgstr "" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "" @@ -3937,6 +3942,50 @@ msgstr "" msgid "Snap (Pixels):" msgstr "" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Change default type" +msgstr "Skift Array værditype" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4802,18 +4851,6 @@ msgstr "" msgid "Contextual Help" msgstr "" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "" @@ -5576,6 +5613,66 @@ msgid "No exporter for platform '%s' yet." msgstr "" #: tools/editor/project_export.cpp +#, fuzzy +msgid "Create Android keystore" +msgstr "Opret mappe" + +#: tools/editor/project_export.cpp +msgid "Full name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Organization" +msgstr "Overgang" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "State" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Password" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "at least 6 characters" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "File name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "" @@ -6035,10 +6132,6 @@ msgid "Erase Input Action Event" msgstr "" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "" @@ -6182,7 +6275,7 @@ msgstr "" msgid "Dir.." msgstr "" -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "" @@ -6215,10 +6308,6 @@ msgid "Properties:" msgstr "" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "" @@ -6297,14 +6386,6 @@ msgid "Scene Run Settings" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "" @@ -6313,10 +6394,6 @@ msgid "Error loading scene from %s" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "" @@ -6355,10 +6432,6 @@ msgid "This operation can't be done without a scene." msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "" @@ -6383,10 +6456,6 @@ msgid "Remove Node(s)" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6425,10 +6494,15 @@ msgid "Change Type" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" +msgid "Attach Script" msgstr "" #: tools/editor/scene_tree_dock.cpp +#, fuzzy +msgid "Clear Script" +msgstr "Opret abonnement" + +#: tools/editor/scene_tree_dock.cpp msgid "Merge From Scene" msgstr "" @@ -6451,13 +6525,11 @@ msgid "" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." +msgid "Attach a new or existing script for the selected node." msgstr "" -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." msgstr "" #: tools/editor/scene_tree_editor.cpp @@ -6553,6 +6625,11 @@ msgid "Could not create script in filesystem." msgstr "" #: tools/editor/script_create_dialog.cpp +#, fuzzy +msgid "Error loading script from %s" +msgstr "Error loading skrifttype." + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "" @@ -6565,15 +6642,16 @@ msgid "Invalid base path" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "File exists" +msgid "Invalid extension" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Invalid extension" -msgstr "" +#, fuzzy +msgid "Create new script" +msgstr "Opret abonnement" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" +msgid "Load existing script" msgstr "" #: tools/editor/script_create_dialog.cpp @@ -6585,7 +6663,7 @@ msgid "Built-In Script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" +msgid "Attach Node Script" msgstr "" #: tools/editor/script_editor_debugger.cpp @@ -6752,6 +6830,13 @@ msgstr "" msgid "Change Notifier Extents" msgstr "" +#: tools/editor/spatial_editor_gizmos.cpp +msgid "Change Probe Extents" +msgstr "" + +#~ msgid "BakedLightInstance does not contain a BakedLight resource." +#~ msgstr "BakedLightInstance indeholder ikke en BakedLight ressource." + #~ msgid "" #~ "Custom node has no _get_output_port_unsequenced(idx,wmem), but " #~ "unsequenced ports were specified." diff --git a/tools/translations/de.po b/tools/translations/de.po index 12351973d5..68ce048b5b 100644 --- a/tools/translations/de.po +++ b/tools/translations/de.po @@ -1,5 +1,5 @@ # German translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # # Alexander Mahr <alex.mahr@gmail.com>, 2016. @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2016-09-30 03:13+0000\n" +"PO-Revision-Date: 2016-12-10 04:27+0000\n" "Last-Translator: So Wieso <sowieso@dukun.de>\n" "Language-Team: German <https://hosted.weblate.org/projects/godot-engine/" "godot/de/>\n" @@ -31,7 +31,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 2.9-dev\n" +"X-Generator: Weblate 2.10-dev\n" #: modules/gdscript/gd_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -50,12 +50,6 @@ msgid "step argument is zero!" msgstr "Schrittargument ist null!" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" msgstr "Skript hat keine Instanz" @@ -188,9 +182,8 @@ msgid "Editing Signal:" msgstr "bearbeite Signal:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Change Expression" -msgstr "Typ ändern" +msgstr "Ausdruck ändern" #: modules/visual_script/visual_script_editor.cpp msgid "Add Node" @@ -241,40 +234,36 @@ msgid "Add Setter Property" msgstr "Setter-Eigenschaft hinzufügen" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Condition" -msgstr "Animation kopieren" +msgstr "Bedingung" #: modules/visual_script/visual_script_editor.cpp msgid "Sequence" -msgstr "" +msgstr "Sequenz" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Switch" -msgstr "Tonhöhe" +msgstr "Schalter" #: modules/visual_script/visual_script_editor.cpp msgid "Iterator" -msgstr "" +msgstr "Iterator" #: modules/visual_script/visual_script_editor.cpp msgid "While" -msgstr "" +msgstr "Während" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Return" -msgstr "Rückgabe:" +msgstr "Rückgabe" #: modules/visual_script/visual_script_editor.cpp tools/editor/call_dialog.cpp msgid "Call" msgstr "Aufruf" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Get" -msgstr "Setzen" +msgstr "Abfragen" #: modules/visual_script/visual_script_editor.cpp #: tools/editor/property_editor.cpp @@ -417,87 +406,87 @@ msgstr "" #: modules/visual_script/visual_script_nodes.cpp msgid "just pressed" -msgstr "" +msgstr "gerade gedrückt" #: modules/visual_script/visual_script_nodes.cpp msgid "just released" -msgstr "" +msgstr "gerade losgelassen" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" +"Zertifikat-Datei konnte nicht gelesen werden. Sind Pfad und Passwort beide " +"korrekt?" -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." -msgstr "Fehler beim Schreiben des Projekt-PCK!" +msgstr "Fehler beim erstellen des Signaturobjekts." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." -msgstr "" +msgstr "Fehler beim erstellen der Paketsignatur." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" +"Keine Exportvorlagen gefunden.\n" +"Laden Sie Exportvorlagen ggf. von der offiziellen Webseite herunter und " +"installieren Sie diese." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." -msgstr "" +msgstr "Selbst konfiguriertes Debug-Paket nicht gefunden." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." -msgstr "" +msgstr "Selbst konfiguriertes Release-Paket nicht gefunden." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid unique name." -msgstr "Ungültiger Name." +msgstr "Ungültiger einzigartiger Name." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid product GUID." -msgstr "Ungültige Schriftgröße." +msgstr "Ungültige Produkt-GUID." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." -msgstr "Ungültiger Pfad" +msgstr "Ungültige Verleger-GUID." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid background color." -msgstr "Eigene Schriftart-Quelle ist ungültig." +msgstr "Ungültige Hintergrundfarbe." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." -msgstr "" +msgstr "Ungültige Abmessungen des Store-Logos (sollte 50x50 sein)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." -msgstr "" +msgstr "Ungültige Abmessungen für 44x44-Quadratlogo (sollte 44x44 sein)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." -msgstr "" +msgstr "Ungültige Abmessungen für 71x71-Quadratlogo (sollte 71x71 sein)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." -msgstr "" +msgstr "Ungültige Abmessungen für 150x150-Quadratlogo (sollte 150x150 sein)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." -msgstr "" +msgstr "Ungültige Abmessungen für 310x310-Quadratlogo (sollte 310x310 sein)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." -msgstr "" +msgstr "Ungültige Abmessungen für 310x150-Breitlogo (sollte 310x150 sein)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." -msgstr "" +msgstr "Ungültige Abmessungen für Startbildschirm (sollte 620x300 sein)." #: scene/2d/animated_sprite.cpp msgid "" @@ -643,10 +632,6 @@ msgstr "" "VisibilityEnable2D funktioniert am besten, wenn es ein Unterobjekt erster " "Ordnung der bearbeiteten Szene ist." -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "BakedLightInstance enthält keine BakedLight-Ressource." - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -694,9 +679,8 @@ msgstr "" "eines Navigation-Nodes sein. Es liefert nur Navigationsdaten." #: scene/3d/remote_transform.cpp -#, fuzzy msgid "Path property must point to a valid Spatial node to work." -msgstr "Die Pfad-Eigenschaft muss auf ein gültiges Particles2D-Node verweisen." +msgstr "Die Pfad-Eigenschaft muss auf ein gültiges Spatial-Node verweisen." #: scene/3d/scenario_fx.cpp msgid "" @@ -725,7 +709,8 @@ msgstr "" msgid "Cancel" msgstr "Abbrechen" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "OK" @@ -1473,6 +1458,8 @@ msgid "" "Target method not found! Specify a valid method or attach a script to target " "Node." msgstr "" +"Zielmethode nicht gefunden! Bitte gültige Methode angeben oder Skript an " +"Zielnode anhängen." #: tools/editor/connections_dialog.cpp msgid "Connect To Node:" @@ -1891,6 +1878,11 @@ msgid "Constants:" msgstr "Konstanten:" #: tools/editor/editor_help.cpp +#, fuzzy +msgid "Property Description:" +msgstr "Kurze Beschreibung:" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "Methoden Beschreibung:" @@ -1958,7 +1950,9 @@ msgstr "Fehler beim speichern der Ressource!" msgid "Save Resource As.." msgstr "Speichere Ressource als.." -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "Verstehe..." @@ -2199,7 +2193,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "Wähle eine Hauptszene" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "Ähm" @@ -2521,9 +2517,8 @@ msgid "Editor Layout" msgstr "Editorlayout" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Toggle Fullscreen" -msgstr "Vollbildmodus" +msgstr "Vollbildmodus umschalten" #: tools/editor/editor_node.cpp msgid "Install Export Templates" @@ -2551,7 +2546,7 @@ msgstr "Änderungen aktualisieren" #: tools/editor/editor_node.cpp msgid "Disable Update Spinner" -msgstr "" +msgstr "Update-Anzeigerad deaktivieren" #: tools/editor/editor_node.cpp msgid "Inspector" @@ -2905,6 +2900,7 @@ msgstr "Quelltextur(en):" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "Zielpfad:" @@ -3136,6 +3132,10 @@ msgid "Auto" msgstr "Auto" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +msgid "Root Node Name:" +msgstr "Name des Root-Node:" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "Die folgenden Dateien fehlen:" @@ -3980,9 +3980,8 @@ msgid "Clear Bones" msgstr "Knochen entfernen" #: tools/editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Show Bones" -msgstr "Knochen erstellen" +msgstr "Knochen anzeigen" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Make IK Chain" @@ -4045,6 +4044,52 @@ msgstr "Einen Wert setzen" msgid "Snap (Pixels):" msgstr "Einrasten (Pixel):" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "%s hinzufügen" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "%s hinzufügen…" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "Erzeuge Node" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "Fehler beim Instanziieren von %s" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "Verstehe" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "Kein Node unter dem Unterobjekt instantiiert werden könnte vorhanden." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "Diese Aktion benötigt ein einzelnes ausgewähltes Node." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Change default type" +msgstr "Standardtyp ändern" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" +"Ziehen + Umschalt: Node in gleicher Hierarchie einfügen\n" +"Ziehen + Alt: Nodetyp ändern" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4724,9 +4769,8 @@ msgid "Close Docs" msgstr "Dokumentation schließen" #: tools/editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Close All" -msgstr "Schließen" +msgstr "Alle schließen" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/plugins/script_text_editor.cpp @@ -4841,9 +4885,8 @@ msgstr "" "Szene geladen ist" #: tools/editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Pick Color" -msgstr "Farbe" +msgstr "Farbe auswählen" #: tools/editor/plugins/script_text_editor.cpp tools/editor/scene_tree_dock.cpp msgid "Move Up" @@ -4916,18 +4959,6 @@ msgstr "Springe zu Zeile.." msgid "Contextual Help" msgstr "Kontexthilfe" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "Vertex" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "Fragment" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "Belichtung" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "Ändere skalare Konstante" @@ -5221,9 +5252,8 @@ msgid "Insert Animation Key" msgstr "Animations-Schlüsselbild einfügen" #: tools/editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Focus Origin" -msgstr "Zeige Ursprung" +msgstr "Auf Ursprung zentrieren" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Focus Selection" @@ -5491,9 +5521,8 @@ msgid "Remove Item" msgstr "Entferne Element" #: tools/editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Theme" -msgstr "Motiv speichern" +msgstr "Motiv" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Add Class Items" @@ -5692,6 +5721,71 @@ msgid "No exporter for platform '%s' yet." msgstr "Kein Exporter für Plattform ‚%s‘ verfügbar." #: tools/editor/project_export.cpp +#, fuzzy +msgid "Create Android keystore" +msgstr "Erstelle neue Ressource" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Full name" +msgstr "Gültiger Name" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Organization" +msgstr "Übergang" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "State" +msgstr "Status:" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Password" +msgstr "Passwort:" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "at least 6 characters" +msgstr "Gültige Zeichen:" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "File name" +msgstr "Neuer Name:" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "Einbeziehen" @@ -6158,10 +6252,6 @@ msgid "Erase Input Action Event" msgstr "Lösche Eingabeaktionsereignis" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "Persistente an- und ausschalten" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "Fehler beim Speichern der Einstellungen." @@ -6305,7 +6395,7 @@ msgstr "Datei.." msgid "Dir.." msgstr "Verzeichnis.." -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "Lade" @@ -6314,9 +6404,8 @@ msgid "Assign" msgstr "Zuweisen" #: tools/editor/property_editor.cpp -#, fuzzy msgid "New Script" -msgstr "Nächstes Skript" +msgstr "Neues Skript" #: tools/editor/property_editor.cpp msgid "Error loading file: Not a resource!" @@ -6339,10 +6428,6 @@ msgid "Properties:" msgstr "Eigenschaften:" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "Global" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "Abschnitte:" @@ -6420,14 +6505,6 @@ msgid "Scene Run Settings" msgstr "Szenenausführungseinstellungen" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "Verstehe" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "Kein Node unter dem Unterobjekt instantiiert werden könnte vorhanden." - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "" "Kein Eltern-Node unter dem Szenen instantiiert werden könnten vorhanden." @@ -6437,10 +6514,6 @@ msgid "Error loading scene from %s" msgstr "Fehler beim Laden der Szene von %s" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "Fehler beim Instanziieren von %s" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "Ok" @@ -6482,10 +6555,6 @@ msgid "This operation can't be done without a scene." msgstr "Diese Aktion kann nicht ohne eine Szene ausgeführt werden." #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "Diese Aktion benötigt ein einzelnes ausgewähltes Node." - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "Diese Aktion kann nicht auf instantiierten Szenen ausgeführt werden." @@ -6510,10 +6579,6 @@ msgid "Remove Node(s)" msgstr "Entferne Node(s)" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "Erzeuge Node" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6554,10 +6619,14 @@ msgid "Change Type" msgstr "Typ ändern" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" +msgid "Attach Script" msgstr "Skript hinzufügen" #: tools/editor/scene_tree_dock.cpp +msgid "Clear Script" +msgstr "Skript leeren" + +#: tools/editor/scene_tree_dock.cpp msgid "Merge From Scene" msgstr "Aus Szene zusammenführen" @@ -6582,16 +6651,12 @@ msgstr "" "keine Root-Node existiert." #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." -msgstr "Erzeuge ein neues Skript für das ausgewählte Node." +msgid "Attach a new or existing script for the selected node." +msgstr "Ein neues oder existierendes Skript zum ausgewählten Node hinzufügen." -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." -msgstr "" -"Diese Element kann nicht sichtbar gemacht werden solange das Elternelement " -"versteckt ist. Elternelement zuerst sichtbar machen." +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." +msgstr "Leere ein Skript für das ausgewählte Node." #: tools/editor/scene_tree_editor.cpp msgid "Toggle Spatial Visible" @@ -6687,6 +6752,10 @@ msgid "Could not create script in filesystem." msgstr "Skript konnte nicht im Dateisystem erstellt werden." #: tools/editor/script_create_dialog.cpp +msgid "Error loading script from %s" +msgstr "Fehler beim Laden des Skripts von %s" + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "Pfad ist leer" @@ -6699,16 +6768,16 @@ msgid "Invalid base path" msgstr "Ungültiger Pfad" #: tools/editor/script_create_dialog.cpp -msgid "File exists" -msgstr "Datei existiert" - -#: tools/editor/script_create_dialog.cpp msgid "Invalid extension" msgstr "Ungültige Erweiterung" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" -msgstr "Gültiger Pfad" +msgid "Create new script" +msgstr "Neues Skript erstellen" + +#: tools/editor/script_create_dialog.cpp +msgid "Load existing script" +msgstr "Lade bestehendes Skript" #: tools/editor/script_create_dialog.cpp msgid "Class Name:" @@ -6719,8 +6788,8 @@ msgid "Built-In Script" msgstr "Built-In-Skript" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" -msgstr "Erstelle Node-Skript" +msgid "Attach Node Script" +msgstr "Node-Skript hinzufügen" #: tools/editor/script_editor_debugger.cpp msgid "Bytes:" @@ -6886,6 +6955,42 @@ msgstr "Ändere Länge der Strahlenform" msgid "Change Notifier Extents" msgstr "Ändere Ausmaße des Benachrichtigers" +#: tools/editor/spatial_editor_gizmos.cpp +#, fuzzy +msgid "Change Probe Extents" +msgstr "Ändere Ausmaße des Benachrichtigers" + +#~ msgid "BakedLightInstance does not contain a BakedLight resource." +#~ msgstr "BakedLightInstance enthält keine BakedLight-Ressource." + +#~ msgid "Vertex" +#~ msgstr "Vertex" + +#~ msgid "Fragment" +#~ msgstr "Fragment" + +#~ msgid "Lighting" +#~ msgstr "Belichtung" + +#~ msgid "Toggle Persisting" +#~ msgstr "Persistente an- und ausschalten" + +#~ msgid "Global" +#~ msgstr "Global" + +#~ msgid "" +#~ "This item cannot be made visible because the parent is hidden. Unhide the " +#~ "parent first." +#~ msgstr "" +#~ "Diese Element kann nicht sichtbar gemacht werden solange das " +#~ "Elternelement versteckt ist. Elternelement zuerst sichtbar machen." + +#~ msgid "File exists" +#~ msgstr "Datei existiert" + +#~ msgid "Valid path" +#~ msgstr "Gültiger Pfad" + #~ msgid "" #~ "Custom node has no _get_output_port_unsequenced(idx,wmem), but " #~ "unsequenced ports were specified." diff --git a/tools/translations/de_CH.po b/tools/translations/de_CH.po index 6c5e6b65c3..e6e0efdb23 100644 --- a/tools/translations/de_CH.po +++ b/tools/translations/de_CH.po @@ -1,5 +1,5 @@ # Swiss High German translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # # Christian Fisch <christian.fiesel@gmail.com>, 2016. @@ -32,12 +32,6 @@ msgid "step argument is zero!" msgstr "" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" msgstr "" @@ -393,75 +387,75 @@ msgstr "" msgid "just released" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Error creating the signature object." msgstr "Fehler beim Schreiben des Projekts PCK!" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid unique name." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid product GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid background color." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" @@ -592,10 +586,6 @@ msgstr "" "VisibilityEnable2D funktioniert am besten, wenn es ein Unterobjekt erster " "Ordnung der bearbeiteten Hauptszene ist." -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "" - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -659,7 +649,8 @@ msgstr "" msgid "Cancel" msgstr "Abbrechen" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "Okay" @@ -1804,6 +1795,10 @@ msgid "Constants:" msgstr "" #: tools/editor/editor_help.cpp +msgid "Property Description:" +msgstr "" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "" @@ -1871,7 +1866,9 @@ msgstr "" msgid "Save Resource As.." msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "" @@ -2096,7 +2093,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "" @@ -2781,6 +2780,7 @@ msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "" @@ -3008,6 +3008,10 @@ msgid "Auto" msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +msgid "Root Node Name:" +msgstr "" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "" @@ -3919,6 +3923,50 @@ msgstr "" msgid "Snap (Pixels):" msgstr "" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "Node erstellen" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "Fehler beim Instanzieren der %s Szene" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "Okay :(" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "Bitte nur ein Node selektieren." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Change default type" +msgstr "Typ ändern" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4785,18 +4833,6 @@ msgstr "" msgid "Contextual Help" msgstr "" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "" @@ -5560,6 +5596,64 @@ msgid "No exporter for platform '%s' yet." msgstr "" #: tools/editor/project_export.cpp +msgid "Create Android keystore" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Full name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organization" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "State" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Password" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "at least 6 characters" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "File name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "" @@ -6020,10 +6114,6 @@ msgid "Erase Input Action Event" msgstr "" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "" @@ -6167,7 +6257,7 @@ msgstr "" msgid "Dir.." msgstr "" -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "" @@ -6201,10 +6291,6 @@ msgid "Properties:" msgstr "" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "" @@ -6281,14 +6367,6 @@ msgid "Scene Run Settings" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "Okay :(" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "" @@ -6297,10 +6375,6 @@ msgid "Error loading scene from %s" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "Fehler beim Instanzieren der %s Szene" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "Okay" @@ -6340,10 +6414,6 @@ msgid "This operation can't be done without a scene." msgstr "Ohne eine Szene kann das nicht funktionieren." #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "Bitte nur ein Node selektieren." - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "Das funktioniert nicht bei einer instanzierten Szene." @@ -6368,10 +6438,6 @@ msgid "Remove Node(s)" msgstr "Node(s) entfernen" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "Node erstellen" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6410,7 +6476,13 @@ msgid "Change Type" msgstr "Typ ändern" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" +#, fuzzy +msgid "Attach Script" +msgstr "Script hinzufügen" + +#: tools/editor/scene_tree_dock.cpp +#, fuzzy +msgid "Clear Script" msgstr "Script hinzufügen" #: tools/editor/scene_tree_dock.cpp @@ -6437,13 +6509,11 @@ msgid "" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." +msgid "Attach a new or existing script for the selected node." msgstr "" -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." msgstr "" #: tools/editor/scene_tree_editor.cpp @@ -6539,6 +6609,11 @@ msgid "Could not create script in filesystem." msgstr "" #: tools/editor/script_create_dialog.cpp +#, fuzzy +msgid "Error loading script from %s" +msgstr "Fehler beim Instanzieren der %s Szene" + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "" @@ -6551,15 +6626,16 @@ msgid "Invalid base path" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "File exists" +msgid "Invalid extension" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Invalid extension" -msgstr "" +#, fuzzy +msgid "Create new script" +msgstr "Neues Projekt erstellen" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" +msgid "Load existing script" msgstr "" #: tools/editor/script_create_dialog.cpp @@ -6571,8 +6647,9 @@ msgid "Built-In Script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" -msgstr "" +#, fuzzy +msgid "Attach Node Script" +msgstr "Script hinzufügen" #: tools/editor/script_editor_debugger.cpp msgid "Bytes:" @@ -6738,5 +6815,9 @@ msgstr "" msgid "Change Notifier Extents" msgstr "" +#: tools/editor/spatial_editor_gizmos.cpp +msgid "Change Probe Extents" +msgstr "" + #~ msgid "Insert Keys (Ins)" #~ msgstr "Bilder (innerhalb) einfügen" diff --git a/tools/translations/es.po b/tools/translations/es.po index c02a679529..cec4730148 100644 --- a/tools/translations/es.po +++ b/tools/translations/es.po @@ -1,5 +1,5 @@ # Spanish translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # # Carlos López <genetita@gmail.com>, 2016. @@ -13,7 +13,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2016-09-01 19:29+0000\n" +"PO-Revision-Date: 2016-11-22 16:41+0000\n" "Last-Translator: Swyter <swyterzone@gmail.com>\n" "Language-Team: Spanish <https://hosted.weblate.org/projects/godot-engine/" "godot/es/>\n" @@ -22,7 +22,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 2.8\n" +"X-Generator: Weblate 2.10-dev\n" #: modules/gdscript/gd_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -43,12 +43,6 @@ msgid "step argument is zero!" msgstr "¡El argumento «step» es cero!" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" msgstr "No es un script con una instancia" @@ -241,8 +235,9 @@ msgid "Condition" msgstr "Copiar animación" #: modules/visual_script/visual_script_editor.cpp +#, fuzzy msgid "Sequence" -msgstr "" +msgstr "Secuencia" #: modules/visual_script/visual_script_editor.cpp #, fuzzy @@ -251,11 +246,11 @@ msgstr "Altura" #: modules/visual_script/visual_script_editor.cpp msgid "Iterator" -msgstr "" +msgstr "Iterador" #: modules/visual_script/visual_script_editor.cpp msgid "While" -msgstr "" +msgstr "Mientras" #: modules/visual_script/visual_script_editor.cpp #, fuzzy @@ -415,87 +410,108 @@ msgstr "" #: modules/visual_script/visual_script_nodes.cpp msgid "just pressed" -msgstr "" +msgstr "se presione" #: modules/visual_script/visual_script_nodes.cpp msgid "just released" -msgstr "" +msgstr "se levante" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp +#, fuzzy msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" +"No se ha podido leer el archivo de certificación. ¿Seguro que la ruta y " +"contraseña son correctas?" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Error creating the signature object." msgstr "¡Error al escribir el PCK de proyecto!" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp +#, fuzzy msgid "Error creating the package signature." -msgstr "" +msgstr "Se produjo un error al firmar el paquete." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp +#, fuzzy msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" +"No se han encontrado plantillas de exportación.\n" +"Tienes que descargar e instalarlas para continuar." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp +#, fuzzy msgid "Custom debug package not found." -msgstr "" +msgstr "No se ha encontrado ningún paquete de depuración personalizado." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." -msgstr "" +msgstr "No se ha encontrado ningún paquete final personalizado." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid unique name." msgstr "El nombre no es correcto." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid product GUID." msgstr "Tamaño de tipografía incorrecto." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid publisher GUID." msgstr "Ruta base incorrecta" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid background color." msgstr "El origen personalizado de tipografía no es correcto." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp +#, fuzzy msgid "Invalid Store Logo image dimensions (should be 50x50)." -msgstr "" +msgstr "El logo de la tienda no es del tamaño adecuado (debe ser de 50x50)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp +#, fuzzy msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." msgstr "" +"El logo cuadrado de 44x44 no es del tamaño adecuado (debe ser de 44x44)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp +#, fuzzy msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." msgstr "" +"El logo cuadrado de 71x71 no es del tamaño adecuado (debe ser de 71x71)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp +#, fuzzy msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." msgstr "" +"El logo cuadrado de 150x150 no es del tamaño adecuado (debe ser de 150x150)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp +#, fuzzy msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." msgstr "" +"El logo cuadrado de 310x310 no es del tamaño adecuado (debe ser de 310x310)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp +#, fuzzy msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." msgstr "" +"El logo ancho de 310x150 no es del tamaño adecuado (debe ser de 310x150)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp +#, fuzzy msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" +"El tamaño de la imagen de arranque no es correcto (debe ser de 620x300)." #: scene/2d/animated_sprite.cpp msgid "" @@ -633,10 +649,6 @@ msgstr "" "VisibilityEnable2D funciona mejor cuando se usa con la raíz de escena " "editada directamente como padre." -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "BakedLightInstance no contiene un recurso BakedLight." - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -716,7 +728,8 @@ msgstr "" msgid "Cancel" msgstr "Cancelar" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "Aceptar" @@ -1460,10 +1473,13 @@ msgid "Method in target Node must be specified!" msgstr "¡Debes establecer un método en el nodo seleccionado!" #: tools/editor/connections_dialog.cpp +#, fuzzy msgid "" "Target method not found! Specify a valid method or attach a script to target " "Node." msgstr "" +"No se ha encontrado el método objetivo. Especifica un método válido o ancla " +"un script en el nodo objetivo." #: tools/editor/connections_dialog.cpp msgid "Connect To Node:" @@ -1885,6 +1901,11 @@ msgid "Constants:" msgstr "Constantes:" #: tools/editor/editor_help.cpp +#, fuzzy +msgid "Property Description:" +msgstr "Descripción breve:" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "Descripción de métodos:" @@ -1952,7 +1973,9 @@ msgstr "¡Hubo un error al guardar el recurso!" msgid "Save Resource As.." msgstr "Guardar recurso como…" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "Muy bien…" @@ -2193,7 +2216,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "Elige una escena principal" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "Vaya" @@ -2543,8 +2568,9 @@ msgid "Update Changes" msgstr "Actualizar cambios" #: tools/editor/editor_node.cpp +#, fuzzy msgid "Disable Update Spinner" -msgstr "" +msgstr "Desactivar la animación al actualizar" #: tools/editor/editor_node.cpp msgid "Inspector" @@ -2901,6 +2927,7 @@ msgstr "Texturas de origen:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "Ruta de destino:" @@ -3132,6 +3159,11 @@ msgid "Auto" msgstr "Auto" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +#, fuzzy +msgid "Root Node Name:" +msgstr "Nombre del nodo:" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "Faltan los siguientes archivos:" @@ -4045,6 +4077,55 @@ msgstr "Establecer valor" msgid "Snap (Pixels):" msgstr "Fijar (Pixeles):" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Add %s" +msgstr "Añadir todos" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Adding %s..." +msgstr "Añadiendo %s..." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "Crear nodo" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "Error al instanciar escena desde %s" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "Muy bien :(" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "No hay padre al que instanciarle un hijo." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "Esta operación requiere un solo nodo seleccionado." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Change default type" +msgstr "Cambiar Valor por Defecto" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" +"Arrastrar y soltar + Mayús: Añadir nodo como hermano\n" +"Arrastrar y soltar + Alt: Cambiar tipo de nodo" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4923,18 +5004,6 @@ msgstr "Ir a línea…" msgid "Contextual Help" msgstr "Ayuda contextual" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "Vértice" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "Fragmento" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "Iluminación" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "Cambiar Constante Escalar" @@ -5701,6 +5770,71 @@ msgid "No exporter for platform '%s' yet." msgstr "No hay exportador para la plataforma '%s' aun." #: tools/editor/project_export.cpp +#, fuzzy +msgid "Create Android keystore" +msgstr "Crear recurso nuevo" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Full name" +msgstr "Nombre válido" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Organization" +msgstr "Transición" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "State" +msgstr "Estado:" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Password" +msgstr "Contraseña:" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "at least 6 characters" +msgstr "Letras válidas:" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "File name" +msgstr "Nuevo nombre:" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "Incluir" @@ -6168,10 +6302,6 @@ msgid "Erase Input Action Event" msgstr "Borrar evento de acción de entrada" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "Des/activar persistencia" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "Error al guardar los ajustes." @@ -6315,7 +6445,7 @@ msgstr "Archivo…" msgid "Dir.." msgstr "Dir…" -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "Cargar" @@ -6349,10 +6479,6 @@ msgid "Properties:" msgstr "Propiedades:" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "Global" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "Selecciones:" @@ -6432,14 +6558,6 @@ msgid "Scene Run Settings" msgstr "Ajustes de ejecución de escena" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "Muy bien :(" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "No hay padre al que instanciarle un hijo." - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "No hay padre donde instanciar la escena." @@ -6448,10 +6566,6 @@ msgid "Error loading scene from %s" msgstr "Error al cargar escena desde %s" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "Error al instanciar escena desde %s" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "Aceptar" @@ -6492,10 +6606,6 @@ msgid "This operation can't be done without a scene." msgstr "Esta operación no puede realizarse sin una escena." #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "Esta operación requiere un solo nodo seleccionado." - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "Esta operación no puede realizarse en escenas instanciadas." @@ -6520,10 +6630,6 @@ msgid "Remove Node(s)" msgstr "Borrar nodos" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "Crear nodo" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6564,10 +6670,16 @@ msgid "Change Type" msgstr "Cambiar tipo" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" +#, fuzzy +msgid "Attach Script" msgstr "Añadir script" #: tools/editor/scene_tree_dock.cpp +#, fuzzy +msgid "Clear Script" +msgstr "Crear script" + +#: tools/editor/scene_tree_dock.cpp msgid "Merge From Scene" msgstr "Unir desde escena" @@ -6592,16 +6704,14 @@ msgstr "" "existe ningún nodo raíz." #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." +#, fuzzy +msgid "Attach a new or existing script for the selected node." msgstr "Crear un nuevo script para el nodo seleccionado." -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." -msgstr "" -"Este item no puede hacerse visible porque el padre esta oculto. Desocultá el " -"padre primero." +#: tools/editor/scene_tree_dock.cpp +#, fuzzy +msgid "Clear a script for the selected node." +msgstr "Crear un nuevo script para el nodo seleccionado." #: tools/editor/scene_tree_editor.cpp msgid "Toggle Spatial Visible" @@ -6697,6 +6807,11 @@ msgid "Could not create script in filesystem." msgstr "No se puede crear el script en el sistema de archivos." #: tools/editor/script_create_dialog.cpp +#, fuzzy +msgid "Error loading script from %s" +msgstr "Error al cargar escena desde %s" + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "La ruta está vacia" @@ -6709,16 +6824,18 @@ msgid "Invalid base path" msgstr "Ruta base incorrecta" #: tools/editor/script_create_dialog.cpp -msgid "File exists" -msgstr "El archivo ya existe" - -#: tools/editor/script_create_dialog.cpp msgid "Invalid extension" msgstr "La extensión no es correcta" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" -msgstr "Ruta válida" +#, fuzzy +msgid "Create new script" +msgstr "Crear script" + +#: tools/editor/script_create_dialog.cpp +#, fuzzy +msgid "Load existing script" +msgstr "Script siguiente" #: tools/editor/script_create_dialog.cpp msgid "Class Name:" @@ -6729,7 +6846,8 @@ msgid "Built-In Script" msgstr "Script integrado" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" +#, fuzzy +msgid "Attach Node Script" msgstr "Crear script de nodo" #: tools/editor/script_editor_debugger.cpp @@ -6896,6 +7014,42 @@ msgstr "Cambiar longitud de forma de rayo" msgid "Change Notifier Extents" msgstr "Cambiar Alcances de Notificadores" +#: tools/editor/spatial_editor_gizmos.cpp +#, fuzzy +msgid "Change Probe Extents" +msgstr "Cambiar Alcances de Notificadores" + +#~ msgid "BakedLightInstance does not contain a BakedLight resource." +#~ msgstr "BakedLightInstance no contiene un recurso BakedLight." + +#~ msgid "Vertex" +#~ msgstr "Vértice" + +#~ msgid "Fragment" +#~ msgstr "Fragmento" + +#~ msgid "Lighting" +#~ msgstr "Iluminación" + +#~ msgid "Toggle Persisting" +#~ msgstr "Des/activar persistencia" + +#~ msgid "Global" +#~ msgstr "Global" + +#~ msgid "" +#~ "This item cannot be made visible because the parent is hidden. Unhide the " +#~ "parent first." +#~ msgstr "" +#~ "Este item no puede hacerse visible porque el padre esta oculto. Desocultá " +#~ "el padre primero." + +#~ msgid "File exists" +#~ msgstr "El archivo ya existe" + +#~ msgid "Valid path" +#~ msgstr "Ruta válida" + #~ msgid "" #~ "Custom node has no _get_output_port_unsequenced(idx,wmem), but " #~ "unsequenced ports were specified." diff --git a/tools/translations/es_AR.po b/tools/translations/es_AR.po index 6c266e74a7..08376f39c5 100644 --- a/tools/translations/es_AR.po +++ b/tools/translations/es_AR.po @@ -1,5 +1,5 @@ # Spanish (Argentina) translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # # Lisandro Lorea <lisandrolorea@gmail.com>, 2016. @@ -10,8 +10,8 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2016-09-04 12:31+0000\n" -"Last-Translator: Roger BR <drai_kin@hotmail.com>\n" +"PO-Revision-Date: 2016-12-04 06:03+0000\n" +"Last-Translator: Lisandro Lorea <lisandrolorea@gmail.com>\n" "Language-Team: Spanish (Argentina) <https://hosted.weblate.org/projects/" "godot-engine/godot/es_AR/>\n" "Language: es_AR\n" @@ -19,7 +19,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 2.8\n" +"X-Generator: Weblate 2.10-dev\n" #: modules/gdscript/gd_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -37,12 +37,6 @@ msgid "step argument is zero!" msgstr "el argumento step es cero!" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" msgstr "No es un script con una instancia" @@ -175,9 +169,8 @@ msgid "Editing Signal:" msgstr "Editando Señal:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Change Expression" -msgstr "Cambiar Tipo" +msgstr "Cambiar Expresión" #: modules/visual_script/visual_script_editor.cpp msgid "Add Node" @@ -228,40 +221,36 @@ msgid "Add Setter Property" msgstr "Agregar Propiedad Setter" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Condition" -msgstr "Copiar Animación" +msgstr "Condición" #: modules/visual_script/visual_script_editor.cpp msgid "Sequence" -msgstr "" +msgstr "Secuencia" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Switch" -msgstr "Altura" +msgstr "Switch" #: modules/visual_script/visual_script_editor.cpp msgid "Iterator" -msgstr "" +msgstr "Iterador" #: modules/visual_script/visual_script_editor.cpp msgid "While" -msgstr "" +msgstr "Mientras" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Return" -msgstr "Retornar:" +msgstr "Retornar" #: modules/visual_script/visual_script_editor.cpp tools/editor/call_dialog.cpp msgid "Call" msgstr "Llamar" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Get" -msgstr "Setear" +msgstr "Obtener" #: modules/visual_script/visual_script_editor.cpp #: tools/editor/property_editor.cpp @@ -403,87 +392,97 @@ msgstr "" #: modules/visual_script/visual_script_nodes.cpp msgid "just pressed" -msgstr "" +msgstr "recién presionado" #: modules/visual_script/visual_script_nodes.cpp msgid "just released" -msgstr "" +msgstr "recién soltado" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" +"No se pudo leer el archivo de certificado. Son tanto la ruta como el " +"password correctos?" -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." -msgstr "Error al escribir el PCK de proyecto!" +msgstr "Error al crear el objeto firma." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." -msgstr "" +msgstr "Error al crear la firma del paquete." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" +"No se encontraron export templates.\n" +"Descargá o instalá export templates." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." -msgstr "" +msgstr "Paquete debug personalizado no encontrado." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." -msgstr "" +msgstr "Paquete release personalizado no encontrado." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid unique name." -msgstr "Nombre inválido." +msgstr "Nombre único inválido." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid product GUID." -msgstr "Tamaño de tipografía inválido." +msgstr "GUID de producto inválido." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." -msgstr "Ruta base inválida" +msgstr "GUID de publisher inválido." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid background color." -msgstr "Origen personalizado de tipografía inválido." +msgstr "Color de fondo inválido." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." msgstr "" +"Dimensiones de la imagen para el Store Logo inválidas (debería ser 50x50)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." msgstr "" +"Dimensiones de la imagen para el logo cuadrado de 44x44 inválidas (debería " +"ser 44x44)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." msgstr "" +"Dimensiones de la imagen para el logo cuadrado de 71x71 inválidas (debería " +"ser 71x71)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." msgstr "" +"Dimensiones de la imagen para el logo cuadrado de 150x150 inválidas (debería " +"ser 150x150)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." msgstr "" +"Dimensiones de la imagen para el logo cuadrado de 310x310 inválidas (debería " +"ser 310x310)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." msgstr "" +"Dimensiones de la imagen para el logo ancho de 310x150 inválidas (debería " +"ser 310x150)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." -msgstr "" +msgstr "Dimensiones de la imagen del splash inválidas (debería ser 620x400)." #: scene/2d/animated_sprite.cpp msgid "" @@ -621,10 +620,6 @@ msgstr "" "VisibilityEnable2D funciona mejor cuando se usa con la raíz de escena " "editada directamente como padre." -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "BakedLightInstance no contiene un recurso BakedLight." - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -671,10 +666,9 @@ msgstr "" "provee datos de navegación." #: scene/3d/remote_transform.cpp -#, fuzzy msgid "Path property must point to a valid Spatial node to work." msgstr "" -"La propiedad Path debe apuntar a un nodo Particles2D valido para funcionar." +"La propiedad Path debe apuntar a un nodo Spatial valido para funcionar." #: scene/3d/scenario_fx.cpp msgid "" @@ -703,7 +697,8 @@ msgstr "" msgid "Cancel" msgstr "Cancelar" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "OK" @@ -1449,6 +1444,8 @@ msgid "" "Target method not found! Specify a valid method or attach a script to target " "Node." msgstr "" +"El método objetivo no fue encontrado! Especificá un método válido o agregá " +"un script al Nodo objetivo." #: tools/editor/connections_dialog.cpp msgid "Connect To Node:" @@ -1826,7 +1823,7 @@ msgstr "EscanearFuentes" #: tools/editor/editor_help.cpp tools/editor/plugins/script_editor_plugin.cpp msgid "Search Help" -msgstr "Ayuda de Búsqueda" +msgstr "Buscar en la Ayuda" #: tools/editor/editor_help.cpp msgid "Class List:" @@ -1866,6 +1863,11 @@ msgid "Constants:" msgstr "Constantes:" #: tools/editor/editor_help.cpp +#, fuzzy +msgid "Property Description:" +msgstr "Descripción Breve:" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "Descripción de Métodos:" @@ -1933,7 +1935,9 @@ msgstr "Error al guardar el recurso!" msgid "Save Resource As.." msgstr "Guardar Recurso Como.." -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "Ya Veo.." @@ -2171,7 +2175,9 @@ msgstr "Abrir el Gestor de Proyectos? (Los cambios sin guardar se perderán)" msgid "Pick a Main Scene" msgstr "Elegí una Escena Principal" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "Ugh" @@ -2493,9 +2499,8 @@ msgid "Editor Layout" msgstr "Layout del Editor" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Toggle Fullscreen" -msgstr "Modo Pantalla Completa" +msgstr "Act./Desact. Pantalla Completa" #: tools/editor/editor_node.cpp msgid "Install Export Templates" @@ -2523,7 +2528,7 @@ msgstr "Actualizar Cambios" #: tools/editor/editor_node.cpp msgid "Disable Update Spinner" -msgstr "" +msgstr "Desactivar Update Spinner" #: tools/editor/editor_node.cpp msgid "Inspector" @@ -2878,6 +2883,7 @@ msgstr "Textura(s) de Origen:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "Ruta de Destino:" @@ -3109,6 +3115,10 @@ msgid "Auto" msgstr "Auto" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +msgid "Root Node Name:" +msgstr "Nombre del Nodo Raíz:" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "Los Siguientes Archivos estan Faltando:" @@ -3955,9 +3965,8 @@ msgid "Clear Bones" msgstr "Reestablecer Huesos" #: tools/editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Show Bones" -msgstr "Crear Huesos" +msgstr "Mostrar Huesos" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Make IK Chain" @@ -4020,6 +4029,51 @@ msgstr "Setear un Valor" msgid "Snap (Pixels):" msgstr "Snap (Pixeles):" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "Agregar %s" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "Agregando %s..." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "Crear Nodo" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "Error al instanciar escena desde %s" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "OK :(" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "No hay padre al que instanciarle un hijo." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "Esta operación requiere un solo nodo seleccionado." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Change default type" +msgstr "Cambiar typo por defecto" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" +"Drag & drop + Shift : Agregar nodo como hermano\n" +"Drag & drop + Alt : Cambiar tipo de nodo" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4699,9 +4753,8 @@ msgid "Close Docs" msgstr "Cerrar Docs" #: tools/editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Close All" -msgstr "Cerrar" +msgstr "Cerrar Todos" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/plugins/script_text_editor.cpp @@ -4816,9 +4869,8 @@ msgstr "" "pertenecen esta cargada" #: tools/editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Pick Color" -msgstr "Color" +msgstr "Elegir Color" #: tools/editor/plugins/script_text_editor.cpp tools/editor/scene_tree_dock.cpp msgid "Move Up" @@ -4891,18 +4943,6 @@ msgstr "Ir a Línea.." msgid "Contextual Help" msgstr "Ayuda Contextual" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "Vértice" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "Fragmento" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "Iluminación" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "Cambiar Constante Escalar" @@ -5196,9 +5236,8 @@ msgid "Insert Animation Key" msgstr "Insertar Clave de Animación" #: tools/editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Focus Origin" -msgstr "Ver Origen" +msgstr "Foco en Origen" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Focus Selection" @@ -5466,9 +5505,8 @@ msgid "Remove Item" msgstr "Remover Item" #: tools/editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Theme" -msgstr "Guardar Tema" +msgstr "Tema" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Add Class Items" @@ -5667,6 +5705,71 @@ msgid "No exporter for platform '%s' yet." msgstr "No hay exportador para la plataforma '%s' aun." #: tools/editor/project_export.cpp +#, fuzzy +msgid "Create Android keystore" +msgstr "Crear Nuevo Recurso" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Full name" +msgstr "Nombre válido" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Organization" +msgstr "Transición" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "State" +msgstr "Estado:" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Password" +msgstr "Contraseña:" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "at least 6 characters" +msgstr "Caracteres válidos:" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "File name" +msgstr "Nuevo nombre:" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "Incluir" @@ -6134,10 +6237,6 @@ msgid "Erase Input Action Event" msgstr "Borrar Evento de Acción de Entrada" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "Act/Desact. Persistente" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "Error al guardar los ajustes." @@ -6281,7 +6380,7 @@ msgstr "Archivo.." msgid "Dir.." msgstr "Dir.." -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "Cargar" @@ -6290,9 +6389,8 @@ msgid "Assign" msgstr "Asignar" #: tools/editor/property_editor.cpp -#, fuzzy msgid "New Script" -msgstr "Script siguiente" +msgstr "Nuevo Script" #: tools/editor/property_editor.cpp msgid "Error loading file: Not a resource!" @@ -6315,10 +6413,6 @@ msgid "Properties:" msgstr "Propiedades:" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "Global" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "Selecciones:" @@ -6396,14 +6490,6 @@ msgid "Scene Run Settings" msgstr "Ajustes de Ejecución de Escena" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "OK :(" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "No hay padre al que instanciarle un hijo." - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "No hay padre donde instanciar la escena." @@ -6412,10 +6498,6 @@ msgid "Error loading scene from %s" msgstr "Error al cargar escena desde %s" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "Error al instanciar escena desde %s" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "Ok" @@ -6456,10 +6538,6 @@ msgid "This operation can't be done without a scene." msgstr "Esta operación no puede hacerse sin una escena." #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "Esta operación requiere un solo nodo seleccionado." - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "Esta operación no puede ser realizada en escenas instanciadas." @@ -6485,10 +6563,6 @@ msgid "Remove Node(s)" msgstr "Quitar Nodo(s)" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "Crear Nodo" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6529,8 +6603,12 @@ msgid "Change Type" msgstr "Cambiar Tipo" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" -msgstr "Agregar Script" +msgid "Attach Script" +msgstr "Adjuntar Script" + +#: tools/editor/scene_tree_dock.cpp +msgid "Clear Script" +msgstr "Reestablecer Script" #: tools/editor/scene_tree_dock.cpp msgid "Merge From Scene" @@ -6557,16 +6635,12 @@ msgstr "" "existe ningún nodo raíz." #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." -msgstr "Crear un nuevo script para el nodo seleccionado." +msgid "Attach a new or existing script for the selected node." +msgstr "Adjuntar un script nuevo o existente para el nodo seleccionado." -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." -msgstr "" -"Este item no puede hacerse visible porque el padre esta oculto. Desocultá el " -"padre primero." +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." +msgstr "Reestablecer un script para el nodo seleccionado." #: tools/editor/scene_tree_editor.cpp msgid "Toggle Spatial Visible" @@ -6661,6 +6735,10 @@ msgid "Could not create script in filesystem." msgstr "No se puede crear el script en el sistema de archivos." #: tools/editor/script_create_dialog.cpp +msgid "Error loading script from %s" +msgstr "Error al cargar el script desde %s" + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "La ruta está vacia" @@ -6673,16 +6751,16 @@ msgid "Invalid base path" msgstr "Ruta base inválida" #: tools/editor/script_create_dialog.cpp -msgid "File exists" -msgstr "El archivo existe" - -#: tools/editor/script_create_dialog.cpp msgid "Invalid extension" msgstr "Extensión invalida" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" -msgstr "Ruta inválida" +msgid "Create new script" +msgstr "Crear script nuevo" + +#: tools/editor/script_create_dialog.cpp +msgid "Load existing script" +msgstr "Cargar script existente" #: tools/editor/script_create_dialog.cpp msgid "Class Name:" @@ -6693,8 +6771,8 @@ msgid "Built-In Script" msgstr "Script Integrado (Built-In)" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" -msgstr "Crear Script de Nodo" +msgid "Attach Node Script" +msgstr "Adjuntar Script de Nodo" #: tools/editor/script_editor_debugger.cpp msgid "Bytes:" @@ -6860,6 +6938,49 @@ msgstr "Cambiar Largo de Shape Rayo" msgid "Change Notifier Extents" msgstr "Cambiar Alcances de Notificadores" +#: tools/editor/spatial_editor_gizmos.cpp +#, fuzzy +msgid "Change Probe Extents" +msgstr "Cambiar Alcances de Notificadores" + +#~ msgid "BakedLightInstance does not contain a BakedLight resource." +#~ msgstr "BakedLightInstance no contiene un recurso BakedLight." + +#~ msgid "Vertex" +#~ msgstr "Vértice" + +#~ msgid "Fragment" +#~ msgstr "Fragmento" + +#~ msgid "Lighting" +#~ msgstr "Iluminación" + +#~ msgid "Toggle Persisting" +#~ msgstr "Act/Desact. Persistente" + +#~ msgid "Global" +#~ msgstr "Global" + +#~ msgid "" +#~ "This item cannot be made visible because the parent is hidden. Unhide the " +#~ "parent first." +#~ msgstr "" +#~ "Este item no puede hacerse visible porque el padre esta oculto. Desocultá " +#~ "el padre primero." + +#~ msgid "" +#~ "Paths cannot start with '/', absolute paths must start with 'res://', " +#~ "'user://', or 'local://'" +#~ msgstr "" +#~ "Las rutas no pueden comenzar con '/', las rutas absolutas deben comenzar " +#~ "con 'res://', 'user://'. o 'local://'" + +#~ msgid "File exists" +#~ msgstr "El archivo existe" + +#~ msgid "Valid path" +#~ msgstr "Ruta inválida" + #~ msgid "" #~ "Custom node has no _get_output_port_unsequenced(idx,wmem), but " #~ "unsequenced ports were specified." diff --git a/tools/translations/extract.py b/tools/translations/extract.py index bd6f03237b..1192c19011 100755 --- a/tools/translations/extract.py +++ b/tools/translations/extract.py @@ -38,7 +38,7 @@ unique_str = [] unique_loc = {} main_po = """ # LANGUAGE translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. diff --git a/tools/translations/fa.po b/tools/translations/fa.po index 290c4a6309..8e29cda45f 100644 --- a/tools/translations/fa.po +++ b/tools/translations/fa.po @@ -1,5 +1,5 @@ # Persian translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # # alabd14313 <alabd14313@yahoo.com>, 2016. @@ -38,12 +38,6 @@ msgid "step argument is zero!" msgstr "آرگومان step صفر است!" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp #, fuzzy msgid "Not a script with an instance" msgstr "اسکریپتی با یک نمونه نیست ." @@ -409,76 +403,76 @@ msgstr "" msgid "just released" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid unique name." msgstr "نام نامعتبر." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid product GUID." msgstr "اندازهی قلم نامعتبر." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid background color." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" @@ -619,10 +613,6 @@ msgstr "" "VisibilityEnable2D زمانی بهتر کار میکند که در یک ریشهی صحنهی ویرایش شده به " "صورت پدر (parent) استفاده شود." -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "BakedLightInstance محتوی یک منبع BakedLight نیست." - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -701,7 +691,8 @@ msgstr "" msgid "Cancel" msgstr "لغو" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "موافقت" @@ -1863,6 +1854,11 @@ msgid "Constants:" msgstr "" #: tools/editor/editor_help.cpp +#, fuzzy +msgid "Property Description:" +msgstr "خلاصه توضیحات:" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "" @@ -1930,7 +1926,9 @@ msgstr "" msgid "Save Resource As.." msgstr "ذخیره منبع از ..." -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "من میبینم ..." @@ -2155,7 +2153,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "" @@ -2836,6 +2836,7 @@ msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "" @@ -3065,6 +3066,10 @@ msgid "Auto" msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +msgid "Root Node Name:" +msgstr "" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "" @@ -3964,6 +3969,50 @@ msgstr "" msgid "Snap (Pixels):" msgstr "" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Change default type" +msgstr "نوع مقدار آرایه را تغییر بده" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4829,18 +4878,6 @@ msgstr "" msgid "Contextual Help" msgstr "" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "" @@ -5603,6 +5640,69 @@ msgid "No exporter for platform '%s' yet." msgstr "" #: tools/editor/project_export.cpp +#, fuzzy +msgid "Create Android keystore" +msgstr "پوشه ایجاد کن" + +#: tools/editor/project_export.cpp +msgid "Full name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Organization" +msgstr "انتقال" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "State" +msgstr "وضعیت:" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Password" +msgstr "گذرواژه:" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "at least 6 characters" +msgstr "کاراکترهای معتبر:" + +#: tools/editor/project_export.cpp +msgid "File name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "" @@ -6064,10 +6164,6 @@ msgid "Erase Input Action Event" msgstr "" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "" @@ -6211,7 +6307,7 @@ msgstr "" msgid "Dir.." msgstr "" -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "" @@ -6245,10 +6341,6 @@ msgid "Properties:" msgstr "" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "" @@ -6327,14 +6419,6 @@ msgid "Scene Run Settings" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "" @@ -6343,10 +6427,6 @@ msgid "Error loading scene from %s" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "" @@ -6385,10 +6465,6 @@ msgid "This operation can't be done without a scene." msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "" @@ -6413,10 +6489,6 @@ msgid "Remove Node(s)" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6455,8 +6527,14 @@ msgid "Change Type" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" -msgstr "" +#, fuzzy +msgid "Attach Script" +msgstr "صحنه جدید" + +#: tools/editor/scene_tree_dock.cpp +#, fuzzy +msgid "Clear Script" +msgstr "صحنه جدید" #: tools/editor/scene_tree_dock.cpp msgid "Merge From Scene" @@ -6481,13 +6559,11 @@ msgid "" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." +msgid "Attach a new or existing script for the selected node." msgstr "" -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." msgstr "" #: tools/editor/scene_tree_editor.cpp @@ -6583,6 +6659,11 @@ msgid "Could not create script in filesystem." msgstr "" #: tools/editor/script_create_dialog.cpp +#, fuzzy +msgid "Error loading script from %s" +msgstr "خطای بارگذاری قلم." + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "" @@ -6595,15 +6676,16 @@ msgid "Invalid base path" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "File exists" +msgid "Invalid extension" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Invalid extension" -msgstr "" +#, fuzzy +msgid "Create new script" +msgstr "جدید ایجاد کن" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" +msgid "Load existing script" msgstr "" #: tools/editor/script_create_dialog.cpp @@ -6615,8 +6697,9 @@ msgid "Built-In Script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" -msgstr "" +#, fuzzy +msgid "Attach Node Script" +msgstr "صحنه جدید" #: tools/editor/script_editor_debugger.cpp msgid "Bytes:" @@ -6782,6 +6865,13 @@ msgstr "" msgid "Change Notifier Extents" msgstr "" +#: tools/editor/spatial_editor_gizmos.cpp +msgid "Change Probe Extents" +msgstr "" + +#~ msgid "BakedLightInstance does not contain a BakedLight resource." +#~ msgstr "BakedLightInstance محتوی یک منبع BakedLight نیست." + #~ msgid "" #~ "Custom node has no _get_output_port_unsequenced(idx,wmem), but " #~ "unsequenced ports were specified." diff --git a/tools/translations/fr.po b/tools/translations/fr.po index 94d43d12ba..10f82e2840 100644 --- a/tools/translations/fr.po +++ b/tools/translations/fr.po @@ -1,12 +1,15 @@ # French translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # +# Brice <bbric@free.fr>, 2016. # Chenebel Dorian <LoubiTek54@gmail.com>, 2016. # derderder77 <derderder77380@gmail.com>, 2016. # finkiki <specialpopol@gmx.fr>, 2016. # Hugo Locurcio <hugo.l@openmailbox.org>, 2016. # Marc <marc.gilleron@gmail.com>, 2016. +# Nicolas Lehuen <nicolas@lehuen.com>, 2016. +# Omicron <tritonic.dev@gmail.com>, 2016. # Onyx Steinheim <thevoxelmanonyx@gmail.com>, 2016. # rafeu <duchainer@gmail.com>, 2016. # Rémi Verschelde <rverschelde@gmail.com>, 2016. @@ -17,8 +20,8 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2016-09-03 09:11+0000\n" -"Last-Translator: Thomas Baijot <thomasbaijot@gmail.com>\n" +"PO-Revision-Date: 2016-12-15 22:36+0000\n" +"Last-Translator: Nicolas Lehuen <nicolas@lehuen.com>\n" "Language-Team: French <https://hosted.weblate.org/projects/godot-engine/" "godot/fr/>\n" "Language: fr\n" @@ -26,7 +29,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 2.8\n" +"X-Generator: Weblate 2.10\n" #: modules/gdscript/gd_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -43,12 +46,6 @@ msgid "step argument is zero!" msgstr "L'argument du pas est zéro!" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" msgstr "N'est pas un script avec une instance" @@ -91,24 +88,30 @@ msgid "" "Node yielded, but did not return a function state in the first working " "memory." msgstr "" +"Le nœud a été produit mais il n'a pas retourné un état de fonction dans la " +"première mémoire de travail." #: modules/visual_script/visual_script.cpp msgid "" "Return value must be assigned to first element of node working memory! Fix " "your node please." msgstr "" +"Une valeur de retour doit être assignée au premier élément de la mémoire de " +"travail du nœud! Veuillez corriger votre nœud." #: modules/visual_script/visual_script.cpp msgid "Node returned an invalid sequence output: " -msgstr "Le nœud a retourné une séquence de sortie invalide " +msgstr "Le nœud a retourné une séquence de sortie invalide: " #: modules/visual_script/visual_script.cpp msgid "Found sequence bit but not the node in the stack, report bug!" msgstr "" +"Une séquence d'octets a été trouvée mais pas le nœud dans la pile, signalez " +"le bug!" #: modules/visual_script/visual_script.cpp msgid "Stack overflow with stack depth: " -msgstr "" +msgstr "Débordement de pile avec profondeur de pile: " #: modules/visual_script/visual_script_editor.cpp msgid "Functions:" @@ -123,9 +126,8 @@ msgid "Signals:" msgstr "Signaux :" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Name is not a valid identifier:" -msgstr "Le nom n'est pas un identifiant valide" +msgstr "Le nom n'est pas un identifiant valide:" #: modules/visual_script/visual_script_editor.cpp msgid "Name already in use by another func/var/signal:" @@ -164,23 +166,20 @@ msgid "Remove Variable" msgstr "Supprimer la variable" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Editing Variable:" -msgstr "Variable" +msgstr "Éditer la variable:" #: modules/visual_script/visual_script_editor.cpp msgid "Remove Signal" msgstr "Supprimer le signal" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Editing Signal:" -msgstr "Connecter un signal :" +msgstr "Éditer le signal :" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Change Expression" -msgstr "Changer le type" +msgstr "Changer l'expression" #: modules/visual_script/visual_script_editor.cpp msgid "Add Node" @@ -189,31 +188,34 @@ msgstr "Ajouter un nœud" #: modules/visual_script/visual_script_editor.cpp msgid "Hold Meta to drop a Getter. Hold Shift to drop a generic signature." msgstr "" +"Maintenir Meta pour déposer un accesseur. Maintenir Maj pour déposer une " +"signature générique." #: modules/visual_script/visual_script_editor.cpp msgid "Hold Ctrl to drop a Getter. Hold Shift to drop a generic signature." msgstr "" +"Maintenir Ctrl pour déposer un accesseur. Maintenir Maj pour déposer une " +"signature générique." #: modules/visual_script/visual_script_editor.cpp msgid "Hold Meta to drop a simple reference to the node." -msgstr "" +msgstr "Maintenir Meta pour déposer une référence simple au nœud." #: modules/visual_script/visual_script_editor.cpp msgid "Hold Ctrl to drop a simple reference to the node." -msgstr "" +msgstr "Maintenir Ctrl pour déposer une référence simple au nœud." #: modules/visual_script/visual_script_editor.cpp msgid "Hold Meta to drop a Variable Setter." -msgstr "" +msgstr "Maintenir Meta pour déposer un mutateur de variable." #: modules/visual_script/visual_script_editor.cpp msgid "Hold Ctrl to drop a Variable Setter." -msgstr "" +msgstr "Maintenir Ctrl pour déposer un mutateur de variable." #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Add Preload Node" -msgstr "Ajouter un nœud enfant" +msgstr "Ajouter un nœud 'preload'" #: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" @@ -221,47 +223,43 @@ msgstr "Ajouter un nœud à partir de l'arbre" #: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" -msgstr "" +msgstr "Ajouter une propriété accesseur" #: modules/visual_script/visual_script_editor.cpp msgid "Add Setter Property" -msgstr "" +msgstr "Ajouter une propriété mutateur" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Condition" -msgstr "Copier l'animation" +msgstr "Condition" #: modules/visual_script/visual_script_editor.cpp msgid "Sequence" -msgstr "" +msgstr "Séquence" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Switch" -msgstr "Hauteur" +msgstr "Switch" #: modules/visual_script/visual_script_editor.cpp msgid "Iterator" -msgstr "" +msgstr "Itérateur" #: modules/visual_script/visual_script_editor.cpp msgid "While" -msgstr "" +msgstr "Tant que" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Return" -msgstr "Retourne :" +msgstr "Retour" #: modules/visual_script/visual_script_editor.cpp tools/editor/call_dialog.cpp msgid "Call" msgstr "Appel" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Get" -msgstr "Définir" +msgstr "Récupérer" #: modules/visual_script/visual_script_editor.cpp #: tools/editor/property_editor.cpp @@ -308,11 +306,11 @@ msgstr "Fermer" #: modules/visual_script/visual_script_editor.cpp msgid "Edit Signal Arguments:" -msgstr "Editer les arguments du signal" +msgstr "Éditer les arguments du signal:" #: modules/visual_script/visual_script_editor.cpp msgid "Edit Variable:" -msgstr "Editer la variable" +msgstr "Éditer la variable:" #: modules/visual_script/visual_script_editor.cpp msgid "Change" @@ -328,28 +326,24 @@ msgid "Toggle Breakpoint" msgstr "Placer un point d'arrêt" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Find Node Type" -msgstr "Trouver le type du noeud" +msgstr "Trouver le type du nœud" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Copy Nodes" -msgstr "Copier la pose" +msgstr "Copier les nœuds" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Cut Nodes" -msgstr "Créer un nœud" +msgstr "Couper les nœuds" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Paste Nodes" -msgstr "Coller la pose" +msgstr "Coller les nœuds" #: modules/visual_script/visual_script_flow_control.cpp msgid "Input type not iterable: " -msgstr "" +msgstr "Type d'entrée non itérable: " #: modules/visual_script/visual_script_flow_control.cpp msgid "Iterator became invalid" @@ -360,9 +354,8 @@ msgid "Iterator became invalid: " msgstr "L'itérateur est devenu invalide " #: modules/visual_script/visual_script_func_nodes.cpp -#, fuzzy msgid "Invalid index property name." -msgstr "Nom de classe parent invalide" +msgstr "Indice de nom de propriété invalide." #: modules/visual_script/visual_script_func_nodes.cpp msgid "Base object is not a Node!" @@ -377,9 +370,8 @@ msgid "Invalid index property name '%s' in node %s." msgstr "Nom de propriété invalide '%s' dans le nœud %s." #: modules/visual_script/visual_script_nodes.cpp -#, fuzzy msgid ": Invalid argument of type: " -msgstr "Nom de classe parent invalide" +msgstr ": Argument invalide de type: " #: modules/visual_script/visual_script_nodes.cpp msgid ": Invalid arguments: " @@ -396,96 +388,105 @@ msgstr "VariableSet introuvable dans le script: " #: modules/visual_script/visual_script_nodes.cpp msgid "Custom node has no _step() method, can't process graph." msgstr "" +"Le nœud personnalisé n'a pas de méthode _step(), le graph ne peut pas être " +"traité." #: modules/visual_script/visual_script_nodes.cpp msgid "" "Invalid return value from _step(), must be integer (seq out), or string " "(error)." msgstr "" +"La valeur retournée par _step() est invalide, elle doit être un entier (seq " +"out), ou une chaîne (erreur)." #: modules/visual_script/visual_script_nodes.cpp msgid "just pressed" -msgstr "" +msgstr "seulement pressé" #: modules/visual_script/visual_script_nodes.cpp msgid "just released" -msgstr "" +msgstr "seulement relâché" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" +"Le fichier certificat ne pourrait pas être lu. Les chemin et mot de passe " +"sont t-ils tous deux corrects ?" -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." -msgstr "Erreur d'écriture du PCK du projet !" +msgstr "Erreur en créant la signature de l'objet." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." -msgstr "" +msgstr "Erreur en créant la signature du paquet." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" +"Aucun modèle d'export n'a été trouvé.\n" +"Téléchargez et installez des modèles d'export." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." -msgstr "" +msgstr "Le paquet personnalisé de débogage n'a pas été trouvé." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." -msgstr "" +msgstr "Le paquet personnalisé de parution n'a pas été trouvé." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid unique name." -msgstr "Nom invalide." +msgstr "Nom unique invalide." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid product GUID." -msgstr "Taille de police invalide." +msgstr "GUID de produit invalide." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." -msgstr "Chemin de base invalide" +msgstr "GUID d'éditeur invalide." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid background color." -msgstr "Source personnalisée de police invalide." +msgstr "Couleur d'arrière-plan invalide." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." -msgstr "" +msgstr "Dimensions d'image de logo magasin invalides (devraient être 50x50)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." msgstr "" +"Dimensions d'image de logo carré 44x44 invalides (devraient être 44x44)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." msgstr "" +"Dimensions d'image de logo carré 71x71 invalides (devraient être 71x71)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." msgstr "" +"Dimensions d'image de logo carré 150x150 invalides (devraient être 150x150)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." msgstr "" +"Dimensions d'image de logo carré 310x310 invalides (devraient être 310x310)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." msgstr "" +"Dimensions d'image de logo large 310x150 invalides (devraient être 310x150)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" +"Dimensions d'image d'écran de démarrage invalides (devraient être 620x300)." #: scene/2d/animated_sprite.cpp msgid "" @@ -630,10 +631,6 @@ msgstr "" "Un VisibilityEnable2D fonctionne mieux lorsqu'il est directement enfant du " "nœud racine de la scène." -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "La BakedLightInstance ne contient pas de ressource BakedLight." - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -679,11 +676,9 @@ msgstr "" "Navigation. Il fournit uniquement des données de navigation." #: scene/3d/remote_transform.cpp -#, fuzzy msgid "Path property must point to a valid Spatial node to work." msgstr "" -"La propriété Path doit pointer à un nœud de type Particles2D valide pour " -"fonctionner." +"La propriété Path doit pointer vers un nœud Spatial valide pour fonctionner." #: scene/3d/scenario_fx.cpp msgid "" @@ -712,7 +707,8 @@ msgstr "" msgid "Cancel" msgstr "Annuler" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "OK" @@ -823,7 +819,7 @@ msgstr "Alt+" #: scene/gui/input_action.cpp msgid "Ctrl+" -msgstr "Contrôle+" +msgstr "Ctrl+" #: scene/gui/input_action.cpp tools/editor/project_settings.cpp #: tools/editor/settings_config_dialog.cpp @@ -1030,7 +1026,7 @@ msgstr "Dupliquer la sélection" #: tools/editor/animation_editor.cpp msgid "Duplicate Transposed" -msgstr "" +msgstr "Double transposé" #: tools/editor/animation_editor.cpp msgid "Remove Selection" @@ -1233,6 +1229,8 @@ msgstr "Optimiser" #: tools/editor/animation_editor.cpp msgid "Select an AnimationPlayer from the Scene Tree to edit animations." msgstr "" +"Sélectionnez un AnimationPlayer de l'arbre de scène pour éditer les " +"animations." #: tools/editor/animation_editor.cpp msgid "Key" @@ -1458,6 +1456,8 @@ msgid "" "Target method not found! Specify a valid method or attach a script to target " "Node." msgstr "" +"La méthode cible n'a pas été trouvée! Spécifiez une méthode valide ou " +"attachez un script au nœud cible." #: tools/editor/connections_dialog.cpp msgid "Connect To Node:" @@ -1516,7 +1516,7 @@ msgstr "Connecter un signal :" #: tools/editor/connections_dialog.cpp msgid "Create Subscription" -msgstr "" +msgstr "Créer une souscription" #: tools/editor/connections_dialog.cpp msgid "Connect.." @@ -1818,9 +1818,8 @@ msgid "Toggle Mode" msgstr "Basculer le mode" #: tools/editor/editor_file_dialog.cpp -#, fuzzy msgid "Focus Path" -msgstr "Copier le chemin" +msgstr "Focaliser le chemin" #: tools/editor/editor_file_dialog.cpp msgid "Move Favorite Up" @@ -1880,6 +1879,11 @@ msgid "Constants:" msgstr "Constantes :" #: tools/editor/editor_help.cpp +#, fuzzy +msgid "Property Description:" +msgstr "Brève description :" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "Description de la méthode :" @@ -1948,7 +1952,9 @@ msgstr "Erreur d'enregistrement de la ressource !" msgid "Save Resource As.." msgstr "Enregistrer la ressource sous…" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "Je vois…" @@ -2190,7 +2196,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "Choisir une scène principale" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "Oups" @@ -2452,12 +2460,11 @@ msgid "Visible Collision Shapes" msgstr "Formes de collision visibles" #: tools/editor/editor_node.cpp -#, fuzzy msgid "" "Collision shapes and raycast nodes (for 2D and 3D) will be visible on the " "running game if this option is turned on." msgstr "" -"Les formes de collision et les noeuds de raycast (pour 2D et 3D) seront " +"Les formes de collision et les nœuds de raycast (pour 2D et 3D) seront " "visibles en jeu si cette option est activée." #: tools/editor/editor_node.cpp @@ -2519,9 +2526,8 @@ msgid "Editor Layout" msgstr "Disposition de l'éditeur" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Toggle Fullscreen" -msgstr "Mode plein écran" +msgstr "Basculer le mode plein écran" #: tools/editor/editor_node.cpp msgid "Install Export Templates" @@ -2908,6 +2914,7 @@ msgstr "Texture(s) source :" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "Chemin de destination :" @@ -3141,6 +3148,11 @@ msgid "Auto" msgstr "Auto." #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +#, fuzzy +msgid "Root Node Name:" +msgstr "Nom de nœud :" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "Les fichiers suivants sont manquants :" @@ -3176,9 +3188,8 @@ msgid "Couldn't load post-import script:" msgstr "Impossible de charger le script de post-importation :" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp -#, fuzzy msgid "Invalid/broken script for post-import (check console):" -msgstr "Script de post-importation invalide ou cassé :" +msgstr "Script de post-importation invalide ou cassé (vérifiez la console):" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Error running post-import script:" @@ -3548,9 +3559,8 @@ msgid "Play selected animation from start. (Shift+D)" msgstr "Lire l'animation sélectionnée depuis le début. (Maj + D)" #: tools/editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Play selected animation from current pos. (D)" -msgstr "Lire l'animation sélectionnée à sa position actuelle. (D)" +msgstr "Lire l'animation sélectionnée depuis la position actuelle. (D)" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Animation position (in seconds)." @@ -3709,11 +3719,11 @@ msgstr "Ajouter une entrée" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Clear Auto-Advance" -msgstr "" +msgstr "Réinitialiser la progression automatique" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Set Auto-Advance" -msgstr "" +msgstr "Définir la progression automatique" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Delete Input" @@ -3741,7 +3751,7 @@ msgstr "Nœud one-shot" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Mix Node" -msgstr "" +msgstr "Mélanger le nœud" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Blend2 Node" @@ -3868,7 +3878,7 @@ msgstr "Déplacer le pivot" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Move Action" -msgstr "" +msgstr "Déplacer l'action" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Edit IK Chain" @@ -3891,9 +3901,8 @@ msgid "Paste Pose" msgstr "Coller la pose" #: tools/editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Select Mode" -msgstr "Mode sélection (Q)" +msgstr "Sélectionner le mode" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Drag: Rotate" @@ -3914,9 +3923,8 @@ msgid "Alt+RMB: Depth list selection" msgstr "Alt + Bouton droit : sélection détaillée par liste" #: tools/editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Move Mode" -msgstr "Move déplacement (W)" +msgstr "Mode déplacement" #: tools/editor/plugins/canvas_item_editor_plugin.cpp #, fuzzy @@ -4000,9 +4008,8 @@ msgid "Clear Bones" msgstr "Effacer les os" #: tools/editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Show Bones" -msgstr "Créer les os" +msgstr "Afficher les os" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Make IK Chain" @@ -4038,9 +4045,8 @@ msgid "Anchor" msgstr "Ancre" #: tools/editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Insert Keys" -msgstr "Animation Inserer une clé" +msgstr "Insérer des clefs" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Insert Key" @@ -4066,6 +4072,53 @@ msgstr "Définir une valeur" msgid "Snap (Pixels):" msgstr "Aligner (pixels) :" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Add %s" +msgstr "Tout ajouter" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "Créer un nœud" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "Erreur d'instanciation de la scène depuis %s" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "OK :(" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "Pas de parent dans lequel instancier l'enfant." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "" +"Cette opération ne peut être réalisée uniquement avec un seul nœud " +"sélectionné." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Change default type" +msgstr "Changer la valeur par défaut" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4364,7 +4417,7 @@ msgstr "Créer un polygone de navigation" #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp msgid "Remove Poly And Point" -msgstr "" +msgstr "Supprimer le polygone et le point" #: tools/editor/plugins/particles_2d_editor_plugin.cpp msgid "Error loading image:" @@ -4388,7 +4441,7 @@ msgstr "Charger le masque d'émission" #: tools/editor/plugins/particles_2d_editor_plugin.cpp msgid "Generated Point Count:" -msgstr "" +msgstr "Compte de points générés:" #: tools/editor/plugins/particles_editor_plugin.cpp msgid "Node does not contain geometry." @@ -4693,21 +4746,19 @@ msgstr "Erreur d'importation" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Import Theme" -msgstr "Improter un thème" +msgstr "Importer un thème" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Save Theme As.." msgstr "Enregistrer le thème sous…" #: tools/editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Next script" -msgstr "Créer un script" +msgstr "Script suivant" #: tools/editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Previous script" -msgstr "Répertoire précédent" +msgstr "Script précédent" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/project_export.cpp @@ -4749,14 +4800,12 @@ msgid "Save Theme As" msgstr "Enregistrer le thème sous" #: tools/editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Close Docs" -msgstr "Cloner en dessous" +msgstr "Fermer les documentations" #: tools/editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Close All" -msgstr "Fermer" +msgstr "Fermer tout" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/plugins/script_text_editor.cpp @@ -4871,9 +4920,8 @@ msgstr "" "qui ils appartiennent est ouverte" #: tools/editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Pick Color" -msgstr "Couleur" +msgstr "Prélever une couleur" #: tools/editor/plugins/script_text_editor.cpp tools/editor/scene_tree_dock.cpp msgid "Move Up" @@ -4946,18 +4994,6 @@ msgstr "Aller à la ligne…" msgid "Contextual Help" msgstr "Aide contextuelle" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "Vertex" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "Fragment" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "Éclairage" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "Modifier une constante scalaire" @@ -4988,15 +5024,15 @@ msgstr "Modifier un opérateur RVB" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Toggle Rot Only" -msgstr "" +msgstr "Basculer seulement la rotation" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Function" -msgstr "" +msgstr "Modifier une fonction scalaire" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Vec Function" -msgstr "" +msgstr "Modifier une fonction vecteur" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Uniform" @@ -5048,27 +5084,27 @@ msgstr "Changer le nom de l'entrée" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Connect Graph Nodes" -msgstr "" +msgstr "Connecter les nœuds de graphe" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Disconnect Graph Nodes" -msgstr "" +msgstr "Déconnecter les nœuds de graphe" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Remove Shader Graph Node" -msgstr "" +msgstr "Supprimer le nœud de graphe Shader" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Move Shader Graph Node" -msgstr "" +msgstr "Déplacer le nœud de graphe Shader" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Duplicate Graph Node(s)" -msgstr "" +msgstr "Dupliquer le(s) nœud(s) de graphe" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Delete Shader Graph Node(s)" -msgstr "" +msgstr "Effacer le(s) nœud(s) de graphe Shader" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Error: Cyclic Connection Link" @@ -5080,7 +5116,7 @@ msgstr "Erreur : connexions d'entrée manquantes" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Add Shader Graph Node" -msgstr "" +msgstr "Ajouter un nœud de graphe Shader" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Orthogonal" @@ -5108,7 +5144,7 @@ msgstr "Transformation sur l'axe Z." #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "View Plane Transform." -msgstr "" +msgstr "Transformation du plan de vue." #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Scaling to %s%%." @@ -5219,58 +5255,48 @@ msgid "Scale Mode (R)" msgstr "Mode de mise à l'échelle (R)" #: tools/editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Bottom View" -msgstr "Vue de dessous." +msgstr "Vue de dessous" #: tools/editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Top View" -msgstr "Vue de dessus." +msgstr "Vue de dessus" #: tools/editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Rear View" -msgstr "Vue arrière." +msgstr "Vue arrière" #: tools/editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Front View" -msgstr "Vue avant." +msgstr "Vue avant" #: tools/editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Left View" -msgstr "Vue de gauche." +msgstr "Vue de gauche" #: tools/editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Right View" -msgstr "Vue de droite." +msgstr "Vue de droite" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Switch Perspective/Orthogonal view" msgstr "Basculer entre la vue perspective et orthogonale" #: tools/editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Insert Animation Key" -msgstr "Coller l'animation" +msgstr "Insérer une clef d'animation" #: tools/editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Focus Origin" -msgstr "Afficher l'origine" +msgstr "Focaliser l'origine" #: tools/editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Focus Selection" -msgstr "Mettre à l'échelle la sélection" +msgstr "Focaliser la sélection" #: tools/editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Align Selection With View" -msgstr "Aligner avec la vue" +msgstr "Aligner la sélection avec la vue" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Transform" @@ -5430,7 +5456,7 @@ msgstr "Ajouter vide" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Change Animation Loop" -msgstr "" +msgstr "Modifier la boucle d'animation" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Change Animation FPS" @@ -5473,32 +5499,28 @@ msgid "StyleBox Preview:" msgstr "Aperçu de la StyleBox :" #: tools/editor/plugins/texture_region_editor_plugin.cpp -#, fuzzy msgid "Snap Mode:" -msgstr "Mode d'exécution :" +msgstr "Mode d'aimantation :" #: tools/editor/plugins/texture_region_editor_plugin.cpp msgid "<None>" msgstr "<Aucun>" #: tools/editor/plugins/texture_region_editor_plugin.cpp -#, fuzzy msgid "Pixel Snap" -msgstr "Aligner au pixel près" +msgstr "Aimanter au pixel" #: tools/editor/plugins/texture_region_editor_plugin.cpp -#, fuzzy msgid "Grid Snap" -msgstr "Pas de la grille :" +msgstr "Aimanter à la grille" #: tools/editor/plugins/texture_region_editor_plugin.cpp msgid "Auto Slice" -msgstr "" +msgstr "Coupe automatique" #: tools/editor/plugins/texture_region_editor_plugin.cpp -#, fuzzy msgid "Offset:" -msgstr "Décalage de la grille :" +msgstr "Décalage:" #: tools/editor/plugins/texture_region_editor_plugin.cpp #, fuzzy @@ -5506,14 +5528,12 @@ msgid "Step:" msgstr "Pas (s) :" #: tools/editor/plugins/texture_region_editor_plugin.cpp -#, fuzzy msgid "Separation:" -msgstr "Sections :" +msgstr "Séparation:" #: tools/editor/plugins/texture_region_editor_plugin.cpp -#, fuzzy msgid "Texture Region" -msgstr "Éditeur de région de texture" +msgstr "Région de texture" #: tools/editor/plugins/texture_region_editor_plugin.cpp msgid "Texture Region Editor" @@ -5537,9 +5557,8 @@ msgid "Remove Item" msgstr "Supprimer l'item" #: tools/editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Theme" -msgstr "Enregistrer le thème" +msgstr "Thème" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Add Class Items" @@ -5738,6 +5757,71 @@ msgid "No exporter for platform '%s' yet." msgstr "Pas d'exportateur pour la plate-forme « %s » actuellement." #: tools/editor/project_export.cpp +#, fuzzy +msgid "Create Android keystore" +msgstr "Créer une nouvelle ressource" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Full name" +msgstr "Nom valide" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Organization" +msgstr "Transition" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "State" +msgstr "État :" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Password" +msgstr "Mot de passe :" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "at least 6 characters" +msgstr "Caractères valides :" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "File name" +msgstr "Nouveau nom :" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "Inclure" @@ -6045,9 +6129,8 @@ msgid "Install Project:" msgstr "Projets récents :" #: tools/editor/project_manager.cpp -#, fuzzy msgid "Install" -msgstr "Instance" +msgstr "Installer" #: tools/editor/project_manager.cpp msgid "Browse" @@ -6085,6 +6168,8 @@ msgid "" "You are about the scan %s folders for existing Godot projects. Do you " "confirm?" msgstr "" +"Vous êtes sur le point de scanner les %s de dossiers pour les projets Godot " +"existants. Est-ce que vous confirmez ?" #: tools/editor/project_manager.cpp msgid "Project Manager" @@ -6103,9 +6188,8 @@ msgid "Scan" msgstr "Scanner" #: tools/editor/project_manager.cpp -#, fuzzy msgid "Select a Folder to Scan" -msgstr "Sélectionner un nœud" +msgstr "Sélectionnez un dossier à scanner" #: tools/editor/project_manager.cpp msgid "New Project" @@ -6212,10 +6296,6 @@ msgid "Erase Input Action Event" msgstr "Effacer l'événement d'action d'entrée" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "Mode persistant" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "Erreur d'enregistrement des paramètres." @@ -6359,7 +6439,7 @@ msgstr "Fichier…" msgid "Dir.." msgstr "Répertoire…" -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "Charger" @@ -6368,9 +6448,8 @@ msgid "Assign" msgstr "Assigner" #: tools/editor/property_editor.cpp -#, fuzzy msgid "New Script" -msgstr "Créer un script" +msgstr "Nouveau script" #: tools/editor/property_editor.cpp msgid "Error loading file: Not a resource!" @@ -6393,22 +6472,16 @@ msgid "Properties:" msgstr "Propriétés :" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "Global" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "Sections :" #: tools/editor/property_selector.cpp -#, fuzzy msgid "Select Property" -msgstr "Sélectionner des points" +msgstr "Sélectionnez une propriété" #: tools/editor/property_selector.cpp -#, fuzzy msgid "Select Method" -msgstr "Mode sélection (Q)" +msgstr "Sélectionner une méthode" #: tools/editor/pvrtc_compress.cpp msgid "Could not execute PVRTC tool:" @@ -6417,6 +6490,7 @@ msgstr "Impossible d'exécuter l'outil PVRTC :" #: tools/editor/pvrtc_compress.cpp msgid "Can't load back converted image using PVRTC tool:" msgstr "" +"L'image convertie n'a pas pu être rechargée en utilisant l'outil PVRTC:" #: tools/editor/reparent_dialog.cpp tools/editor/scene_tree_dock.cpp msgid "Reparent Node" @@ -6475,27 +6549,14 @@ msgid "Scene Run Settings" msgstr "Paramètres d'exécution de la scène" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "OK :(" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "Pas de parent dans lequel instancier l'enfant." - -#: tools/editor/scene_tree_dock.cpp -#, fuzzy msgid "No parent to instance the scenes at." -msgstr "Pas de parent dans lequel instancier l'enfant." +msgstr "Aucun parent dans lequel instancier les scènes." #: tools/editor/scene_tree_dock.cpp msgid "Error loading scene from %s" msgstr "Erreur de chargement de la scène depuis %s" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "Erreur d'instanciation de la scène depuis %s" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "OK" @@ -6536,12 +6597,6 @@ msgid "This operation can't be done without a scene." msgstr "Cette opération ne peut être réalisée sans une scène." #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "" -"Cette opération ne peut être réalisée uniquement avec un seul nœud " -"sélectionné." - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "Cette opération ne peut être réalisée sur des scènes instanciées." @@ -6566,10 +6621,6 @@ msgid "Remove Node(s)" msgstr "Supprimer le(s) nœud(s)" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "Créer un nœud" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6610,10 +6661,16 @@ msgid "Change Type" msgstr "Changer le type" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" +#, fuzzy +msgid "Attach Script" msgstr "Ajouter un script" #: tools/editor/scene_tree_dock.cpp +#, fuzzy +msgid "Clear Script" +msgstr "Créer un script" + +#: tools/editor/scene_tree_dock.cpp msgid "Merge From Scene" msgstr "Fusionner depuis la scène" @@ -6622,9 +6679,8 @@ msgid "Save Branch as Scene" msgstr "Sauvegarder la branche comme scène" #: tools/editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete (No Confirm)" -msgstr "Veuillez confirmer…" +msgstr "Effacer (pas de confirmation)" #: tools/editor/scene_tree_dock.cpp msgid "Add/Create a New Node" @@ -6640,16 +6696,13 @@ msgstr "" #: tools/editor/scene_tree_dock.cpp #, fuzzy -msgid "Create a new script for the selected node." -msgstr "Instancie la/les scènes sélectionnées en tant qu'enfant du nœud." +msgid "Attach a new or existing script for the selected node." +msgstr "Créer un nouveau script pour le nœud sélectionné." -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." -msgstr "" -"Cet objet ne peut être rendu visible car son parent est caché. Affichez le " -"parent d'abord." +#: tools/editor/scene_tree_dock.cpp +#, fuzzy +msgid "Clear a script for the selected node." +msgstr "Créer un nouveau script pour le nœud sélectionné." #: tools/editor/scene_tree_editor.cpp msgid "Toggle Spatial Visible" @@ -6744,6 +6797,11 @@ msgid "Could not create script in filesystem." msgstr "Impossible de créer le script dans le système de fichiers." #: tools/editor/script_create_dialog.cpp +#, fuzzy +msgid "Error loading script from %s" +msgstr "Erreur de chargement de la scène depuis %s" + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "Le chemin est vide" @@ -6756,16 +6814,18 @@ msgid "Invalid base path" msgstr "Chemin de base invalide" #: tools/editor/script_create_dialog.cpp -msgid "File exists" -msgstr "Le fichier existe" - -#: tools/editor/script_create_dialog.cpp msgid "Invalid extension" msgstr "Extension invalide" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" -msgstr "Chemin valide" +#, fuzzy +msgid "Create new script" +msgstr "Créer un script" + +#: tools/editor/script_create_dialog.cpp +#, fuzzy +msgid "Load existing script" +msgstr "Script suivant" #: tools/editor/script_create_dialog.cpp msgid "Class Name:" @@ -6776,7 +6836,8 @@ msgid "Built-In Script" msgstr "Script intégré" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" +#, fuzzy +msgid "Attach Node Script" msgstr "Créer le script de nœud" #: tools/editor/script_editor_debugger.cpp @@ -6943,6 +7004,49 @@ msgstr "Changer la longueur d'une forme en rayon" msgid "Change Notifier Extents" msgstr "Changer les extents d'un notificateur" +#: tools/editor/spatial_editor_gizmos.cpp +#, fuzzy +msgid "Change Probe Extents" +msgstr "Changer les extents d'un notificateur" + +#~ msgid "BakedLightInstance does not contain a BakedLight resource." +#~ msgstr "La BakedLightInstance ne contient pas de ressource BakedLight." + +#~ msgid "Vertex" +#~ msgstr "Vertex" + +#~ msgid "Fragment" +#~ msgstr "Fragment" + +#~ msgid "Lighting" +#~ msgstr "Éclairage" + +#~ msgid "Toggle Persisting" +#~ msgstr "Mode persistant" + +#~ msgid "Global" +#~ msgstr "Global" + +#~ msgid "" +#~ "This item cannot be made visible because the parent is hidden. Unhide the " +#~ "parent first." +#~ msgstr "" +#~ "Cet objet ne peut être rendu visible car son parent est caché. Affichez " +#~ "le parent d'abord." + +#~ msgid "" +#~ "Paths cannot start with '/', absolute paths must start with 'res://', " +#~ "'user://', or 'local://'" +#~ msgstr "" +#~ "Les chemins ne peuvent pas commencer par '/', les chemins absolus doivent " +#~ "commencer par 'res://', 'user://' ou 'local://'" + +#~ msgid "File exists" +#~ msgstr "Le fichier existe" + +#~ msgid "Valid path" +#~ msgstr "Chemin valide" + #~ msgid "Cannot go into subdir:" #~ msgstr "Impossible d'aller dans le sous-répertoire :" diff --git a/tools/translations/is.po b/tools/translations/hu.po index 2a2abb8df4..ef78f27138 100644 --- a/tools/translations/is.po +++ b/tools/translations/hu.po @@ -1,15 +1,21 @@ -# LANGUAGE translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Hungarian translation of the Godot Engine editor +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# Varga Dániel <danikah.danikah@gmail.com>, 2016. # msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" -"Language: is\n" +"PO-Revision-Date: 2016-11-11 18:19+0000\n" +"Last-Translator: Varga Dániel <danikah.danikah@gmail.com>\n" +"Language-Team: Hungarian <https://hosted.weblate.org/projects/godot-engine/" +"godot/hu/>\n" +"Language: hu\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8-bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 2.9\n" #: modules/gdscript/gd_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -26,12 +32,6 @@ msgid "step argument is zero!" msgstr "" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" msgstr "" @@ -375,74 +375,74 @@ msgstr "" msgid "just released" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid unique name." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid product GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid background color." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" @@ -550,10 +550,6 @@ msgid "" "as parent." msgstr "" -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "" - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -613,7 +609,8 @@ msgstr "" msgid "Cancel" msgstr "" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "" @@ -1756,6 +1753,10 @@ msgid "Constants:" msgstr "" #: tools/editor/editor_help.cpp +msgid "Property Description:" +msgstr "" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "" @@ -1823,7 +1824,9 @@ msgstr "" msgid "Save Resource As.." msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "" @@ -2048,7 +2051,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "" @@ -2728,6 +2733,7 @@ msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "" @@ -2955,6 +2961,10 @@ msgid "Auto" msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +msgid "Root Node Name:" +msgstr "" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "" @@ -3854,6 +3864,49 @@ msgstr "" msgid "Snap (Pixels):" msgstr "" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Change default type" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4718,18 +4771,6 @@ msgstr "" msgid "Contextual Help" msgstr "" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "" @@ -5492,6 +5533,64 @@ msgid "No exporter for platform '%s' yet." msgstr "" #: tools/editor/project_export.cpp +msgid "Create Android keystore" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Full name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organization" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "State" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Password" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "at least 6 characters" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "File name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "" @@ -5951,10 +6050,6 @@ msgid "Erase Input Action Event" msgstr "" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "" @@ -6098,7 +6193,7 @@ msgstr "" msgid "Dir.." msgstr "" -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "" @@ -6131,10 +6226,6 @@ msgid "Properties:" msgstr "" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "" @@ -6211,14 +6302,6 @@ msgid "Scene Run Settings" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "" @@ -6227,10 +6310,6 @@ msgid "Error loading scene from %s" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "" @@ -6269,10 +6348,6 @@ msgid "This operation can't be done without a scene." msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "" @@ -6297,10 +6372,6 @@ msgid "Remove Node(s)" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6339,7 +6410,11 @@ msgid "Change Type" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" +msgid "Attach Script" +msgstr "" + +#: tools/editor/scene_tree_dock.cpp +msgid "Clear Script" msgstr "" #: tools/editor/scene_tree_dock.cpp @@ -6365,13 +6440,11 @@ msgid "" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." +msgid "Attach a new or existing script for the selected node." msgstr "" -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." msgstr "" #: tools/editor/scene_tree_editor.cpp @@ -6467,6 +6540,10 @@ msgid "Could not create script in filesystem." msgstr "" #: tools/editor/script_create_dialog.cpp +msgid "Error loading script from %s" +msgstr "" + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "" @@ -6479,15 +6556,15 @@ msgid "Invalid base path" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "File exists" +msgid "Invalid extension" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Invalid extension" +msgid "Create new script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" +msgid "Load existing script" msgstr "" #: tools/editor/script_create_dialog.cpp @@ -6499,7 +6576,7 @@ msgid "Built-In Script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" +msgid "Attach Node Script" msgstr "" #: tools/editor/script_editor_debugger.cpp @@ -6665,3 +6742,7 @@ msgstr "" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Notifier Extents" msgstr "" + +#: tools/editor/spatial_editor_gizmos.cpp +msgid "Change Probe Extents" +msgstr "" diff --git a/tools/translations/id.po b/tools/translations/id.po index 3f2ef7861f..917bd21e82 100644 --- a/tools/translations/id.po +++ b/tools/translations/id.po @@ -1,8 +1,9 @@ # Indonesian translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # # Abdul Aziz Muslim Alqudsy <abdul.aziz.muslim.alqudsy@gmail.com>, 2016. +# Andevid Dynmyn <doyan4forum@gmail.com>, 2016. # Andinawan Asa <asaandinawan@gmail.com>, 2016. # Khairul Hidayat <khairulcyber4rt@gmail.com>, 2016. # yursan9 <rizal.sagi@gmail.com>, 2016. @@ -10,15 +11,15 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" -"PO-Revision-Date: 2016-08-27 02:11+0000\n" -"Last-Translator: yursan9 <rizal.sagi@gmail.com>\n" +"PO-Revision-Date: 2016-10-15 04:17+0000\n" +"Last-Translator: Andevid Dynmyn <doyan4forum@gmail.com>\n" "Language-Team: Indonesian <https://hosted.weblate.org/projects/godot-engine/" "godot/id/>\n" "Language: id\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8-bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 2.8-dev\n" +"X-Generator: Weblate 2.9-dev\n" #: modules/gdscript/gd_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -36,12 +37,6 @@ msgid "step argument is zero!" msgstr "Langkah argumen adalah nol!" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp #, fuzzy msgid "Not a script with an instance" msgstr "Skrip tidak mempunyai turunannya" @@ -404,76 +399,76 @@ msgstr "" msgid "just released" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid unique name." msgstr "Nama tidak sah." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid product GUID." msgstr "Ukuran font tidak sah." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid background color." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" @@ -620,10 +615,6 @@ msgstr "" "VisibilityEnable2D bekerja dengan sangat baik ketika digunakan dengan " "mengedit root scene secara langsung sebagai parent." -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "BakedLightInstance tidak berisi resource BakedLight." - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -706,7 +697,8 @@ msgstr "" msgid "Cancel" msgstr "Batal" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "Oke" @@ -1904,6 +1896,11 @@ msgid "Constants:" msgstr "Konstanta:" #: tools/editor/editor_help.cpp +#, fuzzy +msgid "Property Description:" +msgstr "Deskripsi Singkat:" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "Deskripsi Metode:" @@ -1971,7 +1968,9 @@ msgstr "Error menyimpan resource!" msgid "Save Resource As.." msgstr "Simpan Resource Sebagai.." -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp #, fuzzy msgid "I see.." msgstr "Aku tahu.." @@ -2212,7 +2211,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "Pilih sebuah Scene Utama" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp #, fuzzy msgid "Ugh" msgstr "Wadoo" @@ -2896,6 +2897,7 @@ msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "" @@ -3123,6 +3125,11 @@ msgid "Auto" msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +#, fuzzy +msgid "Root Node Name:" +msgstr "Nama Node:" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "" @@ -4022,6 +4029,50 @@ msgstr "" msgid "Snap (Pixels):" msgstr "" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Change default type" +msgstr "Ubah Tipe Nilai Array" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4887,18 +4938,6 @@ msgstr "" msgid "Contextual Help" msgstr "" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "" @@ -5661,6 +5700,67 @@ msgid "No exporter for platform '%s' yet." msgstr "" #: tools/editor/project_export.cpp +#, fuzzy +msgid "Create Android keystore" +msgstr "Buat Folder" + +#: tools/editor/project_export.cpp +msgid "Full name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Organization" +msgstr "Transisi" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "State" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Password" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "at least 6 characters" +msgstr "Karakter sah:" + +#: tools/editor/project_export.cpp +msgid "File name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "" @@ -6120,10 +6220,6 @@ msgid "Erase Input Action Event" msgstr "" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "" @@ -6267,7 +6363,7 @@ msgstr "" msgid "Dir.." msgstr "" -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "" @@ -6301,10 +6397,6 @@ msgid "Properties:" msgstr "" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "" @@ -6383,14 +6475,6 @@ msgid "Scene Run Settings" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "" @@ -6399,10 +6483,6 @@ msgid "Error loading scene from %s" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "" @@ -6441,10 +6521,6 @@ msgid "This operation can't be done without a scene." msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "" @@ -6469,10 +6545,6 @@ msgid "Remove Node(s)" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6511,8 +6583,14 @@ msgid "Change Type" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" -msgstr "" +#, fuzzy +msgid "Attach Script" +msgstr "Scene Baru" + +#: tools/editor/scene_tree_dock.cpp +#, fuzzy +msgid "Clear Script" +msgstr "Scene Baru" #: tools/editor/scene_tree_dock.cpp msgid "Merge From Scene" @@ -6537,13 +6615,11 @@ msgid "" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." +msgid "Attach a new or existing script for the selected node." msgstr "" -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." msgstr "" #: tools/editor/scene_tree_editor.cpp @@ -6639,6 +6715,11 @@ msgid "Could not create script in filesystem." msgstr "" #: tools/editor/script_create_dialog.cpp +#, fuzzy +msgid "Error loading script from %s" +msgstr "Error memuat font." + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "" @@ -6651,15 +6732,16 @@ msgid "Invalid base path" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "File exists" +msgid "Invalid extension" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Invalid extension" -msgstr "" +#, fuzzy +msgid "Create new script" +msgstr "Buat Subskribsi" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" +msgid "Load existing script" msgstr "" #: tools/editor/script_create_dialog.cpp @@ -6671,8 +6753,9 @@ msgid "Built-In Script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" -msgstr "" +#, fuzzy +msgid "Attach Node Script" +msgstr "Scene Baru" #: tools/editor/script_editor_debugger.cpp msgid "Bytes:" @@ -6795,8 +6878,9 @@ msgid "Live Edit Root:" msgstr "" #: tools/editor/script_editor_debugger.cpp +#, fuzzy msgid "Set From Tree" -msgstr "" +msgstr "Menyetel Dari Keturunan" #: tools/editor/settings_config_dialog.cpp msgid "Shortcuts" @@ -6804,19 +6888,21 @@ msgstr "" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Light Radius" -msgstr "" +msgstr "Ganti Radius Lampu" #: tools/editor/spatial_editor_gizmos.cpp +#, fuzzy msgid "Change Camera FOV" -msgstr "" +msgstr "Ganti FOV Kamera" #: tools/editor/spatial_editor_gizmos.cpp +#, fuzzy msgid "Change Camera Size" -msgstr "" +msgstr "Ganti Ukuran Kamera" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Sphere Shape Radius" -msgstr "" +msgstr "Ganti Radius Bentuk Bola" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Box Shape Extents" @@ -6838,6 +6924,21 @@ msgstr "" msgid "Change Notifier Extents" msgstr "" +#: tools/editor/spatial_editor_gizmos.cpp +msgid "Change Probe Extents" +msgstr "" + +#~ msgid "BakedLightInstance does not contain a BakedLight resource." +#~ msgstr "BakedLightInstance tidak berisi resource BakedLight." + +#, fuzzy +#~ msgid "" +#~ "Paths cannot start with '/', absolute paths must start with 'res://', " +#~ "'user://', or 'local://'" +#~ msgstr "" +#~ "Path tidak bisa diawali dengan '/', tetapi absolut path harus diawali " +#~ "dengan 'res://', 'user://', atau 'local://'" + #~ msgid "" #~ "Custom node has no _get_output_port_unsequenced(idx,wmem), but " #~ "unsequenced ports were specified." diff --git a/tools/translations/it.po b/tools/translations/it.po index 1fa6a89605..f49c953a7d 100644 --- a/tools/translations/it.po +++ b/tools/translations/it.po @@ -1,5 +1,5 @@ # Italian translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # # Dario Bonfanti <bonfi.96@hotmail.it>, 2016. @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2016-09-10 22:09+0000\n" +"PO-Revision-Date: 2016-11-22 20:27+0000\n" "Last-Translator: Dario Bonfanti <bonfi.96@hotmail.it>\n" "Language-Team: Italian <https://hosted.weblate.org/projects/godot-engine/" "godot/it/>\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 2.8\n" +"X-Generator: Weblate 2.10-dev\n" #: modules/gdscript/gd_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -36,12 +36,6 @@ msgid "step argument is zero!" msgstr "step argument è zero!" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" msgstr "Non è uno script con un istanza" @@ -171,9 +165,8 @@ msgid "Editing Signal:" msgstr "Modifica Segnale:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Change Expression" -msgstr "Cambia Tipo" +msgstr "Cambia Espressione" #: modules/visual_script/visual_script_editor.cpp msgid "Add Node" @@ -224,40 +217,36 @@ msgid "Add Setter Property" msgstr "Aggiungi Proprietà Setter" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Condition" -msgstr "Copia Animazione" +msgstr "Condizione" #: modules/visual_script/visual_script_editor.cpp msgid "Sequence" -msgstr "" +msgstr "Sequenza" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Switch" -msgstr "Pitch" +msgstr "Interruttore" #: modules/visual_script/visual_script_editor.cpp msgid "Iterator" -msgstr "" +msgstr "Iteratore" #: modules/visual_script/visual_script_editor.cpp msgid "While" -msgstr "" +msgstr "Mentre" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Return" -msgstr "Ritorna:" +msgstr "Ritorna" #: modules/visual_script/visual_script_editor.cpp tools/editor/call_dialog.cpp msgid "Call" msgstr "Chiama" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Get" -msgstr "Set" +msgstr "Get" #: modules/visual_script/visual_script_editor.cpp #: tools/editor/property_editor.cpp @@ -399,87 +388,99 @@ msgstr "" #: modules/visual_script/visual_script_nodes.cpp msgid "just pressed" -msgstr "" +msgstr "appena premuto" #: modules/visual_script/visual_script_nodes.cpp msgid "just released" -msgstr "" +msgstr "appena rilasciato" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" +"Impossibile leggere il file del certificatio. Il percorso e la pasword sono " +"entrambi corretti?" -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." -msgstr "Errore di scrittura del PCK del progetto!" +msgstr "Errore in creazione del signature object." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." -msgstr "" +msgstr "Errore di creazione della firma del pacchetto." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" +"Nessun template di esportazione trovato.\n" +"Scarica ed installa i template di esportazione." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." -msgstr "" +msgstr "Pacchetto di debug personalizzato non trovato." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." -msgstr "" +msgstr "Pacchetto di release personalizzato non trovato." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid unique name." -msgstr "Nome Invalido." +msgstr "Nome unico invalido." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid product GUID." -msgstr "Dimensione font Invalida." +msgstr "GUID prodotto invalido." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." -msgstr "Percorso di base invalido" +msgstr "GUID publisher invalido." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid background color." -msgstr "Sorgente font personalizzato invalido." +msgstr "Colore di background invalido." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." msgstr "" +"Dimensioni dell'immagine dello Store Logo invalide (dovrebbero essere 50x50)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." msgstr "" +"Dimensioni non valide dell'immagine del logo quadrato 44x44 (dovrebbero " +"essere 44x44)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." msgstr "" +"Dimensioni non valide dell'immagine del logo quadrato 71x71 (dovrebbero " +"essere 71x71)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." msgstr "" +"Dimensioni non valide dell'immagine del logo quadrato 150x150 (dovrebbero " +"essere 150x150)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." msgstr "" +"Dimensioni non valide dell'immagine del logo quadrato 310x310 (dovrebbero " +"essere 310x310)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." msgstr "" +"Dimensioni non valide dell'immagine del logo quadrato 310x150 (dovrebbero " +"essere 310x150)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" +"Dimensioni non valide dell'immagine dello splash screen (dovrebbero essere " +"620x300)." #: scene/2d/animated_sprite.cpp msgid "" @@ -626,10 +627,6 @@ msgstr "" "VisibilityEnable2D funziona al meglio quando usato direttamente come " "genitore con il root della scena modificata." -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "BakedLightInstance non contiene una risorsa BakedLight." - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -678,11 +675,10 @@ msgstr "" "Fornisce solamente dati per la navigazione." #: scene/3d/remote_transform.cpp -#, fuzzy msgid "Path property must point to a valid Spatial node to work." msgstr "" -"La proprietà path deve puntare a un nodo Particles2D valido per poter " -"funzionare." +"La proprietà path deve puntare ad un nodo Spaziale (Spatial) valido per " +"poter funzionare." #: scene/3d/scenario_fx.cpp msgid "" @@ -711,7 +707,8 @@ msgstr "" msgid "Cancel" msgstr "Annulla" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "OK" @@ -1457,6 +1454,8 @@ msgid "" "Target method not found! Specify a valid method or attach a script to target " "Node." msgstr "" +"Metodo di destinazione non trovato! Specifica un metodo valido o annetti uno " +"script al nodo di destinazione." #: tools/editor/connections_dialog.cpp msgid "Connect To Node:" @@ -1875,6 +1874,11 @@ msgid "Constants:" msgstr "Costanti:" #: tools/editor/editor_help.cpp +#, fuzzy +msgid "Property Description:" +msgstr "Breve Descrizione:" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "Descrizione Metodo:" @@ -1942,7 +1946,9 @@ msgstr "Errore salvando la Risorsa!" msgid "Save Resource As.." msgstr "Salva Risorsa Come.." -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "Capisco.." @@ -2182,7 +2188,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "Scegli una Scena Principale" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "Ugh" @@ -2503,9 +2511,8 @@ msgid "Editor Layout" msgstr "Layout dell'Editor" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Toggle Fullscreen" -msgstr "Modalità Fullscreen" +msgstr "Abilita/Disabilita Fullscreen" #: tools/editor/editor_node.cpp msgid "Install Export Templates" @@ -2533,7 +2540,7 @@ msgstr "Aggiorna Cambiamenti" #: tools/editor/editor_node.cpp msgid "Disable Update Spinner" -msgstr "" +msgstr "Disabilita lo Spinner di Update" #: tools/editor/editor_node.cpp msgid "Inspector" @@ -2890,6 +2897,7 @@ msgstr "Texture Sorgenti:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "Percorso di destinazione:" @@ -3121,6 +3129,10 @@ msgid "Auto" msgstr "Auto" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +msgid "Root Node Name:" +msgstr "Nome Nodo di Root:" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "I File Seguenti sono Mancanti:" @@ -3964,9 +3976,8 @@ msgid "Clear Bones" msgstr "Elimina Ossa" #: tools/editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Show Bones" -msgstr "Crea Ossa" +msgstr "Mostra Ossa" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Make IK Chain" @@ -4029,6 +4040,51 @@ msgstr "Imposta un Valore" msgid "Snap (Pixels):" msgstr "Snap (Pixels):" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "Aggiungi %s" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "Aggiungendo %s..." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "Crea Nodo" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "Errore istanziamento scena da %s" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "OK :(" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "Nessun genitore del quale istanziare un figlio." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "Questa operazione richiede un solo nodo selezionato." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Change default type" +msgstr "Cambia tipo di default" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" +"Premi & Trascina + Shift : Aggiungi nodo come fratello\n" +"Premi & Trascina + Alt : Cambia tipo del nodo" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4709,9 +4765,8 @@ msgid "Close Docs" msgstr "Chiudi Documentazione" #: tools/editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Close All" -msgstr "Chiudi" +msgstr "Chiudi Tutto" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/plugins/script_text_editor.cpp @@ -4826,9 +4881,8 @@ msgstr "" "cui appartengono è caricata" #: tools/editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Pick Color" -msgstr "Colore" +msgstr "Scegli Colore" #: tools/editor/plugins/script_text_editor.cpp tools/editor/scene_tree_dock.cpp msgid "Move Up" @@ -4901,18 +4955,6 @@ msgstr "Vai a Linea.." msgid "Contextual Help" msgstr "Aiuto Contestuale" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "Vertice" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "Frammento" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "Illuminazione" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "Cambia Costante Scalare" @@ -5206,9 +5248,8 @@ msgid "Insert Animation Key" msgstr "Inserisci Key Animazione" #: tools/editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Focus Origin" -msgstr "Visualizza Origine" +msgstr "Focalizza su Origine" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Focus Selection" @@ -5476,9 +5517,8 @@ msgid "Remove Item" msgstr "Rimuovi Elemento" #: tools/editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Theme" -msgstr "Salva Tema" +msgstr "Tema" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Add Class Items" @@ -5677,6 +5717,71 @@ msgid "No exporter for platform '%s' yet." msgstr "Per ora non vi è esportatore per la piattaforma '%s'." #: tools/editor/project_export.cpp +#, fuzzy +msgid "Create Android keystore" +msgstr "Crea Nuova Risorsa" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Full name" +msgstr "Nome valido" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Organization" +msgstr "Transizione" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "State" +msgstr "Stato:" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Password" +msgstr "Password:" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "at least 6 characters" +msgstr "Caratteri validi:" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "File name" +msgstr "Nuovo nome:" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "Includi" @@ -6142,10 +6247,6 @@ msgid "Erase Input Action Event" msgstr "Elimina Evento di Azione Input" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "Attiva Persistenza" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "Errore nel salvare le impostazioni." @@ -6289,7 +6390,7 @@ msgstr "File.." msgid "Dir.." msgstr "Dir.." -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "Carica" @@ -6298,9 +6399,8 @@ msgid "Assign" msgstr "Assegna" #: tools/editor/property_editor.cpp -#, fuzzy msgid "New Script" -msgstr "Script successivo" +msgstr "Nuovo Script" #: tools/editor/property_editor.cpp msgid "Error loading file: Not a resource!" @@ -6323,10 +6423,6 @@ msgid "Properties:" msgstr "Proprietà:" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "Globale" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "Sezioni:" @@ -6403,14 +6499,6 @@ msgid "Scene Run Settings" msgstr "Impostazioni Esecuzione Scena" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "OK :(" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "Nessun genitore del quale istanziare un figlio." - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "Nessun genitore nel quale istanziare una scena." @@ -6419,10 +6507,6 @@ msgid "Error loading scene from %s" msgstr "Errore caricamento scena da %s" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "Errore istanziamento scena da %s" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "Ok" @@ -6463,10 +6547,6 @@ msgid "This operation can't be done without a scene." msgstr "Questa operazione non può essere eseguita senza una scena." #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "Questa operazione richiede un solo nodo selezionato." - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "Questa operazione no può essere eseguita su scene istanziate." @@ -6491,10 +6571,6 @@ msgid "Remove Node(s)" msgstr "Rimuovi nodo(i)" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "Crea Nodo" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6535,8 +6611,12 @@ msgid "Change Type" msgstr "Cambia Tipo" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" -msgstr "Aggiungi Script" +msgid "Attach Script" +msgstr "Allega Script" + +#: tools/editor/scene_tree_dock.cpp +msgid "Clear Script" +msgstr "Svuota Script" #: tools/editor/scene_tree_dock.cpp msgid "Merge From Scene" @@ -6563,16 +6643,12 @@ msgstr "" "root esiste." #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." -msgstr "Crea un nuovo script per il nodo selezionato." +msgid "Attach a new or existing script for the selected node." +msgstr "Allega un nuovo script o uno esistente al nodo selezionato." -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." -msgstr "" -"Questo elemento non può essere reso visibile perchè il genitore è nascosto. " -"Rivela prima il genitore." +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." +msgstr "Svuota uno script per il nodo selezionato." #: tools/editor/scene_tree_editor.cpp msgid "Toggle Spatial Visible" @@ -6667,6 +6743,10 @@ msgid "Could not create script in filesystem." msgstr "Impossibile creare script in filesystem." #: tools/editor/script_create_dialog.cpp +msgid "Error loading script from %s" +msgstr "Errore caricamento script da %s" + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "Percorso vuoto" @@ -6679,16 +6759,16 @@ msgid "Invalid base path" msgstr "Percorso di base invalido" #: tools/editor/script_create_dialog.cpp -msgid "File exists" -msgstr "File esistente" - -#: tools/editor/script_create_dialog.cpp msgid "Invalid extension" msgstr "Estensione Invalida" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" -msgstr "Percorso valido" +msgid "Create new script" +msgstr "Crea nuovo script" + +#: tools/editor/script_create_dialog.cpp +msgid "Load existing script" +msgstr "Carica script esistente" #: tools/editor/script_create_dialog.cpp msgid "Class Name:" @@ -6699,8 +6779,8 @@ msgid "Built-In Script" msgstr "Built-In Script" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" -msgstr "Crea Script Nodo" +msgid "Attach Node Script" +msgstr "Allega Script Nodo" #: tools/editor/script_editor_debugger.cpp msgid "Bytes:" @@ -6866,6 +6946,49 @@ msgstr "Cambia lunghezza Ray Shape" msgid "Change Notifier Extents" msgstr "Cambia Estensione di Notifier" +#: tools/editor/spatial_editor_gizmos.cpp +#, fuzzy +msgid "Change Probe Extents" +msgstr "Cambia Estensione di Notifier" + +#~ msgid "BakedLightInstance does not contain a BakedLight resource." +#~ msgstr "BakedLightInstance non contiene una risorsa BakedLight." + +#~ msgid "Vertex" +#~ msgstr "Vertice" + +#~ msgid "Fragment" +#~ msgstr "Frammento" + +#~ msgid "Lighting" +#~ msgstr "Illuminazione" + +#~ msgid "Toggle Persisting" +#~ msgstr "Attiva Persistenza" + +#~ msgid "Global" +#~ msgstr "Globale" + +#~ msgid "" +#~ "This item cannot be made visible because the parent is hidden. Unhide the " +#~ "parent first." +#~ msgstr "" +#~ "Questo elemento non può essere reso visibile perchè il genitore è " +#~ "nascosto. Rivela prima il genitore." + +#~ msgid "" +#~ "Paths cannot start with '/', absolute paths must start with 'res://', " +#~ "'user://', or 'local://'" +#~ msgstr "" +#~ "I percorsi non possono iniziare per '/', i percorsi assoluti devono " +#~ "iniziare per 'res://', 'user://', oppure 'local://'" + +#~ msgid "File exists" +#~ msgstr "File esistente" + +#~ msgid "Valid path" +#~ msgstr "Percorso valido" + #~ msgid "" #~ "Custom node has no _get_output_port_unsequenced(idx,wmem), but " #~ "unsequenced ports were specified." diff --git a/tools/translations/ja.po b/tools/translations/ja.po index 25003026c1..279f59c9c8 100644 --- a/tools/translations/ja.po +++ b/tools/translations/ja.po @@ -1,21 +1,22 @@ # Japanese translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # +# akirakido <achts.y@gmail.com>, 2016. # hopping tappy (たっぴさん) <hopping.tappy@gmail.com>, 2016. # msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" -"PO-Revision-Date: 2016-07-16 08:16+0000\n" -"Last-Translator: hopping tappy (たっぴさん) <hopping.tappy@gmail.com>\n" +"PO-Revision-Date: 2016-11-12 15:11+0000\n" +"Last-Translator: akirakido <achts.y@gmail.com>\n" "Language-Team: Japanese <https://hosted.weblate.org/projects/godot-engine/" "godot/ja/>\n" "Language: ja\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8-bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 2.8-dev\n" +"X-Generator: Weblate 2.9\n" #: modules/gdscript/gd_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -34,12 +35,6 @@ msgid "step argument is zero!" msgstr "ステップ引数はゼロです!" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" msgstr "インスタンスを使用していないスクリプトです" @@ -400,76 +395,76 @@ msgstr "" msgid "just released" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid unique name." msgstr "無効なフォント サイズです。" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid product GUID." msgstr "無効なフォント サイズです。" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid background color." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" @@ -612,10 +607,6 @@ msgstr "" "VisibilityEnable2D は、親として直接編集されたシーンのルートを使用する場合に最" "適です。" -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "" - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -698,7 +689,8 @@ msgstr "" msgid "Cancel" msgstr "キャンセル" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "決定" @@ -1851,6 +1843,10 @@ msgid "Constants:" msgstr "" #: tools/editor/editor_help.cpp +msgid "Property Description:" +msgstr "" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "" @@ -1919,7 +1915,9 @@ msgstr "" msgid "Save Resource As.." msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "" @@ -2154,7 +2152,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "" @@ -2835,6 +2835,7 @@ msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "" @@ -3062,6 +3063,10 @@ msgid "Auto" msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +msgid "Root Node Name:" +msgstr "" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "" @@ -3963,6 +3968,50 @@ msgstr "" msgid "Snap (Pixels):" msgstr "" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Change default type" +msgstr "配列の値の種類の変更" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4829,18 +4878,6 @@ msgstr "" msgid "Contextual Help" msgstr "" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "" @@ -5603,6 +5640,66 @@ msgid "No exporter for platform '%s' yet." msgstr "" #: tools/editor/project_export.cpp +#, fuzzy +msgid "Create Android keystore" +msgstr "フォルダを作成" + +#: tools/editor/project_export.cpp +msgid "Full name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Organization" +msgstr "遷移" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "State" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Password" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "at least 6 characters" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "File name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "" @@ -6062,10 +6159,6 @@ msgid "Erase Input Action Event" msgstr "" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "" @@ -6209,7 +6302,7 @@ msgstr "" msgid "Dir.." msgstr "" -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "" @@ -6242,10 +6335,6 @@ msgid "Properties:" msgstr "" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "" @@ -6324,14 +6413,6 @@ msgid "Scene Run Settings" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "" @@ -6340,10 +6421,6 @@ msgid "Error loading scene from %s" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "" @@ -6382,10 +6459,6 @@ msgid "This operation can't be done without a scene." msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "" @@ -6410,10 +6483,6 @@ msgid "Remove Node(s)" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6452,7 +6521,11 @@ msgid "Change Type" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" +msgid "Attach Script" +msgstr "" + +#: tools/editor/scene_tree_dock.cpp +msgid "Clear Script" msgstr "" #: tools/editor/scene_tree_dock.cpp @@ -6479,13 +6552,11 @@ msgid "" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." +msgid "Attach a new or existing script for the selected node." msgstr "" -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." msgstr "" #: tools/editor/scene_tree_editor.cpp @@ -6581,6 +6652,11 @@ msgid "Could not create script in filesystem." msgstr "" #: tools/editor/script_create_dialog.cpp +#, fuzzy +msgid "Error loading script from %s" +msgstr "フォント読み込みエラー。" + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "" @@ -6593,15 +6669,16 @@ msgid "Invalid base path" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "File exists" +msgid "Invalid extension" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Invalid extension" -msgstr "" +#, fuzzy +msgid "Create new script" +msgstr "フォルダを作成" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" +msgid "Load existing script" msgstr "" #: tools/editor/script_create_dialog.cpp @@ -6613,7 +6690,7 @@ msgid "Built-In Script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" +msgid "Attach Node Script" msgstr "" #: tools/editor/script_editor_debugger.cpp @@ -6779,3 +6856,15 @@ msgstr "" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Notifier Extents" msgstr "" + +#: tools/editor/spatial_editor_gizmos.cpp +msgid "Change Probe Extents" +msgstr "" + +#, fuzzy +#~ msgid "" +#~ "Paths cannot start with '/', absolute paths must start with 'res://', " +#~ "'user://', or 'local://'" +#~ msgstr "" +#~ "パスは「/」で始めることができません。絶対パスは必ず「res://」「user://」" +#~ "「local://」 で始まる必要があります。" diff --git a/tools/translations/ko.po b/tools/translations/ko.po index a4d24d8b52..ea2b130d37 100644 --- a/tools/translations/ko.po +++ b/tools/translations/ko.po @@ -1,5 +1,5 @@ # Korean translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # # 박한얼 (volzhs) <volzhs@gmail.com>, 2016. @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2016-09-26 13:04+0000\n" +"PO-Revision-Date: 2016-11-23 14:38+0000\n" "Last-Translator: 박한얼 <volzhs@gmail.com>\n" "Language-Team: Korean <https://hosted.weblate.org/projects/godot-engine/" "godot/ko/>\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 2.9-dev\n" +"X-Generator: Weblate 2.10-dev\n" #: modules/gdscript/gd_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -35,12 +35,6 @@ msgid "step argument is zero!" msgstr "스텝 인자가 제로입니다!" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" msgstr "스크립트의 인스턴스가 아님" @@ -165,9 +159,8 @@ msgid "Editing Signal:" msgstr "시그널 편집:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Change Expression" -msgstr "타입 변경" +msgstr "표현식 변경" #: modules/visual_script/visual_script_editor.cpp msgid "Add Node" @@ -214,18 +207,16 @@ msgid "Add Setter Property" msgstr "" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Condition" -msgstr "애니메이션 복사" +msgstr "조건" #: modules/visual_script/visual_script_editor.cpp msgid "Sequence" msgstr "" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Switch" -msgstr "피치" +msgstr "스위치" #: modules/visual_script/visual_script_editor.cpp msgid "Iterator" @@ -236,18 +227,16 @@ msgid "While" msgstr "" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Return" -msgstr "리턴:" +msgstr "리턴" #: modules/visual_script/visual_script_editor.cpp tools/editor/call_dialog.cpp msgid "Call" msgstr "호출" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Get" -msgstr "설정" +msgstr "얻기" #: modules/visual_script/visual_script_editor.cpp #: tools/editor/property_editor.cpp @@ -391,81 +380,79 @@ msgstr "" msgid "just released" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" -msgstr "" +msgstr "인증서 파일을 읽을 수 없습니다. 경로와 비밀번호가 정확합니까?" -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." -msgstr "프로젝트 PCK 작성중 에러!" +msgstr "서명 오브젝트 생성중 에러." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." -msgstr "" +msgstr "패키지 서명을 생성하는 중 에러가 발생했습니다." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" +"내보내기 템플릿을 찾을 수 없습니다.\n" +"내보내기 템플릿을 다운로드하여 설치하십시요." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." -msgstr "" +msgstr "커스텀 디버그 패키지를 찾을 수 없습니다." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." -msgstr "" +msgstr "커스텀 릴리즈 패키지를 찾을 수 없습니다." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid unique name." -msgstr "유효하지 않은 이름." +msgstr "유효하지 않은 고유 이름." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid product GUID." -msgstr "유요하지 않은 폰트 사이즈." +msgstr "유요하지 않은 프로덕트 GUID." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." -msgstr "기본 경로가 유요하지 않음" +msgstr "유요하지 않은 퍼블리셔 GUID." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid background color." -msgstr "사용자 지정 폰트 소스가 유효하지 않습니다." +msgstr "유요하지 않은 배경 색상." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." -msgstr "" +msgstr "유효하지 않은 로고 이미지 크기입니다 (50x50 이어야 합니다)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." -msgstr "" +msgstr "유효하지 않은 로고 이미지 크기입니다 (44x44 이어야 합니다)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." -msgstr "" +msgstr "유효하지 않은 로고 이미지 크기입니다 (71x71 이어야 합니다)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." -msgstr "" +msgstr "유효하지 않은 로고 이미지 크기입니다 (150x150 이어야 합니다)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." -msgstr "" +msgstr "유효하지 않은 로고 이미지 크기입니다 (310x310 이어야 합니다)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." -msgstr "" +msgstr "유효하지 않은 로고 이미지 크기입니다 (310x150 이어야 합니다)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" +"유효하지 않은 스플래쉬 스크린 이미지 크기입니다 (620x300 이어야 합니다)." #: scene/2d/animated_sprite.cpp msgid "" @@ -597,10 +584,6 @@ msgstr "" "VisibilityEnable2D는 편집 씬의 루트의 하위 노드로 추가할 때 가장 잘 동작합니" "다." -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "BakedLightInstance가 BakedLight 리소스를 가지고 있지 않습니다." - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -648,9 +631,8 @@ msgstr "" "게이션 데이타만을 제공합니다." #: scene/3d/remote_transform.cpp -#, fuzzy msgid "Path property must point to a valid Spatial node to work." -msgstr "Path 속성은 유효한 Particles2D 노드를 가리켜야 합니다." +msgstr "Path 속성은 유효한 Spatial 노드를 가리켜야 합니다." #: scene/3d/scenario_fx.cpp msgid "" @@ -677,7 +659,8 @@ msgstr "" msgid "Cancel" msgstr "취소" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "확인" @@ -1195,7 +1178,7 @@ msgstr "최적화" #: tools/editor/animation_editor.cpp msgid "Select an AnimationPlayer from the Scene Tree to edit animations." -msgstr "" +msgstr "애니메이션 편집을 위해서는 씬에서 AnimationPlayer를 선택해야 합니다." #: tools/editor/animation_editor.cpp msgid "Key" @@ -1402,7 +1385,7 @@ msgstr "축소" #: tools/editor/code_editor.cpp msgid "Reset Zoom" -msgstr "" +msgstr "줌 리셋" #: tools/editor/code_editor.cpp tools/editor/script_editor_debugger.cpp msgid "Line:" @@ -1421,6 +1404,8 @@ msgid "" "Target method not found! Specify a valid method or attach a script to target " "Node." msgstr "" +"타겟 메소드를 찾을 수 없습니다! 유효한 메소드를 지정하거나, 타겟 노드에 스크" +"립트를 추가하세요." #: tools/editor/connections_dialog.cpp msgid "Connect To Node:" @@ -1834,6 +1819,11 @@ msgid "Constants:" msgstr "상수:" #: tools/editor/editor_help.cpp +#, fuzzy +msgid "Property Description:" +msgstr "간단한 설명:" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "함수 설명:" @@ -1901,7 +1891,9 @@ msgstr "리소스 저장 중 에러!" msgid "Save Resource As.." msgstr "리소스를 다른 이름으로 저장.." -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "알겠습니다.." @@ -2135,7 +2127,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "메인 씬 선택" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "오우" @@ -2456,9 +2450,8 @@ msgid "Editor Layout" msgstr "에디터 레이아웃" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Toggle Fullscreen" -msgstr "전체화면 모드" +msgstr "전체화면 토글" #: tools/editor/editor_node.cpp msgid "Install Export Templates" @@ -2486,7 +2479,7 @@ msgstr "변경사항만 갱신" #: tools/editor/editor_node.cpp msgid "Disable Update Spinner" -msgstr "" +msgstr "업데이트 스피너 비활성화" #: tools/editor/editor_node.cpp msgid "Inspector" @@ -2838,6 +2831,7 @@ msgstr "소스 텍스쳐:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "대상 경로:" @@ -3069,6 +3063,10 @@ msgid "Auto" msgstr "자동" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +msgid "Root Node Name:" +msgstr "루트 노드 이름:" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "다음의 파일들이 빠져있습니다:" @@ -3909,9 +3907,8 @@ msgid "Clear Bones" msgstr "Bones 없애기" #: tools/editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Show Bones" -msgstr "Bones 만들기" +msgstr "뼈대 보기" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Make IK Chain" @@ -3974,6 +3971,51 @@ msgstr "값 설정" msgid "Snap (Pixels):" msgstr "스냅 (픽셀):" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "%s 추가" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "%s 추가중..." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "노드 생성" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "'%s' 로부터 씬 인스턴스 중 에러" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "넹 :(" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "선택된 부모 노드가 없어서 자식노드를 인스턴스할 수 없습니다." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "이 작업은 하나의 선택된 노드를 필요로 합니다." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Change default type" +msgstr "기본 타입 변경" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" +"드래그 & 드랍 + 쉬프트 : 형제 노드로 추가\n" +"드래그 & 드랍 + 알트 : 노드 타입 변경" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4652,9 +4694,8 @@ msgid "Close Docs" msgstr "문서 닫기" #: tools/editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Close All" -msgstr "닫기" +msgstr "모두 닫기" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/plugins/script_text_editor.cpp @@ -4767,9 +4808,8 @@ msgid "" msgstr "내장 스크립트는 종속된 씬이 열린 상태에서만 편집이 가능합니다" #: tools/editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Pick Color" -msgstr "색깔" +msgstr "색상 선택" #: tools/editor/plugins/script_text_editor.cpp tools/editor/scene_tree_dock.cpp msgid "Move Up" @@ -4842,18 +4882,6 @@ msgstr "라인으로 이동.." msgid "Contextual Help" msgstr "도움말 보기" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "버텍스" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "프래그먼트" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "라이팅" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "Scalar 상수 변경" @@ -5147,7 +5175,6 @@ msgid "Insert Animation Key" msgstr "애니메이션 키 삽입" #: tools/editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Focus Origin" msgstr "원점 보기" @@ -5417,9 +5444,8 @@ msgid "Remove Item" msgstr "아이템 삭제" #: tools/editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Theme" -msgstr "테마 저장" +msgstr "테마" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Add Class Items" @@ -5618,6 +5644,71 @@ msgid "No exporter for platform '%s' yet." msgstr "'%s' 플랫폼으로 내보내기 위한 템플릿 파일이 없습니다." #: tools/editor/project_export.cpp +#, fuzzy +msgid "Create Android keystore" +msgstr "새 리소스 만들기" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Full name" +msgstr "유요한 이름" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Organization" +msgstr "전환" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "State" +msgstr "상태:" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Password" +msgstr "암호:" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "at least 6 characters" +msgstr "유효한 문자:" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "File name" +msgstr "새 이름:" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "포함" @@ -5951,7 +6042,7 @@ msgstr "" msgid "" "You are about the scan %s folders for existing Godot projects. Do you " "confirm?" -msgstr "" +msgstr "%s 에서 기존 Godot 프로젝트들을 스캔하려고 합니다. 진행하시겠습니까?" #: tools/editor/project_manager.cpp msgid "Project Manager" @@ -6078,10 +6169,6 @@ msgid "Erase Input Action Event" msgstr "입력 액션 이벤트 삭제" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "지속 전환" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "설정 저장 중 에러." @@ -6225,7 +6312,7 @@ msgstr "파일.." msgid "Dir.." msgstr "디렉토리.." -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "로드" @@ -6234,9 +6321,8 @@ msgid "Assign" msgstr "할당" #: tools/editor/property_editor.cpp -#, fuzzy msgid "New Script" -msgstr "다음 스크립트" +msgstr "새 스크립트" #: tools/editor/property_editor.cpp msgid "Error loading file: Not a resource!" @@ -6259,10 +6345,6 @@ msgid "Properties:" msgstr "속성:" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "Global" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "부문:" @@ -6339,14 +6421,6 @@ msgid "Scene Run Settings" msgstr "씬 실행 설정" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "넹 :(" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "선택된 부모 노드가 없어서 자식노드를 인스턴스할 수 없습니다." - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "씬을 인스턴스할 수 있는 부모가 없습니다." @@ -6355,10 +6429,6 @@ msgid "Error loading scene from %s" msgstr "'%s' 로부터 씬 로딩 중 에러" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "'%s' 로부터 씬 인스턴스 중 에러" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "확인" @@ -6397,10 +6467,6 @@ msgid "This operation can't be done without a scene." msgstr "이 작업은 씬 없이는 불가합니다." #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "이 작업은 하나의 선택된 노드를 필요로 합니다." - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "이 작업은 인스턴스된 씬에서는 불가합니다." @@ -6425,10 +6491,6 @@ msgid "Remove Node(s)" msgstr "노드 삭제" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "노드 생성" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6468,8 +6530,12 @@ msgid "Change Type" msgstr "타입 변경" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" -msgstr "스크립트 추가" +msgid "Attach Script" +msgstr "스크립트 붙이기" + +#: tools/editor/scene_tree_dock.cpp +msgid "Clear Script" +msgstr "스크립트 제거" #: tools/editor/scene_tree_dock.cpp msgid "Merge From Scene" @@ -6495,16 +6561,12 @@ msgstr "" "씬 파일을 노드로 추가합니다. 루트 노드가 없을 경우, 상속씬으로 만들어집니다." #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." -msgstr "선택된 노드에 새로운 스크립트를 생성합니다." +msgid "Attach a new or existing script for the selected node." +msgstr "선택된 노드에 새로운 스크립트를 생성하거나 기존 스크립트를 로드합니다." -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." -msgstr "" -"부모 노드가 숨겨져 있기 때문에 이 항목을 보이도록 만들 수 없습니다. 부모 노드" -"를 먼저 보이도록 하세요." +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." +msgstr "선택된 노드의 스크립트를 제거합니다." #: tools/editor/scene_tree_editor.cpp msgid "Toggle Spatial Visible" @@ -6599,6 +6661,10 @@ msgid "Could not create script in filesystem." msgstr "파일 시스템에 스크립트를 생성할 수 없습니다." #: tools/editor/script_create_dialog.cpp +msgid "Error loading script from %s" +msgstr "'%s' 스크립트 로딩 중 에러" + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "경로가 비어 있음" @@ -6611,16 +6677,16 @@ msgid "Invalid base path" msgstr "기본 경로가 유요하지 않음" #: tools/editor/script_create_dialog.cpp -msgid "File exists" -msgstr "파일이 존재함" - -#: tools/editor/script_create_dialog.cpp msgid "Invalid extension" msgstr "확장자가 유요하지 않음" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" -msgstr "유요한 경로" +msgid "Create new script" +msgstr "새 스크립트 만들기" + +#: tools/editor/script_create_dialog.cpp +msgid "Load existing script" +msgstr "기존 스크립트 로드하기" #: tools/editor/script_create_dialog.cpp msgid "Class Name:" @@ -6631,8 +6697,8 @@ msgid "Built-In Script" msgstr "내장 스크립트" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" -msgstr "노드 스크립트 생성" +msgid "Attach Node Script" +msgstr "노드 스크립트 붙이기" #: tools/editor/script_editor_debugger.cpp msgid "Bytes:" @@ -6798,6 +6864,49 @@ msgstr "Ray Shape 길이 변경" msgid "Change Notifier Extents" msgstr "Notifier 범위 변경" +#: tools/editor/spatial_editor_gizmos.cpp +#, fuzzy +msgid "Change Probe Extents" +msgstr "Notifier 범위 변경" + +#~ msgid "BakedLightInstance does not contain a BakedLight resource." +#~ msgstr "BakedLightInstance가 BakedLight 리소스를 가지고 있지 않습니다." + +#~ msgid "Vertex" +#~ msgstr "버텍스" + +#~ msgid "Fragment" +#~ msgstr "프래그먼트" + +#~ msgid "Lighting" +#~ msgstr "라이팅" + +#~ msgid "Toggle Persisting" +#~ msgstr "지속 전환" + +#~ msgid "Global" +#~ msgstr "Global" + +#~ msgid "" +#~ "This item cannot be made visible because the parent is hidden. Unhide the " +#~ "parent first." +#~ msgstr "" +#~ "부모 노드가 숨겨져 있기 때문에 이 항목을 보이도록 만들 수 없습니다. 부모 " +#~ "노드를 먼저 보이도록 하세요." + +#~ msgid "" +#~ "Paths cannot start with '/', absolute paths must start with 'res://', " +#~ "'user://', or 'local://'" +#~ msgstr "" +#~ "경로는 '/'로 시작할 수 없습니다. 'res://', 'user://', 또는 'local://'로 시" +#~ "작하는 절대 경로를 사용해야 합니다" + +#~ msgid "File exists" +#~ msgstr "파일이 존재함" + +#~ msgid "Valid path" +#~ msgstr "유요한 경로" + #~ msgid "Cannot go into subdir:" #~ msgstr "하위 디렉토리로 이동할 수 없습니다:" diff --git a/tools/translations/nb.po b/tools/translations/nb.po index d8d1a2771b..ff659eae8b 100644 --- a/tools/translations/nb.po +++ b/tools/translations/nb.po @@ -1,5 +1,5 @@ # Norwegian Bokmål translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # # Jørgen Aarmo Lund <jorgen.aarmo@gmail.com>, 2016. @@ -32,12 +32,6 @@ msgid "step argument is zero!" msgstr "" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" msgstr "" @@ -381,74 +375,74 @@ msgstr "" msgid "just released" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid unique name." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid product GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid background color." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" @@ -556,10 +550,6 @@ msgid "" "as parent." msgstr "" -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "" - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -619,7 +609,8 @@ msgstr "" msgid "Cancel" msgstr "" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "" @@ -1762,6 +1753,10 @@ msgid "Constants:" msgstr "" #: tools/editor/editor_help.cpp +msgid "Property Description:" +msgstr "" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "" @@ -1829,7 +1824,9 @@ msgstr "" msgid "Save Resource As.." msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "" @@ -2054,7 +2051,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "" @@ -2734,6 +2733,7 @@ msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "" @@ -2961,6 +2961,10 @@ msgid "Auto" msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +msgid "Root Node Name:" +msgstr "" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "" @@ -3860,6 +3864,49 @@ msgstr "" msgid "Snap (Pixels):" msgstr "" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Change default type" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4724,18 +4771,6 @@ msgstr "" msgid "Contextual Help" msgstr "" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "" @@ -5498,6 +5533,64 @@ msgid "No exporter for platform '%s' yet." msgstr "" #: tools/editor/project_export.cpp +msgid "Create Android keystore" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Full name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organization" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "State" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Password" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "at least 6 characters" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "File name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "" @@ -5957,10 +6050,6 @@ msgid "Erase Input Action Event" msgstr "" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "" @@ -6104,7 +6193,7 @@ msgstr "" msgid "Dir.." msgstr "" -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "" @@ -6137,10 +6226,6 @@ msgid "Properties:" msgstr "" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "" @@ -6217,14 +6302,6 @@ msgid "Scene Run Settings" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "" @@ -6233,10 +6310,6 @@ msgid "Error loading scene from %s" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "" @@ -6275,10 +6348,6 @@ msgid "This operation can't be done without a scene." msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "" @@ -6303,10 +6372,6 @@ msgid "Remove Node(s)" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6345,7 +6410,11 @@ msgid "Change Type" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" +msgid "Attach Script" +msgstr "" + +#: tools/editor/scene_tree_dock.cpp +msgid "Clear Script" msgstr "" #: tools/editor/scene_tree_dock.cpp @@ -6371,13 +6440,11 @@ msgid "" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." +msgid "Attach a new or existing script for the selected node." msgstr "" -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." msgstr "" #: tools/editor/scene_tree_editor.cpp @@ -6473,6 +6540,10 @@ msgid "Could not create script in filesystem." msgstr "" #: tools/editor/script_create_dialog.cpp +msgid "Error loading script from %s" +msgstr "" + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "" @@ -6485,15 +6556,15 @@ msgid "Invalid base path" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "File exists" +msgid "Invalid extension" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Invalid extension" +msgid "Create new script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" +msgid "Load existing script" msgstr "" #: tools/editor/script_create_dialog.cpp @@ -6505,7 +6576,7 @@ msgid "Built-In Script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" +msgid "Attach Node Script" msgstr "" #: tools/editor/script_editor_debugger.cpp @@ -6671,3 +6742,7 @@ msgstr "" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Notifier Extents" msgstr "" + +#: tools/editor/spatial_editor_gizmos.cpp +msgid "Change Probe Extents" +msgstr "" diff --git a/tools/translations/pl.po b/tools/translations/pl.po index 78b1964fad..465fbe133d 100644 --- a/tools/translations/pl.po +++ b/tools/translations/pl.po @@ -1,9 +1,11 @@ # Polish translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # +# 8-bit Pixel <dawdejw@gmail.com>, 2016. # Adrian Węcławski <weclawskiadrian@gmail.com>, 2016. # Daniel Lewan <vision360.daniel@gmail.com>, 2016. +# Kajetan Kuszczyński <kajetanek99@gmail.com>, 2016. # Kamil Lewan <lewan.kamil@gmail.com>, 2016. # Karol Walasek <coreconviction@gmail.com>, 2016. # Mietek Szcześniak <ravaging@go2.pl>, 2016. @@ -13,8 +15,8 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" -"PO-Revision-Date: 2016-08-16 18:01+0000\n" -"Last-Translator: Mietek Szcześniak <ravaging@go2.pl>\n" +"PO-Revision-Date: 2016-12-29 16:37+0000\n" +"Last-Translator: 8-bit Pixel <dawdejw@gmail.com>\n" "Language-Team: Polish <https://hosted.weblate.org/projects/godot-engine/" "godot/pl/>\n" "Language: pl\n" @@ -22,31 +24,26 @@ msgstr "" "Content-Transfer-Encoding: 8-bit\n" "Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 2.8-dev\n" +"X-Generator: Weblate 2.11-dev\n" #: modules/gdscript/gd_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp msgid "Invalid type argument to convert(), use TYPE_* constants." -msgstr "Niepoprawny typ argumentu funkcji convert(), użyj stałej TYPE_*." +msgstr "Niepoprawny typ argumentu funkcji convert(), użyj stałych TYPE_*." #: modules/gdscript/gd_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp msgid "Not enough bytes for decoding bytes, or invalid format." -msgstr "Brak miejsca dla bajtów dekodujących, lub zły format." +msgstr "" +"Niewystarczająca ilość bajtów dla bajtów dekodujących, albo zły format." #: modules/gdscript/gd_functions.cpp msgid "step argument is zero!" -msgstr "argument kroku jest zerowy!" - -#: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" +msgstr "argument kroku wynosi zero!" #: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" -msgstr "Nie jest to skrypt z instancją" +msgstr "To nie jest skrypt z instancją" #: modules/gdscript/gd_functions.cpp msgid "Not based on a script" @@ -402,79 +399,79 @@ msgstr "" msgid "just released" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Error creating the signature object." msgstr "Błąd przy eksporcie projektu!" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid unique name." msgstr "Niewłaściwa nazwa." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid product GUID." msgstr "Niepoprawny rozmiar fonta." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid publisher GUID." msgstr "Niepoprawna ścieżka bazowa" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid background color." msgstr "Nie rozpoznano typu czcionki." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" @@ -615,10 +612,6 @@ msgstr "" "VisibilityEnable2D działa najlepiej, gdy jest bezpośrednio pod korzeniem " "aktualnie edytowanej sceny." -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "" - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -698,7 +691,8 @@ msgstr "" msgid "Cancel" msgstr "Anuluj" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "OK" @@ -1854,6 +1848,11 @@ msgid "Constants:" msgstr "Stałe:" #: tools/editor/editor_help.cpp +#, fuzzy +msgid "Property Description:" +msgstr "Krótki opis:" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "Opis Metody:" @@ -1921,7 +1920,9 @@ msgstr "Błąd podczas zapisu zasobu!" msgid "Save Resource As.." msgstr "Zapisz zasób jako..." -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "Widzę.." @@ -2159,7 +2160,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "Wybierz główną scenę" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp #, fuzzy msgid "Ugh" msgstr "Błąd" @@ -2865,6 +2868,7 @@ msgstr "Źródło tekstury:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "Ścieżka docelowa:" @@ -3094,6 +3098,11 @@ msgid "Auto" msgstr "Automatyczny" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +#, fuzzy +msgid "Root Node Name:" +msgstr "Nazwa węzła:" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "Brakuje następujących plików:" @@ -4002,6 +4011,51 @@ msgstr "Ustaw Wartość" msgid "Snap (Pixels):" msgstr "" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Add %s" +msgstr "Dodaj wszystko" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "Utwórz węzeł" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "OK :(" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Change default type" +msgstr "Zmień Wartość Domyślną" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4868,18 +4922,6 @@ msgstr "Przejdź do linii.." msgid "Contextual Help" msgstr "Pomoc kontekstowa" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "Wierzchołek" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "" @@ -5643,6 +5685,71 @@ msgid "No exporter for platform '%s' yet." msgstr "Brak jeszcze eksportu dla platformy '%s'." #: tools/editor/project_export.cpp +#, fuzzy +msgid "Create Android keystore" +msgstr "Utwórz nowy zasób" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Full name" +msgstr "Poprawna nazwa" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Organization" +msgstr "Przejście" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "State" +msgstr "Status:" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Password" +msgstr "Hasło:" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "at least 6 characters" +msgstr "Dopuszczalne znaki:" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "File name" +msgstr "Nowa nazwa:" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "Zawiera" @@ -6102,10 +6209,6 @@ msgid "Erase Input Action Event" msgstr "" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "Błąd zapisu ustawień." @@ -6249,7 +6352,7 @@ msgstr "Plik.." msgid "Dir.." msgstr "Katalog.." -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "Wczytaj" @@ -6283,10 +6386,6 @@ msgid "Properties:" msgstr "Właściwości:" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "Globalne" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "" @@ -6322,7 +6421,7 @@ msgstr "" #: tools/editor/reparent_dialog.cpp tools/editor/scene_tree_dock.cpp msgid "Reparent" -msgstr "" +msgstr "Zmień nadrzędny" #: tools/editor/resources_dock.cpp msgid "Create New Resource" @@ -6365,14 +6464,6 @@ msgid "Scene Run Settings" msgstr "Ustawienia uruchomienia sceny" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "OK :(" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "" @@ -6381,10 +6472,6 @@ msgid "Error loading scene from %s" msgstr "Błąd przy ładowaniu sceny z %s" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "Ok" @@ -6400,15 +6487,16 @@ msgstr "" #: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on the tree root." -msgstr "" +msgstr "Nie można wykonać tej operacji na głównym węźle drzewa." #: tools/editor/scene_tree_dock.cpp msgid "Move Node In Parent" msgstr "" #: tools/editor/scene_tree_dock.cpp +#, fuzzy msgid "Move Nodes In Parent" -msgstr "" +msgstr "Przenieść węzły do węzła nadrzędnego." #: tools/editor/scene_tree_dock.cpp msgid "Duplicate Node(s)" @@ -6423,12 +6511,8 @@ msgid "This operation can't be done without a scene." msgstr "Ta operacja nie może zostać wykonana bez sceny." #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." -msgstr "" +msgstr "Tej operacji nie można wykonać na dziedziczącej scenie." #: tools/editor/scene_tree_dock.cpp msgid "Save New Scene As.." @@ -6451,22 +6535,21 @@ msgid "Remove Node(s)" msgstr "Usuń węzeł(y)" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "Utwórz węzeł" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." msgstr "" +"Nie udało się zapisać sceny. Najprawdopodobniej pewne zależności nie są " +"spełnione." #: tools/editor/scene_tree_dock.cpp msgid "Error saving scene." msgstr "Błąd podczas zapisywania sceny." #: tools/editor/scene_tree_dock.cpp +#, fuzzy msgid "Error duplicating scene to save it." -msgstr "" +msgstr "Błąd duplikowania sceny przy zapisywaniu." #: tools/editor/scene_tree_dock.cpp msgid "Edit Groups" @@ -6493,10 +6576,16 @@ msgid "Change Type" msgstr "Zmień typ" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" +#, fuzzy +msgid "Attach Script" msgstr "Dodaj skrypt" #: tools/editor/scene_tree_dock.cpp +#, fuzzy +msgid "Clear Script" +msgstr "Utwórz Skrypt" + +#: tools/editor/scene_tree_dock.cpp msgid "Merge From Scene" msgstr "Dołącz ze sceny" @@ -6519,24 +6608,22 @@ msgid "" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." +#, fuzzy +msgid "Attach a new or existing script for the selected node." msgstr "Utwórz nowy skrypt dla zaznaczonego węzła." -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." -msgstr "" -"Ten obiekt nie może być widoczny ponieważ jego rodzic jest ukryty. Odkryj " -"najpierw rodzica." +#: tools/editor/scene_tree_dock.cpp +#, fuzzy +msgid "Clear a script for the selected node." +msgstr "Utwórz nowy skrypt dla zaznaczonego węzła." #: tools/editor/scene_tree_editor.cpp msgid "Toggle Spatial Visible" -msgstr "" +msgstr "Przełącz widoczność Spatial" #: tools/editor/scene_tree_editor.cpp msgid "Toggle CanvasItem Visible" -msgstr "" +msgstr "Przełącz widoczność CanvasItem" #: tools/editor/scene_tree_editor.cpp msgid "Instance:" @@ -6556,15 +6643,16 @@ msgstr "Drzewo sceny (węzły):" #: tools/editor/scene_tree_editor.cpp msgid "Editable Children" -msgstr "" +msgstr "Edytowalne dzieci" #: tools/editor/scene_tree_editor.cpp msgid "Load As Placeholder" -msgstr "" +msgstr "Załaduj jako zastępczy" #: tools/editor/scene_tree_editor.cpp +#, fuzzy msgid "Discard Instancing" -msgstr "" +msgstr "Odrzuć instancjonowanie" #: tools/editor/scene_tree_editor.cpp msgid "Open in Editor" @@ -6623,6 +6711,11 @@ msgid "Could not create script in filesystem." msgstr "Nie można było utworzyć skryptu w systemie plików." #: tools/editor/script_create_dialog.cpp +#, fuzzy +msgid "Error loading script from %s" +msgstr "Błąd przy ładowaniu sceny z %s" + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "Ścieżka jest pusta" @@ -6635,16 +6728,18 @@ msgid "Invalid base path" msgstr "Niepoprawna ścieżka bazowa" #: tools/editor/script_create_dialog.cpp -msgid "File exists" -msgstr "Plik Istnieje" - -#: tools/editor/script_create_dialog.cpp msgid "Invalid extension" msgstr "Niepoprawne rozszerzenie" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" -msgstr "Poprawna ścieżka" +#, fuzzy +msgid "Create new script" +msgstr "Utwórz Skrypt" + +#: tools/editor/script_create_dialog.cpp +#, fuzzy +msgid "Load existing script" +msgstr "Następny skrypt" #: tools/editor/script_create_dialog.cpp msgid "Class Name:" @@ -6655,7 +6750,8 @@ msgid "Built-In Script" msgstr "Wbudowany skrypt" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" +#, fuzzy +msgid "Attach Node Script" msgstr "Utwórz skrypt dla węzła" #: tools/editor/script_editor_debugger.cpp @@ -6822,6 +6918,37 @@ msgstr "Zmień długość Ray Shape" msgid "Change Notifier Extents" msgstr "" +#: tools/editor/spatial_editor_gizmos.cpp +#, fuzzy +msgid "Change Probe Extents" +msgstr "Zmień rozmiar Box Shape" + +#~ msgid "Vertex" +#~ msgstr "Wierzchołek" + +#~ msgid "Global" +#~ msgstr "Globalne" + +#~ msgid "" +#~ "This item cannot be made visible because the parent is hidden. Unhide the " +#~ "parent first." +#~ msgstr "" +#~ "Ten obiekt nie może być widoczny ponieważ jego rodzic jest ukryty. Odkryj " +#~ "najpierw rodzica." + +#~ msgid "" +#~ "Paths cannot start with '/', absolute paths must start with 'res://', " +#~ "'user://', or 'local://'" +#~ msgstr "" +#~ "Ścieżki nie mogą zaczynać się od '/', ścieżki absolutne muszą zaczynać " +#~ "się od 'res://', 'user://', lub 'local://'" + +#~ msgid "File exists" +#~ msgstr "Plik Istnieje" + +#~ msgid "Valid path" +#~ msgstr "Poprawna ścieżka" + #~ msgid "Cannot go into subdir:" #~ msgstr "Nie można iść do podkatalogu:" diff --git a/tools/translations/ro.po b/tools/translations/pr.po index e4782fec64..f8a9505066 100644 --- a/tools/translations/ro.po +++ b/tools/translations/pr.po @@ -1,173 +1,191 @@ -# Romanian translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Pirate translation of the Godot Engine editor +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# Zion Nimchuk <zionnimchuk@gmail.com>, 2016. # msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" -"Language: ro\n" +"PO-Revision-Date: 2016-11-14 19:48+0000\n" +"Last-Translator: Zion Nimchuk <zionnimchuk@gmail.com>\n" +"Language-Team: Pirate <https://hosted.weblate.org/projects/godot-engine/" +"godot/pr/>\n" +"Language: pr\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8-bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 2.10-dev\n" #: modules/gdscript/gd_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp msgid "Invalid type argument to convert(), use TYPE_* constants." msgstr "" +"Shiver me timbers! ye type argument t' convert() be wrong! use yer TYPE_* " +"constants!" #: modules/gdscript/gd_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp msgid "Not enough bytes for decoding bytes, or invalid format." -msgstr "" +msgstr "Nah enough bytes fer decodin' bytes, or ye got th' wrong ship." #: modules/gdscript/gd_functions.cpp msgid "step argument is zero!" -msgstr "" - -#: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" +msgstr "Blimey! Ye step argument be marooned!" #: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" -msgstr "" +msgstr "Arr! Yer script is marooned!" #: modules/gdscript/gd_functions.cpp msgid "Not based on a script" -msgstr "" +msgstr "Ye be loaded to the gunwalls? It's anchorage be not on a script!" #: modules/gdscript/gd_functions.cpp msgid "Not based on a resource file" -msgstr "" +msgstr "Yer anchorage not be on a resource file, ye bilge rat!" #: modules/gdscript/gd_functions.cpp msgid "Invalid instance dictionary format (missing @path)" -msgstr "" +msgstr "Ye got th' wrong dictionary getup! (ye be missin' yer @path!)" #: modules/gdscript/gd_functions.cpp msgid "Invalid instance dictionary format (can't load script at @path)" -msgstr "" +msgstr "Ye got th' wrong dictionary getup! (yer script aint' at ye @path)" #: modules/gdscript/gd_functions.cpp msgid "Invalid instance dictionary format (invalid script at @path)" msgstr "" +"Ye got th' wrong dictionary getup! (ye be drinkin'? Ye got yerself a bad " +"script at @path!)" #: modules/gdscript/gd_functions.cpp msgid "Invalid instance dictionary (invalid subclasses)" msgstr "" +"Ye got th' wrong dictionary getup! (yer subclasses be walkin' the plank!)" #: modules/visual_script/visual_script.cpp msgid "" "A node yielded without working memory, please read the docs on how to yield " "properly!" msgstr "" +"Yer scurvy node yielded but she got n' workin' memry'! Ye should keep a " +"lookout for em' docs, she knows how t' yield like yer captain!" #: modules/visual_script/visual_script.cpp msgid "" "Node yielded, but did not return a function state in the first working " "memory." msgstr "" +"Yer scurvy node yielded but er' booty didn't have no function state in er' " +"maiden workin' memry'!" #: modules/visual_script/visual_script.cpp msgid "" "Return value must be assigned to first element of node working memory! Fix " "your node please." msgstr "" +"Yer value best be comin' back posted to ye first element of yer node's " +"workin' memry'! Swab the decks!" #: modules/visual_script/visual_script.cpp msgid "Node returned an invalid sequence output: " -msgstr "" +msgstr "Blow the man down! Yer node's booty got ye n' a evil sequence output: " #: modules/visual_script/visual_script.cpp msgid "Found sequence bit but not the node in the stack, report bug!" msgstr "" +"Arrr! I found yer sequence bit but there be no node in yer stack. Tell th' " +"Captain!" #: modules/visual_script/visual_script.cpp msgid "Stack overflow with stack depth: " -msgstr "" +msgstr "Avast! Yer stack has burst! Her depth be: " #: modules/visual_script/visual_script_editor.cpp msgid "Functions:" -msgstr "" +msgstr "Yer functions:" #: modules/visual_script/visual_script_editor.cpp msgid "Variables:" -msgstr "" +msgstr "Yer variables:" #: modules/visual_script/visual_script_editor.cpp tools/editor/editor_help.cpp msgid "Signals:" -msgstr "" +msgstr "Yer signals:" #: modules/visual_script/visual_script_editor.cpp msgid "Name is not a valid identifier:" -msgstr "" +msgstr "Yer name's got no valid identifier: " #: modules/visual_script/visual_script_editor.cpp msgid "Name already in use by another func/var/signal:" msgstr "" +"Yer name be backstabin'! She be used by another dastardly func/var/signal:" #: modules/visual_script/visual_script_editor.cpp msgid "Rename Function" -msgstr "" +msgstr "Rename Function" #: modules/visual_script/visual_script_editor.cpp msgid "Rename Variable" -msgstr "" +msgstr "Rename Variable" #: modules/visual_script/visual_script_editor.cpp msgid "Rename Signal" -msgstr "" +msgstr "Rename Signal" #: modules/visual_script/visual_script_editor.cpp msgid "Add Function" -msgstr "" +msgstr "Add Function" #: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" -msgstr "" +msgstr "Add Variable" #: modules/visual_script/visual_script_editor.cpp msgid "Add Signal" -msgstr "" +msgstr "Add Signal" #: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" -msgstr "" +msgstr "Discharge ye' Function" #: modules/visual_script/visual_script_editor.cpp msgid "Remove Variable" -msgstr "" +msgstr "Discharge ye' Variable" #: modules/visual_script/visual_script_editor.cpp msgid "Editing Variable:" -msgstr "" +msgstr "Ye be fixin' Variable:" #: modules/visual_script/visual_script_editor.cpp msgid "Remove Signal" -msgstr "" +msgstr "Discharge ye' Signal" #: modules/visual_script/visual_script_editor.cpp msgid "Editing Signal:" -msgstr "" +msgstr "Ye be fixin' Signal:" #: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" -msgstr "" +msgstr "Swap yer Expression" #: modules/visual_script/visual_script_editor.cpp msgid "Add Node" -msgstr "" +msgstr "Add Node" #: modules/visual_script/visual_script_editor.cpp msgid "Hold Meta to drop a Getter. Hold Shift to drop a generic signature." msgstr "" +"Smash yer Meta t' sink yer Getter. Smash yer Shift t' sink a generic " +"signature." #: modules/visual_script/visual_script_editor.cpp msgid "Hold Ctrl to drop a Getter. Hold Shift to drop a generic signature." msgstr "" +"Smash yer Ctrl t' sink yer Getter. Smash yer Shift t' sink a generic " +"signature." #: modules/visual_script/visual_script_editor.cpp msgid "Hold Meta to drop a simple reference to the node." @@ -375,74 +393,74 @@ msgstr "" msgid "just released" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid unique name." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid product GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid background color." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" @@ -550,10 +568,6 @@ msgid "" "as parent." msgstr "" -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "" - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -613,7 +627,8 @@ msgstr "" msgid "Cancel" msgstr "" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "" @@ -1756,6 +1771,10 @@ msgid "Constants:" msgstr "" #: tools/editor/editor_help.cpp +msgid "Property Description:" +msgstr "" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "" @@ -1823,7 +1842,9 @@ msgstr "" msgid "Save Resource As.." msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "" @@ -2048,7 +2069,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "" @@ -2728,6 +2751,7 @@ msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "" @@ -2955,6 +2979,10 @@ msgid "Auto" msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +msgid "Root Node Name:" +msgstr "" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "" @@ -3854,6 +3882,49 @@ msgstr "" msgid "Snap (Pixels):" msgstr "" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Change default type" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4718,18 +4789,6 @@ msgstr "" msgid "Contextual Help" msgstr "" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "" @@ -5492,6 +5551,64 @@ msgid "No exporter for platform '%s' yet." msgstr "" #: tools/editor/project_export.cpp +msgid "Create Android keystore" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Full name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organization" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "State" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Password" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "at least 6 characters" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "File name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "" @@ -5951,10 +6068,6 @@ msgid "Erase Input Action Event" msgstr "" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "" @@ -6098,7 +6211,7 @@ msgstr "" msgid "Dir.." msgstr "" -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "" @@ -6131,10 +6244,6 @@ msgid "Properties:" msgstr "" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "" @@ -6211,14 +6320,6 @@ msgid "Scene Run Settings" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "" @@ -6227,10 +6328,6 @@ msgid "Error loading scene from %s" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "" @@ -6269,10 +6366,6 @@ msgid "This operation can't be done without a scene." msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "" @@ -6297,10 +6390,6 @@ msgid "Remove Node(s)" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6339,7 +6428,11 @@ msgid "Change Type" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" +msgid "Attach Script" +msgstr "" + +#: tools/editor/scene_tree_dock.cpp +msgid "Clear Script" msgstr "" #: tools/editor/scene_tree_dock.cpp @@ -6365,13 +6458,11 @@ msgid "" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." +msgid "Attach a new or existing script for the selected node." msgstr "" -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." msgstr "" #: tools/editor/scene_tree_editor.cpp @@ -6467,6 +6558,10 @@ msgid "Could not create script in filesystem." msgstr "" #: tools/editor/script_create_dialog.cpp +msgid "Error loading script from %s" +msgstr "" + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "" @@ -6479,15 +6574,15 @@ msgid "Invalid base path" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "File exists" +msgid "Invalid extension" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Invalid extension" +msgid "Create new script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" +msgid "Load existing script" msgstr "" #: tools/editor/script_create_dialog.cpp @@ -6499,7 +6594,7 @@ msgid "Built-In Script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" +msgid "Attach Node Script" msgstr "" #: tools/editor/script_editor_debugger.cpp @@ -6665,3 +6760,14 @@ msgstr "" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Notifier Extents" msgstr "" + +#: tools/editor/spatial_editor_gizmos.cpp +msgid "Change Probe Extents" +msgstr "" + +#~ msgid "" +#~ "Paths cannot start with '/', absolute paths must start with 'res://', " +#~ "'user://', or 'local://'" +#~ msgstr "" +#~ "Avast! Ye cannot steer yer ship with a '/'! Yer need t' start wit' " +#~ "'res://', 'user://', or 'local://' ye knave!" diff --git a/tools/translations/pt_BR.po b/tools/translations/pt_BR.po index de8b9920a5..106142b4ea 100644 --- a/tools/translations/pt_BR.po +++ b/tools/translations/pt_BR.po @@ -1,5 +1,5 @@ # Portuguese (Brazil) translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # # António Sarmento <antonio.luis.sarmento@gmail.com>, 2016. @@ -37,12 +37,6 @@ msgid "step argument is zero!" msgstr "o argumento step é zero!" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" msgstr "Não é um script com uma instância" @@ -402,79 +396,79 @@ msgstr "" msgid "just released" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Error creating the signature object." msgstr "Erro ao escrever o PCK do projeto!" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid unique name." msgstr "Nome Inválido." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid product GUID." msgstr "Tamanho de fonte inválido." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid publisher GUID." msgstr "Caminho base inválido" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid background color." msgstr "Origem personalizada da fonte inválida." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" @@ -616,10 +610,6 @@ msgstr "" "VisibilityEnable2D funciona melhor quando usado como filho direto da raiz da " "cena atualmente editada." -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "BakedLightInstance não contém um recurso BakedLight ." - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -698,7 +688,8 @@ msgstr "" msgid "Cancel" msgstr "Cancelar" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "OK" @@ -1858,6 +1849,11 @@ msgid "Constants:" msgstr "Constantes:" #: tools/editor/editor_help.cpp +#, fuzzy +msgid "Property Description:" +msgstr "Descrição breve:" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "Descrição do Método:" @@ -1925,7 +1921,9 @@ msgstr "Erro ao salvar Recurso!" msgid "Save Resource As.." msgstr "Salvar Recuso como..." -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "Entendo..." @@ -2163,7 +2161,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "Escolha uma Cena Principal" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "Ugh" @@ -2867,6 +2867,7 @@ msgstr "Textura(s) de Origem:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "Caminho Destino:" @@ -3100,6 +3101,11 @@ msgid "Auto" msgstr "Auto" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +#, fuzzy +msgid "Root Node Name:" +msgstr "Nome do Nó:" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "Os Seguintes Arquivos estão Faltando:" @@ -4012,6 +4018,51 @@ msgstr "Defina um Valor" msgid "Snap (Pixels):" msgstr "Snap (Pixels):" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Add %s" +msgstr "Adicionar Todos" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "Criar Nó" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "Erro ao instanciar cena de %s" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "OK :(" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "Sem nó pai onde instanciar um filho." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "Essa operação requer um único nó selecionado." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#, fuzzy +msgid "Change default type" +msgstr "Alterar Valor Padrão" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4883,18 +4934,6 @@ msgstr "Ir para linha..." msgid "Contextual Help" msgstr "Ajuda Contextual" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "Vértice" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "Fragmento" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "Iluminação" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "Alterar Constante Escalar" @@ -5659,6 +5698,71 @@ msgid "No exporter for platform '%s' yet." msgstr "Ainda não há exportador para a plataforma \"%s\"." #: tools/editor/project_export.cpp +#, fuzzy +msgid "Create Android keystore" +msgstr "Criar Novo Recurso" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Full name" +msgstr "Nome Válido" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Organization" +msgstr "Transição" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "State" +msgstr "Status:" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Password" +msgstr "Senha:" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "at least 6 characters" +msgstr "Caracteres válidos:" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "File name" +msgstr "Novo nome:" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "Incluir" @@ -6125,10 +6229,6 @@ msgid "Erase Input Action Event" msgstr "Apagar Evento Ação de Entrada" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "Alternar Persistência" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "Erro ao salvar as configurações." @@ -6272,7 +6372,7 @@ msgstr "Arquivo..." msgid "Dir.." msgstr "Dir..." -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "Carregar" @@ -6306,10 +6406,6 @@ msgid "Properties:" msgstr "Propriedades:" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "Global" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "Seções:" @@ -6388,14 +6484,6 @@ msgid "Scene Run Settings" msgstr "Configurações de Carregamento da Cena" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "OK :(" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "Sem nó pai onde instanciar um filho." - -#: tools/editor/scene_tree_dock.cpp #, fuzzy msgid "No parent to instance the scenes at." msgstr "Sem nó pai onde instanciar um filho." @@ -6405,10 +6493,6 @@ msgid "Error loading scene from %s" msgstr "Erro ao carregar cena de %s" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "Erro ao instanciar cena de %s" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "Ok" @@ -6449,10 +6533,6 @@ msgid "This operation can't be done without a scene." msgstr "Essa operação não pode ser realizada sem uma cena." #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "Essa operação requer um único nó selecionado." - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "Essa operação não pode ser realizada em cenas instanciadas." @@ -6477,10 +6557,6 @@ msgid "Remove Node(s)" msgstr "Remover Nó(s)" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "Criar Nó" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6521,10 +6597,16 @@ msgid "Change Type" msgstr "Alterar Tipo" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" +#, fuzzy +msgid "Attach Script" msgstr "Adicionar Script" #: tools/editor/scene_tree_dock.cpp +#, fuzzy +msgid "Clear Script" +msgstr "Criar Script" + +#: tools/editor/scene_tree_dock.cpp msgid "Merge From Scene" msgstr "Fundir a Partir de Cena" @@ -6549,16 +6631,14 @@ msgstr "" "existe um nó raiz." #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." +#, fuzzy +msgid "Attach a new or existing script for the selected node." msgstr "Criar um script novo para o nó selecionado." -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." -msgstr "" -"Este item não pode se tornar visível porque o pai está escondido. Reexiba o " -"pai primeiro." +#: tools/editor/scene_tree_dock.cpp +#, fuzzy +msgid "Clear a script for the selected node." +msgstr "Criar um script novo para o nó selecionado." #: tools/editor/scene_tree_editor.cpp msgid "Toggle Spatial Visible" @@ -6653,6 +6733,11 @@ msgid "Could not create script in filesystem." msgstr "Não foi possível criar o script no sistema de arquivos." #: tools/editor/script_create_dialog.cpp +#, fuzzy +msgid "Error loading script from %s" +msgstr "Erro ao carregar cena de %s" + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "O caminho está vazio" @@ -6665,16 +6750,18 @@ msgid "Invalid base path" msgstr "Caminho base inválido" #: tools/editor/script_create_dialog.cpp -msgid "File exists" -msgstr "O arquivo existe" - -#: tools/editor/script_create_dialog.cpp msgid "Invalid extension" msgstr "Extensão inválida" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" -msgstr "Caminho válido" +#, fuzzy +msgid "Create new script" +msgstr "Criar Script" + +#: tools/editor/script_create_dialog.cpp +#, fuzzy +msgid "Load existing script" +msgstr "Próximo Script" #: tools/editor/script_create_dialog.cpp msgid "Class Name:" @@ -6685,7 +6772,8 @@ msgid "Built-In Script" msgstr "Script Embutido" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" +#, fuzzy +msgid "Attach Node Script" msgstr "Criar Script para Nó" #: tools/editor/script_editor_debugger.cpp @@ -6852,6 +6940,42 @@ msgstr "Mudar o tamanho do Shape Ray" msgid "Change Notifier Extents" msgstr "Alterar a Extensão do Notificador" +#: tools/editor/spatial_editor_gizmos.cpp +#, fuzzy +msgid "Change Probe Extents" +msgstr "Alterar a Extensão do Notificador" + +#~ msgid "BakedLightInstance does not contain a BakedLight resource." +#~ msgstr "BakedLightInstance não contém um recurso BakedLight ." + +#~ msgid "Vertex" +#~ msgstr "Vértice" + +#~ msgid "Fragment" +#~ msgstr "Fragmento" + +#~ msgid "Lighting" +#~ msgstr "Iluminação" + +#~ msgid "Toggle Persisting" +#~ msgstr "Alternar Persistência" + +#~ msgid "Global" +#~ msgstr "Global" + +#~ msgid "" +#~ "This item cannot be made visible because the parent is hidden. Unhide the " +#~ "parent first." +#~ msgstr "" +#~ "Este item não pode se tornar visível porque o pai está escondido. Reexiba " +#~ "o pai primeiro." + +#~ msgid "File exists" +#~ msgstr "O arquivo existe" + +#~ msgid "Valid path" +#~ msgstr "Caminho válido" + #~ msgid "Cannot go into subdir:" #~ msgstr "Não é possível ir ao subdiretório:" diff --git a/tools/translations/pt_PT.po b/tools/translations/pt_PT.po index 21727ce186..7b3c814f8c 100644 --- a/tools/translations/pt_PT.po +++ b/tools/translations/pt_PT.po @@ -1,5 +1,5 @@ # Portuguese (Portugal) translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # # António Sarmento <antonio.luis.sarmento@gmail.com>, 2016. @@ -33,12 +33,6 @@ msgid "step argument is zero!" msgstr "o argumento \"step\" é zero!" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" msgstr "Não é um script com uma instância" @@ -393,75 +387,75 @@ msgstr "" msgid "just released" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid unique name." msgstr "Nome de índice propriedade inválido." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid product GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid background color." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" @@ -569,10 +563,6 @@ msgid "" "as parent." msgstr "" -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "" - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -632,7 +622,8 @@ msgstr "" msgid "Cancel" msgstr "" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "" @@ -1775,6 +1766,10 @@ msgid "Constants:" msgstr "" #: tools/editor/editor_help.cpp +msgid "Property Description:" +msgstr "" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "" @@ -1842,7 +1837,9 @@ msgstr "" msgid "Save Resource As.." msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "" @@ -2067,7 +2064,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "" @@ -2747,6 +2746,7 @@ msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "" @@ -2974,6 +2974,10 @@ msgid "Auto" msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +msgid "Root Node Name:" +msgstr "" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "" @@ -3873,6 +3877,49 @@ msgstr "" msgid "Snap (Pixels):" msgstr "" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Change default type" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4738,18 +4785,6 @@ msgstr "" msgid "Contextual Help" msgstr "" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "" @@ -5512,6 +5547,64 @@ msgid "No exporter for platform '%s' yet." msgstr "" #: tools/editor/project_export.cpp +msgid "Create Android keystore" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Full name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organization" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "State" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Password" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "at least 6 characters" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "File name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "" @@ -5971,10 +6064,6 @@ msgid "Erase Input Action Event" msgstr "" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "" @@ -6118,7 +6207,7 @@ msgstr "" msgid "Dir.." msgstr "" -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "" @@ -6151,10 +6240,6 @@ msgid "Properties:" msgstr "" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "" @@ -6232,14 +6317,6 @@ msgid "Scene Run Settings" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "" @@ -6248,10 +6325,6 @@ msgid "Error loading scene from %s" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "" @@ -6290,10 +6363,6 @@ msgid "This operation can't be done without a scene." msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "" @@ -6318,10 +6387,6 @@ msgid "Remove Node(s)" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6360,7 +6425,11 @@ msgid "Change Type" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" +msgid "Attach Script" +msgstr "" + +#: tools/editor/scene_tree_dock.cpp +msgid "Clear Script" msgstr "" #: tools/editor/scene_tree_dock.cpp @@ -6386,13 +6455,11 @@ msgid "" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." +msgid "Attach a new or existing script for the selected node." msgstr "" -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." msgstr "" #: tools/editor/scene_tree_editor.cpp @@ -6488,6 +6555,10 @@ msgid "Could not create script in filesystem." msgstr "" #: tools/editor/script_create_dialog.cpp +msgid "Error loading script from %s" +msgstr "" + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "" @@ -6500,15 +6571,15 @@ msgid "Invalid base path" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "File exists" +msgid "Invalid extension" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Invalid extension" +msgid "Create new script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" +msgid "Load existing script" msgstr "" #: tools/editor/script_create_dialog.cpp @@ -6520,7 +6591,7 @@ msgid "Built-In Script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" +msgid "Attach Node Script" msgstr "" #: tools/editor/script_editor_debugger.cpp @@ -6686,3 +6757,7 @@ msgstr "" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Notifier Extents" msgstr "" + +#: tools/editor/spatial_editor_gizmos.cpp +msgid "Change Probe Extents" +msgstr "" diff --git a/tools/translations/ru.po b/tools/translations/ru.po index b8288d07a4..73262dbd5e 100644 --- a/tools/translations/ru.po +++ b/tools/translations/ru.po @@ -1,5 +1,5 @@ # Russian translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # # DimOkGamer <dimokgamer@gmail.com>, 2016. @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2016-09-14 21:55+0000\n" +"PO-Revision-Date: 2016-12-14 17:04+0000\n" "Last-Translator: DimOkGamer <dimokgamer@gmail.com>\n" "Language-Team: Russian <https://hosted.weblate.org/projects/godot-engine/" "godot/ru/>\n" @@ -20,7 +20,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 2.8\n" +"X-Generator: Weblate 2.10-dev\n" #: modules/gdscript/gd_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -37,12 +37,6 @@ msgid "step argument is zero!" msgstr "Аргумент шага равен нулю!" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" msgstr "Скрипт без экземпляра" @@ -172,9 +166,8 @@ msgid "Editing Signal:" msgstr "Редактирование сигнала:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Change Expression" -msgstr "Изменить тип" +msgstr "Изменить выражение" #: modules/visual_script/visual_script_editor.cpp msgid "Add Node" @@ -225,40 +218,36 @@ msgid "Add Setter Property" msgstr "Добавить устанавливающее свойство" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Condition" -msgstr "Копировать анимацию" +msgstr "Условие" #: modules/visual_script/visual_script_editor.cpp msgid "Sequence" -msgstr "" +msgstr "Последовательность" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Switch" -msgstr "Высота" +msgstr "Переключатель" #: modules/visual_script/visual_script_editor.cpp msgid "Iterator" -msgstr "" +msgstr "Итератор" #: modules/visual_script/visual_script_editor.cpp msgid "While" -msgstr "" +msgstr "Пока" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Return" -msgstr "Возвращение:" +msgstr "Возвращение" #: modules/visual_script/visual_script_editor.cpp tools/editor/call_dialog.cpp msgid "Call" msgstr "Вызов" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Get" -msgstr "Задан" +msgstr "Получить" #: modules/visual_script/visual_script_editor.cpp #: tools/editor/property_editor.cpp @@ -399,87 +388,84 @@ msgstr "" #: modules/visual_script/visual_script_nodes.cpp msgid "just pressed" -msgstr "" +msgstr "просто нажата" #: modules/visual_script/visual_script_nodes.cpp msgid "just released" -msgstr "" +msgstr "просто отпущена" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" -msgstr "" +msgstr "Не могу прочитать файл сертификата. Уверены, что путь и пароль верны?" -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." -msgstr "Ошибка записи PCK файла!" +msgstr "Ошибка при создании объекта подписи." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." -msgstr "" +msgstr "Ошибка при создании подписи пакета." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" +"Шаблоны экспорта не найдены.\n" +"Скачайте и установите шаблоны экспорта." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." -msgstr "" +msgstr "Пользовательский отладочный пакет не найден." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." -msgstr "" +msgstr "Пользовательский релизный пакет не найден." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid unique name." -msgstr "Недопустимое имя." +msgstr "Неверное уникальное имя." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid product GUID." -msgstr "Недопустимый размер шрифта." +msgstr "Неверный GUID продукта." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." -msgstr "Недопустимый базовый путь" +msgstr "Неверный GUID издателя." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid background color." -msgstr "Недопустимый шрифт пользовательского источника." +msgstr "Недопустимый цвет фона." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." -msgstr "" +msgstr "Неверные размеры логотипа для магазина (должны быть 50х50)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." -msgstr "" +msgstr "Неверные размеры квадратного логотипа 44x44 (должны быть 44x44)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." -msgstr "" +msgstr "Неверные размеры квадратного логотипа 71x71 (должны быть 71x71)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." -msgstr "" +msgstr "Неверные размеры квадратного логотипа 150x150 (должны быть 150x150)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." -msgstr "" +msgstr "Неверные размеры квадратного логотипа 310x310 (должны быть 310x310)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." -msgstr "" +msgstr "Неверные размеры широкого логотипа 310x150 (должны быть 310x150)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." -msgstr "" +msgstr "Неверные размеры заставки (должны быть 620x300)." #: scene/2d/animated_sprite.cpp msgid "" @@ -623,10 +609,6 @@ msgstr "" "VisibilityEnable2D работает наилучшим образом при использовании корня " "редактируемой сцены, как прямого родителя." -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "BakedLightInstance не содержит BakedLight ресурс." - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -673,11 +655,8 @@ msgstr "" "Navigation. Он предоставляет только навигационные данные." #: scene/3d/remote_transform.cpp -#, fuzzy msgid "Path property must point to a valid Spatial node to work." -msgstr "" -"Для корректной работы свойство Path должно указывать на действующий узел " -"Particles2D." +msgstr "Свойство Path должно указывать на действительный Spatial узел." #: scene/3d/scenario_fx.cpp msgid "" @@ -706,7 +685,8 @@ msgstr "" msgid "Cancel" msgstr "Отмена" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "Ок" @@ -1028,7 +1008,7 @@ msgstr "Дублировать перемещённый" #: tools/editor/animation_editor.cpp msgid "Remove Selection" -msgstr "Убрать выделение" +msgstr "Удалить выделенное" #: tools/editor/animation_editor.cpp msgid "Continuous" @@ -1452,6 +1432,8 @@ msgid "" "Target method not found! Specify a valid method or attach a script to target " "Node." msgstr "" +"Целевой метод не найден! Укажите правильный метод или прикрепите скрипт на " +"целевой узел." #: tools/editor/connections_dialog.cpp msgid "Connect To Node:" @@ -1869,6 +1851,11 @@ msgid "Constants:" msgstr "Константы:" #: tools/editor/editor_help.cpp +#, fuzzy +msgid "Property Description:" +msgstr "Краткое описание:" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "Описание методов:" @@ -1936,7 +1923,9 @@ msgstr "Ошибка при сохранении ресурса!" msgid "Save Resource As.." msgstr "Сохранить ресурс как.." -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "Ясно.." @@ -2174,7 +2163,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "Выберите главную сцену" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "Ясно" @@ -2495,9 +2486,8 @@ msgid "Editor Layout" msgstr "Макет редактора" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Toggle Fullscreen" -msgstr "Полноэкранный режим" +msgstr "Переключить полноэкранный режим" #: tools/editor/editor_node.cpp msgid "Install Export Templates" @@ -2525,7 +2515,7 @@ msgstr "Обновлять при изменениях" #: tools/editor/editor_node.cpp msgid "Disable Update Spinner" -msgstr "" +msgstr "Отключить счётчик обновлений" #: tools/editor/editor_node.cpp msgid "Inspector" @@ -2879,6 +2869,7 @@ msgstr "Исходные текстура(ы):" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "Целевой путь:" @@ -3112,6 +3103,10 @@ msgid "Auto" msgstr "Авто" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +msgid "Root Node Name:" +msgstr "Имя корневого узла:" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "Отсутствуют следующие файлы:" @@ -3460,7 +3455,7 @@ msgstr "Добавить анимацию" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Blend Next Changed" -msgstr "изменена последующая анимация" +msgstr "Изменена последующая анимация" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Change Blend Time" @@ -3958,9 +3953,8 @@ msgid "Clear Bones" msgstr "Очистить кости" #: tools/editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Show Bones" -msgstr "Создать кости" +msgstr "Показать кости" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Make IK Chain" @@ -4023,6 +4017,51 @@ msgstr "Установить значение" msgid "Snap (Pixels):" msgstr "Привязка (пиксели):" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "Добавить %s" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "Добавление %s..." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "Создать узел" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "Ошибка добавления сцены из %s" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "Ок :(" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "Не выбран родитель для добавления потомка." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "Эта операция требует одного выбранного узла." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Change default type" +msgstr "Изменить тип по умолчанию" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" +"Drag & drop + Shift : Добавить узел к выделению\n" +"Drag & drop + Alt : Изменить тип узла" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4701,9 +4740,8 @@ msgid "Close Docs" msgstr "Закрыть документацию" #: tools/editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Close All" -msgstr "Закрыть" +msgstr "Закрыть всё" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/plugins/script_text_editor.cpp @@ -4818,9 +4856,8 @@ msgstr "" "принадлежат, загружена" #: tools/editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Pick Color" -msgstr "Цвет" +msgstr "Выбрать цвет" #: tools/editor/plugins/script_text_editor.cpp tools/editor/scene_tree_dock.cpp msgid "Move Up" @@ -4893,18 +4930,6 @@ msgstr "Перейти к строке.." msgid "Contextual Help" msgstr "Контекстная справка" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "Вертекс" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "Фрагмент" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "Освещение" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "Изменена числовая константа" @@ -5198,9 +5223,8 @@ msgid "Insert Animation Key" msgstr "Вставить ключ анимации" #: tools/editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Focus Origin" -msgstr "Отображать начало координат" +msgstr "Фокус на центре" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Focus Selection" @@ -5468,9 +5492,8 @@ msgid "Remove Item" msgstr "Удалить элемент" #: tools/editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Theme" -msgstr "Сохранить тему" +msgstr "Тема" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Add Class Items" @@ -5669,6 +5692,71 @@ msgid "No exporter for platform '%s' yet." msgstr "Платформа '%s' пока не поддерживается." #: tools/editor/project_export.cpp +#, fuzzy +msgid "Create Android keystore" +msgstr "Создать новый ресурс" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Full name" +msgstr "Допустимое имя" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Organization" +msgstr "Переход" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "State" +msgstr "Статус:" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Password" +msgstr "Пароль:" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "at least 6 characters" +msgstr "Допустимые символы:" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "File name" +msgstr "Новое имя:" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "Включить" @@ -6132,10 +6220,6 @@ msgid "Erase Input Action Event" msgstr "Удалить действие" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "Переключено настаивание" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "Ошибка сохранения настроек." @@ -6279,7 +6363,7 @@ msgstr "Файл.." msgid "Dir.." msgstr "Папка.." -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "Загрузить" @@ -6288,9 +6372,8 @@ msgid "Assign" msgstr "Назначить" #: tools/editor/property_editor.cpp -#, fuzzy msgid "New Script" -msgstr "Следующий скрипт" +msgstr "Новый скрипт" #: tools/editor/property_editor.cpp msgid "Error loading file: Not a resource!" @@ -6313,10 +6396,6 @@ msgid "Properties:" msgstr "Свойства:" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "Глобальные" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "Разделы:" @@ -6395,14 +6474,6 @@ msgid "Scene Run Settings" msgstr "Параметры запуска сцены" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "Ок :(" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "Нет родителя для добавления потомка." - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "Нет родителя для добавления сюда сцены." @@ -6411,10 +6482,6 @@ msgid "Error loading scene from %s" msgstr "Ошибка при загрузке сцены из %s" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "Ошибка добавления сцены из %s" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "Ок" @@ -6455,10 +6522,6 @@ msgid "This operation can't be done without a scene." msgstr "Эта операция не может быть выполнена без сцены." #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "Эта операция требует одного выбранного узла." - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "Эта операция не может быть сделана на редактируемой сцене." @@ -6483,10 +6546,6 @@ msgid "Remove Node(s)" msgstr "Удалить узел(узлы)" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "Создать узел" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6527,8 +6586,12 @@ msgid "Change Type" msgstr "Изменить тип" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" -msgstr "Добавить скрипт" +msgid "Attach Script" +msgstr "Прикрепить скрипт" + +#: tools/editor/scene_tree_dock.cpp +msgid "Clear Script" +msgstr "Убрать скрипт" #: tools/editor/scene_tree_dock.cpp msgid "Merge From Scene" @@ -6555,16 +6618,12 @@ msgstr "" "не существует." #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." -msgstr "Создать новый скрипт для выбранного узла." +msgid "Attach a new or existing script for the selected node." +msgstr "Прикрепить новый или существующий скрипт к выбранному узлу." -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." -msgstr "" -"Этот объект не может быть отображён, потому что его родитель скрыт. " -"Отобразите сначала родительский узел." +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." +msgstr "Убрать скрипт у выбранного узла." #: tools/editor/scene_tree_editor.cpp msgid "Toggle Spatial Visible" @@ -6659,8 +6718,12 @@ msgid "Could not create script in filesystem." msgstr "Не удалось создать скрипт в файловой системе." #: tools/editor/script_create_dialog.cpp +msgid "Error loading script from %s" +msgstr "Ошибка при загрузке скрипта из %s" + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" -msgstr "Путь не назначен" +msgstr "Не указан путь" #: tools/editor/script_create_dialog.cpp msgid "Path is not local" @@ -6671,16 +6734,16 @@ msgid "Invalid base path" msgstr "Недопустимый базовый путь" #: tools/editor/script_create_dialog.cpp -msgid "File exists" -msgstr "Файл существует" - -#: tools/editor/script_create_dialog.cpp msgid "Invalid extension" msgstr "Недопустимое расширение" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" -msgstr "Допустимый путь" +msgid "Create new script" +msgstr "Создать новый скрипт" + +#: tools/editor/script_create_dialog.cpp +msgid "Load existing script" +msgstr "Загрузить существующий скрипт" #: tools/editor/script_create_dialog.cpp msgid "Class Name:" @@ -6691,8 +6754,8 @@ msgid "Built-In Script" msgstr "Встроенный Скрипт" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" -msgstr "Создать скрипт для узла" +msgid "Attach Node Script" +msgstr "Добавление скрипта" #: tools/editor/script_editor_debugger.cpp msgid "Bytes:" @@ -6858,6 +6921,49 @@ msgstr "Изменена длинна луча" msgid "Change Notifier Extents" msgstr "Изменены границы уведомителя" +#: tools/editor/spatial_editor_gizmos.cpp +#, fuzzy +msgid "Change Probe Extents" +msgstr "Изменены границы уведомителя" + +#~ msgid "BakedLightInstance does not contain a BakedLight resource." +#~ msgstr "BakedLightInstance не содержит BakedLight ресурс." + +#~ msgid "Vertex" +#~ msgstr "Вертекс" + +#~ msgid "Fragment" +#~ msgstr "Фрагмент" + +#~ msgid "Lighting" +#~ msgstr "Освещение" + +#~ msgid "Toggle Persisting" +#~ msgstr "Параметр изменён" + +#~ msgid "Global" +#~ msgstr "Глобальные" + +#~ msgid "" +#~ "This item cannot be made visible because the parent is hidden. Unhide the " +#~ "parent first." +#~ msgstr "" +#~ "Этот объект не может быть отображён, потому что его родитель скрыт. " +#~ "Отобразите сначала родительский узел." + +#~ msgid "" +#~ "Paths cannot start with '/', absolute paths must start with 'res://', " +#~ "'user://', or 'local://'" +#~ msgstr "" +#~ "Путь не может начинаться с '/', абсолютные пути должны начинаться с " +#~ "'res://', 'user://' или 'local://'" + +#~ msgid "File exists" +#~ msgstr "Файл существует" + +#~ msgid "Valid path" +#~ msgstr "Допустимый путь" + #~ msgid "" #~ "Custom node has no _get_output_port_unsequenced(idx,wmem), but " #~ "unsequenced ports were specified." diff --git a/tools/translations/sk.po b/tools/translations/sk.po index 0e21e5a94f..f1bd9f1300 100644 --- a/tools/translations/sk.po +++ b/tools/translations/sk.po @@ -1,5 +1,5 @@ # Slovak translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # # J08nY <johnenter@gmail.com>, 2016. @@ -32,12 +32,6 @@ msgid "step argument is zero!" msgstr "argument \"step\"/krok je nulový!" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" msgstr "" @@ -387,74 +381,74 @@ msgstr "" msgid "just released" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid unique name." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid product GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid background color." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" @@ -569,10 +563,6 @@ msgid "" "as parent." msgstr "" -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "" - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -632,7 +622,8 @@ msgstr "" msgid "Cancel" msgstr "" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "" @@ -1776,6 +1767,11 @@ msgid "Constants:" msgstr "Konštanty:" #: tools/editor/editor_help.cpp +#, fuzzy +msgid "Property Description:" +msgstr "Popis:" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "" @@ -1843,7 +1839,9 @@ msgstr "" msgid "Save Resource As.." msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "" @@ -2068,7 +2066,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "" @@ -2749,6 +2749,7 @@ msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "" @@ -2976,6 +2977,10 @@ msgid "Auto" msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +msgid "Root Node Name:" +msgstr "" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "" @@ -3875,6 +3880,49 @@ msgstr "" msgid "Snap (Pixels):" msgstr "" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Change default type" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4740,18 +4788,6 @@ msgstr "" msgid "Contextual Help" msgstr "" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "" @@ -5517,6 +5553,65 @@ msgid "No exporter for platform '%s' yet." msgstr "" #: tools/editor/project_export.cpp +#, fuzzy +msgid "Create Android keystore" +msgstr "Vytvoriť adresár" + +#: tools/editor/project_export.cpp +msgid "Full name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organization" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "State" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Password" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "at least 6 characters" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "File name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "" @@ -5976,10 +6071,6 @@ msgid "Erase Input Action Event" msgstr "" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "" @@ -6123,7 +6214,7 @@ msgstr "" msgid "Dir.." msgstr "" -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "" @@ -6157,10 +6248,6 @@ msgid "Properties:" msgstr "" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "" @@ -6237,14 +6324,6 @@ msgid "Scene Run Settings" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "" @@ -6253,10 +6332,6 @@ msgid "Error loading scene from %s" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "" @@ -6295,10 +6370,6 @@ msgid "This operation can't be done without a scene." msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "" @@ -6323,10 +6394,6 @@ msgid "Remove Node(s)" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6365,8 +6432,14 @@ msgid "Change Type" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" -msgstr "" +#, fuzzy +msgid "Attach Script" +msgstr "Popis:" + +#: tools/editor/scene_tree_dock.cpp +#, fuzzy +msgid "Clear Script" +msgstr "Popis:" #: tools/editor/scene_tree_dock.cpp msgid "Merge From Scene" @@ -6391,13 +6464,11 @@ msgid "" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." +msgid "Attach a new or existing script for the selected node." msgstr "" -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." msgstr "" #: tools/editor/scene_tree_editor.cpp @@ -6493,6 +6564,10 @@ msgid "Could not create script in filesystem." msgstr "" #: tools/editor/script_create_dialog.cpp +msgid "Error loading script from %s" +msgstr "" + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "" @@ -6505,16 +6580,18 @@ msgid "Invalid base path" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "File exists" +msgid "Invalid extension" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Invalid extension" -msgstr "" +#, fuzzy +msgid "Create new script" +msgstr "Popis:" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" -msgstr "" +#, fuzzy +msgid "Load existing script" +msgstr "Popis:" #: tools/editor/script_create_dialog.cpp msgid "Class Name:" @@ -6525,8 +6602,9 @@ msgid "Built-In Script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" -msgstr "" +#, fuzzy +msgid "Attach Node Script" +msgstr "Popis:" #: tools/editor/script_editor_debugger.cpp msgid "Bytes:" @@ -6691,3 +6769,7 @@ msgstr "" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Notifier Extents" msgstr "" + +#: tools/editor/spatial_editor_gizmos.cpp +msgid "Change Probe Extents" +msgstr "" diff --git a/tools/translations/sl.po b/tools/translations/sl.po index 41ebecad54..12903cba83 100644 --- a/tools/translations/sl.po +++ b/tools/translations/sl.po @@ -1,5 +1,5 @@ # Slovenian translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # # matevž lapajne <sivar.lapajne@gmail.com>, 2016. @@ -33,12 +33,6 @@ msgid "step argument is zero!" msgstr "stopnja argumenta je nič!" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" msgstr "To ni skripta z instanco" @@ -393,75 +387,75 @@ msgstr "" msgid "just released" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid unique name." msgstr "Neveljaven indeks lastnosti imena." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid product GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid background color." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" @@ -581,10 +575,6 @@ msgid "" "as parent." msgstr "" -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "" - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -644,7 +634,8 @@ msgstr "" msgid "Cancel" msgstr "" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "" @@ -1787,6 +1778,10 @@ msgid "Constants:" msgstr "" #: tools/editor/editor_help.cpp +msgid "Property Description:" +msgstr "" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "" @@ -1854,7 +1849,9 @@ msgstr "" msgid "Save Resource As.." msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "" @@ -2079,7 +2076,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "" @@ -2759,6 +2758,7 @@ msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "" @@ -2986,6 +2986,10 @@ msgid "Auto" msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +msgid "Root Node Name:" +msgstr "" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "" @@ -3885,6 +3889,49 @@ msgstr "" msgid "Snap (Pixels):" msgstr "" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Change default type" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4750,18 +4797,6 @@ msgstr "" msgid "Contextual Help" msgstr "" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "" @@ -5524,6 +5559,64 @@ msgid "No exporter for platform '%s' yet." msgstr "" #: tools/editor/project_export.cpp +msgid "Create Android keystore" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Full name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organization" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "State" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Password" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "at least 6 characters" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "File name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "" @@ -5983,10 +6076,6 @@ msgid "Erase Input Action Event" msgstr "" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "" @@ -6130,7 +6219,7 @@ msgstr "" msgid "Dir.." msgstr "" -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "" @@ -6163,10 +6252,6 @@ msgid "Properties:" msgstr "" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "" @@ -6244,14 +6329,6 @@ msgid "Scene Run Settings" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "" @@ -6260,10 +6337,6 @@ msgid "Error loading scene from %s" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "" @@ -6302,10 +6375,6 @@ msgid "This operation can't be done without a scene." msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "" @@ -6330,10 +6399,6 @@ msgid "Remove Node(s)" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6372,7 +6437,11 @@ msgid "Change Type" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" +msgid "Attach Script" +msgstr "" + +#: tools/editor/scene_tree_dock.cpp +msgid "Clear Script" msgstr "" #: tools/editor/scene_tree_dock.cpp @@ -6398,13 +6467,11 @@ msgid "" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." +msgid "Attach a new or existing script for the selected node." msgstr "" -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." msgstr "" #: tools/editor/scene_tree_editor.cpp @@ -6500,6 +6567,10 @@ msgid "Could not create script in filesystem." msgstr "" #: tools/editor/script_create_dialog.cpp +msgid "Error loading script from %s" +msgstr "" + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "" @@ -6512,15 +6583,15 @@ msgid "Invalid base path" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "File exists" +msgid "Invalid extension" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Invalid extension" +msgid "Create new script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" +msgid "Load existing script" msgstr "" #: tools/editor/script_create_dialog.cpp @@ -6532,7 +6603,7 @@ msgid "Built-In Script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" +msgid "Attach Node Script" msgstr "" #: tools/editor/script_editor_debugger.cpp @@ -6699,6 +6770,10 @@ msgstr "" msgid "Change Notifier Extents" msgstr "" +#: tools/editor/spatial_editor_gizmos.cpp +msgid "Change Probe Extents" +msgstr "" + #~ msgid "" #~ "Custom node has no _get_output_port_unsequenced(idx,wmem), but " #~ "unsequenced ports were specified." diff --git a/tools/translations/tools.pot b/tools/translations/tools.pot index 5453c5d9e2..447067beb3 100644 --- a/tools/translations/tools.pot +++ b/tools/translations/tools.pot @@ -1,5 +1,5 @@ # LANGUAGE translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. @@ -26,12 +26,6 @@ msgid "step argument is zero!" msgstr "" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" msgstr "" @@ -375,74 +369,74 @@ msgstr "" msgid "just released" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid unique name." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid product GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid background color." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" @@ -550,10 +544,6 @@ msgid "" "as parent." msgstr "" -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "" - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -613,7 +603,8 @@ msgstr "" msgid "Cancel" msgstr "" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "" @@ -1756,6 +1747,10 @@ msgid "Constants:" msgstr "" #: tools/editor/editor_help.cpp +msgid "Property Description:" +msgstr "" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "" @@ -1823,7 +1818,9 @@ msgstr "" msgid "Save Resource As.." msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "" @@ -2048,7 +2045,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "" @@ -2728,6 +2727,7 @@ msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "" @@ -2955,6 +2955,10 @@ msgid "Auto" msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +msgid "Root Node Name:" +msgstr "" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "" @@ -3854,6 +3858,49 @@ msgstr "" msgid "Snap (Pixels):" msgstr "" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Change default type" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4718,18 +4765,6 @@ msgstr "" msgid "Contextual Help" msgstr "" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "" @@ -5492,6 +5527,64 @@ msgid "No exporter for platform '%s' yet." msgstr "" #: tools/editor/project_export.cpp +msgid "Create Android keystore" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Full name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organization" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "State" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Password" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "at least 6 characters" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "File name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "" @@ -5951,10 +6044,6 @@ msgid "Erase Input Action Event" msgstr "" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "" @@ -6098,7 +6187,7 @@ msgstr "" msgid "Dir.." msgstr "" -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "" @@ -6131,10 +6220,6 @@ msgid "Properties:" msgstr "" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "" @@ -6211,14 +6296,6 @@ msgid "Scene Run Settings" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "" @@ -6227,10 +6304,6 @@ msgid "Error loading scene from %s" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "" @@ -6269,10 +6342,6 @@ msgid "This operation can't be done without a scene." msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "" @@ -6297,10 +6366,6 @@ msgid "Remove Node(s)" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6339,7 +6404,11 @@ msgid "Change Type" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" +msgid "Attach Script" +msgstr "" + +#: tools/editor/scene_tree_dock.cpp +msgid "Clear Script" msgstr "" #: tools/editor/scene_tree_dock.cpp @@ -6365,13 +6434,11 @@ msgid "" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." +msgid "Attach a new or existing script for the selected node." msgstr "" -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." msgstr "" #: tools/editor/scene_tree_editor.cpp @@ -6467,6 +6534,10 @@ msgid "Could not create script in filesystem." msgstr "" #: tools/editor/script_create_dialog.cpp +msgid "Error loading script from %s" +msgstr "" + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "" @@ -6479,15 +6550,15 @@ msgid "Invalid base path" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "File exists" +msgid "Invalid extension" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Invalid extension" +msgid "Create new script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" +msgid "Load existing script" msgstr "" #: tools/editor/script_create_dialog.cpp @@ -6499,7 +6570,7 @@ msgid "Built-In Script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" +msgid "Attach Node Script" msgstr "" #: tools/editor/script_editor_debugger.cpp @@ -6665,3 +6736,7 @@ msgstr "" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Notifier Extents" msgstr "" + +#: tools/editor/spatial_editor_gizmos.cpp +msgid "Change Probe Extents" +msgstr "" diff --git a/tools/translations/tr.po b/tools/translations/tr.po index 823082ef17..b930e302f2 100644 --- a/tools/translations/tr.po +++ b/tools/translations/tr.po @@ -1,104 +1,108 @@ # Turkish translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # +# Aprın Çor Tigin <kabusturk38@gmail.com>, 2016. +# Ceyhun Can Ulker <ceyhuncanu@gmail.com>, 2016. # Enes Kaya Öcal <ekayaocal@hotmail.com>, 2016. # M. Yavuz Uzun <myavuzuzun@yandex.com>, 2016. +# Orkun Turan <holygatestudio@yandex.com>, 2016-2017. # msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" -"PO-Revision-Date: 2016-08-18 00:13+0000\n" -"Last-Translator: M. Yavuz Uzun <myavuzuzun@yandex.com>\n" +"PO-Revision-Date: 2017-01-02 19:10+0000\n" +"Last-Translator: Orkun Turan <holygatestudio@yandex.com>\n" "Language-Team: Turkish <https://hosted.weblate.org/projects/godot-engine/" "godot/tr/>\n" "Language: tr\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8-bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 2.8-dev\n" +"X-Generator: Weblate 2.11-dev\n" #: modules/gdscript/gd_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp msgid "Invalid type argument to convert(), use TYPE_* constants." msgstr "" +"convert() için geçersiz türde değiştirgen, TYPE_* sabitlerini kullanın." #: modules/gdscript/gd_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp msgid "Not enough bytes for decoding bytes, or invalid format." -msgstr "" +msgstr "Geçersiz biçem ya da kod çözmek için yetersiz byte sayısı." #: modules/gdscript/gd_functions.cpp msgid "step argument is zero!" -msgstr "" - -#: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" +msgstr "adım değiştirgeni sıfır!" #: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" -msgstr "" +msgstr "Örneği bulunan bir betik değil" #: modules/gdscript/gd_functions.cpp msgid "Not based on a script" -msgstr "Bir koda bağlı değil" +msgstr "Bir betiğe bağlı değil" #: modules/gdscript/gd_functions.cpp msgid "Not based on a resource file" -msgstr "Bir kaynak dosyasına bağlı değil" +msgstr "Bir kaynak dizecine bağlı değil" #: modules/gdscript/gd_functions.cpp msgid "Invalid instance dictionary format (missing @path)" -msgstr "" +msgstr "Geçersiz örnek sözlük biçemi (@path eksik)" #: modules/gdscript/gd_functions.cpp msgid "Invalid instance dictionary format (can't load script at @path)" -msgstr "" +msgstr "Geçersiz örnek sözlük biçemi (betik @path 'tan yüklenemiyor)" #: modules/gdscript/gd_functions.cpp msgid "Invalid instance dictionary format (invalid script at @path)" -msgstr "" +msgstr "Geçersiz örnek sözlük biçemi (@path 'taki kod geçersiz)" #: modules/gdscript/gd_functions.cpp msgid "Invalid instance dictionary (invalid subclasses)" -msgstr "" +msgstr "Geçersiz örnek sözlüğü (geçersiz altbölütler)" #: modules/visual_script/visual_script.cpp msgid "" "A node yielded without working memory, please read the docs on how to yield " "properly!" -msgstr "Çalışan hafıza olmadan düğüm yerleştirilmiş, lütfen belgeleri okuyun!" +msgstr "" +"Çalışan hafıza olmadan düğüm yerleştirilmiş, lütfen doğru yerleştirme " +"üzerine olan belgeleri okuyun!" #: modules/visual_script/visual_script.cpp msgid "" "Node yielded, but did not return a function state in the first working " "memory." msgstr "" +"Düğüm yerleştirilmiş, fakat çalışan ilk hafızada bir işlev koşulunu " +"döndüremedi." #: modules/visual_script/visual_script.cpp msgid "" "Return value must be assigned to first element of node working memory! Fix " "your node please." msgstr "" +"Döndürülen değer, düğüm çalışan hafızasındaki ilk elemana atanmış olmalıdır! " +"Lütfen düğümünüzü düzeltin." #: modules/visual_script/visual_script.cpp msgid "Node returned an invalid sequence output: " -msgstr "" +msgstr "Düğüm geçersiz bir dizi çıktısı döndürdü: " #: modules/visual_script/visual_script.cpp msgid "Found sequence bit but not the node in the stack, report bug!" -msgstr "" +msgstr "Bit dizisi bulundu fakat yığındaki düğüm değil, kusuru bildir!" #: modules/visual_script/visual_script.cpp msgid "Stack overflow with stack depth: " -msgstr "" +msgstr "Şu derinlikte yığın taşması: " #: modules/visual_script/visual_script_editor.cpp msgid "Functions:" -msgstr "Fonksiyonlar:" +msgstr "İşlevler:" #: modules/visual_script/visual_script_editor.cpp msgid "Variables:" @@ -106,31 +110,31 @@ msgstr "Değişkenler:" #: modules/visual_script/visual_script_editor.cpp tools/editor/editor_help.cpp msgid "Signals:" -msgstr "Sinyaller:" +msgstr "İşaretler:" #: modules/visual_script/visual_script_editor.cpp msgid "Name is not a valid identifier:" -msgstr "İsim doğru bir belirleyici değil:" +msgstr "Ad doğru bir belirleyici değil:" #: modules/visual_script/visual_script_editor.cpp msgid "Name already in use by another func/var/signal:" -msgstr "Ad zaten başka bir fonksiyon/değişken/sinyal tarafından kullanılıyor:" +msgstr "Ad zaten başka bir işlev/değişken/işaret tarafından kullanılıyor:" #: modules/visual_script/visual_script_editor.cpp msgid "Rename Function" -msgstr "Fonksiyonu Yeniden İsimlendir" +msgstr "İşlevi Yeniden Adlandır" #: modules/visual_script/visual_script_editor.cpp msgid "Rename Variable" -msgstr "Değişkeni Yeniden İsimlendir" +msgstr "Değişkeni Yeniden Adlandır" #: modules/visual_script/visual_script_editor.cpp msgid "Rename Signal" -msgstr "Sinyali Yeniden İsimlendir" +msgstr "İşareti Yeniden Adlandır" #: modules/visual_script/visual_script_editor.cpp msgid "Add Function" -msgstr "Fonksiyon Ekle" +msgstr "İşlev Ekle" #: modules/visual_script/visual_script_editor.cpp msgid "Add Variable" @@ -138,11 +142,11 @@ msgstr "Değişken Ekle" #: modules/visual_script/visual_script_editor.cpp msgid "Add Signal" -msgstr "Sinyal Ekle" +msgstr "İşaret Ekle" #: modules/visual_script/visual_script_editor.cpp msgid "Remove Function" -msgstr "Fonksiyonu Kaldır" +msgstr "İşlevi Kaldır" #: modules/visual_script/visual_script_editor.cpp msgid "Remove Variable" @@ -154,15 +158,15 @@ msgstr "Değişken Düzenleniyor:" #: modules/visual_script/visual_script_editor.cpp msgid "Remove Signal" -msgstr "Sinyali Kaldır" +msgstr "İşareti Kaldır" #: modules/visual_script/visual_script_editor.cpp msgid "Editing Signal:" -msgstr "Sinyal Düzenleniyor:" +msgstr "İşaret Düzenleniyor:" #: modules/visual_script/visual_script_editor.cpp msgid "Change Expression" -msgstr "" +msgstr "İfadeyi Değiştir" #: modules/visual_script/visual_script_editor.cpp msgid "Add Node" @@ -171,31 +175,34 @@ msgstr "Düğüm Ekle" #: modules/visual_script/visual_script_editor.cpp msgid "Hold Meta to drop a Getter. Hold Shift to drop a generic signature." msgstr "" +"Alıcı işlevini bırakmak için Alt'a basılı tutun. Genelgeçer imzayı bırakmak " +"için Shift'e basılı tutun." #: modules/visual_script/visual_script_editor.cpp msgid "Hold Ctrl to drop a Getter. Hold Shift to drop a generic signature." msgstr "" +"Alıcı işlevini bırakmak için Ctrl'e basılı tutun. Genelgeçer imzayı bırakmak " +"için Shift'e basılı tutun." #: modules/visual_script/visual_script_editor.cpp msgid "Hold Meta to drop a simple reference to the node." -msgstr "" +msgstr "Bir düğüme basit bir başvuru bırakmak için Alt'a basılı tutun." #: modules/visual_script/visual_script_editor.cpp msgid "Hold Ctrl to drop a simple reference to the node." -msgstr "" +msgstr "Bir düğüme basit bir başvuru bırakmak için Ctrl'e basılı tutun." #: modules/visual_script/visual_script_editor.cpp msgid "Hold Meta to drop a Variable Setter." -msgstr "" +msgstr "Bir Değişken Atayıcı bırakmak için Alt'a basılı tutun." #: modules/visual_script/visual_script_editor.cpp msgid "Hold Ctrl to drop a Variable Setter." -msgstr "" +msgstr "Bir Değişken Atayıcı bırakmak için Ctrl'e basılı tutun." #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Add Preload Node" -msgstr "Düğüm Ekle" +msgstr "Önyüklenen Düğüm Ekle" #: modules/visual_script/visual_script_editor.cpp msgid "Add Node(s) From Tree" @@ -210,42 +217,41 @@ msgid "Add Setter Property" msgstr "Düzenleyici Özellik Ekle" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Condition" -msgstr "Animasyon Yükle" +msgstr "Koşul" #: modules/visual_script/visual_script_editor.cpp msgid "Sequence" -msgstr "" +msgstr "Dizi" #: modules/visual_script/visual_script_editor.cpp msgid "Switch" -msgstr "" +msgstr "Değiştir" #: modules/visual_script/visual_script_editor.cpp msgid "Iterator" -msgstr "" +msgstr "Yineleyici" #: modules/visual_script/visual_script_editor.cpp msgid "While" -msgstr "" +msgstr "İken" #: modules/visual_script/visual_script_editor.cpp msgid "Return" -msgstr "" +msgstr "Döndür" #: modules/visual_script/visual_script_editor.cpp tools/editor/call_dialog.cpp msgid "Call" -msgstr "" +msgstr "Çağır" #: modules/visual_script/visual_script_editor.cpp msgid "Get" -msgstr "" +msgstr "Al" #: modules/visual_script/visual_script_editor.cpp #: tools/editor/property_editor.cpp msgid "Set" -msgstr "" +msgstr "Ata" #: modules/visual_script/visual_script_editor.cpp #: tools/editor/plugins/canvas_item_editor_plugin.cpp @@ -258,7 +264,7 @@ msgstr "Düzenle" #: modules/visual_script/visual_script_editor.cpp msgid "Base Type:" -msgstr "Taban Tipi:" +msgstr "Taban Türü:" #: modules/visual_script/visual_script_editor.cpp tools/editor/editor_help.cpp msgid "Members:" @@ -266,11 +272,11 @@ msgstr "Üyeler:" #: modules/visual_script/visual_script_editor.cpp msgid "Available Nodes:" -msgstr "" +msgstr "Kullanışlı Düğümler:" #: modules/visual_script/visual_script_editor.cpp msgid "Select or create a function to edit graph" -msgstr "" +msgstr "Çizgeyi düzenlemek için bir işlev seçin ya da oluşturun" #: modules/visual_script/visual_script_editor.cpp tools/editor/call_dialog.cpp #: tools/editor/connections_dialog.cpp @@ -287,7 +293,7 @@ msgstr "Kapat" #: modules/visual_script/visual_script_editor.cpp msgid "Edit Signal Arguments:" -msgstr "" +msgstr "İşaret Değiştirgenlerini Düzenle:" #: modules/visual_script/visual_script_editor.cpp msgid "Edit Variable:" @@ -304,176 +310,178 @@ msgstr "Seçilenleri Sil" #: modules/visual_script/visual_script_editor.cpp #: tools/editor/plugins/script_text_editor.cpp msgid "Toggle Breakpoint" -msgstr "" +msgstr "Kesme Noktası Aç/Kapat" #: modules/visual_script/visual_script_editor.cpp msgid "Find Node Type" -msgstr "" +msgstr "Düğüm Türü Bul" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Copy Nodes" -msgstr "Kaynağı Kopyala" +msgstr "Düğümleri Tıpkıla" #: modules/visual_script/visual_script_editor.cpp msgid "Cut Nodes" -msgstr "" +msgstr "Düğümleri Kes" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Paste Nodes" -msgstr "Kaynağı Yapıştır" +msgstr "Düğümleri Yapıştır" #: modules/visual_script/visual_script_flow_control.cpp msgid "Input type not iterable: " -msgstr "" +msgstr "Girdi türü yinelenebilir değil: " #: modules/visual_script/visual_script_flow_control.cpp msgid "Iterator became invalid" -msgstr "" +msgstr "Yineleyici geçersiz durumda" #: modules/visual_script/visual_script_flow_control.cpp msgid "Iterator became invalid: " -msgstr "" +msgstr "Yineleyici geçersiz durumda: " #: modules/visual_script/visual_script_func_nodes.cpp -#, fuzzy msgid "Invalid index property name." -msgstr "Geçersiz ebeveyn sınıf adı" +msgstr "Geçersiz dizin özelliği adı." #: modules/visual_script/visual_script_func_nodes.cpp msgid "Base object is not a Node!" -msgstr "" +msgstr "Taban nesne bir Düğüm değil!" #: modules/visual_script/visual_script_func_nodes.cpp msgid "Path does not lead Node!" -msgstr "" +msgstr "Yol bir düğüme çıkmıyor!" #: modules/visual_script/visual_script_func_nodes.cpp msgid "Invalid index property name '%s' in node %s." -msgstr "" +msgstr "%s düğümünde geçersiz dizin özelliği adı '%s'." #: modules/visual_script/visual_script_nodes.cpp -#, fuzzy msgid ": Invalid argument of type: " -msgstr "Geçersiz ebeveyn sınıf adı" +msgstr ": Şu tür için geçersiz değiştirgen: " #: modules/visual_script/visual_script_nodes.cpp -#, fuzzy msgid ": Invalid arguments: " -msgstr "Geçersiz ebeveyn sınıf adı" +msgstr ": Geçersiz değiştirgenler: " #: modules/visual_script/visual_script_nodes.cpp msgid "VariableGet not found in script: " -msgstr "" +msgstr "VariableGet betikte bulunamadı: " #: modules/visual_script/visual_script_nodes.cpp msgid "VariableSet not found in script: " -msgstr "" +msgstr "VariableSet betikte bulunamadı: " #: modules/visual_script/visual_script_nodes.cpp msgid "Custom node has no _step() method, can't process graph." -msgstr "" +msgstr "Özel düğüm _step() yöntemine sahip değil, çizgeyi işleyemez." #: modules/visual_script/visual_script_nodes.cpp msgid "" "Invalid return value from _step(), must be integer (seq out), or string " "(error)." msgstr "" +"_step()'ten geçersiz dönüş değeri, tam sayı (dizi çıkışı) ya da dizgi " +"(sorunu) olmalı." #: modules/visual_script/visual_script_nodes.cpp msgid "just pressed" -msgstr "" +msgstr "yeni basıldı" #: modules/visual_script/visual_script_nodes.cpp msgid "just released" -msgstr "" +msgstr "yeni bırakıldı" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" +"Onay belgesi dizeci okunamadı. Yol ve gizyazının her ikisi de doğru mu?" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." -msgstr "" +msgstr "İmza nesnesini oluşturmada sorun." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." -msgstr "" +msgstr "Çıkın imzasını oluşturmada sorun." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" +"Hiçbir dışa aktarım kalıbı bulunamadı.\n" +"Dışa aktarım kalıplarını indirin ve yükleyin.." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." -msgstr "" +msgstr "Özel kusur ayıklama çıkını bulunmadı." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." -msgstr "" +msgstr "Özel yayınlama çıkını bulunamadı." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid unique name." -msgstr "Geçersiz isim." +msgstr "Benzersiz Ad Geçersiz." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid product GUID." -msgstr "Geçersiz yazı tipi boyutu." +msgstr "Geçersiz ürün GUID'i." -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." -msgstr "Geçersiz üst yol" +msgstr "Geçersiz yayıncı GUID'i." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid background color." -msgstr "" +msgstr "Geçersiz arkaplan rengi." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." -msgstr "" +msgstr "Geçersiz Yığım Belirtkesi, bedizin boyutları (50x50 olmalı)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." -msgstr "" +msgstr "Geçersiz kare 44x44 belirtkenin bediz boyutları (44x44 olmalı)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." -msgstr "" +msgstr "Geçersiz kare 71x71 belirtkenin bediz boyutları (71x71 olmalı)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." -msgstr "" +msgstr "Geçersiz kare 150x150 belirtkenin bediz boyutları (150x150 olmalı)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." -msgstr "" +msgstr "Geçersiz kare 310x310 belirtkenin bediz boyutları (310x310 olmalı)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." -msgstr "" +msgstr "Geçersiz kare 310x150 belirtkenin bediz boyutları (310x150 olmalı)." -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." -msgstr "" +msgstr "Geçersiz açılış görüntülüğü bediz boyutları (620x300 olmalı)." #: scene/2d/animated_sprite.cpp msgid "" "A SpriteFrames resource must be created or set in the 'Frames' property in " "order for AnimatedSprite to display frames." msgstr "" +"Bir SpriteFrames kaynağı oluşturulmalı ya da 'Kareler' özelliğine atanmalı " +"ki AnimatedSprite düğümü kareleri gösterebilsin." #: scene/2d/canvas_modulate.cpp msgid "" "Only one visible CanvasModulate is allowed per scene (or set of instanced " "scenes). The first created one will work, while the rest will be ignored." msgstr "" +"Sahne başına (ya da bir öbek örneklenmiş sahneler için) yalnızca bir görünür " +"CanvasModulate'e izin verilir. İlk oluşturulan çalışırken diğerleri ihmal " +"edilecektir." #: scene/2d/collision_polygon_2d.cpp msgid "" @@ -481,10 +489,14 @@ msgid "" "CollisionObject2D derived node. Please only use it as a child of Area2D, " "StaticBody2D, RigidBody2D, KinematicBody2D, etc. to give them a shape." msgstr "" +"CollisionPolygon2D yalnızca CollisionObject2D'den türeyen düğümlere bir " +"şekil elde etmeye hizmet eder. Lütfen onu yalnızca şunların çocuğu olarak " +"kullanın ve Area2D, StaticBody2D, RigidBody2D, KinematicBody2D vs.'ye bir " +"şekil vermek için kullanın." #: scene/2d/collision_polygon_2d.cpp msgid "An empty CollisionPolygon2D has no effect on collision." -msgstr "" +msgstr "Boş bir CollisionPolygon2D'nin çarpışmaya hiçbir etkisi yoktur." #: scene/2d/collision_shape_2d.cpp msgid "" @@ -492,84 +504,107 @@ msgid "" "CollisionObject2D derived node. Please only use it as a child of Area2D, " "StaticBody2D, RigidBody2D, KinematicBody2D, etc. to give them a shape." msgstr "" +"CollisionShape2D yalnızca CollisionObject2D'den türeyen düğümlere bir şekil " +"elde etmeye hizmet eder. Lütfen onu yalnızca şunların çocuğu olarak kullanın " +"ve Area2D, StaticBody2D, RigidBody2D, KinematicBody2D vs.'ye bir şekil " +"vermek için kullanın." #: scene/2d/collision_shape_2d.cpp msgid "" "A shape must be provided for CollisionShape2D to function. Please create a " "shape resource for it!" msgstr "" +"CollisionShape2D'nin işlevini yerine getirmesi için ona bir şekil sağlanması " +"gerekmektedir. Lütfen onun için bir şekil kaynağı oluşturun!" #: scene/2d/light_2d.cpp msgid "" "A texture with the shape of the light must be supplied to the 'texture' " "property." -msgstr "" +msgstr "Işık yüzeyli bir doku, \"doku\" niteliğine sağlanmalıdır." #: scene/2d/light_occluder_2d.cpp msgid "" "An occluder polygon must be set (or drawn) for this occluder to take effect." msgstr "" +"Engelleyicinin etkili olabilmesi için bir engelleyici çokgeni ayarlanmalıdır " +"(ya da çizilmelidir)." #: scene/2d/light_occluder_2d.cpp msgid "The occluder polygon for this occluder is empty. Please draw a polygon!" -msgstr "" +msgstr "Bu engelleyici için engelleyici çokgeni boş. Lütfen bir çokgen çizin!" #: scene/2d/navigation_polygon.cpp msgid "" "A NavigationPolygon resource must be set or created for this node to work. " "Please set a property or draw a polygon." msgstr "" +"Bu düğüm(node) çalışmak için bir NavigationPolygon kaynağı ayarlanmasına ya " +"da oluşturulmasına gereksinim duyar. Lütfen hazır bir tane seçin ya da bir " +"çokgen çizin." #: scene/2d/navigation_polygon.cpp msgid "" "NavigationPolygonInstance must be a child or grandchild to a Navigation2D " "node. It only provides navigation data." msgstr "" +"NavigationPolygonInstance, bir Navigation2D çocuğu olmalı ya da Navigation2D " +"düğümünün torunu olması gerekir. Bu nesne yalnızca yönlendirme verisi sağlar." #: scene/2d/parallax_layer.cpp msgid "" "ParallaxLayer node only works when set as child of a ParallaxBackground node." msgstr "" +"ParallaxLayer, yalnızca ParallaxBackground düğümünün çocuğu olduğu zaman " +"çalışır." #: scene/2d/particles_2d.cpp msgid "Path property must point to a valid Particles2D node to work." msgstr "" +"Yol niteliği çalışması için geçerli bir Particles2D düğümünü işaret " +"etmelidir." #: scene/2d/path_2d.cpp msgid "PathFollow2D only works when set as a child of a Path2D node." msgstr "" +"PathFollow2D yalnızca Path2D düğümünün çocuğu olarak ayarlanınca çalışır." #: scene/2d/remote_transform_2d.cpp msgid "Path property must point to a valid Node2D node to work." msgstr "" +"Yol niteliği çalışması için geçerli bir Node2D düğümüne işaret etmelidir." #: scene/2d/sample_player_2d.cpp scene/audio/sample_player.cpp msgid "" "A SampleLibrary resource must be created or set in the 'samples' property in " "order for SamplePlayer to play sound." msgstr "" +"SamplePlayer ın ses çalması için bir SampleLibrary kaynağı oluşturulmalı " +"veya 'örnekler' niteliğinde ayarlanmalıdır." #: scene/2d/sprite.cpp msgid "" "Path property must point to a valid Viewport node to work. Such Viewport " "must be set to 'render target' mode." msgstr "" +"Yol niteliği çalışması için geçerli bir Viewport düğümüne işaret etmelidir. " +"Bu tür Viewport 'işleyici amacı' biçimine ayarlanmalıdır." #: scene/2d/sprite.cpp msgid "" "The Viewport set in the path property must be set as 'render target' in " "order for this sprite to work." msgstr "" +"Bu sprite'ın çalışması için yol niteliğinde ayarlanan Viewport durumu " +"'işleyici amacı' olarak ayarlanmalıdır." #: scene/2d/visibility_notifier_2d.cpp msgid "" "VisibilityEnable2D works best when used with the edited scene root directly " "as parent." msgstr "" - -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "" +"VisibilityEnable2D düğümü düzenlenmiş sahne kökü doğrudan ata olarak " +"kullanıldığında çalışır." #: scene/3d/body_shape.cpp msgid "" @@ -577,12 +612,17 @@ msgid "" "derived node. Please only use it as a child of Area, StaticBody, RigidBody, " "KinematicBody, etc. to give them a shape." msgstr "" +"CollisionShape sadece CollisionObject türetilmiş bir düğümde çarpışma yüzeyi " +"sağlamaya yarar. Bunların yüzeyine şekil vermek için Area, StaticBody, " +"RigidBody, KinematicBody, v.b. onu sadece bunların çocuğu olarak kullanın." #: scene/3d/body_shape.cpp msgid "" "A shape must be provided for CollisionShape to function. Please create a " "shape resource for it!" msgstr "" +"CollisionShape'in çalışması için bir şekil verilmelidir. Lütfen bunun için " +"bir şekil kaynağı oluşturun!" #: scene/3d/collision_polygon.cpp msgid "" @@ -590,47 +630,63 @@ msgid "" "CollisionObject derived node. Please only use it as a child of Area, " "StaticBody, RigidBody, KinematicBody, etc. to give them a shape." msgstr "" +"CollisionPolygon sadece CollisionObject türetilmiş bir düğümde çarpışma " +"yüzeyi sağlamaya yarar. Bunların yüzeyine şekil vermek için Area, " +"StaticBody, RigidBody, KinematicBody, v.b. onu sadece bunların çocuğu olarak " +"kullanın." #: scene/3d/collision_polygon.cpp msgid "An empty CollisionPolygon has no effect on collision." -msgstr "" +msgstr "Boş bir CollisionPolygon'un çarpışma üzerinde etkisi yoktur." #: scene/3d/navigation_mesh.cpp msgid "A NavigationMesh resource must be set or created for this node to work." msgstr "" +"Bu düğümün çalışması için bir NavigationMesh kaynağı ayarlanmış veya " +"oluşturulmuş olmalıdır." #: scene/3d/navigation_mesh.cpp msgid "" "NavigationMeshInstance must be a child or grandchild to a Navigation node. " "It only provides navigation data." msgstr "" +"NavigationMeshInstance, bir Navigation düğümünün çocuğu ya da torunu " +"olmalıdır. O yalnızca yönlendirme verisi sağlar." #: scene/3d/remote_transform.cpp msgid "Path property must point to a valid Spatial node to work." msgstr "" +"Yol niteliği, çalışmak için geçerli bir Spatial düğümü işaret etmelidir." #: scene/3d/scenario_fx.cpp msgid "" "Only one WorldEnvironment is allowed per scene (or set of instanced scenes)." msgstr "" +"Her sahne başına (ya da örneklenmiş sahneler dizisine) sadece bir tane " +"WorldEnvironment 'a izin verilir." #: scene/3d/spatial_sample_player.cpp msgid "" "A SampleLibrary resource must be created or set in the 'samples' property in " "order for SpatialSamplePlayer to play sound." msgstr "" +"SpatialSamplePlayer 'ın ses çalması için bir SampleLibrary kaynağı " +"oluşturulmalı veya 'örnekler' niteliğinde ayarlanmalıdır." #: scene/3d/sprite_3d.cpp msgid "" "A SpriteFrames resource must be created or set in the 'Frames' property in " "order for AnimatedSprite3D to display frames." msgstr "" +"AnimatedSprite3D 'nin çerçeveleri görüntülemek için bir SpriteFrames kaynağı " +"oluşturulmalı veya 'Çerçeveler' niteliğinde ayarlanmalıdır." #: scene/gui/dialogs.cpp tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Cancel" -msgstr "İptal" +msgstr "Vazgeç" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "Tamam" @@ -640,19 +696,19 @@ msgstr "Uyarı!" #: scene/gui/dialogs.cpp msgid "Please Confirm..." -msgstr "Lütfen doğrulayınız..." +msgstr "Lütfen Doğrulayın..." #: scene/gui/file_dialog.cpp tools/editor/editor_file_dialog.cpp msgid "File Exists, Overwrite?" -msgstr "Dosya mevcut. Üzerine yazılsın mı?" +msgstr "Dizeç var. Üzerine Yazılsın mı?" #: scene/gui/file_dialog.cpp tools/editor/editor_file_dialog.cpp msgid "All Recognized" -msgstr "" +msgstr "Tümü Onaylandı" #: scene/gui/file_dialog.cpp tools/editor/editor_file_dialog.cpp msgid "All Files (*)" -msgstr "Tüm dosyalar (*)" +msgstr "Tüm Dizeçler (*)" #: scene/gui/file_dialog.cpp tools/editor/editor_file_dialog.cpp #: tools/editor/editor_help.cpp tools/editor/editor_node.cpp @@ -664,19 +720,19 @@ msgstr "Aç" #: scene/gui/file_dialog.cpp msgid "Open a File" -msgstr "Bir Dosya Aç" +msgstr "Bir Dizeç Aç" #: scene/gui/file_dialog.cpp msgid "Open File(s)" -msgstr "Dosya(ları) aç" +msgstr "Dizeç(leri) Aç" #: scene/gui/file_dialog.cpp msgid "Open a Directory" -msgstr "Bir klasör aç" +msgstr "Bir dizin aç" #: scene/gui/file_dialog.cpp msgid "Open a File or Directory" -msgstr "Bir dosya yada klasör aç" +msgstr "Bir Dizeç ya da Dizin Aç" #: scene/gui/file_dialog.cpp tools/editor/editor_file_dialog.cpp #: tools/editor/editor_node.cpp @@ -687,43 +743,43 @@ msgstr "Kaydet" #: scene/gui/file_dialog.cpp tools/editor/editor_file_dialog.cpp msgid "Save a File" -msgstr "Dosyayı kaydet" +msgstr "Dizeci Kaydet" #: scene/gui/file_dialog.cpp tools/editor/editor_dir_dialog.cpp #: tools/editor/editor_file_dialog.cpp msgid "Create Folder" -msgstr "Yeni klasör" +msgstr "Dizin Oluştur" #: scene/gui/file_dialog.cpp tools/editor/editor_autoload_settings.cpp #: tools/editor/editor_file_dialog.cpp #: tools/editor/io_plugins/editor_font_import_plugin.cpp #: tools/editor/script_create_dialog.cpp msgid "Path:" -msgstr "Dosya yolu:" +msgstr "Dizeç yolu:" #: scene/gui/file_dialog.cpp tools/editor/editor_file_dialog.cpp msgid "Directories & Files:" -msgstr "Klasörler & Dosyalar:" +msgstr "Dizinler & Dizeçler:" #: scene/gui/file_dialog.cpp tools/editor/editor_file_dialog.cpp #: tools/editor/script_editor_debugger.cpp msgid "File:" -msgstr "Dosya:" +msgstr "Dizeç:" #: scene/gui/file_dialog.cpp tools/editor/editor_file_dialog.cpp msgid "Filter:" -msgstr "Filtre:" +msgstr "Süzgeç:" #: scene/gui/file_dialog.cpp tools/editor/editor_dir_dialog.cpp #: tools/editor/editor_file_dialog.cpp tools/editor/editor_plugin_settings.cpp #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Name:" -msgstr "İsim:" +msgstr "Ad:" #: scene/gui/file_dialog.cpp tools/editor/editor_dir_dialog.cpp #: tools/editor/editor_file_dialog.cpp msgid "Could not create folder." -msgstr "Klasör oluşturulamadı." +msgstr "Dizin oluşturulamadı." #: scene/gui/file_dialog.cpp tools/editor/editor_file_dialog.cpp msgid "Must use a valid extension." @@ -750,31 +806,31 @@ msgstr "Meta+" #: scene/gui/input_action.cpp tools/editor/project_settings.cpp msgid "Device" -msgstr "Cihaz" +msgstr "Aygıt" #: scene/gui/input_action.cpp tools/editor/project_settings.cpp msgid "Button" -msgstr "Buton" +msgstr "Düğme" #: scene/gui/input_action.cpp tools/editor/project_settings.cpp msgid "Left Button." -msgstr "Sol tuş." +msgstr "Sol Düğme." #: scene/gui/input_action.cpp tools/editor/project_settings.cpp msgid "Right Button." -msgstr "Sağ tuş." +msgstr "Sağ Düğme." #: scene/gui/input_action.cpp tools/editor/project_settings.cpp msgid "Middle Button." -msgstr "Orta tuş." +msgstr "Orta Düğme." #: scene/gui/input_action.cpp tools/editor/project_settings.cpp msgid "Wheel Up." -msgstr "" +msgstr "Tekerlek Yukarı." #: scene/gui/input_action.cpp tools/editor/project_settings.cpp msgid "Wheel Down." -msgstr "" +msgstr "Tekerlek Aşağı." #: scene/gui/input_action.cpp tools/editor/project_settings.cpp msgid "Axis" @@ -791,7 +847,7 @@ msgstr "Kes" #: tools/editor/plugins/shader_editor_plugin.cpp #: tools/editor/property_editor.cpp tools/editor/resources_dock.cpp msgid "Copy" -msgstr "Kopyala" +msgstr "Tıpkıla" #: scene/gui/line_edit.cpp scene/gui/text_edit.cpp #: tools/editor/plugins/resource_preloader_editor_plugin.cpp @@ -828,6 +884,9 @@ msgid "" "functions. Making them visible for editing is fine though, but they will " "hide upon running." msgstr "" +"Açılır pencereler popup() veya popup*() işlevlerini çağırmadıkça ön tanımlı " +"olarak gizlenecektir. Onları düzenleme için görünür kılmak da iyidir, ancak " +"çalışırken gizlenecekler." #: scene/main/viewport.cpp msgid "" @@ -836,26 +895,30 @@ msgid "" "obtain a size. Otherwise, make it a RenderTarget and assign its internal " "texture to some node for display." msgstr "" +"Bu görüntü alanı, işleyici amacı olarak ayarlanmadı. İçeriğini doğrudan " +"görüntlükte göstermek istiyorsanız, bir Denetimcinin çocuğu olun ve böylece " +"bir boyut elde edin. Ya da, onu bir RenderTarget yapın ve iç dokusunu " +"görüntülemesi için bir düğüme atayın." #: scene/resources/dynamic_font.cpp #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "Error initializing FreeType." -msgstr "" +msgstr "FreeType başlatılırken sorun oluştu." #: scene/resources/dynamic_font.cpp #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "Unknown font format." -msgstr "Bilinmeyen yazıtipi türü." +msgstr "Bilinmeyen yazı türü." #: scene/resources/dynamic_font.cpp #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "Error loading font." -msgstr "Yazı tipi yüklerken hata." +msgstr "Yazı türü yüklerken sorun oluştu." #: scene/resources/dynamic_font.cpp #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "Invalid font size." -msgstr "Geçersiz yazı tipi boyutu." +msgstr "Geçersiz yazı türü boyutu." #: tools/editor/animation_editor.cpp msgid "Disabled" @@ -863,84 +926,84 @@ msgstr "Devre dışı" #: tools/editor/animation_editor.cpp msgid "All Selection" -msgstr "Tüm seçilenler" +msgstr "Tüm seçim" #: tools/editor/animation_editor.cpp msgid "Move Add Key" -msgstr "" +msgstr "Açar Eklemeyi Taşı" #: tools/editor/animation_editor.cpp msgid "Anim Change Transition" -msgstr "" +msgstr "Canln Geçişi Değiştir" #: tools/editor/animation_editor.cpp msgid "Anim Change Transform" -msgstr "" +msgstr "Canln Dönüşümü Değiştir" #: tools/editor/animation_editor.cpp msgid "Anim Change Value" -msgstr "" +msgstr "Canln Değeri Değiştir" #: tools/editor/animation_editor.cpp msgid "Anim Change Call" -msgstr "" +msgstr "Canln Çağrıyı Değiştir" #: tools/editor/animation_editor.cpp msgid "Anim Add Track" -msgstr "" +msgstr "Canln İz Ekle" #: tools/editor/animation_editor.cpp msgid "Anim Duplicate Keys" -msgstr "" +msgstr "Canln Açarlarını İkile" #: tools/editor/animation_editor.cpp msgid "Move Anim Track Up" -msgstr "" +msgstr "Canln İzini Yukarı Hareket Ettir" #: tools/editor/animation_editor.cpp msgid "Move Anim Track Down" -msgstr "" +msgstr "Canln İzini Aşağı Hareket Ettir" #: tools/editor/animation_editor.cpp msgid "Remove Anim Track" -msgstr "" +msgstr "Canln İzini Sil" #: tools/editor/animation_editor.cpp msgid "Set Transitions to:" -msgstr "" +msgstr "Geçişleri şuna ayarla:" #: tools/editor/animation_editor.cpp msgid "Anim Track Rename" -msgstr "" +msgstr "Canln İzini Yeniden Adlandır" #: tools/editor/animation_editor.cpp msgid "Anim Track Change Interpolation" -msgstr "" +msgstr "Canln İz Ara Değer Değiştir" #: tools/editor/animation_editor.cpp msgid "Anim Track Change Value Mode" -msgstr "" +msgstr "Canln İzi Değer Değiştir Biçimi" #: tools/editor/animation_editor.cpp msgid "Edit Node Curve" -msgstr "" +msgstr "Düğüm Eğrisini Düzenle" #: tools/editor/animation_editor.cpp msgid "Edit Selection Curve" -msgstr "" +msgstr "Seçim Eğrisini Düzenle" #: tools/editor/animation_editor.cpp msgid "Anim Delete Keys" -msgstr "" +msgstr "Canln Açarları Sil" #: tools/editor/animation_editor.cpp #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Duplicate Selection" -msgstr "" +msgstr "Seçimi İkile" #: tools/editor/animation_editor.cpp msgid "Duplicate Transposed" -msgstr "" +msgstr "Tersine Çevirmeyi İkile" #: tools/editor/animation_editor.cpp msgid "Remove Selection" @@ -960,19 +1023,19 @@ msgstr "Tetikleyici" #: tools/editor/animation_editor.cpp msgid "Anim Add Key" -msgstr "" +msgstr "Canln Açar Ekle" #: tools/editor/animation_editor.cpp msgid "Anim Move Keys" -msgstr "" +msgstr "Canln Açarlarını Taşı" #: tools/editor/animation_editor.cpp msgid "Scale Selection" -msgstr "" +msgstr "Seçimi Ölçekle" #: tools/editor/animation_editor.cpp msgid "Scale From Cursor" -msgstr "" +msgstr "Göstergeden Ölçekle" #: tools/editor/animation_editor.cpp msgid "Goto Next Step" @@ -993,39 +1056,39 @@ msgstr "Sabit" #: tools/editor/animation_editor.cpp msgid "In" -msgstr "" +msgstr "Giriş" #: tools/editor/animation_editor.cpp msgid "Out" -msgstr "" +msgstr "Çıkış" #: tools/editor/animation_editor.cpp msgid "In-Out" -msgstr "" +msgstr "Giriş-Çıkış" #: tools/editor/animation_editor.cpp msgid "Out-In" -msgstr "" +msgstr "Çıkış-Giriş" #: tools/editor/animation_editor.cpp msgid "Transitions" -msgstr "" +msgstr "Geçişler" #: tools/editor/animation_editor.cpp msgid "Optimize Animation" -msgstr "" +msgstr "Canlandırmayı İyileştir" #: tools/editor/animation_editor.cpp msgid "Clean-Up Animation" -msgstr "" +msgstr "Canlandırmayı Temizle" #: tools/editor/animation_editor.cpp msgid "Create NEW track for %s and insert key?" -msgstr "" +msgstr "%s için yeni iz oluştur ve açar gir?" #: tools/editor/animation_editor.cpp msgid "Create %d NEW tracks and insert keys?" -msgstr "" +msgstr "%d için yeni izler oluştur ve açar gir?" #: tools/editor/animation_editor.cpp tools/editor/create_dialog.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp @@ -1038,43 +1101,43 @@ msgstr "Oluştur" #: tools/editor/animation_editor.cpp msgid "Anim Create & Insert" -msgstr "" +msgstr "Canln Oluştur & Gir" #: tools/editor/animation_editor.cpp msgid "Anim Insert Track & Key" -msgstr "" +msgstr "Canln İz Gir & Açar" #: tools/editor/animation_editor.cpp msgid "Anim Insert Key" -msgstr "" +msgstr "Canln Açar Gir" #: tools/editor/animation_editor.cpp msgid "Change Anim Len" -msgstr "" +msgstr "Canln Uzunluğu Değiştir" #: tools/editor/animation_editor.cpp msgid "Change Anim Loop" -msgstr "" +msgstr "Canln Döngüsünü Değiştir" #: tools/editor/animation_editor.cpp msgid "Anim Create Typed Value Key" -msgstr "" +msgstr "Canln Yazılı Değer Açarı Oluştur" #: tools/editor/animation_editor.cpp msgid "Anim Insert" -msgstr "" +msgstr "Canln Gir" #: tools/editor/animation_editor.cpp msgid "Anim Scale Keys" -msgstr "" +msgstr "Canln Açarı Ölçekle" #: tools/editor/animation_editor.cpp msgid "Anim Add Call Track" -msgstr "" +msgstr "Canln İzi Çağırma Ekle" #: tools/editor/animation_editor.cpp msgid "Animation zoom." -msgstr "" +msgstr "Canlandırma yaklaş." #: tools/editor/animation_editor.cpp msgid "Length (s):" @@ -1082,7 +1145,7 @@ msgstr "Uzunluk (lar):" #: tools/editor/animation_editor.cpp msgid "Animation length (in seconds)." -msgstr "Animasyon uzunluğu (saniye)." +msgstr "Canlandırma uzunluğu (saniye)." #: tools/editor/animation_editor.cpp msgid "Step (s):" @@ -1090,99 +1153,101 @@ msgstr "Adım (lar):" #: tools/editor/animation_editor.cpp msgid "Cursor step snap (in seconds)." -msgstr "" +msgstr "Gösterge şipşak adımla (saniyelerde)." #: tools/editor/animation_editor.cpp msgid "Enable/Disable looping in animation." -msgstr "Animasyon tekrarını Aç/Kapat." +msgstr "Canlandırma yinelemesini Aç/Kapat." #: tools/editor/animation_editor.cpp msgid "Add new tracks." -msgstr "" +msgstr "Yeni izler ekle." #: tools/editor/animation_editor.cpp msgid "Move current track up." -msgstr "" +msgstr "Mevcut izi yukarı al." #: tools/editor/animation_editor.cpp msgid "Move current track down." -msgstr "" +msgstr "Mevcut izi aşağı al." #: tools/editor/animation_editor.cpp msgid "Remove selected track." -msgstr "" +msgstr "Seçilen izleri sil." #: tools/editor/animation_editor.cpp msgid "Track tools" -msgstr "" +msgstr "İz araçları" #: tools/editor/animation_editor.cpp msgid "Enable editing of individual keys by clicking them." -msgstr "" +msgstr "Özgün açarların düzenlenebilmesini onları tıklayarak etkinleştirin." #: tools/editor/animation_editor.cpp msgid "Anim. Optimizer" -msgstr "" +msgstr "Cnln. İyileştirici" #: tools/editor/animation_editor.cpp msgid "Max. Linear Error:" -msgstr "" +msgstr "En üst Doğrusal Sorun:" #: tools/editor/animation_editor.cpp msgid "Max. Angular Error:" -msgstr "" +msgstr "En üst Açısal Sorun:" #: tools/editor/animation_editor.cpp msgid "Max Optimizable Angle:" -msgstr "" +msgstr "Max İyileştirilebilir Açı:" #: tools/editor/animation_editor.cpp msgid "Optimize" -msgstr "" +msgstr "İyileştir" #: tools/editor/animation_editor.cpp msgid "Select an AnimationPlayer from the Scene Tree to edit animations." msgstr "" +"Sahne Ağacından canlandırmaları düzenleyebilmek için bir AnimationPlayer " +"seçin." #: tools/editor/animation_editor.cpp msgid "Key" -msgstr "" +msgstr "Açar" #: tools/editor/animation_editor.cpp msgid "Transition" -msgstr "" +msgstr "Geçiş" #: tools/editor/animation_editor.cpp msgid "Scale Ratio:" -msgstr "" +msgstr "Ölçek Oranı:" #: tools/editor/animation_editor.cpp msgid "Call Functions in Which Node?" -msgstr "" +msgstr "Hangi düğümdeki İşlevler Çağrılsın?" #: tools/editor/animation_editor.cpp msgid "Remove invalid keys" -msgstr "" +msgstr "Geçersiz açarları kaldır" #: tools/editor/animation_editor.cpp msgid "Remove unresolved and empty tracks" -msgstr "" +msgstr "Çözümlenmemiş ve boş izleri sil" #: tools/editor/animation_editor.cpp msgid "Clean-up all animations" -msgstr "" +msgstr "Tüm canlandırmaları temizle" #: tools/editor/animation_editor.cpp msgid "Clean-Up Animation(s) (NO UNDO!)" -msgstr "" +msgstr "Canlandırma(ları) Temizle (GERİ ALINAMAZ!)" #: tools/editor/animation_editor.cpp msgid "Clean-Up" -msgstr "" +msgstr "Temizle" #: tools/editor/array_property_edit.cpp msgid "Resize Array" -msgstr "Diziyi Yeniden Boyutlandır" +msgstr "Sırayı Yeniden Boyutlandır" #: tools/editor/array_property_edit.cpp msgid "Change Array Value Type" @@ -1190,7 +1255,7 @@ msgstr "Dizinin türünü degistir" #: tools/editor/array_property_edit.cpp msgid "Change Array Value" -msgstr "" +msgstr "Dizi Değerini Değiştir" #: tools/editor/asset_library_editor_plugin.cpp tools/editor/create_dialog.cpp #: tools/editor/editor_help.cpp tools/editor/editor_node.cpp @@ -1211,7 +1276,7 @@ msgstr "Tersi" #: tools/editor/asset_library_editor_plugin.cpp #: tools/editor/project_settings.cpp msgid "Category:" -msgstr "Kategori:" +msgstr "Katman:" #: tools/editor/asset_library_editor_plugin.cpp msgid "All" @@ -1219,7 +1284,7 @@ msgstr "Hepsi" #: tools/editor/asset_library_editor_plugin.cpp msgid "Site:" -msgstr "Site:" +msgstr "Yer:" #: tools/editor/asset_library_editor_plugin.cpp msgid "Support.." @@ -1235,35 +1300,35 @@ msgstr "Topluluk" #: tools/editor/asset_library_editor_plugin.cpp msgid "Testing" -msgstr "" +msgstr "Deneme" #: tools/editor/asset_library_editor_plugin.cpp msgid "Assets ZIP File" -msgstr "" +msgstr "Varlıkların ZIP Dizeci" #: tools/editor/call_dialog.cpp msgid "Method List For '%s':" -msgstr "" +msgstr "'%s' İçin Yöntem Dizelgesi:" #: tools/editor/call_dialog.cpp msgid "Method List:" -msgstr "" +msgstr "Yöntem Dizelgesi:" #: tools/editor/call_dialog.cpp msgid "Arguments:" -msgstr "" +msgstr "Değiştirgenler:" #: tools/editor/call_dialog.cpp msgid "Return:" -msgstr "" +msgstr "Döndür:" #: tools/editor/code_editor.cpp msgid "Go to Line" -msgstr "Satıra Git" +msgstr "Dizeye Git" #: tools/editor/code_editor.cpp msgid "Line Number:" -msgstr "Satır numarası:" +msgstr "Dize Numarası:" #: tools/editor/code_editor.cpp msgid "No Matches" @@ -1271,27 +1336,27 @@ msgstr "Eşleşme Bulunamadı" #: tools/editor/code_editor.cpp msgid "Replaced %d Ocurrence(s)." -msgstr "" +msgstr "%d Olgusu(ları) ile Değiştirildi." #: tools/editor/code_editor.cpp msgid "Replace" -msgstr "" +msgstr "Değiştir" #: tools/editor/code_editor.cpp msgid "Replace All" -msgstr "" +msgstr "Tümünü Değiştir" #: tools/editor/code_editor.cpp msgid "Match Case" -msgstr "" +msgstr "Durumla Eşleştir" #: tools/editor/code_editor.cpp msgid "Whole Words" -msgstr "" +msgstr "Tüm Sözcükler" #: tools/editor/code_editor.cpp msgid "Selection Only" -msgstr "" +msgstr "Yalnızca Seçim" #: tools/editor/code_editor.cpp tools/editor/editor_help.cpp #: tools/editor/plugins/script_editor_plugin.cpp @@ -1299,7 +1364,7 @@ msgstr "" #: tools/editor/plugins/shader_editor_plugin.cpp #: tools/editor/project_settings.cpp msgid "Search" -msgstr "" +msgstr "Ara" #: tools/editor/code_editor.cpp tools/editor/editor_help.cpp msgid "Find" @@ -1311,7 +1376,7 @@ msgstr "İleri" #: tools/editor/code_editor.cpp msgid "Replaced %d ocurrence(s)." -msgstr "" +msgstr "%d Olgusu(ları) ile Değiştirildi." #: tools/editor/code_editor.cpp msgid "Not found!" @@ -1319,19 +1384,19 @@ msgstr "Bulunamadı!" #: tools/editor/code_editor.cpp msgid "Replace By" -msgstr "" +msgstr "Şununla Değiştir" #: tools/editor/code_editor.cpp msgid "Case Sensitive" -msgstr "" +msgstr "Büyük Küçük Damga Duyarlı" #: tools/editor/code_editor.cpp msgid "Backwards" -msgstr "" +msgstr "Terse doğru" #: tools/editor/code_editor.cpp msgid "Prompt On Replace" -msgstr "" +msgstr "Değişimi Sor" #: tools/editor/code_editor.cpp msgid "Skip" @@ -1340,7 +1405,7 @@ msgstr "Geç" #: tools/editor/code_editor.cpp #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Zoom In" -msgstr "Yakınlaştır" +msgstr "Yaklaş" #: tools/editor/code_editor.cpp #: tools/editor/plugins/canvas_item_editor_plugin.cpp @@ -1349,29 +1414,31 @@ msgstr "Uzaklaştır" #: tools/editor/code_editor.cpp msgid "Reset Zoom" -msgstr "" +msgstr "Yaklaşmayı Sıfırla" #: tools/editor/code_editor.cpp tools/editor/script_editor_debugger.cpp msgid "Line:" -msgstr "Satır:" +msgstr "Dize:" #: tools/editor/code_editor.cpp msgid "Col:" -msgstr "" +msgstr "Dik:" #: tools/editor/connections_dialog.cpp msgid "Method in target Node must be specified!" -msgstr "" +msgstr "Hedef Node daki Yöntem belirtilmeli!" #: tools/editor/connections_dialog.cpp msgid "" "Target method not found! Specify a valid method or attach a script to target " "Node." msgstr "" +"Amaçlanan yöntem bulunamadı! Geçerli bir yöntem belirtin veya amaçlanan " +"Düğüme bir betik iliştirin." #: tools/editor/connections_dialog.cpp msgid "Connect To Node:" -msgstr "Düğüme bağlan:" +msgstr "Düğüme Bağlan:" #: tools/editor/connections_dialog.cpp #: tools/editor/editor_autoload_settings.cpp tools/editor/groups_editor.cpp @@ -1390,43 +1457,43 @@ msgstr "Kaldır" #: tools/editor/connections_dialog.cpp msgid "Add Extra Call Argument:" -msgstr "" +msgstr "Ayrı Çağrı Değiştirgeni Ekleyin:" #: tools/editor/connections_dialog.cpp msgid "Extra Call Arguments:" -msgstr "" +msgstr "Ayrıca Çağrı Değiştirgenler:" #: tools/editor/connections_dialog.cpp msgid "Path to Node:" -msgstr "" +msgstr "Düğüm Yolu:" #: tools/editor/connections_dialog.cpp msgid "Make Function" -msgstr "" +msgstr "İşlev Yap" #: tools/editor/connections_dialog.cpp msgid "Deferred" -msgstr "" +msgstr "Ertelenmiş" #: tools/editor/connections_dialog.cpp msgid "Oneshot" -msgstr "" +msgstr "Tek sefer" #: tools/editor/connections_dialog.cpp msgid "Connect" -msgstr "" +msgstr "Bağla" #: tools/editor/connections_dialog.cpp msgid "Connect '%s' to '%s'" -msgstr "" +msgstr "Bunu '%s' şuna '%s' Bağla" #: tools/editor/connections_dialog.cpp msgid "Connecting Signal:" -msgstr "" +msgstr "İşarete Bağlanıyor:" #: tools/editor/connections_dialog.cpp msgid "Create Subscription" -msgstr "" +msgstr "Üyelik Oluştur" #: tools/editor/connections_dialog.cpp msgid "Connect.." @@ -1439,7 +1506,7 @@ msgstr "Bağlantıyı kes" #: tools/editor/connections_dialog.cpp tools/editor/node_dock.cpp msgid "Signals" -msgstr "" +msgstr "İşaretler" #: tools/editor/create_dialog.cpp msgid "Create New" @@ -1448,7 +1515,7 @@ msgstr "Yeni oluştur" #: tools/editor/create_dialog.cpp tools/editor/editor_file_dialog.cpp #: tools/editor/filesystem_dock.cpp msgid "Favorites:" -msgstr "Favoriler:" +msgstr "Beğeniler:" #: tools/editor/create_dialog.cpp tools/editor/editor_file_dialog.cpp msgid "Recent:" @@ -1467,25 +1534,27 @@ msgstr "Açıklama:" #: tools/editor/dependency_editor.cpp msgid "Search Replacement For:" -msgstr "" +msgstr "Şunun İçin Değişikliği Ara:" #: tools/editor/dependency_editor.cpp msgid "Dependencies For:" -msgstr "" +msgstr "Şunun İçin Bağımlılıklar:" #: tools/editor/dependency_editor.cpp msgid "" "Scene '%s' is currently being edited.\n" "Changes will not take effect unless reloaded." msgstr "" -"'%s' Sahnesi şuanda düzenleniyor.\n" -"Tekrar yüklenene kadar değişiklikler etki etmeyecek." +"'%s' Sahnesi şu anda düzenleniyor.\n" +"Yeniden yüklenene kadar değişiklikler etki etmeyecek." #: tools/editor/dependency_editor.cpp msgid "" "Resource '%s' is in use.\n" "Changes will take effect when reloaded." msgstr "" +"Kaynak '%s' kullanımda.\n" +"Değişiklikler yeniden yükleme yapılınca etkin olacak." #: tools/editor/dependency_editor.cpp msgid "Dependencies" @@ -1498,27 +1567,27 @@ msgstr "Kaynak" #: tools/editor/dependency_editor.cpp tools/editor/editor_autoload_settings.cpp #: tools/editor/project_manager.cpp tools/editor/project_settings.cpp msgid "Path" -msgstr "" +msgstr "Yol" #: tools/editor/dependency_editor.cpp msgid "Dependencies:" -msgstr "" +msgstr "Bağımlılıklar:" #: tools/editor/dependency_editor.cpp msgid "Fix Broken" -msgstr "" +msgstr "Bozulanı Onar" #: tools/editor/dependency_editor.cpp msgid "Dependency Editor" -msgstr "" +msgstr "Bağımlılık Düzenleyicisi" #: tools/editor/dependency_editor.cpp msgid "Search Replacement Resource:" -msgstr "" +msgstr "Değişim Kaynağını Ara:" #: tools/editor/dependency_editor.cpp msgid "Owners Of:" -msgstr "" +msgstr "Bunun Sahibi:" #: tools/editor/dependency_editor.cpp msgid "" @@ -1526,29 +1595,28 @@ msgid "" "work.\n" "Remove them anyway? (no undo)" msgstr "" -"Kaldırılmakta olan dosyalar başka dosyaların çalışması için gerekli.\n" -"Yine de kaldırmak istiyor musunuz?(Geri alınamaz)" +"Kaldırılmakta olan dizeçler başka dizeçlerin çalışması için gerekli.\n" +"Yine de kaldırmak istiyor musunuz? (Geri alınamaz)" #: tools/editor/dependency_editor.cpp msgid "Remove selected files from the project? (no undo)" -msgstr "Seçili dosyaları projeden kaldır? (Geri alınamaz)" +msgstr "Seçili dizeçleri tasarıdan kaldır? (Geri alınamaz)" #: tools/editor/dependency_editor.cpp msgid "Error loading:" -msgstr "Yüklerken hata:" +msgstr "Yüklerken sorun:" #: tools/editor/dependency_editor.cpp msgid "Scene failed to load due to missing dependencies:" -msgstr "" -"Sahnede ki kayıp bağımlılıklar yüzünden sahneyi yükleme başarısız oldu:" +msgstr "Sahnedeki kayıp bağımlılıklar yüzünden sahneyi yükleme başarısız oldu:" #: tools/editor/dependency_editor.cpp msgid "Open Anyway" -msgstr "Yinede Aç" +msgstr "Yine de Aç" #: tools/editor/dependency_editor.cpp msgid "Which action should be taken?" -msgstr "" +msgstr "Hangi eylem alınmalı?" #: tools/editor/dependency_editor.cpp msgid "Fix Dependencies" @@ -1556,27 +1624,27 @@ msgstr "Bağımlılıkları düzelt" #: tools/editor/dependency_editor.cpp msgid "Errors loading!" -msgstr "Yüklemede hata!" +msgstr "Yükleme sorunları!" #: tools/editor/dependency_editor.cpp msgid "Permanently delete %d item(s)? (No undo!)" -msgstr "%d Öğeleri kalıcı olarak sil? (No undo!)" +msgstr "%d Öğeleri kalıcı olarak silsin mi? (Geri alınamaz!)" #: tools/editor/dependency_editor.cpp msgid "Owns" -msgstr "" +msgstr "Sahipler" #: tools/editor/dependency_editor.cpp msgid "Resources Without Explicit Ownership:" -msgstr "" +msgstr "Belirgin Sahipliği Olmayan Kaynaklar:" #: tools/editor/dependency_editor.cpp tools/editor/editor_node.cpp msgid "Orphan Resource Explorer" -msgstr "" +msgstr "Orphan Kaynak Gezgini" #: tools/editor/dependency_editor.cpp msgid "Delete selected files?" -msgstr "Seçili dosyaları sil?" +msgstr "Seçili dizeçleri sil?" #: tools/editor/dependency_editor.cpp tools/editor/editor_node.cpp #: tools/editor/filesystem_dock.cpp @@ -1587,23 +1655,23 @@ msgstr "Sil" #: tools/editor/editor_autoload_settings.cpp msgid "Invalid name." -msgstr "Geçersiz isim." +msgstr "Geçersiz ad." #: tools/editor/editor_autoload_settings.cpp msgid "Valid characters:" -msgstr "Gecerli karakterler:" +msgstr "Geçerli damgalar:" #: tools/editor/editor_autoload_settings.cpp msgid "Invalid name. Must not collide with an existing engine class name." -msgstr "Geçersiz isim. Motora kullanılan sınıf adları kullanılamaz." +msgstr "Geçersiz ad. Devinimcide kullanılan bölüt adları kullanılamaz." #: tools/editor/editor_autoload_settings.cpp msgid "Invalid name. Must not collide with an existing buit-in type name." -msgstr "" +msgstr "Geçersiz ad. Var olan gömülü türdeki ad ile çakışmamalı." #: tools/editor/editor_autoload_settings.cpp msgid "Invalid name. Must not collide with an existing global constant name." -msgstr "Geçersiz isim. İsim , evrensel sabit isimleriyle aynı olamaz." +msgstr "Geçersiz ad. Var olan genel değişmeyen bir adla çakışmamalıdır." #: tools/editor/editor_autoload_settings.cpp msgid "Invalid Path." @@ -1611,36 +1679,35 @@ msgstr "Gecersiz Yol." #: tools/editor/editor_autoload_settings.cpp msgid "File does not exist." -msgstr "Dosya mevcut değil." +msgstr "Dizeç yok." #: tools/editor/editor_autoload_settings.cpp msgid "Not in resource path." -msgstr "Kaynak yolunda degil." +msgstr "Kaynak yolunda değil." #: tools/editor/editor_autoload_settings.cpp -#, fuzzy msgid "Add AutoLoad" -msgstr "AutoLoad ekle" +msgstr "KendindenYüklenme Ekle" #: tools/editor/editor_autoload_settings.cpp msgid "Autoload '%s' already exists!" -msgstr "" +msgstr "KendindenYüklenme '%s' zaten var!" #: tools/editor/editor_autoload_settings.cpp msgid "Rename Autoload" -msgstr "" +msgstr "KendindenYüklenme'yi Yeniden Adlandır" #: tools/editor/editor_autoload_settings.cpp msgid "Toggle AutoLoad Globals" -msgstr "" +msgstr "KendindenYüklenme Bütünsellerini Aç / Kapat" #: tools/editor/editor_autoload_settings.cpp msgid "Move Autoload" -msgstr "" +msgstr "KendindenYüklenme'yi Taşı" #: tools/editor/editor_autoload_settings.cpp msgid "Remove Autoload" -msgstr "" +msgstr "KendindenYüklenme'yi Kaldır" #: tools/editor/editor_autoload_settings.cpp msgid "Enable" @@ -1648,7 +1715,7 @@ msgstr "Etkin" #: tools/editor/editor_autoload_settings.cpp msgid "Rearrange Autoloads" -msgstr "" +msgstr "KendindenYüklenme'leri Yeniden Sırala" #: tools/editor/editor_autoload_settings.cpp msgid "Node Name:" @@ -1659,15 +1726,15 @@ msgstr "Düğüm adı:" #: tools/editor/plugins/sample_library_editor_plugin.cpp #: tools/editor/project_manager.cpp msgid "Name" -msgstr "İsim" +msgstr "Ad" #: tools/editor/editor_autoload_settings.cpp msgid "Singleton" -msgstr "Tekil (Singleton)" +msgstr "Tekil" #: tools/editor/editor_autoload_settings.cpp msgid "List:" -msgstr "Liste:" +msgstr "Dizelge:" #: tools/editor/editor_data.cpp msgid "Updating Scene" @@ -1707,35 +1774,35 @@ msgstr "Yenile" #: tools/editor/editor_file_dialog.cpp msgid "Toggle Hidden Files" -msgstr "" +msgstr "Gizli Dizeçleri Aç / Kapat" #: tools/editor/editor_file_dialog.cpp msgid "Toggle Favorite" -msgstr "" +msgstr "Beğenileni Aç / Kapat" #: tools/editor/editor_file_dialog.cpp msgid "Toggle Mode" -msgstr "" +msgstr "Aç / Kapat Biçimi" #: tools/editor/editor_file_dialog.cpp msgid "Focus Path" -msgstr "" +msgstr "Yola Odaklan" #: tools/editor/editor_file_dialog.cpp msgid "Move Favorite Up" -msgstr "" +msgstr "Beğenileni Yukarı Taşı" #: tools/editor/editor_file_dialog.cpp msgid "Move Favorite Down" -msgstr "" +msgstr "Beğenileni Aşağı Taşı" #: tools/editor/editor_file_dialog.cpp msgid "Preview:" -msgstr "Ön izleme:" +msgstr "Önizleme:" #: tools/editor/editor_file_system.cpp msgid "ScanSources" -msgstr "" +msgstr "KaynaklarıTara" #: tools/editor/editor_help.cpp tools/editor/plugins/script_editor_plugin.cpp msgid "Search Help" @@ -1743,44 +1810,49 @@ msgstr "Yardım Ara" #: tools/editor/editor_help.cpp msgid "Class List:" -msgstr "Sınıf Listesi:" +msgstr "Bölüt Dizelgesi:" #: tools/editor/editor_help.cpp msgid "Search Classes" -msgstr "Sınıfları Ara" +msgstr "Bölütleri Ara" #: tools/editor/editor_help.cpp tools/editor/property_editor.cpp msgid "Class:" -msgstr "Sınıf:" +msgstr "Bölüt:" #: tools/editor/editor_help.cpp tools/editor/scene_tree_editor.cpp #: tools/editor/script_create_dialog.cpp msgid "Inherits:" -msgstr "" +msgstr "Kalıtçılar:" #: tools/editor/editor_help.cpp msgid "Inherited by:" -msgstr "Tarafından miras alındı:" +msgstr "Tarafından kalıt alındı:" #: tools/editor/editor_help.cpp msgid "Brief Description:" -msgstr "" +msgstr "Kısa Açıklama:" #: tools/editor/editor_help.cpp msgid "Public Methods:" -msgstr "Public Metodlar:" +msgstr "Açık Yöntemler:" #: tools/editor/editor_help.cpp msgid "GUI Theme Items:" -msgstr "Arayüz Tema Öğeleri:" +msgstr "Arayüz Kalıbı Öğeleri:" #: tools/editor/editor_help.cpp msgid "Constants:" msgstr "Sabitler:" #: tools/editor/editor_help.cpp +#, fuzzy +msgid "Property Description:" +msgstr "Kısa Açıklama:" + +#: tools/editor/editor_help.cpp msgid "Method Description:" -msgstr "Metot Açıklaması:" +msgstr "Yöntem Açıklaması:" #: tools/editor/editor_help.cpp msgid "Search Text" @@ -1796,27 +1868,27 @@ msgstr "Silinen:" #: tools/editor/editor_import_export.cpp tools/editor/project_export.cpp msgid "Error saving atlas:" -msgstr "Atlas kaydedilirken hata oluştu:" +msgstr "Atlas kaydedilirken sorun oluştu:" #: tools/editor/editor_import_export.cpp msgid "Could not save atlas subtexture:" -msgstr "" +msgstr "Atlas alt dokusu kaydedilemedi:" #: tools/editor/editor_import_export.cpp msgid "Storing File:" -msgstr "" +msgstr "Dizeci Depoluyor:" #: tools/editor/editor_import_export.cpp msgid "Packing" -msgstr "" +msgstr "Çıkınla" #: tools/editor/editor_import_export.cpp msgid "Exporting for %s" -msgstr "" +msgstr "%s için Dışa Aktarım" #: tools/editor/editor_import_export.cpp msgid "Setting Up.." -msgstr "" +msgstr "Kurulum..." #: tools/editor/editor_log.cpp msgid " Output:" @@ -1824,43 +1896,45 @@ msgstr " Çıktı:" #: tools/editor/editor_node.cpp tools/editor/editor_reimport_dialog.cpp msgid "Re-Importing" -msgstr "" +msgstr "Yeniden-İçe Aktarım" #: tools/editor/editor_node.cpp msgid "Importing:" -msgstr "" +msgstr "İçe Aktarım:" #: tools/editor/editor_node.cpp msgid "Node From Scene" -msgstr "" +msgstr "Sahneden Düğüm(node)" #: tools/editor/editor_node.cpp #: tools/editor/plugins/animation_player_editor_plugin.cpp #: tools/editor/resources_dock.cpp msgid "Error saving resource!" -msgstr "" +msgstr "Kaynak kaydedilirken sorun!" #: tools/editor/editor_node.cpp #: tools/editor/plugins/animation_player_editor_plugin.cpp #: tools/editor/resources_dock.cpp msgid "Save Resource As.." -msgstr "Kaynağı Farklı Kaydet.." +msgstr "Kaynağı Başkaca Kaydet.." -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "Anlıyorum.." #: tools/editor/editor_node.cpp msgid "Can't open file for writing:" -msgstr "Dosya yazmak için açılamıyor:" +msgstr "Dizeç yazmak için açılamıyor:" #: tools/editor/editor_node.cpp msgid "Requested file format unknown:" -msgstr "Talep edilen dosya formatı bilinmiyor:" +msgstr "İstenilen dizeç formatı bilinmiyor:" #: tools/editor/editor_node.cpp msgid "Error while saving." -msgstr "Kaydedilirken hata oluştu." +msgstr "Kaydedilirken sorun oluştu." #: tools/editor/editor_node.cpp msgid "Saving Scene" @@ -1868,64 +1942,64 @@ msgstr "Sahne Kaydediliyor" #: tools/editor/editor_node.cpp msgid "Analyzing" -msgstr "Analiz Ediliyor" +msgstr "Çözümleniyor" #: tools/editor/editor_node.cpp msgid "Creating Thumbnail" -msgstr "Küçük Resim Oluşturuluyor" +msgstr "Küçük Bediz Oluşturuluyor" #: tools/editor/editor_node.cpp msgid "" "Couldn't save scene. Likely dependencies (instances) couldn't be satisfied." -msgstr "" +msgstr "Sahne kaydedilemedi. Anlaşılan bağımlılıklar (örnekler) karşılanamadı." #: tools/editor/editor_node.cpp msgid "Failed to load resource." -msgstr "Kaynak yüklenirken hata oluştu." +msgstr "Kaynak yüklenirken sorun oluştu." #: tools/editor/editor_node.cpp msgid "Can't load MeshLibrary for merging!" -msgstr "" +msgstr "Birleştirme için MeshLibrary yüklenemedi!" #: tools/editor/editor_node.cpp msgid "Error saving MeshLibrary!" -msgstr "" +msgstr "MeshLibrary kayıt edilirken sorun!" #: tools/editor/editor_node.cpp msgid "Can't load TileSet for merging!" -msgstr "" +msgstr "TileSet birleştirme için yüklenemedi!" #: tools/editor/editor_node.cpp msgid "Error saving TileSet!" -msgstr "" +msgstr "TileSet kayıt edilirken sorun!" #: tools/editor/editor_node.cpp msgid "Can't open export templates zip." -msgstr "" +msgstr "Dışa aktarım kalıplarının zipi açılamadı." #: tools/editor/editor_node.cpp msgid "Loading Export Templates" -msgstr "" +msgstr "Dışa Aktarım Kalıpları Yükleniyor" #: tools/editor/editor_node.cpp msgid "Error trying to save layout!" -msgstr "Düzen kaydedilmeye çalışılırken hata oluştu!" +msgstr "Tasarım kaydedilmeye çalışılırken sorun oluştu!" #: tools/editor/editor_node.cpp msgid "Default editor layout overridden." -msgstr "" +msgstr "Önyüklü düzenleyici tasarımı geçersiz kılındı." #: tools/editor/editor_node.cpp msgid "Layout name not found!" -msgstr "" +msgstr "Tasarım adı bulunamadı!" #: tools/editor/editor_node.cpp msgid "Restored default layout to base settings." -msgstr "" +msgstr "Önyüklü tasarım temel ayarlara onarıldı." #: tools/editor/editor_node.cpp msgid "Copy Params" -msgstr "Parametreleri Kopyala" +msgstr "Değişkenleri Tıpkıla" #: tools/editor/editor_node.cpp msgid "Paste Params" @@ -1938,12 +2012,11 @@ msgstr "Kaynağı Yapıştır" #: tools/editor/editor_node.cpp msgid "Copy Resource" -msgstr "Kaynağı Kopyala" +msgstr "Kaynağı Tıpkıla" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Make Built-In" -msgstr "Göm" +msgstr "Gömülü Yap" #: tools/editor/editor_node.cpp msgid "Make Sub-Resources Unique" @@ -1963,6 +2036,9 @@ msgid "" "You can change it later in later in \"Project Settings\" under the " "'application' category." msgstr "" +"Hiçbir ana sahne tanımlanmadı, birini seçiniz?\n" +"Daha sonra \"uygulama\" kategorisinin altındaki \"Tasarı Ayarları\" ndan " +"değiştirebilirsiniz." #: tools/editor/editor_node.cpp msgid "" @@ -1970,6 +2046,9 @@ msgid "" "You can change it later in \"Project Settings\" under the 'application' " "category." msgstr "" +"Seçilen sahne '%s' mevcut değil, geçerli bir tane seçin?\n" +"Daha sonra \"uygulama\" kategorisinin altındaki \"Tasarı Ayarları\" ndan " +"değiştirebilirsiniz." #: tools/editor/editor_node.cpp msgid "" @@ -1977,10 +2056,13 @@ msgid "" "You can change it later in \"Project Settings\" under the 'application' " "category." msgstr "" +"Seçilen sahne '%s' bir sahne dizeci değil, geçerli bir tane seç?\n" +"Daha sonra \"uygulama\" kategorisinin altındaki \"Tasarı Ayarları\" ndan " +"değiştirebilirsiniz." #: tools/editor/editor_node.cpp msgid "Current scene was never saved, please save it prior to running." -msgstr "Mevcut sahne hiç kaydedilmedi,lütfen çalıştırmadan önce kaydediniz." +msgstr "Şimdiki sahne hiç kaydedilmedi, lütfen çalıştırmadan önce kaydediniz." #: tools/editor/editor_node.cpp msgid "Could not start subprocess!" @@ -2008,11 +2090,11 @@ msgstr "Evet" #: tools/editor/editor_node.cpp msgid "Close scene? (Unsaved changes will be lost)" -msgstr "Sahneyi kapat? (Kaydedilmemiş değişiklikler yok olacak)" +msgstr "Sahneyi kapatsın mı? (Kaydedilmemiş değişiklikler yok olacak)" #: tools/editor/editor_node.cpp msgid "Save Scene As.." -msgstr "Sahneyi Farklı Kaydet.." +msgstr "Sahneyi Başkaca Kaydet.." #: tools/editor/editor_node.cpp msgid "This scene has never been saved. Save before running?" @@ -2028,164 +2110,171 @@ msgstr "Çevirilebilir Metinleri Kaydet" #: tools/editor/editor_node.cpp msgid "Export Mesh Library" -msgstr "" +msgstr "Örüntü Betikevini Dışa Aktar" #: tools/editor/editor_node.cpp msgid "Export Tile Set" -msgstr "" +msgstr "Döşenti Dizi Dışa Aktar" #: tools/editor/editor_node.cpp msgid "Quit" -msgstr "" +msgstr "Çıkış" #: tools/editor/editor_node.cpp msgid "Exit the editor?" -msgstr "" +msgstr "Düzenleyiciden çık?" #: tools/editor/editor_node.cpp msgid "Current scene not saved. Open anyway?" -msgstr "" +msgstr "Var olan sahne kaydedilmedi. Yine de açılsın mı?" #: tools/editor/editor_node.cpp msgid "Can't reload a scene that was never saved." -msgstr "" +msgstr "Hiç kaydedilmemiş bir sahne yeniden yüklenemiyor." #: tools/editor/editor_node.cpp msgid "Revert" -msgstr "" +msgstr "Geri dön" #: tools/editor/editor_node.cpp msgid "This action cannot be undone. Revert anyway?" -msgstr "" +msgstr "Bu eylem geri alınamaz. Yine de geri dönsün mü?" #: tools/editor/editor_node.cpp msgid "Quick Run Scene.." -msgstr "" +msgstr "Sahneyi Hızlı Çalıştır.." #: tools/editor/editor_node.cpp msgid "" "Open Project Manager? \n" "(Unsaved changes will be lost)" msgstr "" +"Tasarı Yöneticisini Aç\n" +"(Kaydedilmemiş değişiklikler kaybolacak!)" #: tools/editor/editor_node.cpp msgid "Pick a Main Scene" -msgstr "" +msgstr "Bir Ana Sahne Seç" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" -msgstr "" +msgstr "Öff" #: tools/editor/editor_node.cpp msgid "" "Error loading scene, it must be inside the project path. Use 'Import' to " "open the scene, then save it inside the project path." msgstr "" +"Sahne yüklenirken sorun oluştu, tasarı yolunun içinde olmalı. Sahneyi açmak " +"için 'İçe Aktar' seçeneğini kullanın, ardından tasarının yolunun içine " +"kaydedin." #: tools/editor/editor_node.cpp msgid "Error loading scene." -msgstr "" +msgstr "Sahne yüklenirken sorun oluştu." #: tools/editor/editor_node.cpp msgid "Scene '%s' has broken dependencies:" -msgstr "" +msgstr "Sahne '%s' bağımlılıkları koptu:" #: tools/editor/editor_node.cpp msgid "Save Layout" -msgstr "" +msgstr "Tasarımı Kaydet" #: tools/editor/editor_node.cpp msgid "Delete Layout" -msgstr "" +msgstr "Tasarımı Sil" #: tools/editor/editor_node.cpp tools/editor/project_export.cpp msgid "Default" -msgstr "" +msgstr "Önyüklü" #: tools/editor/editor_node.cpp msgid "Switch Scene Tab" -msgstr "" +msgstr "Sahne Sekmesine Geç" #: tools/editor/editor_node.cpp msgid "%d more file(s)" -msgstr "" +msgstr "%d daha çok dizeç(ler)" #: tools/editor/editor_node.cpp msgid "%d more file(s) or folder(s)" -msgstr "" +msgstr "%d daha çok dizeç(ler) veya dizin(ler)" #: tools/editor/editor_node.cpp #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Scene" -msgstr "" +msgstr "Sahne" #: tools/editor/editor_node.cpp msgid "Go to previously opened scene." -msgstr "" +msgstr "Daha önce açılan sahneye git." #: tools/editor/editor_node.cpp msgid "Next tab" -msgstr "" +msgstr "Sonraki sekme" #: tools/editor/editor_node.cpp msgid "Previous tab" -msgstr "" +msgstr "Önceki sekme" #: tools/editor/editor_node.cpp msgid "Operations with scene files." -msgstr "" +msgstr "Sahne dizeçlerinin işlemleri." #: tools/editor/editor_node.cpp msgid "New Scene" -msgstr "" +msgstr "Yeni Sahne" #: tools/editor/editor_node.cpp msgid "New Inherited Scene.." -msgstr "" +msgstr "Yeni Kalıt Alınmış Sahne .." #: tools/editor/editor_node.cpp msgid "Open Scene.." -msgstr "" +msgstr "Sahne Aç.." #: tools/editor/editor_node.cpp msgid "Save Scene" -msgstr "" +msgstr "Sahne Kaydet" #: tools/editor/editor_node.cpp msgid "Save all Scenes" -msgstr "" +msgstr "Tüm Sahneleri Kaydet" #: tools/editor/editor_node.cpp msgid "Close Scene" -msgstr "" +msgstr "Sahneyi Kapat" #: tools/editor/editor_node.cpp msgid "Close Goto Prev. Scene" -msgstr "" +msgstr "Önc. Sahneye Git sekmesini Kapat" #: tools/editor/editor_node.cpp msgid "Open Recent" -msgstr "" +msgstr "En Sonuncuyu Aç" #: tools/editor/editor_node.cpp msgid "Quick Filter Files.." -msgstr "" +msgstr "Hızlı Süzgeç Dizeçleri.." #: tools/editor/editor_node.cpp msgid "Convert To.." -msgstr "" +msgstr "Şuna Dönüştür.." #: tools/editor/editor_node.cpp msgid "Translatable Strings.." -msgstr "" +msgstr "Çevirilebilir Dizeler.." #: tools/editor/editor_node.cpp msgid "MeshLibrary.." -msgstr "" +msgstr "MeshLibrary .." #: tools/editor/editor_node.cpp msgid "TileSet.." -msgstr "" +msgstr "TileSet .." #: tools/editor/editor_node.cpp tools/editor/plugins/script_text_editor.cpp #: tools/editor/plugins/shader_editor_plugin.cpp @@ -2193,29 +2282,28 @@ msgid "Redo" msgstr "Geri" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Run Script" msgstr "Betiği Çalıştır" #: tools/editor/editor_node.cpp msgid "Project Settings" -msgstr "Proje Ayarları" +msgstr "Tasarı Ayarları" #: tools/editor/editor_node.cpp msgid "Revert Scene" -msgstr "" +msgstr "Sahneyi Eski Durumuna Çevir" #: tools/editor/editor_node.cpp msgid "Quit to Project List" -msgstr "Proje Listesine Git" +msgstr "Tasarı Dizelgesine Git" #: tools/editor/editor_node.cpp msgid "Distraction Free Mode" -msgstr "" +msgstr "Dikkat Dağıtmayan Biçim" #: tools/editor/editor_node.cpp msgid "Import assets to the project." -msgstr "" +msgstr "Varlıkları tasarının içine aktar." #: tools/editor/editor_node.cpp #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp @@ -2231,7 +2319,7 @@ msgstr "İçe Aktar" #: tools/editor/editor_node.cpp msgid "Miscellaneous project or scene-wide tools." -msgstr "" +msgstr "Türlü tasarı ya da sahne genişliğinde araçlar." #: tools/editor/editor_node.cpp msgid "Tools" @@ -2239,7 +2327,7 @@ msgstr "Araçlar" #: tools/editor/editor_node.cpp msgid "Export the project to many platforms." -msgstr "" +msgstr "Tasarıyı pek çok ortama aktarın." #: tools/editor/editor_node.cpp tools/editor/project_export.cpp msgid "Export" @@ -2247,7 +2335,7 @@ msgstr "Dışa Aktar" #: tools/editor/editor_node.cpp msgid "Play the project." -msgstr "Projeyi oynat." +msgstr "Tasarıyı oynat." #: tools/editor/editor_node.cpp #: tools/editor/plugins/sample_library_editor_plugin.cpp @@ -2281,29 +2369,31 @@ msgstr "Sahneyi Oynat" #: tools/editor/editor_node.cpp msgid "Play custom scene" -msgstr "" +msgstr "Özel sahneyi oynat" #: tools/editor/editor_node.cpp msgid "Play Custom Scene" -msgstr "" +msgstr "Özel Sahneyi Oynat" #: tools/editor/editor_node.cpp msgid "Debug options" -msgstr "" +msgstr "Sorun ayıklama seçenekleri" #: tools/editor/editor_node.cpp msgid "Deploy with Remote Debug" -msgstr "" +msgstr "Uzaktan Sorun Ayıklama ile Dağıt" #: tools/editor/editor_node.cpp msgid "" "When exporting or deploying, the resulting executable will attempt to " "connect to the IP of this computer in order to be debugged." msgstr "" +"Verilen yürütülebilir dizeç, dışa aktarılırken veya dağıtıldığında, sorun " +"ayıklanacak şekilde bu bilgisayarın IP'sine bağlanmaya çalışacaktır." #: tools/editor/editor_node.cpp msgid "Small Deploy with Network FS" -msgstr "" +msgstr "Ağ DS'li Küçük Dağıtım" #: tools/editor/editor_node.cpp msgid "" @@ -2314,30 +2404,39 @@ msgid "" "On Android, deploy will use the USB cable for faster performance. This " "option speeds up testing for games with a large footprint." msgstr "" +"Bu seçenek etkinleştirildiğinde, dışa aktarma veya dağıtma çok küçük bir " +"çalıştırılabilir dizeç üretir.\n" +"Dizeç düzeni, ağ üzerindeki düzenleyici tarafından tasarıdan sağlanacaktır.\n" +"Android'de daha hızlı verim için dağıtım uygulaması USB kablosunu " +"kullanacak. Bu seçenek, ayak izi büyük olan oyunları denemeyi hızlandırır." #: tools/editor/editor_node.cpp msgid "Visible Collision Shapes" -msgstr "" +msgstr "Görünür Çarpışma Şekilleri" #: tools/editor/editor_node.cpp msgid "" "Collision shapes and raycast nodes (for 2D and 3D) will be visible on the " "running game if this option is turned on." msgstr "" +"Bu seçenek açıksa, çalışan oyunda çarpışma şekilleri ve raycast düğümleri " +"(2B ve 3B için) görünür olacaktır." #: tools/editor/editor_node.cpp msgid "Visible Navigation" -msgstr "" +msgstr "Görünür Yönlendirici" #: tools/editor/editor_node.cpp msgid "" "Navigation meshes and polygons will be visible on the running game if this " "option is turned on." msgstr "" +"Bu seçenek açıksa, çalışan oyunda yönlendirici örüntüleri ve çokgenler " +"görünür olacaktır." #: tools/editor/editor_node.cpp msgid "Sync Scene Changes" -msgstr "" +msgstr "Sahne Değişikliklerini Eşzamanla" #: tools/editor/editor_node.cpp msgid "" @@ -2346,10 +2445,14 @@ msgid "" "When used remotely on a device, this is more efficient with network " "filesystem." msgstr "" +"Bu seçenek etkinleştirildiğinde, düzenleyicide bulunan sahnedeki " +"değişiklikler çalışmakta olan oyununda çoğaltılır.\n" +"Bir cihazda uzaktan kullanıldığında, ağ dizeç düzeni ile bu işlem daha " +"verimli olur." #: tools/editor/editor_node.cpp msgid "Sync Script Changes" -msgstr "" +msgstr "Betik Değişikliklerini Eşzamanla" #: tools/editor/editor_node.cpp msgid "" @@ -2358,6 +2461,10 @@ msgid "" "When used remotely on a device, this is more efficient with network " "filesystem." msgstr "" +"Bu seçenek etkinleştirildiğinde, kaydedilen tüm betik çalışan oyunda yeniden " +"yüklenecektir.\n" +"Bir cihazda uzaktan kullanıldığında, ağ dizeç düzeni ile bu işlem daha " +"verimli olur." #: tools/editor/editor_node.cpp tools/editor/plugins/spatial_editor_plugin.cpp msgid "Settings" @@ -2365,31 +2472,31 @@ msgstr "Ayarlar" #: tools/editor/editor_node.cpp tools/editor/settings_config_dialog.cpp msgid "Editor Settings" -msgstr "Editör Ayarları" +msgstr "Düzenleyici Ayarları" #: tools/editor/editor_node.cpp msgid "Editor Layout" -msgstr "Editör Düzeni" +msgstr "Düzenleyici Tasarımı" #: tools/editor/editor_node.cpp msgid "Toggle Fullscreen" -msgstr "" +msgstr "Tam Ekran Aç / Kapat" #: tools/editor/editor_node.cpp msgid "Install Export Templates" -msgstr "" +msgstr "Dışa Aktarım Kalıplarını Yükle" #: tools/editor/editor_node.cpp msgid "About" -msgstr "Hakkında" +msgstr "İlişkin" #: tools/editor/editor_node.cpp msgid "Alerts when an external resource has changed." -msgstr "Harici kaynaklar da değişme olursa uyarır." +msgstr "Dış kaynaklar değişince uyarır." #: tools/editor/editor_node.cpp msgid "Spins when the editor window repaints!" -msgstr "" +msgstr "Düzenleyici penceresi yeniden boyandığında döndürülür!" #: tools/editor/editor_node.cpp msgid "Update Always" @@ -2397,43 +2504,43 @@ msgstr "Sürekli Güncelle" #: tools/editor/editor_node.cpp msgid "Update Changes" -msgstr "" +msgstr "Değişiklikleri güncelle" #: tools/editor/editor_node.cpp msgid "Disable Update Spinner" -msgstr "" +msgstr "Güncelleme Topacını Devre Dışı Bırak" #: tools/editor/editor_node.cpp msgid "Inspector" -msgstr "" +msgstr "Denetçi" #: tools/editor/editor_node.cpp msgid "Create a new resource in memory and edit it." -msgstr "" +msgstr "Bellekte yeni bir kaynak oluşturun ve onu düzenleyin." #: tools/editor/editor_node.cpp msgid "Load an existing resource from disk and edit it." -msgstr "" +msgstr "Var olan bir kaynağı saklaktan yükleyin ve düzenleyin." #: tools/editor/editor_node.cpp msgid "Save the currently edited resource." -msgstr "" +msgstr "Düzenlenen kaynağı kaydedin." #: tools/editor/editor_node.cpp tools/editor/plugins/script_editor_plugin.cpp msgid "Save As.." -msgstr "Farklı Kaydet.." +msgstr "Başkaca Kaydet.." #: tools/editor/editor_node.cpp msgid "Go to the previous edited object in history." -msgstr "" +msgstr "Geçmişte bir önceki düzenlenmiş nesneye gidin." #: tools/editor/editor_node.cpp msgid "Go to the next edited object in history." -msgstr "" +msgstr "Geçmişte bir sonraki düzenlenmiş nesneye gidin." #: tools/editor/editor_node.cpp msgid "History of recently edited objects." -msgstr "" +msgstr "En son düzenlenen nesnelerin geçmişi." #: tools/editor/editor_node.cpp msgid "Object properties." @@ -2441,63 +2548,63 @@ msgstr "Nesne özellikleri." #: tools/editor/editor_node.cpp msgid "FileSystem" -msgstr "" +msgstr "DizeçDüzeni" #: tools/editor/editor_node.cpp tools/editor/node_dock.cpp msgid "Node" -msgstr "" +msgstr "Düğüm" #: tools/editor/editor_node.cpp msgid "Output" -msgstr "" +msgstr "Çıktı" #: tools/editor/editor_node.cpp tools/editor/editor_reimport_dialog.cpp msgid "Re-Import" -msgstr "" +msgstr "Yeniden İçe Aktar" #: tools/editor/editor_node.cpp tools/editor/editor_plugin_settings.cpp msgid "Update" -msgstr "" +msgstr "Güncelle" #: tools/editor/editor_node.cpp msgid "Thanks from the Godot community!" -msgstr "Godot Topluluğu Teşekkürler Eder!" +msgstr "Godot Topluluğu Sağ Olmanızı Diliyor!" #: tools/editor/editor_node.cpp msgid "Thanks!" -msgstr "Teşekkürler!" +msgstr "Sağ olun!" #: tools/editor/editor_node.cpp msgid "Import Templates From ZIP File" -msgstr "" +msgstr "Kalıpları ZIP Dizecinden İçe Aktar" #: tools/editor/editor_node.cpp tools/editor/project_export.cpp msgid "Export Project" -msgstr "" +msgstr "Tasarıyı Dışa Aktar" #: tools/editor/editor_node.cpp msgid "Export Library" -msgstr "" +msgstr "Betikevini Dışa Aktar" #: tools/editor/editor_node.cpp msgid "Merge With Existing" -msgstr "" +msgstr "Var Olanla Birleştir" #: tools/editor/editor_node.cpp tools/editor/project_export.cpp msgid "Password:" -msgstr "Şifre:" +msgstr "Gizyazı:" #: tools/editor/editor_node.cpp msgid "Open & Run a Script" -msgstr "" +msgstr "Aç & Bir Betik Çalıştır" #: tools/editor/editor_node.cpp msgid "Load Errors" -msgstr "" +msgstr "Sorunları Yükle" #: tools/editor/editor_plugin_settings.cpp msgid "Installed Plugins:" -msgstr "" +msgstr "Yüklü Eklentiler:" #: tools/editor/editor_plugin_settings.cpp msgid "Version:" @@ -2513,47 +2620,47 @@ msgstr "Durum:" #: tools/editor/editor_profiler.cpp msgid "Stop Profiling" -msgstr "" +msgstr "Kesitlemeyi Durdur" #: tools/editor/editor_profiler.cpp msgid "Start Profiling" -msgstr "" +msgstr "Kesitlemeyi Başlat" #: tools/editor/editor_profiler.cpp msgid "Measure:" -msgstr "" +msgstr "Ölçüm:" #: tools/editor/editor_profiler.cpp msgid "Frame Time (sec)" -msgstr "" +msgstr "Kare Zamanı (sn)" #: tools/editor/editor_profiler.cpp msgid "Average Time (sec)" -msgstr "" +msgstr "Ortalama Zaman (sn)" #: tools/editor/editor_profiler.cpp msgid "Frame %" -msgstr "" +msgstr "Kare %" #: tools/editor/editor_profiler.cpp msgid "Fixed Frame %" -msgstr "" +msgstr "Sabit Kare %" #: tools/editor/editor_profiler.cpp tools/editor/script_editor_debugger.cpp msgid "Time:" -msgstr "" +msgstr "Süre:" #: tools/editor/editor_profiler.cpp msgid "Inclusive" -msgstr "" +msgstr "Kapsayıcı" #: tools/editor/editor_profiler.cpp msgid "Self" -msgstr "" +msgstr "Kendi" #: tools/editor/editor_profiler.cpp msgid "Frame #:" -msgstr "" +msgstr "Kare #:" #: tools/editor/editor_reimport_dialog.cpp msgid "Please wait for scan to complete." @@ -2561,7 +2668,7 @@ msgstr "Tarama için bitmesini bekleyin." #: tools/editor/editor_reimport_dialog.cpp msgid "Current scene must be saved to re-import." -msgstr "Yeniden içe aktarmak için şimdiki sahneyi kaydet." +msgstr "Yeniden içe aktarmak için şu anki sahneyi kaydet." #: tools/editor/editor_reimport_dialog.cpp msgid "Save & Re-Import" @@ -2573,19 +2680,19 @@ msgstr "Değiştirilmiş Kaynakları Yeniden İçe Aktar" #: tools/editor/editor_run_script.cpp msgid "Write your logic in the _run() method." -msgstr "" +msgstr "Mantığını _run() yöntemine yaz." #: tools/editor/editor_run_script.cpp msgid "There is an edited scene already." -msgstr "" +msgstr "Düzenlenmiş bir sahne zaten var." #: tools/editor/editor_run_script.cpp msgid "Couldn't instance script:" -msgstr "" +msgstr "Betik dizeci alınamadı:" #: tools/editor/editor_run_script.cpp msgid "Did you forget the 'tool' keyword?" -msgstr "" +msgstr "'araç' anahtar sözcüğünü unuttunuz mu?" #: tools/editor/editor_run_script.cpp msgid "Couldn't run script:" @@ -2593,11 +2700,11 @@ msgstr "Betik çalıştırılamadı:" #: tools/editor/editor_run_script.cpp msgid "Did you forget the '_run' method?" -msgstr "" +msgstr "'_run()' yöntemini unuttunuz mu?" #: tools/editor/editor_settings.cpp msgid "Default (Same as Editor)" -msgstr "" +msgstr "Önyüklü(Düzenleyici ile aynı)" #: tools/editor/editor_sub_scene.cpp msgid "Select Node(s) to Import" @@ -2614,33 +2721,34 @@ msgstr "Düğümden İçe Aktar:" #: tools/editor/file_type_cache.cpp msgid "Can't open file_type_cache.cch for writing, not saving file type cache!" msgstr "" +"file_type_cache.cch yazma için açılamıyor! Dizeç türü önbelleğe " +"kaydedilmiyor!" #: tools/editor/filesystem_dock.cpp msgid "Same source and destination files, doing nothing." -msgstr "Aynı dosya kaynağı ve hedefi, bir şey yapılmayacak." +msgstr "Özdeş kaynak ve varış dizeçleri, hiçbir şey yapılmıyor." #: tools/editor/filesystem_dock.cpp msgid "Same source and destination paths, doing nothing." -msgstr "" +msgstr "Özdeş kaynak ve varış yolları, hiçbir şey yapılmıyor." #: tools/editor/filesystem_dock.cpp msgid "Can't move directories to within themselves." -msgstr "" +msgstr "Dizinleri kendi içlerine taşıyamazsınız." #: tools/editor/filesystem_dock.cpp msgid "Can't operate on '..'" -msgstr "" +msgstr "'..' üzerinde çalışılamıyor" #: tools/editor/filesystem_dock.cpp msgid "Pick New Name and Location For:" -msgstr "" +msgstr "Şunun için yeni ad ile konum seçin:" #: tools/editor/filesystem_dock.cpp msgid "No files selected!" -msgstr "Hiçbir Dosya Seçilmedi!" +msgstr "Hiçbir Dizeç Seçilmedi!" #: tools/editor/filesystem_dock.cpp -#, fuzzy msgid "Instance" msgstr "Örnek" @@ -2654,11 +2762,11 @@ msgstr "Sahipleri Görüntüle.." #: tools/editor/filesystem_dock.cpp msgid "Copy Path" -msgstr "Dosya Yolunu Kopyala" +msgstr "Dizeç Yolunu Tıpkıla" #: tools/editor/filesystem_dock.cpp msgid "Rename or Move.." -msgstr "İsim Değiştir veya Taşı.." +msgstr "Yeniden Adlandır ya da Taşı.." #: tools/editor/filesystem_dock.cpp msgid "Move To.." @@ -2670,15 +2778,15 @@ msgstr "Bilgi" #: tools/editor/filesystem_dock.cpp msgid "Show In File Manager" -msgstr "Dosya Yöneticisinde Göster" +msgstr "Dizeç Yöneticisinde Göster" #: tools/editor/filesystem_dock.cpp msgid "Re-Import.." -msgstr "" +msgstr "Yeniden İçe Aktar.." #: tools/editor/filesystem_dock.cpp msgid "Previous Directory" -msgstr "" +msgstr "Önceki Dizin" #: tools/editor/filesystem_dock.cpp msgid "Next Directory" @@ -2686,15 +2794,15 @@ msgstr "Sıradaki Dizin" #: tools/editor/filesystem_dock.cpp msgid "Re-Scan Filesystem" -msgstr "Dosya Sistemini Tekrar Tara" +msgstr "Dizeç Düzenini Yeniden Tara" #: tools/editor/filesystem_dock.cpp msgid "Toggle folder status as Favorite" -msgstr "" +msgstr "Dizin Durumlarını Beğenilen Olarak Aç/Kapat" #: tools/editor/filesystem_dock.cpp msgid "Instance the selected scene(s) as child of the selected node." -msgstr "" +msgstr "Seçilen sahneyi/sahneleri seçilen düğüme çocuk olarak örneklendir." #: tools/editor/filesystem_dock.cpp msgid "Move" @@ -2702,51 +2810,51 @@ msgstr "Taşı" #: tools/editor/groups_editor.cpp msgid "Add to Group" -msgstr "Gruba Ekle" +msgstr "Öbeğe Ekle" #: tools/editor/groups_editor.cpp msgid "Remove from Group" -msgstr "Gruptan Kaldır" +msgstr "Öbekten Kaldır" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp msgid "No bit masks to import!" -msgstr "" +msgstr "Alınacak hiç bit örteci yok!" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp #: tools/editor/io_plugins/editor_sample_import_plugin.cpp #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Target path is empty." -msgstr "Hedef dosya yolu boş." +msgstr "Amaçlanan dizeç yolu boş." #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp #: tools/editor/io_plugins/editor_sample_import_plugin.cpp #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Target path must be a complete resource path." -msgstr "" +msgstr "Amaçlanan yol, tam bir kaynak yolu olmalıdır." #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp #: tools/editor/io_plugins/editor_sample_import_plugin.cpp #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Target path must exist." -msgstr "Hedef dosya yolu mevcut olmalı." +msgstr "Amaçlanan dizeç yolu var olmalı." #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp #: tools/editor/io_plugins/editor_mesh_import_plugin.cpp #: tools/editor/io_plugins/editor_sample_import_plugin.cpp msgid "Save path is empty!" -msgstr "" +msgstr "Kayıt yolu boş!" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp msgid "Import BitMasks" -msgstr "" +msgstr "BitMasks İçe Aktar" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Source Texture(s):" -msgstr "" +msgstr "Kaynak Doku(lar):" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp #: tools/editor/io_plugins/editor_mesh_import_plugin.cpp @@ -2754,8 +2862,9 @@ msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" -msgstr "Hedef Dosya Yolu :" +msgstr "Amaçlanan Dizeç Yolu :" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp #: tools/editor/io_plugins/editor_font_import_plugin.cpp @@ -2768,672 +2877,684 @@ msgstr "Kabul" #: tools/editor/io_plugins/editor_bitmask_import_plugin.cpp msgid "Bit Mask" -msgstr "" +msgstr "Bit Örteci" #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "No source font file!" -msgstr "" +msgstr "Kaynak yazı türü dizeci yok!" #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "No target font resource!" -msgstr "" +msgstr "Amaçlanan yazı türü kaynağı yok!" #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "" "Invalid file extension.\n" "Please use .fnt." msgstr "" +"Geçersiz dizeç uzantısı.\n" +"Lütfen .fnt uzantısını kullanın." #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "Can't load/process source font." -msgstr "" +msgstr "Kaynak yazı tipi yüklenemiyor / işlenemiyor." #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "Couldn't save font." -msgstr "" +msgstr "Yazı türü kaydedilemedi." #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "Source Font:" -msgstr "" +msgstr "Yazı Türü Kaynağı:" #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "Source Font Size:" -msgstr "" +msgstr "Kaynak Yazı Türü Boyutu:" #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "Dest Resource:" -msgstr "" +msgstr "Varış Kaynağı:" #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "The quick brown fox jumps over the lazy dog." -msgstr "" +msgstr "Hızlı kahverengi tilki üşengeç köpeğin üstünden atlar." #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "Test:" -msgstr "" +msgstr "Deneme:" #: tools/editor/io_plugins/editor_font_import_plugin.cpp #: tools/editor/io_plugins/editor_mesh_import_plugin.cpp #: tools/editor/io_plugins/editor_sample_import_plugin.cpp #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Options:" -msgstr "" +msgstr "Seçenekler:" #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "Font Import" -msgstr "" +msgstr "Yazı Türü İçe Aktar" #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "" "This file is already a Godot font file, please supply a BMFont type file " "instead." msgstr "" +"Bu dizeç zaten bir Godot yazı türü dizecidir , lütfen bunun yerine bir " +"BMFont türü dizeci sağlayın." #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "Failed opening as BMFont file." -msgstr "" +msgstr "BMFont dizeci olarak açma başarısız oldu." #: tools/editor/io_plugins/editor_font_import_plugin.cpp msgid "Invalid font custom source." -msgstr "" +msgstr "Geçersiz yazı türü özel kaynağı." #: tools/editor/io_plugins/editor_font_import_plugin.cpp #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Font" -msgstr "" +msgstr "Yazı Tipi" #: tools/editor/io_plugins/editor_mesh_import_plugin.cpp msgid "No meshes to import!" -msgstr "" +msgstr "İçe aktarılacak örüntü yok!" #: tools/editor/io_plugins/editor_mesh_import_plugin.cpp msgid "Single Mesh Import" -msgstr "" +msgstr "Tekil Örüntü İçe Aktar" #: tools/editor/io_plugins/editor_mesh_import_plugin.cpp msgid "Source Mesh(es):" -msgstr "" +msgstr "Kaynak Örüntü(leri):" #: tools/editor/io_plugins/editor_mesh_import_plugin.cpp #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Mesh" -msgstr "" +msgstr "Örüntü" #: tools/editor/io_plugins/editor_mesh_import_plugin.cpp msgid "Surface %d" -msgstr "" +msgstr "Yüzey %d" #: tools/editor/io_plugins/editor_sample_import_plugin.cpp msgid "No samples to import!" -msgstr "" +msgstr "Alınacak örnek yok!" #: tools/editor/io_plugins/editor_sample_import_plugin.cpp msgid "Import Audio Samples" -msgstr "" +msgstr "Ses Örneklerini İçe Aktar" #: tools/editor/io_plugins/editor_sample_import_plugin.cpp msgid "Source Sample(s):" -msgstr "" +msgstr "Kaynak Örnek(leri):" #: tools/editor/io_plugins/editor_sample_import_plugin.cpp msgid "Audio Sample" -msgstr "" +msgstr "Ses Örneği" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "New Clip" -msgstr "" +msgstr "Yeni Parça" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Animation Options" -msgstr "" +msgstr "Canlandırma Seçenekleri" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Flags" -msgstr "" +msgstr "Bayraklar" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Bake FPS:" -msgstr "" +msgstr "FPS'i Pişir:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Optimizer" -msgstr "" +msgstr "İyileştirici" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Max Linear Error" -msgstr "" +msgstr "En üst Doğrusal Sorun" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Max Angular Error" -msgstr "" +msgstr "En üst Açısal Sorun" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Max Angle" -msgstr "" +msgstr "En üst Açı" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Clips" -msgstr "" +msgstr "Parçalar" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Start(s)" -msgstr "" +msgstr "Başlangıç(lar)" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "End(s)" -msgstr "" +msgstr "Son(lar)" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Loop" -msgstr "" +msgstr "Döngü" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Filters" -msgstr "" +msgstr "Süzgeçler" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Source path is empty." -msgstr "" +msgstr "Kaynak yol boş." #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Couldn't load post-import script." -msgstr "" +msgstr "İçe aktarma sonrası betik dizeci yüklenemedi." #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Invalid/broken script for post-import." -msgstr "" +msgstr "İçe aktarma sonrası için geçersiz/bozuk betik dizeci." #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Error importing scene." -msgstr "" +msgstr "İçe aktarırken sorun oluştu." #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Import 3D Scene" -msgstr "" +msgstr "3B Sahneyi İçe Aktar" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Source Scene:" -msgstr "" +msgstr "Kaynak Sahne:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Same as Target Scene" -msgstr "" +msgstr "Hedef Sahne ile Aynı" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Shared" -msgstr "" +msgstr "Paylaşılan" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Target Texture Folder:" -msgstr "" +msgstr "Amaçlanan Doku Dizini:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Post-Process Script:" -msgstr "" +msgstr "İşlem Sonrası Betik Dizeci:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Custom Root Node Type:" -msgstr "" +msgstr "Özel Kök Düğüm Türü:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Auto" -msgstr "" +msgstr "Kendiliğinden" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp +msgid "Root Node Name:" +msgstr "Kök Düğüm adı:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" -msgstr "" +msgstr "Aşağıdaki Dizeçler Eksik:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Import Anyway" -msgstr "" +msgstr "Yine de İçe Aktar" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Import & Open" -msgstr "" +msgstr "İçe Aktar & Aç" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Edited scene has not been saved, open imported scene anyway?" -msgstr "" +msgstr "Düzenlenen sahne kaydedilmedi, yine de içe aktarılan sahne açılsın mı?" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/plugins/cube_grid_theme_editor_plugin.cpp msgid "Import Scene" -msgstr "" +msgstr "Sahneyi İçe Aktar" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Importing Scene.." -msgstr "" +msgstr "Sahneyi İçe Aktarıyor..." #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Running Custom Script.." -msgstr "" +msgstr "Çalışan Özel Betik.." #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Couldn't load post-import script:" -msgstr "" +msgstr "İçe aktarma sonrası betik dizeci yüklenemedi:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Invalid/broken script for post-import (check console):" msgstr "" +"İçe aktarma işlemi sonrası için geçersiz/bozuk betik dizeci (konsolu " +"denetleyin):" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Error running post-import script:" -msgstr "" +msgstr "İçe aktarma sonrası betik dizeci çalıştırılırken sorun oluştu:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Import Image:" -msgstr "" +msgstr "Bedizi İçe Aktar:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Can't import a file over itself:" -msgstr "" +msgstr "Bir dizeç kendisi üzerine içe aktaramıyor:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Couldn't localize path: %s (already local)" -msgstr "" +msgstr "Yol yerelleştirilemedi: %s (zaten yerel)" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "Saving.." -msgstr "" +msgstr "Kaydediliyor..." #: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "3D Scene Animation" -msgstr "" +msgstr "3B Sahne Canlandırması" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Uncompressed" -msgstr "" +msgstr "Sıkıştırılmamış" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Compress Lossless (PNG)" -msgstr "" +msgstr "Kayıpsız Sıkıştırma (PNG)" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Compress Lossy (WebP)" -msgstr "" +msgstr "Kayıplı Sıkıştırma (WebP)" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Compress (VRAM)" -msgstr "" +msgstr "Sıkıştır (VRAM)" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Texture Format" -msgstr "" +msgstr "Doku Biçemi" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Texture Compression Quality (WebP):" -msgstr "" +msgstr "Doku Sıkıştırma Niteliği (WebP):" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Texture Options" -msgstr "" +msgstr "Doku Seçenekleri" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Please specify some files!" -msgstr "" +msgstr "Lütfen bazı dizeçleri belirtin!" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "At least one file needed for Atlas." -msgstr "" +msgstr "Atlas için en az bir dizeç gerekli." #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Error importing:" -msgstr "" +msgstr "İçe aktarırken sorun:" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Only one file is required for large texture." -msgstr "" +msgstr "Büyük doku için yalnızca bir dizeç gereklidir." #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Max Texture Size:" -msgstr "" +msgstr "En üst Doku Boyutu:" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Import Textures for Atlas (2D)" -msgstr "" +msgstr "Dokuları Atlas(2B) için içe aktar" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Cell Size:" -msgstr "" +msgstr "Odacık Boyutu:" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Large Texture" -msgstr "" +msgstr "Geniş Doku" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Import Large Textures (2D)" -msgstr "" +msgstr "Büyük Boyutlu(2D) Dokuları İçe Aktar" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Source Texture" -msgstr "" +msgstr "Kaynak Doku" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Base Atlas Texture" -msgstr "" +msgstr "Temel Atlas Doku" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Source Texture(s)" -msgstr "" +msgstr "Kaynak Doku(lar)" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Import Textures for 2D" -msgstr "" +msgstr "2B için Dokuları İçe Aktar" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Import Textures for 3D" -msgstr "" +msgstr "3B için Dokuları İçe Aktar" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Import Textures" -msgstr "" +msgstr "Dokuları İçe Aktar" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "2D Texture" -msgstr "" +msgstr "2B Doku" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "3D Texture" -msgstr "" +msgstr "3B Doku" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Atlas Texture" -msgstr "" +msgstr "Atlas Doku" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "" "NOTICE: Importing 2D textures is not mandatory. Just copy png/jpg files to " "the project." msgstr "" +"UYARI: 2B dokuların içe aktarılması zorunlu değildir. Png / jpg dizeçlerini " +"tasarıya tıpkılamanız yeterlidir." #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Crop empty space." -msgstr "" +msgstr "Boş alanı kırp." #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Texture" -msgstr "" +msgstr "Doku" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Import Large Texture" -msgstr "" +msgstr "Büyük Dokuyu İçe Aktar" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Load Source Image" -msgstr "" +msgstr "Kaynak Bedizi Yükle" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Slicing" -msgstr "" +msgstr "Dilimleme" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Inserting" -msgstr "" +msgstr "Girdileme" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Saving" -msgstr "" +msgstr "Kaydediyor" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Couldn't save large texture:" -msgstr "" +msgstr "Büyük doku kaydedilemedi:" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Build Atlas For:" -msgstr "" +msgstr "Atlası Şunun için Oluştur:" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Loading Image:" -msgstr "" +msgstr "Bediz Yükleniyor:" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Couldn't load image:" -msgstr "" +msgstr "Bediz yüklenemedi:" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Converting Images" -msgstr "" +msgstr "Bedizleri Dönüştürüyor" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Cropping Images" -msgstr "" +msgstr "Bedizleri Kırpıyor" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Blitting Images" -msgstr "" +msgstr "Bedizleri Blitle" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Couldn't save atlas image:" -msgstr "" +msgstr "Atlas bedizi kaydedilemedi:" #: tools/editor/io_plugins/editor_texture_import_plugin.cpp msgid "Couldn't save converted texture:" -msgstr "" +msgstr "Dönüştürülmüş doku kaydedilemedi:" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Invalid source!" -msgstr "" +msgstr "Geçersiz kaynak!" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Invalid translation source!" -msgstr "" +msgstr "Geçersiz çeviri kaynağı!" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Column" -msgstr "" +msgstr "Dikeç" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp #: tools/editor/script_create_dialog.cpp msgid "Language" -msgstr "" +msgstr "Dil" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "No items to import!" -msgstr "" +msgstr "Alınacak öğe yok!" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "No target path!" -msgstr "" +msgstr "Amaçlanan yol yok!" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Import Translations" -msgstr "" +msgstr "Çevirileri İçe Aktar" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Couldn't import!" -msgstr "" +msgstr "Alınamadı!" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Import Translation" -msgstr "" +msgstr "Çeviriyi İçe Aktar" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Source CSV:" -msgstr "" +msgstr "Kaynak CSV:" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Ignore First Row" -msgstr "" +msgstr "İlk Sırayı Yoksay" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Compress" -msgstr "" +msgstr "Sıkıştır" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Add to Project (engine.cfg)" -msgstr "" +msgstr "Tasarıya Ekle (engine.cfg)" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Import Languages:" -msgstr "" +msgstr "Dilleri İçe Aktar:" #: tools/editor/io_plugins/editor_translation_import_plugin.cpp msgid "Translation" -msgstr "" +msgstr "Çeviri" #: tools/editor/multi_node_edit.cpp msgid "MultiNode Set" -msgstr "" +msgstr "MultiNode Kur" #: tools/editor/node_dock.cpp msgid "Groups" -msgstr "" +msgstr "Öbekler" #: tools/editor/node_dock.cpp msgid "Select a Node to edit Signals and Groups." -msgstr "" +msgstr "İşaretleri ve Öbekleri düzenlemek için bir Düğüm seçin." #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Toggle Autoplay" -msgstr "" +msgstr "KendindenOynatmayı Aç/Kapat" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "New Animation Name:" -msgstr "" +msgstr "Yeni Canlandırma Adı:" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "New Anim" -msgstr "Yeni Animasyon" +msgstr "Yeni Canlandırma" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Change Animation Name:" -msgstr "Animasyonun adını değiştir:" +msgstr "Canlandırmanın Adını Değiştir:" #: tools/editor/plugins/animation_player_editor_plugin.cpp #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Remove Animation" -msgstr "Animasyonu Kaldır" +msgstr "Canlandırmayı Kaldır" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "ERROR: Invalid animation name!" -msgstr "HATA: Geçersiz animasyon adı!" +msgstr "SORUN: Geçersiz canlandırma adı!" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "ERROR: Animation name already exists!" -msgstr "HATA: Bu animasyonun adı zaten var!" +msgstr "SORUN: Bu canlandırma adı zaten var!" #: tools/editor/plugins/animation_player_editor_plugin.cpp #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Rename Animation" -msgstr "Animasyonu Yeniden İsimlendir" +msgstr "Canlandırmayı Yeniden Adlandır" #: tools/editor/plugins/animation_player_editor_plugin.cpp #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Add Animation" -msgstr "Animasyon Ekle" +msgstr "Canlandırma Ekle" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Blend Next Changed" -msgstr "" +msgstr "Sonraki Değişeni Karıştır" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Change Blend Time" -msgstr "" +msgstr "Karışım Süresini Değiştir" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Load Animation" -msgstr "Animasyon Yükle" +msgstr "Canlandırma Yükle" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Duplicate Animation" -msgstr "Animasyonu Yeniden Çıkar" +msgstr "Canlandırmayı İkile" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "ERROR: No animation to copy!" -msgstr "HATA: Kopyalamak için bir animasyon yok!" +msgstr "SORUN: Tıpkılamak için bir canlandırma yok!" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "ERROR: No animation resource on clipboard!" -msgstr "" +msgstr "SORUN: Bellemde canlandırma kaynağı yok!" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Pasted Animation" -msgstr "" +msgstr "Yapıştırılan Canlandırma" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Paste Animation" -msgstr "" +msgstr "Canlandırmayı Yapıştır" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "ERROR: No animation to edit!" -msgstr "HATA: Düzenlemek için bir animasyon yok!" +msgstr "SORUN: Düzenlemek için bir canlandırma yok!" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Play selected animation backwards from current pos. (A)" -msgstr "" +msgstr "Seçilen canlandırmayı geçerli konumdan geriye doğru oynat. (A)" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Play selected animation backwards from end. (Shift+A)" -msgstr "" +msgstr "Seçilen canlandırmayı geriye doğru oynat. (Shift + A)" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Stop animation playback. (S)" -msgstr "" +msgstr "Canlandırmayı oynatmayı durdur. (S)" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Play selected animation from start. (Shift+D)" -msgstr "" +msgstr "Seçilen canlandırmayı başlangıç anından oynat. (ÜstKrkt + D)" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Play selected animation from current pos. (D)" -msgstr "" +msgstr "Seçilen calandırmayı geçerli konumdan oynat. (D)" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Animation position (in seconds)." -msgstr "" +msgstr "Canlandırma konumu (saniye olarak)." #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Scale animation playback globally for the node." -msgstr "" +msgstr "Düğüm için canlandırma arka oynatmasını ölçeklendir." #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Create new animation in player." -msgstr "" +msgstr "Oynatıcıda yeni canlandırma oluşturun." #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Load animation from disk." -msgstr "" +msgstr "Canlandırmayı saklaktan yükle." #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Load an animation from disk." -msgstr "" +msgstr "Bir canlandırmayı saklaktan yükle." #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Save the current animation" -msgstr "" +msgstr "Geçerli canlandırmayı kaydet" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Save As" -msgstr "" +msgstr "Başkaca Kaydet" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Display list of animations in player." -msgstr "" +msgstr "Oyuncudaki canlandırmaların dizelgesini görüntüle." #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Autoplay on Load" -msgstr "" +msgstr "Yükleme sırasında KendindenOynat" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Edit Target Blend Times" -msgstr "" +msgstr "Amaçlanan Karışma Zamanlarını Düzenle" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Animation Tools" -msgstr "" +msgstr "Canlandırma Araçları" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Copy Animation" -msgstr "" +msgstr "Canlandırmayı Tıpkıla" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Create New Animation" -msgstr "" +msgstr "Yeni Canlandırma Oluştur" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Animation Name:" -msgstr "" +msgstr "Canlandırma Adı:" #: tools/editor/plugins/animation_player_editor_plugin.cpp #: tools/editor/plugins/resource_preloader_editor_plugin.cpp @@ -3441,307 +3562,307 @@ msgstr "" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp #: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Error!" -msgstr "" +msgstr "Sorun!" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Blend Times:" -msgstr "" +msgstr "Süreleri Karıştır:" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Next (Auto Queue):" -msgstr "" +msgstr "Sonraki (Kendiliğinden Kuyruğu):" #: tools/editor/plugins/animation_player_editor_plugin.cpp msgid "Cross-Animation Blend Times" -msgstr "" +msgstr "Çapraz Canlandırma Karışma Süreleri" #: tools/editor/plugins/animation_player_editor_plugin.cpp #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Animation" -msgstr "" +msgstr "Canlandırma" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "New name:" -msgstr "" +msgstr "Yeni ad:" #: tools/editor/plugins/animation_tree_editor_plugin.cpp #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Scale:" -msgstr "" +msgstr "Ölçekle:" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Fade In (s):" -msgstr "" +msgstr "Açılma (sn):" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Fade Out (s):" -msgstr "" +msgstr "Karartma (sn):" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Blend" -msgstr "" +msgstr "Karıştır" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Mix" -msgstr "" +msgstr "Çırp" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Auto Restart:" -msgstr "" +msgstr "Kendiliğinden Yeniden Başlat:" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Restart (s):" -msgstr "" +msgstr "Yeniden Başlat (sn):" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Random Restart (s):" -msgstr "" +msgstr "Rastgele Yeniden Başlama (sn):" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Start!" -msgstr "" +msgstr "Başlat!" #: tools/editor/plugins/animation_tree_editor_plugin.cpp #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Amount:" -msgstr "" +msgstr "Değer:" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Blend:" -msgstr "" +msgstr "Karışma:" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Blend 0:" -msgstr "" +msgstr "Karışma 0:" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Blend 1:" -msgstr "" +msgstr "Karışma 1:" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "X-Fade Time (s):" -msgstr "" +msgstr "X-Sönülme Süresi (sn):" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Current:" -msgstr "" +msgstr "Geçerli:" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Add Input" -msgstr "" +msgstr "Giriş Ekle" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Clear Auto-Advance" -msgstr "" +msgstr "Kendiliğinden İlerlemeyi Temizle" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Set Auto-Advance" -msgstr "" +msgstr "Kendiliğinden İlerlemeyi Ayarla" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Delete Input" -msgstr "" +msgstr "Girişi Sil" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Rename" -msgstr "" +msgstr "Yeniden Adlandır" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Animation tree is valid." -msgstr "" +msgstr "Canlandırma ağacı geçerlidir." #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Animation tree is invalid." -msgstr "" +msgstr "Canlandırma ağacı geçersizdir." #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Animation Node" -msgstr "" +msgstr "Canlandırma Düğümü" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "OneShot Node" -msgstr "" +msgstr "OneShot Düğümü" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Mix Node" -msgstr "" +msgstr "Düğümü Çırp" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Blend2 Node" -msgstr "" +msgstr "Karıştır2 Düğümü" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Blend3 Node" -msgstr "" +msgstr "Karıştır3 Düğümü" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Blend4 Node" -msgstr "" +msgstr "Karıştır4 Düğümü" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "TimeScale Node" -msgstr "" +msgstr "TimeScale Düğümü" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "TimeSeek Node" -msgstr "" +msgstr "TimeSeek Düğümü" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Transition Node" -msgstr "" +msgstr "Geçiş Düğümü" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Import Animations.." -msgstr "" +msgstr "Canlandırmaları İçe Aktar.." #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Edit Node Filters" -msgstr "" +msgstr "Düğüm Süzgeçlerini Düzenle" #: tools/editor/plugins/animation_tree_editor_plugin.cpp msgid "Filters.." -msgstr "" +msgstr "Süzgeçler..." #: tools/editor/plugins/baked_light_baker.cpp msgid "Parsing %d Triangles:" -msgstr "" +msgstr "%d Üçgenlerini Ayrıştırma:" #: tools/editor/plugins/baked_light_baker.cpp msgid "Triangle #" -msgstr "" +msgstr "Üçgen #" #: tools/editor/plugins/baked_light_baker.cpp msgid "Light Baker Setup:" -msgstr "" +msgstr "Işık Pişirici Kurulumu:" #: tools/editor/plugins/baked_light_baker.cpp msgid "Parsing Geometry" -msgstr "" +msgstr "Uzambilgisini Ayrıştırıyor" #: tools/editor/plugins/baked_light_baker.cpp msgid "Fixing Lights" -msgstr "" +msgstr "Işıkları Sabitliyor" #: tools/editor/plugins/baked_light_baker.cpp msgid "Making BVH" -msgstr "" +msgstr "BVH Yapıyor" #: tools/editor/plugins/baked_light_baker.cpp msgid "Creating Light Octree" -msgstr "" +msgstr "Işık Sekağacı Oluşturuyor" #: tools/editor/plugins/baked_light_baker.cpp msgid "Creating Octree Texture" -msgstr "" +msgstr "Sekağaç Dokusu Oluşturuyor" #: tools/editor/plugins/baked_light_baker.cpp msgid "Transfer to Lightmaps:" -msgstr "" +msgstr "Işık Haritalarına Aktar:" #: tools/editor/plugins/baked_light_baker.cpp msgid "Allocating Texture #" -msgstr "" +msgstr "Doku Paylaşımı #" #: tools/editor/plugins/baked_light_baker.cpp msgid "Baking Triangle #" -msgstr "" +msgstr "Pişirme Üçgeni #" #: tools/editor/plugins/baked_light_baker.cpp msgid "Post-Processing Texture #" -msgstr "" +msgstr "İşleme-Sonrası Dokusu #" #: tools/editor/plugins/baked_light_editor_plugin.cpp msgid "Bake!" -msgstr "" +msgstr "Pişir!" #: tools/editor/plugins/baked_light_editor_plugin.cpp msgid "Reset the lightmap octree baking process (start over)." -msgstr "" +msgstr "Işık haritası sekağacı pişirme işlemini sıfırlayın (baştan başlayın)." #: tools/editor/plugins/camera_editor_plugin.cpp #: tools/editor/plugins/sample_library_editor_plugin.cpp msgid "Preview" -msgstr "" +msgstr "Önizleme" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Configure Snap" -msgstr "" +msgstr "Yapışmayı Yapılandır" #: tools/editor/plugins/canvas_item_editor_plugin.cpp #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Grid Offset:" -msgstr "" +msgstr "Izgarayı Kaydır:" #: tools/editor/plugins/canvas_item_editor_plugin.cpp #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Grid Step:" -msgstr "" +msgstr "Izgara Adımı:" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Rotation Offset:" -msgstr "" +msgstr "Dönme Kayması:" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Rotation Step:" -msgstr "" +msgstr "Dönme Adımı:" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Move Pivot" -msgstr "" +msgstr "Ekseni Taşı" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Move Action" -msgstr "" +msgstr "Eylemi Taşı" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Edit IK Chain" -msgstr "" +msgstr "IK Zincirini Düzenle" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Edit CanvasItem" -msgstr "" +msgstr "CanvasItem Düzenle" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Change Anchors" -msgstr "" +msgstr "Çapaları Değiştir" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Zoom (%):" -msgstr "" +msgstr "Yaklaş (%):" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Paste Pose" -msgstr "" +msgstr "Duruşu Yapıştır" #: tools/editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Select Mode" -msgstr "Bir Düğüm Seç" +msgstr "Biçim Seç" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Drag: Rotate" -msgstr "" +msgstr "Sürükle: Döndürür" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Alt+Drag: Move" -msgstr "" +msgstr "Alt+Sürükle: Taşır" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Press 'v' to Change Pivot, 'Shift+v' to Drag Pivot (while moving)." msgstr "" +"Ekseni Değiştirmek için 'v' dokunacına basın, Ekseni Sürüklemek için " +"(sürüklerken) 'Shift + v' dokunaçlarına basın." #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Alt+RMB: Depth list selection" -msgstr "" +msgstr "Alt + RMB: Derin dizelge seçimi" #: tools/editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Move Mode" -msgstr "Şuraya Taşı.." +msgstr "Biçimi Taşı" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Rotate Mode" -msgstr "" +msgstr "Döndürme Biçimi" #: tools/editor/plugins/canvas_item_editor_plugin.cpp #: tools/editor/plugins/spatial_editor_plugin.cpp @@ -3749,61 +3870,63 @@ msgid "" "Show a list of all objects at the position clicked\n" "(same as Alt+RMB in select mode)." msgstr "" +"Tıklanan konumdaki tüm nesnelerin bir dizelgesini gösterin\n" +"(Seçme biçiminde Alt + RMB ile özdeş)." #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Click to change object's rotation pivot." -msgstr "" +msgstr "Nesnenin dönüş eksenini değiştirmek için tıklayın." #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Pan Mode" -msgstr "" +msgstr "Kaydırma Biçimi" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Lock the selected object in place (can't be moved)." -msgstr "" +msgstr "Seçilen nesneyi yerine kilitleyin (taşınamaz)." #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Unlock the selected object (can be moved)." -msgstr "" +msgstr "Seçilen nesnenin kilidini açın (taşınabilir)." #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Makes sure the object's children are not selectable." -msgstr "" +msgstr "Nesnenin çocuğunun seçilemez olduğundan kuşkusuz olur." #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Restores the object's children's ability to be selected." -msgstr "" +msgstr "Nesnenin çocuğunun seçilebilme yeteneğini geri kazandırır." #: tools/editor/plugins/canvas_item_editor_plugin.cpp #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Use Snap" -msgstr "" +msgstr "Yapışma Kullan" #: tools/editor/plugins/canvas_item_editor_plugin.cpp #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Show Grid" -msgstr "" +msgstr "Izgarayı Göster" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Rotation Snap" -msgstr "" +msgstr "Döndürme Yapışması Kullan" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Snap Relative" -msgstr "" +msgstr "Göreceli Yapış" #: tools/editor/plugins/canvas_item_editor_plugin.cpp #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Configure Snap.." -msgstr "" +msgstr "Yapışmayı Yapılandır.." #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Use Pixel Snap" -msgstr "" +msgstr "Nokta Yapışması Kullan" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Expand to Parent" -msgstr "" +msgstr "Ataya genişletin" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Skeleton.." @@ -3811,83 +3934,128 @@ msgstr "İskelet.." #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Make Bones" -msgstr "" +msgstr "Kemik Yap" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Clear Bones" -msgstr "" +msgstr "Kemikleri Temizle" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Show Bones" -msgstr "" +msgstr "Kemikleri Göster" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Make IK Chain" -msgstr "" +msgstr "IK Zinciri Yap" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Clear IK Chain" -msgstr "" +msgstr "IK Zincirini Temizle" #: tools/editor/plugins/canvas_item_editor_plugin.cpp #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "View" -msgstr "" +msgstr "Görüş" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Zoom Reset" -msgstr "Yakınlaştırmayı Sıfırla" +msgstr "Yakınlaşmayı Sıfırla" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Zoom Set.." -msgstr "Yakınlaştırmayı Ayarla.." +msgstr "Yakınlaşmayı Ayarla.." #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Center Selection" -msgstr "" +msgstr "İçre Seçimi" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Frame Selection" -msgstr "" +msgstr "Kafes Seçimi" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Anchor" -msgstr "" +msgstr "Çapa" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Insert Keys" -msgstr "" +msgstr "Açarlar Gir" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Insert Key" -msgstr "" +msgstr "Açar Gir" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Insert Key (Existing Tracks)" -msgstr "" +msgstr "Açar Gir (Var Olan İzler)" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Copy Pose" -msgstr "" +msgstr "Duruşu Tıpkıla" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Clear Pose" -msgstr "" +msgstr "Duruşu Temizle" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Set a Value" -msgstr "Değeri Ata" +msgstr "Bir Değer Ata" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Snap (Pixels):" +msgstr "Yapış (Noktalara):" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "Ekle %s" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "Ekliyor %s.." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "Düğüm Oluştur" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "%s sahne örnekleme sorunu" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "Tamam :(" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "Çocuğun örnek alacağı bir ata yok." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "Bu işlem, seçilmiş tek bir düğüm gerektirir." + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Change default type" +msgstr "Önyüklü tipi değiştir" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" msgstr "" +"Sürükle & bırak + Shift: Kardeş olarak düğüm ekle\n" +"Sürükle & bırak + Alt: Düğüm türünü değiştir" #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Create Poly" -msgstr "" +msgstr "Çoklu Oluşturun" #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/collision_polygon_editor_plugin.cpp @@ -3896,7 +4064,7 @@ msgstr "" #: tools/editor/plugins/path_2d_editor_plugin.cpp #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Edit Poly" -msgstr "" +msgstr "Çokluyu Düzenleyin" #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/collision_polygon_editor_plugin.cpp @@ -3905,2561 +4073,2595 @@ msgstr "" #: tools/editor/plugins/path_2d_editor_plugin.cpp #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Edit Poly (Remove Point)" -msgstr "" +msgstr "Çokluyu Düzenleyin (Noktayı Silin)" #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp msgid "Create a new polygon from scratch." -msgstr "" +msgstr "Sıfırdan yeni bir çokgen oluşturun." #: tools/editor/plugins/collision_polygon_editor_plugin.cpp msgid "Create Poly3D" -msgstr "" +msgstr "Çoklu3B Oluştur" #: tools/editor/plugins/collision_shape_2d_editor_plugin.cpp msgid "Set Handle" -msgstr "" +msgstr "Tutamacı Ayarla" #: tools/editor/plugins/color_ramp_editor_plugin.cpp msgid "Add/Remove Color Ramp Point" -msgstr "" +msgstr "Renk Yokuşu Noktası Ekle / Kaldır" #: tools/editor/plugins/color_ramp_editor_plugin.cpp #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Modify Color Ramp" -msgstr "" +msgstr "Renk Yokuşunu Değiştir" #: tools/editor/plugins/cube_grid_theme_editor_plugin.cpp msgid "Creating Mesh Library" -msgstr "" +msgstr "Örüntü Betikevi Oluştur" #: tools/editor/plugins/cube_grid_theme_editor_plugin.cpp msgid "Thumbnail.." -msgstr "" +msgstr "Küçük Bediz.." #: tools/editor/plugins/cube_grid_theme_editor_plugin.cpp msgid "Remove item %d?" -msgstr "" +msgstr "%d öğe kaldırılsın mı?" #: tools/editor/plugins/cube_grid_theme_editor_plugin.cpp #: tools/editor/plugins/theme_editor_plugin.cpp #: tools/editor/plugins/tile_set_editor_plugin.cpp msgid "Add Item" -msgstr "" +msgstr "Öğe Ekle" #: tools/editor/plugins/cube_grid_theme_editor_plugin.cpp msgid "Remove Selected Item" -msgstr "" +msgstr "Seçilen Öğeyi Kaldır" #: tools/editor/plugins/cube_grid_theme_editor_plugin.cpp msgid "Import from Scene" -msgstr "" +msgstr "Sahneden İçe Aktar" #: tools/editor/plugins/cube_grid_theme_editor_plugin.cpp msgid "Update from Scene" -msgstr "" +msgstr "Sahneden Güncelle" #: tools/editor/plugins/item_list_editor_plugin.cpp msgid "Item %d" -msgstr "" +msgstr "Öğe%d" #: tools/editor/plugins/item_list_editor_plugin.cpp msgid "Items" -msgstr "" +msgstr "Öğeler" #: tools/editor/plugins/item_list_editor_plugin.cpp msgid "Item List Editor" -msgstr "" +msgstr "Öğe Dizelgesi Düzenleyicisi" #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp msgid "Create Occluder Polygon" -msgstr "" +msgstr "Engelleyici Çokgeni Oluştur" #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp msgid "Edit existing polygon:" -msgstr "" +msgstr "Var olan çokgeni düzenleyin:" #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp msgid "LMB: Move Point." -msgstr "" +msgstr "LMB: Taşıma Noktası." #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp msgid "Ctrl+LMB: Split Segment." -msgstr "" +msgstr "Ctrl + LMB: Parçayı Böl." #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp msgid "RMB: Erase Point." -msgstr "" +msgstr "RMB: Noktayı Sil." #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Mesh is empty!" -msgstr "" +msgstr "Örüntü boş!" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Static Trimesh Body" -msgstr "" +msgstr "Durağan Üçlü Örüntü Oluştur" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Static Convex Body" -msgstr "" +msgstr "Durağan Dışbükey Gövde Oluştur" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "This doesn't work on scene root!" -msgstr "" +msgstr "Bu, sahne kökünde çalışmaz!" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Trimesh Shape" -msgstr "" +msgstr "Üçlü Örüntü Yüzeyi Oluştur" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Convex Shape" -msgstr "" +msgstr "Dışbükey Şekil Oluştur" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Navigation Mesh" -msgstr "" +msgstr "Yönlendirici Örüntüsü Oluştur" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "MeshInstance lacks a Mesh!" -msgstr "" +msgstr "MeshInstance herhangi bir Örüntüden yoksun!" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Mesh has not surface to create outlines from!" -msgstr "" +msgstr "Örüntü anahat oluşturmak için bir yüzeye sahip değil!" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Could not create outline!" -msgstr "" +msgstr "Anahat oluşturulamadı!" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Outline" -msgstr "" +msgstr "Anahat Oluştur" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Trimesh Static Body" -msgstr "" +msgstr "Üçlü Örüntü Durağan Gövdesi Oluştur" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Convex Static Body" -msgstr "" +msgstr "Dışbükey Durağan Gövde Oluştur" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Trimesh Collision Sibling" -msgstr "" +msgstr "Üçlü Örüntü Çarpışma Kardeşi Oluştur" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Convex Collision Sibling" -msgstr "" +msgstr "Dışbükey Çarpışma Kardeşi Oluştur" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Outline Mesh.." -msgstr "" +msgstr "Anahat Örüntüsü Oluştur.." #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Create Outline Mesh" -msgstr "" +msgstr "Anahat Örüntüsü Oluştur" #: tools/editor/plugins/mesh_instance_editor_plugin.cpp msgid "Outline Size:" -msgstr "" +msgstr "Anahat Ölçüsü:" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "No mesh source specified (and no MultiMesh set in node)." -msgstr "" +msgstr "Örüntü kaynağı belirtilmedi (düğümde MultiMesh yok)." #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "No mesh source specified (and MultiMesh contains no Mesh)." -msgstr "" +msgstr "Hiçbir örüntü kaynağı belirtilmedi (ve MultiMesh, Örüntü içermiyor)." #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Mesh source is invalid (invalid path)." -msgstr "" +msgstr "Örüntü kaynağı geçersiz (geçersiz yol)." #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Mesh source is invalid (not a MeshInstance)." -msgstr "" +msgstr "Örüntü kaynağı geçersiz (bir MeshInstance değil)." #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Mesh source is invalid (contains no Mesh resource)." -msgstr "" +msgstr "Örüntü kaynağı geçersiz (Örüntü kaynağı içermiyor)." #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "No surface source specified." -msgstr "" +msgstr "Yüzey kaynağı belirtilmedi." #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Surface source is invalid (invalid path)." -msgstr "" +msgstr "Yüzey kaynağı geçersiz (geçersiz yol)." #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Surface source is invalid (no geometry)." -msgstr "" +msgstr "Yüzey kaynağı geçersiz (uzambilgisi yok)." #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Surface source is invalid (no faces)." -msgstr "" +msgstr "Yüzey kaynağı geçersiz (yüzler yok)." #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Parent has no solid faces to populate." -msgstr "" +msgstr "Atanın doldurmak için eksiksiz yüzleri yok." #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Couldn't map area." -msgstr "" +msgstr "Alan eşleştirilemedi." #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Select a Source Mesh:" -msgstr "" +msgstr "Bir Kaynak Örüntü Seçin:" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Select a Target Surface:" -msgstr "" +msgstr "Bir Amaçlanan Yüzeyi Seçin:" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Populate Surface" -msgstr "" +msgstr "Yüzeyi Doldur" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Populate MultiMesh" -msgstr "" +msgstr "MultiMesh'i Doldur" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Target Surface:" -msgstr "" +msgstr "Amaçlanan Yüzey:" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Source Mesh:" -msgstr "" +msgstr "Kaynak Örüntü:" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "X-Axis" -msgstr "" +msgstr "X-Ekseni" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Y-Axis" -msgstr "" +msgstr "Y-Ekseni" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Z-Axis" -msgstr "" +msgstr "Z-Ekseni" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Mesh Up Axis:" -msgstr "" +msgstr "Örüntü Üst Ekseni:" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Random Rotation:" -msgstr "" +msgstr "Rastgele Döndürme:" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Random Tilt:" -msgstr "" +msgstr "Rastgele Eğilme:" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Random Scale:" -msgstr "" +msgstr "Rastgele Ölçek:" #: tools/editor/plugins/multimesh_editor_plugin.cpp msgid "Populate" -msgstr "" +msgstr "Doldur" #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp msgid "Create Navigation Polygon" -msgstr "" +msgstr "Yönlendirici Çokgeni Oluştur" #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp msgid "Remove Poly And Point" -msgstr "" +msgstr "Çokluyu ve Noktayı Kaldır" #: tools/editor/plugins/particles_2d_editor_plugin.cpp msgid "Error loading image:" -msgstr "" +msgstr "Bediz yüklenirken sorun oluştu:" #: tools/editor/plugins/particles_2d_editor_plugin.cpp msgid "No pixels with transparency > 128 in image.." -msgstr "" +msgstr "Saydamlığı olan nokta yok > 128 bedizde.." #: tools/editor/plugins/particles_2d_editor_plugin.cpp msgid "Set Emission Mask" -msgstr "" +msgstr "Yayma Örtecini Ayarla" #: tools/editor/plugins/particles_2d_editor_plugin.cpp msgid "Clear Emission Mask" -msgstr "" +msgstr "Yayma Örtecini Temizle" #: tools/editor/plugins/particles_2d_editor_plugin.cpp msgid "Load Emission Mask" -msgstr "" +msgstr "Yayma Örtecini Yükle" #: tools/editor/plugins/particles_2d_editor_plugin.cpp msgid "Generated Point Count:" -msgstr "" +msgstr "Üretilen Nokta Say:" #: tools/editor/plugins/particles_editor_plugin.cpp msgid "Node does not contain geometry." -msgstr "" +msgstr "Düğüm uzambilgisi içermiyor." #: tools/editor/plugins/particles_editor_plugin.cpp msgid "Node does not contain geometry (faces)." -msgstr "" +msgstr "Düğüm uzambilgisi (yüzler) içermiyor." #: tools/editor/plugins/particles_editor_plugin.cpp msgid "Faces contain no area!" -msgstr "" +msgstr "Yüzler alan içermez!" #: tools/editor/plugins/particles_editor_plugin.cpp msgid "No faces!" -msgstr "" +msgstr "Yüzler yok!" #: tools/editor/plugins/particles_editor_plugin.cpp msgid "Generate AABB" -msgstr "" +msgstr "AABB Üret" #: tools/editor/plugins/particles_editor_plugin.cpp msgid "Create Emitter From Mesh" -msgstr "" +msgstr "Örüntüden Yayıcı Oluştur" #: tools/editor/plugins/particles_editor_plugin.cpp msgid "Create Emitter From Node" -msgstr "" +msgstr "Düğümden Yayıcı Oluştur" #: tools/editor/plugins/particles_editor_plugin.cpp msgid "Clear Emitter" -msgstr "" +msgstr "Yayıcıyı Temizle" #: tools/editor/plugins/particles_editor_plugin.cpp msgid "Create Emitter" -msgstr "" +msgstr "Yayıcı Oluştur" #: tools/editor/plugins/particles_editor_plugin.cpp msgid "Emission Positions:" -msgstr "" +msgstr "Yayma Konumları:" #: tools/editor/plugins/particles_editor_plugin.cpp msgid "Emission Fill:" -msgstr "" +msgstr "Yayma Dolumu:" #: tools/editor/plugins/particles_editor_plugin.cpp msgid "Surface" -msgstr "" +msgstr "Yüzey" #: tools/editor/plugins/particles_editor_plugin.cpp msgid "Volume" -msgstr "" +msgstr "Oylum" #: tools/editor/plugins/path_2d_editor_plugin.cpp msgid "Remove Point from Curve" -msgstr "" +msgstr "Noktayı Eğriden Kaldır" #: tools/editor/plugins/path_2d_editor_plugin.cpp #: tools/editor/plugins/path_editor_plugin.cpp msgid "Add Point to Curve" -msgstr "" +msgstr "Noktayı Eğriye Ekle" #: tools/editor/plugins/path_2d_editor_plugin.cpp msgid "Move Point in Curve" -msgstr "" +msgstr "Noktayı Eğriye Taşı" #: tools/editor/plugins/path_2d_editor_plugin.cpp msgid "Move In-Control in Curve" -msgstr "" +msgstr "Eğriye Denetimli Taşı" #: tools/editor/plugins/path_2d_editor_plugin.cpp msgid "Move Out-Control in Curve" -msgstr "" +msgstr "Eğriye Denetimsiz Taşı" #: tools/editor/plugins/path_2d_editor_plugin.cpp #: tools/editor/plugins/path_editor_plugin.cpp msgid "Select Points" -msgstr "" +msgstr "Noktaları Seç" #: tools/editor/plugins/path_2d_editor_plugin.cpp #: tools/editor/plugins/path_editor_plugin.cpp msgid "Shift+Drag: Select Control Points" -msgstr "" +msgstr "Shift + Sürükle: Denetim Noktalarını Seç" #: tools/editor/plugins/path_2d_editor_plugin.cpp #: tools/editor/plugins/path_editor_plugin.cpp msgid "Click: Add Point" -msgstr "" +msgstr "Tıkla: Nokta Ekle" #: tools/editor/plugins/path_2d_editor_plugin.cpp #: tools/editor/plugins/path_editor_plugin.cpp msgid "Right Click: Delete Point" -msgstr "" +msgstr "Sağ tıkla: Nokta Sil" #: tools/editor/plugins/path_2d_editor_plugin.cpp msgid "Select Control Points (Shift+Drag)" -msgstr "" +msgstr "Denetim Noktalarını Seç (Shift + Sürükle)" #: tools/editor/plugins/path_2d_editor_plugin.cpp #: tools/editor/plugins/path_editor_plugin.cpp msgid "Add Point (in empty space)" -msgstr "" +msgstr "Nokta Ekle (boşlukta)" #: tools/editor/plugins/path_2d_editor_plugin.cpp #: tools/editor/plugins/path_editor_plugin.cpp msgid "Split Segment (in curve)" -msgstr "" +msgstr "Parçayı Ayır (eğriye göre)" #: tools/editor/plugins/path_2d_editor_plugin.cpp #: tools/editor/plugins/path_editor_plugin.cpp msgid "Delete Point" -msgstr "" +msgstr "Noktayı Sil" #: tools/editor/plugins/path_2d_editor_plugin.cpp #: tools/editor/plugins/path_editor_plugin.cpp msgid "Close Curve" -msgstr "" +msgstr "Eğriyi Kapat" #: tools/editor/plugins/path_editor_plugin.cpp msgid "Curve Point #" -msgstr "" +msgstr "Eğrisel Nokta #" #: tools/editor/plugins/path_editor_plugin.cpp msgid "Set Curve Point Pos" -msgstr "" +msgstr "Eğri Noktası Konumu Ayarla" #: tools/editor/plugins/path_editor_plugin.cpp msgid "Set Curve In Pos" -msgstr "" +msgstr "Eğriyi Konumda Ayarla" #: tools/editor/plugins/path_editor_plugin.cpp msgid "Set Curve Out Pos" -msgstr "" +msgstr "Eğri Çıkış Konumunu Ayarla" #: tools/editor/plugins/path_editor_plugin.cpp msgid "Split Path" -msgstr "" +msgstr "Yolu Ayır" #: tools/editor/plugins/path_editor_plugin.cpp msgid "Remove Path Point" -msgstr "" +msgstr "Yol Noktasını Kaldır" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Create UV Map" -msgstr "" +msgstr "UV Haritası Oluştur" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Transform UV Map" -msgstr "" +msgstr "UV Haritasını Dönüştür" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Polygon 2D UV Editor" -msgstr "" +msgstr "Çokgen 2B UV Düzenleyicisi" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Move Point" -msgstr "" +msgstr "Noktayı Taşı" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Ctrl: Rotate" -msgstr "" +msgstr "Ctrl: Döndür" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Shift: Move All" -msgstr "" +msgstr "ÜstKrkt: Tümünü Taşı" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Shift+Ctrl: Scale" -msgstr "" +msgstr "ÜstKrkt+Ctrl: Ölçek" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Move Polygon" -msgstr "" +msgstr "Çokgeni Taşı" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Rotate Polygon" -msgstr "" +msgstr "Çokgeni Döndür" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Scale Polygon" -msgstr "" +msgstr "Çokgeni Ölçekle" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Polygon->UV" -msgstr "" +msgstr "Çokgen->UV" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "UV->Polygon" -msgstr "" +msgstr "UV->Çokgen" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Clear UV" -msgstr "" +msgstr "UV yi Temizle" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Snap" -msgstr "" +msgstr "Yapış" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Enable Snap" -msgstr "" +msgstr "Yapışmayı Enkinleştir" #: tools/editor/plugins/polygon_2d_editor_plugin.cpp msgid "Grid" -msgstr "" +msgstr "Izgara" #: tools/editor/plugins/resource_preloader_editor_plugin.cpp msgid "ERROR: Couldn't load resource!" -msgstr "" +msgstr "SORUN: Kaynak yüklenemedi!" #: tools/editor/plugins/resource_preloader_editor_plugin.cpp msgid "Add Resource" -msgstr "" +msgstr "Kaynak Ekle" #: tools/editor/plugins/resource_preloader_editor_plugin.cpp msgid "Rename Resource" -msgstr "" +msgstr "Kaynağı Yeniden Adlandır" #: tools/editor/plugins/resource_preloader_editor_plugin.cpp #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Delete Resource" -msgstr "" +msgstr "Kaynağı Sil" #: tools/editor/plugins/resource_preloader_editor_plugin.cpp msgid "Resource clipboard is empty!" -msgstr "" +msgstr "Kaynak bellemi boş!" #: tools/editor/plugins/resource_preloader_editor_plugin.cpp #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Load Resource" -msgstr "" +msgstr "Kaynak Yükle" #: tools/editor/plugins/rich_text_editor_plugin.cpp msgid "Parse BBCode" -msgstr "" +msgstr "BBCode'u Ayrıştır" #: tools/editor/plugins/sample_editor_plugin.cpp msgid "Length:" -msgstr "" +msgstr "Uzunluk:" #: tools/editor/plugins/sample_library_editor_plugin.cpp msgid "Open Sample File(s)" -msgstr "" +msgstr "Örnek Dizeçleri Aç" #: tools/editor/plugins/sample_library_editor_plugin.cpp msgid "ERROR: Couldn't load sample!" -msgstr "" +msgstr "SORUN: Örnek yüklenemedi!" #: tools/editor/plugins/sample_library_editor_plugin.cpp msgid "Add Sample" -msgstr "" +msgstr "Örnek Ekle" #: tools/editor/plugins/sample_library_editor_plugin.cpp msgid "Rename Sample" -msgstr "" +msgstr "Örneği Yeniden Addlandır" #: tools/editor/plugins/sample_library_editor_plugin.cpp msgid "Delete Sample" -msgstr "" +msgstr "Örneği Sil" #: tools/editor/plugins/sample_library_editor_plugin.cpp msgid "16 Bits" -msgstr "" +msgstr "16 bit" #: tools/editor/plugins/sample_library_editor_plugin.cpp msgid "8 Bits" -msgstr "" +msgstr "8 Bit" #: tools/editor/plugins/sample_library_editor_plugin.cpp msgid "Stereo" -msgstr "" +msgstr "Çiftli" #: tools/editor/plugins/sample_library_editor_plugin.cpp msgid "Mono" -msgstr "" +msgstr "Tekli" #: tools/editor/plugins/sample_library_editor_plugin.cpp #: tools/editor/script_editor_debugger.cpp msgid "Format" -msgstr "" +msgstr "Biçem" #: tools/editor/plugins/sample_library_editor_plugin.cpp msgid "Pitch" -msgstr "" +msgstr "Perde" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Error while saving theme" -msgstr "" +msgstr "Kalıp kaydedilirken sorun oluştu" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Error saving" -msgstr "" +msgstr "Kaydetme sorunu" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Error importing theme" -msgstr "" +msgstr "Kalıp içe aktarılırken sorun oluştu" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Error importing" -msgstr "" +msgstr "İçe aktarma sorunu" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Import Theme" -msgstr "" +msgstr "Kalıbı İçe Aktar" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Save Theme As.." -msgstr "" +msgstr "Kalıbı Başkaca Kaydet.." #: tools/editor/plugins/script_editor_plugin.cpp msgid "Next script" -msgstr "" +msgstr "Sonraki betik" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Previous script" -msgstr "" +msgstr "Önceki betik" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/project_export.cpp msgid "File" -msgstr "" +msgstr "Dizeç" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/property_editor.cpp msgid "New" -msgstr "" +msgstr "Yeni" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Save All" -msgstr "" +msgstr "Tümünü kaydet" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Soft Reload Script" -msgstr "" +msgstr "Betiği Yeniden Duyarlı Yükle" #: tools/editor/plugins/script_editor_plugin.cpp msgid "History Prev" -msgstr "" +msgstr "Öceki Geçmiş" #: tools/editor/plugins/script_editor_plugin.cpp msgid "History Next" -msgstr "" +msgstr "Sonraki Geçmiş" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Reload Theme" -msgstr "" +msgstr "Kalıbı Yeniden Yükle" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Save Theme" -msgstr "" +msgstr "Kalıbı Kaydet" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Save Theme As" -msgstr "" +msgstr "Kalıbı Başkaca Kaydet" #: tools/editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Close Docs" -msgstr "Kapat" +msgstr "Belgeleri Kapat" #: tools/editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Close All" -msgstr "Kapat" +msgstr "Tümünü Kapat" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/plugins/script_text_editor.cpp #: tools/editor/plugins/shader_editor_plugin.cpp msgid "Find.." -msgstr "" +msgstr "Bul.." #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/plugins/script_text_editor.cpp #: tools/editor/plugins/shader_editor_plugin.cpp msgid "Find Next" -msgstr "" +msgstr "Sonraki Bul" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Debug" -msgstr "" +msgstr "Kusur Ayıkla" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/script_editor_debugger.cpp msgid "Step Over" -msgstr "" +msgstr "Adımla" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/script_editor_debugger.cpp msgid "Step Into" -msgstr "" +msgstr "İçeri Adımla" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/script_editor_debugger.cpp msgid "Break" -msgstr "" +msgstr "Ara Ver" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/script_editor_debugger.cpp msgid "Continue" -msgstr "" +msgstr "Devam Et" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Keep Debugger Open" -msgstr "" +msgstr "Kusurayıkları Açık Tut" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Window" -msgstr "" +msgstr "Pencere" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Move Left" -msgstr "" +msgstr "Sola Taşı" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Move Right" -msgstr "" +msgstr "Sağa Taşı" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Tutorials" -msgstr "" +msgstr "Öğreticiler" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Open https://godotengine.org at tutorials section." -msgstr "" +msgstr "https://godotengine.org bağlantısını öğreticiler bölümünde aç." #: tools/editor/plugins/script_editor_plugin.cpp msgid "Classes" -msgstr "" +msgstr "Bölütler" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Search the class hierarchy." -msgstr "" +msgstr "Bölüt sıradüzenini Ara." #: tools/editor/plugins/script_editor_plugin.cpp msgid "Search the reference documentation." -msgstr "" +msgstr "Başvuru belgelerinde arama yap." #: tools/editor/plugins/script_editor_plugin.cpp msgid "Go to previous edited document." -msgstr "" +msgstr "Daha önce düzenlenmiş belgeye git." #: tools/editor/plugins/script_editor_plugin.cpp msgid "Go to next edited document." -msgstr "" +msgstr "Düzenlenmiş bir sonraki belgeye git." #: tools/editor/plugins/script_editor_plugin.cpp msgid "Create Script" -msgstr "" +msgstr "Betik Oluştur" #: tools/editor/plugins/script_editor_plugin.cpp msgid "" "The following files are newer on disk.\n" "What action should be taken?:" msgstr "" +"Aşağıdaki dizeçler saklakta daha yeni.\n" +"Hangi eylem yapılsın?:" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Reload" -msgstr "" +msgstr "Yeniden Yükle" #: tools/editor/plugins/script_editor_plugin.cpp msgid "Resave" -msgstr "" +msgstr "Yeniden Kaydet" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/script_editor_debugger.cpp msgid "Debugger" -msgstr "" +msgstr "Kusurayıklar" #: tools/editor/plugins/script_editor_plugin.cpp msgid "" "Built-in scripts can only be edited when the scene they belong to is loaded" msgstr "" +"Gömülü betik dizeçleri yalnızca ait oldukları sahne yüklendiğinde " +"düzenlenebilirler" #: tools/editor/plugins/script_text_editor.cpp msgid "Pick Color" -msgstr "" +msgstr "Renk Seç" #: tools/editor/plugins/script_text_editor.cpp tools/editor/scene_tree_dock.cpp msgid "Move Up" -msgstr "" +msgstr "Yukarı Taşı" #: tools/editor/plugins/script_text_editor.cpp tools/editor/scene_tree_dock.cpp msgid "Move Down" -msgstr "" +msgstr "Aşağı Taşı" #: tools/editor/plugins/script_text_editor.cpp msgid "Indent Left" -msgstr "" +msgstr "Sola Girintile" #: tools/editor/plugins/script_text_editor.cpp msgid "Indent Right" -msgstr "" +msgstr "Sağa Girintile" #: tools/editor/plugins/script_text_editor.cpp msgid "Toggle Comment" -msgstr "" +msgstr "Yorumu Aç / Kapat" #: tools/editor/plugins/script_text_editor.cpp msgid "Clone Down" -msgstr "" +msgstr "Aşağıya Eşle" #: tools/editor/plugins/script_text_editor.cpp msgid "Complete Symbol" -msgstr "" +msgstr "Simgeyi Tamamla" #: tools/editor/plugins/script_text_editor.cpp msgid "Trim Trailing Whitespace" -msgstr "" +msgstr "İzleyenin Boşluklarını Kırp" #: tools/editor/plugins/script_text_editor.cpp msgid "Auto Indent" -msgstr "" +msgstr "Kendinden Girintili" #: tools/editor/plugins/script_text_editor.cpp msgid "Remove All Breakpoints" -msgstr "" +msgstr "Tüm Kesme Noktalarını Kaldır" #: tools/editor/plugins/script_text_editor.cpp msgid "Goto Next Breakpoint" -msgstr "" +msgstr "Sonraki Kesme Noktasına Git" #: tools/editor/plugins/script_text_editor.cpp msgid "Goto Previous Breakpoint" -msgstr "" +msgstr "Önceki Kesme Noktasına Git" #: tools/editor/plugins/script_text_editor.cpp #: tools/editor/plugins/shader_editor_plugin.cpp msgid "Find Previous" -msgstr "" +msgstr "Öncekini Bul" #: tools/editor/plugins/script_text_editor.cpp #: tools/editor/plugins/shader_editor_plugin.cpp msgid "Replace.." -msgstr "" +msgstr "Değiştir.." #: tools/editor/plugins/script_text_editor.cpp msgid "Goto Function.." -msgstr "" +msgstr "İşleve Git.." #: tools/editor/plugins/script_text_editor.cpp #: tools/editor/plugins/shader_editor_plugin.cpp msgid "Goto Line.." -msgstr "" +msgstr "Dizeye Git.." #: tools/editor/plugins/script_text_editor.cpp msgid "Contextual Help" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "" +msgstr "Bağlamsal Yardım" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" -msgstr "" +msgstr "Basamaklı Sabiti Değiştir" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Vec Constant" -msgstr "" +msgstr "Vec Sabitini Değiştir" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change RGB Constant" -msgstr "" +msgstr "RGB Sabitini Değiştir" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Operator" -msgstr "" +msgstr "Basamaklı İşletmeni Değiştir" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Vec Operator" -msgstr "" +msgstr "Vec İşletmenini Değiştir" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Vec Scalar Operator" -msgstr "" +msgstr "Vec Basamaklı İşletmeni Değiştir" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change RGB Operator" -msgstr "" +msgstr "RGB İşletmenini Değiştir" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Toggle Rot Only" -msgstr "" +msgstr "Yalnız Döndürmeye Geçiş Yap" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Function" -msgstr "" +msgstr "Basamaklı İşlevi Değiştir" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Vec Function" -msgstr "" +msgstr "Vec İşlevini Değiştir" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Uniform" -msgstr "" +msgstr "Basamaklı Tekdüzenini Değiştir" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Vec Uniform" -msgstr "" +msgstr "Vec Tekdüzenini Değiştir" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change RGB Uniform" -msgstr "" +msgstr "RGB Tekdüzenini Değiştir" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Default Value" -msgstr "" +msgstr "Önyüklü Değeri Değiştir" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change XForm Uniform" -msgstr "" +msgstr "XForm Tekdüzenini Değiştir" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Texture Uniform" -msgstr "" +msgstr "Doku Tekdüzenini Değiştir" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Cubemap Uniform" -msgstr "" +msgstr "Küp Eşleşme Tekdüzenini Değiştir" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Comment" -msgstr "" +msgstr "Yorumu Değiştir" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Add/Remove to Color Ramp" -msgstr "" +msgstr "Renk Yokuşuna Ekle / Kaldır" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Add/Remove to Curve Map" -msgstr "" +msgstr "Eğri Haritası Ekle / Kaldır" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Modify Curve Map" -msgstr "" +msgstr "Eğri Haritasını Değiştir" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Input Name" -msgstr "" +msgstr "Giriş Adını Değiştir" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Connect Graph Nodes" -msgstr "" +msgstr "Çizge Düğümlerini Bağla" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Disconnect Graph Nodes" -msgstr "" +msgstr "Çizge Düğümlerinin Bağlantılarını Kes" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Remove Shader Graph Node" -msgstr "" +msgstr "Gölgelendirici Çizge Düğümünü Kaldır" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Move Shader Graph Node" -msgstr "" +msgstr "Gölgelendirici Çizge Düğümünü Taşı" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Duplicate Graph Node(s)" -msgstr "" +msgstr "Çizge Düğüm(lerini) İkile" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Delete Shader Graph Node(s)" -msgstr "" +msgstr "Gölgelendirici Çizge Düğümünü Sil" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Error: Cyclic Connection Link" -msgstr "" +msgstr "Sorun: Döngüsel İlişki Bağlantısı" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Error: Missing Input Connections" -msgstr "" +msgstr "Sorun: Giriş Bağlantıları Eksik" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Add Shader Graph Node" -msgstr "" +msgstr "Gölgelendirici Çizge Düğümü Ekle" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Orthogonal" -msgstr "" +msgstr "Dikey" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Perspective" -msgstr "" +msgstr "Derinlik" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Transform Aborted." -msgstr "" +msgstr "Dönüşüm Durduruldu." #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "X-Axis Transform." -msgstr "" +msgstr "X-Ekseni Dönüşümü." #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Y-Axis Transform." -msgstr "" +msgstr "Y-Eksen Dönüşümü." #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Z-Axis Transform." -msgstr "" +msgstr "Z-Eksen Dönüşümü." #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "View Plane Transform." -msgstr "" +msgstr "Düzlem Dönüşümünü Görüntüle." #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Scaling to %s%%." -msgstr "" +msgstr "Şuna %s%% Ölçeklendiriliyor." #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Rotating %s degrees." -msgstr "" +msgstr "%s Düzey Dönüyor." #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View." -msgstr "" +msgstr "Alttan Görünüm." #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Bottom" -msgstr "" +msgstr "Alt" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Top View." -msgstr "" +msgstr "Üstten Görünüm." #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Top" -msgstr "" +msgstr "Üst" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Rear View." -msgstr "" +msgstr "Arkadan Görünüm." #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Rear" -msgstr "" +msgstr "Arka" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Front View." -msgstr "" +msgstr "Önden Görünüm." #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Front" -msgstr "" +msgstr "Ön" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Left View." -msgstr "" +msgstr "Soldan Görünüm." #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Left" -msgstr "" +msgstr "Sol" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Right View." -msgstr "" +msgstr "Sağdan Görünüm." #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Right" -msgstr "" +msgstr "Sağ" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Keying is disabled (no key inserted)." -msgstr "" +msgstr "Açar ekleme devre dışı (eklenmiş açar yok)." #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Animation Key Inserted." -msgstr "" +msgstr "Canlandırma Açarı Eklendi." #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Align with view" -msgstr "" +msgstr "Görünüme Ayarla" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Environment" -msgstr "" +msgstr "Çevre" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Audio Listener" -msgstr "" +msgstr "Ses Dinleyici" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Gizmos" -msgstr "" +msgstr "Zımbırtılar" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "XForm Dialog" -msgstr "" +msgstr "XForm İletişim Kutusu" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "No scene selected to instance!" -msgstr "" +msgstr "Örnek vermek için hiçbir sahne seçilmedi!" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Instance at Cursor" -msgstr "" +msgstr "Göstergede Örnekle" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Could not instance scene!" -msgstr "" +msgstr "Sahne Örneklenemedi!" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Move Mode (W)" -msgstr "" +msgstr "Taşıma Biçimi (W)" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Rotate Mode (E)" -msgstr "" +msgstr "Döndürme Biçimi (E)" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Scale Mode (R)" -msgstr "" +msgstr "Ölçek Biçimi (R)" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Bottom View" -msgstr "" +msgstr "Alttan Görünüm" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Top View" -msgstr "" +msgstr "Üstten Görünüm" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Rear View" -msgstr "" +msgstr "Arkadan Görünüm" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Front View" -msgstr "" +msgstr "Önden Görünüm" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Left View" -msgstr "" +msgstr "Soldan Görünüm" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Right View" -msgstr "" +msgstr "Sağdan Görünüm" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Switch Perspective/Orthogonal view" -msgstr "" +msgstr "Derinlik / Dikey Görünüme Değiştir" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Insert Animation Key" -msgstr "" +msgstr "Canlandırma Açarı Ekle" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Focus Origin" -msgstr "" +msgstr "Başlatıma Odaklan" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Focus Selection" -msgstr "" +msgstr "Seçime Odaklan" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Align Selection With View" -msgstr "" +msgstr "Seçimi Görünüme Ayarla" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Transform" -msgstr "" +msgstr "Dönüşüm" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Local Coords" -msgstr "" +msgstr "Yerel Konaçlar" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Transform Dialog.." -msgstr "" +msgstr "Dönüştürme İletişim Kutusu.." #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Use Default Light" -msgstr "" +msgstr "Önyüklü Işık Kullan" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Use Default sRGB" -msgstr "" +msgstr "Önyüklü sRGB'yi Kullan" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "1 Viewport" -msgstr "" +msgstr "1 Görünüm" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "2 Viewports" -msgstr "" +msgstr "2 Görünüm" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "2 Viewports (Alt)" -msgstr "" +msgstr "2 Görünüm (Alt)" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "3 Viewports" -msgstr "" +msgstr "3 Görünüm" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "3 Viewports (Alt)" -msgstr "" +msgstr "3 Görünüm (Alt)" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "4 Viewports" -msgstr "" +msgstr "4 Görünüm" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Display Normal" -msgstr "" +msgstr "Olağanı Görüntüle" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Display Wireframe" -msgstr "" +msgstr "Telkafes Görüntüle" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Display Overdraw" -msgstr "" +msgstr "Abartı Görüntüle" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Display Shadeless" -msgstr "" +msgstr "Gölgesiz Görüntüle" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "View Origin" -msgstr "" +msgstr "Başlatım Görünümü" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "View Grid" -msgstr "" +msgstr "Izgara Görünümü" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Snap Settings" -msgstr "" +msgstr "Yapışma Ayarları" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Translate Snap:" -msgstr "" +msgstr "Yapışmayı Çevir:" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Rotate Snap (deg.):" -msgstr "" +msgstr "Yapışmayı Döndür (düzey):" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Scale Snap (%):" -msgstr "" +msgstr "Yapışmayı Ölçekle (%):" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Viewport Settings" -msgstr "" +msgstr "Görüntüleme Ayarları" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Default Light Normal:" -msgstr "" +msgstr "Önyüklü Işığın Olağanı:" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Ambient Light Color:" -msgstr "" +msgstr "Ortam Işığı Rengi:" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Perspective FOV (deg.):" -msgstr "" +msgstr "Perspektif FOV (düzey):" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "View Z-Near:" -msgstr "" +msgstr "Z-Yakını Göster:" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "View Z-Far:" -msgstr "" +msgstr "Z-Uzağı Görüntüle:" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Transform Change" -msgstr "" +msgstr "Dönüşümü Değiştir" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Translate:" -msgstr "" +msgstr "Çevir:" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Rotate (deg.):" -msgstr "" +msgstr "Döndür (düzey):" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Scale (ratio):" -msgstr "" +msgstr "Ölçek (oran):" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Transform Type" -msgstr "" +msgstr "Dönüştürme Türü" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Pre" -msgstr "" +msgstr "Öncesi" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Post" -msgstr "" +msgstr "Sonrası" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "ERROR: Couldn't load frame resource!" -msgstr "" +msgstr "SORUN: Kare kaynağı yüklenemedi!" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Add Frame" -msgstr "" +msgstr "Çerçeve Ekle" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Resource clipboard is empty or not a texture!" -msgstr "" +msgstr "Kaynak bellem boş ya da bu bir doku değil!" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Paste Frame" -msgstr "" +msgstr "Çerçeveyi Yapıştır" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Add Empty" -msgstr "" +msgstr "Boş Ekle" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Change Animation Loop" -msgstr "" +msgstr "Canlandırma Döngüsünü Değiştir" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Change Animation FPS" -msgstr "" +msgstr "Canlandırma FPS'sini Değiştir" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "(empty)" -msgstr "" +msgstr "(boş)" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Animations" -msgstr "" +msgstr "Canlandırmalar" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Speed (FPS):" -msgstr "" +msgstr "Hız (FPS):" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Animation Frames" -msgstr "" +msgstr "Canlandırma Çerçeveleri" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Insert Empty (Before)" -msgstr "" +msgstr "Boş Ekle (Önce)" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Insert Empty (After)" -msgstr "" +msgstr "Boş Ekle (Sonra)" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Up" -msgstr "" +msgstr "Yukarı" #: tools/editor/plugins/sprite_frames_editor_plugin.cpp msgid "Down" -msgstr "" +msgstr "Aşağı" #: tools/editor/plugins/style_box_editor_plugin.cpp msgid "StyleBox Preview:" -msgstr "" +msgstr "StyleBox Önizleme:" #: tools/editor/plugins/texture_region_editor_plugin.cpp msgid "Snap Mode:" -msgstr "" +msgstr "Yapışma Biçimi:" #: tools/editor/plugins/texture_region_editor_plugin.cpp msgid "<None>" -msgstr "" +msgstr "<Yok>" #: tools/editor/plugins/texture_region_editor_plugin.cpp msgid "Pixel Snap" -msgstr "" +msgstr "Nokta Yapışması" #: tools/editor/plugins/texture_region_editor_plugin.cpp msgid "Grid Snap" -msgstr "" +msgstr "Izgara Yapışması" #: tools/editor/plugins/texture_region_editor_plugin.cpp msgid "Auto Slice" -msgstr "" +msgstr "Kendinden Dilimle" #: tools/editor/plugins/texture_region_editor_plugin.cpp msgid "Offset:" -msgstr "" +msgstr "Kaydırma:" #: tools/editor/plugins/texture_region_editor_plugin.cpp msgid "Step:" -msgstr "" +msgstr "Adım:" #: tools/editor/plugins/texture_region_editor_plugin.cpp msgid "Separation:" -msgstr "" +msgstr "Ayrım:" #: tools/editor/plugins/texture_region_editor_plugin.cpp msgid "Texture Region" -msgstr "" +msgstr "Doku Bölgesi" #: tools/editor/plugins/texture_region_editor_plugin.cpp msgid "Texture Region Editor" -msgstr "" +msgstr "Doku Bölgesi Düzenleyicisi" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Can't save theme to file:" -msgstr "" +msgstr "Kalıbı dizece kaydedemiyoruz:" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Add All Items" -msgstr "" +msgstr "Tüm Öğeleri Ekle" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Add All" -msgstr "" +msgstr "Tümünü Ekle" #: tools/editor/plugins/theme_editor_plugin.cpp #: tools/editor/plugins/tile_set_editor_plugin.cpp msgid "Remove Item" -msgstr "" +msgstr "Öğeyi Kaldır" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Theme" -msgstr "" +msgstr "Kalıp" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Add Class Items" -msgstr "" +msgstr "Bölüt Öğeleri Ekle" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Remove Class Items" -msgstr "" +msgstr "Bölüt Öğelerini Kaldır" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Create Empty Template" -msgstr "" +msgstr "Boş Kalıp Oluştur" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Create Empty Editor Template" -msgstr "" +msgstr "Boş Düzenleyici Kalıbı Oluştur" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "CheckBox Radio1" -msgstr "" +msgstr "OnayKutusu Radyo1" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "CheckBox Radio2" -msgstr "" +msgstr "OnayKutusu Radyo2" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Item" -msgstr "" +msgstr "Öğe" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Check Item" -msgstr "" +msgstr "Öğeyi Denetle" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Checked Item" -msgstr "" +msgstr "Denetlenen Öğe" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Has" -msgstr "" +msgstr "Var" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Many" -msgstr "" +msgstr "Çok" #: tools/editor/plugins/theme_editor_plugin.cpp tools/editor/project_export.cpp msgid "Options" -msgstr "" +msgstr "Seçenekler" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Have,Many,Several,Options!" -msgstr "" +msgstr "Bir Çok,Seçenek,Var!" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Tab 1" -msgstr "" +msgstr "Sekme 1" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Tab 2" -msgstr "" +msgstr "Sekme 2" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Tab 3" -msgstr "" +msgstr "Sekme 3" #: tools/editor/plugins/theme_editor_plugin.cpp #: tools/editor/project_settings.cpp tools/editor/scene_tree_editor.cpp #: tools/editor/script_editor_debugger.cpp msgid "Type:" -msgstr "" +msgstr "Tür:" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Data Type:" -msgstr "" +msgstr "Veri Türü:" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Icon" -msgstr "" +msgstr "Simge" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Style" -msgstr "" +msgstr "Yoldam" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Color" -msgstr "" +msgstr "Renk" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Paint TileMap" -msgstr "" +msgstr "TileMap'i Boya" #: tools/editor/plugins/tile_map_editor_plugin.cpp #: tools/editor/scene_tree_dock.cpp msgid "Duplicate" -msgstr "" +msgstr "İkile" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Erase TileMap" -msgstr "" +msgstr "TileMap'i Sil" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Erase selection" -msgstr "" +msgstr "Seçimi Sil" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Find tile" -msgstr "" +msgstr "Döşentiyi Bul" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Transpose" -msgstr "" +msgstr "Tersine Çevir" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Mirror X" -msgstr "" +msgstr "X'e Aynala" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Mirror Y" -msgstr "" +msgstr "Y'ye Aynala" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Bucket" -msgstr "" +msgstr "Kova" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Pick Tile" -msgstr "" +msgstr "Karo Seç" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Select" -msgstr "" +msgstr "Seç" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Rotate 0 degrees" -msgstr "" +msgstr "0 Düzeyde Döndür" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Rotate 90 degrees" -msgstr "" +msgstr "90 Düzeyde Döndür" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Rotate 180 degrees" -msgstr "" +msgstr "180 Düzeyde Döndür" #: tools/editor/plugins/tile_map_editor_plugin.cpp msgid "Rotate 270 degrees" -msgstr "" +msgstr "270 Düzeyde Döndür" #: tools/editor/plugins/tile_set_editor_plugin.cpp msgid "Could not find tile:" -msgstr "" +msgstr "Karo Bulunamadı:" #: tools/editor/plugins/tile_set_editor_plugin.cpp msgid "Item name or ID:" -msgstr "" +msgstr "Öğe adı yada kimliği:" #: tools/editor/plugins/tile_set_editor_plugin.cpp msgid "Create from scene?" -msgstr "" +msgstr "Sahneden mi oluşturulsun?" #: tools/editor/plugins/tile_set_editor_plugin.cpp msgid "Merge from scene?" -msgstr "" +msgstr "Sahneden birleştirilsin mi?" #: tools/editor/plugins/tile_set_editor_plugin.cpp msgid "Create from Scene" -msgstr "" +msgstr "Sahneden Oluştur" #: tools/editor/plugins/tile_set_editor_plugin.cpp msgid "Merge from Scene" -msgstr "" +msgstr "Sahneden Birleştir" #: tools/editor/plugins/tile_set_editor_plugin.cpp #: tools/editor/script_editor_debugger.cpp msgid "Error" -msgstr "" +msgstr "Sorun" #: tools/editor/project_export.cpp msgid "Edit Script Options" -msgstr "" +msgstr "Betik Seçeneklerini Düzenle" #: tools/editor/project_export.cpp msgid "Please export outside the project folder!" -msgstr "" +msgstr "Lütfen tasarı dizininin dışına aktarın!" #: tools/editor/project_export.cpp msgid "Error exporting project!" -msgstr "" +msgstr "Tasarı gönderilirken sorun oluştu!" #: tools/editor/project_export.cpp msgid "Error writing the project PCK!" -msgstr "" +msgstr "Tasarının PCK'ini yazarken sorun oluştu!" #: tools/editor/project_export.cpp msgid "No exporter for platform '%s' yet." +msgstr "Şu anda '%s' ortamı için dışa aktarıcı yok." + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Create Android keystore" +msgstr "Yeni Kaynak Oluştur" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Full name" +msgstr "Uygun ad" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" msgstr "" #: tools/editor/project_export.cpp -msgid "Include" +#, fuzzy +msgid "Organization" +msgstr "Geçiş" + +#: tools/editor/project_export.cpp +msgid "City" msgstr "" #: tools/editor/project_export.cpp -msgid "Change Image Group" +#, fuzzy +msgid "State" +msgstr "Durum:" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" msgstr "" #: tools/editor/project_export.cpp -msgid "Group name can't be empty!" +msgid "User alias" msgstr "" #: tools/editor/project_export.cpp -msgid "Invalid character in group name!" +#, fuzzy +msgid "Password" +msgstr "Gizyazı:" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "at least 6 characters" +msgstr "Geçerli damgalar:" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "File name" +msgstr "Yeni ad:" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" msgstr "" #: tools/editor/project_export.cpp -msgid "Group name already exists!" +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" msgstr "" #: tools/editor/project_export.cpp -msgid "Add Image Group" +msgid "Fill Keystore/Release User and Release Password" msgstr "" #: tools/editor/project_export.cpp +msgid "Include" +msgstr "Katıştır" + +#: tools/editor/project_export.cpp +msgid "Change Image Group" +msgstr "Bediz Öbeğini Değiştir" + +#: tools/editor/project_export.cpp +msgid "Group name can't be empty!" +msgstr "Öbek adı boş olamaz!" + +#: tools/editor/project_export.cpp +msgid "Invalid character in group name!" +msgstr "Öbek adında geçersiz damga!" + +#: tools/editor/project_export.cpp +msgid "Group name already exists!" +msgstr "Öbek adı zaten var!" + +#: tools/editor/project_export.cpp +msgid "Add Image Group" +msgstr "Bediz Öbeği Ekle" + +#: tools/editor/project_export.cpp msgid "Delete Image Group" -msgstr "" +msgstr "Bediz Öbeğini Sil" #: tools/editor/project_export.cpp msgid "Atlas Preview" -msgstr "" +msgstr "Atlas Önizleme" #: tools/editor/project_export.cpp msgid "Project Export Settings" -msgstr "" +msgstr "Tasarıyı Dışa Aktarma Ayarları" #: tools/editor/project_export.cpp msgid "Target" -msgstr "" +msgstr "Amaç" #: tools/editor/project_export.cpp msgid "Export to Platform" -msgstr "" +msgstr "Ortama Aktar" #: tools/editor/project_export.cpp msgid "Resources" -msgstr "" +msgstr "Kaynaklar" #: tools/editor/project_export.cpp msgid "Export selected resources (including dependencies)." -msgstr "" +msgstr "Seçilen kaynakları dışa aktar (bağımlılıklar dahil)." #: tools/editor/project_export.cpp msgid "Export all resources in the project." -msgstr "" +msgstr "Tasarıdaki tüm kaynakları dışa aktarın." #: tools/editor/project_export.cpp msgid "Export all files in the project directory." -msgstr "" +msgstr "Tasarı dizinindeki tüm dizeçleri dışa aktarın." #: tools/editor/project_export.cpp msgid "Export Mode:" -msgstr "" +msgstr "Dışa Aktarma Biçimi:" #: tools/editor/project_export.cpp msgid "Resources to Export:" -msgstr "" +msgstr "Dışa Aktarılacak Kaynaklar:" #: tools/editor/project_export.cpp msgid "Action" -msgstr "" +msgstr "Eylem" #: tools/editor/project_export.cpp msgid "" "Filters to export non-resource files (comma-separated, e.g.: *.json, *.txt):" msgstr "" +"Kaynak olmayan dizeçleri dışa aktarmak için kullanılan süzgeçler (virgülle " +"ayrılmış, ör. * .json, * .txt):" #: tools/editor/project_export.cpp msgid "Filters to exclude from export (comma-separated, e.g.: *.json, *.txt):" msgstr "" +"Dışa aktarma işleminden hariç tutulacak süzgeçler (virgülle ayrılmış, ör. * ." +"json, * .txt):" #: tools/editor/project_export.cpp msgid "Convert text scenes to binary on export." -msgstr "" +msgstr "Dışa aktarmada yazı sahnelerini ikili hale getirin." #: tools/editor/project_export.cpp msgid "Images" -msgstr "" +msgstr "Bedizler" #: tools/editor/project_export.cpp msgid "Keep Original" -msgstr "" +msgstr "Özgün Tut" #: tools/editor/project_export.cpp msgid "Compress for Disk (Lossy, WebP)" -msgstr "" +msgstr "Saklak İçin Sıkıştır (Kayıplı, WebP)" #: tools/editor/project_export.cpp msgid "Compress for RAM (BC/PVRTC/ETC)" -msgstr "" +msgstr "RAM için Sıkıştır (BC / PVRTC / ETC)" #: tools/editor/project_export.cpp msgid "Convert Images (*.png):" -msgstr "" +msgstr "Bedizleri Dönüştür (*.png):" #: tools/editor/project_export.cpp msgid "Compress for Disk (Lossy) Quality:" -msgstr "" +msgstr "Saklak İçin Sıkıştır (Kayıplı) Nitelik:" #: tools/editor/project_export.cpp msgid "Shrink All Images:" -msgstr "" +msgstr "Tüm Bedizleri Küçült:" #: tools/editor/project_export.cpp msgid "Compress Formats:" -msgstr "" +msgstr "Sıkıştırma Biçemleri:" #: tools/editor/project_export.cpp msgid "Image Groups" -msgstr "" +msgstr "Bediz Öbekleri" #: tools/editor/project_export.cpp msgid "Groups:" -msgstr "" +msgstr "Öbekler:" #: tools/editor/project_export.cpp msgid "Compress Disk" -msgstr "" +msgstr "Saklağı Sıkıştır" #: tools/editor/project_export.cpp msgid "Compress RAM" -msgstr "" +msgstr "RAM'i Sıkıştır" #: tools/editor/project_export.cpp msgid "Compress Mode:" -msgstr "" +msgstr "Sıkıştırma Biçimi:" #: tools/editor/project_export.cpp msgid "Lossy Quality:" -msgstr "" +msgstr "Kayıplı Nitelik:" #: tools/editor/project_export.cpp msgid "Atlas:" -msgstr "" +msgstr "Atlas :" #: tools/editor/project_export.cpp msgid "Shrink By:" -msgstr "" +msgstr "Küçült:" #: tools/editor/project_export.cpp msgid "Preview Atlas" -msgstr "" +msgstr "Atlası Önizle" #: tools/editor/project_export.cpp msgid "Image Filter:" -msgstr "" +msgstr "Bediz Süzgeci:" #: tools/editor/project_export.cpp msgid "Images:" -msgstr "" +msgstr "Bedizler:" #: tools/editor/project_export.cpp msgid "Select None" -msgstr "" +msgstr "Hiçbir Şey Seçilmedi" #: tools/editor/project_export.cpp msgid "Group" -msgstr "" +msgstr "Öbek" #: tools/editor/project_export.cpp msgid "Samples" -msgstr "" +msgstr "Örnekler" #: tools/editor/project_export.cpp msgid "Sample Conversion Mode: (.wav files):" -msgstr "" +msgstr "Örnek Dönüşüm Biçimi: (.wav dizeçleri):" #: tools/editor/project_export.cpp msgid "Keep" -msgstr "" +msgstr "Tut" #: tools/editor/project_export.cpp msgid "Compress (RAM - IMA-ADPCM)" -msgstr "" +msgstr "Sıkıştır (RAM - IMA-ADPCM)" #: tools/editor/project_export.cpp msgid "Sampling Rate Limit (Hz):" -msgstr "" +msgstr "Örnekleme Oranının Sınırı (Hz):" #: tools/editor/project_export.cpp msgid "Trim" -msgstr "" +msgstr "Buda" #: tools/editor/project_export.cpp msgid "Trailing Silence:" -msgstr "" +msgstr "Sessizliği İzliyor:" #: tools/editor/project_export.cpp msgid "Script" -msgstr "" +msgstr "Betik" #: tools/editor/project_export.cpp msgid "Script Export Mode:" -msgstr "" +msgstr "Betik Dışa Aktarım Biçimi:" #: tools/editor/project_export.cpp msgid "Text" -msgstr "" +msgstr "Yazı" #: tools/editor/project_export.cpp msgid "Compiled" -msgstr "" +msgstr "Derlenmiş" #: tools/editor/project_export.cpp msgid "Encrypted (Provide Key Below)" -msgstr "" +msgstr "Şifreli (Açarı Aşağıda Belirtin)" #: tools/editor/project_export.cpp msgid "Script Encryption Key (256-bits as hex):" -msgstr "" +msgstr "Betik Şifreleme Açarı (Hex olarak 256-bit):" #: tools/editor/project_export.cpp msgid "Export PCK/Zip" -msgstr "" +msgstr "PCK/Zip Dizecini Dışa Aktar" #: tools/editor/project_export.cpp msgid "Export Project PCK" -msgstr "" +msgstr "Tasarı PCK Dışa Aktar" #: tools/editor/project_export.cpp msgid "Export.." -msgstr "" +msgstr "Dışa Aktar.." #: tools/editor/project_export.cpp msgid "Project Export" -msgstr "" +msgstr "Tasarı Dışa Aktar" #: tools/editor/project_export.cpp msgid "Export Preset:" -msgstr "" +msgstr "Ön Ayarları Dışa Aktar:" #: tools/editor/project_manager.cpp msgid "Invalid project path, the path must exist!" -msgstr "" +msgstr "Geçersiz tasarı yolu, yolun var olması gerekir!" #: tools/editor/project_manager.cpp msgid "Invalid project path, engine.cfg must not exist." -msgstr "" +msgstr "Geçersiz tasarı yolu, engine.cfg var olmaması gerekir." #: tools/editor/project_manager.cpp msgid "Invalid project path, engine.cfg must exist." -msgstr "" +msgstr "Geçersiz tasarı yolu, engine.cfg var olması gerekir." #: tools/editor/project_manager.cpp msgid "Imported Project" -msgstr "" +msgstr "İçe Aktarılan Tasarı" #: tools/editor/project_manager.cpp msgid "Invalid project path (changed anything?)." -msgstr "" +msgstr "Geçersiz tasarı yolu (bir şey değişti mi?)." #: tools/editor/project_manager.cpp msgid "Couldn't create engine.cfg in project path." -msgstr "" +msgstr "engine.cfg tasarı yolunda oluşturulamadı." #: tools/editor/project_manager.cpp msgid "The following files failed extraction from package:" -msgstr "" +msgstr "Aşağıdaki dizeçlerin, çıkından ayıklanma işlemi başarısız oldu:" #: tools/editor/project_manager.cpp msgid "Package Installed Successfully!" -msgstr "" +msgstr "Çıkın Başarı ile Kuruldu!" #: tools/editor/project_manager.cpp msgid "Import Existing Project" -msgstr "" +msgstr "Var olan Tasarıyı İçe Aktar" #: tools/editor/project_manager.cpp msgid "Project Path (Must Exist):" -msgstr "" +msgstr "Tasarı Yolu (Var Olması Gerekir):" #: tools/editor/project_manager.cpp msgid "Project Name:" -msgstr "" +msgstr "Tasarı Adı:" #: tools/editor/project_manager.cpp msgid "Create New Project" -msgstr "" +msgstr "Yeni Tasarı Oluştur" #: tools/editor/project_manager.cpp msgid "Project Path:" -msgstr "" +msgstr "Tasarı Yolu:" #: tools/editor/project_manager.cpp msgid "Install Project:" -msgstr "" +msgstr "Tasarıyı Kur:" #: tools/editor/project_manager.cpp msgid "Install" -msgstr "" +msgstr "Kur" #: tools/editor/project_manager.cpp msgid "Browse" -msgstr "" +msgstr "Gözat" #: tools/editor/project_manager.cpp msgid "New Game Project" -msgstr "" +msgstr "Yeni Oyun Tasarısı" #: tools/editor/project_manager.cpp msgid "That's a BINGO!" -msgstr "" +msgstr "Yaşa BE!" #: tools/editor/project_manager.cpp msgid "Unnamed Project" -msgstr "" +msgstr "Adsız Tasarı" #: tools/editor/project_manager.cpp msgid "Are you sure to open more than one project?" -msgstr "" +msgstr "Birden fazla tasarı açmakta kararlı mısınız?" #: tools/editor/project_manager.cpp msgid "Are you sure to run more than one project?" -msgstr "" +msgstr "Birden fazla tasarıyı çalıştırmaya kararlı mısınız?" #: tools/editor/project_manager.cpp msgid "Remove project from the list? (Folder contents will not be modified)" msgstr "" +"Tasarıyı dizelgeden kaldırmak mı istiyorsunuz? (Dizin içeriği değiştirilmez)" #: tools/editor/project_manager.cpp msgid "" "You are about the scan %s folders for existing Godot projects. Do you " "confirm?" msgstr "" +"Var olan Godot tasarıları için %s dizin taraması yapıyorsunuz. Onaylıyor " +"musunuz?" #: tools/editor/project_manager.cpp msgid "Project Manager" -msgstr "" +msgstr "Tasarı Yöneticisi" #: tools/editor/project_manager.cpp msgid "Project List" -msgstr "" +msgstr "Tasarı Dizelgesi" #: tools/editor/project_manager.cpp msgid "Run" -msgstr "" +msgstr "Çalıştır" #: tools/editor/project_manager.cpp msgid "Scan" -msgstr "" +msgstr "Tara" #: tools/editor/project_manager.cpp -#, fuzzy msgid "Select a Folder to Scan" -msgstr "Bir Düğüm Seç" +msgstr "Tarama için bir Dizin Seç" #: tools/editor/project_manager.cpp msgid "New Project" -msgstr "" +msgstr "Yeni Tasarı" #: tools/editor/project_manager.cpp msgid "Exit" -msgstr "" +msgstr "Çık" #: tools/editor/project_settings.cpp msgid "Key " -msgstr "" +msgstr "Dokunaç " #: tools/editor/project_settings.cpp msgid "Joy Button" -msgstr "" +msgstr "Eğlence Düğmesi" #: tools/editor/project_settings.cpp msgid "Joy Axis" -msgstr "" +msgstr "Eğlence Ekseni" #: tools/editor/project_settings.cpp msgid "Mouse Button" -msgstr "" +msgstr "Fare Düğmesi" #: tools/editor/project_settings.cpp msgid "Invalid action (anything goes but '/' or ':')." -msgstr "" +msgstr "Geçersiz işlem (her şey ancak şu '/' ya da şuna ':' gider)." #: tools/editor/project_settings.cpp msgid "Action '%s' already exists!" -msgstr "" +msgstr "İşlem '%s' zaten var!" #: tools/editor/project_settings.cpp msgid "Rename Input Action Event" -msgstr "" +msgstr "Giriş İşlem Olayını Yeniden Adlandır" #: tools/editor/project_settings.cpp msgid "Add Input Action Event" -msgstr "" +msgstr "Giriş İşlem Olayı Ekle" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp msgid "Control+" -msgstr "" +msgstr "Denetim+" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp msgid "Press a Key.." -msgstr "" +msgstr "Bir Dokunaca Basın.." #: tools/editor/project_settings.cpp msgid "Mouse Button Index:" -msgstr "" +msgstr "Fare Düğme Dizini:" #: tools/editor/project_settings.cpp msgid "Left Button" -msgstr "" +msgstr "Sol Düğme" #: tools/editor/project_settings.cpp msgid "Right Button" -msgstr "" +msgstr "Sağ Düğme" #: tools/editor/project_settings.cpp msgid "Middle Button" -msgstr "" +msgstr "Orta Düğme" #: tools/editor/project_settings.cpp msgid "Wheel Up Button" -msgstr "" +msgstr "Tekerlek Yukarı Düğmesi" #: tools/editor/project_settings.cpp msgid "Wheel Down Button" -msgstr "" +msgstr "Tekerlek Aşağı Düğmesi" #: tools/editor/project_settings.cpp msgid "Button 6" -msgstr "" +msgstr "Düğme 6" #: tools/editor/project_settings.cpp msgid "Button 7" -msgstr "" +msgstr "Düğme 7" #: tools/editor/project_settings.cpp msgid "Button 8" -msgstr "" +msgstr "Düğme 8" #: tools/editor/project_settings.cpp msgid "Button 9" -msgstr "" +msgstr "Düğme 9" #: tools/editor/project_settings.cpp msgid "Joystick Axis Index:" -msgstr "" +msgstr "Oyunçubuğu Ekseni Dizini:" #: tools/editor/project_settings.cpp msgid "Joystick Button Index:" -msgstr "" +msgstr "Oyunçubuğu Düğme Dizini:" #: tools/editor/project_settings.cpp msgid "Add Input Action" -msgstr "" +msgstr "Giriş Eylemi Ekle" #: tools/editor/project_settings.cpp msgid "Erase Input Action Event" -msgstr "" - -#: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "" +msgstr "Giriş Eylemi Olayını Sil" #: tools/editor/project_settings.cpp msgid "Error saving settings." -msgstr "" +msgstr "Ayarları kaydetme sorunu." #: tools/editor/project_settings.cpp msgid "Settings saved OK." -msgstr "" +msgstr "Ayarlar kaydedildi TAMAM." #: tools/editor/project_settings.cpp msgid "Add Translation" -msgstr "" +msgstr "Çeviri Ekle" #: tools/editor/project_settings.cpp msgid "Remove Translation" -msgstr "" +msgstr "Çeviriyi Kaldır" #: tools/editor/project_settings.cpp msgid "Add Remapped Path" -msgstr "" +msgstr "Yeniden Eşlenmiş Yol Ekle" #: tools/editor/project_settings.cpp msgid "Resource Remap Add Remap" -msgstr "" +msgstr "Kaynak Yeniden Eşleme Ekle Eşle" #: tools/editor/project_settings.cpp msgid "Change Resource Remap Language" -msgstr "" +msgstr "Kaynak Yeniden Eşleme Dilini Değiştir" #: tools/editor/project_settings.cpp msgid "Remove Resource Remap" -msgstr "" +msgstr "Kaynak Yeniden Eşlemesini Kaldır" #: tools/editor/project_settings.cpp msgid "Remove Resource Remap Option" -msgstr "" +msgstr "Kaynak Yeniden Eşle Seçeneğini Kaldır" #: tools/editor/project_settings.cpp msgid "Project Settings (engine.cfg)" -msgstr "" +msgstr "Tasarı Ayarları (engine.cfg)" #: tools/editor/project_settings.cpp tools/editor/settings_config_dialog.cpp msgid "General" -msgstr "" +msgstr "Genel" #: tools/editor/project_settings.cpp tools/editor/property_editor.cpp msgid "Property:" -msgstr "" +msgstr "Özellik:" #: tools/editor/project_settings.cpp msgid "Del" -msgstr "" +msgstr "Sil" #: tools/editor/project_settings.cpp msgid "Copy To Platform.." -msgstr "" +msgstr "Düzleme Tıpkıla.." #: tools/editor/project_settings.cpp msgid "Input Map" -msgstr "" +msgstr "Eşleme Gir" #: tools/editor/project_settings.cpp msgid "Action:" -msgstr "" +msgstr "Eylem:" #: tools/editor/project_settings.cpp msgid "Device:" -msgstr "" +msgstr "Aygıt:" #: tools/editor/project_settings.cpp msgid "Index:" -msgstr "" +msgstr "Dizin:" #: tools/editor/project_settings.cpp msgid "Localization" -msgstr "" +msgstr "Yerelleştirme" #: tools/editor/project_settings.cpp msgid "Translations" -msgstr "" +msgstr "Çeviriler" #: tools/editor/project_settings.cpp msgid "Translations:" -msgstr "" +msgstr "Çeviriler:" #: tools/editor/project_settings.cpp msgid "Add.." -msgstr "" +msgstr "Ekle.." #: tools/editor/project_settings.cpp msgid "Remaps" -msgstr "" +msgstr "Yeniden Eşlemeler" #: tools/editor/project_settings.cpp msgid "Resources:" -msgstr "" +msgstr "Kaynaklar:" #: tools/editor/project_settings.cpp msgid "Remaps by Locale:" -msgstr "" +msgstr "Yerel Ayara Göre Yeniden Eşlemeler:" #: tools/editor/project_settings.cpp msgid "Locale" -msgstr "" +msgstr "Yerel" #: tools/editor/project_settings.cpp msgid "AutoLoad" -msgstr "" +msgstr "KendindenYükle" #: tools/editor/project_settings.cpp msgid "Plugins" -msgstr "" +msgstr "Eklentiler" #: tools/editor/property_editor.cpp msgid "Preset.." -msgstr "" +msgstr "Ön ayar.." #: tools/editor/property_editor.cpp msgid "Ease In" -msgstr "" +msgstr "Açılma" #: tools/editor/property_editor.cpp msgid "Ease Out" -msgstr "" +msgstr "Kararma" #: tools/editor/property_editor.cpp msgid "Zero" -msgstr "" +msgstr "Sıfır" #: tools/editor/property_editor.cpp msgid "Easing In-Out" -msgstr "" +msgstr "Açılma Kararma" #: tools/editor/property_editor.cpp msgid "Easing Out-In" -msgstr "" +msgstr "Kararma Açılma" #: tools/editor/property_editor.cpp msgid "File.." -msgstr "" +msgstr "Dizeç.." #: tools/editor/property_editor.cpp msgid "Dir.." -msgstr "" +msgstr "Diz.." -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" -msgstr "" +msgstr "Yükle" #: tools/editor/property_editor.cpp msgid "Assign" -msgstr "" +msgstr "Ata" #: tools/editor/property_editor.cpp -#, fuzzy msgid "New Script" -msgstr "Betiği Çalıştır" +msgstr "Yeni Betik" #: tools/editor/property_editor.cpp msgid "Error loading file: Not a resource!" -msgstr "" +msgstr "Dizeç yüklenirken sorun oluştu: Bir kaynak değil!" #: tools/editor/property_editor.cpp msgid "Couldn't load image" -msgstr "" +msgstr "Bediz yüklenemedi" #: tools/editor/property_editor.cpp msgid "Bit %d, val %d." -msgstr "" +msgstr "Bit %d, val %d." #: tools/editor/property_editor.cpp msgid "On" -msgstr "" +msgstr "Açık" #: tools/editor/property_editor.cpp msgid "Properties:" -msgstr "" - -#: tools/editor/property_editor.cpp -msgid "Global" -msgstr "" +msgstr "Özellikleri:" #: tools/editor/property_editor.cpp msgid "Sections:" -msgstr "" +msgstr "Bölümler:" #: tools/editor/property_selector.cpp -#, fuzzy msgid "Select Property" -msgstr "Düzenleyici Özellik Ekle" +msgstr "Nitelik Seç" #: tools/editor/property_selector.cpp -#, fuzzy msgid "Select Method" -msgstr "Bir Düğüm Seç" +msgstr "Yöntem Seç" #: tools/editor/pvrtc_compress.cpp msgid "Could not execute PVRTC tool:" -msgstr "" +msgstr "PVRTC aracı çalıştırılamadı:" #: tools/editor/pvrtc_compress.cpp msgid "Can't load back converted image using PVRTC tool:" -msgstr "" +msgstr "PVRTC aracını kullanarak dönüştürülen bedizi geri yükleyemiyor:" #: tools/editor/reparent_dialog.cpp tools/editor/scene_tree_dock.cpp msgid "Reparent Node" -msgstr "" +msgstr "Yeniden Ata Düğümü" #: tools/editor/reparent_dialog.cpp msgid "Reparent Location (Select new Parent):" -msgstr "" +msgstr "Yeniden Ata Konumu (Yeni Ata Seç):" #: tools/editor/reparent_dialog.cpp msgid "Keep Global Transform" -msgstr "" +msgstr "Bütünsel Dönüşümü Tut" #: tools/editor/reparent_dialog.cpp tools/editor/scene_tree_dock.cpp msgid "Reparent" -msgstr "" +msgstr "Yeniden Ata Yap" #: tools/editor/resources_dock.cpp msgid "Create New Resource" -msgstr "" +msgstr "Yeni Kaynak Oluştur" #: tools/editor/resources_dock.cpp msgid "Open Resource" -msgstr "" +msgstr "Kaynak Aç" #: tools/editor/resources_dock.cpp msgid "Save Resource" -msgstr "" +msgstr "Kaynağı Kaydet" #: tools/editor/resources_dock.cpp msgid "Resource Tools" -msgstr "" +msgstr "Kaynak Araçları" #: tools/editor/resources_dock.cpp msgid "Make Local" -msgstr "" +msgstr "Yerelleştir" #: tools/editor/run_settings_dialog.cpp msgid "Run Mode:" -msgstr "" +msgstr "Çalışma Biçimi:" #: tools/editor/run_settings_dialog.cpp msgid "Current Scene" -msgstr "" +msgstr "Şu anki Sahne" #: tools/editor/run_settings_dialog.cpp msgid "Main Scene" -msgstr "" +msgstr "Ana Sahne" #: tools/editor/run_settings_dialog.cpp msgid "Main Scene Arguments:" -msgstr "" +msgstr "Ana Sahne Değiştirgenleri:" #: tools/editor/run_settings_dialog.cpp msgid "Scene Run Settings" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "" +msgstr "Sahne Çalıştırma Ayarları" #: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." -msgstr "" +msgstr "Sahneleri örneklemek için ata yok." #: tools/editor/scene_tree_dock.cpp msgid "Error loading scene from %s" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "" +msgstr "%s Adlı sahne yüklenirken sorun oluştu" #: tools/editor/scene_tree_dock.cpp msgid "Ok" -msgstr "" +msgstr "Tamam" #: tools/editor/scene_tree_dock.cpp msgid "" "Cannot instance the scene '%s' because the current scene exists within one " "of its nodes." msgstr "" +"Geçerli sahne, düğümlerinden birinin içinde bulunduğu için '%s' sahnesi " +"örneklenemiyor." #: tools/editor/scene_tree_dock.cpp msgid "Instance Scene(s)" -msgstr "" +msgstr "Sahne(leri) Örnekle" #: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on the tree root." -msgstr "" +msgstr "Bu işlem, ağaç kökü üzerinde yapılamaz." #: tools/editor/scene_tree_dock.cpp msgid "Move Node In Parent" -msgstr "" +msgstr "Düğümü Ataya Taşı" #: tools/editor/scene_tree_dock.cpp msgid "Move Nodes In Parent" -msgstr "" +msgstr "Düğümleri Ataya Taşı" #: tools/editor/scene_tree_dock.cpp msgid "Duplicate Node(s)" -msgstr "" +msgstr "İkile Düğüm(leri)" #: tools/editor/scene_tree_dock.cpp msgid "Delete Node(s)?" -msgstr "" +msgstr "Düğüm(ler) Silinsin mi?" #: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done without a scene." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "" +msgstr "Bu işlem bir sahne olmadan yapılamaz." #: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." -msgstr "" +msgstr "Bu işlem örneklenmiş sahnelerde yapılamaz." #: tools/editor/scene_tree_dock.cpp msgid "Save New Scene As.." -msgstr "" +msgstr "Yeni Sahneyi Başkaca Kaydet .." #: tools/editor/scene_tree_dock.cpp msgid "Makes Sense!" -msgstr "" +msgstr "Anlamlı!" #: tools/editor/scene_tree_dock.cpp msgid "Can't operate on nodes from a foreign scene!" -msgstr "" +msgstr "Yad bir sahnedeki düğümler üzerinde çalışamaz!" #: tools/editor/scene_tree_dock.cpp msgid "Can't operate on nodes the current scene inherits from!" -msgstr "" +msgstr "Geçerli sahneden kalıt aldığı düğümler üzerinde çalışamaz!" #: tools/editor/scene_tree_dock.cpp msgid "Remove Node(s)" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "" +msgstr "Düğümleri Kaldır" #: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." msgstr "" +"Yeni sahne kaydedilemedi. Olası bağımlılıklar (örnekler) karşılanamadı." #: tools/editor/scene_tree_dock.cpp msgid "Error saving scene." -msgstr "" +msgstr "Sahne kaydedilirken sorun oluştu." #: tools/editor/scene_tree_dock.cpp msgid "Error duplicating scene to save it." -msgstr "" +msgstr "Kaydetmek için sahne ikilenirken sorun oluştu." #: tools/editor/scene_tree_dock.cpp msgid "Edit Groups" -msgstr "" +msgstr "Öbekleri Düzenle" #: tools/editor/scene_tree_dock.cpp msgid "Edit Connections" -msgstr "" +msgstr "Bağlantıları Düzenle" #: tools/editor/scene_tree_dock.cpp msgid "Delete Node(s)" -msgstr "" +msgstr "Düğümleri Sil" #: tools/editor/scene_tree_dock.cpp msgid "Add Child Node" -msgstr "" +msgstr "Çocuk Düğüm Ekle" #: tools/editor/scene_tree_dock.cpp msgid "Instance Child Scene" -msgstr "" +msgstr "Çocuk Sahnesini Örnekle" #: tools/editor/scene_tree_dock.cpp msgid "Change Type" -msgstr "" +msgstr "Türü Değiştir" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" -msgstr "" +msgid "Attach Script" +msgstr "Betik İliştir" + +#: tools/editor/scene_tree_dock.cpp +msgid "Clear Script" +msgstr "Betiği Temizle" #: tools/editor/scene_tree_dock.cpp msgid "Merge From Scene" -msgstr "" +msgstr "Sahneden Birleştir" #: tools/editor/scene_tree_dock.cpp msgid "Save Branch as Scene" -msgstr "" +msgstr "Dalı Sahne olarak Kaydet" #: tools/editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete (No Confirm)" -msgstr "Lütfen doğrulayınız..." +msgstr "Sil (Doğrulama Yok)" #: tools/editor/scene_tree_dock.cpp msgid "Add/Create a New Node" -msgstr "" +msgstr "Yeni Bir Düğüm Ekle / Oluştur" #: tools/editor/scene_tree_dock.cpp msgid "" "Instance a scene file as a Node. Creates an inherited scene if no root node " "exists." msgstr "" +"Sahne dizecini Düğüm olarak örneklendirin. Kök düğüm yoksa kalıtsal bir " +"sahne oluşturur." #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." -msgstr "" +msgid "Attach a new or existing script for the selected node." +msgstr "Seçili düğüm için yeni veya mevcut bir betik iliştir." -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." -msgstr "" +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." +msgstr "Seçilen düğüm için betik temizle." #: tools/editor/scene_tree_editor.cpp msgid "Toggle Spatial Visible" -msgstr "" +msgstr "Uzaysal Görünürlüğü Aç / Kapat" #: tools/editor/scene_tree_editor.cpp msgid "Toggle CanvasItem Visible" -msgstr "" +msgstr "CanvasItem'ı Görünür Duruma Getir" #: tools/editor/scene_tree_editor.cpp msgid "Instance:" -msgstr "" +msgstr "Örnek:" #: tools/editor/scene_tree_editor.cpp msgid "Invalid node name, the following characters are not allowed:" -msgstr "" +msgstr "Geçersiz düğüm adı, aşağıdaki damgalara izin verilmiyor:" #: tools/editor/scene_tree_editor.cpp msgid "Rename Node" -msgstr "" +msgstr "Düğümü Yeniden Adlandır" #: tools/editor/scene_tree_editor.cpp msgid "Scene Tree (Nodes):" -msgstr "" +msgstr "Sahne Ağacı (Düğümler):" #: tools/editor/scene_tree_editor.cpp msgid "Editable Children" -msgstr "" +msgstr "Düzenlenebilir Çocuklar" #: tools/editor/scene_tree_editor.cpp msgid "Load As Placeholder" -msgstr "" +msgstr "Yer Tutucu Olarak Yükle" #: tools/editor/scene_tree_editor.cpp msgid "Discard Instancing" -msgstr "" +msgstr "Örneği Boşalt" #: tools/editor/scene_tree_editor.cpp msgid "Open in Editor" -msgstr "Editörde Aç" +msgstr "Düzenleyicide Aç" #: tools/editor/scene_tree_editor.cpp -#, fuzzy msgid "Clear Inheritance" -msgstr "Mirası Temizle" +msgstr "Kalıtı Temizle" #: tools/editor/scene_tree_editor.cpp msgid "Clear Inheritance? (No Undo!)" -msgstr "" +msgstr "Kalıt Silinsin mi? (Geri Alınamaz!)" #: tools/editor/scene_tree_editor.cpp -#, fuzzy msgid "Clear!" msgstr "Temiz!" @@ -6469,32 +6671,31 @@ msgstr "Bir Düğüm Seç" #: tools/editor/script_create_dialog.cpp msgid "Invalid parent class name" -msgstr "Geçersiz ebeveyn sınıf adı" +msgstr "Geçersiz ata bölüt adı" #: tools/editor/script_create_dialog.cpp msgid "Valid chars:" -msgstr "Geçerli karakterler:" +msgstr "Geçerli damgalar:" #: tools/editor/script_create_dialog.cpp msgid "Invalid class name" -msgstr "Geçersiz sınıf adı" +msgstr "Geçersiz bölüt adı" #: tools/editor/script_create_dialog.cpp msgid "Valid name" msgstr "Uygun ad" #: tools/editor/script_create_dialog.cpp -#, fuzzy msgid "N/A" msgstr "Uygulanamaz" #: tools/editor/script_create_dialog.cpp msgid "Class name is invalid!" -msgstr "Sınıf adı geçersiz!" +msgstr "Bölüt adı geçersiz!" #: tools/editor/script_create_dialog.cpp msgid "Parent class name is invalid!" -msgstr "Ebeveyn sınıf adı geçersiz!" +msgstr "Ata bölüt adı geçersiz!" #: tools/editor/script_create_dialog.cpp msgid "Invalid path!" @@ -6502,44 +6703,47 @@ msgstr "Geçersiz yol!" #: tools/editor/script_create_dialog.cpp msgid "Could not create script in filesystem." -msgstr "" +msgstr "Dizeç düzeninde betik oluşturulamadı." + +#: tools/editor/script_create_dialog.cpp +msgid "Error loading script from %s" +msgstr "Yazı tipi %s yüklerken sorun oluştu" #: tools/editor/script_create_dialog.cpp msgid "Path is empty" -msgstr "Dosya yolu boş" +msgstr "Yol boş" #: tools/editor/script_create_dialog.cpp msgid "Path is not local" -msgstr "" +msgstr "Yol yerel değil" #: tools/editor/script_create_dialog.cpp -#, fuzzy msgid "Invalid base path" msgstr "Geçersiz üst yol" #: tools/editor/script_create_dialog.cpp -msgid "File exists" -msgstr "Dosya mevcut" - -#: tools/editor/script_create_dialog.cpp msgid "Invalid extension" msgstr "Geçersiz uzantı" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" -msgstr "Geçerli yol" +msgid "Create new script" +msgstr "Yeni Betik Oluştur" + +#: tools/editor/script_create_dialog.cpp +msgid "Load existing script" +msgstr "Var olan betiği yükle" #: tools/editor/script_create_dialog.cpp msgid "Class Name:" -msgstr "Sınıf Adı:" +msgstr "Bölüt Adı:" #: tools/editor/script_create_dialog.cpp msgid "Built-In Script" msgstr "Gömme Betik" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" -msgstr "Düğüm Betiği Oluştur" +msgid "Attach Node Script" +msgstr "Düğüm Betiği İliştir" #: tools/editor/script_editor_debugger.cpp msgid "Bytes:" @@ -6551,7 +6755,7 @@ msgstr "Uyarı" #: tools/editor/script_editor_debugger.cpp msgid "Error:" -msgstr "Hata:" +msgstr "Sorun:" #: tools/editor/script_editor_debugger.cpp msgid "Source:" @@ -6559,27 +6763,27 @@ msgstr "Kaynak:" #: tools/editor/script_editor_debugger.cpp msgid "Function:" -msgstr "Fonksiyon:" +msgstr "İşlev:" #: tools/editor/script_editor_debugger.cpp msgid "Errors" -msgstr "Hatalar" +msgstr "Sorunlar" #: tools/editor/script_editor_debugger.cpp msgid "Child Process Connected" -msgstr "" +msgstr "Çocuk Süreç Bağlandı" #: tools/editor/script_editor_debugger.cpp msgid "Inspect Previous Instance" -msgstr "" +msgstr "Önceki Örneği İncele" #: tools/editor/script_editor_debugger.cpp msgid "Inspect Next Instance" -msgstr "" +msgstr "Sonraki Örneğ İncele" #: tools/editor/script_editor_debugger.cpp msgid "Stack Frames" -msgstr "" +msgstr "Çerçeveleri Yığ" #: tools/editor/script_editor_debugger.cpp msgid "Variable" @@ -6587,31 +6791,31 @@ msgstr "Değişken" #: tools/editor/script_editor_debugger.cpp msgid "Errors:" -msgstr "Hatalar:" +msgstr "Sorunlar:" #: tools/editor/script_editor_debugger.cpp msgid "Stack Trace (if applicable):" -msgstr "" +msgstr "İzi Yığ (uygulanabilirse):" #: tools/editor/script_editor_debugger.cpp msgid "Remote Inspector" -msgstr "" +msgstr "Dolaylı Denetçi" #: tools/editor/script_editor_debugger.cpp msgid "Live Scene Tree:" -msgstr "" +msgstr "Canlı Sahne Ağacı:" #: tools/editor/script_editor_debugger.cpp msgid "Remote Object Properties: " -msgstr "" +msgstr "Dolaylı Nesne Özellikleri: " #: tools/editor/script_editor_debugger.cpp msgid "Profiler" -msgstr "" +msgstr "Kesitçi" #: tools/editor/script_editor_debugger.cpp msgid "Monitor" -msgstr "Ekran" +msgstr "Görüntülük" #: tools/editor/script_editor_debugger.cpp msgid "Value" @@ -6619,11 +6823,11 @@ msgstr "Değer" #: tools/editor/script_editor_debugger.cpp msgid "Monitors" -msgstr "Ekranlar" +msgstr "Görüntülükler" #: tools/editor/script_editor_debugger.cpp msgid "List of Video Memory Usage by Resource:" -msgstr "Kaynağa Göre Video Belleği Kullanımının Listesi:" +msgstr "Kaynağa Göre İzleti Belleği Kullanımının Dizelgesi:" #: tools/editor/script_editor_debugger.cpp msgid "Total:" @@ -6631,7 +6835,7 @@ msgstr "Toplam:" #: tools/editor/script_editor_debugger.cpp msgid "Video Mem" -msgstr "Video Belleği" +msgstr "İzleti Belleği" #: tools/editor/script_editor_debugger.cpp msgid "Resource Path" @@ -6647,23 +6851,23 @@ msgstr "Kullanım" #: tools/editor/script_editor_debugger.cpp msgid "Misc" -msgstr "" +msgstr "Türlü" #: tools/editor/script_editor_debugger.cpp msgid "Clicked Control:" -msgstr "" +msgstr "Tıklanan Denetim:" #: tools/editor/script_editor_debugger.cpp msgid "Clicked Control Type:" -msgstr "" +msgstr "Tıklanan Denetim Türü:" #: tools/editor/script_editor_debugger.cpp msgid "Live Edit Root:" -msgstr "" +msgstr "Canlı Kök Düzenle:" #: tools/editor/script_editor_debugger.cpp msgid "Set From Tree" -msgstr "" +msgstr "Ağaçtan Ayarla" #: tools/editor/settings_config_dialog.cpp msgid "Shortcuts" @@ -6675,7 +6879,7 @@ msgstr "Işın Çapını Değiştir" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Camera FOV" -msgstr "" +msgstr "Kamera FOV'sunu Değiştir" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Camera Size" @@ -6687,7 +6891,7 @@ msgstr "Küresel Şeklin Çapını Değiştir" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Box Shape Extents" -msgstr "Kübik Şekli Genislet" +msgstr "Kübik Şekli Genişlet" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Capsule Shape Radius" @@ -6695,12 +6899,55 @@ msgstr "Kapsülün Çapını Değiştir" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Capsule Shape Height" -msgstr "Kapsülün yüksekliğini değiştir" +msgstr "Kapsülün Yüksekliğini Değiştir" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Ray Shape Length" -msgstr "" +msgstr "Işın Şeklinin Uzunluğunu Değiştir" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Notifier Extents" -msgstr "" +msgstr "Bildirim Kapsamını Değiştir" + +#: tools/editor/spatial_editor_gizmos.cpp +#, fuzzy +msgid "Change Probe Extents" +msgstr "Bildirim Kapsamını Değiştir" + +#~ msgid "BakedLightInstance does not contain a BakedLight resource." +#~ msgstr "BakedLightInstance, bir BakedLight kaynağı içermez." + +#~ msgid "Vertex" +#~ msgstr "Başucu" + +#~ msgid "Fragment" +#~ msgstr "Bölümlenme" + +#~ msgid "Lighting" +#~ msgstr "Aydınlatma" + +#~ msgid "Toggle Persisting" +#~ msgstr "Sürdürmeyi Aç/Kapat" + +#~ msgid "Global" +#~ msgstr "Bütünsel" + +#~ msgid "" +#~ "This item cannot be made visible because the parent is hidden. Unhide the " +#~ "parent first." +#~ msgstr "" +#~ "Ata gizli olduğu için bu öğe görünür hale getirilemiyor. Önce atayı " +#~ "göster." + +#~ msgid "" +#~ "Paths cannot start with '/', absolute paths must start with 'res://', " +#~ "'user://', or 'local://'" +#~ msgstr "" +#~ "Yollar '/' ile başlayamaz, mutlak yollar 'res://', 'user://' veya " +#~ "'local://' ile başlamalıdır" + +#~ msgid "File exists" +#~ msgstr "Dosya mevcut" + +#~ msgid "Valid path" +#~ msgstr "Geçerli yol" diff --git a/tools/translations/ur_PK.po b/tools/translations/ur_PK.po index 188d2bb4c2..0eed08b52a 100644 --- a/tools/translations/ur_PK.po +++ b/tools/translations/ur_PK.po @@ -1,5 +1,5 @@ # Urdu (Pakistan) translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # # Muhammad Ali <ali@codeonion.com>, 2016. @@ -33,12 +33,6 @@ msgid "step argument is zero!" msgstr "سٹیپ کے ارگمنٹس سفر ہیں!" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" msgstr ".یہ انسٹینس کے بغیر سکرپٹ نہی ہوتی" @@ -385,74 +379,74 @@ msgstr "" msgid "just released" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid unique name." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid product GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid background color." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" @@ -560,10 +554,6 @@ msgid "" "as parent." msgstr "" -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "" - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -623,7 +613,8 @@ msgstr "" msgid "Cancel" msgstr "" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "" @@ -1770,6 +1761,11 @@ msgid "Constants:" msgstr "" #: tools/editor/editor_help.cpp +#, fuzzy +msgid "Property Description:" +msgstr "سب سکریپشن بنائیں" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "" @@ -1837,7 +1833,9 @@ msgstr "" msgid "Save Resource As.." msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "" @@ -2063,7 +2061,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "ایک مینو منظر چنیں" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "" @@ -2743,6 +2743,7 @@ msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "" @@ -2970,6 +2971,10 @@ msgid "Auto" msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +msgid "Root Node Name:" +msgstr "" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "" @@ -3870,6 +3875,49 @@ msgstr "" msgid "Snap (Pixels):" msgstr "" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Change default type" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4735,18 +4783,6 @@ msgstr "" msgid "Contextual Help" msgstr "" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "" @@ -5511,6 +5547,64 @@ msgid "No exporter for platform '%s' yet." msgstr "" #: tools/editor/project_export.cpp +msgid "Create Android keystore" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Full name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organization" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "State" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Password" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "at least 6 characters" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "File name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "" @@ -5970,10 +6064,6 @@ msgid "Erase Input Action Event" msgstr "" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "" @@ -6117,7 +6207,7 @@ msgstr "" msgid "Dir.." msgstr "" -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "" @@ -6151,10 +6241,6 @@ msgid "Properties:" msgstr "" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "" @@ -6231,14 +6317,6 @@ msgid "Scene Run Settings" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "" @@ -6247,10 +6325,6 @@ msgid "Error loading scene from %s" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "" @@ -6289,10 +6363,6 @@ msgid "This operation can't be done without a scene." msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "" @@ -6317,10 +6387,6 @@ msgid "Remove Node(s)" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6359,8 +6425,14 @@ msgid "Change Type" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" -msgstr "" +#, fuzzy +msgid "Attach Script" +msgstr "سب سکریپشن بنائیں" + +#: tools/editor/scene_tree_dock.cpp +#, fuzzy +msgid "Clear Script" +msgstr "سب سکریپشن بنائیں" #: tools/editor/scene_tree_dock.cpp msgid "Merge From Scene" @@ -6385,13 +6457,11 @@ msgid "" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." +msgid "Attach a new or existing script for the selected node." msgstr "" -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." msgstr "" #: tools/editor/scene_tree_editor.cpp @@ -6487,6 +6557,10 @@ msgid "Could not create script in filesystem." msgstr "" #: tools/editor/script_create_dialog.cpp +msgid "Error loading script from %s" +msgstr "" + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "" @@ -6499,16 +6573,18 @@ msgid "Invalid base path" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "File exists" +msgid "Invalid extension" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Invalid extension" -msgstr "" +#, fuzzy +msgid "Create new script" +msgstr "سب سکریپشن بنائیں" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" -msgstr "" +#, fuzzy +msgid "Load existing script" +msgstr "سب سکریپشن بنائیں" #: tools/editor/script_create_dialog.cpp msgid "Class Name:" @@ -6519,8 +6595,9 @@ msgid "Built-In Script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" -msgstr "" +#, fuzzy +msgid "Attach Node Script" +msgstr "سب سکریپشن بنائیں" #: tools/editor/script_editor_debugger.cpp msgid "Bytes:" @@ -6685,3 +6762,8 @@ msgstr "" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Notifier Extents" msgstr ".نوٹفئر کے اکسٹنٹ کو تبدیل کیجیۓ" + +#: tools/editor/spatial_editor_gizmos.cpp +#, fuzzy +msgid "Change Probe Extents" +msgstr ".نوٹفئر کے اکسٹنٹ کو تبدیل کیجیۓ" diff --git a/tools/translations/zh_CN.po b/tools/translations/zh_CN.po index 318d4186f3..58f79fac56 100644 --- a/tools/translations/zh_CN.po +++ b/tools/translations/zh_CN.po @@ -1,11 +1,12 @@ # Chinese (China) translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # # 纯洁的坏蛋 <tqj.zyy@gmail.com>, 2016. # 孤月蓝风 <trlanfeng@foxmail.com>, 2016. +# ageazrael <ageazrael@gmail.com>, 2016. # Bruce Guo <guoboism@hotmail.com>, 2016. -# Geequlim <geequlim@gmail.com>, 2016. +# Geequlim <geequlim@gmail.com>, 2016-2017. # Luo Jun <vipsbpig@gmail.com>, 2016. # oberon-tonya <360119124@qq.com>, 2016. # wanfang liu <wanfang.liu@gmail.com>, 2016. @@ -14,8 +15,8 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2016-10-01 09:03+0000\n" -"Last-Translator: oberon-tonya <360119124@qq.com>\n" +"PO-Revision-Date: 2017-01-04 14:55+0000\n" +"Last-Translator: Geequlim <geequlim@gmail.com>\n" "Language-Team: Chinese (China) <https://hosted.weblate.org/projects/godot-" "engine/godot/zh_CN/>\n" "Language: zh_CN\n" @@ -23,7 +24,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 2.9-dev\n" +"X-Generator: Weblate 2.11-dev\n" #: modules/gdscript/gd_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -40,12 +41,6 @@ msgid "step argument is zero!" msgstr "step参数为0!" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" msgstr "脚本没有实例化" @@ -105,7 +100,6 @@ msgid "Stack overflow with stack depth: " msgstr "堆栈深度溢出: " #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Functions:" msgstr "函数:" @@ -118,14 +112,12 @@ msgid "Signals:" msgstr "事件:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Name is not a valid identifier:" msgstr "名称不是有效的标识符:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Name already in use by another func/var/signal:" -msgstr "名称已经被其他的函数/变量/信号占用:" +msgstr "名称已经被其他的函数/变量/事件占用:" #: modules/visual_script/visual_script_editor.cpp msgid "Rename Function" @@ -136,138 +128,120 @@ msgid "Rename Variable" msgstr "重命名变量" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Rename Signal" -msgstr "重命名信号" +msgstr "重命名事件" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Add Function" msgstr "添加函数" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Add Variable" msgstr "添加变量" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Add Signal" -msgstr "添加信号" +msgstr "添加事件" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Remove Function" -msgstr "移除函数" +msgstr "删除函数" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Remove Variable" -msgstr "移除变量" +msgstr "删除变量" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Editing Variable:" msgstr "编辑变量:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Remove Signal" -msgstr "移除信号" +msgstr "删除事件" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Editing Signal:" -msgstr "连接事件:" +msgstr "编辑事件:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Change Expression" -msgstr "更改类型" +msgstr "更改表达式" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Add Node" -msgstr "添加子节点" +msgstr "添加节点" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Hold Meta to drop a Getter. Hold Shift to drop a generic signature." -msgstr "按住Meta键放置一个访问器,按住Shift键放置一个通用签名" +msgstr "按住Meta键放置一个Getter节点,按住Shift键放置一个通用签名。" #: modules/visual_script/visual_script_editor.cpp msgid "Hold Ctrl to drop a Getter. Hold Shift to drop a generic signature." -msgstr "" +msgstr "按住Ctrl键放置一个Getter节点。按住Shift键放置一个通用签名。" #: modules/visual_script/visual_script_editor.cpp msgid "Hold Meta to drop a simple reference to the node." -msgstr "" +msgstr "按住Meta键放置一个场景节点的引用节点。" #: modules/visual_script/visual_script_editor.cpp msgid "Hold Ctrl to drop a simple reference to the node." -msgstr "" +msgstr "按住Ctrl键放置一个场景节点的引用节点。" #: modules/visual_script/visual_script_editor.cpp msgid "Hold Meta to drop a Variable Setter." -msgstr "" +msgstr "按住Meta键放置变量的Setter节点。" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Hold Ctrl to drop a Variable Setter." -msgstr "按住Ctrl键放置一个变量设定器。" +msgstr "按住Ctrl键放置变量的Setter节点。" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Add Preload Node" -msgstr "添加子节点" +msgstr "添加Preload节点" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Add Node(s) From Tree" msgstr "从场景导入节点" #: modules/visual_script/visual_script_editor.cpp msgid "Add Getter Property" -msgstr "添加访问器属性" +msgstr "添加 Getter Property" #: modules/visual_script/visual_script_editor.cpp msgid "Add Setter Property" -msgstr "添加设置器" +msgstr "添加 Setter Property" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Condition" -msgstr "拷贝动画" +msgstr "条件节点(Condition)" #: modules/visual_script/visual_script_editor.cpp msgid "Sequence" -msgstr "" +msgstr "序列节点(Sequence)" #: modules/visual_script/visual_script_editor.cpp msgid "Switch" -msgstr "" +msgstr "选择节点(Switch)" #: modules/visual_script/visual_script_editor.cpp msgid "Iterator" -msgstr "" +msgstr "遍历节点(Iterator)" #: modules/visual_script/visual_script_editor.cpp msgid "While" -msgstr "" +msgstr "条件循环节点(While)" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Return" -msgstr "返回:" +msgstr "返回节点(Return)" #: modules/visual_script/visual_script_editor.cpp tools/editor/call_dialog.cpp msgid "Call" -msgstr "调用" +msgstr "调用到" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Get" -msgstr "设置" +msgstr "获取" #: modules/visual_script/visual_script_editor.cpp #: tools/editor/property_editor.cpp @@ -296,9 +270,8 @@ msgid "Available Nodes:" msgstr "有效节点:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Select or create a function to edit graph" -msgstr "在 edit graph 中选择或者建立一个函数" +msgstr "选择或创建一个函数来编辑图" #: modules/visual_script/visual_script_editor.cpp tools/editor/call_dialog.cpp #: tools/editor/connections_dialog.cpp @@ -314,49 +287,41 @@ msgid "Close" msgstr "关闭" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Edit Signal Arguments:" -msgstr "额外调用参数:" +msgstr "编辑事件参数:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Edit Variable:" -msgstr "变量" +msgstr "编辑变量:" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Change" -msgstr "更改类型" +msgstr "更改" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Delete Selected" -msgstr "删除选中的文件?" +msgstr "删除选择的节点" #: modules/visual_script/visual_script_editor.cpp #: tools/editor/plugins/script_text_editor.cpp msgid "Toggle Breakpoint" -msgstr "切换断点" +msgstr "设置断点" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Find Node Type" -msgstr "查找下一项" +msgstr "查找节点类型" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Copy Nodes" -msgstr "拷贝姿势" +msgstr "复制节点" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Cut Nodes" -msgstr "新节点" +msgstr "剪切节点" #: modules/visual_script/visual_script_editor.cpp -#, fuzzy msgid "Paste Nodes" -msgstr "粘贴姿势" +msgstr "粘贴节点" #: modules/visual_script/visual_script_flow_control.cpp msgid "Input type not iterable: " @@ -371,18 +336,16 @@ msgid "Iterator became invalid: " msgstr "迭代器失效: " #: modules/visual_script/visual_script_func_nodes.cpp -#, fuzzy msgid "Invalid index property name." -msgstr "基类名称非法" +msgstr "属性名称非法" #: modules/visual_script/visual_script_func_nodes.cpp msgid "Base object is not a Node!" msgstr "基础对象不是一个节点!" #: modules/visual_script/visual_script_func_nodes.cpp -#, fuzzy msgid "Path does not lead Node!" -msgstr "必须是项目路径" +msgstr "路径必须指向节点" #: modules/visual_script/visual_script_func_nodes.cpp msgid "Invalid index property name '%s' in node %s." @@ -405,97 +368,93 @@ msgid "VariableSet not found in script: " msgstr "脚本中未找到VariableSet: " #: modules/visual_script/visual_script_nodes.cpp -#, fuzzy msgid "Custom node has no _step() method, can't process graph." -msgstr "自定义节点具备no_step()方法,不能生成图像" +msgstr "自定义脚本节点不包含_step()方法,不能生成图。" #: modules/visual_script/visual_script_nodes.cpp msgid "" "Invalid return value from _step(), must be integer (seq out), or string " "(error)." -msgstr "_step()的返回值无效,必须是整形(seq out),或字符串(error)。" +msgstr "_step()的返回值无效,必须是整形(seq out)或字符串(error)。" #: modules/visual_script/visual_script_nodes.cpp msgid "just pressed" -msgstr "" +msgstr "正好按下" #: modules/visual_script/visual_script_nodes.cpp msgid "just released" -msgstr "" +msgstr "刚好释放" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" -msgstr "" +msgstr "无法读取证书文件。路径和密码是否都正确?" -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." -msgstr "写入项目PCK文件出错!" +msgstr "创建包(PCK)签名对象出错。" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." -msgstr "" +msgstr "创建包(PCK)签名时出错。" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" +"找不到导出模版。\n" +"下载并安装导出模版。" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." msgstr "" -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid unique name." msgstr "名称非法:" -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid product GUID." -msgstr "字体大小非法。" +msgstr "产品GUID非法。" -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." -msgstr "父路径非法" +msgstr "发布GUID非法" -#: platform/winrt/export/export.cpp -#, fuzzy +#: platform/uwp/export/export.cpp msgid "Invalid background color." -msgstr "自定义字体文件非法。" +msgstr "无效的背景颜色。" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." -msgstr "" +msgstr "Logo图片尺寸无效(图像尺寸必须是50x50)。" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" @@ -620,10 +579,6 @@ msgid "" "as parent." msgstr "VisibilityEnable2D类型的节点用于场景的根节点才能获得最好的效果。" -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "BakedLightInstance未包含BakedLight资源。" - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -666,9 +621,8 @@ msgstr "" "NavigationMeshInstance类型节点必须作为Navigation节点的子孙才能提供导航数据。" #: scene/3d/remote_transform.cpp -#, fuzzy msgid "Path property must point to a valid Spatial node to work." -msgstr "path属性必须指向一个合法的Particles2D节点才能正常工作。" +msgstr "path属性必须指向一个合法的Spatial节点才能正常工作。" #: scene/3d/scenario_fx.cpp msgid "" @@ -695,7 +649,8 @@ msgstr "" msgid "Cancel" msgstr "取消" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "好的" @@ -897,7 +852,6 @@ msgstr "" "行时它们会自动隐藏。" #: scene/main/viewport.cpp -#, fuzzy msgid "" "This viewport is not set as render target. If you intend for it to display " "its contents directly to the screen, make it a child of a Control so it can " @@ -933,7 +887,6 @@ msgid "Disabled" msgstr "已禁用" #: tools/editor/animation_editor.cpp -#, fuzzy msgid "All Selection" msgstr "所有选中项" @@ -986,12 +939,10 @@ msgid "Anim Track Rename" msgstr "重命名轨道" #: tools/editor/animation_editor.cpp -#, fuzzy msgid "Anim Track Change Interpolation" msgstr "轨道修改为插值模式" #: tools/editor/animation_editor.cpp -#, fuzzy msgid "Anim Track Change Value Mode" msgstr "轨道修改为值模式" @@ -1131,7 +1082,6 @@ msgid "Change Anim Loop" msgstr "修改动画循环" #: tools/editor/animation_editor.cpp -#, fuzzy msgid "Anim Create Typed Value Key" msgstr "创建输入值的动画关键帧" @@ -1200,7 +1150,6 @@ msgid "Anim. Optimizer" msgstr "优化动画" #: tools/editor/animation_editor.cpp -#, fuzzy msgid "Max. Linear Error:" msgstr "最大线性错误:" @@ -1481,7 +1430,6 @@ msgid "Make Function" msgstr "创建方法" #: tools/editor/connections_dialog.cpp -#, fuzzy msgid "Deferred" msgstr "延时" @@ -1502,7 +1450,6 @@ msgid "Connecting Signal:" msgstr "连接事件:" #: tools/editor/connections_dialog.cpp -#, fuzzy msgid "Create Subscription" msgstr "创建订阅" @@ -1851,6 +1798,11 @@ msgid "Constants:" msgstr "常量:" #: tools/editor/editor_help.cpp +#, fuzzy +msgid "Property Description:" +msgstr "简介:" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "方法描述:" @@ -1892,7 +1844,7 @@ msgstr "配置.." #: tools/editor/editor_log.cpp msgid " Output:" -msgstr "输出" +msgstr " 输出" #: tools/editor/editor_node.cpp tools/editor/editor_reimport_dialog.cpp msgid "Re-Importing" @@ -1918,7 +1870,9 @@ msgstr "保存资源出错!" msgid "Save Resource As.." msgstr "资源另存为.." -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "好吧.." @@ -2013,12 +1967,10 @@ msgid "Copy Resource" msgstr "拷贝资源" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Make Built-In" msgstr "使之内置" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Make Sub-Resources Unique" msgstr "使子资源唯一化" @@ -2151,7 +2103,9 @@ msgstr "退出到项目管理窗口(未保存的修改将丢失)?" msgid "Pick a Main Scene" msgstr "选择主场景" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "额" @@ -2289,7 +2243,6 @@ msgid "Quit to Project List" msgstr "退出到项目列表" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Distraction Free Mode" msgstr "无干扰模式" @@ -2310,7 +2263,6 @@ msgid "Import" msgstr "导入" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Miscellaneous project or scene-wide tools." msgstr "其他工程或全场景工具" @@ -2462,7 +2414,6 @@ msgid "Editor Layout" msgstr "编辑器布局" #: tools/editor/editor_node.cpp -#, fuzzy msgid "Toggle Fullscreen" msgstr "全屏模式" @@ -2635,12 +2586,10 @@ msgid "Time:" msgstr "时间:" #: tools/editor/editor_profiler.cpp -#, fuzzy msgid "Inclusive" msgstr "包含" #: tools/editor/editor_profiler.cpp -#, fuzzy msgid "Self" msgstr "自身" @@ -2846,6 +2795,7 @@ msgstr "源贴图:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "目标路径:" @@ -2871,7 +2821,6 @@ msgid "No target font resource!" msgstr "请设置目标字体资源!" #: tools/editor/io_plugins/editor_font_import_plugin.cpp -#, fuzzy msgid "" "Invalid file extension.\n" "Please use .fnt." @@ -2977,7 +2926,6 @@ msgid "Audio Sample" msgstr "音效" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp -#, fuzzy msgid "New Clip" msgstr "新片段" @@ -2998,32 +2946,26 @@ msgid "Optimizer" msgstr "优化" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp -#, fuzzy msgid "Max Linear Error" msgstr "最大线性误差" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp -#, fuzzy msgid "Max Angular Error" msgstr "最大角度误差" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp -#, fuzzy msgid "Max Angle" msgstr "最大角度" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp -#, fuzzy msgid "Clips" -msgstr "剪辑" +msgstr "片段" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp -#, fuzzy msgid "Start(s)" msgstr "起点" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp -#, fuzzy msgid "End(s)" msgstr "终点" @@ -3041,12 +2983,10 @@ msgid "Source path is empty." msgstr "源路径为空。" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp -#, fuzzy msgid "Couldn't load post-import script." msgstr "无法载入后导入脚本" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp -#, fuzzy msgid "Invalid/broken script for post-import." msgstr "后导入脚本被损坏或不合法" @@ -3075,7 +3015,6 @@ msgid "Target Texture Folder:" msgstr "目标贴图目录:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp -#, fuzzy msgid "Post-Process Script:" msgstr "后处理脚本:" @@ -3088,6 +3027,10 @@ msgid "Auto" msgstr "自动" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +msgid "Root Node Name:" +msgstr "节点名称:" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "找不到下列文件:" @@ -3117,17 +3060,14 @@ msgid "Running Custom Script.." msgstr "执行自定义脚本.." #: tools/editor/io_plugins/editor_scene_import_plugin.cpp -#, fuzzy msgid "Couldn't load post-import script:" msgstr "无法载入后导入脚本:" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp -#, fuzzy msgid "Invalid/broken script for post-import (check console):" msgstr "后处理脚本被损坏或不合法(查看控制台):" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp -#, fuzzy msgid "Error running post-import script:" msgstr "后处理脚本运行发生错误" @@ -3384,7 +3324,6 @@ msgid "Translation" msgstr "语言" #: tools/editor/multi_node_edit.cpp -#, fuzzy msgid "MultiNode Set" msgstr "多节点组" @@ -3496,7 +3435,6 @@ msgid "Animation position (in seconds)." msgstr "动画位置(单位:秒)" #: tools/editor/plugins/animation_player_editor_plugin.cpp -#, fuzzy msgid "Scale animation playback globally for the node." msgstr "节点全局缩放动画回放" @@ -3827,9 +3765,8 @@ msgid "Paste Pose" msgstr "粘贴姿势" #: tools/editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Select Mode" -msgstr "选择模式(Q)" +msgstr "选择模式" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Drag: Rotate" @@ -3848,14 +3785,12 @@ msgid "Alt+RMB: Depth list selection" msgstr "Alt+鼠标右键:显示鼠标点击位置下的所有节点列表" #: tools/editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Move Mode" -msgstr "移动模式(W)" +msgstr "移动模式" #: tools/editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Rotate Mode" -msgstr "旋转模式(E)" +msgstr "旋转模式" #: tools/editor/plugins/canvas_item_editor_plugin.cpp #: tools/editor/plugins/spatial_editor_plugin.cpp @@ -3932,9 +3867,8 @@ msgid "Clear Bones" msgstr "清除骨骼" #: tools/editor/plugins/canvas_item_editor_plugin.cpp -#, fuzzy msgid "Show Bones" -msgstr "添加骨骼" +msgstr "显示骨骼" #: tools/editor/plugins/canvas_item_editor_plugin.cpp msgid "Make IK Chain" @@ -3997,6 +3931,49 @@ msgstr "设置值" msgid "Snap (Pixels):" msgstr "吸附(像素):" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "添加 %s" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "新节点" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "从%s实例化场景出错!" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "好吧" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "没有选中节点来添加实例。" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "此操作只能应用于单个选中节点。" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Change default type" +msgstr "修改默认值" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4671,14 +4648,12 @@ msgid "Save Theme As" msgstr "主题另存为" #: tools/editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Close Docs" -msgstr "拷贝到下一行" +msgstr "关闭文档" #: tools/editor/plugins/script_editor_plugin.cpp -#, fuzzy msgid "Close All" -msgstr "关闭" +msgstr "关闭全部" #: tools/editor/plugins/script_editor_plugin.cpp #: tools/editor/plugins/script_text_editor.cpp @@ -4788,12 +4763,11 @@ msgstr "调试器" #: tools/editor/plugins/script_editor_plugin.cpp msgid "" "Built-in scripts can only be edited when the scene they belong to is loaded" -msgstr "" +msgstr "内建脚本只有在其所属的节点读取后才能被修改" #: tools/editor/plugins/script_text_editor.cpp -#, fuzzy msgid "Pick Color" -msgstr "颜色" +msgstr "拾取颜色" #: tools/editor/plugins/script_text_editor.cpp tools/editor/scene_tree_dock.cpp msgid "Move Up" @@ -4866,29 +4840,17 @@ msgstr "前往行.." msgid "Contextual Help" msgstr "搜索光标位置" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "顶点" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "片段" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "光照" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" -msgstr "" +msgstr "修改Scalar常量系数" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Vec Constant" -msgstr "" +msgstr "修改Vec常量系数" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change RGB Constant" -msgstr "" +msgstr "修改RGB常量系数" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Operator" @@ -4936,15 +4898,15 @@ msgstr "修改默认值" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change XForm Uniform" -msgstr "修改Uniform XForm " +msgstr "修改Uniform XForm" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Texture Uniform" -msgstr "修改Uniform Texture " +msgstr "修改Uniform纹理" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Cubemap Uniform" -msgstr "修改Uniform Cubemap " +msgstr "修改Uniform Cubemap" #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Comment" @@ -5143,38 +5105,34 @@ msgid "Bottom View" msgstr "" #: tools/editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Top View" -msgstr "视图" +msgstr "Top视图" #: tools/editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Rear View" -msgstr "视图" +msgstr "Rear视图" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Front View" -msgstr "" +msgstr "正面视图" #: tools/editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Left View" -msgstr "视图" +msgstr "左视图" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Right View" -msgstr "" +msgstr "右视图" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Switch Perspective/Orthogonal view" -msgstr "" +msgstr "切换投影(正交)视图" #: tools/editor/plugins/spatial_editor_plugin.cpp msgid "Insert Animation Key" msgstr "插入动画帧" #: tools/editor/plugins/spatial_editor_plugin.cpp -#, fuzzy msgid "Focus Origin" msgstr "显示原点" @@ -5444,9 +5402,8 @@ msgid "Remove Item" msgstr "移除项目" #: tools/editor/plugins/theme_editor_plugin.cpp -#, fuzzy msgid "Theme" -msgstr "保存主题" +msgstr "主题" #: tools/editor/plugins/theme_editor_plugin.cpp msgid "Add Class Items" @@ -5645,6 +5602,71 @@ msgid "No exporter for platform '%s' yet." msgstr "没有针对'%s'平台的导出模板。" #: tools/editor/project_export.cpp +#, fuzzy +msgid "Create Android keystore" +msgstr "创建资源" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Full name" +msgstr "名称可用" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Organization" +msgstr "过渡" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "State" +msgstr "状态" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Password" +msgstr "密码" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "at least 6 characters" +msgstr "字符合法:" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "File name" +msgstr "新名称:" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "包含" @@ -5962,12 +5984,10 @@ msgid "Unnamed Project" msgstr "未命名项目" #: tools/editor/project_manager.cpp -#, fuzzy msgid "Are you sure to open more than one project?" msgstr "您确定要打开多个项目吗?" #: tools/editor/project_manager.cpp -#, fuzzy msgid "Are you sure to run more than one project?" msgstr "您确定要执行多个项目吗?" @@ -5979,7 +5999,7 @@ msgstr "移除此项目(项目的文件不受影响)" msgid "" "You are about the scan %s folders for existing Godot projects. Do you " "confirm?" -msgstr "" +msgstr "您确认要扫描%s目录下现有的Godot项目吗?" #: tools/editor/project_manager.cpp msgid "Project Manager" @@ -5998,9 +6018,8 @@ msgid "Scan" msgstr "扫描" #: tools/editor/project_manager.cpp -#, fuzzy msgid "Select a Folder to Scan" -msgstr "选择一个节点" +msgstr "选择要扫描的目录" #: tools/editor/project_manager.cpp msgid "New Project" @@ -6012,7 +6031,7 @@ msgstr "退出" #: tools/editor/project_settings.cpp msgid "Key " -msgstr "键" +msgstr "键 " #: tools/editor/project_settings.cpp msgid "Joy Button" @@ -6028,7 +6047,7 @@ msgstr "鼠标按键:" #: tools/editor/project_settings.cpp msgid "Invalid action (anything goes but '/' or ':')." -msgstr "" +msgstr "Action名非法(不得包含'/'或':')" #: tools/editor/project_settings.cpp msgid "Action '%s' already exists!" @@ -6107,10 +6126,6 @@ msgid "Erase Input Action Event" msgstr "移除输入事件" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "保存设置出错。" @@ -6227,22 +6242,18 @@ msgid "Preset.." msgstr "预设.." #: tools/editor/property_editor.cpp -#, fuzzy msgid "Ease In" msgstr "缓入" #: tools/editor/property_editor.cpp -#, fuzzy msgid "Ease Out" msgstr "缓出" #: tools/editor/property_editor.cpp -#, fuzzy msgid "Zero" msgstr "置零" #: tools/editor/property_editor.cpp -#, fuzzy msgid "Easing In-Out" msgstr "缓入缓出" @@ -6258,7 +6269,7 @@ msgstr "文件.." msgid "Dir.." msgstr "目录.." -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "加载" @@ -6267,9 +6278,8 @@ msgid "Assign" msgstr "" #: tools/editor/property_editor.cpp -#, fuzzy msgid "New Script" -msgstr "下一个脚本" +msgstr "新建脚本" #: tools/editor/property_editor.cpp msgid "Error loading file: Not a resource!" @@ -6292,22 +6302,16 @@ msgid "Properties:" msgstr "属性:" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "全局" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "选项:" #: tools/editor/property_selector.cpp -#, fuzzy msgid "Select Property" -msgstr "选择顶点" +msgstr "选择属性" #: tools/editor/property_selector.cpp -#, fuzzy msgid "Select Method" -msgstr "选择模式(Q)" +msgstr "选择方式" #: tools/editor/pvrtc_compress.cpp msgid "Could not execute PVRTC tool:" @@ -6374,15 +6378,6 @@ msgid "Scene Run Settings" msgstr "场景运行设置" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "好吧" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "没有选中节点来添加实例。" - -#: tools/editor/scene_tree_dock.cpp -#, fuzzy msgid "No parent to instance the scenes at." msgstr "没有选中节点来添加实例。" @@ -6391,10 +6386,6 @@ msgid "Error loading scene from %s" msgstr "从%s加载场景出错!" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "从%s实例化场景出错!" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "好的" @@ -6433,10 +6424,6 @@ msgid "This operation can't be done without a scene." msgstr "此操作必须在打开一个场景后才能执行。" #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "此操作只能应用于单个选中节点。" - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "此操作不能应用于实例化的场景。" @@ -6461,10 +6448,6 @@ msgid "Remove Node(s)" msgstr "移除节点" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "新节点" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6503,10 +6486,14 @@ msgid "Change Type" msgstr "更改类型" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" +msgid "Attach Script" msgstr "添加脚本" #: tools/editor/scene_tree_dock.cpp +msgid "Clear Script" +msgstr "清除脚本" + +#: tools/editor/scene_tree_dock.cpp msgid "Merge From Scene" msgstr "从场景中合并" @@ -6515,9 +6502,8 @@ msgid "Save Branch as Scene" msgstr "将分支保存为场景" #: tools/editor/scene_tree_dock.cpp -#, fuzzy msgid "Delete (No Confirm)" -msgstr "请确认..." +msgstr "确认删除" #: tools/editor/scene_tree_dock.cpp msgid "Add/Create a New Node" @@ -6530,15 +6516,12 @@ msgid "" msgstr "实例化场景文件为一个节点,如果没有根节点则创建一个继承自该文件的场景。" #: tools/editor/scene_tree_dock.cpp -#, fuzzy -msgid "Create a new script for the selected node." -msgstr "将选中的场景实例为选中节点的子节点。" +msgid "Attach a new or existing script for the selected node." +msgstr "为选中节点创建或设置脚本" -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." -msgstr "无法显示此节点,请先取消隐藏其父节点。" +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." +msgstr "清除选中节点的脚本" #: tools/editor/scene_tree_editor.cpp msgid "Toggle Spatial Visible" @@ -6633,6 +6616,10 @@ msgid "Could not create script in filesystem." msgstr "无法创建脚本。" #: tools/editor/script_create_dialog.cpp +msgid "Error loading script from %s" +msgstr "从%s加载脚本出错!" + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "文件路径为空" @@ -6645,16 +6632,16 @@ msgid "Invalid base path" msgstr "父路径非法" #: tools/editor/script_create_dialog.cpp -msgid "File exists" -msgstr "文件已存在" - -#: tools/editor/script_create_dialog.cpp msgid "Invalid extension" msgstr "扩展名非法" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" -msgstr "路径可用" +msgid "Create new script" +msgstr "创建新脚本" + +#: tools/editor/script_create_dialog.cpp +msgid "Load existing script" +msgstr "加载现有脚本" #: tools/editor/script_create_dialog.cpp msgid "Class Name:" @@ -6665,8 +6652,8 @@ msgid "Built-In Script" msgstr "内置脚本" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" -msgstr "创建脚本" +msgid "Attach Node Script" +msgstr "设置节点的脚本" #: tools/editor/script_editor_debugger.cpp msgid "Bytes:" @@ -6730,11 +6717,11 @@ msgstr "即时场景树:" #: tools/editor/script_editor_debugger.cpp msgid "Remote Object Properties: " -msgstr "远程对象属性。" +msgstr "远程对象属性: " #: tools/editor/script_editor_debugger.cpp msgid "Profiler" -msgstr "" +msgstr "性能分析" #: tools/editor/script_editor_debugger.cpp msgid "Monitor" @@ -6814,7 +6801,7 @@ msgstr "更改球体半径" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Box Shape Extents" -msgstr "" +msgstr "改变方框大小" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Capsule Shape Radius" @@ -6825,15 +6812,50 @@ msgid "Change Capsule Shape Height" msgstr "更改胶囊高度" #: tools/editor/spatial_editor_gizmos.cpp -#, fuzzy msgid "Change Ray Shape Length" msgstr "更改射线形状长度" #: tools/editor/spatial_editor_gizmos.cpp -#, fuzzy msgid "Change Notifier Extents" msgstr "更改通知器级别" +#: tools/editor/spatial_editor_gizmos.cpp +#, fuzzy +msgid "Change Probe Extents" +msgstr "更改通知器级别" + +#~ msgid "BakedLightInstance does not contain a BakedLight resource." +#~ msgstr "BakedLightInstance未包含BakedLight资源。" + +#~ msgid "Vertex" +#~ msgstr "顶点" + +#~ msgid "Fragment" +#~ msgstr "片段" + +#~ msgid "Lighting" +#~ msgstr "光照" + +#~ msgid "Global" +#~ msgstr "全局" + +#~ msgid "" +#~ "This item cannot be made visible because the parent is hidden. Unhide the " +#~ "parent first." +#~ msgstr "无法显示此节点,请先取消隐藏其父节点。" + +#~ msgid "" +#~ "Paths cannot start with '/', absolute paths must start with 'res://', " +#~ "'user://', or 'local://'" +#~ msgstr "" +#~ "路径不能以'/'符号打头,绝对路径必须以'res://'、'user://'或者'local://'打头" + +#~ msgid "File exists" +#~ msgstr "文件已存在" + +#~ msgid "Valid path" +#~ msgstr "路径可用" + #~ msgid "Cannot go into subdir:" #~ msgstr "无法打开目录:" diff --git a/tools/translations/zh_HK.po b/tools/translations/zh_HK.po index 9f6d7786ac..60f2b51464 100644 --- a/tools/translations/zh_HK.po +++ b/tools/translations/zh_HK.po @@ -1,5 +1,5 @@ # Chinese (Honk Kong) translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # # Wesley (zx-wt) <ZX_WT@ymail.com>, 2016. @@ -33,12 +33,6 @@ msgid "step argument is zero!" msgstr "" #: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" - -#: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" msgstr "" @@ -391,76 +385,76 @@ msgstr "" msgid "just released" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid unique name." msgstr "無效名稱" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp #, fuzzy msgid "Invalid product GUID." msgstr "無效字型" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid background color." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" @@ -568,10 +562,6 @@ msgid "" "as parent." msgstr "" -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "" - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -631,7 +621,8 @@ msgstr "" msgid "Cancel" msgstr "取消" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "OK" @@ -1785,6 +1776,10 @@ msgid "Constants:" msgstr "" #: tools/editor/editor_help.cpp +msgid "Property Description:" +msgstr "" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "" @@ -1852,7 +1847,9 @@ msgstr "" msgid "Save Resource As.." msgstr "把資源另存為..." -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "如來如此" @@ -2080,7 +2077,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "選擇主場景" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "" @@ -2761,6 +2760,7 @@ msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "" @@ -2988,6 +2988,10 @@ msgid "Auto" msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +msgid "Root Node Name:" +msgstr "" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "" @@ -3887,6 +3891,49 @@ msgstr "" msgid "Snap (Pixels):" msgstr "" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "OK :(" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Change default type" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4753,18 +4800,6 @@ msgstr "" msgid "Contextual Help" msgstr "" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "" @@ -5528,6 +5563,70 @@ msgid "No exporter for platform '%s' yet." msgstr "" #: tools/editor/project_export.cpp +#, fuzzy +msgid "Create Android keystore" +msgstr "新增資料夾" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Full name" +msgstr "有效名稱" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Organization" +msgstr "本地化" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "State" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "Password" +msgstr "密碼:" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "at least 6 characters" +msgstr "有效字符:" + +#: tools/editor/project_export.cpp +#, fuzzy +msgid "File name" +msgstr "有效名稱" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "包括" @@ -5987,10 +6086,6 @@ msgid "Erase Input Action Event" msgstr "" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "" @@ -6134,7 +6229,7 @@ msgstr "" msgid "Dir.." msgstr "" -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "" @@ -6168,10 +6263,6 @@ msgid "Properties:" msgstr "" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "" @@ -6250,14 +6341,6 @@ msgid "Scene Run Settings" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "OK :(" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "" @@ -6266,10 +6349,6 @@ msgid "Error loading scene from %s" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "Ok" @@ -6308,10 +6387,6 @@ msgid "This operation can't be done without a scene." msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "" @@ -6336,10 +6411,6 @@ msgid "Remove Node(s)" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6378,8 +6449,14 @@ msgid "Change Type" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" -msgstr "" +#, fuzzy +msgid "Attach Script" +msgstr "腳本" + +#: tools/editor/scene_tree_dock.cpp +#, fuzzy +msgid "Clear Script" +msgstr "下一個腳本" #: tools/editor/scene_tree_dock.cpp msgid "Merge From Scene" @@ -6404,13 +6481,11 @@ msgid "" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." +msgid "Attach a new or existing script for the selected node." msgstr "" -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." msgstr "" #: tools/editor/scene_tree_editor.cpp @@ -6506,6 +6581,11 @@ msgid "Could not create script in filesystem." msgstr "" #: tools/editor/script_create_dialog.cpp +#, fuzzy +msgid "Error loading script from %s" +msgstr "載入字形出現錯誤" + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "路徑為空" @@ -6518,16 +6598,18 @@ msgid "Invalid base path" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "File exists" -msgstr "檔案已存在" - -#: tools/editor/script_create_dialog.cpp msgid "Invalid extension" msgstr "無效副檔名" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" -msgstr "有效路徑" +#, fuzzy +msgid "Create new script" +msgstr "新增" + +#: tools/editor/script_create_dialog.cpp +#, fuzzy +msgid "Load existing script" +msgstr "下一個腳本" #: tools/editor/script_create_dialog.cpp msgid "Class Name:" @@ -6538,8 +6620,9 @@ msgid "Built-In Script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" -msgstr "" +#, fuzzy +msgid "Attach Node Script" +msgstr "下一個腳本" #: tools/editor/script_editor_debugger.cpp msgid "Bytes:" @@ -6706,6 +6789,16 @@ msgstr "" msgid "Change Notifier Extents" msgstr "" +#: tools/editor/spatial_editor_gizmos.cpp +msgid "Change Probe Extents" +msgstr "" + +#~ msgid "File exists" +#~ msgstr "檔案已存在" + +#~ msgid "Valid path" +#~ msgstr "有效路徑" + #~ msgid "Cannot go into subdir:" #~ msgstr "無法進入次要資料夾" diff --git a/tools/translations/zh_TW.po b/tools/translations/zh_TW.po index af66795003..efad7ee167 100644 --- a/tools/translations/zh_TW.po +++ b/tools/translations/zh_TW.po @@ -1,21 +1,22 @@ # Chinese (Taiwan) translation of the Godot Engine editor -# Copyright (C) 2016 Juan Linietsky, Ariel Manzur and the Godot community +# Copyright (C) 2016-2017 Juan Linietsky, Ariel Manzur and the Godot community # This file is distributed under the same license as the Godot source code. # # popcade <popcade@gmail.com>, 2016. +# Sam Pan <sampan66@gmail.com>, 2016. # msgid "" msgstr "" "Project-Id-Version: Godot Engine editor\n" -"PO-Revision-Date: 2016-06-13 13:57+0000\n" -"Last-Translator: popcade <popcade@gmail.com>\n" +"PO-Revision-Date: 2016-10-23 19:47+0000\n" +"Last-Translator: Sam Pan <sampan66@gmail.com>\n" "Language-Team: Chinese (Taiwan) <https://hosted.weblate.org/projects/godot-" "engine/godot/zh_TW/>\n" "Language: zh_TW\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8-bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 2.7-dev\n" +"X-Generator: Weblate 2.9-dev\n" #: modules/gdscript/gd_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp @@ -25,41 +26,40 @@ msgstr "" #: modules/gdscript/gd_functions.cpp #: modules/visual_script/visual_script_builtin_funcs.cpp msgid "Not enough bytes for decoding bytes, or invalid format." -msgstr "" +msgstr "解碼字節位元不足,或為無效格式。" #: modules/gdscript/gd_functions.cpp msgid "step argument is zero!" -msgstr "" - -#: modules/gdscript/gd_functions.cpp -msgid "" -"Paths cannot start with '/', absolute paths must start with 'res://', " -"'user://', or 'local://'" -msgstr "" +msgstr "step引數為0!" #: modules/gdscript/gd_functions.cpp msgid "Not a script with an instance" -msgstr "" +msgstr "非為單一事件腳本" #: modules/gdscript/gd_functions.cpp +#, fuzzy msgid "Not based on a script" -msgstr "" +msgstr "未依據腳本" #: modules/gdscript/gd_functions.cpp +#, fuzzy msgid "Not based on a resource file" -msgstr "" +msgstr "未依據資源檔案" #: modules/gdscript/gd_functions.cpp +#, fuzzy msgid "Invalid instance dictionary format (missing @path)" -msgstr "" +msgstr "無效的事件詞典格式(遺失 @path)" #: modules/gdscript/gd_functions.cpp +#, fuzzy msgid "Invalid instance dictionary format (can't load script at @path)" -msgstr "" +msgstr "無效的事件詞典格式(無法載入腳本 @path)" #: modules/gdscript/gd_functions.cpp +#, fuzzy msgid "Invalid instance dictionary format (invalid script at @path)" -msgstr "" +msgstr "無效的事件詞典格式(無效的腳本 @path)" #: modules/gdscript/gd_functions.cpp msgid "Invalid instance dictionary (invalid subclasses)" @@ -78,14 +78,16 @@ msgid "" msgstr "" #: modules/visual_script/visual_script.cpp +#, fuzzy msgid "" "Return value must be assigned to first element of node working memory! Fix " "your node please." -msgstr "" +msgstr "回傳值需被指定為運算記憶體節點的第一要素!請修正該節點。" #: modules/visual_script/visual_script.cpp +#, fuzzy msgid "Node returned an invalid sequence output: " -msgstr "" +msgstr "節點回傳一個無效的連續輸出: " #: modules/visual_script/visual_script.cpp msgid "Found sequence bit but not the node in the stack, report bug!" @@ -381,74 +383,74 @@ msgstr "" msgid "just released" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "Couldn't read the certficate file. Are the path and password both correct?" msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the signature object." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Error creating the package signature." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "" "No export templates found.\n" "Download and install export templates." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom debug package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Custom release package not found." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid unique name." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid product GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid publisher GUID." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid background color." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid Store Logo image dimensions (should be 50x50)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 44x44 logo image dimensions (should be 44x44)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 71x71 logo image dimensions (should be 71x71)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 150x150 logo image dimensions (should be 150x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid square 310x310 logo image dimensions (should be 310x310)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)." msgstr "" -#: platform/winrt/export/export.cpp +#: platform/uwp/export/export.cpp msgid "Invalid splash screen image dimensions (should be 620x300)." msgstr "" @@ -562,10 +564,6 @@ msgid "" "as parent." msgstr "" -#: scene/3d/baked_light_instance.cpp -msgid "BakedLightInstance does not contain a BakedLight resource." -msgstr "" - #: scene/3d/body_shape.cpp msgid "" "CollisionShape only serves to provide a collision shape to a CollisionObject " @@ -625,7 +623,8 @@ msgstr "" msgid "Cancel" msgstr "" -#: scene/gui/dialogs.cpp tools/editor/scene_tree_dock.cpp +#: scene/gui/dialogs.cpp tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "OK" msgstr "" @@ -1768,6 +1767,10 @@ msgid "Constants:" msgstr "" #: tools/editor/editor_help.cpp +msgid "Property Description:" +msgstr "" + +#: tools/editor/editor_help.cpp msgid "Method Description:" msgstr "" @@ -1835,7 +1838,9 @@ msgstr "" msgid "Save Resource As.." msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp msgid "I see.." msgstr "" @@ -2060,7 +2065,9 @@ msgstr "" msgid "Pick a Main Scene" msgstr "" -#: tools/editor/editor_node.cpp tools/editor/scene_tree_dock.cpp +#: tools/editor/editor_node.cpp +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp tools/editor/script_create_dialog.cpp msgid "Ugh" msgstr "" @@ -2740,6 +2747,7 @@ msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp #: tools/editor/io_plugins/editor_texture_import_plugin.cpp #: tools/editor/io_plugins/editor_translation_import_plugin.cpp +#: tools/editor/project_export.cpp msgid "Target Path:" msgstr "" @@ -2967,6 +2975,10 @@ msgid "Auto" msgstr "" #: tools/editor/io_plugins/editor_scene_import_plugin.cpp +msgid "Root Node Name:" +msgstr "" + +#: tools/editor/io_plugins/editor_scene_import_plugin.cpp msgid "The Following Files are Missing:" msgstr "" @@ -3866,6 +3878,49 @@ msgstr "" msgid "Snap (Pixels):" msgstr "" +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Add %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Adding %s..." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Create Node" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "Error instancing scene from %s" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "OK :(" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "No parent to instance a child at." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +#: tools/editor/scene_tree_dock.cpp +msgid "This operation requires a single selected node." +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "Change default type" +msgstr "" + +#: tools/editor/plugins/canvas_item_editor_plugin.cpp +msgid "" +"Drag & drop + Shift : Add node as sibling\n" +"Drag & drop + Alt : Change node type" +msgstr "" + #: tools/editor/plugins/collision_polygon_2d_editor_plugin.cpp #: tools/editor/plugins/light_occluder_2d_editor_plugin.cpp #: tools/editor/plugins/navigation_polygon_editor_plugin.cpp @@ -4730,18 +4785,6 @@ msgstr "" msgid "Contextual Help" msgstr "" -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Vertex" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Fragment" -msgstr "" - -#: tools/editor/plugins/shader_editor_plugin.cpp -msgid "Lighting" -msgstr "" - #: tools/editor/plugins/shader_graph_editor_plugin.cpp msgid "Change Scalar Constant" msgstr "" @@ -5504,6 +5547,64 @@ msgid "No exporter for platform '%s' yet." msgstr "" #: tools/editor/project_export.cpp +msgid "Create Android keystore" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Full name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organizational unit" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Organization" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "City" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "State" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "2 letter country code" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "User alias" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Password" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "at least 6 characters" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "File name" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Path : (better to save outside of project)" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "" +"Release keystore is not set.\n" +"Do you want to create one?" +msgstr "" + +#: tools/editor/project_export.cpp +msgid "Fill Keystore/Release User and Release Password" +msgstr "" + +#: tools/editor/project_export.cpp msgid "Include" msgstr "" @@ -5963,10 +6064,6 @@ msgid "Erase Input Action Event" msgstr "" #: tools/editor/project_settings.cpp -msgid "Toggle Persisting" -msgstr "" - -#: tools/editor/project_settings.cpp msgid "Error saving settings." msgstr "" @@ -6110,7 +6207,7 @@ msgstr "" msgid "Dir.." msgstr "" -#: tools/editor/property_editor.cpp +#: tools/editor/property_editor.cpp tools/editor/script_create_dialog.cpp msgid "Load" msgstr "" @@ -6143,10 +6240,6 @@ msgid "Properties:" msgstr "" #: tools/editor/property_editor.cpp -msgid "Global" -msgstr "" - -#: tools/editor/property_editor.cpp msgid "Sections:" msgstr "" @@ -6223,14 +6316,6 @@ msgid "Scene Run Settings" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "OK :(" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp -msgid "No parent to instance a child at." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "No parent to instance the scenes at." msgstr "" @@ -6239,10 +6324,6 @@ msgid "Error loading scene from %s" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Error instancing scene from %s" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "Ok" msgstr "" @@ -6281,10 +6362,6 @@ msgid "This operation can't be done without a scene." msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "This operation requires a single selected node." -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "This operation can't be done on instanced scenes." msgstr "" @@ -6309,10 +6386,6 @@ msgid "Remove Node(s)" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create Node" -msgstr "" - -#: tools/editor/scene_tree_dock.cpp msgid "" "Couldn't save new scene. Likely dependencies (instances) couldn't be " "satisfied." @@ -6351,7 +6424,11 @@ msgid "Change Type" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Add Script" +msgid "Attach Script" +msgstr "" + +#: tools/editor/scene_tree_dock.cpp +msgid "Clear Script" msgstr "" #: tools/editor/scene_tree_dock.cpp @@ -6377,13 +6454,11 @@ msgid "" msgstr "" #: tools/editor/scene_tree_dock.cpp -msgid "Create a new script for the selected node." +msgid "Attach a new or existing script for the selected node." msgstr "" -#: tools/editor/scene_tree_editor.cpp -msgid "" -"This item cannot be made visible because the parent is hidden. Unhide the " -"parent first." +#: tools/editor/scene_tree_dock.cpp +msgid "Clear a script for the selected node." msgstr "" #: tools/editor/scene_tree_editor.cpp @@ -6479,6 +6554,10 @@ msgid "Could not create script in filesystem." msgstr "" #: tools/editor/script_create_dialog.cpp +msgid "Error loading script from %s" +msgstr "" + +#: tools/editor/script_create_dialog.cpp msgid "Path is empty" msgstr "" @@ -6491,15 +6570,15 @@ msgid "Invalid base path" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "File exists" +msgid "Invalid extension" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Invalid extension" +msgid "Create new script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Valid path" +msgid "Load existing script" msgstr "" #: tools/editor/script_create_dialog.cpp @@ -6511,7 +6590,7 @@ msgid "Built-In Script" msgstr "" #: tools/editor/script_create_dialog.cpp -msgid "Create Node Script" +msgid "Attach Node Script" msgstr "" #: tools/editor/script_editor_debugger.cpp @@ -6591,44 +6670,48 @@ msgid "Value" msgstr "" #: tools/editor/script_editor_debugger.cpp +#, fuzzy msgid "Monitors" -msgstr "" +msgstr "監看畫面" #: tools/editor/script_editor_debugger.cpp +#, fuzzy msgid "List of Video Memory Usage by Resource:" -msgstr "" +msgstr "影片記憶體使用容量列表(依資源別):" #: tools/editor/script_editor_debugger.cpp msgid "Total:" -msgstr "" +msgstr "總計:" #: tools/editor/script_editor_debugger.cpp msgid "Video Mem" -msgstr "" +msgstr "影片記憶體" #: tools/editor/script_editor_debugger.cpp msgid "Resource Path" -msgstr "" +msgstr "資源路徑" #: tools/editor/script_editor_debugger.cpp msgid "Type" -msgstr "" +msgstr "類型" #: tools/editor/script_editor_debugger.cpp msgid "Usage" -msgstr "" +msgstr "使用量" #: tools/editor/script_editor_debugger.cpp msgid "Misc" -msgstr "" +msgstr "雜項" #: tools/editor/script_editor_debugger.cpp +#, fuzzy msgid "Clicked Control:" -msgstr "" +msgstr "點擊控制:" #: tools/editor/script_editor_debugger.cpp +#, fuzzy msgid "Clicked Control Type:" -msgstr "" +msgstr "點擊控制類型:" #: tools/editor/script_editor_debugger.cpp msgid "Live Edit Root:" @@ -6640,35 +6723,35 @@ msgstr "" #: tools/editor/settings_config_dialog.cpp msgid "Shortcuts" -msgstr "" +msgstr "捷徑" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Light Radius" -msgstr "" +msgstr "變更光源半徑" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Camera FOV" -msgstr "" +msgstr "變更鏡頭視野(FOV)" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Camera Size" -msgstr "" +msgstr "變更鏡頭尺寸" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Sphere Shape Radius" -msgstr "" +msgstr "變更球型半徑" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Box Shape Extents" -msgstr "" +msgstr "變更框型範圍" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Capsule Shape Radius" -msgstr "" +msgstr "變更楕圓體半徑" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Capsule Shape Height" -msgstr "" +msgstr "變更楕圓體高度" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Ray Shape Length" @@ -6677,3 +6760,15 @@ msgstr "" #: tools/editor/spatial_editor_gizmos.cpp msgid "Change Notifier Extents" msgstr "" + +#: tools/editor/spatial_editor_gizmos.cpp +#, fuzzy +msgid "Change Probe Extents" +msgstr "變更框型範圍" + +#~ msgid "" +#~ "Paths cannot start with '/', absolute paths must start with 'res://', " +#~ "'user://', or 'local://'" +#~ msgstr "" +#~ "路徑不可以\"/\"為起始,完整路徑需以'res://'、'user://'、或 'local://'做為" +#~ "起始" diff --git a/version.py b/version.py index d014a538c9..f0da206837 100644 --- a/version.py +++ b/version.py @@ -1,5 +1,5 @@ short_name = "godot" name = "Godot Engine" -major = 2 -minor = 2 +major = 3 +minor = 0 status = "alpha" |